SubPopupMenu.d.ts
3.71 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
import * as React from 'react';
import { CSSMotionProps } from 'rc-motion';
import { noop } from './util';
import { SelectEventHandler, OpenEventHandler, DestroyEventHandler, MiniStore, MenuMode, LegacyFunctionRef, RenderIconType, HoverEventHandler, BuiltinPlacements, MenuClickEventHandler, TriggerSubMenuAction } from './interface';
import { MenuItem, MenuItemProps } from './MenuItem';
export declare function getActiveKey(props: {
children?: React.ReactNode;
eventKey?: React.Key;
defaultActiveFirst?: boolean;
}, originalActiveKey: string): string | number;
export declare function saveRef(c: React.ReactInstance): void;
export interface SubPopupMenuProps {
onSelect?: SelectEventHandler;
onClick?: MenuClickEventHandler;
onDeselect?: SelectEventHandler;
onOpenChange?: OpenEventHandler;
onDestroy?: DestroyEventHandler;
openKeys?: string[];
visible?: boolean;
children?: React.ReactNode;
parentMenu?: React.ReactInstance;
eventKey?: React.Key;
store?: MiniStore;
prefixCls?: string;
focusable?: boolean;
multiple?: boolean;
style?: React.CSSProperties;
className?: string;
defaultActiveFirst?: boolean;
activeKey?: string;
selectedKeys?: string[];
defaultSelectedKeys?: string[];
defaultOpenKeys?: string[];
level?: number;
mode?: MenuMode;
triggerSubMenuAction?: TriggerSubMenuAction;
inlineIndent?: number;
manualRef?: LegacyFunctionRef;
itemIcon?: RenderIconType;
expandIcon?: RenderIconType;
subMenuOpenDelay?: number;
subMenuCloseDelay?: number;
forceSubMenuRender?: boolean;
builtinPlacements?: BuiltinPlacements;
role?: string;
id?: string;
overflowedIndicator?: React.ReactNode;
theme?: string;
motion?: CSSMotionProps;
direction?: 'ltr' | 'rtl';
}
export declare class SubPopupMenu extends React.Component<SubPopupMenuProps> {
static defaultProps: {
prefixCls: string;
className: string;
mode: string;
level: number;
inlineIndent: number;
visible: boolean;
focusable: boolean;
style: {};
manualRef: typeof noop;
};
constructor(props: SubPopupMenuProps);
instanceArray: MenuItem[];
componentDidMount(): void;
shouldComponentUpdate(nextProps: SubPopupMenuProps): boolean;
componentDidUpdate(prevProps: SubPopupMenuProps): void;
/**
* all keyboard events callbacks run from here at first
*
* note:
* This legacy code that `onKeyDown` is called by parent instead of dom self.
* which need return code to check if this event is handled
*/
onKeyDown: (e: React.KeyboardEvent<HTMLElement>, callback: (item: MenuItem) => void) => number;
onItemHover: HoverEventHandler;
onDeselect: SelectEventHandler;
onSelect: SelectEventHandler;
onClick: MenuClickEventHandler;
onOpenChange: OpenEventHandler;
onDestroy: DestroyEventHandler;
getFlatInstanceArray: () => MenuItem[];
step: (direction: number) => MenuItem;
renderCommonMenuItem: (child: React.ReactElement, i: number, extraProps: MenuItemProps) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
renderMenuItem: (c: React.ReactElement, i: number, subMenuKey: React.Key) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
render(): JSX.Element;
}
declare const connected: React.ComponentClass<SubPopupMenuProps, any> & {
getWrappedInstance: () => SubPopupMenu;
};
export default connected;