@yamada-ui/autocomplete 1.5.4-dev-20240929142808 → 1.5.4-dev-20241001120721
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/autocomplete-create.js +4 -4
- package/dist/autocomplete-create.js.map +1 -1
- package/dist/autocomplete-create.mjs +1 -1
- package/dist/autocomplete-empty.js +4 -4
- package/dist/autocomplete-empty.js.map +1 -1
- package/dist/autocomplete-empty.mjs +1 -1
- package/dist/autocomplete-option.js +4 -4
- package/dist/autocomplete-option.js.map +1 -1
- package/dist/autocomplete-option.mjs +1 -1
- package/dist/autocomplete.js +12 -12
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.mjs +5 -5
- package/dist/{chunk-CCOWDDFS.mjs → chunk-5GKGL6BL.mjs} +5 -5
- package/dist/chunk-5GKGL6BL.mjs.map +1 -0
- package/dist/{chunk-UNGOVJSY.mjs → chunk-HZECQUHV.mjs} +4 -4
- package/dist/{chunk-PCQMCEHL.mjs → chunk-OLOU5HFC.mjs} +2 -2
- package/dist/{chunk-E3Y2E2TK.mjs → chunk-Q2HZVVOI.mjs} +5 -5
- package/dist/chunk-Q2HZVVOI.mjs.map +1 -0
- package/dist/{chunk-7OWUOQZD.mjs → chunk-QPIWG4ZF.mjs} +4 -4
- package/dist/{chunk-2WVIW6HR.mjs → chunk-S2HFYJVI.mjs} +5 -5
- package/dist/chunk-S2HFYJVI.mjs.map +1 -0
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/multi-autocomplete.js +12 -12
- package/dist/multi-autocomplete.js.map +1 -1
- package/dist/multi-autocomplete.mjs +5 -5
- package/dist/use-autocomplete.js +4 -4
- package/dist/use-autocomplete.js.map +1 -1
- package/dist/use-autocomplete.mjs +2 -2
- package/package.json +3 -3
- package/dist/chunk-2WVIW6HR.mjs.map +0 -1
- package/dist/chunk-CCOWDDFS.mjs.map +0 -1
- package/dist/chunk-E3Y2E2TK.mjs.map +0 -1
- /package/dist/{chunk-UNGOVJSY.mjs.map → chunk-HZECQUHV.mjs.map} +0 -0
- /package/dist/{chunk-PCQMCEHL.mjs.map → chunk-OLOU5HFC.mjs.map} +0 -0
- /package/dist/{chunk-7OWUOQZD.mjs.map → chunk-QPIWG4ZF.mjs.map} +0 -0
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/autocomplete.tsx","../src/autocomplete-context.ts","../src/autocomplete-create.tsx","../src/autocomplete-icon.tsx","../src/use-autocomplete-option.ts","../src/autocomplete-empty.tsx","../src/autocomplete-list.tsx","../src/use-autocomplete-list.ts","../src/use-autocomplete.tsx","../src/autocomplete-option.tsx","../src/autocomplete-option-group.tsx","../src/use-autocomplete-option-group.ts","../src/multi-autocomplete.tsx"],"sourcesContent":["export { Autocomplete } from \"./autocomplete\"\nexport type { AutocompleteProps } from \"./autocomplete\"\nexport { AutocompleteOptionGroup } from \"./autocomplete-option-group\"\nexport type { AutocompleteOptionGroupProps } from \"./autocomplete-option-group\"\nexport { AutocompleteOption } from \"./autocomplete-option\"\nexport type { AutocompleteOptionProps } from \"./autocomplete-option\"\nexport { AutocompleteCreate } from \"./autocomplete-create\"\nexport type { AutocompleteCreateProps } from \"./autocomplete-create\"\nexport { AutocompleteEmpty } from \"./autocomplete-empty\"\nexport type { AutocompleteEmptyProps } from \"./autocomplete-empty\"\nexport { MultiAutocomplete } from \"./multi-autocomplete\"\nexport type { MultiAutocompleteProps } from \"./multi-autocomplete\"\nexport type { AutocompleteItem } from \"./use-autocomplete\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { Popover, PopoverTrigger } from \"@yamada-ui/popover\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport type { FC, ReactNode } from \"react\"\nimport {\n AutocompleteDescendantsContextProvider,\n AutocompleteProvider,\n useAutocompleteContext,\n} from \"./autocomplete-context\"\nimport { AutocompleteCreate } from \"./autocomplete-create\"\nimport type { AutocompleteCreateProps } from \"./autocomplete-create\"\nimport { AutocompleteEmpty } from \"./autocomplete-empty\"\nimport type { AutocompleteEmptyProps } from \"./autocomplete-empty\"\nimport type { AutocompleteIconProps } from \"./autocomplete-icon\"\nimport { AutocompleteIcon } from \"./autocomplete-icon\"\nimport type { AutocompleteListProps } from \"./autocomplete-list\"\nimport { AutocompleteList } from \"./autocomplete-list\"\nimport type { UseAutocompleteProps } from \"./use-autocomplete\"\nimport { useAutocomplete, useAutocompleteInput } from \"./use-autocomplete\"\n\ninterface AutocompleteOptions {\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: string\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: string\n /**\n * Props for autocomplete container element.\n */\n containerProps?: Omit<HTMLUIProps, \"children\">\n /**\n * Props for autocomplete content element.\n */\n contentProps?: Omit<MotionProps, \"children\">\n /**\n * Props for autocomplete list element.\n */\n listProps?: Omit<AutocompleteListProps, \"children\">\n /**\n * Props for autocomplete field element.\n */\n fieldProps?: Omit<AutocompleteFieldProps, \"inputProps\" | \"children\">\n /**\n * Props for autocomplete input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for autocomplete icon element.\n */\n iconProps?: AutocompleteIconProps\n /**\n * Props to be forwarded to the portal component.\n *\n * @default '{ isDisabled: true }'\n */\n portalProps?: Omit<PortalProps, \"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 * The header of the autocomplete content element.\n */\n header?: ReactNode | FC<{ value: string | undefined; onClose: () => void }>\n /**\n * The footer of the autocomplete content element.\n */\n footer?: ReactNode | FC<{ value: string | undefined; onClose: () => void }>\n}\n\nexport interface AutocompleteProps\n extends ThemeProps<\"Autocomplete\">,\n Omit<UseAutocompleteProps, \"maxSelectValues\" | \"omitSelectedValues\">,\n AutocompleteOptions {}\n\n/**\n * `Autocomplete` is a component used to display suggestions in response to user text input.\n *\n * @see Docs https://yamada-ui.com/components/forms/autocomplete\n */\nexport const Autocomplete = forwardRef<AutocompleteProps, \"input\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Autocomplete\", props)\n let {\n className,\n defaultValue = \"\",\n color,\n h,\n height,\n minH,\n minHeight,\n containerProps,\n contentProps,\n listProps,\n fieldProps,\n inputProps,\n iconProps,\n portalProps = { isDisabled: true },\n createProps,\n emptyProps,\n header,\n footer,\n children,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n const {\n value,\n onClose,\n descendants,\n formControlProps,\n getPopoverProps,\n getContainerProps,\n getFieldProps,\n allowCreate,\n isEmpty,\n inputValue,\n computedChildren,\n ...rest\n } = useAutocomplete({ ...computedProps, defaultValue, children })\n\n h ??= height\n minH ??= minHeight\n\n const css: CSSUIObject = {\n w: \"100%\",\n h: \"fit-content\",\n color,\n ...styles.container,\n }\n\n return (\n <AutocompleteDescendantsContextProvider value={descendants}>\n <AutocompleteProvider\n value={{\n ...rest,\n value,\n onClose,\n formControlProps,\n inputValue,\n allowCreate,\n isEmpty,\n styles,\n }}\n >\n <Popover {...getPopoverProps()}>\n <ui.div\n className={cx(\"ui-autocomplete\", className)}\n __css={css}\n {...getContainerProps(containerProps)}\n >\n <ui.div\n className=\"ui-autocomplete__inner\"\n __css={{ position: \"relative\", ...styles.inner }}\n >\n <AutocompleteField\n h={h}\n minH={minH}\n inputProps={inputProps}\n {...getFieldProps(fieldProps, ref)}\n />\n\n <AutocompleteIcon {...iconProps} {...formControlProps} />\n </ui.div>\n\n {!isEmpty ? (\n <Portal {...portalProps}>\n <AutocompleteList\n header={runIfFunc(header, { value, onClose })}\n footer={runIfFunc(footer, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {allowCreate ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n\n {children ?? computedChildren}\n </AutocompleteList>\n </Portal>\n ) : (\n <Portal {...portalProps}>\n <AutocompleteList\n header={runIfFunc(header, { value, onClose })}\n footer={runIfFunc(footer, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {allowCreate && inputValue ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n </AutocompleteList>\n </Portal>\n )}\n </ui.div>\n </Popover>\n </AutocompleteProvider>\n </AutocompleteDescendantsContextProvider>\n )\n },\n)\n\nAutocomplete.displayName = \"Autocomplete\"\nAutocomplete.__ui__ = \"Autocomplete\"\n\ninterface AutocompleteFieldProps\n extends HTMLUIProps,\n Pick<AutocompleteProps, \"inputProps\"> {}\n\nconst AutocompleteField = forwardRef<AutocompleteFieldProps, \"input\">(\n ({ className, h, minH, placeholder, inputProps, ...rest }, ref) => {\n const { label, inputValue, styles } = useAutocompleteContext()\n const { getInputProps } = useAutocompleteInput()\n\n const css: CSSUIObject = {\n pe: \"2rem\",\n h,\n minH,\n display: \"flex\",\n alignItems: \"center\",\n ...styles.field,\n cursor: \"text\",\n }\n\n return (\n <PopoverTrigger>\n <ui.div\n className={cx(\"ui-autocomplete__field\", className)}\n __css={css}\n {...rest}\n >\n <ui.input\n className=\"ui-autocomplete__field__input\"\n display=\"inline-block\"\n w=\"100%\"\n placeholder={placeholder}\n {...getInputProps(\n { ...inputProps, value: inputValue || label || \"\" },\n ref,\n )}\n />\n </ui.div>\n </PopoverTrigger>\n )\n },\n)\n\nAutocompleteField.displayName = \"AutocompleteField\"\nAutocompleteField.__ui__ = \"AutocompleteField\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { Dispatch, DOMAttributes, RefObject, SetStateAction } from \"react\"\nimport type { ChangeOptions, UseAutocompleteProps } from \"./use-autocomplete\"\n\nexport const {\n DescendantsContextProvider: AutocompleteDescendantsContextProvider,\n useDescendantsContext: useAutocompleteDescendantsContext,\n useDescendants: useAutocompleteDescendants,\n useDescendant: useAutocompleteDescendant,\n} = createDescendant()\n\ninterface AutocompleteContext\n extends Omit<\n UseAutocompleteProps,\n \"value\" | \"defaultValue\" | \"onChange\" | \"onCreate\"\n > {\n value: string | string[]\n label: string | string[] | undefined\n inputValue: string\n isHit: boolean\n isEmpty: boolean\n isAllSelected: boolean\n onChange: (newValue: string, options?: ChangeOptions) => void\n onChangeLabel: (newValue: string, options?: ChangeOptions) => void\n pickOptions: (value: string) => void\n rebirthOptions: (runFocus?: boolean) => void\n inputProps: DOMAttributes<HTMLInputElement>\n isOpen: boolean\n onOpen: () => void\n onClose: () => void\n onCreate: () => void\n onFocusFirst: () => void\n onFocusLast: () => void\n onFocusNext: (index?: number) => void\n onFocusPrev: (index?: number) => void\n focusedIndex: number\n setFocusedIndex: Dispatch<SetStateAction<number>>\n listRef: RefObject<HTMLUListElement>\n inputRef: RefObject<HTMLInputElement>\n formControlProps: { [key: string]: any }\n styles: { [key: string]: CSSUIObject }\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","import type { CSSUIObject, FC, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport type { ReactElement } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { AutocompleteItemIcon } from \"./autocomplete-icon\"\nimport { useAutocompleteCreate } from \"./use-autocomplete-option\"\n\ninterface AutocompleteCreateOptions {\n /**\n * The autocomplete create option icon to use.\n */\n icon?: ReactElement\n /**\n * The label of the autocomplete create option.\n */\n children?: string | ((inputValue: string) => string)\n}\n\nexport interface AutocompleteCreateProps\n extends Omit<HTMLUIProps<\"li\">, \"children\">,\n AutocompleteCreateOptions {}\n\nexport const AutocompleteCreate = forwardRef<AutocompleteCreateProps, \"li\">(\n ({ className, icon, children, ...rest }, ref) => {\n const { inputValue, styles } = useAutocompleteContext()\n const { getCreateProps } = useAutocompleteCreate()\n\n children ??= inputValue\n\n const css: CSSUIObject = {\n textDecoration: \"none\",\n color: \"inherit\",\n userSelect: \"none\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n textAlign: \"start\",\n flex: \"0 0 auto\",\n outline: 0,\n gap: \"0.75rem\",\n ...styles.item,\n }\n\n return (\n <ui.li\n className={cx(\"ui-autocomplete__item--create\", className)}\n __css={css}\n {...getCreateProps(rest, ref)}\n >\n {icon !== null ? (\n <AutocompleteItemIcon>{icon || <PlusIcon />}</AutocompleteItemIcon>\n ) : null}\n {icon ? (\n <ui.span style={{ pointerEvents: \"none\", flex: 1 }} lineClamp={1}>\n {runIfFunc(children, inputValue)}\n </ui.span>\n ) : (\n runIfFunc(children, inputValue)\n )}\n </ui.li>\n )\n },\n)\n\nAutocompleteCreate.displayName = \"AutocompleteCreate\"\nAutocompleteCreate.__ui__ = \"AutocompleteCreate\"\n\nconst PlusIcon: FC = () => (\n <svg viewBox=\"0 0 45.402 45.402\" width=\"1em\" height=\"1em\">\n <path\n fill=\"currentColor\"\n d=\"M41.267,18.557H26.832V4.134C26.832,1.851,24.99,0,22.707,0c-2.283,0-4.124,1.851-4.124,4.135v14.432H4.141 c-2.283,0-4.139,1.851-4.138,4.135c-0.001,1.141,0.46,2.187,1.207,2.934c0.748,0.749,1.78,1.222,2.92,1.222h14.453V41.27 c0,1.142,0.453,2.176,1.201,2.922c0.748,0.748,1.777,1.211,2.919,1.211c2.282,0,4.129-1.851,4.129-4.133V26.857h14.435 c2.283,0,4.134-1.867,4.133-4.15C45.399,20.425,43.548,18.557,41.267,18.557z\"\n />\n </svg>\n)\n\nPlusIcon.displayName = \"PlusIcon\"\nPlusIcon.__ui__ = \"PlusIcon\"\n","import type { CSSUIObject, FC, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { ChevronIcon, CloseIcon } from \"@yamada-ui/icon\"\nimport { useClickable } from \"@yamada-ui/use-clickable\"\nimport { cx, getValidChildren, isValidElement } from \"@yamada-ui/utils\"\nimport type { HTMLAttributes } from \"react\"\nimport { cloneElement, useRef } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\n\nexport interface AutocompleteIconProps extends HTMLUIProps {}\n\nexport const AutocompleteIcon = forwardRef<AutocompleteIconProps, \"div\">(\n ({ className, children, __css, ...rest }, ref) => {\n const { styles } = useAutocompleteContext()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n pointerEvents: \"none\",\n cursor: \"pointer\",\n ...styles.icon,\n ...__css,\n }\n\n const validChildren = getValidChildren(children)\n\n const cloneChildren = validChildren.map((child) =>\n cloneElement(child, {\n focusable: false,\n \"aria-hidden\": true,\n style: {\n maxWidth: \"1em\",\n maxHeight: \"1em\",\n color: \"currentColor\",\n },\n }),\n )\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-autocomplete__icon\", className)}\n __css={css}\n {...rest}\n >\n {isValidElement(children) ? cloneChildren : <ChevronIcon />}\n </ui.div>\n )\n },\n)\n\nAutocompleteIcon.displayName = \"AutocompleteIcon\"\nAutocompleteIcon.__ui__ = \"AutocompleteIcon\"\n\nexport interface AutocompleteClearIconProps extends AutocompleteIconProps {\n disabled?: boolean\n}\n\nexport const AutocompleteClearIcon: FC<AutocompleteClearIconProps> = ({\n className,\n children,\n ...props\n}) => {\n const ref = useRef<HTMLDivElement>(null)\n const { styles } = useAutocompleteContext()\n\n const isDisabled = props.disabled\n\n const rest = useClickable({\n ref,\n isDisabled,\n ...(props as HTMLAttributes<HTMLElement>),\n })\n\n return (\n <AutocompleteIcon\n aria-label=\"Clear value\"\n className={cx(\"ui-autocomplete__icon--clear\", className)}\n __css={styles.clearIcon}\n {...rest}\n >\n {children ?? <CloseIcon w=\"0.5em\" h=\"0.5em\" />}\n </AutocompleteIcon>\n )\n}\n\nAutocompleteClearIcon.displayName = \"AutocompleteClearIcon\"\nAutocompleteClearIcon.__ui__ = \"AutocompleteClearIcon\"\n\nexport interface AutocompleteItemIconProps extends HTMLUIProps<\"span\"> {}\n\nexport const AutocompleteItemIcon = forwardRef<\n AutocompleteItemIconProps,\n \"span\"\n>(({ className, ...rest }, ref) => {\n const { styles } = useAutocompleteContext()\n\n const css: CSSUIObject = {\n flexShrink: 0,\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.85em\",\n ...styles.itemIcon,\n }\n\n return (\n <ui.span\n ref={ref}\n className={cx(\"ui-autocomplete__item__icon\", className)}\n __css={css}\n {...rest}\n />\n )\n})\n\nAutocompleteItemIcon.displayName = \"AutocompleteItemIcon\"\nAutocompleteItemIcon.__ui__ = \"AutocompleteItemIcon\"\n","import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport {\n ariaAttr,\n dataAttr,\n handlerAll,\n isArray,\n isHTMLElement,\n mergeRefs,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport type { CSSProperties, MouseEvent } from \"react\"\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<\"li\">, \"value\" | \"children\"> {\n /**\n * The value of the autocomplete option.\n */\n value?: string\n /**\n * The label of the autocomplete option.\n */\n children?: string\n /**\n * If `true`, the autocomplete option will be disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, the autocomplete option will be focusable.\n *\n * @default false\n */\n isFocusable?: boolean\n /**\n * If `true`, the list element will be closed when selected.\n *\n * @default false\n */\n closeOnSelect?: boolean\n}\n\nexport const useAutocompleteOption = (props: UseAutocompleteOptionProps) => {\n const {\n value,\n omitSelectedValues,\n onChange,\n onChangeLabel,\n focusedIndex,\n setFocusedIndex,\n onClose,\n closeOnSelect: generalCloseOnSelect,\n optionProps,\n inputRef,\n onFocusNext,\n } = useAutocompleteContext()\n const id = useId()\n\n let {\n icon: customIcon,\n isDisabled,\n isFocusable,\n closeOnSelect: customCloseOnSelect,\n children,\n value: optionValue,\n ...computedProps\n } = { ...optionProps, ...props }\n\n const trulyDisabled = !!isDisabled && !isFocusable\n\n const itemRef = useRef<HTMLLIElement>(null)\n\n const { index, register, descendants } = useAutocompleteDescendant({\n disabled: trulyDisabled,\n })\n\n const values = descendants.values()\n const frontValues = values.slice(0, index)\n\n const isMulti = isArray(value)\n const isDuplicated = !isMulti\n ? frontValues.some(({ node }) => node.dataset.value === (optionValue ?? \"\"))\n : false\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 const onClick = useCallback(\n (ev: MouseEvent<HTMLLIElement>) => {\n ev.stopPropagation()\n\n if (isDisabled) {\n if (inputRef.current) inputRef.current.focus()\n\n return\n }\n\n if (!isTargetOption(ev.currentTarget)) {\n if (inputRef.current) inputRef.current.focus()\n\n return\n }\n\n setFocusedIndex(index)\n\n onChange(optionValue ?? \"\")\n\n if (inputRef.current) inputRef.current.focus()\n\n if (customCloseOnSelect ?? generalCloseOnSelect) onClose()\n\n if (omitSelectedValues) onFocusNext(index)\n },\n [\n onFocusNext,\n omitSelectedValues,\n isDisabled,\n optionValue,\n setFocusedIndex,\n index,\n onChange,\n customCloseOnSelect,\n generalCloseOnSelect,\n onClose,\n inputRef,\n ],\n )\n\n useUpdateEffect(() => {\n if (isSelected) onChangeLabel(optionValue ?? \"\", { runOmit: false })\n }, [optionValue])\n\n const getOptionProps: PropGetter<\"li\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n }\n\n return {\n ref: mergeRefs(itemRef, ref, register),\n id,\n role: \"option\",\n ...computedProps,\n ...props,\n tabIndex: -1,\n style:\n !isTarget || (omitSelectedValues && isSelected) ? style : undefined,\n \"data-target\": dataAttr(true),\n \"data-value\": optionValue ?? \"\",\n \"data-focus\": dataAttr(isFocused),\n \"data-disabled\": dataAttr(isDisabled),\n \"aria-checked\": isSelected,\n \"aria-disabled\": ariaAttr(isDisabled),\n onClick: handlerAll(computedProps.onClick, props.onClick, onClick),\n }\n },\n [\n id,\n optionValue,\n computedProps,\n isDisabled,\n isFocused,\n isSelected,\n isTarget,\n omitSelectedValues,\n onClick,\n register,\n ],\n )\n\n return {\n isSelected,\n isFocused,\n customIcon,\n children,\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<\"li\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n }\n\n return {\n ref,\n ...props,\n tabIndex: -1,\n style: isHit ? style : undefined,\n \"data-focus\": dataAttr(!isHit),\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 { isHit, isEmpty } = useAutocompleteContext()\n\n const getEmptyProps: PropGetter<\"li\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n }\n\n return {\n ref,\n ...props,\n tabIndex: -1,\n style: isHit && !isEmpty ? style : undefined,\n }\n },\n [isHit, isEmpty],\n )\n\n return { getEmptyProps }\n}\n\nexport type UseAutocompleteEmptyReturn = ReturnType<typeof useAutocompleteEmpty>\n","import type { CSSUIObject, FC, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { ReactElement } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { AutocompleteItemIcon } from \"./autocomplete-icon\"\nimport { useAutocompleteEmpty } from \"./use-autocomplete-option\"\n\ninterface AutocompleteEmptyOptions {\n /**\n * The autocomplete empty option icon to use.\n */\n icon?: ReactElement\n /**\n * The label of the autocomplete empty option.\n */\n children?: string\n}\n\nexport interface AutocompleteEmptyProps\n extends Omit<HTMLUIProps<\"li\">, \"children\">,\n AutocompleteEmptyOptions {}\n\nexport const AutocompleteEmpty = forwardRef<AutocompleteEmptyProps, \"li\">(\n ({ className, icon, children, ...rest }, ref) => {\n const { emptyMessage, styles } = useAutocompleteContext()\n const { getEmptyProps } = useAutocompleteEmpty()\n\n children ??= emptyMessage\n\n const css: CSSUIObject = {\n textDecoration: \"none\",\n color: \"inherit\",\n userSelect: \"none\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n textAlign: \"start\",\n flex: \"0 0 auto\",\n outline: 0,\n gap: \"0.75rem\",\n pointerEvents: \"none\",\n ...styles.item,\n }\n\n return (\n <ui.li\n className={cx(\"ui-autocomplete__item--empty\", className)}\n __css={css}\n {...getEmptyProps(rest, ref)}\n >\n {icon !== null ? (\n <AutocompleteItemIcon>{icon || <MinusIcon />}</AutocompleteItemIcon>\n ) : null}\n {icon ? (\n <ui.span style={{ pointerEvents: \"none\", flex: 1 }} lineClamp={1}>\n {children}\n </ui.span>\n ) : (\n children\n )}\n </ui.li>\n )\n },\n)\n\nAutocompleteEmpty.displayName = \"AutocompleteEmpty\"\nAutocompleteEmpty.__ui__ = \"AutocompleteEmpty\"\n\nconst MinusIcon: FC = () => (\n <svg viewBox=\"0 0 448 512\" width=\"1em\" height=\"1em\">\n <path\n fill=\"currentColor\"\n d=\"M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z\"\n />\n </svg>\n)\n\nMinusIcon.displayName = \"MinusIcon\"\nMinusIcon.__ui__ = \"MinusIcon\"\n","import type { CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport type { MotionPropsWithoutChildren } from \"@yamada-ui/motion\"\nimport { PopoverContent } from \"@yamada-ui/popover\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport type { ReactNode } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { useAutocompleteList } from \"./use-autocomplete-list\"\n\nexport interface AutocompleteListProps extends HTMLUIProps<\"ul\"> {\n contentProps?: MotionPropsWithoutChildren\n header?: ReactNode\n footer?: ReactNode\n}\n\nexport const AutocompleteList = forwardRef<AutocompleteListProps, \"ul\">(\n (\n {\n className,\n w,\n width,\n minW,\n minWidth,\n maxW,\n maxWidth,\n contentProps,\n header,\n footer,\n children,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useAutocompleteContext()\n const { onAnimationComplete, 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 width={width}\n minWidth={minWidth}\n maxWidth={maxWidth}\n __css={{ ...styles.content, width, minWidth, maxWidth }}\n {...contentProps}\n onAnimationComplete={handlerAll(\n contentProps?.onAnimationComplete,\n onAnimationComplete,\n )}\n >\n {header ? (\n <ui.div\n className=\"ui-autocomplete__header\"\n __css={{ ...styles.header }}\n >\n {header}\n </ui.div>\n ) : null}\n\n <ui.ul\n className={cx(\"ui-autocomplete__list\", className)}\n __css={{ ...styles.list }}\n {...getListProps(rest, ref)}\n >\n {children}\n </ui.ul>\n\n {footer ? (\n <ui.div\n className=\"ui-autocomplete__footer\"\n __css={{ ...styles.footer }}\n >\n {footer}\n </ui.div>\n ) : null}\n </PopoverContent>\n )\n },\n)\n\nAutocompleteList.displayName = \"AutocompleteList\"\nAutocompleteList.__ui__ = \"AutocompleteList\"\n","import type { PropGetter } from \"@yamada-ui/core\"\nimport { mergeRefs, useUpdateEffect } from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useId, useRef } from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendantsContext,\n} from \"./autocomplete-context\"\n\nexport const useAutocompleteList = () => {\n const uuid = useId()\n const { focusedIndex, isOpen, listRef, rebirthOptions } =\n useAutocompleteContext()\n\n const descendants = useAutocompleteDescendantsContext()\n\n const beforeFocusedIndex = useRef<number>(-1)\n const selectedValue = descendants.value(focusedIndex)\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 getListProps: PropGetter<\"ul\"> = useCallback(\n (props = {}, ref = null) => ({\n as: \"ul\",\n ref: mergeRefs(listRef, ref),\n role: \"listbox\",\n tabIndex: -1,\n position: \"relative\",\n id: props.id ?? uuid,\n ...props,\n }),\n [listRef, uuid],\n )\n\n return {\n onAnimationComplete,\n getListProps,\n }\n}\n","import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport { layoutStyleProperties } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport type { ComboBoxProps, PopoverProps } from \"@yamada-ui/popover\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useDisclosure } from \"@yamada-ui/use-disclosure\"\nimport { useOutsideClick } from \"@yamada-ui/use-outside-click\"\nimport type { Union } from \"@yamada-ui/utils\"\nimport {\n dataAttr,\n funcAll,\n getEventRelatedTarget,\n handlerAll,\n isArray,\n isContains,\n mergeRefs,\n pickObject,\n splitObject,\n useUnmountEffect,\n useUpdateEffect,\n getValidChildren,\n isUndefined,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\"\nimport type {\n ChangeEvent,\n DOMAttributes,\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n} from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendants,\n useAutocompleteDescendantsContext,\n} from \"./autocomplete-context\"\nimport { AutocompleteOption } from \"./autocomplete-option\"\nimport type { AutocompleteOptionProps } from \"./autocomplete-option\"\nimport type { AutocompleteOptionGroupProps } from \"./autocomplete-option-group\"\nimport { AutocompleteOptionGroup } from \"./autocomplete-option-group\"\n\nexport interface ChangeOptions {\n forceUpdate?: boolean\n runOmit?: boolean\n runRebirth?: boolean\n}\n\ninterface AutocompleteItemWithValue extends AutocompleteOptionProps {\n label?: string\n value?: string\n}\n\ninterface AutocompleteItemWithItems\n extends AutocompleteOptionGroupProps,\n Pick<AutocompleteOptionProps, \"isDisabled\" | \"isFocusable\"> {\n items?: AutocompleteItemWithValue[]\n}\n\nexport type AutocompleteItem =\n | AutocompleteItemWithValue\n | AutocompleteItemWithItems\n\nconst kanaMap: { [key: string]: string } = {\n ガ: \"ガ\",\n ギ: \"ギ\",\n グ: \"グ\",\n ゲ: \"ゲ\",\n ゴ: \"ゴ\",\n ザ: \"ザ\",\n ジ: \"ジ\",\n ズ: \"ズ\",\n ゼ: \"ゼ\",\n ゾ: \"ゾ\",\n ダ: \"ダ\",\n ヂ: \"ヂ\",\n ヅ: \"ヅ\",\n デ: \"デ\",\n ド: \"ド\",\n バ: \"バ\",\n ビ: \"ビ\",\n ブ: \"ブ\",\n ベ: \"ベ\",\n ボ: \"ボ\",\n パ: \"パ\",\n ピ: \"ピ\",\n プ: \"プ\",\n ペ: \"ペ\",\n ポ: \"ポ\",\n ヴ: \"ヴ\",\n ヷ: \"ヷ\",\n ヺ: \"ヺ\",\n ア: \"ア\",\n イ: \"イ\",\n ウ: \"ウ\",\n エ: \"エ\",\n オ: \"オ\",\n カ: \"カ\",\n キ: \"キ\",\n ク: \"ク\",\n ケ: \"ケ\",\n コ: \"コ\",\n サ: \"サ\",\n シ: \"シ\",\n ス: \"ス\",\n セ: \"セ\",\n ソ: \"ソ\",\n タ: \"タ\",\n チ: \"チ\",\n ツ: \"ツ\",\n テ: \"テ\",\n ト: \"ト\",\n ナ: \"ナ\",\n ニ: \"ニ\",\n ヌ: \"ヌ\",\n ネ: \"ネ\",\n ノ: \"ノ\",\n ハ: \"ハ\",\n ヒ: \"ヒ\",\n フ: \"フ\",\n ヘ: \"ヘ\",\n ホ: \"ホ\",\n マ: \"マ\",\n ミ: \"ミ\",\n ム: \"ム\",\n メ: \"メ\",\n モ: \"モ\",\n ヤ: \"ヤ\",\n ユ: \"ユ\",\n ヨ: \"ヨ\",\n ラ: \"ラ\",\n リ: \"リ\",\n ル: \"ル\",\n レ: \"レ\",\n ロ: \"ロ\",\n ワ: \"ワ\",\n ヲ: \"ヲ\",\n ン: \"ン\",\n ァ: \"ァ\",\n ィ: \"ィ\",\n ゥ: \"ゥ\",\n ェ: \"ェ\",\n ォ: \"ォ\",\n ッ: \"ッ\",\n ャ: \"ャ\",\n ュ: \"ュ\",\n ョ: \"ョ\",\n \"。\": \"。\",\n \"、\": \"、\",\n ー: \"ー\",\n \"「\": \"「\",\n \"」\": \"」\",\n \"・\": \"・\",\n}\n\nconst defaultFormat = (value: string) => {\n value = value.replace(/[!-~]/g, (v) =>\n String.fromCharCode(v.charCodeAt(0) - 0xfee0),\n )\n\n const reg = new RegExp(\"(\" + Object.keys(kanaMap).join(\"|\") + \")\", \"g\")\n\n value = value\n .replace(reg, (v) => kanaMap[v])\n .replace(/゙/g, \"゛\")\n .replace(/゚/g, \"゜\")\n\n value = value.toUpperCase()\n\n return value\n}\n\nconst flattenItems = (\n items: AutocompleteItem[],\n): AutocompleteItemWithValue[] => {\n const filterItems = (\n items: AutocompleteItem[] | AutocompleteItemWithValue[],\n ): (AutocompleteItemWithValue | AutocompleteItemWithValue[])[] =>\n items\n .map((item) => {\n const { isDisabled, isFocusable } = item\n const trulyDisabled = !!isDisabled && !isFocusable\n\n if (trulyDisabled) return\n\n if (\"items\" in item) {\n return filterItems(item.items ?? [])\n } else {\n return item as AutocompleteItemWithValue\n }\n })\n .filter(Boolean) as (\n | AutocompleteItemWithValue\n | AutocompleteItemWithValue[]\n )[]\n\n return filterItems(items).flat(Infinity) as AutocompleteItemWithValue[]\n}\n\ntype UseAutocompleteBaseProps<T extends string | string[] = string> =\n ComboBoxProps &\n FormControlOptions & {\n /**\n * The value of the autocomplete.\n */\n value?: T\n /**\n * The initial value of the autocomplete.\n */\n defaultValue?: T\n /**\n * The callback invoked when value state changes.\n */\n onChange?: (value: T) => void\n /**\n * The callback invoked when search input.\n */\n onSearch?: (ev: ChangeEvent<HTMLInputElement>) => void\n /**\n * The callback invoked when autocomplete option created.\n */\n onCreate?: (\n newItem: AutocompleteItem,\n newItems: AutocompleteItem[],\n ) => void\n /**\n * Function to format text when search input.\n */\n format?: (value: string) => string\n /**\n * The position to be inserted when the autocomplete option is created.\n *\n * @default 'first'\n */\n insertPositionItem?: Union<\"first\" | \"last\"> | [string, \"first\" | \"last\"]\n /**\n * If `true`, the list element will be closed when value is selected.\n *\n * @default true\n */\n closeOnSelect?: boolean\n /**\n * The message displayed when the search yields no hits.\n *\n * @default 'No results found'\n */\n emptyMessage?: string\n /**\n * If `true`, enables the creation of autocomplete option.\n *\n * @default false\n */\n allowCreate?: boolean\n /**\n * If `true`, enables the free input.\n */\n allowFree?: boolean\n /**\n * If `true`, the selected item(s) will be excluded from the list.\n *\n * @default false\n */\n omitSelectedValues?: boolean\n /**\n * The maximum selectable value.\n */\n maxSelectValues?: number\n /**\n * Props for select option element.\n */\n optionProps?: Omit<AutocompleteOptionProps, \"value\" | \"children\">\n /**\n * If provided, generate options based on items.\n */\n items?: AutocompleteItem[]\n }\n\nexport type UseAutocompleteProps<T extends string | string[] = string> = Omit<\n HTMLUIProps<\"input\">,\n | keyof UseAutocompleteBaseProps\n | \"list\"\n | \"disabled\"\n | \"required\"\n | \"readOnly\"\n | \"size\"\n> &\n UseAutocompleteBaseProps<T>\n\nexport const useAutocomplete = <T extends string | string[] = string>(\n props: UseAutocompleteProps<T>,\n) => {\n const {\n value: valueProp,\n defaultValue,\n onChange: onChangeProp,\n onCreate: onCreateProp,\n onSearch: onSearchProp,\n closeOnSelect = true,\n omitSelectedValues = false,\n maxSelectValues,\n allowCreate = false,\n allowFree = false,\n insertPositionItem = \"first\",\n emptyMessage = \"No results found\",\n format = defaultFormat,\n optionProps,\n placeholder,\n onKeyDown: onKeyDownProp,\n isOpen: isOpenProp,\n defaultIsOpen,\n onOpen: onOpenProp,\n onClose: onCloseProp,\n closeOnBlur = true,\n closeOnEsc = true,\n openDelay,\n closeDelay,\n isLazy,\n lazyBehavior,\n animation,\n duration = 0.2,\n offset,\n gutter,\n preventOverflow,\n flip,\n matchWidth = true,\n boundary,\n eventListeners,\n strategy,\n placement = \"bottom-start\",\n modifiers,\n items,\n children,\n ...rest\n } = useFormControlProps(props)\n const {\n \"aria-readonly\": _ariaReadonly,\n onFocus: onFocusProp,\n ...formControlProps\n } = pickObject(rest, formControlProperties)\n const [containerProps, inputProps] = splitObject(rest, layoutStyleProperties)\n const { id } = rest\n\n const descendants = useAutocompleteDescendants()\n\n const containerRef = useRef<HTMLDivElement>(null)\n const listRef = useRef<HTMLUListElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n const timeoutIds = useRef<Set<any>>(new Set([]))\n const isComposition = useRef<boolean>(false)\n const prevValue = useRef<T | undefined>(undefined)\n\n const [resolvedItems, setResolvedItems] = useState<\n AutocompleteItem[] | undefined\n >(items ? JSON.parse(JSON.stringify(items)) : undefined)\n const [value, setValue] = useControllableState({\n value: valueProp,\n defaultValue,\n onChange: onChangeProp,\n })\n const [label, setLabel] = useState<T | undefined>(undefined)\n const [inputValue, setInputValue] = useState<string>(\"\")\n const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n const [isAllSelected, setIsAllSelected] = useState<boolean>(false)\n const [isHit, setIsHit] = useState<boolean>(true)\n const {\n isOpen,\n onOpen: onInternalOpen,\n onClose,\n } = useDisclosure({\n isOpen: isOpenProp,\n defaultIsOpen,\n onOpen: onOpenProp,\n onClose: onCloseProp,\n })\n const isFocused = focusedIndex > -1\n const isCreate = focusedIndex === -2 && allowCreate\n const isMulti = isArray(value)\n const isEmptyValue = !isMulti ? !value : !value.length\n\n const [firstInsertPositionItem, secondInsertPositionItem] = useMemo(() => {\n if (isArray(insertPositionItem)) {\n return insertPositionItem\n } else {\n return [insertPositionItem, \"first\"]\n }\n }, [insertPositionItem])\n\n if (allowCreate && !isUndefined(children)) {\n console.warn(\n `${!isMulti ? \"Autocomplete\" : \"MultiAutocomplete\"}: ${\n !isMulti ? \"Autocomplete\" : \"MultiAutocomplete\"\n } internally prefers 'children'. If 'allowCreate' is true, it will not be reflected correctly. If want to reflect, please set 'items' in props.`,\n )\n }\n\n const selectedValues = descendants.enabledValues(\n ({ node }) => isMulti && value.includes(node.dataset.value ?? \"\"),\n )\n const selectedIndexes = selectedValues.map(({ index }) => index)\n const enabledValues = descendants.enabledValues(\n ({ node, index }) =>\n \"target\" in node.dataset && !selectedIndexes.includes(index),\n )\n\n const validChildren = getValidChildren(children)\n\n const computedChildren = useMemo(\n () =>\n resolvedItems?.map((item, i) => {\n if (\"value\" in item) {\n const { label, value, ...props } = item\n\n return (\n <AutocompleteOption key={i} value={value} {...props}>\n {label}\n </AutocompleteOption>\n )\n } else if (\"items\" in item) {\n const { label, items = [], ...props } = item\n\n return (\n <AutocompleteOptionGroup key={i} label={label as string} {...props}>\n {items.map(({ label, value, ...props }, i) => (\n <AutocompleteOption key={i} value={value} {...props}>\n {label}\n </AutocompleteOption>\n ))}\n </AutocompleteOptionGroup>\n )\n }\n }),\n [resolvedItems],\n )\n\n const isEmpty = !validChildren.length && !computedChildren?.length\n\n const onOpen = useCallback(() => {\n if (formControlProps.disabled || formControlProps.readOnly) return\n\n if (!allowCreate && (isEmpty || isAllSelected)) return\n\n onInternalOpen()\n\n if (inputRef.current) inputRef.current.focus()\n }, [allowCreate, formControlProps, isAllSelected, isEmpty, onInternalOpen])\n\n const onFocusFirst = useCallback(() => {\n const id = setTimeout(() => {\n if (isEmpty || isAllSelected) return\n\n const first = descendants.enabledFirstValue(\n ({ node }) => \"target\" in node.dataset,\n )\n\n if (!first) return\n\n if (!isMulti || !omitSelectedValues) {\n setFocusedIndex(first.index)\n } else {\n if (selectedIndexes.includes(first.index)) {\n const enabledFirst = enabledValues[0]\n\n setFocusedIndex(enabledFirst.index)\n } else {\n setFocusedIndex(first.index)\n }\n }\n })\n\n timeoutIds.current.add(id)\n }, [\n descendants,\n enabledValues,\n isAllSelected,\n isEmpty,\n isMulti,\n omitSelectedValues,\n selectedIndexes,\n ])\n\n const onFocusLast = useCallback(() => {\n const id = setTimeout(() => {\n if (isEmpty || isAllSelected) return\n\n const last = descendants.enabledLastValue(\n ({ node }) => \"target\" in node.dataset,\n )\n\n if (!last) return\n\n if (!isMulti || !omitSelectedValues) {\n setFocusedIndex(last.index)\n } else {\n if (selectedIndexes.includes(last.index)) {\n const enabledLast = enabledValues.reverse()[0]\n\n setFocusedIndex(enabledLast.index)\n } else {\n setFocusedIndex(last.index)\n }\n }\n })\n\n timeoutIds.current.add(id)\n }, [\n descendants,\n enabledValues,\n isAllSelected,\n isEmpty,\n isMulti,\n omitSelectedValues,\n selectedIndexes,\n ])\n\n const onFocusSelected = useCallback(() => {\n const id = setTimeout(() => {\n const values = descendants.enabledValues()\n\n const selected = values.find(({ node }) =>\n !isMulti\n ? node.dataset.value === value\n : value.includes(node.dataset.value ?? \"\"),\n )\n\n if (selected) setFocusedIndex(selected.index)\n })\n\n timeoutIds.current.add(id)\n }, [descendants, isMulti, value])\n\n const onFocusNext = useCallback(\n (index: number = focusedIndex) => {\n const id = setTimeout(() => {\n const next = descendants.enabledNextValue(\n index,\n ({ node }) => \"target\" in node.dataset,\n )\n\n if (!next) return\n\n if (!isMulti || !omitSelectedValues) {\n setFocusedIndex(next.index)\n } else {\n if (selectedIndexes.includes(next.index)) {\n const enabledNext =\n enabledValues.find(({ index }) => next.index < index) ??\n enabledValues[0]\n\n setFocusedIndex(enabledNext.index)\n } else {\n setFocusedIndex(next.index)\n }\n }\n })\n\n timeoutIds.current.add(id)\n },\n [\n descendants,\n enabledValues,\n focusedIndex,\n isMulti,\n omitSelectedValues,\n selectedIndexes,\n ],\n )\n\n const onFocusPrev = useCallback(\n (index: number = focusedIndex) => {\n const id = setTimeout(() => {\n const prev = descendants.enabledPrevValue(\n index,\n ({ node }) => \"target\" in node.dataset,\n )\n\n if (!prev) return\n\n if (!isMulti || !omitSelectedValues) {\n setFocusedIndex(prev.index)\n } else {\n if (selectedIndexes.includes(prev.index)) {\n const enabledPrev =\n enabledValues.reverse().find(({ index }) => index < prev.index) ??\n enabledValues[0]\n\n setFocusedIndex(enabledPrev.index)\n } else {\n setFocusedIndex(prev.index)\n }\n }\n })\n\n timeoutIds.current.add(id)\n },\n [\n descendants,\n enabledValues,\n focusedIndex,\n isMulti,\n omitSelectedValues,\n selectedIndexes,\n ],\n )\n\n const onFocusFirstOrSelected =\n isEmptyValue || omitSelectedValues ? onFocusFirst : onFocusSelected\n const onFocusLastOrSelected =\n isEmptyValue || omitSelectedValues ? onFocusLast : onFocusSelected\n\n const pickOptions = useCallback(\n (value: string) => {\n const values = descendants.values()\n\n let isHit = false\n let isFocused = false\n\n values.forEach(({ node, index }) => {\n if (format(node.textContent ?? \"\").includes(value)) {\n isHit = true\n\n const isDisabled = \"disabled\" in node.dataset\n\n node.dataset.target = \"\"\n\n if (!isFocused && !isDisabled) {\n isFocused = true\n\n setFocusedIndex(index)\n }\n } else {\n delete node.dataset.target\n }\n })\n\n setIsHit(isHit)\n },\n [descendants, format],\n )\n\n const rebirthOptions = useCallback(\n (runFocus = true) => {\n const values = descendants.values()\n\n values.forEach(({ node }) => {\n node.dataset.target = \"\"\n })\n\n if (runFocus) onFocusFirst()\n\n setIsHit(true)\n },\n [descendants, onFocusFirst],\n )\n\n const getSelectedValues = useCallback(\n (newValues: string | string[]) => {\n const enabledValues = descendants.enabledValues()\n\n const resolvedValues = isArray(newValues) ? newValues : [newValues]\n\n const selectedValues = resolvedValues\n .map((value) => {\n const { node } =\n enabledValues.find(({ node }) => node.dataset.value === value) ?? {}\n\n if (node) {\n const el = Array.from(node.children).find(\n (child) => child.getAttribute(\"data-label\") !== null,\n )\n\n return el?.textContent ?? undefined\n } else {\n return allowFree ? value : undefined\n }\n })\n .filter(Boolean) as string[]\n\n return selectedValues\n },\n [allowFree, descendants],\n )\n\n const onChangeLabel = useCallback(\n (newValue: string, { forceUpdate, runOmit = true }: ChangeOptions = {}) => {\n const selectedValues = getSelectedValues(newValue)\n\n if (!forceUpdate && !selectedValues.length) return\n\n setLabel((prev) => {\n if (!isMulti) {\n return selectedValues[0] as T\n } else {\n selectedValues.forEach((selectedValue) => {\n const isSelected =\n isArray(prev) && prev.includes(selectedValue ?? \"\")\n\n if (!isSelected) {\n prev = [...(isArray(prev) ? prev : []), selectedValue] as T\n } else if (runOmit) {\n prev = (\n isArray(prev)\n ? prev.filter((value) => value !== selectedValue)\n : undefined\n ) as T\n }\n })\n\n return prev\n }\n })\n },\n [getSelectedValues, isMulti],\n )\n\n const onChange = useCallback(\n (\n newValue: string,\n { forceUpdate, runRebirth = true }: ChangeOptions = {},\n ) => {\n setValue((prev) => {\n let next: T\n\n if (!isArray(prev)) {\n next = newValue as T\n } else {\n const isSelected = prev.includes(newValue)\n\n if (!isSelected) {\n next = [...prev, newValue] as T\n } else {\n next = prev.filter((value) => value !== newValue) as T\n }\n }\n\n prevValue.current = next\n return next\n })\n\n const isHit =\n descendants\n .values()\n .filter(({ node }) =>\n format(node.textContent ?? \"\").includes(newValue),\n ).length > 0\n\n onChangeLabel(newValue, { forceUpdate })\n\n if (allowFree || isHit) setInputValue(\"\")\n\n if (isMulti && runRebirth) rebirthOptions(false)\n },\n [\n allowFree,\n isMulti,\n onChangeLabel,\n rebirthOptions,\n setValue,\n descendants,\n format,\n ],\n )\n\n const onSelect = useCallback(() => {\n let enabledValue = descendants.value(focusedIndex)\n\n if (\"disabled\" in (enabledValue?.node.dataset ?? {}))\n enabledValue = undefined\n\n if (!enabledValue) return\n\n const value = enabledValue.node.dataset.value ?? \"\"\n\n onChange(value)\n\n if (closeOnSelect) onClose()\n\n if (omitSelectedValues) onFocusNext()\n }, [\n closeOnSelect,\n descendants,\n focusedIndex,\n omitSelectedValues,\n onChange,\n onClose,\n onFocusNext,\n ])\n\n const onSearch = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (!isOpen) onOpen()\n\n onSearchProp?.(ev)\n\n const value = ev.target.value\n const computedValue = format(value)\n\n if (computedValue) {\n pickOptions(computedValue)\n } else {\n rebirthOptions()\n }\n\n setInputValue(value)\n },\n [isOpen, onOpen, format, onSearchProp, pickOptions, rebirthOptions],\n )\n\n const onCompositionStart = useCallback(() => {\n isComposition.current = true\n }, [])\n\n const onCompositionEnd = useCallback(() => {\n isComposition.current = false\n }, [])\n\n const onCreate = useCallback(() => {\n if (!listRef.current) return\n\n const newItem: AutocompleteItem = { label: inputValue, value: inputValue }\n\n let newItems: AutocompleteItem[] = []\n\n if (resolvedItems) newItems = [...resolvedItems]\n\n if (firstInsertPositionItem === \"first\") {\n newItems = [newItem, ...newItems]\n } else if (firstInsertPositionItem === \"last\") {\n newItems = [...newItems, newItem]\n } else {\n const i = newItems.findIndex(\n ({ label }) => label === firstInsertPositionItem,\n )\n\n const targetItem = newItems[i]\n\n if (i !== -1 && \"items\" in targetItem) {\n if (secondInsertPositionItem === \"first\") {\n targetItem.items = [newItem, ...(targetItem.items ?? [])]\n } else {\n targetItem.items = [...(targetItem.items ?? []), newItem]\n }\n\n newItems[i] = targetItem\n } else {\n console.warn(\n `${\n !isMulti ? \"Autocomplete\" : \"MultiAutocomplete\"\n }: '${firstInsertPositionItem}' specified in insertPositionItem does not exist in the option group.`,\n )\n }\n }\n\n setResolvedItems(newItems)\n onChange(inputValue)\n rebirthOptions(false)\n\n const index = flattenItems(newItems).findIndex(\n ({ value }) => value === inputValue,\n )\n\n setFocusedIndex(index)\n\n onCreateProp?.(newItem, newItems)\n }, [\n inputValue,\n resolvedItems,\n firstInsertPositionItem,\n onChange,\n rebirthOptions,\n onCreateProp,\n secondInsertPositionItem,\n isMulti,\n ])\n\n const onClick = useCallback(() => {\n if (isOpen) {\n if (inputRef.current) inputRef.current.focus()\n } else {\n onOpen()\n\n onFocusFirstOrSelected()\n }\n }, [isOpen, onFocusFirstOrSelected, onOpen])\n\n const onFocus = useCallback(() => {\n if (isOpen) return\n\n onOpen()\n\n onFocusFirstOrSelected()\n }, [isOpen, onFocusFirstOrSelected, onOpen])\n\n const onBlur = useCallback(\n (ev: FocusEvent<HTMLDivElement>) => {\n const relatedTarget = getEventRelatedTarget(ev)\n\n if (isContains(containerRef.current, relatedTarget)) return\n\n if (!closeOnBlur && isHit) return\n\n if (allowFree && !!inputValue) onChange(inputValue, { runRebirth: false })\n\n setInputValue(\"\")\n\n if (isOpen) onClose()\n },\n [closeOnBlur, isHit, isOpen, inputValue, allowFree, onClose, onChange],\n )\n\n const onDelete = useCallback(() => {\n if (!isMulti) {\n onChange(\"\", { forceUpdate: true })\n } else {\n onChange(value[value.length - 1])\n }\n\n if (!isOpen) onFocus()\n }, [isMulti, isOpen, onChange, onFocus, value])\n\n const onClear = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n ev.stopPropagation()\n\n prevValue.current = [] as unknown as T\n setValue([] as unknown as T)\n setLabel(undefined)\n setInputValue(\"\")\n rebirthOptions()\n\n if (isOpen && inputRef.current) inputRef.current.focus()\n },\n [isOpen, setLabel, setInputValue, setValue, rebirthOptions],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLDivElement>) => {\n if (ev.key === \" \") ev.key = ev.code\n\n if (formControlProps.disabled || formControlProps.readOnly) return\n if (isComposition.current) return\n\n const enabledDelete = label === inputValue || !inputValue.length\n\n const actions: { [key: string]: Function | undefined } = {\n ArrowDown: isFocused\n ? () => onFocusNext()\n : !isOpen\n ? funcAll(onOpen, onFocusFirstOrSelected)\n : undefined,\n ArrowUp: isFocused\n ? () => onFocusPrev()\n : !isOpen\n ? funcAll(onOpen, onFocusLastOrSelected)\n : undefined,\n Space: isCreate\n ? onCreate\n : isFocused\n ? onSelect\n : !isOpen\n ? funcAll(onOpen, onFocusFirstOrSelected)\n : undefined,\n Enter: isCreate\n ? onCreate\n : isFocused\n ? onSelect\n : !isOpen\n ? funcAll(onOpen, onFocusFirstOrSelected)\n : allowFree && isMulti\n ? () => {\n if (inputValue) onChange(inputValue)\n\n setFocusedIndex(0)\n }\n : undefined,\n Home: isOpen ? onFocusFirst : undefined,\n End: isOpen ? onFocusLast : undefined,\n Escape: closeOnEsc ? onClose : undefined,\n Backspace: !isEmptyValue && enabledDelete ? onDelete : undefined,\n }\n\n const action = actions[ev.key]\n\n if (!action) return\n\n ev.preventDefault()\n ev.stopPropagation()\n\n action(ev)\n },\n [\n allowFree,\n formControlProps,\n label,\n inputValue,\n onOpen,\n isFocused,\n isMulti,\n onFocusFirstOrSelected,\n onFocusNext,\n onFocusLastOrSelected,\n onFocusPrev,\n isCreate,\n onCreate,\n onSelect,\n isOpen,\n onFocusFirst,\n onFocusLast,\n closeOnEsc,\n onClose,\n isEmptyValue,\n onDelete,\n onChange,\n ],\n )\n\n useEffect(() => {\n if (!isMulti) return\n\n if (!omitSelectedValues && isUndefined(maxSelectValues)) return\n\n const isAll = value.length > 0 && value.length === descendants.count()\n const isMax = value.length === maxSelectValues\n\n if (isAll || isMax) {\n onClose()\n setIsAllSelected(true)\n } else {\n setIsAllSelected(false)\n }\n }, [\n omitSelectedValues,\n value,\n descendants,\n isMulti,\n onClose,\n maxSelectValues,\n ])\n\n useEffect(() => {\n if (isMulti) {\n if (\n JSON.stringify(prevValue.current ?? []) === JSON.stringify(value ?? [])\n )\n return\n\n const label = getSelectedValues(value)\n\n setLabel(label as T)\n } else {\n if (prevValue.current === value) return\n\n onChangeLabel(value, { runOmit: false })\n }\n }, [isMulti, value, onChangeLabel, getSelectedValues])\n\n useUpdateEffect(() => {\n if (isOpen || allowFree) return\n\n setFocusedIndex(-1)\n setInputValue(\"\")\n }, [isOpen])\n\n useUpdateEffect(() => {\n if (!isHit) setFocusedIndex(-2)\n }, [isHit])\n\n useUpdateEffect(() => {\n setResolvedItems(items ? JSON.parse(JSON.stringify(items)) : undefined)\n }, [items])\n\n useUnmountEffect(() => {\n timeoutIds.current.forEach((id) => clearTimeout(id))\n timeoutIds.current.clear()\n })\n\n useOutsideClick({\n ref: containerRef,\n handler: onClose,\n enabled: isOpen && (closeOnBlur || !isHit),\n })\n\n const getPopoverProps = useCallback(\n (props?: PopoverProps): PopoverProps => ({\n closeOnBlur,\n openDelay,\n closeDelay,\n isLazy,\n lazyBehavior,\n animation,\n duration,\n offset,\n gutter,\n preventOverflow,\n flip,\n matchWidth,\n boundary,\n eventListeners,\n strategy,\n placement,\n modifiers,\n ...props,\n trigger: \"never\",\n closeOnButton: false,\n isOpen,\n onOpen,\n onClose,\n }),\n [\n closeOnBlur,\n openDelay,\n closeDelay,\n isLazy,\n lazyBehavior,\n animation,\n duration,\n offset,\n gutter,\n preventOverflow,\n flip,\n matchWidth,\n boundary,\n eventListeners,\n strategy,\n placement,\n modifiers,\n isOpen,\n onOpen,\n onClose,\n ],\n )\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ref: mergeRefs(containerRef, ref),\n ...containerProps,\n ...props,\n ...formControlProps,\n onClick: handlerAll(props.onClick, rest.onClick, onClick),\n onBlur: handlerAll(props.onBlur, rest.onBlur, onBlur),\n }),\n\n [containerProps, formControlProps, onBlur, onClick, rest],\n )\n\n const getFieldProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ref,\n tabIndex: -1,\n ...props,\n ...formControlProps,\n placeholder,\n \"data-active\": dataAttr(isOpen),\n \"aria-expanded\": dataAttr(isOpen),\n onFocus: handlerAll(props.onFocus, onFocusProp, onFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDownProp, onKeyDown),\n }),\n [\n formControlProps,\n placeholder,\n isOpen,\n onFocusProp,\n onFocus,\n onKeyDownProp,\n onKeyDown,\n ],\n )\n\n return {\n id,\n descendants,\n value,\n label,\n inputValue,\n isHit,\n isEmpty,\n computedChildren,\n focusedIndex,\n omitSelectedValues,\n closeOnSelect,\n allowCreate,\n allowFree,\n emptyMessage,\n isOpen,\n isAllSelected,\n listRef,\n inputRef,\n optionProps,\n formControlProps,\n setFocusedIndex,\n onChangeLabel,\n onChange,\n onSearch,\n onCreate,\n onClear,\n onCompositionStart,\n onCompositionEnd,\n pickOptions,\n rebirthOptions,\n onOpen,\n onClose,\n onFocusFirst,\n onFocusLast,\n onFocusSelected,\n onFocusNext,\n onFocusPrev,\n getPopoverProps,\n getContainerProps,\n getFieldProps,\n inputProps: inputProps as DOMAttributes<HTMLInputElement>,\n }\n}\n\nexport type UseAutocompleteReturn = ReturnType<typeof useAutocomplete>\n\nexport const useAutocompleteInput = () => {\n const {\n id,\n inputRef,\n onSearch,\n onCompositionStart,\n onCompositionEnd,\n isAllSelected,\n formControlProps,\n inputProps,\n isOpen,\n focusedIndex,\n listRef,\n } = useAutocompleteContext()\n\n const { value } = useAutocompleteDescendantsContext()\n\n useUpdateEffect(() => {\n if (isAllSelected && inputRef.current) inputRef.current.blur()\n }, [isAllSelected])\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ref: mergeRefs(inputRef, ref),\n ...formControlProps,\n role: \"combobox\",\n \"aria-haspopup\": \"listbox\",\n \"aria-autocomplete\": \"list\",\n \"aria-expanded\": isOpen,\n \"aria-activedescendant\": value(focusedIndex)?.node.id,\n \"aria-controls\": listRef.current?.id,\n autoCapitalize: \"none\",\n autoComplete: \"off\",\n spellCheck: \"false\",\n ...inputProps,\n ...props,\n id,\n cursor: formControlProps.readOnly ? \"default\" : \"text\",\n pointerEvents:\n formControlProps.disabled || isAllSelected ? \"none\" : \"auto\",\n tabIndex: isAllSelected ? -1 : 0,\n onChange: handlerAll(props.onChange, onSearch),\n onCompositionStart: handlerAll(\n props.onCompositionStart,\n inputProps.onCompositionStart,\n onCompositionStart,\n ),\n onCompositionEnd: handlerAll(\n props.onCompositionEnd,\n inputProps.onCompositionEnd,\n onCompositionEnd,\n ),\n }),\n [\n listRef,\n focusedIndex,\n isOpen,\n inputProps,\n inputRef,\n formControlProps,\n id,\n isAllSelected,\n value,\n onSearch,\n onCompositionStart,\n onCompositionEnd,\n ],\n )\n\n return {\n getInputProps,\n }\n}\n\nexport type UseAutocompleteInputReturn = ReturnType<typeof useAutocompleteInput>\n","import type { CSSUIObject, FC } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { ReactElement } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { AutocompleteItemIcon } from \"./autocomplete-icon\"\nimport type { UseAutocompleteOptionProps } from \"./use-autocomplete-option\"\nimport { useAutocompleteOption } from \"./use-autocomplete-option\"\n\ninterface AutocompleteOptionOptions {\n /**\n * The autocomplete option icon to use.\n */\n icon?: ReactElement\n}\n\nexport interface AutocompleteOptionProps\n extends UseAutocompleteOptionProps,\n AutocompleteOptionOptions {}\n\nexport const AutocompleteOption = forwardRef<AutocompleteOptionProps, \"li\">(\n ({ className, icon, ...rest }, ref) => {\n const { styles } = useAutocompleteContext()\n const { isSelected, customIcon, children, getOptionProps } =\n useAutocompleteOption(rest)\n\n icon ??= customIcon\n\n const css: CSSUIObject = {\n textDecoration: \"none\",\n color: \"inherit\",\n userSelect: \"none\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n textAlign: \"start\",\n flex: \"0 0 auto\",\n outline: 0,\n gap: \"0.75rem\",\n ...styles.item,\n }\n\n return (\n <ui.li\n className={cx(\"ui-autocomplete__item\", className)}\n __css={css}\n {...getOptionProps({}, ref)}\n >\n {icon !== null ? (\n <AutocompleteItemIcon opacity={isSelected ? 1 : 0}>\n {icon || <CheckIcon />}\n </AutocompleteItemIcon>\n ) : null}\n\n <ui.span style={{ flex: 1 }} data-label>\n {children}\n </ui.span>\n </ui.li>\n )\n },\n)\n\nAutocompleteOption.displayName = \"AutocompleteOption\"\nAutocompleteOption.__ui__ = \"AutocompleteOption\"\n\nconst CheckIcon: FC = () => (\n <svg viewBox=\"0 0 14 14\" width=\"1em\" height=\"1em\">\n <polygon\n fill=\"currentColor\"\n points=\"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039\"\n />\n </svg>\n)\n\nCheckIcon.displayName = \"CheckIcon\"\nCheckIcon.__ui__ = \"CheckIcon\"\n","import type { HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport type { UseAutocompleteOptionGroupProps } from \"./use-autocomplete-option-group\"\nimport { useAutocompleteOptionGroup } from \"./use-autocomplete-option-group\"\n\ninterface AutocompleteOptionGroupOptions\n extends UseAutocompleteOptionGroupProps {\n /**\n * Props for autocomplete option group element.\n */\n labelProps?: HTMLUIProps<\"span\">\n}\n\nexport interface AutocompleteOptionGroupProps\n extends HTMLUIProps<\"ul\">,\n AutocompleteOptionGroupOptions {}\n\nexport const AutocompleteOptionGroup = forwardRef<\n AutocompleteOptionGroupProps,\n \"ul\"\n>(\n (\n {\n className,\n color,\n h,\n height,\n minH,\n minHeight,\n children,\n labelProps,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useAutocompleteContext()\n const { label, getContainerProps, getGroupProps } =\n useAutocompleteOptionGroup(rest)\n\n h ??= height\n minH ??= minHeight\n\n return (\n <ui.li\n className={cx(\n \"ui-autocomplete__item\",\n \"ui-autocomplete__item--group\",\n className,\n )}\n __css={{ w: \"100%\", h: \"fit-content\", color }}\n {...getContainerProps()}\n >\n <ui.span\n className=\"ui-autocomplete__item__group-label\"\n __css={styles.groupLabel}\n lineClamp={1}\n {...labelProps}\n >\n {label}\n </ui.span>\n\n <ui.ul\n {...getGroupProps({}, ref)}\n className=\"ui-autocomplete__item__group\"\n __css={{ h, minH, ...styles.group }}\n >\n {children}\n </ui.ul>\n </ui.li>\n )\n },\n)\n\nAutocompleteOptionGroup.displayName = \"AutocompleteOptionGroup\"\nAutocompleteOptionGroup.__ui__ = \"AutocompleteOptionGroup\"\n","import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport { layoutStyleProperties } from \"@yamada-ui/core\"\nimport { isArray, splitObject } from \"@yamada-ui/utils\"\nimport type { CSSProperties } from \"react\"\nimport { useCallback } from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendantsContext,\n} from \"./autocomplete-context\"\n\nexport interface UseAutocompleteOptionGroupProps extends HTMLUIProps<\"ul\"> {\n /**\n * The label of the autocomplete option group.\n */\n label: string\n}\n\nexport const useAutocompleteOptionGroup = ({\n label,\n ...rest\n}: UseAutocompleteOptionGroupProps) => {\n const { value, omitSelectedValues } = useAutocompleteContext()\n\n const isMulti = isArray(value)\n\n const descendants = useAutocompleteDescendantsContext()\n\n const values = descendants.values()\n const selectedValues =\n isMulti && omitSelectedValues\n ? descendants.values(({ node }) =>\n value.includes(node.dataset.value ?? \"\"),\n )\n : []\n const selectedIndexes = selectedValues.map(({ index }) => index)\n const childValues = values.filter(\n ({ node, index }) =>\n node.parentElement?.dataset.label === label &&\n !selectedIndexes.includes(index) &&\n \"target\" in node.dataset,\n )\n\n const isEmpty = !childValues.length\n\n const [containerProps, groupProps] = splitObject(rest, layoutStyleProperties)\n\n const getContainerProps: PropGetter<\"li\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n }\n\n return {\n ref,\n ...props,\n ...containerProps,\n style: isEmpty ? style : undefined,\n \"data-label\": label,\n role: \"autocomplete-group-container\",\n }\n },\n [containerProps, isEmpty, label],\n )\n\n const getGroupProps: PropGetter<\"ul\"> = useCallback(\n (props = {}, ref = null) => ({\n ref,\n ...props,\n ...groupProps,\n \"data-label\": label,\n role: \"autocomplete-group\",\n }),\n [groupProps, label],\n )\n\n return {\n label,\n getContainerProps,\n getGroupProps,\n }\n}\n\nexport type UseAutocompleteOptionGroupReturn = ReturnType<\n typeof useAutocompleteOptionGroup\n>\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { Popover, PopoverTrigger } from \"@yamada-ui/popover\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport { cx, handlerAll, runIfFunc } from \"@yamada-ui/utils\"\nimport type {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n} from \"react\"\nimport { cloneElement, useMemo } from \"react\"\nimport {\n AutocompleteDescendantsContextProvider,\n AutocompleteProvider,\n useAutocompleteContext,\n} from \"./autocomplete-context\"\nimport { AutocompleteCreate } from \"./autocomplete-create\"\nimport type { AutocompleteCreateProps } from \"./autocomplete-create\"\nimport { AutocompleteEmpty } from \"./autocomplete-empty\"\nimport type { AutocompleteEmptyProps } from \"./autocomplete-empty\"\nimport type { AutocompleteIconProps } from \"./autocomplete-icon\"\nimport { AutocompleteClearIcon, AutocompleteIcon } from \"./autocomplete-icon\"\nimport type { AutocompleteListProps } from \"./autocomplete-list\"\nimport { AutocompleteList } from \"./autocomplete-list\"\nimport type { UseAutocompleteProps } from \"./use-autocomplete\"\nimport { useAutocomplete, useAutocompleteInput } from \"./use-autocomplete\"\n\ninterface MultiAutocompleteOptions {\n /**\n * The visual separator between each value.\n *\n * @default ','\n */\n separator?: string\n /**\n * The custom display value to use.\n */\n component?: FC<{\n value: string | number\n label: string\n index: number\n onRemove: MouseEventHandler<HTMLElement>\n }>\n /**\n * If `true`, keep the placeholder.\n *\n * @default false\n */\n keepPlaceholder?: boolean\n /**\n * If `true`, display the select clear icon.\n *\n * @default true\n */\n isClearable?: boolean\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: string\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: string\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 multi autocomplete list element.\n */\n listProps?: Omit<AutocompleteListProps, \"children\">\n /**\n * Props for multi autocomplete field element.\n */\n fieldProps?: Omit<\n MultiAutocompleteFieldProps,\n \"component\" | \"separator\" | \"keepPlaceholder\" | \"inputProps\" | \"children\"\n >\n /**\n * Props for multi autocomplete input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for multi autocomplete icon element.\n */\n iconProps?: AutocompleteIconProps\n /**\n * Props for multi autocomplete clear icon element.\n */\n clearIconProps?: AutocompleteIconProps\n /**\n * Props to be forwarded to the portal component.\n *\n * @default '{ isDisabled: true }'\n *\n */\n portalProps?: Omit<PortalProps, \"children\">\n /**\n * If `true`, the list element will be closed when value is selected.\n *\n * @default false\n */\n closeOnSelect?: boolean\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 * The header of the autocomplete content element.\n */\n header?: ReactNode | FC<{ value: string[] | undefined; onClose: () => void }>\n /**\n * The footer of the autocomplete content element.\n */\n footer?: ReactNode | FC<{ value: string[] | undefined; onClose: () => void }>\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 defaultValue = [],\n component,\n separator,\n isClearable = true,\n color,\n h,\n height,\n minH,\n minHeight,\n closeOnSelect = false,\n keepPlaceholder = false,\n containerProps,\n contentProps,\n listProps,\n fieldProps,\n inputProps,\n iconProps,\n clearIconProps,\n portalProps = { isDisabled: true },\n createProps,\n emptyProps,\n header,\n footer,\n children,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n const {\n value,\n onClose,\n descendants,\n formControlProps,\n getPopoverProps,\n getContainerProps,\n getFieldProps,\n allowCreate,\n isEmpty,\n inputValue,\n computedChildren,\n onClear,\n ...rest\n } = useAutocomplete<string[]>({\n ...computedProps,\n defaultValue,\n closeOnSelect,\n children,\n })\n\n h ??= height\n minH ??= minHeight\n\n const css: CSSUIObject = {\n w: \"100%\",\n h: \"fit-content\",\n color,\n ...styles.container,\n }\n\n return (\n <AutocompleteDescendantsContextProvider value={descendants}>\n <AutocompleteProvider\n value={{\n ...rest,\n value,\n onClose,\n formControlProps,\n inputValue,\n allowCreate,\n isEmpty,\n styles,\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 separator={separator}\n keepPlaceholder={keepPlaceholder}\n h={h}\n minH={minH}\n inputProps={inputProps}\n {...getFieldProps(fieldProps, ref)}\n />\n\n {isClearable && 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 {!isEmpty ? (\n <Portal {...portalProps}>\n <AutocompleteList\n header={runIfFunc(header, { value, onClose })}\n footer={runIfFunc(footer, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {allowCreate ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n\n {children ?? computedChildren}\n </AutocompleteList>\n </Portal>\n ) : (\n <Portal {...portalProps}>\n <AutocompleteList\n header={runIfFunc(header, { value, onClose })}\n footer={runIfFunc(footer, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {allowCreate && inputValue ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n </AutocompleteList>\n </Portal>\n )}\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\" | \"separator\" | \"keepPlaceholder\" | \"inputProps\"\n > {}\n\nconst MultiAutocompleteField = forwardRef<MultiAutocompleteFieldProps, \"input\">(\n (\n {\n className,\n component,\n separator = \",\",\n keepPlaceholder,\n h,\n minH,\n placeholder,\n inputProps,\n ...rest\n },\n ref,\n ) => {\n const { value, label, inputValue, onChange, isOpen, inputRef, styles } =\n useAutocompleteContext()\n\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 const onRemove: MouseEventHandler<HTMLElement> = (ev) => {\n ev.stopPropagation()\n\n onChange(value[index])\n\n if (inputRef.current) inputRef.current.focus()\n }\n\n const el = component({\n value: value[index],\n label,\n index,\n onRemove,\n })\n\n const style: CSSProperties = {\n marginBlockStart: \"0.125rem\",\n marginBlockEnd: \"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 pe: \"2rem\",\n h,\n minH,\n display: \"flex\",\n flexWrap: \"wrap\",\n alignItems: \"center\",\n ...styles.field,\n cursor: \"text\",\n }\n\n return (\n <PopoverTrigger>\n <ui.div\n className={cx(\"ui-multi-autocomplete__field\", className)}\n __css={css}\n py={label?.length && component ? \"0.125rem\" : undefined}\n {...rest}\n >\n {cloneChildren}\n\n <ui.input\n aria-label=\"Input value\"\n className=\"ui-multi-autocomplete__field__input\"\n display=\"inline-block\"\n flex=\"1\"\n minW=\"0px\"\n overflow=\"hidden\"\n marginBlockStart=\"0.125rem\"\n marginBlockEnd=\"0.125rem\"\n aria-multiselectable=\"true\"\n placeholder={\n !label || !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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,eA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AAW,mBAAG,gCAAgC,SAAS;AAAA,QACvD,OAAO;AAAA,QACP,KAAI,+BAAO,WAAU,YAAY,aAAa;AAAA,QAC7C,GAAG;AAAA,QAEH;AAAA;AAAA,UAED;AAAA,YAAC,iBAAG;AAAA,YAAH;AAAA,cACC,cAAW;AAAA,cACX,WAAU;AAAA,cACV,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,MAAK;AAAA,cACL,UAAS;AAAA,cACT,kBAAiB;AAAA,cACjB,gBAAe;AAAA,cACf,wBAAqB;AAAA,cACrB,aACE,CAAC,SAAS,EAAC,+BAAO,WAAW,mBAAmB,SAC5C,cACA;AAAA,cAEL,GAAG,cAAc,EAAE,GAAG,YAAY,OAAO,kCAAc,GAAG,GAAG,GAAG;AAAA;AAAA,UACnE;AAAA;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;AAEA,uBAAuB,cAAc;AACrC,uBAAuB,SAAS;","names":["import_core","import_popover","import_utils","import_core","import_utils","import_utils","import_utils","import_react","props","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_utils","import_react","import_jsx_runtime","import_core","import_utils","import_react","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_core","import_utils","import_react","import_jsx_runtime","import_jsx_runtime","items","label","value","props","i","id","index","isHit","isFocused","enabledValues","selectedValues","node","import_jsx_runtime","import_core","import_popover","import_portal","import_utils","import_react","import_jsx_runtime","label","value"]}
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/autocomplete.tsx","../src/autocomplete-context.ts","../src/autocomplete-create.tsx","../src/autocomplete-icon.tsx","../src/use-autocomplete-option.ts","../src/autocomplete-empty.tsx","../src/autocomplete-list.tsx","../src/use-autocomplete-list.ts","../src/use-autocomplete.tsx","../src/autocomplete-option.tsx","../src/autocomplete-option-group.tsx","../src/use-autocomplete-option-group.ts","../src/multi-autocomplete.tsx"],"sourcesContent":["export { Autocomplete } from \"./autocomplete\"\nexport type { AutocompleteProps } from \"./autocomplete\"\nexport { AutocompleteOptionGroup } from \"./autocomplete-option-group\"\nexport type { AutocompleteOptionGroupProps } from \"./autocomplete-option-group\"\nexport { AutocompleteOption } from \"./autocomplete-option\"\nexport type { AutocompleteOptionProps } from \"./autocomplete-option\"\nexport { AutocompleteCreate } from \"./autocomplete-create\"\nexport type { AutocompleteCreateProps } from \"./autocomplete-create\"\nexport { AutocompleteEmpty } from \"./autocomplete-empty\"\nexport type { AutocompleteEmptyProps } from \"./autocomplete-empty\"\nexport { MultiAutocomplete } from \"./multi-autocomplete\"\nexport type { MultiAutocompleteProps } from \"./multi-autocomplete\"\nexport type { AutocompleteItem } from \"./use-autocomplete\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { Popover, PopoverTrigger } from \"@yamada-ui/popover\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport type { FC, ReactNode } from \"react\"\nimport {\n AutocompleteDescendantsContextProvider,\n AutocompleteProvider,\n useAutocompleteContext,\n} from \"./autocomplete-context\"\nimport { AutocompleteCreate } from \"./autocomplete-create\"\nimport type { AutocompleteCreateProps } from \"./autocomplete-create\"\nimport { AutocompleteEmpty } from \"./autocomplete-empty\"\nimport type { AutocompleteEmptyProps } from \"./autocomplete-empty\"\nimport type { AutocompleteIconProps } from \"./autocomplete-icon\"\nimport { AutocompleteIcon } from \"./autocomplete-icon\"\nimport type { AutocompleteListProps } from \"./autocomplete-list\"\nimport { AutocompleteList } from \"./autocomplete-list\"\nimport type { UseAutocompleteProps } from \"./use-autocomplete\"\nimport { useAutocomplete, useAutocompleteInput } from \"./use-autocomplete\"\n\ninterface AutocompleteOptions {\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: string\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: string\n /**\n * Props for autocomplete container element.\n */\n containerProps?: Omit<HTMLUIProps, \"children\">\n /**\n * Props for autocomplete content element.\n */\n contentProps?: Omit<MotionProps, \"children\">\n /**\n * Props for autocomplete list element.\n */\n listProps?: Omit<AutocompleteListProps, \"children\">\n /**\n * Props for autocomplete field element.\n */\n fieldProps?: Omit<AutocompleteFieldProps, \"inputProps\" | \"children\">\n /**\n * Props for autocomplete input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for autocomplete icon element.\n */\n iconProps?: AutocompleteIconProps\n /**\n * Props to be forwarded to the portal component.\n *\n * @default '{ isDisabled: true }'\n */\n portalProps?: Omit<PortalProps, \"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 * The header of the autocomplete content element.\n */\n header?: ReactNode | FC<{ value: string | undefined; onClose: () => void }>\n /**\n * The footer of the autocomplete content element.\n */\n footer?: ReactNode | FC<{ value: string | undefined; onClose: () => void }>\n}\n\nexport interface AutocompleteProps\n extends ThemeProps<\"Autocomplete\">,\n Omit<UseAutocompleteProps, \"maxSelectValues\" | \"omitSelectedValues\">,\n AutocompleteOptions {}\n\n/**\n * `Autocomplete` is a component used to display suggestions in response to user text input.\n *\n * @see Docs https://yamada-ui.com/components/forms/autocomplete\n */\nexport const Autocomplete = forwardRef<AutocompleteProps, \"input\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Autocomplete\", props)\n let {\n className,\n defaultValue = \"\",\n color,\n h,\n height,\n minH,\n minHeight,\n containerProps,\n contentProps,\n listProps,\n fieldProps,\n inputProps,\n iconProps,\n portalProps = { isDisabled: true },\n createProps,\n emptyProps,\n header,\n footer,\n children,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n const {\n value,\n onClose,\n descendants,\n formControlProps,\n getPopoverProps,\n getContainerProps,\n getFieldProps,\n allowCreate,\n isEmpty,\n inputValue,\n computedChildren,\n ...rest\n } = useAutocomplete({ ...computedProps, defaultValue, children })\n\n h ??= height\n minH ??= minHeight\n\n const css: CSSUIObject = {\n w: \"100%\",\n h: \"fit-content\",\n color,\n ...styles.container,\n }\n\n return (\n <AutocompleteDescendantsContextProvider value={descendants}>\n <AutocompleteProvider\n value={{\n ...rest,\n value,\n onClose,\n formControlProps,\n inputValue,\n allowCreate,\n isEmpty,\n styles,\n }}\n >\n <Popover {...getPopoverProps()}>\n <ui.div\n className={cx(\"ui-autocomplete\", className)}\n __css={css}\n {...getContainerProps(containerProps)}\n >\n <ui.div\n className=\"ui-autocomplete__inner\"\n __css={{ position: \"relative\", ...styles.inner }}\n >\n <AutocompleteField\n h={h}\n minH={minH}\n inputProps={inputProps}\n {...getFieldProps(fieldProps, ref)}\n />\n\n <AutocompleteIcon {...iconProps} {...formControlProps} />\n </ui.div>\n\n {!isEmpty ? (\n <Portal {...portalProps}>\n <AutocompleteList\n header={runIfFunc(header, { value, onClose })}\n footer={runIfFunc(footer, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {allowCreate ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n\n {children ?? computedChildren}\n </AutocompleteList>\n </Portal>\n ) : (\n <Portal {...portalProps}>\n <AutocompleteList\n header={runIfFunc(header, { value, onClose })}\n footer={runIfFunc(footer, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {allowCreate && inputValue ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n </AutocompleteList>\n </Portal>\n )}\n </ui.div>\n </Popover>\n </AutocompleteProvider>\n </AutocompleteDescendantsContextProvider>\n )\n },\n)\n\nAutocomplete.displayName = \"Autocomplete\"\nAutocomplete.__ui__ = \"Autocomplete\"\n\ninterface AutocompleteFieldProps\n extends HTMLUIProps,\n Pick<AutocompleteProps, \"inputProps\"> {}\n\nconst AutocompleteField = forwardRef<AutocompleteFieldProps, \"input\">(\n ({ className, h, minH, placeholder, inputProps, ...rest }, ref) => {\n const { label, inputValue, styles } = useAutocompleteContext()\n const { getInputProps } = useAutocompleteInput()\n\n const css: CSSUIObject = {\n pe: \"2rem\",\n h,\n minH,\n display: \"flex\",\n alignItems: \"center\",\n ...styles.field,\n cursor: \"text\",\n }\n\n return (\n <PopoverTrigger>\n <ui.div\n className={cx(\"ui-autocomplete__field\", className)}\n __css={css}\n {...rest}\n >\n <ui.input\n className=\"ui-autocomplete__field__input\"\n display=\"inline-block\"\n w=\"100%\"\n placeholder={placeholder}\n {...getInputProps(\n { ...inputProps, value: inputValue || label || \"\" },\n ref,\n )}\n />\n </ui.div>\n </PopoverTrigger>\n )\n },\n)\n\nAutocompleteField.displayName = \"AutocompleteField\"\nAutocompleteField.__ui__ = \"AutocompleteField\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { Dispatch, DOMAttributes, RefObject, SetStateAction } from \"react\"\nimport type { ChangeOptions, UseAutocompleteProps } from \"./use-autocomplete\"\n\nexport const {\n DescendantsContextProvider: AutocompleteDescendantsContextProvider,\n useDescendantsContext: useAutocompleteDescendantsContext,\n useDescendants: useAutocompleteDescendants,\n useDescendant: useAutocompleteDescendant,\n} = createDescendant()\n\ninterface AutocompleteContext\n extends Omit<\n UseAutocompleteProps,\n \"value\" | \"defaultValue\" | \"onChange\" | \"onCreate\"\n > {\n value: string | string[]\n label: string | string[] | undefined\n inputValue: string\n isHit: boolean\n isEmpty: boolean\n isAllSelected: boolean\n onChange: (newValue: string, options?: ChangeOptions) => void\n onChangeLabel: (newValue: string, options?: ChangeOptions) => void\n pickOptions: (value: string) => void\n rebirthOptions: (runFocus?: boolean) => void\n inputProps: DOMAttributes<HTMLInputElement>\n isOpen: boolean\n onOpen: () => void\n onClose: () => void\n onCreate: () => void\n onFocusFirst: () => void\n onFocusLast: () => void\n onFocusNext: (index?: number) => void\n onFocusPrev: (index?: number) => void\n focusedIndex: number\n setFocusedIndex: Dispatch<SetStateAction<number>>\n listRef: RefObject<HTMLUListElement>\n inputRef: RefObject<HTMLInputElement>\n formControlProps: { [key: string]: any }\n styles: { [key: string]: CSSUIObject }\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","import type { CSSUIObject, FC, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport type { ReactElement } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { AutocompleteItemIcon } from \"./autocomplete-icon\"\nimport { useAutocompleteCreate } from \"./use-autocomplete-option\"\n\ninterface AutocompleteCreateOptions {\n /**\n * The autocomplete create option icon to use.\n */\n icon?: ReactElement\n /**\n * The label of the autocomplete create option.\n */\n children?: string | ((inputValue: string) => string)\n}\n\nexport interface AutocompleteCreateProps\n extends Omit<HTMLUIProps<\"li\">, \"children\">,\n AutocompleteCreateOptions {}\n\nexport const AutocompleteCreate = forwardRef<AutocompleteCreateProps, \"li\">(\n ({ className, icon, children, ...rest }, ref) => {\n const { inputValue, styles } = useAutocompleteContext()\n const { getCreateProps } = useAutocompleteCreate()\n\n children ??= inputValue\n\n const css: CSSUIObject = {\n textDecoration: \"none\",\n color: \"inherit\",\n userSelect: \"none\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n textAlign: \"start\",\n flex: \"0 0 auto\",\n outline: 0,\n gap: \"0.75rem\",\n ...styles.item,\n }\n\n return (\n <ui.li\n className={cx(\"ui-autocomplete__item--create\", className)}\n __css={css}\n {...getCreateProps(rest, ref)}\n >\n {icon !== null ? (\n <AutocompleteItemIcon>\n {icon || <AutocompletePlusIcon />}\n </AutocompleteItemIcon>\n ) : null}\n {icon ? (\n <ui.span style={{ pointerEvents: \"none\", flex: 1 }} lineClamp={1}>\n {runIfFunc(children, inputValue)}\n </ui.span>\n ) : (\n runIfFunc(children, inputValue)\n )}\n </ui.li>\n )\n },\n)\n\nAutocompleteCreate.displayName = \"AutocompleteCreate\"\nAutocompleteCreate.__ui__ = \"AutocompleteCreate\"\n\nconst AutocompletePlusIcon: FC = () => (\n <svg viewBox=\"0 0 45.402 45.402\" width=\"1em\" height=\"1em\">\n <path\n fill=\"currentColor\"\n d=\"M41.267,18.557H26.832V4.134C26.832,1.851,24.99,0,22.707,0c-2.283,0-4.124,1.851-4.124,4.135v14.432H4.141 c-2.283,0-4.139,1.851-4.138,4.135c-0.001,1.141,0.46,2.187,1.207,2.934c0.748,0.749,1.78,1.222,2.92,1.222h14.453V41.27 c0,1.142,0.453,2.176,1.201,2.922c0.748,0.748,1.777,1.211,2.919,1.211c2.282,0,4.129-1.851,4.129-4.133V26.857h14.435 c2.283,0,4.134-1.867,4.133-4.15C45.399,20.425,43.548,18.557,41.267,18.557z\"\n />\n </svg>\n)\n\nAutocompletePlusIcon.displayName = \"AutocompletePlusIcon\"\nAutocompletePlusIcon.__ui__ = \"AutocompletePlusIcon\"\n","import type { CSSUIObject, FC, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { ChevronIcon, CloseIcon } from \"@yamada-ui/icon\"\nimport { useClickable } from \"@yamada-ui/use-clickable\"\nimport { cx, getValidChildren, isValidElement } from \"@yamada-ui/utils\"\nimport type { HTMLAttributes } from \"react\"\nimport { cloneElement, useRef } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\n\nexport interface AutocompleteIconProps extends HTMLUIProps {}\n\nexport const AutocompleteIcon = forwardRef<AutocompleteIconProps, \"div\">(\n ({ className, children, __css, ...rest }, ref) => {\n const { styles } = useAutocompleteContext()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n pointerEvents: \"none\",\n cursor: \"pointer\",\n ...styles.icon,\n ...__css,\n }\n\n const validChildren = getValidChildren(children)\n\n const cloneChildren = validChildren.map((child) =>\n cloneElement(child, {\n focusable: false,\n \"aria-hidden\": true,\n style: {\n maxWidth: \"1em\",\n maxHeight: \"1em\",\n color: \"currentColor\",\n },\n }),\n )\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-autocomplete__icon\", className)}\n __css={css}\n {...rest}\n >\n {isValidElement(children) ? cloneChildren : <ChevronIcon />}\n </ui.div>\n )\n },\n)\n\nAutocompleteIcon.displayName = \"AutocompleteIcon\"\nAutocompleteIcon.__ui__ = \"AutocompleteIcon\"\n\nexport interface AutocompleteClearIconProps extends AutocompleteIconProps {\n disabled?: boolean\n}\n\nexport const AutocompleteClearIcon: FC<AutocompleteClearIconProps> = ({\n className,\n children,\n ...props\n}) => {\n const ref = useRef<HTMLDivElement>(null)\n const { styles } = useAutocompleteContext()\n\n const isDisabled = props.disabled\n\n const rest = useClickable({\n ref,\n isDisabled,\n ...(props as HTMLAttributes<HTMLElement>),\n })\n\n return (\n <AutocompleteIcon\n aria-label=\"Clear value\"\n className={cx(\"ui-autocomplete__icon--clear\", className)}\n __css={styles.clearIcon}\n {...rest}\n >\n {children ?? <CloseIcon w=\"0.5em\" h=\"0.5em\" />}\n </AutocompleteIcon>\n )\n}\n\nAutocompleteClearIcon.displayName = \"AutocompleteClearIcon\"\nAutocompleteClearIcon.__ui__ = \"AutocompleteClearIcon\"\n\nexport interface AutocompleteItemIconProps extends HTMLUIProps<\"span\"> {}\n\nexport const AutocompleteItemIcon = forwardRef<\n AutocompleteItemIconProps,\n \"span\"\n>(({ className, ...rest }, ref) => {\n const { styles } = useAutocompleteContext()\n\n const css: CSSUIObject = {\n flexShrink: 0,\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.85em\",\n ...styles.itemIcon,\n }\n\n return (\n <ui.span\n ref={ref}\n className={cx(\"ui-autocomplete__item__icon\", className)}\n __css={css}\n {...rest}\n />\n )\n})\n\nAutocompleteItemIcon.displayName = \"AutocompleteItemIcon\"\nAutocompleteItemIcon.__ui__ = \"AutocompleteItemIcon\"\n","import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport {\n ariaAttr,\n dataAttr,\n handlerAll,\n isArray,\n isHTMLElement,\n mergeRefs,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport type { CSSProperties, MouseEvent } from \"react\"\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<\"li\">, \"value\" | \"children\"> {\n /**\n * The value of the autocomplete option.\n */\n value?: string\n /**\n * The label of the autocomplete option.\n */\n children?: string\n /**\n * If `true`, the autocomplete option will be disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, the autocomplete option will be focusable.\n *\n * @default false\n */\n isFocusable?: boolean\n /**\n * If `true`, the list element will be closed when selected.\n *\n * @default false\n */\n closeOnSelect?: boolean\n}\n\nexport const useAutocompleteOption = (props: UseAutocompleteOptionProps) => {\n const {\n value,\n omitSelectedValues,\n onChange,\n onChangeLabel,\n focusedIndex,\n setFocusedIndex,\n onClose,\n closeOnSelect: generalCloseOnSelect,\n optionProps,\n inputRef,\n onFocusNext,\n } = useAutocompleteContext()\n const id = useId()\n\n let {\n icon: customIcon,\n isDisabled,\n isFocusable,\n closeOnSelect: customCloseOnSelect,\n children,\n value: optionValue,\n ...computedProps\n } = { ...optionProps, ...props }\n\n const trulyDisabled = !!isDisabled && !isFocusable\n\n const itemRef = useRef<HTMLLIElement>(null)\n\n const { index, register, descendants } = useAutocompleteDescendant({\n disabled: trulyDisabled,\n })\n\n const values = descendants.values()\n const frontValues = values.slice(0, index)\n\n const isMulti = isArray(value)\n const isDuplicated = !isMulti\n ? frontValues.some(({ node }) => node.dataset.value === (optionValue ?? \"\"))\n : false\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 const onClick = useCallback(\n (ev: MouseEvent<HTMLLIElement>) => {\n ev.stopPropagation()\n\n if (isDisabled) {\n if (inputRef.current) inputRef.current.focus()\n\n return\n }\n\n if (!isTargetOption(ev.currentTarget)) {\n if (inputRef.current) inputRef.current.focus()\n\n return\n }\n\n setFocusedIndex(index)\n\n onChange(optionValue ?? \"\")\n\n if (inputRef.current) inputRef.current.focus()\n\n if (customCloseOnSelect ?? generalCloseOnSelect) onClose()\n\n if (omitSelectedValues) onFocusNext(index)\n },\n [\n onFocusNext,\n omitSelectedValues,\n isDisabled,\n optionValue,\n setFocusedIndex,\n index,\n onChange,\n customCloseOnSelect,\n generalCloseOnSelect,\n onClose,\n inputRef,\n ],\n )\n\n useUpdateEffect(() => {\n if (isSelected) onChangeLabel(optionValue ?? \"\", { runOmit: false })\n }, [optionValue])\n\n const getOptionProps: PropGetter<\"li\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n }\n\n return {\n ref: mergeRefs(itemRef, ref, register),\n id,\n role: \"option\",\n ...computedProps,\n ...props,\n tabIndex: -1,\n style:\n !isTarget || (omitSelectedValues && isSelected) ? style : undefined,\n \"data-target\": dataAttr(true),\n \"data-value\": optionValue ?? \"\",\n \"data-focus\": dataAttr(isFocused),\n \"data-disabled\": dataAttr(isDisabled),\n \"aria-checked\": isSelected,\n \"aria-disabled\": ariaAttr(isDisabled),\n onClick: handlerAll(computedProps.onClick, props.onClick, onClick),\n }\n },\n [\n id,\n optionValue,\n computedProps,\n isDisabled,\n isFocused,\n isSelected,\n isTarget,\n omitSelectedValues,\n onClick,\n register,\n ],\n )\n\n return {\n isSelected,\n isFocused,\n customIcon,\n children,\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<\"li\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n }\n\n return {\n ref,\n ...props,\n tabIndex: -1,\n style: isHit ? style : undefined,\n \"data-focus\": dataAttr(!isHit),\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 { isHit, isEmpty } = useAutocompleteContext()\n\n const getEmptyProps: PropGetter<\"li\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n }\n\n return {\n ref,\n ...props,\n tabIndex: -1,\n style: isHit && !isEmpty ? style : undefined,\n }\n },\n [isHit, isEmpty],\n )\n\n return { getEmptyProps }\n}\n\nexport type UseAutocompleteEmptyReturn = ReturnType<typeof useAutocompleteEmpty>\n","import type { CSSUIObject, FC, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { ReactElement } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { AutocompleteItemIcon } from \"./autocomplete-icon\"\nimport { useAutocompleteEmpty } from \"./use-autocomplete-option\"\n\ninterface AutocompleteEmptyOptions {\n /**\n * The autocomplete empty option icon to use.\n */\n icon?: ReactElement\n /**\n * The label of the autocomplete empty option.\n */\n children?: string\n}\n\nexport interface AutocompleteEmptyProps\n extends Omit<HTMLUIProps<\"li\">, \"children\">,\n AutocompleteEmptyOptions {}\n\nexport const AutocompleteEmpty = forwardRef<AutocompleteEmptyProps, \"li\">(\n ({ className, icon, children, ...rest }, ref) => {\n const { emptyMessage, styles } = useAutocompleteContext()\n const { getEmptyProps } = useAutocompleteEmpty()\n\n children ??= emptyMessage\n\n const css: CSSUIObject = {\n textDecoration: \"none\",\n color: \"inherit\",\n userSelect: \"none\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n textAlign: \"start\",\n flex: \"0 0 auto\",\n outline: 0,\n gap: \"0.75rem\",\n pointerEvents: \"none\",\n ...styles.item,\n }\n\n return (\n <ui.li\n className={cx(\"ui-autocomplete__item--empty\", className)}\n __css={css}\n {...getEmptyProps(rest, ref)}\n >\n {icon !== null ? (\n <AutocompleteItemIcon>\n {icon || <AutocompleteMinusIcon />}\n </AutocompleteItemIcon>\n ) : null}\n {icon ? (\n <ui.span style={{ pointerEvents: \"none\", flex: 1 }} lineClamp={1}>\n {children}\n </ui.span>\n ) : (\n children\n )}\n </ui.li>\n )\n },\n)\n\nAutocompleteEmpty.displayName = \"AutocompleteEmpty\"\nAutocompleteEmpty.__ui__ = \"AutocompleteEmpty\"\n\nconst AutocompleteMinusIcon: FC = () => (\n <svg viewBox=\"0 0 448 512\" width=\"1em\" height=\"1em\">\n <path\n fill=\"currentColor\"\n d=\"M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z\"\n />\n </svg>\n)\n\nAutocompleteMinusIcon.displayName = \"AutocompleteMinusIcon\"\nAutocompleteMinusIcon.__ui__ = \"AutocompleteMinusIcon\"\n","import type { CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport type { MotionPropsWithoutChildren } from \"@yamada-ui/motion\"\nimport { PopoverContent } from \"@yamada-ui/popover\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport type { ReactNode } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { useAutocompleteList } from \"./use-autocomplete-list\"\n\nexport interface AutocompleteListProps extends HTMLUIProps<\"ul\"> {\n contentProps?: MotionPropsWithoutChildren\n header?: ReactNode\n footer?: ReactNode\n}\n\nexport const AutocompleteList = forwardRef<AutocompleteListProps, \"ul\">(\n (\n {\n className,\n w,\n width,\n minW,\n minWidth,\n maxW,\n maxWidth,\n contentProps,\n header,\n footer,\n children,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useAutocompleteContext()\n const { onAnimationComplete, 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 width={width}\n minWidth={minWidth}\n maxWidth={maxWidth}\n __css={{ ...styles.content, width, minWidth, maxWidth }}\n {...contentProps}\n onAnimationComplete={handlerAll(\n contentProps?.onAnimationComplete,\n onAnimationComplete,\n )}\n >\n {header ? (\n <ui.div\n className=\"ui-autocomplete__header\"\n __css={{ ...styles.header }}\n >\n {header}\n </ui.div>\n ) : null}\n\n <ui.ul\n className={cx(\"ui-autocomplete__list\", className)}\n __css={{ ...styles.list }}\n {...getListProps(rest, ref)}\n >\n {children}\n </ui.ul>\n\n {footer ? (\n <ui.div\n className=\"ui-autocomplete__footer\"\n __css={{ ...styles.footer }}\n >\n {footer}\n </ui.div>\n ) : null}\n </PopoverContent>\n )\n },\n)\n\nAutocompleteList.displayName = \"AutocompleteList\"\nAutocompleteList.__ui__ = \"AutocompleteList\"\n","import type { PropGetter } from \"@yamada-ui/core\"\nimport { mergeRefs, useUpdateEffect } from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useId, useRef } from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendantsContext,\n} from \"./autocomplete-context\"\n\nexport const useAutocompleteList = () => {\n const uuid = useId()\n const { focusedIndex, isOpen, listRef, rebirthOptions } =\n useAutocompleteContext()\n\n const descendants = useAutocompleteDescendantsContext()\n\n const beforeFocusedIndex = useRef<number>(-1)\n const selectedValue = descendants.value(focusedIndex)\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 getListProps: PropGetter<\"ul\"> = useCallback(\n (props = {}, ref = null) => ({\n as: \"ul\",\n ref: mergeRefs(listRef, ref),\n role: \"listbox\",\n tabIndex: -1,\n position: \"relative\",\n id: props.id ?? uuid,\n ...props,\n }),\n [listRef, uuid],\n )\n\n return {\n onAnimationComplete,\n getListProps,\n }\n}\n","import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport { layoutStyleProperties } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport type { ComboBoxProps, PopoverProps } from \"@yamada-ui/popover\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useDisclosure } from \"@yamada-ui/use-disclosure\"\nimport { useOutsideClick } from \"@yamada-ui/use-outside-click\"\nimport type { Union } from \"@yamada-ui/utils\"\nimport {\n dataAttr,\n funcAll,\n getEventRelatedTarget,\n handlerAll,\n isArray,\n isContains,\n mergeRefs,\n pickObject,\n splitObject,\n useUnmountEffect,\n useUpdateEffect,\n getValidChildren,\n isUndefined,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\"\nimport type {\n ChangeEvent,\n DOMAttributes,\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n} from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendants,\n useAutocompleteDescendantsContext,\n} from \"./autocomplete-context\"\nimport { AutocompleteOption } from \"./autocomplete-option\"\nimport type { AutocompleteOptionProps } from \"./autocomplete-option\"\nimport type { AutocompleteOptionGroupProps } from \"./autocomplete-option-group\"\nimport { AutocompleteOptionGroup } from \"./autocomplete-option-group\"\n\nexport interface ChangeOptions {\n forceUpdate?: boolean\n runOmit?: boolean\n runRebirth?: boolean\n}\n\ninterface AutocompleteItemWithValue extends AutocompleteOptionProps {\n label?: string\n value?: string\n}\n\ninterface AutocompleteItemWithItems\n extends AutocompleteOptionGroupProps,\n Pick<AutocompleteOptionProps, \"isDisabled\" | \"isFocusable\"> {\n items?: AutocompleteItemWithValue[]\n}\n\nexport type AutocompleteItem =\n | AutocompleteItemWithValue\n | AutocompleteItemWithItems\n\nconst kanaMap: { [key: string]: string } = {\n ガ: \"ガ\",\n ギ: \"ギ\",\n グ: \"グ\",\n ゲ: \"ゲ\",\n ゴ: \"ゴ\",\n ザ: \"ザ\",\n ジ: \"ジ\",\n ズ: \"ズ\",\n ゼ: \"ゼ\",\n ゾ: \"ゾ\",\n ダ: \"ダ\",\n ヂ: \"ヂ\",\n ヅ: \"ヅ\",\n デ: \"デ\",\n ド: \"ド\",\n バ: \"バ\",\n ビ: \"ビ\",\n ブ: \"ブ\",\n ベ: \"ベ\",\n ボ: \"ボ\",\n パ: \"パ\",\n ピ: \"ピ\",\n プ: \"プ\",\n ペ: \"ペ\",\n ポ: \"ポ\",\n ヴ: \"ヴ\",\n ヷ: \"ヷ\",\n ヺ: \"ヺ\",\n ア: \"ア\",\n イ: \"イ\",\n ウ: \"ウ\",\n エ: \"エ\",\n オ: \"オ\",\n カ: \"カ\",\n キ: \"キ\",\n ク: \"ク\",\n ケ: \"ケ\",\n コ: \"コ\",\n サ: \"サ\",\n シ: \"シ\",\n ス: \"ス\",\n セ: \"セ\",\n ソ: \"ソ\",\n タ: \"タ\",\n チ: \"チ\",\n ツ: \"ツ\",\n テ: \"テ\",\n ト: \"ト\",\n ナ: \"ナ\",\n ニ: \"ニ\",\n ヌ: \"ヌ\",\n ネ: \"ネ\",\n ノ: \"ノ\",\n ハ: \"ハ\",\n ヒ: \"ヒ\",\n フ: \"フ\",\n ヘ: \"ヘ\",\n ホ: \"ホ\",\n マ: \"マ\",\n ミ: \"ミ\",\n ム: \"ム\",\n メ: \"メ\",\n モ: \"モ\",\n ヤ: \"ヤ\",\n ユ: \"ユ\",\n ヨ: \"ヨ\",\n ラ: \"ラ\",\n リ: \"リ\",\n ル: \"ル\",\n レ: \"レ\",\n ロ: \"ロ\",\n ワ: \"ワ\",\n ヲ: \"ヲ\",\n ン: \"ン\",\n ァ: \"ァ\",\n ィ: \"ィ\",\n ゥ: \"ゥ\",\n ェ: \"ェ\",\n ォ: \"ォ\",\n ッ: \"ッ\",\n ャ: \"ャ\",\n ュ: \"ュ\",\n ョ: \"ョ\",\n \"。\": \"。\",\n \"、\": \"、\",\n ー: \"ー\",\n \"「\": \"「\",\n \"」\": \"」\",\n \"・\": \"・\",\n}\n\nconst defaultFormat = (value: string) => {\n value = value.replace(/[!-~]/g, (v) =>\n String.fromCharCode(v.charCodeAt(0) - 0xfee0),\n )\n\n const reg = new RegExp(\"(\" + Object.keys(kanaMap).join(\"|\") + \")\", \"g\")\n\n value = value\n .replace(reg, (v) => kanaMap[v])\n .replace(/゙/g, \"゛\")\n .replace(/゚/g, \"゜\")\n\n value = value.toUpperCase()\n\n return value\n}\n\nconst flattenItems = (\n items: AutocompleteItem[],\n): AutocompleteItemWithValue[] => {\n const filterItems = (\n items: AutocompleteItem[] | AutocompleteItemWithValue[],\n ): (AutocompleteItemWithValue | AutocompleteItemWithValue[])[] =>\n items\n .map((item) => {\n const { isDisabled, isFocusable } = item\n const trulyDisabled = !!isDisabled && !isFocusable\n\n if (trulyDisabled) return\n\n if (\"items\" in item) {\n return filterItems(item.items ?? [])\n } else {\n return item as AutocompleteItemWithValue\n }\n })\n .filter(Boolean) as (\n | AutocompleteItemWithValue\n | AutocompleteItemWithValue[]\n )[]\n\n return filterItems(items).flat(Infinity) as AutocompleteItemWithValue[]\n}\n\ntype UseAutocompleteBaseProps<T extends string | string[] = string> =\n ComboBoxProps &\n FormControlOptions & {\n /**\n * The value of the autocomplete.\n */\n value?: T\n /**\n * The initial value of the autocomplete.\n */\n defaultValue?: T\n /**\n * The callback invoked when value state changes.\n */\n onChange?: (value: T) => void\n /**\n * The callback invoked when search input.\n */\n onSearch?: (ev: ChangeEvent<HTMLInputElement>) => void\n /**\n * The callback invoked when autocomplete option created.\n */\n onCreate?: (\n newItem: AutocompleteItem,\n newItems: AutocompleteItem[],\n ) => void\n /**\n * Function to format text when search input.\n */\n format?: (value: string) => string\n /**\n * The position to be inserted when the autocomplete option is created.\n *\n * @default 'first'\n */\n insertPositionItem?: Union<\"first\" | \"last\"> | [string, \"first\" | \"last\"]\n /**\n * If `true`, the list element will be closed when value is selected.\n *\n * @default true\n */\n closeOnSelect?: boolean\n /**\n * The message displayed when the search yields no hits.\n *\n * @default 'No results found'\n */\n emptyMessage?: string\n /**\n * If `true`, enables the creation of autocomplete option.\n *\n * @default false\n */\n allowCreate?: boolean\n /**\n * If `true`, enables the free input.\n */\n allowFree?: boolean\n /**\n * If `true`, the selected item(s) will be excluded from the list.\n *\n * @default false\n */\n omitSelectedValues?: boolean\n /**\n * The maximum selectable value.\n */\n maxSelectValues?: number\n /**\n * Props for select option element.\n */\n optionProps?: Omit<AutocompleteOptionProps, \"value\" | \"children\">\n /**\n * If provided, generate options based on items.\n */\n items?: AutocompleteItem[]\n }\n\nexport type UseAutocompleteProps<T extends string | string[] = string> = Omit<\n HTMLUIProps<\"input\">,\n | keyof UseAutocompleteBaseProps\n | \"list\"\n | \"disabled\"\n | \"required\"\n | \"readOnly\"\n | \"size\"\n> &\n UseAutocompleteBaseProps<T>\n\nexport const useAutocomplete = <T extends string | string[] = string>(\n props: UseAutocompleteProps<T>,\n) => {\n const {\n value: valueProp,\n defaultValue,\n onChange: onChangeProp,\n onCreate: onCreateProp,\n onSearch: onSearchProp,\n closeOnSelect = true,\n omitSelectedValues = false,\n maxSelectValues,\n allowCreate = false,\n allowFree = false,\n insertPositionItem = \"first\",\n emptyMessage = \"No results found\",\n format = defaultFormat,\n optionProps,\n placeholder,\n onKeyDown: onKeyDownProp,\n isOpen: isOpenProp,\n defaultIsOpen,\n onOpen: onOpenProp,\n onClose: onCloseProp,\n closeOnBlur = true,\n closeOnEsc = true,\n openDelay,\n closeDelay,\n isLazy,\n lazyBehavior,\n animation,\n duration = 0.2,\n offset,\n gutter,\n preventOverflow,\n flip,\n matchWidth = true,\n boundary,\n eventListeners,\n strategy,\n placement = \"bottom-start\",\n modifiers,\n items,\n children,\n ...rest\n } = useFormControlProps(props)\n const {\n \"aria-readonly\": _ariaReadonly,\n onFocus: onFocusProp,\n ...formControlProps\n } = pickObject(rest, formControlProperties)\n const [containerProps, inputProps] = splitObject(rest, layoutStyleProperties)\n const { id } = rest\n\n const descendants = useAutocompleteDescendants()\n\n const containerRef = useRef<HTMLDivElement>(null)\n const listRef = useRef<HTMLUListElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n const timeoutIds = useRef<Set<any>>(new Set([]))\n const isComposition = useRef<boolean>(false)\n const prevValue = useRef<T | undefined>(undefined)\n\n const [resolvedItems, setResolvedItems] = useState<\n AutocompleteItem[] | undefined\n >(items ? JSON.parse(JSON.stringify(items)) : undefined)\n const [value, setValue] = useControllableState({\n value: valueProp,\n defaultValue,\n onChange: onChangeProp,\n })\n const [label, setLabel] = useState<T | undefined>(undefined)\n const [inputValue, setInputValue] = useState<string>(\"\")\n const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n const [isAllSelected, setIsAllSelected] = useState<boolean>(false)\n const [isHit, setIsHit] = useState<boolean>(true)\n const {\n isOpen,\n onOpen: onInternalOpen,\n onClose,\n } = useDisclosure({\n isOpen: isOpenProp,\n defaultIsOpen,\n onOpen: onOpenProp,\n onClose: onCloseProp,\n })\n const isFocused = focusedIndex > -1\n const isCreate = focusedIndex === -2 && allowCreate\n const isMulti = isArray(value)\n const isEmptyValue = !isMulti ? !value : !value.length\n\n const [firstInsertPositionItem, secondInsertPositionItem] = useMemo(() => {\n if (isArray(insertPositionItem)) {\n return insertPositionItem\n } else {\n return [insertPositionItem, \"first\"]\n }\n }, [insertPositionItem])\n\n if (allowCreate && !isUndefined(children)) {\n console.warn(\n `${!isMulti ? \"Autocomplete\" : \"MultiAutocomplete\"}: ${\n !isMulti ? \"Autocomplete\" : \"MultiAutocomplete\"\n } internally prefers 'children'. If 'allowCreate' is true, it will not be reflected correctly. If want to reflect, please set 'items' in props.`,\n )\n }\n\n const selectedValues = descendants.enabledValues(\n ({ node }) => isMulti && value.includes(node.dataset.value ?? \"\"),\n )\n const selectedIndexes = selectedValues.map(({ index }) => index)\n const enabledValues = descendants.enabledValues(\n ({ node, index }) =>\n \"target\" in node.dataset && !selectedIndexes.includes(index),\n )\n\n const validChildren = getValidChildren(children)\n\n const computedChildren = useMemo(\n () =>\n resolvedItems?.map((item, i) => {\n if (\"value\" in item) {\n const { label, value, ...props } = item\n\n return (\n <AutocompleteOption key={i} value={value} {...props}>\n {label}\n </AutocompleteOption>\n )\n } else if (\"items\" in item) {\n const { label, items = [], ...props } = item\n\n return (\n <AutocompleteOptionGroup key={i} label={label as string} {...props}>\n {items.map(({ label, value, ...props }, i) => (\n <AutocompleteOption key={i} value={value} {...props}>\n {label}\n </AutocompleteOption>\n ))}\n </AutocompleteOptionGroup>\n )\n }\n }),\n [resolvedItems],\n )\n\n const isEmpty = !validChildren.length && !computedChildren?.length\n\n const onOpen = useCallback(() => {\n if (formControlProps.disabled || formControlProps.readOnly) return\n\n if (!allowCreate && (isEmpty || isAllSelected)) return\n\n onInternalOpen()\n\n if (inputRef.current) inputRef.current.focus()\n }, [allowCreate, formControlProps, isAllSelected, isEmpty, onInternalOpen])\n\n const onFocusFirst = useCallback(() => {\n const id = setTimeout(() => {\n if (isEmpty || isAllSelected) return\n\n const first = descendants.enabledFirstValue(\n ({ node }) => \"target\" in node.dataset,\n )\n\n if (!first) return\n\n if (!isMulti || !omitSelectedValues) {\n setFocusedIndex(first.index)\n } else {\n if (selectedIndexes.includes(first.index)) {\n const enabledFirst = enabledValues[0]\n\n setFocusedIndex(enabledFirst.index)\n } else {\n setFocusedIndex(first.index)\n }\n }\n })\n\n timeoutIds.current.add(id)\n }, [\n descendants,\n enabledValues,\n isAllSelected,\n isEmpty,\n isMulti,\n omitSelectedValues,\n selectedIndexes,\n ])\n\n const onFocusLast = useCallback(() => {\n const id = setTimeout(() => {\n if (isEmpty || isAllSelected) return\n\n const last = descendants.enabledLastValue(\n ({ node }) => \"target\" in node.dataset,\n )\n\n if (!last) return\n\n if (!isMulti || !omitSelectedValues) {\n setFocusedIndex(last.index)\n } else {\n if (selectedIndexes.includes(last.index)) {\n const enabledLast = enabledValues.reverse()[0]\n\n setFocusedIndex(enabledLast.index)\n } else {\n setFocusedIndex(last.index)\n }\n }\n })\n\n timeoutIds.current.add(id)\n }, [\n descendants,\n enabledValues,\n isAllSelected,\n isEmpty,\n isMulti,\n omitSelectedValues,\n selectedIndexes,\n ])\n\n const onFocusSelected = useCallback(() => {\n const id = setTimeout(() => {\n const values = descendants.enabledValues()\n\n const selected = values.find(({ node }) =>\n !isMulti\n ? node.dataset.value === value\n : value.includes(node.dataset.value ?? \"\"),\n )\n\n if (selected) setFocusedIndex(selected.index)\n })\n\n timeoutIds.current.add(id)\n }, [descendants, isMulti, value])\n\n const onFocusNext = useCallback(\n (index: number = focusedIndex) => {\n const id = setTimeout(() => {\n const next = descendants.enabledNextValue(\n index,\n ({ node }) => \"target\" in node.dataset,\n )\n\n if (!next) return\n\n if (!isMulti || !omitSelectedValues) {\n setFocusedIndex(next.index)\n } else {\n if (selectedIndexes.includes(next.index)) {\n const enabledNext =\n enabledValues.find(({ index }) => next.index < index) ??\n enabledValues[0]\n\n setFocusedIndex(enabledNext.index)\n } else {\n setFocusedIndex(next.index)\n }\n }\n })\n\n timeoutIds.current.add(id)\n },\n [\n descendants,\n enabledValues,\n focusedIndex,\n isMulti,\n omitSelectedValues,\n selectedIndexes,\n ],\n )\n\n const onFocusPrev = useCallback(\n (index: number = focusedIndex) => {\n const id = setTimeout(() => {\n const prev = descendants.enabledPrevValue(\n index,\n ({ node }) => \"target\" in node.dataset,\n )\n\n if (!prev) return\n\n if (!isMulti || !omitSelectedValues) {\n setFocusedIndex(prev.index)\n } else {\n if (selectedIndexes.includes(prev.index)) {\n const enabledPrev =\n enabledValues.reverse().find(({ index }) => index < prev.index) ??\n enabledValues[0]\n\n setFocusedIndex(enabledPrev.index)\n } else {\n setFocusedIndex(prev.index)\n }\n }\n })\n\n timeoutIds.current.add(id)\n },\n [\n descendants,\n enabledValues,\n focusedIndex,\n isMulti,\n omitSelectedValues,\n selectedIndexes,\n ],\n )\n\n const onFocusFirstOrSelected =\n isEmptyValue || omitSelectedValues ? onFocusFirst : onFocusSelected\n const onFocusLastOrSelected =\n isEmptyValue || omitSelectedValues ? onFocusLast : onFocusSelected\n\n const pickOptions = useCallback(\n (value: string) => {\n const values = descendants.values()\n\n let isHit = false\n let isFocused = false\n\n values.forEach(({ node, index }) => {\n if (format(node.textContent ?? \"\").includes(value)) {\n isHit = true\n\n const isDisabled = \"disabled\" in node.dataset\n\n node.dataset.target = \"\"\n\n if (!isFocused && !isDisabled) {\n isFocused = true\n\n setFocusedIndex(index)\n }\n } else {\n delete node.dataset.target\n }\n })\n\n setIsHit(isHit)\n },\n [descendants, format],\n )\n\n const rebirthOptions = useCallback(\n (runFocus = true) => {\n const values = descendants.values()\n\n values.forEach(({ node }) => {\n node.dataset.target = \"\"\n })\n\n if (runFocus) onFocusFirst()\n\n setIsHit(true)\n },\n [descendants, onFocusFirst],\n )\n\n const getSelectedValues = useCallback(\n (newValues: string | string[]) => {\n const enabledValues = descendants.enabledValues()\n\n const resolvedValues = isArray(newValues) ? newValues : [newValues]\n\n const selectedValues = resolvedValues\n .map((value) => {\n const { node } =\n enabledValues.find(({ node }) => node.dataset.value === value) ?? {}\n\n if (node) {\n const el = Array.from(node.children).find(\n (child) => child.getAttribute(\"data-label\") !== null,\n )\n\n return el?.textContent ?? undefined\n } else {\n return allowFree ? value : undefined\n }\n })\n .filter(Boolean) as string[]\n\n return selectedValues\n },\n [allowFree, descendants],\n )\n\n const onChangeLabel = useCallback(\n (newValue: string, { forceUpdate, runOmit = true }: ChangeOptions = {}) => {\n const selectedValues = getSelectedValues(newValue)\n\n if (!forceUpdate && !selectedValues.length) return\n\n setLabel((prev) => {\n if (!isMulti) {\n return selectedValues[0] as T\n } else {\n selectedValues.forEach((selectedValue) => {\n const isSelected =\n isArray(prev) && prev.includes(selectedValue ?? \"\")\n\n if (!isSelected) {\n prev = [...(isArray(prev) ? prev : []), selectedValue] as T\n } else if (runOmit) {\n prev = (\n isArray(prev)\n ? prev.filter((value) => value !== selectedValue)\n : undefined\n ) as T\n }\n })\n\n return prev\n }\n })\n },\n [getSelectedValues, isMulti],\n )\n\n const onChange = useCallback(\n (\n newValue: string,\n { forceUpdate, runRebirth = true }: ChangeOptions = {},\n ) => {\n setValue((prev) => {\n let next: T\n\n if (!isArray(prev)) {\n next = newValue as T\n } else {\n const isSelected = prev.includes(newValue)\n\n if (!isSelected) {\n next = [...prev, newValue] as T\n } else {\n next = prev.filter((value) => value !== newValue) as T\n }\n }\n\n prevValue.current = next\n return next\n })\n\n const isHit =\n descendants\n .values()\n .filter(({ node }) =>\n format(node.textContent ?? \"\").includes(newValue),\n ).length > 0\n\n onChangeLabel(newValue, { forceUpdate })\n\n if (allowFree || isHit) setInputValue(\"\")\n\n if (isMulti && runRebirth) rebirthOptions(false)\n },\n [\n allowFree,\n isMulti,\n onChangeLabel,\n rebirthOptions,\n setValue,\n descendants,\n format,\n ],\n )\n\n const onSelect = useCallback(() => {\n let enabledValue = descendants.value(focusedIndex)\n\n if (\"disabled\" in (enabledValue?.node.dataset ?? {}))\n enabledValue = undefined\n\n if (!enabledValue) return\n\n const value = enabledValue.node.dataset.value ?? \"\"\n\n onChange(value)\n\n if (closeOnSelect) onClose()\n\n if (omitSelectedValues) onFocusNext()\n }, [\n closeOnSelect,\n descendants,\n focusedIndex,\n omitSelectedValues,\n onChange,\n onClose,\n onFocusNext,\n ])\n\n const onSearch = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n if (!isOpen) onOpen()\n\n onSearchProp?.(ev)\n\n const value = ev.target.value\n const computedValue = format(value)\n\n if (computedValue) {\n pickOptions(computedValue)\n } else {\n rebirthOptions()\n }\n\n setInputValue(value)\n },\n [isOpen, onOpen, format, onSearchProp, pickOptions, rebirthOptions],\n )\n\n const onCompositionStart = useCallback(() => {\n isComposition.current = true\n }, [])\n\n const onCompositionEnd = useCallback(() => {\n isComposition.current = false\n }, [])\n\n const onCreate = useCallback(() => {\n if (!listRef.current) return\n\n const newItem: AutocompleteItem = { label: inputValue, value: inputValue }\n\n let newItems: AutocompleteItem[] = []\n\n if (resolvedItems) newItems = [...resolvedItems]\n\n if (firstInsertPositionItem === \"first\") {\n newItems = [newItem, ...newItems]\n } else if (firstInsertPositionItem === \"last\") {\n newItems = [...newItems, newItem]\n } else {\n const i = newItems.findIndex(\n ({ label }) => label === firstInsertPositionItem,\n )\n\n const targetItem = newItems[i]\n\n if (i !== -1 && \"items\" in targetItem) {\n if (secondInsertPositionItem === \"first\") {\n targetItem.items = [newItem, ...(targetItem.items ?? [])]\n } else {\n targetItem.items = [...(targetItem.items ?? []), newItem]\n }\n\n newItems[i] = targetItem\n } else {\n console.warn(\n `${\n !isMulti ? \"Autocomplete\" : \"MultiAutocomplete\"\n }: '${firstInsertPositionItem}' specified in insertPositionItem does not exist in the option group.`,\n )\n }\n }\n\n setResolvedItems(newItems)\n onChange(inputValue)\n rebirthOptions(false)\n\n const index = flattenItems(newItems).findIndex(\n ({ value }) => value === inputValue,\n )\n\n setFocusedIndex(index)\n\n onCreateProp?.(newItem, newItems)\n }, [\n inputValue,\n resolvedItems,\n firstInsertPositionItem,\n onChange,\n rebirthOptions,\n onCreateProp,\n secondInsertPositionItem,\n isMulti,\n ])\n\n const onClick = useCallback(() => {\n if (isOpen) {\n if (inputRef.current) inputRef.current.focus()\n } else {\n onOpen()\n\n onFocusFirstOrSelected()\n }\n }, [isOpen, onFocusFirstOrSelected, onOpen])\n\n const onFocus = useCallback(() => {\n if (isOpen) return\n\n onOpen()\n\n onFocusFirstOrSelected()\n }, [isOpen, onFocusFirstOrSelected, onOpen])\n\n const onBlur = useCallback(\n (ev: FocusEvent<HTMLDivElement>) => {\n const relatedTarget = getEventRelatedTarget(ev)\n\n if (isContains(containerRef.current, relatedTarget)) return\n\n if (!closeOnBlur && isHit) return\n\n if (allowFree && !!inputValue) onChange(inputValue, { runRebirth: false })\n\n setInputValue(\"\")\n\n if (isOpen) onClose()\n },\n [closeOnBlur, isHit, isOpen, inputValue, allowFree, onClose, onChange],\n )\n\n const onDelete = useCallback(() => {\n if (!isMulti) {\n onChange(\"\", { forceUpdate: true })\n } else {\n onChange(value[value.length - 1])\n }\n\n if (!isOpen) onFocus()\n }, [isMulti, isOpen, onChange, onFocus, value])\n\n const onClear = useCallback(\n (ev: MouseEvent<HTMLDivElement>) => {\n ev.stopPropagation()\n\n prevValue.current = [] as unknown as T\n setValue([] as unknown as T)\n setLabel(undefined)\n setInputValue(\"\")\n rebirthOptions()\n\n if (isOpen && inputRef.current) inputRef.current.focus()\n },\n [isOpen, setLabel, setInputValue, setValue, rebirthOptions],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLDivElement>) => {\n if (ev.key === \" \") ev.key = ev.code\n\n if (formControlProps.disabled || formControlProps.readOnly) return\n if (isComposition.current) return\n\n const enabledDelete = label === inputValue || !inputValue.length\n\n const actions: { [key: string]: Function | undefined } = {\n ArrowDown: isFocused\n ? () => onFocusNext()\n : !isOpen\n ? funcAll(onOpen, onFocusFirstOrSelected)\n : undefined,\n ArrowUp: isFocused\n ? () => onFocusPrev()\n : !isOpen\n ? funcAll(onOpen, onFocusLastOrSelected)\n : undefined,\n Space: isCreate\n ? onCreate\n : isFocused\n ? onSelect\n : !isOpen\n ? funcAll(onOpen, onFocusFirstOrSelected)\n : undefined,\n Enter: isCreate\n ? onCreate\n : isFocused\n ? onSelect\n : !isOpen\n ? funcAll(onOpen, onFocusFirstOrSelected)\n : allowFree && isMulti\n ? () => {\n if (inputValue) onChange(inputValue)\n\n setFocusedIndex(0)\n }\n : undefined,\n Home: isOpen ? onFocusFirst : undefined,\n End: isOpen ? onFocusLast : undefined,\n Escape: closeOnEsc ? onClose : undefined,\n Backspace: !isEmptyValue && enabledDelete ? onDelete : undefined,\n }\n\n const action = actions[ev.key]\n\n if (!action) return\n\n ev.preventDefault()\n ev.stopPropagation()\n\n action(ev)\n },\n [\n allowFree,\n formControlProps,\n label,\n inputValue,\n onOpen,\n isFocused,\n isMulti,\n onFocusFirstOrSelected,\n onFocusNext,\n onFocusLastOrSelected,\n onFocusPrev,\n isCreate,\n onCreate,\n onSelect,\n isOpen,\n onFocusFirst,\n onFocusLast,\n closeOnEsc,\n onClose,\n isEmptyValue,\n onDelete,\n onChange,\n ],\n )\n\n useEffect(() => {\n if (!isMulti) return\n\n if (!omitSelectedValues && isUndefined(maxSelectValues)) return\n\n const isAll = value.length > 0 && value.length === descendants.count()\n const isMax = value.length === maxSelectValues\n\n if (isAll || isMax) {\n onClose()\n setIsAllSelected(true)\n } else {\n setIsAllSelected(false)\n }\n }, [\n omitSelectedValues,\n value,\n descendants,\n isMulti,\n onClose,\n maxSelectValues,\n ])\n\n useEffect(() => {\n if (isMulti) {\n if (\n JSON.stringify(prevValue.current ?? []) === JSON.stringify(value ?? [])\n )\n return\n\n const label = getSelectedValues(value)\n\n setLabel(label as T)\n } else {\n if (prevValue.current === value) return\n\n onChangeLabel(value, { runOmit: false })\n }\n }, [isMulti, value, onChangeLabel, getSelectedValues])\n\n useUpdateEffect(() => {\n if (isOpen || allowFree) return\n\n setFocusedIndex(-1)\n setInputValue(\"\")\n }, [isOpen])\n\n useUpdateEffect(() => {\n if (!isHit) setFocusedIndex(-2)\n }, [isHit])\n\n useUpdateEffect(() => {\n setResolvedItems(items ? JSON.parse(JSON.stringify(items)) : undefined)\n }, [items])\n\n useUnmountEffect(() => {\n timeoutIds.current.forEach((id) => clearTimeout(id))\n timeoutIds.current.clear()\n })\n\n useOutsideClick({\n ref: containerRef,\n handler: onClose,\n enabled: isOpen && (closeOnBlur || !isHit),\n })\n\n const getPopoverProps = useCallback(\n (props?: PopoverProps): PopoverProps => ({\n closeOnBlur,\n openDelay,\n closeDelay,\n isLazy,\n lazyBehavior,\n animation,\n duration,\n offset,\n gutter,\n preventOverflow,\n flip,\n matchWidth,\n boundary,\n eventListeners,\n strategy,\n placement,\n modifiers,\n ...props,\n trigger: \"never\",\n closeOnButton: false,\n isOpen,\n onOpen,\n onClose,\n }),\n [\n closeOnBlur,\n openDelay,\n closeDelay,\n isLazy,\n lazyBehavior,\n animation,\n duration,\n offset,\n gutter,\n preventOverflow,\n flip,\n matchWidth,\n boundary,\n eventListeners,\n strategy,\n placement,\n modifiers,\n isOpen,\n onOpen,\n onClose,\n ],\n )\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ref: mergeRefs(containerRef, ref),\n ...containerProps,\n ...props,\n ...formControlProps,\n onClick: handlerAll(props.onClick, rest.onClick, onClick),\n onBlur: handlerAll(props.onBlur, rest.onBlur, onBlur),\n }),\n\n [containerProps, formControlProps, onBlur, onClick, rest],\n )\n\n const getFieldProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ref,\n tabIndex: -1,\n ...props,\n ...formControlProps,\n placeholder,\n \"data-active\": dataAttr(isOpen),\n \"aria-expanded\": dataAttr(isOpen),\n onFocus: handlerAll(props.onFocus, onFocusProp, onFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDownProp, onKeyDown),\n }),\n [\n formControlProps,\n placeholder,\n isOpen,\n onFocusProp,\n onFocus,\n onKeyDownProp,\n onKeyDown,\n ],\n )\n\n return {\n id,\n descendants,\n value,\n label,\n inputValue,\n isHit,\n isEmpty,\n computedChildren,\n focusedIndex,\n omitSelectedValues,\n closeOnSelect,\n allowCreate,\n allowFree,\n emptyMessage,\n isOpen,\n isAllSelected,\n listRef,\n inputRef,\n optionProps,\n formControlProps,\n setFocusedIndex,\n onChangeLabel,\n onChange,\n onSearch,\n onCreate,\n onClear,\n onCompositionStart,\n onCompositionEnd,\n pickOptions,\n rebirthOptions,\n onOpen,\n onClose,\n onFocusFirst,\n onFocusLast,\n onFocusSelected,\n onFocusNext,\n onFocusPrev,\n getPopoverProps,\n getContainerProps,\n getFieldProps,\n inputProps: inputProps as DOMAttributes<HTMLInputElement>,\n }\n}\n\nexport type UseAutocompleteReturn = ReturnType<typeof useAutocomplete>\n\nexport const useAutocompleteInput = () => {\n const {\n id,\n inputRef,\n onSearch,\n onCompositionStart,\n onCompositionEnd,\n isAllSelected,\n formControlProps,\n inputProps,\n isOpen,\n focusedIndex,\n listRef,\n } = useAutocompleteContext()\n\n const { value } = useAutocompleteDescendantsContext()\n\n useUpdateEffect(() => {\n if (isAllSelected && inputRef.current) inputRef.current.blur()\n }, [isAllSelected])\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ref: mergeRefs(inputRef, ref),\n ...formControlProps,\n role: \"combobox\",\n \"aria-haspopup\": \"listbox\",\n \"aria-autocomplete\": \"list\",\n \"aria-expanded\": isOpen,\n \"aria-activedescendant\": value(focusedIndex)?.node.id,\n \"aria-controls\": listRef.current?.id,\n autoCapitalize: \"none\",\n autoComplete: \"off\",\n spellCheck: \"false\",\n ...inputProps,\n ...props,\n id,\n cursor: formControlProps.readOnly ? \"default\" : \"text\",\n pointerEvents:\n formControlProps.disabled || isAllSelected ? \"none\" : \"auto\",\n tabIndex: isAllSelected ? -1 : 0,\n onChange: handlerAll(props.onChange, onSearch),\n onCompositionStart: handlerAll(\n props.onCompositionStart,\n inputProps.onCompositionStart,\n onCompositionStart,\n ),\n onCompositionEnd: handlerAll(\n props.onCompositionEnd,\n inputProps.onCompositionEnd,\n onCompositionEnd,\n ),\n }),\n [\n listRef,\n focusedIndex,\n isOpen,\n inputProps,\n inputRef,\n formControlProps,\n id,\n isAllSelected,\n value,\n onSearch,\n onCompositionStart,\n onCompositionEnd,\n ],\n )\n\n return {\n getInputProps,\n }\n}\n\nexport type UseAutocompleteInputReturn = ReturnType<typeof useAutocompleteInput>\n","import type { CSSUIObject, FC } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { ReactElement } from \"react\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport { AutocompleteItemIcon } from \"./autocomplete-icon\"\nimport type { UseAutocompleteOptionProps } from \"./use-autocomplete-option\"\nimport { useAutocompleteOption } from \"./use-autocomplete-option\"\n\ninterface AutocompleteOptionOptions {\n /**\n * The autocomplete option icon to use.\n */\n icon?: ReactElement\n}\n\nexport interface AutocompleteOptionProps\n extends UseAutocompleteOptionProps,\n AutocompleteOptionOptions {}\n\nexport const AutocompleteOption = forwardRef<AutocompleteOptionProps, \"li\">(\n ({ className, icon, ...rest }, ref) => {\n const { styles } = useAutocompleteContext()\n const { isSelected, customIcon, children, getOptionProps } =\n useAutocompleteOption(rest)\n\n icon ??= customIcon\n\n const css: CSSUIObject = {\n textDecoration: \"none\",\n color: \"inherit\",\n userSelect: \"none\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n textAlign: \"start\",\n flex: \"0 0 auto\",\n outline: 0,\n gap: \"0.75rem\",\n ...styles.item,\n }\n\n return (\n <ui.li\n className={cx(\"ui-autocomplete__item\", className)}\n __css={css}\n {...getOptionProps({}, ref)}\n >\n {icon !== null ? (\n <AutocompleteItemIcon opacity={isSelected ? 1 : 0}>\n {icon || <AutocompleteCheckIcon />}\n </AutocompleteItemIcon>\n ) : null}\n\n <ui.span style={{ flex: 1 }} data-label>\n {children}\n </ui.span>\n </ui.li>\n )\n },\n)\n\nAutocompleteOption.displayName = \"AutocompleteOption\"\nAutocompleteOption.__ui__ = \"AutocompleteOption\"\n\nconst AutocompleteCheckIcon: FC = () => (\n <svg viewBox=\"0 0 14 14\" width=\"1em\" height=\"1em\">\n <polygon\n fill=\"currentColor\"\n points=\"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039\"\n />\n </svg>\n)\n\nAutocompleteCheckIcon.displayName = \"AutocompleteCheckIcon\"\nAutocompleteCheckIcon.__ui__ = \"AutocompleteCheckIcon\"\n","import type { HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useAutocompleteContext } from \"./autocomplete-context\"\nimport type { UseAutocompleteOptionGroupProps } from \"./use-autocomplete-option-group\"\nimport { useAutocompleteOptionGroup } from \"./use-autocomplete-option-group\"\n\ninterface AutocompleteOptionGroupOptions\n extends UseAutocompleteOptionGroupProps {\n /**\n * Props for autocomplete option group element.\n */\n labelProps?: HTMLUIProps<\"span\">\n}\n\nexport interface AutocompleteOptionGroupProps\n extends HTMLUIProps<\"ul\">,\n AutocompleteOptionGroupOptions {}\n\nexport const AutocompleteOptionGroup = forwardRef<\n AutocompleteOptionGroupProps,\n \"ul\"\n>(\n (\n {\n className,\n color,\n h,\n height,\n minH,\n minHeight,\n children,\n labelProps,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useAutocompleteContext()\n const { label, getContainerProps, getGroupProps } =\n useAutocompleteOptionGroup(rest)\n\n h ??= height\n minH ??= minHeight\n\n return (\n <ui.li\n className={cx(\n \"ui-autocomplete__item\",\n \"ui-autocomplete__item--group\",\n className,\n )}\n __css={{ w: \"100%\", h: \"fit-content\", color }}\n {...getContainerProps()}\n >\n <ui.span\n className=\"ui-autocomplete__item__group-label\"\n __css={styles.groupLabel}\n lineClamp={1}\n {...labelProps}\n >\n {label}\n </ui.span>\n\n <ui.ul\n {...getGroupProps({}, ref)}\n className=\"ui-autocomplete__item__group\"\n __css={{ h, minH, ...styles.group }}\n >\n {children}\n </ui.ul>\n </ui.li>\n )\n },\n)\n\nAutocompleteOptionGroup.displayName = \"AutocompleteOptionGroup\"\nAutocompleteOptionGroup.__ui__ = \"AutocompleteOptionGroup\"\n","import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport { layoutStyleProperties } from \"@yamada-ui/core\"\nimport { isArray, splitObject } from \"@yamada-ui/utils\"\nimport type { CSSProperties } from \"react\"\nimport { useCallback } from \"react\"\nimport {\n useAutocompleteContext,\n useAutocompleteDescendantsContext,\n} from \"./autocomplete-context\"\n\nexport interface UseAutocompleteOptionGroupProps extends HTMLUIProps<\"ul\"> {\n /**\n * The label of the autocomplete option group.\n */\n label: string\n}\n\nexport const useAutocompleteOptionGroup = ({\n label,\n ...rest\n}: UseAutocompleteOptionGroupProps) => {\n const { value, omitSelectedValues } = useAutocompleteContext()\n\n const isMulti = isArray(value)\n\n const descendants = useAutocompleteDescendantsContext()\n\n const values = descendants.values()\n const selectedValues =\n isMulti && omitSelectedValues\n ? descendants.values(({ node }) =>\n value.includes(node.dataset.value ?? \"\"),\n )\n : []\n const selectedIndexes = selectedValues.map(({ index }) => index)\n const childValues = values.filter(\n ({ node, index }) =>\n node.parentElement?.dataset.label === label &&\n !selectedIndexes.includes(index) &&\n \"target\" in node.dataset,\n )\n\n const isEmpty = !childValues.length\n\n const [containerProps, groupProps] = splitObject(rest, layoutStyleProperties)\n\n const getContainerProps: PropGetter<\"li\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n border: \"0px\",\n clip: \"rect(0px, 0px, 0px, 0px)\",\n height: \"1px\",\n width: \"1px\",\n margin: \"-1px\",\n padding: \"0px\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n position: \"absolute\",\n }\n\n return {\n ref,\n ...props,\n ...containerProps,\n style: isEmpty ? style : undefined,\n \"data-label\": label,\n role: \"autocomplete-group-container\",\n }\n },\n [containerProps, isEmpty, label],\n )\n\n const getGroupProps: PropGetter<\"ul\"> = useCallback(\n (props = {}, ref = null) => ({\n ref,\n ...props,\n ...groupProps,\n \"data-label\": label,\n role: \"autocomplete-group\",\n }),\n [groupProps, label],\n )\n\n return {\n label,\n getContainerProps,\n getGroupProps,\n }\n}\n\nexport type UseAutocompleteOptionGroupReturn = ReturnType<\n typeof useAutocompleteOptionGroup\n>\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { Popover, PopoverTrigger } from \"@yamada-ui/popover\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport { cx, handlerAll, runIfFunc } from \"@yamada-ui/utils\"\nimport type {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n} from \"react\"\nimport { cloneElement, useMemo } from \"react\"\nimport {\n AutocompleteDescendantsContextProvider,\n AutocompleteProvider,\n useAutocompleteContext,\n} from \"./autocomplete-context\"\nimport { AutocompleteCreate } from \"./autocomplete-create\"\nimport type { AutocompleteCreateProps } from \"./autocomplete-create\"\nimport { AutocompleteEmpty } from \"./autocomplete-empty\"\nimport type { AutocompleteEmptyProps } from \"./autocomplete-empty\"\nimport type { AutocompleteIconProps } from \"./autocomplete-icon\"\nimport { AutocompleteClearIcon, AutocompleteIcon } from \"./autocomplete-icon\"\nimport type { AutocompleteListProps } from \"./autocomplete-list\"\nimport { AutocompleteList } from \"./autocomplete-list\"\nimport type { UseAutocompleteProps } from \"./use-autocomplete\"\nimport { useAutocomplete, useAutocompleteInput } from \"./use-autocomplete\"\n\ninterface MultiAutocompleteOptions {\n /**\n * The visual separator between each value.\n *\n * @default ','\n */\n separator?: string\n /**\n * The custom display value to use.\n */\n component?: FC<{\n value: string | number\n label: string\n index: number\n onRemove: MouseEventHandler<HTMLElement>\n }>\n /**\n * If `true`, keep the placeholder.\n *\n * @default false\n */\n keepPlaceholder?: boolean\n /**\n * If `true`, display the select clear icon.\n *\n * @default true\n */\n isClearable?: boolean\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: string\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: string\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 multi autocomplete list element.\n */\n listProps?: Omit<AutocompleteListProps, \"children\">\n /**\n * Props for multi autocomplete field element.\n */\n fieldProps?: Omit<\n MultiAutocompleteFieldProps,\n \"component\" | \"separator\" | \"keepPlaceholder\" | \"inputProps\" | \"children\"\n >\n /**\n * Props for multi autocomplete input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for multi autocomplete icon element.\n */\n iconProps?: AutocompleteIconProps\n /**\n * Props for multi autocomplete clear icon element.\n */\n clearIconProps?: AutocompleteIconProps\n /**\n * Props to be forwarded to the portal component.\n *\n * @default '{ isDisabled: true }'\n *\n */\n portalProps?: Omit<PortalProps, \"children\">\n /**\n * If `true`, the list element will be closed when value is selected.\n *\n * @default false\n */\n closeOnSelect?: boolean\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 * The header of the autocomplete content element.\n */\n header?: ReactNode | FC<{ value: string[] | undefined; onClose: () => void }>\n /**\n * The footer of the autocomplete content element.\n */\n footer?: ReactNode | FC<{ value: string[] | undefined; onClose: () => void }>\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 defaultValue = [],\n component,\n separator,\n isClearable = true,\n color,\n h,\n height,\n minH,\n minHeight,\n closeOnSelect = false,\n keepPlaceholder = false,\n containerProps,\n contentProps,\n listProps,\n fieldProps,\n inputProps,\n iconProps,\n clearIconProps,\n portalProps = { isDisabled: true },\n createProps,\n emptyProps,\n header,\n footer,\n children,\n ...computedProps\n } = omitThemeProps(mergedProps)\n\n const {\n value,\n onClose,\n descendants,\n formControlProps,\n getPopoverProps,\n getContainerProps,\n getFieldProps,\n allowCreate,\n isEmpty,\n inputValue,\n computedChildren,\n onClear,\n ...rest\n } = useAutocomplete<string[]>({\n ...computedProps,\n defaultValue,\n closeOnSelect,\n children,\n })\n\n h ??= height\n minH ??= minHeight\n\n const css: CSSUIObject = {\n w: \"100%\",\n h: \"fit-content\",\n color,\n ...styles.container,\n }\n\n return (\n <AutocompleteDescendantsContextProvider value={descendants}>\n <AutocompleteProvider\n value={{\n ...rest,\n value,\n onClose,\n formControlProps,\n inputValue,\n allowCreate,\n isEmpty,\n styles,\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 separator={separator}\n keepPlaceholder={keepPlaceholder}\n h={h}\n minH={minH}\n inputProps={inputProps}\n {...getFieldProps(fieldProps, ref)}\n />\n\n {isClearable && 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 {!isEmpty ? (\n <Portal {...portalProps}>\n <AutocompleteList\n header={runIfFunc(header, { value, onClose })}\n footer={runIfFunc(footer, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {allowCreate ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n\n {children ?? computedChildren}\n </AutocompleteList>\n </Portal>\n ) : (\n <Portal {...portalProps}>\n <AutocompleteList\n header={runIfFunc(header, { value, onClose })}\n footer={runIfFunc(footer, { value, onClose })}\n contentProps={contentProps}\n {...listProps}\n >\n {allowCreate && inputValue ? (\n <AutocompleteCreate {...createProps} />\n ) : (\n <AutocompleteEmpty {...emptyProps} />\n )}\n </AutocompleteList>\n </Portal>\n )}\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\" | \"separator\" | \"keepPlaceholder\" | \"inputProps\"\n > {}\n\nconst MultiAutocompleteField = forwardRef<MultiAutocompleteFieldProps, \"input\">(\n (\n {\n className,\n component,\n separator = \",\",\n keepPlaceholder,\n h,\n minH,\n placeholder,\n inputProps,\n ...rest\n },\n ref,\n ) => {\n const { value, label, inputValue, onChange, isOpen, inputRef, styles } =\n useAutocompleteContext()\n\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 const onRemove: MouseEventHandler<HTMLElement> = (ev) => {\n ev.stopPropagation()\n\n onChange(value[index])\n\n if (inputRef.current) inputRef.current.focus()\n }\n\n const el = component({\n value: value[index],\n label,\n index,\n onRemove,\n })\n\n const style: CSSProperties = {\n marginBlockStart: \"0.125rem\",\n marginBlockEnd: \"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 pe: \"2rem\",\n h,\n minH,\n display: \"flex\",\n flexWrap: \"wrap\",\n alignItems: \"center\",\n ...styles.field,\n cursor: \"text\",\n }\n\n return (\n <PopoverTrigger>\n <ui.div\n className={cx(\"ui-multi-autocomplete__field\", className)}\n __css={css}\n py={label?.length && component ? \"0.125rem\" : undefined}\n {...rest}\n >\n {cloneChildren}\n\n <ui.input\n aria-label=\"Input value\"\n className=\"ui-multi-autocomplete__field__input\"\n display=\"inline-block\"\n flex=\"1\"\n minW=\"0px\"\n overflow=\"hidden\"\n marginBlockStart=\"0.125rem\"\n marginBlockEnd=\"0.125rem\"\n aria-multiselectable=\"true\"\n placeholder={\n !label || !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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,eAKO;AAEP,IAAAC,kBAAwC;AACxC,oBAAuB;AAEvB,IAAAC,iBAA8B;;;ACV9B,4BAAiC;AACjC,mBAA8B;AAIvB,IAAM;AAAA,EACX,4BAA4B;AAAA,EAC5B,uBAAuB;AAAA,EACvB,gBAAgB;AAAA,EAChB,eAAe;AACjB,QAAI,wCAAiB;AAkCd,IAAM,CAAC,sBAAsB,sBAAsB,QACxD,4BAAmC;AAAA,EACjC,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AChDH,IAAAC,eAA+B;AAC/B,IAAAC,gBAA8B;;;ACD9B,kBAA+B;AAC/B,kBAAuC;AACvC,2BAA6B;AAC7B,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cACA;AAAA,cAEL,GAAG,cAAc,EAAE,GAAG,YAAY,OAAO,kCAAc,GAAG,GAAG,GAAG;AAAA;AAAA,UACnE;AAAA;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;AAEA,uBAAuB,cAAc;AACrC,uBAAuB,SAAS;","names":["import_core","import_popover","import_utils","import_core","import_utils","import_utils","import_utils","import_react","props","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_utils","import_react","import_jsx_runtime","import_core","import_utils","import_react","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_core","import_utils","import_react","import_jsx_runtime","import_jsx_runtime","items","label","value","props","i","id","index","isHit","isFocused","enabledValues","selectedValues","node","import_jsx_runtime","import_core","import_popover","import_portal","import_utils","import_react","import_jsx_runtime","label","value"]}
|