API reference: @salmonui/data-grid/engine
GroupingModuletype
import type { GroupingModule } from '@salmonui/data-grid/engine';Also exported from @salmonui/data-grid/engine/grouping.
type GroupingModule<Row> = DataGridModule<Row, GroupingState, GroupingCommand, 'grouping', GroupingMethods<Row>>;
| Name | Signature | Description |
|---|---|---|
nameinherited | name: "grouping"; | |
dependenciesoptionalinherited | dependencies?: readonly string[]; | Validated at engine creation. |
inSnapshotoptionalinherited | inSnapshot?: boolean; | When true (default) the slice lives in |
commandsinherited | commands: readonly ("grouping.clear" | "grouping.collapseAll" | "grouping.expandAll" | "grouping.groupBy" | "grouping.loadMore" | "grouping.loaded" | "grouping.move" | "grouping.retry" | "grouping.set" | ... 5 more ... | "grouping.ungroup")[]; | Declared, validated, serializable. Every type must start with |
initialStateinherited | initialState: (options: DataGridOptions<Row>) => GroupingState; | |
reduceoptionalinherited | reduce?: ((state: GroupingState, command: GroupingCommand, ctx: ModuleContext<Row>) => CommandRejection | GroupingState); | |
extendColumnsoptionalinherited | extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]); | |
extendQueryoptionalinherited | extendQuery?: ((query: DataQuery, state: GroupingState) => DataQuery); | |
pipelineoptionalinherited | pipeline?: readonly PipelineStage<Row, GroupingState>[]; | |
selectorsoptionalinherited | selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>; | |
methodsoptionalinherited | methods?: GroupingMethods<Row>; | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
notifyoptionalinherited | notify?: ((previous: GroupingState, next: GroupingState, ctx: ModuleContext<Row>) => NotificationScope); | |
hiddenColumnsoptionalinherited | hiddenColumns?: ((state: GroupingState) => readonly string[]); | Leaf columns this module hides from the visible column set (grouped columns with |
interceptReadoptionalinherited | interceptRead?: ((query: DataQuery, state: GroupingState, ctx: ModuleContext<Row>) => boolean); | Remote sources only: return true to serve the main read of |
onQueryChangeoptionalinherited | onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void); | Called after the effective query changed (sort, filter, search, page,
group). Runs inside the dispatch of the command that changed it; may
dispatch commands through |
onConnectoptionalinherited | onConnect?: ((ctx: ModuleContext<Row>) => void); |
|
onSourceEventoptionalinherited | onSourceEvent?: ((event: DataSourceEvent<Row>, state: GroupingState, ctx: ModuleContext<Row>) => boolean); | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
disposeoptionalinherited | dispose?: (() => void); |