@algorithm-shift/design-system 1.2.70 → 1.2.71

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/dist/index.js CHANGED
@@ -28481,10 +28481,12 @@ function DataTable({
28481
28481
  state: {
28482
28482
  columnFilters,
28483
28483
  columnVisibility,
28484
- pagination: {
28485
- pageIndex: controlledPageIndex ?? 0,
28486
- pageSize
28487
- }
28484
+ ...paginationMode === "server" ? {
28485
+ pagination: {
28486
+ pageIndex: controlledPageIndex ?? 0,
28487
+ pageSize
28488
+ }
28489
+ } : {}
28488
28490
  },
28489
28491
  onColumnFiltersChange: setColumnFilters,
28490
28492
  onColumnVisibilityChange: setColumnVisibility,
@@ -28493,11 +28495,13 @@ function DataTable({
28493
28495
  getPaginationRowModel: pagination && paginationMode === "client" ? (0, import_react_table.getPaginationRowModel)() : void 0,
28494
28496
  manualPagination: paginationMode === "server",
28495
28497
  pageCount: paginationMode === "server" ? Math.ceil(totalRecords / pageSize) : void 0,
28496
- onPaginationChange: (updater) => {
28497
- const prev = table.getState().pagination;
28498
- const next = typeof updater === "function" ? updater(prev) : updater;
28499
- onPageChange?.(next.pageIndex, next.pageSize);
28500
- }
28498
+ ...paginationMode === "server" ? {
28499
+ onPaginationChange: (updater) => {
28500
+ const prev = table.getState().pagination;
28501
+ const next = typeof updater === "function" ? updater(prev) : updater;
28502
+ onPageChange?.(next.pageIndex, next.pageSize);
28503
+ }
28504
+ } : {}
28501
28505
  });
28502
28506
  const getPageNumbers = (currentPage, totalPages, maxVisiblePages = 5) => {
28503
28507
  if (totalPages <= maxVisiblePages) {