@ag-grid-enterprise/menu
Advanced tools
Comparing version 30.2.0 to 30.2.1
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "30.2.0"; | ||
export declare const VERSION = "30.2.1"; |
@@ -5,2 +5,2 @@ "use strict"; | ||
// DO NOT UPDATE MANUALLY: Generated from script during build time | ||
exports.VERSION = '30.2.0'; | ||
exports.VERSION = '30.2.1'; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "30.2.0"; | ||
export declare const VERSION = "30.2.1"; |
@@ -5,2 +5,2 @@ "use strict"; | ||
// DO NOT UPDATE MANUALLY: Generated from script during build time | ||
exports.VERSION = '30.2.0'; | ||
exports.VERSION = '30.2.1'; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "30.2.0"; | ||
export declare const VERSION = "30.2.1"; |
// DO NOT UPDATE MANUALLY: Generated from script during build time | ||
export var VERSION = '30.2.0'; | ||
export var VERSION = '30.2.1'; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "30.2.0"; | ||
export declare const VERSION = "30.2.1"; |
/** | ||
* @ag-grid-enterprise/menu - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.0 | ||
* @ag-grid-enterprise/menu - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.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 v30.2.0 | ||
* @ag-grid-enterprise/menu - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.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.is("enableRtl")&&(u=1,a="right"),this.showMenu(e,(function(r){var s=r.getGui();i.popupService.positionPopupByComponent({type:o,column:e,eventSource:t,ePopup:s,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 s=this,l=this.getMenuParams(e,i,u),c=l.menu,p=l.eMenuGui,d=l.currentHeaderPosition,m=l.currentColumnIndex,h=l.anchorToElement,v=[];v.push(this.getClosedCallback(e,c,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 c.afterGuiAttached(Object.assign({},{container:n},e))},positionCallback:r?function(){return o(c)}:void 0,ariaLabel:g("ariaLabelColumnMenu","Column Menu")}),r||(c.showTabBasedOnPreviousSelection(),o(c));var f=this.popupService.setPopupPositionRelatedToElement(p,h);f&&this.addStopAnchoring(f,e,v),c.addEventListener(a.EVENT_TAB_SELECTED,(function(e){s.lastSelectedTab=e.key})),e.setMenuVisible(!0,"contextMenu"),this.activeMenu=c,c.addEventListener(t.BeanStub.EVENT_DESTROYED,(function(){s.activeMenu===c&&(s.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 s=u.focusService.findTabbableParent(i);s&&(e&&u.headerNavigationService.scrollToColumn(e),s.focus())}else if(n&&-1!==r){var l=u.columnModel.getAllDisplayedColumns(),c=l[r]||t._.last(l);c&&u.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:n.headerRowIndex,column:c}})}}},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){return e.getMenuTabs(a.TABS_DEFAULT).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),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 '"+e+"'. Check that your 'menuTabs' contains one of ["+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.columnModel.getRowGroupColumns().indexOf(this.column)>=0,u=this.column.isAllowValue(),a=this.column.isAllowRowGroup(),s=this.column.isPrimary(),l=this.columnModel.isPivotMode(),c="clientSide"===this.rowModel.getType(),p=this.gridOptionsService.is("treeData"),d=s&&r&&u||!s;return t&&e.push("pinSubMenu"),d&&e.push("valueAggSubMenu"),(t||d)&&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"),a&&this.column.isPrimary()&&(i?e.push("rowUnGroup"):e.push("rowGroup")),e.push(o.MENU_ITEM_SEPARATOR),e.push("resetColumns"),c&&(p||n>(l?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,s=i.suppressColumnFilter,l=i.suppressColumnSelectAll,c=i.suppressSyncLayoutWithGrid,p=i.columnLayout;r.init(!1,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!u,suppressColumnExpandAll:!!a,suppressColumnFilter:!!s,suppressColumnSelectAll:!!l,suppressSyncLayoutWithGrid:!!p||!!c,api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsService.context},"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("gridApi")],o.prototype,"gridApi",void 0),i([t.Autowired("columnApi")],o.prototype,"columnApi",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),s=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)},c=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 s(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.is("suppressCutToClipboard")||r.push("cut"),r.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gridOptionsService.is("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.is("suppressExcelExport")||u,s=this.gridOptionsService.is("suppressCsvExport")||i;!(t._.isIOSUserAgent()||a&&s)&&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.is("allowContextMenuWithControlKey")||!e||!e.ctrlKey&&!e.metaKey)&&(e&&this.blockMiddleClickScrollsIfNeeded(e),!this.gridOptionsService.is("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.is("suppressMiddleClickScrolls")&&2===o&&e.preventDefault()},o.prototype.showMenu=function(e,o,n,r,i){var u=this,a=this.getMenuItems(e,o,n),s=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===a||t._.missingOrEmpty(a))return!1;var c=new d(a);this.createBean(c);var p=c.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(){s.classList.remove("ag-context-menu-open"),u.destroyBean(c)},click:r,positionCallback:function(){var e=u.gridOptionsService.is("enableRtl");u.popupService.positionPopupUnderMouseEvent(l(l({},m),{nudgeX:e?-1*(p.offsetWidth+1):1}))},anchorToElement:i,ariaLabel:h("ariaLabelContextMenu","Context Menu")});return v&&(s.classList.add("ag-context-menu-open"),c.afterGuiAttached({container:"contextMenu",hidePopup:v.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=c,c.addEventListener(t.BeanStub.EVENT_DESTROYED,(function(){u.activeMenu===c&&(u.activeMenu=null)})),v&&c.addEventListener(t.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,v.hideFunc),!0},c([t.Autowired("popupService")],o.prototype,"popupService",void 0),c([t.Optional("rangeService")],o.prototype,"rangeService",void 0),c([t.Autowired("ctrlsService")],o.prototype,"ctrlsService",void 0),c([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),o=c([t.Bean("contextMenuFactory")],o)}(t.BeanStub),d=function(e){function o(t){var o=e.call(this,'<div class="ag-menu" role="presentation"></div>')||this;return o.menuList=null,o.focusedCell=null,o.menuItems=t,o}return s(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)},c([t.Autowired("menuItemMapper")],o.prototype,"menuItemMapper",void 0),c([t.Autowired("focusService")],o.prototype,"focusService",void 0),c([t.Autowired("cellPositionUtils")],o.prototype,"cellPositionUtils",void 0),c([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,i=this,u=this.localeService.getLocaleTextFunc(),a=this.gridOptionsService.is("skipHeaderOnAutoSize");switch(e){case"pinSubMenu":return{name:u("pinColumn","Pin Column"),icon:t._.createIconNoSpan("menuPin",this.gridOptionsService,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:u("pinLeft","Pin Left"),action:function(){return i.columnModel.setColumnPinned(o,"left","contextMenu")},checked:!!o&&o.isPinnedLeft()};case"pinRight":return{name:u("pinRight","Pin Right"),action:function(){return i.columnModel.setColumnPinned(o,"right","contextMenu")},checked:!!o&&o.isPinnedRight()};case"clearPinned":return{name:u("noPin","No Pin"),action:function(){return i.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:u("valueAggregation","Value Aggregation"),icon:t._.createIconNoSpan("menuValue",this.gridOptionsService,null),subMenu:this.createAggregationSubMenu(o)}:null;case"autoSizeThis":return{name:u("autosizeThiscolumn","Autosize This Column"),action:function(){return i.columnModel.autoSizeColumn(o,a,"contextMenu")}};case"autoSizeAll":return{name:u("autosizeAllColumns","Autosize All Columns"),action:function(){return i.columnModel.autoSizeAllColumns(a,"contextMenu")}};case"rowGroup":return{name:u("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 i.columnModel.addRowGroupColumn(o,"contextMenu")},icon:t._.createIconNoSpan("menuAddRowGroup",this.gridOptionsService,null)};case"rowUnGroup":var s=t._.createIconNoSpan("menuRemoveRowGroup",this.gridOptionsService,null),l=null==o?void 0:o.getColDef().showRowGroup;if(!0===l)return{name:u("ungroupAll","Un-Group All"),disabled:!(null==o?void 0:o.getColDef().showRowGroup),action:function(){return i.columnModel.setRowGroupColumns([],"contextMenu")},icon:s};if("string"==typeof l){var c=null===(n=this.columnModel.getSourceColumnsForGroupColumn(o))||void 0===n?void 0:n[0],p=null!=c?t._.escapeString(this.columnModel.getDisplayNameForColumn(c,"header")):l;return{name:u("ungroupBy","Un-Group by")+" "+p,disabled:!(null==o?void 0:o.getColDef().showRowGroup),action:function(){return i.columnModel.removeRowGroupColumn(l,"contextMenu")},icon:s}}return{name:u("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),action:function(){return i.columnModel.removeRowGroupColumn(o,"contextMenu")},icon:s};case"resetColumns":return{name:u("resetColumns","Reset Columns"),action:function(){return i.columnModel.resetColumnState("contextMenu")}};case"expandAll":return{name:u("expandAll","Expand All Row Groups"),action:function(){return i.gridApi.expandAll()}};case"contractAll":return{name:u("collapseAll","Collapse All Row Groups"),action:function(){return i.gridApi.collapseAll()}};case"copy":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy from Menu",this.context.getGridId())?{name:u("copy","Copy"),shortcut:u("ctrlC","Ctrl+C"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return i.clipboardService.copyToClipboard()}}:null;case"copyWithHeaders":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy with Headers from Menu",this.context.getGridId())?{name:u("copyWithHeaders","Copy with Headers"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return i.clipboardService.copyToClipboard({includeHeaders:!0})}}:null;case"copyWithGroupHeaders":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy with Group Headers from Menu",this.context.getGridId())?{name:u("copyWithGroupHeaders","Copy with Group Headers"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return i.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:u("cut","Cut"),shortcut:u("ctrlX","Ctrl+X"),icon:t._.createIconNoSpan("clipboardCut",this.gridOptionsService,null),disabled:!h||this.gridOptionsService.is("suppressCutToClipboard"),action:function(){return i.clipboardService.cutToClipboard(void 0,"contextMenu")}}}return null;case"paste":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Paste from Clipboard",this.context.getGridId())?{name:u("paste","Paste"),shortcut:u("ctrlV","Ctrl+V"),disabled:!0,icon:t._.createIconNoSpan("clipboardPaste",this.gridOptionsService,null),action:function(){return i.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.is("suppressCsvExport")&&g&&v.push("csvExport"),!this.gridOptionsService.is("suppressExcelExport")&&f&&v.push("excelExport"),{name:u("export","Export"),subMenu:v,icon:t._.createIconNoSpan("save",this.gridOptionsService,null)};case"csvExport":return{name:u("csvExport","CSV Export"),icon:t._.createIconNoSpan("csvExport",this.gridOptionsService,null),action:function(){return i.gridApi.exportDataAsCsv({})}};case"excelExport":return{name:u("excelExport","Excel Export"),icon:t._.createIconNoSpan("excelExport",this.gridOptionsService,null),action:function(){return i.gridApi.exportDataAsExcel()}};case"separator":return"separator";case"pivotChart":case"chartRange":return null!==(r=this.chartMenuItemMapper.getChartItems(e))&&void 0!==r?r:null;default:return console.warn("AG Grid: unknown menu item type "+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(),s=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}),s.forEach((function(e){u.push({name:r(e,t._.capitalise(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 "'+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),s=a[0],l=a[1],c=n[s];if(null!=c){var p=i[c._key];if(p)if(p.subMenu){var d=l.map((function(e){var o=c[e];if(null!=o)return i[o];t._.doOnce((function(){return console.warn("AG Grid - invalid chartGroupsDef config '"+s+"."+e+"'")}),"invalid_chartGroupsDef"+e+"_"+s)})).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._.doOnce((function(){return console.warn("AG Grid - invalid chartGroupsDef config '"+s+"'")}),"invalid_chartGroupsDef"+s)})),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‎","groupedColumn","pivotGroupedColumn"),n("stackedColumn","Stacked‎","stackedColumn","pivotStackedColumn"),n("normalizedColumn","100% Stacked‎","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:o("barChart","Bar"),subMenu:[n("groupedBar","Grouped‎","groupedBar","pivotGroupedBar"),n("stackedBar","Stacked‎","stackedBar","pivotStackedBar"),n("normalizedBar","100% Stacked‎","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:o("pieChart","Pie"),subMenu:[n("pie","Pie‎","pie","pivotPie"),n("doughnut","Doughnut‎","doughnut","pivotDoughnut")]},n("line","Line‎","line","pivotLineChart"),{_key:"pivotXYChart",name:o("xyChart","X Y (Scatter)"),subMenu:[n("scatter","Scatter‎","scatter","pivotScatter"),n("bubble","Bubble‎","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:o("areaChart","Area"),subMenu:[n("area","Area‎","area","pivotArea"),n("stackedArea","Stacked‎","stackedArea","pivotStackedArea"),n("normalizedArea","100% Stacked‎","normalizedArea","pivotNormalizedArea")]},n("histogramChart","Histogram‎","histogram","pivotHistogramChart"),{_key:"pivotCombinationChart",name:o("combinationChart","Combination"),subMenu:[n("columnLineCombo","Column & Line‎","columnLineCombo","pivotColumnLineCombo"),n("AreaColumnCombo","Area & Column‎","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‎","groupedColumn","rangeGroupedColumn"),n("stackedColumn","Stacked‎","stackedColumn","rangeStackedColumn"),n("normalizedColumn","100% Stacked‎","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:o("barChart","Bar"),subMenu:[n("groupedBar","Grouped‎","groupedBar","rangeGroupedBar"),n("stackedBar","Stacked‎","stackedBar","rangeStackedBar"),n("normalizedBar","100% Stacked‎","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:o("pieChart","Pie"),subMenu:[n("pie","Pie‎","pie","rangePie"),n("doughnut","Doughnut‎","doughnut","rangeDoughnut")],_key:"rangePieChart"},n("line","Line‎","line","rangeLineChart"),{name:o("xyChart","X Y (Scatter)"),subMenu:[n("scatter","Scatter‎","scatter","rangeScatter"),n("bubble","Bubble‎","bubble","rangeBubble")],_key:"rangeXYChart"},{name:o("areaChart","Area"),subMenu:[n("area","Area‎","area","rangeArea"),n("stackedArea","Stacked‎","stackedArea","rangeStackedArea"),n("normalizedArea","100% Stacked‎","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},n("histogramChart","Histogram‎","histogram","rangeHistogramChart"),{name:o("combinationChart","Combination"),subMenu:[n("columnLineCombo","Column & Line‎","columnLineCombo","rangeColumnLineCombo"),n("AreaColumnCombo","Area & Column‎","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:"30.2.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.is("enableRtl")&&(u=1,a="right"),this.showMenu(e,(function(r){var s=r.getGui();i.popupService.positionPopupByComponent({type:o,column:e,eventSource:t,ePopup:s,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 s=this,l=this.getMenuParams(e,i,u),c=l.menu,p=l.eMenuGui,d=l.currentHeaderPosition,m=l.currentColumnIndex,h=l.anchorToElement,v=[];v.push(this.getClosedCallback(e,c,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 c.afterGuiAttached(Object.assign({},{container:n},e))},positionCallback:r?function(){return o(c)}:void 0,ariaLabel:g("ariaLabelColumnMenu","Column Menu")}),r||(c.showTabBasedOnPreviousSelection(),o(c));var f=this.popupService.setPopupPositionRelatedToElement(p,h);f&&this.addStopAnchoring(f,e,v),c.addEventListener(a.EVENT_TAB_SELECTED,(function(e){s.lastSelectedTab=e.key})),e.setMenuVisible(!0,"contextMenu"),this.activeMenu=c,c.addEventListener(t.BeanStub.EVENT_DESTROYED,(function(){s.activeMenu===c&&(s.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 s=u.focusService.findTabbableParent(i);s&&(e&&u.headerNavigationService.scrollToColumn(e),s.focus())}else if(n&&-1!==r){var l=u.columnModel.getAllDisplayedColumns(),c=l[r]||t._.last(l);c&&u.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:n.headerRowIndex,column:c}})}}},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){return e.getMenuTabs(a.TABS_DEFAULT).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),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 '"+e+"'. Check that your 'menuTabs' contains one of ["+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.columnModel.getRowGroupColumns().indexOf(this.column)>=0,u=this.column.isAllowValue(),a=this.column.isAllowRowGroup(),s=this.column.isPrimary(),l=this.columnModel.isPivotMode(),c="clientSide"===this.rowModel.getType(),p=this.gridOptionsService.is("treeData"),d=s&&r&&u||!s;return t&&e.push("pinSubMenu"),d&&e.push("valueAggSubMenu"),(t||d)&&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"),a&&this.column.isPrimary()&&(i?e.push("rowUnGroup"):e.push("rowGroup")),e.push(o.MENU_ITEM_SEPARATOR),e.push("resetColumns"),c&&(p||n>(l?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,s=i.suppressColumnFilter,l=i.suppressColumnSelectAll,c=i.suppressSyncLayoutWithGrid,p=i.columnLayout;r.init(!1,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!u,suppressColumnExpandAll:!!a,suppressColumnFilter:!!s,suppressColumnSelectAll:!!l,suppressSyncLayoutWithGrid:!!p||!!c,api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsService.context},"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("gridApi")],o.prototype,"gridApi",void 0),i([t.Autowired("columnApi")],o.prototype,"columnApi",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),s=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)},c=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 s(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.is("suppressCutToClipboard")||r.push("cut"),r.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),this.gridOptionsService.is("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.is("suppressExcelExport")||u,s=this.gridOptionsService.is("suppressCsvExport")||i;!(t._.isIOSUserAgent()||a&&s)&&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.is("allowContextMenuWithControlKey")||!e||!e.ctrlKey&&!e.metaKey)&&(e&&this.blockMiddleClickScrollsIfNeeded(e),!this.gridOptionsService.is("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.is("suppressMiddleClickScrolls")&&2===o&&e.preventDefault()},o.prototype.showMenu=function(e,o,n,r,i){var u=this,a=this.getMenuItems(e,o,n),s=this.ctrlsService.getGridBodyCtrl().getGui();if(void 0===a||t._.missingOrEmpty(a))return!1;var c=new d(a);this.createBean(c);var p=c.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(){s.classList.remove("ag-context-menu-open"),u.destroyBean(c)},click:r,positionCallback:function(){var e=u.gridOptionsService.is("enableRtl");u.popupService.positionPopupUnderMouseEvent(l(l({},m),{nudgeX:e?-1*(p.offsetWidth+1):1}))},anchorToElement:i,ariaLabel:h("ariaLabelContextMenu","Context Menu")});return v&&(s.classList.add("ag-context-menu-open"),c.afterGuiAttached({container:"contextMenu",hidePopup:v.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=c,c.addEventListener(t.BeanStub.EVENT_DESTROYED,(function(){u.activeMenu===c&&(u.activeMenu=null)})),v&&c.addEventListener(t.AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED,v.hideFunc),!0},c([t.Autowired("popupService")],o.prototype,"popupService",void 0),c([t.Optional("rangeService")],o.prototype,"rangeService",void 0),c([t.Autowired("ctrlsService")],o.prototype,"ctrlsService",void 0),c([t.Autowired("columnModel")],o.prototype,"columnModel",void 0),o=c([t.Bean("contextMenuFactory")],o)}(t.BeanStub),d=function(e){function o(t){var o=e.call(this,'<div class="ag-menu" role="presentation"></div>')||this;return o.menuList=null,o.focusedCell=null,o.menuItems=t,o}return s(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)},c([t.Autowired("menuItemMapper")],o.prototype,"menuItemMapper",void 0),c([t.Autowired("focusService")],o.prototype,"focusService",void 0),c([t.Autowired("cellPositionUtils")],o.prototype,"cellPositionUtils",void 0),c([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,i=this,u=this.localeService.getLocaleTextFunc(),a=this.gridOptionsService.is("skipHeaderOnAutoSize");switch(e){case"pinSubMenu":return{name:u("pinColumn","Pin Column"),icon:t._.createIconNoSpan("menuPin",this.gridOptionsService,null),subMenu:["clearPinned","pinLeft","pinRight"]};case"pinLeft":return{name:u("pinLeft","Pin Left"),action:function(){return i.columnModel.setColumnPinned(o,"left","contextMenu")},checked:!!o&&o.isPinnedLeft()};case"pinRight":return{name:u("pinRight","Pin Right"),action:function(){return i.columnModel.setColumnPinned(o,"right","contextMenu")},checked:!!o&&o.isPinnedRight()};case"clearPinned":return{name:u("noPin","No Pin"),action:function(){return i.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:u("valueAggregation","Value Aggregation"),icon:t._.createIconNoSpan("menuValue",this.gridOptionsService,null),subMenu:this.createAggregationSubMenu(o)}:null;case"autoSizeThis":return{name:u("autosizeThiscolumn","Autosize This Column"),action:function(){return i.columnModel.autoSizeColumn(o,a,"contextMenu")}};case"autoSizeAll":return{name:u("autosizeAllColumns","Autosize All Columns"),action:function(){return i.columnModel.autoSizeAllColumns(a,"contextMenu")}};case"rowGroup":return{name:u("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 i.columnModel.addRowGroupColumn(o,"contextMenu")},icon:t._.createIconNoSpan("menuAddRowGroup",this.gridOptionsService,null)};case"rowUnGroup":var s=t._.createIconNoSpan("menuRemoveRowGroup",this.gridOptionsService,null),l=null==o?void 0:o.getColDef().showRowGroup;if(!0===l)return{name:u("ungroupAll","Un-Group All"),disabled:!(null==o?void 0:o.getColDef().showRowGroup),action:function(){return i.columnModel.setRowGroupColumns([],"contextMenu")},icon:s};if("string"==typeof l){var c=null===(n=this.columnModel.getSourceColumnsForGroupColumn(o))||void 0===n?void 0:n[0],p=null!=c?t._.escapeString(this.columnModel.getDisplayNameForColumn(c,"header")):l;return{name:u("ungroupBy","Un-Group by")+" "+p,disabled:!(null==o?void 0:o.getColDef().showRowGroup),action:function(){return i.columnModel.removeRowGroupColumn(l,"contextMenu")},icon:s}}return{name:u("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),action:function(){return i.columnModel.removeRowGroupColumn(o,"contextMenu")},icon:s};case"resetColumns":return{name:u("resetColumns","Reset Columns"),action:function(){return i.columnModel.resetColumnState("contextMenu")}};case"expandAll":return{name:u("expandAll","Expand All Row Groups"),action:function(){return i.gridApi.expandAll()}};case"contractAll":return{name:u("collapseAll","Collapse All Row Groups"),action:function(){return i.gridApi.collapseAll()}};case"copy":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy from Menu",this.context.getGridId())?{name:u("copy","Copy"),shortcut:u("ctrlC","Ctrl+C"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return i.clipboardService.copyToClipboard()}}:null;case"copyWithHeaders":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy with Headers from Menu",this.context.getGridId())?{name:u("copyWithHeaders","Copy with Headers"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return i.clipboardService.copyToClipboard({includeHeaders:!0})}}:null;case"copyWithGroupHeaders":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Copy with Group Headers from Menu",this.context.getGridId())?{name:u("copyWithGroupHeaders","Copy with Group Headers"),icon:t._.createIconNoSpan("clipboardCopy",this.gridOptionsService,null),action:function(){return i.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:u("cut","Cut"),shortcut:u("ctrlX","Ctrl+X"),icon:t._.createIconNoSpan("clipboardCut",this.gridOptionsService,null),disabled:!h||this.gridOptionsService.is("suppressCutToClipboard"),action:function(){return i.clipboardService.cutToClipboard(void 0,"contextMenu")}}}return null;case"paste":return t.ModuleRegistry.__assertRegistered(t.ModuleNames.ClipboardModule,"Paste from Clipboard",this.context.getGridId())?{name:u("paste","Paste"),shortcut:u("ctrlV","Ctrl+V"),disabled:!0,icon:t._.createIconNoSpan("clipboardPaste",this.gridOptionsService,null),action:function(){return i.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.is("suppressCsvExport")&&g&&v.push("csvExport"),!this.gridOptionsService.is("suppressExcelExport")&&f&&v.push("excelExport"),{name:u("export","Export"),subMenu:v,icon:t._.createIconNoSpan("save",this.gridOptionsService,null)};case"csvExport":return{name:u("csvExport","CSV Export"),icon:t._.createIconNoSpan("csvExport",this.gridOptionsService,null),action:function(){return i.gridApi.exportDataAsCsv({})}};case"excelExport":return{name:u("excelExport","Excel Export"),icon:t._.createIconNoSpan("excelExport",this.gridOptionsService,null),action:function(){return i.gridApi.exportDataAsExcel()}};case"separator":return"separator";case"pivotChart":case"chartRange":return null!==(r=this.chartMenuItemMapper.getChartItems(e))&&void 0!==r?r:null;default:return console.warn("AG Grid: unknown menu item type "+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(),s=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}),s.forEach((function(e){u.push({name:r(e,t._.capitalise(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 "'+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),s=a[0],l=a[1],c=n[s];if(null!=c){var p=i[c._key];if(p)if(p.subMenu){var d=l.map((function(e){var o=c[e];if(null!=o)return i[o];t._.doOnce((function(){return console.warn("AG Grid - invalid chartGroupsDef config '"+s+"."+e+"'")}),"invalid_chartGroupsDef"+e+"_"+s)})).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._.doOnce((function(){return console.warn("AG Grid - invalid chartGroupsDef config '"+s+"'")}),"invalid_chartGroupsDef"+s)})),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‎","groupedColumn","pivotGroupedColumn"),n("stackedColumn","Stacked‎","stackedColumn","pivotStackedColumn"),n("normalizedColumn","100% Stacked‎","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:o("barChart","Bar"),subMenu:[n("groupedBar","Grouped‎","groupedBar","pivotGroupedBar"),n("stackedBar","Stacked‎","stackedBar","pivotStackedBar"),n("normalizedBar","100% Stacked‎","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:o("pieChart","Pie"),subMenu:[n("pie","Pie‎","pie","pivotPie"),n("doughnut","Doughnut‎","doughnut","pivotDoughnut")]},n("line","Line‎","line","pivotLineChart"),{_key:"pivotXYChart",name:o("xyChart","X Y (Scatter)"),subMenu:[n("scatter","Scatter‎","scatter","pivotScatter"),n("bubble","Bubble‎","bubble","pivotBubble")]},{_key:"pivotAreaChart",name:o("areaChart","Area"),subMenu:[n("area","Area‎","area","pivotArea"),n("stackedArea","Stacked‎","stackedArea","pivotStackedArea"),n("normalizedArea","100% Stacked‎","normalizedArea","pivotNormalizedArea")]},n("histogramChart","Histogram‎","histogram","pivotHistogramChart"),{_key:"pivotCombinationChart",name:o("combinationChart","Combination"),subMenu:[n("columnLineCombo","Column & Line‎","columnLineCombo","pivotColumnLineCombo"),n("AreaColumnCombo","Area & Column‎","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‎","groupedColumn","rangeGroupedColumn"),n("stackedColumn","Stacked‎","stackedColumn","rangeStackedColumn"),n("normalizedColumn","100% Stacked‎","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:o("barChart","Bar"),subMenu:[n("groupedBar","Grouped‎","groupedBar","rangeGroupedBar"),n("stackedBar","Stacked‎","stackedBar","rangeStackedBar"),n("normalizedBar","100% Stacked‎","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:o("pieChart","Pie"),subMenu:[n("pie","Pie‎","pie","rangePie"),n("doughnut","Doughnut‎","doughnut","rangeDoughnut")],_key:"rangePieChart"},n("line","Line‎","line","rangeLineChart"),{name:o("xyChart","X Y (Scatter)"),subMenu:[n("scatter","Scatter‎","scatter","rangeScatter"),n("bubble","Bubble‎","bubble","rangeBubble")],_key:"rangeXYChart"},{name:o("areaChart","Area"),subMenu:[n("area","Area‎","area","rangeArea"),n("stackedArea","Stacked‎","stackedArea","rangeStackedArea"),n("normalizedArea","100% Stacked‎","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},n("histogramChart","Histogram‎","histogram","rangeHistogramChart"),{name:o("combinationChart","Combination"),subMenu:[n("columnLineCombo","Column & Line‎","columnLineCombo","rangeColumnLineCombo"),n("AreaColumnCombo","Area & Column‎","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:"30.2.1",moduleName:t.ModuleNames.MenuModule,beans:[u,p,g,M],dependantModules:[o.EnterpriseCoreModule]};exports.MenuModule=_; |
{ | ||
"name": "@ag-grid-enterprise/menu", | ||
"version": "30.2.0", | ||
"version": "30.2.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": "~30.2.0", | ||
"@ag-grid-enterprise/column-tool-panel": "~30.2.0", | ||
"@ag-grid-enterprise/core": "~30.2.0" | ||
"@ag-grid-community/core": "~30.2.1", | ||
"@ag-grid-enterprise/column-tool-panel": "~30.2.1", | ||
"@ag-grid-enterprise/core": "~30.2.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3988563
65434