@tanstack/react-table 8.0.0-beta.7 → 8.0.0-beta.8
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 +6 -12
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +6 -12
- 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 +6 -12
- 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/build/esm/index.js
CHANGED
|
@@ -1697,7 +1697,7 @@ const Pagination = {
|
|
|
1697
1697
|
setPageIndex: updater => {
|
|
1698
1698
|
instance.setPagination(old => {
|
|
1699
1699
|
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
1700
|
-
const maxPageIndex = typeof
|
|
1700
|
+
const maxPageIndex = typeof instance.options.pageCount !== 'undefined' ? instance.options.pageCount - 1 : Number.MAX_SAFE_INTEGER;
|
|
1701
1701
|
pageIndex = Math.min(Math.max(0, pageIndex), maxPageIndex);
|
|
1702
1702
|
return { ...old,
|
|
1703
1703
|
pageIndex
|
|
@@ -1726,9 +1726,9 @@ const Pagination = {
|
|
|
1726
1726
|
});
|
|
1727
1727
|
},
|
|
1728
1728
|
setPageCount: updater => instance.setPagination(old => {
|
|
1729
|
-
var
|
|
1729
|
+
var _instance$options$pag;
|
|
1730
1730
|
|
|
1731
|
-
let newPageCount = functionalUpdate(updater, (
|
|
1731
|
+
let newPageCount = functionalUpdate(updater, (_instance$options$pag = instance.options.pageCount) != null ? _instance$options$pag : -1);
|
|
1732
1732
|
|
|
1733
1733
|
if (typeof newPageCount === 'number') {
|
|
1734
1734
|
newPageCount = Math.max(-1, newPageCount);
|
|
@@ -1738,7 +1738,7 @@ const Pagination = {
|
|
|
1738
1738
|
pageCount: newPageCount
|
|
1739
1739
|
};
|
|
1740
1740
|
}),
|
|
1741
|
-
getPageOptions: memo(() => [instance.
|
|
1741
|
+
getPageOptions: memo(() => [instance.getPageCount()], pageCount => {
|
|
1742
1742
|
let pageOptions = [];
|
|
1743
1743
|
|
|
1744
1744
|
if (pageCount && pageCount > 0) {
|
|
@@ -1792,15 +1792,9 @@ const Pagination = {
|
|
|
1792
1792
|
return instance._getPaginationRowModel();
|
|
1793
1793
|
},
|
|
1794
1794
|
getPageCount: () => {
|
|
1795
|
-
|
|
1796
|
-
pageCount
|
|
1797
|
-
} = instance.getState().pagination;
|
|
1798
|
-
|
|
1799
|
-
if (typeof pageCount !== 'undefined') {
|
|
1800
|
-
return pageCount;
|
|
1801
|
-
}
|
|
1795
|
+
var _instance$options$pag2;
|
|
1802
1796
|
|
|
1803
|
-
return Math.ceil(instance.getPrePaginationRowModel().rows.length / instance.getState().pagination.pageSize);
|
|
1797
|
+
return (_instance$options$pag2 = instance.options.pageCount) != null ? _instance$options$pag2 : Math.ceil(instance.getPrePaginationRowModel().rows.length / instance.getState().pagination.pageSize);
|
|
1804
1798
|
}
|
|
1805
1799
|
};
|
|
1806
1800
|
}
|