@tanstack/vue-table 8.2.2 → 8.2.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":"a9b1-145"},{"name":"vue-table/src","children":[{"uid":"a9b1-147","name":"merge-proxy.ts"},{"uid":"a9b1-149","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"a9b1-145":{"renderedLength":134594,"gzipLength":23188,"brotliLength":0,"mainUid":"a9b1-144"},"a9b1-147":{"renderedLength":1622,"gzipLength":660,"brotliLength":0,"mainUid":"a9b1-146"},"a9b1-149":{"renderedLength":1683,"gzipLength":677,"brotliLength":0,"mainUid":"a9b1-148"}},"nodeMetas":{"a9b1-144":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"a9b1-145"},"imported":[],"importedBy":[{"uid":"a9b1-148"}]},"a9b1-146":{"id":"/packages/vue-table/src/merge-proxy.ts","moduleParts":{"index.production.js":"a9b1-147"},"imported":[],"importedBy":[{"uid":"a9b1-148"}]},"a9b1-148":{"id":"/packages/vue-table/src/index.ts","moduleParts":{"index.production.js":"a9b1-149"},"imported":[{"uid":"a9b1-144"},{"uid":"a9b1-150"},{"uid":"a9b1-146"}],"importedBy":[],"isEntry":true},"a9b1-150":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"a9b1-148"}],"isExternal":true}},"env":{"rollup":"2.76.0"},"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":"3cee-145"},{"name":"vue-table/src","children":[{"uid":"3cee-147","name":"merge-proxy.ts"},{"uid":"3cee-149","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"3cee-145":{"renderedLength":135079,"gzipLength":23290,"brotliLength":0,"mainUid":"3cee-144"},"3cee-147":{"renderedLength":1622,"gzipLength":660,"brotliLength":0,"mainUid":"3cee-146"},"3cee-149":{"renderedLength":1683,"gzipLength":677,"brotliLength":0,"mainUid":"3cee-148"}},"nodeMetas":{"3cee-144":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"3cee-145"},"imported":[],"importedBy":[{"uid":"3cee-148"}]},"3cee-146":{"id":"/packages/vue-table/src/merge-proxy.ts","moduleParts":{"index.production.js":"3cee-147"},"imported":[],"importedBy":[{"uid":"3cee-148"}]},"3cee-148":{"id":"/packages/vue-table/src/index.ts","moduleParts":{"index.production.js":"3cee-149"},"imported":[{"uid":"3cee-144"},{"uid":"3cee-150"},{"uid":"3cee-146"}],"importedBy":[],"isEntry":true},"3cee-150":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"3cee-148"}],"isExternal":true}},"env":{"rollup":"2.76.0"},"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": "a9b1-152"
14
+ "uid": "3cee-152"
15
15
  },
16
16
  {
17
17
  "name": "vue-table/src",
18
18
  "children": [
19
19
  {
20
- "uid": "a9b1-154",
20
+ "uid": "3cee-154",
21
21
  "name": "merge-proxy.ts"
22
22
  },
23
23
  {
24
- "uid": "a9b1-156",
24
+ "uid": "3cee-156",
25
25
  "name": "index.ts"
26
26
  }
27
27
  ]
@@ -34,76 +34,76 @@
34
34
  "isRoot": true
35
35
  },
36
36
  "nodeParts": {
37
- "a9b1-152": {
38
- "renderedLength": 134594,
39
- "gzipLength": 23188,
37
+ "3cee-152": {
38
+ "renderedLength": 135079,
39
+ "gzipLength": 23290,
40
40
  "brotliLength": 0,
41
- "mainUid": "a9b1-151"
41
+ "mainUid": "3cee-151"
42
42
  },
43
- "a9b1-154": {
43
+ "3cee-154": {
44
44
  "renderedLength": 1622,
45
45
  "gzipLength": 660,
46
46
  "brotliLength": 0,
47
- "mainUid": "a9b1-153"
47
+ "mainUid": "3cee-153"
48
48
  },
49
- "a9b1-156": {
49
+ "3cee-156": {
50
50
  "renderedLength": 1683,
51
51
  "gzipLength": 677,
52
52
  "brotliLength": 0,
53
- "mainUid": "a9b1-155"
53
+ "mainUid": "3cee-155"
54
54
  }
55
55
  },
56
56
  "nodeMetas": {
57
- "a9b1-151": {
57
+ "3cee-151": {
58
58
  "id": "/packages/table-core/build/esm/index.js",
59
59
  "moduleParts": {
60
- "index.production.js": "a9b1-152"
60
+ "index.production.js": "3cee-152"
61
61
  },
62
62
  "imported": [],
63
63
  "importedBy": [
64
64
  {
65
- "uid": "a9b1-155"
65
+ "uid": "3cee-155"
66
66
  }
67
67
  ]
68
68
  },
69
- "a9b1-153": {
69
+ "3cee-153": {
70
70
  "id": "/packages/vue-table/src/merge-proxy.ts",
71
71
  "moduleParts": {
72
- "index.production.js": "a9b1-154"
72
+ "index.production.js": "3cee-154"
73
73
  },
74
74
  "imported": [],
75
75
  "importedBy": [
76
76
  {
77
- "uid": "a9b1-155"
77
+ "uid": "3cee-155"
78
78
  }
79
79
  ]
80
80
  },
81
- "a9b1-155": {
81
+ "3cee-155": {
82
82
  "id": "/packages/vue-table/src/index.ts",
83
83
  "moduleParts": {
84
- "index.production.js": "a9b1-156"
84
+ "index.production.js": "3cee-156"
85
85
  },
86
86
  "imported": [
87
87
  {
88
- "uid": "a9b1-151"
88
+ "uid": "3cee-151"
89
89
  },
90
90
  {
91
- "uid": "a9b1-157"
91
+ "uid": "3cee-157"
92
92
  },
93
93
  {
94
- "uid": "a9b1-153"
94
+ "uid": "3cee-153"
95
95
  }
96
96
  ],
97
97
  "importedBy": [],
98
98
  "isEntry": true
99
99
  },
100
- "a9b1-157": {
100
+ "3cee-157": {
101
101
  "id": "vue",
102
102
  "moduleParts": {},
103
103
  "imported": [],
104
104
  "importedBy": [
105
105
  {
106
- "uid": "a9b1-155"
106
+ "uid": "3cee-155"
107
107
  }
108
108
  ],
109
109
  "isExternal": true
@@ -963,7 +963,7 @@
963
963
  getCanExpand: () => {
964
964
  var _table$options$getRow, _table$options$enable, _row$subRows;
965
965
 
966
- return ((_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : true) && ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
966
+ return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
967
967
  },
968
968
  getToggleExpandedHandler: () => {
969
969
  const canExpand = row.getCanExpand();
@@ -1993,6 +1993,10 @@
1993
1993
 
1994
1994
  if (value) {
1995
1995
  preGroupedFlatRows.forEach(row => {
1996
+ if (!row.getCanSelect()) {
1997
+ return;
1998
+ }
1999
+
1996
2000
  rowSelection[row.id] = true;
1997
2001
  });
1998
2002
  } else {
@@ -2256,8 +2260,8 @@
2256
2260
  const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
2257
2261
  var _row$subRows;
2258
2262
 
2259
- const row = table.getRow(id);
2260
- row.getIsGrouped(); // if ( // TODO: enforce grouping row selection rules
2263
+ const row = table.getRow(id); // const isGrouped = row.getIsGrouped()
2264
+ // if ( // TODO: enforce grouping row selection rules
2261
2265
  // !isGrouped ||
2262
2266
  // (isGrouped && table.options.enableGroupingRowSelection)
2263
2267
  // ) {
@@ -2267,7 +2271,9 @@
2267
2271
  Object.keys(selectedRowIds).forEach(key => delete selectedRowIds[key]);
2268
2272
  }
2269
2273
 
2270
- selectedRowIds[id] = true;
2274
+ if (row.getCanSelect()) {
2275
+ selectedRowIds[id] = true;
2276
+ }
2271
2277
  } else {
2272
2278
  delete selectedRowIds[id];
2273
2279
  } // }
@@ -3568,9 +3574,20 @@
3568
3574
  depth = 0;
3569
3575
  }
3570
3576
 
3571
- // This is the last level, just return the rows
3572
- if (depth === existingGrouping.length) {
3573
- return rows;
3577
+ // Grouping depth has been been met
3578
+ // Stop grouping and simply rewrite thd depth and row relationships
3579
+ if (depth >= existingGrouping.length) {
3580
+ return rows.map(row => {
3581
+ row.depth = depth;
3582
+ groupedFlatRows.push(row);
3583
+ groupedRowsById[row.id] = row;
3584
+
3585
+ if (row.subRows) {
3586
+ row.subRows = groupUpRecursively(row.subRows, depth + 1);
3587
+ }
3588
+
3589
+ return row;
3590
+ });
3574
3591
  }
3575
3592
 
3576
3593
  const columnId = existingGrouping[depth]; // Group the rows together for this level