@tanstack/react-table 8.0.0-beta.8 → 8.0.0-beta.9

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":"6e21-127"},{"name":"react-table/src/index.tsx","uid":"6e21-129"}]}]}],"isRoot":true},"nodeParts":{"6e21-127":{"renderedLength":138740,"gzipLength":23599,"brotliLength":0,"mainUid":"6e21-126"},"6e21-129":{"renderedLength":2135,"gzipLength":854,"brotliLength":0,"mainUid":"6e21-128"}},"nodeMetas":{"6e21-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"6e21-127"},"imported":[],"importedBy":[{"uid":"6e21-128"}]},"6e21-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"6e21-129"},"imported":[{"uid":"6e21-130"},{"uid":"6e21-126"}],"importedBy":[],"isEntry":true},"6e21-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"6e21-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":"612e-127"},{"name":"react-table/src/index.tsx","uid":"612e-129"}]}]}],"isRoot":true},"nodeParts":{"612e-127":{"renderedLength":139240,"gzipLength":23684,"brotliLength":0,"mainUid":"612e-126"},"612e-129":{"renderedLength":2135,"gzipLength":854,"brotliLength":0,"mainUid":"612e-128"}},"nodeMetas":{"612e-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"612e-127"},"imported":[],"importedBy":[{"uid":"612e-128"}]},"612e-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"612e-129"},"imported":[{"uid":"612e-130"},{"uid":"612e-126"}],"importedBy":[],"isEntry":true},"612e-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"612e-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": "6e21-132"
14
+ "uid": "612e-132"
15
15
  },
16
16
  {
17
17
  "name": "react-table/src/index.tsx",
18
- "uid": "6e21-134"
18
+ "uid": "612e-134"
19
19
  }
20
20
  ]
21
21
  }
@@ -25,55 +25,55 @@
25
25
  "isRoot": true
26
26
  },
27
27
  "nodeParts": {
28
- "6e21-132": {
29
- "renderedLength": 138740,
30
- "gzipLength": 23599,
28
+ "612e-132": {
29
+ "renderedLength": 139240,
30
+ "gzipLength": 23684,
31
31
  "brotliLength": 0,
32
- "mainUid": "6e21-131"
32
+ "mainUid": "612e-131"
33
33
  },
34
- "6e21-134": {
34
+ "612e-134": {
35
35
  "renderedLength": 2135,
36
36
  "gzipLength": 854,
37
37
  "brotliLength": 0,
38
- "mainUid": "6e21-133"
38
+ "mainUid": "612e-133"
39
39
  }
40
40
  },
41
41
  "nodeMetas": {
42
- "6e21-131": {
42
+ "612e-131": {
43
43
  "id": "/packages/table-core/build/esm/index.js",
44
44
  "moduleParts": {
45
- "index.production.js": "6e21-132"
45
+ "index.production.js": "612e-132"
46
46
  },
47
47
  "imported": [],
48
48
  "importedBy": [
49
49
  {
50
- "uid": "6e21-133"
50
+ "uid": "612e-133"
51
51
  }
52
52
  ]
53
53
  },
54
- "6e21-133": {
54
+ "612e-133": {
55
55
  "id": "/packages/react-table/src/index.tsx",
56
56
  "moduleParts": {
57
- "index.production.js": "6e21-134"
57
+ "index.production.js": "612e-134"
58
58
  },
59
59
  "imported": [
60
60
  {
61
- "uid": "6e21-135"
61
+ "uid": "612e-135"
62
62
  },
63
63
  {
64
- "uid": "6e21-131"
64
+ "uid": "612e-131"
65
65
  }
66
66
  ],
67
67
  "importedBy": [],
68
68
  "isEntry": true
69
69
  },
70
- "6e21-135": {
70
+ "612e-135": {
71
71
  "id": "react",
72
72
  "moduleParts": {},
73
73
  "imported": [],
74
74
  "importedBy": [
75
75
  {
76
- "uid": "6e21-133"
76
+ "uid": "612e-133"
77
77
  }
78
78
  ],
79
79
  "isExternal": true
@@ -1003,38 +1003,54 @@
1003
1003
  };
1004
1004
 
1005
1005
  const includesString = (row, columnId, filterValue) => {
1006
+ var _row$getValue;
1007
+
1006
1008
  const search = filterValue.toLowerCase();
1007
- return row.getValue(columnId).toLowerCase().includes(search);
1009
+ return (_row$getValue = row.getValue(columnId)) == null ? void 0 : _row$getValue.toLowerCase().includes(search);
1008
1010
  };
1009
1011
 
1010
1012
  includesString.autoRemove = val => testFalsey(val);
1011
1013
 
1012
1014
  const includesStringSensitive = (row, columnId, filterValue) => {
1013
- return row.getValue(columnId).includes(filterValue);
1015
+ var _row$getValue2;
1016
+
1017
+ return (_row$getValue2 = row.getValue(columnId)) == null ? void 0 : _row$getValue2.includes(filterValue);
1014
1018
  };
1015
1019
 
1016
1020
  includesStringSensitive.autoRemove = val => testFalsey(val);
1017
1021
 
1018
1022
  const equalsString = (row, columnId, filterValue) => {
1019
- return row.getValue(columnId).toLowerCase() === filterValue.toLowerCase();
1023
+ var _row$getValue3;
1024
+
1025
+ return ((_row$getValue3 = row.getValue(columnId)) == null ? void 0 : _row$getValue3.toLowerCase()) === filterValue.toLowerCase();
1020
1026
  };
1021
1027
 
1022
1028
  equalsString.autoRemove = val => testFalsey(val);
1023
1029
 
1024
1030
  const arrIncludes = (row, columnId, filterValue) => {
1025
- return row.getValue(columnId).includes(filterValue);
1031
+ var _row$getValue4;
1032
+
1033
+ return (_row$getValue4 = row.getValue(columnId)) == null ? void 0 : _row$getValue4.includes(filterValue);
1026
1034
  };
1027
1035
 
1028
1036
  arrIncludes.autoRemove = val => testFalsey(val) || !(val != null && val.length);
1029
1037
 
1030
1038
  const arrIncludesAll = (row, columnId, filterValue) => {
1031
- return !filterValue.some(val => !row.getValue(columnId).includes(val));
1039
+ return !filterValue.some(val => {
1040
+ var _row$getValue5;
1041
+
1042
+ return !((_row$getValue5 = row.getValue(columnId)) != null && _row$getValue5.includes(val));
1043
+ });
1032
1044
  };
1033
1045
 
1034
1046
  arrIncludesAll.autoRemove = val => testFalsey(val) || !(val != null && val.length);
1035
1047
 
1036
1048
  const arrIncludesSome = (row, columnId, filterValue) => {
1037
- return filterValue.some(val => row.getValue(columnId).includes(val));
1049
+ return filterValue.some(val => {
1050
+ var _row$getValue6;
1051
+
1052
+ return (_row$getValue6 = row.getValue(columnId)) == null ? void 0 : _row$getValue6.includes(val);
1053
+ });
1038
1054
  };
1039
1055
 
1040
1056
  arrIncludesSome.autoRemove = val => testFalsey(val) || !(val != null && val.length);
@@ -1719,7 +1735,7 @@
1719
1735
  setPageIndex: updater => {
1720
1736
  instance.setPagination(old => {
1721
1737
  let pageIndex = functionalUpdate(updater, old.pageIndex);
1722
- const maxPageIndex = typeof instance.options.pageCount !== 'undefined' ? instance.options.pageCount - 1 : Number.MAX_SAFE_INTEGER;
1738
+ const maxPageIndex = typeof instance.options.pageCount === 'undefined' || instance.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : instance.options.pageCount - 1;
1723
1739
  pageIndex = Math.min(Math.max(0, pageIndex), maxPageIndex);
1724
1740
  return { ...old,
1725
1741
  pageIndex
@@ -3249,8 +3265,6 @@
3249
3265
  function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
3250
3266
  const newFilteredFlatRows = [];
3251
3267
  const newFilteredRowsById = {};
3252
- let row;
3253
- let newRow;
3254
3268
 
3255
3269
  const recurseFilterRows = function (rowsToFilter, depth) {
3256
3270
  if (depth === void 0) {
@@ -3262,10 +3276,10 @@
3262
3276
  for (let i = 0; i < rowsToFilter.length; i++) {
3263
3277
  var _row$subRows;
3264
3278
 
3265
- row = rowsToFilter[i];
3279
+ let row = rowsToFilter[i];
3266
3280
 
3267
3281
  if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
3268
- newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3282
+ const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3269
3283
  newRow.columnFilters = row.columnFilters;
3270
3284
  newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
3271
3285
 
@@ -3294,10 +3308,7 @@
3294
3308
  }
3295
3309
  function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
3296
3310
  const newFilteredFlatRows = [];
3297
- const newFilteredRowsById = {};
3298
- let rows;
3299
- let row;
3300
- let newRow; // Filters top level and nested rows
3311
+ const newFilteredRowsById = {}; // Filters top level and nested rows
3301
3312
 
3302
3313
  const recurseFilterRows = function (rowsToFilter, depth) {
3303
3314
  if (depth === void 0) {
@@ -3305,17 +3316,17 @@
3305
3316
  }
3306
3317
 
3307
3318
  // Filter from parents downward first
3308
- rows = []; // Apply the filter to any subRows
3319
+ const rows = []; // Apply the filter to any subRows
3309
3320
 
3310
3321
  for (let i = 0; i < rowsToFilter.length; i++) {
3311
- row = rowsToFilter[i];
3322
+ let row = rowsToFilter[i];
3312
3323
  const pass = filterRow(row);
3313
3324
 
3314
3325
  if (pass) {
3315
3326
  var _row$subRows2;
3316
3327
 
3317
3328
  if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
3318
- newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3329
+ const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3319
3330
  newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
3320
3331
  row = newRow;
3321
3332
  }