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 | interface HTMLAttributesWeak extends ButtonProps {
|
10 | onSelect?: any;
|
11 | }
|
12 |
|
13 | export interface SplitButtonProps extends HTMLAttributesWeak, CommonProps {
|
14 | |
15 |
|
16 |
|
17 | type?: 'normal' | 'primary' | 'secondary';
|
18 |
|
19 | |
20 |
|
21 |
|
22 | size?: 'small' | 'medium' | 'large';
|
23 |
|
24 | |
25 |
|
26 |
|
27 | label?: React.ReactNode;
|
28 |
|
29 | |
30 |
|
31 |
|
32 | component?: 'button' | 'a';
|
33 |
|
34 | |
35 |
|
36 |
|
37 | ghost?: 'light' | 'dark' | false | true;
|
38 |
|
39 | |
40 |
|
41 |
|
42 | defaultSelectedKeys?: string[];
|
43 |
|
44 | |
45 |
|
46 |
|
47 | selectedKeys?: string[];
|
48 |
|
49 | |
50 |
|
51 |
|
52 | selectMode?: 'single' | 'multiple';
|
53 |
|
54 | |
55 |
|
56 |
|
57 | triggerProps?: ButtonProps;
|
58 |
|
59 | |
60 |
|
61 |
|
62 | autoWidth?: boolean;
|
63 |
|
64 | |
65 |
|
66 |
|
67 | visible?: boolean;
|
68 |
|
69 | |
70 |
|
71 |
|
72 | defaultVisible?: boolean;
|
73 |
|
74 | |
75 |
|
76 |
|
77 | onVisibleChange?: (visible: boolean, reason: string) => void;
|
78 |
|
79 | |
80 |
|
81 |
|
82 | popupTriggerType?: 'click' | 'hover';
|
83 |
|
84 | |
85 |
|
86 |
|
87 | popupAlign?: string;
|
88 |
|
89 | |
90 |
|
91 |
|
92 | popupStyle?: React.CSSProperties;
|
93 |
|
94 | |
95 |
|
96 |
|
97 | popupClassName?: string;
|
98 |
|
99 | |
100 |
|
101 |
|
102 | popupProps?: PopupProps;
|
103 |
|
104 | |
105 |
|
106 |
|
107 | onItemClick?: (key: string, item: any, event: React.MouseEvent<HTMLElement>) => void;
|
108 |
|
109 | |
110 |
|
111 |
|
112 | onSelect?: (selectedKeys: Array<any>, item: any, extra: any) => void;
|
113 |
|
114 | |
115 |
|
116 |
|
117 | menuProps?: MenuProps;
|
118 |
|
119 | |
120 |
|
121 |
|
122 | leftButtonProps?: ButtonProps;
|
123 | }
|
124 |
|
125 | export default class SplitButton extends React.Component<SplitButtonProps, any> {
|
126 | static Item: typeof Item;
|
127 | static Group: typeof Group;
|
128 | static Divider: typeof Divider;
|
129 | }
|