@cube-dev/ui-kit 0.0.0-canary-ec74d45 → 0.0.0-canary-e37e543
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-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 +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 +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.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 +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.d.ts +67 -0
- package/dist/components/fields/ColorPicker/ColorPicker.js +232 -0
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/fields/ColorPicker/ColorPickerPanel.js +149 -0
- package/dist/components/fields/ColorPicker/ColorPickerPanel.js.map +1 -0
- package/dist/components/fields/ColorPicker/channels.d.ts +13 -0
- package/dist/components/fields/ColorPicker/channels.js +194 -0
- package/dist/components/fields/ColorPicker/channels.js.map +1 -0
- package/dist/components/fields/ColorPicker/color.d.ts +15 -0
- package/dist/components/fields/ColorPicker/color.js +282 -0
- package/dist/components/fields/ColorPicker/color.js.map +1 -0
- package/dist/components/fields/ColorPicker/index.d.ts +4 -0
- 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/index.d.ts +4 -0
- 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.d.ts +1 -55
- package/dist/components/layout/Board/Board.js +75 -278
- package/dist/components/layout/Board/Board.js.map +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.d.ts +0 -16
- package/dist/components/layout/Board/Widget.js +3 -6
- package/dist/components/layout/Board/Widget.js.map +1 -1
- package/dist/components/layout/Board/WidgetHost.js +14 -81
- package/dist/components/layout/Board/WidgetHost.js.map +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-context.js.map +1 -1
- package/dist/components/layout/Board/board-store.js +2 -2
- package/dist/components/layout/Board/board-store.js.map +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/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.d.ts +1 -2
- package/dist/components/layout/Board/index.js +2 -2
- package/dist/components/layout/Board/index.js.map +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +12 -17
- package/dist/components/layout/Board/use-board-layout.js.map +1 -1
- package/dist/components/layout/Board/use-board-registry.js +20 -139
- package/dist/components/layout/Board/use-board-registry.js.map +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/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/FileTabs/FileTabs.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 +1 -9
- 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 +1 -9
- package/dist/i18n/locales/en-US/uikit.js +1 -9
- package/dist/i18n/locales/en-US/uikit.json.d.ts +1 -9
- package/dist/i18n/locales/es-ES/uikit.js +1 -9
- package/dist/i18n/locales/es-MX/uikit.js +1 -9
- package/dist/i18n/locales/fr-FR/uikit.js +1 -9
- package/dist/i18n/locales/it-IT/uikit.js +1 -9
- package/dist/i18n/locales/ja-JP/uikit.js +1 -9
- package/dist/i18n/locales/nb-NO/uikit.js +1 -9
- package/dist/i18n/locales/pt-BR/uikit.js +1 -9
- package/dist/i18n/locales/pt-PT/uikit.js +1 -9
- package/dist/i18n/locales/sv-SE/uikit.js +1 -9
- package/dist/i18n/locales/vi-VN/uikit.js +1 -9
- 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/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.d.ts +12 -0
- package/dist/icons/PipetteIcon.js +11 -0
- package/dist/icons/PipetteIcon.js.map +1 -0
- 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 +1 -0
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +12 -9
- 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/colors.js +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.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/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/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/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/components/fields/ColorPicker.md +271 -0
- package/docs/components/layout/Board.md +6 -154
- package/package.json +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +0 -132
- package/dist/components/layout/Board/grid-core/group-move.js.map +0 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +0 -24
- package/dist/components/layout/Board/use-board-select-modifier-key.js.map +0 -1
- package/dist/components/layout/Board/use-board-selection.d.ts +0 -8
- package/dist/components/layout/Board/use-board-selection.js +0 -113
- package/dist/components/layout/Board/use-board-selection.js.map +0 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e37e543 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
|
-
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
5
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
6
|
-
import { useI18n } from "../../../i18n/useI18n.js";
|
|
7
5
|
import { BoardGridLinesContext, BoardMetricsContext, useBoardGridLines, useBoardHost, useBoardMetrics, useBoardRegistry } from "./board-context.js";
|
|
8
6
|
import { getAllCollisions } from "./grid-core/collision.js";
|
|
9
7
|
import { bottom, cloneLayout, correctBounds, getLayoutItem, modifyLayout } from "./grid-core/layout.js";
|
|
@@ -12,13 +10,10 @@ import { calcGridColWidth, calcGridItemPosition, calcWH } from "./grid-core/calc
|
|
|
12
10
|
import { applySizeConstraints, defaultConstraints } from "./grid-core/constraints.js";
|
|
13
11
|
import { BoardProvider } from "./BoardProvider.js";
|
|
14
12
|
import { useBoardLayout } from "./use-board-layout.js";
|
|
15
|
-
import { useBoardSelectModifierKey } from "./use-board-select-modifier-key.js";
|
|
16
|
-
import { useBoardSelection } from "./use-board-selection.js";
|
|
17
13
|
import { WidgetHost } from "./WidgetHost.js";
|
|
18
14
|
import { CONTAINER_STYLES, filterBaseProps, mergeStyles, tasty } from "@tenphi/tasty";
|
|
19
15
|
import { forwardRef, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
20
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { useFocusWithin } from "react-aria";
|
|
22
17
|
import { useResizeObserver } from "@react-aria/utils";
|
|
23
18
|
|
|
24
19
|
//#region src/components/layout/Board/Board.tsx
|
|
@@ -31,8 +26,7 @@ const BoardElement = tasty({
|
|
|
31
26
|
flexGrow: 1,
|
|
32
27
|
height: "min 0",
|
|
33
28
|
fill: "#surface",
|
|
34
|
-
boxSizing: "border-box"
|
|
35
|
-
outline: 0
|
|
29
|
+
boxSizing: "border-box"
|
|
36
30
|
}
|
|
37
31
|
});
|
|
38
32
|
const ContentLayer = tasty({ styles: {
|
|
@@ -45,40 +39,15 @@ const PlaceholderElement = tasty({
|
|
|
45
39
|
position: "absolute",
|
|
46
40
|
top: 0,
|
|
47
41
|
left: 0,
|
|
48
|
-
fill: "#
|
|
42
|
+
fill: "#purple.10",
|
|
49
43
|
radius: "1cr",
|
|
50
|
-
border: "#
|
|
44
|
+
border: "#purple.40",
|
|
51
45
|
zIndex: 2,
|
|
52
46
|
pointerEvents: "none",
|
|
53
47
|
transition: "inset 80ms linear, width 80ms linear, height 80ms linear",
|
|
54
48
|
boxSizing: "border-box"
|
|
55
49
|
}
|
|
56
50
|
});
|
|
57
|
-
const MarqueeElement = tasty({
|
|
58
|
-
qa: "BoardMarquee",
|
|
59
|
-
styles: {
|
|
60
|
-
position: "absolute",
|
|
61
|
-
top: 0,
|
|
62
|
-
left: 0,
|
|
63
|
-
fill: "#primary-accent-surface.06",
|
|
64
|
-
border: "1bw dashed #primary-border",
|
|
65
|
-
radius: "1cr",
|
|
66
|
-
zIndex: 3,
|
|
67
|
-
pointerEvents: "none",
|
|
68
|
-
boxSizing: "border-box"
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
const A11yLayer = tasty({ styles: {
|
|
72
|
-
position: "absolute",
|
|
73
|
-
width: "1px",
|
|
74
|
-
height: "1px",
|
|
75
|
-
padding: 0,
|
|
76
|
-
margin: "-1px",
|
|
77
|
-
overflow: "hidden",
|
|
78
|
-
clipPath: "inset(50%)",
|
|
79
|
-
whiteSpace: "nowrap",
|
|
80
|
-
border: 0
|
|
81
|
-
} });
|
|
82
51
|
const GridOverlayElement = tasty({
|
|
83
52
|
qa: "BoardGridOverlay",
|
|
84
53
|
styles: {
|
|
@@ -89,32 +58,12 @@ const GridOverlayElement = tasty({
|
|
|
89
58
|
opacity: ".5"
|
|
90
59
|
}
|
|
91
60
|
});
|
|
92
|
-
/**
|
|
93
|
-
* Descendants whose clicks never change the selection. A widget is a large
|
|
94
|
-
* surface the user also clicks to *work with*, so anything interactive inside it
|
|
95
|
-
* must keep its click. `[data-no-select]` is the escape hatch for an app's own
|
|
96
|
-
* custom controls.
|
|
97
|
-
*/
|
|
98
|
-
const BOARD_SELECTION_CANCEL = "input,textarea,select,button,a,[role=\"button\"],[role=\"menuitem\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"tab\"],[contenteditable=\"true\"],[data-no-select]";
|
|
99
|
-
/** Manhattan distance a pointer must travel before a press becomes a marquee. */
|
|
100
|
-
const MARQUEE_THRESHOLD = 4;
|
|
101
|
-
/**
|
|
102
|
-
* Whether an event landed in a text-editing context. Checking the *event target*
|
|
103
|
-
* beats `document.activeElement`: it stays correct for content rendered through
|
|
104
|
-
* a portal, and it cannot be fooled by focus that moved between the keystroke
|
|
105
|
-
* and the handler.
|
|
106
|
-
*/
|
|
107
|
-
function isEditableTarget(target) {
|
|
108
|
-
const el = target;
|
|
109
|
-
if (!el || typeof el.closest !== "function") return false;
|
|
110
|
-
return !!el.closest("input,textarea,select,[contenteditable=\"true\"]");
|
|
111
|
-
}
|
|
112
61
|
function compactTypeToCore(compact) {
|
|
113
62
|
if (compact === "free") return null;
|
|
114
63
|
return compact;
|
|
115
64
|
}
|
|
116
65
|
function BoardInner(props, ref) {
|
|
117
|
-
const { id: providedId, layout: controlledLayout, defaultLayout, onLayoutChange, onDragStart, onDrag, onDragStop, onResizeStart, onResize: onResizeProp, onResizeStop, cols = 12, rowHeight = 100, margin = [8, 8], containerPadding, maxRows = Infinity, compact = "vertical", allowOverlap = false, preventCollision = false, isDraggable = true, isResizable = true, isDroppable = true, resizeHandles = ["se"], dragCancel, dragHandle, showGridLines, isAligned = false,
|
|
66
|
+
const { id: providedId, layout: controlledLayout, defaultLayout, onLayoutChange, onDragStart, onDrag, onDragStop, onResizeStart, onResize: onResizeProp, onResizeStop, cols = 12, rowHeight = 100, margin = [8, 8], containerPadding, maxRows = Infinity, compact = "vertical", allowOverlap = false, preventCollision = false, isDraggable = true, isResizable = true, isDroppable = true, resizeHandles = ["se"], dragCancel, dragHandle, showGridLines, isAligned = false, constraints, width: providedWidth, widgetProps, children, ...otherProps } = props;
|
|
118
67
|
const registry = useBoardRegistry();
|
|
119
68
|
const parentMetrics = useBoardMetrics();
|
|
120
69
|
const host = useBoardHost();
|
|
@@ -128,8 +77,6 @@ function BoardInner(props, ref) {
|
|
|
128
77
|
const effectiveShowGridLines = showGridLines ?? (inheritedGridLines ? "drag" : false);
|
|
129
78
|
const generatedId = useId();
|
|
130
79
|
const boardId = providedId ?? generatedId;
|
|
131
|
-
const selectedHintId = `${generatedId}-selected`;
|
|
132
|
-
const { t } = useI18n();
|
|
133
80
|
const containerRef = useCombinedRefs(ref);
|
|
134
81
|
const contentRef = useRef(null);
|
|
135
82
|
const [measuredWidth, setMeasuredWidth] = useState(0);
|
|
@@ -150,29 +97,15 @@ function BoardInner(props, ref) {
|
|
|
150
97
|
useEffect(() => {
|
|
151
98
|
if (providedWidth == null) onResizeContainer();
|
|
152
99
|
}, [providedWidth]);
|
|
153
|
-
const { layout, layoutRef,
|
|
100
|
+
const { layout, layoutRef, placeholder, placeholderRef, setPlaceholder, applyLayout } = useBoardLayout({
|
|
154
101
|
layout: controlledLayout,
|
|
155
102
|
defaultLayout,
|
|
156
103
|
onLayoutChange
|
|
157
104
|
});
|
|
158
|
-
const getWidgetLabel = useEvent((key) => {
|
|
159
|
-
const registration = registry.store.get(key);
|
|
160
|
-
return registration?.["aria-label"] ?? registration?.qa ?? key;
|
|
161
|
-
});
|
|
162
|
-
const isWidgetSelectable = (key) => (registry.store.get(key)?.isSelectable ?? widgetProps?.isSelectable) !== false;
|
|
163
|
-
const { selectedKeySet, selectedKeysRef, setSelection, select, clearSelection, announcement } = useBoardSelection({
|
|
164
|
-
selectionMode,
|
|
165
|
-
selectedKeys,
|
|
166
|
-
defaultSelectedKeys,
|
|
167
|
-
onSelectionChange,
|
|
168
|
-
layout,
|
|
169
|
-
getLabel: getWidgetLabel
|
|
170
|
-
});
|
|
171
|
-
const selectModifierKey = useBoardSelectModifierKey();
|
|
172
105
|
useSyncExternalStore(registry.store.subscribe, registry.store.getVersion);
|
|
173
106
|
const effectiveMargin = aligned ? parentMetrics.margin : margin;
|
|
174
107
|
const resolvedPadding = containerPadding ?? (aligned ? [0, 0] : effectiveMargin);
|
|
175
|
-
const rows = Math.max(bottom(layout),
|
|
108
|
+
const rows = Math.max(bottom(layout), placeholder ? placeholder.y + placeholder.h : 0);
|
|
176
109
|
const parentColWidth = aligned ? parentMetrics.colWidth : 0;
|
|
177
110
|
const alignedCols = aligned && width > 0 ? Math.max(1, Math.floor((width - resolvedPadding[0] * 2 + effectiveMargin[0] + 2) / (parentColWidth + effectiveMargin[0]))) : cols;
|
|
178
111
|
const effectiveCols = aligned ? alignedCols : cols;
|
|
@@ -220,7 +153,7 @@ function BoardInner(props, ref) {
|
|
|
220
153
|
isDroppable
|
|
221
154
|
};
|
|
222
155
|
const applyLayoutEvent = useEvent(applyLayout);
|
|
223
|
-
const
|
|
156
|
+
const setPlaceholderEvent = useEvent(setPlaceholder);
|
|
224
157
|
const entryRef = useRef(null);
|
|
225
158
|
if (!entryRef.current) entryRef.current = {
|
|
226
159
|
id: boardId,
|
|
@@ -232,9 +165,8 @@ function BoardInner(props, ref) {
|
|
|
232
165
|
getMaxRows: () => liveRef.current.maxRows,
|
|
233
166
|
getContainerHeight: () => liveRef.current.containerHeight,
|
|
234
167
|
getLayout: () => layoutRef.current,
|
|
235
|
-
getSelectedKeys: () => selectedKeysRef.current.size > 0 ? selectedKeysRef.current : null,
|
|
236
168
|
applyLayout: (next, commit) => applyLayoutEvent(next, commit),
|
|
237
|
-
|
|
169
|
+
setPlaceholder: (item) => setPlaceholderEvent(item),
|
|
238
170
|
isDroppable: () => liveRef.current.isDroppable
|
|
239
171
|
};
|
|
240
172
|
useEffect(() => {
|
|
@@ -303,15 +235,12 @@ function BoardInner(props, ref) {
|
|
|
303
235
|
accX: 0,
|
|
304
236
|
accY: 0
|
|
305
237
|
};
|
|
306
|
-
|
|
238
|
+
setPlaceholder({ ...item });
|
|
307
239
|
onResizeStart?.({
|
|
308
240
|
layout: layoutRef.current,
|
|
309
241
|
item: { ...item },
|
|
310
242
|
oldItem: { ...item },
|
|
311
|
-
placeholder: { ...item }
|
|
312
|
-
items: [{ ...item }],
|
|
313
|
-
oldItems: [{ ...item }],
|
|
314
|
-
placeholders: [{ ...item }]
|
|
243
|
+
placeholder: { ...item }
|
|
315
244
|
});
|
|
316
245
|
return;
|
|
317
246
|
}
|
|
@@ -320,16 +249,12 @@ function BoardInner(props, ref) {
|
|
|
320
249
|
if (phase === "end") {
|
|
321
250
|
const finalLayout = [...layoutRef.current];
|
|
322
251
|
applyLayout(finalLayout, true);
|
|
323
|
-
|
|
324
|
-
const resizedItem = getLayoutItem(finalLayout, id) ?? rs.item;
|
|
252
|
+
setPlaceholder(null);
|
|
325
253
|
onResizeStop?.({
|
|
326
254
|
layout: finalLayout,
|
|
327
|
-
item:
|
|
255
|
+
item: getLayoutItem(finalLayout, id) ?? rs.item,
|
|
328
256
|
oldItem: rs.item,
|
|
329
|
-
placeholder: null
|
|
330
|
-
items: [resizedItem],
|
|
331
|
-
oldItems: [rs.item],
|
|
332
|
-
placeholders: []
|
|
257
|
+
placeholder: null
|
|
333
258
|
});
|
|
334
259
|
resizeStateRef.current = null;
|
|
335
260
|
return;
|
|
@@ -382,16 +307,12 @@ function BoardInner(props, ref) {
|
|
|
382
307
|
const compacted = [...compactor.compact(working, pp.cols)];
|
|
383
308
|
applyLayout(compacted, false);
|
|
384
309
|
const nextPlaceholder = getLayoutItem(compacted, id) ?? newItem;
|
|
385
|
-
|
|
386
|
-
const resizedItem = getLayoutItem(compacted, id) ?? newItem;
|
|
310
|
+
setPlaceholder(nextPlaceholder);
|
|
387
311
|
onResizeProp?.({
|
|
388
312
|
layout: compacted,
|
|
389
|
-
item:
|
|
313
|
+
item: getLayoutItem(compacted, id) ?? newItem,
|
|
390
314
|
oldItem: rs.item,
|
|
391
|
-
placeholder: nextPlaceholder
|
|
392
|
-
items: [resizedItem],
|
|
393
|
-
oldItems: [rs.item],
|
|
394
|
-
placeholders: [nextPlaceholder]
|
|
315
|
+
placeholder: nextPlaceholder
|
|
395
316
|
});
|
|
396
317
|
});
|
|
397
318
|
const handleAutoHeight = useEvent((id, neededRows) => {
|
|
@@ -407,117 +328,23 @@ function BoardInner(props, ref) {
|
|
|
407
328
|
applyLayout([...liveRef.current.compactor.compact(working, pp.cols)], true);
|
|
408
329
|
});
|
|
409
330
|
const dragOldItemRef = useRef(null);
|
|
410
|
-
const dragOldItemsRef = useRef([]);
|
|
411
331
|
const handleDragLifecycle = useEvent((id, phase) => {
|
|
412
332
|
const currentLayout = layoutRef.current;
|
|
413
333
|
const liveItem = getLayoutItem(currentLayout, id);
|
|
414
|
-
if (phase === "start") {
|
|
415
|
-
dragOldItemRef.current = liveItem ? { ...liveItem } : null;
|
|
416
|
-
const ds = registry.getDragState();
|
|
417
|
-
dragOldItemsRef.current = ds && ds.itemId === id ? ds.items.map((it) => ({ ...it })) : [];
|
|
418
|
-
}
|
|
334
|
+
if (phase === "start") dragOldItemRef.current = liveItem ? { ...liveItem } : null;
|
|
419
335
|
const oldItem = dragOldItemRef.current ?? liveItem;
|
|
420
336
|
if (!oldItem) return;
|
|
421
|
-
const item = liveItem ?? oldItem;
|
|
422
|
-
const oldItems = dragOldItemsRef.current.length ? dragOldItemsRef.current : [oldItem];
|
|
423
|
-
const items = oldItems.map((old) => getLayoutItem(currentLayout, old.i) ?? old);
|
|
424
337
|
const info = {
|
|
425
338
|
layout: currentLayout,
|
|
426
|
-
item,
|
|
339
|
+
item: liveItem ?? oldItem,
|
|
427
340
|
oldItem,
|
|
428
|
-
placeholder: placeholderRef.current
|
|
429
|
-
items,
|
|
430
|
-
oldItems,
|
|
431
|
-
placeholders: placeholdersRef.current
|
|
341
|
+
placeholder: placeholderRef.current
|
|
432
342
|
};
|
|
433
343
|
if (phase === "start") onDragStart?.(info);
|
|
434
344
|
else if (phase === "move") onDrag?.(info);
|
|
435
345
|
else {
|
|
436
346
|
onDragStop?.(info);
|
|
437
347
|
dragOldItemRef.current = null;
|
|
438
|
-
dragOldItemsRef.current = [];
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
const [marqueeRect, setMarqueeRect] = useState(null);
|
|
442
|
-
const handleContentPointerDown = useEvent((event) => {
|
|
443
|
-
if (selectionMode !== "multiple" || !allowMarqueeSelection || event.button !== 0 || registry.dragState) return;
|
|
444
|
-
const target = event.target;
|
|
445
|
-
if (target?.closest("[data-board-widget-host]")) return;
|
|
446
|
-
if (selectionCancel && target?.closest(selectionCancel)) return;
|
|
447
|
-
const content = contentRef.current;
|
|
448
|
-
if (!content) return;
|
|
449
|
-
const origin = content.getBoundingClientRect();
|
|
450
|
-
const startX = event.clientX;
|
|
451
|
-
const startY = event.clientY;
|
|
452
|
-
const additive = event[selectModifierKey] || event.shiftKey;
|
|
453
|
-
const base = additive ? [...selectedKeysRef.current] : [];
|
|
454
|
-
let passedThreshold = false;
|
|
455
|
-
const hitTest = (clientX, clientY) => {
|
|
456
|
-
const left = Math.min(startX, clientX) - origin.left;
|
|
457
|
-
const right = Math.max(startX, clientX) - origin.left;
|
|
458
|
-
const top = Math.min(startY, clientY) - origin.top;
|
|
459
|
-
const bottom = Math.max(startY, clientY) - origin.top;
|
|
460
|
-
const next = new Set(base);
|
|
461
|
-
for (const it of layoutRef.current) {
|
|
462
|
-
if (!isWidgetSelectable(it.i)) continue;
|
|
463
|
-
const pos = calcGridItemPosition(liveRef.current.positionParams, it.x, it.y, it.w, it.h);
|
|
464
|
-
if (pos.left < right && pos.left + pos.width > left && pos.top < bottom && pos.top + pos.height > top) next.add(it.i);
|
|
465
|
-
}
|
|
466
|
-
return {
|
|
467
|
-
next,
|
|
468
|
-
box: {
|
|
469
|
-
left,
|
|
470
|
-
top,
|
|
471
|
-
width: right - left,
|
|
472
|
-
height: bottom - top
|
|
473
|
-
}
|
|
474
|
-
};
|
|
475
|
-
};
|
|
476
|
-
const handleMove = (e) => {
|
|
477
|
-
if (!passedThreshold && Math.abs(e.clientX - startX) + Math.abs(e.clientY - startY) < MARQUEE_THRESHOLD) return;
|
|
478
|
-
passedThreshold = true;
|
|
479
|
-
setMarqueeRect(hitTest(e.clientX, e.clientY).box);
|
|
480
|
-
};
|
|
481
|
-
const finish = (e) => {
|
|
482
|
-
window.removeEventListener("pointermove", handleMove);
|
|
483
|
-
window.removeEventListener("pointerup", finish);
|
|
484
|
-
window.removeEventListener("pointercancel", finish);
|
|
485
|
-
setMarqueeRect(null);
|
|
486
|
-
if (passedThreshold) setSelection(hitTest(e.clientX, e.clientY).next);
|
|
487
|
-
else if (!additive) clearSelection();
|
|
488
|
-
containerRef.current?.focus({ preventScroll: true });
|
|
489
|
-
};
|
|
490
|
-
window.addEventListener("pointermove", handleMove);
|
|
491
|
-
window.addEventListener("pointerup", finish);
|
|
492
|
-
window.addEventListener("pointercancel", finish);
|
|
493
|
-
});
|
|
494
|
-
const marqueeStyle = marqueeRect ? {
|
|
495
|
-
left: `${marqueeRect.left}px`,
|
|
496
|
-
top: `${marqueeRect.top}px`,
|
|
497
|
-
width: `${marqueeRect.width}px`,
|
|
498
|
-
height: `${marqueeRect.height}px`
|
|
499
|
-
} : null;
|
|
500
|
-
const { focusWithinProps: boardFocusWithinProps } = useFocusWithin({
|
|
501
|
-
isDisabled: selectionMode === "none",
|
|
502
|
-
onBlurWithin: () => clearSelection()
|
|
503
|
-
});
|
|
504
|
-
const handleBoardKeyDown = useEvent((event) => {
|
|
505
|
-
if (selectionMode === "none") return;
|
|
506
|
-
const selected = selectedKeysRef.current;
|
|
507
|
-
if (selected.size === 0) return;
|
|
508
|
-
if (event.key === "Escape") {
|
|
509
|
-
event.preventDefault();
|
|
510
|
-
event.stopPropagation();
|
|
511
|
-
clearSelection();
|
|
512
|
-
return;
|
|
513
|
-
}
|
|
514
|
-
if ((event.key === "Delete" || event.key === "Backspace") && onWidgetsDelete && !isEditableTarget(event.target)) {
|
|
515
|
-
event.preventDefault();
|
|
516
|
-
event.stopPropagation();
|
|
517
|
-
const keys = [...selected];
|
|
518
|
-
clearSelection();
|
|
519
|
-
onWidgetsDelete(keys);
|
|
520
|
-
containerRef.current?.focus({ preventScroll: true });
|
|
521
348
|
}
|
|
522
349
|
});
|
|
523
350
|
const styles = extractStyles(otherProps, CONTAINER_STYLES);
|
|
@@ -540,18 +367,16 @@ function BoardInner(props, ref) {
|
|
|
540
367
|
};
|
|
541
368
|
}, [ready]);
|
|
542
369
|
const hostWidgetIsDragging = !!dragState && dragState.nestedBoardIds.has(boardId);
|
|
543
|
-
const
|
|
544
|
-
const pos = calcGridItemPosition(positionParams,
|
|
370
|
+
const placeholderStyle = placeholder ? (() => {
|
|
371
|
+
const pos = calcGridItemPosition(positionParams, placeholder.x, placeholder.y, placeholder.w, placeholder.h);
|
|
545
372
|
return {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
width: `${pos.width}px`,
|
|
551
|
-
height: `${pos.height}px`
|
|
552
|
-
}
|
|
373
|
+
left: `${pos.left}px`,
|
|
374
|
+
top: `${pos.top}px`,
|
|
375
|
+
width: `${pos.width}px`,
|
|
376
|
+
height: `${pos.height}px`
|
|
553
377
|
};
|
|
554
|
-
})
|
|
378
|
+
})() : null;
|
|
379
|
+
const showPlaceholder = placeholder && placeholderStyle;
|
|
555
380
|
const gridOverlayStyle = !hostWidgetIsDragging && (effectiveShowGridLines === true || effectiveShowGridLines === "drag" && (!!dragState || !!placeholder)) ? (() => {
|
|
556
381
|
const colWidth = calcGridColWidth(positionParams);
|
|
557
382
|
const rowHeightPx = positionParams.rowHeight;
|
|
@@ -591,87 +416,59 @@ function BoardInner(props, ref) {
|
|
|
591
416
|
children: /* @__PURE__ */ jsx(BoardGridLinesContext.Provider, {
|
|
592
417
|
value: effectiveShowGridLines === true || effectiveShowGridLines === "drag",
|
|
593
418
|
children: /* @__PURE__ */ jsxs(BoardElement, {
|
|
594
|
-
...
|
|
419
|
+
...filterBaseProps(otherProps, { eventProps: true }),
|
|
595
420
|
ref: containerRef,
|
|
596
421
|
styles,
|
|
597
|
-
tabIndex: selectionMode !== "none" ? -1 : void 0,
|
|
598
|
-
"data-board-id": boardId,
|
|
599
422
|
style: aligned ? void 0 : { minHeight: `${containerHeight}px` },
|
|
600
423
|
mods: {
|
|
601
424
|
dragging: !!dragState,
|
|
602
425
|
"drop-target": dragState?.currentBoardId === boardId
|
|
603
426
|
},
|
|
604
|
-
children: [
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
onResize: handleResize,
|
|
650
|
-
onAutoHeight: handleAutoHeight,
|
|
651
|
-
onDragLifecycle: handleDragLifecycle
|
|
652
|
-
}, item.i);
|
|
653
|
-
}) : null,
|
|
654
|
-
placeholderStyles.map(({ i, style }) => /* @__PURE__ */ jsx(PlaceholderElement, {
|
|
655
|
-
"aria-hidden": "true",
|
|
656
|
-
style
|
|
657
|
-
}, i)),
|
|
658
|
-
marqueeStyle ? /* @__PURE__ */ jsx(MarqueeElement, {
|
|
659
|
-
"aria-hidden": "true",
|
|
660
|
-
style: marqueeStyle
|
|
661
|
-
}) : null
|
|
662
|
-
]
|
|
663
|
-
}),
|
|
664
|
-
selectionMode !== "none" ? /* @__PURE__ */ jsxs(A11yLayer, { children: [/* @__PURE__ */ jsx("span", {
|
|
665
|
-
id: selectedHintId,
|
|
666
|
-
children: t("board.selected", "Selected")
|
|
667
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
668
|
-
role: "status",
|
|
669
|
-
"aria-live": "polite",
|
|
670
|
-
"aria-atomic": "true",
|
|
671
|
-
children: announcement
|
|
672
|
-
})] }) : null,
|
|
673
|
-
children
|
|
674
|
-
]
|
|
427
|
+
children: [/* @__PURE__ */ jsxs(ContentLayer, {
|
|
428
|
+
ref: contentRef,
|
|
429
|
+
children: [
|
|
430
|
+
ready && gridOverlayStyle ? /* @__PURE__ */ jsx(GridOverlayElement, {
|
|
431
|
+
"aria-hidden": "true",
|
|
432
|
+
style: gridOverlayStyle
|
|
433
|
+
}) : null,
|
|
434
|
+
ready ? layout.map((item) => {
|
|
435
|
+
const registration = registry.store.get(item.i);
|
|
436
|
+
const widgetDraggable = isDraggable && (registration?.isDraggable ?? widgetProps?.isDraggable) !== false && item.isDraggable !== false && !item.static;
|
|
437
|
+
const widgetResizable = isResizable && (registration?.isResizable ?? widgetProps?.isResizable) !== false && item.isResizable !== false && !item.static;
|
|
438
|
+
const handles = item.resizeHandles ?? registration?.resizeHandles ?? widgetProps?.resizeHandles ?? resizeHandles;
|
|
439
|
+
const widgetDragCancel = registration?.dragCancel ?? widgetProps?.dragCancel ?? dragCancel;
|
|
440
|
+
const widgetDragHandle = registration?.dragHandle ?? widgetProps?.dragHandle ?? dragHandle;
|
|
441
|
+
const widgetIsCard = registration?.isCard ?? widgetProps?.isCard ?? false;
|
|
442
|
+
const widgetIsAutoHeight = registration?.isAutoHeight ?? widgetProps?.isAutoHeight ?? false;
|
|
443
|
+
const widgetQa = registration?.qa ?? widgetProps?.qa;
|
|
444
|
+
return /* @__PURE__ */ jsx(WidgetHost, {
|
|
445
|
+
boardId,
|
|
446
|
+
item,
|
|
447
|
+
positionParams,
|
|
448
|
+
registration,
|
|
449
|
+
isCard: widgetIsCard,
|
|
450
|
+
styles: registration?.styles && widgetPropsStyles ? mergeStyles(widgetPropsStyles, registration.styles) : registration?.styles ?? widgetPropsStyles,
|
|
451
|
+
isDraggable: widgetDraggable,
|
|
452
|
+
isResizable: widgetResizable,
|
|
453
|
+
resizeHandles: handles,
|
|
454
|
+
isAutoHeight: widgetIsAutoHeight,
|
|
455
|
+
qa: widgetQa,
|
|
456
|
+
dragCancel: widgetDragCancel,
|
|
457
|
+
dragHandle: widgetDragHandle,
|
|
458
|
+
registry,
|
|
459
|
+
dragState,
|
|
460
|
+
settled,
|
|
461
|
+
onResize: handleResize,
|
|
462
|
+
onAutoHeight: handleAutoHeight,
|
|
463
|
+
onDragLifecycle: handleDragLifecycle
|
|
464
|
+
}, item.i);
|
|
465
|
+
}) : null,
|
|
466
|
+
showPlaceholder ? /* @__PURE__ */ jsx(PlaceholderElement, {
|
|
467
|
+
"aria-hidden": "true",
|
|
468
|
+
style: placeholderStyle
|
|
469
|
+
}) : null
|
|
470
|
+
]
|
|
471
|
+
}), children]
|
|
675
472
|
})
|
|
676
473
|
})
|
|
677
474
|
});
|
|
@@ -694,5 +491,5 @@ const Board = forwardRef(function Board(props, ref) {
|
|
|
694
491
|
});
|
|
695
492
|
|
|
696
493
|
//#endregion
|
|
697
|
-
export {
|
|
494
|
+
export { Board };
|
|
698
495
|
//# sourceMappingURL=Board.js.map
|