@sheetwrite/coretype
Static rows or a context-aware factory evaluated each time the menu opens.
- Package
@sheetwrite/core- Source
packages/core/src/types/grid.ts#L201
Declaration
export type ContextMenuItems = | readonly ContextMenuIteminterface ContextMenuItem {
id?: string;
action?: ContextMenuActionName;
onClick?: (grid: Grid, cell: CellAddress | null) => void;
label?: string;
shortcut?: string;
visible?: boolean | ((context: ContextMenuContext) => boolean);
disabled?: boolean | ((context: ContextMenuContext) => boolean);
}interface ContextMenuItem {
id?: string;
action?: ContextMenuActionName;
onClick?: (grid: Grid, cell: CellAddress | null) => void;
label?: string;
shortcut?: string;
visible?: boolean | ((context: ContextMenuContext) => boolean);
disabled?: boolean | ((context: ContextMenuContext) => boolean);
}interface ContextMenuItem {
id?: string;
action?: ContextMenuActionName;
onClick?: (
grid: Grid,
cell: CellAddress | null,
) => void;
label?: string;
shortcut?: string;
visible?:
| boolean
| ((
context: ContextMenuContext,
) => boolean);
disabled?:
| boolean
| ((
context: ContextMenuContext,
) => boolean);
}Built-in, separator, or custom callback row in the right-click menu.API reference →[] | ((context: ContextMenuContextinterface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}interface ContextMenuContext {
readonly cell: CellAddress | null;
readonly clientX: number;
readonly clientY: number;
}Cell and viewport coordinates resolved for one bundled context-menu opening.API reference →) => readonly ContextMenuIteminterface ContextMenuItem {
id?: string;
action?: ContextMenuActionName;
onClick?: (grid: Grid, cell: CellAddress | null) => void;
label?: string;
shortcut?: string;
visible?: boolean | ((context: ContextMenuContext) => boolean);
disabled?: boolean | ((context: ContextMenuContext) => boolean);
}interface ContextMenuItem {
id?: string;
action?: ContextMenuActionName;
onClick?: (grid: Grid, cell: CellAddress | null) => void;
label?: string;
shortcut?: string;
visible?: boolean | ((context: ContextMenuContext) => boolean);
disabled?: boolean | ((context: ContextMenuContext) => boolean);
}interface ContextMenuItem {
id?: string;
action?: ContextMenuActionName;
onClick?: (
grid: Grid,
cell: CellAddress | null,
) => void;
label?: string;
shortcut?: string;
visible?:
| boolean
| ((
context: ContextMenuContext,
) => boolean);
disabled?:
| boolean
| ((
context: ContextMenuContext,
) => boolean);
}Built-in, separator, or custom callback row in the right-click menu.API reference →[]);