@tanstack/react-table 8.5.0 → 8.5.3
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 +23 -7
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +23 -7
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +18 -18
- package/build/umd/index.development.js +23 -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
|
@@ -1302,8 +1302,11 @@ const Filters = {
|
|
|
1302
1302
|
table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
|
|
1303
1303
|
},
|
|
1304
1304
|
getPreFilteredRowModel: () => table.getCoreRowModel(),
|
|
1305
|
-
_getFilteredRowModel: table.options.getFilteredRowModel && table.options.getFilteredRowModel(table),
|
|
1306
1305
|
getFilteredRowModel: () => {
|
|
1306
|
+
if (!table._getFilteredRowModel && table.options.getFilteredRowModel) {
|
|
1307
|
+
table._getFilteredRowModel = table.options.getFilteredRowModel(table);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1307
1310
|
if (table.options.manualFiltering || !table._getFilteredRowModel) {
|
|
1308
1311
|
return table.getPreFilteredRowModel();
|
|
1309
1312
|
}
|
|
@@ -2157,14 +2160,14 @@ const RowSelection = {
|
|
|
2157
2160
|
// return table.options.enableGroupingRowSelection ?? false
|
|
2158
2161
|
// },
|
|
2159
2162
|
getIsAllRowsSelected: () => {
|
|
2160
|
-
const
|
|
2163
|
+
const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows;
|
|
2161
2164
|
const {
|
|
2162
2165
|
rowSelection
|
|
2163
2166
|
} = table.getState();
|
|
2164
|
-
let isAllRowsSelected = Boolean(
|
|
2167
|
+
let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);
|
|
2165
2168
|
|
|
2166
2169
|
if (isAllRowsSelected) {
|
|
2167
|
-
if (
|
|
2170
|
+
if (preGroupedFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
|
|
2168
2171
|
isAllRowsSelected = false;
|
|
2169
2172
|
}
|
|
2170
2173
|
}
|
|
@@ -2934,8 +2937,20 @@ function createTable(options) {
|
|
|
2934
2937
|
|
|
2935
2938
|
defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
|
|
2936
2939
|
return {
|
|
2937
|
-
header: props =>
|
|
2938
|
-
|
|
2940
|
+
header: props => {
|
|
2941
|
+
const resolvedColumnDef = props.header.column.columnDef;
|
|
2942
|
+
|
|
2943
|
+
if (resolvedColumnDef.accessorKey) {
|
|
2944
|
+
return resolvedColumnDef.accessorKey;
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
if (resolvedColumnDef.accessorFn) {
|
|
2948
|
+
return resolvedColumnDef.id;
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
return null;
|
|
2952
|
+
},
|
|
2953
|
+
// footer: props => props.header.column.id,
|
|
2939
2954
|
cell: props => {
|
|
2940
2955
|
var _props$renderValue$to, _props$renderValue;
|
|
2941
2956
|
|
|
@@ -2963,7 +2978,8 @@ function createTable(options) {
|
|
|
2963
2978
|
|
|
2964
2979
|
return columnDefs.map(columnDef => {
|
|
2965
2980
|
const column = createColumn(table, columnDef, depth, parent);
|
|
2966
|
-
|
|
2981
|
+
const groupingColumnDef = columnDef;
|
|
2982
|
+
column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];
|
|
2967
2983
|
return column;
|
|
2968
2984
|
});
|
|
2969
2985
|
};
|