@tanstack/react-table 8.2.6 → 8.3.2
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/react-table/src/index.js +1 -0
- package/build/cjs/react-table/src/index.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +70 -5
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +70 -6
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1451 -106
- package/build/stats-react.json +18 -18
- package/build/umd/index.development.js +70 -5
- 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-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": "4d15-132"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "react-table/src/index.tsx",
|
|
18
|
-
"uid": "
|
|
18
|
+
"uid": "4d15-134"
|
|
19
19
|
}
|
|
20
20
|
]
|
|
21
21
|
}
|
|
@@ -25,62 +25,62 @@
|
|
|
25
25
|
"isRoot": true
|
|
26
26
|
},
|
|
27
27
|
"nodeParts": {
|
|
28
|
-
"
|
|
29
|
-
"renderedLength":
|
|
30
|
-
"gzipLength":
|
|
28
|
+
"4d15-132": {
|
|
29
|
+
"renderedLength": 136731,
|
|
30
|
+
"gzipLength": 23744,
|
|
31
31
|
"brotliLength": 0,
|
|
32
|
-
"mainUid": "
|
|
32
|
+
"mainUid": "4d15-131"
|
|
33
33
|
},
|
|
34
|
-
"
|
|
34
|
+
"4d15-134": {
|
|
35
35
|
"renderedLength": 1900,
|
|
36
36
|
"gzipLength": 752,
|
|
37
37
|
"brotliLength": 0,
|
|
38
|
-
"mainUid": "
|
|
38
|
+
"mainUid": "4d15-133"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"nodeMetas": {
|
|
42
|
-
"
|
|
42
|
+
"4d15-131": {
|
|
43
43
|
"id": "/packages/table-core/build/esm/index.js",
|
|
44
44
|
"moduleParts": {
|
|
45
|
-
"index.production.js": "
|
|
45
|
+
"index.production.js": "4d15-132"
|
|
46
46
|
},
|
|
47
47
|
"imported": [],
|
|
48
48
|
"importedBy": [
|
|
49
49
|
{
|
|
50
|
-
"uid": "
|
|
50
|
+
"uid": "4d15-133"
|
|
51
51
|
}
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"4d15-133": {
|
|
55
55
|
"id": "/packages/react-table/src/index.tsx",
|
|
56
56
|
"moduleParts": {
|
|
57
|
-
"index.production.js": "
|
|
57
|
+
"index.production.js": "4d15-134"
|
|
58
58
|
},
|
|
59
59
|
"imported": [
|
|
60
60
|
{
|
|
61
|
-
"uid": "
|
|
61
|
+
"uid": "4d15-135"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
"uid": "
|
|
64
|
+
"uid": "4d15-131"
|
|
65
65
|
}
|
|
66
66
|
],
|
|
67
67
|
"importedBy": [],
|
|
68
68
|
"isEntry": true
|
|
69
69
|
},
|
|
70
|
-
"
|
|
70
|
+
"4d15-135": {
|
|
71
71
|
"id": "react",
|
|
72
72
|
"moduleParts": {},
|
|
73
73
|
"imported": [],
|
|
74
74
|
"importedBy": [
|
|
75
75
|
{
|
|
76
|
-
"uid": "
|
|
76
|
+
"uid": "4d15-133"
|
|
77
77
|
}
|
|
78
78
|
],
|
|
79
79
|
"isExternal": true
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"env": {
|
|
83
|
-
"rollup": "2.
|
|
83
|
+
"rollup": "2.77.0"
|
|
84
84
|
},
|
|
85
85
|
"options": {
|
|
86
86
|
"gzip": true,
|
|
@@ -44,6 +44,9 @@
|
|
|
44
44
|
*
|
|
45
45
|
* @license MIT
|
|
46
46
|
*/
|
|
47
|
+
// Is this type a tuple?
|
|
48
|
+
// If this type is a tuple, what indices are allowed?
|
|
49
|
+
///
|
|
47
50
|
function functionalUpdate(updater, input) {
|
|
48
51
|
return typeof updater === 'function' ? updater(input) : updater;
|
|
49
52
|
}
|
|
@@ -129,13 +132,27 @@
|
|
|
129
132
|
const resolvedColumnDef = { ...defaultColumn,
|
|
130
133
|
...columnDef
|
|
131
134
|
};
|
|
132
|
-
|
|
135
|
+
const accessorKey = resolvedColumnDef.accessorKey;
|
|
136
|
+
let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? accessorKey.replace('.', '_') : undefined) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;
|
|
133
137
|
let accessorFn;
|
|
134
138
|
|
|
135
139
|
if (resolvedColumnDef.accessorFn) {
|
|
136
140
|
accessorFn = resolvedColumnDef.accessorFn;
|
|
137
|
-
} else if (
|
|
138
|
-
|
|
141
|
+
} else if (accessorKey) {
|
|
142
|
+
// Support deep accessor keys
|
|
143
|
+
if (accessorKey.includes('.')) {
|
|
144
|
+
accessorFn = originalRow => {
|
|
145
|
+
let result = originalRow;
|
|
146
|
+
|
|
147
|
+
for (const key of accessorKey.split('.')) {
|
|
148
|
+
result = result[key];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return result;
|
|
152
|
+
};
|
|
153
|
+
} else {
|
|
154
|
+
accessorFn = originalRow => originalRow[resolvedColumnDef.accessorKey];
|
|
155
|
+
}
|
|
139
156
|
}
|
|
140
157
|
|
|
141
158
|
if (!id) {
|
|
@@ -2161,7 +2178,7 @@
|
|
|
2161
2178
|
let isAllRowsSelected = Boolean(preFilteredFlatRows.length && Object.keys(rowSelection).length);
|
|
2162
2179
|
|
|
2163
2180
|
if (isAllRowsSelected) {
|
|
2164
|
-
if (preFilteredFlatRows.some(row => !rowSelection[row.id])) {
|
|
2181
|
+
if (preFilteredFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
|
|
2165
2182
|
isAllRowsSelected = false;
|
|
2166
2183
|
}
|
|
2167
2184
|
}
|
|
@@ -2184,7 +2201,8 @@
|
|
|
2184
2201
|
getIsSomeRowsSelected: () => {
|
|
2185
2202
|
var _table$getState$rowSe;
|
|
2186
2203
|
|
|
2187
|
-
|
|
2204
|
+
const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
|
|
2205
|
+
return totalSelected < table.getCoreRowModel().flatRows.length;
|
|
2188
2206
|
},
|
|
2189
2207
|
getIsSomePageRowsSelected: () => {
|
|
2190
2208
|
const paginationFlatRows = table.getPaginationRowModel().flatRows;
|
|
@@ -3121,6 +3139,52 @@
|
|
|
3121
3139
|
return row;
|
|
3122
3140
|
};
|
|
3123
3141
|
|
|
3142
|
+
// type Person = {
|
|
3143
|
+
// firstName: string
|
|
3144
|
+
// lastName: string
|
|
3145
|
+
// age: number
|
|
3146
|
+
// visits: number
|
|
3147
|
+
// status: string
|
|
3148
|
+
// progress: number
|
|
3149
|
+
// nested: {
|
|
3150
|
+
// foo: [
|
|
3151
|
+
// {
|
|
3152
|
+
// bar: 'bar'
|
|
3153
|
+
// }
|
|
3154
|
+
// ]
|
|
3155
|
+
// bar: { subBar: boolean }[]
|
|
3156
|
+
// baz: {
|
|
3157
|
+
// foo: 'foo'
|
|
3158
|
+
// bar: {
|
|
3159
|
+
// baz: 'baz'
|
|
3160
|
+
// }
|
|
3161
|
+
// }
|
|
3162
|
+
// }
|
|
3163
|
+
// }
|
|
3164
|
+
// const test: DeepKeys<Person> = 'nested.foo.0.bar'
|
|
3165
|
+
// const test2: DeepKeys<Person> = 'nested.bar'
|
|
3166
|
+
// const helper = createColumnHelper<Person>()
|
|
3167
|
+
// helper.accessor('nested.foo', {
|
|
3168
|
+
// cell: info => info.getValue(),
|
|
3169
|
+
// })
|
|
3170
|
+
// helper.accessor('nested.foo.0.bar', {
|
|
3171
|
+
// cell: info => info.getValue(),
|
|
3172
|
+
// })
|
|
3173
|
+
// helper.accessor('nested.bar', {
|
|
3174
|
+
// cell: info => info.getValue(),
|
|
3175
|
+
// })
|
|
3176
|
+
function createColumnHelper() {
|
|
3177
|
+
return {
|
|
3178
|
+
accessor: (accessor, column) => {
|
|
3179
|
+
return typeof accessor === 'function' ? { ...column,
|
|
3180
|
+
accessorFn: accessor
|
|
3181
|
+
} : { ...column,
|
|
3182
|
+
accessorKey: accessor
|
|
3183
|
+
};
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3124
3188
|
function getCoreRowModel() {
|
|
3125
3189
|
return table => memo(() => [table.options.data], data => {
|
|
3126
3190
|
const rowModel = {
|
|
@@ -3883,6 +3947,7 @@
|
|
|
3883
3947
|
exports.aggregationFns = aggregationFns;
|
|
3884
3948
|
exports.buildHeaderGroups = buildHeaderGroups;
|
|
3885
3949
|
exports.createColumn = createColumn;
|
|
3950
|
+
exports.createColumnHelper = createColumnHelper;
|
|
3886
3951
|
exports.createRow = createRow;
|
|
3887
3952
|
exports.createTable = createTable;
|
|
3888
3953
|
exports.defaultColumnSizing = defaultColumnSizing;
|