@cube-dev/ui-kit 0.0.0-canary-069fbca → 0.0.0-canary-7577f97
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/AutoCollapseObserver.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/Button/index.js +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 +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/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.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider/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 +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.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 +55 -29
- package/dist/components/content/Tag/Tag.js.map +1 -1
- 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/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.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 +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/item-table-sections.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/TableRowLink.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-body-sections.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/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.js +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +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/CalendarPopover.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/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +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 +1 -1
- package/dist/components/fields/ListBox/empty-row.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +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 +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/RadioGroup/joined-styles.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +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.d.ts +26 -3
- package/dist/components/fields/TagInput/TagInput.js +340 -204
- package/dist/components/fields/TagInput/TagInput.js.map +1 -1
- package/dist/components/fields/TagInput/TagList.js +59 -34
- package/dist/components/fields/TagInput/TagList.js.map +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useSuffixSpace.js +62 -0
- package/dist/components/fields/TagInput/useSuffixSpace.js.map +1 -0
- 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/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.js +1 -1
- package/dist/components/fields/ToggleGroup/context.js +1 -1
- 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/option-origin-press.js +1 -1
- 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/FormContext.js +1 -1
- package/dist/components/form/Form/FormElement.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/field-layout.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/NavTabs/NavTabs.d.ts +66 -0
- package/dist/components/navigation/NavTabs/NavTabs.js +369 -0
- package/dist/components/navigation/NavTabs/NavTabs.js.map +1 -0
- package/dist/components/navigation/NavTabs/index.d.ts +3 -0
- 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 +3 -46
- package/dist/components/navigation/Tabs/TabButton.js.map +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/scroll-tab-into-strip.js +60 -0
- package/dist/components/navigation/Tabs/scroll-tab-into-strip.js.map +1 -0
- package/dist/components/navigation/Tabs/segmented-styles.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +66 -65
- package/dist/components/navigation/Tabs/styled.js.map +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 +15 -6
- package/dist/components/navigation/Tabs/use-tab-indicator.js.map +1 -1
- package/dist/components/navigation/index.d.ts +3 -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/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +1 -1
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.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 +1 -1
- package/dist/components/overlays/Modal/Popover.js +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.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 +9 -1
- 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 +5 -3
- package/dist/i18n/locales/en-US/uikit.js +5 -3
- package/dist/i18n/locales/en-US/uikit.json.d.ts +8 -4
- package/dist/i18n/locales/es-ES/uikit.js +5 -3
- package/dist/i18n/locales/es-MX/uikit.js +5 -3
- package/dist/i18n/locales/fr-FR/uikit.js +5 -3
- package/dist/i18n/locales/it-IT/uikit.js +5 -3
- package/dist/i18n/locales/ja-JP/uikit.js +5 -3
- package/dist/i18n/locales/nb-NO/uikit.js +5 -3
- package/dist/i18n/locales/pt-BR/uikit.js +5 -3
- package/dist/i18n/locales/pt-PT/uikit.js +5 -3
- package/dist/i18n/locales/sv-SE/uikit.js +5 -3
- package/dist/i18n/locales/vi-VN/uikit.js +5 -3
- 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 +2 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +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/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/layout-scale.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/componentBaseProps.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/pickBaseCustomizationProps.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/useOverlayPosition.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/package.json +1 -1
- package/src/components/content/Tag/Tag.docs.mdx +2 -0
- package/src/components/fields/TagInput/TagInput.docs.mdx +61 -9
- package/src/components/navigation/NavTabs/NavTabs.docs.mdx +217 -0
- package/src/components/navigation/Tabs/Tabs.docs.mdx +5 -2
- package/src/stories/Usage.docs.mdx +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-7577f97 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { pickBaseCustomizationProps } from "../../../utils/react/pickBaseCustomizationProps.js";
|
|
4
4
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
@@ -23,12 +23,13 @@ import { ListBoxPopover } from "../ListBoxPopover/ListBoxPopover.js";
|
|
|
23
23
|
import { useCompositeFocus } from "../ListBoxPopover/useCompositeFocus.js";
|
|
24
24
|
import { TagList } from "./TagList.js";
|
|
25
25
|
import { useActiveOption } from "./useActiveOption.js";
|
|
26
|
+
import { useSuffixSpace } from "./useSuffixSpace.js";
|
|
26
27
|
import { useTagError } from "./useTagError.js";
|
|
27
28
|
import { c } from "react/compiler-runtime";
|
|
28
|
-
import { tasty } from "@tenphi/tasty";
|
|
29
|
+
import { mergeStyles, tasty } from "@tenphi/tasty";
|
|
29
30
|
import { cloneElement, forwardRef, isValidElement, useEffect, useRef, useState } from "react";
|
|
30
31
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
31
|
-
import { VisuallyHidden, useFilter, useId as useId$1, useTextField } from "react-aria";
|
|
32
|
+
import { VisuallyHidden, useFilter, useId as useId$1, useLocale, useTextField } from "react-aria";
|
|
32
33
|
import { Section, useListState } from "react-stately";
|
|
33
34
|
import { useControlledState } from "@react-stately/utils";
|
|
34
35
|
//#region src/components/fields/TagInput/TagInput.tsx
|
|
@@ -38,6 +39,7 @@ import { useControlledState } from "@react-stately/utils";
|
|
|
38
39
|
* function in a ternary branch to every later line of the component.
|
|
39
40
|
*/
|
|
40
41
|
const showEveryOption = () => true;
|
|
42
|
+
const INTERACTIVE_ELEMENTS = "a[href], button, input, select, textarea, [tabindex], [contenteditable]";
|
|
41
43
|
const TagInputElement = tasty({
|
|
42
44
|
qa: "TagInputContainer",
|
|
43
45
|
styles: {
|
|
@@ -51,6 +53,94 @@ const TAG_SIZES = {
|
|
|
51
53
|
medium: "xsmall",
|
|
52
54
|
large: "small"
|
|
53
55
|
};
|
|
56
|
+
const INSIDE_WRAPPER_STYLES = {
|
|
57
|
+
display: "flex",
|
|
58
|
+
flow: "row wrap",
|
|
59
|
+
placeItems: "center start",
|
|
60
|
+
gap: ".5x",
|
|
61
|
+
height: "min $size",
|
|
62
|
+
padding: "$tag-inset",
|
|
63
|
+
backgroundClip: "padding-box",
|
|
64
|
+
"$tag-size": {
|
|
65
|
+
"": "$size-xs",
|
|
66
|
+
"size=small": "2.5x",
|
|
67
|
+
"size=large": "$size-sm"
|
|
68
|
+
},
|
|
69
|
+
"$tag-inset": "(($size - $tag-size - 2bw) / 2)",
|
|
70
|
+
"$suffix-space": "0px",
|
|
71
|
+
Prefix: { display: "contents" },
|
|
72
|
+
Suffix: {
|
|
73
|
+
position: "relative",
|
|
74
|
+
alignSelf: "stretch",
|
|
75
|
+
margin: "(-1 * $tag-inset)",
|
|
76
|
+
marginLeft: "(-1 * $suffix-space)"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const INSIDE_INPUT_STYLES = {
|
|
80
|
+
flexGrow: 1,
|
|
81
|
+
flexBasis: {
|
|
82
|
+
"": 0,
|
|
83
|
+
"@supports(field-sizing: content) & !:placeholder-shown": "auto"
|
|
84
|
+
},
|
|
85
|
+
fieldSizing: {
|
|
86
|
+
"": "content",
|
|
87
|
+
":placeholder-shown": "fixed"
|
|
88
|
+
},
|
|
89
|
+
textOverflow: "ellipsis",
|
|
90
|
+
width: "(6x + $suffix-space) auto 100%",
|
|
91
|
+
height: "$tag-size",
|
|
92
|
+
padding: "0 (1x - 1bw - $tag-inset + $suffix-space) 0 (1x - 1bw - $tag-inset)"
|
|
93
|
+
};
|
|
94
|
+
const INSIDE_TAG_LIST_STYLES = {
|
|
95
|
+
display: "contents",
|
|
96
|
+
gap: 0
|
|
97
|
+
};
|
|
98
|
+
const INSIDE_TAG_STYLES = {
|
|
99
|
+
$size: "$tag-size",
|
|
100
|
+
"$block-padding": 0
|
|
101
|
+
};
|
|
102
|
+
/** What each part is styled with for a placement. The consumer's own win. */
|
|
103
|
+
function getPlacementStyles(placement, own) {
|
|
104
|
+
if (placement !== "inside") return own;
|
|
105
|
+
return {
|
|
106
|
+
wrapper: mergeStyles(INSIDE_WRAPPER_STYLES, own.wrapper),
|
|
107
|
+
input: mergeStyles(INSIDE_INPUT_STYLES, own.input),
|
|
108
|
+
tagList: mergeStyles(INSIDE_TAG_LIST_STYLES, own.tagList),
|
|
109
|
+
tag: mergeStyles(INSIDE_TAG_STYLES, own.tag)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/** The placeholder, unless it hides once there is a tag. */
|
|
113
|
+
function shownPlaceholder(placeholder, hideWithTags, tagCount) {
|
|
114
|
+
return hideWithTags && tagCount > 0 ? void 0 : placeholder;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Whether the popover shows: with an option to list, or to say there is none
|
|
118
|
+
* for the typed text, or none yet while loading (`emptyLabel`), rather than
|
|
119
|
+
* disappear under the user. With no options at all and nothing typed, it
|
|
120
|
+
* hides but stays open, so it comes back as soon as there is something.
|
|
121
|
+
*/
|
|
122
|
+
function isListShown({ isOpen, hasResults, term, isLoading }) {
|
|
123
|
+
return isOpen && (hasResults || term !== "" || !!isLoading);
|
|
124
|
+
}
|
|
125
|
+
/** What the popover says when it has no option to list. */
|
|
126
|
+
function resolveEmptyLabel(emptyLabel, isLoading, t) {
|
|
127
|
+
if (emptyLabel !== void 0) return emptyLabel;
|
|
128
|
+
return isLoading ? t("tagInput.loading", "Loading…") : t("tagInput.noResults", "No results found");
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Where the list of chips renders: inside, after the icon and the prefix and
|
|
132
|
+
* before the text; below, under the box.
|
|
133
|
+
*/
|
|
134
|
+
function placeTagList(placement, prefix, tagList) {
|
|
135
|
+
if (placement !== "inside" || !tagList) return {
|
|
136
|
+
prefix,
|
|
137
|
+
below: tagList
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
prefix: /* @__PURE__ */ jsxs(Fragment$1, { children: [prefix, tagList] }),
|
|
141
|
+
below: null
|
|
142
|
+
};
|
|
143
|
+
}
|
|
54
144
|
const DEFAULT_DELIMITERS = [","];
|
|
55
145
|
const LINE_BREAK = /\r\n|\r|\n/;
|
|
56
146
|
function escapeRegExp(text) {
|
|
@@ -176,6 +266,15 @@ function isComposingKey(e) {
|
|
|
176
266
|
return e.nativeEvent.isComposing || e.keyCode === 229;
|
|
177
267
|
}
|
|
178
268
|
/**
|
|
269
|
+
* The arrow toward the start of the line, with the caret already there and
|
|
270
|
+
* nothing selected: the caret has nowhere to go, so it steps out to the chip
|
|
271
|
+
* before it. Modified arrows stay text editing.
|
|
272
|
+
*/
|
|
273
|
+
function isArrowPastStart(e, direction) {
|
|
274
|
+
const { selectionStart, selectionEnd } = e.currentTarget;
|
|
275
|
+
return e.key === (direction === "rtl" ? "ArrowRight" : "ArrowLeft") && !(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) && selectionStart === 0 && selectionEnd === 0;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
179
278
|
* Why a value is refused, or `null` when it may be added. `optionKey` is the
|
|
180
279
|
* option the part resolved to, if any: an option is not validated. `present`
|
|
181
280
|
* holds the values already there, the ones this commit accepted so far among
|
|
@@ -208,8 +307,8 @@ function getComboboxProps(listBoxId, isOpen, activeKey) {
|
|
|
208
307
|
}
|
|
209
308
|
/** The button in the input that toggles the suggestions popover. */
|
|
210
309
|
function TagInputTrigger(t0) {
|
|
211
|
-
const $ = c(
|
|
212
|
-
const { id, size, ariaLabel, fieldLabelledby, onPress, isOpen, isDisabled, styles } = t0;
|
|
310
|
+
const $ = c(19);
|
|
311
|
+
const { id, size, ariaLabel, fieldLabelledby, onPress, isOpen, isDisabled, isLoading, styles } = t0;
|
|
213
312
|
const { t } = useI18n();
|
|
214
313
|
const t1 = isOpen ? "up" : "down";
|
|
215
314
|
let t2;
|
|
@@ -218,23 +317,28 @@ function TagInputTrigger(t0) {
|
|
|
218
317
|
$[0] = t1;
|
|
219
318
|
$[1] = t2;
|
|
220
319
|
} else t2 = $[1];
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
320
|
+
const t3 = !!isLoading;
|
|
321
|
+
let t4;
|
|
322
|
+
if ($[2] !== isOpen || $[3] !== t3) {
|
|
323
|
+
t4 = {
|
|
324
|
+
pressed: isOpen,
|
|
325
|
+
loading: t3
|
|
326
|
+
};
|
|
224
327
|
$[2] = isOpen;
|
|
225
328
|
$[3] = t3;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
$[5] =
|
|
232
|
-
$[6] =
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
329
|
+
$[4] = t4;
|
|
330
|
+
} else t4 = $[4];
|
|
331
|
+
let t5;
|
|
332
|
+
if ($[5] !== ariaLabel || $[6] !== t) {
|
|
333
|
+
t5 = ariaLabel ? t("tagInput.showOptionsFor", "Show options, {{label}}", { label: ariaLabel }) : t("tagInput.showOptions", "Show options");
|
|
334
|
+
$[5] = ariaLabel;
|
|
335
|
+
$[6] = t;
|
|
336
|
+
$[7] = t5;
|
|
337
|
+
} else t5 = $[7];
|
|
338
|
+
const t6 = fieldLabelledby ? `${id} ${fieldLabelledby}` : void 0;
|
|
339
|
+
let t7;
|
|
340
|
+
if ($[8] !== id || $[9] !== isDisabled || $[10] !== isOpen || $[11] !== onPress || $[12] !== size || $[13] !== styles || $[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== t6) {
|
|
341
|
+
t7 = /* @__PURE__ */ jsx(ItemAction, {
|
|
238
342
|
"data-popover-trigger": true,
|
|
239
343
|
id,
|
|
240
344
|
qa: "TagInputTrigger",
|
|
@@ -242,29 +346,29 @@ function TagInputTrigger(t0) {
|
|
|
242
346
|
size,
|
|
243
347
|
isDisabled,
|
|
244
348
|
styles,
|
|
245
|
-
mods:
|
|
349
|
+
mods: t4,
|
|
246
350
|
tabIndex: -1,
|
|
247
351
|
"aria-expanded": isOpen,
|
|
248
352
|
"aria-haspopup": "listbox",
|
|
249
|
-
"aria-label":
|
|
250
|
-
"aria-labelledby":
|
|
353
|
+
"aria-label": t5,
|
|
354
|
+
"aria-labelledby": t6,
|
|
251
355
|
onPress
|
|
252
356
|
});
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[14] = t3;
|
|
357
|
+
$[8] = id;
|
|
358
|
+
$[9] = isDisabled;
|
|
359
|
+
$[10] = isOpen;
|
|
360
|
+
$[11] = onPress;
|
|
361
|
+
$[12] = size;
|
|
362
|
+
$[13] = styles;
|
|
363
|
+
$[14] = t2;
|
|
261
364
|
$[15] = t4;
|
|
262
365
|
$[16] = t5;
|
|
263
366
|
$[17] = t6;
|
|
264
|
-
|
|
265
|
-
|
|
367
|
+
$[18] = t7;
|
|
368
|
+
} else t7 = $[18];
|
|
369
|
+
return t7;
|
|
266
370
|
}
|
|
267
|
-
/** The button in the input that clears the typed text. */
|
|
371
|
+
/** The button in the input that clears the typed text and the chips. */
|
|
268
372
|
function TagInputClearButton(t0) {
|
|
269
373
|
const $ = c(10);
|
|
270
374
|
const { id, size, ariaLabel, fieldLabelledby, onPress } = t0;
|
|
@@ -276,7 +380,7 @@ function TagInputClearButton(t0) {
|
|
|
276
380
|
} else t1 = $[0];
|
|
277
381
|
let t2;
|
|
278
382
|
if ($[1] !== ariaLabel || $[2] !== t) {
|
|
279
|
-
t2 = ariaLabel ? t("tagInput.
|
|
383
|
+
t2 = ariaLabel ? t("tagInput.clearAllFor", "Clear all, {{label}}", { label: ariaLabel }) : t("tagInput.clearAll", "Clear all");
|
|
280
384
|
$[1] = ariaLabel;
|
|
281
385
|
$[2] = t;
|
|
282
386
|
$[3] = t2;
|
|
@@ -304,7 +408,7 @@ function TagInputClearButton(t0) {
|
|
|
304
408
|
return t4;
|
|
305
409
|
}
|
|
306
410
|
function TagInput(props, ref) {
|
|
307
|
-
const $ = c(
|
|
411
|
+
const $ = c(45);
|
|
308
412
|
let t0;
|
|
309
413
|
if ($[0] !== props) {
|
|
310
414
|
t0 = castNullableArrayValue(props);
|
|
@@ -324,7 +428,8 @@ function TagInput(props, ref) {
|
|
|
324
428
|
props = withFieldChrome(props);
|
|
325
429
|
const { t } = useI18n();
|
|
326
430
|
const { formatList } = useFormatter();
|
|
327
|
-
const {
|
|
431
|
+
const { direction: textDirection } = useLocale();
|
|
432
|
+
const { qa, id, label, value: valueProp, defaultValue, onChange: onChange_0, inputValue: inputValueProp, defaultInputValue, onInputChange, placeholder, hidePlaceholderWithTags, autoFocus, autoComplete: t2, onFocus, onBlur, onKeyDown, delimiters: t3, validateTag, normalizeTag, maxTags, shouldCommitOnBlur: t4, isClearable, onClear, items, children: renderChildren, allowsCustomValue, filter, disabledKeys, popoverTrigger: t5, emptyLabel, onOpenChange, hideTrigger, direction: t6, shouldFlip: t7, overlayOffset: t8, containerPadding: t9, tagProps, icon, prefix, suffix, suffixPosition, size: t10, tagPlacement: t11, isDisabled, isReadOnly, isRequired, isLoading, isInvalid, isValid, message, errorMessage, inputRef: inputRefProp, wrapperRef: wrapperRefProp, popoverRef: popoverRefProp, listBoxRef: listBoxRefProp, wrapperStyles, inputStyles, tagListStyles, tagStyles, triggerStyles, overlayStyles, listBoxStyles, optionStyles, sectionStyles, headingStyles, listGap, labelProps: userLabelProps, mods, name, form, ...otherProps } = props;
|
|
328
433
|
const autoComplete = t2 === void 0 ? "off" : t2;
|
|
329
434
|
const delimiters = t3 === void 0 ? DEFAULT_DELIMITERS : t3;
|
|
330
435
|
const shouldCommitOnBlur = t4 === void 0 ? true : t4;
|
|
@@ -334,6 +439,7 @@ function TagInput(props, ref) {
|
|
|
334
439
|
const overlayOffset = t8 === void 0 ? 8 : t8;
|
|
335
440
|
const containerPadding = t9 === void 0 ? 8 : t9;
|
|
336
441
|
const size = t10 === void 0 ? "medium" : t10;
|
|
442
|
+
const tagPlacement = t11 === void 0 ? "below" : t11;
|
|
337
443
|
const { styles, field } = splitFieldLayout(props);
|
|
338
444
|
const rootRef = useCombinedRefs(ref);
|
|
339
445
|
const inputRef = useCombinedRefs(inputRefProp);
|
|
@@ -342,12 +448,12 @@ function TagInput(props, ref) {
|
|
|
342
448
|
const listBoxRef = useCombinedRefs(listBoxRefProp);
|
|
343
449
|
const tagListRef = useRef(null);
|
|
344
450
|
const listStateRef = useRef(null);
|
|
345
|
-
let
|
|
451
|
+
let t12;
|
|
346
452
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
347
|
-
|
|
348
|
-
$[3] =
|
|
349
|
-
} else
|
|
350
|
-
const listBoxId = `TagInputListBox-${
|
|
453
|
+
t12 = generateRandomId();
|
|
454
|
+
$[3] = t12;
|
|
455
|
+
} else t12 = $[3];
|
|
456
|
+
const listBoxId = `TagInputListBox-${t12}`;
|
|
351
457
|
const tagListId = useId$1();
|
|
352
458
|
const summaryId = useId$1();
|
|
353
459
|
const hintId = useId$1();
|
|
@@ -357,15 +463,15 @@ function TagInput(props, ref) {
|
|
|
357
463
|
const uniqueValues = [...new Set((values ?? []).map(String))];
|
|
358
464
|
const [draft, setDraftState] = useControlledState(inputValueProp, defaultInputValue ?? "", onInputChange);
|
|
359
465
|
const { tagError, setTagError, clearTagErrorAfterPress, cancelPendingClear } = useTagError();
|
|
360
|
-
let
|
|
466
|
+
let t13;
|
|
361
467
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
362
|
-
|
|
468
|
+
t13 = {
|
|
363
469
|
id: 0,
|
|
364
470
|
text: ""
|
|
365
471
|
};
|
|
366
|
-
$[4] =
|
|
367
|
-
} else
|
|
368
|
-
const [announcement, setAnnouncement] = useState(
|
|
472
|
+
$[4] = t13;
|
|
473
|
+
} else t13 = $[4];
|
|
474
|
+
const [announcement, setAnnouncement] = useState(t13);
|
|
369
475
|
let children = renderChildren;
|
|
370
476
|
if (items && typeof renderChildren === "function") children = Array.from(items).map((item, index) => {
|
|
371
477
|
const rendered = renderChildren(item);
|
|
@@ -377,40 +483,40 @@ function TagInput(props, ref) {
|
|
|
377
483
|
children,
|
|
378
484
|
selectionMode: "none"
|
|
379
485
|
}).collection;
|
|
380
|
-
let
|
|
486
|
+
let t14;
|
|
381
487
|
if ($[5] !== collection) {
|
|
382
|
-
|
|
488
|
+
t14 = (key) => {
|
|
383
489
|
const node = collection.getItem(key);
|
|
384
490
|
return node?.type === "item" ? node : null;
|
|
385
491
|
};
|
|
386
492
|
$[5] = collection;
|
|
387
|
-
$[6] =
|
|
388
|
-
} else
|
|
389
|
-
const getOption =
|
|
390
|
-
let
|
|
493
|
+
$[6] = t14;
|
|
494
|
+
} else t14 = $[6];
|
|
495
|
+
const getOption = t14;
|
|
496
|
+
let t15;
|
|
391
497
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
392
|
-
|
|
393
|
-
$[7] =
|
|
394
|
-
} else
|
|
395
|
-
const { contains } = useFilter(
|
|
498
|
+
t15 = { sensitivity: "base" };
|
|
499
|
+
$[7] = t15;
|
|
500
|
+
} else t15 = $[7];
|
|
501
|
+
const { contains } = useFilter(t15);
|
|
396
502
|
const textFilterFn = filter === false ? showEveryOption : filter || contains;
|
|
397
503
|
const [isFilterActive, setIsFilterActive] = useState(false);
|
|
398
504
|
const term = draft.trim();
|
|
399
505
|
const [knownLabels, setKnownLabels] = useState(_temp2);
|
|
400
|
-
let
|
|
506
|
+
let t16;
|
|
401
507
|
if ($[8] !== getOption || $[9] !== knownLabels) {
|
|
402
|
-
|
|
508
|
+
t16 = (key_0) => getOption(key_0)?.textValue || knownLabels.get(key_0) || key_0;
|
|
403
509
|
$[8] = getOption;
|
|
404
510
|
$[9] = knownLabels;
|
|
405
|
-
$[10] =
|
|
406
|
-
} else
|
|
407
|
-
const getOptionLabel =
|
|
511
|
+
$[10] = t16;
|
|
512
|
+
} else t16 = $[10];
|
|
513
|
+
const getOptionLabel = t16;
|
|
408
514
|
const getTagLabel = (key_1) => textLabel(tagProps?.(key_1)?.children) ?? getOptionLabel(key_1);
|
|
409
515
|
const isTagLocked = (key_2) => !!tagProps?.(key_2)?.isDisabled;
|
|
410
516
|
const disabledKeySet = new Set([...disabledKeys ?? []].map(String));
|
|
411
|
-
let
|
|
517
|
+
let t17;
|
|
412
518
|
if ($[11] !== getOption || $[12] !== knownLabels) {
|
|
413
|
-
|
|
519
|
+
t17 = (keys) => {
|
|
414
520
|
let next = null;
|
|
415
521
|
for (const key_3 of keys) {
|
|
416
522
|
const label_0 = getOption(key_3)?.textValue;
|
|
@@ -423,9 +529,9 @@ function TagInput(props, ref) {
|
|
|
423
529
|
};
|
|
424
530
|
$[11] = getOption;
|
|
425
531
|
$[12] = knownLabels;
|
|
426
|
-
$[13] =
|
|
427
|
-
} else
|
|
428
|
-
const rememberLabels = useEvent(
|
|
532
|
+
$[13] = t17;
|
|
533
|
+
} else t17 = $[13];
|
|
534
|
+
const rememberLabels = useEvent(t17);
|
|
429
535
|
const findOptionKey = (text) => {
|
|
430
536
|
if (!hasOptions) return null;
|
|
431
537
|
const match = matchOptionText(collection, text);
|
|
@@ -443,8 +549,8 @@ function TagInput(props, ref) {
|
|
|
443
549
|
typed
|
|
444
550
|
};
|
|
445
551
|
};
|
|
446
|
-
const resolvePart = (part,
|
|
447
|
-
const source =
|
|
552
|
+
const resolvePart = (part, t18) => {
|
|
553
|
+
const source = t18 === void 0 ? "text" : t18;
|
|
448
554
|
if (source === "text") return resolveTypedText(part);
|
|
449
555
|
if (source === "option") return {
|
|
450
556
|
optionKey: part,
|
|
@@ -462,12 +568,12 @@ function TagInput(props, ref) {
|
|
|
462
568
|
};
|
|
463
569
|
const visibleOptionKeys = [];
|
|
464
570
|
if (hasOptions) collectVisibleKeys(optionFilterFn(collection), visibleOptionKeys, disabledKeys ? new Set(disabledKeys) : void 0);
|
|
465
|
-
let
|
|
571
|
+
let t19;
|
|
466
572
|
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
467
|
-
|
|
468
|
-
$[14] =
|
|
469
|
-
} else
|
|
470
|
-
const [unpickedCustomValues, setUnpickedCustomValues] = useState(
|
|
573
|
+
t19 = [];
|
|
574
|
+
$[14] = t19;
|
|
575
|
+
} else t19 = $[14];
|
|
576
|
+
const [unpickedCustomValues, setUnpickedCustomValues] = useState(t19);
|
|
471
577
|
const { keys: customValueKeys, visibleKeys: visibleCustomKeys, typedKey: customTerm } = hasOptions && allowsCustomValue ? getCustomRows({
|
|
472
578
|
values: uniqueValues,
|
|
473
579
|
unpicked: unpickedCustomValues,
|
|
@@ -489,7 +595,12 @@ function TagInput(props, ref) {
|
|
|
489
595
|
const visibleOptionsSignature = [...visibleOptionKeys, ...visibleCustomKeys].join("\0");
|
|
490
596
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
491
597
|
const isInteractive = !isDisabled && !isReadOnly;
|
|
492
|
-
const shouldShowPopover = hasOptions && isInteractive &&
|
|
598
|
+
const shouldShowPopover = hasOptions && isInteractive && isListShown({
|
|
599
|
+
isOpen: isPopoverOpen,
|
|
600
|
+
hasResults,
|
|
601
|
+
term,
|
|
602
|
+
isLoading
|
|
603
|
+
});
|
|
493
604
|
const notifiedOpenRef = useRef(false);
|
|
494
605
|
useEffect(() => {
|
|
495
606
|
if (notifiedOpenRef.current === shouldShowPopover) return;
|
|
@@ -514,27 +625,27 @@ function TagInput(props, ref) {
|
|
|
514
625
|
preferredOptionKey
|
|
515
626
|
});
|
|
516
627
|
const activeOptionKey = activeOption?.key ?? null;
|
|
517
|
-
let
|
|
628
|
+
let t20;
|
|
518
629
|
if ($[15] !== setDraftState) {
|
|
519
|
-
|
|
630
|
+
t20 = (next_0) => {
|
|
520
631
|
setDraftState(next_0);
|
|
521
632
|
setIsFilterActive(!!next_0.trim());
|
|
522
633
|
};
|
|
523
634
|
$[15] = setDraftState;
|
|
524
|
-
$[16] =
|
|
525
|
-
} else
|
|
526
|
-
const setDraft = useEvent(
|
|
527
|
-
let
|
|
635
|
+
$[16] = t20;
|
|
636
|
+
} else t20 = $[16];
|
|
637
|
+
const setDraft = useEvent(t20);
|
|
638
|
+
let t21;
|
|
528
639
|
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
529
|
-
|
|
640
|
+
t21 = (text_1) => {
|
|
530
641
|
setAnnouncement((prev) => ({
|
|
531
642
|
id: prev.id + 1,
|
|
532
643
|
text: text_1
|
|
533
644
|
}));
|
|
534
645
|
};
|
|
535
|
-
$[17] =
|
|
536
|
-
} else
|
|
537
|
-
const announce = useEvent(
|
|
646
|
+
$[17] = t21;
|
|
647
|
+
} else t21 = $[17];
|
|
648
|
+
const announce = useEvent(t21);
|
|
538
649
|
const rejectionMessage = useEvent((rejection) => {
|
|
539
650
|
if (rejection.message) return rejection.message;
|
|
540
651
|
switch (rejection.reason) {
|
|
@@ -594,15 +705,15 @@ function TagInput(props, ref) {
|
|
|
594
705
|
setDraft(rest);
|
|
595
706
|
return rest;
|
|
596
707
|
});
|
|
597
|
-
let
|
|
708
|
+
let t22;
|
|
598
709
|
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
599
|
-
|
|
710
|
+
t22 = () => {
|
|
600
711
|
const rows = tagListRef.current?.querySelectorAll("[role=\"row\"]:not([aria-disabled=\"true\"])");
|
|
601
712
|
rows?.[rows.length - 1]?.focus();
|
|
602
713
|
};
|
|
603
|
-
$[18] =
|
|
604
|
-
} else
|
|
605
|
-
const focusLastTag = useEvent(
|
|
714
|
+
$[18] = t22;
|
|
715
|
+
} else t22 = $[18];
|
|
716
|
+
const focusLastTag = useEvent(t22);
|
|
606
717
|
const removeValues = useEvent((requested) => {
|
|
607
718
|
const keys_0 = requested.filter((key_4) => !isTagLocked(key_4));
|
|
608
719
|
if (!keys_0.length) return;
|
|
@@ -643,7 +754,7 @@ function TagInput(props, ref) {
|
|
|
643
754
|
const handleArrowKey = useEvent((e) => {
|
|
644
755
|
if (!hasOptions) return;
|
|
645
756
|
e.preventDefault();
|
|
646
|
-
if (!shouldShowPopover) {
|
|
757
|
+
if (!shouldShowPopover || !hasResults) {
|
|
647
758
|
if (!hasResults) setIsFilterActive(false);
|
|
648
759
|
setIsPopoverOpen(true);
|
|
649
760
|
return;
|
|
@@ -656,9 +767,9 @@ function TagInput(props, ref) {
|
|
|
656
767
|
const listState_0 = listStateRef.current;
|
|
657
768
|
if (listState_0) moveVirtualFocus(getEdgeVisibleKey(listState_0, e_0.key === "Home" ? "first" : "last"), "user", term);
|
|
658
769
|
});
|
|
659
|
-
let
|
|
770
|
+
let t23;
|
|
660
771
|
if ($[19] !== focusLastTag) {
|
|
661
|
-
|
|
772
|
+
t23 = (e_1) => {
|
|
662
773
|
if (isComposingKey(e_1)) return;
|
|
663
774
|
e_1.preventDefault();
|
|
664
775
|
if (e_1.repeat) return;
|
|
@@ -666,9 +777,9 @@ function TagInput(props, ref) {
|
|
|
666
777
|
focusLastTag();
|
|
667
778
|
};
|
|
668
779
|
$[19] = focusLastTag;
|
|
669
|
-
$[20] =
|
|
670
|
-
} else
|
|
671
|
-
const
|
|
780
|
+
$[20] = t23;
|
|
781
|
+
} else t23 = $[20];
|
|
782
|
+
const handleToTagsKey = useEvent(t23);
|
|
672
783
|
const handleEnterKey = useEvent((e_2) => {
|
|
673
784
|
if (isComposingKey(e_2)) return;
|
|
674
785
|
const isCurrent = activeOption != null && activeOption.term === term;
|
|
@@ -699,36 +810,26 @@ function TagInput(props, ref) {
|
|
|
699
810
|
const rejected_0 = commitParts(splitTagText(draft.slice(0, start), delimiters));
|
|
700
811
|
setDraft([rejected_0, draft.slice(end).trimStart()].filter(Boolean).join(joiner));
|
|
701
812
|
});
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
}
|
|
717
|
-
};
|
|
718
|
-
$[21] = draft;
|
|
719
|
-
$[22] = setDraft;
|
|
720
|
-
$[23] = setTagError;
|
|
721
|
-
$[24] = shouldShowPopover;
|
|
722
|
-
$[25] = tagError;
|
|
723
|
-
$[26] = t23;
|
|
724
|
-
} else t23 = $[26];
|
|
725
|
-
const handleEscapeKey = useEvent(t23);
|
|
813
|
+
const handleEscapeKey = useEvent((e_4) => {
|
|
814
|
+
if (shouldShowPopover) {
|
|
815
|
+
e_4.preventDefault();
|
|
816
|
+
e_4.stopPropagation();
|
|
817
|
+
setIsPopoverOpen(false);
|
|
818
|
+
setTagError(null);
|
|
819
|
+
} else if (draft || tagError) {
|
|
820
|
+
e_4.preventDefault();
|
|
821
|
+
e_4.stopPropagation();
|
|
822
|
+
setDraft("");
|
|
823
|
+
setTagError(null);
|
|
824
|
+
setIsPopoverOpen(false);
|
|
825
|
+
}
|
|
826
|
+
});
|
|
726
827
|
const handleKeyDown = useEvent((e_5) => {
|
|
727
828
|
onKeyDown?.(e_5);
|
|
728
829
|
if (!e_5.defaultPrevented && isInteractive) {
|
|
729
830
|
if (e_5.key === "ArrowDown" || e_5.key === "ArrowUp") handleArrowKey(e_5);
|
|
730
831
|
else if ((e_5.key === "Home" || e_5.key === "End") && shouldShowPopover) handleEdgeKey(e_5);
|
|
731
|
-
else if (e_5.key === "Backspace"
|
|
832
|
+
else if ((e_5.key === "Backspace" ? !draft : tagPlacement === "inside" && isArrowPastStart(e_5, textDirection)) && uniqueValues.some((value_4) => !isTagLocked(value_4))) handleToTagsKey(e_5);
|
|
732
833
|
else if (e_5.key === "Enter") handleEnterKey(e_5);
|
|
733
834
|
else if (delimiters.includes(e_5.key)) handleDelimiterKey(e_5);
|
|
734
835
|
else if (e_5.key === "Escape") handleEscapeKey(e_5);
|
|
@@ -793,23 +894,43 @@ function TagInput(props, ref) {
|
|
|
793
894
|
isDisabled
|
|
794
895
|
});
|
|
795
896
|
let t25;
|
|
796
|
-
if ($[
|
|
897
|
+
if ($[21] !== rootRef || $[22] !== settleDraft) {
|
|
797
898
|
t25 = (e_7) => {
|
|
798
899
|
const isTabbing = isTabbingRef.current;
|
|
799
900
|
const next_4 = e_7.relatedTarget;
|
|
800
901
|
isTabbingRef.current = false;
|
|
801
|
-
if (!
|
|
902
|
+
if (!next_4 || !rootRef.current?.contains(next_4)) return;
|
|
903
|
+
if (!isTabbing && !tagListRef.current?.contains(next_4)) return;
|
|
802
904
|
setIsPopoverOpen(false);
|
|
803
|
-
settleDraft();
|
|
905
|
+
if (isTabbing) settleDraft();
|
|
804
906
|
};
|
|
805
|
-
$[
|
|
806
|
-
$[
|
|
807
|
-
$[
|
|
808
|
-
} else t25 = $[
|
|
907
|
+
$[21] = rootRef;
|
|
908
|
+
$[22] = settleDraft;
|
|
909
|
+
$[23] = t25;
|
|
910
|
+
} else t25 = $[23];
|
|
809
911
|
const handleInputBlur = useEvent(t25);
|
|
810
912
|
const handleInputFocus = useEvent(() => {
|
|
811
913
|
if (hasOptions && popoverTrigger === "focus" && isInteractive) setIsPopoverOpen(true);
|
|
812
914
|
});
|
|
915
|
+
const pressStartedInBoxRef = useRef(false);
|
|
916
|
+
let t26;
|
|
917
|
+
if ($[24] !== inputRef) {
|
|
918
|
+
t26 = (e_8) => {
|
|
919
|
+
const box = e_8.currentTarget;
|
|
920
|
+
const target = e_8.target;
|
|
921
|
+
const interactive = target.closest(INTERACTIVE_ELEMENTS);
|
|
922
|
+
pressStartedInBoxRef.current = box.contains(target) && (!interactive || interactive === inputRef.current || !box.contains(interactive));
|
|
923
|
+
};
|
|
924
|
+
$[24] = inputRef;
|
|
925
|
+
$[25] = t26;
|
|
926
|
+
} else t26 = $[25];
|
|
927
|
+
const handleBoxPointerDown = t26;
|
|
928
|
+
const handleBoxClick = () => {
|
|
929
|
+
const isBoxPress = pressStartedInBoxRef.current;
|
|
930
|
+
pressStartedInBoxRef.current = false;
|
|
931
|
+
if (!isBoxPress || popoverTrigger === "manual") return;
|
|
932
|
+
if (hasOptions && isInteractive && !shouldShowPopover && hasResults) setIsPopoverOpen(true);
|
|
933
|
+
};
|
|
813
934
|
const tags = uniqueValues.map((value_5) => {
|
|
814
935
|
const ownProps = tagProps?.(value_5);
|
|
815
936
|
const result = !(getOption(value_5) != null || knownLabels.has(value_5)) && validateTag ? validateTag(value_5) : true;
|
|
@@ -832,7 +953,7 @@ function TagInput(props, ref) {
|
|
|
832
953
|
id,
|
|
833
954
|
label,
|
|
834
955
|
value: draft,
|
|
835
|
-
placeholder,
|
|
956
|
+
placeholder: shownPlaceholder(placeholder, hidePlaceholderWithTags, tags.length),
|
|
836
957
|
isDisabled,
|
|
837
958
|
isReadOnly,
|
|
838
959
|
isRequired,
|
|
@@ -856,20 +977,12 @@ function TagInput(props, ref) {
|
|
|
856
977
|
"data-input-type": "taginput",
|
|
857
978
|
"aria-describedby": describedBy.join(" ") || void 0
|
|
858
979
|
}, hasOptions ? getComboboxProps(listBoxId, shouldShowPopover, activeOptionKey) : void 0);
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
inputRef.current?.focus();
|
|
866
|
-
};
|
|
867
|
-
$[30] = hasResults;
|
|
868
|
-
$[31] = inputRef;
|
|
869
|
-
$[32] = shouldShowPopover;
|
|
870
|
-
$[33] = t26;
|
|
871
|
-
} else t26 = $[33];
|
|
872
|
-
const handleTriggerPress = useEvent(t26);
|
|
980
|
+
const handleTriggerPress = useEvent(() => {
|
|
981
|
+
const willOpen = !shouldShowPopover;
|
|
982
|
+
inputRef.current?.focus();
|
|
983
|
+
if (willOpen && !hasResults) setIsFilterActive(false);
|
|
984
|
+
setIsPopoverOpen(willOpen);
|
|
985
|
+
});
|
|
873
986
|
const trigger = hasOptions && !hideTrigger ? /* @__PURE__ */ jsx(TagInputTrigger, {
|
|
874
987
|
id: triggerId,
|
|
875
988
|
size,
|
|
@@ -877,74 +990,108 @@ function TagInput(props, ref) {
|
|
|
877
990
|
fieldLabelledby,
|
|
878
991
|
isOpen: shouldShowPopover,
|
|
879
992
|
isDisabled: !isInteractive,
|
|
993
|
+
isLoading,
|
|
880
994
|
styles: triggerStyles,
|
|
881
995
|
onPress: handleTriggerPress
|
|
882
996
|
}) : null;
|
|
883
|
-
const
|
|
997
|
+
const clearAll = useEvent(() => {
|
|
884
998
|
inputRef.current?.focus();
|
|
885
999
|
setDraft("");
|
|
886
|
-
setTagError(null);
|
|
887
1000
|
setIsPopoverOpen(false);
|
|
1001
|
+
removeValues(uniqueValues);
|
|
1002
|
+
setTagError(null);
|
|
888
1003
|
onClear?.();
|
|
889
1004
|
});
|
|
890
|
-
const clearButton = !!isClearable && isInteractive && draft !== "" ? /* @__PURE__ */ jsx(TagInputClearButton, {
|
|
1005
|
+
const clearButton = !!isClearable && isInteractive && (draft !== "" || hasRemovableTags) ? /* @__PURE__ */ jsx(TagInputClearButton, {
|
|
891
1006
|
id: clearId,
|
|
892
1007
|
size,
|
|
893
1008
|
ariaLabel,
|
|
894
1009
|
fieldLabelledby,
|
|
895
|
-
onPress:
|
|
1010
|
+
onPress: clearAll
|
|
896
1011
|
}) : null;
|
|
897
1012
|
const hasActions = clearButton != null || trigger != null;
|
|
1013
|
+
useSuffixSpace(wrapperRef, tagPlacement === "inside");
|
|
1014
|
+
const partStyles = getPlacementStyles(tagPlacement, {
|
|
1015
|
+
wrapper: wrapperStyles,
|
|
1016
|
+
input: inputStyles,
|
|
1017
|
+
tagList: tagListStyles,
|
|
1018
|
+
tag: tagStyles
|
|
1019
|
+
});
|
|
1020
|
+
const placed = placeTagList(tagPlacement, prefix, tags.length ? /* @__PURE__ */ jsx(TagList, {
|
|
1021
|
+
id: tagListId,
|
|
1022
|
+
listRef: tagListRef,
|
|
1023
|
+
inputRef,
|
|
1024
|
+
"aria-label": ariaLabel ? t("tagInput.selectedValuesFor", "Selected values, {{label}}", { label: ariaLabel }) : t("tagInput.selectedValues", "Selected values"),
|
|
1025
|
+
"aria-labelledby": fieldLabelledby,
|
|
1026
|
+
tags,
|
|
1027
|
+
size: TAG_SIZES[size] ?? "xsmall",
|
|
1028
|
+
isDisabled,
|
|
1029
|
+
isReadOnly,
|
|
1030
|
+
isInline: tagPlacement === "inside",
|
|
1031
|
+
styles: partStyles.tagList,
|
|
1032
|
+
tagStyles: partStyles.tag,
|
|
1033
|
+
onRemove: removeValues
|
|
1034
|
+
}) : null);
|
|
898
1035
|
let t27;
|
|
899
|
-
if ($[
|
|
900
|
-
t27 =
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
$[
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1036
|
+
if ($[26] !== handleBoxClick || $[27] !== handleBoxPointerDown) {
|
|
1037
|
+
t27 = {
|
|
1038
|
+
onPointerDown: handleBoxPointerDown,
|
|
1039
|
+
onClick: handleBoxClick
|
|
1040
|
+
};
|
|
1041
|
+
$[26] = handleBoxClick;
|
|
1042
|
+
$[27] = handleBoxPointerDown;
|
|
1043
|
+
$[28] = t27;
|
|
1044
|
+
} else t27 = $[28];
|
|
1045
|
+
let t28;
|
|
1046
|
+
if ($[29] !== clearButton || $[30] !== hasActions || $[31] !== trigger) {
|
|
1047
|
+
t28 = hasActions ? /* @__PURE__ */ jsxs(Fragment$1, { children: [clearButton, trigger] }) : null;
|
|
1048
|
+
$[29] = clearButton;
|
|
1049
|
+
$[30] = hasActions;
|
|
1050
|
+
$[31] = trigger;
|
|
1051
|
+
$[32] = t28;
|
|
1052
|
+
} else t28 = $[32];
|
|
1053
|
+
const t29 = tags.length ? t("tagInput.summary", "Selected: {{values}}.", { values: formatList(tags.map(_temp1)) }) : null;
|
|
1054
|
+
let t30;
|
|
1055
|
+
if ($[33] !== summaryId || $[34] !== t29) {
|
|
1056
|
+
t30 = /* @__PURE__ */ jsx("span", {
|
|
910
1057
|
hidden: true,
|
|
911
1058
|
id: summaryId,
|
|
912
|
-
children:
|
|
1059
|
+
children: t29
|
|
913
1060
|
});
|
|
914
|
-
$[
|
|
915
|
-
$[
|
|
916
|
-
$[
|
|
917
|
-
} else
|
|
918
|
-
let t30;
|
|
919
|
-
if ($[41] !== hasBackspaceHint || $[42] !== t) {
|
|
920
|
-
t30 = hasBackspaceHint ? t("tagInput.backspaceHint", "Press Backspace to go to the selected values.") : null;
|
|
921
|
-
$[41] = hasBackspaceHint;
|
|
922
|
-
$[42] = t;
|
|
923
|
-
$[43] = t30;
|
|
924
|
-
} else t30 = $[43];
|
|
1061
|
+
$[33] = summaryId;
|
|
1062
|
+
$[34] = t29;
|
|
1063
|
+
$[35] = t30;
|
|
1064
|
+
} else t30 = $[35];
|
|
925
1065
|
let t31;
|
|
926
|
-
if ($[
|
|
927
|
-
t31 =
|
|
1066
|
+
if ($[36] !== hasBackspaceHint || $[37] !== t) {
|
|
1067
|
+
t31 = hasBackspaceHint ? t("tagInput.backspaceHint", "Press Backspace to go to the selected values.") : null;
|
|
1068
|
+
$[36] = hasBackspaceHint;
|
|
1069
|
+
$[37] = t;
|
|
1070
|
+
$[38] = t31;
|
|
1071
|
+
} else t31 = $[38];
|
|
1072
|
+
let t32;
|
|
1073
|
+
if ($[39] !== hintId || $[40] !== t31) {
|
|
1074
|
+
t32 = /* @__PURE__ */ jsx("span", {
|
|
928
1075
|
hidden: true,
|
|
929
1076
|
id: hintId,
|
|
930
|
-
children:
|
|
1077
|
+
children: t31
|
|
931
1078
|
});
|
|
932
|
-
$[
|
|
933
|
-
$[
|
|
934
|
-
$[
|
|
935
|
-
} else
|
|
936
|
-
let
|
|
937
|
-
if ($[
|
|
938
|
-
|
|
1079
|
+
$[39] = hintId;
|
|
1080
|
+
$[40] = t31;
|
|
1081
|
+
$[41] = t32;
|
|
1082
|
+
} else t32 = $[41];
|
|
1083
|
+
let t33;
|
|
1084
|
+
if ($[42] !== announcement.id || $[43] !== announcement.text) {
|
|
1085
|
+
t33 = /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
939
1086
|
role: "status",
|
|
940
1087
|
"aria-live": "polite",
|
|
941
1088
|
"aria-atomic": "true",
|
|
942
1089
|
children: /* @__PURE__ */ jsx("span", { children: announcement.text }, announcement.id)
|
|
943
1090
|
});
|
|
944
|
-
$[
|
|
945
|
-
$[
|
|
946
|
-
$[
|
|
947
|
-
} else
|
|
1091
|
+
$[42] = announcement.id;
|
|
1092
|
+
$[43] = announcement.text;
|
|
1093
|
+
$[44] = t33;
|
|
1094
|
+
} else t33 = $[44];
|
|
948
1095
|
const tagInputField = /* @__PURE__ */ jsxs(TagInputElement, {
|
|
949
1096
|
ref: rootRef,
|
|
950
1097
|
...pickBaseCustomizationProps(props),
|
|
@@ -957,13 +1104,14 @@ function TagInput(props, ref) {
|
|
|
957
1104
|
qa: qa || "TagInput",
|
|
958
1105
|
inputRef,
|
|
959
1106
|
wrapperRef,
|
|
1107
|
+
wrapperProps: t27,
|
|
960
1108
|
inputProps: tagInputProps,
|
|
961
1109
|
mods,
|
|
962
1110
|
icon,
|
|
963
|
-
prefix,
|
|
1111
|
+
prefix: placed.prefix,
|
|
964
1112
|
suffix,
|
|
965
1113
|
suffixPosition,
|
|
966
|
-
actions:
|
|
1114
|
+
actions: t28,
|
|
967
1115
|
size,
|
|
968
1116
|
autoFocus,
|
|
969
1117
|
isDisabled,
|
|
@@ -971,26 +1119,13 @@ function TagInput(props, ref) {
|
|
|
971
1119
|
isLoading,
|
|
972
1120
|
isInvalid: effectiveIsInvalid,
|
|
973
1121
|
isValid,
|
|
974
|
-
styles:
|
|
975
|
-
inputStyles
|
|
1122
|
+
styles: partStyles.wrapper,
|
|
1123
|
+
inputStyles: partStyles.input
|
|
976
1124
|
}),
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
listRef: tagListRef,
|
|
980
|
-
inputRef,
|
|
981
|
-
"aria-label": ariaLabel ? t("tagInput.selectedValuesFor", "Selected values, {{label}}", { label: ariaLabel }) : t("tagInput.selectedValues", "Selected values"),
|
|
982
|
-
"aria-labelledby": fieldLabelledby,
|
|
983
|
-
tags,
|
|
984
|
-
size: TAG_SIZES[size] ?? "xsmall",
|
|
985
|
-
isDisabled,
|
|
986
|
-
isReadOnly,
|
|
987
|
-
styles: tagListStyles,
|
|
988
|
-
tagStyles,
|
|
989
|
-
onRemove: removeValues
|
|
990
|
-
}) : null,
|
|
991
|
-
t29,
|
|
992
|
-
t31,
|
|
1125
|
+
placed.below,
|
|
1126
|
+
t30,
|
|
993
1127
|
t32,
|
|
1128
|
+
t33,
|
|
994
1129
|
hasOptions ? /* @__PURE__ */ jsx(ListBoxPopover, {
|
|
995
1130
|
isOpen: shouldShowPopover,
|
|
996
1131
|
triggerRef: wrapperRef,
|
|
@@ -1006,6 +1141,7 @@ function TagInput(props, ref) {
|
|
|
1006
1141
|
listBoxStyles,
|
|
1007
1142
|
optionStyles,
|
|
1008
1143
|
optionHighlight: isFilterActive ? term : void 0,
|
|
1144
|
+
emptyLabel: resolveEmptyLabel(emptyLabel, isLoading, t),
|
|
1009
1145
|
sectionStyles,
|
|
1010
1146
|
headingStyles,
|
|
1011
1147
|
listGap,
|