-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path947.b687e9adac5ad0b6.js
1 lines (1 loc) · 16.9 KB
/
947.b687e9adac5ad0b6.js
1
"use strict";(self.webpackChunkemporium=self.webpackChunkemporium||[]).push([[947],{8947:(h,p,r)=>{r.r(p),r.d(p,{CustomersModule:()=>G,routes:()=>C});var u=r(6019),Z=r(697),i=r(9133),f=r(9165),d=r(8265),s=r(5304),e=r(3668),T=r(2605),g=r(515),A=r(8167),v=r(138),N=r(6400),y=r(6731),q=r(86);function U(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"First name is required"),e.qZA())}function _(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"Last name is required"),e.qZA())}function b(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"Username is required"),e.qZA())}function I(t,l){if(1&t&&(e.TgZ(0,"mat-option",15),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.qZA()),2&t){const a=l.$implicit;e.Q6J("value",a.id),e.xp6(2),e.Oqu(a.name)}}function x(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"First name is required"),e.qZA())}function S(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"Last name is required"),e.qZA())}function P(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"Email is required"),e.qZA())}function F(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"Phone is required"),e.qZA())}function J(t,l){if(1&t&&(e.TgZ(0,"mat-option",15),e._uU(1),e.qZA()),2&t){const a=l.$implicit;e.Q6J("value",a),e.xp6(1),e.hij(" ",a.name," ")}}function L(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"Country is required"),e.qZA())}function w(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"City is required"),e.qZA())}function B(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"Zip/Postal Code is required"),e.qZA())}function D(t,l){1&t&&(e.TgZ(0,"mat-error"),e._uU(1,"Address is required"),e.qZA())}let Y=(()=>{class t{constructor(a,o,n){this.dialogRef=a,this.data=o,this.fb=n}ngOnInit(){this.form=this.fb.group({id:0,username:["",i.kI.required],email:null,firstName:["",i.kI.required],lastName:["",i.kI.required],middleName:null,storeId:null,walletBalance:null,revenue:null,billing:this.fb.group({firstName:["",i.kI.required],lastName:["",i.kI.required],middleName:"",company:"",email:["",i.kI.required],phone:["",i.kI.required],country:["",i.kI.required],city:["",i.kI.required],state:"",zip:["",i.kI.required],address:["",i.kI.required]})}),this.data.customer&&this.form.patchValue(this.data.customer)}onSubmit(){console.log(this.form.value),this.form.valid&&this.dialogRef.close(this.form.value)}compareFunction(a,o){return a.name==o.name&&a.code==o.code}}return t.\u0275fac=function(a){return new(a||t)(e.Y36(s.so),e.Y36(s.WI),e.Y36(i.qu))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-customer-dialog"]],decls:127,vars:15,consts:[["mat-dialog-title",""],["autocomplete","off",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"tab-content-wrapped"],["label","General Info"],["fxLayout","row wrap",1,"mt-2"],["fxFlex","100","fxFlex.gt-sm","33.3",1,"px-1"],["appearance","outline",1,"w-100"],["matInput","","placeholder","First name","formControlName","firstName","required",""],[4,"ngIf"],["matInput","","placeholder","Last name","formControlName","lastName","required",""],["matInput","","placeholder","Middle Name/Initial","formControlName","middleName"],["matInput","","placeholder","Username","formControlName","username","required",""],["matInput","","placeholder","Email","formControlName","email"],["formControlName","storeId"],[3,"value"],[3,"value",4,"ngFor","ngForOf"],["matInput","","formControlName","walletBalance"],["matInput","","formControlName","revenue"],["label","Billing","formGroupName","billing"],["matInput","","placeholder","Company","formControlName","company"],["matInput","","placeholder","Email","formControlName","email","required",""],["matInput","","placeholder","Phone","formControlName","phone","required",""],["fxFlex","100","fxFlex.gt-sm","25",1,"px-1"],["placeholder","Country","formControlName","country","required","",3,"compareWith"],["matInput","","placeholder","City","formControlName","city","required",""],["matInput","","placeholder","State/Province","formControlName","state"],["matInput","","placeholder","Zip/Postal Code","formControlName","zip","required",""],["fxFlex","100",1,"px-1"],["matInput","","placeholder","Address (street, apartment, suite, unit etc.)","formControlName","address","required",""],["mat-dialog-actions",""],["fxLayout","row","fxLayoutAlign","space-between center",1,"w-100"],["mat-raised-button","","color","warn","type","button","mat-dialog-close",""],["mat-raised-button","","color","primary","type","submit"]],template:function(a,o){1&a&&(e.TgZ(0,"h1",0),e._uU(1,"Customer"),e.qZA(),e.TgZ(2,"form",1),e.NdJ("ngSubmit",function(){return o.onSubmit()}),e.TgZ(3,"div",2),e.TgZ(4,"mat-tab-group",3),e.TgZ(5,"mat-tab",4),e.TgZ(6,"div",5),e.TgZ(7,"div",6),e.TgZ(8,"mat-form-field",7),e.TgZ(9,"mat-label"),e._uU(10,"First name"),e.qZA(),e._UZ(11,"input",8),e.YNc(12,U,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(13,"div",6),e.TgZ(14,"mat-form-field",7),e.TgZ(15,"mat-label"),e._uU(16,"Last name"),e.qZA(),e._UZ(17,"input",10),e.YNc(18,_,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(19,"div",6),e.TgZ(20,"mat-form-field",7),e.TgZ(21,"mat-label"),e._uU(22,"Middle Name/Initial"),e.qZA(),e._UZ(23,"input",11),e.qZA(),e.qZA(),e.TgZ(24,"div",6),e.TgZ(25,"mat-form-field",7),e.TgZ(26,"mat-label"),e._uU(27,"Username"),e.qZA(),e._UZ(28,"input",12),e.YNc(29,b,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(30,"div",6),e.TgZ(31,"mat-form-field",7),e.TgZ(32,"mat-label"),e._uU(33,"Email"),e.qZA(),e._UZ(34,"input",13),e.qZA(),e.qZA(),e.TgZ(35,"div",6),e.TgZ(36,"mat-form-field",7),e.TgZ(37,"mat-label"),e._uU(38,"Store"),e.qZA(),e.TgZ(39,"mat-select",14),e.TgZ(40,"mat-option",15),e._uU(41,"-"),e.qZA(),e.YNc(42,I,3,2,"mat-option",16),e.qZA(),e.qZA(),e.qZA(),e.TgZ(43,"div",6),e.TgZ(44,"mat-form-field",7),e.TgZ(45,"mat-label"),e._uU(46,"Wallet Balance ($)"),e.qZA(),e._UZ(47,"input",17),e.qZA(),e.qZA(),e.TgZ(48,"div",6),e.TgZ(49,"mat-form-field",7),e.TgZ(50,"mat-label"),e._uU(51,"Revenue ($)"),e.qZA(),e._UZ(52,"input",18),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(53,"mat-tab",19),e.TgZ(54,"div",5),e.TgZ(55,"div",6),e.TgZ(56,"mat-form-field",7),e.TgZ(57,"mat-label"),e._uU(58,"First name"),e.qZA(),e._UZ(59,"input",8),e.YNc(60,x,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(61,"div",6),e.TgZ(62,"mat-form-field",7),e.TgZ(63,"mat-label"),e._uU(64,"Last name"),e.qZA(),e._UZ(65,"input",10),e.YNc(66,S,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(67,"div",6),e.TgZ(68,"mat-form-field",7),e.TgZ(69,"mat-label"),e._uU(70,"Middle Name/Initial"),e.qZA(),e._UZ(71,"input",11),e.qZA(),e.qZA(),e.TgZ(72,"div",6),e.TgZ(73,"mat-form-field",7),e.TgZ(74,"mat-label"),e._uU(75,"Company"),e.qZA(),e._UZ(76,"input",20),e.qZA(),e.qZA(),e.TgZ(77,"div",6),e.TgZ(78,"mat-form-field",7),e.TgZ(79,"mat-label"),e._uU(80,"Email"),e.qZA(),e._UZ(81,"input",21),e.YNc(82,P,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(83,"div",6),e.TgZ(84,"mat-form-field",7),e.TgZ(85,"mat-label"),e._uU(86,"Phone"),e.qZA(),e._UZ(87,"input",22),e.YNc(88,F,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(89,"div",23),e.TgZ(90,"mat-form-field",7),e.TgZ(91,"mat-label"),e._uU(92,"Country"),e.qZA(),e.TgZ(93,"mat-select",24),e.TgZ(94,"mat-option",15),e._uU(95,"-"),e.qZA(),e.YNc(96,J,2,2,"mat-option",16),e.qZA(),e.YNc(97,L,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(98,"div",23),e.TgZ(99,"mat-form-field",7),e.TgZ(100,"mat-label"),e._uU(101,"City"),e.qZA(),e._UZ(102,"input",25),e.YNc(103,w,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(104,"div",23),e.TgZ(105,"mat-form-field",7),e.TgZ(106,"mat-label"),e._uU(107,"State/Province"),e.qZA(),e._UZ(108,"input",26),e.qZA(),e.qZA(),e.TgZ(109,"div",23),e.TgZ(110,"mat-form-field",7),e.TgZ(111,"mat-label"),e._uU(112,"Zip/Postal Code"),e.qZA(),e._UZ(113,"input",27),e.YNc(114,B,2,0,"mat-error",9),e.qZA(),e.qZA(),e.TgZ(115,"div",28),e.TgZ(116,"mat-form-field",7),e.TgZ(117,"mat-label"),e._uU(118,"Address"),e.qZA(),e._UZ(119,"input",29),e.YNc(120,D,2,0,"mat-error",9),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(121,"div",30),e.TgZ(122,"div",31),e.TgZ(123,"button",32),e._uU(124,"Close"),e.qZA(),e.TgZ(125,"button",33),e._uU(126,"Save"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&a&&(e.xp6(2),e.Q6J("formGroup",o.form),e.xp6(10),e.Q6J("ngIf",null==o.form.controls.firstName.errors?null:o.form.controls.firstName.errors.required),e.xp6(6),e.Q6J("ngIf",null==o.form.controls.lastName.errors?null:o.form.controls.lastName.errors.required),e.xp6(11),e.Q6J("ngIf",null==o.form.controls.username.errors?null:o.form.controls.username.errors.required),e.xp6(13),e.Q6J("ngForOf",o.data.stores),e.xp6(18),e.Q6J("ngIf",null==o.form.get("billing").controls.firstName.errors?null:o.form.get("billing").controls.firstName.errors.required),e.xp6(6),e.Q6J("ngIf",null==o.form.get("billing").controls.lastName.errors?null:o.form.get("billing").controls.lastName.errors.required),e.xp6(16),e.Q6J("ngIf",null==o.form.get("billing").controls.email.errors?null:o.form.get("billing").controls.email.errors.required),e.xp6(6),e.Q6J("ngIf",null==o.form.get("billing").controls.phone.errors?null:o.form.get("billing").controls.phone.errors.required),e.xp6(5),e.Q6J("compareWith",o.compareFunction),e.xp6(3),e.Q6J("ngForOf",o.data.countries),e.xp6(1),e.Q6J("ngIf",null==o.form.get("billing").controls.country.errors?null:o.form.get("billing").controls.country.errors.required),e.xp6(6),e.Q6J("ngIf",null==o.form.get("billing").controls.city.errors?null:o.form.get("billing").controls.city.errors.required),e.xp6(11),e.Q6J("ngIf",null==o.form.get("billing").controls.zip.errors?null:o.form.get("billing").controls.zip.errors.required),e.xp6(6),e.Q6J("ngIf",null==o.form.get("billing").controls.address.errors?null:o.form.get("billing").controls.address.errors.required))},directives:[s.uh,i._Y,i.JL,i.sg,s.xY,T.SP,T.uX,g.xw,g.yH,A.KE,A.hX,v.Nt,i.Fj,i.JJ,i.u,i.Q7,u.O5,N.gD,y.ey,u.sg,i.x0,s.H8,g.Wh,q.lW,s.ZT,A.TO],styles:[""]}),t})();var z=r(3327);const Q=[{id:1,username:"bruno.v",email:"[email protected]",firstName:"Bruno",lastName:"Vespa",middleName:"",storeId:2,walletBalance:5255,revenue:3450,billing:{firstName:"Bruno",lastName:"Vespa",middleName:"",company:"Company 1",email:"[email protected]",phone:"(415) 231-0332",country:{name:"United States",code:"US"},city:"Los Angeles",state:"California",zip:"90201",address:"Palos Verdes Peninsula"}},{id:2,username:"andy.79",email:"[email protected]",firstName:"Andy",lastName:"Warhol",middleName:"",storeId:1,walletBalance:8055,revenue:7200,billing:{firstName:"Andy",lastName:"Warhol",middleName:"",company:"Company 1",email:"[email protected]",phone:"(212) 457-2308",country:{name:"United States",code:"US"},city:"Los Angeles",state:"California",zip:"90201",address:"Palos Verdes Peninsula"}},{id:3,username:"pretty",email:"[email protected]",firstName:"Ashley",lastName:"Ahlberg",middleName:"",storeId:1,walletBalance:17200,revenue:2200,billing:{firstName:"Ashley",lastName:"Ahlberg",middleName:"",company:"Company 5",email:"[email protected]",phone:"(212) 457-2308",country:{name:"United States",code:"US"},city:"Los Angeles",state:"California",zip:"90201",address:"Palos Verdes Peninsula"}},{id:4,username:"julia.a",email:"[email protected]",firstName:"Julia",lastName:"Aniston",middleName:"",storeId:2,walletBalance:9480,revenue:1470,billing:{firstName:"Julia",lastName:"Aniston",middleName:"",company:"Company 5",email:"[email protected]",phone:"(212) 457-2308",country:{name:"United States",code:"US"},city:"Los Angeles",state:"California",zip:"90201",address:"Palos Verdes Peninsula"}},{id:5,username:"lusia.m",email:"[email protected]",firstName:"Lusia",lastName:"Manuel",middleName:"",storeId:1,walletBalance:6200,revenue:3250,billing:{firstName:"Lusia",lastName:"Manuel",middleName:"",company:"Company 4",email:"[email protected]",phone:"(212) 457-2308",country:{name:"United States",code:"US"},city:"Los Angeles",state:"California",zip:"90201",address:"Palos Verdes Peninsula"}},{id:6,username:"adam.s",email:"[email protected]",firstName:"Adam",lastName:"Sandler",middleName:"",storeId:2,walletBalance:7580,revenue:2950,billing:{firstName:"Adam",lastName:"Sandler",middleName:"",company:"Company 1",email:"[email protected]",phone:"(212) 457-2308",country:{name:"United States",code:"US"},city:"Los Angeles",state:"California",zip:"90201",address:"Palos Verdes Peninsula"}},{id:7,username:"tereza.s",email:"[email protected]",firstName:"Tereza",lastName:"Stiles",middleName:"",storeId:2,walletBalance:5240,revenue:1095,billing:{firstName:"Tereza",lastName:"Stiles",middleName:"",company:"Company 3",email:"[email protected]",phone:"(212) 457-2308",country:{name:"United States",code:"US"},city:"Los Angeles",state:"California",zip:"90201",address:"Palos Verdes Peninsula"}},{id:8,username:"michael.b",email:"[email protected]",firstName:"Michael",lastName:"Blair",middleName:"",storeId:2,walletBalance:7340,revenue:4580,billing:{firstName:"Michael",lastName:"Blair",middleName:"",company:"Company 3",email:"[email protected]",phone:"(212) 457-2308",country:{name:"United States",code:"US"},city:"Los Angeles",state:"California",zip:"90201",address:"Palos Verdes Peninsula"}}];var M=r(8198),O=r(8036),E=r(888),W=r(5694),V=r(7444),H=r(9112),$=r(8583);function j(t,l){if(1&t){const a=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"div",10),e._uU(2),e.qZA(),e.TgZ(3,"div",10),e._uU(4),e.qZA(),e.TgZ(5,"div",10),e._uU(6),e.qZA(),e.TgZ(7,"div",10),e._uU(8),e.ALo(9,"filterById"),e.qZA(),e.TgZ(10,"div",10),e._uU(11),e.qZA(),e.TgZ(12,"div",10),e._uU(13),e.qZA(),e.TgZ(14,"div",10),e.TgZ(15,"div",11),e.TgZ(16,"button",12),e.NdJ("click",function(){const m=e.CHM(a).$implicit;return e.oxw().openCustomerDialog(m)}),e.TgZ(17,"mat-icon"),e._uU(18,"edit"),e.qZA(),e.qZA(),e.TgZ(19,"button",13),e.NdJ("click",function(){const m=e.CHM(a).$implicit;return e.oxw().remove(m)}),e.TgZ(20,"mat-icon"),e._uU(21,"delete"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&t){const a=l.$implicit,o=e.oxw();let n;e.xp6(2),e.AsE("",a.firstName," ",a.lastName,""),e.xp6(2),e.Oqu(a.username),e.xp6(2),e.Oqu(a.email),e.xp6(2),e.Oqu(null==(n=e.xi3(9,7,o.stores,a.storeId))?null:n.name),e.xp6(3),e.hij("$",a.walletBalance.toFixed(2),""),e.xp6(2),e.hij("$",a.revenue.toFixed(2),"")}}function R(t,l){if(1&t){const a=e.EpF();e.TgZ(0,"div",14),e.TgZ(1,"div",15),e.TgZ(2,"mat-card",16),e.TgZ(3,"pagination-controls",17),e.NdJ("pageChange",function(n){return e.CHM(a),e.oxw().onPageChanged(n)}),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}const X=function(t,l){return{itemsPerPage:t,currentPage:l}},C=[{path:"",component:(()=>{class t{constructor(a,o,n){this.appService=a,this.dialog=o,this.appSettings=n,this.customers=[],this.stores=[{id:1,name:"Store 1"},{id:2,name:"Store 2"}],this.countries=[],this.count=6,this.settings=this.appSettings.settings}ngOnInit(){this.countries=this.appService.getCountries(),this.customers=Q}onPageChanged(a){this.page=a,window.scrollTo(0,0)}openCustomerDialog(a){this.dialog.open(Y,{data:{customer:a,stores:this.stores,countries:this.countries},panelClass:["theme-dialog"],autoFocus:!1,direction:this.settings.rtl?"rtl":"ltr"}).afterClosed().subscribe(n=>{if(n){const m=this.customers.findIndex(c=>c.id==n.id);-1!==m?this.customers[m]=n:(n.id=this.customers[this.customers.length-1].id+1,this.customers.push(n))}})}remove(a){this.dialog.open(z.$,{maxWidth:"400px",data:{title:"Confirm Action",message:"Are you sure you want remove this customer?"}}).afterClosed().subscribe(n=>{if(n){const m=this.customers.indexOf(a);-1!==m&&this.customers.splice(m,1)}})}}return t.\u0275fac=function(a){return new(a||t)(e.Y36(M.z),e.Y36(s.uw),e.Y36(O.d))},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-customers"]],decls:26,vars:8,consts:[[1,"p-1"],[1,"p-0"],["fxLayout","row wrap","fxLayoutAlign","space-between center",1,"w-100","p-2"],["mat-raised-button","","color","primary",3,"click"],[1,"mat-table","admin-table"],[1,"mat-header-row"],[1,"mat-header-cell"],["class","mat-row",4,"ngFor","ngForOf"],["fxLayout","row wrap",4,"ngIf"],[1,"mat-row"],[1,"mat-cell"],[1,"p-1","actions"],["mat-mini-fab","","color","primary","matTooltip","Edit",3,"click"],["mat-mini-fab","","color","warn","matTooltip","Delete",1,"mx-1",3,"click"],["fxLayout","row wrap"],["fxFlex","100"],[1,"p-0","text-center"],["autoHide","true","maxSize","5",1,"product-pagination",3,"pageChange"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e.TgZ(1,"mat-card",1),e.TgZ(2,"div",2),e.TgZ(3,"h2"),e._uU(4,"Customers List"),e.qZA(),e.TgZ(5,"button",3),e.NdJ("click",function(){return o.openCustomerDialog(null)}),e._uU(6,"Add Customer"),e.qZA(),e.qZA(),e._UZ(7,"mat-divider"),e.TgZ(8,"div",4),e.TgZ(9,"div",5),e.TgZ(10,"div",6),e._uU(11,"Full Name"),e.qZA(),e.TgZ(12,"div",6),e._uU(13,"Username"),e.qZA(),e.TgZ(14,"div",6),e._uU(15,"Email"),e.qZA(),e.TgZ(16,"div",6),e._uU(17,"Store"),e.qZA(),e.TgZ(18,"div",6),e._uU(19,"Wallet Balance"),e.qZA(),e.TgZ(20,"div",6),e._uU(21,"Revenue"),e.qZA(),e._UZ(22,"div",6),e.qZA(),e.YNc(23,j,22,10,"div",7),e.ALo(24,"paginate"),e.qZA(),e.qZA(),e.YNc(25,R,4,0,"div",8),e.qZA()),2&a&&(e.xp6(23),e.Q6J("ngForOf",e.xi3(24,2,o.customers,e.WLB(5,X,o.count,o.page))),e.xp6(2),e.Q6J("ngIf",o.customers.length>0))},directives:[E.a8,g.xw,g.Wh,q.lW,W.d,u.sg,u.O5,V.gM,H.Hw,g.yH,d.LS],pipes:[d._s,$.H],styles:[""]}),t})(),pathMatch:"full"}];let G=(()=>{class t{}return t.\u0275fac=function(a){return new(a||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({imports:[[u.ez,Z.Bz.forChild(C),i.UX,f.m,d.JX]]}),t})()},8583:(h,p,r)=>{r.d(p,{H:()=>Z});var u=r(3668);let Z=(()=>{class i{transform(d,s){return d.filter(e=>e.id==s)[0]}}return i.\u0275fac=function(d){return new(d||i)},i.\u0275pipe=u.Yjl({name:"filterById",type:i,pure:!0}),i})()}}]);