@tanstack/react-table 8.2.6 → 8.3.0
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 +67 -3
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +67 -4
- 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 +67 -3
- 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": "1937-132"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "react-table/src/index.tsx",
|
|
18
|
-
"uid": "
|
|
18
|
+
"uid": "1937-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
|
+
"1937-132": {
|
|
29
|
+
"renderedLength": 136655,
|
|
30
|
+
"gzipLength": 23722,
|
|
31
31
|
"brotliLength": 0,
|
|
32
|
-
"mainUid": "
|
|
32
|
+
"mainUid": "1937-131"
|
|
33
33
|
},
|
|
34
|
-
"
|
|
34
|
+
"1937-134": {
|
|
35
35
|
"renderedLength": 1900,
|
|
36
36
|
"gzipLength": 752,
|
|
37
37
|
"brotliLength": 0,
|
|
38
|
-
"mainUid": "
|
|
38
|
+
"mainUid": "1937-133"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"nodeMetas": {
|
|
42
|
-
"
|
|
42
|
+
"1937-131": {
|
|
43
43
|
"id": "/packages/table-core/build/esm/index.js",
|
|
44
44
|
"moduleParts": {
|
|
45
|
-
"index.production.js": "
|
|
45
|
+
"index.production.js": "1937-132"
|
|
46
46
|
},
|
|
47
47
|
"imported": [],
|
|
48
48
|
"importedBy": [
|
|
49
49
|
{
|
|
50
|
-
"uid": "
|
|
50
|
+
"uid": "1937-133"
|
|
51
51
|
}
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"1937-133": {
|
|
55
55
|
"id": "/packages/react-table/src/index.tsx",
|
|
56
56
|
"moduleParts": {
|
|
57
|
-
"index.production.js": "
|
|
57
|
+
"index.production.js": "1937-134"
|
|
58
58
|
},
|
|
59
59
|
"imported": [
|
|
60
60
|
{
|
|
61
|
-
"uid": "
|
|
61
|
+
"uid": "1937-135"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
"uid": "
|
|
64
|
+
"uid": "1937-131"
|
|
65
65
|
}
|
|
66
66
|
],
|
|
67
67
|
"importedBy": [],
|
|
68
68
|
"isEntry": true
|
|
69
69
|
},
|
|
70
|
-
"
|
|
70
|
+
"1937-135": {
|
|
71
71
|
"id": "react",
|
|
72
72
|
"moduleParts": {},
|
|
73
73
|
"imported": [],
|
|
74
74
|
"importedBy": [
|
|
75
75
|
{
|
|
76
|
-
"uid": "
|
|
76
|
+
"uid": "1937-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) {
|
|
@@ -3121,6 +3138,52 @@
|
|
|
3121
3138
|
return row;
|
|
3122
3139
|
};
|
|
3123
3140
|
|
|
3141
|
+
// type Person = {
|
|
3142
|
+
// firstName: string
|
|
3143
|
+
// lastName: string
|
|
3144
|
+
// age: number
|
|
3145
|
+
// visits: number
|
|
3146
|
+
// status: string
|
|
3147
|
+
// progress: number
|
|
3148
|
+
// nested: {
|
|
3149
|
+
// foo: [
|
|
3150
|
+
// {
|
|
3151
|
+
// bar: 'bar'
|
|
3152
|
+
// }
|
|
3153
|
+
// ]
|
|
3154
|
+
// bar: { subBar: boolean }[]
|
|
3155
|
+
// baz: {
|
|
3156
|
+
// foo: 'foo'
|
|
3157
|
+
// bar: {
|
|
3158
|
+
// baz: 'baz'
|
|
3159
|
+
// }
|
|
3160
|
+
// }
|
|
3161
|
+
// }
|
|
3162
|
+
// }
|
|
3163
|
+
// const test: DeepKeys<Person> = 'nested.foo.0.bar'
|
|
3164
|
+
// const test2: DeepKeys<Person> = 'nested.bar'
|
|
3165
|
+
// const helper = createColumnHelper<Person>()
|
|
3166
|
+
// helper.accessor('nested.foo', {
|
|
3167
|
+
// cell: info => info.getValue(),
|
|
3168
|
+
// })
|
|
3169
|
+
// helper.accessor('nested.foo.0.bar', {
|
|
3170
|
+
// cell: info => info.getValue(),
|
|
3171
|
+
// })
|
|
3172
|
+
// helper.accessor('nested.bar', {
|
|
3173
|
+
// cell: info => info.getValue(),
|
|
3174
|
+
// })
|
|
3175
|
+
function createColumnHelper() {
|
|
3176
|
+
return {
|
|
3177
|
+
accessor: (accessor, column) => {
|
|
3178
|
+
return typeof accessor === 'function' ? { ...column,
|
|
3179
|
+
accessorFn: accessor
|
|
3180
|
+
} : { ...column,
|
|
3181
|
+
accessorKey: accessor
|
|
3182
|
+
};
|
|
3183
|
+
}
|
|
3184
|
+
};
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3124
3187
|
function getCoreRowModel() {
|
|
3125
3188
|
return table => memo(() => [table.options.data], data => {
|
|
3126
3189
|
const rowModel = {
|
|
@@ -3883,6 +3946,7 @@
|
|
|
3883
3946
|
exports.aggregationFns = aggregationFns;
|
|
3884
3947
|
exports.buildHeaderGroups = buildHeaderGroups;
|
|
3885
3948
|
exports.createColumn = createColumn;
|
|
3949
|
+
exports.createColumnHelper = createColumnHelper;
|
|
3886
3950
|
exports.createRow = createRow;
|
|
3887
3951
|
exports.createTable = createTable;
|
|
3888
3952
|
exports.defaultColumnSizing = defaultColumnSizing;
|