@tanstack/table-core 8.0.0-alpha.69 → 8.0.0-alpha.70
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/features/Pagination.js +4 -4
- package/build/cjs/features/Pagination.js.map +1 -1
- package/build/esm/index.js +4 -4
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +296 -296
- package/build/types/features/Pagination.d.ts +1 -1
- package/build/umd/index.development.js +4 -4
- 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 +1 -1
- package/src/features/Pagination.ts +4 -5
|
@@ -2,7 +2,7 @@ import { OnChangeFn, TableGenerics, TableInstance, RowModel, Updater, TableFeatu
|
|
|
2
2
|
export declare type PaginationState = {
|
|
3
3
|
pageIndex: number;
|
|
4
4
|
pageSize: number;
|
|
5
|
-
pageCount
|
|
5
|
+
pageCount?: number;
|
|
6
6
|
};
|
|
7
7
|
export declare type PaginationTableState = {
|
|
8
8
|
pagination: PaginationState;
|
|
@@ -1471,12 +1471,10 @@
|
|
|
1471
1471
|
};
|
|
1472
1472
|
|
|
1473
1473
|
//
|
|
1474
|
-
const defaultPageCount = -1;
|
|
1475
1474
|
const defaultPageIndex = 0;
|
|
1476
1475
|
const defaultPageSize = 10;
|
|
1477
1476
|
|
|
1478
1477
|
const getDefaultPaginationState = () => ({
|
|
1479
|
-
pageCount: defaultPageCount,
|
|
1480
1478
|
pageIndex: defaultPageIndex,
|
|
1481
1479
|
pageSize: defaultPageSize
|
|
1482
1480
|
});
|
|
@@ -1557,7 +1555,9 @@
|
|
|
1557
1555
|
});
|
|
1558
1556
|
},
|
|
1559
1557
|
setPageCount: updater => instance.setPagination(old => {
|
|
1560
|
-
|
|
1558
|
+
var _old$pageCount;
|
|
1559
|
+
|
|
1560
|
+
let newPageCount = functionalUpdate(updater, (_old$pageCount = old.pageCount) != null ? _old$pageCount : -1);
|
|
1561
1561
|
|
|
1562
1562
|
if (typeof newPageCount === 'number') {
|
|
1563
1563
|
newPageCount = Math.max(-1, newPageCount);
|
|
@@ -1625,7 +1625,7 @@
|
|
|
1625
1625
|
pageCount
|
|
1626
1626
|
} = instance.getState().pagination;
|
|
1627
1627
|
|
|
1628
|
-
if (pageCount
|
|
1628
|
+
if (typeof pageCount !== 'undefined') {
|
|
1629
1629
|
return pageCount;
|
|
1630
1630
|
}
|
|
1631
1631
|
|