import{a as k}from"./chunk-RFO27VXV.js";import{a as j}from"./chunk-IRW2X3SS.js";import{a as C}from"./chunk-4FOEVBXN.js";import{a as V}from"./chunk-WKOH7QOZ.js";import{c as D}from"./chunk-DFDVJJF5.js";import"./chunk-3WETVYFL.js";import"./chunk-3K6OG4X3.js";import"./chunk-AQH4B3NW.js";import{a as R}from"./chunk-3LM5OI6G.js";import{k as m}from"./chunk-OGY335Z5.js";import{p as b}from"./chunk-RAGTUOY6.js";import"./chunk-FCHM4KKB.js";import"./chunk-QICOL66Z.js";import"./chunk-WEYT6MSP.js";import"./chunk-YCONLW35.js";import{q as I,r as G,u as L,v as q}from"./chunk-DYEAP73Z.js";import"./chunk-W5A7VAW2.js";import"./chunk-UGQL4IPH.js";import"./chunk-4TDNJBFX.js";import"./chunk-LI2NM675.js";import"./chunk-72BQRPR2.js";import"./chunk-RGMIUFM4.js";import"./chunk-I6HXBYFU.js";import{k as A,p as F}from"./chunk-AVXTYPYF.js";import"./chunk-HNZDUL32.js";import"./chunk-5EZRMHVZ.js";import{$b as u,Kb as S,Lb as y,Nd as P,Ob as _,Td as E,a as c,ic as h,jc as w,od as M,ra as v,rc as g,xb as f,yb as n}from"./chunk-HEIW4SFT.js";E();G();M();q();var N=(()=>{class o extends j{constructor(t,s,i,a){super(),this.postalCodesService=t,this.apiService=s,this.router=i,this.viewSwitchService=a,this.postalCodesFilterFields=[{id:"keywords",component:b,label:"SearchFilter",icon:"far fa-search"}],this.filterModel={keywords:""},this.filtersConfig={keywords:{isPinned:!0}},this.columns=[{id:"post",colId:"AcPost",label:"Code",width:100,pinned:"left",render:{component:C,params:{getParams:e=>({label:e.post,link:["/postal-codes/postal-codes-main/edit",e.post]})}}},{id:"name",colId:"AcName",label:"Name",flex:1,render:{component:C,params:{getParams:e=>{let l=e.name&&e.name.trim()!=="";return{label:l?e.name:"",link:l?["/postal-codes/postal-codes-main/edit",e.post]:null}}}}}],this.settings={id:"postal-codes-list",selectableRows:!1,loadData:(e,l,d)=>{let r={Start:e,Length:l-e};d?.column&&(r.SortColumn=d.column),d?.order&&(r.SortOrder=d.order),this.filterModel.keywords&&(r.Keywords=this.filterModel.keywords);let T=new URLSearchParams;Object.keys(r).forEach(p=>{r[p]!==null&&r[p]!==void 0&&T.append(p,r[p].toString())});let O=`${I.postalCodes.list}`;return this.apiService.post(O,r)}}}ngOnInit(){this.setViewActions(),this.viewSwitchService.unset()}ngOnDestroy(){this.postalCodesService.unset(),this.viewSwitchService.unset()}setViewActions(){this.mainView?.setViewActions(this.getViewActions())}getViewActions(){return[{id:"create",icon:"far fa-file",type:"paw-action-icon",onSelected:()=>this.createPostalCode()}]}createPostalCode(){this.router.navigate(["/postal-codes/postal-codes-main/create"])}onFilter(t){t&&(this.filterModel=c(c({},this.filterModel),t),this.gridApi&&this.gridApi.reloadData())}onGridReady(t){this.gridApi=t}onRowSelected(t){t.post&&this.router.navigate(["/postal-codes/postal-codes-main/edit",t.post])}static{this.\u0275fac=function(s){return new(s||o)(n(k),n(L),n(A),n(R))}}static{this.\u0275cmp=S({type:o,selectors:[["paw-postal-codes-list"]],standalone:!1,features:[_],decls:5,vars:5,consts:[[1,"paw-area-v","paw-holder"],[1,"paw-col","paw-content-bg","paw-padding-bottom-s","paw-padding-top-s","paw-padding-left-m","paw-padding-right-m"],[3,"filter","fields","filterModel","filtersConfig"],[1,"paw-col-d"],[3,"ready","rowSelected","cols","settings"]],template:function(s,i){s&1&&(h(0,"div",0)(1,"div",1)(2,"paw-filters",2),g("filter",function(e){return i.onFilter(e)}),w()(),h(3,"div",3)(4,"paw-datagrid",4),g("ready",function(e){return i.onGridReady(e)})("rowSelected",function(e){return i.onRowSelected(e)}),w()()()),s&2&&(f(2),u("fields",i.postalCodesFilterFields)("filterModel",i.filterModel)("filtersConfig",i.filtersConfig),f(2),u("cols",i.columns)("settings",i.settings))},dependencies:[m,D],encapsulation:2})}}return o})();M();var re=(()=>{class o{static{this.\u0275fac=function(s){return new(s||o)}}static{this.\u0275mod=y({type:o})}static{this.\u0275inj=v({imports:[P,m,V,F.forChild([{path:"",component:N}])]})}}return o})();export{re as PostalCodesListModule};
