@tanstack/svelte-table 8.0.0-alpha.76 → 8.0.0-alpha.79
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 +38 -9
- package/build/cjs/svelte-table/src/index.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +9 -7
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +46 -16
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +48 -42
- package/build/types/index.d.ts +1 -1
- package/build/umd/index.development.js +46 -16
- 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/src/index.ts +39 -7
package/build/stats-html.html
CHANGED
|
@@ -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":"
|
|
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":"3880-163"},{"name":"svelte-table/src","children":[{"uid":"3880-165","name":"placeholder.svelte"},{"uid":"3880-167","name":"render-component.ts"},{"uid":"3880-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"3880-163":{"renderedLength":139811,"gzipLength":23895,"brotliLength":0,"mainUid":"3880-162"},"3880-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"3880-164"},"3880-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"3880-166"},"3880-169":{"renderedLength":2729,"gzipLength":868,"brotliLength":0,"mainUid":"3880-168"}},"nodeMetas":{"3880-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"3880-163"},"imported":[],"importedBy":[{"uid":"3880-168"}]},"3880-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"3880-165"},"imported":[{"uid":"3880-170"}],"importedBy":[{"uid":"3880-168"}]},"3880-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"3880-167"},"imported":[{"uid":"3880-170"}],"importedBy":[{"uid":"3880-168"}]},"3880-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"3880-169"},"imported":[{"uid":"3880-162"},{"uid":"3880-164"},{"uid":"3880-170"},{"uid":"3880-171"},{"uid":"3880-166"}],"importedBy":[],"isEntry":true},"3880-170":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"3880-168"},{"uid":"3880-164"},{"uid":"3880-166"}],"isExternal":true},"3880-171":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"3880-168"}],"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;
|
package/build/stats-react.json
CHANGED
|
@@ -11,21 +11,21 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "3880-173"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "3880-175",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "3880-177",
|
|
25
25
|
"name": "render-component.ts"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"uid": "
|
|
28
|
+
"uid": "3880-179",
|
|
29
29
|
"name": "index.ts"
|
|
30
30
|
}
|
|
31
31
|
]
|
|
@@ -38,119 +38,125 @@
|
|
|
38
38
|
"isRoot": true
|
|
39
39
|
},
|
|
40
40
|
"nodeParts": {
|
|
41
|
-
"
|
|
42
|
-
"renderedLength":
|
|
43
|
-
"gzipLength":
|
|
41
|
+
"3880-173": {
|
|
42
|
+
"renderedLength": 139811,
|
|
43
|
+
"gzipLength": 23895,
|
|
44
44
|
"brotliLength": 0,
|
|
45
|
-
"mainUid": "
|
|
45
|
+
"mainUid": "3880-172"
|
|
46
46
|
},
|
|
47
|
-
"
|
|
47
|
+
"3880-175": {
|
|
48
48
|
"renderedLength": 925,
|
|
49
49
|
"gzipLength": 444,
|
|
50
50
|
"brotliLength": 0,
|
|
51
|
-
"mainUid": "
|
|
51
|
+
"mainUid": "3880-174"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
53
|
+
"3880-177": {
|
|
54
54
|
"renderedLength": 1365,
|
|
55
55
|
"gzipLength": 519,
|
|
56
56
|
"brotliLength": 0,
|
|
57
|
-
"mainUid": "
|
|
57
|
+
"mainUid": "3880-176"
|
|
58
58
|
},
|
|
59
|
-
"
|
|
60
|
-
"renderedLength":
|
|
61
|
-
"gzipLength":
|
|
59
|
+
"3880-179": {
|
|
60
|
+
"renderedLength": 2729,
|
|
61
|
+
"gzipLength": 868,
|
|
62
62
|
"brotliLength": 0,
|
|
63
|
-
"mainUid": "
|
|
63
|
+
"mainUid": "3880-178"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"nodeMetas": {
|
|
67
|
-
"
|
|
67
|
+
"3880-172": {
|
|
68
68
|
"id": "/packages/table-core/build/esm/index.js",
|
|
69
69
|
"moduleParts": {
|
|
70
|
-
"index.production.js": "
|
|
70
|
+
"index.production.js": "3880-173"
|
|
71
71
|
},
|
|
72
72
|
"imported": [],
|
|
73
73
|
"importedBy": [
|
|
74
74
|
{
|
|
75
|
-
"uid": "
|
|
75
|
+
"uid": "3880-178"
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"3880-174": {
|
|
80
80
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
81
81
|
"moduleParts": {
|
|
82
|
-
"index.production.js": "
|
|
82
|
+
"index.production.js": "3880-175"
|
|
83
83
|
},
|
|
84
84
|
"imported": [
|
|
85
85
|
{
|
|
86
|
-
"uid": "
|
|
86
|
+
"uid": "3880-180"
|
|
87
87
|
}
|
|
88
88
|
],
|
|
89
89
|
"importedBy": [
|
|
90
90
|
{
|
|
91
|
-
"uid": "
|
|
91
|
+
"uid": "3880-178"
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"
|
|
95
|
+
"3880-176": {
|
|
96
96
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
97
97
|
"moduleParts": {
|
|
98
|
-
"index.production.js": "
|
|
98
|
+
"index.production.js": "3880-177"
|
|
99
99
|
},
|
|
100
100
|
"imported": [
|
|
101
101
|
{
|
|
102
|
-
"uid": "
|
|
102
|
+
"uid": "3880-180"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"importedBy": [
|
|
106
106
|
{
|
|
107
|
-
"uid": "
|
|
107
|
+
"uid": "3880-178"
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"3880-178": {
|
|
112
112
|
"id": "/packages/svelte-table/src/index.ts",
|
|
113
113
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
114
|
+
"index.production.js": "3880-179"
|
|
115
115
|
},
|
|
116
116
|
"imported": [
|
|
117
117
|
{
|
|
118
|
-
"uid": "
|
|
118
|
+
"uid": "3880-172"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
"uid": "
|
|
121
|
+
"uid": "3880-174"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
"uid": "
|
|
124
|
+
"uid": "3880-180"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
"uid": "
|
|
127
|
+
"uid": "3880-181"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"uid": "3880-176"
|
|
128
131
|
}
|
|
129
132
|
],
|
|
130
133
|
"importedBy": [],
|
|
131
134
|
"isEntry": true
|
|
132
135
|
},
|
|
133
|
-
"
|
|
134
|
-
"id": "svelte/
|
|
136
|
+
"3880-180": {
|
|
137
|
+
"id": "svelte/internal",
|
|
135
138
|
"moduleParts": {},
|
|
136
139
|
"imported": [],
|
|
137
140
|
"importedBy": [
|
|
138
141
|
{
|
|
139
|
-
"uid": "
|
|
142
|
+
"uid": "3880-178"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"uid": "3880-174"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"uid": "3880-176"
|
|
140
149
|
}
|
|
141
150
|
],
|
|
142
151
|
"isExternal": true
|
|
143
152
|
},
|
|
144
|
-
"
|
|
145
|
-
"id": "svelte/
|
|
153
|
+
"3880-181": {
|
|
154
|
+
"id": "svelte/store",
|
|
146
155
|
"moduleParts": {},
|
|
147
156
|
"imported": [],
|
|
148
157
|
"importedBy": [
|
|
149
158
|
{
|
|
150
|
-
"uid": "
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"uid": "e2ab-176"
|
|
159
|
+
"uid": "3880-178"
|
|
154
160
|
}
|
|
155
161
|
],
|
|
156
162
|
"isExternal": true
|
package/build/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { PartialKeys, Table, TableGenerics, TableOptions } from '@tanstack/table
|
|
|
2
2
|
import { Readable } from 'svelte/store';
|
|
3
3
|
export { renderComponent } from './render-component';
|
|
4
4
|
export * from '@tanstack/table-core';
|
|
5
|
-
export declare function render(
|
|
5
|
+
export declare function render(component: any, props: any): any;
|
|
6
6
|
export declare const createTable: () => Table<{
|
|
7
7
|
Renderer: typeof render;
|
|
8
8
|
Rendered: any;
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
-
const startSize =
|
|
540
|
+
const startSize = header.getSize();
|
|
541
541
|
const columnSizingStart = header ? header.getLeafHeaders().map(d => [d.column.id, d.column.getSize()]) : [[column.id, column.getSize()]];
|
|
542
542
|
const clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;
|
|
543
543
|
|
|
@@ -2684,8 +2684,10 @@
|
|
|
2684
2684
|
},
|
|
2685
2685
|
// Header Groups
|
|
2686
2686
|
getHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.left, instance.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
|
|
2687
|
-
|
|
2688
|
-
|
|
2687
|
+
var _left$map$filter, _right$map$filter;
|
|
2688
|
+
|
|
2689
|
+
const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
|
|
2690
|
+
const rightColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
|
|
2689
2691
|
const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
2690
2692
|
const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], instance);
|
|
2691
2693
|
return headerGroups;
|
|
@@ -2709,9 +2711,9 @@
|
|
|
2709
2711
|
}
|
|
2710
2712
|
}),
|
|
2711
2713
|
getLeftHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.left], (allColumns, leafColumns, left) => {
|
|
2712
|
-
var _left$map$
|
|
2714
|
+
var _left$map$filter2;
|
|
2713
2715
|
|
|
2714
|
-
const orderedLeafColumns = (_left$map$
|
|
2716
|
+
const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
|
|
2715
2717
|
return buildHeaderGroups(allColumns, orderedLeafColumns, instance, 'left');
|
|
2716
2718
|
}, {
|
|
2717
2719
|
key: 'getLeftHeaderGroups',
|
|
@@ -2722,9 +2724,9 @@
|
|
|
2722
2724
|
}
|
|
2723
2725
|
}),
|
|
2724
2726
|
getRightHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.right], (allColumns, leafColumns, right) => {
|
|
2725
|
-
var _right$map$
|
|
2727
|
+
var _right$map$filter2;
|
|
2726
2728
|
|
|
2727
|
-
const orderedLeafColumns = (_right$map$
|
|
2729
|
+
const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
|
|
2728
2730
|
return buildHeaderGroups(allColumns, orderedLeafColumns, instance, 'right');
|
|
2729
2731
|
}, {
|
|
2730
2732
|
key: 'getRightHeaderGroups',
|
|
@@ -4001,18 +4003,46 @@
|
|
|
4001
4003
|
|
|
4002
4004
|
const renderComponent = typeof window === 'undefined' ? renderServer : renderClient;
|
|
4003
4005
|
|
|
4004
|
-
function
|
|
4005
|
-
|
|
4006
|
+
function isSvelteServerComponent(component) {
|
|
4007
|
+
return typeof component === 'object' && typeof component.$$render === 'function' && typeof component.render === 'function';
|
|
4008
|
+
}
|
|
4006
4009
|
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
+
function isSvelteClientComponent(component) {
|
|
4011
|
+
return component.prototype instanceof internal.SvelteComponent;
|
|
4012
|
+
}
|
|
4013
|
+
|
|
4014
|
+
function isSvelteComponent(component) {
|
|
4015
|
+
if (typeof document === 'undefined') {
|
|
4016
|
+
return isSvelteServerComponent(component);
|
|
4010
4017
|
} else {
|
|
4011
|
-
return
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4018
|
+
return isSvelteClientComponent(component);
|
|
4019
|
+
}
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
function wrapInPlaceholder(content) {
|
|
4023
|
+
return renderComponent(Placeholder, {
|
|
4024
|
+
content
|
|
4025
|
+
});
|
|
4026
|
+
}
|
|
4027
|
+
|
|
4028
|
+
function render(component, props) {
|
|
4029
|
+
if (!component) return null;
|
|
4030
|
+
|
|
4031
|
+
if (isSvelteComponent(component)) {
|
|
4032
|
+
return renderComponent(component, props);
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
if (typeof component === 'function') {
|
|
4036
|
+
const result = component(props);
|
|
4037
|
+
|
|
4038
|
+
if (isSvelteComponent(result)) {
|
|
4039
|
+
return result;
|
|
4040
|
+
}
|
|
4041
|
+
|
|
4042
|
+
return wrapInPlaceholder(result);
|
|
4043
|
+
}
|
|
4015
4044
|
|
|
4045
|
+
return wrapInPlaceholder(component);
|
|
4016
4046
|
}
|
|
4017
4047
|
const createTable = createTableFactory({
|
|
4018
4048
|
render
|