1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 | import { PopupProps } from '../overlay';
|
6 |
|
7 | export interface GroupProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
8 | |
9 |
|
10 |
|
11 | label?: React.ReactNode;
|
12 |
|
13 | |
14 |
|
15 |
|
16 | children?: React.ReactNode;
|
17 |
|
18 | |
19 |
|
20 |
|
21 | className?: string;
|
22 | }
|
23 |
|
24 | export class Group extends React.Component<GroupProps, any> {}
|
25 |
|
26 | export interface ItemProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
27 | |
28 |
|
29 |
|
30 | disabled?: boolean;
|
31 |
|
32 | |
33 |
|
34 |
|
35 | helper?: React.ReactNode;
|
36 |
|
37 | |
38 |
|
39 |
|
40 | children?: React.ReactNode;
|
41 |
|
42 | |
43 |
|
44 |
|
45 | icon?: string | React.ReactNode;
|
46 | }
|
47 |
|
48 | export class Item extends React.Component<ItemProps, any> {}
|
49 |
|
50 | export interface PopupItemProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
51 | |
52 |
|
53 |
|
54 | label?: React.ReactNode;
|
55 |
|
56 | |
57 |
|
58 |
|
59 | children?: React.ReactNode;
|
60 |
|
61 | |
62 |
|
63 |
|
64 | className?: string;
|
65 |
|
66 | |
67 |
|
68 |
|
69 | icon?: string | React.ReactNode;
|
70 | }
|
71 |
|
72 | export class PopupItem extends React.Component<PopupItemProps, any> {}
|
73 |
|
74 | export interface SubNavProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
75 | |
76 |
|
77 |
|
78 | className?: string;
|
79 |
|
80 | |
81 |
|
82 |
|
83 | icon?: string | React.ReactNode;
|
84 |
|
85 | |
86 |
|
87 |
|
88 | label?: React.ReactNode;
|
89 |
|
90 | |
91 |
|
92 |
|
93 | selectable?: boolean;
|
94 |
|
95 | |
96 |
|
97 |
|
98 | children?: React.ReactNode;
|
99 | }
|
100 |
|
101 | export class SubNav extends React.Component<SubNavProps, any> {}
|
102 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
103 | onSelect?: any;
|
104 | }
|
105 |
|
106 | export interface NavProps extends HTMLAttributesWeak, CommonProps {
|
107 | |
108 |
|
109 |
|
110 | children?: React.ReactNode;
|
111 |
|
112 | |
113 |
|
114 |
|
115 | onItemClick?: (key: string, item: {}, event: {}) => void;
|
116 |
|
117 | |
118 |
|
119 |
|
120 | openKeys?: string | Array<any>;
|
121 |
|
122 | |
123 |
|
124 |
|
125 | defaultOpenKeys?: string | Array<any>;
|
126 |
|
127 | |
128 |
|
129 |
|
130 | defaultOpenAll?: boolean;
|
131 |
|
132 | |
133 |
|
134 |
|
135 | onOpen?: (key: string[], extra: { key: string; open: boolean }) => void;
|
136 |
|
137 | |
138 |
|
139 |
|
140 | mode?: 'inline' | 'popup';
|
141 |
|
142 | |
143 |
|
144 |
|
145 | triggerType?: 'click' | 'hover';
|
146 |
|
147 | |
148 |
|
149 |
|
150 | openMode?: 'single' | 'multiple';
|
151 |
|
152 | |
153 |
|
154 |
|
155 | inlineIndent?: number;
|
156 |
|
157 | |
158 |
|
159 |
|
160 | popupAutoWidth?: boolean;
|
161 |
|
162 | |
163 |
|
164 |
|
165 | popupAlign?: 'follow' | 'outside';
|
166 |
|
167 | |
168 |
|
169 |
|
170 | popupProps?: PopupProps | (() => void);
|
171 |
|
172 | /**
|
173 | * 弹出子导航的自定义类名
|
174 | */
|
175 | popupClassName?: string;
|
176 |
|
177 | /**
|
178 | * 弹出子菜单自定义 style
|
179 | */
|
180 | popupStyle?: React.CSSProperties;
|
181 |
|
182 | /**
|
183 | * 当前选中导航项的 key 值
|
184 | */
|
185 | selectedKeys?: string | Array<any>;
|
186 |
|
187 | /**
|
188 | * 初始选中导航项的 key 值
|
189 | */
|
190 | defaultSelectedKeys?: string | Array<any>;
|
191 |
|
192 | /**
|
193 | * 选中或取消选中导航项触发的回调函数
|
194 | */
|
195 | onSelect?: (selectedKeys: Array<any>, item: {}, extra: {}) => void;
|
196 |
|
197 | |
198 |
|
199 |
|
200 | selectMode?: 'single' | 'multiple';
|
201 |
|
202 | |
203 |
|
204 |
|
205 | shallowSelect?: boolean;
|
206 |
|
207 | |
208 |
|
209 |
|
210 | hasSelectedIcon?: boolean;
|
211 |
|
212 | |
213 |
|
214 |
|
215 |
|
216 | isSelectIconRight?: boolean;
|
217 |
|
218 | |
219 |
|
220 |
|
221 | direction?: 'hoz' | 'ver';
|
222 |
|
223 | |
224 |
|
225 |
|
226 | hozAlign?: 'left' | 'right';
|
227 |
|
228 | |
229 |
|
230 |
|
231 | header?: React.ReactNode;
|
232 |
|
233 | |
234 |
|
235 |
|
236 | footer?: React.ReactNode;
|
237 |
|
238 | |
239 |
|
240 |
|
241 | autoFocus?: boolean;
|
242 |
|
243 | |
244 |
|
245 |
|
246 | focusedKey?: string;
|
247 |
|
248 | |
249 |
|
250 |
|
251 | embeddable?: boolean;
|
252 |
|
253 | |
254 |
|
255 |
|
256 | type?: 'normal' | 'primary' | 'secondary' | 'line';
|
257 |
|
258 | |
259 |
|
260 |
|
261 | activeDirection?: null | 'top' | 'bottom' | 'left' | 'right';
|
262 |
|
263 | |
264 |
|
265 |
|
266 | iconOnly?: boolean;
|
267 |
|
268 | |
269 |
|
270 |
|
271 | iconOnlyWidth?: number | string;
|
272 |
|
273 | |
274 |
|
275 |
|
276 | hasArrow?: boolean;
|
277 |
|
278 | |
279 |
|
280 |
|
281 | hasTooltip?: boolean;
|
282 | }
|
283 |
|
284 | export default class Nav extends React.Component<NavProps, any> {
|
285 | static Group: typeof Group;
|
286 | static Item: typeof Item;
|
287 | static PopupItem: typeof PopupItem;
|
288 | static SubNav: typeof SubNav;
|
289 | }
|