import { DataGrid } from '@lumino/datagrid'; import { DataModel } from '@lumino/datagrid'; import { CommandRegistry } from '@lumino/commands'; import { Menu } from '@lumino/widgets'; /** * An object which provides context menus for the data grid. * * #### Notes * This item creates one Menu widget, then changes it's items based on * the `cellClick` signal from `DataGrid`. */ export declare abstract class GridContextMenu { /** * Construct a new grid context menu. * * @param options - The options for initializing the context menu. */ constructor(options: GridContextMenu.IOptions); /** * Opens the context menu in response to the `cellClick` signal of the * data grid. * * @param grid - The "sender" of the signal. * * @param hit - The "value" of the signal. */ abstract open(grid: DataGrid, hit: DataGrid.HitTestResult): void; /** * The menu widget which displays the relevant context items. */ protected readonly _menu: Menu; } /** * The namespace for the `GridContextMenu` class statics. */ export declare namespace GridContextMenu { /** * An options object for initializing a data grid. */ interface IOptions { /** * The data grid the context menu should be attached to. */ grid: DataGrid; /** * The command registry to use with the context menu. */ commands: CommandRegistry; /** * The custom renderer to use to render menu items. */ renderer?: Menu.Renderer; } } /** * An WIP object which provides context menus for the data grid. * * #### Notes * This is primarily here for demo purposes to demonstrate how we may want to * manage context menus. */ export declare class FeatherGridContextMenu extends GridContextMenu { /** * Opens the context menu in response to the `cellClick` signal of the * data grid. * * @param grid - The "sender" of the signal. * * @param hit - The "value" of the signal. */ open(grid: DataGrid, hit: DataGrid.HitTestResult): void; } /** * The namespace for the `IPyDataGridContextMenu` class statics. */ export declare namespace FeatherGridContextMenu { /** * An options object for initializing a context menu. */ interface IOptions { /** * The data grid to listen to clicks on. */ grid: DataGrid; /** * The command registry used by the menu. */ commands: CommandRegistry; } /** * Command ID strings for the IpyDataGridContextMenu. */ enum CommandID { SortAscending = "sort:Asc", SortDescending = "sort:Desc", SortClear = "sort:Clear", OpenFilterByConditionDialog = "filterCondition:openDialog", OpenFilterByValueDialog = "filterValue:openDialog", RevertGrid = "grid:reset", ClearThisFilter = "filter:clearCurrentColumn", ClearFiltersInAllColumns = "filter:clearAllColumns", CopyToClipboard = "copyToClipboard", CopySelectionToClipboard = "copySelectionToClipboard", SaveSelectionAsCsv = "saveSelectionAsCsv", SaveAllAsCsv = "saveAllAsCsv", ClearSelection = "clearSelection" } /** * Arguments to be provided to a command for execution. */ type CommandArgs = { region: DataModel.CellRegion; rowIndex: number; columnIndex: number; clientX: number; clientY: number; }; }