@carbon/react 1.78.2 → 1.79.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 +882 -882
- package/es/components/Accordion/AccordionItem.js +2 -2
- package/es/components/Button/Button.d.ts +2 -3
- package/es/components/Button/Button.js +29 -19
- package/es/components/Button/ButtonBase.js +3 -1
- package/es/components/ChatButton/ChatButton.d.ts +2 -3
- package/es/components/ChatButton/ChatButton.js +1 -2
- package/es/components/ComboBox/ComboBox.js +34 -24
- package/es/components/ComposedModal/ComposedModal.js +65 -51
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
- package/es/components/ContentSwitcher/ContentSwitcher.js +3 -3
- package/es/components/DataTable/TableBatchAction.d.ts +3 -3
- package/es/components/DataTable/TableBatchAction.js +1 -1
- package/es/components/DataTable/TableContainer.d.ts +1 -1
- package/es/components/DataTable/TableContainer.js +5 -4
- package/es/components/DataTable/TableExpandHeader.d.ts +6 -5
- package/es/components/DataTable/TableToolbarMenu.d.ts +2 -2
- package/es/components/DataTable/TableToolbarMenu.js +1 -1
- package/es/components/DatePicker/DatePicker.js +2 -2
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/es/components/Dialog/index.d.ts +42 -4
- package/es/components/Dialog/index.js +177 -0
- package/es/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/es/components/FeatureFlags/index.d.ts +3 -1
- package/es/components/FeatureFlags/index.js +3 -0
- package/es/components/FileUploader/FileUploader.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.js +2 -2
- package/es/components/FileUploader/FileUploaderButton.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +6 -4
- package/es/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +2 -2
- package/es/components/Grid/CSSGrid.js +18 -14
- package/es/components/Grid/Column.d.ts +2 -2
- package/es/components/Grid/Column.js +7 -8
- package/es/components/Grid/FlexGrid.js +7 -6
- package/es/components/Grid/GridTypes.d.ts +5 -3
- package/es/components/IconButton/index.d.ts +2 -2
- package/es/components/IconButton/index.js +4 -4
- package/es/components/Layer/index.d.ts +4 -6
- package/es/components/Layer/index.js +5 -6
- package/es/components/Link/Link.d.ts +2 -3
- package/es/components/Link/Link.js +1 -2
- package/es/components/ListBox/ListBoxMenuItem.d.ts +3 -3
- package/es/components/ListBox/ListBoxMenuItem.js +37 -15
- package/es/components/Menu/Menu.js +2 -2
- package/es/components/Menu/MenuItem.d.ts +2 -2
- package/es/components/Menu/MenuItem.js +3 -3
- package/es/components/Modal/Modal.js +121 -49
- package/es/components/ModalWrapper/ModalWrapper.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/index.d.ts +1 -1
- package/es/components/MultiSelect/index.js +1 -8
- package/es/components/Notification/Notification.d.ts +5 -13
- package/es/components/Notification/Notification.js +3 -4
- package/es/components/OverflowMenu/OverflowMenu.d.ts +22 -201
- package/es/components/OverflowMenu/OverflowMenu.js +269 -338
- package/es/components/OverflowMenu/index.d.ts +5 -5
- package/es/components/OverflowMenu/index.js +2 -2
- package/es/components/OverflowMenu/next/index.d.ts +4 -4
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.d.ts +2 -3
- package/es/components/Search/Search.js +4 -6
- package/es/components/Slider/Slider.d.ts +39 -44
- package/es/components/Slider/Slider.js +57 -59
- package/es/components/Tabs/Tabs.d.ts +3 -6
- package/es/components/Tabs/Tabs.js +16 -18
- package/es/components/Tag/DismissibleTag.d.ts +3 -5
- package/es/components/Tag/DismissibleTag.js +1 -2
- package/es/components/Tag/OperationalTag.d.ts +2 -3
- package/es/components/Tag/OperationalTag.js +1 -2
- package/es/components/Tag/SelectableTag.d.ts +3 -5
- package/es/components/Tag/SelectableTag.js +1 -2
- package/es/components/Tag/Tag.d.ts +2 -3
- package/es/components/Tag/Tag.js +1 -2
- package/es/components/Tile/Tile.d.ts +3 -5
- package/es/components/Tile/Tile.js +16 -10
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/Tooltip/DefinitionTooltip.js +2 -2
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +2 -2
- package/es/components/TreeView/TreeNode.d.ts +3 -5
- package/es/components/TreeView/TreeNode.js +3 -4
- package/es/components/TreeView/TreeView.js +2 -2
- package/es/components/UIShell/HeaderContainer.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNav.js +2 -2
- package/es/components/UIShell/SideNavHeader.d.ts +2 -3
- package/es/components/UIShell/SideNavHeader.js +1 -2
- package/es/components/UIShell/SideNavLink.d.ts +2 -2
- package/es/components/UIShell/SideNavLink.js +1 -1
- package/es/components/UIShell/SideNavMenu.d.ts +2 -2
- package/es/components/UIShell/SideNavMenu.js +3 -3
- package/es/components/UIShell/SwitcherItem.js +2 -2
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.d.ts +2 -2
- package/es/internal/FloatingMenu.js +8 -5
- package/es/internal/OptimizedResize.d.ts +18 -0
- package/es/internal/OptimizedResize.js +21 -24
- package/es/internal/createClassWrapper.d.ts +3 -3
- package/es/internal/createClassWrapper.js +4 -4
- package/es/internal/keyboard/index.d.ts +9 -0
- package/es/internal/keyboard/keys.d.ts +23 -0
- package/es/internal/keyboard/keys.js +2 -2
- package/es/internal/keyboard/match.d.ts +26 -0
- package/es/internal/keyboard/match.js +17 -41
- package/es/internal/keyboard/navigation.d.ts +37 -0
- package/es/internal/keyboard/navigation.js +15 -27
- package/es/internal/useIsomorphicEffect.d.ts +10 -0
- package/es/internal/useIsomorphicEffect.js +2 -3
- package/es/internal/useMatchMedia.d.ts +8 -0
- package/es/internal/useMatchMedia.js +10 -20
- package/es/internal/useMergedRefs.js +3 -0
- package/es/internal/useNormalizedInputProps.d.ts +52 -0
- package/es/internal/useNormalizedInputProps.js +9 -36
- package/lib/components/Accordion/AccordionItem.js +2 -2
- package/lib/components/Button/Button.d.ts +2 -3
- package/lib/components/Button/Button.js +29 -19
- package/lib/components/Button/ButtonBase.js +3 -1
- package/lib/components/ChatButton/ChatButton.d.ts +2 -3
- package/lib/components/ChatButton/ChatButton.js +1 -2
- package/lib/components/ComboBox/ComboBox.js +34 -24
- package/lib/components/ComposedModal/ComposedModal.js +64 -50
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.js +3 -3
- package/lib/components/DataTable/TableBatchAction.d.ts +3 -3
- package/lib/components/DataTable/TableBatchAction.js +1 -1
- package/lib/components/DataTable/TableContainer.d.ts +1 -1
- package/lib/components/DataTable/TableContainer.js +5 -4
- package/lib/components/DataTable/TableExpandHeader.d.ts +6 -5
- package/lib/components/DataTable/TableToolbarMenu.d.ts +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +1 -1
- package/lib/components/DatePicker/DatePicker.js +2 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/Dialog/index.d.ts +42 -4
- package/lib/components/Dialog/index.js +190 -0
- package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/lib/components/FeatureFlags/index.d.ts +3 -1
- package/lib/components/FeatureFlags/index.js +3 -0
- package/lib/components/FileUploader/FileUploader.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.js +2 -2
- package/lib/components/FileUploader/FileUploaderButton.js +2 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +6 -4
- package/lib/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +2 -2
- package/lib/components/Grid/CSSGrid.js +18 -14
- package/lib/components/Grid/Column.d.ts +2 -2
- package/lib/components/Grid/Column.js +7 -8
- package/lib/components/Grid/FlexGrid.js +7 -6
- package/lib/components/Grid/GridTypes.d.ts +5 -3
- package/lib/components/IconButton/index.d.ts +2 -2
- package/lib/components/IconButton/index.js +4 -4
- package/lib/components/Layer/index.d.ts +4 -6
- package/lib/components/Layer/index.js +5 -6
- package/lib/components/Link/Link.d.ts +2 -3
- package/lib/components/Link/Link.js +1 -2
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +3 -3
- package/lib/components/ListBox/ListBoxMenuItem.js +36 -14
- package/lib/components/Menu/Menu.js +2 -2
- package/lib/components/Menu/MenuItem.d.ts +2 -2
- package/lib/components/Menu/MenuItem.js +3 -3
- package/lib/components/Modal/Modal.js +123 -51
- package/lib/components/ModalWrapper/ModalWrapper.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/lib/components/MultiSelect/MultiSelect.js +2 -2
- package/lib/components/MultiSelect/index.d.ts +1 -1
- package/lib/components/MultiSelect/index.js +1 -8
- package/lib/components/Notification/Notification.d.ts +5 -13
- package/lib/components/Notification/Notification.js +3 -4
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +22 -201
- package/lib/components/OverflowMenu/OverflowMenu.js +268 -336
- package/lib/components/OverflowMenu/index.d.ts +5 -5
- package/lib/components/OverflowMenu/index.js +2 -2
- package/lib/components/OverflowMenu/next/index.d.ts +4 -4
- package/lib/components/OverflowMenu/next/index.js +1 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.d.ts +2 -3
- package/lib/components/Search/Search.js +4 -6
- package/lib/components/Slider/Slider.d.ts +39 -44
- package/lib/components/Slider/Slider.js +57 -59
- package/lib/components/Tabs/Tabs.d.ts +3 -6
- package/lib/components/Tabs/Tabs.js +16 -18
- package/lib/components/Tag/DismissibleTag.d.ts +3 -5
- package/lib/components/Tag/DismissibleTag.js +1 -2
- package/lib/components/Tag/OperationalTag.d.ts +2 -3
- package/lib/components/Tag/OperationalTag.js +1 -2
- package/lib/components/Tag/SelectableTag.d.ts +3 -5
- package/lib/components/Tag/SelectableTag.js +1 -2
- package/lib/components/Tag/Tag.d.ts +2 -3
- package/lib/components/Tag/Tag.js +1 -2
- package/lib/components/Tile/Tile.d.ts +3 -5
- package/lib/components/Tile/Tile.js +16 -10
- package/lib/components/Toggletip/index.js +2 -2
- package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +2 -2
- package/lib/components/TreeView/TreeNode.d.ts +3 -5
- package/lib/components/TreeView/TreeNode.js +3 -4
- package/lib/components/TreeView/TreeView.js +2 -2
- package/lib/components/UIShell/HeaderContainer.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +2 -2
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNav.js +2 -2
- package/lib/components/UIShell/SideNavHeader.d.ts +2 -3
- package/lib/components/UIShell/SideNavHeader.js +1 -2
- package/lib/components/UIShell/SideNavLink.d.ts +2 -2
- package/lib/components/UIShell/SideNavLink.js +1 -1
- package/lib/components/UIShell/SideNavMenu.d.ts +2 -2
- package/lib/components/UIShell/SideNavMenu.js +3 -3
- package/lib/components/UIShell/SwitcherItem.js +2 -2
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.d.ts +2 -2
- package/lib/internal/FloatingMenu.js +9 -6
- package/lib/internal/OptimizedResize.d.ts +18 -0
- package/lib/internal/OptimizedResize.js +21 -24
- package/lib/internal/createClassWrapper.d.ts +3 -3
- package/lib/internal/createClassWrapper.js +4 -4
- package/lib/internal/keyboard/index.d.ts +9 -0
- package/lib/internal/keyboard/keys.d.ts +23 -0
- package/lib/internal/keyboard/keys.js +2 -2
- package/lib/internal/keyboard/match.d.ts +26 -0
- package/lib/internal/keyboard/match.js +17 -41
- package/lib/internal/keyboard/navigation.d.ts +37 -0
- package/lib/internal/keyboard/navigation.js +15 -27
- package/lib/internal/useIsomorphicEffect.d.ts +10 -0
- package/lib/internal/useIsomorphicEffect.js +2 -3
- package/lib/internal/useMatchMedia.d.ts +8 -0
- package/lib/internal/useMatchMedia.js +10 -20
- package/lib/internal/useMergedRefs.js +3 -0
- package/lib/internal/useNormalizedInputProps.d.ts +52 -0
- package/lib/internal/useNormalizedInputProps.js +9 -36
- package/package.json +6 -6
- package/scss/components/dialog/_dialog.scss +9 -0
- package/scss/components/dialog/_index.scss +9 -0
- package/telemetry.yml +1 -0
- package/es/components/Modal/next/index.d.ts +0 -171
- package/es/internal/focus/index.js +0 -15
- package/es/internal/useEffectOnce.js +0 -30
- package/lib/components/Modal/next/index.d.ts +0 -171
- package/lib/internal/focus/index.js +0 -19
- package/lib/internal/useEffectOnce.js +0 -34
|
@@ -4,32 +4,35 @@
|
|
|
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, { type ElementType, type ReactNode, type Ref } from 'react';
|
|
7
8
|
import { type MenuDirection, type MenuOffset } from '../../internal/FloatingMenu';
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Calculates the offset for the floating menu.
|
|
11
|
+
*
|
|
12
|
+
* @param menuBody - The menu body with the menu arrow.
|
|
13
|
+
* @param direction - The floating menu direction.
|
|
14
|
+
* @returns The adjustment of the floating menu position, upon the position of
|
|
15
|
+
* the menu arrow.
|
|
16
|
+
*/
|
|
10
17
|
export declare const getMenuOffset: MenuOffset;
|
|
11
|
-
type IconProps = {
|
|
12
|
-
className?: string;
|
|
13
|
-
'aria-label'?: string;
|
|
14
|
-
};
|
|
15
18
|
export interface OverflowMenuProps {
|
|
16
19
|
/**
|
|
17
20
|
* Specify a label to be read by screen readers on the container node
|
|
18
21
|
*/
|
|
19
22
|
['aria-label']?: string;
|
|
20
23
|
/**
|
|
21
|
-
* Deprecated, please use `aria-label` instead.
|
|
22
24
|
* Specify a label to be read by screen readers on the container note.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
|
|
25
|
+
*
|
|
26
|
+
* @deprecated - Use `aria-label` instead.
|
|
27
|
+
*/
|
|
28
|
+
ariaLabel?: string;
|
|
26
29
|
/**
|
|
27
30
|
* The child nodes.
|
|
28
|
-
|
|
29
|
-
children:
|
|
31
|
+
*/
|
|
32
|
+
children: ReactNode;
|
|
30
33
|
/**
|
|
31
|
-
*
|
|
32
|
-
|
|
34
|
+
* The CSS class names.
|
|
35
|
+
*/
|
|
33
36
|
className?: string;
|
|
34
37
|
/**
|
|
35
38
|
* The menu direction.
|
|
@@ -89,9 +92,9 @@ export interface OverflowMenuProps {
|
|
|
89
92
|
*/
|
|
90
93
|
open?: boolean;
|
|
91
94
|
/**
|
|
92
|
-
*
|
|
95
|
+
* A component used to render an icon.
|
|
93
96
|
*/
|
|
94
|
-
renderIcon?:
|
|
97
|
+
renderIcon?: ElementType;
|
|
95
98
|
/**
|
|
96
99
|
* Specify a CSS selector that matches the DOM element that should
|
|
97
100
|
* be focused when the OverflowMenu opens
|
|
@@ -104,189 +107,7 @@ export interface OverflowMenuProps {
|
|
|
104
107
|
/**
|
|
105
108
|
* The ref to the HTML element that should receive focus when the OverflowMenu opens
|
|
106
109
|
*/
|
|
107
|
-
innerRef?:
|
|
108
|
-
}
|
|
109
|
-
export interface OverflowMenuState {
|
|
110
|
-
open: boolean;
|
|
111
|
-
prevOpen?: boolean;
|
|
112
|
-
hasMountedTrigger: boolean;
|
|
113
|
-
click: boolean;
|
|
114
|
-
}
|
|
115
|
-
interface ReleaseHandle {
|
|
116
|
-
release: () => null;
|
|
117
|
-
}
|
|
118
|
-
declare class OverflowMenu extends React.Component<OverflowMenuProps, OverflowMenuState> {
|
|
119
|
-
state: OverflowMenuState;
|
|
120
|
-
instanceId: number;
|
|
121
|
-
static propTypes: {
|
|
122
|
-
/**
|
|
123
|
-
* Specify a label to be read by screen readers on the container node
|
|
124
|
-
*/
|
|
125
|
-
"aria-label": PropTypes.Requireable<string>;
|
|
126
|
-
/**
|
|
127
|
-
* Deprecated, please use `aria-label` instead.
|
|
128
|
-
* Specify a label to be read by screen readers on the container note.
|
|
129
|
-
*/
|
|
130
|
-
ariaLabel: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
|
|
131
|
-
/**
|
|
132
|
-
* The child nodes.
|
|
133
|
-
*/
|
|
134
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
135
|
-
/**
|
|
136
|
-
* The CSS class names.
|
|
137
|
-
*/
|
|
138
|
-
className: PropTypes.Requireable<string>;
|
|
139
|
-
/**
|
|
140
|
-
* The menu direction.
|
|
141
|
-
*/
|
|
142
|
-
direction: PropTypes.Requireable<string>;
|
|
143
|
-
/**
|
|
144
|
-
* `true` if the menu alignment should be flipped.
|
|
145
|
-
*/
|
|
146
|
-
flipped: PropTypes.Requireable<boolean>;
|
|
147
|
-
/**
|
|
148
|
-
* Enable or disable focus trap behavior
|
|
149
|
-
*/
|
|
150
|
-
focusTrap: PropTypes.Requireable<boolean>;
|
|
151
|
-
/**
|
|
152
|
-
* The CSS class for the icon.
|
|
153
|
-
*/
|
|
154
|
-
iconClass: PropTypes.Requireable<string>;
|
|
155
|
-
/**
|
|
156
|
-
* The icon description.
|
|
157
|
-
*/
|
|
158
|
-
iconDescription: PropTypes.Requireable<string>;
|
|
159
|
-
/**
|
|
160
|
-
* The element ID.
|
|
161
|
-
*/
|
|
162
|
-
id: PropTypes.Requireable<string>;
|
|
163
|
-
/**
|
|
164
|
-
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
165
|
-
* Don't use this to make OverflowMenu background color same as container background color.
|
|
166
|
-
*/
|
|
167
|
-
light: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
|
|
168
|
-
/**
|
|
169
|
-
* The adjustment in position applied to the floating menu.
|
|
170
|
-
*/
|
|
171
|
-
menuOffset: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
172
|
-
top: PropTypes.Requireable<number>;
|
|
173
|
-
left: PropTypes.Requireable<number>;
|
|
174
|
-
}> | null | undefined>>;
|
|
175
|
-
/**
|
|
176
|
-
* The adjustment in position applied to the floating menu.
|
|
177
|
-
*/
|
|
178
|
-
menuOffsetFlip: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
179
|
-
top: PropTypes.Requireable<number>;
|
|
180
|
-
left: PropTypes.Requireable<number>;
|
|
181
|
-
}> | null | undefined>>;
|
|
182
|
-
/**
|
|
183
|
-
* The class to apply to the menu options
|
|
184
|
-
*/
|
|
185
|
-
menuOptionsClass: PropTypes.Requireable<string>;
|
|
186
|
-
/**
|
|
187
|
-
* The event handler for the `click` event.
|
|
188
|
-
*/
|
|
189
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
190
|
-
/**
|
|
191
|
-
* Function called when menu is closed
|
|
192
|
-
*/
|
|
193
|
-
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
194
|
-
/**
|
|
195
|
-
* The event handler for the `focus` event.
|
|
196
|
-
*/
|
|
197
|
-
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
198
|
-
/**
|
|
199
|
-
* The event handler for the `keydown` event.
|
|
200
|
-
*/
|
|
201
|
-
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
202
|
-
/**
|
|
203
|
-
* Function called when menu is opened
|
|
204
|
-
*/
|
|
205
|
-
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
206
|
-
/**
|
|
207
|
-
* `true` if the menu should be open.
|
|
208
|
-
*/
|
|
209
|
-
open: PropTypes.Requireable<boolean>;
|
|
210
|
-
/**
|
|
211
|
-
* Function called to override icon rendering.
|
|
212
|
-
*/
|
|
213
|
-
renderIcon: PropTypes.Requireable<object>;
|
|
214
|
-
/**
|
|
215
|
-
* Specify a CSS selector that matches the DOM element that should
|
|
216
|
-
* be focused when the OverflowMenu opens
|
|
217
|
-
*/
|
|
218
|
-
selectorPrimaryFocus: PropTypes.Requireable<string>;
|
|
219
|
-
/**
|
|
220
|
-
* Specify the size of the OverflowMenu. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
|
|
221
|
-
*/
|
|
222
|
-
size: PropTypes.Requireable<string>;
|
|
223
|
-
};
|
|
224
|
-
static contextType: React.Context<string>;
|
|
225
|
-
/**
|
|
226
|
-
* The handle of `onfocusin` or `focus` event handler.
|
|
227
|
-
* @private
|
|
228
|
-
*/
|
|
229
|
-
_hFocusIn: ReleaseHandle | null;
|
|
230
|
-
/**
|
|
231
|
-
* The timeout handle for handling `blur` event.
|
|
232
|
-
* @private
|
|
233
|
-
*/
|
|
234
|
-
_hBlurTimeout: any;
|
|
235
|
-
/**
|
|
236
|
-
* The element ref of the tooltip's trigger button.
|
|
237
|
-
* @type {React.RefObject<HTMLElement>}
|
|
238
|
-
* @private
|
|
239
|
-
*/
|
|
240
|
-
_triggerRef: React.RefObject<HTMLElement>;
|
|
241
|
-
componentDidUpdate(_: any, prevState: any): void;
|
|
242
|
-
componentDidMount(): void;
|
|
243
|
-
static getDerivedStateFromProps({ open }: {
|
|
244
|
-
open: any;
|
|
245
|
-
}, state: any): {
|
|
246
|
-
open: any;
|
|
247
|
-
prevOpen: any;
|
|
248
|
-
} | null;
|
|
249
|
-
componentWillUnmount(): void;
|
|
250
|
-
handleClick: (evt: any) => void;
|
|
251
|
-
closeMenuAndFocus: () => void;
|
|
252
|
-
closeMenuOnEscape: () => void;
|
|
253
|
-
handleKeyPress: (evt: any) => void;
|
|
254
|
-
handleClickOutside: (evt: any) => void;
|
|
255
|
-
closeMenu: (onCloseMenu?: any) => void;
|
|
256
|
-
focusMenuEl: () => void;
|
|
257
|
-
/**
|
|
258
|
-
* Focuses the next enabled overflow menu item given the currently focused
|
|
259
|
-
* item index and direction to move
|
|
260
|
-
* @param {object} params
|
|
261
|
-
* @param {number} params.currentIndex - the index of the currently focused
|
|
262
|
-
* overflow menu item in the list of overflow menu items
|
|
263
|
-
* @param {number} params.direction - number denoting the direction to move
|
|
264
|
-
* focus (1 for forwards, -1 for backwards)
|
|
265
|
-
*/
|
|
266
|
-
handleOverflowMenuItemFocus: ({ currentIndex, direction }: {
|
|
267
|
-
currentIndex: any;
|
|
268
|
-
direction: any;
|
|
269
|
-
}) => void;
|
|
270
|
-
/**
|
|
271
|
-
* Handles the floating menu being unmounted or non-floating menu being
|
|
272
|
-
* mounted or unmounted.
|
|
273
|
-
* @param {Element} menuBody The DOM element of the menu body.
|
|
274
|
-
* @private
|
|
275
|
-
*/
|
|
276
|
-
_menuBody: HTMLElement | null;
|
|
277
|
-
_bindMenuBody: (menuBody: HTMLElement | null) => void;
|
|
278
|
-
/**
|
|
279
|
-
* Handles the floating menu being placed.
|
|
280
|
-
* @param {Element} menuBody The DOM element of the menu body.
|
|
281
|
-
* @private
|
|
282
|
-
*/
|
|
283
|
-
_handlePlace: (menuBody: any) => void;
|
|
284
|
-
/**
|
|
285
|
-
* @returns {Element} The DOM element where the floating menu is placed in.
|
|
286
|
-
*/
|
|
287
|
-
_getTarget: () => Element;
|
|
288
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
innerRef?: Ref<any>;
|
|
289
111
|
}
|
|
290
|
-
export
|
|
291
|
-
|
|
292
|
-
export default _default;
|
|
112
|
+
export declare const OverflowMenu: React.ForwardRefExoticComponent<OverflowMenuProps & React.RefAttributes<HTMLButtonElement>>;
|
|
113
|
+
export default OverflowMenu;
|