@tanstack/vue-table 8.0.0-beta.3 → 8.0.0-beta.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 +47 -13
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/cjs/vue-table/src/index.js +1 -0
- package/build/cjs/vue-table/src/index.js.map +1 -1
- package/build/esm/index.js +48 -13
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +26 -26
- package/build/umd/index.development.js +48 -13
- 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 +1 -0
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":"50f7-149"},{"name":"vue-table/src","children":[{"uid":"50f7-151","name":"merge-proxy.ts"},{"uid":"50f7-153","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"50f7-149":{"renderedLength":138364,"gzipLength":23596,"brotliLength":0,"mainUid":"50f7-148"},"50f7-151":{"renderedLength":1622,"gzipLength":660,"brotliLength":0,"mainUid":"50f7-150"},"50f7-153":{"renderedLength":1807,"gzipLength":709,"brotliLength":0,"mainUid":"50f7-152"}},"nodeMetas":{"50f7-148":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"50f7-149"},"imported":[],"importedBy":[{"uid":"50f7-152"}]},"50f7-150":{"id":"/packages/vue-table/src/merge-proxy.ts","moduleParts":{"index.production.js":"50f7-151"},"imported":[],"importedBy":[{"uid":"50f7-152"}]},"50f7-152":{"id":"/packages/vue-table/src/index.ts","moduleParts":{"index.production.js":"50f7-153"},"imported":[{"uid":"50f7-148"},{"uid":"50f7-154"},{"uid":"50f7-150"}],"importedBy":[],"isEntry":true},"50f7-154":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"50f7-152"}],"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,17 +11,17 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "50f7-156"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "vue-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "50f7-158",
|
|
21
21
|
"name": "merge-proxy.ts"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "50f7-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
|
+
"50f7-156": {
|
|
38
|
+
"renderedLength": 138364,
|
|
39
|
+
"gzipLength": 23596,
|
|
40
40
|
"brotliLength": 0,
|
|
41
|
-
"mainUid": "
|
|
41
|
+
"mainUid": "50f7-155"
|
|
42
42
|
},
|
|
43
|
-
"
|
|
43
|
+
"50f7-158": {
|
|
44
44
|
"renderedLength": 1622,
|
|
45
45
|
"gzipLength": 660,
|
|
46
46
|
"brotliLength": 0,
|
|
47
|
-
"mainUid": "
|
|
47
|
+
"mainUid": "50f7-157"
|
|
48
48
|
},
|
|
49
|
-
"
|
|
50
|
-
"renderedLength":
|
|
51
|
-
"gzipLength":
|
|
49
|
+
"50f7-160": {
|
|
50
|
+
"renderedLength": 1807,
|
|
51
|
+
"gzipLength": 709,
|
|
52
52
|
"brotliLength": 0,
|
|
53
|
-
"mainUid": "
|
|
53
|
+
"mainUid": "50f7-159"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"nodeMetas": {
|
|
57
|
-
"
|
|
57
|
+
"50f7-155": {
|
|
58
58
|
"id": "/packages/table-core/build/esm/index.js",
|
|
59
59
|
"moduleParts": {
|
|
60
|
-
"index.production.js": "
|
|
60
|
+
"index.production.js": "50f7-156"
|
|
61
61
|
},
|
|
62
62
|
"imported": [],
|
|
63
63
|
"importedBy": [
|
|
64
64
|
{
|
|
65
|
-
"uid": "
|
|
65
|
+
"uid": "50f7-159"
|
|
66
66
|
}
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
|
-
"
|
|
69
|
+
"50f7-157": {
|
|
70
70
|
"id": "/packages/vue-table/src/merge-proxy.ts",
|
|
71
71
|
"moduleParts": {
|
|
72
|
-
"index.production.js": "
|
|
72
|
+
"index.production.js": "50f7-158"
|
|
73
73
|
},
|
|
74
74
|
"imported": [],
|
|
75
75
|
"importedBy": [
|
|
76
76
|
{
|
|
77
|
-
"uid": "
|
|
77
|
+
"uid": "50f7-159"
|
|
78
78
|
}
|
|
79
79
|
]
|
|
80
80
|
},
|
|
81
|
-
"
|
|
81
|
+
"50f7-159": {
|
|
82
82
|
"id": "/packages/vue-table/src/index.ts",
|
|
83
83
|
"moduleParts": {
|
|
84
|
-
"index.production.js": "
|
|
84
|
+
"index.production.js": "50f7-160"
|
|
85
85
|
},
|
|
86
86
|
"imported": [
|
|
87
87
|
{
|
|
88
|
-
"uid": "
|
|
88
|
+
"uid": "50f7-155"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
"uid": "
|
|
91
|
+
"uid": "50f7-161"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
|
-
"uid": "
|
|
94
|
+
"uid": "50f7-157"
|
|
95
95
|
}
|
|
96
96
|
],
|
|
97
97
|
"importedBy": [],
|
|
98
98
|
"isEntry": true
|
|
99
99
|
},
|
|
100
|
-
"
|
|
100
|
+
"50f7-161": {
|
|
101
101
|
"id": "vue",
|
|
102
102
|
"moduleParts": {},
|
|
103
103
|
"imported": [],
|
|
104
104
|
"importedBy": [
|
|
105
105
|
{
|
|
106
|
-
"uid": "
|
|
106
|
+
"uid": "50f7-159"
|
|
107
107
|
}
|
|
108
108
|
],
|
|
109
109
|
"isExternal": true
|
|
@@ -1535,6 +1535,12 @@
|
|
|
1535
1535
|
};
|
|
1536
1536
|
},
|
|
1537
1537
|
createCell: (cell, column, row, instance) => {
|
|
1538
|
+
const getRenderValue = () => {
|
|
1539
|
+
var _cell$getValue;
|
|
1540
|
+
|
|
1541
|
+
return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1538
1544
|
return {
|
|
1539
1545
|
getIsGrouped: () => column.getIsGrouped() && column.id === row.groupingColumnId,
|
|
1540
1546
|
getIsPlaceholder: () => !cell.getIsGrouped() && column.getIsGrouped(),
|
|
@@ -1544,15 +1550,19 @@
|
|
|
1544
1550
|
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && ((_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length) > 1;
|
|
1545
1551
|
},
|
|
1546
1552
|
renderAggregatedCell: () => {
|
|
1547
|
-
|
|
1553
|
+
{
|
|
1554
|
+
if (!column.columnDef.aggregatedCell) {
|
|
1555
|
+
console.warn('A columnDef.aggregatedCell template is recommended for displaying aggregated values.');
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1548
1558
|
|
|
1549
|
-
const template =
|
|
1559
|
+
const template = column.columnDef.aggregatedCell || column.columnDef.cell;
|
|
1550
1560
|
return template ? instance._render(template, {
|
|
1551
1561
|
instance,
|
|
1552
1562
|
column,
|
|
1553
1563
|
row,
|
|
1554
1564
|
cell,
|
|
1555
|
-
getValue:
|
|
1565
|
+
getValue: getRenderValue
|
|
1556
1566
|
}) : null;
|
|
1557
1567
|
}
|
|
1558
1568
|
};
|
|
@@ -2535,8 +2545,10 @@
|
|
|
2535
2545
|
// })
|
|
2536
2546
|
// return
|
|
2537
2547
|
// }
|
|
2548
|
+
// this needs to be outside of instance.setSorting to be in sync with rerender
|
|
2549
|
+
const nextSortingOrder = column.getNextSortingOrder();
|
|
2538
2550
|
instance.setSorting(old => {
|
|
2539
|
-
var
|
|
2551
|
+
var _instance$options$ena, _instance$options$ena2;
|
|
2540
2552
|
|
|
2541
2553
|
// Find any existing sorting for this column
|
|
2542
2554
|
const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
@@ -2561,30 +2573,29 @@
|
|
|
2561
2573
|
} else {
|
|
2562
2574
|
sortAction = 'replace';
|
|
2563
2575
|
}
|
|
2564
|
-
}
|
|
2576
|
+
} // Handle toggle states that will remove the sorting
|
|
2565
2577
|
|
|
2566
|
-
const sortDescFirst = (_ref2 = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc'; // Handle toggle states that will remove the sorting
|
|
2567
2578
|
|
|
2568
2579
|
if (sortAction === 'toggle' && ( // Must be toggling
|
|
2569
2580
|
(_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
|
|
2570
2581
|
!hasDescDefined && ( // Must not be setting desc
|
|
2571
|
-
multi ? (_instance$options$ena2 = instance.options.enableMultiRemove) != null ? _instance$options$ena2 : true : true) &&
|
|
2572
|
-
|
|
2573
|
-
|
|
2582
|
+
multi ? (_instance$options$ena2 = instance.options.enableMultiRemove) != null ? _instance$options$ena2 : true : true) && // If multi, don't allow if enableMultiRemove
|
|
2583
|
+
!nextSortingOrder // Finally, detect if it should indeed be removed
|
|
2584
|
+
) {
|
|
2574
2585
|
sortAction = 'remove';
|
|
2575
2586
|
}
|
|
2576
2587
|
|
|
2577
2588
|
if (sortAction === 'replace') {
|
|
2578
2589
|
newSorting = [{
|
|
2579
2590
|
id: column.id,
|
|
2580
|
-
desc: hasDescDefined ? desc :
|
|
2591
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2581
2592
|
}];
|
|
2582
2593
|
} else if (sortAction === 'add' && old != null && old.length) {
|
|
2583
2594
|
var _instance$options$max;
|
|
2584
2595
|
|
|
2585
2596
|
newSorting = [...old, {
|
|
2586
2597
|
id: column.id,
|
|
2587
|
-
desc: hasDescDefined ? desc :
|
|
2598
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2588
2599
|
}]; // Take latest n columns
|
|
2589
2600
|
|
|
2590
2601
|
newSorting.splice(0, newSorting.length - ((_instance$options$max = instance.options.maxMultiSortColCount) != null ? _instance$options$max : Number.MAX_SAFE_INTEGER));
|
|
@@ -2593,7 +2604,7 @@
|
|
|
2593
2604
|
newSorting = old.map(d => {
|
|
2594
2605
|
if (d.id === column.id) {
|
|
2595
2606
|
return { ...d,
|
|
2596
|
-
desc: hasDescDefined ? desc :
|
|
2607
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2597
2608
|
};
|
|
2598
2609
|
}
|
|
2599
2610
|
|
|
@@ -2606,6 +2617,23 @@
|
|
|
2606
2617
|
return newSorting;
|
|
2607
2618
|
});
|
|
2608
2619
|
},
|
|
2620
|
+
getNextSortingOrder: () => {
|
|
2621
|
+
var _ref2, _column$columnDef$sor;
|
|
2622
|
+
|
|
2623
|
+
const sortDescFirst = (_ref2 = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc';
|
|
2624
|
+
const firstSortDirection = sortDescFirst ? 'desc' : 'asc';
|
|
2625
|
+
const isSorted = column.getIsSorted();
|
|
2626
|
+
|
|
2627
|
+
if (!isSorted) {
|
|
2628
|
+
return firstSortDirection;
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
if (isSorted === firstSortDirection) {
|
|
2632
|
+
return isSorted === 'desc' ? 'asc' : 'desc';
|
|
2633
|
+
} else {
|
|
2634
|
+
return false;
|
|
2635
|
+
}
|
|
2636
|
+
},
|
|
2609
2637
|
getCanSort: () => {
|
|
2610
2638
|
var _column$columnDef$ena, _instance$options$ena3;
|
|
2611
2639
|
|
|
@@ -3053,6 +3081,12 @@
|
|
|
3053
3081
|
}
|
|
3054
3082
|
|
|
3055
3083
|
function createCell(instance, row, column, columnId) {
|
|
3084
|
+
const getRenderValue = () => {
|
|
3085
|
+
var _cell$getValue;
|
|
3086
|
+
|
|
3087
|
+
return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
|
|
3088
|
+
};
|
|
3089
|
+
|
|
3056
3090
|
const cell = {
|
|
3057
3091
|
id: row.id + "_" + column.id,
|
|
3058
3092
|
row,
|
|
@@ -3064,7 +3098,7 @@
|
|
|
3064
3098
|
column,
|
|
3065
3099
|
row,
|
|
3066
3100
|
cell: cell,
|
|
3067
|
-
getValue:
|
|
3101
|
+
getValue: getRenderValue
|
|
3068
3102
|
}) : null;
|
|
3069
3103
|
}
|
|
3070
3104
|
};
|
|
@@ -3912,6 +3946,7 @@
|
|
|
3912
3946
|
onStateChange: () => {},
|
|
3913
3947
|
// noop
|
|
3914
3948
|
render,
|
|
3949
|
+
renderFallbackValue: null,
|
|
3915
3950
|
|
|
3916
3951
|
mergeOptions(defaultOptions, options) {
|
|
3917
3952
|
return mergeProxy(defaultOptions, options);
|