@tanstack/svelte-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.
|
@@ -1495,6 +1495,7 @@
|
|
|
1495
1495
|
};
|
|
1496
1496
|
});
|
|
1497
1497
|
};
|
|
1498
|
+
//deprecated
|
|
1498
1499
|
table.setPageCount = updater => table.setPagination(old => {
|
|
1499
1500
|
var _table$options$pageCo;
|
|
1500
1501
|
let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
|
|
@@ -1535,6 +1536,12 @@
|
|
|
1535
1536
|
return old + 1;
|
|
1536
1537
|
});
|
|
1537
1538
|
};
|
|
1539
|
+
table.firstPage = () => {
|
|
1540
|
+
return table.setPageIndex(0);
|
|
1541
|
+
};
|
|
1542
|
+
table.lastPage = () => {
|
|
1543
|
+
return table.setPageIndex(table.getPageCount() - 1);
|
|
1544
|
+
};
|
|
1538
1545
|
table.getPrePaginationRowModel = () => table.getExpandedRowModel();
|
|
1539
1546
|
table.getPaginationRowModel = () => {
|
|
1540
1547
|
if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
|
|
@@ -1547,7 +1554,11 @@
|
|
|
1547
1554
|
};
|
|
1548
1555
|
table.getPageCount = () => {
|
|
1549
1556
|
var _table$options$pageCo2;
|
|
1550
|
-
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.
|
|
1557
|
+
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getRowCount() / table.getState().pagination.pageSize);
|
|
1558
|
+
};
|
|
1559
|
+
table.getRowCount = () => {
|
|
1560
|
+
var _table$options$rowCou;
|
|
1561
|
+
return (_table$options$rowCou = table.options.rowCount) != null ? _table$options$rowCou : table.getPrePaginationRowModel().rows.length;
|
|
1551
1562
|
};
|
|
1552
1563
|
}
|
|
1553
1564
|
};
|
|
@@ -1698,7 +1709,7 @@
|
|
|
1698
1709
|
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
1699
1710
|
return allCells.filter(d => !leftAndRight.includes(d.column.id));
|
|
1700
1711
|
}, getMemoOptions(table.options, 'debugRows', 'getCenterVisibleCells'));
|
|
1701
|
-
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left
|
|
1712
|
+
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left], (allCells, left) => {
|
|
1702
1713
|
const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
1703
1714
|
...d,
|
|
1704
1715
|
position: 'left'
|