@yeverlibs/ds 1.0.12 → 1.1.0

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.mjs CHANGED
@@ -6199,10 +6199,12 @@ var TableContent = ({
6199
6199
  let shouldPaginate = false;
6200
6200
  if (searchParams?.has("perPage")) {
6201
6201
  setItemsPerPage(perPage);
6202
+ nextReplaceUrl("perPage", String(perPage), pathname);
6202
6203
  shouldPaginate = true;
6203
6204
  }
6204
6205
  if (searchParams?.has("search")) {
6205
6206
  setSearchQuery(searchParam);
6207
+ nextReplaceUrl("search", searchParam, pathname);
6206
6208
  shouldPaginate = true;
6207
6209
  }
6208
6210
  if (shouldPaginate) {
@@ -6306,7 +6308,7 @@ var TableContent = ({
6306
6308
  ]
6307
6309
  }
6308
6310
  ),
6309
- /* @__PURE__ */ jsx("div", { className: "h-auto w-full overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: cn("w-full", paginationVariant === "primary" ? "mb-8" : "mb-0"), children: [
6311
+ /* @__PURE__ */ jsx("div", { className: "h-auto w-full overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: cn("w-full", paginationVariant === "primary" && !noPagination ? "mb-8" : "mb-0"), children: [
6310
6312
  /* @__PURE__ */ jsx("thead", { className: "border-b border-gray-300 bg-gray-0", children: /* @__PURE__ */ jsxs("tr", { children: [
6311
6313
  selectable && /* @__PURE__ */ jsx("th", { className: "!w-[20px] py-3 pl-3", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4" }) }),
6312
6314
  visibleColumns.map((_, index) => /* @__PURE__ */ jsx("th", { className: "px-6 py-3", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }, index))
@@ -6374,7 +6376,7 @@ var TableContent = ({
6374
6376
  /* @__PURE__ */ jsx(Button, { onClick: handleDeleteSelection, $variant: "warning", className: "max-w-[101px] text-xs", children: "Deletar" })
6375
6377
  ] })
6376
6378
  ] }),
6377
- /* @__PURE__ */ jsx("div", { className: "h-auto w-full overflow-x-auto transition-all duration-300", children: /* @__PURE__ */ jsxs("table", { className: cn("w-full", paginationVariant === "primary" ? "mb-8" : "mb-0"), children: [
6379
+ /* @__PURE__ */ jsx("div", { className: "h-auto w-full overflow-x-auto transition-all duration-300", children: /* @__PURE__ */ jsxs("table", { className: cn("w-full", paginationVariant === "primary" && !noPagination ? "mb-8" : "mb-0"), children: [
6378
6380
  /* @__PURE__ */ jsx("thead", { className: "border-b border-gray-300 bg-gray-0", children: /* @__PURE__ */ jsxs("tr", { children: [
6379
6381
  selectable && /* @__PURE__ */ jsx("th", { className: "!w-[20px] py-3 pl-3 text-left text-xs font-bold uppercase text-gray-700", children: /* @__PURE__ */ jsx(
6380
6382
  "input",
@@ -6503,12 +6505,8 @@ var TableContent = ({
6503
6505
  const newPerPage = Number(e.target.value);
6504
6506
  setItemsPerPage(newPerPage);
6505
6507
  setCurrentPage(RESET_PAGE);
6506
- Promise.all([
6507
- nextReplaceUrl("page", "1", pathname),
6508
- nextReplaceUrl("perPage", String(newPerPage), pathname)
6509
- ]).then(() => {
6510
- handlePagination();
6511
- });
6508
+ nextReplaceUrl("page", "1", pathname);
6509
+ nextReplaceUrl("perPage", String(newPerPage), pathname);
6512
6510
  },
6513
6511
  className: "block h-8 w-full cursor-pointer appearance-none rounded border border-gray-300 bg-white p-2 text-sm leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none",
6514
6512
  children: [