1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import { Item, Group, Divider, MenuProps } from '../menu';
|
5 | import CommonProps from '../util';
|
6 | import { ButtonProps } from '../button';
|
7 | import { PopupProps } from '../overlay';
|
8 |
|
9 | export interface MenuButtonProps extends Omit<ButtonProps, 'onSelect'>, CommonProps {
|
10 | |
11 |
|
12 |
|
13 | label?: React.ReactNode;
|
14 |
|
15 | |
16 |
|
17 |
|
18 | autoWidth?: boolean;
|
19 |
|
20 | |
21 |
|
22 |
|
23 | popupTriggerType?: 'click' | 'hover';
|
24 |
|
25 | |
26 |
|
27 |
|
28 | popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);
|
29 |
|
30 | /**
|
31 | * 弹层展开状态
|
32 | */
|
33 | visible?: boolean;
|
34 |
|
35 | /**
|
36 | * 弹层默认是否展开
|
37 | */
|
38 | defaultVisible?: boolean;
|
39 |
|
40 | /**
|
41 | * 弹层在显示和隐藏触发的事件
|
42 | */
|
43 | onVisibleChange?: (visible: boolean, type: string) => void;
|
44 |
|
45 | |
46 |
|
47 |
|
48 | popupStyle?: React.CSSProperties;
|
49 |
|
50 | |
51 |
|
52 |
|
53 | popupClassName?: string;
|
54 |
|
55 | |
56 |
|
57 |
|
58 | popupProps?: PopupProps;
|
59 |
|
60 | |
61 |
|
62 |
|
63 | followTrigger?: boolean;
|
64 |
|
65 | |
66 |
|
67 |
|
68 | defaultSelectedKeys?: Array<any>;
|
69 |
|
70 | |
71 |
|
72 |
|
73 | selectedKeys?: string | Array<any>;
|
74 |
|
75 | |
76 |
|
77 |
|
78 | selectMode?: 'single' | 'multiple';
|
79 |
|
80 | |
81 |
|
82 |
|
83 | onItemClick?: (key: string, item: any, event: React.MouseEvent<HTMLElement>) => void;
|
84 |
|
85 | |
86 |
|
87 |
|
88 | onSelect?: (selectedKeys: Array<any>, item: any, extra: any) => void;
|
89 |
|
90 | |
91 |
|
92 |
|
93 | menuProps?: MenuProps;
|
94 | }
|
95 |
|
96 | export default class MenuButton extends React.Component<MenuButtonProps, any> {
|
97 | static Item: typeof Item;
|
98 | static Group: typeof Group;
|
99 | static Divider: typeof Divider;
|
100 | }
|