@carlonicora/nextjs-jsonapi 1.139.0 → 1.139.1

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.
@@ -48,7 +48,7 @@ import {
48
48
  TabsList,
49
49
  TabsTrigger,
50
50
  useCurrentUserContext
51
- } from "../chunk-GTBHGR3F.mjs";
51
+ } from "../chunk-LFEI3ASB.mjs";
52
52
  import {
53
53
  getRoleId,
54
54
  getStripePublishableKey
@@ -6645,7 +6645,7 @@ function useDataListRetriever(params) {
6645
6645
  ...retrieverParams,
6646
6646
  ...additionalParamsRef.current
6647
6647
  };
6648
- retrieverParams.search = currentSearchTerm;
6648
+ if (additionalParamsRef.current.search === void 0) retrieverParams.search = currentSearchTerm;
6649
6649
  retrieverParams.next = nextRef;
6650
6650
  retrieverParams.previous = previousRef;
6651
6651
  retrieverParams.self = selfRef;
@@ -8249,6 +8249,7 @@ function EntityMultiSelector({
8249
8249
  const [searchTerm, setSearchTerm] = useState14("");
8250
8250
  const [options, setOptions] = useState14([]);
8251
8251
  const searchInputRef = useRef11(null);
8252
+ const searchTermRef = useRef11("");
8252
8253
  const getLabelRef = useRef11(getLabel);
8253
8254
  const toFormValueRef = useRef11(toFormValue);
8254
8255
  const getFormValueLabelRef = useRef11(getFormValueLabel);
@@ -8286,11 +8287,10 @@ function EntityMultiSelector({
8286
8287
  }, [ready]);
8287
8288
  const updateSearch = useCallback13(
8288
8289
  (searchedTerm) => {
8289
- if (searchedTerm.trim()) {
8290
- data.addAdditionalParameter("search", searchedTerm.trim());
8291
- } else {
8292
- data.removeAdditionalParameter("search");
8293
- }
8290
+ const trimmed = searchedTerm.trim();
8291
+ if (trimmed === searchTermRef.current) return;
8292
+ searchTermRef.current = trimmed;
8293
+ data.search(trimmed);
8294
8294
  },
8295
8295
  [data]
8296
8296
  );
@@ -8357,13 +8357,12 @@ function EntityMultiSelector({
8357
8357
  [form, id, options]
8358
8358
  );
8359
8359
  const sortedOptions = useMemo11(() => {
8360
- const filtered = searchTerm.trim() ? options.filter((o) => o.label.toLowerCase().includes(searchTerm.trim().toLowerCase())) : options;
8361
- return [...filtered].sort((a, b) => {
8360
+ return [...options].sort((a, b) => {
8362
8361
  const aSelected = selectedIds.has(a.id) ? 0 : 1;
8363
8362
  const bSelected = selectedIds.has(b.id) ? 0 : 1;
8364
8363
  return aSelected - bSelected;
8365
8364
  });
8366
- }, [options, selectedIds, searchTerm]);
8365
+ }, [options, selectedIds]);
8367
8366
  const triggerSummary = useMemo11(() => {
8368
8367
  if (selectedValues.length === 0) return null;
8369
8368
  return selectedValues.map((v) => stableGetFormValueLabel(v)).join(", ");
@@ -10115,7 +10114,7 @@ import { useRef as useRef17 } from "react";
10115
10114
  import dynamic from "next/dynamic";
10116
10115
  import React17 from "react";
10117
10116
  import { jsx as jsx86 } from "react/jsx-runtime";
10118
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-XVVV2CUL.mjs"), {
10117
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-WXYPQVVY.mjs"), {
10119
10118
  ssr: false
10120
10119
  });
10121
10120
  var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -23889,4 +23888,4 @@ export {
23889
23888
  useOAuthClients,
23890
23889
  useOAuthClient
23891
23890
  };
23892
- //# sourceMappingURL=chunk-GTBHGR3F.mjs.map
23891
+ //# sourceMappingURL=chunk-LFEI3ASB.mjs.map