@yeverlibs/ds 1.0.9 → 1.0.12

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
@@ -5328,8 +5328,12 @@ var Content = ({
5328
5328
  if (parts.length >= 3) {
5329
5329
  const [name, operator, value] = parts;
5330
5330
  const filter = filterOptions.find((f) => f.name === name && f.isSearchNew);
5331
- if (filter && (filter.operator === operator || filter.operator === "eq" && operator === "=")) {
5332
- newFilters[name] = value;
5331
+ if (filter) {
5332
+ const filterOperator = filter.operator || "like";
5333
+ const isOperatorMatch = filterOperator === operator || filterOperator === "eq" && (operator === "=" || operator === "like") || filterOperator === "like" && (operator === "like" || operator === "eq");
5334
+ if (isOperatorMatch) {
5335
+ newFilters[name] = value;
5336
+ }
5333
5337
  }
5334
5338
  }
5335
5339
  });
@@ -6192,14 +6196,16 @@ var TableContent = ({
6192
6196
  }, [pathname]);
6193
6197
  useEffect(() => {
6194
6198
  if (!pathname) return;
6199
+ let shouldPaginate = false;
6195
6200
  if (searchParams?.has("perPage")) {
6196
6201
  setItemsPerPage(perPage);
6197
- nextReplaceUrl("perPage", String(perPage), pathname);
6198
- handlePagination();
6202
+ shouldPaginate = true;
6199
6203
  }
6200
6204
  if (searchParams?.has("search")) {
6201
6205
  setSearchQuery(searchParam);
6202
- nextReplaceUrl("search", searchParam, pathname);
6206
+ shouldPaginate = true;
6207
+ }
6208
+ if (shouldPaginate) {
6203
6209
  handlePagination();
6204
6210
  }
6205
6211
  }, [perPage, searchParam]);
@@ -6218,9 +6224,8 @@ var TableContent = ({
6218
6224
  };
6219
6225
  const handleSearchSubmit = () => {
6220
6226
  if (!pathname) return;
6221
- Promise.all([nextReplaceUrl("search", searchQuery, pathname), nextReplaceUrl("page", "1", pathname)]).then(() => {
6222
- handlePagination();
6223
- });
6227
+ nextReplaceUrl("search", searchQuery, pathname);
6228
+ nextReplaceUrl("page", "1", pathname);
6224
6229
  };
6225
6230
  const handleClickOutside = useCallback((event) => {
6226
6231
  if (actionMenuRef.current && !actionMenuRef.current.contains(event.target)) {