@underverse-ui/underverse 2.0.16 → 2.0.17
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/api-reference.json +1 -1
- package/dist/index.cjs +13 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +13 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -31843,24 +31843,19 @@ function DataTablePagination({
|
|
|
31843
31843
|
pageSizeOptions,
|
|
31844
31844
|
setCurPageSize,
|
|
31845
31845
|
size,
|
|
31846
|
-
align
|
|
31846
|
+
align,
|
|
31847
|
+
paginationRange
|
|
31847
31848
|
}) {
|
|
31848
31849
|
const totalPages = Math.ceil(totalItems / curPageSize);
|
|
31849
31850
|
const pages = import_react35.default.useMemo(() => {
|
|
31850
|
-
const
|
|
31851
|
-
if (totalPages <=
|
|
31852
|
-
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31858
|
-
const end = Math.min(totalPages - 1, curPage + 1);
|
|
31859
|
-
for (let i = start; i <= end; i++) result.push(i);
|
|
31860
|
-
if (curPage < totalPages - 2) result.push("...");
|
|
31861
|
-
result.push(totalPages);
|
|
31862
|
-
return result;
|
|
31863
|
-
}, [curPage, totalPages]);
|
|
31851
|
+
const edgeCount = Math.max(1, Math.floor(paginationRange ?? (totalPages < 14 ? 3 : 5)));
|
|
31852
|
+
if (totalPages <= edgeCount * 2 + 3) return Array.from({ length: totalPages }, (_, index) => index + 1);
|
|
31853
|
+
const pageNumbers = /* @__PURE__ */ new Set();
|
|
31854
|
+
for (let page = 1; page <= edgeCount; page += 1) pageNumbers.add(page);
|
|
31855
|
+
for (let page = totalPages - edgeCount + 1; page <= totalPages; page += 1) pageNumbers.add(page);
|
|
31856
|
+
for (let page = Math.max(1, curPage - 1); page <= Math.min(totalPages, curPage + 1); page += 1) pageNumbers.add(page);
|
|
31857
|
+
return Array.from(pageNumbers).sort((a, b) => a - b).flatMap((page, index, sortedPages) => index > 0 && page - sortedPages[index - 1] > 1 ? ["...", page] : [page]);
|
|
31858
|
+
}, [curPage, paginationRange, totalPages]);
|
|
31864
31859
|
if (totalItems === 0) return null;
|
|
31865
31860
|
const controlButtonSize = size === "lg" ? "md" : "sm";
|
|
31866
31861
|
const navBtnClass = size === "sm" ? "h-6 w-6 p-0 rounded-full" : size === "lg" ? "h-8 w-8 p-0 rounded-full" : "h-7 w-7 p-0 rounded-full";
|
|
@@ -32646,6 +32641,7 @@ function DataTable({
|
|
|
32646
32641
|
estimatedRowHeight,
|
|
32647
32642
|
overscan = 8,
|
|
32648
32643
|
paginationAlign = "right",
|
|
32644
|
+
paginationRange,
|
|
32649
32645
|
enableHeaderAutoFit = true,
|
|
32650
32646
|
labels,
|
|
32651
32647
|
columnColorGroups,
|
|
@@ -32898,7 +32894,8 @@ function DataTable({
|
|
|
32898
32894
|
pageSizeOptions,
|
|
32899
32895
|
setCurPageSize,
|
|
32900
32896
|
size,
|
|
32901
|
-
align: paginationAlign
|
|
32897
|
+
align: paginationAlign,
|
|
32898
|
+
paginationRange
|
|
32902
32899
|
}
|
|
32903
32900
|
)
|
|
32904
32901
|
] });
|