@cube-dev/ui-kit 0.0.0-canary-759f43d → 0.0.0-canary-77836fa
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 +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.d.ts +9 -4
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js.map +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 +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 -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 +28 -28
- 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 +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +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 +2 -1
- 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 +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +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.d.ts +4 -2
- package/dist/components/content/Layout/LayoutPanel.js +73 -2
- package/dist/components/content/Layout/LayoutPanel.js.map +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 +28 -28
- 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 +2 -1
- package/dist/components/content/Tree/TreeNode.js.map +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 +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 +2 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js.map +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 +3 -1
- package/dist/components/data/TableBase/TableView.js.map +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 +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- 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 +3 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +2 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +13 -13
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- 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 +2 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +15 -6
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +7 -5
- 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 +148 -140
- 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.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +15 -6
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +28 -28
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- 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 -6
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -6
- package/dist/components/fields/SearchInput/SearchInput.js.map +1 -1
- package/dist/components/fields/Select/Select.js +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 +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 +2 -2
- package/dist/components/fields/TagInput/TagInput.js.map +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.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +19 -16
- package/dist/components/fields/TextInputMapper/TextInputMapper.js.map +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +3 -1
- package/dist/components/fields/color/ColorPanel.js.map +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/form/FieldWrapper/FieldWrapper.d.ts +10 -8
- package/dist/components/form/FieldWrapper/FieldWrapper.js +214 -159
- package/dist/components/form/FieldWrapper/FieldWrapper.js.map +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +3 -3
- package/dist/components/form/FieldWrapper/field-description.js.map +1 -1
- package/dist/components/form/FieldWrapper/types.d.ts +4 -3
- 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 +21 -33
- package/dist/components/form/Form/use-field/use-field-props.js.map +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 +4 -34
- package/dist/components/form/field-chrome.js.map +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.d.ts +6 -17
- package/dist/components/form/wrapper.js +6 -14
- package/dist/components/form/wrapper.js.map +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 +3 -1
- package/dist/components/navigation/Pagination/Pagination.js.map +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 +2 -1
- package/dist/components/navigation/Tabs/TabPicker.js.map +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.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +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.js +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/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +7 -2
- package/dist/components/overlays/Modal/Overlay.js.map +1 -1
- package/dist/components/overlays/Modal/Popover.js +31 -29
- package/dist/components/overlays/Modal/Popover.js.map +1 -1
- package/dist/components/overlays/Modal/Tray.js +2 -1
- package/dist/components/overlays/Modal/Tray.js.map +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 +18 -32
- package/dist/components/overlays/Notifications/OverlayContainer.js.map +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.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +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 +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 +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- 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.js +1 -1
- 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/shared/form.d.ts +11 -12
- 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 +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/ComplexLayout.md +1 -1
- package/docs/CreateComponent.md +2 -0
- package/docs/FieldProperties.md +31 -6
- package/docs/Usage.md +2 -0
- package/docs/components/actions/ButtonSplit.md +27 -1
- package/docs/components/content/Layout.md +8 -4
- package/docs/components/fields/ComboBox.md +6 -2
- package/docs/components/fields/TagInput.md +8 -1
- 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-77836fa | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { mergeRefs as mergeRefs$1 } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -16,6 +16,14 @@ import { getEventTarget, isFocusWithin } from "@react-aria/utils";
|
|
|
16
16
|
|
|
17
17
|
//#region src/components/fields/ListBoxPopover/ListBoxPopover.tsx
|
|
18
18
|
const CONTROL_SELECTOR = "button, a[href], input, select, textarea, [tabindex], [contenteditable]:not([contenteditable=\"false\"])";
|
|
19
|
+
const LAYER_SELECTOR = "[role=\"dialog\"], [role=\"alertdialog\"], [data-overlay-layer]";
|
|
20
|
+
const DISABLED_SELECTOR = ":disabled, [aria-disabled=\"true\"]";
|
|
21
|
+
function isOutsideControl(el, trigger) {
|
|
22
|
+
const control = el.closest(CONTROL_SELECTOR);
|
|
23
|
+
if (control == null || trigger == null || control.contains(trigger) || trigger.contains(control) || control.matches(`${LAYER_SELECTOR}, ${DISABLED_SELECTOR}`)) return false;
|
|
24
|
+
const layer = trigger.closest(LAYER_SELECTOR);
|
|
25
|
+
return layer == null || layer.contains(control);
|
|
26
|
+
}
|
|
19
27
|
const ListBoxPopoverWrapper = tasty({
|
|
20
28
|
qa: "ComboBoxOverlayWrapper",
|
|
21
29
|
styles: {
|
|
@@ -66,25 +74,24 @@ const ListBoxPopoverElement = tasty({
|
|
|
66
74
|
}
|
|
67
75
|
});
|
|
68
76
|
const ListBoxPopover = function ListBoxPopover(props) {
|
|
69
|
-
const $ = c(
|
|
77
|
+
const $ = c(79);
|
|
70
78
|
const { t } = useI18n();
|
|
71
|
-
const { isOpen, triggerRef, popoverRef, listBoxRef, direction, shouldFlip, overlayOffset, containerPadding, comboBoxWidth, listBoxId, overlayStyles, listBoxStyles, optionStyles, optionHighlight, sectionStyles, headingStyles, listGap, selectedKey, selectionMode: t0, selectedKeys, isCheckable, shouldCloseOnTriggerInteraction: t1,
|
|
79
|
+
const { isOpen, triggerRef, popoverRef, listBoxRef, direction, shouldFlip, overlayOffset, containerPadding, comboBoxWidth, listBoxId, overlayStyles, listBoxStyles, optionStyles, optionHighlight, sectionStyles, headingStyles, listGap, selectedKey, selectionMode: t0, selectedKeys, isCheckable, shouldCloseOnTriggerInteraction: t1, isDisabled, disabledKeys, items, children, listStateRef, onSelectionChange, onClose, label, ariaLabel, ariaLabelledby, compositeFocusProps, filter, size: t2, emptyLabel, positionTargetRef, positionApiRef } = props;
|
|
72
80
|
const selectionMode = t0 === void 0 ? "single" : t0;
|
|
73
81
|
const shouldCloseOnTriggerInteraction = t1 === void 0 ? true : t1;
|
|
74
|
-
const shouldPassControlPresses = t2 === void 0 ? false : t2;
|
|
75
82
|
const mergedPopoverRef = popoverRef;
|
|
76
83
|
const layerRef = useModalLayerRef();
|
|
77
84
|
const overlayScrollRef = useRef(null);
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
-
if ($[0] !== containerPadding || $[1] !== isOpen || $[2] !== overlayOffset || $[3] !== shouldFlip || $[4] !==
|
|
83
|
-
|
|
84
|
-
targetRef:
|
|
85
|
-
overlayRef:
|
|
85
|
+
const t3 = positionTargetRef ?? triggerRef;
|
|
86
|
+
const t4 = mergedPopoverRef;
|
|
87
|
+
const t5 = `${direction} start`;
|
|
88
|
+
let t6;
|
|
89
|
+
if ($[0] !== containerPadding || $[1] !== isOpen || $[2] !== overlayOffset || $[3] !== shouldFlip || $[4] !== t3 || $[5] !== t4 || $[6] !== t5) {
|
|
90
|
+
t6 = {
|
|
91
|
+
targetRef: t3,
|
|
92
|
+
overlayRef: t4,
|
|
86
93
|
scrollRef: overlayScrollRef,
|
|
87
|
-
placement:
|
|
94
|
+
placement: t5,
|
|
88
95
|
shouldFlip,
|
|
89
96
|
isOpen,
|
|
90
97
|
offset: overlayOffset,
|
|
@@ -94,25 +101,25 @@ const ListBoxPopover = function ListBoxPopover(props) {
|
|
|
94
101
|
$[1] = isOpen;
|
|
95
102
|
$[2] = overlayOffset;
|
|
96
103
|
$[3] = shouldFlip;
|
|
97
|
-
$[4] =
|
|
98
|
-
$[5] =
|
|
99
|
-
$[6] =
|
|
100
|
-
$[7] =
|
|
101
|
-
} else
|
|
102
|
-
const { overlayProps: overlayPositionProps, placement, updatePosition } = useOverlayPosition(
|
|
103
|
-
let
|
|
104
|
+
$[4] = t3;
|
|
105
|
+
$[5] = t4;
|
|
106
|
+
$[6] = t5;
|
|
107
|
+
$[7] = t6;
|
|
108
|
+
} else t6 = $[7];
|
|
109
|
+
const { overlayProps: overlayPositionProps, placement, updatePosition } = useOverlayPosition(t6);
|
|
110
|
+
let t7;
|
|
104
111
|
if ($[8] !== overlayPositionProps.style) {
|
|
105
|
-
|
|
112
|
+
t7 = overlayPositionProps.style ?? {};
|
|
106
113
|
$[8] = overlayPositionProps.style;
|
|
107
|
-
$[9] =
|
|
108
|
-
} else
|
|
109
|
-
const
|
|
114
|
+
$[9] = t7;
|
|
115
|
+
} else t7 = $[9];
|
|
116
|
+
const t8 = t7;
|
|
110
117
|
let maxHeight;
|
|
111
118
|
let maxWidth;
|
|
112
119
|
let positionStyle;
|
|
113
|
-
if ($[10] !==
|
|
114
|
-
({maxHeight, maxWidth, ...positionStyle} =
|
|
115
|
-
$[10] =
|
|
120
|
+
if ($[10] !== t8) {
|
|
121
|
+
({maxHeight, maxWidth, ...positionStyle} = t8);
|
|
122
|
+
$[10] = t8;
|
|
116
123
|
$[11] = maxHeight;
|
|
117
124
|
$[12] = maxWidth;
|
|
118
125
|
$[13] = positionStyle;
|
|
@@ -122,113 +129,113 @@ const ListBoxPopover = function ListBoxPopover(props) {
|
|
|
122
129
|
positionStyle = $[13];
|
|
123
130
|
}
|
|
124
131
|
let t10;
|
|
125
|
-
let
|
|
132
|
+
let t9;
|
|
126
133
|
if ($[14] !== positionApiRef || $[15] !== updatePosition) {
|
|
127
|
-
|
|
134
|
+
t9 = () => {
|
|
128
135
|
if (positionApiRef) positionApiRef.current = { updatePosition };
|
|
129
136
|
return () => {
|
|
130
137
|
if (positionApiRef) positionApiRef.current = null;
|
|
131
138
|
};
|
|
132
139
|
};
|
|
133
|
-
|
|
140
|
+
t10 = [positionApiRef, updatePosition];
|
|
134
141
|
$[14] = positionApiRef;
|
|
135
142
|
$[15] = updatePosition;
|
|
136
143
|
$[16] = t10;
|
|
137
|
-
$[17] =
|
|
144
|
+
$[17] = t9;
|
|
138
145
|
} else {
|
|
139
146
|
t10 = $[16];
|
|
140
|
-
|
|
147
|
+
t9 = $[17];
|
|
141
148
|
}
|
|
142
|
-
useEffect(
|
|
143
|
-
let
|
|
144
|
-
if ($[18] !== shouldCloseOnTriggerInteraction || $[19] !==
|
|
145
|
-
|
|
149
|
+
useEffect(t9, t10);
|
|
150
|
+
let t11;
|
|
151
|
+
if ($[18] !== shouldCloseOnTriggerInteraction || $[19] !== triggerRef) {
|
|
152
|
+
t11 = (el) => {
|
|
146
153
|
const menuTriggerEl = el.closest("[data-popover-trigger]");
|
|
147
154
|
if (menuTriggerEl) return menuTriggerEl === triggerRef.current ? "consume" : "ignore";
|
|
148
155
|
if (!shouldCloseOnTriggerInteraction && triggerRef.current?.contains(el) || el.closest("[data-popover-keep]")) return "ignore";
|
|
149
|
-
|
|
156
|
+
const dismissEl = el.closest("[data-popover-dismiss]");
|
|
157
|
+
if (isOutsideControl(el, triggerRef.current) || dismissEl != null && !dismissEl.matches(DISABLED_SELECTOR)) return "pass";
|
|
150
158
|
return "consume";
|
|
151
159
|
};
|
|
152
160
|
$[18] = shouldCloseOnTriggerInteraction;
|
|
153
|
-
$[19] =
|
|
154
|
-
$[20] =
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
t13 = (el_0) => {
|
|
161
|
+
$[19] = triggerRef;
|
|
162
|
+
$[20] = t11;
|
|
163
|
+
} else t11 = $[20];
|
|
164
|
+
const getOutsidePressBehavior = t11;
|
|
165
|
+
let t12;
|
|
166
|
+
if ($[21] !== getOutsidePressBehavior || $[22] !== onClose) {
|
|
167
|
+
t12 = (el_0) => {
|
|
161
168
|
const behavior = getOutsidePressBehavior(el_0);
|
|
162
169
|
if (behavior === "pass") setTimeout(onClose, 0);
|
|
163
170
|
return behavior === "consume";
|
|
164
171
|
};
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
} else
|
|
169
|
-
let
|
|
170
|
-
if ($[
|
|
171
|
-
|
|
172
|
+
$[21] = getOutsidePressBehavior;
|
|
173
|
+
$[22] = onClose;
|
|
174
|
+
$[23] = t12;
|
|
175
|
+
} else t12 = $[23];
|
|
176
|
+
let t13;
|
|
177
|
+
if ($[24] !== isOpen || $[25] !== onClose || $[26] !== t12) {
|
|
178
|
+
t13 = {
|
|
172
179
|
onClose,
|
|
173
180
|
shouldCloseOnBlur: true,
|
|
174
181
|
isOpen,
|
|
175
182
|
isDismissable: true,
|
|
176
|
-
shouldCloseOnInteractOutside:
|
|
183
|
+
shouldCloseOnInteractOutside: t12
|
|
177
184
|
};
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
185
|
+
$[24] = isOpen;
|
|
186
|
+
$[25] = onClose;
|
|
187
|
+
$[26] = t12;
|
|
180
188
|
$[27] = t13;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
t15 = (event) => {
|
|
189
|
+
} else t13 = $[27];
|
|
190
|
+
const { overlayProps: overlayBehaviorProps } = useOverlay(t13, mergedPopoverRef);
|
|
191
|
+
let t14;
|
|
192
|
+
if ($[28] !== getOutsidePressBehavior || $[29] !== mergedPopoverRef || $[30] !== triggerRef) {
|
|
193
|
+
t14 = (event) => {
|
|
187
194
|
if ((isFocusWithin(triggerRef.current) || isFocusWithin(mergedPopoverRef.current)) && getOutsidePressBehavior(getEventTarget(event)) === "consume") event.preventDefault();
|
|
188
195
|
};
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
} else
|
|
194
|
-
const preserveOutsidePressFocus = useEvent(
|
|
195
|
-
const
|
|
196
|
-
let
|
|
197
|
-
if ($[
|
|
198
|
-
|
|
196
|
+
$[28] = getOutsidePressBehavior;
|
|
197
|
+
$[29] = mergedPopoverRef;
|
|
198
|
+
$[30] = triggerRef;
|
|
199
|
+
$[31] = t14;
|
|
200
|
+
} else t14 = $[31];
|
|
201
|
+
const preserveOutsidePressFocus = useEvent(t14);
|
|
202
|
+
const t15 = !isOpen;
|
|
203
|
+
let t16;
|
|
204
|
+
if ($[32] !== mergedPopoverRef || $[33] !== preserveOutsidePressFocus || $[34] !== t15) {
|
|
205
|
+
t16 = {
|
|
199
206
|
ref: mergedPopoverRef,
|
|
200
|
-
isDisabled:
|
|
207
|
+
isDisabled: t15,
|
|
201
208
|
onInteractOutsideStart: preserveOutsidePressFocus,
|
|
202
209
|
onInteractOutside: preserveOutsidePressFocus
|
|
203
210
|
};
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
211
|
+
$[32] = mergedPopoverRef;
|
|
212
|
+
$[33] = preserveOutsidePressFocus;
|
|
213
|
+
$[34] = t15;
|
|
206
214
|
$[35] = t16;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
$[37] =
|
|
214
|
-
$[38] =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
const placementDirection = t18;
|
|
215
|
+
} else t16 = $[35];
|
|
216
|
+
useInteractOutside(t16);
|
|
217
|
+
let t17;
|
|
218
|
+
if ($[36] !== direction || $[37] !== placement) {
|
|
219
|
+
t17 = placement?.split(" ")[0] || direction;
|
|
220
|
+
$[36] = direction;
|
|
221
|
+
$[37] = placement;
|
|
222
|
+
$[38] = t17;
|
|
223
|
+
} else t17 = $[38];
|
|
224
|
+
const placementDirection = t17;
|
|
218
225
|
const transitionRefHolder = useRef(null);
|
|
219
|
-
let
|
|
220
|
-
if ($[
|
|
221
|
-
|
|
226
|
+
let t18;
|
|
227
|
+
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
228
|
+
t18 = (node) => {
|
|
222
229
|
overlayScrollRef.current = node;
|
|
223
230
|
transitionRefHolder.current?.(node);
|
|
224
231
|
};
|
|
225
|
-
$[
|
|
226
|
-
} else
|
|
227
|
-
const setScrollRef =
|
|
228
|
-
let
|
|
229
|
-
if ($[
|
|
230
|
-
|
|
231
|
-
const { phase, isShown, isExiting, ref: transitionRef } =
|
|
232
|
+
$[39] = t18;
|
|
233
|
+
} else t18 = $[39];
|
|
234
|
+
const setScrollRef = t18;
|
|
235
|
+
let t19;
|
|
236
|
+
if ($[40] !== ariaLabel || $[41] !== ariaLabelledby || $[42] !== children || $[43] !== comboBoxWidth || $[44] !== compositeFocusProps || $[45] !== disabledKeys || $[46] !== emptyLabel || $[47] !== filter || $[48] !== headingStyles || $[49] !== isCheckable || $[50] !== isDisabled || $[51] !== items || $[52] !== label || $[53] !== layerRef || $[54] !== listBoxId || $[55] !== listBoxRef || $[56] !== listBoxStyles || $[57] !== listGap || $[58] !== listStateRef || $[59] !== maxHeight || $[60] !== maxWidth || $[61] !== mergedPopoverRef || $[62] !== onSelectionChange || $[63] !== optionHighlight || $[64] !== optionStyles || $[65] !== overlayBehaviorProps || $[66] !== overlayPositionProps || $[67] !== overlayStyles || $[68] !== placementDirection || $[69] !== positionStyle || $[70] !== sectionStyles || $[71] !== selectedKey || $[72] !== selectedKeys || $[73] !== selectionMode || $[74] !== t) {
|
|
237
|
+
t19 = (t20) => {
|
|
238
|
+
const { phase, isShown, isExiting, ref: transitionRef } = t20;
|
|
232
239
|
transitionRefHolder.current = transitionRef;
|
|
233
240
|
return /* @__PURE__ */ jsx(ListBoxPopoverWrapper, {
|
|
234
241
|
...mergeProps$1({
|
|
@@ -253,6 +260,7 @@ const ListBoxPopover = function ListBoxPopover(props) {
|
|
|
253
260
|
maxWidth
|
|
254
261
|
},
|
|
255
262
|
children: /* @__PURE__ */ jsx(ListBox, {
|
|
263
|
+
isBare: true,
|
|
256
264
|
ref: listBoxRef,
|
|
257
265
|
disableSelectionToggle: true,
|
|
258
266
|
id: listBoxId,
|
|
@@ -282,54 +290,54 @@ const ListBoxPopover = function ListBoxPopover(props) {
|
|
|
282
290
|
})
|
|
283
291
|
});
|
|
284
292
|
};
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
} else
|
|
322
|
-
let
|
|
323
|
-
if ($[
|
|
324
|
-
|
|
293
|
+
$[40] = ariaLabel;
|
|
294
|
+
$[41] = ariaLabelledby;
|
|
295
|
+
$[42] = children;
|
|
296
|
+
$[43] = comboBoxWidth;
|
|
297
|
+
$[44] = compositeFocusProps;
|
|
298
|
+
$[45] = disabledKeys;
|
|
299
|
+
$[46] = emptyLabel;
|
|
300
|
+
$[47] = filter;
|
|
301
|
+
$[48] = headingStyles;
|
|
302
|
+
$[49] = isCheckable;
|
|
303
|
+
$[50] = isDisabled;
|
|
304
|
+
$[51] = items;
|
|
305
|
+
$[52] = label;
|
|
306
|
+
$[53] = layerRef;
|
|
307
|
+
$[54] = listBoxId;
|
|
308
|
+
$[55] = listBoxRef;
|
|
309
|
+
$[56] = listBoxStyles;
|
|
310
|
+
$[57] = listGap;
|
|
311
|
+
$[58] = listStateRef;
|
|
312
|
+
$[59] = maxHeight;
|
|
313
|
+
$[60] = maxWidth;
|
|
314
|
+
$[61] = mergedPopoverRef;
|
|
315
|
+
$[62] = onSelectionChange;
|
|
316
|
+
$[63] = optionHighlight;
|
|
317
|
+
$[64] = optionStyles;
|
|
318
|
+
$[65] = overlayBehaviorProps;
|
|
319
|
+
$[66] = overlayPositionProps;
|
|
320
|
+
$[67] = overlayStyles;
|
|
321
|
+
$[68] = placementDirection;
|
|
322
|
+
$[69] = positionStyle;
|
|
323
|
+
$[70] = sectionStyles;
|
|
324
|
+
$[71] = selectedKey;
|
|
325
|
+
$[72] = selectedKeys;
|
|
326
|
+
$[73] = selectionMode;
|
|
327
|
+
$[74] = t;
|
|
328
|
+
$[75] = t19;
|
|
329
|
+
} else t19 = $[75];
|
|
330
|
+
let t20;
|
|
331
|
+
if ($[76] !== isOpen || $[77] !== t19) {
|
|
332
|
+
t20 = /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(DisplayTransition, {
|
|
325
333
|
isShown: isOpen,
|
|
326
|
-
children:
|
|
334
|
+
children: t19
|
|
327
335
|
}) });
|
|
328
|
-
$[
|
|
336
|
+
$[76] = isOpen;
|
|
337
|
+
$[77] = t19;
|
|
329
338
|
$[78] = t20;
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
return t21;
|
|
339
|
+
} else t20 = $[78];
|
|
340
|
+
return t20;
|
|
333
341
|
};
|
|
334
342
|
|
|
335
343
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBoxPopover.js","names":["getEventTarget","isFocusWithin","Key","Styles","tasty","React","CSSProperties","ReactNode","RefObject","useCallback","useEffect","useRef","useInteractOutside","useOverlay","useOverlayPosition","useEvent","useI18n","mergeProps","mergeRefs","DisplayTransition","useModalLayerRef","Portal","ListBox","ListBoxPopoverProps","isOpen","triggerRef","HTMLElement","popoverRef","HTMLDivElement","listBoxRef","direction","shouldFlip","overlayOffset","containerPadding","comboBoxWidth","listBoxId","overlayStyles","listBoxStyles","optionStyles","optionHighlight","sectionStyles","headingStyles","listGap","selectedKey","selectionMode","selectedKeys","isCheckable","shouldCloseOnTriggerInteraction","shouldPassControlPresses","isDisabled","disabledKeys","Iterable","items","children","listStateRef","onSelectionChange","selection","onClose","label","ariaLabel","ariaLabelledby","compositeFocusProps","onFocus","e","FocusEvent","onBlur","filter","nodes","size","emptyLabel","positionTargetRef","Element","positionApiRef","updatePosition","CONTROL_SELECTOR","ListBoxPopoverWrapper","qa","styles","position","zIndex","ListBoxPopoverElement","display","gridRows","gridColumns","width","height","overflow","fill","radius","shadow","padding","border","hide","hidden","boxSizing","transition","translate","transformOrigin","scale","opacity","ListBoxPopover","props","$","_c","t","t0","t1","t2","t3","undefined","mergedPopoverRef","layerRef","overlayScrollRef","t4","t5","t6","t7","targetRef","overlayRef","scrollRef","placement","offset","overlayProps","overlayPositionProps","t8","style","t9","maxHeight","maxWidth","positionStyle","t10","t11","current","t12","el","menuTriggerEl","closest","contains","getOutsidePressBehavior","t13","el_0","behavior","setTimeout","t14","shouldCloseOnBlur","isDismissable","shouldCloseOnInteractOutside","overlayBehaviorProps","t15","event","preventDefault","preserveOutsidePressFocus","t16","t17","ref","onInteractOutsideStart","onInteractOutside","t18","split","placementDirection","transitionRefHolder","t19","Symbol","for","node","setScrollRef","t20","t21","phase","isShown","isExiting","transitionRef","open","overlayContent"],"sources":["../../../../src/components/fields/ListBoxPopover/ListBoxPopover.tsx"],"sourcesContent":["import { getEventTarget, isFocusWithin } from '@react-aria/utils';\nimport { Key } from '@react-types/shared';\nimport { Styles, tasty } from '@tenphi/tasty';\nimport React, {\n CSSProperties,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n} from 'react';\nimport { useInteractOutside, useOverlay, useOverlayPosition } from 'react-aria';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { useI18n } from '../../../i18n';\nimport { mergeProps } from '../../../utils/react';\nimport { mergeRefs } from '../../../utils/react/useCombinedRefs';\nimport { DisplayTransition } from '../../helpers';\nimport { useModalLayerRef } from '../../overlays/Modal/modal-containment';\nimport { Portal } from '../../portal';\nimport { ListBox } from '../ListBox/ListBox';\n\nexport interface ListBoxPopoverProps {\n isOpen: boolean;\n triggerRef: RefObject<HTMLElement>;\n popoverRef: RefObject<HTMLDivElement>;\n listBoxRef: RefObject<HTMLDivElement>;\n direction: 'bottom' | 'top';\n shouldFlip: boolean;\n overlayOffset: number;\n containerPadding: number;\n /** Min width (px) for the overlay; usually the trigger's width. */\n comboBoxWidth?: number;\n /** Stable id used for the ListBox element and aria-controls wiring. */\n listBoxId: string;\n overlayStyles?: Styles;\n listBoxStyles?: Styles;\n optionStyles?: Styles;\n /** Substring to highlight within each option's (text) children. */\n optionHighlight?: string;\n sectionStyles?: Styles;\n headingStyles?: Styles;\n /** Space between options, in pixels. Defaults to a hairline (`1bw`). */\n listGap?: number;\n selectedKey?: Key | null;\n /**\n * `'multiple'` lets the list hold several selected options. The list then\n * reports the whole new selection on every toggle and never closes itself;\n * the caller decides what a toggle means. Defaults to `'single'`.\n */\n selectionMode?: 'single' | 'multiple';\n /** The selected keys in `'multiple'` mode. Ignored in `'single'` mode. */\n selectedKeys?: Key[];\n /** Whether options show a checkbox. Only applies in `'multiple'` mode. */\n isCheckable?: boolean;\n /**\n * Whether a click inside the element `triggerRef` points at closes the\n * popover, like any other outside click. Pass `false` when that element is\n * where the user keeps working with the list open, such as an input that\n * picks several options in a row. Only this popover is affected; others\n * still close. Defaults to `true`.\n */\n shouldCloseOnTriggerInteraction?: boolean;\n /**\n * Whether an outside press on a control (a button, a link, a form control,\n * anything with `tabindex`, or something inside one) reaches it, as one on\n * a `data-popover-dismiss` control does: the control can take focus, and\n * the popover closes after it, so a native Save button saves on the first\n * click. A press anywhere else, such as a dialog's backdrop, still only\n * closes the popover. Defaults to `false`.\n */\n shouldPassControlPresses?: boolean;\n isDisabled?: boolean;\n disabledKeys?: Iterable<Key>;\n items?: Iterable<any>;\n children: ReactNode;\n /** Ref through which the ListBox exposes its internal list state. */\n listStateRef: RefObject<any>;\n onSelectionChange: (selection: Key | Key[] | null) => void;\n onClose: () => void;\n label?: ReactNode;\n ariaLabel?: string;\n /**\n * Ids of the elements that name the field, read after `label` or\n * `ariaLabel`. Without either, they alone name the list, in place of the\n * generic \"Options\".\n */\n ariaLabelledby?: string;\n compositeFocusProps: {\n onFocus: (e: React.FocusEvent) => void;\n onBlur: (e: React.FocusEvent) => void;\n };\n /** Collection node filter applied to the ListBox. */\n filter?: (nodes: Iterable<any>) => Iterable<any>;\n size?: 'small' | 'medium' | 'large' | (string & {});\n /**\n * Label shown when the list is empty (no items / no filter results).\n * Forwarded to the inner ListBox.\n */\n emptyLabel?: ReactNode;\n /**\n * Element to anchor the overlay to geometrically. Defaults to `triggerRef`.\n * Use this to anchor to something other than the trigger (e.g. the caret in\n * a textarea) while keeping `triggerRef` for outside-click/dismiss logic.\n */\n positionTargetRef?: RefObject<Element | null>;\n /**\n * Receives an imperative handle exposing `updatePosition()` so the caller can\n * force the overlay to re-anchor (e.g. when the caret moves).\n */\n positionApiRef?: RefObject<{ updatePosition: () => void } | null>;\n}\n\n// What `shouldPassControlPresses` lets an outside press reach.\nconst CONTROL_SELECTOR =\n 'button, a[href], input, select, textarea, [tabindex], [contenteditable]:not([contenteditable=\"false\"])';\n\nconst ListBoxPopoverWrapper = tasty({\n qa: 'ComboBoxOverlayWrapper',\n styles: {\n position: 'absolute',\n zIndex: 1000,\n },\n});\n\nconst ListBoxPopoverElement = tasty({\n qa: 'ComboBoxOverlay',\n styles: {\n display: 'grid',\n gridRows: '1sf',\n gridColumns: '1sf',\n width: '$overlay-min-width max-content 50vw',\n height: 'initial max-content (50vh - 5x)',\n overflow: 'auto',\n fill: '#surface',\n radius: '1cr',\n shadow: true,\n padding: '0',\n border: '#border',\n hide: {\n '': false,\n hidden: true,\n },\n boxSizing: 'border-box',\n transition:\n 'translate $transition ease-out, scale $transition ease-out, theme $transition ease-out',\n translate: {\n '': '0 0',\n 'open & [data-placement=\"top\"]': '0 0',\n '!open & [data-placement=\"top\"]': '0 1x',\n 'open & ([data-placement=\"bottom\"] | ![data-placement])': '0 0',\n '!open & ([data-placement=\"bottom\"] | ![data-placement])': '0 -1x',\n },\n transformOrigin: {\n '': 'top center',\n '[data-placement=\"top\"]': 'bottom center',\n },\n scale: {\n '': '1 1',\n '!open': '1 .9',\n },\n opacity: {\n '': 1,\n '!open': 0.001,\n },\n\n '$overlay-min-width': 'min 30x',\n },\n});\n\nexport const ListBoxPopover = function ListBoxPopover(\n props: ListBoxPopoverProps,\n) {\n const { t } = useI18n();\n const {\n isOpen,\n triggerRef,\n popoverRef,\n listBoxRef,\n direction,\n shouldFlip,\n overlayOffset,\n containerPadding,\n comboBoxWidth,\n listBoxId,\n overlayStyles,\n listBoxStyles,\n optionStyles,\n optionHighlight,\n sectionStyles,\n headingStyles,\n listGap,\n selectedKey,\n selectionMode = 'single',\n selectedKeys,\n isCheckable,\n shouldCloseOnTriggerInteraction = true,\n shouldPassControlPresses = false,\n isDisabled,\n disabledKeys,\n items,\n children,\n listStateRef,\n onSelectionChange,\n onClose,\n label,\n ariaLabel,\n ariaLabelledby,\n compositeFocusProps,\n filter,\n size = 'medium',\n emptyLabel,\n positionTargetRef,\n positionApiRef,\n } = props;\n\n const mergedPopoverRef = popoverRef;\n\n // Opened inside a modal, the list stays readable while the modal hides the\n // page.\n const layerRef = useModalLayerRef();\n\n // Ref to the inner scrollable element (the visible popover). react-aria\n // measures this for its flip/shrink math and writes maxHeight onto the\n // overlay (positioning wrapper); we forward that maxHeight to this element\n // below so the scroll container actually shrinks instead of overflowing.\n const overlayScrollRef = useRef<HTMLDivElement | null>(null);\n\n // Overlay positioning — anchor to the explicit position target when given\n // (e.g. a caret anchor), otherwise to the trigger. `triggerRef` is still\n // used below for outside-click/dismiss behavior.\n const {\n overlayProps: overlayPositionProps,\n placement,\n updatePosition,\n } = useOverlayPosition({\n targetRef: (positionTargetRef ?? triggerRef) as any,\n overlayRef: mergedPopoverRef as any,\n scrollRef: overlayScrollRef as any,\n placement: `${direction} start` as any,\n shouldFlip,\n isOpen,\n offset: overlayOffset,\n containerPadding: containerPadding,\n });\n\n // Keep positioning (top/left/zIndex) on the wrapper, but split out the\n // available-space cap so it can be applied to the inner scroll element.\n const { maxHeight, maxWidth, ...positionStyle } =\n (overlayPositionProps.style ?? {}) as CSSProperties;\n\n // Expose updatePosition so callers can re-anchor on demand (e.g. caret move).\n useEffect(() => {\n if (positionApiRef) {\n positionApiRef.current = { updatePosition };\n }\n return () => {\n if (positionApiRef) {\n positionApiRef.current = null;\n }\n };\n }, [positionApiRef, updatePosition]);\n\n const getOutsidePressBehavior = (el: Element) => {\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (menuTriggerEl) {\n return menuTriggerEl === triggerRef.current ? 'consume' : 'ignore';\n }\n if (\n (!shouldCloseOnTriggerInteraction && triggerRef.current?.contains(el)) ||\n el.closest('[data-popover-keep]')\n ) {\n return 'ignore';\n }\n if (\n (shouldPassControlPresses && el.closest(CONTROL_SELECTOR)) ||\n el.closest('[data-popover-dismiss]')\n ) {\n return 'pass';\n }\n return 'consume';\n };\n\n // Overlay behavior (dismiss on outside click, escape)\n const { overlayProps: overlayBehaviorProps } = useOverlay(\n {\n onClose,\n shouldCloseOnBlur: true,\n isOpen,\n isDismissable: true,\n shouldCloseOnInteractOutside: (el) => {\n const behavior = getOutsidePressBehavior(el);\n if (behavior === 'pass') {\n // Leave the control's press intact and close after its action.\n setTimeout(onClose, 0);\n }\n return behavior === 'consume';\n },\n },\n mergedPopoverRef as any,\n );\n\n const preserveOutsidePressFocus = useEvent((event: PointerEvent) => {\n if (\n (isFocusWithin(triggerRef.current) ||\n isFocusWithin(mergedPopoverRef.current)) &&\n getOutsidePressBehavior(getEventTarget(event) as Element) === 'consume'\n ) {\n event.preventDefault();\n }\n });\n\n // Aria now permits outside presses to move focus. Consumed presses must\n // only dismiss this list; a blur would also commit the field's draft.\n useInteractOutside({\n ref: mergedPopoverRef,\n isDisabled: !isOpen,\n onInteractOutsideStart: preserveOutsidePressFocus,\n onInteractOutside: preserveOutsidePressFocus,\n });\n\n // Extract primary placement direction for consistent styling\n const placementDirection = placement?.split(' ')[0] || direction;\n\n // Hold the DisplayTransition ref so we can bind the same node to both the\n // transition listener and our scroll ref via a single stable callback.\n const transitionRefHolder = useRef<\n ((node: HTMLElement | null) => void) | null\n >(null);\n const setScrollRef = useCallback((node: HTMLElement | null) => {\n overlayScrollRef.current = node as HTMLDivElement | null;\n transitionRefHolder.current?.(node);\n }, []);\n\n const overlayContent = (\n <DisplayTransition isShown={isOpen}>\n {({ phase, isShown, isExiting, ref: transitionRef }) => {\n transitionRefHolder.current = transitionRef;\n return (\n <ListBoxPopoverWrapper\n {...mergeProps(\n { ...overlayPositionProps, style: positionStyle },\n overlayBehaviorProps,\n compositeFocusProps,\n )}\n ref={mergeRefs(mergedPopoverRef, layerRef)}\n style={positionStyle}\n // A press on the list while it fades out must not close the\n // overlay under it (CUB-5293) — see `Overlay`.\n data-react-aria-top-layer={isExiting || undefined}\n >\n <ListBoxPopoverElement\n ref={setScrollRef}\n data-placement={placementDirection}\n data-phase={phase}\n mods={{\n open: isShown,\n hidden: phase === 'unmounted',\n }}\n styles={overlayStyles}\n style={{\n '--overlay-min-width': comboBoxWidth\n ? `${comboBoxWidth}px`\n : undefined,\n maxHeight,\n maxWidth,\n }}\n >\n <ListBox\n ref={listBoxRef}\n disableSelectionToggle\n id={listBoxId}\n aria-label={\n ariaLabel ||\n (typeof label === 'string'\n ? label\n : ariaLabelledby\n ? undefined\n : t('listBoxPopover.options', 'Options'))\n }\n aria-labelledby={ariaLabelledby}\n // Left unset in single mode, as before this prop existed: an\n // explicit `'single'` switches on ListBox's no-toggle branch,\n // which changes what re-picking the selected option does.\n selectionMode={\n selectionMode === 'multiple' ? 'multiple' : undefined\n }\n selectedKey={\n selectionMode === 'single' ? selectedKey : undefined\n }\n selectedKeys={\n selectionMode === 'multiple' ? selectedKeys : undefined\n }\n isCheckable={\n selectionMode === 'multiple' ? isCheckable : undefined\n }\n isDisabled={isDisabled}\n disabledKeys={disabledKeys}\n shouldUseVirtualFocus={true}\n items={items as any}\n filter={filter}\n styles={listBoxStyles}\n optionStyles={optionStyles}\n optionHighlight={optionHighlight}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n stateRef={listStateRef}\n shape=\"popover\"\n emptyLabel={emptyLabel}\n onSelectionChange={onSelectionChange}\n >\n {children as any}\n </ListBox>\n </ListBoxPopoverElement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AAiC,IAAA,MAAApC;AAAAoC,IAAA,MAAA7D;AAAA6D,IAAA,MAAAxD;AAAAwD,IAAA,MAAArD;AAAAqD,IAAA,MAAAlD;AAAAkD,IAAA,MAAA5C;AAAA4C,IAAA,MAAAS;AAAAT,IAAA,MAAAnE;AAAAmE,IAAA,MAAAzE;AAAAyE,IAAA,MAAAjE;AAAAiE,IAAA,MAAA5D;AAAA4D,IAAA,MAAAhD;AAAAgD,IAAA,MAAAyB;AAAAzB,IAAA,MAAA0B;AAAA1B,IAAA,MAAAQ;AAAAR,IAAA,MAAA/C;AAAA+C,IAAA,MAAA/D;AAAA+D,IAAA,MAAAhE;AAAAgE,IAAA,MAAA6C;AAAA7C,IAAA,MAAAqB;AAAArB,IAAA,MAAAlE;AAAAkE,IAAA,MAAAyD;AAAAzD,IAAA,MAAA2B;AAAA3B,IAAA,MAAA9D;AAAA8D,IAAA,MAAA3D;AAAA2D,IAAA,MAAAzD;AAAAyD,IAAA,MAAA1D;AAAA0D,IAAA,MAAAE;AAAAF,IAAA,MAAAgE;OAAAA,OAAAhE,EAAA;CAAA,IAAAiE;AAAA,KAAAjE,EAAA,QAAA9E,UAAA8E,EAAA,QAAAgE,KAAA;AAIEC,QAAA,oBAAC,oBAtFN,oBAAC;GAA2B/I,SAAAA;aACzB8I;IAkFiB,GAGkB;AAAAhE,IAAA,MAAA9E;AAAA8E,IAAA,MAAAgE;AAAAhE,IAAA,MAAAiE;OAAAA,OAAAjE,EAAA;AAAA,QAAjCiE"}
|
|
1
|
+
{"version":3,"file":"ListBoxPopover.js","names":["getEventTarget","isFocusWithin","Key","Styles","tasty","React","CSSProperties","ReactNode","RefObject","useCallback","useEffect","useRef","useInteractOutside","useOverlay","useOverlayPosition","useEvent","useI18n","mergeProps","mergeRefs","DisplayTransition","useModalLayerRef","Portal","ListBox","ListBoxPopoverProps","isOpen","triggerRef","HTMLElement","popoverRef","HTMLDivElement","listBoxRef","direction","shouldFlip","overlayOffset","containerPadding","comboBoxWidth","listBoxId","overlayStyles","listBoxStyles","optionStyles","optionHighlight","sectionStyles","headingStyles","listGap","selectedKey","selectionMode","selectedKeys","isCheckable","shouldCloseOnTriggerInteraction","isDisabled","disabledKeys","Iterable","items","children","listStateRef","onSelectionChange","selection","onClose","label","ariaLabel","ariaLabelledby","compositeFocusProps","onFocus","e","FocusEvent","onBlur","filter","nodes","size","emptyLabel","positionTargetRef","Element","positionApiRef","updatePosition","CONTROL_SELECTOR","LAYER_SELECTOR","DISABLED_SELECTOR","isOutsideControl","el","trigger","control","closest","contains","matches","layer","ListBoxPopoverWrapper","qa","styles","position","zIndex","ListBoxPopoverElement","display","gridRows","gridColumns","width","height","overflow","fill","radius","shadow","padding","border","hide","hidden","boxSizing","transition","translate","transformOrigin","scale","opacity","ListBoxPopover","props","$","_c","t","t0","t1","t2","undefined","mergedPopoverRef","layerRef","overlayScrollRef","t3","t4","t5","t6","targetRef","overlayRef","scrollRef","placement","offset","overlayProps","overlayPositionProps","t7","style","t8","maxHeight","maxWidth","positionStyle","t10","t9","current","t11","menuTriggerEl","dismissEl","getOutsidePressBehavior","t12","el_0","behavior","setTimeout","t13","shouldCloseOnBlur","isDismissable","shouldCloseOnInteractOutside","overlayBehaviorProps","t14","event","preventDefault","preserveOutsidePressFocus","t15","t16","ref","onInteractOutsideStart","onInteractOutside","t17","split","placementDirection","transitionRefHolder","t18","Symbol","for","node","setScrollRef","t19","t20","phase","isShown","isExiting","transitionRef","open","overlayContent"],"sources":["../../../../src/components/fields/ListBoxPopover/ListBoxPopover.tsx"],"sourcesContent":["import { getEventTarget, isFocusWithin } from '@react-aria/utils';\nimport { Key } from '@react-types/shared';\nimport { Styles, tasty } from '@tenphi/tasty';\nimport React, {\n CSSProperties,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n} from 'react';\nimport { useInteractOutside, useOverlay, useOverlayPosition } from 'react-aria';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { useI18n } from '../../../i18n';\nimport { mergeProps } from '../../../utils/react';\nimport { mergeRefs } from '../../../utils/react/useCombinedRefs';\nimport { DisplayTransition } from '../../helpers';\nimport { useModalLayerRef } from '../../overlays/Modal/modal-containment';\nimport { Portal } from '../../portal';\nimport { ListBox } from '../ListBox/ListBox';\n\nexport interface ListBoxPopoverProps {\n isOpen: boolean;\n triggerRef: RefObject<HTMLElement>;\n popoverRef: RefObject<HTMLDivElement>;\n listBoxRef: RefObject<HTMLDivElement>;\n direction: 'bottom' | 'top';\n shouldFlip: boolean;\n overlayOffset: number;\n containerPadding: number;\n /** Min width (px) for the overlay; usually the trigger's width. */\n comboBoxWidth?: number;\n /** Stable id used for the ListBox element and aria-controls wiring. */\n listBoxId: string;\n overlayStyles?: Styles;\n listBoxStyles?: Styles;\n optionStyles?: Styles;\n /** Substring to highlight within each option's (text) children. */\n optionHighlight?: string;\n sectionStyles?: Styles;\n headingStyles?: Styles;\n /** Space between options, in pixels. Defaults to a hairline (`1bw`). */\n listGap?: number;\n selectedKey?: Key | null;\n /**\n * `'multiple'` lets the list hold several selected options. The list then\n * reports the whole new selection on every toggle and never closes itself;\n * the caller decides what a toggle means. Defaults to `'single'`.\n */\n selectionMode?: 'single' | 'multiple';\n /** The selected keys in `'multiple'` mode. Ignored in `'single'` mode. */\n selectedKeys?: Key[];\n /** Whether options show a checkbox. Only applies in `'multiple'` mode. */\n isCheckable?: boolean;\n /**\n * Whether a click inside the element `triggerRef` points at closes the\n * popover, like any other outside click. Pass `false` when that element is\n * where the user keeps working with the list open, such as an input that\n * picks several options in a row. Only this popover is affected; others\n * still close. Defaults to `true`.\n */\n shouldCloseOnTriggerInteraction?: boolean;\n isDisabled?: boolean;\n disabledKeys?: Iterable<Key>;\n items?: Iterable<any>;\n children: ReactNode;\n /** Ref through which the ListBox exposes its internal list state. */\n listStateRef: RefObject<any>;\n onSelectionChange: (selection: Key | Key[] | null) => void;\n onClose: () => void;\n label?: ReactNode;\n ariaLabel?: string;\n /**\n * Ids of the elements that name the field, read after `label` or\n * `ariaLabel`. Without either, they alone name the list, in place of the\n * generic \"Options\".\n */\n ariaLabelledby?: string;\n compositeFocusProps: {\n onFocus: (e: React.FocusEvent) => void;\n onBlur: (e: React.FocusEvent) => void;\n };\n /** Collection node filter applied to the ListBox. */\n filter?: (nodes: Iterable<any>) => Iterable<any>;\n size?: 'small' | 'medium' | 'large' | (string & {});\n /**\n * Label shown when the list is empty (no items / no filter results).\n * Forwarded to the inner ListBox.\n */\n emptyLabel?: ReactNode;\n /**\n * Element to anchor the overlay to geometrically. Defaults to `triggerRef`.\n * Use this to anchor to something other than the trigger (e.g. the caret in\n * a textarea) while keeping `triggerRef` for outside-click/dismiss logic.\n */\n positionTargetRef?: RefObject<Element | null>;\n /**\n * Receives an imperative handle exposing `updatePosition()` so the caller can\n * force the overlay to re-anchor (e.g. when the caret moves).\n */\n positionApiRef?: RefObject<{ updatePosition: () => void } | null>;\n}\n\n// The controls an outside press reaches: a button, a link, a form control,\n// anything with `tabindex`, or something inside one.\nconst CONTROL_SELECTOR =\n 'button, a[href], input, select, textarea, [tabindex], [contenteditable]:not([contenteditable=\"false\"])';\n\n// The layer a field sits in: a dialog, popover or tray, otherwise the page.\nconst LAYER_SELECTOR =\n '[role=\"dialog\"], [role=\"alertdialog\"], [data-overlay-layer]';\n\nconst DISABLED_SELECTOR = ':disabled, [aria-disabled=\"true\"]';\n\n// An enabled control apart from the field, in the field's own layer. A press\n// anywhere else counts as blank space and keeps the field's focus and draft:\n// on the field itself, on a dialog's surface, on a disabled control, or\n// outside the field's layer, which stays open.\nfunction isOutsideControl(el: Element, trigger: HTMLElement | null) {\n const control = el.closest(CONTROL_SELECTOR);\n\n if (\n control == null ||\n trigger == null ||\n control.contains(trigger) ||\n trigger.contains(control) ||\n control.matches(`${LAYER_SELECTOR}, ${DISABLED_SELECTOR}`)\n ) {\n return false;\n }\n\n const layer = trigger.closest(LAYER_SELECTOR);\n\n return layer == null || layer.contains(control);\n}\n\nconst ListBoxPopoverWrapper = tasty({\n qa: 'ComboBoxOverlayWrapper',\n styles: {\n position: 'absolute',\n zIndex: 1000,\n },\n});\n\nconst ListBoxPopoverElement = tasty({\n qa: 'ComboBoxOverlay',\n styles: {\n display: 'grid',\n gridRows: '1sf',\n gridColumns: '1sf',\n width: '$overlay-min-width max-content 50vw',\n height: 'initial max-content (50vh - 5x)',\n overflow: 'auto',\n fill: '#surface',\n radius: '1cr',\n shadow: true,\n padding: '0',\n border: '#border',\n hide: {\n '': false,\n hidden: true,\n },\n boxSizing: 'border-box',\n transition:\n 'translate $transition ease-out, scale $transition ease-out, theme $transition ease-out',\n translate: {\n '': '0 0',\n 'open & [data-placement=\"top\"]': '0 0',\n '!open & [data-placement=\"top\"]': '0 1x',\n 'open & ([data-placement=\"bottom\"] | ![data-placement])': '0 0',\n '!open & ([data-placement=\"bottom\"] | ![data-placement])': '0 -1x',\n },\n transformOrigin: {\n '': 'top center',\n '[data-placement=\"top\"]': 'bottom center',\n },\n scale: {\n '': '1 1',\n '!open': '1 .9',\n },\n opacity: {\n '': 1,\n '!open': 0.001,\n },\n\n '$overlay-min-width': 'min 30x',\n },\n});\n\nexport const ListBoxPopover = function ListBoxPopover(\n props: ListBoxPopoverProps,\n) {\n const { t } = useI18n();\n const {\n isOpen,\n triggerRef,\n popoverRef,\n listBoxRef,\n direction,\n shouldFlip,\n overlayOffset,\n containerPadding,\n comboBoxWidth,\n listBoxId,\n overlayStyles,\n listBoxStyles,\n optionStyles,\n optionHighlight,\n sectionStyles,\n headingStyles,\n listGap,\n selectedKey,\n selectionMode = 'single',\n selectedKeys,\n isCheckable,\n shouldCloseOnTriggerInteraction = true,\n isDisabled,\n disabledKeys,\n items,\n children,\n listStateRef,\n onSelectionChange,\n onClose,\n label,\n ariaLabel,\n ariaLabelledby,\n compositeFocusProps,\n filter,\n size = 'medium',\n emptyLabel,\n positionTargetRef,\n positionApiRef,\n } = props;\n\n const mergedPopoverRef = popoverRef;\n\n // Opened inside a modal, the list stays readable while the modal hides the\n // page.\n const layerRef = useModalLayerRef();\n\n // Ref to the inner scrollable element (the visible popover). react-aria\n // measures this for its flip/shrink math and writes maxHeight onto the\n // overlay (positioning wrapper); we forward that maxHeight to this element\n // below so the scroll container actually shrinks instead of overflowing.\n const overlayScrollRef = useRef<HTMLDivElement | null>(null);\n\n // Overlay positioning — anchor to the explicit position target when given\n // (e.g. a caret anchor), otherwise to the trigger. `triggerRef` is still\n // used below for outside-click/dismiss behavior.\n const {\n overlayProps: overlayPositionProps,\n placement,\n updatePosition,\n } = useOverlayPosition({\n targetRef: (positionTargetRef ?? triggerRef) as any,\n overlayRef: mergedPopoverRef as any,\n scrollRef: overlayScrollRef as any,\n placement: `${direction} start` as any,\n shouldFlip,\n isOpen,\n offset: overlayOffset,\n containerPadding: containerPadding,\n });\n\n // Keep positioning (top/left/zIndex) on the wrapper, but split out the\n // available-space cap so it can be applied to the inner scroll element.\n const { maxHeight, maxWidth, ...positionStyle } =\n (overlayPositionProps.style ?? {}) as CSSProperties;\n\n // Expose updatePosition so callers can re-anchor on demand (e.g. caret move).\n useEffect(() => {\n if (positionApiRef) {\n positionApiRef.current = { updatePosition };\n }\n return () => {\n if (positionApiRef) {\n positionApiRef.current = null;\n }\n };\n }, [positionApiRef, updatePosition]);\n\n const getOutsidePressBehavior = (el: Element) => {\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (menuTriggerEl) {\n return menuTriggerEl === triggerRef.current ? 'consume' : 'ignore';\n }\n if (\n (!shouldCloseOnTriggerInteraction && triggerRef.current?.contains(el)) ||\n el.closest('[data-popover-keep]')\n ) {\n return 'ignore';\n }\n // The press reaches an outside control, so a checkbox toggles, a text\n // field takes focus and a native Save button saves on the first click.\n // A UI Kit Button passes from any layer, unless it is disabled.\n const dismissEl = el.closest('[data-popover-dismiss]');\n\n if (\n isOutsideControl(el, triggerRef.current) ||\n (dismissEl != null && !dismissEl.matches(DISABLED_SELECTOR))\n ) {\n return 'pass';\n }\n return 'consume';\n };\n\n // Overlay behavior (dismiss on outside click, escape)\n const { overlayProps: overlayBehaviorProps } = useOverlay(\n {\n onClose,\n shouldCloseOnBlur: true,\n isOpen,\n isDismissable: true,\n shouldCloseOnInteractOutside: (el) => {\n const behavior = getOutsidePressBehavior(el);\n if (behavior === 'pass') {\n // Leave the control's press intact and close after its action.\n setTimeout(onClose, 0);\n }\n return behavior === 'consume';\n },\n },\n mergedPopoverRef as any,\n );\n\n const preserveOutsidePressFocus = useEvent((event: PointerEvent) => {\n if (\n (isFocusWithin(triggerRef.current) ||\n isFocusWithin(mergedPopoverRef.current)) &&\n getOutsidePressBehavior(getEventTarget(event) as Element) === 'consume'\n ) {\n event.preventDefault();\n }\n });\n\n // Aria now permits outside presses to move focus. A passed press moves it\n // to its control, and the field settles its draft on blur, as on Tab. A\n // consumed press, such as one on blank space or a dialog's backdrop, must\n // only dismiss this list: the field keeps focus and its draft.\n useInteractOutside({\n ref: mergedPopoverRef,\n isDisabled: !isOpen,\n onInteractOutsideStart: preserveOutsidePressFocus,\n onInteractOutside: preserveOutsidePressFocus,\n });\n\n // Extract primary placement direction for consistent styling\n const placementDirection = placement?.split(' ')[0] || direction;\n\n // Hold the DisplayTransition ref so we can bind the same node to both the\n // transition listener and our scroll ref via a single stable callback.\n const transitionRefHolder = useRef<\n ((node: HTMLElement | null) => void) | null\n >(null);\n const setScrollRef = useCallback((node: HTMLElement | null) => {\n overlayScrollRef.current = node as HTMLDivElement | null;\n transitionRefHolder.current?.(node);\n }, []);\n\n const overlayContent = (\n <DisplayTransition isShown={isOpen}>\n {({ phase, isShown, isExiting, ref: transitionRef }) => {\n transitionRefHolder.current = transitionRef;\n return (\n <ListBoxPopoverWrapper\n {...mergeProps(\n { ...overlayPositionProps, style: positionStyle },\n overlayBehaviorProps,\n compositeFocusProps,\n )}\n ref={mergeRefs(mergedPopoverRef, layerRef)}\n style={positionStyle}\n // A press on the list while it fades out must not close the\n // overlay under it (CUB-5293) — see `Overlay`.\n data-react-aria-top-layer={isExiting || undefined}\n >\n <ListBoxPopoverElement\n ref={setScrollRef}\n data-placement={placementDirection}\n data-phase={phase}\n mods={{\n open: isShown,\n hidden: phase === 'unmounted',\n }}\n styles={overlayStyles}\n style={{\n '--overlay-min-width': comboBoxWidth\n ? `${comboBoxWidth}px`\n : undefined,\n maxHeight,\n maxWidth,\n }}\n >\n <ListBox\n isBare\n ref={listBoxRef}\n disableSelectionToggle\n id={listBoxId}\n aria-label={\n ariaLabel ||\n (typeof label === 'string'\n ? label\n : ariaLabelledby\n ? undefined\n : t('listBoxPopover.options', 'Options'))\n }\n aria-labelledby={ariaLabelledby}\n // Left unset in single mode, as before this prop existed: an\n // explicit `'single'` switches on ListBox's no-toggle branch,\n // which changes what re-picking the selected option does.\n selectionMode={\n selectionMode === 'multiple' ? 'multiple' : undefined\n }\n selectedKey={\n selectionMode === 'single' ? selectedKey : undefined\n }\n selectedKeys={\n selectionMode === 'multiple' ? selectedKeys : undefined\n }\n isCheckable={\n selectionMode === 'multiple' ? isCheckable : undefined\n }\n isDisabled={isDisabled}\n disabledKeys={disabledKeys}\n shouldUseVirtualFocus={true}\n items={items as any}\n filter={filter}\n styles={listBoxStyles}\n optionStyles={optionStyles}\n optionHighlight={optionHighlight}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n stateRef={listStateRef}\n shape=\"popover\"\n emptyLabel={emptyLabel}\n onSelectionChange={onSelectionChange}\n >\n {children as any}\n </ListBox>\n </ListBoxPopoverElement>\n </ListBoxPopoverWrapper>\n );\n }}\n </DisplayTransition>\n );\n\n return <Portal>{overlayContent}</Portal>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA0GA,MAAMyE,mBACJ;AAGF,MAAMC,iBACJ;AAEF,MAAMC,oBAAoB;AAM1B,SAASC,iBAAiBC,IAAaC,SAA6B;CAClE,MAAMC,UAAUF,GAAGG,QAAQP,iBAAiB;AAE5C,KACEM,WAAW,QACXD,WAAW,QACXC,QAAQE,SAASH,QAAQ,IACzBA,QAAQG,SAASF,QA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3C;AAAA2C,IAAA,MAAA9C;AAAA8C,IAAA,MAAAtE;AAAAsE,IAAA,MAAAjE;AAAAiE,IAAA,MAAA/D;AAAA+D,IAAA,MAAA5D;AAAA4D,IAAA,MAAAtD;AAAAsD,IAAA,MAAAQ;AAAAR,IAAA,MAAA5E;AAAA4E,IAAA,MAAAlF;AAAAkF,IAAA,MAAA1E;AAAA0E,IAAA,MAAArE;AAAAqE,IAAA,MAAA1D;AAAA0D,IAAA,MAAAwB;AAAAxB,IAAA,MAAAyB;AAAAzB,IAAA,MAAAO;AAAAP,IAAA,MAAAzD;AAAAyD,IAAA,MAAAxE;AAAAwE,IAAA,MAAAzE;AAAAyE,IAAA,MAAA0C;AAAA1C,IAAA,MAAAoB;AAAApB,IAAA,MAAA3E;AAAA2E,IAAA,MAAAsD;AAAAtD,IAAA,MAAA0B;AAAA1B,IAAA,MAAAvE;AAAAuE,IAAA,MAAApE;AAAAoE,IAAA,MAAAlE;AAAAkE,IAAA,MAAAnE;AAAAmE,IAAA,MAAAE;AAAAF,IAAA,MAAA6D;OAAAA,OAAA7D,EAAA;CAAA,IAAA8D;AAAA,KAAA9D,EAAA,QAAAvF,UAAAuF,EAAA,QAAA6D,KAAA;AAIEC,QAAA,oBAAC,oBAvFN,oBAAC;GAA2BrJ,SAAAA;aACzBoJ;IAmFiB,GAGkB;AAAA7D,IAAA,MAAAvF;AAAAuF,IAAA,MAAA6D;AAAA7D,IAAA,MAAA8D;OAAAA,OAAA9D,EAAA;AAAA,QAAjC8D"}
|
|
@@ -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-77836fa | Cube Dev Team */
|
|
2
2
|
//#region src/components/fields/ListBoxPopover/listNavigation.ts
|
|
3
3
|
/**
|
|
4
4
|
* Walks a collection (possibly nested under sections) and collects the keys of
|
|
@@ -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-77836fa | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
@@ -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-77836fa | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { castNullableNumberValue } from "../../../utils/react/nullableValue.js";
|
|
4
4
|
import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
|
|
@@ -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-77836fa | Cube Dev Team */
|
|
2
2
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
3
3
|
import { Button } from "../../actions/Button/Button.js";
|
|
4
4
|
import { DirectionIcon } from "../../../icons/DirectionIcon.js";
|
|
@@ -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-77836fa | Cube Dev Team */
|
|
2
2
|
import { chain } from "../../../utils/react/chain.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useBufferedValue } from "../../../utils/react/useBufferedValue.js";
|
|
@@ -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-77836fa | Cube Dev Team */
|
|
2
2
|
import { extractStyles, mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { _Text } from "../../content/Text.js";
|
|
4
4
|
import { isTextOnly } from "../../../utils/react/isTextOnly.js";
|
|
@@ -24,7 +24,7 @@ import { processSelectionArray } from "../../../utils/selection.js";
|
|
|
24
24
|
import { BASE_STYLES, COLOR_STYLES, OUTER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
25
25
|
import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
26
26
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
-
import { FocusScope } from "react-aria";
|
|
27
|
+
import { FocusScope, mergeProps, useLabel } from "react-aria";
|
|
28
28
|
import { Section, useListState } from "react-stately";
|
|
29
29
|
|
|
30
30
|
//#region src/components/fields/Picker/Picker.tsx
|
|
@@ -66,7 +66,13 @@ const Picker = forwardRef(function Picker(props, ref) {
|
|
|
66
66
|
const [internalSelectedKeys, setInternalSelectedKeys] = useState(defaultSelectedKeys ?? []);
|
|
67
67
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
68
68
|
const triggerRef = useRef(null);
|
|
69
|
-
const
|
|
69
|
+
const { labelProps, fieldProps: triggerLabelProps } = useLabel({
|
|
70
|
+
id: props.id,
|
|
71
|
+
label,
|
|
72
|
+
labelElementType: "span",
|
|
73
|
+
"aria-label": ariaLabel ?? (!label ? t("picker.pickerAriaLabel", "Picker") : void 0),
|
|
74
|
+
"aria-labelledby": props["aria-labelledby"]
|
|
75
|
+
});
|
|
70
76
|
const pickerAriaLabel = `${ariaLabel ?? (isTextOnly(label) ? String(label ?? "") : "")} ${t("picker.pickerAriaLabel", "Picker")}`.trim();
|
|
71
77
|
const triggerWidthRef = useRef(void 0);
|
|
72
78
|
const isControlledSingle = selectedKey !== void 0;
|
|
@@ -253,7 +259,6 @@ const Picker = forwardRef(function Picker(props, ref) {
|
|
|
253
259
|
const triggerElement = /* @__PURE__ */ jsx(_ItemButton, {
|
|
254
260
|
ref: triggerRef,
|
|
255
261
|
"data-popover-trigger": true,
|
|
256
|
-
id,
|
|
257
262
|
qa: qa || "PickerTrigger",
|
|
258
263
|
type,
|
|
259
264
|
theme: paintedTheme,
|
|
@@ -276,7 +281,7 @@ const Picker = forwardRef(function Picker(props, ref) {
|
|
|
276
281
|
descriptionPlacement,
|
|
277
282
|
styles: triggerStyles,
|
|
278
283
|
...keyboardProps,
|
|
279
|
-
|
|
284
|
+
...mergeProps(triggerLabelProps, { id }),
|
|
280
285
|
"aria-describedby": ariaDescribedBy,
|
|
281
286
|
children: triggerContent
|
|
282
287
|
});
|
|
@@ -332,6 +337,7 @@ const Picker = forwardRef(function Picker(props, ref) {
|
|
|
332
337
|
children: /* @__PURE__ */ jsx(FocusScope, {
|
|
333
338
|
restoreFocus: true,
|
|
334
339
|
children: /* @__PURE__ */ jsx(ListBox, {
|
|
340
|
+
isBare: true,
|
|
335
341
|
autoFocus: true,
|
|
336
342
|
items: items ? finalItems : void 0,
|
|
337
343
|
"aria-label": pickerAriaLabel,
|
|
@@ -372,7 +378,10 @@ const Picker = forwardRef(function Picker(props, ref) {
|
|
|
372
378
|
})
|
|
373
379
|
})]
|
|
374
380
|
})
|
|
375
|
-
}), ref,
|
|
381
|
+
}), ref, {
|
|
382
|
+
...props,
|
|
383
|
+
labelProps: mergeProps(labelProps, props.labelProps)
|
|
384
|
+
});
|
|
376
385
|
});
|
|
377
386
|
Picker.Item = ListBox.Item;
|
|
378
387
|
Picker.Section = Section;
|