View as Markdown

API reference: @salmonui/data-grid/engine

ColumnSnapshotinterface

import type { ColumnSnapshot } from '@salmonui/data-grid/engine';
interface ColumnSnapshot<Row> {
    readonly tree: readonly CompiledColumn<Row>[];
    readonly leaves: readonly CompiledColumn<Row>[];
    readonly zones: ReadonlyMap<ColumnId, 'left' | 'center' | 'right'>;
    readonly visible: readonly CompiledColumn<Row>[];
    readonly left: readonly CompiledColumn<Row>[];
    readonly center: readonly CompiledColumn<Row>[];
    readonly right: readonly CompiledColumn<Row>[];
    readonly fixed: readonly CompiledColumn<Row>[];
    readonly byId: ReadonlyMap<ColumnId, CompiledColumn<Row>>;
    readonly headerRowCount: number;
}
ColumnSnapshot members (10)
NameSignatureDescription
treereadonly tree: readonly CompiledColumn<Row>[];

Every node of the header tree, depth-first, groups before their children.

leavesreadonly leaves: readonly CompiledColumn<Row>[];

Leaf (data) columns in definition order, including hidden ones (identity is stable across reorder).

zonesreadonly zones: ReadonlyMap<ColumnId, 'left' | 'center' | 'right'>;

Runtime freeze zone of every visible leaf (definition pinned, runtime pin/unpin, and frozenColumns counts).

visiblereadonly visible: readonly CompiledColumn<Row>[];

Visible leaves in runtime order: left zone, center, right zone.

leftreadonly left: readonly CompiledColumn<Row>[];
centerreadonly center: readonly CompiledColumn<Row>[];
rightreadonly right: readonly CompiledColumn<Row>[];
fixedreadonly fixed: readonly CompiledColumn<Row>[];

Center leaves in the fixed zone (pinned: 'center'), in runtime order: a subset of center, so visible order, keyboard order and aria-colindex stay the visual order. Empty (a shared frozen array) when no column is fixed.

byIdreadonly byId: ReadonlyMap<ColumnId, CompiledColumn<Row>>;
headerRowCountreadonly headerRowCount: number;

Number of header rows (tree depth).