@cube-dev/ui-kit 0.157.3 → 0.159.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +155 -0
- package/dist/_internal/hooks/use-chained-callback.js +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 +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 +10 -4
- package/dist/components/actions/Button/Button.js.map +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/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.d.ts +7 -0
- package/dist/components/content/Item/Item.js +13 -6
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.d.ts +14 -14
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +41 -32
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +82 -24
- package/dist/components/data/DataTable/DataTable.js.map +1 -1
- package/dist/components/data/DataTable/types.d.ts +56 -1
- package/dist/components/data/ItemTable/ItemTable.js +13 -5
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +3 -7
- package/dist/components/data/ItemTable/ItemTableBulkBar.js.map +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/types.d.ts +19 -0
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +5 -3
- package/dist/components/data/TableBase/RowCollection.js.map +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +115 -0
- package/dist/components/data/TableBase/TableHeaderCell.js.map +1 -0
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +195 -33
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/column-menu.d.ts +36 -0
- package/dist/components/data/TableBase/column-menu.js +104 -0
- package/dist/components/data/TableBase/column-menu.js.map +1 -0
- package/dist/components/data/TableBase/column-tint.js +168 -0
- package/dist/components/data/TableBase/column-tint.js.map +1 -0
- package/dist/components/data/TableBase/index.d.ts +3 -2
- package/dist/components/data/TableBase/row-menu.js +11 -6
- package/dist/components/data/TableBase/row-menu.js.map +1 -1
- package/dist/components/data/TableBase/styled.js +45 -16
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/types.d.ts +104 -6
- 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-order.js +100 -0
- package/dist/components/data/TableBase/use-column-order.js.map +1 -0
- 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 +24 -2
- package/dist/components/data/TableBase/use-table-columns.js.map +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 +20 -1
- package/dist/components/data/TableBase/use-table-sort.js.map +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +40 -1
- package/dist/components/data/TableBase/use-table-sorts.js.map +1 -1
- package/dist/components/data/TableBase/use-table-storage.d.ts +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +6 -2
- package/dist/components/data/TableBase/use-table-storage.js.map +1 -1
- package/dist/components/data/index.d.ts +2 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/ColorSwatch.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/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/index.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/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.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/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +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/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +13 -1
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +5 -1
- package/dist/i18n/locales/en-US/uikit.js +5 -1
- package/dist/i18n/locales/en-US/uikit.json.d.ts +4 -0
- package/dist/i18n/locales/es-ES/uikit.js +5 -1
- package/dist/i18n/locales/es-MX/uikit.js +5 -1
- package/dist/i18n/locales/fr-FR/uikit.js +5 -1
- package/dist/i18n/locales/it-IT/uikit.js +5 -1
- package/dist/i18n/locales/ja-JP/uikit.js +5 -1
- package/dist/i18n/locales/nb-NO/uikit.js +5 -1
- package/dist/i18n/locales/pt-BR/uikit.js +5 -1
- package/dist/i18n/locales/pt-PT/uikit.js +5 -1
- package/dist/i18n/locales/sv-SE/uikit.js +5 -1
- package/dist/i18n/locales/vi-VN/uikit.js +5 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.d.ts +12 -0
- package/dist/icons/ArrowNarrowDownIcon.js +11 -0
- package/dist/icons/ArrowNarrowDownIcon.js.map +1 -0
- package/dist/icons/ArrowNarrowUpIcon.d.ts +12 -0
- package/dist/icons/ArrowNarrowUpIcon.js +11 -0
- package/dist/icons/ArrowNarrowUpIcon.js.map +1 -0
- 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/index.d.ts +2 -0
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-theme.d.ts +86 -0
- package/dist/tokens/color-theme.js +156 -0
- package/dist/tokens/color-theme.js.map +1 -0
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +2 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/palette-config.d.ts +1 -1
- package/dist/tokens/palette-config.js +17 -5
- package/dist/tokens/palette-config.js.map +1 -1
- package/dist/tokens/palette.d.ts +1 -1
- package/dist/tokens/palette.js +44 -2
- package/dist/tokens/palette.js.map +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/index.d.ts +1 -0
- 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.d.ts +49 -0
- package/dist/utils/react/disabledProps.js +82 -0
- package/dist/utils/react/disabledProps.js.map +1 -0
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.d.ts +1 -0
- package/dist/utils/react/index.js +2 -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/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/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/Theming.md +20 -13
- package/docs/components/actions/Button.md +17 -0
- package/docs/components/content/Item.md +8 -1
- package/docs/components/data/DataTable.md +118 -2
- package/docs/components/data/ItemTable.md +37 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { RendererPrism, ensureYamlSqlExtensions } from "./prismSetup.js";
|
|
3
3
|
import { CONTAINER_STYLES, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { wrapNodeIfPlain } from "../../../utils/react/wrapNodeIfPlain.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { Space } from "../../layout/Space.js";
|
|
3
3
|
import { Grid } from "../../layout/Grid.js";
|
|
4
4
|
import { Flow } from "../../layout/Flow.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { _Item } from "../Item/Item.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { CloseIcon } from "../../../icons/CloseIcon.js";
|
|
@@ -140,7 +140,7 @@ declare const MinorText: react.ComponentType<{
|
|
|
140
140
|
accessKey?: string | undefined;
|
|
141
141
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
142
142
|
autoFocus?: boolean | undefined;
|
|
143
|
-
contentEditable?:
|
|
143
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
144
144
|
contextMenu?: string | undefined;
|
|
145
145
|
dir?: string | undefined;
|
|
146
146
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -179,7 +179,7 @@ declare const MinorText: react.ComponentType<{
|
|
|
179
179
|
part?: string | undefined;
|
|
180
180
|
"aria-activedescendant"?: string | undefined;
|
|
181
181
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
182
|
-
"aria-autocomplete"?: "list" | "
|
|
182
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
183
183
|
"aria-braillelabel"?: string | undefined;
|
|
184
184
|
"aria-brailleroledescription"?: string | undefined;
|
|
185
185
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -546,7 +546,7 @@ declare const DangerText: react.ComponentType<{
|
|
|
546
546
|
accessKey?: string | undefined;
|
|
547
547
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
548
548
|
autoFocus?: boolean | undefined;
|
|
549
|
-
contentEditable?:
|
|
549
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
550
550
|
contextMenu?: string | undefined;
|
|
551
551
|
dir?: string | undefined;
|
|
552
552
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -585,7 +585,7 @@ declare const DangerText: react.ComponentType<{
|
|
|
585
585
|
part?: string | undefined;
|
|
586
586
|
"aria-activedescendant"?: string | undefined;
|
|
587
587
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
588
|
-
"aria-autocomplete"?: "list" | "
|
|
588
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
589
589
|
"aria-braillelabel"?: string | undefined;
|
|
590
590
|
"aria-brailleroledescription"?: string | undefined;
|
|
591
591
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -952,7 +952,7 @@ declare const SuccessText: react.ComponentType<{
|
|
|
952
952
|
accessKey?: string | undefined;
|
|
953
953
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
954
954
|
autoFocus?: boolean | undefined;
|
|
955
|
-
contentEditable?:
|
|
955
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
956
956
|
contextMenu?: string | undefined;
|
|
957
957
|
dir?: string | undefined;
|
|
958
958
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -991,7 +991,7 @@ declare const SuccessText: react.ComponentType<{
|
|
|
991
991
|
part?: string | undefined;
|
|
992
992
|
"aria-activedescendant"?: string | undefined;
|
|
993
993
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
994
|
-
"aria-autocomplete"?: "list" | "
|
|
994
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
995
995
|
"aria-braillelabel"?: string | undefined;
|
|
996
996
|
"aria-brailleroledescription"?: string | undefined;
|
|
997
997
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -1358,7 +1358,7 @@ declare const StrongText: react.ComponentType<{
|
|
|
1358
1358
|
accessKey?: string | undefined;
|
|
1359
1359
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
1360
1360
|
autoFocus?: boolean | undefined;
|
|
1361
|
-
contentEditable?:
|
|
1361
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
1362
1362
|
contextMenu?: string | undefined;
|
|
1363
1363
|
dir?: string | undefined;
|
|
1364
1364
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -1397,7 +1397,7 @@ declare const StrongText: react.ComponentType<{
|
|
|
1397
1397
|
part?: string | undefined;
|
|
1398
1398
|
"aria-activedescendant"?: string | undefined;
|
|
1399
1399
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
1400
|
-
"aria-autocomplete"?: "list" | "
|
|
1400
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
1401
1401
|
"aria-braillelabel"?: string | undefined;
|
|
1402
1402
|
"aria-brailleroledescription"?: string | undefined;
|
|
1403
1403
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -1764,7 +1764,7 @@ declare const EmphasisText: react.ComponentType<{
|
|
|
1764
1764
|
accessKey?: string | undefined;
|
|
1765
1765
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
1766
1766
|
autoFocus?: boolean | undefined;
|
|
1767
|
-
contentEditable?:
|
|
1767
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
1768
1768
|
contextMenu?: string | undefined;
|
|
1769
1769
|
dir?: string | undefined;
|
|
1770
1770
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -1803,7 +1803,7 @@ declare const EmphasisText: react.ComponentType<{
|
|
|
1803
1803
|
part?: string | undefined;
|
|
1804
1804
|
"aria-activedescendant"?: string | undefined;
|
|
1805
1805
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
1806
|
-
"aria-autocomplete"?: "list" | "
|
|
1806
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
1807
1807
|
"aria-braillelabel"?: string | undefined;
|
|
1808
1808
|
"aria-brailleroledescription"?: string | undefined;
|
|
1809
1809
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -2170,7 +2170,7 @@ declare const PlaceholderText: react.ComponentType<{
|
|
|
2170
2170
|
accessKey?: string | undefined;
|
|
2171
2171
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
2172
2172
|
autoFocus?: boolean | undefined;
|
|
2173
|
-
contentEditable?:
|
|
2173
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
2174
2174
|
contextMenu?: string | undefined;
|
|
2175
2175
|
dir?: string | undefined;
|
|
2176
2176
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -2209,7 +2209,7 @@ declare const PlaceholderText: react.ComponentType<{
|
|
|
2209
2209
|
part?: string | undefined;
|
|
2210
2210
|
"aria-activedescendant"?: string | undefined;
|
|
2211
2211
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
2212
|
-
"aria-autocomplete"?: "list" | "
|
|
2212
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
2213
2213
|
"aria-braillelabel"?: string | undefined;
|
|
2214
2214
|
"aria-brailleroledescription"?: string | undefined;
|
|
2215
2215
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -2576,7 +2576,7 @@ declare const HighlightText: react.ComponentType<{
|
|
|
2576
2576
|
accessKey?: string | undefined;
|
|
2577
2577
|
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
2578
2578
|
autoFocus?: boolean | undefined;
|
|
2579
|
-
contentEditable?:
|
|
2579
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
2580
2580
|
contextMenu?: string | undefined;
|
|
2581
2581
|
dir?: string | undefined;
|
|
2582
2582
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -2615,7 +2615,7 @@ declare const HighlightText: react.ComponentType<{
|
|
|
2615
2615
|
part?: string | undefined;
|
|
2616
2616
|
"aria-activedescendant"?: string | undefined;
|
|
2617
2617
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
2618
|
-
"aria-autocomplete"?: "list" | "
|
|
2618
|
+
"aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
|
|
2619
2619
|
"aria-braillelabel"?: string | undefined;
|
|
2620
2620
|
"aria-brailleroledescription"?: string | undefined;
|
|
2621
2621
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
4
4
|
import { BASE_STYLES, COLOR_STYLES, TEXT_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { TEXT_PROP_MAP, _Text } from "../Text.js";
|
|
4
4
|
import { highlightText } from "../highlightText.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
4
4
|
import { TEXT_PROP_MAP } from "./Text.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { _Item } from "../Item/Item.js";
|
|
3
3
|
import { Action } from "../../actions/Action/Action.js";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { TooltipProvider } from "../overlays/Tooltip/TooltipProvider.js";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -68,38 +68,46 @@ function useAutoTooltip({ tooltip, children, labelProps, isDynamicLabel = false
|
|
|
68
68
|
delete props.ref;
|
|
69
69
|
return props;
|
|
70
70
|
}, [labelProps]);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
if (typeof tooltip === "object") {
|
|
87
|
-
const { auto, ...tooltipProps } = tooltip;
|
|
88
|
-
if (tooltipProps.title && auto !== true) return /* @__PURE__ */ jsx(TooltipProvider, {
|
|
89
|
-
placement: defaultTooltipPlacement,
|
|
90
|
-
...tooltipProps,
|
|
91
|
-
children: (triggerProps, ref) => renderElement(triggerProps, ref)
|
|
92
|
-
});
|
|
93
|
-
if ((children || labelProps) && (isLabelOverflowed || isDynamicLabel)) return /* @__PURE__ */ jsx(TooltipProvider, {
|
|
94
|
-
placement: defaultTooltipPlacement,
|
|
95
|
-
title: tooltipProps.title ?? children,
|
|
96
|
-
isDisabled: !isLabelOverflowed && isDynamicLabel && tooltipProps.isDisabled !== true,
|
|
97
|
-
...tooltipProps,
|
|
98
|
-
children: (triggerProps, ref) => renderElement(triggerProps, ref)
|
|
99
|
-
});
|
|
100
|
-
}
|
|
71
|
+
/**
|
|
72
|
+
* The `TooltipProvider` props this tooltip resolves to, or `null` when no
|
|
73
|
+
* tooltip is rendered at all. Resolved once so that both the rendering below
|
|
74
|
+
* and `isTooltipActive` speak about the same tooltip.
|
|
75
|
+
*/
|
|
76
|
+
const resolvedTooltip = useMemo(() => {
|
|
77
|
+
if (!tooltip) return null;
|
|
78
|
+
if (typeof tooltip === "string") return { title: tooltip };
|
|
79
|
+
const hasAutoContent = !!(children || labelProps) && (isLabelOverflowed || isDynamicLabel);
|
|
80
|
+
if (tooltip === true) {
|
|
81
|
+
if (!hasAutoContent) return null;
|
|
82
|
+
return {
|
|
83
|
+
title: children,
|
|
84
|
+
isDisabled: !isLabelOverflowed && isDynamicLabel
|
|
85
|
+
};
|
|
101
86
|
}
|
|
102
|
-
|
|
87
|
+
const { auto, ...tooltipProps } = tooltip;
|
|
88
|
+
if (tooltipProps.title && auto !== true) return tooltipProps;
|
|
89
|
+
if (!hasAutoContent) return null;
|
|
90
|
+
return {
|
|
91
|
+
title: tooltipProps.title ?? children,
|
|
92
|
+
isDisabled: !isLabelOverflowed && isDynamicLabel && tooltipProps.isDisabled !== true,
|
|
93
|
+
...tooltipProps
|
|
94
|
+
};
|
|
95
|
+
}, [
|
|
96
|
+
tooltip,
|
|
97
|
+
children,
|
|
98
|
+
labelProps,
|
|
99
|
+
isLabelOverflowed,
|
|
100
|
+
isDynamicLabel
|
|
101
|
+
]);
|
|
102
|
+
/** Whether a tooltip is rendered and able to open. */
|
|
103
|
+
const isTooltipActive = !!resolvedTooltip && resolvedTooltip.isDisabled !== true;
|
|
104
|
+
const renderWithTooltip = (renderElement, defaultTooltipPlacement) => {
|
|
105
|
+
if (!resolvedTooltip) return renderElement();
|
|
106
|
+
return /* @__PURE__ */ jsx(TooltipProvider, {
|
|
107
|
+
placement: defaultTooltipPlacement,
|
|
108
|
+
...resolvedTooltip,
|
|
109
|
+
children: (triggerProps, ref) => renderElement(triggerProps, ref)
|
|
110
|
+
});
|
|
103
111
|
};
|
|
104
112
|
return {
|
|
105
113
|
labelRef: handleLabelElementRef,
|
|
@@ -107,6 +115,7 @@ function useAutoTooltip({ tooltip, children, labelProps, isDynamicLabel = false
|
|
|
107
115
|
isLabelOverflowed,
|
|
108
116
|
isAutoTooltipEnabled,
|
|
109
117
|
hasTooltip: !!tooltip,
|
|
118
|
+
isTooltipActive,
|
|
110
119
|
renderWithTooltip
|
|
111
120
|
};
|
|
112
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-auto-tooltip.js","names":[],"sources":["../../../src/components/content/use-auto-tooltip.tsx"],"sourcesContent":["import {\n HTMLAttributes,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { OverlayProps } from 'react-aria';\n\nimport {\n CubeTooltipProviderProps,\n TooltipProvider,\n} from '../overlays/Tooltip/TooltipProvider';\n\nimport type { Props } from '../../props';\n\nexport type AutoTooltipValue =\n | string\n | boolean\n | (Omit<CubeTooltipProviderProps, 'children'> & { auto?: boolean });\n\nexport interface UseAutoTooltipOptions {\n tooltip: AutoTooltipValue | undefined;\n children: ReactNode;\n labelProps?: Props;\n isDynamicLabel?: boolean;\n}\n\nexport function useAutoTooltip({\n tooltip,\n children,\n labelProps,\n isDynamicLabel = false,\n}: UseAutoTooltipOptions) {\n // Determine if auto tooltip is enabled\n // Auto tooltip only works when children is a string (overflow detection needs text)\n const isAutoTooltipEnabled = useMemo(() => {\n if (typeof children !== 'string') return false;\n\n // Boolean true enables auto overflow detection\n if (tooltip === true) return true;\n if (typeof tooltip === 'object') {\n // If title is provided and auto is explicitly true, enable auto overflow detection\n if (tooltip.title) {\n return tooltip.auto === true;\n }\n\n // If no title is provided, default to auto=true unless explicitly disabled\n const autoValue = tooltip.auto !== undefined ? tooltip.auto : true;\n return !!autoValue;\n }\n return false;\n }, [tooltip, children]);\n\n // Track label overflow for auto tooltip (only when enabled)\n const externalLabelRef = (labelProps as any)?.ref;\n const [isLabelOverflowed, setIsLabelOverflowed] = useState(false);\n const elementRef = useRef<HTMLElement | null>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkLabelOverflow = useCallback(() => {\n const label = elementRef.current;\n if (!label) {\n setIsLabelOverflowed(false);\n return;\n }\n\n const hasOverflow = label.scrollWidth > label.clientWidth;\n setIsLabelOverflowed(hasOverflow);\n }, []);\n\n useEffect(() => {\n if (isAutoTooltipEnabled) {\n checkLabelOverflow();\n }\n }, [isAutoTooltipEnabled, checkLabelOverflow]);\n\n // Attach ResizeObserver via callback ref to handle DOM node changes\n const handleLabelElementRef = useCallback(\n (element: HTMLElement | null) => {\n // Call external callback ref to notify external refs\n if (externalLabelRef) {\n if (typeof externalLabelRef === 'function') {\n externalLabelRef(element);\n } else {\n (externalLabelRef as any).current = element;\n }\n }\n\n // Disconnect previous observer\n if (resizeObserverRef.current) {\n try {\n resizeObserverRef.current.disconnect();\n } catch {\n // do nothing\n }\n resizeObserverRef.current = null;\n }\n\n elementRef.current = element;\n\n if (element && isAutoTooltipEnabled) {\n // Create a fresh observer to capture the latest callback\n const obs = new ResizeObserver(() => {\n checkLabelOverflow();\n });\n resizeObserverRef.current = obs;\n obs.observe(element);\n // Initial check\n checkLabelOverflow();\n } else {\n setIsLabelOverflowed(false);\n }\n },\n [externalLabelRef, isAutoTooltipEnabled, checkLabelOverflow],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n if (resizeObserverRef.current) {\n try {\n resizeObserverRef.current.disconnect();\n } catch {\n // do nothing\n }\n resizeObserverRef.current = null;\n }\n elementRef.current = null;\n };\n }, []);\n\n const finalLabelProps = useMemo(() => {\n const props = {\n ...(labelProps || {}),\n };\n\n delete props.ref;\n\n return props;\n }, [labelProps]);\n\n
|
|
1
|
+
{"version":3,"file":"use-auto-tooltip.js","names":[],"sources":["../../../src/components/content/use-auto-tooltip.tsx"],"sourcesContent":["import {\n HTMLAttributes,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { OverlayProps } from 'react-aria';\n\nimport {\n CubeTooltipProviderProps,\n TooltipProvider,\n} from '../overlays/Tooltip/TooltipProvider';\n\nimport type { Props } from '../../props';\n\nexport type AutoTooltipValue =\n | string\n | boolean\n | (Omit<CubeTooltipProviderProps, 'children'> & { auto?: boolean });\n\nexport interface UseAutoTooltipOptions {\n tooltip: AutoTooltipValue | undefined;\n children: ReactNode;\n labelProps?: Props;\n isDynamicLabel?: boolean;\n}\n\nexport function useAutoTooltip({\n tooltip,\n children,\n labelProps,\n isDynamicLabel = false,\n}: UseAutoTooltipOptions) {\n // Determine if auto tooltip is enabled\n // Auto tooltip only works when children is a string (overflow detection needs text)\n const isAutoTooltipEnabled = useMemo(() => {\n if (typeof children !== 'string') return false;\n\n // Boolean true enables auto overflow detection\n if (tooltip === true) return true;\n if (typeof tooltip === 'object') {\n // If title is provided and auto is explicitly true, enable auto overflow detection\n if (tooltip.title) {\n return tooltip.auto === true;\n }\n\n // If no title is provided, default to auto=true unless explicitly disabled\n const autoValue = tooltip.auto !== undefined ? tooltip.auto : true;\n return !!autoValue;\n }\n return false;\n }, [tooltip, children]);\n\n // Track label overflow for auto tooltip (only when enabled)\n const externalLabelRef = (labelProps as any)?.ref;\n const [isLabelOverflowed, setIsLabelOverflowed] = useState(false);\n const elementRef = useRef<HTMLElement | null>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkLabelOverflow = useCallback(() => {\n const label = elementRef.current;\n if (!label) {\n setIsLabelOverflowed(false);\n return;\n }\n\n const hasOverflow = label.scrollWidth > label.clientWidth;\n setIsLabelOverflowed(hasOverflow);\n }, []);\n\n useEffect(() => {\n if (isAutoTooltipEnabled) {\n checkLabelOverflow();\n }\n }, [isAutoTooltipEnabled, checkLabelOverflow]);\n\n // Attach ResizeObserver via callback ref to handle DOM node changes\n const handleLabelElementRef = useCallback(\n (element: HTMLElement | null) => {\n // Call external callback ref to notify external refs\n if (externalLabelRef) {\n if (typeof externalLabelRef === 'function') {\n externalLabelRef(element);\n } else {\n (externalLabelRef as any).current = element;\n }\n }\n\n // Disconnect previous observer\n if (resizeObserverRef.current) {\n try {\n resizeObserverRef.current.disconnect();\n } catch {\n // do nothing\n }\n resizeObserverRef.current = null;\n }\n\n elementRef.current = element;\n\n if (element && isAutoTooltipEnabled) {\n // Create a fresh observer to capture the latest callback\n const obs = new ResizeObserver(() => {\n checkLabelOverflow();\n });\n resizeObserverRef.current = obs;\n obs.observe(element);\n // Initial check\n checkLabelOverflow();\n } else {\n setIsLabelOverflowed(false);\n }\n },\n [externalLabelRef, isAutoTooltipEnabled, checkLabelOverflow],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n if (resizeObserverRef.current) {\n try {\n resizeObserverRef.current.disconnect();\n } catch {\n // do nothing\n }\n resizeObserverRef.current = null;\n }\n elementRef.current = null;\n };\n }, []);\n\n const finalLabelProps = useMemo(() => {\n const props = {\n ...(labelProps || {}),\n };\n\n delete props.ref;\n\n return props;\n }, [labelProps]);\n\n /**\n * The `TooltipProvider` props this tooltip resolves to, or `null` when no\n * tooltip is rendered at all. Resolved once so that both the rendering below\n * and `isTooltipActive` speak about the same tooltip.\n */\n const resolvedTooltip = useMemo<Omit<\n CubeTooltipProviderProps,\n 'children'\n > | null>(() => {\n if (!tooltip) return null;\n\n // String tooltip - simple case\n if (typeof tooltip === 'string') {\n return { title: tooltip };\n }\n\n const hasAutoContent =\n !!(children || labelProps) && (isLabelOverflowed || isDynamicLabel);\n\n // Boolean tooltip - auto tooltip on overflow\n if (tooltip === true) {\n if (!hasAutoContent) return null;\n\n return {\n title: children,\n isDisabled: !isLabelOverflowed && isDynamicLabel,\n };\n }\n\n // Object tooltip - advanced configuration\n const { auto, ...tooltipProps } = tooltip;\n\n // If title is provided and auto is not explicitly true, always show the tooltip\n if (tooltipProps.title && auto !== true) {\n return tooltipProps;\n }\n\n // If title is provided with auto=true, OR no title but auto behavior enabled\n if (!hasAutoContent) return null;\n\n return {\n title: tooltipProps.title ?? children,\n isDisabled:\n !isLabelOverflowed &&\n isDynamicLabel &&\n tooltipProps.isDisabled !== true,\n ...tooltipProps,\n };\n }, [tooltip, children, labelProps, isLabelOverflowed, isDynamicLabel]);\n\n /** Whether a tooltip is rendered and able to open. */\n const isTooltipActive =\n !!resolvedTooltip && resolvedTooltip.isDisabled !== true;\n\n const renderWithTooltip = (\n renderElement: (\n tooltipTriggerProps?: HTMLAttributes<HTMLElement>,\n tooltipRef?: RefObject<HTMLElement>,\n ) => ReactNode,\n defaultTooltipPlacement: OverlayProps['placement'],\n ) => {\n if (!resolvedTooltip) return renderElement();\n\n return (\n <TooltipProvider placement={defaultTooltipPlacement} {...resolvedTooltip}>\n {(triggerProps, ref) => renderElement(triggerProps, ref)}\n </TooltipProvider>\n );\n };\n\n return {\n labelRef: handleLabelElementRef,\n labelProps: finalLabelProps,\n isLabelOverflowed,\n isAutoTooltipEnabled,\n hasTooltip: !!tooltip,\n isTooltipActive,\n renderWithTooltip,\n };\n}\n"],"mappings":";;;;;;AA+BA,SAAgB,eAAe,EAC7B,SACA,UACA,YACA,iBAAiB,SACO;CAGxB,MAAM,uBAAuB,cAAc;AACzC,MAAI,OAAO,aAAa,SAAU,QAAO;AAGzC,MAAI,YAAY,KAAM,QAAO;AAC7B,MAAI,OAAO,YAAY,UAAU;AAE/B,OAAI,QAAQ,MACV,QAAO,QAAQ,SAAS;AAK1B,UAAO,CAAC,EADU,QAAQ,SAAS,SAAY,QAAQ,OAAO;;AAGhE,SAAO;IACN,CAAC,SAAS,SAAS,CAAC;CAGvB,MAAM,mBAAoB,YAAoB;CAC9C,MAAM,CAAC,mBAAmB,wBAAwB,SAAS,MAAM;CACjE,MAAM,aAAa,OAA2B,KAAK;CACnD,MAAM,oBAAoB,OAA8B,KAAK;CAE7D,MAAM,qBAAqB,kBAAkB;EAC3C,MAAM,QAAQ,WAAW;AACzB,MAAI,CAAC,OAAO;AACV,wBAAqB,MAAM;AAC3B;;AAIF,uBADoB,MAAM,cAAc,MAAM,YACb;IAChC,EAAE,CAAC;AAEN,iBAAgB;AACd,MAAI,qBACF,qBAAoB;IAErB,CAAC,sBAAsB,mBAAmB,CAAC;CAG9C,MAAM,wBAAwB,aAC3B,YAAgC;AAE/B,MAAI,iBACF,KAAI,OAAO,qBAAqB,WAC9B,kBAAiB,QAAQ;MAEzB,CAAC,iBAAyB,UAAU;AAKxC,MAAI,kBAAkB,SAAS;AAC7B,OAAI;AACF,sBAAkB,QAAQ,YAAY;WAChC;AAGR,qBAAkB,UAAU;;AAG9B,aAAW,UAAU;AAErB,MAAI,WAAW,sBAAsB;GAEnC,MAAM,MAAM,IAAI,qBAAqB;AACnC,wBAAoB;KACpB;AACF,qBAAkB,UAAU;AAC5B,OAAI,QAAQ,QAAQ;AAEpB,uBAAoB;QAEpB,sBAAqB,MAAM;IAG/B;EAAC;EAAkB;EAAsB;EAAmB,CAC7D;AAGD,iBAAgB;AACd,eAAa;AACX,OAAI,kBAAkB,SAAS;AAC7B,QAAI;AACF,uBAAkB,QAAQ,YAAY;YAChC;AAGR,sBAAkB,UAAU;;AAE9B,cAAW,UAAU;;IAEtB,EAAE,CAAC;CAEN,MAAM,kBAAkB,cAAc;EACpC,MAAM,QAAQ,EACZ,GAAI,cAAc,EAAE,EACrB;AAED,SAAO,MAAM;AAEb,SAAO;IACN,CAAC,WAAW,CAAC;;;;;;CAOhB,MAAM,kBAAkB,cAGR;AACd,MAAI,CAAC,QAAS,QAAO;AAGrB,MAAI,OAAO,YAAY,SACrB,QAAO,EAAE,OAAO,SAAS;EAG3B,MAAM,iBACJ,CAAC,EAAE,YAAY,gBAAgB,qBAAqB;AAGtD,MAAI,YAAY,MAAM;AACpB,OAAI,CAAC,eAAgB,QAAO;AAE5B,UAAO;IACL,OAAO;IACP,YAAY,CAAC,qBAAqB;IACnC;;EAIH,MAAM,EAAE,MAAM,GAAG,iBAAiB;AAGlC,MAAI,aAAa,SAAS,SAAS,KACjC,QAAO;AAIT,MAAI,CAAC,eAAgB,QAAO;AAE5B,SAAO;GACL,OAAO,aAAa,SAAS;GAC7B,YACE,CAAC,qBACD,kBACA,aAAa,eAAe;GAC9B,GAAG;GACJ;IACA;EAAC;EAAS;EAAU;EAAY;EAAmB;EAAe,CAAC;;CAGtE,MAAM,kBACJ,CAAC,CAAC,mBAAmB,gBAAgB,eAAe;CAEtD,MAAM,qBACJ,eAIA,4BACG;AACH,MAAI,CAAC,gBAAiB,QAAO,eAAe;AAE5C,SACE,oBAAC;GAAgB,WAAW;GAAyB,GAAI;cACrD,cAAc,QAAQ,cAAc,cAAc,IAAI;IACxC;;AAItB,QAAO;EACL,UAAU;EACV,YAAY;EACZ;EACA;EACA,YAAY,CAAC,CAAC;EACd;EACA;EACD"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.159.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
5
5
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
6
|
+
import { DraggableCollection } from "../../shared/DraggableCollection.js";
|
|
6
7
|
import { clampPage, getPageInfo } from "../../navigation/Pagination/use-pagination.js";
|
|
7
8
|
import { ItemTableFooter } from "../ItemTable/ItemTableFooter.js";
|
|
9
|
+
import { RowCollection } from "../TableBase/RowCollection.js";
|
|
8
10
|
import { selectionRowKey } from "../TableBase/types.js";
|
|
9
11
|
import { useCellSelection } from "../TableBase/use-cell-selection.js";
|
|
10
|
-
import {
|
|
12
|
+
import { getDraggableColumnKeys, isColumnDraggable, useColumnOrder } from "../TableBase/use-column-order.js";
|
|
13
|
+
import { freezeColumnWidths, useTableColumns } from "../TableBase/use-table-columns.js";
|
|
11
14
|
import { ROW_NUMBER_COLUMN_KEY } from "../TableBase/use-table-selection.js";
|
|
12
15
|
import { TableView } from "../TableBase/TableView.js";
|
|
13
16
|
import { useContainerWidth } from "../TableBase/use-container-width.js";
|
|
@@ -16,7 +19,9 @@ import { useTableStorage } from "../TableBase/use-table-storage.js";
|
|
|
16
19
|
import { CONTAINER_STYLES } from "@tenphi/tasty";
|
|
17
20
|
import { forwardRef, useMemo, useRef, useState } from "react";
|
|
18
21
|
import { jsx } from "react/jsx-runtime";
|
|
22
|
+
import { useMultipleSelectionState } from "react-stately";
|
|
19
23
|
import { useControlledState } from "@react-stately/utils";
|
|
24
|
+
import { SelectionManager } from "@react-stately/selection";
|
|
20
25
|
|
|
21
26
|
//#region src/components/data/DataTable/DataTable.tsx
|
|
22
27
|
/** Wide enough for five digits at the dense default. */
|
|
@@ -42,29 +47,31 @@ function defaultGetRowKey(rowKey) {
|
|
|
42
47
|
* Cloud.
|
|
43
48
|
*/
|
|
44
49
|
function DataTable(props, ref) {
|
|
45
|
-
const { data, columns, rowKey = "id", getRowKey, pinnedTopRows, pinnedBottomRows, isLoading = false, loadingIndicator = "overlay", skeletonRowCount, error, emptyLabel, noResultsLabel, isFiltered, shape = "plain", size = "small", rowHeight, headerHeight, isStriped = true, isHeaderHidden, isHeaderSticky, showRowNumbers = false, sortMode, sorts: sortsProp, defaultSorts, onSortsChange, paginationMode = "client", page: pageProp, defaultPage, onPageChange, pageSize: pageSizeProp, defaultPageSize = 100, onPageSizeChange, pageSizeOptions, total: totalProp, totalPages, hasNextPage, summary = true, autoHidePagination = true, footerStart, footerCenter, footerEnd, cellSelectionMode = "range", isCellSelectable, selectedCellRange, defaultSelectedCellRange, onCellRangeChange, isRowMoveAnimated, isResizable = true, columnWidths: columnWidthsProp, defaultColumnWidths, onColumnResize, isVirtualized, virtualizeThreshold, overscan, getRowProps, storageKey, styles, headerStyles, headerCellStyles, bodyStyles, rowStyles, cellStyles, footerStyles, ariaLabel, qa, mods, ...rest } = props;
|
|
50
|
+
const { data, columns, rowKey = "id", getRowKey, pinnedTopRows, pinnedBottomRows, isLoading = false, loadingIndicator = "overlay", skeletonRowCount, error, emptyLabel, noResultsLabel, isFiltered, shape = "plain", size = "small", rowSize, rowHeight, headerHeight, isStriped = true, isHeaderHidden, isHeaderSticky, showRowNumbers = false, sortMode, sorts: sortsProp, defaultSorts, onSortsChange, paginationMode = "client", page: pageProp, defaultPage, onPageChange, pageSize: pageSizeProp, defaultPageSize = 100, onPageSizeChange, pageSizeOptions, total: totalProp, totalPages, hasNextPage, summary = true, autoHidePagination = true, footerStart, footerCenter, footerEnd, cellSelectionMode = "range", isCellSelectable, selectedCellRange, defaultSelectedCellRange, onCellRangeChange, isRowMoveAnimated, isResizable = true, columnWidths: columnWidthsProp, defaultColumnWidths, onColumnResize, isColumnReorderable = false, columnOrder, defaultColumnOrder, onColumnOrderChange, columnContextMenu, onColumnMenuAction, columnMenuTriggerProps, columnMenuProps, isVirtualized, virtualizeThreshold, overscan, getRowProps, storageKey, styles, headerStyles, headerCellStyles, bodyStyles, rowStyles, cellStyles, footerStyles, ariaLabel, qa, mods, ...rest } = props;
|
|
46
51
|
const rootRef = useCombinedRefs(ref, useRef(null));
|
|
47
52
|
const [scrollerEl, setScrollerEl] = useState(null);
|
|
48
53
|
const containerWidth = useContainerWidth(scrollerEl);
|
|
49
54
|
const storage = useTableStorage(storageKey);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
const columnOrderState = useColumnOrder({
|
|
56
|
+
columns: useMemo(() => columns.map((column) => {
|
|
57
|
+
const isNumeric = column.dataType === "number";
|
|
58
|
+
return {
|
|
59
|
+
...column,
|
|
60
|
+
align: column.align ?? (isNumeric ? "end" : "start"),
|
|
61
|
+
cellStyles: isNumeric ? {
|
|
62
|
+
fontVariantNumeric: "tabular-nums",
|
|
63
|
+
...typeof column.cellStyles === "object" ? column.cellStyles : null
|
|
64
|
+
} : column.cellStyles
|
|
65
|
+
};
|
|
66
|
+
}), [columns]),
|
|
67
|
+
columnOrder,
|
|
68
|
+
defaultColumnOrder,
|
|
69
|
+
onColumnOrderChange,
|
|
70
|
+
storage
|
|
71
|
+
});
|
|
72
|
+
const orderedColumns = columnOrderState.columns;
|
|
73
|
+
const { sorts, sortedRows, toggleSort, setColumnSort, mode: resolvedSortMode } = useTableSorts({
|
|
74
|
+
columns: orderedColumns,
|
|
68
75
|
rows: data,
|
|
69
76
|
mode: sortMode,
|
|
70
77
|
sorts: sortsProp,
|
|
@@ -94,9 +101,15 @@ function DataTable(props, ref) {
|
|
|
94
101
|
const draftRef = useRef(null);
|
|
95
102
|
const baseColumnWidths = columnWidthsProp ?? ownColumnWidths;
|
|
96
103
|
const columnWidths = draftColumnWidths ?? baseColumnWidths;
|
|
104
|
+
/**
|
|
105
|
+
* The resolved widths, for the freeze below. A ref because `layout` is
|
|
106
|
+
* computed *after* this handler is defined, and `useEvent` only reads it when
|
|
107
|
+
* the drag actually runs.
|
|
108
|
+
*/
|
|
109
|
+
const layoutRef = useRef(null);
|
|
97
110
|
const handleColumnResize = useEvent((key, width) => {
|
|
98
111
|
draftRef.current = {
|
|
99
|
-
...draftRef.current ?? baseColumnWidths,
|
|
112
|
+
...draftRef.current ?? freezeColumnWidths(layoutRef.current, baseColumnWidths),
|
|
100
113
|
[key]: Math.round(width)
|
|
101
114
|
};
|
|
102
115
|
setDraftColumnWidths(draftRef.current);
|
|
@@ -112,7 +125,7 @@ function DataTable(props, ref) {
|
|
|
112
125
|
setDraftColumnWidths(null);
|
|
113
126
|
});
|
|
114
127
|
const layout = useTableColumns({
|
|
115
|
-
columns:
|
|
128
|
+
columns: orderedColumns,
|
|
116
129
|
containerWidth,
|
|
117
130
|
columnWidths,
|
|
118
131
|
leadingColumns: useMemo(() => showRowNumbers ? [{
|
|
@@ -120,6 +133,7 @@ function DataTable(props, ref) {
|
|
|
120
133
|
width: ROW_NUMBER_WIDTH
|
|
121
134
|
}] : void 0, [showRowNumbers])
|
|
122
135
|
});
|
|
136
|
+
layoutRef.current = layout;
|
|
123
137
|
const { t } = useI18n();
|
|
124
138
|
const resolvedGetRowKey = useMemo(() => getRowKey ?? defaultGetRowKey(rowKey), [getRowKey, rowKey]);
|
|
125
139
|
const selectionRows = useMemo(() => [
|
|
@@ -169,7 +183,27 @@ function DataTable(props, ref) {
|
|
|
169
183
|
const smallestPageSize = pageSizeOptions?.length ? Math.min(...pageSizeOptions) : pageSize;
|
|
170
184
|
const showPagination = isPaginated && !(autoHidePagination && !hasNextPage && pageInfo.totalPages <= 1 && total <= smallestPageSize);
|
|
171
185
|
const hasFooter = showPagination || footerStart != null || footerCenter != null || footerEnd != null;
|
|
172
|
-
|
|
186
|
+
const headRowRef = useRef(null);
|
|
187
|
+
const draggableColumnKeys = useMemo(() => getDraggableColumnKeys(layout.columns, isColumnReorderable), [layout.columns, isColumnReorderable]);
|
|
188
|
+
const columnCollection = useMemo(() => new RowCollection(layout.columns.filter((column) => isColumnDraggable(column, isColumnReorderable)), (column) => column.key, /* @__PURE__ */ new Set(), (column) => typeof column.title === "string" ? column.title : column.key), [layout.columns, isColumnReorderable]);
|
|
189
|
+
/**
|
|
190
|
+
* `'single'`, not `'none'`.
|
|
191
|
+
*
|
|
192
|
+
* `useDraggableItem` only deletes its own `onClick` — the one that would
|
|
193
|
+
* hijack a screen-reader click away from the sort — when the selection mode is
|
|
194
|
+
* not `'none'`, and only then does it attach the keyboard drag description.
|
|
195
|
+
* Nothing is ever actually selected here.
|
|
196
|
+
*/
|
|
197
|
+
const columnSelectionState = useMultipleSelectionState({
|
|
198
|
+
selectionMode: "single",
|
|
199
|
+
disabledBehavior: "all"
|
|
200
|
+
});
|
|
201
|
+
const columnSelectionManager = useMemo(() => new SelectionManager(columnCollection, columnSelectionState), [columnCollection, columnSelectionState]);
|
|
202
|
+
const handleColumnFocus = useEvent((columnKey) => {
|
|
203
|
+
columnSelectionManager.setFocusedKey(columnKey);
|
|
204
|
+
});
|
|
205
|
+
const isColumnDragEnabled = isColumnReorderable && draggableColumnKeys.length > 1;
|
|
206
|
+
const renderTable = (columnDragState, columnDropState, headCollectionProps) => /* @__PURE__ */ jsx(TableView, {
|
|
173
207
|
...rest,
|
|
174
208
|
rootRef,
|
|
175
209
|
qa: qa || "DataTable",
|
|
@@ -193,6 +227,7 @@ function DataTable(props, ref) {
|
|
|
193
227
|
isFiltered,
|
|
194
228
|
shape,
|
|
195
229
|
size,
|
|
230
|
+
rowSize,
|
|
196
231
|
rowHeight,
|
|
197
232
|
headerHeight,
|
|
198
233
|
isStriped,
|
|
@@ -204,6 +239,11 @@ function DataTable(props, ref) {
|
|
|
204
239
|
sortMode: resolvedSortMode,
|
|
205
240
|
sorts,
|
|
206
241
|
onColumnSort: toggleSort,
|
|
242
|
+
onColumnSortChange: setColumnSort,
|
|
243
|
+
columnContextMenu,
|
|
244
|
+
onColumnMenuAction,
|
|
245
|
+
columnMenuTriggerProps,
|
|
246
|
+
columnMenuProps,
|
|
207
247
|
isVirtualized,
|
|
208
248
|
virtualizeThreshold,
|
|
209
249
|
overscan,
|
|
@@ -219,6 +259,12 @@ function DataTable(props, ref) {
|
|
|
219
259
|
rowStyles,
|
|
220
260
|
cellStyles,
|
|
221
261
|
mods,
|
|
262
|
+
isColumnReorderable: isColumnDragEnabled,
|
|
263
|
+
columnDragState,
|
|
264
|
+
columnDropState,
|
|
265
|
+
headCollectionProps,
|
|
266
|
+
headRowRef,
|
|
267
|
+
onColumnFocus: handleColumnFocus,
|
|
222
268
|
footer: hasFooter ? /* @__PURE__ */ jsx(ItemTableFooter, {
|
|
223
269
|
start: footerStart,
|
|
224
270
|
center: footerCenter,
|
|
@@ -237,6 +283,18 @@ function DataTable(props, ref) {
|
|
|
237
283
|
} : void 0
|
|
238
284
|
}) : null
|
|
239
285
|
});
|
|
286
|
+
return isColumnDragEnabled ? /* @__PURE__ */ jsx(DraggableCollection, {
|
|
287
|
+
state: {
|
|
288
|
+
collection: columnCollection,
|
|
289
|
+
selectionManager: columnSelectionManager,
|
|
290
|
+
disabledKeys: /* @__PURE__ */ new Set()
|
|
291
|
+
},
|
|
292
|
+
listRef: headRowRef,
|
|
293
|
+
orderedKeys: draggableColumnKeys,
|
|
294
|
+
orientation: "horizontal",
|
|
295
|
+
onReorder: columnOrderState.reorder,
|
|
296
|
+
children: (dragState, dropState, collectionProps) => renderTable(dragState, dropState, collectionProps)
|
|
297
|
+
}) : renderTable();
|
|
240
298
|
}
|
|
241
299
|
const _DataTable = forwardRef(DataTable);
|
|
242
300
|
_DataTable.displayName = "DataTable";
|