-
Notifications
You must be signed in to change notification settings - Fork 0
/
chunk-RR4LT6HK.js
4 lines (4 loc) · 13.8 KB
/
chunk-RR4LT6HK.js
1
2
3
4
import{b as Q}from"./chunk-3MICEEYE.js";import{h as x}from"./chunk-TL3SOKZG.js";import{a as le,c as de,h as se,o as D,p as pe}from"./chunk-2UOGX6KS.js";import{l as q}from"./chunk-FB7CDEED.js";import{$a as E,Ia as j,Ja as V,Lb as H,M as z,Na as w,Oa as K,Pa as h,Ta as U,Ua as G,V as C,Va as X,W as J,Wa as Z,Xa as I,Ya as M,Za as a,_a as l,ba as g,ca as _,cb as y,db as f,eb as p,fa as k,fc as oe,hc as ae,ib as $,jb as ee,kb as te,lb as ie,mb as s,na as A,ob as O,pb as ne,rb as F,sb as b,tb as L,ya as m,yb as v,za as S,zb as re}from"./chunk-XIWENJHJ.js";import"./chunk-BL3FZZIZ.js";function fe(r,n){if(r&1){let o=y();a(0,"div",10),f("removed",function(){let t=g(o).$implicit,i=p();return _(i.removeKey(t))})("edited",function(t){let i=g(o).$implicit,u=p();return _(u.editKey(i,t))}),s(1),a(2,"button",11)(3,"span",12),s(4,"cancel"),l()()()}if(r&2){let o=n.$implicit;m(),O(" ",o," "),m(),K("aria-label","remove "+o)}}var ce=(()=>{let n=class n extends W{onNoClick(){this.itemChanged.emit({role:"none",data:void 0})}onOkClick(){this.itemChanged.emit({role:this.role,data:this.data})}removeKey(e){let t=this.data.valueKeys.indexOf(e);t>=0&&this.data.valueKeys.splice(t,1)}editKey(e,t){let i=t.value.trim();if(!i){this.removeKey(e);return}let u=this.data.valueKeys.indexOf(e);u>=0&&(this.data.valueKeys[u]=i)}addKey(e){let t=e.target.value.trim();t&&(this.data.valueKeys.push(t),e.target.value="")}};n.\u0275fac=(()=>{let e;return function(i){return(e||(e=k(n)))(i||n)}})(),n.\u0275cmp=C({type:n,selectors:[["group-edit"]],standalone:!0,features:[V,v],decls:51,vars:15,consts:[[1,"two"],["matInput","",3,"ngModelChange","ngModel","placeholder"],[1,"color"],["matInput","",3,"ngModelChange","ngModel","type","placeholder"],[1,"one"],[1,"full-width"],["aria-label","Enter key"],["placeholder","Tag List",3,"input"],["matInput","",3,"ngModelChange","rows","cols","ngModel","placeholder"],[3,"click"],[3,"removed","edited"],["matChipRemove",""],[1,"small-icon"]],template:function(t,i){t&1&&(a(0,"h2"),s(1),l(),a(2,"div")(3,"div",0)(4,"fieldset")(5,"legend"),s(6,"category"),l(),a(7,"input",1),L("ngModelChange",function(d){return b(i.data.category,d)||(i.data.category=d),d}),l(),a(8,"p"),s(9,"Category"),l()(),a(10,"fieldset")(11,"legend"),s(12,"Key"),l(),a(13,"input",1),L("ngModelChange",function(d){return b(i.data.key,d)||(i.data.key=d),d}),l(),a(14,"p"),s(15,"Key"),l()()(),a(16,"div",0)(17,"fieldset",2)(18,"legend"),s(19,"Color"),l(),a(20,"input",3),L("ngModelChange",function(d){return b(i.data.color,d)||(i.data.color=d),d}),l(),a(21,"p"),s(22,"Color"),l()(),a(23,"fieldset")(24,"legend"),s(25,"Value Type"),l(),a(26,"input",1),L("ngModelChange",function(d){return b(i.data.valueType,d)||(i.data.valueType=d),d}),l(),a(27,"p"),s(28,"Value Type"),l()()(),a(29,"div",4)(30,"fieldset",5)(31,"legend"),s(32,"Tags List"),l(),a(33,"div",6),I(34,fe,5,2,"div",null,Z),a(36,"input",7),f("input",function(d){return i.addKey(d)}),l()(),a(37,"p"),s(38,"Tag List"),l()()(),a(39,"div",4)(40,"fieldset",5)(41,"legend"),s(42,"Description"),l(),a(43,"textarea",8),L("ngModelChange",function(d){return b(i.data.description,d)||(i.data.description=d),d}),l(),a(44,"p"),s(45,"Description"),l()()()(),a(46,"footer")(47,"button",9),f("click",function(){return i.onNoClick()}),s(48,"No Thanks"),l(),a(49,"button",9),f("click",function(){return i.onOkClick()}),s(50,"Ok"),l()()),t&2&&(m(),ne("",i.role," Group ",i.data.key,""),m(6),F("ngModel",i.data.category),h("placeholder","category"),m(6),F("ngModel",i.data.key),h("placeholder","key"),m(7),F("ngModel",i.data.color),h("type","color")("placeholder","color"),m(6),F("ngModel",i.data.valueType),h("placeholder","value type"),m(8),M(i.data.valueKeys),m(9),h("rows",4)("cols",67),F("ngModel",i.data.description),h("placeholder","description"))},dependencies:[D,le,de,se,pe],styles:[`.two fieldset+fieldset{margin-left:8px}.one,.full-width{width:100%}.color{padding:0;margin:0}
`],encapsulation:2});let r=n;return r})();var W=(()=>{let n=class n{constructor(e,t){this._changeDetectorRef=e,this.service=t,this.role="none",this.level=0,this.category="",this.data=new x,this.itemChanged=new A,this.cloned=j(new x)}ngOnDestroy(){}get roleBased(){return this.role==="edit"?this.current:this.role==="add"?this.cloned():this.role==="clone"?this.cloned():(alert("error"),new x)}trackByFn(e,t){return t.id||e}get marginLeft(){return 1+this.level*20}select(e){e.stopPropagation(),this.itemChanged.emit({role:"none",data:this.data})}toggle(){this.data.toggle()}setChild({role:e,data:t}){this.itemChanged.emit({role:e,data:t})}edit(e){e.stopPropagation(),this.current&&(this.role="edit",this.itemChanged.emit({role:"edit",data:this.current}))}clone(e){if(e.stopPropagation(),this.current!==void 0){var t=this.current.clone();t.id="",this.cloned.set(t),this.role="clone",this.itemChanged.emit({role:"clone",data:t})}}add(e){if(e.stopPropagation(),this.current!==void 0){var t=new x;t.id="",t.category=this.current.category,t.parent=this.current,t.parentKey=this.current.key,t.color=this.current.color,this.cloned.set(t),this.role="add",this.itemChanged.emit({role:"add",data:t})}}dragStart(e){if(!e||!e.target||!e.dataTransfer)return;let i=e.target.getAttribute("data-id");e.dataTransfer.setData("text/plain",i),e.dataTransfer.effectAllowed="move",e.target instanceof HTMLElement&&e.target.classList.add("dragging")}dragOver(e){e.preventDefault(),e.target instanceof HTMLElement&&e.target.classList.add("drag-over")}dragEnter(e){e.target instanceof HTMLElement&&e.target.classList.add("drag-over")}dragLeave(e){e.target instanceof HTMLElement&&e.target.classList.remove("drag-over")}dragEnd(e){e.target instanceof HTMLElement&&(e.target.classList.remove("drag-over"),e.target.classList.remove("dragging"),e.target.classList.add("drag-end"))}onOver(e){e.preventDefault()}};n.\u0275fac=function(t){return new(t||n)(S(H),S(Q))},n.\u0275cmp=C({type:n,selectors:[["group-base"]],inputs:{role:"role",level:"level",category:"category",data:"data",current:"current",parent:"parent"},outputs:{itemChanged:"itemChanged"},standalone:!0,features:[v],decls:0,vars:0,template:function(t,i){},encapsulation:2});let r=n;return r})();function Ce(r,n){if(r&1){let o=y();a(0,"span",6),f("click",function(t){g(o);let i=p(2);return _(i.edit(t))}),s(1,"edit"),l()}}function ve(r,n){r&1&&E(0,"span",4)}function ye(r,n){if(r&1&&(a(0,"span",5),s(1),l()),r&2){let o=p(2);m(),O(" ",o.data.value.length," ")}}function xe(r,n){r&1&&E(0,"span",4)}function we(r,n){if(r&1){let o=y();a(0,"div",2),f("click",function(t){g(o);let i=p();return _(i.select(t))})("dragstart",function(t){g(o);let i=p();return _(i.dragStart(t))})("dragleave",function(t){g(o);let i=p();return _(i.dragLeave(t))})("dragenter",function(t){g(o);let i=p();return _(i.dragEnter(t))})("dragover",function(t){g(o);let i=p();return _(i.dragOver(t))})("dragend",function(t){g(o);let i=p();return _(i.dragEnd(t))}),w(1,Ce,2,0,"span",3)(2,ve,1,0,"span",4),s(3),w(4,ye,2,1,"span",5)(5,xe,1,0,"span",4),l()}if(r&2){let o=p();h("draggable",!0),K("id",o.data.id)("data-id",o.data.id)("data-type",o.data.category),m(),G(o.data===o.current?1:2),m(2),O(" ",o.data.key," "),m(),G(o.data.value.length>0?4:5)}}function Ge(r,n){if(r&1){let o=y();a(0,"group-chip",8),f("itemChanged",function(t){g(o);let i=p(2);return _(i.itemChanged.emit(t))}),l()}if(r&2){let o=n.$implicit,e=p(2);h("data",o)("current",e.current)("parent",e.data)("level",e.level+1)}}function Ee(r,n){if(r&1&&I(0,Ge,1,4,"group-chip",7,X),r&2){let o=p();M(o.data.groups)}}function Te(r,n){if(r&1){let o=y();a(0,"button",9),f("click",function(t){g(o);let i=p();return _(i.add(t))}),a(1,"span",3),s(2,"add"),l()()}r&2&&K("aria-label","add")}var ue=(()=>{let n=class n extends W{};n.\u0275fac=(()=>{let e;return function(i){return(e||(e=k(n)))(i||n)}})(),n.\u0275cmp=C({type:n,selectors:[["group-chip"]],standalone:!0,features:[V,v],decls:4,vars:2,consts:[[1,"chips"],[1,"chip",3,"draggable"],[1,"chip",3,"click","dragstart","dragleave","dragenter","dragover","dragend","draggable"],[1,"small-icon"],[1,"filler"],[1,"badge"],[1,"small-icon",3,"click"],[3,"data","current","parent","level"],[3,"itemChanged","data","current","parent","level"],[3,"click"]],template:function(t,i){t&1&&(a(0,"div",0),w(1,we,6,7,"div",1)(2,Ee,2,0),l(),w(3,Te,3,1,"button")),t&2&&(m(),G(i.data.groups.length?2:1),m(2),G(i.level===0?3:-1))},dependencies:[n,D],encapsulation:2});let r=n;return r})();var me=(()=>{let n=class n{constructor(e,t){this._changeDetectorRef=e,this.service=t,this.data=[],this.itemChanged=new A,this.role="none",this.cloned=j(new x)}trackByFn(e,t){return t.id||e}get roleBased(){return this.role==="edit"?this.current:this.role==="add"?this.cloned():this.role==="clone"?this.cloned():(alert("error"),new x)}closed({role:e,data:t}){if(this.role=e,t===void 0)return;let i=t;if(this.dialog?.close(),i!==void 0){if(this.role==="add"){if(i===void 0||this.current==null)return;this.current.isExpanded=!0,this.current.parent&&(this.current.parent.isExpanded=!0),this.service.createGroup(i)}else if(this.role==="edit"){if(this.current===void 0)return;this.current.key=i.key,this.current.value=i.value,this.current.color=i.color,this.current.isExpanded=!0,this.current.parent&&(this.current.parent.isExpanded=!0)}else if(this.role==="clone"){if(this.current===void 0||i===void 0)return;this.current.parent?i.parentKey=this.current.parent.key:i.parentKey=this.current.key,this.current.isExpanded=!0,this.current.parent&&(this.current.parent.isExpanded=!0),this.service.createGroup(i)}else alert("error");this.service.updateGroup(i)}}setCurrent({role:e,data:t}){if(this.role=e,t!==void 0)if(t.key==="All"){this.current=void 0,this.itemChanged.emit({role:"none",data:void 0});return}else e==="edit"?(this.cloned.set(t),this.dialog?.showModal()):e==="clone"?(this.cloned.set(t),this.dialog?.showModal()):e==="add"?(this.cloned.set(t),this.dialog?.showModal()):(this.current=t,this.itemChanged.emit({role:e,data:t}))}dropped(e){if(e.preventDefault(),!e.dataTransfer)return;let t=e.dataTransfer?.getData("text/plain"),i=e.target;for(;i&&!i.getAttribute("data-id");)i=i.parentElement;if(!t||!i){alert("no source or target");return}let u=i?i.getAttribute("data-id"):null,d=this.getId(u),c=this.getId(t),Y=c?.parent,N=d?.parent;if(Y&&N&&Y.id===N.id&&Y===N){let T=N,R=T.groups.indexOf(c),P=T.groups.indexOf(d);if(R!==-1&&P!==-1)if(R<P){T.groups.splice(R,1),T.groups.splice(P,0,c),this.service.buildGroupedGroups(),this.service.updateGroups();return}else{T.groups.splice(R,1),T.groups.splice(P,0,c),this.service.buildGroupedGroups(),this.service.updateGroups();return}}c!==null&&d!==null&&(d.groups.length>0?c.parent&&(c.parent.groups.splice(c.parent.groups.indexOf(c),1),d.groups.push(c),c.category=d.category,c.parentKey=d.key,this.service.buildGroupedGroups(),this.service.updateGroups()):c?.parent&&(c.parent.groups.splice(c.parent.groups.indexOf(c),1),d.groups.push(c),c.category=d.category,c.parentKey=d.key,this.service.buildGroupedGroups(),this.service.updateGroups()))}getId(e){if(e===null)return null;for(let t of this.service.groups())if(t.id===e)return t;return null}};n.\u0275fac=function(t){return new(t||n)(S(H),S(Q))},n.\u0275cmp=C({type:n,selectors:[["group-base"]],inputs:{data:"data"},outputs:{itemChanged:"itemChanged"},standalone:!0,features:[v],decls:0,vars:0,template:function(t,i){},encapsulation:2});let r=n;return r})();var ke=["groupchipdialog"],Se=()=>({backgroundColor:"green"});function Ve(r,n){r&1&&E(0,"progress")}function Ie(r,n){if(r&1){let o=y();a(0,"group-chip",5),f("itemChanged",function(t){g(o);let i=p(2);return _(i.setCurrent(t))}),l()}if(r&2){let o=n.$implicit,e=p(2);h("data",o)("current",e.current)("parent",o)("level",0)}}function Me(r,n){if(r&1&&I(0,Ie,1,4,"group-chip",4,U().trackByFn,!0),r&2){let o=p();M(o.service.groupedGroups())}}function Fe(r,n){if(r&1){let o=y();a(0,"group-edit",6),f("itemChanged",function(t){g(o);let i=p();return _(i.closed(t))})("close",function(){g(o),p();let t=ie(6);return _(t.close())}),l()}if(r&2){let o=p();h("role",o.role)("data",o.roleBased)}}var ge=(()=>{let n=class n extends me{ngAfterViewInit(){this.element&&(this.dialog=this.element.nativeElement)}addNewGroup(){let e=new x;e.category="RENAME CATEGORY",e.color="green",e.id="",e.key="NEW",e.description="",e.parentKey="",e.parent=null,this.cloned.set(e),this.role="add",this.dialog?.showModal()}};n.\u0275fac=(()=>{let e;return function(i){return(e||(e=k(n)))(i||n)}})(),n.\u0275cmp=C({type:n,selectors:[["group-list"]],viewQuery:function(t,i){if(t&1&&$(ke,5),t&2){let u;ee(u=te())&&(i.element=u.first)}},standalone:!0,features:[V,v],decls:8,vars:4,consts:[["groupchipdialog",""],[1,"filter",3,"click","ngStyle"],[3,"drop"],[3,"role","data"],[3,"data","current","parent","level"],[3,"itemChanged","data","current","parent","level"],[3,"itemChanged","close","role","data"]],template:function(t,i){if(t&1){let u=y();a(0,"button",1),f("click",function(){return g(u),_(i.addNewGroup())}),s(1,"NEW CATEGPRY"),l(),a(2,"div",2),f("drop",function(c){return g(u),_(i.dropped(c))}),w(3,Ve,1,0,"progress")(4,Me,2,0),l(),a(5,"dialog",null,0),w(7,Fe,1,2,"group-edit",3),l()}t&2&&(h("ngStyle",re(3,Se)),m(3),G(i.service.isWaiting()?3:4),m(4),G(i.role!=="none"?7:-1))},dependencies:[ae,oe,ce,ue],styles:[`.filter{margin:1px 1px 9px;display:grid;grid-template-columns:auto 22px;cursor:pointer;border-radius:19px;align-items:center;border-style:none;color:#fff}.filter:hover{background-color:#fff;color:#fff}
`],encapsulation:2});let r=n;return r})();var _e=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=C({type:n,selectors:[["group-container"]],standalone:!0,features:[v],decls:2,vars:0,consts:[[1,"container"]],template:function(t,i){t&1&&(a(0,"div",0),E(1,"group-list"),l())},dependencies:[D,ge],styles:[`.container{margin-left:32px;margin-right:32px;padding-left:10px;padding-right:10px;max-height:90%;overflow-y:auto;overflow-x:hidden}
`],encapsulation:2});let r=n;return r})();var be=[{path:"",component:_e,children:[]}],wt=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=J({type:n}),n.\u0275inj=z({imports:[q.forChild(be),q]});let r=n;return r})();export{wt as groupsRoutingModule};