本文へ移動

@eightkk/vue-weave / core / projectTreeGridRows

Function: projectTreeGridRows() ​

projectTreeGridRows<R>(input, state): TreeGridViewProjection<R>

Defined in: src/core/treeGrid.ts:1282

Project TreeGrid rows for a header sort and column filters, keeping the hierarchy. A row matches when it meets every filter: text must occur, ignoring case and surrounding whitespace, in the cell text the grid shows (treeGridCellText; the row label for timelineLabelColumnId), and values must list the cell's raw string or number value (the row label for the tree column); a cell without a value meets no condition. Matching rows stay with all their ancestors. Siblings are then sorted within their parent by the rules in order: a column compares cell values (numbers as numbers, booleans as 0 and 1, anything else as text), timelineLabelColumnId compares row labels and a registered sortRules entry uses its function; cells without a value sort after the others in both directions, and ties keep the input order. The proposals of TreeGrid's update:sort and update:filters apply directly. Unknown filter columns and sort rules are reported as diagnostics and ignored. Validates the input like createTreeGridIndex and throws a TypeError or RangeError for a malformed state. Never changes its arguments; iterative, so deep trees do not overflow the stack.

Type Parameters ​

R ​

R extends TreeGridRow<unknown>

Parameters ​

input ​

TreeGridViewInput<R>

state ​

TreeGridViewState

Returns ​

TreeGridViewProjection<R>

MIT ライセンスで公開しています。