@tanstack/vue-table 8.0.0-alpha.87 → 8.0.0-beta.1

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":"3258-149"},{"name":"vue-table/src","children":[{"uid":"3258-151","name":"merge-proxy.ts"},{"uid":"3258-153","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"3258-149":{"renderedLength":137395,"gzipLength":23363,"brotliLength":0,"mainUid":"3258-148"},"3258-151":{"renderedLength":1622,"gzipLength":660,"brotliLength":0,"mainUid":"3258-150"},"3258-153":{"renderedLength":1774,"gzipLength":693,"brotliLength":0,"mainUid":"3258-152"}},"nodeMetas":{"3258-148":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"3258-149"},"imported":[],"importedBy":[{"uid":"3258-152"}]},"3258-150":{"id":"/packages/vue-table/src/merge-proxy.ts","moduleParts":{"index.production.js":"3258-151"},"imported":[],"importedBy":[{"uid":"3258-152"}]},"3258-152":{"id":"/packages/vue-table/src/index.ts","moduleParts":{"index.production.js":"3258-153"},"imported":[{"uid":"3258-148"},{"uid":"3258-154"},{"uid":"3258-150"}],"importedBy":[],"isEntry":true},"3258-154":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"3258-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":"6d04-149"},{"name":"vue-table/src","children":[{"uid":"6d04-151","name":"merge-proxy.ts"},{"uid":"6d04-153","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"6d04-149":{"renderedLength":137430,"gzipLength":23365,"brotliLength":0,"mainUid":"6d04-148"},"6d04-151":{"renderedLength":1622,"gzipLength":660,"brotliLength":0,"mainUid":"6d04-150"},"6d04-153":{"renderedLength":1774,"gzipLength":693,"brotliLength":0,"mainUid":"6d04-152"}},"nodeMetas":{"6d04-148":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"6d04-149"},"imported":[],"importedBy":[{"uid":"6d04-152"}]},"6d04-150":{"id":"/packages/vue-table/src/merge-proxy.ts","moduleParts":{"index.production.js":"6d04-151"},"imported":[],"importedBy":[{"uid":"6d04-152"}]},"6d04-152":{"id":"/packages/vue-table/src/index.ts","moduleParts":{"index.production.js":"6d04-153"},"imported":[{"uid":"6d04-148"},{"uid":"6d04-154"},{"uid":"6d04-150"}],"importedBy":[],"isEntry":true},"6d04-154":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d04-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": "3258-156"
14
+ "uid": "6d04-156"
15
15
  },
16
16
  {
17
17
  "name": "vue-table/src",
18
18
  "children": [
19
19
  {
20
- "uid": "3258-158",
20
+ "uid": "6d04-158",
21
21
  "name": "merge-proxy.ts"
22
22
  },
23
23
  {
24
- "uid": "3258-160",
24
+ "uid": "6d04-160",
25
25
  "name": "index.ts"
26
26
  }
27
27
  ]
@@ -34,76 +34,76 @@
34
34
  "isRoot": true
35
35
  },
36
36
  "nodeParts": {
37
- "3258-156": {
38
- "renderedLength": 137395,
39
- "gzipLength": 23363,
37
+ "6d04-156": {
38
+ "renderedLength": 137430,
39
+ "gzipLength": 23365,
40
40
  "brotliLength": 0,
41
- "mainUid": "3258-155"
41
+ "mainUid": "6d04-155"
42
42
  },
43
- "3258-158": {
43
+ "6d04-158": {
44
44
  "renderedLength": 1622,
45
45
  "gzipLength": 660,
46
46
  "brotliLength": 0,
47
- "mainUid": "3258-157"
47
+ "mainUid": "6d04-157"
48
48
  },
49
- "3258-160": {
49
+ "6d04-160": {
50
50
  "renderedLength": 1774,
51
51
  "gzipLength": 693,
52
52
  "brotliLength": 0,
53
- "mainUid": "3258-159"
53
+ "mainUid": "6d04-159"
54
54
  }
55
55
  },
56
56
  "nodeMetas": {
57
- "3258-155": {
57
+ "6d04-155": {
58
58
  "id": "/packages/table-core/build/esm/index.js",
59
59
  "moduleParts": {
60
- "index.production.js": "3258-156"
60
+ "index.production.js": "6d04-156"
61
61
  },
62
62
  "imported": [],
63
63
  "importedBy": [
64
64
  {
65
- "uid": "3258-159"
65
+ "uid": "6d04-159"
66
66
  }
67
67
  ]
68
68
  },
69
- "3258-157": {
69
+ "6d04-157": {
70
70
  "id": "/packages/vue-table/src/merge-proxy.ts",
71
71
  "moduleParts": {
72
- "index.production.js": "3258-158"
72
+ "index.production.js": "6d04-158"
73
73
  },
74
74
  "imported": [],
75
75
  "importedBy": [
76
76
  {
77
- "uid": "3258-159"
77
+ "uid": "6d04-159"
78
78
  }
79
79
  ]
80
80
  },
81
- "3258-159": {
81
+ "6d04-159": {
82
82
  "id": "/packages/vue-table/src/index.ts",
83
83
  "moduleParts": {
84
- "index.production.js": "3258-160"
84
+ "index.production.js": "6d04-160"
85
85
  },
86
86
  "imported": [
87
87
  {
88
- "uid": "3258-155"
88
+ "uid": "6d04-155"
89
89
  },
90
90
  {
91
- "uid": "3258-161"
91
+ "uid": "6d04-161"
92
92
  },
93
93
  {
94
- "uid": "3258-157"
94
+ "uid": "6d04-157"
95
95
  }
96
96
  ],
97
97
  "importedBy": [],
98
98
  "isEntry": true
99
99
  },
100
- "3258-161": {
100
+ "6d04-161": {
101
101
  "id": "vue",
102
102
  "moduleParts": {},
103
103
  "imported": [],
104
104
  "importedBy": [
105
105
  {
106
- "uid": "3258-159"
106
+ "uid": "6d04-159"
107
107
  }
108
108
  ],
109
109
  "isExternal": true
@@ -124,7 +124,7 @@
124
124
  }
125
125
  }
126
126
 
127
- let column = { ...columnDef,
127
+ let column = {
128
128
  id: "" + id,
129
129
  accessorFn,
130
130
  parent: parent,
@@ -888,8 +888,12 @@
888
888
  getIsAllRowsExpanded: () => {
889
889
  const expanded = instance.getState().expanded; // If expanded is true, save some cycles and return true
890
890
 
891
- if (expanded === true) {
892
- return true;
891
+ if (typeof expanded === 'boolean') {
892
+ return expanded === true;
893
+ }
894
+
895
+ if (!Object.keys(expanded).length) {
896
+ return false;
893
897
  } // If any row is not expanded, return false
894
898
 
895
899
 
@@ -2700,8 +2704,8 @@
2700
2704
  },
2701
2705
  createRow: (row, instance) => {
2702
2706
  return {
2703
- _getAllVisibleCells: memo(() => [row.getAllCells().filter(cell => cell.column.getIsVisible()).map(d => d.id).join('_')], _ => {
2704
- return row.getAllCells().filter(cell => cell.column.getIsVisible());
2707
+ _getAllVisibleCells: memo(() => [row.getAllCells(), instance.getState().columnVisibility], cells => {
2708
+ return cells.filter(cell => cell.column.getIsVisible());
2705
2709
  }, {
2706
2710
  key: "development" === 'production' ,
2707
2711
  debug: () => {
@@ -3052,13 +3056,15 @@
3052
3056
  row,
3053
3057
  column,
3054
3058
  getValue: () => row.getValue(columnId),
3055
- renderCell: () => column.columnDef.cell ? instance._render(column.columnDef.cell, {
3056
- instance,
3057
- column,
3058
- row,
3059
- cell: cell,
3060
- getValue: cell.getValue
3061
- }) : null
3059
+ renderCell: () => {
3060
+ return column.columnDef.cell ? instance._render(column.columnDef.cell, {
3061
+ instance,
3062
+ column,
3063
+ row,
3064
+ cell: cell,
3065
+ getValue: cell.getValue
3066
+ }) : null;
3067
+ }
3062
3068
  };
3063
3069
 
3064
3070
  instance._features.forEach(feature => {
@@ -3133,27 +3139,23 @@
3133
3139
  flatRows: [],
3134
3140
  rowsById: {}
3135
3141
  };
3136
- let rows;
3137
- let row;
3138
- let originalRow;
3139
3142
 
3140
3143
  const accessRows = function (originalRows, depth, parent) {
3141
3144
  if (depth === void 0) {
3142
3145
  depth = 0;
3143
3146
  }
3144
3147
 
3145
- rows = [];
3148
+ const rows = [];
3146
3149
 
3147
3150
  for (let i = 0; i < originalRows.length; i++) {
3148
- originalRow = originalRows[i]; // This could be an expensive check at scale, so we should move it somewhere else, but where?
3151
+ // This could be an expensive check at scale, so we should move it somewhere else, but where?
3149
3152
  // if (!id) {
3150
3153
  // if ("development" !== 'production') {
3151
3154
  // throw new Error(`getRowId expected an ID, but got ${id}`)
3152
3155
  // }
3153
3156
  // }
3154
3157
  // Make the row
3155
-
3156
- row = createRow(instance, instance._getRowId(originalRow, i, parent), originalRow, i, depth); // Keep track of every row in a flat array
3158
+ const row = createRow(instance, instance._getRowId(originalRows[i], i, parent), originalRows[i], i, depth); // Keep track of every row in a flat array
3157
3159
 
3158
3160
  rowModel.flatRows.push(row); // Also keep track of every row by its ID
3159
3161
 
@@ -3164,7 +3166,7 @@
3164
3166
  if (instance.options.getSubRows) {
3165
3167
  var _row$originalSubRows;
3166
3168
 
3167
- row.originalSubRows = instance.options.getSubRows(originalRow, i); // Then recursively access them
3169
+ row.originalSubRows = instance.options.getSubRows(originalRows[i], i); // Then recursively access them
3168
3170
 
3169
3171
  if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
3170
3172
  row.subRows = accessRows(row.originalSubRows, depth + 1, row);