@tanstack/react-table 8.5.6 → 8.5.9

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.
@@ -3797,8 +3797,13 @@ function groupBy(rows, columnId) {
3797
3797
 
3798
3798
  function getExpandedRowModel() {
3799
3799
  return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3800
- if (!rowModel.rows.length || // Do not expand if rows are not included in pagination
3801
- !paginateExpandedRows || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3800
+ if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3801
+ return rowModel;
3802
+ }
3803
+
3804
+ if (!paginateExpandedRows) {
3805
+ // Only expand rows at this point if they are being paginated
3806
+ console.log(rowModel.rows);
3802
3807
  return rowModel;
3803
3808
  }
3804
3809
 
@@ -3812,7 +3817,7 @@ function getExpandedRowModel() {
3812
3817
  }
3813
3818
  });
3814
3819
  }
3815
- function expandRows(rowModel, table) {
3820
+ function expandRows(rowModel) {
3816
3821
  const expandedRows = [];
3817
3822
 
3818
3823
  const handleRow = row => {
@@ -3834,7 +3839,7 @@ function expandRows(rowModel, table) {
3834
3839
  }
3835
3840
 
3836
3841
  function getPaginationRowModel(opts) {
3837
- return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel()], (pagination, rowModel) => {
3842
+ return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel(), table.options.paginateExpandedRows ? undefined : table.getState().expanded], (pagination, rowModel) => {
3838
3843
  if (!rowModel.rows.length) {
3839
3844
  return rowModel;
3840
3845
  }
@@ -3867,6 +3872,7 @@ function getPaginationRowModel(opts) {
3867
3872
  };
3868
3873
  }
3869
3874
 
3875
+ console.log(paginatedRowModel.rows);
3870
3876
  paginatedRowModel.flatRows = [];
3871
3877
 
3872
3878
  const handleRow = row => {