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IT;AA0BO,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAyD;AAMlG,MAAM,2CAAgB,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,cAAgC,KAA4B,EAAE,GAAiC;IACzK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,iBAAS,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,uBAAe;IAC/B,IAAI,eAAe,CAAA,GAAA,cAAM,EAAE,IAAM,UAAU,MAAM,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,CAAA,OAAQ,MAAM,aAAa,IAAI,MAAM,CAAC,CAAA,IAAK,MAAM,MAAM;QAAC;QAAW,MAAM,aAAa;KAAC;IAEjK,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,iBAAiB,gBAAgB,MAAM,WAAW;QAClD,kBAAkB;QAClB,QAAQ;YACN,eAAe,CAAA,GAAA,cAAM,EAAE,IAAM,MAAM,aAAa,CAAC,GAAG,CAAC,CAAA,OAAQ,KAAK,KAAK,IAAS,OAAO;gBAAC,MAAM,aAAa;aAAC;0BAC5G;YACA,eAAe,MAAM,aAAa,CAAC,MAAM,KAAK;mBAC9C;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACN,KAAK;QACJ,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,oBAAkB,MAAM,aAAa,CAAC,MAAM,KAAK,KAAK;;AAE5D","sources":["packages/react-aria-components/src/ComboBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaComboBoxProps, useComboBox} from 'react-aria/useComboBox';\n\nimport {ButtonContext} from './Button';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  Provider,\n  RACValidation,\n  removeDataAttributes,\n  RenderProps,\n  SlotProps,\n  useContextProps,\n  useRenderProps,\n  useSlot,\n  useSlottedContext\n} from './utils';\nimport {Collection, Node} from '@react-types/shared';\nimport {CollectionBuilder} from 'react-aria/CollectionBuilder';\nimport {ComboBoxState, useComboBoxState} from 'react-stately/useComboBoxState';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, Key, RefObject} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport {ListBoxContext, ListStateContext} from './ListBox';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, ReactElement, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {TextContext} from './Text';\nimport {useFilter} from 'react-aria/useFilter';\nimport {useListFormatter} from 'react-aria/useListFormatter';\nimport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\n\ntype SelectionMode = 'single' | 'multiple';\n\nexport interface ComboBoxRenderProps {\n  /**\n   * Whether the combobox is currently open.\n   * @selector [data-open]\n   */\n  isOpen: boolean,\n  /**\n   * Whether the combobox is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * Whether the combobox is invalid.\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean,\n  /**\n   * Whether the combobox is required.\n   * @selector [data-required]\n   */\n  isRequired: boolean,\n  /**\n   * Whether the combobox is read only.\n   * @selector [data-readonly]\n   */\n  isReadOnly: boolean\n}\n\nexport interface ComboBoxProps<T extends object, M extends SelectionMode = 'single'> extends Omit<AriaComboBoxProps<T, M>, 'children' | 'placeholder' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<ComboBoxRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-ComboBox'\n   */\n  className?: ClassNameOrFunction<ComboBoxRenderProps>,\n  /** The filter function used to determine if a option should be included in the combo box list. */\n  defaultFilter?: (textValue: string, inputValue: string) => boolean,\n  /**\n   * Whether the text or key of the selected item is submitted as part of an HTML form.\n   * When `allowsCustomValue` is `true`, this option does not apply and the text is always submitted.\n   * @default 'key'\n   */\n  formValue?: 'text' | 'key',\n  /** Whether the combo box allows the menu to be open when the collection is empty. */\n  allowsEmptyCollection?: boolean\n}\n\nexport const ComboBoxContext = createContext<ContextValue<ComboBoxProps<any, SelectionMode>, HTMLDivElement>>(null);\nexport const ComboBoxStateContext = createContext<ComboBoxState<any, SelectionMode> | null>(null);\n\n/**\n * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.\n */\nexport const ComboBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function ComboBox<T extends object, M extends SelectionMode = 'single'>(props: ComboBoxProps<T, M>, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, ComboBoxContext);\n  let {children, isDisabled = false, isInvalid = false, isRequired = false, isReadOnly = false} = props;\n  let content = useMemo(() => (\n    <ListBoxContext.Provider value={{items: props.items ?? props.defaultItems}}>\n      {typeof children === 'function'\n        ? children({\n          isOpen: false,\n          isDisabled,\n          isInvalid,\n          isRequired,\n          defaultChildren: null,\n          isReadOnly\n        })\n        : children}\n    </ListBoxContext.Provider>\n  ), [children, isDisabled, isInvalid, isRequired, isReadOnly, props.items, props.defaultItems]);\n\n  return (\n    <CollectionBuilder content={content}>\n      {collection => <ComboBoxInner props={props} collection={collection} comboBoxRef={ref} />}\n    </CollectionBuilder>\n  );\n});\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [LabelContext, ButtonContext, InputContext, GroupContext, TextContext];\n\ninterface ComboBoxInnerProps<T extends object> {\n  props: ComboBoxProps<T, SelectionMode>,\n  collection: Collection<Node<T>>,\n  comboBoxRef: RefObject<HTMLDivElement | null>\n}\n\nfunction ComboBoxInner<T extends object>({props, collection, comboBoxRef: ref}: ComboBoxInnerProps<T>) {\n  let {\n    name,\n    formValue = 'key',\n    allowsCustomValue\n  } = props;\n  if (allowsCustomValue) {\n    formValue = 'text';\n  }\n\n  let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n  let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n  let {contains} = useFilter({sensitivity: 'base'});\n  let state = useComboBoxState({\n    ...props,\n    defaultFilter: props.defaultFilter || contains,\n    // If props.items isn't provided, rely on collection filtering (aka listbox.items is provided or defaultItems provided to Combobox)\n    items: props.items,\n    children: undefined,\n    collection,\n    validationBehavior\n  });\n\n  let buttonRef = useRef<HTMLButtonElement>(null);\n  let inputRef = useRef<HTMLInputElement>(null);\n  let listBoxRef = useRef<HTMLDivElement>(null);\n  let popoverRef = useRef<HTMLDivElement>(null);\n  let [labelRef, label] = useSlot(\n    !props['aria-label'] && !props['aria-labelledby']\n  );\n  let {\n    buttonProps,\n    inputProps,\n    listBoxProps,\n    labelProps,\n    descriptionProps,\n    errorMessageProps,\n    valueProps,\n    ...validation\n  } = useComboBox({\n    ...removeDataAttributes(props),\n    label,\n    inputRef,\n    buttonRef,\n    listBoxRef,\n    popoverRef,\n    name: formValue === 'text' ? name : undefined,\n    validationBehavior\n  }, state);\n\n  // Make menu width match input + button\n  let [menuWidth, setMenuWidth] = useState<string | null>(null);\n  let onResize = useCallback(() => {\n    if (inputRef.current) {\n      let buttonRect = buttonRef.current?.getBoundingClientRect();\n      let inputRect = inputRef.current.getBoundingClientRect();\n      let minX = buttonRect ? Math.min(buttonRect.left, inputRect.left) : inputRect.left;\n      let maxX = buttonRect ? Math.max(buttonRect.right, inputRect.right) : inputRect.right;\n      setMenuWidth((maxX - minX) + 'px');\n    }\n  }, [buttonRef, inputRef, setMenuWidth]);\n\n  useResizeObserver({\n    ref: inputRef,\n    onResize: onResize\n  });\n\n  // Only expose a subset of state to renderProps function to avoid infinite render loop\n  let renderPropsState = useMemo(() => ({\n    isOpen: state.isOpen,\n    isDisabled: props.isDisabled || false,\n    isInvalid: validation.isInvalid || false,\n    isRequired: props.isRequired || false,\n    isReadOnly: props.isReadOnly || false\n  }), [state.isOpen, props.isDisabled, validation.isInvalid, props.isRequired, props.isReadOnly]);\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: renderPropsState,\n    defaultClassName: 'react-aria-ComboBox'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n  delete DOMProps.id;\n\n  let inputs: ReactElement[] = [];\n  if (name && formValue === 'key') {\n    let values: (Key | null)[] = Array.isArray(state.value) ? state.value : [state.value];\n    if (values.length === 0) {\n      values = [null];\n    }\n\n    inputs = values.map((value, i) => (\n      <input key={i} type=\"hidden\" name={name} form={props.form} value={value ?? ''} />\n    ));\n  }\n\n  return (\n    <Provider\n      values={[\n        [ComboBoxStateContext, state],\n        [LabelContext, {...labelProps, ref: labelRef}],\n        [ButtonContext, {...buttonProps, ref: buttonRef, isPressed: state.isOpen}],\n        [InputContext, {...inputProps, ref: inputRef}],\n        [OverlayTriggerStateContext, state],\n        [PopoverContext, {\n          ref: popoverRef,\n          triggerRef: inputRef,\n          scrollRef: listBoxRef,\n          placement: 'bottom start',\n          isNonModal: true,\n          trigger: 'ComboBox',\n          style: {'--trigger-width': menuWidth} as React.CSSProperties,\n          clearContexts: CLEAR_CONTEXTS\n        }],\n        [ListBoxContext, {...listBoxProps, ref: listBoxRef}],\n        [ListStateContext, state],\n        [TextContext, {\n          slots: {\n            description: descriptionProps,\n            errorMessage: errorMessageProps\n          }\n        }],\n        [GroupContext, {isInvalid: validation.isInvalid, isDisabled: props.isDisabled || false}],\n        [FieldErrorContext, validation],\n        [ComboBoxValueContext, valueProps]\n      ]}>\n      <dom.div\n        {...DOMProps}\n        {...renderProps}\n        ref={ref}\n        slot={props.slot || undefined}\n        data-focused={state.isFocused || undefined}\n        data-open={state.isOpen || undefined}\n        data-disabled={props.isDisabled || undefined}\n        data-readonly={props.isReadOnly || undefined}\n        data-invalid={validation.isInvalid || undefined}\n        data-required={props.isRequired || undefined}>\n        {renderProps.children}\n        {inputs}\n      </dom.div>\n    </Provider>\n  );\n}\n\nexport interface ComboBoxValueRenderProps<T> {\n  /**\n   * Whether the value is a placeholder.\n   * @selector [data-placeholder]\n   */\n  isPlaceholder: boolean,\n  /** The object values of the currently selected items. */\n  selectedItems: (T | null)[],\n  /** The textValue of the currently selected items. */\n  selectedText: string,\n  /** The state of the ComboBox. */\n  state: ComboBoxState<T, 'single' | 'multiple'>\n}\n\nexport interface ComboBoxValueProps<T extends object> extends Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>, RenderProps<ComboBoxValueRenderProps<T>, 'div'> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-ComboBoxValue'\n   */\n  className?: ClassNameOrFunction<ComboBoxValueRenderProps<T>>,\n  /** A value to display when no items are selected. */\n  placeholder?: ReactNode\n}\n\nexport const ComboBoxValueContext = createContext<ContextValue<ComboBoxValueProps<any>, HTMLDivElement>>(null);\n\n/**\n * ComboBoxValue renders the selected values of a ComboBox, or a placeholder if no value is selected.\n * By default, the items are rendered as a comma separated list. Use the render function to customize this.\n */\nexport const ComboBoxValue = /*#__PURE__*/ createHideableComponent(function ComboBoxValue<T extends object>(props: ComboBoxValueProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, ComboBoxValueContext);\n  let state = useContext(ComboBoxStateContext)!;\n  let formatter = useListFormatter();\n  let selectedText = useMemo(() => formatter.format(state.selectedItems.map(item => item?.textValue || '').filter(v => v !== '')), [formatter, state.selectedItems]);\n\n  let renderProps = useRenderProps({\n    ...props,\n    defaultChildren: selectedText || props.placeholder,\n    defaultClassName: 'react-aria-ComboBoxValue',\n    values: {\n      selectedItems: useMemo(() => state.selectedItems.map(item => item.value as T ?? null), [state.selectedItems]),\n      selectedText,\n      isPlaceholder: state.selectedItems.length === 0,\n      state\n    }\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      ref={ref}\n      {...DOMProps}\n      {...renderProps}\n      data-placeholder={state.selectedItems.length === 0 || undefined} />\n  );\n});\n"],"names":[],"version":3,"file":"ComboBox.mjs.map"}