@tanstack/vue-table 8.5.1 → 8.5.4
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 +20 -7
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/cjs/vue-table/src/index.js +12 -12
- package/build/cjs/vue-table/src/index.js.map +1 -1
- package/build/esm/index.js +32 -19
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +26 -26
- package/build/types/index.d.ts +8 -3
- package/build/umd/index.development.js +32 -19
- 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 +14 -15
package/build/stats-html.html
CHANGED
|
@@ -4014,7 +4014,7 @@ var drawChart = (function (exports) {
|
|
|
4014
4014
|
</script>
|
|
4015
4015
|
<script>
|
|
4016
4016
|
/*<!--*/
|
|
4017
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"
|
|
4017
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"6204-149"},{"name":"vue-table/src","children":[{"uid":"6204-151","name":"merge-proxy.ts"},{"uid":"6204-153","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"6204-149":{"renderedLength":138231,"gzipLength":23986,"brotliLength":0,"mainUid":"6204-148"},"6204-151":{"renderedLength":1622,"gzipLength":660,"brotliLength":0,"mainUid":"6204-150"},"6204-153":{"renderedLength":1748,"gzipLength":687,"brotliLength":0,"mainUid":"6204-152"}},"nodeMetas":{"6204-148":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"6204-149"},"imported":[],"importedBy":[{"uid":"6204-152"}]},"6204-150":{"id":"/packages/vue-table/src/merge-proxy.ts","moduleParts":{"index.production.js":"6204-151"},"imported":[],"importedBy":[{"uid":"6204-152"}]},"6204-152":{"id":"/packages/vue-table/src/index.ts","moduleParts":{"index.production.js":"6204-153"},"imported":[{"uid":"6204-148"},{"uid":"6204-154"},{"uid":"6204-150"}],"importedBy":[],"isEntry":true},"6204-154":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"6204-152"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
4018
4018
|
|
|
4019
4019
|
const run = () => {
|
|
4020
4020
|
const width = window.innerWidth;
|
package/build/stats-react.json
CHANGED
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "6204-156"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "vue-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "6204-158",
|
|
21
21
|
"name": "merge-proxy.ts"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "6204-160",
|
|
25
25
|
"name": "index.ts"
|
|
26
26
|
}
|
|
27
27
|
]
|
|
@@ -34,76 +34,76 @@
|
|
|
34
34
|
"isRoot": true
|
|
35
35
|
},
|
|
36
36
|
"nodeParts": {
|
|
37
|
-
"
|
|
38
|
-
"renderedLength":
|
|
39
|
-
"gzipLength":
|
|
37
|
+
"6204-156": {
|
|
38
|
+
"renderedLength": 138231,
|
|
39
|
+
"gzipLength": 23986,
|
|
40
40
|
"brotliLength": 0,
|
|
41
|
-
"mainUid": "
|
|
41
|
+
"mainUid": "6204-155"
|
|
42
42
|
},
|
|
43
|
-
"
|
|
43
|
+
"6204-158": {
|
|
44
44
|
"renderedLength": 1622,
|
|
45
45
|
"gzipLength": 660,
|
|
46
46
|
"brotliLength": 0,
|
|
47
|
-
"mainUid": "
|
|
47
|
+
"mainUid": "6204-157"
|
|
48
48
|
},
|
|
49
|
-
"
|
|
50
|
-
"renderedLength":
|
|
51
|
-
"gzipLength":
|
|
49
|
+
"6204-160": {
|
|
50
|
+
"renderedLength": 1748,
|
|
51
|
+
"gzipLength": 687,
|
|
52
52
|
"brotliLength": 0,
|
|
53
|
-
"mainUid": "
|
|
53
|
+
"mainUid": "6204-159"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"nodeMetas": {
|
|
57
|
-
"
|
|
57
|
+
"6204-155": {
|
|
58
58
|
"id": "/packages/table-core/build/esm/index.js",
|
|
59
59
|
"moduleParts": {
|
|
60
|
-
"index.production.js": "
|
|
60
|
+
"index.production.js": "6204-156"
|
|
61
61
|
},
|
|
62
62
|
"imported": [],
|
|
63
63
|
"importedBy": [
|
|
64
64
|
{
|
|
65
|
-
"uid": "
|
|
65
|
+
"uid": "6204-159"
|
|
66
66
|
}
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
|
-
"
|
|
69
|
+
"6204-157": {
|
|
70
70
|
"id": "/packages/vue-table/src/merge-proxy.ts",
|
|
71
71
|
"moduleParts": {
|
|
72
|
-
"index.production.js": "
|
|
72
|
+
"index.production.js": "6204-158"
|
|
73
73
|
},
|
|
74
74
|
"imported": [],
|
|
75
75
|
"importedBy": [
|
|
76
76
|
{
|
|
77
|
-
"uid": "
|
|
77
|
+
"uid": "6204-159"
|
|
78
78
|
}
|
|
79
79
|
]
|
|
80
80
|
},
|
|
81
|
-
"
|
|
81
|
+
"6204-159": {
|
|
82
82
|
"id": "/packages/vue-table/src/index.ts",
|
|
83
83
|
"moduleParts": {
|
|
84
|
-
"index.production.js": "
|
|
84
|
+
"index.production.js": "6204-160"
|
|
85
85
|
},
|
|
86
86
|
"imported": [
|
|
87
87
|
{
|
|
88
|
-
"uid": "
|
|
88
|
+
"uid": "6204-155"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
"uid": "
|
|
91
|
+
"uid": "6204-161"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
|
-
"uid": "
|
|
94
|
+
"uid": "6204-157"
|
|
95
95
|
}
|
|
96
96
|
],
|
|
97
97
|
"importedBy": [],
|
|
98
98
|
"isEntry": true
|
|
99
99
|
},
|
|
100
|
-
"
|
|
100
|
+
"6204-161": {
|
|
101
101
|
"id": "vue",
|
|
102
102
|
"moduleParts": {},
|
|
103
103
|
"imported": [],
|
|
104
104
|
"importedBy": [
|
|
105
105
|
{
|
|
106
|
-
"uid": "
|
|
106
|
+
"uid": "6204-159"
|
|
107
107
|
}
|
|
108
108
|
],
|
|
109
109
|
"isExternal": true
|
package/build/types/index.d.ts
CHANGED
|
@@ -11,9 +11,14 @@
|
|
|
11
11
|
import * as _tanstack_table_core from '@tanstack/table-core';
|
|
12
12
|
import { RowData, TableOptions } from '@tanstack/table-core';
|
|
13
13
|
export * from '@tanstack/table-core';
|
|
14
|
-
import { VNode } from 'vue';
|
|
15
14
|
|
|
16
|
-
declare
|
|
15
|
+
declare const FlexRender: {
|
|
16
|
+
props: string[];
|
|
17
|
+
setup: (props: {
|
|
18
|
+
render: any;
|
|
19
|
+
props: any;
|
|
20
|
+
}) => () => any;
|
|
21
|
+
};
|
|
17
22
|
declare function useVueTable<TData extends RowData>(options: TableOptions<TData>): _tanstack_table_core.Table<TData>;
|
|
18
23
|
|
|
19
|
-
export {
|
|
24
|
+
export { FlexRender, useVueTable };
|
|
@@ -2160,14 +2160,14 @@
|
|
|
2160
2160
|
// return table.options.enableGroupingRowSelection ?? false
|
|
2161
2161
|
// },
|
|
2162
2162
|
getIsAllRowsSelected: () => {
|
|
2163
|
-
const
|
|
2163
|
+
const preGroupedFlatRows = table.getFilteredRowModel().flatRows;
|
|
2164
2164
|
const {
|
|
2165
2165
|
rowSelection
|
|
2166
2166
|
} = table.getState();
|
|
2167
|
-
let isAllRowsSelected = Boolean(
|
|
2167
|
+
let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);
|
|
2168
2168
|
|
|
2169
2169
|
if (isAllRowsSelected) {
|
|
2170
|
-
if (
|
|
2170
|
+
if (preGroupedFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
|
|
2171
2171
|
isAllRowsSelected = false;
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
@@ -2191,7 +2191,7 @@
|
|
|
2191
2191
|
var _table$getState$rowSe;
|
|
2192
2192
|
|
|
2193
2193
|
const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
|
|
2194
|
-
return totalSelected > 0 && totalSelected < table.
|
|
2194
|
+
return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
|
|
2195
2195
|
},
|
|
2196
2196
|
getIsSomePageRowsSelected: () => {
|
|
2197
2197
|
const paginationFlatRows = table.getPaginationRowModel().flatRows;
|
|
@@ -2935,8 +2935,20 @@
|
|
|
2935
2935
|
|
|
2936
2936
|
defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
|
|
2937
2937
|
return {
|
|
2938
|
-
header: props =>
|
|
2939
|
-
|
|
2938
|
+
header: props => {
|
|
2939
|
+
const resolvedColumnDef = props.header.column.columnDef;
|
|
2940
|
+
|
|
2941
|
+
if (resolvedColumnDef.accessorKey) {
|
|
2942
|
+
return resolvedColumnDef.accessorKey;
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
if (resolvedColumnDef.accessorFn) {
|
|
2946
|
+
return resolvedColumnDef.id;
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
return null;
|
|
2950
|
+
},
|
|
2951
|
+
// footer: props => props.header.column.id,
|
|
2940
2952
|
cell: props => {
|
|
2941
2953
|
var _props$renderValue$to, _props$renderValue;
|
|
2942
2954
|
|
|
@@ -2964,7 +2976,8 @@
|
|
|
2964
2976
|
|
|
2965
2977
|
return columnDefs.map(columnDef => {
|
|
2966
2978
|
const column = createColumn(table, columnDef, depth, parent);
|
|
2967
|
-
|
|
2979
|
+
const groupingColumnDef = columnDef;
|
|
2980
|
+
column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];
|
|
2968
2981
|
return column;
|
|
2969
2982
|
});
|
|
2970
2983
|
};
|
|
@@ -3948,15 +3961,18 @@
|
|
|
3948
3961
|
}, propTraps);
|
|
3949
3962
|
}
|
|
3950
3963
|
|
|
3951
|
-
|
|
3952
|
-
|
|
3964
|
+
const FlexRender = {
|
|
3965
|
+
props: ['render', 'props'],
|
|
3966
|
+
setup: props => {
|
|
3967
|
+
return () => {
|
|
3968
|
+
if (typeof props.render === 'function' || typeof props.render === 'object') {
|
|
3969
|
+
return vue.h(props.render, props.props);
|
|
3970
|
+
}
|
|
3953
3971
|
|
|
3954
|
-
|
|
3955
|
-
|
|
3972
|
+
return props.render;
|
|
3973
|
+
};
|
|
3956
3974
|
}
|
|
3957
|
-
|
|
3958
|
-
return Comp;
|
|
3959
|
-
}
|
|
3975
|
+
};
|
|
3960
3976
|
function useVueTable(options) {
|
|
3961
3977
|
const resolvedOptions = mergeProxy({
|
|
3962
3978
|
state: {},
|
|
@@ -3998,16 +4014,14 @@
|
|
|
3998
4014
|
}
|
|
3999
4015
|
});
|
|
4000
4016
|
});
|
|
4001
|
-
});
|
|
4002
|
-
// table.willUpdate()
|
|
4003
|
-
// })
|
|
4004
|
-
|
|
4017
|
+
});
|
|
4005
4018
|
return table;
|
|
4006
4019
|
}
|
|
4007
4020
|
|
|
4008
4021
|
exports.ColumnSizing = ColumnSizing;
|
|
4009
4022
|
exports.Expanding = Expanding;
|
|
4010
4023
|
exports.Filters = Filters;
|
|
4024
|
+
exports.FlexRender = FlexRender;
|
|
4011
4025
|
exports.Grouping = Grouping;
|
|
4012
4026
|
exports.Headers = Headers;
|
|
4013
4027
|
exports.Ordering = Ordering;
|
|
@@ -4027,7 +4041,6 @@
|
|
|
4027
4041
|
exports.expandRows = expandRows;
|
|
4028
4042
|
exports.filterFns = filterFns;
|
|
4029
4043
|
exports.flattenBy = flattenBy;
|
|
4030
|
-
exports.flexRender = flexRender;
|
|
4031
4044
|
exports.functionalUpdate = functionalUpdate;
|
|
4032
4045
|
exports.getCoreRowModel = getCoreRowModel;
|
|
4033
4046
|
exports.getExpandedRowModel = getExpandedRowModel;
|