@cube-dev/ui-kit 0.155.0 → 0.157.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +284 -0
- package/dist/_internal/hooks/use-chained-callback.js +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +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.d.ts +10 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +4 -3
- 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/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 +42 -44
- package/dist/components/actions/use-context-menu.js.map +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 +2 -2
- package/dist/components/content/Tag/Tag.js.map +1 -1
- package/dist/components/content/Text.d.ts +14 -14
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.d.ts +13 -0
- package/dist/components/data/DataTable/DataTable.js +246 -0
- package/dist/components/data/DataTable/DataTable.js.map +1 -0
- package/dist/components/data/DataTable/index.d.ts +3 -0
- package/dist/components/data/DataTable/types.d.ts +145 -0
- package/dist/components/data/ItemTable/ItemTable.d.ts +19 -0
- package/dist/components/data/ItemTable/ItemTable.js +350 -0
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -0
- package/dist/components/data/ItemTable/ItemTableBulkBar.d.ts +23 -0
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +131 -0
- package/dist/components/data/ItemTable/ItemTableBulkBar.js.map +1 -0
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +46 -0
- package/dist/components/data/ItemTable/ItemTableDragPreview.js.map +1 -0
- package/dist/components/data/ItemTable/ItemTableFooter.js +79 -0
- package/dist/components/data/ItemTable/ItemTableFooter.js.map +1 -0
- package/dist/components/data/ItemTable/ItemTableToolbar.d.ts +34 -0
- package/dist/components/data/ItemTable/ItemTableToolbar.js +91 -0
- package/dist/components/data/ItemTable/ItemTableToolbar.js.map +1 -0
- package/dist/components/data/ItemTable/index.d.ts +4 -0
- package/dist/components/data/ItemTable/types.d.ts +327 -0
- package/dist/components/data/TableBase/ColumnResizer.js +70 -0
- package/dist/components/data/TableBase/ColumnResizer.js.map +1 -0
- package/dist/components/data/TableBase/RowCollection.js +99 -0
- package/dist/components/data/TableBase/RowCollection.js.map +1 -0
- package/dist/components/data/TableBase/TableRow.js +89 -0
- package/dist/components/data/TableBase/TableRow.js.map +1 -0
- package/dist/components/data/TableBase/TableView.d.ts +22 -0
- package/dist/components/data/TableBase/TableView.js +921 -0
- package/dist/components/data/TableBase/TableView.js.map +1 -0
- package/dist/components/data/TableBase/index.d.ts +5 -0
- package/dist/components/data/TableBase/row-menu.js +40 -0
- package/dist/components/data/TableBase/row-menu.js.map +1 -0
- package/dist/components/data/TableBase/styled.d.ts +5 -0
- package/dist/components/data/TableBase/styled.js +532 -0
- package/dist/components/data/TableBase/styled.js.map +1 -0
- package/dist/components/data/TableBase/types.d.ts +160 -0
- package/dist/components/data/TableBase/types.js +31 -0
- package/dist/components/data/TableBase/types.js.map +1 -0
- package/dist/components/data/TableBase/use-cell-selection.d.ts +3 -0
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-cell-selection.js.map +1 -0
- package/dist/components/data/TableBase/use-container-width.js +35 -0
- package/dist/components/data/TableBase/use-container-width.js.map +1 -0
- package/dist/components/data/TableBase/use-row-move-animation.js +90 -0
- package/dist/components/data/TableBase/use-row-move-animation.js.map +1 -0
- package/dist/components/data/TableBase/use-scrollability.js +49 -0
- package/dist/components/data/TableBase/use-scrollability.js.map +1 -0
- package/dist/components/data/TableBase/use-table-columns.d.ts +2 -0
- package/dist/components/data/TableBase/use-table-columns.js +166 -0
- package/dist/components/data/TableBase/use-table-columns.js.map +1 -0
- package/dist/components/data/TableBase/use-table-search.js +64 -0
- package/dist/components/data/TableBase/use-table-search.js.map +1 -0
- package/dist/components/data/TableBase/use-table-selection.d.ts +4 -0
- package/dist/components/data/TableBase/use-table-selection.js +233 -0
- package/dist/components/data/TableBase/use-table-selection.js.map +1 -0
- package/dist/components/data/TableBase/use-table-sort.js +91 -0
- package/dist/components/data/TableBase/use-table-sort.js.map +1 -0
- package/dist/components/data/TableBase/use-table-sorts.js +97 -0
- package/dist/components/data/TableBase/use-table-sorts.js.map +1 -0
- package/dist/components/data/TableBase/use-table-storage.d.ts +8 -0
- package/dist/components/data/TableBase/use-table-storage.js +58 -0
- package/dist/components/data/TableBase/use-table-storage.js.map +1 -0
- package/dist/components/data/index.d.ts +10 -0
- 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.d.ts +67 -0
- package/dist/components/fields/ColorInput/ColorInput.js +230 -0
- package/dist/components/fields/ColorInput/ColorInput.js.map +1 -0
- package/dist/components/fields/ColorInput/index.d.ts +2 -0
- package/dist/components/fields/ColorPicker/ColorPicker.d.ts +64 -0
- package/dist/components/fields/ColorPicker/ColorPicker.js +189 -0
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/fields/ColorPicker/index.d.ts +2 -0
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.d.ts +50 -0
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +269 -0
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -0
- package/dist/components/fields/ColorSwatchGroup/index.d.ts +2 -0
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.d.ts +3 -3
- package/dist/components/fields/FilterListBox/FilterListBox.js +8 -6
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +6 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +2 -2
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +7 -0
- package/dist/components/fields/ListBox/ListBox.js +4 -3
- package/dist/components/fields/ListBox/ListBox.js.map +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.d.ts +2 -2
- package/dist/components/fields/PasswordInput/PasswordInput.js +12 -2
- package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/fields/Picker/Picker.js +6 -1
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +2 -2
- package/dist/components/fields/RadioGroup/Radio.js +4 -4
- package/dist/components/fields/RadioGroup/Radio.js.map +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.d.ts +2 -2
- package/dist/components/fields/SearchInput/SearchInput.js +17 -4
- package/dist/components/fields/SearchInput/SearchInput.js.map +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.d.ts +2 -2
- package/dist/components/fields/TextArea/TextArea.js +12 -5
- package/dist/components/fields/TextArea/TextArea.js.map +1 -1
- package/dist/components/fields/TextInput/TextInput.d.ts +2 -2
- package/dist/components/fields/TextInput/TextInput.js +15 -3
- package/dist/components/fields/TextInput/TextInput.js.map +1 -1
- package/dist/components/fields/TextInput/TextInputBase.d.ts +17 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/index.d.ts +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +152 -0
- package/dist/components/fields/color/ColorPanel.js.map +1 -0
- package/dist/components/fields/color/ColorSwatch.d.ts +22 -0
- package/dist/components/fields/color/ColorSwatch.js +58 -0
- package/dist/components/fields/color/ColorSwatch.js.map +1 -0
- package/dist/components/fields/color/channels.d.ts +13 -0
- package/dist/components/fields/color/channels.js +194 -0
- package/dist/components/fields/color/channels.js.map +1 -0
- package/dist/components/fields/color/color.d.ts +21 -0
- package/dist/components/fields/color/color.js +282 -0
- package/dist/components/fields/color/color.js.map +1 -0
- package/dist/components/fields/color/context.js +20 -0
- package/dist/components/fields/color/context.js.map +1 -0
- package/dist/components/fields/color/index.d.ts +4 -0
- package/dist/components/fields/index.d.ts +11 -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.d.ts +26 -0
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.d.ts +55 -1
- package/dist/components/layout/Board/Board.js +278 -75
- package/dist/components/layout/Board/Board.js.map +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.d.ts +16 -0
- package/dist/components/layout/Board/Widget.js +6 -3
- package/dist/components/layout/Board/Widget.js.map +1 -1
- package/dist/components/layout/Board/WidgetHost.js +81 -14
- package/dist/components/layout/Board/WidgetHost.js.map +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-context.js.map +1 -1
- package/dist/components/layout/Board/board-store.js +2 -2
- package/dist/components/layout/Board/board-store.js.map +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +132 -0
- package/dist/components/layout/Board/grid-core/group-move.js.map +1 -0
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.d.ts +2 -1
- package/dist/components/layout/Board/index.js +2 -2
- package/dist/components/layout/Board/index.js.map +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +17 -12
- package/dist/components/layout/Board/use-board-layout.js.map +1 -1
- package/dist/components/layout/Board/use-board-registry.js +139 -20
- package/dist/components/layout/Board/use-board-registry.js.map +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +24 -0
- package/dist/components/layout/Board/use-board-select-modifier-key.js.map +1 -0
- package/dist/components/layout/Board/use-board-selection.d.ts +8 -0
- package/dist/components/layout/Board/use-board-selection.js +113 -0
- package/dist/components/layout/Board/use-board-selection.js.map +1 -0
- 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.d.ts +9 -0
- package/dist/components/navigation/Pagination/Pagination.js +258 -0
- package/dist/components/navigation/Pagination/Pagination.js.map +1 -0
- package/dist/components/navigation/Pagination/index.d.ts +4 -0
- package/dist/components/navigation/Pagination/types.d.ts +81 -0
- package/dist/components/navigation/Pagination/use-pagination.d.ts +52 -0
- package/dist/components/navigation/Pagination/use-pagination.js +83 -0
- package/dist/components/navigation/Pagination/use-pagination.js.map +1 -0
- 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/navigation/index.d.ts +5 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +24 -8
- package/dist/components/shared/DraggableCollection.js.map +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 +227 -5
- 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 +44 -1
- package/dist/i18n/locales/en-US/uikit.js +44 -1
- package/dist/i18n/locales/en-US/uikit.json.d.ts +49 -1
- package/dist/i18n/locales/es-ES/uikit.js +44 -1
- package/dist/i18n/locales/es-MX/uikit.js +44 -1
- package/dist/i18n/locales/fr-FR/uikit.js +44 -1
- package/dist/i18n/locales/it-IT/uikit.js +44 -1
- package/dist/i18n/locales/ja-JP/uikit.js +44 -1
- package/dist/i18n/locales/nb-NO/uikit.js +44 -1
- package/dist/i18n/locales/pt-BR/uikit.js +44 -1
- package/dist/i18n/locales/pt-PT/uikit.js +44 -1
- package/dist/i18n/locales/sv-SE/uikit.js +44 -1
- package/dist/i18n/locales/vi-VN/uikit.js +44 -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/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.d.ts +12 -0
- package/dist/icons/PipetteIcon.js +11 -0
- package/dist/icons/PipetteIcon.js.map +1 -0
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +31 -12
- package/dist/index.js +24 -11
- package/dist/index.js.map +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.d.ts +1 -1
- package/dist/tokens/typography.js +11 -2
- package/dist/tokens/typography.js.map +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.d.ts +1 -0
- package/dist/utils/react/index.js +2 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.d.ts +56 -0
- package/dist/utils/react/useBufferedValue.js +86 -0
- package/dist/utils/react/useBufferedValue.js.map +1 -0
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/actions/ButtonGroup.md +1 -1
- package/docs/components/data/DataTable.md +298 -0
- package/docs/components/data/ItemTable.md +984 -0
- package/docs/components/fields/ColorInput.md +284 -0
- package/docs/components/fields/ColorPicker.md +212 -0
- package/docs/components/fields/ColorSwatchGroup.md +206 -0
- package/docs/components/fields/FilterPicker.md +1 -1
- package/docs/components/fields/ListBox.md +4 -0
- package/docs/components/fields/PasswordInput.md +1 -0
- package/docs/components/fields/Picker.md +1 -1
- package/docs/components/fields/SearchInput.md +1 -0
- package/docs/components/fields/TextArea.md +1 -0
- package/docs/components/fields/TextInput.md +1 -0
- package/docs/components/layout/Board.md +154 -6
- package/docs/components/navigation/Pagination.md +245 -0
- package/package.json +8 -3
- package/dist/components/organisms/FileTabs/FileTabs.d.ts +0 -54
- package/dist/components/organisms/FileTabs/FileTabs.js +0 -282
- package/dist/components/organisms/FileTabs/FileTabs.js.map +0 -1
- package/docs/components/organisms/FileTabs.md +0 -51
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.157.0 | Cube Dev Team */
|
|
2
|
+
//#region src/components/data/TableBase/RowCollection.ts
|
|
3
|
+
/**
|
|
4
|
+
* A `Collection<Node<T>>` over a plain row array.
|
|
5
|
+
*
|
|
6
|
+
* React Aria's selection primitives — `SelectionManager`, `useSelectableItem`,
|
|
7
|
+
* `useSelectableCollection` — need a collection, but the only thing they ask of
|
|
8
|
+
* it is key order and lookup. `useTableState` would build a `Node` per header
|
|
9
|
+
* row, per column, per body row *and per cell*, which a table whose page size
|
|
10
|
+
* goes to 500 (and whose "Load all results" removes the cap entirely) cannot
|
|
11
|
+
* afford.
|
|
12
|
+
*
|
|
13
|
+
* So the array is the collection. Nodes are built lazily on `getItem` and
|
|
14
|
+
* memoized, which means a 100k-row table allocates nodes only for the handful
|
|
15
|
+
* of keys selection actually touches.
|
|
16
|
+
*/
|
|
17
|
+
var RowCollection = class {
|
|
18
|
+
rows;
|
|
19
|
+
keys;
|
|
20
|
+
indexByKey;
|
|
21
|
+
nodeCache = /* @__PURE__ */ new Map();
|
|
22
|
+
disabledKeys;
|
|
23
|
+
constructor(rows, getKey, disabledKeys = /* @__PURE__ */ new Set()) {
|
|
24
|
+
this.rows = rows;
|
|
25
|
+
this.keys = rows.map(getKey);
|
|
26
|
+
this.disabledKeys = disabledKeys;
|
|
27
|
+
this.indexByKey = /* @__PURE__ */ new Map();
|
|
28
|
+
this.keys.forEach((key, index) => {
|
|
29
|
+
if (!this.indexByKey.has(key)) this.indexByKey.set(key, index);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
get size() {
|
|
33
|
+
return this.rows.length;
|
|
34
|
+
}
|
|
35
|
+
getKeys() {
|
|
36
|
+
return this.keys;
|
|
37
|
+
}
|
|
38
|
+
getItem(key) {
|
|
39
|
+
const index = this.indexByKey.get(key);
|
|
40
|
+
if (index == null) return null;
|
|
41
|
+
const cached = this.nodeCache.get(key);
|
|
42
|
+
if (cached) return cached;
|
|
43
|
+
const node = {
|
|
44
|
+
type: "item",
|
|
45
|
+
key,
|
|
46
|
+
value: this.rows[index],
|
|
47
|
+
level: 0,
|
|
48
|
+
hasChildNodes: false,
|
|
49
|
+
childNodes: [],
|
|
50
|
+
rendered: null,
|
|
51
|
+
textValue: "",
|
|
52
|
+
index,
|
|
53
|
+
"aria-label": void 0,
|
|
54
|
+
parentKey: null,
|
|
55
|
+
prevKey: index > 0 ? this.keys[index - 1] : null,
|
|
56
|
+
nextKey: index < this.keys.length - 1 ? this.keys[index + 1] : null
|
|
57
|
+
};
|
|
58
|
+
this.nodeCache.set(key, node);
|
|
59
|
+
return node;
|
|
60
|
+
}
|
|
61
|
+
at(index) {
|
|
62
|
+
const key = this.keys[index];
|
|
63
|
+
return key == null ? null : this.getItem(key);
|
|
64
|
+
}
|
|
65
|
+
getKeyBefore(key) {
|
|
66
|
+
const index = this.indexByKey.get(key);
|
|
67
|
+
return index == null || index === 0 ? null : this.keys[index - 1];
|
|
68
|
+
}
|
|
69
|
+
getKeyAfter(key) {
|
|
70
|
+
const index = this.indexByKey.get(key);
|
|
71
|
+
return index == null || index >= this.keys.length - 1 ? null : this.keys[index + 1];
|
|
72
|
+
}
|
|
73
|
+
getFirstKey() {
|
|
74
|
+
return this.keys[0] ?? null;
|
|
75
|
+
}
|
|
76
|
+
getLastKey() {
|
|
77
|
+
return this.keys[this.keys.length - 1] ?? null;
|
|
78
|
+
}
|
|
79
|
+
getChildren() {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
/** Not part of `Collection`, but selection asks about it constantly. */
|
|
83
|
+
isDisabled(key) {
|
|
84
|
+
return this.disabledKeys.has(key);
|
|
85
|
+
}
|
|
86
|
+
indexOf(key) {
|
|
87
|
+
return this.indexByKey.get(key) ?? -1;
|
|
88
|
+
}
|
|
89
|
+
*[Symbol.iterator]() {
|
|
90
|
+
for (const key of this.keys) {
|
|
91
|
+
const node = this.getItem(key);
|
|
92
|
+
if (node) yield node;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
export { RowCollection };
|
|
99
|
+
//# sourceMappingURL=RowCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowCollection.js","names":[],"sources":["../../../../src/components/data/TableBase/RowCollection.ts"],"sourcesContent":["import type { Collection, Key, Node } from '@react-types/shared';\n\n/**\n * A `Collection<Node<T>>` over a plain row array.\n *\n * React Aria's selection primitives — `SelectionManager`, `useSelectableItem`,\n * `useSelectableCollection` — need a collection, but the only thing they ask of\n * it is key order and lookup. `useTableState` would build a `Node` per header\n * row, per column, per body row *and per cell*, which a table whose page size\n * goes to 500 (and whose \"Load all results\" removes the cap entirely) cannot\n * afford.\n *\n * So the array is the collection. Nodes are built lazily on `getItem` and\n * memoized, which means a 100k-row table allocates nodes only for the handful\n * of keys selection actually touches.\n */\nexport class RowCollection<T> implements Collection<Node<T>> {\n private rows: readonly T[];\n private keys: Key[];\n private indexByKey: Map<Key, number>;\n private nodeCache = new Map<Key, Node<T>>();\n private disabledKeys: Set<Key>;\n\n constructor(\n rows: readonly T[],\n getKey: (row: T, index: number) => Key,\n disabledKeys: Set<Key> = new Set(),\n ) {\n this.rows = rows;\n this.keys = rows.map(getKey);\n this.disabledKeys = disabledKeys;\n this.indexByKey = new Map();\n\n // A duplicate key would make selection ambiguous — two rows would answer to\n // the same identity. First occurrence wins, matching how React resolves a\n // duplicated `key`.\n this.keys.forEach((key, index) => {\n if (!this.indexByKey.has(key)) this.indexByKey.set(key, index);\n });\n }\n\n get size() {\n return this.rows.length;\n }\n\n getKeys() {\n return this.keys;\n }\n\n getItem(key: Key): Node<T> | null {\n const index = this.indexByKey.get(key);\n\n if (index == null) return null;\n\n const cached = this.nodeCache.get(key);\n\n if (cached) return cached;\n\n const node: Node<T> = {\n type: 'item',\n key,\n value: this.rows[index],\n level: 0,\n hasChildNodes: false,\n childNodes: [],\n rendered: null,\n textValue: '',\n index,\n // `SelectionManager` reads this to decide whether a key can be selected\n // at all, before `disabledBehavior` is even considered.\n 'aria-label': undefined,\n parentKey: null,\n prevKey: index > 0 ? this.keys[index - 1] : null,\n nextKey: index < this.keys.length - 1 ? this.keys[index + 1] : null,\n } as Node<T>;\n\n this.nodeCache.set(key, node);\n\n return node;\n }\n\n at(index: number): Node<T> | null {\n const key = this.keys[index];\n\n return key == null ? null : this.getItem(key);\n }\n\n getKeyBefore(key: Key): Key | null {\n const index = this.indexByKey.get(key);\n\n return index == null || index === 0 ? null : this.keys[index - 1];\n }\n\n getKeyAfter(key: Key): Key | null {\n const index = this.indexByKey.get(key);\n\n return index == null || index >= this.keys.length - 1\n ? null\n : this.keys[index + 1];\n }\n\n getFirstKey(): Key | null {\n return this.keys[0] ?? null;\n }\n\n getLastKey(): Key | null {\n return this.keys[this.keys.length - 1] ?? null;\n }\n\n getChildren(): Iterable<Node<T>> {\n return [];\n }\n\n /** Not part of `Collection`, but selection asks about it constantly. */\n isDisabled(key: Key) {\n return this.disabledKeys.has(key);\n }\n\n indexOf(key: Key): number {\n return this.indexByKey.get(key) ?? -1;\n }\n\n *[Symbol.iterator](): Iterator<Node<T>> {\n for (const key of this.keys) {\n const node = this.getItem(key);\n\n if (node) yield node;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAa,gBAAb,MAA6D;CAC3D,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ,4BAAY,IAAI,KAAmB;CAC3C,AAAQ;CAER,YACE,MACA,QACA,+BAAyB,IAAI,KAAK,EAClC;AACA,OAAK,OAAO;AACZ,OAAK,OAAO,KAAK,IAAI,OAAO;AAC5B,OAAK,eAAe;AACpB,OAAK,6BAAa,IAAI,KAAK;AAK3B,OAAK,KAAK,SAAS,KAAK,UAAU;AAChC,OAAI,CAAC,KAAK,WAAW,IAAI,IAAI,CAAE,MAAK,WAAW,IAAI,KAAK,MAAM;IAC9D;;CAGJ,IAAI,OAAO;AACT,SAAO,KAAK,KAAK;;CAGnB,UAAU;AACR,SAAO,KAAK;;CAGd,QAAQ,KAA0B;EAChC,MAAM,QAAQ,KAAK,WAAW,IAAI,IAAI;AAEtC,MAAI,SAAS,KAAM,QAAO;EAE1B,MAAM,SAAS,KAAK,UAAU,IAAI,IAAI;AAEtC,MAAI,OAAQ,QAAO;EAEnB,MAAM,OAAgB;GACpB,MAAM;GACN;GACA,OAAO,KAAK,KAAK;GACjB,OAAO;GACP,eAAe;GACf,YAAY,EAAE;GACd,UAAU;GACV,WAAW;GACX;GAGA,cAAc;GACd,WAAW;GACX,SAAS,QAAQ,IAAI,KAAK,KAAK,QAAQ,KAAK;GAC5C,SAAS,QAAQ,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,KAAK;GAChE;AAED,OAAK,UAAU,IAAI,KAAK,KAAK;AAE7B,SAAO;;CAGT,GAAG,OAA+B;EAChC,MAAM,MAAM,KAAK,KAAK;AAEtB,SAAO,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI;;CAG/C,aAAa,KAAsB;EACjC,MAAM,QAAQ,KAAK,WAAW,IAAI,IAAI;AAEtC,SAAO,SAAS,QAAQ,UAAU,IAAI,OAAO,KAAK,KAAK,QAAQ;;CAGjE,YAAY,KAAsB;EAChC,MAAM,QAAQ,KAAK,WAAW,IAAI,IAAI;AAEtC,SAAO,SAAS,QAAQ,SAAS,KAAK,KAAK,SAAS,IAChD,OACA,KAAK,KAAK,QAAQ;;CAGxB,cAA0B;AACxB,SAAO,KAAK,KAAK,MAAM;;CAGzB,aAAyB;AACvB,SAAO,KAAK,KAAK,KAAK,KAAK,SAAS,MAAM;;CAG5C,cAAiC;AAC/B,SAAO,EAAE;;;CAIX,WAAW,KAAU;AACnB,SAAO,KAAK,aAAa,IAAI,IAAI;;CAGnC,QAAQ,KAAkB;AACxB,SAAO,KAAK,WAAW,IAAI,IAAI,IAAI;;CAGrC,EAAE,OAAO,YAA+B;AACtC,OAAK,MAAM,OAAO,KAAK,MAAM;GAC3B,MAAM,OAAO,KAAK,QAAQ,IAAI;AAE9B,OAAI,KAAM,OAAM"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.157.0 | Cube Dev Team */
|
|
2
|
+
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useDraggableItem, useDropIndicator } from "react-aria";
|
|
6
|
+
|
|
7
|
+
//#region src/components/data/TableBase/TableRow.tsx
|
|
8
|
+
function Row(props) {
|
|
9
|
+
const { rowProps, height, measureRef, index, extra, children } = props;
|
|
10
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
11
|
+
...rowProps,
|
|
12
|
+
...extra,
|
|
13
|
+
ref: measureRef,
|
|
14
|
+
"data-index": index,
|
|
15
|
+
style: height != null ? { height } : void 0,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A row inside a collection that accepts drags.
|
|
21
|
+
*
|
|
22
|
+
* Split from the plain row so the drag hooks can be called unconditionally —
|
|
23
|
+
* they are hooks, and whether a table is draggable is a prop.
|
|
24
|
+
*/
|
|
25
|
+
function DraggableRow(props) {
|
|
26
|
+
const { rowKey, dragState, dropState } = props;
|
|
27
|
+
const dragResult = useDraggableItem({ key: rowKey }, dragState);
|
|
28
|
+
/**
|
|
29
|
+
* Whether a drop would land *on* this row.
|
|
30
|
+
*
|
|
31
|
+
* `useDropIndicator` rather than asking `dropState.isDropTarget` directly:
|
|
32
|
+
* the state object's identity never changes as the pointer moves, so a plain
|
|
33
|
+
* read is computed once and never updates. The hook subscribes, which is what
|
|
34
|
+
* makes the highlight follow the cursor.
|
|
35
|
+
*/
|
|
36
|
+
const onRef = useRef(null);
|
|
37
|
+
const { isDropTarget: isOnTarget } = useDropIndicator({ target: {
|
|
38
|
+
type: "item",
|
|
39
|
+
key: rowKey,
|
|
40
|
+
dropPosition: "on"
|
|
41
|
+
} }, dropState, onRef);
|
|
42
|
+
return /* @__PURE__ */ jsx(Row, {
|
|
43
|
+
...props,
|
|
44
|
+
extra: {
|
|
45
|
+
...mergeProps$1(props.rowProps, dragResult.dragProps),
|
|
46
|
+
"data-draggable": "",
|
|
47
|
+
"data-dragging": dragResult.isDragging ? "" : void 0,
|
|
48
|
+
"data-drop-target": isOnTarget ? "" : void 0
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function TableRow(props) {
|
|
53
|
+
return props.dragState && props.dropState ? /* @__PURE__ */ jsx(DraggableRow, { ...props }) : /* @__PURE__ */ jsx(Row, { ...props });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The line showing where a dragged row would land.
|
|
57
|
+
*
|
|
58
|
+
* Its own `<tr>`, because a native table cannot hold an arbitrary element
|
|
59
|
+
* between two rows — the same shape `ListBox` uses with `<li>`. It renders
|
|
60
|
+
* nothing at all unless a drag is in flight, so the table's normal structure is
|
|
61
|
+
* untouched the rest of the time.
|
|
62
|
+
*/
|
|
63
|
+
function TableRowDropIndicator(props) {
|
|
64
|
+
const { rowKey, dropPosition, dropState, columnCount } = props;
|
|
65
|
+
const ref = useRef(null);
|
|
66
|
+
const { dropIndicatorProps, isHidden, isDropTarget } = useDropIndicator({ target: {
|
|
67
|
+
type: "item",
|
|
68
|
+
key: rowKey,
|
|
69
|
+
dropPosition
|
|
70
|
+
} }, dropState, ref);
|
|
71
|
+
if (isHidden) return null;
|
|
72
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
73
|
+
"data-element": "DropIndicatorRow",
|
|
74
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
75
|
+
"data-element": "DropIndicatorCell",
|
|
76
|
+
colSpan: Math.max(columnCount, 1),
|
|
77
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
78
|
+
...dropIndicatorProps,
|
|
79
|
+
ref,
|
|
80
|
+
"data-element": "DropIndicator",
|
|
81
|
+
"data-drop-target": isDropTarget ? "" : void 0
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
export { TableRow, TableRowDropIndicator };
|
|
89
|
+
//# sourceMappingURL=TableRow.js.map
|
|
@@ -0,0 +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 & { extra?: Record<string, any> }) {\n const { rowProps, height, measureRef, index, extra, children } = props;\n\n return (\n <tr\n {...rowProps}\n {...extra}\n ref={measureRef}\n data-index={index}\n style={height != null ? { height } : undefined}\n >\n {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\nexport function TableRow(props: TableRowProps) {\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":";;;;;;;AAyBA,SAAS,IAAI,OAAwD;CACnE,MAAM,EAAE,UAAU,QAAQ,YAAY,OAAO,OAAO,aAAa;AAEjE,QACE,oBAAC;EACC,GAAI;EACJ,GAAI;EACJ,KAAK;EACL,cAAY;EACZ,OAAO,UAAU,OAAO,EAAE,QAAQ,GAAG;EAEpC;GACE;;;;;;;;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,SAAgB,SAAS,OAAsB;AAC7C,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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import "./types.js";
|
|
3
|
+
import "./use-cell-selection.js";
|
|
4
|
+
import "./use-table-selection.js";
|
|
5
|
+
import { Styles } from "@tenphi/tasty";
|
|
6
|
+
import { ReactNode, RefObject } from "react";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import { Key as Key$1 } from "@react-types/shared";
|
|
9
|
+
|
|
10
|
+
//#region src/components/data/TableBase/TableView.d.ts
|
|
11
|
+
/** Visual/behavioural overrides a table adapter may attach to a single row. */
|
|
12
|
+
interface CubeTableRowRenderProps {
|
|
13
|
+
isDimmed?: boolean;
|
|
14
|
+
mods?: Record<string, boolean | undefined>;
|
|
15
|
+
styles?: Styles;
|
|
16
|
+
height?: number;
|
|
17
|
+
qa?: string;
|
|
18
|
+
tooltip?: string;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { CubeTableRowRenderProps };
|
|
22
|
+
//# sourceMappingURL=TableView.d.ts.map
|