@carbon/react 1.83.0-rc.0 → 1.84.0-rc.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +895 -790
- package/README.md +1 -1
- package/es/components/AILabel/index.js +37 -40
- package/es/components/AISkeleton/AISkeletonIcon.js +6 -7
- package/es/components/AISkeleton/AISkeletonPlaceholder.js +6 -7
- package/es/components/AISkeleton/AISkeletonText.js +6 -7
- package/es/components/Accordion/Accordion.Skeleton.js +24 -25
- package/es/components/Accordion/Accordion.js +13 -14
- package/es/components/Accordion/AccordionItem.js +22 -23
- package/es/components/Accordion/AccordionProvider.js +6 -7
- package/es/components/AspectRatio/AspectRatio.js +9 -10
- package/es/components/BadgeIndicator/index.js +7 -8
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +9 -10
- package/es/components/Breadcrumb/Breadcrumb.js +3 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +9 -9
- package/es/components/Button/Button.Skeleton.js +10 -11
- package/es/components/Button/Button.js +5 -5
- package/es/components/Button/ButtonBase.js +27 -28
- package/es/components/ButtonSet/ButtonSet.js +2 -2
- package/es/components/ChatButton/ChatButton.Skeleton.js +7 -8
- package/es/components/ChatButton/ChatButton.js +13 -14
- package/es/components/Checkbox/Checkbox.Skeleton.js +8 -9
- package/es/components/Checkbox/Checkbox.js +33 -34
- package/es/components/CheckboxGroup/CheckboxGroup.js +28 -29
- package/es/components/ClassPrefix/index.js +6 -7
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +12 -13
- package/es/components/CodeSnippet/CodeSnippet.js +41 -42
- package/es/components/ComboBox/ComboBox.js +42 -48
- package/es/components/ComboBox/tools/filter.js +9 -12
- package/es/components/ComboButton/index.js +22 -24
- package/es/components/ComposedModal/ComposedModal.js +49 -52
- package/es/components/ComposedModal/ModalFooter.js +42 -47
- package/es/components/ComposedModal/ModalHeader.js +21 -22
- package/es/components/ContainedList/ContainedList.js +17 -18
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +16 -17
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +17 -29
- package/es/components/ContentSwitcher/ContentSwitcher.js +100 -126
- package/es/components/ContentSwitcher/index.d.ts +3 -4
- package/es/components/ContextMenu/useContextMenu.js +1 -2
- package/es/components/Copy/Copy.js +13 -14
- package/es/components/CopyButton/CopyButton.js +14 -15
- package/es/components/DangerButton/DangerButton.js +2 -2
- package/es/components/DataTable/DataTable.d.ts +81 -283
- package/es/components/DataTable/DataTable.js +124 -172
- package/es/components/DataTable/Table.d.ts +2 -2
- package/es/components/DataTable/Table.js +19 -22
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableBatchAction.js +9 -12
- package/es/components/DataTable/TableBatchActions.js +27 -29
- package/es/components/DataTable/TableBody.d.ts +3 -3
- package/es/components/DataTable/TableBody.js +9 -12
- package/es/components/DataTable/TableCell.d.ts +3 -4
- package/es/components/DataTable/TableCell.js +2 -2
- package/es/components/DataTable/TableContainer.d.ts +2 -3
- package/es/components/DataTable/TableContainer.js +15 -16
- package/es/components/DataTable/TableDecoratorRow.js +8 -9
- package/es/components/DataTable/TableExpandHeader.d.ts +2 -3
- package/es/components/DataTable/TableExpandHeader.js +18 -19
- package/es/components/DataTable/TableExpandRow.js +20 -21
- package/es/components/DataTable/TableExpandedRow.d.ts +3 -3
- package/es/components/DataTable/TableExpandedRow.js +10 -11
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableHeader.d.ts +4 -4
- package/es/components/DataTable/TableHeader.js +29 -30
- package/es/components/DataTable/TableRow.d.ts +3 -4
- package/es/components/DataTable/TableRow.js +4 -4
- package/es/components/DataTable/TableSelectAll.js +14 -15
- package/es/components/DataTable/TableSelectRow.js +16 -17
- package/es/components/DataTable/TableSlugRow.js +7 -8
- package/es/components/DataTable/TableToolbar.js +9 -10
- package/es/components/DataTable/TableToolbarAction.js +2 -2
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +10 -11
- package/es/components/DataTable/TableToolbarSearch.js +24 -26
- package/es/components/DataTable/index.d.ts +1 -1
- package/es/components/DataTable/state/sorting.js +3 -4
- package/es/components/DataTable/tools/filter.js +10 -12
- package/es/components/DataTable/tools/normalize.js +6 -8
- package/es/components/DataTable/tools/sorting.js +24 -30
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +26 -27
- package/es/components/DatePicker/DatePicker.Skeleton.js +15 -16
- package/es/components/DatePicker/DatePicker.js +104 -81
- package/es/components/DatePickerInput/DatePickerInput.d.ts +3 -4
- package/es/components/DatePickerInput/DatePickerInput.js +24 -25
- package/es/components/Dialog/index.d.ts +194 -10
- package/es/components/Dialog/index.js +458 -39
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
- package/es/components/Dropdown/Dropdown.Skeleton.js +10 -11
- package/es/components/Dropdown/Dropdown.d.ts +3 -3
- package/es/components/Dropdown/Dropdown.js +57 -60
- package/es/components/ErrorBoundary/ErrorBoundary.js +4 -4
- package/es/components/ExpandableSearch/ExpandableSearch.js +11 -12
- package/es/components/FeatureFlags/index.js +13 -14
- package/es/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
- package/es/components/FileUploader/FileUploader.Skeleton.js +9 -10
- package/es/components/FileUploader/FileUploader.d.ts +2 -3
- package/es/components/FileUploader/FileUploader.js +33 -35
- package/es/components/FileUploader/FileUploaderButton.d.ts +2 -3
- package/es/components/FileUploader/FileUploaderButton.js +20 -21
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
- package/es/components/FileUploader/FileUploaderDropContainer.js +20 -21
- package/es/components/FileUploader/FileUploaderItem.d.ts +2 -3
- package/es/components/FileUploader/FileUploaderItem.js +26 -27
- package/es/components/FileUploader/Filename.d.ts +3 -4
- package/es/components/FileUploader/Filename.js +16 -17
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +9 -10
- package/es/components/FluidComboBox/FluidComboBox.js +8 -9
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +16 -17
- package/es/components/FluidDatePicker/FluidDatePicker.js +13 -14
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +9 -10
- package/es/components/FluidDropdown/FluidDropdown.js +8 -9
- package/es/components/FluidForm/FluidForm.d.ts +3 -4
- package/es/components/FluidForm/FluidForm.js +8 -9
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +9 -10
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +10 -11
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +9 -10
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
- package/es/components/FluidNumberInput/FluidNumberInput.js +41 -8
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +9 -10
- package/es/components/FluidSearch/FluidSearch.js +7 -8
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +9 -10
- package/es/components/FluidSelect/FluidSelect.js +8 -9
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +9 -10
- package/es/components/FluidTextArea/FluidTextArea.js +7 -8
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +9 -10
- package/es/components/FluidTextInput/FluidTextInput.js +9 -10
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +8 -9
- package/es/components/FluidTimePicker/FluidTimePicker.js +23 -24
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +7 -8
- package/es/components/Form/Form.js +7 -8
- package/es/components/FormGroup/FormGroup.d.ts +3 -4
- package/es/components/FormGroup/FormGroup.js +15 -16
- package/es/components/FormItem/FormItem.js +7 -8
- package/es/components/FormLabel/FormLabel.js +8 -9
- package/es/components/Grid/CSSGrid.js +23 -25
- package/es/components/Grid/Column.js +32 -31
- package/es/components/Grid/ColumnHang.js +8 -9
- package/es/components/Grid/FlexGrid.js +12 -13
- package/es/components/Grid/Grid.js +3 -3
- package/es/components/Grid/GridContext.d.ts +2 -2
- package/es/components/Grid/GridContext.js +6 -7
- package/es/components/Grid/Row.js +10 -11
- package/es/components/Heading/index.js +13 -14
- package/es/components/Icon/Icon.Skeleton.js +6 -7
- package/es/components/IconButton/index.js +30 -26
- package/es/components/IconIndicator/index.js +10 -11
- package/es/components/IdPrefix/index.js +6 -7
- package/es/components/InlineCheckbox/InlineCheckbox.js +6 -6
- package/es/components/InlineLoading/InlineLoading.js +19 -20
- package/es/components/Layer/LayerContext.js +2 -2
- package/es/components/Layer/index.d.ts +4 -0
- package/es/components/Layer/index.js +21 -15
- package/es/components/Layout/index.js +24 -29
- package/es/components/LayoutDirection/LayoutDirection.js +10 -11
- package/es/components/LayoutDirection/LayoutDirectionContext.js +2 -2
- package/es/components/Link/Link.d.ts +1 -1
- package/es/components/Link/Link.js +19 -20
- package/es/components/ListBox/ListBox.d.ts +2 -3
- package/es/components/ListBox/ListBox.js +5 -5
- package/es/components/ListBox/ListBoxField.d.ts +3 -4
- package/es/components/ListBox/ListBoxField.js +8 -9
- package/es/components/ListBox/ListBoxMenu.d.ts +2 -3
- package/es/components/ListBox/ListBoxMenu.js +7 -8
- package/es/components/ListBox/ListBoxMenuIcon.js +8 -9
- package/es/components/ListBox/ListBoxMenuItem.d.ts +2 -3
- package/es/components/ListBox/ListBoxMenuItem.js +11 -13
- package/es/components/ListBox/ListBoxSelection.js +14 -15
- package/es/components/ListBox/next/ListBoxSelection.js +16 -17
- package/es/components/ListBox/next/ListBoxTrigger.js +8 -9
- package/es/components/ListItem/ListItem.js +7 -8
- package/es/components/Loading/Loading.d.ts +3 -3
- package/es/components/Loading/Loading.js +14 -15
- package/es/components/Menu/Menu.js +26 -27
- package/es/components/Menu/MenuItem.js +55 -60
- package/es/components/MenuButton/index.js +20 -22
- package/es/components/Modal/Modal.d.ts +2 -3
- package/es/components/Modal/Modal.js +85 -93
- package/es/components/ModalWrapper/ModalWrapper.js +9 -9
- package/es/components/MultiSelect/FilterableMultiSelect.js +68 -74
- package/es/components/MultiSelect/MultiSelect.js +65 -67
- package/es/components/MultiSelect/tools/sorting.js +11 -15
- package/es/components/Notification/Notification.js +137 -146
- package/es/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
- package/es/components/NumberInput/NumberFormatPropTypes.js +40 -0
- package/es/components/NumberInput/NumberInput.Skeleton.js +10 -11
- package/es/components/NumberInput/NumberInput.d.ts +39 -3
- package/es/components/NumberInput/NumberInput.js +195 -65
- package/es/components/OrderedList/OrderedList.js +9 -10
- package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +42 -48
- package/es/components/OverflowMenu/index.js +3 -3
- package/es/components/OverflowMenu/next/index.js +17 -18
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
- package/es/components/OverflowMenuV2/index.js +3 -3
- package/es/components/PageHeader/PageHeader.d.ts +29 -5
- package/es/components/PageHeader/PageHeader.js +136 -90
- package/es/components/Pagination/Pagination.Skeleton.js +12 -13
- package/es/components/Pagination/Pagination.js +40 -41
- package/es/components/Pagination/experimental/PageSelector.js +11 -12
- package/es/components/Pagination/experimental/Pagination.js +34 -35
- package/es/components/PaginationNav/PaginationNav.js +63 -68
- package/es/components/Popover/index.js +40 -42
- package/es/components/PrimaryButton/PrimaryButton.js +2 -2
- package/es/components/ProgressBar/ProgressBar.js +24 -25
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +12 -13
- package/es/components/ProgressIndicator/ProgressIndicator.js +49 -52
- package/es/components/RadioButton/RadioButton.Skeleton.js +4 -4
- package/es/components/RadioButton/RadioButton.js +10 -10
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +16 -16
- package/es/components/RadioTile/RadioTile.js +28 -29
- package/es/components/Search/Search.Skeleton.js +9 -10
- package/es/components/Search/Search.js +36 -38
- package/es/components/SecondaryButton/SecondaryButton.js +2 -2
- package/es/components/Select/Select.Skeleton.js +10 -11
- package/es/components/Select/Select.js +42 -43
- package/es/components/SelectItem/SelectItem.js +10 -11
- package/es/components/SelectItemGroup/SelectItemGroup.js +9 -10
- package/es/components/ShapeIndicator/index.js +13 -14
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
- package/es/components/SkeletonIcon/SkeletonIcon.js +7 -12
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +6 -7
- package/es/components/SkeletonText/SkeletonText.js +12 -13
- package/es/components/Slider/Slider.Skeleton.js +25 -26
- package/es/components/Slider/Slider.js +99 -113
- package/es/components/Slider/SliderHandles.js +20 -20
- package/es/components/Stack/HStack.js +2 -2
- package/es/components/Stack/Stack.js +2 -2
- package/es/components/Stack/VStack.js +2 -2
- package/es/components/StructuredList/StructuredList.Skeleton.js +17 -18
- package/es/components/StructuredList/StructuredList.js +24 -24
- package/es/components/Switch/IconSwitch.js +3 -3
- package/es/components/Switch/Switch.js +4 -4
- package/es/components/TabContent/TabContent.js +2 -2
- package/es/components/Tabs/Tabs.Skeleton.js +12 -13
- package/es/components/Tabs/Tabs.js +141 -156
- package/es/components/Tabs/usePressable.js +7 -8
- package/es/components/Tag/DismissibleTag.js +26 -27
- package/es/components/Tag/OperationalTag.js +16 -17
- package/es/components/Tag/SelectableTag.js +19 -20
- package/es/components/Tag/Tag.Skeleton.js +7 -8
- package/es/components/Tag/Tag.js +33 -34
- package/es/components/Text/Text.js +9 -10
- package/es/components/Text/TextDirection.js +7 -8
- package/es/components/Text/createTextComponent.js +2 -2
- package/es/components/TextArea/TextArea.Skeleton.js +4 -4
- package/es/components/TextArea/TextArea.js +22 -22
- package/es/components/TextInput/ControlledPasswordInput.d.ts +2 -3
- package/es/components/TextInput/ControlledPasswordInput.js +36 -37
- package/es/components/TextInput/PasswordInput.js +40 -41
- package/es/components/TextInput/TextInput.Skeleton.js +9 -10
- package/es/components/TextInput/TextInput.js +43 -44
- package/es/components/TextInput/util.js +14 -17
- package/es/components/Theme/index.js +19 -21
- package/es/components/Tile/Tile.js +98 -104
- package/es/components/TileGroup/TileGroup.d.ts +3 -4
- package/es/components/TileGroup/TileGroup.js +8 -8
- package/es/components/TimePicker/TimePicker.d.ts +2 -3
- package/es/components/TimePicker/TimePicker.js +14 -14
- package/es/components/TimePickerSelect/TimePickerSelect.js +4 -4
- package/es/components/Toggle/Toggle.Skeleton.js +8 -9
- package/es/components/Toggle/Toggle.js +27 -28
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +14 -15
- package/es/components/Toggletip/index.js +43 -49
- package/es/components/Tooltip/DefinitionTooltip.js +17 -18
- package/es/components/Tooltip/Tooltip.d.ts +3 -0
- package/es/components/Tooltip/Tooltip.js +39 -28
- package/es/components/TreeView/TreeNode.js +64 -56
- package/es/components/TreeView/TreeView.js +44 -37
- package/es/components/UIShell/Content.js +8 -9
- package/es/components/UIShell/Header.js +7 -8
- package/es/components/UIShell/HeaderContainer.js +7 -8
- package/es/components/UIShell/HeaderGlobalAction.js +14 -15
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +10 -112
- package/es/components/UIShell/HeaderMenu.js +154 -201
- package/es/components/UIShell/HeaderMenuButton.js +14 -15
- package/es/components/UIShell/HeaderMenuItem.js +21 -20
- package/es/components/UIShell/HeaderName.js +9 -10
- package/es/components/UIShell/HeaderNavigation.js +10 -11
- package/es/components/UIShell/HeaderPanel.js +11 -12
- package/es/components/UIShell/HeaderSideNavItems.js +7 -8
- package/es/components/UIShell/Link.js +11 -12
- package/es/components/UIShell/SideNav.js +30 -32
- package/es/components/UIShell/SideNavDetails.js +9 -10
- package/es/components/UIShell/SideNavDivider.js +6 -7
- package/es/components/UIShell/SideNavFooter.js +13 -14
- package/es/components/UIShell/SideNavHeader.js +8 -9
- package/es/components/UIShell/SideNavIcon.js +7 -8
- package/es/components/UIShell/SideNavItem.js +7 -8
- package/es/components/UIShell/SideNavItems.js +10 -11
- package/es/components/UIShell/SideNavLink.js +15 -16
- package/es/components/UIShell/SideNavLinkText.js +7 -8
- package/es/components/UIShell/SideNavMenu.js +20 -21
- package/es/components/UIShell/SideNavMenuItem.js +5 -5
- package/es/components/UIShell/SideNavSwitcher.js +8 -8
- package/es/components/UIShell/SkipToContent.js +9 -10
- package/es/components/UIShell/Switcher.js +12 -13
- package/es/components/UIShell/SwitcherDivider.js +6 -7
- package/es/components/UIShell/SwitcherItem.js +3 -3
- package/es/components/UnorderedList/UnorderedList.js +8 -9
- package/es/index.js +25 -26
- package/es/internal/FloatingMenu.js +30 -32
- package/es/internal/Selection.js +15 -17
- package/{lib/feature-flags.d.ts → es/internal/__mocks__/mockHTMLElement.d.ts} +4 -2
- package/es/internal/createClassWrapper.js +2 -2
- package/es/internal/getAnnouncement.d.ts +8 -0
- package/es/internal/getAnnouncement.js +22 -0
- package/es/internal/keyboard/match.js +6 -7
- package/es/internal/useControllableState.d.ts +1 -1
- package/es/internal/useControllableState.js +8 -9
- package/es/internal/useDelayedState.js +1 -2
- package/es/internal/useDocumentLang.d.ts +12 -0
- package/es/internal/useId.js +4 -6
- package/es/internal/useIdPrefix.js +3 -3
- package/es/internal/useMatchMedia.js +1 -2
- package/es/internal/useMergedRefs.d.ts +1 -1
- package/es/internal/useNoInteractiveChildren.js +2 -4
- package/es/internal/useNormalizedInputProps.js +12 -13
- package/es/internal/usePrefix.js +3 -3
- package/es/internal/useResizeObserver.d.ts +14 -0
- package/es/internal/useResizeObserver.js +73 -0
- package/es/internal/useSavedCallback.js +1 -3
- package/es/internal/wrapFocus.js +23 -35
- package/es/prop-types/deprecate.js +1 -4
- package/es/prop-types/deprecateValuesWithin.js +1 -4
- package/es/prop-types/isRequiredOneOf.js +1 -4
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
- package/es/tools/events.js +1 -4
- package/es/tools/mergeRefs.js +9 -14
- package/es/tools/uniqueId.js +1 -2
- package/es/tools/wrapComponent.d.ts +3 -4
- package/es/tools/wrapComponent.js +11 -13
- package/es/types/common.d.ts +0 -2
- package/lib/components/AILabel/index.js +27 -30
- package/lib/components/AISkeleton/AISkeletonIcon.js +4 -5
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
- package/lib/components/AISkeleton/AISkeletonText.js +4 -5
- package/lib/components/Accordion/Accordion.Skeleton.js +9 -10
- package/lib/components/Accordion/Accordion.js +10 -11
- package/lib/components/Accordion/AccordionItem.js +13 -14
- package/lib/components/Accordion/AccordionProvider.js +4 -5
- package/lib/components/AspectRatio/AspectRatio.js +7 -8
- package/lib/components/BadgeIndicator/index.js +5 -6
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
- package/lib/components/Button/Button.Skeleton.js +7 -8
- package/lib/components/Button/ButtonBase.js +23 -24
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -6
- package/lib/components/ChatButton/ChatButton.js +11 -12
- package/lib/components/Checkbox/Checkbox.Skeleton.js +4 -5
- package/lib/components/Checkbox/Checkbox.js +19 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -17
- package/lib/components/ClassPrefix/index.js +4 -5
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
- package/lib/components/CodeSnippet/CodeSnippet.js +27 -29
- package/lib/components/ComboBox/ComboBox.js +24 -30
- package/lib/components/ComboBox/tools/filter.js +9 -12
- package/lib/components/ComboButton/index.js +16 -18
- package/lib/components/ComposedModal/ComposedModal.js +31 -34
- package/lib/components/ComposedModal/ModalFooter.js +37 -42
- package/lib/components/ComposedModal/ModalHeader.js +14 -15
- package/lib/components/ContainedList/ContainedList.js +10 -11
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +17 -29
- package/lib/components/ContentSwitcher/ContentSwitcher.js +98 -124
- package/lib/components/ContentSwitcher/index.d.ts +3 -4
- package/lib/components/ContextMenu/useContextMenu.js +1 -2
- package/lib/components/Copy/Copy.js +11 -12
- package/lib/components/CopyButton/CopyButton.js +10 -11
- package/lib/components/DataTable/DataTable.d.ts +81 -283
- package/lib/components/DataTable/DataTable.js +123 -172
- package/lib/components/DataTable/Table.d.ts +2 -2
- package/lib/components/DataTable/Table.js +15 -18
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableBatchAction.js +8 -11
- package/lib/components/DataTable/TableBatchActions.js +18 -20
- package/lib/components/DataTable/TableBody.d.ts +3 -3
- package/lib/components/DataTable/TableBody.js +8 -11
- package/lib/components/DataTable/TableCell.d.ts +3 -4
- package/lib/components/DataTable/TableContainer.d.ts +2 -3
- package/lib/components/DataTable/TableContainer.js +9 -10
- package/lib/components/DataTable/TableDecoratorRow.js +4 -5
- package/lib/components/DataTable/TableExpandHeader.d.ts +2 -3
- package/lib/components/DataTable/TableExpandHeader.js +14 -15
- package/lib/components/DataTable/TableExpandRow.js +13 -14
- package/lib/components/DataTable/TableExpandedRow.d.ts +3 -3
- package/lib/components/DataTable/TableExpandedRow.js +6 -7
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.d.ts +4 -4
- package/lib/components/DataTable/TableHeader.js +15 -16
- package/lib/components/DataTable/TableRow.d.ts +3 -4
- package/lib/components/DataTable/TableSelectAll.js +11 -12
- package/lib/components/DataTable/TableSelectRow.js +12 -13
- package/lib/components/DataTable/TableSlugRow.js +4 -5
- package/lib/components/DataTable/TableToolbar.js +7 -8
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +8 -9
- package/lib/components/DataTable/TableToolbarSearch.js +22 -24
- package/lib/components/DataTable/index.d.ts +1 -1
- package/lib/components/DataTable/state/sorting.js +3 -4
- package/lib/components/DataTable/tools/filter.js +10 -12
- package/lib/components/DataTable/tools/normalize.js +6 -8
- package/lib/components/DataTable/tools/sorting.js +24 -30
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
- package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -8
- package/lib/components/DatePicker/DatePicker.js +87 -64
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +3 -4
- package/lib/components/DatePickerInput/DatePickerInput.js +5 -6
- package/lib/components/Dialog/index.d.ts +194 -10
- package/lib/components/Dialog/index.js +457 -33
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
- package/lib/components/Dropdown/Dropdown.Skeleton.js +6 -7
- package/lib/components/Dropdown/Dropdown.d.ts +3 -3
- package/lib/components/Dropdown/Dropdown.js +40 -43
- package/lib/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +9 -10
- package/lib/components/FeatureFlags/index.js +11 -12
- package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
- package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -5
- package/lib/components/FileUploader/FileUploader.d.ts +2 -3
- package/lib/components/FileUploader/FileUploader.js +22 -24
- package/lib/components/FileUploader/FileUploaderButton.d.ts +2 -3
- package/lib/components/FileUploader/FileUploaderButton.js +16 -17
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
- package/lib/components/FileUploader/FileUploaderDropContainer.js +15 -16
- package/lib/components/FileUploader/FileUploaderItem.d.ts +2 -3
- package/lib/components/FileUploader/FileUploaderItem.js +13 -14
- package/lib/components/FileUploader/Filename.d.ts +3 -4
- package/lib/components/FileUploader/Filename.js +9 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
- package/lib/components/FluidComboBox/FluidComboBox.js +5 -6
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
- package/lib/components/FluidDatePicker/FluidDatePicker.js +10 -11
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
- package/lib/components/FluidDropdown/FluidDropdown.js +5 -6
- package/lib/components/FluidForm/FluidForm.d.ts +3 -4
- package/lib/components/FluidForm/FluidForm.js +5 -6
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
- package/lib/components/FluidNumberInput/FluidNumberInput.js +38 -5
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
- package/lib/components/FluidSearch/FluidSearch.js +4 -5
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
- package/lib/components/FluidSelect/FluidSelect.js +5 -6
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
- package/lib/components/FluidTextArea/FluidTextArea.js +4 -5
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
- package/lib/components/FluidTextInput/FluidTextInput.js +5 -6
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -12
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
- package/lib/components/Form/Form.js +5 -6
- package/lib/components/FormGroup/FormGroup.d.ts +3 -4
- package/lib/components/FormGroup/FormGroup.js +11 -12
- package/lib/components/FormItem/FormItem.js +5 -6
- package/lib/components/FormLabel/FormLabel.js +6 -7
- package/lib/components/Grid/CSSGrid.js +17 -19
- package/lib/components/Grid/Column.js +28 -27
- package/lib/components/Grid/ColumnHang.js +6 -7
- package/lib/components/Grid/FlexGrid.js +9 -10
- package/lib/components/Grid/GridContext.d.ts +2 -2
- package/lib/components/Grid/GridContext.js +10 -29
- package/lib/components/Grid/Row.js +8 -9
- package/lib/components/Heading/index.js +5 -6
- package/lib/components/Icon/Icon.Skeleton.js +4 -5
- package/lib/components/IconButton/index.js +26 -22
- package/lib/components/IconIndicator/index.js +7 -8
- package/lib/components/IdPrefix/index.js +4 -5
- package/lib/components/InlineLoading/InlineLoading.js +9 -10
- package/lib/components/Layer/index.d.ts +4 -0
- package/lib/components/Layer/index.js +16 -10
- package/lib/components/Layout/index.js +21 -26
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -7
- package/lib/components/Link/Link.d.ts +1 -1
- package/lib/components/Link/Link.js +15 -16
- package/lib/components/ListBox/ListBox.d.ts +2 -3
- package/lib/components/ListBox/ListBoxField.d.ts +3 -4
- package/lib/components/ListBox/ListBoxField.js +6 -7
- package/lib/components/ListBox/ListBoxMenu.d.ts +2 -3
- package/lib/components/ListBox/ListBoxMenu.js +5 -6
- package/lib/components/ListBox/ListBoxMenuIcon.js +4 -5
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +2 -3
- package/lib/components/ListBox/ListBoxMenuItem.js +8 -10
- package/lib/components/ListBox/ListBoxSelection.js +8 -9
- package/lib/components/ListBox/next/ListBoxSelection.js +9 -10
- package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
- package/lib/components/ListItem/ListItem.js +5 -6
- package/lib/components/Loading/Loading.d.ts +3 -3
- package/lib/components/Loading/Loading.js +8 -9
- package/lib/components/Menu/Menu.js +23 -24
- package/lib/components/Menu/MenuItem.js +39 -44
- package/lib/components/MenuButton/index.js +16 -18
- package/lib/components/Modal/Modal.d.ts +2 -3
- package/lib/components/Modal/Modal.js +55 -63
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +46 -52
- package/lib/components/MultiSelect/MultiSelect.js +43 -45
- package/lib/components/MultiSelect/tools/sorting.js +11 -15
- package/lib/components/Notification/Notification.js +96 -105
- package/lib/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
- package/lib/components/NumberInput/NumberFormatPropTypes.js +48 -0
- package/lib/components/NumberInput/NumberInput.Skeleton.js +6 -7
- package/lib/components/NumberInput/NumberInput.d.ts +39 -3
- package/lib/components/NumberInput/NumberInput.js +173 -43
- package/lib/components/OrderedList/OrderedList.js +7 -8
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +35 -41
- package/lib/components/OverflowMenu/next/index.js +12 -13
- package/lib/components/PageHeader/PageHeader.d.ts +29 -5
- package/lib/components/PageHeader/PageHeader.js +119 -73
- package/lib/components/Pagination/Pagination.Skeleton.js +4 -5
- package/lib/components/Pagination/Pagination.js +24 -25
- package/lib/components/Pagination/experimental/PageSelector.js +8 -9
- package/lib/components/Pagination/experimental/Pagination.js +20 -21
- package/lib/components/PaginationNav/PaginationNav.js +33 -38
- package/lib/components/Popover/index.js +26 -28
- package/lib/components/ProgressBar/ProgressBar.js +11 -12
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
- package/lib/components/ProgressIndicator/ProgressIndicator.js +29 -32
- package/lib/components/RadioTile/RadioTile.js +17 -18
- package/lib/components/Search/Search.Skeleton.js +5 -6
- package/lib/components/Search/Search.js +26 -28
- package/lib/components/Select/Select.Skeleton.js +5 -6
- package/lib/components/Select/Select.js +24 -25
- package/lib/components/SelectItem/SelectItem.js +8 -9
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -8
- package/lib/components/ShapeIndicator/index.js +7 -8
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
- package/lib/components/SkeletonIcon/SkeletonIcon.js +5 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
- package/lib/components/SkeletonText/SkeletonText.js +8 -9
- package/lib/components/Slider/Slider.Skeleton.js +8 -9
- package/lib/components/Slider/Slider.js +69 -83
- package/lib/components/Slider/SliderHandles.js +6 -6
- package/lib/components/StructuredList/StructuredList.Skeleton.js +5 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +5 -6
- package/lib/components/Tabs/Tabs.js +83 -98
- package/lib/components/Tabs/usePressable.js +7 -8
- package/lib/components/Tag/DismissibleTag.js +16 -17
- package/lib/components/Tag/OperationalTag.js +10 -11
- package/lib/components/Tag/SelectableTag.js +13 -14
- package/lib/components/Tag/Tag.Skeleton.js +5 -6
- package/lib/components/Tag/Tag.js +19 -20
- package/lib/components/Text/Text.js +6 -7
- package/lib/components/Text/TextDirection.js +5 -6
- package/lib/components/TextArea/TextArea.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +2 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +24 -25
- package/lib/components/TextInput/PasswordInput.js +26 -27
- package/lib/components/TextInput/TextInput.Skeleton.js +5 -6
- package/lib/components/TextInput/TextInput.js +27 -28
- package/lib/components/TextInput/util.js +14 -17
- package/lib/components/Theme/index.js +10 -12
- package/lib/components/Tile/Tile.js +68 -74
- package/lib/components/TileGroup/TileGroup.d.ts +3 -4
- package/lib/components/TimePicker/TimePicker.d.ts +2 -3
- package/lib/components/Toggle/Toggle.Skeleton.js +4 -5
- package/lib/components/Toggle/Toggle.js +17 -18
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
- package/lib/components/Toggletip/index.js +33 -39
- package/lib/components/Tooltip/DefinitionTooltip.js +13 -14
- package/lib/components/Tooltip/Tooltip.d.ts +3 -0
- package/lib/components/Tooltip/Tooltip.js +33 -22
- package/lib/components/TreeView/TreeNode.js +40 -32
- package/lib/components/TreeView/TreeView.js +41 -34
- package/lib/components/UIShell/Content.js +6 -7
- package/lib/components/UIShell/Header.js +5 -6
- package/lib/components/UIShell/HeaderContainer.js +5 -6
- package/lib/components/UIShell/HeaderGlobalAction.js +12 -13
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +10 -112
- package/lib/components/UIShell/HeaderMenu.js +152 -199
- package/lib/components/UIShell/HeaderMenuButton.js +10 -11
- package/lib/components/UIShell/HeaderMenuItem.js +17 -16
- package/lib/components/UIShell/HeaderName.js +6 -7
- package/lib/components/UIShell/HeaderNavigation.js +7 -8
- package/lib/components/UIShell/HeaderPanel.js +9 -10
- package/lib/components/UIShell/HeaderSideNavItems.js +5 -6
- package/lib/components/UIShell/Link.js +8 -9
- package/lib/components/UIShell/SideNav.js +23 -25
- package/lib/components/UIShell/SideNavDetails.js +6 -7
- package/lib/components/UIShell/SideNavDivider.js +3 -4
- package/lib/components/UIShell/SideNavFooter.js +6 -7
- package/lib/components/UIShell/SideNavHeader.js +5 -6
- package/lib/components/UIShell/SideNavIcon.js +5 -6
- package/lib/components/UIShell/SideNavItem.js +5 -6
- package/lib/components/UIShell/SideNavItems.js +5 -6
- package/lib/components/UIShell/SideNavLink.js +10 -11
- package/lib/components/UIShell/SideNavLinkText.js +5 -6
- package/lib/components/UIShell/SideNavMenu.js +11 -12
- package/lib/components/UIShell/SkipToContent.js +7 -8
- package/lib/components/UIShell/Switcher.js +4 -5
- package/lib/components/UIShell/SwitcherDivider.js +4 -5
- package/lib/components/UnorderedList/UnorderedList.js +6 -7
- package/lib/index.js +81 -82
- package/lib/internal/FloatingMenu.js +26 -28
- package/lib/internal/Selection.js +15 -17
- package/{es/feature-flags.d.ts → lib/internal/__mocks__/mockHTMLElement.d.ts} +4 -2
- package/lib/internal/getAnnouncement.d.ts +8 -0
- package/lib/internal/getAnnouncement.js +26 -0
- package/lib/internal/keyboard/match.js +6 -7
- package/lib/internal/useControllableState.d.ts +1 -1
- package/lib/internal/useControllableState.js +8 -9
- package/lib/internal/useDelayedState.js +1 -2
- package/lib/internal/useDocumentLang.d.ts +12 -0
- package/lib/internal/useId.js +2 -4
- package/lib/internal/useMatchMedia.js +1 -2
- package/lib/internal/useMergedRefs.d.ts +1 -1
- package/lib/internal/useNoInteractiveChildren.js +2 -4
- package/lib/internal/useNormalizedInputProps.js +9 -10
- package/lib/internal/useResizeObserver.d.ts +14 -0
- package/lib/internal/useResizeObserver.js +77 -0
- package/lib/internal/useSavedCallback.js +1 -3
- package/lib/internal/wrapFocus.js +23 -35
- package/lib/prop-types/deprecate.js +1 -4
- package/lib/prop-types/deprecateValuesWithin.js +1 -4
- package/lib/prop-types/isRequiredOneOf.js +1 -4
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
- package/lib/tools/events.js +1 -4
- package/lib/tools/mergeRefs.js +9 -14
- package/lib/tools/uniqueId.js +1 -2
- package/lib/tools/wrapComponent.d.ts +3 -4
- package/lib/tools/wrapComponent.js +9 -11
- package/lib/types/common.d.ts +0 -2
- package/package.json +21 -20
- package/scss/components/content-switcher/_tokens.scss +9 -0
- package/telemetry.yml +27 -2
- package/es/components/ContentSwitcher/index.js +0 -13
- package/es/components/DataTable/index.js +0 -76
- package/es/internal/useAnnouncer.js +0 -21
- package/lib/components/ContentSwitcher/index.js +0 -18
- package/lib/components/DataTable/index.js +0 -82
- package/lib/internal/useAnnouncer.js +0 -25
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import
|
|
11
|
+
import React, { useRef } from 'react';
|
|
12
12
|
import { ArrowUp, ArrowsVertical } from '@carbon/icons-react';
|
|
13
13
|
import './state/sorting.js';
|
|
14
14
|
import { useId } from '../../internal/useId.js';
|
|
@@ -41,32 +41,31 @@ const sortDirections = {
|
|
|
41
41
|
[sortStates.ASC]: 'ascending',
|
|
42
42
|
[sortStates.DESC]: 'descending'
|
|
43
43
|
};
|
|
44
|
-
const TableHeader = /*#__PURE__*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} = _ref;
|
|
44
|
+
const TableHeader = /*#__PURE__*/React.forwardRef(function TableHeader({
|
|
45
|
+
className: headerClassName,
|
|
46
|
+
children,
|
|
47
|
+
colSpan,
|
|
48
|
+
decorator,
|
|
49
|
+
isSortable = false,
|
|
50
|
+
isSortHeader,
|
|
51
|
+
onClick,
|
|
52
|
+
scope = defaultScope,
|
|
53
|
+
sortDirection,
|
|
54
|
+
translateWithId: t = translateWithId,
|
|
55
|
+
slug,
|
|
56
|
+
id,
|
|
57
|
+
...rest
|
|
58
|
+
}, ref) {
|
|
60
59
|
const prefix = usePrefix();
|
|
61
60
|
const uniqueId = useId('table-sort');
|
|
62
61
|
|
|
63
62
|
// AILabel is always size `mini`
|
|
64
63
|
const AILableRef = useRef(null);
|
|
65
64
|
let colHasAILabel;
|
|
66
|
-
let normalizedDecorator = /*#__PURE__*/
|
|
65
|
+
let normalizedDecorator = /*#__PURE__*/React.isValidElement(slug ?? decorator) ? slug ?? decorator : null;
|
|
67
66
|
if (normalizedDecorator && normalizedDecorator['type']?.displayName === 'AILabel') {
|
|
68
67
|
colHasAILabel = true;
|
|
69
|
-
normalizedDecorator = /*#__PURE__*/
|
|
68
|
+
normalizedDecorator = /*#__PURE__*/React.cloneElement(normalizedDecorator, {
|
|
70
69
|
size: 'mini',
|
|
71
70
|
ref: AILableRef
|
|
72
71
|
});
|
|
@@ -77,15 +76,15 @@ const TableHeader = /*#__PURE__*/React__default.forwardRef(function TableHeader(
|
|
|
77
76
|
[`${prefix}--table-header-label--decorator`]: decorator
|
|
78
77
|
});
|
|
79
78
|
if (!isSortable) {
|
|
80
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/React.createElement("th", _extends({}, rest, {
|
|
81
80
|
id: id,
|
|
82
81
|
className: headerClassName,
|
|
83
82
|
scope: scope,
|
|
84
83
|
colSpan: colSpan,
|
|
85
84
|
ref: ref
|
|
86
|
-
}), children ? /*#__PURE__*/
|
|
85
|
+
}), children ? /*#__PURE__*/React.createElement("div", {
|
|
87
86
|
className: headerLabelClassNames
|
|
88
|
-
}, children, /*#__PURE__*/
|
|
87
|
+
}, children, /*#__PURE__*/React.createElement("div", {
|
|
89
88
|
className: `${prefix}--table-header-label--decorator-inner`
|
|
90
89
|
}, normalizedDecorator)) : null);
|
|
91
90
|
}
|
|
@@ -112,32 +111,32 @@ const TableHeader = /*#__PURE__*/React__default.forwardRef(function TableHeader(
|
|
|
112
111
|
return onClick(evt);
|
|
113
112
|
}
|
|
114
113
|
};
|
|
115
|
-
return /*#__PURE__*/
|
|
114
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
116
115
|
id: id,
|
|
117
116
|
"aria-sort": ariaSort,
|
|
118
117
|
className: headerClasses,
|
|
119
118
|
colSpan: colSpan,
|
|
120
119
|
ref: ref,
|
|
121
120
|
scope: scope
|
|
122
|
-
}, /*#__PURE__*/
|
|
121
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
123
122
|
className: `${prefix}--table-sort__description`,
|
|
124
123
|
id: uniqueId
|
|
125
|
-
}, sortDescription), /*#__PURE__*/
|
|
124
|
+
}, sortDescription), /*#__PURE__*/React.createElement("button", _extends({
|
|
126
125
|
type: "button",
|
|
127
126
|
"aria-describedby": uniqueId,
|
|
128
127
|
className: className,
|
|
129
128
|
onClick: handleClick
|
|
130
|
-
}, rest), /*#__PURE__*/
|
|
129
|
+
}, rest), /*#__PURE__*/React.createElement("span", {
|
|
131
130
|
className: `${prefix}--table-sort__flex`
|
|
132
|
-
}, /*#__PURE__*/
|
|
131
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
133
132
|
className: `${prefix}--table-header-label`
|
|
134
|
-
}, children), /*#__PURE__*/
|
|
133
|
+
}, children), /*#__PURE__*/React.createElement(ArrowUp, {
|
|
135
134
|
size: 20,
|
|
136
135
|
className: `${prefix}--table-sort__icon`
|
|
137
|
-
}), /*#__PURE__*/
|
|
136
|
+
}), /*#__PURE__*/React.createElement(ArrowsVertical, {
|
|
138
137
|
size: 20,
|
|
139
138
|
className: `${prefix}--table-sort__icon-unsorted`
|
|
140
|
-
}), /*#__PURE__*/
|
|
139
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
141
140
|
className: `${prefix}--table-header-label--decorator-inner`
|
|
142
141
|
}, normalizedDecorator))));
|
|
143
142
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
export interface TableRowProps extends ReactAttr<HTMLTableRowElement> {
|
|
7
|
+
import React, { type HTMLAttributes } from 'react';
|
|
8
|
+
export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
10
9
|
/**
|
|
11
10
|
* Specify an optional className to be applied to the container node
|
|
12
11
|
*/
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import
|
|
9
|
+
import React from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
|
-
const TableRow = /*#__PURE__*/
|
|
14
|
+
const TableRow = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
15
|
const prefix = usePrefix();
|
|
16
16
|
let rowHasAILabel;
|
|
17
17
|
if (props?.children) {
|
|
18
|
-
|
|
18
|
+
React.Children.toArray(props.children).map(child => {
|
|
19
19
|
if (child.type?.displayName === 'TableSlugRow' || child.type?.displayName === 'TableDecoratorRow') {
|
|
20
20
|
if (child.props.slug || child.props.decorator?.type.displayName === 'AILabel') {
|
|
21
21
|
rowHasAILabel = true;
|
|
@@ -41,7 +41,7 @@ const TableRow = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
|
41
41
|
if (className) {
|
|
42
42
|
cleanProps.className = className;
|
|
43
43
|
}
|
|
44
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/React.createElement("tr", _extends({
|
|
45
45
|
ref: ref
|
|
46
46
|
}, cleanProps));
|
|
47
47
|
});
|
|
@@ -6,30 +6,29 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import
|
|
9
|
+
import React from 'react';
|
|
10
10
|
import InlineCheckbox from '../InlineCheckbox/InlineCheckbox.js';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import deprecate from '../../prop-types/deprecate.js';
|
|
14
14
|
|
|
15
|
-
const TableSelectAll =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref;
|
|
15
|
+
const TableSelectAll = ({
|
|
16
|
+
ariaLabel: deprecatedAriaLabel = 'Select all rows in the table',
|
|
17
|
+
['aria-label']: ariaLabel,
|
|
18
|
+
checked,
|
|
19
|
+
id,
|
|
20
|
+
indeterminate,
|
|
21
|
+
name,
|
|
22
|
+
onSelect,
|
|
23
|
+
disabled,
|
|
24
|
+
className
|
|
25
|
+
}) => {
|
|
27
26
|
const prefix = usePrefix();
|
|
28
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
29
28
|
"aria-live": "off",
|
|
30
29
|
scope: "col",
|
|
31
30
|
className: cx(`${prefix}--table-column-checkbox`, className)
|
|
32
|
-
}, /*#__PURE__*/
|
|
31
|
+
}, /*#__PURE__*/React.createElement(InlineCheckbox, {
|
|
33
32
|
"aria-label": ariaLabel || deprecatedAriaLabel,
|
|
34
33
|
checked: checked,
|
|
35
34
|
id: id,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import
|
|
10
|
+
import React from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import InlineCheckbox from '../InlineCheckbox/InlineCheckbox.js';
|
|
13
13
|
import RadioButton from '../RadioButton/RadioButton.js';
|
|
@@ -15,19 +15,18 @@ import { useId } from '../../internal/useId.js';
|
|
|
15
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
16
|
import deprecate from '../../prop-types/deprecate.js';
|
|
17
17
|
|
|
18
|
-
const TableSelectRow =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = _ref;
|
|
18
|
+
const TableSelectRow = ({
|
|
19
|
+
ariaLabel: deprecatedAriaLabel,
|
|
20
|
+
['aria-label']: ariaLabel,
|
|
21
|
+
checked,
|
|
22
|
+
id,
|
|
23
|
+
name,
|
|
24
|
+
onSelect,
|
|
25
|
+
onChange,
|
|
26
|
+
disabled,
|
|
27
|
+
radio,
|
|
28
|
+
className
|
|
29
|
+
}) => {
|
|
31
30
|
const prefix = usePrefix();
|
|
32
31
|
const uniqueNameId = useId();
|
|
33
32
|
const handleRadioChange = onChange ? (value, name, event) => {
|
|
@@ -51,14 +50,14 @@ const TableSelectRow = _ref => {
|
|
|
51
50
|
}),
|
|
52
51
|
[`${prefix}--table-column-radio`]: radio
|
|
53
52
|
});
|
|
54
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
55
54
|
className: tableSelectRowClasses,
|
|
56
55
|
"aria-live": "off"
|
|
57
|
-
}, radio ? /*#__PURE__*/
|
|
56
|
+
}, radio ? /*#__PURE__*/React.createElement(RadioButton, _extends({}, selectionInputProps, {
|
|
58
57
|
labelText: labelValue,
|
|
59
58
|
onChange: handleRadioChange,
|
|
60
59
|
hideLabel: true
|
|
61
|
-
})) : /*#__PURE__*/
|
|
60
|
+
})) : /*#__PURE__*/React.createElement(InlineCheckbox, _extends({}, selectionInputProps, {
|
|
62
61
|
"aria-label": labelValue,
|
|
63
62
|
onChange: handleCheckboxChange
|
|
64
63
|
})));
|
|
@@ -6,16 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import
|
|
9
|
+
import React, { useEffect } from 'react';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
12
12
|
import deprecateComponent from '../../prop-types/deprecateComponent.js';
|
|
13
13
|
|
|
14
|
-
const TableSlugRow =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
14
|
+
const TableSlugRow = ({
|
|
15
|
+
className,
|
|
16
|
+
slug
|
|
17
|
+
}) => {
|
|
19
18
|
useEffect(() => {
|
|
20
19
|
deprecateComponent('TableSlugRow', 'The `TableSlugRow` component has been deprecated and will be removed in the next major version. Use the TableDecoratorRow component instead.');
|
|
21
20
|
}, []);
|
|
@@ -31,11 +30,11 @@ const TableSlugRow = _ref => {
|
|
|
31
30
|
// Slug is always size `mini`
|
|
32
31
|
let normalizedSlug;
|
|
33
32
|
if (slug) {
|
|
34
|
-
normalizedSlug = /*#__PURE__*/
|
|
33
|
+
normalizedSlug = /*#__PURE__*/React.cloneElement(slug, {
|
|
35
34
|
size: 'mini'
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
39
38
|
className: TableSlugRowClasses
|
|
40
39
|
}, normalizedSlug);
|
|
41
40
|
};
|
|
@@ -8,24 +8,23 @@
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import
|
|
11
|
+
import React from 'react';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import deprecate from '../../prop-types/deprecate.js';
|
|
14
14
|
|
|
15
|
-
const TableToolbar =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
15
|
+
const TableToolbar = ({
|
|
16
|
+
['aria-label']: ariaLabel = 'data table toolbar',
|
|
17
|
+
ariaLabel: deprecatedAriaLabel,
|
|
18
|
+
children,
|
|
19
|
+
size,
|
|
20
|
+
...rest
|
|
21
|
+
}) => {
|
|
23
22
|
const prefix = usePrefix();
|
|
24
23
|
const className = cx({
|
|
25
24
|
[`${prefix}--table-toolbar`]: true,
|
|
26
25
|
[`${prefix}--table-toolbar--${size}`]: size
|
|
27
26
|
});
|
|
28
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/React.createElement("section", _extends({
|
|
29
28
|
"aria-label": deprecatedAriaLabel || ariaLabel
|
|
30
29
|
}, rest, {
|
|
31
30
|
className: className
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import
|
|
10
|
+
import React, { forwardRef } from 'react';
|
|
11
11
|
import OverflowMenuItem from '../OverflowMenuItem/OverflowMenuItem.js';
|
|
12
12
|
|
|
13
13
|
const frFn = forwardRef;
|
|
@@ -16,7 +16,7 @@ const TableToolbarAction = frFn((props, ref) => {
|
|
|
16
16
|
children,
|
|
17
17
|
...rest
|
|
18
18
|
} = props;
|
|
19
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/React.createElement(OverflowMenuItem, _extends({
|
|
20
20
|
ref: ref,
|
|
21
21
|
itemText: children
|
|
22
22
|
}, rest));
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
declare const TableToolbarContent: (props: import("
|
|
7
|
+
declare const TableToolbarContent: (props: import("react").HTMLAttributes<"div">) => React.ReactElement<any>;
|
|
8
8
|
export default TableToolbarContent;
|
|
@@ -9,24 +9,23 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import { Settings } from '@carbon/icons-react';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
|
-
import
|
|
12
|
+
import React from 'react';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
import OverflowMenu from '../OverflowMenu/index.js';
|
|
15
15
|
|
|
16
16
|
const defaultIconDescription = 'Settings';
|
|
17
|
-
const TableToolbarMenu =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
17
|
+
const TableToolbarMenu = ({
|
|
18
|
+
className,
|
|
19
|
+
renderIcon = Settings,
|
|
20
|
+
iconDescription = defaultIconDescription,
|
|
21
|
+
children,
|
|
22
|
+
menuOptionsClass,
|
|
23
|
+
...rest
|
|
24
|
+
}) => {
|
|
26
25
|
const prefix = usePrefix();
|
|
27
26
|
const toolbarActionClasses = cx(className, `${prefix}--toolbar-action ${prefix}--overflow-menu`);
|
|
28
27
|
const menuOptionsClasses = cx(menuOptionsClass, `${prefix}--toolbar-action__menu`);
|
|
29
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/React.createElement(OverflowMenu, _extends({
|
|
30
29
|
"aria-label": iconDescription,
|
|
31
30
|
renderIcon: renderIcon,
|
|
32
31
|
className: toolbarActionClasses,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import
|
|
11
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
12
12
|
import Search from '../Search/Search.js';
|
|
13
13
|
import '../Search/Search.Skeleton.js';
|
|
14
14
|
import { useId } from '../../internal/useId.js';
|
|
@@ -26,28 +26,27 @@ const translationKeys = {
|
|
|
26
26
|
const translateWithId = id => {
|
|
27
27
|
return translationKeys[id];
|
|
28
28
|
};
|
|
29
|
-
const TableToolbarSearch =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} = _ref;
|
|
29
|
+
const TableToolbarSearch = ({
|
|
30
|
+
className,
|
|
31
|
+
searchContainerClass,
|
|
32
|
+
onChange: onChangeProp,
|
|
33
|
+
onClear = noopFn,
|
|
34
|
+
translateWithId: t = translateWithId,
|
|
35
|
+
placeholder,
|
|
36
|
+
labelText,
|
|
37
|
+
expanded: expandedProp,
|
|
38
|
+
defaultExpanded,
|
|
39
|
+
defaultValue,
|
|
40
|
+
disabled,
|
|
41
|
+
onExpand,
|
|
42
|
+
persistent = false,
|
|
43
|
+
id,
|
|
44
|
+
onBlur,
|
|
45
|
+
onFocus,
|
|
46
|
+
size = 'lg',
|
|
47
|
+
tabIndex = '0',
|
|
48
|
+
...rest
|
|
49
|
+
}) => {
|
|
51
50
|
const {
|
|
52
51
|
current: controlled
|
|
53
52
|
} = useRef(expandedProp !== undefined);
|
|
@@ -78,8 +77,7 @@ const TableToolbarSearch = _ref => {
|
|
|
78
77
|
[`${prefix}--toolbar-search-container-expandable`]: !persistent,
|
|
79
78
|
[`${prefix}--toolbar-search-container-persistent`]: persistent
|
|
80
79
|
});
|
|
81
|
-
const handleExpand =
|
|
82
|
-
let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !expanded;
|
|
80
|
+
const handleExpand = (event, value = !expanded) => {
|
|
83
81
|
if (!disabled) {
|
|
84
82
|
if (!controlled && !persistent) {
|
|
85
83
|
setExpandedState(value);
|
|
@@ -97,7 +95,7 @@ const TableToolbarSearch = _ref => {
|
|
|
97
95
|
};
|
|
98
96
|
const handleOnFocus = event => handleExpand(event, true);
|
|
99
97
|
const handleOnBlur = event => !value && handleExpand(event, false);
|
|
100
|
-
return /*#__PURE__*/
|
|
98
|
+
return /*#__PURE__*/React.createElement(Search, _extends({
|
|
101
99
|
disabled: disabled,
|
|
102
100
|
className: searchClasses,
|
|
103
101
|
value: value,
|
|
@@ -40,10 +40,9 @@ const getNextSortDirection = (prevHeader, header, prevState) => {
|
|
|
40
40
|
// in descending order by default
|
|
41
41
|
return sortStates.ASC;
|
|
42
42
|
};
|
|
43
|
-
const getNextSortState = (props, state,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} = _ref;
|
|
43
|
+
const getNextSortState = (props, state, {
|
|
44
|
+
key
|
|
45
|
+
}) => {
|
|
47
46
|
const {
|
|
48
47
|
sortDirection,
|
|
49
48
|
sortHeaderKey
|
|
@@ -9,20 +9,18 @@
|
|
|
9
9
|
* Filters row IDs based on whether any of the cell values in the row include
|
|
10
10
|
* the input value as a substring. Boolean cell values are ignored.
|
|
11
11
|
*/
|
|
12
|
-
const defaultFilterRows =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = _ref;
|
|
12
|
+
const defaultFilterRows = ({
|
|
13
|
+
rowIds,
|
|
14
|
+
headers,
|
|
15
|
+
cellsById,
|
|
16
|
+
inputValue,
|
|
17
|
+
getCellId
|
|
18
|
+
}) => {
|
|
20
19
|
const normalizedInput = inputValue.trim().toLowerCase();
|
|
21
20
|
if (!normalizedInput) return rowIds;
|
|
22
|
-
return rowIds.filter(rowId => headers.some(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref2;
|
|
21
|
+
return rowIds.filter(rowId => headers.some(({
|
|
22
|
+
key
|
|
23
|
+
}) => {
|
|
26
24
|
const cellId = getCellId(rowId, key);
|
|
27
25
|
const cell = cellsById[cellId];
|
|
28
26
|
if (typeof cell.value === 'boolean') return false;
|
|
@@ -14,8 +14,7 @@ import { getCellId } from './cells.js';
|
|
|
14
14
|
* @param {Array<object>} headers
|
|
15
15
|
* @returns {object}
|
|
16
16
|
*/
|
|
17
|
-
const normalize =
|
|
18
|
-
let prevState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
17
|
+
const normalize = (rows, headers, prevState = {}) => {
|
|
19
18
|
const {
|
|
20
19
|
rowsById: prevRowsByIds
|
|
21
20
|
} = prevState;
|
|
@@ -46,12 +45,11 @@ const normalize = function (rows, headers) {
|
|
|
46
45
|
rowsById[row.id].isSelected = prevRowsByIds[row.id].isSelected;
|
|
47
46
|
rowsById[row.id].isExpanded = prevRowsByIds[row.id].isExpanded;
|
|
48
47
|
}
|
|
49
|
-
headers.forEach((
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} = _ref;
|
|
48
|
+
headers.forEach(({
|
|
49
|
+
key,
|
|
50
|
+
slug,
|
|
51
|
+
decorator
|
|
52
|
+
}, i) => {
|
|
55
53
|
const id = getCellId(row.id, key);
|
|
56
54
|
// Initialize the cell info and state values, namely for editing
|
|
57
55
|
cellsById[id] = {
|
|
@@ -13,8 +13,7 @@ import { sortStates } from '../state/sortStates.js';
|
|
|
13
13
|
* type, the default sort algorithm will be used for those types. Otherwise, the
|
|
14
14
|
* values will be converted to strings for comparison.
|
|
15
15
|
*/
|
|
16
|
-
const compare =
|
|
17
|
-
let locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en';
|
|
16
|
+
const compare = (a, b, locale = 'en') => {
|
|
18
17
|
// prevent multiple null values in one column (sorting breaks)
|
|
19
18
|
if (a === null) a = '';
|
|
20
19
|
if (b === null) b = '';
|
|
@@ -37,8 +36,7 @@ const compare = function (a, b) {
|
|
|
37
36
|
*
|
|
38
37
|
* Note: Uses numeric comparison if strings are numeric.
|
|
39
38
|
*/
|
|
40
|
-
const compareStrings =
|
|
41
|
-
let locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en';
|
|
39
|
+
const compareStrings = (a, b, locale = 'en') => {
|
|
42
40
|
const isNumeric = !isNaN(parseFloat(a)) && !isNaN(parseFloat(b));
|
|
43
41
|
return a.localeCompare(b, locale, {
|
|
44
42
|
numeric: isNumeric
|
|
@@ -47,38 +45,34 @@ const compareStrings = function (a, b) {
|
|
|
47
45
|
/**
|
|
48
46
|
* Sorts table rows based on the provided column key and direction.
|
|
49
47
|
*/
|
|
50
|
-
const sortRows =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
const sortRows = ({
|
|
49
|
+
rowIds,
|
|
50
|
+
cellsById,
|
|
51
|
+
sortDirection,
|
|
52
|
+
key,
|
|
53
|
+
locale = 'en',
|
|
54
|
+
sortRow = defaultSortRow
|
|
55
|
+
}) => rowIds.slice().sort((a, b) => {
|
|
56
|
+
const cellA = cellsById[getCellId(a, key)];
|
|
57
|
+
const cellB = cellsById[getCellId(b, key)];
|
|
58
|
+
return sortRow(cellA?.value, cellB?.value, {
|
|
55
59
|
key,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const cellB = cellsById[getCellId(b, key)];
|
|
62
|
-
return sortRow(cellA?.value, cellB?.value, {
|
|
63
|
-
key,
|
|
64
|
-
sortDirection,
|
|
65
|
-
sortStates,
|
|
66
|
-
locale,
|
|
67
|
-
compare,
|
|
68
|
-
rowIds: [a, b]
|
|
69
|
-
});
|
|
60
|
+
sortDirection,
|
|
61
|
+
sortStates,
|
|
62
|
+
locale,
|
|
63
|
+
compare,
|
|
64
|
+
rowIds: [a, b]
|
|
70
65
|
});
|
|
71
|
-
};
|
|
66
|
+
});
|
|
72
67
|
|
|
73
68
|
/**
|
|
74
69
|
* Sorts table rows based on the sort direction.
|
|
75
70
|
*/
|
|
76
|
-
const defaultSortRow = (cellA, cellB,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} = _ref2;
|
|
71
|
+
const defaultSortRow = (cellA, cellB, {
|
|
72
|
+
sortDirection,
|
|
73
|
+
sortStates,
|
|
74
|
+
locale
|
|
75
|
+
}) => {
|
|
82
76
|
if (sortDirection === sortStates.ASC) {
|
|
83
77
|
return compare(cellA, cellB, locale);
|
|
84
78
|
}
|