@yamada-ui/autocomplete 1.6.5-next-20241123050941 → 1.6.6-dev-20241123052407
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/autocomplete-context.d.mts +0 -1
- package/dist/autocomplete-context.d.ts +0 -1
- package/dist/autocomplete-context.js.map +1 -1
- package/dist/autocomplete-context.mjs +1 -1
- package/dist/autocomplete-create.js.map +1 -1
- package/dist/autocomplete-create.mjs +4 -4
- package/dist/autocomplete-empty.js.map +1 -1
- package/dist/autocomplete-empty.mjs +4 -4
- package/dist/autocomplete-icon.js.map +1 -1
- package/dist/autocomplete-icon.mjs +2 -2
- package/dist/autocomplete-list.js +22 -15
- package/dist/autocomplete-list.js.map +1 -1
- package/dist/autocomplete-list.mjs +3 -3
- package/dist/autocomplete-option-group.js.map +1 -1
- package/dist/autocomplete-option-group.mjs +3 -3
- package/dist/autocomplete-option.js +10 -6
- package/dist/autocomplete-option.js.map +1 -1
- package/dist/autocomplete-option.mjs +4 -4
- package/dist/autocomplete.js +78 -84
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.mjs +12 -12
- package/dist/{chunk-JYPMXZG4.mjs → chunk-2CVB4NO5.mjs} +7 -7
- package/dist/{chunk-3A2HEULI.mjs → chunk-2LP57WVB.mjs} +12 -8
- package/dist/chunk-2LP57WVB.mjs.map +1 -0
- package/dist/{chunk-PTPJFYGI.mjs → chunk-4GVV3HBE.mjs} +29 -13
- package/dist/chunk-4GVV3HBE.mjs.map +1 -0
- package/dist/{chunk-6OTUOEYS.mjs → chunk-7QCZ5NGS.mjs} +2 -2
- package/dist/{chunk-PU6HFINM.mjs → chunk-ABCTEZN5.mjs} +3 -3
- package/dist/{chunk-NOSATNDY.mjs → chunk-IFH3PPSD.mjs} +10 -8
- package/dist/chunk-IFH3PPSD.mjs.map +1 -0
- package/dist/{chunk-REPBXBG3.mjs → chunk-LIBFONYN.mjs} +7 -10
- package/dist/chunk-LIBFONYN.mjs.map +1 -0
- package/dist/{chunk-2UKLSSUA.mjs → chunk-PWV7X7G6.mjs} +4 -4
- package/dist/{chunk-G6SC44LI.mjs → chunk-RK5E5J5E.mjs} +4 -4
- package/dist/{chunk-ZNO5RUVT.mjs → chunk-TP5VZFO3.mjs} +1 -1
- package/dist/chunk-TP5VZFO3.mjs.map +1 -0
- package/dist/{chunk-CMFJUJJW.mjs → chunk-UX5QECNB.mjs} +2 -2
- package/dist/{chunk-6II6KCIJ.mjs → chunk-YPKDYYEV.mjs} +4 -4
- package/dist/{chunk-75VF5Q5W.mjs → chunk-ZR77IT3O.mjs} +51 -69
- package/dist/chunk-ZR77IT3O.mjs.map +1 -0
- package/dist/index.js +81 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -13
- package/dist/multi-autocomplete.d.mts +8 -0
- package/dist/multi-autocomplete.d.ts +8 -0
- package/dist/multi-autocomplete.js +81 -85
- package/dist/multi-autocomplete.js.map +1 -1
- package/dist/multi-autocomplete.mjs +12 -12
- package/dist/use-autocomplete-list.d.mts +2 -1
- package/dist/use-autocomplete-list.d.ts +2 -1
- package/dist/use-autocomplete-list.js +19 -9
- package/dist/use-autocomplete-list.js.map +1 -1
- package/dist/use-autocomplete-list.mjs +2 -2
- package/dist/use-autocomplete-option-group.js.map +1 -1
- package/dist/use-autocomplete-option-group.mjs +2 -2
- package/dist/use-autocomplete-option.d.mts +16 -0
- package/dist/use-autocomplete-option.d.ts +16 -0
- package/dist/use-autocomplete-option.js +10 -6
- package/dist/use-autocomplete-option.js.map +1 -1
- package/dist/use-autocomplete-option.mjs +2 -2
- package/dist/use-autocomplete.d.mts +3 -5
- package/dist/use-autocomplete.d.ts +3 -5
- package/dist/use-autocomplete.js +56 -69
- package/dist/use-autocomplete.js.map +1 -1
- package/dist/use-autocomplete.mjs +7 -7
- package/package.json +7 -7
- package/dist/chunk-3A2HEULI.mjs.map +0 -1
- package/dist/chunk-75VF5Q5W.mjs.map +0 -1
- package/dist/chunk-NOSATNDY.mjs.map +0 -1
- package/dist/chunk-PTPJFYGI.mjs.map +0 -1
- package/dist/chunk-REPBXBG3.mjs.map +0 -1
- package/dist/chunk-ZNO5RUVT.mjs.map +0 -1
- /package/dist/{chunk-JYPMXZG4.mjs.map → chunk-2CVB4NO5.mjs.map} +0 -0
- /package/dist/{chunk-6OTUOEYS.mjs.map → chunk-7QCZ5NGS.mjs.map} +0 -0
- /package/dist/{chunk-PU6HFINM.mjs.map → chunk-ABCTEZN5.mjs.map} +0 -0
- /package/dist/{chunk-2UKLSSUA.mjs.map → chunk-PWV7X7G6.mjs.map} +0 -0
- /package/dist/{chunk-G6SC44LI.mjs.map → chunk-RK5E5J5E.mjs.map} +0 -0
- /package/dist/{chunk-CMFJUJJW.mjs.map → chunk-UX5QECNB.mjs.map} +0 -0
- /package/dist/{chunk-6II6KCIJ.mjs.map → chunk-YPKDYYEV.mjs.map} +0 -0
@@ -2,7 +2,7 @@
|
|
2
2
|
import {
|
3
3
|
useAutocompleteContext,
|
4
4
|
useAutocompleteDescendant
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-TP5VZFO3.mjs";
|
6
6
|
|
7
7
|
// src/use-autocomplete-option.ts
|
8
8
|
import {
|
@@ -41,13 +41,17 @@ var useAutocompleteOption = (props) => {
|
|
41
41
|
id,
|
42
42
|
children,
|
43
43
|
closeOnSelect: customCloseOnSelect,
|
44
|
+
disabled,
|
45
|
+
focusable,
|
44
46
|
icon: customIcon,
|
45
47
|
isDisabled,
|
46
48
|
isFocusable,
|
47
49
|
value: optionValue,
|
48
50
|
...computedProps
|
49
51
|
} = { ...optionProps, ...props };
|
50
|
-
|
52
|
+
disabled != null ? disabled : disabled = isDisabled;
|
53
|
+
focusable != null ? focusable : focusable = isFocusable;
|
54
|
+
const trulyDisabled = !!disabled && !focusable;
|
51
55
|
const { descendants, index, register } = useAutocompleteDescendant({
|
52
56
|
disabled: trulyDisabled
|
53
57
|
});
|
@@ -73,7 +77,7 @@ var useAutocompleteOption = (props) => {
|
|
73
77
|
const onClick = useCallback(
|
74
78
|
(ev) => {
|
75
79
|
ev.stopPropagation();
|
76
|
-
if (
|
80
|
+
if (disabled || !isTargetOption(ev.currentTarget)) {
|
77
81
|
if (inputRef.current) inputRef.current.focus();
|
78
82
|
return;
|
79
83
|
}
|
@@ -87,7 +91,7 @@ var useAutocompleteOption = (props) => {
|
|
87
91
|
isDuplicated,
|
88
92
|
onFocusNext,
|
89
93
|
omitSelectedValues,
|
90
|
-
|
94
|
+
disabled,
|
91
95
|
optionValue,
|
92
96
|
setFocusedIndex,
|
93
97
|
index,
|
@@ -119,10 +123,10 @@ var useAutocompleteOption = (props) => {
|
|
119
123
|
...props2,
|
120
124
|
id,
|
121
125
|
style: isHidden ? style : void 0,
|
122
|
-
"aria-disabled": ariaAttr(
|
126
|
+
"aria-disabled": ariaAttr(disabled),
|
123
127
|
"aria-hidden": ariaAttr(isHidden),
|
124
128
|
"aria-selected": isSelected,
|
125
|
-
"data-disabled": dataAttr(
|
129
|
+
"data-disabled": dataAttr(disabled),
|
126
130
|
"data-duplicated": dataAttr(isDuplicated),
|
127
131
|
"data-focus": dataAttr(isFocused),
|
128
132
|
"data-target": dataAttr(true),
|
@@ -136,7 +140,7 @@ var useAutocompleteOption = (props) => {
|
|
136
140
|
isDuplicated,
|
137
141
|
optionValue,
|
138
142
|
computedProps,
|
139
|
-
|
143
|
+
disabled,
|
140
144
|
isFocused,
|
141
145
|
isSelected,
|
142
146
|
isTarget,
|
@@ -220,4 +224,4 @@ export {
|
|
220
224
|
useAutocompleteCreate,
|
221
225
|
useAutocompleteEmpty
|
222
226
|
};
|
223
|
-
//# sourceMappingURL=chunk-
|
227
|
+
//# sourceMappingURL=chunk-2LP57WVB.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-autocomplete-option.ts"],"sourcesContent":["import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport type { CSSProperties, MouseEvent } from \"react\"\nimport {\n ariaAttr,\n dataAttr,\n handlerAll,\n isArray,\n isHTMLElement,\n isNumber,\n isString,\n isUndefined,\n mergeRefs,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useId, useRef } from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendant,\n} from \"./autocomplete-context\"\n\nconst isTargetOption = (target: EventTarget | null): boolean =>\n isHTMLElement(target) && !!target.getAttribute(\"role\")?.startsWith(\"option\")\n\nexport interface UseAutocompleteOptionProps\n extends Omit<HTMLUIProps, \"children\" | \"value\"> {\n /**\n * The label of the autocomplete option.\n */\n children?: string\n /**\n * If `true`, the list element will be closed when selected.\n *\n * @default false\n */\n closeOnSelect?: boolean\n /**\n * If `true`, the autocomplete option will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, the autocomplete option will be focusable.\n *\n * @default false\n */\n focusable?: boolean\n /**\n * If `true`, the autocomplete option will be disabled.\n *\n * @default false\n *\n * @deprecated Use `disabled` instead.\n */\n isDisabled?: boolean\n /**\n * If `true`, the autocomplete option will be focusable.\n *\n * @default false\n *\n * @deprecated Use `focusable` instead.\n */\n isFocusable?: boolean\n /**\n * The value of the autocomplete option.\n */\n value?: string\n}\n\nexport const useAutocompleteOption = (props: UseAutocompleteOptionProps) => {\n const {\n closeOnSelect,\n focusedIndex,\n inputRef,\n omitSelectedValues,\n setFocusedIndex,\n value,\n optionProps,\n onChange,\n onClose,\n onFocusNext,\n } = useAutocompleteContext()\n const uuid = useId()\n const itemRef = useRef<HTMLLIElement>(null)\n let {\n id,\n children,\n closeOnSelect: customCloseOnSelect,\n disabled,\n focusable,\n icon: customIcon,\n isDisabled,\n isFocusable,\n value: optionValue,\n ...computedProps\n } = { ...optionProps, ...props }\n disabled ??= isDisabled\n focusable ??= isFocusable\n const trulyDisabled = !!disabled && !focusable\n const { descendants, index, register } = useAutocompleteDescendant({\n disabled: trulyDisabled,\n })\n const values = descendants.values()\n const frontValues = values.slice(0, index)\n const isMulti = isArray(value)\n const isDuplicated = frontValues.some(\n ({ node }) => node.dataset.value === (optionValue ?? \"\"),\n )\n const isSelected =\n !isDuplicated &&\n (!isMulti\n ? (optionValue ?? \"\") === value\n : value.includes(optionValue ?? \"\"))\n const isTarget = \"target\" in (itemRef.current?.dataset ?? {})\n const isFocused = index === focusedIndex\n\n id ??= uuid\n\n if (isUndefined(optionValue)) {\n if (isString(children) || isNumber(children)) {\n optionValue = children.toString()\n } else {\n console.warn(\n `${\n !isMulti ? \"Autocomplete\" : \"MultiAutocomplete\"\n }: Cannot infer the option value of complex children. Pass a \\`value\\` prop or use a plain string as children to <Option>.`,\n )\n }\n }\n\n const onClick = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n ev.stopPropagation()\n\n if (disabled || !isTargetOption(ev.currentTarget)) {\n if (inputRef.current) inputRef.current.focus()\n\n return\n }\n\n if (!isDuplicated) setFocusedIndex(index)\n\n onChange(optionValue ?? \"\")\n\n if (inputRef.current) inputRef.current.focus()\n\n if (customCloseOnSelect ?? closeOnSelect) onClose()\n\n if (omitSelectedValues) onFocusNext(index)\n },\n [\n isDuplicated,\n onFocusNext,\n omitSelectedValues,\n disabled,\n optionValue,\n setFocusedIndex,\n index,\n onChange,\n customCloseOnSelect,\n closeOnSelect,\n onClose,\n inputRef,\n ],\n )\n\n const getOptionProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const isHidden = !isTarget || (omitSelectedValues && isSelected)\n\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: \"0px\",\n position: \"absolute\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n }\n\n return {\n ref: mergeRefs(itemRef, ref, register),\n role: \"option\",\n ...computedProps,\n ...props,\n id,\n style: isHidden ? style : undefined,\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-hidden\": ariaAttr(isHidden),\n \"aria-selected\": isSelected,\n \"data-disabled\": dataAttr(disabled),\n \"data-duplicated\": dataAttr(isDuplicated),\n \"data-focus\": dataAttr(isFocused),\n \"data-target\": dataAttr(true),\n \"data-value\": optionValue ?? \"\",\n tabIndex: -1,\n onClick: handlerAll(computedProps.onClick, props.onClick, onClick),\n }\n },\n [\n id,\n isDuplicated,\n optionValue,\n computedProps,\n disabled,\n isFocused,\n isSelected,\n isTarget,\n omitSelectedValues,\n onClick,\n register,\n ],\n )\n\n return {\n children,\n customIcon,\n isFocused,\n isSelected,\n isTarget,\n omitSelectedValues,\n getOptionProps,\n }\n}\n\nexport type UseAutocompleteOptionReturn = ReturnType<\n typeof useAutocompleteOption\n>\n\nexport const useAutocompleteCreate = () => {\n const { isHit, onCreate } = useAutocompleteContext()\n\n const getCreateProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: \"0px\",\n position: \"absolute\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n }\n\n return {\n ref,\n role: \"option\",\n ...props,\n style: isHit ? style : undefined,\n \"aria-hidden\": ariaAttr(isHit),\n \"data-focus\": dataAttr(!isHit),\n tabIndex: -1,\n onClick: handlerAll(props.onClick, onCreate),\n }\n },\n [isHit, onCreate],\n )\n\n return { getCreateProps }\n}\n\nexport type UseAutocompleteCreateReturn = ReturnType<\n typeof useAutocompleteCreate\n>\n\nexport const useAutocompleteEmpty = () => {\n const { isEmpty, isHit } = useAutocompleteContext()\n\n const getEmptyProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const isHidden = isHit && !isEmpty\n\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: \"0px\",\n position: \"absolute\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n }\n\n return {\n ref,\n role: \"presentation\",\n ...props,\n style: isHidden ? style : undefined,\n \"aria-hidden\": ariaAttr(isHidden),\n tabIndex: -1,\n }\n },\n [isHit, isEmpty],\n )\n\n return { getEmptyProps }\n}\n\nexport type UseAutocompleteEmptyReturn = ReturnType<typeof useAutocompleteEmpty>\n"],"mappings":";;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,OAAO,cAAc;AAM3C,IAAM,iBAAiB,CAAC,WAAqC;AAnB7D;AAoBE,uBAAc,MAAM,KAAK,CAAC,GAAC,YAAO,aAAa,MAAM,MAA1B,mBAA6B,WAAW;AAAA;AAgD9D,IAAM,wBAAwB,CAAC,UAAsC;AApE5E;AAqEE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,uBAAuB;AAC3B,QAAM,OAAO,MAAM;AACnB,QAAM,UAAU,OAAsB,IAAI;AAC1C,MAAI;AAAA,IACF;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,GAAG;AAAA,EACL,IAAI,EAAE,GAAG,aAAa,GAAG,MAAM;AAC/B,2CAAa;AACb,8CAAc;AACd,QAAM,gBAAgB,CAAC,CAAC,YAAY,CAAC;AACrC,QAAM,EAAE,aAAa,OAAO,SAAS,IAAI,0BAA0B;AAAA,IACjE,UAAU;AAAA,EACZ,CAAC;AACD,QAAM,SAAS,YAAY,OAAO;AAClC,QAAM,cAAc,OAAO,MAAM,GAAG,KAAK;AACzC,QAAM,UAAU,QAAQ,KAAK;AAC7B,QAAM,eAAe,YAAY;AAAA,IAC/B,CAAC,EAAE,KAAK,MAAM,KAAK,QAAQ,WAAW,oCAAe;AAAA,EACvD;AACA,QAAM,aACJ,CAAC,iBACA,CAAC,WAC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M,SAAS,QAAQ;AAAA,MAC7C;AAAA,IACF;AAAA,IACA,CAAC,OAAO,QAAQ;AAAA,EAClB;AAEA,SAAO,EAAE,eAAe;AAC1B;AAMO,IAAM,uBAAuB,MAAM;AACxC,QAAM,EAAE,SAAS,MAAM,IAAI,uBAAuB;AAElD,QAAM,gBAA4B;AAAA,IAChC,CAAC,QAAQ,CAAC,GAAG,MAAM,SAAS;AAC1B,YAAM,WAAW,SAAS,CAAC;AAE3B,YAAM,QAAuB;AAAA,QAC3B,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,OAAO;AAAA,MACT;AAEA,aAAO;AAAA,QACL;AAAA,QACA,MAAM;AAAA,QACN,GAAG;AAAA,QACH,OAAO,WAAW,QAAQ;AAAA,QAC1B,eAAe,SAAS,QAAQ;AAAA,QAChC,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,CAAC,OAAO,OAAO;AAAA,EACjB;AAEA,SAAO,EAAE,cAAc;AACzB;","names":["props"]}
|
@@ -2,15 +2,21 @@
|
|
2
2
|
import {
|
3
3
|
useAutocompleteContext,
|
4
4
|
useAutocompleteDescendantsContext
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-TP5VZFO3.mjs";
|
6
6
|
|
7
7
|
// src/use-autocomplete-list.ts
|
8
|
-
import {
|
9
|
-
|
8
|
+
import {
|
9
|
+
ariaAttr,
|
10
|
+
handlerAll,
|
11
|
+
isArray,
|
12
|
+
mergeRefs,
|
13
|
+
useUpdateEffect
|
14
|
+
} from "@yamada-ui/utils";
|
15
|
+
import { useCallback, useEffect, useRef } from "react";
|
10
16
|
var useAutocompleteList = () => {
|
11
|
-
const { focusedIndex, isOpen,
|
17
|
+
const { focusedIndex, isOpen, rebirthOptions, value } = useAutocompleteContext();
|
12
18
|
const descendants = useAutocompleteDescendantsContext();
|
13
|
-
const
|
19
|
+
const listRef = useRef(null);
|
14
20
|
const beforeFocusedIndex = useRef(-1);
|
15
21
|
const selectedValue = descendants.value(focusedIndex);
|
16
22
|
const isMulti = isArray(value);
|
@@ -46,25 +52,35 @@ var useAutocompleteList = () => {
|
|
46
52
|
useUpdateEffect(() => {
|
47
53
|
if (!isOpen) beforeFocusedIndex.current = -1;
|
48
54
|
}, [isOpen]);
|
55
|
+
const getContainerProps = useCallback(
|
56
|
+
(props = {}, ref = null) => ({
|
57
|
+
ref,
|
58
|
+
"aria-multiselectable": ariaAttr(isMulti),
|
59
|
+
role: "listbox",
|
60
|
+
...props,
|
61
|
+
onAnimationComplete: handlerAll(
|
62
|
+
props.onAnimationComplete,
|
63
|
+
onAnimationComplete
|
64
|
+
)
|
65
|
+
}),
|
66
|
+
[isMulti, onAnimationComplete]
|
67
|
+
);
|
49
68
|
const getListProps = useCallback(
|
50
|
-
(
|
51
|
-
id: id != null ? id : uuid,
|
69
|
+
(props = {}, ref = null) => ({
|
52
70
|
ref: mergeRefs(listRef, ref),
|
53
|
-
"aria-multiselectable": ariaAttr(isMulti),
|
54
71
|
position: "relative",
|
55
|
-
role: "listbox",
|
56
72
|
tabIndex: -1,
|
57
73
|
...props
|
58
74
|
}),
|
59
|
-
[listRef
|
75
|
+
[listRef]
|
60
76
|
);
|
61
77
|
return {
|
62
|
-
|
63
|
-
|
78
|
+
getContainerProps,
|
79
|
+
getListProps
|
64
80
|
};
|
65
81
|
};
|
66
82
|
|
67
83
|
export {
|
68
84
|
useAutocompleteList
|
69
85
|
};
|
70
|
-
//# sourceMappingURL=chunk-
|
86
|
+
//# sourceMappingURL=chunk-4GVV3HBE.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-autocomplete-list.ts"],"sourcesContent":["import type { PropGetter } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport {\n ariaAttr,\n handlerAll,\n isArray,\n mergeRefs,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useRef } from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendantsContext,\n} from \"./autocomplete-context\"\n\nexport const useAutocompleteList = () => {\n const { focusedIndex, isOpen, rebirthOptions, value } =\n useAutocompleteContext()\n const descendants = useAutocompleteDescendantsContext()\n const listRef = useRef<HTMLDivElement>(null)\n const beforeFocusedIndex = useRef<number>(-1)\n const selectedValue = descendants.value(focusedIndex)\n const isMulti = isArray(value)\n\n const onAnimationComplete = useCallback(() => {\n if (!isOpen) rebirthOptions(false)\n }, [isOpen, rebirthOptions])\n\n useEffect(() => {\n if (!listRef.current || !selectedValue) return\n\n if (beforeFocusedIndex.current === selectedValue.index) return\n\n const parent = listRef.current\n const child = selectedValue.node\n\n const parentHeight = parent.clientHeight\n const viewTop = parent.scrollTop\n const viewBottom = viewTop + parentHeight\n\n const childHeight = child.clientHeight\n const childTop = child.offsetTop\n const childBottom = childTop + childHeight\n\n const isInView = viewTop <= childTop && childBottom <= viewBottom\n\n const isScrollBottom = beforeFocusedIndex.current < selectedValue.index\n\n if (!isInView) {\n if (childBottom <= parentHeight) {\n listRef.current.scrollTo({ top: 0 })\n } else {\n if (!isScrollBottom) {\n listRef.current.scrollTo({ top: childTop + 1 })\n } else {\n listRef.current.scrollTo({ top: childBottom - parentHeight })\n }\n }\n }\n\n beforeFocusedIndex.current = selectedValue.index\n }, [listRef, selectedValue])\n\n useUpdateEffect(() => {\n if (!isOpen) beforeFocusedIndex.current = -1\n }, [isOpen])\n\n const getContainerProps: PropGetter<MotionProps, MotionProps> = useCallback(\n (props = {}, ref = null) => ({\n ref,\n \"aria-multiselectable\": ariaAttr(isMulti),\n role: \"listbox\",\n ...props,\n onAnimationComplete: handlerAll(\n props.onAnimationComplete,\n onAnimationComplete,\n ),\n }),\n [isMulti, onAnimationComplete],\n )\n\n const getListProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ref: mergeRefs(listRef, ref),\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9D;AAAA,MACF;AAAA,IACF;AAEA,uBAAmB,UAAU,cAAc;AAAA,EAC7C,GAAG,CAAC,SAAS,aAAa,CAAC;AAE3B,kBAAgB,MAAM;AACpB,QAAI,CAAC,OAAQ,oBAAmB,UAAU;AAAA,EAC5C,GAAG,CAAC,MAAM,CAAC;AAEX,QAAM,oBAA0D;AAAA,IAC9D,CAAC,QAAQ,CAAC,GAAG,MAAM,UAAU;AAAA,MAC3B;AAAA,MACA,wBAAwB,SAAS,OAAO;AAAA,MACxC,MAAM;AAAA,MACN,GAAG;AAAA,MACH,qBAAqB;AAAA,QACnB,MAAM;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,SAAS,mBAAmB;AAAA,EAC/B;AAEA,QAAM,eAA2B;AAAA,IAC/B,CAAC,QAAQ,CAAC,GAAG,MAAM,UAAU;AAAA,MAC3B,KAAK,UAAU,SAAS,GAAG;AAAA,MAC3B,UAAU;AAAA,MACV,UAAU;AAAA,MACV,GAAG;AAAA,IACL;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useAutocompleteContext
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-TP5VZFO3.mjs";
|
5
5
|
|
6
6
|
// src/autocomplete-icon.tsx
|
7
7
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -105,4 +105,4 @@ export {
|
|
105
105
|
AutocompleteClearIcon,
|
106
106
|
AutocompleteItemIcon
|
107
107
|
};
|
108
|
-
//# sourceMappingURL=chunk-
|
108
|
+
//# sourceMappingURL=chunk-7QCZ5NGS.mjs.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useAutocompleteOptionGroup
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-UX5QECNB.mjs";
|
5
5
|
import {
|
6
6
|
useAutocompleteContext
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-TP5VZFO3.mjs";
|
8
8
|
|
9
9
|
// src/autocomplete-option-group.tsx
|
10
10
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -67,4 +67,4 @@ AutocompleteOptionGroup.__ui__ = "AutocompleteOptionGroup";
|
|
67
67
|
export {
|
68
68
|
AutocompleteOptionGroup
|
69
69
|
};
|
70
|
-
//# sourceMappingURL=chunk-
|
70
|
+
//# sourceMappingURL=chunk-ABCTEZN5.mjs.map
|
@@ -2,25 +2,25 @@
|
|
2
2
|
import {
|
3
3
|
useAutocomplete,
|
4
4
|
useAutocompleteInput
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-ZR77IT3O.mjs";
|
6
6
|
import {
|
7
7
|
AutocompleteCreate
|
8
|
-
} from "./chunk-
|
8
|
+
} from "./chunk-RK5E5J5E.mjs";
|
9
9
|
import {
|
10
10
|
AutocompleteEmpty
|
11
|
-
} from "./chunk-
|
11
|
+
} from "./chunk-YPKDYYEV.mjs";
|
12
12
|
import {
|
13
13
|
AutocompleteList
|
14
|
-
} from "./chunk-
|
14
|
+
} from "./chunk-LIBFONYN.mjs";
|
15
15
|
import {
|
16
16
|
AutocompleteClearIcon,
|
17
17
|
AutocompleteIcon
|
18
|
-
} from "./chunk-
|
18
|
+
} from "./chunk-7QCZ5NGS.mjs";
|
19
19
|
import {
|
20
20
|
AutocompleteDescendantsContextProvider,
|
21
21
|
AutocompleteProvider,
|
22
22
|
useAutocompleteContext
|
23
|
-
} from "./chunk-
|
23
|
+
} from "./chunk-TP5VZFO3.mjs";
|
24
24
|
|
25
25
|
// src/multi-autocomplete.tsx
|
26
26
|
import {
|
@@ -42,6 +42,7 @@ var MultiAutocomplete = forwardRef(
|
|
42
42
|
);
|
43
43
|
let {
|
44
44
|
className,
|
45
|
+
clearable,
|
45
46
|
closeOnSelect = false,
|
46
47
|
color,
|
47
48
|
component,
|
@@ -88,6 +89,7 @@ var MultiAutocomplete = forwardRef(
|
|
88
89
|
});
|
89
90
|
h != null ? h : h = height;
|
90
91
|
minH != null ? minH : minH = minHeight;
|
92
|
+
clearable != null ? clearable : clearable = isClearable;
|
91
93
|
const css = {
|
92
94
|
color,
|
93
95
|
h: "fit-content",
|
@@ -132,7 +134,7 @@ var MultiAutocomplete = forwardRef(
|
|
132
134
|
...getFieldProps(fieldProps, ref)
|
133
135
|
}
|
134
136
|
),
|
135
|
-
|
137
|
+
clearable && value.length ? /* @__PURE__ */ jsx(
|
136
138
|
AutocompleteClearIcon,
|
137
139
|
{
|
138
140
|
...clearIconProps,
|
@@ -257,4 +259,4 @@ MultiAutocompleteField.__ui__ = "MultiAutocompleteField";
|
|
257
259
|
export {
|
258
260
|
MultiAutocomplete
|
259
261
|
};
|
260
|
-
//# sourceMappingURL=chunk-
|
262
|
+
//# sourceMappingURL=chunk-IFH3PPSD.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/multi-autocomplete.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport type {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n} from \"react\"\nimport type { AutocompleteCreateProps } from \"./autocomplete-create\"\nimport type { AutocompleteEmptyProps } from \"./autocomplete-empty\"\nimport type { AutocompleteIconProps } from \"./autocomplete-icon\"\nimport type { AutocompleteListProps } from \"./autocomplete-list\"\nimport type { UseAutocompleteProps } from \"./use-autocomplete\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { Popover, PopoverTrigger } from \"@yamada-ui/popover\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport { cx, handlerAll, runIfFunc } from \"@yamada-ui/utils\"\nimport { cloneElement, useMemo } from \"react\"\nimport {\n AutocompleteDescendantsContextProvider,\n AutocompleteProvider,\n useAutocompleteContext,\n} from \"./autocomplete-context\"\nimport { AutocompleteCreate } from \"./autocomplete-create\"\nimport { AutocompleteEmpty } from \"./autocomplete-empty\"\nimport { AutocompleteClearIcon, AutocompleteIcon } from \"./autocomplete-icon\"\nimport { AutocompleteList } from \"./autocomplete-list\"\nimport { useAutocomplete, useAutocompleteInput } from \"./use-autocomplete\"\n\ninterface MultiAutocompleteOptions {\n /**\n * If `true`, display the select clear icon.\n *\n * @default true\n */\n clearable?: boolean\n /**\n * If `true`, the list element will be closed when value is selected.\n *\n * @default false\n */\n closeOnSelect?: boolean\n /**\n * The custom display value to use.\n */\n component?: FC<{\n index: number\n label: string\n value: number | string\n onRemove: MouseEventHandler<HTMLElement>\n }>\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: string\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: string\n /**\n * The footer of the autocomplete content element.\n */\n footer?: FC<{ value: string[] | undefined; onClose: () => void }> | ReactNode\n /**\n * The header of the autocomplete content element.\n */\n header?: FC<{ value: string[] | undefined; onClose: () => void }> | ReactNode\n /**\n * If `true`, display the select clear icon.\n *\n * @default true\n *\n * @deprecated Use `clearable` instead.\n */\n isClearable?: boolean\n /**\n * If `true`, keep the placeholder.\n *\n * @default false\n */\n keepPlaceholder?: boolean\n /**\n * The visual separator between each value.\n *\n * @default ','\n */\n separator?: string\n /**\n * Props for multi autocomplete clear icon element.\n */\n clearIconProps?: AutocompleteIconProps\n /**\n * Props for multi autocomplete container element.\n */\n containerProps?: Omit<HTMLUIProps, \"children\">\n /**\n * Props for multi autocomplete content element.\n */\n contentProps?: Omit<MotionProps, \"children\">\n /**\n * Props for autocomplete create element.\n */\n createProps?: Omit<AutocompleteCreateProps, \"children\">\n /**\n * Props for autocomplete empty element.\n */\n emptyProps?: Omit<AutocompleteEmptyProps, \"children\">\n /**\n * Props for multi autocomplete field element.\n */\n fieldProps?: Omit<\n MultiAutocompleteFieldProps,\n \"children\" | \"component\" | \"inputProps\" | \"keepPlaceholder\" | \"separator\"\n >\n /**\n * Props for multi autocomplete icon element.\n */\n iconProps?: AutocompleteIconProps\n /**\n * Props for multi autocomplete input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for multi autocomplete list element.\n */\n listProps?: Omit<AutocompleteListProps, \"children\">\n /**\n * Props to be forwarded to the portal component.\n *\n * @default '{ isDisabled: true }'\n *\n */\n portalProps?: Omit<PortalProps, \"children\">\n}\n\nexport interface MultiAutocompleteProps\n extends ThemeProps<\"MultiAutocomplete\">,\n Omit<UseAutocompleteProps<string[]>, \"closeOnSelect\">,\n MultiAutocompleteOptions {}\n\n/**\n * `MultiAutocomplete` is a component used to display suggestions based on user text input and to obtain multiple values.\n *\n * @see Docs https://yamada-ui.com/components/forms/multi-autocomplete\n */\nexport const MultiAutocomplete = forwardRef<MultiAutocompleteProps, \"input\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\n \"MultiAutocomplete\",\n props,\n )\n let {\n className,\n clearable,\n closeOnSelect = false,\n color,\n component,\n defaultValue = [],\n footer,\n h,\n header,\n height,\n isClearable = true,\n keepPlaceholder = false,\n minH,\n minHeight,\n separator,\n clearIconProps,\n containerProps,\n contentProps,\n createProps,\n emptyProps,\n fieldProps,\n iconProps,\n inputProps,\n listProps,\n portalProps = { isDisabled: true },\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n const {\n allowCreate,\n children,\n descendants,\n inputValue,\n isEmpty,\n value,\n formControlProps,\n getContainerProps,\n getFieldProps,\n getPopoverProps,\n onClear,\n onClose,\n ...rest\n } = useAutocomplete<string[]>({\n ...computedProps,\n closeOnSelect,\n defaultValue,\n })\n\n h ??= height\n minH ??= minHeight\n clearable ??= isClearable\n\n const css: CSSUIObject = {\n color,\n h: \"fit-content\",\n w: \"100%\",\n ...styles.container,\n }\n\n return (\n <AutocompleteDescendantsContextProvider value={descendants}>\n <AutocompleteProvider\n value={{\n ...rest,\n allowCreate,\n inputValue,\n isEmpty,\n styles,\n value,\n formControlProps,\n onClose,\n }}\n >\n <Popover {...getPopoverProps()}>\n <ui.div\n className={cx(\"ui-multi-autocomplete\", className)}\n __css={css}\n {...getContainerProps(containerProps)}\n >\n <ui.div\n className=\"ui-multi-autocomplete__inner\"\n __css={{ position: \"relative\", ...styles.inner }}\n >\n <MultiAutocompleteField\n component={component}\n h={h}\n keepPlaceholder={keepPlaceholder}\n minH={minH}\n separator={separator}\n inputProps={inputProps}\n {...getFieldProps(fieldProps, ref)}\n />\n\n {clearable && value.length ? (\n <AutocompleteClearIcon\n {...clearIconProps}\n onClick={handlerAll(clearIconProps?.onClick, onClear)}\n {...formControlProps}\n />\n ) : (\n <AutocompleteIcon {...iconProps} {...formControlProps} />\n )}\n </ui.div>\n\n <Portal {...portalProps}>\n <AutocompleteList\n footer={runIfFunc(footer, { value, onClose })}\n header={runIfFunc(header, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {!isEmpty ? (\n <>\n {allowCreate ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n\n {children}\n </>\n ) : allowCreate && inputValue ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n </AutocompleteList>\n </Portal>\n </ui.div>\n </Popover>\n </AutocompleteProvider>\n </AutocompleteDescendantsContextProvider>\n )\n },\n)\n\nMultiAutocomplete.displayName = \"MultiAutocomplete\"\nMultiAutocomplete.__ui__ = \"MultiAutocomplete\"\n\ninterface MultiAutocompleteFieldProps\n extends HTMLUIProps,\n Pick<\n MultiAutocompleteProps,\n \"component\" | \"inputProps\" | \"keepPlaceholder\" | \"separator\"\n > {}\n\nconst MultiAutocompleteField = forwardRef<MultiAutocompleteFieldProps, \"input\">(\n (\n {\n className,\n component,\n h,\n keepPlaceholder,\n minH,\n placeholder,\n separator = \",\",\n inputProps,\n ...rest\n },\n ref,\n ) => {\n const { inputRef, inputValue, isOpen, label, styles, value, onChange } =\n useAutocompleteContext()\n const { getInputProps } = useAutocompleteInput()\n\n const cloneChildren = useMemo(() => {\n if (!label?.length) return null\n\n if (component) {\n return (label as string[]).map((label, index) => {\n if (!value[index]) return null\n\n const onRemove: MouseEventHandler<HTMLElement> = (ev) => {\n if (!value[index]) return\n\n ev.stopPropagation()\n\n onChange(value[index])\n\n if (inputRef.current) inputRef.current.focus()\n }\n\n const el = component({\n index,\n label,\n value: value[index],\n onRemove,\n })\n\n const style: CSSProperties = {\n marginBlockEnd: \"0.125rem\",\n marginBlockStart: \"0.125rem\",\n marginInlineEnd: \"0.25rem\",\n }\n\n return el\n ? cloneElement(el as ReactElement, { key: index, style })\n : null\n })\n } else {\n return (label as string[]).map((value, index) => {\n const isLast = label.length === index + 1\n\n return (\n <ui.span key={index} display=\"inline-block\" me=\"0.25rem\">\n {value}\n {!isLast || isOpen ? separator : null}\n </ui.span>\n )\n })\n }\n }, [label, component, value, onChange, isOpen, inputRef, separator])\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flexWrap: \"wrap\",\n h,\n minH,\n pe: \"2rem\",\n ...styles.field,\n cursor: \"text\",\n }\n\n if (label?.length && component) css.py = \"0.125rem\"\n\n return (\n <PopoverTrigger>\n <ui.div\n className={cx(\"ui-multi-autocomplete__field\", className)}\n __css={css}\n {...rest}\n >\n {cloneChildren}\n\n <ui.input\n className=\"ui-multi-autocomplete__field__input\"\n display=\"inline-block\"\n flex=\"1\"\n marginBlockEnd=\"0.125rem\"\n marginBlockStart=\"0.125rem\"\n minW=\"0px\"\n overflow=\"hidden\"\n placeholder={\n !label?.length || (keepPlaceholder && isOpen)\n ? placeholder\n : undefined\n }\n {...getInputProps({ ...inputProps, value: inputValue }, ref)}\n />\n </ui.div>\n </PopoverTrigger>\n )\n },\n)\n\nMultiAutocompleteField.displayName = \"MultiAutocompleteField\"\nMultiAutocompleteField.__ui__ = \"MultiAutocompleteField\"\n"],"m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d;AAAA,QAEJ,CAAC;AAAA,MACH;AAAA,IACF,GAAG,CAAC,OAAO,WAAW,OAAO,UAAU,QAAQ,UAAU,SAAS,CAAC;AAEnE,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,IAAI;AAAA,MACJ,GAAG,OAAO;AAAA,MACV,QAAQ;AAAA,IACV;AAEA,SAAI,+BAAO,WAAU,UAAW,KAAI,KAAK;AAEzC,WACE,oBAAC,kBACC;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC,WAAW,GAAG,gCAAgC,SAAS;AAAA,QACvD,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA;AAAA,UAED;AAAA,YAAC,GAAG;AAAA,YAAH;AAAA,cACC,WAAU;AAAA,cACV,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,gBAAe;AAAA,cACf,kBAAiB;AAAA,cACjB,MAAK;AAAA,cACL,UAAS;AAAA,cACT,aACE,EAAC,+BAAO,WAAW,mBAAmB,SAClC,cACA;AAAA,cAEL,GAAG,cAAc,EAAE,GAAG,YAAY,OAAO,WAAW,GAAG,GAAG;AAAA;AAAA,UAC7D;AAAA;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;AAEA,uBAAuB,cAAc;AACrC,uBAAuB,SAAS;","names":["label","value"]}
|
@@ -1,15 +1,15 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useAutocompleteList
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-4GVV3HBE.mjs";
|
5
5
|
import {
|
6
6
|
useAutocompleteContext
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-TP5VZFO3.mjs";
|
8
8
|
|
9
9
|
// src/autocomplete-list.tsx
|
10
10
|
import { forwardRef, ui } from "@yamada-ui/core";
|
11
11
|
import { PopoverContent } from "@yamada-ui/popover";
|
12
|
-
import { cx
|
12
|
+
import { cx } from "@yamada-ui/utils";
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
14
14
|
var AutocompleteList = forwardRef(
|
15
15
|
({
|
@@ -28,7 +28,7 @@ var AutocompleteList = forwardRef(
|
|
28
28
|
}, ref) => {
|
29
29
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
30
30
|
const { styles } = useAutocompleteContext();
|
31
|
-
const {
|
31
|
+
const { getContainerProps, getListProps } = useAutocompleteList();
|
32
32
|
width != null ? width : width = w;
|
33
33
|
width != null ? width : width = (_c = (_a = styles.list) == null ? void 0 : _a.width) != null ? _c : (_b = styles.list) == null ? void 0 : _b.w;
|
34
34
|
minWidth != null ? minWidth : minWidth = minW;
|
@@ -38,16 +38,13 @@ var AutocompleteList = forwardRef(
|
|
38
38
|
return /* @__PURE__ */ jsxs(
|
39
39
|
PopoverContent,
|
40
40
|
{
|
41
|
+
as: "div",
|
41
42
|
className: "ui-autocomplete__popover",
|
42
43
|
maxWidth,
|
43
44
|
minWidth,
|
44
45
|
width,
|
45
46
|
__css: { ...styles.content, maxWidth, minWidth, width },
|
46
|
-
...contentProps,
|
47
|
-
onAnimationComplete: handlerAll(
|
48
|
-
contentProps == null ? void 0 : contentProps.onAnimationComplete,
|
49
|
-
onAnimationComplete
|
50
|
-
),
|
47
|
+
...getContainerProps(contentProps),
|
51
48
|
children: [
|
52
49
|
header ? /* @__PURE__ */ jsx(
|
53
50
|
ui.header,
|
@@ -85,4 +82,4 @@ AutocompleteList.__ui__ = "AutocompleteList";
|
|
85
82
|
export {
|
86
83
|
AutocompleteList
|
87
84
|
};
|
88
|
-
//# sourceMappingURL=chunk-
|
85
|
+
//# sourceMappingURL=chunk-LIBFONYN.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/autocomplete-list.tsx"],"sourcesContent":["import type { CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { MotionPropsWithoutChildren } from \"@yamada-ui/motion\"\nimport type { ReactNode } from \"react\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { PopoverContent } from \"@yamada-ui/popover\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { useAutocompleteList } from \"./use-autocomplete-list\"\n\nexport interface AutocompleteListProps extends HTMLUIProps {\n footer?: ReactNode\n header?: ReactNode\n contentProps?: MotionPropsWithoutChildren\n}\n\nexport const AutocompleteList = forwardRef<AutocompleteListProps, \"div\">(\n (\n {\n className,\n children,\n footer,\n header,\n maxW,\n maxWidth,\n minW,\n minWidth,\n w,\n width,\n contentProps,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useAutocompleteContext()\n const { getContainerProps, getListProps } = useAutocompleteList()\n\n width ??= w\n width ??= (styles.list?.width ?? styles.list?.w) as CSSUIProps[\"width\"]\n minWidth ??= minW\n minWidth ??= (styles.list?.minWidth ??\n styles.list?.minW) as CSSUIProps[\"minWidth\"]\n maxWidth ??= maxW\n maxWidth ??= (styles.list?.maxWidth ??\n styles.list?.maxW) as CSSUIProps[\"maxWidth\"]\n\n return (\n <PopoverContent\n as=\"div\"\n className=\"ui-autocomplete__popover\"\n maxWidth={maxWidth}\n minWidth={minWidth}\n width={width}\n __css={{ ...styles.content, maxWidth, minWidth, width }}\n {...getContainerProps(contentProps)}\n >\n {header ? (\n <ui.header\n className=\"ui-autocomplete__header\"\n __css={{ ...styles.header }}\n >\n {header}\n </ui.header>\n ) : null}\n\n <ui.div\n className={cx(\"ui-autocomplete__list\", className)}\n __css={{ ...styles.list }}\n {...getListProps(rest, ref)}\n >\n {children}\n </ui.div>\n\n {footer ? (\n <ui.footer\n className=\"ui-autocomplete__footer\"\n __css={{ ...styles.footer }}\n >\n {footer}\n </ui.footer>\n ) : null}\n </PopoverContent>\n )\n },\n)\n\nAutocompleteList.displayName = \"AutocompleteList\"\nAutocompleteList.__ui__ = \"AutocompleteList\"\n"],"mappings":";;;;;;;;;AAGA,SAAS,YAAY,UAAU;AAC/B,S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ACH,IACE;AAAA;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,iBAAiB,cAAc;AAC/B,iBAAiB,SAAS;","names":[]}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useAutocompleteOption
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-2LP57WVB.mjs";
|
5
5
|
import {
|
6
6
|
AutocompleteItemIcon
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-7QCZ5NGS.mjs";
|
8
8
|
import {
|
9
9
|
useAutocompleteContext
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-TP5VZFO3.mjs";
|
11
11
|
|
12
12
|
// src/autocomplete-option.tsx
|
13
13
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -60,4 +60,4 @@ AutocompleteCheckIcon.__ui__ = "AutocompleteCheckIcon";
|
|
60
60
|
export {
|
61
61
|
AutocompleteOption
|
62
62
|
};
|
63
|
-
//# sourceMappingURL=chunk-
|
63
|
+
//# sourceMappingURL=chunk-PWV7X7G6.mjs.map
|
@@ -1,13 +1,13 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useAutocompleteCreate
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-2LP57WVB.mjs";
|
5
5
|
import {
|
6
6
|
AutocompleteItemIcon
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-7QCZ5NGS.mjs";
|
8
8
|
import {
|
9
9
|
useAutocompleteContext
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-TP5VZFO3.mjs";
|
11
11
|
|
12
12
|
// src/autocomplete-create.tsx
|
13
13
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -60,4 +60,4 @@ AutocompletePlusIcon.__ui__ = "AutocompletePlusIcon";
|
|
60
60
|
export {
|
61
61
|
AutocompleteCreate
|
62
62
|
};
|
63
|
-
//# sourceMappingURL=chunk-
|
63
|
+
//# sourceMappingURL=chunk-RK5E5J5E.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/autocomplete-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dispatch, DOMAttributes, RefObject, SetStateAction } from \"react\"\nimport type { UseAutocompleteProps } from \"./use-autocomplete\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { createContext } from \"@yamada-ui/utils\"\n\nexport const {\n DescendantsContextProvider: AutocompleteDescendantsContextProvider,\n useDescendant: useAutocompleteDescendant,\n useDescendants: useAutocompleteDescendants,\n useDescendantsContext: useAutocompleteDescendantsContext,\n} = createDescendant()\n\ninterface AutocompleteContext\n extends Omit<\n UseAutocompleteProps,\n \"defaultValue\" | \"onChange\" | \"onCreate\" | \"value\"\n > {\n focusedIndex: number\n inputRef: RefObject<HTMLInputElement>\n inputValue: string\n isAllSelected: boolean\n isEmpty: boolean\n isHit: boolean\n isOpen: boolean\n label: string | string[] | undefined\n pickOptions: (value: string) => void\n rebirthOptions: (runFocus?: boolean) => void\n setFocusedIndex: Dispatch<SetStateAction<number>>\n styles: { [key: string]: CSSUIObject | undefined }\n value: string | string[]\n formControlProps: { [key: string]: any }\n inputProps: DOMAttributes<HTMLInputElement>\n onChange: (newValue: string, runRebirth?: boolean) => void\n onClose: () => void\n onCreate: () => void\n onFocusFirst: () => void\n onFocusLast: () => void\n onFocusNext: (index?: number) => void\n onFocusPrev: (index?: number) => void\n onOpen: () => void\n}\n\nexport const [AutocompleteProvider, useAutocompleteContext] =\n createContext<AutocompleteContext>({\n name: \"AutocompleteContext\",\n errorMessage: `useAutocompleteContext returned is 'undefined'. Seems you forgot to wrap the components in \"<Autocomplete />\" or \"<MultiAutocomplete />\"`,\n })\n"],"mappings":";;;AAGA,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAEvB,IAAM;AAAA,EACX,4BAA4B;AAAA,EAC5B,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,uBAAuB;AACzB,IAAI,iBAAiB;AAgCd,IAAM,CAAC,sBAAsB,sBAAsB,IACxD,cAAmC;AAAA,EACjC,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;","names":[]}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import {
|
3
3
|
useAutocompleteContext,
|
4
4
|
useAutocompleteDescendantsContext
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-TP5VZFO3.mjs";
|
6
6
|
|
7
7
|
// src/use-autocomplete-option-group.ts
|
8
8
|
import { layoutStyleProperties } from "@yamada-ui/core";
|
@@ -89,4 +89,4 @@ var useAutocompleteOptionGroup = ({
|
|
89
89
|
export {
|
90
90
|
useAutocompleteOptionGroup
|
91
91
|
};
|
92
|
-
//# sourceMappingURL=chunk-
|
92
|
+
//# sourceMappingURL=chunk-UX5QECNB.mjs.map
|
@@ -1,13 +1,13 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useAutocompleteEmpty
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-2LP57WVB.mjs";
|
5
5
|
import {
|
6
6
|
AutocompleteItemIcon
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-7QCZ5NGS.mjs";
|
8
8
|
import {
|
9
9
|
useAutocompleteContext
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-TP5VZFO3.mjs";
|
11
11
|
|
12
12
|
// src/autocomplete-empty.tsx
|
13
13
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -61,4 +61,4 @@ AutocompleteMinusIcon.__ui__ = "AutocompleteMinusIcon";
|
|
61
61
|
export {
|
62
62
|
AutocompleteEmpty
|
63
63
|
};
|
64
|
-
//# sourceMappingURL=chunk-
|
64
|
+
//# sourceMappingURL=chunk-YPKDYYEV.mjs.map
|