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