-
Notifications
You must be signed in to change notification settings - Fork 32
/
antd_v3.x.x.js
513 lines (418 loc) · 14.9 KB
/
antd_v3.x.x.js
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
// flow-typed signature: 7ea3e2a84916904f577e758892d7d8c3
// flow-typed version: ff9b65a21d/antd_v3.x.x/flow_>=v0.25.x
declare module "antd" {
import type { Node, Component } from "react";
declare type ModalReference = {
destroy: () => void
};
declare type messageFn<TReturn> = (
content: React$Node,
duration?: number,
onClose?: () => mixed
) => TReturn;
declare type modalFnArguments = {
title?: string,
content?: React$Node,
onOk?: () => mixed
};
declare function modalFn(args: modalFnArguments): ModalReference;
declare export class Alert extends React$Component<{}> {}
declare export class Avatar extends React$Component<{}> {}
declare export class AutoComplete extends React$Component<{}> {}
declare export class Badge extends React$Component<{}> {}
declare export type ButtonProps = {
disabled?: boolean,
ghost?: boolean,
href?: string,
htmlType?: string,
icon?: string,
loading?: boolean | { delay: number },
shape?: 'circle' | 'round',
size?: 'small' | 'large',
target?: string,
type?: 'primary' | 'ghost' | 'dashed' | 'danger' | 'default',
onClick?: (event: SyntheticEvent<HTMLButtonElement>) => void,
block?: boolean
}
declare export class Button extends React$Component<ButtonProps> {
static Group: typeof ButtonGroup
}
declare class ButtonGroup extends React$Component<{}> {}
declare export class Card extends React$Component<{}> {}
declare export class Checkbox extends React$Component<{}> {
static Group: typeof CheckboxGroup;
}
declare class CheckboxGroup extends React$Component<{}> {}
declare export class Divider extends React$Component<{}> {}
declare export class Col extends React$Component<{}> {}
declare export type DatePickerProps = {};
declare export class DatePicker extends React$Component<DatePickerProps> {
static RangePicker: typeof DatePicker$RangePicker;
}
declare export class Dropdown extends React$Component<{}> {}
declare export class Grid extends React$Component<{
className?: string,
style?: $Shape<CSSStyleDeclaration>
}> {}
declare export class Meta extends React$Component<{
avatar?: React$Node,
className?: string,
description?: React$Node,
style?: $Shape<CSSStyleDeclaration>,
title?: React$Node
}> {}
declare export class Card extends React$Component<{
actions?: Array<Node>,
activeTabKey?: string,
headStyle?: $Shape<CSSStyleDeclaration>,
bodyStyle?: $Shape<CSSStyleDeclaration>,
bordered?: boolean,
cover?: React$Node,
defaultActiveTabKey?: string,
extra?: React$Node,
hoverable?: boolean,
loading?: boolean,
tabList?: Array<{ key: string, tab: React$Node }>,
title?: React$Node,
type?: "inner",
onTabChange?: (key: string) => void
}> {
static Grid: typeof Grid;
static Meta: typeof Meta;
}
declare type CascaderOption = {
value: string,
label: string,
children?: CascaderOption[]
};
declare export type CascaderProps = {
allowClear?: boolean,
autoFocus?: boolean,
changeOnSelect?: boolean,
className?: string,
disabled?: boolean,
expandTrigger?: "click" | "hover",
notFoundContent?: string,
onChange?: (values: string[]) => mixed,
options: CascaderOption[],
placeholder?: string,
popupClassName?: string,
popupPlacement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight",
popupVisible?: boolean,
showSearch?: boolean,
size?: "large" | "default" | "small",
value?: string[]
};
declare export class Cascader extends React$Component<CascaderProps> {}
declare export class Col extends React$Component<{}> {}
declare export type CollapsePanelProps = {};
declare class CollapsePanel extends React$Component<CollapsePanelProps> {}
declare export type CollapseProps = {};
declare export class Collapse extends React$Component<CollapseProps> {
static Panel: typeof CollapsePanel;
}
declare export class DatePicker extends React$Component<{}> {}
declare export class Dropdown extends React$Component<{}> {}
declare export class Drawer extends React$Component<{}> {}
declare type ValidationRule = {
enum?: string | string[],
len?: number,
max?: number,
message?: string,
min?: number,
pattern?: RegExp,
required?: boolean,
transform?: (value: mixed) => mixed,
type?: string,
validator?: (
rule: mixed,
value: mixed,
callback: mixed,
source?: mixed,
options?: mixed
) => mixed,
whitespace?: boolean
};
declare type ValidateCallback = (erros: mixed, values: mixed) => void;
declare type GetFieldDecoratorOptions = {
exclusive?: boolean,
getValueFromEvent?: (...args: mixed[]) => mixed,
initialValue?: mixed,
normalize?: (value: mixed, prevValue: mixed, allValues: mixed) => mixed,
rules?: ValidationRule[],
trigger?: string,
validateFirst?: boolean,
validateTrigger?: string | string[],
valuePropName?: string
};
declare type WrappedFormUtils = {
getFieldDecorator(
id: string,
options?: GetFieldDecoratorOptions
): (node: React$Node) => React$Node,
getFieldError(name: string): mixed[],
getFieldsError(names?: Array<string>): mixed,
getFieldsValue(fieldNames?: Array<string>): mixed,
getFieldValue(fieldName: string): mixed,
isFieldsTouched(names?: Array<string>): boolean,
isFieldTouched(name: string): boolean,
isFieldValidating(name: string): boolean,
resetFields(names?: Array<string>): void,
setFields(obj: Object): void,
setFieldsValue(obj: Object): void,
validateFields(callback: ValidateCallback): mixed,
validateFields(
fieldNames: Array<string>,
callback: ValidateCallback
): mixed,
validateFields(
fieldNames: Array<string>,
options: Object,
callback: ValidateCallback
): mixed,
validateFields(options: Object, callback: ValidateCallback): mixed,
validateFieldsAndScroll(
fieldNames?: Array<string>,
options?: Object,
callback?: ValidateCallback
): void,
validateFieldsAndScroll(callback?: ValidateCallback): void,
validateFieldsAndScroll(
fieldNames?: Array<string>,
callback?: ValidateCallback
): void,
validateFieldsAndScroll(options?: Object, callback?: ValidateCallback): void
};
declare export type FormProps = {
className?: string,
form?: WrappedFormUtils,
hideRequiredMark?: boolean,
horizontal?: boolean,
inline?: boolean,
layout?: "horizontal" | "inline" | "vertical",
onSubmit?: (e: SyntheticEvent<HTMLFormElement>) => void,
prefixCls?: string,
style?: $Shape<CSSStyleDeclaration>,
vertical?: boolean
};
declare export type FormCreateOption<T> = {
onFieldsChange?: (props: T, fields: Array<mixed>) => void,
onValuesChange?: (props: T, values: mixed) => void,
mapPropsToFields?: (props: T) => void,
withRef?: boolean
};
declare export class Form extends React$Component<FormProps> {
static Item: typeof FormItem;
static create: <TOwnProps>(options?: FormCreateOption<TOwnProps>) => mixed;
}
declare export type FormItemProps = {
help?: React$Node,
extra?: React$Node,
validateStatus?: "success" | "warning" | "error" | "validating" | ""
};
declare class FormItem extends React$Component<FormItemProps> {}
declare export type RangePickerProps = {};
declare export class DatePicker$RangePicker extends React$Component<
RangePickerProps
> {}
declare export class Icon extends React$Component<{}> {}
declare export class InputNumber extends React$Component<{}> {}
declare type InputProps = {
onBlur?: (event: SyntheticFocusEvent<HTMLInputElement>) => mixed,
onChange?: (event: SyntheticKeyboardEvent<HTMLInputElement>) => mixed
};
declare export class Input extends React$Component<InputProps> {
static Search: typeof InputSearch;
static TextArea: typeof InputTextArea;
}
declare class InputSearch extends React$Component<{}> {
input: { input: HTMLInputElement };
}
declare class InputTextArea extends React$Component<{}> {}
declare export class Layout extends React$Component<{}> {
static Content: typeof LayoutContent;
static Header: typeof LayoutHeader;
static Sider: typeof LayoutSider;
}
declare class LayoutContent extends React$Component<{}> {}
declare class LayoutHeader extends React$Component<{}> {}
declare class LayoutSider extends React$Component<{}> {}
declare export type ListItemProps = {};
declare export class ListItem extends React$Component<ListItemProps> {
static Meta: typeof Meta;
}
declare export class List extends React$Component<{}> {
static Item: typeof ListItem;
}
declare export class LocaleProvider extends React$Component<{}> {}
declare export type MenuProps = {
onClick?: ({
domEvent: SyntheticMouseEvent<HTMLElement>,
item: React$Component<MenuItem>,
key: string,
keyPath: string[]
}) => mixed
};
declare export class Menu extends React$Component<MenuProps> {
static Item: typeof MenuItem;
static SubMenu: typeof MenuSubMenu;
}
declare class MenuItem extends React$Component<{}> {}
declare class MenuSubMenu extends React$Component<{}> {}
declare export class message {
static config({
duration?: number,
getContainer?: () => HTMLElement,
top?: number
}): void;
static success: messageFn<mixed>;
static error: messageFn<mixed>;
static info: messageFn<mixed>;
static warning: messageFn<mixed>;
static warn: messageFn<mixed>;
static loading: messageFn<() => void>;
}
declare export class Modal extends React$Component<{}> {
static info: typeof modalFn;
static success: typeof modalFn;
static error: typeof modalFn;
static warning: typeof modalFn;
static confirm: typeof modalFn;
}
declare export type PaginationProps = {
current?: number,
defaultCurrent?: number,
defaultPageSize?: number,
hideOnSinglePage?: boolean,
itemRender?: (
page: number,
type: "page" | "prev" | "next",
originalElement: React$Node
) => React$Node,
pageSize?: number,
pageSizeOptions?: string[],
showQuickJumper?: boolean,
showSizeChanger?: boolean,
showTotal?: (total: number, range: number[]) => React$Node,
simple?: boolean,
size?: string,
total?: number,
onChange?: (page: number, pageSize: number) => void,
onShowSizeChange?: (current: number, size: number) => void
};
declare export class Pagination extends React$Component<PaginationProps> {}
// These props are shared by Tooltip, Popconfirm, and Poopover
declare type TooltipSharedProps = {
arrowPointAtCenter?: boolean,
autoAdjustOverflow?: boolean,
defaultVisible?: boolean,
getPopupContainer?: (element?: HTMLElement) => HTMLElement,
mouseEnterDelay?: number,
mouseLeaveDelay?: number,
overlayClassName?: string,
overlayStyle?: $Shape<CSSStyleDeclaration>,
placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom',
trigger?: 'hover' | 'focus' | 'click' | 'contextMenu',
visible?: boolean,
onVisibleChange?: (visible: boolean) => void,
align?: AlignConfig
}
// for alignConfig value, antd documentation points to rc-tooltip docs,
// which poits to https://github.com/yiminghe/dom-align
declare type AlignConfig = {|
points?: string,
offset?: number | string,
targetOffset?: number | string,
overflow?: {| adjustX?: boolean, adjustY?: boolean |},
useCssRight?: boolean,
useCssBottom?: boolean,
useCssTransform:? boolean
|}
declare export type PopconfirmProps = {
cancelText?: string,
okText?: string,
okType?: 'primary' | 'dashed' | 'ghost' | 'danger' | 'default',
title?: 'string' | React$Node,
onCancel?: (event: SyntheticEvent<>) => void,
onConfirm?: (event: SyntheticEvent<>) => void,
icon?: React$Node
} & TooltipSharedProps
declare export class Popconfirm extends React$Component<PopconfirmProps> {}
declare export type PopoverProps = {
content?: 'string' | React$Node,
title?: 'string' | React$Node,
} & TooltipSharedProps
declare export class Popover extends React$Component<PopoverProps> {}
declare export class Progress extends React$Component<{}> {}
declare export class Radio extends React$Component<{}> {
static Group: typeof RadioGroup;
static Button: typeof RadioButton;
}
declare class RadioGroup extends React$Component<{}> {}
declare class RadioButton extends React$Component<{}> {}
declare export class Row extends React$Component<{}> {}
declare export type SelectProps = {
expandTrigger?: "click" | "hover",
filterOption?: (input: string, option: React$Element<mixed>) => boolean,
onFocus?: () => mixed,
popupVisible?: boolean,
showSearch?: boolean
};
declare export class Select extends React$Component<SelectProps> {
static Option: typeof SelectOption;
}
declare class SelectOption extends React$Component<{}> {}
declare export class Slider extends React$Component<{}> {}
declare export type SpinProps = {
delay?: number,
size?: "small" | "default" | "large",
spinning?: boolean,
tip?: string
};
declare export class Spin extends React$Component<SpinProps> {}
declare export class Step extends React$Component<{
description?: React$Node,
icon?: React$Node,
status?: "wait" | "process" | "finish" | "error",
title?: React$Node
}> {}
declare export class Steps extends React$Component<{
current?: number,
direction?: "horizontal" | "vertical",
labelPlacement?: "horizontal" | "vertical",
progressDot?:
| boolean
| ((
iconDot: React$Node,
{
index: number,
status: "wait" | "process" | "finish" | "error",
title: React$Node,
description: React$Node
}
) => React$Node),
size?: "default" | "small",
status?: "wait" | "process" | "finish" | "error"
}> {
static Step: typeof Step;
}
declare export class Switch extends React$Component<{}> {}
declare export class Table extends React$Component<{}> {}
declare export class Tabs extends React$Component<{}> {
static TabPane: typeof TabsTabPane;
}
declare export class TabsTabPane extends React$Component<{}> {}
declare export class Tag extends React$Component<{}> {}
declare export type TooltipProps = {
title: React$Node | () => React$Node
} & TooltipSharedProps
declare export class Tooltip extends React$Component<TooltipProps> {}
declare export class TreeSelect extends React$Component<{}> {
static TreeNode: typeof TreeSelectTreeNode;
}
declare export class TreeSelectTreeNode extends React$Component<{}> {}
declare export class Upload extends React$Component<{}> {
static Dragger: typeof UploadDragger;
}
declare export class UploadDragger extends React$Component<{}> {}
}