@tanstack/react-table 8.5.2 → 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.
@@ -2158,14 +2158,14 @@ const RowSelection = {
2158
2158
  // return table.options.enableGroupingRowSelection ?? false
2159
2159
  // },
2160
2160
  getIsAllRowsSelected: () => {
2161
- const preFilteredFlatRows = table.getPreFilteredRowModel().flatRows;
2161
+ const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows;
2162
2162
  const {
2163
2163
  rowSelection
2164
2164
  } = table.getState();
2165
- let isAllRowsSelected = Boolean(preFilteredFlatRows.length && Object.keys(rowSelection).length);
2165
+ let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);
2166
2166
 
2167
2167
  if (isAllRowsSelected) {
2168
- if (preFilteredFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
2168
+ if (preGroupedFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
2169
2169
  isAllRowsSelected = false;
2170
2170
  }
2171
2171
  }
@@ -2976,7 +2976,8 @@ function createTable(options) {
2976
2976
 
2977
2977
  return columnDefs.map(columnDef => {
2978
2978
  const column = createColumn(table, columnDef, depth, parent);
2979
- column.columns = columnDef.columns ? recurseColumns(columnDef.columns, column, depth + 1) : [];
2979
+ const groupingColumnDef = columnDef;
2980
+ column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];
2980
2981
  return column;
2981
2982
  });
2982
2983
  };