@carbon/react 1.39.0 → 1.41.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 +2755 -901
- package/es/components/Accordion/Accordion.Skeleton.d.ts +0 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -5
- package/es/components/Breadcrumb/BreadcrumbItem.js +3 -1
- package/es/components/Checkbox/Checkbox.js +3 -6
- package/es/components/CodeSnippet/CodeSnippet.js +5 -12
- package/es/components/ComboBox/ComboBox.d.ts +1 -5
- package/es/components/ComboBox/ComboBox.js +6 -20
- package/es/components/ComposedModal/ComposedModal.js +1 -4
- package/es/components/ComposedModal/ModalFooter.js +4 -9
- package/es/components/ComposedModal/ModalHeader.js +1 -4
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
- package/es/components/ContentSwitcher/ContentSwitcher.js +7 -11
- package/es/components/Copy/Copy.js +4 -8
- package/es/components/CopyButton/CopyButton.js +8 -7
- package/es/components/DataTable/DataTable.d.ts +3 -39
- package/es/components/DataTable/DataTable.js +10 -18
- package/es/components/DataTable/Table.d.ts +0 -4
- package/es/components/DataTable/Table.js +0 -4
- package/es/components/DataTable/TableBatchAction.js +12 -5
- package/es/components/DataTable/TableBatchActions.js +1 -6
- package/es/components/DataTable/TableBody.d.ts +0 -3
- package/es/components/DataTable/TableBody.js +1 -3
- package/es/components/DataTable/TableHeader.js +3 -8
- package/es/components/DataTable/TableSelectAll.d.ts +0 -3
- package/es/components/DataTable/TableSelectAll.js +2 -4
- package/es/components/DataTable/TableSelectRow.js +2 -1
- package/es/components/DataTable/TableToolbar.d.ts +10 -0
- package/es/components/DataTable/TableToolbar.js +15 -7
- package/es/components/DataTable/TableToolbarMenu.js +2 -6
- package/es/components/DataTable/TableToolbarSearch.d.ts +2 -8
- package/es/components/DataTable/TableToolbarSearch.js +6 -11
- package/es/components/DataTable/tools/sorting.js +2 -2
- package/es/components/DatePicker/DatePicker.d.ts +4 -4
- package/es/components/DatePicker/DatePicker.js +9 -4
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
- package/es/components/DatePickerInput/DatePickerInput.js +12 -6
- package/es/components/Dropdown/Dropdown.js +6 -15
- package/es/components/FileUploader/FileUploader.d.ts +2 -11
- package/es/components/FileUploader/FileUploader.js +15 -19
- package/es/components/FileUploader/FileUploaderButton.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
- package/es/components/FileUploader/FileUploaderDropContainer.js +2 -8
- package/es/components/FileUploader/FileUploaderItem.d.ts +4 -4
- package/es/components/FileUploader/FileUploaderItem.js +42 -12
- package/es/components/FileUploader/Filename.d.ts +6 -10
- package/es/components/FileUploader/Filename.js +9 -12
- package/es/components/FormGroup/FormGroup.d.ts +0 -5
- package/es/components/FormGroup/FormGroup.js +3 -8
- package/es/components/FormItem/FormItem.d.ts +32 -0
- package/es/components/FormItem/index.d.ts +9 -0
- package/es/components/FormLabel/FormLabel.js +4 -1
- package/es/components/ListBox/ListBox.js +4 -8
- package/es/components/ListBox/ListBoxMenuIcon.js +1 -4
- package/es/components/ListBox/ListBoxMenuItem.js +4 -8
- package/es/components/ListBox/ListBoxSelection.d.ts +5 -5
- package/es/components/ListBox/ListBoxSelection.js +12 -13
- package/es/components/ListBox/next/ListBoxSelection.js +12 -13
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -5
- package/es/components/ListItem/ListItem.d.ts +1 -1
- package/es/components/ListItem/ListItem.js +6 -2
- package/es/components/Menu/MenuItem.js +4 -1
- package/es/components/Modal/Modal.js +16 -27
- package/es/components/ModalWrapper/ModalWrapper.js +13 -19
- package/es/components/MultiSelect/FilterableMultiSelect.js +14 -28
- package/es/components/MultiSelect/MultiSelect.js +17 -33
- package/es/components/MultiSelect/MultiSelectPropTypes.js +2 -2
- package/es/components/MultiSelect/tools/sorting.js +2 -2
- package/es/components/Notification/Notification.d.ts +11 -29
- package/es/components/Notification/Notification.js +38 -57
- package/es/components/NumberInput/NumberInput.js +6 -2
- package/es/components/OverflowMenu/OverflowMenu.js +27 -33
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
- package/es/components/Pagination/experimental/PageSelector.js +3 -8
- package/es/components/Pagination/experimental/Pagination.js +16 -34
- package/es/components/ProgressIndicator/ProgressIndicator.js +7 -6
- package/es/components/RadioTile/RadioTile.js +6 -7
- package/es/components/Search/Search.Skeleton.d.ts +0 -3
- package/es/components/Search/Search.Skeleton.js +1 -4
- package/es/components/Search/Search.js +1 -1
- package/es/components/Select/Select.d.ts +2 -2
- package/es/components/Select/Select.js +13 -16
- package/es/components/SelectItem/SelectItem.d.ts +0 -6
- package/es/components/SelectItem/SelectItem.js +4 -10
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -4
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
- package/es/components/SkeletonIcon/SkeletonIcon.js +2 -3
- package/es/components/SkeletonText/SkeletonText.d.ts +0 -6
- package/es/components/SkeletonText/SkeletonText.js +0 -6
- package/es/components/Slider/Slider.Skeleton.d.ts +9 -1
- package/es/components/Slider/Slider.Skeleton.js +20 -4
- package/es/components/Slider/Slider.d.ts +137 -25
- package/es/components/Slider/Slider.js +779 -186
- package/es/components/StructuredList/StructuredList.js +5 -2
- package/es/components/Switch/Switch.js +3 -7
- package/es/components/Tabs/Tabs.js +5 -2
- package/es/components/Tag/Tag.js +4 -2
- package/es/components/Text/Text.js +1 -1
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/TextArea/TextArea.js +30 -34
- package/es/components/TextInput/ControlledPasswordInput.js +12 -19
- package/es/components/TextInput/TextInput.js +8 -3
- package/es/components/Tile/Tile.js +4 -2
- package/es/components/TileGroup/TileGroup.js +5 -4
- package/es/components/Toggle/Toggle.js +4 -2
- package/es/components/UIShell/Content.js +1 -4
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNavDetails.d.ts +32 -0
- package/es/components/UIShell/SideNavDetails.js +1 -2
- package/es/components/UIShell/SideNavDivider.d.ts +15 -0
- package/es/components/UIShell/SideNavDivider.js +2 -2
- package/es/components/UIShell/SideNavFooter.js +2 -5
- package/es/components/UIShell/SideNavIcon.d.ts +25 -0
- package/es/components/UIShell/SideNavIcon.js +4 -7
- package/es/components/UIShell/SideNavLinkText.d.ts +26 -0
- package/es/components/UIShell/SideNavLinkText.js +1 -1
- package/es/components/UIShell/SideNavMenu.d.ts +46 -0
- package/es/components/UIShell/SideNavMenu.js +23 -13
- package/es/components/UIShell/SideNavSwitcher.d.ts +31 -0
- package/es/components/UIShell/SideNavSwitcher.js +6 -5
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.js +2 -7
- package/es/internal/Selection.js +0 -3
- package/es/internal/noopFn.d.ts +7 -0
- package/es/internal/noopFn.js +10 -0
- package/es/internal/useNormalizedInputProps.js +6 -2
- package/lib/components/Accordion/Accordion.Skeleton.d.ts +0 -5
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -5
- package/lib/components/Breadcrumb/BreadcrumbItem.js +3 -1
- package/lib/components/Checkbox/Checkbox.js +3 -6
- package/lib/components/CodeSnippet/CodeSnippet.js +5 -12
- package/lib/components/ComboBox/ComboBox.d.ts +1 -5
- package/lib/components/ComboBox/ComboBox.js +5 -19
- package/lib/components/ComposedModal/ComposedModal.js +1 -4
- package/lib/components/ComposedModal/ModalFooter.js +4 -9
- package/lib/components/ComposedModal/ModalHeader.js +1 -4
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
- package/lib/components/ContentSwitcher/ContentSwitcher.js +7 -11
- package/lib/components/Copy/Copy.js +4 -8
- package/lib/components/CopyButton/CopyButton.js +8 -7
- package/lib/components/DataTable/DataTable.d.ts +3 -39
- package/lib/components/DataTable/DataTable.js +13 -21
- package/lib/components/DataTable/Table.d.ts +0 -4
- package/lib/components/DataTable/Table.js +0 -4
- package/lib/components/DataTable/TableBatchAction.js +12 -5
- package/lib/components/DataTable/TableBatchActions.js +1 -6
- package/lib/components/DataTable/TableBody.d.ts +0 -3
- package/lib/components/DataTable/TableBody.js +1 -3
- package/lib/components/DataTable/TableHeader.js +3 -8
- package/lib/components/DataTable/TableSelectAll.d.ts +0 -3
- package/lib/components/DataTable/TableSelectAll.js +2 -4
- package/lib/components/DataTable/TableSelectRow.js +2 -1
- package/lib/components/DataTable/TableToolbar.d.ts +10 -0
- package/lib/components/DataTable/TableToolbar.js +15 -7
- package/lib/components/DataTable/TableToolbarMenu.js +2 -6
- package/lib/components/DataTable/TableToolbarSearch.d.ts +2 -8
- package/lib/components/DataTable/TableToolbarSearch.js +6 -11
- package/lib/components/DataTable/tools/sorting.js +2 -2
- package/lib/components/DatePicker/DatePicker.d.ts +4 -4
- package/lib/components/DatePicker/DatePicker.js +9 -4
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
- package/lib/components/DatePickerInput/DatePickerInput.js +12 -6
- package/lib/components/Dropdown/Dropdown.js +6 -15
- package/lib/components/FileUploader/FileUploader.d.ts +2 -11
- package/lib/components/FileUploader/FileUploader.js +15 -19
- package/lib/components/FileUploader/FileUploaderButton.js +2 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
- package/lib/components/FileUploader/FileUploaderDropContainer.js +2 -8
- package/lib/components/FileUploader/FileUploaderItem.d.ts +4 -4
- package/lib/components/FileUploader/FileUploaderItem.js +41 -11
- package/lib/components/FileUploader/Filename.d.ts +6 -10
- package/lib/components/FileUploader/Filename.js +9 -12
- package/lib/components/FormGroup/FormGroup.d.ts +0 -5
- package/lib/components/FormGroup/FormGroup.js +3 -8
- package/lib/components/FormItem/FormItem.d.ts +32 -0
- package/lib/components/FormItem/index.d.ts +9 -0
- package/lib/components/FormLabel/FormLabel.js +4 -1
- package/lib/components/ListBox/ListBox.js +4 -8
- package/lib/components/ListBox/ListBoxMenuIcon.js +1 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -8
- package/lib/components/ListBox/ListBoxSelection.d.ts +5 -5
- package/lib/components/ListBox/ListBoxSelection.js +12 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +12 -13
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -5
- package/lib/components/ListItem/ListItem.d.ts +1 -1
- package/lib/components/ListItem/ListItem.js +6 -2
- package/lib/components/Menu/MenuItem.js +4 -1
- package/lib/components/Modal/Modal.js +16 -27
- package/lib/components/ModalWrapper/ModalWrapper.js +13 -19
- package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -32
- package/lib/components/MultiSelect/MultiSelect.js +16 -32
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -2
- package/lib/components/MultiSelect/tools/sorting.js +2 -2
- package/lib/components/Notification/Notification.d.ts +11 -29
- package/lib/components/Notification/Notification.js +38 -57
- package/lib/components/NumberInput/NumberInput.js +6 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +27 -33
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
- package/lib/components/Pagination/experimental/PageSelector.js +3 -8
- package/lib/components/Pagination/experimental/Pagination.js +16 -34
- package/lib/components/ProgressIndicator/ProgressIndicator.js +7 -6
- package/lib/components/RadioTile/RadioTile.js +6 -7
- package/lib/components/Search/Search.Skeleton.d.ts +0 -3
- package/lib/components/Search/Search.Skeleton.js +1 -4
- package/lib/components/Search/Search.js +1 -1
- package/lib/components/Select/Select.d.ts +2 -2
- package/lib/components/Select/Select.js +13 -16
- package/lib/components/SelectItem/SelectItem.d.ts +0 -6
- package/lib/components/SelectItem/SelectItem.js +4 -10
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -4
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
- package/lib/components/SkeletonIcon/SkeletonIcon.js +2 -3
- package/lib/components/SkeletonText/SkeletonText.d.ts +0 -6
- package/lib/components/SkeletonText/SkeletonText.js +0 -6
- package/lib/components/Slider/Slider.Skeleton.d.ts +9 -1
- package/lib/components/Slider/Slider.Skeleton.js +20 -4
- package/lib/components/Slider/Slider.d.ts +137 -25
- package/lib/components/Slider/Slider.js +778 -185
- package/lib/components/StructuredList/StructuredList.js +5 -2
- package/lib/components/Switch/Switch.js +3 -7
- package/lib/components/Tabs/Tabs.js +5 -2
- package/lib/components/Tag/Tag.js +4 -2
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/TextArea/TextArea.js +30 -34
- package/lib/components/TextInput/ControlledPasswordInput.js +12 -19
- package/lib/components/TextInput/TextInput.js +8 -3
- package/lib/components/Tile/Tile.js +4 -2
- package/lib/components/TileGroup/TileGroup.js +5 -4
- package/lib/components/Toggle/Toggle.js +4 -2
- package/lib/components/UIShell/Content.js +1 -4
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNavDetails.d.ts +32 -0
- package/lib/components/UIShell/SideNavDetails.js +1 -2
- package/lib/components/UIShell/SideNavDivider.d.ts +15 -0
- package/lib/components/UIShell/SideNavDivider.js +2 -2
- package/lib/components/UIShell/SideNavFooter.js +2 -5
- package/lib/components/UIShell/SideNavIcon.d.ts +25 -0
- package/lib/components/UIShell/SideNavIcon.js +4 -7
- package/lib/components/UIShell/SideNavLinkText.d.ts +26 -0
- package/lib/components/UIShell/SideNavLinkText.js +2 -2
- package/lib/components/UIShell/SideNavMenu.d.ts +46 -0
- package/lib/components/UIShell/SideNavMenu.js +23 -13
- package/lib/components/UIShell/SideNavSwitcher.d.ts +31 -0
- package/lib/components/UIShell/SideNavSwitcher.js +5 -4
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.js +2 -7
- package/lib/internal/Selection.js +0 -3
- package/lib/internal/noopFn.d.ts +7 -0
- package/lib/internal/noopFn.js +14 -0
- package/lib/internal/useNormalizedInputProps.js +6 -2
- package/package.json +10 -9
|
@@ -25,11 +25,11 @@ const FormGroup = _ref => {
|
|
|
25
25
|
let {
|
|
26
26
|
legendId,
|
|
27
27
|
legendText,
|
|
28
|
-
invalid,
|
|
28
|
+
invalid = false,
|
|
29
29
|
children,
|
|
30
30
|
className,
|
|
31
|
-
message,
|
|
32
|
-
messageText,
|
|
31
|
+
message = false,
|
|
32
|
+
messageText = '',
|
|
33
33
|
...rest
|
|
34
34
|
} = _ref;
|
|
35
35
|
const prefix = usePrefix.usePrefix();
|
|
@@ -78,10 +78,5 @@ FormGroup.propTypes = {
|
|
|
78
78
|
*/
|
|
79
79
|
messageText: PropTypes__default["default"].string
|
|
80
80
|
};
|
|
81
|
-
FormGroup.defaultProps = {
|
|
82
|
-
invalid: false,
|
|
83
|
-
message: false,
|
|
84
|
-
messageText: ''
|
|
85
|
-
};
|
|
86
81
|
|
|
87
82
|
exports["default"] = FormGroup;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
type FormItemProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Provide content to be rendered in the form item
|
|
12
|
+
*/
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Provide a custom className to be applied to the containing node
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
declare function FormItem({ className, children, ...rest }: FormItemProps): JSX.Element;
|
|
20
|
+
declare namespace FormItem {
|
|
21
|
+
var propTypes: {
|
|
22
|
+
/**
|
|
23
|
+
* Provide content to be rendered in the form item
|
|
24
|
+
*/
|
|
25
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
|
+
/**
|
|
27
|
+
* Provide a custom className to be applied to the containing node
|
|
28
|
+
*/
|
|
29
|
+
className: PropTypes.Requireable<string>;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export default FormItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import FormItem from './FormItem';
|
|
8
|
+
export default FormItem;
|
|
9
|
+
export { FormItem };
|
|
@@ -14,6 +14,8 @@ var PropTypes = require('prop-types');
|
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
require('../Text/index.js');
|
|
18
|
+
var Text = require('../Text/Text.js');
|
|
17
19
|
|
|
18
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
21
|
|
|
@@ -30,7 +32,8 @@ function FormLabel(_ref) {
|
|
|
30
32
|
} = _ref;
|
|
31
33
|
const prefix = usePrefix.usePrefix();
|
|
32
34
|
const className = cx__default["default"](`${prefix}--label`, `${prefix}--label--no-margin`, customClassName);
|
|
33
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
35
|
+
return /*#__PURE__*/React__default["default"].createElement(Text.Text, _rollupPluginBabelHelpers["extends"]({
|
|
36
|
+
as: "label",
|
|
34
37
|
htmlFor: id,
|
|
35
38
|
className: className
|
|
36
39
|
}, rest), children);
|
|
@@ -42,8 +42,8 @@ const ListBox = /*#__PURE__*/React__default["default"].forwardRef(function ListB
|
|
|
42
42
|
let {
|
|
43
43
|
children,
|
|
44
44
|
className: containerClassName,
|
|
45
|
-
disabled,
|
|
46
|
-
type,
|
|
45
|
+
disabled = false,
|
|
46
|
+
type = 'default',
|
|
47
47
|
size,
|
|
48
48
|
invalid,
|
|
49
49
|
invalidText,
|
|
@@ -98,7 +98,7 @@ ListBox.propTypes = {
|
|
|
98
98
|
/**
|
|
99
99
|
* Specify whether the ListBox is currently disabled
|
|
100
100
|
*/
|
|
101
|
-
disabled: PropTypes__default["default"].bool
|
|
101
|
+
disabled: PropTypes__default["default"].bool,
|
|
102
102
|
/**
|
|
103
103
|
* Specify whether the control is currently invalid
|
|
104
104
|
*/
|
|
@@ -124,7 +124,7 @@ ListBox.propTypes = {
|
|
|
124
124
|
* Specify the "type" of the ListBox. Currently supports either `default` or
|
|
125
125
|
* `inline` as an option.
|
|
126
126
|
*/
|
|
127
|
-
type: ListBoxPropTypes.ListBoxType
|
|
127
|
+
type: ListBoxPropTypes.ListBoxType,
|
|
128
128
|
/**
|
|
129
129
|
* Specify whether the control is currently in warning state
|
|
130
130
|
*/
|
|
@@ -134,9 +134,5 @@ ListBox.propTypes = {
|
|
|
134
134
|
*/
|
|
135
135
|
warnText: PropTypes__default["default"].node
|
|
136
136
|
};
|
|
137
|
-
ListBox.defaultProps = {
|
|
138
|
-
disabled: false,
|
|
139
|
-
type: 'default'
|
|
140
|
-
};
|
|
141
137
|
|
|
142
138
|
exports["default"] = ListBox;
|
|
@@ -62,10 +62,7 @@ ListBoxMenuIcon.propTypes = {
|
|
|
62
62
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
63
63
|
* return a string message for that given message id.
|
|
64
64
|
*/
|
|
65
|
-
translateWithId: PropTypes__default["default"].func
|
|
66
|
-
};
|
|
67
|
-
ListBoxMenuIcon.defaultProps = {
|
|
68
|
-
translateWithId: defaultTranslateWithId
|
|
65
|
+
translateWithId: PropTypes__default["default"].func
|
|
69
66
|
};
|
|
70
67
|
|
|
71
68
|
exports["default"] = ListBoxMenuIcon;
|
|
@@ -41,8 +41,8 @@ function useIsTruncated(ref) {
|
|
|
41
41
|
const ListBoxMenuItem = /*#__PURE__*/React__default["default"].forwardRef(function ListBoxMenuItem(_ref, forwardedRef) {
|
|
42
42
|
let {
|
|
43
43
|
children,
|
|
44
|
-
isActive,
|
|
45
|
-
isHighlighted,
|
|
44
|
+
isActive = false,
|
|
45
|
+
isHighlighted = false,
|
|
46
46
|
title,
|
|
47
47
|
...rest
|
|
48
48
|
} = _ref;
|
|
@@ -75,19 +75,15 @@ ListBoxMenuItem.propTypes = {
|
|
|
75
75
|
/**
|
|
76
76
|
* Specify whether the current menu item is "active".
|
|
77
77
|
*/
|
|
78
|
-
isActive: PropTypes__default["default"].bool
|
|
78
|
+
isActive: PropTypes__default["default"].bool,
|
|
79
79
|
/**
|
|
80
80
|
* Specify whether the current menu item is "highlighted".
|
|
81
81
|
*/
|
|
82
|
-
isHighlighted: PropTypes__default["default"].bool
|
|
82
|
+
isHighlighted: PropTypes__default["default"].bool,
|
|
83
83
|
/**
|
|
84
84
|
* Provide an optional tooltip for the ListBoxMenuItem
|
|
85
85
|
*/
|
|
86
86
|
title: PropTypes__default["default"].string
|
|
87
87
|
};
|
|
88
|
-
ListBoxMenuItem.defaultProps = {
|
|
89
|
-
isActive: false,
|
|
90
|
-
isHighlighted: false
|
|
91
|
-
};
|
|
92
88
|
|
|
93
89
|
exports["default"] = ListBoxMenuItem;
|
|
@@ -35,17 +35,17 @@ export interface ListBoxSelectionProps {
|
|
|
35
35
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
36
36
|
* return a string message for that given message id.
|
|
37
37
|
*/
|
|
38
|
-
translateWithId(messageId: string, args?: Record<string, unknown>): string;
|
|
38
|
+
translateWithId?(messageId: string, args?: Record<string, unknown>): string;
|
|
39
39
|
}
|
|
40
40
|
export type ListBoxSelectionComponent = React.FC<ListBoxSelectionProps>;
|
|
41
|
+
export declare const translationIds: {
|
|
42
|
+
'clear.all': string;
|
|
43
|
+
'clear.selection': string;
|
|
44
|
+
};
|
|
41
45
|
/**
|
|
42
46
|
* `ListBoxSelection` is used to provide controls for clearing a selection, in
|
|
43
47
|
* addition to conditionally rendering a badge if the control has more than one
|
|
44
48
|
* selection.
|
|
45
49
|
*/
|
|
46
50
|
declare const ListBoxSelection: ListBoxSelectionComponent;
|
|
47
|
-
export declare const translationIds: {
|
|
48
|
-
'clear.all': string;
|
|
49
|
-
'clear.selection': string;
|
|
50
|
-
};
|
|
51
51
|
export default ListBoxSelection;
|
|
@@ -22,6 +22,16 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
22
22
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
23
|
|
|
24
24
|
var _Close, _Close2;
|
|
25
|
+
const translationIds = {
|
|
26
|
+
'clear.all': 'clear.all',
|
|
27
|
+
'clear.selection': 'clear.selection'
|
|
28
|
+
};
|
|
29
|
+
const defaultTranslations = {
|
|
30
|
+
[translationIds['clear.all']]: 'Clear all selected items',
|
|
31
|
+
[translationIds['clear.selection']]: 'Clear selected item'
|
|
32
|
+
};
|
|
33
|
+
const defaultTranslateWithId = id => defaultTranslations[id];
|
|
34
|
+
|
|
25
35
|
/**
|
|
26
36
|
* `ListBoxSelection` is used to provide controls for clearing a selection, in
|
|
27
37
|
* addition to conditionally rendering a badge if the control has more than one
|
|
@@ -31,7 +41,7 @@ const ListBoxSelection = _ref => {
|
|
|
31
41
|
let {
|
|
32
42
|
clearSelection,
|
|
33
43
|
selectionCount,
|
|
34
|
-
translateWithId: t,
|
|
44
|
+
translateWithId: t = defaultTranslateWithId,
|
|
35
45
|
disabled,
|
|
36
46
|
onClearSelection,
|
|
37
47
|
readOnly
|
|
@@ -79,14 +89,6 @@ const ListBoxSelection = _ref => {
|
|
|
79
89
|
title: description
|
|
80
90
|
}, selectionCount, _Close2 || (_Close2 = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null)));
|
|
81
91
|
};
|
|
82
|
-
const translationIds = {
|
|
83
|
-
'clear.all': 'clear.all',
|
|
84
|
-
'clear.selection': 'clear.selection'
|
|
85
|
-
};
|
|
86
|
-
const defaultTranslations = {
|
|
87
|
-
[translationIds['clear.all']]: 'Clear all selected items',
|
|
88
|
-
[translationIds['clear.selection']]: 'Clear selected item'
|
|
89
|
-
};
|
|
90
92
|
ListBoxSelection.propTypes = {
|
|
91
93
|
/**
|
|
92
94
|
* Specify a function to be invoked when a user interacts with the clear
|
|
@@ -116,10 +118,7 @@ ListBoxSelection.propTypes = {
|
|
|
116
118
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
117
119
|
* return a string message for that given message id.
|
|
118
120
|
*/
|
|
119
|
-
translateWithId: PropTypes__default["default"].func
|
|
120
|
-
};
|
|
121
|
-
ListBoxSelection.defaultProps = {
|
|
122
|
-
translateWithId: id => defaultTranslations[id]
|
|
121
|
+
translateWithId: PropTypes__default["default"].func
|
|
123
122
|
};
|
|
124
123
|
|
|
125
124
|
exports["default"] = ListBoxSelection;
|
|
@@ -29,11 +29,21 @@ var _Close, _Close2;
|
|
|
29
29
|
* addition to conditionally rendering a badge if the control has more than one
|
|
30
30
|
* selection.
|
|
31
31
|
*/
|
|
32
|
+
|
|
33
|
+
const translationIds = {
|
|
34
|
+
'clear.all': 'clear.all',
|
|
35
|
+
'clear.selection': 'clear.selection'
|
|
36
|
+
};
|
|
37
|
+
const defaultTranslations = {
|
|
38
|
+
[translationIds['clear.all']]: 'Clear all selected items',
|
|
39
|
+
[translationIds['clear.selection']]: 'Clear selected item'
|
|
40
|
+
};
|
|
41
|
+
const defaultTranslateWithId = id => defaultTranslations[id];
|
|
32
42
|
function ListBoxSelection(_ref) {
|
|
33
43
|
let {
|
|
34
44
|
clearSelection,
|
|
35
45
|
selectionCount,
|
|
36
|
-
translateWithId: t,
|
|
46
|
+
translateWithId: t = defaultTranslateWithId,
|
|
37
47
|
disabled,
|
|
38
48
|
onClearSelection,
|
|
39
49
|
...rest
|
|
@@ -83,14 +93,6 @@ function ListBoxSelection(_ref) {
|
|
|
83
93
|
type: "button"
|
|
84
94
|
}), _Close2 || (_Close2 = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null)));
|
|
85
95
|
}
|
|
86
|
-
const translationIds = {
|
|
87
|
-
'clear.all': 'clear.all',
|
|
88
|
-
'clear.selection': 'clear.selection'
|
|
89
|
-
};
|
|
90
|
-
const defaultTranslations = {
|
|
91
|
-
[translationIds['clear.all']]: 'Clear all selected items',
|
|
92
|
-
[translationIds['clear.selection']]: 'Clear selected item'
|
|
93
|
-
};
|
|
94
96
|
ListBoxSelection.propTypes = {
|
|
95
97
|
/**
|
|
96
98
|
* Specify a function to be invoked when a user interacts with the clear
|
|
@@ -126,10 +128,7 @@ ListBoxSelection.propTypes = {
|
|
|
126
128
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
127
129
|
* return a string message for that given message id.
|
|
128
130
|
*/
|
|
129
|
-
translateWithId: PropTypes__default["default"].func
|
|
130
|
-
};
|
|
131
|
-
ListBoxSelection.defaultProps = {
|
|
132
|
-
translateWithId: id => defaultTranslations[id]
|
|
131
|
+
translateWithId: PropTypes__default["default"].func
|
|
133
132
|
};
|
|
134
133
|
|
|
135
134
|
exports["default"] = ListBoxSelection;
|
|
@@ -31,6 +31,7 @@ const defaultTranslations = {
|
|
|
31
31
|
[translationIds['close.menu']]: 'Close',
|
|
32
32
|
[translationIds['open.menu']]: 'Open'
|
|
33
33
|
};
|
|
34
|
+
const defaultTranslateWithId = id => defaultTranslations[id];
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* `ListBoxTrigger` is used to orient the icon up or down depending on the
|
|
@@ -39,7 +40,7 @@ const defaultTranslations = {
|
|
|
39
40
|
const ListBoxTrigger = _ref => {
|
|
40
41
|
let {
|
|
41
42
|
isOpen,
|
|
42
|
-
translateWithId: t,
|
|
43
|
+
translateWithId: t = defaultTranslateWithId,
|
|
43
44
|
...rest
|
|
44
45
|
} = _ref;
|
|
45
46
|
const prefix = usePrefix.usePrefix();
|
|
@@ -67,10 +68,7 @@ ListBoxTrigger.propTypes = {
|
|
|
67
68
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
68
69
|
* return a string message for that given message id.
|
|
69
70
|
*/
|
|
70
|
-
translateWithId: PropTypes__default["default"].func
|
|
71
|
-
};
|
|
72
|
-
ListBoxTrigger.defaultProps = {
|
|
73
|
-
translateWithId: id => defaultTranslations[id]
|
|
71
|
+
translateWithId: PropTypes__default["default"].func
|
|
74
72
|
};
|
|
75
73
|
var ListBoxTrigger$1 = ListBoxTrigger;
|
|
76
74
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { type ComponentProps } from 'react';
|
|
9
9
|
type ListItemProps = ComponentProps<'li'>;
|
|
10
|
-
declare function ListItem({ className, ...other }: ListItemProps): JSX.Element;
|
|
10
|
+
declare function ListItem({ className, children, ...other }: ListItemProps): JSX.Element;
|
|
11
11
|
declare namespace ListItem {
|
|
12
12
|
var propTypes: {
|
|
13
13
|
/**
|
|
@@ -14,6 +14,8 @@ var PropTypes = require('prop-types');
|
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
require('../Text/index.js');
|
|
18
|
+
var Text = require('../Text/Text.js');
|
|
17
19
|
|
|
18
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
21
|
|
|
@@ -24,13 +26,15 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
24
26
|
function ListItem(_ref) {
|
|
25
27
|
let {
|
|
26
28
|
className,
|
|
29
|
+
children,
|
|
27
30
|
...other
|
|
28
31
|
} = _ref;
|
|
29
32
|
const prefix = usePrefix.usePrefix();
|
|
30
33
|
const classNames = cx__default["default"](`${prefix}--list__item`, className);
|
|
31
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
34
|
+
return /*#__PURE__*/React__default["default"].createElement(Text.Text, _rollupPluginBabelHelpers["extends"]({
|
|
35
|
+
as: "li",
|
|
32
36
|
className: classNames
|
|
33
|
-
}, other));
|
|
37
|
+
}, other), children);
|
|
34
38
|
}
|
|
35
39
|
ListItem.propTypes = {
|
|
36
40
|
/**
|
|
@@ -19,7 +19,9 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
|
19
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
20
|
var Menu = require('./Menu.js');
|
|
21
21
|
var MenuContext = require('./MenuContext.js');
|
|
22
|
+
require('../Text/index.js');
|
|
22
23
|
var useLayoutDirection = require('../LayoutDirection/useLayoutDirection.js');
|
|
24
|
+
var Text = require('../Text/Text.js');
|
|
23
25
|
var match = require('../../internal/keyboard/match.js');
|
|
24
26
|
var keys = require('../../internal/keyboard/keys.js');
|
|
25
27
|
|
|
@@ -166,7 +168,8 @@ const MenuItem = /*#__PURE__*/React__default["default"].forwardRef(function Menu
|
|
|
166
168
|
onKeyDown: handleKeyDown
|
|
167
169
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
168
170
|
className: `${prefix}--menu-item__icon`
|
|
169
|
-
}, IconElement && /*#__PURE__*/React__default["default"].createElement(IconElement, null)), /*#__PURE__*/React__default["default"].createElement(
|
|
171
|
+
}, IconElement && /*#__PURE__*/React__default["default"].createElement(IconElement, null)), /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
172
|
+
as: "div",
|
|
170
173
|
className: `${prefix}--menu-item__label`
|
|
171
174
|
}, label), shortcut && !hasChildren && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
172
175
|
className: `${prefix}--menu-item__shortcut`
|
|
@@ -22,6 +22,9 @@ var requiredIfGivenPropIsTruthy = require('../../prop-types/requiredIfGivenPropI
|
|
|
22
22
|
var wrapFocus = require('../../internal/wrapFocus.js');
|
|
23
23
|
var setupGetInstanceId = require('../../tools/setupGetInstanceId.js');
|
|
24
24
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
25
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
26
|
+
require('../Text/index.js');
|
|
27
|
+
var Text = require('../Text/Text.js');
|
|
25
28
|
var match = require('../../internal/keyboard/match.js');
|
|
26
29
|
var keys = require('../../internal/keyboard/keys.js');
|
|
27
30
|
|
|
@@ -37,31 +40,27 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
|
|
|
37
40
|
'aria-label': ariaLabelProp,
|
|
38
41
|
children,
|
|
39
42
|
className,
|
|
40
|
-
modalHeading,
|
|
41
|
-
modalLabel,
|
|
43
|
+
modalHeading = '',
|
|
44
|
+
modalLabel = '',
|
|
42
45
|
modalAriaLabel,
|
|
43
|
-
passiveModal,
|
|
46
|
+
passiveModal = false,
|
|
44
47
|
secondaryButtonText,
|
|
45
48
|
primaryButtonText,
|
|
46
49
|
open,
|
|
47
|
-
onRequestClose,
|
|
48
|
-
onRequestSubmit,
|
|
50
|
+
onRequestClose = noopFn.noopFn,
|
|
51
|
+
onRequestSubmit = noopFn.noopFn,
|
|
49
52
|
onSecondarySubmit,
|
|
50
|
-
primaryButtonDisabled,
|
|
53
|
+
primaryButtonDisabled = false,
|
|
51
54
|
danger,
|
|
52
55
|
alert,
|
|
53
56
|
secondaryButtons,
|
|
54
|
-
selectorPrimaryFocus,
|
|
55
|
-
// eslint-disable-line
|
|
57
|
+
selectorPrimaryFocus = '[data-modal-primary-focus]',
|
|
56
58
|
selectorsFloatingMenus,
|
|
57
|
-
// eslint-disable-line
|
|
58
59
|
shouldSubmitOnEnter,
|
|
59
|
-
// eslint-disable-line
|
|
60
60
|
size,
|
|
61
|
-
hasScrollingContent,
|
|
61
|
+
hasScrollingContent = false,
|
|
62
62
|
closeButtonLabel,
|
|
63
|
-
preventCloseOnClickOutside,
|
|
64
|
-
// eslint-disable-line
|
|
63
|
+
preventCloseOnClickOutside = false,
|
|
65
64
|
isFullWidth,
|
|
66
65
|
launcherButtonRef,
|
|
67
66
|
...rest
|
|
@@ -210,10 +209,12 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
|
|
|
210
209
|
tabIndex: "-1"
|
|
211
210
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
212
211
|
className: `${prefix}--modal-header`
|
|
213
|
-
}, passiveModal && modalButton, modalLabel && /*#__PURE__*/React__default["default"].createElement(
|
|
212
|
+
}, passiveModal && modalButton, modalLabel && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
213
|
+
as: "h2",
|
|
214
214
|
id: modalLabelId,
|
|
215
215
|
className: `${prefix}--modal-header__label`
|
|
216
|
-
}, modalLabel), /*#__PURE__*/React__default["default"].createElement(
|
|
216
|
+
}, modalLabel), /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
217
|
+
as: "h3",
|
|
217
218
|
id: modalHeadingId,
|
|
218
219
|
className: `${prefix}--modal-header__heading`
|
|
219
220
|
}, modalHeading), !passiveModal && modalButton), /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
@@ -402,18 +403,6 @@ Modal.propTypes = {
|
|
|
402
403
|
*/
|
|
403
404
|
size: PropTypes__default["default"].oneOf(['xs', 'sm', 'md', 'lg'])
|
|
404
405
|
};
|
|
405
|
-
Modal.defaultProps = {
|
|
406
|
-
onRequestClose: () => {},
|
|
407
|
-
onRequestSubmit: () => {},
|
|
408
|
-
primaryButtonDisabled: false,
|
|
409
|
-
onKeyDown: () => {},
|
|
410
|
-
passiveModal: false,
|
|
411
|
-
modalHeading: '',
|
|
412
|
-
modalLabel: '',
|
|
413
|
-
preventCloseOnClickOutside: false,
|
|
414
|
-
selectorPrimaryFocus: '[data-modal-primary-focus]',
|
|
415
|
-
hasScrollingContent: false
|
|
416
|
-
};
|
|
417
406
|
var Modal$1 = Modal;
|
|
418
407
|
|
|
419
408
|
exports["default"] = Modal$1;
|
|
@@ -17,6 +17,7 @@ var Button = require('../Button/Button.js');
|
|
|
17
17
|
require('../Button/Button.Skeleton.js');
|
|
18
18
|
var types = require('../../prop-types/types.js');
|
|
19
19
|
var warning = require('../../internal/warning.js');
|
|
20
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
20
21
|
|
|
21
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
23
|
|
|
@@ -66,19 +67,21 @@ class ModalWrapper extends React__default["default"].Component {
|
|
|
66
67
|
render() {
|
|
67
68
|
const {
|
|
68
69
|
children,
|
|
69
|
-
onKeyDown,
|
|
70
|
+
onKeyDown = noopFn.noopFn,
|
|
70
71
|
buttonTriggerText,
|
|
71
72
|
buttonTriggerClassName,
|
|
72
73
|
renderTriggerButtonIcon,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
primaryButtonText = 'Save',
|
|
75
|
+
secondaryButtonText = 'Cancel',
|
|
76
|
+
triggerButtonIconDescription = 'Provide icon description if icon is used',
|
|
77
|
+
triggerButtonKind = 'primary',
|
|
78
|
+
disabled = false,
|
|
76
79
|
handleSubmit,
|
|
77
80
|
// eslint-disable-line no-unused-vars
|
|
78
|
-
shouldCloseAfterSubmit,
|
|
81
|
+
shouldCloseAfterSubmit = true,
|
|
79
82
|
// eslint-disable-line no-unused-vars
|
|
80
|
-
selectorPrimaryFocus,
|
|
81
|
-
preventCloseOnClickOutside,
|
|
83
|
+
selectorPrimaryFocus = '[data-modal-primary-focus]',
|
|
84
|
+
preventCloseOnClickOutside = false,
|
|
82
85
|
// eslint-disable-line no-unused-vars
|
|
83
86
|
...other
|
|
84
87
|
} = this.props;
|
|
@@ -106,7 +109,9 @@ class ModalWrapper extends React__default["default"].Component {
|
|
|
106
109
|
onClick: this.handleOpen,
|
|
107
110
|
ref: this.triggerButton
|
|
108
111
|
}, buttonTriggerText), /*#__PURE__*/React__default["default"].createElement(Modal["default"], _rollupPluginBabelHelpers["extends"]({
|
|
109
|
-
ref: this.modal
|
|
112
|
+
ref: this.modal,
|
|
113
|
+
primaryButtonText: primaryButtonText,
|
|
114
|
+
secondaryButtonText: secondaryButtonText
|
|
110
115
|
}, props), children));
|
|
111
116
|
}
|
|
112
117
|
}
|
|
@@ -135,16 +140,5 @@ _rollupPluginBabelHelpers.defineProperty(ModalWrapper, "propTypes", {
|
|
|
135
140
|
triggerButtonKind: PropTypes__default["default"].oneOf(types.ButtonKinds),
|
|
136
141
|
withHeader: PropTypes__default["default"].bool
|
|
137
142
|
});
|
|
138
|
-
_rollupPluginBabelHelpers.defineProperty(ModalWrapper, "defaultProps", {
|
|
139
|
-
shouldCloseAfterSubmit: true,
|
|
140
|
-
primaryButtonText: 'Save',
|
|
141
|
-
secondaryButtonText: 'Cancel',
|
|
142
|
-
triggerButtonIconDescription: 'Provide icon description if icon is used',
|
|
143
|
-
triggerButtonKind: 'primary',
|
|
144
|
-
disabled: false,
|
|
145
|
-
preventCloseOnClickOutside: false,
|
|
146
|
-
selectorPrimaryFocus: '[data-modal-primary-focus]',
|
|
147
|
-
onKeyDown: () => {}
|
|
148
|
-
});
|
|
149
143
|
|
|
150
144
|
exports["default"] = ModalWrapper;
|
|
@@ -45,35 +45,35 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
45
45
|
const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(function FilterableMultiSelect(_ref, ref) {
|
|
46
46
|
let {
|
|
47
47
|
className: containerClassName,
|
|
48
|
-
clearSelectionDescription,
|
|
49
|
-
clearSelectionText,
|
|
50
|
-
compareItems,
|
|
51
|
-
direction,
|
|
52
|
-
disabled,
|
|
48
|
+
clearSelectionDescription = 'Total items selected: ',
|
|
49
|
+
clearSelectionText = 'To clear selection, press Delete or Backspace',
|
|
50
|
+
compareItems = sorting.defaultCompareItems,
|
|
51
|
+
direction = 'bottom',
|
|
52
|
+
disabled = false,
|
|
53
53
|
downshiftProps,
|
|
54
|
-
filterItems,
|
|
54
|
+
filterItems = filter.defaultFilterItems,
|
|
55
55
|
helperText,
|
|
56
56
|
hideLabel,
|
|
57
57
|
id,
|
|
58
|
-
initialSelectedItems,
|
|
58
|
+
initialSelectedItems = [],
|
|
59
59
|
invalid,
|
|
60
60
|
invalidText,
|
|
61
61
|
items,
|
|
62
62
|
itemToElement: ItemToElement,
|
|
63
63
|
// needs to be capitalized for react to render it correctly
|
|
64
|
-
itemToString,
|
|
64
|
+
itemToString: itemToString$1 = itemToString.defaultItemToString,
|
|
65
65
|
light,
|
|
66
|
-
locale,
|
|
66
|
+
locale = 'en',
|
|
67
67
|
onInputValueChange,
|
|
68
|
-
open,
|
|
68
|
+
open = false,
|
|
69
69
|
onChange,
|
|
70
70
|
onMenuChange,
|
|
71
71
|
placeholder,
|
|
72
72
|
titleText,
|
|
73
73
|
type,
|
|
74
|
-
selectionFeedback,
|
|
74
|
+
selectionFeedback = 'top-after-reopen',
|
|
75
75
|
size,
|
|
76
|
-
sortItems,
|
|
76
|
+
sortItems = sorting.defaultSortItems,
|
|
77
77
|
translateWithId,
|
|
78
78
|
useTitleInItem,
|
|
79
79
|
warn,
|
|
@@ -221,7 +221,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
221
221
|
onItemChange(selectedItem);
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
|
-
itemToString: itemToString,
|
|
224
|
+
itemToString: itemToString$1,
|
|
225
225
|
onStateChange: handleOnStateChange,
|
|
226
226
|
onOuterClick: handleOnOuterClick,
|
|
227
227
|
selectedItem: selectedItems,
|
|
@@ -309,10 +309,10 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
309
309
|
if (match.match(event, keys.Tab)) {
|
|
310
310
|
handleOnMenuChange(false);
|
|
311
311
|
}
|
|
312
|
-
if (match.match(event, keys.Home)) {
|
|
312
|
+
if (match.match(event, keys.Home) && event.code !== 'Numpad7') {
|
|
313
313
|
event.target.setSelectionRange(0, 0);
|
|
314
314
|
}
|
|
315
|
-
if (match.match(event, keys.End)) {
|
|
315
|
+
if (match.match(event, keys.End) && event.code !== 'Numpad1') {
|
|
316
316
|
event.target.setSelectionRange(event.target.value.length, event.target.value.length);
|
|
317
317
|
}
|
|
318
318
|
},
|
|
@@ -394,7 +394,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
394
394
|
isOpen: isOpen,
|
|
395
395
|
translateWithId: translateWithId
|
|
396
396
|
}))), isOpen ? /*#__PURE__*/React__default["default"].createElement(index["default"].Menu, menuProps, sortItems(filterItems(items, {
|
|
397
|
-
itemToString,
|
|
397
|
+
itemToString: itemToString$1,
|
|
398
398
|
inputValue
|
|
399
399
|
}), {
|
|
400
400
|
selectedItems: {
|
|
@@ -402,7 +402,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
402
402
|
fixed: [],
|
|
403
403
|
'top-after-reopen': topItems
|
|
404
404
|
}[selectionFeedback],
|
|
405
|
-
itemToString,
|
|
405
|
+
itemToString: itemToString$1,
|
|
406
406
|
compareItems,
|
|
407
407
|
locale
|
|
408
408
|
}).map((item, index$1) => {
|
|
@@ -412,7 +412,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
412
412
|
disabled: item.disabled,
|
|
413
413
|
['aria-selected']: isChecked
|
|
414
414
|
});
|
|
415
|
-
const itemText = itemToString(item);
|
|
415
|
+
const itemText = itemToString$1(item);
|
|
416
416
|
return /*#__PURE__*/React__default["default"].createElement(index["default"].MenuItem, _rollupPluginBabelHelpers["extends"]({
|
|
417
417
|
key: itemProps.id,
|
|
418
418
|
"aria-label": itemText,
|
|
@@ -564,20 +564,6 @@ FilterableMultiSelect.propTypes = {
|
|
|
564
564
|
*/
|
|
565
565
|
warnText: PropTypes__default["default"].node
|
|
566
566
|
};
|
|
567
|
-
FilterableMultiSelect.defaultProps = {
|
|
568
|
-
compareItems: sorting.defaultCompareItems,
|
|
569
|
-
direction: 'bottom',
|
|
570
|
-
disabled: false,
|
|
571
|
-
filterItems: filter.defaultFilterItems,
|
|
572
|
-
initialSelectedItems: [],
|
|
573
|
-
itemToString: itemToString.defaultItemToString,
|
|
574
|
-
locale: 'en',
|
|
575
|
-
sortItems: sorting.defaultSortItems,
|
|
576
|
-
open: false,
|
|
577
|
-
selectionFeedback: 'top-after-reopen',
|
|
578
|
-
clearSelectionText: 'To clear selection, press Delete or Backspace,',
|
|
579
|
-
clearSelectionDescription: 'Total items selected: '
|
|
580
|
-
};
|
|
581
567
|
var FilterableMultiSelect$1 = FilterableMultiSelect;
|
|
582
568
|
|
|
583
569
|
exports["default"] = FilterableMultiSelect$1;
|