@ai-matrx/design-system 0.60.6 → 0.60.7

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.
@@ -931,7 +931,7 @@ function GenericTablePagination({
931
931
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChevronLeft, { className: "h-5 w-5" })
932
932
  }
933
933
  ),
934
- !unknownTotal && getPageNumbers(3).map((page) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
934
+ (unknownTotal ? [currentPage] : getPageNumbers(3)).map((page) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
935
935
  PaginationAction,
936
936
  {
937
937
  HostAction: host.ToolbarAction,
@@ -941,13 +941,15 @@ function GenericTablePagination({
941
941
  disabledHint: isFetching ? "Loading source page" : `Already on page ${page}`,
942
942
  visibilityClassName: "hidden",
943
943
  fallbackClassName: page === currentPage ? pageActiveButtonClassName : pageButtonClassName,
944
- onClick: () => onPageChange(page),
945
- disabled: isFetching || totalPages <= 1,
944
+ onClick: () => {
945
+ if (!unknownTotal) onPageChange(page);
946
+ },
947
+ disabled: Boolean(unknownTotal) || isFetching || totalPages <= 1,
946
948
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: page })
947
949
  },
948
950
  `mobile-${page}`
949
951
  )),
950
- !unknownTotal && getPageNumbers().map((page) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
952
+ (unknownTotal ? [currentPage] : getPageNumbers()).map((page) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
951
953
  PaginationAction,
952
954
  {
953
955
  HostAction: host.ToolbarAction,
@@ -957,8 +959,10 @@ function GenericTablePagination({
957
959
  disabledHint: isFetching ? "Loading source page" : `Already on page ${page}`,
958
960
  visibilityClassName: "hidden sm:inline-flex",
959
961
  fallbackClassName: currentPage === page ? pageActiveButtonClassName : pageButtonClassName,
960
- onClick: () => onPageChange(page),
961
- disabled: isFetching || totalPages <= 1,
962
+ onClick: () => {
963
+ if (!unknownTotal) onPageChange(page);
964
+ },
965
+ disabled: Boolean(unknownTotal) || isFetching || totalPages <= 1,
962
966
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: page })
963
967
  },
964
968
  `desktop-${page}`
@@ -976,17 +980,19 @@ function GenericTablePagination({
976
980
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChevronRight, { className: "h-5 w-5" })
977
981
  }
978
982
  ),
979
- !unknownTotal && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
983
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
980
984
  PaginationAction,
981
985
  {
982
986
  HostAction: host.ToolbarAction,
983
987
  compact,
984
988
  ariaLabel: "Last page",
985
- disabledHint: isFetching ? "Loading source page" : "Already on the last page",
989
+ disabledHint: unknownTotal ? "Last page is unknown" : isFetching ? "Loading source page" : "Already on the last page",
986
990
  visibilityClassName: "hidden sm:inline-flex",
987
991
  fallbackClassName: navButtonClassName,
988
- onClick: () => onPageChange(totalPages),
989
- disabled: isLastPageDisabled,
992
+ onClick: () => {
993
+ if (!unknownTotal) onPageChange(totalPages);
994
+ },
995
+ disabled: Boolean(unknownTotal) || isLastPageDisabled,
990
996
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChevronsRight, { className: "h-5 w-5" })
991
997
  }
992
998
  )