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
3
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.0.0 to 31.0.1

2

dist/cjs/es5/version.d.ts

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

export declare const VERSION = "31.0.0";
export declare const VERSION = "31.0.1";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '31.0.0';
exports.VERSION = '31.0.1';

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

export declare const VERSION = "31.0.0";
export declare const VERSION = "31.0.1";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '31.0.0';
exports.VERSION = '31.0.1';

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

export declare const VERSION = "31.0.0";
export declare const VERSION = "31.0.1";
// DO NOT UPDATE MANUALLY: Generated from script during build time
export var VERSION = '31.0.0';
export var VERSION = '31.0.1';

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

export declare const VERSION = "31.0.0";
export declare const VERSION = "31.0.1";
/**
* @ag-grid-enterprise/menu - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.0
* @ag-grid-enterprise/menu - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.1
* @link https://www.ag-grid.com/

@@ -7,6 +7,6 @@ * @license Commercial

/**
* @ag-grid-enterprise/menu - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.0
* @ag-grid-enterprise/menu - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.1
* @link https://www.ag-grid.com/
* @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),n=require("@ag-grid-enterprise/column-tool-panel"),r=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),i=function(e,t,o,n){var r,i=arguments.length,u=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(u=(i<3?r(u):i>3?r(t,o,u):r(t,o))||u);return i>3&&u&&Object.defineProperty(t,o,u),u},u=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return r(o,e),o.prototype.hideActiveMenu=function(){this.destroyBean(this.activeMenu)},o.prototype.showMenuAfterMouseEvent=function(e,t,o){var n=this;this.showMenu(e,(function(r){var i=r.getGui();n.popupService.positionPopupUnderMouseEvent({type:"columnMenu",column:e,mouseEvent:t,ePopup:i}),o&&r.showTab(o)}),"columnMenu",o,void 0,t.target)},o.prototype.showMenuAfterButtonClick=function(e,t,o,n,r){var i=this,u=-1,a="left";this.gridOptionsService.get("enableRtl")&&(u=1,a="right"),this.showMenu(e,(function(r){var c=r.getGui();i.popupService.positionPopupByComponent({type:o,column:e,eventSource:t,ePopup:c,alignSide:a,nudgeX:9*u,nudgeY:-23,position:"under",keepWithinBounds:!0}),n&&r.showTab(n)}),o,n,r,t)},o.prototype.showMenu=function(e,o,n,r,i,u){var c=this,l=this.getMenuParams(e,i,u),s=l.menu,p=l.eMenuGui,d=l.currentHeaderPosition,m=l.currentColumnIndex,h=l.anchorToElement,v=[];v.push(this.getClosedCallback(e,s,d,m,u));var g=this.localeService.getLocaleTextFunc();this.popupService.addPopup({modal:!0,eChild:p,closeOnEsc:!0,closedCallback:function(e){v.forEach((function(t){return t(e)}))},afterGuiAttached:function(e){return s.afterGuiAttached(Object.assign({},{container:n},e))},positionCallback:r?function(){return o(s)}:void 0,ariaLabel:g("ariaLabelColumnMenu","Column Menu")}),r||(s.showTabBasedOnPreviousSelection(),o(s));var f=this.popupService.setPopupPositionRelatedToElement(p,h);f&&this.addStopAnchoring(f,e,v),s.addEventListener(a.EVENT_TAB_SELECTED,(function(e){c.lastSelectedTab=e.key})),e.setMenuVisible(!0,"contextMenu"),this.activeMenu=s,s.addEventListener(t.BeanStub.EVENT_DESTROYED,(function(){c.activeMenu===s&&(c.activeMenu=null)}))},o.prototype.addStopAnchoring=function(e,t,o){e.then((function(e){t.addEventListener("leftChanged",e),t.addEventListener("visibleChanged",e),o.push((function(){t.removeEventListener("leftChanged",e),t.removeEventListener("visibleChanged",e)}))}))},o.prototype.getClosedCallback=function(e,o,n,r,i){var u=this;return function(a){if(u.destroyBean(o),e.setMenuVisible(!1,"contextMenu"),a instanceof KeyboardEvent&&i)if(u.columnModel.getAllDisplayedColumns().some((function(t){return t===e}))&&t._.isVisible(i)){var c=u.focusService.findTabbableParent(i);c&&(e&&u.headerNavigationService.scrollToColumn(e),c.focus())}else if(n&&-1!==r){var l=u.columnModel.getAllDisplayedColumns(),s=l[r]||t._.last(l);s&&u.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:n.headerRowIndex,column:s}})}}},o.prototype.getMenuParams=function(e,t,o){var n=this.createBean(new a(e,this.lastSelectedTab,t));return{menu:n,eMenuGui:n.getGui(),currentHeaderPosition:this.focusService.getFocusedHeader(),currentColumnIndex:this.columnModel.getAllDisplayedColumns().indexOf(e),anchorToElement:o||this.ctrlsService.getGridBodyCtrl().getGui()}},o.prototype.isMenuEnabled=function(e){var t=!this.filterManager.isFilterAllowed(e),o=e.getMenuTabs(a.TABS_DEFAULT);return(t&&o.includes(a.TAB_FILTER)?o.length-1:o.length)>0},i([t.Autowired("popupService")],o.prototype,"popupService",void 0),i([t.Autowired("focusService")],o.prototype,"focusService",void 0),i([t.Autowired("headerNavigationService")],o.prototype,"headerNavigationService",void 0),i([t.Autowired("ctrlsService")],o.prototype,"ctrlsService",void 0),i([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),i([t.Autowired("filterManager")],o.prototype,"filterManager",void 0),o=i([t.Bean("menuFactory")],o)}(t.BeanStub),a=function(e){function o(t,n,r){var i=e.call(this)||this;return i.tabFactories={},i.includeChecks={},i.column=t,i.initialSelection=n,i.tabFactories[o.TAB_GENERAL]=i.createMainPanel.bind(i),i.tabFactories[o.TAB_FILTER]=i.createFilterPanel.bind(i),i.tabFactories[o.TAB_COLUMNS]=i.createColumnsPanel.bind(i),i.includeChecks[o.TAB_GENERAL]=function(){return!0},i.includeChecks[o.TAB_FILTER]=function(){return i.filterManager.isFilterAllowed(t)},i.includeChecks[o.TAB_COLUMNS]=function(){return!0},i.restrictTo=r,i}return r(o,e),o.prototype.init=function(){var e=this,o=this.getTabsToCreate().map((function(t){return e.createTab(t)}));this.tabbedLayout=new t.TabbedLayout({items:o,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((function(){return e.destroyBean(e.tabbedLayout)}))},o.prototype.getTabsToCreate=function(){var e=this;return this.restrictTo?this.restrictTo:this.column.getMenuTabs(o.TABS_DEFAULT).filter((function(t){return e.isValidMenuTabItem(t)})).filter((function(t){return e.isNotSuppressed(t)})).filter((function(t){return e.isModuleLoaded(t)}))},o.prototype.isModuleLoaded=function(e){return e!==o.TAB_COLUMNS||t.ModuleRegistry.__isRegistered(t.ModuleNames.ColumnsToolPanelModule,this.context.getGridId())},o.prototype.isValidMenuTabItem=function(e){var t=!0,n=o.TABS_DEFAULT;return null!=this.restrictTo&&(t=this.restrictTo.indexOf(e)>-1,n=this.restrictTo),(t=t&&o.TABS_DEFAULT.indexOf(e)>-1)||console.warn("AG Grid: Trying to render an invalid menu item '".concat(e,"'. Check that your 'menuTabs' contains one of [").concat(n,"]")),t},o.prototype.isNotSuppressed=function(e){return this.includeChecks[e]()},o.prototype.createTab=function(e){return this.tabFactories[e]()},o.prototype.showTabBasedOnPreviousSelection=function(){this.showTab(this.initialSelection)},o.prototype.showTab=function(e){this.tabItemColumns&&e===o.TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&e===o.TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&e===o.TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()},o.prototype.onTabItemClicked=function(e){var t=null;switch(e.item){case this.tabItemColumns:t=o.TAB_COLUMNS;break;case this.tabItemFilter:t=o.TAB_FILTER;break;case this.tabItemGeneral:t=o.TAB_GENERAL}t&&this.activateTab(t)},o.prototype.activateTab=function(e){var t={type:o.EVENT_TAB_SELECTED,key:e};this.dispatchEvent(t)},o.prototype.getMenuItems=function(){var e,n=this.getDefaultMenuOptions(),r=this.gridOptionsService.getCallback("getMainMenuItems");return e=r?r({column:this.column,defaultItems:n}):n,t._.removeRepeatsFromArray(e,o.MENU_ITEM_SEPARATOR),e},o.prototype.getDefaultMenuOptions=function(){var e=[],t=!this.column.getColDef().lockPinned,n=this.columnModel.getRowGroupColumns().length,r=n>0,i=this.column.isAllowValue(),u=this.column.isAllowRowGroup(),a=this.column.isPrimary(),c=this.columnModel.isPivotMode(),l="clientSide"===this.rowModel.getType(),s=this.gridOptionsService.get("treeData"),p=a&&r&&i||!a;if(t&&e.push("pinSubMenu"),p&&e.push("valueAggSubMenu"),(t||p)&&e.push(o.MENU_ITEM_SEPARATOR),e.push("autoSizeThis"),e.push("autoSizeAll"),e.push(o.MENU_ITEM_SEPARATOR),this.column.getColDef().showRowGroup)e.push("rowUnGroup");else if(u&&this.column.isPrimary()){if(this.column.isRowGroupActive())this.columnModel.isColumnGroupingLocked(this.column)||e.push("rowUnGroup");else e.push("rowGroup")}return e.push(o.MENU_ITEM_SEPARATOR),e.push("resetColumns"),l&&(s||n>(c?1:0))&&(e.push("expandAll"),e.push("contractAll")),e},o.prototype.createMainPanel=function(){this.mainMenuList=this.createManagedBean(new t.AgMenuList);var e=this.getMenuItems(),n=this.menuItemMapper.mapWithStockItems(e,this.column);return this.mainMenuList.addMenuItems(n),this.mainMenuList.addEventListener(t.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,this.onHidePopup.bind(this)),this.tabItemGeneral={title:t._.createIconNoSpan("menu",this.gridOptionsService,this.column),titleLabel:o.TAB_GENERAL.replace("MenuTab",""),bodyPromise:t.AgPromise.resolve(this.mainMenuList.getGui()),name:o.TAB_GENERAL},this.tabItemGeneral},o.prototype.onHidePopup=function(e){var t;e&&e.event&&e.event instanceof KeyboardEvent&&(t=e.event),this.hidePopupFunc(t&&{keyboardEvent:t});var o=this.focusService.getFocusedCell(),n=this.gridOptionsService.getDocument();if(n.activeElement===n.body&&o){var r=o.rowIndex,i=o.rowPinned,u=o.column;this.focusService.setFocusedCell({rowIndex:r,column:u,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}},o.prototype.createFilterPanel=function(){var e=this.filterManager.getOrCreateFilterWrapper(this.column,"COLUMN_MENU");if(!e)throw new Error("AG Grid - Unable to instantiate filter");return this.tabItemFilter={title:t._.createIconNoSpan("filter",this.gridOptionsService,this.column),titleLabel:o.TAB_FILTER.replace("MenuTab",""),bodyPromise:null==e?void 0:e.guiPromise,afterAttachedCallback:function(t){(null==e?void 0:e.filterPromise)&&e.filterPromise.then((function(e){e&&e.afterGuiAttached&&e.afterGuiAttached(t)}))},afterDetachedCallback:function(){var t;return null===(t=null==e?void 0:e.filterPromise)||void 0===t?void 0:t.then((function(e){var t;return null===(t=null==e?void 0:e.afterGuiDetached)||void 0===t?void 0:t.call(e)}))},name:o.TAB_FILTER},this.tabItemFilter},o.prototype.createColumnsPanel=function(){var e=document.createElement("div");e.classList.add("ag-menu-column-select-wrapper");var r=this.createManagedBean(new n.PrimaryColsPanel),i=this.column.getColDef().columnsMenuParams;i||(i={});var u=i.contractColumnSelection,a=i.suppressColumnExpandAll,c=i.suppressColumnFilter,l=i.suppressColumnSelectAll,s=i.suppressSyncLayoutWithGrid,p=i.columnLayout;r.init(!1,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!u,suppressColumnExpandAll:!!a,suppressColumnFilter:!!c,suppressColumnSelectAll:!!l,suppressSyncLayoutWithGrid:!!p||!!s,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,onStateUpdated:function(){}},"columnMenu"),p&&r.setColumnLayout(p);var d=r.getGui();return d.classList.add("ag-menu-column-select"),e.appendChild(d),this.tabItemColumns={title:t._.createIconNoSpan("columns",this.gridOptionsService,this.column),titleLabel:o.TAB_COLUMNS.replace("MenuTab",""),bodyPromise:t.AgPromise.resolve(e),name:o.TAB_COLUMNS},this.tabItemColumns},o.prototype.afterGuiAttached=function(e){var t=e.container,o=e.hidePopup;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:o}),o&&(this.hidePopupFunc=o,this.addDestroyFunc(o))},o.prototype.getGui=function(){return this.tabbedLayout.getGui()},o.EVENT_TAB_SELECTED="tabSelected",o.TAB_FILTER="filterMenuTab",o.TAB_GENERAL="generalMenuTab",o.TAB_COLUMNS="columnsMenuTab",o.TABS_DEFAULT=[o.TAB_GENERAL,o.TAB_FILTER,o.TAB_COLUMNS],o.MENU_ITEM_SEPARATOR="separator",i([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),i([t.Autowired("filterManager")],o.prototype,"filterManager",void 0),i([t.Autowired("menuItemMapper")],o.prototype,"menuItemMapper",void 0),i([t.Autowired("rowModel")],o.prototype,"rowModel",void 0),i([t.Autowired("focusService")],o.prototype,"focusService",void 0),i([t.PostConstruct],o.prototype,"init",null),o}(t.BeanStub),c=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),l=function(){return(l=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},s=function(e,t,o,n){var r,i=arguments.length,u=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(u=(i<3?r(u):i>3?r(t,o,u):r(t,o))||u);return i>3&&u&&Object.defineProperty(t,o,u),u},p=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return c(o,e),o.prototype.hideActiveMenu=function(){this.destroyBean(this.activeMenu)},o.prototype.getMenuItems=function(e,o,n){var r=[];if(t._.exists(e)&&t.ModuleRegistry.__isRegistered(t.ModuleNames.ClipboardModule,this.context.getGridId())&&o&&(this.gridOptionsService.get("suppressCutToClipboard")||r.push("cut"),r.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gridOptionsService.get("enableCharts")&&t.ModuleRegistry.__isRegistered(t.ModuleNames.GridChartsModule,this.context.getGridId())&&(this.columnModel.isPivotMode()&&r.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&r.push("chartRange")),t._.exists(e)){var i=!t.ModuleRegistry.__isRegistered(t.ModuleNames.CsvExportModule,this.context.getGridId()),u=!t.ModuleRegistry.__isRegistered(t.ModuleNames.ExcelExportModule,this.context.getGridId()),a=this.gridOptionsService.get("suppressExcelExport")||u,c=this.gridOptionsService.get("suppressCsvExport")||i;!(t._.isIOSUserAgent()||a&&c)&&r.push("export")}var l=this.gridOptionsService.getCallback("getContextMenuItems");return l?l({node:e,column:o,value:n,defaultItems:r.length?r:void 0}):r},o.prototype.onContextMenu=function(e,t,o,n,r,i){if((this.gridOptionsService.get("allowContextMenuWithControlKey")||!e||!e.ctrlKey&&!e.metaKey)&&(e&&this.blockMiddleClickScrollsIfNeeded(e),!this.gridOptionsService.get("suppressContextMenu"))){var u=e||t.touches[0];if(this.showMenu(o,n,r,u,i))(e||t).preventDefault()}},o.prototype.blockMiddleClickScrollsIfNeeded=function(e){var t=this.gridOptionsService,o=e.which;t.get("suppressMiddleClickScrolls")&&2===o&&e.preventDefault()},o.prototype.showMenu=function(e,o,n,r,i){var u=this,a=this.getMenuItems(e,o,n),c=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===a||t._.missingOrEmpty(a))return!1;var s=new d(a);this.createBean(s);var p=s.getGui(),m={column:o,rowNode:e,type:"contextMenu",mouseEvent:r,ePopup:p,nudgeY:1},h=this.localeService.getLocaleTextFunc(),v=this.popupService.addPopup({modal:!0,eChild:p,closeOnEsc:!0,closedCallback:function(){c.classList.remove("ag-context-menu-open"),u.destroyBean(s)},click:r,positionCallback:function(){var e=u.gridOptionsService.get("enableRtl");u.popupService.positionPopupUnderMouseEvent(l(l({},m),{nudgeX:e?-1*(p.offsetWidth+1):1}))},anchorToElement:i,ariaLabel:h("ariaLabelContextMenu","Context Menu")});return v&&(c.classList.add("ag-context-menu-open"),s.afterGuiAttached({container:"contextMenu",hidePopup:v.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=s,s.addEventListener(t.BeanStub.EVENT_DESTROYED,(function(){u.activeMenu===s&&(u.activeMenu=null)})),v&&s.addEventListener(t.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,v.hideFunc),!0},s([t.Autowired("popupService")],o.prototype,"popupService",void 0),s([t.Optional("rangeService")],o.prototype,"rangeService",void 0),s([t.Autowired("ctrlsService")],o.prototype,"ctrlsService",void 0),s([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),o=s([t.Bean("contextMenuFactory")],o)}(t.BeanStub),d=function(e){function o(t){var o=e.call(this,'<div class="'.concat("ag-menu",'" role="presentation"></div>'))||this;return o.menuList=null,o.focusedCell=null,o.menuItems=t,o}return c(o,e),o.prototype.addMenuItems=function(){var e=this,o=this.createManagedBean(new t.AgMenuList),n=this.menuItemMapper.mapWithStockItems(this.menuItems,null);o.addMenuItems(n),this.appendChild(o),this.menuList=o,o.addEventListener(t.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,(function(t){return e.dispatchEvent(t)}))},o.prototype.afterGuiAttached=function(e){e.hidePopup&&this.addDestroyFunc(e.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())},o.prototype.restoreFocusedCell=function(){var e=this.focusService.getFocusedCell();if(e&&this.focusedCell&&this.cellPositionUtils.equals(e,this.focusedCell)){var t=this.focusedCell,o=t.rowIndex,n=t.rowPinned,r=t.column,i=this.gridOptionsService.getDocument();i.activeElement===i.body&&this.focusService.setFocusedCell({rowIndex:o,column:r,rowPinned:n,forceBrowserFocus:!0})}},o.prototype.destroy=function(){this.restoreFocusedCell(),e.prototype.destroy.call(this)},s([t.Autowired("menuItemMapper")],o.prototype,"menuItemMapper",void 0),s([t.Autowired("focusService")],o.prototype,"focusService",void 0),s([t.Autowired("cellPositionUtils")],o.prototype,"cellPositionUtils",void 0),s([t.PostConstruct],o.prototype,"addMenuItems",null),o}(t.Component),m=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),h=function(){return(h=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},v=function(e,t,o,n){var r,i=arguments.length,u=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(u=(i<3?r(u):i>3?r(t,o,u):r(t,o))||u);return i>3&&u&&Object.defineProperty(t,o,u),u},g=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return m(o,e),o.prototype.mapWithStockItems=function(e,t){var o=this;if(!e)return[];var n=[];return e.forEach((function(e){var r;if(r="string"==typeof e?o.getStockMenuItem(e,t):h({},e)){var i=r,u=i.subMenu;u&&u instanceof Array&&(i.subMenu=o.mapWithStockItems(u,t)),null!=r&&n.push(r)}})),n},o.prototype.getStockMenuItem=function(e,o){var n,r=this,i=this.localeService.getLocaleTextFunc(),u=this.gridOptionsService.get("skipHeaderOnAutoSize");switch(e){case"pinSubMenu":return{name:i("pinColumn","Pin Column"),icon:t._.createIconNoSpan("menuPin",this.gridOptionsService,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:i("pinLeft","Pin Left"),action:function(){return r.columnModel.setColumnPinned(o,"left","contextMenu")},checked:!!o&&o.isPinnedLeft()};case"pinRight":return{name:i("pinRight","Pin Right"),action:function(){return r.columnModel.setColumnPinned(o,"right","contextMenu")},checked:!!o&&o.isPinnedRight()};case"clearPinned":return{name:i("noPin","No Pin"),action:function(){return r.columnModel.setColumnPinned(o,null,"contextMenu")},checked:!!o&&!o.isPinned()};case"valueAggSubMenu":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.RowGroupingModule,"Aggregation from Menu",this.context.getGridId())&&((null==o?void 0:o.isPrimary())||(null==o?void 0:o.getColDef().pivotValueColumn))?{name:i("valueAggregation","Value Aggregation"),icon:t._.createIconNoSpan("menuValue",this.gridOptionsService,null),subMenu:this.createAggregationSubMenu(o)}:null;case"autoSizeThis":return{name:i("autosizeThiscolumn","Autosize This Column"),action:function(){return r.columnModel.autoSizeColumn(o,u,"contextMenu")}};case"autoSizeAll":return{name:i("autosizeAllColumns","Autosize All Columns"),action:function(){return r.columnModel.autoSizeAllColumns(u,"contextMenu")}};case"rowGroup":return{name:i("groupBy","Group by")+" "+t._.escapeString(this.columnModel.getDisplayNameForColumn(o,"header")),disabled:(null==o?void 0:o.isRowGroupActive())||!(null==o?void 0:o.getColDef().enableRowGroup),action:function(){return r.columnModel.addRowGroupColumn(o,"contextMenu")},icon:t._.createIconNoSpan("menuAddRowGroup",this.gridOptionsService,null)};case"rowUnGroup":var a=t._.createIconNoSpan("menuRemoveRowGroup",this.gridOptionsService,null),c=null==o?void 0:o.getColDef().showRowGroup,l=this.gridOptionsService.get("groupLockGroupColumns");if(!0===c)return{name:i("ungroupAll","Un-Group All"),disabled:-1===l||l>=this.columnModel.getRowGroupColumns().length,action:function(){return r.columnModel.setRowGroupColumns(r.columnModel.getRowGroupColumns().slice(0,l),"contextMenu")},icon:a};if("string"==typeof c){var s=this.columnModel.getPrimaryColumn(c),p=null!=s?t._.escapeString(this.columnModel.getDisplayNameForColumn(s,"header")):c;return{name:i("ungroupBy","Un-Group by")+" "+p,disabled:null!=s&&this.columnModel.isColumnGroupingLocked(s),action:function(){return r.columnModel.removeRowGroupColumn(c,"contextMenu")},icon:a}}return{name:i("ungroupBy","Un-Group by")+" "+t._.escapeString(this.columnModel.getDisplayNameForColumn(o,"header")),disabled:!(null==o?void 0:o.isRowGroupActive())||!(null==o?void 0:o.getColDef().enableRowGroup)||this.columnModel.isColumnGroupingLocked(o),action:function(){return r.columnModel.removeRowGroupColumn(o,"contextMenu")},icon:a};case"resetColumns":return{name:i("resetColumns","Reset Columns"),action:function(){return r.columnModel.resetColumnState("contextMenu")}};case"expandAll":return{name:i("expandAll","Expand All Row Groups"),action:function(){return r.gridApi.expandAll()}};case"contractAll":return{name:i("collapseAll","Collapse All Row Groups"),action:function(){return r.gridApi.collapseAll()}};case"copy":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy from Menu",this.context.getGridId())?{name:i("copy","Copy"),shortcut:i("ctrlC","Ctrl+C"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return r.clipboardService.copyToClipboard()}}:null;case"copyWithHeaders":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy with Headers from Menu",this.context.getGridId())?{name:i("copyWithHeaders","Copy with Headers"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return r.clipboardService.copyToClipboard({includeHeaders:!0})}}:null;case"copyWithGroupHeaders":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy with Group Headers from Menu",this.context.getGridId())?{name:i("copyWithGroupHeaders","Copy with Group Headers"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return r.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}}:null;case"cut":if(t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Cut from Menu",this.context.getGridId())){var d=this.focusService.getFocusedCell(),m=d?this.rowPositionUtils.getRowNode(d):null,h=!!m&&(null==d?void 0:d.column.isCellEditable(m));return{name:i("cut","Cut"),shortcut:i("ctrlX","Ctrl+X"),icon:t._.createIconNoSpan("clipboardCut",this.gridOptionsService,null),disabled:!h||this.gridOptionsService.get("suppressCutToClipboard"),action:function(){return r.clipboardService.cutToClipboard(void 0,"contextMenu")}}}return null;case"paste":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Paste from Clipboard",this.context.getGridId())?{name:i("paste","Paste"),shortcut:i("ctrlV","Ctrl+V"),disabled:!0,icon:t._.createIconNoSpan("clipboardPaste",this.gridOptionsService,null),action:function(){return r.clipboardService.pasteFromClipboard()}}:null;case"export":var v=[],g=t.ModuleRegistry.__isRegistered(t.ModuleNames.CsvExportModule,this.context.getGridId()),f=t.ModuleRegistry.__isRegistered(t.ModuleNames.ExcelExportModule,this.context.getGridId());return!this.gridOptionsService.get("suppressCsvExport")&&g&&v.push("csvExport"),!this.gridOptionsService.get("suppressExcelExport")&&f&&v.push("excelExport"),{name:i("export","Export"),subMenu:v,icon:t._.createIconNoSpan("save",this.gridOptionsService,null)};case"csvExport":return{name:i("csvExport","CSV Export"),icon:t._.createIconNoSpan("csvExport",this.gridOptionsService,null),action:function(){return r.gridApi.exportDataAsCsv({})}};case"excelExport":return{name:i("excelExport","Excel Export"),icon:t._.createIconNoSpan("excelExport",this.gridOptionsService,null),action:function(){return r.gridApi.exportDataAsExcel()}};case"separator":return"separator";case"pivotChart":case"chartRange":return null!==(n=this.chartMenuItemMapper.getChartItems(e))&&void 0!==n?n:null;default:return console.warn("AG Grid: unknown menu item type ".concat(e)),null}},o.prototype.createAggregationSubMenu=function(e){var o,n=this,r=this.localeService.getLocaleTextFunc();if(e.isPrimary())o=e;else{var i=e.getColDef().pivotValueColumn;o=t._.exists(i)?i:void 0}var u=[];if(o){var a=o.isValueActive(),c=this.aggFuncService.getFuncNames(o);u.push({name:r("noAggregation","None"),action:function(){n.columnModel.removeValueColumn(o,"contextMenu"),n.columnModel.setColumnAggFunc(o,void 0,"contextMenu")},checked:!a}),c.forEach((function(e){u.push({name:r(e,n.aggFuncService.getDefaultFuncLabel(e)),action:function(){n.columnModel.setColumnAggFunc(o,e,"contextMenu"),n.columnModel.addValueColumn(o,"contextMenu")},checked:a&&o.getAggFunc()===e})}))}return u},v([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),v([t.Autowired("gridApi")],o.prototype,"gridApi",void 0),v([t.Optional("clipboardService")],o.prototype,"clipboardService",void 0),v([t.Optional("aggFuncService")],o.prototype,"aggFuncService",void 0),v([t.Autowired("focusService")],o.prototype,"focusService",void 0),v([t.Autowired("rowPositionUtils")],o.prototype,"rowPositionUtils",void 0),v([t.Autowired("chartMenuItemMapper")],o.prototype,"chartMenuItemMapper",void 0),o=v([t.Bean("menuItemMapper")],o)}(t.BeanStub),f=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),C=function(){return(C=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},b=function(e,t,o,n){var r,i=arguments.length,u=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(u=(i<3?r(u):i>3?r(t,o,u):r(t,o))||u);return i>3&&u&&Object.defineProperty(t,o,u),u},y=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var n,r,i=o.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)u.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return u},M=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}var n;return f(o,e),n=o,o.prototype.getChartItems=function(e){var o,r;if(this.chartService){var i="pivotChart"===e?new S(this.gridOptionsService,this.chartService,this.localeService):new A(this.gridOptionsService,this.chartService,this.localeService),u=i.getMenuItem(),a=null===(r=null===(o=this.gridOptionsService.get("chartToolPanelsDef"))||void 0===o?void 0:o.settingsPanel)||void 0===r?void 0:r.chartGroupsDef;return a&&(u=n.filterAndOrderChartMenu(u,a,i.getConfigLookup())),this.cleanInternals(u)}t.ModuleRegistry.__assertRegistered(t.ModuleNames.GridChartsModule,'the Context Menu key "'.concat(e,'"'),this.context.getGridId())},o.prototype.cleanInternals=function(e){if(!e)return e;var t=function(e){var o;return null==e||delete e._key,null===(o=null==e?void 0:e.subMenu)||void 0===o||o.forEach((function(e){return t(e)})),e};return t(e)},o.buildLookup=function(e){var t={},o=function(e){t[e._key]=e,e.subMenu&&e.subMenu.forEach((function(e){return o(e)}))};return o(e),t},o.filterAndOrderChartMenu=function(e,o,n){var r,i=this.buildLookup(e),u=C(C({},e),{subMenu:[]});if(Object.entries(o).forEach((function(e){var o,r,a=y(e,2),c=a[0],l=a[1],s=n[c];if(null!=s){var p=i[s._key];if(p)if(p.subMenu){var d=l.map((function(e){var o=s[e];if(null!=o)return i[o];t._.warnOnce("invalid chartGroupsDef config '".concat(c,".").concat(e,"'"))})).filter((function(e){return void 0!==e}));d.length>0&&(p.subMenu=d,null===(o=u.subMenu)||void 0===o||o.push(p))}else null===(r=u.subMenu)||void 0===r||r.push(p)}else t._.warnOnce("invalid chartGroupsDef config '".concat(c,"'"))})),0!=(null===(r=u.subMenu)||void 0===r?void 0:r.length))return u},b([t.Optional("chartService")],o.prototype,"chartService",void 0),o=n=b([t.Bean("chartMenuItemMapper")],o)}(t.BeanStub),S=function(){function e(e,t,o){this.gridOptionsService=e,this.chartService=t,this.localeService=o}return e.prototype.getMenuItem=function(){var e=this,o=this.localeService.getLocaleTextFunc(),n=function(t,n,r,i){return{name:o(t,n),action:function(){return e.chartService.createPivotChart({chartType:r})},_key:i}};return{name:o("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:o("columnChart","Column"),subMenu:[n("groupedColumn","Grouped&lrm;","groupedColumn","pivotGroupedColumn"),n("stackedColumn","Stacked&lrm;","stackedColumn","pivotStackedColumn"),n("normalizedColumn","100% Stacked&lrm;","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:o("barChart","Bar"),subMenu:[n("groupedBar","Grouped&lrm;","groupedBar","pivotGroupedBar"),n("stackedBar","Stacked&lrm;","stackedBar","pivotStackedBar"),n("normalizedBar","100% Stacked&lrm;","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:o("pieChart","Pie"),subMenu:[n("pie","Pie&lrm;","pie","pivotPie"),n("doughnut","Doughnut&lrm;","doughnut","pivotDoughnut")]},n("line","Line&lrm;","line","pivotLineChart"),{_key:"pivotXYChart",name:o("xyChart","X Y (Scatter)"),subMenu:[n("scatter","Scatter&lrm;","scatter","pivotScatter"),n("bubble","Bubble&lrm;","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:o("areaChart","Area"),subMenu:[n("area","Area&lrm;","area","pivotArea"),n("stackedArea","Stacked&lrm;","stackedArea","pivotStackedArea"),n("normalizedArea","100% Stacked&lrm;","normalizedArea","pivotNormalizedArea")]},n("histogramChart","Histogram&lrm;","histogram","pivotHistogramChart"),{_key:"pivotCombinationChart",name:o("combinationChart","Combination"),subMenu:[n("columnLineCombo","Column & Line&lrm;","columnLineCombo","pivotColumnLineCombo"),n("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","pivotAreaColumnCombo")]}],icon:t._.createIconNoSpan("chart",this.gridOptionsService,void 0)}},e.prototype.getConfigLookup=function(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",doughnut:"pivotDoughnut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},histogramGroup:{_key:"pivotHistogramChart",histogram:"pivotHistogramChart"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:""}}},e}(),A=function(){function e(e,t,o){this.gridOptionsService=e,this.chartService=t,this.localeService=o}return e.prototype.getMenuItem=function(){var e=this,o=this.localeService.getLocaleTextFunc(),n=function(t,n,r,i){return{name:o(t,n),action:function(){return e.chartService.createChartFromCurrentRange(r)},_key:i}};return{name:o("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:o("columnChart","Column"),subMenu:[n("groupedColumn","Grouped&lrm;","groupedColumn","rangeGroupedColumn"),n("stackedColumn","Stacked&lrm;","stackedColumn","rangeStackedColumn"),n("normalizedColumn","100% Stacked&lrm;","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:o("barChart","Bar"),subMenu:[n("groupedBar","Grouped&lrm;","groupedBar","rangeGroupedBar"),n("stackedBar","Stacked&lrm;","stackedBar","rangeStackedBar"),n("normalizedBar","100% Stacked&lrm;","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:o("pieChart","Pie"),subMenu:[n("pie","Pie&lrm;","pie","rangePie"),n("doughnut","Doughnut&lrm;","doughnut","rangeDoughnut")],_key:"rangePieChart"},n("line","Line&lrm;","line","rangeLineChart"),{name:o("xyChart","X Y (Scatter)"),subMenu:[n("scatter","Scatter&lrm;","scatter","rangeScatter"),n("bubble","Bubble&lrm;","bubble","rangeBubble")],_key:"rangeXYChart"},{name:o("areaChart","Area"),subMenu:[n("area","Area&lrm;","area","rangeArea"),n("stackedArea","Stacked&lrm;","stackedArea","rangeStackedArea"),n("normalizedArea","100% Stacked&lrm;","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},n("histogramChart","Histogram&lrm;","histogram","rangeHistogramChart"),{name:o("combinationChart","Combination"),subMenu:[n("columnLineCombo","Column & Line&lrm;","columnLineCombo","rangeColumnLineCombo"),n("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:t._.createIconNoSpan("chart",this.gridOptionsService,void 0)}},e.prototype.getConfigLookup=function(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",doughnut:"rangeDoughnut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},histogramGroup:{_key:"rangeHistogramChart",histogram:"rangeHistogramChart"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:""}}},e}(),_={version:"31.0.0",moduleName:t.ModuleNames.MenuModule,beans:[u,p,g,M],dependantModules:[o.EnterpriseCoreModule]};exports.MenuModule=_;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),n=require("@ag-grid-enterprise/column-tool-panel"),r=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),i=function(e,t,o,n){var r,i=arguments.length,u=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(u=(i<3?r(u):i>3?r(t,o,u):r(t,o))||u);return i>3&&u&&Object.defineProperty(t,o,u),u},u=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return r(o,e),o.prototype.hideActiveMenu=function(){this.destroyBean(this.activeMenu)},o.prototype.showMenuAfterMouseEvent=function(e,t,o){var n=this;this.showMenu(e,(function(r){var i=r.getGui();n.popupService.positionPopupUnderMouseEvent({type:"columnMenu",column:e,mouseEvent:t,ePopup:i}),o&&r.showTab(o)}),"columnMenu",o,void 0,t.target)},o.prototype.showMenuAfterButtonClick=function(e,t,o,n,r){var i=this,u=-1,a="left";this.gridOptionsService.get("enableRtl")&&(u=1,a="right"),this.showMenu(e,(function(r){var c=r.getGui();i.popupService.positionPopupByComponent({type:o,column:e,eventSource:t,ePopup:c,alignSide:a,nudgeX:9*u,nudgeY:-23,position:"under",keepWithinBounds:!0}),n&&r.showTab(n)}),o,n,r,t)},o.prototype.showMenu=function(e,o,n,r,i,u){var c=this,l=this.getMenuParams(e,i,u),s=l.menu,p=l.eMenuGui,d=l.currentHeaderPosition,m=l.currentColumnIndex,h=l.anchorToElement,v=[];v.push(this.getClosedCallback(e,s,d,m,u));var g=this.localeService.getLocaleTextFunc();this.popupService.addPopup({modal:!0,eChild:p,closeOnEsc:!0,closedCallback:function(e){v.forEach((function(t){return t(e)}))},afterGuiAttached:function(e){return s.afterGuiAttached(Object.assign({},{container:n},e))},positionCallback:r?function(){return o(s)}:void 0,ariaLabel:g("ariaLabelColumnMenu","Column Menu")}),r||(s.showTabBasedOnPreviousSelection(),o(s));var f=this.popupService.setPopupPositionRelatedToElement(p,h);f&&this.addStopAnchoring(f,e,v),s.addEventListener(a.EVENT_TAB_SELECTED,(function(e){c.lastSelectedTab=e.key})),e.setMenuVisible(!0,"contextMenu"),this.activeMenu=s,s.addEventListener(t.BeanStub.EVENT_DESTROYED,(function(){c.activeMenu===s&&(c.activeMenu=null)}))},o.prototype.addStopAnchoring=function(e,t,o){e.then((function(e){t.addEventListener("leftChanged",e),t.addEventListener("visibleChanged",e),o.push((function(){t.removeEventListener("leftChanged",e),t.removeEventListener("visibleChanged",e)}))}))},o.prototype.getClosedCallback=function(e,o,n,r,i){var u=this;return function(a){if(u.destroyBean(o),e.setMenuVisible(!1,"contextMenu"),a instanceof KeyboardEvent&&i)if(u.columnModel.getAllDisplayedColumns().some((function(t){return t===e}))&&t._.isVisible(i)){var c=u.focusService.findTabbableParent(i);c&&(e&&u.headerNavigationService.scrollToColumn(e),c.focus())}else if(n&&-1!==r){var l=u.columnModel.getAllDisplayedColumns(),s=l[r]||t._.last(l);s&&u.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:n.headerRowIndex,column:s}})}}},o.prototype.getMenuParams=function(e,t,o){var n=this.createBean(new a(e,this.lastSelectedTab,t));return{menu:n,eMenuGui:n.getGui(),currentHeaderPosition:this.focusService.getFocusedHeader(),currentColumnIndex:this.columnModel.getAllDisplayedColumns().indexOf(e),anchorToElement:o||this.ctrlsService.getGridBodyCtrl().getGui()}},o.prototype.isMenuEnabled=function(e){var t=!this.filterManager.isFilterAllowed(e),o=e.getMenuTabs(a.TABS_DEFAULT);return(t&&o.includes(a.TAB_FILTER)?o.length-1:o.length)>0},i([t.Autowired("popupService")],o.prototype,"popupService",void 0),i([t.Autowired("focusService")],o.prototype,"focusService",void 0),i([t.Autowired("headerNavigationService")],o.prototype,"headerNavigationService",void 0),i([t.Autowired("ctrlsService")],o.prototype,"ctrlsService",void 0),i([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),i([t.Autowired("filterManager")],o.prototype,"filterManager",void 0),o=i([t.Bean("menuFactory")],o)}(t.BeanStub),a=function(e){function o(t,n,r){var i=e.call(this)||this;return i.tabFactories={},i.includeChecks={},i.column=t,i.initialSelection=n,i.tabFactories[o.TAB_GENERAL]=i.createMainPanel.bind(i),i.tabFactories[o.TAB_FILTER]=i.createFilterPanel.bind(i),i.tabFactories[o.TAB_COLUMNS]=i.createColumnsPanel.bind(i),i.includeChecks[o.TAB_GENERAL]=function(){return!0},i.includeChecks[o.TAB_FILTER]=function(){return i.filterManager.isFilterAllowed(t)},i.includeChecks[o.TAB_COLUMNS]=function(){return!0},i.restrictTo=r,i}return r(o,e),o.prototype.init=function(){var e=this,o=this.getTabsToCreate().map((function(t){return e.createTab(t)}));this.tabbedLayout=new t.TabbedLayout({items:o,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((function(){return e.destroyBean(e.tabbedLayout)}))},o.prototype.getTabsToCreate=function(){var e=this;return this.restrictTo?this.restrictTo:this.column.getMenuTabs(o.TABS_DEFAULT).filter((function(t){return e.isValidMenuTabItem(t)})).filter((function(t){return e.isNotSuppressed(t)})).filter((function(t){return e.isModuleLoaded(t)}))},o.prototype.isModuleLoaded=function(e){return e!==o.TAB_COLUMNS||t.ModuleRegistry.__isRegistered(t.ModuleNames.ColumnsToolPanelModule,this.context.getGridId())},o.prototype.isValidMenuTabItem=function(e){var t=!0,n=o.TABS_DEFAULT;return null!=this.restrictTo&&(t=this.restrictTo.indexOf(e)>-1,n=this.restrictTo),(t=t&&o.TABS_DEFAULT.indexOf(e)>-1)||console.warn("AG Grid: Trying to render an invalid menu item '".concat(e,"'. Check that your 'menuTabs' contains one of [").concat(n,"]")),t},o.prototype.isNotSuppressed=function(e){return this.includeChecks[e]()},o.prototype.createTab=function(e){return this.tabFactories[e]()},o.prototype.showTabBasedOnPreviousSelection=function(){this.showTab(this.initialSelection)},o.prototype.showTab=function(e){this.tabItemColumns&&e===o.TAB_COLUMNS?this.tabbedLayout.showItem(this.tabItemColumns):this.tabItemFilter&&e===o.TAB_FILTER?this.tabbedLayout.showItem(this.tabItemFilter):this.tabItemGeneral&&e===o.TAB_GENERAL?this.tabbedLayout.showItem(this.tabItemGeneral):this.tabbedLayout.showFirstItem()},o.prototype.onTabItemClicked=function(e){var t=null;switch(e.item){case this.tabItemColumns:t=o.TAB_COLUMNS;break;case this.tabItemFilter:t=o.TAB_FILTER;break;case this.tabItemGeneral:t=o.TAB_GENERAL}t&&this.activateTab(t)},o.prototype.activateTab=function(e){var t={type:o.EVENT_TAB_SELECTED,key:e};this.dispatchEvent(t)},o.prototype.getMenuItems=function(){var e,n=this.getDefaultMenuOptions(),r=this.gridOptionsService.getCallback("getMainMenuItems");return e=r?r({column:this.column,defaultItems:n}):n,t._.removeRepeatsFromArray(e,o.MENU_ITEM_SEPARATOR),e},o.prototype.getDefaultMenuOptions=function(){var e=[],t=!this.column.getColDef().lockPinned,n=this.columnModel.getRowGroupColumns().length,r=n>0,i=this.column.isAllowValue(),u=this.column.isAllowRowGroup(),a=this.column.isPrimary(),c=this.columnModel.isPivotMode(),l="clientSide"===this.rowModel.getType(),s=this.gridOptionsService.get("treeData"),p=a&&r&&i||!a;if(t&&e.push("pinSubMenu"),p&&e.push("valueAggSubMenu"),(t||p)&&e.push(o.MENU_ITEM_SEPARATOR),e.push("autoSizeThis"),e.push("autoSizeAll"),e.push(o.MENU_ITEM_SEPARATOR),this.column.getColDef().showRowGroup)e.push("rowUnGroup");else if(u&&this.column.isPrimary()){if(this.column.isRowGroupActive())this.columnModel.isColumnGroupingLocked(this.column)||e.push("rowUnGroup");else e.push("rowGroup")}return e.push(o.MENU_ITEM_SEPARATOR),e.push("resetColumns"),l&&(s||n>(c?1:0))&&(e.push("expandAll"),e.push("contractAll")),e},o.prototype.createMainPanel=function(){this.mainMenuList=this.createManagedBean(new t.AgMenuList);var e=this.getMenuItems(),n=this.menuItemMapper.mapWithStockItems(e,this.column);return this.mainMenuList.addMenuItems(n),this.mainMenuList.addEventListener(t.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,this.onHidePopup.bind(this)),this.tabItemGeneral={title:t._.createIconNoSpan("menu",this.gridOptionsService,this.column),titleLabel:o.TAB_GENERAL.replace("MenuTab",""),bodyPromise:t.AgPromise.resolve(this.mainMenuList.getGui()),name:o.TAB_GENERAL},this.tabItemGeneral},o.prototype.onHidePopup=function(e){var t;e&&e.event&&e.event instanceof KeyboardEvent&&(t=e.event),this.hidePopupFunc(t&&{keyboardEvent:t});var o=this.focusService.getFocusedCell(),n=this.gridOptionsService.getDocument();if(n.activeElement===n.body&&o){var r=o.rowIndex,i=o.rowPinned,u=o.column;this.focusService.setFocusedCell({rowIndex:r,column:u,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}},o.prototype.createFilterPanel=function(){var e=this.filterManager.getOrCreateFilterWrapper(this.column,"COLUMN_MENU");if(!e)throw new Error("AG Grid - Unable to instantiate filter");return this.tabItemFilter={title:t._.createIconNoSpan("filter",this.gridOptionsService,this.column),titleLabel:o.TAB_FILTER.replace("MenuTab",""),bodyPromise:null==e?void 0:e.guiPromise,afterAttachedCallback:function(t){(null==e?void 0:e.filterPromise)&&e.filterPromise.then((function(e){e&&e.afterGuiAttached&&e.afterGuiAttached(t)}))},afterDetachedCallback:function(){var t;return null===(t=null==e?void 0:e.filterPromise)||void 0===t?void 0:t.then((function(e){var t;return null===(t=null==e?void 0:e.afterGuiDetached)||void 0===t?void 0:t.call(e)}))},name:o.TAB_FILTER},this.tabItemFilter},o.prototype.createColumnsPanel=function(){var e=document.createElement("div");e.classList.add("ag-menu-column-select-wrapper");var r=this.createManagedBean(new n.PrimaryColsPanel),i=this.column.getColDef().columnsMenuParams;i||(i={});var u=i.contractColumnSelection,a=i.suppressColumnExpandAll,c=i.suppressColumnFilter,l=i.suppressColumnSelectAll,s=i.suppressSyncLayoutWithGrid,p=i.columnLayout;r.init(!1,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!u,suppressColumnExpandAll:!!a,suppressColumnFilter:!!c,suppressColumnSelectAll:!!l,suppressSyncLayoutWithGrid:!!p||!!s,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,onStateUpdated:function(){}},"columnMenu"),p&&r.setColumnLayout(p);var d=r.getGui();return d.classList.add("ag-menu-column-select"),e.appendChild(d),this.tabItemColumns={title:t._.createIconNoSpan("columns",this.gridOptionsService,this.column),titleLabel:o.TAB_COLUMNS.replace("MenuTab",""),bodyPromise:t.AgPromise.resolve(e),name:o.TAB_COLUMNS},this.tabItemColumns},o.prototype.afterGuiAttached=function(e){var t=e.container,o=e.hidePopup;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:o}),o&&(this.hidePopupFunc=o,this.addDestroyFunc(o))},o.prototype.getGui=function(){return this.tabbedLayout.getGui()},o.EVENT_TAB_SELECTED="tabSelected",o.TAB_FILTER="filterMenuTab",o.TAB_GENERAL="generalMenuTab",o.TAB_COLUMNS="columnsMenuTab",o.TABS_DEFAULT=[o.TAB_GENERAL,o.TAB_FILTER,o.TAB_COLUMNS],o.MENU_ITEM_SEPARATOR="separator",i([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),i([t.Autowired("filterManager")],o.prototype,"filterManager",void 0),i([t.Autowired("menuItemMapper")],o.prototype,"menuItemMapper",void 0),i([t.Autowired("rowModel")],o.prototype,"rowModel",void 0),i([t.Autowired("focusService")],o.prototype,"focusService",void 0),i([t.PostConstruct],o.prototype,"init",null),o}(t.BeanStub),c=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),l=function(){return(l=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},s=function(e,t,o,n){var r,i=arguments.length,u=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(u=(i<3?r(u):i>3?r(t,o,u):r(t,o))||u);return i>3&&u&&Object.defineProperty(t,o,u),u},p=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return c(o,e),o.prototype.hideActiveMenu=function(){this.destroyBean(this.activeMenu)},o.prototype.getMenuItems=function(e,o,n){var r=[];if(t._.exists(e)&&t.ModuleRegistry.__isRegistered(t.ModuleNames.ClipboardModule,this.context.getGridId())&&o&&(this.gridOptionsService.get("suppressCutToClipboard")||r.push("cut"),r.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gridOptionsService.get("enableCharts")&&t.ModuleRegistry.__isRegistered(t.ModuleNames.GridChartsModule,this.context.getGridId())&&(this.columnModel.isPivotMode()&&r.push("pivotChart"),this.rangeService&&!this.rangeService.isEmpty()&&r.push("chartRange")),t._.exists(e)){var i=!t.ModuleRegistry.__isRegistered(t.ModuleNames.CsvExportModule,this.context.getGridId()),u=!t.ModuleRegistry.__isRegistered(t.ModuleNames.ExcelExportModule,this.context.getGridId()),a=this.gridOptionsService.get("suppressExcelExport")||u,c=this.gridOptionsService.get("suppressCsvExport")||i;!(t._.isIOSUserAgent()||a&&c)&&r.push("export")}var l=this.gridOptionsService.getCallback("getContextMenuItems");return l?l({node:e,column:o,value:n,defaultItems:r.length?r:void 0}):r},o.prototype.onContextMenu=function(e,t,o,n,r,i){if((this.gridOptionsService.get("allowContextMenuWithControlKey")||!e||!e.ctrlKey&&!e.metaKey)&&(e&&this.blockMiddleClickScrollsIfNeeded(e),!this.gridOptionsService.get("suppressContextMenu"))){var u=e||t.touches[0];if(this.showMenu(o,n,r,u,i))(e||t).preventDefault()}},o.prototype.blockMiddleClickScrollsIfNeeded=function(e){var t=this.gridOptionsService,o=e.which;t.get("suppressMiddleClickScrolls")&&2===o&&e.preventDefault()},o.prototype.showMenu=function(e,o,n,r,i){var u=this,a=this.getMenuItems(e,o,n),c=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===a||t._.missingOrEmpty(a))return!1;var s=new d(a);this.createBean(s);var p=s.getGui(),m={column:o,rowNode:e,type:"contextMenu",mouseEvent:r,ePopup:p,nudgeY:1},h=this.localeService.getLocaleTextFunc(),v=this.popupService.addPopup({modal:!0,eChild:p,closeOnEsc:!0,closedCallback:function(){c.classList.remove("ag-context-menu-open"),u.destroyBean(s)},click:r,positionCallback:function(){var e=u.gridOptionsService.get("enableRtl");u.popupService.positionPopupUnderMouseEvent(l(l({},m),{nudgeX:e?-1*(p.offsetWidth+1):1}))},anchorToElement:i,ariaLabel:h("ariaLabelContextMenu","Context Menu")});return v&&(c.classList.add("ag-context-menu-open"),s.afterGuiAttached({container:"contextMenu",hidePopup:v.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=s,s.addEventListener(t.BeanStub.EVENT_DESTROYED,(function(){u.activeMenu===s&&(u.activeMenu=null)})),v&&s.addEventListener(t.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,v.hideFunc),!0},s([t.Autowired("popupService")],o.prototype,"popupService",void 0),s([t.Optional("rangeService")],o.prototype,"rangeService",void 0),s([t.Autowired("ctrlsService")],o.prototype,"ctrlsService",void 0),s([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),o=s([t.Bean("contextMenuFactory")],o)}(t.BeanStub),d=function(e){function o(t){var o=e.call(this,'<div class="'.concat("ag-menu",'" role="presentation"></div>'))||this;return o.menuList=null,o.focusedCell=null,o.menuItems=t,o}return c(o,e),o.prototype.addMenuItems=function(){var e=this,o=this.createManagedBean(new t.AgMenuList),n=this.menuItemMapper.mapWithStockItems(this.menuItems,null);o.addMenuItems(n),this.appendChild(o),this.menuList=o,o.addEventListener(t.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,(function(t){return e.dispatchEvent(t)}))},o.prototype.afterGuiAttached=function(e){e.hidePopup&&this.addDestroyFunc(e.hidePopup),this.focusedCell=this.focusService.getFocusedCell(),this.menuList&&this.focusService.focusInto(this.menuList.getGui())},o.prototype.restoreFocusedCell=function(){var e=this.focusService.getFocusedCell();if(e&&this.focusedCell&&this.cellPositionUtils.equals(e,this.focusedCell)){var t=this.focusedCell,o=t.rowIndex,n=t.rowPinned,r=t.column,i=this.gridOptionsService.getDocument();i.activeElement===i.body&&this.focusService.setFocusedCell({rowIndex:o,column:r,rowPinned:n,forceBrowserFocus:!0})}},o.prototype.destroy=function(){this.restoreFocusedCell(),e.prototype.destroy.call(this)},s([t.Autowired("menuItemMapper")],o.prototype,"menuItemMapper",void 0),s([t.Autowired("focusService")],o.prototype,"focusService",void 0),s([t.Autowired("cellPositionUtils")],o.prototype,"cellPositionUtils",void 0),s([t.PostConstruct],o.prototype,"addMenuItems",null),o}(t.Component),m=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),h=function(){return(h=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},v=function(e,t,o,n){var r,i=arguments.length,u=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(u=(i<3?r(u):i>3?r(t,o,u):r(t,o))||u);return i>3&&u&&Object.defineProperty(t,o,u),u},g=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return m(o,e),o.prototype.mapWithStockItems=function(e,t){var o=this;if(!e)return[];var n=[];return e.forEach((function(e){var r;if(r="string"==typeof e?o.getStockMenuItem(e,t):h({},e)){var i=r,u=i.subMenu;u&&u instanceof Array&&(i.subMenu=o.mapWithStockItems(u,t)),null!=r&&n.push(r)}})),n},o.prototype.getStockMenuItem=function(e,o){var n,r=this,i=this.localeService.getLocaleTextFunc(),u=this.gridOptionsService.get("skipHeaderOnAutoSize");switch(e){case"pinSubMenu":return{name:i("pinColumn","Pin Column"),icon:t._.createIconNoSpan("menuPin",this.gridOptionsService,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:i("pinLeft","Pin Left"),action:function(){return r.columnModel.setColumnPinned(o,"left","contextMenu")},checked:!!o&&o.isPinnedLeft()};case"pinRight":return{name:i("pinRight","Pin Right"),action:function(){return r.columnModel.setColumnPinned(o,"right","contextMenu")},checked:!!o&&o.isPinnedRight()};case"clearPinned":return{name:i("noPin","No Pin"),action:function(){return r.columnModel.setColumnPinned(o,null,"contextMenu")},checked:!!o&&!o.isPinned()};case"valueAggSubMenu":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.RowGroupingModule,"Aggregation from Menu",this.context.getGridId())&&((null==o?void 0:o.isPrimary())||(null==o?void 0:o.getColDef().pivotValueColumn))?{name:i("valueAggregation","Value Aggregation"),icon:t._.createIconNoSpan("menuValue",this.gridOptionsService,null),subMenu:this.createAggregationSubMenu(o)}:null;case"autoSizeThis":return{name:i("autosizeThiscolumn","Autosize This Column"),action:function(){return r.columnModel.autoSizeColumn(o,u,"contextMenu")}};case"autoSizeAll":return{name:i("autosizeAllColumns","Autosize All Columns"),action:function(){return r.columnModel.autoSizeAllColumns(u,"contextMenu")}};case"rowGroup":return{name:i("groupBy","Group by")+" "+t._.escapeString(this.columnModel.getDisplayNameForColumn(o,"header")),disabled:(null==o?void 0:o.isRowGroupActive())||!(null==o?void 0:o.getColDef().enableRowGroup),action:function(){return r.columnModel.addRowGroupColumn(o,"contextMenu")},icon:t._.createIconNoSpan("menuAddRowGroup",this.gridOptionsService,null)};case"rowUnGroup":var a=t._.createIconNoSpan("menuRemoveRowGroup",this.gridOptionsService,null),c=null==o?void 0:o.getColDef().showRowGroup,l=this.gridOptionsService.get("groupLockGroupColumns");if(!0===c)return{name:i("ungroupAll","Un-Group All"),disabled:-1===l||l>=this.columnModel.getRowGroupColumns().length,action:function(){return r.columnModel.setRowGroupColumns(r.columnModel.getRowGroupColumns().slice(0,l),"contextMenu")},icon:a};if("string"==typeof c){var s=this.columnModel.getPrimaryColumn(c),p=null!=s?t._.escapeString(this.columnModel.getDisplayNameForColumn(s,"header")):c;return{name:i("ungroupBy","Un-Group by")+" "+p,disabled:null!=s&&this.columnModel.isColumnGroupingLocked(s),action:function(){return r.columnModel.removeRowGroupColumn(c,"contextMenu")},icon:a}}return{name:i("ungroupBy","Un-Group by")+" "+t._.escapeString(this.columnModel.getDisplayNameForColumn(o,"header")),disabled:!(null==o?void 0:o.isRowGroupActive())||!(null==o?void 0:o.getColDef().enableRowGroup)||this.columnModel.isColumnGroupingLocked(o),action:function(){return r.columnModel.removeRowGroupColumn(o,"contextMenu")},icon:a};case"resetColumns":return{name:i("resetColumns","Reset Columns"),action:function(){return r.columnModel.resetColumnState("contextMenu")}};case"expandAll":return{name:i("expandAll","Expand All Row Groups"),action:function(){return r.gridApi.expandAll()}};case"contractAll":return{name:i("collapseAll","Collapse All Row Groups"),action:function(){return r.gridApi.collapseAll()}};case"copy":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy from Menu",this.context.getGridId())?{name:i("copy","Copy"),shortcut:i("ctrlC","Ctrl+C"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return r.clipboardService.copyToClipboard()}}:null;case"copyWithHeaders":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy with Headers from Menu",this.context.getGridId())?{name:i("copyWithHeaders","Copy with Headers"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return r.clipboardService.copyToClipboard({includeHeaders:!0})}}:null;case"copyWithGroupHeaders":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy with Group Headers from Menu",this.context.getGridId())?{name:i("copyWithGroupHeaders","Copy with Group Headers"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return r.clipboardService.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}}:null;case"cut":if(t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Cut from Menu",this.context.getGridId())){var d=this.focusService.getFocusedCell(),m=d?this.rowPositionUtils.getRowNode(d):null,h=!!m&&(null==d?void 0:d.column.isCellEditable(m));return{name:i("cut","Cut"),shortcut:i("ctrlX","Ctrl+X"),icon:t._.createIconNoSpan("clipboardCut",this.gridOptionsService,null),disabled:!h||this.gridOptionsService.get("suppressCutToClipboard"),action:function(){return r.clipboardService.cutToClipboard(void 0,"contextMenu")}}}return null;case"paste":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Paste from Clipboard",this.context.getGridId())?{name:i("paste","Paste"),shortcut:i("ctrlV","Ctrl+V"),disabled:!0,icon:t._.createIconNoSpan("clipboardPaste",this.gridOptionsService,null),action:function(){return r.clipboardService.pasteFromClipboard()}}:null;case"export":var v=[],g=t.ModuleRegistry.__isRegistered(t.ModuleNames.CsvExportModule,this.context.getGridId()),f=t.ModuleRegistry.__isRegistered(t.ModuleNames.ExcelExportModule,this.context.getGridId());return!this.gridOptionsService.get("suppressCsvExport")&&g&&v.push("csvExport"),!this.gridOptionsService.get("suppressExcelExport")&&f&&v.push("excelExport"),{name:i("export","Export"),subMenu:v,icon:t._.createIconNoSpan("save",this.gridOptionsService,null)};case"csvExport":return{name:i("csvExport","CSV Export"),icon:t._.createIconNoSpan("csvExport",this.gridOptionsService,null),action:function(){return r.gridApi.exportDataAsCsv({})}};case"excelExport":return{name:i("excelExport","Excel Export"),icon:t._.createIconNoSpan("excelExport",this.gridOptionsService,null),action:function(){return r.gridApi.exportDataAsExcel()}};case"separator":return"separator";case"pivotChart":case"chartRange":return null!==(n=this.chartMenuItemMapper.getChartItems(e))&&void 0!==n?n:null;default:return console.warn("AG Grid: unknown menu item type ".concat(e)),null}},o.prototype.createAggregationSubMenu=function(e){var o,n=this,r=this.localeService.getLocaleTextFunc();if(e.isPrimary())o=e;else{var i=e.getColDef().pivotValueColumn;o=t._.exists(i)?i:void 0}var u=[];if(o){var a=o.isValueActive(),c=this.aggFuncService.getFuncNames(o);u.push({name:r("noAggregation","None"),action:function(){n.columnModel.removeValueColumn(o,"contextMenu"),n.columnModel.setColumnAggFunc(o,void 0,"contextMenu")},checked:!a}),c.forEach((function(e){u.push({name:r(e,n.aggFuncService.getDefaultFuncLabel(e)),action:function(){n.columnModel.setColumnAggFunc(o,e,"contextMenu"),n.columnModel.addValueColumn(o,"contextMenu")},checked:a&&o.getAggFunc()===e})}))}return u},v([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),v([t.Autowired("gridApi")],o.prototype,"gridApi",void 0),v([t.Optional("clipboardService")],o.prototype,"clipboardService",void 0),v([t.Optional("aggFuncService")],o.prototype,"aggFuncService",void 0),v([t.Autowired("focusService")],o.prototype,"focusService",void 0),v([t.Autowired("rowPositionUtils")],o.prototype,"rowPositionUtils",void 0),v([t.Autowired("chartMenuItemMapper")],o.prototype,"chartMenuItemMapper",void 0),o=v([t.Bean("menuItemMapper")],o)}(t.BeanStub),f=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),C=function(){return(C=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},b=function(e,t,o,n){var r,i=arguments.length,u=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(u=(i<3?r(u):i>3?r(t,o,u):r(t,o))||u);return i>3&&u&&Object.defineProperty(t,o,u),u},y=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var n,r,i=o.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)u.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return u},M=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}var n;return f(o,e),n=o,o.prototype.getChartItems=function(e){var o,r;if(this.chartService){var i="pivotChart"===e?new S(this.gridOptionsService,this.chartService,this.localeService):new A(this.gridOptionsService,this.chartService,this.localeService),u=i.getMenuItem(),a=null===(r=null===(o=this.gridOptionsService.get("chartToolPanelsDef"))||void 0===o?void 0:o.settingsPanel)||void 0===r?void 0:r.chartGroupsDef;return a&&(u=n.filterAndOrderChartMenu(u,a,i.getConfigLookup())),this.cleanInternals(u)}t.ModuleRegistry.__assertRegistered(t.ModuleNames.GridChartsModule,'the Context Menu key "'.concat(e,'"'),this.context.getGridId())},o.prototype.cleanInternals=function(e){if(!e)return e;var t=function(e){var o;return null==e||delete e._key,null===(o=null==e?void 0:e.subMenu)||void 0===o||o.forEach((function(e){return t(e)})),e};return t(e)},o.buildLookup=function(e){var t={},o=function(e){t[e._key]=e,e.subMenu&&e.subMenu.forEach((function(e){return o(e)}))};return o(e),t},o.filterAndOrderChartMenu=function(e,o,n){var r,i=this.buildLookup(e),u=C(C({},e),{subMenu:[]});if(Object.entries(o).forEach((function(e){var o,r,a=y(e,2),c=a[0],l=a[1],s=n[c];if(null!=s){var p=i[s._key];if(p)if(p.subMenu){var d=l.map((function(e){var o=s[e];if(null!=o)return i[o];t._.warnOnce("invalid chartGroupsDef config '".concat(c,".").concat(e,"'"))})).filter((function(e){return void 0!==e}));d.length>0&&(p.subMenu=d,null===(o=u.subMenu)||void 0===o||o.push(p))}else null===(r=u.subMenu)||void 0===r||r.push(p)}else t._.warnOnce("invalid chartGroupsDef config '".concat(c,"'"))})),0!=(null===(r=u.subMenu)||void 0===r?void 0:r.length))return u},b([t.Optional("chartService")],o.prototype,"chartService",void 0),o=n=b([t.Bean("chartMenuItemMapper")],o)}(t.BeanStub),S=function(){function e(e,t,o){this.gridOptionsService=e,this.chartService=t,this.localeService=o}return e.prototype.getMenuItem=function(){var e=this,o=this.localeService.getLocaleTextFunc(),n=function(t,n,r,i){return{name:o(t,n),action:function(){return e.chartService.createPivotChart({chartType:r})},_key:i}};return{name:o("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:o("columnChart","Column"),subMenu:[n("groupedColumn","Grouped&lrm;","groupedColumn","pivotGroupedColumn"),n("stackedColumn","Stacked&lrm;","stackedColumn","pivotStackedColumn"),n("normalizedColumn","100% Stacked&lrm;","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:o("barChart","Bar"),subMenu:[n("groupedBar","Grouped&lrm;","groupedBar","pivotGroupedBar"),n("stackedBar","Stacked&lrm;","stackedBar","pivotStackedBar"),n("normalizedBar","100% Stacked&lrm;","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:o("pieChart","Pie"),subMenu:[n("pie","Pie&lrm;","pie","pivotPie"),n("doughnut","Doughnut&lrm;","doughnut","pivotDoughnut")]},n("line","Line&lrm;","line","pivotLineChart"),{_key:"pivotXYChart",name:o("xyChart","X Y (Scatter)"),subMenu:[n("scatter","Scatter&lrm;","scatter","pivotScatter"),n("bubble","Bubble&lrm;","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:o("areaChart","Area"),subMenu:[n("area","Area&lrm;","area","pivotArea"),n("stackedArea","Stacked&lrm;","stackedArea","pivotStackedArea"),n("normalizedArea","100% Stacked&lrm;","normalizedArea","pivotNormalizedArea")]},n("histogramChart","Histogram&lrm;","histogram","pivotHistogramChart"),{_key:"pivotCombinationChart",name:o("combinationChart","Combination"),subMenu:[n("columnLineCombo","Column & Line&lrm;","columnLineCombo","pivotColumnLineCombo"),n("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","pivotAreaColumnCombo")]}],icon:t._.createIconNoSpan("chart",this.gridOptionsService,void 0)}},e.prototype.getConfigLookup=function(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",doughnut:"pivotDoughnut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},histogramGroup:{_key:"pivotHistogramChart",histogram:"pivotHistogramChart"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:""}}},e}(),A=function(){function e(e,t,o){this.gridOptionsService=e,this.chartService=t,this.localeService=o}return e.prototype.getMenuItem=function(){var e=this,o=this.localeService.getLocaleTextFunc(),n=function(t,n,r,i){return{name:o(t,n),action:function(){return e.chartService.createChartFromCurrentRange(r)},_key:i}};return{name:o("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:o("columnChart","Column"),subMenu:[n("groupedColumn","Grouped&lrm;","groupedColumn","rangeGroupedColumn"),n("stackedColumn","Stacked&lrm;","stackedColumn","rangeStackedColumn"),n("normalizedColumn","100% Stacked&lrm;","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:o("barChart","Bar"),subMenu:[n("groupedBar","Grouped&lrm;","groupedBar","rangeGroupedBar"),n("stackedBar","Stacked&lrm;","stackedBar","rangeStackedBar"),n("normalizedBar","100% Stacked&lrm;","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:o("pieChart","Pie"),subMenu:[n("pie","Pie&lrm;","pie","rangePie"),n("doughnut","Doughnut&lrm;","doughnut","rangeDoughnut")],_key:"rangePieChart"},n("line","Line&lrm;","line","rangeLineChart"),{name:o("xyChart","X Y (Scatter)"),subMenu:[n("scatter","Scatter&lrm;","scatter","rangeScatter"),n("bubble","Bubble&lrm;","bubble","rangeBubble")],_key:"rangeXYChart"},{name:o("areaChart","Area"),subMenu:[n("area","Area&lrm;","area","rangeArea"),n("stackedArea","Stacked&lrm;","stackedArea","rangeStackedArea"),n("normalizedArea","100% Stacked&lrm;","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},n("histogramChart","Histogram&lrm;","histogram","rangeHistogramChart"),{name:o("combinationChart","Combination"),subMenu:[n("columnLineCombo","Column & Line&lrm;","columnLineCombo","rangeColumnLineCombo"),n("AreaColumnCombo","Area & Column&lrm;","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:t._.createIconNoSpan("chart",this.gridOptionsService,void 0)}},e.prototype.getConfigLookup=function(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",doughnut:"rangeDoughnut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},histogramGroup:{_key:"rangeHistogramChart",histogram:"rangeHistogramChart"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:""}}},e}(),_={version:"31.0.1",moduleName:t.ModuleNames.MenuModule,beans:[u,p,g,M],dependantModules:[o.EnterpriseCoreModule]};exports.MenuModule=_;
{
"name": "@ag-grid-enterprise/menu",
"version": "31.0.0",
"version": "31.0.1",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -50,5 +50,5 @@ "main": "./dist/esm/es6/main.mjs",

"dependencies": {
"@ag-grid-community/core": "~31.0.0",
"@ag-grid-enterprise/column-tool-panel": "~31.0.0",
"@ag-grid-enterprise/core": "~31.0.0"
"@ag-grid-community/core": "~31.0.1",
"@ag-grid-enterprise/column-tool-panel": "~31.0.1",
"@ag-grid-enterprise/core": "~31.0.1"
},

@@ -55,0 +55,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

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

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

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

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