@ai-matrx/design-system 0.49.21 → 0.49.22

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.
@@ -36627,6 +36627,10 @@ function GenericTablePagination({
36627
36627
  const host = useMatrxDataTableHost();
36628
36628
  const positivePageSizes = pageSizeOptions.filter((size) => size > 0);
36629
36629
  const availablePageSizes = itemsPerPage > 0 && !positivePageSizes.includes(itemsPerPage) ? [...positivePageSizes, itemsPerPage].sort((a, b) => a - b) : positivePageSizes;
36630
+ const pageSizeChoices = [...new Set(availablePageSizes)];
36631
+ const hasDistinctAllChoice = showAllOption && !unknownTotal && !pageSizeChoices.includes(allValue);
36632
+ if (hasDistinctAllChoice) pageSizeChoices.push(allValue);
36633
+ const pageSizeIsFixed = pageSizeChoices.length <= 1;
36630
36634
  const effectiveItemsPerPage = itemsPerPage === 0 ? Math.max(totalItems, 1) : Math.max(itemsPerPage, 1);
36631
36635
  const totalPages = Math.max(1, Math.ceil(totalItems / effectiveItemsPerPage));
36632
36636
  const getPageNumbers = (limit = maxPagesToShow) => {
@@ -36669,7 +36673,7 @@ function GenericTablePagination({
36669
36673
  children: /* @__PURE__ */ jsxs15(
36670
36674
  Select,
36671
36675
  {
36672
- disabled: isFetching,
36676
+ disabled: isFetching || pageSizeIsFixed,
36673
36677
  value: itemsPerPage.toString(),
36674
36678
  onValueChange: (value) => onItemsPerPageChange(parseInt(value)),
36675
36679
  children: [
@@ -36684,10 +36688,7 @@ function GenericTablePagination({
36684
36688
  children: /* @__PURE__ */ jsx23(SelectValue, { placeholder: itemsPerPage.toString() })
36685
36689
  }
36686
36690
  ),
36687
- /* @__PURE__ */ jsxs15(SelectContent, { children: [
36688
- availablePageSizes.map((size) => /* @__PURE__ */ jsx23(SelectItem, { value: size.toString(), children: size }, size)),
36689
- showAllOption && !unknownTotal ? /* @__PURE__ */ jsx23(SelectItem, { value: allValue.toString(), children: allOptionLabel }) : null
36690
- ] })
36691
+ /* @__PURE__ */ jsx23(SelectContent, { children: pageSizeChoices.map((size) => /* @__PURE__ */ jsx23(SelectItem, { value: size.toString(), children: size === allValue && hasDistinctAllChoice ? allOptionLabel : size }, size)) })
36691
36692
  ]
36692
36693
  }
36693
36694
  )