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 32.3.2 to 32.3.3

2

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

@@ -16,5 +16,5 @@ "main": "./dist/package/main.cjs.js",

"dependencies": {
"@ag-grid-community/core": "32.3.2",
"@ag-grid-enterprise/core": "32.3.2",
"@ag-grid-enterprise/column-tool-panel": "32.3.2"
"@ag-grid-community/core": "32.3.3",
"@ag-grid-enterprise/core": "32.3.3",
"@ag-grid-enterprise/column-tool-panel": "32.3.3"
},

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

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

@@ -16,5 +16,5 @@ "main": "./src/main.js",

"dependencies": {
"@ag-grid-community/core": "32.3.2",
"@ag-grid-enterprise/core": "32.3.2",
"@ag-grid-enterprise/column-tool-panel": "32.3.2"
"@ag-grid-community/core": "32.3.3",
"@ag-grid-enterprise/core": "32.3.3",
"@ag-grid-enterprise/column-tool-panel": "32.3.3"
},

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

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

export declare const VERSION = "32.3.2";
export declare const VERSION = "32.3.3";
{
"name": "@ag-grid-enterprise/menu",
"version": "32.3.2",
"version": "32.3.3",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -16,5 +16,5 @@ "main": "./dist/package/main.cjs.js",

"dependencies": {
"@ag-grid-community/core": "32.3.2",
"@ag-grid-enterprise/core": "32.3.2",
"@ag-grid-enterprise/column-tool-panel": "32.3.2"
"@ag-grid-community/core": "32.3.3",
"@ag-grid-enterprise/core": "32.3.3",
"@ag-grid-enterprise/column-tool-panel": "32.3.3"
},

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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