@adobe/react-spectrum 3.47.2 → 3.47.3
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.
- package/dist/private/actionbar/ActionBar.cjs +2 -3
- package/dist/private/actionbar/ActionBar.cjs.map +1 -1
- package/dist/private/actionbar/ActionBar.js +2 -3
- package/dist/private/actionbar/ActionBar.js.map +1 -1
- package/dist/private/actionbar/ActionBar.mjs +2 -3
- package/dist/private/actionbar/ActionBar.mjs.map +1 -1
- package/dist/private/actiongroup/ActionGroup.cjs +5 -1
- package/dist/private/actiongroup/ActionGroup.cjs.map +1 -1
- package/dist/private/actiongroup/ActionGroup.js +5 -1
- package/dist/private/actiongroup/ActionGroup.js.map +1 -1
- package/dist/private/actiongroup/ActionGroup.mjs +5 -1
- package/dist/private/actiongroup/ActionGroup.mjs.map +1 -1
- package/dist/private/autocomplete/MobileSearchAutocomplete.cjs +6 -0
- package/dist/private/autocomplete/MobileSearchAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/MobileSearchAutocomplete.js +6 -0
- package/dist/private/autocomplete/MobileSearchAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/MobileSearchAutocomplete.mjs +6 -0
- package/dist/private/autocomplete/MobileSearchAutocomplete.mjs.map +1 -1
- package/dist/private/autocomplete/SearchAutocomplete.cjs +1 -0
- package/dist/private/autocomplete/SearchAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/SearchAutocomplete.js +1 -0
- package/dist/private/autocomplete/SearchAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/SearchAutocomplete.mjs +1 -0
- package/dist/private/autocomplete/SearchAutocomplete.mjs.map +1 -1
- package/dist/private/button/Button.cjs +2 -1
- package/dist/private/button/Button.cjs.map +1 -1
- package/dist/private/button/Button.js +3 -2
- package/dist/private/button/Button.js.map +1 -1
- package/dist/private/button/Button.mjs +3 -2
- package/dist/private/button/Button.mjs.map +1 -1
- package/dist/private/button/ClearButton.cjs +2 -1
- package/dist/private/button/ClearButton.cjs.map +1 -1
- package/dist/private/button/ClearButton.js +2 -1
- package/dist/private/button/ClearButton.js.map +1 -1
- package/dist/private/button/ClearButton.mjs +2 -1
- package/dist/private/button/ClearButton.mjs.map +1 -1
- package/dist/private/buttongroup/ButtonGroup.cjs +4 -2
- package/dist/private/buttongroup/ButtonGroup.cjs.map +1 -1
- package/dist/private/buttongroup/ButtonGroup.js +4 -2
- package/dist/private/buttongroup/ButtonGroup.js.map +1 -1
- package/dist/private/buttongroup/ButtonGroup.mjs +4 -2
- package/dist/private/buttongroup/ButtonGroup.mjs.map +1 -1
- package/dist/private/card/CardBase.cjs +1 -0
- package/dist/private/card/CardBase.cjs.map +1 -1
- package/dist/private/card/CardBase.js +1 -0
- package/dist/private/card/CardBase.js.map +1 -1
- package/dist/private/card/CardBase.mjs +1 -0
- package/dist/private/card/CardBase.mjs.map +1 -1
- package/dist/private/card/CardView.cjs +3 -0
- package/dist/private/card/CardView.cjs.map +1 -1
- package/dist/private/card/CardView.js +3 -0
- package/dist/private/card/CardView.js.map +1 -1
- package/dist/private/card/CardView.mjs +3 -0
- package/dist/private/card/CardView.mjs.map +1 -1
- package/dist/private/checkbox/Checkbox.cjs.map +1 -1
- package/dist/private/checkbox/Checkbox.js.map +1 -1
- package/dist/private/checkbox/Checkbox.mjs.map +1 -1
- package/dist/private/color/ColorField.cjs +1 -0
- package/dist/private/color/ColorField.cjs.map +1 -1
- package/dist/private/color/ColorField.js +1 -0
- package/dist/private/color/ColorField.js.map +1 -1
- package/dist/private/color/ColorField.mjs +1 -0
- package/dist/private/color/ColorField.mjs.map +1 -1
- package/dist/private/color/ColorPicker.cjs.map +1 -1
- package/dist/private/color/ColorPicker.js.map +1 -1
- package/dist/private/color/ColorPicker.mjs.map +1 -1
- package/dist/private/color/ColorSwatch.cjs +2 -1
- package/dist/private/color/ColorSwatch.cjs.map +1 -1
- package/dist/private/color/ColorSwatch.js +2 -1
- package/dist/private/color/ColorSwatch.js.map +1 -1
- package/dist/private/color/ColorSwatch.mjs +2 -1
- package/dist/private/color/ColorSwatch.mjs.map +1 -1
- package/dist/private/color/ColorSwatchPicker.cjs.map +1 -1
- package/dist/private/color/ColorSwatchPicker.js.map +1 -1
- package/dist/private/color/ColorSwatchPicker.mjs.map +1 -1
- package/dist/private/color/ColorWheel.cjs +1 -0
- package/dist/private/color/ColorWheel.cjs.map +1 -1
- package/dist/private/color/ColorWheel.js +1 -0
- package/dist/private/color/ColorWheel.js.map +1 -1
- package/dist/private/color/ColorWheel.mjs +1 -0
- package/dist/private/color/ColorWheel.mjs.map +1 -1
- package/dist/private/combobox/ComboBox.cjs +1 -0
- package/dist/private/combobox/ComboBox.cjs.map +1 -1
- package/dist/private/combobox/ComboBox.js +1 -0
- package/dist/private/combobox/ComboBox.js.map +1 -1
- package/dist/private/combobox/ComboBox.mjs +1 -0
- package/dist/private/combobox/ComboBox.mjs.map +1 -1
- package/dist/private/combobox/MobileComboBox.cjs +8 -0
- package/dist/private/combobox/MobileComboBox.cjs.map +1 -1
- package/dist/private/combobox/MobileComboBox.js +8 -0
- package/dist/private/combobox/MobileComboBox.js.map +1 -1
- package/dist/private/combobox/MobileComboBox.mjs +8 -0
- package/dist/private/combobox/MobileComboBox.mjs.map +1 -1
- package/dist/private/datepicker/DateField.cjs +2 -1
- package/dist/private/datepicker/DateField.cjs.map +1 -1
- package/dist/private/datepicker/DateField.js +2 -1
- package/dist/private/datepicker/DateField.js.map +1 -1
- package/dist/private/datepicker/DateField.mjs +2 -1
- package/dist/private/datepicker/DateField.mjs.map +1 -1
- package/dist/private/datepicker/DatePicker.cjs +2 -1
- package/dist/private/datepicker/DatePicker.cjs.map +1 -1
- package/dist/private/datepicker/DatePicker.js +2 -1
- package/dist/private/datepicker/DatePicker.js.map +1 -1
- package/dist/private/datepicker/DatePicker.mjs +2 -1
- package/dist/private/datepicker/DatePicker.mjs.map +1 -1
- package/dist/private/datepicker/DateRangePicker.cjs +2 -1
- package/dist/private/datepicker/DateRangePicker.cjs.map +1 -1
- package/dist/private/datepicker/DateRangePicker.js +2 -1
- package/dist/private/datepicker/DateRangePicker.js.map +1 -1
- package/dist/private/datepicker/DateRangePicker.mjs +2 -1
- package/dist/private/datepicker/DateRangePicker.mjs.map +1 -1
- package/dist/private/dialog/AlertDialog.cjs +3 -1
- package/dist/private/dialog/AlertDialog.cjs.map +1 -1
- package/dist/private/dialog/AlertDialog.js +3 -1
- package/dist/private/dialog/AlertDialog.js.map +1 -1
- package/dist/private/dialog/AlertDialog.mjs +3 -1
- package/dist/private/dialog/AlertDialog.mjs.map +1 -1
- package/dist/private/dialog/Dialog.cjs +10 -3
- package/dist/private/dialog/Dialog.cjs.map +1 -1
- package/dist/private/dialog/Dialog.js +10 -3
- package/dist/private/dialog/Dialog.js.map +1 -1
- package/dist/private/dialog/Dialog.mjs +10 -3
- package/dist/private/dialog/Dialog.mjs.map +1 -1
- package/dist/private/dnd/useDragAndDrop.cjs +7 -0
- package/dist/private/dnd/useDragAndDrop.cjs.map +1 -1
- package/dist/private/dnd/useDragAndDrop.js +7 -0
- package/dist/private/dnd/useDragAndDrop.js.map +1 -1
- package/dist/private/dnd/useDragAndDrop.mjs +7 -0
- package/dist/private/dnd/useDragAndDrop.mjs.map +1 -1
- package/dist/private/icon/Icon.cjs +1 -1
- package/dist/private/icon/Icon.cjs.map +1 -1
- package/dist/private/icon/Icon.js +1 -1
- package/dist/private/icon/Icon.js.map +1 -1
- package/dist/private/icon/Icon.mjs +1 -1
- package/dist/private/icon/Icon.mjs.map +1 -1
- package/dist/private/icon/UIIcon.cjs +1 -1
- package/dist/private/icon/UIIcon.cjs.map +1 -1
- package/dist/private/icon/UIIcon.js +1 -1
- package/dist/private/icon/UIIcon.js.map +1 -1
- package/dist/private/icon/UIIcon.mjs +1 -1
- package/dist/private/icon/UIIcon.mjs.map +1 -1
- package/dist/private/intl/label/zh-CN.cjs +1 -1
- package/dist/private/intl/label/zh-CN.cjs.map +1 -1
- package/dist/private/intl/label/zh-CN.js +1 -1
- package/dist/private/intl/label/zh-CN.js.map +1 -1
- package/dist/private/intl/label/zh-CN.mjs +1 -1
- package/dist/private/intl/label/zh-CN.mjs.map +1 -1
- package/dist/private/intl/menu/es-ES.cjs +1 -1
- package/dist/private/intl/menu/es-ES.cjs.map +1 -1
- package/dist/private/intl/menu/es-ES.js +1 -1
- package/dist/private/intl/menu/es-ES.js.map +1 -1
- package/dist/private/intl/menu/es-ES.mjs +1 -1
- package/dist/private/intl/menu/es-ES.mjs.map +1 -1
- package/dist/private/intl/picker/zh-CN.cjs +1 -1
- package/dist/private/intl/picker/zh-CN.cjs.map +1 -1
- package/dist/private/intl/picker/zh-CN.js +1 -1
- package/dist/private/intl/picker/zh-CN.js.map +1 -1
- package/dist/private/intl/picker/zh-CN.mjs +1 -1
- package/dist/private/intl/picker/zh-CN.mjs.map +1 -1
- package/dist/private/intl/table/es-ES.cjs +1 -1
- package/dist/private/intl/table/es-ES.cjs.map +1 -1
- package/dist/private/intl/table/es-ES.js +1 -1
- package/dist/private/intl/table/es-ES.js.map +1 -1
- package/dist/private/intl/table/es-ES.mjs +1 -1
- package/dist/private/intl/table/es-ES.mjs.map +1 -1
- package/dist/private/intl/table/zh-TW.cjs +2 -2
- package/dist/private/intl/table/zh-TW.cjs.map +1 -1
- package/dist/private/intl/table/zh-TW.js +2 -2
- package/dist/private/intl/table/zh-TW.js.map +1 -1
- package/dist/private/intl/table/zh-TW.mjs +2 -2
- package/dist/private/intl/table/zh-TW.mjs.map +1 -1
- package/dist/private/label/Field.cjs +2 -1
- package/dist/private/label/Field.cjs.map +1 -1
- package/dist/private/label/Field.js +2 -1
- package/dist/private/label/Field.js.map +1 -1
- package/dist/private/label/Field.mjs +2 -1
- package/dist/private/label/Field.mjs.map +1 -1
- package/dist/private/layout/Grid.cjs +2 -1
- package/dist/private/layout/Grid.cjs.map +1 -1
- package/dist/private/layout/Grid.js +2 -1
- package/dist/private/layout/Grid.js.map +1 -1
- package/dist/private/layout/Grid.mjs +2 -1
- package/dist/private/layout/Grid.mjs.map +1 -1
- package/dist/private/link/Link.cjs +3 -0
- package/dist/private/link/Link.cjs.map +1 -1
- package/dist/private/link/Link.js +3 -0
- package/dist/private/link/Link.js.map +1 -1
- package/dist/private/link/Link.mjs +3 -0
- package/dist/private/link/Link.mjs.map +1 -1
- package/dist/private/list/InsertionIndicator.cjs +1 -0
- package/dist/private/list/InsertionIndicator.cjs.map +1 -1
- package/dist/private/list/InsertionIndicator.js +1 -0
- package/dist/private/list/InsertionIndicator.js.map +1 -1
- package/dist/private/list/InsertionIndicator.mjs +1 -0
- package/dist/private/list/InsertionIndicator.mjs.map +1 -1
- package/dist/private/list/ListView.cjs +5 -0
- package/dist/private/list/ListView.cjs.map +1 -1
- package/dist/private/list/ListView.js +5 -0
- package/dist/private/list/ListView.js.map +1 -1
- package/dist/private/list/ListView.mjs +5 -0
- package/dist/private/list/ListView.mjs.map +1 -1
- package/dist/private/list/ListViewItem.cjs +2 -0
- package/dist/private/list/ListViewItem.cjs.map +1 -1
- package/dist/private/list/ListViewItem.js +2 -0
- package/dist/private/list/ListViewItem.js.map +1 -1
- package/dist/private/list/ListViewItem.mjs +2 -0
- package/dist/private/list/ListViewItem.mjs.map +1 -1
- package/dist/private/list/RootDropIndicator.cjs +1 -0
- package/dist/private/list/RootDropIndicator.cjs.map +1 -1
- package/dist/private/list/RootDropIndicator.js +1 -0
- package/dist/private/list/RootDropIndicator.js.map +1 -1
- package/dist/private/list/RootDropIndicator.mjs +1 -0
- package/dist/private/list/RootDropIndicator.mjs.map +1 -1
- package/dist/private/menu/ContextualHelpTrigger.cjs +7 -1
- package/dist/private/menu/ContextualHelpTrigger.cjs.map +1 -1
- package/dist/private/menu/ContextualHelpTrigger.js +7 -1
- package/dist/private/menu/ContextualHelpTrigger.js.map +1 -1
- package/dist/private/menu/ContextualHelpTrigger.mjs +7 -1
- package/dist/private/menu/ContextualHelpTrigger.mjs.map +1 -1
- package/dist/private/menu/MenuItem.cjs +2 -0
- package/dist/private/menu/MenuItem.cjs.map +1 -1
- package/dist/private/menu/MenuItem.js +2 -0
- package/dist/private/menu/MenuItem.js.map +1 -1
- package/dist/private/menu/MenuItem.mjs +2 -0
- package/dist/private/menu/MenuItem.mjs.map +1 -1
- package/dist/private/menu/MenuTrigger.cjs +1 -0
- package/dist/private/menu/MenuTrigger.cjs.map +1 -1
- package/dist/private/menu/MenuTrigger.js +1 -0
- package/dist/private/menu/MenuTrigger.js.map +1 -1
- package/dist/private/menu/MenuTrigger.mjs +1 -0
- package/dist/private/menu/MenuTrigger.mjs.map +1 -1
- package/dist/private/menu/SubmenuTrigger.cjs +6 -1
- package/dist/private/menu/SubmenuTrigger.cjs.map +1 -1
- package/dist/private/menu/SubmenuTrigger.js +6 -1
- package/dist/private/menu/SubmenuTrigger.js.map +1 -1
- package/dist/private/menu/SubmenuTrigger.mjs +6 -1
- package/dist/private/menu/SubmenuTrigger.mjs.map +1 -1
- package/dist/private/package.cjs +1 -1
- package/dist/private/package.cjs.map +1 -1
- package/dist/private/package.js +1 -1
- package/dist/private/package.js.map +1 -1
- package/dist/private/package.mjs +1 -1
- package/dist/private/package.mjs.map +1 -1
- package/dist/private/progress/ProgressBarBase.cjs +2 -1
- package/dist/private/progress/ProgressBarBase.cjs.map +1 -1
- package/dist/private/progress/ProgressBarBase.js +2 -1
- package/dist/private/progress/ProgressBarBase.js.map +1 -1
- package/dist/private/progress/ProgressBarBase.mjs +2 -1
- package/dist/private/progress/ProgressBarBase.mjs.map +1 -1
- package/dist/private/progress/ProgressCircle.cjs +2 -1
- package/dist/private/progress/ProgressCircle.cjs.map +1 -1
- package/dist/private/progress/ProgressCircle.js +2 -1
- package/dist/private/progress/ProgressCircle.js.map +1 -1
- package/dist/private/progress/ProgressCircle.mjs +2 -1
- package/dist/private/progress/ProgressCircle.mjs.map +1 -1
- package/dist/private/slider/Slider.cjs +1 -0
- package/dist/private/slider/Slider.cjs.map +1 -1
- package/dist/private/slider/Slider.js +1 -0
- package/dist/private/slider/Slider.js.map +1 -1
- package/dist/private/slider/Slider.mjs +1 -0
- package/dist/private/slider/Slider.mjs.map +1 -1
- package/dist/private/table/InsertionIndicator.cjs +1 -0
- package/dist/private/table/InsertionIndicator.cjs.map +1 -1
- package/dist/private/table/InsertionIndicator.js +1 -0
- package/dist/private/table/InsertionIndicator.js.map +1 -1
- package/dist/private/table/InsertionIndicator.mjs +1 -0
- package/dist/private/table/InsertionIndicator.mjs.map +1 -1
- package/dist/private/table/Resizer.cjs +2 -25
- package/dist/private/table/Resizer.cjs.map +1 -1
- package/dist/private/table/Resizer.js +3 -26
- package/dist/private/table/Resizer.js.map +1 -1
- package/dist/private/table/Resizer.mjs +3 -26
- package/dist/private/table/Resizer.mjs.map +1 -1
- package/dist/private/table/RootDropIndicator.cjs +1 -0
- package/dist/private/table/RootDropIndicator.cjs.map +1 -1
- package/dist/private/table/RootDropIndicator.js +1 -0
- package/dist/private/table/RootDropIndicator.js.map +1 -1
- package/dist/private/table/RootDropIndicator.mjs +1 -0
- package/dist/private/table/RootDropIndicator.mjs.map +1 -1
- package/dist/private/table/TableViewBase.cjs +8 -0
- package/dist/private/table/TableViewBase.cjs.map +1 -1
- package/dist/private/table/TableViewBase.js +8 -0
- package/dist/private/table/TableViewBase.js.map +1 -1
- package/dist/private/table/TableViewBase.mjs +8 -0
- package/dist/private/table/TableViewBase.mjs.map +1 -1
- package/dist/private/table/TreeGridTableView.cjs +1 -0
- package/dist/private/table/TreeGridTableView.cjs.map +1 -1
- package/dist/private/table/TreeGridTableView.js +1 -0
- package/dist/private/table/TreeGridTableView.js.map +1 -1
- package/dist/private/table/TreeGridTableView.mjs +1 -0
- package/dist/private/table/TreeGridTableView.mjs.map +1 -1
- package/dist/private/tabs/Tabs.cjs +4 -2
- package/dist/private/tabs/Tabs.cjs.map +1 -1
- package/dist/private/tabs/Tabs.js +4 -2
- package/dist/private/tabs/Tabs.js.map +1 -1
- package/dist/private/tabs/Tabs.mjs +4 -2
- package/dist/private/tabs/Tabs.mjs.map +1 -1
- package/dist/private/tag/TagGroup.cjs +2 -0
- package/dist/private/tag/TagGroup.cjs.map +1 -1
- package/dist/private/tag/TagGroup.js +2 -0
- package/dist/private/tag/TagGroup.js.map +1 -1
- package/dist/private/tag/TagGroup.mjs +2 -0
- package/dist/private/tag/TagGroup.mjs.map +1 -1
- package/dist/private/textfield/TextArea.cjs +2 -0
- package/dist/private/textfield/TextArea.cjs.map +1 -1
- package/dist/private/textfield/TextArea.js +2 -0
- package/dist/private/textfield/TextArea.js.map +1 -1
- package/dist/private/textfield/TextArea.mjs +2 -0
- package/dist/private/textfield/TextArea.mjs.map +1 -1
- package/dist/private/textfield/TextField.cjs +1 -0
- package/dist/private/textfield/TextField.cjs.map +1 -1
- package/dist/private/textfield/TextField.js +1 -0
- package/dist/private/textfield/TextField.js.map +1 -1
- package/dist/private/textfield/TextField.mjs +1 -0
- package/dist/private/textfield/TextField.mjs.map +1 -1
- package/dist/private/textfield/TextFieldBase.cjs +2 -1
- package/dist/private/textfield/TextFieldBase.cjs.map +1 -1
- package/dist/private/textfield/TextFieldBase.js +2 -1
- package/dist/private/textfield/TextFieldBase.js.map +1 -1
- package/dist/private/textfield/TextFieldBase.mjs +2 -1
- package/dist/private/textfield/TextFieldBase.mjs.map +1 -1
- package/dist/private/utils/Slots.cjs +1 -0
- package/dist/private/utils/Slots.cjs.map +1 -1
- package/dist/private/utils/Slots.js +1 -0
- package/dist/private/utils/Slots.js.map +1 -1
- package/dist/private/utils/Slots.mjs +1 -0
- package/dist/private/utils/Slots.mjs.map +1 -1
- package/dist/types/src/dialog/AlertDialog.d.ts +2 -2
- package/i18n/ar-AE.js +1 -1
- package/i18n/ar-AE.mjs +1 -1
- package/i18n/bg-BG.js +1 -1
- package/i18n/bg-BG.mjs +1 -1
- package/i18n/cs-CZ.js +1 -1
- package/i18n/cs-CZ.mjs +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.mjs +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/i18n/el-GR.js +1 -1
- package/i18n/el-GR.mjs +1 -1
- package/i18n/en-US.js +1 -1
- package/i18n/en-US.mjs +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/et-EE.js +1 -1
- package/i18n/et-EE.mjs +1 -1
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.mjs +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.mjs +1 -1
- package/i18n/he-IL.js +1 -1
- package/i18n/he-IL.mjs +1 -1
- package/i18n/hr-HR.js +1 -1
- package/i18n/hr-HR.mjs +1 -1
- package/i18n/hu-HU.js +1 -1
- package/i18n/hu-HU.mjs +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.mjs +1 -1
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.mjs +1 -1
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.mjs +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.mjs +1 -1
- package/i18n/lt-LT.js +1 -1
- package/i18n/lt-LT.mjs +1 -1
- package/i18n/lv-LV.js +1 -1
- package/i18n/lv-LV.mjs +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.mjs +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.mjs +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.mjs +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.mjs +1 -1
- package/i18n/pt-PT.js +1 -1
- package/i18n/pt-PT.mjs +1 -1
- package/i18n/ro-RO.js +1 -1
- package/i18n/ro-RO.mjs +1 -1
- package/i18n/ru-RU.js +1 -1
- package/i18n/ru-RU.mjs +1 -1
- package/i18n/sk-SK.js +1 -1
- package/i18n/sk-SK.mjs +1 -1
- package/i18n/sl-SI.js +1 -1
- package/i18n/sl-SI.mjs +1 -1
- package/i18n/sr-SP.js +1 -1
- package/i18n/sr-SP.mjs +1 -1
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.mjs +1 -1
- package/i18n/tr-TR.js +1 -1
- package/i18n/tr-TR.mjs +1 -1
- package/i18n/uk-UA.js +1 -1
- package/i18n/uk-UA.mjs +1 -1
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.mjs +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.mjs +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDM,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAiC,EACjC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,0CAAe,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,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,mCAAQ,EAAE;QAAC,aAAa;IAAM;IAC/C,IAAI,QAAQ,CAAA,GAAA,oDAAe,EAAE;QAC3B,GAAG,KAAK;QACR,eAAe;QACf,uBAAuB;QACvB,gGAAgG;QAChG,uHAAuH;QACvH,wFAAwF;QACxF,mBAAmB;IACrB;IAEA,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAkB;IACvC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,mDAAgB,EAAE;QAAC,MAAM;IAAS,GAAG,OAAO;IAE/E,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;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ACA,qBAAA;QACA,QAAQ;QACR,OAAO;QACP,uBAAA;QACA,kBAAkB,IAChB,iBAAiB,2BACf,0DAAC;gBAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAa,GAAG;eACzC,gBAAgB,MAAM,CAAC;QAI9B,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAa,GAAG;QAC7C,KAAK;QACL,UAAU;QACV,YAAY;QACZ,WAAW;sBAEb,0DAAC,CAAA,GAAA,qCAAY;QAAE,WAAW;;AAIlC","sources":["packages/@adobe/react-spectrum/src/combobox/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, useButton} from 'react-aria/useButton';\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} from '../utils/classNames';\nimport {ClearButton} from '../button/ClearButton';\nimport {ComboBoxState, useComboBoxState} from 'react-stately/useComboBoxState';\nimport comboboxStyles from './combobox.css';\nimport {DismissButton} from 'react-aria/Overlay';\nimport {Field} from '../label/Field';\nimport {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {getActiveElement} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../../intl/combobox/*.json';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {ListBoxBase, useListBoxLayout} from '../listbox/ListBoxBase';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {ProgressCircle} from '../progress/ProgressCircle';\nimport React, {\n ForwardedRef,\n HTMLAttributes,\n InputHTMLAttributes,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {setInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {SpectrumComboBoxProps} from './ComboBox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '../overlays/Tray';\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useComboBox} from 'react-aria/useComboBox';\nimport {useDialog} from 'react-aria/useDialog';\nimport {useField} from 'react-aria/useField';\nimport {useFilter} from 'react-aria/useFilter';\nimport {useFormReset} from 'react-aria/private/utils/useFormReset';\nimport {useFormValidation} from 'react-aria/private/form/useFormValidation';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useOverlayTrigger} from 'react-aria/useOverlayTrigger';\nimport {useProviderProps} from '../provider/Provider';\n\nexport const MobileComboBox = React.forwardRef(function MobileComboBox(\n props: SpectrumComboBoxProps<any>,\n ref: FocusableRef<HTMLElement>\n) {\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 {\n ...props,\n focus: () => buttonRef.current?.focus()\n },\n state,\n inputRef\n );\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 {...props} onClose={state.close} overlayProps={overlayProps} 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(\n props: ComboBoxButtonProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isQuiet, isDisabled, isPlaceholder, validationState, children, style, className} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let valueId = useId();\n let invalidId = useId();\n let validId = useId();\n let validationIcon =\n validationState === 'invalid' ? (\n <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n ) : (\n <CheckmarkMedium id={validId} aria-label={stringFormatter.format('valid')} />\n );\n\n let validation = React.cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon',\n classNames(styles, 'spectrum-InputGroup-input-validationIcon')\n )\n });\n\n let objRef = useObjectRef(ref);\n let {hoverProps, isHovered} = useHover({});\n let {buttonProps, isPressed} = useButton(\n {\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 ]\n .filter(Boolean)\n .join(' '),\n elementType: 'div'\n },\n objRef\n );\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={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(comboboxStyles, 'mobile-combobox'),\n className\n )}>\n <div\n className={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(styles, 'spectrum-InputGroup-field')\n )}>\n <div\n className={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(comboboxStyles, 'mobile-input')\n )}>\n <span id={valueId} className={classNames(comboboxStyles, 'mobile-value')}>\n {children}\n </span>\n </div>\n {validationState && !isDisabled ? validation : null}\n </div>\n <div\n className={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(styles, 'spectrum-FieldButton')\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 {\n 'aria-labelledby': useId(labelProps.id)\n },\n popoverRef\n );\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={classNames(searchStyles, 'spectrum-ClearButton')}\n isDisabled={isDisabled}\n />\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(textfieldStyles, '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 || getActiveElement() !== 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={classNames(comboboxStyles, 'tray-dialog')}>\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={\n (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) &&\n !props.isReadOnly\n ? clearButton\n : undefined\n }\n UNSAFE_className={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(comboboxStyles, 'tray-textfield', {\n 'has-label': !!props.label\n })\n )}\n inputClassName={classNames(\n comboboxStyles,\n 'tray-textfield-input',\n classNames(searchStyles, 'spectrum-Search-input')\n )}\n validationIconClassName={classNames(searchStyles, 'spectrum-Search-validationIcon')}\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={() =>\n loadingState !== 'loading' && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )\n }\n UNSAFE_className={classNames(comboboxStyles, 'tray-listbox')}\n ref={listBoxRef}\n onScroll={onScroll}\n onLoadMore={onLoadMore}\n isLoading={isLoading}\n />\n <DismissButton onDismiss={onClose} />\n </div>\n </FocusScope>\n );\n}\n"],"names":[],"version":3,"file":"MobileComboBox.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDM,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAiC,EACjC,GAA8B;IAE9B,gDAAgD;IAChD,QAAQ,CAAA,GAAA,0CAAe,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,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,mCAAQ,EAAE;QAAC,aAAa;IAAM;IAC/C,IAAI,QAAQ,CAAA,GAAA,oDAAe,EAAE;QAC3B,GAAG,KAAK;QACR,eAAe;QACf,uBAAuB;QACvB,gGAAgG;QAChG,uHAAuH;QACvH,wFAAwF;QACxF,mBAAmB;IACrB;IAEA,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAkB;IACvC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,mDAAgB,EAAE;QAAC,MAAM;IAAS,GAAG,OAAO;IAE/E,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,CAAA,GAAA,8DAAgB,EACd;QACE,GAAG,KAAK;QACR,OAAO,IAAM,UAAU,OAAO,EAAE;IAClC,GACA,OACA;IAEF,IAAI,aAAC,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,MAAM,iBAAiB;IAC9E,IAAI,kBA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AW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAa,GAAG;eACzC,gBAAgB,MAAM,CAAC;QAI9B,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAa,GAAG;QAC7C,KAAK;QACL,UAAU;QACV,YAAY;QACZ,WAAW;sBAEb,0DAAC,CAAA,GAAA,qCAAY;QAAE,WAAW;;AAIlC","sources":["packages/@adobe/react-spectrum/src/combobox/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, useButton} from 'react-aria/useButton';\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} from '../utils/classNames';\nimport {ClearButton} from '../button/ClearButton';\nimport {ComboBoxState, useComboBoxState} from 'react-stately/useComboBoxState';\nimport comboboxStyles from './combobox.css';\nimport {DismissButton} from 'react-aria/Overlay';\nimport {Field} from '../label/Field';\nimport {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {getActiveElement} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../../intl/combobox/*.json';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {ListBoxBase, useListBoxLayout} from '../listbox/ListBoxBase';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {ProgressCircle} from '../progress/ProgressCircle';\nimport React, {\n ForwardedRef,\n HTMLAttributes,\n InputHTMLAttributes,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {setInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {SpectrumComboBoxProps} from './ComboBox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '../overlays/Tray';\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useComboBox} from 'react-aria/useComboBox';\nimport {useDialog} from 'react-aria/useDialog';\nimport {useField} from 'react-aria/useField';\nimport {useFilter} from 'react-aria/useFilter';\nimport {useFormReset} from 'react-aria/private/utils/useFormReset';\nimport {useFormValidation} from 'react-aria/private/form/useFormValidation';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useOverlayTrigger} from 'react-aria/useOverlayTrigger';\nimport {useProviderProps} from '../provider/Provider';\n\nexport const MobileComboBox = React.forwardRef(function MobileComboBox(\n props: SpectrumComboBoxProps<any>,\n ref: FocusableRef<HTMLElement>\n) {\n // oxlint-disable-next-line react/react-compiler\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 {\n ...props,\n focus: () => buttonRef.current?.focus()\n },\n state,\n inputRef\n );\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 // oxlint-disable-next-line react/react-compiler\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 {...props} onClose={state.close} overlayProps={overlayProps} 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(\n props: ComboBoxButtonProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isQuiet, isDisabled, isPlaceholder, validationState, children, style, className} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let valueId = useId();\n let invalidId = useId();\n let validId = useId();\n let validationIcon =\n validationState === 'invalid' ? (\n <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n ) : (\n <CheckmarkMedium id={validId} aria-label={stringFormatter.format('valid')} />\n );\n\n let validation = React.cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon',\n classNames(styles, 'spectrum-InputGroup-input-validationIcon')\n )\n });\n\n let objRef = useObjectRef(ref);\n let {hoverProps, isHovered} = useHover({});\n let {buttonProps, isPressed} = useButton(\n {\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 ]\n .filter(Boolean)\n .join(' '),\n elementType: 'div'\n },\n objRef\n );\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={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(comboboxStyles, 'mobile-combobox'),\n className\n )}>\n <div\n className={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(styles, 'spectrum-InputGroup-field')\n )}>\n <div\n className={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(comboboxStyles, 'mobile-input')\n )}>\n <span id={valueId} className={classNames(comboboxStyles, 'mobile-value')}>\n {children}\n </span>\n </div>\n {validationState && !isDisabled ? validation : null}\n </div>\n <div\n className={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(styles, 'spectrum-FieldButton')\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 // oxlint-disable-next-line react/react-compiler\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 {\n 'aria-labelledby': useId(labelProps.id)\n },\n popoverRef\n );\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 // oxlint-disable-next-line react/react-compiler\n inputProps.role = 'searchbox';\n // oxlint-disable-next-line react/react-compiler\n inputProps['aria-haspopup'] = 'listbox';\n // oxlint-disable-next-line react/react-compiler\n delete inputProps['aria-expanded'];\n // oxlint-disable-next-line react/react-compiler\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={classNames(searchStyles, 'spectrum-ClearButton')}\n isDisabled={isDisabled}\n />\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(textfieldStyles, '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 || getActiveElement() !== 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 // oxlint-disable-next-line react/react-compiler\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={classNames(comboboxStyles, 'tray-dialog')}>\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={\n (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) &&\n !props.isReadOnly\n ? clearButton\n : undefined\n }\n UNSAFE_className={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(comboboxStyles, 'tray-textfield', {\n 'has-label': !!props.label\n })\n )}\n inputClassName={classNames(\n comboboxStyles,\n 'tray-textfield-input',\n classNames(searchStyles, 'spectrum-Search-input')\n )}\n validationIconClassName={classNames(searchStyles, 'spectrum-Search-validationIcon')}\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={() =>\n loadingState !== 'loading' && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )\n }\n UNSAFE_className={classNames(comboboxStyles, 'tray-listbox')}\n ref={listBoxRef}\n onScroll={onScroll}\n onLoadMore={onLoadMore}\n isLoading={isLoading}\n />\n <DismissButton onDismiss={onClose} />\n </div>\n </FocusScope>\n );\n}\n"],"names":[],"version":3,"file":"MobileComboBox.cjs.map"}
|
|
@@ -100,6 +100,7 @@ function $parcel$interopDefault(a) {
|
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
const $536c5102a10ee08b$export$7637df911c069b4d = /*#__PURE__*/ (0, $9Yx27$react).forwardRef(function MobileComboBox(props, ref) {
|
|
103
|
+
// oxlint-disable-next-line react/react-compiler
|
|
103
104
|
props = (0, $089943c7a219141c$export$521c373ccc32c300)(props);
|
|
104
105
|
let { isQuiet: isQuiet, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, validationBehavior: validationBehavior, name: name, formValue: formValue = 'text', allowsCustomValue: allowsCustomValue } = props;
|
|
105
106
|
if (allowsCustomValue) formValue = 'text';
|
|
@@ -139,6 +140,7 @@ const $536c5102a10ee08b$export$7637df911c069b4d = /*#__PURE__*/ (0, $9Yx27$react
|
|
|
139
140
|
errorMessage: errorMessage
|
|
140
141
|
});
|
|
141
142
|
// Focus the button and show focus ring when clicking on the label
|
|
143
|
+
// oxlint-disable-next-line react/react-compiler
|
|
142
144
|
labelProps.onClick = ()=>{
|
|
143
145
|
if (!props.isDisabled) {
|
|
144
146
|
var _buttonRef_current;
|
|
@@ -286,6 +288,7 @@ function $536c5102a10ee08b$var$ComboBoxTray(props) {
|
|
|
286
288
|
...props,
|
|
287
289
|
// completionMode,
|
|
288
290
|
layoutDelegate: layout,
|
|
291
|
+
// oxlint-disable-next-line react/react-compiler
|
|
289
292
|
buttonRef: (0, $c234463e9ef56637$export$c7e28c72a4823176)(buttonRef),
|
|
290
293
|
popoverRef: popoverRef,
|
|
291
294
|
listBoxRef: listBoxRef,
|
|
@@ -312,9 +315,13 @@ function $536c5102a10ee08b$var$ComboBoxTray(props) {
|
|
|
312
315
|
// "double tap to edit text", as with a textbox or searchbox. We'd like double tapping to
|
|
313
316
|
// open the virtual keyboard rather than closing the tray.
|
|
314
317
|
// Unlike "combobox", "aria-expanded" is not a valid attribute on "searchbox".
|
|
318
|
+
// oxlint-disable-next-line react/react-compiler
|
|
315
319
|
inputProps.role = 'searchbox';
|
|
320
|
+
// oxlint-disable-next-line react/react-compiler
|
|
316
321
|
inputProps['aria-haspopup'] = 'listbox';
|
|
322
|
+
// oxlint-disable-next-line react/react-compiler
|
|
317
323
|
delete inputProps['aria-expanded'];
|
|
324
|
+
// oxlint-disable-next-line react/react-compiler
|
|
318
325
|
delete inputProps.onTouchEnd;
|
|
319
326
|
let clearButton = /*#__PURE__*/ (0, $9Yx27$react).createElement((0, $cf8b586db4c34baa$export$13ec83e50bf04290), {
|
|
320
327
|
preventFocus: true,
|
|
@@ -369,6 +376,7 @@ function $536c5102a10ee08b$var$ComboBoxTray(props) {
|
|
|
369
376
|
}
|
|
370
377
|
} else if (loadingState !== 'filtering') {
|
|
371
378
|
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
379
|
+
// oxlint-disable-next-line react/react-compiler
|
|
372
380
|
setShowLoading(false);
|
|
373
381
|
if (timeout.current) clearTimeout(timeout.current);
|
|
374
382
|
timeout.current = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAiC,EACjC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,yCAAe,EAAE;IAEzB,IAAI,WACF,OAAO,cACP,UAAU,cACV,UAAU,cACV,UAAU,sBACV,kBAAkB,QAClB,IAAI,aACJ,YAAY,2BACZ,iBAAiB,EA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BAAiB;QAC3C,kBAAkB,gBAAgB,OAAO,gBAAgB;QACzD,iBAAiB;QACjB,YAAW;QACX,eAAc;QACd,iBACE,AAAC,CAAA,MAAM,UAAU,KAAK,MAAM,iBAAiB,eAAe,mBAAmB,IAAG,KAClF,CAAC,MAAM,UAAU,GACb,cACA;QAEN,kBAAkB,CAAA,GAAA,yCAAS,EACzB,CAAA,GAAA,mDAAW,GACX,mBACA,sBACA,6BACA;YACE,4BAA4B,oBAAoB,aAAa,CAAC;YAC9D,0BAA0B,oBAAoB,WAAW,CAAC;QAC5D,GACA,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,gDAAa,GAAG,kBAAkB;YAC3C,aAAa,CAAC,CAAC,MAAM,KAAK;QAC5B;QAEF,gBAAgB,CAAA,GAAA,yCAAS,EACvB,CAAA,GAAA,gDAAa,GACb,wBACA,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;QAE3B,yBAAyB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;sBAEpD,gCAAC,CAAA,GAAA,yCAAU;QACR,GAAG,YAAY;QAChB,UAAU;0BAAC;wBAAc;QAAU;QACnC,wBAAA;QACA,uBAAA;QACA,qBAAA;QACA,QAAQ;QACR,OAAO;QACP,uBAAA;QACA,kBAAkB,IAChB,iBAAiB,2BACf,gCAAC;gBAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,gDAAa,GAAG;eACzC,gBAAgB,MAAM,CAAC;QAI9B,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,gDAAa,GAAG;QAC7C,KAAK;QACL,UAAU;QACV,YAAY;QACZ,WAAW;sBAEb,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW;;AAIlC","sources":["packages/@adobe/react-spectrum/src/combobox/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, useButton} from 'react-aria/useButton';\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} from '../utils/classNames';\nimport {ClearButton} from '../button/ClearButton';\nimport {ComboBoxState, useComboBoxState} from 'react-stately/useComboBoxState';\nimport comboboxStyles from './combobox.css';\nimport {DismissButton} from 'react-aria/Overlay';\nimport {Field} from '../label/Field';\nimport {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {getActiveElement} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../../intl/combobox/*.json';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {ListBoxBase, useListBoxLayout} from '../listbox/ListBoxBase';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {ProgressCircle} from '../progress/ProgressCircle';\nimport React, {\n ForwardedRef,\n HTMLAttributes,\n InputHTMLAttributes,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {setInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {SpectrumComboBoxProps} from './ComboBox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '../overlays/Tray';\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useComboBox} from 'react-aria/useComboBox';\nimport {useDialog} from 'react-aria/useDialog';\nimport {useField} from 'react-aria/useField';\nimport {useFilter} from 'react-aria/useFilter';\nimport {useFormReset} from 'react-aria/private/utils/useFormReset';\nimport {useFormValidation} from 'react-aria/private/form/useFormValidation';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useOverlayTrigger} from 'react-aria/useOverlayTrigger';\nimport {useProviderProps} from '../provider/Provider';\n\nexport const MobileComboBox = React.forwardRef(function MobileComboBox(\n props: SpectrumComboBoxProps<any>,\n ref: FocusableRef<HTMLElement>\n) {\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 {\n ...props,\n focus: () => buttonRef.current?.focus()\n },\n state,\n inputRef\n );\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 {...props} onClose={state.close} overlayProps={overlayProps} 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(\n props: ComboBoxButtonProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isQuiet, isDisabled, isPlaceholder, validationState, children, style, className} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let valueId = useId();\n let invalidId = useId();\n let validId = useId();\n let validationIcon =\n validationState === 'invalid' ? (\n <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n ) : (\n <CheckmarkMedium id={validId} aria-label={stringFormatter.format('valid')} />\n );\n\n let validation = React.cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon',\n classNames(styles, 'spectrum-InputGroup-input-validationIcon')\n )\n });\n\n let objRef = useObjectRef(ref);\n let {hoverProps, isHovered} = useHover({});\n let {buttonProps, isPressed} = useButton(\n {\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 ]\n .filter(Boolean)\n .join(' '),\n elementType: 'div'\n },\n objRef\n );\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={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(comboboxStyles, 'mobile-combobox'),\n className\n )}>\n <div\n className={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(styles, 'spectrum-InputGroup-field')\n )}>\n <div\n className={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(comboboxStyles, 'mobile-input')\n )}>\n <span id={valueId} className={classNames(comboboxStyles, 'mobile-value')}>\n {children}\n </span>\n </div>\n {validationState && !isDisabled ? validation : null}\n </div>\n <div\n className={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(styles, 'spectrum-FieldButton')\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 {\n 'aria-labelledby': useId(labelProps.id)\n },\n popoverRef\n );\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={classNames(searchStyles, 'spectrum-ClearButton')}\n isDisabled={isDisabled}\n />\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(textfieldStyles, '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 || getActiveElement() !== 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={classNames(comboboxStyles, 'tray-dialog')}>\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={\n (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) &&\n !props.isReadOnly\n ? clearButton\n : undefined\n }\n UNSAFE_className={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(comboboxStyles, 'tray-textfield', {\n 'has-label': !!props.label\n })\n )}\n inputClassName={classNames(\n comboboxStyles,\n 'tray-textfield-input',\n classNames(searchStyles, 'spectrum-Search-input')\n )}\n validationIconClassName={classNames(searchStyles, 'spectrum-Search-validationIcon')}\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={() =>\n loadingState !== 'loading' && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )\n }\n UNSAFE_className={classNames(comboboxStyles, 'tray-listbox')}\n ref={listBoxRef}\n onScroll={onScroll}\n onLoadMore={onLoadMore}\n isLoading={isLoading}\n />\n <DismissButton onDismiss={onClose} />\n </div>\n </FocusScope>\n );\n}\n"],"names":[],"version":3,"file":"MobileComboBox.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAiC,EACjC,GAA8B;IAE9B,gDAAgD;IAChD,QAAQ,CAAA,GAAA,yCAAe,EAAE;IAEzB,IAAI,WACF,OAAO,cACP,UAAU,cACV,UAAU,cACV,UAAU,sBACV,kBAAkB,QAClB,IA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lC","sources":["packages/@adobe/react-spectrum/src/combobox/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, useButton} from 'react-aria/useButton';\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} from '../utils/classNames';\nimport {ClearButton} from '../button/ClearButton';\nimport {ComboBoxState, useComboBoxState} from 'react-stately/useComboBoxState';\nimport comboboxStyles from './combobox.css';\nimport {DismissButton} from 'react-aria/Overlay';\nimport {Field} from '../label/Field';\nimport {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {getActiveElement} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../../intl/combobox/*.json';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {ListBoxBase, useListBoxLayout} from '../listbox/ListBoxBase';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {ProgressCircle} from '../progress/ProgressCircle';\nimport React, {\n ForwardedRef,\n HTMLAttributes,\n InputHTMLAttributes,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {setInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {SpectrumComboBoxProps} from './ComboBox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '../overlays/Tray';\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useComboBox} from 'react-aria/useComboBox';\nimport {useDialog} from 'react-aria/useDialog';\nimport {useField} from 'react-aria/useField';\nimport {useFilter} from 'react-aria/useFilter';\nimport {useFormReset} from 'react-aria/private/utils/useFormReset';\nimport {useFormValidation} from 'react-aria/private/form/useFormValidation';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useOverlayTrigger} from 'react-aria/useOverlayTrigger';\nimport {useProviderProps} from '../provider/Provider';\n\nexport const MobileComboBox = React.forwardRef(function MobileComboBox(\n props: SpectrumComboBoxProps<any>,\n ref: FocusableRef<HTMLElement>\n) {\n // oxlint-disable-next-line react/react-compiler\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 {\n ...props,\n focus: () => buttonRef.current?.focus()\n },\n state,\n inputRef\n );\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 // oxlint-disable-next-line react/react-compiler\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 {...props} onClose={state.close} overlayProps={overlayProps} 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(\n props: ComboBoxButtonProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isQuiet, isDisabled, isPlaceholder, validationState, children, style, className} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let valueId = useId();\n let invalidId = useId();\n let validId = useId();\n let validationIcon =\n validationState === 'invalid' ? (\n <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n ) : (\n <CheckmarkMedium id={validId} aria-label={stringFormatter.format('valid')} />\n );\n\n let validation = React.cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon',\n classNames(styles, 'spectrum-InputGroup-input-validationIcon')\n )\n });\n\n let objRef = useObjectRef(ref);\n let {hoverProps, isHovered} = useHover({});\n let {buttonProps, isPressed} = useButton(\n {\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 ]\n .filter(Boolean)\n .join(' '),\n elementType: 'div'\n },\n objRef\n );\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={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(comboboxStyles, 'mobile-combobox'),\n className\n )}>\n <div\n className={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(styles, 'spectrum-InputGroup-field')\n )}>\n <div\n className={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(comboboxStyles, 'mobile-input')\n )}>\n <span id={valueId} className={classNames(comboboxStyles, 'mobile-value')}>\n {children}\n </span>\n </div>\n {validationState && !isDisabled ? validation : null}\n </div>\n <div\n className={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(styles, 'spectrum-FieldButton')\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 // oxlint-disable-next-line react/react-compiler\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 {\n 'aria-labelledby': useId(labelProps.id)\n },\n popoverRef\n );\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 // oxlint-disable-next-line react/react-compiler\n inputProps.role = 'searchbox';\n // oxlint-disable-next-line react/react-compiler\n inputProps['aria-haspopup'] = 'listbox';\n // oxlint-disable-next-line react/react-compiler\n delete inputProps['aria-expanded'];\n // oxlint-disable-next-line react/react-compiler\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={classNames(searchStyles, 'spectrum-ClearButton')}\n isDisabled={isDisabled}\n />\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(textfieldStyles, '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 || getActiveElement() !== 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 // oxlint-disable-next-line react/react-compiler\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={classNames(comboboxStyles, 'tray-dialog')}>\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={\n (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) &&\n !props.isReadOnly\n ? clearButton\n : undefined\n }\n UNSAFE_className={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(comboboxStyles, 'tray-textfield', {\n 'has-label': !!props.label\n })\n )}\n inputClassName={classNames(\n comboboxStyles,\n 'tray-textfield-input',\n classNames(searchStyles, 'spectrum-Search-input')\n )}\n validationIconClassName={classNames(searchStyles, 'spectrum-Search-validationIcon')}\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={() =>\n loadingState !== 'loading' && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )\n }\n UNSAFE_className={classNames(comboboxStyles, 'tray-listbox')}\n ref={listBoxRef}\n onScroll={onScroll}\n onLoadMore={onLoadMore}\n isLoading={isLoading}\n />\n <DismissButton onDismiss={onClose} />\n </div>\n </FocusScope>\n );\n}\n"],"names":[],"version":3,"file":"MobileComboBox.js.map"}
|
|
@@ -100,6 +100,7 @@ function $parcel$interopDefault(a) {
|
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
const $5815f9078a56ef80$export$7637df911c069b4d = /*#__PURE__*/ (0, $cZmNf$react).forwardRef(function MobileComboBox(props, ref) {
|
|
103
|
+
// oxlint-disable-next-line react/react-compiler
|
|
103
104
|
props = (0, $71dfb0e0358a12de$export$521c373ccc32c300)(props);
|
|
104
105
|
let { isQuiet: isQuiet, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, validationBehavior: validationBehavior, name: name, formValue: formValue = 'text', allowsCustomValue: allowsCustomValue } = props;
|
|
105
106
|
if (allowsCustomValue) formValue = 'text';
|
|
@@ -135,6 +136,7 @@ const $5815f9078a56ef80$export$7637df911c069b4d = /*#__PURE__*/ (0, $cZmNf$react
|
|
|
135
136
|
errorMessage: errorMessage
|
|
136
137
|
});
|
|
137
138
|
// Focus the button and show focus ring when clicking on the label
|
|
139
|
+
// oxlint-disable-next-line react/react-compiler
|
|
138
140
|
labelProps.onClick = ()=>{
|
|
139
141
|
if (!props.isDisabled) {
|
|
140
142
|
buttonRef.current?.focus();
|
|
@@ -281,6 +283,7 @@ function $5815f9078a56ef80$var$ComboBoxTray(props) {
|
|
|
281
283
|
...props,
|
|
282
284
|
// completionMode,
|
|
283
285
|
layoutDelegate: layout,
|
|
286
|
+
// oxlint-disable-next-line react/react-compiler
|
|
284
287
|
buttonRef: (0, $3c2c983d5210446c$export$c7e28c72a4823176)(buttonRef),
|
|
285
288
|
popoverRef: popoverRef,
|
|
286
289
|
listBoxRef: listBoxRef,
|
|
@@ -307,9 +310,13 @@ function $5815f9078a56ef80$var$ComboBoxTray(props) {
|
|
|
307
310
|
// "double tap to edit text", as with a textbox or searchbox. We'd like double tapping to
|
|
308
311
|
// open the virtual keyboard rather than closing the tray.
|
|
309
312
|
// Unlike "combobox", "aria-expanded" is not a valid attribute on "searchbox".
|
|
313
|
+
// oxlint-disable-next-line react/react-compiler
|
|
310
314
|
inputProps.role = 'searchbox';
|
|
315
|
+
// oxlint-disable-next-line react/react-compiler
|
|
311
316
|
inputProps['aria-haspopup'] = 'listbox';
|
|
317
|
+
// oxlint-disable-next-line react/react-compiler
|
|
312
318
|
delete inputProps['aria-expanded'];
|
|
319
|
+
// oxlint-disable-next-line react/react-compiler
|
|
313
320
|
delete inputProps.onTouchEnd;
|
|
314
321
|
let clearButton = /*#__PURE__*/ (0, $cZmNf$react).createElement((0, $ab14010a528467be$export$13ec83e50bf04290), {
|
|
315
322
|
preventFocus: true,
|
|
@@ -362,6 +369,7 @@ function $5815f9078a56ef80$var$ComboBoxTray(props) {
|
|
|
362
369
|
}
|
|
363
370
|
} else if (loadingState !== 'filtering') {
|
|
364
371
|
// If loading is no longer happening, clear any timers and hide the loading circle
|
|
372
|
+
// oxlint-disable-next-line react/react-compiler
|
|
365
373
|
setShowLoading(false);
|
|
366
374
|
if (timeout.current) clearTimeout(timeout.current);
|
|
367
375
|
timeout.current = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAiC,EACjC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,yCAAe,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,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE;QAAC,aAAa;IAAM;IAC/C,IAAI,QAAQ,CAAA,GAAA,uBAAe,EAAE;QAC3B,GAAG,KAAK;QACR,eAAe;QACf,uBAAuB;QACvB,gGAAgG;QAChG,uHAAuH;QACvH,wFA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A,gDAAa,GACb,wBACA,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;QAE3B,yBAAyB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;sBAEpD,gCAAC,CAAA,GAAA,yCAAU;QACR,GAAG,YAAY;QAChB,UAAU;0BAAC;wBAAc;QAAU;QACnC,wBAAA;QACA,uBAAA;QACA,qBAAA;QACA,QAAQ;QACR,OAAO;QACP,uBAAA;QACA,kBAAkB,IAChB,iBAAiB,2BACf,gCAAC;gBAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,gDAAa,GAAG;eACzC,gBAAgB,MAAM,CAAC;QAI9B,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,gDAAa,GAAG;QAC7C,KAAK;QACL,UAAU;QACV,YAAY;QACZ,WAAW;sBAEb,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW;;AAIlC","sources":["packages/@adobe/react-spectrum/src/combobox/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, useButton} from 'react-aria/useButton';\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} from '../utils/classNames';\nimport {ClearButton} from '../button/ClearButton';\nimport {ComboBoxState, useComboBoxState} from 'react-stately/useComboBoxState';\nimport comboboxStyles from './combobox.css';\nimport {DismissButton} from 'react-aria/Overlay';\nimport {Field} from '../label/Field';\nimport {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {getActiveElement} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../../intl/combobox/*.json';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {ListBoxBase, useListBoxLayout} from '../listbox/ListBoxBase';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {ProgressCircle} from '../progress/ProgressCircle';\nimport React, {\n ForwardedRef,\n HTMLAttributes,\n InputHTMLAttributes,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {setInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {SpectrumComboBoxProps} from './ComboBox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '../overlays/Tray';\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useComboBox} from 'react-aria/useComboBox';\nimport {useDialog} from 'react-aria/useDialog';\nimport {useField} from 'react-aria/useField';\nimport {useFilter} from 'react-aria/useFilter';\nimport {useFormReset} from 'react-aria/private/utils/useFormReset';\nimport {useFormValidation} from 'react-aria/private/form/useFormValidation';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useOverlayTrigger} from 'react-aria/useOverlayTrigger';\nimport {useProviderProps} from '../provider/Provider';\n\nexport const MobileComboBox = React.forwardRef(function MobileComboBox(\n props: SpectrumComboBoxProps<any>,\n ref: FocusableRef<HTMLElement>\n) {\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 {\n ...props,\n focus: () => buttonRef.current?.focus()\n },\n state,\n inputRef\n );\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 {...props} onClose={state.close} overlayProps={overlayProps} 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(\n props: ComboBoxButtonProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isQuiet, isDisabled, isPlaceholder, validationState, children, style, className} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let valueId = useId();\n let invalidId = useId();\n let validId = useId();\n let validationIcon =\n validationState === 'invalid' ? (\n <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n ) : (\n <CheckmarkMedium id={validId} aria-label={stringFormatter.format('valid')} />\n );\n\n let validation = React.cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon',\n classNames(styles, 'spectrum-InputGroup-input-validationIcon')\n )\n });\n\n let objRef = useObjectRef(ref);\n let {hoverProps, isHovered} = useHover({});\n let {buttonProps, isPressed} = useButton(\n {\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 ]\n .filter(Boolean)\n .join(' '),\n elementType: 'div'\n },\n objRef\n );\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={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(comboboxStyles, 'mobile-combobox'),\n className\n )}>\n <div\n className={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(styles, 'spectrum-InputGroup-field')\n )}>\n <div\n className={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(comboboxStyles, 'mobile-input')\n )}>\n <span id={valueId} className={classNames(comboboxStyles, 'mobile-value')}>\n {children}\n </span>\n </div>\n {validationState && !isDisabled ? validation : null}\n </div>\n <div\n className={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(styles, 'spectrum-FieldButton')\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 {\n 'aria-labelledby': useId(labelProps.id)\n },\n popoverRef\n );\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={classNames(searchStyles, 'spectrum-ClearButton')}\n isDisabled={isDisabled}\n />\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(textfieldStyles, '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 || getActiveElement() !== 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={classNames(comboboxStyles, 'tray-dialog')}>\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={\n (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) &&\n !props.isReadOnly\n ? clearButton\n : undefined\n }\n UNSAFE_className={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(comboboxStyles, 'tray-textfield', {\n 'has-label': !!props.label\n })\n )}\n inputClassName={classNames(\n comboboxStyles,\n 'tray-textfield-input',\n classNames(searchStyles, 'spectrum-Search-input')\n )}\n validationIconClassName={classNames(searchStyles, 'spectrum-Search-validationIcon')}\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={() =>\n loadingState !== 'loading' && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )\n }\n UNSAFE_className={classNames(comboboxStyles, 'tray-listbox')}\n ref={listBoxRef}\n onScroll={onScroll}\n onLoadMore={onLoadMore}\n isLoading={isLoading}\n />\n <DismissButton onDismiss={onClose} />\n </div>\n </FocusScope>\n );\n}\n"],"names":[],"version":3,"file":"MobileComboBox.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAiC,EACjC,GAA8B;IAE9B,gDAAgD;IAChD,QAAQ,CAAA,GAAA,yCAAe,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,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE;QAAC,aAAa;IAAM;IAC/C,IAAI,QAAQ,CAAA,GAAA,uBAAe,EAAE;QAC3B,GAAG,KAAK;QACR,eAAe;QACf,uBAAuB;QACvB,gGAAgG;QAChG,uHAAuH;QACvH,wFAAwF;QACxF,mBAAmB;IACrB;IAEA,IAAI,YAAY,CAAA,GAAA,aAAK,EAAkB;IACvC,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAAC,MAAM;IAAS,GAAG,OAAO;IAE/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W,GAAG;sBAEpD,gCAAC,CAAA,GAAA,yCAAU;QACR,GAAG,YAAY;QAChB,UAAU;0BAAC;wBAAc;QAAU;QACnC,wBAAA;QACA,uBAAA;QACA,qBAAA;QACA,QAAQ;QACR,OAAO;QACP,uBAAA;QACA,kBAAkB,IAChB,iBAAiB,2BACf,gCAAC;gBAAK,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,gDAAa,GAAG;eACzC,gBAAgB,MAAM,CAAC;QAI9B,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,gDAAa,GAAG;QAC7C,KAAK;QACL,UAAU;QACV,YAAY;QACZ,WAAW;sBAEb,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW;;AAIlC","sources":["packages/@adobe/react-spectrum/src/combobox/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, useButton} from 'react-aria/useButton';\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} from '../utils/classNames';\nimport {ClearButton} from '../button/ClearButton';\nimport {ComboBoxState, useComboBoxState} from 'react-stately/useComboBoxState';\nimport comboboxStyles from './combobox.css';\nimport {DismissButton} from 'react-aria/Overlay';\nimport {Field} from '../label/Field';\nimport {FocusableRef, FocusableRefValue, ValidationState} from '@react-types/shared';\nimport {FocusRing} from 'react-aria/FocusRing';\nimport {focusSafely} from 'react-aria/private/interactions/focusSafely';\nimport {FocusScope} from 'react-aria/FocusScope';\nimport {getActiveElement} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nimport intlMessages from '../../intl/combobox/*.json';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport {ListBoxBase, useListBoxLayout} from '../listbox/ListBoxBase';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {ProgressCircle} from '../progress/ProgressCircle';\nimport React, {\n ForwardedRef,\n HTMLAttributes,\n InputHTMLAttributes,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {setInteractionModality} from 'react-aria/private/interactions/useFocusVisible';\nimport {SpectrumComboBoxProps} from './ComboBox';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '../textfield/TextFieldBase';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {Tray} from '../overlays/Tray';\nimport {unwrapDOMRef, useFocusableRef} from '../utils/useDOMRef';\nimport {useComboBox} from 'react-aria/useComboBox';\nimport {useDialog} from 'react-aria/useDialog';\nimport {useField} from 'react-aria/useField';\nimport {useFilter} from 'react-aria/useFilter';\nimport {useFormReset} from 'react-aria/private/utils/useFormReset';\nimport {useFormValidation} from 'react-aria/private/form/useFormValidation';\nimport {useHover} from 'react-aria/useHover';\nimport {useId} from 'react-aria/useId';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useOverlayTrigger} from 'react-aria/useOverlayTrigger';\nimport {useProviderProps} from '../provider/Provider';\n\nexport const MobileComboBox = React.forwardRef(function MobileComboBox(\n props: SpectrumComboBoxProps<any>,\n ref: FocusableRef<HTMLElement>\n) {\n // oxlint-disable-next-line react/react-compiler\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 {\n ...props,\n focus: () => buttonRef.current?.focus()\n },\n state,\n inputRef\n );\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 // oxlint-disable-next-line react/react-compiler\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 {...props} onClose={state.close} overlayProps={overlayProps} 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(\n props: ComboBoxButtonProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {isQuiet, isDisabled, isPlaceholder, validationState, children, style, className} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/combobox');\n let valueId = useId();\n let invalidId = useId();\n let validId = useId();\n let validationIcon =\n validationState === 'invalid' ? (\n <AlertMedium id={invalidId} aria-label={stringFormatter.format('invalid')} />\n ) : (\n <CheckmarkMedium id={validId} aria-label={stringFormatter.format('valid')} />\n );\n\n let validation = React.cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon',\n classNames(styles, 'spectrum-InputGroup-input-validationIcon')\n )\n });\n\n let objRef = useObjectRef(ref);\n let {hoverProps, isHovered} = useHover({});\n let {buttonProps, isPressed} = useButton(\n {\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 ]\n .filter(Boolean)\n .join(' '),\n elementType: 'div'\n },\n objRef\n );\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={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(comboboxStyles, 'mobile-combobox'),\n className\n )}>\n <div\n className={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(styles, 'spectrum-InputGroup-field')\n )}>\n <div\n className={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(comboboxStyles, 'mobile-input')\n )}>\n <span id={valueId} className={classNames(comboboxStyles, 'mobile-value')}>\n {children}\n </span>\n </div>\n {validationState && !isDisabled ? validation : null}\n </div>\n <div\n className={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(styles, 'spectrum-FieldButton')\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 // oxlint-disable-next-line react/react-compiler\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 {\n 'aria-labelledby': useId(labelProps.id)\n },\n popoverRef\n );\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 // oxlint-disable-next-line react/react-compiler\n inputProps.role = 'searchbox';\n // oxlint-disable-next-line react/react-compiler\n inputProps['aria-haspopup'] = 'listbox';\n // oxlint-disable-next-line react/react-compiler\n delete inputProps['aria-expanded'];\n // oxlint-disable-next-line react/react-compiler\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={classNames(searchStyles, 'spectrum-ClearButton')}\n isDisabled={isDisabled}\n />\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(textfieldStyles, '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 || getActiveElement() !== 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 // oxlint-disable-next-line react/react-compiler\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={classNames(comboboxStyles, 'tray-dialog')}>\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={\n (state.inputValue !== '' || loadingState === 'filtering' || validationState != null) &&\n !props.isReadOnly\n ? clearButton\n : undefined\n }\n UNSAFE_className={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(comboboxStyles, 'tray-textfield', {\n 'has-label': !!props.label\n })\n )}\n inputClassName={classNames(\n comboboxStyles,\n 'tray-textfield-input',\n classNames(searchStyles, 'spectrum-Search-input')\n )}\n validationIconClassName={classNames(searchStyles, 'spectrum-Search-validationIcon')}\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={() =>\n loadingState !== 'loading' && (\n <span className={classNames(comboboxStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )\n }\n UNSAFE_className={classNames(comboboxStyles, 'tray-listbox')}\n ref={listBoxRef}\n onScroll={onScroll}\n onLoadMore={onLoadMore}\n isLoading={isLoading}\n />\n <DismissButton onDismiss={onClose} />\n </div>\n </FocusScope>\n );\n}\n"],"names":[],"version":3,"file":"MobileComboBox.mjs.map"}
|
|
@@ -66,7 +66,8 @@ const $548b51a9f8b07706$export$d9781c7894a82487 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
66
66
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
67
67
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
68
68
|
let description = (0, $7f5eff3a70a58c6f$exports.useFormatHelpText)(props);
|
|
69
|
-
if (description && !props.description)
|
|
69
|
+
if (description && !props.description) // oxlint-disable-next-line react/react-compiler
|
|
70
|
+
descriptionProps.id = undefined;
|
|
70
71
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
71
72
|
let approximateWidth = (0, $7f5eff3a70a58c6f$exports.useFormattedDateWidth)(state) + 'ch';
|
|
72
73
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($6Kenu$react))).createElement((0, $b93966d678e0af07$exports.Field), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AA0DM,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,UACjD,KAAgC,EAChC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;I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GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC5B,0DAAC,CAAA,GAAA,2CAAgB;YACf,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAGhB,0DAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC","sources":["packages/@adobe/react-spectrum/src/datepicker/DateField.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 {\n AriaDateFieldProps,\n DateValue,\n MappedDateValue,\n useDateField\n} from 'react-aria/useDateField';\n\nimport {classNames} from '../utils/classNames';\nimport {createCalendar} from '@internationalized/date';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '../label/Field';\nimport {\n FocusableRef,\n HelpTextProps,\n SpectrumFieldValidation,\n SpectrumLabelableProps,\n StyleProps\n} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {useDateFieldState} from 'react-stately/useDateFieldState';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth} from './utils';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDateFieldBase<T extends DateValue>\n extends\n SpectrumLabelableProps,\n HelpTextProps,\n SpectrumFieldValidation<MappedDateValue<T>>,\n StyleProps {\n /**\n * Whether the date picker should be displayed with a quiet style.\n *\n * @default false\n */\n isQuiet?: boolean;\n /**\n * Whether to show the localized date format as help text below the field.\n *\n * @default false\n */\n showFormatHelpText?: boolean;\n}\n\nexport interface SpectrumDateFieldProps<T extends DateValue>\n extends\n Omit<AriaDateFieldProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n SpectrumDateFieldBase<T> {}\n\n/**\n * DateFields allow users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport const DateField = React.forwardRef(function DateField<T extends DateValue>(\n props: SpectrumDateFieldProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {autoFocus, isDisabled, isReadOnly, isRequired, isQuiet} = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...props,\n locale,\n createCalendar\n });\n\n let fieldRef = useRef<HTMLElement | null>(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {\n labelProps,\n fieldProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useDateField(\n {\n ...props,\n inputRef\n },\n state,\n fieldRef\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n descriptionProps.id = undefined;\n }\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n let approximateWidth = useFormattedDateWidth(state) + 'ch';\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState ?? undefined}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n minWidth={approximateWidth}\n className={classNames(datepickerStyles, 'react-spectrum-DateField')}>\n {state.segments.map((segment, i) => (\n <DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n />\n ))}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDateFieldProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"DateField.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AA0DM,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,UACjD,KAAgC,EAChC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,aAAC,SAAS,cAAE,UAAU,cAAE,UAAU,cAAE,UAAU,WAAE,OAAO,EAAC,GAAG;IAE/D,IAAI,SAAS,CAAA,GAAA,4CAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,sCAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,sDAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;wBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAsB;IAC1C,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,oBACV,gBAAgB,qBAChB,iBAAiB,aACjB,SAAS,oBACT,gBAAgB,qBAChB,iBAAiB,EAClB,GAAG,CAAA,GAAA,yCAAW,EACb;QACE,GAAG,KAAK;kBACR;IACF,GACA,OACA;IAGF,uEAAuE;IACvE,wGAAwG;IACxG,IAAI,cAAc,CAAA,GAAA,2CAAgB,EAAE;IACpC,IAAI,eAAe,CAAC,MAAM,WAAW,EACnC,gDAAgD;IAChD,iBAAiB,EAAE,GAAG;IAGxB,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,IAAI,mBAAmB,CAAA,GAAA,+CAAoB,EAAE,SAAS;IAEtD,qBACE,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,aAAa;QACb,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB,mBAAmB;QACpC,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,0DAAC,CAAA,GAAA,+BAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,UAAU;QACV,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC5B,0DAAC,CAAA,GAAA,2CAAgB;YACf,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAGhB,0DAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC","sources":["packages/@adobe/react-spectrum/src/datepicker/DateField.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 {\n AriaDateFieldProps,\n DateValue,\n MappedDateValue,\n useDateField\n} from 'react-aria/useDateField';\n\nimport {classNames} from '../utils/classNames';\nimport {createCalendar} from '@internationalized/date';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '../label/Field';\nimport {\n FocusableRef,\n HelpTextProps,\n SpectrumFieldValidation,\n SpectrumLabelableProps,\n StyleProps\n} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {useDateFieldState} from 'react-stately/useDateFieldState';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth} from './utils';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDateFieldBase<T extends DateValue>\n extends\n SpectrumLabelableProps,\n HelpTextProps,\n SpectrumFieldValidation<MappedDateValue<T>>,\n StyleProps {\n /**\n * Whether the date picker should be displayed with a quiet style.\n *\n * @default false\n */\n isQuiet?: boolean;\n /**\n * Whether to show the localized date format as help text below the field.\n *\n * @default false\n */\n showFormatHelpText?: boolean;\n}\n\nexport interface SpectrumDateFieldProps<T extends DateValue>\n extends\n Omit<AriaDateFieldProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n SpectrumDateFieldBase<T> {}\n\n/**\n * DateFields allow users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport const DateField = React.forwardRef(function DateField<T extends DateValue>(\n props: SpectrumDateFieldProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {autoFocus, isDisabled, isReadOnly, isRequired, isQuiet} = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...props,\n locale,\n createCalendar\n });\n\n let fieldRef = useRef<HTMLElement | null>(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {\n labelProps,\n fieldProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useDateField(\n {\n ...props,\n inputRef\n },\n state,\n fieldRef\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n // oxlint-disable-next-line react/react-compiler\n descriptionProps.id = undefined;\n }\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n let approximateWidth = useFormattedDateWidth(state) + 'ch';\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState ?? undefined}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n minWidth={approximateWidth}\n className={classNames(datepickerStyles, 'react-spectrum-DateField')}>\n {state.segments.map((segment, i) => (\n <DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n />\n ))}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDateFieldProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"DateField.cjs.map"}
|
|
@@ -60,7 +60,8 @@ const $e2601972aa3002a4$export$d9781c7894a82487 = /*#__PURE__*/ (0, $fKiD6$react
|
|
|
60
60
|
// Note: this description is intentionally not passed to useDatePicker.
|
|
61
61
|
// The format help text is unnecessary for screen reader users because each segment already has a label.
|
|
62
62
|
let description = (0, $14b5acfdaf2344b2$export$322f4580ccd8dde6)(props);
|
|
63
|
-
if (description && !props.description)
|
|
63
|
+
if (description && !props.description) // oxlint-disable-next-line react/react-compiler
|
|
64
|
+
descriptionProps.id = undefined;
|
|
64
65
|
let validationState = state.validationState || (isInvalid ? 'invalid' : null);
|
|
65
66
|
let approximateWidth = (0, $14b5acfdaf2344b2$export$31e22e3c931fc056)(state) + 'ch';
|
|
66
67
|
return /*#__PURE__*/ (0, $fKiD6$react).createElement((0, $3967792f95357356$export$a455218a85c89869), {
|