@tanstack/svelte-table 8.2.5 → 8.3.1
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/svelte-table/src/index.js +1 -0
- package/build/cjs/svelte-table/src/index.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +71 -6
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +72 -8
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1451 -106
- package/build/stats-react.json +48 -48
- package/build/umd/index.development.js +71 -6
- 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,25 +11,25 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "d409-175"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "d409-177",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "d409-179",
|
|
25
25
|
"name": "placeholder.ts"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"uid": "
|
|
28
|
+
"uid": "d409-181",
|
|
29
29
|
"name": "render-component.ts"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
"uid": "
|
|
32
|
+
"uid": "d409-183",
|
|
33
33
|
"name": "index.ts"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
@@ -42,160 +42,160 @@
|
|
|
42
42
|
"isRoot": true
|
|
43
43
|
},
|
|
44
44
|
"nodeParts": {
|
|
45
|
-
"
|
|
46
|
-
"renderedLength":
|
|
47
|
-
"gzipLength":
|
|
45
|
+
"d409-175": {
|
|
46
|
+
"renderedLength": 136731,
|
|
47
|
+
"gzipLength": 23744,
|
|
48
48
|
"brotliLength": 0,
|
|
49
|
-
"mainUid": "
|
|
49
|
+
"mainUid": "d409-174"
|
|
50
50
|
},
|
|
51
|
-
"
|
|
51
|
+
"d409-177": {
|
|
52
52
|
"renderedLength": 927,
|
|
53
53
|
"gzipLength": 445,
|
|
54
54
|
"brotliLength": 0,
|
|
55
|
-
"mainUid": "
|
|
55
|
+
"mainUid": "d409-176"
|
|
56
56
|
},
|
|
57
|
-
"
|
|
57
|
+
"d409-179": {
|
|
58
58
|
"renderedLength": 246,
|
|
59
59
|
"gzipLength": 184,
|
|
60
60
|
"brotliLength": 0,
|
|
61
|
-
"mainUid": "
|
|
61
|
+
"mainUid": "d409-178"
|
|
62
62
|
},
|
|
63
|
-
"
|
|
63
|
+
"d409-181": {
|
|
64
64
|
"renderedLength": 1458,
|
|
65
65
|
"gzipLength": 539,
|
|
66
66
|
"brotliLength": 0,
|
|
67
|
-
"mainUid": "
|
|
67
|
+
"mainUid": "d409-180"
|
|
68
68
|
},
|
|
69
|
-
"
|
|
69
|
+
"d409-183": {
|
|
70
70
|
"renderedLength": 2915,
|
|
71
71
|
"gzipLength": 958,
|
|
72
72
|
"brotliLength": 0,
|
|
73
|
-
"mainUid": "
|
|
73
|
+
"mainUid": "d409-182"
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"nodeMetas": {
|
|
77
|
-
"
|
|
77
|
+
"d409-174": {
|
|
78
78
|
"id": "/packages/table-core/build/esm/index.js",
|
|
79
79
|
"moduleParts": {
|
|
80
|
-
"index.production.js": "
|
|
80
|
+
"index.production.js": "d409-175"
|
|
81
81
|
},
|
|
82
82
|
"imported": [],
|
|
83
83
|
"importedBy": [
|
|
84
84
|
{
|
|
85
|
-
"uid": "
|
|
85
|
+
"uid": "d409-182"
|
|
86
86
|
}
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
|
-
"
|
|
89
|
+
"d409-176": {
|
|
90
90
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
91
91
|
"moduleParts": {
|
|
92
|
-
"index.production.js": "
|
|
92
|
+
"index.production.js": "d409-177"
|
|
93
93
|
},
|
|
94
94
|
"imported": [
|
|
95
95
|
{
|
|
96
|
-
"uid": "
|
|
96
|
+
"uid": "d409-184"
|
|
97
97
|
}
|
|
98
98
|
],
|
|
99
99
|
"importedBy": [
|
|
100
100
|
{
|
|
101
|
-
"uid": "
|
|
101
|
+
"uid": "d409-178"
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
|
-
"
|
|
105
|
+
"d409-178": {
|
|
106
106
|
"id": "/packages/svelte-table/src/placeholder.ts",
|
|
107
107
|
"moduleParts": {
|
|
108
|
-
"index.production.js": "
|
|
108
|
+
"index.production.js": "d409-179"
|
|
109
109
|
},
|
|
110
110
|
"imported": [
|
|
111
111
|
{
|
|
112
|
-
"uid": "
|
|
112
|
+
"uid": "d409-184"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
|
-
"uid": "
|
|
115
|
+
"uid": "d409-176"
|
|
116
116
|
}
|
|
117
117
|
],
|
|
118
118
|
"importedBy": [
|
|
119
119
|
{
|
|
120
|
-
"uid": "
|
|
120
|
+
"uid": "d409-182"
|
|
121
121
|
}
|
|
122
122
|
]
|
|
123
123
|
},
|
|
124
|
-
"
|
|
124
|
+
"d409-180": {
|
|
125
125
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
126
126
|
"moduleParts": {
|
|
127
|
-
"index.production.js": "
|
|
127
|
+
"index.production.js": "d409-181"
|
|
128
128
|
},
|
|
129
129
|
"imported": [
|
|
130
130
|
{
|
|
131
|
-
"uid": "
|
|
131
|
+
"uid": "d409-184"
|
|
132
132
|
}
|
|
133
133
|
],
|
|
134
134
|
"importedBy": [
|
|
135
135
|
{
|
|
136
|
-
"uid": "
|
|
136
|
+
"uid": "d409-182"
|
|
137
137
|
}
|
|
138
138
|
]
|
|
139
139
|
},
|
|
140
|
-
"
|
|
140
|
+
"d409-182": {
|
|
141
141
|
"id": "/packages/svelte-table/src/index.ts",
|
|
142
142
|
"moduleParts": {
|
|
143
|
-
"index.production.js": "
|
|
143
|
+
"index.production.js": "d409-183"
|
|
144
144
|
},
|
|
145
145
|
"imported": [
|
|
146
146
|
{
|
|
147
|
-
"uid": "
|
|
147
|
+
"uid": "d409-174"
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
|
-
"uid": "
|
|
150
|
+
"uid": "d409-178"
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
|
-
"uid": "
|
|
153
|
+
"uid": "d409-184"
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
|
-
"uid": "
|
|
156
|
+
"uid": "d409-185"
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
|
-
"uid": "
|
|
159
|
+
"uid": "d409-180"
|
|
160
160
|
}
|
|
161
161
|
],
|
|
162
162
|
"importedBy": [],
|
|
163
163
|
"isEntry": true
|
|
164
164
|
},
|
|
165
|
-
"
|
|
165
|
+
"d409-184": {
|
|
166
166
|
"id": "svelte/internal",
|
|
167
167
|
"moduleParts": {},
|
|
168
168
|
"imported": [],
|
|
169
169
|
"importedBy": [
|
|
170
170
|
{
|
|
171
|
-
"uid": "
|
|
171
|
+
"uid": "d409-182"
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
|
-
"uid": "
|
|
174
|
+
"uid": "d409-178"
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
|
-
"uid": "
|
|
177
|
+
"uid": "d409-180"
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
|
-
"uid": "
|
|
180
|
+
"uid": "d409-176"
|
|
181
181
|
}
|
|
182
182
|
],
|
|
183
183
|
"isExternal": true
|
|
184
184
|
},
|
|
185
|
-
"
|
|
185
|
+
"d409-185": {
|
|
186
186
|
"id": "svelte/store",
|
|
187
187
|
"moduleParts": {},
|
|
188
188
|
"imported": [],
|
|
189
189
|
"importedBy": [
|
|
190
190
|
{
|
|
191
|
-
"uid": "
|
|
191
|
+
"uid": "d409-182"
|
|
192
192
|
}
|
|
193
193
|
],
|
|
194
194
|
"isExternal": true
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
"env": {
|
|
198
|
-
"rollup": "2.
|
|
198
|
+
"rollup": "2.77.0"
|
|
199
199
|
},
|
|
200
200
|
"options": {
|
|
201
201
|
"gzip": true,
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
*
|
|
25
25
|
* @license MIT
|
|
26
26
|
*/
|
|
27
|
+
// Is this type a tuple?
|
|
28
|
+
// If this type is a tuple, what indices are allowed?
|
|
29
|
+
///
|
|
27
30
|
function functionalUpdate(updater, input) {
|
|
28
31
|
return typeof updater === 'function' ? updater(input) : updater;
|
|
29
32
|
}
|
|
@@ -109,13 +112,27 @@
|
|
|
109
112
|
const resolvedColumnDef = { ...defaultColumn,
|
|
110
113
|
...columnDef
|
|
111
114
|
};
|
|
112
|
-
|
|
115
|
+
const accessorKey = resolvedColumnDef.accessorKey;
|
|
116
|
+
let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? accessorKey.replace('.', '_') : undefined) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;
|
|
113
117
|
let accessorFn;
|
|
114
118
|
|
|
115
119
|
if (resolvedColumnDef.accessorFn) {
|
|
116
120
|
accessorFn = resolvedColumnDef.accessorFn;
|
|
117
|
-
} else if (
|
|
118
|
-
|
|
121
|
+
} else if (accessorKey) {
|
|
122
|
+
// Support deep accessor keys
|
|
123
|
+
if (accessorKey.includes('.')) {
|
|
124
|
+
accessorFn = originalRow => {
|
|
125
|
+
let result = originalRow;
|
|
126
|
+
|
|
127
|
+
for (const key of accessorKey.split('.')) {
|
|
128
|
+
result = result[key];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return result;
|
|
132
|
+
};
|
|
133
|
+
} else {
|
|
134
|
+
accessorFn = originalRow => originalRow[resolvedColumnDef.accessorKey];
|
|
135
|
+
}
|
|
119
136
|
}
|
|
120
137
|
|
|
121
138
|
if (!id) {
|
|
@@ -1109,7 +1126,7 @@
|
|
|
1109
1126
|
var _table$getCoreRowMode, _table$getCoreRowMode2;
|
|
1110
1127
|
|
|
1111
1128
|
const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null ? void 0 : (_table$getCoreRowMode2 = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode2.getValue();
|
|
1112
|
-
return typeof value === 'string';
|
|
1129
|
+
return typeof value === 'string' || typeof value === 'number';
|
|
1113
1130
|
}
|
|
1114
1131
|
};
|
|
1115
1132
|
},
|
|
@@ -2141,7 +2158,7 @@
|
|
|
2141
2158
|
let isAllRowsSelected = Boolean(preFilteredFlatRows.length && Object.keys(rowSelection).length);
|
|
2142
2159
|
|
|
2143
2160
|
if (isAllRowsSelected) {
|
|
2144
|
-
if (preFilteredFlatRows.some(row => !rowSelection[row.id])) {
|
|
2161
|
+
if (preFilteredFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
|
|
2145
2162
|
isAllRowsSelected = false;
|
|
2146
2163
|
}
|
|
2147
2164
|
}
|
|
@@ -2164,7 +2181,8 @@
|
|
|
2164
2181
|
getIsSomeRowsSelected: () => {
|
|
2165
2182
|
var _table$getState$rowSe;
|
|
2166
2183
|
|
|
2167
|
-
|
|
2184
|
+
const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
|
|
2185
|
+
return totalSelected < table.getCoreRowModel().flatRows.length;
|
|
2168
2186
|
},
|
|
2169
2187
|
getIsSomePageRowsSelected: () => {
|
|
2170
2188
|
const paginationFlatRows = table.getPaginationRowModel().flatRows;
|
|
@@ -3101,6 +3119,52 @@
|
|
|
3101
3119
|
return row;
|
|
3102
3120
|
};
|
|
3103
3121
|
|
|
3122
|
+
// type Person = {
|
|
3123
|
+
// firstName: string
|
|
3124
|
+
// lastName: string
|
|
3125
|
+
// age: number
|
|
3126
|
+
// visits: number
|
|
3127
|
+
// status: string
|
|
3128
|
+
// progress: number
|
|
3129
|
+
// nested: {
|
|
3130
|
+
// foo: [
|
|
3131
|
+
// {
|
|
3132
|
+
// bar: 'bar'
|
|
3133
|
+
// }
|
|
3134
|
+
// ]
|
|
3135
|
+
// bar: { subBar: boolean }[]
|
|
3136
|
+
// baz: {
|
|
3137
|
+
// foo: 'foo'
|
|
3138
|
+
// bar: {
|
|
3139
|
+
// baz: 'baz'
|
|
3140
|
+
// }
|
|
3141
|
+
// }
|
|
3142
|
+
// }
|
|
3143
|
+
// }
|
|
3144
|
+
// const test: DeepKeys<Person> = 'nested.foo.0.bar'
|
|
3145
|
+
// const test2: DeepKeys<Person> = 'nested.bar'
|
|
3146
|
+
// const helper = createColumnHelper<Person>()
|
|
3147
|
+
// helper.accessor('nested.foo', {
|
|
3148
|
+
// cell: info => info.getValue(),
|
|
3149
|
+
// })
|
|
3150
|
+
// helper.accessor('nested.foo.0.bar', {
|
|
3151
|
+
// cell: info => info.getValue(),
|
|
3152
|
+
// })
|
|
3153
|
+
// helper.accessor('nested.bar', {
|
|
3154
|
+
// cell: info => info.getValue(),
|
|
3155
|
+
// })
|
|
3156
|
+
function createColumnHelper() {
|
|
3157
|
+
return {
|
|
3158
|
+
accessor: (accessor, column) => {
|
|
3159
|
+
return typeof accessor === 'function' ? { ...column,
|
|
3160
|
+
accessorFn: accessor
|
|
3161
|
+
} : { ...column,
|
|
3162
|
+
accessorKey: accessor
|
|
3163
|
+
};
|
|
3164
|
+
}
|
|
3165
|
+
};
|
|
3166
|
+
}
|
|
3167
|
+
|
|
3104
3168
|
function getCoreRowModel() {
|
|
3105
3169
|
return table => memo(() => [table.options.data], data => {
|
|
3106
3170
|
const rowModel = {
|
|
@@ -4015,6 +4079,7 @@
|
|
|
4015
4079
|
exports.aggregationFns = aggregationFns;
|
|
4016
4080
|
exports.buildHeaderGroups = buildHeaderGroups;
|
|
4017
4081
|
exports.createColumn = createColumn;
|
|
4082
|
+
exports.createColumnHelper = createColumnHelper;
|
|
4018
4083
|
exports.createRow = createRow;
|
|
4019
4084
|
exports.createSvelteTable = createSvelteTable;
|
|
4020
4085
|
exports.createTable = createTable;
|