Skip to content

TreeGrid ​

TreeGrid shows a tree of rows against columns: a product hierarchy against attributes and warehouses, a bill of materials against plants, or a WBS against periods. Rows and columns are virtualized together, so thousands of rows and dozens of columns stay fast, and the ARIA treegrid keys reach every cell. Cells come from a column's value(row) or from a sparse cells list, and a cell can state that it has no value, an unknown value, or one that is not loaded yet.

It is an opt-in, controlled component. Expansion, the active cell, cell edits, spreadsheet batches and row structure changes are events (update:expandedIds, cell-edit, sheet-edit, row-create, …) that your code applies, for example with applyTreeGridEdits. Children can be loaded on demand through expand-request.

Minimal example ​

vue
<script setup lang="ts">
import { ref } from 'vue'
import { TreeGrid, type TreeGridColumn, type TreeGridRow } from '@eightkk/vue-weave'
import '@eightkk/vue-weave/style.css'

type Part = TreeGridRow<{ quantity: number }>
const rows: Part[] = [
  { id: 'bike', label: 'Bicycle', data: { quantity: 1 } },
  { id: 'frame', parentId: 'bike', label: 'Frame', data: { quantity: 1 } },
  { id: 'wheel', parentId: 'bike', label: 'Wheel', data: { quantity: 2 } },
]
const columns: TreeGridColumn<Part>[] = [
  { id: 'quantity', label: 'Quantity', width: 120, value: row => row.data?.quantity },
]
const expanded = ref(['bike'])
</script>

<template>
  <TreeGrid v-model:expanded-ids="expanded" :rows="rows" :columns="columns" :height="240" />
</template>

Examples: Tree grid, Bill of materials. Guide: Tree grids, matrices and bills of materials. Types: TreeGridRow, TreeGridColumn, TreeGridExposed.

TreeGrid ​

An opt-in controlled component that unifies a tree grid and a matrix: a tree of rows against columns, for example a product hierarchy against attributes and warehouses, or a bill of materials against plants. The tree column is the sticky row header; the other columns are field columns, which read each row through value(row), or sparse columns, which read the cells list. Rows and columns are virtualized together. The grid never changes its data: expansion, the active cell, cell edits, spreadsheet batches and row structure changes are events, and the parent applies them (see the "Tree grid" demo).

Rows are positions, entities are what they show. A row's id identifies one position in the tree. What it stands for goes in entities (EntityRef[], as in Linked views), and the same entity may appear in several rows, such as one part used in two assemblies. Activation reports entities, and matchTreeGridEntities marks every row and cell that lists one of the given entities, so an entity highlight shows all of its usages.

PropType / defaultMeaning
rowsreadonly R[] (R extends TreeGridRow) / requiredID, optional parentId, label, optional detail, entities, childStatus (WindowedCellStatus) and data. Array order is sibling order. R is inferred
columnsreadonly TreeGridColumn<R>[] / requiredID, label, width (pixels, finite and positive) and optionally value(row) (a field column), missingCell, align (start, center, end; numbers default to end), editor, editable (boolean or (row) => boolean, default true) and update(row, value)
cellsreadonly TreeGridCell[] / undefinedSparse cells of the columns without value: rowId, columnId, and value (string, number or boolean) or status, plus optional label, tone, entities and editable: false
missingCellempty, none, unknown or not-applicable / emptyWhat a cell that the data does not list means; a column's own missingCell wins
expandedIdsreadonly string[] / undefinedControlled expanded rows; supports v-model:expanded-ids. Compared by value
activeCellTreeGridPosition / undefinedControlled active cell ({ rowId, columnId?, status? }: no columnId is the row header, status: true the status line under the row); supports v-model:active-cell. The grid moves it itself and reports each move; setting it moves the focus stop
selectedRowIdsreadonly string[] or ReadonlySet / undefinedSelected rows (aria-selected, vw-is-selected). Display only
highlightedRowIds, highlightedCellsreadonly string[] or ReadonlySet, readonly TreeGridCellRef[] / undefinedDisplay-only highlights for linked views (vw-is-highlighted)
formatValue(value, { row, column }) => string / undefinedCell text. Default: the cell label, booleans as labels.yes and labels.no, the editor's format, else the value as text
rowHeight, headerHeight, treeColumnWidthnumber / 32, 36, 240Fixed line height, header height and tree column width in pixels
heightnumber or CSS length / 400Height of the scroll viewport
initialWidthnumber / 960Viewport width assumed before mounting, so server rendering emits a bounded column window
overscan, columnOverscannumber / 6, 2Lines and columns rendered beyond each edge of the viewport
labelsPartial<TreeGridLabels> / EnglishEvery user-visible string and accessible name (treeGridDefaultLabels lists them)
dirChartDirection / ltrrtl puts the tree column on the right and swaps ArrowLeft and ArrowRight; auto follows the inherited direction
editable, validateCellEditboolean / false, TreeGridCellEditValidator / undefinedCell editing in the columns that have an editor; see Editing
spreadsheet, validateSheetEdit, maxSheetCellsboolean / false, TreeGridSheetEditValidator / undefined, number / 10000Range selection, copy, cut, paste, clear and fill down
rowsEditable, validateRowCreate, validateRowDelete, validateRowMoveboolean / false, validators / undefinedRow create, delete and move proposals; see Row structure
columnsResizable, minColumnWidth, maxColumnWidth, validateColumnResizeboolean / false, number / 48, number / 800, ColumnResizeValidator / undefinedResize separators on the tree column and each column header that propose new widths; see Column widths, sorting and filtering
sortableColumns, sortboolean or readonly string[] / undefined, readonly TimelineViewSort[] / undefinedHeader sort buttons that propose the next sort through update:sort (v-model:sort); see the same section
filterableColumns, filtersboolean or readonly string[] / undefined, readonly TimelineViewFilter[] / undefinedHeader filter buttons with a small dialog that propose column filters through update:filters (v-model:filters); see the same section
EventPayloadMeaning
update:expandedIdsstring[]A toggle, ArrowRight or ArrowLeft proposes the new expanded IDs
expand-requestrowIdA row whose childStatus is unloaded or failed was expanded, or Enter or a click was used on its status line: load its children and update childStatus
update:activeCellTreeGridPositionThe active cell moved, or followed its row to the nearest displayed ancestor after a collapse or a data change
row-activate, cell-activateTreeGridActivationClick or Enter on a row header or a cell: rowId, columnId (cells only), entities (the cell's, else the row's) and source (pointer or keyboard). Enter on an editable cell starts editing instead
cell-edit, cell-edit-rejectedTreeGridCellEdit, (change, reason)A cell proposal and its rejection by validateCellEdit
sheet-edit, sheet-edit-rejectedTreeGridSheetEdit, (change, reason)A spreadsheet batch and its rejection (validateSheetEdit, a value its editor cannot read, or a paste that does not fit; a batch rejected before it was built has empty edits)
edit-cancelTreeGridEditCancelAn open editor (kind: 'cell'), a fill handle drag (fill) or a row drag (row-move) ended without a proposal: reason is escape, source-changed (new rows, columns or cells, or a change of editable, spreadsheet or rowsEditable), hidden (the edited row is no longer displayed), blur (the editor lost focus with a value that could not be proposed), pointer-cancel or api
row-create, row-delete, row-moveTreeGridRowCreate, TreeGridRowDelete, TimelineRowMoveRow structure proposals, each with a -rejected event (change, reason)
column-resize, column-resize-rejectedTimelineColumnResize, (change, reason)A column width proposal (columnsResizable) and its rejection by validateColumnResize
update:sort, update:filtersTimelineViewSort[], TimelineViewFilter[]Header sort and filter proposals (sortableColumns, filterableColumns)
validation-errorErrorInvalid rows, columns or cells (the errors of createTreeGridIndex). The grid renders its empty state and the error is rethrown, as in the other components

Slots are cell({ row, column, cell, text, active, highlighted }) with the resolved TreeGridCellView, row-header({ row, line, active, highlighted, selected }) (after the expand toggle), status({ row, status, text }) for the status line of children that are not loaded, and empty(). Keep slot content non-interactive: the cells take the focus. Methods are focusCell(position), revealRow(rowId, { focus?, columnId? }) (a RevealResult: revealed, hidden-by-collapse with the nearest displayed ancestor as proxyId, or unknown), startEdit(position?), cancelEdit(), copySelection() (the range as tab-separated text), pasteText(text), and exportSvg(options?) and exportPng(options?) (see Export to SVG and PNG). The public component type is TreeGridComponent, and TreeGridExposed<R> types a template ref.

Cell states. A resolved cell has a state: value (any value, including 0, false and ''), empty (blank), none (known to have no value), unknown, not-applicable, or the load states unloaded, loading and failed. A sparse cell with a status shows the status; a column accessor returns a value, a TreeGridCellContent, null for none or undefined for a missing cell. The default rendering shows a short mark (labels.noneMark "–", unknownMark "?", notApplicableMark "n/a", unloadedMark "·", loadingMark "…", failedMark "!") with the full word for screen readers, and the cell gets vw-is-<state>.

Lazy children. childStatus unloaded, loading or failed makes a row expandable without child rows. While it is expanded, a status line follows its loaded children, with the status text (labels.unloaded, loading, failed) in a role="status" element, and the row has aria-busy while loading. loaded and loaded-empty without children make the row a leaf. Pair it with useWindowedData or your own loader.

Markup and keyboard. The scroll viewport is the treegrid, named labels.grid, with aria-rowcount (displayed lines plus the header) and aria-colcount; each line is a row with aria-rowindex, aria-level, aria-setsize, aria-posinset and, on expandable rows, aria-expanded. The tree column cells are rowheaders named by the row label (with detail as aria-description), the other cells gridcells. One cell holds the roving tab stop. The keys follow the ARIA treegrid pattern in cell focus mode: arrows move one cell; in the tree column the arrow towards the cells expands a collapsed row and otherwise moves into the row, and the other arrow collapses an expanded row and otherwise moves to the parent; Home and End go to the first and last cell of the line, Ctrl (or Cmd) with them to the first and last cell of the grid; PageUp and PageDown move by a page; Enter activates. Focus reaches every cell, also outside the rendered window: the grid scrolls to it.

Virtualization. Only the lines in the viewport plus overscan and the columns in it plus columnOverscan are rendered, from fixed line heights and the cumulative column widths (a binary search per scroll). Elements are keyed by their slot in the window, so a scroll patches them in place. The active line and, inside it, the active column are rendered in elements of their own between the keyed lists of the window, so they stay rendered outside the window and are never moved or removed by a scroll, a keyboard move, an expansion or an edit: the focused element keeps the focus. Validation and indexing still process the whole input.

Tree grid editing ​

With editable, the cells of columns that have an editor can be edited, unless the column's editable predicate or the cell's editable: false says otherwise. An editor is a TimelineFieldSpec without id and get (TreeGridEditor), so values are read and checked by the same parseFieldValue and validateFieldValue as GanttChart's typed fields: text, number (min, max, integer), select (choices; drawn as a select), checkbox (booleans: Enter, Space or F2 toggles at once) and time for dates and times (utcOffsetMinutes, timeZone, or a custom parse and format such as a date-only format). Multiple selection is not supported.

  • Start: Enter or F2 (the current text, selected), typing a character (replaces the text with it) or a double-click. Commit: Enter (then down; Shift+Enter up), Tab (then right; Shift+Tab left) or moving the focus elsewhere. Cancel: Escape, which returns the focus to the cell and reports edit-cancel with escape.
  • The editor is named Edit <column> for <row> (labels.edit, labels.for). A value its editor cannot read, and a proposal that validateCellEdit rejects (cell-edit-rejected), keep the editor open with the reason below it (aria-invalid, aria-describedby) and announced in the live region. An unchanged value proposes nothing.
  • While an IME composition is in progress (compositionstart to compositionend, or isComposing), Enter, Escape and Tab belong to the input method; the edit commits once, on the Enter after the composition.
  • A change of rows, columns or cells while an editor is open cancels it (source-changed); collapsing its row cancels it with hidden.
  • Apply a cell-edit with applyTreeGridEdits({ rows, columns, cells }, [change]): a field column's update(row, after) returns the new row, and a sparse cell gets the value (after: null removes it). It returns new rows and cells for one history entry.

With spreadsheet, Shift with an arrow, Shift+click or a pointer drag over cells selects a rectangular range (aria-selected on its cells, vw-is-in-range); Escape or a plain arrow ends it. The range covers data columns only.

  • Copy (Ctrl+C, the native copy event) writes the range as tab-separated text (CRLF between lines) in the editors' formats; cut also proposes clearing it.
  • Paste (the native paste event, or pasteText) proposes the pasted values from the range's top-left cell; a single value fills the whole range. Every value is parsed by its column's editor, status lines are skipped, and cells that cannot be edited keep their value. A paste that reaches past the last line or column, or holds more than maxSheetCells cells, is rejected as a whole (labels.pasteTooLarge), as is one with a value its editor cannot read. The paste is computed from the model, so it reaches lines and columns that are not rendered.
  • Delete or Backspace proposes clearing the range (after: null), Ctrl+D (Cmd+D) fills the range down from its first line, and the fill handle at the range's corner (vw-tree-grid-fill-handle, pointer only) drags the range down and fills the new lines with the range's lines, repeated. Escape, cancelEdit() and a data change cancel a fill drag (edit-cancel, kind: 'fill').
  • Each operation is one sheet-edit ({ action: 'paste' | 'fill' | 'clear' | 'cut', edits, source }), checked by validateSheetEdit as a whole; apply it with applyTreeGridEdits({ rows, columns, cells }, change.edits). Unchanged cells are left out, and nothing is proposed when nothing changes.

Tree grid row structure ​

With rowsEditable, the row headers propose structure changes. A row header describes the keys (labels.rowMoveHint), and the active row's header shows three buttons: Add row below <row>, Add child row to <row> and Delete <row> (labels.addBelow, addChild, deleteRow).

  • Create. Ctrl+Enter (Cmd+Enter) proposes a sibling after the row, Ctrl+Shift+Enter a child (as its last child). row-create carries parentId, index (the sibling position), referenceId, placement (before, after or child) and source; the parent creates the row with its own ID: insertTreeGridRow(rows, change, newRow). treeGridRowCreate(rows, id, placement) builds the same proposal.
  • Delete. Delete proposes row-delete with ids and includeDescendants: true. deleteTreeGridRows({ rows, cells }, change) removes the rows (with their descendants, or with includeDescendants: false moving the children up into the deleted row's place) and their sparse cells.
  • Move. The keys are GanttChart's row move keys: Alt+ArrowUp and Alt+ArrowDown move the row among its siblings, Alt+Shift with the arrow towards the cells indents it (it becomes the last child of its previous sibling) and the other arrow outdents it (after its parent); in right-to-left grids the arrows swap. A pointer drag of a row header (4 px threshold, auto-scroll at the viewport edges) shows a drop indicator: the upper quarter of a line places the row before it, the lower quarter after it (as the first child when its children are shown), and the middle inside it as its last child (vw-is-drop-inside); the live region announces the place ("Move Bolt into Frame"). Places in the dragged row's own subtree, and the row's own place, are never offered. row-move is a TimelineRowMove; apply it with moveTimelineRow(rows, change.id, change.after). Escape, pointer cancellation and a data change cancel a drag (edit-cancel, kind: 'row-move').
  • Each proposal is checked by its synchronous validator first (validateRowCreate, validateRowDelete, validateRowMove; true or nothing accepts, false or a reason rejects, a blank reason rejects with the default text). A rejection emits the -rejected event and announces the reason.
ts
import { applyTreeGridEdits, deleteTreeGridRows, insertTreeGridRow, moveTimelineRow, useEditHistory } from '@eightkk/vue-weave'

const history = useEditHistory({ rows: initialRows, cells: initialCells })
const commit = (next: Partial<typeof history.state.value>) => history.commit({ ...history.state.value, ...next })
const onCellEdit = (change: TreeGridCellEdit) => commit(applyTreeGridEdits({ ...history.state.value, columns }, [change]))
const onSheetEdit = (change: TreeGridSheetEdit) => commit(applyTreeGridEdits({ ...history.state.value, columns }, change.edits))
const onRowCreate = (change: TreeGridRowCreate) => commit({ rows: insertTreeGridRow(history.state.value.rows, change, { id: crypto.randomUUID(), label: 'New row' }) })
const onRowDelete = (change: TreeGridRowDelete) => commit(deleteTreeGridRows(history.state.value, change))
const onRowMove = (change: TimelineRowMove) => commit({ rows: moveTimelineRow(history.state.value.rows, change.id, change.after) })
// <TreeGrid v-model:expanded-ids="expanded" :rows="history.state.value.rows" :cells="history.state.value.cells" :columns="columns"
//   editable spreadsheet rows-editable @cell-edit="onCellEdit" @sheet-edit="onSheetEdit" @row-create="onRowCreate"
//   @row-delete="onRowDelete" @row-move="onRowMove" />

Tree grid column widths, sorting and filtering ​

Opt-in with columnsResizable, sortableColumns and filterableColumns; they work like GanttChart's Column resizing and Header sorting and filtering, with the same payloads. Without them the header markup, names and events are unchanged. The grid stays controlled: it previews a separator drag and proposes widths, shows the sort and filters props and proposes changes, and never resizes, reorders or filters anything itself. The tree column's ID in proposals, sort rules, filters and option lists is timelineLabelColumnId ('$label'), which no column may use while one of these options is on.

APIBehavior
Header cellsWith one of the options, the header cells are keyed by column, so a focused control stays with its column while the columns scroll. A header with a control or separator is named by its label alone (aria-label), and one with sort or filter controls gets vw-header-controls. The header controls are tabbable and outside the grid's roving focus: keys in them do not move the active cell, and new rows from an applied sort or filter do not take the focus from them. Option lists may name only timelineLabelColumnId and column IDs; an unknown ID, a minColumnWidth that is not finite and positive, or a maxColumnWidth below it is reported through validation-error. A valid grid without lines keeps its header with these options, as GanttChart does, so a filter that matches nothing can be edited or cleared in place: an open filter dialog stays open with the focus and text of its box, the sort buttons and separators keep working, and the empty text (labels.empty or the empty slot) is the second row of the grid (aria-rowindex="2", aria-rowcount="2"), under the header. Without the options, and for invalid data, the grid shows its single-row empty state as before.
columnsResizableA separator (vw-column-resize, role="separator", aria-orientation="vertical", focusable) on the inline-end edge of the tree column header and of each column header, named labels.resizeColumn ("Resize column") and the column label, with aria-valuenow (the width), aria-valuemin and aria-valuemax (minColumnWidth and maxColumnWidth, defaults 48 and 800). ArrowRight and ArrowLeft move the edge 10 px on screen (40 px with Shift; ArrowLeft widens in right-to-left grids), Home proposes the minimum and End the maximum. A pointer drag previews the width in the header and the cells and proposes it on release (source: 'pointer'); Escape, pointer cancellation, lost capture and a change of rows, columns, cells, treeColumnWidth, the limits, columnsResizable or dir cancel it without a proposal.
column-resize(change)TimelineColumnResize: id (the column ID, or timelineLabelColumnId for the tree column), before, after (whole pixels within the limits) and source. Accept it by setting the column's width, or treeColumnWidth. An unchanged width is not proposed. validateColumnResize rejects with false (labels.columnResizeRejected, "This column resize was rejected.") or a reason: column-resize-rejected(change, reason), announced in the live region.
Sort buttonvw-column-sort, named labels.sortBy ("Sort by") and the column label, with labels.sortedAscending or labels.sortedDescending in parentheses when sort has a rule for the column ("Sort by Budget (descending)"), and the ▲ or ▼ glyph (vw-is-sorted). The column header of the first rule has aria-sort ascending or descending; sortable headers without a rule have none. Click, Enter or Space proposes nextTimelineSort(sort, columnId) through update:sort: a new rule comes first, ascending; an ascending rule turns descending; a descending rule is removed.
Filter button and dialogvw-column-filter (aria-haspopup="dialog", aria-expanded), named labels.filterBy ("Filter") and the column label, plus labels.filtered in parentheses while the column has a filter (vw-is-active). It opens a dialog (vw-column-filter-popover) under the header with a text box (labels.filterContains, "Contains"), for a column whose editor is a select of texts or numbers a group of checkboxes (labels.filterValues, "Show values"), and a labels.clearFilter button. Typing or toggling proposes update:filters at once (composed text once, when the composition ends), and the controls show the applied filters again afterwards. Escape closes it and returns focus to the button; a press or focus outside the header cell closes it. It never renders on the server.
update:sort(sort), update:filters(filters)TimelineViewSort[] and TimelineViewFilter[], as GanttChart proposes them.

Apply the proposals with projectTreeGridRows({ rows, columns, cells }, { sort, filters }): it keeps the rows that match every filter with all their ancestors, sorts siblings within their parent, and returns the rows and the cells of the kept rows for the grid. Edits still apply to the full data. With a sort or filter applied, the sibling positions of row-create and row-move refer to the displayed siblings, so turn rowsEditable off or map the positions while a view is applied.

ts
import { projectTreeGridRows, timelineLabelColumnId, type TimelineColumnResize, type TimelineViewFilter, type TimelineViewSort } from '@eightkk/vue-weave/core'

const sort = ref<TimelineViewSort[]>([])
const filters = ref<TimelineViewFilter[]>([])
const treeWidth = ref(240)
const view = computed(() => projectTreeGridRows({ rows: rows.value, columns: columns.value, cells: cells.value }, { sort: sort.value, filters: filters.value }))
function onColumnResize(change: TimelineColumnResize) {
  if (change.id === timelineLabelColumnId) treeWidth.value = change.after
  else columns.value = columns.value.map(column => column.id === change.id ? { ...column, width: change.after } : column)
}
// <TreeGrid :rows="view.rows" :cells="view.cells" :columns="columns" :tree-column-width="treeWidth" columns-resizable
//   sortable-columns filterable-columns v-model:sort="sort" v-model:filters="filters" @column-resize="onColumnResize" />

The CSS classes are GanttChart's (vw-column-resize, vw-header-controls, vw-column-sort, vw-column-title, vw-sort-indicator, vw-column-filter, vw-column-filter-popover, vw-column-filter-text, vw-column-filter-values, vw-column-filter-clear); they use the existing theme variables, add no new one, and the separators and filter controls are hidden in print.

Tree grid helpers ​

These functions are part of @eightkk/vue-weave/core and do not need Vue.

FunctionResult
createTreeGridIndex({ rows, columns, cells?, missingCell? })The validated TreeGridIndex. Throws like createTimelineRowTree with (tree grid rows) appended (Invalid row ID, Duplicate row ID, Unknown parent for row, cycles), Invalid column ID, Duplicate column ID, a RangeError for a width that is not finite and positive or an unknown missingCell or childStatus, a TypeError for a value, update or editable of the wrong type, and for cells Unknown row in tree grid cell: <id>, Unknown column in tree grid cell: <id>, Duplicate tree grid cell: <row> / <column>, an Error for a cell in a field column or one with neither value nor status, a RangeError for a non-finite number or an unknown status and a TypeError for another value type. Entities need non-empty string kinds and IDs
flattenTreeGrid(index, expandedIds)TreeGridLines: the displayed lines (kind row or status, row, level, expandable, expanded, posinset, setsize, parent, status), and rowLine and statusLine maps. Iterative
findTreeGridLine(index, lines, position), treeGridPositionAt(index, lines, cursor)The line of a position (or of its nearest displayed ancestor, exact: false), and the position of a line and column
treeGridColumnOffsets(columns), treeGridColumnAt(offsets, x), treeGridRowWindow(options), treeGridColumnWindow(offsets, options)Cumulative widths, the column at an offset (binary search) and the [start, end) windows for a scroll position with overscan
treeGridKeyAction(key, cursor, { lines, columnCount, pageSize, rtl? })What a treegrid key does: move, expand, collapse or activate
resolveTreeGridCell(index, rowId, columnId), treeGridCellValue(...), isTreeGridCellEditable(...), treeGridFieldSpec(column)The TreeGridCellView of a cell, its field value (null without a value), whether it can be edited, and the field spec of a column's editor
matchTreeGridEntities(input or index, entities){ rowIds, cells }: every row and cell that lists one of the entities
treeGridCellsFromTimeBuckets(cells) / treeGridCellContentFromTimeBucket(cell, extra?)TreeGrid cells from aggregateTimeBuckets cells: a loaded value stays a value (a sum of nothing is 0), a loaded bucket without a value is none, and unloaded, loading and failed keep their status. extra (label, tone, entities, editable) is added to cells with a value
treeGridRangeBounds(range), treeGridRangeText(index, lines, range)The bounds of a range and its tab-separated text
buildTreeGridPaste(index, lines, range, text, { maxCells?, source? }), buildTreeGridClear(...), buildTreeGridFill(index, lines, range, { source?, origin?, maxCells? })The edits of a paste, clear or fill, or { ok: false, reason: 'too-large' or 'invalid', error, cell? }
applyTreeGridEdits({ rows, columns, cells? }, edits)New { rows, cells }; unchanged rows and cells keep their identity
treeGridRowCreate(rows, id, placement), insertTreeGridRow(rows, change, row)A create proposal, and the rows (in tree preorder) with the new row in place
deleteTreeGridRows({ rows, cells? }, { ids, includeDescendants })New { rows, cells } without the deleted rows
treeGridRowMoveForKey(key, rows, id, rtl?), treeGridDropAt(index, lines, id, line, fraction)The target of a row move key ('ignore' for other keys, undefined when the row cannot move) and the drop place of a row drag
treeGridCellText(index, rowId, columnId, { formatValue?, labels? })The text the default rendering shows in a cell with a value (its label, formatValue, labels.yes or labels.no for booleans without an editor format, the editor's format, else the value as text); '' for a cell without a value
projectTreeGridRows({ rows, columns, cells?, missingCell?, sortRules?, formatValue?, labels? }, { sort?, filters? })TreeGridViewProjection: the kept rows (matches with all their ancestors; the input's row objects), their cells, matchedRowIds and diagnostics. A filter's text must occur, ignoring case, in the shown cell text (treeGridCellText; the row label for timelineLabelColumnId), and its values must list the cell's raw string or number value; a cell without a value meets no condition. Siblings are sorted stably within their parent: numbers as numbers, booleans as 0 and 1, anything else as text, cells without a value last in both directions; timelineLabelColumnId compares row labels and an own sortRules entry with the rule's ID wins (inherited members such as constructor are not rules). Unknown columns and rules become unknown-column and unknown-sort-rule diagnostics. Validates like createTreeGridIndex, throws a TypeError or RangeError for a malformed state, never changes its input and is iterative

Released under the MIT License.