@cube-dev/ui-kit 0.200.1 → 0.202.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/README.md +1 -1
- package/dist/CHANGELOG.md +50 -0
- package/dist/README.md +1 -1
- 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 +2 -1
- package/dist/components/HiddenInput.js.map +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider/Divider.d.ts +22 -0
- package/dist/components/content/Divider/Divider.js +159 -0
- package/dist/components/content/Divider/Divider.js.map +1 -0
- 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.d.ts +2 -1
- package/dist/components/content/TextItem/TextItem.js +134 -69
- package/dist/components/content/TextItem/TextItem.js.map +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +39 -14
- package/dist/components/content/Tree/Tree.js.map +1 -1
- package/dist/components/content/Tree/TreeNode.js +8 -7
- package/dist/components/content/Tree/TreeNode.js.map +1 -1
- package/dist/components/content/Tree/checked-keys.js +158 -0
- package/dist/components/content/Tree/checked-keys.js.map +1 -0
- package/dist/components/content/Tree/rowId.js +16 -0
- package/dist/components/content/Tree/rowId.js.map +1 -0
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +10 -2
- package/dist/components/content/Tree/tree-index.js.map +1 -1
- package/dist/components/content/Tree/types.d.ts +21 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +17 -123
- package/dist/components/content/Tree/use-checkbox-tree.js.map +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 +94 -66
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +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 +88 -0
- package/dist/components/data/TableBase/TableRowLink.js.map +1 -0
- package/dist/components/data/TableBase/TableView.js +317 -69
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +33 -22
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.d.ts +2 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/types.js.map +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.d.ts +3 -2
- package/dist/components/fields/Checkbox/Checkbox.js +21 -10
- package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.d.ts +3 -2
- package/dist/components/fields/Checkbox/CheckboxGroup.js +36 -42
- package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.d.ts +3 -2
- package/dist/components/fields/ColorInput/ColorInput.js +5 -3
- package/dist/components/fields/ColorInput/ColorInput.js.map +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/components/fields/ColorPicker/ColorPicker.js +182 -200
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.d.ts +3 -2
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +143 -171
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +6 -4
- package/dist/components/fields/ComboBox/ComboBox.js +601 -574
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +5 -4
- package/dist/components/fields/CommandTextArea/CommandTextArea.js.map +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateInput.js +7 -5
- package/dist/components/fields/DatePicker/DateInput.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +79 -76
- package/dist/components/fields/DatePicker/DateInputBase.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/DatePicker.js +85 -173
- package/dist/components/fields/DatePicker/DatePicker.js.map +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.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateRangePicker.js +117 -204
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +289 -434
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/PeriodPicker.js +87 -113
- 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.d.ts +3 -2
- package/dist/components/fields/DatePicker/TimeInput.js +7 -5
- package/dist/components/fields/DatePicker/TimeInput.js.map +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.d.ts +3 -2
- package/dist/components/fields/FileInput/FileInput.js +114 -141
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +10 -65
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterListBox/styled.js +66 -0
- package/dist/components/fields/FilterListBox/styled.js.map +1 -0
- package/dist/components/fields/FilterPicker/FilterPicker.d.ts +35 -3
- package/dist/components/fields/FilterPicker/FilterPicker.js +76 -15
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +413 -0
- package/dist/components/fields/FilterPicker/FilterTree.js.map +1 -0
- 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 +3 -2
- package/dist/components/fields/ListBox/ListBox.js +7 -10
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +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 +5 -3
- package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +5 -3
- package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/fields/Picker/Picker.d.ts +9 -3
- package/dist/components/fields/Picker/Picker.js +12 -11
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +152 -154
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.d.ts +3 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js +85 -111
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/RadioGroup/context.js.map +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.d.ts +9 -4
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +16 -23
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +52 -48
- package/dist/components/fields/SearchInput/SearchInput.js.map +1 -1
- package/dist/components/fields/Select/Select.d.ts +3 -2
- package/dist/components/fields/Select/Select.js +8 -10
- package/dist/components/fields/Select/Select.js.map +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +19 -26
- package/dist/components/fields/Slider/RangeSlider.js.map +1 -1
- package/dist/components/fields/Slider/Slider.js +51 -58
- package/dist/components/fields/Slider/Slider.js.map +1 -1
- package/dist/components/fields/Slider/SliderBase.js +61 -60
- package/dist/components/fields/Slider/SliderBase.js.map +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/Slider/types.d.ts +3 -2
- package/dist/components/fields/Switch/Switch.d.ts +12 -2
- package/dist/components/fields/Switch/Switch.js +97 -165
- package/dist/components/fields/Switch/Switch.js.map +1 -1
- package/dist/components/fields/TagInput/TagInput.d.ts +5 -2
- package/dist/components/fields/TagInput/TagInput.js +18 -13
- package/dist/components/fields/TagInput/TagInput.js.map +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +5 -3
- package/dist/components/fields/TextArea/TextArea.js.map +1 -1
- package/dist/components/fields/TextInput/TextInput.js +5 -3
- package/dist/components/fields/TextInput/TextInput.js.map +1 -1
- package/dist/components/fields/TextInput/TextInputBase.d.ts +15 -4
- package/dist/components/fields/TextInput/TextInputBase.js +200 -104
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/index.d.ts +2 -2
- 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/index.d.ts +2 -2
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +120 -57
- package/dist/components/form/FieldWrapper/FieldWrapper.js.map +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/field-chrome.js.map +1 -1
- package/dist/components/form/field-layout.d.ts +10 -0
- package/dist/components/form/field-layout.js +96 -0
- package/dist/components/form/field-layout.js.map +1 -0
- package/dist/components/form/index.d.ts +2 -1
- package/dist/components/form/legacy-tooltip.js +15 -2
- package/dist/components/form/legacy-tooltip.js.map +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 +6 -2
- package/dist/components/form/wrapper.js.map +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +2 -1
- package/dist/components/navigation/Tabs/styled.js.map +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +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-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 +2 -2
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js.map +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 +116 -116
- package/dist/data/item-themes.js.map +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.d.ts +4 -3
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.d.ts +5 -0
- package/dist/provider.js +19 -7
- package/dist/provider.js.map +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/shared/form.d.ts +3 -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 +4 -4
- package/dist/tokens/palette.js.map +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 +29 -2
- package/dist/utils/react/disabledProps.js.map +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 +44 -7
- package/dist/utils/react/overlayKeyPropagation.js.map +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 +3 -3
- package/docs/CreateComponent.md +1 -1
- package/docs/FieldProperties.md +17 -7
- package/docs/Usage.md +3 -0
- package/docs/components/content/Divider.md +103 -21
- package/docs/components/content/Tree.md +5 -4
- package/docs/components/data/ItemTable.md +9 -1
- package/docs/components/fields/Checkbox.md +7 -8
- package/docs/components/fields/ColorInput.md +11 -13
- package/docs/components/fields/ColorPicker.md +2 -2
- package/docs/components/fields/ColorSwatchGroup.md +2 -3
- package/docs/components/fields/ComboBox.md +2 -4
- package/docs/components/fields/CommandTextArea.md +3 -5
- package/docs/components/fields/DatePicker.md +1 -4
- package/docs/components/fields/FileInput.md +1 -5
- package/docs/components/fields/FilterListBox.md +0 -3
- package/docs/components/fields/FilterPicker.md +68 -5
- package/docs/components/fields/HueSlider.md +1 -2
- package/docs/components/fields/ListBox.md +0 -3
- package/docs/components/fields/NumberInput.md +5 -6
- package/docs/components/fields/PasswordInput.md +7 -8
- package/docs/components/fields/PeriodPicker.md +0 -4
- package/docs/components/fields/Picker.md +2 -4
- package/docs/components/fields/RadioGroup.md +4 -5
- package/docs/components/fields/SearchComboBox.md +2 -4
- package/docs/components/fields/SearchInput.md +3 -4
- package/docs/components/fields/Select.md +0 -3
- package/docs/components/fields/Slider.md +0 -1
- package/docs/components/fields/Switch.md +16 -3
- package/docs/components/fields/TagInput.md +3 -6
- package/docs/components/fields/TextArea.md +9 -8
- package/docs/components/fields/TextInput.md +39 -10
- package/docs/components/overlays/Tooltip.md +1 -1
- package/docs/tasty/ai-agents.md +1 -1
- package/docs/tasty/react-api.md +1 -1
- package/docs/tasty/styles.md +37 -3
- package/package.json +6 -4
- package/dist/components/content/Divider.d.ts +0 -7
- package/dist/components/content/Divider.js +0 -105
- package/dist/components/content/Divider.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
2
|
-
import {
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.202.0 | Cube Dev Team */
|
|
2
|
+
import { mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { Text as _Text } from "../../content/Text.js";
|
|
4
4
|
import { isTextOnly } from "../../../utils/react/isTextOnly.js";
|
|
5
5
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -12,27 +12,41 @@ import { ItemActionIcon } from "../../actions/ItemActionsWrapper.js";
|
|
|
12
12
|
import { ItemButton as _ItemButton } from "../../actions/ItemButton/ItemButton.js";
|
|
13
13
|
import { CloseIcon } from "../../../icons/CloseIcon.js";
|
|
14
14
|
import { Dialog } from "../../overlays/Dialog/Dialog.js";
|
|
15
|
+
import { buildTreeIndex, getTreeNodeText } from "../../content/Tree/tree-index.js";
|
|
15
16
|
import { allowOverlayKeysToPropagate } from "../../../utils/react/overlayKeyPropagation.js";
|
|
16
17
|
import { getValidationTheme } from "../../form/validation/resolve-validation-props.js";
|
|
17
18
|
import { getValidationIcon } from "../../form/validation/ValidationIndicator.js";
|
|
19
|
+
import { TRIGGER_TOOLTIP_WARNING } from "../../form/legacy-tooltip.js";
|
|
18
20
|
import { useFieldProps } from "../../form/Form/use-field/use-field-props.js";
|
|
19
21
|
import { wrapWithField } from "../../form/wrapper.js";
|
|
22
|
+
import { splitFieldLayout } from "../../form/field-layout.js";
|
|
23
|
+
import { deriveCheckedSets, toOrderedKeys } from "../../content/Tree/checked-keys.js";
|
|
20
24
|
import { DialogTrigger } from "../../overlays/Dialog/DialogTrigger.js";
|
|
21
25
|
import { ListBox } from "../ListBox/ListBox.js";
|
|
22
26
|
import { TriggerActions } from "../TriggerActions.js";
|
|
23
27
|
import { processSelectionArray } from "../../../utils/selection.js";
|
|
24
28
|
import { FilterListBox } from "../FilterListBox/FilterListBox.js";
|
|
25
|
-
import {
|
|
29
|
+
import { FilterTree } from "./FilterTree.js";
|
|
30
|
+
import { filterBaseProps, tasty } from "@tenphi/tasty";
|
|
26
31
|
import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
27
32
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
28
33
|
import { FocusScope, mergeProps, useLabel } from "react-aria";
|
|
29
34
|
import { Section, useListState } from "react-stately";
|
|
30
35
|
//#region src/components/fields/FilterPicker/FilterPicker.tsx
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Tree mode's summary: the topmost checked nodes, since a checked parent
|
|
38
|
+
* stands for its children. Keys the tree lacks are listed as they are.
|
|
39
|
+
*/
|
|
40
|
+
function getTreeSummaryLabels(index, checked) {
|
|
41
|
+
const labels = [];
|
|
42
|
+
for (const [key, node] of index.byKey) {
|
|
43
|
+
const parentKey = index.parentOf.get(key);
|
|
44
|
+
if (!checked.has(key) || parentKey != null && checked.has(parentKey)) continue;
|
|
45
|
+
labels.push(getTreeNodeText(node));
|
|
46
|
+
}
|
|
47
|
+
for (const key of checked) if (!index.byKey.has(key)) labels.push(key);
|
|
48
|
+
return labels;
|
|
49
|
+
}
|
|
36
50
|
const FilterPickerWrapper = tasty({
|
|
37
51
|
qa: "FilterPicker",
|
|
38
52
|
styles: {
|
|
@@ -47,20 +61,24 @@ const FilterPicker = forwardRef(function FilterPicker(inputProps, ref) {
|
|
|
47
61
|
const { t } = useI18n();
|
|
48
62
|
const props = useFieldProps(inputProps, { valuePropsMapper: ({ value, onChange }) => {
|
|
49
63
|
const fieldProps = {};
|
|
50
|
-
|
|
64
|
+
const isMultiple = inputProps.selectionMode === "multiple" || !!inputProps.treeData;
|
|
65
|
+
if (isMultiple) fieldProps.selectedKeys = value || [];
|
|
51
66
|
else fieldProps.selectedKey = value ?? null;
|
|
52
67
|
fieldProps.onSelectionChange = (key) => {
|
|
53
|
-
if (
|
|
68
|
+
if (isMultiple) {
|
|
54
69
|
if (key === "all") onChange("all");
|
|
55
70
|
else onChange(key ? Array.isArray(key) ? key : [key] : []);
|
|
56
71
|
} else onChange(Array.isArray(key) ? key[0] : key);
|
|
57
72
|
};
|
|
58
73
|
return fieldProps;
|
|
59
74
|
} });
|
|
60
|
-
let { qa, label, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, extra, id, icon, rightIcon, prefix, suffix, actions, hotkeys, triggerTooltip, triggerDescription, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, isDisabled, isLoading, message, mods: externalMods, description, descriptionPlacement, placeholder, size = "medium", styles, listBoxStyles, popoverStyles, type = "outline", theme = "default", shape, labelSuffix, shouldFocusWrap, children, shouldFlip = true, placement = "bottom start", targetRef, containerPadding = 8, selectedKey, defaultSelectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, onSelectionChange, selectionMode = "single", listStateRef, focusOnHover, showSelectAll, selectAllLabel = t("picker.all", "All"), items, header, footer, headerStyles, footerStyles, triggerStyles, allowsCustomValue, renderSummary, isCheckable, allValueProps, customValueProps, newCustomValueProps, searchPlaceholder, autoFocus, filter, emptyLabel, searchInputStyles, searchInputRef, listStyles, optionStyles, sectionStyles, headingStyles, listGap, listRef, disallowEmptySelection, shouldUseVirtualFocus, onEscape, onOptionClick, isClearable, clearLabel, isLoadingItems, searchValue, onSearchChange, sortSelectedToTop: sortSelectedToTopProp, onOpenChange, isReorderable, onReorder, form, ...otherProps } = props;
|
|
75
|
+
let { qa, label, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, extra, id, icon, rightIcon, prefix, suffix, actions, hotkeys, tooltip, triggerTooltip, triggerDescription, labelStyles, isRequired, necessityIndicator, isInvalid, isValid, isDisabled, isLoading, message, mods: externalMods, description, descriptionPlacement, placeholder, size = "medium", styles, listBoxStyles, popoverStyles, type = "outline", theme = "default", shape, labelSuffix, shouldFocusWrap, children, shouldFlip = true, placement = "bottom start", targetRef, containerPadding = 8, selectedKey, defaultSelectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, onSelectionChange, selectionMode = "single", listStateRef, focusOnHover, showSelectAll, selectAllLabel = t("picker.all", "All"), items, header, footer, headerStyles, footerStyles, triggerStyles, allowsCustomValue, renderSummary, isCheckable, allValueProps, customValueProps, newCustomValueProps, searchPlaceholder, autoFocus, filter, emptyLabel, searchInputStyles, searchInputRef, listStyles, optionStyles, sectionStyles, headingStyles, listGap, listRef, disallowEmptySelection, shouldUseVirtualFocus, onEscape, onOptionClick, isClearable, clearLabel, isLoadingItems, searchValue, onSearchChange, sortSelectedToTop: sortSelectedToTopProp, onOpenChange, isReorderable, onReorder, form, treeData, expandedKeys, defaultExpandedKeys, onExpand, ...otherProps } = props;
|
|
76
|
+
if (treeData) selectionMode = "multiple";
|
|
61
77
|
const sortSelectedToTopExplicit = sortSelectedToTopProp !== void 0;
|
|
62
78
|
const sortSelectedToTop = sortSelectedToTopProp ?? (items ? true : false);
|
|
63
|
-
|
|
79
|
+
const fieldLayout = splitFieldLayout(props);
|
|
80
|
+
styles = fieldLayout.styles;
|
|
81
|
+
useWarn(triggerTooltip !== void 0, TRIGGER_TOOLTIP_WARNING);
|
|
64
82
|
useWarn(isCheckable === false && selectionMode === "single", {
|
|
65
83
|
key: ["filterpicker-checkable-single-mode"],
|
|
66
84
|
args: ["CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior."]
|
|
@@ -133,10 +151,25 @@ const FilterPicker = forwardRef(function FilterPicker(inputProps, ref) {
|
|
|
133
151
|
effectiveSelectedKeys,
|
|
134
152
|
keyMap
|
|
135
153
|
]);
|
|
154
|
+
const treeIndex = useMemo(() => treeData ? buildTreeIndex(treeData) : null, [treeData]);
|
|
155
|
+
const treeCheckedKeys = useMemo(() => effectiveSelectedKeys === "all" ? [...treeIndex?.byKey.keys() ?? []] : (effectiveSelectedKeys ?? []).map(String), [effectiveSelectedKeys, treeIndex]);
|
|
156
|
+
const treeSelectedKeys = useMemo(() => treeData && treeIndex ? toOrderedKeys(treeIndex, deriveCheckedSets(treeData, treeIndex, treeCheckedKeys).checked) : null, [
|
|
157
|
+
treeData,
|
|
158
|
+
treeIndex,
|
|
159
|
+
treeCheckedKeys
|
|
160
|
+
]);
|
|
161
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = useState(defaultExpandedKeys ?? []);
|
|
162
|
+
const handleExpand = (keys) => {
|
|
163
|
+
if (expandedKeys === void 0) setInternalExpandedKeys(keys);
|
|
164
|
+
onExpand?.(keys);
|
|
165
|
+
};
|
|
136
166
|
const selectedLabels = useMemo(() => {
|
|
167
|
+
if (treeIndex && treeSelectedKeys) return getTreeSummaryLabels(treeIndex, new Set(treeSelectedKeys));
|
|
137
168
|
if (selectionMode === "multiple" && effectiveSelectedKeys === "all") return Array.from(labelMap.values());
|
|
138
169
|
return (selectionMode === "multiple" && effectiveSelectedKeys !== "all" ? (effectiveSelectedKeys || []).map(String) : effectiveSelectedKey != null ? [String(effectiveSelectedKey)] : []).map((k_0) => labelMap.get(k_0) ?? k_0);
|
|
139
170
|
}, [
|
|
171
|
+
treeIndex,
|
|
172
|
+
treeSelectedKeys,
|
|
140
173
|
selectionMode,
|
|
141
174
|
effectiveSelectedKey,
|
|
142
175
|
effectiveSelectedKeys,
|
|
@@ -258,7 +291,7 @@ const FilterPicker = forwardRef(function FilterPicker(inputProps, ref) {
|
|
|
258
291
|
});
|
|
259
292
|
return renderSummary({
|
|
260
293
|
selectedLabels,
|
|
261
|
-
selectedKeys: effectiveSelectedKeys,
|
|
294
|
+
selectedKeys: treeSelectedKeys ?? effectiveSelectedKeys,
|
|
262
295
|
selectionMode: "multiple"
|
|
263
296
|
});
|
|
264
297
|
} else if (renderSummary === false) return null;
|
|
@@ -272,6 +305,7 @@ const FilterPicker = forwardRef(function FilterPicker(inputProps, ref) {
|
|
|
272
305
|
selectedLabels,
|
|
273
306
|
effectiveSelectedKey,
|
|
274
307
|
effectiveSelectedKeys,
|
|
308
|
+
treeSelectedKeys,
|
|
275
309
|
hasSelection,
|
|
276
310
|
placeholder,
|
|
277
311
|
selectAllLabel
|
|
@@ -320,7 +354,7 @@ const FilterPicker = forwardRef(function FilterPicker(inputProps, ref) {
|
|
|
320
354
|
prefix,
|
|
321
355
|
suffix,
|
|
322
356
|
hotkeys,
|
|
323
|
-
tooltip: triggerTooltip,
|
|
357
|
+
tooltip: tooltip ?? triggerTooltip,
|
|
324
358
|
description: triggerDescription,
|
|
325
359
|
descriptionPlacement,
|
|
326
360
|
styles: triggerStyles,
|
|
@@ -383,7 +417,32 @@ const FilterPicker = forwardRef(function FilterPicker(inputProps, ref) {
|
|
|
383
417
|
tokens: triggerWidthRef.current ? { "$overlay-min-width": `${triggerWidthRef.current}px` } : void 0,
|
|
384
418
|
children: /* @__PURE__ */ jsx(FocusScope, {
|
|
385
419
|
restoreFocus: true,
|
|
386
|
-
children: /* @__PURE__ */ jsx(
|
|
420
|
+
children: treeData ? /* @__PURE__ */ jsx(FilterTree, {
|
|
421
|
+
autoFocus: true,
|
|
422
|
+
treeData,
|
|
423
|
+
checkedKeys: treeCheckedKeys,
|
|
424
|
+
expandedKeys: expandedKeys ?? internalExpandedKeys,
|
|
425
|
+
"aria-label": pickerAriaLabel,
|
|
426
|
+
searchPlaceholder,
|
|
427
|
+
searchValue,
|
|
428
|
+
searchInputStyles,
|
|
429
|
+
searchInputRef,
|
|
430
|
+
filter,
|
|
431
|
+
emptyLabel,
|
|
432
|
+
header,
|
|
433
|
+
headerStyles,
|
|
434
|
+
footer,
|
|
435
|
+
footerStyles,
|
|
436
|
+
size: size === "small" ? "medium" : size,
|
|
437
|
+
isDisabled,
|
|
438
|
+
isLoadingItems,
|
|
439
|
+
shouldFocusWrap,
|
|
440
|
+
onExpand: handleExpand,
|
|
441
|
+
onSearchChange,
|
|
442
|
+
onCheckedKeysChange: handleSelectionChange,
|
|
443
|
+
onEscape: handleEscape,
|
|
444
|
+
onCommit: handleEscape
|
|
445
|
+
}) : /* @__PURE__ */ jsx(FilterListBox, {
|
|
387
446
|
isBare: true,
|
|
388
447
|
autoFocus: true,
|
|
389
448
|
items: items ? finalItems : void 0,
|
|
@@ -442,6 +501,8 @@ const FilterPicker = forwardRef(function FilterPicker(inputProps, ref) {
|
|
|
442
501
|
});
|
|
443
502
|
return wrapWithField(filterPickerField, {
|
|
444
503
|
...props,
|
|
504
|
+
...fieldLayout.field,
|
|
505
|
+
tooltip: void 0,
|
|
445
506
|
labelProps: mergeProps(labelProps, props.labelProps)
|
|
446
507
|
});
|
|
447
508
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterPicker.js","names":["CollectionChildren","FocusableRefValue","BASE_STYLES","BasePropsWithoutChildren","BaseStyleProps","COLOR_STYLES","ColorStyleProps","filterBaseProps","OUTER_STYLES","OuterStyleProps","Styles","tasty","ForwardedRef","forwardRef","ReactElement","ReactNode","RefObject","useEffect","useMemo","useRef","useState","FocusScope","Key","mergeProps","Placement","useLabel","Section","BaseSection","ListState","useListState","useEvent","useWarn","useI18n","CloseIcon","DirectionIcon","LoadingIcon","isTextOnly","allowOverlayKeysToPropagate","processSelectionArray","extractStyles","mergeStyleLayers","CubeItemButtonProps","ItemAction","ItemButton","CubeItemProps","Text","getValidationIcon","getValidationTheme","useFieldProps","wrapWithField","Dialog","DialogTrigger","CubeFilterListBoxProps","FilterListBox","ListBox","TriggerActions","TriggerIcon","KeyboardEvent","RAKeyboardEvent","FieldBaseProps","ItemWithKey","key","id","textValue","children","CubeFilterPickerProps","Omit","T","Pick","placeholder","size","listBoxStyles","popoverStyles","triggerStyles","isCheckable","shouldFlip","placement","targetRef","HTMLElement","containerPadding","triggerTooltip","triggerDescription","renderSummary","args","selectedLabels","selectedKeys","selectedLabel","selectedKey","selectionMode","listStateRef","mods","Record","isClearable","clearLabel","onClear","actions","isLoadingItems","sortSelectedToTop","onOpenChange","isOpen","PROP_STYLES","FilterPickerWrapper","qa","styles","display","flow","gridRows","placeContent","placeItems","FilterPicker","inputProps","ref","t","props","valuePropsMapper","value","onChange","fieldProps","onSelectionChange","Array","isArray","label","ariaLabel","ariaDescribedBy","extra","icon","rightIcon","prefix","suffix","hotkeys","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","isDisabled","isLoading","message","externalMods","description","descriptionPlacement","type","theme","shape","labelSuffix","shouldFocusWrap","defaultSelectedKey","defaultSelectedKeys","disabledKeys","focusOnHover","showSelectAll","selectAllLabel","items","header","footer","headerStyles","footerStyles","allowsCustomValue","allValueProps","customValueProps","newCustomValueProps","searchPlaceholder","autoFocus","filter","emptyLabel","searchInputStyles","searchInputRef","listStyles","optionStyles","sectionStyles","headingStyles","listGap","listRef","disallowEmptySelection","shouldUseVirtualFocus","onEscape","onOptionClick","searchValue","onSearchChange","sortSelectedToTopProp","isReorderable","onReorder","form","otherProps","sortSelectedToTopExplicit","undefined","internalSelectedKey","setInternalSelectedKey","internalSelectedKeys","setInternalSelectedKeys","isPopoverOpen","setIsPopoverOpen","cachedItemsOrder","triggerRef","HTMLButtonElement","labelProps","triggerLabelProps","labelElementType","pickerAriaLabel","String","trim","triggerWidthRef","current","isControlledSingle","isControlledMultiple","effectiveSelectedKey","effectiveSelectedKeys","localCollectionState","labelMap","keyMap","lm","Map","km","traverse","nodes","Iterable","node","strKey","set","childNodes","collection","mappedSelectedKey","get","mappedSelectedKeys","const","map","k","from","values","selectedKeyStrs","hasSelection","length","latestSelectionRef","single","multiple","selectionsWhenClosed","handleOpenChange","UNSAFE_getDOMNode","offsetWidth","keyboardProps","onKeyDown","e","preventDefault","clearValue","focus","finalItems","selectedSet","Set","addSelected","add","forEach","getItemKey","obj","item","sortArray","arr","selectedArr","unselectedArr","sortedChildren","push","has","itemsArray","sorted","triggerContent","join","showClearButton","isReadOnly","validationIcon","paintedTheme","hasCustomRightIcon","triggerRightIcon","hasTriggerActions","triggerActions","pressed","triggerElement","handleSelectionChange","selection","normalized","handleEscape","handleOptionClick","filterPickerField","eventProps","width","popover","Item","Action","Object","defineProperty","enumerable","configurable","Text","TriggerIcon","ItemButton","BaseSection"],"sources":["../../../../src/components/fields/FilterPicker/FilterPicker.tsx"],"sourcesContent":["import { CollectionChildren, FocusableRefValue } from '@react-types/shared';\nimport {\n BASE_STYLES,\n BasePropsWithoutChildren,\n BaseStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n filterBaseProps,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FocusScope, Key, mergeProps, Placement, useLabel } from 'react-aria';\nimport { Section as BaseSection, ListState, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { useWarn } from '../../../_internal/hooks/use-warn';\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { isTextOnly } from '../../../utils/react/isTextOnly';\nimport { allowOverlayKeysToPropagate } from '../../../utils/react/overlayKeyPropagation';\nimport { processSelectionArray } from '../../../utils/selection';\nimport { extractStyles, mergeStyleLayers } from '../../../utils/styles';\nimport { CubeItemButtonProps, ItemAction, ItemButton } from '../../actions';\nimport { CubeItemProps } from '../../content/Item';\nimport { Text } from '../../content/Text';\nimport {\n getValidationIcon,\n getValidationTheme,\n useFieldProps,\n wrapWithField,\n} from '../../form';\nimport { Dialog } from '../../overlays/Dialog/Dialog';\nimport { DialogTrigger } from '../../overlays/Dialog/DialogTrigger';\nimport {\n CubeFilterListBoxProps,\n FilterListBox,\n} from '../FilterListBox/FilterListBox';\nimport { ListBox } from '../ListBox';\nimport { TriggerActions, TriggerIcon } from '../TriggerActions';\n\nimport type { KeyboardEvent as RAKeyboardEvent } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\n\ninterface ItemWithKey {\n key?: string | number;\n id?: string | number;\n textValue?: string;\n children?: ItemWithKey[];\n [key: string]: unknown;\n}\n\nexport interface CubeFilterPickerProps<T>\n extends\n Omit<CubeFilterListBoxProps<T>, 'size' | 'shape'>,\n // `tooltip` is the trigger's, and on a picker the trigger's is spelled\n // `triggerTooltip`; the label's info badge is `labelTooltip`.\n Omit<CubeItemProps, 'children' | 'size' | 'tooltip'>,\n BasePropsWithoutChildren,\n BaseStyleProps,\n OuterStyleProps,\n ColorStyleProps,\n FieldBaseProps<\n string | number | readonly (string | number)[] | null | undefined\n >,\n Pick<\n CubeItemButtonProps,\n | 'type'\n | 'theme'\n | 'icon'\n | 'rightIcon'\n | 'prefix'\n | 'suffix'\n | 'hotkeys'\n | 'shape'\n > {\n /** Accessible name for the picker trigger when there is no visible label. */\n 'aria-label'?: string;\n /** Ids of elements that also describe the trigger, beside the field's own description and message. */\n 'aria-describedby'?: string;\n /** Placeholder text when no selection is made */\n placeholder?: string;\n /** Size of the picker component */\n size?: 'small' | 'medium' | 'large';\n /** Custom styles for the list box popover */\n listBoxStyles?: Styles;\n /** Custom styles for the popover container */\n popoverStyles?: Styles;\n /** Custom styles for the trigger button */\n triggerStyles?: Styles;\n /** Whether to show checkboxes for multiple selection mode */\n isCheckable?: boolean;\n /** Whether to flip the popover placement */\n shouldFlip?: boolean;\n /**\n * Placement of the popover relative to the trigger.\n * Accepts React Aria's `Placement` strings (e.g. `'bottom start'`,\n * `'top start'`, `'right top'`, `'left top'`).\n * @default 'bottom start'\n */\n placement?: Placement;\n /**\n * The ref of the element the popover should visually attach itself to.\n * Defaults to the trigger button.\n *\n * Forwarded to `DialogTrigger`, so the anchor also becomes what outside-click\n * dismissal treats as the trigger. The popover's `minWidth` stays tied to the\n * trigger button, not to this element.\n */\n targetRef?: RefObject<HTMLElement | null>;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /** Tooltip for the trigger button (separate from `labelTooltip`) */\n triggerTooltip?: CubeItemProps['tooltip'];\n /** Description for the trigger button (separate from field description) */\n triggerDescription?: CubeItemProps['description'];\n\n /**\n * Custom renderer for the summary shown inside the trigger when there is a selection.\n *\n * For `selectionMode=\"multiple\"` the function receives:\n * - `selectedLabels`: array of labels of the selected items.\n * - `selectedKeys`: array of keys of the selected items or \"all\".\n *\n * For `selectionMode=\"single\"` the function receives:\n * - `selectedLabel`: label of the selected item.\n * - `selectedKey`: key of the selected item.\n *\n * The function should return a `ReactNode` that will be rendered inside the trigger.\n * Set to `false` to hide the summary text completely.\n */\n renderSummary?:\n | ((args: {\n selectedLabels?: string[];\n selectedKeys?: 'all' | (string | number)[];\n selectedLabel?: string;\n selectedKey?: string | number | null;\n selectionMode?: 'single' | 'multiple';\n }) => ReactNode)\n | false;\n\n /** Ref to access internal ListBox state (from FilterListBox) */\n listStateRef?: RefObject<ListState<T>>;\n /** Additional modifiers for styling the FilterPicker */\n mods?: Record<string, boolean>;\n /** Whether the filter picker is clearable using a clear button in the rightIcon slot */\n isClearable?: boolean;\n /** Accessible name for the built-in clear button. Defaults to a localized \"Clear value\". */\n clearLabel?: string;\n /** Callback called when the clear button is pressed */\n onClear?: () => void;\n /**\n * Custom actions rendered inside the trigger, to the left of the built-in\n * clear button and dropdown caret. Use `FilterPicker.Action` so they match the\n * trigger's size and theme.\n *\n * Pressing one runs its handler without opening or closing the popover —\n * including while the popover is open. Actions follow the trigger's disabled\n * state but NOT `isReadOnly`, since a read-only field can still host an\n * action that does not change the value; pass `isDisabled` yourself for one\n * that does.\n */\n actions?: ReactNode;\n /**\n * Whether items are currently loading. Shows a loading spinner in the search\n * input suffix inside the popover. Unlike `isLoading`, this does NOT disable\n * the trigger.\n */\n isLoadingItems?: boolean;\n /**\n * Sort selected items to the top when the popover opens.\n * Only works when using the `items` prop (data-driven mode).\n * Ignored when using JSX children.\n * @default true when items are provided, false when using JSX children\n */\n sortSelectedToTop?: boolean;\n /** Callback called when the popover open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nconst PROP_STYLES = [...BASE_STYLES, ...OUTER_STYLES, ...COLOR_STYLES];\n\nconst FilterPickerWrapper = tasty({\n qa: 'FilterPicker',\n styles: {\n display: 'inline-grid',\n flow: 'column',\n gridRows: '1sf',\n placeContent: 'stretch',\n placeItems: 'stretch',\n },\n});\n\nexport const FilterPicker = forwardRef(function FilterPicker<T extends object>(\n inputProps: CubeFilterPickerProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n const props = useFieldProps(inputProps, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: Record<string, unknown> = {};\n\n if (inputProps.selectionMode === 'multiple') {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: Key | null | 'all' | Key[]) => {\n if (inputProps.selectionMode === 'multiple') {\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 let {\n qa,\n label,\n 'aria-label': ariaLabel,\n // The field's description and message describe the trigger, which is the\n // control, not the wrapper the rest of these props land on.\n 'aria-describedby': ariaDescribedBy,\n extra,\n id,\n icon,\n rightIcon,\n prefix,\n suffix,\n actions,\n hotkeys,\n triggerTooltip,\n triggerDescription,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n isLoading,\n message,\n mods: externalMods,\n description,\n descriptionPlacement,\n placeholder,\n size = 'medium',\n styles,\n listBoxStyles,\n popoverStyles,\n type = 'outline',\n theme = 'default',\n shape,\n labelSuffix,\n shouldFocusWrap,\n children,\n shouldFlip = true,\n placement = 'bottom start',\n targetRef,\n containerPadding = 8,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n selectionMode = 'single',\n listStateRef,\n focusOnHover,\n showSelectAll,\n selectAllLabel = t('picker.all', 'All'),\n items,\n header,\n footer,\n headerStyles,\n footerStyles,\n triggerStyles,\n allowsCustomValue,\n renderSummary,\n isCheckable,\n allValueProps,\n customValueProps,\n newCustomValueProps,\n searchPlaceholder,\n autoFocus,\n filter,\n emptyLabel,\n searchInputStyles,\n searchInputRef,\n listStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n listRef,\n disallowEmptySelection,\n shouldUseVirtualFocus,\n onEscape,\n onOptionClick,\n isClearable,\n clearLabel,\n isLoadingItems,\n searchValue,\n onSearchChange,\n sortSelectedToTop: sortSelectedToTopProp,\n onOpenChange,\n isReorderable,\n onReorder,\n form,\n ...otherProps\n } = props;\n\n const sortSelectedToTopExplicit = sortSelectedToTopProp !== undefined;\n const sortSelectedToTop = sortSelectedToTopProp ?? (items ? true : false);\n\n styles = extractStyles(otherProps, PROP_STYLES, styles);\n\n useWarn(isCheckable === false && selectionMode === 'single', {\n key: ['filterpicker-checkable-single-mode'],\n args: [\n 'CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior.',\n ],\n });\n\n useWarn(sortSelectedToTopExplicit && sortSelectedToTop && !items, {\n key: ['filterpicker-sort-selected-to-top-children'],\n args: [\n 'FilterPicker: sortSelectedToTop only works with the items prop. Sorting will be skipped when using JSX children.',\n ],\n });\n\n // Internal selection state (uncontrolled scenario)\n const [internalSelectedKey, setInternalSelectedKey] = useState<Key | null>(\n defaultSelectedKey ?? null,\n );\n const [internalSelectedKeys, setInternalSelectedKeys] = useState<\n 'all' | Key[]\n >(defaultSelectedKeys ?? []);\n\n // Popover state — used as controlled prop for DialogTrigger\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const cachedItemsOrder = useRef<T[] | null>(null);\n const triggerRef = useRef<FocusableRefValue<HTMLButtonElement>>(null);\n const { labelProps, fieldProps: triggerLabelProps } = useLabel({\n id: props.id,\n label,\n labelElementType: 'span',\n 'aria-label':\n ariaLabel ?? (!label ? t('picker.pickerAriaLabel', 'Picker') : undefined),\n 'aria-labelledby': props['aria-labelledby'],\n });\n const pickerAriaLabel =\n `${ariaLabel ?? (isTextOnly(label) ? String(label ?? '') : '')} ${t('picker.pickerAriaLabel', 'Picker')}`.trim();\n\n // Measured lazily on popover open instead of on every render\n const triggerWidthRef = useRef<number | undefined>(undefined);\n\n useEffect(() => {\n cachedItemsOrder.current = null;\n }, [items]);\n\n const isControlledSingle = selectedKey !== undefined;\n const isControlledMultiple = selectedKeys !== undefined;\n\n const effectiveSelectedKey = isControlledSingle\n ? selectedKey\n : internalSelectedKey;\n const effectiveSelectedKeys = isControlledMultiple\n ? selectedKeys\n : internalSelectedKeys;\n\n // Collection for label extraction (shared with FilterListBox via _internalCollection)\n const localCollectionState = useListState({\n children: children as any,\n items: items as any,\n selectionMode: 'none' as any,\n });\n\n // Build Maps for O(1) label and key lookups from the collection\n const { labelMap, keyMap } = useMemo(() => {\n const lm = new Map<string, string>();\n const km = new Map<string, Key>();\n\n const traverse = (nodes: Iterable<any>) => {\n for (const node of nodes) {\n if (node.type === 'item') {\n const strKey = String(node.key);\n lm.set(strKey, node.textValue || strKey);\n km.set(strKey, node.key);\n } else if (node.childNodes) {\n traverse(node.childNodes);\n }\n }\n };\n\n traverse(localCollectionState.collection);\n return { labelMap: lm, keyMap: km };\n }, [localCollectionState.collection]);\n\n // O(1) key mapping via Map (replaces O(n) iteration per key)\n const mappedSelectedKey = useMemo(() => {\n if (selectionMode !== 'single' || effectiveSelectedKey == null) return null;\n const strKey = String(effectiveSelectedKey);\n return keyMap.get(strKey) ?? effectiveSelectedKey;\n }, [selectionMode, effectiveSelectedKey, keyMap]);\n\n const mappedSelectedKeys = useMemo(() => {\n if (selectionMode !== 'multiple') return undefined;\n if (effectiveSelectedKeys === 'all') return 'all' as const;\n if (Array.isArray(effectiveSelectedKeys)) {\n return effectiveSelectedKeys.map((k) => {\n const strKey = String(k);\n return keyMap.get(strKey) ?? k;\n });\n }\n return effectiveSelectedKeys;\n }, [selectionMode, effectiveSelectedKeys, keyMap]);\n\n // Memoized label extraction using the labelMap\n const selectedLabels = useMemo(() => {\n if (selectionMode === 'multiple' && effectiveSelectedKeys === 'all') {\n return Array.from(labelMap.values());\n }\n\n const selectedKeyStrs =\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : effectiveSelectedKey != null\n ? [String(effectiveSelectedKey)]\n : [];\n\n return selectedKeyStrs.map((k) => labelMap.get(k) ?? k);\n }, [selectionMode, effectiveSelectedKey, effectiveSelectedKeys, labelMap]);\n\n const hasSelection = selectedLabels.length > 0;\n\n // Refs for tracking selection state synchronously\n const latestSelectionRef = useRef<{\n single: string | null;\n multiple: 'all' | string[];\n }>({\n single: effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n effectiveSelectedKeys === 'all'\n ? 'all'\n : (effectiveSelectedKeys ?? []).map(String),\n });\n\n useEffect(() => {\n latestSelectionRef.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n effectiveSelectedKeys === 'all'\n ? 'all'\n : (effectiveSelectedKeys ?? []).map(String),\n };\n }, [effectiveSelectedKey, effectiveSelectedKeys]);\n\n const selectionsWhenClosed = useRef<{\n single: string | null;\n multiple: 'all' | string[];\n }>({ single: null, multiple: [] });\n\n useEffect(() => {\n if (!isPopoverOpen) {\n selectionsWhenClosed.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n effectiveSelectedKeys === 'all'\n ? 'all'\n : (effectiveSelectedKeys ?? []).map(String),\n };\n }\n }, [effectiveSelectedKey, effectiveSelectedKeys, isPopoverOpen]);\n\n // ---------------------------------------------------------------------------\n // Popover lifecycle — all effects moved out of the inline renderTrigger\n // function so they have a stable component identity and don't tear\n // down/setup on every parent re-render.\n // DialogTrigger is controlled via isOpen/onOpenChange.\n // ---------------------------------------------------------------------------\n\n const handleOpenChange = useEvent((isOpen: boolean) => {\n if (isOpen === isPopoverOpen) return;\n\n if (isOpen) {\n triggerWidthRef.current =\n triggerRef?.current?.UNSAFE_getDOMNode()?.offsetWidth;\n }\n setIsPopoverOpen(isOpen);\n if (!isOpen) {\n selectionsWhenClosed.current = { ...latestSelectionRef.current };\n cachedItemsOrder.current = null;\n onSearchChange?.('');\n }\n onOpenChange?.(isOpen);\n });\n\n // Popover sync is handled by the inner `DialogTrigger` (type=\"popover\").\n\n // Keyboard handler for arrow keys to open popover\n // Deliberately NOT `useKeyboard`. `ItemButton` already runs whatever\n // `onKeyDown` it is given through `useFocusable`'s own `useKeyboard`, and a\n // second wrapper here would leave `continuePropagation()` releasing only the\n // inner one while the outer still stopped the event — `Escape` reached the\n // trigger and died there (CUB-4839). Handed over plain, this IS the outer\n // wrapper's handler, so the opt-out applies to the event that travels.\n const keyboardProps = {\n onKeyDown: (e: RAKeyboardEvent) => {\n allowOverlayKeysToPropagate(e);\n\n if ((e.key === 'ArrowUp' || e.key === 'ArrowDown') && !isPopoverOpen) {\n e.preventDefault();\n handleOpenChange(true);\n\n return;\n }\n },\n };\n\n // Clear handler\n const clearValue = useEvent(() => {\n if (selectionMode === 'multiple') {\n if (!isControlledMultiple) {\n setInternalSelectedKeys([]);\n }\n onSelectionChange?.([]);\n } else {\n if (!isControlledSingle) {\n setInternalSelectedKey(null);\n }\n onSelectionChange?.(null);\n }\n\n handleOpenChange(false);\n triggerRef?.current?.focus?.();\n props.onClear?.();\n\n return false;\n });\n\n // ---------------------------------------------------------------------------\n // Sorting\n // ---------------------------------------------------------------------------\n\n // Ref values (selectionsWhenClosed.current) are read synchronously inside\n // the memo body; isPopoverOpen changing triggers recomputation at the right\n // time (the ref is updated before the next render).\n const finalItems = useMemo(() => {\n if (!items) return items;\n if (!sortSelectedToTop) return items;\n if (!isPopoverOpen) return items;\n if (cachedItemsOrder.current) return cachedItemsOrder.current;\n\n const selectedSet = new Set<string>();\n\n const addSelected = (key: Key) => {\n if (key != null) selectedSet.add(String(key));\n };\n\n if (selectionMode === 'multiple') {\n if (selectionsWhenClosed.current.multiple === 'all') {\n return items;\n }\n (selectionsWhenClosed.current.multiple as string[]).forEach(addSelected);\n } else {\n if (selectionsWhenClosed.current.single != null) {\n addSelected(selectionsWhenClosed.current.single);\n }\n }\n\n if (selectedSet.size === 0) {\n return items;\n }\n\n const getItemKey = (obj: unknown): string | undefined => {\n if (obj == null || typeof obj !== 'object') return undefined;\n\n const item = obj as ItemWithKey;\n if (item.key != null) return String(item.key);\n if (item.id != null) return String(item.id);\n return undefined;\n };\n\n const sortArray = (arr: unknown[]): unknown[] => {\n const selectedArr: unknown[] = [];\n const unselectedArr: unknown[] = [];\n\n arr.forEach((obj) => {\n const item = obj as ItemWithKey;\n if (obj && Array.isArray(item.children)) {\n const sortedChildren = sortArray(item.children);\n unselectedArr.push({ ...item, children: sortedChildren });\n } else {\n const key = getItemKey(obj);\n if (key && selectedSet.has(key)) {\n selectedArr.push(obj);\n } else {\n unselectedArr.push(obj);\n }\n }\n });\n\n return [...selectedArr, ...unselectedArr];\n };\n\n const itemsArray = Array.isArray(items)\n ? items\n : Array.from(items as Iterable<unknown>);\n const sorted = sortArray(itemsArray) as T[];\n\n cachedItemsOrder.current = sorted;\n\n return sorted;\n }, [items, sortSelectedToTop, selectionMode, isPopoverOpen]);\n\n // ---------------------------------------------------------------------------\n // Trigger content\n // ---------------------------------------------------------------------------\n\n const triggerContent = useMemo((): ReactNode => {\n if (typeof renderSummary === 'function') {\n if (selectionMode === 'single') {\n return renderSummary({\n selectedLabel: selectedLabels[0],\n selectedKey: effectiveSelectedKey ?? null,\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'single',\n });\n }\n\n return renderSummary({\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'multiple',\n });\n } else if (renderSummary === false) {\n return null;\n }\n\n if (!hasSelection) {\n return <Text.Placeholder>{placeholder}</Text.Placeholder>;\n } else if (selectionMode === 'single') {\n return selectedLabels[0] || null;\n } else if (effectiveSelectedKeys === 'all') {\n return selectAllLabel;\n } else {\n return selectedLabels.join(', ') || null;\n }\n }, [\n renderSummary,\n selectionMode,\n selectedLabels,\n effectiveSelectedKey,\n effectiveSelectedKeys,\n hasSelection,\n placeholder,\n selectAllLabel,\n ]);\n\n const showClearButton =\n isClearable && hasSelection && !isDisabled && !props.isReadOnly;\n\n const validationIcon = getValidationIcon({ isInvalid, isValid });\n\n // The same expression the trigger is painted with, not the raw `theme` — see\n // `Picker` for why validation has to be applied here too.\n const paintedTheme = getValidationTheme(theme, { isInvalid, isValid });\n //\n // It reaches the trailing actions through `ItemButton`'s wrapper, which is\n // what provides `ItemActionContext` for a run rendered outside the button —\n // so passing it as the trigger's `theme` is all that is needed.\n\n if (validationIcon) {\n suffix = (\n <>\n {suffix}\n {validationIcon}\n </>\n );\n }\n\n // A caller's `rightIcon` keeps the `rightIcon` slot — see `Picker` for why.\n const hasCustomRightIcon = rightIcon !== undefined;\n const triggerRightIcon = hasCustomRightIcon ? (\n isLoading ? (\n <LoadingIcon />\n ) : (\n rightIcon\n )\n ) : undefined;\n\n // With a caller's own `rightIcon` the built-in control moves into that slot,\n // leaving the run with whatever the caller passed — possibly nothing. `null`\n // rather than nothing at all: the run stays in the markup, so the trigger does\n // not restructure if actions arrive later, but the row stops counting it as\n // end content. That is what keeps an icon-only trigger with `rightIcon={null}`\n // square, as it was before the run existed.\n const hasTriggerActions = !hasCustomRightIcon || !!actions;\n\n // Everything trailing that is NOT the caller's own icon goes into the actions\n // run — a sibling of the `<button>`, so the clear button is no longer nested\n // inside one. See `TriggerActions`.\n const triggerActions = (\n <TriggerActions\n actions={actions}\n builtIn={\n hasCustomRightIcon ? null : isLoading ? (\n <TriggerIcon>\n <LoadingIcon />\n </TriggerIcon>\n ) : showClearButton ? (\n <ItemAction\n icon={<CloseIcon />}\n size={size}\n qa=\"FilterPickerClearButton\"\n // See `Select`: `ItemAction` names itself from `aria-label` or a\n // string `tooltip`, and warns for neither.\n aria-label={\n clearLabel ?? t('filterPicker.clearValue', 'Clear value')\n }\n // No explicit `type`/`theme` — see `Picker`: the default `current`\n // type inherits the trigger's text color, which already carries\n // validation state.\n mods={{ pressed: false }}\n onPress={clearValue}\n />\n ) : (\n <TriggerIcon>\n <DirectionIcon to={isPopoverOpen ? 'top' : 'bottom'} />\n </TriggerIcon>\n )\n }\n />\n );\n\n // Trigger element — plain JSX with no hooks.\n // The element type (ItemButton) is stable so React can reconcile efficiently.\n const triggerElement = (\n <ItemButton\n ref={triggerRef as any}\n data-popover-trigger\n qa={qa || 'FilterPicker'}\n type={type}\n theme={paintedTheme}\n size={size}\n shape={shape}\n isDisabled={isDisabled || isLoading}\n data-input-type=\"filterpicker\"\n mods={{\n placeholder: !hasSelection,\n ...externalMods,\n }}\n icon={icon}\n rightIcon={triggerRightIcon}\n actions={hasTriggerActions ? triggerActions : null}\n prefix={prefix}\n suffix={suffix}\n hotkeys={hotkeys}\n tooltip={triggerTooltip}\n description={triggerDescription}\n descriptionPlacement={descriptionPlacement}\n styles={triggerStyles}\n {...keyboardProps}\n {...mergeProps(triggerLabelProps, { id })}\n aria-describedby={ariaDescribedBy}\n >\n {triggerContent}\n </ItemButton>\n );\n\n // ---------------------------------------------------------------------------\n // Selection change handler\n // ---------------------------------------------------------------------------\n\n const handleSelectionChange = useEvent((selection: any) => {\n if (selectionMode === 'single') {\n // With `disallowEmptySelection`, re-selecting the current item emits a\n // duplicate event (see `allowDuplicateSelectionEvents` below). Close the\n // popover but don't propagate the unchanged selection.\n if (\n disallowEmptySelection &&\n selection != null &&\n effectiveSelectedKey != null &&\n String(selection) === String(effectiveSelectedKey)\n ) {\n handleOpenChange(false);\n return;\n }\n\n if (!isControlledSingle) {\n setInternalSelectedKey(selection as Key | null);\n }\n } else {\n if (!isControlledMultiple) {\n let normalized: 'all' | Key[] = selection;\n\n if (selection === 'all') {\n normalized = 'all';\n } else if (Array.isArray(selection)) {\n normalized = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n normalized = processSelectionArray(selection as Set<Key>);\n }\n\n setInternalSelectedKeys(normalized);\n }\n }\n\n // Update latest selection ref synchronously\n if (selectionMode === 'single') {\n latestSelectionRef.current.single =\n selection != null ? String(selection) : null;\n } else {\n if (selection === 'all') {\n latestSelectionRef.current.multiple = 'all';\n } else if (Array.isArray(selection)) {\n latestSelectionRef.current.multiple = Array.from(\n new Set(processSelectionArray(selection)),\n );\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n latestSelectionRef.current.multiple = Array.from(\n new Set(processSelectionArray(selection as Set<Key>)),\n );\n } else {\n latestSelectionRef.current.multiple =\n selection === 'all'\n ? 'all'\n : Array.isArray(selection)\n ? selection.map(String)\n : [];\n }\n }\n\n onSelectionChange?.(selection);\n\n if (selectionMode === 'single') {\n handleOpenChange(false);\n }\n });\n\n // Stable callbacks for popover content (avoid inline closures that change every render)\n const handleEscape = useEvent(() => {\n handleOpenChange(false);\n });\n\n const handleOptionClick = useEvent((key: Key) => {\n if ((selectionMode === 'multiple' && isCheckable) || key === '__ALL__') {\n handleOpenChange(false);\n }\n });\n\n const filterPickerField = (\n <FilterPickerWrapper\n ref={ref}\n qa=\"FilterPickerWrapper\"\n styles={styles}\n {...filterBaseProps(otherProps, { eventProps: true })}\n >\n <DialogTrigger\n type=\"popover\"\n placement={placement}\n targetRef={targetRef}\n isOpen={isPopoverOpen}\n containerPadding={containerPadding}\n shouldFlip={shouldFlip}\n onOpenChange={handleOpenChange}\n >\n {triggerElement}\n {() => (\n <Dialog\n qa=\"FilterPickerOverlay\"\n aria-label={pickerAriaLabel}\n isDismissable={false}\n display=\"grid\"\n styles={mergeStyleLayers(\n {\n gridRows: '1sf',\n width: 'max($overlay-min-width, 30x) max-content 50vw',\n '$overlay-min-width': '30x',\n },\n popoverStyles,\n )}\n tokens={\n triggerWidthRef.current\n ? { '$overlay-min-width': `${triggerWidthRef.current}px` }\n : undefined\n }\n >\n <FocusScope restoreFocus>\n <FilterListBox\n isBare\n autoFocus\n items={items ? (finalItems as typeof props.items) : undefined}\n aria-label={pickerAriaLabel}\n _internalCollection={localCollectionState.collection}\n selectedKey={\n selectionMode === 'single' ? mappedSelectedKey : undefined\n }\n selectedKeys={\n selectionMode === 'multiple' ? mappedSelectedKeys : undefined\n }\n searchPlaceholder={searchPlaceholder}\n filter={filter}\n searchValue={searchValue}\n listStyles={listStyles}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n listRef={listRef}\n disallowEmptySelection={disallowEmptySelection}\n allowDuplicateSelectionEvents={\n selectionMode === 'single' && !!disallowEmptySelection\n }\n emptyLabel={emptyLabel}\n searchInputStyles={searchInputStyles}\n searchInputRef={searchInputRef}\n disabledKeys={disabledKeys}\n focusOnHover={focusOnHover}\n shouldFocusWrap={shouldFocusWrap}\n allowsCustomValue={allowsCustomValue}\n selectionMode={selectionMode}\n isInvalid={isInvalid}\n isValid={isValid}\n isDisabled={isDisabled}\n isLoading={isLoading}\n isLoadingItems={isLoadingItems}\n stateRef={listStateRef}\n isCheckable={isCheckable}\n mods={{\n popover: true,\n }}\n size={size === 'small' ? 'medium' : size}\n showSelectAll={showSelectAll}\n selectAllLabel={selectAllLabel}\n header={header}\n footer={footer}\n headerStyles={headerStyles}\n footerStyles={footerStyles}\n allValueProps={allValueProps}\n customValueProps={customValueProps}\n newCustomValueProps={newCustomValueProps}\n isReorderable={isReorderable}\n onSearchChange={onSearchChange}\n onReorder={onReorder}\n onEscape={handleEscape}\n onOptionClick={handleOptionClick}\n onSelectionChange={handleSelectionChange}\n >\n {\n (children\n ? (children as CollectionChildren<T>)\n : undefined) as CollectionChildren<T>\n }\n </FilterListBox>\n </FocusScope>\n </Dialog>\n )}\n </DialogTrigger>\n </FilterPickerWrapper>\n );\n\n return wrapWithField<Omit<CubeFilterPickerProps<T>, 'children'>>(\n filterPickerField,\n { ...props, labelProps: mergeProps(labelProps, props.labelProps) },\n );\n}) as unknown as (<T>(\n props: CubeFilterPickerProps<T> & { ref?: ForwardedRef<HTMLElement> },\n) => ReactElement) & {\n Item: typeof ListBox.Item;\n Section: typeof BaseSection;\n Action: typeof ItemAction;\n};\n\nFilterPicker.Item = ListBox.Item;\n\nFilterPicker.Section = BaseSection;\n\nFilterPicker.Action = ItemAction;\n\nObject.defineProperty(FilterPicker, 'cubeInputType', {\n value: 'FilterPicker',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkMA,MAAMoG,cAAc;CAAC,GAAGlG;CAAa,GAAGM;CAAc,GAAGH;AAAY;AAErE,MAAMgG,sBAAsB1F,MAAM;CAChC2F,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC,YAAY;CACd;AACF,CAAC;AAED,MAAaC,eAAehG,WAAW,SAASgG,aAC9CC,YACAC,KACA;CACA,MAAM,EAAEC,MAAMhF,QAAQ;CAEtB,MAAMiF,QAAQjE,cAAc8D,YAAY,EACtCI,mBAAmB,EAAEC,OAAOC,eAAe;EACzC,MAAMC,aAAsC,CAAC;EAE7C,IAAIP,WAAWtB,kBAAkB,YAC/B6B,WAAWhC,eAAe8B,SAAS,CAAA;OAEnCE,WAAW9B,cAAc4B,SAAS;EAGpCE,WAAWC,qBAAqBzD,QAAoC;GAClE,IAAIiD,WAAWtB,kBAAkB,YAAY;IAC3C,IAAI3B,QAAQ,OACVuD,SAAS,KAAK;SAEdA,SAASvD,MAAO0D,MAAMC,QAAQ3D,GAAG,IAAIA,MAAM,CAACA,GAAG,IAAK,CAAA,CAAE;GAE1D,OACEuD,SAASG,MAAMC,QAAQ3D,GAAG,IAAIA,IAAI,KAAKA,GAAG;EAE9C;EAEA,OAAO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AUiG;MACV,eAAeC;MACf,mBAAmBJ;MAGhBnN,UAAAA,WACIA,WACDyH,KAAAA;KAEO,CAAA;IACL,CAAA;GACN,CAAA,CAEG;;CACI,CAAA;CAGvB,OAAOxI,cACLuO,mBACA;EAAE,GAAGvK;EAAOkF,YAAY5K,WAAW4K,YAAYlF,MAAMkF,UAAU;CAAE,CACnE;AACF,CAAC;AAQDtF,aAAa+K,OAAOtO,QAAQsO;AAE5B/K,aAAanF,UAAUC;AAEvBkF,aAAagL,SAASnP;AAEtBoP,OAAOC,eAAelL,cAAc,iBAAiB;CACnDM,OAAO;CACP6K,YAAY;CACZC,cAAc;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"FilterPicker.js","names":["CollectionChildren","FocusableRefValue","BasePropsWithoutChildren","ContainerStyleProps","filterBaseProps","Styles","tasty","ForwardedRef","forwardRef","ReactElement","ReactNode","RefObject","useEffect","useMemo","useRef","useState","FocusScope","Key","mergeProps","Placement","useLabel","Section","BaseSection","ListState","useListState","useEvent","useWarn","useI18n","CloseIcon","DirectionIcon","LoadingIcon","isTextOnly","allowOverlayKeysToPropagate","processSelectionArray","mergeStyleLayers","CubeItemButtonProps","ItemAction","ItemButton","CubeItemProps","Text","deriveCheckedSets","toOrderedKeys","buildTreeIndex","getTreeNodeText","getValidationIcon","getValidationTheme","useFieldProps","wrapWithField","FieldLayoutStyleProps","splitFieldLayout","TRIGGER_TOOLTIP_WARNING","Dialog","DialogTrigger","CubeFilterListBoxProps","FilterListBox","ListBox","TriggerActions","TriggerIcon","FilterTree","KeyboardEvent","RAKeyboardEvent","FieldBaseProps","CubeTreeNodeData","ItemWithKey","key","id","textValue","children","CubeFilterPickerProps","Omit","T","Pick","placeholder","size","listBoxStyles","popoverStyles","triggerStyles","isCheckable","shouldFlip","placement","targetRef","HTMLElement","containerPadding","tooltip","triggerTooltip","triggerDescription","renderSummary","args","selectedLabels","selectedKeys","selectedLabel","selectedKey","selectionMode","listStateRef","mods","Record","isClearable","clearLabel","onClear","actions","isLoadingItems","sortSelectedToTop","onOpenChange","isOpen","treeData","expandedKeys","defaultExpandedKeys","onExpand","getTreeSummaryLabels","index","ReturnType","checked","Set","labels","node","byKey","parentKey","parentOf","get","has","push","FilterPickerWrapper","qa","styles","display","flow","gridRows","placeContent","placeItems","FilterPicker","inputProps","ref","t","props","valuePropsMapper","value","onChange","fieldProps","isMultiple","onSelectionChange","Array","isArray","label","ariaLabel","ariaDescribedBy","extra","icon","rightIcon","prefix","suffix","hotkeys","labelStyles","isRequired","necessityIndicator","isInvalid","isValid","isDisabled","isLoading","message","externalMods","description","descriptionPlacement","type","theme","shape","labelSuffix","shouldFocusWrap","defaultSelectedKey","defaultSelectedKeys","disabledKeys","focusOnHover","showSelectAll","selectAllLabel","items","header","footer","headerStyles","footerStyles","allowsCustomValue","allValueProps","customValueProps","newCustomValueProps","searchPlaceholder","autoFocus","filter","emptyLabel","searchInputStyles","searchInputRef","listStyles","optionStyles","sectionStyles","headingStyles","listGap","listRef","disallowEmptySelection","shouldUseVirtualFocus","onEscape","onOptionClick","searchValue","onSearchChange","sortSelectedToTopProp","isReorderable","onReorder","form","otherProps","sortSelectedToTopExplicit","undefined","fieldLayout","internalSelectedKey","setInternalSelectedKey","internalSelectedKeys","setInternalSelectedKeys","isPopoverOpen","setIsPopoverOpen","cachedItemsOrder","triggerRef","HTMLButtonElement","labelProps","triggerLabelProps","labelElementType","pickerAriaLabel","String","trim","triggerWidthRef","current","isControlledSingle","isControlledMultiple","effectiveSelectedKey","effectiveSelectedKeys","localCollectionState","labelMap","keyMap","lm","Map","km","traverse","nodes","Iterable","strKey","set","childNodes","collection","mappedSelectedKey","mappedSelectedKeys","const","map","k","treeIndex","treeCheckedKeys","keys","treeSelectedKeys","internalExpandedKeys","setInternalExpandedKeys","handleExpand","from","values","selectedKeyStrs","hasSelection","length","latestSelectionRef","single","multiple","selectionsWhenClosed","handleOpenChange","UNSAFE_getDOMNode","offsetWidth","keyboardProps","onKeyDown","e","preventDefault","clearValue","focus","finalItems","selectedSet","addSelected","add","forEach","getItemKey","obj","item","sortArray","arr","selectedArr","unselectedArr","sortedChildren","itemsArray","sorted","triggerContent","join","showClearButton","isReadOnly","validationIcon","paintedTheme","hasCustomRightIcon","triggerRightIcon","hasTriggerActions","triggerActions","pressed","triggerElement","handleSelectionChange","selection","normalized","handleEscape","handleOptionClick","filterPickerField","eventProps","width","popover","field","Item","Action","Object","defineProperty","enumerable","configurable","Text","TriggerIcon","ItemButton","BaseSection"],"sources":["../../../../src/components/fields/FilterPicker/FilterPicker.tsx"],"sourcesContent":["import { CollectionChildren, FocusableRefValue } from '@react-types/shared';\nimport {\n BasePropsWithoutChildren,\n ContainerStyleProps,\n filterBaseProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FocusScope, Key, mergeProps, Placement, useLabel } from 'react-aria';\nimport { Section as BaseSection, ListState, useListState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { useWarn } from '../../../_internal/hooks/use-warn';\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { isTextOnly } from '../../../utils/react/isTextOnly';\nimport { allowOverlayKeysToPropagate } from '../../../utils/react/overlayKeyPropagation';\nimport { processSelectionArray } from '../../../utils/selection';\nimport { mergeStyleLayers } from '../../../utils/styles';\nimport { CubeItemButtonProps, ItemAction, ItemButton } from '../../actions';\nimport { CubeItemProps } from '../../content/Item';\nimport { Text } from '../../content/Text';\nimport {\n deriveCheckedSets,\n toOrderedKeys,\n} from '../../content/Tree/checked-keys';\nimport { buildTreeIndex, getTreeNodeText } from '../../content/Tree/tree-index';\nimport {\n getValidationIcon,\n getValidationTheme,\n useFieldProps,\n wrapWithField,\n} from '../../form';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport { TRIGGER_TOOLTIP_WARNING } from '../../form/legacy-tooltip';\nimport { Dialog } from '../../overlays/Dialog/Dialog';\nimport { DialogTrigger } from '../../overlays/Dialog/DialogTrigger';\nimport {\n CubeFilterListBoxProps,\n FilterListBox,\n} from '../FilterListBox/FilterListBox';\nimport { ListBox } from '../ListBox';\nimport { TriggerActions, TriggerIcon } from '../TriggerActions';\n\nimport { FilterTree } from './FilterTree';\n\nimport type { KeyboardEvent as RAKeyboardEvent } from '@react-types/shared';\nimport type { FieldBaseProps } from '../../../shared';\nimport type { CubeTreeNodeData } from '../../content/Tree/types';\n\ninterface ItemWithKey {\n key?: string | number;\n id?: string | number;\n textValue?: string;\n children?: ItemWithKey[];\n [key: string]: unknown;\n}\n\nexport interface CubeFilterPickerProps<T>\n extends\n Omit<CubeFilterListBoxProps<T>, 'size' | 'shape' | 'children'>,\n // `tooltip` is declared below, for the trigger; the label's info badge is\n // `labelTooltip`. Of the item's style props, only the field layout ones\n // apply, through `FieldLayoutStyleProps`.\n Omit<\n CubeItemProps,\n 'children' | 'size' | 'tooltip' | keyof ContainerStyleProps\n >,\n BasePropsWithoutChildren,\n FieldLayoutStyleProps,\n FieldBaseProps<\n string | number | readonly (string | number)[] | null | undefined\n >,\n Pick<\n CubeItemButtonProps,\n | 'type'\n | 'theme'\n | 'icon'\n | 'rightIcon'\n | 'prefix'\n | 'suffix'\n | 'hotkeys'\n | 'shape'\n > {\n /** The options, or a render function over `items`. Required unless `treeData` is set. */\n children?: CollectionChildren<T>;\n /** Accessible name for the picker trigger when there is no visible label. */\n 'aria-label'?: string;\n /** Ids of elements that also describe the trigger, beside the field's own description and message. */\n 'aria-describedby'?: string;\n /** Placeholder text when no selection is made */\n placeholder?: string;\n /** Size of the picker component */\n size?: 'small' | 'medium' | 'large';\n /** Custom styles for the list box popover */\n listBoxStyles?: Styles;\n /** Custom styles for the popover container */\n popoverStyles?: Styles;\n /** Custom styles for the trigger button */\n triggerStyles?: Styles;\n /** Whether to show checkboxes for multiple selection mode */\n isCheckable?: boolean;\n /** Whether to flip the popover placement */\n shouldFlip?: boolean;\n /**\n * Placement of the popover relative to the trigger.\n * Accepts React Aria's `Placement` strings (e.g. `'bottom start'`,\n * `'top start'`, `'right top'`, `'left top'`).\n * @default 'bottom start'\n */\n placement?: Placement;\n /**\n * The ref of the element the popover should visually attach itself to.\n * Defaults to the trigger button.\n *\n * Forwarded to `DialogTrigger`, so the anchor also becomes what outside-click\n * dismissal treats as the trigger. The popover's `minWidth` stays tied to the\n * trigger button, not to this element.\n */\n targetRef?: RefObject<HTMLElement | null>;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /**\n * Tooltip for the trigger. The info badge next to the field's label is\n * `labelTooltip`.\n */\n tooltip?: CubeItemProps['tooltip'];\n /** @deprecated Use `tooltip`. */\n triggerTooltip?: CubeItemProps['tooltip'];\n /** Description for the trigger button (separate from field description) */\n triggerDescription?: CubeItemProps['description'];\n\n /**\n * Custom renderer for the summary shown inside the trigger when there is a selection.\n *\n * For `selectionMode=\"multiple\"` the function receives:\n * - `selectedLabels`: array of labels of the selected items.\n * - `selectedKeys`: array of keys of the selected items or \"all\".\n *\n * For `selectionMode=\"single\"` the function receives:\n * - `selectedLabel`: label of the selected item.\n * - `selectedKey`: key of the selected item.\n *\n * The function should return a `ReactNode` that will be rendered inside the trigger.\n * Set to `false` to hide the summary text completely.\n */\n renderSummary?:\n | ((args: {\n selectedLabels?: string[];\n selectedKeys?: 'all' | (string | number)[];\n selectedLabel?: string;\n selectedKey?: string | number | null;\n selectionMode?: 'single' | 'multiple';\n }) => ReactNode)\n | false;\n\n /** Ref to access internal ListBox state (from FilterListBox) */\n listStateRef?: RefObject<ListState<T>>;\n /** Additional modifiers for styling the FilterPicker */\n mods?: Record<string, boolean>;\n /** Whether the filter picker is clearable using a clear button in the rightIcon slot */\n isClearable?: boolean;\n /** Accessible name for the built-in clear button. Defaults to a localized \"Clear value\". */\n clearLabel?: string;\n /** Callback called when the clear button is pressed */\n onClear?: () => void;\n /**\n * Custom actions rendered inside the trigger, to the left of the built-in\n * clear button and dropdown caret. Use `FilterPicker.Action` so they match the\n * trigger's size and theme.\n *\n * Pressing one runs its handler without opening or closing the popover —\n * including while the popover is open. Actions follow the trigger's disabled\n * state but NOT `isReadOnly`, since a read-only field can still host an\n * action that does not change the value; pass `isDisabled` yourself for one\n * that does.\n */\n actions?: ReactNode;\n /**\n * Whether items are currently loading. Shows a loading spinner in the search\n * input suffix inside the popover. Unlike `isLoading`, this does NOT disable\n * the trigger.\n */\n isLoadingItems?: boolean;\n /**\n * Sort selected items to the top when the popover opens.\n * Only works when using the `items` prop (data-driven mode).\n * Ignored when using JSX children.\n * @default true when items are provided, false when using JSX children\n */\n sortSelectedToTop?: boolean;\n /** Callback called when the popover open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n\n /**\n * Tree-shaped options. When set, the popover shows a checkable `Tree` in\n * place of the list, and `items` and `children` are not used.\n *\n * Tree mode is always multiple selection. The value (`selectedKeys`) is\n * every fully checked key, parents included: checking a parent checks its\n * children, and a parent with only some children checked is half-checked.\n * The cascade runs over the whole tree, so a search never unchecks the\n * nodes it hides. A press on a row toggles its checkbox. Disable a node\n * with its own `isDisabled`, not `disabledKeys`.\n *\n * The search keeps a node that matches with its whole subtree, and the\n * ancestors of deeper matches with only their matching branches, opened.\n * The default summary lists the topmost checked nodes.\n */\n treeData?: CubeTreeNodeData[];\n /** Expanded nodes in tree mode (controlled). A search expands on its own and restores these when cleared. */\n expandedKeys?: string[];\n /** Initially expanded nodes in tree mode (uncontrolled). */\n defaultExpandedKeys?: string[];\n /** Called when the user expands or collapses a node in tree mode, outside a search. */\n onExpand?: (expandedKeys: string[]) => void;\n}\n\n/**\n * Tree mode's summary: the topmost checked nodes, since a checked parent\n * stands for its children. Keys the tree lacks are listed as they are.\n */\nfunction getTreeSummaryLabels(\n index: ReturnType<typeof buildTreeIndex>,\n checked: Set<string>,\n): string[] {\n const labels: string[] = [];\n\n for (const [key, node] of index.byKey) {\n const parentKey = index.parentOf.get(key);\n if (!checked.has(key) || (parentKey != null && checked.has(parentKey))) {\n continue;\n }\n labels.push(getTreeNodeText(node));\n }\n\n for (const key of checked) {\n if (!index.byKey.has(key)) labels.push(key);\n }\n\n return labels;\n}\n\nconst FilterPickerWrapper = tasty({\n qa: 'FilterPicker',\n styles: {\n display: 'inline-grid',\n flow: 'column',\n gridRows: '1sf',\n placeContent: 'stretch',\n placeItems: 'stretch',\n },\n});\n\nexport const FilterPicker = forwardRef(function FilterPicker<T extends object>(\n inputProps: CubeFilterPickerProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const { t } = useI18n();\n\n const props = useFieldProps(inputProps, {\n valuePropsMapper: ({ value, onChange }) => {\n const fieldProps: Record<string, unknown> = {};\n const isMultiple =\n inputProps.selectionMode === 'multiple' || !!inputProps.treeData;\n\n if (isMultiple) {\n fieldProps.selectedKeys = value || [];\n } else {\n fieldProps.selectedKey = value ?? null;\n }\n\n fieldProps.onSelectionChange = (key: Key | null | 'all' | Key[]) => {\n if (isMultiple) {\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 let {\n qa,\n label,\n 'aria-label': ariaLabel,\n // The field's description and message describe the trigger, which is the\n // control, not the wrapper the rest of these props land on.\n 'aria-describedby': ariaDescribedBy,\n extra,\n id,\n icon,\n rightIcon,\n prefix,\n suffix,\n actions,\n hotkeys,\n tooltip,\n triggerTooltip,\n triggerDescription,\n labelStyles,\n isRequired,\n necessityIndicator,\n isInvalid,\n isValid,\n isDisabled,\n isLoading,\n message,\n mods: externalMods,\n description,\n descriptionPlacement,\n placeholder,\n size = 'medium',\n styles,\n listBoxStyles,\n popoverStyles,\n type = 'outline',\n theme = 'default',\n shape,\n labelSuffix,\n shouldFocusWrap,\n children,\n shouldFlip = true,\n placement = 'bottom start',\n targetRef,\n containerPadding = 8,\n selectedKey,\n defaultSelectedKey,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n selectionMode = 'single',\n listStateRef,\n focusOnHover,\n showSelectAll,\n selectAllLabel = t('picker.all', 'All'),\n items,\n header,\n footer,\n headerStyles,\n footerStyles,\n triggerStyles,\n allowsCustomValue,\n renderSummary,\n isCheckable,\n allValueProps,\n customValueProps,\n newCustomValueProps,\n searchPlaceholder,\n autoFocus,\n filter,\n emptyLabel,\n searchInputStyles,\n searchInputRef,\n listStyles,\n optionStyles,\n sectionStyles,\n headingStyles,\n listGap,\n listRef,\n disallowEmptySelection,\n shouldUseVirtualFocus,\n onEscape,\n onOptionClick,\n isClearable,\n clearLabel,\n isLoadingItems,\n searchValue,\n onSearchChange,\n sortSelectedToTop: sortSelectedToTopProp,\n onOpenChange,\n isReorderable,\n onReorder,\n form,\n treeData,\n expandedKeys,\n defaultExpandedKeys,\n onExpand,\n ...otherProps\n } = props;\n\n // Tree mode is multiple selection, whatever `selectionMode` says.\n if (treeData) selectionMode = 'multiple';\n\n const sortSelectedToTopExplicit = sortSelectedToTopProp !== undefined;\n const sortSelectedToTop = sortSelectedToTopProp ?? (items ? true : false);\n\n const fieldLayout = splitFieldLayout(props);\n\n styles = fieldLayout.styles;\n\n useWarn(triggerTooltip !== undefined, TRIGGER_TOOLTIP_WARNING);\n\n useWarn(isCheckable === false && selectionMode === 'single', {\n key: ['filterpicker-checkable-single-mode'],\n args: [\n 'CubeUIKit: isCheckable=false is not recommended in single selection mode as it may confuse users about selection behavior.',\n ],\n });\n\n useWarn(sortSelectedToTopExplicit && sortSelectedToTop && !items, {\n key: ['filterpicker-sort-selected-to-top-children'],\n args: [\n 'FilterPicker: sortSelectedToTop only works with the items prop. Sorting will be skipped when using JSX children.',\n ],\n });\n\n // Internal selection state (uncontrolled scenario)\n const [internalSelectedKey, setInternalSelectedKey] = useState<Key | null>(\n defaultSelectedKey ?? null,\n );\n const [internalSelectedKeys, setInternalSelectedKeys] = useState<\n 'all' | Key[]\n >(defaultSelectedKeys ?? []);\n\n // Popover state — used as controlled prop for DialogTrigger\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const cachedItemsOrder = useRef<T[] | null>(null);\n const triggerRef = useRef<FocusableRefValue<HTMLButtonElement>>(null);\n const { labelProps, fieldProps: triggerLabelProps } = useLabel({\n id: props.id,\n label,\n labelElementType: 'span',\n 'aria-label':\n ariaLabel ?? (!label ? t('picker.pickerAriaLabel', 'Picker') : undefined),\n 'aria-labelledby': props['aria-labelledby'],\n });\n const pickerAriaLabel =\n `${ariaLabel ?? (isTextOnly(label) ? String(label ?? '') : '')} ${t('picker.pickerAriaLabel', 'Picker')}`.trim();\n\n // Measured lazily on popover open instead of on every render\n const triggerWidthRef = useRef<number | undefined>(undefined);\n\n useEffect(() => {\n cachedItemsOrder.current = null;\n }, [items]);\n\n const isControlledSingle = selectedKey !== undefined;\n const isControlledMultiple = selectedKeys !== undefined;\n\n const effectiveSelectedKey = isControlledSingle\n ? selectedKey\n : internalSelectedKey;\n const effectiveSelectedKeys = isControlledMultiple\n ? selectedKeys\n : internalSelectedKeys;\n\n // Collection for label extraction (shared with FilterListBox via _internalCollection)\n const localCollectionState = useListState({\n children: children as any,\n items: items as any,\n selectionMode: 'none' as any,\n });\n\n // Build Maps for O(1) label and key lookups from the collection\n const { labelMap, keyMap } = useMemo(() => {\n const lm = new Map<string, string>();\n const km = new Map<string, Key>();\n\n const traverse = (nodes: Iterable<any>) => {\n for (const node of nodes) {\n if (node.type === 'item') {\n const strKey = String(node.key);\n lm.set(strKey, node.textValue || strKey);\n km.set(strKey, node.key);\n } else if (node.childNodes) {\n traverse(node.childNodes);\n }\n }\n };\n\n traverse(localCollectionState.collection);\n return { labelMap: lm, keyMap: km };\n }, [localCollectionState.collection]);\n\n // O(1) key mapping via Map (replaces O(n) iteration per key)\n const mappedSelectedKey = useMemo(() => {\n if (selectionMode !== 'single' || effectiveSelectedKey == null) return null;\n const strKey = String(effectiveSelectedKey);\n return keyMap.get(strKey) ?? effectiveSelectedKey;\n }, [selectionMode, effectiveSelectedKey, keyMap]);\n\n const mappedSelectedKeys = useMemo(() => {\n if (selectionMode !== 'multiple') return undefined;\n if (effectiveSelectedKeys === 'all') return 'all' as const;\n if (Array.isArray(effectiveSelectedKeys)) {\n return effectiveSelectedKeys.map((k) => {\n const strKey = String(k);\n return keyMap.get(strKey) ?? k;\n });\n }\n return effectiveSelectedKeys;\n }, [selectionMode, effectiveSelectedKeys, keyMap]);\n\n const treeIndex = useMemo(\n () => (treeData ? buildTreeIndex(treeData) : null),\n [treeData],\n );\n\n // Tree mode's value as the tree reads it: `'all'` checks every node.\n const treeCheckedKeys = useMemo(\n () =>\n effectiveSelectedKeys === 'all'\n ? [...(treeIndex?.byKey.keys() ?? [])]\n : (effectiveSelectedKeys ?? []).map(String),\n [effectiveSelectedKeys, treeIndex],\n );\n\n // Every key the value checks, conducted over the whole tree, in tree\n // order: what the tree shows and what `renderSummary` receives.\n const treeSelectedKeys = useMemo(\n () =>\n treeData && treeIndex\n ? toOrderedKeys(\n treeIndex,\n deriveCheckedSets(treeData, treeIndex, treeCheckedKeys).checked,\n )\n : null,\n [treeData, treeIndex, treeCheckedKeys],\n );\n\n // The user's expansion, held here rather than in the popover, so it\n // outlives closing it.\n const [internalExpandedKeys, setInternalExpandedKeys] = useState<string[]>(\n defaultExpandedKeys ?? [],\n );\n const handleExpand = (keys: string[]) => {\n if (expandedKeys === undefined) setInternalExpandedKeys(keys);\n onExpand?.(keys);\n };\n\n // Memoized label extraction using the labelMap\n const selectedLabels = useMemo(() => {\n if (treeIndex && treeSelectedKeys) {\n return getTreeSummaryLabels(treeIndex, new Set(treeSelectedKeys));\n }\n\n if (selectionMode === 'multiple' && effectiveSelectedKeys === 'all') {\n return Array.from(labelMap.values());\n }\n\n const selectedKeyStrs =\n selectionMode === 'multiple' && effectiveSelectedKeys !== 'all'\n ? (effectiveSelectedKeys || []).map(String)\n : effectiveSelectedKey != null\n ? [String(effectiveSelectedKey)]\n : [];\n\n return selectedKeyStrs.map((k) => labelMap.get(k) ?? k);\n }, [\n treeIndex,\n treeSelectedKeys,\n selectionMode,\n effectiveSelectedKey,\n effectiveSelectedKeys,\n labelMap,\n ]);\n\n const hasSelection = selectedLabels.length > 0;\n\n // Refs for tracking selection state synchronously\n const latestSelectionRef = useRef<{\n single: string | null;\n multiple: 'all' | string[];\n }>({\n single: effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n effectiveSelectedKeys === 'all'\n ? 'all'\n : (effectiveSelectedKeys ?? []).map(String),\n });\n\n useEffect(() => {\n latestSelectionRef.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n effectiveSelectedKeys === 'all'\n ? 'all'\n : (effectiveSelectedKeys ?? []).map(String),\n };\n }, [effectiveSelectedKey, effectiveSelectedKeys]);\n\n const selectionsWhenClosed = useRef<{\n single: string | null;\n multiple: 'all' | string[];\n }>({ single: null, multiple: [] });\n\n useEffect(() => {\n if (!isPopoverOpen) {\n selectionsWhenClosed.current = {\n single:\n effectiveSelectedKey != null ? String(effectiveSelectedKey) : null,\n multiple:\n effectiveSelectedKeys === 'all'\n ? 'all'\n : (effectiveSelectedKeys ?? []).map(String),\n };\n }\n }, [effectiveSelectedKey, effectiveSelectedKeys, isPopoverOpen]);\n\n // ---------------------------------------------------------------------------\n // Popover lifecycle — all effects moved out of the inline renderTrigger\n // function so they have a stable component identity and don't tear\n // down/setup on every parent re-render.\n // DialogTrigger is controlled via isOpen/onOpenChange.\n // ---------------------------------------------------------------------------\n\n const handleOpenChange = useEvent((isOpen: boolean) => {\n if (isOpen === isPopoverOpen) return;\n\n if (isOpen) {\n triggerWidthRef.current =\n triggerRef?.current?.UNSAFE_getDOMNode()?.offsetWidth;\n }\n setIsPopoverOpen(isOpen);\n if (!isOpen) {\n selectionsWhenClosed.current = { ...latestSelectionRef.current };\n cachedItemsOrder.current = null;\n onSearchChange?.('');\n }\n onOpenChange?.(isOpen);\n });\n\n // Popover sync is handled by the inner `DialogTrigger` (type=\"popover\").\n\n // Keyboard handler for arrow keys to open popover\n // Deliberately NOT `useKeyboard`. `ItemButton` already runs whatever\n // `onKeyDown` it is given through `useFocusable`'s own `useKeyboard`, and a\n // second wrapper here would leave `continuePropagation()` releasing only the\n // inner one while the outer still stopped the event — `Escape` reached the\n // trigger and died there (CUB-4839). Handed over plain, this IS the outer\n // wrapper's handler, so the opt-out applies to the event that travels.\n const keyboardProps = {\n onKeyDown: (e: RAKeyboardEvent) => {\n allowOverlayKeysToPropagate(e);\n\n if ((e.key === 'ArrowUp' || e.key === 'ArrowDown') && !isPopoverOpen) {\n e.preventDefault();\n handleOpenChange(true);\n\n return;\n }\n },\n };\n\n // Clear handler\n const clearValue = useEvent(() => {\n if (selectionMode === 'multiple') {\n if (!isControlledMultiple) {\n setInternalSelectedKeys([]);\n }\n onSelectionChange?.([]);\n } else {\n if (!isControlledSingle) {\n setInternalSelectedKey(null);\n }\n onSelectionChange?.(null);\n }\n\n handleOpenChange(false);\n triggerRef?.current?.focus?.();\n props.onClear?.();\n\n return false;\n });\n\n // ---------------------------------------------------------------------------\n // Sorting\n // ---------------------------------------------------------------------------\n\n // Ref values (selectionsWhenClosed.current) are read synchronously inside\n // the memo body; isPopoverOpen changing triggers recomputation at the right\n // time (the ref is updated before the next render).\n const finalItems = useMemo(() => {\n if (!items) return items;\n if (!sortSelectedToTop) return items;\n if (!isPopoverOpen) return items;\n if (cachedItemsOrder.current) return cachedItemsOrder.current;\n\n const selectedSet = new Set<string>();\n\n const addSelected = (key: Key) => {\n if (key != null) selectedSet.add(String(key));\n };\n\n if (selectionMode === 'multiple') {\n if (selectionsWhenClosed.current.multiple === 'all') {\n return items;\n }\n (selectionsWhenClosed.current.multiple as string[]).forEach(addSelected);\n } else {\n if (selectionsWhenClosed.current.single != null) {\n addSelected(selectionsWhenClosed.current.single);\n }\n }\n\n if (selectedSet.size === 0) {\n return items;\n }\n\n const getItemKey = (obj: unknown): string | undefined => {\n if (obj == null || typeof obj !== 'object') return undefined;\n\n const item = obj as ItemWithKey;\n if (item.key != null) return String(item.key);\n if (item.id != null) return String(item.id);\n return undefined;\n };\n\n const sortArray = (arr: unknown[]): unknown[] => {\n const selectedArr: unknown[] = [];\n const unselectedArr: unknown[] = [];\n\n arr.forEach((obj) => {\n const item = obj as ItemWithKey;\n if (obj && Array.isArray(item.children)) {\n const sortedChildren = sortArray(item.children);\n unselectedArr.push({ ...item, children: sortedChildren });\n } else {\n const key = getItemKey(obj);\n if (key && selectedSet.has(key)) {\n selectedArr.push(obj);\n } else {\n unselectedArr.push(obj);\n }\n }\n });\n\n return [...selectedArr, ...unselectedArr];\n };\n\n const itemsArray = Array.isArray(items)\n ? items\n : Array.from(items as Iterable<unknown>);\n const sorted = sortArray(itemsArray) as T[];\n\n cachedItemsOrder.current = sorted;\n\n return sorted;\n }, [items, sortSelectedToTop, selectionMode, isPopoverOpen]);\n\n // ---------------------------------------------------------------------------\n // Trigger content\n // ---------------------------------------------------------------------------\n\n const triggerContent = useMemo((): ReactNode => {\n if (typeof renderSummary === 'function') {\n if (selectionMode === 'single') {\n return renderSummary({\n selectedLabel: selectedLabels[0],\n selectedKey: effectiveSelectedKey ?? null,\n selectedLabels,\n selectedKeys: effectiveSelectedKeys,\n selectionMode: 'single',\n });\n }\n\n return renderSummary({\n selectedLabels,\n selectedKeys: treeSelectedKeys ?? effectiveSelectedKeys,\n selectionMode: 'multiple',\n });\n } else if (renderSummary === false) {\n return null;\n }\n\n if (!hasSelection) {\n return <Text.Placeholder>{placeholder}</Text.Placeholder>;\n } else if (selectionMode === 'single') {\n return selectedLabels[0] || null;\n } else if (effectiveSelectedKeys === 'all') {\n return selectAllLabel;\n } else {\n return selectedLabels.join(', ') || null;\n }\n }, [\n renderSummary,\n selectionMode,\n selectedLabels,\n effectiveSelectedKey,\n effectiveSelectedKeys,\n treeSelectedKeys,\n hasSelection,\n placeholder,\n selectAllLabel,\n ]);\n\n const showClearButton =\n isClearable && hasSelection && !isDisabled && !props.isReadOnly;\n\n const validationIcon = getValidationIcon({ isInvalid, isValid });\n\n // The same expression the trigger is painted with, not the raw `theme` — see\n // `Picker` for why validation has to be applied here too.\n const paintedTheme = getValidationTheme(theme, { isInvalid, isValid });\n //\n // It reaches the trailing actions through `ItemButton`'s wrapper, which is\n // what provides `ItemActionContext` for a run rendered outside the button —\n // so passing it as the trigger's `theme` is all that is needed.\n\n if (validationIcon) {\n suffix = (\n <>\n {suffix}\n {validationIcon}\n </>\n );\n }\n\n // A caller's `rightIcon` keeps the `rightIcon` slot — see `Picker` for why.\n const hasCustomRightIcon = rightIcon !== undefined;\n const triggerRightIcon = hasCustomRightIcon ? (\n isLoading ? (\n <LoadingIcon />\n ) : (\n rightIcon\n )\n ) : undefined;\n\n // With a caller's own `rightIcon` the built-in control moves into that slot,\n // leaving the run with whatever the caller passed — possibly nothing. `null`\n // rather than nothing at all: the run stays in the markup, so the trigger does\n // not restructure if actions arrive later, but the row stops counting it as\n // end content. That is what keeps an icon-only trigger with `rightIcon={null}`\n // square, as it was before the run existed.\n const hasTriggerActions = !hasCustomRightIcon || !!actions;\n\n // Everything trailing that is NOT the caller's own icon goes into the actions\n // run — a sibling of the `<button>`, so the clear button is no longer nested\n // inside one. See `TriggerActions`.\n const triggerActions = (\n <TriggerActions\n actions={actions}\n builtIn={\n hasCustomRightIcon ? null : isLoading ? (\n <TriggerIcon>\n <LoadingIcon />\n </TriggerIcon>\n ) : showClearButton ? (\n <ItemAction\n icon={<CloseIcon />}\n size={size}\n qa=\"FilterPickerClearButton\"\n // See `Select`: `ItemAction` names itself from `aria-label` or a\n // string `tooltip`, and warns for neither.\n aria-label={\n clearLabel ?? t('filterPicker.clearValue', 'Clear value')\n }\n // No explicit `type`/`theme` — see `Picker`: the default `current`\n // type inherits the trigger's text color, which already carries\n // validation state.\n mods={{ pressed: false }}\n onPress={clearValue}\n />\n ) : (\n <TriggerIcon>\n <DirectionIcon to={isPopoverOpen ? 'top' : 'bottom'} />\n </TriggerIcon>\n )\n }\n />\n );\n\n // Trigger element — plain JSX with no hooks.\n // The element type (ItemButton) is stable so React can reconcile efficiently.\n const triggerElement = (\n <ItemButton\n ref={triggerRef as any}\n data-popover-trigger\n qa={qa || 'FilterPicker'}\n type={type}\n theme={paintedTheme}\n size={size}\n shape={shape}\n isDisabled={isDisabled || isLoading}\n data-input-type=\"filterpicker\"\n mods={{\n placeholder: !hasSelection,\n ...externalMods,\n }}\n icon={icon}\n rightIcon={triggerRightIcon}\n actions={hasTriggerActions ? triggerActions : null}\n prefix={prefix}\n suffix={suffix}\n hotkeys={hotkeys}\n tooltip={tooltip ?? triggerTooltip}\n description={triggerDescription}\n descriptionPlacement={descriptionPlacement}\n styles={triggerStyles}\n {...keyboardProps}\n {...mergeProps(triggerLabelProps, { id })}\n aria-describedby={ariaDescribedBy}\n >\n {triggerContent}\n </ItemButton>\n );\n\n // ---------------------------------------------------------------------------\n // Selection change handler\n // ---------------------------------------------------------------------------\n\n const handleSelectionChange = useEvent((selection: any) => {\n if (selectionMode === 'single') {\n // With `disallowEmptySelection`, re-selecting the current item emits a\n // duplicate event (see `allowDuplicateSelectionEvents` below). Close the\n // popover but don't propagate the unchanged selection.\n if (\n disallowEmptySelection &&\n selection != null &&\n effectiveSelectedKey != null &&\n String(selection) === String(effectiveSelectedKey)\n ) {\n handleOpenChange(false);\n return;\n }\n\n if (!isControlledSingle) {\n setInternalSelectedKey(selection as Key | null);\n }\n } else {\n if (!isControlledMultiple) {\n let normalized: 'all' | Key[] = selection;\n\n if (selection === 'all') {\n normalized = 'all';\n } else if (Array.isArray(selection)) {\n normalized = processSelectionArray(selection);\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n normalized = processSelectionArray(selection as Set<Key>);\n }\n\n setInternalSelectedKeys(normalized);\n }\n }\n\n // Update latest selection ref synchronously\n if (selectionMode === 'single') {\n latestSelectionRef.current.single =\n selection != null ? String(selection) : null;\n } else {\n if (selection === 'all') {\n latestSelectionRef.current.multiple = 'all';\n } else if (Array.isArray(selection)) {\n latestSelectionRef.current.multiple = Array.from(\n new Set(processSelectionArray(selection)),\n );\n } else if (\n selection &&\n typeof selection === 'object' &&\n selection instanceof Set\n ) {\n latestSelectionRef.current.multiple = Array.from(\n new Set(processSelectionArray(selection as Set<Key>)),\n );\n } else {\n latestSelectionRef.current.multiple =\n selection === 'all'\n ? 'all'\n : Array.isArray(selection)\n ? selection.map(String)\n : [];\n }\n }\n\n onSelectionChange?.(selection);\n\n if (selectionMode === 'single') {\n handleOpenChange(false);\n }\n });\n\n // Stable callbacks for popover content (avoid inline closures that change every render)\n const handleEscape = useEvent(() => {\n handleOpenChange(false);\n });\n\n const handleOptionClick = useEvent((key: Key) => {\n if ((selectionMode === 'multiple' && isCheckable) || key === '__ALL__') {\n handleOpenChange(false);\n }\n });\n\n const filterPickerField = (\n <FilterPickerWrapper\n ref={ref}\n qa=\"FilterPickerWrapper\"\n styles={styles}\n {...filterBaseProps(otherProps, { eventProps: true })}\n >\n <DialogTrigger\n type=\"popover\"\n placement={placement}\n targetRef={targetRef}\n isOpen={isPopoverOpen}\n containerPadding={containerPadding}\n shouldFlip={shouldFlip}\n onOpenChange={handleOpenChange}\n >\n {triggerElement}\n {() => (\n <Dialog\n qa=\"FilterPickerOverlay\"\n aria-label={pickerAriaLabel}\n isDismissable={false}\n display=\"grid\"\n styles={mergeStyleLayers(\n {\n gridRows: '1sf',\n width: 'max($overlay-min-width, 30x) max-content 50vw',\n '$overlay-min-width': '30x',\n },\n popoverStyles,\n )}\n tokens={\n triggerWidthRef.current\n ? { '$overlay-min-width': `${triggerWidthRef.current}px` }\n : undefined\n }\n >\n <FocusScope restoreFocus>\n {treeData ? (\n <FilterTree\n autoFocus\n treeData={treeData}\n checkedKeys={treeCheckedKeys}\n expandedKeys={expandedKeys ?? internalExpandedKeys}\n aria-label={pickerAriaLabel}\n searchPlaceholder={searchPlaceholder}\n searchValue={searchValue}\n searchInputStyles={searchInputStyles}\n searchInputRef={searchInputRef}\n filter={filter}\n emptyLabel={emptyLabel}\n header={header}\n headerStyles={headerStyles}\n footer={footer}\n footerStyles={footerStyles}\n size={size === 'small' ? 'medium' : size}\n isDisabled={isDisabled}\n isLoadingItems={isLoadingItems}\n shouldFocusWrap={shouldFocusWrap}\n onExpand={handleExpand}\n onSearchChange={onSearchChange}\n onCheckedKeysChange={handleSelectionChange}\n onEscape={handleEscape}\n onCommit={handleEscape}\n />\n ) : (\n <FilterListBox\n isBare\n autoFocus\n items={items ? (finalItems as typeof props.items) : undefined}\n aria-label={pickerAriaLabel}\n _internalCollection={localCollectionState.collection}\n selectedKey={\n selectionMode === 'single' ? mappedSelectedKey : undefined\n }\n selectedKeys={\n selectionMode === 'multiple'\n ? mappedSelectedKeys\n : undefined\n }\n searchPlaceholder={searchPlaceholder}\n filter={filter}\n searchValue={searchValue}\n listStyles={listStyles}\n optionStyles={optionStyles}\n sectionStyles={sectionStyles}\n headingStyles={headingStyles}\n listGap={listGap}\n listRef={listRef}\n disallowEmptySelection={disallowEmptySelection}\n allowDuplicateSelectionEvents={\n selectionMode === 'single' && !!disallowEmptySelection\n }\n emptyLabel={emptyLabel}\n searchInputStyles={searchInputStyles}\n searchInputRef={searchInputRef}\n disabledKeys={disabledKeys}\n focusOnHover={focusOnHover}\n shouldFocusWrap={shouldFocusWrap}\n allowsCustomValue={allowsCustomValue}\n selectionMode={selectionMode}\n isInvalid={isInvalid}\n isValid={isValid}\n isDisabled={isDisabled}\n isLoading={isLoading}\n isLoadingItems={isLoadingItems}\n stateRef={listStateRef}\n isCheckable={isCheckable}\n mods={{\n popover: true,\n }}\n size={size === 'small' ? 'medium' : size}\n showSelectAll={showSelectAll}\n selectAllLabel={selectAllLabel}\n header={header}\n footer={footer}\n headerStyles={headerStyles}\n footerStyles={footerStyles}\n allValueProps={allValueProps}\n customValueProps={customValueProps}\n newCustomValueProps={newCustomValueProps}\n isReorderable={isReorderable}\n onSearchChange={onSearchChange}\n onReorder={onReorder}\n onEscape={handleEscape}\n onOptionClick={handleOptionClick}\n onSelectionChange={handleSelectionChange}\n >\n {\n (children\n ? (children as CollectionChildren<T>)\n : undefined) as CollectionChildren<T>\n }\n </FilterListBox>\n )}\n </FocusScope>\n </Dialog>\n )}\n </DialogTrigger>\n </FilterPickerWrapper>\n );\n\n return wrapWithField<Omit<CubeFilterPickerProps<T>, 'children'>>(\n filterPickerField,\n {\n ...props,\n ...fieldLayout.field,\n // The trigger's own. Handed on, it read as the legacy field `tooltip`.\n tooltip: undefined,\n labelProps: mergeProps(labelProps, props.labelProps),\n },\n );\n}) as unknown as (<T>(\n props: CubeFilterPickerProps<T> & { ref?: ForwardedRef<HTMLElement> },\n) => ReactElement) & {\n Item: typeof ListBox.Item;\n Section: typeof BaseSection;\n Action: typeof ItemAction;\n};\n\nFilterPicker.Item = ListBox.Item;\n\nFilterPicker.Section = BaseSection;\n\nFilterPicker.Action = ItemAction;\n\nObject.defineProperty(FilterPicker, 'cubeInputType', {\n value: 'FilterPicker',\n enumerable: false,\n configurable: false,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8OA,SAAS4G,qBACPC,OACAE,SACU;CACV,MAAME,SAAmB,CAAA;CAEzB,KAAK,MAAM,CAACjD,KAAKkD,SAASL,MAAMM,OAAO;EACrC,MAAMC,YAAYP,MAAMQ,SAASC,IAAItD,GAAG;EACxC,IAAI,CAAC+C,QAAQQ,IAAIvD,GAAG,KAAMoD,aAAa,QAAQL,QAAQQ,IAAIH,SAAS,GAClE;EAEFH,OAAOO,KAAK7E,gBAAgBuE,IAAI,CAAC;CACnC;CAEA,KAAK,MAAMlD,OAAO+C,SAChB,IAAI,CAACF,MAAMM,MAAMI,IAAIvD,GAAG,GAAGiD,OAAOO,KAAKxD,GAAG;CAG5C,OAAOiD;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