@tanstack/react-table 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.
|
@@ -1514,6 +1514,7 @@
|
|
|
1514
1514
|
};
|
|
1515
1515
|
});
|
|
1516
1516
|
};
|
|
1517
|
+
//deprecated
|
|
1517
1518
|
table.setPageCount = updater => table.setPagination(old => {
|
|
1518
1519
|
var _table$options$pageCo;
|
|
1519
1520
|
let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
|
|
@@ -1554,6 +1555,12 @@
|
|
|
1554
1555
|
return old + 1;
|
|
1555
1556
|
});
|
|
1556
1557
|
};
|
|
1558
|
+
table.firstPage = () => {
|
|
1559
|
+
return table.setPageIndex(0);
|
|
1560
|
+
};
|
|
1561
|
+
table.lastPage = () => {
|
|
1562
|
+
return table.setPageIndex(table.getPageCount() - 1);
|
|
1563
|
+
};
|
|
1557
1564
|
table.getPrePaginationRowModel = () => table.getExpandedRowModel();
|
|
1558
1565
|
table.getPaginationRowModel = () => {
|
|
1559
1566
|
if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
|
|
@@ -1566,7 +1573,11 @@
|
|
|
1566
1573
|
};
|
|
1567
1574
|
table.getPageCount = () => {
|
|
1568
1575
|
var _table$options$pageCo2;
|
|
1569
|
-
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.
|
|
1576
|
+
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getRowCount() / table.getState().pagination.pageSize);
|
|
1577
|
+
};
|
|
1578
|
+
table.getRowCount = () => {
|
|
1579
|
+
var _table$options$rowCou;
|
|
1580
|
+
return (_table$options$rowCou = table.options.rowCount) != null ? _table$options$rowCou : table.getPrePaginationRowModel().rows.length;
|
|
1570
1581
|
};
|
|
1571
1582
|
}
|
|
1572
1583
|
};
|
|
@@ -1717,7 +1728,7 @@
|
|
|
1717
1728
|
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
1718
1729
|
return allCells.filter(d => !leftAndRight.includes(d.column.id));
|
|
1719
1730
|
}, getMemoOptions(table.options, 'debugRows', 'getCenterVisibleCells'));
|
|
1720
|
-
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left
|
|
1731
|
+
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left], (allCells, left) => {
|
|
1721
1732
|
const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
1722
1733
|
...d,
|
|
1723
1734
|
position: 'left'
|