@tanstack/react-table 8.5.16 → 8.5.18
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.
- package/build/cjs/table-core/build/esm/index.js +36 -12
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +36 -12
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +17 -17
- package/build/umd/index.development.js +36 -12
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
package/build/stats-html.html
CHANGED
|
@@ -4024,7 +4024,7 @@ var drawChart = (function (exports) {
|
|
|
4024
4024
|
</script>
|
|
4025
4025
|
<script>
|
|
4026
4026
|
/*<!--*/
|
|
4027
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"
|
|
4027
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"0c68-127"},{"name":"react-table/src/index.tsx","uid":"0c68-129"}]}]}],"isRoot":true},"nodeParts":{"0c68-127":{"renderedLength":126174,"gzipLength":22385,"brotliLength":0,"mainUid":"0c68-126"},"0c68-129":{"renderedLength":1923,"gzipLength":755,"brotliLength":0,"mainUid":"0c68-128"}},"nodeMetas":{"0c68-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"0c68-127"},"imported":[],"importedBy":[{"uid":"0c68-128"}]},"0c68-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"0c68-129"},"imported":[{"uid":"0c68-130"},{"uid":"0c68-126"}],"importedBy":[],"isEntry":true},"0c68-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0c68-128"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
4028
4028
|
|
|
4029
4029
|
const run = () => {
|
|
4030
4030
|
const width = window.innerWidth;
|
package/build/stats-react.json
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "0c68-132"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "react-table/src/index.tsx",
|
|
18
|
-
"uid": "
|
|
18
|
+
"uid": "0c68-134"
|
|
19
19
|
}
|
|
20
20
|
]
|
|
21
21
|
}
|
|
@@ -25,55 +25,55 @@
|
|
|
25
25
|
"isRoot": true
|
|
26
26
|
},
|
|
27
27
|
"nodeParts": {
|
|
28
|
-
"
|
|
29
|
-
"renderedLength":
|
|
30
|
-
"gzipLength":
|
|
28
|
+
"0c68-132": {
|
|
29
|
+
"renderedLength": 126174,
|
|
30
|
+
"gzipLength": 22385,
|
|
31
31
|
"brotliLength": 0,
|
|
32
|
-
"mainUid": "
|
|
32
|
+
"mainUid": "0c68-131"
|
|
33
33
|
},
|
|
34
|
-
"
|
|
34
|
+
"0c68-134": {
|
|
35
35
|
"renderedLength": 1923,
|
|
36
36
|
"gzipLength": 755,
|
|
37
37
|
"brotliLength": 0,
|
|
38
|
-
"mainUid": "
|
|
38
|
+
"mainUid": "0c68-133"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"nodeMetas": {
|
|
42
|
-
"
|
|
42
|
+
"0c68-131": {
|
|
43
43
|
"id": "/packages/table-core/build/esm/index.js",
|
|
44
44
|
"moduleParts": {
|
|
45
|
-
"index.production.js": "
|
|
45
|
+
"index.production.js": "0c68-132"
|
|
46
46
|
},
|
|
47
47
|
"imported": [],
|
|
48
48
|
"importedBy": [
|
|
49
49
|
{
|
|
50
|
-
"uid": "
|
|
50
|
+
"uid": "0c68-133"
|
|
51
51
|
}
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"0c68-133": {
|
|
55
55
|
"id": "/packages/react-table/src/index.tsx",
|
|
56
56
|
"moduleParts": {
|
|
57
|
-
"index.production.js": "
|
|
57
|
+
"index.production.js": "0c68-134"
|
|
58
58
|
},
|
|
59
59
|
"imported": [
|
|
60
60
|
{
|
|
61
|
-
"uid": "
|
|
61
|
+
"uid": "0c68-135"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
"uid": "
|
|
64
|
+
"uid": "0c68-131"
|
|
65
65
|
}
|
|
66
66
|
],
|
|
67
67
|
"importedBy": [],
|
|
68
68
|
"isEntry": true
|
|
69
69
|
},
|
|
70
|
-
"
|
|
70
|
+
"0c68-135": {
|
|
71
71
|
"id": "react",
|
|
72
72
|
"moduleParts": {},
|
|
73
73
|
"imported": [],
|
|
74
74
|
"importedBy": [
|
|
75
75
|
{
|
|
76
|
-
"uid": "
|
|
76
|
+
"uid": "0c68-133"
|
|
77
77
|
}
|
|
78
78
|
],
|
|
79
79
|
"isExternal": true
|
|
@@ -139,6 +139,9 @@
|
|
|
139
139
|
let result = originalRow;
|
|
140
140
|
for (const key of accessorKey.split('.')) {
|
|
141
141
|
result = result[key];
|
|
142
|
+
if (result === undefined) {
|
|
143
|
+
throw new Error(`"${key}" in deeply nested key "${accessorKey}" returned undefined.`);
|
|
144
|
+
}
|
|
142
145
|
}
|
|
143
146
|
return result;
|
|
144
147
|
};
|
|
@@ -2691,6 +2694,7 @@
|
|
|
2691
2694
|
original,
|
|
2692
2695
|
depth,
|
|
2693
2696
|
_valuesCache: {},
|
|
2697
|
+
_uniqueValuesCache: {},
|
|
2694
2698
|
getValue: columnId => {
|
|
2695
2699
|
if (row._valuesCache.hasOwnProperty(columnId)) {
|
|
2696
2700
|
return row._valuesCache[columnId];
|
|
@@ -2702,6 +2706,21 @@
|
|
|
2702
2706
|
row._valuesCache[columnId] = column.accessorFn(row.original, rowIndex);
|
|
2703
2707
|
return row._valuesCache[columnId];
|
|
2704
2708
|
},
|
|
2709
|
+
getUniqueValues: columnId => {
|
|
2710
|
+
if (row._uniqueValuesCache.hasOwnProperty(columnId)) {
|
|
2711
|
+
return row._uniqueValuesCache[columnId];
|
|
2712
|
+
}
|
|
2713
|
+
const column = table.getColumn(columnId);
|
|
2714
|
+
if (!column.accessorFn) {
|
|
2715
|
+
return undefined;
|
|
2716
|
+
}
|
|
2717
|
+
if (!column.columnDef.getUniqueValues) {
|
|
2718
|
+
row._uniqueValuesCache[columnId] = [row.getValue(columnId)];
|
|
2719
|
+
return row._uniqueValuesCache[columnId];
|
|
2720
|
+
}
|
|
2721
|
+
row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(row.original, rowIndex);
|
|
2722
|
+
return row._uniqueValuesCache[columnId];
|
|
2723
|
+
},
|
|
2705
2724
|
renderValue: columnId => row.getValue(columnId) ?? table.options.renderFallbackValue,
|
|
2706
2725
|
subRows: subRows ?? [],
|
|
2707
2726
|
getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
|
|
@@ -3042,12 +3061,14 @@
|
|
|
3042
3061
|
return (table, columnId) => memo(() => [table.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
|
|
3043
3062
|
let facetedUniqueValues = new Map();
|
|
3044
3063
|
for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3064
|
+
const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
|
|
3065
|
+
for (let j = 0; j < values.length; j++) {
|
|
3066
|
+
const value = values[j];
|
|
3067
|
+
if (facetedUniqueValues.has(value)) {
|
|
3068
|
+
facetedUniqueValues.set(value, (facetedUniqueValues.get(value) ?? 0) + 1);
|
|
3069
|
+
} else {
|
|
3070
|
+
facetedUniqueValues.set(value, 1);
|
|
3071
|
+
}
|
|
3051
3072
|
}
|
|
3052
3073
|
}
|
|
3053
3074
|
return facetedUniqueValues;
|
|
@@ -3061,17 +3082,20 @@
|
|
|
3061
3082
|
function getFacetedMinMaxValues() {
|
|
3062
3083
|
return (table, columnId) => memo(() => [table.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
|
|
3063
3084
|
var _facetedRowModel$flat;
|
|
3064
|
-
const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.
|
|
3085
|
+
const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getUniqueValues(columnId);
|
|
3065
3086
|
if (typeof firstValue === 'undefined') {
|
|
3066
3087
|
return undefined;
|
|
3067
3088
|
}
|
|
3068
3089
|
let facetedMinMaxValues = [firstValue, firstValue];
|
|
3069
3090
|
for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
|
|
3070
|
-
const
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3091
|
+
const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
|
|
3092
|
+
for (let j = 0; j < values.length; j++) {
|
|
3093
|
+
const value = values[j];
|
|
3094
|
+
if (value < facetedMinMaxValues[0]) {
|
|
3095
|
+
facetedMinMaxValues[0] = value;
|
|
3096
|
+
} else if (value > facetedMinMaxValues[1]) {
|
|
3097
|
+
facetedMinMaxValues[1] = value;
|
|
3098
|
+
}
|
|
3075
3099
|
}
|
|
3076
3100
|
}
|
|
3077
3101
|
return facetedMinMaxValues;
|