@tanstack/table-core 8.12.0 → 8.13.0
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/lib/features/Pagination.d.ts +26 -4
- package/build/lib/features/Pagination.js +12 -1
- package/build/lib/features/Pagination.js.map +1 -1
- package/build/lib/features/Pinning.js +1 -1
- package/build/lib/features/Pinning.js.map +1 -1
- package/build/lib/features/Visibility.d.ts +5 -0
- package/build/lib/features/Visibility.js.map +1 -1
- package/build/lib/index.esm.js +13 -2
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.mjs +13 -2
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/utils/filterRowsUtils.d.ts +0 -2
- package/build/lib/utils/filterRowsUtils.js +0 -2
- package/build/lib/utils/filterRowsUtils.js.map +1 -1
- package/build/umd/index.development.js +13 -2
- 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 +42 -8
- package/src/features/Pinning.ts +1 -1
- package/src/features/Visibility.ts +5 -0
- package/src/utils/filterRowsUtils.ts +2 -2
package/build/lib/index.mjs
CHANGED
|
@@ -1480,6 +1480,7 @@ const Pagination = {
|
|
|
1480
1480
|
};
|
|
1481
1481
|
});
|
|
1482
1482
|
};
|
|
1483
|
+
//deprecated
|
|
1483
1484
|
table.setPageCount = updater => table.setPagination(old => {
|
|
1484
1485
|
var _table$options$pageCo;
|
|
1485
1486
|
let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
|
|
@@ -1520,6 +1521,12 @@ const Pagination = {
|
|
|
1520
1521
|
return old + 1;
|
|
1521
1522
|
});
|
|
1522
1523
|
};
|
|
1524
|
+
table.firstPage = () => {
|
|
1525
|
+
return table.setPageIndex(0);
|
|
1526
|
+
};
|
|
1527
|
+
table.lastPage = () => {
|
|
1528
|
+
return table.setPageIndex(table.getPageCount() - 1);
|
|
1529
|
+
};
|
|
1523
1530
|
table.getPrePaginationRowModel = () => table.getExpandedRowModel();
|
|
1524
1531
|
table.getPaginationRowModel = () => {
|
|
1525
1532
|
if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
|
|
@@ -1532,7 +1539,11 @@ const Pagination = {
|
|
|
1532
1539
|
};
|
|
1533
1540
|
table.getPageCount = () => {
|
|
1534
1541
|
var _table$options$pageCo2;
|
|
1535
|
-
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.
|
|
1542
|
+
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getRowCount() / table.getState().pagination.pageSize);
|
|
1543
|
+
};
|
|
1544
|
+
table.getRowCount = () => {
|
|
1545
|
+
var _table$options$rowCou;
|
|
1546
|
+
return (_table$options$rowCou = table.options.rowCount) != null ? _table$options$rowCou : table.getPrePaginationRowModel().rows.length;
|
|
1536
1547
|
};
|
|
1537
1548
|
}
|
|
1538
1549
|
};
|
|
@@ -1683,7 +1694,7 @@ const Pinning = {
|
|
|
1683
1694
|
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
1684
1695
|
return allCells.filter(d => !leftAndRight.includes(d.column.id));
|
|
1685
1696
|
}, getMemoOptions(table.options, 'debugRows', 'getCenterVisibleCells'));
|
|
1686
|
-
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left
|
|
1697
|
+
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left], (allCells, left) => {
|
|
1687
1698
|
const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
1688
1699
|
...d,
|
|
1689
1700
|
position: 'left'
|