@sync-in/server 1.3.1 → 1.3.2
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/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/static/{chunk-NCIAR3N4.js → chunk-2LIE3SKB.js} +1 -1
- package/static/{chunk-2CQOSX2Q.js → chunk-3BKYCF53.js} +1 -1
- package/static/{chunk-HQC3W7BS.js → chunk-6CFIZHYI.js} +1 -1
- package/static/{chunk-HDDBV3QQ.js → chunk-7FVU676A.js} +1 -1
- package/static/{chunk-2QEYCCHN.js → chunk-7RNZNYVF.js} +1 -1
- package/static/{chunk-TFBTBTPR.js → chunk-7SJOQRBE.js} +1 -1
- package/static/{chunk-CTWOQLAR.js → chunk-BS5LXHXU.js} +1 -1
- package/static/{chunk-Y6IYSEKU.js → chunk-CPHC7U34.js} +1 -1
- package/static/{chunk-7U66TR6P.js → chunk-DYRV5R67.js} +1 -1
- package/static/{chunk-3RLZPQMJ.js → chunk-EWJD5G76.js} +1 -1
- package/static/{chunk-AXITQYVN.js → chunk-EYXC4W63.js} +1 -1
- package/static/{chunk-VIL6L67B.js → chunk-GSVMWC5N.js} +1 -1
- package/static/{chunk-EWY4ALVF.js → chunk-HNWPHW2W.js} +1 -1
- package/static/{chunk-FBG4NUDE.js → chunk-IPGNGPWY.js} +1 -1
- package/static/{chunk-5OIPLRAE.js → chunk-J5O3CY2H.js} +1 -1
- package/static/{chunk-R4USKWW6.js → chunk-JRVJIJB5.js} +1 -1
- package/static/{chunk-AYEOHGUD.js → chunk-MAWDGVNC.js} +1 -1
- package/static/{chunk-2SX3MVH3.js → chunk-N3QPDPBV.js} +1 -1
- package/static/{chunk-WA3LPP4G.js → chunk-NSXFB3SX.js} +1 -1
- package/static/{chunk-2XXS272C.js → chunk-OVO4W2GF.js} +1 -1
- package/static/{chunk-LHKO5Y4A.js → chunk-SOLCSMU7.js} +1 -1
- package/static/{chunk-RGONEEJE.js → chunk-SY5HMUMM.js} +1 -1
- package/static/{chunk-GI2LXVWQ.js → chunk-SZKZH4MJ.js} +1 -1
- package/static/{chunk-ZSMTUPAP.js → chunk-ULTPIQL3.js} +1 -1
- package/static/{chunk-AA6ZTGRW.js → chunk-VFSSL4TI.js} +1 -1
- package/static/{chunk-WQPVP63E.js → chunk-WGSPBZVN.js} +1 -1
- package/static/{chunk-ZZGFGD5E.js → chunk-X6UFHF4Q.js} +1 -1
- package/static/{chunk-ZS5YIDNI.js → chunk-XBHT4AH5.js} +1 -1
- package/static/{chunk-5JDPARJT.js → chunk-ZYB4TLJM.js} +1 -1
- package/static/index.html +1 -1
- package/static/{main-7IVUWYWM.js → main-EDITZWHO.js} +3 -3
- package/sync-in-server.js +17 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as fe,g as ge}from"./chunk-5JDPARJT.js";import{f as he}from"./chunk-ZZGFGD5E.js";import{Ia as de,Sb as me,tb as j,xb as ue}from"./chunk-HDDBV3QQ.js";import{Ab as E,Bb as b,Bc as Z,Bd as se,Ce as ae,Dd as w,Eb as m,Fb as c,Gf as pe,J as z,La as P,Me as le,N,Pb as T,Qb as u,Rb as y,Sa as r,Ub as D,Vb as F,Vc as $,Wb as G,Wc as Y,Xa as x,Xb as J,Yc as ee,Zb as K,_b as X,_d as re,_e as ce,ab as M,ad as te,ba as L,bc as V,cb as W,dc as A,fb as h,fc as H,fd as ie,lb as d,nb as O,pa as _,pb as U,qa as C,rb as f,sb as q,sd as ne,tb as B,td as oe,ub as Q,vb as l,wa as v,wb as a,xb as g,za as R}from"./chunk-FPEGN42P.js";var ve=function(i){return i[i.USER=0]="USER",i[i.PERSONAL=1]="PERSONAL",i}(ve||{}),xe=function(i){return i[i.VISIBLE=0]="VISIBLE",i[i.PRIVATE=1]="PRIVATE",i[i.ISOLATED=2]="ISOLATED",i}(xe||{});function Oe(i,o){if(i&1&&(l(0,"span"),u(1),a()),i&2){let e=c();r(),y(e.group.name)}}function be(i,o){i&1&&(l(0,"span",3),u(1,"New personal group"),a())}function ye(i,o){if(i&1&&g(0,"fa-icon",4),i&2){let e=c();d("icon",e.icons.faSpinner)}}function ke(i,o){i&1&&(l(0,"span",3),u(1,"Edit personal group"),a())}function Se(i,o){i&1&&(l(0,"span",3),u(1,"Edit group"),a())}function Me(i,o){if(i&1&&(l(0,"h4",5),h(1,ke,2,0,"span",3)(2,Se,2,0,"span",3),a()),i&2){let e=c();r(),f(e.isPersonalGroup?1:2)}}var it=(()=>{class i{constructor(e,t){this.layout=e,this.userService=t,this.groupChange=new v,this.user=this.userService.user,this.icons={GROUPS:ue.GROUPS,faSpinner:pe,faCog:ce,faUsers:re,faPen:le},this.isPersonalGroup=!0,this.submitted=!1,this.loading=!1}ngOnInit(){this.originalGroup?.id?(this.isPersonalGroup=this.originalGroup.isPersonalGroup,this.group=new j({id:this.originalGroup.id,name:this.originalGroup.name,description:this.originalGroup.description,createdAt:this.originalGroup.createdAt,modifiedAt:this.originalGroup.modifiedAt,type:this.originalGroup.type})):this.group=new j({id:0,name:"",description:"",createdAt:null,modifiedAt:null,type:de.PGROUP})}onCancel(){this.layout.closeDialog()}onSubmit(){if(this.loading=!0,this.submitted=!0,this.group.id===0)this.userService.createPersonalGroup(this.makeDto(!0)).subscribe({next:e=>{this.loading=!1,this.groupChange.emit(["add",e]),this.layout.sendNotification("success","Group created",e.name),this.layout.closeDialog()},error:e=>this.onError(e)});else{let e=this.makeDto();if(!Object.keys(e).length){this.loading=!1,this.submitted=!1;return}this.userService.updatePersonalGroup(this.originalGroup.id,this.makeDto()).subscribe({next:t=>{this.loading=!1,this.groupChange.emit(["update",t]),this.layout.sendNotification("success","Group updated",t.name),this.layout.closeDialog()},error:t=>this.onError(t)})}}makeDto(e=!1){return{name:e?this.group.name:this.group.name!==this.originalGroup.name?this.group.name:void 0,description:e?this.group.description:this.group.description!==this.originalGroup.description?this.group.description:void 0}}onError(e){this.layout.sendNotification("error","Group error",this.group.name,e),this.submitted=!1,this.loading=!1}static{this.\u0275fac=function(t){return new(t||i)(x(me),x(he))}}static{this.\u0275cmp=M({type:i,selectors:[["app-user-group-dialog"]],inputs:{originalGroup:"originalGroup"},outputs:{groupChange:"groupChange"},decls:23,vars:15,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","disabled","autoSelect","ngModel"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","disabled"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,n){t&1&&(l(0,"div",0)(1,"h4",1),g(2,"fa-icon",2),h(3,Oe,2,1,"span")(4,be,2,0,"span",3)(5,ye,1,1,"fa-icon",4),a(),h(6,Me,3,1,"h4",5),l(7,"button",6),m("click",function(){return n.layout.closeDialog()}),a()(),l(8,"div",7)(9,"div",8)(10,"div",9)(11,"label",10),u(12,"Name"),a(),l(13,"input",11),G("ngModelChange",function(p){return F(n.group.name,p)||(n.group.name=p),p}),a()(),l(14,"div",12)(15,"label",13),u(16,"Description"),a(),l(17,"input",14),G("ngModelChange",function(p){return F(n.group.description,p)||(n.group.description=p),p}),a()()()(),l(18,"div",15)(19,"button",16),m("click",function(){return n.onCancel()}),u(20,"Cancel"),a(),l(21,"button",17),m("click",function(){return n.onSubmit()}),u(22," Confirm "),a()()),t&2&&(r(2),d("icon",n.icons.GROUPS),r(),f(n.group.id?3:4),r(2),f(n.loading?5:-1),r(),f(n.group.id?6:-1),r(),U("btn-close btn-close-white ",n.group.id?"ms-2":"ms-auto"," ms-2"),r(6),O("is-invalid",!n.group.name),d("disabled",!n.isPersonalGroup)("autoSelect",!1),D("ngModel",n.group.name),r(4),D("ngModel",n.group.description),d("disabled",!n.isPersonalGroup),r(4),d("disabled",!n.group.name||n.submitted))},dependencies:[oe,ee,te,ne,ie,w,se,fe],encapsulation:2})}}return i})();var Ce=(()=>{class i{onClick(e){e.stopPropagation()}ngOnInit(){setTimeout(()=>{typeof document<"u"&&document.addEventListener("click",this.offClickHandler)},0)}ngOnDestroy(){typeof document<"u"&&document.removeEventListener("click",this.offClickHandler)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=W({type:i,selectors:[["","offClick",""]],hostBindings:function(t,n){t&1&&m("click",function(p){return n.onClick(p)})},inputs:{offClickHandler:[0,"offClick","offClickHandler"]}})}}return i})();var k=class{constructor(o){typeof o=="string"&&(this.id=this.name=o,this.description=""),typeof o=="object"&&(this.id=o.id||o.name,this.name=o.name,this.description=o.description||"")}};var we=i=>({active:i}),Pe=(i,o)=>({o:i,i:o});function Ee(i,o){if(i&1){let e=b();l(0,"input",6),m("keydown",function(n){_(e);let s=c();return C(s.inputEvent(n))})("keyup",function(n){_(e);let s=c();return C(s.inputEvent(n,!0))}),a()}if(i&2){let e=c();d("disabled",e.disabled)}}function Te(i,o){i&1&&E(0)}function De(i,o){if(i&1&&(l(0,"span",12),h(1,Te,1,0,"ng-container",13),a()),i&2){let e=c(2),t=T(6);O("ui-select-allow-clear",e.allowClear&&e.active),r(),d("ngTemplateOutlet",e.customTemplateSelect||t)("ngTemplateOutletContext",K(4,we,e.active))}}function Fe(i,o){if(i&1&&(l(0,"span",9),u(1),a()),i&2){let e=c(2);r(),y(e.placeholder)}}function Ge(i,o){if(i&1){let e=b();l(0,"button",14),m("click",function(n){_(e);let s=c(2);return C(s.removeClick(s.active,n))}),a()}}function Ve(i,o){if(i&1){let e=b();l(0,"div",4)(1,"span",7),m("click",function(n){_(e);let s=c();return C(s.matchClick(n))}),h(2,De,2,6,"span",8)(3,Fe,2,1,"span",9)(4,Ge,1,0,"button",10),g(5,"i",11),a()()}if(i&2){let e=c();r(2),f(e.active?2:3),r(2),f(e.allowClear&&e.active?4:-1)}}function Ae(i,o){i&1&&E(0)}function He(i,o){if(i&1){let e=b();l(0,"li",15)(1,"div",16),m("click",function(n){let s=_(e).$implicit,p=c(2);return C(p.selectMatch(s,n))})("mouseenter",function(){let n=_(e).$implicit,s=c(2);return C(s.selectActive(n))}),h(2,Ae,1,0,"ng-container",13),a()()}if(i&2){let e=o.$implicit,t=c(2),n=T(8);r(),O("active",t.isActive(e)),r(),d("ngTemplateOutlet",t.customTemplateOptions||n)("ngTemplateOutletContext",X(4,Pe,e,t.inputValue))}}function je(i,o){if(i&1&&(l(0,"ul",5),B(1,He,3,7,"li",15,q),a()),i&2){let e=c();r(),Q(e.options)}}function Ie(i,o){if(i&1&&(l(0,"div",17)(1,"span",18),g(2,"fa-icon",19),a(),l(3,"span"),u(4),a(),l(5,"div",20),u(6),a()()),i&2){let e=o.active,t=c();r(2),d("icon",t.itemIcon)("fixedWidth",!1),r(2),y(e.name),r(2),y(e.description)}}function ze(i,o){if(i&1&&(l(0,"a",21)(1,"div",17)(2,"span",18),g(3,"fa-icon",19),a(),g(4,"span",22),V(5,"highlight"),g(6,"span",23),V(7,"highlight"),a()()),i&2){let e=o.i,t=o.o,n=c();r(3),d("icon",n.itemIcon)("fixedWidth",!1),r(),d("innerHtml",n.sanitize(A(5,4,t.name,e)),P),r(2),d("innerHtml",n.sanitize(A(7,7,t.description,e)),P)}}var vt=(()=>{class i{constructor(e,t){this.sanitizer=t,this.itemIcon=ae,this.allowClear=!0,this.placeholder="",this.idField="id",this.nameField="name",this.descriptionField="description",this.data=new v,this.selected=new v,this.removed=new v,this.typed=new v,this.opened=new v,this._items=[],this._optionsOpened=!1,this._disabled=!1,this._active=null,this.options=[],this.itemObjects=[],this.inputMode=!1,this.inputValue="",this.onChange=Function.prototype,this.onTouched=Function.prototype,this.element=e,this.clickedOutside=this.clickedOutside.bind(this)}get optionsOpened(){return this._optionsOpened}set optionsOpened(e){this._optionsOpened=e,this.opened.emit(e)}set items(e){if(!e.length){this._items=this.itemObjects=[],this.itemObjects=[];return}this._items=e.filter(t=>{if(typeof t=="string"||typeof t=="object"&&t&&t[this.nameField]&&t[this.idField])return t}),this.itemObjects=this._items.map(t=>typeof t=="string"?new k(t):new k({id:t[this.idField],name:t[this.nameField],description:t[this.descriptionField]}))}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._disabled===!0&&this.hideOptions()}get active(){return this._active}set active(e){e?this._active=typeof e=="string"?e:new k({id:e[this.idField],name:e[this.nameField],description:e[this.descriptionField]}):this._active=null}sanitize(e){return this.sanitizer.bypassSecurityTrustHtml(e)}inputEvent(e,t=!1){if(e.keyCode===9)return;if(t&&(e.keyCode===37||e.keyCode===39||e.keyCode===38||e.keyCode===40||e.keyCode===13)){e.preventDefault();return}if(!t&&e.keyCode===8){let s=this.element.nativeElement.querySelector("div.ui-select-container > input");(!s.value||s.value.length<=0)&&(this.active&&this.remove(this.active),e.preventDefault())}if(!t&&e.keyCode===27){this.hideOptions(),e.preventDefault();return}if(!t&&e.keyCode===46&&(this.active&&this.remove(this.active),e.preventDefault()),!t&&e.keyCode===37&&this._items.length>0){this.behavior.first(),e.preventDefault();return}if(!t&&e.keyCode===39&&this._items.length>0){this.behavior.last(),e.preventDefault();return}if(!t&&e.keyCode===38){this.behavior.prev(),e.preventDefault();return}if(!t&&e.keyCode===40){this.behavior.next(),e.preventDefault();return}if(!t&&e.keyCode===13){(!this.active||this.active.id!==this.activeOption.id)&&(this.selectActiveMatch(),this.behavior.next()),e.preventDefault();return}let n=e.target||e.srcElement;n?(this.inputValue=n.value,this.doEvent("typed",this.inputValue||" ")):this.open()}ngOnInit(){this.subscription=this.typed.asObservable().pipe(z(200),N()).subscribe(e=>this.doSearch(e)),this.behavior=new I(this),this.doEvent("typed"," ")}ngOnDestroy(){this.subscription.unsubscribe()}doSearch(e){this.searchFunction(e).subscribe({next:t=>{this.items=t},error:t=>{console.error(t),this.items=[]},complete:()=>this.behavior.filter()})}remove(e){this._disabled!==!0&&(this.active=null,this.data.next(this.active),this.doEvent("removed",e),this.inputValue="",this.doEvent("typed"," "))}doEvent(e,t){this[e]&&t&&this[e].next(t),this.onTouched(),(e==="selected"||e==="removed")&&this.onChange(this.active)}clickedOutside(){this.inputMode=!1,this.optionsOpened=!1}writeValue(e){this.active=e,this.data.emit(this.active)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}matchClick(e){this._disabled!==!0&&(this.inputMode=!this.inputMode,this.inputMode===!0&&(this.focusToInput(),this.open()))}mainClick(e){if(this.inputMode===!0||this._disabled===!0)return;if(e.keyCode===46){e.preventDefault(),this.inputEvent(e);return}if(e.keyCode===8){e.preventDefault(),this.inputEvent(e,!0);return}if(e.keyCode===9||e.keyCode===13||e.keyCode===27||e.keyCode>=37&&e.keyCode<=40){e.preventDefault();return}this.inputMode=!0;let t=String.fromCharCode(96<=e.keyCode&&e.keyCode<=105?e.keyCode-48:e.keyCode).toLowerCase();this.focusToInput(t),this.open();let n=e.target||e.srcElement;n.value=t,this.inputEvent(e)}selectActive(e){this.activeOption=e}isActive(e){return this.activeOption.id===e.id}removeClick(e,t){t.stopPropagation(),this.remove(e)}focusToInput(e=""){setTimeout(()=>{let t=this.element.nativeElement.querySelector("div.ui-select-container > input");t&&(t.focus(),t.value=e)},0)}selectMatch(e,t=void 0){t&&(t.stopPropagation(),t.preventDefault()),!(this.options.length<=0)&&(this.active=e,this.data.next(this.active),this.doEvent("selected",e),this.hideOptions(),this.focusToInput(e.name),this.element.nativeElement.querySelector(".ui-select-container").focus())}open(){this.options=this.itemObjects,this.options.length>0&&this.behavior.first(),this.optionsOpened=!0}hideOptions(){this.inputMode=!1,this.optionsOpened=!1}selectActiveMatch(){this.selectMatch(this.activeOption)}static{this.\u0275fac=function(t){return new(t||i)(x(R),x($))}}static{this.\u0275cmp=M({type:i,selectors:[["app-select"]],inputs:{searchFunction:"searchFunction",customTemplateOptions:"customTemplateOptions",customTemplateSelect:"customTemplateSelect",itemIcon:"itemIcon",allowClear:"allowClear",placeholder:"placeholder",idField:"idField",nameField:"nameField",descriptionField:"descriptionField",disabled:"disabled",active:"active"},outputs:{data:"data",selected:"selected",removed:"removed",typed:"typed",opened:"opened"},features:[J([{provide:Y,useExisting:L(()=>i),multi:!0}])],decls:9,vars:5,consts:[["DefaultSelect",""],["DefaultOptions",""],[1,"ui-select-container","dropdown","open",3,"keyup","offClick"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"disabled"],[1,"ui-select-match","form-control","form-control-sm"],["role","menu",1,"ui-select-choices","dropdown-menu"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"keydown","keyup","disabled"],["tabindex","-1",1,"ui-select-toggle","no-select",2,"outline","0",3,"click"],[1,"ui-select-match-text","w-100",3,"ui-select-allow-clear"],[1,"ui-select-placeholder"],["aria-label","close","type","button",1,"btn-close"],[1,"dropdown-toggle"],[1,"ui-select-match-text","w-100"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["aria-label","close","type","button",1,"btn-close",3,"click"],["role","menuitem"],[1,"ui-select-choices-row",3,"click","mouseenter"],[1,"d-flex","align-items-center"],[1,"ui-icon","circle-primary-icon","me-2"],[3,"icon","fixedWidth"],[1,"d-flex","ms-auto","me-4","fs-xxxs","text-muted"],["href","javascript:void(0)",1,"dropdown-item","cursor-pointer",2,"padding","3px 5px"],[3,"innerHtml"],[1,"d-flex","ms-auto","fs-xxxs","text-muted",3,"innerHtml"]],template:function(t,n){if(t&1){let s=b();l(0,"div",2),m("keyup",function(S){return _(s),C(n.mainClick(S))}),g(1,"div"),h(2,Ee,1,1,"input",3)(3,Ve,6,2,"div",4)(4,je,3,0,"ul",5),a(),h(5,Ie,7,4,"ng-template",null,0,H)(7,ze,8,10,"ng-template",null,1,H)}t&2&&(d("offClick",n.clickedOutside),r(),O("ui-disabled",n.disabled),r(),f(n.inputMode?2:3),r(2),f(n.optionsOpened&&n.options&&n.options.length>0?4:-1))},dependencies:[Ce,ge,w,Z],styles:[`.ui-select-container[_ngcontent-%COMP%]{background-color:transparent;border-radius:4px}.ui-select-container.open[_ngcontent-%COMP%] > .dropdown-menu[_ngcontent-%COMP%]{display:block}.ui-select-container.open[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{outline:none}.ui-select-container[_ngcontent-%COMP%] .ui-icon[_ngcontent-%COMP%]{min-width:26px;min-height:26px;font-size:.85rem}.ui-select-container[_ngcontent-%COMP%] .ui-disabled[_ngcontent-%COMP%]{background-color:#d4dbe8;border-radius:4px;position:absolute;width:100%;height:100%;z-index:5;opacity:.6;top:0;left:0;cursor:not-allowed}.ui-select-container[_ngcontent-%COMP%] .ui-select-search[_ngcontent-%COMP%]{line-height:26px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%]{padding-left:.3rem}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{text-align:start!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{position:absolute;top:45%;right:15px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{font-size:1.6em;line-height:.75}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%]{display:flex;align-items:center}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%] > .caret[_ngcontent-%COMP%]{position:absolute;height:10px;top:50%;right:10px;margin-top:-2px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-placeholder[_ngcontent-%COMP%]{float:left;line-height:26px;color:#8c8c8c;width:100%}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]{cursor:pointer}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%]{width:100%;height:auto;max-height:200px;overflow-x:hidden;margin-top:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{display:block;padding:3px 5px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;outline:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{pointer-events:none}
|
|
1
|
+
import{f as fe,g as ge}from"./chunk-ZYB4TLJM.js";import{f as he}from"./chunk-X6UFHF4Q.js";import{Ia as de,Sb as me,tb as j,xb as ue}from"./chunk-7FVU676A.js";import{Ab as E,Bb as b,Bc as Z,Bd as se,Ce as ae,Dd as w,Eb as m,Fb as c,Gf as pe,J as z,La as P,Me as le,N,Pb as T,Qb as u,Rb as y,Sa as r,Ub as D,Vb as F,Vc as $,Wb as G,Wc as Y,Xa as x,Xb as J,Yc as ee,Zb as K,_b as X,_d as re,_e as ce,ab as M,ad as te,ba as L,bc as V,cb as W,dc as A,fb as h,fc as H,fd as ie,lb as d,nb as O,pa as _,pb as U,qa as C,rb as f,sb as q,sd as ne,tb as B,td as oe,ub as Q,vb as l,wa as v,wb as a,xb as g,za as R}from"./chunk-FPEGN42P.js";var ve=function(i){return i[i.USER=0]="USER",i[i.PERSONAL=1]="PERSONAL",i}(ve||{}),xe=function(i){return i[i.VISIBLE=0]="VISIBLE",i[i.PRIVATE=1]="PRIVATE",i[i.ISOLATED=2]="ISOLATED",i}(xe||{});function Oe(i,o){if(i&1&&(l(0,"span"),u(1),a()),i&2){let e=c();r(),y(e.group.name)}}function be(i,o){i&1&&(l(0,"span",3),u(1,"New personal group"),a())}function ye(i,o){if(i&1&&g(0,"fa-icon",4),i&2){let e=c();d("icon",e.icons.faSpinner)}}function ke(i,o){i&1&&(l(0,"span",3),u(1,"Edit personal group"),a())}function Se(i,o){i&1&&(l(0,"span",3),u(1,"Edit group"),a())}function Me(i,o){if(i&1&&(l(0,"h4",5),h(1,ke,2,0,"span",3)(2,Se,2,0,"span",3),a()),i&2){let e=c();r(),f(e.isPersonalGroup?1:2)}}var it=(()=>{class i{constructor(e,t){this.layout=e,this.userService=t,this.groupChange=new v,this.user=this.userService.user,this.icons={GROUPS:ue.GROUPS,faSpinner:pe,faCog:ce,faUsers:re,faPen:le},this.isPersonalGroup=!0,this.submitted=!1,this.loading=!1}ngOnInit(){this.originalGroup?.id?(this.isPersonalGroup=this.originalGroup.isPersonalGroup,this.group=new j({id:this.originalGroup.id,name:this.originalGroup.name,description:this.originalGroup.description,createdAt:this.originalGroup.createdAt,modifiedAt:this.originalGroup.modifiedAt,type:this.originalGroup.type})):this.group=new j({id:0,name:"",description:"",createdAt:null,modifiedAt:null,type:de.PGROUP})}onCancel(){this.layout.closeDialog()}onSubmit(){if(this.loading=!0,this.submitted=!0,this.group.id===0)this.userService.createPersonalGroup(this.makeDto(!0)).subscribe({next:e=>{this.loading=!1,this.groupChange.emit(["add",e]),this.layout.sendNotification("success","Group created",e.name),this.layout.closeDialog()},error:e=>this.onError(e)});else{let e=this.makeDto();if(!Object.keys(e).length){this.loading=!1,this.submitted=!1;return}this.userService.updatePersonalGroup(this.originalGroup.id,this.makeDto()).subscribe({next:t=>{this.loading=!1,this.groupChange.emit(["update",t]),this.layout.sendNotification("success","Group updated",t.name),this.layout.closeDialog()},error:t=>this.onError(t)})}}makeDto(e=!1){return{name:e?this.group.name:this.group.name!==this.originalGroup.name?this.group.name:void 0,description:e?this.group.description:this.group.description!==this.originalGroup.description?this.group.description:void 0}}onError(e){this.layout.sendNotification("error","Group error",this.group.name,e),this.submitted=!1,this.loading=!1}static{this.\u0275fac=function(t){return new(t||i)(x(me),x(he))}}static{this.\u0275cmp=M({type:i,selectors:[["app-user-group-dialog"]],inputs:{originalGroup:"originalGroup"},outputs:{groupChange:"groupChange"},decls:23,vars:15,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","disabled","autoSelect","ngModel"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","disabled"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,n){t&1&&(l(0,"div",0)(1,"h4",1),g(2,"fa-icon",2),h(3,Oe,2,1,"span")(4,be,2,0,"span",3)(5,ye,1,1,"fa-icon",4),a(),h(6,Me,3,1,"h4",5),l(7,"button",6),m("click",function(){return n.layout.closeDialog()}),a()(),l(8,"div",7)(9,"div",8)(10,"div",9)(11,"label",10),u(12,"Name"),a(),l(13,"input",11),G("ngModelChange",function(p){return F(n.group.name,p)||(n.group.name=p),p}),a()(),l(14,"div",12)(15,"label",13),u(16,"Description"),a(),l(17,"input",14),G("ngModelChange",function(p){return F(n.group.description,p)||(n.group.description=p),p}),a()()()(),l(18,"div",15)(19,"button",16),m("click",function(){return n.onCancel()}),u(20,"Cancel"),a(),l(21,"button",17),m("click",function(){return n.onSubmit()}),u(22," Confirm "),a()()),t&2&&(r(2),d("icon",n.icons.GROUPS),r(),f(n.group.id?3:4),r(2),f(n.loading?5:-1),r(),f(n.group.id?6:-1),r(),U("btn-close btn-close-white ",n.group.id?"ms-2":"ms-auto"," ms-2"),r(6),O("is-invalid",!n.group.name),d("disabled",!n.isPersonalGroup)("autoSelect",!1),D("ngModel",n.group.name),r(4),D("ngModel",n.group.description),d("disabled",!n.isPersonalGroup),r(4),d("disabled",!n.group.name||n.submitted))},dependencies:[oe,ee,te,ne,ie,w,se,fe],encapsulation:2})}}return i})();var Ce=(()=>{class i{onClick(e){e.stopPropagation()}ngOnInit(){setTimeout(()=>{typeof document<"u"&&document.addEventListener("click",this.offClickHandler)},0)}ngOnDestroy(){typeof document<"u"&&document.removeEventListener("click",this.offClickHandler)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=W({type:i,selectors:[["","offClick",""]],hostBindings:function(t,n){t&1&&m("click",function(p){return n.onClick(p)})},inputs:{offClickHandler:[0,"offClick","offClickHandler"]}})}}return i})();var k=class{constructor(o){typeof o=="string"&&(this.id=this.name=o,this.description=""),typeof o=="object"&&(this.id=o.id||o.name,this.name=o.name,this.description=o.description||"")}};var we=i=>({active:i}),Pe=(i,o)=>({o:i,i:o});function Ee(i,o){if(i&1){let e=b();l(0,"input",6),m("keydown",function(n){_(e);let s=c();return C(s.inputEvent(n))})("keyup",function(n){_(e);let s=c();return C(s.inputEvent(n,!0))}),a()}if(i&2){let e=c();d("disabled",e.disabled)}}function Te(i,o){i&1&&E(0)}function De(i,o){if(i&1&&(l(0,"span",12),h(1,Te,1,0,"ng-container",13),a()),i&2){let e=c(2),t=T(6);O("ui-select-allow-clear",e.allowClear&&e.active),r(),d("ngTemplateOutlet",e.customTemplateSelect||t)("ngTemplateOutletContext",K(4,we,e.active))}}function Fe(i,o){if(i&1&&(l(0,"span",9),u(1),a()),i&2){let e=c(2);r(),y(e.placeholder)}}function Ge(i,o){if(i&1){let e=b();l(0,"button",14),m("click",function(n){_(e);let s=c(2);return C(s.removeClick(s.active,n))}),a()}}function Ve(i,o){if(i&1){let e=b();l(0,"div",4)(1,"span",7),m("click",function(n){_(e);let s=c();return C(s.matchClick(n))}),h(2,De,2,6,"span",8)(3,Fe,2,1,"span",9)(4,Ge,1,0,"button",10),g(5,"i",11),a()()}if(i&2){let e=c();r(2),f(e.active?2:3),r(2),f(e.allowClear&&e.active?4:-1)}}function Ae(i,o){i&1&&E(0)}function He(i,o){if(i&1){let e=b();l(0,"li",15)(1,"div",16),m("click",function(n){let s=_(e).$implicit,p=c(2);return C(p.selectMatch(s,n))})("mouseenter",function(){let n=_(e).$implicit,s=c(2);return C(s.selectActive(n))}),h(2,Ae,1,0,"ng-container",13),a()()}if(i&2){let e=o.$implicit,t=c(2),n=T(8);r(),O("active",t.isActive(e)),r(),d("ngTemplateOutlet",t.customTemplateOptions||n)("ngTemplateOutletContext",X(4,Pe,e,t.inputValue))}}function je(i,o){if(i&1&&(l(0,"ul",5),B(1,He,3,7,"li",15,q),a()),i&2){let e=c();r(),Q(e.options)}}function Ie(i,o){if(i&1&&(l(0,"div",17)(1,"span",18),g(2,"fa-icon",19),a(),l(3,"span"),u(4),a(),l(5,"div",20),u(6),a()()),i&2){let e=o.active,t=c();r(2),d("icon",t.itemIcon)("fixedWidth",!1),r(2),y(e.name),r(2),y(e.description)}}function ze(i,o){if(i&1&&(l(0,"a",21)(1,"div",17)(2,"span",18),g(3,"fa-icon",19),a(),g(4,"span",22),V(5,"highlight"),g(6,"span",23),V(7,"highlight"),a()()),i&2){let e=o.i,t=o.o,n=c();r(3),d("icon",n.itemIcon)("fixedWidth",!1),r(),d("innerHtml",n.sanitize(A(5,4,t.name,e)),P),r(2),d("innerHtml",n.sanitize(A(7,7,t.description,e)),P)}}var vt=(()=>{class i{constructor(e,t){this.sanitizer=t,this.itemIcon=ae,this.allowClear=!0,this.placeholder="",this.idField="id",this.nameField="name",this.descriptionField="description",this.data=new v,this.selected=new v,this.removed=new v,this.typed=new v,this.opened=new v,this._items=[],this._optionsOpened=!1,this._disabled=!1,this._active=null,this.options=[],this.itemObjects=[],this.inputMode=!1,this.inputValue="",this.onChange=Function.prototype,this.onTouched=Function.prototype,this.element=e,this.clickedOutside=this.clickedOutside.bind(this)}get optionsOpened(){return this._optionsOpened}set optionsOpened(e){this._optionsOpened=e,this.opened.emit(e)}set items(e){if(!e.length){this._items=this.itemObjects=[],this.itemObjects=[];return}this._items=e.filter(t=>{if(typeof t=="string"||typeof t=="object"&&t&&t[this.nameField]&&t[this.idField])return t}),this.itemObjects=this._items.map(t=>typeof t=="string"?new k(t):new k({id:t[this.idField],name:t[this.nameField],description:t[this.descriptionField]}))}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._disabled===!0&&this.hideOptions()}get active(){return this._active}set active(e){e?this._active=typeof e=="string"?e:new k({id:e[this.idField],name:e[this.nameField],description:e[this.descriptionField]}):this._active=null}sanitize(e){return this.sanitizer.bypassSecurityTrustHtml(e)}inputEvent(e,t=!1){if(e.keyCode===9)return;if(t&&(e.keyCode===37||e.keyCode===39||e.keyCode===38||e.keyCode===40||e.keyCode===13)){e.preventDefault();return}if(!t&&e.keyCode===8){let s=this.element.nativeElement.querySelector("div.ui-select-container > input");(!s.value||s.value.length<=0)&&(this.active&&this.remove(this.active),e.preventDefault())}if(!t&&e.keyCode===27){this.hideOptions(),e.preventDefault();return}if(!t&&e.keyCode===46&&(this.active&&this.remove(this.active),e.preventDefault()),!t&&e.keyCode===37&&this._items.length>0){this.behavior.first(),e.preventDefault();return}if(!t&&e.keyCode===39&&this._items.length>0){this.behavior.last(),e.preventDefault();return}if(!t&&e.keyCode===38){this.behavior.prev(),e.preventDefault();return}if(!t&&e.keyCode===40){this.behavior.next(),e.preventDefault();return}if(!t&&e.keyCode===13){(!this.active||this.active.id!==this.activeOption.id)&&(this.selectActiveMatch(),this.behavior.next()),e.preventDefault();return}let n=e.target||e.srcElement;n?(this.inputValue=n.value,this.doEvent("typed",this.inputValue||" ")):this.open()}ngOnInit(){this.subscription=this.typed.asObservable().pipe(z(200),N()).subscribe(e=>this.doSearch(e)),this.behavior=new I(this),this.doEvent("typed"," ")}ngOnDestroy(){this.subscription.unsubscribe()}doSearch(e){this.searchFunction(e).subscribe({next:t=>{this.items=t},error:t=>{console.error(t),this.items=[]},complete:()=>this.behavior.filter()})}remove(e){this._disabled!==!0&&(this.active=null,this.data.next(this.active),this.doEvent("removed",e),this.inputValue="",this.doEvent("typed"," "))}doEvent(e,t){this[e]&&t&&this[e].next(t),this.onTouched(),(e==="selected"||e==="removed")&&this.onChange(this.active)}clickedOutside(){this.inputMode=!1,this.optionsOpened=!1}writeValue(e){this.active=e,this.data.emit(this.active)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}matchClick(e){this._disabled!==!0&&(this.inputMode=!this.inputMode,this.inputMode===!0&&(this.focusToInput(),this.open()))}mainClick(e){if(this.inputMode===!0||this._disabled===!0)return;if(e.keyCode===46){e.preventDefault(),this.inputEvent(e);return}if(e.keyCode===8){e.preventDefault(),this.inputEvent(e,!0);return}if(e.keyCode===9||e.keyCode===13||e.keyCode===27||e.keyCode>=37&&e.keyCode<=40){e.preventDefault();return}this.inputMode=!0;let t=String.fromCharCode(96<=e.keyCode&&e.keyCode<=105?e.keyCode-48:e.keyCode).toLowerCase();this.focusToInput(t),this.open();let n=e.target||e.srcElement;n.value=t,this.inputEvent(e)}selectActive(e){this.activeOption=e}isActive(e){return this.activeOption.id===e.id}removeClick(e,t){t.stopPropagation(),this.remove(e)}focusToInput(e=""){setTimeout(()=>{let t=this.element.nativeElement.querySelector("div.ui-select-container > input");t&&(t.focus(),t.value=e)},0)}selectMatch(e,t=void 0){t&&(t.stopPropagation(),t.preventDefault()),!(this.options.length<=0)&&(this.active=e,this.data.next(this.active),this.doEvent("selected",e),this.hideOptions(),this.focusToInput(e.name),this.element.nativeElement.querySelector(".ui-select-container").focus())}open(){this.options=this.itemObjects,this.options.length>0&&this.behavior.first(),this.optionsOpened=!0}hideOptions(){this.inputMode=!1,this.optionsOpened=!1}selectActiveMatch(){this.selectMatch(this.activeOption)}static{this.\u0275fac=function(t){return new(t||i)(x(R),x($))}}static{this.\u0275cmp=M({type:i,selectors:[["app-select"]],inputs:{searchFunction:"searchFunction",customTemplateOptions:"customTemplateOptions",customTemplateSelect:"customTemplateSelect",itemIcon:"itemIcon",allowClear:"allowClear",placeholder:"placeholder",idField:"idField",nameField:"nameField",descriptionField:"descriptionField",disabled:"disabled",active:"active"},outputs:{data:"data",selected:"selected",removed:"removed",typed:"typed",opened:"opened"},features:[J([{provide:Y,useExisting:L(()=>i),multi:!0}])],decls:9,vars:5,consts:[["DefaultSelect",""],["DefaultOptions",""],[1,"ui-select-container","dropdown","open",3,"keyup","offClick"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"disabled"],[1,"ui-select-match","form-control","form-control-sm"],["role","menu",1,"ui-select-choices","dropdown-menu"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"keydown","keyup","disabled"],["tabindex","-1",1,"ui-select-toggle","no-select",2,"outline","0",3,"click"],[1,"ui-select-match-text","w-100",3,"ui-select-allow-clear"],[1,"ui-select-placeholder"],["aria-label","close","type","button",1,"btn-close"],[1,"dropdown-toggle"],[1,"ui-select-match-text","w-100"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["aria-label","close","type","button",1,"btn-close",3,"click"],["role","menuitem"],[1,"ui-select-choices-row",3,"click","mouseenter"],[1,"d-flex","align-items-center"],[1,"ui-icon","circle-primary-icon","me-2"],[3,"icon","fixedWidth"],[1,"d-flex","ms-auto","me-4","fs-xxxs","text-muted"],["href","javascript:void(0)",1,"dropdown-item","cursor-pointer",2,"padding","3px 5px"],[3,"innerHtml"],[1,"d-flex","ms-auto","fs-xxxs","text-muted",3,"innerHtml"]],template:function(t,n){if(t&1){let s=b();l(0,"div",2),m("keyup",function(S){return _(s),C(n.mainClick(S))}),g(1,"div"),h(2,Ee,1,1,"input",3)(3,Ve,6,2,"div",4)(4,je,3,0,"ul",5),a(),h(5,Ie,7,4,"ng-template",null,0,H)(7,ze,8,10,"ng-template",null,1,H)}t&2&&(d("offClick",n.clickedOutside),r(),O("ui-disabled",n.disabled),r(),f(n.inputMode?2:3),r(2),f(n.optionsOpened&&n.options&&n.options.length>0?4:-1))},dependencies:[Ce,ge,w,Z],styles:[`.ui-select-container[_ngcontent-%COMP%]{background-color:transparent;border-radius:4px}.ui-select-container.open[_ngcontent-%COMP%] > .dropdown-menu[_ngcontent-%COMP%]{display:block}.ui-select-container.open[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{outline:none}.ui-select-container[_ngcontent-%COMP%] .ui-icon[_ngcontent-%COMP%]{min-width:26px;min-height:26px;font-size:.85rem}.ui-select-container[_ngcontent-%COMP%] .ui-disabled[_ngcontent-%COMP%]{background-color:#d4dbe8;border-radius:4px;position:absolute;width:100%;height:100%;z-index:5;opacity:.6;top:0;left:0;cursor:not-allowed}.ui-select-container[_ngcontent-%COMP%] .ui-select-search[_ngcontent-%COMP%]{line-height:26px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%]{padding-left:.3rem}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{text-align:start!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{position:absolute;top:45%;right:15px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{font-size:1.6em;line-height:.75}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%]{display:flex;align-items:center}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%] > .caret[_ngcontent-%COMP%]{position:absolute;height:10px;top:50%;right:10px;margin-top:-2px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-placeholder[_ngcontent-%COMP%]{float:left;line-height:26px;color:#8c8c8c;width:100%}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]{cursor:pointer}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%]{width:100%;height:auto;max-height:200px;overflow-x:hidden;margin-top:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{display:block;padding:3px 5px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;outline:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{pointer-events:none}
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ya as J,ab as K}from"./chunk-
|
|
1
|
+
import{Ya as J,ab as K}from"./chunk-7FVU676A.js";import{$d as H,Ad as W,Bb as y,Bd as j,Dd as z,Eb as f,Fb as b,Le as U,Mb as L,Nb as S,Ob as T,Pb as P,Qb as I,Sa as n,Tf as Z,Ub as V,Vb as D,Wb as F,Xa as E,Yc as B,ab as g,ad as O,bc as R,dc as q,fb as _,fd as N,lb as w,mb as d,nb as k,oa as v,pa as c,pd as A,qa as u,rb as C,sd as G,td as x,ud as Q,vb as r,wa as M,wb as l,xb as m}from"./chunk-FPEGN42P.js";var ie=["Password"];function ne(i,X){i&1&&(r(0,"label",1),I(1,"Password"),l())}function se(i,X){if(i&1){let o=y();r(0,"div",5),f("click",function(){c(o);let t=b();return u(t.randomPassword())}),r(1,"span"),m(2,"fa-icon",6),l()()}if(i&2){let o=b();n(2),w("icon",o.icons.faDice)}}var Ce=(()=>{class i{constructor(o){this.locale=o,this.passwordChange=new M,this.passwordMinLength=8,this.showGenerator=!1,this.showLabel=!1,this.disabled=!1,this.isRequired=!1,this.focus=!1,this.toggleVisiblePassword=K,this.icons={faEye:U,faEyeSlash:H,faDice:Z}}ngOnInit(){this.focus&&setTimeout(()=>{this.passwordElement.nativeElement.focus(),this.passwordElement.nativeElement.select()},0)}randomPassword(){this.disabled||this.passwordChange.emit(J(this.passwordMinLength+2))}static{this.\u0275fac=function(e){return new(e||i)(E(Q))}}static{this.\u0275cmp=g({type:i,selectors:[["app-input-password"]],viewQuery:function(e,t){if(e&1&&L(ie,7),e&2){let s;S(s=T())&&(t.passwordElement=s.first)}},inputs:{password:"password",passwordMinLength:"passwordMinLength",placeholder:"placeholder",showGenerator:"showGenerator",showLabel:"showLabel",disabled:"disabled",isRequired:"isRequired",focus:"focus"},outputs:{passwordChange:"passwordChange"},decls:9,vars:12,consts:[["Password",""],["for","password","l10nTranslate",""],["id","password",1,"input-group","input-group-sm",2,"min-width","150px"],["autocomplete","off","type","password",1,"form-control","form-control-sm",3,"ngModelChange","keyup","ngModel","disabled","placeholder","required"],[1,"input-group-text","cursor-pointer"],[1,"input-group-text","cursor-pointer",3,"click"],[3,"icon"]],template:function(e,t){if(e&1){let s=y();_(0,ne,2,0,"label",1),r(1,"div",2)(2,"input",3,0),R(4,"translate"),F("ngModelChange",function(a){return c(s),D(t.password,a)||(t.password=a),u(a)}),f("keyup",function(){return c(s),u(t.passwordChange.emit(t.password))}),l(),_(5,se,3,1,"div",4),r(6,"div",5),f("click",function(){c(s);let a=P(3);return u(t.toggleVisiblePassword(a))}),r(7,"span"),m(8,"fa-icon",6),l()()()}if(e&2){let s=P(3);C(t.showLabel?0:-1),n(2),k("is-invalid",t.isRequired&&(t.password==null?null:t.password.length)<t.passwordMinLength),V("ngModel",t.password),w("disabled",t.disabled)("placeholder",q(4,9,t.placeholder,t.locale.language))("required",t.isRequired),n(3),C(t.showGenerator?5:-1),n(3),w("icon",s.type==="text"?t.icons.faEye:t.icons.faEyeSlash)}},dependencies:[G,B,O,A,N,x,W,z,j],encapsulation:2})}}return i})();var be=(()=>{class i{constructor(){this.passwordToCheck="",this.bar0="",this.bar1="",this.bar2="",this.bar3="",this.bar4="",this.colors=["#F00","#F90","#FF0","#7ACC00","#06854B"]}static measureStrength(o){let e=0,t=/[$-/:-?{-~!"^_`[\]]/g,s=/[a-z]+/.test(o),h=/[A-Z]+/.test(o),a=/[0-9]+/.test(o),Y=t.test(o),$=[s,h,a,Y],p=0;for(let ee of $)p+=ee===!0?1:0;return e+=2*o.length+(o.length>=10?1:0),e+=p*10,e=o.length<=6?Math.min(e,10):e,e=p===1?Math.min(e,10):e,e=p===2?Math.min(e,20):e,e=p===3?Math.min(e,40):e,e}ngOnChanges(o){let e=o.passwordToCheck.currentValue;if(this.setBarColors(5,"#DDD"),e){let t=this.getColor(i.measureStrength(e));this.setBarColors(t.idx,t.col)}}getColor(o){let e=Math.min(Math.floor((o-1)/10),4);return{idx:e+1,col:this.colors[e]}}setBarColors(o,e){for(let t=0;t<o;t++)this[`bar${t}`]=e}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=g({type:i,selectors:[["app-password-strength-bar"]],inputs:{passwordToCheck:"passwordToCheck"},features:[v],decls:8,vars:10,consts:[["strength",""],["id","strength"],["id","strengthBar"],[1,"point"]],template:function(e,t){e&1&&(r(0,"div",1,0)(2,"ul",2),m(3,"li",3)(4,"li",3)(5,"li",3)(6,"li",3)(7,"li",3),l()()),e&2&&(n(3),d("background-color",t.bar0),n(),d("background-color",t.bar1),n(),d("background-color",t.bar2),n(),d("background-color",t.bar3),n(),d("background-color",t.bar4))},styles:["ul#strengthBar[_ngcontent-%COMP%]{display:flex;list-style:none;padding:0;align-self:center;margin-bottom:-2px}.point[_ngcontent-%COMP%]:last-child{margin:0!important}.point[_ngcontent-%COMP%]{background:#ddd;border-radius:2px;height:6px;margin-right:1px;width:20px}"],changeDetection:0})}}return i})();export{Ce as a,be as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as H,m as v,s as D,t as _}from"./chunk-HDDBV3QQ.js";import{E as y,Eb as w,Gb as j,Hb as N,Ta as M,Wa as p,Xa as n,Xb as B,Ya as m,Zb as L,ab as k,bb as I,ca as f,cb as u,da as b,kb as O,kc as C,lb as A,nb as g,vb as S,vc as E,wa as c,wb as R,za as l}from"./chunk-FPEGN42P.js";var T=["*"],U=t=>({dropdown:t}),P=(()=>{class t{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=f({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),h=(()=>{class t{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new c,this.isDisabledChange=new c,this.toggleClick=new c,this.counts=0,this.dropdownMenu=new Promise(e=>{this.resolveDropdownMenu=e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=f({token:t,factory:t.\u0275fac,providedIn:"platform"})}}return t})(),V="220ms cubic-bezier(0, 0, 0.2, 1)",F=[v({height:0,overflow:"hidden"}),H(V,v({height:"*",overflow:"hidden"}))],K=(()=>{class t{get direction(){return this._state.direction}constructor(e,i,s,r,d){this._state=e,this.cd=i,this._renderer=s,this._element=r,this.isOpen=!1,this._factoryDropDownAnimation=d.build(F),this._subscription=e.isOpenChange.subscribe(a=>{this.isOpen=a;let o=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),o&&(this._renderer.addClass(o,"show"),(o.classList.contains("dropdown-menu-right")||o.classList.contains("dropdown-menu-end"))&&(this._renderer.setStyle(o,"left","auto"),this._renderer.setStyle(o,"right","0")),this.direction==="up"&&(this._renderer.setStyle(o,"top","auto"),this._renderer.setStyle(o,"transform","translateY(-101%)"))),o&&this._state.isAnimated&&this._factoryDropDownAnimation.create(o).play(),this.cd.markForCheck(),this.cd.detectChanges()})}_contains(e){return this._element.nativeElement.contains(e)}ngOnDestroy(){this._subscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(n(h),n(C),n(p),n(l),n(D))}}static{this.\u0275cmp=k({type:t,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:T,decls:2,vars:9,consts:[[3,"ngClass"]],template:function(i,s){i&1&&(j(),S(0,"div",0),N(1),R()),i&2&&(g("dropup",s.direction==="up")("show",s.isOpen)("open",s.isOpen),A("ngClass",L(7,U,s.direction==="down")))},dependencies:[E],encapsulation:2,changeDetection:0})}}return t})(),q=(()=>{class t{set autoClose(e){this._state.autoClose=e}get autoClose(){return this._state.autoClose}set isAnimated(e){this._state.isAnimated=e}get isAnimated(){return this._state.isAnimated}set insideClick(e){this._state.insideClick=e}get insideClick(){return this._state.insideClick}set isDisabled(e){this._isDisabled=e,this._state.isDisabledChange.emit(e),e&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(e){e?this.show():this.hide()}get _showInline(){return!this.container}constructor(e,i,s,r,d,a,o){this._elementRef=e,this._renderer=i,this._viewContainerRef=s,this._cis=r,this._state=d,this._config=a,this.dropup=!1,this._isInlineOpen=!1,this._isDisabled=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._state.stopOnClickPropagation=this._config.stopOnClickPropagation,this._factoryDropDownAnimation=o.build(F),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:h,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(e=>this.toggle(e))),this._subscriptions.push(this._state.isDisabledChange.pipe(y(e=>e)).subscribe(()=>this.hide())))}show(){if(!(this.isOpen||this.isDisabled)){if(this._showInline){this._inlinedMenu||this._state.dropdownMenu.then(e=>{this._dropdown.attachInline(e.viewContainer,e.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._inlinedMenu&&this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),this.playAnimation();return}this._state.dropdownMenu.then(e=>{let i=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=i?"up":"down";let s=this.placement||(i?"top start":"bottom start");this._dropdown.attach(K).to(this.container).position({attachment:s}).show({content:e.templateRef,placement:s}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){this.isOpen&&(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(e){return this.isOpen||!e?this.hide():this.show()}_contains(e){return this._elementRef.nativeElement.contains(e.target)||this._dropdown.instance&&this._dropdown.instance._contains(e.target)}navigationClick(e){let i=this._elementRef.nativeElement.querySelector(".dropdown-menu");if(!i)return;let s=this._elementRef.nativeElement.ownerDocument.activeElement,r=i.querySelectorAll(".dropdown-item");switch(e.keyCode){case 38:this._state.counts>0&&r[--this._state.counts].focus();break;case 40:this._state.counts+1<r.length&&(s.classList!==r[this._state.counts].classList?r[this._state.counts].focus():r[++this._state.counts].focus());break;default:}e.preventDefault()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles()}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._inlinedMenu&&this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){let e=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right")||this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-end");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",e?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",e?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}static{this.\u0275fac=function(i){return new(i||t)(n(l),n(p),n(m),n(_),n(h),n(P),n(D))}}static{this.\u0275dir=u({type:t,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(i,s){i&1&&w("keydown.arrowDown",function(d){return s.navigationClick(d)})("keydown.arrowUp",function(d){return s.navigationClick(d)}),i&2&&g("dropup",s.dropup)("open",s.isOpen)("show",s.isOpen)},inputs:{placement:"placement",triggers:"triggers",container:"container",dropup:"dropup",autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",onShown:"onShown",onHidden:"onHidden"},exportAs:["bs-dropdown"],features:[B([h,_,P])]})}}return t})(),de=(()=>{class t{constructor(e,i,s){e.resolveDropdownMenu({templateRef:s,viewContainer:i})}static{this.\u0275fac=function(i){return new(i||t)(n(h),n(m),n(M))}}static{this.\u0275dir=u({type:t,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]})}}return t})(),ae=(()=>{class t{constructor(e,i,s,r,d){this._changeDetectorRef=e,this._dropdown=i,this._element=s,this._renderer=r,this._state=d,this.isOpen=!1,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(a=>{this.isOpen=a,a?(this._documentClickListener=this._renderer.listen("document","click",o=>{this._state.autoClose&&o.button!==2&&!this._element.nativeElement.contains(o.target)&&!(this._state.insideClick&&this._dropdown._contains(o))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(a=>this.isDisabled=a||void 0))}onClick(e){this._state.stopOnClickPropagation&&e.stopPropagation(),!this.isDisabled&&this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(let e of this._subscriptions)e.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(n(C),n(q),n(l),n(p),n(h))}}static{this.\u0275dir=u({type:t,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(i,s){i&1&&w("click",function(d){return s.onClick(d)}),i&2&&O("aria-haspopup",!0)("disabled",s.isDisabled)("aria-expanded",s.isOpen)},exportAs:["bs-dropdown-toggle"]})}}return t})(),he=(()=>{class t{static forRoot(){return{ngModule:t,providers:[]}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=I({type:t})}static{this.\u0275inj=b({})}}return t})();export{q as a,de as b,ae as c,he as d};
|
|
1
|
+
import{k as H,m as v,s as D,t as _}from"./chunk-7FVU676A.js";import{E as y,Eb as w,Gb as j,Hb as N,Ta as M,Wa as p,Xa as n,Xb as B,Ya as m,Zb as L,ab as k,bb as I,ca as f,cb as u,da as b,kb as O,kc as C,lb as A,nb as g,vb as S,vc as E,wa as c,wb as R,za as l}from"./chunk-FPEGN42P.js";var T=["*"],U=t=>({dropdown:t}),P=(()=>{class t{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=f({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),h=(()=>{class t{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new c,this.isDisabledChange=new c,this.toggleClick=new c,this.counts=0,this.dropdownMenu=new Promise(e=>{this.resolveDropdownMenu=e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=f({token:t,factory:t.\u0275fac,providedIn:"platform"})}}return t})(),V="220ms cubic-bezier(0, 0, 0.2, 1)",F=[v({height:0,overflow:"hidden"}),H(V,v({height:"*",overflow:"hidden"}))],K=(()=>{class t{get direction(){return this._state.direction}constructor(e,i,s,r,d){this._state=e,this.cd=i,this._renderer=s,this._element=r,this.isOpen=!1,this._factoryDropDownAnimation=d.build(F),this._subscription=e.isOpenChange.subscribe(a=>{this.isOpen=a;let o=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),o&&(this._renderer.addClass(o,"show"),(o.classList.contains("dropdown-menu-right")||o.classList.contains("dropdown-menu-end"))&&(this._renderer.setStyle(o,"left","auto"),this._renderer.setStyle(o,"right","0")),this.direction==="up"&&(this._renderer.setStyle(o,"top","auto"),this._renderer.setStyle(o,"transform","translateY(-101%)"))),o&&this._state.isAnimated&&this._factoryDropDownAnimation.create(o).play(),this.cd.markForCheck(),this.cd.detectChanges()})}_contains(e){return this._element.nativeElement.contains(e)}ngOnDestroy(){this._subscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(n(h),n(C),n(p),n(l),n(D))}}static{this.\u0275cmp=k({type:t,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:T,decls:2,vars:9,consts:[[3,"ngClass"]],template:function(i,s){i&1&&(j(),S(0,"div",0),N(1),R()),i&2&&(g("dropup",s.direction==="up")("show",s.isOpen)("open",s.isOpen),A("ngClass",L(7,U,s.direction==="down")))},dependencies:[E],encapsulation:2,changeDetection:0})}}return t})(),q=(()=>{class t{set autoClose(e){this._state.autoClose=e}get autoClose(){return this._state.autoClose}set isAnimated(e){this._state.isAnimated=e}get isAnimated(){return this._state.isAnimated}set insideClick(e){this._state.insideClick=e}get insideClick(){return this._state.insideClick}set isDisabled(e){this._isDisabled=e,this._state.isDisabledChange.emit(e),e&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(e){e?this.show():this.hide()}get _showInline(){return!this.container}constructor(e,i,s,r,d,a,o){this._elementRef=e,this._renderer=i,this._viewContainerRef=s,this._cis=r,this._state=d,this._config=a,this.dropup=!1,this._isInlineOpen=!1,this._isDisabled=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._state.stopOnClickPropagation=this._config.stopOnClickPropagation,this._factoryDropDownAnimation=o.build(F),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:h,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(e=>this.toggle(e))),this._subscriptions.push(this._state.isDisabledChange.pipe(y(e=>e)).subscribe(()=>this.hide())))}show(){if(!(this.isOpen||this.isDisabled)){if(this._showInline){this._inlinedMenu||this._state.dropdownMenu.then(e=>{this._dropdown.attachInline(e.viewContainer,e.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._inlinedMenu&&this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),this.playAnimation();return}this._state.dropdownMenu.then(e=>{let i=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=i?"up":"down";let s=this.placement||(i?"top start":"bottom start");this._dropdown.attach(K).to(this.container).position({attachment:s}).show({content:e.templateRef,placement:s}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){this.isOpen&&(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(e){return this.isOpen||!e?this.hide():this.show()}_contains(e){return this._elementRef.nativeElement.contains(e.target)||this._dropdown.instance&&this._dropdown.instance._contains(e.target)}navigationClick(e){let i=this._elementRef.nativeElement.querySelector(".dropdown-menu");if(!i)return;let s=this._elementRef.nativeElement.ownerDocument.activeElement,r=i.querySelectorAll(".dropdown-item");switch(e.keyCode){case 38:this._state.counts>0&&r[--this._state.counts].focus();break;case 40:this._state.counts+1<r.length&&(s.classList!==r[this._state.counts].classList?r[this._state.counts].focus():r[++this._state.counts].focus());break;default:}e.preventDefault()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles()}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._inlinedMenu&&this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){let e=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right")||this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-end");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",e?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",e?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}static{this.\u0275fac=function(i){return new(i||t)(n(l),n(p),n(m),n(_),n(h),n(P),n(D))}}static{this.\u0275dir=u({type:t,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(i,s){i&1&&w("keydown.arrowDown",function(d){return s.navigationClick(d)})("keydown.arrowUp",function(d){return s.navigationClick(d)}),i&2&&g("dropup",s.dropup)("open",s.isOpen)("show",s.isOpen)},inputs:{placement:"placement",triggers:"triggers",container:"container",dropup:"dropup",autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",onShown:"onShown",onHidden:"onHidden"},exportAs:["bs-dropdown"],features:[B([h,_,P])]})}}return t})(),de=(()=>{class t{constructor(e,i,s){e.resolveDropdownMenu({templateRef:s,viewContainer:i})}static{this.\u0275fac=function(i){return new(i||t)(n(h),n(m),n(M))}}static{this.\u0275dir=u({type:t,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]})}}return t})(),ae=(()=>{class t{constructor(e,i,s,r,d){this._changeDetectorRef=e,this._dropdown=i,this._element=s,this._renderer=r,this._state=d,this.isOpen=!1,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(a=>{this.isOpen=a,a?(this._documentClickListener=this._renderer.listen("document","click",o=>{this._state.autoClose&&o.button!==2&&!this._element.nativeElement.contains(o.target)&&!(this._state.insideClick&&this._dropdown._contains(o))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(a=>this.isDisabled=a||void 0))}onClick(e){this._state.stopOnClickPropagation&&e.stopPropagation(),!this.isDisabled&&this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(let e of this._subscriptions)e.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(n(C),n(q),n(l),n(p),n(h))}}static{this.\u0275dir=u({type:t,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(i,s){i&1&&w("click",function(d){return s.onClick(d)}),i&2&&O("aria-haspopup",!0)("disabled",s.isDisabled)("aria-expanded",s.isOpen)},exportAs:["bs-dropdown-toggle"]})}}return t})(),he=(()=>{class t{static forRoot(){return{ngModule:t,providers:[]}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=I({type:t})}static{this.\u0275inj=b({})}}return t})();export{q as a,de as b,ae as c,he as d};
|