@knoflows/engine 0.1.0 → 0.1.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine.js +19 -19
- package/dist/migrations/20260921193000_local_repo_remote/migration.sql +3 -0
- package/dist/migrations/20260921193000_local_repo_remote/snapshot.json +1378 -0
- package/package.json +1 -1
- package/static/assets/i18n/en.json +14 -0
- package/static/assets/i18n/es.json +14 -0
- package/static/{chunk-BRZ5T52h.js → chunk-1s-6iZs8.js} +1 -1
- package/static/{chunk-DSgUAlqN.js → chunk-8INlEe9b.js} +1 -1
- package/static/chunk-96ta9Sdz.js +1 -0
- package/static/{chunk-7NTQwN96.js → chunk-9I0-e_3z.js} +1 -1
- package/static/{chunk-BcQQgpKh.js → chunk-B3UE2A3I.js} +1 -1
- package/static/chunk-BDDp2BQi.js +1 -0
- package/static/{chunk-Dx92ksvP.js → chunk-BJVGVLQp.js} +1 -1
- package/static/{chunk-VXZaUyyE.js → chunk-BZBN-IEB.js} +1 -1
- package/static/{chunk-CRGkNzel.js → chunk-Bayax3su.js} +2 -2
- package/static/chunk-BbtIjpMQ.js +5 -0
- package/static/{chunk-BCHj6l85.js → chunk-BgIY3xBH.js} +1 -1
- package/static/{chunk-CPNxRF7A.js → chunk-BrckDrlX.js} +1 -1
- package/static/{chunk-CuwZV6XG.js → chunk-Ce3aSFve.js} +1 -1
- package/static/{chunk-DvWh-Q5D.js → chunk-CepRGzVJ.js} +1 -1
- package/static/{chunk-DEF7Ge5B.js → chunk-CqhV23s2.js} +1 -1
- package/static/{chunk-C9PkSfMb.js → chunk-CsJt5dbK.js} +1 -1
- package/static/{chunk-BrP_q6LZ.js → chunk-CtFtOXy4.js} +1 -1
- package/static/{chunk-BIdwV0jx.js → chunk-CuBg4N16.js} +1 -1
- package/static/chunk-D-L7yklF.js +1 -0
- package/static/{chunk-ZqQUQSE8.js → chunk-DDkLmxql.js} +1 -1
- package/static/{chunk-DAONFRT8.js → chunk-DF1Zujdm.js} +1 -1
- package/static/{chunk-Dg-4XevL.js → chunk-DFHhTmIq.js} +1 -1
- package/static/{chunk-Bv1r1Ly-.js → chunk-DKjiFhsx.js} +1 -1
- package/static/{chunk-hpn_m1ZC.js → chunk-DP75g4hD.js} +1 -1
- package/static/chunk-DX21GXyA.js +1 -0
- package/static/{chunk-Ysn4Fbgj.js → chunk-DaP135hJ.js} +1 -1
- package/static/{chunk-B_R_vsLt.js → chunk-Dgi_aaUY.js} +1 -1
- package/static/{chunk-DVJ9L-aC.js → chunk-DiKEYJdn.js} +1 -1
- package/static/{chunk-DHC_yfIa.js → chunk-Dl_fBMXY.js} +1 -1
- package/static/{chunk-Cvoe3MtC.js → chunk-Dqjhd0t8.js} +1 -1
- package/static/{chunk-CV-FUe_H.js → chunk-DuhskOh7.js} +1 -1
- package/static/{chunk-5xJXPFlv.js → chunk-DvI50p6W.js} +1 -1
- package/static/chunk-Ou4ZHVyl.js +1 -0
- package/static/{chunk-D3JZ8ur5.js → chunk-XJrnAloK.js} +3 -3
- package/static/{chunk-CLM-K-Vg.js → chunk-djGmnQaE.js} +1 -1
- package/static/{chunk-CZoPJsBm.js → chunk-lQWDKNhr.js} +1 -1
- package/static/chunk-rTfgntJ9.js +1 -0
- package/static/{chunk-xeQj_hSF.js → chunk-wWwVqMLO.js} +1 -1
- package/static/{chunk-DyiDg8XX.js → chunk-wqJvNV4X.js} +1 -1
- package/static/{chunk-BIL86kgf.js → chunk-wu6SvZ0s.js} +1 -1
- package/static/index.html +1 -1
- package/static/{main-SI5AKDMC.js → main-Q5LNROCU.js} +1 -1
- package/static/chunk--WRMKpmO.js +0 -5
- package/static/chunk-BaYdwXIA.js +0 -1
- package/static/chunk-C3Xml1YG.js +0 -1
- package/static/chunk-DDhSFoAE.js +0 -1
- package/static/chunk-DaO-gpzS.js +0 -1
- package/static/chunk-pi-mtheN.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a7 as KE,a8 as fu,bP as hn,aA as mT,C,a9 as Z0,ab as Oe$1,aB as yT,aC as zt,Z as ZE,as as st,at as Ee$1,au as w5,av as K0,aj as $D,l as _D,j as _i,J as Jc,M as MD,o as gI,aQ as aw,al as Sh,am as Ih,an as WD,ao as GD,aM as Yl,bQ as Wr,r as r$1,ai as ly,H as HD,aw as rh,w as lh,n as uh,aR as xw,ak as UD,x as xD,aO as SD,B as AD,bR as eD,bS as dh,aP as Mh,aJ as tl,I as Iw,aK as nl,L as Lh,bT as oh,ax as Eh,ac as Er,N as ND}from'./main-SI5AKDMC.js';var Ce=["*"];function fe(e,a){if(e&1&&(_i(0,"div",0),uh(1,"nz-skeleton-element",4),Jc()),e&2){let t=HD(2);gI(),lh("nzSize",t.avatar.size||"default")("nzShape",t.avatar.shape||"circle");}}function _e(e,a){if(e&1&&uh(0,"h3",5),e&2){let t=HD(2);Mh("width",t.toCSSUnit(t.title.width));}}function ve(e,a){if(e&1&&uh(0,"li"),e&2){let t=a.$index,n=HD(3);Mh("width",n.toCSSUnit(n.widthList[t]));}}function ge(e,a){if(e&1&&(_i(0,"ul",3),xD(1,ve,1,2,"li",6,ND),Jc()),e&2){let t=HD(2);gI(),AD(t.rowsList);}}function he(e,a){if(e&1&&(_D(0,fe,2,2,"div",0),_i(1,"div",1),_D(2,_e,1,2,"h3",2),_D(3,ge,3,0,"ul",3),Jc()),e&2){let t=HD();MD(t.nzAvatar?0:-1),gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzParagraph?3:-1);}}function Se(e,a){e&1&&UD(0);}var Te=(()=>{class e{nzActive=false;nzType;nzBlock=false;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["nz-skeleton-element"]],hostAttrs:[1,"ant-skeleton","ant-skeleton-element"],hostVars:4,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-active",i.nzActive)("ant-skeleton-block",i.nzBlock);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzType:"nzType",nzBlock:[2,"nzBlock","nzBlock",K0]}})}return e})();var ye=(()=>{class e{nzShape="circle";nzSize="default";styleMap={};ngOnChanges(t){if(t.nzSize&&typeof this.nzSize=="number"){let n=`${this.nzSize}px`;this.styleMap={width:n,height:n,"line-height":n};}else this.styleMap={};}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton-element","nzType","avatar"]],inputs:{nzShape:"nzShape",nzSize:"nzSize"},features:[ly],decls:1,vars:10,consts:[[1,"ant-skeleton-avatar"]],template:function(n,i){n&1&&dh(0,"span",0),n&2&&(aw(i.styleMap),Sh("ant-skeleton-avatar-square",i.nzShape==="square")("ant-skeleton-avatar-circle",i.nzShape==="circle")("ant-skeleton-avatar-lg",i.nzSize==="large")("ant-skeleton-avatar-sm",i.nzSize==="small"));},encapsulation:2})}return e})();var ce=(()=>{class e{cdr=C(Z0);nzActive=false;nzLoading=true;nzRound=false;nzTitle=true;nzAvatar=false;nzParagraph=true;title;avatar;paragraph;rowsList=[];widthList=[];toCSSUnit(t=""){return Wr(t)}getTitleProps(){let t=!!this.nzAvatar,n=!!this.nzParagraph,i="";return !t&&n?i="38%":t&&n&&(i="50%"),r$1({width:i},this.getProps(this.nzTitle))}getAvatarProps(){let t=this.nzTitle&&!this.nzParagraph?"square":"circle";return r$1({shape:t,size:"large"},this.getProps(this.nzAvatar))}getParagraphProps(){let t=!!this.nzAvatar,n=!!this.nzTitle,i={};return (!t||!n)&&(i.width="61%"),!t&&n?i.rows=3:i.rows=2,r$1(r$1({},i),this.getProps(this.nzParagraph))}getProps(t){return t&&typeof t=="object"?t:{}}getWidthList(){let{width:t,rows:n}=this.paragraph,i=[];return t&&Array.isArray(t)?i=t:t&&!Array.isArray(t)&&(i=[],i[n-1]=t),i}updateProps(){this.title=this.getTitleProps(),this.avatar=this.getAvatarProps(),this.paragraph=this.getParagraphProps(),this.rowsList=[...Array(this.paragraph.rows)],this.widthList=this.getWidthList(),this.cdr.markForCheck();}ngOnInit(){this.updateProps();}ngOnChanges(t){(t.nzTitle||t.nzAvatar||t.nzParagraph)&&this.updateProps();}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton"]],hostAttrs:[1,"ant-skeleton"],hostVars:6,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-with-avatar",!!i.nzAvatar)("ant-skeleton-active",i.nzActive)("ant-skeleton-round",i.nzRound);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzRound:[2,"nzRound","nzRound",K0],nzTitle:"nzTitle",nzAvatar:"nzAvatar",nzParagraph:"nzParagraph"},exportAs:["nzSkeleton"],features:[ly],ngContentSelectors:Ce,decls:2,vars:1,consts:[[1,"ant-skeleton-header"],[1,"ant-skeleton-content"],[1,"ant-skeleton-title",3,"width"],[1,"ant-skeleton-paragraph"],["nzType","avatar",3,"nzSize","nzShape"],[1,"ant-skeleton-title"],[3,"width"]],template:function(n,i){n&1&&($D(),_D(0,he,4,3)(1,Se,1,0)),n&2&&MD(i.nzLoading?0:1);},dependencies:[Te,ye],encapsulation:2})}return e})(),pe=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({})}return e})();function Ne(e,a){}function ke(e,a){if(e&1&&(_i(0,"div",0),rh(1,Ne,0,0,"ng-template",2),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzAvatar);}}function be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Me(e,a){if(e&1&&(_i(0,"div",3),rh(1,be,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Ae(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzDescription);}}function De(e,a){if(e&1&&(_i(0,"div",4),rh(1,Ae,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzDescription);}}function Ee(e,a){if(e&1&&(_i(0,"div",1),_D(1,Me,2,1,"div",3),_D(2,De,2,1,"div",4),Jc()),e&2){let t=HD();gI(),MD(t.nzTitle?1:-1),gI(),MD(t.nzDescription?2:-1);}}var me=["*"];function we(e,a){e&1&&UD(0);}var Pe=()=>({rows:4});function Be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Oe(e,a){if(e&1&&(_i(0,"div",6),rh(1,Be,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Fe(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzExtra);}}function Le(e,a){if(e&1&&(_i(0,"div",7),rh(1,Fe,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzExtra);}}function He(e,a){}function Ie(e,a){if(e&1&&rh(0,He,0,0,"ng-template",8),e&2){let t=HD(2);lh("ngTemplateOutlet",t.listOfNzCardTabComponent.template);}}function qe(e,a){if(e&1&&(_i(0,"div",0)(1,"div",5),_D(2,Oe,2,1,"div",6),_D(3,Le,2,1,"div",7),Jc(),_D(4,Ie,1,1,null,8),Jc()),e&2){let t=HD();gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzExtra?3:-1),gI(),MD(t.listOfNzCardTabComponent?4:-1);}}function je(e,a){}function Re(e,a){if(e&1&&(_i(0,"div",1),rh(1,je,0,0,"ng-template",8),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzCover);}}function Ge(e,a){e&1&&uh(0,"nz-skeleton",3),e&2&&lh("nzActive",true)("nzTitle",false)("nzParagraph",xw(3,Pe));}function Qe(e,a){e&1&&UD(0);}function Ve(e,a){}function $e(e,a){if(e&1&&(_i(0,"li")(1,"span"),rh(2,Ve,0,0,"ng-template",8),Jc()()),e&2){let t=a.$implicit,n=a.$count;Mh("width",100/n,"%"),gI(2),lh("ngTemplateOutlet",t);}}function Ue(e,a){if(e&1&&(_i(0,"ul",4),xD(1,$e,3,3,"li",10,SD),Jc()),e&2){let t=HD();gI(),AD(t.nzActions);}}var We=(()=>{class e{nzHoverable=true;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["","nz-card-grid",""]],hostAttrs:[1,"ant-card-grid"],hostVars:2,hostBindings:function(n,i){n&2&&Sh("ant-card-hoverable",i.nzHoverable);},inputs:{nzHoverable:[2,"nzHoverable","nzHoverable",K0]},exportAs:["nzCardGrid"]})}return e})(),Ze=(()=>{class e{nzTitle=null;nzDescription=null;nzAvatar=null;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-meta"]],hostAttrs:[1,"ant-card-meta"],inputs:{nzTitle:"nzTitle",nzDescription:"nzDescription",nzAvatar:"nzAvatar"},exportAs:["nzCardMeta"],decls:2,vars:2,consts:[[1,"ant-card-meta-avatar"],[1,"ant-card-meta-detail"],[3,"ngTemplateOutlet"],[1,"ant-card-meta-title"],[1,"ant-card-meta-description"],[4,"nzStringTemplateOutlet"]],template:function(n,i){n&1&&(_D(0,ke,2,1,"div",0),_D(1,Ee,3,2,"div",1)),n&2&&(MD(i.nzAvatar?0:-1),gI(),MD(i.nzTitle||i.nzDescription?1:-1));},dependencies:[w5,st,Ee$1],encapsulation:2})}return e})(),Je=(()=>{class e{template;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-tab"]],viewQuery:function(n,i){if(n&1&&Eh(Er,7),n&2){let S;WD(S=GD())&&(i.template=S.first);}},exportAs:["nzCardTab"],ngContentSelectors:me,decls:1,vars:0,template:function(n,i){n&1&&($D(),oh(0,we,1,0,"ng-template"));},encapsulation:2})}return e})(),ze="card",Ke=(()=>{let e,a=[],t=[],n,i=[],S=[],W,Z=[],J=[];return class U{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[Yl()],n=[Yl()],W=[Yl()],mT(null,null,e,{kind:"field",name:"nzBordered",static:false,private:false,access:{has:r=>"nzBordered"in r,get:r=>r.nzBordered,set:(r,l)=>{r.nzBordered=l;}},metadata:C},a,t),mT(null,null,n,{kind:"field",name:"nzHoverable",static:false,private:false,access:{has:r=>"nzHoverable"in r,get:r=>r.nzHoverable,set:(r,l)=>{r.nzHoverable=l;}},metadata:C},i,S),mT(null,null,W,{kind:"field",name:"nzSize",static:false,private:false,access:{has:r=>"nzSize"in r,get:r=>r.nzSize,set:(r,l)=>{r.nzSize=l;}},metadata:C},Z,J),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}cdr=C(Z0);dir=C(Oe$1).valueSignal;_nzModuleName=ze;nzBordered=yT(this,a,true);nzLoading=(yT(this,t),false);nzHoverable=yT(this,i,false);nzBodyStyle=(yT(this,S),null);nzCover;nzActions=[];nzType=null;nzSize=yT(this,Z,"default");nzTitle=yT(this,J);nzExtra;listOfNzCardTabComponent;listOfNzCardGridDirective;constructor(){zt(ze,()=>this.cdr.markForCheck());}static \u0275fac=function(r){return new(r||U)};static \u0275cmp=ZE({type:U,selectors:[["nz-card"]],contentQueries:function(r,l,K){if(r&1&&Ih(K,Je,5)(K,We,4),r&2){let E;WD(E=GD())&&(l.listOfNzCardTabComponent=E.first),WD(E=GD())&&(l.listOfNzCardGridDirective=E);}},hostAttrs:[1,"ant-card"],hostVars:16,hostBindings:function(r,l){r&2&&Sh("ant-card-loading",l.nzLoading)("ant-card-bordered",l.nzBordered)("ant-card-hoverable",l.nzHoverable)("ant-card-small",l.nzSize==="small")("ant-card-contain-grid",l.listOfNzCardGridDirective&&l.listOfNzCardGridDirective.length)("ant-card-type-inner",l.nzType==="inner")("ant-card-contain-tabs",!!l.listOfNzCardTabComponent)("ant-card-rtl",l.dir()==="rtl");},inputs:{nzBordered:[2,"nzBordered","nzBordered",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzHoverable:[2,"nzHoverable","nzHoverable",K0],nzBodyStyle:"nzBodyStyle",nzCover:"nzCover",nzActions:"nzActions",nzType:"nzType",nzSize:"nzSize",nzTitle:"nzTitle",nzExtra:"nzExtra"},exportAs:["nzCard"],ngContentSelectors:me,decls:6,vars:6,consts:[[1,"ant-card-head"],[1,"ant-card-cover"],[1,"ant-card-body"],[3,"nzActive","nzTitle","nzParagraph"],[1,"ant-card-actions"],[1,"ant-card-head-wrapper"],[1,"ant-card-head-title"],[1,"ant-card-extra"],[3,"ngTemplateOutlet"],[4,"nzStringTemplateOutlet"],[3,"width"]],template:function(r,l){r&1&&($D(),_D(0,qe,5,3,"div",0),_D(1,Re,2,1,"div",1),_i(2,"div",2),_D(3,Ge,1,4,"nz-skeleton",3)(4,Qe,1,0),Jc(),_D(5,Ue,3,0,"ul",4)),r&2&&(MD(l.nzTitle||l.nzExtra||l.listOfNzCardTabComponent?0:-1),gI(),MD(l.nzCover?1:-1),gI(),aw(l.nzBodyStyle),gI(),MD(l.nzLoading?3:4),gI(2),MD(l.nzActions.length?5:-1));},dependencies:[st,Ee$1,w5,pe,ce],encapsulation:2})}})(),Nt=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({imports:[Ke,Ze,hn]})}return e})();export{Ke as K,Nt as N};
|
|
1
|
+
import {a7 as KE,a8 as fu,bP as hn,aA as mT,C,a9 as Z0,ab as Oe$1,aB as yT,aC as zt,Z as ZE,as as st,at as Ee$1,au as w5,av as K0,aj as $D,l as _D,j as _i,J as Jc,M as MD,o as gI,aQ as aw,al as Sh,am as Ih,an as WD,ao as GD,aM as Yl,bQ as Wr,r as r$1,ai as ly,H as HD,aw as rh,w as lh,n as uh,aR as xw,ak as UD,x as xD,aO as SD,B as AD,bR as eD,bS as dh,aP as Mh,aJ as tl,I as Iw,aK as nl,L as Lh,bT as oh,ax as Eh,ac as Er,N as ND}from'./main-Q5LNROCU.js';var Ce=["*"];function fe(e,a){if(e&1&&(_i(0,"div",0),uh(1,"nz-skeleton-element",4),Jc()),e&2){let t=HD(2);gI(),lh("nzSize",t.avatar.size||"default")("nzShape",t.avatar.shape||"circle");}}function _e(e,a){if(e&1&&uh(0,"h3",5),e&2){let t=HD(2);Mh("width",t.toCSSUnit(t.title.width));}}function ve(e,a){if(e&1&&uh(0,"li"),e&2){let t=a.$index,n=HD(3);Mh("width",n.toCSSUnit(n.widthList[t]));}}function ge(e,a){if(e&1&&(_i(0,"ul",3),xD(1,ve,1,2,"li",6,ND),Jc()),e&2){let t=HD(2);gI(),AD(t.rowsList);}}function he(e,a){if(e&1&&(_D(0,fe,2,2,"div",0),_i(1,"div",1),_D(2,_e,1,2,"h3",2),_D(3,ge,3,0,"ul",3),Jc()),e&2){let t=HD();MD(t.nzAvatar?0:-1),gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzParagraph?3:-1);}}function Se(e,a){e&1&&UD(0);}var Te=(()=>{class e{nzActive=false;nzType;nzBlock=false;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["nz-skeleton-element"]],hostAttrs:[1,"ant-skeleton","ant-skeleton-element"],hostVars:4,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-active",i.nzActive)("ant-skeleton-block",i.nzBlock);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzType:"nzType",nzBlock:[2,"nzBlock","nzBlock",K0]}})}return e})();var ye=(()=>{class e{nzShape="circle";nzSize="default";styleMap={};ngOnChanges(t){if(t.nzSize&&typeof this.nzSize=="number"){let n=`${this.nzSize}px`;this.styleMap={width:n,height:n,"line-height":n};}else this.styleMap={};}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton-element","nzType","avatar"]],inputs:{nzShape:"nzShape",nzSize:"nzSize"},features:[ly],decls:1,vars:10,consts:[[1,"ant-skeleton-avatar"]],template:function(n,i){n&1&&dh(0,"span",0),n&2&&(aw(i.styleMap),Sh("ant-skeleton-avatar-square",i.nzShape==="square")("ant-skeleton-avatar-circle",i.nzShape==="circle")("ant-skeleton-avatar-lg",i.nzSize==="large")("ant-skeleton-avatar-sm",i.nzSize==="small"));},encapsulation:2})}return e})();var ce=(()=>{class e{cdr=C(Z0);nzActive=false;nzLoading=true;nzRound=false;nzTitle=true;nzAvatar=false;nzParagraph=true;title;avatar;paragraph;rowsList=[];widthList=[];toCSSUnit(t=""){return Wr(t)}getTitleProps(){let t=!!this.nzAvatar,n=!!this.nzParagraph,i="";return !t&&n?i="38%":t&&n&&(i="50%"),r$1({width:i},this.getProps(this.nzTitle))}getAvatarProps(){let t=this.nzTitle&&!this.nzParagraph?"square":"circle";return r$1({shape:t,size:"large"},this.getProps(this.nzAvatar))}getParagraphProps(){let t=!!this.nzAvatar,n=!!this.nzTitle,i={};return (!t||!n)&&(i.width="61%"),!t&&n?i.rows=3:i.rows=2,r$1(r$1({},i),this.getProps(this.nzParagraph))}getProps(t){return t&&typeof t=="object"?t:{}}getWidthList(){let{width:t,rows:n}=this.paragraph,i=[];return t&&Array.isArray(t)?i=t:t&&!Array.isArray(t)&&(i=[],i[n-1]=t),i}updateProps(){this.title=this.getTitleProps(),this.avatar=this.getAvatarProps(),this.paragraph=this.getParagraphProps(),this.rowsList=[...Array(this.paragraph.rows)],this.widthList=this.getWidthList(),this.cdr.markForCheck();}ngOnInit(){this.updateProps();}ngOnChanges(t){(t.nzTitle||t.nzAvatar||t.nzParagraph)&&this.updateProps();}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton"]],hostAttrs:[1,"ant-skeleton"],hostVars:6,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-with-avatar",!!i.nzAvatar)("ant-skeleton-active",i.nzActive)("ant-skeleton-round",i.nzRound);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzRound:[2,"nzRound","nzRound",K0],nzTitle:"nzTitle",nzAvatar:"nzAvatar",nzParagraph:"nzParagraph"},exportAs:["nzSkeleton"],features:[ly],ngContentSelectors:Ce,decls:2,vars:1,consts:[[1,"ant-skeleton-header"],[1,"ant-skeleton-content"],[1,"ant-skeleton-title",3,"width"],[1,"ant-skeleton-paragraph"],["nzType","avatar",3,"nzSize","nzShape"],[1,"ant-skeleton-title"],[3,"width"]],template:function(n,i){n&1&&($D(),_D(0,he,4,3)(1,Se,1,0)),n&2&&MD(i.nzLoading?0:1);},dependencies:[Te,ye],encapsulation:2})}return e})(),pe=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({})}return e})();function Ne(e,a){}function ke(e,a){if(e&1&&(_i(0,"div",0),rh(1,Ne,0,0,"ng-template",2),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzAvatar);}}function be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Me(e,a){if(e&1&&(_i(0,"div",3),rh(1,be,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Ae(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzDescription);}}function De(e,a){if(e&1&&(_i(0,"div",4),rh(1,Ae,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzDescription);}}function Ee(e,a){if(e&1&&(_i(0,"div",1),_D(1,Me,2,1,"div",3),_D(2,De,2,1,"div",4),Jc()),e&2){let t=HD();gI(),MD(t.nzTitle?1:-1),gI(),MD(t.nzDescription?2:-1);}}var me=["*"];function we(e,a){e&1&&UD(0);}var Pe=()=>({rows:4});function Be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Oe(e,a){if(e&1&&(_i(0,"div",6),rh(1,Be,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Fe(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzExtra);}}function Le(e,a){if(e&1&&(_i(0,"div",7),rh(1,Fe,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzExtra);}}function He(e,a){}function Ie(e,a){if(e&1&&rh(0,He,0,0,"ng-template",8),e&2){let t=HD(2);lh("ngTemplateOutlet",t.listOfNzCardTabComponent.template);}}function qe(e,a){if(e&1&&(_i(0,"div",0)(1,"div",5),_D(2,Oe,2,1,"div",6),_D(3,Le,2,1,"div",7),Jc(),_D(4,Ie,1,1,null,8),Jc()),e&2){let t=HD();gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzExtra?3:-1),gI(),MD(t.listOfNzCardTabComponent?4:-1);}}function je(e,a){}function Re(e,a){if(e&1&&(_i(0,"div",1),rh(1,je,0,0,"ng-template",8),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzCover);}}function Ge(e,a){e&1&&uh(0,"nz-skeleton",3),e&2&&lh("nzActive",true)("nzTitle",false)("nzParagraph",xw(3,Pe));}function Qe(e,a){e&1&&UD(0);}function Ve(e,a){}function $e(e,a){if(e&1&&(_i(0,"li")(1,"span"),rh(2,Ve,0,0,"ng-template",8),Jc()()),e&2){let t=a.$implicit,n=a.$count;Mh("width",100/n,"%"),gI(2),lh("ngTemplateOutlet",t);}}function Ue(e,a){if(e&1&&(_i(0,"ul",4),xD(1,$e,3,3,"li",10,SD),Jc()),e&2){let t=HD();gI(),AD(t.nzActions);}}var We=(()=>{class e{nzHoverable=true;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["","nz-card-grid",""]],hostAttrs:[1,"ant-card-grid"],hostVars:2,hostBindings:function(n,i){n&2&&Sh("ant-card-hoverable",i.nzHoverable);},inputs:{nzHoverable:[2,"nzHoverable","nzHoverable",K0]},exportAs:["nzCardGrid"]})}return e})(),Ze=(()=>{class e{nzTitle=null;nzDescription=null;nzAvatar=null;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-meta"]],hostAttrs:[1,"ant-card-meta"],inputs:{nzTitle:"nzTitle",nzDescription:"nzDescription",nzAvatar:"nzAvatar"},exportAs:["nzCardMeta"],decls:2,vars:2,consts:[[1,"ant-card-meta-avatar"],[1,"ant-card-meta-detail"],[3,"ngTemplateOutlet"],[1,"ant-card-meta-title"],[1,"ant-card-meta-description"],[4,"nzStringTemplateOutlet"]],template:function(n,i){n&1&&(_D(0,ke,2,1,"div",0),_D(1,Ee,3,2,"div",1)),n&2&&(MD(i.nzAvatar?0:-1),gI(),MD(i.nzTitle||i.nzDescription?1:-1));},dependencies:[w5,st,Ee$1],encapsulation:2})}return e})(),Je=(()=>{class e{template;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-tab"]],viewQuery:function(n,i){if(n&1&&Eh(Er,7),n&2){let S;WD(S=GD())&&(i.template=S.first);}},exportAs:["nzCardTab"],ngContentSelectors:me,decls:1,vars:0,template:function(n,i){n&1&&($D(),oh(0,we,1,0,"ng-template"));},encapsulation:2})}return e})(),ze="card",Ke=(()=>{let e,a=[],t=[],n,i=[],S=[],W,Z=[],J=[];return class U{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[Yl()],n=[Yl()],W=[Yl()],mT(null,null,e,{kind:"field",name:"nzBordered",static:false,private:false,access:{has:r=>"nzBordered"in r,get:r=>r.nzBordered,set:(r,l)=>{r.nzBordered=l;}},metadata:C},a,t),mT(null,null,n,{kind:"field",name:"nzHoverable",static:false,private:false,access:{has:r=>"nzHoverable"in r,get:r=>r.nzHoverable,set:(r,l)=>{r.nzHoverable=l;}},metadata:C},i,S),mT(null,null,W,{kind:"field",name:"nzSize",static:false,private:false,access:{has:r=>"nzSize"in r,get:r=>r.nzSize,set:(r,l)=>{r.nzSize=l;}},metadata:C},Z,J),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}cdr=C(Z0);dir=C(Oe$1).valueSignal;_nzModuleName=ze;nzBordered=yT(this,a,true);nzLoading=(yT(this,t),false);nzHoverable=yT(this,i,false);nzBodyStyle=(yT(this,S),null);nzCover;nzActions=[];nzType=null;nzSize=yT(this,Z,"default");nzTitle=yT(this,J);nzExtra;listOfNzCardTabComponent;listOfNzCardGridDirective;constructor(){zt(ze,()=>this.cdr.markForCheck());}static \u0275fac=function(r){return new(r||U)};static \u0275cmp=ZE({type:U,selectors:[["nz-card"]],contentQueries:function(r,l,K){if(r&1&&Ih(K,Je,5)(K,We,4),r&2){let E;WD(E=GD())&&(l.listOfNzCardTabComponent=E.first),WD(E=GD())&&(l.listOfNzCardGridDirective=E);}},hostAttrs:[1,"ant-card"],hostVars:16,hostBindings:function(r,l){r&2&&Sh("ant-card-loading",l.nzLoading)("ant-card-bordered",l.nzBordered)("ant-card-hoverable",l.nzHoverable)("ant-card-small",l.nzSize==="small")("ant-card-contain-grid",l.listOfNzCardGridDirective&&l.listOfNzCardGridDirective.length)("ant-card-type-inner",l.nzType==="inner")("ant-card-contain-tabs",!!l.listOfNzCardTabComponent)("ant-card-rtl",l.dir()==="rtl");},inputs:{nzBordered:[2,"nzBordered","nzBordered",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzHoverable:[2,"nzHoverable","nzHoverable",K0],nzBodyStyle:"nzBodyStyle",nzCover:"nzCover",nzActions:"nzActions",nzType:"nzType",nzSize:"nzSize",nzTitle:"nzTitle",nzExtra:"nzExtra"},exportAs:["nzCard"],ngContentSelectors:me,decls:6,vars:6,consts:[[1,"ant-card-head"],[1,"ant-card-cover"],[1,"ant-card-body"],[3,"nzActive","nzTitle","nzParagraph"],[1,"ant-card-actions"],[1,"ant-card-head-wrapper"],[1,"ant-card-head-title"],[1,"ant-card-extra"],[3,"ngTemplateOutlet"],[4,"nzStringTemplateOutlet"],[3,"width"]],template:function(r,l){r&1&&($D(),_D(0,qe,5,3,"div",0),_D(1,Re,2,1,"div",1),_i(2,"div",2),_D(3,Ge,1,4,"nz-skeleton",3)(4,Qe,1,0),Jc(),_D(5,Ue,3,0,"ul",4)),r&2&&(MD(l.nzTitle||l.nzExtra||l.listOfNzCardTabComponent?0:-1),gI(),MD(l.nzCover?1:-1),gI(),aw(l.nzBodyStyle),gI(),MD(l.nzLoading?3:4),gI(2),MD(l.nzActions.length?5:-1));},dependencies:[st,Ee$1,w5,pe,ce],encapsulation:2})}})(),Nt=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({imports:[Ke,Ze,hn]})}return e})();export{Ke as K,Nt as N};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a7 as KE,a8 as fu,aA as mT,aB as yT,a5 as q0,av as K0,U as Uw,s,r as r$1,ae as Le$1,u as ue,bR as eD,c3 as th,al as Sh,q as qo,ap as re,C,c4 as Uo,c5 as Q0,c6 as em,ar as sn,c7 as Gl,Z as ZE,c8 as vo,c9 as Wt,ca as _o,cb as Gl$1,cc as zh,cd as Fh,c0 as Mn,as as st,at as Ee,a3 as Ah,a4 as Th,Y as pf,a0 as bd,a1 as sp,a2 as fp,ce as $b,cf as Zb,aw as rh,m as mh,w as lh,ax as Eh,bf as _r,an as WD,ao as GD,aM as Yl,cg as oc,bW as Bl,ch as Sy,G as FD,j as _i,ci as oi,cj as ri,l as _D,J as Jc,ck as $h,P as Pw,I as Iw,H as HD,aQ as aw,aG as lw,o as gI,M as MD,D as ch,p as Fw,z as rl,cl as Vi,bV as XI,be as E3,b as at,cm as Wm,cn as S2,co as Kg,cp as Yg,cq as kg,cr as kr,cs as xy,ai as ly,ab as Oe,a9 as Z0,ct as Sr,cu as Cr,cv as me,cw as Rg,cx as yo,cy as _n$1,ac as Er,aD as Nr,n as uh,aJ as tl,aK as nl,ad as jr,L as Lh,aT as Vw,O as Fu,Q as ju}from'./main-SI5AKDMC.js';var lt=["overlay"];function ct(i,m){if(i&1&&(tl(0),Iw(1),nl()),i&2){let e=HD(2);gI(),Lh(e.nzTitle);}}function pt(i,m){if(i&1){let e=FD();_i(0,"div",2),oi(function(){Fu(e);let n=HD();return ju(n.zoomAnimationLeave())}),ri(function(){Fu(e);let n=HD();return ju(n.zoomAnimationEnter())}),uh(1,"div",3),_i(2,"div",4)(3,"div",5),rh(4,ct,2,1,"ng-container",6),Jc()()();}if(i&2){let e=HD();aw(e.nzOverlayStyle),lw(e._classMap),Sh("ant-tooltip-rtl",e.dir()==="rtl"),lh("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),aw(e._arrowStyleMap),gI(2),aw(e._contentStyleMap),gI(),lh("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext);}}var tt=(()=>{class i{componentType;elementRef=C(_r);hostView=C(Vi);renderer=C(XI);noAnimation=C(Mn,{host:true,optional:true});nzConfigService=C(E3);destroyRef=C(at);platformId=C(Wm);config;visibleChange=new Le$1;get _title(){return this.title||this.directiveTitle||null}get _content(){return this.content||this.directiveContent||null}get _trigger(){return typeof this.trigger<"u"?this.trigger:"hover"}get _placement(){let e=this.placement;return Array.isArray(e)&&e.length>0?e:typeof e=="string"&&e?[e]:["top"]}get _visible(){return (typeof this.visible<"u"?this.visible:this.internalVisible)||false}get _mouseEnterDelay(){return this.mouseEnterDelay||.15}get _mouseLeaveDelay(){return this.mouseLeaveDelay||.1}get _overlayClassName(){return this.overlayClassName||null}get _overlayStyle(){return this.overlayStyle||null}get _overlayClickable(){return this.overlayClickable??true}internalVisible=false;getProxyPropertyMap(){return {noAnimation:["noAnimation",()=>!!this.noAnimation]}}component;destroy$=new re;triggerDisposables=[];delayTimer;constructor(e){this.componentType=e,this.destroyRef.onDestroy(()=>{this.clearTogglingTimer(),this.removeTriggerListeners();});}ngAfterViewInit(){S2(this.platformId)&&(this.createComponent(),this.registerTriggers());}ngOnChanges(e){let{trigger:t}=e;t&&!t.isFirstChange()&&this.registerTriggers(),this.component&&this.updatePropertiesByChanges(e);}show(){this.component?.show();}hide(){this.component?.hide();}updatePosition(){this.component&&this.component.updatePosition();}createComponent(){let e=this.hostView.createComponent(this.componentType);this.component=e.instance,this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement),e.location.nativeElement),this.component.setOverlayOrigin(this.origin||this.elementRef),this.initProperties();let t=this.component.nzVisibleChange.pipe(Kg());t.pipe(ue(this.destroyRef)).subscribe(n=>{this.internalVisible=n,this.visibleChange.emit(n);}),t.pipe(sn(Boolean),Yg(0,kg),sn(()=>!!this.component?.overlay?.overlayRef),ue(this.destroyRef)).subscribe(()=>{this.component?.updatePosition();});}registerTriggers(){let e=this.elementRef.nativeElement,t=this.trigger;if(this.removeTriggerListeners(),t==="hover"){let n;this.triggerDisposables.push(this.renderer.listen(e,"mouseenter",()=>{this.delayEnterLeave(true,true,this._mouseEnterDelay);})),this.triggerDisposables.push(this.renderer.listen(e,"mouseleave",()=>{this.delayEnterLeave(true,false,this._mouseLeaveDelay),this.component?.overlay.overlayRef&&!n&&(n=this.component.overlay.overlayRef.overlayElement,this.triggerDisposables.push(this.renderer.listen(n,"mouseenter",()=>{this.delayEnterLeave(false,true,this._mouseEnterDelay);})),this.triggerDisposables.push(this.renderer.listen(n,"mouseleave",()=>{this.delayEnterLeave(false,false,this._mouseLeaveDelay);})));}));}else t==="focus"?(this.triggerDisposables.push(this.renderer.listen(e,"focusin",()=>this.show())),this.triggerDisposables.push(this.renderer.listen(e,"focusout",()=>this.hide()))):t==="click"&&this.triggerDisposables.push(this.renderer.listen(e,"click",n=>{n.preventDefault(),this.show();}));}updatePropertiesByChanges(e){this.updatePropertiesByKeys(Object.keys(e));}updatePropertiesByKeys(e){let t=r$1({title:["nzTitle",()=>this._title],directiveTitle:["nzTitle",()=>this._title],content:["nzContent",()=>this._content],directiveContent:["nzContent",()=>this._content],trigger:["nzTrigger",()=>this._trigger],placement:["nzPlacement",()=>this._placement],visible:["nzVisible",()=>this._visible],mouseEnterDelay:["nzMouseEnterDelay",()=>this._mouseEnterDelay],mouseLeaveDelay:["nzMouseLeaveDelay",()=>this._mouseLeaveDelay],overlayClassName:["nzOverlayClassName",()=>this._overlayClassName],overlayStyle:["nzOverlayStyle",()=>this._overlayStyle],overlayClickable:["nzOverlayClickable",()=>this._overlayClickable],arrowPointAtCenter:["nzArrowPointAtCenter",()=>this.arrowPointAtCenter]},this.getProxyPropertyMap());(e||Object.keys(t).filter(n=>!n.startsWith("directive"))).forEach(n=>{if(t[n]){let[o,c]=t[n];this.updateComponentValue(o,c());}}),this.component?.updateByDirective();}initProperties(){this.updatePropertiesByKeys();}updateComponentValue(e,t){typeof t<"u"&&(this.component[e]=t);}delayEnterLeave(e,t,n=-1){this.delayTimer?this.clearTogglingTimer():n>0?this.delayTimer=setTimeout(()=>{this.delayTimer=void 0,t?this.show():this.hide();},n*1e3):t&&e?this.show():this.hide();}removeTriggerListeners(){this.triggerDisposables.forEach(e=>e()),this.triggerDisposables.length=0;}clearTogglingTimer(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=void 0);}static \u0275fac=function(t){return new(t||i)(kr(xy))};static \u0275dir=eD({type:i,features:[ly]})}return i})(),mt=(()=>{class i{noAnimation=C(Mn,{host:true,optional:true});dir=C(Oe).valueSignal;cdr=C(Z0);elementRef=C(_r);destroyRef=C(at);overlay;nzTitle=null;nzContent=null;nzArrowPointAtCenter=false;nzOverlayClassName;nzOverlayStyle={};nzOverlayClickable=true;nzBackdrop=false;nzMouseEnterDelay;nzMouseLeaveDelay;nzVisibleChange=new re;set nzVisible(e){let t=jr(e);this._visible!==t&&(this._visible=t,this.nzVisibleChange.next(t));}get nzVisible(){return this._visible}_visible=false;set nzTrigger(e){this._trigger=e;}get nzTrigger(){return this._trigger}_trigger="hover";set nzPlacement(e){let t=e.map(n=>Sr(me[n],Cr[n]));this._positions=[...t,...Rg];}preferredPlacement="top";origin;_classMap={};_prefix="ant-tooltip";_positions=[...Rg];constructor(){this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete();});}show(){this.nzVisible||(this.isEmpty()||(this.nzVisible=true,this.nzVisibleChange.next(true),this.cdr.detectChanges()),this.origin&&this.overlay&&this.overlay.overlayRef&&this.overlay.overlayRef.getDirection()==="rtl"&&this.overlay.overlayRef.setDirection("ltr"));}hide(){this.nzVisible&&(this.nzVisible=false,this.nzVisibleChange.next(false),this.cdr.detectChanges());}updateByDirective(){this.updateStyles(),this.cdr.detectChanges(),Promise.resolve().then(()=>{this.updatePosition(),this.updateVisibilityByTitle();});}updatePosition(){this.origin&&this.overlay&&this.overlay.overlayRef&&this.overlay.overlayRef.updatePosition();}onPositionChange(e){this.preferredPlacement=yo(e),this.updateStyles(),this.cdr.detectChanges();}setOverlayOrigin(e){this.origin=e,this.cdr.markForCheck();}onClickOutside(e){if(!this.nzOverlayClickable)return;let t=_n$1(e);!this.origin.nativeElement.contains(t)&&this.nzTrigger!==null&&this.hide();}updateVisibilityByTitle(){this.isEmpty()&&this.hide();}updateStyles(){this._classMap=s(r$1({},this.transformClassListToMap(this.nzOverlayClassName)),{[`${this._prefix}-placement-${this.preferredPlacement}`]:true});}transformClassListToMap(e){let t={};return (e!==null?e.split(/\s+/):[]).forEach(o=>t[o]=true),t}static \u0275fac=function(t){return new(t||i)};static \u0275dir=eD({type:i,viewQuery:function(t,n){if(t&1&&Eh(lt,5),t&2){let o;WD(o=GD())&&(n.overlay=o.first);}}})}return i})();function ut(i){return i instanceof Er?false:i===""||!Nr(i)}var nt=(()=>{class i extends mt{_animationPrefix="ant-zoom-big-fast";nzTitle=null;nzTitleContext=null;nzColor;_arrowStyleMap={};_contentStyleMap={};zoomAnimationEnter=oc(()=>`${this._animationPrefix}-enter ${this._animationPrefix}-enter-active`);zoomAnimationLeave=oc(()=>`${this._animationPrefix}-leave ${this._animationPrefix}-leave-active`);isEmpty(){return ut(this.nzTitle)}updateStyles(){let e=this.nzColor&&Bl(this.nzColor);this._classMap=s(r$1({},this.transformClassListToMap(this.nzOverlayClassName)),{[`${this._prefix}-placement-${this.preferredPlacement}`]:true,[`${this._prefix}-${this.nzColor}`]:e}),this._contentStyleMap={backgroundColor:this.nzColor&&!e?this.nzColor:null},this._arrowStyleMap={"--antd-arrow-background-color":this.nzColor&&!e?this.nzColor:null};}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sy(i)))(n||i)}})();static \u0275cmp=ZE({type:i,selectors:[["nz-tooltip"]],exportAs:["nzTooltipComponent"],features:[th],decls:2,vars:4,consts:[["overlay","cdkConnectedOverlay"],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","nzArrowPointAtCenter"],[1,"ant-tooltip",3,"nzNoAnimation"],[1,"ant-tooltip-arrow"],[1,"ant-tooltip-content"],[1,"ant-tooltip-inner"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"]],template:function(t,n){t&1&&(rh(0,pt,5,13,"ng-template",1,0,Vw),mh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&lh("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayOpen",n._visible)("cdkConnectedOverlayPositions",n._positions)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[vo,Wt,Mn,st,Ee,_o,Gl$1],encapsulation:2})}return i})();var dt=["okBtn"],ft=["cancelBtn"];function zt(i,m){i&1&&uh(0,"div",5);}function ht(i,m){if(i&1&&(tl(0),uh(1,"nz-icon",17),nl()),i&2){let e=m.$implicit;gI(),lh("nzType",e||"exclamation-circle");}}function vt(i,m){if(i&1&&(_i(0,"span",10),rh(1,ht,2,1,"ng-container",16),Jc()),i&2){let e=HD(2);gI(),lh("nzStringTemplateOutlet",e.nzIcon);}}function yt(i,m){if(i&1&&(tl(0),Iw(1),nl()),i&2){let e=HD(2);gI(),rl(" ",e.nzTitle," ");}}function gt(i,m){if(i&1){let e=FD();_i(0,"div",4),oi(function(){Fu(e);let n=HD();return ju(n.zoomAnimationLeave())}),ri(function(){Fu(e);let n=HD();return ju(n.zoomAnimationEnter())}),_D(1,zt,1,0,"div",5),_i(2,"div",6)(3,"div",7)(4,"div")(5,"div",8)(6,"div",9),_D(7,vt,2,1,"span",10),_i(8,"div",11),rh(9,yt,2,1,"ng-container",12),Jc()(),_i(10,"div",13)(11,"button",14,1),mh("click",function(){Fu(e);let n=HD();return ju(n.onCancel())}),$h(13),Pw(14,"nzI18n"),Iw(15),Jc(),_i(16,"button",15,2),mh("click",function(){Fu(e);let n=HD();return ju(n.onConfirm())}),$h(18),Pw(19,"nzI18n"),Iw(20),Jc()()()()()()();}if(i&2){let e=HD();aw(e.nzOverlayStyle),lw(e._classMap),Sh("ant-popover-rtl",e.dir()==="rtl"),lh("cdkTrapFocusAutoCapture",e.nzAutoFocus!==null)("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),MD(e.nzPopconfirmShowArrow?1:-1),gI(6),MD(e.nzIcon!==null?7:-1),gI(2),lh("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext),gI(2),lh("nzDanger",e.nzCancelButtonProps()?.nzDanger)("disabled",e.nzCancelButtonProps()?.nzDisabled),ch("cdkFocusInitial",e.nzAutoFocus==="cancel"||null);let t=e.nzCancelText()||Fw(14,22,"Modal.cancelText");gI(4),rl(" ",t," "),gI(),lh("nzType",e.nzOkButtonProps().nzType)("nzDanger",e.nzOkButtonProps().nzDanger)("nzLoading",e.confirmLoading)("disabled",e.nzOkButtonProps().nzDisabled),ch("cdkFocusInitial",e.nzAutoFocus==="ok"||null);let n=e.nzOkText()||Fw(19,24,"Modal.okText");gI(4),rl(" ",n," ");}}var Ct="popconfirm",Cn=(()=>{let i=tt,m,e=[],t=[],n,o=[],c=[];return class he extends i{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;m=[Yl()],n=[Yl()],mT(null,null,m,{kind:"field",name:"nzPopconfirmBackdrop",static:false,private:false,access:{has:a=>"nzPopconfirmBackdrop"in a,get:a=>a.nzPopconfirmBackdrop,set:(a,N)=>{a.nzPopconfirmBackdrop=N;}},metadata:C},e,t),mT(null,null,n,{kind:"field",name:"nzAutofocus",static:false,private:false,access:{has:a=>"nzAutofocus"in a,get:a=>a.nzAutofocus,set:(a,N)=>{a.nzAutofocus=N;}},metadata:C},o,c),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}_nzModuleName=Ct;arrowPointAtCenter;title;titleContext=null;directiveTitle;trigger="click";placement="top";origin;mouseEnterDelay;mouseLeaveDelay;overlayClassName;overlayStyle;visible;nzBeforeConfirm;nzIcon;nzCondition=false;nzPopconfirmShowArrow=true;nzPopconfirmBackdrop=yT(this,e,false);nzAutofocus=(yT(this,t),yT(this,o,null));nzOkText=(yT(this,c),q0(null));nzOkType=q0("primary");nzCancelText=q0(null);nzOkButtonProps=q0(null);nzCancelButtonProps=q0(null);nzOkDisabled=q0(false,{transform:K0});nzOkDanger=q0(false,{transform:K0});okButtonProps=Uw(()=>s(r$1({},this.nzOkButtonProps()),{nzType:this.nzOkButtonProps()?.nzType||this.nzOkType()==="danger"?"primary":this.nzOkType(),nzDanger:this.nzOkDanger()||this.nzOkButtonProps()?.nzDanger||this.nzOkType()==="danger",nzDisabled:this.nzOkDisabled()||this.nzOkButtonProps()?.nzDisabled}));cancelButtonProps=Uw(()=>r$1({},this.nzCancelButtonProps()));directiveContent=null;content=null;overlayClickable;visibleChange=new Le$1;nzOnCancel=new Le$1;nzOnConfirm=new Le$1;getProxyPropertyMap(){return r$1({nzOkText:["nzOkText",()=>this.nzOkText],nzCancelText:["nzCancelText",()=>this.nzCancelText],nzOkButtonProps:["nzOkButtonProps",()=>this.okButtonProps],nzCancelButtonProps:["nzCancelButtonProps",()=>this.cancelButtonProps],nzBeforeConfirm:["nzBeforeConfirm",()=>this.nzBeforeConfirm],nzCondition:["nzCondition",()=>this.nzCondition],nzIcon:["nzIcon",()=>this.nzIcon],nzPopconfirmShowArrow:["nzPopconfirmShowArrow",()=>this.nzPopconfirmShowArrow],nzPopconfirmBackdrop:["nzBackdrop",()=>this.nzPopconfirmBackdrop],nzPopconfirmContext:["nzTitleContext",()=>this.titleContext],nzAutoFocus:["nzAutoFocus",()=>this.nzAutofocus]},super.getProxyPropertyMap())}constructor(){super(it);}createComponent(){super.createComponent(),this.component.nzOnCancel.pipe(ue(this.destroyRef)).subscribe(()=>{this.nzOnCancel.emit();}),this.component.nzOnConfirm.pipe(ue(this.destroyRef)).subscribe(()=>{this.nzOnConfirm.emit();});}static \u0275fac=function(a){return new(a||he)};static \u0275dir=eD({type:he,selectors:[["","nz-popconfirm",""]],hostVars:2,hostBindings:function(a,N){a&2&&Sh("ant-popover-open",N.visible);},inputs:{arrowPointAtCenter:[2,"nzPopconfirmArrowPointAtCenter","arrowPointAtCenter",K0],title:[0,"nzPopconfirmTitle","title"],titleContext:[0,"nzPopconfirmTitleContext","titleContext"],directiveTitle:[0,"nz-popconfirm","directiveTitle"],trigger:[0,"nzPopconfirmTrigger","trigger"],placement:[0,"nzPopconfirmPlacement","placement"],origin:[0,"nzPopconfirmOrigin","origin"],mouseEnterDelay:[0,"nzPopconfirmMouseEnterDelay","mouseEnterDelay"],mouseLeaveDelay:[0,"nzPopconfirmMouseLeaveDelay","mouseLeaveDelay"],overlayClassName:[0,"nzPopconfirmOverlayClassName","overlayClassName"],overlayStyle:[0,"nzPopconfirmOverlayStyle","overlayStyle"],visible:[0,"nzPopconfirmVisible","visible"],nzBeforeConfirm:"nzBeforeConfirm",nzIcon:"nzIcon",nzCondition:[2,"nzCondition","nzCondition",K0],nzPopconfirmShowArrow:[2,"nzPopconfirmShowArrow","nzPopconfirmShowArrow",K0],nzPopconfirmBackdrop:"nzPopconfirmBackdrop",nzAutofocus:"nzAutofocus",nzOkText:[1,"nzOkText"],nzOkType:[1,"nzOkType"],nzCancelText:[1,"nzCancelText"],nzOkButtonProps:[1,"nzOkButtonProps"],nzCancelButtonProps:[1,"nzCancelButtonProps"],nzOkDisabled:[1,"nzOkDisabled"],nzOkDanger:[1,"nzOkDanger"]},outputs:{visibleChange:"nzPopconfirmVisibleChange",nzOnCancel:"nzOnCancel",nzOnConfirm:"nzOnConfirm"},exportAs:["nzPopconfirm"],features:[th]})}})(),it=(()=>{class i extends nt{_animationPrefix="ant-zoom-big";okBtn;cancelBtn;nzCondition=false;nzPopconfirmShowArrow=true;nzIcon;nzAutoFocus=null;nzBeforeConfirm=null;nzOkText=qo(null);nzCancelText=qo(null);nzOkButtonProps=qo({nzType:"primary"});nzCancelButtonProps=qo(null);nzOnCancel=new re;nzOnConfirm=new re;_trigger="click";elementFocusedBeforeModalWasOpened=null;document=C(Uo);_prefix="ant-popover";confirmLoading=false;constructor(){super(),this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete();});}show(){this.nzCondition?this.onConfirm():(this.capturePreviouslyFocusedElement(),super.show());}hide(){super.hide(),this.restoreFocus();}handleConfirm(){this.nzOnConfirm.next(),super.hide();}onCancel(){this.nzOnCancel.next(),super.hide();}onConfirm(){this.nzBeforeConfirm?(this.confirmLoading=true,this.cdr.markForCheck(),Q0(this.nzBeforeConfirm()).pipe(em(),sn(Boolean),Gl(()=>{this.confirmLoading=false,this.cdr.markForCheck();})).subscribe(()=>this.handleConfirm())):this.handleConfirm();}capturePreviouslyFocusedElement(){this.document&&(this.elementFocusedBeforeModalWasOpened=this.document.activeElement);}restoreFocus(){this.elementFocusedBeforeModalWasOpened?.focus();}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ZE({type:i,selectors:[["nz-popconfirm"]],viewQuery:function(t,n){if(t&1&&Eh(dt,5,_r)(ft,5,_r),t&2){let o;WD(o=GD())&&(n.okBtn=o),WD(o=GD())&&(n.cancelBtn=o);}},exportAs:["nzPopconfirmComponent"],features:[th],decls:2,vars:5,consts:[["overlay","cdkConnectedOverlay"],["cancelBtn",""],["okBtn",""],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayOpen","nzArrowPointAtCenter"],["cdkTrapFocus","",1,"ant-popover",3,"cdkTrapFocusAutoCapture","nzNoAnimation"],[1,"ant-popover-arrow"],[1,"ant-popover-content"],[1,"ant-popover-inner"],[1,"ant-popover-inner-content"],[1,"ant-popover-message"],[1,"ant-popover-message-icon"],[1,"ant-popover-message-title"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[1,"ant-popover-buttons"],["nz-button","","nzSize","small",3,"click","nzDanger","disabled"],["nz-button","","nzSize","small",3,"click","nzType","nzDanger","nzLoading","disabled"],[4,"nzStringTemplateOutlet"],["nzTheme","fill",3,"nzType"]],template:function(t,n){t&1&&(rh(0,gt,21,26,"ng-template",3,0,Vw),mh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&lh("cdkConnectedOverlayHasBackdrop",n.nzBackdrop)("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayOpen",n._visible)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[vo,Wt,_o,Gl$1,zh,Fh,Mn,st,Ee,Ah,Th,pf,bd,sp,fp,$b,Zb],encapsulation:2})}return i})(),_n=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=KE({type:i});static \u0275inj=fu({imports:[it]})}return i})();export{Cn as C,_n as _};
|
|
1
|
+
import {a7 as KE,a8 as fu,aA as mT,aB as yT,a5 as q0,av as K0,U as Uw,s,r as r$1,ae as Le$1,u as ue,bR as eD,c3 as th,al as Sh,q as qo,ap as re,C,c4 as Uo,c5 as Q0,c6 as em,ar as sn,c7 as Gl,Z as ZE,c8 as vo,c9 as Wt,ca as _o,cb as Gl$1,cc as zh,cd as Fh,c0 as Mn,as as st,at as Ee,a3 as Ah,a4 as Th,Y as pf,a0 as bd,a1 as sp,a2 as fp,ce as $b,cf as Zb,aw as rh,m as mh,w as lh,ax as Eh,bf as _r,an as WD,ao as GD,aM as Yl,cg as oc,bW as Bl,ch as Sy,G as FD,j as _i,ci as oi,cj as ri,l as _D,J as Jc,ck as $h,P as Pw,I as Iw,H as HD,aQ as aw,aG as lw,o as gI,M as MD,D as ch,p as Fw,z as rl,cl as Vi,bV as XI,be as E3,b as at,cm as Wm,cn as S2,co as Kg,cp as Yg,cq as kg,cr as kr,cs as xy,ai as ly,ab as Oe,a9 as Z0,ct as Sr,cu as Cr,cv as me,cw as Rg,cx as yo,cy as _n$1,ac as Er,aD as Nr,n as uh,aJ as tl,aK as nl,ad as jr,L as Lh,aT as Vw,O as Fu,Q as ju}from'./main-Q5LNROCU.js';var lt=["overlay"];function ct(i,m){if(i&1&&(tl(0),Iw(1),nl()),i&2){let e=HD(2);gI(),Lh(e.nzTitle);}}function pt(i,m){if(i&1){let e=FD();_i(0,"div",2),oi(function(){Fu(e);let n=HD();return ju(n.zoomAnimationLeave())}),ri(function(){Fu(e);let n=HD();return ju(n.zoomAnimationEnter())}),uh(1,"div",3),_i(2,"div",4)(3,"div",5),rh(4,ct,2,1,"ng-container",6),Jc()()();}if(i&2){let e=HD();aw(e.nzOverlayStyle),lw(e._classMap),Sh("ant-tooltip-rtl",e.dir()==="rtl"),lh("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),aw(e._arrowStyleMap),gI(2),aw(e._contentStyleMap),gI(),lh("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext);}}var tt=(()=>{class i{componentType;elementRef=C(_r);hostView=C(Vi);renderer=C(XI);noAnimation=C(Mn,{host:true,optional:true});nzConfigService=C(E3);destroyRef=C(at);platformId=C(Wm);config;visibleChange=new Le$1;get _title(){return this.title||this.directiveTitle||null}get _content(){return this.content||this.directiveContent||null}get _trigger(){return typeof this.trigger<"u"?this.trigger:"hover"}get _placement(){let e=this.placement;return Array.isArray(e)&&e.length>0?e:typeof e=="string"&&e?[e]:["top"]}get _visible(){return (typeof this.visible<"u"?this.visible:this.internalVisible)||false}get _mouseEnterDelay(){return this.mouseEnterDelay||.15}get _mouseLeaveDelay(){return this.mouseLeaveDelay||.1}get _overlayClassName(){return this.overlayClassName||null}get _overlayStyle(){return this.overlayStyle||null}get _overlayClickable(){return this.overlayClickable??true}internalVisible=false;getProxyPropertyMap(){return {noAnimation:["noAnimation",()=>!!this.noAnimation]}}component;destroy$=new re;triggerDisposables=[];delayTimer;constructor(e){this.componentType=e,this.destroyRef.onDestroy(()=>{this.clearTogglingTimer(),this.removeTriggerListeners();});}ngAfterViewInit(){S2(this.platformId)&&(this.createComponent(),this.registerTriggers());}ngOnChanges(e){let{trigger:t}=e;t&&!t.isFirstChange()&&this.registerTriggers(),this.component&&this.updatePropertiesByChanges(e);}show(){this.component?.show();}hide(){this.component?.hide();}updatePosition(){this.component&&this.component.updatePosition();}createComponent(){let e=this.hostView.createComponent(this.componentType);this.component=e.instance,this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement),e.location.nativeElement),this.component.setOverlayOrigin(this.origin||this.elementRef),this.initProperties();let t=this.component.nzVisibleChange.pipe(Kg());t.pipe(ue(this.destroyRef)).subscribe(n=>{this.internalVisible=n,this.visibleChange.emit(n);}),t.pipe(sn(Boolean),Yg(0,kg),sn(()=>!!this.component?.overlay?.overlayRef),ue(this.destroyRef)).subscribe(()=>{this.component?.updatePosition();});}registerTriggers(){let e=this.elementRef.nativeElement,t=this.trigger;if(this.removeTriggerListeners(),t==="hover"){let n;this.triggerDisposables.push(this.renderer.listen(e,"mouseenter",()=>{this.delayEnterLeave(true,true,this._mouseEnterDelay);})),this.triggerDisposables.push(this.renderer.listen(e,"mouseleave",()=>{this.delayEnterLeave(true,false,this._mouseLeaveDelay),this.component?.overlay.overlayRef&&!n&&(n=this.component.overlay.overlayRef.overlayElement,this.triggerDisposables.push(this.renderer.listen(n,"mouseenter",()=>{this.delayEnterLeave(false,true,this._mouseEnterDelay);})),this.triggerDisposables.push(this.renderer.listen(n,"mouseleave",()=>{this.delayEnterLeave(false,false,this._mouseLeaveDelay);})));}));}else t==="focus"?(this.triggerDisposables.push(this.renderer.listen(e,"focusin",()=>this.show())),this.triggerDisposables.push(this.renderer.listen(e,"focusout",()=>this.hide()))):t==="click"&&this.triggerDisposables.push(this.renderer.listen(e,"click",n=>{n.preventDefault(),this.show();}));}updatePropertiesByChanges(e){this.updatePropertiesByKeys(Object.keys(e));}updatePropertiesByKeys(e){let t=r$1({title:["nzTitle",()=>this._title],directiveTitle:["nzTitle",()=>this._title],content:["nzContent",()=>this._content],directiveContent:["nzContent",()=>this._content],trigger:["nzTrigger",()=>this._trigger],placement:["nzPlacement",()=>this._placement],visible:["nzVisible",()=>this._visible],mouseEnterDelay:["nzMouseEnterDelay",()=>this._mouseEnterDelay],mouseLeaveDelay:["nzMouseLeaveDelay",()=>this._mouseLeaveDelay],overlayClassName:["nzOverlayClassName",()=>this._overlayClassName],overlayStyle:["nzOverlayStyle",()=>this._overlayStyle],overlayClickable:["nzOverlayClickable",()=>this._overlayClickable],arrowPointAtCenter:["nzArrowPointAtCenter",()=>this.arrowPointAtCenter]},this.getProxyPropertyMap());(e||Object.keys(t).filter(n=>!n.startsWith("directive"))).forEach(n=>{if(t[n]){let[o,c]=t[n];this.updateComponentValue(o,c());}}),this.component?.updateByDirective();}initProperties(){this.updatePropertiesByKeys();}updateComponentValue(e,t){typeof t<"u"&&(this.component[e]=t);}delayEnterLeave(e,t,n=-1){this.delayTimer?this.clearTogglingTimer():n>0?this.delayTimer=setTimeout(()=>{this.delayTimer=void 0,t?this.show():this.hide();},n*1e3):t&&e?this.show():this.hide();}removeTriggerListeners(){this.triggerDisposables.forEach(e=>e()),this.triggerDisposables.length=0;}clearTogglingTimer(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=void 0);}static \u0275fac=function(t){return new(t||i)(kr(xy))};static \u0275dir=eD({type:i,features:[ly]})}return i})(),mt=(()=>{class i{noAnimation=C(Mn,{host:true,optional:true});dir=C(Oe).valueSignal;cdr=C(Z0);elementRef=C(_r);destroyRef=C(at);overlay;nzTitle=null;nzContent=null;nzArrowPointAtCenter=false;nzOverlayClassName;nzOverlayStyle={};nzOverlayClickable=true;nzBackdrop=false;nzMouseEnterDelay;nzMouseLeaveDelay;nzVisibleChange=new re;set nzVisible(e){let t=jr(e);this._visible!==t&&(this._visible=t,this.nzVisibleChange.next(t));}get nzVisible(){return this._visible}_visible=false;set nzTrigger(e){this._trigger=e;}get nzTrigger(){return this._trigger}_trigger="hover";set nzPlacement(e){let t=e.map(n=>Sr(me[n],Cr[n]));this._positions=[...t,...Rg];}preferredPlacement="top";origin;_classMap={};_prefix="ant-tooltip";_positions=[...Rg];constructor(){this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete();});}show(){this.nzVisible||(this.isEmpty()||(this.nzVisible=true,this.nzVisibleChange.next(true),this.cdr.detectChanges()),this.origin&&this.overlay&&this.overlay.overlayRef&&this.overlay.overlayRef.getDirection()==="rtl"&&this.overlay.overlayRef.setDirection("ltr"));}hide(){this.nzVisible&&(this.nzVisible=false,this.nzVisibleChange.next(false),this.cdr.detectChanges());}updateByDirective(){this.updateStyles(),this.cdr.detectChanges(),Promise.resolve().then(()=>{this.updatePosition(),this.updateVisibilityByTitle();});}updatePosition(){this.origin&&this.overlay&&this.overlay.overlayRef&&this.overlay.overlayRef.updatePosition();}onPositionChange(e){this.preferredPlacement=yo(e),this.updateStyles(),this.cdr.detectChanges();}setOverlayOrigin(e){this.origin=e,this.cdr.markForCheck();}onClickOutside(e){if(!this.nzOverlayClickable)return;let t=_n$1(e);!this.origin.nativeElement.contains(t)&&this.nzTrigger!==null&&this.hide();}updateVisibilityByTitle(){this.isEmpty()&&this.hide();}updateStyles(){this._classMap=s(r$1({},this.transformClassListToMap(this.nzOverlayClassName)),{[`${this._prefix}-placement-${this.preferredPlacement}`]:true});}transformClassListToMap(e){let t={};return (e!==null?e.split(/\s+/):[]).forEach(o=>t[o]=true),t}static \u0275fac=function(t){return new(t||i)};static \u0275dir=eD({type:i,viewQuery:function(t,n){if(t&1&&Eh(lt,5),t&2){let o;WD(o=GD())&&(n.overlay=o.first);}}})}return i})();function ut(i){return i instanceof Er?false:i===""||!Nr(i)}var nt=(()=>{class i extends mt{_animationPrefix="ant-zoom-big-fast";nzTitle=null;nzTitleContext=null;nzColor;_arrowStyleMap={};_contentStyleMap={};zoomAnimationEnter=oc(()=>`${this._animationPrefix}-enter ${this._animationPrefix}-enter-active`);zoomAnimationLeave=oc(()=>`${this._animationPrefix}-leave ${this._animationPrefix}-leave-active`);isEmpty(){return ut(this.nzTitle)}updateStyles(){let e=this.nzColor&&Bl(this.nzColor);this._classMap=s(r$1({},this.transformClassListToMap(this.nzOverlayClassName)),{[`${this._prefix}-placement-${this.preferredPlacement}`]:true,[`${this._prefix}-${this.nzColor}`]:e}),this._contentStyleMap={backgroundColor:this.nzColor&&!e?this.nzColor:null},this._arrowStyleMap={"--antd-arrow-background-color":this.nzColor&&!e?this.nzColor:null};}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sy(i)))(n||i)}})();static \u0275cmp=ZE({type:i,selectors:[["nz-tooltip"]],exportAs:["nzTooltipComponent"],features:[th],decls:2,vars:4,consts:[["overlay","cdkConnectedOverlay"],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","nzArrowPointAtCenter"],[1,"ant-tooltip",3,"nzNoAnimation"],[1,"ant-tooltip-arrow"],[1,"ant-tooltip-content"],[1,"ant-tooltip-inner"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"]],template:function(t,n){t&1&&(rh(0,pt,5,13,"ng-template",1,0,Vw),mh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&lh("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayOpen",n._visible)("cdkConnectedOverlayPositions",n._positions)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[vo,Wt,Mn,st,Ee,_o,Gl$1],encapsulation:2})}return i})();var dt=["okBtn"],ft=["cancelBtn"];function zt(i,m){i&1&&uh(0,"div",5);}function ht(i,m){if(i&1&&(tl(0),uh(1,"nz-icon",17),nl()),i&2){let e=m.$implicit;gI(),lh("nzType",e||"exclamation-circle");}}function vt(i,m){if(i&1&&(_i(0,"span",10),rh(1,ht,2,1,"ng-container",16),Jc()),i&2){let e=HD(2);gI(),lh("nzStringTemplateOutlet",e.nzIcon);}}function yt(i,m){if(i&1&&(tl(0),Iw(1),nl()),i&2){let e=HD(2);gI(),rl(" ",e.nzTitle," ");}}function gt(i,m){if(i&1){let e=FD();_i(0,"div",4),oi(function(){Fu(e);let n=HD();return ju(n.zoomAnimationLeave())}),ri(function(){Fu(e);let n=HD();return ju(n.zoomAnimationEnter())}),_D(1,zt,1,0,"div",5),_i(2,"div",6)(3,"div",7)(4,"div")(5,"div",8)(6,"div",9),_D(7,vt,2,1,"span",10),_i(8,"div",11),rh(9,yt,2,1,"ng-container",12),Jc()(),_i(10,"div",13)(11,"button",14,1),mh("click",function(){Fu(e);let n=HD();return ju(n.onCancel())}),$h(13),Pw(14,"nzI18n"),Iw(15),Jc(),_i(16,"button",15,2),mh("click",function(){Fu(e);let n=HD();return ju(n.onConfirm())}),$h(18),Pw(19,"nzI18n"),Iw(20),Jc()()()()()()();}if(i&2){let e=HD();aw(e.nzOverlayStyle),lw(e._classMap),Sh("ant-popover-rtl",e.dir()==="rtl"),lh("cdkTrapFocusAutoCapture",e.nzAutoFocus!==null)("nzNoAnimation",!!e.noAnimation?.nzNoAnimation?.()),gI(),MD(e.nzPopconfirmShowArrow?1:-1),gI(6),MD(e.nzIcon!==null?7:-1),gI(2),lh("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext),gI(2),lh("nzDanger",e.nzCancelButtonProps()?.nzDanger)("disabled",e.nzCancelButtonProps()?.nzDisabled),ch("cdkFocusInitial",e.nzAutoFocus==="cancel"||null);let t=e.nzCancelText()||Fw(14,22,"Modal.cancelText");gI(4),rl(" ",t," "),gI(),lh("nzType",e.nzOkButtonProps().nzType)("nzDanger",e.nzOkButtonProps().nzDanger)("nzLoading",e.confirmLoading)("disabled",e.nzOkButtonProps().nzDisabled),ch("cdkFocusInitial",e.nzAutoFocus==="ok"||null);let n=e.nzOkText()||Fw(19,24,"Modal.okText");gI(4),rl(" ",n," ");}}var Ct="popconfirm",Cn=(()=>{let i=tt,m,e=[],t=[],n,o=[],c=[];return class he extends i{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;m=[Yl()],n=[Yl()],mT(null,null,m,{kind:"field",name:"nzPopconfirmBackdrop",static:false,private:false,access:{has:a=>"nzPopconfirmBackdrop"in a,get:a=>a.nzPopconfirmBackdrop,set:(a,N)=>{a.nzPopconfirmBackdrop=N;}},metadata:C},e,t),mT(null,null,n,{kind:"field",name:"nzAutofocus",static:false,private:false,access:{has:a=>"nzAutofocus"in a,get:a=>a.nzAutofocus,set:(a,N)=>{a.nzAutofocus=N;}},metadata:C},o,c),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}_nzModuleName=Ct;arrowPointAtCenter;title;titleContext=null;directiveTitle;trigger="click";placement="top";origin;mouseEnterDelay;mouseLeaveDelay;overlayClassName;overlayStyle;visible;nzBeforeConfirm;nzIcon;nzCondition=false;nzPopconfirmShowArrow=true;nzPopconfirmBackdrop=yT(this,e,false);nzAutofocus=(yT(this,t),yT(this,o,null));nzOkText=(yT(this,c),q0(null));nzOkType=q0("primary");nzCancelText=q0(null);nzOkButtonProps=q0(null);nzCancelButtonProps=q0(null);nzOkDisabled=q0(false,{transform:K0});nzOkDanger=q0(false,{transform:K0});okButtonProps=Uw(()=>s(r$1({},this.nzOkButtonProps()),{nzType:this.nzOkButtonProps()?.nzType||this.nzOkType()==="danger"?"primary":this.nzOkType(),nzDanger:this.nzOkDanger()||this.nzOkButtonProps()?.nzDanger||this.nzOkType()==="danger",nzDisabled:this.nzOkDisabled()||this.nzOkButtonProps()?.nzDisabled}));cancelButtonProps=Uw(()=>r$1({},this.nzCancelButtonProps()));directiveContent=null;content=null;overlayClickable;visibleChange=new Le$1;nzOnCancel=new Le$1;nzOnConfirm=new Le$1;getProxyPropertyMap(){return r$1({nzOkText:["nzOkText",()=>this.nzOkText],nzCancelText:["nzCancelText",()=>this.nzCancelText],nzOkButtonProps:["nzOkButtonProps",()=>this.okButtonProps],nzCancelButtonProps:["nzCancelButtonProps",()=>this.cancelButtonProps],nzBeforeConfirm:["nzBeforeConfirm",()=>this.nzBeforeConfirm],nzCondition:["nzCondition",()=>this.nzCondition],nzIcon:["nzIcon",()=>this.nzIcon],nzPopconfirmShowArrow:["nzPopconfirmShowArrow",()=>this.nzPopconfirmShowArrow],nzPopconfirmBackdrop:["nzBackdrop",()=>this.nzPopconfirmBackdrop],nzPopconfirmContext:["nzTitleContext",()=>this.titleContext],nzAutoFocus:["nzAutoFocus",()=>this.nzAutofocus]},super.getProxyPropertyMap())}constructor(){super(it);}createComponent(){super.createComponent(),this.component.nzOnCancel.pipe(ue(this.destroyRef)).subscribe(()=>{this.nzOnCancel.emit();}),this.component.nzOnConfirm.pipe(ue(this.destroyRef)).subscribe(()=>{this.nzOnConfirm.emit();});}static \u0275fac=function(a){return new(a||he)};static \u0275dir=eD({type:he,selectors:[["","nz-popconfirm",""]],hostVars:2,hostBindings:function(a,N){a&2&&Sh("ant-popover-open",N.visible);},inputs:{arrowPointAtCenter:[2,"nzPopconfirmArrowPointAtCenter","arrowPointAtCenter",K0],title:[0,"nzPopconfirmTitle","title"],titleContext:[0,"nzPopconfirmTitleContext","titleContext"],directiveTitle:[0,"nz-popconfirm","directiveTitle"],trigger:[0,"nzPopconfirmTrigger","trigger"],placement:[0,"nzPopconfirmPlacement","placement"],origin:[0,"nzPopconfirmOrigin","origin"],mouseEnterDelay:[0,"nzPopconfirmMouseEnterDelay","mouseEnterDelay"],mouseLeaveDelay:[0,"nzPopconfirmMouseLeaveDelay","mouseLeaveDelay"],overlayClassName:[0,"nzPopconfirmOverlayClassName","overlayClassName"],overlayStyle:[0,"nzPopconfirmOverlayStyle","overlayStyle"],visible:[0,"nzPopconfirmVisible","visible"],nzBeforeConfirm:"nzBeforeConfirm",nzIcon:"nzIcon",nzCondition:[2,"nzCondition","nzCondition",K0],nzPopconfirmShowArrow:[2,"nzPopconfirmShowArrow","nzPopconfirmShowArrow",K0],nzPopconfirmBackdrop:"nzPopconfirmBackdrop",nzAutofocus:"nzAutofocus",nzOkText:[1,"nzOkText"],nzOkType:[1,"nzOkType"],nzCancelText:[1,"nzCancelText"],nzOkButtonProps:[1,"nzOkButtonProps"],nzCancelButtonProps:[1,"nzCancelButtonProps"],nzOkDisabled:[1,"nzOkDisabled"],nzOkDanger:[1,"nzOkDanger"]},outputs:{visibleChange:"nzPopconfirmVisibleChange",nzOnCancel:"nzOnCancel",nzOnConfirm:"nzOnConfirm"},exportAs:["nzPopconfirm"],features:[th]})}})(),it=(()=>{class i extends nt{_animationPrefix="ant-zoom-big";okBtn;cancelBtn;nzCondition=false;nzPopconfirmShowArrow=true;nzIcon;nzAutoFocus=null;nzBeforeConfirm=null;nzOkText=qo(null);nzCancelText=qo(null);nzOkButtonProps=qo({nzType:"primary"});nzCancelButtonProps=qo(null);nzOnCancel=new re;nzOnConfirm=new re;_trigger="click";elementFocusedBeforeModalWasOpened=null;document=C(Uo);_prefix="ant-popover";confirmLoading=false;constructor(){super(),this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete();});}show(){this.nzCondition?this.onConfirm():(this.capturePreviouslyFocusedElement(),super.show());}hide(){super.hide(),this.restoreFocus();}handleConfirm(){this.nzOnConfirm.next(),super.hide();}onCancel(){this.nzOnCancel.next(),super.hide();}onConfirm(){this.nzBeforeConfirm?(this.confirmLoading=true,this.cdr.markForCheck(),Q0(this.nzBeforeConfirm()).pipe(em(),sn(Boolean),Gl(()=>{this.confirmLoading=false,this.cdr.markForCheck();})).subscribe(()=>this.handleConfirm())):this.handleConfirm();}capturePreviouslyFocusedElement(){this.document&&(this.elementFocusedBeforeModalWasOpened=this.document.activeElement);}restoreFocus(){this.elementFocusedBeforeModalWasOpened?.focus();}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ZE({type:i,selectors:[["nz-popconfirm"]],viewQuery:function(t,n){if(t&1&&Eh(dt,5,_r)(ft,5,_r),t&2){let o;WD(o=GD())&&(n.okBtn=o),WD(o=GD())&&(n.cancelBtn=o);}},exportAs:["nzPopconfirmComponent"],features:[th],decls:2,vars:5,consts:[["overlay","cdkConnectedOverlay"],["cancelBtn",""],["okBtn",""],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayOpen","nzArrowPointAtCenter"],["cdkTrapFocus","",1,"ant-popover",3,"cdkTrapFocusAutoCapture","nzNoAnimation"],[1,"ant-popover-arrow"],[1,"ant-popover-content"],[1,"ant-popover-inner"],[1,"ant-popover-inner-content"],[1,"ant-popover-message"],[1,"ant-popover-message-icon"],[1,"ant-popover-message-title"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[1,"ant-popover-buttons"],["nz-button","","nzSize","small",3,"click","nzDanger","disabled"],["nz-button","","nzSize","small",3,"click","nzType","nzDanger","nzLoading","disabled"],[4,"nzStringTemplateOutlet"],["nzTheme","fill",3,"nzType"]],template:function(t,n){t&1&&(rh(0,gt,21,26,"ng-template",3,0,Vw),mh("overlayOutsideClick",function(c){return n.onClickOutside(c)})("detach",function(){return n.hide()})("positionChange",function(c){return n.onPositionChange(c)})),t&2&&lh("cdkConnectedOverlayHasBackdrop",n.nzBackdrop)("cdkConnectedOverlayOrigin",n.origin)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayOpen",n._visible)("nzArrowPointAtCenter",n.nzArrowPointAtCenter);},dependencies:[vo,Wt,_o,Gl$1,zh,Fh,Mn,st,Ee,Ah,Th,pf,bd,sp,fp,$b,Zb],encapsulation:2})}return i})(),_n=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=KE({type:i});static \u0275inj=fu({imports:[it]})}return i})();export{Cn as C,_n as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p as pc,a as as,d as dc,K as Kl,U as Ul,c as cc,J as Ji,l as ls,e as es}from'./chunk-
|
|
1
|
+
import {p as pc,a as as,d as dc,K as Kl,U as Ul,c as cc,J as Ji,l as ls,e as es}from'./chunk-DF1Zujdm.js';import {a5 as q0,a6 as U0,q as qo,U as Uw,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,I as Iw,P as Pw,J as Jc,x as xD,o as gI,M as MD,w as lh,L as Lh,p as Fw,B as AD,G as FD,m as mh,H as HD,z as rl,az as jw,E as Aw,D as ch,O as Fu,Q as ju}from'./main-Q5LNROCU.js';var Q=t=>({count:t}),U=t=>["/jobs",t],X=(t,c)=>c.id;function Y(t,c){if(t&1){let e=FD();_i(0,"div",1)(1,"button",4),mh("click",function(){Fu(e);let o=HD();return ju(o.emitBulk())}),Iw(2),Pw(3,"transloco"),Jc()();}if(t&2){let e=HD();gI(),lh("disabled",e.checkedCount()===0),gI(),rl(" ",jw(3,2,"runnableTable.runSelected",Aw(5,Q,e.checkedCount()))," ");}}function Z(t,c){if(t&1){let e=FD();_i(0,"th",5),mh("nzCheckedChange",function(o){Fu(e);let s=HD();return ju(s.onAllChecked(o))}),Jc();}if(t&2){let e=HD();lh("nzChecked",e.allChecked())("nzIndeterminate",e.someChecked());}}function ee(t,c){t&1&&(_i(0,"th"),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"runnableTable.column.actions")));}function te(t,c){if(t&1){let e=FD();_i(0,"td",12),mh("nzCheckedChange",function(o){Fu(e);let s=HD().$implicit,H=HD();return ju(H.onItemChecked(s.id,o))}),Jc();}if(t&2){let e=HD().$implicit,n=HD();lh("nzChecked",n.checkedIds().has(e.id)),ch("data-testid","check-"+e.id);}}function ne(t,c){if(t&1&&(_i(0,"span",9),Iw(1),Jc()),t&2){let e=HD().$implicit;ch("data-testid","subtitle-"+e.id),gI(),Lh(e.subtitle);}}function ie(t,c){if(t&1&&(_i(0,"a",10),Iw(1),Pw(2,"transloco"),Jc()),t&2){let e=c,n=HD().$implicit,o=HD();lh("routerLink",Aw(5,U,e.id)),ch("data-testid","latest-"+n.id),gI(),rl(" ",Fw(2,3,o.statusKey(e.status))," ");}}function oe(t,c){if(t&1&&(_i(0,"span",11),Iw(1),Pw(2,"transloco"),Jc()),t&2){let e=HD().$implicit;ch("data-testid","latest-"+e.id),gI(),Lh(Fw(2,2,"runnableTable.neverRun"));}}function ae(t,c){if(t&1){let e=FD();_i(0,"td")(1,"button",13),mh("click",function(){Fu(e);let o=HD().$implicit,s=HD();return ju(s.emitRow(o.id))}),Iw(2),Pw(3,"transloco"),Jc()();}if(t&2){let e=HD().$implicit;gI(),ch("data-testid","run-"+e.id),gI(),rl(" ",Fw(3,2,"runnableTable.run")," ");}}function le(t,c){if(t&1&&(_i(0,"tr"),_D(1,te,1,2,"td",6),_i(2,"td")(3,"div",7)(4,"span",8),Iw(5),Jc(),_D(6,ne,2,2,"span",9),Jc()(),_i(7,"td"),_D(8,ie,3,7,"a",10)(9,oe,3,4,"span",11),Jc(),_D(10,ae,4,4,"td"),Jc()),t&2){let e,n=c.$implicit,o=HD();ch("data-testid","row-"+n.id),gI(),MD(o.selectable()?1:-1),gI(3),ch("data-testid","label-"+n.id),gI(),Lh(n.primaryLabel),gI(),MD(n.subtitle?6:-1),gI(2),MD((e=n.latestJob)?8:9,e),gI(2),MD(o.showRowAction()?10:-1);}}var we=(()=>{class t{constructor(){this.rows=q0([]),this.selectable=q0(false),this.showRowAction=q0(true),this.rowAction=U0(),this.bulkAction=U0(),this.checkedIds=qo(new Set),this.checkedCount=Uw(()=>this.checkedIds().size),this.allChecked=Uw(()=>{let e=this.rows();return e.length>0&&e.every(n=>this.checkedIds().has(n.id))}),this.someChecked=Uw(()=>{let e=this.checkedCount();return e>0&&e<this.rows().length});}onItemChecked(e,n){this.checkedIds.update(o=>{let s=new Set(o);return n?s.add(e):s.delete(e),s});}onAllChecked(e){this.checkedIds.set(e?new Set(this.rows().map(n=>n.id)):new Set);}emitBulk(){this.bulkAction.emit([...this.checkedIds()]);}emitRow(e){this.rowAction.emit(e);}statusKey(e){return `jobs.status.${e}`}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-runnable-items-table"]],inputs:{rows:[1,"rows"],selectable:[1,"selectable"],showRowAction:[1,"showRowAction"]},outputs:{rowAction:"rowAction",bulkAction:"bulkAction"},decls:16,vars:12,consts:[["data-testid","runnable-items-table",1,"runnable-table"],["data-testid","bulk-bar",1,"bulk-bar"],[3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","select-all",3,"nzChecked","nzIndeterminate"],["nz-button","","type","button","data-testid","run-selected",3,"click","disabled"],["data-testid","select-all",3,"nzCheckedChange","nzChecked","nzIndeterminate"],[3,"nzChecked"],[1,"item"],[1,"primary"],[1,"subtitle"],[3,"routerLink"],[1,"never"],[3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"]],template:function(n,o){n&1&&(_i(0,"div",0),_D(1,Y,4,7,"div",1),_i(2,"nz-table",2)(3,"thead")(4,"tr"),_D(5,Z,1,2,"th",3),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_D(12,ee,3,3,"th"),Jc()(),_i(13,"tbody"),xD(14,le,11,7,"tr",null,X),Jc()()()),n&2&&(gI(),MD(o.selectable()?1:-1),gI(),lh("nzData",o.rows())("nzFrontPagination",false)("nzShowPagination",false),gI(3),MD(o.selectable()?5:-1),gI(2),Lh(Fw(8,8,"runnableTable.column.item")),gI(3),Lh(Fw(11,10,"runnableTable.column.latestRun")),gI(2),MD(o.showRowAction()?12:-1),gI(2),AD(o.rows()));},dependencies:[$8,v3,pf,bd,sp,fp,pc,as,dc,Kl,Ul,cc,Ji,ls,es,Kt],styles:[".runnable-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.bulk-bar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem}.primary[_ngcontent-%COMP%]{font-weight:600}.subtitle[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.never[_ngcontent-%COMP%]{color:#78716c}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return t})();export{we as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f}from'./chunk-
|
|
1
|
+
import {f}from'./chunk-8INlEe9b.js';import {C,b as at,a5 as q0,a6 as U0,q as qo,u as ue,s,r as r$1,Z as ZE,d as $8,K as Kt,bm as Xc,x as xD,bn as el,o as gI,B as AD,I as Iw,l as _D,z as rl,M as MD,G as FD,bL as yh,O as Fu,H as HD,Q as ju,c_ as hh,D as ch,N as ND,aR as xw,P as Pw,L as Lh,p as Fw}from'./main-Q5LNROCU.js';var q=()=>[],A=(t,o)=>o.name,B=(t,o)=>o.id;function j(t,o){t&1&&(Xc(0,"span",1),Iw(1,"*"),el());}function z(t,o){if(t&1){let e=FD();Xc(0,"input",6),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("checked",n.checked(e)),ch("data-testid","input-"+e.name);}}function U(t,o){if(t&1){let e=FD();Xc(0,"input",7),yh("input",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name);}}function G(t,o){if(t&1&&(Xc(0,"option",4),Iw(1),el()),t&2){let e=o.$implicit;hh("value",e),gI(),Lh(e);}}function H(t,o){if(t&1){let e=FD();Xc(0,"select",8),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),xD(1,G,2,2,"option",4,ND),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name),gI(),AD(e.options??xw(2,q));}}function J(t,o){if(t&1&&(Xc(0,"option",4),Iw(1),el()),t&2){let e=o.$implicit;hh("value",e.id),gI(),Lh(e.name);}}function K(t,o){if(t&1){let e=FD();Xc(0,"select",8),yh("change",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),Xc(1,"option",9),Iw(2),Pw(3,"transloco"),el(),xD(4,J,2,2,"option",4,B),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name),gI(2),Lh(Fw(3,3,"workflow-input.localRepositoryPlaceholder")),gI(2),AD(n.localRepositories());}}function Q(t,o){if(t&1){let e=FD();Xc(0,"input",10),yh("input",function(r){Fu(e);let a=HD().$implicit,c=HD();return ju(c.setValue(a,r))}),el();}if(t&2){let e=HD().$implicit,n=HD();hh("value",n.displayValue(e)),ch("data-testid","input-"+e.name);}}function X(t,o){if(t&1&&(Xc(0,"label"),Iw(1),_D(2,j,2,0,"span",1),_D(3,z,1,2,"input",2)(4,U,1,2,"input",3)(5,H,3,3,"select",4)(6,K,6,5,"select",4)(7,Q,1,2,"input",5),el()),t&2){let e,n=o.$implicit;gI(),rl(" ",n.label," "),gI(),MD(n.required?2:-1),gI(),MD((e=n.type)==="boolean"?3:e==="number"?4:e==="select"?5:e==="localRepository"?6:7);}}function Y(t){if(t.defaultValue!==void 0)return t.defaultValue;switch(t.type){case "boolean":return false;case "number":return "";case "select":return t.options?.[0]??"";default:return ""}}function ae(t){let o={};for(let e of t)o[e.name]=Y(e);return o}var le=(()=>{class t{constructor(){this.reposApi=C(f),this.destroyRef=C(at),this.fields=q0([]),this.values=q0({}),this.valuesChange=U0(),this.localRepositories=qo([]),this.reposApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.localRepositories.set(e),error:()=>this.localRepositories.set([])});}displayValue(e){let n=this.values()[e.name];return n==null?"":String(n)}checked(e){return !!this.values()[e.name]}setValue(e,n){let r=n.target,a=r.value;e.type==="boolean"?a=r.checked:e.type==="number"&&(a=r.value===""?"":Number(r.value)),this.valuesChange.emit(s(r$1({},this.values()),{[e.name]:a}));}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-workflow-input-form"]],inputs:{fields:[1,"fields"],values:[1,"values"]},outputs:{valuesChange:"valuesChange"},decls:3,vars:0,consts:[["data-testid","workflow-input-form",1,"input-form"],[1,"required"],["type","checkbox",3,"checked"],["type","number",3,"value"],[3,"value"],["type","text",3,"value"],["type","checkbox",3,"change","checked"],["type","number",3,"input","value"],[3,"change","value"],["value",""],["type","text",3,"input","value"]],template:function(n,r){n&1&&(Xc(0,"div",0),xD(1,X,8,3,"label",null,A),el()),n&2&&(gI(),AD(r.fields()));},dependencies:[$8,Kt],styles:["label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}input[type=checkbox][_ngcontent-%COMP%]{width:1.1rem;height:1.1rem}.required[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{ae as a,le as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {l}from'./chunk-D19C8Gcb.js';import {T}from'./chunk-DVJ9L-aC.js';import {_ as _n,C as Cn}from'./chunk-CPNxRF7A.js';import {C,V as Ve,b as at,b0 as jn,R as J1,q as qo,u as ue,aS as v,aY as Dg,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,h as ex,F as Fm,A as Am,K as Kt$1,G as FD,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,b2 as Le,b3 as Wn,az as jw,E as Aw,H as HD,x as xD,N as ND,k as iE,y as aE,B as AD,b4 as N2,aV as ix,b5 as cx,i as ie$1,n as uh,D as ch,aO as SD,aP as Mh,O as Fu,Q as ju,aH as QD}from'./main-SI5AKDMC.js';import {b}from'./chunk-Dx92ksvP.js';import {N as Nt,K as Ke}from'./chunk-BCHj6l85.js';import {n as ng,i as i_}from'./chunk-D3JZ8ur5.js';import {W,I}from'./chunk-5xJXPFlv.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-DAONFRT8.js';import'./chunk-CLM-K-Vg.js';var Ot=i=>({name:i}),Lt=(()=>{class i{constructor(){this.modalRef=C(Le),this.data=C(Wn);}cancel(){this.modalRef.close(void 0);}choose(t){this.modalRef.close(t);}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-import-conflict"]],decls:14,vars:15,consts:[["data-testid","import-conflict-dialog"],["data-testid","import-conflict-message"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","import-conflict-cancel",3,"click"],["nz-button","","type","button","data-testid","import-conflict-create-new",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","import-conflict-update",3,"click"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"button",3),mh("click",function(){return a.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",4),mh("click",function(){return a.choose("create_new")}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",5),mh("click",function(){return a.choose("update")}),Iw(12),Pw(13,"transloco"),Jc()()()),e&2&&(gI(2),rl$1(" ",jw(3,4,"workflows.import.conflictBody",Aw(13,Ot,a.data.name))," "),gI(4),rl$1(" ",Fw(7,7,"common.cancel")," "),gI(3),rl$1(" ",Fw(10,9,"workflows.import.createNew")," "),gI(3),rl$1(" ",Fw(13,11,"workflows.import.update")," "));},dependencies:[pf,bd,sp,fp,Kt$1],styles:["p[_ngcontent-%COMP%]{margin:0 0 1.25rem;color:#44403c}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}"]});}}return i})();var Pt=(()=>{class i{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflow-library`;}list(){return this.http.get(this.baseUrl).pipe(cx())}add(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/add`,{}).pipe(cx())}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275prov=ie$1({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();var At=(i,d)=>d.id;function Vt(i,d){i&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Rt(i,d){if(i&1&&(_i(0,"p",3),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function Ht(i,d){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.addError());}}function Kt(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD(3);gI(),Lh(Fw(2,1,e.subjectTypeKey(t)));}}function Ut(i,d){if(i&1&&(_i(0,"li")(1,"span"),Iw(2),Jc(),_i(3,"span",14),Iw(4),Pw(5,"transloco"),Jc()()),i&2){let t=d.$implicit,e=HD(4);Mh("margin-left",t.depth,"rem"),gI(2),Lh(t.name),gI(2),Lh(Fw(5,4,e.stepTypeKey(t.type)));}}function Jt(i,d){if(i&1&&(_i(0,"ol",12),xD(1,Ut,6,6,"li",13,SD),Jc()),i&2){let t=HD().$implicit,e=HD(2);ch("data-testid","library-steps-"+t.id),gI(),AD(e.previewSteps(t));}}function Zt(i,d){if(i&1){let t=FD();_i(0,"nz-card")(1,"div",6)(2,"h2"),Iw(3),Jc(),_i(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"p",7),Iw(8),Jc(),_i(9,"div",8),xD(10,Kt,3,3,"nz-tag",null,ND),Jc(),_i(12,"div",9)(13,"button",10),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.togglePreview(a.id))}),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",11),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.addToMyWorkflows(a.id))}),Iw(17),Pw(18,"transloco"),Jc()(),_D(19,Jt,3,1,"ol",12),Jc();}if(i&2){let t=d.$implicit,e=HD(2);ch("data-testid","library-entry-"+t.id),gI(2),ch("data-testid","library-name-"+t.id),gI(),Lh(t.name),gI(),ch("data-testid","library-source-"+t.id),gI(),Lh(Fw(6,13,e.sourceKey(t.source))),gI(2),ch("data-testid","library-description-"+t.id),gI(),rl$1(" ",t.description," "),gI(2),AD(e.appliesToValues(t)),gI(3),ch("data-testid","library-preview-"+t.id),gI(),rl$1(" ",Fw(15,15,e.isExpanded(t.id)?"workflow-library.hideSteps":"workflow-library.previewSteps")," "),gI(2),lh("disabled",e.addingId()!==null),ch("data-testid","library-add-"+t.id),gI(),rl$1(" ",Fw(18,17,e.addingId()===t.id?"workflow-library.adding":"workflow-library.add")," "),gI(2),MD(e.isExpanded(t.id)?19:-1);}}function qt(i,d){if(i&1&&(_D(0,Ht,2,1,"p",4),_i(1,"div",5),xD(2,Zt,20,19,"nz-card",null,At),Jc()),i&2){let t=HD();MD(t.addError()?0:-1),gI(2),AD(t.entries());}}var jt=(()=>{class i{constructor(){this.libraryApi=C(Pt),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.modalRef=C(Le,{optional:true}),this.entries=qo([]),this.loading=qo(true),this.loadError=qo(null),this.addError=qo(null),this.addingId=qo(null),this.expandedIds=qo(new Set),this.libraryApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.entries.set(t),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("workflow-library.loadFailed")));}});}sourceKey(t){return `workflow-library.source.${t}`}appliesToValues(t){let e=t.workflowDefinition.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}stepTypeKey(t){return `step-list.stepType.${t}`}isExpanded(t){return this.expandedIds().has(t)}togglePreview(t){this.expandedIds.update(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a});}previewSteps(t){return Dt(t.workflowDefinition.steps,0)}addToMyWorkflows(t){this.addingId()||(this.addError.set(null),this.addingId.set(t),this.libraryApi.add(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.addingId.set(null),this.modalRef?.close(),this.router.navigate(["/workflows",e.id,"edit"]);},error:e=>{this.addingId.set(null),this.addError.set(this.errorMessage(e,this.transloco.translate("workflow-library.addFailed")));}}));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-library-browser"]],decls:7,vars:4,consts:[["data-testid","workflow-library-browser",1,"library"],[1,"lede"],["data-testid","library-loading"],["data-testid","library-load-error",1,"error"],["data-testid","library-add-error",1,"error"],[1,"cards"],[1,"card-head"],[1,"description"],[1,"applies-to"],[1,"card-actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","primary","type","button",3,"click","disabled"],[1,"steps-preview"],[3,"margin-left"],[1,"step-type"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_D(4,Vt,3,3,"p",2)(5,Rt,2,1,"p",3)(6,qt,4,1),Jc()),e&2&&(gI(2),Lh(Fw(3,2,"workflow-library.lede")),gI(2),MD(a.loading()?4:a.loadError()?5:6));},dependencies:[$8,pf,bd,sp,fp,Nt,Ke,W,I,Kt$1],styles:[".library[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.lede[_ngcontent-%COMP%]{margin:0;color:#57534e}.cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.card-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.card-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600}.description[_ngcontent-%COMP%]{margin:.5rem 0 0;color:#57534e}.applies-to[_ngcontent-%COMP%]{margin-top:.5rem}.card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.steps-preview[_ngcontent-%COMP%]{margin:.75rem 0 0;padding-left:1.25rem;color:#44403c}.steps-preview[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;margin:.25rem 0}.step-type[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();function Dt(i,d){let t=[];for(let e of i)t.push({name:e.name,type:e.type,depth:d}),e.type==="loop"&&Array.isArray(e.steps)&&t.push(...Dt(e.steps,d+1));return t}var Gt=i=>({count:i}),Qt=i=>["/workflows",i,"edit"],Xt=(i,d)=>d.id;function Yt(i,d){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.actionError());}}function te(i,d){i&1&&(_i(0,"p",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ee(i,d){if(i&1&&(_i(0,"p",11),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ie(i,d){if(i&1&&(uh(0,"nz-option",14),Pw(1,"transloco")),i&2){let t=d.$implicit,e=HD(2);lh("nzValue",t)("nzLabel",Fw(1,2,e.subjectHandlingFilterKey(t)));}}function ne(i,d){if(i&1&&(_i(0,"p",15),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.deleteError());}}function oe(i,d){if(i&1){let t=FD();_i(0,"section",16)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",18)(5,"button",19),mh("click",function(){Fu(t);let a=HD(2);return ju(a.openLibrary())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",20),Iw(9),Pw(10,"transloco"),Jc()()();}i&2&&(gI(2),Lh(Fw(3,3,"workflows.list.emptyState")),gI(4),rl$1(" ",Fw(7,5,"workflows.list.emptyBrowseLibrary")," "),gI(3),rl$1(" ",Fw(10,7,"workflows.list.emptyCreateButton")," "));}function re(i,d){if(i&1&&(_i(0,"span"),Iw(1),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(t.description);}}function ae(i,d){if(i&1&&(_i(0,"span",22),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(Fw(2,2,"workflows.list.noDescription"));}}function le(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD().$implicit,a=HD(3);ch("data-testid","applies-to-"+e.id),gI(),Lh(Fw(2,2,a.subjectTypeKey(t)));}}function se(i,d){if(i&1){let t=FD();_i(0,"tr")(1,"td")(2,"span"),Iw(3),Jc()(),_i(4,"td",21),_D(5,re,2,2,"span")(6,ae,3,4,"span",22),Jc(),_i(7,"td"),xD(8,le,3,4,"nz-tag",null,ND),Jc(),_i(10,"td")(11,"nz-tag"),Iw(12),Pw(13,"transloco"),Jc()(),_i(14,"td")(15,"span"),Iw(16),Pw(17,"transloco"),Jc()(),_i(18,"td",23)(19,"a",24),Iw(20),Pw(21,"transloco"),Jc(),_i(22,"button",25),mh("click",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.exportWorkflow(a))}),Iw(23),Pw(24,"transloco"),Jc(),_i(25,"button",26),Pw(26,"transloco"),Pw(27,"transloco"),Pw(28,"transloco"),mh("nzOnConfirm",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.deleteWorkflow(a.id))}),Iw(29),Pw(30,"transloco"),Jc()()();}if(i&2){let t=d.$implicit,e=HD(3);ch("data-testid","workflow-"+t.id),gI(2),ch("data-testid","name-"+t.id),gI(),Lh(t.name),gI(2),MD(t.description?.trim()?5:6),gI(3),AD(e.appliesToValues(t)),gI(3),ch("data-testid","subject-handling-"+t.id),gI(),Lh(Fw(13,18,e.subjectHandlingKey(t.subjectHandling))),gI(3),ch("data-testid","step-count-"+t.id),gI(),Lh(jw(17,20,"workflows.list.stepCount",Aw(35,Gt,t.steps.length))),gI(3),lh("routerLink",Aw(37,Qt,t.id)),ch("data-testid","edit-"+t.id),gI(),rl$1(" ",Fw(21,23,"workflows.list.edit")," "),gI(2),ch("data-testid","export-"+t.id),gI(),rl$1(" ",Fw(24,25,"workflows.list.export")," "),gI(2),lh("nzPopconfirmTitle",Fw(26,27,"workflows.list.deleteConfirm"))("nzOkText",Fw(27,29,"workflows.list.delete"))("nzCancelText",Fw(28,31,"common.cancel")),ch("data-testid","delete-"+t.id),gI(4),rl$1(" ",Fw(30,33,"workflows.list.delete")," ");}}function pe(i,d){if(i&1&&(_i(0,"nz-table",17)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,se,31,39,"tr",null,Xt),Jc()()),i&2){let t=HD(2);lh("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,9,"workflows.list.column.name")),gI(3),Lh(Fw(8,11,"workflows.list.column.description")),gI(3),Lh(Fw(11,13,"workflow-editor.appliesTo")),gI(3),Lh(Fw(14,15,"workflow-editor.subjectHandling.label")),gI(3),Lh(Fw(17,17,"workflows.list.column.steps")),gI(3),Lh(Fw(20,19,"workflows.list.column.actions")),gI(3),AD(t.workflows());}}function de(i,d){if(i&1){let t=FD();_i(0,"div",12)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",13),mh("ngModelChange",function(a){Fu(t);let f=HD();return ju(f.setSubjectHandlingFilter(a))}),xD(5,ie,2,4,"nz-option",14,ND),Jc(),iE(),Jc(),_D(7,ne,2,1,"p",15),_D(8,oe,11,9,"section",16)(9,pe,24,21,"nz-table",17);}if(i&2){let t=HD();gI(2),Lh(Fw(3,4,"workflows.list.filterBySubjectHandling")),gI(2),lh("ngModel",t.subjectHandlingFilter()),aE(),gI(),AD(t.subjectHandlingOptions),gI(2),MD(t.deleteError()?7:-1),gI(),MD(t.workflows().length===0?8:9);}}var si=(()=>{class i{constructor(){this.workflowsApi=C(b),this.transloco=C(Ve),this.destroyRef=C(at),this.modal=C(jn),this.router=C(J1),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.actionError=qo(null),this.importing=qo(false),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let e=t.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}subjectHandlingKey(t){return `workflow-editor.subjectHandling.${t}`}subjectHandlingFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.subjectHandling.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.workflows.update(e=>e.filter(a=>a.id!==t));},error:e=>{this.deleteError.set(this.errorMessage(e,this.transloco.translate("workflows.list.deleteFailed")));}});}openLibrary(){this.modal.create({nzTitle:this.transloco.translate("workflow-library.title"),nzContent:jt,nzFooter:null,nzWidth:720});}exportWorkflow(t){this.actionError.set(null),this.workflowsApi.exportDefinition(t.id).pipe(ue(this.destroyRef)).subscribe({next:e=>{l(`${ng(e.name)}.json`,JSON.stringify(e,null,2),"application/json");},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("workflows.list.exportFailed")));}});}downloadInstructions(){this.actionError.set(null),this.workflowsApi.getInstructions().pipe(ue(this.destroyRef)).subscribe({next:t=>{l("knoflows-workflow-agent-instructions.md",t,"text/markdown;charset=utf-8");},error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("workflows.list.instructionsFailed")));}});}onImportFile(t){let e=t.target,a=e.files?.[0];e.value="",!(!a||this.importing())&&this.readAndImport(a);}importJsonText(t){this.actionError.set(null);let e;try{e=JSON.parse(t);}catch(f){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));return}let a=i_.safeParse(e);if(!a.success){let f=T(a.error);this.actionError.set(`${this.transloco.translate("workflows.list.importInvalidSchema")}: ${f[0]??""}`);return}this.postImport(e);}readAndImport(t){return v(this,null,function*(){try{this.importJsonText(yield t.text());}catch(e){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));}})}postImport(t,e){this.importing.set(true),this.actionError.set(null),this.workflowsApi.importDefinition(e?{workflowDefinition:t,resolution:e}:{workflowDefinition:t}).pipe(ue(this.destroyRef)).subscribe({next:a=>{this.importing.set(false),this.router.navigate(["/workflows",a.id,"edit"]);},error:a=>{this.importing.set(false);let f=this.importConflict(a);if(f&&!e){this.openImportConflict(t,f.name);return}this.actionError.set(this.errorMessage(a,this.transloco.translate("workflows.list.importFailed")));}});}openImportConflict(t,e){(this.modal.create({nzTitle:this.transloco.translate("workflows.import.conflictTitle"),nzContent:Lt,nzData:{name:e},nzFooter:null}).afterClose??Dg(void 0)).pipe(ue(this.destroyRef)).subscribe(T=>{(T==="update"||T==="create_new")&&this.postImport(t,T);});}importConflict(t){if(!(t instanceof bi)||t.httpStatus!==409||!t.details)return null;let e=t.details.conflictingWorkflowId,a=t.details.conflictingWorkflowName;return typeof e!="string"||typeof a!="string"?null:{id:e,name:a}}load(){let t=this.subjectHandlingFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{subjectHandling:t}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("workflows.list.loadFailed")));}});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-list"]],decls:24,vars:18,consts:[["importFileInput",""],["data-testid","workflows-list",1,"list-page"],[1,"header"],[1,"header-actions"],["type","file","accept","application/json,.json","hidden","","data-testid","import-file",3,"change"],["nz-button","","type","button","data-testid","import-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","download-instructions",3,"click"],["nz-button","","type","button","data-testid","browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","action-error",1,"error"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","subject-handling-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],[1,"empty-actions"],["nz-button","","type","button","data-testid","empty-browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(e,a){if(e&1){let f=FD();_i(0,"main",1)(1,"header",2)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",3)(6,"input",4,0),mh("change",function(U){return a.onImportFile(U)}),Jc(),_i(8,"button",5),mh("click",function(){Fu(f);let U=QD(7);return ju(U.click())}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",6),mh("click",function(){return a.downloadInstructions()}),Iw(12),Pw(13,"transloco"),Jc(),_i(14,"button",7),mh("click",function(){return a.openLibrary()}),Iw(15),Pw(16,"transloco"),Jc(),_i(17,"a",8),Iw(18),Pw(19,"transloco"),Jc()()(),_D(20,Yt,2,1,"p",9),_D(21,te,3,3,"p",10)(22,ee,2,1,"p",11)(23,de,10,6),Jc();}e&2&&(gI(3),Lh(Fw(4,8,"workflows.list.title")),gI(5),lh("disabled",a.importing()),gI(),rl$1(" ",Fw(10,10,"workflows.list.import")," "),gI(3),rl$1(" ",Fw(13,12,"workflows.list.downloadInstructions")," "),gI(3),rl$1(" ",Fw(16,14,"workflows.list.browseLibrary")," "),gI(3),rl$1(" ",Fw(19,16,"workflows.list.createButton")," "),gI(2),MD(a.actionError()?20:-1),gI(),MD(a.loading()?21:a.loadError()?22:23));},dependencies:[$8,al,rl,$i,v3,pf,bd,sp,fp,ts,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;flex-shrink:0;justify-content:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.empty-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{si as WorkflowListComponent,si as WorkflowsManageComponent};
|
|
1
|
+
import {l}from'./chunk-D19C8Gcb.js';import {T}from'./chunk-DiKEYJdn.js';import {_ as _n,C as Cn}from'./chunk-BrckDrlX.js';import {C,V as Ve,b as at,b0 as jn,R as J1,q as qo,u as ue,aS as v,aY as Dg,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,h as ex,F as Fm,A as Am,K as Kt$1,G as FD,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,b2 as Le,b3 as Wn,az as jw,E as Aw,H as HD,x as xD,N as ND,k as iE,y as aE,B as AD,b4 as N2,aV as ix,b5 as cx,i as ie$1,n as uh,D as ch,aO as SD,aP as Mh,O as Fu,Q as ju,aH as QD}from'./main-Q5LNROCU.js';import {b}from'./chunk-BJVGVLQp.js';import {N as Nt,K as Ke}from'./chunk-BgIY3xBH.js';import {W,I}from'./chunk-DvI50p6W.js';import {n as ng,c as c_}from'./chunk-XJrnAloK.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-DF1Zujdm.js';import'./chunk-djGmnQaE.js';var Ot=i=>({name:i}),Lt=(()=>{class i{constructor(){this.modalRef=C(Le),this.data=C(Wn);}cancel(){this.modalRef.close(void 0);}choose(t){this.modalRef.close(t);}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-import-conflict"]],decls:14,vars:15,consts:[["data-testid","import-conflict-dialog"],["data-testid","import-conflict-message"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","import-conflict-cancel",3,"click"],["nz-button","","type","button","data-testid","import-conflict-create-new",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","import-conflict-update",3,"click"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"button",3),mh("click",function(){return a.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",4),mh("click",function(){return a.choose("create_new")}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",5),mh("click",function(){return a.choose("update")}),Iw(12),Pw(13,"transloco"),Jc()()()),e&2&&(gI(2),rl$1(" ",jw(3,4,"workflows.import.conflictBody",Aw(13,Ot,a.data.name))," "),gI(4),rl$1(" ",Fw(7,7,"common.cancel")," "),gI(3),rl$1(" ",Fw(10,9,"workflows.import.createNew")," "),gI(3),rl$1(" ",Fw(13,11,"workflows.import.update")," "));},dependencies:[pf,bd,sp,fp,Kt$1],styles:["p[_ngcontent-%COMP%]{margin:0 0 1.25rem;color:#44403c}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}"]});}}return i})();var Pt=(()=>{class i{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflow-library`;}list(){return this.http.get(this.baseUrl).pipe(cx())}add(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/add`,{}).pipe(cx())}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275prov=ie$1({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();var At=(i,d)=>d.id;function Vt(i,d){i&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Rt(i,d){if(i&1&&(_i(0,"p",3),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function Ht(i,d){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.addError());}}function Kt(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD(3);gI(),Lh(Fw(2,1,e.subjectTypeKey(t)));}}function Ut(i,d){if(i&1&&(_i(0,"li")(1,"span"),Iw(2),Jc(),_i(3,"span",14),Iw(4),Pw(5,"transloco"),Jc()()),i&2){let t=d.$implicit,e=HD(4);Mh("margin-left",t.depth,"rem"),gI(2),Lh(t.name),gI(2),Lh(Fw(5,4,e.stepTypeKey(t.type)));}}function Jt(i,d){if(i&1&&(_i(0,"ol",12),xD(1,Ut,6,6,"li",13,SD),Jc()),i&2){let t=HD().$implicit,e=HD(2);ch("data-testid","library-steps-"+t.id),gI(),AD(e.previewSteps(t));}}function Zt(i,d){if(i&1){let t=FD();_i(0,"nz-card")(1,"div",6)(2,"h2"),Iw(3),Jc(),_i(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"p",7),Iw(8),Jc(),_i(9,"div",8),xD(10,Kt,3,3,"nz-tag",null,ND),Jc(),_i(12,"div",9)(13,"button",10),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.togglePreview(a.id))}),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",11),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.addToMyWorkflows(a.id))}),Iw(17),Pw(18,"transloco"),Jc()(),_D(19,Jt,3,1,"ol",12),Jc();}if(i&2){let t=d.$implicit,e=HD(2);ch("data-testid","library-entry-"+t.id),gI(2),ch("data-testid","library-name-"+t.id),gI(),Lh(t.name),gI(),ch("data-testid","library-source-"+t.id),gI(),Lh(Fw(6,13,e.sourceKey(t.source))),gI(2),ch("data-testid","library-description-"+t.id),gI(),rl$1(" ",t.description," "),gI(2),AD(e.appliesToValues(t)),gI(3),ch("data-testid","library-preview-"+t.id),gI(),rl$1(" ",Fw(15,15,e.isExpanded(t.id)?"workflow-library.hideSteps":"workflow-library.previewSteps")," "),gI(2),lh("disabled",e.addingId()!==null),ch("data-testid","library-add-"+t.id),gI(),rl$1(" ",Fw(18,17,e.addingId()===t.id?"workflow-library.adding":"workflow-library.add")," "),gI(2),MD(e.isExpanded(t.id)?19:-1);}}function qt(i,d){if(i&1&&(_D(0,Ht,2,1,"p",4),_i(1,"div",5),xD(2,Zt,20,19,"nz-card",null,At),Jc()),i&2){let t=HD();MD(t.addError()?0:-1),gI(2),AD(t.entries());}}var jt=(()=>{class i{constructor(){this.libraryApi=C(Pt),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.modalRef=C(Le,{optional:true}),this.entries=qo([]),this.loading=qo(true),this.loadError=qo(null),this.addError=qo(null),this.addingId=qo(null),this.expandedIds=qo(new Set),this.libraryApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.entries.set(t),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("workflow-library.loadFailed")));}});}sourceKey(t){return `workflow-library.source.${t}`}appliesToValues(t){let e=t.workflowDefinition.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}stepTypeKey(t){return `step-list.stepType.${t}`}isExpanded(t){return this.expandedIds().has(t)}togglePreview(t){this.expandedIds.update(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a});}previewSteps(t){return Dt(t.workflowDefinition.steps,0)}addToMyWorkflows(t){this.addingId()||(this.addError.set(null),this.addingId.set(t),this.libraryApi.add(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.addingId.set(null),this.modalRef?.close(),this.router.navigate(["/workflows",e.id,"edit"]);},error:e=>{this.addingId.set(null),this.addError.set(this.errorMessage(e,this.transloco.translate("workflow-library.addFailed")));}}));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-library-browser"]],decls:7,vars:4,consts:[["data-testid","workflow-library-browser",1,"library"],[1,"lede"],["data-testid","library-loading"],["data-testid","library-load-error",1,"error"],["data-testid","library-add-error",1,"error"],[1,"cards"],[1,"card-head"],[1,"description"],[1,"applies-to"],[1,"card-actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","primary","type","button",3,"click","disabled"],[1,"steps-preview"],[3,"margin-left"],[1,"step-type"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_D(4,Vt,3,3,"p",2)(5,Rt,2,1,"p",3)(6,qt,4,1),Jc()),e&2&&(gI(2),Lh(Fw(3,2,"workflow-library.lede")),gI(2),MD(a.loading()?4:a.loadError()?5:6));},dependencies:[$8,pf,bd,sp,fp,Nt,Ke,W,I,Kt$1],styles:[".library[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.lede[_ngcontent-%COMP%]{margin:0;color:#57534e}.cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.card-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.card-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600}.description[_ngcontent-%COMP%]{margin:.5rem 0 0;color:#57534e}.applies-to[_ngcontent-%COMP%]{margin-top:.5rem}.card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.steps-preview[_ngcontent-%COMP%]{margin:.75rem 0 0;padding-left:1.25rem;color:#44403c}.steps-preview[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;margin:.25rem 0}.step-type[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();function Dt(i,d){let t=[];for(let e of i)t.push({name:e.name,type:e.type,depth:d}),e.type==="loop"&&Array.isArray(e.steps)&&t.push(...Dt(e.steps,d+1));return t}var Gt=i=>({count:i}),Qt=i=>["/workflows",i,"edit"],Xt=(i,d)=>d.id;function Yt(i,d){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.actionError());}}function te(i,d){i&1&&(_i(0,"p",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ee(i,d){if(i&1&&(_i(0,"p",11),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ie(i,d){if(i&1&&(uh(0,"nz-option",14),Pw(1,"transloco")),i&2){let t=d.$implicit,e=HD(2);lh("nzValue",t)("nzLabel",Fw(1,2,e.subjectHandlingFilterKey(t)));}}function ne(i,d){if(i&1&&(_i(0,"p",15),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.deleteError());}}function oe(i,d){if(i&1){let t=FD();_i(0,"section",16)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",18)(5,"button",19),mh("click",function(){Fu(t);let a=HD(2);return ju(a.openLibrary())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",20),Iw(9),Pw(10,"transloco"),Jc()()();}i&2&&(gI(2),Lh(Fw(3,3,"workflows.list.emptyState")),gI(4),rl$1(" ",Fw(7,5,"workflows.list.emptyBrowseLibrary")," "),gI(3),rl$1(" ",Fw(10,7,"workflows.list.emptyCreateButton")," "));}function re(i,d){if(i&1&&(_i(0,"span"),Iw(1),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(t.description);}}function ae(i,d){if(i&1&&(_i(0,"span",22),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(Fw(2,2,"workflows.list.noDescription"));}}function le(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD().$implicit,a=HD(3);ch("data-testid","applies-to-"+e.id),gI(),Lh(Fw(2,2,a.subjectTypeKey(t)));}}function se(i,d){if(i&1){let t=FD();_i(0,"tr")(1,"td")(2,"span"),Iw(3),Jc()(),_i(4,"td",21),_D(5,re,2,2,"span")(6,ae,3,4,"span",22),Jc(),_i(7,"td"),xD(8,le,3,4,"nz-tag",null,ND),Jc(),_i(10,"td")(11,"nz-tag"),Iw(12),Pw(13,"transloco"),Jc()(),_i(14,"td")(15,"span"),Iw(16),Pw(17,"transloco"),Jc()(),_i(18,"td",23)(19,"a",24),Iw(20),Pw(21,"transloco"),Jc(),_i(22,"button",25),mh("click",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.exportWorkflow(a))}),Iw(23),Pw(24,"transloco"),Jc(),_i(25,"button",26),Pw(26,"transloco"),Pw(27,"transloco"),Pw(28,"transloco"),mh("nzOnConfirm",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.deleteWorkflow(a.id))}),Iw(29),Pw(30,"transloco"),Jc()()();}if(i&2){let t=d.$implicit,e=HD(3);ch("data-testid","workflow-"+t.id),gI(2),ch("data-testid","name-"+t.id),gI(),Lh(t.name),gI(2),MD(t.description?.trim()?5:6),gI(3),AD(e.appliesToValues(t)),gI(3),ch("data-testid","subject-handling-"+t.id),gI(),Lh(Fw(13,18,e.subjectHandlingKey(t.subjectHandling))),gI(3),ch("data-testid","step-count-"+t.id),gI(),Lh(jw(17,20,"workflows.list.stepCount",Aw(35,Gt,t.steps.length))),gI(3),lh("routerLink",Aw(37,Qt,t.id)),ch("data-testid","edit-"+t.id),gI(),rl$1(" ",Fw(21,23,"workflows.list.edit")," "),gI(2),ch("data-testid","export-"+t.id),gI(),rl$1(" ",Fw(24,25,"workflows.list.export")," "),gI(2),lh("nzPopconfirmTitle",Fw(26,27,"workflows.list.deleteConfirm"))("nzOkText",Fw(27,29,"workflows.list.delete"))("nzCancelText",Fw(28,31,"common.cancel")),ch("data-testid","delete-"+t.id),gI(4),rl$1(" ",Fw(30,33,"workflows.list.delete")," ");}}function pe(i,d){if(i&1&&(_i(0,"nz-table",17)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,se,31,39,"tr",null,Xt),Jc()()),i&2){let t=HD(2);lh("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,9,"workflows.list.column.name")),gI(3),Lh(Fw(8,11,"workflows.list.column.description")),gI(3),Lh(Fw(11,13,"workflow-editor.appliesTo")),gI(3),Lh(Fw(14,15,"workflow-editor.subjectHandling.label")),gI(3),Lh(Fw(17,17,"workflows.list.column.steps")),gI(3),Lh(Fw(20,19,"workflows.list.column.actions")),gI(3),AD(t.workflows());}}function de(i,d){if(i&1){let t=FD();_i(0,"div",12)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",13),mh("ngModelChange",function(a){Fu(t);let f=HD();return ju(f.setSubjectHandlingFilter(a))}),xD(5,ie,2,4,"nz-option",14,ND),Jc(),iE(),Jc(),_D(7,ne,2,1,"p",15),_D(8,oe,11,9,"section",16)(9,pe,24,21,"nz-table",17);}if(i&2){let t=HD();gI(2),Lh(Fw(3,4,"workflows.list.filterBySubjectHandling")),gI(2),lh("ngModel",t.subjectHandlingFilter()),aE(),gI(),AD(t.subjectHandlingOptions),gI(2),MD(t.deleteError()?7:-1),gI(),MD(t.workflows().length===0?8:9);}}var si=(()=>{class i{constructor(){this.workflowsApi=C(b),this.transloco=C(Ve),this.destroyRef=C(at),this.modal=C(jn),this.router=C(J1),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.actionError=qo(null),this.importing=qo(false),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let e=t.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}subjectHandlingKey(t){return `workflow-editor.subjectHandling.${t}`}subjectHandlingFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.subjectHandling.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.workflows.update(e=>e.filter(a=>a.id!==t));},error:e=>{this.deleteError.set(this.errorMessage(e,this.transloco.translate("workflows.list.deleteFailed")));}});}openLibrary(){this.modal.create({nzTitle:this.transloco.translate("workflow-library.title"),nzContent:jt,nzFooter:null,nzWidth:720});}exportWorkflow(t){this.actionError.set(null),this.workflowsApi.exportDefinition(t.id).pipe(ue(this.destroyRef)).subscribe({next:e=>{l(`${ng(e.name)}.json`,JSON.stringify(e,null,2),"application/json");},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("workflows.list.exportFailed")));}});}downloadInstructions(){this.actionError.set(null),this.workflowsApi.getInstructions().pipe(ue(this.destroyRef)).subscribe({next:t=>{l("knoflows-workflow-agent-instructions.md",t,"text/markdown;charset=utf-8");},error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("workflows.list.instructionsFailed")));}});}onImportFile(t){let e=t.target,a=e.files?.[0];e.value="",!(!a||this.importing())&&this.readAndImport(a);}importJsonText(t){this.actionError.set(null);let e;try{e=JSON.parse(t);}catch(f){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));return}let a=c_.safeParse(e);if(!a.success){let f=T(a.error);this.actionError.set(`${this.transloco.translate("workflows.list.importInvalidSchema")}: ${f[0]??""}`);return}this.postImport(e);}readAndImport(t){return v(this,null,function*(){try{this.importJsonText(yield t.text());}catch(e){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));}})}postImport(t,e){this.importing.set(true),this.actionError.set(null),this.workflowsApi.importDefinition(e?{workflowDefinition:t,resolution:e}:{workflowDefinition:t}).pipe(ue(this.destroyRef)).subscribe({next:a=>{this.importing.set(false),this.router.navigate(["/workflows",a.id,"edit"]);},error:a=>{this.importing.set(false);let f=this.importConflict(a);if(f&&!e){this.openImportConflict(t,f.name);return}this.actionError.set(this.errorMessage(a,this.transloco.translate("workflows.list.importFailed")));}});}openImportConflict(t,e){(this.modal.create({nzTitle:this.transloco.translate("workflows.import.conflictTitle"),nzContent:Lt,nzData:{name:e},nzFooter:null}).afterClose??Dg(void 0)).pipe(ue(this.destroyRef)).subscribe(T=>{(T==="update"||T==="create_new")&&this.postImport(t,T);});}importConflict(t){if(!(t instanceof bi)||t.httpStatus!==409||!t.details)return null;let e=t.details.conflictingWorkflowId,a=t.details.conflictingWorkflowName;return typeof e!="string"||typeof a!="string"?null:{id:e,name:a}}load(){let t=this.subjectHandlingFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{subjectHandling:t}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("workflows.list.loadFailed")));}});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-list"]],decls:24,vars:18,consts:[["importFileInput",""],["data-testid","workflows-list",1,"list-page"],[1,"header"],[1,"header-actions"],["type","file","accept","application/json,.json","hidden","","data-testid","import-file",3,"change"],["nz-button","","type","button","data-testid","import-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","download-instructions",3,"click"],["nz-button","","type","button","data-testid","browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","action-error",1,"error"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","subject-handling-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],[1,"empty-actions"],["nz-button","","type","button","data-testid","empty-browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(e,a){if(e&1){let f=FD();_i(0,"main",1)(1,"header",2)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",3)(6,"input",4,0),mh("change",function(U){return a.onImportFile(U)}),Jc(),_i(8,"button",5),mh("click",function(){Fu(f);let U=QD(7);return ju(U.click())}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",6),mh("click",function(){return a.downloadInstructions()}),Iw(12),Pw(13,"transloco"),Jc(),_i(14,"button",7),mh("click",function(){return a.openLibrary()}),Iw(15),Pw(16,"transloco"),Jc(),_i(17,"a",8),Iw(18),Pw(19,"transloco"),Jc()()(),_D(20,Yt,2,1,"p",9),_D(21,te,3,3,"p",10)(22,ee,2,1,"p",11)(23,de,10,6),Jc();}e&2&&(gI(3),Lh(Fw(4,8,"workflows.list.title")),gI(5),lh("disabled",a.importing()),gI(),rl$1(" ",Fw(10,10,"workflows.list.import")," "),gI(3),rl$1(" ",Fw(13,12,"workflows.list.downloadInstructions")," "),gI(3),rl$1(" ",Fw(16,14,"workflows.list.browseLibrary")," "),gI(3),rl$1(" ",Fw(19,16,"workflows.list.createButton")," "),gI(2),MD(a.actionError()?20:-1),gI(),MD(a.loading()?21:a.loadError()?22:23));},dependencies:[$8,al,rl,$i,v3,pf,bd,sp,fp,ts,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;flex-shrink:0;justify-content:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.empty-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{si as WorkflowListComponent,si as WorkflowsManageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as ae,l as le}from'./chunk-
|
|
1
|
+
import {a as ae,l as le}from'./chunk-CepRGzVJ.js';import {T}from'./chunk-DiKEYJdn.js';import {H as He}from'./chunk-DP75g4hD.js';import'./chunk-8INlEe9b.js';import {C,a as C1,R as J1,b7 as m,b8 as y,b as at,V as Ve,bo as O,bp as de,ba as Se,q as qo,U as Uw,u as ue$1,r as r$1,c as bi,Z as ZE,d as $8,e as al,bb as er,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,I as Iw,J as Jc,P as Pw,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,H as HD,G as FD,k as iE,x as xD,y as aE,B as AD,N as ND,n as uh,O as Fu,Q as ju}from'./main-Q5LNROCU.js';import {b}from'./chunk-BJVGVLQp.js';import {a as ai,z}from'./chunk-wu6SvZ0s.js';import {g as d_}from'./chunk-XJrnAloK.js';import'./chunk-djGmnQaE.js';var ue=(t,s)=>s.id;function he(t,s){t&1&&(_i(0,"p",6),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function fe(t,s){if(t&1&&(_i(0,"p",7),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function ge(t,s){if(t&1&&(_i(0,"li"),Iw(1),Jc()),t&2){let e=s.$implicit;gI(),Lh(e);}}function _e(t,s){if(t&1&&(_i(0,"section",8)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"ul"),xD(5,ge,2,1,"li",null,ND),Jc()()),t&2){let e=HD(2);gI(2),Lh(Fw(3,1,"shortcuts.editor.validation")),gI(3),AD(e.validationErrors());}}function ve(t,s){if(t&1&&uh(0,"nz-option",12),t&2){let e=s.$implicit;lh("nzValue",e.id)("nzLabel",e.name);}}function we(t,s){if(t&1){let e=FD();_i(0,"app-workflow-input-form",14),mh("valuesChange",function(i){Fu(e);let u=HD(2);return ju(u.setInputValues(i))}),Jc();}if(t&2){let e=HD(2);lh("fields",s.inputSchema)("values",e.inputValues());}}function Ce(t,s){if(t&1){let e=FD();_D(0,_e,7,3,"section",8),_i(1,"label",9)(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"input",10),mh("ngModelChange",function(i){Fu(e);let u=HD();return ju(u.name.set(i))}),Jc(),iE(),Jc(),_i(6,"div",9)(7,"span"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"nz-select",11),mh("ngModelChange",function(i){Fu(e);let u=HD();return ju(u.onWorkflowChange(i))}),xD(11,ve,1,2,"nz-option",12,ue),Jc(),iE(),Jc(),_D(13,we,1,2,"app-workflow-input-form",13);}if(t&2){let e,o=HD();MD(o.validationErrors().length>0?0:-1),gI(3),Lh(Fw(4,6,"shortcuts.editor.name")),gI(2),lh("ngModel",o.name()),aE(),gI(3),Lh(Fw(9,8,"shortcuts.editor.workflow")),gI(2),lh("ngModel",o.workflowId()),aE(),gI(),AD(o.eligibleWorkflows()),gI(2),MD((e=o.selectedWorkflow())?13:-1,e);}}function be(t){let s=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return s.length>0?`sc-${s}-${e}`:`sc-${e}`}var Ge=(()=>{class t{constructor(){this.route=C(C1),this.router=C(J1),this.shortcutsApi=C(m),this.nav=C(y),this.workflowsApi=C(b),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.language=C(O),this.routeId=de(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.workflows=qo([]),this.inputValues=qo({}),this.lastJobId=qo(void 0),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.isNew=Uw(()=>!this.routeId()),this.pageTitle=Uw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("shortcuts.editor.titleNew"):this.transloco.translate("shortcuts.editor.titleEdit",{name:this.name().trim()}))),this.eligibleWorkflows=Uw(()=>this.workflows().filter(e=>e.appliesTo==="none"&&e.subjectHandling==="per-subject")),this.selectedWorkflow=Uw(()=>this.eligibleWorkflows().find(e=>e.id===this.workflowId())??null),this.workflowsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("shortcuts.editor.loadFailed")));}}),this.route.paramMap.pipe(ue$1(this.destroyRef)).subscribe(e=>{let o=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),!o){this.name.set(""),this.workflowId.set(""),this.inputValues.set({}),this.lastJobId.set(void 0),this.loading.set(false);return}this.loading.set(true),this.shortcutsApi.get(o).subscribe({next:i=>{this.name.set(i.name),this.workflowId.set(i.workflowId),this.inputValues.set(i.inputValues),this.lastJobId.set(i.lastJobId),this.loading.set(false);},error:i=>{this.loading.set(false),this.loadError.set(this.errorMessage(i,this.transloco.translate("shortcuts.editor.loadFailed")));}});});}onWorkflowChange(e){this.workflowId.set(e);let o=this.eligibleWorkflows().find(i=>i.id===e);this.inputValues.set(ae(o?.inputSchema??[]));}setInputValues(e){this.inputValues.set(e);}save(){let e=this.routeId(),o=r$1({id:e??be(this.name()),name:this.name().trim(),workflowId:this.workflowId(),inputValues:this.inputValues()},this.lastJobId()?{lastJobId:this.lastJobId()}:{}),i=d_.safeParse(o);if(!i.success){this.validationErrors.set(T(i.error));return}this.validationErrors.set([]),this.saving.set(true),(this.isNew()||!e?this.shortcutsApi.create(i.data):this.shortcutsApi.update(e,i.data)).subscribe({next:M=>{this.saving.set(false),this.nav.refresh(),this.message.success(this.transloco.translate(this.isNew()?"shortcuts.editor.created":"shortcuts.editor.saved")),this.isNew()&&this.router.navigate(["/shortcuts",M.id,"edit"]);},error:M=>{this.saving.set(false),this.message.error(this.errorMessage(M,this.transloco.translate("shortcuts.editor.saveFailed")));}});}errorMessage(e,o){return e instanceof bi||e instanceof Error?e.message:o}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-shortcut-editor"]],decls:15,vars:10,consts:[["data-testid","shortcut-editor",1,"editor"],[1,"header"],["data-testid","page-title"],[1,"header-actions"],["routerLink","/shortcuts"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","shortcut-name",3,"ngModelChange","ngModel"],["data-testid","shortcut-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[3,"fields","values"],[3,"valuesChange","fields","values"]],template:function(o,i){o&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1",2),Iw(4),Jc()(),_i(5,"div",3)(6,"a",4),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"button",5),mh("click",function(){return i.save()}),Iw(10),Pw(11,"transloco"),Jc()()(),_D(12,he,3,3,"p",6)(13,fe,2,1,"p",7)(14,Ce,14,10),Jc()),o&2&&(gI(4),Lh(i.pageTitle()),gI(3),Lh(Fw(8,6,"shortcuts.editor.backToList")),gI(2),lh("nzLoading",i.saving())("disabled",i.loading()||!!i.loadError()),gI(),rl$1(" ",Fw(11,8,"common.save")," "),gI(2),MD(i.loading()?12:i.loadError()?13:14));},dependencies:[$8,al,er,rl,$i,v3,pf,bd,sp,fp,ai,z,ex,Fm,Am,le,Kt],styles:[".editor[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{Ge as ShortcutEditorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o as ot}from'./chunk-BIdwV0jx.js';import {_ as _n,C as Cn}from'./chunk-CPNxRF7A.js';import {C,V as Ve$1,b as at,b3 as Wn,a5 as q0,U as Uw,q as qo,r as r$1,u as ue,c as bi,Z as ZE,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,l as _D,J as Jc,al as Sh,D as ch,o as gI,M as MD,b4 as N2,aV as ix,b5 as cx,i as ie,G as FD,I as Iw,P as Pw,m as mh,L as Lh,p as Fw,z as rl$1,H as HD,k as iE,x as xD,N as ND,w as lh,y as aE,B as AD,aR as xw,n as uh,O as Fu,Q as ju}from'./main-SI5AKDMC.js';import {a as ai,z}from'./chunk-BIL86kgf.js';import {W,I}from'./chunk-5xJXPFlv.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-DAONFRT8.js';var ze=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/context-files`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}create(e){return this.http.post(this.baseUrl,e).pipe(cx())}update(e,n){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(e)}`,n).pipe(cx())}delete(e){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var Te=()=>[".md"],Ie=(t,f)=>f.id;function Fe(t,f){if(t&1){let e=FD();_i(0,"header",1)(1,"h1"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",4),mh("click",function(){Fu(e);let r=HD();return ju(r.openCreateForm())}),Iw(5),Pw(6,"transloco"),Jc()();}t&2&&(gI(2),Lh(Fw(3,2,"context-files.title")),gI(3),rl$1(" ",Fw(6,4,"context-files.create")," "));}function ye(t,f){t&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Ne(t,f){if(t&1&&(_i(0,"p",3),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function De(t,f){if(t&1&&(_i(0,"p",5),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.deleteError());}}function we(t,f){if(t&1&&(_i(0,"p",9),Iw(1),Jc()),t&2){let e=HD(3);gI(),Lh(e.saveError());}}function ke(t,f){if(t&1&&(uh(0,"nz-option",13),Pw(1,"transloco")),t&2){let e=f.$implicit,n=HD(3);lh("nzValue",e)("nzLabel",Fw(1,2,n.tierKey(e)));}}function Le(t,f){if(t&1){let e=FD();_i(0,"button",20),mh("click",function(){Fu(e);let r=HD(3);return ju(r.cancelForm())}),Iw(1),Pw(2,"transloco"),Jc();}t&2&&(gI(),rl$1(" ",Fw(2,1,"context-files.form.cancel")," "));}function Pe(t,f){if(t&1){let e=FD();_i(0,"section",6),_D(1,we,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formName.set(r))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"nz-select",12),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formTier.set(r))}),xD(12,ke,2,4,"nz-option",13,ND),Jc(),iE(),Jc(),_i(14,"div",10)(15,"span"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"app-path-picker",14),mh("pathChange",function(r){Fu(e);let p=HD(2);return ju(p.formPath.set(r))}),Jc(),_i(19,"p",15),Iw(20),Pw(21,"transloco"),Jc()(),_i(22,"label",10)(23,"span"),Iw(24),Pw(25,"transloco"),Jc(),_i(26,"input",16),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formDescription.set(r))}),Jc(),iE(),Jc(),_i(27,"div",17)(28,"button",18),mh("click",function(){Fu(e);let r=HD(2);return ju(r.submitForm())}),Iw(29),Pw(30,"transloco"),Jc(),_D(31,Le,3,3,"button",19),Jc()();}if(t&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,14,"context-files.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,16,"context-files.form.tier")),gI(2),lh("ngModel",e.formTier()),aE(),gI(),AD(e.tiers),gI(4),Lh(Fw(17,18,"context-files.form.path")),gI(2),lh("extensions",xw(26,Te))("path",e.formPath()),gI(2),Lh(Fw(21,20,"context-files.form.pathHint")),gI(4),Lh(Fw(25,22,"context-files.form.description")),gI(2),lh("ngModel",e.formDescription()),aE(),gI(2),lh("nzLoading",e.saving()),gI(),rl$1(" ",Fw(30,24,e.editingId()?"context-files.form.save":"context-files.form.add")," "),gI(2),MD(e.inSelectionMode()?-1:31);}}function Ve(t,f){if(t&1){let e=FD();_i(0,"section",7)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",21),mh("click",function(){Fu(e);let r=HD(2);return ju(r.openCreateForm())}),Iw(5),Pw(6,"transloco"),Jc()();}t&2&&(gI(2),Lh(Fw(3,2,"context-files.emptyState")),gI(3),rl$1(" ",Fw(6,4,"context-files.create")," "));}function Be(t,f){t&1&&uh(0,"th");}function Oe(t,f){t&1&&(_i(0,"th"),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"context-files.column.actions")));}function $e(t,f){if(t&1){let e=FD();_i(0,"td")(1,"label",24),mh("nzCheckedChange",function(r){Fu(e);let p=HD().$implicit,T=HD(3);return ju(T.toggleSelected(p.id,r))}),Jc()();}if(t&2){let e=HD().$implicit,n=HD(3);gI(),lh("nzChecked",n.isSelected(e.id)),ch("data-testid","select-"+e.id);}}function Ae(t,f){if(t&1){let e=FD();_i(0,"td",23)(1,"button",25),mh("click",function(){Fu(e);let r=HD().$implicit,p=HD(3);return ju(p.openEditForm(r))}),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",26),Pw(5,"transloco"),Pw(6,"transloco"),Pw(7,"transloco"),mh("nzOnConfirm",function(){Fu(e);let r=HD().$implicit,p=HD(3);return ju(p.deleteFile(r.id))}),Iw(8),Pw(9,"transloco"),Jc()();}if(t&2){let e=HD().$implicit;gI(),ch("data-testid","edit-"+e.id),gI(),rl$1(" ",Fw(3,7,"context-files.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(5,9,"context-files.deleteConfirm"))("nzOkText",Fw(6,11,"context-files.delete"))("nzCancelText",Fw(7,13,"common.cancel")),ch("data-testid","delete-"+e.id),gI(4),rl$1(" ",Fw(9,15,"context-files.delete")," ");}}function Ue(t,f){if(t&1&&(_i(0,"tr"),_D(1,$e,2,2,"td"),_i(2,"td"),Iw(3),Jc(),_i(4,"td")(5,"nz-tag"),Iw(6),Pw(7,"transloco"),Jc()(),_i(8,"td",22),Iw(9),Jc(),_i(10,"td"),Iw(11),Jc(),_D(12,Ae,10,17,"td",23),Jc()),t&2){let e=f.$implicit,n=HD(3);ch("data-testid","context-file-"+e.id),gI(),MD(n.inSelectionMode()?1:-1),gI(),ch("data-testid","name-"+e.id),gI(),Lh(e.name),gI(2),ch("data-testid","tier-"+e.id),gI(),Lh(Fw(7,11,n.tierKey(e.tier))),gI(2),ch("data-testid","path-"+e.id),gI(),Lh(e.path),gI(),ch("data-testid","description-"+e.id),gI(),Lh(e.description),gI(),MD(n.inSelectionMode()?-1:12);}}function Re(t,f){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),_D(3,Be,1,0,"th"),_i(4,"th"),Iw(5),Pw(6,"transloco"),Jc(),_i(7,"th"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"th"),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"th"),Iw(14),Pw(15,"transloco"),Jc(),_D(16,Oe,3,3,"th"),Jc()(),_i(17,"tbody"),xD(18,Ue,13,13,"tr",null,Ie),Jc()()),t&2){let e=HD(2);lh("nzData",e.files())("nzFrontPagination",false)("nzShowPagination",false),gI(3),MD(e.inSelectionMode()?3:-1),gI(2),Lh(Fw(6,9,"context-files.column.name")),gI(3),Lh(Fw(9,11,"context-files.column.tier")),gI(3),Lh(Fw(12,13,"context-files.column.path")),gI(3),Lh(Fw(15,15,"context-files.column.description")),gI(2),MD(e.inSelectionMode()?-1:16),gI(2),AD(e.files());}}function je(t,f){if(t&1&&(_D(0,De,2,1,"p",5),_D(1,Pe,32,27,"section",6),_D(2,Ve,7,6,"section",7)(3,Re,20,17,"nz-table",8)),t&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.inSelectionMode()||e.formOpen()?1:-1),gI(),MD(e.files().length===0&&!e.inSelectionMode()&&!e.formOpen()?2:3);}}var Ke=["user","organization","project"],St=(()=>{class t{constructor(){this.filesApi=C(ze),this.transloco=C(Ve$1),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.selectionModeInput=q0(false),this.inSelectionMode=Uw(()=>this.modalData?.selectionMode??this.selectionModeInput()),this.files=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.selectedIds=qo([...this.modalData?.selectedIds??[]]),this.formName=qo(""),this.formTier=qo("user"),this.formPath=qo(""),this.formDescription=qo(""),this.tiers=Ke,this.reload();}currentSelectedIds(){return this.selectedIds()}tierKey(e){return `context-files.tier.${e}`}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,n){this.selectedIds.update(r=>n?r.includes(e)?r:[...r,e]:r.filter(p=>p!==e));}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formTier.set(e.tier),this.formPath.set(e.path),this.formDescription.set(e.description??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1({name:this.formName().trim(),tier:this.formTier(),path:this.formPath().trim()},this.formDescription().trim()?{description:this.formDescription().trim()}:{description:void 0}),n=this.editingId();(n?this.filesApi.update(n,e):this.filesApi.create(e)).pipe(ue(this.destroyRef)).subscribe({next:p=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.files.update(T=>[...T.filter(N=>N.id!==p.id),p].sort((N,Ee)=>N.name.localeCompare(Ee.name))),this.inSelectionMode()&&!this.isSelected(p.id)&&this.selectedIds.update(T=>[...T,p.id]),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set("");},error:p=>{this.saving.set(false),this.saveError.set(this.errorMessage(p,this.transloco.translate("context-files.saveFailed")));}});}deleteFile(e){this.deleteError.set(null),this.filesApi.delete(e).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.files.update(n=>n.filter(r=>r.id!==e)),this.selectedIds.update(n=>n.filter(r=>r!==e));},error:n=>{this.deleteError.set(this.errorMessage(n,this.transloco.translate("context-files.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.filesApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.files.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("context-files.loadFailed")));}});}errorMessage(e,n){return e instanceof bi||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-context-file-list"]],inputs:{selectionModeInput:[1,"selectionModeInput"]},decls:5,vars:5,consts:[[1,"context-file-list"],[1,"header"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","create-context-file",3,"click"],["data-testid","delete-error",1,"error"],["data-testid","context-file-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","context-file-items",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","context-file-name",3,"ngModelChange","ngModel"],["data-testid","context-file-tier",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["mode","files",3,"pathChange","extensions","path"],[1,"hint"],["nz-input","","data-testid","context-file-description",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","context-file-submit",3,"click","nzLoading"],["nz-button","","type","button","data-testid","context-file-cancel"],["nz-button","","type","button","data-testid","context-file-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","empty-create",3,"click"],[1,"path-cell"],[1,"actions"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(n,r){n&1&&(_i(0,"div",0),_D(1,Fe,7,6,"header",1),_D(2,ye,3,3,"p",2)(3,Ne,2,1,"p",3)(4,je,4,3),Jc()),n&2&&(Sh("list-page",!r.inSelectionMode()),ch("data-testid",r.inSelectionMode()?"context-file-picker":"context-files-manage"),gI(),MD(r.inSelectionMode()?-1:1),gI(),MD(r.loading()?2:r.loadError()?3:4));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,Lt,ut,ai,z,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();export{St as S,ze as z};
|
|
1
|
+
import {o as ot}from'./chunk-CuBg4N16.js';import {_ as _n,C as Cn}from'./chunk-BrckDrlX.js';import {C,V as Ve$1,b as at,b3 as Wn,a5 as q0,U as Uw,q as qo,r as r$1,u as ue,c as bi,Z as ZE,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,l as _D,J as Jc,al as Sh,D as ch,o as gI,M as MD,b4 as N2,aV as ix,b5 as cx,i as ie,G as FD,I as Iw,P as Pw,m as mh,L as Lh,p as Fw,z as rl$1,H as HD,k as iE,x as xD,N as ND,w as lh,y as aE,B as AD,aR as xw,n as uh,O as Fu,Q as ju}from'./main-Q5LNROCU.js';import {a as ai,z}from'./chunk-wu6SvZ0s.js';import {W,I}from'./chunk-DvI50p6W.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-DF1Zujdm.js';var ze=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/context-files`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}create(e){return this.http.post(this.baseUrl,e).pipe(cx())}update(e,n){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(e)}`,n).pipe(cx())}delete(e){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var Te=()=>[".md"],Ie=(t,f)=>f.id;function Fe(t,f){if(t&1){let e=FD();_i(0,"header",1)(1,"h1"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",4),mh("click",function(){Fu(e);let r=HD();return ju(r.openCreateForm())}),Iw(5),Pw(6,"transloco"),Jc()();}t&2&&(gI(2),Lh(Fw(3,2,"context-files.title")),gI(3),rl$1(" ",Fw(6,4,"context-files.create")," "));}function ye(t,f){t&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Ne(t,f){if(t&1&&(_i(0,"p",3),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function De(t,f){if(t&1&&(_i(0,"p",5),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.deleteError());}}function we(t,f){if(t&1&&(_i(0,"p",9),Iw(1),Jc()),t&2){let e=HD(3);gI(),Lh(e.saveError());}}function ke(t,f){if(t&1&&(uh(0,"nz-option",13),Pw(1,"transloco")),t&2){let e=f.$implicit,n=HD(3);lh("nzValue",e)("nzLabel",Fw(1,2,n.tierKey(e)));}}function Le(t,f){if(t&1){let e=FD();_i(0,"button",20),mh("click",function(){Fu(e);let r=HD(3);return ju(r.cancelForm())}),Iw(1),Pw(2,"transloco"),Jc();}t&2&&(gI(),rl$1(" ",Fw(2,1,"context-files.form.cancel")," "));}function Pe(t,f){if(t&1){let e=FD();_i(0,"section",6),_D(1,we,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formName.set(r))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"nz-select",12),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formTier.set(r))}),xD(12,ke,2,4,"nz-option",13,ND),Jc(),iE(),Jc(),_i(14,"div",10)(15,"span"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"app-path-picker",14),mh("pathChange",function(r){Fu(e);let p=HD(2);return ju(p.formPath.set(r))}),Jc(),_i(19,"p",15),Iw(20),Pw(21,"transloco"),Jc()(),_i(22,"label",10)(23,"span"),Iw(24),Pw(25,"transloco"),Jc(),_i(26,"input",16),mh("ngModelChange",function(r){Fu(e);let p=HD(2);return ju(p.formDescription.set(r))}),Jc(),iE(),Jc(),_i(27,"div",17)(28,"button",18),mh("click",function(){Fu(e);let r=HD(2);return ju(r.submitForm())}),Iw(29),Pw(30,"transloco"),Jc(),_D(31,Le,3,3,"button",19),Jc()();}if(t&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,14,"context-files.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,16,"context-files.form.tier")),gI(2),lh("ngModel",e.formTier()),aE(),gI(),AD(e.tiers),gI(4),Lh(Fw(17,18,"context-files.form.path")),gI(2),lh("extensions",xw(26,Te))("path",e.formPath()),gI(2),Lh(Fw(21,20,"context-files.form.pathHint")),gI(4),Lh(Fw(25,22,"context-files.form.description")),gI(2),lh("ngModel",e.formDescription()),aE(),gI(2),lh("nzLoading",e.saving()),gI(),rl$1(" ",Fw(30,24,e.editingId()?"context-files.form.save":"context-files.form.add")," "),gI(2),MD(e.inSelectionMode()?-1:31);}}function Ve(t,f){if(t&1){let e=FD();_i(0,"section",7)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",21),mh("click",function(){Fu(e);let r=HD(2);return ju(r.openCreateForm())}),Iw(5),Pw(6,"transloco"),Jc()();}t&2&&(gI(2),Lh(Fw(3,2,"context-files.emptyState")),gI(3),rl$1(" ",Fw(6,4,"context-files.create")," "));}function Be(t,f){t&1&&uh(0,"th");}function Oe(t,f){t&1&&(_i(0,"th"),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"context-files.column.actions")));}function $e(t,f){if(t&1){let e=FD();_i(0,"td")(1,"label",24),mh("nzCheckedChange",function(r){Fu(e);let p=HD().$implicit,T=HD(3);return ju(T.toggleSelected(p.id,r))}),Jc()();}if(t&2){let e=HD().$implicit,n=HD(3);gI(),lh("nzChecked",n.isSelected(e.id)),ch("data-testid","select-"+e.id);}}function Ae(t,f){if(t&1){let e=FD();_i(0,"td",23)(1,"button",25),mh("click",function(){Fu(e);let r=HD().$implicit,p=HD(3);return ju(p.openEditForm(r))}),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"button",26),Pw(5,"transloco"),Pw(6,"transloco"),Pw(7,"transloco"),mh("nzOnConfirm",function(){Fu(e);let r=HD().$implicit,p=HD(3);return ju(p.deleteFile(r.id))}),Iw(8),Pw(9,"transloco"),Jc()();}if(t&2){let e=HD().$implicit;gI(),ch("data-testid","edit-"+e.id),gI(),rl$1(" ",Fw(3,7,"context-files.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(5,9,"context-files.deleteConfirm"))("nzOkText",Fw(6,11,"context-files.delete"))("nzCancelText",Fw(7,13,"common.cancel")),ch("data-testid","delete-"+e.id),gI(4),rl$1(" ",Fw(9,15,"context-files.delete")," ");}}function Ue(t,f){if(t&1&&(_i(0,"tr"),_D(1,$e,2,2,"td"),_i(2,"td"),Iw(3),Jc(),_i(4,"td")(5,"nz-tag"),Iw(6),Pw(7,"transloco"),Jc()(),_i(8,"td",22),Iw(9),Jc(),_i(10,"td"),Iw(11),Jc(),_D(12,Ae,10,17,"td",23),Jc()),t&2){let e=f.$implicit,n=HD(3);ch("data-testid","context-file-"+e.id),gI(),MD(n.inSelectionMode()?1:-1),gI(),ch("data-testid","name-"+e.id),gI(),Lh(e.name),gI(2),ch("data-testid","tier-"+e.id),gI(),Lh(Fw(7,11,n.tierKey(e.tier))),gI(2),ch("data-testid","path-"+e.id),gI(),Lh(e.path),gI(),ch("data-testid","description-"+e.id),gI(),Lh(e.description),gI(),MD(n.inSelectionMode()?-1:12);}}function Re(t,f){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),_D(3,Be,1,0,"th"),_i(4,"th"),Iw(5),Pw(6,"transloco"),Jc(),_i(7,"th"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"th"),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"th"),Iw(14),Pw(15,"transloco"),Jc(),_D(16,Oe,3,3,"th"),Jc()(),_i(17,"tbody"),xD(18,Ue,13,13,"tr",null,Ie),Jc()()),t&2){let e=HD(2);lh("nzData",e.files())("nzFrontPagination",false)("nzShowPagination",false),gI(3),MD(e.inSelectionMode()?3:-1),gI(2),Lh(Fw(6,9,"context-files.column.name")),gI(3),Lh(Fw(9,11,"context-files.column.tier")),gI(3),Lh(Fw(12,13,"context-files.column.path")),gI(3),Lh(Fw(15,15,"context-files.column.description")),gI(2),MD(e.inSelectionMode()?-1:16),gI(2),AD(e.files());}}function je(t,f){if(t&1&&(_D(0,De,2,1,"p",5),_D(1,Pe,32,27,"section",6),_D(2,Ve,7,6,"section",7)(3,Re,20,17,"nz-table",8)),t&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.inSelectionMode()||e.formOpen()?1:-1),gI(),MD(e.files().length===0&&!e.inSelectionMode()&&!e.formOpen()?2:3);}}var Ke=["user","organization","project"],St=(()=>{class t{constructor(){this.filesApi=C(ze),this.transloco=C(Ve$1),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.selectionModeInput=q0(false),this.inSelectionMode=Uw(()=>this.modalData?.selectionMode??this.selectionModeInput()),this.files=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.selectedIds=qo([...this.modalData?.selectedIds??[]]),this.formName=qo(""),this.formTier=qo("user"),this.formPath=qo(""),this.formDescription=qo(""),this.tiers=Ke,this.reload();}currentSelectedIds(){return this.selectedIds()}tierKey(e){return `context-files.tier.${e}`}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,n){this.selectedIds.update(r=>n?r.includes(e)?r:[...r,e]:r.filter(p=>p!==e));}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formTier.set(e.tier),this.formPath.set(e.path),this.formDescription.set(e.description??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1({name:this.formName().trim(),tier:this.formTier(),path:this.formPath().trim()},this.formDescription().trim()?{description:this.formDescription().trim()}:{description:void 0}),n=this.editingId();(n?this.filesApi.update(n,e):this.filesApi.create(e)).pipe(ue(this.destroyRef)).subscribe({next:p=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.files.update(T=>[...T.filter(N=>N.id!==p.id),p].sort((N,Ee)=>N.name.localeCompare(Ee.name))),this.inSelectionMode()&&!this.isSelected(p.id)&&this.selectedIds.update(T=>[...T,p.id]),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set("");},error:p=>{this.saving.set(false),this.saveError.set(this.errorMessage(p,this.transloco.translate("context-files.saveFailed")));}});}deleteFile(e){this.deleteError.set(null),this.filesApi.delete(e).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.files.update(n=>n.filter(r=>r.id!==e)),this.selectedIds.update(n=>n.filter(r=>r!==e));},error:n=>{this.deleteError.set(this.errorMessage(n,this.transloco.translate("context-files.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.filesApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.files.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("context-files.loadFailed")));}});}errorMessage(e,n){return e instanceof bi||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-context-file-list"]],inputs:{selectionModeInput:[1,"selectionModeInput"]},decls:5,vars:5,consts:[[1,"context-file-list"],[1,"header"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","create-context-file",3,"click"],["data-testid","delete-error",1,"error"],["data-testid","context-file-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","context-file-items",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","context-file-name",3,"ngModelChange","ngModel"],["data-testid","context-file-tier",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["mode","files",3,"pathChange","extensions","path"],[1,"hint"],["nz-input","","data-testid","context-file-description",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","context-file-submit",3,"click","nzLoading"],["nz-button","","type","button","data-testid","context-file-cancel"],["nz-button","","type","button","data-testid","context-file-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","empty-create",3,"click"],[1,"path-cell"],[1,"actions"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(n,r){n&1&&(_i(0,"div",0),_D(1,Fe,7,6,"header",1),_D(2,ye,3,3,"p",2)(3,Ne,2,1,"p",3)(4,je,4,3),Jc()),n&2&&(Sh("list-page",!r.inSelectionMode()),ch("data-testid",r.inSelectionMode()?"context-file-picker":"context-files-manage"),gI(),MD(r.inSelectionMode()?-1:1),gI(),MD(r.loading()?2:r.loadError()?3:4));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,Lt,ut,ai,z,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();export{St as S,ze as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,b0 as jn,V as Ve,bK as W0,a5 as q0,Z as ZE,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,j as _i,m as mh,J as Jc,k as iE,I as Iw,o as gI,w as lh,y as aE,z as rl$1,b as at,b3 as Wn,q as qo,U as Uw,u as ue,r as r$1,c as bi,d as $8,K as Kt,P as Pw,x as xD,l as _D,p as Fw,B as AD,M as MD,b4 as N2,aV as ix,bU as M1,b5 as cx,i as ie,L as Lh,H as HD,D as ch,G as FD,al as Sh,aL as Fh,O as Fu,Q as ju}from'./main-
|
|
1
|
+
import {C,b0 as jn,V as Ve,bK as W0,a5 as q0,Z as ZE,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,j as _i,m as mh,J as Jc,k as iE,I as Iw,o as gI,w as lh,y as aE,z as rl$1,b as at,b3 as Wn,q as qo,U as Uw,u as ue,r as r$1,c as bi,d as $8,K as Kt,P as Pw,x as xD,l as _D,p as Fw,B as AD,M as MD,b4 as N2,aV as ix,bU as M1,b5 as cx,i as ie,L as Lh,H as HD,D as ch,G as FD,al as Sh,aL as Fh,O as Fu,Q as ju}from'./main-Q5LNROCU.js';import {a as ai,z}from'./chunk-wu6SvZ0s.js';var fe=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/filesystem`;}browse(e,i){let n=new M1;return e!=null&&e.trim()!==""&&(n=n.set("path",e.trim())),i?.mode&&(n=n.set("mode",i.mode)),i?.extensions&&i.extensions.length>0&&(n=n.set("extensions",i.extensions.join(","))),this.http.get(`${this.baseUrl}/browse`,{params:n}).pipe(cx())}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();function L(t){if(!t)return [];if(/^[A-Za-z]:/.test(t)){let r=t.includes("\\")?"\\":"/",h=`${t.slice(0,2)}${r}`,_=t.slice(2).replace(/^[\\/]+/,"").split(/[\\/]/).filter(Boolean),R=[{label:t.slice(0,2),path:h}],f=h;for(let O of _)f=f.endsWith(r)?f+O:f+r+O,R.push({label:O,path:f});return R}if(t.startsWith("/")){let r=t.split("/").filter(Boolean),h=[{label:"/",path:"/"}],z="";for(let _ of r)z+=`/${_}`,h.push({label:_,path:z});return h}let o=t.includes("\\")?"\\":"/",e=t.split(/[\\/]/).filter(Boolean),i=[],n="";for(let r of e)n=n?n+o+r:r,i.push({label:r,path:n});return i}function j(t){let o=L(t);return o.length<2?null:o[o.length-2].path}var be=(t,o)=>o.path;function xe(t,o){if(t&1){let e=FD();_i(0,"button",7),mh("click",function(){Fu(e);let n=HD().$implicit,r=HD();return ju(r.loadDir(n.path))}),Iw(1),Jc(),_i(2,"span",8),Iw(3,"/"),Jc();}if(t&2){let e=HD().$implicit;ch("data-testid","file-browser-crumb-"+e.label),gI(),rl$1(" ",e.label," ");}}function we(t,o){if(t&1&&(_i(0,"span",6),Iw(1),Jc()),t&2){let e=HD().$implicit;ch("data-testid","file-browser-crumb-"+e.label),gI(),Lh(e.label);}}function De(t,o){if(t&1&&_D(0,xe,4,2)(1,we,2,2,"span",6),t&2){let e=o.$index,i=o.$count;MD(e!==i-1?0:1);}}function ve(t,o){t&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ye(t,o){if(t&1&&(_i(0,"p",4),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.error());}}function Me(t,o){if(t&1){let e=FD();_i(0,"li")(1,"button",9),mh("click",function(){let n=Fu(e),r=HD(2);return ju(r.loadDir(n))}),Iw(2," ../ "),Jc()();}}function ke(t,o){if(t&1){let e=FD();_i(0,"li")(1,"button",10),mh("click",function(){let n=Fu(e).$implicit,r=HD(2);return ju(r.onEntry(n))}),Iw(2),Jc()();}if(t&2){let e=o.$implicit,i=HD(2);gI(),Sh("dir",e.isDirectory)("selected",i.isSelected(e)),ch("data-testid","file-browser-entry-"+e.name),gI(),Fh(" ",e.name,"",e.isDirectory?"/":""," ");}}function Fe(t,o){if(t&1&&(_i(0,"ul",5),_D(1,Me,3,0,"li"),xD(2,ke,3,7,"li",null,be),Jc()),t&2){let e,i=HD();gI(),MD((e=i.parentDir())?1:-1,e),gI(),AD(i.entries());}}var ge=(()=>{class t{constructor(){this.filesystem=C(fe),this.transloco=C(Ve),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.path=W0(this.modalData?.path??""),this.mode=q0(this.modalData?.mode??"files"),this.extensions=q0(this.modalData?.extensions??[]),this.currentDir=qo(""),this.entries=qo([]),this.loading=qo(false),this.error=qo(null),this.crumbs=Uw(()=>L(this.currentDir())),this.parentDir=Uw(()=>j(this.currentDir()));}ngOnInit(){this.openAround(this.path());}isSelected(e){return this.mode()==="directories"?e.isDirectory&&e.path===this.path():!e.isDirectory&&e.path===this.path()}onEntry(e){if(e.isDirectory){this.loadDir(e.path);return}this.mode()==="files"&&this.path.set(e.path);}loadDir(e){this.loading.set(true),this.error.set(null),this.filesystem.browse(e,this.browseFilter()).pipe(ue(this.destroyRef)).subscribe({next:i=>this.applyListing(i),error:i=>{this.loading.set(false),this.error.set(this.errorMessage(i,this.transloco.translate("file-browser.loadFailed")));}});}browseFilter(){let e=this.extensions();return r$1({mode:this.mode()},e.length>0?{extensions:e}:{})}openAround(e){let i=e.trim();if(!i){this.loadDir(void 0);return}this.loading.set(true),this.error.set(null),this.filesystem.browse(i,this.browseFilter()).pipe(ue(this.destroyRef)).subscribe({next:n=>this.applyListing(n),error:()=>this.loadDir(j(i)??void 0)});}applyListing(e){this.currentDir.set(e.path),this.entries.set(e.entries),this.mode()==="directories"&&this.path.set(e.path),this.loading.set(false),this.error.set(null);}errorMessage(e,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-file-browser"]],inputs:{path:[1,"path"],mode:[1,"mode"],extensions:[1,"extensions"]},outputs:{path:"pathChange"},decls:10,vars:4,consts:[["data-testid","file-browser",1,"file-browser"],["data-testid","file-browser-selected",1,"selected"],["data-testid","file-browser-breadcrumbs",1,"crumbs"],["data-testid","file-browser-loading"],["data-testid","file-browser-error",1,"error"],["data-testid","file-browser-entries",1,"entries"],[1,"current"],["nz-button","","nzType","link","type","button",3,"click"],["aria-hidden","true",1,"sep"],["type","button","data-testid","file-browser-up",1,"entry","dir",3,"click"],["type","button",1,"entry",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nav",2),xD(5,De,2,1,null,null,be),Jc(),_D(7,ve,3,3,"p",3)(8,ye,2,1,"p",4)(9,Fe,4,1,"ul",5),Jc()),i&2&&(gI(2),rl$1(" ",n.path()||Fw(3,2,n.mode()==="directories"?"file-browser.emptySelectionDirectory":"file-browser.emptySelection")," "),gI(3),AD(n.crumbs()),gI(2),MD(n.loading()?7:n.error()?8:9));},dependencies:[$8,pf,bd,sp,Kt],styles:[".file-browser[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.45rem}.selected[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#44403c;overflow-wrap:anywhere;word-break:break-word}.crumbs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.1rem;font-size:.85rem}.crumbs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding-inline:.15rem;height:auto}.sep[_ngcontent-%COMP%]{color:#a8a29e}.current[_ngcontent-%COMP%]{color:#1c1917;font-weight:600}.entries[_ngcontent-%COMP%]{list-style:none;margin:0;padding:.2rem 0;max-height:20rem;overflow:auto;border:1px solid #e7e5e4;background:#fff}.entry[_ngcontent-%COMP%]{display:block;width:100%;text-align:left;border:0;background:transparent;padding:.3rem .6rem;cursor:pointer;font:inherit;color:inherit}.entry[_ngcontent-%COMP%]:hover{background:#f5f5f4}.entry.dir[_ngcontent-%COMP%]{font-weight:600}.entry.selected[_ngcontent-%COMP%]{background:#e7e5e4}.error[_ngcontent-%COMP%]{margin:0;color:#9f1239}"]});}}return t})();var ot=(()=>{class t{constructor(){this.modal=C(jn),this.transloco=C(Ve),this.path=W0(""),this.mode=q0("files"),this.extensions=q0([]),this.placeholder=q0(void 0),this.browseLabel=q0(void 0);}placeholderText(){return this.placeholder()||this.transloco.translate(this.mode()==="directories"?"path-picker.placeholderDirectory":"path-picker.placeholderFile")}browseButtonText(){return this.browseLabel()||this.transloco.translate("path-picker.browse")}openBrowse(){let e=this.mode(),i=this.modal.create({nzTitle:this.transloco.translate(e==="directories"?"path-picker.modalTitleDirectory":"path-picker.modalTitleFile"),nzContent:ge,nzData:{path:this.path(),mode:e,extensions:this.extensions()},nzWidth:640,nzOkText:this.transloco.translate(e==="directories"?"file-browser.useFolder":"path-picker.selectFile"),nzCancelText:this.transloco.translate("common.cancel"),nzOnOk:()=>{let n=i.getContentComponent();this.path.set(n.path());}});}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-path-picker"]],inputs:{path:[1,"path"],mode:[1,"mode"],extensions:[1,"extensions"],placeholder:[1,"placeholder"],browseLabel:[1,"browseLabel"]},outputs:{path:"pathChange"},decls:4,vars:3,consts:[["data-testid","path-picker",1,"path-picker"],["nz-input","","data-testid","path-picker-input",3,"ngModelChange","placeholder","ngModel"],["nz-button","","type","button","data-testid","path-picker-browse",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0)(1,"input",1),mh("ngModelChange",function(h){return n.path.set(h)}),Jc(),iE(),_i(2,"button",2),mh("click",function(){return n.openBrowse()}),Iw(3),Jc()()),i&2&&(gI(),lh("placeholder",n.placeholderText())("ngModel",n.path()),aE(),gI(2),rl$1(" ",n.browseButtonText()," "));},dependencies:[al,er,rl,$i,pf,bd,sp,fp,ai,z,ts],styles:[".path-picker[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.path-picker[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0}"]});}}return t})();export{ot as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {S as St}from'./chunk-CtFtOXy4.js';import'./chunk-CuBg4N16.js';import'./chunk-BrckDrlX.js';import {Z as ZE,n as uh}from'./main-Q5LNROCU.js';import'./chunk-wu6SvZ0s.js';import'./chunk-DvI50p6W.js';import'./chunk-DF1Zujdm.js';import'./chunk-djGmnQaE.js';var c=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-context-files-manage"]],decls:1,vars:0,template:function(t,a){t&1&&uh(0,"app-context-file-list");},dependencies:[St],encapsulation:2});}}return e})();export{c as ContextFilesManageComponent};
|