@react-spectrum/combobox 3.15.5 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/dist/ComboBox.main.js +2 -1
  2. package/dist/ComboBox.main.js.map +1 -1
  3. package/dist/ComboBox.mjs +2 -1
  4. package/dist/ComboBox.module.js +2 -1
  5. package/dist/ComboBox.module.js.map +1 -1
  6. package/dist/MobileComboBox.main.js +10 -6
  7. package/dist/MobileComboBox.main.js.map +1 -1
  8. package/dist/MobileComboBox.mjs +10 -6
  9. package/dist/MobileComboBox.module.js +10 -6
  10. package/dist/MobileComboBox.module.js.map +1 -1
  11. package/dist/ar-AE.main.js +2 -1
  12. package/dist/ar-AE.main.js.map +1 -1
  13. package/dist/ar-AE.mjs +2 -1
  14. package/dist/ar-AE.module.js +2 -1
  15. package/dist/ar-AE.module.js.map +1 -1
  16. package/dist/bg-BG.main.js +2 -1
  17. package/dist/bg-BG.main.js.map +1 -1
  18. package/dist/bg-BG.mjs +2 -1
  19. package/dist/bg-BG.module.js +2 -1
  20. package/dist/bg-BG.module.js.map +1 -1
  21. package/dist/{combobox.02a75b23.css → combobox.8958325b.css} +13 -10
  22. package/dist/combobox.8958325b.css.map +1 -0
  23. package/dist/{combobox.6021f915.css → combobox.a38acc5c.css} +5 -5
  24. package/dist/{combobox.6021f915.css.map → combobox.a38acc5c.css.map} +1 -1
  25. package/dist/cs-CZ.main.js +2 -1
  26. package/dist/cs-CZ.main.js.map +1 -1
  27. package/dist/cs-CZ.mjs +2 -1
  28. package/dist/cs-CZ.module.js +2 -1
  29. package/dist/cs-CZ.module.js.map +1 -1
  30. package/dist/da-DK.main.js +2 -1
  31. package/dist/da-DK.main.js.map +1 -1
  32. package/dist/da-DK.mjs +2 -1
  33. package/dist/da-DK.module.js +2 -1
  34. package/dist/da-DK.module.js.map +1 -1
  35. package/dist/de-DE.main.js +2 -1
  36. package/dist/de-DE.main.js.map +1 -1
  37. package/dist/de-DE.mjs +2 -1
  38. package/dist/de-DE.module.js +2 -1
  39. package/dist/de-DE.module.js.map +1 -1
  40. package/dist/el-GR.main.js +2 -1
  41. package/dist/el-GR.main.js.map +1 -1
  42. package/dist/el-GR.mjs +2 -1
  43. package/dist/el-GR.module.js +2 -1
  44. package/dist/el-GR.module.js.map +1 -1
  45. package/dist/en-US.main.js +2 -1
  46. package/dist/en-US.main.js.map +1 -1
  47. package/dist/en-US.mjs +2 -1
  48. package/dist/en-US.module.js +2 -1
  49. package/dist/en-US.module.js.map +1 -1
  50. package/dist/es-ES.main.js +2 -1
  51. package/dist/es-ES.main.js.map +1 -1
  52. package/dist/es-ES.mjs +2 -1
  53. package/dist/es-ES.module.js +2 -1
  54. package/dist/es-ES.module.js.map +1 -1
  55. package/dist/et-EE.main.js +2 -1
  56. package/dist/et-EE.main.js.map +1 -1
  57. package/dist/et-EE.mjs +2 -1
  58. package/dist/et-EE.module.js +2 -1
  59. package/dist/et-EE.module.js.map +1 -1
  60. package/dist/fi-FI.main.js +2 -1
  61. package/dist/fi-FI.main.js.map +1 -1
  62. package/dist/fi-FI.mjs +2 -1
  63. package/dist/fi-FI.module.js +2 -1
  64. package/dist/fi-FI.module.js.map +1 -1
  65. package/dist/fr-FR.main.js +2 -1
  66. package/dist/fr-FR.main.js.map +1 -1
  67. package/dist/fr-FR.mjs +2 -1
  68. package/dist/fr-FR.module.js +2 -1
  69. package/dist/fr-FR.module.js.map +1 -1
  70. package/dist/he-IL.main.js +2 -1
  71. package/dist/he-IL.main.js.map +1 -1
  72. package/dist/he-IL.mjs +2 -1
  73. package/dist/he-IL.module.js +2 -1
  74. package/dist/he-IL.module.js.map +1 -1
  75. package/dist/hr-HR.main.js +2 -1
  76. package/dist/hr-HR.main.js.map +1 -1
  77. package/dist/hr-HR.mjs +2 -1
  78. package/dist/hr-HR.module.js +2 -1
  79. package/dist/hr-HR.module.js.map +1 -1
  80. package/dist/hu-HU.main.js +2 -1
  81. package/dist/hu-HU.main.js.map +1 -1
  82. package/dist/hu-HU.mjs +2 -1
  83. package/dist/hu-HU.module.js +2 -1
  84. package/dist/hu-HU.module.js.map +1 -1
  85. package/dist/it-IT.main.js +2 -1
  86. package/dist/it-IT.main.js.map +1 -1
  87. package/dist/it-IT.mjs +2 -1
  88. package/dist/it-IT.module.js +2 -1
  89. package/dist/it-IT.module.js.map +1 -1
  90. package/dist/ja-JP.main.js +2 -1
  91. package/dist/ja-JP.main.js.map +1 -1
  92. package/dist/ja-JP.mjs +2 -1
  93. package/dist/ja-JP.module.js +2 -1
  94. package/dist/ja-JP.module.js.map +1 -1
  95. package/dist/ko-KR.main.js +2 -1
  96. package/dist/ko-KR.main.js.map +1 -1
  97. package/dist/ko-KR.mjs +2 -1
  98. package/dist/ko-KR.module.js +2 -1
  99. package/dist/ko-KR.module.js.map +1 -1
  100. package/dist/lt-LT.main.js +2 -1
  101. package/dist/lt-LT.main.js.map +1 -1
  102. package/dist/lt-LT.mjs +2 -1
  103. package/dist/lt-LT.module.js +2 -1
  104. package/dist/lt-LT.module.js.map +1 -1
  105. package/dist/lv-LV.main.js +2 -1
  106. package/dist/lv-LV.main.js.map +1 -1
  107. package/dist/lv-LV.mjs +2 -1
  108. package/dist/lv-LV.module.js +2 -1
  109. package/dist/lv-LV.module.js.map +1 -1
  110. package/dist/nb-NO.main.js +2 -1
  111. package/dist/nb-NO.main.js.map +1 -1
  112. package/dist/nb-NO.mjs +2 -1
  113. package/dist/nb-NO.module.js +2 -1
  114. package/dist/nb-NO.module.js.map +1 -1
  115. package/dist/nl-NL.main.js +2 -1
  116. package/dist/nl-NL.main.js.map +1 -1
  117. package/dist/nl-NL.mjs +2 -1
  118. package/dist/nl-NL.module.js +2 -1
  119. package/dist/nl-NL.module.js.map +1 -1
  120. package/dist/pl-PL.main.js +2 -1
  121. package/dist/pl-PL.main.js.map +1 -1
  122. package/dist/pl-PL.mjs +2 -1
  123. package/dist/pl-PL.module.js +2 -1
  124. package/dist/pl-PL.module.js.map +1 -1
  125. package/dist/pt-BR.main.js +2 -1
  126. package/dist/pt-BR.main.js.map +1 -1
  127. package/dist/pt-BR.mjs +2 -1
  128. package/dist/pt-BR.module.js +2 -1
  129. package/dist/pt-BR.module.js.map +1 -1
  130. package/dist/pt-PT.main.js +2 -1
  131. package/dist/pt-PT.main.js.map +1 -1
  132. package/dist/pt-PT.mjs +2 -1
  133. package/dist/pt-PT.module.js +2 -1
  134. package/dist/pt-PT.module.js.map +1 -1
  135. package/dist/ro-RO.main.js +2 -1
  136. package/dist/ro-RO.main.js.map +1 -1
  137. package/dist/ro-RO.mjs +2 -1
  138. package/dist/ro-RO.module.js +2 -1
  139. package/dist/ro-RO.module.js.map +1 -1
  140. package/dist/ru-RU.main.js +2 -1
  141. package/dist/ru-RU.main.js.map +1 -1
  142. package/dist/ru-RU.mjs +2 -1
  143. package/dist/ru-RU.module.js +2 -1
  144. package/dist/ru-RU.module.js.map +1 -1
  145. package/dist/sk-SK.main.js +2 -1
  146. package/dist/sk-SK.main.js.map +1 -1
  147. package/dist/sk-SK.mjs +2 -1
  148. package/dist/sk-SK.module.js +2 -1
  149. package/dist/sk-SK.module.js.map +1 -1
  150. package/dist/sl-SI.main.js +2 -1
  151. package/dist/sl-SI.main.js.map +1 -1
  152. package/dist/sl-SI.mjs +2 -1
  153. package/dist/sl-SI.module.js +2 -1
  154. package/dist/sl-SI.module.js.map +1 -1
  155. package/dist/sr-SP.main.js +2 -1
  156. package/dist/sr-SP.main.js.map +1 -1
  157. package/dist/sr-SP.mjs +2 -1
  158. package/dist/sr-SP.module.js +2 -1
  159. package/dist/sr-SP.module.js.map +1 -1
  160. package/dist/sv-SE.main.js +2 -1
  161. package/dist/sv-SE.main.js.map +1 -1
  162. package/dist/sv-SE.mjs +2 -1
  163. package/dist/sv-SE.module.js +2 -1
  164. package/dist/sv-SE.module.js.map +1 -1
  165. package/dist/tr-TR.main.js +2 -1
  166. package/dist/tr-TR.main.js.map +1 -1
  167. package/dist/tr-TR.mjs +2 -1
  168. package/dist/tr-TR.module.js +2 -1
  169. package/dist/tr-TR.module.js.map +1 -1
  170. package/dist/uk-UA.main.js +2 -1
  171. package/dist/uk-UA.main.js.map +1 -1
  172. package/dist/uk-UA.mjs +2 -1
  173. package/dist/uk-UA.module.js +2 -1
  174. package/dist/uk-UA.module.js.map +1 -1
  175. package/dist/zh-CN.main.js +2 -1
  176. package/dist/zh-CN.main.js.map +1 -1
  177. package/dist/zh-CN.mjs +2 -1
  178. package/dist/zh-CN.module.js +2 -1
  179. package/dist/zh-CN.module.js.map +1 -1
  180. package/dist/zh-TW.main.js +2 -1
  181. package/dist/zh-TW.main.js.map +1 -1
  182. package/dist/zh-TW.mjs +2 -1
  183. package/dist/zh-TW.module.js +2 -1
  184. package/dist/zh-TW.module.js.map +1 -1
  185. package/package.json +26 -26
  186. package/src/ComboBox.tsx +1 -1
  187. package/src/MobileComboBox.tsx +9 -3
  188. package/dist/combobox.02a75b23.css.map +0 -1
@@ -2,7 +2,7 @@ require("./combobox.1c1869da.css");
2
2
  var $41fae9390a5a37fa$exports = require("./combobox_css.main.js");
3
3
  var $9e627d9ac6346a53$exports = require("./intlStrings.main.js");
4
4
  var $e514018f82d1b067$exports = require("./MobileComboBox.main.js");
5
- require("./combobox.6021f915.css");
5
+ require("./combobox.a38acc5c.css");
6
6
  var $2f86633ce5b04f1e$exports = require("./inputgroup_vars_css.main.js");
7
7
  require("./combobox.32e7c48f.css");
8
8
  var $40cb3a00c193680f$exports = require("./textfield_vars_css.main.js");
@@ -169,6 +169,7 @@ const $e4f518eb9b010873$var$ComboBoxBase = /*#__PURE__*/ (0, ($parcel$interopDef
169
169
  })), name && formValue === 'key' && /*#__PURE__*/ (0, ($parcel$interopDefault($XxzjX$react))).createElement("input", {
170
170
  type: "hidden",
171
171
  name: name,
172
+ form: props.form,
172
173
  value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ''
173
174
  }), /*#__PURE__*/ (0, ($parcel$interop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,YAAY;QAChB,KAAK;QACL,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;QAGJ,SAAS;QACT,iBAAiB;qBACjB,0DAAC,CAAA,GAAA,iEAAgB;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAMpE","sources":["packages/@react-spectrum/combobox/src/ComboBox.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n dimensionValue,\n useFocusableRef,\n useIsMobileDevice,\n useResizeObserver,\n useUnwrapDOMRef\n} from '@react-spectrum/utils';\nimport comboboxStyles from './combobox.css';\nimport {DOMRefValue, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport {MobileComboBox} from './MobileComboBox';\nimport {Popover} from '@react-spectrum/overlays';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {\n ForwardedRef,\n InputHTMLAttributes,\n ReactElement,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport {SpectrumComboBoxProps} from '@react-types/combobox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useComboBox} from '@react-aria/combobox';\nimport {useComboBoxState} from '@react-stately/combobox';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\n\n/**\n * ComboBoxes combine a text entry with a picker menu, allowing users to filter longer lists to only the selections matching a query.\n */\nexport const ComboBox = React.forwardRef(function ComboBox<T extends object>(props: SpectrumComboBoxProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ComboBox.html#help-text');\n }\n\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // menuTrigger=focus/manual don't apply to mobile combobox\n return <MobileComboBox {...props} menuTrigger=\"input\" ref={ref} />;\n } else {\n return <ComboBoxBase {...props} ref={ref} />;\n }\n}) as <T>(props: SpectrumComboBoxProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\nconst ComboBoxBase = React.forwardRef(function ComboBoxBase(props: SpectrumComboBoxProps<any>, ref: FocusableRef<HTMLElement>) {\n let {\n menuTrigger = 'input',\n shouldFlip = true,\n direction = 'bottom',\n align = 'start',\n isQuiet,\n loadingState,\n onLoadMore,\n allowsCustomValue,\n menuWidth: customMenuWidth,\n name,\n formValue = 'text'\n } = props;\n if (allowsCustomValue) {\n formValue = 'text';\n }\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let isAsync = loadingState != null;\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);\n let buttonRef = useRef<FocusableRefValue<HTMLElement>>(null);\n let unwrappedButtonRef = useUnwrapDOMRef(buttonRef);\n let listBoxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement>(null);\n // serve as the new popover `triggerRef` instead of `unwrappedButtonRef` before for better positioning.\n let inputGroupRef = useRef<HTMLDivElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState(\n {\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: isAsync\n }\n );\n let layout = useListBoxLayout();\n\n let {buttonProps, inputProps, listBoxProps, labelProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useComboBox(\n {\n ...props,\n layoutDelegate: layout,\n buttonRef: unwrappedButtonRef,\n popoverRef: unwrappedPopoverRef,\n listBoxRef,\n inputRef: inputRef,\n menuTrigger,\n name: formValue === 'text' ? name : undefined\n },\n state\n );\n\n // Measure the width of the inputfield and the button to inform the width of the menu (below).\n let [menuWidth, setMenuWidth] = useState<number | undefined>(undefined);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (unwrappedButtonRef.current && inputRef.current) {\n let buttonWidth = unwrappedButtonRef.current.offsetWidth;\n let inputWidth = inputRef.current.offsetWidth;\n setMenuWidth(buttonWidth + inputWidth);\n }\n }, [unwrappedButtonRef, inputRef, setMenuWidth]);\n\n useResizeObserver({\n ref: domRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, onResize]);\n\n let width = isQuiet ? undefined : menuWidth;\n let style = {\n width: customMenuWidth ? dimensionValue(customMenuWidth) : width,\n minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth\n };\n let cbInputProps = {...props, children: null};\n\n return (\n <>\n <Field\n {...props}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n labelProps={labelProps}\n ref={domRef}>\n <ComboBoxInput\n {...cbInputProps}\n isOpen={state.isOpen}\n loadingState={loadingState}\n inputProps={inputProps}\n inputRef={inputRef}\n triggerProps={buttonProps}\n triggerRef={buttonRef}\n validationState={props.validationState || (isInvalid ? 'invalid' : undefined)}\n ref={inputGroupRef} />\n </Field>\n {name && formValue === 'key' && <input type=\"hidden\" name={name} value={state.selectedKey ?? ''} />}\n <Popover\n state={state}\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-InputGroup-popover', {'spectrum-InputGroup-popover--quiet': isQuiet})}\n ref={popoverRef}\n triggerRef={inputGroupRef}\n scrollRef={listBoxRef}\n placement={`${direction} ${align}`}\n hideArrow\n isNonModal\n shouldFlip={shouldFlip}>\n <ListBoxBase\n {...listBoxProps}\n ref={listBoxRef}\n disallowEmptySelection\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n isLoading={loadingState === 'loading' || loadingState === 'loadingMore'}\n showLoadingSpinner={loadingState === 'loadingMore'}\n onLoadMore={onLoadMore}\n renderEmptyState={() => isAsync && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {loadingState === 'loading' ? stringFormatter.format('loading') : stringFormatter.format('noResults')}\n </span>\n )} />\n </Popover>\n </>\n );\n});\n\ninterface ComboBoxInputProps extends SpectrumComboBoxProps<unknown> {\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n triggerProps: AriaButtonProps,\n triggerRef: RefObject<FocusableRefValue<HTMLElement> | null>,\n style?: React.CSSProperties,\n className?: string,\n isOpen?: boolean\n}\n\nconst ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInputProps, ref: ForwardedRef<HTMLElement | null>) {\n let {\n isQuiet,\n isDisabled,\n validationState,\n inputProps,\n inputRef,\n triggerProps,\n triggerRef,\n autoFocus,\n style,\n className,\n loadingState,\n isOpen,\n menuTrigger\n } = props;\n let {hoverProps, isHovered} = useHover({});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader',\n classNames(\n styles,\n 'spectrum-InputGroup-input-circleLoader'\n )\n )} />\n );\n\n let isLoading = loadingState === 'loading' || loadingState === 'filtering';\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (isLoading && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (!isLoading) {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n }\n\n lastInputValue.current = inputValue;\n }, [isLoading, showLoading, inputValue]);\n\n useEffect(() => {\n return () => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n };\n }, []);\n\n return (\n (<FocusRing\n within\n isTextInput\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...hoverProps}\n ref={ref as RefObject<HTMLDivElement | null>}\n style={style}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n className\n )\n }>\n <TextFieldBase\n inputProps={inputProps}\n inputRef={inputRef}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n }\n inputClassName={\n classNames(\n styles,\n 'spectrum-InputGroup-input'\n )\n }\n validationIconClassName={\n classNames(\n styles,\n 'spectrum-InputGroup-input-validationIcon'\n )\n }\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n // loading circle should only be displayed if menu is open, if menuTrigger is \"manual\", or first time load (to stop circle from showing up when user selects an option)\n // TODO: add special case for completionMode: complete as well\n isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n disableFocusRing />\n <PressResponder preventFocusOnPress isPressed={isOpen}>\n <FieldButton\n {...triggerProps}\n ref={triggerRef}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-FieldButton'\n )\n }\n isQuiet={isQuiet}\n validationState={validationState}>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-Dropdown-chevron')} />\n </FieldButton>\n </PressResponder>\n </div>\n </FocusRing>)\n );\n});\n"],"names":[],"version":3,"file":"ComboBox.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;AAgDM,MAAM,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,SAA2B,KAA+B,EAAE,GAA8B;IAC1I,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IAErB,IAAI,MAAM,WAAW,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChD,QAAQ,IAAI,CAAC;IAGf,IAAI,WAAW,CAAA,GAAA,2CAAgB;IAC/B,IAAI,UACF,0DAA0D;IAC1D,qBAAO,0DAAC,CAAA,GAAA,wCAAa;QAAG,GAAG,KAAK;QAAE,aAAY;QAAQ,KAAK;;SAE3D,qBAAO,0DAAC;QAAc,GAAG,KAAK;QAAE,KAAK;;AAEzC;AAEA,MAAM,mDAAe,CA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AAe;YACf,gCAAgC,oBAAoB,aAAa,CAAC;YAClE,cAAc;QAChB,GACA;qBAGJ,0DAAC,CAAA,GAAA,2CAAY;QACX,YAAY;QACZ,UAAU;QACV,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;QAGJ,gBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;QAGJ,yBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;QAGJ,YAAY;QACZ,SAAS;QACT,iBAAiB;QACjB,uKAAuK;QACvK,8DAA8D;QAC9D,WAAW,eAAgB,CAAA,UAAU,gBAAgB,YAAY,iBAAiB,SAAQ;QAC1F,kBAAkB,gBAAgB,OAAO,gBAAgB;QACzD,kBAAA;sBACF,0DAAC,CAAA,GAAA,2CAAa;QAAE,qBAAA;QAAoB,WAAW;qBAC7C,0DAAC,CAAA,GAAA,sCAAU;QACR,GAAG,YAAY;QAChB,KAAK;QACL,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;QAGJ,SAAS;QACT,iBAAiB;qBACjB,0DAAC,CAAA,GAAA,iEAAgB;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAMpE","sources":["packages/@react-spectrum/combobox/src/ComboBox.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n dimensionValue,\n useFocusableRef,\n useIsMobileDevice,\n useResizeObserver,\n useUnwrapDOMRef\n} from '@react-spectrum/utils';\nimport comboboxStyles from './combobox.css';\nimport {DOMRefValue, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport {MobileComboBox} from './MobileComboBox';\nimport {Popover} from '@react-spectrum/overlays';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {\n ForwardedRef,\n InputHTMLAttributes,\n ReactElement,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport {SpectrumComboBoxProps} from '@react-types/combobox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useComboBox} from '@react-aria/combobox';\nimport {useComboBoxState} from '@react-stately/combobox';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\n\n/**\n * ComboBoxes combine a text entry with a picker menu, allowing users to filter longer lists to only the selections matching a query.\n */\nexport const ComboBox = React.forwardRef(function ComboBox<T extends object>(props: SpectrumComboBoxProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ComboBox.html#help-text');\n }\n\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // menuTrigger=focus/manual don't apply to mobile combobox\n return <MobileComboBox {...props} menuTrigger=\"input\" ref={ref} />;\n } else {\n return <ComboBoxBase {...props} ref={ref} />;\n }\n}) as <T>(props: SpectrumComboBoxProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\nconst ComboBoxBase = React.forwardRef(function ComboBoxBase(props: SpectrumComboBoxProps<any>, ref: FocusableRef<HTMLElement>) {\n let {\n menuTrigger = 'input',\n shouldFlip = true,\n direction = 'bottom',\n align = 'start',\n isQuiet,\n loadingState,\n onLoadMore,\n allowsCustomValue,\n menuWidth: customMenuWidth,\n name,\n formValue = 'text'\n } = props;\n if (allowsCustomValue) {\n formValue = 'text';\n }\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let isAsync = loadingState != null;\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);\n let buttonRef = useRef<FocusableRefValue<HTMLElement>>(null);\n let unwrappedButtonRef = useUnwrapDOMRef(buttonRef);\n let listBoxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement>(null);\n // serve as the new popover `triggerRef` instead of `unwrappedButtonRef` before for better positioning.\n let inputGroupRef = useRef<HTMLDivElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState(\n {\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: isAsync\n }\n );\n let layout = useListBoxLayout();\n\n let {buttonProps, inputProps, listBoxProps, labelProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useComboBox(\n {\n ...props,\n layoutDelegate: layout,\n buttonRef: unwrappedButtonRef,\n popoverRef: unwrappedPopoverRef,\n listBoxRef,\n inputRef: inputRef,\n menuTrigger,\n name: formValue === 'text' ? name : undefined\n },\n state\n );\n\n // Measure the width of the inputfield and the button to inform the width of the menu (below).\n let [menuWidth, setMenuWidth] = useState<number | undefined>(undefined);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (unwrappedButtonRef.current && inputRef.current) {\n let buttonWidth = unwrappedButtonRef.current.offsetWidth;\n let inputWidth = inputRef.current.offsetWidth;\n setMenuWidth(buttonWidth + inputWidth);\n }\n }, [unwrappedButtonRef, inputRef, setMenuWidth]);\n\n useResizeObserver({\n ref: domRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, onResize]);\n\n let width = isQuiet ? undefined : menuWidth;\n let style = {\n width: customMenuWidth ? dimensionValue(customMenuWidth) : width,\n minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth\n };\n let cbInputProps = {...props, children: null};\n\n return (\n <>\n <Field\n {...props}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n labelProps={labelProps}\n ref={domRef}>\n <ComboBoxInput\n {...cbInputProps}\n isOpen={state.isOpen}\n loadingState={loadingState}\n inputProps={inputProps}\n inputRef={inputRef}\n triggerProps={buttonProps}\n triggerRef={buttonRef}\n validationState={props.validationState || (isInvalid ? 'invalid' : undefined)}\n ref={inputGroupRef} />\n </Field>\n {name && formValue === 'key' && <input type=\"hidden\" name={name} form={props.form} value={state.selectedKey ?? ''} />}\n <Popover\n state={state}\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-InputGroup-popover', {'spectrum-InputGroup-popover--quiet': isQuiet})}\n ref={popoverRef}\n triggerRef={inputGroupRef}\n scrollRef={listBoxRef}\n placement={`${direction} ${align}`}\n hideArrow\n isNonModal\n shouldFlip={shouldFlip}>\n <ListBoxBase\n {...listBoxProps}\n ref={listBoxRef}\n disallowEmptySelection\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n isLoading={loadingState === 'loading' || loadingState === 'loadingMore'}\n showLoadingSpinner={loadingState === 'loadingMore'}\n onLoadMore={onLoadMore}\n renderEmptyState={() => isAsync && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {loadingState === 'loading' ? stringFormatter.format('loading') : stringFormatter.format('noResults')}\n </span>\n )} />\n </Popover>\n </>\n );\n});\n\ninterface ComboBoxInputProps extends SpectrumComboBoxProps<unknown> {\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n triggerProps: AriaButtonProps,\n triggerRef: RefObject<FocusableRefValue<HTMLElement> | null>,\n style?: React.CSSProperties,\n className?: string,\n isOpen?: boolean\n}\n\nconst ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInputProps, ref: ForwardedRef<HTMLElement | null>) {\n let {\n isQuiet,\n isDisabled,\n validationState,\n inputProps,\n inputRef,\n triggerProps,\n triggerRef,\n autoFocus,\n style,\n className,\n loadingState,\n isOpen,\n menuTrigger\n } = props;\n let {hoverProps, isHovered} = useHover({});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader',\n classNames(\n styles,\n 'spectrum-InputGroup-input-circleLoader'\n )\n )} />\n );\n\n let isLoading = loadingState === 'loading' || loadingState === 'filtering';\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (isLoading && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (!isLoading) {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n }\n\n lastInputValue.current = inputValue;\n }, [isLoading, showLoading, inputValue]);\n\n useEffect(() => {\n return () => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n };\n }, []);\n\n return (\n (<FocusRing\n within\n isTextInput\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...hoverProps}\n ref={ref as RefObject<HTMLDivElement | null>}\n style={style}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n className\n )\n }>\n <TextFieldBase\n inputProps={inputProps}\n inputRef={inputRef}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n }\n inputClassName={\n classNames(\n styles,\n 'spectrum-InputGroup-input'\n )\n }\n validationIconClassName={\n classNames(\n styles,\n 'spectrum-InputGroup-input-validationIcon'\n )\n }\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n // loading circle should only be displayed if menu is open, if menuTrigger is \"manual\", or first time load (to stop circle from showing up when user selects an option)\n // TODO: add special case for completionMode: complete as well\n isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n disableFocusRing />\n <PressResponder preventFocusOnPress isPressed={isOpen}>\n <FieldButton\n {...triggerProps}\n ref={triggerRef}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-FieldButton'\n )\n }\n isQuiet={isQuiet}\n validationState={validationState}>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-Dropdown-chevron')} />\n </FieldButton>\n </PressResponder>\n </div>\n </FocusRing>)\n );\n});\n"],"names":[],"version":3,"file":"ComboBox.main.js.map"}
package/dist/ComboBox.mjs CHANGED
@@ -2,7 +2,7 @@ import "./combobox.1c1869da.css";
2
2
  import $c3ZYr$combobox_cssmodulejs from "./combobox_css.mjs";
3
3
  import $c3ZYr$intlStringsmodulejs from "./intlStrings.mjs";
4
4
  import {MobileComboBox as $a1ae4cad4496428f$export$7637df911c069b4d} from "./MobileComboBox.mjs";
5
- import "./combobox.6021f915.css";
5
+ import "./combobox.a38acc5c.css";
6
6
  import $c3ZYr$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.mjs";
7
7
  import "./combobox.32e7c48f.css";
8
8
  import $c3ZYr$textfield_vars_cssmodulejs from "./textfield_vars_css.mjs";
@@ -163,6 +163,7 @@ const $2289f375e813f187$var$ComboBoxBase = /*#__PURE__*/ (0, $c3ZYr$react).forwa
163
163
  })), name && formValue === 'key' && /*#__PURE__*/ (0, $c3ZYr$react).createElement("input", {
164
164
  type: "hidden",
165
165
  name: name,
166
+ form: props.form,
166
167
  value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ''
167
168
  }), /*#__PURE__*/ (0, $c3ZYr$react).createElement((0, $c3ZYr$Popover), {
168
169
  state: state,
@@ -2,7 +2,7 @@ import "./combobox.1c1869da.css";
2
2
  import $c3ZYr$combobox_cssmodulejs from "./combobox_css.module.js";
3
3
  import $c3ZYr$intlStringsmodulejs from "./intlStrings.module.js";
4
4
  import {MobileComboBox as $a1ae4cad4496428f$export$7637df911c069b4d} from "./MobileComboBox.module.js";
5
- import "./combobox.6021f915.css";
5
+ import "./combobox.a38acc5c.css";
6
6
  import $c3ZYr$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.module.js";
7
7
  import "./combobox.32e7c48f.css";
8
8
  import $c3ZYr$textfield_vars_cssmodulejs from "./textfield_vars_css.module.js";
@@ -163,6 +163,7 @@ const $2289f375e813f187$var$ComboBoxBase = /*#__PURE__*/ (0, $c3ZYr$react).forwa
163
163
  })), name && formValue === 'key' && /*#__PURE__*/ (0, $c3ZYr$react).createElement("input", {
164
164
  type: "hidden",
165
165
  name: name,
166
+ form: props.form,
166
167
  value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ''
167
168
  }), /*#__PURE__*/ (0, $c3ZYr$react).createElement((0, $c3ZYr$Popover), {
168
169
  state: state,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;AAgDM,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,SAA2B,KAA+B,EAAE,GAA8B;IAC1I,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IAErB,IAAI,MAAM,WAAW,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChD,QAAQ,IAAI,CAAC;IAGf,IAAI,WAAW,CAAA,GAAA,wBAAgB;IAC/B,IAAI,UACF,0DAA0D;IAC1D,qBAAO,gCAAC,CAAA,GAAA,yCAAa;QAAG,GAAG,KAAK;QAAE,aAAY;QAAQ,KAAK;;SAE3D,qBAAO,gCAAC;QAAc,GAAG,KAAK;QAAE,KAAK;;AAEzC;AAEA,MAAM,mDAAe,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,aAAa,KAAiC,EAAE,GAA8B;IAC3H,IAAI,eACF,cAAc,qBACd,aAAa,iBACb,YAAY,iBACZ,QAAQ,kBACR,OAAO,gBACP,YAAY,cACZ,UAAU,qBACV,iBAAiB,EACjB,WAAW,eAAe,QAC1B,IAAI,aACJ,YAAY,QACb,GAAG;IACJ,IAAI,mBACF,YAAY;IAGd,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,UAAU,gBAAgB;IAC9B,IAAI,aAAa,CAAA,GAAA,aAAK,EAA+B;IACrD,IAAI,sBAAsB,CAAA,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;QACzD,kBAAA;sBACF,gCAAC,CAAA,GAAA,qBAAa;QAAE,qBAAA;QAAoB,WAAW;qBAC7C,gCAAC,CAAA,GAAA,kBAAU;QACR,GAAG,YAAY;QAChB,KAAK;QACL,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL;QAGJ,SAAS;QACT,iBAAiB;qBACjB,gCAAC,CAAA,GAAA,uCAAgB;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAK,GAAG;;AAMpE","sources":["packages/@react-spectrum/combobox/src/ComboBox.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n dimensionValue,\n useFocusableRef,\n useIsMobileDevice,\n useResizeObserver,\n useUnwrapDOMRef\n} from '@react-spectrum/utils';\nimport comboboxStyles from './combobox.css';\nimport {DOMRefValue, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport {MobileComboBox} from './MobileComboBox';\nimport {Popover} from '@react-spectrum/overlays';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {\n ForwardedRef,\n InputHTMLAttributes,\n ReactElement,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport {SpectrumComboBoxProps} from '@react-types/combobox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useComboBox} from '@react-aria/combobox';\nimport {useComboBoxState} from '@react-stately/combobox';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\n\n/**\n * ComboBoxes combine a text entry with a picker menu, allowing users to filter longer lists to only the selections matching a query.\n */\nexport const ComboBox = React.forwardRef(function ComboBox<T extends object>(props: SpectrumComboBoxProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ComboBox.html#help-text');\n }\n\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // menuTrigger=focus/manual don't apply to mobile combobox\n return <MobileComboBox {...props} menuTrigger=\"input\" ref={ref} />;\n } else {\n return <ComboBoxBase {...props} ref={ref} />;\n }\n}) as <T>(props: SpectrumComboBoxProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\nconst ComboBoxBase = React.forwardRef(function ComboBoxBase(props: SpectrumComboBoxProps<any>, ref: FocusableRef<HTMLElement>) {\n let {\n menuTrigger = 'input',\n shouldFlip = true,\n direction = 'bottom',\n align = 'start',\n isQuiet,\n loadingState,\n onLoadMore,\n allowsCustomValue,\n menuWidth: customMenuWidth,\n name,\n formValue = 'text'\n } = props;\n if (allowsCustomValue) {\n formValue = 'text';\n }\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let isAsync = loadingState != null;\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);\n let buttonRef = useRef<FocusableRefValue<HTMLElement>>(null);\n let unwrappedButtonRef = useUnwrapDOMRef(buttonRef);\n let listBoxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement>(null);\n // serve as the new popover `triggerRef` instead of `unwrappedButtonRef` before for better positioning.\n let inputGroupRef = useRef<HTMLDivElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState(\n {\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: isAsync\n }\n );\n let layout = useListBoxLayout();\n\n let {buttonProps, inputProps, listBoxProps, labelProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useComboBox(\n {\n ...props,\n layoutDelegate: layout,\n buttonRef: unwrappedButtonRef,\n popoverRef: unwrappedPopoverRef,\n listBoxRef,\n inputRef: inputRef,\n menuTrigger,\n name: formValue === 'text' ? name : undefined\n },\n state\n );\n\n // Measure the width of the inputfield and the button to inform the width of the menu (below).\n let [menuWidth, setMenuWidth] = useState<number | undefined>(undefined);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (unwrappedButtonRef.current && inputRef.current) {\n let buttonWidth = unwrappedButtonRef.current.offsetWidth;\n let inputWidth = inputRef.current.offsetWidth;\n setMenuWidth(buttonWidth + inputWidth);\n }\n }, [unwrappedButtonRef, inputRef, setMenuWidth]);\n\n useResizeObserver({\n ref: domRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, onResize]);\n\n let width = isQuiet ? undefined : menuWidth;\n let style = {\n width: customMenuWidth ? dimensionValue(customMenuWidth) : width,\n minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth\n };\n let cbInputProps = {...props, children: null};\n\n return (\n <>\n <Field\n {...props}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n labelProps={labelProps}\n ref={domRef}>\n <ComboBoxInput\n {...cbInputProps}\n isOpen={state.isOpen}\n loadingState={loadingState}\n inputProps={inputProps}\n inputRef={inputRef}\n triggerProps={buttonProps}\n triggerRef={buttonRef}\n validationState={props.validationState || (isInvalid ? 'invalid' : undefined)}\n ref={inputGroupRef} />\n </Field>\n {name && formValue === 'key' && <input type=\"hidden\" name={name} value={state.selectedKey ?? ''} />}\n <Popover\n state={state}\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-InputGroup-popover', {'spectrum-InputGroup-popover--quiet': isQuiet})}\n ref={popoverRef}\n triggerRef={inputGroupRef}\n scrollRef={listBoxRef}\n placement={`${direction} ${align}`}\n hideArrow\n isNonModal\n shouldFlip={shouldFlip}>\n <ListBoxBase\n {...listBoxProps}\n ref={listBoxRef}\n disallowEmptySelection\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n isLoading={loadingState === 'loading' || loadingState === 'loadingMore'}\n showLoadingSpinner={loadingState === 'loadingMore'}\n onLoadMore={onLoadMore}\n renderEmptyState={() => isAsync && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {loadingState === 'loading' ? stringFormatter.format('loading') : stringFormatter.format('noResults')}\n </span>\n )} />\n </Popover>\n </>\n );\n});\n\ninterface ComboBoxInputProps extends SpectrumComboBoxProps<unknown> {\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n triggerProps: AriaButtonProps,\n triggerRef: RefObject<FocusableRefValue<HTMLElement> | null>,\n style?: React.CSSProperties,\n className?: string,\n isOpen?: boolean\n}\n\nconst ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInputProps, ref: ForwardedRef<HTMLElement | null>) {\n let {\n isQuiet,\n isDisabled,\n validationState,\n inputProps,\n inputRef,\n triggerProps,\n triggerRef,\n autoFocus,\n style,\n className,\n loadingState,\n isOpen,\n menuTrigger\n } = props;\n let {hoverProps, isHovered} = useHover({});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader',\n classNames(\n styles,\n 'spectrum-InputGroup-input-circleLoader'\n )\n )} />\n );\n\n let isLoading = loadingState === 'loading' || loadingState === 'filtering';\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (isLoading && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (!isLoading) {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n }\n\n lastInputValue.current = inputValue;\n }, [isLoading, showLoading, inputValue]);\n\n useEffect(() => {\n return () => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n };\n }, []);\n\n return (\n (<FocusRing\n within\n isTextInput\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...hoverProps}\n ref={ref as RefObject<HTMLDivElement | null>}\n style={style}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n className\n )\n }>\n <TextFieldBase\n inputProps={inputProps}\n inputRef={inputRef}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n }\n inputClassName={\n classNames(\n styles,\n 'spectrum-InputGroup-input'\n )\n }\n validationIconClassName={\n classNames(\n styles,\n 'spectrum-InputGroup-input-validationIcon'\n )\n }\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n // loading circle should only be displayed if menu is open, if menuTrigger is \"manual\", or first time load (to stop circle from showing up when user selects an option)\n // TODO: add special case for completionMode: complete as well\n isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n disableFocusRing />\n <PressResponder preventFocusOnPress isPressed={isOpen}>\n <FieldButton\n {...triggerProps}\n ref={triggerRef}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-FieldButton'\n )\n }\n isQuiet={isQuiet}\n validationState={validationState}>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-Dropdown-chevron')} />\n </FieldButton>\n </PressResponder>\n </div>\n </FocusRing>)\n );\n});\n"],"names":[],"version":3,"file":"ComboBox.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;AAgDM,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,SAA2B,KAA+B,EAAE,GAA8B;IAC1I,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IAErB,IAAI,MAAM,WAAW,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChD,QAAQ,IAAI,CAAC;IAGf,IAAI,WAAW,CAAA,GAAA,wBAAgB;IAC/B,IAAI,UACF,0DAA0D;IAC1D,qBAAO,gCAAC,CAAA,GAAA,yCAAa;QAAG,GAAG,KAAK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,OAAO;QACP,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL,uBACA;YACE,8BAA8B;YAC9B,eAAe;YACf,gCAAgC,oBAAoB,aAAa,CAAC;YAClE,cAAc;QAChB,GACA;qBAGJ,gCAAC,CAAA,GAAA,oBAAY;QACX,YAAY;QACZ,UAAU;QACV,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL;QAGJ,gBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL;QAGJ,yBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL;QAGJ,YAAY;QACZ,SAAS;QACT,iBAAiB;QACjB,uKAAuK;QACvK,8DAA8D;QAC9D,WAAW,eAAgB,CAAA,UAAU,gBAAgB,YAAY,iBAAiB,SAAQ;QAC1F,kBAAkB,gBAAgB,OAAO,gBAAgB;QACzD,kBAAA;sBACF,gCAAC,CAAA,GAAA,qBAAa;QAAE,qBAAA;QAAoB,WAAW;qBAC7C,gCAAC,CAAA,GAAA,kBAAU;QACR,GAAG,YAAY;QAChB,KAAK;QACL,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL;QAGJ,SAAS;QACT,iBAAiB;qBACjB,gCAAC,CAAA,GAAA,uCAAgB;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAK,GAAG;;AAMpE","sources":["packages/@react-spectrum/combobox/src/ComboBox.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n dimensionValue,\n useFocusableRef,\n useIsMobileDevice,\n useResizeObserver,\n useUnwrapDOMRef\n} from '@react-spectrum/utils';\nimport comboboxStyles from './combobox.css';\nimport {DOMRefValue, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport {MobileComboBox} from './MobileComboBox';\nimport {Popover} from '@react-spectrum/overlays';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {\n ForwardedRef,\n InputHTMLAttributes,\n ReactElement,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport {SpectrumComboBoxProps} from '@react-types/combobox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useComboBox} from '@react-aria/combobox';\nimport {useComboBoxState} from '@react-stately/combobox';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\n\n/**\n * ComboBoxes combine a text entry with a picker menu, allowing users to filter longer lists to only the selections matching a query.\n */\nexport const ComboBox = React.forwardRef(function ComboBox<T extends object>(props: SpectrumComboBoxProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ComboBox.html#help-text');\n }\n\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // menuTrigger=focus/manual don't apply to mobile combobox\n return <MobileComboBox {...props} menuTrigger=\"input\" ref={ref} />;\n } else {\n return <ComboBoxBase {...props} ref={ref} />;\n }\n}) as <T>(props: SpectrumComboBoxProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\nconst ComboBoxBase = React.forwardRef(function ComboBoxBase(props: SpectrumComboBoxProps<any>, ref: FocusableRef<HTMLElement>) {\n let {\n menuTrigger = 'input',\n shouldFlip = true,\n direction = 'bottom',\n align = 'start',\n isQuiet,\n loadingState,\n onLoadMore,\n allowsCustomValue,\n menuWidth: customMenuWidth,\n name,\n formValue = 'text'\n } = props;\n if (allowsCustomValue) {\n formValue = 'text';\n }\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let isAsync = loadingState != null;\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);\n let buttonRef = useRef<FocusableRefValue<HTMLElement>>(null);\n let unwrappedButtonRef = useUnwrapDOMRef(buttonRef);\n let listBoxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement>(null);\n // serve as the new popover `triggerRef` instead of `unwrappedButtonRef` before for better positioning.\n let inputGroupRef = useRef<HTMLDivElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState(\n {\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: isAsync\n }\n );\n let layout = useListBoxLayout();\n\n let {buttonProps, inputProps, listBoxProps, labelProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useComboBox(\n {\n ...props,\n layoutDelegate: layout,\n buttonRef: unwrappedButtonRef,\n popoverRef: unwrappedPopoverRef,\n listBoxRef,\n inputRef: inputRef,\n menuTrigger,\n name: formValue === 'text' ? name : undefined\n },\n state\n );\n\n // Measure the width of the inputfield and the button to inform the width of the menu (below).\n let [menuWidth, setMenuWidth] = useState<number | undefined>(undefined);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (unwrappedButtonRef.current && inputRef.current) {\n let buttonWidth = unwrappedButtonRef.current.offsetWidth;\n let inputWidth = inputRef.current.offsetWidth;\n setMenuWidth(buttonWidth + inputWidth);\n }\n }, [unwrappedButtonRef, inputRef, setMenuWidth]);\n\n useResizeObserver({\n ref: domRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, onResize]);\n\n let width = isQuiet ? undefined : menuWidth;\n let style = {\n width: customMenuWidth ? dimensionValue(customMenuWidth) : width,\n minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth\n };\n let cbInputProps = {...props, children: null};\n\n return (\n <>\n <Field\n {...props}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n labelProps={labelProps}\n ref={domRef}>\n <ComboBoxInput\n {...cbInputProps}\n isOpen={state.isOpen}\n loadingState={loadingState}\n inputProps={inputProps}\n inputRef={inputRef}\n triggerProps={buttonProps}\n triggerRef={buttonRef}\n validationState={props.validationState || (isInvalid ? 'invalid' : undefined)}\n ref={inputGroupRef} />\n </Field>\n {name && formValue === 'key' && <input type=\"hidden\" name={name} form={props.form} value={state.selectedKey ?? ''} />}\n <Popover\n state={state}\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-InputGroup-popover', {'spectrum-InputGroup-popover--quiet': isQuiet})}\n ref={popoverRef}\n triggerRef={inputGroupRef}\n scrollRef={listBoxRef}\n placement={`${direction} ${align}`}\n hideArrow\n isNonModal\n shouldFlip={shouldFlip}>\n <ListBoxBase\n {...listBoxProps}\n ref={listBoxRef}\n disallowEmptySelection\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n isLoading={loadingState === 'loading' || loadingState === 'loadingMore'}\n showLoadingSpinner={loadingState === 'loadingMore'}\n onLoadMore={onLoadMore}\n renderEmptyState={() => isAsync && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {loadingState === 'loading' ? stringFormatter.format('loading') : stringFormatter.format('noResults')}\n </span>\n )} />\n </Popover>\n </>\n );\n});\n\ninterface ComboBoxInputProps extends SpectrumComboBoxProps<unknown> {\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n triggerProps: AriaButtonProps,\n triggerRef: RefObject<FocusableRefValue<HTMLElement> | null>,\n style?: React.CSSProperties,\n className?: string,\n isOpen?: boolean\n}\n\nconst ComboBoxInput = React.forwardRef(function ComboBoxInput(props: ComboBoxInputProps, ref: ForwardedRef<HTMLElement | null>) {\n let {\n isQuiet,\n isDisabled,\n validationState,\n inputProps,\n inputRef,\n triggerProps,\n triggerRef,\n autoFocus,\n style,\n className,\n loadingState,\n isOpen,\n menuTrigger\n } = props;\n let {hoverProps, isHovered} = useHover({});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader',\n classNames(\n styles,\n 'spectrum-InputGroup-input-circleLoader'\n )\n )} />\n );\n\n let isLoading = loadingState === 'loading' || loadingState === 'filtering';\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (isLoading && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (!isLoading) {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n }\n\n lastInputValue.current = inputValue;\n }, [isLoading, showLoading, inputValue]);\n\n useEffect(() => {\n return () => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n };\n }, []);\n\n return (\n (<FocusRing\n within\n isTextInput\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...hoverProps}\n ref={ref as RefObject<HTMLDivElement | null>}\n style={style}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n className\n )\n }>\n <TextFieldBase\n inputProps={inputProps}\n inputRef={inputRef}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n }\n inputClassName={\n classNames(\n styles,\n 'spectrum-InputGroup-input'\n )\n }\n validationIconClassName={\n classNames(\n styles,\n 'spectrum-InputGroup-input-validationIcon'\n )\n }\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n // loading circle should only be displayed if menu is open, if menuTrigger is \"manual\", or first time load (to stop circle from showing up when user selects an option)\n // TODO: add special case for completionMode: complete as well\n isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n disableFocusRing />\n <PressResponder preventFocusOnPress isPressed={isOpen}>\n <FieldButton\n {...triggerProps}\n ref={triggerRef}\n UNSAFE_className={\n classNames(\n styles,\n 'spectrum-FieldButton'\n )\n }\n isQuiet={isQuiet}\n validationState={validationState}>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-Dropdown-chevron')} />\n </FieldButton>\n </PressResponder>\n </div>\n </FocusRing>)\n );\n});\n"],"names":[],"version":3,"file":"ComboBox.module.js.map"}
@@ -1,4 +1,4 @@
1
- require("./combobox.02a75b23.css");
1
+ require("./combobox.8958325b.css");
2
2
  var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
3
3
  require("./combobox.1c1869da.css");
4
4
  var $41fae9390a5a37fa$exports = require("./combobox_css.main.js");
@@ -7,7 +7,7 @@ require("./combobox.cab3a9ff.css");
7
7
  var $eb2fc0ee655eff6b$exports = require("./fieldlabel_vars_css.main.js");
8
8
  require("./combobox.cce0a74c.css");
9
9
  var $1e139f06a0a4b696$exports = require("./search_vars_css.main.js");
10
- require("./combobox.6021f915.css");
10
+ require("./combobox.a38acc5c.css");
11
11
  var $2f86633ce5b04f1e$exports = require("./inputgroup_vars_css.main.js");
12
12
  require("./combobox.32e7c48f.css");
13
13
  var $40cb3a00c193680f$exports = require("./textfield_vars_css.main.js");
@@ -146,8 +146,7 @@ const $e514018f82d1b067$export$7637df911c069b4d = /*#__PURE__*/ (0, ($parcel$int
146
146
  // Ignore react warning.
147
147
  inputProps.onChange = ()=>{};
148
148
  }
149
- var _inputProps_value;
150
- (0, $iKVNA$reactariautils.useFormReset)(inputRef, String((_inputProps_value = inputProps.value) !== null && _inputProps_value !== void 0 ? _inputProps_value : ''), formValue === 'text' ? state.setInputValue : state.setSelectedKey);
149
+ (0, $iKVNA$reactariautils.useFormReset)(inputRef, formValue === 'text' ? state.defaultInputValue : state.defaultSelectedKey, formValue === 'text' ? state.setInputValue : state.setSelectedKey);
151
150
  return /*#__PURE__*/ (0, ($parcel$interopDefault($iKVNA$react))).createElement((0, ($parcel$interopDefault($iKVNA$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($iKVNA$react))).createElement((0, $iKVNA$reactspectrumlabel.Field), {
152
151
  ...props,
153
152
  labelProps: labelProps,
@@ -189,10 +188,14 @@ const $e514018f82d1b067$export$adfa0abcd5972f7e = /*#__PURE__*/ (0, ($parcel$int
189
188
  let stringFormatter = (0, $iKVNA$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($9e627d9ac6346a53$exports))), '@react-spectrum/combobox');
190
189
  let valueId = (0, $iKVNA$reactariautils.useId)();
191
190
  let invalidId = (0, $iKVNA$reactariautils.useId)();
191
+ let validId = (0, $iKVNA$reactariautils.useId)();
192
192
  let validationIcon = validationState === 'invalid' ? /*#__PURE__*/ (0, ($parcel$interopDefault($iKVNA$react))).createElement((0, ($parcel$interopDefault($iKVNA$spectrumiconsuiAlertMedium))), {
193
193
  id: invalidId,
194
194
  "aria-label": stringFormatter.format('invalid')
195
- }) : /*#__PURE__*/ (0, ($parcel$interopDefault($iKVNA$react))).createElement((0, ($parcel$interopDefault($iKVNA$spectrumiconsuiCheckmarkMedium))), null);
195
+ }) : /*#__PURE__*/ (0, ($parcel$interopDefault($iKVNA$react))).createElement((0, ($parcel$interopDefault($iKVNA$spectrumiconsuiCheckmarkMedium))), {
196
+ id: validId,
197
+ "aria-label": stringFormatter.format('valid')
198
+ });
196
199
  let validation = /*#__PURE__*/ (0, ($parcel$interopDefault($iKVNA$react))).cloneElement(validationIcon, {
197
200
  UNSAFE_className: (0, $iKVNA$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-validationIcon', (0, $iKVNA$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2f86633ce5b04f1e$exports))), 'spectrum-InputGroup-input-validationIcon'))
198
201
  });
@@ -204,7 +207,8 @@ const $e514018f82d1b067$export$adfa0abcd5972f7e = /*#__PURE__*/ (0, ($parcel$int
204
207
  props['aria-labelledby'],
205
208
  props['aria-label'] && !props['aria-labelledby'] ? props.id : null,
206
209
  valueId,
207
- validationState === 'invalid' ? invalidId : null
210
+ validationState === 'invalid' ? invalidId : null,
211
+ validationState === 'valid' ? validId : null
208
212
  ].filter(Boolean).join(' '),
209
213
  elementType: 'div'
210
214
  }, obj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AA,mDAAa,GACb;QAGJ,KAAK;QACL,UAAU;QACV,YAAY;QACZ,WAAW;sBACb,0DAAC,CAAA,GAAA,sCAAY;QAAE,WAAW;;AAIlC","sources":["packages/@react-spectrum/combobox/src/MobileComboBox.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {AriaButtonProps} from '@react-types/button';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {classNames, unwrapDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {ComboBoxState, useComboBoxState} from '@react-stately/combobox';\nimport comboboxStyles from './combobox.css';\nimport {DismissButton, useOverlayTrigger} from '@react-aria/overlays';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';\nimport {FocusRing, FocusScope} from '@react-aria/focus';\nimport {focusSafely, setInteractionModality, useHover} from '@react-aria/interactions';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport {mergeProps, useFormReset, useId, useObjectRef} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ForwardedRef, HTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode, useCallback, useEffect, useRef, useState} from 'react';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {SpectrumComboBoxProps} from '@react-types/combobox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '@react-spectrum/overlays';\nimport {useButton} from '@react-aria/button';\nimport {useComboBox} from '@react-aria/combobox';\nimport {useDialog} from '@react-aria/dialog';\nimport {useField} from '@react-aria/label';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormValidation} from '@react-aria/form';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nexport const MobileComboBox = React.forwardRef(function MobileComboBox(props: SpectrumComboBoxProps<any>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n\n let {\n isQuiet,\n isDisabled,\n isReadOnly,\n isRequired,\n validationBehavior,\n name,\n formValue = 'text',\n allowsCustomValue\n } = props;\n if (allowsCustomValue) {\n formValue = 'text';\n }\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState({\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: true,\n // Needs to be false here otherwise we double up on commitSelection/commitCustomValue calls when\n // user taps on underlay (i.e. initial tap will call setFocused(false) -> commitSelection/commitCustomValue via onBlur,\n // then the closing of the tray will call setFocused(false) again due to cleanup effect)\n shouldCloseOnBlur: false\n });\n\n let buttonRef = useRef<HTMLDivElement>(null);\n let domRef = useFocusableRef(ref, buttonRef);\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'listbox'}, state, buttonRef);\n\n let inputRef = useRef<HTMLInputElement>(null);\n useFormValidation({\n ...props,\n focus: () => buttonRef.current?.focus()\n }, state, inputRef);\n let {isInvalid, validationErrors, validationDetails} = state.displayValidation;\n let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);\n let errorMessage = props.errorMessage ?? validationErrors.join(' ');\n\n let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n ...props,\n labelElementType: 'span',\n isInvalid,\n errorMessage\n });\n\n // Focus the button and show focus ring when clicking on the label\n labelProps.onClick = () => {\n if (!props.isDisabled) {\n buttonRef.current?.focus();\n setInteractionModality('keyboard');\n }\n };\n\n let inputProps: InputHTMLAttributes<HTMLInputElement> = {\n type: 'hidden',\n name,\n value: formValue === 'text' ? state.inputValue : String(state.selectedKey)\n };\n\n if (validationBehavior === 'native') {\n // Use a hidden <input type=\"text\"> rather than <input type=\"hidden\">\n // so that an empty value blocks HTML form submission when the field is required.\n inputProps.type = 'text';\n inputProps.hidden = true;\n inputProps.required = isRequired;\n // Ignore react warning.\n inputProps.onChange = () => {};\n }\n\n useFormReset(inputRef, String(inputProps.value ?? ''), formValue === 'text' ? state.setInputValue : state.setSelectedKey);\n\n return (\n <>\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n elementType=\"span\"\n ref={domRef}\n includeNecessityIndicatorInAccessibilityName>\n <ComboBoxButton\n {...mergeProps(triggerProps, fieldProps, {autoFocus: props.autoFocus})}\n ref={buttonRef}\n isQuiet={isQuiet}\n isDisabled={isDisabled}\n isPlaceholder={!state.inputValue}\n validationState={validationState}\n onPress={() => !isReadOnly && state.open(null, 'manual')}>\n {state.inputValue || props.placeholder || ''}\n </ComboBoxButton>\n </Field>\n <input {...inputProps} ref={inputRef} />\n <Tray state={state} isFixedHeight {...overlayProps}>\n <ComboBoxTray\n {...props}\n onClose={state.close}\n overlayProps={overlayProps}\n state={state} />\n </Tray>\n </>\n );\n});\n\ninterface ComboBoxButtonProps extends AriaButtonProps {\n isQuiet?: boolean,\n isDisabled?: boolean,\n isPlaceholder?: boolean,\n validationState?: ValidationState,\n children?: ReactNode,\n style?: React.CSSProperties,\n className?: string\n}\n\nexport const ComboBoxButton = React.forwardRef(function ComboBoxButton(props: ComboBoxButtonProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n isQuiet,\n isDisabled,\n isPlaceholder,\n validationState,\n children,\n style,\n className\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let valueId = useId();\n let invalidId = useId();\n let validationIcon = validationState === 'invalid'\n ? <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n : <CheckmarkMedium />;\n\n let validation = React.cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon',\n classNames(\n styles,\n 'spectrum-InputGroup-input-validationIcon'\n )\n )\n });\n\n let objRef = useObjectRef(ref);\n let {hoverProps, isHovered} = useHover({});\n let {buttonProps, isPressed} = useButton({\n ...props,\n 'aria-labelledby': [\n props['aria-labelledby'],\n props['aria-label'] && !props['aria-labelledby'] ? props.id : null,\n valueId,\n validationState === 'invalid' ? invalidId : null\n ].filter(Boolean).join(' '),\n elementType: 'div'\n }, objRef);\n\n return (\n (<FocusRing\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...mergeProps(hoverProps, buttonProps)}\n aria-haspopup=\"dialog\"\n ref={objRef}\n style={{...style, outline: 'none'}}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n classNames(\n comboboxStyles,\n 'mobile-combobox'\n ),\n className\n )\n }>\n <div\n className={\n classNames(\n textfieldStyles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--quiet': isQuiet\n },\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n )\n }>\n <div\n className={\n classNames(\n textfieldStyles,\n 'spectrum-Textfield-input',\n {\n 'is-hovered': isHovered,\n 'is-placeholder': isPlaceholder,\n 'is-disabled': isDisabled\n },\n classNames(\n styles,\n 'spectrum-InputGroup-input',\n classNames(labelStyles, 'spectrum-Field-field')\n ),\n classNames(\n comboboxStyles,\n 'mobile-input'\n )\n )\n }>\n <span\n id={valueId}\n className={\n classNames(\n comboboxStyles,\n 'mobile-value'\n )\n }>\n {children}\n </span>\n </div>\n {validationState && !isDisabled ? validation : null}\n </div>\n <div\n className={\n classNames(\n buttonStyles,\n 'spectrum-FieldButton',\n {\n 'spectrum-FieldButton--quiet': isQuiet,\n 'is-active': isPressed,\n 'is-disabled': isDisabled,\n 'spectrum-FieldButton--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n classNames(\n styles,\n 'spectrum-FieldButton'\n )\n )\n }>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-Dropdown-chevron')} />\n </div>\n </div>\n </FocusRing>)\n );\n});\n\ninterface ComboBoxTrayProps extends SpectrumComboBoxProps<any> {\n state: ComboBoxState<any>,\n overlayProps: HTMLAttributes<HTMLElement>,\n loadingIndicator?: ReactElement,\n onClose: () => void\n}\n\nfunction ComboBoxTray(props: ComboBoxTrayProps) {\n let {\n // completionMode = 'suggest',\n state,\n isDisabled,\n validationState,\n label,\n overlayProps,\n loadingState,\n onLoadMore,\n onClose\n } = props;\n\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n let inputRef = useRef<HTMLInputElement>(null);\n let buttonRef = useRef<FocusableRefValue<HTMLElement>>(null);\n let popoverRef = useRef<HTMLDivElement>(null);\n let listBoxRef = useRef<HTMLDivElement>(null);\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n let layout = useListBoxLayout();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n\n let {inputProps, listBoxProps, labelProps} = useComboBox(\n {\n ...props,\n // completionMode,\n layoutDelegate: layout,\n buttonRef: unwrapDOMRef(buttonRef),\n popoverRef: popoverRef,\n listBoxRef,\n inputRef,\n // Handled outside the tray.\n name: undefined\n },\n state\n );\n\n React.useEffect(() => {\n if (inputRef.current) {\n focusSafely(inputRef.current);\n }\n }, []);\n\n React.useEffect(() => {\n // When the tray closes, set state.isFocused (i.e. the tray input's focus tracker) to false.\n // This is to prevent state.isFocused from being set to true when the tray closes via tapping on the underlay\n // (FocusScope attempts to restore focus to the tray input when tapping outside the tray due to \"contain\")\n // Have to do this manually since React doesn't call onBlur when a component is unmounted: https://github.com/facebook/react/issues/12363\n if (!state.isOpen && state.isFocused) {\n state.setFocused(false);\n }\n });\n\n let {dialogProps} = useDialog({\n 'aria-labelledby': useId(labelProps.id)\n }, popoverRef);\n\n // Override the role of the input to \"searchbox\" instead of \"combobox\".\n // Since the listbox is always visible, the combobox role doesn't really give us anything.\n // VoiceOver on iOS reads \"double tap to collapse\" when focused on the input rather than\n // \"double tap to edit text\", as with a textbox or searchbox. We'd like double tapping to\n // open the virtual keyboard rather than closing the tray.\n // Unlike \"combobox\", \"aria-expanded\" is not a valid attribute on \"searchbox\".\n inputProps.role = 'searchbox';\n inputProps['aria-haspopup'] = 'listbox';\n delete inputProps['aria-expanded'];\n delete inputProps.onTouchEnd;\n\n let clearButton = (\n <ClearButton\n preventFocus\n aria-label={stringFormatter.format('clear')}\n excludeFromTabOrder\n onPress={() => {\n state.setInputValue('');\n inputRef.current?.focus();\n }}\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n searchStyles,\n 'spectrum-Search-circleLoader',\n classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader'\n )\n )} />\n );\n\n // Close the software keyboard on scroll to give the user a bigger area to scroll.\n // But only do this if scrolling with touch, otherwise it can cause issues with touch\n // screen readers.\n let isTouchDown = useRef(false);\n let onTouchStart = () => {\n isTouchDown.current = true;\n };\n\n let onTouchEnd = () => {\n isTouchDown.current = false;\n };\n\n let onScroll = useCallback(() => {\n if (!inputRef.current || document.activeElement !== inputRef.current || !isTouchDown.current) {\n return;\n }\n\n popoverRef.current?.focus();\n }, [inputRef, popoverRef, isTouchDown]);\n\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (loadingState === 'filtering' && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (loadingState !== 'filtering') {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n }\n\n lastInputValue.current = inputValue;\n }, [loadingState, inputValue, showLoading]);\n\n let onKeyDown = (e) => {\n // Close virtual keyboard if user hits Enter w/o any focused options\n if (e.key === 'Enter' && state.selectionManager.focusedKey == null) {\n popoverRef.current?.focus();\n } else {\n inputProps.onKeyDown?.(e);\n }\n };\n\n return (\n <FocusScope restoreFocus contain>\n <div\n {...mergeProps(overlayProps, dialogProps)}\n ref={popoverRef}\n className={\n classNames(\n comboboxStyles,\n 'tray-dialog'\n )\n }>\n <DismissButton onDismiss={onClose} />\n <TextFieldBase\n label={label}\n labelProps={labelProps}\n inputProps={{...inputProps, onKeyDown}}\n inputRef={inputRef}\n isDisabled={isDisabled}\n isLoading={showLoading && loadingState === 'filtering'}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n validationState={validationState}\n labelAlign=\"start\"\n labelPosition=\"top\"\n wrapperChildren={(state.inputValue !== '' || loadingState === 'filtering' || validationState != null) && !props.isReadOnly ? clearButton : undefined}\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-Search',\n 'spectrum-Textfield',\n 'spectrum-Search--loadable',\n {\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n classNames(\n comboboxStyles,\n 'tray-textfield',\n {\n 'has-label': !!props.label\n }\n )\n )\n }\n inputClassName={\n classNames(\n comboboxStyles,\n 'tray-textfield-input',\n classNames(\n searchStyles,\n 'spectrum-Search-input'\n )\n )\n }\n validationIconClassName={\n classNames(\n searchStyles,\n 'spectrum-Search-validationIcon'\n )\n } />\n <ListBoxBase\n {...listBoxProps}\n domProps={{onTouchStart, onTouchEnd}}\n disallowEmptySelection\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n renderEmptyState={() => loadingState !== 'loading' && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )}\n UNSAFE_className={\n classNames(\n comboboxStyles,\n 'tray-listbox'\n )\n }\n ref={listBoxRef}\n onScroll={onScroll}\n onLoadMore={onLoadMore}\n isLoading={isLoading} />\n <DismissButton onDismiss={onClose} />\n </div>\n </FocusScope>\n );\n}\n"],"names":[],"version":3,"file":"MobileComboBox.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCM,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,eAAe,KAAiC,EAAE,GAA8B;IACtI,QAAQ,CAAA,GAAA,6CAAe,EAAE;IAEzB,IAAI,WACF,OAAO,cACP,UAAU,cACV,UAAU,cACV,UAAU,sBACV,kBAAkB,QAClB,IAAI,aACJ,YAAY,2BACZ,iBAAiB,EAClB,GAAG;IACJ,IAAI,mBACF,YAAY;IAGd,IAAI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;QACX,eAAc;QACd,iBAAiB,AAAC,CAAA,MAAM,UAAU,KAAK,MAAM,iBAAiB,eAAe,mBAAmB,IAAG,KAAM,CAAC,MAAM,UAAU,GAAG,cAAc;QAC3I,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAW,GACX,mBACA,sBACA,6BACA;YACE,4BAA4B,oBAAoB,aAAa,CAAC;YAC9D,0BAA0B,oBAAoB,WAAW,CAAC;QAC5D,GACA,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAa,GACb,kBACA;YACE,aAAa,CAAC,CAAC,MAAM,KAAK;QAC5B;QAIN,gBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAa,GACb,wBACA,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAW,GACX;QAIN,yBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAW,GACX;sBAGN,0DAAC,CAAA,GAAA,uCAAU;QACR,GAAG,YAAY;QAChB,UAAU;0BAAC;wBAAc;QAAU;QACnC,wBAAA;QACA,uBAAA;QACA,qBAAA;QACA,QAAQ;QACR,OAAO;QACP,uBAAA;QACA,kBAAkB,IAAM,iBAAiB,2BACvC,0DAAC;gBAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAa,GAAG;eACzC,gBAAgB,MAAM,CAAC;QAG5B,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAa,GACb;QAGJ,KAAK;QACL,UAAU;QACV,YAAY;QACZ,WAAW;sBACb,0DAAC,CAAA,GAAA,sCAAY;QAAE,WAAW;;AAIlC","sources":["packages/@react-spectrum/combobox/src/MobileComboBox.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\n\nimport AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport {AriaButtonProps} from '@react-types/button';\nimport buttonStyles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {classNames, unwrapDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {ComboBoxState, useComboBoxState} from '@react-stately/combobox';\nimport comboboxStyles from './combobox.css';\nimport {DismissButton, useOverlayTrigger} from '@react-aria/overlays';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';\nimport {FocusRing, FocusScope} from '@react-aria/focus';\nimport {focusSafely, setInteractionModality, useHover} from '@react-aria/interactions';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport {mergeProps, useFormReset, useId, useObjectRef} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ForwardedRef, HTMLAttributes, InputHTMLAttributes, ReactElement, ReactNode, useCallback, useEffect, useRef, useState} from 'react';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {SpectrumComboBoxProps} from '@react-types/combobox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '@react-spectrum/overlays';\nimport {useButton} from '@react-aria/button';\nimport {useComboBox} from '@react-aria/combobox';\nimport {useDialog} from '@react-aria/dialog';\nimport {useField} from '@react-aria/label';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormValidation} from '@react-aria/form';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nexport const MobileComboBox = React.forwardRef(function MobileComboBox(props: SpectrumComboBoxProps<any>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n\n let {\n isQuiet,\n isDisabled,\n isReadOnly,\n isRequired,\n validationBehavior,\n name,\n formValue = 'text',\n allowsCustomValue\n } = props;\n if (allowsCustomValue) {\n formValue = 'text';\n }\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState({\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: true,\n // Needs to be false here otherwise we double up on commitSelection/commitCustomValue calls when\n // user taps on underlay (i.e. initial tap will call setFocused(false) -> commitSelection/commitCustomValue via onBlur,\n // then the closing of the tray will call setFocused(false) again due to cleanup effect)\n shouldCloseOnBlur: false\n });\n\n let buttonRef = useRef<HTMLDivElement>(null);\n let domRef = useFocusableRef(ref, buttonRef);\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'listbox'}, state, buttonRef);\n\n let inputRef = useRef<HTMLInputElement>(null);\n useFormValidation({\n ...props,\n focus: () => buttonRef.current?.focus()\n }, state, inputRef);\n let {isInvalid, validationErrors, validationDetails} = state.displayValidation;\n let validationState = props.validationState || (isInvalid ? 'invalid' : undefined);\n let errorMessage = props.errorMessage ?? validationErrors.join(' ');\n\n let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n ...props,\n labelElementType: 'span',\n isInvalid,\n errorMessage\n });\n\n // Focus the button and show focus ring when clicking on the label\n labelProps.onClick = () => {\n if (!props.isDisabled) {\n buttonRef.current?.focus();\n setInteractionModality('keyboard');\n }\n };\n\n let inputProps: InputHTMLAttributes<HTMLInputElement> = {\n type: 'hidden',\n name,\n value: formValue === 'text' ? state.inputValue : String(state.selectedKey)\n };\n\n if (validationBehavior === 'native') {\n // Use a hidden <input type=\"text\"> rather than <input type=\"hidden\">\n // so that an empty value blocks HTML form submission when the field is required.\n inputProps.type = 'text';\n inputProps.hidden = true;\n inputProps.required = isRequired;\n // Ignore react warning.\n inputProps.onChange = () => {};\n }\n\n useFormReset<any>(\n inputRef,\n formValue === 'text' ? state.defaultInputValue : state.defaultSelectedKey,\n formValue === 'text' ? state.setInputValue : state.setSelectedKey\n );\n\n return (\n <>\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n elementType=\"span\"\n ref={domRef}\n includeNecessityIndicatorInAccessibilityName>\n <ComboBoxButton\n {...mergeProps(triggerProps, fieldProps, {autoFocus: props.autoFocus})}\n ref={buttonRef}\n isQuiet={isQuiet}\n isDisabled={isDisabled}\n isPlaceholder={!state.inputValue}\n validationState={validationState}\n onPress={() => !isReadOnly && state.open(null, 'manual')}>\n {state.inputValue || props.placeholder || ''}\n </ComboBoxButton>\n </Field>\n <input {...inputProps} ref={inputRef} />\n <Tray state={state} isFixedHeight {...overlayProps}>\n <ComboBoxTray\n {...props}\n onClose={state.close}\n overlayProps={overlayProps}\n state={state} />\n </Tray>\n </>\n );\n});\n\ninterface ComboBoxButtonProps extends AriaButtonProps {\n isQuiet?: boolean,\n isDisabled?: boolean,\n isPlaceholder?: boolean,\n validationState?: ValidationState,\n children?: ReactNode,\n style?: React.CSSProperties,\n className?: string\n}\n\nexport const ComboBoxButton = React.forwardRef(function ComboBoxButton(props: ComboBoxButtonProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n isQuiet,\n isDisabled,\n isPlaceholder,\n validationState,\n children,\n style,\n className\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let valueId = useId();\n let invalidId = useId();\n let validId = useId();\n let validationIcon = validationState === 'invalid'\n ? <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n : <CheckmarkMedium id={validId} aria-label={stringFormatter.format('valid')} />;\n\n let validation = React.cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon',\n classNames(\n styles,\n 'spectrum-InputGroup-input-validationIcon'\n )\n )\n });\n\n let objRef = useObjectRef(ref);\n let {hoverProps, isHovered} = useHover({});\n let {buttonProps, isPressed} = useButton({\n ...props,\n 'aria-labelledby': [\n props['aria-labelledby'],\n props['aria-label'] && !props['aria-labelledby'] ? props.id : null,\n valueId,\n validationState === 'invalid' ? invalidId : null,\n validationState === 'valid' ? validId : null\n ].filter(Boolean).join(' '),\n elementType: 'div'\n }, objRef);\n\n return (\n (<FocusRing\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...mergeProps(hoverProps, buttonProps)}\n aria-haspopup=\"dialog\"\n ref={objRef}\n style={{...style, outline: 'none'}}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n classNames(\n comboboxStyles,\n 'mobile-combobox'\n ),\n className\n )\n }>\n <div\n className={\n classNames(\n textfieldStyles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--quiet': isQuiet\n },\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n )\n }>\n <div\n className={\n classNames(\n textfieldStyles,\n 'spectrum-Textfield-input',\n {\n 'is-hovered': isHovered,\n 'is-placeholder': isPlaceholder,\n 'is-disabled': isDisabled\n },\n classNames(\n styles,\n 'spectrum-InputGroup-input',\n classNames(labelStyles, 'spectrum-Field-field')\n ),\n classNames(\n comboboxStyles,\n 'mobile-input'\n )\n )\n }>\n <span\n id={valueId}\n className={\n classNames(\n comboboxStyles,\n 'mobile-value'\n )\n }>\n {children}\n </span>\n </div>\n {validationState && !isDisabled ? validation : null}\n </div>\n <div\n className={\n classNames(\n buttonStyles,\n 'spectrum-FieldButton',\n {\n 'spectrum-FieldButton--quiet': isQuiet,\n 'is-active': isPressed,\n 'is-disabled': isDisabled,\n 'spectrum-FieldButton--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n classNames(\n styles,\n 'spectrum-FieldButton'\n )\n )\n }>\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-Dropdown-chevron')} />\n </div>\n </div>\n </FocusRing>)\n );\n});\n\ninterface ComboBoxTrayProps extends SpectrumComboBoxProps<any> {\n state: ComboBoxState<any>,\n overlayProps: HTMLAttributes<HTMLElement>,\n loadingIndicator?: ReactElement,\n onClose: () => void\n}\n\nfunction ComboBoxTray(props: ComboBoxTrayProps) {\n let {\n // completionMode = 'suggest',\n state,\n isDisabled,\n validationState,\n label,\n overlayProps,\n loadingState,\n onLoadMore,\n onClose\n } = props;\n\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n let inputRef = useRef<HTMLInputElement>(null);\n let buttonRef = useRef<FocusableRefValue<HTMLElement>>(null);\n let popoverRef = useRef<HTMLDivElement>(null);\n let listBoxRef = useRef<HTMLDivElement>(null);\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n let layout = useListBoxLayout();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n\n let {inputProps, listBoxProps, labelProps} = useComboBox(\n {\n ...props,\n // completionMode,\n layoutDelegate: layout,\n buttonRef: unwrapDOMRef(buttonRef),\n popoverRef: popoverRef,\n listBoxRef,\n inputRef,\n // Handled outside the tray.\n name: undefined\n },\n state\n );\n\n React.useEffect(() => {\n if (inputRef.current) {\n focusSafely(inputRef.current);\n }\n }, []);\n\n React.useEffect(() => {\n // When the tray closes, set state.isFocused (i.e. the tray input's focus tracker) to false.\n // This is to prevent state.isFocused from being set to true when the tray closes via tapping on the underlay\n // (FocusScope attempts to restore focus to the tray input when tapping outside the tray due to \"contain\")\n // Have to do this manually since React doesn't call onBlur when a component is unmounted: https://github.com/facebook/react/issues/12363\n if (!state.isOpen && state.isFocused) {\n state.setFocused(false);\n }\n });\n\n let {dialogProps} = useDialog({\n 'aria-labelledby': useId(labelProps.id)\n }, popoverRef);\n\n // Override the role of the input to \"searchbox\" instead of \"combobox\".\n // Since the listbox is always visible, the combobox role doesn't really give us anything.\n // VoiceOver on iOS reads \"double tap to collapse\" when focused on the input rather than\n // \"double tap to edit text\", as with a textbox or searchbox. We'd like double tapping to\n // open the virtual keyboard rather than closing the tray.\n // Unlike \"combobox\", \"aria-expanded\" is not a valid attribute on \"searchbox\".\n inputProps.role = 'searchbox';\n inputProps['aria-haspopup'] = 'listbox';\n delete inputProps['aria-expanded'];\n delete inputProps.onTouchEnd;\n\n let clearButton = (\n <ClearButton\n preventFocus\n aria-label={stringFormatter.format('clear')}\n excludeFromTabOrder\n onPress={() => {\n state.setInputValue('');\n inputRef.current?.focus();\n }}\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n searchStyles,\n 'spectrum-Search-circleLoader',\n classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader'\n )\n )} />\n );\n\n // Close the software keyboard on scroll to give the user a bigger area to scroll.\n // But only do this if scrolling with touch, otherwise it can cause issues with touch\n // screen readers.\n let isTouchDown = useRef(false);\n let onTouchStart = () => {\n isTouchDown.current = true;\n };\n\n let onTouchEnd = () => {\n isTouchDown.current = false;\n };\n\n let onScroll = useCallback(() => {\n if (!inputRef.current || document.activeElement !== inputRef.current || !isTouchDown.current) {\n return;\n }\n\n popoverRef.current?.focus();\n }, [inputRef, popoverRef, isTouchDown]);\n\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (loadingState === 'filtering' && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (loadingState !== 'filtering') {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n timeout.current = null;\n }\n\n lastInputValue.current = inputValue;\n }, [loadingState, inputValue, showLoading]);\n\n let onKeyDown = (e) => {\n // Close virtual keyboard if user hits Enter w/o any focused options\n if (e.key === 'Enter' && state.selectionManager.focusedKey == null) {\n popoverRef.current?.focus();\n } else {\n inputProps.onKeyDown?.(e);\n }\n };\n\n return (\n <FocusScope restoreFocus contain>\n <div\n {...mergeProps(overlayProps, dialogProps)}\n ref={popoverRef}\n className={\n classNames(\n comboboxStyles,\n 'tray-dialog'\n )\n }>\n <DismissButton onDismiss={onClose} />\n <TextFieldBase\n label={label}\n labelProps={labelProps}\n inputProps={{...inputProps, onKeyDown}}\n inputRef={inputRef}\n isDisabled={isDisabled}\n isLoading={showLoading && loadingState === 'filtering'}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n validationState={validationState}\n labelAlign=\"start\"\n labelPosition=\"top\"\n wrapperChildren={(state.inputValue !== '' || loadingState === 'filtering' || validationState != null) && !props.isReadOnly ? clearButton : undefined}\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-Search',\n 'spectrum-Textfield',\n 'spectrum-Search--loadable',\n {\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n classNames(\n comboboxStyles,\n 'tray-textfield',\n {\n 'has-label': !!props.label\n }\n )\n )\n }\n inputClassName={\n classNames(\n comboboxStyles,\n 'tray-textfield-input',\n classNames(\n searchStyles,\n 'spectrum-Search-input'\n )\n )\n }\n validationIconClassName={\n classNames(\n searchStyles,\n 'spectrum-Search-validationIcon'\n )\n } />\n <ListBoxBase\n {...listBoxProps}\n domProps={{onTouchStart, onTouchEnd}}\n disallowEmptySelection\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n renderEmptyState={() => loadingState !== 'loading' && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )}\n UNSAFE_className={\n classNames(\n comboboxStyles,\n 'tray-listbox'\n )\n }\n ref={listBoxRef}\n onScroll={onScroll}\n onLoadMore={onLoadMore}\n isLoading={isLoading} />\n <DismissButton onDismiss={onClose} />\n </div>\n </FocusScope>\n );\n}\n"],"names":[],"version":3,"file":"MobileComboBox.main.js.map"}
@@ -1,4 +1,4 @@
1
- import "./combobox.02a75b23.css";
1
+ import "./combobox.8958325b.css";
2
2
  import $gRayl$button_vars_cssmodulejs from "./button_vars_css.mjs";
3
3
  import "./combobox.1c1869da.css";
4
4
  import $gRayl$combobox_cssmodulejs from "./combobox_css.mjs";
@@ -7,7 +7,7 @@ import "./combobox.cab3a9ff.css";
7
7
  import $gRayl$fieldlabel_vars_cssmodulejs from "./fieldlabel_vars_css.mjs";
8
8
  import "./combobox.cce0a74c.css";
9
9
  import $gRayl$search_vars_cssmodulejs from "./search_vars_css.mjs";
10
- import "./combobox.6021f915.css";
10
+ import "./combobox.a38acc5c.css";
11
11
  import $gRayl$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.mjs";
12
12
  import "./combobox.32e7c48f.css";
13
13
  import $gRayl$textfield_vars_cssmodulejs from "./textfield_vars_css.mjs";
@@ -140,8 +140,7 @@ const $a1ae4cad4496428f$export$7637df911c069b4d = /*#__PURE__*/ (0, $gRayl$react
140
140
  // Ignore react warning.
141
141
  inputProps.onChange = ()=>{};
142
142
  }
143
- var _inputProps_value;
144
- (0, $gRayl$useFormReset)(inputRef, String((_inputProps_value = inputProps.value) !== null && _inputProps_value !== void 0 ? _inputProps_value : ''), formValue === 'text' ? state.setInputValue : state.setSelectedKey);
143
+ (0, $gRayl$useFormReset)(inputRef, formValue === 'text' ? state.defaultInputValue : state.defaultSelectedKey, formValue === 'text' ? state.setInputValue : state.setSelectedKey);
145
144
  return /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$react).Fragment, null, /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$Field), {
146
145
  ...props,
147
146
  labelProps: labelProps,
@@ -183,10 +182,14 @@ const $a1ae4cad4496428f$export$adfa0abcd5972f7e = /*#__PURE__*/ (0, $gRayl$react
183
182
  let stringFormatter = (0, $gRayl$useLocalizedStringFormatter)((0, ($parcel$interopDefault($gRayl$intlStringsmodulejs))), '@react-spectrum/combobox');
184
183
  let valueId = (0, $gRayl$useId)();
185
184
  let invalidId = (0, $gRayl$useId)();
185
+ let validId = (0, $gRayl$useId)();
186
186
  let validationIcon = validationState === 'invalid' ? /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$spectrumiconsuiAlertMedium), {
187
187
  id: invalidId,
188
188
  "aria-label": stringFormatter.format('invalid')
189
- }) : /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$spectrumiconsuiCheckmarkMedium), null);
189
+ }) : /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$spectrumiconsuiCheckmarkMedium), {
190
+ id: validId,
191
+ "aria-label": stringFormatter.format('valid')
192
+ });
190
193
  let validation = /*#__PURE__*/ (0, $gRayl$react).cloneElement(validationIcon, {
191
194
  UNSAFE_className: (0, $gRayl$classNames)((0, ($parcel$interopDefault($gRayl$textfield_vars_cssmodulejs))), 'spectrum-Textfield-validationIcon', (0, $gRayl$classNames)((0, ($parcel$interopDefault($gRayl$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup-input-validationIcon'))
192
195
  });
@@ -198,7 +201,8 @@ const $a1ae4cad4496428f$export$adfa0abcd5972f7e = /*#__PURE__*/ (0, $gRayl$react
198
201
  props['aria-labelledby'],
199
202
  props['aria-label'] && !props['aria-labelledby'] ? props.id : null,
200
203
  valueId,
201
- validationState === 'invalid' ? invalidId : null
204
+ validationState === 'invalid' ? invalidId : null,
205
+ validationState === 'valid' ? validId : null
202
206
  ].filter(Boolean).join(' '),
203
207
  elementType: 'div'
204
208
  }, objRef);
@@ -1,4 +1,4 @@
1
- import "./combobox.02a75b23.css";
1
+ import "./combobox.8958325b.css";
2
2
  import $gRayl$button_vars_cssmodulejs from "./button_vars_css.module.js";
3
3
  import "./combobox.1c1869da.css";
4
4
  import $gRayl$combobox_cssmodulejs from "./combobox_css.module.js";
@@ -7,7 +7,7 @@ import "./combobox.cab3a9ff.css";
7
7
  import $gRayl$fieldlabel_vars_cssmodulejs from "./fieldlabel_vars_css.module.js";
8
8
  import "./combobox.cce0a74c.css";
9
9
  import $gRayl$search_vars_cssmodulejs from "./search_vars_css.module.js";
10
- import "./combobox.6021f915.css";
10
+ import "./combobox.a38acc5c.css";
11
11
  import $gRayl$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.module.js";
12
12
  import "./combobox.32e7c48f.css";
13
13
  import $gRayl$textfield_vars_cssmodulejs from "./textfield_vars_css.module.js";
@@ -140,8 +140,7 @@ const $a1ae4cad4496428f$export$7637df911c069b4d = /*#__PURE__*/ (0, $gRayl$react
140
140
  // Ignore react warning.
141
141
  inputProps.onChange = ()=>{};
142
142
  }
143
- var _inputProps_value;
144
- (0, $gRayl$useFormReset)(inputRef, String((_inputProps_value = inputProps.value) !== null && _inputProps_value !== void 0 ? _inputProps_value : ''), formValue === 'text' ? state.setInputValue : state.setSelectedKey);
143
+ (0, $gRayl$useFormReset)(inputRef, formValue === 'text' ? state.defaultInputValue : state.defaultSelectedKey, formValue === 'text' ? state.setInputValue : state.setSelectedKey);
145
144
  return /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$react).Fragment, null, /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$Field), {
146
145
  ...props,
147
146
  labelProps: labelProps,
@@ -183,10 +182,14 @@ const $a1ae4cad4496428f$export$adfa0abcd5972f7e = /*#__PURE__*/ (0, $gRayl$react
183
182
  let stringFormatter = (0, $gRayl$useLocalizedStringFormatter)((0, ($parcel$interopDefault($gRayl$intlStringsmodulejs))), '@react-spectrum/combobox');
184
183
  let valueId = (0, $gRayl$useId)();
185
184
  let invalidId = (0, $gRayl$useId)();
185
+ let validId = (0, $gRayl$useId)();
186
186
  let validationIcon = validationState === 'invalid' ? /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$spectrumiconsuiAlertMedium), {
187
187
  id: invalidId,
188
188
  "aria-label": stringFormatter.format('invalid')
189
- }) : /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$spectrumiconsuiCheckmarkMedium), null);
189
+ }) : /*#__PURE__*/ (0, $gRayl$react).createElement((0, $gRayl$spectrumiconsuiCheckmarkMedium), {
190
+ id: validId,
191
+ "aria-label": stringFormatter.format('valid')
192
+ });
190
193
  let validation = /*#__PURE__*/ (0, $gRayl$react).cloneElement(validationIcon, {
191
194
  UNSAFE_className: (0, $gRayl$classNames)((0, ($parcel$interopDefault($gRayl$textfield_vars_cssmodulejs))), 'spectrum-Textfield-validationIcon', (0, $gRayl$classNames)((0, ($parcel$interopDefault($gRayl$inputgroup_vars_cssmodulejs))), 'spectrum-InputGroup-input-validationIcon'))
192
195
  });
@@ -198,7 +201,8 @@ const $a1ae4cad4496428f$export$adfa0abcd5972f7e = /*#__PURE__*/ (0, $gRayl$react
198
201
  props['aria-labelledby'],
199
202
  props['aria-label'] && !props['aria-labelledby'] ? props.id : null,
200
203
  valueId,
201
- validationState === 'invalid' ? invalidId : null
204
+ validationState === 'invalid' ? invalidId : null,
205
+ validationState === 'valid' ? validId : null
202
206
  ].filter(Boolean).join(' '),
203
207
  elementType: 'div'
204
208
  }, objRef);