@tanstack/react-table 8.0.0-alpha.87 → 8.0.0-alpha.88

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-127"},{"name":"react-table/src/index.tsx","uid":"3258-129"}]}]}],"isRoot":true},"nodeParts":{"3258-127":{"renderedLength":137395,"gzipLength":23363,"brotliLength":0,"mainUid":"3258-126"},"3258-129":{"renderedLength":2102,"gzipLength":836,"brotliLength":0,"mainUid":"3258-128"}},"nodeMetas":{"3258-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"3258-127"},"imported":[],"importedBy":[{"uid":"3258-128"}]},"3258-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"3258-129"},"imported":[{"uid":"3258-130"},{"uid":"3258-126"}],"importedBy":[],"isEntry":true},"3258-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"3258-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":"8ad0-127"},{"name":"react-table/src/index.tsx","uid":"8ad0-129"}]}]}],"isRoot":true},"nodeParts":{"8ad0-127":{"renderedLength":137430,"gzipLength":23365,"brotliLength":0,"mainUid":"8ad0-126"},"8ad0-129":{"renderedLength":2102,"gzipLength":836,"brotliLength":0,"mainUid":"8ad0-128"}},"nodeMetas":{"8ad0-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"8ad0-127"},"imported":[],"importedBy":[{"uid":"8ad0-128"}]},"8ad0-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"8ad0-129"},"imported":[{"uid":"8ad0-130"},{"uid":"8ad0-126"}],"importedBy":[],"isEntry":true},"8ad0-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"8ad0-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": "3258-132"
14
+ "uid": "8ad0-132"
15
15
  },
16
16
  {
17
17
  "name": "react-table/src/index.tsx",
18
- "uid": "3258-134"
18
+ "uid": "8ad0-134"
19
19
  }
20
20
  ]
21
21
  }
@@ -25,55 +25,55 @@
25
25
  "isRoot": true
26
26
  },
27
27
  "nodeParts": {
28
- "3258-132": {
29
- "renderedLength": 137395,
30
- "gzipLength": 23363,
28
+ "8ad0-132": {
29
+ "renderedLength": 137430,
30
+ "gzipLength": 23365,
31
31
  "brotliLength": 0,
32
- "mainUid": "3258-131"
32
+ "mainUid": "8ad0-131"
33
33
  },
34
- "3258-134": {
34
+ "8ad0-134": {
35
35
  "renderedLength": 2102,
36
36
  "gzipLength": 836,
37
37
  "brotliLength": 0,
38
- "mainUid": "3258-133"
38
+ "mainUid": "8ad0-133"
39
39
  }
40
40
  },
41
41
  "nodeMetas": {
42
- "3258-131": {
42
+ "8ad0-131": {
43
43
  "id": "/packages/table-core/build/esm/index.js",
44
44
  "moduleParts": {
45
- "index.production.js": "3258-132"
45
+ "index.production.js": "8ad0-132"
46
46
  },
47
47
  "imported": [],
48
48
  "importedBy": [
49
49
  {
50
- "uid": "3258-133"
50
+ "uid": "8ad0-133"
51
51
  }
52
52
  ]
53
53
  },
54
- "3258-133": {
54
+ "8ad0-133": {
55
55
  "id": "/packages/react-table/src/index.tsx",
56
56
  "moduleParts": {
57
- "index.production.js": "3258-134"
57
+ "index.production.js": "8ad0-134"
58
58
  },
59
59
  "imported": [
60
60
  {
61
- "uid": "3258-135"
61
+ "uid": "8ad0-135"
62
62
  },
63
63
  {
64
- "uid": "3258-131"
64
+ "uid": "8ad0-131"
65
65
  }
66
66
  ],
67
67
  "importedBy": [],
68
68
  "isEntry": true
69
69
  },
70
- "3258-135": {
70
+ "8ad0-135": {
71
71
  "id": "react",
72
72
  "moduleParts": {},
73
73
  "imported": [],
74
74
  "importedBy": [
75
75
  {
76
- "uid": "3258-133"
76
+ "uid": "8ad0-133"
77
77
  }
78
78
  ],
79
79
  "isExternal": true
@@ -144,7 +144,7 @@
144
144
  }
145
145
  }
146
146
 
147
- let column = { ...columnDef,
147
+ let column = {
148
148
  id: "" + id,
149
149
  accessorFn,
150
150
  parent: parent,
@@ -908,8 +908,12 @@
908
908
  getIsAllRowsExpanded: () => {
909
909
  const expanded = instance.getState().expanded; // If expanded is true, save some cycles and return true
910
910
 
911
- if (expanded === true) {
912
- return true;
911
+ if (typeof expanded === 'boolean') {
912
+ return expanded === true;
913
+ }
914
+
915
+ if (!Object.keys(expanded).length) {
916
+ return false;
913
917
  } // If any row is not expanded, return false
914
918
 
915
919
 
@@ -2720,8 +2724,8 @@
2720
2724
  },
2721
2725
  createRow: (row, instance) => {
2722
2726
  return {
2723
- _getAllVisibleCells: memo(() => [row.getAllCells().filter(cell => cell.column.getIsVisible()).map(d => d.id).join('_')], _ => {
2724
- return row.getAllCells().filter(cell => cell.column.getIsVisible());
2727
+ _getAllVisibleCells: memo(() => [row.getAllCells(), instance.getState().columnVisibility], cells => {
2728
+ return cells.filter(cell => cell.column.getIsVisible());
2725
2729
  }, {
2726
2730
  key: "development" === 'production' ,
2727
2731
  debug: () => {
@@ -3072,13 +3076,15 @@
3072
3076
  row,
3073
3077
  column,
3074
3078
  getValue: () => row.getValue(columnId),
3075
- renderCell: () => column.columnDef.cell ? instance._render(column.columnDef.cell, {
3076
- instance,
3077
- column,
3078
- row,
3079
- cell: cell,
3080
- getValue: cell.getValue
3081
- }) : null
3079
+ renderCell: () => {
3080
+ return column.columnDef.cell ? instance._render(column.columnDef.cell, {
3081
+ instance,
3082
+ column,
3083
+ row,
3084
+ cell: cell,
3085
+ getValue: cell.getValue
3086
+ }) : null;
3087
+ }
3082
3088
  };
3083
3089
 
3084
3090
  instance._features.forEach(feature => {
@@ -3153,27 +3159,23 @@
3153
3159
  flatRows: [],
3154
3160
  rowsById: {}
3155
3161
  };
3156
- let rows;
3157
- let row;
3158
- let originalRow;
3159
3162
 
3160
3163
  const accessRows = function (originalRows, depth, parent) {
3161
3164
  if (depth === void 0) {
3162
3165
  depth = 0;
3163
3166
  }
3164
3167
 
3165
- rows = [];
3168
+ const rows = [];
3166
3169
 
3167
3170
  for (let i = 0; i < originalRows.length; i++) {
3168
- originalRow = originalRows[i]; // This could be an expensive check at scale, so we should move it somewhere else, but where?
3171
+ // This could be an expensive check at scale, so we should move it somewhere else, but where?
3169
3172
  // if (!id) {
3170
3173
  // if ("development" !== 'production') {
3171
3174
  // throw new Error(`getRowId expected an ID, but got ${id}`)
3172
3175
  // }
3173
3176
  // }
3174
3177
  // Make the row
3175
-
3176
- row = createRow(instance, instance._getRowId(originalRow, i, parent), originalRow, i, depth); // Keep track of every row in a flat array
3178
+ const row = createRow(instance, instance._getRowId(originalRows[i], i, parent), originalRows[i], i, depth); // Keep track of every row in a flat array
3177
3179
 
3178
3180
  rowModel.flatRows.push(row); // Also keep track of every row by its ID
3179
3181
 
@@ -3184,7 +3186,7 @@
3184
3186
  if (instance.options.getSubRows) {
3185
3187
  var _row$originalSubRows;
3186
3188
 
3187
- row.originalSubRows = instance.options.getSubRows(originalRow, i); // Then recursively access them
3189
+ row.originalSubRows = instance.options.getSubRows(originalRows[i], i); // Then recursively access them
3188
3190
 
3189
3191
  if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
3190
3192
  row.subRows = accessRows(row.originalSubRows, depth + 1, row);