@cube-dev/ui-kit 0.190.1 → 0.190.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +12 -0
- 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.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/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.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.d.ts +2 -1
- package/dist/components/content/Item/Item.js +393 -334
- package/dist/components/content/Item/Item.js.map +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/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.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +200 -133
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +439 -352
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +97 -0
- package/dist/components/data/ItemTable/use-item-table-column-widths.js.map +1 -0
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +144 -0
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js.map +1 -0
- package/dist/components/data/ItemTable/use-item-table-pagination.js +143 -0
- package/dist/components/data/ItemTable/use-item-table-pagination.js.map +1 -0
- package/dist/components/data/ItemTable/use-item-table-selection.js +141 -0
- package/dist/components/data/ItemTable/use-item-table-selection.js.map +1 -0
- package/dist/components/data/ItemTable/use-item-table-sort.js +135 -0
- package/dist/components/data/ItemTable/use-item-table-sort.js.map +1 -0
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +107 -0
- package/dist/components/data/ItemTable/use-item-table-tree-model.js.map +1 -0
- 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 +96 -297
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +142 -0
- package/dist/components/data/TableBase/TreeGridTable.js.map +1 -0
- package/dist/components/data/TableBase/column-header.js +94 -0
- package/dist/components/data/TableBase/column-header.js.map +1 -0
- 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 +3 -2
- package/dist/components/data/TableBase/styled.js.map +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 +166 -0
- package/dist/components/data/TableBase/use-column-menu.js.map +1 -0
- package/dist/components/data/TableBase/use-column-order.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-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/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.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/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/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.js +768 -723
- 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 +122 -0
- package/dist/components/fields/TagInput/useActiveOption.js.map +1 -0
- package/dist/components/fields/TagInput/useTagError.js +95 -0
- package/dist/components/fields/TagInput/useTagError.js.map +1 -0
- 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 +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/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/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/Board/Board.js +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision-modes.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/placement.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.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 +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/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 +7 -1
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.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/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/navigationAdapter.default.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/escapePropagation.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/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/content/Item.md +7 -2
- package/docs/components/overlays/Tooltip.md +1 -1
- package/package.json +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.190.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.190.3 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
@@ -14,20 +14,28 @@ import { castNullableArrayValue } from "../../../utils/react/nullableValue.js";
|
|
|
14
14
|
import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
|
|
15
15
|
import { wrapWithField } from "../../form/wrapper.js";
|
|
16
16
|
import { getListBoxOptionId } from "../ListBox/optionId.js";
|
|
17
|
-
import { collectVisibleKeys, filterCollectionNodes, getEdgeVisibleKey, getNextVisibleKey
|
|
17
|
+
import { collectVisibleKeys, filterCollectionNodes, getEdgeVisibleKey, getNextVisibleKey } from "../ListBoxPopover/listNavigation.js";
|
|
18
18
|
import { TextInputBase } from "../TextInput/TextInputBase.js";
|
|
19
19
|
import { ListBoxPopover } from "../ListBoxPopover/ListBoxPopover.js";
|
|
20
20
|
import { useCompositeFocus } from "../ListBoxPopover/useCompositeFocus.js";
|
|
21
21
|
import { TagList } from "./TagList.js";
|
|
22
|
+
import { useActiveOption } from "./useActiveOption.js";
|
|
23
|
+
import { useTagError } from "./useTagError.js";
|
|
22
24
|
import { c } from "react-compiler-runtime";
|
|
23
25
|
import { CONTAINER_STYLES, tasty } from "@tenphi/tasty";
|
|
24
|
-
import { cloneElement, forwardRef, isValidElement, useEffect,
|
|
26
|
+
import { cloneElement, forwardRef, isValidElement, useEffect, useRef, useState } from "react";
|
|
25
27
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
26
28
|
import { VisuallyHidden, useFilter, useId as useId$1, useTextField } from "react-aria";
|
|
27
29
|
import { Section, useListState } from "react-stately";
|
|
28
30
|
import { useControlledState } from "@react-stately/utils";
|
|
29
31
|
|
|
30
32
|
//#region src/components/fields/TagInput/TagInput.tsx
|
|
33
|
+
/**
|
|
34
|
+
* `filter={false}`: the options come filtered already, as from a server.
|
|
35
|
+
* Named rather than inline in the ternary that picks it: SonarJS charges a
|
|
36
|
+
* function in a ternary branch to every later line of the component.
|
|
37
|
+
*/
|
|
38
|
+
const showEveryOption = () => true;
|
|
31
39
|
const TagInputElement = tasty({
|
|
32
40
|
qa: "TagInputContainer",
|
|
33
41
|
styles: {
|
|
@@ -121,11 +129,180 @@ function withCustomOptions(children, { customKeys, customTerm, hasOptionRows, ha
|
|
|
121
129
|
children
|
|
122
130
|
}, "__options__"), customSection];
|
|
123
131
|
}
|
|
132
|
+
const NO_CUSTOM_ROWS = {
|
|
133
|
+
keys: [],
|
|
134
|
+
visibleKeys: [],
|
|
135
|
+
typedKey: null
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* The rows listed after the options: the user's own values, so they can be
|
|
139
|
+
* unpicked where they were picked, and the typed text. `unpicked` holds the
|
|
140
|
+
* custom values unpicked during this visit, which stay listed.
|
|
141
|
+
*/
|
|
142
|
+
function getCustomRows({ values, unpicked, isOption, term, isFiltering, matches, termOptionKey }) {
|
|
143
|
+
const keys = [...new Set([...values, ...unpicked].filter((value) => !isOption(value)))].sort(compareText);
|
|
144
|
+
return {
|
|
145
|
+
keys,
|
|
146
|
+
visibleKeys: isFiltering && term ? keys.filter((key) => matches(key, term)) : keys,
|
|
147
|
+
typedKey: term && termOptionKey == null && !values.includes(term) && !keys.includes(term) ? term : null
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The row the typed text names: the option it stands for, or else a custom
|
|
152
|
+
* value it spells. Text that names a row only in another case is a value of
|
|
153
|
+
* its own, so its own row wins over that one: Enter adds `paris` as typed, not
|
|
154
|
+
* `Paris`.
|
|
155
|
+
*/
|
|
156
|
+
function getExactRowKey(collection, { term, termOptionKey, customTerm, customValueKeys }) {
|
|
157
|
+
if (termOptionKey != null) return termOptionKey;
|
|
158
|
+
if (term && customValueKeys.includes(term)) return term;
|
|
159
|
+
if (customTerm && (matchOptionText(collection, customTerm).loose != null || customValueKeys.some((key) => isSameText(key, customTerm)))) return customTerm;
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The row the focus pass lands on, and Enter with it. The row the typed text
|
|
164
|
+
* names wins over the first match, so typing "build" and pressing Enter picks
|
|
165
|
+
* "build", not "rebuild". Typed text means "add", so past an exact match the
|
|
166
|
+
* first row that is not added yet wins: typing "def" next to a picked
|
|
167
|
+
* "undefined" lands on "def".
|
|
168
|
+
*/
|
|
169
|
+
function getPreferredRowKey(rows, exactKey, term, values) {
|
|
170
|
+
if (exactKey != null && rows.includes(exactKey)) return exactKey;
|
|
171
|
+
return (term ? rows.find((key) => !values.includes(String(key))) : void 0) ?? rows[0] ?? null;
|
|
172
|
+
}
|
|
124
173
|
function isComposingKey(e) {
|
|
125
174
|
return e.nativeEvent.isComposing || e.keyCode === 229;
|
|
126
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Why a value is refused, or `null` when it may be added. `optionKey` is the
|
|
178
|
+
* option the part resolved to, if any: an option is not validated. `present`
|
|
179
|
+
* holds the values already there, the ones this commit accepted so far among
|
|
180
|
+
* them.
|
|
181
|
+
*/
|
|
182
|
+
function getRejection(value, optionKey, present, { disabledKeys, isOptionOnly, maxTags, validateTag }) {
|
|
183
|
+
if (optionKey != null && disabledKeys.has(optionKey)) return { reason: "unavailable" };
|
|
184
|
+
if (optionKey == null && isOptionOnly) return { reason: "unknown" };
|
|
185
|
+
if (present.has(value)) return { reason: "duplicate" };
|
|
186
|
+
if (maxTags != null && present.size >= maxTags) return { reason: "limit" };
|
|
187
|
+
if (optionKey == null && validateTag) {
|
|
188
|
+
const result = validateTag(value);
|
|
189
|
+
if (result === false || typeof result === "string") return {
|
|
190
|
+
reason: "invalid",
|
|
191
|
+
message: typeof result === "string" ? result : void 0
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
/** The input's combobox wiring, for a field with options to suggest. */
|
|
197
|
+
function getComboboxProps(listBoxId, isOpen, activeKey) {
|
|
198
|
+
return {
|
|
199
|
+
role: "combobox",
|
|
200
|
+
"aria-autocomplete": "list",
|
|
201
|
+
"aria-haspopup": "listbox",
|
|
202
|
+
"aria-expanded": isOpen,
|
|
203
|
+
"aria-controls": isOpen ? listBoxId : void 0,
|
|
204
|
+
"aria-activedescendant": isOpen && activeKey != null ? getListBoxOptionId(listBoxId, activeKey) : void 0
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/** The button in the input that toggles the suggestions popover. */
|
|
208
|
+
function TagInputTrigger(t0) {
|
|
209
|
+
const $ = c(18);
|
|
210
|
+
const { id, size, ariaLabel, fieldLabelledby, onPress, isOpen, isDisabled, styles } = t0;
|
|
211
|
+
const { t } = useI18n();
|
|
212
|
+
const t1 = isOpen ? "up" : "down";
|
|
213
|
+
let t2;
|
|
214
|
+
if ($[0] !== t1) {
|
|
215
|
+
t2 = /* @__PURE__ */ jsx(DirectionIcon, { to: t1 });
|
|
216
|
+
$[0] = t1;
|
|
217
|
+
$[1] = t2;
|
|
218
|
+
} else t2 = $[1];
|
|
219
|
+
let t3;
|
|
220
|
+
if ($[2] !== isOpen) {
|
|
221
|
+
t3 = { pressed: isOpen };
|
|
222
|
+
$[2] = isOpen;
|
|
223
|
+
$[3] = t3;
|
|
224
|
+
} else t3 = $[3];
|
|
225
|
+
let t4;
|
|
226
|
+
if ($[4] !== ariaLabel || $[5] !== t) {
|
|
227
|
+
t4 = ariaLabel ? t("tagInput.showOptionsFor", "Show options, {{label}}", { label: ariaLabel }) : t("tagInput.showOptions", "Show options");
|
|
228
|
+
$[4] = ariaLabel;
|
|
229
|
+
$[5] = t;
|
|
230
|
+
$[6] = t4;
|
|
231
|
+
} else t4 = $[6];
|
|
232
|
+
const t5 = fieldLabelledby ? `${id} ${fieldLabelledby}` : void 0;
|
|
233
|
+
let t6;
|
|
234
|
+
if ($[7] !== id || $[8] !== isDisabled || $[9] !== isOpen || $[10] !== onPress || $[11] !== size || $[12] !== styles || $[13] !== t2 || $[14] !== t3 || $[15] !== t4 || $[16] !== t5) {
|
|
235
|
+
t6 = /* @__PURE__ */ jsx(ItemAction, {
|
|
236
|
+
"data-popover-trigger": true,
|
|
237
|
+
id,
|
|
238
|
+
qa: "TagInputTrigger",
|
|
239
|
+
icon: t2,
|
|
240
|
+
size,
|
|
241
|
+
isDisabled,
|
|
242
|
+
styles,
|
|
243
|
+
mods: t3,
|
|
244
|
+
tabIndex: -1,
|
|
245
|
+
"aria-expanded": isOpen,
|
|
246
|
+
"aria-haspopup": "listbox",
|
|
247
|
+
"aria-label": t4,
|
|
248
|
+
"aria-labelledby": t5,
|
|
249
|
+
onPress
|
|
250
|
+
});
|
|
251
|
+
$[7] = id;
|
|
252
|
+
$[8] = isDisabled;
|
|
253
|
+
$[9] = isOpen;
|
|
254
|
+
$[10] = onPress;
|
|
255
|
+
$[11] = size;
|
|
256
|
+
$[12] = styles;
|
|
257
|
+
$[13] = t2;
|
|
258
|
+
$[14] = t3;
|
|
259
|
+
$[15] = t4;
|
|
260
|
+
$[16] = t5;
|
|
261
|
+
$[17] = t6;
|
|
262
|
+
} else t6 = $[17];
|
|
263
|
+
return t6;
|
|
264
|
+
}
|
|
265
|
+
/** The button in the input that clears the typed text. */
|
|
266
|
+
function TagInputClearButton(t0) {
|
|
267
|
+
const $ = c(10);
|
|
268
|
+
const { id, size, ariaLabel, fieldLabelledby, onPress } = t0;
|
|
269
|
+
const { t } = useI18n();
|
|
270
|
+
let t1;
|
|
271
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
272
|
+
t1 = /* @__PURE__ */ jsx(CloseIcon, {});
|
|
273
|
+
$[0] = t1;
|
|
274
|
+
} else t1 = $[0];
|
|
275
|
+
let t2;
|
|
276
|
+
if ($[1] !== ariaLabel || $[2] !== t) {
|
|
277
|
+
t2 = ariaLabel ? t("tagInput.clearTextFor", "Clear text, {{label}}", { label: ariaLabel }) : t("tagInput.clearText", "Clear text");
|
|
278
|
+
$[1] = ariaLabel;
|
|
279
|
+
$[2] = t;
|
|
280
|
+
$[3] = t2;
|
|
281
|
+
} else t2 = $[3];
|
|
282
|
+
const t3 = fieldLabelledby ? `${id} ${fieldLabelledby}` : void 0;
|
|
283
|
+
let t4;
|
|
284
|
+
if ($[4] !== id || $[5] !== onPress || $[6] !== size || $[7] !== t2 || $[8] !== t3) {
|
|
285
|
+
t4 = /* @__PURE__ */ jsx(ItemAction, {
|
|
286
|
+
id,
|
|
287
|
+
qa: "TagInputClearButton",
|
|
288
|
+
icon: t1,
|
|
289
|
+
size,
|
|
290
|
+
tabIndex: -1,
|
|
291
|
+
"aria-label": t2,
|
|
292
|
+
"aria-labelledby": t3,
|
|
293
|
+
onPress
|
|
294
|
+
});
|
|
295
|
+
$[4] = id;
|
|
296
|
+
$[5] = onPress;
|
|
297
|
+
$[6] = size;
|
|
298
|
+
$[7] = t2;
|
|
299
|
+
$[8] = t3;
|
|
300
|
+
$[9] = t4;
|
|
301
|
+
} else t4 = $[9];
|
|
302
|
+
return t4;
|
|
303
|
+
}
|
|
127
304
|
function TagInput(props, ref) {
|
|
128
|
-
const $ = c(
|
|
305
|
+
const $ = c(300);
|
|
129
306
|
let t0;
|
|
130
307
|
if ($[0] !== props) {
|
|
131
308
|
t0 = castNullableArrayValue(props);
|
|
@@ -457,33 +634,16 @@ function TagInput(props, ref) {
|
|
|
457
634
|
const [values, setValues] = useControlledState(valueProp, t4, onChange_0);
|
|
458
635
|
const uniqueValues = [...new Set((values ?? []).map(String))];
|
|
459
636
|
const [draft, setDraftState] = useControlledState(inputValueProp, defaultInputValue ?? "", onInputChange);
|
|
460
|
-
const
|
|
461
|
-
const tagErrorIdRef = useRef(0);
|
|
637
|
+
const { tagError, setTagError, clearTagErrorAfterPress, cancelPendingClear } = useTagError();
|
|
462
638
|
let t5;
|
|
463
639
|
if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
|
|
464
|
-
t5 =
|
|
465
|
-
if (text == null) {
|
|
466
|
-
setTagErrorState(null);
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
tagErrorIdRef.current = tagErrorIdRef.current + 1;
|
|
470
|
-
setTagErrorState({
|
|
471
|
-
id: tagErrorIdRef.current,
|
|
472
|
-
text
|
|
473
|
-
});
|
|
474
|
-
};
|
|
475
|
-
$[77] = t5;
|
|
476
|
-
} else t5 = $[77];
|
|
477
|
-
const setTagError = useEvent(t5);
|
|
478
|
-
let t6;
|
|
479
|
-
if ($[78] === Symbol.for("react.memo_cache_sentinel")) {
|
|
480
|
-
t6 = {
|
|
640
|
+
t5 = {
|
|
481
641
|
id: 0,
|
|
482
642
|
text: ""
|
|
483
643
|
};
|
|
484
|
-
$[
|
|
485
|
-
} else
|
|
486
|
-
const [announcement, setAnnouncement] = useState(
|
|
644
|
+
$[77] = t5;
|
|
645
|
+
} else t5 = $[77];
|
|
646
|
+
const [announcement, setAnnouncement] = useState(t5);
|
|
487
647
|
let children = renderChildren;
|
|
488
648
|
if (items && typeof renderChildren === "function") children = Array.from(items).map((item, index) => {
|
|
489
649
|
const rendered = renderChildren(item);
|
|
@@ -495,66 +655,59 @@ function TagInput(props, ref) {
|
|
|
495
655
|
children,
|
|
496
656
|
selectionMode: "none"
|
|
497
657
|
}).collection;
|
|
498
|
-
let
|
|
499
|
-
if ($[
|
|
500
|
-
|
|
658
|
+
let t6;
|
|
659
|
+
if ($[78] !== collection) {
|
|
660
|
+
t6 = (key) => {
|
|
501
661
|
const node = collection.getItem(key);
|
|
502
662
|
return node?.type === "item" ? node : null;
|
|
503
663
|
};
|
|
504
|
-
$[
|
|
664
|
+
$[78] = collection;
|
|
665
|
+
$[79] = t6;
|
|
666
|
+
} else t6 = $[79];
|
|
667
|
+
const getOption = t6;
|
|
668
|
+
let t7;
|
|
669
|
+
if ($[80] === Symbol.for("react.memo_cache_sentinel")) {
|
|
670
|
+
t7 = { sensitivity: "base" };
|
|
505
671
|
$[80] = t7;
|
|
506
672
|
} else t7 = $[80];
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
if ($[81] === Symbol.for("react.memo_cache_sentinel")) {
|
|
510
|
-
t8 = { sensitivity: "base" };
|
|
511
|
-
$[81] = t8;
|
|
512
|
-
} else t8 = $[81];
|
|
513
|
-
const { contains } = useFilter(t8);
|
|
514
|
-
let t9;
|
|
515
|
-
if ($[82] !== contains || $[83] !== filter) {
|
|
516
|
-
t9 = filter === false ? _temp2 : filter || contains;
|
|
517
|
-
$[82] = contains;
|
|
518
|
-
$[83] = filter;
|
|
519
|
-
$[84] = t9;
|
|
520
|
-
} else t9 = $[84];
|
|
521
|
-
const textFilterFn = t9;
|
|
673
|
+
const { contains } = useFilter(t7);
|
|
674
|
+
const textFilterFn = filter === false ? showEveryOption : filter || contains;
|
|
522
675
|
const [isFilterActive, setIsFilterActive] = useState(false);
|
|
523
676
|
const term = draft.trim();
|
|
524
|
-
const [knownLabels, setKnownLabels] = useState(
|
|
677
|
+
const [knownLabels, setKnownLabels] = useState(_temp2);
|
|
678
|
+
let t8;
|
|
679
|
+
if ($[81] !== getOption || $[82] !== knownLabels) {
|
|
680
|
+
t8 = (key_0) => getOption(key_0)?.textValue || knownLabels.get(key_0) || key_0;
|
|
681
|
+
$[81] = getOption;
|
|
682
|
+
$[82] = knownLabels;
|
|
683
|
+
$[83] = t8;
|
|
684
|
+
} else t8 = $[83];
|
|
685
|
+
const getOptionLabel = t8;
|
|
686
|
+
let t9;
|
|
687
|
+
if ($[84] !== getOptionLabel || $[85] !== tagProps) {
|
|
688
|
+
t9 = (key_1) => textLabel(tagProps?.(key_1)?.children) ?? getOptionLabel(key_1);
|
|
689
|
+
$[84] = getOptionLabel;
|
|
690
|
+
$[85] = tagProps;
|
|
691
|
+
$[86] = t9;
|
|
692
|
+
} else t9 = $[86];
|
|
693
|
+
const getTagLabel = t9;
|
|
525
694
|
let t10;
|
|
526
|
-
if ($[
|
|
527
|
-
t10 = (
|
|
528
|
-
$[
|
|
529
|
-
$[
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
const getOptionLabel = t10;
|
|
695
|
+
if ($[87] !== tagProps) {
|
|
696
|
+
t10 = (key_2) => !!tagProps?.(key_2)?.isDisabled;
|
|
697
|
+
$[87] = tagProps;
|
|
698
|
+
$[88] = t10;
|
|
699
|
+
} else t10 = $[88];
|
|
700
|
+
const isTagLocked = t10;
|
|
533
701
|
let t11;
|
|
534
|
-
if ($[
|
|
535
|
-
t11 =
|
|
536
|
-
$[
|
|
537
|
-
$[89] = tagProps;
|
|
702
|
+
if ($[89] !== disabledKeys) {
|
|
703
|
+
t11 = new Set([...disabledKeys ?? []].map(String));
|
|
704
|
+
$[89] = disabledKeys;
|
|
538
705
|
$[90] = t11;
|
|
539
706
|
} else t11 = $[90];
|
|
540
|
-
const
|
|
707
|
+
const disabledKeySet = t11;
|
|
541
708
|
let t12;
|
|
542
|
-
if ($[91] !==
|
|
543
|
-
t12 = (
|
|
544
|
-
$[91] = tagProps;
|
|
545
|
-
$[92] = t12;
|
|
546
|
-
} else t12 = $[92];
|
|
547
|
-
const isTagLocked = t12;
|
|
548
|
-
let t13;
|
|
549
|
-
if ($[93] !== disabledKeys) {
|
|
550
|
-
t13 = new Set([...disabledKeys ?? []].map(String));
|
|
551
|
-
$[93] = disabledKeys;
|
|
552
|
-
$[94] = t13;
|
|
553
|
-
} else t13 = $[94];
|
|
554
|
-
const disabledKeySet = t13;
|
|
555
|
-
let t14;
|
|
556
|
-
if ($[95] !== getOption || $[96] !== knownLabels) {
|
|
557
|
-
t14 = (keys) => {
|
|
709
|
+
if ($[91] !== getOption || $[92] !== knownLabels) {
|
|
710
|
+
t12 = (keys) => {
|
|
558
711
|
let next = null;
|
|
559
712
|
for (const key_3 of keys) {
|
|
560
713
|
const label_0 = getOption(key_3)?.textValue;
|
|
@@ -565,47 +718,47 @@ function TagInput(props, ref) {
|
|
|
565
718
|
}
|
|
566
719
|
if (next) setKnownLabels(next);
|
|
567
720
|
};
|
|
568
|
-
$[
|
|
569
|
-
$[
|
|
570
|
-
$[
|
|
571
|
-
} else
|
|
572
|
-
const rememberLabels = useEvent(
|
|
573
|
-
let
|
|
574
|
-
if ($[
|
|
575
|
-
|
|
721
|
+
$[91] = getOption;
|
|
722
|
+
$[92] = knownLabels;
|
|
723
|
+
$[93] = t12;
|
|
724
|
+
} else t12 = $[93];
|
|
725
|
+
const rememberLabels = useEvent(t12);
|
|
726
|
+
let t13;
|
|
727
|
+
if ($[94] !== allowsCustomValue || $[95] !== collection || $[96] !== hasOptions) {
|
|
728
|
+
t13 = (text) => {
|
|
576
729
|
if (!hasOptions) return null;
|
|
577
|
-
const match = matchOptionText(collection,
|
|
730
|
+
const match = matchOptionText(collection, text);
|
|
578
731
|
return match.exact ?? (allowsCustomValue ? null : match.loose);
|
|
579
732
|
};
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
} else
|
|
585
|
-
const findOptionKey =
|
|
586
|
-
let
|
|
587
|
-
if ($[
|
|
588
|
-
|
|
589
|
-
const optionKey = findOptionKey(
|
|
733
|
+
$[94] = allowsCustomValue;
|
|
734
|
+
$[95] = collection;
|
|
735
|
+
$[96] = hasOptions;
|
|
736
|
+
$[97] = t13;
|
|
737
|
+
} else t13 = $[97];
|
|
738
|
+
const findOptionKey = t13;
|
|
739
|
+
let t14;
|
|
740
|
+
if ($[98] !== findOptionKey || $[99] !== normalizeTag) {
|
|
741
|
+
t14 = (text_0) => {
|
|
742
|
+
const optionKey = findOptionKey(text_0);
|
|
590
743
|
if (optionKey != null || !normalizeTag) return {
|
|
591
744
|
optionKey,
|
|
592
|
-
typed:
|
|
745
|
+
typed: text_0
|
|
593
746
|
};
|
|
594
|
-
const typed = normalizeTag(
|
|
747
|
+
const typed = normalizeTag(text_0).trim();
|
|
595
748
|
return {
|
|
596
749
|
optionKey: typed ? findOptionKey(typed) : null,
|
|
597
750
|
typed
|
|
598
751
|
};
|
|
599
752
|
};
|
|
600
|
-
$[
|
|
601
|
-
$[
|
|
602
|
-
$[
|
|
603
|
-
} else
|
|
604
|
-
const resolveTypedText =
|
|
605
|
-
let
|
|
606
|
-
if ($[
|
|
607
|
-
|
|
608
|
-
const source =
|
|
753
|
+
$[98] = findOptionKey;
|
|
754
|
+
$[99] = normalizeTag;
|
|
755
|
+
$[100] = t14;
|
|
756
|
+
} else t14 = $[100];
|
|
757
|
+
const resolveTypedText = t14;
|
|
758
|
+
let t15;
|
|
759
|
+
if ($[101] !== normalizeTag || $[102] !== resolveTypedText) {
|
|
760
|
+
t15 = (part, t16) => {
|
|
761
|
+
const source = t16 === void 0 ? "text" : t16;
|
|
609
762
|
if (source === "text") return resolveTypedText(part);
|
|
610
763
|
if (source === "option") return {
|
|
611
764
|
optionKey: part,
|
|
@@ -616,11 +769,11 @@ function TagInput(props, ref) {
|
|
|
616
769
|
typed: normalizeTag ? normalizeTag(part).trim() : part
|
|
617
770
|
};
|
|
618
771
|
};
|
|
619
|
-
$[
|
|
620
|
-
$[
|
|
621
|
-
$[
|
|
622
|
-
} else
|
|
623
|
-
const resolvePart =
|
|
772
|
+
$[101] = normalizeTag;
|
|
773
|
+
$[102] = resolveTypedText;
|
|
774
|
+
$[103] = t15;
|
|
775
|
+
} else t15 = $[103];
|
|
776
|
+
const resolvePart = t15;
|
|
624
777
|
const termOptionKey = term ? resolveTypedText(term).optionKey : null;
|
|
625
778
|
const optionFilterFn = (nodes) => {
|
|
626
779
|
if (!isFilterActive || !term) return nodes;
|
|
@@ -628,21 +781,26 @@ function TagInput(props, ref) {
|
|
|
628
781
|
};
|
|
629
782
|
const visibleOptionKeys = [];
|
|
630
783
|
if (hasOptions) collectVisibleKeys(optionFilterFn(collection), visibleOptionKeys, disabledKeys ? new Set(disabledKeys) : void 0);
|
|
631
|
-
let
|
|
632
|
-
if ($[
|
|
633
|
-
|
|
634
|
-
$[
|
|
635
|
-
} else
|
|
636
|
-
const [unpickedCustomValues, setUnpickedCustomValues] = useState(
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
784
|
+
let t16;
|
|
785
|
+
if ($[104] === Symbol.for("react.memo_cache_sentinel")) {
|
|
786
|
+
t16 = [];
|
|
787
|
+
$[104] = t16;
|
|
788
|
+
} else t16 = $[104];
|
|
789
|
+
const [unpickedCustomValues, setUnpickedCustomValues] = useState(t16);
|
|
790
|
+
const { keys: customValueKeys, visibleKeys: visibleCustomKeys, typedKey: customTerm } = hasOptions && allowsCustomValue ? getCustomRows({
|
|
791
|
+
values: uniqueValues,
|
|
792
|
+
unpicked: unpickedCustomValues,
|
|
793
|
+
isOption: (value_0) => getOption(value_0) != null || knownLabels.has(value_0),
|
|
794
|
+
term,
|
|
795
|
+
isFiltering: isFilterActive,
|
|
796
|
+
matches: typeof filter === "function" ? filter : contains,
|
|
797
|
+
termOptionKey
|
|
798
|
+
}) : NO_CUSTOM_ROWS;
|
|
641
799
|
const popoverChildren = withCustomOptions(children, {
|
|
642
800
|
customKeys: visibleCustomKeys,
|
|
643
801
|
customTerm,
|
|
644
802
|
hasOptionRows: visibleOptionKeys.length > 0,
|
|
645
|
-
hasSections: [...collection].some(
|
|
803
|
+
hasSections: [...collection].some(_temp3),
|
|
646
804
|
optionsLabel: t("tagInput.options", "Options"),
|
|
647
805
|
customValuesLabel: t("tagInput.customValues", "Custom values")
|
|
648
806
|
});
|
|
@@ -652,150 +810,79 @@ function TagInput(props, ref) {
|
|
|
652
810
|
const isInteractive = !isDisabled && !isReadOnly;
|
|
653
811
|
const shouldShowPopover = hasOptions && isInteractive && isPopoverOpen && hasResults;
|
|
654
812
|
const notifiedOpenRef = useRef(false);
|
|
655
|
-
let
|
|
656
|
-
let
|
|
657
|
-
if ($[
|
|
658
|
-
|
|
813
|
+
let t17;
|
|
814
|
+
let t18;
|
|
815
|
+
if ($[105] !== onOpenChange || $[106] !== shouldShowPopover) {
|
|
816
|
+
t17 = () => {
|
|
659
817
|
if (notifiedOpenRef.current === shouldShowPopover) return;
|
|
660
818
|
notifiedOpenRef.current = shouldShowPopover;
|
|
661
819
|
onOpenChange?.(shouldShowPopover);
|
|
662
820
|
};
|
|
663
|
-
|
|
664
|
-
$[
|
|
665
|
-
$[
|
|
666
|
-
$[
|
|
667
|
-
$[
|
|
821
|
+
t18 = [shouldShowPopover, onOpenChange];
|
|
822
|
+
$[105] = onOpenChange;
|
|
823
|
+
$[106] = shouldShowPopover;
|
|
824
|
+
$[107] = t17;
|
|
825
|
+
$[108] = t18;
|
|
668
826
|
} else {
|
|
669
|
-
|
|
670
|
-
|
|
827
|
+
t17 = $[107];
|
|
828
|
+
t18 = $[108];
|
|
671
829
|
}
|
|
672
|
-
useEffect(
|
|
673
|
-
const [activeOption, setActiveOption] = useState(null);
|
|
674
|
-
const activeOptionKey = activeOption?.key ?? null;
|
|
675
|
-
let t21;
|
|
676
|
-
if ($[113] !== setActiveOption) {
|
|
677
|
-
t21 = (key_5, source_0, forTerm) => {
|
|
678
|
-
const listState = listStateRef.current;
|
|
679
|
-
if (!listState || key_5 == null) return;
|
|
680
|
-
markKeyboardFocus(listState);
|
|
681
|
-
listState.selectionManager.setFocusedKey(key_5);
|
|
682
|
-
setActiveOption({
|
|
683
|
-
key: key_5,
|
|
684
|
-
term: forTerm,
|
|
685
|
-
source: source_0
|
|
686
|
-
});
|
|
687
|
-
};
|
|
688
|
-
$[113] = setActiveOption;
|
|
689
|
-
$[114] = t21;
|
|
690
|
-
} else t21 = $[114];
|
|
691
|
-
const moveVirtualFocus = useEvent(t21);
|
|
692
|
-
const [popoverMinWidth, setPopoverMinWidth] = useState();
|
|
693
|
-
let exactOptionKey = termOptionKey;
|
|
694
|
-
if (exactOptionKey == null && term && customValueKeys.includes(term)) exactOptionKey = term;
|
|
695
|
-
if (exactOptionKey == null && customTerm && (matchOptionText(collection, customTerm).loose != null || customValueKeys.some((key_6) => isSameText(key_6, customTerm)))) exactOptionKey = customTerm;
|
|
830
|
+
useEffect(t17, t18);
|
|
696
831
|
const visibleTargetKeys = [...visibleOptionKeys, ...visibleCustomKeys];
|
|
697
832
|
if (customTerm) visibleTargetKeys.push(customTerm);
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
setPopoverMinWidth(wrapperRef.current?.offsetWidth);
|
|
711
|
-
const visibleKeys = visibleOptionsSignature ? visibleOptionsSignature.split("\0") : [];
|
|
712
|
-
if (customTerm) visibleKeys.push(customTerm);
|
|
713
|
-
const isNewTerm = !!term && focusTermRef.current !== term;
|
|
714
|
-
focusTermRef.current = term;
|
|
715
|
-
let attempts = 0;
|
|
716
|
-
let isCancelled = false;
|
|
717
|
-
const tick = () => {
|
|
718
|
-
if (isCancelled) return;
|
|
719
|
-
const listState_0 = listStateRef.current;
|
|
720
|
-
if (!listState_0) {
|
|
721
|
-
attempts = attempts + 1;
|
|
722
|
-
if (attempts < 8) requestAnimationFrame(tick);
|
|
723
|
-
return;
|
|
724
|
-
}
|
|
725
|
-
const focused = listState_0.selectionManager.focusedKey;
|
|
726
|
-
if (focused != null && visibleKeys.includes(focused) && !isNewTerm) setActiveOption((prev) => prev?.key === focused ? {
|
|
727
|
-
...prev,
|
|
728
|
-
term
|
|
729
|
-
} : {
|
|
730
|
-
key: focused,
|
|
731
|
-
term,
|
|
732
|
-
source: "auto"
|
|
733
|
-
});
|
|
734
|
-
else moveVirtualFocus(preferredOptionKey, "auto", term);
|
|
735
|
-
};
|
|
736
|
-
requestAnimationFrame(() => requestAnimationFrame(tick));
|
|
737
|
-
return () => {
|
|
738
|
-
isCancelled = true;
|
|
739
|
-
};
|
|
740
|
-
};
|
|
741
|
-
$[115] = customTerm;
|
|
742
|
-
$[116] = moveVirtualFocus;
|
|
743
|
-
$[117] = preferredOptionKey;
|
|
744
|
-
$[118] = setActiveOption;
|
|
745
|
-
$[119] = setPopoverMinWidth;
|
|
746
|
-
$[120] = shouldShowPopover;
|
|
747
|
-
$[121] = term;
|
|
748
|
-
$[122] = visibleOptionsSignature;
|
|
749
|
-
$[123] = wrapperRef;
|
|
750
|
-
$[124] = t22;
|
|
751
|
-
} else t22 = $[124];
|
|
752
|
-
let t23;
|
|
753
|
-
if ($[125] !== customTerm || $[126] !== moveVirtualFocus || $[127] !== preferredOptionKey || $[128] !== shouldShowPopover || $[129] !== term || $[130] !== visibleOptionsSignature || $[131] !== wrapperRef) {
|
|
754
|
-
t23 = [
|
|
755
|
-
shouldShowPopover,
|
|
833
|
+
const preferredOptionKey = getPreferredRowKey(visibleTargetKeys, getExactRowKey(collection, {
|
|
834
|
+
term,
|
|
835
|
+
termOptionKey,
|
|
836
|
+
customTerm,
|
|
837
|
+
customValueKeys
|
|
838
|
+
}), term, uniqueValues);
|
|
839
|
+
let t19;
|
|
840
|
+
if ($[109] !== customTerm || $[110] !== preferredOptionKey || $[111] !== shouldShowPopover || $[112] !== term || $[113] !== visibleOptionsSignature || $[114] !== wrapperRef) {
|
|
841
|
+
t19 = {
|
|
842
|
+
listStateRef,
|
|
843
|
+
wrapperRef,
|
|
844
|
+
isOpen: shouldShowPopover,
|
|
756
845
|
visibleOptionsSignature,
|
|
757
846
|
customTerm,
|
|
758
847
|
term,
|
|
759
|
-
preferredOptionKey
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
];
|
|
763
|
-
$[
|
|
764
|
-
$[
|
|
765
|
-
$[
|
|
766
|
-
$[
|
|
767
|
-
$[
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
if ($[133] !== setDraftState || $[134] !== setIsFilterActive) {
|
|
775
|
-
t24 = (next_0) => {
|
|
848
|
+
preferredOptionKey
|
|
849
|
+
};
|
|
850
|
+
$[109] = customTerm;
|
|
851
|
+
$[110] = preferredOptionKey;
|
|
852
|
+
$[111] = shouldShowPopover;
|
|
853
|
+
$[112] = term;
|
|
854
|
+
$[113] = visibleOptionsSignature;
|
|
855
|
+
$[114] = wrapperRef;
|
|
856
|
+
$[115] = t19;
|
|
857
|
+
} else t19 = $[115];
|
|
858
|
+
const { activeOption, setActiveOption, moveVirtualFocus, popoverMinWidth } = useActiveOption(t19);
|
|
859
|
+
const activeOptionKey = activeOption?.key ?? null;
|
|
860
|
+
let t20;
|
|
861
|
+
if ($[116] !== setDraftState || $[117] !== setIsFilterActive) {
|
|
862
|
+
t20 = (next_0) => {
|
|
776
863
|
setDraftState(next_0);
|
|
777
864
|
setIsFilterActive(!!next_0.trim());
|
|
778
865
|
};
|
|
779
|
-
$[
|
|
780
|
-
$[
|
|
781
|
-
$[
|
|
782
|
-
} else
|
|
783
|
-
const setDraft = useEvent(
|
|
784
|
-
let
|
|
785
|
-
if ($[
|
|
786
|
-
|
|
787
|
-
setAnnouncement((
|
|
788
|
-
id:
|
|
789
|
-
text:
|
|
866
|
+
$[116] = setDraftState;
|
|
867
|
+
$[117] = setIsFilterActive;
|
|
868
|
+
$[118] = t20;
|
|
869
|
+
} else t20 = $[118];
|
|
870
|
+
const setDraft = useEvent(t20);
|
|
871
|
+
let t21;
|
|
872
|
+
if ($[119] !== setAnnouncement) {
|
|
873
|
+
t21 = (text_1) => {
|
|
874
|
+
setAnnouncement((prev) => ({
|
|
875
|
+
id: prev.id + 1,
|
|
876
|
+
text: text_1
|
|
790
877
|
}));
|
|
791
878
|
};
|
|
792
|
-
$[
|
|
793
|
-
$[
|
|
794
|
-
} else
|
|
795
|
-
const announce = useEvent(
|
|
796
|
-
let
|
|
797
|
-
if ($[
|
|
798
|
-
|
|
879
|
+
$[119] = setAnnouncement;
|
|
880
|
+
$[120] = t21;
|
|
881
|
+
} else t21 = $[120];
|
|
882
|
+
const announce = useEvent(t21);
|
|
883
|
+
let t22;
|
|
884
|
+
if ($[121] !== maxTags || $[122] !== t) {
|
|
885
|
+
t22 = (rejection) => {
|
|
799
886
|
if (rejection.message) return rejection.message;
|
|
800
887
|
switch (rejection.reason) {
|
|
801
888
|
case "duplicate": return t("tagInput.duplicateValue", "\"{{value}}\" is already added", { value: rejection.text });
|
|
@@ -805,72 +892,47 @@ function TagInput(props, ref) {
|
|
|
805
892
|
default: return t("tagInput.invalidValue", "\"{{value}}\" is not a valid value", { value: rejection.text });
|
|
806
893
|
}
|
|
807
894
|
};
|
|
808
|
-
$[
|
|
809
|
-
$[
|
|
810
|
-
$[
|
|
811
|
-
} else
|
|
812
|
-
const rejectionMessage = useEvent(
|
|
813
|
-
let
|
|
814
|
-
if ($[
|
|
815
|
-
|
|
816
|
-
$[
|
|
817
|
-
$[
|
|
818
|
-
} else
|
|
819
|
-
const joinDelimiter =
|
|
895
|
+
$[121] = maxTags;
|
|
896
|
+
$[122] = t;
|
|
897
|
+
$[123] = t22;
|
|
898
|
+
} else t22 = $[123];
|
|
899
|
+
const rejectionMessage = useEvent(t22);
|
|
900
|
+
let t23;
|
|
901
|
+
if ($[124] !== delimiters) {
|
|
902
|
+
t23 = delimiters.find(_temp4);
|
|
903
|
+
$[124] = delimiters;
|
|
904
|
+
$[125] = t23;
|
|
905
|
+
} else t23 = $[125];
|
|
906
|
+
const joinDelimiter = t23;
|
|
820
907
|
const joiner = joinDelimiter ? `${joinDelimiter} ` : " ";
|
|
821
908
|
const hasFieldMessage = !!label || !!props.forceField;
|
|
822
|
-
const commitParts = useEvent((parts,
|
|
909
|
+
const commitParts = useEvent((parts, source_0) => {
|
|
823
910
|
if (!parts.length) return "";
|
|
911
|
+
const rules = {
|
|
912
|
+
disabledKeys: disabledKeySet,
|
|
913
|
+
isOptionOnly: hasOptions && !allowsCustomValue,
|
|
914
|
+
maxTags,
|
|
915
|
+
validateTag
|
|
916
|
+
};
|
|
824
917
|
const present = new Set(uniqueValues);
|
|
825
918
|
const accepted = [];
|
|
826
919
|
const rejected = [];
|
|
827
920
|
for (const part_0 of parts) {
|
|
828
|
-
const { optionKey: optionKey_0, typed: typed_0 } = resolvePart(part_0,
|
|
921
|
+
const { optionKey: optionKey_0, typed: typed_0 } = resolvePart(part_0, source_0);
|
|
829
922
|
if (!typed_0) continue;
|
|
830
923
|
const nextValue = optionKey_0 ?? typed_0;
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
text: part_0,
|
|
834
|
-
reason: "unavailable"
|
|
835
|
-
});
|
|
836
|
-
continue;
|
|
837
|
-
}
|
|
838
|
-
if (optionKey_0 == null && hasOptions && !allowsCustomValue) {
|
|
839
|
-
rejected.push({
|
|
840
|
-
text: part_0,
|
|
841
|
-
reason: "unknown"
|
|
842
|
-
});
|
|
843
|
-
continue;
|
|
844
|
-
}
|
|
845
|
-
if (present.has(nextValue)) {
|
|
846
|
-
rejected.push({
|
|
847
|
-
text: part_0,
|
|
848
|
-
reason: "duplicate"
|
|
849
|
-
});
|
|
850
|
-
continue;
|
|
851
|
-
}
|
|
852
|
-
if (maxTags != null && present.size >= maxTags) {
|
|
924
|
+
const rejection_0 = getRejection(nextValue, optionKey_0, present, rules);
|
|
925
|
+
if (rejection_0) {
|
|
853
926
|
rejected.push({
|
|
854
927
|
text: part_0,
|
|
855
|
-
|
|
928
|
+
...rejection_0
|
|
856
929
|
});
|
|
857
930
|
continue;
|
|
858
931
|
}
|
|
859
|
-
if (optionKey_0 == null && validateTag) {
|
|
860
|
-
const result = validateTag(nextValue);
|
|
861
|
-
if (result === false || typeof result === "string") {
|
|
862
|
-
rejected.push({
|
|
863
|
-
text: part_0,
|
|
864
|
-
reason: "invalid",
|
|
865
|
-
message: typeof result === "string" ? result : void 0
|
|
866
|
-
});
|
|
867
|
-
continue;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
932
|
present.add(nextValue);
|
|
871
933
|
accepted.push(nextValue);
|
|
872
934
|
}
|
|
873
|
-
const returned = rejected.filter(
|
|
935
|
+
const returned = rejected.filter(_temp5);
|
|
874
936
|
const kept = joinDelimiter ? returned : returned.slice(0, 1);
|
|
875
937
|
const shown = kept[0] ?? rejected[0];
|
|
876
938
|
const error = shown ? rejectionMessage(shown) : null;
|
|
@@ -883,33 +945,33 @@ function TagInput(props, ref) {
|
|
|
883
945
|
if (error && !hasFieldMessage) messages.push(error);
|
|
884
946
|
if (messages.length) announce(messages.join(" "));
|
|
885
947
|
setTagError(error);
|
|
886
|
-
return kept.map(
|
|
948
|
+
return kept.map(_temp6).join(joiner);
|
|
887
949
|
});
|
|
888
|
-
let
|
|
889
|
-
if ($[
|
|
890
|
-
|
|
950
|
+
let t24;
|
|
951
|
+
if ($[126] !== commitParts || $[127] !== delimiters || $[128] !== draft || $[129] !== setDraft) {
|
|
952
|
+
t24 = () => {
|
|
891
953
|
const rest = commitParts(splitTagText(draft, delimiters));
|
|
892
954
|
setDraft(rest);
|
|
893
955
|
return rest;
|
|
894
956
|
};
|
|
895
|
-
$[
|
|
896
|
-
$[
|
|
897
|
-
$[
|
|
898
|
-
$[
|
|
899
|
-
$[
|
|
900
|
-
} else
|
|
901
|
-
const commitDraft = useEvent(
|
|
902
|
-
let
|
|
903
|
-
if ($[
|
|
904
|
-
|
|
957
|
+
$[126] = commitParts;
|
|
958
|
+
$[127] = delimiters;
|
|
959
|
+
$[128] = draft;
|
|
960
|
+
$[129] = setDraft;
|
|
961
|
+
$[130] = t24;
|
|
962
|
+
} else t24 = $[130];
|
|
963
|
+
const commitDraft = useEvent(t24);
|
|
964
|
+
let t25;
|
|
965
|
+
if ($[131] === Symbol.for("react.memo_cache_sentinel")) {
|
|
966
|
+
t25 = () => {
|
|
905
967
|
const rows = tagListRef.current?.querySelectorAll("[role=\"row\"]:not([aria-disabled=\"true\"])");
|
|
906
968
|
rows?.[rows.length - 1]?.focus();
|
|
907
969
|
};
|
|
908
|
-
$[
|
|
909
|
-
} else
|
|
910
|
-
const focusLastTag = useEvent(
|
|
970
|
+
$[131] = t25;
|
|
971
|
+
} else t25 = $[131];
|
|
972
|
+
const focusLastTag = useEvent(t25);
|
|
911
973
|
const removeValues = useEvent((requested) => {
|
|
912
|
-
const keys_0 = requested.filter((
|
|
974
|
+
const keys_0 = requested.filter((key_4) => !isTagLocked(key_4));
|
|
913
975
|
if (!keys_0.length) return;
|
|
914
976
|
const removed = new Set(keys_0);
|
|
915
977
|
const next_1 = uniqueValues.filter((value_1) => !removed.has(value_1));
|
|
@@ -918,20 +980,20 @@ function TagInput(props, ref) {
|
|
|
918
980
|
setTagError(null);
|
|
919
981
|
announce(t("tagInput.removed", "Removed {{value}}", { value: formatList(keys_0.map(getTagLabel)) }));
|
|
920
982
|
});
|
|
921
|
-
const toggleOption = useEvent((
|
|
922
|
-
if (isTagLocked(
|
|
923
|
-
const
|
|
983
|
+
const toggleOption = useEvent((key_5) => {
|
|
984
|
+
if (isTagLocked(key_5)) return;
|
|
985
|
+
const source_1 = getOption(key_5) != null ? "option" : customValueKeys.includes(key_5) ? "custom" : "text";
|
|
924
986
|
setTagError(null);
|
|
925
|
-
if (uniqueValues.includes(
|
|
926
|
-
removeValues([
|
|
987
|
+
if (uniqueValues.includes(key_5)) {
|
|
988
|
+
removeValues([key_5]);
|
|
927
989
|
setDraft("");
|
|
928
|
-
if (customValueKeys.includes(
|
|
929
|
-
} else if (!commitParts([
|
|
990
|
+
if (customValueKeys.includes(key_5)) setUnpickedCustomValues((prev_0) => prev_0.includes(key_5) ? prev_0 : [...prev_0, key_5]);
|
|
991
|
+
} else if (!commitParts([key_5], source_1)) setDraft("");
|
|
930
992
|
});
|
|
931
993
|
const handlePopoverSelection = useEvent((selection) => {
|
|
932
994
|
if (!Array.isArray(selection)) return;
|
|
933
995
|
const next_2 = new Set(selection.map(String));
|
|
934
|
-
const changed = [...[...next_2].filter((
|
|
996
|
+
const changed = [...[...next_2].filter((key_6) => !uniqueValues.includes(key_6)), ...uniqueValues.filter((value_3) => !next_2.has(value_3) && (getOption(value_3) != null || visibleCustomKeys.includes(value_3)))];
|
|
935
997
|
changed.forEach(toggleOption);
|
|
936
998
|
const clicked = changed[changed.length - 1];
|
|
937
999
|
if (clicked != null) {
|
|
@@ -945,12 +1007,9 @@ function TagInput(props, ref) {
|
|
|
945
1007
|
setTimeout(() => inputRef.current?.focus(), 0);
|
|
946
1008
|
});
|
|
947
1009
|
const isTabbingRef = useRef(false);
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
if (e.defaultPrevented || !isInteractive) return;
|
|
952
|
-
const listState_1 = listStateRef.current;
|
|
953
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
1010
|
+
let t26;
|
|
1011
|
+
if ($[132] !== hasOptions || $[133] !== hasResults || $[134] !== moveVirtualFocus || $[135] !== setIsFilterActive || $[136] !== setIsPopoverOpen || $[137] !== shouldShowPopover || $[138] !== term) {
|
|
1012
|
+
t26 = (e) => {
|
|
954
1013
|
if (!hasOptions) return;
|
|
955
1014
|
e.preventDefault();
|
|
956
1015
|
if (!shouldShowPopover) {
|
|
@@ -958,67 +1017,119 @@ function TagInput(props, ref) {
|
|
|
958
1017
|
setIsPopoverOpen(true);
|
|
959
1018
|
return;
|
|
960
1019
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1020
|
+
const listState = listStateRef.current;
|
|
1021
|
+
if (listState) moveVirtualFocus(getNextVisibleKey(listState, e.key === "ArrowDown" ? 1 : -1), "user", term);
|
|
1022
|
+
};
|
|
1023
|
+
$[132] = hasOptions;
|
|
1024
|
+
$[133] = hasResults;
|
|
1025
|
+
$[134] = moveVirtualFocus;
|
|
1026
|
+
$[135] = setIsFilterActive;
|
|
1027
|
+
$[136] = setIsPopoverOpen;
|
|
1028
|
+
$[137] = shouldShowPopover;
|
|
1029
|
+
$[138] = term;
|
|
1030
|
+
$[139] = t26;
|
|
1031
|
+
} else t26 = $[139];
|
|
1032
|
+
const handleArrowKey = useEvent(t26);
|
|
1033
|
+
let t27;
|
|
1034
|
+
if ($[140] !== moveVirtualFocus || $[141] !== term) {
|
|
1035
|
+
t27 = (e_0) => {
|
|
1036
|
+
e_0.preventDefault();
|
|
1037
|
+
const listState_0 = listStateRef.current;
|
|
1038
|
+
if (listState_0) moveVirtualFocus(getEdgeVisibleKey(listState_0, e_0.key === "Home" ? "first" : "last"), "user", term);
|
|
1039
|
+
};
|
|
1040
|
+
$[140] = moveVirtualFocus;
|
|
1041
|
+
$[141] = term;
|
|
1042
|
+
$[142] = t27;
|
|
1043
|
+
} else t27 = $[142];
|
|
1044
|
+
const handleEdgeKey = useEvent(t27);
|
|
1045
|
+
let t28;
|
|
1046
|
+
if ($[143] !== focusLastTag || $[144] !== setIsPopoverOpen) {
|
|
1047
|
+
t28 = (e_1) => {
|
|
1048
|
+
if (isComposingKey(e_1)) return;
|
|
1049
|
+
e_1.preventDefault();
|
|
1050
|
+
if (e_1.repeat) return;
|
|
973
1051
|
setIsPopoverOpen(false);
|
|
974
1052
|
focusLastTag();
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1053
|
+
};
|
|
1054
|
+
$[143] = focusLastTag;
|
|
1055
|
+
$[144] = setIsPopoverOpen;
|
|
1056
|
+
$[145] = t28;
|
|
1057
|
+
} else t28 = $[145];
|
|
1058
|
+
const handleBackspaceKey = useEvent(t28);
|
|
1059
|
+
const handleEnterKey = useEvent((e_2) => {
|
|
1060
|
+
if (isComposingKey(e_2)) return;
|
|
1061
|
+
const isCurrent = activeOption != null && activeOption.term === term;
|
|
1062
|
+
const targetKey = shouldShowPopover ? isCurrent ? activeOption.key : preferredOptionKey : null;
|
|
1063
|
+
if (targetKey != null) {
|
|
1064
|
+
e_2.preventDefault();
|
|
1065
|
+
const key_7 = String(targetKey);
|
|
1066
|
+
if (term && uniqueValues.includes(key_7) && !(isCurrent && activeOption.source === "user")) {
|
|
1067
|
+
setDraft("");
|
|
1068
|
+
setTagError(rejectionMessage({
|
|
1069
|
+
text: getTagLabel(key_7),
|
|
1070
|
+
reason: "duplicate"
|
|
1071
|
+
}));
|
|
993
1072
|
return;
|
|
994
1073
|
}
|
|
995
|
-
|
|
996
|
-
if (term) commitDraft();
|
|
1074
|
+
toggleOption(key_7);
|
|
997
1075
|
return;
|
|
998
1076
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1077
|
+
e_2.preventDefault();
|
|
1078
|
+
if (term) commitDraft();
|
|
1079
|
+
});
|
|
1080
|
+
let t29;
|
|
1081
|
+
if ($[146] !== commitParts || $[147] !== delimiters || $[148] !== draft || $[149] !== joiner || $[150] !== setDraft) {
|
|
1082
|
+
t29 = (e_3) => {
|
|
1083
|
+
if (isComposingKey(e_3)) return;
|
|
1084
|
+
e_3.preventDefault();
|
|
1085
|
+
const el = e_3.currentTarget;
|
|
1003
1086
|
const start = el.selectionStart ?? draft.length;
|
|
1004
1087
|
const end = el.selectionEnd ?? start;
|
|
1005
1088
|
setDraft([commitParts(splitTagText(draft.slice(0, start), delimiters)), draft.slice(end).trimStart()].filter(Boolean).join(joiner));
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1089
|
+
};
|
|
1090
|
+
$[146] = commitParts;
|
|
1091
|
+
$[147] = delimiters;
|
|
1092
|
+
$[148] = draft;
|
|
1093
|
+
$[149] = joiner;
|
|
1094
|
+
$[150] = setDraft;
|
|
1095
|
+
$[151] = t29;
|
|
1096
|
+
} else t29 = $[151];
|
|
1097
|
+
const handleDelimiterKey = useEvent(t29);
|
|
1098
|
+
let t30;
|
|
1099
|
+
if ($[152] !== draft || $[153] !== setDraft || $[154] !== setIsPopoverOpen || $[155] !== setTagError || $[156] !== shouldShowPopover || $[157] !== tagError) {
|
|
1100
|
+
t30 = (e_4) => {
|
|
1009
1101
|
if (shouldShowPopover) {
|
|
1010
|
-
|
|
1011
|
-
|
|
1102
|
+
e_4.preventDefault();
|
|
1103
|
+
e_4.stopPropagation();
|
|
1012
1104
|
setIsPopoverOpen(false);
|
|
1013
1105
|
setTagError(null);
|
|
1014
1106
|
} else if (draft || tagError) {
|
|
1015
|
-
|
|
1016
|
-
|
|
1107
|
+
e_4.preventDefault();
|
|
1108
|
+
e_4.stopPropagation();
|
|
1017
1109
|
setDraft("");
|
|
1018
1110
|
setTagError(null);
|
|
1019
1111
|
setIsPopoverOpen(false);
|
|
1020
1112
|
}
|
|
1021
|
-
}
|
|
1113
|
+
};
|
|
1114
|
+
$[152] = draft;
|
|
1115
|
+
$[153] = setDraft;
|
|
1116
|
+
$[154] = setIsPopoverOpen;
|
|
1117
|
+
$[155] = setTagError;
|
|
1118
|
+
$[156] = shouldShowPopover;
|
|
1119
|
+
$[157] = tagError;
|
|
1120
|
+
$[158] = t30;
|
|
1121
|
+
} else t30 = $[158];
|
|
1122
|
+
const handleEscapeKey = useEvent(t30);
|
|
1123
|
+
const handleKeyDown = useEvent((e_5) => {
|
|
1124
|
+
onKeyDown?.(e_5);
|
|
1125
|
+
isTabbingRef.current = e_5.key === "Tab" && !e_5.defaultPrevented;
|
|
1126
|
+
if (e_5.defaultPrevented || !isInteractive) return;
|
|
1127
|
+
if (e_5.key === "ArrowDown" || e_5.key === "ArrowUp") handleArrowKey(e_5);
|
|
1128
|
+
else if ((e_5.key === "Home" || e_5.key === "End") && shouldShowPopover) handleEdgeKey(e_5);
|
|
1129
|
+
else if (e_5.key === "Backspace" && !draft && uniqueValues.some((value_4) => !isTagLocked(value_4))) handleBackspaceKey(e_5);
|
|
1130
|
+
else if (e_5.key === "Enter") handleEnterKey(e_5);
|
|
1131
|
+
else if (delimiters.includes(e_5.key)) handleDelimiterKey(e_5);
|
|
1132
|
+
else if (e_5.key === "Escape") handleEscapeKey(e_5);
|
|
1022
1133
|
});
|
|
1023
1134
|
const handleInputChange = useEvent((next_3) => {
|
|
1024
1135
|
setTagError(null);
|
|
@@ -1028,36 +1139,36 @@ function TagInput(props, ref) {
|
|
|
1028
1139
|
let nextDraft = next_3;
|
|
1029
1140
|
if (parts_0.length > 1) {
|
|
1030
1141
|
const rest_0 = (parts_0.pop() ?? "").trimStart();
|
|
1031
|
-
nextDraft = [commitParts(parts_0.map(
|
|
1142
|
+
nextDraft = [commitParts(parts_0.map(_temp7).filter(Boolean)), rest_0].filter(Boolean).join(joiner);
|
|
1032
1143
|
}
|
|
1033
1144
|
setDraft(nextDraft);
|
|
1034
1145
|
if (hasOptions && popoverTrigger !== "manual" && nextDraft.trim()) setIsPopoverOpen(true);
|
|
1035
1146
|
});
|
|
1036
|
-
let
|
|
1037
|
-
if ($[
|
|
1038
|
-
|
|
1147
|
+
let t31;
|
|
1148
|
+
if ($[159] !== commitParts || $[160] !== delimiters || $[161] !== draft || $[162] !== isInteractive || $[163] !== setDraft || $[164] !== setTagError) {
|
|
1149
|
+
t31 = (e_6) => {
|
|
1039
1150
|
if (!isInteractive) return;
|
|
1040
|
-
const pasted =
|
|
1151
|
+
const pasted = e_6.clipboardData.getData("text");
|
|
1041
1152
|
if (!pasted || splitTagText(pasted, delimiters).length < 2) return;
|
|
1042
|
-
|
|
1043
|
-
const el_0 =
|
|
1153
|
+
e_6.preventDefault();
|
|
1154
|
+
const el_0 = e_6.currentTarget;
|
|
1044
1155
|
const start_0 = el_0.selectionStart ?? draft.length;
|
|
1045
1156
|
const end_0 = el_0.selectionEnd ?? draft.length;
|
|
1046
1157
|
setTagError(null);
|
|
1047
1158
|
setDraft(commitParts(splitTagText(`${draft.slice(0, start_0)}\n${pasted}\n${draft.slice(end_0)}`, delimiters)));
|
|
1048
1159
|
};
|
|
1049
|
-
$[
|
|
1050
|
-
$[
|
|
1051
|
-
$[
|
|
1052
|
-
$[
|
|
1053
|
-
$[
|
|
1054
|
-
$[
|
|
1055
|
-
$[
|
|
1056
|
-
} else
|
|
1057
|
-
const handlePaste = useEvent(
|
|
1058
|
-
let
|
|
1059
|
-
if ($[
|
|
1060
|
-
|
|
1160
|
+
$[159] = commitParts;
|
|
1161
|
+
$[160] = delimiters;
|
|
1162
|
+
$[161] = draft;
|
|
1163
|
+
$[162] = isInteractive;
|
|
1164
|
+
$[163] = setDraft;
|
|
1165
|
+
$[164] = setTagError;
|
|
1166
|
+
$[165] = t31;
|
|
1167
|
+
} else t31 = $[165];
|
|
1168
|
+
const handlePaste = useEvent(t31);
|
|
1169
|
+
let t32;
|
|
1170
|
+
if ($[166] !== allowsCustomValue || $[167] !== commitDraft || $[168] !== draft || $[169] !== hasOptions || $[170] !== isInteractive || $[171] !== setDraft || $[172] !== setTagError || $[173] !== shouldCommitOnBlur || $[174] !== term || $[175] !== termOptionKey) {
|
|
1171
|
+
t32 = () => {
|
|
1061
1172
|
if (!term) return "";
|
|
1062
1173
|
if (!shouldCommitOnBlur || !isInteractive) return draft;
|
|
1063
1174
|
if (hasOptions && !allowsCustomValue && termOptionKey == null) {
|
|
@@ -1067,79 +1178,34 @@ function TagInput(props, ref) {
|
|
|
1067
1178
|
}
|
|
1068
1179
|
return commitDraft();
|
|
1069
1180
|
};
|
|
1070
|
-
$[
|
|
1071
|
-
$[
|
|
1072
|
-
$[
|
|
1073
|
-
$[
|
|
1074
|
-
$[
|
|
1075
|
-
$[
|
|
1076
|
-
$[
|
|
1077
|
-
$[
|
|
1078
|
-
$[
|
|
1079
|
-
$[
|
|
1080
|
-
$[
|
|
1081
|
-
} else
|
|
1082
|
-
const settleDraft = useEvent(
|
|
1083
|
-
const pendingClearRef = useRef(null);
|
|
1084
|
-
let t32;
|
|
1085
|
-
if ($[167] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1086
|
-
t32 = () => {
|
|
1087
|
-
pendingClearRef.current?.();
|
|
1088
|
-
pendingClearRef.current = null;
|
|
1089
|
-
};
|
|
1090
|
-
$[167] = t32;
|
|
1091
|
-
} else t32 = $[167];
|
|
1092
|
-
const cancelPendingClear = t32;
|
|
1181
|
+
$[166] = allowsCustomValue;
|
|
1182
|
+
$[167] = commitDraft;
|
|
1183
|
+
$[168] = draft;
|
|
1184
|
+
$[169] = hasOptions;
|
|
1185
|
+
$[170] = isInteractive;
|
|
1186
|
+
$[171] = setDraft;
|
|
1187
|
+
$[172] = setTagError;
|
|
1188
|
+
$[173] = shouldCommitOnBlur;
|
|
1189
|
+
$[174] = term;
|
|
1190
|
+
$[175] = termOptionKey;
|
|
1191
|
+
$[176] = t32;
|
|
1192
|
+
} else t32 = $[176];
|
|
1193
|
+
const settleDraft = useEvent(t32);
|
|
1093
1194
|
let t33;
|
|
1094
|
-
if ($[
|
|
1195
|
+
if ($[177] !== cancelPendingClear || $[178] !== onFocus) {
|
|
1095
1196
|
t33 = () => {
|
|
1096
|
-
cancelPendingClear();
|
|
1097
|
-
let timer;
|
|
1098
|
-
const handleMouseUp = () => {
|
|
1099
|
-
timer = setTimeout(() => {
|
|
1100
|
-
pendingClearRef.current = null;
|
|
1101
|
-
setTagError(null);
|
|
1102
|
-
}, 0);
|
|
1103
|
-
};
|
|
1104
|
-
document.addEventListener("mouseup", handleMouseUp, {
|
|
1105
|
-
capture: true,
|
|
1106
|
-
once: true
|
|
1107
|
-
});
|
|
1108
|
-
pendingClearRef.current = () => {
|
|
1109
|
-
document.removeEventListener("mouseup", handleMouseUp, true);
|
|
1110
|
-
clearTimeout(timer);
|
|
1111
|
-
};
|
|
1112
|
-
};
|
|
1113
|
-
$[168] = setTagError;
|
|
1114
|
-
$[169] = t33;
|
|
1115
|
-
} else t33 = $[169];
|
|
1116
|
-
const clearTagErrorAfterPress = t33;
|
|
1117
|
-
let t34;
|
|
1118
|
-
let t35;
|
|
1119
|
-
if ($[170] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1120
|
-
t34 = () => () => pendingClearRef.current?.();
|
|
1121
|
-
t35 = [];
|
|
1122
|
-
$[170] = t34;
|
|
1123
|
-
$[171] = t35;
|
|
1124
|
-
} else {
|
|
1125
|
-
t34 = $[170];
|
|
1126
|
-
t35 = $[171];
|
|
1127
|
-
}
|
|
1128
|
-
useEffect(t34, t35);
|
|
1129
|
-
let t36;
|
|
1130
|
-
if ($[172] !== onFocus) {
|
|
1131
|
-
t36 = () => {
|
|
1132
1197
|
cancelPendingClear();
|
|
1133
1198
|
onFocus?.();
|
|
1134
1199
|
};
|
|
1135
|
-
$[
|
|
1136
|
-
$[
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1200
|
+
$[177] = cancelPendingClear;
|
|
1201
|
+
$[178] = onFocus;
|
|
1202
|
+
$[179] = t33;
|
|
1203
|
+
} else t33 = $[179];
|
|
1204
|
+
const handleCompositeFocus = useEvent(t33);
|
|
1205
|
+
let t34;
|
|
1206
|
+
if ($[180] !== clearTagErrorAfterPress || $[181] !== onBlur || $[182] !== setIsPopoverOpen || $[183] !== setTagError || $[184] !== setUnpickedCustomValues || $[185] !== settleDraft || $[186] !== tagError) {
|
|
1207
|
+
t34 = (t35) => {
|
|
1208
|
+
const { isPressing } = t35;
|
|
1143
1209
|
setIsPopoverOpen(false);
|
|
1144
1210
|
setUnpickedCustomValues([]);
|
|
1145
1211
|
const wasShowingMessage = tagError != null;
|
|
@@ -1147,83 +1213,83 @@ function TagInput(props, ref) {
|
|
|
1147
1213
|
else setTagError(null);
|
|
1148
1214
|
onBlur?.();
|
|
1149
1215
|
};
|
|
1150
|
-
$[
|
|
1151
|
-
$[
|
|
1152
|
-
$[
|
|
1153
|
-
$[
|
|
1154
|
-
$[
|
|
1155
|
-
$[
|
|
1156
|
-
$[
|
|
1157
|
-
$[
|
|
1158
|
-
} else
|
|
1159
|
-
const handleCompositeBlur = useEvent(
|
|
1160
|
-
const
|
|
1161
|
-
const
|
|
1162
|
-
let
|
|
1163
|
-
if ($[
|
|
1164
|
-
|
|
1165
|
-
wrapperRef:
|
|
1166
|
-
popoverRef:
|
|
1216
|
+
$[180] = clearTagErrorAfterPress;
|
|
1217
|
+
$[181] = onBlur;
|
|
1218
|
+
$[182] = setIsPopoverOpen;
|
|
1219
|
+
$[183] = setTagError;
|
|
1220
|
+
$[184] = setUnpickedCustomValues;
|
|
1221
|
+
$[185] = settleDraft;
|
|
1222
|
+
$[186] = tagError;
|
|
1223
|
+
$[187] = t34;
|
|
1224
|
+
} else t34 = $[187];
|
|
1225
|
+
const handleCompositeBlur = useEvent(t34);
|
|
1226
|
+
const t35 = rootRef;
|
|
1227
|
+
const t36 = popoverRef;
|
|
1228
|
+
let t37;
|
|
1229
|
+
if ($[188] !== handleCompositeBlur || $[189] !== handleCompositeFocus || $[190] !== isDisabled || $[191] !== t35 || $[192] !== t36) {
|
|
1230
|
+
t37 = {
|
|
1231
|
+
wrapperRef: t35,
|
|
1232
|
+
popoverRef: t36,
|
|
1167
1233
|
onFocus: handleCompositeFocus,
|
|
1168
1234
|
onBlur: handleCompositeBlur,
|
|
1169
1235
|
isDisabled
|
|
1170
1236
|
};
|
|
1171
|
-
$[
|
|
1172
|
-
$[
|
|
1173
|
-
$[
|
|
1174
|
-
$[
|
|
1175
|
-
$[
|
|
1176
|
-
$[
|
|
1177
|
-
} else
|
|
1178
|
-
const { compositeFocusProps } = useCompositeFocus(
|
|
1179
|
-
let
|
|
1180
|
-
if ($[
|
|
1181
|
-
|
|
1237
|
+
$[188] = handleCompositeBlur;
|
|
1238
|
+
$[189] = handleCompositeFocus;
|
|
1239
|
+
$[190] = isDisabled;
|
|
1240
|
+
$[191] = t35;
|
|
1241
|
+
$[192] = t36;
|
|
1242
|
+
$[193] = t37;
|
|
1243
|
+
} else t37 = $[193];
|
|
1244
|
+
const { compositeFocusProps } = useCompositeFocus(t37);
|
|
1245
|
+
let t38;
|
|
1246
|
+
if ($[194] !== rootRef || $[195] !== setIsPopoverOpen || $[196] !== settleDraft) {
|
|
1247
|
+
t38 = (e_7) => {
|
|
1182
1248
|
const isTabbing = isTabbingRef.current;
|
|
1183
|
-
const next_4 =
|
|
1249
|
+
const next_4 = e_7.relatedTarget;
|
|
1184
1250
|
isTabbingRef.current = false;
|
|
1185
1251
|
if (!isTabbing || !next_4 || !rootRef.current?.contains(next_4)) return;
|
|
1186
1252
|
setIsPopoverOpen(false);
|
|
1187
1253
|
settleDraft();
|
|
1188
1254
|
};
|
|
1189
|
-
$[
|
|
1190
|
-
$[
|
|
1191
|
-
$[
|
|
1192
|
-
$[
|
|
1193
|
-
} else
|
|
1194
|
-
const handleInputBlur = useEvent(
|
|
1195
|
-
let
|
|
1196
|
-
if ($[
|
|
1197
|
-
|
|
1255
|
+
$[194] = rootRef;
|
|
1256
|
+
$[195] = setIsPopoverOpen;
|
|
1257
|
+
$[196] = settleDraft;
|
|
1258
|
+
$[197] = t38;
|
|
1259
|
+
} else t38 = $[197];
|
|
1260
|
+
const handleInputBlur = useEvent(t38);
|
|
1261
|
+
let t39;
|
|
1262
|
+
if ($[198] !== hasOptions || $[199] !== isInteractive || $[200] !== popoverTrigger || $[201] !== setIsPopoverOpen) {
|
|
1263
|
+
t39 = () => {
|
|
1198
1264
|
if (hasOptions && popoverTrigger === "focus" && isInteractive) setIsPopoverOpen(true);
|
|
1199
1265
|
};
|
|
1200
|
-
$[
|
|
1201
|
-
$[
|
|
1202
|
-
$[
|
|
1203
|
-
$[
|
|
1204
|
-
$[
|
|
1205
|
-
} else
|
|
1206
|
-
const handleInputFocus = useEvent(
|
|
1266
|
+
$[198] = hasOptions;
|
|
1267
|
+
$[199] = isInteractive;
|
|
1268
|
+
$[200] = popoverTrigger;
|
|
1269
|
+
$[201] = setIsPopoverOpen;
|
|
1270
|
+
$[202] = t39;
|
|
1271
|
+
} else t39 = $[202];
|
|
1272
|
+
const handleInputFocus = useEvent(t39);
|
|
1207
1273
|
const tags = uniqueValues.map((value_5) => {
|
|
1208
1274
|
const ownProps = tagProps?.(value_5);
|
|
1209
|
-
const
|
|
1275
|
+
const result = !(getOption(value_5) != null || knownLabels.has(value_5)) && validateTag ? validateTag(value_5) : true;
|
|
1210
1276
|
const label_1 = textLabel(ownProps?.children) ?? getOptionLabel(value_5);
|
|
1211
1277
|
return {
|
|
1212
1278
|
key: value_5,
|
|
1213
1279
|
label: label_1,
|
|
1214
|
-
invalidMessage: typeof
|
|
1280
|
+
invalidMessage: typeof result === "string" ? result : result === false ? t("tagInput.invalidValue", "\"{{value}}\" is not a valid value", { value: label_1 }) : void 0,
|
|
1215
1281
|
tagProps: ownProps,
|
|
1216
1282
|
isDisabled: !!ownProps?.isDisabled
|
|
1217
1283
|
};
|
|
1218
1284
|
});
|
|
1219
1285
|
const effectiveIsInvalid = tagError ? true : isInvalid;
|
|
1220
|
-
const hasRemovableTags = tags.some(
|
|
1286
|
+
const hasRemovableTags = tags.some(_temp8);
|
|
1221
1287
|
const hasBackspaceHint = isInteractive && hasRemovableTags;
|
|
1222
|
-
const lockedKeys = tags.filter(
|
|
1288
|
+
const lockedKeys = tags.filter(_temp9).map(_temp0);
|
|
1223
1289
|
const optionDisabledKeys = lockedKeys.length ? [...disabledKeySet, ...lockedKeys] : disabledKeys;
|
|
1224
|
-
let
|
|
1225
|
-
if ($[
|
|
1226
|
-
|
|
1290
|
+
let t40;
|
|
1291
|
+
if ($[203] !== autoFocus || $[204] !== draft || $[205] !== effectiveIsInvalid || $[206] !== handleInputChange || $[207] !== id || $[208] !== isDisabled || $[209] !== isReadOnly || $[210] !== isRequired || $[211] !== label || $[212] !== otherProps || $[213] !== placeholder) {
|
|
1292
|
+
t40 = {
|
|
1227
1293
|
...otherProps,
|
|
1228
1294
|
id,
|
|
1229
1295
|
label,
|
|
@@ -1236,31 +1302,31 @@ function TagInput(props, ref) {
|
|
|
1236
1302
|
autoFocus,
|
|
1237
1303
|
onChange: handleInputChange
|
|
1238
1304
|
};
|
|
1239
|
-
$[
|
|
1240
|
-
$[
|
|
1241
|
-
$[
|
|
1242
|
-
$[
|
|
1243
|
-
$[
|
|
1244
|
-
$[
|
|
1245
|
-
$[
|
|
1246
|
-
$[
|
|
1247
|
-
$[
|
|
1248
|
-
$[
|
|
1249
|
-
$[
|
|
1250
|
-
$[
|
|
1251
|
-
} else
|
|
1252
|
-
const { labelProps, inputProps } = useTextField(
|
|
1305
|
+
$[203] = autoFocus;
|
|
1306
|
+
$[204] = draft;
|
|
1307
|
+
$[205] = effectiveIsInvalid;
|
|
1308
|
+
$[206] = handleInputChange;
|
|
1309
|
+
$[207] = id;
|
|
1310
|
+
$[208] = isDisabled;
|
|
1311
|
+
$[209] = isReadOnly;
|
|
1312
|
+
$[210] = isRequired;
|
|
1313
|
+
$[211] = label;
|
|
1314
|
+
$[212] = otherProps;
|
|
1315
|
+
$[213] = placeholder;
|
|
1316
|
+
$[214] = t40;
|
|
1317
|
+
} else t40 = $[214];
|
|
1318
|
+
const { labelProps, inputProps } = useTextField(t40, inputRef);
|
|
1253
1319
|
const ariaLabel = props["aria-label"];
|
|
1254
1320
|
const ariaLabelledby = props["aria-labelledby"];
|
|
1255
1321
|
const labelId = label ? labelProps.id : void 0;
|
|
1256
|
-
let
|
|
1257
|
-
if ($[
|
|
1258
|
-
|
|
1259
|
-
$[
|
|
1260
|
-
$[
|
|
1261
|
-
$[
|
|
1262
|
-
} else
|
|
1263
|
-
const fieldLabelledby =
|
|
1322
|
+
let t41;
|
|
1323
|
+
if ($[215] !== ariaLabelledby || $[216] !== labelId) {
|
|
1324
|
+
t41 = [labelId, ariaLabelledby].filter(Boolean).join(" ") || void 0;
|
|
1325
|
+
$[215] = ariaLabelledby;
|
|
1326
|
+
$[216] = labelId;
|
|
1327
|
+
$[217] = t41;
|
|
1328
|
+
} else t41 = $[217];
|
|
1329
|
+
const fieldLabelledby = t41;
|
|
1264
1330
|
const describedBy = [];
|
|
1265
1331
|
if (inputProps["aria-describedby"]) describedBy.push(inputProps["aria-describedby"]);
|
|
1266
1332
|
if (tags.length) describedBy.push(summaryId);
|
|
@@ -1273,117 +1339,99 @@ function TagInput(props, ref) {
|
|
|
1273
1339
|
autoComplete,
|
|
1274
1340
|
"data-input-type": "taginput",
|
|
1275
1341
|
"aria-describedby": describedBy.join(" ") || void 0
|
|
1276
|
-
}, hasOptions ?
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
"aria-expanded": shouldShowPopover,
|
|
1281
|
-
"aria-controls": shouldShowPopover ? listBoxId : void 0,
|
|
1282
|
-
"aria-activedescendant": shouldShowPopover && activeOptionKey != null ? getListBoxOptionId(listBoxId, activeOptionKey) : void 0
|
|
1283
|
-
} : null);
|
|
1284
|
-
let t45;
|
|
1285
|
-
if ($[212] !== hasResults || $[213] !== inputRef || $[214] !== setIsFilterActive || $[215] !== setIsPopoverOpen || $[216] !== shouldShowPopover) {
|
|
1286
|
-
t45 = () => {
|
|
1342
|
+
}, hasOptions ? getComboboxProps(listBoxId, shouldShowPopover, activeOptionKey) : null);
|
|
1343
|
+
let t42;
|
|
1344
|
+
if ($[218] !== hasResults || $[219] !== inputRef || $[220] !== setIsFilterActive || $[221] !== setIsPopoverOpen || $[222] !== shouldShowPopover) {
|
|
1345
|
+
t42 = () => {
|
|
1287
1346
|
const willOpen = !shouldShowPopover;
|
|
1288
1347
|
if (willOpen && !hasResults) setIsFilterActive(false);
|
|
1289
1348
|
setIsPopoverOpen(willOpen);
|
|
1290
1349
|
inputRef.current?.focus();
|
|
1291
1350
|
};
|
|
1292
|
-
$[
|
|
1293
|
-
$[
|
|
1294
|
-
$[
|
|
1295
|
-
$[
|
|
1296
|
-
$[
|
|
1297
|
-
$[
|
|
1298
|
-
} else
|
|
1299
|
-
const handleTriggerPress = useEvent(
|
|
1300
|
-
let
|
|
1301
|
-
if ($[
|
|
1302
|
-
|
|
1303
|
-
"data-popover-trigger": true,
|
|
1351
|
+
$[218] = hasResults;
|
|
1352
|
+
$[219] = inputRef;
|
|
1353
|
+
$[220] = setIsFilterActive;
|
|
1354
|
+
$[221] = setIsPopoverOpen;
|
|
1355
|
+
$[222] = shouldShowPopover;
|
|
1356
|
+
$[223] = t42;
|
|
1357
|
+
} else t42 = $[223];
|
|
1358
|
+
const handleTriggerPress = useEvent(t42);
|
|
1359
|
+
let t43;
|
|
1360
|
+
if ($[224] !== ariaLabel || $[225] !== fieldLabelledby || $[226] !== handleTriggerPress || $[227] !== hasOptions || $[228] !== hideTrigger || $[229] !== isInteractive || $[230] !== shouldShowPopover || $[231] !== size || $[232] !== triggerId || $[233] !== triggerStyles) {
|
|
1361
|
+
t43 = hasOptions && !hideTrigger ? /* @__PURE__ */ jsx(TagInputTrigger, {
|
|
1304
1362
|
id: triggerId,
|
|
1305
|
-
qa: "TagInputTrigger",
|
|
1306
|
-
icon: /* @__PURE__ */ jsx(DirectionIcon, { to: shouldShowPopover ? "up" : "down" }),
|
|
1307
1363
|
size,
|
|
1364
|
+
ariaLabel,
|
|
1365
|
+
fieldLabelledby,
|
|
1366
|
+
isOpen: shouldShowPopover,
|
|
1308
1367
|
isDisabled: !isInteractive,
|
|
1309
1368
|
styles: triggerStyles,
|
|
1310
|
-
mods: { pressed: shouldShowPopover },
|
|
1311
|
-
tabIndex: -1,
|
|
1312
|
-
"aria-expanded": shouldShowPopover,
|
|
1313
|
-
"aria-haspopup": "listbox",
|
|
1314
|
-
"aria-label": ariaLabel ? t("tagInput.showOptionsFor", "Show options, {{label}}", { label: ariaLabel }) : t("tagInput.showOptions", "Show options"),
|
|
1315
|
-
"aria-labelledby": fieldLabelledby ? `${triggerId} ${fieldLabelledby}` : void 0,
|
|
1316
1369
|
onPress: handleTriggerPress
|
|
1317
1370
|
}) : null;
|
|
1318
|
-
$[
|
|
1319
|
-
$[
|
|
1320
|
-
$[
|
|
1321
|
-
$[
|
|
1322
|
-
$[
|
|
1323
|
-
$[
|
|
1324
|
-
$[
|
|
1325
|
-
$[
|
|
1326
|
-
$[
|
|
1327
|
-
$[
|
|
1328
|
-
$[
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
t47 = () => {
|
|
1371
|
+
$[224] = ariaLabel;
|
|
1372
|
+
$[225] = fieldLabelledby;
|
|
1373
|
+
$[226] = handleTriggerPress;
|
|
1374
|
+
$[227] = hasOptions;
|
|
1375
|
+
$[228] = hideTrigger;
|
|
1376
|
+
$[229] = isInteractive;
|
|
1377
|
+
$[230] = shouldShowPopover;
|
|
1378
|
+
$[231] = size;
|
|
1379
|
+
$[232] = triggerId;
|
|
1380
|
+
$[233] = triggerStyles;
|
|
1381
|
+
$[234] = t43;
|
|
1382
|
+
} else t43 = $[234];
|
|
1383
|
+
const trigger = t43;
|
|
1384
|
+
let t44;
|
|
1385
|
+
if ($[235] !== inputRef || $[236] !== onClear || $[237] !== setDraft || $[238] !== setIsPopoverOpen || $[239] !== setTagError) {
|
|
1386
|
+
t44 = () => {
|
|
1335
1387
|
inputRef.current?.focus();
|
|
1336
1388
|
setDraft("");
|
|
1337
1389
|
setTagError(null);
|
|
1338
1390
|
setIsPopoverOpen(false);
|
|
1339
1391
|
onClear?.();
|
|
1340
1392
|
};
|
|
1341
|
-
$[
|
|
1342
|
-
$[
|
|
1343
|
-
$[
|
|
1344
|
-
$[
|
|
1345
|
-
$[
|
|
1346
|
-
$[
|
|
1347
|
-
} else
|
|
1348
|
-
const clearText = useEvent(
|
|
1393
|
+
$[235] = inputRef;
|
|
1394
|
+
$[236] = onClear;
|
|
1395
|
+
$[237] = setDraft;
|
|
1396
|
+
$[238] = setIsPopoverOpen;
|
|
1397
|
+
$[239] = setTagError;
|
|
1398
|
+
$[240] = t44;
|
|
1399
|
+
} else t44 = $[240];
|
|
1400
|
+
const clearText = useEvent(t44);
|
|
1349
1401
|
const canClear = !!isClearable && isInteractive && draft !== "";
|
|
1350
|
-
let
|
|
1351
|
-
if ($[
|
|
1352
|
-
|
|
1402
|
+
let t45;
|
|
1403
|
+
if ($[241] !== ariaLabel || $[242] !== canClear || $[243] !== clearId || $[244] !== clearText || $[245] !== fieldLabelledby || $[246] !== size) {
|
|
1404
|
+
t45 = canClear ? /* @__PURE__ */ jsx(TagInputClearButton, {
|
|
1353
1405
|
id: clearId,
|
|
1354
|
-
qa: "TagInputClearButton",
|
|
1355
|
-
icon: /* @__PURE__ */ jsx(CloseIcon, {}),
|
|
1356
1406
|
size,
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
"aria-labelledby": fieldLabelledby ? `${clearId} ${fieldLabelledby}` : void 0,
|
|
1407
|
+
ariaLabel,
|
|
1408
|
+
fieldLabelledby,
|
|
1360
1409
|
onPress: clearText
|
|
1361
1410
|
}) : null;
|
|
1362
|
-
$[
|
|
1363
|
-
$[
|
|
1364
|
-
$[
|
|
1365
|
-
$[
|
|
1366
|
-
$[
|
|
1367
|
-
$[
|
|
1368
|
-
$[
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
const clearButton = t48;
|
|
1411
|
+
$[241] = ariaLabel;
|
|
1412
|
+
$[242] = canClear;
|
|
1413
|
+
$[243] = clearId;
|
|
1414
|
+
$[244] = clearText;
|
|
1415
|
+
$[245] = fieldLabelledby;
|
|
1416
|
+
$[246] = size;
|
|
1417
|
+
$[247] = t45;
|
|
1418
|
+
} else t45 = $[247];
|
|
1419
|
+
const clearButton = t45;
|
|
1372
1420
|
const hasActions = clearButton != null || trigger != null;
|
|
1373
1421
|
const T0 = TagInputElement;
|
|
1374
|
-
const
|
|
1375
|
-
let
|
|
1376
|
-
if ($[
|
|
1377
|
-
|
|
1378
|
-
$[
|
|
1379
|
-
$[
|
|
1380
|
-
$[
|
|
1381
|
-
$[
|
|
1382
|
-
} else
|
|
1383
|
-
let
|
|
1384
|
-
if ($[
|
|
1385
|
-
|
|
1386
|
-
qa:
|
|
1422
|
+
const t46 = qa || "TagInput";
|
|
1423
|
+
let t47;
|
|
1424
|
+
if ($[248] !== clearButton || $[249] !== hasActions || $[250] !== trigger) {
|
|
1425
|
+
t47 = hasActions ? /* @__PURE__ */ jsxs(Fragment$1, { children: [clearButton, trigger] }) : null;
|
|
1426
|
+
$[248] = clearButton;
|
|
1427
|
+
$[249] = hasActions;
|
|
1428
|
+
$[250] = trigger;
|
|
1429
|
+
$[251] = t47;
|
|
1430
|
+
} else t47 = $[251];
|
|
1431
|
+
let t48;
|
|
1432
|
+
if ($[252] !== autoFocus || $[253] !== effectiveIsInvalid || $[254] !== icon || $[255] !== inputRef || $[256] !== inputStyles || $[257] !== isDisabled || $[258] !== isLoading || $[259] !== isValid || $[260] !== mods || $[261] !== prefix || $[262] !== size || $[263] !== suffix || $[264] !== suffixPosition || $[265] !== t46 || $[266] !== t47 || $[267] !== tagInputProps || $[268] !== wrapperRef || $[269] !== wrapperStyles) {
|
|
1433
|
+
t48 = /* @__PURE__ */ jsx(TextInputBase, {
|
|
1434
|
+
qa: t46,
|
|
1387
1435
|
inputRef,
|
|
1388
1436
|
wrapperRef,
|
|
1389
1437
|
inputProps: tagInputProps,
|
|
@@ -1392,7 +1440,7 @@ function TagInput(props, ref) {
|
|
|
1392
1440
|
prefix,
|
|
1393
1441
|
suffix,
|
|
1394
1442
|
suffixPosition,
|
|
1395
|
-
actions:
|
|
1443
|
+
actions: t47,
|
|
1396
1444
|
size,
|
|
1397
1445
|
autoFocus,
|
|
1398
1446
|
isDisabled,
|
|
@@ -1402,27 +1450,27 @@ function TagInput(props, ref) {
|
|
|
1402
1450
|
styles: wrapperStyles,
|
|
1403
1451
|
inputStyles
|
|
1404
1452
|
});
|
|
1405
|
-
$[
|
|
1406
|
-
$[
|
|
1407
|
-
$[
|
|
1408
|
-
$[
|
|
1409
|
-
$[
|
|
1410
|
-
$[
|
|
1411
|
-
$[
|
|
1412
|
-
$[
|
|
1413
|
-
$[
|
|
1414
|
-
$[
|
|
1415
|
-
$[
|
|
1416
|
-
$[
|
|
1417
|
-
$[
|
|
1418
|
-
$[
|
|
1419
|
-
$[
|
|
1420
|
-
$[
|
|
1421
|
-
$[
|
|
1422
|
-
$[
|
|
1423
|
-
$[
|
|
1424
|
-
} else
|
|
1425
|
-
const
|
|
1453
|
+
$[252] = autoFocus;
|
|
1454
|
+
$[253] = effectiveIsInvalid;
|
|
1455
|
+
$[254] = icon;
|
|
1456
|
+
$[255] = inputRef;
|
|
1457
|
+
$[256] = inputStyles;
|
|
1458
|
+
$[257] = isDisabled;
|
|
1459
|
+
$[258] = isLoading;
|
|
1460
|
+
$[259] = isValid;
|
|
1461
|
+
$[260] = mods;
|
|
1462
|
+
$[261] = prefix;
|
|
1463
|
+
$[262] = size;
|
|
1464
|
+
$[263] = suffix;
|
|
1465
|
+
$[264] = suffixPosition;
|
|
1466
|
+
$[265] = t46;
|
|
1467
|
+
$[266] = t47;
|
|
1468
|
+
$[267] = tagInputProps;
|
|
1469
|
+
$[268] = wrapperRef;
|
|
1470
|
+
$[269] = wrapperStyles;
|
|
1471
|
+
$[270] = t48;
|
|
1472
|
+
} else t48 = $[270];
|
|
1473
|
+
const t49 = tags.length ? /* @__PURE__ */ jsx(TagList, {
|
|
1426
1474
|
id: tagListId,
|
|
1427
1475
|
listRef: tagListRef,
|
|
1428
1476
|
inputRef,
|
|
@@ -1436,50 +1484,50 @@ function TagInput(props, ref) {
|
|
|
1436
1484
|
tagStyles,
|
|
1437
1485
|
onRemove: removeValues
|
|
1438
1486
|
}) : null;
|
|
1439
|
-
const
|
|
1440
|
-
const
|
|
1441
|
-
let
|
|
1442
|
-
if ($[
|
|
1443
|
-
|
|
1444
|
-
hidden:
|
|
1487
|
+
const t50 = true;
|
|
1488
|
+
const t51 = tags.length ? t("tagInput.summary", "Selected: {{values}}.", { values: formatList(tags.map(_temp1)) }) : null;
|
|
1489
|
+
let t52;
|
|
1490
|
+
if ($[271] !== summaryId || $[272] !== t51) {
|
|
1491
|
+
t52 = /* @__PURE__ */ jsx("span", {
|
|
1492
|
+
hidden: t50,
|
|
1445
1493
|
id: summaryId,
|
|
1446
|
-
children:
|
|
1494
|
+
children: t51
|
|
1447
1495
|
});
|
|
1448
|
-
$[
|
|
1449
|
-
$[
|
|
1450
|
-
$[
|
|
1451
|
-
} else
|
|
1452
|
-
let
|
|
1453
|
-
if ($[
|
|
1454
|
-
|
|
1455
|
-
$[
|
|
1456
|
-
$[
|
|
1457
|
-
$[
|
|
1458
|
-
} else
|
|
1459
|
-
let
|
|
1460
|
-
if ($[
|
|
1461
|
-
|
|
1496
|
+
$[271] = summaryId;
|
|
1497
|
+
$[272] = t51;
|
|
1498
|
+
$[273] = t52;
|
|
1499
|
+
} else t52 = $[273];
|
|
1500
|
+
let t53;
|
|
1501
|
+
if ($[274] !== hasBackspaceHint || $[275] !== t) {
|
|
1502
|
+
t53 = hasBackspaceHint ? t("tagInput.backspaceHint", "Press Backspace to go to the selected values.") : null;
|
|
1503
|
+
$[274] = hasBackspaceHint;
|
|
1504
|
+
$[275] = t;
|
|
1505
|
+
$[276] = t53;
|
|
1506
|
+
} else t53 = $[276];
|
|
1507
|
+
let t54;
|
|
1508
|
+
if ($[277] !== hintId || $[278] !== t53) {
|
|
1509
|
+
t54 = /* @__PURE__ */ jsx("span", {
|
|
1462
1510
|
hidden: true,
|
|
1463
1511
|
id: hintId,
|
|
1464
|
-
children:
|
|
1512
|
+
children: t53
|
|
1465
1513
|
});
|
|
1466
|
-
$[
|
|
1467
|
-
$[
|
|
1468
|
-
$[
|
|
1469
|
-
} else
|
|
1470
|
-
let
|
|
1471
|
-
if ($[
|
|
1472
|
-
|
|
1514
|
+
$[277] = hintId;
|
|
1515
|
+
$[278] = t53;
|
|
1516
|
+
$[279] = t54;
|
|
1517
|
+
} else t54 = $[279];
|
|
1518
|
+
let t55;
|
|
1519
|
+
if ($[280] !== announcement.id || $[281] !== announcement.text) {
|
|
1520
|
+
t55 = /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
1473
1521
|
role: "status",
|
|
1474
1522
|
"aria-live": "polite",
|
|
1475
1523
|
"aria-atomic": "true",
|
|
1476
1524
|
children: /* @__PURE__ */ jsx("span", { children: announcement.text }, announcement.id)
|
|
1477
1525
|
});
|
|
1478
|
-
$[
|
|
1479
|
-
$[
|
|
1480
|
-
$[
|
|
1481
|
-
} else
|
|
1482
|
-
const
|
|
1526
|
+
$[280] = announcement.id;
|
|
1527
|
+
$[281] = announcement.text;
|
|
1528
|
+
$[282] = t55;
|
|
1529
|
+
} else t55 = $[282];
|
|
1530
|
+
const t56 = hasOptions ? /* @__PURE__ */ jsx(ListBoxPopover, {
|
|
1483
1531
|
isOpen: shouldShowPopover,
|
|
1484
1532
|
triggerRef: wrapperRef,
|
|
1485
1533
|
popoverRef,
|
|
@@ -1514,9 +1562,9 @@ function TagInput(props, ref) {
|
|
|
1514
1562
|
onClose: () => setIsPopoverOpen(false),
|
|
1515
1563
|
children: popoverChildren
|
|
1516
1564
|
}) : null;
|
|
1517
|
-
let
|
|
1518
|
-
if ($[
|
|
1519
|
-
|
|
1565
|
+
let t57;
|
|
1566
|
+
if ($[283] !== T0 || $[284] !== className || $[285] !== compositeFocusProps || $[286] !== qaVal || $[287] !== rootRef || $[288] !== style || $[289] !== styles || $[290] !== t48 || $[291] !== t49 || $[292] !== t52 || $[293] !== t54 || $[294] !== t55 || $[295] !== t56) {
|
|
1567
|
+
t57 = /* @__PURE__ */ jsxs(T0, {
|
|
1520
1568
|
ref: rootRef,
|
|
1521
1569
|
className,
|
|
1522
1570
|
style,
|
|
@@ -1524,44 +1572,44 @@ function TagInput(props, ref) {
|
|
|
1524
1572
|
styles,
|
|
1525
1573
|
...compositeFocusProps,
|
|
1526
1574
|
children: [
|
|
1527
|
-
|
|
1575
|
+
t48,
|
|
1576
|
+
t49,
|
|
1528
1577
|
t52,
|
|
1578
|
+
t54,
|
|
1529
1579
|
t55,
|
|
1530
|
-
|
|
1531
|
-
t58,
|
|
1532
|
-
t59
|
|
1580
|
+
t56
|
|
1533
1581
|
]
|
|
1534
1582
|
});
|
|
1535
|
-
$[
|
|
1536
|
-
$[
|
|
1537
|
-
$[
|
|
1538
|
-
$[
|
|
1539
|
-
$[
|
|
1540
|
-
$[
|
|
1541
|
-
$[
|
|
1542
|
-
$[
|
|
1543
|
-
$[
|
|
1544
|
-
$[
|
|
1545
|
-
$[
|
|
1546
|
-
$[
|
|
1547
|
-
$[
|
|
1548
|
-
$[
|
|
1549
|
-
} else
|
|
1550
|
-
const tagInputField =
|
|
1583
|
+
$[283] = T0;
|
|
1584
|
+
$[284] = className;
|
|
1585
|
+
$[285] = compositeFocusProps;
|
|
1586
|
+
$[286] = qaVal;
|
|
1587
|
+
$[287] = rootRef;
|
|
1588
|
+
$[288] = style;
|
|
1589
|
+
$[289] = styles;
|
|
1590
|
+
$[290] = t48;
|
|
1591
|
+
$[291] = t49;
|
|
1592
|
+
$[292] = t52;
|
|
1593
|
+
$[293] = t54;
|
|
1594
|
+
$[294] = t55;
|
|
1595
|
+
$[295] = t56;
|
|
1596
|
+
$[296] = t57;
|
|
1597
|
+
} else t57 = $[296];
|
|
1598
|
+
const tagInputField = t57;
|
|
1551
1599
|
const { children: _children, ...fieldProps } = props;
|
|
1552
1600
|
const fieldRef = useCombinedRefs();
|
|
1553
|
-
let
|
|
1554
|
-
if ($[
|
|
1555
|
-
|
|
1556
|
-
$[
|
|
1557
|
-
$[
|
|
1558
|
-
$[
|
|
1559
|
-
} else
|
|
1601
|
+
let t58;
|
|
1602
|
+
if ($[297] !== message || $[298] !== tagError) {
|
|
1603
|
+
t58 = tagError ? /* @__PURE__ */ jsx("span", { children: tagError.text }, tagError.id) : message;
|
|
1604
|
+
$[297] = message;
|
|
1605
|
+
$[298] = tagError;
|
|
1606
|
+
$[299] = t58;
|
|
1607
|
+
} else t58 = $[299];
|
|
1560
1608
|
return wrapWithField(tagInputField, fieldRef, {
|
|
1561
1609
|
...fieldProps,
|
|
1562
1610
|
labelProps: mergeProps$1(labelProps, userLabelProps),
|
|
1563
1611
|
isInvalid: effectiveIsInvalid,
|
|
1564
|
-
message:
|
|
1612
|
+
message: t58,
|
|
1565
1613
|
errorMessage: tagError ? void 0 : errorMessage
|
|
1566
1614
|
});
|
|
1567
1615
|
}
|
|
@@ -1570,38 +1618,35 @@ function TagInput(props, ref) {
|
|
|
1570
1618
|
* input. Values are typed (Enter or a separator commits them) or picked from
|
|
1571
1619
|
* suggested options.
|
|
1572
1620
|
*/
|
|
1573
|
-
function
|
|
1621
|
+
function _temp1(tag_2) {
|
|
1574
1622
|
return tag_2.label;
|
|
1575
1623
|
}
|
|
1576
|
-
function
|
|
1624
|
+
function _temp0(tag_1) {
|
|
1577
1625
|
return tag_1.key;
|
|
1578
1626
|
}
|
|
1579
|
-
function
|
|
1627
|
+
function _temp9(tag_0) {
|
|
1580
1628
|
return tag_0.isDisabled;
|
|
1581
1629
|
}
|
|
1582
|
-
function
|
|
1630
|
+
function _temp8(tag) {
|
|
1583
1631
|
return !tag.isDisabled;
|
|
1584
1632
|
}
|
|
1585
|
-
function
|
|
1633
|
+
function _temp7(part_1) {
|
|
1586
1634
|
return part_1.trim();
|
|
1587
1635
|
}
|
|
1588
|
-
function
|
|
1589
|
-
return
|
|
1636
|
+
function _temp6(rejection_2) {
|
|
1637
|
+
return rejection_2.text;
|
|
1590
1638
|
}
|
|
1591
|
-
function
|
|
1592
|
-
return
|
|
1639
|
+
function _temp5(rejection_1) {
|
|
1640
|
+
return rejection_1.reason !== "duplicate";
|
|
1593
1641
|
}
|
|
1594
|
-
function
|
|
1642
|
+
function _temp4(delimiter) {
|
|
1595
1643
|
return delimiter && !LINE_BREAK.test(delimiter);
|
|
1596
1644
|
}
|
|
1597
|
-
function
|
|
1645
|
+
function _temp3(node_1) {
|
|
1598
1646
|
return node_1.type === "section";
|
|
1599
1647
|
}
|
|
1600
|
-
function _temp3() {
|
|
1601
|
-
return /* @__PURE__ */ new Map();
|
|
1602
|
-
}
|
|
1603
1648
|
function _temp2() {
|
|
1604
|
-
return
|
|
1649
|
+
return /* @__PURE__ */ new Map();
|
|
1605
1650
|
}
|
|
1606
1651
|
function _temp(t0) {
|
|
1607
1652
|
const { value, onChange } = t0;
|