@cube-dev/ui-kit 0.0.0-canary-c325dcb → 0.0.0-canary-162cdb3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +8 -0
- 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 +201 -201
- package/dist/components/actions/CommandMenu/CommandMenu.js.map +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.d.ts +6 -6
- 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/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.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/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/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +3 -3
- package/dist/components/data/TableBase/ColumnResizer.js.map +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 +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +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.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-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 +154 -166
- package/dist/components/data/TableBase/use-table-columns.js.map +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +194 -160
- package/dist/components/fields/ComboBox/ComboBox.js.map +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 +15 -8
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +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.d.ts +4 -4
- 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 +71 -67
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +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/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- 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/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/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/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/legacy-tooltip.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/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.d.ts +36 -0
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +57 -0
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js.map +1 -0
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +2 -2
- package/dist/components/navigation/Tabs/TabButton.js.map +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 +2 -2
- package/dist/components/navigation/Tabs/Tabs.js.map +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/index.d.ts +2 -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/navigation/index.d.ts +1 -0
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/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/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -83
- 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/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +3 -15
- package/dist/index.js +3 -11
- 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 +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/escapePropagation.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/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/data/ItemTable.md +1 -1
- package/docs/components/navigation/Tabs.md +8 -2
- package/package.json +1 -1
- package/dist/components/layout/Board/Board.d.ts +0 -253
- package/dist/components/layout/Board/Board.js +0 -771
- package/dist/components/layout/Board/Board.js.map +0 -1
- package/dist/components/layout/Board/BoardProvider.d.ts +0 -28
- package/dist/components/layout/Board/BoardProvider.js +0 -47
- package/dist/components/layout/Board/BoardProvider.js.map +0 -1
- package/dist/components/layout/Board/BoardResponsive.d.ts +0 -55
- package/dist/components/layout/Board/BoardResponsive.js +0 -101
- package/dist/components/layout/Board/BoardResponsive.js.map +0 -1
- package/dist/components/layout/Board/Widget.d.ts +0 -152
- package/dist/components/layout/Board/Widget.js +0 -76
- package/dist/components/layout/Board/Widget.js.map +0 -1
- package/dist/components/layout/Board/WidgetHost.js +0 -1065
- package/dist/components/layout/Board/WidgetHost.js.map +0 -1
- package/dist/components/layout/Board/board-context.d.ts +0 -43
- package/dist/components/layout/Board/board-context.js +0 -79
- package/dist/components/layout/Board/board-context.js.map +0 -1
- package/dist/components/layout/Board/board-store.d.ts +0 -4
- package/dist/components/layout/Board/board-store.js +0 -49
- package/dist/components/layout/Board/board-store.js.map +0 -1
- package/dist/components/layout/Board/grid-core/calculate.js +0 -90
- package/dist/components/layout/Board/grid-core/calculate.js.map +0 -1
- package/dist/components/layout/Board/grid-core/collision-modes.js +0 -254
- package/dist/components/layout/Board/grid-core/collision-modes.js.map +0 -1
- package/dist/components/layout/Board/grid-core/collision.js +0 -35
- package/dist/components/layout/Board/grid-core/collision.js.map +0 -1
- package/dist/components/layout/Board/grid-core/compactors.d.ts +0 -23
- package/dist/components/layout/Board/grid-core/compactors.js +0 -166
- package/dist/components/layout/Board/grid-core/compactors.js.map +0 -1
- package/dist/components/layout/Board/grid-core/constraints.d.ts +0 -35
- package/dist/components/layout/Board/grid-core/constraints.js +0 -155
- package/dist/components/layout/Board/grid-core/constraints.js.map +0 -1
- package/dist/components/layout/Board/grid-core/group-move.js +0 -317
- package/dist/components/layout/Board/grid-core/group-move.js.map +0 -1
- package/dist/components/layout/Board/grid-core/layout.js +0 -186
- package/dist/components/layout/Board/grid-core/layout.js.map +0 -1
- package/dist/components/layout/Board/grid-core/placement.d.ts +0 -58
- package/dist/components/layout/Board/grid-core/placement.js +0 -153
- package/dist/components/layout/Board/grid-core/placement.js.map +0 -1
- package/dist/components/layout/Board/grid-core/sort.js +0 -37
- package/dist/components/layout/Board/grid-core/sort.js.map +0 -1
- package/dist/components/layout/Board/grid-core/types.d.ts +0 -186
- package/dist/components/layout/Board/index.d.ts +0 -24
- package/dist/components/layout/Board/index.js +0 -20
- package/dist/components/layout/Board/index.js.map +0 -1
- package/dist/components/layout/Board/responsive-utils.d.ts +0 -13
- package/dist/components/layout/Board/responsive-utils.js +0 -55
- package/dist/components/layout/Board/responsive-utils.js.map +0 -1
- package/dist/components/layout/Board/use-board-layout.d.ts +0 -26
- package/dist/components/layout/Board/use-board-layout.js +0 -57
- package/dist/components/layout/Board/use-board-layout.js.map +0 -1
- package/dist/components/layout/Board/use-board-registry.js +0 -700
- package/dist/components/layout/Board/use-board-registry.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
- package/docs/components/layout/Board.md +0 -473
|
@@ -1,771 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-c325dcb | Cube Dev Team */
|
|
2
|
-
import { extractStyles } from "../../../utils/styles.js";
|
|
3
|
-
import { mergeProps as mergeProps$1 } 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 { BoardGridLinesContext, BoardMetricsContext, useBoardGridLines, useBoardHost, useBoardMetrics, useBoardRegistry } from "./board-context.js";
|
|
8
|
-
import { getAllCollisions } from "./grid-core/collision.js";
|
|
9
|
-
import { bottom, cloneLayout, correctBounds, getLayoutItem, modifyLayout } from "./grid-core/layout.js";
|
|
10
|
-
import { getCompactor } from "./grid-core/compactors.js";
|
|
11
|
-
import { calcGridColWidth, calcGridItemPosition, calcWH } from "./grid-core/calculate.js";
|
|
12
|
-
import { applySizeConstraints, defaultConstraints } from "./grid-core/constraints.js";
|
|
13
|
-
import { BoardProvider } from "./BoardProvider.js";
|
|
14
|
-
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
|
-
import { WidgetHost } from "./WidgetHost.js";
|
|
18
|
-
import { c } from "react/compiler-runtime";
|
|
19
|
-
import { CONTAINER_STYLES, filterBaseProps, mergeStyles, tasty } from "@tenphi/tasty";
|
|
20
|
-
import { forwardRef, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
21
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { useFocusWithin } from "react-aria";
|
|
23
|
-
import { useResizeObserver } from "@react-aria/utils";
|
|
24
|
-
|
|
25
|
-
//#region src/components/layout/Board/Board.tsx
|
|
26
|
-
const BoardElement = tasty({
|
|
27
|
-
qa: "Board",
|
|
28
|
-
styles: {
|
|
29
|
-
position: "relative",
|
|
30
|
-
display: "block",
|
|
31
|
-
width: "100%",
|
|
32
|
-
flexGrow: 1,
|
|
33
|
-
height: "min 0",
|
|
34
|
-
fill: "#surface",
|
|
35
|
-
boxSizing: "border-box",
|
|
36
|
-
outline: 0,
|
|
37
|
-
userSelect: {
|
|
38
|
-
"": "auto",
|
|
39
|
-
marquee: "none"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
const ContentLayer = tasty({ styles: {
|
|
44
|
-
position: "absolute",
|
|
45
|
-
inset: 0
|
|
46
|
-
} });
|
|
47
|
-
const PlaceholderElement = tasty({
|
|
48
|
-
qa: "BoardPlaceholder",
|
|
49
|
-
styles: {
|
|
50
|
-
position: "absolute",
|
|
51
|
-
top: 0,
|
|
52
|
-
left: 0,
|
|
53
|
-
fill: "#primary.10",
|
|
54
|
-
radius: "1cr",
|
|
55
|
-
border: "#primary.40",
|
|
56
|
-
zIndex: 2,
|
|
57
|
-
pointerEvents: "none",
|
|
58
|
-
transition: "inset linear, width linear, height linear",
|
|
59
|
-
boxSizing: "border-box"
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const MarqueeElement = tasty({
|
|
63
|
-
qa: "BoardMarquee",
|
|
64
|
-
styles: {
|
|
65
|
-
position: "absolute",
|
|
66
|
-
top: 0,
|
|
67
|
-
left: 0,
|
|
68
|
-
fill: "#primary-accent-surface.06",
|
|
69
|
-
border: "1bw dashed #primary-border",
|
|
70
|
-
radius: "1cr",
|
|
71
|
-
zIndex: 3,
|
|
72
|
-
pointerEvents: "none",
|
|
73
|
-
boxSizing: "border-box"
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const A11yLayer = tasty({ styles: {
|
|
77
|
-
position: "absolute",
|
|
78
|
-
width: "1px",
|
|
79
|
-
height: "1px",
|
|
80
|
-
padding: 0,
|
|
81
|
-
margin: "-1px",
|
|
82
|
-
overflow: "hidden",
|
|
83
|
-
clipPath: "inset(50%)",
|
|
84
|
-
whiteSpace: "nowrap",
|
|
85
|
-
border: 0
|
|
86
|
-
} });
|
|
87
|
-
const GridOverlayElement = tasty({
|
|
88
|
-
qa: "BoardGridOverlay",
|
|
89
|
-
styles: {
|
|
90
|
-
position: "absolute",
|
|
91
|
-
zIndex: 0,
|
|
92
|
-
pointerEvents: "none",
|
|
93
|
-
boxSizing: "border-box",
|
|
94
|
-
opacity: ".5"
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
/**
|
|
98
|
-
* Descendants whose clicks never change the selection. A widget is a large
|
|
99
|
-
* surface the user also clicks to *work with*, so anything interactive inside it
|
|
100
|
-
* must keep its click. `[data-no-select]` is the escape hatch for an app's own
|
|
101
|
-
* custom controls.
|
|
102
|
-
*/
|
|
103
|
-
const BOARD_SELECTION_CANCEL = "input,textarea,select,button,a,[role=\"button\"],[role=\"menuitem\"],[role=\"checkbox\"],[role=\"switch\"],[role=\"tab\"],[contenteditable=\"true\"],[data-no-select]";
|
|
104
|
-
/**
|
|
105
|
-
* Row height when none is given, and the fallback a `rowHeight="stretch"` board
|
|
106
|
-
* uses until it has both a bounded row count and a measured height to divide.
|
|
107
|
-
*/
|
|
108
|
-
const DEFAULT_ROW_HEIGHT = 100;
|
|
109
|
-
/** Manhattan distance a pointer must travel before a press becomes a marquee. */
|
|
110
|
-
const MARQUEE_THRESHOLD = 4;
|
|
111
|
-
/** Shared empty set, so "no pre-selection" is a stable reference. */
|
|
112
|
-
const NO_KEYS = /* @__PURE__ */ new Set();
|
|
113
|
-
/**
|
|
114
|
-
* Whether an event landed in a text-editing context. Checking the *event target*
|
|
115
|
-
* beats `document.activeElement`: it stays correct for content rendered through
|
|
116
|
-
* a portal, and it cannot be fooled by focus that moved between the keystroke
|
|
117
|
-
* and the handler.
|
|
118
|
-
*/
|
|
119
|
-
function isEditableTarget(target) {
|
|
120
|
-
const el = target;
|
|
121
|
-
if (!el || typeof el.closest !== "function") return false;
|
|
122
|
-
return !!el.closest("input,textarea,select,[contenteditable=\"true\"]");
|
|
123
|
-
}
|
|
124
|
-
function compactTypeToCore(compact) {
|
|
125
|
-
if (compact === "free") return null;
|
|
126
|
-
return compact;
|
|
127
|
-
}
|
|
128
|
-
function BoardInner(props, ref) {
|
|
129
|
-
const { id: providedId, layout: controlledLayout, defaultLayout, onLayoutChange, onDragStart, onDrag, onDragStop, onResizeStart, onResize: onResizeProp, onResizeStop, cols = 12, rows: fixedRows, rowHeight = DEFAULT_ROW_HEIGHT, margin = [8, 8], containerPadding, maxRows: maxRowsProp, extraRows = 0, compact = "vertical", allowOverlap = false, preventCollision = false, collisionMode = "revert", isDraggable = true, isResizable = true, isDroppable = true, resizeHandles = ["se"], resizeGripPlacement, dragCancel = BOARD_SELECTION_CANCEL, dragHandle, showGridLines, isAligned = false, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, selectionCancel = BOARD_SELECTION_CANCEL, allowMarqueeSelection = selectionMode === "multiple", onWidgetsDelete, constraints, width: providedWidth, widgetProps, children, ...otherProps } = props;
|
|
130
|
-
const maxRows = maxRowsProp ?? (fixedRows != null ? Math.max(1, fixedRows) : Infinity);
|
|
131
|
-
const registry = useBoardRegistry();
|
|
132
|
-
const parentMetrics = useBoardMetrics();
|
|
133
|
-
const host = useBoardHost();
|
|
134
|
-
const inheritedGridLines = useBoardGridLines();
|
|
135
|
-
const aligned = isAligned && !!parentMetrics;
|
|
136
|
-
const boardDepth = (parentMetrics?.depth ?? -1) + 1;
|
|
137
|
-
const widgetPropsStyles = useMemo(() => {
|
|
138
|
-
if (!widgetProps) return void 0;
|
|
139
|
-
const extracted = extractStyles(widgetProps, CONTAINER_STYLES);
|
|
140
|
-
return Object.keys(extracted).length > 0 ? extracted : void 0;
|
|
141
|
-
}, [widgetProps]);
|
|
142
|
-
const effectiveShowGridLines = showGridLines ?? inheritedGridLines;
|
|
143
|
-
const generatedId = useId();
|
|
144
|
-
const boardId = providedId ?? generatedId;
|
|
145
|
-
const selectedHintId = `${generatedId}-selected`;
|
|
146
|
-
const { t } = useI18n();
|
|
147
|
-
const containerRef = useCombinedRefs(ref);
|
|
148
|
-
const contentRef = useRef(null);
|
|
149
|
-
const [measuredWidth, setMeasuredWidth] = useState(0);
|
|
150
|
-
const [measuredHeight, setMeasuredHeight] = useState(0);
|
|
151
|
-
const width = providedWidth ?? measuredWidth;
|
|
152
|
-
const onResizeContainer = useEvent(() => {
|
|
153
|
-
const el = containerRef.current;
|
|
154
|
-
if (!el) return;
|
|
155
|
-
const nextWidth = el.offsetWidth;
|
|
156
|
-
const nextHeight = el.offsetHeight;
|
|
157
|
-
if (nextWidth > 0) setMeasuredWidth(nextWidth);
|
|
158
|
-
if (nextHeight > 0) setMeasuredHeight(nextHeight);
|
|
159
|
-
});
|
|
160
|
-
useResizeObserver({
|
|
161
|
-
ref: containerRef,
|
|
162
|
-
onResize: onResizeContainer
|
|
163
|
-
});
|
|
164
|
-
useEffect(() => {
|
|
165
|
-
if (providedWidth == null) onResizeContainer();
|
|
166
|
-
}, [providedWidth]);
|
|
167
|
-
const { layout, layoutRef, placeholders, placeholder, placeholdersRef, placeholderRef, setPlaceholders, applyLayout } = useBoardLayout({
|
|
168
|
-
layout: controlledLayout,
|
|
169
|
-
defaultLayout,
|
|
170
|
-
onLayoutChange
|
|
171
|
-
});
|
|
172
|
-
const getWidgetLabel = useEvent((key) => {
|
|
173
|
-
const registration = registry.store.get(key);
|
|
174
|
-
return registration?.["aria-label"] ?? registration?.qa ?? key;
|
|
175
|
-
});
|
|
176
|
-
const isWidgetSelectable = (key) => (registry.store.get(key)?.isSelectable ?? widgetProps?.isSelectable) !== false;
|
|
177
|
-
const { selectedKeySet, selectedKeysRef, setSelection, select, clearSelection, announcement } = useBoardSelection({
|
|
178
|
-
selectionMode,
|
|
179
|
-
selectedKeys,
|
|
180
|
-
defaultSelectedKeys,
|
|
181
|
-
onSelectionChange,
|
|
182
|
-
layout,
|
|
183
|
-
getLabel: getWidgetLabel
|
|
184
|
-
});
|
|
185
|
-
const selectModifierKey = useBoardSelectModifierKey();
|
|
186
|
-
useSyncExternalStore(registry.store.subscribe, registry.store.getVersion);
|
|
187
|
-
const effectiveMargin = aligned ? parentMetrics.margin : margin;
|
|
188
|
-
const resolvedPadding = containerPadding ?? (aligned ? [0, 0] : effectiveMargin);
|
|
189
|
-
const rows = Math.max(bottom(layout), ...placeholders.map((p) => p.y + p.h), 0);
|
|
190
|
-
const renderedRows = fixedRows != null ? Math.max(1, fixedRows) : Math.min(rows + Math.max(0, extraRows), maxRows);
|
|
191
|
-
const parentColWidth = aligned ? parentMetrics.colWidth : 0;
|
|
192
|
-
const alignedCols = aligned && width > 0 ? Math.max(1, Math.floor((width - resolvedPadding[0] * 2 + effectiveMargin[0] + 2) / (parentColWidth + effectiveMargin[0]))) : cols;
|
|
193
|
-
const effectiveCols = aligned ? alignedCols : cols;
|
|
194
|
-
const effectiveContainerWidth = aligned ? parentColWidth * effectiveCols + effectiveMargin[0] * Math.max(0, effectiveCols - 1) + resolvedPadding[0] * 2 : width;
|
|
195
|
-
const isStretching = rowHeight === "stretch" && fixedRows != null;
|
|
196
|
-
const stretchedRowHeight = isStretching && measuredHeight > 0 ? Math.max(1, (measuredHeight - Math.max(0, renderedRows - 1) * effectiveMargin[1] - resolvedPadding[1] * 2) / renderedRows) : DEFAULT_ROW_HEIGHT;
|
|
197
|
-
const effectiveRowHeight = aligned ? parentMetrics.rowHeight : rowHeight === "stretch" ? stretchedRowHeight : rowHeight;
|
|
198
|
-
const positionParams = useMemo(() => ({
|
|
199
|
-
margin: effectiveMargin,
|
|
200
|
-
containerPadding: resolvedPadding,
|
|
201
|
-
containerWidth: effectiveContainerWidth,
|
|
202
|
-
cols: effectiveCols,
|
|
203
|
-
rowHeight: effectiveRowHeight,
|
|
204
|
-
maxRows
|
|
205
|
-
}), [
|
|
206
|
-
effectiveMargin[0],
|
|
207
|
-
effectiveMargin[1],
|
|
208
|
-
resolvedPadding[0],
|
|
209
|
-
resolvedPadding[1],
|
|
210
|
-
effectiveContainerWidth,
|
|
211
|
-
effectiveCols,
|
|
212
|
-
effectiveRowHeight,
|
|
213
|
-
maxRows
|
|
214
|
-
]);
|
|
215
|
-
const compactor = useMemo(() => getCompactor(compactTypeToCore(compact), allowOverlap, compact === "free" ? !allowOverlap : preventCollision), [
|
|
216
|
-
compact,
|
|
217
|
-
allowOverlap,
|
|
218
|
-
preventCollision
|
|
219
|
-
]);
|
|
220
|
-
const resolvedConstraints = constraints ?? defaultConstraints;
|
|
221
|
-
const computedHeight = renderedRows > 0 ? renderedRows * effectiveRowHeight + Math.max(0, renderedRows - 1) * effectiveMargin[1] + resolvedPadding[1] * 2 : effectiveRowHeight;
|
|
222
|
-
const containerHeight = (aligned || isStretching) && measuredHeight > 0 ? measuredHeight : computedHeight;
|
|
223
|
-
const liveRef = useRef({
|
|
224
|
-
positionParams,
|
|
225
|
-
compactor,
|
|
226
|
-
collisionMode,
|
|
227
|
-
constraints: resolvedConstraints,
|
|
228
|
-
maxRows,
|
|
229
|
-
containerHeight,
|
|
230
|
-
isDroppable
|
|
231
|
-
});
|
|
232
|
-
liveRef.current = {
|
|
233
|
-
positionParams,
|
|
234
|
-
compactor,
|
|
235
|
-
collisionMode,
|
|
236
|
-
constraints: resolvedConstraints,
|
|
237
|
-
maxRows,
|
|
238
|
-
containerHeight,
|
|
239
|
-
isDroppable
|
|
240
|
-
};
|
|
241
|
-
const applyLayoutEvent = useEvent(applyLayout);
|
|
242
|
-
const setPlaceholdersEvent = useEvent(setPlaceholders);
|
|
243
|
-
const entryRef = useRef(null);
|
|
244
|
-
if (!entryRef.current) entryRef.current = {
|
|
245
|
-
id: boardId,
|
|
246
|
-
getContentRect: () => contentRef.current?.getBoundingClientRect() ?? null,
|
|
247
|
-
getContentNode: () => contentRef.current,
|
|
248
|
-
getPositionParams: () => liveRef.current.positionParams,
|
|
249
|
-
getConstraints: () => liveRef.current.constraints,
|
|
250
|
-
getCompactor: () => liveRef.current.compactor,
|
|
251
|
-
getCollisionMode: () => liveRef.current.collisionMode,
|
|
252
|
-
getMaxRows: () => liveRef.current.maxRows,
|
|
253
|
-
getContainerHeight: () => liveRef.current.containerHeight,
|
|
254
|
-
getLayout: () => layoutRef.current,
|
|
255
|
-
getSelectedKeys: () => selectedKeysRef.current.size > 0 ? selectedKeysRef.current : null,
|
|
256
|
-
applyLayout: (next, commit, reason) => applyLayoutEvent(next, commit, reason),
|
|
257
|
-
setPlaceholders: (items) => setPlaceholdersEvent(items),
|
|
258
|
-
isDroppable: () => liveRef.current.isDroppable
|
|
259
|
-
};
|
|
260
|
-
useEffect(() => {
|
|
261
|
-
const entry = entryRef.current;
|
|
262
|
-
entry.id = boardId;
|
|
263
|
-
return registry.registerBoard(entry);
|
|
264
|
-
}, [boardId]);
|
|
265
|
-
const recompactForCols = useEvent((nextCols) => {
|
|
266
|
-
const corrected = correctBounds(cloneLayout(layoutRef.current), { cols: nextCols });
|
|
267
|
-
applyLayoutEvent([...liveRef.current.compactor.compact(corrected, nextCols)], true, "normalize");
|
|
268
|
-
});
|
|
269
|
-
const prevAlignedColsRef = useRef(null);
|
|
270
|
-
useEffect(() => {
|
|
271
|
-
if (!aligned) {
|
|
272
|
-
prevAlignedColsRef.current = null;
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
if (width <= 0) return;
|
|
276
|
-
if (prevAlignedColsRef.current === null) {
|
|
277
|
-
prevAlignedColsRef.current = effectiveCols;
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
if (prevAlignedColsRef.current === effectiveCols) return;
|
|
281
|
-
prevAlignedColsRef.current = effectiveCols;
|
|
282
|
-
recompactForCols(effectiveCols);
|
|
283
|
-
}, [
|
|
284
|
-
aligned,
|
|
285
|
-
width,
|
|
286
|
-
effectiveCols,
|
|
287
|
-
recompactForCols
|
|
288
|
-
]);
|
|
289
|
-
const naturalHeight = renderedRows > 0 ? renderedRows * effectiveRowHeight + Math.max(0, renderedRows - 1) * effectiveMargin[1] + resolvedPadding[1] * 2 : effectiveRowHeight;
|
|
290
|
-
const registerNestedBoard = host?.registerNestedBoard;
|
|
291
|
-
useEffect(() => registerNestedBoard?.(), [registerNestedBoard]);
|
|
292
|
-
const requestHeightDeficit = host?.requestHeightDeficit;
|
|
293
|
-
useEffect(() => {
|
|
294
|
-
if (!aligned || !host?.isAutoHeight || !requestHeightDeficit) return;
|
|
295
|
-
if (measuredHeight <= 0) return;
|
|
296
|
-
requestHeightDeficit(naturalHeight - measuredHeight);
|
|
297
|
-
}, [
|
|
298
|
-
aligned,
|
|
299
|
-
host?.isAutoHeight,
|
|
300
|
-
requestHeightDeficit,
|
|
301
|
-
naturalHeight,
|
|
302
|
-
measuredHeight
|
|
303
|
-
]);
|
|
304
|
-
const resizeStateRef = useRef(null);
|
|
305
|
-
const autoHeightMinRowsRef = useRef({});
|
|
306
|
-
const handleResize = useEvent((id, axis, phase, dx, dy) => {
|
|
307
|
-
const pp = liveRef.current.positionParams;
|
|
308
|
-
if (phase === "start") {
|
|
309
|
-
const rawItem = getLayoutItem(layoutRef.current, id);
|
|
310
|
-
if (!rawItem) return;
|
|
311
|
-
const reg = registry.store.get(id);
|
|
312
|
-
const item = {
|
|
313
|
-
...rawItem,
|
|
314
|
-
minW: rawItem.minW ?? reg?.minW ?? widgetProps?.minW,
|
|
315
|
-
maxW: rawItem.maxW ?? reg?.maxW ?? widgetProps?.maxW,
|
|
316
|
-
minH: rawItem.minH ?? reg?.minH ?? widgetProps?.minH,
|
|
317
|
-
maxH: rawItem.maxH ?? reg?.maxH ?? widgetProps?.maxH,
|
|
318
|
-
constraints: rawItem.constraints ?? reg?.constraints ?? widgetProps?.constraints
|
|
319
|
-
};
|
|
320
|
-
resizeStateRef.current = {
|
|
321
|
-
id,
|
|
322
|
-
axis,
|
|
323
|
-
item: { ...item },
|
|
324
|
-
origin: calcGridItemPosition(pp, item.x, item.y, item.w, item.h),
|
|
325
|
-
accX: 0,
|
|
326
|
-
accY: 0
|
|
327
|
-
};
|
|
328
|
-
setPlaceholders([{ ...item }]);
|
|
329
|
-
onResizeStart?.({
|
|
330
|
-
layout: layoutRef.current,
|
|
331
|
-
item: { ...item },
|
|
332
|
-
oldItem: { ...item },
|
|
333
|
-
placeholder: { ...item },
|
|
334
|
-
items: [{ ...item }],
|
|
335
|
-
oldItems: [{ ...item }],
|
|
336
|
-
placeholders: [{ ...item }]
|
|
337
|
-
});
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
const rs = resizeStateRef.current;
|
|
341
|
-
if (!rs) return;
|
|
342
|
-
if (phase === "end") {
|
|
343
|
-
const finalLayout = [...layoutRef.current];
|
|
344
|
-
applyLayout(finalLayout, true, "resize");
|
|
345
|
-
setPlaceholders([]);
|
|
346
|
-
const resizedItem = getLayoutItem(finalLayout, id) ?? rs.item;
|
|
347
|
-
onResizeStop?.({
|
|
348
|
-
layout: finalLayout,
|
|
349
|
-
item: resizedItem,
|
|
350
|
-
oldItem: rs.item,
|
|
351
|
-
placeholder: null,
|
|
352
|
-
items: [resizedItem],
|
|
353
|
-
oldItems: [rs.item],
|
|
354
|
-
placeholders: []
|
|
355
|
-
});
|
|
356
|
-
resizeStateRef.current = null;
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
rs.accX += dx;
|
|
360
|
-
rs.accY += dy;
|
|
361
|
-
const { origin, item, axis: handle } = rs;
|
|
362
|
-
let newW = origin.width;
|
|
363
|
-
let newH = origin.height;
|
|
364
|
-
if (handle.includes("e")) newW = origin.width + rs.accX;
|
|
365
|
-
if (handle.includes("w")) newW = origin.width - rs.accX;
|
|
366
|
-
if (handle.includes("s")) newH = origin.height + rs.accY;
|
|
367
|
-
if (handle.includes("n")) newH = origin.height - rs.accY;
|
|
368
|
-
newW = Math.max(newW, 8);
|
|
369
|
-
newH = Math.max(newH, 8);
|
|
370
|
-
const raw = calcWH(pp, newW, newH, item.x, item.y, handle);
|
|
371
|
-
const constrained = applySizeConstraints(liveRef.current.constraints, item, raw.w, raw.h, handle, {
|
|
372
|
-
cols: pp.cols,
|
|
373
|
-
maxRows: liveRef.current.maxRows,
|
|
374
|
-
containerWidth: pp.containerWidth,
|
|
375
|
-
containerHeight: liveRef.current.containerHeight,
|
|
376
|
-
rowHeight: pp.rowHeight,
|
|
377
|
-
margin: pp.margin,
|
|
378
|
-
layout: layoutRef.current
|
|
379
|
-
});
|
|
380
|
-
const floorRows = autoHeightMinRowsRef.current[id] ?? 0;
|
|
381
|
-
const finalW = constrained.w;
|
|
382
|
-
const finalH = Math.max(constrained.h, floorRows);
|
|
383
|
-
let x = item.x;
|
|
384
|
-
let y = item.y;
|
|
385
|
-
if (handle.includes("w")) x = item.x + item.w - finalW;
|
|
386
|
-
if (handle.includes("n")) y = item.y + item.h - finalH;
|
|
387
|
-
x = Math.max(0, x);
|
|
388
|
-
y = Math.max(0, y);
|
|
389
|
-
let newItem = {
|
|
390
|
-
...item,
|
|
391
|
-
x,
|
|
392
|
-
y,
|
|
393
|
-
w: finalW,
|
|
394
|
-
h: finalH
|
|
395
|
-
};
|
|
396
|
-
const compactor = liveRef.current.compactor;
|
|
397
|
-
if (compactor.preventCollision && !compactor.allowOverlap) {
|
|
398
|
-
if (getAllCollisions(layoutRef.current, newItem).some((other) => other.i !== id)) {
|
|
399
|
-
const lastValid = getLayoutItem(layoutRef.current, id);
|
|
400
|
-
if (lastValid) newItem = { ...lastValid };
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
const working = modifyLayout(layoutRef.current, newItem);
|
|
404
|
-
const compacted = [...compactor.compact(working, pp.cols)];
|
|
405
|
-
applyLayout(compacted, false);
|
|
406
|
-
const nextPlaceholder = getLayoutItem(compacted, id) ?? newItem;
|
|
407
|
-
setPlaceholders([nextPlaceholder]);
|
|
408
|
-
const resizedItem = getLayoutItem(compacted, id) ?? newItem;
|
|
409
|
-
onResizeProp?.({
|
|
410
|
-
layout: compacted,
|
|
411
|
-
item: resizedItem,
|
|
412
|
-
oldItem: rs.item,
|
|
413
|
-
placeholder: nextPlaceholder,
|
|
414
|
-
items: [resizedItem],
|
|
415
|
-
oldItems: [rs.item],
|
|
416
|
-
placeholders: [nextPlaceholder]
|
|
417
|
-
});
|
|
418
|
-
});
|
|
419
|
-
const handleAutoHeight = useEvent((id, neededRows) => {
|
|
420
|
-
autoHeightMinRowsRef.current[id] = neededRows;
|
|
421
|
-
const current = getLayoutItem(layoutRef.current, id);
|
|
422
|
-
if (!current || neededRows <= current.h) return;
|
|
423
|
-
if (registry.dragState || resizeStateRef.current) return;
|
|
424
|
-
const pp = liveRef.current.positionParams;
|
|
425
|
-
const working = modifyLayout(layoutRef.current, {
|
|
426
|
-
...current,
|
|
427
|
-
h: neededRows
|
|
428
|
-
});
|
|
429
|
-
applyLayout([...liveRef.current.compactor.compact(working, pp.cols)], true, "normalize");
|
|
430
|
-
});
|
|
431
|
-
const dragOldItemRef = useRef(null);
|
|
432
|
-
const dragOldItemsRef = useRef([]);
|
|
433
|
-
const handleDragLifecycle = useEvent((id, phase) => {
|
|
434
|
-
const currentLayout = layoutRef.current;
|
|
435
|
-
const liveItem = getLayoutItem(currentLayout, id);
|
|
436
|
-
if (phase === "start") {
|
|
437
|
-
dragOldItemRef.current = liveItem ? { ...liveItem } : null;
|
|
438
|
-
const ds = registry.getDragState();
|
|
439
|
-
dragOldItemsRef.current = ds && ds.itemId === id ? ds.items.map((it) => ({ ...it })) : [];
|
|
440
|
-
}
|
|
441
|
-
const oldItem = dragOldItemRef.current ?? liveItem;
|
|
442
|
-
if (!oldItem) return;
|
|
443
|
-
const item = liveItem ?? oldItem;
|
|
444
|
-
const oldItems = dragOldItemsRef.current.length ? dragOldItemsRef.current : [oldItem];
|
|
445
|
-
const items = oldItems.map((old) => getLayoutItem(currentLayout, old.i) ?? old);
|
|
446
|
-
const info = {
|
|
447
|
-
layout: currentLayout,
|
|
448
|
-
item,
|
|
449
|
-
oldItem,
|
|
450
|
-
placeholder: placeholderRef.current,
|
|
451
|
-
items,
|
|
452
|
-
oldItems,
|
|
453
|
-
placeholders: placeholdersRef.current
|
|
454
|
-
};
|
|
455
|
-
if (phase === "start") onDragStart?.(info);
|
|
456
|
-
else if (phase === "move") onDrag?.(info);
|
|
457
|
-
else {
|
|
458
|
-
onDragStop?.(info);
|
|
459
|
-
dragOldItemRef.current = null;
|
|
460
|
-
dragOldItemsRef.current = [];
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
const [marqueeRect, setMarqueeRect] = useState(null);
|
|
464
|
-
const [preSelectedKeys, setPreSelectedKeys] = useState(NO_KEYS);
|
|
465
|
-
const [isMarqueeActive, setIsMarqueeActive] = useState(false);
|
|
466
|
-
const handleContentPointerDown = useEvent((event) => {
|
|
467
|
-
if (selectionMode !== "multiple" || !allowMarqueeSelection || event.button !== 0 || registry.dragState) return;
|
|
468
|
-
const target = event.target;
|
|
469
|
-
if (target?.closest("[data-board-widget-host]")) return;
|
|
470
|
-
if (selectionCancel && target?.closest(selectionCancel)) return;
|
|
471
|
-
const content = contentRef.current;
|
|
472
|
-
if (!content) return;
|
|
473
|
-
if (target && !content.contains(target)) return;
|
|
474
|
-
event.preventDefault();
|
|
475
|
-
setIsMarqueeActive(true);
|
|
476
|
-
const origin = content.getBoundingClientRect();
|
|
477
|
-
const startX = event.clientX;
|
|
478
|
-
const startY = event.clientY;
|
|
479
|
-
const additive = event[selectModifierKey] || event.shiftKey;
|
|
480
|
-
const base = additive ? [...selectedKeysRef.current] : [];
|
|
481
|
-
let passedThreshold = false;
|
|
482
|
-
const hitTest = (clientX, clientY) => {
|
|
483
|
-
const left = Math.min(startX, clientX) - origin.left;
|
|
484
|
-
const right = Math.max(startX, clientX) - origin.left;
|
|
485
|
-
const top = Math.min(startY, clientY) - origin.top;
|
|
486
|
-
const bottom = Math.max(startY, clientY) - origin.top;
|
|
487
|
-
const next = new Set(base);
|
|
488
|
-
for (const it of layoutRef.current) {
|
|
489
|
-
if (!isWidgetSelectable(it.i)) continue;
|
|
490
|
-
const pos = calcGridItemPosition(liveRef.current.positionParams, it.x, it.y, it.w, it.h);
|
|
491
|
-
if (pos.left < right && pos.left + pos.width > left && pos.top < bottom && pos.top + pos.height > top) next.add(it.i);
|
|
492
|
-
}
|
|
493
|
-
return {
|
|
494
|
-
next,
|
|
495
|
-
box: {
|
|
496
|
-
left,
|
|
497
|
-
top,
|
|
498
|
-
width: right - left,
|
|
499
|
-
height: bottom - top
|
|
500
|
-
}
|
|
501
|
-
};
|
|
502
|
-
};
|
|
503
|
-
const blockSelectStart = (e) => e.preventDefault();
|
|
504
|
-
const handleMove = (e) => {
|
|
505
|
-
if (!passedThreshold && Math.abs(e.clientX - startX) + Math.abs(e.clientY - startY) < MARQUEE_THRESHOLD) return;
|
|
506
|
-
if (!passedThreshold) {
|
|
507
|
-
const selection = window.getSelection();
|
|
508
|
-
const anchor = selection?.anchorNode;
|
|
509
|
-
if (anchor && containerRef.current?.contains(anchor)) selection?.removeAllRanges();
|
|
510
|
-
}
|
|
511
|
-
passedThreshold = true;
|
|
512
|
-
const { box, next } = hitTest(e.clientX, e.clientY);
|
|
513
|
-
setMarqueeRect(box);
|
|
514
|
-
setPreSelectedKeys(next);
|
|
515
|
-
};
|
|
516
|
-
const finish = (e) => {
|
|
517
|
-
window.removeEventListener("pointermove", handleMove);
|
|
518
|
-
window.removeEventListener("pointerup", finish);
|
|
519
|
-
window.removeEventListener("pointercancel", finish);
|
|
520
|
-
window.removeEventListener("selectstart", blockSelectStart);
|
|
521
|
-
setMarqueeRect(null);
|
|
522
|
-
setPreSelectedKeys(NO_KEYS);
|
|
523
|
-
setIsMarqueeActive(false);
|
|
524
|
-
if (passedThreshold) setSelection(hitTest(e.clientX, e.clientY).next);
|
|
525
|
-
else if (!additive) clearSelection();
|
|
526
|
-
containerRef.current?.focus({ preventScroll: true });
|
|
527
|
-
};
|
|
528
|
-
window.addEventListener("pointermove", handleMove);
|
|
529
|
-
window.addEventListener("pointerup", finish);
|
|
530
|
-
window.addEventListener("pointercancel", finish);
|
|
531
|
-
window.addEventListener("selectstart", blockSelectStart);
|
|
532
|
-
});
|
|
533
|
-
const marqueeStyle = marqueeRect ? {
|
|
534
|
-
left: `${marqueeRect.left}px`,
|
|
535
|
-
top: `${marqueeRect.top}px`,
|
|
536
|
-
width: `${marqueeRect.width}px`,
|
|
537
|
-
height: `${marqueeRect.height}px`
|
|
538
|
-
} : null;
|
|
539
|
-
const { focusWithinProps: boardFocusWithinProps } = useFocusWithin({
|
|
540
|
-
isDisabled: selectionMode === "none",
|
|
541
|
-
onBlurWithin: () => clearSelection()
|
|
542
|
-
});
|
|
543
|
-
const handleBoardKeyDown = useEvent((event) => {
|
|
544
|
-
if (selectionMode === "none") return;
|
|
545
|
-
const selected = selectedKeysRef.current;
|
|
546
|
-
if (selected.size === 0) return;
|
|
547
|
-
if (event.key === "Escape") {
|
|
548
|
-
event.preventDefault();
|
|
549
|
-
event.stopPropagation();
|
|
550
|
-
clearSelection();
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
if ((event.key === "Delete" || event.key === "Backspace") && onWidgetsDelete && !isEditableTarget(event.target)) {
|
|
554
|
-
event.preventDefault();
|
|
555
|
-
event.stopPropagation();
|
|
556
|
-
const keys = [...selected];
|
|
557
|
-
clearSelection();
|
|
558
|
-
onWidgetsDelete(keys);
|
|
559
|
-
containerRef.current?.focus({ preventScroll: true });
|
|
560
|
-
}
|
|
561
|
-
});
|
|
562
|
-
const styles = extractStyles(otherProps, CONTAINER_STYLES);
|
|
563
|
-
const dragState = registry.dragState;
|
|
564
|
-
const ready = width > 0;
|
|
565
|
-
const [settled, setSettled] = useState(false);
|
|
566
|
-
useEffect(() => {
|
|
567
|
-
if (!ready) {
|
|
568
|
-
setSettled(false);
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
let id1 = 0;
|
|
572
|
-
let id2 = 0;
|
|
573
|
-
id1 = requestAnimationFrame(() => {
|
|
574
|
-
id2 = requestAnimationFrame(() => setSettled(true));
|
|
575
|
-
});
|
|
576
|
-
return () => {
|
|
577
|
-
cancelAnimationFrame(id1);
|
|
578
|
-
if (id2) cancelAnimationFrame(id2);
|
|
579
|
-
};
|
|
580
|
-
}, [ready]);
|
|
581
|
-
const hostWidgetIsDragging = !!dragState && dragState.nestedBoardIds.has(boardId);
|
|
582
|
-
const placeholderStyles = useMemo(() => placeholders.map((p) => {
|
|
583
|
-
const pos = calcGridItemPosition(positionParams, p.x, p.y, p.w, p.h);
|
|
584
|
-
return {
|
|
585
|
-
i: p.i,
|
|
586
|
-
style: {
|
|
587
|
-
left: `${pos.left}px`,
|
|
588
|
-
top: `${pos.top}px`,
|
|
589
|
-
width: `${pos.width}px`,
|
|
590
|
-
height: `${pos.height}px`
|
|
591
|
-
}
|
|
592
|
-
};
|
|
593
|
-
}), [placeholders, positionParams]);
|
|
594
|
-
const ownsDrag = !!dragState && (dragState.sourceBoardId === boardId || dragState.currentBoardId === boardId);
|
|
595
|
-
const gridOverlayStyle = !hostWidgetIsDragging && (effectiveShowGridLines === true || effectiveShowGridLines === "drag" && (ownsDrag || !!placeholder) || effectiveShowGridLines === "any-drag" && (!!dragState || !!placeholder)) ? (() => {
|
|
596
|
-
const colWidth = calcGridColWidth(positionParams);
|
|
597
|
-
const rowHeightPx = positionParams.rowHeight;
|
|
598
|
-
const pitchX = colWidth + effectiveMargin[0];
|
|
599
|
-
const pitchY = rowHeightPx + effectiveMargin[1];
|
|
600
|
-
const padX = resolvedPadding[0];
|
|
601
|
-
const padY = resolvedPadding[1];
|
|
602
|
-
const gridWidth = Math.max(0, effectiveContainerWidth - padX * 2);
|
|
603
|
-
const gridHeight = renderedRows > 0 ? renderedRows * rowHeightPx + (renderedRows - 1) * effectiveMargin[1] : 0;
|
|
604
|
-
const fill = "var(--border-color)";
|
|
605
|
-
const columns = `repeating-linear-gradient(to right, ${fill} 0, ${fill} ${colWidth}px, transparent ${colWidth}px, transparent ${pitchX}px)`;
|
|
606
|
-
const rowsGrad = `repeating-linear-gradient(to bottom, #000 0, #000 ${rowHeightPx}px, transparent ${rowHeightPx}px, transparent ${pitchY}px)`;
|
|
607
|
-
return {
|
|
608
|
-
left: `${padX}px`,
|
|
609
|
-
top: `${padY}px`,
|
|
610
|
-
width: `${gridWidth}px`,
|
|
611
|
-
height: `${gridHeight}px`,
|
|
612
|
-
backgroundImage: columns,
|
|
613
|
-
backgroundPosition: "0 0",
|
|
614
|
-
backgroundRepeat: "repeat",
|
|
615
|
-
maskImage: rowsGrad,
|
|
616
|
-
WebkitMaskImage: rowsGrad,
|
|
617
|
-
maskPosition: "0 0",
|
|
618
|
-
WebkitMaskPosition: "0 0",
|
|
619
|
-
maskRepeat: "repeat",
|
|
620
|
-
WebkitMaskRepeat: "repeat"
|
|
621
|
-
};
|
|
622
|
-
})() : null;
|
|
623
|
-
const boardMetrics = useMemo(() => ({
|
|
624
|
-
colWidth: calcGridColWidth(positionParams),
|
|
625
|
-
rowHeight: positionParams.rowHeight,
|
|
626
|
-
margin: positionParams.margin,
|
|
627
|
-
containerPadding: positionParams.containerPadding,
|
|
628
|
-
depth: boardDepth
|
|
629
|
-
}), [positionParams, boardDepth]);
|
|
630
|
-
return /* @__PURE__ */ jsx(BoardMetricsContext.Provider, {
|
|
631
|
-
value: boardMetrics,
|
|
632
|
-
children: /* @__PURE__ */ jsx(BoardGridLinesContext.Provider, {
|
|
633
|
-
value: effectiveShowGridLines === "any-drag" ? "any-drag" : effectiveShowGridLines ? "drag" : false,
|
|
634
|
-
children: /* @__PURE__ */ jsxs(BoardElement, {
|
|
635
|
-
...mergeProps$1(filterBaseProps(otherProps, { eventProps: true }), boardFocusWithinProps, { onKeyDown: handleBoardKeyDown }),
|
|
636
|
-
ref: containerRef,
|
|
637
|
-
styles,
|
|
638
|
-
tabIndex: selectionMode !== "none" ? -1 : void 0,
|
|
639
|
-
"data-board-id": boardId,
|
|
640
|
-
style: aligned ? void 0 : isStretching ? { height: "100%" } : { minHeight: `${containerHeight}px` },
|
|
641
|
-
mods: {
|
|
642
|
-
dragging: !!dragState,
|
|
643
|
-
"drop-target": dragState?.currentBoardId === boardId,
|
|
644
|
-
marquee: isMarqueeActive
|
|
645
|
-
},
|
|
646
|
-
children: [
|
|
647
|
-
/* @__PURE__ */ jsxs(ContentLayer, {
|
|
648
|
-
ref: contentRef,
|
|
649
|
-
onPointerDown: handleContentPointerDown,
|
|
650
|
-
children: [
|
|
651
|
-
ready && gridOverlayStyle ? /* @__PURE__ */ jsx(GridOverlayElement, {
|
|
652
|
-
"aria-hidden": "true",
|
|
653
|
-
style: gridOverlayStyle
|
|
654
|
-
}) : null,
|
|
655
|
-
ready ? layout.map((item) => {
|
|
656
|
-
const registration = registry.store.get(item.i);
|
|
657
|
-
const widgetDraggable = isDraggable && (registration?.isDraggable ?? widgetProps?.isDraggable) !== false && item.isDraggable !== false && !item.static;
|
|
658
|
-
const widgetResizable = isResizable && (registration?.isResizable ?? widgetProps?.isResizable) !== false && item.isResizable !== false && !item.static;
|
|
659
|
-
const handles = item.resizeHandles ?? registration?.resizeHandles ?? widgetProps?.resizeHandles ?? resizeHandles;
|
|
660
|
-
const gripPlacement = registration?.resizeGripPlacement ?? widgetProps?.resizeGripPlacement ?? resizeGripPlacement;
|
|
661
|
-
const widgetDragCancel = registration?.dragCancel ?? widgetProps?.dragCancel ?? dragCancel;
|
|
662
|
-
const widgetDragHandle = registration?.dragHandle ?? widgetProps?.dragHandle ?? dragHandle;
|
|
663
|
-
const widgetIsCard = registration?.isCard ?? widgetProps?.isCard ?? false;
|
|
664
|
-
const widgetHoverRing = registration?.hoverRing ?? widgetProps?.hoverRing ?? true;
|
|
665
|
-
const widgetMods = registration?.mods && widgetProps?.mods ? {
|
|
666
|
-
...widgetProps.mods,
|
|
667
|
-
...registration.mods
|
|
668
|
-
} : registration?.mods ?? widgetProps?.mods;
|
|
669
|
-
const widgetIsAutoHeight = registration?.isAutoHeight ?? widgetProps?.isAutoHeight ?? false;
|
|
670
|
-
const widgetQa = registration?.qa ?? widgetProps?.qa;
|
|
671
|
-
const widgetSelectable = selectionMode !== "none" && isWidgetSelectable(item.i);
|
|
672
|
-
const widgetSelectionCancel = registration?.selectionCancel ?? widgetProps?.selectionCancel ?? selectionCancel;
|
|
673
|
-
const widgetStyles = registration?.styles && widgetPropsStyles ? mergeStyles(widgetPropsStyles, registration.styles) : registration?.styles ?? widgetPropsStyles;
|
|
674
|
-
return /* @__PURE__ */ jsx(WidgetHost, {
|
|
675
|
-
boardId,
|
|
676
|
-
item,
|
|
677
|
-
positionParams,
|
|
678
|
-
registration,
|
|
679
|
-
isCard: widgetIsCard,
|
|
680
|
-
hoverRing: widgetHoverRing,
|
|
681
|
-
cornerChrome: registration?.cornerChrome ?? widgetProps?.cornerChrome,
|
|
682
|
-
cornerChromePlacement: registration?.cornerChromePlacement ?? widgetProps?.cornerChromePlacement,
|
|
683
|
-
mods: widgetMods,
|
|
684
|
-
styles: widgetStyles,
|
|
685
|
-
isDraggable: widgetDraggable,
|
|
686
|
-
isResizable: widgetResizable,
|
|
687
|
-
resizeHandles: handles,
|
|
688
|
-
resizeGripPlacement: gripPlacement,
|
|
689
|
-
boardDepth,
|
|
690
|
-
isAutoHeight: widgetIsAutoHeight,
|
|
691
|
-
qa: widgetQa,
|
|
692
|
-
dragCancel: widgetDragCancel,
|
|
693
|
-
dragHandle: widgetDragHandle,
|
|
694
|
-
isSelectable: widgetSelectable,
|
|
695
|
-
isSelected: selectedKeySet.has(item.i),
|
|
696
|
-
isPreSelected: preSelectedKeys.has(item.i),
|
|
697
|
-
selectionCancel: widgetSelectionCancel,
|
|
698
|
-
selectedHintId,
|
|
699
|
-
onSelect: select,
|
|
700
|
-
onSelectionReset: clearSelection,
|
|
701
|
-
selectModifierKey,
|
|
702
|
-
registry,
|
|
703
|
-
dragState,
|
|
704
|
-
settled,
|
|
705
|
-
onResize: handleResize,
|
|
706
|
-
onAutoHeight: handleAutoHeight,
|
|
707
|
-
onDragLifecycle: handleDragLifecycle
|
|
708
|
-
}, item.i);
|
|
709
|
-
}) : null,
|
|
710
|
-
placeholderStyles.map(({ i, style }) => /* @__PURE__ */ jsx(PlaceholderElement, {
|
|
711
|
-
"aria-hidden": "true",
|
|
712
|
-
style
|
|
713
|
-
}, i)),
|
|
714
|
-
marqueeStyle ? /* @__PURE__ */ jsx(MarqueeElement, {
|
|
715
|
-
"aria-hidden": "true",
|
|
716
|
-
style: marqueeStyle
|
|
717
|
-
}) : null
|
|
718
|
-
]
|
|
719
|
-
}),
|
|
720
|
-
selectionMode !== "none" ? /* @__PURE__ */ jsxs(A11yLayer, { children: [/* @__PURE__ */ jsx("span", {
|
|
721
|
-
id: selectedHintId,
|
|
722
|
-
children: t("board.selected", "Selected")
|
|
723
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
724
|
-
role: "status",
|
|
725
|
-
"aria-live": "polite",
|
|
726
|
-
"aria-atomic": "true",
|
|
727
|
-
children: announcement
|
|
728
|
-
})] }) : null,
|
|
729
|
-
children
|
|
730
|
-
]
|
|
731
|
-
})
|
|
732
|
-
})
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
const BoardInnerForwarded = forwardRef(BoardInner);
|
|
736
|
-
/**
|
|
737
|
-
* A draggable and resizable widget grid. Widgets are declared with
|
|
738
|
-
* `Board.Widget` and positioned via a `layout`. Wrap multiple boards in a
|
|
739
|
-
* `BoardProvider` to enable dragging widgets between them.
|
|
740
|
-
*/
|
|
741
|
-
const Board = forwardRef(function Board(props, ref) {
|
|
742
|
-
const $ = c(6);
|
|
743
|
-
if (useBoardRegistry()) {
|
|
744
|
-
let t0;
|
|
745
|
-
if ($[0] !== props || $[1] !== ref) {
|
|
746
|
-
t0 = /* @__PURE__ */ jsx(BoardInnerForwarded, {
|
|
747
|
-
...props,
|
|
748
|
-
ref
|
|
749
|
-
});
|
|
750
|
-
$[0] = props;
|
|
751
|
-
$[1] = ref;
|
|
752
|
-
$[2] = t0;
|
|
753
|
-
} else t0 = $[2];
|
|
754
|
-
return t0;
|
|
755
|
-
}
|
|
756
|
-
let t0;
|
|
757
|
-
if ($[3] !== props || $[4] !== ref) {
|
|
758
|
-
t0 = /* @__PURE__ */ jsx(BoardProvider, { children: /* @__PURE__ */ jsx(BoardInnerForwarded, {
|
|
759
|
-
...props,
|
|
760
|
-
ref
|
|
761
|
-
}) });
|
|
762
|
-
$[3] = props;
|
|
763
|
-
$[4] = ref;
|
|
764
|
-
$[5] = t0;
|
|
765
|
-
} else t0 = $[5];
|
|
766
|
-
return t0;
|
|
767
|
-
});
|
|
768
|
-
|
|
769
|
-
//#endregion
|
|
770
|
-
export { BOARD_SELECTION_CANCEL, Board };
|
|
771
|
-
//# sourceMappingURL=Board.js.map
|