Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ag-grid-enterprise/menu

Package Overview
Dependencies
Maintainers
0
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/menu - npm Package Compare versions

Comparing version 31.3.2 to 32.0.0

dist/types/src/menu/menuApi.d.ts

30

CONTRIBUTING.md

@@ -5,6 +5,4 @@ # Contributing to AG Grid Enterprise

Retention of Intellectual Property Rights for AG Grid Enterprise component
==============
# Retention of Intellectual Property Rights for AG Grid Enterprise component
1.DEFINITIONS

@@ -27,9 +25,9 @@

- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
- [Signing the CLA](#cla)
- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
- [Signing the CLA](#cla)

@@ -45,2 +43,3 @@ ## <a name="question"></a> Got a Question or Problem?

## <a name="issue"></a> Found a Bug?
If you find a bug in the source code, you can help us by

@@ -50,3 +49,4 @@ [submitting an issue](#submit-issue) to our [GitHub Repository][github].

## <a name="feature"></a> Missing a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub
You can _request_ a new feature by [submitting an issue](#submit-issue) to our GitHub
Repository.

@@ -62,5 +62,5 @@

- version of AG Grid Enterprise used
- 3rd-party libraries and their versions
- and most importantly - a use-case that fails
- version of AG Grid Enterprise used
- 3rd-party libraries and their versions
- and most importantly - a use-case that fails

@@ -78,3 +78,1 @@ A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If plunker is not a suitable way to demonstrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demonstrating the problem.

[stackoverflow]: http://stackoverflow.com/questions/tagged/ag-grid

@@ -1,3 +0,3 @@

var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,o)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,__spreadValues=(t,e)=>{for(var o in e||(e={}))__hasOwnProp.call(e,o)&&__defNormalProp(t,o,e[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(e))__propIsEnum.call(e,o)&&__defNormalProp(t,o,e[o]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e)),__export=(t,e)=>{for(var o in e)__defProp(t,o,{get:e[o],enumerable:!0})},__copyProps=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of __getOwnPropNames(e))!__hasOwnProp.call(t,n)&&n!==o&&__defProp(t,n,{get:()=>e[n],enumerable:!(r=__getOwnPropDesc(e,n))||r.enumerable});return t},__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),__decorateClass=(t,e,o,r)=>{for(var n=r>1?void 0:r?__getOwnPropDesc(e,o):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(n=(r?s(e,o,n):s(n))||n);return r&&n&&__defProp(e,o,n),n},main_exports={};__export(main_exports,{MenuModule:()=>MenuModule}),module.exports=__toCommonJS(main_exports);var import_core8=require("@ag-grid-community/core"),import_core9=require("@ag-grid-enterprise/core"),import_core=require("@ag-grid-community/core"),EnterpriseMenuFactory=class extends import_core.BeanStub{hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(t,e,o,r){const n=r?"filterMenuTab":void 0;this.showMenu(t,i=>{var s;const a=i.getGui();this.popupService.positionPopupUnderMouseEvent({type:o,column:t,mouseEvent:e,ePopup:a}),n&&((s=i.showTab)==null||s.call(i,n)),this.dispatchVisibleChangedEvent(!0,!1,t,n)},o,n,void 0,e.target)}showMenuAfterButtonClick(t,e,o,r){let n=-1,i="left";this.gos.get("enableRtl")&&(n=1,i="right");const s=r?"filterMenuTab":void 0,a=s?[s]:void 0,l=this.menuService.isLegacyMenuEnabled();let h=(l?9:4)*n,m=l?-23:4;this.showMenu(t,c=>{var d;const u=c.getGui();this.popupService.positionPopupByComponent({type:o,column:t,eventSource:e,ePopup:u,alignSide:i,nudgeX:h,nudgeY:m,position:"under",keepWithinBounds:!0}),s&&((d=c.showTab)==null||d.call(c,s)),this.dispatchVisibleChangedEvent(!0,!1,t,s)},o,s,a,e)}showMenu(t,e,o,r,n,i){var s;const{menu:a,eMenuGui:l,anchorToElement:h,restoreFocusParams:m}=this.getMenuParams(t,n,i),c=[];c.push(u=>{const g=a.getGui();this.destroyBean(a),t&&(t.setMenuVisible(!1,"contextMenu"),this.menuUtils.restoreFocusOnClose(m,g,u))});const d=this.localeService.getLocaleTextFunc();if(this.popupService.addPopup({modal:!0,eChild:l,closeOnEsc:!0,closedCallback:u=>{c.forEach(g=>g(u)),this.dispatchVisibleChangedEvent(!1,!1,t,r)},afterGuiAttached:u=>a.afterGuiAttached(Object.assign({},{container:o},u)),positionCallback:r?()=>e(a):void 0,ariaLabel:d("ariaLabelColumnMenu","Column Menu")}),r||((s=a.showTabBasedOnPreviousSelection)==null||s.call(a),e(a)),this.menuService.isColumnMenuAnchoringEnabled()){const u=this.popupService.setPopupPositionRelatedToElement(l,h);u&&t&&this.addStopAnchoring(u,t,c)}a.addEventListener(TabbedColumnMenu.EVENT_TAB_SELECTED,u=>{this.dispatchVisibleChangedEvent(!1,!0,t),this.lastSelectedTab=u.key,this.dispatchVisibleChangedEvent(!0,!0,t)}),t?.setMenuVisible(!0,"contextMenu"),this.activeMenu=a,a.addEventListener(import_core.BeanStub.EVENT_DESTROYED,()=>{this.activeMenu===a&&(this.activeMenu=null)})}addStopAnchoring(t,e,o){t.then(r=>{e.addEventListener("leftChanged",r),e.addEventListener("visibleChanged",r),o.push(()=>{e.removeEventListener("leftChanged",r),e.removeEventListener("visibleChanged",r)})})}getMenuParams(t,e,o){const r={column:t,headerPosition:this.focusService.getFocusedHeader(),columnIndex:this.columnModel.getAllDisplayedColumns().indexOf(t),eventSource:o},n=this.createMenu(t,r,e,o);return{menu:n,eMenuGui:n.getGui(),anchorToElement:o||this.ctrlsService.getGridBodyCtrl().getGui(),restoreFocusParams:r}}createMenu(t,e,o,r){return this.menuService.isLegacyMenuEnabled()?this.createBean(new TabbedColumnMenu(t,e,this.lastSelectedTab,o,r)):this.createBean(new ColumnContextMenu(t,e,r))}dispatchVisibleChangedEvent(t,e,o,r){var n,i;const s={type:import_core.Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:t,switchingTab:e,key:(i=(n=this.lastSelectedTab)!=null?n:r)!=null?i:this.menuService.isLegacyMenuEnabled()?TabbedColumnMenu.TAB_GENERAL:"columnMenu",column:o??null};this.eventService.dispatchEvent(s)}isMenuEnabled(t){var e;if(!this.menuService.isLegacyMenuEnabled())return!0;const o=!this.filterManager.isFilterAllowed(t),r=(e=t.getColDef().menuTabs)!=null?e:TabbedColumnMenu.TABS_DEFAULT;return(o&&r.includes(TabbedColumnMenu.TAB_FILTER)?r.length-1:r.length)>0}showMenuAfterContextMenuEvent(t,e,o){this.menuUtils.onContextMenu(e,o,r=>(this.showMenuAfterMouseEvent(t,r,"columnMenu"),!0))}};__decorateClass([(0,import_core.Autowired)("popupService")],EnterpriseMenuFactory.prototype,"popupService",2),__decorateClass([(0,import_core.Autowired)("focusService")],EnterpriseMenuFactory.prototype,"focusService",2),__decorateClass([(0,import_core.Autowired)("ctrlsService")],EnterpriseMenuFactory.prototype,"ctrlsService",2),__decorateClass([(0,import_core.Autowired)("columnModel")],EnterpriseMenuFactory.prototype,"columnModel",2),__decorateClass([(0,import_core.Autowired)("filterManager")],EnterpriseMenuFactory.prototype,"filterManager",2),__decorateClass([(0,import_core.Autowired)("menuUtils")],EnterpriseMenuFactory.prototype,"menuUtils",2),__decorateClass([(0,import_core.Autowired)("menuService")],EnterpriseMenuFactory.prototype,"menuService",2),EnterpriseMenuFactory=__decorateClass([(0,import_core.Bean)("enterpriseMenuFactory")],EnterpriseMenuFactory);var _TabbedColumnMenu=class p extends import_core.BeanStub{constructor(e,o,r,n,i){super(),this.column=e,this.restoreFocusParams=o,this.initialSelection=r,this.restrictTo=n,this.sourceElement=i,this.tabFactories={},this.includeChecks={},this.tabFactories[p.TAB_GENERAL]=this.createMainPanel.bind(this),this.tabFactories[p.TAB_FILTER]=this.createFilterPanel.bind(this),this.tabFactories[p.TAB_COLUMNS]=this.createColumnsPanel.bind(this),this.includeChecks[p.TAB_GENERAL]=()=>!0,this.includeChecks[p.TAB_FILTER]=()=>e?this.filterManager.isFilterAllowed(e):!1,this.includeChecks[p.TAB_COLUMNS]=()=>!0}init(){const e=this.getTabsToCreate().map(o=>this.createTab(o));this.tabbedLayout=new import_core.TabbedLayout({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)}),this.createBean(this.tabbedLayout),this.mainMenuList&&this.mainMenuList.setParentComponent(this.tabbedLayout),this.addDestroyFunc(()=>this.destroyBean(this.tabbedLayout))}getTabsToCreate(){var e,o;return this.restrictTo?this.restrictTo:((o=(e=this.column)==null?void 0:e.getColDef().menuTabs)!=null?o:p.TABS_DEFAULT).filter(r=>this.isValidMenuTabItem(r)).filter(r=>this.isNotSuppressed(r)).filter(r=>this.isModuleLoaded(r))}isModuleLoaded(e){return e===p.TAB_COLUMNS?import_core.ModuleRegistry.__isRegistered(import_core.ModuleNames.ColumnsToolPanelModule,this.context.getGridId()):!0}isValidMenuTabItem(e){let o=!0,r=p.TABS_DEFAULT;return this.restrictTo!=null&&(o=this.restrictTo.indexOf(e)>-1,r=this.restrictTo),o=o&&p.TABS_DEFAULT.indexOf(e)>-1,o||console.warn(`AG Grid: Trying to render an invalid menu item '${e}'. Check that your 'menuTabs' contains one of [${r}]`),o}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){this.tabItemColumns&&e===p.TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&e===p.TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&e===p.TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()}onTabItemClicked(e){let o=null;switch(e.item){case this.tabItemColumns:o=p.TAB_COLUMNS;break;case this.tabItemFilter:o=p.TAB_FILTER;break;case this.tabItemGeneral:o=p.TAB_GENERAL;break}o&&this.activateTab(o)}activateTab(e){const o={type:p.EVENT_TAB_SELECTED,key:e};this.dispatchEvent(o)}createMainPanel(){return this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>{var e;return(e=this.sourceElement)!=null?e:this.getGui()}),this.mainMenuList.addEventListener(import_core.AgMenuItemComponent.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.tabItemGeneral={title:import_core._.createIconNoSpan("menu",this.gos,this.column),titleLabel:p.TAB_GENERAL.replace("MenuTab",""),bodyPromise:import_core.AgPromise.resolve(this.mainMenuList.getGui()),name:p.TAB_GENERAL},this.tabItemGeneral}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const e=this.column?this.createManagedBean(new import_core.FilterWrapperComp(this.column,"COLUMN_MENU")):null;if(!e?.hasFilter())throw new Error("AG Grid - Unable to instantiate filter");const o=n=>e.afterGuiAttached(n),r=()=>e.afterGuiDetached();return this.tabItemFilter={title:import_core._.createIconNoSpan("filter",this.gos,this.column),titleLabel:p.TAB_FILTER.replace("MenuTab",""),bodyPromise:import_core.AgPromise.resolve(e?.getGui()),afterAttachedCallback:o,afterDetachedCallback:r,name:p.TAB_FILTER},this.tabItemFilter}createColumnsPanel(){const e=document.createElement("div");e.classList.add("ag-menu-column-select-wrapper");const r=this.columnChooserFactory.createColumnSelectPanel(this,this.column).getGui();return r.classList.add("ag-menu-column-select"),e.appendChild(r),this.tabItemColumns={title:import_core._.createIconNoSpan("columns",this.gos,this.column),titleLabel:p.TAB_COLUMNS.replace("MenuTab",""),bodyPromise:import_core.AgPromise.resolve(e),name:p.TAB_COLUMNS},this.tabItemColumns}afterGuiAttached(e){const{container:o,hidePopup:r}=e;this.tabbedLayout.setAfterAttachedParams({container:o,hidePopup:r}),r&&(this.hidePopupFunc=r,this.addDestroyFunc(r))}getGui(){return this.tabbedLayout.getGui()}};_TabbedColumnMenu.EVENT_TAB_SELECTED="tabSelected",_TabbedColumnMenu.TAB_FILTER="filterMenuTab",_TabbedColumnMenu.TAB_GENERAL="generalMenuTab",_TabbedColumnMenu.TAB_COLUMNS="columnsMenuTab",_TabbedColumnMenu.TABS_DEFAULT=[_TabbedColumnMenu.TAB_GENERAL,_TabbedColumnMenu.TAB_FILTER,_TabbedColumnMenu.TAB_COLUMNS],__decorateClass([(0,import_core.Autowired)("filterManager")],_TabbedColumnMenu.prototype,"filterManager",2),__decorateClass([(0,import_core.Autowired)("columnChooserFactory")],_TabbedColumnMenu.prototype,"columnChooserFactory",2),__decorateClass([(0,import_core.Autowired)("columnMenuFactory")],_TabbedColumnMenu.prototype,"columnMenuFactory",2),__decorateClass([(0,import_core.Autowired)("menuUtils")],_TabbedColumnMenu.prototype,"menuUtils",2),__decorateClass([import_core.PostConstruct],_TabbedColumnMenu.prototype,"init",1);var TabbedColumnMenu=_TabbedColumnMenu,ColumnContextMenu=class extends import_core.Component{constructor(t,e,o){super(`
<div ref="eColumnMenu" role="presentation" class="ag-menu ag-column-menu"></div>
`),this.column=t,this.restoreFocusParams=e,this.sourceElement=o}init(){this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>{var t;return(t=this.sourceElement)!=null?t:this.getGui()}),this.mainMenuList.addEventListener(import_core.AgMenuItemComponent.EVENT_CLOSE_MENU,this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(t){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,t)}afterGuiAttached({hidePopup:t}){t&&(this.hidePopupFunc=t,this.addDestroyFunc(t)),this.focusService.focusInto(this.mainMenuList.getGui())}};__decorateClass([(0,import_core.Autowired)("columnMenuFactory")],ColumnContextMenu.prototype,"columnMenuFactory",2),__decorateClass([(0,import_core.Autowired)("menuUtils")],ColumnContextMenu.prototype,"menuUtils",2),__decorateClass([(0,import_core.Autowired)("focusService")],ColumnContextMenu.prototype,"focusService",2),__decorateClass([(0,import_core.RefSelector)("eColumnMenu")],ColumnContextMenu.prototype,"eColumnMenu",2),__decorateClass([import_core.PostConstruct],ColumnContextMenu.prototype,"init",1);var import_core2=require("@ag-grid-community/core"),CSS_MENU="ag-menu",CSS_CONTEXT_MENU_OPEN="ag-context-menu-open",ContextMenuFactory=class extends import_core2.BeanStub{hideActiveMenu(){this.destroyBean(this.activeMenu)}getMenuItems(t,e,o){const r=[];if(import_core2._.exists(t)&&import_core2.ModuleRegistry.__isRegistered(import_core2.ModuleNames.ClipboardModule,this.context.getGridId())&&e&&(this.gos.get("suppressCutToClipboard")||r.push("cut"),r.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gos.get("enableCharts")&&import_core2.ModuleRegistry.__isRegistered(import_core2.ModuleNames.GridChartsModule,this.context.getGridId())&&(this.columnModel.isPivotMode()&&r.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&r.push("chartRange")),import_core2._.exists(t)){const a=!import_core2.ModuleRegistry.__isRegistered(import_core2.ModuleNames.CsvExportModule,this.context.getGridId()),l=!import_core2.ModuleRegistry.__isRegistered(import_core2.ModuleNames.ExcelExportModule,this.context.getGridId()),h=this.gos.get("suppressExcelExport")||l,m=this.gos.get("suppressCsvExport")||a;!import_core2._.isIOSUserAgent()&&(!h||!m)&&r.push("export")}const n=r.length?r:void 0,i=e?.getColDef().contextMenuItems;if(Array.isArray(i))return i;if(typeof i=="function")return i(this.gos.addGridCommonParams({column:e,node:t,value:o,defaultItems:n}));const s=this.gos.getCallback("getContextMenuItems");return s?s({column:e,node:t,value:o,defaultItems:n}):r}onContextMenu(t,e,o,r,n,i){this.menuUtils.onContextMenu(t,e,s=>this.showMenu(o,r,n,s,i))}showMenu(t,e,o,r,n){const i=this.getMenuItems(t,e,o),s=this.ctrlsService.getGridBodyCtrl().getGui();if(i===void 0||import_core2._.missingOrEmpty(i))return!1;const a=new ContextMenu(i,e,t,o);this.createBean(a);const l=a.getGui(),h={column:e,rowNode:t,type:"contextMenu",mouseEvent:r,ePopup:l,nudgeY:1},m=this.localeService.getLocaleTextFunc(),c=this.popupService.addPopup({modal:!0,eChild:l,closeOnEsc:!0,closedCallback:u=>{s.classList.remove(CSS_CONTEXT_MENU_OPEN),this.destroyBean(a),this.dispatchVisibleChangedEvent(!1,u===void 0?"api":"ui")},click:r,positionCallback:()=>{const u=this.gos.get("enableRtl");this.popupService.positionPopupUnderMouseEvent(__spreadProps(__spreadValues({},h),{nudgeX:u?(l.offsetWidth+1)*-1:1}))},anchorToElement:n,ariaLabel:m("ariaLabelContextMenu","Context Menu")});c&&(s.classList.add(CSS_CONTEXT_MENU_OPEN),a.afterGuiAttached({container:"contextMenu",hidePopup:c.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=a,a.addEventListener(import_core2.BeanStub.EVENT_DESTROYED,()=>{this.activeMenu===a&&(this.activeMenu=null)}),c&&a.addEventListener(import_core2.AgMenuItemComponent.EVENT_CLOSE_MENU,u=>{var g,C;return c.hideFunc({mouseEvent:(g=u.mouseEvent)!=null?g:void 0,keyboardEvent:(C=u.keyboardEvent)!=null?C:void 0,forceHide:!0})});const d=r&&r instanceof MouseEvent&&r.type==="mousedown";return this.dispatchVisibleChangedEvent(!0,d?"api":"ui"),!0}dispatchVisibleChangedEvent(t,e="ui"){const o={type:import_core2.Events.EVENT_CONTEXT_MENU_VISIBLE_CHANGED,visible:t,source:e};this.eventService.dispatchEvent(o)}};__decorateClass([(0,import_core2.Autowired)("popupService")],ContextMenuFactory.prototype,"popupService",2),__decorateClass([(0,import_core2.Autowired)("ctrlsService")],ContextMenuFactory.prototype,"ctrlsService",2),__decorateClass([(0,import_core2.Autowired)("columnModel")],ContextMenuFactory.prototype,"columnModel",2),__decorateClass([(0,import_core2.Autowired)("menuUtils")],ContextMenuFactory.prototype,"menuUtils",2),__decorateClass([(0,import_core2.Optional)("rangeService")],ContextMenuFactory.prototype,"rangeService",2),ContextMenuFactory=__decorateClass([(0,import_core2.Bean)("contextMenuFactory")],ContextMenuFactory);var ContextMenu=class extends import_core2.Component{constructor(t,e,o,r){super(`<div class="${CSS_MENU}" role="presentation"></div>`),this.menuItems=t,this.column=e,this.node=o,this.value=r,this.menuList=null,this.focusedCell=null}addMenuItems(){const t=this.createManagedBean(new import_core2.AgMenuList(0,{column:this.column,node:this.node,value:this.value})),e=this.menuItemMapper.mapWithStockItems(this.menuItems,null,()=>this.getGui());t.addMenuItems(e),this.appendChild(t),this.menuList=t,t.addEventListener(import_core2.AgMenuItemComponent.EVENT_CLOSE_MENU,o=>this.dispatchEvent(o))}afterGuiAttached(t){t.hidePopup&&this.addDestroyFunc(t.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())}restoreFocusedCell(){const t=this.focusService.getFocusedCell();if(t&&this.focusedCell&&this.cellPositionUtils.equals(t,this.focusedCell)){const{rowIndex:e,rowPinned:o,column:r}=this.focusedCell,n=this.gos.getDocument(),i=this.gos.getActiveDomElement();(!i||i===n.body)&&this.focusService.setFocusedCell({rowIndex:e,column:r,rowPinned:o,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!this.focusService.isKeyboardMode()})}}destroy(){this.restoreFocusedCell(),super.destroy()}};__decorateClass([(0,import_core2.Autowired)("menuItemMapper")],ContextMenu.prototype,"menuItemMapper",2),__decorateClass([(0,import_core2.Autowired)("focusService")],ContextMenu.prototype,"focusService",2),__decorateClass([(0,import_core2.Autowired)("cellPositionUtils")],ContextMenu.prototype,"cellPositionUtils",2),__decorateClass([import_core2.PostConstruct],ContextMenu.prototype,"addMenuItems",1);var import_core3=require("@ag-grid-community/core"),MenuItemMapper=class extends import_core3.BeanStub{mapWithStockItems(t,e,o){if(!t)return[];const r=[];return t.forEach(n=>{let i;if(typeof n=="string"?i=this.getStockMenuItem(n,e,o):i=__spreadValues({},n),!i)return;const s=i,{subMenu:a}=s;a&&a instanceof Array&&(s.subMenu=this.mapWithStockItems(a,e,o)),i!=null&&r.push(i)}),r}getStockMenuItem(t,e,o){var r;const n=this.localeService.getLocaleTextFunc(),i=this.gos.get("skipHeaderOnAutoSize");switch(t){case"pinSubMenu":return{name:n("pinColumn","Pin Column"),icon:import_core3._.createIconNoSpan("menuPin",this.gos,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:n("pinLeft","Pin Left"),action:()=>this.columnModel.setColumnsPinned([e],"left","contextMenu"),checked:!!e&&e.isPinnedLeft()};case"pinRight":return{name:n("pinRight","Pin Right"),action:()=>this.columnModel.setColumnsPinned([e],"right","contextMenu"),checked:!!e&&e.isPinnedRight()};case"clearPinned":return{name:n("noPin","No Pin"),action:()=>this.columnModel.setColumnsPinned([e],null,"contextMenu"),checked:!!e&&!e.isPinned()};case"valueAggSubMenu":return import_core3.ModuleRegistry.__assertRegistered(import_core3.ModuleNames.RowGroupingModule,"Aggregation from Menu",this.context.getGridId())?!e?.isPrimary()&&!e?.getColDef().pivotValueColumn?null:{name:n("valueAggregation","Value Aggregation"),icon:import_core3._.createIconNoSpan("menuValue",this.gos,null),subMenu:this.createAggregationSubMenu(e,this.aggFuncService)}:null;case"autoSizeThis":return{name:n("autosizeThiscolumn","Autosize This Column"),action:()=>this.columnModel.autoSizeColumn(e,"contextMenu",i)};case"autoSizeAll":return{name:n("autosizeAllColumns","Autosize All Columns"),action:()=>this.columnModel.autoSizeAllColumns("contextMenu",i)};case"rowGroup":return{name:n("groupBy","Group by")+" "+import_core3._.escapeString(this.columnModel.getDisplayNameForColumn(e,"header")),disabled:e?.isRowGroupActive()||!e?.getColDef().enableRowGroup,action:()=>this.columnModel.addRowGroupColumns([e],"contextMenu"),icon:import_core3._.createIconNoSpan("menuAddRowGroup",this.gos,null)};case"rowUnGroup":const s=import_core3._.createIconNoSpan("menuRemoveRowGroup",this.gos,null),a=e?.getColDef().showRowGroup,l=this.gos.get("groupLockGroupColumns");if(a===!0)return{name:n("ungroupAll","Un-Group All"),disabled:l===-1||l>=this.columnModel.getRowGroupColumns().length,action:()=>this.columnModel.setRowGroupColumns(this.columnModel.getRowGroupColumns().slice(0,l),"contextMenu"),icon:s};if(typeof a=="string"){const d=this.columnModel.getPrimaryColumn(a),u=d!=null?import_core3._.escapeString(this.columnModel.getDisplayNameForColumn(d,"header")):a;return{name:n("ungroupBy","Un-Group by")+" "+u,disabled:d!=null&&this.columnModel.isColumnGroupingLocked(d),action:()=>this.columnModel.removeRowGroupColumns([a],"contextMenu"),icon:s}}return{name:n("ungroupBy","Un-Group by")+" "+import_core3._.escapeString(this.columnModel.getDisplayNameForColumn(e,"header")),disabled:!e?.isRowGroupActive()||!e?.getColDef().enableRowGroup||this.columnModel.isColumnGroupingLocked(e),action:()=>this.columnModel.removeRowGroupColumns([e],"contextMenu"),icon:s};case"resetColumns":return{name:n("resetColumns","Reset Columns"),action:()=>this.columnModel.resetColumnState("contextMenu")};case"expandAll":return{name:n("expandAll","Expand All Row Groups"),action:()=>this.gridApi.expandAll()};case"contractAll":return{name:n("collapseAll","Collapse All Row Groups"),action:()=>this.gridApi.collapseAll()};case"copy":return import_core3.ModuleRegistry.__assertRegistered(import_core3.ModuleNames.ClipboardModule,"Copy from Menu",this.context.getGridId())?{name:n("copy","Copy"),shortcut:n("ctrlC","Ctrl+C"),icon:import_core3._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard()}:null;case"copyWithHeaders":return import_core3.ModuleRegistry.__assertRegistered(import_core3.ModuleNames.ClipboardModule,"Copy with Headers from Menu",this.context.getGridId())?{name:n("copyWithHeaders","Copy with Headers"),icon:import_core3._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return import_core3.ModuleRegistry.__assertRegistered(import_core3.ModuleNames.ClipboardModule,"Copy with Group Headers from Menu",this.context.getGridId())?{name:n("copyWithGroupHeaders","Copy with Group Headers"),icon:import_core3._.createIconNoSpan("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(import_core3.ModuleRegistry.__assertRegistered(import_core3.ModuleNames.ClipboardModule,"Cut from Menu",this.context.getGridId())){const d=this.focusService.getFocusedCell(),u=d?this.rowPositionUtils.getRowNode(d):null,g=u?d?.column.isCellEditable(u):!1;return{name:n("cut","Cut"),shortcut:n("ctrlX","Ctrl+X"),icon:import_core3._.createIconNoSpan("clipboardCut",this.gos,null),disabled:!g||this.gos.get("suppressCutToClipboard"),action:()=>this.clipboardService.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":return import_core3.ModuleRegistry.__assertRegistered(import_core3.ModuleNames.ClipboardModule,"Paste from Clipboard",this.context.getGridId())?{name:n("paste","Paste"),shortcut:n("ctrlV","Ctrl+V"),disabled:!0,icon:import_core3._.createIconNoSpan("clipboardPaste",this.gos,null),action:()=>this.clipboardService.pasteFromClipboard()}:null;case"export":const h=[],m=import_core3.ModuleRegistry.__isRegistered(import_core3.ModuleNames.CsvExportModule,this.context.getGridId()),c=import_core3.ModuleRegistry.__isRegistered(import_core3.ModuleNames.ExcelExportModule,this.context.getGridId());return!this.gos.get("suppressCsvExport")&&m&&h.push("csvExport"),!this.gos.get("suppressExcelExport")&&c&&h.push("excelExport"),{name:n("export","Export"),subMenu:h,icon:import_core3._.createIconNoSpan("save",this.gos,null)};case"csvExport":return{name:n("csvExport","CSV Export"),icon:import_core3._.createIconNoSpan("csvExport",this.gos,null),action:()=>this.gridApi.exportDataAsCsv({})};case"excelExport":return{name:n("excelExport","Excel Export"),icon:import_core3._.createIconNoSpan("excelExport",this.gos,null),action:()=>this.gridApi.exportDataAsExcel()};case"separator":return"separator";case"pivotChart":case"chartRange":return(r=this.chartMenuItemMapper.getChartItems(t))!=null?r:null;case"columnFilter":return e?{name:n("columnFilter","Column Filter"),icon:import_core3._.createIconNoSpan("filter",this.gos,null),action:()=>this.menuService.showFilterMenu({column:e,buttonElement:o(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":return import_core3.ModuleRegistry.__isRegistered(import_core3.ModuleNames.ColumnsToolPanelModule,this.context.getGridId())?{name:n("columnChooser","Choose Columns"),icon:import_core3._.createIconNoSpan("columns",this.gos,null),action:()=>this.menuService.showColumnChooser({column:e,eventSource:o()})}:null;case"sortAscending":return{name:n("sortAscending","Sort Ascending"),icon:import_core3._.createIconNoSpan("sortAscending",this.gos,null),action:()=>this.sortController.setSortForColumn(e,"asc",!1,"columnMenu")};case"sortDescending":return{name:n("sortDescending","Sort Descending"),icon:import_core3._.createIconNoSpan("sortDescending",this.gos,null),action:()=>this.sortController.setSortForColumn(e,"desc",!1,"columnMenu")};case"sortUnSort":return{name:n("sortUnSort","Clear Sort"),icon:import_core3._.createIconNoSpan("sortUnSort",this.gos,null),action:()=>this.sortController.setSortForColumn(e,null,!1,"columnMenu")};default:return console.warn(`AG Grid: unknown menu item type ${t}`),null}}createAggregationSubMenu(t,e){const o=this.localeService.getLocaleTextFunc();let r;if(t.isPrimary())r=t;else{const i=t.getColDef().pivotValueColumn;r=import_core3._.exists(i)?i:void 0}const n=[];if(r){const i=r.isValueActive(),s=e.getFuncNames(r);n.push({name:o("noAggregation","None"),action:()=>{this.columnModel.removeValueColumns([r],"contextMenu"),this.columnModel.setColumnAggFunc(r,void 0,"contextMenu")},checked:!i}),s.forEach(a=>{n.push({name:o(a,e.getDefaultFuncLabel(a)),action:()=>{this.columnModel.setColumnAggFunc(r,a,"contextMenu"),this.columnModel.addValueColumns([r],"contextMenu")},checked:i&&r.getAggFunc()===a})})}return n}};__decorateClass([(0,import_core3.Autowired)("columnModel")],MenuItemMapper.prototype,"columnModel",2),__decorateClass([(0,import_core3.Autowired)("gridApi")],MenuItemMapper.prototype,"gridApi",2),__decorateClass([(0,import_core3.Autowired)("focusService")],MenuItemMapper.prototype,"focusService",2),__decorateClass([(0,import_core3.Autowired)("rowPositionUtils")],MenuItemMapper.prototype,"rowPositionUtils",2),__decorateClass([(0,import_core3.Autowired)("chartMenuItemMapper")],MenuItemMapper.prototype,"chartMenuItemMapper",2),__decorateClass([(0,import_core3.Autowired)("menuService")],MenuItemMapper.prototype,"menuService",2),__decorateClass([(0,import_core3.Autowired)("sortController")],MenuItemMapper.prototype,"sortController",2),__decorateClass([(0,import_core3.Optional)("clipboardService")],MenuItemMapper.prototype,"clipboardService",2),__decorateClass([(0,import_core3.Optional)("aggFuncService")],MenuItemMapper.prototype,"aggFuncService",2),MenuItemMapper=__decorateClass([(0,import_core3.Bean)("menuItemMapper")],MenuItemMapper);var VERSION="31.3.2",import_core4=require("@ag-grid-community/core"),ChartMenuItemMapper=class extends import_core4.BeanStub{getChartItems(t){var e,o;if(!this.chartService){import_core4.ModuleRegistry.__assertRegistered(import_core4.ModuleNames.GridChartsModule,`the Context Menu key "${t}"`,this.context.getGridId());return}const r=t==="pivotChart"?new PivotMenuItemMapper(this.gos,this.chartService,this.localeService):new RangeMenuItemMapper(this.gos,this.chartService,this.localeService),n=this.chartService.isEnterprise();let i=r.getMenuItem();if(i&&i.subMenu&&!n){const a=l=>{var h;return __spreadProps(__spreadValues({},l),{subMenu:(h=l.subMenu)==null?void 0:h.filter(m=>!m._enterprise).map(m=>a(m))})};i=a(i)}const s=(o=(e=this.gos.get("chartToolPanelsDef"))==null?void 0:e.settingsPanel)==null?void 0:o.chartGroupsDef;return s&&(i=ChartMenuItemMapper.filterAndOrderChartMenu(i,s,r.getConfigLookup())),this.cleanInternals(i)}cleanInternals(t){if(!t)return t;const e=o=>{var r;return o==null||delete o._key,o==null||delete o._enterprise,(r=o?.subMenu)==null||r.forEach(n=>e(n)),o};return e(t)}static buildLookup(t){let e={};const o=r=>{e[r._key]=r,r.subMenu&&r.subMenu.forEach(n=>o(n))};return o(t),e}static filterAndOrderChartMenu(t,e,o){var r;const n=this.buildLookup(t);let i=__spreadProps(__spreadValues({},t),{subMenu:[]});if(Object.entries(e).forEach(([s,a])=>{var l,h;const m=o[s];if(m===null)return;if(m==null){import_core4._.warnOnce(`invalid chartGroupsDef config '${s}'`);return}const c=n[m._key];if(c)if(c.subMenu){const d=a.map(u=>{const g=m[u];if(g==null){import_core4._.warnOnce(`invalid chartGroupsDef config '${s}.${u}'`);return}return n[g]}).filter(u=>u!==void 0);d.length>0&&(c.subMenu=d,(l=i.subMenu)==null||l.push(c))}else(h=i.subMenu)==null||h.push(c)}),((r=i.subMenu)==null?void 0:r.length)!=0)return i}};__decorateClass([(0,import_core4.Optional)("chartService")],ChartMenuItemMapper.prototype,"chartService",2),ChartMenuItemMapper=__decorateClass([(0,import_core4.Bean)("chartMenuItemMapper")],ChartMenuItemMapper);var PivotMenuItemMapper=class{constructor(t,e,o){this.gos=t,this.chartService=e,this.localeService=o}getMenuItem(){const t=this.localeService.getLocaleTextFunc(),e=(o,r,n,i,s=!1)=>({name:t(o,r),action:()=>this.chartService.createPivotChart({chartType:n}),_key:i,_enterprise:s});return{name:t("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:t("columnChart","Column"),subMenu:[e("groupedColumn","Grouped&lrm;","groupedColumn","pivotGroupedColumn"),e("stackedColumn","Stacked&lrm;","stackedColumn","pivotStackedColumn"),e("normalizedColumn","100% Stacked&lrm;","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:t("barChart","Bar"),subMenu:[e("groupedBar","Grouped&lrm;","groupedBar","pivotGroupedBar"),e("stackedBar","Stacked&lrm;","stackedBar","pivotStackedBar"),e("normalizedBar","100% Stacked&lrm;","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:t("pieChart","Pie"),subMenu:[e("pie","Pie&lrm;","pie","pivotPie"),e("donut","Donut&lrm;","donut","pivotDonut")]},e("line","Line&lrm;","line","pivotLineChart"),{_key:"pivotXYChart",name:t("xyChart","X Y (Scatter)"),subMenu:[e("scatter","Scatter&lrm;","scatter","pivotScatter"),e("bubble","Bubble&lrm;","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:t("areaChart","Area"),subMenu:[e("area","Area&lrm;","area","pivotArea"),e("stackedArea","Stacked&lrm;","stackedArea","pivotStackedArea"),e("normalizedArea","100% Stacked&lrm;","normalizedArea","pivotNormalizedArea")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:t("statisticalChart","Statistical"),subMenu:[e("histogramChart","Histogram&lrm;","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:t("hierarchicalChart","Hierarchical"),subMenu:[e("treemapChart","Treemap&lrm;","treemap","pivotTreemap",!0),e("sunburstChart","Sunburst&lrm;","sunburst","pivotSunburst",!0)]},{_key:"pivotCombinationChart",name:t("combinationChart","Combination"),subMenu:[e("columnLineCombo","Column & Line&lrm;","columnLineCombo","pivotColumnLineCombo"),e("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","pivotAreaColumnCombo")]}],icon:import_core4._.createIconNoSpan("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},polarGroup:null,specializedGroup:null}}},RangeMenuItemMapper=class{constructor(t,e,o){this.gos=t,this.chartService=e,this.localeService=o}getMenuItem(){const t=this.localeService.getLocaleTextFunc(),e=(o,r,n,i,s=!1)=>({name:t(o,r),action:()=>this.chartService.createChartFromCurrentRange(n),_key:i,_enterprise:s});return{name:t("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:t("columnChart","Column"),subMenu:[e("groupedColumn","Grouped&lrm;","groupedColumn","rangeGroupedColumn"),e("stackedColumn","Stacked&lrm;","stackedColumn","rangeStackedColumn"),e("normalizedColumn","100% Stacked&lrm;","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:t("barChart","Bar"),subMenu:[e("groupedBar","Grouped&lrm;","groupedBar","rangeGroupedBar"),e("stackedBar","Stacked&lrm;","stackedBar","rangeStackedBar"),e("normalizedBar","100% Stacked&lrm;","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:t("pieChart","Pie"),subMenu:[e("pie","Pie&lrm;","pie","rangePie"),e("donut","Donut&lrm;","donut","rangeDonut")],_key:"rangePieChart"},e("line","Line&lrm;","line","rangeLineChart"),{name:t("xyChart","X Y (Scatter)"),subMenu:[e("scatter","Scatter&lrm;","scatter","rangeScatter"),e("bubble","Bubble&lrm;","bubble","rangeBubble")],_key:"rangeXYChart"},{name:t("areaChart","Area"),subMenu:[e("area","Area&lrm;","area","rangeArea"),e("stackedArea","Stacked&lrm;","stackedArea","rangeStackedArea"),e("normalizedArea","100% Stacked&lrm;","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:t("polarChart","Polar"),subMenu:[e("radarLine","Radar Line&lrm;","radarLine","rangeRadarLine"),e("radarArea","Radar Area&lrm;","radarArea","rangeRadarArea"),e("nightingale","Nightingale&lrm;","nightingale","rangeNightingale"),e("radialColumn","Radial Column&lrm;","radialColumn","rangeRadialColumn"),e("radialBar","Radial Bar&lrm;","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:t("statisticalChart","Statistical"),subMenu:[e("boxPlot","Box Plot&lrm;","boxPlot","rangeBoxPlot",!0),e("histogramChart","Histogram&lrm;","histogram","rangeHistogram",!1),e("rangeBar","Range Bar&lrm;","rangeBar","rangeRangeBar",!0),e("rangeArea","Range Area&lrm;","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:t("hierarchicalChart","Hierarchical"),subMenu:[e("treemap","Treemap&lrm;","treemap","rangeTreemap"),e("sunburst","Sunburst&lrm;","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:t("specializedChart","Specialized"),subMenu:[e("heatmap","Heatmap&lrm;","heatmap","rangeHeatmap"),e("waterfall","Waterfall&lrm;","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:t("combinationChart","Combination"),subMenu:[e("columnLineCombo","Column & Line&lrm;","columnLineCombo","rangeColumnLineCombo"),e("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:import_core4._.createIconNoSpan("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},import_core5=require("@ag-grid-community/core"),import_column_tool_panel=require("@ag-grid-enterprise/column-tool-panel"),ColumnChooserFactory=class extends import_core5.BeanStub{createColumnSelectPanel(t,e,o,r){var n,i;const s=t.createManagedBean(new import_column_tool_panel.PrimaryColsPanel),a=(i=(n=r??e?.getColDef().columnChooserParams)!=null?n:e?.getColDef().columnsMenuParams)!=null?i:{},{contractColumnSelection:l,suppressColumnExpandAll:h,suppressColumnFilter:m,suppressColumnSelectAll:c,suppressSyncLayoutWithGrid:d,columnLayout:u}=a;return s.init(!!o,this.gos.addGridCommonParams({suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!l,suppressColumnExpandAll:!!h,suppressColumnFilter:!!m,suppressColumnSelectAll:!!c,suppressSyncLayoutWithGrid:!!u||!!d,onStateUpdated:()=>{}}),"columnMenu"),u&&s.setColumnLayout(u),s}showColumnChooser({column:t,chooserParams:e,eventSource:o}){this.hideActiveColumnChooser();const r=this.createColumnSelectPanel(this,t,!0,e),n=this.localeService.getLocaleTextFunc(),i=this.columnModel.getAllDisplayedColumns().indexOf(t),s=t?this.focusService.getFocusedHeader():null;this.activeColumnChooserDialog=this.createBean(new import_core5.AgDialog({title:n("chooseColumns","Choose Columns"),component:r,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{var a;(a=this.focusService.findNextFocusableElement(r.getGui()))==null||a.focus(),this.dispatchVisibleChangedEvent(!0,t)},closedCallback:a=>{const l=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,t),t&&this.menuUtils.restoreFocusOnClose({column:t,headerPosition:s,columnIndex:i,eventSource:o},l,a,!0)}})),this.activeColumnChooser=r}hideActiveColumnChooser(){this.activeColumnChooserDialog&&this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(t,e){const o={type:import_core5.Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:t,switchingTab:!1,key:"columnChooser",column:e??null};this.eventService.dispatchEvent(o)}};__decorateClass([(0,import_core5.Autowired)("focusService")],ColumnChooserFactory.prototype,"focusService",2),__decorateClass([(0,import_core5.Autowired)("menuUtils")],ColumnChooserFactory.prototype,"menuUtils",2),__decorateClass([(0,import_core5.Autowired)("columnModel")],ColumnChooserFactory.prototype,"columnModel",2),ColumnChooserFactory=__decorateClass([(0,import_core5.Bean)("columnChooserFactory")],ColumnChooserFactory);var import_core6=require("@ag-grid-community/core"),ColumnMenuFactory=class extends import_core6.BeanStub{createMenu(t,e,o){const r=t.createManagedBean(new import_core6.AgMenuList(0,{column:e??null,node:null,value:null})),n=this.getMenuItems(e),i=this.menuItemMapper.mapWithStockItems(n,e??null,o);return r.addMenuItems(i),r}getMenuItems(t){const e=this.getDefaultMenuOptions(t);let o;const r=t?.getColDef().mainMenuItems;if(Array.isArray(r))o=r;else if(typeof r=="function")o=r(this.gos.addGridCommonParams({column:t,defaultItems:e}));else{const n=this.gos.getCallback("getMainMenuItems");n&&t?o=n({column:t,defaultItems:e}):o=e}return import_core6._.removeRepeatsFromArray(o,ColumnMenuFactory.MENU_ITEM_SEPARATOR),o}getDefaultMenuOptions(t){const e=[],o=this.menuService.isLegacyMenuEnabled();if(!t)return o||e.push("columnChooser"),e.push("resetColumns"),e;const r=!t.getColDef().lockPinned,n=this.columnModel.getRowGroupColumns().length,i=n>0,s=t.isAllowValue(),a=t.isAllowRowGroup(),l=t.isPrimary(),h=this.columnModel.isPivotMode(),m=this.rowModel.getType()==="clientSide",c=this.gos.get("treeData"),d=l&&i&&s||!l;if(!o&&t.isSortable()){const C=t.getSort();C!=="asc"&&e.push("sortAscending"),C!=="desc"&&e.push("sortDescending"),C&&e.push("sortUnSort"),e.push(ColumnMenuFactory.MENU_ITEM_SEPARATOR)}return this.menuService.isFilterMenuItemEnabled(t)&&(e.push("columnFilter"),e.push(ColumnMenuFactory.MENU_ITEM_SEPARATOR)),r&&e.push("pinSubMenu"),d&&e.push("valueAggSubMenu"),(r||d)&&e.push(ColumnMenuFactory.MENU_ITEM_SEPARATOR),e.push("autoSizeThis"),e.push("autoSizeAll"),e.push(ColumnMenuFactory.MENU_ITEM_SEPARATOR),t.getColDef().showRowGroup?e.push("rowUnGroup"):a&&t.isPrimary()&&(t.isRowGroupActive()?this.columnModel.isColumnGroupingLocked(t)||e.push("rowUnGroup"):e.push("rowGroup")),e.push(ColumnMenuFactory.MENU_ITEM_SEPARATOR),o||e.push("columnChooser"),e.push("resetColumns"),m&&(c||n>(h?1:0))&&(e.push("expandAll"),e.push("contractAll")),e}};ColumnMenuFactory.MENU_ITEM_SEPARATOR="separator",__decorateClass([(0,import_core6.Autowired)("menuItemMapper")],ColumnMenuFactory.prototype,"menuItemMapper",2),__decorateClass([(0,import_core6.Autowired)("columnModel")],ColumnMenuFactory.prototype,"columnModel",2),__decorateClass([(0,import_core6.Autowired)("rowModel")],ColumnMenuFactory.prototype,"rowModel",2),__decorateClass([(0,import_core6.Autowired)("filterManager")],ColumnMenuFactory.prototype,"filterManager",2),__decorateClass([(0,import_core6.Autowired)("menuService")],ColumnMenuFactory.prototype,"menuService",2),ColumnMenuFactory=__decorateClass([(0,import_core6.Bean)("columnMenuFactory")],ColumnMenuFactory);var import_core7=require("@ag-grid-community/core"),MenuUtils=class extends import_core7.BeanStub{restoreFocusOnClose(t,e,o,r){const{eventSource:n}=t,i=o instanceof KeyboardEvent;if(!r&&!i||!n)return;const s=this.gos.getDocument(),a=this.gos.getActiveDomElement();!e.contains(a)&&a!==s.body||this.focusHeaderCell(t)}closePopupAndRestoreFocusOnSelect(t,e,o){let r;o&&o.keyboardEvent&&(r=o.keyboardEvent),t(r&&{keyboardEvent:r});const n=this.focusService.getFocusedCell(),i=this.gos.getDocument(),s=this.gos.getActiveDomElement();if(!s||s===i.body)if(n){const{rowIndex:a,rowPinned:l,column:h}=n;this.focusService.setFocusedCell({rowIndex:a,column:h,rowPinned:l,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(e)}onContextMenu(t,e,o){if(!this.gos.get("allowContextMenuWithControlKey")&&t&&(t.ctrlKey||t.metaKey)||(t&&this.blockMiddleClickScrollsIfNeeded(t),this.gos.get("suppressContextMenu")))return;const r=t??e.touches[0];if(o(r)){const n=t??e;n&&n.cancelable&&n.preventDefault()}}focusHeaderCell(t){const{column:e,columnIndex:o,headerPosition:r,eventSource:n}=t;if(this.columnModel.getAllDisplayedColumns().some(s=>s===e)&&n&&import_core7._.isVisible(n)){const s=this.focusService.findTabbableParent(n);s&&(e&&this.headerNavigationService.scrollToColumn(e),s.focus())}else if(r&&o!==-1){const s=this.columnModel.getAllDisplayedColumns(),a=s[o]||import_core7._.last(s);a&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:r.headerRowIndex,column:a}})}}blockMiddleClickScrollsIfNeeded(t){this.gos.get("suppressMiddleClickScrolls")&&t.which===2&&t.preventDefault()}};__decorateClass([(0,import_core7.Autowired)("focusService")],MenuUtils.prototype,"focusService",2),__decorateClass([(0,import_core7.Autowired)("headerNavigationService")],MenuUtils.prototype,"headerNavigationService",2),__decorateClass([(0,import_core7.Autowired)("columnModel")],MenuUtils.prototype,"columnModel",2),MenuUtils=__decorateClass([(0,import_core7.Bean)("menuUtils")],MenuUtils);var MenuModule={version:VERSION,moduleName:import_core8.ModuleNames.MenuModule,beans:[EnterpriseMenuFactory,ContextMenuFactory,MenuItemMapper,ChartMenuItemMapper,ColumnChooserFactory,ColumnMenuFactory,MenuUtils],dependantModules:[import_core9.EnterpriseCoreModule]};
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of __getOwnPropNames(t))!__hasOwnProp.call(e,i)&&i!==o&&__defProp(e,i,{get:()=>t[i],enumerable:!(r=__getOwnPropDesc(t,i))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{MenuModule:()=>MenuModule}),module.exports=__toCommonJS(main_exports);var import_core12=require("@ag-grid-community/core"),import_core13=require("@ag-grid-enterprise/core"),import_core=require("@ag-grid-community/core"),ChartMenuItemMapper=class g extends import_core.BeanStub{constructor(){super(...arguments),this.beanName="chartMenuItemMapper"}wireBeans(t){this.chartService=t.chartService}getChartItems(t){if(!this.chartService){import_core.ModuleRegistry.__assertRegistered(import_core.ModuleNames.GridChartsModule,`the Context Menu key "${t}"`,this.gridId);return}const o=t==="pivotChart"?new PivotMenuItemMapper(this.gos,this.chartService,this.localeService):new RangeMenuItemMapper(this.gos,this.chartService,this.localeService),r=this.chartService.isEnterprise();let i=o.getMenuItem();if(i&&i.subMenu&&!r){const s=a=>({...a,subMenu:a.subMenu?.filter(u=>!u._enterprise).map(u=>s(u))});i=s(i)}const n=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;return n&&(i=g.filterAndOrderChartMenu(i,n,o.getConfigLookup())),this.cleanInternals(i)}cleanInternals(t){if(!t)return t;const o=r=>(delete r?._key,delete r?._enterprise,r?.subMenu?.forEach(i=>o(i)),r);return o(t)}static buildLookup(t){const o={},r=i=>{o[i._key]=i,i.subMenu&&i.subMenu.forEach(n=>r(n))};return r(t),o}static filterAndOrderChartMenu(t,o,r){const i=this.buildLookup(t),n={...t,subMenu:[]};if(Object.entries(o).forEach(([s,a])=>{const u=r[s];if(u===null)return;if(u==null){(0,import_core._warnOnce)(`invalid chartGroupsDef config '${s}'`);return}const l=i[u._key];if(l)if(l.subMenu){const d=a.map(c=>{const h=u[c];if(h==null){(0,import_core._warnOnce)(`invalid chartGroupsDef config '${s}.${c}'`);return}return i[h]}).filter(c=>c!==void 0);d.length>0&&(l.subMenu=d,n.subMenu?.push(l))}else n.subMenu?.push(l)}),n.subMenu?.length!=0)return n}},PivotMenuItemMapper=class{constructor(e,t,o){this.gos=e,this.chartService=t,this.localeService=o}getMenuItem(){const e=this.localeService.getLocaleTextFunc(),t=(o,r,i,n,s=!1)=>({name:e(o,r),action:()=>this.chartService.createPivotChart({chartType:i}),_key:n,_enterprise:s});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped&lrm;","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked&lrm;","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked&lrm;","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped&lrm;","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked&lrm;","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked&lrm;","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie&lrm;","pie","pivotPie"),t("donut","Donut&lrm;","donut","pivotDonut")]},t("line","Line&lrm;","line","pivotLineChart"),{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter&lrm;","scatter","pivotScatter"),t("bubble","Bubble&lrm;","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("area","Area&lrm;","area","pivotArea"),t("stackedArea","Stacked&lrm;","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked&lrm;","normalizedArea","pivotNormalizedArea")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram&lrm;","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap&lrm;","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst&lrm;","sunburst","pivotSunburst",!0)]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line&lrm;","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","pivotAreaColumnCombo")]}],icon:(0,import_core._createIconNoSpan)("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},polarGroup:null,specializedGroup:null}}},RangeMenuItemMapper=class{constructor(e,t,o){this.gos=e,this.chartService=t,this.localeService=o}getMenuItem(){const e=this.localeService.getLocaleTextFunc(),t=(o,r,i,n,s=!1)=>({name:e(o,r),action:()=>this.chartService.createChartFromCurrentRange(i),_key:n,_enterprise:s});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped&lrm;","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked&lrm;","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked&lrm;","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped&lrm;","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked&lrm;","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked&lrm;","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie&lrm;","pie","rangePie"),t("donut","Donut&lrm;","donut","rangeDonut")],_key:"rangePieChart"},t("line","Line&lrm;","line","rangeLineChart"),{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter&lrm;","scatter","rangeScatter"),t("bubble","Bubble&lrm;","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("areaChart","Area"),subMenu:[t("area","Area&lrm;","area","rangeArea"),t("stackedArea","Stacked&lrm;","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked&lrm;","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line&lrm;","radarLine","rangeRadarLine"),t("radarArea","Radar Area&lrm;","radarArea","rangeRadarArea"),t("nightingale","Nightingale&lrm;","nightingale","rangeNightingale"),t("radialColumn","Radial Column&lrm;","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar&lrm;","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot&lrm;","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram&lrm;","histogram","rangeHistogram",!1),t("rangeBar","Range Bar&lrm;","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area&lrm;","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap&lrm;","treemap","rangeTreemap"),t("sunburst","Sunburst&lrm;","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap&lrm;","heatmap","rangeHeatmap"),t("waterfall","Waterfall&lrm;","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line&lrm;","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:(0,import_core._createIconNoSpan)("chart",this.gos,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},import_core2=require("@ag-grid-community/core"),import_column_tool_panel=require("@ag-grid-enterprise/column-tool-panel"),import_core3=require("@ag-grid-enterprise/core"),ColumnChooserFactory=class extends import_core2.BeanStub{constructor(){super(...arguments),this.beanName="columnChooserFactory"}wireBeans(e){this.focusService=e.focusService,this.menuUtils=e.menuUtils,this.visibleColsService=e.visibleColsService}createColumnSelectPanel(e,t,o,r){const i=e.createManagedBean(new import_column_tool_panel.AgPrimaryCols),n=r??t?.getColDef().columnChooserParams??t?.getColDef().columnsMenuParams??{},{contractColumnSelection:s,suppressColumnExpandAll:a,suppressColumnFilter:u,suppressColumnSelectAll:l,suppressSyncLayoutWithGrid:d,columnLayout:c}=n;return i.init(!!o,this.gos.addGridCommonParams({suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!s,suppressColumnExpandAll:!!a,suppressColumnFilter:!!u,suppressColumnSelectAll:!!l,suppressSyncLayoutWithGrid:!!c||!!d,onStateUpdated:()=>{}}),"columnMenu"),c&&i.setColumnLayout(c),i}showColumnChooser({column:e,chooserParams:t,eventSource:o}){this.hideActiveColumnChooser();const r=this.createColumnSelectPanel(this,e,!0,t),i=this.localeService.getLocaleTextFunc(),n=this.visibleColsService.getAllCols().indexOf(e),s=e?this.focusService.getFocusedHeader():null;this.activeColumnChooserDialog=this.createBean(new import_core3.AgDialog({title:i("chooseColumns","Choose Columns"),component:r,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{this.focusService.findNextFocusableElement(r.getGui())?.focus(),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:a=>{const u=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&this.menuUtils.restoreFocusOnClose({column:e,headerPosition:s,columnIndex:n,eventSource:o},u,a,!0)}})),this.activeColumnChooser=r}hideActiveColumnChooser(){this.activeColumnChooserDialog&&this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){const o={type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:"columnChooser",column:t??null};this.eventService.dispatchEvent(o)}},import_core4=require("@ag-grid-community/core"),import_core5=require("@ag-grid-enterprise/core"),MENU_ITEM_SEPARATOR="separator",ColumnMenuFactory=class extends import_core4.BeanStub{constructor(){super(...arguments),this.beanName="columnMenuFactory"}wireBeans(e){this.menuItemMapper=e.menuItemMapper,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowModel=e.rowModel,this.menuService=e.menuService}createMenu(e,t,o){const r=e.createManagedBean(new import_core5.AgMenuList(0,{column:t??null,node:null,value:null})),i=this.getMenuItems(t),n=this.menuItemMapper.mapWithStockItems(i,t??null,o,"columnMenu");return r.addMenuItems(n),r}getMenuItems(e){const t=this.getDefaultMenuOptions(e);let o;const r=e?.getColDef().mainMenuItems;if(Array.isArray(r))o=r;else if(typeof r=="function")o=r(this.gos.addGridCommonParams({column:e,defaultItems:t}));else{const i=this.gos.getCallback("getMainMenuItems");i&&e?o=i({column:e,defaultItems:t}):o=t}return(0,import_core4._removeRepeatsFromArray)(o,MENU_ITEM_SEPARATOR),o}getDefaultMenuOptions(e){const t=[],o=this.menuService.isLegacyMenuEnabled();if(!e)return o||t.push("columnChooser"),t.push("resetColumns"),t;const r=!e.getColDef().lockPinned,i=this.funcColsService.getRowGroupColumns().length,n=i>0,s=e.isAllowValue(),a=e.isAllowRowGroup(),u=e.isPrimary(),l=this.columnModel.isPivotMode(),d=this.rowModel.getType()==="clientSide",c=this.gos.get("treeData"),h=u&&n&&s||!u;if(!o&&e.isSortable()){const m=e.getSort();m!=="asc"&&t.push("sortAscending"),m!=="desc"&&t.push("sortDescending"),m&&t.push("sortUnSort"),t.push(MENU_ITEM_SEPARATOR)}return this.menuService.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(MENU_ITEM_SEPARATOR)),r&&t.push("pinSubMenu"),h&&t.push("valueAggSubMenu"),(r||h)&&t.push(MENU_ITEM_SEPARATOR),t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(MENU_ITEM_SEPARATOR),e.getColDef().showRowGroup?t.push("rowUnGroup"):a&&e.isPrimary()&&(e.isRowGroupActive()?this.columnModel.isColGroupLocked(e)||t.push("rowUnGroup"):t.push("rowGroup")),t.push(MENU_ITEM_SEPARATOR),o||t.push("columnChooser"),t.push("resetColumns"),d&&(c||i>(l?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}},import_core6=require("@ag-grid-community/core"),import_core7=require("@ag-grid-enterprise/core"),CSS_MENU="ag-menu",CSS_CONTEXT_MENU_OPEN="ag-context-menu-open",ContextMenuFactory=class extends import_core6.BeanStub{constructor(){super(...arguments),this.beanName="contextMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.menuUtils=e.menuUtils,this.rangeService=e.rangeService}hideActiveMenu(){this.destroyBean(this.activeMenu)}getMenuItems(e,t,o){const r=[];if((0,import_core6._exists)(e)&&import_core6.ModuleRegistry.__isRegistered(import_core6.ModuleNames.ClipboardModule,this.gridId)&&t&&(this.gos.get("suppressCutToClipboard")||r.push("cut"),r.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gos.get("enableCharts")&&import_core6.ModuleRegistry.__isRegistered(import_core6.ModuleNames.GridChartsModule,this.gridId)&&(this.columnModel.isPivotMode()&&r.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&r.push("chartRange")),(0,import_core6._exists)(e)){const a=!import_core6.ModuleRegistry.__isRegistered(import_core6.ModuleNames.CsvExportModule,this.gridId),u=!import_core6.ModuleRegistry.__isRegistered(import_core6.ModuleNames.ExcelExportModule,this.gridId),l=this.gos.get("suppressExcelExport")||u,d=this.gos.get("suppressCsvExport")||a;!(0,import_core6._isIOSUserAgent)()&&(!l||!d)&&r.push("export")}const i=r.length?r:void 0,n=t?.getColDef().contextMenuItems;if(Array.isArray(n))return n;if(typeof n=="function")return n(this.gos.addGridCommonParams({column:t,node:e,value:o,defaultItems:i}));const s=this.gos.getCallback("getContextMenuItems");return s?s({column:t,node:e,value:o,defaultItems:i}):r}onContextMenu(e,t,o,r,i,n){this.menuUtils.onContextMenu(e,t,s=>this.showMenu(o,r,i,s,n))}showMenu(e,t,o,r,i){const n=this.getMenuItems(e,t,o),s=this.ctrlsService.getGridBodyCtrl().getGui();if(n===void 0||(0,import_core6._missingOrEmpty)(n))return!1;const a=new ContextMenu(n,t,e,o);this.createBean(a);const u=a.getGui(),l={column:t,rowNode:e,type:"contextMenu",mouseEvent:r,ePopup:u,nudgeY:1},d=this.localeService.getLocaleTextFunc(),c=this.popupService.addPopup({modal:!0,eChild:u,closeOnEsc:!0,closedCallback:p=>{s.classList.remove(CSS_CONTEXT_MENU_OPEN),this.destroyBean(a),this.dispatchVisibleChangedEvent(!1,p===void 0?"api":"ui")},click:r,positionCallback:()=>{const p=this.gos.get("enableRtl");this.popupService.positionPopupUnderMouseEvent({...l,nudgeX:p?(u.offsetWidth+1)*-1:1})},anchorToElement:i,ariaLabel:d("ariaLabelContextMenu","Context Menu")});c&&(s.classList.add(CSS_CONTEXT_MENU_OPEN),a.afterGuiAttached({container:"contextMenu",hidePopup:c.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=a,a.addEventListener("destroyed",()=>{this.activeMenu===a&&(this.activeMenu=null)}),c&&a.addEventListener("closeMenu",p=>c.hideFunc({mouseEvent:p.mouseEvent??void 0,keyboardEvent:p.keyboardEvent??void 0,forceHide:!0}));const h=r&&r instanceof MouseEvent&&r.type==="mousedown";return this.dispatchVisibleChangedEvent(!0,h?"api":"ui"),!0}dispatchVisibleChangedEvent(e,t="ui"){const o={type:"contextMenuVisibleChanged",visible:e,source:t};this.eventService.dispatchEvent(o)}},ContextMenu=class extends import_core6.Component{constructor(e,t,o,r){super(`<div class="${CSS_MENU}" role="presentation"></div>`),this.menuItems=e,this.column=t,this.node=o,this.value=r,this.menuList=null,this.focusedCell=null}wireBeans(e){this.focusService=e.focusService,this.menuItemMapper=e.menuItemMapper,this.cellPositionUtils=e.cellPositionUtils}postConstruct(){const e=this.createManagedBean(new import_core7.AgMenuList(0,{column:this.column,node:this.node,value:this.value})),t=this.menuItemMapper.mapWithStockItems(this.menuItems,null,()=>this.getGui(),"contextMenu");e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener("closeMenu",o=>this.dispatchLocalEvent(o))}afterGuiAttached(e){e.hidePopup&&this.addDestroyFunc(e.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())}restoreFocusedCell(){const e=this.focusService.getFocusedCell();if(e&&this.focusedCell&&this.cellPositionUtils.equals(e,this.focusedCell)){const{rowIndex:t,rowPinned:o,column:r}=this.focusedCell,i=this.gos.getDocument(),n=this.gos.getActiveDomElement();(!n||n===i.body)&&this.focusService.setFocusedCell({rowIndex:t,column:r,rowPinned:o,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!this.focusService.isKeyboardMode()})}}destroy(){this.restoreFocusedCell(),super.destroy()}},import_core8=require("@ag-grid-community/core"),import_core9=require("@ag-grid-enterprise/core"),TAB_FILTER="filterMenuTab",TAB_GENERAL="generalMenuTab",TAB_COLUMNS="columnsMenuTab",TABS_DEFAULT=[TAB_GENERAL,TAB_FILTER,TAB_COLUMNS],EnterpriseMenuFactory=class extends import_core8.BeanStub{constructor(){super(...arguments),this.beanName="enterpriseMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.visibleColsService=e.visibleColsService,this.filterManager=e.filterManager,this.menuUtils=e.menuUtils,this.menuService=e.menuService}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,o,r){const i=r?"filterMenuTab":void 0;this.showMenu(e,n=>{const s=n.getGui();this.popupService.positionPopupUnderMouseEvent({type:o,column:e,mouseEvent:t,ePopup:s}),i&&n.showTab?.(i),this.dispatchVisibleChangedEvent(!0,!1,e,i)},o,i,void 0,t.target)}showMenuAfterButtonClick(e,t,o,r){let i=-1,n="left";this.gos.get("enableRtl")&&(i=1,n="right");const s=r?"filterMenuTab":void 0,a=s?[s]:void 0,u=this.menuService.isLegacyMenuEnabled(),l=(u?9:4)*i,d=u?-23:4;this.showMenu(e,c=>{const h=c.getGui();this.popupService.positionPopupByComponent({type:o,column:e,eventSource:t,ePopup:h,alignSide:n,nudgeX:l,nudgeY:d,position:"under",keepWithinBounds:!0}),s&&c.showTab?.(s),this.dispatchVisibleChangedEvent(!0,!1,e,s)},o,s,a,t)}showMenu(e,t,o,r,i,n){const{menu:s,eMenuGui:a,anchorToElement:u,restoreFocusParams:l}=this.getMenuParams(e,i,n),d=[];d.push(h=>{const p=s.getGui();this.destroyBean(s),e&&(e.setMenuVisible(!1,"contextMenu"),this.menuUtils.restoreFocusOnClose(l,p,h))});const c=this.localeService.getLocaleTextFunc();if(this.popupService.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:h=>{d.forEach(p=>p(h)),this.dispatchVisibleChangedEvent(!1,!1,e,r)},afterGuiAttached:h=>s.afterGuiAttached(Object.assign({},{container:o},h)),positionCallback:r?()=>t(s):void 0,ariaLabel:c("ariaLabelColumnMenu","Column Menu")}),r||(s.showTabBasedOnPreviousSelection?.(),t(s)),this.menuService.isColumnMenuAnchoringEnabled()){const h=this.popupService.setPopupPositionRelatedToElement(a,u);h&&e&&this.addStopAnchoring(h,e,d)}s.addEventListener("tabSelected",h=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=h.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),e?.setMenuVisible(!0,"contextMenu"),this.activeMenu=s,s.addEventListener("destroyed",()=>{this.activeMenu===s&&(this.activeMenu=null)})}addStopAnchoring(e,t,o){e.then(r=>{t.addEventListener("leftChanged",r),t.addEventListener("visibleChanged",r),o.push(()=>{t.removeEventListener("leftChanged",r),t.removeEventListener("visibleChanged",r)})})}getMenuParams(e,t,o){const r={column:e,headerPosition:this.focusService.getFocusedHeader(),columnIndex:this.visibleColsService.getAllCols().indexOf(e),eventSource:o},i=this.createMenu(e,r,t,o);return{menu:i,eMenuGui:i.getGui(),anchorToElement:o||this.ctrlsService.getGridBodyCtrl().getGui(),restoreFocusParams:r}}createMenu(e,t,o,r){return this.menuService.isLegacyMenuEnabled()?this.createBean(new TabbedColumnMenu(e,t,this.lastSelectedTab,o,r)):this.createBean(new ColumnContextMenu(e,t,r))}dispatchVisibleChangedEvent(e,t,o,r){const i={type:"columnMenuVisibleChanged",visible:e,switchingTab:t,key:this.lastSelectedTab??r??(this.menuService.isLegacyMenuEnabled()?TAB_GENERAL:"columnMenu"),column:o??null};this.eventService.dispatchEvent(i)}isMenuEnabled(e){if(!this.menuService.isLegacyMenuEnabled())return!0;const t=!this.filterManager?.isFilterAllowed(e),o=e.getColDef().menuTabs??TABS_DEFAULT;return(t&&o.includes(TAB_FILTER)?o.length-1:o.length)>0}showMenuAfterContextMenuEvent(e,t,o){this.menuUtils.onContextMenu(t,o,r=>(this.showMenuAfterMouseEvent(e,r,"columnMenu"),!0))}},TabbedColumnMenu=class extends import_core8.BeanStub{constructor(e,t,o,r,i){super(),this.column=e,this.restoreFocusParams=t,this.initialSelection=o,this.restrictTo=r,this.sourceElement=i,this.tabFactories={},this.includeChecks={},this.tabFactories[TAB_GENERAL]=this.createMainPanel.bind(this),this.tabFactories[TAB_FILTER]=this.createFilterPanel.bind(this),this.tabFactories[TAB_COLUMNS]=this.createColumnsPanel.bind(this),this.includeChecks[TAB_GENERAL]=()=>!0,this.includeChecks[TAB_FILTER]=()=>e?!!this.filterManager?.isFilterAllowed(e):!1,this.includeChecks[TAB_COLUMNS]=()=>!0}wireBeans(e){this.filterManager=e.filterManager,this.columnChooserFactory=e.columnChooserFactory,this.columnMenuFactory=e.columnMenuFactory,this.menuUtils=e.menuUtils}postConstruct(){const e=this.getTabsToCreate().map(t=>this.createTab(t));this.tabbedLayout=new import_core9.TabbedLayout({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)}),this.createBean(this.tabbedLayout),this.mainMenuList&&this.mainMenuList.setParentComponent(this.tabbedLayout),this.addDestroyFunc(()=>this.destroyBean(this.tabbedLayout))}getTabsToCreate(){return this.restrictTo?this.restrictTo:(this.column?.getColDef().menuTabs??TABS_DEFAULT).filter(e=>this.isValidMenuTabItem(e)).filter(e=>this.isNotSuppressed(e)).filter(e=>this.isModuleLoaded(e))}isModuleLoaded(e){return e===TAB_COLUMNS?import_core8.ModuleRegistry.__isRegistered(import_core8.ModuleNames.ColumnsToolPanelModule,this.gridId):!0}isValidMenuTabItem(e){let t=!0,o=TABS_DEFAULT;return this.restrictTo!=null&&(t=this.restrictTo.indexOf(e)>-1,o=this.restrictTo),t=t&&TABS_DEFAULT.indexOf(e)>-1,t||(0,import_core8._warnOnce)(`Trying to render an invalid menu item '${e}'. Check that your 'menuTabs' contains one of [${o}]`),t}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){this.tabItemColumns&&e===TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&e===TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&e===TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()}onTabItemClicked(e){let t=null;switch(e.item){case this.tabItemColumns:t=TAB_COLUMNS;break;case this.tabItemFilter:t=TAB_FILTER;break;case this.tabItemGeneral:t=TAB_GENERAL;break}t&&this.activateTab(t)}activateTab(e){const t={type:"tabSelected",key:e};this.dispatchLocalEvent(t)}createMainPanel(){return this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>this.sourceElement??this.getGui()),this.mainMenuList.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.tabItemGeneral={title:(0,import_core8._createIconNoSpan)("menu",this.gos,this.column),titleLabel:TAB_GENERAL.replace("MenuTab",""),bodyPromise:import_core8.AgPromise.resolve(this.mainMenuList.getGui()),name:TAB_GENERAL},this.tabItemGeneral}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const e=this.column?this.createBean(new import_core8.FilterWrapperComp(this.column,"COLUMN_MENU")):null;if(this.filterComp=e,!e?.hasFilter())throw new Error("AG Grid - Unable to instantiate filter");const t=r=>e.afterGuiAttached(r),o=()=>e.afterGuiDetached();return this.tabItemFilter={title:(0,import_core8._createIconNoSpan)("filter",this.gos,this.column),titleLabel:TAB_FILTER.replace("MenuTab",""),bodyPromise:import_core8.AgPromise.resolve(e?.getGui()),afterAttachedCallback:t,afterDetachedCallback:o,name:TAB_FILTER},this.tabItemFilter}createColumnsPanel(){const e=document.createElement("div");e.classList.add("ag-menu-column-select-wrapper");const o=this.columnChooserFactory.createColumnSelectPanel(this,this.column).getGui();return o.classList.add("ag-menu-column-select"),e.appendChild(o),this.tabItemColumns={title:(0,import_core8._createIconNoSpan)("columns",this.gos,this.column),titleLabel:TAB_COLUMNS.replace("MenuTab",""),bodyPromise:import_core8.AgPromise.resolve(e),name:TAB_COLUMNS},this.tabItemColumns}afterGuiAttached(e){const{container:t,hidePopup:o}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:o}),o&&(this.hidePopupFunc=o,this.addDestroyFunc(o))}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},ColumnContextMenu=class extends import_core8.Component{constructor(e,t,o){super(`
<div data-ref="eColumnMenu" role="presentation" class="ag-menu ag-column-menu"></div>
`),this.column=e,this.restoreFocusParams=t,this.sourceElement=o,this.eColumnMenu=import_core8.RefPlaceholder}wireBeans(e){this.columnMenuFactory=e.columnMenuFactory,this.menuUtils=e.menuUtils,this.focusService=e.focusService}postConstruct(){this.mainMenuList=this.columnMenuFactory.createMenu(this,this.column,()=>this.sourceElement??this.getGui()),this.mainMenuList.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(e){this.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),this.focusService.focusInto(this.mainMenuList.getGui())}};function showContextMenu(e,t){const{rowNode:o,column:r,value:i,x:n,y:s}=t||{};let{x:a,y:u}=e.menuService.getContextMenuPosition(o,r);n!=null&&(a=n),s!=null&&(u=s),e.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:a,clientY:u}),rowNode:o,column:r,value:i})}function showColumnChooser(e,t){e.menuService.showColumnChooser({chooserParams:t})}function hideColumnChooser(e){e.menuService.hideColumnChooser()}var import_core10=require("@ag-grid-community/core"),MenuItemMapper=class extends import_core10.BeanStub{constructor(){super(...arguments),this.beanName="menuItemMapper"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.columnApplyStateService=e.columnApplyStateService,this.funcColsService=e.funcColsService,this.focusService=e.focusService,this.rowPositionUtils=e.rowPositionUtils,this.chartMenuItemMapper=e.chartMenuItemMapper,this.menuService=e.menuService,this.sortController=e.sortController,this.columnAutosizeService=e.columnAutosizeService,this.expansionService=e.expansionService,this.clipboardService=e.clipboardService,this.aggFuncService=e.aggFuncService,this.csvCreator=e.csvCreator,this.excelCreator=e.excelCreator}mapWithStockItems(e,t,o,r){if(!e)return[];const i=[];return e.forEach(n=>{let s;if(typeof n=="string"?s=this.getStockMenuItem(n,t,o,r):s={...n},!s)return;const a=s,{subMenu:u}=a;u&&u instanceof Array&&(a.subMenu=this.mapWithStockItems(u,t,o,r)),s!=null&&i.push(s)}),i}getStockMenuItem(e,t,o,r){const i=this.localeService.getLocaleTextFunc(),n=this.gos.get("skipHeaderOnAutoSize");switch(e){case"pinSubMenu":return{name:i("pinColumn","Pin Column"),icon:(0,import_core10._createIconNoSpan)("menuPin",this.gos,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:i("pinLeft","Pin Left"),action:()=>this.columnModel.setColsPinned([t],"left",r),checked:!!t&&t.isPinnedLeft()};case"pinRight":return{name:i("pinRight","Pin Right"),action:()=>this.columnModel.setColsPinned([t],"right",r),checked:!!t&&t.isPinnedRight()};case"clearPinned":return{name:i("noPin","No Pin"),action:()=>this.columnModel.setColsPinned([t],null,r),checked:!!t&&!t.isPinned()};case"valueAggSubMenu":return import_core10.ModuleRegistry.__assertRegistered(import_core10.ModuleNames.RowGroupingModule,"Aggregation from Menu",this.gridId)?!t?.isPrimary()&&!t?.getColDef().pivotValueColumn?null:{name:i("valueAggregation","Value Aggregation"),icon:(0,import_core10._createIconNoSpan)("menuValue",this.gos,null),subMenu:this.createAggregationSubMenu(t,this.aggFuncService)}:null;case"autoSizeThis":return{name:i("autosizeThisColumn","Autosize This Column"),action:()=>this.columnAutosizeService.autoSizeColumn(t,r,n)};case"autoSizeAll":return{name:i("autosizeAllColumns","Autosize All Columns"),action:()=>this.columnAutosizeService.autoSizeAllColumns(r,n)};case"rowGroup":return{name:i("groupBy","Group by")+" "+(0,import_core10._escapeString)(this.columnNameService.getDisplayNameForColumn(t,"header")),disabled:this.gos.get("functionsReadOnly")||t?.isRowGroupActive()||!t?.getColDef().enableRowGroup,action:()=>this.funcColsService.addRowGroupColumns([t],r),icon:(0,import_core10._createIconNoSpan)("menuAddRowGroup",this.gos,null)};case"rowUnGroup":{const s=(0,import_core10._createIconNoSpan)("menuRemoveRowGroup",this.gos,null),a=t?.getColDef().showRowGroup,u=this.gos.get("groupLockGroupColumns");if(a===!0)return{name:i("ungroupAll","Un-Group All"),disabled:this.gos.get("functionsReadOnly")||u===-1||u>=this.funcColsService.getRowGroupColumns().length,action:()=>this.funcColsService.setRowGroupColumns(this.funcColsService.getRowGroupColumns().slice(0,u),r),icon:s};if(typeof a=="string"){const l=this.columnModel.getColDefCol(a),d=l!=null?(0,import_core10._escapeString)(this.columnNameService.getDisplayNameForColumn(l,"header")):a;return{name:i("ungroupBy","Un-Group by")+" "+d,disabled:this.gos.get("functionsReadOnly")||l!=null&&this.columnModel.isColGroupLocked(l),action:()=>this.funcColsService.removeRowGroupColumns([a],r),icon:s}}return{name:i("ungroupBy","Un-Group by")+" "+(0,import_core10._escapeString)(this.columnNameService.getDisplayNameForColumn(t,"header")),disabled:this.gos.get("functionsReadOnly")||!t?.isRowGroupActive()||!t?.getColDef().enableRowGroup||this.columnModel.isColGroupLocked(t),action:()=>this.funcColsService.removeRowGroupColumns([t],r),icon:s}}case"resetColumns":return{name:i("resetColumns","Reset Columns"),action:()=>this.columnApplyStateService.resetColumnState(r)};case"expandAll":return{name:i("expandAll","Expand All Row Groups"),action:()=>this.expansionService.expandAll(!0)};case"contractAll":return{name:i("collapseAll","Collapse All Row Groups"),action:()=>this.expansionService.expandAll(!1)};case"copy":return import_core10.ModuleRegistry.__assertRegistered(import_core10.ModuleNames.ClipboardModule,"Copy from Menu",this.gridId)?{name:i("copy","Copy"),shortcut:i("ctrlC","Ctrl+C"),icon:(0,import_core10._createIconNoSpan)("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard()}:null;case"copyWithHeaders":return import_core10.ModuleRegistry.__assertRegistered(import_core10.ModuleNames.ClipboardModule,"Copy with Headers from Menu",this.gridId)?{name:i("copyWithHeaders","Copy with Headers"),icon:(0,import_core10._createIconNoSpan)("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return import_core10.ModuleRegistry.__assertRegistered(import_core10.ModuleNames.ClipboardModule,"Copy with Group Headers from Menu",this.gridId)?{name:i("copyWithGroupHeaders","Copy with Group Headers"),icon:(0,import_core10._createIconNoSpan)("clipboardCopy",this.gos,null),action:()=>this.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(import_core10.ModuleRegistry.__assertRegistered(import_core10.ModuleNames.ClipboardModule,"Cut from Menu",this.gridId)){const s=this.focusService.getFocusedCell(),a=s?this.rowPositionUtils.getRowNode(s):null,u=a?s?.column.isCellEditable(a):!1;return{name:i("cut","Cut"),shortcut:i("ctrlX","Ctrl+X"),icon:(0,import_core10._createIconNoSpan)("clipboardCut",this.gos,null),disabled:!u||this.gos.get("suppressCutToClipboard"),action:()=>this.clipboardService.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":return import_core10.ModuleRegistry.__assertRegistered(import_core10.ModuleNames.ClipboardModule,"Paste from Clipboard",this.gridId)?{name:i("paste","Paste"),shortcut:i("ctrlV","Ctrl+V"),disabled:!0,icon:(0,import_core10._createIconNoSpan)("clipboardPaste",this.gos,null),action:()=>this.clipboardService.pasteFromClipboard()}:null;case"export":{const s=[],a=import_core10.ModuleRegistry.__isRegistered(import_core10.ModuleNames.CsvExportModule,this.gridId),u=import_core10.ModuleRegistry.__isRegistered(import_core10.ModuleNames.ExcelExportModule,this.gridId);return!this.gos.get("suppressCsvExport")&&a&&s.push("csvExport"),!this.gos.get("suppressExcelExport")&&u&&s.push("excelExport"),{name:i("export","Export"),subMenu:s,icon:(0,import_core10._createIconNoSpan)("save",this.gos,null)}}case"csvExport":return{name:i("csvExport","CSV Export"),icon:(0,import_core10._createIconNoSpan)("csvExport",this.gos,null),action:()=>this.csvCreator?.exportDataAsCsv()};case"excelExport":return{name:i("excelExport","Excel Export"),icon:(0,import_core10._createIconNoSpan)("excelExport",this.gos,null),action:()=>this.excelCreator?.exportDataAsExcel()};case"separator":return"separator";case"pivotChart":case"chartRange":return this.chartMenuItemMapper.getChartItems(e)??null;case"columnFilter":return t?{name:i("columnFilter","Column Filter"),icon:(0,import_core10._createIconNoSpan)("filter",this.gos,null),action:()=>this.menuService.showFilterMenu({column:t,buttonElement:o(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":return import_core10.ModuleRegistry.__isRegistered(import_core10.ModuleNames.ColumnsToolPanelModule,this.gridId)?{name:i("columnChooser","Choose Columns"),icon:(0,import_core10._createIconNoSpan)("columns",this.gos,null),action:()=>this.menuService.showColumnChooser({column:t,eventSource:o()})}:null;case"sortAscending":return{name:i("sortAscending","Sort Ascending"),icon:(0,import_core10._createIconNoSpan)("sortAscending",this.gos,null),action:()=>this.sortController.setSortForColumn(t,"asc",!1,r)};case"sortDescending":return{name:i("sortDescending","Sort Descending"),icon:(0,import_core10._createIconNoSpan)("sortDescending",this.gos,null),action:()=>this.sortController.setSortForColumn(t,"desc",!1,r)};case"sortUnSort":return{name:i("sortUnSort","Clear Sort"),icon:(0,import_core10._createIconNoSpan)("sortUnSort",this.gos,null),action:()=>this.sortController.setSortForColumn(t,null,!1,r)};default:return(0,import_core10._warnOnce)(`unknown menu item type ${e}`),null}}createAggregationSubMenu(e,t){const o=this.localeService.getLocaleTextFunc();let r;if(e.isPrimary())r=e;else{const n=e.getColDef().pivotValueColumn;r=(0,import_core10._exists)(n)?n:void 0}const i=[];if(r){const n=r.isValueActive(),s=t.getFuncNames(r);i.push({name:o("noAggregation","None"),action:()=>{this.funcColsService.removeValueColumns([r],"contextMenu"),this.funcColsService.setColumnAggFunc(r,void 0,"contextMenu")},checked:!n}),s.forEach(a=>{i.push({name:o(a,t.getDefaultFuncLabel(a)),action:()=>{this.funcColsService.setColumnAggFunc(r,a,"contextMenu"),this.funcColsService.addValueColumns([r],"contextMenu")},checked:n&&r.getAggFunc()===a})})}return i}},import_core11=require("@ag-grid-community/core"),MenuUtils=class extends import_core11.BeanStub{constructor(){super(...arguments),this.beanName="menuUtils"}wireBeans(e){this.focusService=e.focusService,this.headerNavigationService=e.headerNavigationService,this.visibleColsService=e.visibleColsService}restoreFocusOnClose(e,t,o,r){const{eventSource:i}=e,n=o instanceof KeyboardEvent;if(!r&&!n||!i)return;const s=this.gos.getDocument(),a=this.gos.getActiveDomElement();!t.contains(a)&&a!==s.body||this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,o){let r;o&&o.keyboardEvent&&(r=o.keyboardEvent),e(r&&{keyboardEvent:r});const i=this.focusService.getFocusedCell(),n=this.gos.getDocument(),s=this.gos.getActiveDomElement();if(!s||s===n.body)if(i){const{rowIndex:a,rowPinned:u,column:l}=i;this.focusService.setFocusedCell({rowIndex:a,column:l,rowPinned:u,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e,t,o){if(!this.gos.get("allowContextMenuWithControlKey")&&e&&(e.ctrlKey||e.metaKey)||(e&&this.blockMiddleClickScrollsIfNeeded(e),this.gos.get("suppressContextMenu")))return;const r=e??t.touches[0];if(o(r)){const i=e??t;i&&i.cancelable&&i.preventDefault()}}focusHeaderCell(e){const{column:t,columnIndex:o,headerPosition:r,eventSource:i}=e;if(this.visibleColsService.getAllCols().some(s=>s===t)&&i&&(0,import_core11._isVisible)(i)){const s=this.focusService.findTabbableParent(i);s&&(t&&this.headerNavigationService.scrollToColumn(t),s.focus())}else if(r&&o!==-1){const s=this.visibleColsService.getAllCols(),a=s[o]||(0,import_core11._last)(s);a&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:r.headerRowIndex,column:a}})}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&e.which===2&&e.preventDefault()}},VERSION="32.0.0",MenuCoreModule={version:VERSION,moduleName:`${import_core12.ModuleNames.MenuModule}-core`,beans:[EnterpriseMenuFactory,ContextMenuFactory,MenuItemMapper,ChartMenuItemMapper,ColumnChooserFactory,ColumnMenuFactory,MenuUtils],dependantModules:[import_core13.EnterpriseCoreModule],userComponents:[{name:"agMenuItem",classImp:import_core13.AgMenuItemRenderer}]},MenuApiModule={version:VERSION,moduleName:`${import_core12.ModuleNames.MenuModule}-api`,apiFunctions:{showContextMenu,showColumnChooser,hideColumnChooser},dependantModules:[MenuCoreModule,import_core12._CommunityMenuApiModule]},MenuModule={version:VERSION,moduleName:import_core12.ModuleNames.MenuModule,dependantModules:[MenuCoreModule,MenuApiModule]};
{
"name": "@ag-grid-enterprise/menu",
"version": "31.3.2",
"version": "32.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -14,6 +14,7 @@ "main": "./dist/package/main.cjs.js",

},
"sideEffects": false,
"dependencies": {
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2",
"@ag-grid-enterprise/column-tool-panel": "31.3.2"
"@ag-grid-community/core": "32.0.0",
"@ag-grid-enterprise/core": "32.0.0",
"@ag-grid-enterprise/column-tool-panel": "32.0.0"
},

@@ -20,0 +21,0 @@ "devDependencies": {

{
"name": "@ag-grid-enterprise/menu",
"version": "31.3.2",
"version": "32.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -14,6 +14,7 @@ "main": "./src/main.js",

},
"sideEffects": false,
"dependencies": {
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2",
"@ag-grid-enterprise/column-tool-panel": "31.3.2"
"@ag-grid-community/core": "32.0.0",
"@ag-grid-enterprise/core": "32.0.0",
"@ag-grid-enterprise/column-tool-panel": "32.0.0"
},

@@ -20,0 +21,0 @@ "devDependencies": {

@@ -1,4 +0,7 @@

import { BeanStub, MenuItemDef } from '@ag-grid-community/core';
export declare class ChartMenuItemMapper extends BeanStub {
private readonly chartService?;
import type { BeanCollection, MenuItemDef, NamedBean } from '@ag-grid-community/core';
import { BeanStub } from '@ag-grid-community/core';
export declare class ChartMenuItemMapper extends BeanStub implements NamedBean {
beanName: "chartMenuItemMapper";
private chartService?;
wireBeans(beans: BeanCollection): void;
getChartItems(key: 'pivotChart' | 'chartRange'): MenuItemDef | undefined;

@@ -5,0 +8,0 @@ private cleanInternals;

@@ -1,10 +0,13 @@

import { BeanStub, Column, ColumnChooserParams, IColumnChooserFactory, ShowColumnChooserParams } from "@ag-grid-community/core";
import { PrimaryColsPanel } from "@ag-grid-enterprise/column-tool-panel";
export declare class ColumnChooserFactory extends BeanStub implements IColumnChooserFactory {
private readonly focusService;
private readonly menuUtils;
private readonly columnModel;
import type { AgColumn, BeanCollection, ColumnChooserParams, IColumnChooserFactory, NamedBean, ShowColumnChooserParams } from '@ag-grid-community/core';
import { BeanStub } from '@ag-grid-community/core';
import { AgPrimaryCols } from '@ag-grid-enterprise/column-tool-panel';
export declare class ColumnChooserFactory extends BeanStub implements NamedBean, IColumnChooserFactory {
beanName: "columnChooserFactory";
private focusService;
private menuUtils;
private visibleColsService;
wireBeans(beans: BeanCollection): void;
private activeColumnChooser;
private activeColumnChooserDialog;
createColumnSelectPanel(parent: BeanStub, column?: Column | null, draggable?: boolean, params?: ColumnChooserParams): PrimaryColsPanel;
createColumnSelectPanel(parent: BeanStub<any>, column?: AgColumn | null, draggable?: boolean, params?: ColumnChooserParams): AgPrimaryCols;
showColumnChooser({ column, chooserParams, eventSource }: ShowColumnChooserParams): void;

@@ -11,0 +14,0 @@ hideActiveColumnChooser(): void;

@@ -1,12 +0,15 @@

import { AgMenuList, BeanStub, Column } from "@ag-grid-community/core";
export declare class ColumnMenuFactory extends BeanStub {
private readonly menuItemMapper;
private readonly columnModel;
private readonly rowModel;
private readonly filterManager;
private readonly menuService;
private static MENU_ITEM_SEPARATOR;
createMenu(parent: BeanStub, column: Column | undefined, sourceElement: () => HTMLElement): AgMenuList;
import type { AgColumn, BeanCollection, NamedBean } from '@ag-grid-community/core';
import { BeanStub } from '@ag-grid-community/core';
import { AgMenuList } from '@ag-grid-enterprise/core';
export declare class ColumnMenuFactory extends BeanStub implements NamedBean {
beanName: "columnMenuFactory";
private menuItemMapper;
private columnModel;
private funcColsService;
private rowModel;
private menuService;
wireBeans(beans: BeanCollection): void;
createMenu(parent: BeanStub<any>, column: AgColumn | undefined, sourceElement: () => HTMLElement): AgMenuList;
private getMenuItems;
private getDefaultMenuOptions;
}

@@ -1,3 +0,5 @@

import { BeanStub, Column, IContextMenuFactory, RowNode } from "@ag-grid-community/core";
export declare class ContextMenuFactory extends BeanStub implements IContextMenuFactory {
import type { AgColumn, BeanCollection, IContextMenuFactory, NamedBean, RowNode } from '@ag-grid-community/core';
import { BeanStub } from '@ag-grid-community/core';
export declare class ContextMenuFactory extends BeanStub implements NamedBean, IContextMenuFactory {
beanName: "contextMenuFactory";
private popupService;

@@ -8,8 +10,10 @@ private ctrlsService;

private rangeService?;
wireBeans(beans: BeanCollection): void;
private activeMenu;
hideActiveMenu(): void;
private getMenuItems;
onContextMenu(mouseEvent: MouseEvent | null, touchEvent: TouchEvent | null, rowNode: RowNode | null, column: Column | null, value: any, anchorToElement: HTMLElement): void;
showMenu(node: RowNode | null, column: Column | null, value: any, mouseEvent: MouseEvent | Touch, anchorToElement: HTMLElement): boolean;
onContextMenu(mouseEvent: MouseEvent | null, touchEvent: TouchEvent | null, rowNode: RowNode | null, column: AgColumn | null, value: any, anchorToElement: HTMLElement): void;
showMenu(node: RowNode | null, column: AgColumn | null, value: any, mouseEvent: MouseEvent | Touch, anchorToElement: HTMLElement): boolean;
private dispatchVisibleChangedEvent;
}
export type ContextMenuEvent = 'closeMenu';

@@ -1,18 +0,21 @@

import { AgEvent, BeanStub, Column, IMenuFactory, ContainerType } from '@ag-grid-community/core';
export interface TabSelectedEvent extends AgEvent {
import type { AgColumn, AgEvent, BeanCollection, ContainerType, IMenuFactory, NamedBean } from '@ag-grid-community/core';
import { BeanStub } from '@ag-grid-community/core';
export interface TabSelectedEvent extends AgEvent<'tabSelected'> {
key: string;
}
export declare class EnterpriseMenuFactory extends BeanStub implements IMenuFactory {
private readonly popupService;
private readonly focusService;
private readonly ctrlsService;
private readonly columnModel;
private readonly filterManager;
private readonly menuUtils;
private readonly menuService;
export declare class EnterpriseMenuFactory extends BeanStub implements NamedBean, IMenuFactory {
beanName: "enterpriseMenuFactory";
private popupService;
private focusService;
private ctrlsService;
private visibleColsService;
private filterManager?;
private menuUtils;
private menuService;
wireBeans(beans: BeanCollection): void;
private lastSelectedTab;
private activeMenu;
hideActiveMenu(): void;
showMenuAfterMouseEvent(column: Column | undefined, mouseEvent: MouseEvent | Touch, containerType: ContainerType, filtersOnly?: boolean): void;
showMenuAfterButtonClick(column: Column | undefined, eventSource: HTMLElement, containerType: ContainerType, filtersOnly?: boolean): void;
showMenuAfterMouseEvent(column: AgColumn | undefined, mouseEvent: MouseEvent | Touch, containerType: ContainerType, filtersOnly?: boolean): void;
showMenuAfterButtonClick(column: AgColumn | undefined, eventSource: HTMLElement, containerType: ContainerType, filtersOnly?: boolean): void;
private showMenu;

@@ -23,4 +26,4 @@ private addStopAnchoring;

private dispatchVisibleChangedEvent;
isMenuEnabled(column: Column): boolean;
showMenuAfterContextMenuEvent(column: Column<any> | undefined, mouseEvent?: MouseEvent | null, touchEvent?: TouchEvent | null): void;
isMenuEnabled(column: AgColumn): boolean;
showMenuAfterContextMenuEvent(column: AgColumn<any> | undefined, mouseEvent?: MouseEvent | null, touchEvent?: TouchEvent | null): void;
}

@@ -1,15 +0,24 @@

import { BeanStub, Column, MenuItemDef } from '@ag-grid-community/core';
export declare class MenuItemMapper extends BeanStub {
private readonly columnModel;
private readonly gridApi;
private readonly focusService;
private readonly rowPositionUtils;
private readonly chartMenuItemMapper;
private readonly menuService;
private readonly sortController;
private readonly clipboardService?;
private readonly aggFuncService?;
mapWithStockItems(originalList: (MenuItemDef | string)[], column: Column | null, sourceElement: () => HTMLElement): (MenuItemDef | string)[];
import type { AgColumn, BeanCollection, ColumnEventType, MenuItemDef, NamedBean } from '@ag-grid-community/core';
import { BeanStub } from '@ag-grid-community/core';
export declare class MenuItemMapper extends BeanStub implements NamedBean {
beanName: "menuItemMapper";
private columnModel;
private columnNameService;
private columnApplyStateService;
private funcColsService;
private focusService;
private rowPositionUtils;
private chartMenuItemMapper;
private menuService;
private sortController;
private columnAutosizeService;
private expansionService;
private clipboardService?;
private aggFuncService?;
private csvCreator?;
private excelCreator?;
wireBeans(beans: BeanCollection): void;
mapWithStockItems(originalList: (MenuItemDef | string)[], column: AgColumn | null, sourceElement: () => HTMLElement, source: ColumnEventType): (MenuItemDef | string)[];
private getStockMenuItem;
private createAggregationSubMenu;
}

@@ -1,4 +0,6 @@

import { BeanStub, Column, HeaderPosition, CloseMenuEvent, PopupEventParams } from "@ag-grid-community/core";
import type { AgColumn, BeanCollection, HeaderPosition, NamedBean, PopupEventParams } from '@ag-grid-community/core';
import { BeanStub } from '@ag-grid-community/core';
import type { CloseMenuEvent } from '@ag-grid-enterprise/core';
export interface MenuRestoreFocusParams {
column: Column | undefined;
column: AgColumn | undefined;
headerPosition: HeaderPosition | null;

@@ -8,11 +10,13 @@ columnIndex: number;

}
export declare class MenuUtils extends BeanStub {
private readonly focusService;
private readonly headerNavigationService;
private readonly columnModel;
export declare class MenuUtils extends BeanStub implements NamedBean {
beanName: "menuUtils";
private focusService;
private headerNavigationService;
private visibleColsService;
wireBeans(beans: BeanCollection): void;
restoreFocusOnClose(restoreFocusParams: MenuRestoreFocusParams, eComp: HTMLElement, e?: Event, restoreIfMouseEvent?: boolean): void;
closePopupAndRestoreFocusOnSelect(hidePopupFunc: (popupParams?: PopupEventParams) => void, restoreFocusParams: MenuRestoreFocusParams, event?: CloseMenuEvent): void;
onContextMenu(mouseEvent: MouseEvent | null | undefined, touchEvent: TouchEvent | null | undefined, showMenuCallback: (eventOrTouch: (MouseEvent | Touch)) => boolean): void;
onContextMenu(mouseEvent: MouseEvent | null | undefined, touchEvent: TouchEvent | null | undefined, showMenuCallback: (eventOrTouch: MouseEvent | Touch) => boolean): void;
private focusHeaderCell;
private blockMiddleClickScrollsIfNeeded;
}

@@ -1,2 +0,4 @@

import { Module } from "@ag-grid-community/core";
import type { Module } from '@ag-grid-community/core';
export declare const MenuCoreModule: Module;
export declare const MenuApiModule: Module;
export declare const MenuModule: Module;

@@ -1,1 +0,1 @@

export declare const VERSION = "31.3.2";
export declare const VERSION = "32.0.0";

@@ -0,6 +1,7 @@

/* eslint-disable @typescript-eslint/no-var-requires */
const gulp = require('gulp');
const {series} = gulp;
const { series } = gulp;
const replace = require('gulp-replace');
const rename = require('gulp-rename');
const del = require("del");
const del = require('del');

@@ -12,10 +13,12 @@ const DIST_FOLDER = 'dist/esm/es6/';

.src(['dist/esm/es6/**/*.js', '!dist/esm/es6/**/*.map'])
.pipe(replace(/(import|export)(.*['"]\..*)(['"].*)/gi, (line) => {
const regexp = /(import|export)(.*['"]\..*)(['"].*)/gi;
const matches = [...line.matchAll(regexp)][0];
return `${matches[1]}${matches[2]}.mjs${matches[3]}`
}))
.pipe(
replace(/(import|export)(.*['"]\..*)(['"].*)/gi, (line) => {
const regexp = /(import|export)(.*['"]\..*)(['"].*)/gi;
const matches = [...line.matchAll(regexp)][0];
return `${matches[1]}${matches[2]}.mjs${matches[3]}`;
})
)
.pipe(rename({ extname: '.mjs' }))
.pipe(gulp.dest(DIST_FOLDER));
}
};

@@ -25,3 +28,1 @@ const cleanup = () => del([`${DIST_FOLDER}/**/*.js`]);

gulp.task('mjs-processing', series(mjsProcessing, cleanup));
{
"name": "@ag-grid-enterprise/menu",
"version": "31.3.2",
"version": "32.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -14,6 +14,7 @@ "main": "./dist/package/main.cjs.js",

},
"sideEffects": false,
"dependencies": {
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2",
"@ag-grid-enterprise/column-tool-panel": "31.3.2"
"@ag-grid-community/core": "32.0.0",
"@ag-grid-enterprise/core": "32.0.0",
"@ag-grid-enterprise/column-tool-panel": "32.0.0"
},

@@ -20,0 +21,0 @@ "devDependencies": {

@@ -1,3 +0,2 @@

AG Grid Enterprise
==============
# AG Grid Enterprise

@@ -8,4 +7,4 @@ This project contains AG Grid Enterprise features.

Frameworks Supported
====================
# Frameworks Supported
Framework specific Getting Started guides:

@@ -21,4 +20,3 @@

Issue Reporting
==============
# Issue Reporting

@@ -29,2 +27,1 @@ If you are an Enterprise customer (or are evaluating AG Grid Enterprise) and wish to report a Bug or raise a new Feature Request please do so on our [Support Portal](https://ag-grid.zendesk.com/).

Send an email to accounts@ag-grid.com with your license key

@@ -1,2 +0,1 @@

Support and Maintenance document is now merged into the licence document. Please see the licence.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc