marketplacepos 5.43.7 → 5.43.9
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/Marketplace/{chunk-Z5NWWPJP.js → chunk-2ITJ4DPG.js} +4 -4
- package/Marketplace/{chunk-VJNZ5THR.js → chunk-2UCPBIOZ.js} +1 -1
- package/Marketplace/{chunk-TSPQ2LFF.js → chunk-37ZTEPCA.js} +1 -1
- package/Marketplace/{chunk-YHKEECJR.js → chunk-3B2PNJWF.js} +1 -1
- package/Marketplace/{chunk-SUJBRB2D.js → chunk-3FDTU6XX.js} +1 -1
- package/Marketplace/{chunk-RM3KYX7K.js → chunk-476VORY6.js} +1 -1
- package/Marketplace/{chunk-UYLU3G52.js → chunk-4QFQSMCD.js} +1 -1
- package/Marketplace/{chunk-UDIDZKN6.js → chunk-5BSS4CVK.js} +1 -1
- package/Marketplace/{chunk-XC7L6C26.js → chunk-5LMIOXNX.js} +1 -1
- package/Marketplace/chunk-7PN4XLNE.js +1 -0
- package/Marketplace/{chunk-R45ORDIE.js → chunk-7TZVISSD.js} +1 -1
- package/Marketplace/{chunk-LZYW24WA.js → chunk-BRI2WDZ5.js} +1 -1
- package/Marketplace/{chunk-HFBAUQ7H.js → chunk-DMU3IXDC.js} +1 -1
- package/Marketplace/{chunk-DO2UECCT.js → chunk-DPE3IM5A.js} +1 -1
- package/Marketplace/{chunk-BQVXVM7F.js → chunk-EOZ2J2CF.js} +2 -2
- package/Marketplace/{chunk-FO2QLLKW.js → chunk-EY2JCLRQ.js} +2 -2
- package/Marketplace/{chunk-AOFDSBOE.js → chunk-GFJ2PTHZ.js} +1 -1
- package/Marketplace/{chunk-DEJVMFIS.js → chunk-GH57P6KF.js} +1 -1
- package/Marketplace/{chunk-UDZIOJVC.js → chunk-GVULJZIG.js} +1 -1
- package/Marketplace/chunk-GZZULDDB.js +1 -0
- package/Marketplace/{chunk-KG47DFP5.js → chunk-H22ULYCV.js} +1 -1
- package/Marketplace/{chunk-5FJUX7W5.js → chunk-IA7AHP7C.js} +2 -2
- package/Marketplace/{chunk-KFNKVXCN.js → chunk-IVHM5DMM.js} +1 -1
- package/Marketplace/{chunk-3NP5TQOW.js → chunk-IYDKWIZE.js} +1 -1
- package/Marketplace/{chunk-KJATJWWX.js → chunk-KEUKEBMY.js} +1 -1
- package/Marketplace/{chunk-FYBG3KWC.js → chunk-KWDFFHTV.js} +1 -1
- package/Marketplace/{chunk-3IO4ZF34.js → chunk-LE4MX5H2.js} +1 -1
- package/Marketplace/{chunk-QWJECSZK.js → chunk-LKUIHFXN.js} +1 -1
- package/Marketplace/{chunk-BCH2MADE.js → chunk-MQY7U3MF.js} +1 -1
- package/Marketplace/{chunk-KMZPNPJF.js → chunk-MTSGSFEV.js} +1 -1
- package/Marketplace/{chunk-FHQTKJXS.js → chunk-NEENWUEW.js} +1 -1
- package/Marketplace/{chunk-6ZVXICIH.js → chunk-O7GJ2IQZ.js} +1 -1
- package/Marketplace/{chunk-MCOWAYNM.js → chunk-ONMIDN4J.js} +1 -1
- package/Marketplace/{chunk-J6UZFGNY.js → chunk-OPYL4IAL.js} +1 -1
- package/Marketplace/{chunk-EHU3RPGU.js → chunk-PDJ2XCYS.js} +1 -1
- package/Marketplace/{chunk-AEJ5I5MW.js → chunk-Q7P5KBPH.js} +2 -2
- package/Marketplace/{chunk-JJ6HE6R7.js → chunk-QS4VZEY6.js} +1 -1
- package/Marketplace/chunk-RMR3C4TT.js +1 -0
- package/Marketplace/{chunk-EBVE2XHU.js → chunk-RWOAVYTX.js} +1 -1
- package/Marketplace/{chunk-WUUXAXFO.js → chunk-STACT5DW.js} +1 -1
- package/Marketplace/{chunk-JX6HFP2Y.js → chunk-TBA2O4W7.js} +1 -1
- package/Marketplace/chunk-TEKUG5ZU.js +1 -0
- package/Marketplace/{chunk-ZJVWTRCI.js → chunk-U23XMVSL.js} +1 -1
- package/Marketplace/{chunk-Q23GGWWT.js → chunk-UCA5RNCO.js} +1 -1
- package/Marketplace/{chunk-5DIRXS7I.js → chunk-UMP6ZMEJ.js} +1 -1
- package/Marketplace/{chunk-TXVG5OHR.js → chunk-VUTDYXBC.js} +1 -1
- package/Marketplace/{chunk-6NGH2YZQ.js → chunk-WAWTQ57P.js} +1 -1
- package/Marketplace/chunk-WIAQQWWF.js +1 -0
- package/Marketplace/chunk-WUF2BP4O.js +1 -0
- package/Marketplace/{chunk-TAA75BNT.js → chunk-XBUZ27V4.js} +1 -1
- package/Marketplace/{chunk-O7FDRTJ2.js → chunk-XQM5PYIP.js} +1 -1
- package/Marketplace/chunk-YQEJLTF7.js +1 -0
- package/Marketplace/{chunk-SSAGHA7U.js → chunk-Z6AT4GBY.js} +1 -1
- package/Marketplace/{chunk-5DG3HADY.js → chunk-ZUEJZI4O.js} +1 -1
- package/Marketplace/chunk-ZZKMIPQN.js +1 -0
- package/Marketplace/{chunk-UMA5ZNXQ.js → chunk-ZZS2X4HD.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-4LOUTBLN.js → main-553UOJOV.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-3BYIWPKX.js +0 -1
- package/Marketplace/chunk-A4BNLR77.js +0 -1
- package/Marketplace/chunk-ESX7MIMG.js +0 -1
- package/Marketplace/chunk-FWG7M5IP.js +0 -1
- package/Marketplace/chunk-GJUPDABG.js +0 -1
- package/Marketplace/chunk-HYJVHRMN.js +0 -1
- package/Marketplace/chunk-LLDNDJ7P.js +0 -1
- package/Marketplace/chunk-YJHI5U5R.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as M,c as P}from"./chunk-SWQXSJ7O.js";import{s as k}from"./chunk-YCH6HHU3.js";import{H as y,I as S,J as E,g as N,n as I}from"./chunk-M2FCTYGU.js";import{Fc as b,Gb as x,Gc as d,Hb as g,Ic as v,Mb as l,Yb as a,cd as C,ec as c,gc as p,hc as f,ic as r,jc as s,ka as T,lc as u,mc as _,rb as n,uc as m}from"./chunk-B7KTCPKC.js";function L(e,i){if(e&1&&(u(0),r(1,"li",4)(2,"a",5),d(3),s()(),_()),e&2){let t=m().$implicit;n(2),a("routerLink",t.Url)("title",t.Description?t.Description:""),n(),v(" ",t.Title," ")}}function O(e,i){if(e&1&&l(0,L,4,3,"ng-container",3),e&2){let t=i.$implicit;a("ngxPermissionsOnly",t.Permissions)}}function R(e,i){if(e&1&&(u(0),p(1,O,1,1,"ng-container",null,c),_()),e&2){let t=m();n(),f(t.Tabs)}}function F(e,i){if(e&1&&(r(0,"li",4)(1,"a",5),d(2),s()()),e&2){let t=i.$implicit;n(),a("routerLink",t.Url)("title",t.Description?t.Description:""),n(),v(" ",t.Title," ")}}function w(e,i){if(e&1&&p(0,F,3,3,"li",4,c),e&2){let t=m();f(t.Tabs)}}var H=(()=>{class e{constructor(){this.usePermissions=!1}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=x({type:e,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs",usePermissions:"usePermissions"},standalone:!1,decls:4,vars:2,consts:[["NOT_USE_PERMISSIONS",""],[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],[4,"ngIf","ngIfElse"],[4,"ngxPermissionsOnly"],["routerLinkActive","active",1,"nav-item","me-6"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink","title"]],template:function(o,D){if(o&1&&(r(0,"ul",1),l(1,R,3,0,"ng-container",2)(2,w,2,0,"ng-template",null,0,C),s()),o&2){let h=b(3);n(),a("ngIf",D.usePermissions)("ngIfElse",h)}},dependencies:[N,y,S,M],encapsulation:2})}}return e})(),J=(()=>{class e{static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275mod=g({type:e})}static{this.\u0275inj=T({imports:[I,E,k,P]})}}return e})();export{H as a,J as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-GFJ2PTHZ.js";import{a as s,b as l}from"./chunk-7PN4XLNE.js";import"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as c,J as d}from"./chunk-M2FCTYGU.js";import{Gb as a,Yb as i,ic as p,jc as m,kc as n,rb as r}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class t{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=a({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,v){e&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),m()()(),n(4,"router-outlet")),e&2&&(r(3),i("Tabs",v.tabs))},dependencies:[l,s,d,c],encapsulation:2})}}return t})(),g=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-MQY7U3MF.js").then(t=>t.OrderApiComponent)},canActivate:[o],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-2UCPBIOZ.js").then(t=>t.ProductApiComponent)},canActivate:[o],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-VUTDYXBC.js").then(t=>t.EscrowApiComponent)},canActivate:[o],data:{title:"Escrow API"}}]}];export{f as JsonApiComponent,g as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as M}from"./chunk-7AQ244V7.js";import{a as Ve,b as Te}from"./chunk-RMCAWPWK.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as U}from"./chunk-UDIDZKN6.js";import"./chunk-M5XGP4SG.js";import{a as be,b as Fe}from"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as ve}from"./chunk-SSAGHA7U.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import{a as ye}from"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as se}from"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{h as he}from"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Ce,b as ue,d as xe,e as fe}from"./chunk-5JVEEL2T.js";import{c as pe}from"./chunk-PW42BQIY.js";import{b as de,c as ge}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as _e,e as me}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Pe,l as Se,m as Ie,n as we}from"./chunk-CLER2MX6.js";import{A as ce,b as ie,c as oe,h as ae,m as re,o as le}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-M2FCTYGU.js";import{$c as y,Fc as H,G as W,Gb as z,Gc as d,Hc as R,Ic as b,Kc as I,Lc as w,Mb as h,Mc as v,Qc as J,Sc as T,Yb as m,Z as A,ad as F,bd as Z,cd as Q,dc as P,ea as $,ec as N,gc as k,hc as L,ic as a,jc as c,kc as S,lc as G,mc as q,oc as x,pa as j,pb as V,rb as l,tc as C,uc as r,xb as u,xc as K,ya as p,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var B=i=>[i],Re=i=>({"text-decoration-line-through":i}),Ue=i=>({"bg-gradient-warning":i});function Be(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=x();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=x();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=x();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=x();a(0,"input",49),v("ngModelChange",function(t){p(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,B,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=x();G(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function qe(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function Ke(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,qe,2,1,"small",48),c()),i&2){let e=H(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),R(n.Name),l(),P(n.Category?10:-1)}}function He(i,s){if(i&1){let e=x();a(0,"input",54),v("ngModelChange",function(t){p(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,He,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),y(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=x();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,f=r();return _(f.openTableDialog(t,o,g))}),d(1),y(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=x();a(0,"tr",33),h(1,Ke,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),R(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,B,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Ue,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function nt(i,s){if(i&1){let e=x();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),v("ngModelChange",function(t){p(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),y(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),y(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,B,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=x();a(0,"mainpanel",2),v("textChange",function(t){p(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Be,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),y(16,"async"),h(17,nt,30,18,"content",9),y(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,f,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=f,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(f=>pe.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),f=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${f}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Pe),u(ve),u(ye),u(M),u(he),u(Se),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([U,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),y(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,fe,xe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
|
|
1
|
+
import{a as M}from"./chunk-7AQ244V7.js";import{a as Ve,b as Te}from"./chunk-RMCAWPWK.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as U}from"./chunk-5BSS4CVK.js";import"./chunk-M5XGP4SG.js";import{a as be,b as Fe}from"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as ve}from"./chunk-Z6AT4GBY.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import{a as ye}from"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as se}from"./chunk-UMP6ZMEJ.js";import"./chunk-CMTBBXR5.js";import{h as he}from"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Ce,b as ue,d as xe,e as fe}from"./chunk-5JVEEL2T.js";import{c as pe}from"./chunk-PW42BQIY.js";import{b as de,c as ge}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as _e,e as me}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Pe,l as Se,m as Ie,n as we}from"./chunk-CLER2MX6.js";import{A as ce,b as ie,c as oe,h as ae,m as re,o as le}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-M2FCTYGU.js";import{$c as y,Fc as H,G as W,Gb as z,Gc as d,Hc as R,Ic as b,Kc as I,Lc as w,Mb as h,Mc as v,Qc as J,Sc as T,Yb as m,Z as A,ad as F,bd as Z,cd as Q,dc as P,ea as $,ec as N,gc as k,hc as L,ic as a,jc as c,kc as S,lc as G,mc as q,oc as x,pa as j,pb as V,rb as l,tc as C,uc as r,xb as u,xc as K,ya as p,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var B=i=>[i],Re=i=>({"text-decoration-line-through":i}),Ue=i=>({"bg-gradient-warning":i});function Be(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=x();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=x();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=x();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=x();a(0,"input",49),v("ngModelChange",function(t){p(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,B,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=x();G(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function qe(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function Ke(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,qe,2,1,"small",48),c()),i&2){let e=H(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),R(n.Name),l(),P(n.Category?10:-1)}}function He(i,s){if(i&1){let e=x();a(0,"input",54),v("ngModelChange",function(t){p(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,He,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),y(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=x();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,f=r();return _(f.openTableDialog(t,o,g))}),d(1),y(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=x();a(0,"tr",33),h(1,Ke,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),R(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,B,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Ue,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function nt(i,s){if(i&1){let e=x();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),v("ngModelChange",function(t){p(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),y(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),y(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,B,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=x();a(0,"mainpanel",2),v("textChange",function(t){p(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Be,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),y(16,"async"),h(17,nt,30,18,"content",9),y(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,f,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=f,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(f=>pe.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),f=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${f}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Pe),u(ve),u(ye),u(M),u(he),u(Se),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([U,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),y(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,fe,xe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as he}from"./chunk-JX6HFP2Y.js";import{a as pe}from"./chunk-3NMM37H7.js";import"./chunk-BFU7VKO3.js";import{a as de}from"./chunk-SRVGUGY2.js";import{a as D}from"./chunk-XHAXYWZ7.js";import{c as me,d as R}from"./chunk-UDIDZKN6.js";import"./chunk-M5XGP4SG.js";import"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import{a as ce}from"./chunk-SSAGHA7U.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-5KS4WK6H.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as ee}from"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-CMTBBXR5.js";import{h as w}from"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{c as C}from"./chunk-PW42BQIY.js";import{b as ie,c as ae}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as te,e as ne}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as oe,l as re,m as le,n as se}from"./chunk-CLER2MX6.js";import{A as Z,c as K,h as q,m as X,o as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as $,j as Q,n as J}from"./chunk-M2FCTYGU.js";import{$c as I,G as U,Gb as A,Gc as v,Kc as T,Lc as E,Mb as u,Mc as x,Qc as H,Ra as M,Sc as z,Yb as h,ad as y,ea as k,ic as s,ja as j,jc as p,kc as G,lc as N,mc as F,nc as W,oc as L,pa as S,rb as c,tc as g,uc as m,xb as d,ya as b,za as P}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as V,b as B}from"./chunk-66YHNWRR.js";var O=(()=>{class o{constructor(){this.authService=S(w),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(r=>{a=e.find(l=>l.ID==r?.parent?.id),a&&(a=B(V({},a),{Name:`${r?.parent?.label} - ${r?.label}`,LocationID:r?.id}),n.push(a))}),i.forEach(r=>{a=e.find(l=>l.ID==r.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(r=>r.id),n=t.filter(r=>C.IsNotEmpty(r?.parent?.id)).map(r=>r?.parent?.id).filter((r,l,_)=>_.indexOf(r)===l)):(e=[],n=[]),a=i.map(r=>r.id),a=a.concat(n).filter((r,l,_)=>_.indexOf(r)===l),{locationIds:e,channelIds:a}}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275prov=j({token:o,factory:o.\u0275fac})}}return o})();var ge=o=>[o];function Ce(o,f){if(o&1){let t=L();s(0,"button",16),g("click",function(){b(t);let e=m(2).ngIf,n=m();return P(n.onUpdateItems(e))}),G(1,"i",17),v(2," Update "),p()}}function fe(o,f){if(o&1&&(N(0),u(1,Ce,3,0,"button",15),F()),o&2){let t=m().ngIf,i=m();c(),h("ngIf",i.productService.hasSelectionVariant(t))}}function _e(o,f){if(o&1&&(s(0,"actions")(1,"div",13),u(2,fe,2,1,"ng-container",14),p()()),o&2){let t=m();c(2),h("ngxPermissionsOnly",z(1,ge,t.inventoryUpdateRole))}}function Se(o,f){o&1&&W(0)}function ve(o,f){if(o&1){let t=L();N(0),s(1,"app-table",18),g("onToggle",function(e){b(t);let n=m();return P(n.onShowDifferenceStock(e))})("onSubmit",function(e){b(t);let n=m();return P(n.updateStockByVariant(e))}),p(),F()}if(o&2){let t=f.ngIf,i=m();c(),h("data",t)("channel",i.channels())("showProductToggle",!0)("hiddenIPOSInventory",i.searchFilter.HiddenIPOSInventory)}}var et=(()=>{class o{constructor(t,i,e,n,a,r){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=r,this.paginationService=S(R),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=M([]),this.selectedChannels=M([]),this.channels=M([]),this.inventoryUpdateRole=ee.InventoryUpdate,this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>C.isValidGUID(n.id)==!1),e=t.filter(n=>C.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(l=>{l.Channel?.forEach(_=>{n.push({ID:l.ID,Code:l.Code,Inventory:l.Inventory,LocationID:_.LocationID})})});let r={ListChannelID:i.filter(l=>l.selected).map(l=>l.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",r).subscribe(l=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+r.List.length+" variants in "+r.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(pe,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(U(n=>C.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}static{this.\u0275fac=function(i){return new(i||o)(d(ne),d(te),d(oe),d(ce),d(w),d(re))}}static{this.\u0275cmp=A({type:o,selectors:[["app-multi-channel-comparison"]],features:[H([R,O])],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(s(0,"mainpanel",0),g("onSubmit",function(a){return e.onSearch(a)}),u(1,_e,3,3,"actions",1),I(2,"async"),s(3,"filters"),u(4,Se,1,0,"ng-container",1),I(5,"async"),s(6,"div")(7,"label",2),v(8,"Channel"),p(),s(9,"multiwarehouse-tree-select",3),g("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),s(10,"div",4)(11,"label",5),v(12,"PageNumber"),p(),s(13,"input",6),x("ngModelChange",function(a){return E(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),s(14,"div",4)(15,"label",7),v(16,"Page Size"),p(),s(17,"input",8),x("ngModelChange",function(a){return E(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),s(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),u(22,ve,2,4,"ng-container",1),I(23,"async"),s(24,"infinite-paginator",12),I(25,"async"),g("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(h("pageData",e.pageData)("hideSearchBox",!1),c(),h("ngIf",y(2,14,e.paginationService.data$)),c(3),h("ngIf",y(5,16,e.loader$)),c(5),h("multiple",!0),c(4),T("ngModel",e.searchFilter.PageNumber),c(4),T("ngModel",e.searchFilter.RowCount),c(5),h("ngIf",y(23,18,e.paginationService.data$)),c(2),h("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[J,$,Q,se,le,he,Z,K,Y,q,X,me,de,ae,ie],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return o})();export{et as MultiChannelComparison};
|
|
1
|
+
import{a as he}from"./chunk-TBA2O4W7.js";import{a as pe}from"./chunk-3NMM37H7.js";import"./chunk-BFU7VKO3.js";import{a as de}from"./chunk-SRVGUGY2.js";import{a as D}from"./chunk-XHAXYWZ7.js";import{c as me,d as R}from"./chunk-5BSS4CVK.js";import"./chunk-M5XGP4SG.js";import"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import{a as ce}from"./chunk-Z6AT4GBY.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-5KS4WK6H.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as ee}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-CMTBBXR5.js";import{h as w}from"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{c as C}from"./chunk-PW42BQIY.js";import{b as ie,c as ae}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as te,e as ne}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as oe,l as re,m as le,n as se}from"./chunk-CLER2MX6.js";import{A as Z,c as K,h as q,m as X,o as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as $,j as Q,n as J}from"./chunk-M2FCTYGU.js";import{$c as I,G as U,Gb as A,Gc as v,Kc as T,Lc as E,Mb as u,Mc as x,Qc as H,Ra as M,Sc as z,Yb as h,ad as y,ea as k,ic as s,ja as j,jc as p,kc as G,lc as N,mc as F,nc as W,oc as L,pa as S,rb as c,tc as g,uc as m,xb as d,ya as b,za as P}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as V,b as B}from"./chunk-66YHNWRR.js";var O=(()=>{class o{constructor(){this.authService=S(w),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(r=>{a=e.find(l=>l.ID==r?.parent?.id),a&&(a=B(V({},a),{Name:`${r?.parent?.label} - ${r?.label}`,LocationID:r?.id}),n.push(a))}),i.forEach(r=>{a=e.find(l=>l.ID==r.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(r=>r.id),n=t.filter(r=>C.IsNotEmpty(r?.parent?.id)).map(r=>r?.parent?.id).filter((r,l,_)=>_.indexOf(r)===l)):(e=[],n=[]),a=i.map(r=>r.id),a=a.concat(n).filter((r,l,_)=>_.indexOf(r)===l),{locationIds:e,channelIds:a}}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275prov=j({token:o,factory:o.\u0275fac})}}return o})();var ge=o=>[o];function Ce(o,f){if(o&1){let t=L();s(0,"button",16),g("click",function(){b(t);let e=m(2).ngIf,n=m();return P(n.onUpdateItems(e))}),G(1,"i",17),v(2," Update "),p()}}function fe(o,f){if(o&1&&(N(0),u(1,Ce,3,0,"button",15),F()),o&2){let t=m().ngIf,i=m();c(),h("ngIf",i.productService.hasSelectionVariant(t))}}function _e(o,f){if(o&1&&(s(0,"actions")(1,"div",13),u(2,fe,2,1,"ng-container",14),p()()),o&2){let t=m();c(2),h("ngxPermissionsOnly",z(1,ge,t.inventoryUpdateRole))}}function Se(o,f){o&1&&W(0)}function ve(o,f){if(o&1){let t=L();N(0),s(1,"app-table",18),g("onToggle",function(e){b(t);let n=m();return P(n.onShowDifferenceStock(e))})("onSubmit",function(e){b(t);let n=m();return P(n.updateStockByVariant(e))}),p(),F()}if(o&2){let t=f.ngIf,i=m();c(),h("data",t)("channel",i.channels())("showProductToggle",!0)("hiddenIPOSInventory",i.searchFilter.HiddenIPOSInventory)}}var et=(()=>{class o{constructor(t,i,e,n,a,r){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=r,this.paginationService=S(R),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=M([]),this.selectedChannels=M([]),this.channels=M([]),this.inventoryUpdateRole=ee.InventoryUpdate,this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>C.isValidGUID(n.id)==!1),e=t.filter(n=>C.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(l=>{l.Channel?.forEach(_=>{n.push({ID:l.ID,Code:l.Code,Inventory:l.Inventory,LocationID:_.LocationID})})});let r={ListChannelID:i.filter(l=>l.selected).map(l=>l.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",r).subscribe(l=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+r.List.length+" variants in "+r.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(pe,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(U(n=>C.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}static{this.\u0275fac=function(i){return new(i||o)(d(ne),d(te),d(oe),d(ce),d(w),d(re))}}static{this.\u0275cmp=A({type:o,selectors:[["app-multi-channel-comparison"]],features:[H([R,O])],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(s(0,"mainpanel",0),g("onSubmit",function(a){return e.onSearch(a)}),u(1,_e,3,3,"actions",1),I(2,"async"),s(3,"filters"),u(4,Se,1,0,"ng-container",1),I(5,"async"),s(6,"div")(7,"label",2),v(8,"Channel"),p(),s(9,"multiwarehouse-tree-select",3),g("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),s(10,"div",4)(11,"label",5),v(12,"PageNumber"),p(),s(13,"input",6),x("ngModelChange",function(a){return E(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),s(14,"div",4)(15,"label",7),v(16,"Page Size"),p(),s(17,"input",8),x("ngModelChange",function(a){return E(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),s(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),u(22,ve,2,4,"ng-container",1),I(23,"async"),s(24,"infinite-paginator",12),I(25,"async"),g("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(h("pageData",e.pageData)("hideSearchBox",!1),c(),h("ngIf",y(2,14,e.paginationService.data$)),c(3),h("ngIf",y(5,16,e.loader$)),c(5),h("multiple",!0),c(4),T("ngModel",e.searchFilter.PageNumber),c(4),T("ngModel",e.searchFilter.RowCount),c(5),h("ngIf",y(23,18,e.paginationService.data$)),c(2),h("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[J,$,Q,se,le,he,Z,K,Y,q,X,me,de,ae,ie],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return o})();export{et as MultiChannelComparison};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-EPVCMYCI.js";import{a as le,b as re}from"./chunk-6FY74YFQ.js";import"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{b as ae}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import{h as X}from"./chunk-
|
|
1
|
+
import{a as oe}from"./chunk-EPVCMYCI.js";import{a as le,b as re}from"./chunk-6FY74YFQ.js";import"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{b as ae}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import{h as X}from"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-5JVEEL2T.js";import{c as K}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as Q}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as ne,n as ie}from"./chunk-CLER2MX6.js";import{A as G,h as H,m as U}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as V,k as J,l as W,n as k}from"./chunk-M2FCTYGU.js";import{$c as m,Gb as P,Gc as p,Hc as C,Ic as y,Kc as j,Lc as O,Mb as u,Mc as q,Qc as z,Yb as d,Z as M,aa as D,ad as c,bd as A,dc as R,ec as B,g as L,gc as T,hc as $,ic as i,ja as w,jc as a,kc as f,oc as F,pa as g,pb as S,rb as l,tc as v,uc as x,v as I,ya as E,za as N}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as we}from"./chunk-EZY2ATQQ.js";import{a as bt}from"./chunk-AJL3CYNX.js";import{a as ft}from"./chunk-WUHNNJ2C.js";import{a as _t}from"./chunk-IA6KOBDJ.js";import{a as ht,c as mt,d as gt}from"./chunk-SB7NWPDS.js";import{a as yt}from"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import{a as ae}from"./chunk-
|
|
1
|
+
import{a as we}from"./chunk-EZY2ATQQ.js";import{a as bt}from"./chunk-AJL3CYNX.js";import{a as ft}from"./chunk-WUHNNJ2C.js";import{a as _t}from"./chunk-IA6KOBDJ.js";import{a as ht,c as mt,d as gt}from"./chunk-SB7NWPDS.js";import{a as yt}from"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import{a as ae}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import{a as Ce}from"./chunk-ECRWEMEV.js";import{M as ce,O as C,P as M,Q as Oe,S as ve,W as ct,Y as lt,ba as rt,f as tt,fa as pt,ia as dt,ja as U,k as it,ka as ut,n as nt,q as ot,r as se,w as at,z as st}from"./chunk-LZCEM2PC.js";import"./chunk-5HO2IJ47.js";import{a as Xe,b as Je,c as Ye}from"./chunk-SWQXSJ7O.js";import{b as je}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Ze,n as et}from"./chunk-CLER2MX6.js";import{A as Ue,a as qe,b as ze,h as Qe,m as We}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{H as Ne,J as He,d as _e,f as Ke,g as ye,h as Re,i as be,j as Ae,m as Be,n as W}from"./chunk-M2FCTYGU.js";import{$b as Ee,$c as ne,Ac as B,Bc as O,Ca as ke,Cc as v,Fc as te,Gb as A,Gc as g,Hb as Me,Hc as R,Ic as $,Ka as w,Kb as pe,Kc as N,Lc as H,Mb as m,Mc as q,Nc as ue,Oc as Pe,Pc as he,Qc as ie,Ra as V,Rc as fe,Sc as z,Tc as $e,Xb as _,Yb as r,Z as le,ac as Z,ad as oe,cd as Q,dc as de,ec as Le,gc as Fe,hc as Ge,ia as Ie,ic as d,ja as Te,jc as u,ka as Se,kc as P,lc as x,mc as I,nc as ee,oc as T,od as S,pa as K,pd as me,q as xe,rb as c,rd as ge,sd as De,tc as y,uc as p,xa as Ve,xb as re,ya as h,za as f,zc as k}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as L,b as F}from"./chunk-66YHNWRR.js";var xt=t=>({$implicit:t});function It(t,s){t&1&&ee(0)}function Tt(t,s){if(t&1&&(x(0),m(1,It,1,0,"ng-container",8),I()),t&2){let e=p().$implicit,n=p();c(),r("ngTemplateOutlet",n.optionTemplate)("ngTemplateOutletContext",z(2,xt,e==null?null:e.option))}}function St(t,s){if(t&1&&(d(0,"span",9),g(1),u()),t&2){let e=p().$implicit,n=p();_("data-pc-section","text"),c(),R(n.getOptionLabelToRender(e))}}function Vt(t,s){t&1&&P(0,"AngleRightIcon")}function kt(t,s){}function Mt(t,s){t&1&&m(0,kt,0,0,"ng-template")}function Et(t,s){if(t&1&&(d(0,"span",10),m(1,Vt,1,0,"AngleRightIcon",11)(2,Mt,1,0,null,12),u()),t&2){let e=p(2);_("data-pc-section","groupIcon"),c(),r("ngIf",!e.groupicon),c(),r("ngTemplateOutlet",e.groupicon)}}function Lt(t,s){if(t&1){let e=T();d(0,"p-cascadeselect-sub",13),y("onChange",function(i){h(e);let o=p(2);return f(o.onChange.emit(i))})("onFocusChange",function(i){h(e);let o=p(2);return f(o.onFocusChange.emit(i))})("onFocusEnterChange",function(i){h(e);let o=p(2);return f(o.onFocusEnterChange.emit(i))}),u()}if(t&2){let e=p().$implicit,n=p();r("role","group")("selectId",n.selectId)("focusedOptionId",n.focusedOptionId)("activeOptionPath",n.activeOptionPath)("options",n.getOptionGroupChildren(e))("optionLabel",n.optionLabel)("optionValue",n.optionValue)("level",n.level+1)("optionGroupLabel",n.optionGroupLabel)("optionGroupChildren",n.optionGroupChildren)("dirty",n.dirty)("optionTemplate",n.optionTemplate)}}function Ft(t,s){if(t&1){let e=T();d(0,"li",3)(1,"div",4),y("click",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionClick(i,o))})("mouseenter",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionMouseEnter(i,o))})("mousemove",function(i){let o=h(e).$implicit,a=p();return f(a.onOptionMouseMove(i,o))}),m(2,Tt,2,4,"ng-container",5)(3,St,2,2,"ng-template",null,0,Q)(5,Et,3,3,"span",6),u(),m(6,Lt,1,12,"p-cascadeselect-sub",7),u()}if(t&2){let e=s.$implicit,n=s.index,i=te(4),o=p();r("ngClass",o.getItemClass(e))("id",o.getOptionId(e)),_("aria-level",o.level+1)("aria-setsize",o.options.length)("data-pc-section","item")("aria-label",o.getOptionLabelToRender(e))("aria-selected",o.isOptionGroup(e)?void 0:o.isOptionSelected(e))("aria-posinset",n+1),c(),_("data-pc-section","content"),c(),r("ngIf",o.optionTemplate)("ngIfElse",i),c(3),r("ngIf",o.isOptionGroup(e)),c(),r("ngIf",o.isOptionGroup(e)&&o.isOptionActive(e))}}var Gt=["value"],Pt=["option"],$t=["header"],Dt=["footer"],Kt=["triggericon"],Rt=["loadingicon"],At=["optiongroupicon"],Bt=["clearicon"],Nt=["focusInput"],Ht=["container"],qt=["panel"],zt=["overlay"],Qt=(t,s)=>({$implicit:t,placeholder:s}),Wt=t=>({"p-cascadeselect-overlay p-component":!0,"p-cascadeselect-mobile-active":t});function Ut(t,s){t&1&&ee(0)}function jt(t,s){if(t&1&&(x(0),m(1,Ut,1,0,"ng-container",16),I()),t&2){let e=p();c(),r("ngTemplateOutlet",e.valueTemplate||e._valueTemplate)("ngTemplateOutletContext",$e(2,Qt,e.value,e.placeholder))}}function Xt(t,s){if(t&1&&g(0),t&2){let e=p();$(" ",e.label()," ")}}function Jt(t,s){if(t&1){let e=T();d(0,"TimesIcon",18),y("click",function(i){h(e);let o=p(2);return f(o.clear(i))}),u()}t&2&&_("data-pc-section","clearicon")("aria-hidden",!0)}function Yt(t,s){}function Zt(t,s){t&1&&m(0,Yt,0,0,"ng-template")}function ei(t,s){if(t&1){let e=T();d(0,"span",18),y("click",function(i){h(e);let o=p(2);return f(o.clear(i))}),m(1,Zt,1,0,null,19),u()}if(t&2){let e=p(2);_("data-pc-section","clearicon")("aria-hidden",!0),c(),r("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function ti(t,s){if(t&1&&(x(0),m(1,Jt,1,2,"TimesIcon",17)(2,ei,2,3,"span",17),I()),t&2){let e=p();c(),r("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),c(),r("ngIf",e.clearIconTemplate||e._clearIconTemplate)}}function ii(t,s){t&1&&ee(0)}function ni(t,s){if(t&1&&(x(0),m(1,ii,1,0,"ng-container",19),I()),t&2){let e=p(2);c(),r("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function oi(t,s){if(t&1&&P(0,"span",22),t&2){let e=p(3);r("ngClass","p-cascadeselect-loading-icon pi-spin "+e.loadingIcon)}}function ai(t,s){t&1&&P(0,"span",23),t&2&&Z("p-cascadeselect-loading-icon pi pi-spinner pi-spin")}function si(t,s){if(t&1&&(x(0),m(1,oi,1,1,"span",20)(2,ai,1,2,"span",21),I()),t&2){let e=p(2);c(),r("ngIf",e.loadingIcon),c(),r("ngIf",!e.loadingIcon)}}function ci(t,s){if(t&1&&(x(0),m(1,ni,2,1,"ng-container",12)(2,si,3,2,"ng-container",12),I()),t&2){let e=p();c(),r("ngIf",e.loadingIconTemplate||e._loadingIconTemplate),c(),r("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate)}}function li(t,s){t&1&&P(0,"ChevronDownIcon",26),t&2&&r("styleClass","p-cascadeselect-dropdown-icon")}function ri(t,s){}function pi(t,s){t&1&&m(0,ri,0,0,"ng-template")}function di(t,s){if(t&1&&(d(0,"span",27),m(1,pi,1,0,null,19),u()),t&2){let e=p(2);c(),r("ngTemplateOutlet",e.triggerIconTemplate||e._triggerIconTemplate)}}function ui(t,s){if(t&1&&m(0,li,1,1,"ChevronDownIcon",24)(1,di,2,1,"span",25),t&2){let e=p();r("ngIf",!e.triggerIconTemplate&&!e._triggerIconTemplate),c(),r("ngIf",e.triggerIconTemplate||e._triggerIconTemplate)}}function hi(t,s){}function fi(t,s){t&1&&m(0,hi,0,0,"ng-template")}function mi(t,s){}function gi(t,s){t&1&&m(0,mi,0,0,"ng-template")}function _i(t,s){if(t&1){let e=T();d(0,"div",28,6),m(2,fi,1,0,null,19),d(3,"div",29)(4,"p-cascadeselect-sub",30),y("onChange",function(i){h(e);let o=p();return f(o.onOptionClick(i))})("onFocusChange",function(i){h(e);let o=p();return f(o.onOptionMouseMove(i))})("onFocusEnterChange",function(i){h(e);let o=p();return f(o.onOptionMouseEnter(i))}),u()(),d(5,"span",14),g(6),u(),m(7,gi,1,0,null,19),u()}if(t&2){let e=p();Z(e.panelStyleClass),r("ngClass",z(24,Wt,e.queryMatches()))("ngStyle",e.panelStyle),_("data-pc-section","panel"),c(2),r("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),c(),_("data-pc-section","wrapper"),c(),r("options",e.processedOptions)("selectId",e.id)("focusedOptionId",e.focused?e.focusedOptionId:void 0)("activeOptionPath",e.activeOptionPath())("optionLabel",e.optionLabel)("optionValue",e.optionValue)("level",0)("optionTemplate",e.optionTemplate||e._optionTemplate)("groupicon",e.groupIconTemplate||e.groupIconTemplate)("optionGroupLabel",e.optionGroupLabel)("optionGroupChildren",e.optionGroupChildren)("optionDisabled",e.optionDisabled)("root",!0)("dirty",e.dirty)("role","tree"),c(2),$(" ",e.selectedMessageText," "),c(),r("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}var yi=({dt:t})=>`
|
|
2
2
|
.p-cascadeselect {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
cursor: pointer;
|
|
@@ -249,4 +249,4 @@ p-cascadeselect.ng-invalid.ng-dirty .p-cascadeselect-label.p-placeholder {
|
|
|
249
249
|
flex-shrink: 0;
|
|
250
250
|
background: transparent;
|
|
251
251
|
color: ${t("cascadeselect.clear.icon.color")};
|
|
252
|
-
}`,bi={root:({props:t})=>({position:t.appendTo==="self"?"relative":void 0})},Oi={root:({instance:t,props:s})=>["p-cascadeselect p-component p-inputwrapper",{"p-cascadeselect-mobile":t.queryMatches(),"p-disabled":s.disabled,"p-invalid":s.invalid,"p-variant-filled":s.variant?s.variant==="filled":t.config.inputStyle==="filled"||t.config.inputVariant==="filled","p-focus":t.focused,"p-inputwrapper-filled":s.modelValue,"p-inputwrapper-focus":t.focused||t.overlayVisible,"p-cascadeselect-open":t.overlayVisible,"p-cascadeselect-fluid":s.fluid,"p-cascadeselect-sm p-inputfield-sm":s.size==="small","p-cascadeselect-lg p-inputfield-lg":s.size==="large"}],label:({instance:t,props:s})=>["p-cascadeselect-label",{"p-placeholder":t.label===s.placeholder,"p-cascadeselect-label-empty":!t.$slots.value&&(t.label==="p-emptylabel"||t.label.length===0)}],dropdown:"p-cascadeselect-dropdown",loadingIcon:"p-cascadeselect-loading-icon",dropdownIcon:"p-cascadeselect-dropdown-icon",overlay:({instance:t})=>["p-cascadeselect-overlay p-component",{"p-cascadeselect-mobile-active":t.queryMatches()}],listContainer:"p-cascadeselect-list-container",list:"p-cascadeselect-list",option:({instance:t,processedOption:s})=>["p-cascadeselect-option",{"p-cascadeselect-option-active":t.isOptionActive(s),"p-cascadeselect-option-selected":t.isOptionSelected(s),"p-focus":t.isOptionFocused(s),"p-disabled":t.isOptionDisabled(s)}],optionContent:"p-cascadeselect-option-content",optionText:"p-cascadeselect-option-text",groupIcon:"p-cascadeselect-group-icon",optionList:"p-cascadeselect-overlay p-cascadeselect-option-list"},Ot=(()=>{class t extends rt{name="cascadeselect";theme=yi;classes=Oi;inlineStyles=bi;static \u0275fac=(()=>{let e;return function(i){return(e||(e=ke(t)))(i||t)}})();static \u0275prov=Te({token:t,factory:t.\u0275fac})}return t})();var vi={provide:qe,useExisting:Ie(()=>j),multi:!0},Ci=(()=>{class t extends Ce{cascadeselect;role;selectId;activeOptionPath;optionDisabled;focusedOptionId;options;optionGroupChildren;optionTemplate;groupicon;level=0;optionLabel;optionValue;optionGroupLabel;dirty;root;onChange=new w;onFocusChange=new w;onFocusEnterChange=new w;get listLabel(){return this.config.getTranslation(ut.ARIA).listLabel}constructor(e){super(),this.cascadeselect=e}ngOnInit(){super.ngOnInit(),this.root||this.position()}onOptionClick(e,n){this.onChange.emit({originalEvent:e,processedOption:n,isFocus:!0})}onOptionMouseEnter(e,n){this.onFocusEnterChange.emit({originalEvent:e,processedOption:n})}onOptionMouseMove(e,n){this.onFocusChange.emit({originalEvent:e,processedOption:n})}getOptionId(e){return`${this.selectId}_${e.key}`}getOptionLabel(e){return this.optionLabel?M(e.option,this.optionLabel):e.option}getOptionValue(e){return this.optionValue?M(e.option,this.optionValue):e.option}getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)}isOptionDisabled(e){return this.optionDisabled?M(e.option,this.optionDisabled):!1}getOptionGroupLabel(e){return this.optionGroupLabel?M(e.option,this.optionGroupLabel):null}getOptionGroupChildren(e){return e.children}isOptionGroup(e){return C(e.children)}isOptionSelected(e){return Oe(this.cascadeselect?.modelValue(),e?.option)}isOptionActive(e){return this.activeOptionPath.some(n=>n.key===e.key)}isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)}getItemClass(e){return{"p-cascadeselect-option":!0,"p-cascadeselect-option-group":this.isOptionGroup(e),"p-cascadeselect-option-active":this.isOptionActive(e),"p-cascadeselect-option-selected":this.isOptionSelected(e),"p-focus":this.isOptionFocused(e),"p-disabled":this.isOptionDisabled(e)}}position(){let e=this.el.nativeElement.parentElement,n=st(e),i=tt(),o=this.el.nativeElement.children[0].offsetParent?this.el.nativeElement.children[0].offsetWidth:at(this.el.nativeElement.children[0]),a=it(e.children[0]);parseInt(n.left,10)+a+o>i.width-nt()&&(this.el.nativeElement.children[0].style.left="-200%")}static \u0275fac=function(n){return new(n||t)(re(j))};static \u0275cmp=A({type:t,selectors:[["p-cascadeSelectSub"],["p-cascadeselect-sub"]],inputs:{role:"role",selectId:"selectId",activeOptionPath:"activeOptionPath",optionDisabled:"optionDisabled",focusedOptionId:"focusedOptionId",options:"options",optionGroupChildren:"optionGroupChildren",optionTemplate:"optionTemplate",groupicon:"groupicon",level:[2,"level","level",me],optionLabel:"optionLabel",optionValue:"optionValue",optionGroupLabel:"optionGroupLabel",dirty:[2,"dirty","dirty",S],root:[2,"root","root",S]},outputs:{onChange:"onChange",onFocusChange:"onFocusChange",onFocusEnterChange:"onFocusEnterChange"},features:[pe],decls:2,vars:4,consts:[["defaultOptionTemplate",""],["aria-orientation","horizontal",1,"p-cascadeselect-list"],["ngFor","",3,"ngForOf"],["role","treeitem",3,"ngClass","id"],["pRipple","",1,"p-cascadeselect-option-content",3,"click","mouseenter","mousemove"],[4,"ngIf","ngIfElse"],["class","p-cascadeselect-group-icon",4,"ngIf"],["class","p-cascadeselect-list p-cascadeselect-overlay p-cascadeselect-option-list",3,"role","selectId","focusedOptionId","activeOptionPath","options","optionLabel","optionValue","level","optionGroupLabel","optionGroupChildren","dirty","optionTemplate","onChange","onFocusChange","onFocusEnterChange",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-cascadeselect-option-text"],[1,"p-cascadeselect-group-icon"],[4,"ngIf"],[4,"ngTemplateOutlet"],[1,"p-cascadeselect-list","p-cascadeselect-overlay","p-cascadeselect-option-list",3,"onChange","onFocusChange","onFocusEnterChange","role","selectId","focusedOptionId","activeOptionPath","options","optionLabel","optionValue","level","optionGroupLabel","optionGroupChildren","dirty","optionTemplate"]],template:function(n,i){n&1&&(d(0,"ul",1),m(1,Ft,7,13,"ng-template",2),u()),n&2&&(_("role",i.role)("data-pc-section",i.level===0?"list":"sublist")("aria-label",i.listLabel),c(),r("ngForOf",i.options))},dependencies:[t,W,_e,Ke,ye,be,yt,ft,U],encapsulation:2,changeDetection:0})}return t})(),j=(()=>{class t extends Ce{overlayService;id;searchMessage;emptyMessage;selectionMessage;emptySearchMessage;emptySelectionMessage;searchLocale;optionDisabled;focusOnHover=!0;selectOnFocus=!1;autoOptionFocus=!1;styleClass;style;options;optionLabel;optionValue;optionGroupLabel;optionGroupChildren;placeholder;value;dataKey;inputId;size;tabindex=0;ariaLabelledBy;inputLabel;ariaLabel;appendTo;disabled;showClear=!1;panelStyleClass;panelStyle;overlayOptions;autofocus;get showTransitionOptions(){return this._showTransitionOptions}set showTransitionOptions(e){this._showTransitionOptions=e,console.log("The showTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.")}variant;loading=!1;loadingIcon;get hideTransitionOptions(){return this._hideTransitionOptions}set hideTransitionOptions(e){this._hideTransitionOptions=e,console.log("The hideTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.")}fluid=!1;breakpoint="960px";onChange=new w;onGroupChange=new w;onShow=new w;onHide=new w;onClear=new w;onBeforeShow=new w;onBeforeHide=new w;onFocus=new w;onBlur=new w;focusInputViewChild;containerViewChild;panelViewChild;overlayViewChild;valueTemplate;optionTemplate;headerTemplate;footerTemplate;triggerIconTemplate;loadingIconTemplate;groupIconTemplate;clearIconTemplate;_valueTemplate;_optionTemplate;_headerTemplate;_footerTemplate;_triggerIconTemplate;_loadingIconTemplate;_groupIconTemplate;_clearIconTemplate;_showTransitionOptions="";_hideTransitionOptions="";selectionPath=null;focused=!1;overlayVisible=!1;clicked=!1;dirty=!1;searchValue;searchTimeout;onModelChange=()=>{};onModelTouched=()=>{};focusedOptionInfo=V({index:-1,level:0,parentKey:""});activeOptionPath=V([]);modelValue=V(null);processedOptions=[];_componentStyle=K(Ot);initialized=!1;get containerClass(){return{"p-cascadeselect p-component p-inputwrapper":!0,"p-cascadeselect-clearable":this.showClear&&!this.disabled,"p-cascadeselect-mobile":this.queryMatches(),"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue(),"p-variant-filled":this.variant==="filled"||this.config.inputStyle()==="filled"||this.config.inputVariant()==="filled","p-inputwrapper-focus":this.focused||this.overlayVisible,"p-cascadeselect-open":this.overlayVisible,"p-cascadeselect-fluid":this.hasFluid,"p-cascadeselect-sm p-inputfield-sm":this.size==="small","p-cascadeselect-lg p-inputfield-lg":this.size==="large"}}get labelClass(){return{"p-cascadeselect-label":!0,"p-placeholder":this.label()===this.placeholder,"p-cascadeselect-label-empty":!this.value&&(this.label()==="p-emptylabel"||this.label().length===0)}}get hasFluid(){let n=this.el.nativeElement.closest("p-fluid");return this.fluid||!!n}get focusedOptionId(){return this.focusedOptionInfo().index!==-1?`${this.id}${C(this.focusedOptionInfo().parentKey)?"_"+this.focusedOptionInfo().parentKey:""}_${this.focusedOptionInfo().index}`:null}get filled(){return typeof this.modelValue()=="string"?!!this.modelValue():this.modelValue()||this.modelValue()!=null||this.modelValue()!=null}get searchResultMessageText(){return C(this.visibleOptions())?this.searchMessageText.replaceAll("{0}",this.visibleOptions().length):this.emptySearchMessageText}get searchMessageText(){return this.searchMessage||this.config.translation.searchMessage||""}get emptySearchMessageText(){return this.emptySearchMessage||this.config.translation.emptySearchMessage||""}get emptyMessageText(){return this.emptyMessage||this.config.translation.emptyMessage||""}get selectionMessageText(){return this.selectionMessage||this.config.translation.selectionMessage||""}get emptySelectionMessageText(){return this.emptySelectionMessage||this.config.translation.emptySelectionMessage||""}get selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText}visibleOptions=ge(()=>{let e=this.activeOptionPath().find(n=>n.key===this.focusedOptionInfo().parentKey);return e?e.children:this.processedOptions});label=ge(()=>{let e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption()){let n=this.findOptionPathByValue(this.modelValue(),null),i=C(n)?n[n.length-1]:null;return i?this.getOptionLabel(i.option):e}return e});get _label(){let e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption()){let n=this.findOptionPathByValue(this.modelValue(),null),i=C(n)?n[n.length-1]:null;return i?this.getOptionLabel(i.option):e}return e}templates;ngAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"value":this._valueTemplate=e.template;break;case"option":this._optionTemplate=e.template;break;case"triggericon":this._triggerIconTemplate=e.template;break;case"loadingicon":this._loadingIconTemplate=e.template;break;case"clearicon":this._clearIconTemplate=e.template;break;case"optiongroupicon":this._groupIconTemplate=e.template;break}})}ngOnChanges(e){super.ngOnChanges(e),e.options&&(this.processedOptions=this.createProcessedOptions(e.options.currentValue||[]),this.updateModel(null))}hasSelectedOption(){return C(this.modelValue())}createProcessedOptions(e,n=0,i={},o=""){let a=[];return e&&e.forEach((l,b)=>{let G=(o!==""?o+"_":"")+b,E={option:l,index:b,level:n,key:G,parent:i,parentKey:o};E.children=this.createProcessedOptions(this.getOptionGroupChildren(l,n),n+1,E,G),a.push(E)}),a}onInputFocus(e){this.disabled||(this.focused=!0,this.onFocus.emit(e))}onInputBlur(e){this.focused=!1,this.focusedOptionInfo.set({indeX:-1,level:0,parentKey:""}),this.searchValue="",this.onModelTouched(),this.onBlur.emit(e)}onInputKeyDown(e){if(this.disabled||this.loading){e.preventDefault();return}let n=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e);break;case"PageDown":case"PageUp":case"ShiftLeft":case"ShiftRight":break;default:!n&&ct(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key));break}this.clicked=!1}onArrowDownKey(e){if(!this.overlayVisible)this.show();else{let n=this.focusedOptionInfo().index!==-1?this.findNextOptionIndex(this.focusedOptionInfo().index):this.clicked?this.findFirstOptionIndex():this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,n,!0)}e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedOptionInfo().index!==-1){let n=this.visibleOptions[this.focusedOptionInfo().index];!this.isProccessedOptionGroup(n)&&this.onOptionChange({originalEvent:e,processedOption:n})}this.overlayVisible&&this.hide(),e.preventDefault()}else{let n=this.focusedOptionInfo().index!==-1?this.findPrevOptionIndex(this.focusedOptionInfo().index):this.clicked?this.findLastOptionIndex():this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,n,!0),!this.overlayVisible&&this.show(),e.preventDefault()}}onArrowLeftKey(e){if(this.overlayVisible){let n=this.visibleOptions()[this.focusedOptionInfo().index],i=this.activeOptionPath().find(l=>l.key===n.parentKey),o=this.focusedOptionInfo().parentKey===""||i&&i.key===this.focusedOptionInfo().parentKey,a=ce(n.parent);if(o){let l=this.activeOptionPath().filter(b=>b.parentKey!==this.focusedOptionInfo().parentKey);this.activeOptionPath.set(l)}a||(this.focusedOptionInfo.set({index:-1,parentKey:i?i.parentKey:""}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}}onArrowRightKey(e){if(this.overlayVisible){let n=this.visibleOptions()[this.focusedOptionInfo().index];this.isProccessedOptionGroup(n)&&(this.activeOptionPath().some(a=>n.key===a.key)?(this.focusedOptionInfo.set({index:-1,parentKey:n.key}),this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:n})),e.preventDefault()}}onHomeKey(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()}onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()}onEnterKey(e){if(!this.overlayVisible)this.focusedOptionInfo.set(F(L({},this.focusedOptionInfo()),{index:-1})),this.onArrowDownKey(e);else if(this.focusedOptionInfo().index!==-1){let n=this.visibleOptions()[this.focusedOptionInfo().index],i=this.isProccessedOptionGroup(n);this.onOptionClick({originalEvent:e,processedOption:n}),!i&&this.hide()}e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.overlayVisible&&this.hide(e,!0),e.preventDefault()}onTabKey(e){if(this.focusedOptionInfo().index!==-1){let n=this.visibleOptions()[this.focusedOptionInfo().index];!this.isProccessedOptionGroup(n)&&this.onOptionChange({originalEvent:e,processedOption:n})}this.overlayVisible&&this.hide()}onBackspaceKey(e){C(this.modelValue())&&this.showClear&&this.clear(),e.stopPropagation()}equalityKey(){return this.optionValue?null:this.dataKey}updateModel(e,n){this.value=e,this.onModelChange(e),this.modelValue.set(e),this.initialized&&this.onChange.emit({originalEvent:n,value:e})}autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption()&&(this.focusedOptionInfo().index=this.findFirstFocusedOptionIndex(),this.onOptionChange({originalEvent:null,processedOption:this.visibleOptions()[this.focusedOptionInfo().index],isHide:!1}),!this.overlayVisible&&this.focusedOptionInfo.set({index:-1,level:0,parentKey:""}))}scrollInView(e=-1){let n=e!==-1?`${this.id}_${e}`:this.focusedOptionId,i=ot(this.panelViewChild?.nativeElement,`li[id="${n}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})}changeFocusedOptionIndex(e,n,i){let o=this.focusedOptionInfo();o.index!==n&&(this.focusedOptionInfo.set(F(L({},o),{index:n})),this.scrollInView(),this.focusOnHover&&this.onOptionClick({originalEvent:e,processedOption:this.visibleOptions()[n],isHide:!1,preventSelection:i}),this.selectOnFocus&&this.onOptionChange({originalEvent:e,processedOption:this.visibleOptions()[n],isHide:!1}))}matchMediaListener;onOptionSelect(e){let{originalEvent:n,value:i,isHide:o}=e,a=this.getOptionValue(i),l=this.activeOptionPath();l.forEach(b=>b.selected=!0),this.activeOptionPath.set(l),this.updateModel(a,n),o&&this.hide(e,!0)}onOptionGroupSelect(e){this.dirty=!0,this.onGroupChange.emit(e)}onContainerClick(e){this.disabled||this.loading||(this.overlayViewChild?.el?.nativeElement?.contains(e.target)||(this.overlayVisible?this.hide():this.show(),this.focusInputViewChild?.nativeElement.focus()),this.clicked=!0)}isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))}isOptionDisabled(e){return this.optionDisabled?M(e,this.optionDisabled):!1}isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)}isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)}isSelected(e){return this.activeOptionPath().some(n=>n.key===e.key)}findOptionPathByValue(e,n,i=0){if(n=n||i===0&&this.processedOptions,!n)return null;if(ce(e))return[];for(let o=0;o<n.length;o++){let a=n[o];if(Oe(e,this.getOptionValue(a.option),this.equalityKey()))return[a];let l=this.findOptionPathByValue(e,a.children,i+1);if(l)return l.unshift(a),l}}findFirstOptionIndex(){return this.visibleOptions().findIndex(e=>this.isValidOption(e))}findLastOptionIndex(){return ve(this.visibleOptions(),e=>this.isValidOption(e))}findNextOptionIndex(e){let n=e<this.visibleOptions().length-1?this.visibleOptions().slice(e+1).findIndex(i=>this.isValidOption(i)):-1;return n>-1?n+e+1:e}findPrevOptionIndex(e){let n=e>0?ve(this.visibleOptions().slice(0,e),i=>this.isValidOption(i)):-1;return n>-1?n:e}findSelectedOptionIndex(){return this.visibleOptions().findIndex(e=>this.isValidSelectedOption(e))}findFirstFocusedOptionIndex(){let e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e}findLastFocusedOptionIndex(){let e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e}searchOptions(e,n){this.searchValue=(this.searchValue||"")+n;let i=-1,o=!1,a=this.focusedOptionInfo();return a.index!==-1?(i=this.visibleOptions().slice(a.index).findIndex(l=>this.isOptionMatched(l)),i=i===-1?this.visibleOptions().slice(0,a.index).findIndex(l=>this.isOptionMatched(l)):i+a.index):i=this.visibleOptions().findIndex(l=>this.isOptionMatched(l)),i!==-1&&(o=!0),i===-1&&a.index===-1&&(i=this.findFirstFocusedOptionIndex()),i!==-1&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}hide(e,n=!1){let i=()=>{this.overlayVisible=!1,this.clicked=!1,this.activeOptionPath.set([]),this.focusedOptionInfo.set({index:-1,level:0,parentKey:""}),n&&se(this.focusInputViewChild.nativeElement),this.onHide.emit(e),this.cd.markForCheck()};setTimeout(()=>{i()},0)}show(e,n=!1){this.onShow.emit(e),this.overlayVisible=!0;let i=this.hasSelectedOption()?this.findOptionPathByValue(this.modelValue()):this.activeOptionPath();this.activeOptionPath.set(i);let o;if(this.hasSelectedOption()&&C(this.activeOptionPath())){let a=this.activeOptionPath()[this.activeOptionPath().length-1];o={index:a.index,level:a.level,parentKey:a.parentKey}}else o={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),level:0,parentKey:""};this.focusedOptionInfo.set(o),n&&se(this.focusInputViewChild.nativeElement)}clear(e){C(this.modelValue())&&this.showClear&&(this.updateModel(null),this.focusedOptionInfo.set({index:-1,level:0,parentKey:""}),this.activeOptionPath.set([]),this.onClear.emit()),e&&e.stopPropagation()}getOptionLabel(e){return this.optionLabel?M(e,this.optionLabel):e}getOptionValue(e){return this.optionValue?M(e,this.optionValue):e}getOptionGroupLabel(e){return this.optionGroupLabel?M(e,this.optionGroupLabel):null}getOptionGroupChildren(e,n){return M(e,this.optionGroupChildren[n])}isOptionGroup(e,n){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[n])}isProccessedOptionGroup(e){return C(e?.children)}getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option):this.getOptionLabel(e.option)}constructor(e){super(),this.overlayService=e,De(()=>{let n=this.activeOptionPath();C(n)&&this.overlayViewChild.alignOverlay()})}query;queryMatches=V(!1);mobileActive=V(!1);onOptionChange(e){let{processedOption:n,type:i}=e;if(ce(n))return;let{index:o,key:a,level:l,parentKey:b,children:G}=n,E=C(G),D=this.activeOptionPath().filter(X=>X.parentKey!==b&&X.parentKey!==a);this.focusedOptionInfo.set({index:o,level:l,parentKey:b}),!(i=="hover"&&this.queryMatches())&&(E&&D.push(n),this.activeOptionPath.set([...D]))}onOptionClick(e){let{originalEvent:n,processedOption:i,isFocus:o,isHide:a,preventSelection:l}=e,{index:b,key:G,level:E,parentKey:D}=i,X=this.isProccessedOptionGroup(i);if(this.isSelected(i)){let J=this.activeOptionPath().filter(Y=>G!==Y.key&&G.startsWith(Y.key));this.activeOptionPath.set([...J]),this.focusedOptionInfo.set({index:b,level:E,parentKey:D})}else if(X)this.onOptionChange(e),this.onOptionGroupSelect({originalEvent:n,value:i.option,isFocus:!1});else{let J=this.activeOptionPath().filter(Y=>Y.parentKey!==D);J.push(i),this.focusedOptionInfo.set({index:b,level:E,parentKey:D}),(!l||i?.children.length!==0)&&(this.activeOptionPath.set([...J]),this.onOptionSelect({originalEvent:n,value:i.option,isHide:o}))}o&&se(this.focusInputViewChild.nativeElement)}onOptionMouseEnter(e){this.focusOnHover&&(this.dirty||!this.dirty&&C(this.modelValue())?this.onOptionChange(F(L({},e),{type:"hover"})):!this.dirty&&e.processedOption.level===0&&this.onOptionClick(F(L({},e),{type:"hover"})))}onOptionMouseMove(e){this.focused&&this.focusOnHover&&this.changeFocusedOptionIndex(e,e.processedOption.index)}ngOnInit(){super.ngOnInit(),this.id=this.id||lt("pn_id_"),this.autoUpdateModel(),this.bindMatchMediaListener()}ngAfterViewInit(){super.ngAfterViewInit(),this.initialized=!0}bindMatchMediaListener(){if(!this.matchMediaListener){let e=this.document.defaultView;if(e&&e.matchMedia){let n=e.matchMedia(`(max-width: ${this.breakpoint})`);this.query=n,this.queryMatches.set(n?.matches),this.matchMediaListener=()=>{this.queryMatches.set(n?.matches),this.mobileActive.set(!1)},this.query.addEventListener("change",this.matchMediaListener)}}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}onOverlayAnimationDone(e){switch(e.toState){case"void":this.dirty=!1;break}}writeValue(e){this.value=e,this.updateModel(e),this.cd.markForCheck()}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.disabled=e,this.cd.markForCheck()}ngOnDestroy(){this.matchMediaListener&&this.unbindMatchMediaListener()}static \u0275fac=function(n){return new(n||t)(re(pt))};static \u0275cmp=A({type:t,selectors:[["p-cascadeSelect"],["p-cascadeselect"],["p-cascade-select"]],contentQueries:function(n,i,o){if(n&1&&(k(o,Gt,4),k(o,Pt,4),k(o,$t,4),k(o,Dt,4),k(o,Kt,4),k(o,Rt,4),k(o,At,4),k(o,Bt,4),k(o,dt,4)),n&2){let a;O(a=v())&&(i.valueTemplate=a.first),O(a=v())&&(i.optionTemplate=a.first),O(a=v())&&(i.headerTemplate=a.first),O(a=v())&&(i.footerTemplate=a.first),O(a=v())&&(i.triggerIconTemplate=a.first),O(a=v())&&(i.loadingIconTemplate=a.first),O(a=v())&&(i.groupIconTemplate=a.first),O(a=v())&&(i.clearIconTemplate=a.first),O(a=v())&&(i.templates=a)}},viewQuery:function(n,i){if(n&1&&(B(Nt,5),B(Ht,5),B(qt,5),B(zt,5)),n&2){let o;O(o=v())&&(i.focusInputViewChild=o.first),O(o=v())&&(i.containerViewChild=o.first),O(o=v())&&(i.panelViewChild=o.first),O(o=v())&&(i.overlayViewChild=o.first)}},inputs:{id:"id",searchMessage:"searchMessage",emptyMessage:"emptyMessage",selectionMessage:"selectionMessage",emptySearchMessage:"emptySearchMessage",emptySelectionMessage:"emptySelectionMessage",searchLocale:"searchLocale",optionDisabled:"optionDisabled",focusOnHover:[2,"focusOnHover","focusOnHover",S],selectOnFocus:[2,"selectOnFocus","selectOnFocus",S],autoOptionFocus:[2,"autoOptionFocus","autoOptionFocus",S],styleClass:"styleClass",style:"style",options:"options",optionLabel:"optionLabel",optionValue:"optionValue",optionGroupLabel:"optionGroupLabel",optionGroupChildren:"optionGroupChildren",placeholder:"placeholder",value:"value",dataKey:"dataKey",inputId:"inputId",size:"size",tabindex:[2,"tabindex","tabindex",me],ariaLabelledBy:"ariaLabelledBy",inputLabel:"inputLabel",ariaLabel:"ariaLabel",appendTo:"appendTo",disabled:[2,"disabled","disabled",S],showClear:[2,"showClear","showClear",S],panelStyleClass:"panelStyleClass",panelStyle:"panelStyle",overlayOptions:"overlayOptions",autofocus:[2,"autofocus","autofocus",S],showTransitionOptions:"showTransitionOptions",variant:"variant",loading:[2,"loading","loading",S],loadingIcon:"loadingIcon",hideTransitionOptions:"hideTransitionOptions",fluid:[2,"fluid","fluid",S],breakpoint:"breakpoint"},outputs:{onChange:"onChange",onGroupChange:"onGroupChange",onShow:"onShow",onHide:"onHide",onClear:"onClear",onBeforeShow:"onBeforeShow",onBeforeHide:"onBeforeHide",onFocus:"onFocus",onBlur:"onBlur"},features:[ie([vi,Ot]),pe,Ve],decls:20,vars:34,consts:[["container",""],["focusInput",""],["defaultValueTemplate",""],["elseBlock",""],["overlay",""],["content",""],["panel",""],[3,"click","ngClass","ngStyle"],[1,"p-hidden-accessible"],["readonly","","type","text","role","combobox","aria-haspopup","tree",3,"focus","blur","keydown","disabled","placeholder","tabindex","pAutoFocus"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[4,"ngIf"],["role","button","aria-haspopup","listbox",1,"p-cascadeselect-dropdown"],["role","status","aria-live","polite",1,"p-hidden-accessible"],[3,"visibleChange","onAnimationDone","onBeforeShow","onShow","onBeforeHide","onHide","visible","options","target","appendTo","showTransitionOptions","hideTransitionOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","p-cascadeselect-clear-icon",3,"click",4,"ngIf"],[1,"p-cascadeselect-clear-icon",3,"click"],[4,"ngTemplateOutlet"],["aria-hidden","true",3,"ngClass",4,"ngIf"],["aria-hidden","true",3,"class",4,"ngIf"],["aria-hidden","true",3,"ngClass"],["aria-hidden","true"],[3,"styleClass",4,"ngIf"],["class","p-cascadeselect-dropdown-icon",4,"ngIf"],[3,"styleClass"],[1,"p-cascadeselect-dropdown-icon"],[3,"ngClass","ngStyle"],[1,"p-cascadeselect-list-container"],[3,"onChange","onFocusChange","onFocusEnterChange","options","selectId","focusedOptionId","activeOptionPath","optionLabel","optionValue","level","optionTemplate","groupicon","optionGroupLabel","optionGroupChildren","optionDisabled","root","dirty","role"]],template:function(n,i){if(n&1){let o=T();d(0,"div",7,0),y("click",function(l){return h(o),f(i.onContainerClick(l))}),d(2,"div",8)(3,"input",9,1),y("focus",function(l){return h(o),f(i.onInputFocus(l))})("blur",function(l){return h(o),f(i.onInputBlur(l))})("keydown",function(l){return h(o),f(i.onInputKeyDown(l))}),u()(),d(5,"span",10),m(6,jt,2,5,"ng-container",11)(7,Xt,1,1,"ng-template",null,2,Q),u(),m(9,ti,3,2,"ng-container",12),d(10,"div",13),m(11,ci,3,2,"ng-container",11)(12,ui,2,2,"ng-template",null,3,Q),u(),d(14,"span",14),g(15),u(),d(16,"p-overlay",15,4),q("visibleChange",function(l){return h(o),H(i.overlayVisible,l)||(i.overlayVisible=l),f(l)}),y("onAnimationDone",function(l){return h(o),f(i.onOverlayAnimationDone(l))})("onBeforeShow",function(l){return h(o),f(i.onBeforeShow.emit(l))})("onShow",function(l){return h(o),f(i.show(l))})("onBeforeHide",function(l){return h(o),f(i.onBeforeHide.emit(l))})("onHide",function(l){return h(o),f(i.hide(l))}),m(18,_i,8,26,"ng-template",null,5,Q),u()()}if(n&2){let o,a,l=te(8),b=te(13);Z(i.styleClass),r("ngClass",i.containerClass)("ngStyle",i.style),_("data-pc-name","cascadeselect")("data-pc-section","root"),c(2),_("data-pc-section","hiddenInputWrapper"),c(),r("disabled",i.disabled)("placeholder",i.placeholder)("tabindex",i.disabled?-1:i.tabindex)("pAutoFocus",i.autofocus),_("id",i.inputId)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledBy)("aria-expanded",(o=i.overlayVisible)!==null&&o!==void 0?o:!1)("aria-controls",i.overlayVisible?i.id+"_tree":null)("aria-activedescendant",i.focused?i.focusedOptionId:void 0),c(2),r("ngClass",i.labelClass),_("data-pc-section","label"),c(),r("ngIf",i.valueTemplate||i._valueTemplate)("ngIfElse",l),c(3),r("ngIf",i.filled&&!i.disabled&&i.showClear),c(),_("aria-expanded",(a=i.overlayVisible)!==null&&a!==void 0?a:!1)("data-pc-section","dropdownIcon")("aria-hidden",!0),c(),r("ngIf",i.loading)("ngIfElse",b),c(4),$(" ",i.searchResultMessageText," "),c(),N("visible",i.overlayVisible),r("options",i.overlayOptions)("target","@parent")("appendTo",i.appendTo)("showTransitionOptions",i.showTransitionOptions)("hideTransitionOptions",i.hideTransitionOptions)}},dependencies:[W,_e,ye,be,Re,_t,ht,Ci,mt,gt,U],encapsulation:2,changeDetection:0})}return t})(),vt=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Me({type:t});static \u0275inj=Se({imports:[j,U,U]})}return t})();var xi=()=>({minWidth:"100%"}),Ii=()=>["Roles"],Ti=t=>({ID:t});function Si(t,s){if(t&1){let e=T();d(0,"button",13),y("click",function(){h(e);let i=p(2);return f(i.onDeleteGroup())}),P(1,"i",14),g(2),u()}if(t&2){let e,n=p(2);c(2),$(" Delete (",(e=n.selectedGroups())==null?null:e.length,") ")}}function Vi(t,s){if(t&1&&(x(0),m(1,Si,3,1,"button",12),I()),t&2){let e,n=p();c(),de(((e=n.selectedGroups())==null?null:e.length)>0?1:-1)}}function ki(t,s){t&1&&(x(0),d(1,"a",15),g(2," Add"),u(),I())}function Mi(t,s){if(t&1){let e=T();x(0),d(1,"th",16)(2,"div",17)(3,"input",18),y("change",function(i){h(e);let o=p(),a=he(0);return f(o.onCheckAllGroups(i==null||i.target==null?null:i.target.checked,a==null?null:a.Data))}),u()()(),I()}}function Ei(t,s){if(t&1){let e=T();x(0),d(1,"td")(2,"div",17)(3,"input",20),q("ngModelChange",function(i){h(e);let o=p().$implicit;return H(o.checked,i)||(o.checked=i),f(i)}),y("ngModelChange",function(){h(e);let i=p(2),o=he(0);return f(i.onSelectGroup(o==null?null:o.Data))}),u()()(),I()}if(t&2){let e=p().$implicit;c(3),N("ngModel",e.checked)}}function Li(t,s){if(t&1&&(d(0,"a",19),g(1),u()),t&2){let e=p().$implicit;r("queryParams",z(2,Ti,e.ID)),c(),$(" ",e.Name," ")}}function Fi(t,s){if(t&1&&(d(0,"span"),g(1),u()),t&2){let e=p().$implicit;c(),R(e.Name)}}function Gi(t,s){if(t&1&&(d(0,"tr"),m(1,Ei,4,1,"ng-container",1),d(2,"td"),m(3,Li,2,4,"a",19)(4,Fi,2,1,"span"),u(),d(5,"td"),g(6),u(),d(7,"td"),g(8),ne(9,"number"),u()()),t&2){let e=s.$implicit,n=p();c(),r("ngxPermissionsOnly",n.userDeleteRole),c(2),de(n.hasUserEditRole()?3:4),c(3),R(e.Description),c(2),R(oe(9,4,e.Count))}}var xn=(()=>{class t{constructor(){this.permissionService=K(Xe),this.groupsService=K(we),this.toastr=K(je),this.groupLoader$=this.groupsService.getGroupsLoader().pipe(le(1)),this.groups$=xe({Count:0,Data:[]}),this.filter=V({PageNumber:1,PageSize:100,Role:null}),this.selectedGroups=V([]),this.userCreateRole=ae.UserAdd,this.userDeleteRole=ae.UserDelete,this.hasUserEditRole=V(!1),this.initGroup(),this.permissionService.hasPermission(ae.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initGroup(){this.groups$=this.groupsService.getGroups(this.filter()).pipe(le(1))}onCheckAllGroups(e,n){n.forEach(o=>{o.checked=e});let i=n.filter(o=>o.checked);this.selectedGroups.set(i)}onSelectGroup(e){this.selectedGroups.set(e.filter(n=>n.checked))}onDeleteGroup(){if(confirm("Are you sure you want to delete the selected groups?")){let n=this.selectedGroups().map(i=>i.ID);this.groupsService.deleteGroups(n).subscribe({next:()=>{this.selectedGroups.set([]),this.toastr.success("Groups deleted successfully","Success"),this.initGroup()}})}}onNextPage(){this.filter.update(e=>F(L({},e),{PageNumber:e.PageNumber+1})),this.initGroup()}onPrevPage(){this.filter.update(e=>F(L({},e),{PageNumber:e.PageNumber-1})),this.initGroup()}onFilter(){this.initGroup()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-groups"]],features:[ie([we])],decls:31,vars:21,consts:[["headerTitle","Groups",3,"onSubmit","hideSearchBox","hideSearchDropdown"],[4,"ngxPermissionsOnly"],[1,"w-100"],[1,"d-block","fs-5","mb-2"],["appendTo","body","optionLabel","Name","optionGroupLabel","Name","optionValue","ID","placeholder","Select a Role",3,"ngModelChange","options","ngModel","optionGroupChildren"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],["routerLink","/menu/users/groups/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["type","checkbox",3,"change"],["routerLink","/menu/users/groups/info",3,"queryParams"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(n,i){if(n&1){let o=T();ue(0),ne(1,"async"),ue(2),ne(3,"async"),d(4,"mainpanel",0),y("onSubmit",function(){return h(o),f(i.onFilter())}),d(5,"actions"),m(6,Vi,2,1,"ng-container",1)(7,ki,3,0,"ng-container",1),u(),d(8,"filters")(9,"div",2)(10,"span",3),g(11,"Roles"),u(),d(12,"p-cascadeselect",4),q("ngModelChange",function(l){return h(o),H(i.filter().Role,l)||(i.filter().Role=l),f(l)}),u()()(),d(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),m(20,Mi,4,0,"ng-container",1),d(21,"th",10),g(22,"Name"),u(),d(23,"th"),g(24,"Description"),u(),d(25,"th"),g(26,"Role Count"),u()()(),d(27,"tbody"),Fe(28,Gi,10,6,"tr",null,Le),u()(),d(30,"app-mat-paginator-no-count",11),y("next",function(){return h(o),f(i.onNextPage())})("previous",function(){return h(o),f(i.onPrevPage())}),u()()()()()()}if(n&2){let o=Pe(oe(1,14,i.groups$)),a=oe(3,17,i.groupLoader$);c(4),r("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),r("ngxPermissionsOnly",i.userDeleteRole),c(),r("ngxPermissionsOnly",i.userCreateRole),c(5),Ee(fe(19,xi)),r("options",a==null?null:a.Options),N("ngModel",i.filter().Role),r("optionGroupChildren",fe(20,Ii)),c(8),r("ngxPermissionsOnly",i.userDeleteRole),c(8),Ge(o==null?null:o.Data),c(2),r("filter",i.filter())("totaldata",o==null||o.Data==null?null:o.Data.length)("paginationTotal",o==null?null:o.Count)("hasClicked",!0)}},dependencies:[W,Ae,Be,et,Ze,He,Ne,bt,vt,j,Ye,Je,Ue,ze,Qe,We],styles:["p-cascadeselect>.p-cascadeselect{width:100%}"]})}}return t})();export{xn as GroupsComponent};
|
|
252
|
+
}`,bi={root:({props:t})=>({position:t.appendTo==="self"?"relative":void 0})},Oi={root:({instance:t,props:s})=>["p-cascadeselect p-component p-inputwrapper",{"p-cascadeselect-mobile":t.queryMatches(),"p-disabled":s.disabled,"p-invalid":s.invalid,"p-variant-filled":s.variant?s.variant==="filled":t.config.inputStyle==="filled"||t.config.inputVariant==="filled","p-focus":t.focused,"p-inputwrapper-filled":s.modelValue,"p-inputwrapper-focus":t.focused||t.overlayVisible,"p-cascadeselect-open":t.overlayVisible,"p-cascadeselect-fluid":s.fluid,"p-cascadeselect-sm p-inputfield-sm":s.size==="small","p-cascadeselect-lg p-inputfield-lg":s.size==="large"}],label:({instance:t,props:s})=>["p-cascadeselect-label",{"p-placeholder":t.label===s.placeholder,"p-cascadeselect-label-empty":!t.$slots.value&&(t.label==="p-emptylabel"||t.label.length===0)}],dropdown:"p-cascadeselect-dropdown",loadingIcon:"p-cascadeselect-loading-icon",dropdownIcon:"p-cascadeselect-dropdown-icon",overlay:({instance:t})=>["p-cascadeselect-overlay p-component",{"p-cascadeselect-mobile-active":t.queryMatches()}],listContainer:"p-cascadeselect-list-container",list:"p-cascadeselect-list",option:({instance:t,processedOption:s})=>["p-cascadeselect-option",{"p-cascadeselect-option-active":t.isOptionActive(s),"p-cascadeselect-option-selected":t.isOptionSelected(s),"p-focus":t.isOptionFocused(s),"p-disabled":t.isOptionDisabled(s)}],optionContent:"p-cascadeselect-option-content",optionText:"p-cascadeselect-option-text",groupIcon:"p-cascadeselect-group-icon",optionList:"p-cascadeselect-overlay p-cascadeselect-option-list"},Ot=(()=>{class t extends rt{name="cascadeselect";theme=yi;classes=Oi;inlineStyles=bi;static \u0275fac=(()=>{let e;return function(i){return(e||(e=ke(t)))(i||t)}})();static \u0275prov=Te({token:t,factory:t.\u0275fac})}return t})();var vi={provide:qe,useExisting:Ie(()=>j),multi:!0},Ci=(()=>{class t extends Ce{cascadeselect;role;selectId;activeOptionPath;optionDisabled;focusedOptionId;options;optionGroupChildren;optionTemplate;groupicon;level=0;optionLabel;optionValue;optionGroupLabel;dirty;root;onChange=new w;onFocusChange=new w;onFocusEnterChange=new w;get listLabel(){return this.config.getTranslation(ut.ARIA).listLabel}constructor(e){super(),this.cascadeselect=e}ngOnInit(){super.ngOnInit(),this.root||this.position()}onOptionClick(e,n){this.onChange.emit({originalEvent:e,processedOption:n,isFocus:!0})}onOptionMouseEnter(e,n){this.onFocusEnterChange.emit({originalEvent:e,processedOption:n})}onOptionMouseMove(e,n){this.onFocusChange.emit({originalEvent:e,processedOption:n})}getOptionId(e){return`${this.selectId}_${e.key}`}getOptionLabel(e){return this.optionLabel?M(e.option,this.optionLabel):e.option}getOptionValue(e){return this.optionValue?M(e.option,this.optionValue):e.option}getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)}isOptionDisabled(e){return this.optionDisabled?M(e.option,this.optionDisabled):!1}getOptionGroupLabel(e){return this.optionGroupLabel?M(e.option,this.optionGroupLabel):null}getOptionGroupChildren(e){return e.children}isOptionGroup(e){return C(e.children)}isOptionSelected(e){return Oe(this.cascadeselect?.modelValue(),e?.option)}isOptionActive(e){return this.activeOptionPath.some(n=>n.key===e.key)}isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)}getItemClass(e){return{"p-cascadeselect-option":!0,"p-cascadeselect-option-group":this.isOptionGroup(e),"p-cascadeselect-option-active":this.isOptionActive(e),"p-cascadeselect-option-selected":this.isOptionSelected(e),"p-focus":this.isOptionFocused(e),"p-disabled":this.isOptionDisabled(e)}}position(){let e=this.el.nativeElement.parentElement,n=st(e),i=tt(),o=this.el.nativeElement.children[0].offsetParent?this.el.nativeElement.children[0].offsetWidth:at(this.el.nativeElement.children[0]),a=it(e.children[0]);parseInt(n.left,10)+a+o>i.width-nt()&&(this.el.nativeElement.children[0].style.left="-200%")}static \u0275fac=function(n){return new(n||t)(re(j))};static \u0275cmp=A({type:t,selectors:[["p-cascadeSelectSub"],["p-cascadeselect-sub"]],inputs:{role:"role",selectId:"selectId",activeOptionPath:"activeOptionPath",optionDisabled:"optionDisabled",focusedOptionId:"focusedOptionId",options:"options",optionGroupChildren:"optionGroupChildren",optionTemplate:"optionTemplate",groupicon:"groupicon",level:[2,"level","level",me],optionLabel:"optionLabel",optionValue:"optionValue",optionGroupLabel:"optionGroupLabel",dirty:[2,"dirty","dirty",S],root:[2,"root","root",S]},outputs:{onChange:"onChange",onFocusChange:"onFocusChange",onFocusEnterChange:"onFocusEnterChange"},features:[pe],decls:2,vars:4,consts:[["defaultOptionTemplate",""],["aria-orientation","horizontal",1,"p-cascadeselect-list"],["ngFor","",3,"ngForOf"],["role","treeitem",3,"ngClass","id"],["pRipple","",1,"p-cascadeselect-option-content",3,"click","mouseenter","mousemove"],[4,"ngIf","ngIfElse"],["class","p-cascadeselect-group-icon",4,"ngIf"],["class","p-cascadeselect-list p-cascadeselect-overlay p-cascadeselect-option-list",3,"role","selectId","focusedOptionId","activeOptionPath","options","optionLabel","optionValue","level","optionGroupLabel","optionGroupChildren","dirty","optionTemplate","onChange","onFocusChange","onFocusEnterChange",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-cascadeselect-option-text"],[1,"p-cascadeselect-group-icon"],[4,"ngIf"],[4,"ngTemplateOutlet"],[1,"p-cascadeselect-list","p-cascadeselect-overlay","p-cascadeselect-option-list",3,"onChange","onFocusChange","onFocusEnterChange","role","selectId","focusedOptionId","activeOptionPath","options","optionLabel","optionValue","level","optionGroupLabel","optionGroupChildren","dirty","optionTemplate"]],template:function(n,i){n&1&&(d(0,"ul",1),m(1,Ft,7,13,"ng-template",2),u()),n&2&&(_("role",i.role)("data-pc-section",i.level===0?"list":"sublist")("aria-label",i.listLabel),c(),r("ngForOf",i.options))},dependencies:[t,W,_e,Ke,ye,be,yt,ft,U],encapsulation:2,changeDetection:0})}return t})(),j=(()=>{class t extends Ce{overlayService;id;searchMessage;emptyMessage;selectionMessage;emptySearchMessage;emptySelectionMessage;searchLocale;optionDisabled;focusOnHover=!0;selectOnFocus=!1;autoOptionFocus=!1;styleClass;style;options;optionLabel;optionValue;optionGroupLabel;optionGroupChildren;placeholder;value;dataKey;inputId;size;tabindex=0;ariaLabelledBy;inputLabel;ariaLabel;appendTo;disabled;showClear=!1;panelStyleClass;panelStyle;overlayOptions;autofocus;get showTransitionOptions(){return this._showTransitionOptions}set showTransitionOptions(e){this._showTransitionOptions=e,console.log("The showTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.")}variant;loading=!1;loadingIcon;get hideTransitionOptions(){return this._hideTransitionOptions}set hideTransitionOptions(e){this._hideTransitionOptions=e,console.log("The hideTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.")}fluid=!1;breakpoint="960px";onChange=new w;onGroupChange=new w;onShow=new w;onHide=new w;onClear=new w;onBeforeShow=new w;onBeforeHide=new w;onFocus=new w;onBlur=new w;focusInputViewChild;containerViewChild;panelViewChild;overlayViewChild;valueTemplate;optionTemplate;headerTemplate;footerTemplate;triggerIconTemplate;loadingIconTemplate;groupIconTemplate;clearIconTemplate;_valueTemplate;_optionTemplate;_headerTemplate;_footerTemplate;_triggerIconTemplate;_loadingIconTemplate;_groupIconTemplate;_clearIconTemplate;_showTransitionOptions="";_hideTransitionOptions="";selectionPath=null;focused=!1;overlayVisible=!1;clicked=!1;dirty=!1;searchValue;searchTimeout;onModelChange=()=>{};onModelTouched=()=>{};focusedOptionInfo=V({index:-1,level:0,parentKey:""});activeOptionPath=V([]);modelValue=V(null);processedOptions=[];_componentStyle=K(Ot);initialized=!1;get containerClass(){return{"p-cascadeselect p-component p-inputwrapper":!0,"p-cascadeselect-clearable":this.showClear&&!this.disabled,"p-cascadeselect-mobile":this.queryMatches(),"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue(),"p-variant-filled":this.variant==="filled"||this.config.inputStyle()==="filled"||this.config.inputVariant()==="filled","p-inputwrapper-focus":this.focused||this.overlayVisible,"p-cascadeselect-open":this.overlayVisible,"p-cascadeselect-fluid":this.hasFluid,"p-cascadeselect-sm p-inputfield-sm":this.size==="small","p-cascadeselect-lg p-inputfield-lg":this.size==="large"}}get labelClass(){return{"p-cascadeselect-label":!0,"p-placeholder":this.label()===this.placeholder,"p-cascadeselect-label-empty":!this.value&&(this.label()==="p-emptylabel"||this.label().length===0)}}get hasFluid(){let n=this.el.nativeElement.closest("p-fluid");return this.fluid||!!n}get focusedOptionId(){return this.focusedOptionInfo().index!==-1?`${this.id}${C(this.focusedOptionInfo().parentKey)?"_"+this.focusedOptionInfo().parentKey:""}_${this.focusedOptionInfo().index}`:null}get filled(){return typeof this.modelValue()=="string"?!!this.modelValue():this.modelValue()||this.modelValue()!=null||this.modelValue()!=null}get searchResultMessageText(){return C(this.visibleOptions())?this.searchMessageText.replaceAll("{0}",this.visibleOptions().length):this.emptySearchMessageText}get searchMessageText(){return this.searchMessage||this.config.translation.searchMessage||""}get emptySearchMessageText(){return this.emptySearchMessage||this.config.translation.emptySearchMessage||""}get emptyMessageText(){return this.emptyMessage||this.config.translation.emptyMessage||""}get selectionMessageText(){return this.selectionMessage||this.config.translation.selectionMessage||""}get emptySelectionMessageText(){return this.emptySelectionMessage||this.config.translation.emptySelectionMessage||""}get selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText}visibleOptions=ge(()=>{let e=this.activeOptionPath().find(n=>n.key===this.focusedOptionInfo().parentKey);return e?e.children:this.processedOptions});label=ge(()=>{let e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption()){let n=this.findOptionPathByValue(this.modelValue(),null),i=C(n)?n[n.length-1]:null;return i?this.getOptionLabel(i.option):e}return e});get _label(){let e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption()){let n=this.findOptionPathByValue(this.modelValue(),null),i=C(n)?n[n.length-1]:null;return i?this.getOptionLabel(i.option):e}return e}templates;ngAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"value":this._valueTemplate=e.template;break;case"option":this._optionTemplate=e.template;break;case"triggericon":this._triggerIconTemplate=e.template;break;case"loadingicon":this._loadingIconTemplate=e.template;break;case"clearicon":this._clearIconTemplate=e.template;break;case"optiongroupicon":this._groupIconTemplate=e.template;break}})}ngOnChanges(e){super.ngOnChanges(e),e.options&&(this.processedOptions=this.createProcessedOptions(e.options.currentValue||[]),this.updateModel(null))}hasSelectedOption(){return C(this.modelValue())}createProcessedOptions(e,n=0,i={},o=""){let a=[];return e&&e.forEach((l,b)=>{let G=(o!==""?o+"_":"")+b,E={option:l,index:b,level:n,key:G,parent:i,parentKey:o};E.children=this.createProcessedOptions(this.getOptionGroupChildren(l,n),n+1,E,G),a.push(E)}),a}onInputFocus(e){this.disabled||(this.focused=!0,this.onFocus.emit(e))}onInputBlur(e){this.focused=!1,this.focusedOptionInfo.set({indeX:-1,level:0,parentKey:""}),this.searchValue="",this.onModelTouched(),this.onBlur.emit(e)}onInputKeyDown(e){if(this.disabled||this.loading){e.preventDefault();return}let n=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"Backspace":this.onBackspaceKey(e);break;case"PageDown":case"PageUp":case"ShiftLeft":case"ShiftRight":break;default:!n&&ct(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key));break}this.clicked=!1}onArrowDownKey(e){if(!this.overlayVisible)this.show();else{let n=this.focusedOptionInfo().index!==-1?this.findNextOptionIndex(this.focusedOptionInfo().index):this.clicked?this.findFirstOptionIndex():this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,n,!0)}e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedOptionInfo().index!==-1){let n=this.visibleOptions[this.focusedOptionInfo().index];!this.isProccessedOptionGroup(n)&&this.onOptionChange({originalEvent:e,processedOption:n})}this.overlayVisible&&this.hide(),e.preventDefault()}else{let n=this.focusedOptionInfo().index!==-1?this.findPrevOptionIndex(this.focusedOptionInfo().index):this.clicked?this.findLastOptionIndex():this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,n,!0),!this.overlayVisible&&this.show(),e.preventDefault()}}onArrowLeftKey(e){if(this.overlayVisible){let n=this.visibleOptions()[this.focusedOptionInfo().index],i=this.activeOptionPath().find(l=>l.key===n.parentKey),o=this.focusedOptionInfo().parentKey===""||i&&i.key===this.focusedOptionInfo().parentKey,a=ce(n.parent);if(o){let l=this.activeOptionPath().filter(b=>b.parentKey!==this.focusedOptionInfo().parentKey);this.activeOptionPath.set(l)}a||(this.focusedOptionInfo.set({index:-1,parentKey:i?i.parentKey:""}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}}onArrowRightKey(e){if(this.overlayVisible){let n=this.visibleOptions()[this.focusedOptionInfo().index];this.isProccessedOptionGroup(n)&&(this.activeOptionPath().some(a=>n.key===a.key)?(this.focusedOptionInfo.set({index:-1,parentKey:n.key}),this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:n})),e.preventDefault()}}onHomeKey(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()}onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()}onEnterKey(e){if(!this.overlayVisible)this.focusedOptionInfo.set(F(L({},this.focusedOptionInfo()),{index:-1})),this.onArrowDownKey(e);else if(this.focusedOptionInfo().index!==-1){let n=this.visibleOptions()[this.focusedOptionInfo().index],i=this.isProccessedOptionGroup(n);this.onOptionClick({originalEvent:e,processedOption:n}),!i&&this.hide()}e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.overlayVisible&&this.hide(e,!0),e.preventDefault()}onTabKey(e){if(this.focusedOptionInfo().index!==-1){let n=this.visibleOptions()[this.focusedOptionInfo().index];!this.isProccessedOptionGroup(n)&&this.onOptionChange({originalEvent:e,processedOption:n})}this.overlayVisible&&this.hide()}onBackspaceKey(e){C(this.modelValue())&&this.showClear&&this.clear(),e.stopPropagation()}equalityKey(){return this.optionValue?null:this.dataKey}updateModel(e,n){this.value=e,this.onModelChange(e),this.modelValue.set(e),this.initialized&&this.onChange.emit({originalEvent:n,value:e})}autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption()&&(this.focusedOptionInfo().index=this.findFirstFocusedOptionIndex(),this.onOptionChange({originalEvent:null,processedOption:this.visibleOptions()[this.focusedOptionInfo().index],isHide:!1}),!this.overlayVisible&&this.focusedOptionInfo.set({index:-1,level:0,parentKey:""}))}scrollInView(e=-1){let n=e!==-1?`${this.id}_${e}`:this.focusedOptionId,i=ot(this.panelViewChild?.nativeElement,`li[id="${n}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})}changeFocusedOptionIndex(e,n,i){let o=this.focusedOptionInfo();o.index!==n&&(this.focusedOptionInfo.set(F(L({},o),{index:n})),this.scrollInView(),this.focusOnHover&&this.onOptionClick({originalEvent:e,processedOption:this.visibleOptions()[n],isHide:!1,preventSelection:i}),this.selectOnFocus&&this.onOptionChange({originalEvent:e,processedOption:this.visibleOptions()[n],isHide:!1}))}matchMediaListener;onOptionSelect(e){let{originalEvent:n,value:i,isHide:o}=e,a=this.getOptionValue(i),l=this.activeOptionPath();l.forEach(b=>b.selected=!0),this.activeOptionPath.set(l),this.updateModel(a,n),o&&this.hide(e,!0)}onOptionGroupSelect(e){this.dirty=!0,this.onGroupChange.emit(e)}onContainerClick(e){this.disabled||this.loading||(this.overlayViewChild?.el?.nativeElement?.contains(e.target)||(this.overlayVisible?this.hide():this.show(),this.focusInputViewChild?.nativeElement.focus()),this.clicked=!0)}isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))}isOptionDisabled(e){return this.optionDisabled?M(e,this.optionDisabled):!1}isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)}isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)}isSelected(e){return this.activeOptionPath().some(n=>n.key===e.key)}findOptionPathByValue(e,n,i=0){if(n=n||i===0&&this.processedOptions,!n)return null;if(ce(e))return[];for(let o=0;o<n.length;o++){let a=n[o];if(Oe(e,this.getOptionValue(a.option),this.equalityKey()))return[a];let l=this.findOptionPathByValue(e,a.children,i+1);if(l)return l.unshift(a),l}}findFirstOptionIndex(){return this.visibleOptions().findIndex(e=>this.isValidOption(e))}findLastOptionIndex(){return ve(this.visibleOptions(),e=>this.isValidOption(e))}findNextOptionIndex(e){let n=e<this.visibleOptions().length-1?this.visibleOptions().slice(e+1).findIndex(i=>this.isValidOption(i)):-1;return n>-1?n+e+1:e}findPrevOptionIndex(e){let n=e>0?ve(this.visibleOptions().slice(0,e),i=>this.isValidOption(i)):-1;return n>-1?n:e}findSelectedOptionIndex(){return this.visibleOptions().findIndex(e=>this.isValidSelectedOption(e))}findFirstFocusedOptionIndex(){let e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e}findLastFocusedOptionIndex(){let e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e}searchOptions(e,n){this.searchValue=(this.searchValue||"")+n;let i=-1,o=!1,a=this.focusedOptionInfo();return a.index!==-1?(i=this.visibleOptions().slice(a.index).findIndex(l=>this.isOptionMatched(l)),i=i===-1?this.visibleOptions().slice(0,a.index).findIndex(l=>this.isOptionMatched(l)):i+a.index):i=this.visibleOptions().findIndex(l=>this.isOptionMatched(l)),i!==-1&&(o=!0),i===-1&&a.index===-1&&(i=this.findFirstFocusedOptionIndex()),i!==-1&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}hide(e,n=!1){let i=()=>{this.overlayVisible=!1,this.clicked=!1,this.activeOptionPath.set([]),this.focusedOptionInfo.set({index:-1,level:0,parentKey:""}),n&&se(this.focusInputViewChild.nativeElement),this.onHide.emit(e),this.cd.markForCheck()};setTimeout(()=>{i()},0)}show(e,n=!1){this.onShow.emit(e),this.overlayVisible=!0;let i=this.hasSelectedOption()?this.findOptionPathByValue(this.modelValue()):this.activeOptionPath();this.activeOptionPath.set(i);let o;if(this.hasSelectedOption()&&C(this.activeOptionPath())){let a=this.activeOptionPath()[this.activeOptionPath().length-1];o={index:a.index,level:a.level,parentKey:a.parentKey}}else o={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),level:0,parentKey:""};this.focusedOptionInfo.set(o),n&&se(this.focusInputViewChild.nativeElement)}clear(e){C(this.modelValue())&&this.showClear&&(this.updateModel(null),this.focusedOptionInfo.set({index:-1,level:0,parentKey:""}),this.activeOptionPath.set([]),this.onClear.emit()),e&&e.stopPropagation()}getOptionLabel(e){return this.optionLabel?M(e,this.optionLabel):e}getOptionValue(e){return this.optionValue?M(e,this.optionValue):e}getOptionGroupLabel(e){return this.optionGroupLabel?M(e,this.optionGroupLabel):null}getOptionGroupChildren(e,n){return M(e,this.optionGroupChildren[n])}isOptionGroup(e,n){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[n])}isProccessedOptionGroup(e){return C(e?.children)}getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option):this.getOptionLabel(e.option)}constructor(e){super(),this.overlayService=e,De(()=>{let n=this.activeOptionPath();C(n)&&this.overlayViewChild.alignOverlay()})}query;queryMatches=V(!1);mobileActive=V(!1);onOptionChange(e){let{processedOption:n,type:i}=e;if(ce(n))return;let{index:o,key:a,level:l,parentKey:b,children:G}=n,E=C(G),D=this.activeOptionPath().filter(X=>X.parentKey!==b&&X.parentKey!==a);this.focusedOptionInfo.set({index:o,level:l,parentKey:b}),!(i=="hover"&&this.queryMatches())&&(E&&D.push(n),this.activeOptionPath.set([...D]))}onOptionClick(e){let{originalEvent:n,processedOption:i,isFocus:o,isHide:a,preventSelection:l}=e,{index:b,key:G,level:E,parentKey:D}=i,X=this.isProccessedOptionGroup(i);if(this.isSelected(i)){let J=this.activeOptionPath().filter(Y=>G!==Y.key&&G.startsWith(Y.key));this.activeOptionPath.set([...J]),this.focusedOptionInfo.set({index:b,level:E,parentKey:D})}else if(X)this.onOptionChange(e),this.onOptionGroupSelect({originalEvent:n,value:i.option,isFocus:!1});else{let J=this.activeOptionPath().filter(Y=>Y.parentKey!==D);J.push(i),this.focusedOptionInfo.set({index:b,level:E,parentKey:D}),(!l||i?.children.length!==0)&&(this.activeOptionPath.set([...J]),this.onOptionSelect({originalEvent:n,value:i.option,isHide:o}))}o&&se(this.focusInputViewChild.nativeElement)}onOptionMouseEnter(e){this.focusOnHover&&(this.dirty||!this.dirty&&C(this.modelValue())?this.onOptionChange(F(L({},e),{type:"hover"})):!this.dirty&&e.processedOption.level===0&&this.onOptionClick(F(L({},e),{type:"hover"})))}onOptionMouseMove(e){this.focused&&this.focusOnHover&&this.changeFocusedOptionIndex(e,e.processedOption.index)}ngOnInit(){super.ngOnInit(),this.id=this.id||lt("pn_id_"),this.autoUpdateModel(),this.bindMatchMediaListener()}ngAfterViewInit(){super.ngAfterViewInit(),this.initialized=!0}bindMatchMediaListener(){if(!this.matchMediaListener){let e=this.document.defaultView;if(e&&e.matchMedia){let n=e.matchMedia(`(max-width: ${this.breakpoint})`);this.query=n,this.queryMatches.set(n?.matches),this.matchMediaListener=()=>{this.queryMatches.set(n?.matches),this.mobileActive.set(!1)},this.query.addEventListener("change",this.matchMediaListener)}}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}onOverlayAnimationDone(e){switch(e.toState){case"void":this.dirty=!1;break}}writeValue(e){this.value=e,this.updateModel(e),this.cd.markForCheck()}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.disabled=e,this.cd.markForCheck()}ngOnDestroy(){this.matchMediaListener&&this.unbindMatchMediaListener()}static \u0275fac=function(n){return new(n||t)(re(pt))};static \u0275cmp=A({type:t,selectors:[["p-cascadeSelect"],["p-cascadeselect"],["p-cascade-select"]],contentQueries:function(n,i,o){if(n&1&&(k(o,Gt,4),k(o,Pt,4),k(o,$t,4),k(o,Dt,4),k(o,Kt,4),k(o,Rt,4),k(o,At,4),k(o,Bt,4),k(o,dt,4)),n&2){let a;O(a=v())&&(i.valueTemplate=a.first),O(a=v())&&(i.optionTemplate=a.first),O(a=v())&&(i.headerTemplate=a.first),O(a=v())&&(i.footerTemplate=a.first),O(a=v())&&(i.triggerIconTemplate=a.first),O(a=v())&&(i.loadingIconTemplate=a.first),O(a=v())&&(i.groupIconTemplate=a.first),O(a=v())&&(i.clearIconTemplate=a.first),O(a=v())&&(i.templates=a)}},viewQuery:function(n,i){if(n&1&&(B(Nt,5),B(Ht,5),B(qt,5),B(zt,5)),n&2){let o;O(o=v())&&(i.focusInputViewChild=o.first),O(o=v())&&(i.containerViewChild=o.first),O(o=v())&&(i.panelViewChild=o.first),O(o=v())&&(i.overlayViewChild=o.first)}},inputs:{id:"id",searchMessage:"searchMessage",emptyMessage:"emptyMessage",selectionMessage:"selectionMessage",emptySearchMessage:"emptySearchMessage",emptySelectionMessage:"emptySelectionMessage",searchLocale:"searchLocale",optionDisabled:"optionDisabled",focusOnHover:[2,"focusOnHover","focusOnHover",S],selectOnFocus:[2,"selectOnFocus","selectOnFocus",S],autoOptionFocus:[2,"autoOptionFocus","autoOptionFocus",S],styleClass:"styleClass",style:"style",options:"options",optionLabel:"optionLabel",optionValue:"optionValue",optionGroupLabel:"optionGroupLabel",optionGroupChildren:"optionGroupChildren",placeholder:"placeholder",value:"value",dataKey:"dataKey",inputId:"inputId",size:"size",tabindex:[2,"tabindex","tabindex",me],ariaLabelledBy:"ariaLabelledBy",inputLabel:"inputLabel",ariaLabel:"ariaLabel",appendTo:"appendTo",disabled:[2,"disabled","disabled",S],showClear:[2,"showClear","showClear",S],panelStyleClass:"panelStyleClass",panelStyle:"panelStyle",overlayOptions:"overlayOptions",autofocus:[2,"autofocus","autofocus",S],showTransitionOptions:"showTransitionOptions",variant:"variant",loading:[2,"loading","loading",S],loadingIcon:"loadingIcon",hideTransitionOptions:"hideTransitionOptions",fluid:[2,"fluid","fluid",S],breakpoint:"breakpoint"},outputs:{onChange:"onChange",onGroupChange:"onGroupChange",onShow:"onShow",onHide:"onHide",onClear:"onClear",onBeforeShow:"onBeforeShow",onBeforeHide:"onBeforeHide",onFocus:"onFocus",onBlur:"onBlur"},features:[ie([vi,Ot]),pe,Ve],decls:20,vars:34,consts:[["container",""],["focusInput",""],["defaultValueTemplate",""],["elseBlock",""],["overlay",""],["content",""],["panel",""],[3,"click","ngClass","ngStyle"],[1,"p-hidden-accessible"],["readonly","","type","text","role","combobox","aria-haspopup","tree",3,"focus","blur","keydown","disabled","placeholder","tabindex","pAutoFocus"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[4,"ngIf"],["role","button","aria-haspopup","listbox",1,"p-cascadeselect-dropdown"],["role","status","aria-live","polite",1,"p-hidden-accessible"],[3,"visibleChange","onAnimationDone","onBeforeShow","onShow","onBeforeHide","onHide","visible","options","target","appendTo","showTransitionOptions","hideTransitionOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","p-cascadeselect-clear-icon",3,"click",4,"ngIf"],[1,"p-cascadeselect-clear-icon",3,"click"],[4,"ngTemplateOutlet"],["aria-hidden","true",3,"ngClass",4,"ngIf"],["aria-hidden","true",3,"class",4,"ngIf"],["aria-hidden","true",3,"ngClass"],["aria-hidden","true"],[3,"styleClass",4,"ngIf"],["class","p-cascadeselect-dropdown-icon",4,"ngIf"],[3,"styleClass"],[1,"p-cascadeselect-dropdown-icon"],[3,"ngClass","ngStyle"],[1,"p-cascadeselect-list-container"],[3,"onChange","onFocusChange","onFocusEnterChange","options","selectId","focusedOptionId","activeOptionPath","optionLabel","optionValue","level","optionTemplate","groupicon","optionGroupLabel","optionGroupChildren","optionDisabled","root","dirty","role"]],template:function(n,i){if(n&1){let o=T();d(0,"div",7,0),y("click",function(l){return h(o),f(i.onContainerClick(l))}),d(2,"div",8)(3,"input",9,1),y("focus",function(l){return h(o),f(i.onInputFocus(l))})("blur",function(l){return h(o),f(i.onInputBlur(l))})("keydown",function(l){return h(o),f(i.onInputKeyDown(l))}),u()(),d(5,"span",10),m(6,jt,2,5,"ng-container",11)(7,Xt,1,1,"ng-template",null,2,Q),u(),m(9,ti,3,2,"ng-container",12),d(10,"div",13),m(11,ci,3,2,"ng-container",11)(12,ui,2,2,"ng-template",null,3,Q),u(),d(14,"span",14),g(15),u(),d(16,"p-overlay",15,4),q("visibleChange",function(l){return h(o),H(i.overlayVisible,l)||(i.overlayVisible=l),f(l)}),y("onAnimationDone",function(l){return h(o),f(i.onOverlayAnimationDone(l))})("onBeforeShow",function(l){return h(o),f(i.onBeforeShow.emit(l))})("onShow",function(l){return h(o),f(i.show(l))})("onBeforeHide",function(l){return h(o),f(i.onBeforeHide.emit(l))})("onHide",function(l){return h(o),f(i.hide(l))}),m(18,_i,8,26,"ng-template",null,5,Q),u()()}if(n&2){let o,a,l=te(8),b=te(13);Z(i.styleClass),r("ngClass",i.containerClass)("ngStyle",i.style),_("data-pc-name","cascadeselect")("data-pc-section","root"),c(2),_("data-pc-section","hiddenInputWrapper"),c(),r("disabled",i.disabled)("placeholder",i.placeholder)("tabindex",i.disabled?-1:i.tabindex)("pAutoFocus",i.autofocus),_("id",i.inputId)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledBy)("aria-expanded",(o=i.overlayVisible)!==null&&o!==void 0?o:!1)("aria-controls",i.overlayVisible?i.id+"_tree":null)("aria-activedescendant",i.focused?i.focusedOptionId:void 0),c(2),r("ngClass",i.labelClass),_("data-pc-section","label"),c(),r("ngIf",i.valueTemplate||i._valueTemplate)("ngIfElse",l),c(3),r("ngIf",i.filled&&!i.disabled&&i.showClear),c(),_("aria-expanded",(a=i.overlayVisible)!==null&&a!==void 0?a:!1)("data-pc-section","dropdownIcon")("aria-hidden",!0),c(),r("ngIf",i.loading)("ngIfElse",b),c(4),$(" ",i.searchResultMessageText," "),c(),N("visible",i.overlayVisible),r("options",i.overlayOptions)("target","@parent")("appendTo",i.appendTo)("showTransitionOptions",i.showTransitionOptions)("hideTransitionOptions",i.hideTransitionOptions)}},dependencies:[W,_e,ye,be,Re,_t,ht,Ci,mt,gt,U],encapsulation:2,changeDetection:0})}return t})(),vt=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Me({type:t});static \u0275inj=Se({imports:[j,U,U]})}return t})();var xi=()=>({minWidth:"100%"}),Ii=()=>["Roles"],Ti=t=>({ID:t});function Si(t,s){if(t&1){let e=T();d(0,"button",13),y("click",function(){h(e);let i=p(2);return f(i.onDeleteGroup())}),P(1,"i",14),g(2),u()}if(t&2){let e,n=p(2);c(2),$(" Delete (",(e=n.selectedGroups())==null?null:e.length,") ")}}function Vi(t,s){if(t&1&&(x(0),m(1,Si,3,1,"button",12),I()),t&2){let e,n=p();c(),de(((e=n.selectedGroups())==null?null:e.length)>0?1:-1)}}function ki(t,s){t&1&&(x(0),d(1,"a",15),g(2," Add"),u(),I())}function Mi(t,s){if(t&1){let e=T();x(0),d(1,"th",16)(2,"div",17)(3,"input",18),y("change",function(i){h(e);let o=p(),a=he(0);return f(o.onCheckAllGroups(i==null||i.target==null?null:i.target.checked,a==null?null:a.Data))}),u()()(),I()}}function Ei(t,s){if(t&1){let e=T();x(0),d(1,"td")(2,"div",17)(3,"input",20),q("ngModelChange",function(i){h(e);let o=p().$implicit;return H(o.checked,i)||(o.checked=i),f(i)}),y("ngModelChange",function(){h(e);let i=p(2),o=he(0);return f(i.onSelectGroup(o==null?null:o.Data))}),u()()(),I()}if(t&2){let e=p().$implicit;c(3),N("ngModel",e.checked)}}function Li(t,s){if(t&1&&(d(0,"a",19),g(1),u()),t&2){let e=p().$implicit;r("queryParams",z(2,Ti,e.ID)),c(),$(" ",e.Name," ")}}function Fi(t,s){if(t&1&&(d(0,"span"),g(1),u()),t&2){let e=p().$implicit;c(),R(e.Name)}}function Gi(t,s){if(t&1&&(d(0,"tr"),m(1,Ei,4,1,"ng-container",1),d(2,"td"),m(3,Li,2,4,"a",19)(4,Fi,2,1,"span"),u(),d(5,"td"),g(6),u(),d(7,"td"),g(8),ne(9,"number"),u()()),t&2){let e=s.$implicit,n=p();c(),r("ngxPermissionsOnly",n.userDeleteRole),c(2),de(n.hasUserEditRole()?3:4),c(3),R(e.Description),c(2),R(oe(9,4,e.Count))}}var xn=(()=>{class t{constructor(){this.permissionService=K(Xe),this.groupsService=K(we),this.toastr=K(je),this.groupLoader$=this.groupsService.getGroupsLoader().pipe(le(1)),this.groups$=xe({Count:0,Data:[]}),this.filter=V({PageNumber:1,PageSize:100,Role:null}),this.selectedGroups=V([]),this.userCreateRole=ae.UserInvite,this.userDeleteRole=ae.UserDelete,this.hasUserEditRole=V(!1),this.initGroup(),this.permissionService.hasPermission(ae.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initGroup(){this.groups$=this.groupsService.getGroups(this.filter()).pipe(le(1))}onCheckAllGroups(e,n){n.forEach(o=>{o.checked=e});let i=n.filter(o=>o.checked);this.selectedGroups.set(i)}onSelectGroup(e){this.selectedGroups.set(e.filter(n=>n.checked))}onDeleteGroup(){if(confirm("Are you sure you want to delete the selected groups?")){let n=this.selectedGroups().map(i=>i.ID);this.groupsService.deleteGroups(n).subscribe({next:()=>{this.selectedGroups.set([]),this.toastr.success("Groups deleted successfully","Success"),this.initGroup()}})}}onNextPage(){this.filter.update(e=>F(L({},e),{PageNumber:e.PageNumber+1})),this.initGroup()}onPrevPage(){this.filter.update(e=>F(L({},e),{PageNumber:e.PageNumber-1})),this.initGroup()}onFilter(){this.initGroup()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-groups"]],features:[ie([we])],decls:31,vars:21,consts:[["headerTitle","Groups",3,"onSubmit","hideSearchBox","hideSearchDropdown"],[4,"ngxPermissionsOnly"],[1,"w-100"],[1,"d-block","fs-5","mb-2"],["appendTo","body","optionLabel","Name","optionGroupLabel","Name","optionValue","ID","placeholder","Select a Role",3,"ngModelChange","options","ngModel","optionGroupChildren"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],["routerLink","/menu/users/groups/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["type","checkbox",3,"change"],["routerLink","/menu/users/groups/info",3,"queryParams"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(n,i){if(n&1){let o=T();ue(0),ne(1,"async"),ue(2),ne(3,"async"),d(4,"mainpanel",0),y("onSubmit",function(){return h(o),f(i.onFilter())}),d(5,"actions"),m(6,Vi,2,1,"ng-container",1)(7,ki,3,0,"ng-container",1),u(),d(8,"filters")(9,"div",2)(10,"span",3),g(11,"Roles"),u(),d(12,"p-cascadeselect",4),q("ngModelChange",function(l){return h(o),H(i.filter().Role,l)||(i.filter().Role=l),f(l)}),u()()(),d(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),m(20,Mi,4,0,"ng-container",1),d(21,"th",10),g(22,"Name"),u(),d(23,"th"),g(24,"Description"),u(),d(25,"th"),g(26,"Role Count"),u()()(),d(27,"tbody"),Fe(28,Gi,10,6,"tr",null,Le),u()(),d(30,"app-mat-paginator-no-count",11),y("next",function(){return h(o),f(i.onNextPage())})("previous",function(){return h(o),f(i.onPrevPage())}),u()()()()()()}if(n&2){let o=Pe(oe(1,14,i.groups$)),a=oe(3,17,i.groupLoader$);c(4),r("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),r("ngxPermissionsOnly",i.userDeleteRole),c(),r("ngxPermissionsOnly",i.userCreateRole),c(5),Ee(fe(19,xi)),r("options",a==null?null:a.Options),N("ngModel",i.filter().Role),r("optionGroupChildren",fe(20,Ii)),c(8),r("ngxPermissionsOnly",i.userDeleteRole),c(8),Ge(o==null?null:o.Data),c(2),r("filter",i.filter())("totaldata",o==null||o.Data==null?null:o.Data.length)("paginationTotal",o==null?null:o.Count)("hasClicked",!0)}},dependencies:[W,Ae,Be,et,Ze,He,Ne,bt,vt,j,Ye,Je,Ue,ze,Qe,We],styles:["p-cascadeselect>.p-cascadeselect{width:100%}"]})}}return t})();export{xn as GroupsComponent};
|