UNPKG

3.18 kBTypeScriptView Raw
1import * as React from 'react';
2import { OUIAProps } from '../../helpers';
3export interface MenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'ref' | 'onSelect'>, OUIAProps {
4 /** Anything that can be rendered inside of the Menu */
5 children?: React.ReactNode;
6 /** Additional classes added to the Menu */
7 className?: string;
8 /** ID of the menu */
9 id?: string;
10 /** Callback for updating when item selection changes. You can also specify onClick on the MenuItem. */
11 onSelect?: (event?: React.MouseEvent, itemId?: string | number) => void;
12 /** Single itemId for single select menus, or array of itemIds for multi select. You can also specify isSelected on the MenuItem. */
13 selected?: any | any[];
14 /** Callback called when an MenuItems's action button is clicked. You can also specify it within a MenuItemAction. */
15 onActionClick?: (event?: any, itemId?: any, actionId?: any) => void;
16 /** Search input of menu */
17 hasSearchInput?: boolean;
18 /** A callback for when the input value changes. */
19 onSearchInputChange?: (event: React.FormEvent<HTMLInputElement> | React.SyntheticEvent<HTMLButtonElement>, value: string) => void;
20 /** Accessibility label */
21 'aria-label'?: string;
22 /** @beta Indicates if menu contains a flyout menu */
23 containsFlyout?: boolean;
24 /** @beta Indicating that the menu should have nav flyout styling */
25 isNavFlyout?: boolean;
26 /** @beta Indicates if menu contains a drilldown menu */
27 containsDrilldown?: boolean;
28 /** @beta Indicates if a menu is drilled into */
29 isMenuDrilledIn?: boolean;
30 /** @beta Indicates the path of drilled in menu itemIds */
31 drilldownItemPath?: string[];
32 /** @beta Array of menus that are drilled in */
33 drilledInMenus?: string[];
34 /** @beta Callback for drilling into a submenu */
35 onDrillIn?: (fromItemId: string, toItemId: string, itemId: string) => void;
36 /** @beta Callback for drilling out of a submenu */
37 onDrillOut?: (toItemId: string, itemId: string) => void;
38 /** @beta Callback for collecting menu heights */
39 onGetMenuHeight?: (menuId: string, height: number) => void;
40 /** @beta ID of parent menu for drilldown menus */
41 parentMenu?: string;
42 /** @beta ID of the currently active menu for the drilldown variant */
43 activeMenu?: string;
44 /** @beta itemId of the currently active item. You can also specify isActive on the MenuItem. */
45 activeItemId?: string | number;
46 /** @hide Forwarded ref */
47 innerRef?: React.Ref<HTMLDivElement>;
48 /** Internal flag indicating if the Menu is the root of a menu tree */
49 isRootMenu?: boolean;
50 /** Indicates if the menu should be without the outer box-shadow */
51 isPlain?: boolean;
52 /** Indicates if the menu should be srollable */
53 isScrollable?: boolean;
54}
55export interface MenuState {
56 searchInputValue: string | null;
57 ouiaStateId: string;
58 transitionMoveTarget: HTMLElement;
59 flyoutRef: React.Ref<HTMLLIElement> | null;
60 disableHover: boolean;
61}
62export declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLDivElement>>;
63//# sourceMappingURL=Menu.d.ts.map
\No newline at end of file