@yamada-ui/autocomplete 1.5.4-next-20241008193728 → 1.6.0-dev-20241011151311

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/dist/autocomplete-create.js.map +1 -1
  2. package/dist/autocomplete-create.mjs +2 -2
  3. package/dist/autocomplete-empty.js.map +1 -1
  4. package/dist/autocomplete-empty.mjs +2 -2
  5. package/dist/autocomplete-option.js +9 -0
  6. package/dist/autocomplete-option.js.map +1 -1
  7. package/dist/autocomplete-option.mjs +2 -2
  8. package/dist/autocomplete.js +9 -0
  9. package/dist/autocomplete.js.map +1 -1
  10. package/dist/autocomplete.mjs +6 -6
  11. package/dist/{chunk-KLXMUIGY.mjs → chunk-2HJUFFCU.mjs} +2 -2
  12. package/dist/{chunk-DDMSYTKO.mjs → chunk-6OLHNK7O.mjs} +13 -1
  13. package/dist/chunk-6OLHNK7O.mjs.map +1 -0
  14. package/dist/{chunk-EEECVCVW.mjs → chunk-7LZUXESV.mjs} +4 -4
  15. package/dist/{chunk-WFLZPB35.mjs → chunk-AIBJWPRA.mjs} +2 -2
  16. package/dist/{chunk-BKW7XJ6R.mjs → chunk-K5HCHHCJ.mjs} +2 -2
  17. package/dist/{chunk-AXC7ILCH.mjs → chunk-Q33EMTO2.mjs} +4 -4
  18. package/dist/{chunk-BGZIX6SN.mjs → chunk-WERCEZNJ.mjs} +2 -2
  19. package/dist/index.js +9 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +7 -7
  22. package/dist/multi-autocomplete.js +9 -0
  23. package/dist/multi-autocomplete.js.map +1 -1
  24. package/dist/multi-autocomplete.mjs +6 -6
  25. package/dist/use-autocomplete-option.js +9 -0
  26. package/dist/use-autocomplete-option.js.map +1 -1
  27. package/dist/use-autocomplete-option.mjs +1 -1
  28. package/dist/use-autocomplete.js +9 -0
  29. package/dist/use-autocomplete.js.map +1 -1
  30. package/dist/use-autocomplete.mjs +3 -3
  31. package/package.json +13 -13
  32. package/dist/chunk-DDMSYTKO.mjs.map +0 -1
  33. /package/dist/{chunk-KLXMUIGY.mjs.map → chunk-2HJUFFCU.mjs.map} +0 -0
  34. /package/dist/{chunk-EEECVCVW.mjs.map → chunk-7LZUXESV.mjs.map} +0 -0
  35. /package/dist/{chunk-WFLZPB35.mjs.map → chunk-AIBJWPRA.mjs.map} +0 -0
  36. /package/dist/{chunk-BKW7XJ6R.mjs.map → chunk-K5HCHHCJ.mjs.map} +0 -0
  37. /package/dist/{chunk-AXC7ILCH.mjs.map → chunk-Q33EMTO2.mjs.map} +0 -0
  38. /package/dist/{chunk-BGZIX6SN.mjs.map → chunk-WERCEZNJ.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,17 +1,17 @@
1
1
  "use client"
2
2
  import {
3
3
  MultiAutocomplete
4
- } from "./chunk-EEECVCVW.mjs";
4
+ } from "./chunk-7LZUXESV.mjs";
5
5
  import {
6
6
  Autocomplete
7
- } from "./chunk-AXC7ILCH.mjs";
8
- import "./chunk-BGZIX6SN.mjs";
7
+ } from "./chunk-Q33EMTO2.mjs";
8
+ import "./chunk-WERCEZNJ.mjs";
9
9
  import {
10
10
  AutocompleteCreate
11
- } from "./chunk-BKW7XJ6R.mjs";
11
+ } from "./chunk-K5HCHHCJ.mjs";
12
12
  import {
13
13
  AutocompleteEmpty
14
- } from "./chunk-KLXMUIGY.mjs";
14
+ } from "./chunk-2HJUFFCU.mjs";
15
15
  import "./chunk-VTBUO5SK.mjs";
16
16
  import "./chunk-TR4X4EEG.mjs";
17
17
  import {
@@ -20,8 +20,8 @@ import {
20
20
  import "./chunk-67X7JKWL.mjs";
21
21
  import {
22
22
  AutocompleteOption
23
- } from "./chunk-WFLZPB35.mjs";
24
- import "./chunk-DDMSYTKO.mjs";
23
+ } from "./chunk-AIBJWPRA.mjs";
24
+ import "./chunk-6OLHNK7O.mjs";
25
25
  import "./chunk-V6YCG642.mjs";
26
26
  import "./chunk-WDQYM4FP.mjs";
27
27
  export {
@@ -185,6 +185,15 @@ var useAutocompleteOption = (props) => {
185
185
  const values = descendants.values();
186
186
  const frontValues = values.slice(0, index);
187
187
  const isMulti = (0, import_utils3.isArray)(value);
188
+ if ((0, import_utils3.isUndefined)(optionValue)) {
189
+ if ((0, import_utils3.isString)(children) || (0, import_utils3.isNumber)(children)) {
190
+ optionValue = children.toString();
191
+ } else {
192
+ console.warn(
193
+ `${!isMulti ? "Autocomplete" : "MultiAutocomplete"}: Cannot infer the option value of complex children. Pass a \`value\` prop or use a plain string as children to <Option>.`
194
+ );
195
+ }
196
+ }
188
197
  const isDuplicated = !isMulti ? frontValues.some(({ node }) => node.dataset.value === (optionValue != null ? optionValue : "")) : false;
189
198
  const isSelected = !isDuplicated && (!isMulti ? (optionValue != null ? optionValue : "") === value : value.includes(optionValue != null ? optionValue : ""));
190
199
  const isTarget = "target" in ((_b = (_a = itemRef.current) == null ? void 0 : _a.dataset) != null ? _b : {});