udp-stencil-component-library 25.18.2 → 25.18.3-beta.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/cjs/ag-grid-base_6.cjs.entry.js +5 -2
- package/dist/collection/components/grid/new-grid/ag-grid-base.js +5 -2
- package/dist/components/ag-grid-base2.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/ag-grid-base_6.entry.js +5 -2
- package/dist/stencil-library/ag-grid-base_6.entry.js +1 -1
- package/package.json +2 -2
|
@@ -997,11 +997,14 @@ const AgGridBase = class {
|
|
|
997
997
|
this.updateGridHeight();
|
|
998
998
|
this.resizeObserver = new ResizeObserver(this.scheduleHeightUpdate);
|
|
999
999
|
this.resizeObserver.observe(this.gridContainerEl);
|
|
1000
|
+
window.addEventListener('resize', this.scheduleHeightUpdate);
|
|
1000
1001
|
}
|
|
1001
1002
|
}
|
|
1002
1003
|
disconnectedCallback() {
|
|
1003
|
-
var _a;
|
|
1004
|
+
var _a, _b;
|
|
1004
1005
|
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1006
|
+
(_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1007
|
+
window.removeEventListener('resize', this.scheduleHeightUpdate);
|
|
1005
1008
|
}
|
|
1006
1009
|
handleUpdateColumnDefs(newVal, prevVal) {
|
|
1007
1010
|
if (isEqual__default.default(newVal, prevVal)) {
|
|
@@ -1022,7 +1025,7 @@ const AgGridBase = class {
|
|
|
1022
1025
|
render() {
|
|
1023
1026
|
var _a;
|
|
1024
1027
|
const variantClass = `variant-${((_a = this.headerConfig) === null || _a === void 0 ? void 0 : _a.variant) || 'light'}`;
|
|
1025
|
-
return (index.h("div", { key: '
|
|
1028
|
+
return (index.h("div", { key: 'bcbd0fe1693a169eac2d3eaa43ec8021d781071d', class: variantClass, ref: el => (this.gridContainerEl = el) }, index.h("ghost-render", { key: 'a9eb1234b76fa9937e34cd468a0335cea2b36444' }, index.h("div", { key: 'a7dfd166a485a1093828b9fa1b327081223b9ff7' }, index.h("udp-dialog", { key: '5e4ee01cf0d8ff4bab63107b5eaed5fe826bd6a9' }), index.h("udp-list-item", { key: '6b1a02b2f37e9f4805768d37fa0b8a00b4689d30' }), index.h("hint-panel", { key: '4624370fe64ca7eb304c09aec59e8c80d335a2c0' }), index.h("udp-side-sheet", { key: 'dd7a83b3a87d17b397a4198a5f0160e1bb07ac20' }))), index.h("div", { key: '72fd3f9ccbb67b47418af4ed3d419406f4be6928', class: "grid-base-header" }, index.h("grid-header", { key: '91476b641388c546da6addc4463906ce4652013b', headerConfig: this.headerConfig, gridFunctions: this.gridFunctions, onHeaderAction: this.onHeaderAction }), index.h("div", { key: 'af9718f0931f15691a35bd99b4232c2fc70d1da5', class: "action-bar", style: { viewTransitionName: `action-bar` } }, this.gridFunctionInstances.map(fn => { var _a; return (_a = fn.render) === null || _a === void 0 ? void 0 : _a.call(fn); }))), index.h("div", { key: 'b1eee4354e580529fff3af958ba7c1f3fd8926fb', id: "myNewGrid", ref: el => (this.gridEl = el), style: {
|
|
1026
1029
|
viewTransitionName: `my-new-grid`,
|
|
1027
1030
|
} })));
|
|
1028
1031
|
}
|
|
@@ -126,11 +126,14 @@ export class AgGridBase {
|
|
|
126
126
|
this.updateGridHeight();
|
|
127
127
|
this.resizeObserver = new ResizeObserver(this.scheduleHeightUpdate);
|
|
128
128
|
this.resizeObserver.observe(this.gridContainerEl);
|
|
129
|
+
window.addEventListener('resize', this.scheduleHeightUpdate);
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
disconnectedCallback() {
|
|
132
|
-
var _a;
|
|
133
|
+
var _a, _b;
|
|
133
134
|
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
135
|
+
(_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
136
|
+
window.removeEventListener('resize', this.scheduleHeightUpdate);
|
|
134
137
|
}
|
|
135
138
|
handleUpdateColumnDefs(newVal, prevVal) {
|
|
136
139
|
if (isEqual(newVal, prevVal)) {
|
|
@@ -151,7 +154,7 @@ export class AgGridBase {
|
|
|
151
154
|
render() {
|
|
152
155
|
var _a;
|
|
153
156
|
const variantClass = `variant-${((_a = this.headerConfig) === null || _a === void 0 ? void 0 : _a.variant) || 'light'}`;
|
|
154
|
-
return (h("div", { key: '
|
|
157
|
+
return (h("div", { key: 'bcbd0fe1693a169eac2d3eaa43ec8021d781071d', class: variantClass, ref: el => (this.gridContainerEl = el) }, h("ghost-render", { key: 'a9eb1234b76fa9937e34cd468a0335cea2b36444' }, h("div", { key: 'a7dfd166a485a1093828b9fa1b327081223b9ff7' }, h("udp-dialog", { key: '5e4ee01cf0d8ff4bab63107b5eaed5fe826bd6a9' }), h("udp-list-item", { key: '6b1a02b2f37e9f4805768d37fa0b8a00b4689d30' }), h("hint-panel", { key: '4624370fe64ca7eb304c09aec59e8c80d335a2c0' }), h("udp-side-sheet", { key: 'dd7a83b3a87d17b397a4198a5f0160e1bb07ac20' }))), h("div", { key: '72fd3f9ccbb67b47418af4ed3d419406f4be6928', class: "grid-base-header" }, h("grid-header", { key: '91476b641388c546da6addc4463906ce4652013b', headerConfig: this.headerConfig, gridFunctions: this.gridFunctions, onHeaderAction: this.onHeaderAction }), h("div", { key: 'af9718f0931f15691a35bd99b4232c2fc70d1da5', class: "action-bar", style: { viewTransitionName: `action-bar` } }, this.gridFunctionInstances.map(fn => { var _a; return (_a = fn.render) === null || _a === void 0 ? void 0 : _a.call(fn); }))), h("div", { key: 'b1eee4354e580529fff3af958ba7c1f3fd8926fb', id: "myNewGrid", ref: el => (this.gridEl = el), style: {
|
|
155
158
|
viewTransitionName: `my-new-grid`,
|
|
156
159
|
} })));
|
|
157
160
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,p as i,H as e,c as s,t as o}from"./index2.js";import{ModuleRegistry as n,themeQuartz as r,createGrid as a}from"ag-grid-community-v33";import{AllEnterpriseModule as d,LicenseManager as l}from"ag-grid-enterprise-v33";import{x as h,i as c,s as u,u as p,p as v,y as m,w as g,o as b}from"./apiUtils.js";import{g as f,d as y}from"./udp-icon2.js";import{C as _}from"./configService.js";import{g as w}from"./tenantUtils.js";import{S as x,I as C,D as S,C as k,A as O}from"./status-renderer.js";import j from"lodash/isEqual";import{d as N}from"./ghost-render2.js";import{d as A}from"./grid-header2.js";import{d as E}from"./hint-panel2.js";import{d as T}from"./stencil-icon-button2.js";import{d as D}from"./udp-ambient-tool-tip2.js";import{d as R}from"./udp-avatar2.js";import{d as M}from"./udp-badge2.js";import{d as F}from"./udp-button2.js";import{d as J}from"./udp-chip2.js";import{d as $}from"./udp-dialog2.js";import{d as I}from"./udp-icon-button2.js";import{d as G}from"./udp-linear-loader2.js";import{d as B}from"./list-item.js";import{d as V}from"./udp-menu2.js";import{d as L}from"./udp-menu-item2.js";import{d as P}from"./udp-pop-over2.js";import{d as U}from"./udp-side-sheet2.js";import{d as H}from"./unity-typography2.js";function z(){return sessionStorage.getItem("user-id")}const W=async t=>{(null===document||void 0===document?void 0:document.startViewTransition)?(document.viewTransition&&await document.viewTransition.finished,document.startViewTransition(t)):t()};function q(){return sessionStorage.getItem("current-api-catalog-id")}const K={agGridExport:class{constructor(t="export.csv"){this.fileName=t}init(t){this.gridApi=t}onAction(t){"agGridExport"===t&&this.gridApi.exportDataAsCsv({fileName:this.fileName})}},openSavedViews:class{constructor(){this.isSidesheetOpen=!1,this.isDialogOpen=!1,this.viewName="",this.viewIsPrivate=!0,this.filteredViews=[],this.allViewData=[],this.activeView=null,this.loading=0,this.initialLoad=!0,this.addStateChangeListeners=()=>{this.api.addEventListener("columnVisible",this.handleManualColumnChange),this.api.addEventListener("columnPinned",this.handleManualColumnChange),this.api.addEventListener("columnMoved",this.handleManualColumnChange),this.api.addEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.addEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.addEventListener("columnsReset",this.handleManualColumnChange),this.api.addEventListener("filterChanged",this.handleManualColumnChange),this.api.addEventListener("sortChanged",this.handleManualColumnChange)},this.removeStateChangeListeners=()=>{this.api.removeEventListener("columnVisible",this.handleManualColumnChange),this.api.removeEventListener("columnPinned",this.handleManualColumnChange),this.api.removeEventListener("columnMoved",this.handleManualColumnChange),this.api.removeEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.removeEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.removeEventListener("columnsReset",this.handleManualColumnChange),this.api.removeEventListener("filterChanged",this.handleManualColumnChange),this.api.removeEventListener("sortChanged",this.handleManualColumnChange)},this.fetchViews=async()=>{var t,i;0!==(null===(t=this.api.getColumnDefs())||void 0===t?void 0:t.length)&&(this.loading=1,this.refresh(),this.api.removeEventListener("gridColumnsChanged",this.fetchViews),this.gridId=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,this.gridId&&(this.allViewData=await h(z(),this.gridId),this.filterData(),this.initialLoad&&this.setDefaultView()),this.loading=0)},this.setDefaultView=()=>{const t=this.filteredViews.find((t=>null==t?void 0:t.isDefault));t&&this.setActiveView(t),this.initialLoad=!1},this.filterData=()=>{var t,i;this.entityName=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.entityName,this.filteredViews=this.entityName?null===(i=this.allViewData)||void 0===i?void 0:i.filter((t=>(null==t?void 0:t.domain)===this.entityName)):this.allViewData,this.refresh()},this.setActiveView=t=>{var i,e;this.removeStateChangeListeners();const s=null===(i=null==t?void 0:t.gridViewGridViewGridConfiguration)||void 0===i?void 0:i.find((t=>1===t.gridViewGridConfigurationGridConfiguration.gridStateTypeId)),o=null===(e=null==t?void 0:t.gridViewGridViewGridConfiguration)||void 0===e?void 0:e.find((t=>4===t.gridViewGridConfigurationGridConfiguration.gridStateTypeId));if(s){const t={state:JSON.parse(s.gridViewGridConfigurationGridConfiguration.values),applyOrder:!0};this.api.applyColumnState(t)}this.api.setFilterModel(o?JSON.parse(o.gridViewGridConfigurationGridConfiguration.values):null),this.handleSidesheetClose(),W((()=>{this.activeView=t,this.refresh(),setTimeout(this.addStateChangeListeners,300)}))},this.deleteView=async t=>{this.loading=1,this.refresh(),await c(t.gridViewId,(()=>{this.fetchViews()})),this.loading=0,this.refresh()},this.postViewCallback=()=>{this.loading=0,this.fetchViews(),this.handleDialogClose()},this.removeActiveView=()=>{this.removeStateChangeListeners(),this.api.resetColumnState(),this.api.setFilterModel(null),W((()=>{this.activeView=null,this.refresh()}))},this.handleManualColumnChange=async()=>{this.removeStateChangeListeners(),this.activeView&&W((()=>{this.activeView=null,this.refresh()}))},this.handleNameChange=t=>{this.viewName=t.target.value,this.refresh()},this.handleViewIsPrivateToggleChange=()=>{this.viewIsPrivate=!this.viewIsPrivate,this.refresh()},this.handleSidesheetClose=()=>{this.isSidesheetOpen=!1,this.refresh()},this.handleDialogClose=()=>{this.isDialogOpen=!1,this.viewName="",this.refresh()},this.handleOpenModal=()=>{this.isDialogOpen=!0,this.refresh()}}init(t,i){this.api=t,this.refresh=i,this.api.addEventListener("gridColumnsChanged",this.fetchViews)}onAction(t){if("openSavedViews"===t){const t=this.api.getGridOption("context");(null==t?void 0:t.gridId)!==this.gridId?this.fetchViews():(null==t?void 0:t.entityName)!==this.entityName&&this.filterData(),this.isSidesheetOpen=!0,this.refresh()}}async postView(){var t,i;this.loading=1,this.refresh();const e=[];e.push({gridStateTypeId:1,gridId:null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,values:JSON.stringify(this.api.getColumnState())}),e.push({gridStateTypeId:4,gridId:null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,values:JSON.stringify(this.api.getFilterModel())});const s=this.api.getGridOption("context");try{await u(z(),null==s?void 0:s.gridId,q(),this.viewName,null==s?void 0:s.entityName,e,!0===this.viewIsPrivate?1:2,0,this.postViewCallback)}catch(t){console.error(t)}finally{this.refresh()}}async updateViewMarkedAsPrimary(t){this.loading=1,this.refresh();const i=this.api.getGridOption("context"),e=null==t?void 0:t.isDefault;await p(null==t?void 0:t.gridViewId,z(),null==i?void 0:i.gridId,q(),null==t?void 0:t.name,e?0:1,null==i?void 0:i.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).then((async()=>{if(!e){const t=this.filteredViews.find((t=>null==t?void 0:t.isDefault));t&&await p(null==t?void 0:t.gridViewId,z(),null==i?void 0:i.gridId,q(),null==t?void 0:t.name,0,null==i?void 0:i.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).catch((t=>console.log(t)))}await this.fetchViews(),this.loading=0,this.refresh()})).catch((t=>console.log(t)))}render(){var i,e;return t("div",null,t("div",{style:{viewTransitionName:"active-view-chip"},class:"grid-action-transition"},this.activeView&&t("div",{style:{margin:"4px"}},t("udp-chip",{label:null===(i=this.activeView)||void 0===i?void 0:i.name,variant:"filled",color:"secondary",deleteButton:!0,onChipDelete:this.removeActiveView}))),t("udp-dialog",{open:this.isDialogOpen,actionOne:()=>{this.postView()},actionTwo:this.handleDialogClose,handleClose:this.handleDialogClose,labelOne:"Create View",labelTwo:"Cancel",title:"Create a grid view",message:"The view will be created from the current column and filter state.",disableOne:!this.viewName,progress:this.loading},t("div",{style:{display:"flex",flexDirection:"column"}},t("div",{style:{marginBottom:"-4px",marginTop:"2em"}},t("text-field",{value:this.viewName,onInput:this.handleNameChange,placeholder:"View name"})),t("div",{style:{marginTop:"-4px"}},t("stencil-toggle",{label:"Private",checked:this.viewIsPrivate,onChange:this.handleViewIsPrivateToggleChange})))),t("udp-side-sheet",{title:"Views",open:this.isSidesheetOpen,position:"right",onUdpSideSheetClose:this.handleSidesheetClose,headerActionButtonLabel:"Create View",onUdpHeaderActionButtonClick:this.handleOpenModal,headerActionButtonIcon:"add",loading:!!this.loading},t("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},t("hint-panel",{hint:"Quickly access and manage your pre-configured grid views. These views are designed to help you focus on specific sets of data and streamline your workflow.",hideHintText:"Dismiss"}),this.entityName&&t("hint-panel",{hint:"Note: Displaying entity specific views."}),t("div",null,(null===(e=this.filteredViews)||void 0===e?void 0:e.length)>0?this.filteredViews.map((i=>{var e;return t("udp-list-item",{primaryText:i.name,clickable:!0,onListItemClick:()=>this.setActiveView(i)},t("div",{style:{display:"flex",flexDirection:"row",gap:"4px"},slot:"status-chip"},(null===(e=this.activeView)||void 0===e?void 0:e.gridViewId)===i.gridViewId&&t("udp-chip",{label:"Active",color:"success",variant:"filled"}),1===i.gridViewVisibilityTypeId&&t("udp-chip",{label:"Private",color:"gray",variant:"outlined"})),t("div",{slot:"actions"},t("udp-icon-button",{icon:f("star"),size:"small",variant:i.isDefault?"contained":"text",tooltip:2===i.gridViewVisibilityTypeId?"Cannot mark public view as primary":i.isDefault?"Remove as primary":"Mark as primary",onClick:()=>this.updateViewMarkedAsPrimary(i),disabled:2===i.gridViewVisibilityTypeId}),t("udp-icon-button",{icon:f("trashCan"),size:"small",variant:"text",tooltip:i.userId!==z()?"Cannot delete public view with different owner":"Delete View",onClick:()=>this.deleteView(i),disabled:i.userId!==z()})))})):t("udp-empty-state-display",{primaryText:"No Views to display"})))))}},agGridSizeColumnsToFit:class{init(t){this.gridApi=t}onAction(t){"agGridSizeColumnsToFit"===t&&this.gridApi.sizeColumnsToFit()}},agGridAutoSizeColumns:class{init(t){this.gridApi=t}onAction(t){"agGridAutoSizeColumns"===t&&this.gridApi.autoSizeAllColumns()}},bulkActions:class{constructor(){this.bulkActions=[],this.selectedRowCount=0,this.fetchedData=!1,this.isMenuOpen=!1,this.onRowSelectionChanged=()=>{var t;W((()=>{const t=this.api.getSelectedRows();this.selectedRows=t,this.selectedRowCount=t.length,this.refresh()})),this.fetchedData&&(null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId)===this.gridId||this.fetchBulkActions()},this.setBulkActions=t=>{const i=t.map((t=>({label:t.name,onClick:()=>this.executeActionProviderAction(t.actionId)}))),e=this.localFunctions.map((t=>({label:t.label,onClick:()=>this.executeLocalFunction(t.label)})));this.bulkActions=[...i,...e],this.fetchedData=!0,this.refresh()},this.executeLocalFunction=t=>{const i=this.localFunctions.find((i=>i.label===t));i&&i.callback(this.selectedRows),this.refresh()},this.executeActionProviderAction=t=>{this.actionProviderCallback&&this.actionProviderCallback(t,this.selectedRows),this.refresh()},this.toggleMenu=()=>{this.isMenuOpen=!this.isMenuOpen,this.refresh()},this.closeMenu=()=>{this.isMenuOpen=!1,this.refresh()}}init(t,i,e){this.api=t,this.refresh=i,this.actionProviderCallback=null==e?void 0:e.actionProviderCallback,this.localFunctions=null==e?void 0:e.localFunctions;const s=this.api.getGridOption("rowModelType");this.api.setGridOption("rowSelection","clientSide"===s?{mode:"multiRow",enableClickSelection:!0}:{mode:"multiRow",enableClickSelection:!0,headerCheckbox:!1}),this.api.addEventListener("selectionChanged",this.onRowSelectionChanged)}onAction(t){"executeBulkAction"===t&&this.refresh()}async fetchBulkActions(){var t;try{this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,await v(this.gridId,!1,[],this.setBulkActions)}catch(t){console.error(t)}}render(){var i;return t("div",{style:{viewTransitionName:"bulk-action-button"},class:"grid-action-transition"},this.selectedRowCount>0&&[t("div",{style:{margin:"2px"}},t("udp-button",{ref:t=>{this.menuAnchorEl=t||void 0},onClick:this.toggleMenu,variant:"outlined",color:"primary",endIcon:t("udp-icon",{iconName:"chevronDown",style:{transform:this.isMenuOpen?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"}})},`${this.selectedRowCount} Selected`)),t("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:this.closeMenu},0===(null===(i=this.bulkActions)||void 0===i?void 0:i.length)?t("udp-menu-item",{label:"No available actions"}):this.bulkActions.map((i=>t("udp-menu-item",{label:i.label,onItemClick:()=>{i.onClick(),this.isMenuOpen=!1}}))))])}},chipFilter:class{constructor(){this.handleFilterChanged=t=>{var i,e,s;const o=null===(e=null===(i=null==t?void 0:t.columns)||void 0===i?void 0:i[0])||void 0===e?void 0:e.colId,n=null===(s=this.filterChips)||void 0===s?void 0:s.find((t=>t.field===o));if(n){const t=this.api.getColumnFilterModel(o),i=Object.assign(Object.assign({},n),{filterObjects:n.filterObjects.map((i=>{let e=!1;return(null==t?void 0:t.conditions)&&"AND"===(null==t?void 0:t.operator)?e=t.conditions.some((t=>JSON.stringify(t)===JSON.stringify(i.agGridFilterModel[o]))):t&&(e=JSON.stringify(t)===JSON.stringify(i.agGridFilterModel[o])),Object.assign(Object.assign({},i),{toggled:e})}))});this.filterChips=this.filterChips.map((t=>t.field===o?i:t)),this.refresh()}},this.syncChipsWithGridFilters=()=>{if(!this.filterChips||0===this.filterChips.length)return;const t=this.filterChips.map((t=>{const i=t.field,e=this.api.getColumnFilterModel(i);if(!e)return t;const s=t.filterObjects.map((t=>{let s=!1;return s=(null==e?void 0:e.conditions)&&"AND"===(null==e?void 0:e.operator)?e.conditions.some((e=>JSON.stringify(e)===JSON.stringify(t.agGridFilterModel[i]))):JSON.stringify(e)===JSON.stringify(t.agGridFilterModel[i]),Object.assign(Object.assign({},t),{toggled:s})}));return Object.assign(Object.assign({},t),{filterObjects:s})}));this.filterChips=t},this.getGridfilterChips=async()=>{var t,i;if(this.gridId!==(null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId)){this.gridId=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId;const t=(await m(this.gridId,7)).map((t=>JSON.parse(t.values)));W((async()=>{this.filterChips=t.map((t=>Object.assign(Object.assign({},t),{filterObjects:t.filterObjects.map((t=>Object.assign(Object.assign({},t),{toggled:!1})))}))),this.syncChipsWithGridFilters(),this.getFilterChipCounts(),this.refresh()}))}},this.getFilterChipCounts=async()=>{var t;const i={pageNumber:1,pageSize:1,filterElements:[],filterGroups:[],orderElements:[],groupingType:"",groupProperty:[],groupOperationList:[],eagerLoad:!1,logicalSearchOperator:1},e=[];for(const s of this.filterChips){if(!(null==s?void 0:s.udpDomainSanitizedName))continue;const o=await g(q(),s.udpDomainSanitizedName,!0);for(const n of null!==(t=s.filterObjects)&&void 0!==t?t:[])(null==n?void 0:n.udpFilterElement)&&e.push((async()=>{var t;const e=Object.assign(Object.assign({},i),{filterElements:[n.udpFilterElement]});return{result:await b(e,null===(t=null==o?void 0:o.unityBaseSearchMethod)||void 0===t?void 0:t.apiMethodId,_.config.UNITY_API_DOMAIN,!1),groupField:s.field,objLabel:n.label}})())}const s=await Promise.all(e);this.filterChips=this.filterChips.map((t=>{const i=s.filter((i=>i.groupField===t.field));return Object.assign(Object.assign({},t),{filterObjects:t.filterObjects.map((t=>{var e,s;const o=i.find((i=>i.objLabel===t.label));return Object.assign(Object.assign({},t),{resultCount:null!==(s=null===(e=null==o?void 0:o.result)||void 0===e?void 0:e.total)&&void 0!==s?s:null})}))})})),this.refresh()},this.setSelectedFilterChip=t=>{this.filterChips=this.filterChips.map((i=>Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>i.label===t.label?Object.assign(Object.assign({},i),{toggled:!i.toggled}):i))}))),this.refresh();const i=Object.keys(t.agGridFilterModel)[0];!function(t,i,e){var s,o;const n=t.getColumn(i);if(!n)return void console.error("Invalid column id provided for filtering");if(!(null===(s=null==n?void 0:n.colDef)||void 0===s?void 0:s.filter))return void console.error(`Filtering not enabled for column: ${null==n?void 0:n.colId}`);const r=t.getColumnFilterModel(i);if(JSON.stringify(e)!==JSON.stringify(r)){if(null===(o=null==r?void 0:r.conditions)||void 0===o?void 0:o.some((t=>JSON.stringify(t)===JSON.stringify(e)))){const s=null==r?void 0:r.conditions.filter((t=>JSON.stringify(t)!==JSON.stringify(e)));if(1===s.length)return void t.setColumnFilterModel(i,s[0]).then((()=>t.onFilterChanged()));{const e=Object.assign(Object.assign({},r),{conditions:s});return void t.setColumnFilterModel(i,e).then((()=>t.onFilterChanged()))}}if(r)if(null==r?void 0:r.conditions){const s=[...null==r?void 0:r.conditions,e];t.setColumnFilterModel(i,{conditions:s,operator:"AND"}).then((()=>t.onFilterChanged()))}else r&&t.setColumnFilterModel(i,{conditions:[Object.assign({},r),e],operator:"AND"}).then((()=>t.onFilterChanged()));else t.setColumnFilterModel(n,e).then((()=>t.onFilterChanged()))}else t.setColumnFilterModel(i,null).then((()=>t.onFilterChanged()))}(this.api,i,t.agGridFilterModel[i])}}init(t,i){this.api=t,this.refresh=i,this.api.addEventListener("firstDataRendered",this.getGridfilterChips),this.api.addEventListener("filterChanged",this.handleFilterChanged)}onAction(t){"chipFilter"===t&&this.refresh()}render(){var i;return t("div",{class:"grid-action-transition",style:{display:"flex",flexWrap:"nowrap",gap:"5px",viewTransitionName:"view-chip-filters"}},(null===(i=this.filterChips)||void 0===i?void 0:i.length)>0&&this.filterChips.map(((i,e)=>[e>0&&t("div",{style:{width:"1px",backgroundColor:"#ddd",marginBottom:"5px",marginTop:"5px"}}),t("div",{style:{padding:"4px",display:"flex",flexWrap:"nowrap",gap:"3px"}},i.filterObjects.map((i=>t("udp-chip",{label:`${i.label} ${null!=i.resultCount?`(${i.resultCount})`:""}`,variant:i.toggled?"filled":"outlined",clickable:!0,onChipClick:()=>this.setSelectedFilterChip(i),color:"primary"}))))])))}},restoreGridState:class{constructor(){this.getPreviousState=()=>{W((()=>{this.api.removeEventListener("stateUpdated",this.saveState);const t=this.api.getGridOption("context");this.gridId=null==t?void 0:t.gridId,this.apiMethodInstanceId=(null==t?void 0:t.apiMethodInstanceId)||"",this.previousState=JSON.parse(localStorage.getItem(this.getStorageKey())),this.refresh(),this.api.addEventListener("stateUpdated",this.saveState)}))},this.getStorageKey=()=>{const t=w();return`saved-grid-state-${this.gridId}-${this.apiMethodInstanceId}-${t}`},this.saveState=()=>{const t=this.api.getGridOption("context");if((null==t?void 0:t.gridId)!==this.gridId||(null==t?void 0:t.apiMethodInstanceId)&&(null==t?void 0:t.apiMethodInstanceId)!==this.apiMethodInstanceId)this.getPreviousState();else{const t=this.api.getState();localStorage.setItem(this.getStorageKey(),JSON.stringify({date:new Date,state:t}))}},this.restoreState=async()=>{this.api.setState(this.previousState.state),setTimeout((()=>W((()=>{this.previousState=null,this.refresh()}))),0)},this.dismissMessage=()=>{W((()=>{this.previousState=null,this.refresh()}))}}init(t,i){this.api=t,this.refresh=i,this.api.addEventListener("firstDataRendered",this.getPreviousState)}getTimeAgo(t){const i=Math.floor((Date.now()-t.getTime())/1e3);if(i<60)return`${i} second${1!==i?"s":""} ago`;const e=Math.floor(i/60);if(e<60)return`${e} minute${1!==e?"s":""} ago`;const s=Math.floor(e/60);if(s<24)return`${s} hour${1!==s?"s":""} ago`;const o=Math.floor(s/24);return`${o} day${1!==o?"s":""} ago`}render(){var i;return t("div",{style:{viewTransitionName:"restore-grid-state"}},(null===(i=this.previousState)||void 0===i?void 0:i.date)&&t("div",{style:{margin:"4px"}},t("udp-ambient-tool-tip",{content:`Restore grid state from ${this.getTimeAgo(new Date(this.previousState.date))}?`},t("udp-chip",{startIcon:"rotate",label:"Restore state",variant:"outlined",color:"gray",deleteButton:!0,onChipDelete:this.dismissMessage,clickable:!0,onClick:this.restoreState}))))}},agGridResetColumns:class{init(t){this.gridApi=t}onAction(t){"agGridResetColumns"===t&&(this.gridApi.resetColumnState(),this.gridApi.setFilterModel(null))}},advancedSearch:class{init(t,i,e){this.onOpenCallback=null==e?void 0:e.callback}onAction(t){var i;"advancedSearch"===t&&(null===(i=this.onOpenCallback)||void 0===i||i.call(this))}},agGridHideShowColumns:class{init(t){this.gridApi=t}onAction(t){"agGridHideShowColumns"===t&&this.gridApi.showColumnChooser()}},udpExport:class{init(t,i,e){this.onOpenCallback=null==e?void 0:e.callback,this.api=t}onAction(t){var i;if("udpExport"===t){const t=this.api.getGridOption("context");null===(i=this.onOpenCallback)||void 0===i||i.call(this,null==t?void 0:t.searchObject,null==t?void 0:t.entityName)}}}};function Q(t,i=!1){return t.map((t=>{var e,s,o,n,r;if("actions"===t.field){const i=(null===(s=null===(e=t.cellRendererParams)||void 0===e?void 0:e.actionList)||void 0===s?void 0:s.length)>5?5:null===(n=null===(o=t.cellRendererParams)||void 0===o?void 0:o.actionList)||void 0===n?void 0:n.length;if(0===i)return t;let r=30*i+4*(i-1)+40;return r<80&&(r=80),Object.assign(Object.assign({},t),{pinned:"right",width:r,minWidth:r,maxWidth:r,sortable:!1,filter:!1,suppressHeaderMenuButton:!0,suppressMovable:!0})}return(null===(r=null==t?void 0:t.context)||void 0===r?void 0:r.lookupId)&&(t.valueGetter=i=>i.data[(null==t?void 0:t.field)+"LookupValue"],t.filter=!1,t.sortable=!1),i&&(t.filter=!1),t}))}const Y=t=>{const i=t.value;if(null==i)return"";const e=new Date(i);return e?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`:""},X=r.withParams({wrapperBorderRadius:0,wrapperBorder:!1,headerCellHoverBackgroundColor:"var(--udp-grid-column-header-bg-hover)",borderColor:"#E9ECEF"}),Z=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.gridReady=s(this,"gridReady"),this.headerConfig={},this.gridFunctions=[],this.refreshKey=0,this.gridFunctionInstances=[],this.updateGridHeight=()=>{if(this.gridEl){const t=this.gridEl.getBoundingClientRect(),i=window.innerHeight-t.top,e=10;this.gridEl.style.height=(i-e>400?i-e:400)+"px"}},this.scheduleHeightUpdate=()=>{clearTimeout(this.resizeDebounce),this.resizeDebounce=setTimeout(this.updateGridHeight,100)},this.refreshGridFunctions=()=>{this.refreshKey++},this.onGridReady=t=>{this.gridApi=t.api,this.updateGridContextValues(),this.gridFunctionInstances=this.gridFunctions.map((t=>{const i=K[t.name];if(!i)return null;const e=new i;return e.init(this.gridApi,this.refreshGridFunctions,t.params),e})).filter((t=>!!t)),this.gridApiCallback&&this.gridApiCallback({refreshServerSide:()=>this.gridApi.refreshServerSide(),getSelectedRows:()=>this.gridApi.getSelectedRows(),getSelectedNodes:()=>this.gridApi.getSelectedNodes(),getSearchObject:()=>{var t;return null===(t=this.gridApi.getGridOption("context"))||void 0===t?void 0:t.searchObject},getEntityName:()=>{var t;return null===(t=this.gridApi.getGridOption("context"))||void 0===t?void 0:t.entityName},getRowCount:()=>{var t;return null===(t=this.gridApi.getGridOption("context"))||void 0===t?void 0:t.rowCount},getFilterModel:()=>this.gridApi.getFilterModel(),setFilterModel:t=>this.gridApi.setFilterModel(t),onFilterChanged:()=>this.gridApi.onFilterChanged(),expandAll:()=>this.gridApi.expandAll(),collapseAll:()=>this.gridApi.collapseAll(),toggleLoadingOverlay:t=>this.gridApi.setGridOption("loading",t),refreshCells:()=>this.gridApi.refreshCells(),refreshClientSideRowModel:t=>this.gridApi.refreshClientSideRowModel(t),selectAll:(t,i)=>this.gridApi.selectAll(t,i),deselectAll:(t,i)=>this.gridApi.deselectAll(t,i),getServerSideSelectionState:()=>this.gridApi.getServerSideSelectionState(),setServerSideSelectionState:t=>this.gridApi.setServerSideSelectionState(t),forEachNode:t=>this.gridApi.forEachNode(t),forEachNodeAfterFilterAndSort:t=>this.gridApi.forEachNodeAfterFilterAndSort(t)}),this.setColumnDefs(),this.gridReady.emit(this.gridApi)},this.onHeaderAction=t=>{this.gridFunctionInstances.forEach((i=>{var e;return null===(e=i.onAction)||void 0===e?void 0:e.call(i,t.detail.name,t.detail.payload)}))},this.updateGridContextValues=()=>{this.gridApi.setGridOption("context",Object.assign(Object.assign({},this.gridApi.getGridOption("context")),{entityName:this.entityName,gridId:this.gridId}))}}componentWillLoad(){n.registerModules([d]),l.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-080613}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Univerus_Software_Inc}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{MAIS_eRec}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{MAIS_eRec}_need_to_be_licensed___{MAIS_eRec}_has_not_been_granted_a_Deployment_License_Add-on___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{28_June_2026}____[v3]_[01]_MTc4MjYwMTIwMDAwMA==5c7d1487ecb13b28e75415d34b7cf694")}componentDidLoad(){var t,i,e,s;const o=Object.assign(Object.assign({tooltipShowMode:"whenTruncated",tooltipShowDelay:500},this.gridOptions),{columnTypes:{booleanChip:{cellRenderer:"iconRenderer",cellRendererParams:{iconMappingConfig:{true:{iconName:"checkMark24",color:"success"},false:{iconName:"close24",color:"error"}}}}},dataTypeDefinitions:{dateTimeString:{baseDataType:"dateTimeString",extendsDataType:"dateTimeString",valueFormatter:Y},boolean:{baseDataType:"boolean",extendsDataType:"boolean",columnTypes:"booleanChip"}},gridId:this.gridId,onGridReady:this.onGridReady,theme:X,components:Object.assign({actionsRenderer:O,currencyRenderer:k,dateTimeCellRenderer:S,iconRenderer:C,statusRenderer:x},null===(t=this.gridOptions)||void 0===t?void 0:t.components),domLayout:"normal",defaultColDef:Object.assign(Object.assign({sortable:!0,filter:!0,flex:1,minWidth:150,suppressHeaderMenuButton:!0},null===(i=this.gridOptions)||void 0===i?void 0:i.defaultColDef),{filterParams:Object.assign({buttons:["reset","apply"],closeOnApply:!0,maxNumConditions:10},null===(s=null===(e=this.gridOptions)||void 0===e?void 0:e.defaultColDef)||void 0===s?void 0:s.filterParams)})});a(this.el.querySelector("#myNewGrid"),o),this.gridHeight?this.gridEl.style.height=this.gridHeight:(this.updateGridHeight(),this.resizeObserver=new ResizeObserver(this.scheduleHeightUpdate),this.resizeObserver.observe(this.gridContainerEl))}disconnectedCallback(){var t;null===(t=this.gridApi)||void 0===t||t.destroy()}handleUpdateColumnDefs(t,i){j(t,i)||this.setColumnDefs()}setColumnDefs(){var t;if(this.columnDefs&&this.gridApi){const i=Q(this.columnDefs,null===(t=this.gridFunctions)||void 0===t?void 0:t.some((t=>"advancedSearch"===(null==t?void 0:t.name))));this.gridApi.setGridOption("columnDefs",i)}}handleEntityNameChange(){this.updateGridContextValues()}render(){var i;const e=`variant-${(null===(i=this.headerConfig)||void 0===i?void 0:i.variant)||"light"}`;return t("div",{key:"24fa82598a8b3c7cd8908d279dd5d55fa56fb059",class:e,ref:t=>this.gridContainerEl=t},t("ghost-render",{key:"5a135714392f7edb7fee6d2146e231971ed0ca93"},t("div",{key:"f8a3749c2bff52ca09f110152d2a0c9d61d8458c"},t("udp-dialog",{key:"7c245a75a383f6acc3df2eae99beb1eca1b0ce3b"}),t("udp-list-item",{key:"00c826a169725fe7950b5f48e6c6018554885eaf"}),t("hint-panel",{key:"e36c1b28357c275c6d71caa245a5e5dfc0dcf8a8"}),t("udp-side-sheet",{key:"26ce13c227185842de854c0dca352a5bae875038"}))),t("div",{key:"97ec4f0e8a4e464965fddc7d27807797bf9690b1",class:"grid-base-header"},t("grid-header",{key:"2af72231d327d5ff5c6b6c082ca24c8389b71db6",headerConfig:this.headerConfig,gridFunctions:this.gridFunctions,onHeaderAction:this.onHeaderAction}),t("div",{key:"b3464f54b3c57d19d2deaa673e7a6b483573fa6c",class:"action-bar",style:{viewTransitionName:"action-bar"}},this.gridFunctionInstances.map((t=>{var i;return null===(i=t.render)||void 0===i?void 0:i.call(t)})))),t("div",{key:"851c7e4d8f06734ad7a0e5e5119ed61eb8556c57",id:"myNewGrid",ref:t=>this.gridEl=t,style:{viewTransitionName:"my-new-grid"}}))}get el(){return this}static get watchers(){return{columnDefs:[{handleUpdateColumnDefs:0}],entityName:[{handleEntityNameChange:0}],gridId:[{handleEntityNameChange:0}]}}static get style(){return":root{--udp-grid-base-header-bg:#EBECEF;--udp-grid-base-header-text:#000;--udp-grid-action-divider-color:rgba(0, 0, 0, 0.3);--udp-grid-action-bar-border-color:rgb(202, 197, 197)}.variant-dark{--udp-grid-base-header-bg:var(--primary-color-dark);--udp-grid-action-bar-bg:#F8F9FA;--udp-grid-column-header-bg:#F8F9FA;--udp-grid-column-header-bg-hover:#dce6f2;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}.variant-light{--udp-grid-base-header-bg:#d8dfe6;--udp-grid-action-bar-bg:#f4f6f8;--udp-grid-column-header-bg:#f2f4f5;--udp-grid-column-header-bg-hover:#eef3f9;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}::view-transition-group(*){animation-duration:0.2s}.grid-base-header{background-color:var(--udp-grid-base-header-bg);color:var(--udp-grid-base-header-text)}.action-bar{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;background-color:var(--udp-grid-action-bar-bg);color:var(--udp-grid-action-bar-text-color);padding:0px 8px 0px 12px;border-bottom:1px solid var(--udp-grid-action-bar-border-color)}.grid-wrapper{display:flex;flex-direction:column;height:100%}#myNewGrid{flex:1}"}},[0,"ag-grid-base",{columnDefs:[16],gridOptions:[16],headerConfig:[16],gridHeight:[1,"grid-height"],gridFunctions:[16],gridId:[1,"grid-id"],entityName:[1,"entity-name"],gridApiCallback:[16],refreshKey:[32]},void 0,{columnDefs:[{handleUpdateColumnDefs:0}],entityName:[{handleEntityNameChange:0}],gridId:[{handleEntityNameChange:0}]}]);function tt(){"undefined"!=typeof customElements&&["ag-grid-base","ghost-render","grid-header","hint-panel","stencil-icon-button","udp-ambient-tool-tip","udp-avatar","udp-badge","udp-button","udp-chip","udp-dialog","udp-icon","udp-icon-button","udp-linear-loader","udp-list-item","udp-menu","udp-menu-item","udp-pop-over","udp-side-sheet","unity-typography"].forEach((t=>{switch(t){case"ag-grid-base":customElements.get(o(t))||customElements.define(o(t),Z);break;case"ghost-render":customElements.get(o(t))||N();break;case"grid-header":customElements.get(o(t))||A();break;case"hint-panel":customElements.get(o(t))||E();break;case"stencil-icon-button":customElements.get(o(t))||T();break;case"udp-ambient-tool-tip":customElements.get(o(t))||D();break;case"udp-avatar":customElements.get(o(t))||R();break;case"udp-badge":customElements.get(o(t))||M();break;case"udp-button":customElements.get(o(t))||F();break;case"udp-chip":customElements.get(o(t))||J();break;case"udp-dialog":customElements.get(o(t))||$();break;case"udp-icon":customElements.get(o(t))||y();break;case"udp-icon-button":customElements.get(o(t))||I();break;case"udp-linear-loader":customElements.get(o(t))||G();break;case"udp-list-item":customElements.get(o(t))||B();break;case"udp-menu":customElements.get(o(t))||V();break;case"udp-menu-item":customElements.get(o(t))||L();break;case"udp-pop-over":customElements.get(o(t))||P();break;case"udp-side-sheet":customElements.get(o(t))||U();break;case"unity-typography":customElements.get(o(t))||H()}}))}export{Z as A,Q as c,tt as d,q as g}
|
|
1
|
+
import{h as t,p as i,H as e,c as s,t as o}from"./index2.js";import{ModuleRegistry as n,themeQuartz as r,createGrid as a}from"ag-grid-community-v33";import{AllEnterpriseModule as d,LicenseManager as l}from"ag-grid-enterprise-v33";import{x as h,i as c,s as u,u as p,p as v,y as m,w as g,o as b}from"./apiUtils.js";import{g as f,d as y}from"./udp-icon2.js";import{C as _}from"./configService.js";import{g as w}from"./tenantUtils.js";import{S as x,I as C,D as S,C as k,A as O}from"./status-renderer.js";import j from"lodash/isEqual";import{d as N}from"./ghost-render2.js";import{d as A}from"./grid-header2.js";import{d as E}from"./hint-panel2.js";import{d as T}from"./stencil-icon-button2.js";import{d as D}from"./udp-ambient-tool-tip2.js";import{d as R}from"./udp-avatar2.js";import{d as M}from"./udp-badge2.js";import{d as F}from"./udp-button2.js";import{d as J}from"./udp-chip2.js";import{d as $}from"./udp-dialog2.js";import{d as I}from"./udp-icon-button2.js";import{d as G}from"./udp-linear-loader2.js";import{d as B}from"./list-item.js";import{d as V}from"./udp-menu2.js";import{d as L}from"./udp-menu-item2.js";import{d as P}from"./udp-pop-over2.js";import{d as U}from"./udp-side-sheet2.js";import{d as z}from"./unity-typography2.js";function H(){return sessionStorage.getItem("user-id")}const W=async t=>{(null===document||void 0===document?void 0:document.startViewTransition)?(document.viewTransition&&await document.viewTransition.finished,document.startViewTransition(t)):t()};function q(){return sessionStorage.getItem("current-api-catalog-id")}const K={agGridExport:class{constructor(t="export.csv"){this.fileName=t}init(t){this.gridApi=t}onAction(t){"agGridExport"===t&&this.gridApi.exportDataAsCsv({fileName:this.fileName})}},openSavedViews:class{constructor(){this.isSidesheetOpen=!1,this.isDialogOpen=!1,this.viewName="",this.viewIsPrivate=!0,this.filteredViews=[],this.allViewData=[],this.activeView=null,this.loading=0,this.initialLoad=!0,this.addStateChangeListeners=()=>{this.api.addEventListener("columnVisible",this.handleManualColumnChange),this.api.addEventListener("columnPinned",this.handleManualColumnChange),this.api.addEventListener("columnMoved",this.handleManualColumnChange),this.api.addEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.addEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.addEventListener("columnsReset",this.handleManualColumnChange),this.api.addEventListener("filterChanged",this.handleManualColumnChange),this.api.addEventListener("sortChanged",this.handleManualColumnChange)},this.removeStateChangeListeners=()=>{this.api.removeEventListener("columnVisible",this.handleManualColumnChange),this.api.removeEventListener("columnPinned",this.handleManualColumnChange),this.api.removeEventListener("columnMoved",this.handleManualColumnChange),this.api.removeEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.removeEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.removeEventListener("columnsReset",this.handleManualColumnChange),this.api.removeEventListener("filterChanged",this.handleManualColumnChange),this.api.removeEventListener("sortChanged",this.handleManualColumnChange)},this.fetchViews=async()=>{var t,i;0!==(null===(t=this.api.getColumnDefs())||void 0===t?void 0:t.length)&&(this.loading=1,this.refresh(),this.api.removeEventListener("gridColumnsChanged",this.fetchViews),this.gridId=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,this.gridId&&(this.allViewData=await h(H(),this.gridId),this.filterData(),this.initialLoad&&this.setDefaultView()),this.loading=0)},this.setDefaultView=()=>{const t=this.filteredViews.find((t=>null==t?void 0:t.isDefault));t&&this.setActiveView(t),this.initialLoad=!1},this.filterData=()=>{var t,i;this.entityName=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.entityName,this.filteredViews=this.entityName?null===(i=this.allViewData)||void 0===i?void 0:i.filter((t=>(null==t?void 0:t.domain)===this.entityName)):this.allViewData,this.refresh()},this.setActiveView=t=>{var i,e;this.removeStateChangeListeners();const s=null===(i=null==t?void 0:t.gridViewGridViewGridConfiguration)||void 0===i?void 0:i.find((t=>1===t.gridViewGridConfigurationGridConfiguration.gridStateTypeId)),o=null===(e=null==t?void 0:t.gridViewGridViewGridConfiguration)||void 0===e?void 0:e.find((t=>4===t.gridViewGridConfigurationGridConfiguration.gridStateTypeId));if(s){const t={state:JSON.parse(s.gridViewGridConfigurationGridConfiguration.values),applyOrder:!0};this.api.applyColumnState(t)}this.api.setFilterModel(o?JSON.parse(o.gridViewGridConfigurationGridConfiguration.values):null),this.handleSidesheetClose(),W((()=>{this.activeView=t,this.refresh(),setTimeout(this.addStateChangeListeners,300)}))},this.deleteView=async t=>{this.loading=1,this.refresh(),await c(t.gridViewId,(()=>{this.fetchViews()})),this.loading=0,this.refresh()},this.postViewCallback=()=>{this.loading=0,this.fetchViews(),this.handleDialogClose()},this.removeActiveView=()=>{this.removeStateChangeListeners(),this.api.resetColumnState(),this.api.setFilterModel(null),W((()=>{this.activeView=null,this.refresh()}))},this.handleManualColumnChange=async()=>{this.removeStateChangeListeners(),this.activeView&&W((()=>{this.activeView=null,this.refresh()}))},this.handleNameChange=t=>{this.viewName=t.target.value,this.refresh()},this.handleViewIsPrivateToggleChange=()=>{this.viewIsPrivate=!this.viewIsPrivate,this.refresh()},this.handleSidesheetClose=()=>{this.isSidesheetOpen=!1,this.refresh()},this.handleDialogClose=()=>{this.isDialogOpen=!1,this.viewName="",this.refresh()},this.handleOpenModal=()=>{this.isDialogOpen=!0,this.refresh()}}init(t,i){this.api=t,this.refresh=i,this.api.addEventListener("gridColumnsChanged",this.fetchViews)}onAction(t){if("openSavedViews"===t){const t=this.api.getGridOption("context");(null==t?void 0:t.gridId)!==this.gridId?this.fetchViews():(null==t?void 0:t.entityName)!==this.entityName&&this.filterData(),this.isSidesheetOpen=!0,this.refresh()}}async postView(){var t,i;this.loading=1,this.refresh();const e=[];e.push({gridStateTypeId:1,gridId:null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,values:JSON.stringify(this.api.getColumnState())}),e.push({gridStateTypeId:4,gridId:null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,values:JSON.stringify(this.api.getFilterModel())});const s=this.api.getGridOption("context");try{await u(H(),null==s?void 0:s.gridId,q(),this.viewName,null==s?void 0:s.entityName,e,!0===this.viewIsPrivate?1:2,0,this.postViewCallback)}catch(t){console.error(t)}finally{this.refresh()}}async updateViewMarkedAsPrimary(t){this.loading=1,this.refresh();const i=this.api.getGridOption("context"),e=null==t?void 0:t.isDefault;await p(null==t?void 0:t.gridViewId,H(),null==i?void 0:i.gridId,q(),null==t?void 0:t.name,e?0:1,null==i?void 0:i.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).then((async()=>{if(!e){const t=this.filteredViews.find((t=>null==t?void 0:t.isDefault));t&&await p(null==t?void 0:t.gridViewId,H(),null==i?void 0:i.gridId,q(),null==t?void 0:t.name,0,null==i?void 0:i.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).catch((t=>console.log(t)))}await this.fetchViews(),this.loading=0,this.refresh()})).catch((t=>console.log(t)))}render(){var i,e;return t("div",null,t("div",{style:{viewTransitionName:"active-view-chip"},class:"grid-action-transition"},this.activeView&&t("div",{style:{margin:"4px"}},t("udp-chip",{label:null===(i=this.activeView)||void 0===i?void 0:i.name,variant:"filled",color:"secondary",deleteButton:!0,onChipDelete:this.removeActiveView}))),t("udp-dialog",{open:this.isDialogOpen,actionOne:()=>{this.postView()},actionTwo:this.handleDialogClose,handleClose:this.handleDialogClose,labelOne:"Create View",labelTwo:"Cancel",title:"Create a grid view",message:"The view will be created from the current column and filter state.",disableOne:!this.viewName,progress:this.loading},t("div",{style:{display:"flex",flexDirection:"column"}},t("div",{style:{marginBottom:"-4px",marginTop:"2em"}},t("text-field",{value:this.viewName,onInput:this.handleNameChange,placeholder:"View name"})),t("div",{style:{marginTop:"-4px"}},t("stencil-toggle",{label:"Private",checked:this.viewIsPrivate,onChange:this.handleViewIsPrivateToggleChange})))),t("udp-side-sheet",{title:"Views",open:this.isSidesheetOpen,position:"right",onUdpSideSheetClose:this.handleSidesheetClose,headerActionButtonLabel:"Create View",onUdpHeaderActionButtonClick:this.handleOpenModal,headerActionButtonIcon:"add",loading:!!this.loading},t("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},t("hint-panel",{hint:"Quickly access and manage your pre-configured grid views. These views are designed to help you focus on specific sets of data and streamline your workflow.",hideHintText:"Dismiss"}),this.entityName&&t("hint-panel",{hint:"Note: Displaying entity specific views."}),t("div",null,(null===(e=this.filteredViews)||void 0===e?void 0:e.length)>0?this.filteredViews.map((i=>{var e;return t("udp-list-item",{primaryText:i.name,clickable:!0,onListItemClick:()=>this.setActiveView(i)},t("div",{style:{display:"flex",flexDirection:"row",gap:"4px"},slot:"status-chip"},(null===(e=this.activeView)||void 0===e?void 0:e.gridViewId)===i.gridViewId&&t("udp-chip",{label:"Active",color:"success",variant:"filled"}),1===i.gridViewVisibilityTypeId&&t("udp-chip",{label:"Private",color:"gray",variant:"outlined"})),t("div",{slot:"actions"},t("udp-icon-button",{icon:f("star"),size:"small",variant:i.isDefault?"contained":"text",tooltip:2===i.gridViewVisibilityTypeId?"Cannot mark public view as primary":i.isDefault?"Remove as primary":"Mark as primary",onClick:()=>this.updateViewMarkedAsPrimary(i),disabled:2===i.gridViewVisibilityTypeId}),t("udp-icon-button",{icon:f("trashCan"),size:"small",variant:"text",tooltip:i.userId!==H()?"Cannot delete public view with different owner":"Delete View",onClick:()=>this.deleteView(i),disabled:i.userId!==H()})))})):t("udp-empty-state-display",{primaryText:"No Views to display"})))))}},agGridSizeColumnsToFit:class{init(t){this.gridApi=t}onAction(t){"agGridSizeColumnsToFit"===t&&this.gridApi.sizeColumnsToFit()}},agGridAutoSizeColumns:class{init(t){this.gridApi=t}onAction(t){"agGridAutoSizeColumns"===t&&this.gridApi.autoSizeAllColumns()}},bulkActions:class{constructor(){this.bulkActions=[],this.selectedRowCount=0,this.fetchedData=!1,this.isMenuOpen=!1,this.onRowSelectionChanged=()=>{var t;W((()=>{const t=this.api.getSelectedRows();this.selectedRows=t,this.selectedRowCount=t.length,this.refresh()})),this.fetchedData&&(null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId)===this.gridId||this.fetchBulkActions()},this.setBulkActions=t=>{const i=t.map((t=>({label:t.name,onClick:()=>this.executeActionProviderAction(t.actionId)}))),e=this.localFunctions.map((t=>({label:t.label,onClick:()=>this.executeLocalFunction(t.label)})));this.bulkActions=[...i,...e],this.fetchedData=!0,this.refresh()},this.executeLocalFunction=t=>{const i=this.localFunctions.find((i=>i.label===t));i&&i.callback(this.selectedRows),this.refresh()},this.executeActionProviderAction=t=>{this.actionProviderCallback&&this.actionProviderCallback(t,this.selectedRows),this.refresh()},this.toggleMenu=()=>{this.isMenuOpen=!this.isMenuOpen,this.refresh()},this.closeMenu=()=>{this.isMenuOpen=!1,this.refresh()}}init(t,i,e){this.api=t,this.refresh=i,this.actionProviderCallback=null==e?void 0:e.actionProviderCallback,this.localFunctions=null==e?void 0:e.localFunctions;const s=this.api.getGridOption("rowModelType");this.api.setGridOption("rowSelection","clientSide"===s?{mode:"multiRow",enableClickSelection:!0}:{mode:"multiRow",enableClickSelection:!0,headerCheckbox:!1}),this.api.addEventListener("selectionChanged",this.onRowSelectionChanged)}onAction(t){"executeBulkAction"===t&&this.refresh()}async fetchBulkActions(){var t;try{this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,await v(this.gridId,!1,[],this.setBulkActions)}catch(t){console.error(t)}}render(){var i;return t("div",{style:{viewTransitionName:"bulk-action-button"},class:"grid-action-transition"},this.selectedRowCount>0&&[t("div",{style:{margin:"2px"}},t("udp-button",{ref:t=>{this.menuAnchorEl=t||void 0},onClick:this.toggleMenu,variant:"outlined",color:"primary",endIcon:t("udp-icon",{iconName:"chevronDown",style:{transform:this.isMenuOpen?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"}})},`${this.selectedRowCount} Selected`)),t("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:this.closeMenu},0===(null===(i=this.bulkActions)||void 0===i?void 0:i.length)?t("udp-menu-item",{label:"No available actions"}):this.bulkActions.map((i=>t("udp-menu-item",{label:i.label,onItemClick:()=>{i.onClick(),this.isMenuOpen=!1}}))))])}},chipFilter:class{constructor(){this.handleFilterChanged=t=>{var i,e,s;const o=null===(e=null===(i=null==t?void 0:t.columns)||void 0===i?void 0:i[0])||void 0===e?void 0:e.colId,n=null===(s=this.filterChips)||void 0===s?void 0:s.find((t=>t.field===o));if(n){const t=this.api.getColumnFilterModel(o),i=Object.assign(Object.assign({},n),{filterObjects:n.filterObjects.map((i=>{let e=!1;return(null==t?void 0:t.conditions)&&"AND"===(null==t?void 0:t.operator)?e=t.conditions.some((t=>JSON.stringify(t)===JSON.stringify(i.agGridFilterModel[o]))):t&&(e=JSON.stringify(t)===JSON.stringify(i.agGridFilterModel[o])),Object.assign(Object.assign({},i),{toggled:e})}))});this.filterChips=this.filterChips.map((t=>t.field===o?i:t)),this.refresh()}},this.syncChipsWithGridFilters=()=>{if(!this.filterChips||0===this.filterChips.length)return;const t=this.filterChips.map((t=>{const i=t.field,e=this.api.getColumnFilterModel(i);if(!e)return t;const s=t.filterObjects.map((t=>{let s=!1;return s=(null==e?void 0:e.conditions)&&"AND"===(null==e?void 0:e.operator)?e.conditions.some((e=>JSON.stringify(e)===JSON.stringify(t.agGridFilterModel[i]))):JSON.stringify(e)===JSON.stringify(t.agGridFilterModel[i]),Object.assign(Object.assign({},t),{toggled:s})}));return Object.assign(Object.assign({},t),{filterObjects:s})}));this.filterChips=t},this.getGridfilterChips=async()=>{var t,i;if(this.gridId!==(null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId)){this.gridId=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId;const t=(await m(this.gridId,7)).map((t=>JSON.parse(t.values)));W((async()=>{this.filterChips=t.map((t=>Object.assign(Object.assign({},t),{filterObjects:t.filterObjects.map((t=>Object.assign(Object.assign({},t),{toggled:!1})))}))),this.syncChipsWithGridFilters(),this.getFilterChipCounts(),this.refresh()}))}},this.getFilterChipCounts=async()=>{var t;const i={pageNumber:1,pageSize:1,filterElements:[],filterGroups:[],orderElements:[],groupingType:"",groupProperty:[],groupOperationList:[],eagerLoad:!1,logicalSearchOperator:1},e=[];for(const s of this.filterChips){if(!(null==s?void 0:s.udpDomainSanitizedName))continue;const o=await g(q(),s.udpDomainSanitizedName,!0);for(const n of null!==(t=s.filterObjects)&&void 0!==t?t:[])(null==n?void 0:n.udpFilterElement)&&e.push((async()=>{var t;const e=Object.assign(Object.assign({},i),{filterElements:[n.udpFilterElement]});return{result:await b(e,null===(t=null==o?void 0:o.unityBaseSearchMethod)||void 0===t?void 0:t.apiMethodId,_.config.UNITY_API_DOMAIN,!1),groupField:s.field,objLabel:n.label}})())}const s=await Promise.all(e);this.filterChips=this.filterChips.map((t=>{const i=s.filter((i=>i.groupField===t.field));return Object.assign(Object.assign({},t),{filterObjects:t.filterObjects.map((t=>{var e,s;const o=i.find((i=>i.objLabel===t.label));return Object.assign(Object.assign({},t),{resultCount:null!==(s=null===(e=null==o?void 0:o.result)||void 0===e?void 0:e.total)&&void 0!==s?s:null})}))})})),this.refresh()},this.setSelectedFilterChip=t=>{this.filterChips=this.filterChips.map((i=>Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>i.label===t.label?Object.assign(Object.assign({},i),{toggled:!i.toggled}):i))}))),this.refresh();const i=Object.keys(t.agGridFilterModel)[0];!function(t,i,e){var s,o;const n=t.getColumn(i);if(!n)return void console.error("Invalid column id provided for filtering");if(!(null===(s=null==n?void 0:n.colDef)||void 0===s?void 0:s.filter))return void console.error(`Filtering not enabled for column: ${null==n?void 0:n.colId}`);const r=t.getColumnFilterModel(i);if(JSON.stringify(e)!==JSON.stringify(r)){if(null===(o=null==r?void 0:r.conditions)||void 0===o?void 0:o.some((t=>JSON.stringify(t)===JSON.stringify(e)))){const s=null==r?void 0:r.conditions.filter((t=>JSON.stringify(t)!==JSON.stringify(e)));if(1===s.length)return void t.setColumnFilterModel(i,s[0]).then((()=>t.onFilterChanged()));{const e=Object.assign(Object.assign({},r),{conditions:s});return void t.setColumnFilterModel(i,e).then((()=>t.onFilterChanged()))}}if(r)if(null==r?void 0:r.conditions){const s=[...null==r?void 0:r.conditions,e];t.setColumnFilterModel(i,{conditions:s,operator:"AND"}).then((()=>t.onFilterChanged()))}else r&&t.setColumnFilterModel(i,{conditions:[Object.assign({},r),e],operator:"AND"}).then((()=>t.onFilterChanged()));else t.setColumnFilterModel(n,e).then((()=>t.onFilterChanged()))}else t.setColumnFilterModel(i,null).then((()=>t.onFilterChanged()))}(this.api,i,t.agGridFilterModel[i])}}init(t,i){this.api=t,this.refresh=i,this.api.addEventListener("firstDataRendered",this.getGridfilterChips),this.api.addEventListener("filterChanged",this.handleFilterChanged)}onAction(t){"chipFilter"===t&&this.refresh()}render(){var i;return t("div",{class:"grid-action-transition",style:{display:"flex",flexWrap:"nowrap",gap:"5px",viewTransitionName:"view-chip-filters"}},(null===(i=this.filterChips)||void 0===i?void 0:i.length)>0&&this.filterChips.map(((i,e)=>[e>0&&t("div",{style:{width:"1px",backgroundColor:"#ddd",marginBottom:"5px",marginTop:"5px"}}),t("div",{style:{padding:"4px",display:"flex",flexWrap:"nowrap",gap:"3px"}},i.filterObjects.map((i=>t("udp-chip",{label:`${i.label} ${null!=i.resultCount?`(${i.resultCount})`:""}`,variant:i.toggled?"filled":"outlined",clickable:!0,onChipClick:()=>this.setSelectedFilterChip(i),color:"primary"}))))])))}},restoreGridState:class{constructor(){this.getPreviousState=()=>{W((()=>{this.api.removeEventListener("stateUpdated",this.saveState);const t=this.api.getGridOption("context");this.gridId=null==t?void 0:t.gridId,this.apiMethodInstanceId=(null==t?void 0:t.apiMethodInstanceId)||"",this.previousState=JSON.parse(localStorage.getItem(this.getStorageKey())),this.refresh(),this.api.addEventListener("stateUpdated",this.saveState)}))},this.getStorageKey=()=>{const t=w();return`saved-grid-state-${this.gridId}-${this.apiMethodInstanceId}-${t}`},this.saveState=()=>{const t=this.api.getGridOption("context");if((null==t?void 0:t.gridId)!==this.gridId||(null==t?void 0:t.apiMethodInstanceId)&&(null==t?void 0:t.apiMethodInstanceId)!==this.apiMethodInstanceId)this.getPreviousState();else{const t=this.api.getState();localStorage.setItem(this.getStorageKey(),JSON.stringify({date:new Date,state:t}))}},this.restoreState=async()=>{this.api.setState(this.previousState.state),setTimeout((()=>W((()=>{this.previousState=null,this.refresh()}))),0)},this.dismissMessage=()=>{W((()=>{this.previousState=null,this.refresh()}))}}init(t,i){this.api=t,this.refresh=i,this.api.addEventListener("firstDataRendered",this.getPreviousState)}getTimeAgo(t){const i=Math.floor((Date.now()-t.getTime())/1e3);if(i<60)return`${i} second${1!==i?"s":""} ago`;const e=Math.floor(i/60);if(e<60)return`${e} minute${1!==e?"s":""} ago`;const s=Math.floor(e/60);if(s<24)return`${s} hour${1!==s?"s":""} ago`;const o=Math.floor(s/24);return`${o} day${1!==o?"s":""} ago`}render(){var i;return t("div",{style:{viewTransitionName:"restore-grid-state"}},(null===(i=this.previousState)||void 0===i?void 0:i.date)&&t("div",{style:{margin:"4px"}},t("udp-ambient-tool-tip",{content:`Restore grid state from ${this.getTimeAgo(new Date(this.previousState.date))}?`},t("udp-chip",{startIcon:"rotate",label:"Restore state",variant:"outlined",color:"gray",deleteButton:!0,onChipDelete:this.dismissMessage,clickable:!0,onClick:this.restoreState}))))}},agGridResetColumns:class{init(t){this.gridApi=t}onAction(t){"agGridResetColumns"===t&&(this.gridApi.resetColumnState(),this.gridApi.setFilterModel(null))}},advancedSearch:class{init(t,i,e){this.onOpenCallback=null==e?void 0:e.callback}onAction(t){var i;"advancedSearch"===t&&(null===(i=this.onOpenCallback)||void 0===i||i.call(this))}},agGridHideShowColumns:class{init(t){this.gridApi=t}onAction(t){"agGridHideShowColumns"===t&&this.gridApi.showColumnChooser()}},udpExport:class{init(t,i,e){this.onOpenCallback=null==e?void 0:e.callback,this.api=t}onAction(t){var i;if("udpExport"===t){const t=this.api.getGridOption("context");null===(i=this.onOpenCallback)||void 0===i||i.call(this,null==t?void 0:t.searchObject,null==t?void 0:t.entityName)}}}};function Q(t,i=!1){return t.map((t=>{var e,s,o,n,r;if("actions"===t.field){const i=(null===(s=null===(e=t.cellRendererParams)||void 0===e?void 0:e.actionList)||void 0===s?void 0:s.length)>5?5:null===(n=null===(o=t.cellRendererParams)||void 0===o?void 0:o.actionList)||void 0===n?void 0:n.length;if(0===i)return t;let r=30*i+4*(i-1)+40;return r<80&&(r=80),Object.assign(Object.assign({},t),{pinned:"right",width:r,minWidth:r,maxWidth:r,sortable:!1,filter:!1,suppressHeaderMenuButton:!0,suppressMovable:!0})}return(null===(r=null==t?void 0:t.context)||void 0===r?void 0:r.lookupId)&&(t.valueGetter=i=>i.data[(null==t?void 0:t.field)+"LookupValue"],t.filter=!1,t.sortable=!1),i&&(t.filter=!1),t}))}const Y=t=>{const i=t.value;if(null==i)return"";const e=new Date(i);return e?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`:""},X=r.withParams({wrapperBorderRadius:0,wrapperBorder:!1,headerCellHoverBackgroundColor:"var(--udp-grid-column-header-bg-hover)",borderColor:"#E9ECEF"}),Z=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.gridReady=s(this,"gridReady"),this.headerConfig={},this.gridFunctions=[],this.refreshKey=0,this.gridFunctionInstances=[],this.updateGridHeight=()=>{if(this.gridEl){const t=this.gridEl.getBoundingClientRect(),i=window.innerHeight-t.top,e=10;this.gridEl.style.height=(i-e>400?i-e:400)+"px"}},this.scheduleHeightUpdate=()=>{clearTimeout(this.resizeDebounce),this.resizeDebounce=setTimeout(this.updateGridHeight,100)},this.refreshGridFunctions=()=>{this.refreshKey++},this.onGridReady=t=>{this.gridApi=t.api,this.updateGridContextValues(),this.gridFunctionInstances=this.gridFunctions.map((t=>{const i=K[t.name];if(!i)return null;const e=new i;return e.init(this.gridApi,this.refreshGridFunctions,t.params),e})).filter((t=>!!t)),this.gridApiCallback&&this.gridApiCallback({refreshServerSide:()=>this.gridApi.refreshServerSide(),getSelectedRows:()=>this.gridApi.getSelectedRows(),getSelectedNodes:()=>this.gridApi.getSelectedNodes(),getSearchObject:()=>{var t;return null===(t=this.gridApi.getGridOption("context"))||void 0===t?void 0:t.searchObject},getEntityName:()=>{var t;return null===(t=this.gridApi.getGridOption("context"))||void 0===t?void 0:t.entityName},getRowCount:()=>{var t;return null===(t=this.gridApi.getGridOption("context"))||void 0===t?void 0:t.rowCount},getFilterModel:()=>this.gridApi.getFilterModel(),setFilterModel:t=>this.gridApi.setFilterModel(t),onFilterChanged:()=>this.gridApi.onFilterChanged(),expandAll:()=>this.gridApi.expandAll(),collapseAll:()=>this.gridApi.collapseAll(),toggleLoadingOverlay:t=>this.gridApi.setGridOption("loading",t),refreshCells:()=>this.gridApi.refreshCells(),refreshClientSideRowModel:t=>this.gridApi.refreshClientSideRowModel(t),selectAll:(t,i)=>this.gridApi.selectAll(t,i),deselectAll:(t,i)=>this.gridApi.deselectAll(t,i),getServerSideSelectionState:()=>this.gridApi.getServerSideSelectionState(),setServerSideSelectionState:t=>this.gridApi.setServerSideSelectionState(t),forEachNode:t=>this.gridApi.forEachNode(t),forEachNodeAfterFilterAndSort:t=>this.gridApi.forEachNodeAfterFilterAndSort(t)}),this.setColumnDefs(),this.gridReady.emit(this.gridApi)},this.onHeaderAction=t=>{this.gridFunctionInstances.forEach((i=>{var e;return null===(e=i.onAction)||void 0===e?void 0:e.call(i,t.detail.name,t.detail.payload)}))},this.updateGridContextValues=()=>{this.gridApi.setGridOption("context",Object.assign(Object.assign({},this.gridApi.getGridOption("context")),{entityName:this.entityName,gridId:this.gridId}))}}componentWillLoad(){n.registerModules([d]),l.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-080613}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Univerus_Software_Inc}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{MAIS_eRec}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{MAIS_eRec}_need_to_be_licensed___{MAIS_eRec}_has_not_been_granted_a_Deployment_License_Add-on___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{28_June_2026}____[v3]_[01]_MTc4MjYwMTIwMDAwMA==5c7d1487ecb13b28e75415d34b7cf694")}componentDidLoad(){var t,i,e,s;const o=Object.assign(Object.assign({tooltipShowMode:"whenTruncated",tooltipShowDelay:500},this.gridOptions),{columnTypes:{booleanChip:{cellRenderer:"iconRenderer",cellRendererParams:{iconMappingConfig:{true:{iconName:"checkMark24",color:"success"},false:{iconName:"close24",color:"error"}}}}},dataTypeDefinitions:{dateTimeString:{baseDataType:"dateTimeString",extendsDataType:"dateTimeString",valueFormatter:Y},boolean:{baseDataType:"boolean",extendsDataType:"boolean",columnTypes:"booleanChip"}},gridId:this.gridId,onGridReady:this.onGridReady,theme:X,components:Object.assign({actionsRenderer:O,currencyRenderer:k,dateTimeCellRenderer:S,iconRenderer:C,statusRenderer:x},null===(t=this.gridOptions)||void 0===t?void 0:t.components),domLayout:"normal",defaultColDef:Object.assign(Object.assign({sortable:!0,filter:!0,flex:1,minWidth:150,suppressHeaderMenuButton:!0},null===(i=this.gridOptions)||void 0===i?void 0:i.defaultColDef),{filterParams:Object.assign({buttons:["reset","apply"],closeOnApply:!0,maxNumConditions:10},null===(s=null===(e=this.gridOptions)||void 0===e?void 0:e.defaultColDef)||void 0===s?void 0:s.filterParams)})});a(this.el.querySelector("#myNewGrid"),o),this.gridHeight?this.gridEl.style.height=this.gridHeight:(this.updateGridHeight(),this.resizeObserver=new ResizeObserver(this.scheduleHeightUpdate),this.resizeObserver.observe(this.gridContainerEl),window.addEventListener("resize",this.scheduleHeightUpdate))}disconnectedCallback(){var t,i;null===(t=this.gridApi)||void 0===t||t.destroy(),null===(i=this.resizeObserver)||void 0===i||i.disconnect(),window.removeEventListener("resize",this.scheduleHeightUpdate)}handleUpdateColumnDefs(t,i){j(t,i)||this.setColumnDefs()}setColumnDefs(){var t;if(this.columnDefs&&this.gridApi){const i=Q(this.columnDefs,null===(t=this.gridFunctions)||void 0===t?void 0:t.some((t=>"advancedSearch"===(null==t?void 0:t.name))));this.gridApi.setGridOption("columnDefs",i)}}handleEntityNameChange(){this.updateGridContextValues()}render(){var i;const e=`variant-${(null===(i=this.headerConfig)||void 0===i?void 0:i.variant)||"light"}`;return t("div",{key:"bcbd0fe1693a169eac2d3eaa43ec8021d781071d",class:e,ref:t=>this.gridContainerEl=t},t("ghost-render",{key:"a9eb1234b76fa9937e34cd468a0335cea2b36444"},t("div",{key:"a7dfd166a485a1093828b9fa1b327081223b9ff7"},t("udp-dialog",{key:"5e4ee01cf0d8ff4bab63107b5eaed5fe826bd6a9"}),t("udp-list-item",{key:"6b1a02b2f37e9f4805768d37fa0b8a00b4689d30"}),t("hint-panel",{key:"4624370fe64ca7eb304c09aec59e8c80d335a2c0"}),t("udp-side-sheet",{key:"dd7a83b3a87d17b397a4198a5f0160e1bb07ac20"}))),t("div",{key:"72fd3f9ccbb67b47418af4ed3d419406f4be6928",class:"grid-base-header"},t("grid-header",{key:"91476b641388c546da6addc4463906ce4652013b",headerConfig:this.headerConfig,gridFunctions:this.gridFunctions,onHeaderAction:this.onHeaderAction}),t("div",{key:"af9718f0931f15691a35bd99b4232c2fc70d1da5",class:"action-bar",style:{viewTransitionName:"action-bar"}},this.gridFunctionInstances.map((t=>{var i;return null===(i=t.render)||void 0===i?void 0:i.call(t)})))),t("div",{key:"b1eee4354e580529fff3af958ba7c1f3fd8926fb",id:"myNewGrid",ref:t=>this.gridEl=t,style:{viewTransitionName:"my-new-grid"}}))}get el(){return this}static get watchers(){return{columnDefs:[{handleUpdateColumnDefs:0}],entityName:[{handleEntityNameChange:0}],gridId:[{handleEntityNameChange:0}]}}static get style(){return":root{--udp-grid-base-header-bg:#EBECEF;--udp-grid-base-header-text:#000;--udp-grid-action-divider-color:rgba(0, 0, 0, 0.3);--udp-grid-action-bar-border-color:rgb(202, 197, 197)}.variant-dark{--udp-grid-base-header-bg:var(--primary-color-dark);--udp-grid-action-bar-bg:#F8F9FA;--udp-grid-column-header-bg:#F8F9FA;--udp-grid-column-header-bg-hover:#dce6f2;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}.variant-light{--udp-grid-base-header-bg:#d8dfe6;--udp-grid-action-bar-bg:#f4f6f8;--udp-grid-column-header-bg:#f2f4f5;--udp-grid-column-header-bg-hover:#eef3f9;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}::view-transition-group(*){animation-duration:0.2s}.grid-base-header{background-color:var(--udp-grid-base-header-bg);color:var(--udp-grid-base-header-text)}.action-bar{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;background-color:var(--udp-grid-action-bar-bg);color:var(--udp-grid-action-bar-text-color);padding:0px 8px 0px 12px;border-bottom:1px solid var(--udp-grid-action-bar-border-color)}.grid-wrapper{display:flex;flex-direction:column;height:100%}#myNewGrid{flex:1}"}},[0,"ag-grid-base",{columnDefs:[16],gridOptions:[16],headerConfig:[16],gridHeight:[1,"grid-height"],gridFunctions:[16],gridId:[1,"grid-id"],entityName:[1,"entity-name"],gridApiCallback:[16],refreshKey:[32]},void 0,{columnDefs:[{handleUpdateColumnDefs:0}],entityName:[{handleEntityNameChange:0}],gridId:[{handleEntityNameChange:0}]}]);function tt(){"undefined"!=typeof customElements&&["ag-grid-base","ghost-render","grid-header","hint-panel","stencil-icon-button","udp-ambient-tool-tip","udp-avatar","udp-badge","udp-button","udp-chip","udp-dialog","udp-icon","udp-icon-button","udp-linear-loader","udp-list-item","udp-menu","udp-menu-item","udp-pop-over","udp-side-sheet","unity-typography"].forEach((t=>{switch(t){case"ag-grid-base":customElements.get(o(t))||customElements.define(o(t),Z);break;case"ghost-render":customElements.get(o(t))||N();break;case"grid-header":customElements.get(o(t))||A();break;case"hint-panel":customElements.get(o(t))||E();break;case"stencil-icon-button":customElements.get(o(t))||T();break;case"udp-ambient-tool-tip":customElements.get(o(t))||D();break;case"udp-avatar":customElements.get(o(t))||R();break;case"udp-badge":customElements.get(o(t))||M();break;case"udp-button":customElements.get(o(t))||F();break;case"udp-chip":customElements.get(o(t))||J();break;case"udp-dialog":customElements.get(o(t))||$();break;case"udp-icon":customElements.get(o(t))||y();break;case"udp-icon-button":customElements.get(o(t))||I();break;case"udp-linear-loader":customElements.get(o(t))||G();break;case"udp-list-item":customElements.get(o(t))||B();break;case"udp-menu":customElements.get(o(t))||V();break;case"udp-menu-item":customElements.get(o(t))||L();break;case"udp-pop-over":customElements.get(o(t))||P();break;case"udp-side-sheet":customElements.get(o(t))||U();break;case"unity-typography":customElements.get(o(t))||z()}}))}export{Z as A,Q as c,tt as d,q as g}
|
package/dist/docs.json
CHANGED
|
@@ -991,11 +991,14 @@ const AgGridBase = class {
|
|
|
991
991
|
this.updateGridHeight();
|
|
992
992
|
this.resizeObserver = new ResizeObserver(this.scheduleHeightUpdate);
|
|
993
993
|
this.resizeObserver.observe(this.gridContainerEl);
|
|
994
|
+
window.addEventListener('resize', this.scheduleHeightUpdate);
|
|
994
995
|
}
|
|
995
996
|
}
|
|
996
997
|
disconnectedCallback() {
|
|
997
|
-
var _a;
|
|
998
|
+
var _a, _b;
|
|
998
999
|
(_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
1000
|
+
(_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
1001
|
+
window.removeEventListener('resize', this.scheduleHeightUpdate);
|
|
999
1002
|
}
|
|
1000
1003
|
handleUpdateColumnDefs(newVal, prevVal) {
|
|
1001
1004
|
if (isEqual(newVal, prevVal)) {
|
|
@@ -1016,7 +1019,7 @@ const AgGridBase = class {
|
|
|
1016
1019
|
render() {
|
|
1017
1020
|
var _a;
|
|
1018
1021
|
const variantClass = `variant-${((_a = this.headerConfig) === null || _a === void 0 ? void 0 : _a.variant) || 'light'}`;
|
|
1019
|
-
return (h("div", { key: '
|
|
1022
|
+
return (h("div", { key: 'bcbd0fe1693a169eac2d3eaa43ec8021d781071d', class: variantClass, ref: el => (this.gridContainerEl = el) }, h("ghost-render", { key: 'a9eb1234b76fa9937e34cd468a0335cea2b36444' }, h("div", { key: 'a7dfd166a485a1093828b9fa1b327081223b9ff7' }, h("udp-dialog", { key: '5e4ee01cf0d8ff4bab63107b5eaed5fe826bd6a9' }), h("udp-list-item", { key: '6b1a02b2f37e9f4805768d37fa0b8a00b4689d30' }), h("hint-panel", { key: '4624370fe64ca7eb304c09aec59e8c80d335a2c0' }), h("udp-side-sheet", { key: 'dd7a83b3a87d17b397a4198a5f0160e1bb07ac20' }))), h("div", { key: '72fd3f9ccbb67b47418af4ed3d419406f4be6928', class: "grid-base-header" }, h("grid-header", { key: '91476b641388c546da6addc4463906ce4652013b', headerConfig: this.headerConfig, gridFunctions: this.gridFunctions, onHeaderAction: this.onHeaderAction }), h("div", { key: 'af9718f0931f15691a35bd99b4232c2fc70d1da5', class: "action-bar", style: { viewTransitionName: `action-bar` } }, this.gridFunctionInstances.map(fn => { var _a; return (_a = fn.render) === null || _a === void 0 ? void 0 : _a.call(fn); }))), h("div", { key: 'b1eee4354e580529fff3af958ba7c1f3fd8926fb', id: "myNewGrid", ref: el => (this.gridEl = el), style: {
|
|
1020
1023
|
viewTransitionName: `my-new-grid`,
|
|
1021
1024
|
} })));
|
|
1022
1025
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,r as t,c as e,a as o,H as s}from"./index-DFnjA9NX.js";import{ModuleRegistry as n,themeQuartz as a,createGrid as r}from"ag-grid-community-v33";import{AllEnterpriseModule as c,LicenseManager as d}from"ag-grid-enterprise-v33";import{x as l,i as h,s as u,u as p,p as b,y as m,w as v,o as g}from"./apiUtils-11-yfzUs.js";import{g as f}from"./iconUtils-DcPvHO4A.js";import{g as y}from"./getCurrentApiCatalogId-DeurXd9l.js";import{C as x}from"./configService-BqLfkVKh.js";import{g as k}from"./tenantUtils-Basdb1b1.js";import{S as w,I as C,D as _,C as S,A as O}from"./currency-renderer-D6zBtP2s.js";import{c as N}from"./configureUdpColumnMods-CoCTzhve.js";import j from"lodash/isEqual";import"deep-equal";import"./makeApiCall-2umiVB6u.js";import"axios";import"@stencil/store";import"./iconMapping-CPerGeNF.js";import"@carbon/icons/es/add/16";import"@carbon/icons/es/add/32";import"@carbon/icons/es/add--alt/16";import"@carbon/icons/es/add--filled/16";import"@carbon/icons/es/arrows--horizontal/16";import"@carbon/icons/es/attachment/16";import"@carbon/icons/es/batch-job/16";import"@carbon/icons/es/box/16";import"@carbon/icons/es/close/16";import"@carbon/icons/es/close/24";import"@carbon/icons/es/close/32";import"@carbon/icons/es/close--filled/16";import"@carbon/icons/es/close--outline/16";import"@carbon/icons/es/checkmark/16";import"@carbon/icons/es/checkmark/24";import"@carbon/icons/es/checkmark/32";import"@carbon/icons/es/chevron--left/16";import"@carbon/icons/es/chevron--right/16";import"@carbon/icons/es/chevron--down/16";import"@carbon/icons/es/data-enrichment/16";import"@carbon/icons/es/document/16";import"@carbon/icons/es/document--add/16";import"@carbon/icons/es/document--attachment/16";import"@carbon/icons/es/document--pdf/16";import"@carbon/icons/es/document--video/16";import"@carbon/icons/es/document--audio/16";import"@carbon/icons/es/draggable/16";import"@carbon/icons/es/edit/16";import"@carbon/icons/es/export/16";import"@carbon/icons/es/flag/16";import"@carbon/icons/es/information/16";import"@carbon/icons/es/information/32";import"@carbon/icons/es/link/16";import"@carbon/icons/es/overflow-menu--vertical/16";import"@carbon/icons/es/overflow-menu--vertical/32";import"@carbon/icons/es/return/16";import"@carbon/icons/es/save/16";import"@carbon/icons/es/settings/16";import"@carbon/icons/es/subtract/16";import"@carbon/icons/es/subtract--alt/16";import"@carbon/icons/es/subtract--filled/16";import"@carbon/icons/es/trash-can/16";import"@carbon/icons/es/user/16";import"@carbon/icons/es/view/16";import"@carbon/icons/es/warning/16";import"@carbon/icons/es/warning/32";import"@carbon/icons/es/warning--alt/16";import"@carbon/icons/es/warning--alt/32";import"@carbon/icons/es/product/16";import"@carbon/icons/es/workspace/16";import"@carbon/icons/es/arrow--up/16";import"@carbon/icons/es/arrow--down/16";import"@carbon/icons/es/arrow--right/16";import"@carbon/icons/es/arrow--left/16";import"@carbon/icons/es/copy/16";import"@carbon/icons/es/star/16";import"@carbon/icons/es/data-table/16";import"@carbon/icons/es/fit-to-width/16";import"@carbon/icons/es/search--advanced/16";import"@carbon/icons/es/reset/16";import"@carbon/icons/es/column/16";import"@carbon/icons/es/column--delete/16";import"@carbon/icons/es/watson-health/rotate--360/16";import"@carbon/icons/es/filter/16";import"@carbon/icons/es/app-connectivity/16";import"@carbon/icons/es/text--font/16";import"@carbon/icons/es/text--long-paragraph/16";import"@carbon/icons/es/character--whole-number/16";import"@carbon/icons/es/checkbox--checked/16";import"@carbon/icons/es/radio-button--checked/16";import"@carbon/icons/es/event--schedule/16";import"@carbon/icons/es/view--off/16";import"@carbon/icons/es/time/16";import"@carbon/icons/es/calendar/16";import"@carbon/icons/es/list--checked/16";import"@carbon/icons/es/list--bulleted/16";import"@carbon/icons/es/cloud--upload/16";import"@carbon/icons/es/locked/16";import"@carbon/icons/es/pause/16";import"@carbon/icons/es/unlocked/16";import"@carbon/icons/es/send/16";import"@carbon/icons/es/email/16";import"@carbon/icons/es/checkmark--outline/16";import"@carbon/icons/es/migrate--alt/16";import"@carbon/icons/es/checkbox--checked--filled/16";import"@carbon/icons/es/checkbox/16";import"@carbon/icons/es/ZIP/16";import"@carbon/icons/es/image/16";import"@carbon/icons/es/PPT/16";import"@carbon/icons/es/XLS/16";function A(){return sessionStorage.getItem("user-id")}const T=async i=>{(null===document||void 0===document?void 0:document.startViewTransition)?(document.viewTransition&&await document.viewTransition.finished,document.startViewTransition(i)):i()},F={agGridExport:class{constructor(i="export.csv"){this.fileName=i}init(i){this.gridApi=i}onAction(i){"agGridExport"===i&&this.gridApi.exportDataAsCsv({fileName:this.fileName})}},openSavedViews:class{constructor(){this.isSidesheetOpen=!1,this.isDialogOpen=!1,this.viewName="",this.viewIsPrivate=!0,this.filteredViews=[],this.allViewData=[],this.activeView=null,this.loading=0,this.initialLoad=!0,this.addStateChangeListeners=()=>{this.api.addEventListener("columnVisible",this.handleManualColumnChange),this.api.addEventListener("columnPinned",this.handleManualColumnChange),this.api.addEventListener("columnMoved",this.handleManualColumnChange),this.api.addEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.addEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.addEventListener("columnsReset",this.handleManualColumnChange),this.api.addEventListener("filterChanged",this.handleManualColumnChange),this.api.addEventListener("sortChanged",this.handleManualColumnChange)},this.removeStateChangeListeners=()=>{this.api.removeEventListener("columnVisible",this.handleManualColumnChange),this.api.removeEventListener("columnPinned",this.handleManualColumnChange),this.api.removeEventListener("columnMoved",this.handleManualColumnChange),this.api.removeEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.removeEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.removeEventListener("columnsReset",this.handleManualColumnChange),this.api.removeEventListener("filterChanged",this.handleManualColumnChange),this.api.removeEventListener("sortChanged",this.handleManualColumnChange)},this.fetchViews=async()=>{var i,t;0!==(null===(i=this.api.getColumnDefs())||void 0===i?void 0:i.length)&&(this.loading=1,this.refresh(),this.api.removeEventListener("gridColumnsChanged",this.fetchViews),this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,this.gridId&&(this.allViewData=await l(A(),this.gridId),this.filterData(),this.initialLoad&&this.setDefaultView()),this.loading=0)},this.setDefaultView=()=>{const i=this.filteredViews.find((i=>null==i?void 0:i.isDefault));i&&this.setActiveView(i),this.initialLoad=!1},this.filterData=()=>{var i,t;this.entityName=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.entityName,this.filteredViews=this.entityName?null===(t=this.allViewData)||void 0===t?void 0:t.filter((i=>(null==i?void 0:i.domain)===this.entityName)):this.allViewData,this.refresh()},this.setActiveView=i=>{var t,e;this.removeStateChangeListeners();const o=null===(t=null==i?void 0:i.gridViewGridViewGridConfiguration)||void 0===t?void 0:t.find((i=>1===i.gridViewGridConfigurationGridConfiguration.gridStateTypeId)),s=null===(e=null==i?void 0:i.gridViewGridViewGridConfiguration)||void 0===e?void 0:e.find((i=>4===i.gridViewGridConfigurationGridConfiguration.gridStateTypeId));if(o){const i={state:JSON.parse(o.gridViewGridConfigurationGridConfiguration.values),applyOrder:!0};this.api.applyColumnState(i)}this.api.setFilterModel(s?JSON.parse(s.gridViewGridConfigurationGridConfiguration.values):null),this.handleSidesheetClose(),T((()=>{this.activeView=i,this.refresh(),setTimeout(this.addStateChangeListeners,300)}))},this.deleteView=async i=>{this.loading=1,this.refresh(),await h(i.gridViewId,(()=>{this.fetchViews()})),this.loading=0,this.refresh()},this.postViewCallback=()=>{this.loading=0,this.fetchViews(),this.handleDialogClose()},this.removeActiveView=()=>{this.removeStateChangeListeners(),this.api.resetColumnState(),this.api.setFilterModel(null),T((()=>{this.activeView=null,this.refresh()}))},this.handleManualColumnChange=async()=>{this.removeStateChangeListeners(),this.activeView&&T((()=>{this.activeView=null,this.refresh()}))},this.handleNameChange=i=>{this.viewName=i.target.value,this.refresh()},this.handleViewIsPrivateToggleChange=()=>{this.viewIsPrivate=!this.viewIsPrivate,this.refresh()},this.handleSidesheetClose=()=>{this.isSidesheetOpen=!1,this.refresh()},this.handleDialogClose=()=>{this.isDialogOpen=!1,this.viewName="",this.refresh()},this.handleOpenModal=()=>{this.isDialogOpen=!0,this.refresh()}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("gridColumnsChanged",this.fetchViews)}onAction(i){if("openSavedViews"===i){const i=this.api.getGridOption("context");(null==i?void 0:i.gridId)!==this.gridId?this.fetchViews():(null==i?void 0:i.entityName)!==this.entityName&&this.filterData(),this.isSidesheetOpen=!0,this.refresh()}}async postView(){var i,t;this.loading=1,this.refresh();const e=[];e.push({gridStateTypeId:1,gridId:null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,values:JSON.stringify(this.api.getColumnState())}),e.push({gridStateTypeId:4,gridId:null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,values:JSON.stringify(this.api.getFilterModel())});const o=this.api.getGridOption("context");try{await u(A(),null==o?void 0:o.gridId,y(),this.viewName,null==o?void 0:o.entityName,e,!0===this.viewIsPrivate?1:2,0,this.postViewCallback)}catch(i){console.error(i)}finally{this.refresh()}}async updateViewMarkedAsPrimary(i){this.loading=1,this.refresh();const t=this.api.getGridOption("context"),e=null==i?void 0:i.isDefault;await p(null==i?void 0:i.gridViewId,A(),null==t?void 0:t.gridId,y(),null==i?void 0:i.name,e?0:1,null==t?void 0:t.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).then((async()=>{if(!e){const i=this.filteredViews.find((i=>null==i?void 0:i.isDefault));i&&await p(null==i?void 0:i.gridViewId,A(),null==t?void 0:t.gridId,y(),null==i?void 0:i.name,0,null==t?void 0:t.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).catch((i=>console.log(i)))}await this.fetchViews(),this.loading=0,this.refresh()})).catch((i=>console.log(i)))}render(){var t,e;return i("div",null,i("div",{style:{viewTransitionName:"active-view-chip"},class:"grid-action-transition"},this.activeView&&i("div",{style:{margin:"4px"}},i("udp-chip",{label:null===(t=this.activeView)||void 0===t?void 0:t.name,variant:"filled",color:"secondary",deleteButton:!0,onChipDelete:this.removeActiveView}))),i("udp-dialog",{open:this.isDialogOpen,actionOne:()=>{this.postView()},actionTwo:this.handleDialogClose,handleClose:this.handleDialogClose,labelOne:"Create View",labelTwo:"Cancel",title:"Create a grid view",message:"The view will be created from the current column and filter state.",disableOne:!this.viewName,progress:this.loading},i("div",{style:{display:"flex",flexDirection:"column"}},i("div",{style:{marginBottom:"-4px",marginTop:"2em"}},i("text-field",{value:this.viewName,onInput:this.handleNameChange,placeholder:"View name"})),i("div",{style:{marginTop:"-4px"}},i("stencil-toggle",{label:"Private",checked:this.viewIsPrivate,onChange:this.handleViewIsPrivateToggleChange})))),i("udp-side-sheet",{title:"Views",open:this.isSidesheetOpen,position:"right",onUdpSideSheetClose:this.handleSidesheetClose,headerActionButtonLabel:"Create View",onUdpHeaderActionButtonClick:this.handleOpenModal,headerActionButtonIcon:"add",loading:!!this.loading},i("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},i("hint-panel",{hint:"Quickly access and manage your pre-configured grid views. These views are designed to help you focus on specific sets of data and streamline your workflow.",hideHintText:"Dismiss"}),this.entityName&&i("hint-panel",{hint:"Note: Displaying entity specific views."}),i("div",null,(null===(e=this.filteredViews)||void 0===e?void 0:e.length)>0?this.filteredViews.map((t=>{var e;return i("udp-list-item",{primaryText:t.name,clickable:!0,onListItemClick:()=>this.setActiveView(t)},i("div",{style:{display:"flex",flexDirection:"row",gap:"4px"},slot:"status-chip"},(null===(e=this.activeView)||void 0===e?void 0:e.gridViewId)===t.gridViewId&&i("udp-chip",{label:"Active",color:"success",variant:"filled"}),1===t.gridViewVisibilityTypeId&&i("udp-chip",{label:"Private",color:"gray",variant:"outlined"})),i("div",{slot:"actions"},i("udp-icon-button",{icon:f("star"),size:"small",variant:t.isDefault?"contained":"text",tooltip:2===t.gridViewVisibilityTypeId?"Cannot mark public view as primary":t.isDefault?"Remove as primary":"Mark as primary",onClick:()=>this.updateViewMarkedAsPrimary(t),disabled:2===t.gridViewVisibilityTypeId}),i("udp-icon-button",{icon:f("trashCan"),size:"small",variant:"text",tooltip:t.userId!==A()?"Cannot delete public view with different owner":"Delete View",onClick:()=>this.deleteView(t),disabled:t.userId!==A()})))})):i("udp-empty-state-display",{primaryText:"No Views to display"})))))}},agGridSizeColumnsToFit:class{init(i){this.gridApi=i}onAction(i){"agGridSizeColumnsToFit"===i&&this.gridApi.sizeColumnsToFit()}},agGridAutoSizeColumns:class{init(i){this.gridApi=i}onAction(i){"agGridAutoSizeColumns"===i&&this.gridApi.autoSizeAllColumns()}},bulkActions:class{constructor(){this.bulkActions=[],this.selectedRowCount=0,this.fetchedData=!1,this.isMenuOpen=!1,this.onRowSelectionChanged=()=>{var i;T((()=>{const i=this.api.getSelectedRows();this.selectedRows=i,this.selectedRowCount=i.length,this.refresh()})),this.fetchedData&&(null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId)===this.gridId||this.fetchBulkActions()},this.setBulkActions=i=>{const t=i.map((i=>({label:i.name,onClick:()=>this.executeActionProviderAction(i.actionId)}))),e=this.localFunctions.map((i=>({label:i.label,onClick:()=>this.executeLocalFunction(i.label)})));this.bulkActions=[...t,...e],this.fetchedData=!0,this.refresh()},this.executeLocalFunction=i=>{const t=this.localFunctions.find((t=>t.label===i));t&&t.callback(this.selectedRows),this.refresh()},this.executeActionProviderAction=i=>{this.actionProviderCallback&&this.actionProviderCallback(i,this.selectedRows),this.refresh()},this.toggleMenu=()=>{this.isMenuOpen=!this.isMenuOpen,this.refresh()},this.closeMenu=()=>{this.isMenuOpen=!1,this.refresh()}}init(i,t,e){this.api=i,this.refresh=t,this.actionProviderCallback=null==e?void 0:e.actionProviderCallback,this.localFunctions=null==e?void 0:e.localFunctions;const o=this.api.getGridOption("rowModelType");this.api.setGridOption("rowSelection","clientSide"===o?{mode:"multiRow",enableClickSelection:!0}:{mode:"multiRow",enableClickSelection:!0,headerCheckbox:!1}),this.api.addEventListener("selectionChanged",this.onRowSelectionChanged)}onAction(i){"executeBulkAction"===i&&this.refresh()}async fetchBulkActions(){var i;try{this.gridId=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,await b(this.gridId,!1,[],this.setBulkActions)}catch(i){console.error(i)}}render(){var t;return i("div",{style:{viewTransitionName:"bulk-action-button"},class:"grid-action-transition"},this.selectedRowCount>0&&[i("div",{style:{margin:"2px"}},i("udp-button",{ref:i=>{this.menuAnchorEl=i||void 0},onClick:this.toggleMenu,variant:"outlined",color:"primary",endIcon:i("udp-icon",{iconName:"chevronDown",style:{transform:this.isMenuOpen?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"}})},`${this.selectedRowCount} Selected`)),i("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:this.closeMenu},0===(null===(t=this.bulkActions)||void 0===t?void 0:t.length)?i("udp-menu-item",{label:"No available actions"}):this.bulkActions.map((t=>i("udp-menu-item",{label:t.label,onItemClick:()=>{t.onClick(),this.isMenuOpen=!1}}))))])}},chipFilter:class{constructor(){this.handleFilterChanged=i=>{var t,e,o;const s=null===(e=null===(t=null==i?void 0:i.columns)||void 0===t?void 0:t[0])||void 0===e?void 0:e.colId,n=null===(o=this.filterChips)||void 0===o?void 0:o.find((i=>i.field===s));if(n){const i=this.api.getColumnFilterModel(s),t=Object.assign(Object.assign({},n),{filterObjects:n.filterObjects.map((t=>{let e=!1;return(null==i?void 0:i.conditions)&&"AND"===(null==i?void 0:i.operator)?e=i.conditions.some((i=>JSON.stringify(i)===JSON.stringify(t.agGridFilterModel[s]))):i&&(e=JSON.stringify(i)===JSON.stringify(t.agGridFilterModel[s])),Object.assign(Object.assign({},t),{toggled:e})}))});this.filterChips=this.filterChips.map((i=>i.field===s?t:i)),this.refresh()}},this.syncChipsWithGridFilters=()=>{if(!this.filterChips||0===this.filterChips.length)return;const i=this.filterChips.map((i=>{const t=i.field,e=this.api.getColumnFilterModel(t);if(!e)return i;const o=i.filterObjects.map((i=>{let o=!1;return o=(null==e?void 0:e.conditions)&&"AND"===(null==e?void 0:e.operator)?e.conditions.some((e=>JSON.stringify(e)===JSON.stringify(i.agGridFilterModel[t]))):JSON.stringify(e)===JSON.stringify(i.agGridFilterModel[t]),Object.assign(Object.assign({},i),{toggled:o})}));return Object.assign(Object.assign({},i),{filterObjects:o})}));this.filterChips=i},this.getGridfilterChips=async()=>{var i,t;if(this.gridId!==(null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId)){this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId;const i=(await m(this.gridId,7)).map((i=>JSON.parse(i.values)));T((async()=>{this.filterChips=i.map((i=>Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>Object.assign(Object.assign({},i),{toggled:!1})))}))),this.syncChipsWithGridFilters(),this.getFilterChipCounts(),this.refresh()}))}},this.getFilterChipCounts=async()=>{var i;const t={pageNumber:1,pageSize:1,filterElements:[],filterGroups:[],orderElements:[],groupingType:"",groupProperty:[],groupOperationList:[],eagerLoad:!1,logicalSearchOperator:1},e=[];for(const o of this.filterChips){if(!(null==o?void 0:o.udpDomainSanitizedName))continue;const s=await v(y(),o.udpDomainSanitizedName,!0);for(const n of null!==(i=o.filterObjects)&&void 0!==i?i:[])(null==n?void 0:n.udpFilterElement)&&e.push((async()=>{var i;const e=Object.assign(Object.assign({},t),{filterElements:[n.udpFilterElement]});return{result:await g(e,null===(i=null==s?void 0:s.unityBaseSearchMethod)||void 0===i?void 0:i.apiMethodId,x.config.UNITY_API_DOMAIN,!1),groupField:o.field,objLabel:n.label}})())}const o=await Promise.all(e);this.filterChips=this.filterChips.map((i=>{const t=o.filter((t=>t.groupField===i.field));return Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>{var e,o;const s=t.find((t=>t.objLabel===i.label));return Object.assign(Object.assign({},i),{resultCount:null!==(o=null===(e=null==s?void 0:s.result)||void 0===e?void 0:e.total)&&void 0!==o?o:null})}))})})),this.refresh()},this.setSelectedFilterChip=i=>{this.filterChips=this.filterChips.map((t=>Object.assign(Object.assign({},t),{filterObjects:t.filterObjects.map((t=>t.label===i.label?Object.assign(Object.assign({},t),{toggled:!t.toggled}):t))}))),this.refresh();const t=Object.keys(i.agGridFilterModel)[0];!function(i,t,e){var o,s;const n=i.getColumn(t);if(!n)return void console.error("Invalid column id provided for filtering");if(!(null===(o=null==n?void 0:n.colDef)||void 0===o?void 0:o.filter))return void console.error(`Filtering not enabled for column: ${null==n?void 0:n.colId}`);const a=i.getColumnFilterModel(t);if(JSON.stringify(e)!==JSON.stringify(a)){if(null===(s=null==a?void 0:a.conditions)||void 0===s?void 0:s.some((i=>JSON.stringify(i)===JSON.stringify(e)))){const o=null==a?void 0:a.conditions.filter((i=>JSON.stringify(i)!==JSON.stringify(e)));if(1===o.length)return void i.setColumnFilterModel(t,o[0]).then((()=>i.onFilterChanged()));{const e=Object.assign(Object.assign({},a),{conditions:o});return void i.setColumnFilterModel(t,e).then((()=>i.onFilterChanged()))}}if(a)if(null==a?void 0:a.conditions){const o=[...null==a?void 0:a.conditions,e];i.setColumnFilterModel(t,{conditions:o,operator:"AND"}).then((()=>i.onFilterChanged()))}else a&&i.setColumnFilterModel(t,{conditions:[Object.assign({},a),e],operator:"AND"}).then((()=>i.onFilterChanged()));else i.setColumnFilterModel(n,e).then((()=>i.onFilterChanged()))}else i.setColumnFilterModel(t,null).then((()=>i.onFilterChanged()))}(this.api,t,i.agGridFilterModel[t])}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("firstDataRendered",this.getGridfilterChips),this.api.addEventListener("filterChanged",this.handleFilterChanged)}onAction(i){"chipFilter"===i&&this.refresh()}render(){var t;return i("div",{class:"grid-action-transition",style:{display:"flex",flexWrap:"nowrap",gap:"5px",viewTransitionName:"view-chip-filters"}},(null===(t=this.filterChips)||void 0===t?void 0:t.length)>0&&this.filterChips.map(((t,e)=>[e>0&&i("div",{style:{width:"1px",backgroundColor:"#ddd",marginBottom:"5px",marginTop:"5px"}}),i("div",{style:{padding:"4px",display:"flex",flexWrap:"nowrap",gap:"3px"}},t.filterObjects.map((t=>i("udp-chip",{label:`${t.label} ${null!=t.resultCount?`(${t.resultCount})`:""}`,variant:t.toggled?"filled":"outlined",clickable:!0,onChipClick:()=>this.setSelectedFilterChip(t),color:"primary"}))))])))}},restoreGridState:class{constructor(){this.getPreviousState=()=>{T((()=>{this.api.removeEventListener("stateUpdated",this.saveState);const i=this.api.getGridOption("context");this.gridId=null==i?void 0:i.gridId,this.apiMethodInstanceId=(null==i?void 0:i.apiMethodInstanceId)||"",this.previousState=JSON.parse(localStorage.getItem(this.getStorageKey())),this.refresh(),this.api.addEventListener("stateUpdated",this.saveState)}))},this.getStorageKey=()=>{const i=k();return`saved-grid-state-${this.gridId}-${this.apiMethodInstanceId}-${i}`},this.saveState=()=>{const i=this.api.getGridOption("context");if((null==i?void 0:i.gridId)!==this.gridId||(null==i?void 0:i.apiMethodInstanceId)&&(null==i?void 0:i.apiMethodInstanceId)!==this.apiMethodInstanceId)this.getPreviousState();else{const i=this.api.getState();localStorage.setItem(this.getStorageKey(),JSON.stringify({date:new Date,state:i}))}},this.restoreState=async()=>{this.api.setState(this.previousState.state),setTimeout((()=>T((()=>{this.previousState=null,this.refresh()}))),0)},this.dismissMessage=()=>{T((()=>{this.previousState=null,this.refresh()}))}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("firstDataRendered",this.getPreviousState)}getTimeAgo(i){const t=Math.floor((Date.now()-i.getTime())/1e3);if(t<60)return`${t} second${1!==t?"s":""} ago`;const e=Math.floor(t/60);if(e<60)return`${e} minute${1!==e?"s":""} ago`;const o=Math.floor(e/60);if(o<24)return`${o} hour${1!==o?"s":""} ago`;const s=Math.floor(o/24);return`${s} day${1!==s?"s":""} ago`}render(){var t;return i("div",{style:{viewTransitionName:"restore-grid-state"}},(null===(t=this.previousState)||void 0===t?void 0:t.date)&&i("div",{style:{margin:"4px"}},i("udp-ambient-tool-tip",{content:`Restore grid state from ${this.getTimeAgo(new Date(this.previousState.date))}?`},i("udp-chip",{startIcon:"rotate",label:"Restore state",variant:"outlined",color:"gray",deleteButton:!0,onChipDelete:this.dismissMessage,clickable:!0,onClick:this.restoreState}))))}},agGridResetColumns:class{init(i){this.gridApi=i}onAction(i){"agGridResetColumns"===i&&(this.gridApi.resetColumnState(),this.gridApi.setFilterModel(null))}},advancedSearch:class{init(i,t,e){this.onOpenCallback=null==e?void 0:e.callback}onAction(i){var t;"advancedSearch"===i&&(null===(t=this.onOpenCallback)||void 0===t||t.call(this))}},agGridHideShowColumns:class{init(i){this.gridApi=i}onAction(i){"agGridHideShowColumns"===i&&this.gridApi.showColumnChooser()}},udpExport:class{init(i,t,e){this.onOpenCallback=null==e?void 0:e.callback,this.api=i}onAction(i){var t;if("udpExport"===i){const i=this.api.getGridOption("context");null===(t=this.onOpenCallback)||void 0===t||t.call(this,null==i?void 0:i.searchObject,null==i?void 0:i.entityName)}}}},D=i=>{const t=i.value;if(null==t)return"";const e=new Date(t);return e?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`:""},G=a.withParams({wrapperBorderRadius:0,wrapperBorder:!1,headerCellHoverBackgroundColor:"var(--udp-grid-column-header-bg-hover)",borderColor:"#E9ECEF"}),E=class{constructor(i){t(this,i),this.gridReady=e(this,"gridReady"),this.headerConfig={},this.gridFunctions=[],this.refreshKey=0,this.gridFunctionInstances=[],this.updateGridHeight=()=>{if(this.gridEl){const i=this.gridEl.getBoundingClientRect(),t=window.innerHeight-i.top,e=10;this.gridEl.style.height=(t-e>400?t-e:400)+"px"}},this.scheduleHeightUpdate=()=>{clearTimeout(this.resizeDebounce),this.resizeDebounce=setTimeout(this.updateGridHeight,100)},this.refreshGridFunctions=()=>{this.refreshKey++},this.onGridReady=i=>{this.gridApi=i.api,this.updateGridContextValues(),this.gridFunctionInstances=this.gridFunctions.map((i=>{const t=F[i.name];if(!t)return null;const e=new t;return e.init(this.gridApi,this.refreshGridFunctions,i.params),e})).filter((i=>!!i)),this.gridApiCallback&&this.gridApiCallback({refreshServerSide:()=>this.gridApi.refreshServerSide(),getSelectedRows:()=>this.gridApi.getSelectedRows(),getSelectedNodes:()=>this.gridApi.getSelectedNodes(),getSearchObject:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.searchObject},getEntityName:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.entityName},getRowCount:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.rowCount},getFilterModel:()=>this.gridApi.getFilterModel(),setFilterModel:i=>this.gridApi.setFilterModel(i),onFilterChanged:()=>this.gridApi.onFilterChanged(),expandAll:()=>this.gridApi.expandAll(),collapseAll:()=>this.gridApi.collapseAll(),toggleLoadingOverlay:i=>this.gridApi.setGridOption("loading",i),refreshCells:()=>this.gridApi.refreshCells(),refreshClientSideRowModel:i=>this.gridApi.refreshClientSideRowModel(i),selectAll:(i,t)=>this.gridApi.selectAll(i,t),deselectAll:(i,t)=>this.gridApi.deselectAll(i,t),getServerSideSelectionState:()=>this.gridApi.getServerSideSelectionState(),setServerSideSelectionState:i=>this.gridApi.setServerSideSelectionState(i),forEachNode:i=>this.gridApi.forEachNode(i),forEachNodeAfterFilterAndSort:i=>this.gridApi.forEachNodeAfterFilterAndSort(i)}),this.setColumnDefs(),this.gridReady.emit(this.gridApi)},this.onHeaderAction=i=>{this.gridFunctionInstances.forEach((t=>{var e;return null===(e=t.onAction)||void 0===e?void 0:e.call(t,i.detail.name,i.detail.payload)}))},this.updateGridContextValues=()=>{this.gridApi.setGridOption("context",Object.assign(Object.assign({},this.gridApi.getGridOption("context")),{entityName:this.entityName,gridId:this.gridId}))}}componentWillLoad(){n.registerModules([c]),d.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-080613}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Univerus_Software_Inc}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{MAIS_eRec}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{MAIS_eRec}_need_to_be_licensed___{MAIS_eRec}_has_not_been_granted_a_Deployment_License_Add-on___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{28_June_2026}____[v3]_[01]_MTc4MjYwMTIwMDAwMA==5c7d1487ecb13b28e75415d34b7cf694")}componentDidLoad(){var i,t,e,o;const s=Object.assign(Object.assign({tooltipShowMode:"whenTruncated",tooltipShowDelay:500},this.gridOptions),{columnTypes:{booleanChip:{cellRenderer:"iconRenderer",cellRendererParams:{iconMappingConfig:{true:{iconName:"checkMark24",color:"success"},false:{iconName:"close24",color:"error"}}}}},dataTypeDefinitions:{dateTimeString:{baseDataType:"dateTimeString",extendsDataType:"dateTimeString",valueFormatter:D},boolean:{baseDataType:"boolean",extendsDataType:"boolean",columnTypes:"booleanChip"}},gridId:this.gridId,onGridReady:this.onGridReady,theme:G,components:Object.assign({actionsRenderer:O,currencyRenderer:S,dateTimeCellRenderer:_,iconRenderer:C,statusRenderer:w},null===(i=this.gridOptions)||void 0===i?void 0:i.components),domLayout:"normal",defaultColDef:Object.assign(Object.assign({sortable:!0,filter:!0,flex:1,minWidth:150,suppressHeaderMenuButton:!0},null===(t=this.gridOptions)||void 0===t?void 0:t.defaultColDef),{filterParams:Object.assign({buttons:["reset","apply"],closeOnApply:!0,maxNumConditions:10},null===(o=null===(e=this.gridOptions)||void 0===e?void 0:e.defaultColDef)||void 0===o?void 0:o.filterParams)})});r(this.el.querySelector("#myNewGrid"),s),this.gridHeight?this.gridEl.style.height=this.gridHeight:(this.updateGridHeight(),this.resizeObserver=new ResizeObserver(this.scheduleHeightUpdate),this.resizeObserver.observe(this.gridContainerEl))}disconnectedCallback(){var i;null===(i=this.gridApi)||void 0===i||i.destroy()}handleUpdateColumnDefs(i,t){j(i,t)||this.setColumnDefs()}setColumnDefs(){var i;if(this.columnDefs&&this.gridApi){const t=N(this.columnDefs,null===(i=this.gridFunctions)||void 0===i?void 0:i.some((i=>"advancedSearch"===(null==i?void 0:i.name))));this.gridApi.setGridOption("columnDefs",t)}}handleEntityNameChange(){this.updateGridContextValues()}render(){var t;const e=`variant-${(null===(t=this.headerConfig)||void 0===t?void 0:t.variant)||"light"}`;return i("div",{key:"24fa82598a8b3c7cd8908d279dd5d55fa56fb059",class:e,ref:i=>this.gridContainerEl=i},i("ghost-render",{key:"5a135714392f7edb7fee6d2146e231971ed0ca93"},i("div",{key:"f8a3749c2bff52ca09f110152d2a0c9d61d8458c"},i("udp-dialog",{key:"7c245a75a383f6acc3df2eae99beb1eca1b0ce3b"}),i("udp-list-item",{key:"00c826a169725fe7950b5f48e6c6018554885eaf"}),i("hint-panel",{key:"e36c1b28357c275c6d71caa245a5e5dfc0dcf8a8"}),i("udp-side-sheet",{key:"26ce13c227185842de854c0dca352a5bae875038"}))),i("div",{key:"97ec4f0e8a4e464965fddc7d27807797bf9690b1",class:"grid-base-header"},i("grid-header",{key:"2af72231d327d5ff5c6b6c082ca24c8389b71db6",headerConfig:this.headerConfig,gridFunctions:this.gridFunctions,onHeaderAction:this.onHeaderAction}),i("div",{key:"b3464f54b3c57d19d2deaa673e7a6b483573fa6c",class:"action-bar",style:{viewTransitionName:"action-bar"}},this.gridFunctionInstances.map((i=>{var t;return null===(t=i.render)||void 0===t?void 0:t.call(i)})))),i("div",{key:"851c7e4d8f06734ad7a0e5e5119ed61eb8556c57",id:"myNewGrid",ref:i=>this.gridEl=i,style:{viewTransitionName:"my-new-grid"}}))}get el(){return o(this)}static get watchers(){return{columnDefs:[{handleUpdateColumnDefs:0}],entityName:[{handleEntityNameChange:0}],gridId:[{handleEntityNameChange:0}]}}};E.style=":root{--udp-grid-base-header-bg:#EBECEF;--udp-grid-base-header-text:#000;--udp-grid-action-divider-color:rgba(0, 0, 0, 0.3);--udp-grid-action-bar-border-color:rgb(202, 197, 197)}.variant-dark{--udp-grid-base-header-bg:var(--primary-color-dark);--udp-grid-action-bar-bg:#F8F9FA;--udp-grid-column-header-bg:#F8F9FA;--udp-grid-column-header-bg-hover:#dce6f2;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}.variant-light{--udp-grid-base-header-bg:#d8dfe6;--udp-grid-action-bar-bg:#f4f6f8;--udp-grid-column-header-bg:#f2f4f5;--udp-grid-column-header-bg-hover:#eef3f9;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}::view-transition-group(*){animation-duration:0.2s}.grid-base-header{background-color:var(--udp-grid-base-header-bg);color:var(--udp-grid-base-header-text)}.action-bar{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;background-color:var(--udp-grid-action-bar-bg);color:var(--udp-grid-action-bar-text-color);padding:0px 8px 0px 12px;border-bottom:1px solid var(--udp-grid-action-bar-border-color)}.grid-wrapper{display:flex;flex-direction:column;height:100%}#myNewGrid{flex:1}";const I=class{constructor(i){t(this,i)}render(){return i(s,{key:"77d50c2b9c9ccbb58d00b4928fcbed63d13c1010"},i("slot",{key:"30730a259776f1452fca147be792d928ba2ee996"}))}};I.style=":host {\n display: none;\n }";const R=class{constructor(i){t(this,i),this.headerAction=e(this,"headerAction"),this.isMenuOpen=!1,this.toggleSettingsMenu=()=>{this.isMenuOpen=!this.isMenuOpen}}action(i,t){this.headerAction.emit({name:i,payload:t})}render(){var t,e,o,s,n,a,r,c,d,l,h,u,p,b,m,v,g,y,x,k,w,C,_,S;const O=!!(null===(e=null===(t=this.headerConfig)||void 0===t?void 0:t.title)||void 0===e?void 0:e.replace(/\u00A0/g," ").trim()),N=!!(null===(s=null===(o=this.headerConfig)||void 0===o?void 0:o.primaryActionButton)||void 0===s?void 0:s.label),j=((null===(a=null===(n=this.headerConfig)||void 0===n?void 0:n.secondaryActionButtons)||void 0===a?void 0:a.length)||0)>0,A=((null===(r=this.gridFunctions)||void 0===r?void 0:r.length)||0)>0;if(!(O||N||j||A))return null;const T=`variant-${(null===(c=this.headerConfig)||void 0===c?void 0:c.variant)||"light"}`,F=new Set(this.gridFunctions.map((i=>i.name))),D=["agGridSizeColumnsToFit","agGridAutoSizeColumns","agGridHideShowColumns","agGridResetColumns","agGridExport"].some((i=>F.has(i)));return i("div",{class:`header-bar ${T}`},i("unity-typography",{variant:"h6",color:"inherit"},this.headerConfig.title),i("div",{class:"actions"},D&&i("udp-icon-button",{class:{"settings-button":!0,"is-open":this.isMenuOpen},onClick:this.toggleSettingsMenu,ref:i=>{this.menuAnchorEl=i||void 0},icon:f("settings"),variant:"outlined",size:"small",color:"inherit"}),i("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:()=>this.isMenuOpen=!1},F.has("agGridSizeColumnsToFit")&&i("udp-menu-item",{label:"Size Columns To Fit",iconName:"fitToWidth",onItemClick:()=>this.action("agGridSizeColumnsToFit")}),F.has("agGridAutoSizeColumns")&&i("udp-menu-item",{label:"Auto Size Columns",iconName:"column",onItemClick:()=>this.action("agGridAutoSizeColumns")}),F.has("agGridHideShowColumns")&&i("udp-menu-item",{label:"Hide/Show Columns",iconName:"hideColumn",onItemClick:()=>this.action("agGridHideShowColumns")}),F.has("agGridResetColumns")&&i("udp-menu-item",{label:"Reset Columns",iconName:"reset",onItemClick:()=>this.action("agGridResetColumns")}),F.has("agGridExport")&&i("udp-menu-item",{label:"CSV Export",iconName:"export",onItemClick:()=>this.action("agGridExport")})),F.has("openSavedViews")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"dataTable",label:"Views",clickable:!0,onChipClick:()=>this.action("openSavedViews"),size:"medium"}),F.has("udpExport")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"export",label:"Export",clickable:!0,onChipClick:()=>this.action("udpExport"),size:"medium"}),F.has("advancedSearch")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"search",label:"Search",clickable:!0,onChipClick:()=>this.action("advancedSearch"),size:"medium"}),i("div",{class:"secondary-actions"},null===(l=null===(d=this.headerConfig)||void 0===d?void 0:d.secondaryActionButtons)||void 0===l?void 0:l.map((t=>i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:null==t?void 0:t.iconName,label:null==t?void 0:t.label,clickable:!(null==t?void 0:t.disabled),onChipClick:t.onClick,size:"medium"})))),i("div",{class:"primary-action"},(null===(u=null===(h=this.headerConfig)||void 0===h?void 0:h.primaryActionButton)||void 0===u?void 0:u.label)&&i("udp-button",{variant:"contained",onButtonClick:null===(b=null===(p=this.headerConfig)||void 0===p?void 0:p.primaryActionButton)||void 0===b?void 0:b.onClick,color:"secondary",disabled:null===(v=null===(m=this.headerConfig)||void 0===m?void 0:m.primaryActionButton)||void 0===v?void 0:v.disabled,loading:null===(y=null===(g=this.headerConfig)||void 0===g?void 0:g.primaryActionButton)||void 0===y?void 0:y.loading,endIcon:(null===(k=null===(x=this.headerConfig)||void 0===x?void 0:x.primaryActionButton)||void 0===k?void 0:k.iconName)&&i("udp-icon",{iconName:null===(C=null===(w=this.headerConfig)||void 0===w?void 0:w.primaryActionButton)||void 0===C?void 0:C.iconName,color:"inherit"})},null===(S=null===(_=this.headerConfig)||void 0===_?void 0:_.primaryActionButton)||void 0===S?void 0:S.label))))}};R.style=".header-bar{display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-03) var(--spacing-03) var(--spacing-03) var(--spacing-05);font-family:'Segoe UI', Tahoma, sans-serif;color:var(--grid-header-text);min-height:42px}.header-bar.variant-dark{--grid-header-text:#FFFFFF;--grid-header-icon-hover-bg:rgba(255, 255, 255, 0.12);}.header-bar.variant-light{--grid-header-text:black;--grid-header-icon-hover-bg:rgba(0, 0, 0, 0.08)}.header-bar .header-title{color:inherit;margin:0;white-space:nowrap}.header-bar .actions{display:flex;gap:0.4rem;flex-wrap:nowrap;align-items:center}.header-bar .secondary-actions{display:flex;gap:0.4rem}.menu-trigger-wrapper{position:relative;display:inline-flex}.settings-button{transition:transform 0.2s ease-in-out}.settings-button.is-open{transform:rotate(45deg)}";const z=class{constructor(i){t(this,i),this.showHint=!0,this.handleHideHint=()=>{this.showHint=!1}}render(){return i("div",{key:"a12706b04206a3155c828c4a3c74ab93f4f9a54b",class:"hint-container"},this.showHint&&i("div",{key:"61c421a9227f8da52e07b5a27c122aae9cbe7bd8",class:"hint-content"},i("div",{key:"e7e196b3de4cb3eff963e5663acb4b3665caa885"},i("unity-typography",{key:"326bafd6cc82f8020e49f59a5cd35174715bb34e",variant:"body"}," ",this.hint," ")),this.hideHintText&&i("div",{key:"8ff552c3eadde4f86cd793826bf5d2da1a6253f8",class:"hide-help"},i("udp-button",{key:"c4b13f7784eab8a0796d212489614cdd58bd6fe2",size:"small",color:"info",onClick:this.handleHideHint},this.hideHintText))))}};z.style=".hint-container{border-left:3px solid var(--info-color-main)}.hint-content{background-color:color-mix(in srgb, var(--info-color-hint) 70%, transparent);padding:8px}.hide-help{display:flex;justify-content:flex-end;margin-top:0.5rem}";const M=class{constructor(i){t(this,i),this.open=!1,this.titleId="dialog-title",this.descriptionId="dialog-description",this.buttonOneHidden=!1,this.buttonTwoHidden=!1,this.buttonThreeHidden=!0,this.originalBodyOverflow="",this.handleTransitionEnd=()=>{this.open||this.hostEl.parentElement!==document.body||document.body.removeChild(this.hostEl)},this.handleKeyDown=i=>{"Escape"===i.key&&this.handleClose&&this.handleClose()},this.handleOverlayClick=()=>{this.handleClose&&this.handleClose()}}handleOpenChange(i){i?(this.originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",document.body.appendChild(this.hostEl),document.addEventListener("keydown",this.handleKeyDown),requestAnimationFrame((()=>{this.hostEl.classList.add("is-visible")}))):(this.hostEl.classList.remove("is-visible"),document.body.style.overflow=this.originalBodyOverflow,document.removeEventListener("keydown",this.handleKeyDown),this.hostEl.addEventListener("transitionend",this.handleTransitionEnd,{once:!0}))}disconnectedCallback(){"hidden"===document.body.style.overflow&&(document.body.style.overflow=this.originalBodyOverflow),document.removeEventListener("keydown",this.handleKeyDown)}render(){return i(s,{key:"5a90e0cfa060c1363fb823be98a2f3f7ff5682ef",onClick:this.handleOverlayClick},i("div",{key:"8ab6dd81074d401ed22b436c9cc21c21ec0210f8",class:"dialog-container",role:"dialog","aria-modal":"true","aria-labelledby":this.titleId,"aria-describedby":this.descriptionId,onClick:i=>i.stopPropagation()},i("div",{key:"6b4181bceeecbe7d316d13e902897b9dcfd3dff1",class:"dialog-title",id:this.titleId},i("unity-typography",{key:"cdc44f463dc5cce8fcc583fdb9b140cd0b651df2",variant:"h3"},this.title)),i("div",{key:"1b5147acd9da752ef77ece211e645b020766a90e",class:"dialog-content",id:this.descriptionId},this.message&&i("unity-typography",{key:"e3056d62d5b19dc4ab59491cd35ff5e876d5af69",variant:"body"},this.message),i("slot",{key:"7e3077ebd768e66fb38c96635d9270baa4e26b68"})),i("div",{key:"049b0fd822a3a6fd44264bd0c98db78bbe8860dc",class:"dialog-actions"},!this.buttonTwoHidden&&i("udp-button",{key:"4e2451c51e0d7f687e6a20208f7b128c9fa93cc8",variant:"text",disabled:this.disableTwo,onClick:()=>this.actionTwo()},this.labelTwo),!this.buttonThreeHidden&&i("udp-button",{key:"ffce2387c9aa1aed65706eb3901687e2f1843618",variant:"text",disabled:this.disableThree,onClick:()=>this.actionThree()},this.labelThree),!this.buttonOneHidden&&i("udp-button",{key:"66b2adc47093fa6f8ace3460390f59081451d2b9",variant:"contained",disabled:this.disableOne,onClick:()=>this.actionOne(),loading:!!this.progress},this.labelOne))))}get hostEl(){return o(this)}static get watchers(){return{open:[{handleOpenChange:0}]}}};M.style=":host{position:fixed;top:0;left:0;width:0;height:0;overflow:hidden;transform:translate(0);z-index:100000;display:flex;align-items:center;justify-content:center;visibility:hidden;background-color:rgba(0, 0, 0, 0);transition:background-color 0.2s ease-out, visibility 0s 0.2s, width 0s 0.2s, height 0s 0.2s;}:host(.is-visible){visibility:visible;background-color:rgba(0, 0, 0, 0.5);width:100%;height:100%;overflow:visible;transition-delay:0s}.dialog-container{background-color:#fff;box-shadow:0 12px 24px rgba(0, 0, 0, 0.16), 0 12px 24px rgba(0, 0, 0, 0.23);max-width:90vw;width:500px;max-height:90vh;display:flex;flex-direction:column;opacity:0;transition:opacity 0.2s ease-out}:host(.is-visible) .dialog-container{opacity:1}.dialog-title{padding:16px;flex-shrink:0}.dialog-content{padding:0 16px;overflow-y:auto}.dialog-actions{padding:16px;display:flex;justify-content:flex-end;gap:8px;flex-shrink:0}";const $=class{constructor(i){t(this,i),this.listItemClick=e(this,"listItemClick"),this.hasPrimaryTextSlot=!1,this.hasSecondaryTextSlot=!1,this.hasActionsSlot=!1,this.hasStatusChipSlot=!1,this.avatarBackgroundColor="info",this.avatarVariant="rounded",this.clickable=!1,this.variant="normal",this.handleClick=i=>{i.composedPath().some((i=>{var t,e;return(null===(t=i.classList)||void 0===t?void 0:t.contains("actions-container"))||(null===(e=i.classList)||void 0===e?void 0:e.contains("status-chip-container"))}))||this.clickable&&(this.listItemClick.emit(i),this.onClick&&this.onClick(i))},this.handleKeyPress=i=>{!this.clickable||"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.handleClick(i))}}componentWillLoad(){this.hasPrimaryTextSlot=!!this.hostEl.querySelector('[slot="primary-text"]'),this.hasSecondaryTextSlot=!!this.hostEl.querySelector('[slot="secondary-text"]'),this.hasActionsSlot=!!this.hostEl.querySelector('[slot="actions"]'),this.hasStatusChipSlot=!!this.hostEl.querySelector('[slot="status-chip"]')}render(){const t=this.primaryText||this.hasPrimaryTextSlot,e=this.secondaryText||this.hasSecondaryTextSlot;return i(s,{key:"4e8edba80d5983c2f878b2ad0731b72238ea882e"},i("div",{key:"568adde99ec3bc362ab34d2c31c9e307002acac2",class:{"list-item":!0,clickable:this.clickable,"variant-compact":"compact"===this.variant},onClick:this.handleClick,onKeyPress:this.handleKeyPress,role:this.clickable?"button":void 0,tabindex:this.clickable?0:-1},this.iconName&&i("div",{key:"61b51b5dede1f2705dcc7b2825348a07c0a80efa",class:"avatar-container"},i("udp-avatar",{key:"108678bcb61b90c1390a54582e6388384d1ebd1e",iconName:this.iconName,variant:this.avatarVariant,color:this.avatarBackgroundColor})),i("div",{key:"10eac3586f355e87339e03d94ac41af2d1ef097b",class:"text-container"},t&&i("div",{key:"c3c0f2e589d2c5ba83840a6b08869f13d8ba2ff1",class:"primary-text"},i("slot",{key:"b01581a16a642c52e0700f7ccd19037d1b59958f",name:"primary-text"},i("unity-typography",{key:"01fcd927aeeb074067d03f795d123985f3a52bcb",variant:"body"},this.primaryText))),e&&i("div",{key:"a5bc8b98b185424a82d06d97a29ba4c2c32bc8c3",class:"secondary-text"},i("slot",{key:"da8cbda21c28f6ba5873d5eaf0f694ad906bb14f",name:"secondary-text"},i("unity-typography",{key:"f5d19214b90eb6c2b8a992dc43e529761d394d40",variant:"caption-text",color:"textSecondary"},this.secondaryText)))),this.hasStatusChipSlot&&i("div",{key:"3bcf146d66ec6671beefe002f3f5a84a2dd23944",class:"status-chip-container"},i("slot",{key:"9b5e6d67c50f113a52b3b20054a8d81a744d1f23",name:"status-chip"})),this.hasActionsSlot&&i("div",{key:"20a822232840d162030142618fcfc762d0d95e92",class:"actions-container"},i("slot",{key:"305560605b78e8f02ed30052e9013eb9b01b5a01",name:"actions"}))))}get hostEl(){return o(this)}};$.style=".list-item{display:flex;flex-direction:row;align-items:center;padding:var(--spacing-3, 12px) var(--spacing-4, 16px);background-color:var(--card-background-color, #FFF);transition:background-color 0.1s;gap:var(--spacing-4, 16px);position:relative}.list-item::after{content:'';position:absolute;bottom:0;height:1px;background-color:var(--border-color, #e0e0e0);left:var(--spacing-4, 16px);right:var(--spacing-4, 16px)}.list-item.variant-compact{padding-top:var(--spacing-1, 4px);padding-bottom:var(--spacing-1, 4px)}.list-item.clickable{cursor:pointer}.list-item.clickable:hover{background-color:color-mix(in srgb, var(--card-background-color, #FFF) 95%, black)}.avatar-container{align-items:center}.text-container{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.primary-text{font-weight:400;line-height:1.4}.secondary-text{margin-top:2px}.status-chip-container{display:flex;align-items:center;flex-shrink:0}.actions-container{display:flex;flex-shrink:0}";export{E as ag_grid_base,I as ghost_render,R as grid_header,z as hint_panel,M as udp_dialog,$ as udp_list_item}
|
|
1
|
+
import{h as i,r as t,c as e,a as o,H as s}from"./index-DFnjA9NX.js";import{ModuleRegistry as n,themeQuartz as a,createGrid as r}from"ag-grid-community-v33";import{AllEnterpriseModule as c,LicenseManager as d}from"ag-grid-enterprise-v33";import{x as l,i as h,s as u,u as p,p as b,y as m,w as v,o as g}from"./apiUtils-11-yfzUs.js";import{g as f}from"./iconUtils-DcPvHO4A.js";import{g as y}from"./getCurrentApiCatalogId-DeurXd9l.js";import{C as x}from"./configService-BqLfkVKh.js";import{g as k}from"./tenantUtils-Basdb1b1.js";import{S as w,I as C,D as _,C as S,A as O}from"./currency-renderer-D6zBtP2s.js";import{c as N}from"./configureUdpColumnMods-CoCTzhve.js";import j from"lodash/isEqual";import"deep-equal";import"./makeApiCall-2umiVB6u.js";import"axios";import"@stencil/store";import"./iconMapping-CPerGeNF.js";import"@carbon/icons/es/add/16";import"@carbon/icons/es/add/32";import"@carbon/icons/es/add--alt/16";import"@carbon/icons/es/add--filled/16";import"@carbon/icons/es/arrows--horizontal/16";import"@carbon/icons/es/attachment/16";import"@carbon/icons/es/batch-job/16";import"@carbon/icons/es/box/16";import"@carbon/icons/es/close/16";import"@carbon/icons/es/close/24";import"@carbon/icons/es/close/32";import"@carbon/icons/es/close--filled/16";import"@carbon/icons/es/close--outline/16";import"@carbon/icons/es/checkmark/16";import"@carbon/icons/es/checkmark/24";import"@carbon/icons/es/checkmark/32";import"@carbon/icons/es/chevron--left/16";import"@carbon/icons/es/chevron--right/16";import"@carbon/icons/es/chevron--down/16";import"@carbon/icons/es/data-enrichment/16";import"@carbon/icons/es/document/16";import"@carbon/icons/es/document--add/16";import"@carbon/icons/es/document--attachment/16";import"@carbon/icons/es/document--pdf/16";import"@carbon/icons/es/document--video/16";import"@carbon/icons/es/document--audio/16";import"@carbon/icons/es/draggable/16";import"@carbon/icons/es/edit/16";import"@carbon/icons/es/export/16";import"@carbon/icons/es/flag/16";import"@carbon/icons/es/information/16";import"@carbon/icons/es/information/32";import"@carbon/icons/es/link/16";import"@carbon/icons/es/overflow-menu--vertical/16";import"@carbon/icons/es/overflow-menu--vertical/32";import"@carbon/icons/es/return/16";import"@carbon/icons/es/save/16";import"@carbon/icons/es/settings/16";import"@carbon/icons/es/subtract/16";import"@carbon/icons/es/subtract--alt/16";import"@carbon/icons/es/subtract--filled/16";import"@carbon/icons/es/trash-can/16";import"@carbon/icons/es/user/16";import"@carbon/icons/es/view/16";import"@carbon/icons/es/warning/16";import"@carbon/icons/es/warning/32";import"@carbon/icons/es/warning--alt/16";import"@carbon/icons/es/warning--alt/32";import"@carbon/icons/es/product/16";import"@carbon/icons/es/workspace/16";import"@carbon/icons/es/arrow--up/16";import"@carbon/icons/es/arrow--down/16";import"@carbon/icons/es/arrow--right/16";import"@carbon/icons/es/arrow--left/16";import"@carbon/icons/es/copy/16";import"@carbon/icons/es/star/16";import"@carbon/icons/es/data-table/16";import"@carbon/icons/es/fit-to-width/16";import"@carbon/icons/es/search--advanced/16";import"@carbon/icons/es/reset/16";import"@carbon/icons/es/column/16";import"@carbon/icons/es/column--delete/16";import"@carbon/icons/es/watson-health/rotate--360/16";import"@carbon/icons/es/filter/16";import"@carbon/icons/es/app-connectivity/16";import"@carbon/icons/es/text--font/16";import"@carbon/icons/es/text--long-paragraph/16";import"@carbon/icons/es/character--whole-number/16";import"@carbon/icons/es/checkbox--checked/16";import"@carbon/icons/es/radio-button--checked/16";import"@carbon/icons/es/event--schedule/16";import"@carbon/icons/es/view--off/16";import"@carbon/icons/es/time/16";import"@carbon/icons/es/calendar/16";import"@carbon/icons/es/list--checked/16";import"@carbon/icons/es/list--bulleted/16";import"@carbon/icons/es/cloud--upload/16";import"@carbon/icons/es/locked/16";import"@carbon/icons/es/pause/16";import"@carbon/icons/es/unlocked/16";import"@carbon/icons/es/send/16";import"@carbon/icons/es/email/16";import"@carbon/icons/es/checkmark--outline/16";import"@carbon/icons/es/migrate--alt/16";import"@carbon/icons/es/checkbox--checked--filled/16";import"@carbon/icons/es/checkbox/16";import"@carbon/icons/es/ZIP/16";import"@carbon/icons/es/image/16";import"@carbon/icons/es/PPT/16";import"@carbon/icons/es/XLS/16";function A(){return sessionStorage.getItem("user-id")}const T=async i=>{(null===document||void 0===document?void 0:document.startViewTransition)?(document.viewTransition&&await document.viewTransition.finished,document.startViewTransition(i)):i()},F={agGridExport:class{constructor(i="export.csv"){this.fileName=i}init(i){this.gridApi=i}onAction(i){"agGridExport"===i&&this.gridApi.exportDataAsCsv({fileName:this.fileName})}},openSavedViews:class{constructor(){this.isSidesheetOpen=!1,this.isDialogOpen=!1,this.viewName="",this.viewIsPrivate=!0,this.filteredViews=[],this.allViewData=[],this.activeView=null,this.loading=0,this.initialLoad=!0,this.addStateChangeListeners=()=>{this.api.addEventListener("columnVisible",this.handleManualColumnChange),this.api.addEventListener("columnPinned",this.handleManualColumnChange),this.api.addEventListener("columnMoved",this.handleManualColumnChange),this.api.addEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.addEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.addEventListener("columnsReset",this.handleManualColumnChange),this.api.addEventListener("filterChanged",this.handleManualColumnChange),this.api.addEventListener("sortChanged",this.handleManualColumnChange)},this.removeStateChangeListeners=()=>{this.api.removeEventListener("columnVisible",this.handleManualColumnChange),this.api.removeEventListener("columnPinned",this.handleManualColumnChange),this.api.removeEventListener("columnMoved",this.handleManualColumnChange),this.api.removeEventListener("columnPivotChanged",this.handleManualColumnChange),this.api.removeEventListener("gridColumnsChanged",this.handleManualColumnChange),this.api.removeEventListener("columnsReset",this.handleManualColumnChange),this.api.removeEventListener("filterChanged",this.handleManualColumnChange),this.api.removeEventListener("sortChanged",this.handleManualColumnChange)},this.fetchViews=async()=>{var i,t;0!==(null===(i=this.api.getColumnDefs())||void 0===i?void 0:i.length)&&(this.loading=1,this.refresh(),this.api.removeEventListener("gridColumnsChanged",this.fetchViews),this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,this.gridId&&(this.allViewData=await l(A(),this.gridId),this.filterData(),this.initialLoad&&this.setDefaultView()),this.loading=0)},this.setDefaultView=()=>{const i=this.filteredViews.find((i=>null==i?void 0:i.isDefault));i&&this.setActiveView(i),this.initialLoad=!1},this.filterData=()=>{var i,t;this.entityName=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.entityName,this.filteredViews=this.entityName?null===(t=this.allViewData)||void 0===t?void 0:t.filter((i=>(null==i?void 0:i.domain)===this.entityName)):this.allViewData,this.refresh()},this.setActiveView=i=>{var t,e;this.removeStateChangeListeners();const o=null===(t=null==i?void 0:i.gridViewGridViewGridConfiguration)||void 0===t?void 0:t.find((i=>1===i.gridViewGridConfigurationGridConfiguration.gridStateTypeId)),s=null===(e=null==i?void 0:i.gridViewGridViewGridConfiguration)||void 0===e?void 0:e.find((i=>4===i.gridViewGridConfigurationGridConfiguration.gridStateTypeId));if(o){const i={state:JSON.parse(o.gridViewGridConfigurationGridConfiguration.values),applyOrder:!0};this.api.applyColumnState(i)}this.api.setFilterModel(s?JSON.parse(s.gridViewGridConfigurationGridConfiguration.values):null),this.handleSidesheetClose(),T((()=>{this.activeView=i,this.refresh(),setTimeout(this.addStateChangeListeners,300)}))},this.deleteView=async i=>{this.loading=1,this.refresh(),await h(i.gridViewId,(()=>{this.fetchViews()})),this.loading=0,this.refresh()},this.postViewCallback=()=>{this.loading=0,this.fetchViews(),this.handleDialogClose()},this.removeActiveView=()=>{this.removeStateChangeListeners(),this.api.resetColumnState(),this.api.setFilterModel(null),T((()=>{this.activeView=null,this.refresh()}))},this.handleManualColumnChange=async()=>{this.removeStateChangeListeners(),this.activeView&&T((()=>{this.activeView=null,this.refresh()}))},this.handleNameChange=i=>{this.viewName=i.target.value,this.refresh()},this.handleViewIsPrivateToggleChange=()=>{this.viewIsPrivate=!this.viewIsPrivate,this.refresh()},this.handleSidesheetClose=()=>{this.isSidesheetOpen=!1,this.refresh()},this.handleDialogClose=()=>{this.isDialogOpen=!1,this.viewName="",this.refresh()},this.handleOpenModal=()=>{this.isDialogOpen=!0,this.refresh()}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("gridColumnsChanged",this.fetchViews)}onAction(i){if("openSavedViews"===i){const i=this.api.getGridOption("context");(null==i?void 0:i.gridId)!==this.gridId?this.fetchViews():(null==i?void 0:i.entityName)!==this.entityName&&this.filterData(),this.isSidesheetOpen=!0,this.refresh()}}async postView(){var i,t;this.loading=1,this.refresh();const e=[];e.push({gridStateTypeId:1,gridId:null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,values:JSON.stringify(this.api.getColumnState())}),e.push({gridStateTypeId:4,gridId:null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId,values:JSON.stringify(this.api.getFilterModel())});const o=this.api.getGridOption("context");try{await u(A(),null==o?void 0:o.gridId,y(),this.viewName,null==o?void 0:o.entityName,e,!0===this.viewIsPrivate?1:2,0,this.postViewCallback)}catch(i){console.error(i)}finally{this.refresh()}}async updateViewMarkedAsPrimary(i){this.loading=1,this.refresh();const t=this.api.getGridOption("context"),e=null==i?void 0:i.isDefault;await p(null==i?void 0:i.gridViewId,A(),null==t?void 0:t.gridId,y(),null==i?void 0:i.name,e?0:1,null==t?void 0:t.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).then((async()=>{if(!e){const i=this.filteredViews.find((i=>null==i?void 0:i.isDefault));i&&await p(null==i?void 0:i.gridViewId,A(),null==t?void 0:t.gridId,y(),null==i?void 0:i.name,0,null==t?void 0:t.entityName,!0===this.viewIsPrivate?1:2,(()=>null)).catch((i=>console.log(i)))}await this.fetchViews(),this.loading=0,this.refresh()})).catch((i=>console.log(i)))}render(){var t,e;return i("div",null,i("div",{style:{viewTransitionName:"active-view-chip"},class:"grid-action-transition"},this.activeView&&i("div",{style:{margin:"4px"}},i("udp-chip",{label:null===(t=this.activeView)||void 0===t?void 0:t.name,variant:"filled",color:"secondary",deleteButton:!0,onChipDelete:this.removeActiveView}))),i("udp-dialog",{open:this.isDialogOpen,actionOne:()=>{this.postView()},actionTwo:this.handleDialogClose,handleClose:this.handleDialogClose,labelOne:"Create View",labelTwo:"Cancel",title:"Create a grid view",message:"The view will be created from the current column and filter state.",disableOne:!this.viewName,progress:this.loading},i("div",{style:{display:"flex",flexDirection:"column"}},i("div",{style:{marginBottom:"-4px",marginTop:"2em"}},i("text-field",{value:this.viewName,onInput:this.handleNameChange,placeholder:"View name"})),i("div",{style:{marginTop:"-4px"}},i("stencil-toggle",{label:"Private",checked:this.viewIsPrivate,onChange:this.handleViewIsPrivateToggleChange})))),i("udp-side-sheet",{title:"Views",open:this.isSidesheetOpen,position:"right",onUdpSideSheetClose:this.handleSidesheetClose,headerActionButtonLabel:"Create View",onUdpHeaderActionButtonClick:this.handleOpenModal,headerActionButtonIcon:"add",loading:!!this.loading},i("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},i("hint-panel",{hint:"Quickly access and manage your pre-configured grid views. These views are designed to help you focus on specific sets of data and streamline your workflow.",hideHintText:"Dismiss"}),this.entityName&&i("hint-panel",{hint:"Note: Displaying entity specific views."}),i("div",null,(null===(e=this.filteredViews)||void 0===e?void 0:e.length)>0?this.filteredViews.map((t=>{var e;return i("udp-list-item",{primaryText:t.name,clickable:!0,onListItemClick:()=>this.setActiveView(t)},i("div",{style:{display:"flex",flexDirection:"row",gap:"4px"},slot:"status-chip"},(null===(e=this.activeView)||void 0===e?void 0:e.gridViewId)===t.gridViewId&&i("udp-chip",{label:"Active",color:"success",variant:"filled"}),1===t.gridViewVisibilityTypeId&&i("udp-chip",{label:"Private",color:"gray",variant:"outlined"})),i("div",{slot:"actions"},i("udp-icon-button",{icon:f("star"),size:"small",variant:t.isDefault?"contained":"text",tooltip:2===t.gridViewVisibilityTypeId?"Cannot mark public view as primary":t.isDefault?"Remove as primary":"Mark as primary",onClick:()=>this.updateViewMarkedAsPrimary(t),disabled:2===t.gridViewVisibilityTypeId}),i("udp-icon-button",{icon:f("trashCan"),size:"small",variant:"text",tooltip:t.userId!==A()?"Cannot delete public view with different owner":"Delete View",onClick:()=>this.deleteView(t),disabled:t.userId!==A()})))})):i("udp-empty-state-display",{primaryText:"No Views to display"})))))}},agGridSizeColumnsToFit:class{init(i){this.gridApi=i}onAction(i){"agGridSizeColumnsToFit"===i&&this.gridApi.sizeColumnsToFit()}},agGridAutoSizeColumns:class{init(i){this.gridApi=i}onAction(i){"agGridAutoSizeColumns"===i&&this.gridApi.autoSizeAllColumns()}},bulkActions:class{constructor(){this.bulkActions=[],this.selectedRowCount=0,this.fetchedData=!1,this.isMenuOpen=!1,this.onRowSelectionChanged=()=>{var i;T((()=>{const i=this.api.getSelectedRows();this.selectedRows=i,this.selectedRowCount=i.length,this.refresh()})),this.fetchedData&&(null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId)===this.gridId||this.fetchBulkActions()},this.setBulkActions=i=>{const t=i.map((i=>({label:i.name,onClick:()=>this.executeActionProviderAction(i.actionId)}))),e=this.localFunctions.map((i=>({label:i.label,onClick:()=>this.executeLocalFunction(i.label)})));this.bulkActions=[...t,...e],this.fetchedData=!0,this.refresh()},this.executeLocalFunction=i=>{const t=this.localFunctions.find((t=>t.label===i));t&&t.callback(this.selectedRows),this.refresh()},this.executeActionProviderAction=i=>{this.actionProviderCallback&&this.actionProviderCallback(i,this.selectedRows),this.refresh()},this.toggleMenu=()=>{this.isMenuOpen=!this.isMenuOpen,this.refresh()},this.closeMenu=()=>{this.isMenuOpen=!1,this.refresh()}}init(i,t,e){this.api=i,this.refresh=t,this.actionProviderCallback=null==e?void 0:e.actionProviderCallback,this.localFunctions=null==e?void 0:e.localFunctions;const o=this.api.getGridOption("rowModelType");this.api.setGridOption("rowSelection","clientSide"===o?{mode:"multiRow",enableClickSelection:!0}:{mode:"multiRow",enableClickSelection:!0,headerCheckbox:!1}),this.api.addEventListener("selectionChanged",this.onRowSelectionChanged)}onAction(i){"executeBulkAction"===i&&this.refresh()}async fetchBulkActions(){var i;try{this.gridId=null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId,await b(this.gridId,!1,[],this.setBulkActions)}catch(i){console.error(i)}}render(){var t;return i("div",{style:{viewTransitionName:"bulk-action-button"},class:"grid-action-transition"},this.selectedRowCount>0&&[i("div",{style:{margin:"2px"}},i("udp-button",{ref:i=>{this.menuAnchorEl=i||void 0},onClick:this.toggleMenu,variant:"outlined",color:"primary",endIcon:i("udp-icon",{iconName:"chevronDown",style:{transform:this.isMenuOpen?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"}})},`${this.selectedRowCount} Selected`)),i("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:this.closeMenu},0===(null===(t=this.bulkActions)||void 0===t?void 0:t.length)?i("udp-menu-item",{label:"No available actions"}):this.bulkActions.map((t=>i("udp-menu-item",{label:t.label,onItemClick:()=>{t.onClick(),this.isMenuOpen=!1}}))))])}},chipFilter:class{constructor(){this.handleFilterChanged=i=>{var t,e,o;const s=null===(e=null===(t=null==i?void 0:i.columns)||void 0===t?void 0:t[0])||void 0===e?void 0:e.colId,n=null===(o=this.filterChips)||void 0===o?void 0:o.find((i=>i.field===s));if(n){const i=this.api.getColumnFilterModel(s),t=Object.assign(Object.assign({},n),{filterObjects:n.filterObjects.map((t=>{let e=!1;return(null==i?void 0:i.conditions)&&"AND"===(null==i?void 0:i.operator)?e=i.conditions.some((i=>JSON.stringify(i)===JSON.stringify(t.agGridFilterModel[s]))):i&&(e=JSON.stringify(i)===JSON.stringify(t.agGridFilterModel[s])),Object.assign(Object.assign({},t),{toggled:e})}))});this.filterChips=this.filterChips.map((i=>i.field===s?t:i)),this.refresh()}},this.syncChipsWithGridFilters=()=>{if(!this.filterChips||0===this.filterChips.length)return;const i=this.filterChips.map((i=>{const t=i.field,e=this.api.getColumnFilterModel(t);if(!e)return i;const o=i.filterObjects.map((i=>{let o=!1;return o=(null==e?void 0:e.conditions)&&"AND"===(null==e?void 0:e.operator)?e.conditions.some((e=>JSON.stringify(e)===JSON.stringify(i.agGridFilterModel[t]))):JSON.stringify(e)===JSON.stringify(i.agGridFilterModel[t]),Object.assign(Object.assign({},i),{toggled:o})}));return Object.assign(Object.assign({},i),{filterObjects:o})}));this.filterChips=i},this.getGridfilterChips=async()=>{var i,t;if(this.gridId!==(null===(i=this.api.getGridOption("context"))||void 0===i?void 0:i.gridId)){this.gridId=null===(t=this.api.getGridOption("context"))||void 0===t?void 0:t.gridId;const i=(await m(this.gridId,7)).map((i=>JSON.parse(i.values)));T((async()=>{this.filterChips=i.map((i=>Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>Object.assign(Object.assign({},i),{toggled:!1})))}))),this.syncChipsWithGridFilters(),this.getFilterChipCounts(),this.refresh()}))}},this.getFilterChipCounts=async()=>{var i;const t={pageNumber:1,pageSize:1,filterElements:[],filterGroups:[],orderElements:[],groupingType:"",groupProperty:[],groupOperationList:[],eagerLoad:!1,logicalSearchOperator:1},e=[];for(const o of this.filterChips){if(!(null==o?void 0:o.udpDomainSanitizedName))continue;const s=await v(y(),o.udpDomainSanitizedName,!0);for(const n of null!==(i=o.filterObjects)&&void 0!==i?i:[])(null==n?void 0:n.udpFilterElement)&&e.push((async()=>{var i;const e=Object.assign(Object.assign({},t),{filterElements:[n.udpFilterElement]});return{result:await g(e,null===(i=null==s?void 0:s.unityBaseSearchMethod)||void 0===i?void 0:i.apiMethodId,x.config.UNITY_API_DOMAIN,!1),groupField:o.field,objLabel:n.label}})())}const o=await Promise.all(e);this.filterChips=this.filterChips.map((i=>{const t=o.filter((t=>t.groupField===i.field));return Object.assign(Object.assign({},i),{filterObjects:i.filterObjects.map((i=>{var e,o;const s=t.find((t=>t.objLabel===i.label));return Object.assign(Object.assign({},i),{resultCount:null!==(o=null===(e=null==s?void 0:s.result)||void 0===e?void 0:e.total)&&void 0!==o?o:null})}))})})),this.refresh()},this.setSelectedFilterChip=i=>{this.filterChips=this.filterChips.map((t=>Object.assign(Object.assign({},t),{filterObjects:t.filterObjects.map((t=>t.label===i.label?Object.assign(Object.assign({},t),{toggled:!t.toggled}):t))}))),this.refresh();const t=Object.keys(i.agGridFilterModel)[0];!function(i,t,e){var o,s;const n=i.getColumn(t);if(!n)return void console.error("Invalid column id provided for filtering");if(!(null===(o=null==n?void 0:n.colDef)||void 0===o?void 0:o.filter))return void console.error(`Filtering not enabled for column: ${null==n?void 0:n.colId}`);const a=i.getColumnFilterModel(t);if(JSON.stringify(e)!==JSON.stringify(a)){if(null===(s=null==a?void 0:a.conditions)||void 0===s?void 0:s.some((i=>JSON.stringify(i)===JSON.stringify(e)))){const o=null==a?void 0:a.conditions.filter((i=>JSON.stringify(i)!==JSON.stringify(e)));if(1===o.length)return void i.setColumnFilterModel(t,o[0]).then((()=>i.onFilterChanged()));{const e=Object.assign(Object.assign({},a),{conditions:o});return void i.setColumnFilterModel(t,e).then((()=>i.onFilterChanged()))}}if(a)if(null==a?void 0:a.conditions){const o=[...null==a?void 0:a.conditions,e];i.setColumnFilterModel(t,{conditions:o,operator:"AND"}).then((()=>i.onFilterChanged()))}else a&&i.setColumnFilterModel(t,{conditions:[Object.assign({},a),e],operator:"AND"}).then((()=>i.onFilterChanged()));else i.setColumnFilterModel(n,e).then((()=>i.onFilterChanged()))}else i.setColumnFilterModel(t,null).then((()=>i.onFilterChanged()))}(this.api,t,i.agGridFilterModel[t])}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("firstDataRendered",this.getGridfilterChips),this.api.addEventListener("filterChanged",this.handleFilterChanged)}onAction(i){"chipFilter"===i&&this.refresh()}render(){var t;return i("div",{class:"grid-action-transition",style:{display:"flex",flexWrap:"nowrap",gap:"5px",viewTransitionName:"view-chip-filters"}},(null===(t=this.filterChips)||void 0===t?void 0:t.length)>0&&this.filterChips.map(((t,e)=>[e>0&&i("div",{style:{width:"1px",backgroundColor:"#ddd",marginBottom:"5px",marginTop:"5px"}}),i("div",{style:{padding:"4px",display:"flex",flexWrap:"nowrap",gap:"3px"}},t.filterObjects.map((t=>i("udp-chip",{label:`${t.label} ${null!=t.resultCount?`(${t.resultCount})`:""}`,variant:t.toggled?"filled":"outlined",clickable:!0,onChipClick:()=>this.setSelectedFilterChip(t),color:"primary"}))))])))}},restoreGridState:class{constructor(){this.getPreviousState=()=>{T((()=>{this.api.removeEventListener("stateUpdated",this.saveState);const i=this.api.getGridOption("context");this.gridId=null==i?void 0:i.gridId,this.apiMethodInstanceId=(null==i?void 0:i.apiMethodInstanceId)||"",this.previousState=JSON.parse(localStorage.getItem(this.getStorageKey())),this.refresh(),this.api.addEventListener("stateUpdated",this.saveState)}))},this.getStorageKey=()=>{const i=k();return`saved-grid-state-${this.gridId}-${this.apiMethodInstanceId}-${i}`},this.saveState=()=>{const i=this.api.getGridOption("context");if((null==i?void 0:i.gridId)!==this.gridId||(null==i?void 0:i.apiMethodInstanceId)&&(null==i?void 0:i.apiMethodInstanceId)!==this.apiMethodInstanceId)this.getPreviousState();else{const i=this.api.getState();localStorage.setItem(this.getStorageKey(),JSON.stringify({date:new Date,state:i}))}},this.restoreState=async()=>{this.api.setState(this.previousState.state),setTimeout((()=>T((()=>{this.previousState=null,this.refresh()}))),0)},this.dismissMessage=()=>{T((()=>{this.previousState=null,this.refresh()}))}}init(i,t){this.api=i,this.refresh=t,this.api.addEventListener("firstDataRendered",this.getPreviousState)}getTimeAgo(i){const t=Math.floor((Date.now()-i.getTime())/1e3);if(t<60)return`${t} second${1!==t?"s":""} ago`;const e=Math.floor(t/60);if(e<60)return`${e} minute${1!==e?"s":""} ago`;const o=Math.floor(e/60);if(o<24)return`${o} hour${1!==o?"s":""} ago`;const s=Math.floor(o/24);return`${s} day${1!==s?"s":""} ago`}render(){var t;return i("div",{style:{viewTransitionName:"restore-grid-state"}},(null===(t=this.previousState)||void 0===t?void 0:t.date)&&i("div",{style:{margin:"4px"}},i("udp-ambient-tool-tip",{content:`Restore grid state from ${this.getTimeAgo(new Date(this.previousState.date))}?`},i("udp-chip",{startIcon:"rotate",label:"Restore state",variant:"outlined",color:"gray",deleteButton:!0,onChipDelete:this.dismissMessage,clickable:!0,onClick:this.restoreState}))))}},agGridResetColumns:class{init(i){this.gridApi=i}onAction(i){"agGridResetColumns"===i&&(this.gridApi.resetColumnState(),this.gridApi.setFilterModel(null))}},advancedSearch:class{init(i,t,e){this.onOpenCallback=null==e?void 0:e.callback}onAction(i){var t;"advancedSearch"===i&&(null===(t=this.onOpenCallback)||void 0===t||t.call(this))}},agGridHideShowColumns:class{init(i){this.gridApi=i}onAction(i){"agGridHideShowColumns"===i&&this.gridApi.showColumnChooser()}},udpExport:class{init(i,t,e){this.onOpenCallback=null==e?void 0:e.callback,this.api=i}onAction(i){var t;if("udpExport"===i){const i=this.api.getGridOption("context");null===(t=this.onOpenCallback)||void 0===t||t.call(this,null==i?void 0:i.searchObject,null==i?void 0:i.entityName)}}}},D=i=>{const t=i.value;if(null==t)return"";const e=new Date(t);return e?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`:""},G=a.withParams({wrapperBorderRadius:0,wrapperBorder:!1,headerCellHoverBackgroundColor:"var(--udp-grid-column-header-bg-hover)",borderColor:"#E9ECEF"}),E=class{constructor(i){t(this,i),this.gridReady=e(this,"gridReady"),this.headerConfig={},this.gridFunctions=[],this.refreshKey=0,this.gridFunctionInstances=[],this.updateGridHeight=()=>{if(this.gridEl){const i=this.gridEl.getBoundingClientRect(),t=window.innerHeight-i.top,e=10;this.gridEl.style.height=(t-e>400?t-e:400)+"px"}},this.scheduleHeightUpdate=()=>{clearTimeout(this.resizeDebounce),this.resizeDebounce=setTimeout(this.updateGridHeight,100)},this.refreshGridFunctions=()=>{this.refreshKey++},this.onGridReady=i=>{this.gridApi=i.api,this.updateGridContextValues(),this.gridFunctionInstances=this.gridFunctions.map((i=>{const t=F[i.name];if(!t)return null;const e=new t;return e.init(this.gridApi,this.refreshGridFunctions,i.params),e})).filter((i=>!!i)),this.gridApiCallback&&this.gridApiCallback({refreshServerSide:()=>this.gridApi.refreshServerSide(),getSelectedRows:()=>this.gridApi.getSelectedRows(),getSelectedNodes:()=>this.gridApi.getSelectedNodes(),getSearchObject:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.searchObject},getEntityName:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.entityName},getRowCount:()=>{var i;return null===(i=this.gridApi.getGridOption("context"))||void 0===i?void 0:i.rowCount},getFilterModel:()=>this.gridApi.getFilterModel(),setFilterModel:i=>this.gridApi.setFilterModel(i),onFilterChanged:()=>this.gridApi.onFilterChanged(),expandAll:()=>this.gridApi.expandAll(),collapseAll:()=>this.gridApi.collapseAll(),toggleLoadingOverlay:i=>this.gridApi.setGridOption("loading",i),refreshCells:()=>this.gridApi.refreshCells(),refreshClientSideRowModel:i=>this.gridApi.refreshClientSideRowModel(i),selectAll:(i,t)=>this.gridApi.selectAll(i,t),deselectAll:(i,t)=>this.gridApi.deselectAll(i,t),getServerSideSelectionState:()=>this.gridApi.getServerSideSelectionState(),setServerSideSelectionState:i=>this.gridApi.setServerSideSelectionState(i),forEachNode:i=>this.gridApi.forEachNode(i),forEachNodeAfterFilterAndSort:i=>this.gridApi.forEachNodeAfterFilterAndSort(i)}),this.setColumnDefs(),this.gridReady.emit(this.gridApi)},this.onHeaderAction=i=>{this.gridFunctionInstances.forEach((t=>{var e;return null===(e=t.onAction)||void 0===e?void 0:e.call(t,i.detail.name,i.detail.payload)}))},this.updateGridContextValues=()=>{this.gridApi.setGridOption("context",Object.assign(Object.assign({},this.gridApi.getGridOption("context")),{entityName:this.entityName,gridId:this.gridId}))}}componentWillLoad(){n.registerModules([c]),d.setLicenseKey("Using_this_{AG_Grid}_Enterprise_key_{AG-080613}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Univerus_Software_Inc}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{MAIS_eRec}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{MAIS_eRec}_need_to_be_licensed___{MAIS_eRec}_has_not_been_granted_a_Deployment_License_Add-on___This_key_works_with_{AG_Grid}_Enterprise_versions_released_before_{28_June_2026}____[v3]_[01]_MTc4MjYwMTIwMDAwMA==5c7d1487ecb13b28e75415d34b7cf694")}componentDidLoad(){var i,t,e,o;const s=Object.assign(Object.assign({tooltipShowMode:"whenTruncated",tooltipShowDelay:500},this.gridOptions),{columnTypes:{booleanChip:{cellRenderer:"iconRenderer",cellRendererParams:{iconMappingConfig:{true:{iconName:"checkMark24",color:"success"},false:{iconName:"close24",color:"error"}}}}},dataTypeDefinitions:{dateTimeString:{baseDataType:"dateTimeString",extendsDataType:"dateTimeString",valueFormatter:D},boolean:{baseDataType:"boolean",extendsDataType:"boolean",columnTypes:"booleanChip"}},gridId:this.gridId,onGridReady:this.onGridReady,theme:G,components:Object.assign({actionsRenderer:O,currencyRenderer:S,dateTimeCellRenderer:_,iconRenderer:C,statusRenderer:w},null===(i=this.gridOptions)||void 0===i?void 0:i.components),domLayout:"normal",defaultColDef:Object.assign(Object.assign({sortable:!0,filter:!0,flex:1,minWidth:150,suppressHeaderMenuButton:!0},null===(t=this.gridOptions)||void 0===t?void 0:t.defaultColDef),{filterParams:Object.assign({buttons:["reset","apply"],closeOnApply:!0,maxNumConditions:10},null===(o=null===(e=this.gridOptions)||void 0===e?void 0:e.defaultColDef)||void 0===o?void 0:o.filterParams)})});r(this.el.querySelector("#myNewGrid"),s),this.gridHeight?this.gridEl.style.height=this.gridHeight:(this.updateGridHeight(),this.resizeObserver=new ResizeObserver(this.scheduleHeightUpdate),this.resizeObserver.observe(this.gridContainerEl),window.addEventListener("resize",this.scheduleHeightUpdate))}disconnectedCallback(){var i,t;null===(i=this.gridApi)||void 0===i||i.destroy(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),window.removeEventListener("resize",this.scheduleHeightUpdate)}handleUpdateColumnDefs(i,t){j(i,t)||this.setColumnDefs()}setColumnDefs(){var i;if(this.columnDefs&&this.gridApi){const t=N(this.columnDefs,null===(i=this.gridFunctions)||void 0===i?void 0:i.some((i=>"advancedSearch"===(null==i?void 0:i.name))));this.gridApi.setGridOption("columnDefs",t)}}handleEntityNameChange(){this.updateGridContextValues()}render(){var t;const e=`variant-${(null===(t=this.headerConfig)||void 0===t?void 0:t.variant)||"light"}`;return i("div",{key:"bcbd0fe1693a169eac2d3eaa43ec8021d781071d",class:e,ref:i=>this.gridContainerEl=i},i("ghost-render",{key:"a9eb1234b76fa9937e34cd468a0335cea2b36444"},i("div",{key:"a7dfd166a485a1093828b9fa1b327081223b9ff7"},i("udp-dialog",{key:"5e4ee01cf0d8ff4bab63107b5eaed5fe826bd6a9"}),i("udp-list-item",{key:"6b1a02b2f37e9f4805768d37fa0b8a00b4689d30"}),i("hint-panel",{key:"4624370fe64ca7eb304c09aec59e8c80d335a2c0"}),i("udp-side-sheet",{key:"dd7a83b3a87d17b397a4198a5f0160e1bb07ac20"}))),i("div",{key:"72fd3f9ccbb67b47418af4ed3d419406f4be6928",class:"grid-base-header"},i("grid-header",{key:"91476b641388c546da6addc4463906ce4652013b",headerConfig:this.headerConfig,gridFunctions:this.gridFunctions,onHeaderAction:this.onHeaderAction}),i("div",{key:"af9718f0931f15691a35bd99b4232c2fc70d1da5",class:"action-bar",style:{viewTransitionName:"action-bar"}},this.gridFunctionInstances.map((i=>{var t;return null===(t=i.render)||void 0===t?void 0:t.call(i)})))),i("div",{key:"b1eee4354e580529fff3af958ba7c1f3fd8926fb",id:"myNewGrid",ref:i=>this.gridEl=i,style:{viewTransitionName:"my-new-grid"}}))}get el(){return o(this)}static get watchers(){return{columnDefs:[{handleUpdateColumnDefs:0}],entityName:[{handleEntityNameChange:0}],gridId:[{handleEntityNameChange:0}]}}};E.style=":root{--udp-grid-base-header-bg:#EBECEF;--udp-grid-base-header-text:#000;--udp-grid-action-divider-color:rgba(0, 0, 0, 0.3);--udp-grid-action-bar-border-color:rgb(202, 197, 197)}.variant-dark{--udp-grid-base-header-bg:var(--primary-color-dark);--udp-grid-action-bar-bg:#F8F9FA;--udp-grid-column-header-bg:#F8F9FA;--udp-grid-column-header-bg-hover:#dce6f2;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}.variant-light{--udp-grid-base-header-bg:#d8dfe6;--udp-grid-action-bar-bg:#f4f6f8;--udp-grid-column-header-bg:#f2f4f5;--udp-grid-column-header-bg-hover:#eef3f9;--udp-grid-column-header-text:var(--primary-color-dark);--udp-grid-action-bar-text-color:var(--primary-color-dark);--udp-grid-action-bar-border-color:rgba(0, 0, 0, 0.1)}::view-transition-group(*){animation-duration:0.2s}.grid-base-header{background-color:var(--udp-grid-base-header-bg);color:var(--udp-grid-base-header-text)}.action-bar{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;background-color:var(--udp-grid-action-bar-bg);color:var(--udp-grid-action-bar-text-color);padding:0px 8px 0px 12px;border-bottom:1px solid var(--udp-grid-action-bar-border-color)}.grid-wrapper{display:flex;flex-direction:column;height:100%}#myNewGrid{flex:1}";const I=class{constructor(i){t(this,i)}render(){return i(s,{key:"77d50c2b9c9ccbb58d00b4928fcbed63d13c1010"},i("slot",{key:"30730a259776f1452fca147be792d928ba2ee996"}))}};I.style=":host {\n display: none;\n }";const R=class{constructor(i){t(this,i),this.headerAction=e(this,"headerAction"),this.isMenuOpen=!1,this.toggleSettingsMenu=()=>{this.isMenuOpen=!this.isMenuOpen}}action(i,t){this.headerAction.emit({name:i,payload:t})}render(){var t,e,o,s,n,a,r,c,d,l,h,u,p,b,m,v,g,y,x,k,w,C,_,S;const O=!!(null===(e=null===(t=this.headerConfig)||void 0===t?void 0:t.title)||void 0===e?void 0:e.replace(/\u00A0/g," ").trim()),N=!!(null===(s=null===(o=this.headerConfig)||void 0===o?void 0:o.primaryActionButton)||void 0===s?void 0:s.label),j=((null===(a=null===(n=this.headerConfig)||void 0===n?void 0:n.secondaryActionButtons)||void 0===a?void 0:a.length)||0)>0,A=((null===(r=this.gridFunctions)||void 0===r?void 0:r.length)||0)>0;if(!(O||N||j||A))return null;const T=`variant-${(null===(c=this.headerConfig)||void 0===c?void 0:c.variant)||"light"}`,F=new Set(this.gridFunctions.map((i=>i.name))),D=["agGridSizeColumnsToFit","agGridAutoSizeColumns","agGridHideShowColumns","agGridResetColumns","agGridExport"].some((i=>F.has(i)));return i("div",{class:`header-bar ${T}`},i("unity-typography",{variant:"h6",color:"inherit"},this.headerConfig.title),i("div",{class:"actions"},D&&i("udp-icon-button",{class:{"settings-button":!0,"is-open":this.isMenuOpen},onClick:this.toggleSettingsMenu,ref:i=>{this.menuAnchorEl=i||void 0},icon:f("settings"),variant:"outlined",size:"small",color:"inherit"}),i("udp-menu",{open:this.isMenuOpen,anchor:this.menuAnchorEl,handleClose:()=>this.isMenuOpen=!1},F.has("agGridSizeColumnsToFit")&&i("udp-menu-item",{label:"Size Columns To Fit",iconName:"fitToWidth",onItemClick:()=>this.action("agGridSizeColumnsToFit")}),F.has("agGridAutoSizeColumns")&&i("udp-menu-item",{label:"Auto Size Columns",iconName:"column",onItemClick:()=>this.action("agGridAutoSizeColumns")}),F.has("agGridHideShowColumns")&&i("udp-menu-item",{label:"Hide/Show Columns",iconName:"hideColumn",onItemClick:()=>this.action("agGridHideShowColumns")}),F.has("agGridResetColumns")&&i("udp-menu-item",{label:"Reset Columns",iconName:"reset",onItemClick:()=>this.action("agGridResetColumns")}),F.has("agGridExport")&&i("udp-menu-item",{label:"CSV Export",iconName:"export",onItemClick:()=>this.action("agGridExport")})),F.has("openSavedViews")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"dataTable",label:"Views",clickable:!0,onChipClick:()=>this.action("openSavedViews"),size:"medium"}),F.has("udpExport")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"export",label:"Export",clickable:!0,onChipClick:()=>this.action("udpExport"),size:"medium"}),F.has("advancedSearch")&&i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:"search",label:"Search",clickable:!0,onChipClick:()=>this.action("advancedSearch"),size:"medium"}),i("div",{class:"secondary-actions"},null===(l=null===(d=this.headerConfig)||void 0===d?void 0:d.secondaryActionButtons)||void 0===l?void 0:l.map((t=>i("udp-chip",{color:"monochrome",variant:"outlined",startIcon:null==t?void 0:t.iconName,label:null==t?void 0:t.label,clickable:!(null==t?void 0:t.disabled),onChipClick:t.onClick,size:"medium"})))),i("div",{class:"primary-action"},(null===(u=null===(h=this.headerConfig)||void 0===h?void 0:h.primaryActionButton)||void 0===u?void 0:u.label)&&i("udp-button",{variant:"contained",onButtonClick:null===(b=null===(p=this.headerConfig)||void 0===p?void 0:p.primaryActionButton)||void 0===b?void 0:b.onClick,color:"secondary",disabled:null===(v=null===(m=this.headerConfig)||void 0===m?void 0:m.primaryActionButton)||void 0===v?void 0:v.disabled,loading:null===(y=null===(g=this.headerConfig)||void 0===g?void 0:g.primaryActionButton)||void 0===y?void 0:y.loading,endIcon:(null===(k=null===(x=this.headerConfig)||void 0===x?void 0:x.primaryActionButton)||void 0===k?void 0:k.iconName)&&i("udp-icon",{iconName:null===(C=null===(w=this.headerConfig)||void 0===w?void 0:w.primaryActionButton)||void 0===C?void 0:C.iconName,color:"inherit"})},null===(S=null===(_=this.headerConfig)||void 0===_?void 0:_.primaryActionButton)||void 0===S?void 0:S.label))))}};R.style=".header-bar{display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-03) var(--spacing-03) var(--spacing-03) var(--spacing-05);font-family:'Segoe UI', Tahoma, sans-serif;color:var(--grid-header-text);min-height:42px}.header-bar.variant-dark{--grid-header-text:#FFFFFF;--grid-header-icon-hover-bg:rgba(255, 255, 255, 0.12);}.header-bar.variant-light{--grid-header-text:black;--grid-header-icon-hover-bg:rgba(0, 0, 0, 0.08)}.header-bar .header-title{color:inherit;margin:0;white-space:nowrap}.header-bar .actions{display:flex;gap:0.4rem;flex-wrap:nowrap;align-items:center}.header-bar .secondary-actions{display:flex;gap:0.4rem}.menu-trigger-wrapper{position:relative;display:inline-flex}.settings-button{transition:transform 0.2s ease-in-out}.settings-button.is-open{transform:rotate(45deg)}";const z=class{constructor(i){t(this,i),this.showHint=!0,this.handleHideHint=()=>{this.showHint=!1}}render(){return i("div",{key:"a12706b04206a3155c828c4a3c74ab93f4f9a54b",class:"hint-container"},this.showHint&&i("div",{key:"61c421a9227f8da52e07b5a27c122aae9cbe7bd8",class:"hint-content"},i("div",{key:"e7e196b3de4cb3eff963e5663acb4b3665caa885"},i("unity-typography",{key:"326bafd6cc82f8020e49f59a5cd35174715bb34e",variant:"body"}," ",this.hint," ")),this.hideHintText&&i("div",{key:"8ff552c3eadde4f86cd793826bf5d2da1a6253f8",class:"hide-help"},i("udp-button",{key:"c4b13f7784eab8a0796d212489614cdd58bd6fe2",size:"small",color:"info",onClick:this.handleHideHint},this.hideHintText))))}};z.style=".hint-container{border-left:3px solid var(--info-color-main)}.hint-content{background-color:color-mix(in srgb, var(--info-color-hint) 70%, transparent);padding:8px}.hide-help{display:flex;justify-content:flex-end;margin-top:0.5rem}";const M=class{constructor(i){t(this,i),this.open=!1,this.titleId="dialog-title",this.descriptionId="dialog-description",this.buttonOneHidden=!1,this.buttonTwoHidden=!1,this.buttonThreeHidden=!0,this.originalBodyOverflow="",this.handleTransitionEnd=()=>{this.open||this.hostEl.parentElement!==document.body||document.body.removeChild(this.hostEl)},this.handleKeyDown=i=>{"Escape"===i.key&&this.handleClose&&this.handleClose()},this.handleOverlayClick=()=>{this.handleClose&&this.handleClose()}}handleOpenChange(i){i?(this.originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",document.body.appendChild(this.hostEl),document.addEventListener("keydown",this.handleKeyDown),requestAnimationFrame((()=>{this.hostEl.classList.add("is-visible")}))):(this.hostEl.classList.remove("is-visible"),document.body.style.overflow=this.originalBodyOverflow,document.removeEventListener("keydown",this.handleKeyDown),this.hostEl.addEventListener("transitionend",this.handleTransitionEnd,{once:!0}))}disconnectedCallback(){"hidden"===document.body.style.overflow&&(document.body.style.overflow=this.originalBodyOverflow),document.removeEventListener("keydown",this.handleKeyDown)}render(){return i(s,{key:"5a90e0cfa060c1363fb823be98a2f3f7ff5682ef",onClick:this.handleOverlayClick},i("div",{key:"8ab6dd81074d401ed22b436c9cc21c21ec0210f8",class:"dialog-container",role:"dialog","aria-modal":"true","aria-labelledby":this.titleId,"aria-describedby":this.descriptionId,onClick:i=>i.stopPropagation()},i("div",{key:"6b4181bceeecbe7d316d13e902897b9dcfd3dff1",class:"dialog-title",id:this.titleId},i("unity-typography",{key:"cdc44f463dc5cce8fcc583fdb9b140cd0b651df2",variant:"h3"},this.title)),i("div",{key:"1b5147acd9da752ef77ece211e645b020766a90e",class:"dialog-content",id:this.descriptionId},this.message&&i("unity-typography",{key:"e3056d62d5b19dc4ab59491cd35ff5e876d5af69",variant:"body"},this.message),i("slot",{key:"7e3077ebd768e66fb38c96635d9270baa4e26b68"})),i("div",{key:"049b0fd822a3a6fd44264bd0c98db78bbe8860dc",class:"dialog-actions"},!this.buttonTwoHidden&&i("udp-button",{key:"4e2451c51e0d7f687e6a20208f7b128c9fa93cc8",variant:"text",disabled:this.disableTwo,onClick:()=>this.actionTwo()},this.labelTwo),!this.buttonThreeHidden&&i("udp-button",{key:"ffce2387c9aa1aed65706eb3901687e2f1843618",variant:"text",disabled:this.disableThree,onClick:()=>this.actionThree()},this.labelThree),!this.buttonOneHidden&&i("udp-button",{key:"66b2adc47093fa6f8ace3460390f59081451d2b9",variant:"contained",disabled:this.disableOne,onClick:()=>this.actionOne(),loading:!!this.progress},this.labelOne))))}get hostEl(){return o(this)}static get watchers(){return{open:[{handleOpenChange:0}]}}};M.style=":host{position:fixed;top:0;left:0;width:0;height:0;overflow:hidden;transform:translate(0);z-index:100000;display:flex;align-items:center;justify-content:center;visibility:hidden;background-color:rgba(0, 0, 0, 0);transition:background-color 0.2s ease-out, visibility 0s 0.2s, width 0s 0.2s, height 0s 0.2s;}:host(.is-visible){visibility:visible;background-color:rgba(0, 0, 0, 0.5);width:100%;height:100%;overflow:visible;transition-delay:0s}.dialog-container{background-color:#fff;box-shadow:0 12px 24px rgba(0, 0, 0, 0.16), 0 12px 24px rgba(0, 0, 0, 0.23);max-width:90vw;width:500px;max-height:90vh;display:flex;flex-direction:column;opacity:0;transition:opacity 0.2s ease-out}:host(.is-visible) .dialog-container{opacity:1}.dialog-title{padding:16px;flex-shrink:0}.dialog-content{padding:0 16px;overflow-y:auto}.dialog-actions{padding:16px;display:flex;justify-content:flex-end;gap:8px;flex-shrink:0}";const $=class{constructor(i){t(this,i),this.listItemClick=e(this,"listItemClick"),this.hasPrimaryTextSlot=!1,this.hasSecondaryTextSlot=!1,this.hasActionsSlot=!1,this.hasStatusChipSlot=!1,this.avatarBackgroundColor="info",this.avatarVariant="rounded",this.clickable=!1,this.variant="normal",this.handleClick=i=>{i.composedPath().some((i=>{var t,e;return(null===(t=i.classList)||void 0===t?void 0:t.contains("actions-container"))||(null===(e=i.classList)||void 0===e?void 0:e.contains("status-chip-container"))}))||this.clickable&&(this.listItemClick.emit(i),this.onClick&&this.onClick(i))},this.handleKeyPress=i=>{!this.clickable||"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.handleClick(i))}}componentWillLoad(){this.hasPrimaryTextSlot=!!this.hostEl.querySelector('[slot="primary-text"]'),this.hasSecondaryTextSlot=!!this.hostEl.querySelector('[slot="secondary-text"]'),this.hasActionsSlot=!!this.hostEl.querySelector('[slot="actions"]'),this.hasStatusChipSlot=!!this.hostEl.querySelector('[slot="status-chip"]')}render(){const t=this.primaryText||this.hasPrimaryTextSlot,e=this.secondaryText||this.hasSecondaryTextSlot;return i(s,{key:"4e8edba80d5983c2f878b2ad0731b72238ea882e"},i("div",{key:"568adde99ec3bc362ab34d2c31c9e307002acac2",class:{"list-item":!0,clickable:this.clickable,"variant-compact":"compact"===this.variant},onClick:this.handleClick,onKeyPress:this.handleKeyPress,role:this.clickable?"button":void 0,tabindex:this.clickable?0:-1},this.iconName&&i("div",{key:"61b51b5dede1f2705dcc7b2825348a07c0a80efa",class:"avatar-container"},i("udp-avatar",{key:"108678bcb61b90c1390a54582e6388384d1ebd1e",iconName:this.iconName,variant:this.avatarVariant,color:this.avatarBackgroundColor})),i("div",{key:"10eac3586f355e87339e03d94ac41af2d1ef097b",class:"text-container"},t&&i("div",{key:"c3c0f2e589d2c5ba83840a6b08869f13d8ba2ff1",class:"primary-text"},i("slot",{key:"b01581a16a642c52e0700f7ccd19037d1b59958f",name:"primary-text"},i("unity-typography",{key:"01fcd927aeeb074067d03f795d123985f3a52bcb",variant:"body"},this.primaryText))),e&&i("div",{key:"a5bc8b98b185424a82d06d97a29ba4c2c32bc8c3",class:"secondary-text"},i("slot",{key:"da8cbda21c28f6ba5873d5eaf0f694ad906bb14f",name:"secondary-text"},i("unity-typography",{key:"f5d19214b90eb6c2b8a992dc43e529761d394d40",variant:"caption-text",color:"textSecondary"},this.secondaryText)))),this.hasStatusChipSlot&&i("div",{key:"3bcf146d66ec6671beefe002f3f5a84a2dd23944",class:"status-chip-container"},i("slot",{key:"9b5e6d67c50f113a52b3b20054a8d81a744d1f23",name:"status-chip"})),this.hasActionsSlot&&i("div",{key:"20a822232840d162030142618fcfc762d0d95e92",class:"actions-container"},i("slot",{key:"305560605b78e8f02ed30052e9013eb9b01b5a01",name:"actions"}))))}get hostEl(){return o(this)}};$.style=".list-item{display:flex;flex-direction:row;align-items:center;padding:var(--spacing-3, 12px) var(--spacing-4, 16px);background-color:var(--card-background-color, #FFF);transition:background-color 0.1s;gap:var(--spacing-4, 16px);position:relative}.list-item::after{content:'';position:absolute;bottom:0;height:1px;background-color:var(--border-color, #e0e0e0);left:var(--spacing-4, 16px);right:var(--spacing-4, 16px)}.list-item.variant-compact{padding-top:var(--spacing-1, 4px);padding-bottom:var(--spacing-1, 4px)}.list-item.clickable{cursor:pointer}.list-item.clickable:hover{background-color:color-mix(in srgb, var(--card-background-color, #FFF) 95%, black)}.avatar-container{align-items:center}.text-container{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.primary-text{font-weight:400;line-height:1.4}.secondary-text{margin-top:2px}.status-chip-container{display:flex;align-items:center;flex-shrink:0}.actions-container{display:flex;flex-shrink:0}";export{E as ag_grid_base,I as ghost_render,R as grid_header,z as hint_panel,M as udp_dialog,$ as udp_list_item}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "udp-stencil-component-library",
|
|
3
|
-
"version": "25.18.
|
|
3
|
+
"version": "25.18.3-beta.1",
|
|
4
4
|
"description": "A Stencil based component library for UDP",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"license": "MIT",
|
|
84
84
|
"publishConfig": {
|
|
85
|
-
"tag": "
|
|
85
|
+
"tag": "beta"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "stencil build --docs",
|