@tanstack/vue-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-149"},{"name":"vue-table/src","children":[{"uid":"50f7-151","name":"merge-proxy.ts"},{"uid":"50f7-153","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"50f7-149":{"renderedLength":138364,"gzipLength":23596,"brotliLength":0,"mainUid":"50f7-148"},"50f7-151":{"renderedLength":1622,"gzipLength":660,"brotliLength":0,"mainUid":"50f7-150"},"50f7-153":{"renderedLength":1807,"gzipLength":709,"brotliLength":0,"mainUid":"50f7-152"}},"nodeMetas":{"50f7-148":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"50f7-149"},"imported":[],"importedBy":[{"uid":"50f7-152"}]},"50f7-150":{"id":"/packages/vue-table/src/merge-proxy.ts","moduleParts":{"index.production.js":"50f7-151"},"imported":[],"importedBy":[{"uid":"50f7-152"}]},"50f7-152":{"id":"/packages/vue-table/src/index.ts","moduleParts":{"index.production.js":"50f7-153"},"imported":[{"uid":"50f7-148"},{"uid":"50f7-154"},{"uid":"50f7-150"}],"importedBy":[],"isEntry":true},"50f7-154":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"50f7-152"}],"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-149"},{"name":"vue-table/src","children":[{"uid":"8d24-151","name":"merge-proxy.ts"},{"uid":"8d24-153","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"8d24-149":{"renderedLength":138784,"gzipLength":23663,"brotliLength":0,"mainUid":"8d24-148"},"8d24-151":{"renderedLength":1622,"gzipLength":660,"brotliLength":0,"mainUid":"8d24-150"},"8d24-153":{"renderedLength":1807,"gzipLength":709,"brotliLength":0,"mainUid":"8d24-152"}},"nodeMetas":{"8d24-148":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"8d24-149"},"imported":[],"importedBy":[{"uid":"8d24-152"}]},"8d24-150":{"id":"/packages/vue-table/src/merge-proxy.ts","moduleParts":{"index.production.js":"8d24-151"},"imported":[],"importedBy":[{"uid":"8d24-152"}]},"8d24-152":{"id":"/packages/vue-table/src/index.ts","moduleParts":{"index.production.js":"8d24-153"},"imported":[{"uid":"8d24-148"},{"uid":"8d24-154"},{"uid":"8d24-150"}],"importedBy":[],"isEntry":true},"8d24-154":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"8d24-152"}],"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,17 +11,17 @@
11
11
  "children": [
12
12
  {
13
13
  "name": "table-core/build/esm/index.js",
14
- "uid": "50f7-156"
14
+ "uid": "8d24-156"
15
15
  },
16
16
  {
17
17
  "name": "vue-table/src",
18
18
  "children": [
19
19
  {
20
- "uid": "50f7-158",
20
+ "uid": "8d24-158",
21
21
  "name": "merge-proxy.ts"
22
22
  },
23
23
  {
24
- "uid": "50f7-160",
24
+ "uid": "8d24-160",
25
25
  "name": "index.ts"
26
26
  }
27
27
  ]
@@ -34,76 +34,76 @@
34
34
  "isRoot": true
35
35
  },
36
36
  "nodeParts": {
37
- "50f7-156": {
38
- "renderedLength": 138364,
39
- "gzipLength": 23596,
37
+ "8d24-156": {
38
+ "renderedLength": 138784,
39
+ "gzipLength": 23663,
40
40
  "brotliLength": 0,
41
- "mainUid": "50f7-155"
41
+ "mainUid": "8d24-155"
42
42
  },
43
- "50f7-158": {
43
+ "8d24-158": {
44
44
  "renderedLength": 1622,
45
45
  "gzipLength": 660,
46
46
  "brotliLength": 0,
47
- "mainUid": "50f7-157"
47
+ "mainUid": "8d24-157"
48
48
  },
49
- "50f7-160": {
49
+ "8d24-160": {
50
50
  "renderedLength": 1807,
51
51
  "gzipLength": 709,
52
52
  "brotliLength": 0,
53
- "mainUid": "50f7-159"
53
+ "mainUid": "8d24-159"
54
54
  }
55
55
  },
56
56
  "nodeMetas": {
57
- "50f7-155": {
57
+ "8d24-155": {
58
58
  "id": "/packages/table-core/build/esm/index.js",
59
59
  "moduleParts": {
60
- "index.production.js": "50f7-156"
60
+ "index.production.js": "8d24-156"
61
61
  },
62
62
  "imported": [],
63
63
  "importedBy": [
64
64
  {
65
- "uid": "50f7-159"
65
+ "uid": "8d24-159"
66
66
  }
67
67
  ]
68
68
  },
69
- "50f7-157": {
69
+ "8d24-157": {
70
70
  "id": "/packages/vue-table/src/merge-proxy.ts",
71
71
  "moduleParts": {
72
- "index.production.js": "50f7-158"
72
+ "index.production.js": "8d24-158"
73
73
  },
74
74
  "imported": [],
75
75
  "importedBy": [
76
76
  {
77
- "uid": "50f7-159"
77
+ "uid": "8d24-159"
78
78
  }
79
79
  ]
80
80
  },
81
- "50f7-159": {
81
+ "8d24-159": {
82
82
  "id": "/packages/vue-table/src/index.ts",
83
83
  "moduleParts": {
84
- "index.production.js": "50f7-160"
84
+ "index.production.js": "8d24-160"
85
85
  },
86
86
  "imported": [
87
87
  {
88
- "uid": "50f7-155"
88
+ "uid": "8d24-155"
89
89
  },
90
90
  {
91
- "uid": "50f7-161"
91
+ "uid": "8d24-161"
92
92
  },
93
93
  {
94
- "uid": "50f7-157"
94
+ "uid": "8d24-157"
95
95
  }
96
96
  ],
97
97
  "importedBy": [],
98
98
  "isEntry": true
99
99
  },
100
- "50f7-161": {
100
+ "8d24-161": {
101
101
  "id": "vue",
102
102
  "moduleParts": {},
103
103
  "imported": [],
104
104
  "importedBy": [
105
105
  {
106
- "uid": "50f7-159"
106
+ "uid": "8d24-159"
107
107
  }
108
108
  ],
109
109
  "isExternal": true
@@ -2032,11 +2032,11 @@
2032
2032
  });
2033
2033
  },
2034
2034
  toggleAllPageRowsSelected: value => instance.setRowSelection(old => {
2035
- typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
2035
+ const resolvedValue = typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
2036
2036
  const rowSelection = { ...old
2037
2037
  };
2038
2038
  instance.getRowModel().rows.forEach(row => {
2039
- mutateRowIsSelected(rowSelection, row.id, value, instance);
2039
+ mutateRowIsSelected(rowSelection, row.id, resolvedValue, instance);
2040
2040
  });
2041
2041
  return rowSelection;
2042
2042
  }),
@@ -2191,7 +2191,7 @@
2191
2191
  },
2192
2192
  getIsSomePageRowsSelected: () => {
2193
2193
  const paginationFlatRows = instance.getPaginationRowModel().flatRows;
2194
- return instance.getIsAllPageRowsSelected() ? false : !!(paginationFlatRows != null && paginationFlatRows.length);
2194
+ return instance.getIsAllPageRowsSelected() ? false : paginationFlatRows.some(d => d.getIsSelected() || d.getIsSomeSelected());
2195
2195
  },
2196
2196
  getToggleAllRowsSelectedHandler: () => {
2197
2197
  return e => {
@@ -3827,20 +3827,34 @@
3827
3827
  const pageStart = pageSize * pageIndex;
3828
3828
  const pageEnd = pageStart + pageSize;
3829
3829
  rows = rows.slice(pageStart, pageEnd);
3830
+ let paginatedRowModel;
3830
3831
 
3831
3832
  if (!instance.options.paginateExpandedRows) {
3832
- return expandRows({
3833
+ paginatedRowModel = expandRows({
3833
3834
  rows,
3834
3835
  flatRows,
3835
3836
  rowsById
3836
3837
  });
3838
+ } else {
3839
+ paginatedRowModel = {
3840
+ rows,
3841
+ flatRows,
3842
+ rowsById
3843
+ };
3837
3844
  }
3838
3845
 
3839
- return {
3840
- rows,
3841
- flatRows,
3842
- rowsById
3846
+ paginatedRowModel.flatRows = [];
3847
+
3848
+ const handleRow = row => {
3849
+ paginatedRowModel.flatRows.push(row);
3850
+
3851
+ if (row.subRows.length) {
3852
+ row.subRows.forEach(handleRow);
3853
+ }
3843
3854
  };
3855
+
3856
+ paginatedRowModel.rows.forEach(handleRow);
3857
+ return paginatedRowModel;
3844
3858
  }, {
3845
3859
  key: 'getPaginationRowModel',
3846
3860
  debug: () => {