@carbon/react 1.90.0-rc.0 → 1.91.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 +923 -964
- package/es/components/AILabel/index.js +8 -6
- package/es/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/es/components/Button/Button.js +3 -0
- package/es/components/ChatButton/ChatButton.js +1 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +21 -2
- package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +1 -1
- package/es/components/ComboBox/ComboBox.js +18 -13
- package/es/components/ComboButton/index.js +2 -1
- package/es/components/ComposedModal/ComposedModal.js +5 -2
- package/es/components/Copy/Copy.d.ts +1 -1
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/CopyButton/CopyButton.d.ts +1 -1
- package/es/components/CopyButton/CopyButton.js +1 -1
- package/es/components/DataTable/DataTable.d.ts +60 -15
- package/es/components/DataTable/DataTable.js +119 -178
- package/es/components/DataTable/Table.d.ts +2 -2
- package/es/components/DataTable/Table.js +4 -4
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableExpandHeader.js +6 -2
- package/es/components/DataTable/TableExpandRow.js +1 -0
- package/es/components/DataTable/TableHeader.js +2 -0
- package/es/components/DataTable/TableRow.js +5 -0
- package/es/components/DataTable/TableSlugRow.js +1 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -0
- package/es/components/DataTable/state/sorting.d.ts +3 -1
- package/es/components/DataTable/state/sorting.js +2 -0
- package/es/components/DataTable/tools/sorting.js +1 -0
- package/es/components/DatePicker/DatePicker.d.ts +0 -12
- package/es/components/DatePicker/DatePicker.js +17 -6
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
- package/es/components/DatePicker/plugins/rangePlugin.js +18 -14
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/Dialog/Dialog.js +10 -2
- package/es/components/Dropdown/Dropdown.js +17 -16
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/es/components/FeatureFlags/index.js +1 -0
- package/es/components/FileUploader/FileUploader.js +9 -2
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +3 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSearch/FluidSearch.js +3 -2
- package/es/components/FluidSelect/FluidSelect.js +3 -2
- package/es/components/FluidTextInput/FluidTextInput.js +3 -2
- package/es/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/es/components/Grid/CSSGrid.js +5 -0
- package/es/components/Grid/Column.js +3 -0
- package/es/components/Grid/ColumnHang.js +1 -0
- package/es/components/Grid/FlexGrid.js +1 -0
- package/es/components/Grid/Row.js +1 -0
- package/es/components/Heading/index.js +3 -1
- package/es/components/IconButton/index.js +5 -3
- package/es/components/IconIndicator/index.js +4 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/es/components/Layout/index.js +6 -4
- package/es/components/LayoutDirection/LayoutDirection.js +2 -0
- package/es/components/Link/Link.js +3 -0
- package/es/components/ListBox/ListBoxMenuItem.js +4 -1
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/es/components/Menu/Menu.js +6 -9
- package/es/components/Menu/MenuContext.js +1 -0
- package/es/components/Menu/MenuItem.d.ts +1 -1
- package/es/components/Menu/MenuItem.js +10 -18
- package/es/components/MenuButton/index.js +7 -2
- package/es/components/Modal/Modal.js +4 -1
- package/es/components/ModalWrapper/ModalWrapper.js +2 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +25 -6
- package/es/components/MultiSelect/MultiSelect.js +22 -17
- package/es/components/Notification/Notification.d.ts +6 -6
- package/es/components/Notification/Notification.js +7 -7
- package/es/components/NumberInput/NumberInput.js +7 -1
- package/es/components/OverflowMenu/OverflowMenu.js +3 -1
- package/es/components/OverflowMenu/next/index.js +4 -3
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/es/components/PageHeader/PageHeader.d.ts +3 -3
- package/es/components/PageHeader/PageHeader.js +22 -8
- package/es/components/Pagination/Pagination.js +6 -2
- package/es/components/PaginationNav/PaginationNav.js +2 -5
- package/es/components/Popover/index.js +15 -5
- package/es/components/ProgressBar/ProgressBar.js +4 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.d.ts +4 -2
- package/es/components/Search/Search.js +7 -6
- package/es/components/Select/Select.js +2 -3
- package/es/components/ShapeIndicator/index.js +4 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/es/components/SkeletonText/SkeletonText.js +0 -2
- package/es/components/Slider/Slider.d.ts +144 -188
- package/es/components/Slider/Slider.js +798 -726
- package/es/components/Slider/index.d.ts +2 -2
- package/es/components/Stack/HStack.js +1 -0
- package/es/components/Stack/Stack.js +6 -9
- package/es/components/Stack/VStack.js +1 -0
- package/es/components/StructuredList/StructuredList.js +3 -0
- package/es/components/Switch/Switch.js +1 -1
- package/es/components/Tabs/Tabs.d.ts +4 -0
- package/es/components/Tabs/Tabs.js +28 -17
- package/es/components/Tag/DismissibleTag.js +2 -0
- package/es/components/Tag/OperationalTag.js +2 -0
- package/es/components/Tag/SelectableTag.js +2 -0
- package/es/components/Tag/Tag.js +4 -0
- package/es/components/Tag/isEllipsisActive.js +1 -0
- package/es/components/Text/Text.js +1 -0
- package/es/components/TextArea/TextArea.js +13 -6
- package/es/components/TextInput/ControlledPasswordInput.js +4 -6
- package/es/components/TextInput/PasswordInput.js +9 -4
- package/es/components/TextInput/TextInput.js +6 -4
- package/es/components/TextInput/util.d.ts +17 -5
- package/es/components/TextInput/util.js +2 -7
- package/es/components/Theme/index.js +8 -3
- package/es/components/Tile/Tile.js +14 -17
- package/es/components/TimePicker/TimePicker.js +1 -0
- package/es/components/Toggle/Toggle.js +1 -1
- package/es/components/Toggletip/index.js +4 -0
- package/es/components/Tooltip/DefinitionTooltip.js +1 -0
- package/es/components/Tooltip/Tooltip.js +30 -23
- package/es/components/TreeView/TreeNode.js +13 -5
- package/es/components/TreeView/TreeView.js +7 -0
- package/es/components/UIShell/HeaderContainer.js +3 -1
- package/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +3 -3
- package/es/components/UIShell/HeaderPanel.d.ts +1 -1
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/Link.js +2 -0
- package/es/components/UIShell/SideNavItems.js +1 -0
- package/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +1 -1
- package/es/components/UIShell/Switcher.js +2 -1
- package/es/components/UIShell/SwitcherItem.js +4 -2
- package/es/index.d.ts +12 -13
- package/es/index.js +25 -24
- package/es/internal/FloatingMenu.js +7 -1
- package/es/internal/Selection.js +12 -3
- package/es/internal/defaultItemToString.d.ts +7 -0
- package/es/internal/defaultItemToString.js +17 -0
- package/es/internal/index.d.ts +1 -0
- package/es/internal/useMergedRefs.js +1 -0
- package/es/internal/useNoInteractiveChildren.js +4 -0
- package/es/internal/useOutsideClick.js +1 -0
- package/es/internal/useOverflowItems.js +6 -0
- package/es/internal/useResizeObserver.js +4 -0
- package/es/internal/useSavedCallback.js +1 -0
- package/es/internal/warning.js +1 -0
- package/es/prop-types/deprecateValuesWithin.d.ts +8 -1
- package/es/prop-types/deprecateValuesWithin.js +6 -6
- package/es/prop-types/isRequiredOneOf.js +4 -1
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +10 -10
- package/es/tools/events.js +3 -1
- package/es/tools/wrapComponent.js +1 -0
- package/lib/components/AILabel/index.js +8 -6
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/ChatButton/ChatButton.js +1 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +20 -1
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +1 -1
- package/lib/components/ComboBox/ComboBox.js +20 -15
- package/lib/components/ComboButton/index.js +2 -1
- package/lib/components/ComposedModal/ComposedModal.js +5 -2
- package/lib/components/Copy/Copy.d.ts +1 -1
- package/lib/components/Copy/Copy.js +1 -1
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.js +1 -1
- package/lib/components/DataTable/DataTable.d.ts +60 -15
- package/lib/components/DataTable/DataTable.js +119 -178
- package/lib/components/DataTable/Table.d.ts +2 -2
- package/lib/components/DataTable/Table.js +4 -4
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableExpandHeader.js +6 -2
- package/lib/components/DataTable/TableExpandRow.js +1 -0
- package/lib/components/DataTable/TableHeader.js +2 -0
- package/lib/components/DataTable/TableRow.js +5 -0
- package/lib/components/DataTable/TableSlugRow.js +1 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -0
- package/lib/components/DataTable/state/sorting.d.ts +3 -1
- package/lib/components/DataTable/state/sorting.js +2 -0
- package/lib/components/DataTable/tools/sorting.js +1 -0
- package/lib/components/DatePicker/DatePicker.d.ts +0 -12
- package/lib/components/DatePicker/DatePicker.js +16 -5
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
- package/lib/components/DatePicker/plugins/rangePlugin.js +18 -16
- package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
- package/lib/components/Dialog/Dialog.js +10 -2
- package/lib/components/Dropdown/Dropdown.js +19 -18
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/lib/components/FeatureFlags/index.js +1 -0
- package/lib/components/FileUploader/FileUploader.js +9 -2
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +3 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/lib/components/FluidSearch/FluidSearch.js +3 -2
- package/lib/components/FluidSelect/FluidSelect.js +3 -2
- package/lib/components/FluidTextInput/FluidTextInput.js +3 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/lib/components/Grid/CSSGrid.js +5 -0
- package/lib/components/Grid/Column.js +3 -0
- package/lib/components/Grid/ColumnHang.js +1 -0
- package/lib/components/Grid/FlexGrid.js +1 -0
- package/lib/components/Grid/Row.js +1 -0
- package/lib/components/Heading/index.js +3 -1
- package/lib/components/IconButton/index.js +5 -3
- package/lib/components/IconIndicator/index.js +4 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/lib/components/Layout/index.js +6 -4
- package/lib/components/LayoutDirection/LayoutDirection.js +2 -0
- package/lib/components/Link/Link.js +3 -0
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -1
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/lib/components/Menu/Menu.js +6 -9
- package/lib/components/Menu/MenuContext.js +1 -0
- package/lib/components/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +11 -19
- package/lib/components/MenuButton/index.js +7 -2
- package/lib/components/Modal/Modal.js +4 -1
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +32 -13
- package/lib/components/MultiSelect/MultiSelect.js +23 -18
- package/lib/components/Notification/Notification.d.ts +6 -6
- package/lib/components/Notification/Notification.js +7 -7
- package/lib/components/NumberInput/NumberInput.js +7 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +3 -1
- package/lib/components/OverflowMenu/next/index.js +4 -3
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/lib/components/PageHeader/PageHeader.d.ts +3 -3
- package/lib/components/PageHeader/PageHeader.js +22 -8
- package/lib/components/Pagination/Pagination.js +6 -2
- package/lib/components/PaginationNav/PaginationNav.js +2 -5
- package/lib/components/Popover/index.js +15 -5
- package/lib/components/ProgressBar/ProgressBar.js +4 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.d.ts +4 -2
- package/lib/components/Search/Search.js +7 -6
- package/lib/components/Select/Select.js +2 -3
- package/lib/components/ShapeIndicator/index.js +4 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/lib/components/SkeletonText/SkeletonText.js +0 -2
- package/lib/components/Slider/Slider.d.ts +144 -188
- package/lib/components/Slider/Slider.js +795 -725
- package/lib/components/Slider/index.d.ts +2 -2
- package/lib/components/Stack/HStack.js +1 -0
- package/lib/components/Stack/Stack.js +6 -9
- package/lib/components/Stack/VStack.js +1 -0
- package/lib/components/StructuredList/StructuredList.js +3 -0
- package/lib/components/Switch/Switch.js +1 -1
- package/lib/components/Tabs/Tabs.d.ts +4 -0
- package/lib/components/Tabs/Tabs.js +28 -17
- package/lib/components/Tag/DismissibleTag.js +2 -0
- package/lib/components/Tag/OperationalTag.js +2 -0
- package/lib/components/Tag/SelectableTag.js +2 -0
- package/lib/components/Tag/Tag.js +4 -0
- package/lib/components/Tag/isEllipsisActive.js +1 -0
- package/lib/components/Text/Text.js +1 -0
- package/lib/components/TextArea/TextArea.js +13 -6
- package/lib/components/TextInput/ControlledPasswordInput.js +3 -5
- package/lib/components/TextInput/PasswordInput.js +8 -3
- package/lib/components/TextInput/TextInput.js +5 -3
- package/lib/components/TextInput/util.d.ts +17 -5
- package/lib/components/TextInput/util.js +2 -7
- package/lib/components/Theme/index.js +8 -3
- package/lib/components/Tile/Tile.js +14 -17
- package/lib/components/TimePicker/TimePicker.js +1 -0
- package/lib/components/Toggle/Toggle.js +1 -1
- package/lib/components/Toggletip/index.js +4 -0
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
- package/lib/components/Tooltip/Tooltip.js +30 -23
- package/lib/components/TreeView/TreeNode.js +13 -5
- package/lib/components/TreeView/TreeView.js +7 -0
- package/lib/components/UIShell/HeaderContainer.js +3 -1
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +3 -3
- package/lib/components/UIShell/HeaderPanel.d.ts +1 -1
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/Link.js +2 -0
- package/lib/components/UIShell/SideNavItems.js +1 -0
- package/lib/components/UIShell/SideNavMenu.js +2 -2
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +1 -1
- package/lib/components/UIShell/Switcher.js +2 -1
- package/lib/components/UIShell/SwitcherItem.js +4 -2
- package/lib/index.d.ts +12 -13
- package/lib/index.js +51 -28
- package/lib/internal/FloatingMenu.js +7 -1
- package/lib/internal/Selection.js +12 -3
- package/lib/internal/defaultItemToString.d.ts +7 -0
- package/lib/internal/defaultItemToString.js +19 -0
- package/lib/internal/index.d.ts +1 -0
- package/lib/internal/useMergedRefs.js +1 -0
- package/lib/internal/useNoInteractiveChildren.js +4 -0
- package/lib/internal/useOutsideClick.js +1 -0
- package/lib/internal/useOverflowItems.js +6 -0
- package/lib/internal/useResizeObserver.js +4 -0
- package/lib/internal/useSavedCallback.js +1 -0
- package/lib/internal/warning.js +1 -0
- package/lib/prop-types/deprecateValuesWithin.d.ts +8 -1
- package/lib/prop-types/deprecateValuesWithin.js +6 -8
- package/lib/prop-types/isRequiredOneOf.js +4 -1
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +10 -12
- package/lib/tools/events.js +3 -1
- package/lib/tools/wrapComponent.js +1 -0
- package/package.json +10 -9
- package/es/components/MultiSelect/tools/itemToString.d.ts +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -21
- package/es/components/Slider/index.js +0 -14
- package/es/internal/createClassWrapper.js +0 -23
- package/lib/components/MultiSelect/tools/itemToString.d.ts +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -23
- package/lib/components/Slider/index.js +0 -20
- package/lib/internal/createClassWrapper.js +0 -25
|
@@ -19,17 +19,19 @@ import { deprecate } from '../../prop-types/deprecate.js';
|
|
|
19
19
|
var _Undo;
|
|
20
20
|
const AILabelContent = /*#__PURE__*/React.forwardRef(function AILabelContent({
|
|
21
21
|
className,
|
|
22
|
-
children
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
children
|
|
23
|
+
}, ref // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
24
|
+
) {
|
|
25
25
|
const prefix = usePrefix();
|
|
26
26
|
const hasAILabelActions = React.Children.toArray(children).some(child => {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
27
28
|
const item = child;
|
|
28
29
|
// TODO: Is there supposed to be a `return` here? If so, this issue would
|
|
29
30
|
// have been caught by ESLint. It's concerning that this code is 7 months
|
|
30
31
|
// old and no one has noticed any issues with it. It also makes me question
|
|
31
32
|
// whether the code is necessary.
|
|
32
33
|
// https://github.com/carbon-design-system/carbon/issues/18991
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
33
35
|
item.type === AILabelActions;
|
|
34
36
|
});
|
|
35
37
|
const aiLabelContentClasses = cx(className, {
|
|
@@ -53,9 +55,9 @@ AILabelContent.propTypes = {
|
|
|
53
55
|
};
|
|
54
56
|
const AILabelActions = /*#__PURE__*/React.forwardRef(function AILabelActions({
|
|
55
57
|
className,
|
|
56
|
-
children
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
children
|
|
59
|
+
}, ref // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
60
|
+
) {
|
|
59
61
|
const prefix = usePrefix();
|
|
60
62
|
const aiLabelActionsClasses = cx(className, {
|
|
61
63
|
[`${prefix}--ai-label-actions`]: true
|
|
@@ -33,6 +33,8 @@ const BreadcrumbItem = frFn((props, ref) => {
|
|
|
33
33
|
[`${prefix}--breadcrumb-item--current`]: isCurrentPage && ariaCurrent !== 'page',
|
|
34
34
|
[customClassName]: !!customClassName
|
|
35
35
|
});
|
|
36
|
+
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
36
38
|
const child = children;
|
|
37
39
|
if (child.type && child.type.displayName !== undefined && child.type.displayName.includes('OverflowMenu')) {
|
|
38
40
|
const horizontalOverflowIcon = /*#__PURE__*/React.createElement(OverflowMenuHorizontal, {
|
|
@@ -21,6 +21,8 @@ function isIconOnlyButton(hasIconOnly, _kind) {
|
|
|
21
21
|
}
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
24
26
|
const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
25
27
|
const {
|
|
26
28
|
as,
|
|
@@ -43,6 +45,7 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
43
45
|
...rest
|
|
44
46
|
} = props;
|
|
45
47
|
if (ButtonImageElement && !children && !iconDescription) {
|
|
48
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
46
49
|
console.error('Button: renderIcon property specified without also providing an iconDescription property. ' + 'This may impact accessibility for screen reader users.');
|
|
47
50
|
}
|
|
48
51
|
const iconOnlyImage = !ButtonImageElement ? null : /*#__PURE__*/React.createElement(ButtonImageElement, null);
|
|
@@ -38,6 +38,7 @@ const ChatButton = /*#__PURE__*/React.forwardRef(function ChatButton({
|
|
|
38
38
|
} else {
|
|
39
39
|
// Check if size is valid and warn if not
|
|
40
40
|
if (size && !allowedSizes.includes(size)) {
|
|
41
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
41
42
|
console.error(`Invalid size "${size}" provided to ChatButton. Size must be one of: ${allowedSizes.join(', ')}. Defaulting to "lg".`);
|
|
42
43
|
size = 'lg';
|
|
43
44
|
}
|
|
@@ -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 React, { cloneElement } from 'react';
|
|
10
|
+
import React, { Children, isValidElement, cloneElement } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
@@ -15,6 +15,8 @@ import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
|
15
15
|
import { useId } from '../../internal/useId.js';
|
|
16
16
|
import { AILabel } from '../AILabel/index.js';
|
|
17
17
|
import { isComponentElement } from '../../internal/utils.js';
|
|
18
|
+
import Checkbox from '../Checkbox/Checkbox.js';
|
|
19
|
+
import '../Checkbox/Checkbox.Skeleton.js';
|
|
18
20
|
|
|
19
21
|
const CheckboxGroup = ({
|
|
20
22
|
children,
|
|
@@ -57,6 +59,23 @@ const CheckboxGroup = ({
|
|
|
57
59
|
size: 'mini',
|
|
58
60
|
kind: 'default'
|
|
59
61
|
}) : null;
|
|
62
|
+
const clonedChildren = Children.map(children, child => {
|
|
63
|
+
if (/*#__PURE__*/isValidElement(child) && child.type === Checkbox) {
|
|
64
|
+
const childProps = {
|
|
65
|
+
...(typeof invalid !== 'undefined' && typeof child.props.invalid === 'undefined' ? {
|
|
66
|
+
invalid
|
|
67
|
+
} : {}),
|
|
68
|
+
...(typeof readOnly !== 'undefined' && typeof child.props.readOnly === 'undefined' ? {
|
|
69
|
+
readOnly
|
|
70
|
+
} : {}),
|
|
71
|
+
...(typeof warn !== 'undefined' && typeof child.props.warn === 'undefined' ? {
|
|
72
|
+
warn
|
|
73
|
+
} : {})
|
|
74
|
+
};
|
|
75
|
+
return Object.keys(childProps).length ? /*#__PURE__*/cloneElement(child, childProps) : child;
|
|
76
|
+
}
|
|
77
|
+
return child;
|
|
78
|
+
});
|
|
60
79
|
return /*#__PURE__*/React.createElement("fieldset", _extends({
|
|
61
80
|
className: fieldsetClasses,
|
|
62
81
|
"data-invalid": invalid ? true : undefined,
|
|
@@ -68,7 +87,7 @@ const CheckboxGroup = ({
|
|
|
68
87
|
id: legendId || rest['aria-labelledby']
|
|
69
88
|
}, legendText, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
|
|
70
89
|
className: `${prefix}--checkbox-group-inner--decorator`
|
|
71
|
-
}, normalizedDecorator) : ''),
|
|
90
|
+
}, normalizedDecorator) : ''), clonedChildren, /*#__PURE__*/React.createElement("div", {
|
|
72
91
|
className: `${prefix}--checkbox-group__validation-msg`
|
|
73
92
|
}, !readOnly && invalid && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WarningFilled, {
|
|
74
93
|
className: `${prefix}--checkbox__invalid-icon`
|
|
@@ -111,7 +111,7 @@ declare namespace CodeSnippet {
|
|
|
111
111
|
/**
|
|
112
112
|
* Specify how the trigger should align with the tooltip
|
|
113
113
|
*/
|
|
114
|
-
align:
|
|
114
|
+
align: PropTypes.Requireable<string> | PropTypes.Validator<string>;
|
|
115
115
|
/**
|
|
116
116
|
* Specify a label to be read by screen readers on the containing textbox
|
|
117
117
|
* node
|
|
@@ -19,7 +19,7 @@ import { useId } from '../../internal/useId.js';
|
|
|
19
19
|
import copy from 'copy-to-clipboard';
|
|
20
20
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
21
21
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
22
|
-
import deprecateValuesWithin from '../../prop-types/deprecateValuesWithin.js';
|
|
22
|
+
import { deprecateValuesWithin } from '../../prop-types/deprecateValuesWithin.js';
|
|
23
23
|
import { mapPopoverAlign } from '../../tools/mapPopoverAlign.js';
|
|
24
24
|
|
|
25
25
|
const rowHeightInPixels = 16;
|
|
@@ -27,6 +27,7 @@ import { FormContext } from '../FluidForm/FormContext.js';
|
|
|
27
27
|
import { useFloating, autoUpdate, flip, hide } from '@floating-ui/react';
|
|
28
28
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
29
29
|
import { AILabel } from '../AILabel/index.js';
|
|
30
|
+
import { defaultItemToString } from '../../internal/defaultItemToString.js';
|
|
30
31
|
import { isComponentElement } from '../../internal/utils.js';
|
|
31
32
|
import { ListBoxSizePropType } from '../ListBox/ListBoxPropTypes.js';
|
|
32
33
|
import { Text } from '../Text/Text.js';
|
|
@@ -43,18 +44,6 @@ const {
|
|
|
43
44
|
ItemClick,
|
|
44
45
|
FunctionSelectItem
|
|
45
46
|
} = useCombobox.stateChangeTypes;
|
|
46
|
-
const defaultItemToString = item => {
|
|
47
|
-
if (typeof item === 'string') {
|
|
48
|
-
return item;
|
|
49
|
-
}
|
|
50
|
-
if (typeof item === 'number') {
|
|
51
|
-
return `${item}`;
|
|
52
|
-
}
|
|
53
|
-
if (item !== null && typeof item === 'object' && 'label' in item && typeof item['label'] === 'string') {
|
|
54
|
-
return item['label'];
|
|
55
|
-
}
|
|
56
|
-
return '';
|
|
57
|
-
};
|
|
58
47
|
const defaultShouldFilterItem = () => true;
|
|
59
48
|
const autocompleteCustomFilter = ({
|
|
60
49
|
item,
|
|
@@ -180,6 +169,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
180
169
|
refs.floating.current.style.width = parentWidth + 'px';
|
|
181
170
|
}
|
|
182
171
|
}
|
|
172
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
183
173
|
}, [enableFloatingStyles, floatingStyles, refs.floating, parentWidth]);
|
|
184
174
|
const [inputValue, setInputValue] = useState(getInputValue({
|
|
185
175
|
initialSelectedItem,
|
|
@@ -209,6 +199,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
209
199
|
}
|
|
210
200
|
prevInputLengthRef.current = inputValue.length;
|
|
211
201
|
}
|
|
202
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
212
203
|
}, [typeahead, inputValue, items, itemToString, autocompleteCustomFilter]);
|
|
213
204
|
const isManualClearingRef = useRef(false);
|
|
214
205
|
const [isClearing, setIsClearing] = useState(false);
|
|
@@ -249,6 +240,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
249
240
|
}
|
|
250
241
|
prevSelectedItemProp.current = selectedItemProp;
|
|
251
242
|
}
|
|
243
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
252
244
|
}, [selectedItemProp]);
|
|
253
245
|
const filterItems = (items, itemToString, inputValue) => items.filter(item => typeahead ? autocompleteCustomFilter({
|
|
254
246
|
item: itemToString(item),
|
|
@@ -263,8 +255,10 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
263
255
|
useEffect(() => {
|
|
264
256
|
if (prevInputValue.current !== inputValue) {
|
|
265
257
|
prevInputValue.current = inputValue;
|
|
258
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
266
259
|
onInputChange && onInputChange(inputValue);
|
|
267
260
|
}
|
|
261
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
268
262
|
}, [inputValue]);
|
|
269
263
|
const handleSelectionClear = () => {
|
|
270
264
|
if (textInput?.current) {
|
|
@@ -317,6 +311,8 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
317
311
|
if (state.highlightedIndex !== -1) {
|
|
318
312
|
const filteredList = filterItems(items, itemToString, inputValue);
|
|
319
313
|
const highlightedItem = filteredList[state.highlightedIndex];
|
|
314
|
+
|
|
315
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
320
316
|
if (highlightedItem && !highlightedItem.disabled) {
|
|
321
317
|
return {
|
|
322
318
|
...changes,
|
|
@@ -328,6 +324,8 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
328
324
|
const autoIndex = indexToHighlight(inputValue);
|
|
329
325
|
if (autoIndex !== -1) {
|
|
330
326
|
const matchingItem = items[autoIndex];
|
|
327
|
+
|
|
328
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
331
329
|
if (matchingItem && !matchingItem.disabled) {
|
|
332
330
|
return {
|
|
333
331
|
...changes,
|
|
@@ -480,8 +478,10 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
480
478
|
onHighlightedIndexChange: ({
|
|
481
479
|
highlightedIndex
|
|
482
480
|
}) => {
|
|
481
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion , valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
483
482
|
if (highlightedIndex > -1 && typeof window !== undefined) {
|
|
484
483
|
const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
|
|
484
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
485
485
|
const highlightedItem = itemArray[highlightedIndex];
|
|
486
486
|
if (highlightedItem) {
|
|
487
487
|
highlightedItem.scrollIntoView({
|
|
@@ -494,7 +494,9 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
494
494
|
initialSelectedItem: initialSelectedItem,
|
|
495
495
|
inputId: id,
|
|
496
496
|
stateReducer,
|
|
497
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
497
498
|
isItemDisabled(item, _index) {
|
|
499
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
498
500
|
return item?.disabled;
|
|
499
501
|
},
|
|
500
502
|
...downshiftProps,
|
|
@@ -531,6 +533,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
531
533
|
toggleMenu
|
|
532
534
|
};
|
|
533
535
|
}
|
|
536
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
534
537
|
}, [closeMenu, openMenu, reset, selectItem, setHighlightedIndex, downshiftSetInputValue, toggleMenu]);
|
|
535
538
|
const buttonProps = getToggleButtonProps({
|
|
536
539
|
disabled: disabled || readOnly,
|
|
@@ -579,7 +582,9 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
579
582
|
// Memoize the value of getMenuProps to avoid an infinite loop
|
|
580
583
|
const menuProps = useMemo(() => getMenuProps({
|
|
581
584
|
ref: enableFloatingStyles ? refs.setFloating : null
|
|
582
|
-
}),
|
|
585
|
+
}),
|
|
586
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
587
|
+
[enableFloatingStyles, deprecatedAriaLabel, ariaLabel, getMenuProps, refs.setFloating]);
|
|
583
588
|
useEffect(() => {
|
|
584
589
|
if (textInput.current) {
|
|
585
590
|
if (inputRef.current && typeaheadText) {
|
|
@@ -21,7 +21,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
21
21
|
import { flip, hide, size, useFloating, autoUpdate } from '@floating-ui/react';
|
|
22
22
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
23
23
|
import mergeRefs from '../../tools/mergeRefs.js';
|
|
24
|
-
import deprecateValuesWithin from '../../prop-types/deprecateValuesWithin.js';
|
|
24
|
+
import { deprecateValuesWithin } from '../../prop-types/deprecateValuesWithin.js';
|
|
25
25
|
import { mapPopoverAlign } from '../../tools/mapPopoverAlign.js';
|
|
26
26
|
|
|
27
27
|
var _ChevronDown;
|
|
@@ -54,6 +54,7 @@ const ComboButton = /*#__PURE__*/React.forwardRef(function ComboButton({
|
|
|
54
54
|
const id = useId('combobutton');
|
|
55
55
|
const prefix = usePrefix();
|
|
56
56
|
const containerRef = useRef(null);
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
57
58
|
let middlewares = [];
|
|
58
59
|
if (!enableOnlyFloatingStyles) {
|
|
59
60
|
middlewares = [flip({
|
|
@@ -16,7 +16,7 @@ import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
|
16
16
|
import mergeRefs from '../../tools/mergeRefs.js';
|
|
17
17
|
import cx from 'classnames';
|
|
18
18
|
import { toggleClass } from '../../tools/toggleClass.js';
|
|
19
|
-
import requiredIfGivenPropIsTruthy from '../../prop-types/requiredIfGivenPropIsTruthy.js';
|
|
19
|
+
import { requiredIfGivenPropIsTruthy } from '../../prop-types/requiredIfGivenPropIsTruthy.js';
|
|
20
20
|
import { wrapFocusWithoutSentinels, wrapFocus, elementOrParentIsFloatingMenu } from '../../internal/wrapFocus.js';
|
|
21
21
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
22
22
|
import { Escape, Tab } from '../../internal/keyboard/keys.js';
|
|
@@ -134,6 +134,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
|
|
|
134
134
|
setWasOpen(!!open);
|
|
135
135
|
toggleClass(document.body, `${prefix}--body--with-modal-open`, !!open);
|
|
136
136
|
}
|
|
137
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
137
138
|
}, [open, wasOpen, prefix]);
|
|
138
139
|
// Remove the document.body className on unmount
|
|
139
140
|
useEffect(() => {
|
|
@@ -209,7 +210,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
|
|
|
209
210
|
}
|
|
210
211
|
const lastContent = modalContent.children[modalContent.children.length - 1];
|
|
211
212
|
const gradientSpacing = modalContent.scrollHeight - lastContent.offsetTop - lastContent.clientHeight;
|
|
212
|
-
for (
|
|
213
|
+
for (const elem of modalContent.children) {
|
|
213
214
|
if (elem.contains(currentActiveNode)) {
|
|
214
215
|
const spaceBelow = modalContent.clientHeight - elem.offsetTop + modalContent.scrollTop - elem.clientHeight;
|
|
215
216
|
if (spaceBelow < gradientSpacing) {
|
|
@@ -276,6 +277,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
|
|
|
276
277
|
return () => {
|
|
277
278
|
document.removeEventListener('keydown', handleEscapeKey, true);
|
|
278
279
|
};
|
|
280
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
279
281
|
}, [open]);
|
|
280
282
|
useEffect(() => {
|
|
281
283
|
if (!enableDialogElement && !open && launcherButtonRef) {
|
|
@@ -307,6 +309,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
|
|
|
307
309
|
focusButton(innerModal.current);
|
|
308
310
|
}
|
|
309
311
|
}
|
|
312
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
310
313
|
}, [open, selectorPrimaryFocus, isOpen]);
|
|
311
314
|
|
|
312
315
|
// AILabel is always size `sm`
|
|
@@ -50,7 +50,7 @@ declare namespace Copy {
|
|
|
50
50
|
/**
|
|
51
51
|
* Specify how the trigger should align with the tooltip
|
|
52
52
|
*/
|
|
53
|
-
align:
|
|
53
|
+
align: PropTypes.Requireable<string> | PropTypes.Validator<string>;
|
|
54
54
|
/**
|
|
55
55
|
* **Experimental**: Will attempt to automatically align the tooltip. Requires
|
|
56
56
|
* React v17+
|
|
@@ -13,7 +13,7 @@ import { composeEventHandlers } from '../../tools/events.js';
|
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
import { IconButton } from '../IconButton/index.js';
|
|
15
15
|
import { noopFn } from '../../internal/noopFn.js';
|
|
16
|
-
import deprecateValuesWithin from '../../prop-types/deprecateValuesWithin.js';
|
|
16
|
+
import { deprecateValuesWithin } from '../../prop-types/deprecateValuesWithin.js';
|
|
17
17
|
import { mapPopoverAlign } from '../../tools/mapPopoverAlign.js';
|
|
18
18
|
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.js';
|
|
19
19
|
|
|
@@ -51,7 +51,7 @@ declare namespace CopyButton {
|
|
|
51
51
|
/**
|
|
52
52
|
* Specify how the trigger should align with the tooltip
|
|
53
53
|
*/
|
|
54
|
-
align:
|
|
54
|
+
align: PropTypes.Requireable<string> | PropTypes.Validator<string>;
|
|
55
55
|
/**
|
|
56
56
|
* **Experimental**: Will attempt to automatically align the tooltip. Requires
|
|
57
57
|
* React v17+
|
|
@@ -14,7 +14,7 @@ import Copy from '../Copy/Copy.js';
|
|
|
14
14
|
import { LayoutConstraint } from '../Layout/index.js';
|
|
15
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
16
|
import { noopFn } from '../../internal/noopFn.js';
|
|
17
|
-
import deprecateValuesWithin from '../../prop-types/deprecateValuesWithin.js';
|
|
17
|
+
import { deprecateValuesWithin } from '../../prop-types/deprecateValuesWithin.js';
|
|
18
18
|
import { mapPopoverAlign } from '../../tools/mapPopoverAlign.js';
|
|
19
19
|
|
|
20
20
|
function CopyButton({
|
|
@@ -20,7 +20,7 @@ declare const translationKeys: {
|
|
|
20
20
|
readonly unselectRow: "carbon.table.row.unselect";
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* Message
|
|
23
|
+
* Message IDs that will be passed to translateWithId().
|
|
24
24
|
*/
|
|
25
25
|
type TranslationKey = (typeof translationKeys)[keyof typeof translationKeys];
|
|
26
26
|
export type DataTableSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -35,7 +35,6 @@ export interface DataTableCell<T> {
|
|
|
35
35
|
header: string;
|
|
36
36
|
};
|
|
37
37
|
hasAILabelHeader?: boolean;
|
|
38
|
-
hasDecoratorHeader?: boolean;
|
|
39
38
|
}
|
|
40
39
|
type DataTableCells<T extends any[]> = {
|
|
41
40
|
[K in keyof T]: DataTableCell<T[K]>;
|
|
@@ -54,8 +53,17 @@ export interface DataTableHeader {
|
|
|
54
53
|
decorator?: ReactElement;
|
|
55
54
|
}
|
|
56
55
|
export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
|
|
56
|
+
/**
|
|
57
|
+
* The headers for the table.
|
|
58
|
+
*/
|
|
57
59
|
headers: DataTableHeader[];
|
|
60
|
+
/**
|
|
61
|
+
* The rows for the table.
|
|
62
|
+
*/
|
|
58
63
|
rows: (DataTableRow<ColTypes> & RowType)[];
|
|
64
|
+
/**
|
|
65
|
+
* The rows that are currently selected.
|
|
66
|
+
*/
|
|
59
67
|
selectedRows: (DataTableRow<ColTypes> & RowType)[];
|
|
60
68
|
getHeaderProps: (options: {
|
|
61
69
|
header: DataTableHeader;
|
|
@@ -154,14 +162,36 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
|
|
|
154
162
|
}) => {
|
|
155
163
|
[key: string]: unknown;
|
|
156
164
|
hasAILabelHeader?: boolean;
|
|
157
|
-
|
|
165
|
+
key: string;
|
|
158
166
|
};
|
|
167
|
+
/**
|
|
168
|
+
* Handles input value changes.
|
|
169
|
+
*/
|
|
159
170
|
onInputChange: (event: ChangeEvent<HTMLInputElement>, defaultValue?: string) => void;
|
|
171
|
+
/**
|
|
172
|
+
* Sorts the table by a specific header.
|
|
173
|
+
*/
|
|
160
174
|
sortBy: (headerKey: string) => void;
|
|
175
|
+
/**
|
|
176
|
+
* Selects all rows.
|
|
177
|
+
*/
|
|
161
178
|
selectAll: () => void;
|
|
179
|
+
/**
|
|
180
|
+
* Selects or deselects a specific row.
|
|
181
|
+
*/
|
|
162
182
|
selectRow: (rowId: string) => void;
|
|
183
|
+
/**
|
|
184
|
+
* Expands or collapses a specific row.
|
|
185
|
+
*/
|
|
163
186
|
expandRow: (rowId: string) => void;
|
|
187
|
+
/**
|
|
188
|
+
* Expands or collapses all rows.
|
|
189
|
+
*/
|
|
164
190
|
expandAll: () => void;
|
|
191
|
+
/**
|
|
192
|
+
* Whether the table is using radio buttons for selection instead of
|
|
193
|
+
* checkboxes.
|
|
194
|
+
*/
|
|
165
195
|
radio: boolean | undefined;
|
|
166
196
|
}
|
|
167
197
|
export interface DataTableProps<RowType, ColTypes extends any[]> extends TranslateWithId<TranslationKey> {
|
|
@@ -179,6 +209,12 @@ export interface DataTableProps<RowType, ColTypes extends any[]> extends Transla
|
|
|
179
209
|
locale?: string;
|
|
180
210
|
overflowMenuOnHover?: boolean;
|
|
181
211
|
radio?: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* @deprecated Use `children` instead. This prop will be removed in
|
|
214
|
+
* the next major version.
|
|
215
|
+
*
|
|
216
|
+
* https://www.patterns.dev/react/render-props-pattern/#children-as-a-function
|
|
217
|
+
*/
|
|
182
218
|
render?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => ReactElement;
|
|
183
219
|
rows: Omit<DataTableRow<ColTypes>, 'cells'>[];
|
|
184
220
|
size?: DataTableSize;
|
|
@@ -188,14 +224,12 @@ export interface DataTableProps<RowType, ColTypes extends any[]> extends Transla
|
|
|
188
224
|
useZebraStyles?: boolean;
|
|
189
225
|
}
|
|
190
226
|
/**
|
|
191
|
-
*
|
|
192
|
-
* subset of their fields in columns, or headers. We prioritize
|
|
193
|
-
* to the state of what we're rendering, so internally we
|
|
194
|
-
* given data and then
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* and updating the state of the single entity will cascade updates to the
|
|
198
|
-
* consumer.
|
|
227
|
+
* DataTable components are used to represent a collection of resources,
|
|
228
|
+
* displaying a subset of their fields in columns, or headers. We prioritize
|
|
229
|
+
* direct updates to the state of what we're rendering, so internally we
|
|
230
|
+
* normalize the given data and then denormalize it at render time. Each part of
|
|
231
|
+
* the DataTable is accessible through look-up by ID, and updating the state of
|
|
232
|
+
* a single entity cascades updates to the consumer.
|
|
199
233
|
*/
|
|
200
234
|
export declare const DataTable: {
|
|
201
235
|
<RowType, ColTypes extends any[]>(props: DataTableProps<RowType, ColTypes>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -266,7 +300,7 @@ export declare const DataTable: {
|
|
|
266
300
|
enableToggle: PropTypes.Requireable<boolean>;
|
|
267
301
|
expandIconDescription: PropTypes.Requireable<string>;
|
|
268
302
|
id: PropTypes.Requireable<string>;
|
|
269
|
-
isExpanded:
|
|
303
|
+
isExpanded: PropTypes.Validator<boolean | null | undefined>;
|
|
270
304
|
onExpand: PropTypes.Requireable<any>;
|
|
271
305
|
};
|
|
272
306
|
};
|
|
@@ -348,6 +382,10 @@ export declare const DataTable: {
|
|
|
348
382
|
};
|
|
349
383
|
TableToolbarMenu: React.FC<import("./TableToolbarMenu").TableToolbarMenuProps>;
|
|
350
384
|
propTypes: {
|
|
385
|
+
/**
|
|
386
|
+
* Pass in the children that will be rendered within the Table
|
|
387
|
+
*/
|
|
388
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
351
389
|
/**
|
|
352
390
|
* 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
|
|
353
391
|
*/
|
|
@@ -383,6 +421,13 @@ export declare const DataTable: {
|
|
|
383
421
|
* Specify whether the control should be a radio button or inline checkbox
|
|
384
422
|
*/
|
|
385
423
|
radio: PropTypes.Requireable<boolean>;
|
|
424
|
+
/**
|
|
425
|
+
* @deprecated Use `children` instead. This prop will be removed in
|
|
426
|
+
* the next major version.
|
|
427
|
+
*
|
|
428
|
+
* https://www.patterns.dev/react/render-props-pattern/#children-as-a-function
|
|
429
|
+
*/
|
|
430
|
+
render: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
|
|
386
431
|
/**
|
|
387
432
|
* The `rows` prop is where you provide us with a list of all the rows that
|
|
388
433
|
* you want to render in the table. The only hard requirement is that this
|
|
@@ -409,13 +454,13 @@ export declare const DataTable: {
|
|
|
409
454
|
*/
|
|
410
455
|
stickyHeader: PropTypes.Requireable<boolean>;
|
|
411
456
|
/**
|
|
412
|
-
* Optional method that takes in a message
|
|
457
|
+
* Optional method that takes in a message ID and returns an
|
|
413
458
|
* internationalized string. See `DataTable.translationKeys` for all
|
|
414
|
-
* available message
|
|
459
|
+
* available message IDs.
|
|
415
460
|
*/
|
|
416
461
|
translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
|
|
417
462
|
/**
|
|
418
|
-
*
|
|
463
|
+
* If `true`, sets the table width to `auto` instead of `100%`.
|
|
419
464
|
*/
|
|
420
465
|
useStaticWidth: PropTypes.Requireable<boolean>;
|
|
421
466
|
/**
|