@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
|
@@ -46,7 +46,6 @@ var TableToolbarMenu = require('./TableToolbarMenu.js');
|
|
|
46
46
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
47
47
|
|
|
48
48
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
49
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
50
49
|
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
51
50
|
|
|
52
51
|
const getInstanceId = setupGetInstanceId.setupGetInstanceId();
|
|
@@ -86,29 +85,23 @@ const translateWithId = id => defaultTranslations[id];
|
|
|
86
85
|
* and updating the state of the single entity will cascade updates to the
|
|
87
86
|
* consumer.
|
|
88
87
|
*/
|
|
89
|
-
class DataTable extends
|
|
88
|
+
class DataTable extends React.Component {
|
|
90
89
|
constructor(_props) {
|
|
91
|
-
var _this;
|
|
92
90
|
super(_props);
|
|
93
|
-
_this = this;
|
|
94
91
|
_rollupPluginBabelHelpers.defineProperty(this, "instanceId", void 0);
|
|
92
|
+
// TODO: Replace with a `type` when this component is converted to a
|
|
93
|
+
// functional component.
|
|
94
|
+
_rollupPluginBabelHelpers.defineProperty(this, "rp", void 0);
|
|
95
95
|
/**
|
|
96
96
|
* Get the props associated with the given header. Mostly used for adding in
|
|
97
97
|
* sorting behavior.
|
|
98
|
-
*
|
|
99
|
-
* @param {object} config
|
|
100
|
-
* @param {string} config.header the header we want the props for
|
|
101
|
-
* @param {Function} config.onClick a custom click handler for the header
|
|
102
|
-
* @param {boolean} config.isSortable
|
|
103
|
-
* @returns {object}
|
|
104
98
|
*/
|
|
105
|
-
_rollupPluginBabelHelpers.defineProperty(this, "getHeaderProps",
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
} = _ref;
|
|
99
|
+
_rollupPluginBabelHelpers.defineProperty(this, "getHeaderProps", ({
|
|
100
|
+
header,
|
|
101
|
+
onClick,
|
|
102
|
+
isSortable = this.props.isSortable,
|
|
103
|
+
...rest
|
|
104
|
+
}) => {
|
|
112
105
|
const {
|
|
113
106
|
sortDirection,
|
|
114
107
|
sortHeaderKey
|
|
@@ -136,26 +129,20 @@ class DataTable extends React__default["default"].Component {
|
|
|
136
129
|
});
|
|
137
130
|
/**
|
|
138
131
|
* Get the props associated with the given expand header.
|
|
139
|
-
*
|
|
140
|
-
* @param {object} config
|
|
141
|
-
* @param {Function} config.onClick a custom click handler for the expand header
|
|
142
|
-
* @param {Function} config.onExpand a custom click handler called when header is expanded
|
|
143
|
-
* @returns {object}
|
|
144
132
|
*/
|
|
145
|
-
_rollupPluginBabelHelpers.defineProperty(this, "getExpandHeaderProps",
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
133
|
+
_rollupPluginBabelHelpers.defineProperty(this, "getExpandHeaderProps", ({
|
|
134
|
+
onClick,
|
|
135
|
+
onExpand,
|
|
136
|
+
...rest
|
|
137
|
+
} = {}) => {
|
|
151
138
|
const {
|
|
152
139
|
translateWithId: t = translateWithId
|
|
153
|
-
} =
|
|
140
|
+
} = this.props;
|
|
154
141
|
const {
|
|
155
142
|
isExpandedAll,
|
|
156
143
|
rowIds,
|
|
157
144
|
rowsById
|
|
158
|
-
} =
|
|
145
|
+
} = this.state;
|
|
159
146
|
const isExpanded = isExpandedAll || rowIds.every(id => rowsById[id].isExpanded);
|
|
160
147
|
const translationKey = isExpanded ? translationKeys.collapseAll : translationKeys.expandAll;
|
|
161
148
|
return {
|
|
@@ -166,45 +153,31 @@ class DataTable extends React__default["default"].Component {
|
|
|
166
153
|
isExpanded,
|
|
167
154
|
// Compose the event handlers so we don't overwrite a consumer's `onClick`
|
|
168
155
|
// handler
|
|
169
|
-
onExpand: events.composeEventHandlers([
|
|
156
|
+
onExpand: events.composeEventHandlers([this.handleOnExpandAll, onExpand, onClick && this.handleOnExpandHeaderClick(onClick, {
|
|
170
157
|
isExpanded
|
|
171
158
|
})])
|
|
172
159
|
};
|
|
173
160
|
});
|
|
174
161
|
/**
|
|
175
162
|
* Decorate consumer's `onClick` event handler with sort parameters
|
|
176
|
-
*
|
|
177
|
-
* @param {Function} onClick
|
|
178
|
-
* @param {object} sortParams
|
|
179
|
-
* @returns {Function}
|
|
180
163
|
*/
|
|
181
164
|
_rollupPluginBabelHelpers.defineProperty(this, "handleOnHeaderClick", (onClick, sortParams) => {
|
|
182
|
-
return
|
|
165
|
+
return event => onClick(event, sortParams);
|
|
183
166
|
});
|
|
184
167
|
/**
|
|
185
|
-
* Decorate consumer's `onClick` event handler with
|
|
186
|
-
*
|
|
187
|
-
* @param {Function} onClick
|
|
188
|
-
* @param {object} expandParams
|
|
189
|
-
* @returns {Function}
|
|
168
|
+
* Decorate consumer's `onClick` event handler with expand parameters
|
|
190
169
|
*/
|
|
191
170
|
_rollupPluginBabelHelpers.defineProperty(this, "handleOnExpandHeaderClick", (onClick, expandParams) => {
|
|
192
|
-
return
|
|
171
|
+
return event => onClick(event, expandParams);
|
|
193
172
|
});
|
|
194
173
|
/**
|
|
195
174
|
* Get the props associated with the given row. Mostly used for expansion.
|
|
196
|
-
*
|
|
197
|
-
* @param {object} config
|
|
198
|
-
* @param {object} config.row the row we want the props for
|
|
199
|
-
* @param {Function} config.onClick a custom click handler for the header
|
|
200
|
-
* @returns {object}
|
|
201
175
|
*/
|
|
202
|
-
_rollupPluginBabelHelpers.defineProperty(this, "getRowProps",
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
} = _ref2;
|
|
176
|
+
_rollupPluginBabelHelpers.defineProperty(this, "getRowProps", ({
|
|
177
|
+
row,
|
|
178
|
+
onClick,
|
|
179
|
+
...rest
|
|
180
|
+
}) => {
|
|
208
181
|
const {
|
|
209
182
|
translateWithId: t = translateWithId
|
|
210
183
|
} = this.props;
|
|
@@ -224,16 +197,11 @@ class DataTable extends React__default["default"].Component {
|
|
|
224
197
|
});
|
|
225
198
|
/**
|
|
226
199
|
* Get the props associated with an expanded row
|
|
227
|
-
*
|
|
228
|
-
* @param {object} config
|
|
229
|
-
* @param {object} config.row the parent row we want the props for
|
|
230
|
-
* @returns {object}
|
|
231
200
|
*/
|
|
232
|
-
_rollupPluginBabelHelpers.defineProperty(this, "getExpandedRowProps",
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
} = _ref3;
|
|
201
|
+
_rollupPluginBabelHelpers.defineProperty(this, "getExpandedRowProps", ({
|
|
202
|
+
row,
|
|
203
|
+
...rest
|
|
204
|
+
}) => {
|
|
237
205
|
return {
|
|
238
206
|
...rest,
|
|
239
207
|
id: `expanded-row-${row.id}`
|
|
@@ -244,15 +212,14 @@ class DataTable extends React__default["default"].Component {
|
|
|
244
212
|
* applicable. Most often used to indicate selection status of the table or
|
|
245
213
|
* for a specific row.
|
|
246
214
|
*/
|
|
247
|
-
_rollupPluginBabelHelpers.defineProperty(this, "getSelectionProps",
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
215
|
+
_rollupPluginBabelHelpers.defineProperty(this, "getSelectionProps", ({
|
|
216
|
+
onClick,
|
|
217
|
+
row,
|
|
218
|
+
...rest
|
|
219
|
+
} = {}) => {
|
|
253
220
|
const {
|
|
254
221
|
translateWithId: t = translateWithId
|
|
255
|
-
} =
|
|
222
|
+
} = this.props;
|
|
256
223
|
|
|
257
224
|
// If we're given a row, return the selection state values for that row
|
|
258
225
|
if (row) {
|
|
@@ -260,19 +227,19 @@ class DataTable extends React__default["default"].Component {
|
|
|
260
227
|
return {
|
|
261
228
|
...rest,
|
|
262
229
|
checked: row.isSelected,
|
|
263
|
-
onSelect: events.composeEventHandlers([
|
|
264
|
-
id: `${
|
|
265
|
-
name: `select-row-${
|
|
230
|
+
onSelect: events.composeEventHandlers([this.handleOnSelectRow(row.id), onClick]),
|
|
231
|
+
id: `${this.getTablePrefix()}__select-row-${row.id}`,
|
|
232
|
+
name: `select-row-${this.instanceId}`,
|
|
266
233
|
'aria-label': t(translationKey),
|
|
267
234
|
disabled: row.disabled,
|
|
268
|
-
radio:
|
|
235
|
+
radio: this.props.radio
|
|
269
236
|
};
|
|
270
237
|
}
|
|
271
238
|
|
|
272
239
|
// Otherwise, we're working on `TableSelectAll` which handles toggling the
|
|
273
240
|
// selection state of all rows.
|
|
274
|
-
const rowCount =
|
|
275
|
-
const selectedRowCount =
|
|
241
|
+
const rowCount = this.state.rowIds.length;
|
|
242
|
+
const selectedRowCount = this.getSelectedRows().length;
|
|
276
243
|
const checked = rowCount > 0 && selectedRowCount === rowCount;
|
|
277
244
|
const indeterminate = rowCount > 0 && selectedRowCount > 0 && selectedRowCount !== rowCount;
|
|
278
245
|
const translationKey = checked || indeterminate ? translationKeys.unselectAll : translationKeys.selectAll;
|
|
@@ -280,41 +247,36 @@ class DataTable extends React__default["default"].Component {
|
|
|
280
247
|
...rest,
|
|
281
248
|
'aria-label': t(translationKey),
|
|
282
249
|
checked,
|
|
283
|
-
id: `${
|
|
250
|
+
id: `${this.getTablePrefix()}__select-all`,
|
|
284
251
|
indeterminate,
|
|
285
|
-
name: `select-all-${
|
|
286
|
-
onSelect: events.composeEventHandlers([
|
|
252
|
+
name: `select-all-${this.instanceId}`,
|
|
253
|
+
onSelect: events.composeEventHandlers([this.handleSelectAll, onClick])
|
|
287
254
|
};
|
|
288
255
|
});
|
|
289
|
-
_rollupPluginBabelHelpers.defineProperty(this, "getToolbarProps",
|
|
290
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
256
|
+
_rollupPluginBabelHelpers.defineProperty(this, "getToolbarProps", props => {
|
|
291
257
|
const {
|
|
292
258
|
size
|
|
293
|
-
} =
|
|
259
|
+
} = this.props;
|
|
294
260
|
const isSmall = size === 'xs' || size === 'sm';
|
|
295
261
|
return {
|
|
296
262
|
...props,
|
|
297
263
|
size: isSmall ? 'sm' : undefined
|
|
298
264
|
};
|
|
299
265
|
});
|
|
300
|
-
_rollupPluginBabelHelpers.defineProperty(this, "getBatchActionProps",
|
|
301
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
266
|
+
_rollupPluginBabelHelpers.defineProperty(this, "getBatchActionProps", props => {
|
|
302
267
|
const {
|
|
303
268
|
shouldShowBatchActions
|
|
304
|
-
} =
|
|
305
|
-
const totalSelected =
|
|
269
|
+
} = this.state;
|
|
270
|
+
const totalSelected = this.getSelectedRows().length;
|
|
306
271
|
return {
|
|
307
272
|
onSelectAll: undefined,
|
|
308
|
-
totalCount:
|
|
273
|
+
totalCount: this.state.rowIds.length || 0,
|
|
309
274
|
...props,
|
|
310
275
|
shouldShowBatchActions: shouldShowBatchActions && totalSelected > 0,
|
|
311
276
|
totalSelected,
|
|
312
|
-
onCancel:
|
|
277
|
+
onCancel: this.handleOnCancel
|
|
313
278
|
};
|
|
314
279
|
});
|
|
315
|
-
/**
|
|
316
|
-
* Helper utility to get the Table Props.
|
|
317
|
-
*/
|
|
318
280
|
_rollupPluginBabelHelpers.defineProperty(this, "getTableProps", () => {
|
|
319
281
|
const {
|
|
320
282
|
useZebraStyles,
|
|
@@ -335,9 +297,6 @@ class DataTable extends React__default["default"].Component {
|
|
|
335
297
|
experimentalAutoAlign
|
|
336
298
|
};
|
|
337
299
|
});
|
|
338
|
-
/**
|
|
339
|
-
* Helper utility to get the TableContainer Props.
|
|
340
|
-
*/
|
|
341
300
|
_rollupPluginBabelHelpers.defineProperty(this, "getTableContainerProps", () => {
|
|
342
301
|
const {
|
|
343
302
|
stickyHeader,
|
|
@@ -350,25 +309,24 @@ class DataTable extends React__default["default"].Component {
|
|
|
350
309
|
});
|
|
351
310
|
/**
|
|
352
311
|
* Get the props associated with the given table cell.
|
|
353
|
-
*
|
|
354
|
-
* @param {object} config
|
|
355
|
-
* @param {object} config.cell the cell we want the props for
|
|
356
|
-
* @returns {object}
|
|
357
312
|
*/
|
|
358
|
-
_rollupPluginBabelHelpers.defineProperty(this, "getCellProps",
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
313
|
+
_rollupPluginBabelHelpers.defineProperty(this, "getCellProps", ({
|
|
314
|
+
cell: {
|
|
315
|
+
hasAILabelHeader,
|
|
316
|
+
hasDecoratorHeader
|
|
317
|
+
},
|
|
318
|
+
...rest
|
|
319
|
+
}) => {
|
|
363
320
|
return {
|
|
364
321
|
...rest,
|
|
365
|
-
hasAILabelHeader
|
|
366
|
-
hasDecoratorHeader
|
|
322
|
+
hasAILabelHeader,
|
|
323
|
+
hasDecoratorHeader
|
|
367
324
|
};
|
|
368
325
|
});
|
|
369
326
|
/**
|
|
370
327
|
* Helper utility to get all the currently selected rows
|
|
371
|
-
*
|
|
328
|
+
*
|
|
329
|
+
* @returns the array of rowIds that are currently selected
|
|
372
330
|
*/
|
|
373
331
|
_rollupPluginBabelHelpers.defineProperty(this, "getSelectedRows", () => this.state.rowIds.filter(id => {
|
|
374
332
|
const row = this.state.rowsById[id];
|
|
@@ -376,8 +334,9 @@ class DataTable extends React__default["default"].Component {
|
|
|
376
334
|
}));
|
|
377
335
|
/**
|
|
378
336
|
* Helper utility to get all of the available rows after applying the filter
|
|
379
|
-
*
|
|
380
|
-
*
|
|
337
|
+
*
|
|
338
|
+
* @returns the array of rowIds that are currently included through the filter
|
|
339
|
+
*/
|
|
381
340
|
_rollupPluginBabelHelpers.defineProperty(this, "getFilteredRowIds", () => {
|
|
382
341
|
const {
|
|
383
342
|
filterRows = filter.defaultFilterRows
|
|
@@ -397,15 +356,13 @@ class DataTable extends React__default["default"].Component {
|
|
|
397
356
|
/**
|
|
398
357
|
* Helper for getting the table prefix for elements that require an
|
|
399
358
|
* `id` attribute that is unique.
|
|
400
|
-
*
|
|
401
|
-
* @returns {string}
|
|
402
359
|
*/
|
|
403
360
|
_rollupPluginBabelHelpers.defineProperty(this, "getTablePrefix", () => `data-table-${this.instanceId}`);
|
|
404
361
|
/**
|
|
405
362
|
* Helper for toggling all selected items in a state. Does not call
|
|
406
363
|
* setState, so use it when setting state.
|
|
407
|
-
*
|
|
408
|
-
* @returns
|
|
364
|
+
*
|
|
365
|
+
* @returns object to put into this.setState (use spread operator)
|
|
409
366
|
*/
|
|
410
367
|
_rollupPluginBabelHelpers.defineProperty(this, "setAllSelectedState", (initialState, isSelected, filteredRowIds) => {
|
|
411
368
|
const {
|
|
@@ -455,9 +412,6 @@ class DataTable extends React__default["default"].Component {
|
|
|
455
412
|
});
|
|
456
413
|
/**
|
|
457
414
|
* Handler for toggling the selection state of a given row.
|
|
458
|
-
*
|
|
459
|
-
* @param {string} rowId
|
|
460
|
-
* @returns {Function}
|
|
461
415
|
*/
|
|
462
416
|
_rollupPluginBabelHelpers.defineProperty(this, "handleOnSelectRow", rowId => () => {
|
|
463
417
|
this.setState(state => {
|
|
@@ -502,9 +456,6 @@ class DataTable extends React__default["default"].Component {
|
|
|
502
456
|
});
|
|
503
457
|
/**
|
|
504
458
|
* Handler for toggling the expansion state of a given row.
|
|
505
|
-
*
|
|
506
|
-
* @param {string} rowId
|
|
507
|
-
* @returns {Function}
|
|
508
459
|
*/
|
|
509
460
|
_rollupPluginBabelHelpers.defineProperty(this, "handleOnExpandRow", rowId => () => {
|
|
510
461
|
this.setState(state => {
|
|
@@ -548,8 +499,7 @@ class DataTable extends React__default["default"].Component {
|
|
|
548
499
|
/**
|
|
549
500
|
* Handler for transitioning to the next sort state of the table
|
|
550
501
|
*
|
|
551
|
-
* @param
|
|
552
|
-
* @returns {Function}
|
|
502
|
+
* @param headerKey - The field for the header that we are sorting by.
|
|
553
503
|
*/
|
|
554
504
|
_rollupPluginBabelHelpers.defineProperty(this, "handleSortBy", headerKey => () => {
|
|
555
505
|
this.setState(state => sorting.getNextSortState(this.props, state, {
|
|
@@ -559,8 +509,6 @@ class DataTable extends React__default["default"].Component {
|
|
|
559
509
|
/**
|
|
560
510
|
* Event handler for transitioning input value state changes for the table
|
|
561
511
|
* filter component.
|
|
562
|
-
*
|
|
563
|
-
* @param {Event} event
|
|
564
512
|
*/
|
|
565
513
|
_rollupPluginBabelHelpers.defineProperty(this, "handleOnInputValueChange", (event, defaultValue) => {
|
|
566
514
|
if (event.target) {
|
|
@@ -581,7 +529,7 @@ class DataTable extends React__default["default"].Component {
|
|
|
581
529
|
this.instanceId = getInstanceId();
|
|
582
530
|
}
|
|
583
531
|
|
|
584
|
-
//
|
|
532
|
+
// If state needs to be updated, defer render until after the update completes.
|
|
585
533
|
shouldComponentUpdate(nextProps) {
|
|
586
534
|
if (this.props !== nextProps) {
|
|
587
535
|
const nextRowIds = nextProps.rows.map(row => row.id);
|
|
@@ -649,16 +597,65 @@ class DataTable extends React__default["default"].Component {
|
|
|
649
597
|
expandAll: this.handleOnExpandAll,
|
|
650
598
|
radio: this.props.radio
|
|
651
599
|
};
|
|
652
|
-
if (render !== undefined) {
|
|
600
|
+
if (typeof render !== 'undefined') {
|
|
653
601
|
return render(renderProps);
|
|
654
602
|
}
|
|
655
|
-
if (children !== undefined) {
|
|
603
|
+
if (typeof children !== 'undefined') {
|
|
656
604
|
return children(renderProps);
|
|
657
605
|
}
|
|
658
606
|
return null;
|
|
659
607
|
}
|
|
660
608
|
}
|
|
661
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "
|
|
609
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "translationKeys", Object.values(translationKeys));
|
|
610
|
+
// TODO: Delete these static properties when the components are converted to a
|
|
611
|
+
// functional component.
|
|
612
|
+
//
|
|
613
|
+
// Static properties for sub-components
|
|
614
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "Table", void 0);
|
|
615
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableActionList", void 0);
|
|
616
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableBatchAction", void 0);
|
|
617
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableBatchActions", void 0);
|
|
618
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableBody", void 0);
|
|
619
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableCell", void 0);
|
|
620
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableContainer", void 0);
|
|
621
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableDecoratorRow", void 0);
|
|
622
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableExpandHeader", void 0);
|
|
623
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableExpandRow", void 0);
|
|
624
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableExpandedRow", void 0);
|
|
625
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableHead", void 0);
|
|
626
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableHeader", void 0);
|
|
627
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableRow", void 0);
|
|
628
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSelectAll", void 0);
|
|
629
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSelectRow", void 0);
|
|
630
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSlugRow", void 0);
|
|
631
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbar", void 0);
|
|
632
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarAction", void 0);
|
|
633
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarContent", void 0);
|
|
634
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarSearch", void 0);
|
|
635
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarMenu", void 0);
|
|
636
|
+
DataTable.Table = Table.Table;
|
|
637
|
+
DataTable.TableActionList = TableActionList["default"];
|
|
638
|
+
DataTable.TableBatchAction = TableBatchAction["default"];
|
|
639
|
+
DataTable.TableBatchActions = TableBatchActions["default"];
|
|
640
|
+
DataTable.TableBody = TableBody["default"];
|
|
641
|
+
DataTable.TableCell = TableCell["default"];
|
|
642
|
+
DataTable.TableContainer = TableContainer["default"];
|
|
643
|
+
DataTable.TableDecoratorRow = TableDecoratorRow["default"];
|
|
644
|
+
DataTable.TableExpandHeader = TableExpandHeader["default"];
|
|
645
|
+
DataTable.TableExpandRow = TableExpandRow["default"];
|
|
646
|
+
DataTable.TableExpandedRow = TableExpandedRow["default"];
|
|
647
|
+
DataTable.TableHead = TableHead["default"];
|
|
648
|
+
DataTable.TableHeader = TableHeader["default"];
|
|
649
|
+
DataTable.TableRow = TableRow["default"];
|
|
650
|
+
DataTable.TableSelectAll = TableSelectAll["default"];
|
|
651
|
+
DataTable.TableSelectRow = TableSelectRow["default"];
|
|
652
|
+
DataTable.TableSlugRow = TableSlugRow["default"];
|
|
653
|
+
DataTable.TableToolbar = TableToolbar["default"];
|
|
654
|
+
DataTable.TableToolbarAction = TableToolbarAction["default"];
|
|
655
|
+
DataTable.TableToolbarContent = TableToolbarContent["default"];
|
|
656
|
+
DataTable.TableToolbarSearch = TableToolbarSearch["default"];
|
|
657
|
+
DataTable.TableToolbarMenu = TableToolbarMenu["default"];
|
|
658
|
+
DataTable.propTypes = {
|
|
662
659
|
/**
|
|
663
660
|
* Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
|
|
664
661
|
*/
|
|
@@ -733,52 +730,6 @@ _rollupPluginBabelHelpers.defineProperty(DataTable, "propTypes", {
|
|
|
733
730
|
* `true` to add useZebraStyles striping.
|
|
734
731
|
*/
|
|
735
732
|
useZebraStyles: PropTypes__default["default"].bool
|
|
736
|
-
}
|
|
737
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "translationKeys", Object.values(translationKeys));
|
|
738
|
-
// Static properties for sub-components
|
|
739
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "Table", void 0);
|
|
740
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableActionList", void 0);
|
|
741
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableBatchAction", void 0);
|
|
742
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableBatchActions", void 0);
|
|
743
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableBody", void 0);
|
|
744
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableCell", void 0);
|
|
745
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableContainer", void 0);
|
|
746
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableDecoratorRow", void 0);
|
|
747
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableExpandHeader", void 0);
|
|
748
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableExpandRow", void 0);
|
|
749
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableExpandedRow", void 0);
|
|
750
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableHead", void 0);
|
|
751
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableHeader", void 0);
|
|
752
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableRow", void 0);
|
|
753
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSelectAll", void 0);
|
|
754
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSelectRow", void 0);
|
|
755
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSlugRow", void 0);
|
|
756
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbar", void 0);
|
|
757
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarAction", void 0);
|
|
758
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarContent", void 0);
|
|
759
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarSearch", void 0);
|
|
760
|
-
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarMenu", void 0);
|
|
761
|
-
DataTable.Table = Table.Table;
|
|
762
|
-
DataTable.TableActionList = TableActionList["default"];
|
|
763
|
-
DataTable.TableBatchAction = TableBatchAction["default"];
|
|
764
|
-
DataTable.TableBatchActions = TableBatchActions["default"];
|
|
765
|
-
DataTable.TableBody = TableBody["default"];
|
|
766
|
-
DataTable.TableCell = TableCell["default"];
|
|
767
|
-
DataTable.TableContainer = TableContainer["default"];
|
|
768
|
-
DataTable.TableDecoratorRow = TableDecoratorRow["default"];
|
|
769
|
-
DataTable.TableExpandHeader = TableExpandHeader["default"];
|
|
770
|
-
DataTable.TableExpandRow = TableExpandRow["default"];
|
|
771
|
-
DataTable.TableExpandedRow = TableExpandedRow["default"];
|
|
772
|
-
DataTable.TableHead = TableHead["default"];
|
|
773
|
-
DataTable.TableHeader = TableHeader["default"];
|
|
774
|
-
DataTable.TableRow = TableRow["default"];
|
|
775
|
-
DataTable.TableSelectAll = TableSelectAll["default"];
|
|
776
|
-
DataTable.TableSelectRow = TableSelectRow["default"];
|
|
777
|
-
DataTable.TableSlugRow = TableSlugRow["default"];
|
|
778
|
-
DataTable.TableToolbar = TableToolbar["default"];
|
|
779
|
-
DataTable.TableToolbarAction = TableToolbarAction["default"];
|
|
780
|
-
DataTable.TableToolbarContent = TableToolbarContent["default"];
|
|
781
|
-
DataTable.TableToolbarSearch = TableToolbarSearch["default"];
|
|
782
|
-
DataTable.TableToolbarMenu = TableToolbarMenu["default"];
|
|
733
|
+
};
|
|
783
734
|
|
|
784
735
|
exports["default"] = DataTable;
|
|
@@ -1,12 +1,12 @@
|
|
|
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
7
|
import { PropsWithChildren } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
interface TableProps {
|
|
9
|
+
export interface TableProps {
|
|
10
10
|
experimentalAutoAlign?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
/**
|
|
@@ -53,20 +53,19 @@ const isElementWrappingContent = (element, context) => {
|
|
|
53
53
|
}
|
|
54
54
|
return false;
|
|
55
55
|
};
|
|
56
|
-
const Table =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} = _ref;
|
|
56
|
+
const Table = ({
|
|
57
|
+
className,
|
|
58
|
+
children,
|
|
59
|
+
useZebraStyles,
|
|
60
|
+
size = 'lg',
|
|
61
|
+
isSortable = false,
|
|
62
|
+
useStaticWidth,
|
|
63
|
+
stickyHeader,
|
|
64
|
+
overflowMenuOnHover = true,
|
|
65
|
+
experimentalAutoAlign = false,
|
|
66
|
+
tabIndex,
|
|
67
|
+
...other
|
|
68
|
+
}) => {
|
|
70
69
|
const {
|
|
71
70
|
titleId,
|
|
72
71
|
descriptionId
|
|
@@ -82,12 +81,10 @@ const Table = _ref => {
|
|
|
82
81
|
[`${prefix}--data-table--sticky-header`]: stickyHeader,
|
|
83
82
|
[`${prefix}--data-table--visible-overflow-menu`]: !overflowMenuOnHover
|
|
84
83
|
});
|
|
85
|
-
const toggleTableBodyAlignmentClass = React.useCallback(
|
|
86
|
-
let alignTop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
84
|
+
const toggleTableBodyAlignmentClass = React.useCallback((alignTop = false) => {
|
|
87
85
|
alignTop ? tableRef.current?.classList.add(`${prefix}--data-table--top-aligned-body`) : tableRef.current?.classList.remove(`${prefix}--data-table--top-aligned-body`);
|
|
88
86
|
}, [prefix]);
|
|
89
|
-
const toggleTableHeaderAlignmentClass = React.useCallback(
|
|
90
|
-
let alignTop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
87
|
+
const toggleTableHeaderAlignmentClass = React.useCallback((alignTop = false) => {
|
|
91
88
|
alignTop ? tableRef.current?.classList.add(`${prefix}--data-table--top-aligned-header`) : tableRef.current?.classList.remove(`${prefix}--data-table--top-aligned-header`);
|
|
92
89
|
}, [prefix]);
|
|
93
90
|
const setTableAlignment = React.useCallback(() => {
|
|
@@ -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 TableActionList: (props: import("
|
|
7
|
+
declare const TableActionList: (props: import("react").HTMLAttributes<"div">) => React.ReactElement<any>;
|
|
8
8
|
export default TableActionList;
|
|
@@ -21,17 +21,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
21
21
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
23
|
|
|
24
|
-
const TableBatchAction =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
iconDescription: iconDescription
|
|
33
|
-
}, props));
|
|
34
|
-
};
|
|
24
|
+
const TableBatchAction = ({
|
|
25
|
+
renderIcon = iconsReact.AddFilled,
|
|
26
|
+
iconDescription = 'Add',
|
|
27
|
+
...props
|
|
28
|
+
}) => /*#__PURE__*/React__default["default"].createElement(Button["default"], _rollupPluginBabelHelpers["extends"]({
|
|
29
|
+
renderIcon: renderIcon,
|
|
30
|
+
iconDescription: iconDescription
|
|
31
|
+
}, props));
|
|
35
32
|
TableBatchAction.propTypes = {
|
|
36
33
|
/**
|
|
37
34
|
* Specify if the button is an icon-only button
|
|
@@ -33,14 +33,13 @@ const translationKeys = {
|
|
|
33
33
|
'carbon.table.batch.item.selected': 'item selected',
|
|
34
34
|
'carbon.table.batch.selectAll': 'Select all'
|
|
35
35
|
};
|
|
36
|
-
const translateWithId =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
36
|
+
const translateWithId = (id, {
|
|
37
|
+
totalSelected,
|
|
38
|
+
totalCount
|
|
39
|
+
} = {
|
|
40
|
+
totalSelected: 0,
|
|
41
|
+
totalCount: 0
|
|
42
|
+
}) => {
|
|
44
43
|
if (id === 'carbon.table.batch.cancel') {
|
|
45
44
|
return translationKeys[id];
|
|
46
45
|
}
|
|
@@ -49,18 +48,17 @@ const translateWithId = function (id) {
|
|
|
49
48
|
}
|
|
50
49
|
return `${totalSelected} ${translationKeys[id]}`;
|
|
51
50
|
};
|
|
52
|
-
const TableBatchActions =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} = _ref;
|
|
51
|
+
const TableBatchActions = ({
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
shouldShowBatchActions,
|
|
55
|
+
totalSelected,
|
|
56
|
+
totalCount,
|
|
57
|
+
onCancel,
|
|
58
|
+
onSelectAll,
|
|
59
|
+
translateWithId: t = translateWithId,
|
|
60
|
+
...rest
|
|
61
|
+
}) => {
|
|
64
62
|
const [isScrolling, setIsScrolling] = React__default["default"].useState(false);
|
|
65
63
|
const prefix = usePrefix.usePrefix();
|
|
66
64
|
const batchActionsClasses = cx__default["default"]({
|
|
@@ -1,12 +1,12 @@
|
|
|
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
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import {
|
|
9
|
-
export interface TableBodyProps extends
|
|
8
|
+
import { type HTMLAttributes } from 'react';
|
|
9
|
+
export interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
10
10
|
/**
|
|
11
11
|
* `polite` Adjust the notification behavior of screen readers
|
|
12
12
|
*/
|