import{d as P}from"./chunk-T6NRFYFX.js";import{O as c}from"./chunk-57DG2VC5.js";import{h as T}from"./chunk-NMMBNW5X.js";import{a as A}from"./chunk-CVFNZXIB.js";import{c as b}from"./chunk-XALE2GEX.js";import{c as F}from"./chunk-GJIGZB63.js";import{b as O}from"./chunk-5VDVFGVW.js";import{Ba as m,Ca as g,Eb as D,Kb as l,Lc as I,Vb as o,cc as d,dc as p,ec as v,fc as C,gc as h,ic as w,lc as _,nc as s,rb as a,sb as u,td as L,uc as y,ud as V,vc as x,wc as M}from"./chunk-J476KISY.js";var R=()=>({});function S(t,f){if(t&1){let e=w();d(0,"div",5)(1,"paw-filters",6),_("filter",function(n){m(e);let r=s();return g(r.onFilter(n))}),p()()}if(t&2){let e=s();a(),o("storageId",e.listDef.filtersDef.storageId)("fields",e.listDef.filtersDef.fields)("filterModel",e.listDef.filtersDef.model)("filtersConfig",e.listDef.filtersDef.filterConfig||I(6,R))("onClearModel",e.listDef.filtersDef.onClear)("focusFieldId",e.listDef.filtersDef.focusFieldId)}}function E(t,f){if(t&1){let e=w();d(0,"div",7)(1,"paw-datagrid",8),_("ready",function(n){m(e);let r=s();return g(r.onGridReady(n))}),p()()}if(t&2){let e=s();a(),o("manualLoad",!!(e.listDef.filtersDef!=null&&e.listDef.filtersDef.storageId))("cols",e.listDef.columnsDef)("settings",e.listDef.gridSettings)}}function G(t,f){if(t&1&&v(0,"paw-action",13),t&2){let e=s().$implicit,i=s(2);o("action",e)("model",i.gridApi==null?null:i.gridApi.selection)}}function Q(t,f){if(t&1&&(C(0),l(1,G,1,2,"paw-action",12),h()),t&2){let e=f.$implicit;a(),o("ngIf",e.isDisplayed!==!1)}}function j(t,f){if(t&1&&(d(0,"div",9)(1,"div",10),l(2,Q,2,1,"ng-container",11),p()()),t&2){let e=s();a(2),o("ngForOf",e.listDef.listActions)}}var W=(()=>{class t{constructor(e){this.translate=e,this.filterInputMatOptions={appearance:"outline"},this.filterFormGroup=new T([]),this.getLocaleText=i=>this.translate.instant(i.key),this.debounceLoad=A.debounce(()=>{this.gridApi?.reloadData()})}onGridReady(e){this.gridApi=e,O.isFunction(this.onListDatagridReady)&&this.onListDatagridReady(e)}onFilter(e){this.listDef?.filtersDef?.model&&Object.assign(this.listDef.filtersDef.model,e),this.gridApi?.reloadData()}static{this.\u0275fac=function(i){return new(i||t)(u(F))}}static{this.\u0275cmp=D({type:t,selectors:[["paw-main-view-list"]],viewQuery:function(i,n){if(i&1&&y(c,5),i&2){let r;x(r=M())&&(n.datagrid=r.first)}},inputs:{dialogRef:"dialogRef",listDef:"listDef",onListDatagridReady:"onListDatagridReady"},standalone:!1,decls:5,vars:3,consts:[[1,"paw-holder","paw-area-v","paw-main-view-list-holder"],["class","paw-col paw-padding-left-m paw-padding-right-m paw-padding-bottom-s paw-padding-top-s",4,"ngIf"],[1,"paw-col-d"],["class","paw-holder paw-nooverflow table-body paw-area-v","id","gridholder",4,"ngIf"],["class","paw-col paw-offset-left paw-offset-right paw-offset-top-s",4,"ngIf"],[1,"paw-col","paw-padding-left-m","paw-padding-right-m","paw-padding-bottom-s","paw-padding-top-s"],[3,"filter","storageId","fields","filterModel","filtersConfig","onClearModel","focusFieldId"],["id","gridholder",1,"paw-holder","paw-nooverflow","table-body","paw-area-v"],[1,"paw-holder",3,"ready","manualLoad","cols","settings"],[1,"paw-col","paw-offset-left","paw-offset-right","paw-offset-top-s"],[1,"paw-list-actions"],[4,"ngFor","ngForOf"],["type","paw-icon-btn",3,"action","model",4,"ngIf"],["type","paw-icon-btn",3,"action","model"]],template:function(i,n){i&1&&(d(0,"div",0),l(1,S,2,7,"div",1),d(2,"div",2),l(3,E,2,3,"div",3),p(),l(4,j,3,1,"div",4),p()),i&2&&(a(),o("ngIf",n.listDef.filtersDef),a(2),o("ngIf",n.listDef.columnsDef&&n.listDef.gridSettings),a(),o("ngIf",n.listDef.listActions&&n.listDef.listActions.length>0))},dependencies:[L,V,b,c,P],styles:["[_nghost-%COMP%]   .paw-main-view-list-holder[_ngcontent-%COMP%]{height:80vh}[_nghost-%COMP%]   .paw-list-actions[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center;justify-content:flex-end;padding:8px 0;border-top:1px solid var(--paw-color-divider)}[_nghost-%COMP%]   .paw-list-actions[_ngcontent-%COMP%]   paw-action[_ngcontent-%COMP%]{flex-shrink:0}@media (max-width: 640px){[_nghost-%COMP%]   .paw-main-view-list-holder[_ngcontent-%COMP%]{height:100%}}"]})}}return t})();export{W as a};
