@tanstack/table-core 8.2.2 → 8.2.5
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/build/cjs/features/Expanding.js +1 -1
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/RowSelection.js +9 -3
- package/build/cjs/features/RowSelection.js.map +1 -1
- package/build/cjs/utils/getGroupedRowModel.js +14 -3
- package/build/cjs/utils/getGroupedRowModel.js.map +1 -1
- package/build/esm/index.js +24 -7
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +305 -305
- package/build/umd/index.development.js +24 -7
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/features/Expanding.ts +5 -3
- package/src/features/RowSelection.ts +7 -2
- package/src/utils/getGroupedRowModel.ts +16 -4
|
@@ -953,7 +953,7 @@
|
|
|
953
953
|
getCanExpand: () => {
|
|
954
954
|
var _table$options$getRow, _table$options$enable, _row$subRows;
|
|
955
955
|
|
|
956
|
-
return (
|
|
956
|
+
return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
957
957
|
},
|
|
958
958
|
getToggleExpandedHandler: () => {
|
|
959
959
|
const canExpand = row.getCanExpand();
|
|
@@ -1983,6 +1983,10 @@
|
|
|
1983
1983
|
|
|
1984
1984
|
if (value) {
|
|
1985
1985
|
preGroupedFlatRows.forEach(row => {
|
|
1986
|
+
if (!row.getCanSelect()) {
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1986
1990
|
rowSelection[row.id] = true;
|
|
1987
1991
|
});
|
|
1988
1992
|
} else {
|
|
@@ -2246,8 +2250,8 @@
|
|
|
2246
2250
|
const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
|
|
2247
2251
|
var _row$subRows;
|
|
2248
2252
|
|
|
2249
|
-
const row = table.getRow(id);
|
|
2250
|
-
|
|
2253
|
+
const row = table.getRow(id); // const isGrouped = row.getIsGrouped()
|
|
2254
|
+
// if ( // TODO: enforce grouping row selection rules
|
|
2251
2255
|
// !isGrouped ||
|
|
2252
2256
|
// (isGrouped && table.options.enableGroupingRowSelection)
|
|
2253
2257
|
// ) {
|
|
@@ -2257,7 +2261,9 @@
|
|
|
2257
2261
|
Object.keys(selectedRowIds).forEach(key => delete selectedRowIds[key]);
|
|
2258
2262
|
}
|
|
2259
2263
|
|
|
2260
|
-
|
|
2264
|
+
if (row.getCanSelect()) {
|
|
2265
|
+
selectedRowIds[id] = true;
|
|
2266
|
+
}
|
|
2261
2267
|
} else {
|
|
2262
2268
|
delete selectedRowIds[id];
|
|
2263
2269
|
} // }
|
|
@@ -3558,9 +3564,20 @@
|
|
|
3558
3564
|
depth = 0;
|
|
3559
3565
|
}
|
|
3560
3566
|
|
|
3561
|
-
//
|
|
3562
|
-
|
|
3563
|
-
|
|
3567
|
+
// Grouping depth has been been met
|
|
3568
|
+
// Stop grouping and simply rewrite thd depth and row relationships
|
|
3569
|
+
if (depth >= existingGrouping.length) {
|
|
3570
|
+
return rows.map(row => {
|
|
3571
|
+
row.depth = depth;
|
|
3572
|
+
groupedFlatRows.push(row);
|
|
3573
|
+
groupedRowsById[row.id] = row;
|
|
3574
|
+
|
|
3575
|
+
if (row.subRows) {
|
|
3576
|
+
row.subRows = groupUpRecursively(row.subRows, depth + 1);
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
return row;
|
|
3580
|
+
});
|
|
3564
3581
|
}
|
|
3565
3582
|
|
|
3566
3583
|
const columnId = existingGrouping[depth]; // Group the rows together for this level
|