@cube-dev/ui-kit 0.0.0-canary-e056095 → 0.0.0-canary-31f7f8e
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/_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.d.ts +0 -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/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.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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +2 -2
- 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 +28 -28
- 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 +2 -2
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +2 -2
- package/dist/components/data/TableBase/column-menu.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.d.ts +1 -2
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.d.ts +0 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +2 -2
- package/dist/components/fields/Checkbox/CheckboxGroup.js +2 -2
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +2 -2
- package/dist/components/fields/ColorPicker/ColorPicker.js +2 -2
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +2 -2
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +2 -2
- 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 +3 -3
- 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 +4 -4
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/index.d.ts +0 -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 +2 -2
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +2 -2
- package/dist/components/fields/Picker/Picker.js +3 -3
- package/dist/components/fields/RadioGroup/Radio.js +2 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/components/fields/TextArea/TextArea.js +2 -2
- package/dist/components/fields/TextInput/TextInput.js +2 -2
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +7 -6
- package/dist/components/fields/color/channels.js.map +1 -1
- package/dist/components/fields/color/color.d.ts +1 -0
- package/dist/components/fields/color/color.js +22 -100
- package/dist/components/fields/color/color.js.map +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-modes.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/placement.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +3 -3
- 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 +2 -2
- package/dist/components/navigation/Tabs/Tabs.js +2 -2
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +2 -2
- 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 +2 -2
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +4 -4
- 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.d.ts +1 -2
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.d.ts +0 -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/types.d.ts +0 -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.d.ts +0 -2
- 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/index.d.ts +0 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -25
- package/dist/i18n/locales/en-US/uikit.js +1 -25
- package/dist/i18n/locales/en-US/uikit.json.d.ts +1 -27
- package/dist/i18n/locales/es-ES/uikit.js +1 -25
- package/dist/i18n/locales/es-MX/uikit.js +1 -25
- package/dist/i18n/locales/fr-FR/uikit.js +1 -25
- package/dist/i18n/locales/it-IT/uikit.js +1 -25
- package/dist/i18n/locales/ja-JP/uikit.js +1 -25
- package/dist/i18n/locales/nb-NO/uikit.js +1 -25
- package/dist/i18n/locales/pt-BR/uikit.js +1 -25
- package/dist/i18n/locales/pt-PT/uikit.js +1 -25
- package/dist/i18n/locales/sv-SE/uikit.js +1 -25
- package/dist/i18n/locales/vi-VN/uikit.js +1 -25
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/index.d.ts +0 -8
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +2 -15
- package/dist/index.js +50 -61
- 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.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/all-tokens.js +2 -2
- 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 +2 -2
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.d.ts +61 -0
- package/dist/tokens/legacy-color.js +58 -0
- package/dist/tokens/legacy-color.js.map +1 -0
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +2 -2
- 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.d.ts +2 -0
- package/dist/utils/colors.js +247 -0
- package/dist/utils/colors.js.map +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.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/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/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/Usage.md +18 -0
- package/package.json +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.d.ts +0 -2
- package/dist/components/layout/Dashboard/Dashboard.d.ts +0 -19
- package/dist/components/layout/Dashboard/Dashboard.js +0 -188
- package/dist/components/layout/Dashboard/Dashboard.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardContainer.d.ts +0 -13
- package/dist/components/layout/Dashboard/DashboardContainer.js +0 -272
- package/dist/components/layout/Dashboard/DashboardContainer.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardContainerContent.js +0 -405
- package/dist/components/layout/Dashboard/DashboardContainerContent.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardNodeActions.js +0 -228
- package/dist/components/layout/Dashboard/DashboardNodeActions.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardTabs.d.ts +0 -14
- package/dist/components/layout/Dashboard/DashboardTabs.js +0 -85
- package/dist/components/layout/Dashboard/DashboardTabs.js.map +0 -1
- package/dist/components/layout/Dashboard/DashboardWidget.d.ts +0 -9
- package/dist/components/layout/Dashboard/DashboardWidget.js +0 -196
- package/dist/components/layout/Dashboard/DashboardWidget.js.map +0 -1
- package/dist/components/layout/Dashboard/context.js +0 -37
- package/dist/components/layout/Dashboard/context.js.map +0 -1
- package/dist/components/layout/Dashboard/drag.js +0 -481
- package/dist/components/layout/Dashboard/drag.js.map +0 -1
- package/dist/components/layout/Dashboard/index.d.ts +0 -6
- package/dist/components/layout/Dashboard/occupancy.js +0 -240
- package/dist/components/layout/Dashboard/occupancy.js.map +0 -1
- package/dist/components/layout/Dashboard/placement.js +0 -94
- package/dist/components/layout/Dashboard/placement.js.map +0 -1
- package/dist/components/layout/Dashboard/styles.js +0 -344
- package/dist/components/layout/Dashboard/styles.js.map +0 -1
- package/dist/components/layout/Dashboard/types.d.ts +0 -220
- package/dist/components/layout/Dashboard/use-dashboard-gestures.js +0 -321
- package/dist/components/layout/Dashboard/use-dashboard-gestures.js.map +0 -1
- package/dist/components/layout/Dashboard/use-dashboard-node.js +0 -93
- package/dist/components/layout/Dashboard/use-dashboard-node.js.map +0 -1
- package/dist/components/portal/PortalProvider.d.ts +0 -2
- package/dist/icons/ArrowsHorizontalIcon.d.ts +0 -12
- package/dist/icons/ArrowsHorizontalIcon.js +0 -11
- package/dist/icons/ArrowsHorizontalIcon.js.map +0 -1
- package/dist/icons/ArrowsInHorizontalIcon.d.ts +0 -20
- package/dist/icons/ArrowsInHorizontalIcon.js +0 -31
- package/dist/icons/ArrowsInHorizontalIcon.js.map +0 -1
- package/dist/icons/ArrowsInVerticalIcon.d.ts +0 -13
- package/dist/icons/ArrowsInVerticalIcon.js +0 -24
- package/dist/icons/ArrowsInVerticalIcon.js.map +0 -1
- package/dist/icons/ArrowsMaximizeIcon.d.ts +0 -12
- package/dist/icons/ArrowsMaximizeIcon.js +0 -11
- package/dist/icons/ArrowsMaximizeIcon.js.map +0 -1
- package/dist/icons/ArrowsMinimizeIcon.d.ts +0 -12
- package/dist/icons/ArrowsMinimizeIcon.js +0 -11
- package/dist/icons/ArrowsMinimizeIcon.js.map +0 -1
- package/dist/icons/ArrowsVerticalIcon.d.ts +0 -12
- package/dist/icons/ArrowsVerticalIcon.js +0 -11
- package/dist/icons/ArrowsVerticalIcon.js.map +0 -1
- package/dist/icons/CirclePlusIcon.d.ts +0 -12
- package/dist/icons/CirclePlusIcon.js +0 -11
- package/dist/icons/CirclePlusIcon.js.map +0 -1
- package/dist/icons/MaximizeIcon.d.ts +0 -12
- package/dist/icons/MaximizeIcon.js +0 -11
- package/dist/icons/MaximizeIcon.js.map +0 -1
- package/docs/components/layout/Dashboard.md +0 -409
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e056095 | Cube Dev Team */
|
|
2
|
-
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
|
-
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
|
-
import { CopyIcon } from "../../../icons/CopyIcon.js";
|
|
5
|
-
import { Button } from "../../actions/Button/Button.js";
|
|
6
|
-
import { __Menu } from "../../actions/Menu/Menu.js";
|
|
7
|
-
import { placementsOverlap } from "./placement.js";
|
|
8
|
-
import { getLargestFreeRect } from "./occupancy.js";
|
|
9
|
-
import { NodeActionsElement } from "./styles.js";
|
|
10
|
-
import { ArrowsHorizontalIcon } from "../../../icons/ArrowsHorizontalIcon.js";
|
|
11
|
-
import { ArrowsInHorizontalIcon } from "../../../icons/ArrowsInHorizontalIcon.js";
|
|
12
|
-
import { ArrowsInVerticalIcon } from "../../../icons/ArrowsInVerticalIcon.js";
|
|
13
|
-
import { ArrowsMaximizeIcon } from "../../../icons/ArrowsMaximizeIcon.js";
|
|
14
|
-
import { ArrowsMinimizeIcon } from "../../../icons/ArrowsMinimizeIcon.js";
|
|
15
|
-
import { ArrowsVerticalIcon } from "../../../icons/ArrowsVerticalIcon.js";
|
|
16
|
-
import { MaximizeIcon } from "../../../icons/MaximizeIcon.js";
|
|
17
|
-
import { MoreIcon } from "../../../icons/MoreIcon.js";
|
|
18
|
-
import { SettingsIcon } from "../../../icons/SettingsIcon.js";
|
|
19
|
-
import { TrashIcon } from "../../../icons/TrashIcon.js";
|
|
20
|
-
import { useMemo, useState } from "react";
|
|
21
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
|
|
23
|
-
//#region src/components/layout/Dashboard/DashboardNodeActions.tsx
|
|
24
|
-
/** Sibling boxes, read straight off the DOM the way the drag engine does. */
|
|
25
|
-
function readSiblingPlacements(parentElement, nodeId) {
|
|
26
|
-
if (!parentElement) return [];
|
|
27
|
-
return Array.from(parentElement.children).flatMap((child) => {
|
|
28
|
-
if (!(child instanceof HTMLElement)) return [];
|
|
29
|
-
if (!child.dataset.dashboardNode) return [];
|
|
30
|
-
if (child.dataset.dashboardNodeId === nodeId) return [];
|
|
31
|
-
if (child.dataset.dashboardAddSlot !== void 0) return [];
|
|
32
|
-
const column = Number(child.dataset.dashboardColumn);
|
|
33
|
-
const row = Number(child.dataset.dashboardRow);
|
|
34
|
-
const columns = Number(child.dataset.dashboardColumns);
|
|
35
|
-
const rows = Number(child.dataset.dashboardRows);
|
|
36
|
-
if (![
|
|
37
|
-
column,
|
|
38
|
-
row,
|
|
39
|
-
columns,
|
|
40
|
-
rows
|
|
41
|
-
].every(Number.isFinite)) return [];
|
|
42
|
-
return [{
|
|
43
|
-
column,
|
|
44
|
-
row,
|
|
45
|
-
columns,
|
|
46
|
-
rows
|
|
47
|
-
}];
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* What each size command would produce, or nothing when it would change nothing.
|
|
52
|
-
*
|
|
53
|
-
* Two things can stop a command: the node's own bounds together with the space
|
|
54
|
-
* left in the parent, and an occupant in the way. Both are checked, because
|
|
55
|
-
* "disabled when pressing it has no effect" is the whole point — an enabled item
|
|
56
|
-
* that silently does nothing is worse than a greyed-out one.
|
|
57
|
-
*
|
|
58
|
-
* Resolved when the menu opens rather than on every render: the occupancy half
|
|
59
|
-
* is a DOM read, and a node re-renders on every frame of a neighbour's drag.
|
|
60
|
-
*/
|
|
61
|
-
function getDashboardSizeCommands(placement, bounds, siblings, canResizeColumns, canResizeRows) {
|
|
62
|
-
const resolved = /* @__PURE__ */ new Map();
|
|
63
|
-
const fits = (candidate) => candidate.column + candidate.columns <= bounds.parentColumns && candidate.row + candidate.rows <= bounds.parentRows && candidate.columns >= bounds.minColumns && candidate.columns <= bounds.maxColumns && candidate.rows >= bounds.minRows && candidate.rows <= bounds.maxRows && !siblings.some((sibling) => placementsOverlap(candidate, sibling));
|
|
64
|
-
const propose = (command, columns, rows) => {
|
|
65
|
-
const candidate = {
|
|
66
|
-
...placement,
|
|
67
|
-
columns,
|
|
68
|
-
rows
|
|
69
|
-
};
|
|
70
|
-
if ((candidate.columns !== placement.columns || candidate.rows !== placement.rows) && fits(candidate)) resolved.set(command, candidate);
|
|
71
|
-
};
|
|
72
|
-
if (canResizeColumns) {
|
|
73
|
-
propose("expand-width", placement.columns + 1, placement.rows);
|
|
74
|
-
propose("shrink-width", placement.columns - 1, placement.rows);
|
|
75
|
-
}
|
|
76
|
-
if (canResizeRows) {
|
|
77
|
-
propose("expand-height", placement.columns, placement.rows + 1);
|
|
78
|
-
propose("shrink-height", placement.columns, placement.rows - 1);
|
|
79
|
-
}
|
|
80
|
-
if (canResizeColumns && canResizeRows) {
|
|
81
|
-
propose("expand-both", placement.columns + 1, placement.rows + 1);
|
|
82
|
-
propose("shrink-both", placement.columns - 1, placement.rows - 1);
|
|
83
|
-
const largest = getLargestFreeRect(placement, siblings, bounds.parentColumns, bounds.parentRows, bounds.maxColumns, bounds.maxRows);
|
|
84
|
-
propose("fill", largest.columns, largest.rows);
|
|
85
|
-
}
|
|
86
|
-
return resolved;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Every action a selected node offers, behind one trigger.
|
|
90
|
-
*
|
|
91
|
-
* Settings and Delete used to sit on the node as two loose round buttons, which
|
|
92
|
-
* capped how many actions a node could ever have and left resizing as a
|
|
93
|
-
* pointer-only gesture. One menu holds the same two actions plus the size
|
|
94
|
-
* commands, a consumer's own entries, and whatever comes next — and the size
|
|
95
|
-
* commands double as the accessible route to resizing.
|
|
96
|
-
*/
|
|
97
|
-
function DashboardNodeActions(props) {
|
|
98
|
-
const { label, mods, qaAttribute, nodeId, isSelected, placement, bounds, canResizeColumns, canResizeRows, nodeRef, onResize, onSettingsPress, settingsLabel, onDuplicatePress, duplicateLabel, onDeletePress, deleteLabel, actions, onMenuAction } = props;
|
|
99
|
-
const { t } = useI18n();
|
|
100
|
-
const [sizeCommands, setSizeCommands] = useState(() => /* @__PURE__ */ new Map());
|
|
101
|
-
const canResize = canResizeColumns || canResizeRows;
|
|
102
|
-
const hasConsumerActions = !!(onSettingsPress || onDuplicatePress || onDeletePress || actions?.length);
|
|
103
|
-
/** Which size commands this node's axes make sense for at all. */
|
|
104
|
-
const sizeItems = useMemo(() => {
|
|
105
|
-
const both = canResizeColumns && canResizeRows;
|
|
106
|
-
return [
|
|
107
|
-
{
|
|
108
|
-
key: "expand-width",
|
|
109
|
-
icon: /* @__PURE__ */ jsx(ArrowsHorizontalIcon, {}),
|
|
110
|
-
label: t("dashboard.expandWidth", "Widen"),
|
|
111
|
-
show: canResizeColumns
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
key: "shrink-width",
|
|
115
|
-
icon: /* @__PURE__ */ jsx(ArrowsInHorizontalIcon, {}),
|
|
116
|
-
label: t("dashboard.shrinkWidth", "Narrow"),
|
|
117
|
-
show: canResizeColumns
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
key: "expand-height",
|
|
121
|
-
icon: /* @__PURE__ */ jsx(ArrowsVerticalIcon, {}),
|
|
122
|
-
label: t("dashboard.expandHeight", "Make taller"),
|
|
123
|
-
show: canResizeRows
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
key: "shrink-height",
|
|
127
|
-
icon: /* @__PURE__ */ jsx(ArrowsInVerticalIcon, {}),
|
|
128
|
-
label: t("dashboard.shrinkHeight", "Make shorter"),
|
|
129
|
-
show: canResizeRows
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
key: "expand-both",
|
|
133
|
-
icon: /* @__PURE__ */ jsx(ArrowsMaximizeIcon, {}),
|
|
134
|
-
label: t("dashboard.expandBoth", "Grow on both axes"),
|
|
135
|
-
show: both
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
key: "shrink-both",
|
|
139
|
-
icon: /* @__PURE__ */ jsx(ArrowsMinimizeIcon, {}),
|
|
140
|
-
label: t("dashboard.shrinkBoth", "Shrink on both axes"),
|
|
141
|
-
show: both
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
key: "fill",
|
|
145
|
-
icon: /* @__PURE__ */ jsx(MaximizeIcon, {}),
|
|
146
|
-
label: t("dashboard.fill", "Fill available space"),
|
|
147
|
-
show: both
|
|
148
|
-
}
|
|
149
|
-
].filter((item) => item.show);
|
|
150
|
-
}, [
|
|
151
|
-
canResizeColumns,
|
|
152
|
-
canResizeRows,
|
|
153
|
-
t
|
|
154
|
-
]);
|
|
155
|
-
const handleOpenChange = useEvent((isOpen) => {
|
|
156
|
-
if (!isOpen || !canResize) return;
|
|
157
|
-
setSizeCommands(getDashboardSizeCommands(placement, bounds, readSiblingPlacements(nodeRef.current?.parentElement ?? null, nodeId), canResizeColumns, canResizeRows));
|
|
158
|
-
});
|
|
159
|
-
const disabledKeys = useMemo(() => [...sizeItems.filter((item) => !sizeCommands.has(item.key)).map((item) => item.key), ...(actions ?? []).filter((action) => action.isDisabled).map((action) => action.id)], [
|
|
160
|
-
actions,
|
|
161
|
-
sizeCommands,
|
|
162
|
-
sizeItems
|
|
163
|
-
]);
|
|
164
|
-
const handleAction = useEvent((key) => {
|
|
165
|
-
const command = String(key);
|
|
166
|
-
const resized = sizeCommands.get(command);
|
|
167
|
-
if (resized) {
|
|
168
|
-
onResize(resized);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (command === "settings") return onSettingsPress?.();
|
|
172
|
-
if (command === "duplicate") return onDuplicatePress?.();
|
|
173
|
-
if (command === "delete") return onDeletePress?.();
|
|
174
|
-
onMenuAction?.(command);
|
|
175
|
-
});
|
|
176
|
-
if (!hasConsumerActions && !canResize) return null;
|
|
177
|
-
const menuLabel = t("dashboard.nodeMenu", "Actions for {{node}}", { node: label });
|
|
178
|
-
return /* @__PURE__ */ jsx(NodeActionsElement, {
|
|
179
|
-
"aria-hidden": !isSelected || void 0,
|
|
180
|
-
mods,
|
|
181
|
-
[qaAttribute]: "",
|
|
182
|
-
children: /* @__PURE__ */ jsxs(__Menu.Trigger, {
|
|
183
|
-
onOpenChange: handleOpenChange,
|
|
184
|
-
children: [/* @__PURE__ */ jsx(Button, {
|
|
185
|
-
qa: "DashboardNodeMenuButton",
|
|
186
|
-
size: "small",
|
|
187
|
-
type: "primary",
|
|
188
|
-
radius: "round",
|
|
189
|
-
icon: /* @__PURE__ */ jsx(MoreIcon, {}),
|
|
190
|
-
"aria-label": menuLabel,
|
|
191
|
-
tabIndex: isSelected ? void 0 : -1
|
|
192
|
-
}), /* @__PURE__ */ jsxs(__Menu, {
|
|
193
|
-
"aria-label": menuLabel,
|
|
194
|
-
width: "240px",
|
|
195
|
-
disabledKeys,
|
|
196
|
-
onAction: handleAction,
|
|
197
|
-
children: [
|
|
198
|
-
onSettingsPress ? /* @__PURE__ */ jsx(__Menu.Item, {
|
|
199
|
-
icon: /* @__PURE__ */ jsx(SettingsIcon, {}),
|
|
200
|
-
children: settingsLabel ?? t("dashboard.settings", "Settings")
|
|
201
|
-
}, "settings") : null,
|
|
202
|
-
onDuplicatePress ? /* @__PURE__ */ jsx(__Menu.Item, {
|
|
203
|
-
icon: /* @__PURE__ */ jsx(CopyIcon, {}),
|
|
204
|
-
children: duplicateLabel ?? t("dashboard.duplicate", "Duplicate")
|
|
205
|
-
}, "duplicate") : null,
|
|
206
|
-
(actions ?? []).map((action) => /* @__PURE__ */ jsx(__Menu.Item, {
|
|
207
|
-
icon: action.icon,
|
|
208
|
-
description: action.description,
|
|
209
|
-
children: action.name
|
|
210
|
-
}, action.id)),
|
|
211
|
-
sizeItems.map((item) => /* @__PURE__ */ jsx(__Menu.Item, {
|
|
212
|
-
icon: item.icon,
|
|
213
|
-
children: item.label
|
|
214
|
-
}, item.key)),
|
|
215
|
-
onDeletePress ? /* @__PURE__ */ jsx(__Menu.Item, {
|
|
216
|
-
theme: "danger",
|
|
217
|
-
icon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
218
|
-
children: deleteLabel ?? t("dashboard.delete", "Delete")
|
|
219
|
-
}, "delete") : null
|
|
220
|
-
]
|
|
221
|
-
})]
|
|
222
|
-
})
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
//#endregion
|
|
227
|
-
export { DashboardNodeActions };
|
|
228
|
-
//# sourceMappingURL=DashboardNodeActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardNodeActions.js","names":["Menu"],"sources":["../../../../src/components/layout/Dashboard/DashboardNodeActions.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport { useEvent } from '../../../_internal/hooks';\nimport { useI18n } from '../../../i18n';\nimport { ArrowsHorizontalIcon } from '../../../icons/ArrowsHorizontalIcon';\nimport { ArrowsInHorizontalIcon } from '../../../icons/ArrowsInHorizontalIcon';\nimport { ArrowsInVerticalIcon } from '../../../icons/ArrowsInVerticalIcon';\nimport { ArrowsMaximizeIcon } from '../../../icons/ArrowsMaximizeIcon';\nimport { ArrowsMinimizeIcon } from '../../../icons/ArrowsMinimizeIcon';\nimport { ArrowsVerticalIcon } from '../../../icons/ArrowsVerticalIcon';\nimport { CopyIcon } from '../../../icons/CopyIcon';\nimport { MaximizeIcon } from '../../../icons/MaximizeIcon';\nimport { MoreIcon } from '../../../icons/MoreIcon';\nimport { SettingsIcon } from '../../../icons/SettingsIcon';\nimport { TrashIcon } from '../../../icons/TrashIcon';\nimport { Button } from '../../actions/Button/Button';\nimport { Menu } from '../../actions/Menu/Menu';\n\nimport { getLargestFreeRect } from './occupancy';\nimport { placementsOverlap } from './placement';\nimport { NodeActionsElement } from './styles';\n\nimport type { Key } from '@react-types/shared';\nimport type { ModValue } from '@tenphi/tasty';\nimport type { ReactNode, RefObject } from 'react';\nimport type {\n DashboardNodeAction,\n DashboardPlacement,\n DashboardSizeBounds,\n} from './types';\n\ntype DashboardSizeCommand =\n | 'expand-width'\n | 'shrink-width'\n | 'expand-height'\n | 'shrink-height'\n | 'expand-both'\n | 'shrink-both'\n | 'fill';\n\nexport interface DashboardNodeActionsProps {\n /** Accessible name of the node, used in the fallback labels. */\n label: string;\n mods: Record<string, ModValue>;\n /** Marks this cluster for tests and for the drag engine's target checks. */\n qaAttribute:\n | 'data-dashboard-widget-actions'\n | 'data-dashboard-container-actions';\n nodeId: string;\n isSelected: boolean;\n placement: DashboardPlacement;\n bounds: DashboardSizeBounds;\n canResizeColumns: boolean;\n canResizeRows: boolean;\n /** The node itself; its parent grid is read for occupancy on menu open. */\n nodeRef: RefObject<HTMLElement | null>;\n onResize: (placement: DashboardPlacement) => void;\n onSettingsPress?: () => void;\n settingsLabel?: string;\n onDuplicatePress?: () => void;\n duplicateLabel?: string;\n onDeletePress?: () => void;\n deleteLabel?: string;\n actions?: readonly DashboardNodeAction[];\n onMenuAction?: (key: string) => void;\n}\n\n/** Sibling boxes, read straight off the DOM the way the drag engine does. */\nfunction readSiblingPlacements(\n parentElement: HTMLElement | null,\n nodeId: string,\n): DashboardPlacement[] {\n if (!parentElement) return [];\n\n return Array.from(parentElement.children).flatMap((child) => {\n if (!(child instanceof HTMLElement)) return [];\n if (!child.dataset.dashboardNode) return [];\n if (child.dataset.dashboardNodeId === nodeId) return [];\n if (child.dataset.dashboardAddSlot !== undefined) return [];\n const column = Number(child.dataset.dashboardColumn);\n const row = Number(child.dataset.dashboardRow);\n const columns = Number(child.dataset.dashboardColumns);\n const rows = Number(child.dataset.dashboardRows);\n if (![column, row, columns, rows].every(Number.isFinite)) return [];\n\n return [{ column, row, columns, rows }];\n });\n}\n\n/**\n * What each size command would produce, or nothing when it would change nothing.\n *\n * Two things can stop a command: the node's own bounds together with the space\n * left in the parent, and an occupant in the way. Both are checked, because\n * \"disabled when pressing it has no effect\" is the whole point — an enabled item\n * that silently does nothing is worse than a greyed-out one.\n *\n * Resolved when the menu opens rather than on every render: the occupancy half\n * is a DOM read, and a node re-renders on every frame of a neighbour's drag.\n */\nexport function getDashboardSizeCommands(\n placement: DashboardPlacement,\n bounds: DashboardSizeBounds,\n siblings: readonly DashboardPlacement[],\n canResizeColumns: boolean,\n canResizeRows: boolean,\n): Map<DashboardSizeCommand, DashboardPlacement> {\n const resolved = new Map<DashboardSizeCommand, DashboardPlacement>();\n const fits = (candidate: DashboardPlacement) =>\n candidate.column + candidate.columns <= bounds.parentColumns &&\n candidate.row + candidate.rows <= bounds.parentRows &&\n candidate.columns >= bounds.minColumns &&\n candidate.columns <= bounds.maxColumns &&\n candidate.rows >= bounds.minRows &&\n candidate.rows <= bounds.maxRows &&\n !siblings.some((sibling) => placementsOverlap(candidate, sibling));\n const propose = (\n command: DashboardSizeCommand,\n columns: number,\n rows: number,\n ) => {\n const candidate = { ...placement, columns, rows };\n const changes =\n candidate.columns !== placement.columns ||\n candidate.rows !== placement.rows;\n\n if (changes && fits(candidate)) resolved.set(command, candidate);\n };\n\n if (canResizeColumns) {\n propose('expand-width', placement.columns + 1, placement.rows);\n propose('shrink-width', placement.columns - 1, placement.rows);\n }\n if (canResizeRows) {\n propose('expand-height', placement.columns, placement.rows + 1);\n propose('shrink-height', placement.columns, placement.rows - 1);\n }\n if (canResizeColumns && canResizeRows) {\n propose('expand-both', placement.columns + 1, placement.rows + 1);\n propose('shrink-both', placement.columns - 1, placement.rows - 1);\n\n const largest = getLargestFreeRect(\n placement,\n siblings,\n bounds.parentColumns,\n bounds.parentRows,\n bounds.maxColumns,\n bounds.maxRows,\n );\n propose('fill', largest.columns, largest.rows);\n }\n\n return resolved;\n}\n\n/**\n * Every action a selected node offers, behind one trigger.\n *\n * Settings and Delete used to sit on the node as two loose round buttons, which\n * capped how many actions a node could ever have and left resizing as a\n * pointer-only gesture. One menu holds the same two actions plus the size\n * commands, a consumer's own entries, and whatever comes next — and the size\n * commands double as the accessible route to resizing.\n */\nexport function DashboardNodeActions(props: DashboardNodeActionsProps) {\n const {\n label,\n mods,\n qaAttribute,\n nodeId,\n isSelected,\n placement,\n bounds,\n canResizeColumns,\n canResizeRows,\n nodeRef,\n onResize,\n onSettingsPress,\n settingsLabel,\n onDuplicatePress,\n duplicateLabel,\n onDeletePress,\n deleteLabel,\n actions,\n onMenuAction,\n } = props;\n const { t } = useI18n();\n const [sizeCommands, setSizeCommands] = useState<\n Map<DashboardSizeCommand, DashboardPlacement>\n >(() => new Map());\n\n const canResize = canResizeColumns || canResizeRows;\n const hasConsumerActions = !!(\n onSettingsPress ||\n onDuplicatePress ||\n onDeletePress ||\n actions?.length\n );\n\n /** Which size commands this node's axes make sense for at all. */\n const sizeItems = useMemo(() => {\n const both = canResizeColumns && canResizeRows;\n const candidates: {\n key: DashboardSizeCommand;\n icon: ReactNode;\n label: string;\n show: boolean;\n }[] = [\n {\n key: 'expand-width',\n icon: <ArrowsHorizontalIcon />,\n label: t('dashboard.expandWidth', 'Widen'),\n show: canResizeColumns,\n },\n {\n key: 'shrink-width',\n icon: <ArrowsInHorizontalIcon />,\n label: t('dashboard.shrinkWidth', 'Narrow'),\n show: canResizeColumns,\n },\n {\n key: 'expand-height',\n icon: <ArrowsVerticalIcon />,\n label: t('dashboard.expandHeight', 'Make taller'),\n show: canResizeRows,\n },\n {\n key: 'shrink-height',\n icon: <ArrowsInVerticalIcon />,\n label: t('dashboard.shrinkHeight', 'Make shorter'),\n show: canResizeRows,\n },\n {\n key: 'expand-both',\n icon: <ArrowsMaximizeIcon />,\n label: t('dashboard.expandBoth', 'Grow on both axes'),\n show: both,\n },\n {\n key: 'shrink-both',\n icon: <ArrowsMinimizeIcon />,\n label: t('dashboard.shrinkBoth', 'Shrink on both axes'),\n show: both,\n },\n {\n key: 'fill',\n icon: <MaximizeIcon />,\n label: t('dashboard.fill', 'Fill available space'),\n show: both,\n },\n ];\n\n return candidates.filter((item) => item.show);\n }, [canResizeColumns, canResizeRows, t]);\n\n const handleOpenChange = useEvent((isOpen: boolean) => {\n if (!isOpen || !canResize) return;\n\n setSizeCommands(\n getDashboardSizeCommands(\n placement,\n bounds,\n readSiblingPlacements(nodeRef.current?.parentElement ?? null, nodeId),\n canResizeColumns,\n canResizeRows,\n ),\n );\n });\n\n const disabledKeys = useMemo(\n () => [\n ...sizeItems\n .filter((item) => !sizeCommands.has(item.key))\n .map((item) => item.key),\n ...(actions ?? [])\n .filter((action) => action.isDisabled)\n .map((action) => action.id),\n ],\n [actions, sizeCommands, sizeItems],\n );\n\n const handleAction = useEvent((key: Key) => {\n const command = String(key);\n const resized = sizeCommands.get(command as DashboardSizeCommand);\n\n if (resized) {\n onResize(resized);\n return;\n }\n if (command === 'settings') return onSettingsPress?.();\n if (command === 'duplicate') return onDuplicatePress?.();\n if (command === 'delete') return onDeletePress?.();\n\n onMenuAction?.(command);\n });\n\n if (!hasConsumerActions && !canResize) return null;\n\n const menuLabel = t('dashboard.nodeMenu', 'Actions for {{node}}', {\n node: label,\n });\n\n return (\n <NodeActionsElement\n aria-hidden={!isSelected || undefined}\n mods={mods}\n {...{ [qaAttribute]: '' }}\n >\n <Menu.Trigger onOpenChange={handleOpenChange}>\n <Button\n qa=\"DashboardNodeMenuButton\"\n size=\"small\"\n type=\"primary\"\n radius=\"round\"\n icon={<MoreIcon />}\n aria-label={menuLabel}\n tabIndex={isSelected ? undefined : -1}\n />\n <Menu\n aria-label={menuLabel}\n width=\"240px\"\n disabledKeys={disabledKeys}\n onAction={handleAction}\n >\n {onSettingsPress ? (\n <Menu.Item key=\"settings\" icon={<SettingsIcon />}>\n {settingsLabel ?? t('dashboard.settings', 'Settings')}\n </Menu.Item>\n ) : null}\n {onDuplicatePress ? (\n <Menu.Item key=\"duplicate\" icon={<CopyIcon />}>\n {duplicateLabel ?? t('dashboard.duplicate', 'Duplicate')}\n </Menu.Item>\n ) : null}\n {(actions ?? []).map((action) => (\n <Menu.Item\n key={action.id}\n icon={action.icon}\n description={action.description}\n >\n {action.name}\n </Menu.Item>\n ))}\n {sizeItems.map((item) => (\n <Menu.Item key={item.key} icon={item.icon}>\n {item.label}\n </Menu.Item>\n ))}\n {onDeletePress ? (\n <Menu.Item key=\"delete\" theme=\"danger\" icon={<TrashIcon />}>\n {deleteLabel ?? t('dashboard.delete', 'Delete')}\n </Menu.Item>\n ) : null}\n </Menu>\n </Menu.Trigger>\n </NodeActionsElement>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoEA,SAAS,sBACP,eACA,QACsB;AACtB,KAAI,CAAC,cAAe,QAAO,EAAE;AAE7B,QAAO,MAAM,KAAK,cAAc,SAAS,CAAC,SAAS,UAAU;AAC3D,MAAI,EAAE,iBAAiB,aAAc,QAAO,EAAE;AAC9C,MAAI,CAAC,MAAM,QAAQ,cAAe,QAAO,EAAE;AAC3C,MAAI,MAAM,QAAQ,oBAAoB,OAAQ,QAAO,EAAE;AACvD,MAAI,MAAM,QAAQ,qBAAqB,OAAW,QAAO,EAAE;EAC3D,MAAM,SAAS,OAAO,MAAM,QAAQ,gBAAgB;EACpD,MAAM,MAAM,OAAO,MAAM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kBAAkB,EAAE,uBAAuB,YAAY;QAD3C,YAEH,GACV;MACF,WAAW,EAAE,EAAE,KAAK,WACpB,oBAACA,OAAK;MAEJ,MAAM,OAAO;MACb,aAAa,OAAO;gBAEnB,OAAO;QAJH,OAAO,GAKF,CACZ;KACD,UAAU,KAAK,SACd,oBAACA,OAAK;MAAoB,MAAM,KAAK;gBAClC,KAAK;QADQ,KAAK,IAET,CACZ;KACD,gBACC,oBAACA,OAAK;MAAkB,OAAM;MAAS,MAAM,oBAAC,cAAY;gBACvD,eAAe,EAAE,oBAAoB,SAAS;QADlC,SAEH,GACV;;KACC;IACM;GACI"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { CubeDashboardTabProps, CubeDashboardTabsProps } from "./types.js";
|
|
3
|
-
import * as react from "react";
|
|
4
|
-
import { ReactElement, ReactNode } from "react";
|
|
5
|
-
|
|
6
|
-
//#region src/components/layout/Dashboard/DashboardTabs.d.ts
|
|
7
|
-
declare function DashboardTab(_props: CubeDashboardTabProps): ReactElement | null;
|
|
8
|
-
declare namespace DashboardTab {
|
|
9
|
-
var displayName: string;
|
|
10
|
-
}
|
|
11
|
-
declare const DashboardTabs: react.ForwardRefExoticComponent<CubeDashboardTabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { DashboardTab, DashboardTabs };
|
|
14
|
-
//# sourceMappingURL=DashboardTabs.d.ts.map
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e056095 | Cube Dev Team */
|
|
2
|
-
import { DashboardTreeContext } from "./context.js";
|
|
3
|
-
import { DashboardContainerContent } from "./DashboardContainerContent.js";
|
|
4
|
-
import { DashboardContainerShell, DashboardGrid, DashboardHorizontalStack, DashboardVerticalStack } from "./DashboardContainer.js";
|
|
5
|
-
import { Tab, Tabs } from "../../navigation/Tabs/Tabs.js";
|
|
6
|
-
import { Children, forwardRef, isValidElement, useContext } from "react";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
|
-
//#region src/components/layout/Dashboard/DashboardTabs.tsx
|
|
10
|
-
function DashboardTab(_props) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
DashboardTab.displayName = "DashboardTab";
|
|
14
|
-
function isDashboardTab(child) {
|
|
15
|
-
return isValidElement(child) && (child.type === DashboardTab || child.type.displayName === DashboardTab.displayName);
|
|
16
|
-
}
|
|
17
|
-
function isDashboardTabLayoutContainer(child) {
|
|
18
|
-
if (!isValidElement(child)) return false;
|
|
19
|
-
const displayName = child.type.displayName;
|
|
20
|
-
return child.type === DashboardGrid || child.type === DashboardHorizontalStack || child.type === DashboardVerticalStack || displayName === DashboardGrid.displayName || displayName === DashboardHorizontalStack.displayName || displayName === DashboardVerticalStack.displayName;
|
|
21
|
-
}
|
|
22
|
-
const DashboardTabs = forwardRef(function DashboardTabs(props, ref) {
|
|
23
|
-
const { id, children, rows = 1, activeKey, defaultActiveKey, onActiveChange, ...containerProps } = props;
|
|
24
|
-
const tree = useContext(DashboardTreeContext);
|
|
25
|
-
if (tree.parentKind !== "root") throw new Error(`Dashboard.Tabs "${id}" is only allowed directly inside Dashboard.`);
|
|
26
|
-
const tabs = Children.toArray(children).filter(isDashboardTab);
|
|
27
|
-
const content = /* @__PURE__ */ jsx(Tabs, {
|
|
28
|
-
activeKey,
|
|
29
|
-
defaultActiveKey: defaultActiveKey ?? tabs[0]?.props.id,
|
|
30
|
-
onChange: onActiveChange,
|
|
31
|
-
keepMounted: true,
|
|
32
|
-
label: props["aria-label"] ?? (typeof props.title === "string" ? props.title : id),
|
|
33
|
-
height: "100%",
|
|
34
|
-
barStyles: {
|
|
35
|
-
borderBottom: "1bw #border",
|
|
36
|
-
marginBottom: "1x"
|
|
37
|
-
},
|
|
38
|
-
children: tabs.map((tab) => {
|
|
39
|
-
const tabLayoutId = `${id}:${tab.props.id}`;
|
|
40
|
-
const tabLayoutChildren = Children.toArray(tab.props.children);
|
|
41
|
-
if (tabLayoutChildren.length > 1 || tabLayoutChildren.some((child) => !isDashboardTabLayoutContainer(child))) throw new Error(`Dashboard.Tab "${tab.props.id}" inside "${id}" accepts one Grid, HorizontalStack, or VerticalStack layout container only.`);
|
|
42
|
-
const tabTree = {
|
|
43
|
-
containerDepth: 1,
|
|
44
|
-
parentKind: "tabs",
|
|
45
|
-
parentId: tabLayoutId,
|
|
46
|
-
layoutParentId: tabLayoutId,
|
|
47
|
-
parentColumns: 12,
|
|
48
|
-
parentRows: Math.max(1, Math.floor(rows)),
|
|
49
|
-
ancestorIds: [...tree.ancestorIds, id]
|
|
50
|
-
};
|
|
51
|
-
return /* @__PURE__ */ jsx(Tab, {
|
|
52
|
-
title: tab.props.title,
|
|
53
|
-
keepMounted: tab.props.keepMounted ?? true,
|
|
54
|
-
children: /* @__PURE__ */ jsx(DashboardTreeContext.Provider, {
|
|
55
|
-
value: tabTree,
|
|
56
|
-
children: /* @__PURE__ */ jsx(DashboardContainerContent, {
|
|
57
|
-
id: tabLayoutId,
|
|
58
|
-
kind: "tabs",
|
|
59
|
-
columns: 12,
|
|
60
|
-
rows: Math.max(1, Math.floor(rows)),
|
|
61
|
-
depth: 1,
|
|
62
|
-
ancestorIds: [...tree.ancestorIds, id],
|
|
63
|
-
tabsId: id,
|
|
64
|
-
tabId: tab.props.id,
|
|
65
|
-
children: tab.props.children
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
}, tab.props.id);
|
|
69
|
-
})
|
|
70
|
-
});
|
|
71
|
-
return /* @__PURE__ */ jsx(DashboardContainerShell, {
|
|
72
|
-
...containerProps,
|
|
73
|
-
ref,
|
|
74
|
-
id,
|
|
75
|
-
rows,
|
|
76
|
-
kind: "tabs",
|
|
77
|
-
content,
|
|
78
|
-
children
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
DashboardTabs.displayName = "DashboardTabs";
|
|
82
|
-
|
|
83
|
-
//#endregion
|
|
84
|
-
export { DashboardTab, DashboardTabs };
|
|
85
|
-
//# sourceMappingURL=DashboardTabs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardTabs.js","names":[],"sources":["../../../../src/components/layout/Dashboard/DashboardTabs.tsx"],"sourcesContent":["import { Children, forwardRef, isValidElement, useContext } from 'react';\n\nimport { Tab, Tabs } from '../../navigation/Tabs/Tabs';\n\nimport { DashboardTreeContext } from './context';\nimport {\n DashboardContainerShell,\n DashboardGrid,\n DashboardHorizontalStack,\n DashboardVerticalStack,\n} from './DashboardContainer';\nimport { DashboardContainerContent } from './DashboardContainerContent';\n\nimport type { ForwardedRef, ReactElement, ReactNode } from 'react';\nimport type {\n CubeDashboardTabProps,\n CubeDashboardTabsProps,\n DashboardTreeContextValue,\n} from './types';\n\nexport function DashboardTab(\n _props: CubeDashboardTabProps,\n): ReactElement | null {\n return null;\n}\n\nDashboardTab.displayName = 'DashboardTab';\n\nexport function isDashboardTab(\n child: ReactNode,\n): child is ReactElement<CubeDashboardTabProps> {\n return (\n isValidElement(child) &&\n (child.type === DashboardTab ||\n (child.type as { displayName?: string }).displayName ===\n DashboardTab.displayName)\n );\n}\n\nexport function isDashboardTabLayoutContainer(child: ReactNode): boolean {\n if (!isValidElement(child)) return false;\n\n const displayName = (child.type as { displayName?: string }).displayName;\n\n return (\n child.type === DashboardGrid ||\n child.type === DashboardHorizontalStack ||\n child.type === DashboardVerticalStack ||\n displayName === DashboardGrid.displayName ||\n displayName === DashboardHorizontalStack.displayName ||\n displayName === DashboardVerticalStack.displayName\n );\n}\n\nexport const DashboardTabs = forwardRef(function DashboardTabs(\n props: CubeDashboardTabsProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const {\n id,\n children,\n rows = 1,\n activeKey,\n defaultActiveKey,\n onActiveChange,\n ...containerProps\n } = props;\n const tree = useContext(DashboardTreeContext);\n\n if (tree.parentKind !== 'root') {\n throw new Error(\n `Dashboard.Tabs \"${id}\" is only allowed directly inside Dashboard.`,\n );\n }\n\n const tabs = Children.toArray(children).filter(isDashboardTab);\n const content = (\n <Tabs\n activeKey={activeKey}\n defaultActiveKey={defaultActiveKey ?? tabs[0]?.props.id}\n onChange={onActiveChange}\n keepMounted\n label={\n props['aria-label'] ??\n (typeof props.title === 'string' ? props.title : id)\n }\n height=\"100%\"\n barStyles={{ borderBottom: '1bw #border', marginBottom: '1x' }}\n >\n {tabs.map((tab) => {\n const tabLayoutId = `${id}:${tab.props.id}`;\n const tabLayoutChildren = Children.toArray(tab.props.children);\n\n if (\n tabLayoutChildren.length > 1 ||\n tabLayoutChildren.some(\n (child) => !isDashboardTabLayoutContainer(child),\n )\n ) {\n throw new Error(\n `Dashboard.Tab \"${tab.props.id}\" inside \"${id}\" accepts one Grid, HorizontalStack, or VerticalStack layout container only.`,\n );\n }\n\n const tabTree: DashboardTreeContextValue = {\n containerDepth: 1,\n parentKind: 'tabs',\n parentId: tabLayoutId,\n layoutParentId: tabLayoutId,\n parentColumns: 12,\n parentRows: Math.max(1, Math.floor(rows)),\n ancestorIds: [...tree.ancestorIds, id],\n };\n\n return (\n <Tab\n key={tab.props.id}\n title={tab.props.title}\n keepMounted={tab.props.keepMounted ?? true}\n >\n <DashboardTreeContext.Provider value={tabTree}>\n <DashboardContainerContent\n id={tabLayoutId}\n kind=\"tabs\"\n columns={12}\n rows={Math.max(1, Math.floor(rows))}\n depth={1}\n ancestorIds={[...tree.ancestorIds, id]}\n tabsId={id}\n tabId={tab.props.id}\n >\n {tab.props.children}\n </DashboardContainerContent>\n </DashboardTreeContext.Provider>\n </Tab>\n );\n })}\n </Tabs>\n );\n\n return (\n <DashboardContainerShell\n {...containerProps}\n ref={ref}\n id={id}\n rows={rows}\n kind=\"tabs\"\n content={content}\n children={children}\n />\n );\n});\n\nDashboardTabs.displayName = 'DashboardTabs';\n"],"mappings":";;;;;;;;;AAoBA,SAAgB,aACd,QACqB;AACrB,QAAO;;AAGT,aAAa,cAAc;AAE3B,SAAg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,KAAK,aAAa,GAAG;IACvC;AAED,UACE,oBAAC;IAEC,OAAO,IAAI,MAAM;IACjB,aAAa,IAAI,MAAM,eAAe;cAEtC,oBAAC,qBAAqB;KAAS,OAAO;eACpC,oBAAC;MACC,IAAI;MACJ,MAAK;MACL,SAAS;MACT,MAAM,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC;MACnC,OAAO;MACP,aAAa,CAAC,GAAG,KAAK,aAAa,GAAG;MACtC,QAAQ;MACR,OAAO,IAAI,MAAM;gBAEhB,IAAI,MAAM;OACe;MACE;MAjB3B,IAAI,MAAM,GAkBX;IAER;GACG;AAGT,QACE,oBAAC;EACC,GAAI;EACC;EACD;EACE;EACN,MAAK;EACI;EACC;GACV;EAEJ;AAEF,cAAc,cAAc"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { CubeDashboardWidgetProps } from "./types.js";
|
|
3
|
-
import * as react from "react";
|
|
4
|
-
|
|
5
|
-
//#region src/components/layout/Dashboard/DashboardWidget.d.ts
|
|
6
|
-
declare const DashboardWidget: react.ForwardRefExoticComponent<CubeDashboardWidgetProps & react.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { DashboardWidget };
|
|
9
|
-
//# sourceMappingURL=DashboardWidget.d.ts.map
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e056095 | Cube Dev Team */
|
|
2
|
-
import { extractStyles } from "../../../utils/styles.js";
|
|
3
|
-
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
4
|
-
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
5
|
-
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
6
|
-
import { useI18n } from "../../../i18n/useI18n.js";
|
|
7
|
-
import { DashboardMetricsContext } from "./context.js";
|
|
8
|
-
import { GripVerticalIcon } from "../../../icons/GripVerticalIcon.js";
|
|
9
|
-
import { clamp, clampRows, clampSpan, getPlacementStyle, normalizePlacement } from "./placement.js";
|
|
10
|
-
import { CornerResizeGripElement, ResizeHandleElement, WidgetElement, WidgetSurfaceElement } from "./styles.js";
|
|
11
|
-
import { DashboardNodeActions } from "./DashboardNodeActions.js";
|
|
12
|
-
import { renderDashboardDropPreview } from "./drag.js";
|
|
13
|
-
import { useDashboardNodeInteraction } from "./use-dashboard-node.js";
|
|
14
|
-
import { useDashboardGestures } from "./use-dashboard-gestures.js";
|
|
15
|
-
import { CONTAINER_STYLES, filterBaseProps } from "@tenphi/tasty";
|
|
16
|
-
import { forwardRef, useContext, useRef } from "react";
|
|
17
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
|
|
19
|
-
//#region src/components/layout/Dashboard/DashboardWidget.tsx
|
|
20
|
-
const DashboardWidget = forwardRef(function DashboardWidget(props, ref) {
|
|
21
|
-
const { id, children, isCard = false, isSelectable, onSettingsPress, settingsLabel, onDeletePress, onDuplicatePress, duplicateLabel, actions, onMenuAction, deleteLabel, isMovable = false, isResizable = false, minColumns = 1, maxColumns = 12, minRows = 1, maxRows, onPlacementChange, moveLabel, resizeLabel, column, row, columns, rows, mods, styles: explicitStyles, style, "aria-label": ariaLabel, ...otherProps } = props;
|
|
22
|
-
const { t } = useI18n();
|
|
23
|
-
const metrics = useContext(DashboardMetricsContext);
|
|
24
|
-
const localRef = useRef(null);
|
|
25
|
-
const combinedRef = useCombinedRefs(ref, localRef);
|
|
26
|
-
const node = useDashboardNodeInteraction({
|
|
27
|
-
id,
|
|
28
|
-
isContainer: false,
|
|
29
|
-
isSelectable
|
|
30
|
-
});
|
|
31
|
-
if (node.tree.parentKind === "root") throw new Error(`Dashboard.Widget "${id}" must be placed inside a Dashboard container.`);
|
|
32
|
-
const resolvedMinColumns = clamp(clampSpan(minColumns, 1), 1, node.tree.parentColumns);
|
|
33
|
-
const resolvedMaxColumns = clamp(clampSpan(maxColumns, node.tree.parentColumns), resolvedMinColumns, node.tree.parentColumns);
|
|
34
|
-
const resolvedMinRows = Math.min(clampRows(minRows, 1), node.tree.parentRows);
|
|
35
|
-
const resolvedMaxRows = clamp(clampRows(maxRows, node.tree.parentRows), resolvedMinRows, node.tree.parentRows);
|
|
36
|
-
const normalizedPlacement = normalizePlacement({
|
|
37
|
-
column,
|
|
38
|
-
row,
|
|
39
|
-
columns: clamp(clampSpan(columns, node.tree.parentColumns), resolvedMinColumns, resolvedMaxColumns),
|
|
40
|
-
rows: clamp(clampRows(rows, 1), resolvedMinRows, resolvedMaxRows)
|
|
41
|
-
}, node.tree.parentColumns, node.tree.parentRows);
|
|
42
|
-
const canMove = isMovable && !!onPlacementChange;
|
|
43
|
-
const canMoveColumns = canMove && node.tree.parentKind !== "vertical-stack";
|
|
44
|
-
const canMoveRows = canMove && node.tree.parentKind !== "horizontal-stack";
|
|
45
|
-
const canResizeColumns = isResizable && !!onPlacementChange && node.tree.parentKind !== "vertical-stack" && resolvedMaxColumns > resolvedMinColumns;
|
|
46
|
-
const canResizeRows = isResizable && !!onPlacementChange && node.tree.parentKind !== "horizontal-stack" && resolvedMaxRows > resolvedMinRows;
|
|
47
|
-
const canResize = canResizeColumns || canResizeRows;
|
|
48
|
-
const resizeAxis = canResizeColumns ? canResizeRows ? "both" : "x" : "y";
|
|
49
|
-
const styles = {
|
|
50
|
-
...extractStyles(props, CONTAINER_STYLES),
|
|
51
|
-
...explicitStyles
|
|
52
|
-
};
|
|
53
|
-
const placementStyle = getPlacementStyle(node.tree, normalizedPlacement);
|
|
54
|
-
const baseProps = filterBaseProps(otherProps, {
|
|
55
|
-
eventProps: true,
|
|
56
|
-
labelable: true
|
|
57
|
-
});
|
|
58
|
-
const resolvedLabel = ariaLabel ?? id;
|
|
59
|
-
const isAddSlot = props["data-dashboard-add-slot"] !== void 0;
|
|
60
|
-
const { isMoving, isResizing, dropPreview, surfaceMoveProps, resizeProps, reportPlacement } = useDashboardGestures({
|
|
61
|
-
id,
|
|
62
|
-
isContainer: false,
|
|
63
|
-
nodeRef: localRef,
|
|
64
|
-
tree: node.tree,
|
|
65
|
-
editing: node.editing,
|
|
66
|
-
metrics,
|
|
67
|
-
placement: normalizedPlacement,
|
|
68
|
-
isSelected: node.isSelected,
|
|
69
|
-
selectSelf: node.selectSelf,
|
|
70
|
-
onPlacementChange,
|
|
71
|
-
canMove,
|
|
72
|
-
canMoveColumns,
|
|
73
|
-
canMoveRows,
|
|
74
|
-
canResize,
|
|
75
|
-
canResizeColumns,
|
|
76
|
-
canResizeRows,
|
|
77
|
-
minColumns: resolvedMinColumns,
|
|
78
|
-
maxColumns: resolvedMaxColumns,
|
|
79
|
-
minRows: resolvedMinRows,
|
|
80
|
-
maxRows: resolvedMaxRows,
|
|
81
|
-
isRootChild: false
|
|
82
|
-
});
|
|
83
|
-
const resolvedMods = {
|
|
84
|
-
...mods,
|
|
85
|
-
"add-slot": isAddSlot,
|
|
86
|
-
card: isCard,
|
|
87
|
-
selected: node.isSelected,
|
|
88
|
-
hovered: node.isHovered,
|
|
89
|
-
"focus-within": node.isFocusWithin,
|
|
90
|
-
editing: node.editing.isEditing,
|
|
91
|
-
dragging: node.editing.movingId !== null,
|
|
92
|
-
movable: canMove,
|
|
93
|
-
moving: isMoving,
|
|
94
|
-
resizing: isResizing
|
|
95
|
-
};
|
|
96
|
-
const handleSettingsPress = useEvent(() => {
|
|
97
|
-
node.selectSelf(false);
|
|
98
|
-
onSettingsPress?.();
|
|
99
|
-
});
|
|
100
|
-
const handleDeletePress = useEvent(() => {
|
|
101
|
-
node.selectSelf(false);
|
|
102
|
-
onDeletePress?.();
|
|
103
|
-
});
|
|
104
|
-
const handleDuplicatePress = useEvent(() => {
|
|
105
|
-
node.selectSelf(false);
|
|
106
|
-
onDuplicatePress?.();
|
|
107
|
-
});
|
|
108
|
-
const handleMenuResize = useEvent((next) => {
|
|
109
|
-
reportPlacement(next, "resize", "commit", "command");
|
|
110
|
-
});
|
|
111
|
-
return /* @__PURE__ */ jsxs(WidgetElement, {
|
|
112
|
-
...mergeProps(baseProps, node.interactionProps, surfaceMoveProps),
|
|
113
|
-
ref: combinedRef,
|
|
114
|
-
role: "group",
|
|
115
|
-
"aria-label": moveLabel ?? resolvedLabel,
|
|
116
|
-
"aria-roledescription": t(canMove ? "dashboard.movableWidget" : "dashboard.widget", canMove ? "Movable dashboard widget" : "Dashboard widget"),
|
|
117
|
-
tabIndex: node.canSelect || canMove ? 0 : void 0,
|
|
118
|
-
"data-dashboard-node": "widget",
|
|
119
|
-
"data-dashboard-node-id": id,
|
|
120
|
-
"data-dashboard-column": normalizedPlacement.column,
|
|
121
|
-
"data-dashboard-row": normalizedPlacement.row,
|
|
122
|
-
"data-dashboard-columns": normalizedPlacement.columns,
|
|
123
|
-
"data-dashboard-rows": normalizedPlacement.rows,
|
|
124
|
-
"data-dashboard-min-columns": clampSpan(minColumns, 1),
|
|
125
|
-
"data-dashboard-max-columns": Math.max(clampSpan(minColumns, 1), clampSpan(maxColumns, 12)),
|
|
126
|
-
"data-dashboard-min-rows": clampRows(minRows, 1),
|
|
127
|
-
"data-dashboard-max-rows": maxRows === void 0 ? Number.MAX_SAFE_INTEGER : Math.max(clampRows(minRows, 1), clampRows(maxRows, 1)),
|
|
128
|
-
"data-selected": node.isSelected || void 0,
|
|
129
|
-
"data-moving": isMoving || void 0,
|
|
130
|
-
"data-resizing": isResizing || void 0,
|
|
131
|
-
mods: resolvedMods,
|
|
132
|
-
style: {
|
|
133
|
-
...placementStyle,
|
|
134
|
-
...style
|
|
135
|
-
},
|
|
136
|
-
children: [
|
|
137
|
-
/* @__PURE__ */ jsx(WidgetSurfaceElement, {
|
|
138
|
-
mods: resolvedMods,
|
|
139
|
-
styles,
|
|
140
|
-
children
|
|
141
|
-
}),
|
|
142
|
-
/* @__PURE__ */ jsx(DashboardNodeActions, {
|
|
143
|
-
label: resolvedLabel,
|
|
144
|
-
mods: resolvedMods,
|
|
145
|
-
qaAttribute: "data-dashboard-widget-actions",
|
|
146
|
-
nodeId: id,
|
|
147
|
-
isSelected: node.isSelected,
|
|
148
|
-
placement: normalizedPlacement,
|
|
149
|
-
bounds: {
|
|
150
|
-
minColumns: resolvedMinColumns,
|
|
151
|
-
maxColumns: resolvedMaxColumns,
|
|
152
|
-
minRows: resolvedMinRows,
|
|
153
|
-
maxRows: resolvedMaxRows,
|
|
154
|
-
parentColumns: node.tree.parentColumns,
|
|
155
|
-
parentRows: node.tree.parentRows
|
|
156
|
-
},
|
|
157
|
-
canResizeColumns,
|
|
158
|
-
canResizeRows,
|
|
159
|
-
nodeRef: localRef,
|
|
160
|
-
actions,
|
|
161
|
-
settingsLabel,
|
|
162
|
-
duplicateLabel,
|
|
163
|
-
deleteLabel,
|
|
164
|
-
onResize: handleMenuResize,
|
|
165
|
-
onSettingsPress: onSettingsPress && handleSettingsPress,
|
|
166
|
-
onDuplicatePress: onDuplicatePress && handleDuplicatePress,
|
|
167
|
-
onDeletePress: onDeletePress && handleDeletePress,
|
|
168
|
-
onMenuAction
|
|
169
|
-
}),
|
|
170
|
-
canResize ? /* @__PURE__ */ jsx(ResizeHandleElement, {
|
|
171
|
-
...resizeProps,
|
|
172
|
-
type: "button",
|
|
173
|
-
"aria-label": resizeLabel ?? t("dashboard.resizeWidget", "Resize dashboard widget"),
|
|
174
|
-
"data-dashboard-resize-handle": "",
|
|
175
|
-
"data-dashboard-resize-axis": resizeAxis,
|
|
176
|
-
"data-dashboard-no-select": "",
|
|
177
|
-
"aria-hidden": !node.isSelected || void 0,
|
|
178
|
-
tabIndex: node.isSelected ? void 0 : -1,
|
|
179
|
-
mods: {
|
|
180
|
-
...resolvedMods,
|
|
181
|
-
axis: resizeAxis,
|
|
182
|
-
corner: resizeAxis === "both"
|
|
183
|
-
},
|
|
184
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
185
|
-
"data-element": "Icon",
|
|
186
|
-
children: resizeAxis === "both" ? /* @__PURE__ */ jsx(CornerResizeGripElement, {}) : /* @__PURE__ */ jsx(GripVerticalIcon, { size: "1.5x" })
|
|
187
|
-
})
|
|
188
|
-
}) : null,
|
|
189
|
-
renderDashboardDropPreview(dropPreview, t("dashboard.dropBlocked", "This position is already taken"))
|
|
190
|
-
]
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
//#endregion
|
|
195
|
-
export { DashboardWidget };
|
|
196
|
-
//# sourceMappingURL=DashboardWidget.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardWidget.js","names":[],"sources":["../../../../src/components/layout/Dashboard/DashboardWidget.tsx"],"sourcesContent":["import { CONTAINER_STYLES, filterBaseProps, Styles } from '@tenphi/tasty';\nimport { forwardRef, useContext, useRef, useState } from 'react';\nimport { useMove } from 'react-aria';\n\nimport { useEvent } from '../../../_internal/hooks';\nimport { useI18n } from '../../../i18n';\nimport { GripVerticalIcon } from '../../../icons/GripVerticalIcon';\nimport { mergeProps, useCombinedRefs } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\nimport { Button } from '../../actions/Button/Button';\n\nimport { DashboardMetricsContext } from './context';\nimport { DashboardNodeActions } from './DashboardNodeActions';\nimport { renderDashboardDropPreview } from './drag';\nimport {\n clamp,\n clampRows,\n clampSpan,\n getPlacementStyle,\n isSamePlacement,\n normalizePlacement,\n} from './placement';\nimport {\n CornerResizeGripElement,\n ResizeHandleElement,\n WidgetElement,\n WidgetSurfaceElement,\n} from './styles';\nimport { useDashboardGestures } from './use-dashboard-gestures';\nimport { useDashboardNodeInteraction } from './use-dashboard-node';\n\nimport type { ForwardedRef } from 'react';\nimport type {\n CubeDashboardWidgetProps,\n DashboardPlacement,\n DashboardPlacementChangeInput,\n DashboardPlacementChangeItem,\n DashboardPlacementChangePhase,\n DashboardPlacementChangeReason,\n} from './types';\n\nexport const DashboardWidget = forwardRef(function DashboardWidget(\n props: CubeDashboardWidgetProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const {\n id,\n children,\n isCard = false,\n isSelectable,\n onSettingsPress,\n settingsLabel,\n onDeletePress,\n onDuplicatePress,\n duplicateLabel,\n actions,\n onMenuAction,\n deleteLabel,\n isMovable = false,\n isResizable = false,\n minColumns = 1,\n maxColumns = 12,\n minRows = 1,\n maxRows,\n onPlacementChange,\n moveLabel,\n resizeLabel,\n column,\n row,\n columns,\n rows,\n mods,\n styles: explicitStyles,\n style,\n 'aria-label': ariaLabel,\n ...otherProps\n } = props;\n const { t } = useI18n();\n const metrics = useContext(DashboardMetricsContext);\n const localRef = useRef<HTMLDivElement>(null);\n const combinedRef = useCombinedRefs(ref, localRef);\n const node = useDashboardNodeInteraction({\n id,\n isContainer: false,\n isSelectable,\n });\n\n if (node.tree.parentKind === 'root') {\n throw new Error(\n `Dashboard.Widget \"${id}\" must be placed inside a Dashboard container.`,\n );\n }\n\n const resolvedMinColumns = clamp(\n clampSpan(minColumns, 1),\n 1,\n node.tree.parentColumns,\n );\n const resolvedMaxColumns = clamp(\n clampSpan(maxColumns, node.tree.parentColumns),\n resolvedMinColumns,\n node.tree.parentColumns,\n );\n const resolvedMinRows = Math.min(clampRows(minRows, 1), node.tree.parentRows);\n const resolvedMaxRows = clamp(\n clampRows(maxRows, node.tree.parentRows),\n resolvedMinRows,\n node.tree.parentRows,\n );\n const normalizedPlacement = normalizePlacement(\n {\n column,\n row,\n columns: clamp(\n clampSpan(columns, node.tree.parentColumns),\n resolvedMinColumns,\n resolvedMaxColumns,\n ),\n rows: clamp(clampRows(rows, 1), resolvedMinRows, resolvedMaxRows),\n },\n node.tree.parentColumns,\n node.tree.parentRows,\n );\n const canMove = isMovable && !!onPlacementChange;\n const canMoveColumns = canMove && node.tree.parentKind !== 'vertical-stack';\n const canMoveRows = canMove && node.tree.parentKind !== 'horizontal-stack';\n const canResizeColumns =\n isResizable &&\n !!onPlacementChange &&\n node.tree.parentKind !== 'vertical-stack' &&\n resolvedMaxColumns > resolvedMinColumns;\n const canResizeRows =\n isResizable &&\n !!onPlacementChange &&\n node.tree.parentKind !== 'horizontal-stack' &&\n resolvedMaxRows > resolvedMinRows;\n const canResize = canResizeColumns || canResizeRows;\n const resizeAxis = canResizeColumns ? (canResizeRows ? 'both' : 'x') : 'y';\n\n const extractedStyles = extractStyles(props, CONTAINER_STYLES);\n const styles: Styles = { ...extractedStyles, ...explicitStyles };\n const placementStyle = getPlacementStyle(node.tree, normalizedPlacement);\n const baseProps = filterBaseProps(otherProps, {\n eventProps: true,\n labelable: true,\n });\n const resolvedLabel = ariaLabel ?? id;\n const isAddSlot =\n (\n props as CubeDashboardWidgetProps & {\n 'data-dashboard-add-slot'?: unknown;\n }\n )['data-dashboard-add-slot'] !== undefined;\n const {\n isMoving,\n isResizing,\n dropPreview,\n surfaceMoveProps,\n resizeProps,\n reportPlacement,\n } = useDashboardGestures({\n id,\n isContainer: false,\n nodeRef: localRef,\n tree: node.tree,\n editing: node.editing,\n metrics,\n placement: normalizedPlacement,\n isSelected: node.isSelected,\n selectSelf: node.selectSelf,\n onPlacementChange,\n canMove,\n canMoveColumns,\n canMoveRows,\n canResize,\n canResizeColumns,\n canResizeRows,\n minColumns: resolvedMinColumns,\n maxColumns: resolvedMaxColumns,\n minRows: resolvedMinRows,\n maxRows: resolvedMaxRows,\n isRootChild: false,\n });\n const resolvedMods = {\n ...mods,\n 'add-slot': isAddSlot,\n card: isCard,\n selected: node.isSelected,\n hovered: node.isHovered,\n 'focus-within': node.isFocusWithin,\n editing: node.editing.isEditing,\n dragging: node.editing.movingId !== null,\n movable: canMove,\n moving: isMoving,\n resizing: isResizing,\n };\n const handleSettingsPress = useEvent(() => {\n node.selectSelf(false);\n onSettingsPress?.();\n });\n const handleDeletePress = useEvent(() => {\n node.selectSelf(false);\n onDeletePress?.();\n });\n const handleDuplicatePress = useEvent(() => {\n node.selectSelf(false);\n onDuplicatePress?.();\n });\n const handleMenuResize = useEvent((next: DashboardPlacement) => {\n reportPlacement(next, 'resize', 'commit', 'command');\n });\n\n return (\n <WidgetElement\n {...mergeProps(baseProps, node.interactionProps, surfaceMoveProps)}\n ref={combinedRef}\n role=\"group\"\n aria-label={moveLabel ?? resolvedLabel}\n aria-roledescription={t(\n canMove ? 'dashboard.movableWidget' : 'dashboard.widget',\n canMove ? 'Movable dashboard widget' : 'Dashboard widget',\n )}\n tabIndex={node.canSelect || canMove ? 0 : undefined}\n data-dashboard-node=\"widget\"\n data-dashboard-node-id={id}\n data-dashboard-column={normalizedPlacement.column}\n data-dashboard-row={normalizedPlacement.row}\n data-dashboard-columns={normalizedPlacement.columns}\n data-dashboard-rows={normalizedPlacement.rows}\n data-dashboard-min-columns={clampSpan(minColumns, 1)}\n data-dashboard-max-columns={Math.max(\n clampSpan(minColumns, 1),\n clampSpan(maxColumns, 12),\n )}\n data-dashboard-min-rows={clampRows(minRows, 1)}\n data-dashboard-max-rows={\n maxRows === undefined\n ? Number.MAX_SAFE_INTEGER\n : Math.max(clampRows(minRows, 1), clampRows(maxRows, 1))\n }\n data-selected={node.isSelected || undefined}\n data-moving={isMoving || undefined}\n data-resizing={isResizing || undefined}\n mods={resolvedMods}\n style={{ ...placementStyle, ...style }}\n >\n <WidgetSurfaceElement mods={resolvedMods} styles={styles}>\n {children}\n </WidgetSurfaceElement>\n <DashboardNodeActions\n label={resolvedLabel}\n mods={resolvedMods}\n qaAttribute=\"data-dashboard-widget-actions\"\n nodeId={id}\n isSelected={node.isSelected}\n placement={normalizedPlacement}\n bounds={{\n minColumns: resolvedMinColumns,\n maxColumns: resolvedMaxColumns,\n minRows: resolvedMinRows,\n maxRows: resolvedMaxRows,\n parentColumns: node.tree.parentColumns,\n parentRows: node.tree.parentRows,\n }}\n canResizeColumns={canResizeColumns}\n canResizeRows={canResizeRows}\n nodeRef={localRef}\n actions={actions}\n settingsLabel={settingsLabel}\n duplicateLabel={duplicateLabel}\n deleteLabel={deleteLabel}\n onResize={handleMenuResize}\n onSettingsPress={onSettingsPress && handleSettingsPress}\n onDuplicatePress={onDuplicatePress && handleDuplicatePress}\n onDeletePress={onDeletePress && handleDeletePress}\n onMenuAction={onMenuAction}\n />\n {canResize ? (\n <ResizeHandleElement\n {...resizeProps}\n type=\"button\"\n aria-label={\n resizeLabel ??\n t('dashboard.resizeWidget', 'Resize dashboard widget')\n }\n data-dashboard-resize-handle=\"\"\n data-dashboard-resize-axis={resizeAxis}\n data-dashboard-no-select=\"\"\n aria-hidden={!node.isSelected || undefined}\n tabIndex={node.isSelected ? undefined : -1}\n mods={{\n ...resolvedMods,\n axis: resizeAxis,\n corner: resizeAxis === 'both',\n }}\n >\n <span data-element=\"Icon\">\n {resizeAxis === 'both' ? (\n <CornerResizeGripElement />\n ) : (\n <GripVerticalIcon size=\"1.5x\" />\n )}\n </span>\n </ResizeHandleElement>\n ) : null}\n {renderDashboardDropPreview(\n dropPreview,\n t('dashboard.dropBlocked', 'This position is already taken'),\n )}\n </WidgetElement>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyCA,MAAa,kBAAkB,WAAW,SAAS,gBACjD,OACA,KACA;CACA,MAAM,EACJ,IACA,UACA,SAAS,OACT,cACA,iBACA,eACA,eACA,kBACA,gBACA,SACA,cACA,aACA,YAAY,OACZ,cAAc,OACd,aAAa,GACb,aAAa,IACb,UAAU,GACV,SACA,mBACA,WACA,aACA,QACA,KACA,SACA,MACA,MACA,QAAQ,gBACR,OACA,cAAc,WACd,GAAG,eACD;CACJ,MAAM,EAAE,MAAM,SAAS;CACvB,MAAM,UAAU,WAAW,wBAAwB;CACnD,MAAM,WAAW,OAAuB,KAAK;CAC7C,MAAM,cAAc,gBAAgB,KAAK,SAAS;CAClD,MAAM,OAAO,4BAA4B;EACvC;EACA,aAAa;EACb;EACD,CAAC;AAEF,KAAI,KAAK,KAAK,eAAe,OAC3B,OAAM,IAAI,MACR,qBAAqB,GAAG,gDACzB;CAGH,MAAM,qBAAqB,MACzB,UAAU,YAAY,EAAE,EACxB,GACA,KAAK,KAAK,cACX;CACD,MAAM,qBAAqB,MACzB,UAAU,YAAY,KAAK,KAAK,cAAc,EAC9C,oBACA,KAAK,KAAK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