@tanstack/table-core 9.0.0-beta.59 → 9.0.0-beta.61
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.
- package/dist/core/row-models/createCoreRowModel.js +16 -16
- package/dist/core/rows/coreRowsFeature.utils.js +1 -1
- package/package.json +1 -1
- package/skills/aggregation/SKILL.md +1 -1
- package/skills/api-not-found/SKILL.md +1 -1
- package/skills/cell-selection/SKILL.md +1 -1
- package/skills/client-vs-server/SKILL.md +1 -1
- package/skills/column-faceting/SKILL.md +1 -1
- package/skills/column-filtering/SKILL.md +1 -1
- package/skills/column-ordering/SKILL.md +1 -1
- package/skills/column-pinning/SKILL.md +1 -1
- package/skills/column-resizing/SKILL.md +1 -1
- package/skills/column-sizing/SKILL.md +1 -1
- package/skills/column-visibility/SKILL.md +1 -1
- package/skills/core/SKILL.md +1 -1
- package/skills/custom-features/SKILL.md +1 -1
- package/skills/expanding/SKILL.md +1 -1
- package/skills/global-filtering/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +1 -1
- package/skills/migrate-v8-to-v9/SKILL.md +1 -1
- package/skills/pagination/SKILL.md +1 -1
- package/skills/row-pinning/SKILL.md +1 -1
- package/skills/row-selection/SKILL.md +1 -1
- package/skills/sorting/SKILL.md +1 -1
- package/skills/table-features/SKILL.md +1 -1
- package/skills/typescript/SKILL.md +1 -1
|
@@ -24,28 +24,28 @@ function createCoreRowModel() {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
+
function accessRows(table, rowModel, originalRows, depth = 0, parentRow) {
|
|
28
|
+
const rows = [];
|
|
29
|
+
for (let i = 0; i < originalRows.length; i++) {
|
|
30
|
+
const originalRow = originalRows[i];
|
|
31
|
+
const row = constructRow(table, table.getRowId(originalRow, i, parentRow), originalRow, i, depth, void 0, parentRow?.id);
|
|
32
|
+
rowModel.flatRows.push(row);
|
|
33
|
+
rowModel.rowsById[row.id] = row;
|
|
34
|
+
rows.push(row);
|
|
35
|
+
if (table.options.getSubRows) {
|
|
36
|
+
row.originalSubRows = table.options.getSubRows(originalRow, i);
|
|
37
|
+
if (row.originalSubRows?.length) row.subRows = accessRows(table, rowModel, row.originalSubRows, depth + 1, row);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return rows;
|
|
41
|
+
}
|
|
27
42
|
function _createCoreRowModel(table, data) {
|
|
28
43
|
const rowModel = {
|
|
29
44
|
rows: [],
|
|
30
45
|
flatRows: [],
|
|
31
46
|
rowsById: makeObjectMap()
|
|
32
47
|
};
|
|
33
|
-
|
|
34
|
-
const rows = [];
|
|
35
|
-
for (let i = 0; i < originalRows.length; i++) {
|
|
36
|
-
const originalRow = originalRows[i];
|
|
37
|
-
const row = constructRow(table, table.getRowId(originalRow, i, parentRow), originalRow, i, depth, void 0, parentRow?.id);
|
|
38
|
-
rowModel.flatRows.push(row);
|
|
39
|
-
rowModel.rowsById[row.id] = row;
|
|
40
|
-
rows.push(row);
|
|
41
|
-
if (table.options.getSubRows) {
|
|
42
|
-
row.originalSubRows = table.options.getSubRows(originalRow, i);
|
|
43
|
-
if (row.originalSubRows?.length) row.subRows = accessRows(row.originalSubRows, depth + 1, row);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return rows;
|
|
47
|
-
};
|
|
48
|
-
rowModel.rows = accessRows(data);
|
|
48
|
+
rowModel.rows = accessRows(table, rowModel, data);
|
|
49
49
|
return rowModel;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -205,7 +205,7 @@ function row_getAllCellsByColumnId(row) {
|
|
|
205
205
|
* ```
|
|
206
206
|
*/
|
|
207
207
|
function table_getRowId(originalRow, table, index, parent) {
|
|
208
|
-
return table.options.getRowId?.(originalRow, index, parent) ??
|
|
208
|
+
return table.options.getRowId?.(originalRow, index, parent) ?? (parent ? `${parent.id}.${index}` : String(index));
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* Looks up a row by id from the current or full row model.
|
package/package.json
CHANGED
package/skills/core/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
metadata:
|
|
6
6
|
type: sub-skill
|
|
7
7
|
library: '@tanstack/table-core'
|
|
8
|
-
library_version: '9.0.0-beta.
|
|
8
|
+
library_version: '9.0.0-beta.61'
|
|
9
9
|
requires: ['core', 'table-features', 'typescript']
|
|
10
10
|
sources:
|
|
11
11
|
- 'TanStack/table:docs/framework/react/guide/custom-features.md'
|
package/skills/grouping/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
metadata:
|
|
6
6
|
type: lifecycle
|
|
7
7
|
library: '@tanstack/table-core'
|
|
8
|
-
library_version: '9.0.0-beta.
|
|
8
|
+
library_version: '9.0.0-beta.61'
|
|
9
9
|
requires: ['core', 'table-features', 'typescript']
|
|
10
10
|
sources:
|
|
11
11
|
- 'TanStack/table:docs/framework/react/guide/migrating.md'
|
package/skills/sorting/SKILL.md
CHANGED