@cube-dev/ui-kit 0.0.0-canary-ccfec10 → 0.0.0-canary-161c235
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/data/DataTable/DataTable.js +100 -13
- package/dist/components/data/DataTable/DataTable.js.map +1 -1
- package/dist/components/data/DataTable/types.d.ts +2 -2
- package/dist/components/data/ItemTable/ItemTable.js +167 -24
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/types.d.ts +7 -2
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +30 -5
- package/dist/components/data/TableBase/TableRow.js.map +1 -1
- package/dist/components/data/TableBase/TableView.d.ts +2 -1
- package/dist/components/data/TableBase/TableView.js +185 -59
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/index.d.ts +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +55 -2
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/table-tree.js +129 -0
- package/dist/components/data/TableBase/table-tree.js.map +1 -0
- package/dist/components/data/TableBase/types.d.ts +35 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/types.js.map +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +4 -4
- package/dist/components/data/TableBase/use-table-search.js.map +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +124 -24
- package/dist/components/data/TableBase/use-table-selection.js.map +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +107 -0
- package/dist/components/data/TableBase/use-table-tree-state.js.map +1 -0
- package/dist/components/data/index.d.ts +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 +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +25 -8
- package/dist/components/fields/CommandTextArea/CommandTextArea.js.map +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.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 +29 -10
- package/dist/components/fields/TextArea/TextArea.js.map +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision-modes.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/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/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 +5 -1
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +2 -1
- package/dist/i18n/locales/en-US/uikit.js +2 -1
- package/dist/i18n/locales/en-US/uikit.json.d.ts +1 -0
- package/dist/i18n/locales/es-ES/uikit.js +2 -1
- package/dist/i18n/locales/es-MX/uikit.js +2 -1
- package/dist/i18n/locales/fr-FR/uikit.js +2 -1
- package/dist/i18n/locales/it-IT/uikit.js +2 -1
- package/dist/i18n/locales/ja-JP/uikit.js +2 -1
- package/dist/i18n/locales/nb-NO/uikit.js +2 -1
- package/dist/i18n/locales/pt-BR/uikit.js +2 -1
- package/dist/i18n/locales/pt-PT/uikit.js +2 -1
- package/dist/i18n/locales/sv-SE/uikit.js +2 -1
- package/dist/i18n/locales/vi-VN/uikit.js +2 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.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 +2 -2
- package/dist/index.js +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/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/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/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/Usage.md +18 -0
- package/docs/components/data/DataTable.md +43 -0
- package/docs/components/data/ItemTable.md +50 -0
- package/package.json +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +0 -146
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.js","names":["mergeProps"],"sources":["../../../../src/components/data/TableBase/TableRow.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useDraggableItem, useDropIndicator } from 'react-aria';\n\nimport { mergeProps } from '../../../utils/react';\n\nimport type { Key } from '@react-types/shared';\nimport type { ReactNode, Ref } from 'react';\nimport type {\n DraggableCollectionState,\n DroppableCollectionState,\n} from 'react-stately';\n\nexport interface TableRowProps {\n rowKey: Key;\n /** Everything the renderer already computed: mods, ARIA, handlers. */\n rowProps: Record<string, any>;\n height?: number;\n /** Set on the virtualized path so the virtualizer can measure the row. */\n measureRef?: Ref<HTMLTableRowElement>;\n index?: number;\n dragState?: DraggableCollectionState;\n dropState?: DroppableCollectionState;\n children: ReactNode;\n}\n\nfunction Row(props: TableRowProps & {
|
|
1
|
+
{"version":3,"file":"TableRow.js","names":["mergeProps"],"sources":["../../../../src/components/data/TableBase/TableRow.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useDraggableItem, useDropIndicator, useTreeItem } from 'react-aria';\n\nimport { mergeProps, mergeRefs } from '../../../utils/react';\n\nimport type { Key, Node } from '@react-types/shared';\nimport type { ReactNode, Ref } from 'react';\nimport type {\n DraggableCollectionState,\n DroppableCollectionState,\n TreeState,\n} from 'react-stately';\nimport type { TableTreeNode } from './table-tree';\n\nexport interface TableRowTreeProps<T = any> {\n state: TreeState<TableTreeNode<T>>;\n node: Node<TableTreeNode<T>>;\n entry: TableTreeNode<T>;\n isVirtualized: boolean;\n}\n\nexport interface TableRowProps<T = any> {\n rowKey: Key;\n /** Everything the renderer already computed: mods, ARIA, handlers. */\n rowProps: Record<string, any>;\n height?: number;\n /** Set on the virtualized path so the virtualizer can measure the row. */\n measureRef?: Ref<HTMLTableRowElement>;\n /** Internal React Aria row ref in tree mode. */\n rowRef?: Ref<HTMLTableRowElement>;\n index?: number;\n dragState?: DraggableCollectionState;\n dropState?: DroppableCollectionState;\n tree?: TableRowTreeProps<T>;\n children:\n | ReactNode\n | ((treeItemAria: ReturnType<typeof useTreeItem> | undefined) => ReactNode);\n}\n\nfunction Row(\n props: TableRowProps & {\n extra?: Record<string, any>;\n rowRef?: Ref<HTMLTableRowElement>;\n },\n) {\n const { rowProps, height, measureRef, rowRef, index, extra, children } =\n props;\n\n return (\n <tr\n {...rowProps}\n {...extra}\n ref={mergeRefs(measureRef, rowRef)}\n data-index={index}\n style={height != null ? { height } : undefined}\n >\n {typeof children === 'function' ? children(undefined) : children}\n </tr>\n );\n}\n\n/**\n * A row inside a collection that accepts drags.\n *\n * Split from the plain row so the drag hooks can be called unconditionally —\n * they are hooks, and whether a table is draggable is a prop.\n */\nfunction DraggableRow(props: TableRowProps) {\n const { rowKey, dragState, dropState } = props;\n\n const dragResult = useDraggableItem(\n { key: rowKey },\n dragState as DraggableCollectionState,\n );\n\n /**\n * Whether a drop would land *on* this row.\n *\n * `useDropIndicator` rather than asking `dropState.isDropTarget` directly:\n * the state object's identity never changes as the pointer moves, so a plain\n * read is computed once and never updates. The hook subscribes, which is what\n * makes the highlight follow the cursor.\n */\n const onRef = useRef<HTMLDivElement>(null);\n const { isDropTarget: isOnTarget } = useDropIndicator(\n { target: { type: 'item', key: rowKey, dropPosition: 'on' } },\n dropState as DroppableCollectionState,\n onRef,\n );\n\n return (\n <Row\n {...props}\n extra={{\n ...mergeProps(props.rowProps, dragResult.dragProps),\n 'data-draggable': '',\n 'data-dragging': dragResult.isDragging ? '' : undefined,\n 'data-drop-target': isOnTarget ? '' : undefined,\n }}\n />\n );\n}\n\nfunction TreeRow<T>(props: TableRowProps<T>) {\n const { tree } = props;\n const rowRef = useRef<HTMLTableRowElement>(null);\n const treeItemAria = useTreeItem(\n {\n node: tree!.node,\n hasChildItems: tree!.entry.children.length > 0,\n isVirtualized: tree!.isVirtualized,\n },\n tree!.state,\n rowRef,\n );\n\n const rowProps = mergeProps(treeItemAria.rowProps, props.rowProps);\n\n // Table geometry and ItemTable selection are separate from React Aria's\n // internal focus-only selection manager, so the renderer's values win.\n if (props.rowProps['aria-rowindex'] !== undefined) {\n rowProps['aria-rowindex'] = props.rowProps['aria-rowindex'];\n }\n if (props.rowProps['aria-selected'] !== undefined) {\n rowProps['aria-selected'] = props.rowProps['aria-selected'];\n }\n rowProps['aria-level'] = tree!.entry.level + 1;\n rowProps['aria-posinset'] = tree!.entry.siblingIndex + 1;\n rowProps['aria-setsize'] = tree!.entry.siblingCount;\n\n const children =\n typeof props.children === 'function'\n ? props.children(treeItemAria)\n : props.children;\n const next = { ...props, rowProps, rowRef, children };\n\n return props.dragState && props.dropState ? (\n <DraggableRow {...next} />\n ) : (\n <Row {...next} />\n );\n}\n\nexport function TableRow<T>(props: TableRowProps<T>) {\n if (props.tree) return <TreeRow {...props} />;\n\n return props.dragState && props.dropState ? (\n <DraggableRow {...props} />\n ) : (\n <Row {...props} />\n );\n}\n\nexport interface TableRowDropIndicatorProps {\n rowKey: Key;\n dropPosition: 'before' | 'after';\n dropState: DroppableCollectionState;\n columnCount: number;\n}\n\n/**\n * The line showing where a dragged row would land.\n *\n * Its own `<tr>`, because a native table cannot hold an arbitrary element\n * between two rows — the same shape `ListBox` uses with `<li>`. It renders\n * nothing at all unless a drag is in flight, so the table's normal structure is\n * untouched the rest of the time.\n */\nexport function TableRowDropIndicator(props: TableRowDropIndicatorProps) {\n const { rowKey, dropPosition, dropState, columnCount } = props;\n const ref = useRef<HTMLDivElement>(null);\n const { dropIndicatorProps, isHidden, isDropTarget } = useDropIndicator(\n { target: { type: 'item', key: rowKey, dropPosition } },\n dropState,\n ref,\n );\n\n if (isHidden) return null;\n\n return (\n <tr data-element=\"DropIndicatorRow\">\n <td data-element=\"DropIndicatorCell\" colSpan={Math.max(columnCount, 1)}>\n <div\n {...dropIndicatorProps}\n ref={ref}\n data-element=\"DropIndicator\"\n data-drop-target={isDropTarget ? '' : undefined}\n />\n </td>\n </tr>\n );\n}\n"],"mappings":";;;;;;;;AAuCA,SAAS,IACP,OAIA;CACA,MAAM,EAAE,UAAU,QAAQ,YAAY,QAAQ,OAAO,OAAO,aAC1D;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,GAAI;EACJ,KAAK,UAAU,YAAY,OAAO;EAClC,cAAY;EACZ,OAAO,UAAU,OAAO,EAAE,QAAQ,GAAG;YAEpC,OAAO,aAAa,aAAa,SAAS,OAAU,GAAG;GACrD;;;;;;;;AAUT,SAAS,aAAa,OAAsB;CAC1C,MAAM,EAAE,QAAQ,WAAW,cAAc;CAEzC,MAAM,aAAa,iBACjB,EAAE,KAAK,QAAQ,EACf,UACD;;;;;;;;;CAUD,MAAM,QAAQ,OAAuB,KAAK;CAC1C,MAAM,EAAE,cAAc,eAAe,iBACnC,EAAE,QAAQ;EAAE,MAAM;EAAQ,KAAK;EAAQ,cAAc;EAAM,EAAE,EAC7D,WACA,MACD;AAED,QACE,oBAAC;EACC,GAAI;EACJ,OAAO;GACL,GAAGA,aAAW,MAAM,UAAU,WAAW,UAAU;GACnD,kBAAkB;GAClB,iBAAiB,WAAW,aAAa,KAAK;GAC9C,oBAAoB,aAAa,KAAK;GACvC;GACD;;AAIN,SAAS,QAAW,OAAyB;CAC3C,MAAM,EAAE,SAAS;CACjB,MAAM,SAAS,OAA4B,KAAK;CAChD,MAAM,eAAe,YACnB;EACE,MAAM,KAAM;EACZ,eAAe,KAAM,MAAM,SAAS,SAAS;EAC7C,eAAe,KAAM;EACtB,EACD,KAAM,OACN,OACD;CAED,MAAM,WAAWA,aAAW,aAAa,UAAU,MAAM,SAAS;AAIlE,KAAI,MAAM,SAAS,qBAAqB,OACtC,UAAS,mBAAmB,MAAM,SAAS;AAE7C,KAAI,MAAM,SAAS,qBAAqB,OACtC,UAAS,mBAAmB,MAAM,SAAS;AAE7C,UAAS,gBAAgB,KAAM,MAAM,QAAQ;AAC7C,UAAS,mBAAmB,KAAM,MAAM,eAAe;AACvD,UAAS,kBAAkB,KAAM,MAAM;CAEvC,MAAM,WACJ,OAAO,MAAM,aAAa,aACtB,MAAM,SAAS,aAAa,GAC5B,MAAM;CACZ,MAAM,OAAO;EAAE,GAAG;EAAO;EAAU;EAAQ;EAAU;AAErD,QAAO,MAAM,aAAa,MAAM,YAC9B,oBAAC,gBAAa,GAAI,OAAQ,GAE1B,oBAAC,OAAI,GAAI,OAAQ;;AAIrB,SAAgB,SAAY,OAAyB;AACnD,KAAI,MAAM,KAAM,QAAO,oBAAC,WAAQ,GAAI,QAAS;AAE7C,QAAO,MAAM,aAAa,MAAM,YAC9B,oBAAC,gBAAa,GAAI,QAAS,GAE3B,oBAAC,OAAI,GAAI,QAAS;;;;;;;;;;AAmBtB,SAAgB,sBAAsB,OAAmC;CACvE,MAAM,EAAE,QAAQ,cAAc,WAAW,gBAAgB;CACzD,MAAM,MAAM,OAAuB,KAAK;CACxC,MAAM,EAAE,oBAAoB,UAAU,iBAAiB,iBACrD,EAAE,QAAQ;EAAE,MAAM;EAAQ,KAAK;EAAQ;EAAc,EAAE,EACvD,WACA,IACD;AAED,KAAI,SAAU,QAAO;AAErB,QACE,oBAAC;EAAG,gBAAa;YACf,oBAAC;GAAG,gBAAa;GAAoB,SAAS,KAAK,IAAI,aAAa,EAAE;aACpE,oBAAC;IACC,GAAI;IACC;IACL,gBAAa;IACb,oBAAkB,eAAe,KAAK;KACtC;IACC;GACF"}
|
|
@@ -5,7 +5,8 @@ import "./use-table-selection.js";
|
|
|
5
5
|
import { Styles } from "@tenphi/tasty";
|
|
6
6
|
import { ReactNode, RefObject } from "react";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
|
-
import {
|
|
8
|
+
import { TreeState } from "react-stately";
|
|
9
|
+
import { Key as Key$1, Node } from "@react-types/shared";
|
|
9
10
|
|
|
10
11
|
//#region src/components/data/TableBase/TableView.d.ts
|
|
11
12
|
/** Visual/behavioural overrides a table adapter may attach to a single row. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-161c235 | Cube Dev Team */
|
|
2
|
+
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
2
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
4
|
import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
|
|
4
5
|
import { TextItem } from "../../content/TextItem/TextItem.js";
|
|
@@ -6,6 +7,7 @@ import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
|
6
7
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
7
8
|
import { ArrowNarrowDownIcon } from "../../../icons/ArrowNarrowDownIcon.js";
|
|
8
9
|
import { ArrowNarrowUpIcon } from "../../../icons/ArrowNarrowUpIcon.js";
|
|
10
|
+
import { DirectionIcon } from "../../../icons/DirectionIcon.js";
|
|
9
11
|
import { MoreIcon } from "../../../icons/MoreIcon.js";
|
|
10
12
|
import { _MenuTrigger } from "../../actions/Menu/MenuTrigger.js";
|
|
11
13
|
import { __Menu } from "../../actions/Menu/Menu.js";
|
|
@@ -22,7 +24,7 @@ import { ROW_MENU_COLUMN_KEY, isMenuEmpty, normalizeMenuAction } from "./row-men
|
|
|
22
24
|
import { COLUMN_MENU_SORT_DIRECTION, isColumnMenuSortKey, processColumnMenuItems } from "./column-menu.js";
|
|
23
25
|
import { buildColumnTints, tintSlot } from "./column-tint.js";
|
|
24
26
|
import { ColumnResizer } from "./ColumnResizer.js";
|
|
25
|
-
import { TableElement, TableHeaderItem } from "./styled.js";
|
|
27
|
+
import { TableElement, TableHeaderItem, TableTreeToggle, TableTreeTogglePlaceholder } from "./styled.js";
|
|
26
28
|
import { TableHeaderCell } from "./TableHeaderCell.js";
|
|
27
29
|
import { TableRow, TableRowDropIndicator } from "./TableRow.js";
|
|
28
30
|
import { selectionRowKey } from "./types.js";
|
|
@@ -34,7 +36,7 @@ import { getColumnText, getColumnValue } from "./use-table-columns.js";
|
|
|
34
36
|
import { ROW_NUMBER_COLUMN_KEY, SELECTION_COLUMN_KEY } from "./use-table-selection.js";
|
|
35
37
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
36
38
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
-
import { VisuallyHidden } from "react-aria";
|
|
39
|
+
import { VisuallyHidden, useTree } from "react-aria";
|
|
38
40
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
39
41
|
|
|
40
42
|
//#region src/components/data/TableBase/TableView.tsx
|
|
@@ -103,12 +105,78 @@ function pinStyle(column) {
|
|
|
103
105
|
return { ["--pin-offset"]: `${column.pinOffset}px` };
|
|
104
106
|
}
|
|
105
107
|
/**
|
|
108
|
+
* Hook boundary for the native table. Flat tables deliberately avoid this
|
|
109
|
+
* component so their DOM and keyboard behaviour remain exactly as before.
|
|
110
|
+
*/
|
|
111
|
+
function TreeGridTable(props) {
|
|
112
|
+
const { tree, tableProps, style, children } = props;
|
|
113
|
+
const ref = useRef(null);
|
|
114
|
+
const pendingFocusKey = useRef(null);
|
|
115
|
+
const { gridProps } = useTree(tree.ariaProps, tree.state, ref);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
const key = pendingFocusKey.current;
|
|
118
|
+
if (key == null) return;
|
|
119
|
+
const target = Array.from(ref.current?.querySelectorAll("tbody tr[data-element=\"Row\"][data-key]") ?? []).find((element) => element.dataset.key === String(key));
|
|
120
|
+
if (target) {
|
|
121
|
+
pendingFocusKey.current = null;
|
|
122
|
+
target.focus();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
const handleKeyDownCapture = (event) => {
|
|
126
|
+
const row = event.target.closest("tbody tr[data-element=\"Row\"][data-key]");
|
|
127
|
+
if (!row || event.target !== row) {
|
|
128
|
+
gridProps.onKeyDownCapture?.(event);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const index = tree.entries.findIndex((entry) => String(entry.key) === row.dataset.key);
|
|
132
|
+
const entry = tree.entries[index];
|
|
133
|
+
if (!entry) return;
|
|
134
|
+
const focusEntry = (next) => {
|
|
135
|
+
if (!next) return false;
|
|
136
|
+
tree.state.selectionManager.setFocusedKey(next.key);
|
|
137
|
+
const target = Array.from(ref.current?.querySelectorAll("tbody tr[data-element=\"Row\"][data-key]") ?? []).find((element) => element.dataset.key === String(next.key));
|
|
138
|
+
if (target) target.focus();
|
|
139
|
+
else pendingFocusKey.current = next.key;
|
|
140
|
+
return true;
|
|
141
|
+
};
|
|
142
|
+
const hasChildren = entry.children.length > 0;
|
|
143
|
+
const isExpanded = tree.state.expandedKeys.has(entry.key);
|
|
144
|
+
let handled = false;
|
|
145
|
+
if (event.key === "ArrowRight" && hasChildren) if (isExpanded) handled = focusEntry(entry.children[0]);
|
|
146
|
+
else {
|
|
147
|
+
tree.state.toggleKey(entry.key);
|
|
148
|
+
handled = true;
|
|
149
|
+
}
|
|
150
|
+
else if (event.key === "ArrowLeft") {
|
|
151
|
+
if (hasChildren && isExpanded) {
|
|
152
|
+
tree.state.toggleKey(entry.key);
|
|
153
|
+
handled = true;
|
|
154
|
+
} else if (entry.parentKey != null) handled = focusEntry(tree.entries.find((candidate) => candidate.key === entry.parentKey));
|
|
155
|
+
} else if (event.key === "ArrowDown") handled = focusEntry(tree.entries[index + 1]);
|
|
156
|
+
else if (event.key === "ArrowUp") handled = focusEntry(tree.entries[index - 1]);
|
|
157
|
+
if (handled) {
|
|
158
|
+
event.preventDefault();
|
|
159
|
+
event.stopPropagation();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
gridProps.onKeyDownCapture?.(event);
|
|
163
|
+
};
|
|
164
|
+
return /* @__PURE__ */ jsx("table", {
|
|
165
|
+
...mergeProps$1(gridProps, tableProps),
|
|
166
|
+
ref,
|
|
167
|
+
role: "treegrid",
|
|
168
|
+
style,
|
|
169
|
+
onKeyDownCapture: handleKeyDownCapture,
|
|
170
|
+
children
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
106
174
|
* The one place table DOM exists. Both `ItemTable` and `DataTable` resolve their
|
|
107
175
|
* props into the shape above and hand it here, so the markup, the ARIA
|
|
108
176
|
* bookkeeping and the tasty sub-element contract have a single implementation.
|
|
109
177
|
*/
|
|
110
178
|
function TableView(props) {
|
|
111
|
-
const { qa, rows, getRowKey, layout, onScrollerRef, rootRef, size = "medium", shape = "plain", rowSize, rowHeight, headerHeight, isHeaderHidden = false, isStriped = false, hasColumnDividers, isRowMoveAnimated = true, isHeaderSticky = true, isVirtualized = "auto", virtualizeThreshold = 50, overscan = 20, isLoading = false, loadingIndicator = "overlay", skeletonRowCount = 6, selection, selectionTooltip, overlay, rowMenu, rowContextMenu = false, onRowMenuAction, rowMenuTriggerProps, rowLink, onRowAction, onLoadMore, hasMore = false, isLoadingMore = false, loadMoreMargin, pinnedTopRows, pinnedBottomRows, cellSelection, rowNumberOffset = 0, rowIndexOffset = 0, totalRowCount, isReorderable = false, dragState, dropState, collectionProps, isColumnReorderable = false, columnDragState, columnDropState, headCollectionProps, headRowRef, onColumnFocus, bodyRef, isResizable = false, onColumnResize, onColumnResizeEnd, emptyLabel, noResultsLabel, error, isFiltered = false, sortMode = "off", sort, sorts, onColumnSort, onColumnSortChange, columnContextMenu = true, onColumnMenuAction, columnMenuTriggerProps, columnMenuProps, getRowProps, headerPreset, contentPreset, toolbar, footer, ariaLabel, styles, headerStyles, headerCellStyles, bodyStyles, rowStyles, cellStyles, mods } = props;
|
|
179
|
+
const { qa, rows, rowKeys, getRowKey, layout, onScrollerRef, rootRef, size = "medium", shape = "plain", rowSize, rowHeight, headerHeight, isHeaderHidden = false, isStriped = false, hasColumnDividers, isRowMoveAnimated = true, isHeaderSticky = true, isVirtualized = "auto", virtualizeThreshold = 50, overscan = 20, isLoading = false, loadingIndicator = "overlay", skeletonRowCount = 6, selection, selectionTooltip, overlay, rowMenu, rowContextMenu = false, onRowMenuAction, rowMenuTriggerProps, rowLink, onRowAction, onLoadMore, hasMore = false, isLoadingMore = false, loadMoreMargin, pinnedTopRows, pinnedBottomRows, cellSelection, rowNumberOffset = 0, rowIndexOffset = 0, totalRowCount, tree, isReorderable = false, dragState, dropState, collectionProps, isColumnReorderable = false, columnDragState, columnDropState, headCollectionProps, headRowRef, onColumnFocus, bodyRef, isResizable = false, onColumnResize, onColumnResizeEnd, emptyLabel, noResultsLabel, error, isFiltered = false, sortMode = "off", sort, sorts, onColumnSort, onColumnSortChange, columnContextMenu = true, onColumnMenuAction, columnMenuTriggerProps, columnMenuProps, getRowProps, headerPreset, contentPreset, toolbar, footer, ariaLabel, styles, headerStyles, headerCellStyles, bodyStyles, rowStyles, cellStyles, mods } = props;
|
|
112
180
|
const { columns } = layout;
|
|
113
181
|
const columnCount = columns.length;
|
|
114
182
|
/**
|
|
@@ -150,6 +218,16 @@ function TableView(props) {
|
|
|
150
218
|
const bodyRowCount = Math.max(totalRowCount ?? rows.length, rowIndexOffset + rows.length);
|
|
151
219
|
/** 1-based `aria-rowindex` for the i-th body row of the current page. */
|
|
152
220
|
const bodyRowIndex = (rowIndex) => headerRowCount + pinnedTopCount + rowIndexOffset + rowIndex + 1;
|
|
221
|
+
const bodyRowKey = (row, rowIndex) => rowKeys?.[rowIndex] ?? getRowKey(row, rowIndex);
|
|
222
|
+
const treeRowState = (rowIndex) => {
|
|
223
|
+
const entry = tree?.entries[rowIndex];
|
|
224
|
+
return entry ? {
|
|
225
|
+
level: entry.level,
|
|
226
|
+
parentKey: entry.parentKey,
|
|
227
|
+
hasChildren: entry.children.length > 0,
|
|
228
|
+
isExpanded: tree.state.expandedKeys.has(entry.key)
|
|
229
|
+
} : void 0;
|
|
230
|
+
};
|
|
153
231
|
/** 1-based `aria-rowindex` for the i-th pinned row at `edge`. */
|
|
154
232
|
const pinnedRowIndex = (index, edge) => edge === "top" ? headerRowCount + index + 1 : headerRowCount + pinnedTopCount + bodyRowCount + index + 1;
|
|
155
233
|
const tints = useMemo(() => buildColumnTints(columns, { resolveTheme: getColorTheme }), [columns, usePaletteVersion()]);
|
|
@@ -345,6 +423,7 @@ function TableView(props) {
|
|
|
345
423
|
const checkbox = /* @__PURE__ */ jsx(__Checkbox, {
|
|
346
424
|
"aria-label": t("itemTable.selectRow", "Select row"),
|
|
347
425
|
isSelected: selection.isSelected(rowKey),
|
|
426
|
+
isIndeterminate: selection.isIndeterminate(rowKey),
|
|
348
427
|
isDisabled: !canSelect,
|
|
349
428
|
onChange: () => selection.toggleRow(rowKey)
|
|
350
429
|
});
|
|
@@ -546,7 +625,7 @@ function TableView(props) {
|
|
|
546
625
|
}) : null]
|
|
547
626
|
}, column.key);
|
|
548
627
|
}
|
|
549
|
-
function renderCell(column, row, rowIndex, rowKey, isLastRow, pinnedEdge) {
|
|
628
|
+
function renderCell(column, row, rowIndex, rowKey, isLastRow, pinnedEdge, treeItemAria) {
|
|
550
629
|
const rangeKey = selectionRowKey(sectionOf(pinnedEdge), rowKey);
|
|
551
630
|
if (column.key === SELECTION_COLUMN_KEY) return renderSelectionCell(column, row, rowIndex, rowKey, isLastRow, pinnedEdge);
|
|
552
631
|
if (column.key === ROW_NUMBER_COLUMN_KEY) return /* @__PURE__ */ jsx("td", {
|
|
@@ -571,12 +650,30 @@ function TableView(props) {
|
|
|
571
650
|
columnKey: column.key,
|
|
572
651
|
columnIndex: column.index,
|
|
573
652
|
section: sectionOf(pinnedEdge),
|
|
574
|
-
isSelected: selection?.isSelected(rowKey) ?? false
|
|
653
|
+
isSelected: selection?.isSelected(rowKey) ?? false,
|
|
654
|
+
tree: pinnedEdge == null ? treeRowState(rowIndex) : void 0
|
|
575
655
|
};
|
|
576
656
|
const value = column.isStructural ? void 0 : getColumnValue(column, row, rowIndex);
|
|
577
657
|
const rendered = column.render ? column.render(value, row, rowIndex, ctx) : column.isStructural ? null : getColumnText(column, row, rowIndex);
|
|
578
658
|
const isText = typeof rendered === "string" || typeof rendered === "number" || typeof rendered === "bigint";
|
|
579
659
|
const content = isText && !column.autoHeight ? /* @__PURE__ */ jsx(TextItem, { children: String(rendered) }) : isText ? String(rendered) : rendered;
|
|
660
|
+
const treeEntry = pinnedEdge == null ? tree?.entries[rowIndex] : void 0;
|
|
661
|
+
const displayContent = treeEntry && column.key === tree?.columnKey ? /* @__PURE__ */ jsxs("div", {
|
|
662
|
+
"data-element": "TreeContent",
|
|
663
|
+
style: { "--tree-level": String(treeEntry.level) },
|
|
664
|
+
children: [treeEntry.children.length > 0 ? /* @__PURE__ */ jsx(TableTreeToggle, {
|
|
665
|
+
...treeItemAria?.expandButtonProps,
|
|
666
|
+
"data-element": "TreeToggle",
|
|
667
|
+
tabIndex: -1,
|
|
668
|
+
children: /* @__PURE__ */ jsx(DirectionIcon, { to: tree.state.expandedKeys.has(treeEntry.key) ? "bottom" : "right" })
|
|
669
|
+
}) : /* @__PURE__ */ jsx(TableTreeTogglePlaceholder, {
|
|
670
|
+
"data-element": "TreeToggle",
|
|
671
|
+
"aria-hidden": "true"
|
|
672
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
673
|
+
"data-element": "TreeValue",
|
|
674
|
+
children: content
|
|
675
|
+
})]
|
|
676
|
+
}) : content;
|
|
580
677
|
const resolvedCellStyles = typeof column.cellStyles === "function" ? column.cellStyles(ctx) : column.cellStyles;
|
|
581
678
|
const CellTag = column.isRowHeader ? "th" : "td";
|
|
582
679
|
const link = column.isRowHeader ? rowLink?.(row, rowIndex) : void 0;
|
|
@@ -603,7 +700,7 @@ function TableView(props) {
|
|
|
603
700
|
...resolvedCellStyles
|
|
604
701
|
},
|
|
605
702
|
...column.cellProps?.(ctx),
|
|
606
|
-
children: [
|
|
703
|
+
children: [displayContent, link !== void 0 ? /* @__PURE__ */ jsx(Action, {
|
|
607
704
|
"data-element": "RowLink",
|
|
608
705
|
to: link,
|
|
609
706
|
tabIndex: -1,
|
|
@@ -630,9 +727,9 @@ function TableView(props) {
|
|
|
630
727
|
}, `pinned-${edge}-${rowKey}`);
|
|
631
728
|
}
|
|
632
729
|
/** The cells of one body row. Shared by both render paths. */
|
|
633
|
-
function renderRowCells(row, rowIndex) {
|
|
634
|
-
const rowKey =
|
|
635
|
-
return columns.map((column) => renderCell(column, row, rowIndex, rowKey, rowIndex === rows.length - 1));
|
|
730
|
+
function renderRowCells(row, rowIndex, treeItemAria) {
|
|
731
|
+
const rowKey = bodyRowKey(row, rowIndex);
|
|
732
|
+
return columns.map((column) => renderCell(column, row, rowIndex, rowKey, rowIndex === rows.length - 1, void 0, treeItemAria));
|
|
636
733
|
}
|
|
637
734
|
/**
|
|
638
735
|
* The `<tr>` shell. Virtuoso owns the element in the virtualized path (it
|
|
@@ -640,15 +737,17 @@ function TableView(props) {
|
|
|
640
737
|
* props rather than the element.
|
|
641
738
|
*/
|
|
642
739
|
function getRowElementProps(row, rowIndex) {
|
|
643
|
-
const rowKey =
|
|
740
|
+
const rowKey = bodyRowKey(row, rowIndex);
|
|
644
741
|
const isSelected = selection?.isSelected(rowKey) ?? false;
|
|
645
|
-
const
|
|
742
|
+
const ctx = {
|
|
646
743
|
row,
|
|
647
744
|
rowKey,
|
|
648
745
|
rowIndex,
|
|
649
746
|
section: "body",
|
|
650
|
-
isSelected
|
|
651
|
-
|
|
747
|
+
isSelected,
|
|
748
|
+
tree: treeRowState(rowIndex)
|
|
749
|
+
};
|
|
750
|
+
const extra = getRowProps?.(ctx);
|
|
652
751
|
return {
|
|
653
752
|
"data-element": "Row",
|
|
654
753
|
"data-key": String(rowKey),
|
|
@@ -659,7 +758,7 @@ function TableView(props) {
|
|
|
659
758
|
"data-selected": isSelected ? "" : void 0,
|
|
660
759
|
"data-disabled": selection?.isRowDisabled(rowKey) ? "" : void 0,
|
|
661
760
|
role: "row",
|
|
662
|
-
tabIndex: isReorderable ? rowIndex === focusedRowIndex ? 0 : -1 : void 0,
|
|
761
|
+
tabIndex: !tree && isReorderable ? rowIndex === focusedRowIndex ? 0 : -1 : void 0,
|
|
663
762
|
"aria-selected": selection?.isEnabled ? isSelected : void 0,
|
|
664
763
|
"aria-rowindex": bodyRowIndex(rowIndex),
|
|
665
764
|
title: extra?.tooltip,
|
|
@@ -675,15 +774,24 @@ function TableView(props) {
|
|
|
675
774
|
}
|
|
676
775
|
function renderRow(row, rowIndex, isVirtual = false) {
|
|
677
776
|
const { height, ...rowProps } = getRowElementProps(row, rowIndex);
|
|
777
|
+
const rowKey = bodyRowKey(row, rowIndex);
|
|
778
|
+
const treeNode = tree?.nodes[rowIndex];
|
|
779
|
+
const treeEntry = tree?.entries[rowIndex];
|
|
678
780
|
return /* @__PURE__ */ jsx(TableRow, {
|
|
679
|
-
rowKey
|
|
781
|
+
rowKey,
|
|
680
782
|
rowProps,
|
|
681
783
|
height,
|
|
682
784
|
index: isVirtual ? rowIndex : void 0,
|
|
683
785
|
measureRef: isVirtual ? virtualizer.measureElement : void 0,
|
|
684
786
|
dragState: isReorderable ? dragState : void 0,
|
|
685
787
|
dropState: isReorderable ? dropState : void 0,
|
|
686
|
-
|
|
788
|
+
tree: treeNode && treeEntry ? {
|
|
789
|
+
state: tree.state,
|
|
790
|
+
node: treeNode,
|
|
791
|
+
entry: treeEntry,
|
|
792
|
+
isVirtualized: isVirtual
|
|
793
|
+
} : void 0,
|
|
794
|
+
children: (treeItemAria) => renderRowCells(row, rowIndex, treeItemAria)
|
|
687
795
|
}, rowProps["data-key"]);
|
|
688
796
|
}
|
|
689
797
|
function renderSpacerRow(height, position) {
|
|
@@ -705,7 +813,7 @@ function TableView(props) {
|
|
|
705
813
|
* is merely *capable* of dragging keeps its ordinary structure.
|
|
706
814
|
*/
|
|
707
815
|
function withDropIndicators(row, index, isVirtual = false) {
|
|
708
|
-
const rowKey =
|
|
816
|
+
const rowKey = bodyRowKey(row, index);
|
|
709
817
|
const rowNode = renderRow(row, index, isVirtual);
|
|
710
818
|
if (!isReorderable || !dropState) return rowNode;
|
|
711
819
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -734,11 +842,22 @@ function TableView(props) {
|
|
|
734
842
|
const virtualizer = useVirtualizer({
|
|
735
843
|
count: shouldVirtualize ? rows.length : 0,
|
|
736
844
|
getScrollElement: () => scrollerRef.current,
|
|
737
|
-
getItemKey: (index) => String(getRowKey(rowsRef.current[index], index)),
|
|
845
|
+
getItemKey: (index) => String(rowKeys?.[index] ?? getRowKey(rowsRef.current[index], index)),
|
|
738
846
|
estimateSize: () => (rowHeight ?? (rowSizeKey ? SIZES[rowSizeKey] : ESTIMATED_ROW_HEIGHT[size ?? "medium"])) + 1,
|
|
739
847
|
measureElement: (element) => element.getBoundingClientRect().height,
|
|
740
848
|
overscan
|
|
741
849
|
});
|
|
850
|
+
const focusedTreeKey = tree?.state.selectionManager.focusedKey;
|
|
851
|
+
useEffect(() => {
|
|
852
|
+
if (!shouldVirtualize || focusedTreeKey == null || !tree) return;
|
|
853
|
+
const index = tree.entries.findIndex((entry) => entry.key === focusedTreeKey);
|
|
854
|
+
if (index >= 0) virtualizer.scrollToIndex(index, { align: "auto" });
|
|
855
|
+
}, [
|
|
856
|
+
focusedTreeKey,
|
|
857
|
+
shouldVirtualize,
|
|
858
|
+
tree,
|
|
859
|
+
virtualizer
|
|
860
|
+
]);
|
|
742
861
|
const scrollability = useScrollability(scrollerEl);
|
|
743
862
|
/**
|
|
744
863
|
* Roving tabindex over the rows, so a reorderable table can be operated from
|
|
@@ -908,7 +1027,8 @@ function TableView(props) {
|
|
|
908
1027
|
const row = rows[index];
|
|
909
1028
|
return row === void 0 ? null : {
|
|
910
1029
|
row,
|
|
911
|
-
index
|
|
1030
|
+
index,
|
|
1031
|
+
key: bodyRowKey(row, index)
|
|
912
1032
|
};
|
|
913
1033
|
}
|
|
914
1034
|
const virtualItems = shouldVirtualize ? virtualizer.getVirtualItems() : [];
|
|
@@ -929,7 +1049,7 @@ function TableView(props) {
|
|
|
929
1049
|
});
|
|
930
1050
|
const tableProps = {
|
|
931
1051
|
"data-element": "Table",
|
|
932
|
-
role: "grid",
|
|
1052
|
+
role: tree ? "treegrid" : "grid",
|
|
933
1053
|
"aria-label": ariaLabel,
|
|
934
1054
|
"aria-busy": isLoading || void 0,
|
|
935
1055
|
"aria-rowcount": headerRowCount + pinnedTopCount + bodyRowCount + pinnedBottomCount,
|
|
@@ -947,6 +1067,40 @@ function TableView(props) {
|
|
|
947
1067
|
renderSpacerRow(paddingBottom, "bottom")
|
|
948
1068
|
] });
|
|
949
1069
|
else bodyContent = rows.map((row, index) => withDropIndicators(row, index));
|
|
1070
|
+
const tableContent = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1071
|
+
colGroup,
|
|
1072
|
+
isHeaderHidden ? null : /* @__PURE__ */ jsx("thead", {
|
|
1073
|
+
"data-element": "Head",
|
|
1074
|
+
children: headerRow
|
|
1075
|
+
}),
|
|
1076
|
+
/* @__PURE__ */ jsxs("tbody", {
|
|
1077
|
+
"data-element": "Body",
|
|
1078
|
+
...collectionProps,
|
|
1079
|
+
ref: handleBodyRef,
|
|
1080
|
+
children: [
|
|
1081
|
+
pinnedTopRows?.map((row, index) => renderPinnedRow(row, index, "top")),
|
|
1082
|
+
bodyContent,
|
|
1083
|
+
pinnedBottomRows?.map((row, index) => renderPinnedRow(row, index, "bottom")),
|
|
1084
|
+
isLoadingMore ? renderSkeletonRows(loadMoreSkeletonCount, "load-more") : null,
|
|
1085
|
+
onLoadMore && hasRows ? /* @__PURE__ */ jsx("tr", {
|
|
1086
|
+
"data-sentinel": "",
|
|
1087
|
+
"aria-hidden": "true",
|
|
1088
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
1089
|
+
colSpan: Math.max(columnCount, 1),
|
|
1090
|
+
style: {
|
|
1091
|
+
height: 1,
|
|
1092
|
+
padding: 0,
|
|
1093
|
+
border: 0
|
|
1094
|
+
},
|
|
1095
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1096
|
+
ref: sentinelRef,
|
|
1097
|
+
style: { height: 1 }
|
|
1098
|
+
})
|
|
1099
|
+
})
|
|
1100
|
+
}) : null
|
|
1101
|
+
]
|
|
1102
|
+
})
|
|
1103
|
+
] });
|
|
950
1104
|
if (columnCount === 0 && isLoading) return /* @__PURE__ */ jsxs(TableElement, {
|
|
951
1105
|
ref: rootRef,
|
|
952
1106
|
qa: qa || "Table",
|
|
@@ -989,16 +1143,16 @@ function TableView(props) {
|
|
|
989
1143
|
const found = rowFromEvent(event.target);
|
|
990
1144
|
if (found) {
|
|
991
1145
|
event.stopPropagation();
|
|
992
|
-
openContextMenuFor(found.row, found.index,
|
|
1146
|
+
openContextMenuFor(found.row, found.index, found.key, event);
|
|
993
1147
|
}
|
|
994
1148
|
return;
|
|
995
1149
|
}
|
|
996
1150
|
if (event.key === "Enter" && onRowAction) {
|
|
997
1151
|
const found = rowFromEvent(event.target);
|
|
998
|
-
if (found && !event.target.closest("a, button, input, select, textarea, [role=\"button\"]")) onRowAction(found.row,
|
|
1152
|
+
if (found && !event.target.closest("a, button, input, select, textarea, [role=\"button\"]")) onRowAction(found.row, found.key);
|
|
999
1153
|
return;
|
|
1000
1154
|
}
|
|
1001
|
-
if (isReorderable && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
1155
|
+
if (!tree && isReorderable && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
1002
1156
|
if (dragState?.draggingKeys?.size) return;
|
|
1003
1157
|
if (moveRowFocus(event.target, event.key === "ArrowDown" ? 1 : -1)) event.preventDefault();
|
|
1004
1158
|
return;
|
|
@@ -1027,43 +1181,15 @@ function TableView(props) {
|
|
|
1027
1181
|
description: t("itemTable.copiedCells", "{{count}} cells copied", { count: cellSelection.cellCount })
|
|
1028
1182
|
});
|
|
1029
1183
|
},
|
|
1030
|
-
children: /* @__PURE__ */
|
|
1184
|
+
children: tree ? /* @__PURE__ */ jsx(TreeGridTable, {
|
|
1185
|
+
tree,
|
|
1186
|
+
tableProps,
|
|
1187
|
+
style: layout.totalWidth != null ? { width: layout.totalWidth } : void 0,
|
|
1188
|
+
children: tableContent
|
|
1189
|
+
}) : /* @__PURE__ */ jsx("table", {
|
|
1031
1190
|
...tableProps,
|
|
1032
1191
|
style: layout.totalWidth != null ? { width: layout.totalWidth } : void 0,
|
|
1033
|
-
children:
|
|
1034
|
-
colGroup,
|
|
1035
|
-
isHeaderHidden ? null : /* @__PURE__ */ jsx("thead", {
|
|
1036
|
-
"data-element": "Head",
|
|
1037
|
-
children: headerRow
|
|
1038
|
-
}),
|
|
1039
|
-
/* @__PURE__ */ jsxs("tbody", {
|
|
1040
|
-
"data-element": "Body",
|
|
1041
|
-
...collectionProps,
|
|
1042
|
-
ref: handleBodyRef,
|
|
1043
|
-
children: [
|
|
1044
|
-
pinnedTopRows?.map((row, index) => renderPinnedRow(row, index, "top")),
|
|
1045
|
-
bodyContent,
|
|
1046
|
-
pinnedBottomRows?.map((row, index) => renderPinnedRow(row, index, "bottom")),
|
|
1047
|
-
isLoadingMore ? renderSkeletonRows(loadMoreSkeletonCount, "load-more") : null,
|
|
1048
|
-
onLoadMore && hasRows ? /* @__PURE__ */ jsx("tr", {
|
|
1049
|
-
"data-sentinel": "",
|
|
1050
|
-
"aria-hidden": "true",
|
|
1051
|
-
children: /* @__PURE__ */ jsx("td", {
|
|
1052
|
-
colSpan: Math.max(columnCount, 1),
|
|
1053
|
-
style: {
|
|
1054
|
-
height: 1,
|
|
1055
|
-
padding: 0,
|
|
1056
|
-
border: 0
|
|
1057
|
-
},
|
|
1058
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
1059
|
-
ref: sentinelRef,
|
|
1060
|
-
style: { height: 1 }
|
|
1061
|
-
})
|
|
1062
|
-
})
|
|
1063
|
-
}) : null
|
|
1064
|
-
]
|
|
1065
|
-
})
|
|
1066
|
-
]
|
|
1192
|
+
children: tableContent
|
|
1067
1193
|
})
|
|
1068
1194
|
}),
|
|
1069
1195
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", {
|