@cube-dev/ui-kit 0.0.0-canary-bef9600 → 0.0.0-canary-e3f8a1a
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/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +11 -5
- package/dist/components/actions/Button/Button.js.map +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +27 -25
- package/dist/components/actions/ItemAction/ItemAction.js.map +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -4
- package/dist/components/actions/Menu/styled.js.map +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.d.ts +4 -4
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +3 -3
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +7 -3
- package/dist/components/content/ItemBadge/ItemBadge.js.map +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +28 -15
- package/dist/components/content/Layout/Layout.js.map +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +20 -10
- package/dist/components/content/Layout/LayoutContext.js.map +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +12 -9
- package/dist/components/content/Layout/LayoutFooter.js.map +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.d.ts +14 -14
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +3 -3
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +2 -2
- package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +5 -5
- package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +26 -6
- package/dist/components/fields/ComboBox/ComboBox.js +1095 -619
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +84 -0
- package/dist/components/fields/ComboBox/comboBoxOptions.js.map +1 -0
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.d.ts +2 -2
- package/dist/components/fields/Input/Input.js +2 -2
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +10 -4
- package/dist/components/fields/ListBox/ListBox.js +293 -143
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +15 -12
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.d.ts +0 -1
- package/dist/components/fields/NumberInput/NumberInput.js +136 -128
- package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +38 -48
- package/dist/components/fields/NumberInput/StepButton.js.map +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.d.ts +1 -2
- package/dist/components/fields/PasswordInput/PasswordInput.js +77 -111
- package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/fields/Picker/Picker.d.ts +1 -1
- package/dist/components/fields/Picker/Picker.js +8 -3
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +8 -8
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.d.ts +8 -3
- package/dist/components/fields/SearchInput/SearchInput.js +22 -29
- package/dist/components/fields/SearchInput/SearchInput.js.map +1 -1
- package/dist/components/fields/Select/Select.d.ts +12 -1
- package/dist/components/fields/Select/Select.js +365 -207
- package/dist/components/fields/Select/Select.js.map +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +3 -4
- package/dist/components/fields/Slider/RangeSlider.js.map +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.d.ts +0 -1
- package/dist/components/fields/TextArea/TextArea.js +49 -63
- package/dist/components/fields/TextArea/TextArea.js.map +1 -1
- package/dist/components/fields/TextInput/TextInput.d.ts +1 -1
- package/dist/components/fields/TextInput/TextInput.js +42 -46
- package/dist/components/fields/TextInput/TextInput.js.map +1 -1
- package/dist/components/fields/TextInput/TextInputBase.d.ts +6 -2
- package/dist/components/fields/TextInput/TextInputBase.js +32 -10
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +50 -0
- package/dist/components/fields/TextInput/displayed-validation.js.map +1 -0
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +2 -2
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/index.d.ts +2 -2
- package/dist/components/fields/option-origin-press.js +78 -0
- package/dist/components/fields/option-origin-press.js.map +1 -0
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.d.ts +6 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +3 -2
- package/dist/components/overlays/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +3 -2
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js.map +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +28 -14
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.d.ts +7 -3
- package/dist/components/overlays/Dialog/DialogTrigger.js +149 -132
- package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +83 -0
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js.map +1 -0
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +3 -2
- package/dist/components/overlays/Modal/Overlay.js.map +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Popover.js.map +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +8 -0
- package/dist/components/overlays/Tooltip/Tooltip.js +16 -22
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.d.ts +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +163 -113
- package/dist/components/overlays/Tooltip/TooltipTrigger.js.map +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/context.js.map +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +6 -5
- package/dist/components/overlays/Tooltip/split-trigger-props.js.map +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +11 -17
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +6 -4
- package/dist/i18n/locales/en-US/uikit.js +6 -4
- package/dist/i18n/locales/en-US/uikit.json.d.ts +3 -1
- package/dist/i18n/locales/es-ES/uikit.js +6 -4
- package/dist/i18n/locales/es-MX/uikit.js +6 -4
- package/dist/i18n/locales/fr-FR/uikit.js +6 -4
- package/dist/i18n/locales/it-IT/uikit.js +6 -4
- package/dist/i18n/locales/ja-JP/uikit.js +6 -4
- package/dist/i18n/locales/nb-NO/uikit.js +6 -4
- package/dist/i18n/locales/pt-BR/uikit.js +6 -4
- package/dist/i18n/locales/pt-PT/uikit.js +6 -4
- package/dist/i18n/locales/sv-SE/uikit.js +6 -4
- package/dist/i18n/locales/vi-VN/uikit.js +6 -4
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +18 -9
- package/dist/utils/react/nullableValue.js.map +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/actions/Button.md +8 -2
- package/docs/components/content/InfoBadge.md +2 -0
- package/docs/components/content/ItemBadge.md +4 -0
- package/docs/components/content/Layout.md +2 -1
- package/docs/components/fields/ComboBox.md +25 -18
- package/docs/components/fields/FilterListBox.md +2 -2
- package/docs/components/fields/FilterPicker.md +2 -2
- package/docs/components/fields/ListBox.md +14 -10
- package/docs/components/fields/NumberInput.md +10 -10
- package/docs/components/fields/PasswordInput.md +6 -7
- package/docs/components/fields/Picker.md +6 -5
- package/docs/components/fields/RadioGroup.md +1 -1
- package/docs/components/fields/SearchInput.md +7 -6
- package/docs/components/fields/Select.md +14 -8
- package/docs/components/fields/TextArea.md +4 -3
- package/docs/components/fields/TextInput.md +13 -6
- package/docs/components/overlays/AlertDialog.md +7 -1
- package/docs/components/overlays/Dialog.md +5 -5
- package/docs/components/overlays/DialogTrigger.md +6 -6
- package/docs/components/overlays/Tooltip.md +17 -6
- package/docs/components/overlays/TooltipTrigger.md +2 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e3f8a1a | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
4
4
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
@@ -20,11 +20,12 @@ import { filterCollectionNodes, getEdgeVisibleKey, getNextVisibleKey, markKeyboa
|
|
|
20
20
|
import { DEFAULT_INPUT_STYLES, INPUT_WRAPPER_STYLES } from "../TextInput/TextInputBase.js";
|
|
21
21
|
import { ListBoxPopover } from "../ListBoxPopover/ListBoxPopover.js";
|
|
22
22
|
import { useCompositeFocus } from "../ListBoxPopover/useCompositeFocus.js";
|
|
23
|
+
import { collectOptions, findTypedOption, getItemLabel, highlightOption, resolveHighlightedKey, sortSelectedFirst } from "./comboBoxOptions.js";
|
|
23
24
|
import { c } from "react/compiler-runtime";
|
|
24
25
|
import { BASE_STYLES, COLOR_STYLES, OUTER_STYLES, tasty } from "@tenphi/tasty";
|
|
25
|
-
import React, { forwardRef,
|
|
26
|
+
import React, { forwardRef, useEffect, useRef, useState } from "react";
|
|
26
27
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
-
import { useFilter, useKeyboard } from "react-aria";
|
|
28
|
+
import { useCollator, useFilter, useKeyboard } from "react-aria";
|
|
28
29
|
import { Section, useListState } from "react-stately";
|
|
29
30
|
|
|
30
31
|
//#region src/components/fields/ComboBox/ComboBox.tsx
|
|
@@ -45,11 +46,10 @@ function useComboBoxState(t0) {
|
|
|
45
46
|
const $ = c(12);
|
|
46
47
|
const { selectedKey, defaultSelectedKey, inputValue, defaultInputValue, comboBoxId, triggerRef, popoverRef } = t0;
|
|
47
48
|
const [internalSelectedKey, setInternalSelectedKey] = useState(defaultSelectedKey ?? null);
|
|
48
|
-
const [internalInputValue, setInternalInputValue] = useState(defaultInputValue ??
|
|
49
|
+
const [internalInputValue, setInternalInputValue] = useState(defaultInputValue ?? null);
|
|
49
50
|
const isControlledKey = selectedKey !== void 0;
|
|
50
51
|
const isControlledInput = inputValue !== void 0;
|
|
51
52
|
const effectiveSelectedKey = isControlledKey ? selectedKey : internalSelectedKey;
|
|
52
|
-
const effectiveInputValue = isControlledInput ? inputValue : internalInputValue;
|
|
53
53
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
54
54
|
let t1;
|
|
55
55
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -73,10 +73,10 @@ function useComboBoxState(t0) {
|
|
|
73
73
|
} else t2 = $[5];
|
|
74
74
|
usePopoverSync(t2);
|
|
75
75
|
let t3;
|
|
76
|
-
if ($[6] !==
|
|
76
|
+
if ($[6] !== effectiveSelectedKey || $[7] !== internalInputValue || $[8] !== isControlledInput || $[9] !== isControlledKey || $[10] !== isPopoverOpen) {
|
|
77
77
|
t3 = {
|
|
78
78
|
effectiveSelectedKey,
|
|
79
|
-
|
|
79
|
+
internalInputValue,
|
|
80
80
|
isPopoverOpen,
|
|
81
81
|
setIsPopoverOpen,
|
|
82
82
|
setInternalSelectedKey,
|
|
@@ -84,8 +84,8 @@ function useComboBoxState(t0) {
|
|
|
84
84
|
isControlledKey,
|
|
85
85
|
isControlledInput
|
|
86
86
|
};
|
|
87
|
-
$[6] =
|
|
88
|
-
$[7] =
|
|
87
|
+
$[6] = effectiveSelectedKey;
|
|
88
|
+
$[7] = internalInputValue;
|
|
89
89
|
$[8] = isControlledInput;
|
|
90
90
|
$[9] = isControlledKey;
|
|
91
91
|
$[10] = isPopoverOpen;
|
|
@@ -93,8 +93,55 @@ function useComboBoxState(t0) {
|
|
|
93
93
|
} else t3 = $[11];
|
|
94
94
|
return t3;
|
|
95
95
|
}
|
|
96
|
+
function useSelectedLabel(collection, selectedKey) {
|
|
97
|
+
const $ = c(7);
|
|
98
|
+
const [knownLabel, setKnownLabel] = useState(null);
|
|
99
|
+
let t0;
|
|
100
|
+
if ($[0] !== collection) {
|
|
101
|
+
t0 = (key) => {
|
|
102
|
+
const picked = getItemLabel(collection, key);
|
|
103
|
+
setKnownLabel({
|
|
104
|
+
key,
|
|
105
|
+
label: picked
|
|
106
|
+
});
|
|
107
|
+
return picked;
|
|
108
|
+
};
|
|
109
|
+
$[0] = collection;
|
|
110
|
+
$[1] = t0;
|
|
111
|
+
} else t0 = $[1];
|
|
112
|
+
const pickLabel = t0;
|
|
113
|
+
if (selectedKey == null) {
|
|
114
|
+
let t1;
|
|
115
|
+
if ($[2] !== pickLabel) {
|
|
116
|
+
t1 = {
|
|
117
|
+
selectedLabel: "",
|
|
118
|
+
pickLabel
|
|
119
|
+
};
|
|
120
|
+
$[2] = pickLabel;
|
|
121
|
+
$[3] = t1;
|
|
122
|
+
} else t1 = $[3];
|
|
123
|
+
return t1;
|
|
124
|
+
}
|
|
125
|
+
const label = collection.getItem(selectedKey)?.textValue;
|
|
126
|
+
if (label && (knownLabel?.key !== selectedKey || knownLabel.label !== label)) setKnownLabel({
|
|
127
|
+
key: selectedKey,
|
|
128
|
+
label
|
|
129
|
+
});
|
|
130
|
+
const selectedLabel = label || (knownLabel?.key === selectedKey ? knownLabel.label : String(selectedKey));
|
|
131
|
+
let t1;
|
|
132
|
+
if ($[4] !== pickLabel || $[5] !== selectedLabel) {
|
|
133
|
+
t1 = {
|
|
134
|
+
selectedLabel,
|
|
135
|
+
pickLabel
|
|
136
|
+
};
|
|
137
|
+
$[4] = pickLabel;
|
|
138
|
+
$[5] = selectedLabel;
|
|
139
|
+
$[6] = t1;
|
|
140
|
+
} else t1 = $[6];
|
|
141
|
+
return t1;
|
|
142
|
+
}
|
|
96
143
|
function useComboBoxFiltering(t0) {
|
|
97
|
-
const $ = c(
|
|
144
|
+
const $ = c(15);
|
|
98
145
|
const { effectiveInputValue, filter } = t0;
|
|
99
146
|
const [isFilterActive, setIsFilterActive] = useState(false);
|
|
100
147
|
let t1;
|
|
@@ -104,45 +151,67 @@ function useComboBoxFiltering(t0) {
|
|
|
104
151
|
} else t1 = $[0];
|
|
105
152
|
const { contains } = useFilter(t1);
|
|
106
153
|
let t2;
|
|
107
|
-
if ($[1]
|
|
108
|
-
t2 =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
154
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
155
|
+
t2 = {
|
|
156
|
+
usage: "search",
|
|
157
|
+
sensitivity: "base"
|
|
158
|
+
};
|
|
159
|
+
$[1] = t2;
|
|
160
|
+
} else t2 = $[1];
|
|
161
|
+
const collator = useCollator(t2);
|
|
114
162
|
let t3;
|
|
115
|
-
if ($[
|
|
116
|
-
t3 = (
|
|
163
|
+
if ($[2] !== collator) {
|
|
164
|
+
t3 = (textValue, text) => collator.compare(textValue.normalize("NFC"), text.normalize("NFC")) === 0;
|
|
165
|
+
$[2] = collator;
|
|
166
|
+
$[3] = t3;
|
|
167
|
+
} else t3 = $[3];
|
|
168
|
+
const isSameText = t3;
|
|
169
|
+
let t4;
|
|
170
|
+
if ($[4] !== contains || $[5] !== filter) {
|
|
171
|
+
t4 = filter === false ? _temp : filter || contains;
|
|
172
|
+
$[4] = contains;
|
|
173
|
+
$[5] = filter;
|
|
174
|
+
$[6] = t4;
|
|
175
|
+
} else t4 = $[6];
|
|
176
|
+
const textFilterFn = t4;
|
|
177
|
+
let t5;
|
|
178
|
+
if ($[7] !== effectiveInputValue || $[8] !== isFilterActive || $[9] !== textFilterFn) {
|
|
179
|
+
t5 = (nodes) => {
|
|
117
180
|
const term = effectiveInputValue.trim();
|
|
118
181
|
if (!isFilterActive || !term) return nodes;
|
|
119
182
|
return filterCollectionNodes(nodes, term, textFilterFn);
|
|
120
183
|
};
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
} else
|
|
126
|
-
const filterFn =
|
|
127
|
-
let
|
|
128
|
-
if ($[
|
|
129
|
-
|
|
184
|
+
$[7] = effectiveInputValue;
|
|
185
|
+
$[8] = isFilterActive;
|
|
186
|
+
$[9] = textFilterFn;
|
|
187
|
+
$[10] = t5;
|
|
188
|
+
} else t5 = $[10];
|
|
189
|
+
const filterFn = t5;
|
|
190
|
+
let t6;
|
|
191
|
+
if ($[11] !== filterFn || $[12] !== isFilterActive || $[13] !== isSameText) {
|
|
192
|
+
t6 = {
|
|
130
193
|
filterFn,
|
|
194
|
+
isSameText,
|
|
131
195
|
isFilterActive,
|
|
132
196
|
setIsFilterActive
|
|
133
197
|
};
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
|
|
138
|
-
|
|
198
|
+
$[11] = filterFn;
|
|
199
|
+
$[12] = isFilterActive;
|
|
200
|
+
$[13] = isSameText;
|
|
201
|
+
$[14] = t6;
|
|
202
|
+
} else t6 = $[14];
|
|
203
|
+
return t6;
|
|
139
204
|
}
|
|
140
205
|
function _temp() {
|
|
141
206
|
return true;
|
|
142
207
|
}
|
|
208
|
+
const OVERLAY_KEYS = new Set(["Escape", "Tab"]);
|
|
209
|
+
function isComposing(e) {
|
|
210
|
+
return e.nativeEvent?.isComposing || e.keyCode === 229;
|
|
211
|
+
}
|
|
143
212
|
function useComboBoxKeyboard(t0) {
|
|
144
|
-
const $ = c(
|
|
145
|
-
const {
|
|
213
|
+
const $ = c(48);
|
|
214
|
+
const { isListShown, isReadOnly, listStateRef, hasResults, allowsCustomValue, effectiveInputValue, selectedKey, selectedLabel, isClearable, onSelectionChange, onClearValue, onOpenList, onCloseList, inputRef, onVirtualFocus, onKeyDown } = t0;
|
|
146
215
|
let t1;
|
|
147
216
|
if ($[0] !== onVirtualFocus) {
|
|
148
217
|
t1 = (listState, key) => {
|
|
@@ -156,155 +225,170 @@ function useComboBoxKeyboard(t0) {
|
|
|
156
225
|
} else t1 = $[1];
|
|
157
226
|
const focusOption = t1;
|
|
158
227
|
let t2;
|
|
159
|
-
if ($[2] !== focusOption || $[3] !==
|
|
228
|
+
if ($[2] !== focusOption || $[3] !== isListShown || $[4] !== listStateRef || $[5] !== onOpenList) {
|
|
160
229
|
t2 = (e) => {
|
|
161
230
|
e.preventDefault();
|
|
162
|
-
if (!
|
|
163
|
-
|
|
164
|
-
onOpenPopover();
|
|
231
|
+
if (!isListShown) {
|
|
232
|
+
onOpenList();
|
|
165
233
|
return;
|
|
166
234
|
}
|
|
167
235
|
const listState_0 = listStateRef.current;
|
|
168
236
|
if (listState_0) focusOption(listState_0, getNextVisibleKey(listState_0, e.key === "ArrowDown" ? 1 : -1));
|
|
169
237
|
};
|
|
170
238
|
$[2] = focusOption;
|
|
171
|
-
$[3] =
|
|
172
|
-
$[4] =
|
|
173
|
-
$[5] =
|
|
174
|
-
$[6] =
|
|
175
|
-
|
|
176
|
-
$[8] = t2;
|
|
177
|
-
} else t2 = $[8];
|
|
239
|
+
$[3] = isListShown;
|
|
240
|
+
$[4] = listStateRef;
|
|
241
|
+
$[5] = onOpenList;
|
|
242
|
+
$[6] = t2;
|
|
243
|
+
} else t2 = $[6];
|
|
178
244
|
const handleArrowKey = t2;
|
|
179
245
|
let t3;
|
|
180
|
-
if ($[
|
|
246
|
+
if ($[7] !== effectiveInputValue || $[8] !== isListShown || $[9] !== onSelectionChange || $[10] !== selectedKey || $[11] !== selectedLabel) {
|
|
181
247
|
t3 = (e_0) => {
|
|
182
|
-
if (!allowsCustomValue) {
|
|
183
|
-
e_0.preventDefault();
|
|
184
|
-
onSelectionChange(null);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
248
|
const value = effectiveInputValue.trim();
|
|
188
|
-
|
|
189
|
-
if (
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
|
|
197
|
-
|
|
249
|
+
if (isListShown || !value) e_0.preventDefault();
|
|
250
|
+
if (value && selectedKey != null && value === selectedLabel) return;
|
|
251
|
+
onSelectionChange(value || null);
|
|
252
|
+
};
|
|
253
|
+
$[7] = effectiveInputValue;
|
|
254
|
+
$[8] = isListShown;
|
|
255
|
+
$[9] = onSelectionChange;
|
|
256
|
+
$[10] = selectedKey;
|
|
257
|
+
$[11] = selectedLabel;
|
|
258
|
+
$[12] = t3;
|
|
259
|
+
} else t3 = $[12];
|
|
260
|
+
const commitTypedText = t3;
|
|
198
261
|
let t4;
|
|
199
|
-
if ($[14] !==
|
|
262
|
+
if ($[13] !== allowsCustomValue || $[14] !== commitTypedText || $[15] !== effectiveInputValue || $[16] !== hasResults || $[17] !== inputRef || $[18] !== isListShown || $[19] !== listStateRef || $[20] !== onCloseList || $[21] !== onSelectionChange || $[22] !== selectedKey) {
|
|
200
263
|
t4 = (e_1) => {
|
|
201
|
-
const listState_1 =
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
264
|
+
const listState_1 = isListShown ? listStateRef.current : null;
|
|
265
|
+
const key_0 = listState_1 ? resolveHighlightedKey(listState_1, selectedKey) : null;
|
|
266
|
+
if (key_0 != null) {
|
|
204
267
|
e_1.preventDefault();
|
|
205
|
-
listState_1.selectionManager.select(
|
|
206
|
-
|
|
268
|
+
listState_1.selectionManager.select(key_0, e_1);
|
|
269
|
+
onCloseList();
|
|
207
270
|
inputRef.current?.focus();
|
|
208
|
-
} else if (
|
|
209
|
-
else if (
|
|
271
|
+
} else if (allowsCustomValue) commitTypedText(e_1);
|
|
272
|
+
else if (!hasResults || !effectiveInputValue.trim()) {
|
|
210
273
|
e_1.preventDefault();
|
|
211
274
|
onSelectionChange(null);
|
|
212
275
|
}
|
|
213
276
|
};
|
|
214
|
-
$[
|
|
277
|
+
$[13] = allowsCustomValue;
|
|
278
|
+
$[14] = commitTypedText;
|
|
215
279
|
$[15] = effectiveInputValue;
|
|
216
280
|
$[16] = hasResults;
|
|
217
281
|
$[17] = inputRef;
|
|
218
|
-
$[18] =
|
|
282
|
+
$[18] = isListShown;
|
|
219
283
|
$[19] = listStateRef;
|
|
220
|
-
$[20] =
|
|
284
|
+
$[20] = onCloseList;
|
|
221
285
|
$[21] = onSelectionChange;
|
|
222
|
-
$[22] =
|
|
223
|
-
|
|
286
|
+
$[22] = selectedKey;
|
|
287
|
+
$[23] = t4;
|
|
288
|
+
} else t4 = $[23];
|
|
224
289
|
const handleEnterKey = t4;
|
|
225
290
|
let t5;
|
|
226
|
-
if ($[
|
|
291
|
+
if ($[24] !== effectiveInputValue || $[25] !== inputRef || $[26] !== isClearable || $[27] !== isListShown || $[28] !== onClearValue || $[29] !== onCloseList) {
|
|
227
292
|
t5 = (e_2) => {
|
|
228
|
-
if (
|
|
293
|
+
if (isListShown) {
|
|
229
294
|
e_2.preventDefault();
|
|
230
|
-
|
|
295
|
+
onCloseList();
|
|
231
296
|
inputRef.current?.focus();
|
|
232
|
-
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
299
|
+
if (effectiveInputValue && isClearable) {
|
|
233
300
|
e_2.preventDefault();
|
|
234
301
|
onClearValue();
|
|
302
|
+
return true;
|
|
235
303
|
}
|
|
304
|
+
return false;
|
|
236
305
|
};
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
} else t5 = $[
|
|
306
|
+
$[24] = effectiveInputValue;
|
|
307
|
+
$[25] = inputRef;
|
|
308
|
+
$[26] = isClearable;
|
|
309
|
+
$[27] = isListShown;
|
|
310
|
+
$[28] = onClearValue;
|
|
311
|
+
$[29] = onCloseList;
|
|
312
|
+
$[30] = t5;
|
|
313
|
+
} else t5 = $[30];
|
|
245
314
|
const handleEscapeKey = t5;
|
|
246
315
|
let t6;
|
|
247
|
-
if ($[
|
|
316
|
+
if ($[31] !== focusOption || $[32] !== isListShown || $[33] !== listStateRef) {
|
|
248
317
|
t6 = (e_3) => {
|
|
249
|
-
if (!
|
|
318
|
+
if (!isListShown) return;
|
|
250
319
|
e_3.preventDefault();
|
|
251
320
|
const listState_2 = listStateRef.current;
|
|
252
321
|
if (listState_2) focusOption(listState_2, getEdgeVisibleKey(listState_2, e_3.key === "Home" ? "first" : "last"));
|
|
253
322
|
};
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
} else t6 = $[
|
|
323
|
+
$[31] = focusOption;
|
|
324
|
+
$[32] = isListShown;
|
|
325
|
+
$[33] = listStateRef;
|
|
326
|
+
$[34] = t6;
|
|
327
|
+
} else t6 = $[34];
|
|
259
328
|
const handleEdgeKey = t6;
|
|
260
329
|
let t7;
|
|
261
|
-
if ($[
|
|
262
|
-
t7 =
|
|
263
|
-
|
|
264
|
-
if (e_4.isDefaultPrevented()) return;
|
|
265
|
-
bb97: switch (e_4.key) {
|
|
330
|
+
if ($[35] !== handleArrowKey || $[36] !== handleEdgeKey || $[37] !== handleEnterKey || $[38] !== handleEscapeKey || $[39] !== isListShown || $[40] !== onCloseList) {
|
|
331
|
+
t7 = (e_4) => {
|
|
332
|
+
switch (e_4.key) {
|
|
266
333
|
case "ArrowDown":
|
|
267
334
|
case "ArrowUp":
|
|
268
335
|
handleArrowKey(e_4);
|
|
269
|
-
|
|
336
|
+
return true;
|
|
270
337
|
case "Enter":
|
|
271
338
|
handleEnterKey(e_4);
|
|
272
|
-
|
|
273
|
-
case "Escape":
|
|
274
|
-
handleEscapeKey(e_4);
|
|
275
|
-
break bb97;
|
|
339
|
+
return true;
|
|
340
|
+
case "Escape": return handleEscapeKey(e_4);
|
|
276
341
|
case "Home":
|
|
277
|
-
case "End":
|
|
342
|
+
case "End":
|
|
343
|
+
handleEdgeKey(e_4);
|
|
344
|
+
return true;
|
|
345
|
+
case "Tab":
|
|
346
|
+
if (isListShown) onCloseList();
|
|
347
|
+
return false;
|
|
348
|
+
default: return true;
|
|
278
349
|
}
|
|
279
|
-
}
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
|
|
287
|
-
|
|
350
|
+
};
|
|
351
|
+
$[35] = handleArrowKey;
|
|
352
|
+
$[36] = handleEdgeKey;
|
|
353
|
+
$[37] = handleEnterKey;
|
|
354
|
+
$[38] = handleEscapeKey;
|
|
355
|
+
$[39] = isListShown;
|
|
356
|
+
$[40] = onCloseList;
|
|
357
|
+
$[41] = t7;
|
|
358
|
+
} else t7 = $[41];
|
|
359
|
+
const handleKey = t7;
|
|
288
360
|
let t8;
|
|
289
|
-
if ($[
|
|
290
|
-
t8 = {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
361
|
+
if ($[42] !== handleKey || $[43] !== isReadOnly || $[44] !== onKeyDown) {
|
|
362
|
+
t8 = { onKeyDown: (e_5) => {
|
|
363
|
+
onKeyDown?.(e_5);
|
|
364
|
+
if (e_5.isDefaultPrevented() || isComposing(e_5)) return;
|
|
365
|
+
if ((isReadOnly || !handleKey(e_5)) && OVERLAY_KEYS.has(e_5.key)) e_5.continuePropagation();
|
|
366
|
+
} };
|
|
367
|
+
$[42] = handleKey;
|
|
368
|
+
$[43] = isReadOnly;
|
|
369
|
+
$[44] = onKeyDown;
|
|
370
|
+
$[45] = t8;
|
|
371
|
+
} else t8 = $[45];
|
|
372
|
+
const { keyboardProps } = useKeyboard(t8);
|
|
373
|
+
let t9;
|
|
374
|
+
if ($[46] !== keyboardProps) {
|
|
375
|
+
t9 = { keyboardProps };
|
|
376
|
+
$[46] = keyboardProps;
|
|
377
|
+
$[47] = t9;
|
|
378
|
+
} else t9 = $[47];
|
|
379
|
+
return t9;
|
|
295
380
|
}
|
|
296
381
|
const ComboBoxInput = forwardRef(function ComboBoxInput(t0, ref) {
|
|
297
|
-
const $ = c(
|
|
298
|
-
const { qa, inputRef, id, value, placeholder, isDisabled, isReadOnly, isRequired, autoFocus, autoComplete, size, mods, inputStyles, keyboardProps, focusProps, onChange, onFocus,
|
|
382
|
+
const $ = c(26);
|
|
383
|
+
const { qa, inputRef, id, value, placeholder, isDisabled, isReadOnly, isRequired, autoFocus, autoComplete, size, mods, inputStyles, keyboardProps, focusProps, onChange, onFocus, onPointerDown, onClick, isListShown, comboBoxId, activeDescendant, ariaProps, isInvalid } = t0;
|
|
299
384
|
const combinedRef = useCombinedRefs(ref, inputRef);
|
|
300
385
|
const t1 = autoFocus ? "" : void 0;
|
|
301
386
|
const t2 = isRequired || void 0;
|
|
302
|
-
const t3 =
|
|
303
|
-
const t4 =
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
t6 = /* @__PURE__ */ jsx(InputElement, {
|
|
387
|
+
const t3 = isListShown ? `ComboBoxListBox-${comboBoxId}` : void 0;
|
|
388
|
+
const t4 = isInvalid || void 0;
|
|
389
|
+
let t5;
|
|
390
|
+
if ($[0] !== activeDescendant || $[1] !== ariaProps || $[2] !== autoComplete || $[3] !== autoFocus || $[4] !== combinedRef || $[5] !== focusProps.onBlur || $[6] !== id || $[7] !== inputStyles || $[8] !== isDisabled || $[9] !== isListShown || $[10] !== isReadOnly || $[11] !== keyboardProps || $[12] !== mods || $[13] !== onChange || $[14] !== onClick || $[15] !== onFocus || $[16] !== onPointerDown || $[17] !== placeholder || $[18] !== qa || $[19] !== size || $[20] !== t1 || $[21] !== t2 || $[22] !== t3 || $[23] !== t4 || $[24] !== value) {
|
|
391
|
+
t5 = /* @__PURE__ */ jsx(InputElement, {
|
|
308
392
|
ref: combinedRef,
|
|
309
393
|
qa,
|
|
310
394
|
id,
|
|
@@ -318,6 +402,8 @@ const ComboBoxInput = forwardRef(function ComboBoxInput(t0, ref) {
|
|
|
318
402
|
"data-autofocus": t1,
|
|
319
403
|
onChange,
|
|
320
404
|
onFocus,
|
|
405
|
+
onPointerDown,
|
|
406
|
+
onClick,
|
|
321
407
|
onBlur: focusProps.onBlur,
|
|
322
408
|
...keyboardProps,
|
|
323
409
|
styles: inputStyles,
|
|
@@ -326,11 +412,12 @@ const ComboBoxInput = forwardRef(function ComboBoxInput(t0, ref) {
|
|
|
326
412
|
"data-input-type": "combobox",
|
|
327
413
|
role: "combobox",
|
|
328
414
|
"aria-required": t2,
|
|
329
|
-
"aria-expanded":
|
|
415
|
+
"aria-expanded": isListShown,
|
|
330
416
|
"aria-haspopup": "listbox",
|
|
331
|
-
"aria-controls":
|
|
417
|
+
"aria-controls": t3,
|
|
418
|
+
"aria-autocomplete": "list",
|
|
332
419
|
"aria-activedescendant": activeDescendant,
|
|
333
|
-
"aria-invalid":
|
|
420
|
+
"aria-invalid": t4,
|
|
334
421
|
...ariaProps
|
|
335
422
|
});
|
|
336
423
|
$[0] = activeDescendant;
|
|
@@ -342,225 +429,319 @@ const ComboBoxInput = forwardRef(function ComboBoxInput(t0, ref) {
|
|
|
342
429
|
$[6] = id;
|
|
343
430
|
$[7] = inputStyles;
|
|
344
431
|
$[8] = isDisabled;
|
|
345
|
-
$[9] =
|
|
346
|
-
$[10] =
|
|
347
|
-
$[11] =
|
|
348
|
-
$[12] =
|
|
349
|
-
$[13] =
|
|
350
|
-
$[14] =
|
|
351
|
-
$[15] =
|
|
352
|
-
$[16] =
|
|
353
|
-
$[17] =
|
|
354
|
-
$[18] =
|
|
355
|
-
$[19] =
|
|
356
|
-
$[20] =
|
|
357
|
-
$[21] =
|
|
358
|
-
$[22] =
|
|
359
|
-
$[23] =
|
|
360
|
-
|
|
361
|
-
|
|
432
|
+
$[9] = isListShown;
|
|
433
|
+
$[10] = isReadOnly;
|
|
434
|
+
$[11] = keyboardProps;
|
|
435
|
+
$[12] = mods;
|
|
436
|
+
$[13] = onChange;
|
|
437
|
+
$[14] = onClick;
|
|
438
|
+
$[15] = onFocus;
|
|
439
|
+
$[16] = onPointerDown;
|
|
440
|
+
$[17] = placeholder;
|
|
441
|
+
$[18] = qa;
|
|
442
|
+
$[19] = size;
|
|
443
|
+
$[20] = t1;
|
|
444
|
+
$[21] = t2;
|
|
445
|
+
$[22] = t3;
|
|
446
|
+
$[23] = t4;
|
|
447
|
+
$[24] = value;
|
|
448
|
+
$[25] = t5;
|
|
449
|
+
} else t5 = $[25];
|
|
450
|
+
return t5;
|
|
362
451
|
});
|
|
363
452
|
const ComboBox = forwardRef(function ComboBox(props, ref) {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
} });
|
|
453
|
+
const $ = c(283);
|
|
454
|
+
let t0;
|
|
455
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
456
|
+
t0 = { valuePropsMapper: _temp2 };
|
|
457
|
+
$[0] = t0;
|
|
458
|
+
} else t0 = $[0];
|
|
459
|
+
props = useFieldProps(props, t0);
|
|
372
460
|
const { t } = useI18n();
|
|
373
|
-
let { qa, label, extra, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, id, icon, prefix, isDisabled, autoFocus, autoComplete
|
|
374
|
-
|
|
461
|
+
let { qa, label, extra, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, id, icon, prefix: t1, isDisabled, autoFocus, autoComplete: t2, wrapperRef: t3, inputRef: t4, triggerRef, popoverRef, listBoxRef, isLoading, inputStyles, optionStyles, triggerStyles, listBoxStyles, overlayStyles, suffix, hideTrigger, message, description, size: t5, direction: t6, shouldFlip: t7, popoverTrigger: t8, suffixPosition: t9, filter, styles, labelSuffix, selectedKey, defaultSelectedKey, inputValue, defaultInputValue, onInputChange, isClearable, onClear, placeholder, allowsCustomValue, shouldCommitOnBlur: t10, clearOnBlur, items, children: renderChildren, sectionStyles, headingStyles, listGap, isReadOnly, overlayOffset: t11, containerPadding: t12, onSelectionChange: externalOnSelectionChange, sortSelectedToTop: sortSelectedToTopProp, onOpenChange, onFocus, onBlur, onKeyDown, form, ...otherProps } = props;
|
|
462
|
+
let prefix = t1;
|
|
463
|
+
const autoComplete = t2 === void 0 ? "off" : t2;
|
|
464
|
+
let wrapperRef = t3;
|
|
465
|
+
let inputRef = t4;
|
|
466
|
+
const size = t5 === void 0 ? "medium" : t5;
|
|
467
|
+
const direction = t6 === void 0 ? "bottom" : t6;
|
|
468
|
+
const shouldFlip = t7 === void 0 ? true : t7;
|
|
469
|
+
const popoverTrigger = t8 === void 0 ? "input" : t8;
|
|
470
|
+
const suffixPosition = t9 === void 0 ? "before" : t9;
|
|
471
|
+
const shouldCommitOnBlur = t10 === void 0 ? true : t10;
|
|
472
|
+
const overlayOffset = t11 === void 0 ? 8 : t11;
|
|
473
|
+
const containerPadding = t12 === void 0 ? 8 : t12;
|
|
474
|
+
let t13;
|
|
475
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
476
|
+
t13 = generateRandomId();
|
|
477
|
+
$[1] = t13;
|
|
478
|
+
} else t13 = $[1];
|
|
479
|
+
const comboBoxId = t13;
|
|
375
480
|
wrapperRef = useCombinedRefs(wrapperRef);
|
|
376
481
|
popoverRef = useCombinedRefs(popoverRef);
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
482
|
+
const t14 = wrapperRef;
|
|
483
|
+
const t15 = popoverRef;
|
|
484
|
+
let t16;
|
|
485
|
+
if ($[2] !== comboBoxId || $[3] !== defaultInputValue || $[4] !== defaultSelectedKey || $[5] !== inputValue || $[6] !== selectedKey || $[7] !== t14 || $[8] !== t15) {
|
|
486
|
+
t16 = {
|
|
487
|
+
selectedKey,
|
|
488
|
+
defaultSelectedKey,
|
|
489
|
+
inputValue,
|
|
490
|
+
defaultInputValue,
|
|
491
|
+
comboBoxId,
|
|
492
|
+
triggerRef: t14,
|
|
493
|
+
popoverRef: t15
|
|
494
|
+
};
|
|
495
|
+
$[2] = comboBoxId;
|
|
496
|
+
$[3] = defaultInputValue;
|
|
497
|
+
$[4] = defaultSelectedKey;
|
|
498
|
+
$[5] = inputValue;
|
|
499
|
+
$[6] = selectedKey;
|
|
500
|
+
$[7] = t14;
|
|
501
|
+
$[8] = t15;
|
|
502
|
+
$[9] = t16;
|
|
503
|
+
} else t16 = $[9];
|
|
504
|
+
const { effectiveSelectedKey, internalInputValue, isPopoverOpen, setIsPopoverOpen, setInternalSelectedKey, setInternalInputValue, isControlledKey, isControlledInput } = useComboBoxState(t16);
|
|
387
505
|
const sortSelectedToTop = sortSelectedToTopProp ?? (items ? true : false);
|
|
388
|
-
const cachedItemsOrder = useRef(null);
|
|
389
|
-
const selectionWhenClosed = useRef(null);
|
|
390
506
|
styles = extractStyles(otherProps, PROP_STYLES, styles);
|
|
391
507
|
ref = useCombinedRefs(ref);
|
|
392
508
|
inputRef = useCombinedRefs(inputRef);
|
|
393
509
|
triggerRef = useCombinedRefs(triggerRef);
|
|
394
510
|
listBoxRef = useCombinedRefs(listBoxRef);
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
return key != null && String(key) === String(selectedKey_0);
|
|
409
|
-
});
|
|
410
|
-
if (!selectedItem) return items;
|
|
411
|
-
const sorted = [selectedItem, ...itemsArray.filter((item_0) => {
|
|
412
|
-
const key_0 = item_0?.key ?? item_0?.id;
|
|
413
|
-
return key_0 == null || String(key_0) !== String(selectedKey_0);
|
|
414
|
-
})];
|
|
415
|
-
if (isPopoverOpen) cachedItemsOrder.current = sorted;
|
|
416
|
-
return sorted;
|
|
417
|
-
}, [
|
|
418
|
-
items,
|
|
419
|
-
sortSelectedToTop,
|
|
420
|
-
sortSelectedToTopExplicit,
|
|
421
|
-
effectiveSelectedKey,
|
|
422
|
-
isPopoverOpen
|
|
423
|
-
])();
|
|
424
|
-
let children = renderChildren;
|
|
425
|
-
const renderFn = renderChildren;
|
|
426
|
-
if (sortedItems && typeof renderFn === "function") try {
|
|
427
|
-
children = Array.from(sortedItems).map((item_1, idx) => {
|
|
428
|
-
const rendered = renderFn(item_1);
|
|
429
|
-
if (React.isValidElement(rendered) && rendered.key == null) return React.cloneElement(rendered, { key: rendered?.key ?? item_1?.key ?? idx });
|
|
430
|
-
return rendered;
|
|
431
|
-
});
|
|
432
|
-
} catch {}
|
|
433
|
-
useEffect(() => {
|
|
434
|
-
cachedItemsOrder.current = null;
|
|
435
|
-
}, [items]);
|
|
436
|
-
useEffect(() => {
|
|
437
|
-
if (!isPopoverOpen) {
|
|
438
|
-
selectionWhenClosed.current = effectiveSelectedKey != null ? String(effectiveSelectedKey) : null;
|
|
439
|
-
cachedItemsOrder.current = null;
|
|
440
|
-
}
|
|
441
|
-
}, [isPopoverOpen, effectiveSelectedKey]);
|
|
442
|
-
useEffect(() => {
|
|
443
|
-
onOpenChange?.(isPopoverOpen);
|
|
444
|
-
}, [isPopoverOpen]);
|
|
445
|
-
const { filterFn, isFilterActive, setIsFilterActive } = useComboBoxFiltering({
|
|
446
|
-
effectiveInputValue,
|
|
447
|
-
filter
|
|
448
|
-
});
|
|
449
|
-
const localCollectionState = useListState({
|
|
450
|
-
children,
|
|
451
|
-
items: sortedItems,
|
|
452
|
-
disabledKeys: props.disabledKeys,
|
|
453
|
-
selectionMode: "none"
|
|
454
|
-
});
|
|
455
|
-
const { isFocused, focusProps } = useFocus$1();
|
|
456
|
-
const checkInputValidity = useCallback(() => {
|
|
457
|
-
if (!effectiveInputValue.trim()) return {
|
|
458
|
-
isInputValid: false,
|
|
459
|
-
singleMatchKey: null,
|
|
460
|
-
filteredCount: 0
|
|
461
|
-
};
|
|
462
|
-
const filteredNodes = filterFn(localCollectionState.collection);
|
|
463
|
-
const filteredItems = [];
|
|
464
|
-
for (const node of filteredNodes) if (node.type === "section" && node.childNodes) {
|
|
465
|
-
for (const child of node.childNodes) if (child.type === "item") filteredItems.push({
|
|
466
|
-
key: child.key,
|
|
467
|
-
textValue: child.textValue || ""
|
|
511
|
+
const [sortKey, setSortKey] = useState(effectiveSelectedKey);
|
|
512
|
+
if (!isPopoverOpen && sortKey !== effectiveSelectedKey) setSortKey(effectiveSelectedKey);
|
|
513
|
+
let children;
|
|
514
|
+
let sortedItems;
|
|
515
|
+
if ($[10] !== items || $[11] !== renderChildren || $[12] !== sortKey || $[13] !== sortSelectedToTop) {
|
|
516
|
+
sortedItems = items && sortSelectedToTop ? sortSelectedFirst(items, sortKey) : items;
|
|
517
|
+
children = renderChildren;
|
|
518
|
+
const renderFn = renderChildren;
|
|
519
|
+
if (sortedItems && typeof renderFn === "function") try {
|
|
520
|
+
children = Array.from(sortedItems).map((item, idx) => {
|
|
521
|
+
const rendered = renderFn(item);
|
|
522
|
+
if (React.isValidElement(rendered) && rendered.key == null) return React.cloneElement(rendered, { key: rendered?.key ?? item?.key ?? idx });
|
|
523
|
+
return rendered;
|
|
468
524
|
});
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
525
|
+
} catch {}
|
|
526
|
+
$[10] = items;
|
|
527
|
+
$[11] = renderChildren;
|
|
528
|
+
$[12] = sortKey;
|
|
529
|
+
$[13] = sortSelectedToTop;
|
|
530
|
+
$[14] = children;
|
|
531
|
+
$[15] = sortedItems;
|
|
532
|
+
} else {
|
|
533
|
+
children = $[14];
|
|
534
|
+
sortedItems = $[15];
|
|
535
|
+
}
|
|
536
|
+
const t17 = children;
|
|
537
|
+
let t18;
|
|
538
|
+
if ($[16] !== props.disabledKeys || $[17] !== sortedItems || $[18] !== t17) {
|
|
539
|
+
t18 = {
|
|
540
|
+
children: t17,
|
|
541
|
+
items: sortedItems,
|
|
542
|
+
disabledKeys: props.disabledKeys,
|
|
543
|
+
selectionMode: "none"
|
|
544
|
+
};
|
|
545
|
+
$[16] = props.disabledKeys;
|
|
546
|
+
$[17] = sortedItems;
|
|
547
|
+
$[18] = t17;
|
|
548
|
+
$[19] = t18;
|
|
549
|
+
} else t18 = $[19];
|
|
550
|
+
const localCollectionState = useListState(t18);
|
|
551
|
+
const { selectedLabel, pickLabel } = useSelectedLabel(localCollectionState.collection, effectiveSelectedKey);
|
|
552
|
+
const effectiveInputValue = isControlledInput ? inputValue : internalInputValue ?? selectedLabel;
|
|
553
|
+
let t19;
|
|
554
|
+
if ($[20] !== effectiveInputValue || $[21] !== filter) {
|
|
555
|
+
t19 = {
|
|
556
|
+
effectiveInputValue,
|
|
557
|
+
filter
|
|
558
|
+
};
|
|
559
|
+
$[20] = effectiveInputValue;
|
|
560
|
+
$[21] = filter;
|
|
561
|
+
$[22] = t19;
|
|
562
|
+
} else t19 = $[22];
|
|
563
|
+
const { filterFn, isSameText, setIsFilterActive } = useComboBoxFiltering(t19);
|
|
564
|
+
let t20;
|
|
565
|
+
if ($[23] !== filterFn || $[24] !== localCollectionState.collection) {
|
|
566
|
+
t20 = collectOptions(filterFn(localCollectionState.collection));
|
|
567
|
+
$[23] = filterFn;
|
|
568
|
+
$[24] = localCollectionState.collection;
|
|
569
|
+
$[25] = t20;
|
|
570
|
+
} else t20 = $[25];
|
|
571
|
+
const filteredOptions = t20;
|
|
572
|
+
const hasResults = filteredOptions.length > 0;
|
|
573
|
+
const shouldShowPopover = isPopoverOpen && hasResults;
|
|
574
|
+
const reportedOpenRef = useRef(shouldShowPopover);
|
|
575
|
+
let t21;
|
|
576
|
+
let t22;
|
|
577
|
+
if ($[26] !== onOpenChange || $[27] !== shouldShowPopover) {
|
|
578
|
+
t21 = () => {
|
|
579
|
+
if (reportedOpenRef.current === shouldShowPopover) return;
|
|
580
|
+
reportedOpenRef.current = shouldShowPopover;
|
|
581
|
+
onOpenChange?.(shouldShowPopover);
|
|
582
|
+
};
|
|
583
|
+
t22 = [shouldShowPopover, onOpenChange];
|
|
584
|
+
$[26] = onOpenChange;
|
|
585
|
+
$[27] = shouldShowPopover;
|
|
586
|
+
$[28] = t21;
|
|
587
|
+
$[29] = t22;
|
|
588
|
+
} else {
|
|
589
|
+
t21 = $[28];
|
|
590
|
+
t22 = $[29];
|
|
591
|
+
}
|
|
592
|
+
useEffect(t21, t22);
|
|
593
|
+
const { isFocused, focusProps } = useFocus$1();
|
|
594
|
+
let t23;
|
|
595
|
+
if ($[30] !== isControlledKey || $[31] !== setInternalSelectedKey) {
|
|
596
|
+
t23 = (key) => {
|
|
597
|
+
if (!isControlledKey) setInternalSelectedKey(key);
|
|
598
|
+
};
|
|
599
|
+
$[30] = isControlledKey;
|
|
600
|
+
$[31] = setInternalSelectedKey;
|
|
601
|
+
$[32] = t23;
|
|
602
|
+
} else t23 = $[32];
|
|
603
|
+
const setSelectedKey = t23;
|
|
604
|
+
let t24;
|
|
605
|
+
if ($[33] !== effectiveInputValue || $[34] !== isControlledInput || $[35] !== onInputChange || $[36] !== setInternalInputValue) {
|
|
606
|
+
t24 = (label_0) => {
|
|
607
|
+
if (!isControlledInput) setInternalInputValue(null);
|
|
608
|
+
if (label_0 !== effectiveInputValue) onInputChange?.(label_0);
|
|
609
|
+
};
|
|
610
|
+
$[33] = effectiveInputValue;
|
|
611
|
+
$[34] = isControlledInput;
|
|
612
|
+
$[35] = onInputChange;
|
|
613
|
+
$[36] = setInternalInputValue;
|
|
614
|
+
$[37] = t24;
|
|
615
|
+
} else t24 = $[37];
|
|
616
|
+
const showSelectionLabel = t24;
|
|
617
|
+
let t25;
|
|
618
|
+
if ($[38] !== effectiveSelectedKey || $[39] !== externalOnSelectionChange || $[40] !== setSelectedKey || $[41] !== showSelectionLabel) {
|
|
619
|
+
t25 = () => {
|
|
620
|
+
if (effectiveSelectedKey != null) {
|
|
621
|
+
externalOnSelectionChange?.(null);
|
|
622
|
+
setSelectedKey(null);
|
|
623
|
+
}
|
|
624
|
+
showSelectionLabel("");
|
|
625
|
+
};
|
|
626
|
+
$[38] = effectiveSelectedKey;
|
|
627
|
+
$[39] = externalOnSelectionChange;
|
|
628
|
+
$[40] = setSelectedKey;
|
|
629
|
+
$[41] = showSelectionLabel;
|
|
630
|
+
$[42] = t25;
|
|
631
|
+
} else t25 = $[42];
|
|
632
|
+
const clearSelectionAndInput = t25;
|
|
633
|
+
let t26;
|
|
634
|
+
if ($[43] !== selectedLabel || $[44] !== showSelectionLabel) {
|
|
635
|
+
t26 = () => showSelectionLabel(selectedLabel);
|
|
636
|
+
$[43] = selectedLabel;
|
|
637
|
+
$[44] = showSelectionLabel;
|
|
638
|
+
$[45] = t26;
|
|
639
|
+
} else t26 = $[45];
|
|
640
|
+
const restoreSelectedLabel = t26;
|
|
641
|
+
let t27;
|
|
642
|
+
if ($[46] !== clearSelectionAndInput || $[47] !== effectiveInputValue || $[48] !== effectiveSelectedKey || $[49] !== externalOnSelectionChange || $[50] !== restoreSelectedLabel || $[51] !== setSelectedKey || $[52] !== shouldCommitOnBlur || $[53] !== showSelectionLabel) {
|
|
643
|
+
t27 = () => {
|
|
644
|
+
const value_0 = effectiveInputValue.trim();
|
|
645
|
+
if (shouldCommitOnBlur && value_0 && effectiveSelectedKey == null) {
|
|
646
|
+
externalOnSelectionChange?.(value_0);
|
|
647
|
+
setSelectedKey(value_0);
|
|
648
|
+
showSelectionLabel(value_0);
|
|
649
|
+
} else if (!value_0) clearSelectionAndInput();
|
|
650
|
+
else restoreSelectedLabel();
|
|
651
|
+
};
|
|
652
|
+
$[46] = clearSelectionAndInput;
|
|
653
|
+
$[47] = effectiveInputValue;
|
|
654
|
+
$[48] = effectiveSelectedKey;
|
|
655
|
+
$[49] = externalOnSelectionChange;
|
|
656
|
+
$[50] = restoreSelectedLabel;
|
|
657
|
+
$[51] = setSelectedKey;
|
|
658
|
+
$[52] = shouldCommitOnBlur;
|
|
659
|
+
$[53] = showSelectionLabel;
|
|
660
|
+
$[54] = t27;
|
|
661
|
+
} else t27 = $[54];
|
|
662
|
+
const settleCustomValueOnBlur = t27;
|
|
663
|
+
let t28;
|
|
664
|
+
if ($[55] !== clearOnBlur || $[56] !== clearSelectionAndInput || $[57] !== effectiveInputValue || $[58] !== effectiveSelectedKey || $[59] !== externalOnSelectionChange || $[60] !== filteredOptions || $[61] !== isSameText || $[62] !== localCollectionState.disabledKeys || $[63] !== pickLabel || $[64] !== restoreSelectedLabel || $[65] !== setSelectedKey || $[66] !== showSelectionLabel) {
|
|
665
|
+
t28 = () => {
|
|
666
|
+
const matchKey = findTypedOption(filteredOptions, effectiveInputValue, effectiveSelectedKey, localCollectionState.disabledKeys, isSameText);
|
|
667
|
+
if (matchKey != null && matchKey !== effectiveSelectedKey) {
|
|
668
|
+
setSelectedKey(matchKey);
|
|
669
|
+
showSelectionLabel(pickLabel(matchKey));
|
|
670
|
+
externalOnSelectionChange?.(matchKey);
|
|
671
|
+
} else if (matchKey == null && (clearOnBlur || !effectiveInputValue.trim())) clearSelectionAndInput();
|
|
672
|
+
else restoreSelectedLabel();
|
|
673
|
+
};
|
|
674
|
+
$[55] = clearOnBlur;
|
|
675
|
+
$[56] = clearSelectionAndInput;
|
|
676
|
+
$[57] = effectiveInputValue;
|
|
677
|
+
$[58] = effectiveSelectedKey;
|
|
678
|
+
$[59] = externalOnSelectionChange;
|
|
679
|
+
$[60] = filteredOptions;
|
|
680
|
+
$[61] = isSameText;
|
|
681
|
+
$[62] = localCollectionState.disabledKeys;
|
|
682
|
+
$[63] = pickLabel;
|
|
683
|
+
$[64] = restoreSelectedLabel;
|
|
684
|
+
$[65] = setSelectedKey;
|
|
685
|
+
$[66] = showSelectionLabel;
|
|
686
|
+
$[67] = t28;
|
|
687
|
+
} else t28 = $[67];
|
|
688
|
+
const settleOptionOnBlur = t28;
|
|
689
|
+
let t29;
|
|
690
|
+
if ($[68] !== allowsCustomValue || $[69] !== isReadOnly || $[70] !== onBlur || $[71] !== setIsFilterActive || $[72] !== setIsPopoverOpen || $[73] !== settleCustomValueOnBlur || $[74] !== settleOptionOnBlur) {
|
|
691
|
+
t29 = () => {
|
|
692
|
+
setIsPopoverOpen(false);
|
|
693
|
+
if (isReadOnly) {} else if (allowsCustomValue) settleCustomValueOnBlur();
|
|
694
|
+
else settleOptionOnBlur();
|
|
695
|
+
onBlur?.();
|
|
696
|
+
setIsFilterActive(false);
|
|
697
|
+
};
|
|
698
|
+
$[68] = allowsCustomValue;
|
|
699
|
+
$[69] = isReadOnly;
|
|
700
|
+
$[70] = onBlur;
|
|
701
|
+
$[71] = setIsFilterActive;
|
|
702
|
+
$[72] = setIsPopoverOpen;
|
|
703
|
+
$[73] = settleCustomValueOnBlur;
|
|
704
|
+
$[74] = settleOptionOnBlur;
|
|
705
|
+
$[75] = t29;
|
|
706
|
+
} else t29 = $[75];
|
|
707
|
+
const handleCompositeBlur = useEvent(t29);
|
|
708
|
+
const t30 = wrapperRef;
|
|
709
|
+
let t31;
|
|
710
|
+
if ($[76] !== handleCompositeBlur || $[77] !== isDisabled || $[78] !== onFocus || $[79] !== popoverRef || $[80] !== t30) {
|
|
711
|
+
t31 = {
|
|
712
|
+
wrapperRef: t30,
|
|
713
|
+
popoverRef,
|
|
714
|
+
onFocus,
|
|
715
|
+
onBlur: handleCompositeBlur,
|
|
716
|
+
isDisabled
|
|
717
|
+
};
|
|
718
|
+
$[76] = handleCompositeBlur;
|
|
719
|
+
$[77] = isDisabled;
|
|
720
|
+
$[78] = onFocus;
|
|
721
|
+
$[79] = popoverRef;
|
|
722
|
+
$[80] = t30;
|
|
723
|
+
$[81] = t31;
|
|
724
|
+
} else t31 = $[81];
|
|
725
|
+
const { compositeFocusProps } = useCompositeFocus(t31);
|
|
726
|
+
let t32;
|
|
727
|
+
if ($[82] !== isInvalid || $[83] !== isValid) {
|
|
728
|
+
t32 = getValidationIcon({
|
|
729
|
+
isInvalid,
|
|
730
|
+
isValid
|
|
472
731
|
});
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
isInputValid: false,
|
|
479
|
-
singleMatchKey: null,
|
|
480
|
-
filteredCount
|
|
481
|
-
};
|
|
482
|
-
return {
|
|
483
|
-
isInputValid: true,
|
|
484
|
-
singleMatchKey: match.key,
|
|
485
|
-
filteredCount
|
|
486
|
-
};
|
|
487
|
-
}, [
|
|
488
|
-
effectiveInputValue,
|
|
489
|
-
effectiveSelectedKey,
|
|
490
|
-
filterFn,
|
|
491
|
-
localCollectionState.collection,
|
|
492
|
-
localCollectionState.disabledKeys
|
|
493
|
-
]);
|
|
494
|
-
const setSelectedKey = (key_1) => {
|
|
495
|
-
if (!isControlledKey) setInternalSelectedKey(key_1);
|
|
496
|
-
};
|
|
497
|
-
const setInputText = (value_0) => {
|
|
498
|
-
if (!isControlledInput) setInternalInputValue(value_0);
|
|
499
|
-
onInputChange?.(value_0);
|
|
500
|
-
};
|
|
501
|
-
const clearSelectionAndInput = () => {
|
|
502
|
-
externalOnSelectionChange?.(null);
|
|
503
|
-
setSelectedKey(null);
|
|
504
|
-
setInputText("");
|
|
505
|
-
};
|
|
506
|
-
const restoreSelectedLabel = () => {
|
|
507
|
-
setInputText(effectiveSelectedKey != null ? getItemLabel(effectiveSelectedKey) : "");
|
|
508
|
-
};
|
|
509
|
-
const settleCustomValueOnBlur = () => {
|
|
510
|
-
if (shouldCommitOnBlur && effectiveInputValue && effectiveSelectedKey == null) {
|
|
511
|
-
externalOnSelectionChange?.(effectiveInputValue);
|
|
512
|
-
setSelectedKey(effectiveInputValue);
|
|
513
|
-
} else if (!String(effectiveInputValue).trim()) clearSelectionAndInput();
|
|
514
|
-
else restoreSelectedLabel();
|
|
515
|
-
};
|
|
516
|
-
const settleOptionOnBlur = () => {
|
|
517
|
-
const { isInputValid, singleMatchKey } = checkInputValidity();
|
|
518
|
-
if (isInputValid && singleMatchKey != null && singleMatchKey !== effectiveSelectedKey) {
|
|
519
|
-
const label_0 = getItemLabel(singleMatchKey);
|
|
520
|
-
setSelectedKey(singleMatchKey);
|
|
521
|
-
setInputText(label_0);
|
|
522
|
-
externalOnSelectionChange?.(singleMatchKey);
|
|
523
|
-
} else if (!isInputValid && (clearOnBlur || !effectiveInputValue.trim())) clearSelectionAndInput();
|
|
524
|
-
else restoreSelectedLabel();
|
|
525
|
-
};
|
|
526
|
-
const handleCompositeBlur = useEvent(() => {
|
|
527
|
-
setIsPopoverOpen(false);
|
|
528
|
-
if (allowsCustomValue) settleCustomValueOnBlur();
|
|
529
|
-
else settleOptionOnBlur();
|
|
530
|
-
onBlur?.();
|
|
531
|
-
setIsFilterActive(false);
|
|
532
|
-
});
|
|
533
|
-
const { compositeFocusProps } = useCompositeFocus({
|
|
534
|
-
wrapperRef,
|
|
535
|
-
popoverRef,
|
|
536
|
-
onFocus,
|
|
537
|
-
onBlur: handleCompositeBlur,
|
|
538
|
-
isDisabled
|
|
539
|
-
});
|
|
540
|
-
let validationIcon = getValidationIcon({
|
|
541
|
-
isInvalid,
|
|
542
|
-
isValid
|
|
543
|
-
});
|
|
732
|
+
$[82] = isInvalid;
|
|
733
|
+
$[83] = isValid;
|
|
734
|
+
$[84] = t32;
|
|
735
|
+
} else t32 = $[84];
|
|
736
|
+
const validationIcon = t32;
|
|
544
737
|
const listStateRef = useRef(null);
|
|
545
|
-
const focusInitAttemptsRef = useRef(0);
|
|
546
738
|
const [activeOptionKey, setActiveOptionKey] = useState(null);
|
|
547
|
-
const getItemLabel = useCallback((key_2) => {
|
|
548
|
-
return (localCollectionState?.collection?.getItem(key_2))?.textValue || String(key_2);
|
|
549
|
-
}, [localCollectionState?.collection]);
|
|
550
739
|
const handleSelectionChange = useEvent((selection) => {
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
if (!isControlledInput) setInternalInputValue(label_1);
|
|
557
|
-
onInputChange?.(label_1);
|
|
558
|
-
} else {
|
|
559
|
-
if (!isControlledInput) setInternalInputValue("");
|
|
560
|
-
onInputChange?.("");
|
|
561
|
-
setIsFilterActive(false);
|
|
562
|
-
}
|
|
563
|
-
externalOnSelectionChange?.(key_3);
|
|
740
|
+
const key_0 = Array.isArray(selection) ? selection[0] : selection;
|
|
741
|
+
setSelectedKey(key_0 ?? null);
|
|
742
|
+
setIsFilterActive(false);
|
|
743
|
+
showSelectionLabel(key_0 != null ? pickLabel(key_0) : "");
|
|
744
|
+
externalOnSelectionChange?.(key_0);
|
|
564
745
|
setIsPopoverOpen(false);
|
|
565
746
|
setTimeout(() => {
|
|
566
747
|
inputRef.current?.focus();
|
|
@@ -568,304 +749,590 @@ const ComboBox = forwardRef(function ComboBox(props, ref) {
|
|
|
568
749
|
});
|
|
569
750
|
const lastSyncedSelectedKey = useRef(void 0);
|
|
570
751
|
const selectionClearedByTyping = useRef(false);
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
if (
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
752
|
+
let t33;
|
|
753
|
+
if ($[85] !== allowsCustomValue || $[86] !== effectiveSelectedKey || $[87] !== externalOnSelectionChange || $[88] !== isControlledInput || $[89] !== isControlledKey || $[90] !== isPopoverOpen || $[91] !== onInputChange || $[92] !== popoverTrigger || $[93] !== setInternalInputValue || $[94] !== setInternalSelectedKey || $[95] !== setIsFilterActive || $[96] !== setIsPopoverOpen) {
|
|
754
|
+
t33 = (e) => {
|
|
755
|
+
const value_1 = e.target.value;
|
|
756
|
+
if (!isControlledInput) setInternalInputValue(value_1);
|
|
757
|
+
onInputChange?.(value_1);
|
|
758
|
+
setIsFilterActive(value_1.trim().length > 0);
|
|
759
|
+
if (allowsCustomValue && effectiveSelectedKey != null) {
|
|
760
|
+
selectionClearedByTyping.current = true;
|
|
761
|
+
if (!isControlledKey) setInternalSelectedKey(null);
|
|
762
|
+
externalOnSelectionChange?.(null);
|
|
763
|
+
}
|
|
764
|
+
if (popoverTrigger !== "manual" && value_1 && !isPopoverOpen) setIsPopoverOpen(true);
|
|
765
|
+
};
|
|
766
|
+
$[85] = allowsCustomValue;
|
|
767
|
+
$[86] = effectiveSelectedKey;
|
|
768
|
+
$[87] = externalOnSelectionChange;
|
|
769
|
+
$[88] = isControlledInput;
|
|
770
|
+
$[89] = isControlledKey;
|
|
771
|
+
$[90] = isPopoverOpen;
|
|
772
|
+
$[91] = onInputChange;
|
|
773
|
+
$[92] = popoverTrigger;
|
|
774
|
+
$[93] = setInternalInputValue;
|
|
775
|
+
$[94] = setInternalSelectedKey;
|
|
776
|
+
$[95] = setIsFilterActive;
|
|
777
|
+
$[96] = setIsPopoverOpen;
|
|
778
|
+
$[97] = t33;
|
|
779
|
+
} else t33 = $[97];
|
|
780
|
+
const handleInputChange = useEvent(t33);
|
|
781
|
+
let t34;
|
|
782
|
+
if ($[98] !== effectiveSelectedKey || $[99] !== isControlledInput || $[100] !== isControlledKey || $[101] !== setInternalInputValue) {
|
|
783
|
+
t34 = () => {
|
|
784
|
+
const preserveTypedInput = selectionClearedByTyping.current;
|
|
785
|
+
selectionClearedByTyping.current = false;
|
|
786
|
+
if (!isControlledKey || isControlledInput) return;
|
|
787
|
+
if (lastSyncedSelectedKey.current !== void 0 && lastSyncedSelectedKey.current === effectiveSelectedKey) return;
|
|
788
|
+
lastSyncedSelectedKey.current = effectiveSelectedKey;
|
|
789
|
+
if (preserveTypedInput && effectiveSelectedKey == null) return;
|
|
790
|
+
setInternalInputValue(null);
|
|
791
|
+
};
|
|
792
|
+
$[98] = effectiveSelectedKey;
|
|
793
|
+
$[99] = isControlledInput;
|
|
794
|
+
$[100] = isControlledKey;
|
|
795
|
+
$[101] = setInternalInputValue;
|
|
796
|
+
$[102] = t34;
|
|
797
|
+
} else t34 = $[102];
|
|
798
|
+
let t35;
|
|
799
|
+
if ($[103] !== effectiveInputValue || $[104] !== effectiveSelectedKey || $[105] !== isControlledInput || $[106] !== isControlledKey || $[107] !== setInternalInputValue) {
|
|
800
|
+
t35 = [
|
|
801
|
+
isControlledKey,
|
|
802
|
+
isControlledInput,
|
|
803
|
+
effectiveSelectedKey,
|
|
804
|
+
effectiveInputValue,
|
|
805
|
+
setInternalInputValue
|
|
806
|
+
];
|
|
807
|
+
$[103] = effectiveInputValue;
|
|
808
|
+
$[104] = effectiveSelectedKey;
|
|
809
|
+
$[105] = isControlledInput;
|
|
810
|
+
$[106] = isControlledKey;
|
|
811
|
+
$[107] = setInternalInputValue;
|
|
812
|
+
$[108] = t35;
|
|
813
|
+
} else t35 = $[108];
|
|
814
|
+
useEffect(t34, t35);
|
|
815
|
+
const showClearButton = isClearable && (allowsCustomValue ? effectiveInputValue !== "" : effectiveSelectedKey != null) && !isDisabled && !isReadOnly;
|
|
816
|
+
let t36;
|
|
817
|
+
if ($[109] !== hasResults || $[110] !== isDisabled || $[111] !== isReadOnly || $[112] !== setIsFilterActive || $[113] !== setIsPopoverOpen) {
|
|
818
|
+
t36 = () => {
|
|
819
|
+
if (isReadOnly || isDisabled) return;
|
|
820
|
+
if (!hasResults) setIsFilterActive(false);
|
|
821
|
+
setIsPopoverOpen(true);
|
|
822
|
+
};
|
|
823
|
+
$[109] = hasResults;
|
|
824
|
+
$[110] = isDisabled;
|
|
825
|
+
$[111] = isReadOnly;
|
|
826
|
+
$[112] = setIsFilterActive;
|
|
827
|
+
$[113] = setIsPopoverOpen;
|
|
828
|
+
$[114] = t36;
|
|
829
|
+
} else t36 = $[114];
|
|
830
|
+
const openList = t36;
|
|
831
|
+
const toggleList = () => {
|
|
832
|
+
if (shouldShowPopover) setIsPopoverOpen(false);
|
|
833
|
+
else openList();
|
|
834
|
+
inputRef.current?.focus();
|
|
835
|
+
};
|
|
836
|
+
let t37;
|
|
837
|
+
if ($[115] !== focusProps || $[116] !== isPopoverOpen || $[117] !== openList || $[118] !== popoverTrigger) {
|
|
838
|
+
t37 = (e_0) => {
|
|
839
|
+
focusProps.onFocus?.(e_0);
|
|
840
|
+
if (popoverTrigger === "focus" && !isPopoverOpen) openList();
|
|
841
|
+
};
|
|
842
|
+
$[115] = focusProps;
|
|
843
|
+
$[116] = isPopoverOpen;
|
|
844
|
+
$[117] = openList;
|
|
845
|
+
$[118] = popoverTrigger;
|
|
846
|
+
$[119] = t37;
|
|
847
|
+
} else t37 = $[119];
|
|
848
|
+
const handleInputFocus = useEvent(t37);
|
|
849
|
+
const pressStartedOnInputRef = useRef(false);
|
|
850
|
+
let t38;
|
|
851
|
+
if ($[120] !== hasResults || $[121] !== openList || $[122] !== popoverTrigger || $[123] !== shouldShowPopover) {
|
|
852
|
+
t38 = () => {
|
|
853
|
+
const isInputPress = pressStartedOnInputRef.current;
|
|
854
|
+
pressStartedOnInputRef.current = false;
|
|
855
|
+
if (!isInputPress || popoverTrigger === "manual") return;
|
|
856
|
+
if (!shouldShowPopover && hasResults) openList();
|
|
857
|
+
};
|
|
858
|
+
$[120] = hasResults;
|
|
859
|
+
$[121] = openList;
|
|
860
|
+
$[122] = popoverTrigger;
|
|
861
|
+
$[123] = shouldShowPopover;
|
|
862
|
+
$[124] = t38;
|
|
863
|
+
} else t38 = $[124];
|
|
864
|
+
const handleInputClick = t38;
|
|
865
|
+
let t39;
|
|
866
|
+
if ($[125] !== focusProps) {
|
|
867
|
+
t39 = (e_1) => {
|
|
868
|
+
focusProps.onBlur?.(e_1);
|
|
869
|
+
};
|
|
870
|
+
$[125] = focusProps;
|
|
871
|
+
$[126] = t39;
|
|
872
|
+
} else t39 = $[126];
|
|
873
|
+
const handleInputBlur = useEvent(t39);
|
|
874
|
+
const clearValue = useEvent(() => {
|
|
875
|
+
if (!isControlledInput) setInternalInputValue(null);
|
|
644
876
|
onInputChange?.("");
|
|
645
|
-
|
|
877
|
+
setSelectedKey(null);
|
|
646
878
|
externalOnSelectionChange?.(null);
|
|
647
879
|
if (isPopoverOpen) setIsPopoverOpen(false);
|
|
648
880
|
inputRef.current?.focus();
|
|
649
881
|
onClear?.();
|
|
650
882
|
});
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
883
|
+
let t40;
|
|
884
|
+
if ($[127] !== setIsPopoverOpen) {
|
|
885
|
+
t40 = () => setIsPopoverOpen(false);
|
|
886
|
+
$[127] = setIsPopoverOpen;
|
|
887
|
+
$[128] = t40;
|
|
888
|
+
} else t40 = $[128];
|
|
889
|
+
const t41 = inputRef;
|
|
890
|
+
let t42;
|
|
891
|
+
if ($[129] !== allowsCustomValue || $[130] !== clearValue || $[131] !== effectiveInputValue || $[132] !== effectiveSelectedKey || $[133] !== handleSelectionChange || $[134] !== hasResults || $[135] !== isClearable || $[136] !== isReadOnly || $[137] !== onKeyDown || $[138] !== openList || $[139] !== selectedLabel || $[140] !== setActiveOptionKey || $[141] !== shouldShowPopover || $[142] !== t40 || $[143] !== t41) {
|
|
892
|
+
t42 = {
|
|
893
|
+
isListShown: shouldShowPopover,
|
|
894
|
+
isReadOnly,
|
|
895
|
+
listStateRef,
|
|
896
|
+
hasResults,
|
|
897
|
+
allowsCustomValue,
|
|
898
|
+
effectiveInputValue,
|
|
899
|
+
selectedKey: effectiveSelectedKey,
|
|
900
|
+
selectedLabel,
|
|
901
|
+
isClearable,
|
|
902
|
+
onSelectionChange: handleSelectionChange,
|
|
903
|
+
onClearValue: clearValue,
|
|
904
|
+
onOpenList: openList,
|
|
905
|
+
onCloseList: t40,
|
|
906
|
+
inputRef: t41,
|
|
907
|
+
onVirtualFocus: setActiveOptionKey,
|
|
908
|
+
onKeyDown
|
|
909
|
+
};
|
|
910
|
+
$[129] = allowsCustomValue;
|
|
911
|
+
$[130] = clearValue;
|
|
912
|
+
$[131] = effectiveInputValue;
|
|
913
|
+
$[132] = effectiveSelectedKey;
|
|
914
|
+
$[133] = handleSelectionChange;
|
|
915
|
+
$[134] = hasResults;
|
|
916
|
+
$[135] = isClearable;
|
|
917
|
+
$[136] = isReadOnly;
|
|
918
|
+
$[137] = onKeyDown;
|
|
919
|
+
$[138] = openList;
|
|
920
|
+
$[139] = selectedLabel;
|
|
921
|
+
$[140] = setActiveOptionKey;
|
|
922
|
+
$[141] = shouldShowPopover;
|
|
923
|
+
$[142] = t40;
|
|
924
|
+
$[143] = t41;
|
|
925
|
+
$[144] = t42;
|
|
926
|
+
} else t42 = $[144];
|
|
927
|
+
const { keyboardProps } = useComboBoxKeyboard(t42);
|
|
667
928
|
if (icon) {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
929
|
+
let t43;
|
|
930
|
+
if ($[145] !== icon) {
|
|
931
|
+
t43 = /* @__PURE__ */ jsx("div", {
|
|
932
|
+
"data-element": "InputIcon",
|
|
933
|
+
children: icon
|
|
934
|
+
});
|
|
935
|
+
$[145] = icon;
|
|
936
|
+
$[146] = t43;
|
|
937
|
+
} else t43 = $[146];
|
|
938
|
+
icon = t43;
|
|
672
939
|
if (prefix) prefix = /* @__PURE__ */ jsxs(Fragment$1, { children: [icon, prefix] });
|
|
673
940
|
else prefix = icon;
|
|
674
941
|
}
|
|
675
|
-
let
|
|
676
|
-
|
|
942
|
+
let t43;
|
|
943
|
+
if ($[147] !== isInvalid || $[148] !== isValid) {
|
|
944
|
+
t43 = getValidationMods({
|
|
677
945
|
isInvalid,
|
|
678
946
|
isValid
|
|
679
|
-
})
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
shouldShowPopover,
|
|
732
|
-
effectiveSelectedKey,
|
|
733
|
-
setActiveOptionKey
|
|
734
|
-
]);
|
|
735
|
-
useLayoutEffect$1(() => {
|
|
736
|
-
if (!shouldShowPopover) return;
|
|
737
|
-
focusInitAttemptsRef.current = 0;
|
|
738
|
-
const tick = () => {
|
|
947
|
+
});
|
|
948
|
+
$[147] = isInvalid;
|
|
949
|
+
$[148] = isValid;
|
|
950
|
+
$[149] = t43;
|
|
951
|
+
} else t43 = $[149];
|
|
952
|
+
const t44 = !!prefix;
|
|
953
|
+
let t45;
|
|
954
|
+
if ($[150] !== isDisabled || $[151] !== isFocused || $[152] !== isLoading || $[153] !== showClearButton || $[154] !== t43 || $[155] !== t44) {
|
|
955
|
+
t45 = {
|
|
956
|
+
...t43,
|
|
957
|
+
disabled: isDisabled,
|
|
958
|
+
hovered: false,
|
|
959
|
+
focused: isFocused,
|
|
960
|
+
loading: isLoading,
|
|
961
|
+
prefix: t44,
|
|
962
|
+
suffix: true,
|
|
963
|
+
clearable: showClearButton
|
|
964
|
+
};
|
|
965
|
+
$[150] = isDisabled;
|
|
966
|
+
$[151] = isFocused;
|
|
967
|
+
$[152] = isLoading;
|
|
968
|
+
$[153] = showClearButton;
|
|
969
|
+
$[154] = t43;
|
|
970
|
+
$[155] = t44;
|
|
971
|
+
$[156] = t45;
|
|
972
|
+
} else t45 = $[156];
|
|
973
|
+
const mods = t45;
|
|
974
|
+
const [comboBoxWidth, setComboBoxWidth] = useState();
|
|
975
|
+
let t46;
|
|
976
|
+
let t47;
|
|
977
|
+
if ($[157] !== hasResults || $[158] !== isPopoverOpen || $[159] !== setIsPopoverOpen) {
|
|
978
|
+
t46 = () => {
|
|
979
|
+
if (isPopoverOpen && !hasResults) setIsPopoverOpen(false);
|
|
980
|
+
};
|
|
981
|
+
t47 = [
|
|
982
|
+
isPopoverOpen,
|
|
983
|
+
hasResults,
|
|
984
|
+
setIsPopoverOpen
|
|
985
|
+
];
|
|
986
|
+
$[157] = hasResults;
|
|
987
|
+
$[158] = isPopoverOpen;
|
|
988
|
+
$[159] = setIsPopoverOpen;
|
|
989
|
+
$[160] = t46;
|
|
990
|
+
$[161] = t47;
|
|
991
|
+
} else {
|
|
992
|
+
t46 = $[160];
|
|
993
|
+
t47 = $[161];
|
|
994
|
+
}
|
|
995
|
+
useEffect(t46, t47);
|
|
996
|
+
let t48;
|
|
997
|
+
if ($[162] !== effectiveSelectedKey || $[163] !== setActiveOptionKey || $[164] !== shouldShowPopover || $[165] !== wrapperRef) {
|
|
998
|
+
t48 = () => {
|
|
739
999
|
if (!shouldShowPopover) return;
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
]
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
1000
|
+
setComboBoxWidth(wrapperRef.current?.offsetWidth);
|
|
1001
|
+
let attempts = 0;
|
|
1002
|
+
let frame = 0;
|
|
1003
|
+
const tick = () => {
|
|
1004
|
+
const key_1 = highlightOption(listStateRef.current, effectiveSelectedKey);
|
|
1005
|
+
if (key_1 != null) setActiveOptionKey(key_1);
|
|
1006
|
+
attempts = attempts + 1;
|
|
1007
|
+
if (key_1 == null && attempts < 8) frame = requestAnimationFrame(tick);
|
|
1008
|
+
};
|
|
1009
|
+
frame = requestAnimationFrame(() => {
|
|
1010
|
+
frame = requestAnimationFrame(tick);
|
|
1011
|
+
});
|
|
1012
|
+
return () => cancelAnimationFrame(frame);
|
|
1013
|
+
};
|
|
1014
|
+
$[162] = effectiveSelectedKey;
|
|
1015
|
+
$[163] = setActiveOptionKey;
|
|
1016
|
+
$[164] = shouldShowPopover;
|
|
1017
|
+
$[165] = wrapperRef;
|
|
1018
|
+
$[166] = t48;
|
|
1019
|
+
} else t48 = $[166];
|
|
1020
|
+
let t49;
|
|
1021
|
+
if ($[167] !== effectiveInputValue || $[168] !== effectiveSelectedKey || $[169] !== shouldShowPopover || $[170] !== wrapperRef) {
|
|
1022
|
+
t49 = [
|
|
1023
|
+
shouldShowPopover,
|
|
1024
|
+
effectiveSelectedKey,
|
|
1025
|
+
effectiveInputValue,
|
|
1026
|
+
wrapperRef
|
|
1027
|
+
];
|
|
1028
|
+
$[167] = effectiveInputValue;
|
|
1029
|
+
$[168] = effectiveSelectedKey;
|
|
1030
|
+
$[169] = shouldShowPopover;
|
|
1031
|
+
$[170] = wrapperRef;
|
|
1032
|
+
$[171] = t49;
|
|
1033
|
+
} else t49 = $[171];
|
|
1034
|
+
useLayoutEffect$1(t48, t49);
|
|
1035
|
+
let t50;
|
|
1036
|
+
if ($[172] !== activeOptionKey || $[173] !== comboBoxId || $[174] !== filteredOptions || $[175] !== shouldShowPopover) {
|
|
1037
|
+
t50 = shouldShowPopover && activeOptionKey != null && filteredOptions.some((option) => option.key === activeOptionKey) ? getListBoxOptionId(`ComboBoxListBox-${comboBoxId}`, activeOptionKey) : void 0;
|
|
1038
|
+
$[172] = activeOptionKey;
|
|
1039
|
+
$[173] = comboBoxId;
|
|
1040
|
+
$[174] = filteredOptions;
|
|
1041
|
+
$[175] = shouldShowPopover;
|
|
1042
|
+
$[176] = t50;
|
|
1043
|
+
} else t50 = $[176];
|
|
1044
|
+
const activeDescendant = t50;
|
|
1045
|
+
const t51 = isFocused ? 1 : "initial";
|
|
1046
|
+
let t52;
|
|
1047
|
+
if ($[177] !== t51) {
|
|
1048
|
+
t52 = { zIndex: t51 };
|
|
1049
|
+
$[177] = t51;
|
|
1050
|
+
$[178] = t52;
|
|
1051
|
+
} else t52 = $[178];
|
|
1052
|
+
let t53;
|
|
1053
|
+
if ($[179] !== prefix) {
|
|
1054
|
+
t53 = prefix ? /* @__PURE__ */ jsx("div", {
|
|
1055
|
+
"data-element": "Prefix",
|
|
1056
|
+
children: prefix
|
|
1057
|
+
}) : null;
|
|
1058
|
+
$[179] = prefix;
|
|
1059
|
+
$[180] = t53;
|
|
1060
|
+
} else t53 = $[180];
|
|
1061
|
+
const t54 = qa || "ComboBox";
|
|
1062
|
+
let t55;
|
|
1063
|
+
if ($[181] !== focusProps || $[182] !== handleInputBlur) {
|
|
1064
|
+
t55 = {
|
|
1065
|
+
...focusProps,
|
|
1066
|
+
onBlur: handleInputBlur
|
|
1067
|
+
};
|
|
1068
|
+
$[181] = focusProps;
|
|
1069
|
+
$[182] = handleInputBlur;
|
|
1070
|
+
$[183] = t55;
|
|
1071
|
+
} else t55 = $[183];
|
|
1072
|
+
let t56;
|
|
1073
|
+
if ($[184] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1074
|
+
t56 = () => {
|
|
1075
|
+
pressStartedOnInputRef.current = true;
|
|
1076
|
+
};
|
|
1077
|
+
$[184] = t56;
|
|
1078
|
+
} else t56 = $[184];
|
|
1079
|
+
const t57 = props["aria-label"];
|
|
1080
|
+
const t58 = props["aria-labelledby"];
|
|
1081
|
+
const t59 = props["aria-describedby"];
|
|
1082
|
+
let t60;
|
|
1083
|
+
if ($[185] !== t57 || $[186] !== t58 || $[187] !== t59) {
|
|
1084
|
+
t60 = {
|
|
1085
|
+
"aria-label": t57,
|
|
1086
|
+
"aria-labelledby": t58,
|
|
1087
|
+
"aria-describedby": t59
|
|
1088
|
+
};
|
|
1089
|
+
$[185] = t57;
|
|
1090
|
+
$[186] = t58;
|
|
1091
|
+
$[187] = t59;
|
|
1092
|
+
$[188] = t60;
|
|
1093
|
+
} else t60 = $[188];
|
|
1094
|
+
let t61;
|
|
1095
|
+
if ($[189] !== activeDescendant || $[190] !== autoComplete || $[191] !== autoFocus || $[192] !== comboBoxId || $[193] !== effectiveInputValue || $[194] !== handleInputChange || $[195] !== handleInputClick || $[196] !== handleInputFocus || $[197] !== id || $[198] !== inputRef || $[199] !== inputStyles || $[200] !== isDisabled || $[201] !== isInvalid || $[202] !== isReadOnly || $[203] !== isRequired || $[204] !== keyboardProps || $[205] !== mods || $[206] !== placeholder || $[207] !== shouldShowPopover || $[208] !== size || $[209] !== t54 || $[210] !== t55 || $[211] !== t60) {
|
|
1096
|
+
t61 = /* @__PURE__ */ jsx(ComboBoxInput, {
|
|
1097
|
+
qa: t54,
|
|
1098
|
+
inputRef,
|
|
1099
|
+
id,
|
|
1100
|
+
value: effectiveInputValue,
|
|
1101
|
+
placeholder,
|
|
1102
|
+
isDisabled,
|
|
1103
|
+
isReadOnly,
|
|
1104
|
+
isRequired,
|
|
1105
|
+
autoFocus,
|
|
1106
|
+
autoComplete,
|
|
1107
|
+
size,
|
|
1108
|
+
mods,
|
|
1109
|
+
inputStyles,
|
|
1110
|
+
keyboardProps,
|
|
1111
|
+
focusProps: t55,
|
|
1112
|
+
isListShown: shouldShowPopover,
|
|
1113
|
+
comboBoxId,
|
|
1114
|
+
activeDescendant,
|
|
1115
|
+
onChange: handleInputChange,
|
|
1116
|
+
onFocus: handleInputFocus,
|
|
1117
|
+
onPointerDown: t56,
|
|
1118
|
+
onClick: handleInputClick,
|
|
1119
|
+
ariaProps: t60,
|
|
1120
|
+
isInvalid
|
|
1121
|
+
});
|
|
1122
|
+
$[189] = activeDescendant;
|
|
1123
|
+
$[190] = autoComplete;
|
|
1124
|
+
$[191] = autoFocus;
|
|
1125
|
+
$[192] = comboBoxId;
|
|
1126
|
+
$[193] = effectiveInputValue;
|
|
1127
|
+
$[194] = handleInputChange;
|
|
1128
|
+
$[195] = handleInputClick;
|
|
1129
|
+
$[196] = handleInputFocus;
|
|
1130
|
+
$[197] = id;
|
|
1131
|
+
$[198] = inputRef;
|
|
1132
|
+
$[199] = inputStyles;
|
|
1133
|
+
$[200] = isDisabled;
|
|
1134
|
+
$[201] = isInvalid;
|
|
1135
|
+
$[202] = isReadOnly;
|
|
1136
|
+
$[203] = isRequired;
|
|
1137
|
+
$[204] = keyboardProps;
|
|
1138
|
+
$[205] = mods;
|
|
1139
|
+
$[206] = placeholder;
|
|
1140
|
+
$[207] = shouldShowPopover;
|
|
1141
|
+
$[208] = size;
|
|
1142
|
+
$[209] = t54;
|
|
1143
|
+
$[210] = t55;
|
|
1144
|
+
$[211] = t60;
|
|
1145
|
+
$[212] = t61;
|
|
1146
|
+
} else t61 = $[212];
|
|
1147
|
+
const t62 = suffixPosition === "before" ? suffix : null;
|
|
1148
|
+
let t63;
|
|
1149
|
+
if ($[213] !== isLoading || $[214] !== validationIcon) {
|
|
1150
|
+
t63 = isLoading ? /* @__PURE__ */ jsx(LoadingIcon, { "data-element": "InputIcon" }) : validationIcon;
|
|
1151
|
+
$[213] = isLoading;
|
|
1152
|
+
$[214] = validationIcon;
|
|
1153
|
+
$[215] = t63;
|
|
1154
|
+
} else t63 = $[215];
|
|
1155
|
+
const t64 = suffixPosition === "after" ? suffix : null;
|
|
1156
|
+
let t65;
|
|
1157
|
+
if ($[216] !== clearValue || $[217] !== hideTrigger || $[218] !== showClearButton || $[219] !== size || $[220] !== t) {
|
|
1158
|
+
t65 = showClearButton && /* @__PURE__ */ jsx(_CollectionItem.Action, {
|
|
1159
|
+
excludeFromTabOrder: true,
|
|
1160
|
+
icon: /* @__PURE__ */ jsx(CloseIcon, {}),
|
|
1161
|
+
size,
|
|
1162
|
+
qa: "ComboBoxClearButton",
|
|
1163
|
+
"data-no-trigger": hideTrigger ? "" : void 0,
|
|
1164
|
+
"data-popover-dismiss": "",
|
|
1165
|
+
"aria-label": t("comboBox.clearValue", "Clear value"),
|
|
1166
|
+
onPress: clearValue
|
|
1167
|
+
});
|
|
1168
|
+
$[216] = clearValue;
|
|
1169
|
+
$[217] = hideTrigger;
|
|
1170
|
+
$[218] = showClearButton;
|
|
1171
|
+
$[219] = size;
|
|
1172
|
+
$[220] = t;
|
|
1173
|
+
$[221] = t65;
|
|
1174
|
+
} else t65 = $[221];
|
|
1175
|
+
let t66;
|
|
1176
|
+
if ($[222] !== hideTrigger || $[223] !== isDisabled || $[224] !== isLoading || $[225] !== shouldShowPopover || $[226] !== size || $[227] !== t || $[228] !== toggleList || $[229] !== triggerRef || $[230] !== triggerStyles) {
|
|
1177
|
+
t66 = !hideTrigger ? /* @__PURE__ */ jsx(_CollectionItem.Action, {
|
|
1178
|
+
ref: triggerRef,
|
|
1179
|
+
excludeFromTabOrder: true,
|
|
1180
|
+
"data-popover-trigger": true,
|
|
1181
|
+
icon: /* @__PURE__ */ jsx(DirectionIcon, { to: shouldShowPopover ? "up" : "down" }),
|
|
1182
|
+
qa: "ComboBoxTrigger",
|
|
1183
|
+
mods: {
|
|
1184
|
+
pressed: shouldShowPopover,
|
|
1185
|
+
disabled: isDisabled,
|
|
1186
|
+
loading: isLoading
|
|
1187
|
+
},
|
|
1188
|
+
"data-size": size,
|
|
1189
|
+
isDisabled,
|
|
1190
|
+
styles: triggerStyles,
|
|
1191
|
+
"aria-expanded": shouldShowPopover,
|
|
1192
|
+
"aria-haspopup": "listbox",
|
|
1193
|
+
"aria-label": t("comboBox.showOptions", "Show options"),
|
|
1194
|
+
onPress: toggleList
|
|
1195
|
+
}) : null;
|
|
1196
|
+
$[222] = hideTrigger;
|
|
1197
|
+
$[223] = isDisabled;
|
|
1198
|
+
$[224] = isLoading;
|
|
1199
|
+
$[225] = shouldShowPopover;
|
|
1200
|
+
$[226] = size;
|
|
1201
|
+
$[227] = t;
|
|
1202
|
+
$[228] = toggleList;
|
|
1203
|
+
$[229] = triggerRef;
|
|
1204
|
+
$[230] = triggerStyles;
|
|
1205
|
+
$[231] = t66;
|
|
1206
|
+
} else t66 = $[231];
|
|
1207
|
+
let t67;
|
|
1208
|
+
if ($[232] !== t62 || $[233] !== t63 || $[234] !== t64 || $[235] !== t65 || $[236] !== t66) {
|
|
1209
|
+
t67 = /* @__PURE__ */ jsxs("div", {
|
|
1210
|
+
"data-element": "Suffix",
|
|
1211
|
+
children: [
|
|
1212
|
+
t62,
|
|
1213
|
+
t63,
|
|
1214
|
+
t64,
|
|
1215
|
+
t65,
|
|
1216
|
+
t66
|
|
1217
|
+
]
|
|
1218
|
+
});
|
|
1219
|
+
$[232] = t62;
|
|
1220
|
+
$[233] = t63;
|
|
1221
|
+
$[234] = t64;
|
|
1222
|
+
$[235] = t65;
|
|
1223
|
+
$[236] = t66;
|
|
1224
|
+
$[237] = t67;
|
|
1225
|
+
} else t67 = $[237];
|
|
1226
|
+
const t68 = wrapperRef;
|
|
1227
|
+
const t69 = props["aria-label"];
|
|
1228
|
+
let t70;
|
|
1229
|
+
if ($[238] !== setIsPopoverOpen) {
|
|
1230
|
+
t70 = () => setIsPopoverOpen(false);
|
|
1231
|
+
$[238] = setIsPopoverOpen;
|
|
1232
|
+
$[239] = t70;
|
|
1233
|
+
} else t70 = $[239];
|
|
1234
|
+
let t71;
|
|
1235
|
+
if ($[240] !== children || $[241] !== comboBoxWidth || $[242] !== compositeFocusProps || $[243] !== containerPadding || $[244] !== direction || $[245] !== effectiveSelectedKey || $[246] !== filterFn || $[247] !== handleSelectionChange || $[248] !== headingStyles || $[249] !== isDisabled || $[250] !== label || $[251] !== listBoxRef || $[252] !== listBoxStyles || $[253] !== listGap || $[254] !== optionStyles || $[255] !== overlayOffset || $[256] !== overlayStyles || $[257] !== popoverRef || $[258] !== props.disabledKeys || $[259] !== sectionStyles || $[260] !== shouldFlip || $[261] !== shouldShowPopover || $[262] !== size || $[263] !== sortedItems || $[264] !== t68 || $[265] !== t69 || $[266] !== t70) {
|
|
1236
|
+
t71 = /* @__PURE__ */ jsx(ListBoxPopover, {
|
|
1237
|
+
isOpen: shouldShowPopover,
|
|
1238
|
+
triggerRef: t68,
|
|
1239
|
+
popoverRef,
|
|
1240
|
+
listBoxRef,
|
|
1241
|
+
direction,
|
|
1242
|
+
shouldFlip,
|
|
1243
|
+
overlayOffset,
|
|
1244
|
+
containerPadding,
|
|
1245
|
+
comboBoxWidth,
|
|
1246
|
+
listBoxId: `ComboBoxListBox-${comboBoxId}`,
|
|
1247
|
+
overlayStyles,
|
|
1248
|
+
listBoxStyles,
|
|
1249
|
+
optionStyles,
|
|
1250
|
+
sectionStyles,
|
|
1251
|
+
headingStyles,
|
|
1252
|
+
listGap,
|
|
1253
|
+
selectedKey: effectiveSelectedKey,
|
|
1254
|
+
shouldCloseOnTriggerInteraction: false,
|
|
1255
|
+
isDisabled,
|
|
1256
|
+
disabledKeys: props.disabledKeys,
|
|
1257
|
+
items: sortedItems,
|
|
1258
|
+
listStateRef,
|
|
1259
|
+
label,
|
|
1260
|
+
ariaLabel: t69,
|
|
1261
|
+
compositeFocusProps,
|
|
1262
|
+
filter: filterFn,
|
|
1263
|
+
size,
|
|
1264
|
+
onSelectionChange: handleSelectionChange,
|
|
1265
|
+
onClose: t70,
|
|
1266
|
+
children
|
|
1267
|
+
});
|
|
1268
|
+
$[240] = children;
|
|
1269
|
+
$[241] = comboBoxWidth;
|
|
1270
|
+
$[242] = compositeFocusProps;
|
|
1271
|
+
$[243] = containerPadding;
|
|
1272
|
+
$[244] = direction;
|
|
1273
|
+
$[245] = effectiveSelectedKey;
|
|
1274
|
+
$[246] = filterFn;
|
|
1275
|
+
$[247] = handleSelectionChange;
|
|
1276
|
+
$[248] = headingStyles;
|
|
1277
|
+
$[249] = isDisabled;
|
|
1278
|
+
$[250] = label;
|
|
1279
|
+
$[251] = listBoxRef;
|
|
1280
|
+
$[252] = listBoxStyles;
|
|
1281
|
+
$[253] = listGap;
|
|
1282
|
+
$[254] = optionStyles;
|
|
1283
|
+
$[255] = overlayOffset;
|
|
1284
|
+
$[256] = overlayStyles;
|
|
1285
|
+
$[257] = popoverRef;
|
|
1286
|
+
$[258] = props.disabledKeys;
|
|
1287
|
+
$[259] = sectionStyles;
|
|
1288
|
+
$[260] = shouldFlip;
|
|
1289
|
+
$[261] = shouldShowPopover;
|
|
1290
|
+
$[262] = size;
|
|
1291
|
+
$[263] = sortedItems;
|
|
1292
|
+
$[264] = t68;
|
|
1293
|
+
$[265] = t69;
|
|
1294
|
+
$[266] = t70;
|
|
1295
|
+
$[267] = t71;
|
|
1296
|
+
} else t71 = $[267];
|
|
1297
|
+
let t72;
|
|
1298
|
+
if ($[268] !== compositeFocusProps || $[269] !== mods || $[270] !== size || $[271] !== styles || $[272] !== t52 || $[273] !== t53 || $[274] !== t61 || $[275] !== t67 || $[276] !== t71 || $[277] !== wrapperRef) {
|
|
1299
|
+
t72 = /* @__PURE__ */ jsxs(ComboBoxWrapperElement, {
|
|
1300
|
+
ref: wrapperRef,
|
|
1301
|
+
mods,
|
|
1302
|
+
styles,
|
|
1303
|
+
style: t52,
|
|
1304
|
+
"data-size": size,
|
|
1305
|
+
...compositeFocusProps,
|
|
1306
|
+
children: [
|
|
1307
|
+
t53,
|
|
1308
|
+
t61,
|
|
1309
|
+
t67,
|
|
1310
|
+
t71
|
|
1311
|
+
]
|
|
1312
|
+
});
|
|
1313
|
+
$[268] = compositeFocusProps;
|
|
1314
|
+
$[269] = mods;
|
|
1315
|
+
$[270] = size;
|
|
1316
|
+
$[271] = styles;
|
|
1317
|
+
$[272] = t52;
|
|
1318
|
+
$[273] = t53;
|
|
1319
|
+
$[274] = t61;
|
|
1320
|
+
$[275] = t67;
|
|
1321
|
+
$[276] = t71;
|
|
1322
|
+
$[277] = wrapperRef;
|
|
1323
|
+
$[278] = t72;
|
|
1324
|
+
} else t72 = $[278];
|
|
1325
|
+
const comboBoxField = t72;
|
|
1326
|
+
let t73;
|
|
1327
|
+
if ($[279] !== comboBoxField || $[280] !== props || $[281] !== ref) {
|
|
1328
|
+
const { children: _, ...propsWithoutChildren } = props;
|
|
1329
|
+
t73 = wrapWithField(comboBoxField, ref, propsWithoutChildren);
|
|
1330
|
+
$[279] = comboBoxField;
|
|
1331
|
+
$[280] = props;
|
|
1332
|
+
$[281] = ref;
|
|
1333
|
+
$[282] = t73;
|
|
1334
|
+
} else t73 = $[282];
|
|
1335
|
+
return t73;
|
|
869
1336
|
});
|
|
870
1337
|
ComboBox.Item = _CollectionItem;
|
|
871
1338
|
ComboBox.Section = Section;
|
|
@@ -874,6 +1341,15 @@ Object.defineProperty(ComboBox, "cubeInputType", {
|
|
|
874
1341
|
enumerable: false,
|
|
875
1342
|
configurable: false
|
|
876
1343
|
});
|
|
1344
|
+
function _temp2(t0) {
|
|
1345
|
+
const { value, onChange } = t0;
|
|
1346
|
+
return {
|
|
1347
|
+
selectedKey: value ?? null,
|
|
1348
|
+
onSelectionChange(val) {
|
|
1349
|
+
onChange(val);
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
877
1353
|
|
|
878
1354
|
//#endregion
|
|
879
1355
|
export { ComboBox };
|