@ioca/react 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/css/index.css +3 -0
- package/lib/css/index.css.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/types/index.d.ts +741 -0
- package/package.json +86 -82
|
@@ -0,0 +1,741 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, CSSProperties, ButtonHTMLAttributes, AnchorHTMLAttributes, ForwardRefExoticComponent, RefAttributes, ChangeEvent, InputHTMLAttributes, MouseEvent, TextareaHTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { LinkProps } from 'react-router-dom';
|
|
3
|
+
import { Dayjs } from 'dayjs';
|
|
4
|
+
import { ListProps } from 'rc-virtual-list';
|
|
5
|
+
|
|
6
|
+
interface IAffix extends HTMLAttributes<HTMLElement> {
|
|
7
|
+
position?: "fixed" | "absolute" | "sticky" | "static";
|
|
8
|
+
left?: string | number;
|
|
9
|
+
top?: string | number;
|
|
10
|
+
right?: string | number;
|
|
11
|
+
bottom?: string | number;
|
|
12
|
+
offset?: number;
|
|
13
|
+
getContainer?: () => HTMLElement | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface IBadge {
|
|
17
|
+
content?: ReactNode;
|
|
18
|
+
contentClass?: string;
|
|
19
|
+
dot?: boolean;
|
|
20
|
+
dotSize?: string | number;
|
|
21
|
+
round?: boolean;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
className?: string;
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface BaseButtonProps {
|
|
29
|
+
as?: "a" | "button" | ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>;
|
|
30
|
+
children?: ReactNode | string;
|
|
31
|
+
className?: string;
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
flat?: boolean;
|
|
34
|
+
outline?: boolean;
|
|
35
|
+
square?: boolean;
|
|
36
|
+
size?: "small" | "normal" | "large" | "extreme";
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
block?: boolean;
|
|
39
|
+
round?: boolean;
|
|
40
|
+
ripple?: boolean;
|
|
41
|
+
secondary?: boolean;
|
|
42
|
+
}
|
|
43
|
+
interface IButton extends BaseButtonProps, Omit<ButtonHTMLAttributes<HTMLElement>, "type">, AnchorHTMLAttributes<HTMLElement> {
|
|
44
|
+
}
|
|
45
|
+
interface IButtonToggle extends IButton {
|
|
46
|
+
active?: boolean;
|
|
47
|
+
activeClass?: string;
|
|
48
|
+
after?: ReactNode;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
onToggle?: (active: boolean) => void;
|
|
51
|
+
}
|
|
52
|
+
interface IButtonGroup {
|
|
53
|
+
children?: ReactNode;
|
|
54
|
+
vertical?: boolean;
|
|
55
|
+
className?: string;
|
|
56
|
+
style?: CSSProperties;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ICard {
|
|
60
|
+
shadow?: boolean;
|
|
61
|
+
border?: boolean;
|
|
62
|
+
style?: CSSProperties;
|
|
63
|
+
className?: string;
|
|
64
|
+
children?: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
type TStatus = "normal" | "success" | "warning" | "error";
|
|
68
|
+
type TOption = {
|
|
69
|
+
label: ReactNode;
|
|
70
|
+
value: any;
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
};
|
|
73
|
+
type TOptions = (TOption | string | number)[];
|
|
74
|
+
type TValidate = {
|
|
75
|
+
status?: TStatus;
|
|
76
|
+
message?: ReactNode;
|
|
77
|
+
};
|
|
78
|
+
interface BaseInput extends TValidate {
|
|
79
|
+
label?: ReactNode;
|
|
80
|
+
value?: any;
|
|
81
|
+
initValue?: any;
|
|
82
|
+
labelInline?: boolean;
|
|
83
|
+
clear?: boolean;
|
|
84
|
+
border?: boolean;
|
|
85
|
+
tip?: ReactNode;
|
|
86
|
+
onChange?: (value: any, e?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
87
|
+
onEnter?: () => void;
|
|
88
|
+
}
|
|
89
|
+
type TPosition = "top" | "right" | "left" | "bottom";
|
|
90
|
+
|
|
91
|
+
interface ICheckbox extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange">, TValidate {
|
|
92
|
+
label?: ReactNode;
|
|
93
|
+
options: TOption[] | (string | number)[];
|
|
94
|
+
type?: "default" | "switch" | "button";
|
|
95
|
+
optionInline?: boolean;
|
|
96
|
+
labelInline?: boolean;
|
|
97
|
+
onChange?: (value: any[], option: TOption, e: ChangeEvent<HTMLInputElement>) => void;
|
|
98
|
+
}
|
|
99
|
+
interface ICheckboxItem extends Omit<InputHTMLAttributes<HTMLElement>, "value" | "onChange">, TValidate {
|
|
100
|
+
type?: "default" | "switch" | "button";
|
|
101
|
+
label?: ReactNode;
|
|
102
|
+
value?: boolean;
|
|
103
|
+
partof?: boolean;
|
|
104
|
+
onChange?: (value: boolean, e: ChangeEvent<HTMLInputElement>) => void;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
type TKey = string | number;
|
|
108
|
+
interface ICollapse extends HTMLAttributes<HTMLDivElement> {
|
|
109
|
+
active?: TKey | TKey[];
|
|
110
|
+
items?: ICollapseItem[];
|
|
111
|
+
multiple?: boolean;
|
|
112
|
+
border?: boolean;
|
|
113
|
+
headerClickable?: boolean;
|
|
114
|
+
renderToggle?: (active: boolean) => ReactNode;
|
|
115
|
+
onCollapse?: (key: TKey, active: boolean) => void;
|
|
116
|
+
}
|
|
117
|
+
interface ICollapseItem {
|
|
118
|
+
key?: TKey;
|
|
119
|
+
title?: ReactNode;
|
|
120
|
+
content?: ReactNode;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
children?: ReactNode;
|
|
123
|
+
className?: string;
|
|
124
|
+
style?: CSSProperties;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
type IData$1 = Record<string, any>;
|
|
128
|
+
interface IColumn {
|
|
129
|
+
id: string;
|
|
130
|
+
title?: ReactNode;
|
|
131
|
+
sorter?: boolean;
|
|
132
|
+
justify?: string;
|
|
133
|
+
rowSpan?: number;
|
|
134
|
+
colSpan?: number;
|
|
135
|
+
width?: string;
|
|
136
|
+
fixed?: "left" | "right";
|
|
137
|
+
render?: (value?: any, data?: IData$1, index?: number) => ReactNode;
|
|
138
|
+
renderHeader?: (column?: IColumn, index?: number) => ReactNode;
|
|
139
|
+
}
|
|
140
|
+
interface IDatagrid {
|
|
141
|
+
data: IData$1[];
|
|
142
|
+
columns?: IColumn[];
|
|
143
|
+
border?: boolean;
|
|
144
|
+
striped?: boolean;
|
|
145
|
+
header?: boolean;
|
|
146
|
+
resizable?: boolean;
|
|
147
|
+
loading?: boolean;
|
|
148
|
+
empty?: ReactNode;
|
|
149
|
+
cellPadding?: string | number;
|
|
150
|
+
height?: number | string;
|
|
151
|
+
style?: CSSProperties;
|
|
152
|
+
className?: string;
|
|
153
|
+
renderLoading?: () => ReactNode;
|
|
154
|
+
onRowClick?: (data?: IData$1, row?: number) => void;
|
|
155
|
+
onCellClick?: (data?: IData$1, column?: IColumn, row?: number, col?: number, e?: MouseEvent) => void;
|
|
156
|
+
onCellDoubleClick?: (data?: IData$1, column?: IColumn, row?: number, col?: number, e?: MouseEvent) => void;
|
|
157
|
+
onHeaderClick?: (column?: IColumn, e?: MouseEvent) => void;
|
|
158
|
+
onSort?: (sortBy: string, sortType: string) => void;
|
|
159
|
+
onScroll?: (e: MouseEvent) => void;
|
|
160
|
+
onResize?: (column?: IColumn, width?: number) => void;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
interface IInput extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> {
|
|
164
|
+
prepend?: ReactNode;
|
|
165
|
+
append?: ReactNode;
|
|
166
|
+
hideVisible?: boolean;
|
|
167
|
+
}
|
|
168
|
+
interface ITextarea extends BaseInput, Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue" | "onChange"> {
|
|
169
|
+
autoSize?: boolean;
|
|
170
|
+
}
|
|
171
|
+
interface IInputNumber extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "defaultValue"> {
|
|
172
|
+
value?: string | number;
|
|
173
|
+
prepend?: ReactNode;
|
|
174
|
+
append?: ReactNode;
|
|
175
|
+
step?: number;
|
|
176
|
+
min?: number;
|
|
177
|
+
max?: number;
|
|
178
|
+
thousand?: string;
|
|
179
|
+
precision?: number;
|
|
180
|
+
hideControl?: boolean;
|
|
181
|
+
}
|
|
182
|
+
interface IInputRange extends Omit<BaseInput, "value" | "onChange">, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "placeholder" | "onChange"> {
|
|
183
|
+
value?: (number | string | undefined)[];
|
|
184
|
+
placeholder?: string[];
|
|
185
|
+
min?: number;
|
|
186
|
+
max?: number;
|
|
187
|
+
prepend?: ReactNode;
|
|
188
|
+
append?: ReactNode;
|
|
189
|
+
step?: number;
|
|
190
|
+
thousand?: string;
|
|
191
|
+
precision?: number;
|
|
192
|
+
hideControl?: boolean;
|
|
193
|
+
onChange?: (value: (number | string | undefined)[], e?: ChangeEvent<HTMLInputElement> | MouseEvent<Element>) => void;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface IPopup {
|
|
197
|
+
visible?: boolean;
|
|
198
|
+
content?: ReactNode;
|
|
199
|
+
trigger?: "hover" | "click" | "focus" | "none" | "contextmenu";
|
|
200
|
+
gap?: number;
|
|
201
|
+
offset?: number;
|
|
202
|
+
fixed?: boolean;
|
|
203
|
+
position?: TPosition;
|
|
204
|
+
arrow?: boolean;
|
|
205
|
+
align?: "start" | "center" | "end";
|
|
206
|
+
showDelay?: number;
|
|
207
|
+
hideDelay?: number;
|
|
208
|
+
touchable?: boolean;
|
|
209
|
+
fitSize?: boolean;
|
|
210
|
+
watchResize?: boolean;
|
|
211
|
+
clickOutside?: boolean;
|
|
212
|
+
disabled?: boolean;
|
|
213
|
+
referToWindow?: boolean;
|
|
214
|
+
style?: CSSProperties;
|
|
215
|
+
children?: ReactNode;
|
|
216
|
+
className?: string;
|
|
217
|
+
getContainer?: (trigger?: HTMLElement) => HTMLElement;
|
|
218
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
interface IDatePicker extends BaseInput, IInput, Omit<IBaseDates, "value"> {
|
|
222
|
+
popupProps?: IPopup;
|
|
223
|
+
}
|
|
224
|
+
interface IBaseDates {
|
|
225
|
+
value?: any;
|
|
226
|
+
format?: string;
|
|
227
|
+
weeks?: ReactNode[];
|
|
228
|
+
unitYear?: ReactNode;
|
|
229
|
+
unitMonth?: ReactNode;
|
|
230
|
+
renderDate?: (date: Dayjs) => ReactNode;
|
|
231
|
+
renderMonth?: (month: number) => ReactNode;
|
|
232
|
+
renderYear?: (year: number) => ReactNode;
|
|
233
|
+
onDateClick?: (date: Dayjs) => void;
|
|
234
|
+
disabledDate?: (date: Dayjs) => boolean;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
type IData = {
|
|
238
|
+
label: ReactNode;
|
|
239
|
+
value: ReactNode;
|
|
240
|
+
colSpan?: number;
|
|
241
|
+
rowSpan?: number;
|
|
242
|
+
hidden?: boolean;
|
|
243
|
+
style?: CSSProperties;
|
|
244
|
+
};
|
|
245
|
+
interface IDescription {
|
|
246
|
+
data: IData[];
|
|
247
|
+
align?: string;
|
|
248
|
+
colon?: ReactNode;
|
|
249
|
+
gap?: string | number;
|
|
250
|
+
equally?: boolean;
|
|
251
|
+
columns?: number;
|
|
252
|
+
vertical?: boolean;
|
|
253
|
+
labelWidth?: string | number;
|
|
254
|
+
labelAlign?: "left" | "right" | "center" | "justify";
|
|
255
|
+
style?: CSSProperties;
|
|
256
|
+
className?: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
interface IDrawer extends HTMLAttributes<HTMLDivElement> {
|
|
260
|
+
visible?: boolean;
|
|
261
|
+
position?: "top" | "left" | "right" | "bottom";
|
|
262
|
+
header?: ReactNode;
|
|
263
|
+
footer?: ReactNode;
|
|
264
|
+
hideCloseButton?: boolean;
|
|
265
|
+
backdropClosable?: boolean;
|
|
266
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
267
|
+
onClose?: () => void;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
interface IList extends HTMLAttributes<HTMLUListElement> {
|
|
271
|
+
label?: ReactNode | ((i: number) => ReactNode);
|
|
272
|
+
type?: "option" | "default";
|
|
273
|
+
}
|
|
274
|
+
interface IListItem extends HTMLAttributes<HTMLLIElement>, Pick<IList, "type"> {
|
|
275
|
+
active?: boolean;
|
|
276
|
+
align?: string;
|
|
277
|
+
disabled?: boolean;
|
|
278
|
+
label?: ReactNode;
|
|
279
|
+
}
|
|
280
|
+
interface IVirtual extends Omit<ListProps<any>, "children"> {
|
|
281
|
+
renderItem: (item: any, i: number) => ReactNode;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
interface IDropdown extends IPopup {
|
|
285
|
+
width?: string | number;
|
|
286
|
+
}
|
|
287
|
+
interface IDropItem extends IListItem {
|
|
288
|
+
more?: ReactNode;
|
|
289
|
+
moreProps?: IDropdown;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
interface IFlex {
|
|
293
|
+
as?: keyof JSX.IntrinsicElements;
|
|
294
|
+
align?: string;
|
|
295
|
+
justify?: string;
|
|
296
|
+
gap?: string | number;
|
|
297
|
+
direction?: any;
|
|
298
|
+
wrap?: any;
|
|
299
|
+
columns?: string | number;
|
|
300
|
+
style?: CSSProperties;
|
|
301
|
+
className?: string;
|
|
302
|
+
children?: ReactNode;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
declare class IFormInstance {
|
|
306
|
+
readonly id?: string;
|
|
307
|
+
data: {
|
|
308
|
+
[key: string]: any;
|
|
309
|
+
};
|
|
310
|
+
rules?: Pick<IForm, "rules">;
|
|
311
|
+
constructor();
|
|
312
|
+
get(field?: string): any;
|
|
313
|
+
set(field: any, value?: any): void;
|
|
314
|
+
clear(): void;
|
|
315
|
+
validate(field?: string): Promise<boolean | {
|
|
316
|
+
[key: string]: any;
|
|
317
|
+
}>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
type TValidator = (value: any, form: IFormInstance) => boolean;
|
|
321
|
+
type TRule = {
|
|
322
|
+
validator: TValidator;
|
|
323
|
+
message?: string;
|
|
324
|
+
};
|
|
325
|
+
interface IForm extends HTMLAttributes<HTMLFormElement> {
|
|
326
|
+
form?: IFormInstance;
|
|
327
|
+
rules?: {
|
|
328
|
+
[key: string]: boolean | TValidator | TRule;
|
|
329
|
+
};
|
|
330
|
+
initialValues?: Record<string, any>;
|
|
331
|
+
width?: string | number;
|
|
332
|
+
}
|
|
333
|
+
interface IField {
|
|
334
|
+
name?: string;
|
|
335
|
+
children?: ReactNode;
|
|
336
|
+
required?: boolean;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
interface IIcon extends HTMLAttributes<HTMLElement> {
|
|
340
|
+
icon: ReactNode;
|
|
341
|
+
size?: string;
|
|
342
|
+
rotate?: number;
|
|
343
|
+
style?: CSSProperties;
|
|
344
|
+
className?: string;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
interface IImage extends HTMLAttributes<HTMLImageElement> {
|
|
348
|
+
src?: string;
|
|
349
|
+
alt?: string;
|
|
350
|
+
round?: boolean;
|
|
351
|
+
size?: string | number;
|
|
352
|
+
initSize?: string | number;
|
|
353
|
+
lazyload?: boolean;
|
|
354
|
+
fallback?: ReactNode;
|
|
355
|
+
fit?: any;
|
|
356
|
+
usePreview?: boolean;
|
|
357
|
+
}
|
|
358
|
+
interface IImageList extends Omit<IImage, "src" | "alt"> {
|
|
359
|
+
items: string[] | IImage[];
|
|
360
|
+
gap?: number | string;
|
|
361
|
+
columns?: number | string;
|
|
362
|
+
wrap?: any;
|
|
363
|
+
direction?: any;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
interface ILoading extends HTMLAttributes<HTMLDivElement> {
|
|
367
|
+
icon?: ReactNode;
|
|
368
|
+
text?: ReactNode;
|
|
369
|
+
size?: number | string;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
interface IMessage {
|
|
373
|
+
id?: string;
|
|
374
|
+
content?: ReactNode;
|
|
375
|
+
active?: boolean;
|
|
376
|
+
duration?: number;
|
|
377
|
+
gap?: number;
|
|
378
|
+
offset?: string;
|
|
379
|
+
max?: number;
|
|
380
|
+
align?: "center" | "left" | "right";
|
|
381
|
+
unshift?: boolean;
|
|
382
|
+
closable?: boolean;
|
|
383
|
+
timer?: ReturnType<typeof setTimeout>;
|
|
384
|
+
className?: string;
|
|
385
|
+
onShow?: () => void;
|
|
386
|
+
onHide?: () => void;
|
|
387
|
+
}
|
|
388
|
+
interface IMessageItem {
|
|
389
|
+
active?: boolean;
|
|
390
|
+
content?: ReactNode;
|
|
391
|
+
top?: number;
|
|
392
|
+
className?: string;
|
|
393
|
+
style?: CSSProperties;
|
|
394
|
+
onClick?: (e: MouseEvent<Element>) => void;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
interface IModal extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
398
|
+
visible?: boolean;
|
|
399
|
+
title?: ReactNode;
|
|
400
|
+
footer?: ReactNode;
|
|
401
|
+
closable?: boolean;
|
|
402
|
+
hideCloseButton?: boolean;
|
|
403
|
+
hideBackdrop?: boolean;
|
|
404
|
+
backdropClosable?: boolean;
|
|
405
|
+
width?: string | number;
|
|
406
|
+
height?: string | number;
|
|
407
|
+
customized?: boolean;
|
|
408
|
+
fixed?: boolean;
|
|
409
|
+
shadow?: boolean;
|
|
410
|
+
okButtonProps?: IButton;
|
|
411
|
+
cancelButtonProps?: IButton;
|
|
412
|
+
footerLeft?: ReactNode;
|
|
413
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
414
|
+
onOk?: () => void;
|
|
415
|
+
onClose?: () => void;
|
|
416
|
+
}
|
|
417
|
+
interface RefHookModal {
|
|
418
|
+
update: (props: IModal) => void;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
interface IPagination extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
422
|
+
page?: number;
|
|
423
|
+
total?: number;
|
|
424
|
+
sibling?: number;
|
|
425
|
+
size?: number;
|
|
426
|
+
sizeOptions?: number[];
|
|
427
|
+
prev?: ReactNode;
|
|
428
|
+
next?: ReactNode;
|
|
429
|
+
simple?: boolean;
|
|
430
|
+
jumper?: boolean;
|
|
431
|
+
renderPage?: (i: number) => ReactNode;
|
|
432
|
+
renderEllipsis?: () => ReactNode;
|
|
433
|
+
onChange?: (page: number) => Promise<void> | void;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
interface IPopconfirm extends IPopup {
|
|
437
|
+
icon?: ReactNode;
|
|
438
|
+
okButtonProps?: IButton;
|
|
439
|
+
cancelButtonProps?: IButton;
|
|
440
|
+
extra?: ReactNode;
|
|
441
|
+
onOk?: () => Promise<void> | void;
|
|
442
|
+
onClose?: () => Promise<void> | void;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
interface IProgress extends Omit<BaseInput, "value" | "hideClear" | "onChange"> {
|
|
446
|
+
name?: string;
|
|
447
|
+
value?: number;
|
|
448
|
+
precision?: number;
|
|
449
|
+
height?: number;
|
|
450
|
+
size?: number;
|
|
451
|
+
barClass?: string;
|
|
452
|
+
draggable?: boolean;
|
|
453
|
+
type?: "line" | "circle";
|
|
454
|
+
className?: string;
|
|
455
|
+
style?: CSSProperties;
|
|
456
|
+
renderCursor?: (value: number) => ReactNode;
|
|
457
|
+
onChange?: (value: number) => void;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
interface IRadioItem extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
|
|
461
|
+
type?: "default" | "button";
|
|
462
|
+
onChange?: (value: any, e: ChangeEvent) => void;
|
|
463
|
+
}
|
|
464
|
+
interface IRadio extends IRadioItem {
|
|
465
|
+
label?: ReactNode;
|
|
466
|
+
options: TOption[] | (number | string)[];
|
|
467
|
+
optionInline?: boolean;
|
|
468
|
+
labelInline?: boolean;
|
|
469
|
+
status?: TStatus;
|
|
470
|
+
message?: string;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
interface ISelect extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onSelect" | "onChange">, BaseInput {
|
|
474
|
+
options: TOptions;
|
|
475
|
+
multiple?: boolean;
|
|
476
|
+
prepend?: ReactNode;
|
|
477
|
+
append?: ReactNode;
|
|
478
|
+
hideClear?: boolean;
|
|
479
|
+
max?: number;
|
|
480
|
+
maxDisplay?: number;
|
|
481
|
+
filter?: boolean | (() => boolean);
|
|
482
|
+
filterPlaceholder?: string;
|
|
483
|
+
empty?: ReactNode;
|
|
484
|
+
popupProps?: IPopup;
|
|
485
|
+
onSelect?: (v: any, option?: TOption) => void;
|
|
486
|
+
onChange?: (v: any) => void;
|
|
487
|
+
}
|
|
488
|
+
interface ISelectOptions extends Pick<ISelect, "multiple" | "empty" | "filter" | "filterPlaceholder" | "onSelect"> {
|
|
489
|
+
value: any;
|
|
490
|
+
options: TOption[];
|
|
491
|
+
onFilter?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
interface IStep {
|
|
495
|
+
active?: number;
|
|
496
|
+
vertical?: boolean;
|
|
497
|
+
style?: CSSProperties;
|
|
498
|
+
className?: string;
|
|
499
|
+
line?: ReactNode;
|
|
500
|
+
children?: ReactNode;
|
|
501
|
+
renderIcon?: (i: number, status: string) => ReactNode;
|
|
502
|
+
onClick?: (i: number) => void;
|
|
503
|
+
}
|
|
504
|
+
interface IStepItem extends IStep {
|
|
505
|
+
index?: number;
|
|
506
|
+
title?: ReactNode;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
interface ISwiper {
|
|
510
|
+
initial?: number;
|
|
511
|
+
type?: "normal" | "fade" | "flow";
|
|
512
|
+
display?: number;
|
|
513
|
+
scroll?: number;
|
|
514
|
+
loop?: boolean;
|
|
515
|
+
gap?: number;
|
|
516
|
+
duration?: number;
|
|
517
|
+
interval?: number;
|
|
518
|
+
draggable?: boolean;
|
|
519
|
+
dragOffset?: number;
|
|
520
|
+
reverse?: boolean;
|
|
521
|
+
autoplay?: boolean;
|
|
522
|
+
pauseOnHover?: boolean;
|
|
523
|
+
indicator?: boolean;
|
|
524
|
+
itemHeight?: number;
|
|
525
|
+
vertical?: boolean;
|
|
526
|
+
prev?: ReactNode;
|
|
527
|
+
next?: ReactNode;
|
|
528
|
+
arrow?: boolean;
|
|
529
|
+
style?: CSSProperties;
|
|
530
|
+
className?: string;
|
|
531
|
+
children?: ReactNode;
|
|
532
|
+
renderIndicator?: (i: number) => ReactNode;
|
|
533
|
+
onBeforeSwipe?: (before: number) => void;
|
|
534
|
+
onAfterSwipe?: (after: number) => void;
|
|
535
|
+
}
|
|
536
|
+
interface ISwiperItem extends Pick<ISwiper, "gap" | "itemHeight" | "vertical" | "type"> {
|
|
537
|
+
active?: boolean;
|
|
538
|
+
index?: number;
|
|
539
|
+
transition?: string;
|
|
540
|
+
style?: CSSProperties;
|
|
541
|
+
className?: string;
|
|
542
|
+
children?: ReactNode;
|
|
543
|
+
}
|
|
544
|
+
interface RefSwiper {
|
|
545
|
+
swipeTo: (i: number) => void;
|
|
546
|
+
swipeNext: () => void;
|
|
547
|
+
swipePrev: () => void;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
type TTabKey = string | number;
|
|
551
|
+
interface ITabItem {
|
|
552
|
+
key?: TTabKey;
|
|
553
|
+
props?: any;
|
|
554
|
+
title?: ReactNode;
|
|
555
|
+
content?: ReactNode;
|
|
556
|
+
closable?: boolean;
|
|
557
|
+
keepDOM?: boolean;
|
|
558
|
+
intersecting?: boolean;
|
|
559
|
+
children?: ReactNode;
|
|
560
|
+
}
|
|
561
|
+
interface ITabs {
|
|
562
|
+
active?: TTabKey;
|
|
563
|
+
tabs?: ITabItem[] | TTabKey[];
|
|
564
|
+
type?: "default" | "line" | "pane";
|
|
565
|
+
prepend?: ReactNode;
|
|
566
|
+
append?: ReactNode;
|
|
567
|
+
vertical?: boolean;
|
|
568
|
+
hideMore?: boolean;
|
|
569
|
+
bar?: boolean;
|
|
570
|
+
barClass?: string;
|
|
571
|
+
toggable?: boolean;
|
|
572
|
+
className?: string;
|
|
573
|
+
children?: ReactNode;
|
|
574
|
+
style?: CSSProperties;
|
|
575
|
+
renderMore?: (moreTabs: ITabItem[]) => ReactNode;
|
|
576
|
+
onTabChange?: (to?: TTabKey, from?: TTabKey) => void;
|
|
577
|
+
}
|
|
578
|
+
interface RefTabs {
|
|
579
|
+
open: (key: TTabKey) => void;
|
|
580
|
+
close: (key: TTabKey) => void;
|
|
581
|
+
add: (tab: ITabItem, position?: number) => void;
|
|
582
|
+
navs: Ref<HTMLDivElement>;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
interface ITag extends HTMLAttributes<HTMLSpanElement> {
|
|
586
|
+
dot?: boolean;
|
|
587
|
+
dotClass?: string;
|
|
588
|
+
outline?: boolean;
|
|
589
|
+
round?: boolean;
|
|
590
|
+
size?: "small" | "normal" | "large" | "extreme";
|
|
591
|
+
onClick?: (e: MouseEvent) => void;
|
|
592
|
+
onClose?: (e: MouseEvent) => void;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
interface IText {
|
|
596
|
+
as?: keyof JSX.IntrinsicElements;
|
|
597
|
+
size?: string | number;
|
|
598
|
+
decoration?: string;
|
|
599
|
+
weight?: string | number;
|
|
600
|
+
gradient?: string[];
|
|
601
|
+
style?: CSSProperties;
|
|
602
|
+
className?: string;
|
|
603
|
+
children?: ReactNode;
|
|
604
|
+
}
|
|
605
|
+
interface ITextNumber extends IText {
|
|
606
|
+
count?: number;
|
|
607
|
+
to?: number;
|
|
608
|
+
decimal?: number;
|
|
609
|
+
thousand?: string;
|
|
610
|
+
duration?: number;
|
|
611
|
+
easing?: (x: number) => number;
|
|
612
|
+
}
|
|
613
|
+
interface ITextTime extends IText {
|
|
614
|
+
seconds?: number;
|
|
615
|
+
zero?: boolean;
|
|
616
|
+
units?: string[];
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
interface ITreeItem {
|
|
620
|
+
as?: "a" | "button" | ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>;
|
|
621
|
+
key?: string;
|
|
622
|
+
type?: "item" | "title" | string;
|
|
623
|
+
title: string | ReactNode;
|
|
624
|
+
icon?: ReactNode;
|
|
625
|
+
href?: string;
|
|
626
|
+
children?: ITreeItem[];
|
|
627
|
+
expanded?: boolean;
|
|
628
|
+
disabled?: boolean;
|
|
629
|
+
checked?: boolean;
|
|
630
|
+
parent?: ITreeItem;
|
|
631
|
+
[key: string]: any;
|
|
632
|
+
}
|
|
633
|
+
interface ITree {
|
|
634
|
+
data: ITreeItem[];
|
|
635
|
+
parent?: ITreeItem;
|
|
636
|
+
depth?: number;
|
|
637
|
+
nodeProps?: {
|
|
638
|
+
key?: string;
|
|
639
|
+
title?: string;
|
|
640
|
+
children?: string;
|
|
641
|
+
};
|
|
642
|
+
selectable?: boolean;
|
|
643
|
+
selected?: string;
|
|
644
|
+
checkable?: boolean;
|
|
645
|
+
checked?: string[];
|
|
646
|
+
disabledRelated?: boolean;
|
|
647
|
+
partofs?: Record<string, boolean>;
|
|
648
|
+
round?: boolean;
|
|
649
|
+
style?: CSSProperties;
|
|
650
|
+
className?: string;
|
|
651
|
+
renderExtra?: (item: ITreeItem) => ReactNode;
|
|
652
|
+
onItemClick?: (item: ITreeItem, e: MouseEvent<HTMLElement>) => void;
|
|
653
|
+
onItemSelect?: (key: string, item: ITreeItem) => void;
|
|
654
|
+
onItemCheck?: (item: ITreeItem, checked: boolean, checkedKeys: string[]) => void;
|
|
655
|
+
}
|
|
656
|
+
interface RefTree {
|
|
657
|
+
getChecked: () => [string[], ITreeItem[]];
|
|
658
|
+
getSelected: () => [string?, ITreeItem?];
|
|
659
|
+
getPartofs: () => [string[], ITreeItem[]];
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
interface IUpload extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> {
|
|
663
|
+
files?: IFile[];
|
|
664
|
+
accept?: string;
|
|
665
|
+
multiple?: boolean;
|
|
666
|
+
directory?: boolean;
|
|
667
|
+
limit?: number;
|
|
668
|
+
mode?: "default" | "card";
|
|
669
|
+
droppable?: boolean;
|
|
670
|
+
cardSize?: string;
|
|
671
|
+
shouldUpload?: (file: IFile) => boolean;
|
|
672
|
+
uploader?: (file: IFile) => Promise<IFile>;
|
|
673
|
+
renderItem?: (file: IFile, i: number) => ReactNode;
|
|
674
|
+
onFilesChange?: (files: IFile[], changed: IFile[], e?: ChangeEvent<HTMLInputElement>) => void;
|
|
675
|
+
onRemove?: (file: IFile) => void;
|
|
676
|
+
onUpload?: (file: IFile) => void;
|
|
677
|
+
}
|
|
678
|
+
interface IFile extends File {
|
|
679
|
+
uid?: string;
|
|
680
|
+
instance?: File;
|
|
681
|
+
src?: string;
|
|
682
|
+
[key: string]: any;
|
|
683
|
+
}
|
|
684
|
+
interface IUploadItem extends Pick<IUpload, "mode"> {
|
|
685
|
+
file?: IFile;
|
|
686
|
+
index: number;
|
|
687
|
+
status?: string;
|
|
688
|
+
onRemove: (i: number) => void;
|
|
689
|
+
onPreview?: (i: number) => void;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
interface IVideo extends HTMLAttributes<HTMLVideoElement> {
|
|
693
|
+
src?: string;
|
|
694
|
+
hideControls?: boolean;
|
|
695
|
+
autoplay?: boolean;
|
|
696
|
+
muted?: boolean;
|
|
697
|
+
volume?: number;
|
|
698
|
+
height?: number | string;
|
|
699
|
+
width?: number | string;
|
|
700
|
+
useOriginControls?: boolean;
|
|
701
|
+
timeProgressProps?: IProgress;
|
|
702
|
+
volumeProgressProps?: IProgress;
|
|
703
|
+
onFullScreenChange?: (fullscreen: boolean) => void;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
type TPreviewItem = {
|
|
707
|
+
src: string;
|
|
708
|
+
name?: ReactNode;
|
|
709
|
+
thumb?: string;
|
|
710
|
+
rotate?: number;
|
|
711
|
+
zoom?: number;
|
|
712
|
+
style?: CSSProperties;
|
|
713
|
+
type?: TFileType;
|
|
714
|
+
suffix?: string;
|
|
715
|
+
};
|
|
716
|
+
declare enum TFileType {
|
|
717
|
+
IMAGE = "IMAGE",
|
|
718
|
+
VIDEO = "VIDEO",
|
|
719
|
+
AUDIO = "AUDIO",
|
|
720
|
+
PDF = "PDF",
|
|
721
|
+
EXCEL = "EXCEL",
|
|
722
|
+
TXT = "TXT",
|
|
723
|
+
UNKNOWN = "UNKNOWN"
|
|
724
|
+
}
|
|
725
|
+
interface IPreview {
|
|
726
|
+
items: (TPreviewItem | string)[];
|
|
727
|
+
initial?: number;
|
|
728
|
+
controls?: boolean;
|
|
729
|
+
loop?: boolean;
|
|
730
|
+
className?: string;
|
|
731
|
+
style?: CSSProperties;
|
|
732
|
+
modalProps?: IModal;
|
|
733
|
+
renderImage?: (file: TPreviewItem) => ReactNode;
|
|
734
|
+
renderFile?: (file: TPreviewItem) => ReactNode;
|
|
735
|
+
onClose?: () => void;
|
|
736
|
+
onChange?: (after: number, before?: number) => void;
|
|
737
|
+
onZoom?: (scale: number) => void;
|
|
738
|
+
onRotate?: (deg: number) => void;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export type { IAffix, IBadge, IButton, IButtonGroup, IButtonToggle, ICard, ICheckbox, ICheckboxItem, ICollapse, ICollapseItem, IDatagrid, IDatePicker, IDescription, IDrawer, IDropItem, IDropdown, IField, IFlex, IForm, IIcon, IImage, IImageList, IInput, IInputNumber, IInputRange, IList, IListItem, ILoading, IMessage, IMessageItem, IModal, IPagination, IPopconfirm, IPopup, IPreview, IProgress, IRadio, IRadioItem, ISelect, ISelectOptions, IStep, IStepItem, ISwiper, ISwiperItem, ITabItem, ITabs, ITag, IText, ITextNumber, ITextTime, ITextarea, ITree, ITreeItem, IUpload, IUploadItem, IVideo, IVirtual, RefHookModal, RefSwiper, RefTabs, RefTree, TPreviewItem };
|