import type { BasePubSubService } from '@slickgrid-universal/event-pub-sub'; import { SlickEvent } from '../core/index.js'; import type { Column, DOMEvent, DOMMouseOrTouchEvent, GridMenu, GridMenuCommandItemCallbackArgs, GridMenuEventWithElementCallbackArgs, GridMenuItem, GridMenuOption, GridOption, onGridMenuColumnsChangedCallbackArgs } from '../interfaces/index.js'; import type { FilterService } from '../services/filter.service.js'; import type { SharedService } from '../services/shared.service.js'; import type { SortService } from '../services/sort.service.js'; import type { ExtensionUtility } from './extensionUtility.js'; import { MenuBaseClass, type ExtendableItemTypes, type ExtractMenuType, type MenuType } from './menuBaseClass.js'; /** * A control to add a Grid Menu with Extra Commands & Column Picker (hambuger menu on top-right of the grid) * To specify a custom button in a column header, extend the column definition like so: * this.gridOptions = { * enableGridMenu: true, * gridMenu: { * ... grid menu options ... * commandItems: [{ ...command... }, { ...command... }] * } * }]; * @class GridMenuControl * @constructor */ export declare class SlickGridMenu extends MenuBaseClass { protected readonly extensionUtility: ExtensionUtility; protected readonly filterService: FilterService; protected readonly pubSubService: BasePubSubService; protected readonly sharedService: SharedService; protected readonly sortService: SortService; onAfterMenuShow: SlickEvent; onBeforeMenuShow: SlickEvent; onMenuClose: SlickEvent; onCommand: SlickEvent; onColumnsChanged: SlickEvent; protected _commandMenuElm: HTMLDivElement | null; protected _gridMenuButtonElm: HTMLButtonElement | null; protected _headerElm: HTMLDivElement | null; protected _isMenuOpen: boolean; protected _subMenuParentId: string; protected _originalGridMenu: GridMenu; protected _userOriginalGridMenu: GridMenu; protected _defaults: GridMenuOption; readonly pluginName = "GridMenu"; /** Constructor of the SlickGrid 3rd party plugin, it can optionally receive options */ constructor(extensionUtility: ExtensionUtility, filterService: FilterService, pubSubService: BasePubSubService, sharedService: SharedService, sortService: SortService); get addonOptions(): GridMenu; get columns(): Column[]; set columns(newColumns: Column[]); get gridOptions(): GridOption; get gridUidSelector(): string; initEventHandlers(): void; /** Initialize plugin. */ init(isFirstLoad?: boolean): void; /** Dispose (destroy) the SlickGrid 3rd party plugin */ dispose(): void; deleteMenu(): void; createColumnPickerContainer(): void; /** Create parent grid menu container */ createGridMenu(): void; /** Create the menu or sub-menu(s) but without the column picker which is a separate single process */ createCommandMenu(triggeredByElm: HTMLElement, commandItems: Array, level?: number, item?: ExtractMenuType): HTMLDivElement; /** * Get all columns including hidden columns. * @returns {Array} - all columns array */ getAllColumns(): Column[]; /** * Get only the visible columns. * @returns {Array} - only the visible columns array */ getVisibleColumns(): Column[]; /** * Hide the Grid Menu but only if it does detect as open prior to executing anything. * @param event * @returns */ hideMenu(event: Event): void; /** destroy and recreate the Grid Menu in the DOM */ recreateGridMenu(): void; /** Open the Grid Menu */ openGridMenu(): void; /** show Grid Menu from the click event, which in theory will recreate the grid menu in the DOM */ showGridMenu(e: MouseEvent | TouchEvent, options?: GridMenuOption): void; /** Translate the Grid Menu titles and column picker */ translateGridMenu(): void; translateTitleLabels(gridMenuOptions: GridMenu | null): void; /** Create Grid Menu with Custom Commands if user has enabled Filters and/or uses a Backend Service (OData, GraphQL) */ protected addGridMenuCustomCommands(originalCommandItems: Array): Array; protected clearPinning(): void; protected exportCsv(): void; protected exportExcel(): void; protected exportPdf(): void; protected exportTextDelimited(): void; protected toggleFilterBar(): void; /** @return default Grid Menu options */ protected getDefaultGridMenuOptions(): GridMenu; /** Returns the CSS selectors for all focusable menu items (commands and column picker), skipping dividers/disabled/hidden. */ protected getFocusableMenuSelectors(): string[]; /** Returns all focusable menu items in DOM order, skipping hidden/disabled/dividers. */ protected getAllFocusableMenuItems(): HTMLElement[]; /** Mouse down handler when clicking anywhere in the DOM body */ protected handleBodyMouseDown(e: DOMEvent): void; protected stopFullBubbling(e: KeyboardEvent | MouseEvent | TouchEvent): void; protected handleKeyDown(e: KeyboardEvent): void; protected handleMenuItemCommandClick(event: DOMMouseOrTouchEvent, _type: MenuType, item: ExtractMenuType, level?: number): void; protected handleMenuItemMouseOver(e: DOMMouseOrTouchEvent, _type: MenuType, item: ExtractMenuType, level?: number): void; /** Re/Create Command List by adding title, close & list of commands */ recreateCommandList(triggeredByElm: HTMLElement, commandItems: Array, menuElm: HTMLElement, callbackArgs: GridMenuEventWithElementCallbackArgs, item?: ExtractMenuType): HTMLDivElement | null; protected repositionSubMenu(e: DOMMouseOrTouchEvent, item: ExtractMenuType, level: number): void; } //# sourceMappingURL=slickGridMenu.d.ts.map