@genesislcap/design-system-configurator 14.498.0 → 14.499.0
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.32f21cbff6ee6a161b6b.js → 445.445.40cbb0ac6011dc295e5c.js} +6 -6
- package/dist/445.d1bf826fafd16312c58fc781bcab2fec.js.map +1 -0
- package/dist/{628.628.7ae0f6858aefbc985118.js → 628.628.bdc36d4335d5ac602657.js} +2 -2
- package/dist/628.bff2c98df2a002e2c46e2119ee551aa0.js.map +1 -0
- package/dist/{designSystemConfigurator.a987ab6b0870d75edee8a894468d35cb.js.map → designSystemConfigurator.ce17bf2e955e5c40918eaba9c7c44e40.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/{main.1cbfb2f48ed4f722d7723a641b49dcd5.js.map → main.55cfaf491cd6d512c53d18f7acf7c423.js.map} +1 -1
- package/dist/{main.f63204ea444ade08b511.js → main.8162266d635f3fab321a.js} +2 -2
- package/dist/remoteEntry.js +2 -2
- package/package.json +13 -13
- package/dist/445.1f207609b7e00aa07fb3720fdceb63ca.js.map +0 -1
- package/dist/628.212bff1030cb6d0baf9b9e4166552c84.js.map +0 -1
|
@@ -757,7 +757,7 @@
|
|
|
757
757
|
${W}
|
|
758
758
|
${Q}
|
|
759
759
|
${Z}
|
|
760
|
-
`;var te=a(82128);const ae=(0,te.U)("rapid");var ie=a(20166),re=a(38370),oe=a(83912);const se="#cccccc",ne="#879ba6",de="#1f2126",le="#2e3339",ge="#2b2e34",ce="#000000",he="#181d1f",pe="#FFFFFF",ue="#babfc7",me="#2196f3",ve={foregroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(se)),headerForegroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(ne)),backgroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(de)),borderSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(le)),rowHoverSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(ge))},be={foregroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(ce)),headerForegroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(he)),backgroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(pe)),borderSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(ue)),rowHoverSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(me))},{create:fe}=re.DesignToken,ye={backgroundColor:fe("rapid-ag-background-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.backgroundSwatch:ve.backgroundSwatch),borderColor:fe("rapid-ag-border-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.borderSwatch:ve.borderSwatch),foregroundColor:fe("rapid-ag-foreground-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.foregroundSwatch:ve.foregroundSwatch),headerForegroundColor:fe("rapid-ag-header-foreground-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.headerForegroundSwatch:ve.headerForegroundSwatch),rowHoverColor:fe("rapid-ag-row-hover-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.rowHoverSwatch:ve.rowHoverSwatch)},Ce=()=>{const e=(0,ie.designTokensMap)();if(!e.value)return null;const{style:t,space:a}=e.value.design_tokens;return(t.baseHeightMultiplier.$value+t.density.$value)*a.designUnit.$value-8},Se="ag-theme-genesis-rapid-dark",Ee="ag-theme-genesis-rapid-light";class we extends r.cF{constructor(){super(...arguments),this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.handleLuminanceChange=e=>{const t=s.baseLayerLuminance.getValueFor(e.target);this.theme=t===s.StandardLuminance.DarkMode?Se:Ee},this.theme="light"===localStorage.getItem("luminance")?Ee:Se}connectedCallback(){var e;super.connectedCallback();const t=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=s.baseLayerLuminance.subscribe(this.luminanceObserver,t)}disconnectedCallback(){var e;const t=null!==(e=this.provider)&&void 0!==e?e:this;s.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,a,i,r;const s=Object.assign({},e);s.components=Object.assign({[o.IX.action]:A,[o.IX.actionsMenu]:D,[o.IX.boolean]:O,[o.IX.editable]:L,[o.IX.icon]:N,[o.IX.select]:z,[o.IX.selectEditor]:l,[o.IX.numberEditor]:h,[o.IX.multiselectEditor]:m,[o.IX.dateEditor]:f,[o.IX.stringEditor]:S,[o.IX.statusPill]:H},e.components);(this.theme===j||this.theme===q||this.theme===J)&&(this.headerHeight=null!==(a=null!==(t=s.headerHeight)&&void 0!==t?t:Ce())&&void 0!==a?a:32,this.rowHeight=null!==(r=null!==(i=s.rowHeight)&&void 0!==i?i:Ce())&&void 0!==r?r:32),super.gridOptions=s}}(0,i.Cg)([n.observable],we.prototype,"provider",void 0);const Ae=r.LU,Re=r.Z$,ke=we.compose(Object.assign({baseName:"grid-pro",template:ae,styles:ee,shadowOptions:Ae},Re));var De=a(6884),xe=a(20633),Ge=a(21409),Oe=a(17190),Pe=a(48046),Te=a(88047),Le=a(62051),Ie=a.n(Le),$e=a(56943),Ne=a(64315),_e=a(14987),Fe=a(63296),ze=a(24638),Me=a(18070),Be=a(26062),He=a(90509),Ve=a(79270),Ue=a(32610),Xe=a(53397),Ke=a(52540),Ye=a(49104),je=a(19060),We=a(88863),qe=a(71964),Qe=a(73203),Je=a(50103),Ze=a(1510),et=a(23201);(0,xe.N)(Be.D,Fe.L,ze.X,$e.O,Ne.G),Pe.syG.registerModules([Pe.n76,Pe.Q90,Pe.x6L,Pe.YN8,Pe.YzW,Pe.Lt,Pe.I95,Pe.O4V,Pe.H18,Pe.mfG,Pe.Iws,Pe.nSw,Pe.FUS,Pe.Ss0,Pe.tkg,Pe.ZDV,Pe.XG7,Pe.VZy,Pe.$I9,Pe.dGu,Pe.AJG,Pe.c5B,Pe.BG]);const tt="gridReady";class at extends((0,Ge.S)(re.FoundationElement)){rowDataChanged(e,t){this.initialised&&this.gridApi.setGridOption("rowData",t)}getfilterModel(){return(0,i.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(e){return(0,i.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=Ie()(this.saveColumnState.bind(this),400),this.debouncedSaveFilterModel=Ie()(this.cacheFilterConfig.bind(this),400),this.debouncedNotifyDatasourceVisibleColumns=Ie()(this.notifyDatasourceVisibleColumns.bind(this),400),this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.enableCellFlashing=!1,this.enableRowFlashing=!1,this.columnComponentName="grid-pro-column",this.themeMode="dark",this.pagination=!1,this.statusBarConfig=o.o2,this.withStatusBar=!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=s.baseLayerLuminance.getValueFor(e.target);this.themeMode=t===s.StandardLuminance.DarkMode?"dark":"light"},this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.agAttributes={},this.agPropertiesMap=Ue.zI.reduce((e,t)=>(e[t.toLowerCase()]=t,e[(0,Je.w)(t)]=t,e),{});const e=this.hideDatasourceError.bind(this);this.rootEventsListeners.push([He.V.dataInit,e],[Ue.yY.datasourceErrorClose,e],[Me.L.error,this.handleBaseDatasourceError.bind(this)],[Me.L.connected,e]),this.datasourceEventHandlers=[[Ve.c.initialize,this.handleInitialize.bind(this)],[Ve.c.dataLoaded,this.handleDataLoaded.bind(this)],[Ve.c.dataChanged,this.handleDataChanged.bind(this)],[Ve.c.schemaUpdated,this.handleSchemaUpdated.bind(this)],[Ve.c.dataCleared,this.handleDataCleared.bind(this)],[Ve.c.loadingStarted,this.handleLoadingStarted.bind(this)],[Ve.c.loadingFinished,this.handleLoadingFinished.bind(this)],[Ve.c.noDataAvailable,this.handleNoDataAvailable.bind(this)],[Ve.c.filtersRestored,this.handleFiltersRestored.bind(this)],[Ve.c.moreDataAvailable,this.handleMoreDataAvailable.bind(this)],[Ve.c.error,this.handleDatasourceError.bind(this)],[Ve.c.destroy,this.handleDatasourceDestroy.bind(this)],[Ve.c.cacheFilterConfig,this.cacheFilterConfig.bind(this)],[Ve.c.refreshServerSide,this.handleRefreshServerSide.bind(this)],[Ve.c.setServerSideDatasource,this.handleSetServerSideDatasource.bind(this)],[Ve.c.addGridCssClass,this.handleAddGridCssClass.bind(this)],[Ve.c.removeGridCssClass,this.handleRemoveGridCssClass.bind(this)],[Ve.c.applyServerSideTransaction,this.handleApplyServerSideTransaction.bind(this)]]}addEventListener(e,t,a){super.addEventListener(e,t,a),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:Ue.Ie.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:t.detail,type:t.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(e=>e.type!==Ue.Ie.datasource),this.removeAttribute("ds-disconnected")}connectedCallback(){var e;super.connectedCallback(),this.disposed=!1;const t=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=s.baseLayerLuminance.subscribe(this.luminanceObserver,t),this.gridAutosizingEnabled&&(this.visibilityObserverCleanup=(0,Oe.j)(this,e=>{e&&this.debouncedColumnAutosize()})),this.rehydrationAttempted=!1,this.shouldRunConnect&&(this.rootEventsListeners.forEach(([e,t])=>{this.addEventListener(e,t)}),Ue.zI.forEach(e=>{Object.defineProperty(this,e,{set:t=>{this.agAttributeChangedCallback((0,Je.w)(e),void 0,t)},enumerable:!0,configurable:!0})}),this.toggleDatasourceEventListeners(!0),this.paginationPageSize=this.isServerSide?this.gridProDatasource.maxRows:De.OD.DEFAULT_PAGINATION_PAGE_SIZE)}disconnectedCallback(){var e;this.disposed=!0,this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel();const t=null!==(e=this.provider)&&void 0!==e?e:this;s.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 a=this.shouldRunDisconnect;this.rootEventsListeners.forEach(([e,t])=>{this.removeEventListener(e,t)}),this.toggleDatasourceEventListeners(!1),a?this.performDisconnectCleanup():queueMicrotask(()=>{this.isConnected||this.performDisconnectCleanup()})}performDisconnectCleanup(){this.debounced&&(clearTimeout(this.debounced),this.debounced=null),this.initialised=!1,this.resetGridOptionsState(),this.destroyGridInstance(),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,a])=>{super[t](e,a)})}handleInitialize(e){const{options:t,keepColDefsOnClearRowData:a}=e.detail;a&&(this.columnState=this.gridApi.getColumnState()),this.applyingDatasourceGridOptions=!0;try{this.gridOptions=Object.assign(Object.assign(Object.assign({},this.userProvidedGridOptions),t),a?{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 a=this.gridApi.applyTransaction(t);this.flashAddedCells(null==a?void 0:a.add)}flashAddedCells(e){this.enableRowFlashing&&(null==e?void 0:e.length)&&this.gridApi.flashCells({rowNodes:e})}handleSchemaUpdated(e){return(0,i.sH)(this,void 0,void 0,function*(){const{schema:t}=e.detail;if(!this.gridApi)return;const a=this.gridApi.getColumnDefs();if(a&&a.length>0)return;this.gridApi.isModuleRegistered("MultiFilterModule")||t.forEach(e=>{"agMultiColumnFilter"===e.filter&&(Ze.v.warn("MultiFilterModule is not registered, falling back to text filter"),e.filter="agTextColumnFilter")});const i=yield this.mergeAllColumnDefsAndStates(t,!0);this.gridApi.setGridOption("columnDefs",i),this.restoreCachedFilterConfig()})}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,a,i,r;const{hasMoreData:s,sourceRef:n}=e.detail;if(!this.gridApi)return;const d=null===(a=(t=this.gridApi).getStatusPanel)||void 0===a?void 0:a.call(t,o.k7.loadMore);d&&(null===(r=(i=d).updateParams)||void 0===r||r.call(i,{moreRows:s,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:a}=e.detail,i=(null===(t=this.gridSlot)||void 0===t?void 0:t.parentElement)||this;i&&i.classList.add(a)}handleRemoveGridCssClass(e){var t;const{className:a}=e.detail,i=(null===(t=this.gridSlot)||void 0===t?void 0:t.parentElement)||this;i&&i.classList.remove(a)}handleApplyServerSideTransaction(e){var t,a;const{transaction:i,async:r,callback:o}=e.detail;if(this.gridApi)if(r)this.gridApi.applyServerSideTransactionAsync(i,e=>{var t,a;this.flashAddedCells([...null!==(t=null==e?void 0:e.add)&&void 0!==t?t:[],...null!==(a=null==e?void 0:e.update)&&void 0!==a?a:[]]),null==o||o(e)});else{const e=this.gridApi.applyServerSideTransaction(i);this.flashAddedCells([...null!==(t=null==e?void 0:e.add)&&void 0!==t?t:[],...null!==(a=null==e?void 0:e.update)&&void 0!==a?a:[]]),o&&o(e)}}combineAllGridComponents(e){const t={[o.IX.action]:w.eA,[o.IX.actionsMenu]:k.cN,[o.IX.boolean]:G._Y,[o.IX.editable]:T.YM,[o.IX.icon]:$.Jt,[o.IX.statusPill]:B.N7,[o.IX.select]:F.gs,[o.IX.selectEditor]:d._Q,[o.IX.numberEditor]:c.Z0,[o.IX.multiselectEditor]:u.pZ,[o.IX.dateEditor]:b.S8,[o.IX.stringEditor]:C.XJ,[o.k7.labelValue]:Ke.k,[o.k7.loadMore]:Ye.s,[o.k7.pagination]:je.h,[o.k7.reload]:We.W,[o.k7.rowCount]:qe.i};return Object.assign(Object.assign(Object.assign({},t),e),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var e,t,a,i;try{if(!this.initialised||!this.gridApi)return[];const r=null===(e=this.gridOptions)||void 0===e?void 0:e.rowSelection;if("single"===r||"multiple"===r)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===(a=this.gridOptions)||void 0===a?void 0:a.enableRangeSelection)){const e=null===(i=this.gridApi)||void 0===i?void 0:i.getFocusedCell();if(e){const t=this.gridApi.getDisplayedRowAtIndex(e.rowIndex);if(null==t?void 0:t.data)return[t.data]}}return[]}catch(e){return Ze.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 a=[];return t.forEach(e=>{const t=e.startRow.rowIndex,i=e.endRow.rowIndex;for(let e=t;e<=i;e+=1){const t=this.gridApi.getDisplayedRowAtIndex(e);(null==t?void 0:t.data)&&!a.some(e=>e===t.data)&&a.push(t.data)}}),a}hasSelectedRows(){return this.getSelectedRows().length>0}updateLabelValueStatusBar(e){var t,a;if(!this.gridApi)return void Ze.v.warn("Grid Pro: Cannot update label-value status bar - grid API not available");const i=null===(a=(t=this.gridApi).getStatusPanel)||void 0===a?void 0:a.call(t,o.k7.labelValue);i&&"function"==typeof i.updateParams?i.updateParams(e):Ze.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()},Ue.BW))}removeConfigWidthsToAutosize(e){return e.map(e=>Object.assign(Object.assign({},e),{width:null}))}saveColumnState(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()){let e=this.gridApi.getColumnState();e=(0,et.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,i.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,i.sH)(this,void 0,void 0,function*(){var e;this.rehydrationAttempted=!0;const t=yield this.getSavedColumnState(),a=(0,et.n7)(t);a&&a.length>0&&(null===(e=this.gridApi)||void 0===e||e.applyColumnState({state:a,applyOrder:!0}))})}cacheFilterConfig(){var e;this.setFilterModel((null===(e=this.gridApi)||void 0===e?void 0:e.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,i.sH)(this,void 0,void 0,function*(){var e,t;const a=yield this.getfilterModel();void 0!==a&&(null===(e=this.gridApi)||void 0===e||e.setFilterModel(a),null===(t=this.gridApi)||void 0===t||t.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof ze.X}get gridParams(){return{globalListener:this.boundGlobalEventListener}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")}notifyDatasourceVisibleColumns(){var e,t,a,i;const r=this.gridProDatasource;if(!r)return;const o=(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===(i=null===(a=this.gridApi)||void 0===a?void 0:a.getColumnDefs)||void 0===i?void 0:i.call(a));o.length&&r.setVisibleColumns(o)}set gridOptions(e){!this.applyingDatasourceGridOptions&&e&&(this.userProvidedGridOptions=Object.assign({},e));const t=()=>{!this.disposed&&this.isConnected&&(this.debouncedSaveColumnState(),this.debouncedColumnAutosize())},a=()=>{!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:r,components:s,defaultColDef:n,getRowId:d,onGridReady:l,onFilterChanged:g,onFirstDataRendered:c}=e,h=(0,i.Tt)(e,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered"]),p=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(s),headerHeight:this.headerHeight,rowHeight:this.rowHeight,animateRows:!1,suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:e=>{var t,a,i;this.gridApi=e.api,this.gridEventsQueue.length&&this.gridEventsQueue.forEach(e=>{this.addGridEventListener(e)}),this.rowData&&this.gridApi.setGridOption("rowData",this.rowData),l&&l(e),(null===(t=this.gridProDatasource)||void 0===t?void 0:t.keepColDefsOnClearRowData)&&(null===(a=this.columnState)||void 0===a?void 0:a.length)>0&&this.gridApi.applyColumnState({state:this.columnState,applyOrder:!0}),this.$emit(tt,{event:e,gridId:this.id}),this.$emit(o.mr,{event:e,gridId:this.id}),this.notifyDatasourceVisibleColumns(),null===(i=this.gridProDatasource)||void 0===i||i.$emit(Ve.c.ready,{pagination:this.pagination}),this.restoreColumnState(),this.restoreCachedFilterConfig(),this.debouncedColumnAutosize()},onFirstDataRendered:e=>{this.notifyDatasourceVisibleColumns(),c&&c(e)},onColumnPinned:t,onColumnResized:t,onColumnMoved:t,onColumnVisible:()=>{t(),a()},onDisplayedColumnsChanged:()=>{t(),a()},onFilterChanged:e=>{!this.disposed&&this.isConnected&&(this.debouncedSaveFilterModel(),g&&g(e))},onGridSizeChanged:t,onSortChanged:t}),h);this.gridProDatasource?(p.columnDefs=r,p.getRowId=d,this.setupPaginationAndStatusBar(p),this.setLocalGridOptions(p)):this.mergeAllColumnDefsAndStates(r).then(e=>{!this.disposed&&this.isConnected&&(p.columnDefs=e,p.getRowId=d,this.setupPaginationAndStatusBar(p),this.setLocalGridOptions(p),this.initGrid())})}setLocalGridOptions(e){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),(0,Ue.Qg)(e,this.agAttributes))}clearLocalGridOptions(){this.agGridOptions=void 0}resetGridOptionsState(){this.userProvidedGridOptions=void 0,this.agGridOptions=void 0}initGrid(){n.DOM.queueUpdate(()=>{!this.disposed&&this.isConnected&&(this.initialised&&(this.destroyGridInstance(),this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild)),this.agGrid=(0,Pe.Dvw)(this.gridSlot,this.agGridOptions,this.gridParams),this.initialised=!0)})}mergeAllColumnDefsAndStates(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!1){var a;const i=e||[];i.forEach(e=>{if(this.headerCaseType&&e.field&&!e.headerName){const t=Te[this.headerCaseType];t?e.headerName=t(e.field):Ze.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 r=Array.from(this.querySelectorAll(this.columnComponentName)).map(e=>e.definition).map(e=>{var t,a;if(this.enableCellFlashing&&void 0===e.enableCellChangeFlash&&(e.enableCellChangeFlash=!0),"agSetColumnFilter"===e.filter){if(!(null!=e.filterParams&&"values"in e.filterParams)){const r=null===(a=null===(t=i.find(t=>t.field===e.field))||void 0===t?void 0:t.filterParams)||void 0===a?void 0:a.values;r&&(e.filterParams=Object.assign(Object.assign({},e.filterParams),{values:r}))}}e.editable&&(e.cellRenderer||e.cellRendererSelector||(e.cellRendererSelector=t=>{if(t.data[o.A7]===e.field)return{component:o.IX.editable}}),e.tooltipComponent||e.tooltipValueGetter||(e.tooltipComponent=Qe.y,e.tooltipValueGetter=t=>{const a=t.data[o.h1];if(a&&a.column===e.field)return a.message}),e.cellClassRules||(e.cellClassRules={error:e=>{var t;return(null===(t=e.data[o.h1])||void 0===t?void 0:t.column)===e.colDef.field}}));const r=i.find(t=>e.field===t.field);return Object.assign(Object.assign({},r),e)}),s=r.map(e=>e.field),n=[...r,...this.onlyTemplateColDefs?[]:i.filter(e=>!s.includes(e.field))];if(this.gridProDatasource&&t){const e=yield this.getSavedColumnState();if((null==e?void 0:e.length)>0)return(0,et.yS)(n,e);if((null===(a=this.gridProDatasource.deferredColumnStates)||void 0===a?void 0:a.length)>0)return(0,et.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 a=this.isServerSide||"serverSide"===(null==t?void 0:t.rowModelType),i=this._pagination||!0===(null==t?void 0:t.pagination);if(a&&!i)this.panelExists(o.k7.rowCount,e)||e.push({statusPanel:o.k7.rowCount,align:"left"});else if(!a){const t="agTotalAndFilteredRowCountComponent";this.panelExists(t,e)||e.push({statusPanel:t,align:"left"})}}}addMaxRowsPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.maxRows&&(this.panelExists(o.k7.labelValue,e)||e.push({statusPanel:o.k7.labelValue,statusPanelParams:{label:"Max Rows",value:this.gridProDatasource.maxRows||De.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.statusBarConfig).filter(t=>!this.panelExists(t.statusPanel,e));e.push(...t)}}addPaginationPanel(e){this._pagination&&(this.panelExists(o.k7.pagination,e)||e.push({statusPanel:o.k7.pagination,align:"right"}))}setupPaginationAndStatusBar(e){var t,a;if(this._pagination&&(e.pagination=!0,e.suppressScrollOnNewData=!0,e.paginationPageSize=this.paginationPageSize),this.withStatusBar&&this.statusBarConfig){const i=[...(null===(t=e.statusBar)||void 0===t?void 0:t.statusPanels)||[]];this.addRowCountPanel(i,e),this.addMaxRowsPanel(i),this.addAggregationPanel(i),this.addDatasourcePanels(i),this._pagination&&(e.suppressPaginationPanel=!0,this.addPaginationPanel(i));const r=((null===(a=e.statusBar)||void 0===a?void 0:a.statusPanels)||[]).filter(e=>!this.panelExists(e.statusPanel,i));i.push(...r),e.statusBar={statusPanels:i}}}get observedAttributes(){const e=Ue.zI.map(e=>e.toLowerCase()),t=Ue.zI.map(e=>(0,Je.w)(e));return e.concat(t)}agAttributeChangedCallback(e,t,a){var i;if(t===a)return;const r=this.agPropertiesMap[e];r&&(this.agAttributes[r]=a,this.initialised&&(null===(i=this.gridApi)||void 0===i||i.setGridOption(r,a)))}globalEventListener(e,t){const a=e.toLowerCase(),i=new Event(a);i.agGridDetails=t,this.dispatchEvent(i);const r="on"+a;"function"==typeof this[r]&&this[r](i)}}(0,i.Cg)([n.observable],at.prototype,"gridApi",void 0),(0,i.Cg)([n.observable],at.prototype,"gridErrorItems",void 0),(0,i.Cg)([Xe.l],at.prototype,"statePersistence",void 0),(0,i.Cg)([(0,n.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],at.prototype,"autoCellRendererByType",void 0),(0,i.Cg)([(0,n.attr)({attribute:"only-template-col-defs",mode:"boolean"})],at.prototype,"onlyTemplateColDefs",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean",attribute:"grid-autosizing"})],at.prototype,"gridAutosizingEnabled",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],at.prototype,"enableCellFlashing",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-row-flashing"})],at.prototype,"enableRowFlashing",void 0),(0,i.Cg)([(0,n.attr)({attribute:"persist-column-state-key"})],at.prototype,"persistColumnStateKey",void 0),(0,i.Cg)([(0,n.attr)({attribute:"persist-filter-model-key"})],at.prototype,"persistFilterModelKey",void 0),(0,i.Cg)([(0,n.attr)({attribute:"header-case-type"})],at.prototype,"headerCaseType",void 0),(0,i.Cg)([n.observable],at.prototype,"rowData",void 0),(0,i.Cg)([n.attr],at.prototype,"columnComponentName",void 0),(0,i.Cg)([n.observable],at.prototype,"eventsAndCallbacks",void 0),(0,i.Cg)([n.attr],at.prototype,"headerHeight",void 0),(0,i.Cg)([n.attr],at.prototype,"rowHeight",void 0),(0,i.Cg)([n.observable],at.prototype,"classNames",void 0),(0,i.Cg)([n.observable],at.prototype,"agGrid",void 0),(0,i.Cg)([n.observable],at.prototype,"gridSlot",void 0),(0,i.Cg)([n.observable],at.prototype,"themeMode",void 0),(0,i.Cg)([n.observable],at.prototype,"gridComponents",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean"})],at.prototype,"pagination",void 0),(0,i.Cg)([(0,n.attr)({attribute:"pagination-page-size"})],at.prototype,"paginationPageSize",void 0),(0,i.Cg)([n.observable],at.prototype,"statusBarConfig",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean",attribute:"with-status-bar"})],at.prototype,"withStatusBar",void 0),(0,i.Cg)([n.observable],at.prototype,"customErrorHandlerTemplate",void 0),(0,i.Cg)([o.lz],at.prototype,"gridOptionsConfig",void 0),(0,i.Cg)([n.observable],at.prototype,"provider",void 0);class it extends at{getCachedTheme(){var e;return null!==(e=it.cachedTheme)&&void 0!==e||(it.cachedTheme=Pe.N8R.withParams({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%)"})),it.cachedTheme}set gridOptions(e){const t=Object.assign({},e);t.components=Object.assign({[o.IX.action]:A,[o.IX.actionsMenu]:D,[o.IX.boolean]:O,[o.IX.editable]:L,[o.IX.select]:z,[o.IX.selectEditor]:l,[o.IX.numberEditor]:h,[o.IX.multiselectEditor]:m,[o.IX.dateEditor]:f,[o.IX.stringEditor]:S,[o.IX.statusPill]:H,[o.IX.icon]:N},t.components),t.theme=this.getCachedTheme(),super.gridOptions=t}}(0,i.Cg)([n.observable],it.prototype,"provider",void 0);const rt=it.compose(Object.assign({baseName:"grid-pro",template:ae,styles:n.css`
|
|
760
|
+
`;var te=a(82128);const ae=(0,te.U)("rapid");var ie=a(20166),re=a(38370),oe=a(83912);const se="#cccccc",ne="#879ba6",de="#1f2126",le="#2e3339",ge="#2b2e34",ce="#000000",he="#181d1f",pe="#FFFFFF",ue="#babfc7",me="#2196f3",ve={foregroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(se)),headerForegroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(ne)),backgroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(de)),borderSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(le)),rowHoverSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(ge))},be={foregroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(ce)),headerForegroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(he)),backgroundSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(pe)),borderSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(ue)),rowHoverSwatch:s.SwatchRGB.from((0,oe.parseColorHexRGB)(me))},{create:fe}=re.DesignToken,ye={backgroundColor:fe("rapid-ag-background-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.backgroundSwatch:ve.backgroundSwatch),borderColor:fe("rapid-ag-border-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.borderSwatch:ve.borderSwatch),foregroundColor:fe("rapid-ag-foreground-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.foregroundSwatch:ve.foregroundSwatch),headerForegroundColor:fe("rapid-ag-header-foreground-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.headerForegroundSwatch:ve.headerForegroundSwatch),rowHoverColor:fe("rapid-ag-row-hover-color").withDefault(e=>s.baseLayerLuminance.getValueFor(e)===s.StandardLuminance.LightMode?be.rowHoverSwatch:ve.rowHoverSwatch)},Ce=()=>{const e=(0,ie.designTokensMap)();if(!e.value)return null;const{style:t,space:a}=e.value.design_tokens;return(t.baseHeightMultiplier.$value+t.density.$value)*a.designUnit.$value-8},Se="ag-theme-genesis-rapid-dark",Ee="ag-theme-genesis-rapid-light";class we extends r.cF{constructor(){super(...arguments),this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.handleLuminanceChange=e=>{const t=s.baseLayerLuminance.getValueFor(e.target);this.theme=t===s.StandardLuminance.DarkMode?Se:Ee},this.theme="light"===localStorage.getItem("luminance")?Ee:Se}connectedCallback(){var e;super.connectedCallback();const t=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=s.baseLayerLuminance.subscribe(this.luminanceObserver,t)}disconnectedCallback(){var e;const t=null!==(e=this.provider)&&void 0!==e?e:this;s.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,a,i,r;const s=Object.assign({},e);s.components=Object.assign({[o.IX.action]:A,[o.IX.actionsMenu]:D,[o.IX.boolean]:O,[o.IX.editable]:L,[o.IX.icon]:N,[o.IX.select]:z,[o.IX.selectEditor]:l,[o.IX.numberEditor]:h,[o.IX.multiselectEditor]:m,[o.IX.dateEditor]:f,[o.IX.stringEditor]:S,[o.IX.statusPill]:H},e.components);(this.theme===j||this.theme===q||this.theme===J)&&(this.headerHeight=null!==(a=null!==(t=s.headerHeight)&&void 0!==t?t:Ce())&&void 0!==a?a:32,this.rowHeight=null!==(r=null!==(i=s.rowHeight)&&void 0!==i?i:Ce())&&void 0!==r?r:32),super.gridOptions=s}}(0,i.Cg)([n.observable],we.prototype,"provider",void 0);const Ae=r.LU,Re=r.Z$,ke=we.compose(Object.assign({baseName:"grid-pro",template:ae,styles:ee,shadowOptions:Ae},Re));var De=a(6884),xe=a(20633),Ge=a(21409),Oe=a(17190),Pe=a(48046),Te=a(88047),Le=a(62051),Ie=a.n(Le),$e=a(56943),Ne=a(64315),_e=a(14987),Fe=a(63296),ze=a(24638),Me=a(18070),Be=a(26062),He=a(90509),Ve=a(79270),Ue=a(32610),Xe=a(53397),Ke=a(52540),Ye=a(49104),je=a(19060),We=a(88863),qe=a(71964),Qe=a(73203),Je=a(50103),Ze=a(1510),et=a(23201);(0,xe.N)(Be.D,Fe.L,ze.X,$e.O,Ne.G),Pe.syG.registerModules([Pe.n76,Pe.Q90,Pe.x6L,Pe.YN8,Pe.YzW,Pe.Lt,Pe.I95,Pe.O4V,Pe.H18,Pe.mfG,Pe.Iws,Pe.nSw,Pe.FUS,Pe.Ss0,Pe.tkg,Pe.ZDV,Pe.XG7,Pe.VZy,Pe.$I9,Pe.dGu,Pe.AJG,Pe.c5B,Pe.BG]);const tt="gridReady";class at extends((0,Ge.S)(re.FoundationElement)){rowDataChanged(e,t){this.initialised&&this.gridApi.setGridOption("rowData",t)}getfilterModel(){return(0,i.sH)(this,void 0,void 0,function*(){if(!this.persistFilterModelKey)return this._filterConfig;return yield this.statePersistence.getFilterModel(this.persistFilterModelKey)})}setFilterModel(e){return(0,i.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=Ie()(this.saveColumnState.bind(this),400),this.debouncedSaveFilterModel=Ie()(this.cacheFilterConfig.bind(this),400),this.debouncedNotifyDatasourceVisibleColumns=Ie()(this.notifyDatasourceVisibleColumns.bind(this),400),this.autoCellRendererByType=!1,this.onlyTemplateColDefs=!1,this.gridAutosizingEnabled=!1,this.enableCellFlashing=!1,this.enableRowFlashing=!1,this.columnComponentName="grid-pro-column",this.themeMode="dark",this.pagination=!1,this.statusBarConfig=o.o2,this.withStatusBar=!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=s.baseLayerLuminance.getValueFor(e.target);this.themeMode=t===s.StandardLuminance.DarkMode?"dark":"light"},this.luminanceObserver={handleChange:e=>this.handleLuminanceChange(e)},this.agAttributes={},this.agPropertiesMap=Ue.zI.reduce((e,t)=>(e[t.toLowerCase()]=t,e[(0,Je.w)(t)]=t,e),{});const e=this.hideDatasourceError.bind(this);this.rootEventsListeners.push([He.V.dataInit,e],[Ue.yY.datasourceErrorClose,e],[Me.L.error,this.handleBaseDatasourceError.bind(this)],[Me.L.connected,e]),this.datasourceEventHandlers=[[Ve.c.initialize,this.handleInitialize.bind(this)],[Ve.c.dataLoaded,this.handleDataLoaded.bind(this)],[Ve.c.dataChanged,this.handleDataChanged.bind(this)],[Ve.c.schemaUpdated,this.handleSchemaUpdated.bind(this)],[Ve.c.dataCleared,this.handleDataCleared.bind(this)],[Ve.c.loadingStarted,this.handleLoadingStarted.bind(this)],[Ve.c.loadingFinished,this.handleLoadingFinished.bind(this)],[Ve.c.noDataAvailable,this.handleNoDataAvailable.bind(this)],[Ve.c.filtersRestored,this.handleFiltersRestored.bind(this)],[Ve.c.moreDataAvailable,this.handleMoreDataAvailable.bind(this)],[Ve.c.error,this.handleDatasourceError.bind(this)],[Ve.c.destroy,this.handleDatasourceDestroy.bind(this)],[Ve.c.cacheFilterConfig,this.cacheFilterConfig.bind(this)],[Ve.c.refreshServerSide,this.handleRefreshServerSide.bind(this)],[Ve.c.setServerSideDatasource,this.handleSetServerSideDatasource.bind(this)],[Ve.c.addGridCssClass,this.handleAddGridCssClass.bind(this)],[Ve.c.removeGridCssClass,this.handleRemoveGridCssClass.bind(this)],[Ve.c.applyServerSideTransaction,this.handleApplyServerSideTransaction.bind(this)]]}addEventListener(e,t,a){super.addEventListener(e,t,a),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:Ue.Ie.datasource};this.gridErrorItems=[...this.gridErrorItems,{detail:t.detail,type:t.type}]}hideDatasourceError(){this.gridErrorItems=this.gridErrorItems.filter(e=>e.type!==Ue.Ie.datasource),this.removeAttribute("ds-disconnected")}connectedCallback(){var e;super.connectedCallback(),this.disposed=!1;const t=null!==(e=this.provider)&&void 0!==e?e:this;this.luminanceSubscription=s.baseLayerLuminance.subscribe(this.luminanceObserver,t),this.gridAutosizingEnabled&&(this.visibilityObserverCleanup=(0,Oe.j)(this,e=>{e&&this.debouncedColumnAutosize()})),this.rehydrationAttempted=!1,this.shouldRunConnect&&(this.rootEventsListeners.forEach(([e,t])=>{this.addEventListener(e,t)}),Ue.zI.forEach(e=>{Object.defineProperty(this,e,{set:t=>{this.agAttributeChangedCallback((0,Je.w)(e),void 0,t)},enumerable:!0,configurable:!0})}),this.toggleDatasourceEventListeners(!0),this.paginationPageSize=this.isServerSide?this.gridProDatasource.maxRows:De.OD.DEFAULT_PAGINATION_PAGE_SIZE)}disconnectedCallback(){var e;this.disposed=!0,this.debouncedSaveColumnState.cancel(),this.debouncedSaveFilterModel.cancel();const t=null!==(e=this.provider)&&void 0!==e?e:this;s.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 a=this.shouldRunDisconnect;this.rootEventsListeners.forEach(([e,t])=>{this.removeEventListener(e,t)}),a?this.performDisconnectCleanup():queueMicrotask(()=>{this.isConnected||this.performDisconnectCleanup()})}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,a])=>{super[t](e,a)})}handleInitialize(e){const{options:t,keepColDefsOnClearRowData:a}=e.detail;a&&(this.columnState=this.gridApi.getColumnState()),this.applyingDatasourceGridOptions=!0;try{this.gridOptions=Object.assign(Object.assign(Object.assign({},this.userProvidedGridOptions),t),a?{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 a=this.gridApi.applyTransaction(t);this.flashAddedCells(null==a?void 0:a.add)}flashAddedCells(e){this.enableRowFlashing&&(null==e?void 0:e.length)&&this.gridApi.flashCells({rowNodes:e})}handleSchemaUpdated(e){return(0,i.sH)(this,void 0,void 0,function*(){const{schema:t}=e.detail;if(!this.gridApi)return;const a=this.gridApi.getColumnDefs();if(a&&a.length>0)return;this.gridApi.isModuleRegistered("MultiFilterModule")||t.forEach(e=>{"agMultiColumnFilter"===e.filter&&(Ze.v.warn("MultiFilterModule is not registered, falling back to text filter"),e.filter="agTextColumnFilter")});const i=yield this.mergeAllColumnDefsAndStates(t,!0);this.gridApi.setGridOption("columnDefs",i),this.restoreCachedFilterConfig()})}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,a,i,r;const{hasMoreData:s,sourceRef:n}=e.detail;if(!this.gridApi)return;const d=null===(a=(t=this.gridApi).getStatusPanel)||void 0===a?void 0:a.call(t,o.k7.loadMore);d&&(null===(r=(i=d).updateParams)||void 0===r||r.call(i,{moreRows:s,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:a}=e.detail,i=(null===(t=this.gridSlot)||void 0===t?void 0:t.parentElement)||this;i&&i.classList.add(a)}handleRemoveGridCssClass(e){var t;const{className:a}=e.detail,i=(null===(t=this.gridSlot)||void 0===t?void 0:t.parentElement)||this;i&&i.classList.remove(a)}handleApplyServerSideTransaction(e){var t,a;const{transaction:i,async:r,callback:o}=e.detail;if(this.gridApi)if(r)this.gridApi.applyServerSideTransactionAsync(i,e=>{var t,a;this.flashAddedCells([...null!==(t=null==e?void 0:e.add)&&void 0!==t?t:[],...null!==(a=null==e?void 0:e.update)&&void 0!==a?a:[]]),null==o||o(e)});else{const e=this.gridApi.applyServerSideTransaction(i);this.flashAddedCells([...null!==(t=null==e?void 0:e.add)&&void 0!==t?t:[],...null!==(a=null==e?void 0:e.update)&&void 0!==a?a:[]]),o&&o(e)}}combineAllGridComponents(e){const t={[o.IX.action]:w.eA,[o.IX.actionsMenu]:k.cN,[o.IX.boolean]:G._Y,[o.IX.editable]:T.YM,[o.IX.icon]:$.Jt,[o.IX.statusPill]:B.N7,[o.IX.select]:F.gs,[o.IX.selectEditor]:d._Q,[o.IX.numberEditor]:c.Z0,[o.IX.multiselectEditor]:u.pZ,[o.IX.dateEditor]:b.S8,[o.IX.stringEditor]:C.XJ,[o.k7.labelValue]:Ke.k,[o.k7.loadMore]:Ye.s,[o.k7.pagination]:je.h,[o.k7.reload]:We.W,[o.k7.rowCount]:qe.i};return Object.assign(Object.assign(Object.assign({},t),e),this.gridComponents)}statePersistanceEnabled(){return!(!this.persistColumnStateKey||0===this.persistColumnStateKey.length)}getSelectedRows(){var e,t,a,i;try{if(!this.initialised||!this.gridApi)return[];const r=null===(e=this.gridOptions)||void 0===e?void 0:e.rowSelection;if("single"===r||"multiple"===r)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===(a=this.gridOptions)||void 0===a?void 0:a.enableRangeSelection)){const e=null===(i=this.gridApi)||void 0===i?void 0:i.getFocusedCell();if(e){const t=this.gridApi.getDisplayedRowAtIndex(e.rowIndex);if(null==t?void 0:t.data)return[t.data]}}return[]}catch(e){return Ze.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 a=[];return t.forEach(e=>{const t=e.startRow.rowIndex,i=e.endRow.rowIndex;for(let e=t;e<=i;e+=1){const t=this.gridApi.getDisplayedRowAtIndex(e);(null==t?void 0:t.data)&&!a.some(e=>e===t.data)&&a.push(t.data)}}),a}hasSelectedRows(){return this.getSelectedRows().length>0}updateLabelValueStatusBar(e){var t,a;if(!this.gridApi)return void Ze.v.warn("Grid Pro: Cannot update label-value status bar - grid API not available");const i=null===(a=(t=this.gridApi).getStatusPanel)||void 0===a?void 0:a.call(t,o.k7.labelValue);i&&"function"==typeof i.updateParams?i.updateParams(e):Ze.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()},Ue.BW))}removeConfigWidthsToAutosize(e){return e.map(e=>Object.assign(Object.assign({},e),{width:null}))}saveColumnState(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.rehydrationAttempted&&this.statePersistanceEnabled()){let e=this.gridApi.getColumnState();e=(0,et.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,i.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,i.sH)(this,void 0,void 0,function*(){var e;this.rehydrationAttempted=!0;const t=yield this.getSavedColumnState(),a=(0,et.n7)(t);a&&a.length>0&&(null===(e=this.gridApi)||void 0===e||e.applyColumnState({state:a,applyOrder:!0}))})}cacheFilterConfig(){var e;this.setFilterModel((null===(e=this.gridApi)||void 0===e?void 0:e.getFilterModel())||void 0)}restoreCachedFilterConfig(){return(0,i.sH)(this,void 0,void 0,function*(){var e,t;const a=yield this.getfilterModel();void 0!==a&&(null===(e=this.gridApi)||void 0===e||e.setFilterModel(a),null===(t=this.gridApi)||void 0===t||t.onFilterChanged())})}get gridOptions(){return this.agGridOptions}get isServerSide(){return this.gridProDatasource instanceof ze.X}get gridParams(){return{globalListener:this.boundGlobalEventListener}}get gridProDatasource(){return this.querySelector("grid-pro-genesis-datasource")||this.querySelector("grid-pro-client-side-datasource")||this.querySelector("grid-pro-server-side-datasource")}notifyDatasourceVisibleColumns(){var e,t,a,i;const r=this.gridProDatasource;if(!r)return;const o=(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===(i=null===(a=this.gridApi)||void 0===a?void 0:a.getColumnDefs)||void 0===i?void 0:i.call(a));o.length&&r.setVisibleColumns(o)}set gridOptions(e){!this.applyingDatasourceGridOptions&&e&&(this.userProvidedGridOptions=Object.assign({},e));const t=()=>{!this.disposed&&this.isConnected&&(this.debouncedSaveColumnState(),this.debouncedColumnAutosize())},a=()=>{!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:r,components:s,defaultColDef:n,getRowId:d,onGridReady:l,onFilterChanged:g,onFirstDataRendered:c}=e,h=(0,i.Tt)(e,["columnDefs","components","defaultColDef","getRowId","onGridReady","onFilterChanged","onFirstDataRendered"]),p=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(s),headerHeight:this.headerHeight,rowHeight:this.rowHeight,animateRows:!1,suppressDragLeaveHidesColumns:!0}),this.eventsAndCallbacks),{onGridReady:e=>{var t,a,i;this.gridApi=e.api,this.gridEventsQueue.length&&this.gridEventsQueue.forEach(e=>{this.addGridEventListener(e)}),this.rowData&&this.gridApi.setGridOption("rowData",this.rowData),l&&l(e),(null===(t=this.gridProDatasource)||void 0===t?void 0:t.keepColDefsOnClearRowData)&&(null===(a=this.columnState)||void 0===a?void 0:a.length)>0&&this.gridApi.applyColumnState({state:this.columnState,applyOrder:!0}),this.$emit(tt,{event:e,gridId:this.id}),this.$emit(o.mr,{event:e,gridId:this.id}),this.notifyDatasourceVisibleColumns(),null===(i=this.gridProDatasource)||void 0===i||i.$emit(Ve.c.ready,{pagination:this.pagination}),this.restoreColumnState(),this.restoreCachedFilterConfig(),this.debouncedColumnAutosize()},onFirstDataRendered:e=>{this.notifyDatasourceVisibleColumns(),c&&c(e)},onColumnPinned:t,onColumnResized:t,onColumnMoved:t,onColumnVisible:()=>{t(),a()},onDisplayedColumnsChanged:()=>{t(),a()},onFilterChanged:e=>{!this.disposed&&this.isConnected&&(this.debouncedSaveFilterModel(),g&&g(e))},onGridSizeChanged:t,onSortChanged:t}),h);this.gridProDatasource?(p.columnDefs=r,p.getRowId=d,this.setupPaginationAndStatusBar(p),this.setLocalGridOptions(p)):this.mergeAllColumnDefsAndStates(r).then(e=>{!this.disposed&&this.isConnected&&(p.columnDefs=e,p.getRowId=d,this.setupPaginationAndStatusBar(p),this.setLocalGridOptions(p),this.initGrid())})}setLocalGridOptions(e){this.agGridOptions=Object.assign(Object.assign({},this.agGridOptions),(0,Ue.Qg)(e,this.agAttributes))}clearLocalGridOptions(){this.agGridOptions=void 0}resetGridOptionsState(){this.userProvidedGridOptions=void 0,this.agGridOptions=void 0}initGrid(){n.DOM.queueUpdate(()=>{!this.disposed&&this.isConnected&&(this.initialised&&(this.destroyGridInstance(),this.gridSlot.firstChild&&this.gridSlot.removeChild(this.gridSlot.firstChild)),this.agGrid=(0,Pe.Dvw)(this.gridSlot,this.agGridOptions,this.gridParams),this.initialised=!0)})}mergeAllColumnDefsAndStates(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!1){var a;const i=e||[];i.forEach(e=>{if(this.headerCaseType&&e.field&&!e.headerName){const t=Te[this.headerCaseType];t?e.headerName=t(e.field):Ze.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 r=Array.from(this.querySelectorAll(this.columnComponentName)).map(e=>e.definition).map(e=>{var t,a;if(this.enableCellFlashing&&void 0===e.enableCellChangeFlash&&(e.enableCellChangeFlash=!0),"agSetColumnFilter"===e.filter){if(!(null!=e.filterParams&&"values"in e.filterParams)){const r=null===(a=null===(t=i.find(t=>t.field===e.field))||void 0===t?void 0:t.filterParams)||void 0===a?void 0:a.values;r&&(e.filterParams=Object.assign(Object.assign({},e.filterParams),{values:r}))}}e.editable&&(e.cellRenderer||e.cellRendererSelector||(e.cellRendererSelector=t=>{if(t.data[o.A7]===e.field)return{component:o.IX.editable}}),e.tooltipComponent||e.tooltipValueGetter||(e.tooltipComponent=Qe.y,e.tooltipValueGetter=t=>{const a=t.data[o.h1];if(a&&a.column===e.field)return a.message}),e.cellClassRules||(e.cellClassRules={error:e=>{var t;return(null===(t=e.data[o.h1])||void 0===t?void 0:t.column)===e.colDef.field}}));const r=i.find(t=>e.field===t.field);return Object.assign(Object.assign({},r),e)}),s=r.map(e=>e.field),n=[...r,...this.onlyTemplateColDefs?[]:i.filter(e=>!s.includes(e.field))];if(this.gridProDatasource&&t){const e=yield this.getSavedColumnState();if((null==e?void 0:e.length)>0)return(0,et.yS)(n,e);if((null===(a=this.gridProDatasource.deferredColumnStates)||void 0===a?void 0:a.length)>0)return(0,et.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 a=this.isServerSide||"serverSide"===(null==t?void 0:t.rowModelType),i=this._pagination||!0===(null==t?void 0:t.pagination);if(a&&!i)this.panelExists(o.k7.rowCount,e)||e.push({statusPanel:o.k7.rowCount,align:"left"});else if(!a){const t="agTotalAndFilteredRowCountComponent";this.panelExists(t,e)||e.push({statusPanel:t,align:"left"})}}}addMaxRowsPanel(e){this.statusBarConfig&&!0===this.statusBarConfig.maxRows&&(this.panelExists(o.k7.labelValue,e)||e.push({statusPanel:o.k7.labelValue,statusPanelParams:{label:"Max Rows",value:this.gridProDatasource.maxRows||De.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.statusBarConfig).filter(t=>!this.panelExists(t.statusPanel,e));e.push(...t)}}addPaginationPanel(e){this._pagination&&(this.panelExists(o.k7.pagination,e)||e.push({statusPanel:o.k7.pagination,align:"right"}))}setupPaginationAndStatusBar(e){var t,a;if(this._pagination&&(e.pagination=!0,e.suppressScrollOnNewData=!0,e.paginationPageSize=this.paginationPageSize),this.withStatusBar&&this.statusBarConfig){const i=[...(null===(t=e.statusBar)||void 0===t?void 0:t.statusPanels)||[]];this.addRowCountPanel(i,e),this.addMaxRowsPanel(i),this.addAggregationPanel(i),this.addDatasourcePanels(i),this._pagination&&(e.suppressPaginationPanel=!0,this.addPaginationPanel(i));const r=((null===(a=e.statusBar)||void 0===a?void 0:a.statusPanels)||[]).filter(e=>!this.panelExists(e.statusPanel,i));i.push(...r),e.statusBar={statusPanels:i}}}get observedAttributes(){const e=Ue.zI.map(e=>e.toLowerCase()),t=Ue.zI.map(e=>(0,Je.w)(e));return e.concat(t)}agAttributeChangedCallback(e,t,a){var i;if(t===a)return;const r=this.agPropertiesMap[e];r&&(this.agAttributes[r]=a,this.initialised&&(null===(i=this.gridApi)||void 0===i||i.setGridOption(r,a)))}globalEventListener(e,t){const a=e.toLowerCase(),i=new Event(a);i.agGridDetails=t,this.dispatchEvent(i);const r="on"+a;"function"==typeof this[r]&&this[r](i)}}(0,i.Cg)([n.observable],at.prototype,"gridApi",void 0),(0,i.Cg)([n.observable],at.prototype,"gridErrorItems",void 0),(0,i.Cg)([Xe.l],at.prototype,"statePersistence",void 0),(0,i.Cg)([(0,n.attr)({attribute:"auto-cell-renderer-by-type",mode:"boolean"})],at.prototype,"autoCellRendererByType",void 0),(0,i.Cg)([(0,n.attr)({attribute:"only-template-col-defs",mode:"boolean"})],at.prototype,"onlyTemplateColDefs",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean",attribute:"grid-autosizing"})],at.prototype,"gridAutosizingEnabled",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-cell-flashing"})],at.prototype,"enableCellFlashing",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean",attribute:"enable-row-flashing"})],at.prototype,"enableRowFlashing",void 0),(0,i.Cg)([(0,n.attr)({attribute:"persist-column-state-key"})],at.prototype,"persistColumnStateKey",void 0),(0,i.Cg)([(0,n.attr)({attribute:"persist-filter-model-key"})],at.prototype,"persistFilterModelKey",void 0),(0,i.Cg)([(0,n.attr)({attribute:"header-case-type"})],at.prototype,"headerCaseType",void 0),(0,i.Cg)([n.observable],at.prototype,"rowData",void 0),(0,i.Cg)([n.attr],at.prototype,"columnComponentName",void 0),(0,i.Cg)([n.observable],at.prototype,"eventsAndCallbacks",void 0),(0,i.Cg)([n.attr],at.prototype,"headerHeight",void 0),(0,i.Cg)([n.attr],at.prototype,"rowHeight",void 0),(0,i.Cg)([n.observable],at.prototype,"classNames",void 0),(0,i.Cg)([n.observable],at.prototype,"agGrid",void 0),(0,i.Cg)([n.observable],at.prototype,"gridSlot",void 0),(0,i.Cg)([n.observable],at.prototype,"themeMode",void 0),(0,i.Cg)([n.observable],at.prototype,"gridComponents",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean"})],at.prototype,"pagination",void 0),(0,i.Cg)([(0,n.attr)({attribute:"pagination-page-size"})],at.prototype,"paginationPageSize",void 0),(0,i.Cg)([n.observable],at.prototype,"statusBarConfig",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean",attribute:"with-status-bar"})],at.prototype,"withStatusBar",void 0),(0,i.Cg)([n.observable],at.prototype,"customErrorHandlerTemplate",void 0),(0,i.Cg)([o.lz],at.prototype,"gridOptionsConfig",void 0),(0,i.Cg)([n.observable],at.prototype,"provider",void 0);class it extends at{getCachedTheme(){var e;return null!==(e=it.cachedTheme)&&void 0!==e||(it.cachedTheme=Pe.N8R.withParams({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%)"})),it.cachedTheme}set gridOptions(e){const t=Object.assign({},e);t.components=Object.assign({[o.IX.action]:A,[o.IX.actionsMenu]:D,[o.IX.boolean]:O,[o.IX.editable]:L,[o.IX.select]:z,[o.IX.selectEditor]:l,[o.IX.numberEditor]:h,[o.IX.multiselectEditor]:m,[o.IX.dateEditor]:f,[o.IX.stringEditor]:S,[o.IX.statusPill]:H,[o.IX.icon]:N},t.components),t.theme=this.getCachedTheme(),super.gridOptions=t}}(0,i.Cg)([n.observable],it.prototype,"provider",void 0);const rt=it.compose(Object.assign({baseName:"grid-pro",template:ae,styles:n.css`
|
|
761
761
|
:host {
|
|
762
762
|
width: 100%;
|
|
763
763
|
height: 100%;
|
|
@@ -966,4 +966,4 @@
|
|
|
966
966
|
</div>
|
|
967
967
|
</div>
|
|
968
968
|
`,Et=St(),wt={menuTabs:["filterMenuTab","generalMenuTab","columnsMenuTab"]},At=(e,t)=>!e.composedPath().includes(t);function Rt(e,t,a,r){return(0,i.sH)(this,void 0,void 0,function*(){var i;try{const o=function(e,t){const a=(new gt.K).withField(e).withValue(null!=t?t:"").withSerialiser(ct.n.EQ).withGroup("default").build();return a.serialiser(a)}(a,r),s=yield e.request(t,{DETAILS:{CRITERIA_MATCH:o}});return 1===(null===(i=s.REPLY)||void 0===i?void 0:i.length)?s.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 kt extends((0,Ge.S)(re.FoundationElement)){constructor(){super(...arguments),this.requestSupportsAdvancedSearch=!1,this.defaultSlottedNodes=[],this.getAndSetRowsDebounce=Ie()(()=>this.getAndSetRows(),300),this.handleClickOutside=e=>{At(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?Rt(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:wt,onRowClicked:e=>{this.selectedRow=e.data,this.emitValue(e.data[this.valueKey]),this.toggle()}})}setGridRowData(e){var t;const a=null===(t=this.grid)||void 0===t?void 0:t.gridApi;a&&("function"==typeof a.updateGridOptions?a.updateGridOptions({rowData:e}):a.setRowData(e))}setGridColumnDefs(e){var t;const a=null===(t=this.grid)||void 0===t?void 0:t.gridApi;a&&("function"==typeof a.updateGridOptions?a.updateGridOptions({columnDefs:e}):a.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,i.sH)(this,void 0,void 0,function*(){var e,t;if(!(null===(e=this.grid)||void 0===e?void 0:e.gridApi))return;const a=this.lastRequest={},i=this.request?{REQUEST:Object.assign({},this.request)}:{},r=Array.isArray(this.searchKey)&&1===this.searchKey.length?this.searchKey[0]:this.searchKey;let o;if(r&&this.filterSearch)if(this.requestSupportsAdvancedSearch){const e=(Array.isArray(r)?r:[r]).map(e=>{var t;return(new gt.K).withField(e).withValue(null!==(t=this.filterSearch)&&void 0!==t?t:"").withSerialiser(ct.n.containsIgnoreCase).withGroup("default").build()}),t=new ht.b;t.Or(e,{join:pt.r.Or()}),o=t.build()}else{if(Array.isArray(r))throw Error("MulticolumnDropdown: Unable to search multiple keys via request; if the request is a GPAL ReqRep, set requestSupportsAdvancedSearch to true");i.REQUEST=Object.assign(Object.assign({},i.REQUEST),{[r]:`*${this.filterSearch}*`})}const s=null===(t=this.baseCriteria)||void 0===t?void 0:t.trim();s&&o?o=`(${o}) && (${s})`:s&&(o=s),o&&(i.DETAILS={CRITERIA_MATCH:o});try{const e=yield this.connect.request(this.resourceName,i);if(a!==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(mt,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,i.Cg)([lt.dm],kt.prototype,"_connectDI",void 0),(0,i.Cg)([(0,n.attr)({mode:"boolean"})],kt.prototype,"disabled",void 0),(0,i.Cg)([(0,n.attr)({attribute:"resource-name"})],kt.prototype,"resourceName",void 0),(0,i.Cg)([(0,n.attr)({attribute:"search-key",converter:ut})],kt.prototype,"searchKey",void 0),(0,i.Cg)([(0,n.attr)({attribute:"advanced-search-req",mode:"boolean"})],kt.prototype,"requestSupportsAdvancedSearch",void 0),(0,i.Cg)([(0,n.attr)({attribute:"value-key"})],kt.prototype,"valueKey",void 0),(0,i.Cg)([(0,n.attr)({attribute:"label-key"})],kt.prototype,"labelKey",void 0),(0,i.Cg)([(0,n.attr)({attribute:"dropdown-placement"})],kt.prototype,"dropdownPlacement",void 0),(0,i.Cg)([n.attr],kt.prototype,"dropdownWidth",void 0),(0,i.Cg)([n.observable],kt.prototype,"request",void 0),(0,i.Cg)([n.observable],kt.prototype,"columnDefinitions",void 0),(0,i.Cg)([n.observable],kt.prototype,"baseCriteria",void 0),(0,i.Cg)([n.observable],kt.prototype,"defaultSlottedNodes",void 0),(0,i.Cg)([n.observable],kt.prototype,"filterSearch",void 0),(0,i.Cg)([n.observable],kt.prototype,"open",void 0),(0,i.Cg)([n.observable],kt.prototype,"selectedRow",void 0),(0,i.Cg)([n.volatile],kt.prototype,"displayValue",null),(0,i.Cg)([n.volatile],kt.prototype,"hasSearchKey",null),(0,i.Cg)([n.volatile],kt.prototype,"hasSlottedContent",null);const Dt=kt.compose({baseName:"multicolumn-dropdown",template:Et,styles:ft}),xt=kt.compose({baseName:"multicolumn-dropdown",template:St("rapid"),styles:ft});var Gt=a(3299),Ot=a(70349),Pt=a(91327),Tt=a(35610),Lt=a(30335),It=a(49568);const $t={foundationIconRenderer:$.qN,foundationGridProActionRenderer:w._X,foundationGridProActionsMenuRenderer:k.su,foundationAgBooleanRenderer:G.fg,foundationAgTextRenderer:ot.G4,foundationAgTextFieldRenderer:Ot.wG,foundationAgEditableRenderer:T.r8,foundationAgSelectRenderer:F.bE,foundationSelectEditor:d.RU,foundationNumberEditor:c.CY,foundationDateEditor:b.vr,foundationMultiselectEditor:u.UH,foundationStringEditor:C.cb,foundationMulticolumnDropdown:Dt,foundationStatusPillRenderer:B.a1,StatusPillRenderer:B.N7,foundationGridPro:r.RB,register(e,...t){if(e)for(const a in this)"register"!==a&&this[a]().register(e,...t)}};var Nt=a(92277);const _t=/^(?:[A-Za-z0-9+/]{4})*?(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Ft=e=>{const t=e.split(":");let a,i;2===t.length?[a,i]=t:i=e;const r=(e=>{if(_t.test(e)){const t=atob(e),a=new Uint8Array(t.length);return[...t].forEach((e,i)=>{a[i]=t.charCodeAt(i)}),a.buffer}return e})(i);if("str"===a){return new TextDecoder("utf-8").decode(r)}return r},zt=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}`:""},Mt={account:"genesis",namespace:"default",authKey:"kv-default",authEmail:void 0},Bt=re.DI.createInterface();var Ht,Vt;!function(e){e.REQ_KEY_VALUE_LIST="REQ_KEY_VALUE_LIST",e.REQ_KEY_VALUE_READ="REQ_KEY_VALUE_READ"}(Ht||(Ht={})),function(e){e.EVENT_KEY_VALUE_PUT="EVENT_KEY_VALUE_PUT",e.EVENT_KEY_VALUE_DELETE="EVENT_KEY_VALUE_DELETE"}(Vt||(Vt={}));let Ut=class{constructor(e,t,a=Mt){this.connect=e,this.user=t,this.kvStorageConfig=a}delete(e){return(0,i.sH)(this,void 0,void 0,function*(){const t={DETAILS:{KEYS:e}},a=yield this.connect.commitEvent(Vt.EVENT_KEY_VALUE_DELETE,t);return!(!a||"EVENT_ACK"!==a.MESSAGE_TYPE)||{ERROR:a.ERROR,WARNING:a.WARNING}})}get(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;const a={REQUEST:{USER_NAME:null!==(t=this.kvStorageConfig.authEmail)&&void 0!==t?t:this.user.userName,KEY:e}},i=yield this.connect.request(Ht.REQ_KEY_VALUE_READ,a);if(i&&i.REPLY&&i.REPLY.length>0){const t=i.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=Ft(e);return"string"==typeof t&&t.startsWith("str:")&&(t=Ft(t)),"string"==typeof t&&t.startsWith("bin:")&&(t=Ft(t)),t}list(){return(0,i.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}},a=yield this.connect.request(Ht.REQ_KEY_VALUE_LIST,t);if(a&&a.REPLY&&a.REPLY.length>0){return a.REPLY.map(e=>e.KEY)}return[]})}put(e){return(0,i.sH)(this,void 0,void 0,function*(){const t={DETAILS:{RECORDS:e.map(e=>({KEY:e.key,VALUE:e.base64?zt(e.value):e.value}))}},a=yield this.connect.commitEvent(Vt.EVENT_KEY_VALUE_PUT,t);return!(!a||"EVENT_ACK"!==a.MESSAGE_TYPE)||{ERROR:a.ERROR,WARNING:a.WARNING}})}};Ut=(0,i.Cg)([(0,i.Qj)(0,lt.dm),(0,i.Qj)(1,Nt.KJ),(0,i.Qj)(2,(0,re.optional)(Bt))],Ut);const Xt=re.DI.createInterface(e=>e.singleton(Ut));var Kt=a(98316);class Yt{getColumnState(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;yield this.migrateLocalStorageToKVStorage(e);const a=yield this.kvStorage.get(e),i=a?null===(t=a.kv)||void 0===t?void 0:t.value:void 0;return i?JSON.parse(i):[]})}saveColumnState(e,t){return(0,i.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(t)}])})}deleteColumnState(e){return(0,i.sH)(this,void 0,void 0,function*(){this.kvStorage.delete([e])})}migrateLocalStorageToKVStorage(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;const a=yield this.kvStorage.get(e);if(a&&(null===(t=a.kv)||void 0===t?void 0:t.value))return;const i=this.session.getLocalStorageItem("gridOptions"),r=i?JSON.parse(i)[e]:void 0;r&&(Ze.v.debug(`Columns state migration for key: ${e} from LocalStorage to KV Storage`),this.kvStorage.put([{key:e,value:r}]))})}getFilterModel(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;const a=yield this.kvStorage.get(e),i=a?null===(t=a.kv)||void 0===t?void 0:t.value:void 0;return i?JSON.parse(i):{}})}saveFilterModel(e,t){return(0,i.sH)(this,void 0,void 0,function*(){this.kvStorage.put([{key:e,value:JSON.stringify(t)}])})}}(0,i.Cg)([Xt],Yt.prototype,"kvStorage",void 0),(0,i.Cg)([Kt.N],Yt.prototype,"session",void 0);var jt=a(11749);const Wt=s.SwatchRGB.from((0,oe.parseColorHexRGB)("#4c4c4c")),qt=s.SwatchRGB.from((0,oe.parseColorHexRGB)("#c01754")),{create:Qt}=re.DesignToken,Jt={foregroundColor:Qt("fui-ag-foreground-color").withDefault(qt),backgroundColor:Qt("fui-ag-background-color").withDefault(Wt)};var Zt=a(68858),ea=a(49874);const ta={processCellCallback:e=>["+","=","-","@","\t","\n"].some(t=>String(e.value).startsWith(t))?`'${e.value}`:e.value}}}]);
|
|
969
|
-
//# sourceMappingURL=628.
|
|
969
|
+
//# sourceMappingURL=628.bff2c98df2a002e2c46e2119ee551aa0.js.map
|