@tanstack/react-table 8.0.0-alpha.69 → 8.0.0-alpha.71
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 +43 -27
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +43 -27
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +17 -17
- package/build/umd/index.development.js +43 -27
- 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
|
@@ -636,28 +636,28 @@ const ColumnSizing = {
|
|
|
636
636
|
var _instance$getHeaderGr, _instance$getHeaderGr2;
|
|
637
637
|
|
|
638
638
|
return (_instance$getHeaderGr = (_instance$getHeaderGr2 = instance.getHeaderGroups()[0]) == null ? void 0 : _instance$getHeaderGr2.headers.reduce((sum, header) => {
|
|
639
|
-
return sum + header.
|
|
639
|
+
return sum + header.getSize();
|
|
640
640
|
}, 0)) != null ? _instance$getHeaderGr : 0;
|
|
641
641
|
},
|
|
642
642
|
getLeftTotalSize: () => {
|
|
643
643
|
var _instance$getLeftHead, _instance$getLeftHead2;
|
|
644
644
|
|
|
645
645
|
return (_instance$getLeftHead = (_instance$getLeftHead2 = instance.getLeftHeaderGroups()[0]) == null ? void 0 : _instance$getLeftHead2.headers.reduce((sum, header) => {
|
|
646
|
-
return sum + header.
|
|
646
|
+
return sum + header.getSize();
|
|
647
647
|
}, 0)) != null ? _instance$getLeftHead : 0;
|
|
648
648
|
},
|
|
649
649
|
getCenterTotalSize: () => {
|
|
650
650
|
var _instance$getCenterHe, _instance$getCenterHe2;
|
|
651
651
|
|
|
652
652
|
return (_instance$getCenterHe = (_instance$getCenterHe2 = instance.getCenterHeaderGroups()[0]) == null ? void 0 : _instance$getCenterHe2.headers.reduce((sum, header) => {
|
|
653
|
-
return sum + header.
|
|
653
|
+
return sum + header.getSize();
|
|
654
654
|
}, 0)) != null ? _instance$getCenterHe : 0;
|
|
655
655
|
},
|
|
656
656
|
getRightTotalSize: () => {
|
|
657
657
|
var _instance$getRightHea, _instance$getRightHea2;
|
|
658
658
|
|
|
659
659
|
return (_instance$getRightHea = (_instance$getRightHea2 = instance.getRightHeaderGroups()[0]) == null ? void 0 : _instance$getRightHea2.headers.reduce((sum, header) => {
|
|
660
|
-
return sum + header.
|
|
660
|
+
return sum + header.getSize();
|
|
661
661
|
}, 0)) != null ? _instance$getRightHea : 0;
|
|
662
662
|
}
|
|
663
663
|
};
|
|
@@ -711,10 +711,13 @@ const Expanding = {
|
|
|
711
711
|
},
|
|
712
712
|
createInstance: instance => {
|
|
713
713
|
let registered = false;
|
|
714
|
+
let queued = false;
|
|
714
715
|
return {
|
|
715
716
|
_autoResetExpanded: () => {
|
|
716
717
|
if (!registered) {
|
|
717
|
-
|
|
718
|
+
instance.queue(() => {
|
|
719
|
+
registered = true;
|
|
720
|
+
});
|
|
718
721
|
return;
|
|
719
722
|
}
|
|
720
723
|
|
|
@@ -723,7 +726,12 @@ const Expanding = {
|
|
|
723
726
|
}
|
|
724
727
|
|
|
725
728
|
if (instance.options.autoResetAll === true || instance.options.autoResetExpanded) {
|
|
726
|
-
|
|
729
|
+
if (queued) return;
|
|
730
|
+
queued = true;
|
|
731
|
+
instance.queue(() => {
|
|
732
|
+
instance.resetExpanded();
|
|
733
|
+
queued = false;
|
|
734
|
+
});
|
|
727
735
|
}
|
|
728
736
|
},
|
|
729
737
|
setExpanded: updater => instance.options.onExpandedChange == null ? void 0 : instance.options.onExpandedChange(updater),
|
|
@@ -1076,7 +1084,7 @@ const Filters = {
|
|
|
1076
1084
|
_getFacetedMinMaxValues: instance.options.getFacetedMinMaxValues && instance.options.getFacetedMinMaxValues(instance, column.id),
|
|
1077
1085
|
getFacetedMinMaxValues: () => {
|
|
1078
1086
|
if (!column._getFacetedMinMaxValues) {
|
|
1079
|
-
return
|
|
1087
|
+
return undefined;
|
|
1080
1088
|
}
|
|
1081
1089
|
|
|
1082
1090
|
return column._getFacetedMinMaxValues();
|
|
@@ -1167,7 +1175,7 @@ const Filters = {
|
|
|
1167
1175
|
_getGlobalFacetedMinMaxValues: instance.options.getFacetedMinMaxValues && instance.options.getFacetedMinMaxValues(instance, '__global__'),
|
|
1168
1176
|
getGlobalFacetedMinMaxValues: () => {
|
|
1169
1177
|
if (!instance._getGlobalFacetedMinMaxValues) {
|
|
1170
|
-
return
|
|
1178
|
+
return;
|
|
1171
1179
|
}
|
|
1172
1180
|
|
|
1173
1181
|
return instance._getGlobalFacetedMinMaxValues();
|
|
@@ -1487,12 +1495,10 @@ const Ordering = {
|
|
|
1487
1495
|
};
|
|
1488
1496
|
|
|
1489
1497
|
//
|
|
1490
|
-
const defaultPageCount = -1;
|
|
1491
1498
|
const defaultPageIndex = 0;
|
|
1492
1499
|
const defaultPageSize = 10;
|
|
1493
1500
|
|
|
1494
1501
|
const getDefaultPaginationState = () => ({
|
|
1495
|
-
pageCount: defaultPageCount,
|
|
1496
1502
|
pageIndex: defaultPageIndex,
|
|
1497
1503
|
pageSize: defaultPageSize
|
|
1498
1504
|
});
|
|
@@ -1513,10 +1519,13 @@ const Pagination = {
|
|
|
1513
1519
|
},
|
|
1514
1520
|
createInstance: instance => {
|
|
1515
1521
|
let registered = false;
|
|
1522
|
+
let queued = false;
|
|
1516
1523
|
return {
|
|
1517
1524
|
_autoResetPageIndex: () => {
|
|
1518
1525
|
if (!registered) {
|
|
1519
|
-
|
|
1526
|
+
instance.queue(() => {
|
|
1527
|
+
registered = true;
|
|
1528
|
+
});
|
|
1520
1529
|
return;
|
|
1521
1530
|
}
|
|
1522
1531
|
|
|
@@ -1525,7 +1534,12 @@ const Pagination = {
|
|
|
1525
1534
|
}
|
|
1526
1535
|
|
|
1527
1536
|
if (instance.options.autoResetAll === true || instance.options.autoResetPageIndex) {
|
|
1528
|
-
|
|
1537
|
+
if (queued) return;
|
|
1538
|
+
queued = true;
|
|
1539
|
+
instance.queue(() => {
|
|
1540
|
+
instance.resetPageIndex();
|
|
1541
|
+
queued = false;
|
|
1542
|
+
});
|
|
1529
1543
|
}
|
|
1530
1544
|
},
|
|
1531
1545
|
setPagination: updater => {
|
|
@@ -1573,7 +1587,9 @@ const Pagination = {
|
|
|
1573
1587
|
});
|
|
1574
1588
|
},
|
|
1575
1589
|
setPageCount: updater => instance.setPagination(old => {
|
|
1576
|
-
|
|
1590
|
+
var _old$pageCount;
|
|
1591
|
+
|
|
1592
|
+
let newPageCount = functionalUpdate(updater, (_old$pageCount = old.pageCount) != null ? _old$pageCount : -1);
|
|
1577
1593
|
|
|
1578
1594
|
if (typeof newPageCount === 'number') {
|
|
1579
1595
|
newPageCount = Math.max(-1, newPageCount);
|
|
@@ -1641,7 +1657,7 @@ const Pagination = {
|
|
|
1641
1657
|
pageCount
|
|
1642
1658
|
} = instance.getState().pagination;
|
|
1643
1659
|
|
|
1644
|
-
if (pageCount
|
|
1660
|
+
if (typeof pageCount !== 'undefined') {
|
|
1645
1661
|
return pageCount;
|
|
1646
1662
|
}
|
|
1647
1663
|
|
|
@@ -3364,9 +3380,7 @@ function getCoreRowModel() {
|
|
|
3364
3380
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
|
|
3365
3381
|
},
|
|
3366
3382
|
onChange: () => {
|
|
3367
|
-
instance.
|
|
3368
|
-
instance._autoResetPageIndex();
|
|
3369
|
-
});
|
|
3383
|
+
instance._autoResetPageIndex();
|
|
3370
3384
|
}
|
|
3371
3385
|
});
|
|
3372
3386
|
}
|
|
@@ -3572,9 +3586,7 @@ function getFilteredRowModel() {
|
|
|
3572
3586
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
|
|
3573
3587
|
},
|
|
3574
3588
|
onChange: () => {
|
|
3575
|
-
instance.
|
|
3576
|
-
instance._autoResetPageIndex();
|
|
3577
|
-
});
|
|
3589
|
+
instance._autoResetPageIndex();
|
|
3578
3590
|
}
|
|
3579
3591
|
});
|
|
3580
3592
|
}
|
|
@@ -3642,14 +3654,20 @@ function getFacetedUniqueValues() {
|
|
|
3642
3654
|
|
|
3643
3655
|
function getFacetedMinMaxValues() {
|
|
3644
3656
|
return (instance, columnId) => memo(() => [instance.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
|
|
3645
|
-
var _facetedRowModel$flat
|
|
3657
|
+
var _facetedRowModel$flat;
|
|
3646
3658
|
|
|
3647
|
-
|
|
3659
|
+
const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId);
|
|
3660
|
+
|
|
3661
|
+
if (typeof firstValue === 'undefined') {
|
|
3662
|
+
return undefined;
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
let facetedMinMaxValues = [firstValue, firstValue];
|
|
3648
3666
|
|
|
3649
3667
|
for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
|
|
3650
|
-
var _facetedRowModel$
|
|
3668
|
+
var _facetedRowModel$flat2;
|
|
3651
3669
|
|
|
3652
|
-
const value = (_facetedRowModel$
|
|
3670
|
+
const value = (_facetedRowModel$flat2 = facetedRowModel.flatRows[i]) == null ? void 0 : _facetedRowModel$flat2.getValue(columnId);
|
|
3653
3671
|
|
|
3654
3672
|
if (value < facetedMinMaxValues[0]) {
|
|
3655
3673
|
facetedMinMaxValues[0] = value;
|
|
@@ -3757,9 +3775,7 @@ function getSortedRowModel() {
|
|
|
3757
3775
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
|
|
3758
3776
|
},
|
|
3759
3777
|
onChange: () => {
|
|
3760
|
-
instance.
|
|
3761
|
-
instance._autoResetPageIndex();
|
|
3762
|
-
});
|
|
3778
|
+
instance._autoResetPageIndex();
|
|
3763
3779
|
}
|
|
3764
3780
|
});
|
|
3765
3781
|
}
|