-
Notifications
You must be signed in to change notification settings - Fork 0
/
11-es2015.e8a11d64cd79385fa53c.js
1 lines (1 loc) · 4.53 KB
/
11-es2015.e8a11d64cd79385fa53c.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{vx63:function(t,n,c){"use strict";c.r(n),c.d(n,"SampleFirstSecondModule",function(){return C});var e=c("An66"),i=c("1VvW"),a=c("5Q2+"),o=c("Vhhf"),s=c("zMYQ"),r=c("3kIJ"),l=c("mcff"),d=c("kZht"),b=c("hCLc"),u=c("EmXI"),f=c("Tcl6");function h(t,n){if(1&t&&(d.Vb(0,"mat-form-field"),d.Gc(1,"\n "),d.Qb(2,"input",4),d.Gc(3,"\n "),d.Ub()),2&t){const t=n.$implicit;d.Cb(2),d.pc("placeholder",t.key),d.oc("formControlName",t.key)}}function m(t,n){if(1&t&&(d.Vb(0,"form",2),d.Gc(1,"\n "),d.Ec(2,h,4,2,"mat-form-field",3),d.ic(3,"keyvalue"),d.Gc(4,"\n"),d.Ub()),2&t){const t=d.hc();d.oc("formGroup",t.form),d.Cb(2),d.oc("ngForOf",d.jc(3,2,t.data))}}let p=(()=>{class t{constructor(t,n,c){this.data=t,this.dialogRef=n,this.fb=c,this.form=null}ngOnInit(){this.form=this.fb.group(Object.assign(Object.assign({},this.data),{id:new r.d({value:this.data.id,disabled:!0})}))}save(){var t;this.dialogRef.close(null===(t=this.form)||void 0===t?void 0:t.getRawValue())}}return t.\u0275fac=function(n){return new(n||t)(d.Ob(l.a),d.Ob(l.d),d.Ob(r.c))},t.\u0275cmp=d.Ib({type:t,selectors:[["dialog-template"]],decls:8,vars:1,consts:[[3,"formGroup",4,"ngIf"],["mat-button","",1,"dialog-close",3,"click"],[3,"formGroup"],[4,"ngFor","ngForOf"],["matInput","",3,"placeholder","formControlName"]],template:function(t,n){1&t&&(d.Vb(0,"h3"),d.Gc(1,"Edit"),d.Ub(),d.Gc(2,"\n\n"),d.Ec(3,m,5,4,"form",0),d.Gc(4,"\n\n"),d.Vb(5,"button",1),d.dc("click",function(){return n.save()}),d.Gc(6,"Save"),d.Ub(),d.Gc(7,"\n")),2&t&&(d.Cb(3),d.oc("ngIf",n.form))},directives:[e.m,b.a,r.q,r.l,r.f,e.l,u.b,f.a,r.b,r.k,r.e],pipes:[e.g],encapsulation:2,changeDetection:0}),t})();var g=c("aJOL"),G=c("1ZKX"),k=c("BL99"),v=c("j5U8"),O=c("ctyY"),w=c("ydE+");function y(t,n){if(1&t&&d.Gc(0),2&t){const t=d.hc().$implicit;d.Hc(t)}}function V(t,n){1&t&&d.Gc(0),2&t&&d.Hc(n.$implicit)}function U(t,n){1&t&&(d.Vb(0,"ngx-column",7),d.Gc(1,"\n "),d.Ec(2,y,1,1,"ng-template",8),d.Gc(3,"\n "),d.Ec(4,V,1,1,"ng-template",9),d.Gc(5,"\n "),d.Ub()),2&t&&d.oc("key",n.$implicit)}function I(t,n){if(1&t){const t=d.Xb();d.Gc(0,"\n "),d.Vb(1,"button",10),d.dc("click",function(){d.xc(t);const c=n.$implicit;return d.hc().edit(c)}),d.Vb(2,"mat-icon"),d.Gc(3,"edit"),d.Ub(),d.Ub(),d.Gc(4,"\n "),d.Vb(5,"button",10),d.dc("click",function(){d.xc(t);const c=n.$implicit;return d.hc().delete(c)}),d.Vb(6,"mat-icon"),d.Gc(7,"delete"),d.Ub(),d.Ub(),d.Gc(8,"\n ")}}let x=(()=>{class t{constructor(t,n,c){this.cd=t,this.dialog=n,this.ngZone=c,this.data=[],this.idInterval=null}ngOnInit(){this.ngZone.runOutsideAngular(()=>{this.idInterval=window.setInterval(()=>{this.updateTable()},14500)})}ngOnDestroy(){window.clearInterval(this.idInterval)}add(){this.updateTable()}delete(t){this.data=this.data.filter(n=>n!==t),Object(o.e)(this.cd)}edit(t){this.ngZone.run(()=>{this.dialog.open(p,{data:t,width:"1024px"}).afterClosed().subscribe(t=>{Object(o.k)(t)&&(this.data=this.data.map(n=>n.id===t.id?Object.assign({},t):n),Object(o.e)(this.cd))})})}updateTable(){const t=this.data.length?Math.max(...this.data.map(t=>t.id)):0;s.a.generator(1,10,t).then(t=>{this.data=this.data.concat(t),this.cd.detectChanges()})}}return t.\u0275fac=function(n){return new(n||t)(d.Ob(d.h),d.Ob(l.b),d.Ob(d.B))},t.\u0275cmp=d.Ib({type:t,selectors:[["sample-first-second"]],decls:23,vars:2,consts:[[1,"simple-toolbar"],["mat-button","",1,"regenerate",3,"click"],[3,"source"],["table",""],[3,"key",4,"ngFor","ngForOf"],["custom-key","","key","action","sticky-end","","empty-head","","width","140"],["ngx-td","","row",""],[3,"key"],["ngx-th",""],["ngx-td",""],["mat-button","",1,"my-action",3,"click"]],template:function(t,n){if(1&t&&(d.Vb(0,"div"),d.Gc(1,"\n "),d.Vb(2,"mat-toolbar",0),d.Gc(3,"\n "),d.Vb(4,"span"),d.Gc(5,"Auto push"),d.Ub(),d.Gc(6,"\n\n "),d.Vb(7,"button",1),d.dc("click",function(){return n.add()}),d.Gc(8,"Add"),d.Ub(),d.Gc(9,"\n "),d.Ub(),d.Gc(10,"\n"),d.Ub(),d.Gc(11,"\n\n"),d.Vb(12,"ngx-table-builder",2,3),d.Gc(14,"\n "),d.Ec(15,U,6,1,"ngx-column",4),d.Gc(16,"\n\n "),d.Vb(17,"ngx-column",5),d.Gc(18,"\n "),d.Ec(19,I,9,0,"ng-template",6),d.Gc(20,"\n "),d.Ub(),d.Gc(21,"\n"),d.Ub(),d.Gc(22,"\n")),2&t){const t=d.wc(13);d.Cb(12),d.oc("source",n.data),d.Cb(3),d.oc("ngForOf",t.modelColumnKeys)}},directives:[g.a,b.a,G.a,e.l,k.a,v.a,O.a,w.a],encapsulation:2,changeDetection:0}),t})(),C=(()=>{class t{}return t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=d.Mb({type:t}),t.\u0275inj=d.Lb({imports:[[e.b,a.a,i.b.forChild([{path:"",component:x}])]]}),t})()}}]);