@cube-dev/ui-kit 0.210.0 → 0.211.0
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 +14 -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/AutoCollapseObserver.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/Button/index.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/item-table-sections.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRowLink.js +1 -1
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-body-sections.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/CalendarPopover.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +5 -2
- package/dist/components/fields/DatePicker/DateInputBase.js.map +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 +64 -65
- package/dist/components/fields/DatePicker/PeriodPicker.js.map +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.d.ts +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +3 -1
- package/dist/components/fields/FilterPicker/FilterTree.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +1 -0
- package/dist/components/fields/ListBox/ListBox.js +3 -1
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/empty-row.js +12 -0
- package/dist/components/fields/ListBox/empty-row.js.map +1 -0
- 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 +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/FormContext.js +1 -1
- package/dist/components/form/Form/FormElement.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +7 -3
- package/dist/components/form/Form/modern/store.js.map +1 -1
- package/dist/components/form/Form/modern/validation.js +11 -2
- package/dist/components/form/Form/modern/validation.js.map +1 -1
- package/dist/components/form/Form/modern/values.js +10 -2
- package/dist/components/form/Form/modern/values.js.map +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/field-layout.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/segmented-styles.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/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +1 -1
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/fields/FilterListBox.md +1 -1
- package/docs/components/fields/FilterPicker.md +1 -1
- package/docs/components/fields/ListBox.md +1 -1
- package/docs/components/form/ModernForm.md +2 -2
- package/docs/modern-form-guide.md +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterListBox.js","names":["ItemElement","Key","modAttrs","Styles","cloneElement","ForwardedRef","forwardRef","isValidElement","ReactElement","ReactNode","RefObject","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","useFilter","useFocusWithin","useId","useKeyboard","Section","BaseSection","useListState","useEvent","useI18n","LoadingIcon","useFocus","mergeProps","useCombinedRefs","CubeCollectionItemProps","CollectionItem","Item","splitFieldLayout","useFieldProps","getValidationMods","wrapWithField","CubeListBoxProps","ListBox","getListBoxOptionId","getEdgeVisibleKey","getNextVisibleKey","markKeyboardFocus","FilterListBoxWrapperElement","SearchInputElement","SearchWrapperElement","StyledHeaderWithoutBorder","Collection","Node","FieldBaseProps","FilterFn","textValue","inputValue","CubeFilterListBoxProps","Omit","T","searchPlaceholder","autoFocus","filter","emptyLabel","searchInputStyles","isLoading","isLoadingItems","searchInputRef","HTMLInputElement","allowsCustomValue","mods","Record","listBoxStyles","onEscape","isCheckable","onOptionClick","key","customValueProps","Partial","newCustomValueProps","searchValue","onSearchChange","value","_internalCollection","FilterListBox","props","ref","HTMLDivElement","valuePropsMapper","onChange","fieldProps","selectionMode","selectedKeys","selectedKey","onSelectionChange","Array","isArray","t","qa","label","extra","id","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","isDisabled","externalMods","listStyles","optionStyles","sectionStyles","headingStyles","listGap","listRef","message","description","styles","focusOnHover","shouldFocusWrap","labelSuffix","defaultSelectedKey","defaultSelectedKeys","externalOnSelectionChange","showSelectAll","selectAllLabel","header","footer","size","headerStyles","footerStyles","items","children","renderChildren","allValueProps","controlledSearchValue","isReorderable","onReorder","form","renderFn","itemsArray","from","Iterable","map","item","idx","rendered","it","localCollectionState","collection","originalKeys","keys","Set","type","add","String","customKeys","setCustomKeys","internalSearchValue","setInternalSearchValue","isSearchControlled","undefined","contains","sensitivity","currentSelectedKeys","length","keysToAdd","k","has","prev","mergedChildren","term","trim","localFilter","customArray","selectedKeysSet","forEach","selectedCustom","unselectedCustom","push","originalArray","innerAriaLabel","handleSearchChange","textFilterFn","filterFn","nodes","node","childNodes","filteredNodes","child","hasChildNodes","Boolean","enhancedChildren","childrenToProcess","doesTermExist","hasVisibleFilteredItems","customKey","customOption","hasSections","some","customValueSection","filteredItemsSection","fieldLayout","fillHeightOnFlex","isFocused","focusProps","isFocusWithin","setIsFocusWithin","focusWithinProps","onFocusWithinChange","listBoxRef","listBoxId","listStateRef","activeOptionKey","setActiveOptionKey","setVirtualFocus","current","selectionManager","setFocusedKey","listState","newCustomValueKey","customValueHasMatches","collectFocusableKeys","out","inCustomSection","disabledKeys","isCustomSection","visibleKeys","customValueShouldBeFocused","currentFocused","focusedKey","includes","currentIsNewCustomValue","keepsFocus","findFirstVisibleSelectedKey","selectedKeyStr","keyStr","keyToFocus","firstRealKey","find","lastFocusSourceRef","keyboardProps","onKeyDown","e","preventDefault","nextKey","wrap","targetKey","keyToSelect","select","disabled","focused","loading","searchable","prefix","suffix","handleSelectionChange","selection","selectedValues","nextSet","val","handleOptionClick","setTimeout","focus","searchInput","target","filterListBoxField","disallowEmptySelection","allowDuplicateSelectionEvents","field","Object","defineProperty","enumerable","configurable","Item","mergeProps","BaseSection","useFocus","useId"],"sources":["../../../../src/components/fields/FilterListBox/FilterListBox.tsx"],"sourcesContent":["import { ItemElement, Key } from '@react-types/shared';\nimport { modAttrs, Styles } from '@tenphi/tasty';\nimport {\n cloneElement,\n ForwardedRef,\n forwardRef,\n isValidElement,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFilter, useFocusWithin, useId, useKeyboard } from 'react-aria';\nimport { Section as BaseSection, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { useI18n } from '../../../i18n/useI18n';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport { useCombinedRefs } from '../../../utils/react/useCombinedRefs';\nimport {\n CubeCollectionItemProps,\n CollectionItem as Item,\n} from '../../CollectionItem';\nimport { splitFieldLayout } from '../../form/field-layout';\nimport { useFieldProps } from '../../form/Form/use-field/use-field-props';\nimport { getValidationMods } from '../../form/validation/resolve-validation-props';\nimport { wrapWithField } from '../../form/wrapper';\nimport { CubeListBoxProps, ListBox } from '../ListBox/ListBox';\nimport { getListBoxOptionId } from '../ListBox/optionId';\nimport {\n getEdgeVisibleKey,\n getNextVisibleKey,\n markKeyboardFocus,\n} from '../ListBoxPopover/listNavigation';\n\nimport {\n FilterListBoxWrapperElement,\n SearchInputElement,\n SearchWrapperElement,\n StyledHeaderWithoutBorder,\n} from './styled';\n\nimport type { Collection, Node } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\nexport interface CubeFilterListBoxProps<T>\n // It sets `isFocusWithin` on its list itself.\n extends\n Omit<CubeListBoxProps<T>, 'filter' | 'isFocusWithin'>,\n FieldBaseProps<\n string | number | readonly (string | number)[] | null | undefined\n > {\n /** Placeholder text for the search input */\n searchPlaceholder?: string;\n /** Whether the search input should have autofocus */\n autoFocus?: boolean;\n /**\n * Custom filter function for determining if an option should be included in search results.\n * Pass `false` to disable internal filtering completely (useful for external filtering).\n */\n filter?: FilterFn | false;\n /** Label shown when the list is empty. When provided, overrides both the \"No results found\" and \"No items\" defaults. */\n emptyLabel?: ReactNode;\n /** Custom styles for the search input */\n searchInputStyles?: Styles;\n /** Whether the FilterListBox is in loading state (shows loading icon in search input) */\n isLoading?: boolean;\n /** Whether items are currently loading. Shows a loading icon in the search input suffix. */\n isLoadingItems?: boolean;\n /** Ref for accessing the search input element */\n searchInputRef?: RefObject<HTMLInputElement | null>;\n /** Whether to allow entering custom values that are not present in the predefined options */\n allowsCustomValue?: boolean;\n /** Additional modifiers for styling the FilterListBox */\n mods?: Record<string, boolean>;\n /** Custom styles for the list box */\n listBoxStyles?: Styles;\n\n /**\n * Callback fired when the user presses Escape key while the search input is empty.\n * Can be used by parent components (e.g. FilterPicker) to close an enclosing Dialog.\n */\n onEscape?: () => void;\n\n /**\n * Whether to show checkboxes for multiple selection mode.\n * This adds a checkbox icon to the left of each option.\n */\n isCheckable?: boolean;\n\n /**\n * Callback fired when an option is clicked but not on the checkbox area.\n * Used by FilterPicker to close the popover on non-checkbox clicks.\n */\n onOptionClick?: (key: Key) => void;\n\n /**\n * Props to apply to existing custom values (values that are already selected but not in the predefined options).\n */\n customValueProps?: Partial<CubeCollectionItemProps<T>>;\n\n /**\n * Props to apply to new custom values (values typed in the search input that are about to be added).\n * These are merged with customValueProps for new custom values.\n */\n newCustomValueProps?: Partial<CubeCollectionItemProps<T>>;\n\n /**\n * Controlled search value. When provided, the search input becomes controlled.\n * Use with `onSearchChange` to manage the search state externally.\n */\n searchValue?: string;\n\n /**\n * Callback fired when the search input value changes.\n * Use with `searchValue` for controlled search input.\n */\n onSearchChange?: (value: string) => void;\n\n /**\n * Pre-built collection to use instead of creating a new one.\n * Used internally by FilterPicker to avoid duplicate collection creation.\n * @internal\n */\n _internalCollection?: Collection<Node<any>>;\n}\n\nexport const FilterListBox = forwardRef(function FilterListBox<\n T extends object,\n>(props: CubeFilterListBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n props = useFieldProps(props, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: any = {};\n\n if (props.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: any) => {\n if (props.selectionMode === 'multiple') {\n // Handle \"all\" selection and array selections\n if (key === 'all') {\n onChange('all');\n } else {\n onChange(key ? (Array.isArray(key) ? key : [key]) : []);\n }\n } else {\n onChange(Array.isArray(key) ? key[0] : key);\n }\n };\n\n return fieldProps;\n },\n });\n\n const { t } = useI18n();\n\n let {\n qa,\n label,\n extra,\n id,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n isLoading,\n isLoadingItems,\n searchPlaceholder = t('filterListBox.searchPlaceholder', 'Search...'),\n autoFocus,\n filter,\n mods: externalMods,\n emptyLabel,\n searchInputStyles,\n listStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n searchInputRef,\n listRef,\n message,\n description,\n styles,\n focusOnHover,\n shouldFocusWrap,\n labelSuffix,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange: externalOnSelectionChange,\n allowsCustomValue = false,\n showSelectAll,\n selectAllLabel,\n header,\n footer,\n size = 'medium',\n headerStyles,\n footerStyles,\n listBoxStyles,\n items,\n children: renderChildren,\n onEscape,\n isCheckable,\n onOptionClick,\n selectionMode = 'single',\n allValueProps,\n customValueProps,\n newCustomValueProps,\n searchValue: controlledSearchValue,\n onSearchChange,\n _internalCollection,\n isReorderable = false,\n onReorder,\n form,\n } = props;\n\n // Preserve the original `children` (may be a render function) before we\n // potentially overwrite it.\n let children: ReactNode = renderChildren as ReactNode;\n\n const renderFn = renderChildren as unknown;\n\n if (items && typeof renderFn === 'function') {\n try {\n const itemsArray = Array.from(items as Iterable<any>);\n // Execute the render function for each item to obtain <Item/> / <Section/> nodes.\n children = itemsArray.map((item, idx) => {\n const rendered = (renderFn as (it: any) => ReactNode)(item);\n // Ensure every element has a stable key: rely on the user-provided key\n // inside the render function, otherwise fall back to the item itself or\n // the index. This mirrors React Aria examples where the render function\n // is expected to set keys, but we add a fallback for robustness.\n if (\n isValidElement(rendered) &&\n (rendered as ReactElement).key == null\n ) {\n return cloneElement(rendered as ReactElement, {\n key: (rendered as any)?.key ?? item?.key ?? idx,\n });\n }\n\n return rendered as ReactNode;\n });\n } catch {\n // If conversion fails for some reason, we silently ignore and proceed\n // with the original children value so we don't break runtime.\n }\n }\n\n // Use provided collection from FilterPicker or create our own\n // Hook call order is stable: _internalCollection is consistent per component instance\n const localCollectionState = _internalCollection\n ? { collection: _internalCollection }\n : useListState({\n children: children as any,\n items: items as any,\n selectionMode: 'none' as any,\n });\n\n // Collect original option keys to avoid duplicating them as custom values.\n const originalKeys = useMemo(() => {\n const keys = new Set<string>();\n for (const item of localCollectionState.collection) {\n if (item.type === 'item') {\n keys.add(String(item.key));\n }\n }\n return keys;\n }, [localCollectionState.collection]);\n\n // State to keep track of custom (user-entered) items that were selected.\n const [customKeys, setCustomKeys] = useState<Set<string>>(new Set());\n\n // Controlled/uncontrolled search value pattern\n const [internalSearchValue, setInternalSearchValue] = useState('');\n const isSearchControlled = controlledSearchValue !== undefined;\n const searchValue = isSearchControlled\n ? controlledSearchValue\n : internalSearchValue;\n\n const { contains } = useFilter({ sensitivity: 'base' });\n\n // Initialize custom keys from current selection\n useEffect(() => {\n if (!allowsCustomValue) return;\n\n const currentSelectedKeys = selectedKeys\n ? selectedKeys === 'all'\n ? [] // Skip custom key detection when 'all' is selected\n : Array.from(selectedKeys).map(String)\n : selectedKey != null\n ? [String(selectedKey)]\n : [];\n\n if (currentSelectedKeys.length === 0) return;\n\n const keysToAdd = currentSelectedKeys.filter((k) => !originalKeys.has(k));\n\n if (keysToAdd.length) {\n setCustomKeys((prev) => new Set([...Array.from(prev), ...keysToAdd]));\n }\n }, [allowsCustomValue, selectedKeys, selectedKey, originalKeys]);\n\n // Merge original children with any custom items so they persist in the list.\n // If there are selected custom values, they should appear on top with other\n // selected items (which are already sorted by the parent component, e.g. FilterPicker).\n const mergedChildren: ReactNode = useMemo(() => {\n if (!children && customKeys.size === 0) return children;\n\n // Selected custom values are injected by FilterListBox itself, not by the\n // parent. They must respect the search input regardless of the `filter`\n // prop — `filter={false}` only describes the parent's authority over its\n // own items. Filter them with the user-provided filter (if any) or the\n // default `contains`.\n const term = searchValue.trim();\n const localFilter: FilterFn =\n typeof filter === 'function' ? filter : contains;\n\n // Build React elements for custom values (kept stable via their key).\n const customArray = Array.from(customKeys)\n .filter((key) => !term || localFilter(key, term))\n .map((key) => (\n <Item key={key} textValue={key} {...customValueProps}>\n {key}\n </Item>\n ));\n\n // Identify which custom keys are currently selected so we can promote them.\n const selectedKeysSet = new Set<string>();\n\n if (selectionMode === 'multiple') {\n if (selectedKeys === 'all') {\n // When 'all' is selected, no custom items should be treated as selected\n // since 'all' means all available items, not custom ones\n } else {\n Array.from(selectedKeys ?? []).forEach((k) =>\n selectedKeysSet.add(String(k)),\n );\n }\n } else {\n if (selectedKey != null) selectedKeysSet.add(String(selectedKey));\n }\n\n const selectedCustom: ReactNode[] = [];\n const unselectedCustom: ReactNode[] = [];\n\n customArray.forEach((item: any) => {\n if (selectedKeysSet.has(String(item.key))) {\n selectedCustom.push(item);\n } else {\n unselectedCustom.push(item);\n }\n });\n\n if (!children) {\n // No original items – just return selected custom followed by the rest.\n return [...selectedCustom, ...unselectedCustom];\n }\n\n const originalArray = Array.isArray(children) ? children : [children];\n\n // Final order: selected custom items -> original array (already possibly\n // sorted by parent) -> unselected custom items.\n return [...selectedCustom, ...originalArray, ...unselectedCustom];\n }, [\n children,\n customKeys,\n selectionMode,\n selectedKey,\n selectedKeys,\n searchValue,\n filter,\n contains,\n customValueProps,\n ]);\n\n // Determine an aria-label for the internal ListBox to avoid React Aria warnings.\n const innerAriaLabel =\n (props as any)['aria-label'] ||\n (typeof label === 'string' ? label : undefined);\n\n const handleSearchChange = useCallback(\n (value: string) => {\n if (!isSearchControlled) {\n setInternalSearchValue(value);\n }\n onSearchChange?.(value);\n },\n [isSearchControlled, onSearchChange],\n );\n\n // Choose the text filter function: user-provided `filter` prop (if any),\n // or the default `contains` helper from `useFilter`.\n // When `filter={false}`, the parent owns filtering — we normally pass items\n // through unchanged. The exception is when `isLoadingItems` is `true`: a\n // server fetch is in flight and currently visible items are stale, so we\n // fall back to client-side `contains` to hide non-matching stale items\n // until the new items arrive.\n const textFilterFn = useMemo<FilterFn>(() => {\n if (filter === false) {\n return isLoadingItems ? contains : () => true;\n }\n return filter || contains;\n }, [filter, contains, isLoadingItems]);\n\n // Create a filter function for collection nodes (similar to ComboBox pattern)\n const filterFn = useCallback(\n (nodes: Iterable<any>) => {\n // Server-side filtering with no fetch in flight — items are\n // authoritative and shown as-is.\n if (filter === false && !isLoadingItems) return nodes;\n\n const term = searchValue.trim();\n\n if (!term) {\n return nodes;\n }\n\n // Filter nodes based on their textValue and preserve section structure\n return [...nodes]\n .map((node: any) => {\n if (node.type === 'section' && node.childNodes) {\n const filteredNodes = [...node.childNodes].filter((child: any) =>\n textFilterFn(child.textValue || '', term),\n );\n\n if (filteredNodes.length === 0) {\n return null;\n }\n\n return {\n ...node,\n childNodes: filteredNodes,\n hasChildNodes: true,\n };\n }\n\n return textFilterFn(node.textValue || '', term) ? node : null;\n })\n .filter(Boolean);\n },\n [filter, searchValue, textFilterFn, isLoadingItems],\n );\n\n // Handle custom values if allowed\n const enhancedChildren = useMemo(() => {\n let childrenToProcess = mergedChildren;\n\n // Handle custom values if allowed\n if (!allowsCustomValue) return childrenToProcess;\n\n const term = searchValue.trim();\n if (!term) return childrenToProcess;\n\n // Helper to determine if the term is already present (exact match on rendered textValue or the key).\n const doesTermExist = (term: string): boolean => {\n // Check if term exists in custom keys\n if (customKeys.has(term)) {\n return true;\n }\n\n // Check if term exists in original collection\n for (const item of localCollectionState.collection) {\n if (item.type === 'item') {\n const textValue = item.textValue || String(item.rendered || '');\n if (term === textValue || String(item.key) === term) {\n return true;\n }\n }\n }\n return false;\n };\n\n if (doesTermExist(term)) {\n return childrenToProcess;\n }\n\n // Check if there are any items that will match the filter.\n // This determines whether we need to visually separate the custom value\n // from real items (i.e. render a divider between sections). When there\n // are no visible items, we skip the section wrapper so no divider is\n // drawn above a lone custom-value option.\n //\n // Selected custom values (from `customKeys`) are filtered by `localFilter`\n // in `mergedChildren` regardless of `filter={false}`, so this check must\n // use the same logic — otherwise we'd report \"items visible\" and draw a\n // divider while the actual collection only contains the custom value.\n const localFilter: FilterFn =\n typeof filter === 'function' ? filter : contains;\n\n const hasVisibleFilteredItems = (() => {\n for (const item of localCollectionState.collection) {\n if (item.type === 'item') {\n const textValue = item.textValue || String(item.rendered || '');\n if (textFilterFn(textValue, term)) {\n return true;\n }\n } else if (item.type === 'section' && item.childNodes) {\n for (const child of item.childNodes) {\n const textValue = child.textValue || String(child.rendered || '');\n if (textFilterFn(textValue, term)) {\n return true;\n }\n }\n }\n }\n\n for (const customKey of customKeys) {\n if (localFilter(customKey, term)) {\n return true;\n }\n }\n\n return false;\n })();\n\n // Create the custom option\n const customOption = (\n <Item\n key={term}\n textValue={term}\n {...mergeProps(customValueProps ?? {}, newCustomValueProps ?? {})}\n >\n {term}\n </Item>\n );\n\n // If there are visible filtered items, add visual separation for custom value\n if (hasVisibleFilteredItems && childrenToProcess) {\n // Check if the collection contains any sections\n // If it does, we can't wrap childrenToProcess in another section (would create nested sections)\n const hasSections = [...localCollectionState.collection].some(\n (item) => item.type === 'section',\n );\n\n const customValueSection = (\n <BaseSection\n key=\"__custom_value__\"\n aria-label={t('filterListBox.customValue', 'Custom value')}\n >\n {customOption}\n </BaseSection>\n );\n\n if (hasSections) {\n // Collection has sections - just append the custom value section without wrapping\n if (Array.isArray(childrenToProcess)) {\n return [...childrenToProcess, customValueSection];\n }\n return [childrenToProcess, customValueSection];\n }\n\n // No sections in collection - wrap items in a section for visual separation\n const filteredItemsSection = (\n <BaseSection\n key=\"__filtered_items__\"\n aria-label={t('filterListBox.filteredItems', 'Filtered items')}\n >\n {childrenToProcess as ItemElement<unknown>[]}\n </BaseSection>\n );\n\n return [filteredItemsSection, customValueSection];\n }\n\n // No visible filtered items, just return the custom option without sections\n if (Array.isArray(childrenToProcess)) {\n return [...childrenToProcess, customOption];\n }\n\n if (childrenToProcess) {\n return [childrenToProcess, customOption];\n }\n\n return customOption;\n }, [\n allowsCustomValue,\n mergedChildren,\n searchValue,\n customKeys,\n localCollectionState.collection,\n customValueProps,\n newCustomValueProps,\n textFilterFn,\n filter,\n contains,\n t,\n ]);\n\n const fieldLayout = splitFieldLayout(props, { fillHeightOnFlex: true });\n\n styles = fieldLayout.styles;\n\n searchInputRef = useCombinedRefs(searchInputRef);\n listRef = useCombinedRefs(listRef);\n\n const { isFocused, focusProps } = useFocus();\n // The search input moves the list's focused option, so the option shows as\n // focused only while focus is in this component.\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: setIsFocusWithin,\n });\n\n const listBoxRef = useRef<HTMLDivElement>(null);\n // The search input points `aria-controls` and `aria-activedescendant` into\n // the list, so the list needs an id the input knows.\n const listBoxId = useId();\n\n // Ref to access internal ListBox state (selection manager, etc.)\n const listStateRef = useRef<any>(null);\n\n // The option under virtual focus, mirrored in state for the search input's\n // `aria-activedescendant`: the listbox's own state update does not re-render\n // this component. Every focus move below goes through `setVirtualFocus`.\n const [activeOptionKey, setActiveOptionKey] = useState<Key | null>(null);\n const setVirtualFocus = useEvent((key: Key | null) => {\n listStateRef.current?.selectionManager.setFocusedKey(key);\n setActiveOptionKey(key);\n });\n\n // When the search value changes, the visible collection of items may change as well.\n // If the currently focused item is no longer visible, move virtual focus to the first\n // available item so that arrow navigation and Enter behaviour continue to work.\n // If there are no available items, reset the selection so Enter won't select anything.\n // Priority: focus on selected items first, then fall back to first visible item.\n useLayoutEffect(() => {\n const listState = listStateRef.current;\n\n if (!listState) return;\n\n const { selectionManager, collection } = listState;\n\n // Walk the collection and:\n // 1. Collect the enabled keys of the visible items (supports sections).\n // 2. Detect the synthetic \"new custom value\" option — the one generated\n // from the current search term when `allowsCustomValue` is true.\n //\n // The custom value is rendered in one of two layouts depending on whether\n // any real item text-matches the search term (`hasVisibleFilteredItems`\n // in `enhancedChildren`):\n // • Some items match → wrapped in a `__custom_value__` section\n // (`customValueHasMatches = true`)\n // • No items match → appended at the top level with key === term\n // (`customValueHasMatches = false`)\n //\n // The layout itself is the signal we use to decide whether the custom\n // value should be the focus target (no matches) or whether focus should\n // move to a real item (matches present).\n const term = searchValue.trim();\n let newCustomValueKey: Key | null = null;\n let customValueHasMatches = false;\n\n const collectFocusableKeys = (\n nodes: Iterable<any>,\n out: Key[],\n inCustomSection = false,\n ) => {\n for (const node of nodes) {\n if (node.type === 'item') {\n if (!listState.disabledKeys.has(node.key)) out.push(node.key);\n if (inCustomSection) {\n newCustomValueKey = node.key;\n customValueHasMatches = true;\n }\n } else if (node.childNodes) {\n const isCustomSection =\n inCustomSection || node.key === '__custom_value__';\n collectFocusableKeys(node.childNodes, out, isCustomSection);\n }\n }\n };\n\n const visibleKeys: Key[] = [];\n collectFocusableKeys(collection, visibleKeys);\n\n // Detect the appended-at-top-level case (no items text-match). The custom\n // option is added with key === trimmed search term and lives directly in\n // the top-level collection (not nested in any section).\n if (newCustomValueKey == null && allowsCustomValue && term) {\n for (const node of collection) {\n if (node.type === 'item' && String(node.key) === term) {\n newCustomValueKey = node.key;\n customValueHasMatches = false;\n break;\n }\n }\n }\n\n // If there are no visible items, reset the focused key so Enter won't select anything\n if (visibleKeys.length === 0) {\n setVirtualFocus(null);\n return;\n }\n\n // The custom value should be the focus target when it exists and there\n // are no real text-matches — the user's typed value is then the only\n // actionable option. During an in-flight server fetch (`filter === false`\n // + `isLoadingItems`) `textFilterFn` falls back to client-side `contains`\n // so non-matching stale items are hidden, which keeps this signal honest.\n const customValueShouldBeFocused =\n newCustomValueKey != null && !customValueHasMatches;\n\n // Decide whether the current focus is already on the right thing. If yes,\n // don't disturb it. Otherwise fall through and re-pick a focus target.\n const currentFocused = selectionManager.focusedKey;\n if (currentFocused != null && visibleKeys.includes(currentFocused)) {\n const currentIsNewCustomValue =\n newCustomValueKey != null && currentFocused === newCustomValueKey;\n const keepsFocus = customValueShouldBeFocused\n ? currentIsNewCustomValue\n : newCustomValueKey != null\n ? // Custom value exists but isn't the priority (matches available)\n // — any non-custom focus is fine.\n !currentIsNewCustomValue\n : // No custom value involved at all.\n true;\n\n if (keepsFocus) {\n setActiveOptionKey(currentFocused);\n return;\n }\n }\n\n // Helper to find the first selected item that's visible\n const findFirstVisibleSelectedKey = (): Key | null => {\n if (selectionMode === 'single') {\n // Single selection: check if selectedKey is visible\n if (selectedKey != null) {\n const selectedKeyStr = String(selectedKey);\n if (visibleKeys.some((k) => String(k) === selectedKeyStr)) {\n return selectedKey;\n }\n }\n } else if (selectionMode === 'multiple') {\n // Multiple selection: find first selected key that's visible\n if (selectedKeys && selectedKeys !== 'all') {\n for (const key of selectedKeys) {\n const keyStr = String(key);\n if (visibleKeys.some((k) => String(k) === keyStr)) {\n return key;\n }\n }\n }\n }\n return null;\n };\n\n // Determine which key to focus\n let keyToFocus: Key | null = null;\n\n if (customValueShouldBeFocused) {\n // No real matches — promote the custom value over any selected/stale\n // item so the user can press Enter to add the value they just typed.\n keyToFocus = newCustomValueKey;\n } else {\n keyToFocus = findFirstVisibleSelectedKey();\n\n // Fallback to first visible item if no selected item found. Prefer the\n // first real (non-custom-value) item so focus doesn't land on the\n // bottom-of-list custom-value suggestion when real items are available.\n if (keyToFocus == null) {\n const firstRealKey = visibleKeys.find((k) => k !== newCustomValueKey);\n keyToFocus = firstRealKey ?? visibleKeys[0];\n }\n }\n\n // Mark this focus change as keyboard navigation so ListBox will scroll to it\n if (listState.lastFocusSourceRef) {\n listState.lastFocusSourceRef.current = 'keyboard';\n }\n\n // Set focus to the determined key\n setVirtualFocus(keyToFocus);\n }, [\n searchValue,\n enhancedChildren,\n selectionMode,\n selectedKey,\n selectedKeys,\n allowsCustomValue,\n setVirtualFocus,\n ]);\n\n // Keyboard navigation handler for search input\n const { keyboardProps } = useKeyboard({\n onKeyDown: (e) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n\n const listState = listStateRef.current;\n if (!listState) return;\n\n // The collection is already filtered by React Stately via filterFn;\n // disabled options are skipped.\n const nextKey = getNextVisibleKey(\n listState,\n e.key === 'ArrowDown' ? 1 : -1,\n { wrap: shouldFocusWrap },\n );\n\n if (nextKey != null) {\n markKeyboardFocus(listState);\n setVirtualFocus(nextKey);\n }\n } else if (\n e.key === 'Home' ||\n e.key === 'End' ||\n e.key === 'PageUp' ||\n e.key === 'PageDown'\n ) {\n e.preventDefault();\n\n const listState = listStateRef.current;\n if (!listState) return;\n\n const targetKey = getEdgeVisibleKey(\n listState,\n e.key === 'Home' || e.key === 'PageUp' ? 'first' : 'last',\n );\n\n if (targetKey == null) return;\n\n markKeyboardFocus(listState);\n setVirtualFocus(targetKey);\n } else if (e.key === 'Enter' || (e.key === ' ' && !searchValue)) {\n const listState = listStateRef.current;\n\n if (!listState) return;\n\n const keyToSelect = listState.selectionManager.focusedKey;\n\n if (keyToSelect != null) {\n e.preventDefault();\n listState.selectionManager.select(keyToSelect, e);\n\n if (\n e.key === 'Enter' &&\n isCheckable &&\n onEscape &&\n selectionMode === 'multiple'\n ) {\n onEscape();\n }\n }\n } else if (e.key === 'Escape') {\n if (searchValue) {\n // Clear the current search if any text is present.\n e.preventDefault();\n handleSearchChange('');\n } else {\n // Notify parent that Escape was pressed on an empty input.\n if (onEscape) {\n e.preventDefault();\n onEscape();\n }\n }\n }\n },\n });\n\n const mods = useMemo(\n () => ({\n ...getValidationMods({ isInvalid, isValid }),\n disabled: !!isDisabled,\n focused: isFocused,\n loading: !!isLoading,\n 'loading-items': !!isLoadingItems,\n searchable: true,\n prefix: !!isLoading,\n suffix: !!isLoadingItems,\n ...externalMods,\n }),\n [\n isInvalid,\n isInvalid,\n isValid,\n isDisabled,\n isFocused,\n isLoading,\n isLoadingItems,\n externalMods,\n ],\n );\n\n // Handler must be defined before we render ListBox so we can pass it.\n const handleSelectionChange = (selection: any) => {\n if (allowsCustomValue) {\n // Normalize current selection into an array of string keys\n let selectedValues: string[] = [];\n\n if (selection != null) {\n if (Array.isArray(selection)) {\n selectedValues = selection.map(String);\n } else {\n selectedValues = [String(selection)];\n }\n }\n\n // Build next custom keys set based on selected values\n const nextSet = new Set<string>();\n\n selectedValues.forEach((val) => {\n if (!originalKeys.has(val)) {\n nextSet.add(val);\n }\n });\n\n // Update internal custom keys state\n setCustomKeys(nextSet);\n }\n\n if (externalOnSelectionChange) {\n (externalOnSelectionChange as any)(selection);\n }\n };\n\n // Custom option click handler that ensures search input receives focus\n const handleOptionClick = (key: Key) => {\n // Focus the search input to enable keyboard navigation\n // Use setTimeout to ensure this happens after React state updates\n setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 0);\n\n // Call the original onOptionClick if provided\n if (onOptionClick) {\n onOptionClick(key);\n }\n };\n\n const searchInput = (\n <SearchWrapperElement mods={mods} data-size={size}>\n {isLoading && (\n <div data-element=\"Prefix\">\n <div data-element=\"InputIcon\">\n {isLoading ? <LoadingIcon /> : null}\n </div>\n </div>\n )}\n <SearchInputElement\n ref={searchInputRef}\n qa={qa || 'FilterListBox'}\n id={id}\n data-prefix={isLoading ? '' : undefined}\n data-suffix={isLoadingItems ? '' : undefined}\n type=\"search\"\n placeholder={searchPlaceholder}\n value={searchValue}\n disabled={isDisabled}\n autoFocus={autoFocus}\n {...(autoFocus ? { 'data-autofocus': '' } : undefined)}\n styles={searchInputStyles}\n data-size={size}\n data-input-type=\"filterlistbox\"\n role=\"combobox\"\n aria-expanded=\"true\"\n aria-haspopup=\"listbox\"\n aria-controls={listBoxId}\n aria-activedescendant={\n activeOptionKey != null\n ? getListBoxOptionId(listBoxId, activeOptionKey)\n : undefined\n }\n // The search input is the control the label points at, so it also\n // takes the caller's naming and the field's description and message.\n aria-label={(props as any)['aria-label']}\n aria-labelledby={(props as any)['aria-labelledby']}\n aria-describedby={(props as any)['aria-describedby']}\n aria-invalid={isInvalid || undefined}\n onChange={(e) => {\n handleSearchChange(e.target.value);\n }}\n {...keyboardProps}\n {...modAttrs(mods)}\n />\n {isLoadingItems && (\n <div data-element=\"Suffix\">\n <LoadingIcon data-element=\"InputIcon\" />\n </div>\n )}\n </SearchWrapperElement>\n );\n\n const filterListBoxField = (\n <FilterListBoxWrapperElement\n ref={ref}\n qa=\"FilterListBoxWrapper\"\n {...modAttrs(mods)}\n styles={styles}\n {...mergeProps(focusProps, focusWithinProps)}\n >\n {header ? (\n <StyledHeaderWithoutBorder data-size={size} styles={headerStyles}>\n {header}\n </StyledHeaderWithoutBorder>\n ) : (\n <div role=\"presentation\" />\n )}\n {searchInput}\n <ListBox\n isBare\n ref={listBoxRef}\n id={listBoxId}\n aria-label={innerAriaLabel}\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n selectionMode={selectionMode}\n isDisabled={isDisabled}\n listRef={listRef}\n stateRef={listStateRef}\n listStyles={listStyles}\n shouldFocusWrap={shouldFocusWrap}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n isInvalid={isInvalid}\n isValid={isValid}\n disallowEmptySelection={props.disallowEmptySelection}\n allowDuplicateSelectionEvents={props.allowDuplicateSelectionEvents}\n disabledKeys={props.disabledKeys}\n focusOnHover={focusOnHover}\n shouldUseVirtualFocus={!(isReorderable && !searchValue.trim())}\n isFocusWithin={isFocusWithin}\n showSelectAll={showSelectAll}\n selectAllLabel={selectAllLabel}\n footer={footer}\n footerStyles={footerStyles}\n mods={mods}\n styles={listBoxStyles}\n isCheckable={isCheckable}\n items={items as any}\n allValueProps={allValueProps}\n filter={filterFn}\n emptyLabel={\n emptyLabel !== undefined\n ? emptyLabel\n : searchValue.trim()\n ? t('filterListBox.noResults', 'No results found')\n : t('filterListBox.noItems', 'No items')\n }\n isReorderable={isReorderable && !searchValue.trim()}\n onReorder={onReorder}\n onSelectionChange={handleSelectionChange}\n onEscape={onEscape}\n onOptionClick={handleOptionClick}\n >\n {enhancedChildren as any}\n </ListBox>\n </FilterListBoxWrapperElement>\n );\n\n return wrapWithField<Omit<CubeFilterListBoxProps<T>, 'children'>>(\n filterListBoxField,\n { ...props, ...fieldLayout.field },\n );\n}) as unknown as (<T>(\n props: CubeFilterListBoxProps<T> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReactElement) & { Item: typeof Item; Section: typeof BaseSection };\n\nFilterListBox.Item = Item;\n\nFilterListBox.Section = BaseSection;\n\nObject.defineProperty(FilterListBox, 'cubeInputType', {\n value: 'FilterListBox',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwIA,MAAagF,gBAAgB1E,WAAW,SAAS0E,cAE/CC,OAAkCC,KAAmC;CACrED,QAAQ/C,cAAc+C,OAAO,EAC3BG,mBAAmB,EAAEN,OAAOO,eAAe;EACzC,MAAMC,aAAkB,CAAC;EAEzB,IAAIL,MAAMM,kBAAkB,YAC1BD,WAAWE,eAAeV,SAAS,CAAA;OAEnCQ,WAAWG,cAAcX,SAAS;EAGpCQ,WAAWI,qBAAqBlB,QAAa;GAC3C,IAAIS,MAAMM,kBAAkB,YAAY;IAEtC,IAAIf,QAAQ,OACVa,SAAS,KAAK;SAEdA,SAASb,MAAOmB,MAAMC,QAAQpB,GAAG,IAAIA,MAAM,CAACA,GAAG,IAAK,CAAA,CAAE;GAE1D,OACEa,SAASM,MAAMC,QAAQpB,GAAG,IAAIA,IAAI,KAAKA,GAAG;EAE9C;EAEA,OAAOc;CACT,EACF,CAAC;CAED,MAAM,EAAEO,MAAMpE,QAAQ;CAEtB,IAAI,EACFqE,IACAC,OACAC,OACAC,IACAC,aACAC,YACAC,oBACAC,WACAC,SACAC,YACA1C,WACAC,gBACAN,oBAAoBqC,EAAE,mCAAmC,WAAW,GACpEpC,WACAC,QACAQ,MAAMsC,cACN7C,YACAC,mBACA6C,YACAC,cACAC,eACAC,eACAC,SACA9C,gBACA+C,SACAC,SACAC,aACAC,QACAC,cACAC,iBACAC,aACA3B,aACA4B,oBACA7B,cACA8B,qBACA5B,mBAAmB6B,2BACnBtD,oBAAoB,OACpBuD,eACAC,gBACAC,QACAC,QACAC,OA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IACAlF;IACCC;IACRE;IACMG;IACR5D;IACN,QAAQE;IACKE;IACNyD;IACQG;IACf,QAAQkD;IACR,YACEzH,eAAekG,KAAAA,IACXlG,aACAiB,YAAY4F,KAAK,IACf3E,EAAE,2BAA2B,kBAAkB,IAC/CA,EAAE,yBAAyB,UAAU;IAE7C,eAAeuC,iBAAiB,CAACxD,YAAY4F,KAAK;IACvCnC;IACX,mBAAmBuH;IACTvL;IACV,eAAe4L;IAEdrE,UAAAA;GACM,CAAA;EACkB;;CAG/B,OAAOxJ,cACLkO,oBACA;EAAE,GAAGrL;EAAO,GAAGqH,YAAYmE;CAAM,CACnC;AACF,CAAC;AAIDzL,cAAchD,OAAOA;AAErBgD,cAAc3D,UAAUC;AAExBoP,OAAOC,eAAe3L,eAAe,iBAAiB;CACpDF,OAAO;CACP8L,YAAY;CACZC,cAAc;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"FilterListBox.js","names":["ItemElement","Key","modAttrs","Styles","cloneElement","ForwardedRef","forwardRef","isValidElement","ReactElement","ReactNode","RefObject","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","useFilter","useFocusWithin","useId","useKeyboard","Section","BaseSection","useListState","useEvent","useI18n","LoadingIcon","useFocus","mergeProps","useCombinedRefs","CubeCollectionItemProps","CollectionItem","Item","splitFieldLayout","useFieldProps","getValidationMods","wrapWithField","CubeListBoxProps","ListBox","getListBoxOptionId","getEdgeVisibleKey","getNextVisibleKey","markKeyboardFocus","FilterListBoxWrapperElement","SearchInputElement","SearchWrapperElement","StyledHeaderWithoutBorder","Collection","Node","FieldBaseProps","FilterFn","textValue","inputValue","CubeFilterListBoxProps","Omit","T","searchPlaceholder","autoFocus","filter","emptyLabel","searchInputStyles","isLoading","isLoadingItems","searchInputRef","HTMLInputElement","allowsCustomValue","mods","Record","listBoxStyles","onEscape","isCheckable","onOptionClick","key","customValueProps","Partial","newCustomValueProps","searchValue","onSearchChange","value","_internalCollection","FilterListBox","props","ref","HTMLDivElement","valuePropsMapper","onChange","fieldProps","selectionMode","selectedKeys","selectedKey","onSelectionChange","Array","isArray","t","qa","label","extra","id","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","isDisabled","externalMods","listStyles","optionStyles","sectionStyles","headingStyles","listGap","listRef","message","description","styles","focusOnHover","shouldFocusWrap","labelSuffix","defaultSelectedKey","defaultSelectedKeys","externalOnSelectionChange","showSelectAll","selectAllLabel","header","footer","size","headerStyles","footerStyles","items","children","renderChildren","allValueProps","controlledSearchValue","isReorderable","onReorder","form","renderFn","itemsArray","from","Iterable","map","item","idx","rendered","it","localCollectionState","collection","originalKeys","keys","Set","type","add","String","customKeys","setCustomKeys","internalSearchValue","setInternalSearchValue","isSearchControlled","undefined","contains","sensitivity","currentSelectedKeys","length","keysToAdd","k","has","prev","mergedChildren","term","trim","localFilter","customArray","selectedKeysSet","forEach","selectedCustom","unselectedCustom","push","originalArray","innerAriaLabel","handleSearchChange","textFilterFn","filterFn","nodes","node","childNodes","filteredNodes","child","hasChildNodes","Boolean","enhancedChildren","childrenToProcess","doesTermExist","hasVisibleFilteredItems","customKey","customOption","hasSections","some","customValueSection","filteredItemsSection","fieldLayout","fillHeightOnFlex","isFocused","focusProps","isFocusWithin","setIsFocusWithin","focusWithinProps","onFocusWithinChange","listBoxRef","listBoxId","listStateRef","activeOptionKey","setActiveOptionKey","setVirtualFocus","current","selectionManager","setFocusedKey","listState","newCustomValueKey","customValueHasMatches","collectFocusableKeys","out","inCustomSection","disabledKeys","isCustomSection","visibleKeys","customValueShouldBeFocused","currentFocused","focusedKey","includes","currentIsNewCustomValue","keepsFocus","findFirstVisibleSelectedKey","selectedKeyStr","keyStr","keyToFocus","firstRealKey","find","lastFocusSourceRef","keyboardProps","onKeyDown","e","preventDefault","nextKey","wrap","targetKey","keyToSelect","select","disabled","focused","loading","searchable","prefix","suffix","handleSelectionChange","selection","selectedValues","nextSet","val","handleOptionClick","setTimeout","focus","searchInput","target","filterListBoxField","disallowEmptySelection","allowDuplicateSelectionEvents","field","Object","defineProperty","enumerable","configurable","Item","mergeProps","BaseSection","useFocus","useId"],"sources":["../../../../src/components/fields/FilterListBox/FilterListBox.tsx"],"sourcesContent":["import { ItemElement, Key } from '@react-types/shared';\nimport { modAttrs, Styles } from '@tenphi/tasty';\nimport {\n cloneElement,\n ForwardedRef,\n forwardRef,\n isValidElement,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFilter, useFocusWithin, useId, useKeyboard } from 'react-aria';\nimport { Section as BaseSection, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { useI18n } from '../../../i18n/useI18n';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport { useCombinedRefs } from '../../../utils/react/useCombinedRefs';\nimport {\n CubeCollectionItemProps,\n CollectionItem as Item,\n} from '../../CollectionItem';\nimport { splitFieldLayout } from '../../form/field-layout';\nimport { useFieldProps } from '../../form/Form/use-field/use-field-props';\nimport { getValidationMods } from '../../form/validation/resolve-validation-props';\nimport { wrapWithField } from '../../form/wrapper';\nimport { CubeListBoxProps, ListBox } from '../ListBox/ListBox';\nimport { getListBoxOptionId } from '../ListBox/optionId';\nimport {\n getEdgeVisibleKey,\n getNextVisibleKey,\n markKeyboardFocus,\n} from '../ListBoxPopover/listNavigation';\n\nimport {\n FilterListBoxWrapperElement,\n SearchInputElement,\n SearchWrapperElement,\n StyledHeaderWithoutBorder,\n} from './styled';\n\nimport type { Collection, Node } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\nexport interface CubeFilterListBoxProps<T>\n // It sets `isFocusWithin` on its list itself.\n extends\n Omit<CubeListBoxProps<T>, 'filter' | 'isFocusWithin'>,\n FieldBaseProps<\n string | number | readonly (string | number)[] | null | undefined\n > {\n /** Placeholder text for the search input */\n searchPlaceholder?: string;\n /** Whether the search input should have autofocus */\n autoFocus?: boolean;\n /**\n * Custom filter function for determining if an option should be included in search results.\n * Pass `false` to disable internal filtering completely (useful for external filtering).\n */\n filter?: FilterFn | false;\n /** Label shown when the list is empty. When provided, overrides both the \"No results found\" and \"No items\" defaults. It wraps to the list's width, so a long message, or an action in it, stays in view. */\n emptyLabel?: ReactNode;\n /** Custom styles for the search input */\n searchInputStyles?: Styles;\n /** Whether the FilterListBox is in loading state (shows loading icon in search input) */\n isLoading?: boolean;\n /** Whether items are currently loading. Shows a loading icon in the search input suffix. */\n isLoadingItems?: boolean;\n /** Ref for accessing the search input element */\n searchInputRef?: RefObject<HTMLInputElement | null>;\n /** Whether to allow entering custom values that are not present in the predefined options */\n allowsCustomValue?: boolean;\n /** Additional modifiers for styling the FilterListBox */\n mods?: Record<string, boolean>;\n /** Custom styles for the list box */\n listBoxStyles?: Styles;\n\n /**\n * Callback fired when the user presses Escape key while the search input is empty.\n * Can be used by parent components (e.g. FilterPicker) to close an enclosing Dialog.\n */\n onEscape?: () => void;\n\n /**\n * Whether to show checkboxes for multiple selection mode.\n * This adds a checkbox icon to the left of each option.\n */\n isCheckable?: boolean;\n\n /**\n * Callback fired when an option is clicked but not on the checkbox area.\n * Used by FilterPicker to close the popover on non-checkbox clicks.\n */\n onOptionClick?: (key: Key) => void;\n\n /**\n * Props to apply to existing custom values (values that are already selected but not in the predefined options).\n */\n customValueProps?: Partial<CubeCollectionItemProps<T>>;\n\n /**\n * Props to apply to new custom values (values typed in the search input that are about to be added).\n * These are merged with customValueProps for new custom values.\n */\n newCustomValueProps?: Partial<CubeCollectionItemProps<T>>;\n\n /**\n * Controlled search value. When provided, the search input becomes controlled.\n * Use with `onSearchChange` to manage the search state externally.\n */\n searchValue?: string;\n\n /**\n * Callback fired when the search input value changes.\n * Use with `searchValue` for controlled search input.\n */\n onSearchChange?: (value: string) => void;\n\n /**\n * Pre-built collection to use instead of creating a new one.\n * Used internally by FilterPicker to avoid duplicate collection creation.\n * @internal\n */\n _internalCollection?: Collection<Node<any>>;\n}\n\nexport const FilterListBox = forwardRef(function FilterListBox<\n T extends object,\n>(props: CubeFilterListBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n props = useFieldProps(props, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: any = {};\n\n if (props.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: any) => {\n if (props.selectionMode === 'multiple') {\n // Handle \"all\" selection and array selections\n if (key === 'all') {\n onChange('all');\n } else {\n onChange(key ? (Array.isArray(key) ? key : [key]) : []);\n }\n } else {\n onChange(Array.isArray(key) ? key[0] : key);\n }\n };\n\n return fieldProps;\n },\n });\n\n const { t } = useI18n();\n\n let {\n qa,\n label,\n extra,\n id,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n isLoading,\n isLoadingItems,\n searchPlaceholder = t('filterListBox.searchPlaceholder', 'Search...'),\n autoFocus,\n filter,\n mods: externalMods,\n emptyLabel,\n searchInputStyles,\n listStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n searchInputRef,\n listRef,\n message,\n description,\n styles,\n focusOnHover,\n shouldFocusWrap,\n labelSuffix,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange: externalOnSelectionChange,\n allowsCustomValue = false,\n showSelectAll,\n selectAllLabel,\n header,\n footer,\n size = 'medium',\n headerStyles,\n footerStyles,\n listBoxStyles,\n items,\n children: renderChildren,\n onEscape,\n isCheckable,\n onOptionClick,\n selectionMode = 'single',\n allValueProps,\n customValueProps,\n newCustomValueProps,\n searchValue: controlledSearchValue,\n onSearchChange,\n _internalCollection,\n isReorderable = false,\n onReorder,\n form,\n } = props;\n\n // Preserve the original `children` (may be a render function) before we\n // potentially overwrite it.\n let children: ReactNode = renderChildren as ReactNode;\n\n const renderFn = renderChildren as unknown;\n\n if (items && typeof renderFn === 'function') {\n try {\n const itemsArray = Array.from(items as Iterable<any>);\n // Execute the render function for each item to obtain <Item/> / <Section/> nodes.\n children = itemsArray.map((item, idx) => {\n const rendered = (renderFn as (it: any) => ReactNode)(item);\n // Ensure every element has a stable key: rely on the user-provided key\n // inside the render function, otherwise fall back to the item itself or\n // the index. This mirrors React Aria examples where the render function\n // is expected to set keys, but we add a fallback for robustness.\n if (\n isValidElement(rendered) &&\n (rendered as ReactElement).key == null\n ) {\n return cloneElement(rendered as ReactElement, {\n key: (rendered as any)?.key ?? item?.key ?? idx,\n });\n }\n\n return rendered as ReactNode;\n });\n } catch {\n // If conversion fails for some reason, we silently ignore and proceed\n // with the original children value so we don't break runtime.\n }\n }\n\n // Use provided collection from FilterPicker or create our own\n // Hook call order is stable: _internalCollection is consistent per component instance\n const localCollectionState = _internalCollection\n ? { collection: _internalCollection }\n : useListState({\n children: children as any,\n items: items as any,\n selectionMode: 'none' as any,\n });\n\n // Collect original option keys to avoid duplicating them as custom values.\n const originalKeys = useMemo(() => {\n const keys = new Set<string>();\n for (const item of localCollectionState.collection) {\n if (item.type === 'item') {\n keys.add(String(item.key));\n }\n }\n return keys;\n }, [localCollectionState.collection]);\n\n // State to keep track of custom (user-entered) items that were selected.\n const [customKeys, setCustomKeys] = useState<Set<string>>(new Set());\n\n // Controlled/uncontrolled search value pattern\n const [internalSearchValue, setInternalSearchValue] = useState('');\n const isSearchControlled = controlledSearchValue !== undefined;\n const searchValue = isSearchControlled\n ? controlledSearchValue\n : internalSearchValue;\n\n const { contains } = useFilter({ sensitivity: 'base' });\n\n // Initialize custom keys from current selection\n useEffect(() => {\n if (!allowsCustomValue) return;\n\n const currentSelectedKeys = selectedKeys\n ? selectedKeys === 'all'\n ? [] // Skip custom key detection when 'all' is selected\n : Array.from(selectedKeys).map(String)\n : selectedKey != null\n ? [String(selectedKey)]\n : [];\n\n if (currentSelectedKeys.length === 0) return;\n\n const keysToAdd = currentSelectedKeys.filter((k) => !originalKeys.has(k));\n\n if (keysToAdd.length) {\n setCustomKeys((prev) => new Set([...Array.from(prev), ...keysToAdd]));\n }\n }, [allowsCustomValue, selectedKeys, selectedKey, originalKeys]);\n\n // Merge original children with any custom items so they persist in the list.\n // If there are selected custom values, they should appear on top with other\n // selected items (which are already sorted by the parent component, e.g. FilterPicker).\n const mergedChildren: ReactNode = useMemo(() => {\n if (!children && customKeys.size === 0) return children;\n\n // Selected custom values are injected by FilterListBox itself, not by the\n // parent. They must respect the search input regardless of the `filter`\n // prop — `filter={false}` only describes the parent's authority over its\n // own items. Filter them with the user-provided filter (if any) or the\n // default `contains`.\n const term = searchValue.trim();\n const localFilter: FilterFn =\n typeof filter === 'function' ? filter : contains;\n\n // Build React elements for custom values (kept stable via their key).\n const customArray = Array.from(customKeys)\n .filter((key) => !term || localFilter(key, term))\n .map((key) => (\n <Item key={key} textValue={key} {...customValueProps}>\n {key}\n </Item>\n ));\n\n // Identify which custom keys are currently selected so we can promote them.\n const selectedKeysSet = new Set<string>();\n\n if (selectionMode === 'multiple') {\n if (selectedKeys === 'all') {\n // When 'all' is selected, no custom items should be treated as selected\n // since 'all' means all available items, not custom ones\n } else {\n Array.from(selectedKeys ?? []).forEach((k) =>\n selectedKeysSet.add(String(k)),\n );\n }\n } else {\n if (selectedKey != null) selectedKeysSet.add(String(selectedKey));\n }\n\n const selectedCustom: ReactNode[] = [];\n const unselectedCustom: ReactNode[] = [];\n\n customArray.forEach((item: any) => {\n if (selectedKeysSet.has(String(item.key))) {\n selectedCustom.push(item);\n } else {\n unselectedCustom.push(item);\n }\n });\n\n if (!children) {\n // No original items – just return selected custom followed by the rest.\n return [...selectedCustom, ...unselectedCustom];\n }\n\n const originalArray = Array.isArray(children) ? children : [children];\n\n // Final order: selected custom items -> original array (already possibly\n // sorted by parent) -> unselected custom items.\n return [...selectedCustom, ...originalArray, ...unselectedCustom];\n }, [\n children,\n customKeys,\n selectionMode,\n selectedKey,\n selectedKeys,\n searchValue,\n filter,\n contains,\n customValueProps,\n ]);\n\n // Determine an aria-label for the internal ListBox to avoid React Aria warnings.\n const innerAriaLabel =\n (props as any)['aria-label'] ||\n (typeof label === 'string' ? label : undefined);\n\n const handleSearchChange = useCallback(\n (value: string) => {\n if (!isSearchControlled) {\n setInternalSearchValue(value);\n }\n onSearchChange?.(value);\n },\n [isSearchControlled, onSearchChange],\n );\n\n // Choose the text filter function: user-provided `filter` prop (if any),\n // or the default `contains` helper from `useFilter`.\n // When `filter={false}`, the parent owns filtering — we normally pass items\n // through unchanged. The exception is when `isLoadingItems` is `true`: a\n // server fetch is in flight and currently visible items are stale, so we\n // fall back to client-side `contains` to hide non-matching stale items\n // until the new items arrive.\n const textFilterFn = useMemo<FilterFn>(() => {\n if (filter === false) {\n return isLoadingItems ? contains : () => true;\n }\n return filter || contains;\n }, [filter, contains, isLoadingItems]);\n\n // Create a filter function for collection nodes (similar to ComboBox pattern)\n const filterFn = useCallback(\n (nodes: Iterable<any>) => {\n // Server-side filtering with no fetch in flight — items are\n // authoritative and shown as-is.\n if (filter === false && !isLoadingItems) return nodes;\n\n const term = searchValue.trim();\n\n if (!term) {\n return nodes;\n }\n\n // Filter nodes based on their textValue and preserve section structure\n return [...nodes]\n .map((node: any) => {\n if (node.type === 'section' && node.childNodes) {\n const filteredNodes = [...node.childNodes].filter((child: any) =>\n textFilterFn(child.textValue || '', term),\n );\n\n if (filteredNodes.length === 0) {\n return null;\n }\n\n return {\n ...node,\n childNodes: filteredNodes,\n hasChildNodes: true,\n };\n }\n\n return textFilterFn(node.textValue || '', term) ? node : null;\n })\n .filter(Boolean);\n },\n [filter, searchValue, textFilterFn, isLoadingItems],\n );\n\n // Handle custom values if allowed\n const enhancedChildren = useMemo(() => {\n let childrenToProcess = mergedChildren;\n\n // Handle custom values if allowed\n if (!allowsCustomValue) return childrenToProcess;\n\n const term = searchValue.trim();\n if (!term) return childrenToProcess;\n\n // Helper to determine if the term is already present (exact match on rendered textValue or the key).\n const doesTermExist = (term: string): boolean => {\n // Check if term exists in custom keys\n if (customKeys.has(term)) {\n return true;\n }\n\n // Check if term exists in original collection\n for (const item of localCollectionState.collection) {\n if (item.type === 'item') {\n const textValue = item.textValue || String(item.rendered || '');\n if (term === textValue || String(item.key) === term) {\n return true;\n }\n }\n }\n return false;\n };\n\n if (doesTermExist(term)) {\n return childrenToProcess;\n }\n\n // Check if there are any items that will match the filter.\n // This determines whether we need to visually separate the custom value\n // from real items (i.e. render a divider between sections). When there\n // are no visible items, we skip the section wrapper so no divider is\n // drawn above a lone custom-value option.\n //\n // Selected custom values (from `customKeys`) are filtered by `localFilter`\n // in `mergedChildren` regardless of `filter={false}`, so this check must\n // use the same logic — otherwise we'd report \"items visible\" and draw a\n // divider while the actual collection only contains the custom value.\n const localFilter: FilterFn =\n typeof filter === 'function' ? filter : contains;\n\n const hasVisibleFilteredItems = (() => {\n for (const item of localCollectionState.collection) {\n if (item.type === 'item') {\n const textValue = item.textValue || String(item.rendered || '');\n if (textFilterFn(textValue, term)) {\n return true;\n }\n } else if (item.type === 'section' && item.childNodes) {\n for (const child of item.childNodes) {\n const textValue = child.textValue || String(child.rendered || '');\n if (textFilterFn(textValue, term)) {\n return true;\n }\n }\n }\n }\n\n for (const customKey of customKeys) {\n if (localFilter(customKey, term)) {\n return true;\n }\n }\n\n return false;\n })();\n\n // Create the custom option\n const customOption = (\n <Item\n key={term}\n textValue={term}\n {...mergeProps(customValueProps ?? {}, newCustomValueProps ?? {})}\n >\n {term}\n </Item>\n );\n\n // If there are visible filtered items, add visual separation for custom value\n if (hasVisibleFilteredItems && childrenToProcess) {\n // Check if the collection contains any sections\n // If it does, we can't wrap childrenToProcess in another section (would create nested sections)\n const hasSections = [...localCollectionState.collection].some(\n (item) => item.type === 'section',\n );\n\n const customValueSection = (\n <BaseSection\n key=\"__custom_value__\"\n aria-label={t('filterListBox.customValue', 'Custom value')}\n >\n {customOption}\n </BaseSection>\n );\n\n if (hasSections) {\n // Collection has sections - just append the custom value section without wrapping\n if (Array.isArray(childrenToProcess)) {\n return [...childrenToProcess, customValueSection];\n }\n return [childrenToProcess, customValueSection];\n }\n\n // No sections in collection - wrap items in a section for visual separation\n const filteredItemsSection = (\n <BaseSection\n key=\"__filtered_items__\"\n aria-label={t('filterListBox.filteredItems', 'Filtered items')}\n >\n {childrenToProcess as ItemElement<unknown>[]}\n </BaseSection>\n );\n\n return [filteredItemsSection, customValueSection];\n }\n\n // No visible filtered items, just return the custom option without sections\n if (Array.isArray(childrenToProcess)) {\n return [...childrenToProcess, customOption];\n }\n\n if (childrenToProcess) {\n return [childrenToProcess, customOption];\n }\n\n return customOption;\n }, [\n allowsCustomValue,\n mergedChildren,\n searchValue,\n customKeys,\n localCollectionState.collection,\n customValueProps,\n newCustomValueProps,\n textFilterFn,\n filter,\n contains,\n t,\n ]);\n\n const fieldLayout = splitFieldLayout(props, { fillHeightOnFlex: true });\n\n styles = fieldLayout.styles;\n\n searchInputRef = useCombinedRefs(searchInputRef);\n listRef = useCombinedRefs(listRef);\n\n const { isFocused, focusProps } = useFocus();\n // The search input moves the list's focused option, so the option shows as\n // focused only while focus is in this component.\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: setIsFocusWithin,\n });\n\n const listBoxRef = useRef<HTMLDivElement>(null);\n // The search input points `aria-controls` and `aria-activedescendant` into\n // the list, so the list needs an id the input knows.\n const listBoxId = useId();\n\n // Ref to access internal ListBox state (selection manager, etc.)\n const listStateRef = useRef<any>(null);\n\n // The option under virtual focus, mirrored in state for the search input's\n // `aria-activedescendant`: the listbox's own state update does not re-render\n // this component. Every focus move below goes through `setVirtualFocus`.\n const [activeOptionKey, setActiveOptionKey] = useState<Key | null>(null);\n const setVirtualFocus = useEvent((key: Key | null) => {\n listStateRef.current?.selectionManager.setFocusedKey(key);\n setActiveOptionKey(key);\n });\n\n // When the search value changes, the visible collection of items may change as well.\n // If the currently focused item is no longer visible, move virtual focus to the first\n // available item so that arrow navigation and Enter behaviour continue to work.\n // If there are no available items, reset the selection so Enter won't select anything.\n // Priority: focus on selected items first, then fall back to first visible item.\n useLayoutEffect(() => {\n const listState = listStateRef.current;\n\n if (!listState) return;\n\n const { selectionManager, collection } = listState;\n\n // Walk the collection and:\n // 1. Collect the enabled keys of the visible items (supports sections).\n // 2. Detect the synthetic \"new custom value\" option — the one generated\n // from the current search term when `allowsCustomValue` is true.\n //\n // The custom value is rendered in one of two layouts depending on whether\n // any real item text-matches the search term (`hasVisibleFilteredItems`\n // in `enhancedChildren`):\n // • Some items match → wrapped in a `__custom_value__` section\n // (`customValueHasMatches = true`)\n // • No items match → appended at the top level with key === term\n // (`customValueHasMatches = false`)\n //\n // The layout itself is the signal we use to decide whether the custom\n // value should be the focus target (no matches) or whether focus should\n // move to a real item (matches present).\n const term = searchValue.trim();\n let newCustomValueKey: Key | null = null;\n let customValueHasMatches = false;\n\n const collectFocusableKeys = (\n nodes: Iterable<any>,\n out: Key[],\n inCustomSection = false,\n ) => {\n for (const node of nodes) {\n if (node.type === 'item') {\n if (!listState.disabledKeys.has(node.key)) out.push(node.key);\n if (inCustomSection) {\n newCustomValueKey = node.key;\n customValueHasMatches = true;\n }\n } else if (node.childNodes) {\n const isCustomSection =\n inCustomSection || node.key === '__custom_value__';\n collectFocusableKeys(node.childNodes, out, isCustomSection);\n }\n }\n };\n\n const visibleKeys: Key[] = [];\n collectFocusableKeys(collection, visibleKeys);\n\n // Detect the appended-at-top-level case (no items text-match). The custom\n // option is added with key === trimmed search term and lives directly in\n // the top-level collection (not nested in any section).\n if (newCustomValueKey == null && allowsCustomValue && term) {\n for (const node of collection) {\n if (node.type === 'item' && String(node.key) === term) {\n newCustomValueKey = node.key;\n customValueHasMatches = false;\n break;\n }\n }\n }\n\n // If there are no visible items, reset the focused key so Enter won't select anything\n if (visibleKeys.length === 0) {\n setVirtualFocus(null);\n return;\n }\n\n // The custom value should be the focus target when it exists and there\n // are no real text-matches — the user's typed value is then the only\n // actionable option. During an in-flight server fetch (`filter === false`\n // + `isLoadingItems`) `textFilterFn` falls back to client-side `contains`\n // so non-matching stale items are hidden, which keeps this signal honest.\n const customValueShouldBeFocused =\n newCustomValueKey != null && !customValueHasMatches;\n\n // Decide whether the current focus is already on the right thing. If yes,\n // don't disturb it. Otherwise fall through and re-pick a focus target.\n const currentFocused = selectionManager.focusedKey;\n if (currentFocused != null && visibleKeys.includes(currentFocused)) {\n const currentIsNewCustomValue =\n newCustomValueKey != null && currentFocused === newCustomValueKey;\n const keepsFocus = customValueShouldBeFocused\n ? currentIsNewCustomValue\n : newCustomValueKey != null\n ? // Custom value exists but isn't the priority (matches available)\n // — any non-custom focus is fine.\n !currentIsNewCustomValue\n : // No custom value involved at all.\n true;\n\n if (keepsFocus) {\n setActiveOptionKey(currentFocused);\n return;\n }\n }\n\n // Helper to find the first selected item that's visible\n const findFirstVisibleSelectedKey = (): Key | null => {\n if (selectionMode === 'single') {\n // Single selection: check if selectedKey is visible\n if (selectedKey != null) {\n const selectedKeyStr = String(selectedKey);\n if (visibleKeys.some((k) => String(k) === selectedKeyStr)) {\n return selectedKey;\n }\n }\n } else if (selectionMode === 'multiple') {\n // Multiple selection: find first selected key that's visible\n if (selectedKeys && selectedKeys !== 'all') {\n for (const key of selectedKeys) {\n const keyStr = String(key);\n if (visibleKeys.some((k) => String(k) === keyStr)) {\n return key;\n }\n }\n }\n }\n return null;\n };\n\n // Determine which key to focus\n let keyToFocus: Key | null = null;\n\n if (customValueShouldBeFocused) {\n // No real matches — promote the custom value over any selected/stale\n // item so the user can press Enter to add the value they just typed.\n keyToFocus = newCustomValueKey;\n } else {\n keyToFocus = findFirstVisibleSelectedKey();\n\n // Fallback to first visible item if no selected item found. Prefer the\n // first real (non-custom-value) item so focus doesn't land on the\n // bottom-of-list custom-value suggestion when real items are available.\n if (keyToFocus == null) {\n const firstRealKey = visibleKeys.find((k) => k !== newCustomValueKey);\n keyToFocus = firstRealKey ?? visibleKeys[0];\n }\n }\n\n // Mark this focus change as keyboard navigation so ListBox will scroll to it\n if (listState.lastFocusSourceRef) {\n listState.lastFocusSourceRef.current = 'keyboard';\n }\n\n // Set focus to the determined key\n setVirtualFocus(keyToFocus);\n }, [\n searchValue,\n enhancedChildren,\n selectionMode,\n selectedKey,\n selectedKeys,\n allowsCustomValue,\n setVirtualFocus,\n ]);\n\n // Keyboard navigation handler for search input\n const { keyboardProps } = useKeyboard({\n onKeyDown: (e) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n\n const listState = listStateRef.current;\n if (!listState) return;\n\n // The collection is already filtered by React Stately via filterFn;\n // disabled options are skipped.\n const nextKey = getNextVisibleKey(\n listState,\n e.key === 'ArrowDown' ? 1 : -1,\n { wrap: shouldFocusWrap },\n );\n\n if (nextKey != null) {\n markKeyboardFocus(listState);\n setVirtualFocus(nextKey);\n }\n } else if (\n e.key === 'Home' ||\n e.key === 'End' ||\n e.key === 'PageUp' ||\n e.key === 'PageDown'\n ) {\n e.preventDefault();\n\n const listState = listStateRef.current;\n if (!listState) return;\n\n const targetKey = getEdgeVisibleKey(\n listState,\n e.key === 'Home' || e.key === 'PageUp' ? 'first' : 'last',\n );\n\n if (targetKey == null) return;\n\n markKeyboardFocus(listState);\n setVirtualFocus(targetKey);\n } else if (e.key === 'Enter' || (e.key === ' ' && !searchValue)) {\n const listState = listStateRef.current;\n\n if (!listState) return;\n\n const keyToSelect = listState.selectionManager.focusedKey;\n\n if (keyToSelect != null) {\n e.preventDefault();\n listState.selectionManager.select(keyToSelect, e);\n\n if (\n e.key === 'Enter' &&\n isCheckable &&\n onEscape &&\n selectionMode === 'multiple'\n ) {\n onEscape();\n }\n }\n } else if (e.key === 'Escape') {\n if (searchValue) {\n // Clear the current search if any text is present.\n e.preventDefault();\n handleSearchChange('');\n } else {\n // Notify parent that Escape was pressed on an empty input.\n if (onEscape) {\n e.preventDefault();\n onEscape();\n }\n }\n }\n },\n });\n\n const mods = useMemo(\n () => ({\n ...getValidationMods({ isInvalid, isValid }),\n disabled: !!isDisabled,\n focused: isFocused,\n loading: !!isLoading,\n 'loading-items': !!isLoadingItems,\n searchable: true,\n prefix: !!isLoading,\n suffix: !!isLoadingItems,\n ...externalMods,\n }),\n [\n isInvalid,\n isInvalid,\n isValid,\n isDisabled,\n isFocused,\n isLoading,\n isLoadingItems,\n externalMods,\n ],\n );\n\n // Handler must be defined before we render ListBox so we can pass it.\n const handleSelectionChange = (selection: any) => {\n if (allowsCustomValue) {\n // Normalize current selection into an array of string keys\n let selectedValues: string[] = [];\n\n if (selection != null) {\n if (Array.isArray(selection)) {\n selectedValues = selection.map(String);\n } else {\n selectedValues = [String(selection)];\n }\n }\n\n // Build next custom keys set based on selected values\n const nextSet = new Set<string>();\n\n selectedValues.forEach((val) => {\n if (!originalKeys.has(val)) {\n nextSet.add(val);\n }\n });\n\n // Update internal custom keys state\n setCustomKeys(nextSet);\n }\n\n if (externalOnSelectionChange) {\n (externalOnSelectionChange as any)(selection);\n }\n };\n\n // Custom option click handler that ensures search input receives focus\n const handleOptionClick = (key: Key) => {\n // Focus the search input to enable keyboard navigation\n // Use setTimeout to ensure this happens after React state updates\n setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 0);\n\n // Call the original onOptionClick if provided\n if (onOptionClick) {\n onOptionClick(key);\n }\n };\n\n const searchInput = (\n <SearchWrapperElement mods={mods} data-size={size}>\n {isLoading && (\n <div data-element=\"Prefix\">\n <div data-element=\"InputIcon\">\n {isLoading ? <LoadingIcon /> : null}\n </div>\n </div>\n )}\n <SearchInputElement\n ref={searchInputRef}\n qa={qa || 'FilterListBox'}\n id={id}\n data-prefix={isLoading ? '' : undefined}\n data-suffix={isLoadingItems ? '' : undefined}\n type=\"search\"\n placeholder={searchPlaceholder}\n value={searchValue}\n disabled={isDisabled}\n autoFocus={autoFocus}\n {...(autoFocus ? { 'data-autofocus': '' } : undefined)}\n styles={searchInputStyles}\n data-size={size}\n data-input-type=\"filterlistbox\"\n role=\"combobox\"\n aria-expanded=\"true\"\n aria-haspopup=\"listbox\"\n aria-controls={listBoxId}\n aria-activedescendant={\n activeOptionKey != null\n ? getListBoxOptionId(listBoxId, activeOptionKey)\n : undefined\n }\n // The search input is the control the label points at, so it also\n // takes the caller's naming and the field's description and message.\n aria-label={(props as any)['aria-label']}\n aria-labelledby={(props as any)['aria-labelledby']}\n aria-describedby={(props as any)['aria-describedby']}\n aria-invalid={isInvalid || undefined}\n onChange={(e) => {\n handleSearchChange(e.target.value);\n }}\n {...keyboardProps}\n {...modAttrs(mods)}\n />\n {isLoadingItems && (\n <div data-element=\"Suffix\">\n <LoadingIcon data-element=\"InputIcon\" />\n </div>\n )}\n </SearchWrapperElement>\n );\n\n const filterListBoxField = (\n <FilterListBoxWrapperElement\n ref={ref}\n qa=\"FilterListBoxWrapper\"\n {...modAttrs(mods)}\n styles={styles}\n {...mergeProps(focusProps, focusWithinProps)}\n >\n {header ? (\n <StyledHeaderWithoutBorder data-size={size} styles={headerStyles}>\n {header}\n </StyledHeaderWithoutBorder>\n ) : (\n <div role=\"presentation\" />\n )}\n {searchInput}\n <ListBox\n isBare\n ref={listBoxRef}\n id={listBoxId}\n aria-label={innerAriaLabel}\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n selectionMode={selectionMode}\n isDisabled={isDisabled}\n listRef={listRef}\n stateRef={listStateRef}\n listStyles={listStyles}\n shouldFocusWrap={shouldFocusWrap}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n isInvalid={isInvalid}\n isValid={isValid}\n disallowEmptySelection={props.disallowEmptySelection}\n allowDuplicateSelectionEvents={props.allowDuplicateSelectionEvents}\n disabledKeys={props.disabledKeys}\n focusOnHover={focusOnHover}\n shouldUseVirtualFocus={!(isReorderable && !searchValue.trim())}\n isFocusWithin={isFocusWithin}\n showSelectAll={showSelectAll}\n selectAllLabel={selectAllLabel}\n footer={footer}\n footerStyles={footerStyles}\n mods={mods}\n styles={listBoxStyles}\n isCheckable={isCheckable}\n items={items as any}\n allValueProps={allValueProps}\n filter={filterFn}\n emptyLabel={\n emptyLabel !== undefined\n ? emptyLabel\n : searchValue.trim()\n ? t('filterListBox.noResults', 'No results found')\n : t('filterListBox.noItems', 'No items')\n }\n isReorderable={isReorderable && !searchValue.trim()}\n onReorder={onReorder}\n onSelectionChange={handleSelectionChange}\n onEscape={onEscape}\n onOptionClick={handleOptionClick}\n >\n {enhancedChildren as any}\n </ListBox>\n </FilterListBoxWrapperElement>\n );\n\n return wrapWithField<Omit<CubeFilterListBoxProps<T>, 'children'>>(\n filterListBoxField,\n { ...props, ...fieldLayout.field },\n );\n}) as unknown as (<T>(\n props: CubeFilterListBoxProps<T> & { ref?: ForwardedRef<HTMLDivElement> },\n) => ReactElement) & { Item: typeof Item; Section: typeof BaseSection };\n\nFilterListBox.Item = Item;\n\nFilterListBox.Section = BaseSection;\n\nObject.defineProperty(FilterListBox, 'cubeInputType', {\n value: 'FilterListBox',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwIA,MAAagF,gBAAgB1E,WAAW,SAAS0E,cAE/CC,OAAkCC,KAAmC;CACrED,QAAQ/C,cAAc+C,OAAO,EAC3BG,mBAAmB,EAAEN,OAAOO,eAAe;EACzC,MAAMC,aAAkB,CAAC;EAEzB,IAAIL,MAAMM,kBAAkB,YAC1BD,WAAWE,eAAeV,SAAS,CAAA;OAEnCQ,WAAWG,cAAcX,SAAS;EAGpCQ,WAAWI,qBAAqBlB,QAAa;GAC3C,IAAIS,MAAMM,kBAAkB,YAAY;IAEtC,IAAIf,QAAQ,OACVa,SAAS,KAAK;SAEdA,SAASb,MAAOmB,MAAMC,QAAQpB,GAAG,IAAIA,MAAM,CAACA,GAAG,IAAK,CAAA,CAAE;GAE1D,OACEa,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AYG,gBAAgB;EAL7C,UAAA;GAOGlF,SACC,oBAAC,2BAAD;IAA2B,aAAWE;IAAM,QAAQC;IACjDH,UAAAA;GACwB,CAAA,IAE3B,oBAAC,OAAD,EAAK,MAAK,eAAc,CAAA;GAEzB0I;GACD,oBAAC,SAAD;IACE,QAAA;IACA,KAAKtD;IACL,IAAIC;IACJ,cAAY9B;IACCxF;IACO4B;IACN7B;IACO8B;IACN/B;IACHgB;IACHO;IACT,UAAUkG;IACEvG;IACKU;IACHT;IACCC;IACAC;IACNC;IACER;IACFC;IACT,wBAAwBrB,MAAMsL;IAC9B,+BAA+BtL,MAAMuL;IACrC,cAAcvL,MAAM4I;IACN3G;IACd,uBAAuB,EAAEkB,iBAAiB,CAACxD,YAAY4F,KAAK;IAC7CkC;IACAlF;IACCC;IACRE;IACMG;IACR5D;IACN,QAAQE;IACKE;IACNyD;IACQG;IACf,QAAQkD;IACR,YACEzH,eAAekG,KAAAA,IACXlG,aACAiB,YAAY4F,KAAK,IACf3E,EAAE,2BAA2B,kBAAkB,IAC/CA,EAAE,yBAAyB,UAAU;IAE7C,eAAeuC,iBAAiB,CAACxD,YAAY4F,KAAK;IACvCnC;IACX,mBAAmBuH;IACTvL;IACV,eAAe4L;IAEdrE,UAAAA;GACM,CAAA;EACkB;;CAG/B,OAAOxJ,cACLkO,oBACA;EAAE,GAAGrL;EAAO,GAAGqH,YAAYmE;CAAM,CACnC;AACF,CAAC;AAIDzL,cAAchD,OAAOA;AAErBgD,cAAc3D,UAAUC;AAExBoP,OAAOC,eAAe3L,eAAe,iBAAiB;CACpDF,OAAO;CACP8L,YAAY;CACZC,cAAc;AAChB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.211.0 | Cube Dev Team */
|
|
2
2
|
import { StyledHeader } from "../../actions/Menu/styled.js";
|
|
3
3
|
import { DEFAULT_INPUT_STYLES, INPUT_WRAPPER_STYLES } from "../TextInput/TextInputBase.js";
|
|
4
4
|
import { mergeStyles, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.211.0 | Cube Dev Team */
|
|
2
2
|
import { mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { Text as _Text } from "../../content/Text.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.211.0 | Cube Dev Team */
|
|
2
2
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
3
3
|
import { LoadingIcon } from "../../../icons/LoadingIcon.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -7,6 +7,7 @@ import { buildTreeIndex, getTreeNodeText } from "../../content/Tree/tree-index.j
|
|
|
7
7
|
import { StyledFooter } from "../../actions/Menu/styled.js";
|
|
8
8
|
import { deriveCheckedSets, toOrderedKeys, toggleCheckedKey } from "../../content/Tree/checked-keys.js";
|
|
9
9
|
import { Tree } from "../../content/Tree/Tree.js";
|
|
10
|
+
import { EMPTY_ROW_STYLES } from "../ListBox/empty-row.js";
|
|
10
11
|
import { FilterListBoxWrapperElement, SearchInputElement, SearchWrapperElement, StyledHeaderWithoutBorder } from "../FilterListBox/styled.js";
|
|
11
12
|
import { getTreeRowId } from "../../content/Tree/rowId.js";
|
|
12
13
|
import { c } from "react/compiler-runtime";
|
|
@@ -340,6 +341,7 @@ function FilterTree(props) {
|
|
|
340
341
|
color: "#dark-03",
|
|
341
342
|
size,
|
|
342
343
|
padding: "(.5x - 1bw)",
|
|
344
|
+
styles: EMPTY_ROW_STYLES,
|
|
343
345
|
children: resolvedEmptyLabel
|
|
344
346
|
});
|
|
345
347
|
let t22;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterTree.js","names":["tasty","useRef","useState","useFilter","useId","useKeyboard","useI18n","LoadingIcon","mergeRefs","StyledFooter","Item","deriveCheckedSets","toggleCheckedKey","toOrderedKeys","getTreeRowId","Tree","buildTreeIndex","getTreeNodeText","FilterListBoxWrapperElement","SearchInputElement","SearchWrapperElement","StyledHeaderWithoutBorder","Styles","ReactNode","RefObject","CubeTreeNodeData","FilterFn","textValue","inputValue","FilterTreeProps","treeData","checkedKeys","onCheckedKeysChange","keys","expandedKeys","onExpand","searchValue","onSearchChange","value","searchPlaceholder","searchInputStyles","searchInputRef","HTMLInputElement","filter","emptyLabel","header","headerStyles","footer","footerStyles","size","isDisabled","isLoadingItems","shouldFocusWrap","autoFocus","onEscape","onCommit","FilterTreeListElement","qa","styles","display","gridColumns","gridRows","height","FOOTER_ROWS_STYLES","filterTreeData","nodes","query","match","expandKeys","kept","node","push","children","length","key","getNavigableRows","expanded","Set","out","has","FilterTree","props","$","_c","controlledSearchValue","t0","undefined","t","t1","t2","ariaLabel","treeId","inputRef","t3","Symbol","for","sensitivity","contains","internalSearchValue","setInternalSearchValue","t4","trim","isSearching","searchExpansion","setSearchExpansion","expansionQuery","setExpansionQuery","t5","setSearchValue","index","checked","halfChecked","filtered","expandedSet","t6","setExpanded","rows","rowKeys","map","_temp","storedActiveKey","setActiveKey","activeKey","includes","find","toggle","key_0","next","toggleActive","key_1","t7","setTimeout","current","focus","refocusSearch","t8","key_2","moveActive","getActiveRow","row_0","row","handleArrow","direction","position","indexOf","next_0","handleExpandKey","input","direction_0","row_1","caret","selectionStart","atEdge","selectionEnd","hasChildren","isExpanded","_temp2","key_3","parentKey","parentOf","get","keyboardProps","onKeyDown","e","bb179","preventDefault","target","t9","t10","t11","t12","disabled","searchable","suffix","searchMods","t13","resolvedEmptyLabel","t14","popover","t15","t16","t17","t18","e_0","t19","T0","t20","t21","keys_0","String","_","info","t22","t23","child","_c","useId","Item"],"sources":["../../../../src/components/fields/FilterPicker/FilterTree.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport { useRef, useState } from 'react';\nimport { useFilter, useId, useKeyboard } from 'react-aria';\n\nimport { useI18n } from '../../../i18n/useI18n';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { mergeRefs } from '../../../utils/react/useCombinedRefs';\nimport { StyledFooter } from '../../actions/Menu/styled';\nimport { Item } from '../../content/Item/Item';\nimport {\n deriveCheckedSets,\n toggleCheckedKey,\n toOrderedKeys,\n} from '../../content/Tree/checked-keys';\nimport { getTreeRowId } from '../../content/Tree/rowId';\nimport { Tree } from '../../content/Tree/Tree';\nimport { buildTreeIndex, getTreeNodeText } from '../../content/Tree/tree-index';\nimport {\n FilterListBoxWrapperElement,\n SearchInputElement,\n SearchWrapperElement,\n StyledHeaderWithoutBorder,\n} from '../FilterListBox/styled';\n\nimport type { Styles } from '@tenphi/tasty';\nimport type { ReactNode, RefObject } from 'react';\nimport type { CubeTreeNodeData } from '../../content/Tree/types';\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\nexport interface FilterTreeProps {\n treeData: CubeTreeNodeData[];\n /** The value: checked keys over the whole tree. A parent key checks its subtree. */\n checkedKeys: readonly string[];\n /** Every fully checked key, parents included, in tree order. */\n onCheckedKeysChange: (keys: string[]) => void;\n /** The user's expansion. FilterPicker holds it, so it outlives the popover. */\n expandedKeys: string[];\n onExpand: (keys: string[]) => void;\n searchValue?: string;\n onSearchChange?: (value: string) => void;\n searchPlaceholder?: string;\n searchInputStyles?: Styles;\n searchInputRef?: RefObject<HTMLInputElement | null>;\n filter?: FilterFn | false;\n emptyLabel?: ReactNode;\n header?: ReactNode;\n headerStyles?: Styles;\n footer?: ReactNode;\n footerStyles?: Styles;\n size?: 'medium' | 'large';\n isDisabled?: boolean;\n isLoadingItems?: boolean;\n shouldFocusWrap?: boolean;\n autoFocus?: boolean;\n 'aria-label'?: string;\n /** Escape on an empty search. */\n onEscape?: () => void;\n /** Enter toggled the active row. FilterPicker closes the popover, as it does for a checkable list. */\n onCommit?: () => void;\n}\n\nconst FilterTreeListElement = tasty({\n qa: 'FilterTreeList',\n styles: {\n display: 'grid',\n gridColumns: '1sf',\n gridRows: '1sf',\n height: 'min 0',\n },\n});\n\n/** With a footer, the frame takes a fourth row for it. */\nconst FOOTER_ROWS_STYLES: Styles = {\n gridRows: 'max-content max-content 1sf max-content',\n};\n\n/**\n * Keep the nodes that match, each with its whole subtree, and the ancestors\n * of deeper matches with only their matching branches. `expandKeys` are the\n * nodes with a match below them, matching or not, so they open to show it.\n */\nfunction filterTreeData(\n nodes: CubeTreeNodeData[],\n query: string,\n match: FilterFn,\n expandKeys: string[] = [],\n): { nodes: CubeTreeNodeData[]; expandKeys: string[] } {\n const kept: CubeTreeNodeData[] = [];\n\n for (const node of nodes) {\n if (match(getTreeNodeText(node), query)) {\n kept.push(node);\n if (\n node.children &&\n filterTreeData(node.children, query, match, expandKeys).nodes.length\n ) {\n expandKeys.push(node.key);\n }\n continue;\n }\n\n const children = node.children\n ? filterTreeData(node.children, query, match, expandKeys).nodes\n : [];\n\n if (children.length) {\n kept.push({ ...node, children });\n expandKeys.push(node.key);\n }\n }\n\n return { nodes: kept, expandKeys };\n}\n\n/** The rows a keyboard can reach, top to bottom. */\nfunction getNavigableRows(\n nodes: CubeTreeNodeData[],\n expanded: Set<string>,\n out: CubeTreeNodeData[] = [],\n): CubeTreeNodeData[] {\n for (const node of nodes) {\n if (!node.isDisabled) out.push(node);\n if (node.children && expanded.has(node.key)) {\n getNavigableRows(node.children, expanded, out);\n }\n }\n\n return out;\n}\n\n/**\n * FilterPicker's popover in tree mode: FilterListBox's header, search row\n * and footer around a checkable `Tree`.\n *\n * The search input keeps focus and points at the active row with\n * `aria-activedescendant`, as FilterListBox does for its options. The\n * checkbox cascade runs over the whole `treeData`, never only the rows a\n * search left visible.\n */\nexport function FilterTree(props: FilterTreeProps) {\n const {\n treeData,\n checkedKeys,\n onCheckedKeysChange,\n expandedKeys,\n onExpand,\n searchValue: controlledSearchValue,\n onSearchChange,\n searchInputStyles,\n searchInputRef,\n filter,\n header,\n headerStyles,\n footer,\n footerStyles,\n size = 'medium',\n isDisabled,\n isLoadingItems,\n shouldFocusWrap,\n autoFocus,\n onEscape,\n onCommit,\n } = props;\n const { t } = useI18n();\n const {\n searchPlaceholder = t('filterListBox.searchPlaceholder', 'Search...'),\n emptyLabel,\n } = props;\n const ariaLabel = props['aria-label'];\n\n const treeId = useId();\n const inputRef = useRef<HTMLInputElement>(null);\n const { contains } = useFilter({ sensitivity: 'base' });\n\n const [internalSearchValue, setInternalSearchValue] = useState('');\n const searchValue = controlledSearchValue ?? internalSearchValue;\n const query = searchValue.trim();\n const isSearching = !!query && filter !== false;\n\n // Expansion during a search is its own: it starts from the ancestors of\n // the matches and resets whenever the query changes, typed or controlled.\n // Clearing the search brings back the expansion the user had, untouched.\n const [searchExpansion, setSearchExpansion] = useState<string[] | null>(null);\n const [expansionQuery, setExpansionQuery] = useState(query);\n\n if (expansionQuery !== query) {\n setExpansionQuery(query);\n setSearchExpansion(null);\n }\n\n const setSearchValue = (value: string) => {\n if (controlledSearchValue === undefined) setInternalSearchValue(value);\n onSearchChange?.(value);\n };\n\n const index = buildTreeIndex(treeData);\n const { checked, halfChecked } = deriveCheckedSets(\n treeData,\n index,\n checkedKeys,\n );\n\n const filtered = isSearching\n ? filterTreeData(\n treeData,\n query,\n typeof filter === 'function' ? filter : contains,\n )\n : { nodes: treeData, expandKeys: [] };\n\n const expanded = isSearching\n ? (searchExpansion ?? filtered.expandKeys)\n : expandedKeys;\n const expandedSet = new Set(expanded);\n\n const setExpanded = (keys: string[]) => {\n if (isSearching) {\n setSearchExpansion(keys);\n return;\n }\n onExpand(keys);\n };\n\n const rows = getNavigableRows(filtered.nodes, expandedSet);\n const rowKeys = rows.map((row) => row.key);\n\n // The row the search input points at. One that a search or a collapse\n // hid falls back to the first checked row in view, then the first row.\n const [storedActiveKey, setActiveKey] = useState<string | null>(null);\n const activeKey =\n storedActiveKey != null && rowKeys.includes(storedActiveKey)\n ? storedActiveKey\n : (rowKeys.find((key) => checked.has(key)) ?? rowKeys[0] ?? null);\n\n // Whether the node could be toggled: one with its checkbox disabled or\n // opted out stays as it is.\n const toggle = (key: string): boolean => {\n const next = toggleCheckedKey(index, checked, key);\n if (!next) return false;\n onCheckedKeysChange(\n toOrderedKeys(index, deriveCheckedSets(treeData, index, next).checked),\n );\n return true;\n };\n\n // Toggle the active row and keep it active, though the fallback above\n // would move away from a row that is no longer checked.\n const toggleActive = (key: string) => {\n setActiveKey(key);\n return toggle(key);\n };\n\n // A press on a row, its checkbox or its chevron moves DOM focus into the\n // tree; hand it back so typing and arrow keys keep working.\n const refocusSearch = () => {\n setTimeout(() => inputRef.current?.focus(), 0);\n };\n\n const moveActive = (key: string | undefined) => {\n if (key != null) setActiveKey(key);\n };\n\n const getActiveRow = () =>\n activeKey == null ? undefined : rows.find((row) => row.key === activeKey);\n\n const handleArrow = (direction: 1 | -1) => {\n const position = activeKey == null ? -1 : rowKeys.indexOf(activeKey);\n let next = position + direction;\n if (position < 0) next = direction === 1 ? 0 : rowKeys.length - 1;\n if (next < 0 || next >= rowKeys.length) {\n if (!shouldFocusWrap) return;\n next = (next + rowKeys.length) % rowKeys.length;\n }\n moveActive(rowKeys[next]);\n };\n\n // Right and Left reach the tree only where they can no longer move the\n // caret: at the end of the text, and at its start.\n const handleExpandKey = (\n input: HTMLInputElement,\n direction: 'open' | 'close',\n ): boolean => {\n const row = getActiveRow();\n if (!row) return false;\n\n const caret = input.selectionStart ?? 0;\n const atEdge =\n input.selectionStart === input.selectionEnd &&\n (direction === 'open' ? caret === input.value.length : caret === 0);\n if (!atEdge) return false;\n\n const hasChildren = !!row.children?.length;\n const isExpanded = expandedSet.has(row.key);\n\n if (direction === 'open') {\n if (!hasChildren) return false;\n if (!isExpanded) {\n setExpanded([...expanded, row.key]);\n } else {\n moveActive(row.children?.find((child) => !child.isDisabled)?.key);\n }\n return true;\n }\n\n if (hasChildren && isExpanded) {\n setExpanded(expanded.filter((key) => key !== row.key));\n return true;\n }\n\n // The nearest ancestor the keyboard can reach; a disabled one is skipped.\n let parentKey = index.parentOf.get(row.key);\n while (parentKey != null && !rowKeys.includes(parentKey)) {\n parentKey = index.parentOf.get(parentKey);\n }\n if (parentKey == null) return false;\n moveActive(parentKey);\n return true;\n };\n\n const { keyboardProps } = useKeyboard({\n onKeyDown: (e) => {\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n e.preventDefault();\n handleArrow(e.key === 'ArrowDown' ? 1 : -1);\n break;\n case 'Home':\n case 'End':\n case 'PageUp':\n case 'PageDown':\n e.preventDefault();\n moveActive(\n e.key === 'Home' || e.key === 'PageUp'\n ? rowKeys[0]\n : rowKeys[rowKeys.length - 1],\n );\n break;\n case 'ArrowRight':\n case 'ArrowLeft':\n if (\n handleExpandKey(\n e.target as HTMLInputElement,\n e.key === 'ArrowRight' ? 'open' : 'close',\n )\n ) {\n e.preventDefault();\n }\n break;\n case 'Enter':\n if (activeKey == null) break;\n e.preventDefault();\n if (toggleActive(activeKey)) onCommit?.();\n break;\n case ' ':\n if (activeKey == null || searchValue) break;\n e.preventDefault();\n toggleActive(activeKey);\n break;\n case 'Escape':\n if (searchValue) {\n e.preventDefault();\n setSearchValue('');\n } else if (onEscape) {\n e.preventDefault();\n onEscape();\n }\n break;\n default:\n break;\n }\n },\n });\n\n const searchMods = {\n disabled: !!isDisabled,\n 'loading-items': !!isLoadingItems,\n searchable: true,\n suffix: !!isLoadingItems,\n };\n\n const resolvedEmptyLabel =\n emptyLabel !== undefined\n ? emptyLabel\n : query\n ? t('filterListBox.noResults', 'No results found')\n : t('filterListBox.noItems', 'No items');\n\n return (\n <FilterListBoxWrapperElement\n qa=\"FilterTreeWrapper\"\n mods={{ popover: true }}\n styles={footer ? FOOTER_ROWS_STYLES : undefined}\n >\n {header ? (\n <StyledHeaderWithoutBorder data-size={size} styles={headerStyles}>\n {header}\n </StyledHeaderWithoutBorder>\n ) : (\n <div role=\"presentation\" />\n )}\n <SearchWrapperElement mods={searchMods} data-size={size}>\n <SearchInputElement\n ref={mergeRefs(inputRef, searchInputRef)}\n qa=\"FilterTreeSearch\"\n type=\"search\"\n role=\"combobox\"\n aria-expanded=\"true\"\n aria-haspopup=\"tree\"\n aria-controls={filtered.nodes.length ? treeId : undefined}\n aria-activedescendant={\n activeKey == null ? undefined : getTreeRowId(treeId, activeKey)\n }\n aria-label={ariaLabel}\n placeholder={searchPlaceholder}\n value={searchValue}\n disabled={isDisabled}\n autoFocus={autoFocus}\n {...(autoFocus ? { 'data-autofocus': '' } : undefined)}\n data-size={size}\n mods={searchMods}\n styles={searchInputStyles}\n onChange={(e) => setSearchValue(e.target.value)}\n {...keyboardProps}\n />\n {isLoadingItems && (\n <div data-element=\"Suffix\">\n <LoadingIcon data-element=\"InputIcon\" />\n </div>\n )}\n </SearchWrapperElement>\n <FilterTreeListElement\n // Only the tree's own focus goes back: an empty label may hold a\n // control, such as Retry, that the keyboard has to reach.\n onFocus={filtered.nodes.length ? refocusSearch : undefined}\n >\n {filtered.nodes.length ? (\n <Tree\n id={treeId}\n qa=\"FilterTree\"\n ariaLabel={ariaLabel}\n treeData={filtered.nodes}\n size={size}\n isCheckable\n isDisabled={isDisabled}\n selectionMode=\"none\"\n checkedKeys={{\n checked: [...checked],\n halfChecked: [...halfChecked],\n }}\n expandedKeys={expanded}\n _activeKey={activeKey}\n onExpand={(keys) => setExpanded(keys.map(String))}\n onCheck={(_, info) => toggle(info.node.key)}\n _onRowAction={toggleActive}\n />\n ) : (\n <Item preset=\"t4\" color=\"#dark-03\" size={size} padding=\"(.5x - 1bw)\">\n {resolvedEmptyLabel}\n </Item>\n )}\n </FilterTreeListElement>\n {footer ? (\n <StyledFooter styles={footerStyles} data-size={size}>\n {footer}\n </StyledFooter>\n ) : null}\n </FilterListBoxWrapperElement>\n );\n}\n"],"mappings":";;;;;;;;;;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MAAAlC;EAAAkC,EAAA,MAAAjC;EAAAiC,EAAA,MAAA+G;CAAA,OAAAA,MAAA/G,EAAA;CAAA,OA7EV,qBAAC,6BAAD;EACK,IAAA;EACG,MAAA+F;EACE,QAAAlI,SAAAgB,qBAAAuB,KAAAA;EAHV,UAAA;GAKG6F;GAOD,qBAAC,sBAAD;IAA4BL,MAAAA;IAAuB7H,aAAAA;IAAnD,UAAA,CACE,oBAAC,oBAAD;KACO,KAAAmI;KACF,IAAA;KACE,MAAA;KACA,MAAA;KACS,iBAAA;KACA,iBAAA;KACC,iBAAApE,SAAQ/C,MAAMQ,SAAdkB,SAAAL,KAAAA;KAEb,yBAAAoC,aAAa,OAAbpC,KAAAA,IAAgCxE,aAAa6E,QAAQ+B,SAAS;KAEpDhC,cAAAA;KACCnD,aAAAA;KACNH,OAAAA;KACGc,UAAAA;KACCG;KAAS,GACfgI;KACMpI,aAAAA;KACL6H,MAAAA;KACEtI,QAAAA;KACE,UAAA8I;KAAqC,GAC3CrB;IAAa,CAAA,GAElBuB,GAxBkB;;GA8BrBQ;GA+BCC;EAzEyB;;AA8EE;AAxU3B,SAAArC,OAAAsC,OAAA;CAAA,OAgK0C,CAACA,MAAKhJ;AAAW;AAhK3D,SAAAqE,MAAAqB,KAAA;CAAA,OAqF6BA,IAAGlE;AAAI"}
|
|
1
|
+
{"version":3,"file":"FilterTree.js","names":["tasty","useRef","useState","useFilter","useId","useKeyboard","useI18n","LoadingIcon","mergeRefs","StyledFooter","Item","deriveCheckedSets","toggleCheckedKey","toOrderedKeys","getTreeRowId","Tree","buildTreeIndex","getTreeNodeText","FilterListBoxWrapperElement","SearchInputElement","SearchWrapperElement","StyledHeaderWithoutBorder","EMPTY_ROW_STYLES","Styles","ReactNode","RefObject","CubeTreeNodeData","FilterFn","textValue","inputValue","FilterTreeProps","treeData","checkedKeys","onCheckedKeysChange","keys","expandedKeys","onExpand","searchValue","onSearchChange","value","searchPlaceholder","searchInputStyles","searchInputRef","HTMLInputElement","filter","emptyLabel","header","headerStyles","footer","footerStyles","size","isDisabled","isLoadingItems","shouldFocusWrap","autoFocus","onEscape","onCommit","FilterTreeListElement","qa","styles","display","gridColumns","gridRows","height","FOOTER_ROWS_STYLES","filterTreeData","nodes","query","match","expandKeys","kept","node","push","children","length","key","getNavigableRows","expanded","Set","out","has","FilterTree","props","$","_c","controlledSearchValue","t0","undefined","t","t1","t2","ariaLabel","treeId","inputRef","t3","Symbol","for","sensitivity","contains","internalSearchValue","setInternalSearchValue","t4","trim","isSearching","searchExpansion","setSearchExpansion","expansionQuery","setExpansionQuery","t5","setSearchValue","index","checked","halfChecked","filtered","expandedSet","t6","setExpanded","rows","rowKeys","map","_temp","storedActiveKey","setActiveKey","activeKey","includes","find","toggle","key_0","next","toggleActive","key_1","t7","setTimeout","current","focus","refocusSearch","t8","key_2","moveActive","getActiveRow","row_0","row","handleArrow","direction","position","indexOf","next_0","handleExpandKey","input","direction_0","row_1","caret","selectionStart","atEdge","selectionEnd","hasChildren","isExpanded","_temp2","key_3","parentKey","parentOf","get","keyboardProps","onKeyDown","e","bb179","preventDefault","target","t9","t10","t11","t12","disabled","searchable","suffix","searchMods","t13","resolvedEmptyLabel","t14","popover","t15","t16","t17","t18","e_0","t19","T0","t20","t21","keys_0","String","_","info","t22","t23","child","_c","useId","Item"],"sources":["../../../../src/components/fields/FilterPicker/FilterTree.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport { useRef, useState } from 'react';\nimport { useFilter, useId, useKeyboard } from 'react-aria';\n\nimport { useI18n } from '../../../i18n/useI18n';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { mergeRefs } from '../../../utils/react/useCombinedRefs';\nimport { StyledFooter } from '../../actions/Menu/styled';\nimport { Item } from '../../content/Item/Item';\nimport {\n deriveCheckedSets,\n toggleCheckedKey,\n toOrderedKeys,\n} from '../../content/Tree/checked-keys';\nimport { getTreeRowId } from '../../content/Tree/rowId';\nimport { Tree } from '../../content/Tree/Tree';\nimport { buildTreeIndex, getTreeNodeText } from '../../content/Tree/tree-index';\nimport {\n FilterListBoxWrapperElement,\n SearchInputElement,\n SearchWrapperElement,\n StyledHeaderWithoutBorder,\n} from '../FilterListBox/styled';\nimport { EMPTY_ROW_STYLES } from '../ListBox/empty-row';\n\nimport type { Styles } from '@tenphi/tasty';\nimport type { ReactNode, RefObject } from 'react';\nimport type { CubeTreeNodeData } from '../../content/Tree/types';\n\ntype FilterFn = (textValue: string, inputValue: string) => boolean;\n\nexport interface FilterTreeProps {\n treeData: CubeTreeNodeData[];\n /** The value: checked keys over the whole tree. A parent key checks its subtree. */\n checkedKeys: readonly string[];\n /** Every fully checked key, parents included, in tree order. */\n onCheckedKeysChange: (keys: string[]) => void;\n /** The user's expansion. FilterPicker holds it, so it outlives the popover. */\n expandedKeys: string[];\n onExpand: (keys: string[]) => void;\n searchValue?: string;\n onSearchChange?: (value: string) => void;\n searchPlaceholder?: string;\n searchInputStyles?: Styles;\n searchInputRef?: RefObject<HTMLInputElement | null>;\n filter?: FilterFn | false;\n emptyLabel?: ReactNode;\n header?: ReactNode;\n headerStyles?: Styles;\n footer?: ReactNode;\n footerStyles?: Styles;\n size?: 'medium' | 'large';\n isDisabled?: boolean;\n isLoadingItems?: boolean;\n shouldFocusWrap?: boolean;\n autoFocus?: boolean;\n 'aria-label'?: string;\n /** Escape on an empty search. */\n onEscape?: () => void;\n /** Enter toggled the active row. FilterPicker closes the popover, as it does for a checkable list. */\n onCommit?: () => void;\n}\n\nconst FilterTreeListElement = tasty({\n qa: 'FilterTreeList',\n styles: {\n display: 'grid',\n gridColumns: '1sf',\n gridRows: '1sf',\n height: 'min 0',\n },\n});\n\n/** With a footer, the frame takes a fourth row for it. */\nconst FOOTER_ROWS_STYLES: Styles = {\n gridRows: 'max-content max-content 1sf max-content',\n};\n\n/**\n * Keep the nodes that match, each with its whole subtree, and the ancestors\n * of deeper matches with only their matching branches. `expandKeys` are the\n * nodes with a match below them, matching or not, so they open to show it.\n */\nfunction filterTreeData(\n nodes: CubeTreeNodeData[],\n query: string,\n match: FilterFn,\n expandKeys: string[] = [],\n): { nodes: CubeTreeNodeData[]; expandKeys: string[] } {\n const kept: CubeTreeNodeData[] = [];\n\n for (const node of nodes) {\n if (match(getTreeNodeText(node), query)) {\n kept.push(node);\n if (\n node.children &&\n filterTreeData(node.children, query, match, expandKeys).nodes.length\n ) {\n expandKeys.push(node.key);\n }\n continue;\n }\n\n const children = node.children\n ? filterTreeData(node.children, query, match, expandKeys).nodes\n : [];\n\n if (children.length) {\n kept.push({ ...node, children });\n expandKeys.push(node.key);\n }\n }\n\n return { nodes: kept, expandKeys };\n}\n\n/** The rows a keyboard can reach, top to bottom. */\nfunction getNavigableRows(\n nodes: CubeTreeNodeData[],\n expanded: Set<string>,\n out: CubeTreeNodeData[] = [],\n): CubeTreeNodeData[] {\n for (const node of nodes) {\n if (!node.isDisabled) out.push(node);\n if (node.children && expanded.has(node.key)) {\n getNavigableRows(node.children, expanded, out);\n }\n }\n\n return out;\n}\n\n/**\n * FilterPicker's popover in tree mode: FilterListBox's header, search row\n * and footer around a checkable `Tree`.\n *\n * The search input keeps focus and points at the active row with\n * `aria-activedescendant`, as FilterListBox does for its options. The\n * checkbox cascade runs over the whole `treeData`, never only the rows a\n * search left visible.\n */\nexport function FilterTree(props: FilterTreeProps) {\n const {\n treeData,\n checkedKeys,\n onCheckedKeysChange,\n expandedKeys,\n onExpand,\n searchValue: controlledSearchValue,\n onSearchChange,\n searchInputStyles,\n searchInputRef,\n filter,\n header,\n headerStyles,\n footer,\n footerStyles,\n size = 'medium',\n isDisabled,\n isLoadingItems,\n shouldFocusWrap,\n autoFocus,\n onEscape,\n onCommit,\n } = props;\n const { t } = useI18n();\n const {\n searchPlaceholder = t('filterListBox.searchPlaceholder', 'Search...'),\n emptyLabel,\n } = props;\n const ariaLabel = props['aria-label'];\n\n const treeId = useId();\n const inputRef = useRef<HTMLInputElement>(null);\n const { contains } = useFilter({ sensitivity: 'base' });\n\n const [internalSearchValue, setInternalSearchValue] = useState('');\n const searchValue = controlledSearchValue ?? internalSearchValue;\n const query = searchValue.trim();\n const isSearching = !!query && filter !== false;\n\n // Expansion during a search is its own: it starts from the ancestors of\n // the matches and resets whenever the query changes, typed or controlled.\n // Clearing the search brings back the expansion the user had, untouched.\n const [searchExpansion, setSearchExpansion] = useState<string[] | null>(null);\n const [expansionQuery, setExpansionQuery] = useState(query);\n\n if (expansionQuery !== query) {\n setExpansionQuery(query);\n setSearchExpansion(null);\n }\n\n const setSearchValue = (value: string) => {\n if (controlledSearchValue === undefined) setInternalSearchValue(value);\n onSearchChange?.(value);\n };\n\n const index = buildTreeIndex(treeData);\n const { checked, halfChecked } = deriveCheckedSets(\n treeData,\n index,\n checkedKeys,\n );\n\n const filtered = isSearching\n ? filterTreeData(\n treeData,\n query,\n typeof filter === 'function' ? filter : contains,\n )\n : { nodes: treeData, expandKeys: [] };\n\n const expanded = isSearching\n ? (searchExpansion ?? filtered.expandKeys)\n : expandedKeys;\n const expandedSet = new Set(expanded);\n\n const setExpanded = (keys: string[]) => {\n if (isSearching) {\n setSearchExpansion(keys);\n return;\n }\n onExpand(keys);\n };\n\n const rows = getNavigableRows(filtered.nodes, expandedSet);\n const rowKeys = rows.map((row) => row.key);\n\n // The row the search input points at. One that a search or a collapse\n // hid falls back to the first checked row in view, then the first row.\n const [storedActiveKey, setActiveKey] = useState<string | null>(null);\n const activeKey =\n storedActiveKey != null && rowKeys.includes(storedActiveKey)\n ? storedActiveKey\n : (rowKeys.find((key) => checked.has(key)) ?? rowKeys[0] ?? null);\n\n // Whether the node could be toggled: one with its checkbox disabled or\n // opted out stays as it is.\n const toggle = (key: string): boolean => {\n const next = toggleCheckedKey(index, checked, key);\n if (!next) return false;\n onCheckedKeysChange(\n toOrderedKeys(index, deriveCheckedSets(treeData, index, next).checked),\n );\n return true;\n };\n\n // Toggle the active row and keep it active, though the fallback above\n // would move away from a row that is no longer checked.\n const toggleActive = (key: string) => {\n setActiveKey(key);\n return toggle(key);\n };\n\n // A press on a row, its checkbox or its chevron moves DOM focus into the\n // tree; hand it back so typing and arrow keys keep working.\n const refocusSearch = () => {\n setTimeout(() => inputRef.current?.focus(), 0);\n };\n\n const moveActive = (key: string | undefined) => {\n if (key != null) setActiveKey(key);\n };\n\n const getActiveRow = () =>\n activeKey == null ? undefined : rows.find((row) => row.key === activeKey);\n\n const handleArrow = (direction: 1 | -1) => {\n const position = activeKey == null ? -1 : rowKeys.indexOf(activeKey);\n let next = position + direction;\n if (position < 0) next = direction === 1 ? 0 : rowKeys.length - 1;\n if (next < 0 || next >= rowKeys.length) {\n if (!shouldFocusWrap) return;\n next = (next + rowKeys.length) % rowKeys.length;\n }\n moveActive(rowKeys[next]);\n };\n\n // Right and Left reach the tree only where they can no longer move the\n // caret: at the end of the text, and at its start.\n const handleExpandKey = (\n input: HTMLInputElement,\n direction: 'open' | 'close',\n ): boolean => {\n const row = getActiveRow();\n if (!row) return false;\n\n const caret = input.selectionStart ?? 0;\n const atEdge =\n input.selectionStart === input.selectionEnd &&\n (direction === 'open' ? caret === input.value.length : caret === 0);\n if (!atEdge) return false;\n\n const hasChildren = !!row.children?.length;\n const isExpanded = expandedSet.has(row.key);\n\n if (direction === 'open') {\n if (!hasChildren) return false;\n if (!isExpanded) {\n setExpanded([...expanded, row.key]);\n } else {\n moveActive(row.children?.find((child) => !child.isDisabled)?.key);\n }\n return true;\n }\n\n if (hasChildren && isExpanded) {\n setExpanded(expanded.filter((key) => key !== row.key));\n return true;\n }\n\n // The nearest ancestor the keyboard can reach; a disabled one is skipped.\n let parentKey = index.parentOf.get(row.key);\n while (parentKey != null && !rowKeys.includes(parentKey)) {\n parentKey = index.parentOf.get(parentKey);\n }\n if (parentKey == null) return false;\n moveActive(parentKey);\n return true;\n };\n\n const { keyboardProps } = useKeyboard({\n onKeyDown: (e) => {\n switch (e.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n e.preventDefault();\n handleArrow(e.key === 'ArrowDown' ? 1 : -1);\n break;\n case 'Home':\n case 'End':\n case 'PageUp':\n case 'PageDown':\n e.preventDefault();\n moveActive(\n e.key === 'Home' || e.key === 'PageUp'\n ? rowKeys[0]\n : rowKeys[rowKeys.length - 1],\n );\n break;\n case 'ArrowRight':\n case 'ArrowLeft':\n if (\n handleExpandKey(\n e.target as HTMLInputElement,\n e.key === 'ArrowRight' ? 'open' : 'close',\n )\n ) {\n e.preventDefault();\n }\n break;\n case 'Enter':\n if (activeKey == null) break;\n e.preventDefault();\n if (toggleActive(activeKey)) onCommit?.();\n break;\n case ' ':\n if (activeKey == null || searchValue) break;\n e.preventDefault();\n toggleActive(activeKey);\n break;\n case 'Escape':\n if (searchValue) {\n e.preventDefault();\n setSearchValue('');\n } else if (onEscape) {\n e.preventDefault();\n onEscape();\n }\n break;\n default:\n break;\n }\n },\n });\n\n const searchMods = {\n disabled: !!isDisabled,\n 'loading-items': !!isLoadingItems,\n searchable: true,\n suffix: !!isLoadingItems,\n };\n\n const resolvedEmptyLabel =\n emptyLabel !== undefined\n ? emptyLabel\n : query\n ? t('filterListBox.noResults', 'No results found')\n : t('filterListBox.noItems', 'No items');\n\n return (\n <FilterListBoxWrapperElement\n qa=\"FilterTreeWrapper\"\n mods={{ popover: true }}\n styles={footer ? FOOTER_ROWS_STYLES : undefined}\n >\n {header ? (\n <StyledHeaderWithoutBorder data-size={size} styles={headerStyles}>\n {header}\n </StyledHeaderWithoutBorder>\n ) : (\n <div role=\"presentation\" />\n )}\n <SearchWrapperElement mods={searchMods} data-size={size}>\n <SearchInputElement\n ref={mergeRefs(inputRef, searchInputRef)}\n qa=\"FilterTreeSearch\"\n type=\"search\"\n role=\"combobox\"\n aria-expanded=\"true\"\n aria-haspopup=\"tree\"\n aria-controls={filtered.nodes.length ? treeId : undefined}\n aria-activedescendant={\n activeKey == null ? undefined : getTreeRowId(treeId, activeKey)\n }\n aria-label={ariaLabel}\n placeholder={searchPlaceholder}\n value={searchValue}\n disabled={isDisabled}\n autoFocus={autoFocus}\n {...(autoFocus ? { 'data-autofocus': '' } : undefined)}\n data-size={size}\n mods={searchMods}\n styles={searchInputStyles}\n onChange={(e) => setSearchValue(e.target.value)}\n {...keyboardProps}\n />\n {isLoadingItems && (\n <div data-element=\"Suffix\">\n <LoadingIcon data-element=\"InputIcon\" />\n </div>\n )}\n </SearchWrapperElement>\n <FilterTreeListElement\n // Only the tree's own focus goes back: an empty label may hold a\n // control, such as Retry, that the keyboard has to reach.\n onFocus={filtered.nodes.length ? refocusSearch : undefined}\n >\n {filtered.nodes.length ? (\n <Tree\n id={treeId}\n qa=\"FilterTree\"\n ariaLabel={ariaLabel}\n treeData={filtered.nodes}\n size={size}\n isCheckable\n isDisabled={isDisabled}\n selectionMode=\"none\"\n checkedKeys={{\n checked: [...checked],\n halfChecked: [...halfChecked],\n }}\n expandedKeys={expanded}\n _activeKey={activeKey}\n onExpand={(keys) => setExpanded(keys.map(String))}\n onCheck={(_, info) => toggle(info.node.key)}\n _onRowAction={toggleActive}\n />\n ) : (\n <Item\n preset=\"t4\"\n color=\"#dark-03\"\n size={size}\n padding=\"(.5x - 1bw)\"\n styles={EMPTY_ROW_STYLES}\n >\n {resolvedEmptyLabel}\n </Item>\n )}\n </FilterTreeListElement>\n {footer ? (\n <StyledFooter styles={footerStyles} data-size={size}>\n {footer}\n </StyledFooter>\n ) : null}\n </FilterListBoxWrapperElement>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+DA,MAAMyD,wBAAwBzD,MAAM;CAClC0D,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,aAAa;EACbC,UAAU;EACVC,QAAQ;CACV;AACF,CAAC;;AAGD,MAAMC,qBAA6B,EACjCF,UAAU,0CACZ;;;;;;AAOA,SAASG,eACPC,OACAC,OACAC,OACAC,aAAuB,CAAA,GAC8B;CACrD,MAAMC,OAA2B,CAAA;CAEjC,KAAK,MAAMC,QAAQL,OAAO;EACxB,IAAIE,MAAMnD,gBAAgBsD,IAAI,GAAGJ,KAAK,GA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C,iBAAApE,SAAQ/C,MAAMQ,SAAdkB,SAAAL,KAAAA;KAEb,yBAAAoC,aAAa,OAAbpC,KAAAA,IAAgCzE,aAAa8E,QAAQ+B,SAAS;KAEpDhC,cAAAA;KACCnD,aAAAA;KACNH,OAAAA;KACGc,UAAAA;KACCG;KAAS,GACfgI;KACMpI,aAAAA;KACL6H,MAAAA;KACEtI,QAAAA;KACE,UAAA8I;KAAqC,GAC3CrB;IAAa,CAAA,GAElBuB,GAxBkB;;GA8BrBQ;GAqCCC;EA/EyB;;AAoFE;AA9U3B,SAAArC,OAAAsC,OAAA;CAAA,OAgK0C,CAACA,MAAKhJ;AAAW;AAhK3D,SAAAqE,MAAAqB,KAAA;CAAA,OAqF6BA,IAAGlE;AAAI"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.211.0 | Cube Dev Team */
|
|
2
2
|
import { FileInput as _FileInput } from "../FileInput/FileInput.js";
|
|
3
3
|
import { NumberInput as _NumberInput } from "../NumberInput/NumberInput.js";
|
|
4
4
|
import { PasswordInput as _PasswordInput } from "../PasswordInput/PasswordInput.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.211.0 | Cube Dev Team */
|
|
2
2
|
import { DraggableCollection } from "../../shared/DraggableCollection.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -140,6 +140,7 @@ export interface CubeListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'autoFocu
|
|
|
140
140
|
/**
|
|
141
141
|
* Label to display when the list is empty (no items available).
|
|
142
142
|
* Defaults to "No items".
|
|
143
|
+
* It wraps to the list's width, so a long message, or an action in it, stays in view.
|
|
143
144
|
*/
|
|
144
145
|
emptyLabel?: ReactNode;
|
|
145
146
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.211.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useFocus as useFocus$1 } from "../../../utils/react/interactions.js";
|
|
@@ -19,6 +19,7 @@ import { GripVerticalIcon } from "../../../icons/GripVerticalIcon.js";
|
|
|
19
19
|
import { createMockDragState } from "../../shared/DraggableCollection.js";
|
|
20
20
|
import { useOptionOriginPress } from "../option-origin-press.js";
|
|
21
21
|
import { DraggableListBox } from "./DraggableListBox.js";
|
|
22
|
+
import { EMPTY_ROW_STYLES } from "./empty-row.js";
|
|
22
23
|
import { c } from "react/compiler-runtime";
|
|
23
24
|
import { mergeStyles, tasty } from "@tenphi/tasty";
|
|
24
25
|
import { forwardRef, useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
@@ -714,6 +715,7 @@ const ListBox = forwardRef(function ListBox(props, ref) {
|
|
|
714
715
|
color: "#dark-03",
|
|
715
716
|
size,
|
|
716
717
|
padding: "(.5x - 1bw)",
|
|
718
|
+
styles: EMPTY_ROW_STYLES,
|
|
717
719
|
children: emptyLabel
|
|
718
720
|
}), isReorderable && !isEmpty ? /* @__PURE__ */ jsx(DraggableListBox, {
|
|
719
721
|
state: listState,
|