@qualtrics/ui-react 2.79.0 → 2.80.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/CHANGELOG.md +21 -0
- package/dist/__node_modules/@radix-ui/primitive/dist/index.js +5 -6
- package/dist/__node_modules/@radix-ui/react-arrow/dist/index.js +8 -7
- package/dist/__node_modules/@radix-ui/react-collection/dist/index.js +71 -63
- package/dist/__node_modules/@radix-ui/react-context/dist/index.js +10 -14
- package/dist/__node_modules/@radix-ui/react-direction/dist/index.js +2 -4
- package/dist/__node_modules/@radix-ui/react-dismissable-layer/dist/index.js +22 -15
- package/dist/__node_modules/@radix-ui/react-dropdown-menu/dist/index.js +89 -89
- package/dist/__node_modules/@radix-ui/react-focus-scope/dist/index.js +26 -19
- package/dist/__node_modules/@radix-ui/react-id/dist/index.js +5 -2
- package/dist/__node_modules/@radix-ui/react-menu/dist/index.js +165 -129
- package/dist/__node_modules/@radix-ui/react-popper/dist/index.js +139 -106
- package/dist/__node_modules/@radix-ui/react-portal/dist/index.js +9 -5
- package/dist/__node_modules/@radix-ui/react-presence/dist/index.js +27 -20
- package/dist/__node_modules/@radix-ui/react-primitive/dist/index.js +4 -5
- package/dist/__node_modules/@radix-ui/react-roving-focus/dist/index.js +61 -38
- package/dist/__node_modules/@radix-ui/react-slot/dist/index.js +8 -12
- package/dist/__node_modules/@radix-ui/react-use-controllable-state/dist/index.js +40 -35
- package/dist/__node_modules/@radix-ui/react-use-size/dist/index.js +5 -2
- package/dist/__shared/cjs/{index-7181e053.js → index-807921ca.js} +2830 -2635
- package/dist/__shared/cjs/{index-b77d5870.js → index-8c77a9ef.js} +15 -9
- package/dist/components/Accordion/Accordion.js +27 -21
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionContext.js +6 -8
- package/dist/components/Accordion/AccordionHeader.js +13 -17
- package/dist/components/Accordion/AccordionPanel.js +7 -11
- package/dist/components/Accordion/AccordionSection.js +14 -11
- package/dist/components/Banner/Banner.js +10 -11
- package/dist/components/Banner/BannerBody.js +1 -3
- package/dist/components/Banner/BannerFooter.js +1 -3
- package/dist/components/Banner/BannerTitle.js +1 -3
- package/dist/components/BreakpointSwitch/Breakpoint.js +2 -5
- package/dist/components/BreakpointSwitch/BreakpointContext.js +3 -4
- package/dist/components/BreakpointSwitch/BreakpointSwitch.js +1 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +19 -13
- package/dist/components/ButtonGroup/ButtonGroup.js +7 -7
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Check.js +8 -6
- package/dist/components/Checkbox/Checkbox.js +31 -28
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/CheckboxField.js +14 -13
- package/dist/components/ColorPicker/Alpha.js +8 -12
- package/dist/components/ColorPicker/ColorPicker.js +67 -48
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +23 -24
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +27 -22
- package/dist/components/ColorPicker/ColorPickerWIthNoColor.js +11 -7
- package/dist/components/ColorPicker/Hue.js +9 -13
- package/dist/components/ColorPicker/Palette.js +23 -21
- package/dist/components/ColorPicker/Saturation.js +11 -15
- package/dist/components/ColorPicker/utils/hexToHsv.js +4 -5
- package/dist/components/ColorPicker/utils/hsvToHex.js +3 -5
- package/dist/components/ColorPicker/utils/rgbToHex.js +3 -5
- package/dist/components/Combobox/Combobox.js +166 -133
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxContext.js +3 -4
- package/dist/components/Combobox/ComboboxHeader.js +6 -6
- package/dist/components/Combobox/ComboboxIcon.js +14 -14
- package/dist/components/Combobox/ComboboxInput.js +41 -43
- package/dist/components/Combobox/ComboboxList.js +20 -20
- package/dist/components/Combobox/ComboboxOption.js +9 -10
- package/dist/components/ConfigPane/ConfigPane.js +53 -37
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider.js +4 -4
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/index.js +7 -9
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +18 -21
- package/dist/components/Dropdown/Dropdown.js +68 -43
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +53 -47
- package/dist/components/Dropdown/DropdownContext.js +3 -4
- package/dist/components/Dropdown/DropdownHeader.js +12 -9
- package/dist/components/Dropdown/DropdownHeaderContext.js +3 -4
- package/dist/components/Dropdown/DropdownList.js +32 -32
- package/dist/components/Dropdown/DropdownOption.js +32 -30
- package/dist/components/Dropdown/DropdownSearch.js +12 -14
- package/dist/components/FilePicker/FilePicker.js +30 -25
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/ErrorText.js +5 -5
- package/dist/components/FormField/FormField.js +27 -14
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +6 -13
- package/dist/components/FormField/HelperText.js +5 -5
- package/dist/components/FormField/ReadOnlyText.js +4 -6
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +22 -15
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +6 -5
- package/dist/components/Icon/IconTypes.js +1 -0
- package/dist/components/IconButton/IconButton.js +25 -16
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +25 -14
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +42 -29
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +26 -21
- package/dist/components/InputGroup/InputGroup.js +7 -7
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/InputGroup/InputGroupAddon.js +7 -6
- package/dist/components/InputGroup/InputGroupProvider.js +5 -8
- package/dist/components/Label/Label.js +8 -9
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link.js +9 -7
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +22 -17
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionContainer.js +8 -10
- package/dist/components/LogicEditor/ConditionSet.js +16 -21
- package/dist/components/LogicEditor/Controls.js +17 -20
- package/dist/components/LogicEditor/LogicEditor.js +33 -24
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/LogicEditorContext.js +3 -4
- package/dist/components/LogicEditor/utils.js +5 -9
- package/dist/components/Modal/Modal.js +63 -49
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/Modal/ModalBody.js +5 -5
- package/dist/components/Modal/ModalContext.js +3 -4
- package/dist/components/Modal/ModalFooter.js +5 -5
- package/dist/components/Modal/ModalHeader.js +10 -12
- package/dist/components/NewMenu/BaseMenu.js +83 -54
- package/dist/components/NewMenu/Menu/Menu.js +10 -12
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +6 -7
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +35 -30
- package/dist/components/NewMenu/parts/MenuAnchor.js +15 -16
- package/dist/components/NewMenu/parts/MenuContext.js +3 -4
- package/dist/components/NewMenu/parts/MenuItem.js +23 -17
- package/dist/components/NewMenu/parts/MenuSearchBox.js +4 -6
- package/dist/components/NewMenu/parts/SubmenuAnchor.js +5 -5
- package/dist/components/NumberStepper/NumberStepper.js +42 -37
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperContext.js +3 -4
- package/dist/components/NumberStepper/NumberStepperDecrement.js +13 -15
- package/dist/components/NumberStepper/NumberStepperIncrement.js +13 -15
- package/dist/components/NumberStepper/NumberStepperInput.js +28 -30
- package/dist/components/PageLayout/MainContent.js +4 -4
- package/dist/components/PageLayout/PageContainer.js +4 -4
- package/dist/components/PageLayout/PageHeader.js +4 -4
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +20 -16
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationContext.js +3 -4
- package/dist/components/Pagination/PaginationNextButton.js +15 -17
- package/dist/components/Pagination/PaginationPageInput.js +24 -24
- package/dist/components/Pagination/PaginationPreviousButton.js +14 -16
- package/dist/components/Popover/Popover.js +27 -18
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +23 -16
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +33 -23
- package/dist/components/Radio/Radio.js +26 -28
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/Radio/RadioGroup.js +15 -16
- package/dist/components/Radio/RadioGroupContext.js +3 -4
- package/dist/components/Radio/RadioOption.js +11 -10
- package/dist/components/SearchInput/SearchInput.js +32 -25
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/ExpandCollapseButton.js +4 -6
- package/dist/components/SidebarNav/SidebarNav.js +19 -13
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavContext.js +3 -4
- package/dist/components/SidebarNav/SidebarNavLink.js +7 -10
- package/dist/components/Slider/RangeSlider.js +36 -24
- package/dist/components/Slider/Slider.js +29 -20
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +26 -17
- package/dist/components/Switch/Switch.js +19 -19
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Switch/SwitchField.js +13 -13
- package/dist/components/Table/Table.js +5 -5
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Table/TableBody.js +5 -5
- package/dist/components/Table/TableCell.js +5 -5
- package/dist/components/Table/TableHead.js +5 -5
- package/dist/components/Table/TableHeaderCell.js +5 -5
- package/dist/components/Table/TableRow.js +5 -5
- package/dist/components/Tabs/Tab.js +12 -13
- package/dist/components/Tabs/TabContextProvider.js +10 -13
- package/dist/components/Tabs/TabList.js +17 -13
- package/dist/components/Tabs/TabPanel.js +10 -11
- package/dist/components/Tabs/TabPanels.js +1 -3
- package/dist/components/Tabs/Tabs.js +20 -12
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +51 -29
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/A11yHelpersContext.js +3 -9
- package/dist/components/UIProvider/PortalTargetContext.js +6 -8
- package/dist/components/UIProvider/UIProvider.js +4 -5
- package/dist/components/deprecated_ColorPicker/Alpha.js +7 -7
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +24 -13
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +16 -9
- package/dist/components/deprecated_ColorPicker/Hue.js +6 -6
- package/dist/components/deprecated_ColorPicker/Saturation.js +14 -16
- package/dist/components/deprecated_ColorPicker/Swatch.js +7 -6
- package/dist/components/deprecated_ColorPicker/useMouseDrag.js +5 -1
- package/dist/components/deprecated_NumberStepper/NumberStepper.js +34 -25
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperContext.js +3 -4
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +14 -16
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +14 -16
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +32 -34
- package/dist/components/deprecated_Tabs/Tab.js +8 -9
- package/dist/components/deprecated_Tabs/TabContextProvider.js +3 -4
- package/dist/components/deprecated_Tabs/Tabs.js +13 -9
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/IconButtonWithLabel.js +6 -6
- package/dist/components/deprecated_Toolbar/Toolbar.js +16 -11
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarContext.js +3 -4
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +16 -16
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +44 -29
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +19 -20
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +34 -24
- package/dist/design-tokens/less/typography.js +3 -3
- package/dist/hooks/useBreakpoints/useBreakpoints.js +12 -4
- package/dist/hooks/useClickOutside/useClickOutside.js +1 -3
- package/dist/hooks/useClickOutsidePortals/useClickOutsidePortals.js +3 -3
- package/dist/hooks/useControllableState/useControllableState.js +5 -2
- package/dist/hooks/useEventListener/useEventListener.js +6 -5
- package/dist/hooks/useFocusSequence/useFocusSequence.js +12 -12
- package/dist/hooks/useId/useId.js +4 -1
- package/dist/hooks/useIsFocused/useIsFocused.js +5 -1
- package/dist/hooks/useIsHovered/useIsHovered.js +5 -1
- package/dist/hooks/useIsTruncated/useIsTruncated.js +11 -16
- package/dist/hooks/useMouseDrag/useMouseDrag.js +5 -1
- package/dist/hooks/useOverlay/useOverlay.js +10 -10
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +9 -2
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/FrontlineEmployeeVoiceIcon.js +6 -0
- package/dist/icons/createIconComponent.js +7 -6
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.es.js +1 -0
- package/dist/icons/index.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1 -1
- package/dist/index.js +7 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +192 -173
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +30 -25
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +12 -15
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +83 -65
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +25 -30
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaders.js +10 -9
- package/dist/next/AdvancedTable/AdvancedTableDnDContext.js +12 -10
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +4 -7
- package/dist/next/AdvancedTable/AdvancedTableHiddenDescription.js +4 -7
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +9 -13
- package/dist/next/AdvancedTable/AdvancedTableRow.js +16 -16
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +7 -11
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +32 -36
- package/dist/next/AdvancedTable/useDragAndDropConfig.js +44 -53
- package/dist/next/Chat/Chat.js +5 -6
- package/dist/next/Chat/ChatContext.js +3 -4
- package/dist/next/Chat/ChatInput.js +24 -20
- package/dist/next/Chat/ChatMessage.js +16 -20
- package/dist/next/Chat/ChatMessageList.js +11 -10
- package/dist/next/Chat/ChatMessageText.js +1 -3
- package/dist/next/Chat/Loader.js +6 -9
- package/dist/next/Chat/MessageContext.js +3 -4
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +28 -18
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +8 -8
- package/dist/next/CollectionGrid/CollectionGrid.js +14 -12
- package/dist/next/CollectionGrid/CollectionGridItem.js +4 -5
- package/dist/next/Combobox/Combobox.js +48 -37
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxContext.js +3 -4
- package/dist/next/Combobox/ComboboxFlyout.js +12 -15
- package/dist/next/Combobox/ComboboxGroup.js +10 -14
- package/dist/next/Combobox/ComboboxGroupContext.js +9 -10
- package/dist/next/Combobox/ComboboxInput.js +37 -39
- package/dist/next/Combobox/ComboboxOption.js +15 -19
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +9 -4
- package/dist/next/Combobox/hooks/useComboboxLoadingState/useComboboxLoadingState.js +2 -3
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +10 -5
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +12 -5
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +5 -1
- package/dist/next/Drawer/Drawer.js +38 -23
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +21 -19
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/FormFieldWrapper.js +11 -11
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Form/useForm.js +25 -30
- package/dist/next/Form/useFormField.js +3 -4
- package/dist/next/Form/utils/createFormInstance.js +7 -9
- package/dist/next/Form/utils/useFormContext.js +3 -4
- package/dist/next/Indicator/Indicator.js +12 -8
- package/dist/next/Indicator/Indicator2.js +3 -3
- package/dist/next/Input/Input.js +49 -35
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/LayoutGrid/LayoutGrid.js +11 -12
- package/dist/next/LayoutGrid/LayoutGridItem.js +5 -6
- package/dist/next/LoadingSpinner/LoadingSpinner.js +22 -17
- package/dist/next/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/next/Menu/Hooks/useFocusVirtualBoundary.js +7 -4
- package/dist/next/Menu/Hooks/useMaskDimensions.js +6 -7
- package/dist/next/Menu/Hooks/usePaneSearch.js +50 -39
- package/dist/next/Menu/Menu.js +28 -15
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +17 -18
- package/dist/next/Menu/MenuContext.js +13 -18
- package/dist/next/Menu/MenuItem.js +28 -29
- package/dist/next/Menu/MenuPane.js +74 -61
- package/dist/next/Menu/MenuSearch.js +10 -10
- package/dist/next/Menu/PaneChildren.js +10 -15
- package/dist/next/Menu/SubMenu.js +91 -76
- package/dist/next/Pagination/Pagination.js +40 -31
- package/dist/next/Pagination/RowDisplayCount.js +6 -7
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +49 -47
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select.js +27 -30
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/Select/SelectButton.js +16 -15
- package/dist/next/Select/SelectContext.js +3 -4
- package/dist/next/Select/SelectItem.js +12 -13
- package/dist/next/Select/SelectPane.js +13 -14
- package/dist/next/Select/SelectedItems.js +16 -10
- package/dist/next/Select/SubSelect.js +21 -18
- package/dist/next/SplitButton/SplitButton.js +28 -21
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/SplitButton/SplitButtonOption.js +3 -5
- package/dist/next/Stack/Stack.js +26 -26
- package/dist/next/Stack/StackItem.js +12 -14
- package/dist/next/TimePicker/TimeDropdown.js +18 -18
- package/dist/next/TimePicker/TimeInput.js +38 -42
- package/dist/next/TimePicker/TimePicker.js +46 -25
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +5 -7
- package/dist/next/TimePicker/utils.js +34 -13
- package/dist/next/ToggleButton/ToggleButton.js +14 -13
- package/dist/next/ToggleButton/ToggleButtonGroup.js +8 -10
- package/dist/next/ToggleButton/ToggleButtonGroupContext.js +3 -4
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/Tooltip/Tooltip.js +5 -4
- package/dist/next/Typography/Typography.js +8 -7
- package/dist/next/index.js +2377 -2193
- package/dist/utils/Flyout/Flyout.js +14 -13
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Flyout/FlyoutHeader.js +6 -6
- package/dist/utils/Flyout/FlyoutOption.js +11 -8
- package/dist/utils/GridChildrenWrapper/GridChildrenWrapper.js +4 -6
- package/dist/utils/Popper/Popper.js +71 -61
- package/dist/utils/Popper/PopperContext.js +5 -6
- package/dist/utils/Portal/Portal.js +7 -5
- package/dist/utils/Text/Text.js +10 -8
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +10 -6
- package/dist/utils/Translation/Translate.js +4 -7
- package/dist/utils/Translation/TranslationProvider.js +10 -14
- package/dist/utils/Translation/containsComponentOrElement.js +3 -1
- package/dist/utils/Translation/useTranslation.js +2 -3
- package/dist/utils/VirtuosoTestWrapper/VirtuosoTestWrapper.js +1 -3
- package/dist/utils/filterChildren/filterChildren.js +4 -4
- package/icons/package.json +1 -1
- package/next/package.json +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
4
|
import React__default, { forwardRef, useRef, useState, useCallback } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './AdvancedTable2.js';
|
|
@@ -8,34 +10,37 @@ import useComputedWidth from './useComputedWidth.js';
|
|
|
8
10
|
import { getExternalRowsWithUpdatedRow } from './AdvancedTable.js';
|
|
9
11
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
10
12
|
|
|
13
|
+
const _excluded = ["value", "renderCellContent", "isCellContentInteractive", "width", "widthBuffer", "alignment", "rowId", "columnId", "rowIndex", "columnIndex", "data-testid", "isFocused", "onKeyDown", "onFocus", "isDragging", "className", "rowPropReference", "rowsProp", "depth", "onRowsChange"];
|
|
11
14
|
const AdvancedTableCell = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
isCellContentInteractive = true,
|
|
16
|
-
width,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
alignment = Alignments.Left,
|
|
20
|
-
rowId,
|
|
21
|
-
columnId,
|
|
22
|
-
rowIndex,
|
|
23
|
-
columnIndex,
|
|
24
|
-
'data-testid'
|
|
25
|
-
isFocused,
|
|
26
|
-
onKeyDown,
|
|
27
|
-
onFocus,
|
|
28
|
-
isDragging,
|
|
29
|
-
className,
|
|
30
|
-
rowPropReference,
|
|
31
|
-
rowsProp,
|
|
32
|
-
depth,
|
|
33
|
-
onRowsChange,
|
|
34
|
-
|
|
35
|
-
} = _ref;
|
|
15
|
+
let value = _ref.value,
|
|
16
|
+
renderCellContent = _ref.renderCellContent,
|
|
17
|
+
_ref$isCellContentInt = _ref.isCellContentInteractive,
|
|
18
|
+
isCellContentInteractive = _ref$isCellContentInt === void 0 ? true : _ref$isCellContentInt,
|
|
19
|
+
width = _ref.width,
|
|
20
|
+
widthBuffer = _ref.widthBuffer,
|
|
21
|
+
_ref$alignment = _ref.alignment,
|
|
22
|
+
alignment = _ref$alignment === void 0 ? Alignments.Left : _ref$alignment,
|
|
23
|
+
rowId = _ref.rowId,
|
|
24
|
+
columnId = _ref.columnId,
|
|
25
|
+
rowIndex = _ref.rowIndex,
|
|
26
|
+
columnIndex = _ref.columnIndex,
|
|
27
|
+
dataTestId = _ref['data-testid'],
|
|
28
|
+
isFocused = _ref.isFocused,
|
|
29
|
+
onKeyDown = _ref.onKeyDown,
|
|
30
|
+
onFocus = _ref.onFocus,
|
|
31
|
+
isDragging = _ref.isDragging,
|
|
32
|
+
className = _ref.className,
|
|
33
|
+
rowPropReference = _ref.rowPropReference,
|
|
34
|
+
rowsProp = _ref.rowsProp,
|
|
35
|
+
depth = _ref.depth,
|
|
36
|
+
onRowsChange = _ref.onRowsChange,
|
|
37
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
38
|
const cellRef = useRef(null);
|
|
37
39
|
const focusableElementRef = useRef(null);
|
|
38
|
-
const
|
|
40
|
+
const _useState = useState(false),
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
isEditing = _useState2[0],
|
|
43
|
+
setIsEditing = _useState2[1];
|
|
39
44
|
const isInteractive = typeof renderCellContent === 'function' && isCellContentInteractive;
|
|
40
45
|
const handleClick = isInteractive ? e => {
|
|
41
46
|
if (e.target !== e.currentTarget) {
|
|
@@ -10,21 +10,18 @@ import useScreenReaderAnnouncement from '../../hooks/useScreenReaderAnnouncement
|
|
|
10
10
|
|
|
11
11
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
12
12
|
const AdvancedTableCheckbox = _ref => {
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
variant = 'cell',
|
|
18
|
-
isRowFocused,
|
|
19
|
-
className,
|
|
20
|
-
isDisabled
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
isDragging
|
|
27
|
-
} = useAdvancedTableDnDContext();
|
|
13
|
+
let dataTestId = _ref['data-testid'],
|
|
14
|
+
state = _ref.state,
|
|
15
|
+
onClick = _ref.onClick,
|
|
16
|
+
_ref$variant = _ref.variant,
|
|
17
|
+
variant = _ref$variant === void 0 ? 'cell' : _ref$variant,
|
|
18
|
+
isRowFocused = _ref.isRowFocused,
|
|
19
|
+
className = _ref.className,
|
|
20
|
+
isDisabled = _ref.isDisabled;
|
|
21
|
+
const _useTranslation = useTranslation(),
|
|
22
|
+
translate = _useTranslation.translate;
|
|
23
|
+
const _useAdvancedTableDnDC = useAdvancedTableDnDContext(),
|
|
24
|
+
isDragging = _useAdvancedTableDnDC.isDragging;
|
|
28
25
|
const label = useMemo(() => {
|
|
29
26
|
const labels = {
|
|
30
27
|
true: translate('checked'),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
2
3
|
import React__default, { forwardRef, useRef, useState, useEffect } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import AdvancedTableColumnHeaderMenu from './AdvancedTableColumnHeaderMenu.js';
|
|
@@ -20,47 +21,48 @@ import IconButton from '../../components/IconButton/IconButton.js';
|
|
|
20
21
|
import ChevronDownIcon from '../../icons/components/ChevronDownIcon.js';
|
|
21
22
|
|
|
22
23
|
const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
headerMaxLines = 1
|
|
56
|
-
} = _ref;
|
|
24
|
+
let id = _ref.id,
|
|
25
|
+
dataTestId = _ref['data-testid'],
|
|
26
|
+
label = _ref.label,
|
|
27
|
+
width = _ref.width,
|
|
28
|
+
widthBuffer = _ref.widthBuffer,
|
|
29
|
+
onWidthChange = _ref.onWidthChange,
|
|
30
|
+
_ref$alignment = _ref.alignment,
|
|
31
|
+
alignment = _ref$alignment === void 0 ? 'left' : _ref$alignment,
|
|
32
|
+
columnIndex = _ref.columnIndex,
|
|
33
|
+
isFocused = _ref.isFocused,
|
|
34
|
+
sortOptions = _ref.sortOptions,
|
|
35
|
+
selectedSortOption = _ref.selectedSortOption,
|
|
36
|
+
setSelectedSortOption = _ref.setSelectedSortOption,
|
|
37
|
+
onKeyDown = _ref.onKeyDown,
|
|
38
|
+
onFocus = _ref.onFocus,
|
|
39
|
+
setFocusedColumnId = _ref.setFocusedColumnId,
|
|
40
|
+
minUnpinnedColumnIndex = _ref.minUnpinnedColumnIndex,
|
|
41
|
+
maxUnpinnedColumnIndex = _ref.maxUnpinnedColumnIndex,
|
|
42
|
+
disableUserPinnableColumns = _ref.disableUserPinnableColumns,
|
|
43
|
+
isPinned = _ref.isPinned,
|
|
44
|
+
setPinnedColumns = _ref.setPinnedColumns,
|
|
45
|
+
disableUserReorderableColumns = _ref.disableUserReorderableColumns,
|
|
46
|
+
setColumnOrder = _ref.setColumnOrder,
|
|
47
|
+
isDragging = _ref.isDragging,
|
|
48
|
+
setDragSource = _ref.setDragSource,
|
|
49
|
+
setDropTarget = _ref.setDropTarget,
|
|
50
|
+
dropTargetSide = _ref.dropTargetSide,
|
|
51
|
+
setDropTargetSide = _ref.setDropTargetSide,
|
|
52
|
+
tableId = _ref.tableId,
|
|
53
|
+
tableHeight = _ref.tableHeight,
|
|
54
|
+
isRowActionMenuColumn = _ref.isRowActionMenuColumn,
|
|
55
|
+
_ref$headerMaxLines = _ref.headerMaxLines,
|
|
56
|
+
headerMaxLines = _ref$headerMaxLines === void 0 ? 1 : _ref$headerMaxLines;
|
|
57
57
|
const labelRef = useRef(null);
|
|
58
|
-
const
|
|
58
|
+
const _useState = useState(),
|
|
59
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
60
|
+
ellipsisShown = _useState2[0],
|
|
61
|
+
setEllipsisShown = _useState2[1];
|
|
59
62
|
const columnHeaderRef = useRef(null);
|
|
60
63
|
const labelContainerRef = useRef(null);
|
|
61
|
-
const
|
|
62
|
-
isDragging
|
|
63
|
-
} = useAdvancedTableDnDContext();
|
|
64
|
+
const _useAdvancedTableDnDC = useAdvancedTableDnDContext(),
|
|
65
|
+
isUserDragging = _useAdvancedTableDnDC.isDragging;
|
|
64
66
|
const isSortable = Boolean(sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length);
|
|
65
67
|
const isSorted = isSortable && selectedSortOption.columnId === id && selectedSortOption.index >= 0 && selectedSortOption.index < (sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.length) && (selectedSortOption.direction === 'ascending' || selectedSortOption.direction === 'descending');
|
|
66
68
|
const selectedSortIndex = isSorted ? selectedSortOption.index : -1;
|
|
@@ -91,30 +93,41 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
91
93
|
viewBox: "0 0 10 10",
|
|
92
94
|
xmlns: "http://www.w3.org/2000/svg"
|
|
93
95
|
}, selectedSortOption.direction === 'ascending' ? arrowUpSvgContent : arrowDownSvgContent) : undefined;
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
const _useState3 = useState(false),
|
|
97
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
98
|
+
isResizing = _useState4[0],
|
|
99
|
+
setIsResizing = _useState4[1];
|
|
100
|
+
const _useState5 = useState(false),
|
|
101
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
102
|
+
isMenuOpen = _useState6[0],
|
|
103
|
+
setIsMenuOpen = _useState6[1];
|
|
104
|
+
const _useState7 = useState(false),
|
|
105
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
106
|
+
isHiddenMenuOpen = _useState8[0],
|
|
107
|
+
setIsHiddenMenuOpen = _useState8[1];
|
|
108
|
+
const _useState9 = useState(-1),
|
|
109
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
110
|
+
hiddenMenuHighlightedIndex = _useState0[0],
|
|
111
|
+
setHiddenMenuHighlightedIndex = _useState0[1];
|
|
98
112
|
const hasMenu = !isRowActionMenuColumn && (isSortable || !disableUserPinnableColumns || !disableUserReorderableColumns);
|
|
99
113
|
const hasDraggableColumns = !disableUserPinnableColumns && !disableUserReorderableColumns && !isRowActionMenuColumn;
|
|
100
|
-
const {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
114
|
+
const _useDragAndDrop = useDragAndDrop({
|
|
115
|
+
isEnabled: hasDraggableColumns,
|
|
116
|
+
id,
|
|
117
|
+
tableId,
|
|
118
|
+
columnIndex,
|
|
119
|
+
columnHeaderRef,
|
|
120
|
+
isPinned,
|
|
121
|
+
setPinnedColumns,
|
|
122
|
+
setColumnOrder,
|
|
123
|
+
setDragSource,
|
|
124
|
+
setDropTarget,
|
|
125
|
+
dropTargetSide,
|
|
126
|
+
setDropTargetSide
|
|
127
|
+
}),
|
|
128
|
+
dragRef = _useDragAndDrop.dragRef,
|
|
129
|
+
dropRef = _useDragAndDrop.dropRef,
|
|
130
|
+
listeners = _useDragAndDrop.listeners;
|
|
118
131
|
|
|
119
132
|
/**
|
|
120
133
|
* Note: Screen reader descriptions (aria-describedby) of column header keyboard shorcuts were not added due to a suboptimal
|
|
@@ -245,7 +258,10 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
245
258
|
}
|
|
246
259
|
}, [isResizing]);
|
|
247
260
|
const computedWidth = useComputedWidth(widthBuffer, width);
|
|
248
|
-
const
|
|
261
|
+
const _useState1 = useState(null),
|
|
262
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
263
|
+
focusSource = _useState10[0],
|
|
264
|
+
setFocusSource = _useState10[1];
|
|
249
265
|
const mouseDownRef = useRef(false);
|
|
250
266
|
const contentId = useId();
|
|
251
267
|
useEffect(() => {
|
|
@@ -253,10 +269,12 @@ const AdvancedTableColumnHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
253
269
|
setFocusSource(null);
|
|
254
270
|
}
|
|
255
271
|
}, [isMenuOpen, isHiddenMenuOpen]);
|
|
256
|
-
const
|
|
257
|
-
translate
|
|
258
|
-
|
|
259
|
-
|
|
272
|
+
const _useTranslation = useTranslation(),
|
|
273
|
+
translate = _useTranslation.translate;
|
|
274
|
+
const _useState11 = useState(undefined),
|
|
275
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
276
|
+
buttonAriaLabel = _useState12[0],
|
|
277
|
+
setButtonAriaLabel = _useState12[1];
|
|
260
278
|
useEffect(() => {
|
|
261
279
|
if (!labelRef.current) {
|
|
262
280
|
setButtonAriaLabel(undefined);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default from 'react';
|
|
3
4
|
import { SortDirections } from './AdvancedTableTypes.js';
|
|
4
5
|
import styles from './AdvancedTable2.js';
|
|
@@ -19,32 +20,28 @@ import Divider from '../../components/Divider/Divider.js';
|
|
|
19
20
|
import ArrowLeftIcon from '../../icons/components/ArrowLeftIcon.js';
|
|
20
21
|
import ArrowRightIcon from '../../icons/components/ArrowRightIcon.js';
|
|
21
22
|
|
|
23
|
+
const _excluded = ["sortOptions", "selectedSortOption", "setSelectedSortOption", "isPinned", "onIsPinnedChange", "onMoveLeft", "onMoveRight", "isOpen", "setIsOpen", "columnId", "columnHeaderRef", "data-testid"];
|
|
22
24
|
const AdvancedTableColumnHeaderMenu = _ref => {
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const {
|
|
39
|
-
translate
|
|
40
|
-
} = useTranslation();
|
|
25
|
+
let sortOptions = _ref.sortOptions,
|
|
26
|
+
selectedSortOption = _ref.selectedSortOption,
|
|
27
|
+
setSelectedSortOption = _ref.setSelectedSortOption,
|
|
28
|
+
isPinned = _ref.isPinned,
|
|
29
|
+
onIsPinnedChange = _ref.onIsPinnedChange,
|
|
30
|
+
onMoveLeft = _ref.onMoveLeft,
|
|
31
|
+
onMoveRight = _ref.onMoveRight,
|
|
32
|
+
isOpen = _ref.isOpen,
|
|
33
|
+
setIsOpen = _ref.setIsOpen,
|
|
34
|
+
columnId = _ref.columnId,
|
|
35
|
+
columnHeaderRef = _ref.columnHeaderRef,
|
|
36
|
+
dataTestId = _ref['data-testid'],
|
|
37
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
const _useTranslation = useTranslation(),
|
|
39
|
+
translate = _useTranslation.translate;
|
|
41
40
|
const getActionMenuItem = _ref2 => {
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
'data-testid': menuItemDataTestId
|
|
47
|
-
} = _ref2;
|
|
41
|
+
let onSelect = _ref2.onSelect,
|
|
42
|
+
Icon = _ref2.Icon,
|
|
43
|
+
label = _ref2.label,
|
|
44
|
+
menuItemDataTestId = _ref2['data-testid'];
|
|
48
45
|
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
49
46
|
onSelect: () => {
|
|
50
47
|
var _columnHeaderRef$curr;
|
|
@@ -73,12 +70,10 @@ const AdvancedTableColumnHeaderMenu = _ref => {
|
|
|
73
70
|
isOpen: isOpen,
|
|
74
71
|
onIsOpenChange: setIsOpen
|
|
75
72
|
}, rest), sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.map((_ref3, index) => {
|
|
76
|
-
let
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
descendingIcon
|
|
81
|
-
} = _ref3;
|
|
73
|
+
let ascendingLabel = _ref3.ascendingLabel,
|
|
74
|
+
ascendingIcon = _ref3.ascendingIcon,
|
|
75
|
+
descendingLabel = _ref3.descendingLabel,
|
|
76
|
+
descendingIcon = _ref3.descendingIcon;
|
|
82
77
|
const selectedSortDirection = columnId === selectedSortOption.columnId && index === selectedSortOption.index ? selectedSortOption.direction : SortDirections.None;
|
|
83
78
|
const getSortOptionMenuItem = (direction, label, Icon) => {
|
|
84
79
|
const isSelected = columnId === selectedSortOption.columnId && index === selectedSortOption.index && selectedSortDirection === direction;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { forwardRef } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './AdvancedTable2.js';
|
|
5
6
|
|
|
7
|
+
const _excluded = ["isFocusable", "isFocused", "onKeyDown", "onFocus", "children", "restrictedWidth"];
|
|
6
8
|
const AdvancedTableColumnHeaders = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
restrictedWidth = false,
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
9
|
+
let isFocusable = _ref.isFocusable,
|
|
10
|
+
isFocused = _ref.isFocused,
|
|
11
|
+
onKeyDown = _ref.onKeyDown,
|
|
12
|
+
onFocus = _ref.onFocus,
|
|
13
|
+
children = _ref.children,
|
|
14
|
+
_ref$restrictedWidth = _ref.restrictedWidth,
|
|
15
|
+
restrictedWidth = _ref$restrictedWidth === void 0 ? false : _ref$restrictedWidth,
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
16
17
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
17
18
|
role: "row",
|
|
18
19
|
tabIndex: isFocusable ? isFocused ? 0 : -1 : undefined,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { createContext, useState, useMemo, useContext } from 'react';
|
|
2
3
|
import { DndContext } from '@dnd-kit/core';
|
|
3
4
|
import useDragAndDropConfig from './useDragAndDropConfig.js';
|
|
@@ -8,16 +9,17 @@ const defaultAdvancedTableDnDContext = {
|
|
|
8
9
|
};
|
|
9
10
|
const AdvancedTableDnDContext = /*#__PURE__*/createContext(defaultAdvancedTableDnDContext);
|
|
10
11
|
const AdvancedTableDnDContextProvider = _ref => {
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
let children = _ref.children,
|
|
13
|
+
setColumnOrder = _ref.setColumnOrder,
|
|
14
|
+
setDropTargetSide = _ref.setDropTargetSide,
|
|
15
|
+
setPinnedColumns = _ref.setPinnedColumns,
|
|
16
|
+
setDropTarget = _ref.setDropTarget,
|
|
17
|
+
setDragSource = _ref.setDragSource,
|
|
18
|
+
dropTargetSide = _ref.dropTargetSide;
|
|
19
|
+
const _useState = useState(false),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
isDragging = _useState2[0],
|
|
22
|
+
setIsDragging = _useState2[1];
|
|
21
23
|
const context = useMemo(() => ({
|
|
22
24
|
isDragging,
|
|
23
25
|
setIsDragging
|
|
@@ -6,13 +6,10 @@ import Portal from '../../utils/Portal/Portal.js';
|
|
|
6
6
|
|
|
7
7
|
const AdvancedTableDragPreview = _ref => {
|
|
8
8
|
var _columnHeaderRefs$ite, _tableRef$current;
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
active
|
|
15
|
-
} = useDndContext();
|
|
9
|
+
let tableRef = _ref.tableRef,
|
|
10
|
+
columnHeaderRefs = _ref.columnHeaderRefs;
|
|
11
|
+
const _useDndContext = useDndContext(),
|
|
12
|
+
active = _useDndContext.active;
|
|
16
13
|
const item = active === null || active === void 0 ? void 0 : active.data.current;
|
|
17
14
|
const position = active === null || active === void 0 ? void 0 : active.rect.current.translated;
|
|
18
15
|
const width = (columnHeaderRefs === null || columnHeaderRefs === void 0 || (_columnHeaderRefs$ite = columnHeaderRefs[item === null || item === void 0 ? void 0 : item.columnIndex]) === null || _columnHeaderRefs$ite === void 0 || (_columnHeaderRefs$ite = _columnHeaderRefs$ite.getBoundingClientRect()) === null || _columnHeaderRefs$ite === void 0 ? void 0 : _columnHeaderRefs$ite.width) || 0;
|
|
@@ -4,13 +4,10 @@ import '../../utils/index.js';
|
|
|
4
4
|
import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
5
5
|
|
|
6
6
|
const AdvancedTableHiddenDescription = _ref => {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
translate
|
|
13
|
-
} = useTranslation();
|
|
7
|
+
let id = _ref.id,
|
|
8
|
+
messageKey = _ref.messageKey;
|
|
9
|
+
const _useTranslation = useTranslation(),
|
|
10
|
+
translate = _useTranslation.translate;
|
|
14
11
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
15
12
|
className: styles.hiddenDescription,
|
|
16
13
|
id: id
|
|
@@ -6,20 +6,16 @@ import Pagination from '../../components/Pagination/Pagination.js';
|
|
|
6
6
|
|
|
7
7
|
/* eslint-disable no-nested-ternary */
|
|
8
8
|
const AdvancedTablePagination = _ref => {
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'data-testid': dataTestId
|
|
18
|
-
} = _ref;
|
|
9
|
+
let rowsPerPage = _ref.rowsPerPage,
|
|
10
|
+
currentPage = _ref.currentPage,
|
|
11
|
+
setCurrentPage = _ref.setCurrentPage,
|
|
12
|
+
rows = _ref.rows,
|
|
13
|
+
ariaLabel = _ref.ariaLabel,
|
|
14
|
+
onPageChange = _ref.onPageChange,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
dataTestId = _ref['data-testid'];
|
|
19
17
|
const handlePageChange = _ref2 => {
|
|
20
|
-
let
|
|
21
|
-
page
|
|
22
|
-
} = _ref2;
|
|
18
|
+
let page = _ref2.page;
|
|
23
19
|
setCurrentPage(page);
|
|
24
20
|
onPageChange === null || onPageChange === void 0 || onPageChange(page);
|
|
25
21
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { forwardRef } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './AdvancedTable2.js';
|
|
5
6
|
import { useAdvancedTableDnDContext } from './AdvancedTableDnDContext.js';
|
|
6
7
|
|
|
8
|
+
const _excluded = ["data-testid", "hasOnRowSelect", "isFocusable", "isFocused", "isSelected", "onKeyDown", "onFocus", "onClick", "restrictedWidth", "children"];
|
|
7
9
|
const AdvancedTableRow = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
restrictedWidth = false,
|
|
18
|
-
children,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
isDragging
|
|
23
|
-
} = useAdvancedTableDnDContext();
|
|
10
|
+
let dataTestId = _ref['data-testid'],
|
|
11
|
+
hasOnRowSelect = _ref.hasOnRowSelect,
|
|
12
|
+
isFocusable = _ref.isFocusable,
|
|
13
|
+
isFocused = _ref.isFocused,
|
|
14
|
+
isSelected = _ref.isSelected,
|
|
15
|
+
onKeyDown = _ref.onKeyDown,
|
|
16
|
+
onFocus = _ref.onFocus,
|
|
17
|
+
onClick = _ref.onClick,
|
|
18
|
+
_ref$restrictedWidth = _ref.restrictedWidth,
|
|
19
|
+
restrictedWidth = _ref$restrictedWidth === void 0 ? false : _ref$restrictedWidth,
|
|
20
|
+
children = _ref.children,
|
|
21
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
const _useAdvancedTableDnDC = useAdvancedTableDnDContext(),
|
|
23
|
+
isDragging = _useAdvancedTableDnDC.isDragging;
|
|
24
24
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
25
25
|
role: "row",
|
|
26
26
|
"data-testid": dataTestId,
|
|
@@ -12,17 +12,13 @@ import CaretRightIcon from '../../icons/components/CaretRightIcon.js';
|
|
|
12
12
|
|
|
13
13
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
14
14
|
const AdvancedTableRowExpandButton = _ref => {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
} = useTranslation();
|
|
23
|
-
const {
|
|
24
|
-
isDragging
|
|
25
|
-
} = useAdvancedTableDnDContext();
|
|
15
|
+
let isRowExpanded = _ref.isRowExpanded,
|
|
16
|
+
onClick = _ref.onClick,
|
|
17
|
+
dataTestId = _ref['data-testid'];
|
|
18
|
+
const _useTranslation = useTranslation(),
|
|
19
|
+
translate = _useTranslation.translate;
|
|
20
|
+
const _useAdvancedTableDnDC = useAdvancedTableDnDContext(),
|
|
21
|
+
isDragging = _useAdvancedTableDnDC.isDragging;
|
|
26
22
|
const state = isRowExpanded ? 'expanded' : 'collapsed';
|
|
27
23
|
const labels = {
|
|
28
24
|
expanded: translate('advancedTable.collapseRow'),
|
|
@@ -2,44 +2,40 @@ import { useEffect } from 'react';
|
|
|
2
2
|
import { useDraggable, useDroppable } from '@dnd-kit/core';
|
|
3
3
|
|
|
4
4
|
const useDragAndDrop = _ref => {
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = _ref;
|
|
15
|
-
const {
|
|
16
|
-
setNodeRef: dragRef,
|
|
17
|
-
listeners
|
|
18
|
-
} = useDraggable({
|
|
19
|
-
id,
|
|
20
|
-
disabled: !isEnabled,
|
|
21
|
-
data: {
|
|
22
|
-
type: tableId,
|
|
23
|
-
isPinned,
|
|
24
|
-
columnIndex,
|
|
5
|
+
let isEnabled = _ref.isEnabled,
|
|
6
|
+
id = _ref.id,
|
|
7
|
+
tableId = _ref.tableId,
|
|
8
|
+
columnIndex = _ref.columnIndex,
|
|
9
|
+
columnHeaderRef = _ref.columnHeaderRef,
|
|
10
|
+
isPinned = _ref.isPinned,
|
|
11
|
+
setDropTarget = _ref.setDropTarget,
|
|
12
|
+
setDropTargetSide = _ref.setDropTargetSide;
|
|
13
|
+
const _useDraggable = useDraggable({
|
|
25
14
|
id,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
columnIndex,
|
|
15
|
+
disabled: !isEnabled,
|
|
16
|
+
data: {
|
|
17
|
+
type: tableId,
|
|
18
|
+
isPinned,
|
|
19
|
+
columnIndex,
|
|
20
|
+
id,
|
|
21
|
+
columnHeaderRef
|
|
22
|
+
}
|
|
23
|
+
}),
|
|
24
|
+
dragRef = _useDraggable.setNodeRef,
|
|
25
|
+
listeners = _useDraggable.listeners;
|
|
26
|
+
const _useDroppable = useDroppable({
|
|
39
27
|
id,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
disabled: !isEnabled,
|
|
29
|
+
data: {
|
|
30
|
+
type: tableId,
|
|
31
|
+
isPinned,
|
|
32
|
+
columnIndex,
|
|
33
|
+
id,
|
|
34
|
+
columnHeaderRef
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
isOver = _useDroppable.isOver,
|
|
38
|
+
dropRef = _useDroppable.setNodeRef;
|
|
43
39
|
|
|
44
40
|
// Clear dropTarget when header is no longer being hovered
|
|
45
41
|
useEffect(() => {
|