@invopop/popui 0.1.92 → 0.1.94

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.
@@ -18,7 +18,7 @@
18
18
  bind:ref
19
19
  data-slot="alert-dialog-content"
20
20
  class={cn(
21
- 'bg-background fixed left-1/2 top-1/2 z-[1002] flex flex-col w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-xl overflow-clip',
21
+ 'bg-background border border-border fixed left-1/2 top-1/2 z-[1002] flex flex-col w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-xl overflow-clip',
22
22
  className
23
23
  )}
24
24
  >
@@ -20,6 +20,7 @@
20
20
  onPageSizeChange,
21
21
  data,
22
22
  rowCount,
23
+ pageCount,
23
24
  manualPagination,
24
25
  disabled = false,
25
26
  disableJumpToPage = false,
@@ -36,8 +37,12 @@
36
37
  // For client-side pagination, use data length directly
37
38
  return data?.length ?? 0
38
39
  })
39
- // Calculate totalPages from reactive values instead of calling table.getPageCount()
40
- let totalPages = $derived(Math.ceil(totalItems / rowsPerPage) || 1)
40
+ // Prefer the caller-supplied pageCount when provided (manual pagination): it lets
41
+ // consumers express "Next is available" before an exact rowCount is known. Fall
42
+ // back to deriving from rowCount/data for the client-side default.
43
+ let totalPages = $derived(
44
+ manualPagination && pageCount !== undefined ? pageCount : Math.ceil(totalItems / rowsPerPage) || 1
45
+ )
41
46
 
42
47
  let pageInputValue = $derived(`${currentPage}`)
43
48
 
@@ -91,6 +91,7 @@ export interface DataTablePaginationProps<T> {
91
91
  onPageSizeChange?: (pageSize: number) => void;
92
92
  data?: T[];
93
93
  rowCount?: number;
94
+ pageCount?: number;
94
95
  manualPagination?: boolean;
95
96
  disabled?: boolean;
96
97
  disableJumpToPage?: boolean;
@@ -434,6 +434,7 @@
434
434
  {table}
435
435
  {data}
436
436
  {rowCount}
437
+ {pageCount}
437
438
  {manualPagination}
438
439
  {onPageChange}
439
440
  {onPageSizeChange}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.1.92",
4
+ "version": "0.1.94",
5
5
  "repository": {
6
6
  "url": "https://github.com/invopop/popui"
7
7
  },