@genesislcap/design-system-configurator 15.30.0 → 15.30.1
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/dist/{445.445.9c66df79c519fa1fa363.js → 445.445.5773584467e5d79e6717.js} +36 -36
- package/dist/445.ccbb471b8bb9a704f7d9cc0073f43a58.js.map +1 -0
- package/dist/625.295a96ecbe30dd36ea5fc96aad3716f6.js.map +1 -0
- package/dist/{625.625.3590b415be6d93af448a.js → 625.625.19d1f86043f46d3fa132.js} +25 -25
- package/dist/{designSystemConfigurator.3a8a7dba3d31c0e4d858b683a860da9c.js.map → designSystemConfigurator.d2aa0f210f8ca1dc0ccf26ced8c8abeb.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/{main.9fab2e699769561f832d.js → main.2798bb968e5b27a100c8.js} +2 -2
- package/dist/{main.cd84d1738ff59d8c83773c118f951fb1.js.map → main.3bafc65bacb95b76e2a532080e332fd9.js.map} +1 -1
- package/dist/remoteEntry.js +2 -2
- package/package.json +12 -12
- package/dist/445.89ec4f122116ddbba4de80ee39b92863.js.map +0 -1
- package/dist/625.42381f2af39debff45aa0e4b863e605b.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[625],{41492(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(r,a,s){var o=a.prototype;s.utc=function(e){return new a({date:e,utc:!0,args:arguments})},o.utc=function(t){var i=s(this.toDate(),{locale:this.$L,utc:!0});return t?i.add(this.utcOffset(),e):i},o.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var n=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),n.call(this,e)};var l=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var d=o.utcOffset;o.utcOffset=function(r,a){var s=this.$utils().u;if(s(r))return this.$u?0:s(this.$offset)?d.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var a=(""+r[0]).match(i)||["-",0,0],s=a[0],o=60*+a[1]+ +a[2];return 0===o?0:"+"===s?o:-o}(r),null===r))return this;var o=Math.abs(r)<=16?60*r:r;if(0===o)return this.utc(a);var n=this.clone();if(a)return n.$offset=o,n.$u=!1,n;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(n=this.local().add(o+l,e)).$offset=o,n.$x.$localOffset=l,n};var c=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var g=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=o.diff;o.diff=function(e,t,i){if(e&&this.$u===e.$u)return h.call(this,e,t,i);var r=this.local(),a=s(e).local();return h.call(r,a,t,i)}}}()},86770(e,t,i){"use strict";i.r(t),i.d(t,{AG_BOOLEAN_PROPERTIES:()=>Ft.ME,AG_NUMBER_PROPERTIES:()=>Ft.LB,AG_PROPERTIES:()=>Ft.zI,ActionRenderer:()=>R.eA,ActionsMenuRenderer:()=>k.cN,AgGridCSSVars:()=>s.W3,AgGridTheme:()=>s.mJ,AgTextFieldRenderer:()=>wi.p8,AgTextRenderer:()=>Wt.t,BooleanRenderer:()=>I._Y,COLUMN_PICKER_SORT_DEFAULT:()=>Ye,CellTemplate:()=>Si.x,ColumnSelection:()=>pt,ColumnTemplate:()=>Ri.R,DARK_BACKGROUND_HEX:()=>le,DARK_BORDER_HEX:()=>de,DARK_FOREGROUND_HEX:()=>oe,DARK_HEADER_FOREGROUND_HEX:()=>ne,DARK_ROW_HOVER_HEX:()=>ce,DEBOUNCED_RESIZE_TIME:()=>Ft.BW,DEFAULT_STATUS_BAR_CONFIG:()=>s.o2,DISPLAY_NONE_CLASS:()=>di,DatasourceRowMatchTracker:()=>ki,DateEditor:()=>f.S8,EDITED_COLUMN_FIELD:()=>s.A7,ERROR_COLUMN_FIELD:()=>s.h1,EditableRenderer:()=>L.YM,EnumColumnFilter:()=>Ue,EnumColumnFloatingFilter:()=>qe,ErrorTooltip:()=>Bt.y,GRID_PRO_COLUMN_DRAG_BRIDGE_CONTEXT_KEY:()=>ot,GRID_READY_EVENT:()=>s.mr,GenesisGridDatasourceElement:()=>At.yu,GridOptionsConfig:()=>s.lz,GridPro:()=>a.cF,GridProBaseDatasource:()=>At.ML,GridProBeta:()=>Ut,GridProCaseType:()=>s.uA,GridProCell:()=>$e.O,GridProClientSideDatasource:()=>vt.L,GridProColumn:()=>Me.G,GridProFilterTypes:()=>De,GridProGenesisDatasource:()=>Pt.D,GridProInfiniteDatasource:()=>Tt,GridProRendererTypes:()=>s.IX,GridProServerSideDatasource:()=>ft.X,GridProStatusBarTypes:()=>s.k7,IconRenderer:()=>G.Jt,KVStorageStatePersistence:()=>Yi,LIGHT_BACKGROUND_HEX:()=>ue,LIGHT_BORDER_HEX:()=>pe,LIGHT_FOREGROUND_HEX:()=>ge,LIGHT_HEADER_FOREGROUND_HEX:()=>he,LIGHT_ROW_HOVER_HEX:()=>me,LabelValueStatusBarComponent:()=>$t.k,LoadMoreStatusBarComponent:()=>Mt.s,LocalStorageStatePersistence:()=>Wi.H,MulticolumnDropdown:()=>bi,MultiselectEditor:()=>p.pZ,NumberEditor:()=>g.Z0,OperationType:()=>At.S5,ROW_MATCH_ALERT_CELL_CLASS:()=>Di.mJ,ROW_MATCH_ALERT_CLASS:()=>Di.Xm,RapidAgActionRenderer:()=>E,RapidAgActionsMenuRenderer:()=>D,RapidAgSelectRenderer:()=>N,RapidAgTextRenderer:()=>Qt,RapidBooleanRenderer:()=>x,RapidColumnSelection:()=>Zt,RapidDateEditor:()=>b,RapidEditableRenderer:()=>P,RapidGridPro:()=>Re,RapidGridProBeta:()=>jt,RapidIconRenderer:()=>$,RapidMultiselectEditor:()=>m,RapidNumberEditor:()=>h,RapidSelectEditor:()=>d,RapidStatusPillRenderer:()=>V,RapidStringEditor:()=>S,ReloadStatusBarComponent:()=>_t.W,RowCountStatusBarComponent:()=>Nt.i,SelectEditor:()=>l._Q,SelectRenderer:()=>_.gs,StatePersistence:()=>Gt.l,StatusPillRenderer:()=>H.N7,StringEditor:()=>y.XJ,actionHeightMultiplier:()=>R.Fz,agActionRendererStyles:()=>R.AC,agBooleanRendererStyles:()=>I.CL,agDateEditorStyles:()=>f.kI,agDragGhostShadowDomStyles:()=>U.yK,agEditableRendererStyles:()=>L.Mx,agExternalStockStyles:()=>Oi.Kp,agGridAlpineFontFace:()=>Oi.KX,agGridBalhamFontFace:()=>Oi.c_,agGridCSS:()=>Oi.AT,agGridMaterialFontFace:()=>Oi.Id,agHeadCSS:()=>Oi.g4,agIconRendererStyles:()=>G.X5,agMultiselectEditorStyles:()=>p.$b,agNumberEditorStyles:()=>g.Fv,agSelectEditorStyles:()=>l.Uo,agSelectRendererStyles:()=>_.Ad,agStatusPillRendererStyles:()=>H.x2,agStringEditorStyles:()=>y.P_,agThemeAlpineNofontsCSS:()=>Oi.lJ,agThemeBalhamNofontsCSS:()=>Oi.HC,agThemeFontFaceMap:()=>Oi.KE,agThemeFontsId:()=>s.b7,agThemeGenesisRapid:()=>Y,agThemeGenesisRapidDark:()=>Q,agThemeGenesisRapidLight:()=>Z,agThemeGenesisRapidTokens:()=>Ce,agThemeMaterialCustomTokens:()=>er,agThemeMaterialNofontsCSS:()=>Oi.DX,agThemeTokenMapCSS:()=>s.Kb,agThemeTokenMapClassname:()=>s.eL,applyVisibleOrder:()=>it,backgroundSwatch:()=>Qi,baseDatasourceEventNames:()=>Lt.L,bindAgColumnPickerDrag:()=>je,columnSelectionStyles:()=>rt.H,columnSelectionTemplate:()=>st,convertColDefToColumnState:()=>Vt.pr,convertColDefsToColumnStates:()=>Vt.rG,convertDateFilterToCriteria:()=>Ot.A0,convertFilterModelToCriteria:()=>Ot.P4,convertNumberFilterToCriteria:()=>Ot.X_,convertSetFilterToCriteria:()=>Ot.EC,convertTextFilterToCriteria:()=>Ot.zP,convertToKebabCase:()=>Ht.w,copyAttributesToGridOptions:()=>Ft.Qg,createEnumValueLabelFormatter:()=>Be,createRowAlert:()=>Mi,createRowMatchCellClassRules:()=>Di.Li,createRowMatchClassRules:()=>Di.PO,criteriaDelimiter:()=>At.NC,criteriaJoin:()=>At.W_,csvExportParams:()=>rr,darkColors:()=>ve,datasourceEventNames:()=>Et.c,dateTimeValueFormatter:()=>Ft.XV,dateValueFormatter:()=>Ft.sL,defaultAgGridFontFace:()=>Oi.qh,defaultGridOptionsConfig:()=>s.YO,defaultGridProConfig:()=>a.Z$,defaultRowAlertColorPresets:()=>xi,defaultRowAlertPreferences:()=>Pi,defaultRowAlertRatePresets:()=>Ti,defaultRowAlertScopePresets:()=>Li,deriveHeightsFromTokens:()=>ye,dropdownWidthVar:()=>ni,errorHandlerDialogStyles:()=>Ei.B,extractErrorMessage:()=>tr.P,foregroundSwatch:()=>Ji,formatDateExtra:()=>Ft.mC,formatEnumFilterModelAsString:()=>He,foundationAgBooleanRenderer:()=>I.fg,foundationAgEditableRenderer:()=>L.r8,foundationAgSelectRenderer:()=>_.bE,foundationAgTextFieldRenderer:()=>wi.wG,foundationAgTextRenderer:()=>Wt.G4,foundationColumnSelection:()=>mt,foundationDateEditor:()=>f.vr,foundationGridComponents:()=>Ii,foundationGridPro:()=>a.RB,foundationGridProActionRenderer:()=>R._X,foundationGridProActionsMenuRenderer:()=>k.su,foundationGridProShadowOptions:()=>a.LU,foundationGridProStyles:()=>U.XF,foundationIconRenderer:()=>G.qN,foundationMulticolumnDropdown:()=>Ci,foundationMultiselectEditor:()=>p.UH,foundationNumberEditor:()=>g.CY,foundationSelectEditor:()=>l.RU,foundationStatusPillRenderer:()=>H.a1,foundationStringEditor:()=>y.cb,getActionsMenuDef:()=>k.Al,getAgBooleanRendererTemplate:()=>I.A9,getAgEditableRendererTemplate:()=>L.iP,getAvailableIndexFields:()=>ir.P,getAvailableIndexes:()=>ir.i,getColumnSelectionTemplate:()=>at,getColumnType:()=>Ft.nh,getDateEditorTemplate:()=>f.m6,getEnumFilterParams:()=>Ft.O7,getErrorHandlerDialogTemplate:()=>Ei.P,getGridProTemplate:()=>te.U,getIconRendererTemplate:()=>G.V$,getMulticolumnDropdownTemplate:()=>ui,getMultiselectEditorTemplate:()=>p.tB,getNumberEditorTemplate:()=>g.r1,getPickerItems:()=>Je,getSelectEditorTemplate:()=>l.iY,getSelectRendererTemplate:()=>_.qj,getStatusPillRendererTemplate:()=>H.T2,getStringEditorTemplate:()=>y.bZ,getTextFieldRendererTemplate:()=>wi.tm,getTextRendererTemplate:()=>Wt.d6,gridProColumnDragBridgeModule:()=>lt,gridProColumnSelectionHostStyles:()=>rt.M,gridProColumns:()=>_e.T,gridProErrorNames:()=>Ft.Ie,gridProEventNames:()=>Ft.yY,gridProGenesisDatasourceEventNames:()=>Rt.V,gridProTemplate:()=>te.a,lightColors:()=>fe,logger:()=>Ne.v,matchesRowCriteria:()=>Ai.D,mergeAndDedupColDefWithColumnState:()=>Vt.yS,multicolumnDropdownStyles:()=>ci,multicolumnDropdownTemplate:()=>pi,normalizeRowAlertPreferences:()=>Fi,optionsClass:()=>li,orderColumnsForPicker:()=>Ze,partitionPickerItems:()=>et,rapidAgActionRenderer:()=>A,rapidAgActionsMenuRenderer:()=>O,rapidAgBooleanRenderer:()=>T,rapidAgDateEditor:()=>C,rapidAgEditableRenderer:()=>F,rapidAgMultiselectEditor:()=>v,rapidAgNumberEditor:()=>u,rapidAgSelectEditor:()=>c,rapidAgSelectRenderer:()=>B,rapidAgStringEditor:()=>w,rapidAgTextRenderer:()=>Jt,rapidColumnSelection:()=>ei,rapidDefaultGridProConfig:()=>Ae,rapidGridComponents:()=>ti,rapidGridPro:()=>ke,rapidGridProBeta:()=>Yt,rapidGridProShadowOptions:()=>Ee,rapidGridProStyles:()=>ee,rapidGridProTemplate:()=>ie,rapidIconRenderer:()=>M,rapidMulticolumnDropdown:()=>yi,rapidStatusPillRenderer:()=>z,reorderVisibleIds:()=>tt,resolveColumnDragBridge:()=>dt,resolveColumnDragBridgeDirect:()=>ct,resolveColumnDragBridgeFromApi:()=>gt,resolveColumnPickerSort:()=>We,resolveColumnsPickerApi:()=>ht,resolveVisibleColumnFields:()=>_e.C,rowMatchAlertStyles:()=>U.em,sanitizeColumnState:()=>Vt.n7,syncColumnDragBridge:()=>nt,textFieldRendererStyles:()=>wi.zS,textRendererStyles:()=>Wt.JN,themeGenesisRapid:()=>j,themeGenesisRapidDark:()=>W,themeGenesisRapidLight:()=>J,toPickerItem:()=>Qe,wasClickOutsideElement:()=>vi});var r=i(55823),a=i(51266),s=i(55365),o=i(54634),n=i(33681),l=i(48075);class d extends l._Q{}const c=d.compose({baseName:"select-editor",styles:l.Uo,template:(0,l.iY)("rapid")});var g=i(48072);class h extends g.Z0{}const u=h.compose({baseName:"number-editor",styles:g.Fv,template:(0,g.r1)("rapid")});var p=i(56182);class m extends p.pZ{}const v=m.compose({baseName:"multiselect-editor",styles:p.$b,template:(0,p.tB)("rapid")});var f=i(49255);class b extends f.S8{}const C=b.compose({baseName:"date-editor",styles:f.kI,template:(0,f.m6)("rapid")});var y=i(43352);class S extends y.XJ{}const w=S.compose({baseName:"string-editor",styles:y.P_,template:(0,y.bZ)("rapid")});var R=i(67489);class E extends R.eA{paramsChanged(e,t){(null==t?void 0:t.node.rowHeight)&&this.style.setProperty("--params-row-node-height",`${t.node.rowHeight}px`,"")}}const A=E.compose({baseName:"grid-pro-action-renderer",styles:n.css`
|
|
1
|
+
(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[625],{41492(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(r,a,s){var o=a.prototype;s.utc=function(e){return new a({date:e,utc:!0,args:arguments})},o.utc=function(t){var i=s(this.toDate(),{locale:this.$L,utc:!0});return t?i.add(this.utcOffset(),e):i},o.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var n=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),n.call(this,e)};var l=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var d=o.utcOffset;o.utcOffset=function(r,a){var s=this.$utils().u;if(s(r))return this.$u?0:s(this.$offset)?d.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var a=(""+r[0]).match(i)||["-",0,0],s=a[0],o=60*+a[1]+ +a[2];return 0===o?0:"+"===s?o:-o}(r),null===r))return this;var o=Math.abs(r)<=16?60*r:r;if(0===o)return this.utc(a);var n=this.clone();if(a)return n.$offset=o,n.$u=!1,n;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(n=this.local().add(o+l,e)).$offset=o,n.$x.$localOffset=l,n};var c=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var g=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=o.diff;o.diff=function(e,t,i){if(e&&this.$u===e.$u)return h.call(this,e,t,i);var r=this.local(),a=s(e).local();return h.call(r,a,t,i)}}}()},86770(e,t,i){"use strict";i.r(t),i.d(t,{AG_BOOLEAN_PROPERTIES:()=>$t.ME,AG_NUMBER_PROPERTIES:()=>$t.LB,AG_PROPERTIES:()=>$t.zI,ActionRenderer:()=>R.eA,ActionsMenuRenderer:()=>k.cN,AgGridCSSVars:()=>s.W3,AgGridTheme:()=>s.mJ,AgTextFieldRenderer:()=>Ai.p8,AgTextRenderer:()=>Zt.t,BooleanRenderer:()=>I._Y,COLUMN_PICKER_SORT_DEFAULT:()=>Ye,CellTemplate:()=>Ei.x,ColumnSelection:()=>pt,ColumnTemplate:()=>ki.R,DARK_BACKGROUND_HEX:()=>le,DARK_BORDER_HEX:()=>de,DARK_FOREGROUND_HEX:()=>oe,DARK_HEADER_FOREGROUND_HEX:()=>ne,DARK_ROW_HOVER_HEX:()=>ce,DEBOUNCED_RESIZE_TIME:()=>$t.BW,DEFAULT_STATUS_BAR_CONFIG:()=>s.o2,DISPLAY_NONE_CLASS:()=>hi,DatasourceRowMatchTracker:()=>Ii,DateEditor:()=>f.S8,EDITED_COLUMN_FIELD:()=>s.A7,ERROR_COLUMN_FIELD:()=>s.h1,EditableRenderer:()=>L.YM,EnumColumnFilter:()=>Ue,EnumColumnFloatingFilter:()=>Xe,ErrorTooltip:()=>zt.y,GRID_PRO_COLUMN_DRAG_BRIDGE_CONTEXT_KEY:()=>ot,GRID_READY_EVENT:()=>s.mr,GenesisGridDatasourceElement:()=>Dt.yu,GridOptionsConfig:()=>s.lz,GridPro:()=>a.cF,GridProBaseDatasource:()=>Dt.ML,GridProBeta:()=>Xt,GridProCaseType:()=>s.uA,GridProCell:()=>Me.O,GridProClientSideDatasource:()=>mt.L,GridProColumn:()=>$e.G,GridProFilterTypes:()=>De,GridProGenesisDatasource:()=>Mt.D,GridProInfiniteDatasource:()=>Pt,GridProRendererTypes:()=>s.IX,GridProServerSideDatasource:()=>ft.X,GridProStatusBarTypes:()=>s.k7,IconRenderer:()=>G.Jt,KVStorageStatePersistence:()=>Ji,LIGHT_BACKGROUND_HEX:()=>ue,LIGHT_BORDER_HEX:()=>pe,LIGHT_FOREGROUND_HEX:()=>ge,LIGHT_HEADER_FOREGROUND_HEX:()=>he,LIGHT_ROW_HOVER_HEX:()=>ve,LabelValueStatusBarComponent:()=>Nt.k,LoadMoreStatusBarComponent:()=>Bt.s,LocalStorageStatePersistence:()=>Zi.H,MulticolumnDropdown:()=>Si,MultiselectEditor:()=>p.pZ,NumberEditor:()=>g.Z0,OperationType:()=>Dt.S5,ROW_MATCH_ALERT_CELL_CLASS:()=>xi.mJ,ROW_MATCH_ALERT_CLASS:()=>xi.Xm,RapidAgActionRenderer:()=>E,RapidAgActionsMenuRenderer:()=>D,RapidAgSelectRenderer:()=>N,RapidAgTextRenderer:()=>ei,RapidBooleanRenderer:()=>x,RapidColumnSelection:()=>ii,RapidDateEditor:()=>b,RapidEditableRenderer:()=>F,RapidGridPro:()=>Re,RapidGridProBeta:()=>Qt,RapidIconRenderer:()=>M,RapidMultiselectEditor:()=>v,RapidNumberEditor:()=>h,RapidSelectEditor:()=>d,RapidStatusPillRenderer:()=>V,RapidStringEditor:()=>S,ReloadStatusBarComponent:()=>Ht.W,RowCountStatusBarComponent:()=>Vt.i,SelectEditor:()=>l._Q,SelectRenderer:()=>_.gs,StatePersistence:()=>_t.l,StatusPillRenderer:()=>H.N7,StringEditor:()=>y.XJ,actionHeightMultiplier:()=>R.Fz,agActionRendererStyles:()=>R.AC,agBooleanRendererStyles:()=>I.CL,agDateEditorStyles:()=>f.kI,agDragGhostShadowDomStyles:()=>U.yK,agEditableRendererStyles:()=>L.Mx,agExternalStockStyles:()=>Ti.Kp,agGridAlpineFontFace:()=>Ti.KX,agGridBalhamFontFace:()=>Ti.c_,agGridCSS:()=>Ti.AT,agGridMaterialFontFace:()=>Ti.Id,agHeadCSS:()=>Ti.g4,agIconRendererStyles:()=>G.X5,agMultiselectEditorStyles:()=>p.$b,agNumberEditorStyles:()=>g.Fv,agSelectEditorStyles:()=>l.Uo,agSelectRendererStyles:()=>_.Ad,agStatusPillRendererStyles:()=>H.x2,agStringEditorStyles:()=>y.P_,agThemeAlpineNofontsCSS:()=>Ti.lJ,agThemeBalhamNofontsCSS:()=>Ti.HC,agThemeFontFaceMap:()=>Ti.KE,agThemeFontsId:()=>s.b7,agThemeGenesisRapid:()=>Y,agThemeGenesisRapidDark:()=>Q,agThemeGenesisRapidLight:()=>Z,agThemeGenesisRapidTokens:()=>Ce,agThemeMaterialCustomTokens:()=>rr,agThemeMaterialNofontsCSS:()=>Ti.DX,agThemeTokenMapCSS:()=>s.Kb,agThemeTokenMapClassname:()=>s.eL,applyVisibleOrder:()=>it,backgroundSwatch:()=>er,baseDatasourceEventNames:()=>Gt.L,bindAgColumnPickerDrag:()=>je,columnSelectionStyles:()=>rt.H,columnSelectionTemplate:()=>st,convertColDefToColumnState:()=>Kt.pr,convertColDefsToColumnStates:()=>Kt.rG,convertDateFilterToCriteria:()=>Tt.A0,convertFilterModelToCriteria:()=>Tt.P4,convertNumberFilterToCriteria:()=>Tt.X_,convertSetFilterToCriteria:()=>Tt.EC,convertTextFilterToCriteria:()=>Tt.zP,convertToKebabCase:()=>Ut.w,copyAttributesToGridOptions:()=>$t.Qg,createEnumValueLabelFormatter:()=>Be,createRowAlert:()=>Bi,createRowMatchCellClassRules:()=>xi.Li,createRowMatchClassRules:()=>xi.PO,criteriaDelimiter:()=>Dt.NC,criteriaJoin:()=>Dt.W_,csvExportParams:()=>or,darkColors:()=>me,datasourceEventNames:()=>kt.c,dateTimeValueFormatter:()=>$t.XV,dateValueFormatter:()=>$t.sL,defaultAgGridFontFace:()=>Ti.qh,defaultGridOptionsConfig:()=>s.YO,defaultGridProConfig:()=>a.Z$,defaultRowAlertColorPresets:()=>Fi,defaultRowAlertPreferences:()=>Mi,defaultRowAlertRatePresets:()=>Pi,defaultRowAlertScopePresets:()=>Gi,deriveHeightsFromTokens:()=>ye,dropdownWidthVar:()=>ci,errorHandlerDialogStyles:()=>Di.B,extractErrorMessage:()=>ar.P,foregroundSwatch:()=>tr,formatDateExtra:()=>$t.mC,formatEnumFilterModelAsString:()=>He,foundationAgBooleanRenderer:()=>I.fg,foundationAgEditableRenderer:()=>L.r8,foundationAgSelectRenderer:()=>_.bE,foundationAgTextFieldRenderer:()=>Ai.wG,foundationAgTextRenderer:()=>Zt.G4,foundationColumnSelection:()=>vt,foundationDateEditor:()=>f.vr,foundationGridComponents:()=>Li,foundationGridPro:()=>a.RB,foundationGridProActionRenderer:()=>R._X,foundationGridProActionsMenuRenderer:()=>k.su,foundationGridProShadowOptions:()=>a.LU,foundationGridProStyles:()=>U.XF,foundationIconRenderer:()=>G.qN,foundationMulticolumnDropdown:()=>wi,foundationMultiselectEditor:()=>p.UH,foundationNumberEditor:()=>g.CY,foundationSelectEditor:()=>l.RU,foundationStatusPillRenderer:()=>H.a1,foundationStringEditor:()=>y.cb,getActionsMenuDef:()=>k.Al,getAgBooleanRendererTemplate:()=>I.A9,getAgEditableRendererTemplate:()=>L.iP,getAvailableIndexFields:()=>sr.P,getAvailableIndexes:()=>sr.i,getColumnSelectionTemplate:()=>at,getColumnType:()=>$t.nh,getDateEditorTemplate:()=>f.m6,getEnumFilterParams:()=>$t.O7,getErrorHandlerDialogTemplate:()=>Di.P,getGridProTemplate:()=>te.U,getIconRendererTemplate:()=>G.V$,getMulticolumnDropdownTemplate:()=>mi,getMultiselectEditorTemplate:()=>p.tB,getNumberEditorTemplate:()=>g.r1,getPickerItems:()=>Je,getSelectEditorTemplate:()=>l.iY,getSelectRendererTemplate:()=>_.qj,getStatusPillRendererTemplate:()=>H.T2,getStringEditorTemplate:()=>y.bZ,getTextFieldRendererTemplate:()=>Ai.tm,getTextRendererTemplate:()=>Zt.d6,gridProColumnDragBridgeModule:()=>lt,gridProColumnSelectionHostStyles:()=>rt.M,gridProColumns:()=>_e.T,gridProErrorNames:()=>$t.Ie,gridProEventNames:()=>$t.yY,gridProGenesisDatasourceEventNames:()=>At.V,gridProTemplate:()=>te.a,lightColors:()=>fe,logger:()=>Ne.v,matchesRowCriteria:()=>Oi.D,mergeAndDedupColDefWithColumnState:()=>Kt.yS,multicolumnDropdownStyles:()=>ui,multicolumnDropdownTemplate:()=>fi,normalizeRowAlertPreferences:()=>$i,optionsClass:()=>gi,orderColumnsForPicker:()=>Ze,partitionPickerItems:()=>et,rapidAgActionRenderer:()=>A,rapidAgActionsMenuRenderer:()=>O,rapidAgBooleanRenderer:()=>T,rapidAgDateEditor:()=>C,rapidAgEditableRenderer:()=>P,rapidAgMultiselectEditor:()=>m,rapidAgNumberEditor:()=>u,rapidAgSelectEditor:()=>c,rapidAgSelectRenderer:()=>B,rapidAgStringEditor:()=>w,rapidAgTextRenderer:()=>ti,rapidColumnSelection:()=>ri,rapidDefaultGridProConfig:()=>Ae,rapidGridComponents:()=>ai,rapidGridPro:()=>ke,rapidGridProBeta:()=>Jt,rapidGridProShadowOptions:()=>Ee,rapidGridProStyles:()=>ee,rapidGridProTemplate:()=>ie,rapidIconRenderer:()=>$,rapidMulticolumnDropdown:()=>Ri,rapidStatusPillRenderer:()=>z,reorderVisibleIds:()=>tt,resolveColumnDragBridge:()=>dt,resolveColumnDragBridgeDirect:()=>ct,resolveColumnDragBridgeFromApi:()=>gt,resolveColumnPickerSort:()=>We,resolveColumnsPickerApi:()=>ht,resolveVisibleColumnFields:()=>_e.C,rowMatchAlertStyles:()=>U.em,sanitizeColumnState:()=>Kt.n7,syncColumnDragBridge:()=>nt,textFieldRendererStyles:()=>Ai.zS,textRendererStyles:()=>Zt.JN,themeGenesisRapid:()=>j,themeGenesisRapidDark:()=>W,themeGenesisRapidLight:()=>J,toPickerItem:()=>Qe,wasClickOutsideElement:()=>Ci});var r=i(55823),a=i(51266),s=i(55365),o=i(54634),n=i(33681),l=i(48075);class d extends l._Q{}const c=d.compose({baseName:"select-editor",styles:l.Uo,template:(0,l.iY)("rapid")});var g=i(48072);class h extends g.Z0{}const u=h.compose({baseName:"number-editor",styles:g.Fv,template:(0,g.r1)("rapid")});var p=i(56182);class v extends p.pZ{}const m=v.compose({baseName:"multiselect-editor",styles:p.$b,template:(0,p.tB)("rapid")});var f=i(49255);class b extends f.S8{}const C=b.compose({baseName:"date-editor",styles:f.kI,template:(0,f.m6)("rapid")});var y=i(43352);class S extends y.XJ{}const w=S.compose({baseName:"string-editor",styles:y.P_,template:(0,y.bZ)("rapid")});var R=i(67489);class E extends R.eA{paramsChanged(e,t){(null==t?void 0:t.node.rowHeight)&&this.style.setProperty("--params-row-node-height",`${t.node.rowHeight}px`,"")}}const A=E.compose({baseName:"grid-pro-action-renderer",styles:n.css`
|
|
2
2
|
${R.AC}
|
|
3
3
|
.button-padding {
|
|
4
4
|
justify-content: center;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
name="${e=>{var t;return null===(t=e.params)||void 0===t?void 0:t.headerName}}"
|
|
46
46
|
:definition=${e=>e.params}
|
|
47
47
|
></rapid-actions-menu>
|
|
48
|
-
`});var I=i(60905);class x extends I._Y{}const T=x.compose({baseName:"boolean-renderer",styles:I.CL,template:(0,I.A9)("rapid")});var L=i(46255);class
|
|
48
|
+
`});var I=i(60905);class x extends I._Y{}const T=x.compose({baseName:"boolean-renderer",styles:I.CL,template:(0,I.A9)("rapid")});var L=i(46255);class F extends L.YM{}const P=F.compose({baseName:"editable-renderer",styles:L.Mx,template:(0,L.iP)("rapid")});var G=i(2048);class M extends G.Jt{}const $=M.compose({baseName:"icon-renderer",styles:G.X5,template:(0,G.V$)("rapid")});var _=i(80879);class N extends _.gs{}const B=N.compose({baseName:"select-renderer",styles:_.Ad,template:(0,_.qj)("rapid")});var H=i(19511);class V extends H.N7{}const z=V.compose({baseName:"status-pill-renderer",template:(0,H.T2)("rapid"),styles:H.x2});var U=i(98884),K=i(60591),q=i(93188);const X=n.css`
|
|
49
49
|
.ag-theme-genesis-rapid,
|
|
50
50
|
.ag-theme-genesis-rapid-dark,
|
|
51
51
|
.ag-theme-genesis-rapid-light {
|
|
@@ -675,10 +675,10 @@
|
|
|
675
675
|
border: 0 !important;
|
|
676
676
|
}
|
|
677
677
|
`,j="ag-theme-genesis-rapid",Y=n.css`
|
|
678
|
-
${
|
|
678
|
+
${X}
|
|
679
679
|
|
|
680
680
|
.${j} {
|
|
681
|
-
${(0,
|
|
681
|
+
${(0,q.mixinRobotoFont)()}
|
|
682
682
|
font-family: var(--body-font);
|
|
683
683
|
}
|
|
684
684
|
|
|
@@ -697,10 +697,10 @@
|
|
|
697
697
|
font-size: var(--type-ramp-minus-1-font-size);
|
|
698
698
|
}
|
|
699
699
|
`,W="ag-theme-genesis-rapid-dark",Q=n.css`
|
|
700
|
-
${
|
|
700
|
+
${X}
|
|
701
701
|
|
|
702
702
|
.${W} {
|
|
703
|
-
${(0,
|
|
703
|
+
${(0,q.mixinRobotoFont)()}
|
|
704
704
|
font-family: var(--body-font);
|
|
705
705
|
}
|
|
706
706
|
|
|
@@ -723,10 +723,10 @@
|
|
|
723
723
|
color-scheme: dark;
|
|
724
724
|
}
|
|
725
725
|
`,J="ag-theme-genesis-rapid-light",Z=n.css`
|
|
726
|
-
${
|
|
726
|
+
${X}
|
|
727
727
|
|
|
728
728
|
.${J} {
|
|
729
|
-
${(0,
|
|
729
|
+
${(0,q.mixinRobotoFont)()}
|
|
730
730
|
font-family: var(--body-font);
|
|
731
731
|
}
|
|
732
732
|
|
|
@@ -757,7 +757,7 @@
|
|
|
757
757
|
${Y}
|
|
758
758
|
${Q}
|
|
759
759
|
${Z}
|
|
760
|
-
`;var te=i(82128);const ie=(0,te.U)("rapid");var re=i(20166),ae=i(38370),se=i(83912);const oe="#cccccc",ne="#879ba6",le="#1f2126",de="#2e3339",ce="#2b2e34",ge="#000000",he="#181d1f",ue="#FFFFFF",pe="#babfc7",
|
|
760
|
+
`;var te=i(82128);const ie=(0,te.U)("rapid");var re=i(20166),ae=i(38370),se=i(83912);const oe="#cccccc",ne="#879ba6",le="#1f2126",de="#2e3339",ce="#2b2e34",ge="#000000",he="#181d1f",ue="#FFFFFF",pe="#babfc7",ve="#2196f3",me={foregroundSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(oe)),headerForegroundSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(ne)),backgroundSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(le)),borderSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(de)),rowHoverSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(ce))},fe={foregroundSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(ge)),headerForegroundSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(he)),backgroundSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(ue)),borderSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(pe)),rowHoverSwatch:o.SwatchRGB.from((0,se.parseColorHexRGB)(ve))},{create:be}=ae.DesignToken,Ce={backgroundColor:be("rapid-ag-background-color").withDefault(e=>o.baseLayerLuminance.getValueFor(e)===o.StandardLuminance.LightMode?fe.backgroundSwatch:me.backgroundSwatch),borderColor:be("rapid-ag-border-color").withDefault(e=>o.baseLayerLuminance.getValueFor(e)===o.StandardLuminance.LightMode?fe.borderSwatch:me.borderSwatch),foregroundColor:be("rapid-ag-foreground-color").withDefault(e=>o.baseLayerLuminance.getValueFor(e)===o.StandardLuminance.LightMode?fe.foregroundSwatch:me.foregroundSwatch),headerForegroundColor:be("rapid-ag-header-foreground-color").withDefault(e=>o.baseLayerLuminance.getValueFor(e)===o.StandardLuminance.LightMode?fe.headerForegroundSwatch:me.headerForegroundSwatch),rowHoverColor:be("rapid-ag-row-hover-color").withDefault(e=>o.baseLayerLuminance.getValueFor(e)===o.StandardLuminance.LightMode?fe.rowHoverSwatch:me.rowHoverSwatch)},ye=()=>{const e=(0,re.designTokensMap)();if(!e.value)return null;const{style:t,space:i}=e.value.design_tokens;return(t.baseHeightMultiplier.$value+t.density.$value)*i.designUnit.$value-8},Se="ag-theme-genesis-rapid-dark",we="ag-theme-genesis-rapid-light";class Re extends a.cF{constructor(){super(...arguments),this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.handleLuminanceChange=e=>{const t=o.baseLayerLuminance.getValueFor(e.target);this.theme=t===o.StandardLuminance.DarkMode?Se:we},this.theme="light"===localStorage.getItem("luminance")?we:Se}connectedCallback(){var e;super.connectedCallback();const t=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=o.baseLayerLuminance.subscribe(this.luminanceObserver,t)}disconnectedCallback(){var e;const t=null!==(e=this.provider)&&void 0!==e?e:this;o.baseLayerLuminance.unsubscribe(this.luminanceObserver,t),this.luminanceSubscription&&(this.luminanceSubscription.unsubscribe(),this.luminanceSubscription=void 0),super.disconnectedCallback()}themeChanged(e,t){(e||t===Se)&&super.themeChanged(e,t)}set gridOptions(e){var t,i,r,a;const o=Object.assign({},e);o.components=Object.assign({[s.IX.action]:E,[s.IX.actionsMenu]:D,[s.IX.boolean]:x,[s.IX.editable]:F,[s.IX.icon]:M,[s.IX.select]:N,[s.IX.selectEditor]:d,[s.IX.numberEditor]:h,[s.IX.multiselectEditor]:v,[s.IX.dateEditor]:b,[s.IX.stringEditor]:S,[s.IX.statusPill]:V},e.components);(this.theme===j||this.theme===W||this.theme===J)&&(this.headerHeight=null!==(i=null!==(t=o.headerHeight)&&void 0!==t?t:ye())&&void 0!==i?i:32,this.rowHeight=null!==(a=null!==(r=o.rowHeight)&&void 0!==r?r:ye())&&void 0!==a?a:32),super.gridOptions=o}}(0,r.Cg)([n.observable],Re.prototype,"provider",void 0);const Ee=a.LU,Ae=a.Z$,ke=Re.compose(Object.assign({baseName:"grid-pro",template:ie,styles:ee,shadowOptions:Ee},Ae));var De,Oe=i(6884),Ie=i(20633),xe=i(21409),Te=i(17190),Le=i(48046),Fe=i(88047),Pe=i(62051),Ge=i.n(Pe),Me=i(56943),$e=i(64315),_e=i(14987),Ne=i(1510);!function(e){e.enumFilter="enumColumnFilter",e.enumFloatingFilter="enumColumnFloatingFilter"}(De||(De={}));function Be(e){const t=null==e?void 0:e.valueFormatter,i=t?i=>String(t({value:i,api:null==e?void 0:e.api,colDef:null==e?void 0:e.colDef,column:null==e?void 0:e.column,context:null==e?void 0:e.context})):e=>(0,Fe.capitalCase)(e);return e=>null===e?"(Blanks)":i(e)}function He(e,t){return(null==e?void 0:e.values)?0===e.values.length?"(None)":`(${e.values.length}) ${e.values.map(t).join(", ")}`:""}const Ve="gp-enum-filter",ze=n.css`
|
|
761
761
|
:host {
|
|
762
762
|
display: flex;
|
|
763
763
|
flex-direction: column;
|
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
padding: 4px;
|
|
821
821
|
opacity: 0.7;
|
|
822
822
|
}
|
|
823
|
-
`;class Ue{constructor(){this.itemInputs=new Map,this.allValues=[],this.includeBlanks=!0,this.valuesRequestId=0,this.loading=!1,this.ownsHeaderTooltip=!1,this.model=null,this.searchTerm=""}init(e){this.params=e,this.formatLabel=Be(e),this.installHeaderTooltip(),this.createGui(),this.resolveState()}getGui(){return this.eGui}isFilterActive(){return null!==this.model}doesFilterPass(e){if(null===this.model)return!0;const t=this.getCellValue(e.node);return null==t||""===t?this.model.includes(null):this.model.includes(String(t))}getModel(){return null===this.model?null:{filterType:"set",values:[...this.model]}}setModel(e){this.model=(null==e?void 0:e.values)?[...e.values]:null,this.syncCheckedStates()}getModelAsString(e){return He(null!=e?e:this.getModel(),this.formatLabel)}clear(){null!==this.model&&(this.model=null,this.syncCheckedStates(),this.params.filterChangedCallback())}installHeaderTooltip(){const e=this.params.colDef;e&&!e.headerTooltipValueGetter&&(this.ownsHeaderTooltip=!0,e.headerTooltipValueGetter=()=>{const t=He(this.getModel(),this.formatLabel);if(t)return e.headerTooltip?`${e.headerTooltip} — Filtered: ${t}`:`Filtered: ${t}`})}afterGuiAttached(e){this.searchTerm="",this.eSearch.value="",this.renderList(),(null==e?void 0:e.suppressFocus)||this.eSearch.focus()}refresh(e){return this.params=e,this.formatLabel=Be(e),this.installHeaderTooltip(),this.resolveState(),!0}destroy(){var e;this.valuesRequestId+=1,this.ownsHeaderTooltip&&(delete this.params.colDef.headerTooltipValueGetter,this.ownsHeaderTooltip=!1),null===(e=this.eGui)||void 0===e||e.remove()}resolveState(){var e;this.loading=!1,this.includeBlanks=!1!==this.params.blanks;const t=this.params.values;"function"!=typeof t?(Array.isArray(t)?this.allValues=[...new Set(t.map(String))]:(Ne.v.warn(`EnumColumnFilter on column '${null===(e=this.params.colDef)||void 0===e?void 0:e.field}' has no filterParams.values; provide the enum options (metadata enumOptions, an array, or a getter).`),this.allValues=[]),this.renderList()):this.loadAsyncValues(t)}loadAsyncValues(e){this.valuesRequestId+=1;const t=this.valuesRequestId;let i=!1;const r=e=>{i||t!==this.valuesRequestId||(i=!0,this.loading=!1,this.allValues=[...new Set((null!=e?e:[]).map(String))],this.renderList())};let a;try{a=e({colDef:this.params.colDef,api:this.params.api,success:r})}catch(e){return void r([])}if(!i)if(Array.isArray(a))r(a);else{if(void 0!==a){const e=a;return"function"!=typeof e.then?void r([]):(this.loading=!0,this.renderList(),void e.then(r,()=>r([])))}this.loading=!0,this.renderList()}}getCellValue(e){var t,i;const r=this.params;if("function"==typeof r.getValue)return r.getValue(e);const a=null===(t=r.colDef)||void 0===t?void 0:t.field;return a?null===(i=null==e?void 0:e.data)||void 0===i?void 0:i[a]:void 0}extraModelValues(){var e;return(null!==(e=this.model)&&void 0!==e?e:[]).filter(e=>null!==e&&!this.allValues.includes(e))}allKeys(){var e;const t=[...this.allValues,...this.extraModelValues()];return(this.includeBlanks||(null===(e=this.model)||void 0===e?void 0:e.includes(null)))&&t.push(null),t}isSelected(e){return null===this.model||this.model.includes(e)}visibleKeys(){const e=this.allKeys();if(!this.searchTerm)return e;const t=this.searchTerm.toLowerCase();return e.filter(e=>this.formatLabel(e).toLowerCase().includes(t)||null!==e&&e.toLowerCase().includes(t))}updateSelection(e){const t=this.allKeys().every(t=>e.has(t));this.model=t?null:[...e],this.syncCheckedStates(),this.params.filterChangedCallback()}currentSelection(){return new Set(this.allKeys().filter(e=>this.isSelected(e)))}toggleValue(e,t){const i=this.currentSelection();t?i.add(e):i.delete(e),this.updateSelection(i)}toggleAllVisible(e){const t=this.visibleKeys(),i=this.currentSelection();t.forEach(t=>e?i.add(t):i.delete(t)),this.updateSelection(i)}createGui(){this.eGui=document.createElement("div"),this.eGui.className=Ve,this.eRoot=this.eGui.attachShadow({mode:"open"}),ze.addStylesTo(this.eRoot),this.eRoot.addEventListener("keydown",e=>this.handleKeyDown(e)),this.eSearch=document.createElement("input"),this.eSearch.type="text",this.eSearch.className=`${Ve}__search`,this.eSearch.placeholder="Search",this.eSearch.setAttribute("aria-label","Search filter values"),this.eSearch.addEventListener("input",()=>{this.searchTerm=this.eSearch.value.trim(),this.renderList()}),this.eRoot.appendChild(this.eSearch);const e=this.createItem("(Select All)");e.label.classList.add(`${Ve}__select-all`),this.eSelectAll=e.input,this.eSelectAll.addEventListener("change",()=>{this.toggleAllVisible(this.eSelectAll.checked)}),this.eRoot.appendChild(e.label),this.eList=document.createElement("div"),this.eList.className=`${Ve}__list`,this.eRoot.appendChild(this.eList)}createItem(e){const t=document.createElement("label");t.className=`${Ve}__item`;const i=document.createElement("input");i.type="checkbox",t.appendChild(i);const r=document.createElement("span");return r.className=`${Ve}__item-label`,r.textContent=e,r.title=e,t.appendChild(r),{label:t,input:i}}renderList(){if(!this.eList)return;this.eList.replaceChildren(),this.itemInputs.clear();const e=this.visibleKeys();if(this.loading||0===e.length){const e=document.createElement("div");e.className=`${Ve}__no-matches`,e.textContent=this.loading?"Loading…":"No matches",this.eList.appendChild(e)}this.loading||e.forEach(e=>{const{label:t,input:i}=this.createItem(this.formatLabel(e));t.dataset.value=null===e?"":e,i.addEventListener("change",()=>this.toggleValue(e,i.checked)),this.itemInputs.set(e,i),this.eList.appendChild(t)}),this.syncCheckedStates()}syncCheckedStates(){if(!this.eList)return;let e=0;this.itemInputs.forEach((t,i)=>{t.checked=this.isSelected(i),t.checked&&(e+=1)});const t=this.itemInputs.size;this.eSelectAll.checked=t>0&&e===t,this.eSelectAll.indeterminate=e>0&&e<t,this.eSelectAll.disabled=0===t}focusables(){return[this.eSearch,this.eSelectAll,...this.itemInputs.values()]}handleKeyDown(e){const t=e.target;if("Enter"===e.key&&t instanceof HTMLInputElement&&"checkbox"===t.type)return e.preventDefault(),t.checked=!t.checked,void t.dispatchEvent(new Event("change"));if("Tab"===e.key){const i=this.focusables(),r=i[0],a=i[i.length-1];return void(e.shiftKey&&t===r?(e.preventDefault(),a.focus()):e.shiftKey||t!==a||(e.preventDefault(),r.focus()))}if("ArrowDown"!==e.key&&"ArrowUp"!==e.key)return;const i=this.focusables(),r=i.indexOf(t);if(-1===r)return;const a="ArrowDown"===e.key?r+1:r-1;a<0||a>=i.length||(e.preventDefault(),i[a].focus())}}const Ke="gp-enum-floating-filter",
|
|
823
|
+
`;class Ue{constructor(){this.itemInputs=new Map,this.allValues=[],this.includeBlanks=!0,this.valuesRequestId=0,this.loading=!1,this.ownsHeaderTooltip=!1,this.model=null,this.searchTerm=""}init(e){this.params=e,this.formatLabel=Be(e),this.installHeaderTooltip(),this.createGui(),this.resolveState()}getGui(){return this.eGui}isFilterActive(){return null!==this.model}doesFilterPass(e){if(null===this.model)return!0;const t=this.getCellValue(e.node);return null==t||""===t?this.model.includes(null):this.model.includes(String(t))}getModel(){return null===this.model?null:{filterType:"set",values:[...this.model]}}setModel(e){this.model=(null==e?void 0:e.values)?[...e.values]:null,this.syncCheckedStates()}getModelAsString(e){return He(null!=e?e:this.getModel(),this.formatLabel)}clear(){null!==this.model&&(this.model=null,this.syncCheckedStates(),this.params.filterChangedCallback())}installHeaderTooltip(){const e=this.params.colDef;e&&!e.headerTooltipValueGetter&&(this.ownsHeaderTooltip=!0,e.headerTooltipValueGetter=()=>{const t=He(this.getModel(),this.formatLabel);if(t)return e.headerTooltip?`${e.headerTooltip} — Filtered: ${t}`:`Filtered: ${t}`})}afterGuiAttached(e){this.searchTerm="",this.eSearch.value="",this.renderList(),(null==e?void 0:e.suppressFocus)||this.eSearch.focus()}refresh(e){return this.params=e,this.formatLabel=Be(e),this.installHeaderTooltip(),this.resolveState(),!0}destroy(){var e;this.valuesRequestId+=1,this.ownsHeaderTooltip&&(delete this.params.colDef.headerTooltipValueGetter,this.ownsHeaderTooltip=!1),null===(e=this.eGui)||void 0===e||e.remove()}resolveState(){var e;this.loading=!1,this.includeBlanks=!1!==this.params.blanks;const t=this.params.values;"function"!=typeof t?(Array.isArray(t)?this.allValues=[...new Set(t.map(String))]:(Ne.v.warn(`EnumColumnFilter on column '${null===(e=this.params.colDef)||void 0===e?void 0:e.field}' has no filterParams.values; provide the enum options (metadata enumOptions, an array, or a getter).`),this.allValues=[]),this.renderList()):this.loadAsyncValues(t)}loadAsyncValues(e){this.valuesRequestId+=1;const t=this.valuesRequestId;let i=!1;const r=e=>{i||t!==this.valuesRequestId||(i=!0,this.loading=!1,this.allValues=[...new Set((null!=e?e:[]).map(String))],this.renderList())};let a;try{a=e({colDef:this.params.colDef,api:this.params.api,success:r})}catch(e){return void r([])}if(!i)if(Array.isArray(a))r(a);else{if(void 0!==a){const e=a;return"function"!=typeof e.then?void r([]):(this.loading=!0,this.renderList(),void e.then(r,()=>r([])))}this.loading=!0,this.renderList()}}getCellValue(e){var t,i;const r=this.params;if("function"==typeof r.getValue)return r.getValue(e);const a=null===(t=r.colDef)||void 0===t?void 0:t.field;return a?null===(i=null==e?void 0:e.data)||void 0===i?void 0:i[a]:void 0}extraModelValues(){var e;return(null!==(e=this.model)&&void 0!==e?e:[]).filter(e=>null!==e&&!this.allValues.includes(e))}allKeys(){var e;const t=[...this.allValues,...this.extraModelValues()];return(this.includeBlanks||(null===(e=this.model)||void 0===e?void 0:e.includes(null)))&&t.push(null),t}isSelected(e){return null===this.model||this.model.includes(e)}visibleKeys(){const e=this.allKeys();if(!this.searchTerm)return e;const t=this.searchTerm.toLowerCase();return e.filter(e=>this.formatLabel(e).toLowerCase().includes(t)||null!==e&&e.toLowerCase().includes(t))}updateSelection(e){const t=this.allKeys().every(t=>e.has(t));this.model=t?null:[...e],this.syncCheckedStates(),this.params.filterChangedCallback()}currentSelection(){return new Set(this.allKeys().filter(e=>this.isSelected(e)))}toggleValue(e,t){const i=this.currentSelection();t?i.add(e):i.delete(e),this.updateSelection(i)}toggleAllVisible(e){const t=this.visibleKeys(),i=this.currentSelection();t.forEach(t=>e?i.add(t):i.delete(t)),this.updateSelection(i)}createGui(){this.eGui=document.createElement("div"),this.eGui.className=Ve,this.eRoot=this.eGui.attachShadow({mode:"open"}),ze.addStylesTo(this.eRoot),this.eRoot.addEventListener("keydown",e=>this.handleKeyDown(e)),this.eSearch=document.createElement("input"),this.eSearch.type="text",this.eSearch.className=`${Ve}__search`,this.eSearch.placeholder="Search",this.eSearch.setAttribute("aria-label","Search filter values"),this.eSearch.addEventListener("input",()=>{this.searchTerm=this.eSearch.value.trim(),this.renderList()}),this.eRoot.appendChild(this.eSearch);const e=this.createItem("(Select All)");e.label.classList.add(`${Ve}__select-all`),this.eSelectAll=e.input,this.eSelectAll.addEventListener("change",()=>{this.toggleAllVisible(this.eSelectAll.checked)}),this.eRoot.appendChild(e.label),this.eList=document.createElement("div"),this.eList.className=`${Ve}__list`,this.eRoot.appendChild(this.eList)}createItem(e){const t=document.createElement("label");t.className=`${Ve}__item`;const i=document.createElement("input");i.type="checkbox",t.appendChild(i);const r=document.createElement("span");return r.className=`${Ve}__item-label`,r.textContent=e,r.title=e,t.appendChild(r),{label:t,input:i}}renderList(){if(!this.eList)return;this.eList.replaceChildren(),this.itemInputs.clear();const e=this.visibleKeys();if(this.loading||0===e.length){const e=document.createElement("div");e.className=`${Ve}__no-matches`,e.textContent=this.loading?"Loading…":"No matches",this.eList.appendChild(e)}this.loading||e.forEach(e=>{const{label:t,input:i}=this.createItem(this.formatLabel(e));t.dataset.value=null===e?"":e,i.addEventListener("change",()=>this.toggleValue(e,i.checked)),this.itemInputs.set(e,i),this.eList.appendChild(t)}),this.syncCheckedStates()}syncCheckedStates(){if(!this.eList)return;let e=0;this.itemInputs.forEach((t,i)=>{t.checked=this.isSelected(i),t.checked&&(e+=1)});const t=this.itemInputs.size;this.eSelectAll.checked=t>0&&e===t,this.eSelectAll.indeterminate=e>0&&e<t,this.eSelectAll.disabled=0===t}focusables(){return[this.eSearch,this.eSelectAll,...this.itemInputs.values()]}handleKeyDown(e){const t=e.target;if("Enter"===e.key&&t instanceof HTMLInputElement&&"checkbox"===t.type)return e.preventDefault(),t.checked=!t.checked,void t.dispatchEvent(new Event("change"));if("Tab"===e.key){const i=this.focusables(),r=i[0],a=i[i.length-1];return void(e.shiftKey&&t===r?(e.preventDefault(),a.focus()):e.shiftKey||t!==a||(e.preventDefault(),r.focus()))}if("ArrowDown"!==e.key&&"ArrowUp"!==e.key)return;const i=this.focusables(),r=i.indexOf(t);if(-1===r)return;const a="ArrowDown"===e.key?r+1:r-1;a<0||a>=i.length||(e.preventDefault(),i[a].focus())}}const Ke="gp-enum-floating-filter",qe=n.css`
|
|
824
824
|
:host {
|
|
825
825
|
display: flex;
|
|
826
826
|
align-items: center;
|
|
@@ -858,7 +858,7 @@
|
|
|
858
858
|
opacity: 1;
|
|
859
859
|
background: var(--ag-row-hover-color, rgba(33, 150, 243, 0.1));
|
|
860
860
|
}
|
|
861
|
-
`;class
|
|
861
|
+
`;class Xe{init(e){var t,i;this.params=e,this.formatLabel=Be(e.filterParams),this.eGui=document.createElement("div"),this.eGui.className=Ke,this.eRoot=this.eGui.attachShadow({mode:"open"}),qe.addStylesTo(this.eRoot),this.eSummary=document.createElement("span"),this.eSummary.className=`${Ke}__summary`,this.eSummary.setAttribute("role","button"),this.eSummary.tabIndex=0,this.eSummary.addEventListener("click",()=>this.params.showParentFilter()),this.eSummary.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.params.showParentFilter())}),this.eRoot.appendChild(this.eSummary),this.eClear=document.createElement("button"),this.eClear.type="button",this.eClear.className=`${Ke}__clear`,this.eClear.textContent="✕",this.eClear.setAttribute("aria-label","Clear filter"),this.eClear.title="Clear filter",this.eClear.hidden=!0,this.eClear.addEventListener("click",()=>{this.params.parentFilterInstance(e=>{var t,i;null===(i=(t=e).clear)||void 0===i||i.call(t)})}),this.eRoot.appendChild(this.eClear),this.onParentModelChanged(null!==(i=null===(t=e.currentParentModel)||void 0===t?void 0:t.call(e))&&void 0!==i?i:null)}getGui(){return this.eGui}onParentModelChanged(e){const t=He(e,this.formatLabel)||"All";this.eSummary.textContent=t,this.eSummary.title=t,this.eSummary.classList.toggle(`${Ke}__summary--inactive`,!e),this.eClear.hidden=!e}destroy(){var e;null===(e=this.eGui)||void 0===e||e.remove()}}function je(e,t,i,r,a){var s;const o=null===(s=t.getColumn)||void 0===s?void 0:s.call(t,r);if(!o||i.hasAttribute("data-ag-column-drag-bound"))return null;const{dragAndDrop:n,gos:l}=e;if(!n||!l)return null;if(l.get("allowDragFromColumnsToolPanel")||"function"!=typeof t.setGridOption||t.setGridOption("allowDragFromColumnsToolPanel",!0),!l.get("allowDragFromColumnsToolPanel"))return null;i.setAttribute("data-ag-column-drag-bound",""),i.draggable=!1;let d=!l.get("suppressDragLeaveHidesColumns");const c={type:Le.qRA.ToolPanel,eElement:i,dragItemName:a,getDefaultIconName:()=>d?"hide":"notAllowed",getDragItem:()=>function(e){return{columns:[e],visibleState:{[e.getColId()]:e.isVisible()}}}(o),onDragStarted:()=>{d=!l.get("suppressDragLeaveHidesColumns")}};return n.addDragSource(c,!0),{source:c,remove:()=>{i.removeAttribute("data-ag-column-drag-bound"),i.classList.remove("grid-pro-columns-handle-grid-drag"),n.removeDragSource(c)}}}const Ye="selected-first";function We(e){return"ag-grid"===e?"ag-grid":Ye}function Qe(e){const t=e.getColDef();if(t.suppressColumnsToolPanel)return null;if("function"==typeof e.isPrimary&&!e.isPrimary())return null;const i=e.getColId();return{colId:i,headerName:String(t.headerName||t.field||i||""),visible:e.isVisible(),lockVisible:Boolean(t.lockVisible)}}function Je(e){return e.map(Qe).filter(e=>null!=e)}function Ze(e,t,i=Ye,r){if("ag-grid"===i){if(!(null==r?void 0:r.length))return t;const e=new Map(t.map(e=>[e.getColId(),e])),i=[],a=new Set;for(const t of r){const r=t.colId;if(null==r||a.has(r))continue;const s=e.get(r);s&&(i.push(s),a.add(r))}for(const e of t){const t=e.getColId();a.has(t)||(i.push(e),a.add(t))}return i}const a=new Set(e.map(e=>e.getColId()));return[...e,...t.filter(e=>!a.has(e.getColId()))]}function et(e,t,i=Ye){const r=t.trim().toLowerCase(),a=e.filter(e=>!r||e.headerName.toLowerCase().includes(r));return"ag-grid"===i?{selected:a,unselected:[]}:{selected:a.filter(e=>e.visible),unselected:a.filter(e=>!e.visible).sort((e,t)=>e.headerName.localeCompare(t.headerName,void 0,{sensitivity:"base"}))}}function tt(e,t,i,r){const a=[...t],s=a.indexOf(i),o=a.indexOf(r);if(s<0||o<0||i===r)return null;a.splice(s,1),a.splice(o,0,i);let n=0;return e.map(e=>{if(!t.includes(e))return e;const i=a[n];return n+=1,i})}function it(e,t){const i=new Map(e.map(e=>[e.colId,e])),r=new Set(t);let a=0;return e.map(e=>{if(e.hide||!e.colId||!r.has(e.colId))return e;const s=t[a];return a+=1,s&&i.get(s)||e})}var rt=i(34713);const at=(e="foundation")=>{const t=`${e}-text-field`,i=`${e}-checkbox`,r=n.html`
|
|
862
862
|
<div
|
|
863
863
|
class="${e=>"grid-pro-columns-item"+(e.visible?"":" grid-pro-columns-item--unselected")}"
|
|
864
864
|
data-col-id="${e=>e.colId}"
|
|
@@ -934,7 +934,7 @@
|
|
|
934
934
|
</div>
|
|
935
935
|
</div>
|
|
936
936
|
</div>
|
|
937
|
-
`},st=at(),ot="gridProColumnDragBridge";function nt(e){var t,i;if(!(null==e?void 0:e.dragAndDrop)||!e.gos)return!1;const r=null!==(t=e.gos.get("context"))&&void 0!==t?t:null===(i=e.gridOptions)||void 0===i?void 0:i.context,a=null==r?void 0:r[ot];return!!a&&(a.dragAndDrop=e.dragAndDrop,a.gos=e.gos,!0)}const lt={moduleName:"GridProColumnDragBridge",version:Le.Vc.version,beans:[class{constructor(){this.beanName="gridProColumnDragBridgeInit",this.beans=null}wireBeans(e){this.beans=e}postConstruct(){nt(this.beans),queueMicrotask(()=>nt(this.beans))}}],dependsOn:[Le.Vc]};function dt(e){return ct(null==e?void 0:e[ot])}function ct(e){return(null==e?void 0:e.dragAndDrop)&&(null==e?void 0:e.gos)?e:null}function gt(e){var t;return dt(null===(t=null==e?void 0:e.getGridOption)||void 0===t?void 0:t.call(e,"context"))}function ht(e,t){const i=null!=t?t:null==e?void 0:e.gridApi;if(!i)return null;if("function"==typeof i.setColumnsVisible&&"function"==typeof i.getColumns)return i;const r=null==e?void 0:e.columnApi;return r?new Proxy(i,{get(e,t,i){switch(t){case"getColumns":return()=>{var e,t;return null!==(t=null===(e=r.getAllGridColumns)||void 0===e?void 0:e.call(r))&&void 0!==t?t:[]};case"getAllDisplayedColumns":return()=>{var e,t;return null!==(t=null===(e=r.getAllDisplayedColumns)||void 0===e?void 0:e.call(r))&&void 0!==t?t:[]};case"getColumnState":return()=>{var e,t;return null!==(t=null===(e=r.getColumnState)||void 0===e?void 0:e.call(r))&&void 0!==t?t:[]};case"setColumnsVisible":return(e,t)=>{var i;for(const a of e)null===(i=r.setColumnVisible)||void 0===i||i.call(r,a,t)};case"applyColumnState":return e=>{var t;return null===(t=r.applyColumnState)||void 0===t?void 0:t.call(r,e)};default:return Reflect.get(e,t,i)}}}):null}const ut=new WeakMap;class pt extends((0,xe.S)(ae.FoundationElement)){constructor(){super(...arguments),this.label="Column Selection",this.sort=Ye,this.open=!1,this.gridApi=null,this.gridHost=null,this.search="",this.selectedItems=[],this.unselectedItems=[],this.selectAllChecked=!1,this.selectAllIndeterminate=!1,this.resolvedSort=Ye,this.dragColId=null,this.dragOverElement=null,this.dragBindingAbort=null,this.agDragBindings=[],this.columnDragBridge=null,this.dragBridgeRetryId=0,this.pendingVisibility=new Map,this.boundRefresh=()=>this.refresh(),this.handleClickOutside=e=>{this.open&&this.root&&e.isTrusted&&(e.composedPath().includes(this.root)||(this.open=!1))}}get pickerApi(){var e;return null!==(e=ut.get(this))&&void 0!==e?e:null}set pickerApi(e){ut.set(this,e)}get pickerRoot(){var e;return null!==(e=this.panelEl)&&void 0!==e?e:null}get canDrag(){return!this.search.trim()}canDragToGrid(e){return!(!this.canDrag||e.lockVisible)&&("ag-grid"===this.resolvedSort||!e.visible)}get toggleableItems(){return[...this.selectedItems,...this.unselectedItems].filter(e=>!e.lockVisible)}openChanged(e){void 0!==e&&this.$fastController.isConnected&&(this.open?n.DOM.queueUpdate(()=>{this.subscribePicker(),this.refresh(),this.showPanel(),requestAnimationFrame(()=>{this.open&&document.addEventListener("mousedown",this.handleClickOutside)})}):(document.removeEventListener("mousedown",this.handleClickOutside),this.unsubscribePicker(),this.hidePanel()))}sortChanged(){this.resolvedSort=We(this.sort),this.open&&this.refresh()}gridApiChanged(){this.open&&this.resubscribePicker()}gridHostChanged(){this.open&&this.resubscribePicker()}panelElChanged(){this.open&&n.DOM.queueUpdate(()=>{this.refresh(),this.showPanel()})}connectPicker(){this.subscribePicker(),this.refresh()}toggle(){this.open=!this.open}close(){this.open=!1}refresh(){var e,t,i,r,a,s,o,l,d;if(this.resolvedSort=We(this.sort),!this.pickerApi)return;const c=this.pickerRoot,g=document.activeElement,h=g&&(null==c?void 0:c.contains(g))?g.getAttribute("data-test-id"):null,u=null!==(i=null===(t=(e=this.pickerApi).getAllDisplayedColumns)||void 0===t?void 0:t.call(e))&&void 0!==i?i:[],p=null!==(s=null===(a=(r=this.pickerApi).getColumns)||void 0===a?void 0:a.call(r))&&void 0!==s?s:[],m=null!==(d=null===(l=(o=this.pickerApi).getColumnState)||void 0===l?void 0:l.call(o))&&void 0!==d?d:[],v=Ze(u,p,this.resolvedSort,m),f=this.applyPendingVisibility(Je(v)),{selected:b,unselected:C}=et(f,this.search,this.resolvedSort);this.selectedItems=b,this.unselectedItems=C,this.syncSelectAllState(),h&&c&&n.DOM.queueUpdate(()=>{var e;null===(e=c.querySelector(`[data-test-id="${h}"]`))||void 0===e||e.focus()}),n.DOM.queueUpdate(()=>{this.bindRowDrag()})}disconnectedCallback(){document.removeEventListener("mousedown",this.handleClickOutside),this.hidePanel(),this.unsubscribePicker(),this.open=!1,super.disconnectedCallback()}showPanel(){const e=this.panelEl;if(e&&"function"==typeof e.showPopover&&!e.matches(":popover-open"))try{e.showPopover({source:this.buttonEl})}catch(t){e.showPopover()}}hidePanel(){const e=this.panelEl;e&&"function"==typeof e.hidePopover&&e.matches(":popover-open")&&e.hidePopover()}subscribePicker(){var e,t,i;const r=ht(this.gridHost,this.gridApi);r&&this.pickerApi===r||(this.unsubscribePicker(),r&&(this.pickerApi=r,this.columnDragBridge=null!==(i=null===(t=null===(e=this.gridHost)||void 0===e?void 0:e.getColumnDragBridge)||void 0===t?void 0:t.call(e))&&void 0!==i?i:null,this.resolvedSort=We(this.sort),this.pickerApi.addEventListener("columnVisible",this.boundRefresh),this.pickerApi.addEventListener("columnMoved",this.boundRefresh),this.pickerApi.addEventListener("newColumnsLoaded",this.boundRefresh),this.pickerApi.addEventListener("displayedColumnsChanged",this.boundRefresh)))}resubscribePicker(){this.subscribePicker(),this.refresh()}unsubscribePicker(){var e;this.dragBridgeRetryId+=1,null===(e=this.dragBindingAbort)||void 0===e||e.abort(),this.dragBindingAbort=null;for(const e of this.agDragBindings)e.remove();this.agDragBindings=[],this.pendingVisibility.clear(),this.pickerApi&&(this.pickerApi.removeEventListener("columnVisible",this.boundRefresh),this.pickerApi.removeEventListener("columnMoved",this.boundRefresh),this.pickerApi.removeEventListener("newColumnsLoaded",this.boundRefresh),this.pickerApi.removeEventListener("displayedColumnsChanged",this.boundRefresh)),this.pickerApi=null}syncSelectAllState(){const e=this.toggleableItems,t=e.filter(e=>e.visible).length;this.selectAllChecked=e.length>0&&t===e.length,this.selectAllIndeterminate=t>0&&t<e.length}applyPendingVisibility(e){return this.pendingVisibility.size?e.map(e=>{const t=this.pendingVisibility.get(e.colId);return void 0===t?e:(e.visible===t&&this.pendingVisibility.delete(e.colId),Object.assign(Object.assign({},e),{visible:t}))}):e}resolveDragBridge(){var e;return null!==(e=ct(this.columnDragBridge))&&void 0!==e?e:gt(this.pickerApi)}bindRowDrag(){var e;null===(e=this.dragBindingAbort)||void 0===e||e.abort(),this.dragBindingAbort=null;for(const e of this.agDragBindings)e.remove();this.agDragBindings=[];const t=this.pickerRoot;if(!this.canDrag||!this.pickerApi||!t)return;const i=this.resolveDragBridge(),r=t.querySelectorAll(".grid-pro-columns-item");if(!r.length)return;const a=new AbortController;this.dragBindingAbort=a;const{signal:s}=a;let o=!1,n=!1;r.forEach(e=>{const t=e.dataset.colId,r=e.querySelector(".grid-pro-columns-handle");if(!t||!r)return;r.classList.remove("grid-pro-columns-handle-grid-drag","grid-pro-columns-handle-panel-drag"),r.removeAttribute("draggable");const a=[...this.selectedItems,...this.unselectedItems].find(e=>e.colId===t);if(!a)return;const l=this.canDragToGrid(a),d="selected-first"===this.resolvedSort&&a.visible&&!e.classList.contains("grid-pro-columns-item--unselected");if(l)if(i){const e=je(i,this.pickerApi,r,t,a.headerName);if(e&&(n=!0,this.agDragBindings.push(e),r.classList.add("grid-pro-columns-handle-grid-drag"),!d))return}else o=!0;d&&(r.draggable=!0,r.classList.add("grid-pro-columns-handle-panel-drag"),r.addEventListener("dragstart",i=>{this.onDragStart(i,t,e)},{signal:s}),r.addEventListener("dragend",()=>this.onDragEnd(),{signal:s}),e.addEventListener("dragover",t=>{this.onDragOver(t,e)},{signal:s}),e.addEventListener("dragleave",t=>{this.onDragLeave(t,e)},{signal:s}),e.addEventListener("drop",e=>{this.onDrop(e,t)},{signal:s}))}),o&&!n&&this.scheduleDragBridgeRetry()}scheduleDragBridgeRetry(e=0){if(e>30||!this.pickerApi||!this.canDrag)return;this.dragBridgeRetryId+=1;const t=this.dragBridgeRetryId;requestAnimationFrame(()=>{t===this.dragBridgeRetryId&&this.isConnected&&(this.resolveDragBridge()?this.bindRowDrag():this.scheduleDragBridgeRetry(e+1))})}onSearchInput(e){this.search=e,this.refresh()}onSelectAllClick(e){var t,i;if(null===(t=e.preventDefault)||void 0===t||t.call(e),null===(i=e.stopImmediatePropagation)||void 0===i||i.call(e),!this.pickerApi)return;const r=this.toggleableItems;if(!r.length)return;const a=!this.selectAllChecked,s=r.filter(e=>e.visible!==a).map(e=>e.colId);if(s.length){for(const e of s)this.pendingVisibility.set(e,a);this.pickerApi.setColumnsVisible(s,a),this.refresh()}}onCheckboxClick(e,t){t.preventDefault(),t.stopPropagation(),this.onVisibilityChange(e,!e.visible)}onVisibilityChange(e,t){!e.lockVisible&&this.pickerApi&&e.visible!==t&&(this.pendingVisibility.set(e.colId,t),this.pickerApi.setColumnsVisible([e.colId],t),this.refresh())}onDragStart(e,t,i){this.canDrag?(this.dragColId=t,e.dataTransfer&&(e.dataTransfer.setData("text/plain",t),e.dataTransfer.effectAllowed="move"),(null!=i?i:e.currentTarget).classList.add("dragging")):e.preventDefault()}onDragEnd(){var e;this.dragColId=null,this.clearDragOverHighlight(),null===(e=this.pickerRoot)||void 0===e||e.querySelectorAll(".grid-pro-columns-item.dragging").forEach(e=>{e.classList.remove("dragging")})}onDragOver(e,t){var i;this.canDrag&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),this.dragOverElement!==t&&(null===(i=this.dragOverElement)||void 0===i||i.classList.remove("drag-over"),this.dragOverElement=t,t.classList.add("drag-over")))}onDragLeave(e,t){this.dragOverElement!==t||t.contains(e.relatedTarget)||(t.classList.remove("drag-over"),this.dragOverElement=null)}onDrop(e,t){var i;e.preventDefault(),this.clearDragOverHighlight();const r=this.dragColId||(null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"));r&&this.reorderSelected(r,t)}clearDragOverHighlight(){var e;null===(e=this.dragOverElement)||void 0===e||e.classList.remove("drag-over"),this.dragOverElement=null}reorderSelected(e,t){var i,r,a,s,o,n,l,d,c;if(!this.pickerApi||!this.pickerApi.getColumnState||!this.pickerApi.applyColumnState)return;const g=null!==(a=null===(r=(i=this.pickerApi).getAllDisplayedColumns)||void 0===r?void 0:r.call(i))&&void 0!==a?a:[],h=null!==(n=null===(o=(s=this.pickerApi).getColumns)||void 0===o?void 0:o.call(s))&&void 0!==n?n:[],u=null!==(c=null===(d=(l=this.pickerApi).getColumnState)||void 0===d?void 0:d.call(l))&&void 0!==c?c:[],p=Je(Ze(g,h,this.resolvedSort,u)),m=p.filter(e=>e.visible).map(e=>e.colId),{selected:v}=et(p,this.search,this.resolvedSort),f=tt(m,"selected-first"===this.resolvedSort?v.map(e=>e.colId):v.filter(e=>e.visible).map(e=>e.colId),e,t);f&&this.pickerApi.applyColumnState({state:it(u,f),applyOrder:!0})}}(0,r.Cg)([n.attr],pt.prototype,"label",void 0),(0,r.Cg)([n.attr],pt.prototype,"sort",void 0),(0,r.Cg)([n.observable],pt.prototype,"open",void 0),(0,r.Cg)([n.observable],pt.prototype,"gridApi",void 0),(0,r.Cg)([n.observable],pt.prototype,"gridHost",void 0),(0,r.Cg)([n.observable],pt.prototype,"root",void 0),(0,r.Cg)([n.observable],pt.prototype,"buttonEl",void 0),(0,r.Cg)([n.observable],pt.prototype,"panelEl",void 0),(0,r.Cg)([n.observable],pt.prototype,"search",void 0),(0,r.Cg)([n.observable],pt.prototype,"selectedItems",void 0),(0,r.Cg)([n.observable],pt.prototype,"unselectedItems",void 0),(0,r.Cg)([n.observable],pt.prototype,"selectAllChecked",void 0),(0,r.Cg)([n.observable],pt.prototype,"selectAllIndeterminate",void 0);const mt=pt.compose({baseName:"column-selection",template:at("foundation"),styles:rt.H});var vt=i(63296),ft=i(81876),bt=i(48707),Ct=i(96730),yt=i(57963),St=i(24669),wt=i(49964),Rt=i(90509),Et=i(79270),At=i(35610),kt=i(21281),Dt=i(34193),Ot=i(44561);class It{constructor(e){this.rowData=new Map,this.pendingBlocks=new Set,this.deliveredRowCount=0,this.streamStarted=!1,this.moreRowsInFlight=!1,this.hasCriteria=!1,this.viewTruncationWarned=!1,this.createSnapshotFunc=e.createSnapshotFunc,this.createDataserverStreamFunc=e.createDataserverStreamFunc,this.getMoreRowsFunc=e.getMoreRowsFunc,this.onRowsInvalidatedFunc=e.onRowsInvalidatedFunc,this.onRowsUpdatedFunc=e.onRowsUpdatedFunc,this.errorHandlerFunc=e.errorHandlerFunc,this.resourceName=e.resourceName,this.resourceParams=Object.assign({},e.resourceParams),this.resourceIndexes=e.resourceIndexes,this.resourceColDefs=e.resourceColDefs,this.maxRows=e.maxRows,this.rowId=e.rowId,this.baseCriteria=e.baseCriteria||"",this.isRequestServer=e.isRequestServer}buildRequestServerParams(e,t,i){const r=Object.assign({},this.resourceParams);return r.DETAILS=Object.assign({},r.DETAILS),r.DETAILS.MAX_ROWS=this.maxRows,r.DETAILS.OFFSET=e,t?r.DETAILS.CRITERIA_MATCH=t:delete r.DETAILS.CRITERIA_MATCH,r.DETAILS.ORDER_BY=i.orderBy||`${this.rowId} ASC`,r}buildDataserverLogonParams(e,t){const i=Object.assign({},this.resourceParams);return i.MAX_ROWS=this.maxRows,delete i.VIEW_NUMBER,e?i.CRITERIA_MATCH=e:delete i.CRITERIA_MATCH,t.orderBy?(i.ORDER_BY=t.orderBy,i.REVERSE=t.reverse):(delete i.ORDER_BY,delete i.REVERSE),i}getLastRow(e,t,i,r){return"MORE_ROWS"in e&&!1===e.MORE_ROWS?t+i:!r&&"ROWS_COUNT"in e&&"number"==typeof e.ROWS_COUNT?e.ROWS_COUNT:-1}getRows(e){return(0,r.sH)(this,void 0,void 0,function*(){Ne.v.debug("Infinite getRows called",{startRow:e.startRow,endRow:e.endRow,isRequestServer:this.isRequestServer});try{const t=(0,Ot.P4)(e.filterModel,this.resourceColDefs),i=[this.baseCriteria,t].filter(Boolean).join(" && "),r=function(e,t,i=!1){if(!e||0===e.length)return{orderBy:null,reverse:!1};const r=e[0],a=r.colId,s="desc"===r.sort;if(i)return{orderBy:`${a} ${s?"DESC":"ASC"}`,reverse:!1};for(const[e,i]of t.entries())if(e&&i.includes(a))return{orderBy:e,reverse:s};return Ne.v.warn(`Column '${a}' is not part of any named INDEX. Server-side sorting is not available for this column.`),{orderBy:null,reverse:!1}}(e.sortModel,this.resourceIndexes,this.isRequestServer);if(!this.isRequestServer)return void this.getDataserverRows(e,i,r);const a=this.buildRequestServerParams(e.startRow,i,r);Ne.v.debug("Infinite datasource request params",a);const s=yield this.createSnapshotFunc(a);if(!s)return void e.failCallback();if("REPLY"in s&&Array.isArray(s.REPLY)){const t=s.REPLY,r=this.getLastRow(s,e.startRow,t.length,Boolean(i));return void e.successCallback(t,r)}e.successCallback([],e.startRow)}catch(t){Ne.v.error("Error in infinite getRows:",t),this.errorHandlerFunc&&this.errorHandlerFunc(t instanceof Error?t.message:String(t),"unknown"),e.failCallback()}})}getDataserverRows(e,t,i){if(!this.createDataserverStreamFunc||!this.getMoreRowsFunc)return Ne.v.error("Infinite DATASERVER paging requires a stream and a getMoreRows function"),void e.failCallback();const r=JSON.stringify(Object.assign({criteria:t},i));void 0!==this.subscriptionKey&&this.subscriptionKey!==r&&this.teardownDataserverSubscription(),this.subscriptionKey=r;const a=Number.isFinite(Number(e.startRow))?Number(e.startRow):0,s=Number.isFinite(Number(e.endRow))?Number(e.endRow):a+this.maxRows,o={startRow:a,endRow:s,settled:!1,success:e.successCallback,fail:e.failCallback};if(this.streamStarted&&(this.rowData.size>=s||!1===this.moreRows))this.settleBlock(o,!0);else{if(o.timer=this.createBlockTimer(o),this.pendingBlocks.add(o),!this.dataserverStream){const e=this.buildDataserverLogonParams(t,i);return this.hasCriteria=Boolean(e.CRITERIA_MATCH),this.dataserverStream=this.createDataserverStreamFunc(e),void(this.dataserverStreamSubscription=this.dataserverStream.subscribe(e=>this.handleDataserverMessage(e)))}this.pumpMoreRows()}}pumpMoreRows(){this.moreRowsInFlight||!1===this.moreRows||0===this.pendingBlocks.size||this.dataserverStream&&this.dataserverStreamSubscription&&this.sourceRef&&(this.moreRowsInFlight=!0,this.requestMoreRows())}requestMoreRows(){return(0,r.sH)(this,void 0,void 0,function*(){if(this.dataserverStreamSubscription&&this.sourceRef)try{yield this.getMoreRowsFunc(this.sourceRef)}catch(e){if(this.moreRowsInFlight=!1,(null==e?void 0:e.status)===It.HTTP_NOT_FOUND)return Ne.v.warn(`Infinite DATASERVER paging is not available on this connection (MORE_ROWS answered 404, expected over HTTP/feature.forceHttp). ${this.resourceName} is truncated to the ${this.rowData.size} row(s) already delivered; use a websocket connection, or a REQUEST_SERVER resource, to page further.`),this.moreRows=!1,this.viewTruncationWarned=!0,void this.settleCoveredBlocks();Ne.v.error("Infinite DATASERVER MORE_ROWS failed:",e),this.failAllPendingBlocks()}else this.moreRowsInFlight=!1})}handleDataserverMessage(e){var t,i,r,a,s,o;const n=null==e?void 0:e.MESSAGE_TYPE;if(n===kt.Go.LOGOFF_ACK||n===kt.Go.MSG_NACK)return null===(t=this.errorHandlerFunc)||void 0===t||t.call(this,n===kt.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`,"connection"),void this.teardownDataserverSubscription();this.sourceRef=null!==(i=null==e?void 0:e.SOURCE_REF)&&void 0!==i?i:this.sourceRef;const l=(null==e?void 0:e.ROW)?(0,Dt.d)(e,this.rowId):void 0;if((null!==(a=null===(r=null==l?void 0:l.updates)||void 0===r?void 0:r.length)&&void 0!==a?a:0)>0||(null!==(o=null===(s=null==l?void 0:l.deletes)||void 0===s?void 0:s.length)&&void 0!==o?o:0)>0)return this.streamStarted=!0,void this.notifyLiveChange(l);const d=this.moreRowsInFlight||this.pendingBlocks.size>0||!this.streamStarted;if(this.moreRowsInFlight=!1,void 0!==(null==e?void 0:e.MORE_ROWS)&&(this.moreRows=e.MORE_ROWS),l){if(void 0!==e.ROWS_COUNT&&void 0===this.serverRowsCount&&(this.serverRowsCount=e.ROWS_COUNT),!d)return this.streamStarted=!0,void this.notifyLiveChange(l);this.accumulate(l),this.refreshPendingDeadlines()}this.streamStarted=!0,this.settleCoveredBlocks(),this.pumpMoreRows()}notifyLiveChange(e){var t,i,r,a,s,o,n,l,d,c,g,h,u,p;const m=(null!==(i=null===(t=e.inserts)||void 0===t?void 0:t.length)&&void 0!==i?i:0)>0||(null!==(a=null===(r=e.deletes)||void 0===r?void 0:r.length)&&void 0!==a?a:0)>0,v=(null!==(o=null===(s=e.updates)||void 0===s?void 0:s.length)&&void 0!==o?o:0)>0;if(m)return Ne.v.debug("Infinite DATASERVER live change invalidates the cache",{inserts:null!==(l=null===(n=e.inserts)||void 0===n?void 0:n.length)&&void 0!==l?l:0,deletes:null!==(c=null===(d=e.deletes)||void 0===d?void 0:d.length)&&void 0!==c?c:0}),this.reset(),void(null===(g=this.onRowsInvalidatedFunc)||void 0===g||g.call(this));v&&(this.accumulate(e),Ne.v.debug("Infinite DATASERVER live update patched into the cache",{updates:null!==(u=null===(h=e.updates)||void 0===h?void 0:h.length)&&void 0!==u?u:0}),null===(p=this.onRowsUpdatedFunc)||void 0===p||p.call(this))}refreshPendingDeadlines(){for(const e of this.pendingBlocks)clearTimeout(e.timer),e.timer=this.createBlockTimer(e)}createBlockTimer(e){return setTimeout(()=>{Ne.v.warn(`Infinite DATASERVER block ${e.startRow}-${e.endRow} for ${this.resourceName} timed out waiting for rows; resolving with ${this.rowData.size} accumulated row(s).`),this.settleBlock(e,!0)},It.BLOCK_RESOLVE_TIMEOUT_MS)}accumulate(e){var t,i,r;const a=new Map(this.rowData);null===(t=e.inserts)||void 0===t||t.forEach(e=>{const t=null==e?void 0:e[this.rowId];void 0!==t&&a.set(t,e)}),null===(i=e.updates)||void 0===i||i.forEach(e=>{const t=null==e?void 0:e[this.rowId];if(void 0===t)return;const i=a.get(t);a.set(t,i?Object.assign(Object.assign({},i),e):e)}),null===(r=e.deletes)||void 0===r||r.forEach(e=>{const t=null==e?void 0:e[this.rowId];if(void 0===t)return;const i=this.cacheIndexOf(a,t);-1===i||this.deliveredRowCount>0&&i<this.deliveredRowCount||a.delete(t)}),this.rowData=a}cacheIndexOf(e,t){let i=0;for(const r of e.keys()){if(r===t)return i;i+=1}return-1}settleCoveredBlocks(){for(const e of[...this.pendingBlocks])(this.rowData.size>=e.endRow||!1===this.moreRows)&&this.settleBlock(e,!0)}settleBlock(e,t){var i;if(e.settled)return;if(e.settled=!0,this.pendingBlocks.delete(e),clearTimeout(e.timer),!t)return void e.fail();const r=[...this.rowData.values()].slice(e.startRow,e.endRow);this.deliveredRowCount=Math.max(this.deliveredRowCount,e.startRow+r.length);const a=!1===this.moreRows?this.rowData.size:this.hasCriteria?-1:null!==(i=this.serverRowsCount)&&void 0!==i?i:-1;this.warnIfViewTruncated(),Ne.v.debug("Infinite DATASERVER block settled",{startRow:e.startRow,endRow:e.endRow,rows:r.length,cached:this.rowData.size,lastRow:a}),e.success(r,a)}warnIfViewTruncated(){var e,t;this.viewTruncationWarned||!1!==this.moreRows||this.hasCriteria||void 0===this.serverRowsCount||this.rowData.size>=this.serverRowsCount||(this.viewTruncationWarned=!0,Ne.v.warn(`${this.resourceName} stopped at ${this.rowData.size} of ${this.serverRowsCount} rows: the DATASERVER view is capped by MAX_VIEW (${null!==(t=null===(e=this.resourceParams)||void 0===e?void 0:e.MAX_VIEW)&&void 0!==t?t:"server default"}). Raise max-view past the row count to reach the rest.`))}failAllPendingBlocks(){for(const e of[...this.pendingBlocks])this.settleBlock(e,!1)}reset(){this.teardownDataserverSubscription()}teardownDataserverSubscription(){var e;this.failAllPendingBlocks(),null===(e=this.dataserverStreamSubscription)||void 0===e||e.unsubscribe(),this.dataserverStreamSubscription=void 0,this.dataserverStream=void 0,this.subscriptionKey=void 0,this.sourceRef=void 0,this.rowData=new Map,this.deliveredRowCount=0,this.streamStarted=!1,this.serverRowsCount=void 0,this.hasCriteria=!1,this.viewTruncationWarned=!1,this.moreRows=void 0,this.moreRowsInFlight=!1}destroy(){this.teardownDataserverSubscription(),Ne.v.debug("GenesisInfiniteDatasource destroyed")}}It.BLOCK_RESOLVE_TIMEOUT_MS=1e4,It.HTTP_NOT_FOUND=404;var xt=i(62922);let Tt=class extends((0,xe.S)(At.ML)){constructor(){super(...arguments),this.request={},this.onDatasourceReady=e=>(0,r.sH)(this,void 0,void 0,function*(){if(!(yield this.initializeDatasource(this.datasourceOptions(),!0,!1)))return Ne.v.debug(`Genesis Datasource init failed for ${this.resourceName}`),this.clearRowData(),void this.setDisconnected(!0);this.$emit(Rt.V.dataInit),this.setDisconnected(!1),this.indexes=this.getResourceIndexes(this.datasource.availableIndexes,this.datasource.availableSortableFields);const e=(0,bt.X)(this.datasource.originalFieldDef),t=yield this.getAgColumnDefs(e);this.$emit(Et.c.schemaUpdated,{schema:t,metadata:e}),this.infiniteDatasource=new It({createSnapshotFunc:this.createSnapshot.bind(this),createDataserverStreamFunc:this.createDataserverStream.bind(this),getMoreRowsFunc:e=>this.connect.getMoreRows(e,0),onRowsInvalidatedFunc:()=>this.$emit(Et.c.refreshInfiniteCache,{purge:!0}),onRowsUpdatedFunc:()=>this.$emit(Et.c.refreshInfiniteCache,{purge:!1}),errorHandlerFunc:this.handleErrors.bind(this),resourceName:this.resourceName,resourceParams:this.isRequestServer?this.datasource.requestOnlyParams:this.datasource.dataserverOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,rowId:this.rowId,baseCriteria:this.criteria,isRequestServer:this.isRequestServer}),this.$emit(Et.c.setInfiniteDatasource,{datasource:this.infiniteDatasource}),this.setupCommitTriggeredRefresh(),this.$emit(Et.c.addGridCssClass,{className:"grid-pro-infinite"}),this.$emit(Et.c.filtersRestored)})}resourceNameChanged(e,t){e&&e!==t&&n.DOM.queueUpdate(()=>(0,r.sH)(this,void 0,void 0,function*(){yield this.restart()}))}criteriaChanged(e,t){const i=e!==(0,Ct.Q)(t,";");this.infiniteDatasource&&i&&n.DOM.queueUpdate(()=>(0,r.sH)(this,void 0,void 0,function*(){yield this.reloadResourceData()}))}connectedCallback(){super.connectedCallback();const e=this.shouldRunConnect;n.DOM.queueUpdate(()=>{e&&(this.init(),this.subscribeToConnection())})}disconnectedCallback(){super.disconnectedCallback();const e=this.shouldRunDisconnect;n.DOM.queueUpdate(()=>(0,r.sH)(this,void 0,void 0,function*(){e&&(yield this.destroy(),this.unsubscribeFromConnection())}))}deepClone(){const e=super.deepClone();return e.deferredGridOptions=structuredClone(this.deferredGridOptions),e.deferredColumnStates=structuredClone(this.deferredColumnStates),e}reloadResourceData(){return(0,r.sH)(this,void 0,void 0,function*(){var e,t;null===(t=null===(e=this.infiniteDatasource)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),this.infiniteDatasource=void 0,this.datasource.destroy(),this.$emit(Et.c.cacheFilterConfig),this.clearRowData(!1),this.setDisconnected(!1),this.$emit(Et.c.refreshInfiniteCache,{purge:!0}),yield this.init()})}init(){return(0,r.sH)(this,void 0,void 0,function*(){const e=Object.assign({getRowId:e=>e.data?String(e.data[this.rowId]):null,cacheBlockSize:this.maxRows,defaultColDef:{filter:!0,resizable:!0,sortable:!1,unSortIcon:!0},rowBuffer:0,rowModelType:"infinite",suppressMultiSort:!0,cacheOverflowSize:2,maxConcurrentDatasourceRequests:1,infiniteInitialRowCount:1,maxBlocksInCache:10},this.deferredGridOptions);this.$emit(Et.c.initialize,{options:e,keepColDefsOnClearRowData:this.keepColDefsOnClearRowData}),this.clearReadyListener(),this.addEventListener(Et.c.ready,this.onDatasourceReady,{once:!0}),this.resourceName||this.handleErrors("Application not connected or invalid resource name, datasource will not work.","unknown")})}clearReadyListener(){this.removeEventListener(Et.c.ready,this.onDatasourceReady)}destroy(){return(0,r.sH)(this,void 0,void 0,function*(){var e,t;this.clearReadyListener(),this.teardownCommitTriggeredRefresh(),this.$emit(Et.c.removeGridCssClass,{className:"grid-pro-infinite"}),this.datasource.destroy(),this.clearRowData(),this.infiniteDatasource&&(null===(t=(e=this.infiniteDatasource).destroy)||void 0===t||t.call(e),this.infiniteDatasource=void 0),this.$emit(Et.c.setInfiniteDatasource,{datasource:null})})}restart(){return(0,r.sH)(this,void 0,void 0,function*(){yield this.destroy(),yield this.init()})}clearRowData(e=!0){this.rowData=new Map,e&&this.$emit(Et.c.dataCleared,{includeSchema:!0}),this.transactionData={remove:[]}}setupCommitTriggeredRefresh(){var e;this.teardownCommitTriggeredRefresh(),!this.isSnapshot&&this.isRequestServer&&(null===(e=this.pollTriggerEvents)||void 0===e?void 0:e.length)&&(this.commitResponseUnsubscribe=this.connectEvents.addCommitResponseListener(e=>{var t;const{eventName:i,response:r}=e.detail;this.pollTriggerEvents.includes(i)&&(null===(t=r.MESSAGE_TYPE)||void 0===t?void 0:t.endsWith("_ACK"))&&(Ne.v.debug(`Commit ACK for ${i}, re-reading the loaded blocks.`),this.$emit(Et.c.refreshInfiniteCache,{purge:!1}))}))}teardownCommitTriggeredRefresh(){var e;null===(e=this.commitResponseUnsubscribe)||void 0===e||e.call(this),this.commitResponseUnsubscribe=void 0}createSnapshot(){return(0,r.sH)(this,arguments,void 0,function*(e=null){return yield this.datasource.snapshot(e)})}createDataserverStream(e=null){return this.connect.stream(this.resourceName,()=>{},e=>{var t;Ne.v.error("Infinite DATASERVER paged stream error:",e),this.handleErrors((null===(t=null==e?void 0:e.receivedMessage)||void 0===t?void 0:t.ERROR)||(null==e?void 0:e.message),"stream")},e)}getAgColumnDefs(e){return(0,r.sH)(this,void 0,void 0,function*(){const t=this.generateColumnDefsFromMetadata(e,xt.O,xt.c),i=new Set;return this.indexes.forEach((e,t)=>{t&&e.forEach(e=>i.add(e))}),t.forEach(e=>{e.sortable=this.isRequestServer||i.has(e.field),this.datasource.criteriaOnlyRequest&&(e.filter=this.datasource.availableCriteriaFields.includes(e.field)?e.filter:null)}),t})}loadMore(){Ne.v.warn("loadMore() is not needed for Infinite Row Model - scrolling triggers data loading automatically")}};(0,r.Cg)([yt.dm],Tt.prototype,"connect",void 0),(0,r.Cg)([St.a4],Tt.prototype,"connectEvents",void 0),(0,r.Cg)([wt.yW],Tt.prototype,"datasource",void 0),(0,r.Cg)([n.observable],Tt.prototype,"request",void 0),Tt=(0,r.Cg)([(0,n.customElement)({name:"grid-pro-infinite-datasource"})],Tt);var Lt=i(18070),Pt=i(26062),Ft=i(32610),Gt=i(53397),$t=i(52540),Mt=i(49104),_t=i(88863),Nt=i(71964),Bt=i(73203),Ht=i(50103),Vt=i(23201);(0,Ie.N)(Pt.D,vt.L,ft.X,Tt,$e.O,Me.G,pt),Le.syG.registerModules([Le.n76,Le.Q90,Le.x6L,Le.YN8,Le.YzW,Le.Lt,Le.I95,Le.O4V,Le.H18,Le.mfG,Le.Iws,Le.nSw,Le.FUS,Le.Ss0,Le.tkg,Le.ZDV,Le.ZyC,Le.XG7,Le.VZy,Le.$I9,Le.dGu,Le.AJG,Le.c5B,Le.BG,Le.KIB,Le.Sko,Le.ZuP,Le.Vc,lt]);const zt="gridReady";class Ut extends((0,xe.S)(ae.FoundationElement)){getColumnDragBridge(){return this.columnDragBridge}rowDataChanged(e,t){this.initialised&&this.gridApi&&this.gridApi.setGridOption("rowData",t)}gridSlotChanged(){this.gridSlot&&!this.initialised&&this.agGridOptions&&this.initGrid()}enableColumnSelectionChanged(){this.syncColumnSelectionHostLayout()}getfilterModel(){return(0,r.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){this.persistFilterModelKey?yield this.statePersistence.saveFilterModel(this.persistFilterModelKey,e):this._filterConfig=e})}constructor(){super(),this.gridErrorItems=[],this.disposed=!1,this.debouncedSaveColumnState=Ge()(this.saveColumnState.bind(this),400),this.debouncedSaveFilterModel=Ge()(this.cacheFilterConfig.bind(this),400),this.debouncedNotifyDatasourceVisibleColumns=Ge()(this.notifyDatasourceVisibleColumns.bind(this),400),this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.enableCellFlashing=!1,this.enableRowFlashing=!1,this.columnDragBridge={},this.columnComponentName="grid-pro-column",this.themeMode="dark",this.statusBarConfig=s.o2,this.withStatusBar=!1,this.enableColumnSelection=!1,this.applyingDatasourceGridOptions=!1,this.rehydrationAttempted=!1,this.rootEventsListeners=[],this.datasourceEventHandlers=[],this.gridEventsQueue=[],this.registeredGridEvents=new Set,this.gridEventListeners=new Map,this.boundGlobalEventListener=this.globalEventListener.bind(this),this._filterConfig=void 0,this.handleLuminanceChange=e=>{const t=o.baseLayerLuminance.getValueFor(e.target);this.themeMode=t===o.StandardLuminance.DarkMode?"dark":"light"},this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.agAttributes={},this.agPropertiesMap=Ft.zI.reduce((e,t)=>(e[t.toLowerCase()]=t,e[(0,Ht.w)(t)]=t,e),{});const e=this.hideDatasourceError.bind(this);this.rootEventsListeners.push([Rt.V.dataInit,e],[Ft.yY.datasourceErrorClose,e],[Lt.L.error,this.handleBaseDatasourceError.bind(this)],[Lt.L.connected,e]),this.datasourceEventHandlers=[[Et.c.initialize,this.handleInitialize.bind(this)],[Et.c.dataLoaded,this.handleDataLoaded.bind(this)],[Et.c.dataChanged,this.handleDataChanged.bind(this)],[Et.c.schemaUpdated,this.handleSchemaUpdated.bind(this)],[Et.c.dataCleared,this.handleDataCleared.bind(this)],[Et.c.loadingStarted,this.handleLoadingStarted.bind(this)],[Et.c.loadingFinished,this.handleLoadingFinished.bind(this)],[Et.c.noDataAvailable,this.handleNoDataAvailable.bind(this)],[Et.c.filtersRestored,this.handleFiltersRestored.bind(this)],[Et.c.moreDataAvailable,this.handleMoreDataAvailable.bind(this)],[Et.c.error,this.handleDatasourceError.bind(this)],[Et.c.destroy,this.handleDatasourceDestroy.bind(this)],[Et.c.cacheFilterConfig,this.cacheFilterConfig.bind(this)],[Et.c.refreshServerSide,this.handleRefreshServerSide.bind(this)],[Et.c.setServerSideDatasource,this.handleSetServerSideDatasource.bind(this)],[Et.c.addGridCssClass,this.handleAddGridCssClass.bind(this)],[Et.c.removeGridCssClass,this.handleRemoveGridCssClass.bind(this)],[Et.c.applyServerSideTransaction,this.handleApplyServerSideTransaction.bind(this)],[Et.c.setInfiniteDatasource,this.handleSetInfiniteDatasource.bind(this)],[Et.c.refreshInfiniteCache,this.handleRefreshInfiniteCache.bind(this)]]}addEventListener(e,t,i){super.addEventListener(e,t,i),this.gridApi?this.addGridEventListener(e):this.gridEventsQueue.includes(e)||this.gridEventsQueue.push(e)}addGridEventListener(e){if(this.registeredGridEvents.has(e))return;this.registeredGridEvents.add(e);const t=t=>{this.$emit(e,t)};this.gridEventListeners.set(e,t),this.gridApi.addEventListener(e,t)}handleError(e,t){this.gridErrorItems=[...this.gridErrorItems,{detail:t.detail,type:e}]}handleBaseDatasourceError(e){const t={detail:{message:e.detail.message},type:Ft.Ie.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:t.detail,type:t.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(e=>e.type!==Ft.Ie.datasource),this.removeAttribute("ds-disconnected")}connectedCallback(){var e;super.connectedCallback(),this.syncColumnSelectionHostLayout(),this.disposed=!1;const t=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=o.baseLayerLuminance.subscribe(this.luminanceObserver,t),this.gridAutosizingEnabled&&(this.visibilityObserverCleanup=(0,Te.j)(this,e=>{e&&this.debouncedColumnAutosize()})),this.rehydrationAttempted=!1,this.shouldRunConnect&&(this.rootEventsListeners.forEach(([e,t])=>{this.addEventListener(e,t)}),Ft.zI.forEach(e=>{const t=function(e,t){let i=Object.getPrototypeOf(e);for(;i&&i!==HTMLElement.prototype;){const e=Object.getOwnPropertyDescriptor(i,t);if(e)return e;i=Object.getPrototypeOf(i)}}(this,e);Object.defineProperty(this,e,{get:null==t?void 0:t.get,set:i=>{var r,a;const s=null===(r=null==t?void 0:t.get)||void 0===r?void 0:r.call(this);null===(a=null==t?void 0:t.set)||void 0===a||a.call(this,i),this.agAttributeChangedCallback((0,Ht.w)(e),s,i)},enumerable:!0,configurable:!0})}),this.toggleDatasourceEventListeners(!0))}disconnectedCallback(){var e;this.disposed=!0,this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel();const t=null!==(e=this.provider)&&void 0!==e?e:this;o.baseLayerLuminance.unsubscribe(this.luminanceObserver,t),this.luminanceSubscription&&(this.luminanceSubscription.unsubscribe(),this.luminanceSubscription=void 0),this.visibilityObserverCleanup&&(this.visibilityObserverCleanup(),this.visibilityObserverCleanup=void 0),super.disconnectedCallback(),this.rehydrationAttempted=!1;const i=this.shouldRunDisconnect;this.rootEventsListeners.forEach(([e,t])=>{this.removeEventListener(e,t)}),i?this.performDisconnectCleanup():queueMicrotask(()=>{this.isConnected||this.performDisconnectCleanup()})}syncColumnSelectionHostLayout(){this.classList.toggle("has-column-selection",this.enableColumnSelection)}performDisconnectCleanup(){this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.initialised=!1,this.resetGridOptionsState(),this.destroyGridInstance(),this.toggleDatasourceEventListeners(!1),this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel(),this.registeredGridEvents.clear(),this.gridEventsQueue=[]}destroyGridInstance(){this.gridApi&&this.gridEventListeners.forEach((e,t)=>{this.gridApi.removeEventListener(t,e)}),this.gridEventListeners.clear(),this.gridApi?this.gridApi.destroy():this.agGrid&&this.agGrid.destroy(),this.gridSlot&&this.gridSlot.replaceChildren(),this.gridApi=void 0,this.agGrid=void 0}toggleDatasourceEventListeners(e){const t=e?"addEventListener":"removeEventListener";this.datasourceEventHandlers.forEach(([e,i])=>{super[t](e,i)})}handleInitialize(e){const{options:t,keepColDefsOnClearRowData:i}=e.detail;i&&(this.columnState=this.gridApi.getColumnState()),this.applyingDatasourceGridOptions=!0;try{this.gridOptions=Object.assign(Object.assign(Object.assign({},this.userProvidedGridOptions),t),i?{columnDefs:this.gridApi.getColumnDefs()}:{}),this.initGrid()}finally{this.applyingDatasourceGridOptions=!1}}handleDataLoaded(e){const{data:t}=e.detail;this.gridApi&&this.gridApi.setGridOption("rowData",t)}handleDataChanged(e){const{changes:t}=e.detail;if(!this.gridApi)return;const i=this.gridApi.applyTransaction(t);this.flashAddedCells(null==i?void 0:i.add)}flashAddedCells(e){this.enableRowFlashing&&(null==e?void 0:e.length)&&this.gridApi.flashCells({rowNodes:e})}handleSchemaUpdated(e){return(0,r.sH)(this,void 0,void 0,function*(){this.gridApi?yield this.processSchemaUpdate(e.detail):this.pendingSchemaUpdate=e.detail})}processSchemaUpdate(e){return(0,r.sH)(this,arguments,void 0,function*({schema:e}){const t=this.gridApi.getColumnDefs();if(t&&t.length>0)return;this.applyCommunityFilterFallbacks(e);const i=yield this.mergeAllColumnDefsAndStates(e,!0);this.gridApi.setGridOption("columnDefs",i),this.restoreCachedFilterConfig()})}applyCommunityFilterFallbacks(e){const t=this.gridApi.isModuleRegistered("SetFilterModule"),i=this.gridApi.isModuleRegistered("MultiFilterModule");e.forEach(e=>{var r,a,s,o,n;if("agSetColumnFilter"===e.filter&&!t)return Ne.v.debug(`SetFilterModule is not registered; column '${e.field}' falls back to the enum filter`),e.filter=De.enumFilter,void(null!==(r=e.floatingFilterComponent)&&void 0!==r||(e.floatingFilterComponent=De.enumFloatingFilter));if("agMultiColumnFilter"!==e.filter)return;const l=null===(s=null===(a=e.filterParams)||void 0===a?void 0:a.filters)||void 0===s?void 0:s.find(e=>"agSetColumnFilter"===e.filter);i?!t&&l&&(Ne.v.debug(`SetFilterModule is not registered; the set sub-filter of column '${e.field}' falls back to the enum filter`),l.filter=De.enumFilter):(null===(o=null==l?void 0:l.filterParams)||void 0===o?void 0:o.values)?(Ne.v.debug(`MultiFilterModule is not registered; enum column '${e.field}' falls back to the enum filter`),e.filter=De.enumFilter,e.filterParams=Object.assign({},l.filterParams),null!==(n=e.floatingFilterComponent)&&void 0!==n||(e.floatingFilterComponent=De.enumFloatingFilter)):(Ne.v.warn("MultiFilterModule is not registered, falling back to text filter"),e.filter="agTextColumnFilter")})}handleDataCleared(e){const{includeSchema:t}=e.detail;this.gridApi&&(t&&this.gridApi.setGridOption("columnDefs",[]),this.gridApi.setGridOption("rowData",[]),this.gridApi.refreshCells({force:!0}))}handleLoadingStarted(){this.gridApi&&this.gridApi.setGridOption("loading",!0)}handleLoadingFinished(){this.gridApi&&(this.gridApi.setGridOption("loading",!1),this.gridApi.hideOverlay())}handleNoDataAvailable(){this.gridApi&&(this.gridApi.setGridOption("loading",!1),this.gridApi.showNoRowsOverlay())}handleFiltersRestored(){this.restoreCachedFilterConfig()}handleMoreDataAvailable(e){var t,i,r,a;const{hasMoreData:o,sourceRef:n}=e.detail;if(!this.gridApi)return;const l=null===(i=(t=this.gridApi).getStatusPanel)||void 0===i?void 0:i.call(t,s.k7.loadMore);l&&(null===(a=(r=l).updateParams)||void 0===a||a.call(r,{moreRows:o,sourceRef:n}))}handleDatasourceError(){this.setAttribute("ds-disconnected","ds-disconnected")}handleDatasourceDestroy(){this.clearLocalGridOptions()}handleRefreshServerSide(e){const{purge:t}=e.detail;this.gridApi&&this.gridApi.refreshServerSide({purge:t})}handleSetServerSideDatasource(e){const{datasource:t}=e.detail;this.gridApi&&this.gridApi.setGridOption("serverSideDatasource",t)}handleAddGridCssClass(e){var t;const{className:i}=e.detail,r=(null===(t=this.gridSlot)||void 0===t?void 0:t.parentElement)||this;r&&r.classList.add(i)}handleRemoveGridCssClass(e){var t;const{className:i}=e.detail,r=(null===(t=this.gridSlot)||void 0===t?void 0:t.parentElement)||this;r&&r.classList.remove(i)}handleApplyServerSideTransaction(e){var t,i;const{transaction:r,async:a,callback:s}=e.detail;if(this.gridApi)if(a)this.gridApi.applyServerSideTransactionAsync(r,e=>{var t,i;this.flashAddedCells([...null!==(t=null==e?void 0:e.add)&&void 0!==t?t:[],...null!==(i=null==e?void 0:e.update)&&void 0!==i?i:[]]),null==s||s(e)});else{const e=this.gridApi.applyServerSideTransaction(r);this.flashAddedCells([...null!==(t=null==e?void 0:e.add)&&void 0!==t?t:[],...null!==(i=null==e?void 0:e.update)&&void 0!==i?i:[]]),s&&s(e)}}handleSetInfiniteDatasource(e){const{datasource:t}=e.detail;this.gridApi&&this.gridApi.setGridOption("datasource",t)}handleRefreshInfiniteCache(e){var t;this.gridApi&&((null===(t=e.detail)||void 0===t?void 0:t.purge)?this.gridApi.purgeInfiniteCache():this.gridApi.refreshInfiniteCache())}combineAllGridComponents(e){const t={[s.IX.action]:R.eA,[s.IX.actionsMenu]:k.cN,[s.IX.boolean]:I._Y,[s.IX.editable]:L.YM,[s.IX.icon]:G.Jt,[s.IX.statusPill]:H.N7,[s.IX.select]:_.gs,[s.IX.selectEditor]:l._Q,[s.IX.numberEditor]:g.Z0,[s.IX.multiselectEditor]:p.pZ,[s.IX.dateEditor]:f.S8,[s.IX.stringEditor]:y.XJ,[De.enumFilter]:Ue,[De.enumFloatingFilter]:qe,[s.k7.labelValue]:$t.k,[s.k7.loadMore]:Mt.s,[s.k7.reload]:_t.W,[s.k7.rowCount]:Nt.i};return Object.assign(Object.assign(Object.assign({},t),e),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var e,t,i,r;try{if(!this.initialised||!this.gridApi)return[];const a=null===(e=this.gridOptions)||void 0===e?void 0:e.rowSelection;if("single"===a||"multiple"===a)return this.gridApi.getSelectedRows&&this.gridApi.getSelectedRows().length>0?this.gridApi.getSelectedRows():[];if((null===(t=this.gridApi)||void 0===t?void 0:t.getCellRanges)&&this.gridApi.getCellRanges().length>0)return this.getCellRangeRowData();if(!(null===(i=this.gridOptions)||void 0===i?void 0:i.enableRangeSelection)){const e=null===(r=this.gridApi)||void 0===r?void 0:r.getFocusedCell();if(e){const t=this.gridApi.getDisplayedRowAtIndex(e.rowIndex);if(null==t?void 0:t.data)return[t.data]}}return[]}catch(e){return Ne.v.error("Grid Pro: Error getting selected rows:",e),[]}}getCellRangeRowData(){var e;if(!(null===(e=this.gridApi)||void 0===e?void 0:e.getCellRanges))return[];const t=this.gridApi.getCellRanges();if(0===t.length)return[];const i=[];return t.forEach(e=>{const t=e.startRow.rowIndex,r=e.endRow.rowIndex;for(let e=t;e<=r;e+=1){const t=this.gridApi.getDisplayedRowAtIndex(e);(null==t?void 0:t.data)&&!i.some(e=>e===t.data)&&i.push(t.data)}}),i}hasSelectedRows(){return this.getSelectedRows().length>0}updateLabelValueStatusBar(e){var t,i;if(!this.gridApi)return void Ne.v.warn("Grid Pro: Cannot update label-value status bar - grid API not available");const r=null===(i=(t=this.gridApi).getStatusPanel)||void 0===i?void 0:i.call(t,s.k7.labelValue);r&&"function"==typeof r.updateParams?r.updateParams(e):Ne.v.warn("Grid Pro: Label-value status bar component not found or updateParams method not available")}debouncedColumnAutosize(){this.gridAutosizingEnabled&&(this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.debounced=setTimeout(()=>{var e;null===(e=this.gridApi)||void 0===e||e.sizeColumnsToFit()},Ft.BW))}removeConfigWidthsToAutosize(e){return e.map(e=>Object.assign(Object.assign({},e),{width:null}))}saveColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()){let e=this.gridApi.getColumnState();e=(0,Vt.n7)(e),e=this.gridAutosizingEnabled?this.removeConfigWidthsToAutosize(e):e;const t=0===e.filter(e=>{if(e.hide)return!1;const t=this.gridApi.getColumn(e.colId);return Boolean(t.getColDef().headerName)}).length;if(0===e.length||JSON.stringify(e)===JSON.stringify(this.columnState)||t)return;yield this.statePersistence.saveColumnState(this.persistColumnStateKey,e),this.columnState=e}})}getSavedColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){return this.columnState=[],this.statePersistanceEnabled()&&(this.columnState=yield this.statePersistence.getColumnState(this.persistColumnStateKey)),this.columnState})}restoreColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){var e;this.rehydrationAttempted=!0;const t=yield this.getSavedColumnState(),i=(0,Vt.n7)(t);i&&i.length>0&&(null===(e=this.gridApi)||void 0===e||e.applyColumnState({state:i,applyOrder:!0}))})}cacheFilterConfig(){var e;this.setFilterModel((null===(e=this.gridApi)||void 0===e?void 0:e.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,r.sH)(this,void 0,void 0,function*(){var e,t;const i=yield this.getfilterModel();void 0!==i&&(null===(e=this.gridApi)||void 0===e||e.setFilterModel(i),null===(t=this.gridApi)||void 0===t||t.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof ft.X}get gridParams(){return{globalListener:this.boundGlobalEventListener,modules:[lt,Le.Vc,Le.ZuP]}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")||this.querySelector("grid-pro-infinite-datasource")}get isInfiniteRowModel(){return this.gridProDatasource instanceof Tt}notifyDatasourceVisibleColumns(){var e,t,i,r;const a=this.gridProDatasource;if(!a)return;const s=(0,_e.C)(null===(t=null===(e=this.gridApi)||void 0===e?void 0:e.getAllDisplayedColumns)||void 0===t?void 0:t.call(e),null===(r=null===(i=this.gridApi)||void 0===i?void 0:i.getColumnDefs)||void 0===r?void 0:r.call(i));s.length&&a.setVisibleColumns(s)}set gridOptions(e){!this.applyingDatasourceGridOptions&&e&&(this.userProvidedGridOptions=Object.assign({},e));const t=()=>{!this.disposed&&this.isConnected&&(this.debouncedSaveColumnState(),this.debouncedColumnAutosize())},i=()=>{!this.disposed&&this.isConnected&&this.debouncedNotifyDatasourceVisibleColumns()};Array.from(this.attributes).forEach(e=>{const t=this.agPropertiesMap[e.name];t&&(this.agAttributes[t]=e.value)});const{columnDefs:a,components:o,defaultColDef:n,getRowId:l,onGridReady:d,onFilterChanged:c,onFirstDataRendered:g}=e,h=(0,r.Tt)(e,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered"]),u=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.gridOptionsConfig),{defaultColDef:Object.assign({enableCellChangeFlash:this.enableCellFlashing,filter:!0,resizable:!0,sortable:!0},n),components:this.combineAllGridComponents(o),headerHeight:this.headerHeight,rowHeight:this.rowHeight,animateRows:!1,suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:e=>(0,r.sH)(this,void 0,void 0,function*(){var t,i,r;if(this.gridApi=e.api,this.gridEventsQueue.length&&this.gridEventsQueue.forEach(e=>{this.addGridEventListener(e)}),this.pendingSchemaUpdate){const e=this.pendingSchemaUpdate;this.pendingSchemaUpdate=void 0;try{yield this.processSchemaUpdate(e)}catch(e){Ne.v.error("Grid Pro: failed to apply the pending schema update on grid ready:",e)}}this.rowData&&this.gridApi.setGridOption("rowData",this.rowData),d&&d(e),(null===(t=this.gridProDatasource)||void 0===t?void 0:t.keepColDefsOnClearRowData)&&(null===(i=this.columnState)||void 0===i?void 0:i.length)>0&&this.gridApi.applyColumnState({state:this.columnState,applyOrder:!0}),this.$emit(zt,{event:e,gridId:this.id}),this.$emit(s.mr,{event:e,gridId:this.id}),this.notifyDatasourceVisibleColumns(),null===(r=this.gridProDatasource)||void 0===r||r.$emit(Et.c.ready),this.restoreColumnState(),this.restoreCachedFilterConfig(),this.debouncedColumnAutosize()}),onFirstDataRendered:e=>{this.notifyDatasourceVisibleColumns(),g&&g(e)},onColumnPinned:t,onColumnResized:t,onColumnMoved:t,onColumnVisible:()=>{t(),i()},onDisplayedColumnsChanged:()=>{t(),i()},onFilterChanged:e=>{!this.disposed&&this.isConnected&&(this.debouncedSaveFilterModel(),c&&c(e))},onGridSizeChanged:t,onSortChanged:t}),h);this.gridProDatasource?(u.columnDefs=a,u.getRowId=l,this.setupStatusBar(u),this.setLocalGridOptions(u)):this.mergeAllColumnDefsAndStates(a).then(e=>{!this.disposed&&this.isConnected&&(u.columnDefs=e,u.getRowId=l,this.setupStatusBar(u),this.setLocalGridOptions(u),this.initGrid())})}setLocalGridOptions(e){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),(0,Ft.Qg)(e,this.agAttributes)),this.agGridOptions.context=Object.assign(Object.assign({},this.agGridOptions.context),{[ot]:this.columnDragBridge}),null==this.agGridOptions.allowDragFromColumnsToolPanel&&(this.agGridOptions.allowDragFromColumnsToolPanel=!0)}clearLocalGridOptions(){this.agGridOptions=void 0}resetGridOptionsState(){this.userProvidedGridOptions=void 0,this.agGridOptions=void 0}initGrid(){n.DOM.queueUpdate(()=>{!this.disposed&&this.isConnected&&this.gridSlot&&(this.initialised&&(this.destroyGridInstance(),this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild)),this.agGrid=(0,Le.Dvw)(this.gridSlot,this.agGridOptions,this.gridParams),this.initialised=!0)})}mergeAllColumnDefsAndStates(e){return(0,r.sH)(this,arguments,void 0,function*(e,t=!1){var i;const r=e||[];r.forEach(e=>{if(this.headerCaseType&&e.field&&!e.headerName){const t=Pe[this.headerCaseType];t?e.headerName=t(e.field):Ne.v.warn(`Invalid header-case-type attribute value: ${this.headerCaseType}. Please use one of the following: camelCase, capitalCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase.`)}});const a=Array.from(this.querySelectorAll(this.columnComponentName)).map(e=>e.definition).map(e=>{var t,i,a,o,n,l;if(this.enableCellFlashing&&void 0===e.enableCellChangeFlash&&(e.enableCellChangeFlash=!0),"agSetColumnFilter"===e.filter||e.filter===De.enumFilter){if(!(null!=e.filterParams&&"values"in e.filterParams)){const s=null===(t=r.find(t=>t.field===e.field))||void 0===t?void 0:t.filterParams,l=null!==(i=null==s?void 0:s.values)&&void 0!==i?i:null===(n=null===(o=null===(a=null==s?void 0:s.filters)||void 0===a?void 0:a.find(e=>"agSetColumnFilter"===e.filter))||void 0===o?void 0:o.filterParams)||void 0===n?void 0:n.values;l&&(e.filterParams=Object.assign(Object.assign({},e.filterParams),{values:l}))}e.filter===De.enumFilter&&(null!==(l=e.floatingFilterComponent)&&void 0!==l||(e.floatingFilterComponent=De.enumFloatingFilter))}e.editable&&(e.cellRenderer||e.cellRendererSelector||(e.cellRendererSelector=t=>{if(t.data[s.A7]===e.field)return{component:s.IX.editable}}),e.tooltipComponent||e.tooltipValueGetter||(e.tooltipComponent=Bt.y,e.tooltipValueGetter=t=>{const i=t.data[s.h1];if(i&&i.column===e.field)return i.message}),e.cellClassRules||(e.cellClassRules={error:e=>{var t;return(null===(t=e.data[s.h1])||void 0===t?void 0:t.column)===e.colDef.field}}));const d=r.find(t=>e.field===t.field);return Object.assign(Object.assign({},d),e)}),o=a.map(e=>e.field),n=[...a,...this.onlyTemplateColDefs?[]:r.filter(e=>!o.includes(e.field))];if(this.gridProDatasource&&t){const e=yield this.getSavedColumnState();if((null==e?void 0:e.length)>0)return(0,Vt.yS)(n,e);if((null===(i=this.gridProDatasource.deferredColumnStates)||void 0===i?void 0:i.length)>0)return(0,Vt.yS)(n,this.gridProDatasource.deferredColumnStates)}return n})}panelExists(e,t){return t.some(t=>t.statusPanel===e)}addRowCountPanel(e,t){if(this.statusBarConfig&&!0===this.statusBarConfig.rows){const i=this.isServerSide||this.isInfiniteRowModel||"infinite"===(null==t?void 0:t.rowModelType)||"serverSide"===(null==t?void 0:t.rowModelType);if(i)this.panelExists(s.k7.rowCount,e)||e.push({statusPanel:s.k7.rowCount,align:"left"});else if(!i){const t="agTotalAndFilteredRowCountComponent";this.panelExists(t,e)||e.push({statusPanel:t,align:"left"})}}}addMaxRowsPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.maxRows&&(this.panelExists(s.k7.labelValue,e)||e.push({statusPanel:s.k7.labelValue,statusPanelParams:{label:"Max Rows",value:this.gridProDatasource.maxRows||Oe.OD.MAX_ROWS_250,hide:!1},align:"left"}))}addAggregationPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.aggregation&&(this.panelExists("agAggregationComponent",e)||e.push({statusPanel:"agAggregationComponent",align:"right"}))}addDatasourcePanels(e){if(this.gridProDatasource){const t=this.gridProDatasource.getDatasourceStatusBarPanels(this.isServerSide||this.isInfiniteRowModel,this.statusBarConfig).filter(t=>!this.panelExists(t.statusPanel,e));e.push(...t)}}setupStatusBar(e){var t,i;if(this.withStatusBar&&this.statusBarConfig){const r=[...(null===(t=e.statusBar)||void 0===t?void 0:t.statusPanels)||[]];this.addRowCountPanel(r,e),this.addMaxRowsPanel(r),this.addAggregationPanel(r),this.addDatasourcePanels(r);const a=((null===(i=e.statusBar)||void 0===i?void 0:i.statusPanels)||[]).filter(e=>!this.panelExists(e.statusPanel,r));r.push(...a),e.statusBar={statusPanels:r}}}get observedAttributes(){const e=Ft.zI.map(e=>e.toLowerCase()),t=Ft.zI.map(e=>(0,Ht.w)(e));return e.concat(t)}agAttributeChangedCallback(e,t,i){var r;if(t===i)return;const a=this.agPropertiesMap[e];a&&(this.agAttributes[a]=i,this.initialised&&(null===(r=this.gridApi)||void 0===r||r.setGridOption(a,i)))}globalEventListener(e,t){const i=e.toLowerCase(),r=new Event(i);r.agGridDetails=t,this.dispatchEvent(r);const a="on"+i;"function"==typeof this[a]&&this[a](r)}}(0,r.Cg)([n.observable],Ut.prototype,"gridApi",void 0),(0,r.Cg)([n.observable],Ut.prototype,"gridErrorItems",void 0),(0,r.Cg)([Gt.l],Ut.prototype,"statePersistence",void 0),(0,r.Cg)([(0,n.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],Ut.prototype,"autoCellRendererByType",void 0),(0,r.Cg)([(0,n.attr)({attribute:"only-template-col-defs",mode:"boolean"})],Ut.prototype,"onlyTemplateColDefs",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"grid-autosizing"})],Ut.prototype,"gridAutosizingEnabled",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],Ut.prototype,"enableCellFlashing",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-row-flashing"})],Ut.prototype,"enableRowFlashing",void 0),(0,r.Cg)([(0,n.attr)({attribute:"persist-column-state-key"})],Ut.prototype,"persistColumnStateKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"persist-filter-model-key"})],Ut.prototype,"persistFilterModelKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"header-case-type"})],Ut.prototype,"headerCaseType",void 0),(0,r.Cg)([n.observable],Ut.prototype,"rowData",void 0),(0,r.Cg)([n.attr],Ut.prototype,"columnComponentName",void 0),(0,r.Cg)([n.observable],Ut.prototype,"eventsAndCallbacks",void 0),(0,r.Cg)([n.attr],Ut.prototype,"headerHeight",void 0),(0,r.Cg)([n.attr],Ut.prototype,"rowHeight",void 0),(0,r.Cg)([n.observable],Ut.prototype,"classNames",void 0),(0,r.Cg)([n.observable],Ut.prototype,"agGrid",void 0),(0,r.Cg)([n.observable],Ut.prototype,"gridSlot",void 0),(0,r.Cg)([n.observable],Ut.prototype,"themeMode",void 0),(0,r.Cg)([n.observable],Ut.prototype,"gridComponents",void 0),(0,r.Cg)([n.observable],Ut.prototype,"statusBarConfig",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"with-status-bar"})],Ut.prototype,"withStatusBar",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-column-selection"})],Ut.prototype,"enableColumnSelection",void 0),(0,r.Cg)([n.observable],Ut.prototype,"customErrorHandlerTemplate",void 0),(0,r.Cg)([s.lz],Ut.prototype,"gridOptionsConfig",void 0),(0,r.Cg)([n.observable],Ut.prototype,"provider",void 0);const Kt={backgroundColor:"var(--neutral-layer-card-container)",cellHorizontalPadding:"calc(var(--design-unit) * 2px)",foregroundColor:"var(--neutral-foreground-rest)",headerTextColor:"var(--neutral-foreground-hint)",headerBackgroundColor:"var(--neutral-layer-3)",headerColumnBorder:"1px solid var(--neutral-stroke-rest)",oddRowBackgroundColor:"var(--neutral-layer-1)",rowBorder:"1px solid var(--neutral-stroke-divider-rest)",borderColor:"var(--neutral-stroke-rest)",wrapperBorder:"0",accentColor:"var(--accent-foreground-rest)",fontFamily:"var(--body-font)",sideBarBackgroundColor:"var(--neutral-layer-2)",dataFontSize:"var(--type-ramp-minus-2-font-size)",iconButtonColor:"var(--accent-foreground-rest)",iconButtonHoverColor:"color-mix(in srgb, var(--accent-foreground-rest), var(--ag-foreground-color) 30%)"},Xt=["rowheight","row-height"];function qt(e){const t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}class jt extends Ut{getCachedTheme(e){const t=null!=e?e:"default";let i=jt.cachedThemes.get(t);return i||(i=Le.N8R.withParams("default"===t?Kt:Object.assign(Object.assign({},Kt),{rowHeight:`${t}px`})),jt.cachedThemes.set(t,i)),i}resolveRowHeight(e){for(const e of Xt){const t=qt(this.getAttribute(e));if(t)return t}return qt(e.rowHeight)}agAttributeChangedCallback(e,t,i){var r;super.agAttributeChangedCallback(e,t,i),"rowHeight"===this.agPropertiesMap[e]&&t!==i&&(null===(r=this.gridApi)||void 0===r||r.setGridOption("theme",this.getCachedTheme(qt(i))))}set gridOptions(e){const t=Object.assign({},e);t.components=Object.assign({[s.IX.action]:E,[s.IX.actionsMenu]:D,[s.IX.boolean]:x,[s.IX.editable]:P,[s.IX.select]:N,[s.IX.selectEditor]:d,[s.IX.numberEditor]:h,[s.IX.multiselectEditor]:m,[s.IX.dateEditor]:b,[s.IX.stringEditor]:S,[s.IX.statusPill]:V,[s.IX.icon]:$},t.components),t.theme=this.getCachedTheme(this.resolveRowHeight(t)),super.gridOptions=t}}jt.cachedThemes=new Map,(0,r.Cg)([n.observable],jt.prototype,"provider",void 0);const Yt=jt.compose(Object.assign({baseName:"grid-pro",template:ie,styles:n.css`
|
|
937
|
+
`},st=at(),ot="gridProColumnDragBridge";function nt(e){var t,i;if(!(null==e?void 0:e.dragAndDrop)||!e.gos)return!1;const r=null!==(t=e.gos.get("context"))&&void 0!==t?t:null===(i=e.gridOptions)||void 0===i?void 0:i.context,a=null==r?void 0:r[ot];return!!a&&(a.dragAndDrop=e.dragAndDrop,a.gos=e.gos,!0)}const lt={moduleName:"GridProColumnDragBridge",version:Le.Vc.version,beans:[class{constructor(){this.beanName="gridProColumnDragBridgeInit",this.beans=null}wireBeans(e){this.beans=e}postConstruct(){nt(this.beans),queueMicrotask(()=>nt(this.beans))}}],dependsOn:[Le.Vc]};function dt(e){return ct(null==e?void 0:e[ot])}function ct(e){return(null==e?void 0:e.dragAndDrop)&&(null==e?void 0:e.gos)?e:null}function gt(e){var t;return dt(null===(t=null==e?void 0:e.getGridOption)||void 0===t?void 0:t.call(e,"context"))}function ht(e,t){const i=null!=t?t:null==e?void 0:e.gridApi;if(!i)return null;if("function"==typeof i.setColumnsVisible&&"function"==typeof i.getColumns)return i;const r=null==e?void 0:e.columnApi;return r?new Proxy(i,{get(e,t,i){switch(t){case"getColumns":return()=>{var e,t;return null!==(t=null===(e=r.getAllGridColumns)||void 0===e?void 0:e.call(r))&&void 0!==t?t:[]};case"getAllDisplayedColumns":return()=>{var e,t;return null!==(t=null===(e=r.getAllDisplayedColumns)||void 0===e?void 0:e.call(r))&&void 0!==t?t:[]};case"getColumnState":return()=>{var e,t;return null!==(t=null===(e=r.getColumnState)||void 0===e?void 0:e.call(r))&&void 0!==t?t:[]};case"setColumnsVisible":return(e,t)=>{var i;for(const a of e)null===(i=r.setColumnVisible)||void 0===i||i.call(r,a,t)};case"applyColumnState":return e=>{var t;return null===(t=r.applyColumnState)||void 0===t?void 0:t.call(r,e)};default:return Reflect.get(e,t,i)}}}):null}const ut=new WeakMap;class pt extends((0,xe.S)(ae.FoundationElement)){constructor(){super(...arguments),this.label="Column Selection",this.sort=Ye,this.open=!1,this.gridApi=null,this.gridHost=null,this.search="",this.selectedItems=[],this.unselectedItems=[],this.selectAllChecked=!1,this.selectAllIndeterminate=!1,this.resolvedSort=Ye,this.dragColId=null,this.dragOverElement=null,this.dragBindingAbort=null,this.agDragBindings=[],this.columnDragBridge=null,this.dragBridgeRetryId=0,this.pendingVisibility=new Map,this.boundRefresh=()=>this.refresh(),this.handleClickOutside=e=>{this.open&&this.root&&e.isTrusted&&(e.composedPath().includes(this.root)||(this.open=!1))}}get pickerApi(){var e;return null!==(e=ut.get(this))&&void 0!==e?e:null}set pickerApi(e){ut.set(this,e)}get pickerRoot(){var e;return null!==(e=this.panelEl)&&void 0!==e?e:null}get canDrag(){return!this.search.trim()}canDragToGrid(e){return!(!this.canDrag||e.lockVisible)&&("ag-grid"===this.resolvedSort||!e.visible)}get toggleableItems(){return[...this.selectedItems,...this.unselectedItems].filter(e=>!e.lockVisible)}openChanged(e){void 0!==e&&this.$fastController.isConnected&&(this.open?n.DOM.queueUpdate(()=>{this.subscribePicker(),this.refresh(),this.showPanel(),requestAnimationFrame(()=>{this.open&&document.addEventListener("mousedown",this.handleClickOutside)})}):(document.removeEventListener("mousedown",this.handleClickOutside),this.unsubscribePicker(),this.hidePanel()))}sortChanged(){this.resolvedSort=We(this.sort),this.open&&this.refresh()}gridApiChanged(){this.open&&this.resubscribePicker()}gridHostChanged(){this.open&&this.resubscribePicker()}panelElChanged(){this.open&&n.DOM.queueUpdate(()=>{this.refresh(),this.showPanel()})}connectPicker(){this.subscribePicker(),this.refresh()}toggle(){this.open=!this.open}close(){this.open=!1}refresh(){var e,t,i,r,a,s,o,l,d;if(this.resolvedSort=We(this.sort),!this.pickerApi)return;const c=this.pickerRoot,g=document.activeElement,h=g&&(null==c?void 0:c.contains(g))?g.getAttribute("data-test-id"):null,u=null!==(i=null===(t=(e=this.pickerApi).getAllDisplayedColumns)||void 0===t?void 0:t.call(e))&&void 0!==i?i:[],p=null!==(s=null===(a=(r=this.pickerApi).getColumns)||void 0===a?void 0:a.call(r))&&void 0!==s?s:[],v=null!==(d=null===(l=(o=this.pickerApi).getColumnState)||void 0===l?void 0:l.call(o))&&void 0!==d?d:[],m=Ze(u,p,this.resolvedSort,v),f=this.applyPendingVisibility(Je(m)),{selected:b,unselected:C}=et(f,this.search,this.resolvedSort);this.selectedItems=b,this.unselectedItems=C,this.syncSelectAllState(),h&&c&&n.DOM.queueUpdate(()=>{var e;null===(e=c.querySelector(`[data-test-id="${h}"]`))||void 0===e||e.focus()}),n.DOM.queueUpdate(()=>{this.bindRowDrag()})}disconnectedCallback(){document.removeEventListener("mousedown",this.handleClickOutside),this.hidePanel(),this.unsubscribePicker(),this.open=!1,super.disconnectedCallback()}showPanel(){const e=this.panelEl;if(e&&"function"==typeof e.showPopover&&!e.matches(":popover-open"))try{e.showPopover({source:this.buttonEl})}catch(t){e.showPopover()}}hidePanel(){const e=this.panelEl;e&&"function"==typeof e.hidePopover&&e.matches(":popover-open")&&e.hidePopover()}subscribePicker(){var e,t,i;const r=ht(this.gridHost,this.gridApi);r&&this.pickerApi===r||(this.unsubscribePicker(),r&&(this.pickerApi=r,this.columnDragBridge=null!==(i=null===(t=null===(e=this.gridHost)||void 0===e?void 0:e.getColumnDragBridge)||void 0===t?void 0:t.call(e))&&void 0!==i?i:null,this.resolvedSort=We(this.sort),this.pickerApi.addEventListener("columnVisible",this.boundRefresh),this.pickerApi.addEventListener("columnMoved",this.boundRefresh),this.pickerApi.addEventListener("newColumnsLoaded",this.boundRefresh),this.pickerApi.addEventListener("displayedColumnsChanged",this.boundRefresh)))}resubscribePicker(){this.subscribePicker(),this.refresh()}unsubscribePicker(){var e;this.dragBridgeRetryId+=1,null===(e=this.dragBindingAbort)||void 0===e||e.abort(),this.dragBindingAbort=null;for(const e of this.agDragBindings)e.remove();this.agDragBindings=[],this.pendingVisibility.clear(),this.pickerApi&&(this.pickerApi.removeEventListener("columnVisible",this.boundRefresh),this.pickerApi.removeEventListener("columnMoved",this.boundRefresh),this.pickerApi.removeEventListener("newColumnsLoaded",this.boundRefresh),this.pickerApi.removeEventListener("displayedColumnsChanged",this.boundRefresh)),this.pickerApi=null}syncSelectAllState(){const e=this.toggleableItems,t=e.filter(e=>e.visible).length;this.selectAllChecked=e.length>0&&t===e.length,this.selectAllIndeterminate=t>0&&t<e.length}applyPendingVisibility(e){return this.pendingVisibility.size?e.map(e=>{const t=this.pendingVisibility.get(e.colId);return void 0===t?e:(e.visible===t&&this.pendingVisibility.delete(e.colId),Object.assign(Object.assign({},e),{visible:t}))}):e}resolveDragBridge(){var e;return null!==(e=ct(this.columnDragBridge))&&void 0!==e?e:gt(this.pickerApi)}bindRowDrag(){var e;null===(e=this.dragBindingAbort)||void 0===e||e.abort(),this.dragBindingAbort=null;for(const e of this.agDragBindings)e.remove();this.agDragBindings=[];const t=this.pickerRoot;if(!this.canDrag||!this.pickerApi||!t)return;const i=this.resolveDragBridge(),r=t.querySelectorAll(".grid-pro-columns-item");if(!r.length)return;const a=new AbortController;this.dragBindingAbort=a;const{signal:s}=a;let o=!1,n=!1;r.forEach(e=>{const t=e.dataset.colId,r=e.querySelector(".grid-pro-columns-handle");if(!t||!r)return;r.classList.remove("grid-pro-columns-handle-grid-drag","grid-pro-columns-handle-panel-drag"),r.removeAttribute("draggable");const a=[...this.selectedItems,...this.unselectedItems].find(e=>e.colId===t);if(!a)return;const l=this.canDragToGrid(a),d="selected-first"===this.resolvedSort&&a.visible&&!e.classList.contains("grid-pro-columns-item--unselected");if(l)if(i){const e=je(i,this.pickerApi,r,t,a.headerName);if(e&&(n=!0,this.agDragBindings.push(e),r.classList.add("grid-pro-columns-handle-grid-drag"),!d))return}else o=!0;d&&(r.draggable=!0,r.classList.add("grid-pro-columns-handle-panel-drag"),r.addEventListener("dragstart",i=>{this.onDragStart(i,t,e)},{signal:s}),r.addEventListener("dragend",()=>this.onDragEnd(),{signal:s}),e.addEventListener("dragover",t=>{this.onDragOver(t,e)},{signal:s}),e.addEventListener("dragleave",t=>{this.onDragLeave(t,e)},{signal:s}),e.addEventListener("drop",e=>{this.onDrop(e,t)},{signal:s}))}),o&&!n&&this.scheduleDragBridgeRetry()}scheduleDragBridgeRetry(e=0){if(e>30||!this.pickerApi||!this.canDrag)return;this.dragBridgeRetryId+=1;const t=this.dragBridgeRetryId;requestAnimationFrame(()=>{t===this.dragBridgeRetryId&&this.isConnected&&(this.resolveDragBridge()?this.bindRowDrag():this.scheduleDragBridgeRetry(e+1))})}onSearchInput(e){this.search=e,this.refresh()}onSelectAllClick(e){var t,i;if(null===(t=e.preventDefault)||void 0===t||t.call(e),null===(i=e.stopImmediatePropagation)||void 0===i||i.call(e),!this.pickerApi)return;const r=this.toggleableItems;if(!r.length)return;const a=!this.selectAllChecked,s=r.filter(e=>e.visible!==a).map(e=>e.colId);if(s.length){for(const e of s)this.pendingVisibility.set(e,a);this.pickerApi.setColumnsVisible(s,a),this.refresh()}}onCheckboxClick(e,t){t.preventDefault(),t.stopPropagation(),this.onVisibilityChange(e,!e.visible)}onVisibilityChange(e,t){!e.lockVisible&&this.pickerApi&&e.visible!==t&&(this.pendingVisibility.set(e.colId,t),this.pickerApi.setColumnsVisible([e.colId],t),this.refresh())}onDragStart(e,t,i){this.canDrag?(this.dragColId=t,e.dataTransfer&&(e.dataTransfer.setData("text/plain",t),e.dataTransfer.effectAllowed="move"),(null!=i?i:e.currentTarget).classList.add("dragging")):e.preventDefault()}onDragEnd(){var e;this.dragColId=null,this.clearDragOverHighlight(),null===(e=this.pickerRoot)||void 0===e||e.querySelectorAll(".grid-pro-columns-item.dragging").forEach(e=>{e.classList.remove("dragging")})}onDragOver(e,t){var i;this.canDrag&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),this.dragOverElement!==t&&(null===(i=this.dragOverElement)||void 0===i||i.classList.remove("drag-over"),this.dragOverElement=t,t.classList.add("drag-over")))}onDragLeave(e,t){this.dragOverElement!==t||t.contains(e.relatedTarget)||(t.classList.remove("drag-over"),this.dragOverElement=null)}onDrop(e,t){var i;e.preventDefault(),this.clearDragOverHighlight();const r=this.dragColId||(null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"));r&&this.reorderSelected(r,t)}clearDragOverHighlight(){var e;null===(e=this.dragOverElement)||void 0===e||e.classList.remove("drag-over"),this.dragOverElement=null}reorderSelected(e,t){var i,r,a,s,o,n,l,d,c;if(!this.pickerApi||!this.pickerApi.getColumnState||!this.pickerApi.applyColumnState)return;const g=null!==(a=null===(r=(i=this.pickerApi).getAllDisplayedColumns)||void 0===r?void 0:r.call(i))&&void 0!==a?a:[],h=null!==(n=null===(o=(s=this.pickerApi).getColumns)||void 0===o?void 0:o.call(s))&&void 0!==n?n:[],u=null!==(c=null===(d=(l=this.pickerApi).getColumnState)||void 0===d?void 0:d.call(l))&&void 0!==c?c:[],p=Je(Ze(g,h,this.resolvedSort,u)),v=p.filter(e=>e.visible).map(e=>e.colId),{selected:m}=et(p,this.search,this.resolvedSort),f=tt(v,"selected-first"===this.resolvedSort?m.map(e=>e.colId):m.filter(e=>e.visible).map(e=>e.colId),e,t);f&&this.pickerApi.applyColumnState({state:it(u,f),applyOrder:!0})}}(0,r.Cg)([n.attr],pt.prototype,"label",void 0),(0,r.Cg)([n.attr],pt.prototype,"sort",void 0),(0,r.Cg)([n.observable],pt.prototype,"open",void 0),(0,r.Cg)([n.observable],pt.prototype,"gridApi",void 0),(0,r.Cg)([n.observable],pt.prototype,"gridHost",void 0),(0,r.Cg)([n.observable],pt.prototype,"root",void 0),(0,r.Cg)([n.observable],pt.prototype,"buttonEl",void 0),(0,r.Cg)([n.observable],pt.prototype,"panelEl",void 0),(0,r.Cg)([n.observable],pt.prototype,"search",void 0),(0,r.Cg)([n.observable],pt.prototype,"selectedItems",void 0),(0,r.Cg)([n.observable],pt.prototype,"unselectedItems",void 0),(0,r.Cg)([n.observable],pt.prototype,"selectAllChecked",void 0),(0,r.Cg)([n.observable],pt.prototype,"selectAllIndeterminate",void 0);const vt=pt.compose({baseName:"column-selection",template:at("foundation"),styles:rt.H});var mt=i(63296),ft=i(81876),bt=i(48707),Ct=i(96730),yt=i(57963),St=i(24669),wt=i(49964),Rt=i(10629),Et=i(41392),At=i(90509),kt=i(79270),Dt=i(35610),Ot=i(21281),It=i(70985),xt=i(88915),Tt=i(44561);class Lt{constructor(e){var t;this.defaultReverse=!1,this.loadGeneration=0,this.detached=!1,this.rowData=new Map,this.pendingBlocks=new Set,this.deliveredRowCount=0,this.streamStarted=!1,this.moreRowsInFlight=!1,this.hasCriteria=!1,this.viewTruncationWarned=!1,this.createSnapshotFunc=e.createSnapshotFunc,this.createDataserverStreamFunc=e.createDataserverStreamFunc,this.getMoreRowsFunc=e.getMoreRowsFunc,this.onRowsInvalidatedFunc=e.onRowsInvalidatedFunc,this.onRowsUpdatedFunc=e.onRowsUpdatedFunc,this.onRowsDeliveredFunc=e.onRowsDeliveredFunc,this.onRowsWithdrawnFunc=e.onRowsWithdrawnFunc,this.onRowCacheResetFunc=e.onRowCacheResetFunc,this.errorHandlerFunc=e.errorHandlerFunc,this.ledger=new xt.J(e.rowId),this.resourceName=e.resourceName,this.resourceParams=Object.assign({},e.resourceParams),this.resourceIndexes=e.resourceIndexes,this.resourceColDefs=e.resourceColDefs,this.maxRows=e.maxRows,this.rowId=e.rowId,this.baseCriteria=e.baseCriteria||"",this.isRequestServer=e.isRequestServer,this.defaultOrderBy=e.defaultOrderBy||void 0,this.defaultReverse=null!==(t=e.defaultReverse)&&void 0!==t&&t,this.onNoDataAvailableFunc=e.onNoDataAvailableFunc,this.onDataAvailableFunc=e.onDataAvailableFunc}buildRequestServerParams(e,t,i){const r=Object.assign({},this.resourceParams);return r.DETAILS=Object.assign({},r.DETAILS),r.DETAILS.MAX_ROWS=this.maxRows,r.DETAILS.OFFSET=e,t?r.DETAILS.CRITERIA_MATCH=t:delete r.DETAILS.CRITERIA_MATCH,r.DETAILS.ORDER_BY=i.orderBy||`${this.rowId} ASC`,r}buildDataserverLogonParams(e,t){const i=Object.assign({},this.resourceParams);return i.MAX_ROWS=this.maxRows,delete i.VIEW_NUMBER,e?i.CRITERIA_MATCH=e:delete i.CRITERIA_MATCH,t.orderBy?(i.ORDER_BY=t.orderBy,i.REVERSE=t.reverse):(delete i.ORDER_BY,delete i.REVERSE),i}getLastRow(e,t,i,r){return"MORE_ROWS"in e&&!1===e.MORE_ROWS?t+i:!r&&"ROWS_COUNT"in e&&"number"==typeof e.ROWS_COUNT?e.ROWS_COUNT:-1}getRows(e){return(0,r.sH)(this,void 0,void 0,function*(){var t,i;if(this.detached)return Ne.v.debug("Infinite getRows ignored: the datasource was detached by its host"),void e.failCallback();Ne.v.debug("Infinite getRows called",{startRow:e.startRow,endRow:e.endRow,isRequestServer:this.isRequestServer});try{const i=(0,Tt.P4)(e.filterModel,this.resourceColDefs),r=[this.baseCriteria,i].filter(Boolean).join(" && "),a=this.resolveSortConfig(e.sortModel);if(this.noteRequestKey(r,a),!this.isRequestServer)return void this.getDataserverRows(e,r,a);const s=this.buildRequestServerParams(e.startRow,r,a);Ne.v.debug("Infinite datasource request params",s);const o=this.loadGeneration,n=yield this.createSnapshotFunc(s);if(o!==this.loadGeneration)return Ne.v.debug("Infinite REQUEST_SERVER reply discarded: the block cache was reset"),void e.failCallback();if(!n)return void e.failCallback();const l=n.MESSAGE_TYPE;if(l===Ot.Go.LOGOFF_ACK||l===Ot.Go.MSG_NACK){const i=l===Ot.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Request rejected by ${this.resourceName}`;return Ne.v.error(`Infinite REQUEST_SERVER block failed: ${i}`,n),null===(t=this.errorHandlerFunc)||void 0===t||t.call(this,i,"connection"),void e.failCallback()}if("REPLY"in n&&Array.isArray(n.REPLY)){const t=n.REPLY,i=this.getLastRow(n,e.startRow,t.length,Boolean(r));return e.successCallback(t,i),this.deliverRows(e.startRow,t),void this.notifyDataAvailability(e.startRow,t.length)}e.successCallback([],e.startRow),this.notifyDataAvailability(e.startRow,0)}catch(t){Ne.v.error("Error in infinite getRows:",t),null===(i=this.errorHandlerFunc)||void 0===i||i.call(this,function(e){var t,i,r;if(e instanceof Error)return e.message;if("string"==typeof e)return e;const a=e;for(const e of[a,null==a?void 0:a.receivedMessage]){const i=null===(t=null==e?void 0:e.ERROR)||void 0===t?void 0:t.map(e=>null==e?void 0:e.TEXT).filter(Boolean);if(null==i?void 0:i.length)return i.join("; ")}if("string"==typeof(null==a?void 0:a.message)&&a.message)return a.message;const s=null!==(i=null==a?void 0:a.MESSAGE_TYPE)&&void 0!==i?i:null===(r=null==a?void 0:a.receivedMessage)||void 0===r?void 0:r.MESSAGE_TYPE;if(s)return s;try{return JSON.stringify(e)}catch(t){return String(e)}}(t),"unknown"),e.failCallback()}})}resolveSortConfig(e){const t=function(e,t,i=!1){if(!e||0===e.length)return{orderBy:null,reverse:!1};const r=e[0],a=r.colId,s="desc"===r.sort;if(i)return{orderBy:`${a} ${s?"DESC":"ASC"}`,reverse:!1};for(const[e,i]of t.entries())if(e&&i.includes(a))return{orderBy:e,reverse:s};return Ne.v.warn(`Column '${a}' is not part of any named INDEX. Server-side sorting is not available for this column.`),{orderBy:null,reverse:!1}}(e,this.resourceIndexes,this.isRequestServer);return t.orderBy||!this.defaultOrderBy?t:{orderBy:this.defaultOrderBy,reverse:this.defaultReverse}}noteRequestKey(e,t){var i;const r=JSON.stringify(Object.assign({criteria:e},t));void 0!==this.rowCacheKey&&this.rowCacheKey!==r&&(this.loadGeneration+=1,this.ledger.clear(),null===(i=this.onRowCacheResetFunc)||void 0===i||i.call(this)),this.rowCacheKey=r,this.isRequestServer||void 0===this.subscriptionKey||this.subscriptionKey===r||this.teardownDataserverSubscription(),this.subscriptionKey=r}getDataserverRows(e,t,i){if(!this.createDataserverStreamFunc||!this.getMoreRowsFunc)return Ne.v.error("Infinite DATASERVER paging requires a stream and a getMoreRows function"),void e.failCallback();const r=Number.isFinite(Number(e.startRow))?Number(e.startRow):0,a=Number.isFinite(Number(e.endRow))?Number(e.endRow):r+this.maxRows,s={startRow:r,endRow:a,settled:!1,success:e.successCallback,fail:e.failCallback};if(this.streamStarted&&(this.rowData.size>=a||!1===this.moreRows))this.settleBlock(s,!0);else{if(s.timer=this.createBlockTimer(s),this.pendingBlocks.add(s),!this.dataserverStream){const e=this.buildDataserverLogonParams(t,i);return this.hasCriteria=Boolean(e.CRITERIA_MATCH),this.dataserverStream=this.createDataserverStreamFunc(e),void(this.dataserverStreamSubscription=this.dataserverStream.subscribe(e=>this.handleDataserverMessage(e)))}this.pumpMoreRows()}}pumpMoreRows(){this.moreRowsInFlight||!1===this.moreRows||0===this.pendingBlocks.size||this.dataserverStream&&this.dataserverStreamSubscription&&this.sourceRef&&(this.moreRowsInFlight=!0,this.requestMoreRows())}requestMoreRows(){return(0,r.sH)(this,void 0,void 0,function*(){if(this.dataserverStreamSubscription&&this.sourceRef)try{yield this.getMoreRowsFunc(this.sourceRef)}catch(e){if(this.moreRowsInFlight=!1,(null==e?void 0:e.status)===Lt.HTTP_NOT_FOUND)return Ne.v.warn(`Infinite DATASERVER paging is not available on this connection (MORE_ROWS answered 404, expected over HTTP/feature.forceHttp). ${this.resourceName} is truncated to the ${this.rowData.size} row(s) already delivered; use a websocket connection, or a REQUEST_SERVER resource, to page further.`),this.moreRows=!1,this.viewTruncationWarned=!0,void this.settleCoveredBlocks();Ne.v.error("Infinite DATASERVER MORE_ROWS failed:",e),this.failAllPendingBlocks()}else this.moreRowsInFlight=!1})}handleDataserverMessage(e){var t,i,r,a,s,o;const n=null==e?void 0:e.MESSAGE_TYPE;if(n===Ot.Go.LOGOFF_ACK||n===Ot.Go.MSG_NACK)return null===(t=this.errorHandlerFunc)||void 0===t||t.call(this,n===Ot.Go.LOGOFF_ACK?`Connection lost to ${this.resourceName}`:`Authentication failed for ${this.resourceName}`,"connection"),void this.teardownDataserverSubscription();this.sourceRef=null!==(i=null==e?void 0:e.SOURCE_REF)&&void 0!==i?i:this.sourceRef;const l=(null==e?void 0:e.ROW)?(0,It.R)(e,this.rowId):void 0;if((null!==(a=null===(r=null==l?void 0:l.updates)||void 0===r?void 0:r.length)&&void 0!==a?a:0)>0||(null!==(o=null===(s=null==l?void 0:l.deletes)||void 0===s?void 0:s.length)&&void 0!==o?o:0)>0)return this.streamStarted=!0,void this.notifyLiveChange(l);const d=this.moreRowsInFlight||this.pendingBlocks.size>0||!this.streamStarted;if(this.moreRowsInFlight=!1,void 0!==(null==e?void 0:e.MORE_ROWS)&&(this.moreRows=e.MORE_ROWS),l){if(void 0!==e.ROWS_COUNT&&void 0===this.serverRowsCount&&(this.serverRowsCount=e.ROWS_COUNT),!d)return this.streamStarted=!0,void this.notifyLiveChange(l);this.accumulate(l),this.refreshPendingDeadlines()}this.streamStarted=!0,this.settleCoveredBlocks(),this.pumpMoreRows()}notifyLiveChange(e){var t,i,r,a,s,o,n,l,d,c,g,h,u,p;const v=(null!==(i=null===(t=e.inserts)||void 0===t?void 0:t.length)&&void 0!==i?i:0)>0||(null!==(a=null===(r=e.deletes)||void 0===r?void 0:r.length)&&void 0!==a?a:0)>0,m=(null!==(o=null===(s=e.updates)||void 0===s?void 0:s.length)&&void 0!==o?o:0)>0;if(v)return Ne.v.debug("Infinite DATASERVER live change invalidates the cache",{inserts:null!==(l=null===(n=e.inserts)||void 0===n?void 0:n.length)&&void 0!==l?l:0,deletes:null!==(c=null===(d=e.deletes)||void 0===d?void 0:d.length)&&void 0!==c?c:0}),this.reset(),void(null===(g=this.onRowsInvalidatedFunc)||void 0===g||g.call(this,e));m&&(this.accumulate(e),Ne.v.debug("Infinite DATASERVER live update patched into the cache",{updates:null!==(u=null===(h=e.updates)||void 0===h?void 0:h.length)&&void 0!==u?u:0}),null===(p=this.onRowsUpdatedFunc)||void 0===p||p.call(this,e))}refreshPendingDeadlines(){for(const e of this.pendingBlocks)clearTimeout(e.timer),e.timer=this.createBlockTimer(e)}createBlockTimer(e){return setTimeout(()=>{Ne.v.warn(`Infinite DATASERVER block ${e.startRow}-${e.endRow} for ${this.resourceName} timed out waiting for rows; resolving with ${this.rowData.size} accumulated row(s).`),this.settleBlock(e,!0)},Lt.BLOCK_RESOLVE_TIMEOUT_MS)}accumulate(e){var t,i,r;const a=new Map(this.rowData);null===(t=e.inserts)||void 0===t||t.forEach(e=>{const t=null==e?void 0:e[this.rowId];void 0!==t&&a.set(t,e)}),null===(i=e.updates)||void 0===i||i.forEach(e=>{const t=null==e?void 0:e[this.rowId];if(void 0===t)return;const i=a.get(t);a.set(t,i?Object.assign(Object.assign({},i),e):e)}),null===(r=e.deletes)||void 0===r||r.forEach(e=>{const t=null==e?void 0:e[this.rowId];if(void 0===t)return;const i=this.cacheIndexOf(a,t);-1===i||this.deliveredRowCount>0&&i<this.deliveredRowCount||a.delete(t)}),this.rowData=a}cacheIndexOf(e,t){let i=0;for(const r of e.keys()){if(r===t)return i;i+=1}return-1}settleCoveredBlocks(){for(const e of[...this.pendingBlocks])(this.rowData.size>=e.endRow||!1===this.moreRows)&&this.settleBlock(e,!0)}settleBlock(e,t){var i;if(e.settled)return;if(e.settled=!0,this.pendingBlocks.delete(e),clearTimeout(e.timer),!t)return void e.fail();const r=[...this.rowData.values()].slice(e.startRow,e.endRow);this.deliveredRowCount=Math.max(this.deliveredRowCount,e.startRow+r.length);const a=!1===this.moreRows?this.rowData.size:this.hasCriteria?-1:null!==(i=this.serverRowsCount)&&void 0!==i?i:-1;this.warnIfViewTruncated(),Ne.v.debug("Infinite DATASERVER block settled",{startRow:e.startRow,endRow:e.endRow,rows:r.length,cached:this.rowData.size,lastRow:a}),e.success(r,a),this.deliverRows(e.startRow,r),this.notifyDataAvailability(e.startRow,r.length)}notifyDataAvailability(e,t){var i,r;0!==e||this.detached||(0===t?null===(i=this.onNoDataAvailableFunc)||void 0===i||i.call(this):null===(r=this.onDataAvailableFunc)||void 0===r||r.call(this))}deliverRows(e,t){var i,r;if(this.detached)return;const{withdrawnRowIds:a}=this.ledger.record(e,t);t.length>0&&(null===(i=this.onRowsDeliveredFunc)||void 0===i||i.call(this,t)),a.length>0&&(null===(r=this.onRowsWithdrawnFunc)||void 0===r||r.call(this,a))}warnIfViewTruncated(){var e,t;this.viewTruncationWarned||!1!==this.moreRows||this.hasCriteria||void 0===this.serverRowsCount||this.rowData.size>=this.serverRowsCount||(this.viewTruncationWarned=!0,Ne.v.warn(`${this.resourceName} stopped at ${this.rowData.size} of ${this.serverRowsCount} rows: the DATASERVER view is capped by MAX_VIEW (${null!==(t=null===(e=this.resourceParams)||void 0===e?void 0:e.MAX_VIEW)&&void 0!==t?t:"server default"}). Raise max-view past the row count to reach the rest.`))}failAllPendingBlocks(){for(const e of[...this.pendingBlocks])this.settleBlock(e,!1)}reset(){this.teardownDataserverSubscription()}teardownDataserverSubscription(){var e;this.failAllPendingBlocks(),null===(e=this.dataserverStreamSubscription)||void 0===e||e.unsubscribe(),this.dataserverStreamSubscription=void 0,this.dataserverStream=void 0,this.subscriptionKey=void 0,this.sourceRef=void 0,this.rowData=new Map,this.deliveredRowCount=0,this.streamStarted=!1,this.serverRowsCount=void 0,this.hasCriteria=!1,this.viewTruncationWarned=!1,this.moreRows=void 0,this.moreRowsInFlight=!1}destroy(){this.teardownDataserverSubscription(),this.ledger.clear(),Ne.v.debug("GenesisInfiniteDatasource destroyed")}detach(){this.detached=!0,this.loadGeneration+=1,this.rowCacheKey=void 0,this.destroy(),Ne.v.debug("GenesisInfiniteDatasource detached by its host")}}Lt.BLOCK_RESOLVE_TIMEOUT_MS=1e4,Lt.HTTP_NOT_FOUND=404;var Ft=i(62922);let Pt=class extends((0,xe.S)(Dt.ML)){constructor(){super(...arguments),this.request={},this.onDatasourceReady=e=>(0,r.sH)(this,void 0,void 0,function*(){if(!(yield this.initializeDatasource(this.datasourceOptions(),!0,!1)))return Ne.v.debug(`Genesis Datasource init failed for ${this.resourceName}`),this.clearRowData(),void this.setDisconnected(!0);if(!this.isInfiniteSupportedForResource())return void this.clearRowData();this.$emit(At.V.dataInit),this.setDisconnected(!1),this.indexes=this.getResourceIndexes(this.datasource.availableIndexes,this.datasource.availableSortableFields);const e=(0,bt.X)(this.datasource.originalFieldDef),t=yield this.getAgColumnDefs(e);this.$emit(kt.c.schemaUpdated,{schema:t,metadata:e}),this.infiniteDatasource=new Lt({createSnapshotFunc:this.createSnapshot.bind(this),createDataserverStreamFunc:this.createDataserverStream.bind(this),getMoreRowsFunc:e=>this.connect.getMoreRows(e,0),onRowsDeliveredFunc:this.reportDeliveredRows.bind(this),onRowsWithdrawnFunc:this.reportWithdrawnRows.bind(this),onRowCacheResetFunc:()=>this.clearRowData(!1),onRowsInvalidatedFunc:this.handleLiveRowsInvalidated.bind(this),onRowsUpdatedFunc:this.handleLiveRowsUpdated.bind(this),onNoDataAvailableFunc:()=>this.$emit(kt.c.noDataAvailable),onDataAvailableFunc:()=>this.$emit(kt.c.loadingFinished),errorHandlerFunc:this.handleErrors.bind(this),resourceName:this.resourceName,resourceParams:this.isRequestServer?this.datasource.requestOnlyParams:this.datasource.dataserverOnlyParams,resourceIndexes:this.indexes,resourceColDefs:this.datasource.originalFieldDef,maxRows:+this.maxRows,rowId:this.rowId,baseCriteria:this.buildCriteria(),isRequestServer:this.isRequestServer,defaultOrderBy:this.orderBy,defaultReverse:this.reverse}),this.$emit(kt.c.setInfiniteDatasource,{datasource:this.infiniteDatasource}),this.setupCommitTriggeredRefresh(),this.$emit(kt.c.addGridCssClass,{className:"grid-pro-infinite"}),this.$emit(kt.c.filtersRestored)})}resourceNameChanged(e,t){e&&e!==t&&n.DOM.queueUpdate(()=>(0,r.sH)(this,void 0,void 0,function*(){yield this.restart()}))}criteriaChanged(e,t){const i=e!==(0,Ct.Q)(t,";");this.infiniteDatasource&&i&&n.DOM.queueUpdate(()=>(0,r.sH)(this,void 0,void 0,function*(){yield this.reloadResourceData()}))}connectedCallback(){super.connectedCallback();const e=this.shouldRunConnect;n.DOM.queueUpdate(()=>{e&&(this.init(),this.subscribeToConnection(),this.subscribeToFilterChanges())})}disconnectedCallback(){super.disconnectedCallback();const e=this.shouldRunDisconnect;n.DOM.queueUpdate(()=>(0,r.sH)(this,void 0,void 0,function*(){e&&(yield this.destroy(),this.unsubscribeFromConnection(),this.unsubscribeFromFilterChanges())}))}subscribeToFilterChanges(){this.unsubscribeFromFilterChanges(),this.filterSub=this.update.pipe((0,Rt.i)(1),(0,Et.B)(600)).subscribe(()=>{this.infiniteDatasource&&this.reloadResourceData()})}unsubscribeFromFilterChanges(){var e;null===(e=this.filterSub)||void 0===e||e.unsubscribe(),this.filterSub=void 0}deepClone(){const e=super.deepClone();return e.deferredGridOptions=structuredClone(this.deferredGridOptions),e.deferredColumnStates=structuredClone(this.deferredColumnStates),e}reloadResourceData(){return(0,r.sH)(this,void 0,void 0,function*(){var e,t;null===(t=null===(e=this.infiniteDatasource)||void 0===e?void 0:e.detach)||void 0===t||t.call(e),this.infiniteDatasource=void 0,this.datasource.destroy(),this.$emit(kt.c.cacheFilterConfig),this.clearRowData(!1),this.setDisconnected(!1),this.$emit(kt.c.refreshInfiniteCache,{purge:!0}),yield this.init()})}init(){return(0,r.sH)(this,void 0,void 0,function*(){const e=Object.assign({getRowId:e=>e.data?String(e.data[this.rowId]):null,cacheBlockSize:this.maxRows,defaultColDef:{filter:!0,resizable:!0,sortable:!1,unSortIcon:!0},rowBuffer:0,rowModelType:"infinite",suppressMultiSort:!0,cacheOverflowSize:2,maxConcurrentDatasourceRequests:1,infiniteInitialRowCount:1,maxBlocksInCache:10},this.deferredGridOptions);this.$emit(kt.c.initialize,{options:e,keepColDefsOnClearRowData:this.keepColDefsOnClearRowData}),this.clearReadyListener(),this.addEventListener(kt.c.ready,this.onDatasourceReady,{once:!0}),this.resourceName||this.handleErrors("Application not connected or invalid resource name, datasource will not work.","unknown")})}clearReadyListener(){this.removeEventListener(kt.c.ready,this.onDatasourceReady)}isInfiniteSupportedForResource(){return!(this.isRequestServer&&!this.datasource.criteriaOnlyRequest)||(this.handleErrors(`Infinite row model is not supported for the REQUEST_SERVER resource '${this.resourceName}' because it does not support criteria-only requests. Set 'criteriaOnlyRequest = true' on the request reply definition, or use a client-side datasource for this resource.`,"resource-type"),!1)}handleLiveRowsInvalidated(e){this.reportLiveChange(e),this.$emit(kt.c.refreshInfiniteCache,{purge:!0})}handleLiveRowsUpdated(e){this.reportLiveChange(e),this.$emit(kt.c.refreshInfiniteCache,{purge:!1})}reportLiveChange(e){const t=this.resetTransaction();this.handleStreamUpdates(e.updates),this.handleStreamDeletes(e.deletes),this.emitTransaction(t)}destroy(){return(0,r.sH)(this,void 0,void 0,function*(){var e,t;this.clearReadyListener(),this.teardownCommitTriggeredRefresh(),this.$emit(kt.c.removeGridCssClass,{className:"grid-pro-infinite"}),this.datasource.destroy(),this.clearRowData(),this.infiniteDatasource&&(null===(t=(e=this.infiniteDatasource).detach)||void 0===t||t.call(e),this.infiniteDatasource=void 0),this.$emit(kt.c.setInfiniteDatasource,{datasource:null})})}restart(){return(0,r.sH)(this,void 0,void 0,function*(){yield this.destroy(),yield this.init()})}clearRowData(e=!0){this.rowData=new Map,this.resetTransaction(),this.$emit(kt.c.dataCleared,{includeSchema:e})}setupCommitTriggeredRefresh(){var e;this.teardownCommitTriggeredRefresh(),!this.isSnapshot&&this.isRequestServer&&(null===(e=this.pollTriggerEvents)||void 0===e?void 0:e.length)&&(this.commitResponseUnsubscribe=this.connectEvents.addCommitResponseListener(e=>{var t;const{eventName:i,response:r}=e.detail;this.pollTriggerEvents.includes(i)&&(null===(t=r.MESSAGE_TYPE)||void 0===t?void 0:t.endsWith("_ACK"))&&(Ne.v.debug(`Commit ACK for ${i}, re-reading the loaded blocks.`),this.$emit(kt.c.refreshInfiniteCache,{purge:!1}))}))}teardownCommitTriggeredRefresh(){var e;null===(e=this.commitResponseUnsubscribe)||void 0===e||e.call(this),this.commitResponseUnsubscribe=void 0}createSnapshot(){return(0,r.sH)(this,arguments,void 0,function*(e=null){return yield this.datasource.snapshot(e)})}createDataserverStream(e=null){return this.connect.stream(this.resourceName,()=>{},e=>{var t;Ne.v.error("Infinite DATASERVER paged stream error:",e),this.handleErrors((null===(t=null==e?void 0:e.receivedMessage)||void 0===t?void 0:t.ERROR)||(null==e?void 0:e.message),"stream")},e)}getAgColumnDefs(e){return(0,r.sH)(this,void 0,void 0,function*(){const t=this.generateColumnDefsFromMetadata(e,Ft.O,Ft.c),i=new Set;return this.indexes.forEach((e,t)=>{t&&e.forEach(e=>i.add(e))}),t.forEach(e=>{e.sortable=this.isRequestServer||i.has(e.field),this.datasource.criteriaOnlyRequest&&(e.filter=this.datasource.availableCriteriaFields.includes(e.field)?e.filter:null)}),t})}loadMore(){Ne.v.warn("loadMore() is not needed for Infinite Row Model - scrolling triggers data loading automatically")}};(0,r.Cg)([yt.dm],Pt.prototype,"connect",void 0),(0,r.Cg)([St.a4],Pt.prototype,"connectEvents",void 0),(0,r.Cg)([wt.yW],Pt.prototype,"datasource",void 0),(0,r.Cg)([n.observable],Pt.prototype,"request",void 0),Pt=(0,r.Cg)([(0,n.customElement)({name:"grid-pro-infinite-datasource"})],Pt);var Gt=i(18070),Mt=i(26062),$t=i(32610),_t=i(53397),Nt=i(52540),Bt=i(49104),Ht=i(88863),Vt=i(71964),zt=i(73203),Ut=i(50103),Kt=i(23201);(0,Ie.N)(Mt.D,mt.L,ft.X,Pt,Me.O,$e.G,pt),Le.syG.registerModules([Le.n76,Le.Q90,Le.x6L,Le.YN8,Le.YzW,Le.Lt,Le.I95,Le.O4V,Le.H18,Le.mfG,Le.Iws,Le.nSw,Le.FUS,Le.Ss0,Le.tkg,Le.ZDV,Le.ZyC,Le.XG7,Le.VZy,Le.$I9,Le.dGu,Le.AJG,Le.c5B,Le.BG,Le.KIB,Le.Sko,Le.ZuP,Le.Vc,lt]);const qt="gridReady";class Xt extends((0,xe.S)(ae.FoundationElement)){getColumnDragBridge(){return this.columnDragBridge}rowDataChanged(e,t){this.initialised&&this.gridApi&&this.gridApi.setGridOption("rowData",t)}gridSlotChanged(){this.gridSlot&&!this.initialised&&this.agGridOptions&&this.initGrid()}enableColumnSelectionChanged(){this.syncColumnSelectionHostLayout()}getfilterModel(){return(0,r.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){this.persistFilterModelKey?yield this.statePersistence.saveFilterModel(this.persistFilterModelKey,e):this._filterConfig=e})}constructor(){super(),this.gridErrorItems=[],this.disposed=!1,this.debouncedSaveColumnState=Ge()(this.saveColumnState.bind(this),400),this.debouncedSaveFilterModel=Ge()(this.cacheFilterConfig.bind(this),400),this.debouncedNotifyDatasourceVisibleColumns=Ge()(this.notifyDatasourceVisibleColumns.bind(this),400),this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.enableCellFlashing=!1,this.enableRowFlashing=!1,this.columnDragBridge={},this.columnComponentName="grid-pro-column",this.themeMode="dark",this.statusBarConfig=s.o2,this.withStatusBar=!1,this.enableColumnSelection=!1,this.applyingDatasourceGridOptions=!1,this.rehydrationAttempted=!1,this.rootEventsListeners=[],this.datasourceEventHandlers=[],this.gridEventsQueue=[],this.registeredGridEvents=new Set,this.gridEventListeners=new Map,this.boundGlobalEventListener=this.globalEventListener.bind(this),this._filterConfig=void 0,this.handleLuminanceChange=e=>{const t=o.baseLayerLuminance.getValueFor(e.target);this.themeMode=t===o.StandardLuminance.DarkMode?"dark":"light"},this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.agAttributes={},this.agPropertiesMap=$t.zI.reduce((e,t)=>(e[t.toLowerCase()]=t,e[(0,Ut.w)(t)]=t,e),{});const e=this.hideDatasourceError.bind(this);this.rootEventsListeners.push([At.V.dataInit,e],[$t.yY.datasourceErrorClose,e],[Gt.L.error,this.handleBaseDatasourceError.bind(this)],[Gt.L.connected,e]),this.datasourceEventHandlers=[[kt.c.initialize,this.handleInitialize.bind(this)],[kt.c.dataLoaded,this.handleDataLoaded.bind(this)],[kt.c.dataChanged,this.handleDataChanged.bind(this)],[kt.c.schemaUpdated,this.handleSchemaUpdated.bind(this)],[kt.c.dataCleared,this.handleDataCleared.bind(this)],[kt.c.loadingStarted,this.handleLoadingStarted.bind(this)],[kt.c.loadingFinished,this.handleLoadingFinished.bind(this)],[kt.c.noDataAvailable,this.handleNoDataAvailable.bind(this)],[kt.c.filtersRestored,this.handleFiltersRestored.bind(this)],[kt.c.moreDataAvailable,this.handleMoreDataAvailable.bind(this)],[kt.c.error,this.handleDatasourceError.bind(this)],[kt.c.destroy,this.handleDatasourceDestroy.bind(this)],[kt.c.cacheFilterConfig,this.cacheFilterConfig.bind(this)],[kt.c.refreshServerSide,this.handleRefreshServerSide.bind(this)],[kt.c.setServerSideDatasource,this.handleSetServerSideDatasource.bind(this)],[kt.c.addGridCssClass,this.handleAddGridCssClass.bind(this)],[kt.c.removeGridCssClass,this.handleRemoveGridCssClass.bind(this)],[kt.c.applyServerSideTransaction,this.handleApplyServerSideTransaction.bind(this)],[kt.c.setInfiniteDatasource,this.handleSetInfiniteDatasource.bind(this)],[kt.c.refreshInfiniteCache,this.handleRefreshInfiniteCache.bind(this)]]}addEventListener(e,t,i){super.addEventListener(e,t,i),this.gridApi?this.addGridEventListener(e):this.gridEventsQueue.includes(e)||this.gridEventsQueue.push(e)}addGridEventListener(e){if(this.registeredGridEvents.has(e))return;this.registeredGridEvents.add(e);const t=t=>{this.$emit(e,t)};this.gridEventListeners.set(e,t),this.gridApi.addEventListener(e,t)}handleError(e,t){this.gridErrorItems=[...this.gridErrorItems,{detail:t.detail,type:e}]}handleBaseDatasourceError(e){const t={detail:{message:e.detail.message},type:$t.Ie.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:t.detail,type:t.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(e=>e.type!==$t.Ie.datasource),this.removeAttribute("ds-disconnected")}connectedCallback(){var e;super.connectedCallback(),this.syncColumnSelectionHostLayout(),this.disposed=!1;const t=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=o.baseLayerLuminance.subscribe(this.luminanceObserver,t),this.gridAutosizingEnabled&&(this.visibilityObserverCleanup=(0,Te.j)(this,e=>{e&&this.debouncedColumnAutosize()})),this.rehydrationAttempted=!1,this.shouldRunConnect&&(this.rootEventsListeners.forEach(([e,t])=>{this.addEventListener(e,t)}),$t.zI.forEach(e=>{const t=function(e,t){let i=Object.getPrototypeOf(e);for(;i&&i!==HTMLElement.prototype;){const e=Object.getOwnPropertyDescriptor(i,t);if(e)return e;i=Object.getPrototypeOf(i)}}(this,e);Object.defineProperty(this,e,{get:null==t?void 0:t.get,set:i=>{var r,a;const s=null===(r=null==t?void 0:t.get)||void 0===r?void 0:r.call(this);null===(a=null==t?void 0:t.set)||void 0===a||a.call(this,i),this.agAttributeChangedCallback((0,Ut.w)(e),s,i)},enumerable:!0,configurable:!0})}),this.toggleDatasourceEventListeners(!0))}disconnectedCallback(){var e;this.disposed=!0,this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel();const t=null!==(e=this.provider)&&void 0!==e?e:this;o.baseLayerLuminance.unsubscribe(this.luminanceObserver,t),this.luminanceSubscription&&(this.luminanceSubscription.unsubscribe(),this.luminanceSubscription=void 0),this.visibilityObserverCleanup&&(this.visibilityObserverCleanup(),this.visibilityObserverCleanup=void 0),super.disconnectedCallback(),this.rehydrationAttempted=!1;const i=this.shouldRunDisconnect;this.rootEventsListeners.forEach(([e,t])=>{this.removeEventListener(e,t)}),i?this.performDisconnectCleanup():queueMicrotask(()=>{this.isConnected||this.performDisconnectCleanup()})}syncColumnSelectionHostLayout(){this.classList.toggle("has-column-selection",this.enableColumnSelection)}performDisconnectCleanup(){this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.initialised=!1,this.resetGridOptionsState(),this.destroyGridInstance(),this.toggleDatasourceEventListeners(!1),this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel(),this.registeredGridEvents.clear(),this.gridEventsQueue=[]}destroyGridInstance(){this.gridApi&&this.gridEventListeners.forEach((e,t)=>{this.gridApi.removeEventListener(t,e)}),this.gridEventListeners.clear(),this.gridApi?this.gridApi.destroy():this.agGrid&&this.agGrid.destroy(),this.gridSlot&&this.gridSlot.replaceChildren(),this.gridApi=void 0,this.agGrid=void 0}toggleDatasourceEventListeners(e){const t=e?"addEventListener":"removeEventListener";this.datasourceEventHandlers.forEach(([e,i])=>{super[t](e,i)})}handleInitialize(e){const{options:t,keepColDefsOnClearRowData:i}=e.detail;i&&(this.columnState=this.gridApi.getColumnState()),this.applyingDatasourceGridOptions=!0;try{this.gridOptions=Object.assign(Object.assign(Object.assign({},this.userProvidedGridOptions),t),i?{columnDefs:this.gridApi.getColumnDefs()}:{}),this.initGrid()}finally{this.applyingDatasourceGridOptions=!1}}handleDataLoaded(e){const{data:t}=e.detail;this.gridApi&&this.gridApi.setGridOption("rowData",t)}handleDataChanged(e){const{changes:t}=e.detail;if(!this.gridApi||!this.isClientSideRowModel)return;const i=this.gridApi.applyTransaction(t);this.flashAddedCells(null==i?void 0:i.add)}get isClientSideRowModel(){var e,t,i;return"clientSide"===(null!==(i=null===(t=null===(e=this.gridApi)||void 0===e?void 0:e.getGridOption)||void 0===t?void 0:t.call(e,"rowModelType"))&&void 0!==i?i:"clientSide")}flashAddedCells(e){this.enableRowFlashing&&(null==e?void 0:e.length)&&this.gridApi.flashCells({rowNodes:e})}handleSchemaUpdated(e){return(0,r.sH)(this,void 0,void 0,function*(){this.gridApi?yield this.processSchemaUpdate(e.detail):this.pendingSchemaUpdate=e.detail})}processSchemaUpdate(e){return(0,r.sH)(this,arguments,void 0,function*({schema:e}){const t=this.gridApi.getColumnDefs();if(t&&t.length>0)return;this.applyCommunityFilterFallbacks(e);const i=yield this.mergeAllColumnDefsAndStates(e,!0);this.gridApi.setGridOption("columnDefs",i),this.restoreCachedFilterConfig()})}applyCommunityFilterFallbacks(e){const t=this.gridApi.isModuleRegistered("SetFilterModule"),i=this.gridApi.isModuleRegistered("MultiFilterModule");e.forEach(e=>{var r,a,s,o,n;if("agSetColumnFilter"===e.filter&&!t)return Ne.v.debug(`SetFilterModule is not registered; column '${e.field}' falls back to the enum filter`),e.filter=De.enumFilter,void(null!==(r=e.floatingFilterComponent)&&void 0!==r||(e.floatingFilterComponent=De.enumFloatingFilter));if("agMultiColumnFilter"!==e.filter)return;const l=null===(s=null===(a=e.filterParams)||void 0===a?void 0:a.filters)||void 0===s?void 0:s.find(e=>"agSetColumnFilter"===e.filter);i?!t&&l&&(Ne.v.debug(`SetFilterModule is not registered; the set sub-filter of column '${e.field}' falls back to the enum filter`),l.filter=De.enumFilter):(null===(o=null==l?void 0:l.filterParams)||void 0===o?void 0:o.values)?(Ne.v.debug(`MultiFilterModule is not registered; enum column '${e.field}' falls back to the enum filter`),e.filter=De.enumFilter,e.filterParams=Object.assign({},l.filterParams),null!==(n=e.floatingFilterComponent)&&void 0!==n||(e.floatingFilterComponent=De.enumFloatingFilter)):(Ne.v.warn("MultiFilterModule is not registered, falling back to text filter"),e.filter="agTextColumnFilter")})}handleDataCleared(e){const{includeSchema:t}=e.detail;this.gridApi&&(t&&this.gridApi.setGridOption("columnDefs",[]),this.isClientSideRowModel&&this.gridApi.setGridOption("rowData",[]),this.gridApi.refreshCells({force:!0}))}handleLoadingStarted(){this.gridApi&&this.gridApi.setGridOption("loading",!0)}handleLoadingFinished(){this.gridApi&&(this.gridApi.setGridOption("loading",!1),this.gridApi.hideOverlay())}handleNoDataAvailable(){this.gridApi&&(this.gridApi.setGridOption("loading",!1),this.gridApi.showNoRowsOverlay())}handleFiltersRestored(){this.restoreCachedFilterConfig()}handleMoreDataAvailable(e){var t,i,r,a;const{hasMoreData:o,sourceRef:n}=e.detail;if(!this.gridApi)return;const l=null===(i=(t=this.gridApi).getStatusPanel)||void 0===i?void 0:i.call(t,s.k7.loadMore);l&&(null===(a=(r=l).updateParams)||void 0===a||a.call(r,{moreRows:o,sourceRef:n}))}handleDatasourceError(){this.setAttribute("ds-disconnected","ds-disconnected")}handleDatasourceDestroy(){this.clearLocalGridOptions()}handleRefreshServerSide(e){const{purge:t}=e.detail;this.gridApi&&this.gridApi.refreshServerSide({purge:t})}handleSetServerSideDatasource(e){const{datasource:t}=e.detail;this.gridApi&&this.gridApi.setGridOption("serverSideDatasource",t)}handleAddGridCssClass(e){var t;const{className:i}=e.detail,r=(null===(t=this.gridSlot)||void 0===t?void 0:t.parentElement)||this;r&&r.classList.add(i)}handleRemoveGridCssClass(e){var t;const{className:i}=e.detail,r=(null===(t=this.gridSlot)||void 0===t?void 0:t.parentElement)||this;r&&r.classList.remove(i)}handleApplyServerSideTransaction(e){var t,i;const{transaction:r,async:a,callback:s}=e.detail;if(this.gridApi)if(a)this.gridApi.applyServerSideTransactionAsync(r,e=>{var t,i;this.flashAddedCells([...null!==(t=null==e?void 0:e.add)&&void 0!==t?t:[],...null!==(i=null==e?void 0:e.update)&&void 0!==i?i:[]]),null==s||s(e)});else{const e=this.gridApi.applyServerSideTransaction(r);this.flashAddedCells([...null!==(t=null==e?void 0:e.add)&&void 0!==t?t:[],...null!==(i=null==e?void 0:e.update)&&void 0!==i?i:[]]),s&&s(e)}}handleSetInfiniteDatasource(e){const{datasource:t}=e.detail;this.gridApi&&this.gridApi.setGridOption("datasource",t)}handleRefreshInfiniteCache(e){var t;this.gridApi&&((null===(t=e.detail)||void 0===t?void 0:t.purge)?this.gridApi.purgeInfiniteCache():this.gridApi.refreshInfiniteCache())}combineAllGridComponents(e){const t={[s.IX.action]:R.eA,[s.IX.actionsMenu]:k.cN,[s.IX.boolean]:I._Y,[s.IX.editable]:L.YM,[s.IX.icon]:G.Jt,[s.IX.statusPill]:H.N7,[s.IX.select]:_.gs,[s.IX.selectEditor]:l._Q,[s.IX.numberEditor]:g.Z0,[s.IX.multiselectEditor]:p.pZ,[s.IX.dateEditor]:f.S8,[s.IX.stringEditor]:y.XJ,[De.enumFilter]:Ue,[De.enumFloatingFilter]:Xe,[s.k7.labelValue]:Nt.k,[s.k7.loadMore]:Bt.s,[s.k7.reload]:Ht.W,[s.k7.rowCount]:Vt.i};return Object.assign(Object.assign(Object.assign({},t),e),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var e,t,i,r;try{if(!this.initialised||!this.gridApi)return[];const a=null===(e=this.gridOptions)||void 0===e?void 0:e.rowSelection;if("single"===a||"multiple"===a)return this.gridApi.getSelectedRows&&this.gridApi.getSelectedRows().length>0?this.gridApi.getSelectedRows():[];if((null===(t=this.gridApi)||void 0===t?void 0:t.getCellRanges)&&this.gridApi.getCellRanges().length>0)return this.getCellRangeRowData();if(!(null===(i=this.gridOptions)||void 0===i?void 0:i.enableRangeSelection)){const e=null===(r=this.gridApi)||void 0===r?void 0:r.getFocusedCell();if(e){const t=this.gridApi.getDisplayedRowAtIndex(e.rowIndex);if(null==t?void 0:t.data)return[t.data]}}return[]}catch(e){return Ne.v.error("Grid Pro: Error getting selected rows:",e),[]}}getCellRangeRowData(){var e;if(!(null===(e=this.gridApi)||void 0===e?void 0:e.getCellRanges))return[];const t=this.gridApi.getCellRanges();if(0===t.length)return[];const i=[];return t.forEach(e=>{const t=e.startRow.rowIndex,r=e.endRow.rowIndex;for(let e=t;e<=r;e+=1){const t=this.gridApi.getDisplayedRowAtIndex(e);(null==t?void 0:t.data)&&!i.some(e=>e===t.data)&&i.push(t.data)}}),i}hasSelectedRows(){return this.getSelectedRows().length>0}updateLabelValueStatusBar(e){var t,i;if(!this.gridApi)return void Ne.v.warn("Grid Pro: Cannot update label-value status bar - grid API not available");const r=null===(i=(t=this.gridApi).getStatusPanel)||void 0===i?void 0:i.call(t,s.k7.labelValue);r&&"function"==typeof r.updateParams?r.updateParams(e):Ne.v.warn("Grid Pro: Label-value status bar component not found or updateParams method not available")}debouncedColumnAutosize(){this.gridAutosizingEnabled&&(this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.debounced=setTimeout(()=>{var e;null===(e=this.gridApi)||void 0===e||e.sizeColumnsToFit()},$t.BW))}removeConfigWidthsToAutosize(e){return e.map(e=>Object.assign(Object.assign({},e),{width:null}))}saveColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()){let e=this.gridApi.getColumnState();e=(0,Kt.n7)(e),e=this.gridAutosizingEnabled?this.removeConfigWidthsToAutosize(e):e;const t=0===e.filter(e=>{if(e.hide)return!1;const t=this.gridApi.getColumn(e.colId);return Boolean(t.getColDef().headerName)}).length;if(0===e.length||JSON.stringify(e)===JSON.stringify(this.columnState)||t)return;yield this.statePersistence.saveColumnState(this.persistColumnStateKey,e),this.columnState=e}})}getSavedColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){return this.columnState=[],this.statePersistanceEnabled()&&(this.columnState=yield this.statePersistence.getColumnState(this.persistColumnStateKey)),this.columnState})}restoreColumnState(){return(0,r.sH)(this,void 0,void 0,function*(){var e;this.rehydrationAttempted=!0;const t=yield this.getSavedColumnState(),i=(0,Kt.n7)(t);i&&i.length>0&&(null===(e=this.gridApi)||void 0===e||e.applyColumnState({state:i,applyOrder:!0}))})}cacheFilterConfig(){var e;this.setFilterModel((null===(e=this.gridApi)||void 0===e?void 0:e.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,r.sH)(this,void 0,void 0,function*(){var e,t;const i=yield this.getfilterModel();void 0!==i&&(null===(e=this.gridApi)||void 0===e||e.setFilterModel(i),null===(t=this.gridApi)||void 0===t||t.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof ft.X}get gridParams(){return{globalListener:this.boundGlobalEventListener,modules:[lt,Le.Vc,Le.ZuP]}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")||this.querySelector("grid-pro-infinite-datasource")}get isInfiniteRowModel(){return this.gridProDatasource instanceof Pt}notifyDatasourceVisibleColumns(){var e,t,i,r;const a=this.gridProDatasource;if(!a)return;const s=(0,_e.C)(null===(t=null===(e=this.gridApi)||void 0===e?void 0:e.getAllDisplayedColumns)||void 0===t?void 0:t.call(e),null===(r=null===(i=this.gridApi)||void 0===i?void 0:i.getColumnDefs)||void 0===r?void 0:r.call(i));s.length&&a.setVisibleColumns(s)}set gridOptions(e){!this.applyingDatasourceGridOptions&&e&&(this.userProvidedGridOptions=Object.assign({},e));const t=()=>{!this.disposed&&this.isConnected&&(this.debouncedSaveColumnState(),this.debouncedColumnAutosize())},i=()=>{!this.disposed&&this.isConnected&&this.debouncedNotifyDatasourceVisibleColumns()};Array.from(this.attributes).forEach(e=>{const t=this.agPropertiesMap[e.name];t&&(this.agAttributes[t]=e.value)});const{columnDefs:a,components:o,defaultColDef:n,getRowId:l,onGridReady:d,onFilterChanged:c,onFirstDataRendered:g}=e,h=(0,r.Tt)(e,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered"]),u=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.gridOptionsConfig),{defaultColDef:Object.assign({enableCellChangeFlash:this.enableCellFlashing,filter:!0,resizable:!0,sortable:!0},n),components:this.combineAllGridComponents(o),headerHeight:this.headerHeight,rowHeight:this.rowHeight,animateRows:!1,suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:e=>(0,r.sH)(this,void 0,void 0,function*(){var t,i,r;if(this.gridApi=e.api,this.gridEventsQueue.length&&this.gridEventsQueue.forEach(e=>{this.addGridEventListener(e)}),this.pendingSchemaUpdate){const e=this.pendingSchemaUpdate;this.pendingSchemaUpdate=void 0;try{yield this.processSchemaUpdate(e)}catch(e){Ne.v.error("Grid Pro: failed to apply the pending schema update on grid ready:",e)}}this.rowData&&this.gridApi.setGridOption("rowData",this.rowData),d&&d(e),(null===(t=this.gridProDatasource)||void 0===t?void 0:t.keepColDefsOnClearRowData)&&(null===(i=this.columnState)||void 0===i?void 0:i.length)>0&&this.gridApi.applyColumnState({state:this.columnState,applyOrder:!0}),this.$emit(qt,{event:e,gridId:this.id}),this.$emit(s.mr,{event:e,gridId:this.id}),this.notifyDatasourceVisibleColumns(),null===(r=this.gridProDatasource)||void 0===r||r.$emit(kt.c.ready),this.restoreColumnState(),this.restoreCachedFilterConfig(),this.debouncedColumnAutosize()}),onFirstDataRendered:e=>{this.notifyDatasourceVisibleColumns(),g&&g(e)},onColumnPinned:t,onColumnResized:t,onColumnMoved:t,onColumnVisible:()=>{t(),i()},onDisplayedColumnsChanged:()=>{t(),i()},onFilterChanged:e=>{!this.disposed&&this.isConnected&&(this.debouncedSaveFilterModel(),c&&c(e))},onGridSizeChanged:t,onSortChanged:t}),h);this.gridProDatasource?(u.columnDefs=a,u.getRowId=l,this.setupStatusBar(u),this.setLocalGridOptions(u)):this.mergeAllColumnDefsAndStates(a).then(e=>{!this.disposed&&this.isConnected&&(u.columnDefs=e,u.getRowId=l,this.setupStatusBar(u),this.setLocalGridOptions(u),this.initGrid())})}setLocalGridOptions(e){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),(0,$t.Qg)(e,this.agAttributes)),this.agGridOptions.context=Object.assign(Object.assign({},this.agGridOptions.context),{[ot]:this.columnDragBridge}),null==this.agGridOptions.allowDragFromColumnsToolPanel&&(this.agGridOptions.allowDragFromColumnsToolPanel=!0)}clearLocalGridOptions(){this.agGridOptions=void 0}resetGridOptionsState(){this.userProvidedGridOptions=void 0,this.agGridOptions=void 0}initGrid(){n.DOM.queueUpdate(()=>{!this.disposed&&this.isConnected&&this.gridSlot&&(this.initialised&&(this.destroyGridInstance(),this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild)),this.agGrid=(0,Le.Dvw)(this.gridSlot,this.agGridOptions,this.gridParams),this.initialised=!0)})}mergeAllColumnDefsAndStates(e){return(0,r.sH)(this,arguments,void 0,function*(e,t=!1){var i;const r=e||[];r.forEach(e=>{if(this.headerCaseType&&e.field&&!e.headerName){const t=Fe[this.headerCaseType];t?e.headerName=t(e.field):Ne.v.warn(`Invalid header-case-type attribute value: ${this.headerCaseType}. Please use one of the following: camelCase, capitalCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase.`)}});const a=Array.from(this.querySelectorAll(this.columnComponentName)).map(e=>e.definition).map(e=>{var t,i,a,o,n,l;if(this.enableCellFlashing&&void 0===e.enableCellChangeFlash&&(e.enableCellChangeFlash=!0),"agSetColumnFilter"===e.filter||e.filter===De.enumFilter){if(!(null!=e.filterParams&&"values"in e.filterParams)){const s=null===(t=r.find(t=>t.field===e.field))||void 0===t?void 0:t.filterParams,l=null!==(i=null==s?void 0:s.values)&&void 0!==i?i:null===(n=null===(o=null===(a=null==s?void 0:s.filters)||void 0===a?void 0:a.find(e=>"agSetColumnFilter"===e.filter))||void 0===o?void 0:o.filterParams)||void 0===n?void 0:n.values;l&&(e.filterParams=Object.assign(Object.assign({},e.filterParams),{values:l}))}e.filter===De.enumFilter&&(null!==(l=e.floatingFilterComponent)&&void 0!==l||(e.floatingFilterComponent=De.enumFloatingFilter))}e.editable&&(e.cellRenderer||e.cellRendererSelector||(e.cellRendererSelector=t=>{if(t.data[s.A7]===e.field)return{component:s.IX.editable}}),e.tooltipComponent||e.tooltipValueGetter||(e.tooltipComponent=zt.y,e.tooltipValueGetter=t=>{const i=t.data[s.h1];if(i&&i.column===e.field)return i.message}),e.cellClassRules||(e.cellClassRules={error:e=>{var t;return(null===(t=e.data[s.h1])||void 0===t?void 0:t.column)===e.colDef.field}}));const d=r.find(t=>e.field===t.field);return Object.assign(Object.assign({},d),e)}),o=a.map(e=>e.field),n=[...a,...this.onlyTemplateColDefs?[]:r.filter(e=>!o.includes(e.field))];if(this.gridProDatasource&&t){const e=yield this.getSavedColumnState();if((null==e?void 0:e.length)>0)return(0,Kt.yS)(n,e);if((null===(i=this.gridProDatasource.deferredColumnStates)||void 0===i?void 0:i.length)>0)return(0,Kt.yS)(n,this.gridProDatasource.deferredColumnStates)}return n})}panelExists(e,t){return t.some(t=>t.statusPanel===e)}addRowCountPanel(e,t){if(this.statusBarConfig&&!0===this.statusBarConfig.rows){const i=this.isServerSide||this.isInfiniteRowModel||"infinite"===(null==t?void 0:t.rowModelType)||"serverSide"===(null==t?void 0:t.rowModelType);if(i)this.panelExists(s.k7.rowCount,e)||e.push({statusPanel:s.k7.rowCount,align:"left"});else if(!i){const t="agTotalAndFilteredRowCountComponent";this.panelExists(t,e)||e.push({statusPanel:t,align:"left"})}}}addMaxRowsPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.maxRows&&(this.panelExists(s.k7.labelValue,e)||e.push({statusPanel:s.k7.labelValue,statusPanelParams:{label:"Max Rows",value:this.gridProDatasource.maxRows||Oe.OD.MAX_ROWS_250,hide:!1},align:"left"}))}addAggregationPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.aggregation&&(this.panelExists("agAggregationComponent",e)||e.push({statusPanel:"agAggregationComponent",align:"right"}))}addDatasourcePanels(e){if(this.gridProDatasource){const t=this.gridProDatasource.getDatasourceStatusBarPanels(this.isServerSide||this.isInfiniteRowModel,this.statusBarConfig).filter(t=>!this.panelExists(t.statusPanel,e));e.push(...t)}}setupStatusBar(e){var t,i;if(this.withStatusBar&&this.statusBarConfig){const r=[...(null===(t=e.statusBar)||void 0===t?void 0:t.statusPanels)||[]];this.addRowCountPanel(r,e),this.addMaxRowsPanel(r),this.addAggregationPanel(r),this.addDatasourcePanels(r);const a=((null===(i=e.statusBar)||void 0===i?void 0:i.statusPanels)||[]).filter(e=>!this.panelExists(e.statusPanel,r));r.push(...a),e.statusBar={statusPanels:r}}}get observedAttributes(){const e=$t.zI.map(e=>e.toLowerCase()),t=$t.zI.map(e=>(0,Ut.w)(e));return e.concat(t)}agAttributeChangedCallback(e,t,i){var r;if(t===i)return;const a=this.agPropertiesMap[e];a&&(this.agAttributes[a]=i,this.initialised&&(null===(r=this.gridApi)||void 0===r||r.setGridOption(a,i)))}globalEventListener(e,t){const i=e.toLowerCase(),r=new Event(i);r.agGridDetails=t,this.dispatchEvent(r);const a="on"+i;"function"==typeof this[a]&&this[a](r)}}(0,r.Cg)([n.observable],Xt.prototype,"gridApi",void 0),(0,r.Cg)([n.observable],Xt.prototype,"gridErrorItems",void 0),(0,r.Cg)([_t.l],Xt.prototype,"statePersistence",void 0),(0,r.Cg)([(0,n.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],Xt.prototype,"autoCellRendererByType",void 0),(0,r.Cg)([(0,n.attr)({attribute:"only-template-col-defs",mode:"boolean"})],Xt.prototype,"onlyTemplateColDefs",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"grid-autosizing"})],Xt.prototype,"gridAutosizingEnabled",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],Xt.prototype,"enableCellFlashing",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-row-flashing"})],Xt.prototype,"enableRowFlashing",void 0),(0,r.Cg)([(0,n.attr)({attribute:"persist-column-state-key"})],Xt.prototype,"persistColumnStateKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"persist-filter-model-key"})],Xt.prototype,"persistFilterModelKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"header-case-type"})],Xt.prototype,"headerCaseType",void 0),(0,r.Cg)([n.observable],Xt.prototype,"rowData",void 0),(0,r.Cg)([n.attr],Xt.prototype,"columnComponentName",void 0),(0,r.Cg)([n.observable],Xt.prototype,"eventsAndCallbacks",void 0),(0,r.Cg)([n.attr],Xt.prototype,"headerHeight",void 0),(0,r.Cg)([n.attr],Xt.prototype,"rowHeight",void 0),(0,r.Cg)([n.observable],Xt.prototype,"classNames",void 0),(0,r.Cg)([n.observable],Xt.prototype,"agGrid",void 0),(0,r.Cg)([n.observable],Xt.prototype,"gridSlot",void 0),(0,r.Cg)([n.observable],Xt.prototype,"themeMode",void 0),(0,r.Cg)([n.observable],Xt.prototype,"gridComponents",void 0),(0,r.Cg)([n.observable],Xt.prototype,"statusBarConfig",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"with-status-bar"})],Xt.prototype,"withStatusBar",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-column-selection"})],Xt.prototype,"enableColumnSelection",void 0),(0,r.Cg)([n.observable],Xt.prototype,"customErrorHandlerTemplate",void 0),(0,r.Cg)([s.lz],Xt.prototype,"gridOptionsConfig",void 0),(0,r.Cg)([n.observable],Xt.prototype,"provider",void 0);const jt={backgroundColor:"var(--neutral-layer-card-container)",cellHorizontalPadding:"calc(var(--design-unit) * 2px)",foregroundColor:"var(--neutral-foreground-rest)",headerTextColor:"var(--neutral-foreground-hint)",headerBackgroundColor:"var(--neutral-layer-3)",headerColumnBorder:"1px solid var(--neutral-stroke-rest)",oddRowBackgroundColor:"var(--neutral-layer-1)",rowBorder:"1px solid var(--neutral-stroke-divider-rest)",borderColor:"var(--neutral-stroke-rest)",wrapperBorder:"0",accentColor:"var(--accent-foreground-rest)",fontFamily:"var(--body-font)",sideBarBackgroundColor:"var(--neutral-layer-2)",dataFontSize:"var(--type-ramp-minus-2-font-size)",iconButtonColor:"var(--accent-foreground-rest)",iconButtonHoverColor:"color-mix(in srgb, var(--accent-foreground-rest), var(--ag-foreground-color) 30%)"},Yt=["rowheight","row-height"];function Wt(e){const t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}class Qt extends Xt{getCachedTheme(e){const t=null!=e?e:"default";let i=Qt.cachedThemes.get(t);return i||(i=Le.N8R.withParams("default"===t?jt:Object.assign(Object.assign({},jt),{rowHeight:`${t}px`})),Qt.cachedThemes.set(t,i)),i}resolveRowHeight(e){for(const e of Yt){const t=Wt(this.getAttribute(e));if(t)return t}return Wt(e.rowHeight)}agAttributeChangedCallback(e,t,i){var r;super.agAttributeChangedCallback(e,t,i),"rowHeight"===this.agPropertiesMap[e]&&t!==i&&(null===(r=this.gridApi)||void 0===r||r.setGridOption("theme",this.getCachedTheme(Wt(i))))}set gridOptions(e){const t=Object.assign({},e);t.components=Object.assign({[s.IX.action]:E,[s.IX.actionsMenu]:D,[s.IX.boolean]:x,[s.IX.editable]:F,[s.IX.select]:N,[s.IX.selectEditor]:d,[s.IX.numberEditor]:h,[s.IX.multiselectEditor]:v,[s.IX.dateEditor]:b,[s.IX.stringEditor]:S,[s.IX.statusPill]:V,[s.IX.icon]:M},t.components),t.theme=this.getCachedTheme(this.resolveRowHeight(t)),super.gridOptions=t}}Qt.cachedThemes=new Map,(0,r.Cg)([n.observable],Qt.prototype,"provider",void 0);const Jt=Qt.compose(Object.assign({baseName:"grid-pro",template:ie,styles:n.css`
|
|
938
938
|
${U.yK}
|
|
939
939
|
${rt.M}
|
|
940
940
|
${U.em}
|
|
@@ -976,7 +976,7 @@
|
|
|
976
976
|
.grid-pro-infinite .ag-header-cell-sortable:hover .ag-sort-none-icon {
|
|
977
977
|
opacity: 1;
|
|
978
978
|
}
|
|
979
|
-
`,shadowOptions:Ee},Ae));var
|
|
979
|
+
`,shadowOptions:Ee},Ae));var Zt=i(96598);class ei extends Zt.t{}const ti=ei.compose({baseName:"grid-text-renderer",styles:Zt.JN,template:(0,Zt.d6)("rapid")});class ii extends pt{}const ri=ii.compose({baseName:"column-selection",template:at("rapid"),styles:rt.H}),ai={rapidIconRenderer:$,rapidAgEditableRenderer:P,rapidAgActionRenderer:A,rapidAgActionsMenuRenderer:O,rapidAgBooleanRenderer:T,rapidAgTextRenderer:ti,rapidAgSelectRenderer:B,rapidAgDateEditor:C,rapidAgMultiselectEditor:m,rapidAgSelectEditor:c,rapidAgNumberEditor:u,rapidAgStringEditor:w,rapidStatusPillRenderer:z,rapidGridPro:ke,rapidColumnSelection:ri,register(e,...t){if(e)for(const i in this)"register"!==i&&this[i]().register(e,...t)}};var si=i(58749),oi=i(95553),ni=i(14609),li=i(86636);const di={fromView(e){if(null==e?void 0:e.trim())return e.includes(",")?e.split(",").map(e=>e.trim()):e.trim()},toView:e=>"string"==typeof e?e:Array.isArray(e)?e.join(","):""},ci="--dropdown-width",gi="options",hi="dnone",ui=n.css`
|
|
980
980
|
label {
|
|
981
981
|
color: var(--neutral-foreground-hint, rgb(135 155 166));
|
|
982
982
|
font-style: normal;
|
|
@@ -987,7 +987,7 @@
|
|
|
987
987
|
line-height: var(--type-ramp-base-line-height);
|
|
988
988
|
}
|
|
989
989
|
|
|
990
|
-
.${
|
|
990
|
+
.${hi} {
|
|
991
991
|
display: none !important;
|
|
992
992
|
}
|
|
993
993
|
|
|
@@ -995,7 +995,7 @@
|
|
|
995
995
|
position: relative;
|
|
996
996
|
width: inherit;
|
|
997
997
|
min-width: 250px;
|
|
998
|
-
${
|
|
998
|
+
${ci}: 350px;
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
1001
|
.control {
|
|
@@ -1078,9 +1078,9 @@
|
|
|
1078
1078
|
opacity: var(--disabled-opacity);
|
|
1079
1079
|
}
|
|
1080
1080
|
|
|
1081
|
-
.${
|
|
1081
|
+
.${gi} {
|
|
1082
1082
|
min-width: 100%;
|
|
1083
|
-
width: var(${
|
|
1083
|
+
width: var(${ci});
|
|
1084
1084
|
display: flex;
|
|
1085
1085
|
flex-direction: column;
|
|
1086
1086
|
position: absolute;
|
|
@@ -1112,11 +1112,11 @@
|
|
|
1112
1112
|
.visible {
|
|
1113
1113
|
visibility: visible;
|
|
1114
1114
|
}
|
|
1115
|
-
`;var
|
|
1115
|
+
`;var pi=i(40729),vi=i(31679);const mi=(e="foundation")=>n.html`
|
|
1116
1116
|
<label
|
|
1117
1117
|
part="label"
|
|
1118
1118
|
for="control"
|
|
1119
|
-
class="label ${e=>{var t,i;return null!==(i=(0,
|
|
1119
|
+
class="label ${e=>{var t,i;return null!==(i=(0,vi.x)([hi,!(null!==(t=e.hasSlottedContent)&&void 0!==t&&t)]))&&void 0!==i?i:""}}"
|
|
1120
1120
|
>
|
|
1121
1121
|
<slot
|
|
1122
1122
|
${(0,n.slotted)({property:"defaultSlottedNodes"})}
|
|
@@ -1127,12 +1127,12 @@
|
|
|
1127
1127
|
<${e}-icon
|
|
1128
1128
|
id="arrow-icon"
|
|
1129
1129
|
name="chevron-down"
|
|
1130
|
-
class="${e=>(0,
|
|
1130
|
+
class="${e=>(0,vi.x)(["flipped",e.open],["disabled-icon",e.disabled])}"
|
|
1131
1131
|
@click=${e=>!e.disabled&&e.toggle()}
|
|
1132
1132
|
></${e}-icon>
|
|
1133
1133
|
<${e}-icon
|
|
1134
1134
|
name="xmark"
|
|
1135
|
-
class="cross-icon ${e=>(0,
|
|
1135
|
+
class="cross-icon ${e=>(0,vi.x)(["visible",!!e.value],["disabled-icon",e.disabled])}"
|
|
1136
1136
|
@click=${e=>!e.disabled&&(e.value=void 0)}
|
|
1137
1137
|
></${e}-icon>
|
|
1138
1138
|
<input
|
|
@@ -1147,13 +1147,13 @@
|
|
|
1147
1147
|
</div>
|
|
1148
1148
|
<div
|
|
1149
1149
|
${(0,n.ref)("optionsElement")}
|
|
1150
|
-
class="${e=>{var t,i,r,a;return(0,
|
|
1150
|
+
class="${e=>{var t,i,r,a;return(0,vi.x)(gi,["visible",e.open],["dropdown-above",null!==(i=null===(t=e.dropdownPlacement)||void 0===t?void 0:t.startsWith("top"))&&void 0!==i&&i],["dropdown-left",null!==(a=null===(r=e.dropdownPlacement)||void 0===r?void 0:r.endsWith("left"))&&void 0!==a&&a])}}"
|
|
1151
1151
|
>
|
|
1152
1152
|
<${e}-text-field
|
|
1153
1153
|
id="filter-search"
|
|
1154
1154
|
part="filter-search"
|
|
1155
1155
|
placeholder="Search..."
|
|
1156
|
-
:value=${(0,
|
|
1156
|
+
:value=${(0,pi.O)(e=>e.filterSearch,"string","input")}
|
|
1157
1157
|
?hidden=${e=>!e.hasSearchKey}
|
|
1158
1158
|
@change=${(e,t)=>e.changeHandler(t.event)}
|
|
1159
1159
|
></${e}-text-field>
|
|
@@ -1165,5 +1165,5 @@
|
|
|
1165
1165
|
</div>
|
|
1166
1166
|
</div>
|
|
1167
1167
|
</div>
|
|
1168
|
-
`,pi=ui(),mi={menuTabs:["filterMenuTab","generalMenuTab","columnsMenuTab"]},vi=(e,t)=>!e.composedPath().includes(t);function fi(e,t,i,a){return(0,r.sH)(this,void 0,void 0,function*(){var r;try{const s=function(e,t){const i=(new ii.K).withField(e).withValue(null!=t?t:"").withSerialiser(ri.n.EQ).withGroup("default").build();return i.serialiser(i)}(i,a),o=yield e.request(t,{DETAILS:{CRITERIA_MATCH:s}});return 1===(null===(r=o.REPLY)||void 0===r?void 0:r.length)?o.REPLY[0]:void 0}catch(e){return void console.error(`Failed to retrieve object from the ${t} resource: ${e instanceof Error?e.message:String(e)}`)}})}class bi extends((0,xe.S)(ae.FoundationElement)){constructor(){super(...arguments),this.requestSupportsAdvancedSearch=!1,this.defaultSlottedNodes=[],this.getAndSetRowsDebounce=Ge()(()=>this.getAndSetRows(),300),this.handleClickOutside=e=>{vi(e,this)&&(this.open=!1)}}get connect(){var e;return null!==(e=this.connectOverride)&&void 0!==e?e:this._connectDI}set connect(e){this.connectOverride=e}get value(){return n.Observable.track(this,"value"),this._value}set value(e){e!==this._value&&(e?fi(this.connect,this.resourceName,this.valueKey,e).then(t=>{this.value===e&&(this.selectedRow=t)}):this.selectedRow=void 0,this.emitValue(e))}get displayValue(){return this.selectedRow&&this.labelKey&&this.selectedRow[this.labelKey]||this.value||""}get hasSearchKey(){return!!this.searchKey&&this.searchKey.length>0}get hasSlottedContent(){return!(!this.defaultSlottedNodes||0===this.defaultSlottedNodes.length)&&this.defaultSlottedNodes.some(e=>{var t;return e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&(null===(t=e.textContent)||void 0===t?void 0:t.trim().length)>0})}connectedCallback(){var e;super.connectedCallback(),(null===(e=this.optionsElement)||void 0===e?void 0:e.style)&&this.dropdownWidthChanged(),this.open=!1,this.filterSearch="",this.grid&&(this.grid.gridOptions={defaultColDef:mi,onRowClicked:e=>{this.selectedRow=e.data,this.emitValue(e.data[this.valueKey]),this.toggle()}})}setGridRowData(e){var t;const i=null===(t=this.grid)||void 0===t?void 0:t.gridApi;i&&("function"==typeof i.updateGridOptions?i.updateGridOptions({rowData:e}):i.setRowData(e))}setGridColumnDefs(e){var t;const i=null===(t=this.grid)||void 0===t?void 0:t.gridApi;i&&("function"==typeof i.updateGridOptions?i.updateGridOptions({columnDefs:e}):i.setColumnDefs(e))}emitValue(e){this._value=e,this.$emit("change",e),this.$emit("input",e),n.Observable.notify(this,"value")}toggle(){this.open=!this.open}getAndSetRows(){return(0,r.sH)(this,void 0,void 0,function*(){var e,t;if(!(null===(e=this.grid)||void 0===e?void 0:e.gridApi))return;const i=this.lastRequest={},r=this.request?{REQUEST:Object.assign({},this.request)}:{},a=Array.isArray(this.searchKey)&&1===this.searchKey.length?this.searchKey[0]:this.searchKey;let s;if(a&&this.filterSearch)if(this.requestSupportsAdvancedSearch){const e=(Array.isArray(a)?a:[a]).map(e=>{var t;return(new ii.K).withField(e).withValue(null!==(t=this.filterSearch)&&void 0!==t?t:"").withSerialiser(ri.n.containsIgnoreCase).withGroup("default").build()}),t=new ai.b;t.Or(e,{join:si.r.Or()}),s=t.build()}else{if(Array.isArray(a))throw Error("MulticolumnDropdown: Unable to search multiple keys via request; if the request is a GPAL ReqRep, set requestSupportsAdvancedSearch to true");r.REQUEST=Object.assign(Object.assign({},r.REQUEST),{[a]:`*${this.filterSearch}*`})}const o=null===(t=this.baseCriteria)||void 0===t?void 0:t.trim();o&&s?s=`(${s}) && (${o})`:o&&(s=o),s&&(r.DETAILS={CRITERIA_MATCH:s});try{const e=yield this.connect.request(this.resourceName,r);if(i!==this.lastRequest)return;const t=(null==e?void 0:e.REPLY)||[];this.setGridRowData(t),t.length>0?this.grid.gridApi.hideOverlay():this.grid.gridApi.showNoRowsOverlay()}catch(e){console.error(`Failed to retrieve rows from the ${this.resourceName} resource: ${e instanceof Error?e.message:String(e)}`)}})}filterSearchChanged(){var e,t;this.open&&(null===(t=null===(e=this.grid)||void 0===e?void 0:e.gridApi)||void 0===t||t.showLoadingOverlay(),this.getAndSetRowsDebounce())}requestChanged(){var e,t;this.open&&(null===(t=null===(e=this.grid)||void 0===e?void 0:e.gridApi)||void 0===t||t.showLoadingOverlay(),this.getAndSetRows())}columnDefinitionsChanged(){this.setGridColumnDefs(this.columnDefinitions)}openChanged(){var e,t;this.open?(document.addEventListener("mousedown",this.handleClickOutside),(null===(e=this.grid)||void 0===e?void 0:e.gridApi)&&(this.grid.gridApi.showLoadingOverlay(),this.getAndSetRows())):(document.removeEventListener("mousedown",this.handleClickOutside),this.filterSearch="",(null===(t=this.grid)||void 0===t?void 0:t.gridApi)&&this.setGridRowData([]))}dropdownWidthChanged(){var e,t;null===(t=null===(e=this.optionsElement)||void 0===e?void 0:e.style)||void 0===t||t.setProperty(ni,this.dropdownWidth>0?`${this.dropdownWidth}px`:"inherit")}disconnectedCallback(){document.removeEventListener("mousedown",this.handleClickOutside),super.disconnectedCallback();const e=this.shouldRunDisconnect;n.DOM.queueUpdate(()=>{var t;e&&((null===(t=this.grid)||void 0===t?void 0:t.gridApi)&&this.setGridRowData([]),this.selectedRow=void 0,this._value=void 0)})}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}}(0,r.Cg)([yt.dm],bi.prototype,"_connectDI",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean"})],bi.prototype,"disabled",void 0),(0,r.Cg)([(0,n.attr)({attribute:"resource-name"})],bi.prototype,"resourceName",void 0),(0,r.Cg)([(0,n.attr)({attribute:"search-key",converter:oi})],bi.prototype,"searchKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"advanced-search-req",mode:"boolean"})],bi.prototype,"requestSupportsAdvancedSearch",void 0),(0,r.Cg)([(0,n.attr)({attribute:"value-key"})],bi.prototype,"valueKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"label-key"})],bi.prototype,"labelKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"dropdown-placement"})],bi.prototype,"dropdownPlacement",void 0),(0,r.Cg)([n.attr],bi.prototype,"dropdownWidth",void 0),(0,r.Cg)([n.observable],bi.prototype,"request",void 0),(0,r.Cg)([n.observable],bi.prototype,"columnDefinitions",void 0),(0,r.Cg)([n.observable],bi.prototype,"baseCriteria",void 0),(0,r.Cg)([n.observable],bi.prototype,"defaultSlottedNodes",void 0),(0,r.Cg)([n.observable],bi.prototype,"filterSearch",void 0),(0,r.Cg)([n.observable],bi.prototype,"open",void 0),(0,r.Cg)([n.observable],bi.prototype,"selectedRow",void 0),(0,r.Cg)([n.volatile],bi.prototype,"displayValue",null),(0,r.Cg)([n.volatile],bi.prototype,"hasSearchKey",null),(0,r.Cg)([n.volatile],bi.prototype,"hasSlottedContent",null);const Ci=bi.compose({baseName:"multicolumn-dropdown",template:pi,styles:ci}),yi=bi.compose({baseName:"multicolumn-dropdown",template:ui("rapid"),styles:ci});var Si=i(3299),wi=i(70349),Ri=i(91327),Ei=i(30335),Ai=i(22133);class ki{constructor(e,t){this.criteria=e,this.onActiveChanged=t,this.matchedRowIds=new Set,this.lastReportedActive=!1}get active(){return this.matchedRowIds.size>0}get matchCount(){return this.matchedRowIds.size}reset(){this.matchedRowIds.clear(),this.report()}handleDataChanged(e){var t;const{add:i=[],update:r=[],remove:a=[]}=null!==(t=null==e?void 0:e.changes)&&void 0!==t?t:{};for(const e of a)this.syncRow(e,!0);for(const e of i)this.syncRow(e,!1);for(const e of r)this.syncRow(e,!1);this.report()}handleDataCleared(){this.reset()}observe(e){const t=e=>{this.handleDataChanged(e.detail)},i=()=>{this.handleDataCleared()};return e.addEventListener(Et.c.dataChanged,t),e.addEventListener(Et.c.dataCleared,i),()=>{e.removeEventListener(Et.c.dataChanged,t),e.removeEventListener(Et.c.dataCleared,i)}}syncRow(e,t){var i;if(!e)return;const r=String(null!==(i=e[this.criteria.rowIdField])&&void 0!==i?i:"");r&&(!t&&(0,Ai.D)(this.criteria,e)?this.matchedRowIds.add(r):this.matchedRowIds.delete(r))}report(){const e=this.active;e!==this.lastReportedActive&&(this.lastReportedActive=e,this.onActiveChanged(e))}}var Di=i(49260),Oi=i(49568);const Ii={foundationIconRenderer:G.qN,foundationGridProActionRenderer:R._X,foundationGridProActionsMenuRenderer:k.su,foundationAgBooleanRenderer:I.fg,foundationAgTextRenderer:Wt.G4,foundationAgTextFieldRenderer:wi.wG,foundationAgEditableRenderer:L.r8,foundationAgSelectRenderer:_.bE,foundationSelectEditor:l.RU,foundationNumberEditor:g.CY,foundationDateEditor:f.vr,foundationMultiselectEditor:p.UH,foundationStringEditor:y.cb,foundationMulticolumnDropdown:Ci,foundationStatusPillRenderer:H.a1,StatusPillRenderer:H.N7,foundationGridPro:a.RB,register(e,...t){if(e)for(const i in this)"register"!==i&&this[i]().register(e,...t)}},xi=[{id:"error",label:"Error",value:"var(--error-fill-rest, #c62828)"},{id:"warning",label:"Warning",value:"var(--warning-fill-rest, #ef6c00)"},{id:"success",label:"Success",value:"var(--success-fill-rest, #2e7d32)"},{id:"accent",label:"Accent",value:"var(--accent-fill-rest, #1565c0)"},{id:"neutral",label:"Neutral",value:"var(--neutral-fill-rest, #546e7a)"}],Ti=[{id:"slow",label:"Slow",value:1400},{id:"normal",label:"Normal",value:1e3},{id:"fast",label:"Fast",value:500}],Li=[{id:"row",label:"Whole row",value:"row"},{id:"cell",label:"Alert field cell",value:"cell"}],Pi={color:xi[0].value,durationMs:Ti[1].value,scope:"row"};function Fi(e){return{color:"string"==typeof(null==e?void 0:e.color)&&e.color.trim().length>0?e.color:Pi.color,durationMs:"number"==typeof(null==e?void 0:e.durationMs)&&Number.isFinite(e.durationMs)&&e.durationMs>0?e.durationMs:Pi.durationMs,scope:"row"===(null==e?void 0:e.scope)||"cell"===(null==e?void 0:e.scope)?e.scope:Pi.scope}}const Gi=new Map;function $i(e){const{persistPreferencesKey:t,target:i,mirrorColorTo:r=[]}=e,a=t?function(e){if(e.statePersistence)return e.statePersistence;try{return ae.DI.getOrCreateDOMContainer().get(Gt.l)}catch(e){return void Ne.v.debug("Row alert preferences will not persist; no StatePersistence available",e)}}(e):void 0,s=new Set;let o=Fi(Object.assign(Object.assign({},Pi),e.preferences));function n(){const e=null!=i?i:"undefined"==typeof document?void 0:document.documentElement;if(e){e.style.setProperty("--row-alert-color",o.color),e.style.setProperty("--alert-flash-duration",`${o.durationMs}ms`);for(const t of r)e.style.setProperty(t,o.color)}}function l(e,i){o=e,n();for(const e of s)e(o);i&&t&&(null==a?void 0:a.saveRowAlertPreferences)&&a.saveRowAlertPreferences(t,o).catch(e=>{Ne.v.warn("Could not save row alert preferences",e)})}return n(),t&&(null==a?void 0:a.getRowAlertPreferences)&&a.getRowAlertPreferences(t).then(e=>{l(Fi(Object.assign(Object.assign({},o),e)),!1)}).catch(e=>{Ne.v.warn("Could not load row alert preferences",e)}),{get preferences(){return o},change(e){l(Fi(Object.assign(Object.assign({},o),e)),!0)},subscribe:e=>(s.add(e),()=>{s.delete(e)})}}function Mi(e,t={}){var i,r,a,s,o;const{colorPresets:n=xi,ratePresets:l=Ti,menuLabel:d="Alert flash"}=t,c=function(e){const{persistPreferencesKey:t}=e;if(!t)return $i(e);let i=Gi.get(t);return i||(i=$i(e),Gi.set(t,i)),i}(t),g=(0,Di.PO)(e)[Di.Xm],h=(0,Di.Li)(Object.assign(Object.assign({},e),{flashField:null!==(r=null!==(i=e.flashField)&&void 0!==i?i:e.stateField)&&void 0!==r?r:null===(o=null===(s=null===(a=e.anyOf)||void 0===a?void 0:a[0])||void 0===s?void 0:s[0])||void 0===o?void 0:o.field}))[Di.mJ];function u(e,t,i,r){return e.map(e=>({name:e.label,checked:e.value===t,action:()=>{c.change(i(e.value)),r()}}))}const p={rowClassRules:{[Di.Xm]:e=>"row"===c.preferences.scope&&g(e)},defaultColDef:{cellClassRules:{[Di.mJ]:e=>"cell"===c.preferences.scope&&h(e)}},get preferences(){return c.preferences},createMenuItem(e){const t=()=>{var t;return null===(t=null==e?void 0:e.redrawRows)||void 0===t?void 0:t.call(e)};return{name:d,subMenu:[{name:"Flash target",subMenu:u(Li,c.preferences.scope,e=>({scope:e}),t)},{name:"Color",subMenu:u(n,c.preferences.color,e=>({color:e}),()=>{})},{name:"Flash rate",subMenu:u(l,c.preferences.durationMs,e=>({durationMs:e}),()=>{})},{name:"Reset to defaults",action:()=>{p.reset(),t()}}]}},getContextMenuItems(e){var t;return[...null!==(t=e.defaultItems)&&void 0!==t?t:[],"separator",p.createMenuItem(e.api)]},setPreferences(e){c.change(e)},reset(){c.change(Pi)},subscribe:e=>c.subscribe(e)};return p}var _i=i(92277);const Ni=/^(?:[A-Za-z0-9+/]{4})*?(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Bi=e=>{const t=e.split(":");let i,r;2===t.length?[i,r]=t:r=e;const a=(e=>{if(Ni.test(e)){const t=atob(e),i=new Uint8Array(t.length);return[...t].forEach((e,r)=>{i[r]=t.charCodeAt(r)}),i.buffer}return e})(r);if("str"===i){return new TextDecoder("utf-8").decode(a)}return a},Hi=e=>{const t=(e=>{if("string"==typeof e)return btoa(e);if(e instanceof ArrayBuffer){const t=new Uint8Array(e).reduce((e,t)=>e+String.fromCharCode(t),"");return btoa(t)}return""})(e);return"string"==typeof e?`str:${t}`:e instanceof ArrayBuffer?`bin:${t}`:""},Vi={account:"genesis",namespace:"default",authKey:"kv-default",authEmail:void 0},zi=ae.DI.createInterface();var Ui,Ki;!function(e){e.REQ_KEY_VALUE_LIST="REQ_KEY_VALUE_LIST",e.REQ_KEY_VALUE_READ="REQ_KEY_VALUE_READ"}(Ui||(Ui={})),function(e){e.EVENT_KEY_VALUE_PUT="EVENT_KEY_VALUE_PUT",e.EVENT_KEY_VALUE_DELETE="EVENT_KEY_VALUE_DELETE"}(Ki||(Ki={}));let Xi=class{constructor(e,t,i=Vi){this.connect=e,this.user=t,this.kvStorageConfig=i}delete(e){return(0,r.sH)(this,void 0,void 0,function*(){const t={DETAILS:{KEYS:e}},i=yield this.connect.commitEvent(Ki.EVENT_KEY_VALUE_DELETE,t);return!(!i||"EVENT_ACK"!==i.MESSAGE_TYPE)||{ERROR:i.ERROR,WARNING:i.WARNING}})}get(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;const i={REQUEST:{USER_NAME:null!==(t=this.kvStorageConfig.authEmail)&&void 0!==t?t:this.user.userName,KEY:e}},r=yield this.connect.request(Ui.REQ_KEY_VALUE_READ,i);if(r&&r.REPLY&&r.REPLY.length>0){const t=r.REPLY.map(e=>{const t=this.getDecodedValue(e.VALUE);return{kv:{key:e.KEY,value:t}}});return e?t[0]:t}return e?void 0:[]})}getDecodedValue(e){e.startsWith("str:")||e.startsWith("bin:")||(e=`str:${e}`);let t=Bi(e);return"string"==typeof t&&t.startsWith("str:")&&(t=Bi(t)),"string"==typeof t&&t.startsWith("bin:")&&(t=Bi(t)),t}list(){return(0,r.sH)(this,void 0,void 0,function*(){var e;const t={REQUEST:{USER_NAME:null!==(e=this.kvStorageConfig.authEmail)&&void 0!==e?e:this.user.userName}},i=yield this.connect.request(Ui.REQ_KEY_VALUE_LIST,t);if(i&&i.REPLY&&i.REPLY.length>0){return i.REPLY.map(e=>e.KEY)}return[]})}put(e){return(0,r.sH)(this,void 0,void 0,function*(){const t={DETAILS:{RECORDS:e.map(e=>({KEY:e.key,VALUE:e.base64?Hi(e.value):e.value}))}},i=yield this.connect.commitEvent(Ki.EVENT_KEY_VALUE_PUT,t);return!(!i||"EVENT_ACK"!==i.MESSAGE_TYPE)||{ERROR:i.ERROR,WARNING:i.WARNING}})}};Xi=(0,r.Cg)([(0,r.Qj)(0,yt.dm),(0,r.Qj)(1,_i.KJ),(0,r.Qj)(2,(0,ae.optional)(zi))],Xi);const qi=ae.DI.createInterface(e=>e.singleton(Xi));var ji=i(98316);class Yi{getColumnState(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;yield this.migrateLocalStorageToKVStorage(e);const i=yield this.kvStorage.get(e),r=i?null===(t=i.kv)||void 0===t?void 0:t.value:void 0;return r?JSON.parse(r):[]})}saveColumnState(e,t){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(t)}])})}deleteColumnState(e){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.delete([e])})}migrateLocalStorageToKVStorage(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;const i=yield this.kvStorage.get(e);if(i&&(null===(t=i.kv)||void 0===t?void 0:t.value))return;const r=this.session.getLocalStorageItem("gridOptions"),a=r?JSON.parse(r)[e]:void 0;a&&(Ne.v.debug(`Columns state migration for key: ${e} from LocalStorage to KV Storage`),this.kvStorage.put([{key:e,value:a}]))})}getFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;const i=yield this.kvStorage.get(e),r=i?null===(t=i.kv)||void 0===t?void 0:t.value:void 0;return r?JSON.parse(r):{}})}saveFilterModel(e,t){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(t)}])})}getRowAlertPreferences(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;const i=yield this.kvStorage.get(e),r=i?null===(t=i.kv)||void 0===t?void 0:t.value:void 0;return r?JSON.parse(r):{}})}saveRowAlertPreferences(e,t){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(t)}])})}}(0,r.Cg)([qi],Yi.prototype,"kvStorage",void 0),(0,r.Cg)([ji.N],Yi.prototype,"session",void 0);var Wi=i(11749);const Qi=o.SwatchRGB.from((0,se.parseColorHexRGB)("#4c4c4c")),Ji=o.SwatchRGB.from((0,se.parseColorHexRGB)("#c01754")),{create:Zi}=ae.DesignToken,er={foregroundColor:Zi("fui-ag-foreground-color").withDefault(Ji),backgroundColor:Zi("fui-ag-background-color").withDefault(Qi)};var tr=i(68858),ir=i(49874);const rr={processCellCallback:e=>["+","=","-","@","\t","\n"].some(t=>String(e.value).startsWith(t))?`'${e.value}`:e.value}}}]);
|
|
1169
|
-
//# sourceMappingURL=625.
|
|
1168
|
+
`,fi=mi(),bi={menuTabs:["filterMenuTab","generalMenuTab","columnsMenuTab"]},Ci=(e,t)=>!e.composedPath().includes(t);function yi(e,t,i,a){return(0,r.sH)(this,void 0,void 0,function*(){var r;try{const s=function(e,t){const i=(new si.K).withField(e).withValue(null!=t?t:"").withSerialiser(oi.n.EQ).withGroup("default").build();return i.serialiser(i)}(i,a),o=yield e.request(t,{DETAILS:{CRITERIA_MATCH:s}});return 1===(null===(r=o.REPLY)||void 0===r?void 0:r.length)?o.REPLY[0]:void 0}catch(e){return void console.error(`Failed to retrieve object from the ${t} resource: ${e instanceof Error?e.message:String(e)}`)}})}class Si extends((0,xe.S)(ae.FoundationElement)){constructor(){super(...arguments),this.requestSupportsAdvancedSearch=!1,this.defaultSlottedNodes=[],this.getAndSetRowsDebounce=Ge()(()=>this.getAndSetRows(),300),this.handleClickOutside=e=>{Ci(e,this)&&(this.open=!1)}}get connect(){var e;return null!==(e=this.connectOverride)&&void 0!==e?e:this._connectDI}set connect(e){this.connectOverride=e}get value(){return n.Observable.track(this,"value"),this._value}set value(e){e!==this._value&&(e?yi(this.connect,this.resourceName,this.valueKey,e).then(t=>{this.value===e&&(this.selectedRow=t)}):this.selectedRow=void 0,this.emitValue(e))}get displayValue(){return this.selectedRow&&this.labelKey&&this.selectedRow[this.labelKey]||this.value||""}get hasSearchKey(){return!!this.searchKey&&this.searchKey.length>0}get hasSlottedContent(){return!(!this.defaultSlottedNodes||0===this.defaultSlottedNodes.length)&&this.defaultSlottedNodes.some(e=>{var t;return e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&(null===(t=e.textContent)||void 0===t?void 0:t.trim().length)>0})}connectedCallback(){var e;super.connectedCallback(),(null===(e=this.optionsElement)||void 0===e?void 0:e.style)&&this.dropdownWidthChanged(),this.open=!1,this.filterSearch="",this.grid&&(this.grid.gridOptions={defaultColDef:bi,onRowClicked:e=>{this.selectedRow=e.data,this.emitValue(e.data[this.valueKey]),this.toggle()}})}setGridRowData(e){var t;const i=null===(t=this.grid)||void 0===t?void 0:t.gridApi;i&&("function"==typeof i.updateGridOptions?i.updateGridOptions({rowData:e}):i.setRowData(e))}setGridColumnDefs(e){var t;const i=null===(t=this.grid)||void 0===t?void 0:t.gridApi;i&&("function"==typeof i.updateGridOptions?i.updateGridOptions({columnDefs:e}):i.setColumnDefs(e))}emitValue(e){this._value=e,this.$emit("change",e),this.$emit("input",e),n.Observable.notify(this,"value")}toggle(){this.open=!this.open}getAndSetRows(){return(0,r.sH)(this,void 0,void 0,function*(){var e,t;if(!(null===(e=this.grid)||void 0===e?void 0:e.gridApi))return;const i=this.lastRequest={},r=this.request?{REQUEST:Object.assign({},this.request)}:{},a=Array.isArray(this.searchKey)&&1===this.searchKey.length?this.searchKey[0]:this.searchKey;let s;if(a&&this.filterSearch)if(this.requestSupportsAdvancedSearch){const e=(Array.isArray(a)?a:[a]).map(e=>{var t;return(new si.K).withField(e).withValue(null!==(t=this.filterSearch)&&void 0!==t?t:"").withSerialiser(oi.n.containsIgnoreCase).withGroup("default").build()}),t=new ni.b;t.Or(e,{join:li.r.Or()}),s=t.build()}else{if(Array.isArray(a))throw Error("MulticolumnDropdown: Unable to search multiple keys via request; if the request is a GPAL ReqRep, set requestSupportsAdvancedSearch to true");r.REQUEST=Object.assign(Object.assign({},r.REQUEST),{[a]:`*${this.filterSearch}*`})}const o=null===(t=this.baseCriteria)||void 0===t?void 0:t.trim();o&&s?s=`(${s}) && (${o})`:o&&(s=o),s&&(r.DETAILS={CRITERIA_MATCH:s});try{const e=yield this.connect.request(this.resourceName,r);if(i!==this.lastRequest)return;const t=(null==e?void 0:e.REPLY)||[];this.setGridRowData(t),t.length>0?this.grid.gridApi.hideOverlay():this.grid.gridApi.showNoRowsOverlay()}catch(e){console.error(`Failed to retrieve rows from the ${this.resourceName} resource: ${e instanceof Error?e.message:String(e)}`)}})}filterSearchChanged(){var e,t;this.open&&(null===(t=null===(e=this.grid)||void 0===e?void 0:e.gridApi)||void 0===t||t.showLoadingOverlay(),this.getAndSetRowsDebounce())}requestChanged(){var e,t;this.open&&(null===(t=null===(e=this.grid)||void 0===e?void 0:e.gridApi)||void 0===t||t.showLoadingOverlay(),this.getAndSetRows())}columnDefinitionsChanged(){this.setGridColumnDefs(this.columnDefinitions)}openChanged(){var e,t;this.open?(document.addEventListener("mousedown",this.handleClickOutside),(null===(e=this.grid)||void 0===e?void 0:e.gridApi)&&(this.grid.gridApi.showLoadingOverlay(),this.getAndSetRows())):(document.removeEventListener("mousedown",this.handleClickOutside),this.filterSearch="",(null===(t=this.grid)||void 0===t?void 0:t.gridApi)&&this.setGridRowData([]))}dropdownWidthChanged(){var e,t;null===(t=null===(e=this.optionsElement)||void 0===e?void 0:e.style)||void 0===t||t.setProperty(ci,this.dropdownWidth>0?`${this.dropdownWidth}px`:"inherit")}disconnectedCallback(){document.removeEventListener("mousedown",this.handleClickOutside),super.disconnectedCallback();const e=this.shouldRunDisconnect;n.DOM.queueUpdate(()=>{var t;e&&((null===(t=this.grid)||void 0===t?void 0:t.gridApi)&&this.setGridRowData([]),this.selectedRow=void 0,this._value=void 0)})}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}}(0,r.Cg)([yt.dm],Si.prototype,"_connectDI",void 0),(0,r.Cg)([(0,n.attr)({mode:"boolean"})],Si.prototype,"disabled",void 0),(0,r.Cg)([(0,n.attr)({attribute:"resource-name"})],Si.prototype,"resourceName",void 0),(0,r.Cg)([(0,n.attr)({attribute:"search-key",converter:di})],Si.prototype,"searchKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"advanced-search-req",mode:"boolean"})],Si.prototype,"requestSupportsAdvancedSearch",void 0),(0,r.Cg)([(0,n.attr)({attribute:"value-key"})],Si.prototype,"valueKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"label-key"})],Si.prototype,"labelKey",void 0),(0,r.Cg)([(0,n.attr)({attribute:"dropdown-placement"})],Si.prototype,"dropdownPlacement",void 0),(0,r.Cg)([n.attr],Si.prototype,"dropdownWidth",void 0),(0,r.Cg)([n.observable],Si.prototype,"request",void 0),(0,r.Cg)([n.observable],Si.prototype,"columnDefinitions",void 0),(0,r.Cg)([n.observable],Si.prototype,"baseCriteria",void 0),(0,r.Cg)([n.observable],Si.prototype,"defaultSlottedNodes",void 0),(0,r.Cg)([n.observable],Si.prototype,"filterSearch",void 0),(0,r.Cg)([n.observable],Si.prototype,"open",void 0),(0,r.Cg)([n.observable],Si.prototype,"selectedRow",void 0),(0,r.Cg)([n.volatile],Si.prototype,"displayValue",null),(0,r.Cg)([n.volatile],Si.prototype,"hasSearchKey",null),(0,r.Cg)([n.volatile],Si.prototype,"hasSlottedContent",null);const wi=Si.compose({baseName:"multicolumn-dropdown",template:fi,styles:ui}),Ri=Si.compose({baseName:"multicolumn-dropdown",template:mi("rapid"),styles:ui});var Ei=i(3299),Ai=i(70349),ki=i(91327),Di=i(30335),Oi=i(22133);class Ii{constructor(e,t){this.criteria=e,this.onActiveChanged=t,this.matchedRowIds=new Set,this.lastReportedActive=!1}get active(){return this.matchedRowIds.size>0}get matchCount(){return this.matchedRowIds.size}reset(){this.matchedRowIds.clear(),this.report()}handleDataChanged(e){var t;const{add:i=[],update:r=[],remove:a=[]}=null!==(t=null==e?void 0:e.changes)&&void 0!==t?t:{};for(const e of a)this.syncRow(e,!0);for(const e of i)this.syncRow(e,!1);for(const e of r)this.syncRow(e,!1);this.report()}handleDataCleared(){this.reset()}observe(e){const t=e=>{this.handleDataChanged(e.detail)},i=()=>{this.handleDataCleared()};return e.addEventListener(kt.c.dataChanged,t),e.addEventListener(kt.c.dataCleared,i),()=>{e.removeEventListener(kt.c.dataChanged,t),e.removeEventListener(kt.c.dataCleared,i)}}syncRow(e,t){var i;if(!e)return;const r=String(null!==(i=e[this.criteria.rowIdField])&&void 0!==i?i:"");r&&(!t&&(0,Oi.D)(this.criteria,e)?this.matchedRowIds.add(r):this.matchedRowIds.delete(r))}report(){const e=this.active;e!==this.lastReportedActive&&(this.lastReportedActive=e,this.onActiveChanged(e))}}var xi=i(49260),Ti=i(49568);const Li={foundationIconRenderer:G.qN,foundationGridProActionRenderer:R._X,foundationGridProActionsMenuRenderer:k.su,foundationAgBooleanRenderer:I.fg,foundationAgTextRenderer:Zt.G4,foundationAgTextFieldRenderer:Ai.wG,foundationAgEditableRenderer:L.r8,foundationAgSelectRenderer:_.bE,foundationSelectEditor:l.RU,foundationNumberEditor:g.CY,foundationDateEditor:f.vr,foundationMultiselectEditor:p.UH,foundationStringEditor:y.cb,foundationMulticolumnDropdown:wi,foundationStatusPillRenderer:H.a1,StatusPillRenderer:H.N7,foundationGridPro:a.RB,register(e,...t){if(e)for(const i in this)"register"!==i&&this[i]().register(e,...t)}},Fi=[{id:"error",label:"Error",value:"var(--error-fill-rest, #c62828)"},{id:"warning",label:"Warning",value:"var(--warning-fill-rest, #ef6c00)"},{id:"success",label:"Success",value:"var(--success-fill-rest, #2e7d32)"},{id:"accent",label:"Accent",value:"var(--accent-fill-rest, #1565c0)"},{id:"neutral",label:"Neutral",value:"var(--neutral-fill-rest, #546e7a)"}],Pi=[{id:"slow",label:"Slow",value:1400},{id:"normal",label:"Normal",value:1e3},{id:"fast",label:"Fast",value:500}],Gi=[{id:"row",label:"Whole row",value:"row"},{id:"cell",label:"Alert field cell",value:"cell"}],Mi={color:Fi[0].value,durationMs:Pi[1].value,scope:"row"};function $i(e){return{color:"string"==typeof(null==e?void 0:e.color)&&e.color.trim().length>0?e.color:Mi.color,durationMs:"number"==typeof(null==e?void 0:e.durationMs)&&Number.isFinite(e.durationMs)&&e.durationMs>0?e.durationMs:Mi.durationMs,scope:"row"===(null==e?void 0:e.scope)||"cell"===(null==e?void 0:e.scope)?e.scope:Mi.scope}}const _i=new Map;function Ni(e){const{persistPreferencesKey:t,target:i,mirrorColorTo:r=[]}=e,a=t?function(e){if(e.statePersistence)return e.statePersistence;try{return ae.DI.getOrCreateDOMContainer().get(_t.l)}catch(e){return void Ne.v.debug("Row alert preferences will not persist; no StatePersistence available",e)}}(e):void 0,s=new Set;let o=$i(Object.assign(Object.assign({},Mi),e.preferences));function n(){const e=null!=i?i:"undefined"==typeof document?void 0:document.documentElement;if(e){e.style.setProperty("--row-alert-color",o.color),e.style.setProperty("--alert-flash-duration",`${o.durationMs}ms`);for(const t of r)e.style.setProperty(t,o.color)}}function l(e,i){o=e,n();for(const e of s)e(o);i&&t&&(null==a?void 0:a.saveRowAlertPreferences)&&a.saveRowAlertPreferences(t,o).catch(e=>{Ne.v.warn("Could not save row alert preferences",e)})}return n(),t&&(null==a?void 0:a.getRowAlertPreferences)&&a.getRowAlertPreferences(t).then(e=>{l($i(Object.assign(Object.assign({},o),e)),!1)}).catch(e=>{Ne.v.warn("Could not load row alert preferences",e)}),{get preferences(){return o},change(e){l($i(Object.assign(Object.assign({},o),e)),!0)},subscribe:e=>(s.add(e),()=>{s.delete(e)})}}function Bi(e,t={}){var i,r,a,s,o;const{colorPresets:n=Fi,ratePresets:l=Pi,menuLabel:d="Alert flash"}=t,c=function(e){const{persistPreferencesKey:t}=e;if(!t)return Ni(e);let i=_i.get(t);return i||(i=Ni(e),_i.set(t,i)),i}(t),g=(0,xi.PO)(e)[xi.Xm],h=(0,xi.Li)(Object.assign(Object.assign({},e),{flashField:null!==(r=null!==(i=e.flashField)&&void 0!==i?i:e.stateField)&&void 0!==r?r:null===(o=null===(s=null===(a=e.anyOf)||void 0===a?void 0:a[0])||void 0===s?void 0:s[0])||void 0===o?void 0:o.field}))[xi.mJ];function u(e,t,i,r){return e.map(e=>({name:e.label,checked:e.value===t,action:()=>{c.change(i(e.value)),r()}}))}const p={rowClassRules:{[xi.Xm]:e=>"row"===c.preferences.scope&&g(e)},defaultColDef:{cellClassRules:{[xi.mJ]:e=>"cell"===c.preferences.scope&&h(e)}},get preferences(){return c.preferences},createMenuItem(e){const t=()=>{var t;return null===(t=null==e?void 0:e.redrawRows)||void 0===t?void 0:t.call(e)};return{name:d,subMenu:[{name:"Flash target",subMenu:u(Gi,c.preferences.scope,e=>({scope:e}),t)},{name:"Color",subMenu:u(n,c.preferences.color,e=>({color:e}),()=>{})},{name:"Flash rate",subMenu:u(l,c.preferences.durationMs,e=>({durationMs:e}),()=>{})},{name:"Reset to defaults",action:()=>{p.reset(),t()}}]}},getContextMenuItems(e){var t;return[...null!==(t=e.defaultItems)&&void 0!==t?t:[],"separator",p.createMenuItem(e.api)]},setPreferences(e){c.change(e)},reset(){c.change(Mi)},subscribe:e=>c.subscribe(e)};return p}var Hi=i(92277);const Vi=/^(?:[A-Za-z0-9+/]{4})*?(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,zi=e=>{const t=e.split(":");let i,r;2===t.length?[i,r]=t:r=e;const a=(e=>{if(Vi.test(e)){const t=atob(e),i=new Uint8Array(t.length);return[...t].forEach((e,r)=>{i[r]=t.charCodeAt(r)}),i.buffer}return e})(r);if("str"===i){return new TextDecoder("utf-8").decode(a)}return a},Ui=e=>{const t=(e=>{if("string"==typeof e)return btoa(e);if(e instanceof ArrayBuffer){const t=new Uint8Array(e).reduce((e,t)=>e+String.fromCharCode(t),"");return btoa(t)}return""})(e);return"string"==typeof e?`str:${t}`:e instanceof ArrayBuffer?`bin:${t}`:""},Ki={account:"genesis",namespace:"default",authKey:"kv-default",authEmail:void 0},qi=ae.DI.createInterface();var Xi,ji;!function(e){e.REQ_KEY_VALUE_LIST="REQ_KEY_VALUE_LIST",e.REQ_KEY_VALUE_READ="REQ_KEY_VALUE_READ"}(Xi||(Xi={})),function(e){e.EVENT_KEY_VALUE_PUT="EVENT_KEY_VALUE_PUT",e.EVENT_KEY_VALUE_DELETE="EVENT_KEY_VALUE_DELETE"}(ji||(ji={}));let Yi=class{constructor(e,t,i=Ki){this.connect=e,this.user=t,this.kvStorageConfig=i}delete(e){return(0,r.sH)(this,void 0,void 0,function*(){const t={DETAILS:{KEYS:e}},i=yield this.connect.commitEvent(ji.EVENT_KEY_VALUE_DELETE,t);return!(!i||"EVENT_ACK"!==i.MESSAGE_TYPE)||{ERROR:i.ERROR,WARNING:i.WARNING}})}get(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;const i={REQUEST:{USER_NAME:null!==(t=this.kvStorageConfig.authEmail)&&void 0!==t?t:this.user.userName,KEY:e}},r=yield this.connect.request(Xi.REQ_KEY_VALUE_READ,i);if(r&&r.REPLY&&r.REPLY.length>0){const t=r.REPLY.map(e=>{const t=this.getDecodedValue(e.VALUE);return{kv:{key:e.KEY,value:t}}});return e?t[0]:t}return e?void 0:[]})}getDecodedValue(e){e.startsWith("str:")||e.startsWith("bin:")||(e=`str:${e}`);let t=zi(e);return"string"==typeof t&&t.startsWith("str:")&&(t=zi(t)),"string"==typeof t&&t.startsWith("bin:")&&(t=zi(t)),t}list(){return(0,r.sH)(this,void 0,void 0,function*(){var e;const t={REQUEST:{USER_NAME:null!==(e=this.kvStorageConfig.authEmail)&&void 0!==e?e:this.user.userName}},i=yield this.connect.request(Xi.REQ_KEY_VALUE_LIST,t);if(i&&i.REPLY&&i.REPLY.length>0){return i.REPLY.map(e=>e.KEY)}return[]})}put(e){return(0,r.sH)(this,void 0,void 0,function*(){const t={DETAILS:{RECORDS:e.map(e=>({KEY:e.key,VALUE:e.base64?Ui(e.value):e.value}))}},i=yield this.connect.commitEvent(ji.EVENT_KEY_VALUE_PUT,t);return!(!i||"EVENT_ACK"!==i.MESSAGE_TYPE)||{ERROR:i.ERROR,WARNING:i.WARNING}})}};Yi=(0,r.Cg)([(0,r.Qj)(0,yt.dm),(0,r.Qj)(1,Hi.KJ),(0,r.Qj)(2,(0,ae.optional)(qi))],Yi);const Wi=ae.DI.createInterface(e=>e.singleton(Yi));var Qi=i(98316);class Ji{getColumnState(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;yield this.migrateLocalStorageToKVStorage(e);const i=yield this.kvStorage.get(e),r=i?null===(t=i.kv)||void 0===t?void 0:t.value:void 0;return r?JSON.parse(r):[]})}saveColumnState(e,t){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(t)}])})}deleteColumnState(e){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.delete([e])})}migrateLocalStorageToKVStorage(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;const i=yield this.kvStorage.get(e);if(i&&(null===(t=i.kv)||void 0===t?void 0:t.value))return;const r=this.session.getLocalStorageItem("gridOptions"),a=r?JSON.parse(r)[e]:void 0;a&&(Ne.v.debug(`Columns state migration for key: ${e} from LocalStorage to KV Storage`),this.kvStorage.put([{key:e,value:a}]))})}getFilterModel(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;const i=yield this.kvStorage.get(e),r=i?null===(t=i.kv)||void 0===t?void 0:t.value:void 0;return r?JSON.parse(r):{}})}saveFilterModel(e,t){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(t)}])})}getRowAlertPreferences(e){return(0,r.sH)(this,void 0,void 0,function*(){var t;const i=yield this.kvStorage.get(e),r=i?null===(t=i.kv)||void 0===t?void 0:t.value:void 0;return r?JSON.parse(r):{}})}saveRowAlertPreferences(e,t){return(0,r.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(t)}])})}}(0,r.Cg)([Wi],Ji.prototype,"kvStorage",void 0),(0,r.Cg)([Qi.N],Ji.prototype,"session",void 0);var Zi=i(11749);const er=o.SwatchRGB.from((0,se.parseColorHexRGB)("#4c4c4c")),tr=o.SwatchRGB.from((0,se.parseColorHexRGB)("#c01754")),{create:ir}=ae.DesignToken,rr={foregroundColor:ir("fui-ag-foreground-color").withDefault(tr),backgroundColor:ir("fui-ag-background-color").withDefault(er)};var ar=i(68858),sr=i(49874);const or={processCellCallback:e=>["+","=","-","@","\t","\n"].some(t=>String(e.value).startsWith(t))?`'${e.value}`:e.value}}}]);
|
|
1169
|
+
//# sourceMappingURL=625.295a96ecbe30dd36ea5fc96aad3716f6.js.map
|