@tanstack/table-core 9.1.0 → 9.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,6 +85,8 @@ function _createSortedRowModel(table) {
85
85
  for (let i = 0; i < sortedData.length; i++) {
86
86
  const row = sortedData[i];
87
87
  if (row !== rows[i]) changed = true;
88
+ const flatIndex = sortedFlatRows.length;
89
+ sortedFlatRows.push(row);
88
90
  if (row.subRows.length) {
89
91
  const sortedSubRows = sortData(row.subRows);
90
92
  if (sortedSubRows.changed) {
@@ -92,10 +94,10 @@ function _createSortedRowModel(table) {
92
94
  copyInstancePropertiesWithoutMemos(cloned, row);
93
95
  cloned.subRows = sortedSubRows.rows;
94
96
  sortedData[i] = cloned;
95
- sortedFlatRows.push(cloned);
97
+ sortedFlatRows[flatIndex] = cloned;
96
98
  changed = true;
97
- } else sortedFlatRows.push(row);
98
- } else sortedFlatRows.push(row);
99
+ }
100
+ }
99
101
  }
100
102
  return {
101
103
  rows: sortedData,
@@ -63,7 +63,7 @@ function createWorkerRowModel(tableWorker, stage) {
63
63
  if (upstream === stage) break;
64
64
  if (table.options.features[`${upstream}RowModel`] && !bridge.results[upstream]) warnOnce(`This table has a ${upstream}RowModel, but the worker result for '${stage}' was computed without an offloaded '${upstream}' stage, so it is bypassed. Offload it too with createWorkerRowModel(tableWorker, '${upstream}').`);
65
65
  }
66
- return rebuildRowModel(table, payload, stage !== "filtered");
66
+ return rebuildRowModel(table, payload, stage);
67
67
  }
68
68
  });
69
69
  return () => {
@@ -9,8 +9,10 @@ function collectLeafRows(subRows, out) {
9
9
  else collectLeafRows(row.subRows, out);
10
10
  }
11
11
  }
12
- function rebuildRowModel(table, payload, resetDepths) {
12
+ function rebuildRowModel(table, payload, stage) {
13
13
  const core = table.getCoreRowModel();
14
+ const resetDepths = stage !== "filtered";
15
+ const flattenParentsFirst = stage === "sorted";
14
16
  if (payload.kind === "flat") {
15
17
  const { indices } = payload;
16
18
  const rows = new Array(indices.length);
@@ -42,6 +44,8 @@ function rebuildRowModel(table, payload, resetDepths) {
42
44
  rows[i] = row;
43
45
  continue;
44
46
  }
47
+ const flatIndex = flattenParentsFirst ? flatRows.length : -1;
48
+ if (flattenParentsFirst) flatRows.push(void 0);
45
49
  const subRows = rebuildRows(node.children, depth + 1, node.id);
46
50
  const leafRows = [];
47
51
  collectLeafRows(subRows, leafRows);
@@ -54,7 +58,8 @@ function rebuildRowModel(table, payload, resetDepths) {
54
58
  leafRows,
55
59
  getValue: (columnId) => hasOwn(aggregates, columnId) ? aggregates[columnId] : void 0
56
60
  });
57
- flatRows.push(row);
61
+ if (flattenParentsFirst) flatRows[flatIndex] = row;
62
+ else flatRows.push(row);
58
63
  rowsById[node.id] = row;
59
64
  rows[i] = row;
60
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/table-core",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "description": "Headless UI for building powerful tables & datagrids for TS/JS.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -3,7 +3,7 @@ name: aggregation
3
3
  description: >
4
4
  Aggregate TanStack Table columns independently of grouping, including grand totals, caller-selected row totals, multiple keyed aggregations, custom context-based definitions, grouped merges, manual values, and worker constraints.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features']
8
8
  sources:
9
9
  - 'TanStack/table:docs/guide/aggregation.md'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.1.0'
8
+ library_version: '9.1.1'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:packages/table-core/src/index.ts'
@@ -3,7 +3,7 @@ name: cell-selection
3
3
  description: >
4
4
  Select, add, and subtract rectangular cell ranges with cellSelectionFeature: ordered include/exclude operations keyed by row and column id, modifier dragging, final positive bounds, selection edges, render-order resolution under pinning, and autoResetCellSelection. Load for spreadsheet-style selection, “select all except” behavior, unexpected range changes after sorting or reordering, drag performance, or copy-to-clipboard.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/cell-selection.md'
@@ -3,7 +3,7 @@ name: cell-spanning
3
3
  description: >
4
4
  Merge adjacent body cells with cellSpanningFeature: value-based rowSpan opt-in per column via spanRows, per-row colSpan via spanColumns, and the covered-cell convention where a span of 0 means skip the cell. Load for merged data grids, spans that disappear after sorting or paginating, ragged table rows, or a cell that unexpectedly merges down the whole tbody.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/cell-spanning.md'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.1.0'
8
+ library_version: '9.1.1'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/row-models.md'
@@ -3,7 +3,7 @@ name: column-faceting
3
3
  description: >
4
4
  Build faceted filter UIs with columnFacetingFeature, facetedRowModel, facetedUniqueValues, and facetedMinMaxValues. Load for facet counts, numeric ranges, own-filter exclusion, or server-page facet completeness.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'column-filtering']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/column-faceting.md'
@@ -3,7 +3,7 @@ name: column-filtering
3
3
  description: >
4
4
  Filter columns with columnFilteringFeature, filteredRowModel, filterFns, filterMeta, nested-row direction, and manualFiltering. Load for accessor compatibility, controlled filter updaters, fuzzy metadata, or client/server ownership.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'client-vs-server']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/column-filtering.md'
@@ -3,7 +3,7 @@ name: column-ordering
3
3
  description: >
4
4
  Control TanStack Table v9 leaf columnOrder with stable IDs while accounting for pinning regions, visibility, and groupedColumnMode precedence. Load for drag-and-drop columns or rendered order that differs from state.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/column-ordering.md'
@@ -3,7 +3,7 @@ name: column-pinning
3
3
  description: >
4
4
  Pin columns into logical start, center, and end regions with columnPinningFeature and renderer-owned sticky CSS. Load for RTL offsets, z-index, backgrounds, overflow, widths, gaps, or overlaps.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'column-sizing']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/column-pinning.md'
@@ -3,7 +3,7 @@ name: column-resizing
3
3
  description: >
4
4
  Wire columnResizingFeature, header.getResizeHandler, resize mode and direction, pointer or touch events, and performant CSS-variable updates. Load when resize state changes but widths do not, or large tables resize slowly.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'column-sizing']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/column-resizing.md'
@@ -3,7 +3,7 @@ name: column-sizing
3
3
  description: >
4
4
  Use columnSizingFeature numeric size, minSize, maxSize, getSize, getStart, getAfter, and total-size APIs in table, grid, or flex CSS. Load for auto or percentage misconceptions and sizing/pinning layout mismatch.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/column-sizing.md'
@@ -3,7 +3,7 @@ name: column-visibility
3
3
  description: >
4
4
  Hide columns with columnVisibilityFeature while rendering visibility-aware header, column, and cell collections. Load when hidden columns remain in the DOM, false-versus-absent state is confused, or enableHiding is misunderstood.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/column-visibility.md'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: core
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.1.0'
8
+ library_version: '9.1.1'
9
9
  sources:
10
10
  - 'TanStack/table:docs/overview.md'
11
11
  - 'TanStack/table:docs/guide/tables.md'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.1.0'
8
+ library_version: '9.1.1'
9
9
  requires: ['core', 'table-features', 'typescript']
10
10
  sources:
11
11
  - 'TanStack/table:docs/framework/react/guide/custom-features.md'
@@ -3,7 +3,7 @@ name: expanding
3
3
  description: >
4
4
  Expand hierarchical subrows or custom detail panels with rowExpandingFeature, expandedRowModel, getSubRows, getRowCanExpand, manualExpanding, and paginateExpandedRows. Load when expansion state changes but no UI appears.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'client-vs-server']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/expanding.md'
@@ -3,7 +3,7 @@ name: global-filtering
3
3
  description: >
4
4
  Apply globalFilter across eligible columns with globalFilteringFeature, columnFilteringFeature, filteredRowModel, globalFilterFn, and manual server filtering. Load when columns unexpectedly participate or a global filter changes state without changing rows.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'client-vs-server', 'column-filtering']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/global-filtering.md'
@@ -3,7 +3,7 @@ name: grouping
3
3
  description: >
4
4
  Group rows with columnGroupingFeature, groupedRowModel, groupedColumnMode, and manualGrouping. Load for grouped or placeholder cells and grouping interactions with expansion or pagination.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'client-vs-server']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/grouping.md'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: lifecycle
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.1.0'
8
+ library_version: '9.1.1'
9
9
  requires: ['core', 'table-features', 'typescript']
10
10
  sources:
11
11
  - 'TanStack/table:docs/framework/react/guide/migrating.md'
@@ -3,7 +3,7 @@ name: pagination
3
3
  description: >
4
4
  Paginate with rowPaginationFeature and paginatedRowModel or manualPagination. Load for pageIndex/pageSize state, rowCount/pageCount, unknown next-page limits, already-paginated server data, or autoResetPageIndex surprises.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'client-vs-server']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/pagination.md'
@@ -3,7 +3,7 @@ name: row-pinning
3
3
  description: >
4
4
  Pin stable row IDs into top, center, and bottom collections with rowPinningFeature and keepPinnedRows. Load for filtering/pagination visibility, explicit region rendering, or renderer-owned sticky CSS.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/row-pinning.md'
@@ -3,7 +3,7 @@ name: row-selection
3
3
  description: >
4
4
  Maintain rowSelection ID state with stable getRowId, single, multi, subrow, and Shift-range rules, selected row models, handler anchors, and manual-pagination semantics. Load when implementing getToggleSelectedHandler, enableRowRangeSelection, selectChildren, deselectParents, or selected IDs that outlive loaded Row objects.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/row-selection.md'
@@ -3,7 +3,7 @@ name: sorting
3
3
  description: >
4
4
  Sort with rowSortingFeature, sortedRowModel, sortFns, multi-sort and removal options, sortUndefined, and manualSorting. Load for comparator direction, incoming server order, or product-specific sorting cycles.
5
5
  metadata:
6
- { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.0' }
6
+ { type: sub-skill, library: '@tanstack/table-core', library_version: '9.1.1' }
7
7
  requires: ['core', 'table-features', 'client-vs-server']
8
8
  sources:
9
9
  - 'TanStack/table:docs/framework/react/guide/sorting.md'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.1.0'
8
+ library_version: '9.1.1'
9
9
  requires: ['core']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/row-models.md'
@@ -5,7 +5,7 @@ description: >
5
5
  metadata:
6
6
  type: sub-skill
7
7
  library: '@tanstack/table-core'
8
- library_version: '9.1.0'
8
+ library_version: '9.1.1'
9
9
  requires: ['core', 'table-features']
10
10
  sources:
11
11
  - 'TanStack/table:docs/guide/helpers.md'