@tanstack/react-table 8.0.0-beta.4 → 8.0.0-beta.5

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.
@@ -2669,7 +2669,7 @@ var drawChart = (function (exports) {
2669
2669
  </script>
2670
2670
  <script>
2671
2671
  /*<!--*/
2672
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"50f7-127"},{"name":"react-table/src/index.tsx","uid":"50f7-129"}]}]}],"isRoot":true},"nodeParts":{"50f7-127":{"renderedLength":138364,"gzipLength":23596,"brotliLength":0,"mainUid":"50f7-126"},"50f7-129":{"renderedLength":2135,"gzipLength":854,"brotliLength":0,"mainUid":"50f7-128"}},"nodeMetas":{"50f7-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"50f7-127"},"imported":[],"importedBy":[{"uid":"50f7-128"}]},"50f7-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"50f7-129"},"imported":[{"uid":"50f7-130"},{"uid":"50f7-126"}],"importedBy":[],"isEntry":true},"50f7-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"50f7-128"}],"isExternal":true}},"env":{"rollup":"2.70.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
2672
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"8d24-127"},{"name":"react-table/src/index.tsx","uid":"8d24-129"}]}]}],"isRoot":true},"nodeParts":{"8d24-127":{"renderedLength":138784,"gzipLength":23663,"brotliLength":0,"mainUid":"8d24-126"},"8d24-129":{"renderedLength":2135,"gzipLength":854,"brotliLength":0,"mainUid":"8d24-128"}},"nodeMetas":{"8d24-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"8d24-127"},"imported":[],"importedBy":[{"uid":"8d24-128"}]},"8d24-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"8d24-129"},"imported":[{"uid":"8d24-130"},{"uid":"8d24-126"}],"importedBy":[],"isEntry":true},"8d24-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"8d24-128"}],"isExternal":true}},"env":{"rollup":"2.70.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
2673
2673
 
2674
2674
  const run = () => {
2675
2675
  const width = window.innerWidth;
@@ -11,11 +11,11 @@
11
11
  "children": [
12
12
  {
13
13
  "name": "table-core/build/esm/index.js",
14
- "uid": "50f7-132"
14
+ "uid": "8d24-132"
15
15
  },
16
16
  {
17
17
  "name": "react-table/src/index.tsx",
18
- "uid": "50f7-134"
18
+ "uid": "8d24-134"
19
19
  }
20
20
  ]
21
21
  }
@@ -25,55 +25,55 @@
25
25
  "isRoot": true
26
26
  },
27
27
  "nodeParts": {
28
- "50f7-132": {
29
- "renderedLength": 138364,
30
- "gzipLength": 23596,
28
+ "8d24-132": {
29
+ "renderedLength": 138784,
30
+ "gzipLength": 23663,
31
31
  "brotliLength": 0,
32
- "mainUid": "50f7-131"
32
+ "mainUid": "8d24-131"
33
33
  },
34
- "50f7-134": {
34
+ "8d24-134": {
35
35
  "renderedLength": 2135,
36
36
  "gzipLength": 854,
37
37
  "brotliLength": 0,
38
- "mainUid": "50f7-133"
38
+ "mainUid": "8d24-133"
39
39
  }
40
40
  },
41
41
  "nodeMetas": {
42
- "50f7-131": {
42
+ "8d24-131": {
43
43
  "id": "/packages/table-core/build/esm/index.js",
44
44
  "moduleParts": {
45
- "index.production.js": "50f7-132"
45
+ "index.production.js": "8d24-132"
46
46
  },
47
47
  "imported": [],
48
48
  "importedBy": [
49
49
  {
50
- "uid": "50f7-133"
50
+ "uid": "8d24-133"
51
51
  }
52
52
  ]
53
53
  },
54
- "50f7-133": {
54
+ "8d24-133": {
55
55
  "id": "/packages/react-table/src/index.tsx",
56
56
  "moduleParts": {
57
- "index.production.js": "50f7-134"
57
+ "index.production.js": "8d24-134"
58
58
  },
59
59
  "imported": [
60
60
  {
61
- "uid": "50f7-135"
61
+ "uid": "8d24-135"
62
62
  },
63
63
  {
64
- "uid": "50f7-131"
64
+ "uid": "8d24-131"
65
65
  }
66
66
  ],
67
67
  "importedBy": [],
68
68
  "isEntry": true
69
69
  },
70
- "50f7-135": {
70
+ "8d24-135": {
71
71
  "id": "react",
72
72
  "moduleParts": {},
73
73
  "imported": [],
74
74
  "importedBy": [
75
75
  {
76
- "uid": "50f7-133"
76
+ "uid": "8d24-133"
77
77
  }
78
78
  ],
79
79
  "isExternal": true
@@ -2052,11 +2052,11 @@
2052
2052
  });
2053
2053
  },
2054
2054
  toggleAllPageRowsSelected: value => instance.setRowSelection(old => {
2055
- typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
2055
+ const resolvedValue = typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
2056
2056
  const rowSelection = { ...old
2057
2057
  };
2058
2058
  instance.getRowModel().rows.forEach(row => {
2059
- mutateRowIsSelected(rowSelection, row.id, value, instance);
2059
+ mutateRowIsSelected(rowSelection, row.id, resolvedValue, instance);
2060
2060
  });
2061
2061
  return rowSelection;
2062
2062
  }),
@@ -2211,7 +2211,7 @@
2211
2211
  },
2212
2212
  getIsSomePageRowsSelected: () => {
2213
2213
  const paginationFlatRows = instance.getPaginationRowModel().flatRows;
2214
- return instance.getIsAllPageRowsSelected() ? false : !!(paginationFlatRows != null && paginationFlatRows.length);
2214
+ return instance.getIsAllPageRowsSelected() ? false : paginationFlatRows.some(d => d.getIsSelected() || d.getIsSomeSelected());
2215
2215
  },
2216
2216
  getToggleAllRowsSelectedHandler: () => {
2217
2217
  return e => {
@@ -3847,20 +3847,34 @@
3847
3847
  const pageStart = pageSize * pageIndex;
3848
3848
  const pageEnd = pageStart + pageSize;
3849
3849
  rows = rows.slice(pageStart, pageEnd);
3850
+ let paginatedRowModel;
3850
3851
 
3851
3852
  if (!instance.options.paginateExpandedRows) {
3852
- return expandRows({
3853
+ paginatedRowModel = expandRows({
3853
3854
  rows,
3854
3855
  flatRows,
3855
3856
  rowsById
3856
3857
  });
3858
+ } else {
3859
+ paginatedRowModel = {
3860
+ rows,
3861
+ flatRows,
3862
+ rowsById
3863
+ };
3857
3864
  }
3858
3865
 
3859
- return {
3860
- rows,
3861
- flatRows,
3862
- rowsById
3866
+ paginatedRowModel.flatRows = [];
3867
+
3868
+ const handleRow = row => {
3869
+ paginatedRowModel.flatRows.push(row);
3870
+
3871
+ if (row.subRows.length) {
3872
+ row.subRows.forEach(handleRow);
3873
+ }
3863
3874
  };
3875
+
3876
+ paginatedRowModel.rows.forEach(handleRow);
3877
+ return paginatedRowModel;
3864
3878
  }, {
3865
3879
  key: 'getPaginationRowModel',
3866
3880
  debug: () => {