@yeverlibs/ds 1.0.10 → 1.0.13

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.js CHANGED
@@ -5358,8 +5358,12 @@ var Content = ({
5358
5358
  if (parts.length >= 3) {
5359
5359
  const [name, operator, value] = parts;
5360
5360
  const filter = filterOptions.find((f) => f.name === name && f.isSearchNew);
5361
- if (filter && (filter.operator === operator || filter.operator === "eq" && operator === "=")) {
5362
- newFilters[name] = value;
5361
+ if (filter) {
5362
+ const filterOperator = filter.operator || "like";
5363
+ const isOperatorMatch = filterOperator === operator || filterOperator === "eq" && (operator === "=" || operator === "like") || filterOperator === "like" && (operator === "like" || operator === "eq");
5364
+ if (isOperatorMatch) {
5365
+ newFilters[name] = value;
5366
+ }
5363
5367
  }
5364
5368
  }
5365
5369
  });
@@ -6222,14 +6226,16 @@ var TableContent = ({
6222
6226
  }, [pathname]);
6223
6227
  React107.useEffect(() => {
6224
6228
  if (!pathname) return;
6229
+ let shouldPaginate = false;
6225
6230
  if (searchParams?.has("perPage")) {
6226
6231
  setItemsPerPage(perPage);
6227
- nextReplaceUrl("perPage", String(perPage), pathname);
6228
- handlePagination();
6232
+ shouldPaginate = true;
6229
6233
  }
6230
6234
  if (searchParams?.has("search")) {
6231
6235
  setSearchQuery(searchParam);
6232
- nextReplaceUrl("search", searchParam, pathname);
6236
+ shouldPaginate = true;
6237
+ }
6238
+ if (shouldPaginate) {
6233
6239
  handlePagination();
6234
6240
  }
6235
6241
  }, [perPage, searchParam]);
@@ -6248,9 +6254,8 @@ var TableContent = ({
6248
6254
  };
6249
6255
  const handleSearchSubmit = () => {
6250
6256
  if (!pathname) return;
6251
- Promise.all([nextReplaceUrl("search", searchQuery, pathname), nextReplaceUrl("page", "1", pathname)]).then(() => {
6252
- handlePagination();
6253
- });
6257
+ nextReplaceUrl("search", searchQuery, pathname);
6258
+ nextReplaceUrl("page", "1", pathname);
6254
6259
  };
6255
6260
  const handleClickOutside = React107.useCallback((event) => {
6256
6261
  if (actionMenuRef.current && !actionMenuRef.current.contains(event.target)) {
@@ -6331,7 +6336,7 @@ var TableContent = ({
6331
6336
  ]
6332
6337
  }
6333
6338
  ),
6334
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-auto w-full overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: cn("w-full", paginationVariant === "primary" ? "mb-8" : "mb-0"), children: [
6339
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-auto w-full overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: cn("w-full", paginationVariant === "primary" && !noPagination ? "mb-8" : "mb-0"), children: [
6335
6340
  /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "border-b border-gray-300 bg-gray-0", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6336
6341
  selectable && /* @__PURE__ */ jsxRuntime.jsx("th", { className: "!w-[20px] py-3 pl-3", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-4" }) }),
6337
6342
  visibleColumns.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-6 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-24" }) }, index))
@@ -6399,7 +6404,7 @@ var TableContent = ({
6399
6404
  /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleDeleteSelection, $variant: "warning", className: "max-w-[101px] text-xs", children: "Deletar" })
6400
6405
  ] })
6401
6406
  ] }),
6402
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-auto w-full overflow-x-auto transition-all duration-300", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: cn("w-full", paginationVariant === "primary" ? "mb-8" : "mb-0"), children: [
6407
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-auto w-full overflow-x-auto transition-all duration-300", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: cn("w-full", paginationVariant === "primary" && !noPagination ? "mb-8" : "mb-0"), children: [
6403
6408
  /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "border-b border-gray-300 bg-gray-0", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
6404
6409
  selectable && /* @__PURE__ */ jsxRuntime.jsx("th", { className: "!w-[20px] py-3 pl-3 text-left text-xs font-bold uppercase text-gray-700", children: /* @__PURE__ */ jsxRuntime.jsx(
6405
6410
  "input",