import type { ColumnConfiguration } from 'apex-grid'; import type { ColumnMenuProvider, GridFeatureModule, GridHost } from 'apex-grid/internal'; import type { ReactiveController } from 'lit'; export declare const CONTEXT_MENU_MODULE_ID = "context-menu"; /** Fired on the grid before a context menu opens; cancellable, with a mutable `items` array. */ export declare const CONTEXT_MENU_OPENING_EVENT = "apex-context-menu-opening"; /** Declarative config for the context menu (alternative to the boolean toggle). */ export interface ContextMenuConfig { /** Replace the default items: a static array or a per-target callback. */ items?: ContextMenuItem[] | ((target: ContextMenuTarget) => ContextMenuItem[]); } /** Detail of {@link CONTEXT_MENU_OPENING_EVENT}: mutate `items` (or `preventDefault()`) to customize. */ export interface ContextMenuOpeningDetail { readonly target: ContextMenuTarget; items: ContextMenuItem[]; } /** What was right-clicked: a body cell (with its row) or a column header. */ export interface ContextMenuTarget { readonly kind: 'cell' | 'header'; readonly column: ColumnConfiguration; /** The row record (cell targets only). */ readonly row?: T; /** Row index within `pageItems` (cell targets only). */ readonly rowIndex?: number; } /** A single context-menu entry. Provide `submenu` for a nested menu, or `run` for a leaf. */ export interface ContextMenuItem { id: string; label: string; run?: (target: ContextMenuTarget) => void; disabled?: boolean; submenu?: ContextMenuItem[]; /** Render a divider before this item. */ separatorBefore?: boolean; } /** * Enterprise feature: a right-click **context menu** on cells and headers. Listens for `contextmenu` * (and Shift+F10 / the Menu key) on the grid host, resolves the target column/row from the event's * `composedPath()`, and shows a keyboard-navigable menu portaled to `document.body`. * * Default items: sort asc/desc/clear, pin start/end/unpin, hide column, and copy (cells). Override * via {@link items}. Opt in with `ApexGridEnterprise.use(contextMenuModule)` (the `/define` entry * includes it). */ export declare class ContextMenuController implements ReactiveController, ColumnMenuProvider { #private; private host; /** When `false`, the feature is inert. */ enabled: boolean; /** Replace the default items: a static array or a per-target callback. `null` = defaults. */ items: ContextMenuItem[] | ((target: ContextMenuTarget) => ContextMenuItem[]) | null; constructor(host: GridHost); hostConnected(): void; hostDisconnected(): void; /** * {@link ColumnMenuProvider}: tell the core header to show its kebab button * (on every column, not just sortable / resizable ones) whenever the context * menu is enabled, since the kebab opens this shared menu. */ providesColumnMenu(): boolean; /** The built-in items for a target. Exposed so a custom `items` callback can extend them. */ defaultItems(target: ContextMenuTarget): ContextMenuItem[]; } /** Feature module registered on the enterprise grid. */ export declare const contextMenuModule: GridFeatureModule;