@tanstack/react-table 8.5.1 → 8.5.4
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/table-core/build/esm/index.js +20 -7
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +20 -7
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +17 -17
- package/build/umd/index.development.js +20 -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 +2 -2
package/build/esm/index.js
CHANGED
|
@@ -2158,14 +2158,14 @@ const RowSelection = {
|
|
|
2158
2158
|
// return table.options.enableGroupingRowSelection ?? false
|
|
2159
2159
|
// },
|
|
2160
2160
|
getIsAllRowsSelected: () => {
|
|
2161
|
-
const
|
|
2161
|
+
const preGroupedFlatRows = table.getFilteredRowModel().flatRows;
|
|
2162
2162
|
const {
|
|
2163
2163
|
rowSelection
|
|
2164
2164
|
} = table.getState();
|
|
2165
|
-
let isAllRowsSelected = Boolean(
|
|
2165
|
+
let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);
|
|
2166
2166
|
|
|
2167
2167
|
if (isAllRowsSelected) {
|
|
2168
|
-
if (
|
|
2168
|
+
if (preGroupedFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
|
|
2169
2169
|
isAllRowsSelected = false;
|
|
2170
2170
|
}
|
|
2171
2171
|
}
|
|
@@ -2189,7 +2189,7 @@ const RowSelection = {
|
|
|
2189
2189
|
var _table$getState$rowSe;
|
|
2190
2190
|
|
|
2191
2191
|
const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
|
|
2192
|
-
return totalSelected > 0 && totalSelected < table.
|
|
2192
|
+
return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
|
|
2193
2193
|
},
|
|
2194
2194
|
getIsSomePageRowsSelected: () => {
|
|
2195
2195
|
const paginationFlatRows = table.getPaginationRowModel().flatRows;
|
|
@@ -2935,8 +2935,20 @@ function createTable(options) {
|
|
|
2935
2935
|
|
|
2936
2936
|
defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
|
|
2937
2937
|
return {
|
|
2938
|
-
header: props =>
|
|
2939
|
-
|
|
2938
|
+
header: props => {
|
|
2939
|
+
const resolvedColumnDef = props.header.column.columnDef;
|
|
2940
|
+
|
|
2941
|
+
if (resolvedColumnDef.accessorKey) {
|
|
2942
|
+
return resolvedColumnDef.accessorKey;
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
if (resolvedColumnDef.accessorFn) {
|
|
2946
|
+
return resolvedColumnDef.id;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
return null;
|
|
2950
|
+
},
|
|
2951
|
+
// footer: props => props.header.column.id,
|
|
2940
2952
|
cell: props => {
|
|
2941
2953
|
var _props$renderValue$to, _props$renderValue;
|
|
2942
2954
|
|
|
@@ -2964,7 +2976,8 @@ function createTable(options) {
|
|
|
2964
2976
|
|
|
2965
2977
|
return columnDefs.map(columnDef => {
|
|
2966
2978
|
const column = createColumn(table, columnDef, depth, parent);
|
|
2967
|
-
|
|
2979
|
+
const groupingColumnDef = columnDef;
|
|
2980
|
+
column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];
|
|
2968
2981
|
return column;
|
|
2969
2982
|
});
|
|
2970
2983
|
};
|