@carbon/react 1.92.1 → 1.93.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 +1026 -985
- package/es/components/AILabel/index.js +4 -4
- package/es/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/es/components/Button/Button.js +2 -2
- package/es/components/ChatButton/ChatButton.js +1 -1
- package/es/components/Checkbox/Checkbox.js +1 -1
- package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/es/components/ComboBox/ComboBox.d.ts +3 -11
- package/es/components/ComboBox/ComboBox.js +15 -25
- package/es/components/ComboButton/index.d.ts +5 -8
- package/es/components/ComboButton/index.js +9 -12
- package/es/components/ComposedModal/ComposedModal.js +19 -25
- package/es/components/DataTable/DataTable.d.ts +25 -16
- package/es/components/DataTable/DataTable.js +33 -34
- package/es/components/DataTable/Table.js +2 -2
- package/es/components/DataTable/TableBatchActions.d.ts +49 -10
- package/es/components/DataTable/TableBatchActions.js +26 -21
- package/es/components/DataTable/TableExpandHeader.js +2 -2
- package/es/components/DataTable/TableExpandRow.js +1 -1
- package/es/components/DataTable/TableHeader.d.ts +8 -10
- package/es/components/DataTable/TableHeader.js +11 -13
- package/es/components/DataTable/TableRow.js +5 -5
- package/es/components/DataTable/TableSlugRow.js +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +8 -7
- package/es/components/DataTable/TableToolbarSearch.js +11 -11
- package/es/components/DataTable/index.d.ts +2 -2
- package/es/components/DataTable/state/sorting.d.ts +2 -2
- package/es/components/DataTable/state/sorting.js +1 -1
- package/es/components/DataTable/tools/sorting.js +1 -1
- package/es/components/DatePicker/DatePicker.js +9 -9
- package/es/components/DatePickerInput/DatePickerInput.js +5 -5
- package/es/components/Dialog/Dialog.js +6 -6
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.js +8 -8
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
- package/es/components/FileUploader/FileUploader.js +4 -4
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +2 -2
- package/es/components/FluidComboBox/FluidComboBox.d.ts +4 -7
- package/es/components/FluidComboBox/FluidComboBox.js +1 -1
- package/es/components/FluidDropdown/FluidDropdown.d.ts +4 -8
- package/es/components/FluidDropdown/FluidDropdown.js +1 -1
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
- package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
- package/es/components/FluidNumberInput/FluidNumberInput.js +2 -2
- package/es/components/FluidSearch/FluidSearch.js +1 -1
- package/es/components/FluidSelect/FluidSelect.js +1 -1
- package/es/components/FluidTextInput/FluidTextInput.js +1 -1
- package/es/components/FluidTimePicker/FluidTimePicker.js +3 -3
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
- package/es/components/Grid/CSSGrid.js +3 -3
- package/es/components/Grid/Column.js +2 -2
- package/es/components/Grid/ColumnHang.js +1 -1
- package/es/components/Grid/FlexGrid.js +1 -1
- package/es/components/Grid/Row.js +1 -1
- package/es/components/Heading/index.js +2 -2
- package/es/components/IconButton/index.js +2 -2
- package/es/components/IconIndicator/index.js +2 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/es/components/Layout/index.js +2 -2
- package/es/components/LayoutDirection/LayoutDirection.js +1 -1
- package/es/components/Link/Link.js +2 -2
- package/es/components/ListBox/ListBoxField.d.ts +0 -1
- package/es/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
- package/es/components/ListBox/ListBoxMenuIcon.js +10 -6
- package/es/components/ListBox/ListBoxMenuItem.js +2 -2
- package/es/components/ListBox/ListBoxSelection.d.ts +3 -6
- package/es/components/ListBox/ListBoxSelection.js +5 -10
- package/es/components/ListBox/index.d.ts +5 -3
- package/es/components/ListBox/next/ListBoxSelection.d.ts +6 -13
- package/es/components/ListBox/next/ListBoxSelection.js +16 -8
- package/es/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
- package/es/components/ListBox/next/ListBoxTrigger.js +6 -6
- package/es/components/Menu/MenuContext.js +1 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/MenuButton/index.js +5 -5
- package/es/components/Modal/Modal.js +17 -23
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
- package/es/components/MultiSelect/FilterableMultiSelect.js +18 -27
- package/es/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/es/components/MultiSelect/MultiSelect.js +12 -12
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/NumberInput/NumberInput.d.ts +2 -5
- package/es/components/NumberInput/NumberInput.js +13 -18
- package/es/components/OverflowMenu/OverflowMenu.d.ts +2 -2
- package/es/components/OverflowMenu/OverflowMenu.js +4 -4
- package/es/components/OverflowMenu/next/index.d.ts +1 -1
- package/es/components/OverflowMenu/next/index.js +2 -2
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/es/components/PageHeader/PageHeader.js +12 -12
- package/es/components/Pagination/Pagination.js +3 -3
- package/es/components/PaginationNav/PaginationNav.d.ts +6 -9
- package/es/components/PaginationNav/PaginationNav.js +21 -22
- package/es/components/Popover/index.js +8 -8
- package/es/components/ProgressBar/ProgressBar.js +2 -2
- package/es/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
- package/es/components/ProgressIndicator/ProgressIndicator.js +15 -15
- package/es/components/RadioButton/RadioButton.js +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es/components/RadioTile/RadioTile.js +1 -1
- package/es/components/Select/Select.js +7 -5
- package/es/components/ShapeIndicator/index.js +2 -2
- package/es/components/Slider/Slider.d.ts +7 -9
- package/es/components/Slider/Slider.js +16 -20
- package/es/components/Stack/HStack.js +1 -1
- package/es/components/Stack/Stack.js +1 -1
- package/es/components/Stack/VStack.js +1 -1
- package/es/components/StructuredList/StructuredList.js +3 -3
- package/es/components/Tabs/Tabs.js +12 -12
- package/es/components/Tag/DismissibleTag.js +3 -3
- package/es/components/Tag/OperationalTag.js +2 -2
- package/es/components/Tag/SelectableTag.js +2 -2
- package/es/components/Tag/Tag.js +4 -4
- package/es/components/Tag/isEllipsisActive.js +1 -1
- package/es/components/Text/Text.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextInput/PasswordInput.js +4 -4
- package/es/components/TextInput/TextInput.js +3 -3
- package/es/components/Theme/index.js +3 -3
- package/es/components/Tile/Tile.js +3 -3
- package/es/components/TimePicker/TimePicker.js +1 -1
- package/es/components/Toggletip/index.js +4 -4
- package/es/components/Tooltip/DefinitionTooltip.js +1 -1
- package/es/components/Tooltip/Tooltip.js +3 -3
- package/es/components/TreeView/TreeNode.js +6 -6
- package/es/components/TreeView/TreeView.js +5 -5
- package/es/components/UIShell/HeaderContainer.js +1 -1
- package/es/components/UIShell/HeaderMenu.js +1 -1
- package/es/components/UIShell/Link.js +2 -2
- package/es/components/UIShell/SideNavItems.js +1 -1
- package/es/components/UIShell/Switcher.js +1 -1
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/internal/FloatingMenu.js +4 -4
- package/es/internal/Selection.js +6 -6
- package/es/internal/useMergedRefs.js +1 -1
- package/es/internal/useNoInteractiveChildren.js +4 -4
- package/es/internal/useOutsideClick.js +1 -1
- package/es/internal/useOverflowItems.js +6 -6
- package/es/internal/useResizeObserver.js +3 -3
- package/es/internal/useSavedCallback.js +1 -1
- package/es/internal/warning.js +1 -1
- package/es/prop-types/isRequiredOneOf.js +2 -2
- package/es/tools/events.js +1 -1
- package/es/tools/wrapComponent.js +1 -1
- package/es/types/common.d.ts +6 -2
- package/lib/components/AILabel/index.js +4 -4
- package/lib/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/lib/components/Button/Button.js +2 -2
- package/lib/components/ChatButton/ChatButton.js +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +3 -11
- package/lib/components/ComboBox/ComboBox.js +15 -25
- package/lib/components/ComboButton/index.d.ts +5 -8
- package/lib/components/ComboButton/index.js +9 -12
- package/lib/components/ComposedModal/ComposedModal.js +18 -24
- package/lib/components/DataTable/DataTable.d.ts +25 -16
- package/lib/components/DataTable/DataTable.js +33 -34
- package/lib/components/DataTable/Table.js +2 -2
- package/lib/components/DataTable/TableBatchActions.d.ts +49 -10
- package/lib/components/DataTable/TableBatchActions.js +26 -21
- package/lib/components/DataTable/TableExpandHeader.js +2 -2
- package/lib/components/DataTable/TableExpandRow.js +1 -1
- package/lib/components/DataTable/TableHeader.d.ts +8 -10
- package/lib/components/DataTable/TableHeader.js +11 -13
- package/lib/components/DataTable/TableRow.js +5 -5
- package/lib/components/DataTable/TableSlugRow.js +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +8 -7
- package/lib/components/DataTable/TableToolbarSearch.js +11 -11
- package/lib/components/DataTable/index.d.ts +2 -2
- package/lib/components/DataTable/state/sorting.d.ts +2 -2
- package/lib/components/DataTable/state/sorting.js +1 -1
- package/lib/components/DataTable/tools/sorting.js +1 -1
- package/lib/components/DatePicker/DatePicker.js +9 -9
- package/lib/components/DatePickerInput/DatePickerInput.js +5 -5
- package/lib/components/Dialog/Dialog.js +6 -6
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +8 -8
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
- package/lib/components/FileUploader/FileUploader.js +4 -4
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +2 -2
- package/lib/components/FluidComboBox/FluidComboBox.d.ts +4 -7
- package/lib/components/FluidComboBox/FluidComboBox.js +1 -1
- package/lib/components/FluidDropdown/FluidDropdown.d.ts +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.js +1 -1
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
- package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
- package/lib/components/FluidNumberInput/FluidNumberInput.js +2 -2
- package/lib/components/FluidSearch/FluidSearch.js +1 -1
- package/lib/components/FluidSelect/FluidSelect.js +1 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +1 -1
- package/lib/components/FluidTimePicker/FluidTimePicker.js +3 -3
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
- package/lib/components/Grid/CSSGrid.js +3 -3
- package/lib/components/Grid/Column.js +2 -2
- package/lib/components/Grid/ColumnHang.js +1 -1
- package/lib/components/Grid/FlexGrid.js +1 -1
- package/lib/components/Grid/Row.js +1 -1
- package/lib/components/Heading/index.js +2 -2
- package/lib/components/IconButton/index.js +2 -2
- package/lib/components/IconIndicator/index.js +2 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/lib/components/Layout/index.js +2 -2
- package/lib/components/LayoutDirection/LayoutDirection.js +1 -1
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/ListBox/ListBoxField.d.ts +0 -1
- package/lib/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
- package/lib/components/ListBox/ListBoxMenuIcon.js +10 -6
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -2
- package/lib/components/ListBox/ListBoxSelection.d.ts +3 -6
- package/lib/components/ListBox/ListBoxSelection.js +4 -10
- package/lib/components/ListBox/index.d.ts +5 -3
- package/lib/components/ListBox/next/ListBoxSelection.d.ts +6 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +16 -8
- package/lib/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
- package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
- package/lib/components/Menu/MenuContext.js +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/MenuButton/index.js +5 -5
- package/lib/components/Modal/Modal.js +16 -22
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
- package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -27
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/lib/components/MultiSelect/MultiSelect.js +12 -12
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/NumberInput/NumberInput.d.ts +2 -5
- package/lib/components/NumberInput/NumberInput.js +12 -18
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +2 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +4 -4
- package/lib/components/OverflowMenu/next/index.d.ts +1 -1
- package/lib/components/OverflowMenu/next/index.js +2 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/lib/components/PageHeader/PageHeader.js +12 -12
- package/lib/components/Pagination/Pagination.js +3 -3
- package/lib/components/PaginationNav/PaginationNav.d.ts +6 -9
- package/lib/components/PaginationNav/PaginationNav.js +21 -22
- package/lib/components/Popover/index.js +8 -8
- package/lib/components/ProgressBar/ProgressBar.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.js +15 -15
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/lib/components/RadioTile/RadioTile.js +1 -1
- package/lib/components/Select/Select.js +7 -5
- package/lib/components/ShapeIndicator/index.js +2 -2
- package/lib/components/Slider/Slider.d.ts +7 -9
- package/lib/components/Slider/Slider.js +16 -20
- package/lib/components/Stack/HStack.js +1 -1
- package/lib/components/Stack/Stack.js +1 -1
- package/lib/components/Stack/VStack.js +1 -1
- package/lib/components/StructuredList/StructuredList.js +3 -3
- package/lib/components/Tabs/Tabs.js +12 -12
- package/lib/components/Tag/DismissibleTag.js +3 -3
- package/lib/components/Tag/OperationalTag.js +2 -2
- package/lib/components/Tag/SelectableTag.js +2 -2
- package/lib/components/Tag/Tag.js +4 -4
- package/lib/components/Tag/isEllipsisActive.js +1 -1
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextInput/PasswordInput.js +4 -4
- package/lib/components/TextInput/TextInput.js +3 -3
- package/lib/components/Theme/index.js +3 -3
- package/lib/components/Tile/Tile.js +3 -3
- package/lib/components/TimePicker/TimePicker.js +1 -1
- package/lib/components/Toggletip/index.js +4 -4
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -1
- package/lib/components/Tooltip/Tooltip.js +3 -3
- package/lib/components/TreeView/TreeNode.js +6 -6
- package/lib/components/TreeView/TreeView.js +5 -5
- package/lib/components/UIShell/HeaderContainer.js +1 -1
- package/lib/components/UIShell/HeaderMenu.js +1 -1
- package/lib/components/UIShell/Link.js +2 -2
- package/lib/components/UIShell/SideNavItems.js +1 -1
- package/lib/components/UIShell/Switcher.js +1 -1
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/internal/FloatingMenu.js +4 -4
- package/lib/internal/Selection.js +6 -6
- package/lib/internal/useMergedRefs.js +1 -1
- package/lib/internal/useNoInteractiveChildren.js +4 -4
- package/lib/internal/useOutsideClick.js +1 -1
- package/lib/internal/useOverflowItems.js +6 -6
- package/lib/internal/useResizeObserver.js +3 -3
- package/lib/internal/useSavedCallback.js +1 -1
- package/lib/internal/warning.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +2 -2
- package/lib/tools/events.js +1 -1
- package/lib/tools/wrapComponent.js +1 -1
- package/lib/types/common.d.ts +6 -2
- package/package.json +9 -9
|
@@ -34,7 +34,7 @@ const TableSlugRow = ({
|
|
|
34
34
|
// Slug is always size `mini`
|
|
35
35
|
let normalizedSlug;
|
|
36
36
|
if (slug) {
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
38
38
|
normalizedSlug = /*#__PURE__*/React.cloneElement(slug, {
|
|
39
39
|
size: 'mini'
|
|
40
40
|
});
|
|
@@ -19,7 +19,7 @@ var index = require('../OverflowMenu/index.js');
|
|
|
19
19
|
|
|
20
20
|
const defaultIconDescription = 'Settings';
|
|
21
21
|
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- https://github.com/carbon-design-system/carbon/issues/
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
23
23
|
|
|
24
24
|
const TableToolbarMenu = ({
|
|
25
25
|
className,
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { ChangeEvent, FocusEvent, ReactNode } from 'react';
|
|
9
9
|
import { SearchProps } from '../Search';
|
|
10
|
-
import { TranslateWithId } from '../../types/common';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import type { TranslateWithId } from '../../types/common';
|
|
11
|
+
declare const translationIds: {
|
|
12
|
+
readonly 'carbon.table.toolbar.search.label': "carbon.table.toolbar.search.label";
|
|
13
|
+
readonly 'carbon.table.toolbar.search.placeholder': "carbon.table.toolbar.search.placeholder";
|
|
14
|
+
};
|
|
15
|
+
type TranslationKey = keyof typeof translationIds;
|
|
15
16
|
type ExcludedInheritedProps = 'defaultValue' | 'labelText' | 'onBlur' | 'onChange' | 'onExpand' | 'onFocus' | 'tabIndex';
|
|
16
17
|
export type TableToolbarSearchHandleExpand = (event: FocusEvent<HTMLInputElement>, newValue?: boolean) => void;
|
|
17
|
-
export interface TableToolbarSearchProps extends Omit<SearchProps, ExcludedInheritedProps>, TranslateWithId<
|
|
18
|
+
export interface TableToolbarSearchProps extends Omit<SearchProps, ExcludedInheritedProps>, TranslateWithId<TranslationKey> {
|
|
18
19
|
/**
|
|
19
20
|
* Specifies if the search should initially render in an expanded state
|
|
20
21
|
*/
|
|
@@ -138,7 +139,7 @@ declare const TableToolbarSearch: {
|
|
|
138
139
|
*/
|
|
139
140
|
tabIndex: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
140
141
|
/**
|
|
141
|
-
*
|
|
142
|
+
* Translates component strings using your i18n tool.
|
|
142
143
|
*/
|
|
143
144
|
translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
|
|
144
145
|
};
|
|
@@ -19,23 +19,23 @@ var useId = require('../../internal/useId.js');
|
|
|
19
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
20
|
var noopFn = require('../../internal/noopFn.js');
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
'carbon.table.toolbar.search.label': 'Filter table',
|
|
28
|
-
'carbon.table.toolbar.search.placeholder': 'Filter table'
|
|
22
|
+
const translationIds = {
|
|
23
|
+
'carbon.table.toolbar.search.label': 'carbon.table.toolbar.search.label',
|
|
24
|
+
'carbon.table.toolbar.search.placeholder': 'carbon.table.toolbar.search.placeholder'
|
|
25
|
+
};
|
|
26
|
+
const defaultTranslations = {
|
|
27
|
+
[translationIds['carbon.table.toolbar.search.label']]: 'Filter table',
|
|
28
|
+
[translationIds['carbon.table.toolbar.search.placeholder']]: 'Filter table'
|
|
29
29
|
};
|
|
30
|
-
const
|
|
31
|
-
return
|
|
30
|
+
const defaultTranslateWithId = messageId => {
|
|
31
|
+
return defaultTranslations[messageId];
|
|
32
32
|
};
|
|
33
33
|
const TableToolbarSearch = ({
|
|
34
34
|
className,
|
|
35
35
|
searchContainerClass,
|
|
36
36
|
onChange: onChangeProp,
|
|
37
37
|
onClear = noopFn.noopFn,
|
|
38
|
-
translateWithId: t =
|
|
38
|
+
translateWithId: t = defaultTranslateWithId,
|
|
39
39
|
placeholder,
|
|
40
40
|
labelText,
|
|
41
41
|
expanded: expandedProp,
|
|
@@ -192,7 +192,7 @@ TableToolbarSearch.propTypes = {
|
|
|
192
192
|
*/
|
|
193
193
|
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
194
194
|
/**
|
|
195
|
-
*
|
|
195
|
+
* Translates component strings using your i18n tool.
|
|
196
196
|
*/
|
|
197
197
|
translateWithId: PropTypes.func
|
|
198
198
|
};
|
|
@@ -17,7 +17,7 @@ import TableDecoratorRow from './TableDecoratorRow';
|
|
|
17
17
|
import TableExpandRow from './TableExpandRow';
|
|
18
18
|
import TableExpandedRow from './TableExpandedRow';
|
|
19
19
|
import TableHead from './TableHead';
|
|
20
|
-
import TableHeader
|
|
20
|
+
import TableHeader from './TableHeader';
|
|
21
21
|
import TableRow from './TableRow';
|
|
22
22
|
import TableSelectAll from './TableSelectAll';
|
|
23
23
|
import TableSelectRow from './TableSelectRow';
|
|
@@ -28,5 +28,5 @@ import TableToolbarContent from './TableToolbarContent';
|
|
|
28
28
|
import TableToolbarSearch from './TableToolbarSearch';
|
|
29
29
|
import TableToolbarMenu from './TableToolbarMenu';
|
|
30
30
|
import type { DataTableSortState } from './state/sortStates';
|
|
31
|
-
export { DataTable, type DataTableCell, type DataTableHeader, type DataTableProps, type DataTableRenderProps, type DataTableSortState, type DataTableRow, type DataTableSize, Table, TableActionList, TableBatchAction, TableBatchActions, TableBody, TableCell, TableContainer, TableDecoratorRow, TableExpandHeader, TableExpandRow, TableExpandedRow, TableHead, TableHeader,
|
|
31
|
+
export { DataTable, type DataTableCell, type DataTableHeader, type DataTableProps, type DataTableRenderProps, type DataTableSortState, type DataTableRow, type DataTableSize, Table, TableActionList, TableBatchAction, TableBatchActions, TableBody, TableCell, TableContainer, TableDecoratorRow, TableExpandHeader, TableExpandRow, TableExpandedRow, TableHead, TableHeader, TableRow, TableSelectAll, TableSelectRow, TableSlugRow, TableToolbar, TableToolbarAction, TableToolbarContent, TableToolbarSearch, TableToolbarMenu, };
|
|
32
32
|
export default DataTable;
|
|
@@ -13,8 +13,8 @@ export interface SortRowParams {
|
|
|
13
13
|
locale: string;
|
|
14
14
|
compare: (a: string | number, b: string | number, locale?: string) => number;
|
|
15
15
|
}
|
|
16
|
-
export type SortRowFn = (cellA: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
17
|
-
cellB: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
16
|
+
export type SortRowFn = (cellA: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
17
|
+
cellB: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
18
18
|
options: SortRowParams) => number;
|
|
19
19
|
interface Props {
|
|
20
20
|
locale?: string;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
var sortStates = require('./sortStates.js');
|
|
11
11
|
var sorting = require('../tools/sorting.js');
|
|
12
12
|
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
14
14
|
|
|
15
15
|
const initialSortState = sortStates.sortStates.NONE;
|
|
16
16
|
|
|
@@ -15,7 +15,7 @@ var sortStates = require('../state/sortStates.js');
|
|
|
15
15
|
* type, the default sort algorithm will be used for those types. Otherwise, the
|
|
16
16
|
* values will be converted to strings for comparison.
|
|
17
17
|
*/
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
19
19
|
const compare = (a, b, locale = 'en') => {
|
|
20
20
|
// prevent multiple null values in one column (sorting breaks)
|
|
21
21
|
if (a === null) a = '';
|
|
@@ -173,7 +173,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
173
173
|
isFluid
|
|
174
174
|
} = React.useContext(FormContext.FormContext);
|
|
175
175
|
const [hasInput, setHasInput] = React.useState(false);
|
|
176
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
177
177
|
const startInputField = React.useCallback(node => {
|
|
178
178
|
if (node !== null) {
|
|
179
179
|
startInputField.current = node;
|
|
@@ -194,9 +194,9 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
194
194
|
onClose(selectedDates, dateStr, instance);
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
197
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
198
198
|
[onClose]);
|
|
199
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
199
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
200
200
|
const onCalendarClose = (selectedDates, dateStr, instance, e) => {
|
|
201
201
|
if (e && e.type === 'clickOutside') {
|
|
202
202
|
return;
|
|
@@ -235,9 +235,9 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
235
235
|
[String(className)]: className
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
239
239
|
const childrenWithProps = React.Children.toArray(children).map(
|
|
240
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
241
241
|
(child, index) => {
|
|
242
242
|
if (index === 0 && child.type === /*#__PURE__*/React.createElement(DatePickerInput.default, child.props).type) {
|
|
243
243
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -352,7 +352,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
352
352
|
const {
|
|
353
353
|
current: end
|
|
354
354
|
} = endInputField;
|
|
355
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
355
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
356
356
|
const flatpickerConfig = {
|
|
357
357
|
inline: inline ?? false,
|
|
358
358
|
onClose: onCalendarClose,
|
|
@@ -528,7 +528,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
528
528
|
// this hook allows consumers to access the flatpickr calendar
|
|
529
529
|
// instance for cases where functions like open() or close()
|
|
530
530
|
// need to be imperatively called on the calendar
|
|
531
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
531
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
532
532
|
React.useImperativeHandle(ref, () => ({
|
|
533
533
|
get calendar() {
|
|
534
534
|
return calendarRef.current;
|
|
@@ -585,7 +585,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
585
585
|
endInputField.current.value = '';
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
588
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
589
589
|
}, [value]);
|
|
590
590
|
React.useEffect(() => {
|
|
591
591
|
const handleMouseDown = event => {
|
|
@@ -594,7 +594,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
594
594
|
closeCalendar();
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
597
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
598
598
|
const closeCalendar = event => {
|
|
599
599
|
calendarRef.current?.close();
|
|
600
600
|
// Remove focus from endDate calendar input
|
|
@@ -24,7 +24,7 @@ var deprecate = require('../../prop-types/deprecate.js');
|
|
|
24
24
|
var index = require('../AILabel/index.js');
|
|
25
25
|
var utils = require('../../internal/utils.js');
|
|
26
26
|
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
28
28
|
|
|
29
29
|
let didWarnAboutDatePickerInputValue = false;
|
|
30
30
|
const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(props, ref) {
|
|
@@ -100,7 +100,7 @@ const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(p
|
|
|
100
100
|
});
|
|
101
101
|
const datePickerInputHelperId = !helperText ? undefined : `datepicker-input-helper-text-${datePickerInputInstanceId}`;
|
|
102
102
|
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
104
104
|
const inputProps = {
|
|
105
105
|
...rest,
|
|
106
106
|
...datePickerInputProps,
|
|
@@ -119,7 +119,7 @@ const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(p
|
|
|
119
119
|
const candidateIsAILabel = utils.isComponentElement(candidate, index.AILabel);
|
|
120
120
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
121
121
|
size: 'mini'
|
|
122
|
-
}) :
|
|
122
|
+
}) : candidate;
|
|
123
123
|
return /*#__PURE__*/React.createElement("div", {
|
|
124
124
|
className: containerClasses
|
|
125
125
|
}, labelText && /*#__PURE__*/React.createElement(Text.Text, {
|
|
@@ -206,14 +206,14 @@ DatePickerInput.propTypes = {
|
|
|
206
206
|
/**
|
|
207
207
|
* Provide a regular expression that the input value must match
|
|
208
208
|
*/
|
|
209
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
209
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
210
210
|
pattern: (props, propName, componentName) => {
|
|
211
211
|
if (props[propName] === undefined) {
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
try {
|
|
215
215
|
new RegExp(props[propName]);
|
|
216
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
216
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
217
217
|
} catch (e) {
|
|
218
218
|
return new Error(`Invalid value of prop '${propName}' supplied to '${componentName}', it should be a valid regular expression`);
|
|
219
219
|
}
|
|
@@ -95,7 +95,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(({
|
|
|
95
95
|
ref.current.close();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
98
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
99
99
|
}, [modal, open]);
|
|
100
100
|
React.useEffect(() => {
|
|
101
101
|
if (!open && focusAfterCloseRef) {
|
|
@@ -126,7 +126,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(({
|
|
|
126
126
|
ref.current.setAttribute('aria-labelledby', title.id);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
129
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
130
130
|
}, [open, ariaLabel, ariaLabelledBy, prefix]);
|
|
131
131
|
return /*#__PURE__*/React.createElement(DialogContext.Provider, {
|
|
132
132
|
value: contextValue
|
|
@@ -231,7 +231,7 @@ const DialogControls = /*#__PURE__*/React.forwardRef(({
|
|
|
231
231
|
const prefix = usePrefix.usePrefix();
|
|
232
232
|
return (
|
|
233
233
|
/*#__PURE__*/
|
|
234
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
234
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
235
235
|
// @ts-ignore
|
|
236
236
|
React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
237
237
|
className: `${prefix}--dialog__header-controls`,
|
|
@@ -260,7 +260,7 @@ const DialogCloseButton = /*#__PURE__*/React.forwardRef(({
|
|
|
260
260
|
const prefix = usePrefix.usePrefix();
|
|
261
261
|
return (
|
|
262
262
|
/*#__PURE__*/
|
|
263
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
263
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
264
264
|
// @ts-ignore
|
|
265
265
|
React.createElement(index.IconButton, _rollupPluginBabelHelpers.extends({
|
|
266
266
|
kind: "ghost",
|
|
@@ -497,7 +497,7 @@ const DialogFooter = /*#__PURE__*/React.forwardRef(({
|
|
|
497
497
|
onClick: onButtonClick
|
|
498
498
|
}, i) => /*#__PURE__*/React.createElement(Button.default, {
|
|
499
499
|
key: `${buttonText}-${i}`
|
|
500
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/
|
|
500
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
501
501
|
,
|
|
502
502
|
autoFocus: danger,
|
|
503
503
|
kind: "secondary",
|
|
@@ -507,7 +507,7 @@ const DialogFooter = /*#__PURE__*/React.forwardRef(({
|
|
|
507
507
|
ref: danger ? setSecondaryButtonRef : undefined,
|
|
508
508
|
disabled: loadingActive,
|
|
509
509
|
kind: "secondary"
|
|
510
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/
|
|
510
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
511
511
|
,
|
|
512
512
|
autoFocus: danger,
|
|
513
513
|
onClick: onSecondaryButtonClick
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React, { type HTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
8
8
|
import { UseSelectProps } from 'downshift';
|
|
9
9
|
import { type ListBoxMenuIconTranslationKey, type ListBoxSize, type ListBoxType } from '../ListBox';
|
|
10
|
-
import { TranslateWithId } from '../../types/common';
|
|
10
|
+
import type { TranslateWithId } from '../../types/common';
|
|
11
11
|
type ExcludedAttributes = 'id' | 'onChange';
|
|
12
12
|
export interface OnChangeData<ItemType> {
|
|
13
13
|
selectedItem: ItemType | null;
|
|
@@ -142,7 +142,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
145
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
146
146
|
}, [floatingStyles, autoAlign, refs.floating]);
|
|
147
147
|
const prefix = usePrefix.usePrefix();
|
|
148
148
|
const {
|
|
@@ -158,7 +158,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
158
158
|
}
|
|
159
159
|
}, [onChange]);
|
|
160
160
|
|
|
161
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
162
162
|
const isItemDisabled = React.useCallback((item, _index) => {
|
|
163
163
|
const isObject = item !== null && typeof item === 'object';
|
|
164
164
|
return isObject && 'disabled' in item && item.disabled === true;
|
|
@@ -168,7 +168,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
168
168
|
highlightedIndex
|
|
169
169
|
} = changes;
|
|
170
170
|
if (highlightedIndex !== undefined && highlightedIndex > -1 &&
|
|
171
|
-
// eslint-disable-next-line valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/
|
|
171
|
+
// eslint-disable-next-line valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
172
172
|
typeof window !== undefined) {
|
|
173
173
|
const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
|
|
174
174
|
const highlightedItem = itemArray[highlightedIndex];
|
|
@@ -191,7 +191,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
191
191
|
onHighlightedIndexChange,
|
|
192
192
|
...downshiftProps
|
|
193
193
|
}),
|
|
194
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
194
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
195
195
|
[items, itemToString, initialSelectedItem, onSelectedItemChange, stateReducer, isItemDisabled, onHighlightedIndexChange, downshiftProps]);
|
|
196
196
|
const dropdownInstanceId = useId.useId();
|
|
197
197
|
|
|
@@ -283,7 +283,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
283
283
|
toggleButtonProps.onKeyDown(evt);
|
|
284
284
|
}
|
|
285
285
|
},
|
|
286
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
286
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
287
287
|
[isTyping, currTimer, toggleButtonProps]);
|
|
288
288
|
const readOnlyEventHandlers = React.useMemo(() => {
|
|
289
289
|
if (readOnly) {
|
|
@@ -317,7 +317,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
317
317
|
const candidateIsAILabel = utils.isComponentElement(candidate, index$1.AILabel);
|
|
318
318
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
319
319
|
size: 'mini'
|
|
320
|
-
}) :
|
|
320
|
+
}) : candidate;
|
|
321
321
|
const allLabelProps = getLabelProps();
|
|
322
322
|
const labelProps = /*#__PURE__*/React.isValidElement(titleText) ? {
|
|
323
323
|
id: allLabelProps.id
|
|
@@ -358,7 +358,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
358
358
|
}), /*#__PURE__*/React.createElement("span", {
|
|
359
359
|
className: `${prefix}--list-box__label`
|
|
360
360
|
}, selectedItem ? renderSelectedItem ? renderSelectedItem(selectedItem) : itemToString(selectedItem) :
|
|
361
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
361
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
362
362
|
label), /*#__PURE__*/React.createElement(index$2.default.MenuIcon, {
|
|
363
363
|
isOpen: isOpen,
|
|
364
364
|
translateWithId: translateWithId
|
|
@@ -515,7 +515,7 @@ Dropdown.propTypes = {
|
|
|
515
515
|
*/
|
|
516
516
|
titleText: PropTypes.node.isRequired,
|
|
517
517
|
/**
|
|
518
|
-
*
|
|
518
|
+
* Translates component strings using your i18n tool.
|
|
519
519
|
*/
|
|
520
520
|
translateWithId: PropTypes.func,
|
|
521
521
|
/**
|
|
@@ -11,7 +11,7 @@ var React = require('react');
|
|
|
11
11
|
|
|
12
12
|
const ErrorBoundaryContext = /*#__PURE__*/React.createContext({
|
|
13
13
|
log(error, info) {
|
|
14
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
14
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
15
15
|
console.log(info.componentStack);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -24,7 +24,7 @@ require('../Text/TextDirection.js');
|
|
|
24
24
|
var useId = require('../../internal/useId.js');
|
|
25
25
|
var index = require('../FeatureFlags/index.js');
|
|
26
26
|
|
|
27
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
27
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
28
28
|
const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
29
29
|
accept,
|
|
30
30
|
buttonKind,
|
|
@@ -49,7 +49,7 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
49
49
|
const [fileItems, setFileItems] = React.useState([]);
|
|
50
50
|
const [legacyFileNames, setLegacyFileNames] = React.useState([]);
|
|
51
51
|
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
53
53
|
const [fileObjects, setFileObjects] = React.useState(new Map());
|
|
54
54
|
const nodes = [];
|
|
55
55
|
const createFileItem = file => ({
|
|
@@ -103,7 +103,7 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
106
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
107
107
|
[enhancedFileUploaderEnabled, fileItems, legacyFileNames, multiple, onChange]);
|
|
108
108
|
const handleClick = React.useCallback((evt, {
|
|
109
109
|
index,
|
|
@@ -160,7 +160,7 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
160
160
|
uploaderButton.current?.focus?.();
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
163
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
164
164
|
[enhancedFileUploaderEnabled, fileItems, legacyFileNames, onDelete, onChange, onClick]);
|
|
165
165
|
React.useImperativeHandle(ref, () => ({
|
|
166
166
|
clearFiles() {
|
|
@@ -40,7 +40,7 @@ function FileUploaderButton({
|
|
|
40
40
|
const prefix = usePrefix.usePrefix();
|
|
41
41
|
const [labelText, setLabelText] = React.useState(ownerLabelText);
|
|
42
42
|
const [prevOwnerLabelText, setPrevOwnerLabelText] = React.useState(ownerLabelText);
|
|
43
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
44
44
|
const {
|
|
45
45
|
current: inputId
|
|
46
46
|
} = React.useRef(id || useId.useId());
|
|
@@ -37,7 +37,7 @@ function FileUploaderDropContainer({
|
|
|
37
37
|
}) {
|
|
38
38
|
const prefix = usePrefix.usePrefix();
|
|
39
39
|
const inputRef = React.useRef(null);
|
|
40
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
40
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
41
41
|
const {
|
|
42
42
|
current: uid
|
|
43
43
|
} = React.useRef(id || useId.useId());
|
|
@@ -40,7 +40,7 @@ function FileUploaderItem({
|
|
|
40
40
|
const textRef = React.useRef(null);
|
|
41
41
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
42
42
|
const prefix = usePrefix.usePrefix();
|
|
43
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
44
44
|
const {
|
|
45
45
|
current: id
|
|
46
46
|
} = React.useRef(uuid || useId.useId());
|
|
@@ -54,7 +54,7 @@ function FileUploaderItem({
|
|
|
54
54
|
return name?.replace(/\s+/g, '');
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
58
58
|
const isEllipsisActive = element => {
|
|
59
59
|
setIsEllipsisApplied(element.offsetWidth < element.scrollWidth);
|
|
60
60
|
return element.offsetWidth < element.scrollWidth;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { ComponentType } from 'react';
|
|
7
|
+
import React, { ComponentType, type ComponentProps } from 'react';
|
|
8
|
+
import ComboBox from '../ComboBox';
|
|
8
9
|
import { ComboBoxProps } from '../ComboBox/ComboBox';
|
|
9
10
|
type ItemToStringHandler<ItemType> = (item: ItemType | null) => string;
|
|
10
11
|
interface OnChangeData<ItemType> {
|
|
11
12
|
selectedItem: ItemType | null | undefined;
|
|
12
13
|
inputValue?: string | null;
|
|
13
14
|
}
|
|
14
|
-
export interface FluidComboBoxProps<ItemType> extends ComboBoxProps<ItemType> {
|
|
15
|
+
export interface FluidComboBoxProps<ItemType> extends ComboBoxProps<ItemType>, Pick<ComponentProps<typeof ComboBox>, 'translateWithId'> {
|
|
15
16
|
/**
|
|
16
17
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
17
18
|
*/
|
|
@@ -85,10 +86,6 @@ export interface FluidComboBoxProps<ItemType> extends ComboBoxProps<ItemType> {
|
|
|
85
86
|
* visiting this control
|
|
86
87
|
*/
|
|
87
88
|
titleText?: React.ReactNode;
|
|
88
|
-
/**
|
|
89
|
-
* Callback function for translating ListBoxMenuIcon SVG title
|
|
90
|
-
*/
|
|
91
|
-
translateWithId?: (id: string) => string;
|
|
92
89
|
/**
|
|
93
90
|
* Specify whether the control is currently in warning state
|
|
94
91
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { DropdownProps } from '../Dropdown';
|
|
7
|
+
import React, { type ComponentProps } from 'react';
|
|
8
|
+
import Dropdown, { DropdownProps } from '../Dropdown';
|
|
9
9
|
export interface OnChangeData<ItemType> {
|
|
10
10
|
selectedItem: ItemType | null;
|
|
11
11
|
}
|
|
12
|
-
export interface FluidDropdownProps<ItemType> extends DropdownProps<ItemType> {
|
|
12
|
+
export interface FluidDropdownProps<ItemType> extends DropdownProps<ItemType>, Pick<ComponentProps<typeof Dropdown>, 'translateWithId'> {
|
|
13
13
|
/**
|
|
14
14
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
15
15
|
*/
|
|
@@ -84,10 +84,6 @@ export interface FluidDropdownProps<ItemType> extends DropdownProps<ItemType> {
|
|
|
84
84
|
* visiting this control
|
|
85
85
|
*/
|
|
86
86
|
titleText: React.ReactNode;
|
|
87
|
-
/**
|
|
88
|
-
* Callback function for translating ListBoxMenuIcon SVG title
|
|
89
|
-
*/
|
|
90
|
-
translateWithId?: (id: string) => string;
|
|
91
87
|
/**
|
|
92
88
|
* Specify whether the control is currently in warning state
|
|
93
89
|
*/
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { FunctionComponent } from 'react';
|
|
7
|
+
import React, { FunctionComponent, type ComponentProps } from 'react';
|
|
8
8
|
import type { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
-
import { type FilterableMultiSelectProps } from '../MultiSelect';
|
|
9
|
+
import { type FilterableMultiSelectProps, type MultiSelect } from '../MultiSelect';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
13
|
-
export interface FluidFilterableMultiSelectProps<ItemType> extends FilterableMultiSelectProps<ItemType> {
|
|
13
|
+
export interface FluidFilterableMultiSelectProps<ItemType> extends FilterableMultiSelectProps<ItemType>, Pick<ComponentProps<typeof MultiSelect>, 'translateWithId'> {
|
|
14
14
|
/**
|
|
15
15
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
16
16
|
*/
|
|
@@ -123,10 +123,6 @@ export interface FluidFilterableMultiSelectProps<ItemType> extends FilterableMul
|
|
|
123
123
|
* visiting this control
|
|
124
124
|
*/
|
|
125
125
|
titleText?: React.ReactNode;
|
|
126
|
-
/**
|
|
127
|
-
* Callback function for translating ListBoxMenuIcon SVG title
|
|
128
|
-
*/
|
|
129
|
-
translateWithId?: (id: string) => string;
|
|
130
126
|
/**
|
|
131
127
|
* Specify title to show title on hover
|
|
132
128
|
*/
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { type MultiSelectProps } from '../MultiSelect';
|
|
7
|
+
import React, { type ComponentProps } from 'react';
|
|
8
|
+
import { MultiSelect, type MultiSelectProps } from '../MultiSelect';
|
|
9
9
|
import { UseSelectProps } from 'downshift';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
13
|
-
export interface FluidMultiSelectProps<ItemType> extends MultiSelectProps<ItemType> {
|
|
13
|
+
export interface FluidMultiSelectProps<ItemType> extends MultiSelectProps<ItemType>, Pick<ComponentProps<typeof MultiSelect>, 'translateWithId'> {
|
|
14
14
|
/**
|
|
15
15
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
16
16
|
*/
|
|
@@ -128,10 +128,6 @@ export interface FluidMultiSelectProps<ItemType> extends MultiSelectProps<ItemTy
|
|
|
128
128
|
* visiting this control
|
|
129
129
|
*/
|
|
130
130
|
titleText?: React.ReactNode;
|
|
131
|
-
/**
|
|
132
|
-
* Callback function for translating ListBoxMenuIcon SVG title
|
|
133
|
-
*/
|
|
134
|
-
translateWithId?: (id: string) => string;
|
|
135
131
|
/**
|
|
136
132
|
* Specify title to show title on hover
|
|
137
133
|
*/
|