Menu.d.ts
3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import * as React from 'react';
import { CSSMotionProps } from 'rc-motion';
import SubPopupMenu from './SubPopupMenu';
import { noop } from './util';
import { RenderIconType, SelectInfo, SelectEventHandler, DestroyEventHandler, MenuMode, OpenAnimation, MiniStore, BuiltinPlacements, TriggerSubMenuAction, MenuClickEventHandler } from './interface';
export interface MenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick' | 'onSelect'> {
defaultSelectedKeys?: string[];
defaultActiveFirst?: boolean;
selectedKeys?: string[];
defaultOpenKeys?: string[];
openKeys?: string[];
mode?: MenuMode;
getPopupContainer?: (node: HTMLElement) => HTMLElement;
onClick?: MenuClickEventHandler;
onSelect?: SelectEventHandler;
onOpenChange?: (openKeys: React.Key[]) => void;
onDeselect?: SelectEventHandler;
onDestroy?: DestroyEventHandler;
subMenuOpenDelay?: number;
subMenuCloseDelay?: number;
forceSubMenuRender?: boolean;
triggerSubMenuAction?: TriggerSubMenuAction;
level?: number;
selectable?: boolean;
multiple?: boolean;
activeKey?: string;
prefixCls?: string;
builtinPlacements?: BuiltinPlacements;
itemIcon?: RenderIconType;
expandIcon?: RenderIconType;
overflowedIndicator?: React.ReactNode;
/** Menu motion define */
motion?: CSSMotionProps;
/** Default menu motion of each mode */
defaultMotions?: Partial<{
[key in MenuMode | 'other']: CSSMotionProps;
}>;
/** @deprecated Please use `motion` instead */
openTransitionName?: string;
/** @deprecated Please use `motion` instead */
openAnimation?: OpenAnimation;
/** direction of menu */
direction?: 'ltr' | 'rtl';
inlineCollapsed?: boolean;
/** SiderContextProps of layout in ant design */
siderCollapsed?: boolean;
collapsedWidth?: string | number;
}
export interface MenuState {
switchingModeFromInline: boolean;
prevProps: MenuProps;
inlineOpenKeys: Array<string>;
store: MiniStore;
}
declare class Menu extends React.Component<MenuProps, MenuState> {
static defaultProps: {
selectable: boolean;
onClick: typeof noop;
onSelect: typeof noop;
onOpenChange: typeof noop;
onDeselect: typeof noop;
defaultSelectedKeys: any[];
defaultOpenKeys: any[];
subMenuOpenDelay: number;
subMenuCloseDelay: number;
triggerSubMenuAction: string;
prefixCls: string;
className: string;
mode: string;
style: {};
builtinPlacements: {};
overflowedIndicator: JSX.Element;
};
constructor(props: MenuProps);
isRootMenu: boolean;
store: MiniStore;
innerMenu: typeof SubPopupMenu;
prevOpenKeys: string[];
static getDerivedStateFromProps(nextProps: MenuProps, prevState: MenuState): Partial<MenuState>;
componentDidMount(): void;
componentDidUpdate(prevProps: MenuProps): void;
updateMenuDisplay(): void;
onSelect: (selectInfo: SelectInfo) => void;
onClick: MenuClickEventHandler;
onKeyDown: (e: React.KeyboardEvent<HTMLElement>, callback: any) => void;
onOpenChange: (event: any) => void;
onDeselect: (selectInfo: SelectInfo) => void;
getRealMenuMode(): MenuMode;
getInlineCollapsed(): boolean;
onMouseEnter: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
onTransitionEnd: (e: React.TransitionEvent<HTMLDivElement>) => void;
restoreModeVerticalFromInline(): void;
setInnerMenu: (node: any) => void;
updateMiniStore(): void;
render(): JSX.Element;
}
export default Menu;