@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
|
@@ -26,6 +26,7 @@ var deprecate = require('../../prop-types/deprecate.js');
|
|
|
26
26
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
27
27
|
require('../FluidForm/FluidForm.js');
|
|
28
28
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
29
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
29
30
|
var match = require('../../internal/keyboard/match.js');
|
|
30
31
|
var ListBoxPropTypes = require('../ListBox/ListBoxPropTypes.js');
|
|
31
32
|
var keys = require('../../internal/keyboard/keys.js');
|
|
@@ -37,7 +38,6 @@ var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
|
37
38
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
38
39
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
39
40
|
|
|
40
|
-
const noop = () => {};
|
|
41
41
|
const getInstanceId = setupGetInstanceId["default"]();
|
|
42
42
|
const {
|
|
43
43
|
ItemClick,
|
|
@@ -71,18 +71,18 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
|
|
|
71
71
|
items,
|
|
72
72
|
itemToElement,
|
|
73
73
|
itemToString = defaultItemToString,
|
|
74
|
-
titleText,
|
|
74
|
+
titleText = false,
|
|
75
75
|
hideLabel,
|
|
76
76
|
helperText,
|
|
77
77
|
label,
|
|
78
|
-
type,
|
|
78
|
+
type = 'default',
|
|
79
79
|
size,
|
|
80
|
-
disabled,
|
|
81
|
-
initialSelectedItems,
|
|
82
|
-
sortItems,
|
|
83
|
-
compareItems,
|
|
84
|
-
clearSelectionText,
|
|
85
|
-
clearSelectionDescription,
|
|
80
|
+
disabled = false,
|
|
81
|
+
initialSelectedItems = [],
|
|
82
|
+
sortItems = sorting.defaultSortItems,
|
|
83
|
+
compareItems = sorting.defaultCompareItems,
|
|
84
|
+
clearSelectionText = 'To clear selection, press Delete or Backspace',
|
|
85
|
+
clearSelectionDescription = 'Total items selected: ',
|
|
86
86
|
light,
|
|
87
87
|
invalid,
|
|
88
88
|
invalidText,
|
|
@@ -91,14 +91,14 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
|
|
|
91
91
|
useTitleInItem,
|
|
92
92
|
translateWithId,
|
|
93
93
|
downshiftProps,
|
|
94
|
-
open,
|
|
95
|
-
selectionFeedback,
|
|
94
|
+
open = false,
|
|
95
|
+
selectionFeedback = 'top-after-reopen',
|
|
96
96
|
onChange,
|
|
97
97
|
onMenuChange,
|
|
98
|
-
direction,
|
|
98
|
+
direction = 'bottom',
|
|
99
99
|
selectedItems: selected,
|
|
100
100
|
readOnly,
|
|
101
|
-
locale
|
|
101
|
+
locale = 'en'
|
|
102
102
|
} = _ref;
|
|
103
103
|
const prefix = usePrefix.usePrefix();
|
|
104
104
|
const {
|
|
@@ -332,7 +332,7 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
|
|
|
332
332
|
className: multiSelectFieldWrapperClasses
|
|
333
333
|
}, selectedItems.length > 0 && /*#__PURE__*/React__default["default"].createElement(index["default"].Selection, {
|
|
334
334
|
readOnly: readOnly,
|
|
335
|
-
clearSelection: !disabled && !readOnly ? clearSelection :
|
|
335
|
+
clearSelection: !disabled && !readOnly ? clearSelection : noopFn.noopFn,
|
|
336
336
|
selectionCount: selectedItems.length
|
|
337
337
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
338
338
|
,
|
|
@@ -405,7 +405,7 @@ MultiSelect.propTypes = {
|
|
|
405
405
|
* Provide a compare function that is used to determine the ordering of
|
|
406
406
|
* options. See 'sortItems' for more control.
|
|
407
407
|
*/
|
|
408
|
-
compareItems: PropTypes__default["default"].func
|
|
408
|
+
compareItems: PropTypes__default["default"].func,
|
|
409
409
|
/**
|
|
410
410
|
* Specify the direction of the multiselect dropdown. Can be either top or bottom.
|
|
411
411
|
*/
|
|
@@ -527,7 +527,7 @@ MultiSelect.propTypes = {
|
|
|
527
527
|
* locale: string,
|
|
528
528
|
* }) => Array<Item>
|
|
529
529
|
*/
|
|
530
|
-
sortItems: PropTypes__default["default"].func
|
|
530
|
+
sortItems: PropTypes__default["default"].func,
|
|
531
531
|
/**
|
|
532
532
|
* Provide text to be used in a `<label>` element that is tied to the
|
|
533
533
|
* multiselect via ARIA attributes.
|
|
@@ -554,22 +554,6 @@ MultiSelect.propTypes = {
|
|
|
554
554
|
*/
|
|
555
555
|
warnText: PropTypes__default["default"].node
|
|
556
556
|
};
|
|
557
|
-
MultiSelect.defaultProps = {
|
|
558
|
-
compareItems: sorting.defaultCompareItems,
|
|
559
|
-
disabled: false,
|
|
560
|
-
locale: 'en',
|
|
561
|
-
itemToString: defaultItemToString,
|
|
562
|
-
initialSelectedItems: [],
|
|
563
|
-
sortItems: sorting.defaultSortItems,
|
|
564
|
-
type: 'default',
|
|
565
|
-
titleText: false,
|
|
566
|
-
open: false,
|
|
567
|
-
selectionFeedback: 'top-after-reopen',
|
|
568
|
-
direction: 'bottom',
|
|
569
|
-
clearSelectionText: 'To clear selection, press Delete or Backspace,',
|
|
570
|
-
clearSelectionDescription: 'Total items selected: ',
|
|
571
|
-
selectedItems: undefined
|
|
572
|
-
};
|
|
573
557
|
var MultiSelect$1 = MultiSelect;
|
|
574
558
|
|
|
575
559
|
exports["default"] = MultiSelect$1;
|
|
@@ -23,7 +23,7 @@ const sortingPropTypes = {
|
|
|
23
23
|
* compareFunction :
|
|
24
24
|
* (itemA: string, itemB: string, { locale: string }) => number
|
|
25
25
|
*/
|
|
26
|
-
compareItems: PropTypes__default["default"].func
|
|
26
|
+
compareItems: PropTypes__default["default"].func,
|
|
27
27
|
/**
|
|
28
28
|
* Provide a method that sorts all options in the control. Overriding this
|
|
29
29
|
* prop means that you also have to handle the sort logic for selected versus
|
|
@@ -42,7 +42,7 @@ const sortingPropTypes = {
|
|
|
42
42
|
* locale: string,
|
|
43
43
|
* }) => Array<Item>
|
|
44
44
|
*/
|
|
45
|
-
sortItems: PropTypes__default["default"].func
|
|
45
|
+
sortItems: PropTypes__default["default"].func
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
exports.sortingPropTypes = sortingPropTypes;
|
|
@@ -13,8 +13,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
13
13
|
* Use the local `localCompare` with the `numeric` option to sort two,
|
|
14
14
|
* potentially alpha-numeric, strings in a list of items.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
16
|
+
* @param {ItemType} itemA
|
|
17
|
+
* @param {ItemType} itemB
|
|
18
18
|
* @param {object} options
|
|
19
19
|
* @param {string} options.locale
|
|
20
20
|
* @returns {number}
|
|
@@ -51,6 +51,16 @@ export declare namespace NotificationActionButton {
|
|
|
51
51
|
* ==================
|
|
52
52
|
*/
|
|
53
53
|
export interface NotificationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
54
|
+
/**
|
|
55
|
+
* Specify a label to be read by screen readers on the container node
|
|
56
|
+
* 'aria-label' of the NotificationButton component.
|
|
57
|
+
*/
|
|
58
|
+
['aria-label']?: string;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated please use `aria-label` instead.
|
|
61
|
+
* 'aria-label' of the NotificationButton component.
|
|
62
|
+
*/
|
|
63
|
+
ariaLabel?: string;
|
|
54
64
|
/**
|
|
55
65
|
* Specify an optional icon for the Button through a string,
|
|
56
66
|
* if provided. However, regular "close" icon is preferred.
|
|
@@ -107,12 +117,6 @@ export declare namespace NotificationButton {
|
|
|
107
117
|
*/
|
|
108
118
|
type: PropTypes.Requireable<string>;
|
|
109
119
|
};
|
|
110
|
-
var defaultProps: {
|
|
111
|
-
"aria-label": string;
|
|
112
|
-
notificationType: string;
|
|
113
|
-
type: string;
|
|
114
|
-
renderIcon: any;
|
|
115
|
-
};
|
|
116
120
|
}
|
|
117
121
|
export interface NotificationIconProps {
|
|
118
122
|
iconDescription: string;
|
|
@@ -248,13 +252,6 @@ export declare namespace ToastNotification {
|
|
|
248
252
|
*/
|
|
249
253
|
title: PropTypes.Requireable<string>;
|
|
250
254
|
};
|
|
251
|
-
var defaultProps: {
|
|
252
|
-
kind: string;
|
|
253
|
-
role: string;
|
|
254
|
-
onCloseButtonClick: () => void;
|
|
255
|
-
hideCloseButton: boolean;
|
|
256
|
-
timeout: number;
|
|
257
|
-
};
|
|
258
255
|
}
|
|
259
256
|
/**
|
|
260
257
|
* InlineNotification
|
|
@@ -364,12 +361,6 @@ export declare namespace InlineNotification {
|
|
|
364
361
|
*/
|
|
365
362
|
title: PropTypes.Requireable<string>;
|
|
366
363
|
};
|
|
367
|
-
var defaultProps: {
|
|
368
|
-
kind: string;
|
|
369
|
-
role: string;
|
|
370
|
-
onCloseButtonClick: () => void;
|
|
371
|
-
hideCloseButton: boolean;
|
|
372
|
-
};
|
|
373
364
|
}
|
|
374
365
|
/**
|
|
375
366
|
* ActionableNotification
|
|
@@ -484,7 +475,7 @@ export declare namespace ActionableNotification {
|
|
|
484
475
|
/**
|
|
485
476
|
* Specify what state the notification represents
|
|
486
477
|
*/
|
|
487
|
-
kind: PropTypes.
|
|
478
|
+
kind: PropTypes.Requireable<string>;
|
|
488
479
|
/**
|
|
489
480
|
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
490
481
|
*/
|
|
@@ -519,13 +510,4 @@ export declare namespace ActionableNotification {
|
|
|
519
510
|
*/
|
|
520
511
|
title: PropTypes.Requireable<string>;
|
|
521
512
|
};
|
|
522
|
-
var defaultProps: {
|
|
523
|
-
kind: string;
|
|
524
|
-
role: string;
|
|
525
|
-
onCloseButtonClick: () => void;
|
|
526
|
-
hideCloseButton: boolean;
|
|
527
|
-
hasFocus: boolean;
|
|
528
|
-
closeOnEscape: boolean;
|
|
529
|
-
inline: boolean;
|
|
530
|
-
};
|
|
531
513
|
}
|
|
@@ -15,12 +15,15 @@ var React = require('react');
|
|
|
15
15
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
16
16
|
var cx = require('classnames');
|
|
17
17
|
var iconsReact = require('@carbon/icons-react');
|
|
18
|
+
require('../Text/index.js');
|
|
18
19
|
var Button = require('../Button/Button.js');
|
|
19
20
|
require('../Button/Button.Skeleton.js');
|
|
20
21
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
21
22
|
var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
|
|
22
23
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
23
24
|
var useId = require('../../internal/useId.js');
|
|
25
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
26
|
+
var Text = require('../Text/Text.js');
|
|
24
27
|
var match = require('../../internal/keyboard/match.js');
|
|
25
28
|
var keys = require('../../internal/keyboard/keys.js');
|
|
26
29
|
|
|
@@ -95,14 +98,13 @@ NotificationActionButton.propTypes = {
|
|
|
95
98
|
|
|
96
99
|
function NotificationButton(_ref2) {
|
|
97
100
|
let {
|
|
98
|
-
'aria-label': ariaLabel,
|
|
99
|
-
// @ts-expect-error: deprecated prop
|
|
101
|
+
'aria-label': ariaLabel = 'close notification',
|
|
100
102
|
ariaLabel: deprecatedAriaLabel,
|
|
101
103
|
className,
|
|
102
|
-
type,
|
|
103
|
-
renderIcon: IconTag,
|
|
104
|
+
type = 'button',
|
|
105
|
+
renderIcon: IconTag = iconsReact.Close,
|
|
104
106
|
name,
|
|
105
|
-
notificationType,
|
|
107
|
+
notificationType = 'toast',
|
|
106
108
|
...rest
|
|
107
109
|
} = _ref2;
|
|
108
110
|
const prefix = usePrefix.usePrefix();
|
|
@@ -156,12 +158,6 @@ NotificationButton.propTypes = {
|
|
|
156
158
|
*/
|
|
157
159
|
type: PropTypes__default["default"].string
|
|
158
160
|
};
|
|
159
|
-
NotificationButton.defaultProps = {
|
|
160
|
-
['aria-label']: 'close notification',
|
|
161
|
-
notificationType: 'toast',
|
|
162
|
-
type: 'button',
|
|
163
|
-
renderIcon: iconsReact.Close
|
|
164
|
-
};
|
|
165
161
|
|
|
166
162
|
/**
|
|
167
163
|
* NotificationIcon
|
|
@@ -208,16 +204,16 @@ function ToastNotification(_ref4) {
|
|
|
208
204
|
['aria-label']: ariaLabel,
|
|
209
205
|
// @ts-expect-error: deprecated prop
|
|
210
206
|
ariaLabel: deprecatedAriaLabel,
|
|
211
|
-
role,
|
|
207
|
+
role = 'status',
|
|
212
208
|
onClose,
|
|
213
|
-
onCloseButtonClick,
|
|
209
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
214
210
|
statusIconDescription,
|
|
215
211
|
className,
|
|
216
212
|
children,
|
|
217
|
-
kind,
|
|
213
|
+
kind = 'error',
|
|
218
214
|
lowContrast,
|
|
219
|
-
hideCloseButton,
|
|
220
|
-
timeout,
|
|
215
|
+
hideCloseButton = false,
|
|
216
|
+
timeout = 0,
|
|
221
217
|
title,
|
|
222
218
|
caption,
|
|
223
219
|
subtitle,
|
|
@@ -275,11 +271,14 @@ function ToastNotification(_ref4) {
|
|
|
275
271
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
276
272
|
ref: contentRef,
|
|
277
273
|
className: `${prefix}--toast-notification__details`
|
|
278
|
-
}, title && /*#__PURE__*/React__default["default"].createElement(
|
|
274
|
+
}, title && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
275
|
+
as: "div",
|
|
279
276
|
className: `${prefix}--toast-notification__title`
|
|
280
|
-
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(
|
|
277
|
+
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
278
|
+
as: "div",
|
|
281
279
|
className: `${prefix}--toast-notification__subtitle`
|
|
282
|
-
}, subtitle), caption && /*#__PURE__*/React__default["default"].createElement(
|
|
280
|
+
}, subtitle), caption && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
281
|
+
as: "div",
|
|
283
282
|
className: `${prefix}--toast-notification__caption`
|
|
284
283
|
}, caption), children), !hideCloseButton && /*#__PURE__*/React__default["default"].createElement(NotificationButton, {
|
|
285
284
|
notificationType: "toast",
|
|
@@ -353,13 +352,6 @@ ToastNotification.propTypes = {
|
|
|
353
352
|
*/
|
|
354
353
|
title: PropTypes__default["default"].string
|
|
355
354
|
};
|
|
356
|
-
ToastNotification.defaultProps = {
|
|
357
|
-
kind: 'error',
|
|
358
|
-
role: 'status',
|
|
359
|
-
onCloseButtonClick: () => {},
|
|
360
|
-
hideCloseButton: false,
|
|
361
|
-
timeout: 0
|
|
362
|
-
};
|
|
363
355
|
|
|
364
356
|
/**
|
|
365
357
|
* InlineNotification
|
|
@@ -372,14 +364,14 @@ function InlineNotification(_ref5) {
|
|
|
372
364
|
children,
|
|
373
365
|
title,
|
|
374
366
|
subtitle,
|
|
375
|
-
role,
|
|
367
|
+
role = 'status',
|
|
376
368
|
onClose,
|
|
377
|
-
onCloseButtonClick,
|
|
369
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
378
370
|
statusIconDescription,
|
|
379
371
|
className,
|
|
380
|
-
kind,
|
|
372
|
+
kind = 'error',
|
|
381
373
|
lowContrast,
|
|
382
|
-
hideCloseButton,
|
|
374
|
+
hideCloseButton = false,
|
|
383
375
|
...rest
|
|
384
376
|
} = _ref5;
|
|
385
377
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
@@ -419,9 +411,11 @@ function InlineNotification(_ref5) {
|
|
|
419
411
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
420
412
|
ref: contentRef,
|
|
421
413
|
className: `${prefix}--inline-notification__text-wrapper`
|
|
422
|
-
}, title && /*#__PURE__*/React__default["default"].createElement(
|
|
414
|
+
}, title && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
415
|
+
as: "div",
|
|
423
416
|
className: `${prefix}--inline-notification__title`
|
|
424
|
-
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(
|
|
417
|
+
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
418
|
+
as: "div",
|
|
425
419
|
className: `${prefix}--inline-notification__subtitle`
|
|
426
420
|
}, subtitle), children)), !hideCloseButton && /*#__PURE__*/React__default["default"].createElement(NotificationButton, {
|
|
427
421
|
notificationType: "inline",
|
|
@@ -482,12 +476,6 @@ InlineNotification.propTypes = {
|
|
|
482
476
|
*/
|
|
483
477
|
title: PropTypes__default["default"].string
|
|
484
478
|
};
|
|
485
|
-
InlineNotification.defaultProps = {
|
|
486
|
-
kind: 'error',
|
|
487
|
-
role: 'status',
|
|
488
|
-
onCloseButtonClick: () => {},
|
|
489
|
-
hideCloseButton: false
|
|
490
|
-
};
|
|
491
479
|
|
|
492
480
|
/**
|
|
493
481
|
* ActionableNotification
|
|
@@ -501,18 +489,18 @@ function ActionableNotification(_ref6) {
|
|
|
501
489
|
// @ts-expect-error: deprecated prop
|
|
502
490
|
ariaLabel: deprecatedAriaLabel,
|
|
503
491
|
children,
|
|
504
|
-
role,
|
|
492
|
+
role = 'alertdialog',
|
|
505
493
|
onActionButtonClick,
|
|
506
494
|
onClose,
|
|
507
|
-
onCloseButtonClick,
|
|
495
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
508
496
|
statusIconDescription,
|
|
509
497
|
className,
|
|
510
|
-
inline,
|
|
511
|
-
kind,
|
|
498
|
+
inline = false,
|
|
499
|
+
kind = 'error',
|
|
512
500
|
lowContrast,
|
|
513
|
-
hideCloseButton,
|
|
514
|
-
hasFocus,
|
|
515
|
-
closeOnEscape,
|
|
501
|
+
hideCloseButton = false,
|
|
502
|
+
hasFocus = true,
|
|
503
|
+
closeOnEscape = true,
|
|
516
504
|
title,
|
|
517
505
|
subtitle,
|
|
518
506
|
...rest
|
|
@@ -562,10 +550,12 @@ function ActionableNotification(_ref6) {
|
|
|
562
550
|
className: `${prefix}--actionable-notification__text-wrapper`
|
|
563
551
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
564
552
|
className: `${prefix}--actionable-notification__content`
|
|
565
|
-
}, title && /*#__PURE__*/React__default["default"].createElement(
|
|
553
|
+
}, title && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
554
|
+
as: "div",
|
|
566
555
|
className: `${prefix}--actionable-notification__title`,
|
|
567
556
|
id: id
|
|
568
|
-
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(
|
|
557
|
+
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
558
|
+
as: "div",
|
|
569
559
|
className: `${prefix}--actionable-notification__subtitle`,
|
|
570
560
|
id: subtitleId
|
|
571
561
|
}, subtitle), children))), actionButtonLabel && /*#__PURE__*/React__default["default"].createElement(NotificationActionButton, {
|
|
@@ -618,7 +608,7 @@ ActionableNotification.propTypes = {
|
|
|
618
608
|
/**
|
|
619
609
|
* Specify what state the notification represents
|
|
620
610
|
*/
|
|
621
|
-
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt'])
|
|
611
|
+
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
622
612
|
/**
|
|
623
613
|
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
624
614
|
*/
|
|
@@ -653,15 +643,6 @@ ActionableNotification.propTypes = {
|
|
|
653
643
|
*/
|
|
654
644
|
title: PropTypes__default["default"].string
|
|
655
645
|
};
|
|
656
|
-
ActionableNotification.defaultProps = {
|
|
657
|
-
kind: 'error',
|
|
658
|
-
role: 'alertdialog',
|
|
659
|
-
onCloseButtonClick: () => {},
|
|
660
|
-
hideCloseButton: false,
|
|
661
|
-
hasFocus: true,
|
|
662
|
-
closeOnEscape: true,
|
|
663
|
-
inline: false
|
|
664
|
-
};
|
|
665
646
|
|
|
666
647
|
exports.ActionableNotification = ActionableNotification;
|
|
667
648
|
exports.InlineNotification = InlineNotification;
|
|
@@ -20,6 +20,8 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
20
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
21
21
|
require('../FluidForm/FluidForm.js');
|
|
22
22
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
23
|
+
require('../Text/index.js');
|
|
24
|
+
var Text = require('../Text/Text.js');
|
|
23
25
|
|
|
24
26
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
27
|
|
|
@@ -381,7 +383,8 @@ function Label(_ref) {
|
|
|
381
383
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
382
384
|
});
|
|
383
385
|
if (label) {
|
|
384
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
386
|
+
return /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
387
|
+
as: "label",
|
|
385
388
|
htmlFor: id,
|
|
386
389
|
className: className
|
|
387
390
|
}, label);
|
|
@@ -405,7 +408,8 @@ function HelperText(_ref2) {
|
|
|
405
408
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
406
409
|
});
|
|
407
410
|
if (description) {
|
|
408
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
411
|
+
return /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
412
|
+
as: "div",
|
|
409
413
|
id: id,
|
|
410
414
|
className: className
|
|
411
415
|
}, description);
|
|
@@ -22,6 +22,7 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
22
22
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
23
23
|
var index = require('../IconButton/index.js');
|
|
24
24
|
var setupGetInstanceId = require('../../tools/setupGetInstanceId.js');
|
|
25
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
25
26
|
var match = require('../../internal/keyboard/match.js');
|
|
26
27
|
var keys = require('../../internal/keyboard/keys.js');
|
|
27
28
|
|
|
@@ -125,12 +126,15 @@ class OverflowMenu extends React.Component {
|
|
|
125
126
|
*/
|
|
126
127
|
_rollupPluginBabelHelpers.defineProperty(this, "_triggerRef", /*#__PURE__*/React__default["default"].createRef());
|
|
127
128
|
_rollupPluginBabelHelpers.defineProperty(this, "handleClick", evt => {
|
|
129
|
+
const {
|
|
130
|
+
onClick = noopFn.noopFn
|
|
131
|
+
} = this.props;
|
|
128
132
|
evt.stopPropagation();
|
|
129
133
|
if (!this._menuBody || !this._menuBody.contains(evt.target)) {
|
|
130
134
|
this.setState({
|
|
131
135
|
open: !this.state.open
|
|
132
136
|
});
|
|
133
|
-
|
|
137
|
+
onClick(evt);
|
|
134
138
|
}
|
|
135
139
|
});
|
|
136
140
|
_rollupPluginBabelHelpers.defineProperty(this, "closeMenuAndFocus", () => {
|
|
@@ -160,6 +164,9 @@ class OverflowMenu extends React.Component {
|
|
|
160
164
|
}
|
|
161
165
|
});
|
|
162
166
|
_rollupPluginBabelHelpers.defineProperty(this, "closeMenu", onCloseMenu => {
|
|
167
|
+
const {
|
|
168
|
+
onClose = noopFn.noopFn
|
|
169
|
+
} = this.props;
|
|
163
170
|
this.setState({
|
|
164
171
|
open: false
|
|
165
172
|
}, () => {
|
|
@@ -167,7 +174,7 @@ class OverflowMenu extends React.Component {
|
|
|
167
174
|
if (onCloseMenu) {
|
|
168
175
|
onCloseMenu();
|
|
169
176
|
}
|
|
170
|
-
|
|
177
|
+
onClose();
|
|
171
178
|
});
|
|
172
179
|
});
|
|
173
180
|
_rollupPluginBabelHelpers.defineProperty(this, "focusMenuEl", () => {
|
|
@@ -232,6 +239,9 @@ class OverflowMenu extends React.Component {
|
|
|
232
239
|
* @private
|
|
233
240
|
*/
|
|
234
241
|
_rollupPluginBabelHelpers.defineProperty(this, "_handlePlace", menuBody => {
|
|
242
|
+
const {
|
|
243
|
+
onOpen = noopFn.noopFn
|
|
244
|
+
} = this.props;
|
|
235
245
|
if (menuBody) {
|
|
236
246
|
this._menuBody = menuBody;
|
|
237
247
|
const hasFocusin = ('onfocusin' in window);
|
|
@@ -247,7 +257,7 @@ class OverflowMenu extends React.Component {
|
|
|
247
257
|
}
|
|
248
258
|
}
|
|
249
259
|
}, !hasFocusin);
|
|
250
|
-
|
|
260
|
+
onOpen();
|
|
251
261
|
}
|
|
252
262
|
});
|
|
253
263
|
/**
|
|
@@ -262,7 +272,7 @@ class OverflowMenu extends React.Component {
|
|
|
262
272
|
}
|
|
263
273
|
componentDidUpdate(_, prevState) {
|
|
264
274
|
const {
|
|
265
|
-
onClose
|
|
275
|
+
onClose = noopFn.noopFn
|
|
266
276
|
} = this.props;
|
|
267
277
|
if (!this.state.open && prevState.open) {
|
|
268
278
|
onClose();
|
|
@@ -299,23 +309,23 @@ class OverflowMenu extends React.Component {
|
|
|
299
309
|
const prefix = this.context;
|
|
300
310
|
const {
|
|
301
311
|
id,
|
|
302
|
-
['aria-label']: ariaLabel,
|
|
312
|
+
['aria-label']: ariaLabel = null,
|
|
303
313
|
ariaLabel: deprecatedAriaLabel,
|
|
304
314
|
children,
|
|
305
|
-
iconDescription,
|
|
306
|
-
direction,
|
|
307
|
-
flipped,
|
|
308
|
-
focusTrap,
|
|
309
|
-
menuOffset,
|
|
310
|
-
menuOffsetFlip,
|
|
315
|
+
iconDescription = 'Options',
|
|
316
|
+
direction = FloatingMenu.DIRECTION_BOTTOM,
|
|
317
|
+
flipped = false,
|
|
318
|
+
focusTrap = true,
|
|
319
|
+
menuOffset = getMenuOffset,
|
|
320
|
+
menuOffsetFlip = getMenuOffset,
|
|
311
321
|
iconClass,
|
|
312
|
-
onClick,
|
|
322
|
+
onClick = noopFn.noopFn,
|
|
313
323
|
// eslint-disable-line
|
|
314
|
-
onOpen,
|
|
324
|
+
onOpen = noopFn.noopFn,
|
|
315
325
|
// eslint-disable-line
|
|
316
326
|
selectorPrimaryFocus = '[data-floating-menu-primary-focus]',
|
|
317
327
|
// eslint-disable-line
|
|
318
|
-
renderIcon: IconElement,
|
|
328
|
+
renderIcon: IconElement = iconsReact.OverflowMenuVertical,
|
|
319
329
|
// eslint-disable-next-line react/prop-types
|
|
320
330
|
innerRef: ref,
|
|
321
331
|
menuOptionsClass,
|
|
@@ -324,7 +334,7 @@ class OverflowMenu extends React.Component {
|
|
|
324
334
|
...other
|
|
325
335
|
} = this.props;
|
|
326
336
|
const {
|
|
327
|
-
open
|
|
337
|
+
open = false
|
|
328
338
|
} = this.state;
|
|
329
339
|
const overflowMenuClasses = cx__default["default"](this.props.className, `${prefix}--overflow-menu`, {
|
|
330
340
|
[`${prefix}--overflow-menu--open`]: open,
|
|
@@ -380,7 +390,7 @@ class OverflowMenu extends React.Component {
|
|
|
380
390
|
}, /*#__PURE__*/React__default["default"].createElement(index.IconButton, _rollupPluginBabelHelpers["extends"]({}, other, {
|
|
381
391
|
type: "button",
|
|
382
392
|
"aria-haspopup": true,
|
|
383
|
-
"aria-expanded":
|
|
393
|
+
"aria-expanded": open,
|
|
384
394
|
"aria-controls": open ? menuBodyId : null,
|
|
385
395
|
className: overflowMenuClasses,
|
|
386
396
|
onClick: this.handleClick,
|
|
@@ -428,7 +438,7 @@ _rollupPluginBabelHelpers.defineProperty(OverflowMenu, "propTypes", {
|
|
|
428
438
|
/**
|
|
429
439
|
* The icon description.
|
|
430
440
|
*/
|
|
431
|
-
iconDescription: PropTypes__default["default"].string
|
|
441
|
+
iconDescription: PropTypes__default["default"].string,
|
|
432
442
|
/**
|
|
433
443
|
* The element ID.
|
|
434
444
|
*/
|
|
@@ -495,22 +505,6 @@ _rollupPluginBabelHelpers.defineProperty(OverflowMenu, "propTypes", {
|
|
|
495
505
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg'])
|
|
496
506
|
});
|
|
497
507
|
_rollupPluginBabelHelpers.defineProperty(OverflowMenu, "contextType", usePrefix.PrefixContext);
|
|
498
|
-
_rollupPluginBabelHelpers.defineProperty(OverflowMenu, "defaultProps", {
|
|
499
|
-
['aria-label']: null,
|
|
500
|
-
iconDescription: 'Options',
|
|
501
|
-
open: false,
|
|
502
|
-
direction: FloatingMenu.DIRECTION_BOTTOM,
|
|
503
|
-
flipped: false,
|
|
504
|
-
focusTrap: true,
|
|
505
|
-
renderIcon: iconsReact.OverflowMenuVertical,
|
|
506
|
-
onClick: () => {},
|
|
507
|
-
onKeyDown: () => {},
|
|
508
|
-
onClose: () => {},
|
|
509
|
-
onOpen: () => {},
|
|
510
|
-
menuOffset: getMenuOffset,
|
|
511
|
-
menuOffsetFlip: getMenuOffset,
|
|
512
|
-
selectorPrimaryFocus: '[data-overflow-menu-primary-focus]'
|
|
513
|
-
});
|
|
514
508
|
(() => {
|
|
515
509
|
const forwardRef = (props, ref) => /*#__PURE__*/React__default["default"].createElement(OverflowMenu, _rollupPluginBabelHelpers["extends"]({}, props, {
|
|
516
510
|
innerRef: ref
|
|
@@ -15,6 +15,8 @@ var PropTypes = require('prop-types');
|
|
|
15
15
|
var React = require('react');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
var warning = require('../../internal/warning.js');
|
|
18
|
+
require('../Text/index.js');
|
|
19
|
+
var Text = require('../Text/Text.js');
|
|
18
20
|
var match = require('../../internal/keyboard/match.js');
|
|
19
21
|
var keys = require('../../internal/keyboard/keys.js');
|
|
20
22
|
|
|
@@ -81,7 +83,8 @@ const OverflowMenuItem = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
|
81
83
|
className: `${prefix}--overflow-menu-options__option-content`
|
|
82
84
|
}, itemText);
|
|
83
85
|
})();
|
|
84
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
86
|
+
return /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
87
|
+
as: "li",
|
|
85
88
|
className: overflowMenuItemClasses,
|
|
86
89
|
role: "none"
|
|
87
90
|
}, /*#__PURE__*/React__default["default"].createElement(TagToUse, _rollupPluginBabelHelpers["extends"]({
|
|
@@ -28,10 +28,10 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
28
28
|
const getInstanceId = setupGetInstanceId["default"]();
|
|
29
29
|
function PageSelector(_ref) {
|
|
30
30
|
let {
|
|
31
|
-
className,
|
|
31
|
+
className = null,
|
|
32
32
|
currentPage,
|
|
33
|
-
id,
|
|
34
|
-
labelText,
|
|
33
|
+
id = 1,
|
|
34
|
+
labelText = 'Current page number',
|
|
35
35
|
totalPages,
|
|
36
36
|
...other
|
|
37
37
|
} = _ref;
|
|
@@ -73,10 +73,5 @@ PageSelector.propTypes = {
|
|
|
73
73
|
*/
|
|
74
74
|
totalPages: PropTypes__default["default"].number.isRequired
|
|
75
75
|
};
|
|
76
|
-
PageSelector.defaultProps = {
|
|
77
|
-
className: null,
|
|
78
|
-
id: 1,
|
|
79
|
-
labelText: 'Current page number'
|
|
80
|
-
};
|
|
81
76
|
|
|
82
77
|
exports["default"] = PageSelector;
|