@carbon/react 1.81.0-rc.0 → 1.82.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 +784 -784
- package/es/components/AILabel/index.d.ts +1 -1
- package/es/components/AILabel/index.js +2 -9
- package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/es/components/Breadcrumb/Breadcrumb.js +4 -4
- package/es/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
- package/es/components/Breadcrumb/BreadcrumbItem.js +5 -4
- package/es/components/Button/Button.js +2 -10
- package/es/components/ButtonSet/ButtonSet.d.ts +2 -3
- package/es/components/ButtonSet/ButtonSet.js +4 -4
- package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +3 -19
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +54 -32
- package/es/components/ComboButton/index.d.ts +1 -1
- package/es/components/ComboButton/index.js +2 -18
- package/es/components/ComposedModal/ComposedModal.js +5 -3
- package/es/components/Copy/Copy.d.ts +1 -1
- package/es/components/Copy/Copy.js +2 -18
- package/es/components/CopyButton/CopyButton.d.ts +1 -1
- package/es/components/CopyButton/CopyButton.js +2 -18
- package/es/components/DataTable/DataTable.d.ts +7 -12
- package/es/components/DataTable/DataTable.js +0 -5
- package/es/components/DataTable/TableCell.js +28 -4
- package/es/components/DataTable/TableToolbarAction.d.ts +2 -4
- package/es/components/DataTable/TableToolbarAction.js +5 -4
- package/es/components/DataTable/tools/cells.d.ts +13 -0
- package/es/components/DataTable/tools/cells.js +3 -6
- package/es/components/DataTable/tools/filter.d.ts +26 -0
- package/es/components/DataTable/tools/filter.js +8 -17
- package/es/components/DataTable/tools/sorting.d.ts +42 -0
- package/es/components/DataTable/tools/sorting.js +24 -53
- package/es/components/DatePicker/DatePicker.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.js +19 -19
- package/es/components/Dialog/index.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.Skeleton.js +2 -2
- package/es/components/Dropdown/Dropdown.d.ts +7 -6
- package/es/components/Dropdown/Dropdown.js +13 -9
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +1 -1
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.d.ts +1 -1
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +5 -6
- package/es/components/FluidDropdown/FluidDropdown.d.ts +1 -1
- package/es/components/FluidSearch/FluidSearch.d.ts +3 -6
- package/es/components/IconButton/index.d.ts +1 -1
- package/es/components/IconButton/index.js +2 -18
- package/es/components/ListBox/ListBox.d.ts +4 -5
- package/es/components/ListBox/ListBox.js +8 -7
- package/es/components/ListBox/ListBoxMenu.d.ts +4 -4
- package/es/components/ListBox/ListBoxMenu.js +4 -2
- package/es/components/ListBox/ListBoxMenuItem.d.ts +9 -8
- package/es/components/ListBox/ListBoxPropTypes.d.ts +3 -3
- package/es/components/ListBox/ListBoxPropTypes.js +3 -3
- package/es/components/ListBox/index.d.ts +7 -5
- package/es/components/ListBox/index.js +1 -1
- package/es/components/Menu/Menu.js +9 -14
- package/es/components/Menu/MenuItem.js +15 -4
- package/es/components/Modal/Modal.js +9 -9
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/es/components/MultiSelect/MultiSelect.d.ts +8 -2
- package/es/components/MultiSelect/MultiSelect.js +7 -4
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +2 -21
- package/es/components/OverflowMenu/index.d.ts +1 -1
- package/es/components/OverflowMenu/index.js +2 -3
- package/es/components/OverflowMenu/next/index.js +2 -18
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +5 -4
- package/es/components/PageHeader/PageHeader.d.ts +160 -8
- package/es/components/PageHeader/PageHeader.js +155 -21
- package/es/components/PageHeader/index.d.ts +2 -2
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/Popover/index.js +4 -21
- package/es/components/Search/Search.d.ts +2 -5
- package/es/components/Search/Search.js +24 -8
- package/es/components/Stack/HStack.d.ts +2 -3
- package/es/components/Stack/HStack.js +4 -7
- package/es/components/Stack/Stack.d.ts +3 -4
- package/es/components/Stack/Stack.js +3 -6
- package/es/components/Stack/VStack.d.ts +2 -3
- package/es/components/Stack/VStack.js +3 -2
- package/es/components/Stack/index.d.ts +4 -4
- package/es/components/TextArea/TextArea.js +3 -5
- package/es/components/TimePicker/TimePicker.d.ts +3 -4
- package/es/components/TimePicker/TimePicker.js +5 -4
- package/es/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
- package/es/components/TimePickerSelect/TimePickerSelect.js +5 -4
- package/es/components/TreeView/TreeNode.js +13 -1
- package/es/components/TreeView/TreeView.js +1 -1
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.js +9 -5
- package/es/internal/environment.js +7 -0
- package/es/internal/keyboard/navigation.d.ts +0 -10
- package/es/internal/keyboard/navigation.js +1 -13
- package/es/internal/useId.js +1 -1
- package/es/internal/useNoInteractiveChildren.js +7 -0
- package/es/internal/useOutsideClick.js +3 -0
- package/es/internal/wrapFocus.d.ts +49 -0
- package/es/internal/wrapFocus.js +64 -51
- package/es/tools/events.d.ts +17 -0
- package/es/tools/events.js +10 -13
- package/es/tools/mapPopoverAlign.d.ts +15 -0
- package/es/tools/mapPopoverAlign.js +28 -0
- package/es/tools/uniqueId.d.ts +7 -0
- package/es/tools/uniqueId.js +3 -3
- package/es/types/common.d.ts +0 -2
- package/lib/components/AILabel/index.d.ts +1 -1
- package/lib/components/AILabel/index.js +2 -9
- package/lib/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +3 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
- package/lib/components/Breadcrumb/BreadcrumbItem.js +4 -3
- package/lib/components/Button/Button.js +1 -9
- package/lib/components/ButtonSet/ButtonSet.d.ts +2 -3
- package/lib/components/ButtonSet/ButtonSet.js +3 -3
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +3 -19
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +53 -31
- package/lib/components/ComboButton/index.d.ts +1 -1
- package/lib/components/ComboButton/index.js +2 -18
- package/lib/components/ComposedModal/ComposedModal.js +5 -3
- package/lib/components/Copy/Copy.d.ts +1 -1
- package/lib/components/Copy/Copy.js +2 -18
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.js +2 -18
- package/lib/components/DataTable/DataTable.d.ts +7 -12
- package/lib/components/DataTable/DataTable.js +0 -5
- package/lib/components/DataTable/TableCell.js +28 -3
- package/lib/components/DataTable/TableToolbarAction.d.ts +2 -4
- package/lib/components/DataTable/TableToolbarAction.js +4 -3
- package/lib/components/DataTable/tools/cells.d.ts +13 -0
- package/lib/components/DataTable/tools/cells.js +3 -6
- package/lib/components/DataTable/tools/filter.d.ts +26 -0
- package/lib/components/DataTable/tools/filter.js +8 -17
- package/lib/components/DataTable/tools/sorting.d.ts +42 -0
- package/lib/components/DataTable/tools/sorting.js +23 -53
- package/lib/components/DatePicker/DatePicker.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.js +19 -19
- package/lib/components/Dialog/index.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.Skeleton.js +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +7 -6
- package/lib/components/Dropdown/Dropdown.js +12 -8
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +1 -1
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.d.ts +1 -1
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -5
- package/lib/components/FluidDropdown/FluidDropdown.d.ts +1 -1
- package/lib/components/FluidSearch/FluidSearch.d.ts +3 -6
- package/lib/components/IconButton/index.d.ts +1 -1
- package/lib/components/IconButton/index.js +2 -18
- package/lib/components/ListBox/ListBox.d.ts +4 -5
- package/lib/components/ListBox/ListBox.js +7 -6
- package/lib/components/ListBox/ListBoxMenu.d.ts +4 -4
- package/lib/components/ListBox/ListBoxMenu.js +3 -1
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +9 -8
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +3 -3
- package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
- package/lib/components/ListBox/index.d.ts +7 -5
- package/lib/components/ListBox/index.js +2 -2
- package/lib/components/Menu/Menu.js +9 -14
- package/lib/components/Menu/MenuItem.js +15 -4
- package/lib/components/Modal/Modal.js +9 -9
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -1
- package/lib/components/MultiSelect/MultiSelect.d.ts +8 -2
- package/lib/components/MultiSelect/MultiSelect.js +6 -3
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -21
- package/lib/components/OverflowMenu/index.d.ts +1 -1
- package/lib/components/OverflowMenu/index.js +2 -3
- package/lib/components/OverflowMenu/next/index.js +2 -18
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -3
- package/lib/components/PageHeader/PageHeader.d.ts +160 -8
- package/lib/components/PageHeader/PageHeader.js +159 -19
- package/lib/components/PageHeader/index.d.ts +2 -2
- package/lib/components/PageHeader/index.js +6 -0
- package/lib/components/Popover/index.js +4 -21
- package/lib/components/Search/Search.d.ts +2 -5
- package/lib/components/Search/Search.js +24 -8
- package/lib/components/Stack/HStack.d.ts +2 -3
- package/lib/components/Stack/HStack.js +3 -6
- package/lib/components/Stack/Stack.d.ts +3 -4
- package/lib/components/Stack/Stack.js +2 -5
- package/lib/components/Stack/VStack.d.ts +2 -3
- package/lib/components/Stack/VStack.js +2 -1
- package/lib/components/Stack/index.d.ts +4 -4
- package/lib/components/TextArea/TextArea.js +2 -4
- package/lib/components/TimePicker/TimePicker.d.ts +3 -4
- package/lib/components/TimePicker/TimePicker.js +4 -3
- package/lib/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
- package/lib/components/TimePickerSelect/TimePickerSelect.js +4 -3
- package/lib/components/TreeView/TreeNode.js +13 -1
- package/lib/components/TreeView/TreeView.js +1 -1
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.js +9 -5
- package/lib/internal/environment.js +7 -0
- package/lib/internal/keyboard/navigation.d.ts +0 -10
- package/lib/internal/keyboard/navigation.js +0 -14
- package/lib/internal/useNoInteractiveChildren.js +7 -0
- package/lib/internal/useOutsideClick.js +3 -0
- package/lib/internal/wrapFocus.d.ts +49 -0
- package/lib/internal/wrapFocus.js +66 -53
- package/lib/tools/events.d.ts +17 -0
- package/lib/tools/events.js +10 -13
- package/lib/tools/mapPopoverAlign.d.ts +15 -0
- package/lib/tools/mapPopoverAlign.js +32 -0
- package/lib/tools/uniqueId.d.ts +7 -0
- package/lib/tools/uniqueId.js +3 -3
- package/lib/types/common.d.ts +0 -2
- package/package.json +9 -9
- package/telemetry.yml +3 -1
- package/es/tools/createPropAdapter.js +0 -40
- package/lib/tools/createPropAdapter.js +0 -44
|
@@ -49,7 +49,7 @@ function FileUploaderButton(_ref) {
|
|
|
49
49
|
const [prevOwnerLabelText, setPrevOwnerLabelText] = React.useState(ownerLabelText);
|
|
50
50
|
const {
|
|
51
51
|
current: inputId
|
|
52
|
-
} = React.useRef(id || uniqueId
|
|
52
|
+
} = React.useRef(id || uniqueId.uniqueId());
|
|
53
53
|
const inputNode = React.useRef(null);
|
|
54
54
|
const classes = cx__default["default"](`${prefix}--btn`, className, {
|
|
55
55
|
[`${prefix}--btn--${buttonKind}`]: buttonKind,
|
|
@@ -47,7 +47,7 @@ function FileUploaderDropContainer(_ref) {
|
|
|
47
47
|
const inputRef = React.useRef(null);
|
|
48
48
|
const {
|
|
49
49
|
current: uid
|
|
50
|
-
} = React.useRef(id || uniqueId
|
|
50
|
+
} = React.useRef(id || uniqueId.uniqueId());
|
|
51
51
|
const [isActive, setActive] = React.useState(false);
|
|
52
52
|
const dropareaClasses = cx__default["default"](`${prefix}--file__drop-container`, `${prefix}--file-browse-btn`, {
|
|
53
53
|
[`${prefix}--file__drop-container--drag-over`]: isActive,
|
|
@@ -49,7 +49,7 @@ function FileUploaderItem(_ref) {
|
|
|
49
49
|
const prefix = usePrefix.usePrefix();
|
|
50
50
|
const {
|
|
51
51
|
current: id
|
|
52
|
-
} = React.useRef(uuid || uniqueId
|
|
52
|
+
} = React.useRef(uuid || uniqueId.uniqueId());
|
|
53
53
|
const classes = cx__default["default"](`${prefix}--file__selected-file`, className, {
|
|
54
54
|
[`${prefix}--file__selected-file--invalid`]: invalid,
|
|
55
55
|
[`${prefix}--file__selected-file--md`]: size === 'md',
|
|
@@ -18,17 +18,16 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
18
18
|
|
|
19
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
...other
|
|
24
|
-
} = _ref;
|
|
21
|
+
const frFn = React.forwardRef;
|
|
22
|
+
const FluidDatePickerInput = frFn((props, ref) => {
|
|
25
23
|
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
26
24
|
value: {
|
|
27
25
|
isFluid: true
|
|
28
26
|
}
|
|
29
27
|
}, /*#__PURE__*/React__default["default"].createElement(DatePickerInput["default"], _rollupPluginBabelHelpers["extends"]({
|
|
30
28
|
ref: ref
|
|
31
|
-
},
|
|
29
|
+
}, props)));
|
|
32
30
|
});
|
|
31
|
+
FluidDatePickerInput.propTypes = DatePickerInput["default"].propTypes;
|
|
33
32
|
|
|
34
33
|
exports["default"] = FluidDatePickerInput;
|
|
@@ -97,5 +97,5 @@ export interface FluidDropdownProps<ItemType> extends DropdownProps<ItemType> {
|
|
|
97
97
|
*/
|
|
98
98
|
warnText?: React.ReactNode;
|
|
99
99
|
}
|
|
100
|
-
declare const FluidDropdown: React.ForwardRefExoticComponent<
|
|
100
|
+
declare const FluidDropdown: React.ForwardRefExoticComponent<FluidDropdownProps<unknown> & React.RefAttributes<HTMLButtonElement>>;
|
|
101
101
|
export default FluidDropdown;
|
|
@@ -1,10 +1,10 @@
|
|
|
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';
|
|
7
|
+
import React, { type ChangeEvent } from 'react';
|
|
8
8
|
export interface FluidSearchProps {
|
|
9
9
|
/**
|
|
10
10
|
* Specify an optional value for the `autocomplete` property on the underlying
|
|
@@ -38,10 +38,7 @@ export interface FluidSearchProps {
|
|
|
38
38
|
/**
|
|
39
39
|
* Optional callback called when the search value changes.
|
|
40
40
|
*/
|
|
41
|
-
onChange?(
|
|
42
|
-
target: HTMLInputElement;
|
|
43
|
-
type: 'change';
|
|
44
|
-
}): void;
|
|
41
|
+
onChange?(event: ChangeEvent<HTMLInputElement>): void;
|
|
45
42
|
/**
|
|
46
43
|
* Optional callback called when the search value is cleared.
|
|
47
44
|
*/
|
|
@@ -20,6 +20,7 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
20
|
var ButtonBase = require('../Button/ButtonBase.js');
|
|
21
21
|
var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
|
|
22
22
|
var index = require('../BadgeIndicator/index.js');
|
|
23
|
+
var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
|
|
23
24
|
|
|
24
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
26
|
|
|
@@ -28,19 +29,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
28
29
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
29
30
|
|
|
30
31
|
const IconButtonKinds = ['primary', 'secondary', 'ghost', 'tertiary'];
|
|
31
|
-
const propMappingFunction = deprecatedValue => {
|
|
32
|
-
const mapping = {
|
|
33
|
-
'top-left': 'top-start',
|
|
34
|
-
'top-right': 'top-end',
|
|
35
|
-
'bottom-left': 'bottom-start',
|
|
36
|
-
'bottom-right': 'bottom-end',
|
|
37
|
-
'left-bottom': 'left-end',
|
|
38
|
-
'left-top': 'left-start',
|
|
39
|
-
'right-bottom': 'right-end',
|
|
40
|
-
'right-top': 'right-start'
|
|
41
|
-
};
|
|
42
|
-
return mapping[deprecatedValue];
|
|
43
|
-
};
|
|
44
32
|
const IconButton = /*#__PURE__*/React__default["default"].forwardRef(function IconButton(_ref, ref) {
|
|
45
33
|
let {
|
|
46
34
|
align,
|
|
@@ -120,11 +108,7 @@ IconButton.propTypes = {
|
|
|
120
108
|
// deprecated use right-start instead
|
|
121
109
|
|
|
122
110
|
// new values to match floating-ui
|
|
123
|
-
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
|
|
124
|
-
//allowed prop values
|
|
125
|
-
['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
|
|
126
|
-
//optional mapper function
|
|
127
|
-
propMappingFunction),
|
|
111
|
+
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
|
|
128
112
|
/**
|
|
129
113
|
* **Experimental**: Will attempt to automatically align the tooltip
|
|
130
114
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { type ListBoxSize, type ListBoxType } from '.';
|
|
9
|
+
import { ReactAttr } from '../../types/common';
|
|
10
10
|
type ExcludedAttributes = 'onKeyDown' | 'onKeyPress' | 'ref';
|
|
11
11
|
export interface ListBoxProps extends Omit<ReactAttr<HTMLDivElement>, ExcludedAttributes> {
|
|
12
12
|
/**
|
|
@@ -59,10 +59,9 @@ export interface ListBoxProps extends Omit<ReactAttr<HTMLDivElement>, ExcludedAt
|
|
|
59
59
|
*/
|
|
60
60
|
warnTextId?: string;
|
|
61
61
|
}
|
|
62
|
-
export type ListBoxComponent = ForwardRefReturn<HTMLDivElement, ListBoxProps>;
|
|
63
62
|
/**
|
|
64
63
|
* `ListBox` is a generic container component that handles creating the
|
|
65
64
|
* container class name in response to certain props.
|
|
66
65
|
*/
|
|
67
|
-
declare const ListBox:
|
|
66
|
+
declare const ListBox: React.ForwardRefExoticComponent<ListBoxProps & React.RefAttributes<HTMLDivElement>>;
|
|
68
67
|
export default ListBox;
|
|
@@ -14,10 +14,11 @@ var cx = require('classnames');
|
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
17
|
-
|
|
17
|
+
require('./index.js');
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
require('../FluidForm/FluidForm.js');
|
|
20
20
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
21
|
+
var ListBoxPropTypes = require('./ListBoxPropTypes.js');
|
|
21
22
|
|
|
22
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
24
|
|
|
@@ -38,8 +39,8 @@ const handleClick = event => {
|
|
|
38
39
|
* `ListBox` is a generic container component that handles creating the
|
|
39
40
|
* container class name in response to certain props.
|
|
40
41
|
*/
|
|
41
|
-
const ListBox = /*#__PURE__*/
|
|
42
|
-
|
|
42
|
+
const ListBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
43
|
+
const {
|
|
43
44
|
children,
|
|
44
45
|
className: containerClassName,
|
|
45
46
|
disabled = false,
|
|
@@ -54,7 +55,7 @@ const ListBox = /*#__PURE__*/React__default["default"].forwardRef(function ListB
|
|
|
54
55
|
light,
|
|
55
56
|
isOpen,
|
|
56
57
|
...rest
|
|
57
|
-
} =
|
|
58
|
+
} = props;
|
|
58
59
|
const prefix = usePrefix.usePrefix();
|
|
59
60
|
const {
|
|
60
61
|
isFluid
|
|
@@ -127,12 +128,12 @@ ListBox.propTypes = {
|
|
|
127
128
|
/**
|
|
128
129
|
* Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
|
|
129
130
|
*/
|
|
130
|
-
size: ListBoxPropTypes.
|
|
131
|
+
size: ListBoxPropTypes.ListBoxSizePropType,
|
|
131
132
|
/**
|
|
132
133
|
* Specify the "type" of the ListBox. Currently supports either `default` or
|
|
133
134
|
* `inline` as an option.
|
|
134
135
|
*/
|
|
135
|
-
type: ListBoxPropTypes.
|
|
136
|
+
type: ListBoxPropTypes.ListBoxTypePropType,
|
|
136
137
|
/**
|
|
137
138
|
* Specify whether the control is currently in warning state
|
|
138
139
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { ReactAttr } from '../../types/common';
|
|
8
9
|
type ExcludedAttributes = 'id';
|
|
9
10
|
export interface ListBoxMenuProps extends Omit<ReactAttr<HTMLUListElement>, ExcludedAttributes> {
|
|
10
11
|
children?: any;
|
|
@@ -13,11 +14,10 @@ export interface ListBoxMenuProps extends Omit<ReactAttr<HTMLUListElement>, Excl
|
|
|
13
14
|
*/
|
|
14
15
|
id: string;
|
|
15
16
|
}
|
|
16
|
-
export type ListBoxMenuComponent = ForwardRefReturn<HTMLUListElement, ListBoxMenuProps>;
|
|
17
17
|
/**
|
|
18
18
|
* `ListBoxMenu` is a simple container node that isolates the `list-box__menu`
|
|
19
19
|
* class into a single component. It is also being used to validate given
|
|
20
20
|
* `children` components.
|
|
21
21
|
*/
|
|
22
|
-
declare const ListBoxMenu:
|
|
22
|
+
declare const ListBoxMenu: React.ForwardRefExoticComponent<ListBoxMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
23
23
|
export default ListBoxMenu;
|
|
@@ -20,12 +20,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
21
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
22
|
|
|
23
|
+
const frFn = React.forwardRef;
|
|
24
|
+
|
|
23
25
|
/**
|
|
24
26
|
* `ListBoxMenu` is a simple container node that isolates the `list-box__menu`
|
|
25
27
|
* class into a single component. It is also being used to validate given
|
|
26
28
|
* `children` components.
|
|
27
29
|
*/
|
|
28
|
-
const ListBoxMenu =
|
|
30
|
+
const ListBoxMenu = frFn((_ref, ref) => {
|
|
29
31
|
let {
|
|
30
32
|
children,
|
|
31
33
|
id,
|
|
@@ -4,8 +4,8 @@
|
|
|
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 {
|
|
8
|
-
import {
|
|
7
|
+
import React, { ReactNode } from 'react';
|
|
8
|
+
import { ReactAttr } from '../../types/common';
|
|
9
9
|
export interface ListBoxMenuItemProps extends ReactAttr<HTMLLIElement> {
|
|
10
10
|
/**
|
|
11
11
|
* Specify any children nodes that should be rendered inside of the ListBox
|
|
@@ -29,9 +29,10 @@ export interface ListBoxMenuItemProps extends ReactAttr<HTMLLIElement> {
|
|
|
29
29
|
*/
|
|
30
30
|
title?: string;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
/**
|
|
33
|
+
* `ListBoxMenuItem` is a helper component for managing the container class
|
|
34
|
+
* name, alongside any classes for any corresponding states, for a generic list
|
|
35
|
+
* box menu item.
|
|
36
|
+
*/
|
|
37
|
+
declare const ListBoxMenuItem: React.ForwardRefExoticComponent<ListBoxMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
38
|
+
export default ListBoxMenuItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -9,6 +9,6 @@ declare const listBoxTypes: readonly ["default", "inline"];
|
|
|
9
9
|
declare const listBoxSizes: readonly ["sm", "md", "lg"];
|
|
10
10
|
export type ListBoxType = (typeof listBoxTypes)[number];
|
|
11
11
|
export type ListBoxSize = (typeof listBoxSizes)[number];
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
12
|
+
export declare const ListBoxTypePropType: PropTypes.Requireable<"default" | "inline">;
|
|
13
|
+
export declare const ListBoxSizePropType: PropTypes.Requireable<"sm" | "md" | "lg">;
|
|
14
14
|
export {};
|
|
@@ -17,8 +17,8 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
17
17
|
|
|
18
18
|
const listBoxTypes = ['default', 'inline'];
|
|
19
19
|
const listBoxSizes = ['sm', 'md', 'lg'];
|
|
20
|
-
const
|
|
21
|
-
const
|
|
20
|
+
const ListBoxTypePropType = PropTypes__default["default"].oneOf(listBoxTypes);
|
|
21
|
+
const ListBoxSizePropType = PropTypes__default["default"].oneOf(listBoxSizes);
|
|
22
22
|
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
23
|
+
exports.ListBoxSizePropType = ListBoxSizePropType;
|
|
24
|
+
exports.ListBoxTypePropType = ListBoxTypePropType;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
export * as PropTypes from './ListBoxPropTypes';
|
|
8
7
|
export * from './ListBoxPropTypes';
|
|
9
|
-
import
|
|
8
|
+
import ListBoxInternal from './ListBox';
|
|
10
9
|
import { ListBoxFieldComponent } from './ListBoxField';
|
|
11
|
-
import
|
|
10
|
+
import ListBoxMenu from './ListBoxMenu';
|
|
12
11
|
import { ListBoxMenuIconComponent } from './ListBoxMenuIcon';
|
|
13
|
-
import
|
|
12
|
+
import ListBoxMenuItem from './ListBoxMenuItem';
|
|
14
13
|
import { ListBoxSelectionComponent } from './ListBoxSelection';
|
|
14
|
+
type ListBoxMenuComponent = typeof ListBoxMenu;
|
|
15
|
+
type ListBoxMenuItemComponent = typeof ListBoxMenuItem;
|
|
16
|
+
type ListBoxPartialComponent = typeof ListBoxInternal;
|
|
15
17
|
export interface ListBoxComponent extends ListBoxPartialComponent {
|
|
16
18
|
readonly Field: ListBoxFieldComponent;
|
|
17
19
|
readonly Menu: ListBoxMenuComponent;
|
|
@@ -25,6 +25,6 @@ const ListBox = Object.assign(ListBox$1["default"], {
|
|
|
25
25
|
Selection: ListBoxSelection["default"]
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
28
|
+
exports.ListBoxSizePropType = ListBoxPropTypes.ListBoxSizePropType;
|
|
29
|
+
exports.ListBoxTypePropType = ListBoxPropTypes.ListBoxTypePropType;
|
|
30
30
|
exports["default"] = ListBox;
|
|
@@ -44,7 +44,12 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(_ref, forwardRef) {
|
|
|
44
44
|
open,
|
|
45
45
|
size = 'sm',
|
|
46
46
|
legacyAutoalign = 'true',
|
|
47
|
+
// TODO: `ssr-friendly` doesn't support ESLint v9.
|
|
48
|
+
// https://github.com/kopiro/eslint-plugin-ssr-friendly/issues/30
|
|
49
|
+
// https://github.com/carbon-design-system/carbon/issues/18991
|
|
50
|
+
/*
|
|
47
51
|
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-react-fc
|
|
52
|
+
*/
|
|
48
53
|
target = environment.canUseDOM && document.body,
|
|
49
54
|
x = 0,
|
|
50
55
|
y = 0,
|
|
@@ -111,18 +116,8 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(_ref, forwardRef) {
|
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
|
-
function handleClose(
|
|
115
|
-
|
|
116
|
-
window.addEventListener('keyup', returnFocus, {
|
|
117
|
-
once: true
|
|
118
|
-
});
|
|
119
|
-
} else if (e.type === 'click' && menu.current) {
|
|
120
|
-
menu.current.addEventListener('focusout', returnFocus, {
|
|
121
|
-
once: true
|
|
122
|
-
});
|
|
123
|
-
} else {
|
|
124
|
-
returnFocus();
|
|
125
|
-
}
|
|
119
|
+
function handleClose() {
|
|
120
|
+
returnFocus();
|
|
126
121
|
if (onClose) {
|
|
127
122
|
onClose();
|
|
128
123
|
}
|
|
@@ -133,7 +128,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(_ref, forwardRef) {
|
|
|
133
128
|
// if the user presses escape or this is a submenu
|
|
134
129
|
// and the user presses ArrowLeft, close it
|
|
135
130
|
if ((match.match(e, keys.Escape) || !isRoot && match.match(e, keys.ArrowLeft)) && onClose) {
|
|
136
|
-
handleClose(
|
|
131
|
+
handleClose();
|
|
137
132
|
} else {
|
|
138
133
|
focusItem(e);
|
|
139
134
|
}
|
|
@@ -168,7 +163,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(_ref, forwardRef) {
|
|
|
168
163
|
}
|
|
169
164
|
function handleBlur(e) {
|
|
170
165
|
if (open && onClose && isRoot && !menu.current?.contains(e.relatedTarget)) {
|
|
171
|
-
handleClose(
|
|
166
|
+
handleClose();
|
|
172
167
|
}
|
|
173
168
|
}
|
|
174
169
|
function fitValue(range, axis) {
|
|
@@ -108,18 +108,28 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(_ref, forwardRe
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
+
|
|
112
|
+
// Avoid stray keyup event from MenuButton affecting MenuItem, and vice versa.
|
|
113
|
+
// Keyboard click is handled differently for <button> vs. <li> and for Enter vs. Space. See
|
|
114
|
+
// https://www.stefanjudis.com/today-i-learned/keyboard-button-clicks-with-space-and-enter-behave-differently/.
|
|
115
|
+
const pendingKeyboardClick = React.useRef(false);
|
|
116
|
+
const keyboardClickEvent = e => match.match(e, keys.Enter) || match.match(e, keys.Space);
|
|
111
117
|
function handleKeyDown(e) {
|
|
112
118
|
if (hasChildren && match.match(e, keys.ArrowRight)) {
|
|
113
119
|
openSubmenu();
|
|
114
120
|
e.stopPropagation();
|
|
115
121
|
}
|
|
116
|
-
|
|
117
|
-
handleClick(e);
|
|
118
|
-
}
|
|
122
|
+
pendingKeyboardClick.current = keyboardClickEvent(e);
|
|
119
123
|
if (rest.onKeyDown) {
|
|
120
124
|
rest.onKeyDown(e);
|
|
121
125
|
}
|
|
122
126
|
}
|
|
127
|
+
function handleKeyUp(e) {
|
|
128
|
+
if (pendingKeyboardClick.current && keyboardClickEvent(e)) {
|
|
129
|
+
handleClick(e);
|
|
130
|
+
}
|
|
131
|
+
pendingKeyboardClick.current = false;
|
|
132
|
+
}
|
|
123
133
|
const classNames = cx__default["default"](className, `${prefix}--menu-item`, {
|
|
124
134
|
[`${prefix}--menu-item--disabled`]: isDisabled,
|
|
125
135
|
[`${prefix}--menu-item--danger`]: isDanger
|
|
@@ -172,7 +182,8 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(_ref, forwardRe
|
|
|
172
182
|
"aria-haspopup": hasChildren ?? undefined,
|
|
173
183
|
"aria-expanded": hasChildren ? submenuOpen : undefined,
|
|
174
184
|
onClick: handleClick,
|
|
175
|
-
onKeyDown: handleKeyDown
|
|
185
|
+
onKeyDown: handleKeyDown,
|
|
186
|
+
onKeyUp: handleKeyUp
|
|
176
187
|
}, getReferenceProps()), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
177
188
|
className: `${prefix}--menu-item__selection-icon`
|
|
178
189
|
}, rest['aria-checked'] && (_Checkmark || (_Checkmark = /*#__PURE__*/React__default["default"].createElement(iconsReact.Checkmark, null)))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -109,28 +109,28 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
|
|
|
109
109
|
target
|
|
110
110
|
} = evt;
|
|
111
111
|
evt.stopPropagation();
|
|
112
|
-
if (open) {
|
|
112
|
+
if (open && target instanceof HTMLElement) {
|
|
113
113
|
if (match.match(evt, keys.Escape)) {
|
|
114
114
|
onRequestClose(evt);
|
|
115
115
|
}
|
|
116
|
-
if (match.match(evt, keys.Enter) && shouldSubmitOnEnter &&
|
|
116
|
+
if (match.match(evt, keys.Enter) && shouldSubmitOnEnter && !isCloseButton(target) && document.activeElement !== button.current) {
|
|
117
117
|
onRequestSubmit(evt);
|
|
118
118
|
}
|
|
119
119
|
if (focusTrapWithoutSentinels && !enableDialogElement && match.match(evt, keys.Tab) && innerModal.current) {
|
|
120
120
|
wrapFocus.wrapFocusWithoutSentinels({
|
|
121
121
|
containerNode: innerModal.current,
|
|
122
|
-
currentActiveNode:
|
|
123
|
-
// TODO: Delete type assertion following util rewrite.
|
|
124
|
-
// https://github.com/carbon-design-system/carbon/pull/18913
|
|
122
|
+
currentActiveNode: target,
|
|
125
123
|
event: evt
|
|
126
124
|
});
|
|
127
125
|
}
|
|
128
126
|
}
|
|
129
127
|
}
|
|
130
128
|
function handleOnClick(evt) {
|
|
131
|
-
const
|
|
129
|
+
const {
|
|
130
|
+
target
|
|
131
|
+
} = evt;
|
|
132
132
|
evt.stopPropagation();
|
|
133
|
-
if (!preventCloseOnClickOutside && !wrapFocus.elementOrParentIsFloatingMenu(target, selectorsFloatingMenus) && innerModal.current && !innerModal.current.contains(target)) {
|
|
133
|
+
if (!preventCloseOnClickOutside && target instanceof Node && !wrapFocus.elementOrParentIsFloatingMenu(target, selectorsFloatingMenus) && innerModal.current && !innerModal.current.contains(target)) {
|
|
134
134
|
onRequestClose(evt);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -139,7 +139,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
|
|
|
139
139
|
target: oldActiveNode,
|
|
140
140
|
relatedTarget: currentActiveNode
|
|
141
141
|
} = _ref2;
|
|
142
|
-
if (open &&
|
|
142
|
+
if (open && oldActiveNode instanceof HTMLElement && currentActiveNode instanceof HTMLElement) {
|
|
143
143
|
const {
|
|
144
144
|
current: bodyNode
|
|
145
145
|
} = innerModal;
|
|
@@ -149,7 +149,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
|
|
|
149
149
|
const {
|
|
150
150
|
current: endTrapNode
|
|
151
151
|
} = endTrap;
|
|
152
|
-
wrapFocus
|
|
152
|
+
wrapFocus.wrapFocus({
|
|
153
153
|
bodyNode,
|
|
154
154
|
startTrapNode,
|
|
155
155
|
endTrapNode,
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { type UseComboboxProps, type UseMultipleSelectionProps } from 'downshift';
|
|
8
8
|
import React, { ReactNode, FunctionComponent, ReactElement } from 'react';
|
|
9
9
|
import { type MultiSelectSortingProps } from './MultiSelectPropTypes';
|
|
10
|
+
import { type ListBoxSize, type ListBoxType } from '../ListBox';
|
|
10
11
|
import { TranslateWithId } from '../../types/common';
|
|
11
12
|
/**
|
|
12
13
|
* Message ids that will be passed to translateWithId().
|
|
@@ -166,7 +167,7 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
|
|
|
166
167
|
* Specify the size of the ListBox.
|
|
167
168
|
* Currently, supports either `sm`, `md` or `lg` as an option.
|
|
168
169
|
*/
|
|
169
|
-
size?:
|
|
170
|
+
size?: ListBoxSize;
|
|
170
171
|
/**
|
|
171
172
|
* @deprecated please use decorator instead.
|
|
172
173
|
* **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
@@ -177,7 +178,7 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
|
|
|
177
178
|
* combobox via ARIA attributes.
|
|
178
179
|
*/
|
|
179
180
|
titleText?: ReactNode;
|
|
180
|
-
type?:
|
|
181
|
+
type?: ListBoxType;
|
|
181
182
|
/**
|
|
182
183
|
* Specify title to show title on hover
|
|
183
184
|
*/
|
|
@@ -787,7 +787,7 @@ FilterableMultiSelect.propTypes = {
|
|
|
787
787
|
/**
|
|
788
788
|
* Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
|
|
789
789
|
*/
|
|
790
|
-
size: ListBoxPropTypes.
|
|
790
|
+
size: ListBoxPropTypes.ListBoxSizePropType,
|
|
791
791
|
slug: deprecate["default"](PropTypes__default["default"].node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
|
|
792
792
|
...MultiSelectPropTypes.sortingPropTypes,
|
|
793
793
|
/**
|
|
@@ -799,6 +799,7 @@ FilterableMultiSelect.propTypes = {
|
|
|
799
799
|
* Callback function for translating ListBoxMenuIcon SVG title
|
|
800
800
|
*/
|
|
801
801
|
translateWithId: PropTypes__default["default"].func,
|
|
802
|
+
type: ListBoxPropTypes.ListBoxTypePropType,
|
|
802
803
|
/**
|
|
803
804
|
* Specify title to show title on hover
|
|
804
805
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { UseSelectProps } from 'downshift';
|
|
8
8
|
import React, { ReactNode } from 'react';
|
|
9
|
-
import { ListBoxSize, ListBoxType } from '../ListBox';
|
|
9
|
+
import { type ListBoxSize, type ListBoxType } from '../ListBox';
|
|
10
10
|
import { MultiSelectSortingProps } from './MultiSelectPropTypes';
|
|
11
11
|
import { ListBoxProps } from '../ListBox/ListBox';
|
|
12
12
|
import type { TranslateWithId } from '../../types/common';
|
|
@@ -173,5 +173,11 @@ export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<Item
|
|
|
173
173
|
*/
|
|
174
174
|
warnText?: ReactNode;
|
|
175
175
|
}
|
|
176
|
-
export declare const MultiSelect:
|
|
176
|
+
export declare const MultiSelect: MultiSelectComponent;
|
|
177
|
+
type MultiSelectComponentProps<ItemType> = React.PropsWithChildren<MultiSelectProps<ItemType>> & React.RefAttributes<HTMLButtonElement>;
|
|
178
|
+
interface MultiSelectComponent {
|
|
179
|
+
propTypes: Record<string, any>;
|
|
180
|
+
displayName: string;
|
|
181
|
+
<ItemType>(props: MultiSelectComponentProps<ItemType>): React.ReactElement<any> | null;
|
|
182
|
+
}
|
|
177
183
|
export {};
|
|
@@ -435,7 +435,10 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
|
|
|
435
435
|
const menuProps = React.useMemo(() => getMenuProps({
|
|
436
436
|
ref: enableFloatingStyles ? refs.setFloating : null
|
|
437
437
|
}), [enableFloatingStyles, getMenuProps, refs.setFloating]);
|
|
438
|
-
const
|
|
438
|
+
const allLabelProps = getLabelProps();
|
|
439
|
+
const labelProps = /*#__PURE__*/React.isValidElement(titleText) ? {
|
|
440
|
+
id: allLabelProps.id
|
|
441
|
+
} : allLabelProps;
|
|
439
442
|
const getSelectionStats = React.useCallback((selectedItems, filteredItems) => {
|
|
440
443
|
const hasIndividualSelections = selectedItems.some(selected => !selected.isSelectAll);
|
|
441
444
|
const nonSelectAllSelectedCount = selectedItems.filter(selected => !selected.isSelectAll).length;
|
|
@@ -677,7 +680,7 @@ MultiSelect.propTypes = {
|
|
|
677
680
|
/**
|
|
678
681
|
* Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
|
|
679
682
|
*/
|
|
680
|
-
size: ListBoxPropTypes.
|
|
683
|
+
size: ListBoxPropTypes.ListBoxSizePropType,
|
|
681
684
|
slug: deprecate["default"](PropTypes__default["default"].node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
|
|
682
685
|
/**
|
|
683
686
|
* Provide a method that sorts all options in the control. Overriding this
|
|
@@ -712,7 +715,7 @@ MultiSelect.propTypes = {
|
|
|
712
715
|
/**
|
|
713
716
|
* Specify 'inline' to create an inline multi-select.
|
|
714
717
|
*/
|
|
715
|
-
type:
|
|
718
|
+
type: ListBoxPropTypes.ListBoxTypePropType,
|
|
716
719
|
/**
|
|
717
720
|
* Specify title to show title on hover
|
|
718
721
|
*/
|