View as Markdown

API reference

@salmonui/data-grid/engine

444 exported symbols: 53 functions, 173 interfaces, 207 types and 11 constants. Each name links its page with the signature, docs and members.

import { … } from '@salmonui/data-grid/engine';

Functions

  • clampColumnWidthClamps a px width to the column's minWidth/maxWidth (and at least 1px).
  • columnZoneCurrent freeze zone of a visible leaf in a column snapshot (center for unknown or hidden ids).
  • compilePatternCompiles like (% / = any sequence) or wildcard ( = any sequence, ? = one character) into an anchored RegExp.
  • computeRangeVisible range for a scroll offset and viewport extent, widened by overscan items on each side. Works for rows and columns.
  • createAggregatesModuleCreates the aggregates module. Options come from options.aggregates (AggregatesOptions); the initial descriptors from options.defaultQuery.aggregates.
  • createColumnMetrics
  • createDataGridApi
  • createDataGridEngineCreates a framework-agnostic DataGrid engine. Features are modules; without modules the engine compiles columns, holds rows, and runs an empty pipeline.
  • createDataGridQueryBuilds a complete, deeply frozen DataQuery from a partial one.
  • createFilterModuleCreates the filter module. Options are read from options.filter (FilterOptions); initial filters from options.defaultQuery.filters. Create one module instance…
  • createFixedRowMetricsO(1) metrics for the fixed row height fast path.
  • createFocusModuleCreates the focus module. Options are read from options.focus (FocusOptions); the initial direction is the grid direction option.
  • createGroupingModuleCreates the grouping module. Options come from options.grouping (GroupingOptions); the initial grouping from options.defaultQuery.grouping. Register createSort…
  • createKeymapCompiles the binding table for one platform. User bindings replace the combos of their command; a user combo that a built-in binding also uses in the same cont…
  • createLocalDataSourceIn-memory data source (mode: 'local'). Rows are held by reference and the array is treated as immutable: every change produces a new array and one event. The e…
  • createPagingModuleCreates the paging module. Options are read from options.paging (PagingOptions); options.defaultQuery.paging sets the initial page.
  • createRowModelHelper for stage authors: a model over the same source with a new visible order (source indices).
  • createScrollMapping
  • createSearchModuleCreates the search module. Options are read from options.search (SearchOptions); options.defaultQuery.search sets the initial search.
  • createSelectionApiSelection methods over an engine with the selection module (spread into the DataGrid API).
  • createSelectionModuleCreates the selection module. Options are read from options.selection (SelectionOptions).
  • createSortModuleCreates the sort module. Options are read from options.sort (SortOptions); the initial sort comes from options.defaultQuery.sorting.
  • createVariableRowMetricsBuilds variable row metrics in O(n) from a height function.
  • dataRowCountNumber of data rows a model covers (excludes synthetic rows of a view).
  • declaredZoneFreeze zone of a column from its definition and the runtime overrides (count shorthand excluded).
  • defineDataGridModuleIdentity helper that keeps the module name, command union, and methods as literal types for the façade.
  • deserializeDataGridQueryInverse of serializeDataGridQuery. Throws on malformed input.
  • effectiveSortKeysEffective sort keys: grouped columns first (direction from the sort list, else the group descriptor, else ascending), then the remaining sort descriptors. Unkn…
  • filtersNarrowTrue when every row passing next also passes prev, so next can run over the previous result.
  • findColumnLeaf column by column id, else the first leaf with that field.
  • fitColumnWidthsExpands column widths proportionally so that their sum reaches target. Columns are never shrunk: when the widths already reach target the input widths are retu…
  • getColumnFiltersTop-level conditions on one column (filter bar / menu state for renderers).
  • getSortInfoPer-column header state for renderers: direction and 1-based priority, or null.
  • getSourceIndexSource index of the row at a visible index, or -1 (also for synthetic rows such as group captions).
  • groupTargetKeyNormalizes a group target to its path key.
  • isColumnVisible
  • isJsonValueTrue when value survives a JSON round trip unchanged: null, booleans, finite numbers, strings, arrays, and plain objects of those. undefined is allowed only as…
  • keyComboFromEventCanonical combo of a key event. Letters are read from code when Alt is held (macOS Option produces composed characters: Alt+J is ∆) and from key otherwise, so…
  • normalizeFilterOperatorCanonical built-in operator for a name (case-insensitive).
  • normalizeKeyComboCanonical combo string: modifiers in Ctrl+Meta+Alt+Shift order, then the key. Mod resolves to Meta on macOS and Ctrl elsewhere; Cmd/Command mean Meta, Control…
  • orderLeavesLeaves in runtime order: the explicit order first, then the remaining leaves in definition order.
  • orderModulesDependency order, then registration order. Throws on duplicates, missing dependencies, and cycles.
  • previewColumnsCommandPure dry run of a columns.* command: the state it would produce, or null when it would be rejected. Renderers use it to report proposed values before the engin…
  • resolveColumnKeysResolves column keys (by id, field, or header text) to leaf column ids.
  • resolveColumnWidthResolves a column width to pixels. Percent widths need the container width. Returns null for auto (measured by the renderer) or when a percent width has no con…
  • rowIdFromKeyBuilds a getRowId from a primary key: a field name, several field names (joined with \u001f), or a function. The React DataGrid uses it for primaryKey columns.
  • sameRange
  • searchColumnsColumns a search descriptor reads, in leaf order.
  • searchRowOrderRows of base (null = identity over rows) matching the search in any column.
  • serializeDataGridQueryDeterministic serialization of a query: sorted object keys, array order preserved, local-only custom aggregate functions dropped. Equal queries produce equal s…
  • shallowEqualShallow equality for selector results: Object.is, or same keys/items with Object.is values.
  • sortRowOrderStable multi-key sort of order (source indexes; null = identity over rows). Returns a new array; the input is never written.
  • visibleColumnIndexDisplay position of a column among the visible leaves (left zone, center, right zone), or -1.

Interfaces

Types

Constants