@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,14 +1,13 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.202.0 | Cube Dev Team */
|
|
2
2
|
import { useSlotProps } from "../../../utils/react/Slots.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
|
|
5
|
-
import {
|
|
5
|
+
import { TextItemWithNativeLink } from "../../content/TextItem/TextItem.js";
|
|
6
6
|
import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
7
7
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
8
8
|
import { DirectionIcon } from "../../../icons/DirectionIcon.js";
|
|
9
9
|
import { MenuTrigger as _MenuTrigger } from "../../actions/Menu/MenuTrigger.js";
|
|
10
10
|
import { Menu as __Menu } from "../../actions/Menu/Menu.js";
|
|
11
|
-
import { Action } from "../../actions/Action/Action.js";
|
|
12
11
|
import { useContextMenu } from "../../actions/use-context-menu.js";
|
|
13
12
|
import { useToast } from "../../overlays/Toast/useToast.js";
|
|
14
13
|
import { usePaletteVersion } from "../../../tokens/palette-config.js";
|
|
@@ -26,6 +25,7 @@ import { ColumnResizer } from "./ColumnResizer.js";
|
|
|
26
25
|
import { isMenuEmpty, normalizeMenuAction } from "./row-menu.js";
|
|
27
26
|
import { TableHeaderCell } from "./TableHeaderCell.js";
|
|
28
27
|
import { TableRow, TableRowDropIndicator } from "./TableRow.js";
|
|
28
|
+
import { TableRowLink } from "./TableRowLink.js";
|
|
29
29
|
import { TreeGridTable } from "./TreeGridTable.js";
|
|
30
30
|
import { selectionRowKey } from "./types.js";
|
|
31
31
|
import { toTsv } from "./use-cell-selection.js";
|
|
@@ -38,12 +38,46 @@ import { getColumnText, getColumnValue } from "./use-table-columns.js";
|
|
|
38
38
|
import "./use-table-selection.js";
|
|
39
39
|
import { useTableTooltipRefresh } from "./use-table-tooltip-refresh.js";
|
|
40
40
|
import { c } from "react/compiler-runtime";
|
|
41
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
41
42
|
import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
42
43
|
import clsx from "clsx";
|
|
43
44
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
44
45
|
import { VisuallyHidden } from "react-aria";
|
|
46
|
+
import { getInteractionModality } from "@react-aria/interactions";
|
|
45
47
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
46
48
|
//#region src/components/data/TableBase/TableView.tsx
|
|
49
|
+
const CELL_CONTROL_SELECTOR = "a,button,input,select,textarea,label[for],label:has(button,input,select,textarea),[tabindex],[contenteditable=\"\"],[contenteditable=\"true\"],[contenteditable=\"plaintext-only\"],[role=\"button\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"menuitem\"],[role=\"menuitemcheckbox\"],[role=\"menuitemradio\"],[role=\"radio\"],[role=\"textbox\"],[role=\"combobox\"],[role=\"slider\"],[role=\"spinbutton\"],[role=\"link\"]";
|
|
50
|
+
const NATIVE_CELL_CONTROL_SELECTOR = `:where([data-element=CellContent][data-native-row-content]) :where(${CELL_CONTROL_SELECTOR})`;
|
|
51
|
+
const NATIVE_CELL_CONTROL_STYLES = {
|
|
52
|
+
position: "relative",
|
|
53
|
+
zIndex: 1
|
|
54
|
+
};
|
|
55
|
+
function isCellControl(target, row) {
|
|
56
|
+
const control = target.closest(CELL_CONTROL_SELECTOR);
|
|
57
|
+
return control != null && control !== row;
|
|
58
|
+
}
|
|
59
|
+
function flatRowTabStop(restingRow, visibleRow, mountedRows, range) {
|
|
60
|
+
if (!mountedRows || !restingRow) return restingRow;
|
|
61
|
+
if (range && restingRow.index >= range.startIndex && restingRow.index <= range.endIndex) return restingRow;
|
|
62
|
+
return visibleRow && mountedRows.some((item) => item.index === visibleRow.index) ? visibleRow : null;
|
|
63
|
+
}
|
|
64
|
+
function scrollerTabStop(hasCellSelection, hasRowNavigation, restingRow, tabStopRow) {
|
|
65
|
+
if (hasRowNavigation && restingRow && !tabStopRow) return 0;
|
|
66
|
+
return hasCellSelection || hasRowNavigation ? -1 : void 0;
|
|
67
|
+
}
|
|
68
|
+
/** Correct native table/header geometry only when completing row focus. */
|
|
69
|
+
function revealFocusedRow(row, scroller, isHeaderSticky) {
|
|
70
|
+
if (scroller.scrollHeight <= scroller.clientHeight) return;
|
|
71
|
+
const viewport = scroller.getBoundingClientRect();
|
|
72
|
+
const bounds = row.getBoundingClientRect();
|
|
73
|
+
const header = row.closest("table")?.tHead;
|
|
74
|
+
const headerHeight = isHeaderSticky ? header?.getBoundingClientRect().height ?? 0 : 0;
|
|
75
|
+
const top = viewport.top + scroller.clientTop + headerHeight;
|
|
76
|
+
const bottom = viewport.top + scroller.clientTop + scroller.clientHeight;
|
|
77
|
+
if (bounds.top >= top && bounds.bottom <= bottom) return;
|
|
78
|
+
const delta = bounds.top < top || bounds.height > bottom - top ? bounds.top - top : bounds.bottom - bottom;
|
|
79
|
+
scroller.scrollTop += delta;
|
|
80
|
+
}
|
|
47
81
|
/**
|
|
48
82
|
* The same block as an HTML table, so a spreadsheet keeps the cell boundaries.
|
|
49
83
|
*
|
|
@@ -111,8 +145,8 @@ function pinStyle(column) {
|
|
|
111
145
|
}
|
|
112
146
|
/** Default text keeps its tooltip tree while the virtual window moves. */
|
|
113
147
|
function TableCellContent(t0) {
|
|
114
|
-
const $ = c(
|
|
115
|
-
const { column, row, rowIndex } = t0;
|
|
148
|
+
const $ = c(8);
|
|
149
|
+
const { column, row, rowIndex, nativeLinkProps } = t0;
|
|
116
150
|
let t1;
|
|
117
151
|
if ($[0] !== column || $[1] !== row || $[2] !== rowIndex) {
|
|
118
152
|
t1 = getColumnText(column, row, rowIndex);
|
|
@@ -123,25 +157,37 @@ function TableCellContent(t0) {
|
|
|
123
157
|
} else t1 = $[3];
|
|
124
158
|
const text = t1;
|
|
125
159
|
let t2;
|
|
126
|
-
if ($[4] !== column.autoHeight || $[5] !== text) {
|
|
127
|
-
t2 = column.autoHeight || text == null ? text : /* @__PURE__ */ jsx(
|
|
160
|
+
if ($[4] !== column.autoHeight || $[5] !== nativeLinkProps || $[6] !== text) {
|
|
161
|
+
t2 = column.autoHeight || text == null ? text : /* @__PURE__ */ jsx(TextItemWithNativeLink, {
|
|
162
|
+
nativeLinkProps,
|
|
163
|
+
children: text
|
|
164
|
+
});
|
|
128
165
|
$[4] = column.autoHeight;
|
|
129
|
-
$[5] =
|
|
130
|
-
$[6] =
|
|
131
|
-
|
|
166
|
+
$[5] = nativeLinkProps;
|
|
167
|
+
$[6] = text;
|
|
168
|
+
$[7] = t2;
|
|
169
|
+
} else t2 = $[7];
|
|
132
170
|
return t2;
|
|
133
171
|
}
|
|
134
|
-
function renderCellValue(rendered, autoHeight) {
|
|
172
|
+
function renderCellValue(rendered, autoHeight, nativeLinkProps) {
|
|
135
173
|
const isText = typeof rendered === "string" || typeof rendered === "number" || typeof rendered === "bigint";
|
|
136
|
-
return isText && !autoHeight ? /* @__PURE__ */ jsx(
|
|
174
|
+
return isText && !autoHeight ? /* @__PURE__ */ jsx(TextItemWithNativeLink, {
|
|
175
|
+
nativeLinkProps,
|
|
176
|
+
children: String(rendered)
|
|
177
|
+
}) : isText ? String(rendered) : rendered != null && typeof rendered !== "boolean" ? /* @__PURE__ */ jsx("div", {
|
|
178
|
+
"data-element": "CellContent",
|
|
179
|
+
"data-native-row-content": nativeLinkProps ? "" : void 0,
|
|
180
|
+
children: rendered
|
|
181
|
+
}) : rendered;
|
|
137
182
|
}
|
|
138
|
-
function renderCellContent(column, row, rowIndex, ctx) {
|
|
183
|
+
function renderCellContent(column, row, rowIndex, ctx, nativeLinkProps) {
|
|
139
184
|
if (!column.render) return column.isStructural ? null : /* @__PURE__ */ jsx(TableCellContent, {
|
|
140
185
|
column,
|
|
141
186
|
row,
|
|
142
|
-
rowIndex
|
|
187
|
+
rowIndex,
|
|
188
|
+
nativeLinkProps
|
|
143
189
|
});
|
|
144
|
-
return renderCellValue(column.render(column.isStructural ? void 0 : getColumnValue(column, row, rowIndex), row, rowIndex, ctx), column.autoHeight);
|
|
190
|
+
return renderCellValue(column.render(column.isStructural ? void 0 : getColumnValue(column, row, rowIndex), row, rowIndex, ctx), column.autoHeight, nativeLinkProps);
|
|
145
191
|
}
|
|
146
192
|
/**
|
|
147
193
|
* A tree column's cell content: indented to the row's level, with the expand
|
|
@@ -173,6 +219,7 @@ function renderTreeCellContent(entry, isExpanded, expandButtonProps, content) {
|
|
|
173
219
|
function TableView(props) {
|
|
174
220
|
const { qa, rows, rowKeys, getRowKey, layout, columnHeaderPaths, onScrollerRef, rootRef, size = "medium", shape = "plain", rowSize, rowHeight, headerHeight, isHeaderHidden = false, isStriped = false, hasColumnDividers, isRowMoveAnimated = true, isHeaderSticky = true, isAutoHeight = false, isVirtualized = "auto", virtualizeThreshold = 50, overscan = 20, isLoading = false, loadingIndicator = "overlay", skeletonRowCount = 6, selection, selectionTooltip, overlay, rowMenu, rowContextMenu = false, onRowMenuAction, rowMenuTriggerProps, rowLink, onRowAction, onLoadMore, hasMore = false, isLoadingMore = false, loadMoreMargin, pinnedTopRows, pinnedBottomRows, cellSelection, rowNumberOffset = 0, rowIndexOffset = 0, totalRowCount, tree, isReorderable = false, dragState, dropState, collectionProps, isColumnReorderable = false, columnDragState, columnDropState, headCollectionProps, headRowRef, onColumnFocus, bodyRef, isResizable = false, onColumnResize, onColumnResizeEnd, emptyLabel, noResultsLabel, error, isFiltered = false, sortMode = "off", sort, sorts, onColumnSort, onColumnSortChange, columnContextMenu = true, onColumnMenuAction, columnMenuTriggerProps, columnMenuProps, getRowProps, headerPreset, contentPreset, toolbar, footer, ariaLabel, styles, headerStyles, headerCellStyles, bodyStyles, rowStyles, cellStyles, mods } = props;
|
|
175
221
|
const { columns } = layout;
|
|
222
|
+
useGlobalStyles(NATIVE_CELL_CONTROL_SELECTOR, rowLink ? NATIVE_CELL_CONTROL_STYLES : void 0);
|
|
176
223
|
const columnCount = columns.length;
|
|
177
224
|
const headerGroupDepth = columns.reduce((depth, column) => Math.max(depth, columnHeaderPaths?.get(column.key)?.length ?? 0), 0);
|
|
178
225
|
/**
|
|
@@ -501,15 +548,21 @@ function TableView(props) {
|
|
|
501
548
|
style: pinStyle(column),
|
|
502
549
|
children: isMenuEmpty(items) ? null : /* @__PURE__ */ jsx("div", {
|
|
503
550
|
"data-element": "RowActions",
|
|
504
|
-
children: /* @__PURE__ */ jsxs(_MenuTrigger, {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
551
|
+
children: /* @__PURE__ */ jsxs(_MenuTrigger, {
|
|
552
|
+
isDisabled: selection?.isRowDisabled(rowKey),
|
|
553
|
+
shouldRestoreFocus: tree ? void 0 : false,
|
|
554
|
+
onOpenChange: tree ? void 0 : (isOpen) => handleRowMenuOpenChange(isOpen, rowKey, rowIndex),
|
|
555
|
+
children: [/* @__PURE__ */ jsx(ItemAction, {
|
|
556
|
+
tabIndex: !tree && tabStopRow?.key === rowKey ? 0 : -1,
|
|
557
|
+
icon: /* @__PURE__ */ jsx(MoreIcon, {}),
|
|
558
|
+
"aria-label": t("itemTable.rowActions", "Row actions"),
|
|
559
|
+
...rowMenuTriggerProps,
|
|
560
|
+
isDisabled: selection?.isRowDisabled(rowKey) || rowMenuTriggerProps?.isDisabled
|
|
561
|
+
}), /* @__PURE__ */ jsx(__Menu, {
|
|
562
|
+
onAction: menuActionHandler(row, rowKey, false),
|
|
563
|
+
children: items
|
|
564
|
+
})]
|
|
565
|
+
})
|
|
513
566
|
})
|
|
514
567
|
}, `column-cell:${column.key}`);
|
|
515
568
|
}
|
|
@@ -612,7 +665,7 @@ function TableView(props) {
|
|
|
612
665
|
} : void 0
|
|
613
666
|
};
|
|
614
667
|
}
|
|
615
|
-
function renderCell(column, row, rowIndex, rowKey, isLastRow, pinnedEdge, treeItemAria) {
|
|
668
|
+
function renderCell(column, row, rowIndex, rowKey, isLastRow, pinnedEdge, treeItemAria, nativeLinkProps) {
|
|
616
669
|
const rangeKey = selectionRowKey(sectionOf(pinnedEdge), rowKey);
|
|
617
670
|
if (column.key === "__cube-selection__") return renderSelectionCell(column, row, rowIndex, rowKey, isLastRow, pinnedEdge);
|
|
618
671
|
if (column.key === "__cube-row-number__") return /* @__PURE__ */ jsx("td", {
|
|
@@ -640,13 +693,13 @@ function TableView(props) {
|
|
|
640
693
|
isSelected: selection?.isSelected(rowKey) ?? false,
|
|
641
694
|
tree: pinnedEdge == null ? treeRowState(rowIndex) : void 0
|
|
642
695
|
};
|
|
643
|
-
const content = renderCellContent(column, row, rowIndex, ctx);
|
|
696
|
+
const content = renderCellContent(column, row, rowIndex, ctx, nativeLinkProps);
|
|
644
697
|
const treeEntry = pinnedEdge == null ? tree?.entries[rowIndex] : void 0;
|
|
645
698
|
const displayContent = treeEntry && column.key === tree?.columnKey ? renderTreeCellContent(treeEntry, tree.state.expandedKeys.has(treeEntry.key), treeItemAria?.expandButtonProps, content) : content;
|
|
646
699
|
const columnClassName = columnCellClassName(typeof column.cellStyles === "function" ? column.cellStyles(ctx) : column.cellStyles);
|
|
647
700
|
const extraCellProps = column.cellProps?.(ctx);
|
|
648
701
|
const CellTag = column.isRowHeader ? "th" : "td";
|
|
649
|
-
const
|
|
702
|
+
const isLinkedHeader = column.isRowHeader && nativeLinkProps !== void 0;
|
|
650
703
|
return /* @__PURE__ */ jsxs(CellTag, {
|
|
651
704
|
"data-element": "Cell",
|
|
652
705
|
"data-key": column.key,
|
|
@@ -654,7 +707,7 @@ function TableView(props) {
|
|
|
654
707
|
"data-pin-edge": column.isPinEdge ? "" : void 0,
|
|
655
708
|
"data-align": column.align,
|
|
656
709
|
"data-wrap": column.autoHeight ? "" : void 0,
|
|
657
|
-
"data-link":
|
|
710
|
+
"data-link": isLinkedHeader ? "" : void 0,
|
|
658
711
|
"data-last-row": isLastRow ? "" : void 0,
|
|
659
712
|
"data-pinned": pinnedEdge,
|
|
660
713
|
"data-odd": cellBandFlag(rowIndex, pinnedEdge),
|
|
@@ -669,9 +722,9 @@ function TableView(props) {
|
|
|
669
722
|
style: pinStyle(column),
|
|
670
723
|
...extraCellProps,
|
|
671
724
|
className: clsx(columnClassName, extraCellProps?.className) || void 0,
|
|
672
|
-
children: [displayContent,
|
|
725
|
+
children: [displayContent, isLinkedHeader ? /* @__PURE__ */ jsx("a", {
|
|
726
|
+
...nativeLinkProps,
|
|
673
727
|
"data-element": "RowLink",
|
|
674
|
-
to: link,
|
|
675
728
|
tabIndex: -1,
|
|
676
729
|
"aria-label": getColumnText(column, row, rowIndex) ?? void 0
|
|
677
730
|
}) : null]
|
|
@@ -687,18 +740,23 @@ function TableView(props) {
|
|
|
687
740
|
*/
|
|
688
741
|
function renderPinnedRow(row, index, edge) {
|
|
689
742
|
const rowKey = getRowKey(row, index);
|
|
690
|
-
|
|
743
|
+
const render = (nativeLinkProps) => /* @__PURE__ */ jsx("tr", {
|
|
691
744
|
"data-element": "Row",
|
|
692
745
|
"data-pinned": edge,
|
|
693
746
|
role: "row",
|
|
694
747
|
"aria-rowindex": pinnedRowIndex(index, edge),
|
|
695
|
-
children: bodyColumns.map((segment) => segment.column ? renderCell(segment.column, row, index, rowKey, false, edge) : renderColumnSpacer(segment.key, segment.span, edge))
|
|
748
|
+
children: bodyColumns.map((segment) => segment.column ? renderCell(segment.column, row, index, rowKey, false, edge, void 0, nativeLinkProps) : renderColumnSpacer(segment.key, segment.span, edge))
|
|
749
|
+
}, `pinned-${edge}-${rowKey}`);
|
|
750
|
+
const link = !hasRowLinkColumn || selection?.isRowDisabled(rowKey) ? void 0 : rowLink?.(row, index);
|
|
751
|
+
return /* @__PURE__ */ jsx(TableRowLink, {
|
|
752
|
+
to: link,
|
|
753
|
+
children: render
|
|
696
754
|
}, `pinned-${edge}-${rowKey}`);
|
|
697
755
|
}
|
|
698
756
|
/** The cells of one body row. Shared by both render paths. */
|
|
699
|
-
function renderRowCells(row, rowIndex, treeItemAria) {
|
|
757
|
+
function renderRowCells(row, rowIndex, treeItemAria, nativeLinkProps) {
|
|
700
758
|
const rowKey = bodyRowKey(row, rowIndex);
|
|
701
|
-
return bodyColumns.map((segment) => segment.column ? renderCell(segment.column, row, rowIndex, rowKey, rowIndex === rows.length - 1, void 0, treeItemAria) : renderColumnSpacer(segment.key, segment.span, void 0, rowIndex === rows.length - 1));
|
|
759
|
+
return bodyColumns.map((segment) => segment.column ? renderCell(segment.column, row, rowIndex, rowKey, rowIndex === rows.length - 1, void 0, treeItemAria, nativeLinkProps) : renderColumnSpacer(segment.key, segment.span, void 0, rowIndex === rows.length - 1));
|
|
702
760
|
}
|
|
703
761
|
/**
|
|
704
762
|
* The `<tr>` shell. Virtuoso owns the element in the virtualized path (it
|
|
@@ -708,6 +766,7 @@ function TableView(props) {
|
|
|
708
766
|
function getRowElementProps(row, rowIndex) {
|
|
709
767
|
const rowKey = bodyRowKey(row, rowIndex);
|
|
710
768
|
const isSelected = selection?.isSelected(rowKey) ?? false;
|
|
769
|
+
const isDisabled = selection?.isRowDisabled(rowKey) ?? false;
|
|
711
770
|
const ctx = {
|
|
712
771
|
row,
|
|
713
772
|
rowKey,
|
|
@@ -725,19 +784,20 @@ function TableView(props) {
|
|
|
725
784
|
"data-odd": isStriped && rowIndex % 2 === 1 ? "" : void 0,
|
|
726
785
|
"data-dimmed": extra?.isDimmed ? "" : void 0,
|
|
727
786
|
"data-selected": isSelected ? "" : void 0,
|
|
728
|
-
"data-disabled":
|
|
787
|
+
"data-disabled": isDisabled ? "" : void 0,
|
|
729
788
|
role: "row",
|
|
730
|
-
tabIndex: !
|
|
789
|
+
tabIndex: hasFlatRowNavigation ? !isDisabled && rowKey === tabStopRow?.key ? 0 : -1 : void 0,
|
|
731
790
|
"aria-selected": selection?.isEnabled ? isSelected : void 0,
|
|
791
|
+
"aria-disabled": isDisabled || void 0,
|
|
732
792
|
"aria-rowindex": bodyRowIndex(rowIndex),
|
|
733
793
|
title: extra?.tooltip,
|
|
734
794
|
height: extra?.height,
|
|
735
|
-
"data-clickable": onRowAction != null || rowLink?.(row, rowIndex) !== void 0 ? "" : void 0,
|
|
795
|
+
"data-clickable": !isDisabled && (onRowAction != null || hasRowLinkColumn && rowLink?.(row, rowIndex) !== void 0) ? "" : void 0,
|
|
736
796
|
onClick: onRowAction != null ? (event) => {
|
|
737
|
-
if (event.target
|
|
797
|
+
if (isDisabled || isCellControl(event.target, event.currentTarget)) return;
|
|
738
798
|
onRowAction(row, rowKey);
|
|
739
799
|
} : void 0,
|
|
740
|
-
onContextMenu: isMenuEnabled ? (event) => openContextMenuFor(row, rowIndex, rowKey, event) : void 0,
|
|
800
|
+
onContextMenu: isMenuEnabled && !isDisabled ? (event) => openContextMenuFor(row, rowIndex, rowKey, event) : void 0,
|
|
741
801
|
...Object.fromEntries(Object.entries(extra?.mods ?? {}).filter(([, active]) => active).map(([name]) => [`data-${name}`, ""]))
|
|
742
802
|
};
|
|
743
803
|
}
|
|
@@ -746,7 +806,7 @@ function TableView(props) {
|
|
|
746
806
|
const rowKey = bodyRowKey(row, rowIndex);
|
|
747
807
|
const treeNode = tree?.nodes[rowIndex];
|
|
748
808
|
const treeEntry = tree?.entries[rowIndex];
|
|
749
|
-
|
|
809
|
+
const render = (nativeLinkProps) => /* @__PURE__ */ jsx(TableRow, {
|
|
750
810
|
rowKey,
|
|
751
811
|
rowProps,
|
|
752
812
|
height,
|
|
@@ -760,7 +820,12 @@ function TableView(props) {
|
|
|
760
820
|
entry: treeEntry,
|
|
761
821
|
isVirtualized: isVirtual
|
|
762
822
|
} : void 0,
|
|
763
|
-
children: (treeItemAria) => renderRowCells(row, rowIndex, treeItemAria)
|
|
823
|
+
children: (treeItemAria) => renderRowCells(row, rowIndex, treeItemAria, nativeLinkProps)
|
|
824
|
+
}, rowProps["data-key"]);
|
|
825
|
+
const link = !hasRowLinkColumn || selection?.isRowDisabled(rowKey) ? void 0 : rowLink?.(row, rowIndex);
|
|
826
|
+
return /* @__PURE__ */ jsx(TableRowLink, {
|
|
827
|
+
to: link,
|
|
828
|
+
children: render
|
|
764
829
|
}, rowProps["data-key"]);
|
|
765
830
|
}
|
|
766
831
|
function renderSpacerRow(height, position) {
|
|
@@ -820,6 +885,7 @@ function TableView(props) {
|
|
|
820
885
|
measureElement: (element) => element.getBoundingClientRect().height,
|
|
821
886
|
overscan
|
|
822
887
|
});
|
|
888
|
+
const virtualItems = shouldVirtualize ? virtualizer.getVirtualItems() : [];
|
|
823
889
|
useLayoutEffect(() => {
|
|
824
890
|
virtualizer.measure();
|
|
825
891
|
virtualizer.getTotalSize();
|
|
@@ -881,7 +947,80 @@ function TableView(props) {
|
|
|
881
947
|
rowCountBeforeFetchRef.current = null;
|
|
882
948
|
}, [isLoadingMore]);
|
|
883
949
|
const loadMoreSkeletonCount = Math.min(Math.max(lastBatchSizeRef.current || rows.length || skeletonRowCount, 1), MAX_LOAD_MORE_SKELETON_ROWS);
|
|
884
|
-
const
|
|
950
|
+
const isMenuEnabled = rowMenu != null && rowContextMenu !== false;
|
|
951
|
+
const hasRowLinkColumn = columns.some((column) => column.isRowHeader);
|
|
952
|
+
const hasFlatRowNavigation = !tree && (isReorderable || rowLink != null && hasRowLinkColumn || onRowAction != null || isMenuEnabled);
|
|
953
|
+
const [focusedRow, setFocusedRow] = useState({
|
|
954
|
+
key: null,
|
|
955
|
+
index: 0
|
|
956
|
+
});
|
|
957
|
+
const pendingRowFocus = useRef(null);
|
|
958
|
+
const ownedRow = useRef(null);
|
|
959
|
+
const menuOrigin = useRef(null);
|
|
960
|
+
function focusableRowFrom(index, direction) {
|
|
961
|
+
for (; index >= 0 && index < rows.length; index += direction) {
|
|
962
|
+
const row = rows[index];
|
|
963
|
+
const key = bodyRowKey(row, index);
|
|
964
|
+
if (selection?.isRowDisabled(key)) continue;
|
|
965
|
+
if (isReorderable || onRowAction != null || hasRowLinkColumn && rowLink?.(row, index) !== void 0 || isMenuEnabled && !isMenuEmpty(resolveRowMenu(row, index, key))) return {
|
|
966
|
+
key,
|
|
967
|
+
index
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
return null;
|
|
971
|
+
}
|
|
972
|
+
function rowIndexForKey(key) {
|
|
973
|
+
return selection?.collection.indexOf(key) ?? rows.findIndex((row, index) => bodyRowKey(row, index) === key);
|
|
974
|
+
}
|
|
975
|
+
const focusedRowIndex = focusedRow.key == null ? -1 : rowIndexForKey(focusedRow.key);
|
|
976
|
+
const restingIndex = focusedRowIndex >= 0 ? focusedRowIndex : Math.min(focusedRow.index, rows.length - 1);
|
|
977
|
+
const restingRow = hasFlatRowNavigation ? focusableRowFrom(Math.max(restingIndex, 0), 1) ?? focusableRowFrom(restingIndex, -1) : null;
|
|
978
|
+
const tabStopRow = flatRowTabStop(restingRow, shouldVirtualize && virtualItems.length && hasFlatRowNavigation ? focusableRowFrom(virtualizer.range?.startIndex ?? virtualItems[0].index, 1) : null, shouldVirtualize ? virtualItems : void 0, virtualizer.range);
|
|
979
|
+
function mountedRow(key) {
|
|
980
|
+
return Array.from(localBodyRef.current?.querySelectorAll("tr[data-element=\"Row\"][data-key]") ?? []).find((element) => element.dataset.key === String(key));
|
|
981
|
+
}
|
|
982
|
+
function focusFlatRow(next) {
|
|
983
|
+
if (!next) return;
|
|
984
|
+
pendingRowFocus.current = next.key;
|
|
985
|
+
setFocusedRow((current) => current.key === next.key && current.index === next.index ? current : next);
|
|
986
|
+
selection?.selectionManager.setFocusedKey(next.key);
|
|
987
|
+
if (shouldVirtualize) {
|
|
988
|
+
const offset = virtualizer.getOffsetForIndex(next.index, "auto")?.[0];
|
|
989
|
+
if (offset != null) virtualizer.scrollToOffset(offset);
|
|
990
|
+
}
|
|
991
|
+
const target = mountedRow(next.key);
|
|
992
|
+
if (target) {
|
|
993
|
+
pendingRowFocus.current = null;
|
|
994
|
+
ownedRow.current = target;
|
|
995
|
+
target.focus({ preventScroll: shouldVirtualize });
|
|
996
|
+
if (scrollerRef.current) revealFocusedRow(target, scrollerRef.current, isHeaderSticky);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
useLayoutEffect(() => {
|
|
1000
|
+
if (!hasFlatRowNavigation) return;
|
|
1001
|
+
const previous = ownedRow.current;
|
|
1002
|
+
const active = document.activeElement;
|
|
1003
|
+
if (active && active !== document.body && !scrollerRef.current?.contains(active)) {
|
|
1004
|
+
pendingRowFocus.current = null;
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
const wasUnmounted = pendingRowFocus.current == null && previous && !previous.isConnected;
|
|
1008
|
+
if (wasUnmounted && focusedRowIndex >= 0) {
|
|
1009
|
+
ownedRow.current = null;
|
|
1010
|
+
scrollerRef.current?.focus({ preventScroll: true });
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
const wasRemoved = wasUnmounted && focusedRowIndex < 0;
|
|
1014
|
+
if (pendingRowFocus.current == null && !wasRemoved) return;
|
|
1015
|
+
const previousIndex = wasRemoved ? Number(previous.dataset.rowIndex) : restingRow?.index ?? 0;
|
|
1016
|
+
const next = wasRemoved ? focusableRowFrom(Math.min(previousIndex, rows.length - 1), 1) ?? focusableRowFrom(Math.min(previousIndex, rows.length - 1), -1) : restingRow;
|
|
1017
|
+
if (next) focusFlatRow(next);
|
|
1018
|
+
else {
|
|
1019
|
+
pendingRowFocus.current = null;
|
|
1020
|
+
ownedRow.current = null;
|
|
1021
|
+
scrollerRef.current?.focus({ preventScroll: true });
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
885
1024
|
const [isRangeDragging, setIsRangeDragging] = useState(false);
|
|
886
1025
|
useEffect(() => {
|
|
887
1026
|
if (!isRangeDragging) return;
|
|
@@ -896,16 +1035,11 @@ function TableView(props) {
|
|
|
896
1035
|
window.removeEventListener("pointercancel", end);
|
|
897
1036
|
};
|
|
898
1037
|
}, [isRangeDragging, cellSelection]);
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
const next = Math.min(Math.max((index === -1 ? focusedRowIndex : index) + delta, 0), all.length - 1);
|
|
905
|
-
setFocusedRowIndex(next);
|
|
906
|
-
all[next]?.focus();
|
|
907
|
-
return true;
|
|
908
|
-
});
|
|
1038
|
+
function moveRowFocus(index, key) {
|
|
1039
|
+
const logicalIndex = pendingRowFocus.current == null ? index : rowIndexForKey(pendingRowFocus.current);
|
|
1040
|
+
const direction = key === "ArrowUp" || key === "End" ? -1 : 1;
|
|
1041
|
+
focusFlatRow(focusableRowFrom(key === "Home" ? 0 : key === "End" ? rows.length - 1 : logicalIndex + direction, direction));
|
|
1042
|
+
}
|
|
909
1043
|
const sentinelRef = useRef(null);
|
|
910
1044
|
const onLoadMoreEvent = useEvent(() => onLoadMore?.());
|
|
911
1045
|
useEffect(() => {
|
|
@@ -930,7 +1064,44 @@ function TableView(props) {
|
|
|
930
1064
|
rows.length
|
|
931
1065
|
]);
|
|
932
1066
|
const contextMenu = useContextMenu(__Menu, { placement: "bottom start" });
|
|
933
|
-
|
|
1067
|
+
function rememberRowMenuOrigin(key, index, isContextMenu = false) {
|
|
1068
|
+
menuOrigin.current = {
|
|
1069
|
+
key,
|
|
1070
|
+
index,
|
|
1071
|
+
isContextMenu,
|
|
1072
|
+
target: document.activeElement instanceof HTMLElement ? document.activeElement : null
|
|
1073
|
+
};
|
|
1074
|
+
const element = mountedRow(key);
|
|
1075
|
+
if (element) ownedRow.current = element;
|
|
1076
|
+
setFocusedRow({
|
|
1077
|
+
key,
|
|
1078
|
+
index
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
const restoreRowMenuFocus = useEvent(() => {
|
|
1082
|
+
const origin = menuOrigin.current;
|
|
1083
|
+
menuOrigin.current = null;
|
|
1084
|
+
if (!origin) return;
|
|
1085
|
+
const active = document.activeElement;
|
|
1086
|
+
if (active instanceof HTMLElement && active !== document.body && active.isConnected && active !== origin.target && !active.closest("[role=\"menu\"]")) return;
|
|
1087
|
+
if (origin.target?.isConnected && !selection?.isRowDisabled(origin.key)) origin.target.focus();
|
|
1088
|
+
else {
|
|
1089
|
+
const currentIndex = rowIndexForKey(origin.key);
|
|
1090
|
+
const index = currentIndex >= 0 ? currentIndex : Math.min(origin.index, rows.length - 1);
|
|
1091
|
+
const next = focusableRowFrom(index, 1) ?? focusableRowFrom(index, -1);
|
|
1092
|
+
if (next) focusFlatRow(next);
|
|
1093
|
+
else scrollerRef.current?.focus({ preventScroll: true });
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
function handleRowMenuOpenChange(isOpen, key, index) {
|
|
1097
|
+
if (isOpen) rememberRowMenuOrigin(key, index);
|
|
1098
|
+
else restoreRowMenuFocus();
|
|
1099
|
+
}
|
|
1100
|
+
useEffect(() => {
|
|
1101
|
+
if (contextMenu.isOpen || !menuOrigin.current?.isContextMenu) return;
|
|
1102
|
+
contextMenu.close();
|
|
1103
|
+
restoreRowMenuFocus();
|
|
1104
|
+
}, [contextMenu, restoreRowMenuFocus]);
|
|
934
1105
|
function resolveRowMenu(row, rowIndex, rowKey) {
|
|
935
1106
|
if (!rowMenu) return null;
|
|
936
1107
|
return rowMenu(row, {
|
|
@@ -943,20 +1114,29 @@ function TableView(props) {
|
|
|
943
1114
|
isDropTarget: false
|
|
944
1115
|
});
|
|
945
1116
|
}
|
|
1117
|
+
const notifyRowMenuAction = useEvent((action, row, rowKey) => {
|
|
1118
|
+
const index = rowIndexForKey(rowKey);
|
|
1119
|
+
onRowMenuAction?.(normalizeMenuAction(action), index >= 0 ? rows[index] : row, rowKey);
|
|
1120
|
+
});
|
|
946
1121
|
function menuActionHandler(row, rowKey, closeAfter) {
|
|
947
1122
|
return (action) => {
|
|
948
|
-
|
|
1123
|
+
notifyRowMenuAction(action, row, rowKey);
|
|
949
1124
|
if (closeAfter) contextMenu.close();
|
|
950
1125
|
};
|
|
951
1126
|
}
|
|
952
1127
|
const openContextMenuFor = useEvent((row, rowIndex, rowKey, event) => {
|
|
953
1128
|
const items = resolveRowMenu(row, rowIndex, rowKey);
|
|
954
|
-
if (isMenuEmpty(items)) return;
|
|
1129
|
+
if (selection?.isRowDisabled(rowKey) || isMenuEmpty(items)) return;
|
|
955
1130
|
event.preventDefault();
|
|
1131
|
+
if (!tree) rememberRowMenuOrigin(rowKey, rowIndex, true);
|
|
1132
|
+
const rect = mountedRow(rowKey)?.getBoundingClientRect();
|
|
956
1133
|
contextMenu.open({
|
|
957
1134
|
children: items,
|
|
958
1135
|
onAction: menuActionHandler(row, rowKey, true)
|
|
959
|
-
}, void 0, "clientX" in event.nativeEvent ? event.nativeEvent :
|
|
1136
|
+
}, tree ? void 0 : { shouldRestoreFocus: false }, "clientX" in event.nativeEvent ? event.nativeEvent : new MouseEvent("contextmenu", {
|
|
1137
|
+
clientX: rect ? rect.left + rect.width / 2 : 0,
|
|
1138
|
+
clientY: rect ? rect.top + rect.height / 2 : 0
|
|
1139
|
+
}));
|
|
960
1140
|
});
|
|
961
1141
|
const columnMenu = useColumnMenu({
|
|
962
1142
|
contextMenu,
|
|
@@ -969,17 +1149,41 @@ function TableView(props) {
|
|
|
969
1149
|
/** Resolves the row a pointer or keyboard event landed in. */
|
|
970
1150
|
function rowFromEvent(target) {
|
|
971
1151
|
const element = target?.closest?.("tr[data-element=\"Row\"][data-key]");
|
|
972
|
-
if (!element) return null;
|
|
1152
|
+
if (!element || element.parentElement !== localBodyRef.current) return null;
|
|
973
1153
|
const index = Number(element.getAttribute("data-row-index"));
|
|
974
1154
|
if (!Number.isInteger(index)) return null;
|
|
975
1155
|
const row = rows[index];
|
|
976
1156
|
return row === void 0 ? null : {
|
|
977
1157
|
row,
|
|
978
1158
|
index,
|
|
979
|
-
key: bodyRowKey(row, index)
|
|
1159
|
+
key: bodyRowKey(row, index),
|
|
1160
|
+
element
|
|
980
1161
|
};
|
|
981
1162
|
}
|
|
982
|
-
|
|
1163
|
+
function handleFlatRowNavigation(event, found) {
|
|
1164
|
+
if (!hasFlatRowNavigation || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || dragState?.draggingKeys?.size) return false;
|
|
1165
|
+
if (![
|
|
1166
|
+
"ArrowDown",
|
|
1167
|
+
"ArrowUp",
|
|
1168
|
+
"Home",
|
|
1169
|
+
"End"
|
|
1170
|
+
].includes(event.key)) return false;
|
|
1171
|
+
const target = event.target;
|
|
1172
|
+
if (target === event.currentTarget) switch (event.key) {
|
|
1173
|
+
case "Home":
|
|
1174
|
+
focusFlatRow(focusableRowFrom(0, 1));
|
|
1175
|
+
break;
|
|
1176
|
+
case "End":
|
|
1177
|
+
focusFlatRow(focusableRowFrom(rows.length - 1, -1));
|
|
1178
|
+
break;
|
|
1179
|
+
default: focusFlatRow(tabStopRow ?? restingRow);
|
|
1180
|
+
}
|
|
1181
|
+
else if (found && target === found.element) moveRowFocus(found.index, event.key);
|
|
1182
|
+
else if (event.key === "ArrowDown" && target.matches("th[data-element=\"HeaderCell\"]")) focusFlatRow(tabStopRow ?? restingRow);
|
|
1183
|
+
else return false;
|
|
1184
|
+
event.preventDefault();
|
|
1185
|
+
return true;
|
|
1186
|
+
}
|
|
983
1187
|
const paddingTop = virtualItems.length ? virtualItems[0].start : 0;
|
|
984
1188
|
const paddingBottom = virtualItems.length ? virtualizer.getTotalSize() - virtualItems[virtualItems.length - 1].end : 0;
|
|
985
1189
|
const colGroup = /* @__PURE__ */ jsx("colgroup", { children: columns.map((column) => /* @__PURE__ */ jsx("col", { style: column.width != null ? { width: column.width } : void 0 }, column.key)) });
|
|
@@ -1143,24 +1347,68 @@ function TableView(props) {
|
|
|
1143
1347
|
/* @__PURE__ */ jsx("div", {
|
|
1144
1348
|
"data-element": "Scroller",
|
|
1145
1349
|
ref: handleScrollerRef,
|
|
1146
|
-
tabIndex: cellSelection?.isEnabled
|
|
1350
|
+
tabIndex: scrollerTabStop(cellSelection?.isEnabled, hasFlatRowNavigation, restingRow, tabStopRow),
|
|
1351
|
+
onFocusCapture: (event) => {
|
|
1352
|
+
if (!hasFlatRowNavigation) return;
|
|
1353
|
+
const found = rowFromEvent(event.target);
|
|
1354
|
+
if (!found || selection?.isRowDisabled(found.key) || focusableRowFrom(found.index, 1)?.key !== found.key) {
|
|
1355
|
+
pendingRowFocus.current = null;
|
|
1356
|
+
ownedRow.current = null;
|
|
1357
|
+
return;
|
|
1358
|
+
}
|
|
1359
|
+
if (pendingRowFocus.current !== found.key) pendingRowFocus.current = null;
|
|
1360
|
+
ownedRow.current = found.element;
|
|
1361
|
+
setFocusedRow({
|
|
1362
|
+
key: found.key,
|
|
1363
|
+
index: found.index
|
|
1364
|
+
});
|
|
1365
|
+
selection?.selectionManager.setFocusedKey(found.key);
|
|
1366
|
+
if (event.target === found.element && getInteractionModality() !== "pointer" && scrollerRef.current) revealFocusedRow(found.element, scrollerRef.current, isHeaderSticky);
|
|
1367
|
+
},
|
|
1368
|
+
onBlurCapture: (event) => {
|
|
1369
|
+
const target = event.relatedTarget;
|
|
1370
|
+
if (target instanceof Element && !event.currentTarget.contains(target)) {
|
|
1371
|
+
pendingRowFocus.current = null;
|
|
1372
|
+
if (!target.closest("[role=\"menu\"]")) ownedRow.current = null;
|
|
1373
|
+
}
|
|
1374
|
+
},
|
|
1147
1375
|
onKeyDown: (event) => {
|
|
1376
|
+
const found = rowFromEvent(event.target);
|
|
1377
|
+
const target = event.target;
|
|
1378
|
+
const isRowTarget = found && target === found.element;
|
|
1379
|
+
if (pendingRowFocus.current != null && found && pendingRowFocus.current !== found.key && (event.key === "Enter" || event.key === "F10" && event.shiftKey)) {
|
|
1380
|
+
event.preventDefault();
|
|
1381
|
+
event.stopPropagation();
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
if (handleFlatRowNavigation(event, found)) return;
|
|
1148
1385
|
if (event.key === "F10" && event.shiftKey && isMenuEnabled) {
|
|
1149
|
-
const found = rowFromEvent(event.target);
|
|
1150
1386
|
if (found) {
|
|
1151
1387
|
event.stopPropagation();
|
|
1152
1388
|
openContextMenuFor(found.row, found.index, found.key, event);
|
|
1153
1389
|
}
|
|
1154
1390
|
return;
|
|
1155
1391
|
}
|
|
1156
|
-
if (event.key === "Enter" &&
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1392
|
+
if (event.key === "Enter" && found) {
|
|
1393
|
+
if (!selection?.isRowDisabled(found.key) && !isCellControl(target, found.element)) {
|
|
1394
|
+
if (isReorderable && isRowTarget) return;
|
|
1395
|
+
const link = found.element.querySelector("[data-element=\"RowLink\"]");
|
|
1396
|
+
if (link && !tree) {
|
|
1397
|
+
event.preventDefault();
|
|
1398
|
+
link.dispatchEvent(new MouseEvent("click", {
|
|
1399
|
+
bubbles: true,
|
|
1400
|
+
cancelable: true,
|
|
1401
|
+
button: 0,
|
|
1402
|
+
altKey: event.altKey,
|
|
1403
|
+
ctrlKey: event.ctrlKey,
|
|
1404
|
+
metaKey: event.metaKey,
|
|
1405
|
+
shiftKey: event.shiftKey
|
|
1406
|
+
}));
|
|
1407
|
+
} else if (onRowAction) {
|
|
1408
|
+
event.preventDefault();
|
|
1409
|
+
onRowAction(found.row, found.key);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1164
1412
|
return;
|
|
1165
1413
|
}
|
|
1166
1414
|
if (event.key === "Escape") {
|