-
Notifications
You must be signed in to change notification settings - Fork 0
/
62.c41f2cae8b1bc83c.js
1 lines (1 loc) · 9.88 KB
/
62.c41f2cae8b1bc83c.js
1
"use strict";(self.webpackChunkcashwarden_web_ng=self.webpackChunkcashwarden_web_ng||[]).push([[62],{7062:(tt,f,s)=>{s.r(f),s.d(f,{TagModule:()=>q});var T=s(4815),v=s(655),t=s(4650),F=s(4968),N=s(9300),w=s(8372),G=s(7883),C=s(174),m=s(6895),x=s(545);function S(n,l){1&n&&t._UZ(0,"nz-skeleton")}let _=(()=>{class n extends G.$4{constructor(){super(...arguments),this.width=0,this.height=200,this.padding=0,this.data=[],this.clickItem=new t.vpe}initTagCloud(){const e=this.winG2;e.registerShape("point","cloud",{draw(o,a){const i=o.data,c=a.addShape({type:"text",name:"tag-cloud-text",attrs:{...o.style,fontSize:i.size,text:i.text,textAlign:"center",fontFamily:i.font,fill:o.color,textBaseline:"Alphabetic",x:o.x,y:o.y}});return i.rotate&&e.Util.rotate(c,i.rotate*Math.PI/180),c}})}install(){this.initTagCloud();const{el:e,padding:o,theme:a}=this;0===this.height&&(this.height=this.el.nativeElement.clientHeight),0===this.width&&(this.width=this.el.nativeElement.clientWidth);const i=this._chart=new this.winG2.Chart({container:e.nativeElement,autoFit:!1,padding:o,height:this.height,width:this.width,theme:a});i.scale({x:{nice:!1},y:{nice:!1}}),i.legend(!1),i.axis(!1),i.tooltip({showTitle:!1,showMarkers:!1}),i.coordinate().reflect(),i.point().position("x*y").color("text").shape("cloud").state({active:{style:{fillOpacity:.4}}}),i.interaction("element-active"),i.on("tag-cloud-text:click",c=>{this.ngZone.run(()=>this.clickItem.emit({item:c.data?.data,ev:c}))}),this.ready.next(i),this.changeData(),i.render()}changeData(){const{_chart:e,data:o}=this;if(!e||!Array.isArray(o)||o.length<=0)return;const a=(new window.DataSet.View).source(o),i=a.range("value"),c=i[0],V=i[1];a.transform({type:"tag-cloud",fields:["name","value"],font:"Verdana",size:[this.width,this.height],padding:0,timeInterval:5e3,rotate(){let r=~~(4*Math.random())%4;return 2===r&&(r=0),90*r},fontSize:r=>(r.value-c)/(V-c)*24+8}),e.changeData(a.rows)}installResizeEvent(){this.resize$=(0,F.R)(window,"resize").pipe((0,N.h)(()=>!!this._chart),(0,w.b)(200)).subscribe(()=>this.changeData())}onInit(){this.installResizeEvent()}}return n.\u0275fac=function(){let l;return function(o){return(l||(l=t.n5z(n)))(o||n)}}(),n.\u0275cmp=t.Xpm({type:n,selectors:[["g2-tag-cloud"]],inputs:{width:"width",height:"height",padding:"padding",data:"data"},outputs:{clickItem:"clickItem"},exportAs:["g2TagCloud"],features:[t.qOj],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(e,o){1&e&&t.YNc(0,S,1,0,"nz-skeleton",0),2&e&&t.Q6J("ngIf",!o.loaded)},dependencies:[m.O5,x.ng],encapsulation:2,changeDetection:0}),(0,v.gn)([(0,C.Rn)()],n.prototype,"width",void 0),(0,v.gn)([(0,C.Rn)()],n.prototype,"height",void 0),n})(),Y=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[m.ez,x.H0]}),n})();var D=s(8418),z=s(4788),p=s(6152),y=s(5156),u=s(6616),g=s(7044),h=s(1811),d=s(9094);function L(n,l){if(1&n&&t._UZ(0,"g2-tag-cloud",6),2&n){const e=t.oxw();t.Q6J("data",e.list)}}function Q(n,l){1&n&&t._UZ(0,"nz-empty",7)}let Z=(()=>{class n{constructor(e){this.modal=e,this.list=[]}close(){this.modal.destroy()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.Lf))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-tag-cloud"]],decls:10,vars:8,consts:[[1,"modal-header"],[1,"modal-title"],["height","400",3,"data",4,"ngIf"],["nzNotFoundImage","simple",4,"ngIf"],[1,"modal-footer"],["nz-button","","type","button",3,"click"],["height","400",3,"data"],["nzNotFoundImage","simple"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._uU(2),t.ALo(3,"i18n"),t.qZA()(),t.YNc(4,L,1,1,"g2-tag-cloud",2),t.YNc(5,Q,1,0,"nz-empty",3),t.TgZ(6,"div",4)(7,"button",5),t.NdJ("click",function(){return o.close()}),t._uU(8),t.ALo(9,"i18n"),t.qZA()()),2&e&&(t.xp6(2),t.Oqu(t.lcZ(3,4,"app.tag.cloud")),t.xp6(2),t.Q6J("ngIf",o.list.length),t.xp6(1),t.Q6J("ngIf",!o.list.length),t.xp6(3),t.Oqu(t.lcZ(9,6,"app.form.close")))},dependencies:[m.O5,u.ix,g.w,h.dQ,_,z.p9,d.Ck],encapsulation:2}),n})();var A=s(9651),I=s(9959);function U(n,l){1&n&&(t.TgZ(0,"div",7),t._uU(1),t.ALo(2,"i18n"),t.qZA()),2&n&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"app.tag.update"),""))}function k(n,l){1&n&&(t.TgZ(0,"div",7),t._uU(1),t.ALo(2,"i18n"),t.qZA()),2&n&&(t.xp6(1),t.Oqu(t.lcZ(2,1,"app.tag.create")))}s(9553);let M=(()=>{class n{constructor(e,o,a,i,c){this.modal=e,this.msg=o,this.http=a,this.cdr=i,this.i18n=c,this.record={},this.schema={properties:{name:{type:"string",title:this.i18n.fanyi("app.tag.name")}},required:["name"]},this.ui={"*":{spanLabelFixed:100,grid:{span:24}}}}save(e){this.http.request(this.record&&this.record.id?"put":"post","/api/tags"+(this.record&&this.record.id?`/${this.record.id}`:""),{body:e}).subscribe(i=>{i.code||(this.msg.success(this.i18n.fanyi("app.form.save-success")),this.modal.close(!0))})}close(){this.modal.destroy()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.Lf),t.Y36(A.dD),t.Y36(d.lP),t.Y36(t.sBO),t.Y36(d.Oi))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-tag-form"]],decls:12,vars:14,consts:[[1,"modal-header"],["class","modal-title",4,"ngIf"],["mode","edit",3,"schema","ui","formData","button"],["sf",""],[1,"modal-footer"],["nz-button","","type","button",3,"click"],["nz-button","","type","submit","nzType","primary",3,"disabled","nzLoading","click"],[1,"modal-title"]],template:function(e,o){if(1&e){const a=t.EpF();t.TgZ(0,"div",0),t.YNc(1,U,3,3,"div",1),t.YNc(2,k,3,3,"div",1),t.qZA(),t.TgZ(3,"sf",2,3)(5,"div",4)(6,"button",5),t.NdJ("click",function(){return o.close()}),t._uU(7),t.ALo(8,"i18n"),t.qZA(),t.TgZ(9,"button",6),t.NdJ("click",function(){t.CHM(a);const c=t.MAs(4);return t.KtG(o.save(c.value))}),t._uU(10),t.ALo(11,"i18n"),t.qZA()()()}if(2&e){const a=t.MAs(4);t.xp6(1),t.Q6J("ngIf",null==o.record?null:o.record.id),t.xp6(1),t.Q6J("ngIf",!(null!=o.record&&o.record.id)),t.xp6(1),t.Q6J("schema",o.schema)("ui",o.ui)("formData",o.record)("button","none"),t.xp6(4),t.Oqu(t.lcZ(8,10,"app.form.close")),t.xp6(2),t.Q6J("disabled",!a.valid)("nzLoading",o.http.loading),t.xp6(1),t.hij(" ",t.lcZ(11,12,"app.form.save")," ")}},dependencies:[m.O5,I.kJ,u.ix,g.w,h.dQ,d.Ck],encapsulation:2}),n})();var b=s(3679),R=s(1971),E=s(6497),$=s(1102);function B(n,l){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw().$implicit,i=t.oxw();return t.KtG(i.form(a))}),t._uU(1),t.qZA(),t.TgZ(2,"span",12),t._uU(3),t.ALo(4,"i18n"),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.name),t.xp6(2),t.AsE("(",e.value," ",t.lcZ(4,3,"app.tag.times"),")")}}function P(n,l){if(1&n){const e=t.EpF();t.TgZ(0,"span",13)(1,"i",14),t.NdJ("click",function(){t.CHM(e);const a=t.oxw().$implicit,i=t.oxw();return t.KtG(i.form(a))}),t.qZA()(),t.TgZ(2,"span",13)(3,"i",15),t.NdJ("nzOnConfirm",function(){t.CHM(e);const a=t.oxw().$implicit,i=t.oxw();return t.KtG(i.delete(a))}),t.ALo(4,"i18n"),t.qZA()()}2&n&&(t.xp6(3),t.Q6J("nz-popconfirm",t.lcZ(4,1,"app.delete.confirm")))}function j(n,l){if(1&n&&(t.TgZ(0,"g2-card",8),t.YNc(1,B,5,5,"ng-template",null,9,t.W1O),t.YNc(3,P,5,3,"ng-template",null,10,t.W1O),t.qZA()),2&n){const e=l.$implicit,o=t.MAs(2),a=t.MAs(4);t.Q6J("title",o)("bordered",!0)("total",e.currency_balance_desc)("action",a)}}const H=function(){return{xs:6,sm:16,md:24,lg:32}},K=function(){return{gutter:24,lg:8,md:12,sm:24,xs:24}};let J=(()=>{class n{constructor(e,o,a,i,c){this.http=e,this.msg=o,this.modal=a,this.cdr=i,this.i18n=c,this.url="/api/tags",this.loading=!0,this.list=[],this.q={all:1,name:""},this.searchSchema={properties:{name:{type:"string",title:this.i18n.fanyi("app.tag.name")}}}}ngOnInit(){this.index()}index(){this.loading=!0,this.http.get(`${this.url}`,this.q).subscribe(e=>{this.list=e.map(o=>({value:o.count,name:o.name,id:o.id})),this.loading=!1,this.cdr.detectChanges()})}form(e){this.modal.create(M,{record:e},{size:"md"}).subscribe(()=>{this.index()})}cloud(){this.modal.create(Z,{list:this.list},{size:"md"}).subscribe(()=>{})}delete(e){this.http.delete(`/api/tags/${e.id}`).subscribe(o=>{o.code||this.msg.success(this.i18n.fanyi("app.delete.success")),this.index()})}submit(e){e.name&&(this.q.name=e.name,this.index())}reset(){this.q.name="",this.index()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(d.lP),t.Y36(A.dD),t.Y36(d.Te),t.Y36(t.sBO),t.Y36(d.Oi))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-tag-index"]],decls:15,vars:14,consts:[[1,"pt-md"],["nz-row","",3,"nzGutter"],["nz-col",""],["mode","search",3,"schema","formSubmit","formReset"],["nz-button","","nzType","primary",3,"click"],["nz-button","",3,"click"],[3,"nzDataSource","nzLoading","nzRenderItem","nzGrid"],["item",""],[3,"title","bordered","total","action"],["title",""],["action",""],[1,"text-md",3,"click"],[1,"text-sm","text-muted","pl-sm"],[1,"pl-sm"],["nz-icon","","nzType","edit",3,"click"],["nz-icon","","nzType","delete","nzPopconfirmPlacement","bottom",3,"nz-popconfirm","nzOnConfirm"]],template:function(e,o){if(1&e&&(t.TgZ(0,"div",0)(1,"nz-card")(2,"div",1)(3,"div",2)(4,"sf",3),t.NdJ("formSubmit",function(i){return o.submit(i)})("formReset",function(){return o.reset()}),t.qZA()(),t.TgZ(5,"div",2)(6,"button",4),t.NdJ("click",function(){return o.form()}),t._uU(7),t.ALo(8,"i18n"),t.qZA(),t.TgZ(9,"button",5),t.NdJ("click",function(){return o.cloud()}),t._uU(10),t.ALo(11,"i18n"),t.qZA()()()()(),t.TgZ(12,"nz-list",6),t.YNc(13,j,5,4,"ng-template",null,7,t.W1O),t.qZA()),2&e){const a=t.MAs(14);t.xp6(2),t.Q6J("nzGutter",t.DdM(12,H)),t.xp6(2),t.Q6J("schema",o.searchSchema),t.xp6(3),t.Oqu(t.lcZ(8,8,"app.form.create")),t.xp6(3),t.Oqu(t.lcZ(11,10,"app.tag.cloud")),t.xp6(2),t.Q6J("nzDataSource",o.list)("nzLoading",o.loading)("nzRenderItem",a)("nzGrid",t.DdM(13,K))}},dependencies:[I.kJ,b.t3,b.SK,u.ix,g.w,h.dQ,R.bd,E.JW,$.Ls,p.n_,p.fl,T.n,d.Ck],encapsulation:2}),n})();var O=s(9132);const W=[{path:"index",component:J}];let X=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[O.Bz.forChild(W),O.Bz]}),n})(),q=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[D.m8,X,Y,z.Xo,p.Ph,T.T]}),n})()}}]);