API reference: @salmonui/data-grid/engine
SelectionPreviewinterface
import type { SelectionPreview } from '@salmonui/data-grid/engine';Also exported from @salmonui/data-grid/engine/selection.
interface SelectionPreview {
readonly scope: 'explicit' | 'allFiltered';
readonly changes: {
readonly rows: boolean;
readonly cells: boolean;
readonly columns: boolean;
};
readonly added: readonly RowId[];
readonly removed: readonly RowId[];
readonly selectedRowIds: readonly RowId[];
readonly excludedRowIds: readonly RowId[];
readonly cellRanges: readonly CellRange[];
readonly addedCells: readonly CellKey[];
readonly removedCells: readonly CellKey[];
readonly columnIds: readonly ColumnId[];
readonly addedColumns: readonly ColumnId[];
readonly removedColumns: readonly ColumnId[];
}
Proposed selection of a command (rows, cells and columns), computed without committing: before-events and controlled renderers. Parts the command leaves alone report the current selection with empty added / removed lists. Large fields are computed on first read; read them synchronously.
| Name | Signature | Description |
|---|---|---|
scope | readonly scope: 'explicit' | 'allFiltered'; | |
changes | readonly changes: {
readonly rows: boolean;
readonly cells: boolean;
readonly columns: boolean;
}; | Which parts of the selection the command changes. |
added | readonly added: readonly RowId[]; | Rows that become selected / deselected; computed on first read. |
removed | readonly removed: readonly RowId[]; | |
selectedRowIds | readonly selectedRowIds: readonly RowId[]; | Selected ids after the command; materialized on first read (O(selected)). Read synchronously. |
excludedRowIds | readonly excludedRowIds: readonly RowId[]; | Excluded ids when the scope is |
cellRanges | readonly cellRanges: readonly CellRange[]; | Cell ranges after the command. |
addedCells | readonly addedCells: readonly CellKey[]; | Cells (data rows, visible columns) that become selected / deselected; O(cells in the old and new ranges) on first read. |
removedCells | readonly removedCells: readonly CellKey[]; | |
columnIds | readonly columnIds: readonly ColumnId[]; | Selected column ids after the command. |
addedColumns | readonly addedColumns: readonly ColumnId[]; | |
removedColumns | readonly removedColumns: readonly ColumnId[]; |