@xinghunm/compass-ui 0.5.0 → 0.7.0
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/dist/index.d.mts +673 -147
- package/dist/index.d.ts +673 -147
- package/dist/index.js +1020 -815
- package/dist/index.mjs +1022 -817
- package/package.json +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
3
|
-
import { Placement } from '@floating-ui/react';
|
|
4
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { Placement } from '@floating-ui/react';
|
|
5
5
|
import { RuleItem } from 'async-validator';
|
|
6
|
+
export { RuleItem } from 'async-validator';
|
|
6
7
|
|
|
7
8
|
interface ButtonBaseProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
9
|
/** Whether to enable ripple effect */
|
|
9
10
|
hasRipple?: boolean;
|
|
10
|
-
|
|
11
|
-
rippleBgColor?: string;
|
|
12
|
-
/** Ripple opacity */
|
|
13
|
-
rippleOpacity?: number;
|
|
11
|
+
children?: React.ReactNode;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
interface ButtonProps extends ButtonBaseProps {
|
|
17
15
|
/** Button type */
|
|
18
16
|
variant?: 'primary' | 'default' | 'dashed' | 'text' | 'link';
|
|
19
17
|
/** Button size */
|
|
20
|
-
size?: 'small' | '
|
|
18
|
+
size?: 'small' | 'medium' | 'large';
|
|
21
19
|
/** Button shape */
|
|
22
20
|
shape?: 'default' | 'circle' | 'round';
|
|
23
21
|
/** Whether the button is disabled */
|
|
@@ -30,6 +28,20 @@ interface ButtonProps extends ButtonBaseProps {
|
|
|
30
28
|
block?: boolean;
|
|
31
29
|
/** Button icon */
|
|
32
30
|
icon?: React.ReactNode;
|
|
31
|
+
/** Custom class names for internal elements */
|
|
32
|
+
classNames?: {
|
|
33
|
+
root?: string;
|
|
34
|
+
icon?: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
loading?: string;
|
|
37
|
+
};
|
|
38
|
+
/** Custom styles for internal elements */
|
|
39
|
+
styles?: {
|
|
40
|
+
root?: React.CSSProperties;
|
|
41
|
+
icon?: React.CSSProperties;
|
|
42
|
+
text?: React.CSSProperties;
|
|
43
|
+
loading?: React.CSSProperties;
|
|
44
|
+
};
|
|
33
45
|
}
|
|
34
46
|
|
|
35
47
|
declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
@@ -48,9 +60,7 @@ interface StepProps {
|
|
|
48
60
|
status?: StepStatus;
|
|
49
61
|
/** Disabled state */
|
|
50
62
|
disabled?: boolean;
|
|
51
|
-
/** Custom className */
|
|
52
63
|
className?: string;
|
|
53
|
-
/** Custom style */
|
|
54
64
|
style?: React__default.CSSProperties;
|
|
55
65
|
}
|
|
56
66
|
interface StepsProps {
|
|
@@ -70,10 +80,40 @@ interface StepsProps {
|
|
|
70
80
|
children?: React__default.ReactNode;
|
|
71
81
|
/** Change handler */
|
|
72
82
|
onChange?: (current: number) => void;
|
|
73
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* Custom class name for root element
|
|
85
|
+
*/
|
|
74
86
|
className?: string;
|
|
75
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Custom style for root element
|
|
89
|
+
*/
|
|
76
90
|
style?: React__default.CSSProperties;
|
|
91
|
+
/**
|
|
92
|
+
* Granular styles
|
|
93
|
+
*/
|
|
94
|
+
styles?: {
|
|
95
|
+
root?: React__default.CSSProperties;
|
|
96
|
+
item?: React__default.CSSProperties;
|
|
97
|
+
icon?: React__default.CSSProperties;
|
|
98
|
+
content?: React__default.CSSProperties;
|
|
99
|
+
title?: React__default.CSSProperties;
|
|
100
|
+
subtitle?: React__default.CSSProperties;
|
|
101
|
+
description?: React__default.CSSProperties;
|
|
102
|
+
tail?: React__default.CSSProperties;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Granular class names
|
|
106
|
+
*/
|
|
107
|
+
classNames?: {
|
|
108
|
+
root?: string;
|
|
109
|
+
item?: string;
|
|
110
|
+
icon?: string;
|
|
111
|
+
content?: string;
|
|
112
|
+
title?: string;
|
|
113
|
+
subtitle?: string;
|
|
114
|
+
description?: string;
|
|
115
|
+
tail?: string;
|
|
116
|
+
};
|
|
77
117
|
}
|
|
78
118
|
|
|
79
119
|
declare const Step: React__default.FC<StepProps>;
|
|
@@ -81,6 +121,156 @@ declare const Steps: React__default.FC<StepsProps> & {
|
|
|
81
121
|
Step: typeof Step;
|
|
82
122
|
};
|
|
83
123
|
|
|
124
|
+
interface PaginationProps {
|
|
125
|
+
/** Current page number */
|
|
126
|
+
current?: number;
|
|
127
|
+
/** Default initial page number */
|
|
128
|
+
defaultCurrent?: number;
|
|
129
|
+
/** Total number of data items */
|
|
130
|
+
total?: number;
|
|
131
|
+
/** Number of data items per page */
|
|
132
|
+
pageSize?: number;
|
|
133
|
+
/** Default number of data items per page */
|
|
134
|
+
defaultPageSize?: number;
|
|
135
|
+
/** Callback executed when page number or pageSize is changed */
|
|
136
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
137
|
+
/** Disable pagination */
|
|
138
|
+
disabled?: boolean;
|
|
139
|
+
/** Determine whether to show the size changer */
|
|
140
|
+
showSizeChanger?: boolean;
|
|
141
|
+
/** Specify the size changer options */
|
|
142
|
+
pageSizeOptions?: number[];
|
|
143
|
+
/** Determine whether you can jump to pages directly */
|
|
144
|
+
showQuickJumper?: boolean;
|
|
145
|
+
/** To display the total number and range */
|
|
146
|
+
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
|
147
|
+
/** Specify the alignment of total text */
|
|
148
|
+
totalAlign?: 'left' | 'right';
|
|
149
|
+
/** Whether to use simple mode */
|
|
150
|
+
simple?: boolean;
|
|
151
|
+
/** Specify the size of pagination component */
|
|
152
|
+
size?: 'default' | 'small';
|
|
153
|
+
/** Custom class name */
|
|
154
|
+
className?: string;
|
|
155
|
+
/** Custom style */
|
|
156
|
+
style?: React.CSSProperties;
|
|
157
|
+
/**
|
|
158
|
+
* Granular styles
|
|
159
|
+
*/
|
|
160
|
+
styles?: {
|
|
161
|
+
root?: React.CSSProperties;
|
|
162
|
+
item?: React.CSSProperties;
|
|
163
|
+
activeItem?: React.CSSProperties;
|
|
164
|
+
jumpItem?: React.CSSProperties;
|
|
165
|
+
options?: React.CSSProperties;
|
|
166
|
+
total?: React.CSSProperties;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Granular class names
|
|
170
|
+
*/
|
|
171
|
+
classNames?: {
|
|
172
|
+
root?: string;
|
|
173
|
+
item?: string;
|
|
174
|
+
activeItem?: string;
|
|
175
|
+
jumpItem?: string;
|
|
176
|
+
options?: string;
|
|
177
|
+
total?: string;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare const Pagination: React__default.FC<PaginationProps>;
|
|
182
|
+
|
|
183
|
+
interface ColumnType<T = unknown> {
|
|
184
|
+
/** Column title */
|
|
185
|
+
title: React__default.ReactNode;
|
|
186
|
+
/** Unique key for column */
|
|
187
|
+
key?: React__default.Key;
|
|
188
|
+
/** Field name to get value from record */
|
|
189
|
+
dataIndex?: keyof T;
|
|
190
|
+
/** Render function */
|
|
191
|
+
render?: (value: any, record: T, index: number) => React__default.ReactNode;
|
|
192
|
+
/** Column alignment */
|
|
193
|
+
align?: 'left' | 'center' | 'right';
|
|
194
|
+
/** Column width */
|
|
195
|
+
width?: string | number;
|
|
196
|
+
/** Fixed column */
|
|
197
|
+
fixed?: 'left' | 'right' | boolean;
|
|
198
|
+
/** Sorter function */
|
|
199
|
+
sorter?: (a: T, b: T) => number;
|
|
200
|
+
}
|
|
201
|
+
interface RowSelection<T> {
|
|
202
|
+
/** Selected row keys */
|
|
203
|
+
selectedRowKeys?: React__default.Key[];
|
|
204
|
+
/** Callback when selection changes */
|
|
205
|
+
onChange?: (selectedRowKeys: React__default.Key[], selectedRows: T[]) => void;
|
|
206
|
+
}
|
|
207
|
+
interface TableProps<T = unknown> {
|
|
208
|
+
/** Data source array */
|
|
209
|
+
dataSource: T[];
|
|
210
|
+
/** Columns configuration */
|
|
211
|
+
columns: ColumnType<T>[];
|
|
212
|
+
/**
|
|
213
|
+
* Row's unique key
|
|
214
|
+
* @default 'key'
|
|
215
|
+
*/
|
|
216
|
+
rowKey?: string | ((record: T) => string);
|
|
217
|
+
/** Whether to show border */
|
|
218
|
+
bordered?: boolean;
|
|
219
|
+
/** Table size */
|
|
220
|
+
size?: 'small' | 'medium' | 'large';
|
|
221
|
+
/** Loading status */
|
|
222
|
+
loading?: boolean;
|
|
223
|
+
/** Custom loading indicator */
|
|
224
|
+
loadingIndicator?: React__default.ReactNode;
|
|
225
|
+
/** Pagination config, set false to hide */
|
|
226
|
+
pagination?: PaginationProps | false;
|
|
227
|
+
/** Row selection config */
|
|
228
|
+
rowSelection?: RowSelection<T>;
|
|
229
|
+
/** Empty text */
|
|
230
|
+
emptyText?: React__default.ReactNode;
|
|
231
|
+
/** Scroll config */
|
|
232
|
+
scroll?: {
|
|
233
|
+
x?: string | number;
|
|
234
|
+
y?: string | number;
|
|
235
|
+
};
|
|
236
|
+
/** Set header row properties */
|
|
237
|
+
onHeaderRow?: (columns: ColumnType<T>[], index?: number) => React__default.HTMLAttributes<HTMLTableRowElement>;
|
|
238
|
+
/** Set row properties */
|
|
239
|
+
onRow?: (record: T, index?: number) => React__default.HTMLAttributes<HTMLTableRowElement>;
|
|
240
|
+
/** Custom class name */
|
|
241
|
+
className?: string;
|
|
242
|
+
/** Custom style */
|
|
243
|
+
style?: React__default.CSSProperties;
|
|
244
|
+
/** Granular styles */
|
|
245
|
+
styles?: {
|
|
246
|
+
root?: React__default.CSSProperties;
|
|
247
|
+
table?: React__default.CSSProperties;
|
|
248
|
+
thead?: React__default.CSSProperties;
|
|
249
|
+
tbody?: React__default.CSSProperties;
|
|
250
|
+
tr?: React__default.CSSProperties;
|
|
251
|
+
th?: React__default.CSSProperties;
|
|
252
|
+
td?: React__default.CSSProperties;
|
|
253
|
+
pagination?: React__default.CSSProperties;
|
|
254
|
+
empty?: React__default.CSSProperties;
|
|
255
|
+
loadingOverlay?: React__default.CSSProperties;
|
|
256
|
+
};
|
|
257
|
+
/** Granular class names */
|
|
258
|
+
classNames?: {
|
|
259
|
+
root?: string;
|
|
260
|
+
table?: string;
|
|
261
|
+
thead?: string;
|
|
262
|
+
tbody?: string;
|
|
263
|
+
tr?: string;
|
|
264
|
+
th?: string;
|
|
265
|
+
td?: string;
|
|
266
|
+
pagination?: string;
|
|
267
|
+
empty?: string;
|
|
268
|
+
loadingOverlay?: string;
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
declare function Table<T = unknown>(props: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
273
|
+
|
|
84
274
|
interface DataNode {
|
|
85
275
|
key: string | number;
|
|
86
276
|
title?: React__default.ReactNode;
|
|
@@ -90,7 +280,8 @@ interface DataNode {
|
|
|
90
280
|
checkable?: boolean;
|
|
91
281
|
icon?: React__default.ReactNode;
|
|
92
282
|
isLeaf?: boolean;
|
|
93
|
-
|
|
283
|
+
/** Additional custom data fields */
|
|
284
|
+
extraData?: Record<string, unknown>;
|
|
94
285
|
}
|
|
95
286
|
interface TreeProps {
|
|
96
287
|
/** Tree data */
|
|
@@ -138,18 +329,46 @@ interface TreeProps {
|
|
|
138
329
|
}) => React__default.ReactNode);
|
|
139
330
|
/** Custom title render */
|
|
140
331
|
titleRender?: (node: DataNode) => React__default.ReactNode;
|
|
332
|
+
/** Whether to expand node on click */
|
|
333
|
+
expandOnClick?: boolean;
|
|
141
334
|
/** Virtual scroll height */
|
|
142
335
|
height?: number;
|
|
143
336
|
/** Virtual scroll item height */
|
|
144
337
|
itemHeight?: number;
|
|
145
338
|
/** Enable virtual scrolling */
|
|
146
339
|
virtual?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
340
|
+
/**
|
|
341
|
+
* Custom class name for root element
|
|
342
|
+
*/
|
|
150
343
|
className?: string;
|
|
151
|
-
/**
|
|
344
|
+
/**
|
|
345
|
+
* Custom style for root element
|
|
346
|
+
*/
|
|
152
347
|
style?: React__default.CSSProperties;
|
|
348
|
+
/**
|
|
349
|
+
* Granular styles
|
|
350
|
+
*/
|
|
351
|
+
styles?: {
|
|
352
|
+
root?: React__default.CSSProperties;
|
|
353
|
+
node?: React__default.CSSProperties;
|
|
354
|
+
content?: React__default.CSSProperties;
|
|
355
|
+
switcher?: React__default.CSSProperties;
|
|
356
|
+
checkbox?: React__default.CSSProperties;
|
|
357
|
+
icon?: React__default.CSSProperties;
|
|
358
|
+
title?: React__default.CSSProperties;
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Granular class names
|
|
362
|
+
*/
|
|
363
|
+
classNames?: {
|
|
364
|
+
root?: string;
|
|
365
|
+
node?: string;
|
|
366
|
+
content?: string;
|
|
367
|
+
switcher?: string;
|
|
368
|
+
checkbox?: string;
|
|
369
|
+
icon?: string;
|
|
370
|
+
title?: string;
|
|
371
|
+
};
|
|
153
372
|
}
|
|
154
373
|
interface TreeNodeProps extends Omit<DataNode, 'children'> {
|
|
155
374
|
eventKey: string | number;
|
|
@@ -173,6 +392,9 @@ interface TreeNodeProps extends Omit<DataNode, 'children'> {
|
|
|
173
392
|
showIcon?: boolean;
|
|
174
393
|
isLast?: boolean;
|
|
175
394
|
indentLines?: boolean[];
|
|
395
|
+
hasTitleRender?: boolean;
|
|
396
|
+
styles?: TreeProps['styles'];
|
|
397
|
+
classNames?: TreeProps['classNames'];
|
|
176
398
|
}
|
|
177
399
|
|
|
178
400
|
declare const Tree: React$1.FC<TreeProps>;
|
|
@@ -182,7 +404,6 @@ interface SelectOption {
|
|
|
182
404
|
label: React__default.ReactNode;
|
|
183
405
|
value: string | number;
|
|
184
406
|
disabled?: boolean;
|
|
185
|
-
[key: string]: unknown;
|
|
186
407
|
}
|
|
187
408
|
interface SelectProps {
|
|
188
409
|
/**
|
|
@@ -229,14 +450,6 @@ interface SelectProps {
|
|
|
229
450
|
* Whether to allow clearing the selection
|
|
230
451
|
*/
|
|
231
452
|
allowClear?: boolean;
|
|
232
|
-
/**
|
|
233
|
-
* Custom class name
|
|
234
|
-
*/
|
|
235
|
-
className?: string;
|
|
236
|
-
/**
|
|
237
|
-
* Custom style
|
|
238
|
-
*/
|
|
239
|
-
style?: React__default.CSSProperties;
|
|
240
453
|
/**
|
|
241
454
|
* Size of the select input
|
|
242
455
|
* @default 'medium'
|
|
@@ -263,6 +476,45 @@ interface SelectProps {
|
|
|
263
476
|
* @default 'click'
|
|
264
477
|
*/
|
|
265
478
|
trigger?: 'click' | 'hover';
|
|
479
|
+
/** Custom class name */
|
|
480
|
+
className?: string;
|
|
481
|
+
/** Custom style */
|
|
482
|
+
style?: React__default.CSSProperties;
|
|
483
|
+
/**
|
|
484
|
+
* Granular styles for internal components
|
|
485
|
+
*/
|
|
486
|
+
styles?: {
|
|
487
|
+
root?: React__default.CSSProperties;
|
|
488
|
+
trigger?: React__default.CSSProperties;
|
|
489
|
+
dropdown?: React__default.CSSProperties;
|
|
490
|
+
option?: React__default.CSSProperties;
|
|
491
|
+
tag?: React__default.CSSProperties;
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* Granular class names for internal components
|
|
495
|
+
*/
|
|
496
|
+
classNames?: {
|
|
497
|
+
root?: string;
|
|
498
|
+
trigger?: string;
|
|
499
|
+
dropdown?: string;
|
|
500
|
+
option?: string;
|
|
501
|
+
tag?: string;
|
|
502
|
+
};
|
|
503
|
+
/**
|
|
504
|
+
* Custom option renderer
|
|
505
|
+
*/
|
|
506
|
+
optionRender?: (option: SelectOption, info: {
|
|
507
|
+
index: number;
|
|
508
|
+
selected: boolean;
|
|
509
|
+
}) => React__default.ReactNode;
|
|
510
|
+
/**
|
|
511
|
+
* Custom label renderer (for the selected value in the trigger)
|
|
512
|
+
*/
|
|
513
|
+
labelRender?: (props: SelectOption) => React__default.ReactNode;
|
|
514
|
+
/**
|
|
515
|
+
* Custom selected icon in the dropdown menu
|
|
516
|
+
*/
|
|
517
|
+
menuItemSelectedIcon?: React__default.ReactNode;
|
|
266
518
|
}
|
|
267
519
|
interface OptionProps {
|
|
268
520
|
value: string | number;
|
|
@@ -270,6 +522,7 @@ interface OptionProps {
|
|
|
270
522
|
disabled?: boolean;
|
|
271
523
|
className?: string;
|
|
272
524
|
style?: React__default.CSSProperties;
|
|
525
|
+
menuItemSelectedIcon?: React__default.ReactNode;
|
|
273
526
|
/**
|
|
274
527
|
* Internal prop to pass label if children is complex
|
|
275
528
|
*/
|
|
@@ -312,6 +565,28 @@ interface TreeSelectProps extends Omit<SelectProps, 'options' | 'onChange'> {
|
|
|
312
565
|
* Custom icon for selected tree node
|
|
313
566
|
*/
|
|
314
567
|
treeSelectedIcon?: React__default.ReactNode;
|
|
568
|
+
/**
|
|
569
|
+
* Custom title render
|
|
570
|
+
*/
|
|
571
|
+
titleRender?: (node: DataNode, searchValue: string) => React__default.ReactNode;
|
|
572
|
+
/**
|
|
573
|
+
* Custom expand icon
|
|
574
|
+
*/
|
|
575
|
+
switcherIcon?: React__default.ReactNode | ((props: {
|
|
576
|
+
expanded: boolean;
|
|
577
|
+
}) => React__default.ReactNode);
|
|
578
|
+
/**
|
|
579
|
+
* Only allow selecting leaf nodes
|
|
580
|
+
*/
|
|
581
|
+
onlyLeafSelect?: boolean;
|
|
582
|
+
/**
|
|
583
|
+
* Custom className
|
|
584
|
+
*/
|
|
585
|
+
className?: string;
|
|
586
|
+
/**
|
|
587
|
+
* Custom style
|
|
588
|
+
*/
|
|
589
|
+
style?: React__default.CSSProperties;
|
|
315
590
|
}
|
|
316
591
|
|
|
317
592
|
declare const TreeSelect: React__default.FC<TreeSelectProps>;
|
|
@@ -383,6 +658,24 @@ interface MenuProps {
|
|
|
383
658
|
* Select handler
|
|
384
659
|
*/
|
|
385
660
|
onSelect?: (keys: (string | number)[]) => void;
|
|
661
|
+
/**
|
|
662
|
+
* Granular styles
|
|
663
|
+
*/
|
|
664
|
+
styles?: {
|
|
665
|
+
root?: React__default.CSSProperties;
|
|
666
|
+
item?: React__default.CSSProperties;
|
|
667
|
+
icon?: React__default.CSSProperties;
|
|
668
|
+
content?: React__default.CSSProperties;
|
|
669
|
+
};
|
|
670
|
+
/**
|
|
671
|
+
* Granular class names
|
|
672
|
+
*/
|
|
673
|
+
classNames?: {
|
|
674
|
+
root?: string;
|
|
675
|
+
item?: string;
|
|
676
|
+
icon?: string;
|
|
677
|
+
content?: string;
|
|
678
|
+
};
|
|
386
679
|
}
|
|
387
680
|
interface MenuItemProps {
|
|
388
681
|
/**
|
|
@@ -405,6 +698,10 @@ interface MenuItemProps {
|
|
|
405
698
|
* Danger state
|
|
406
699
|
*/
|
|
407
700
|
danger?: boolean;
|
|
701
|
+
/**
|
|
702
|
+
* Unique key for event handling
|
|
703
|
+
*/
|
|
704
|
+
eventKey?: string | number;
|
|
408
705
|
/**
|
|
409
706
|
* Custom class name
|
|
410
707
|
*/
|
|
@@ -413,17 +710,18 @@ interface MenuItemProps {
|
|
|
413
710
|
* Custom style
|
|
414
711
|
*/
|
|
415
712
|
style?: React__default.CSSProperties;
|
|
416
|
-
/**
|
|
417
|
-
* Unique key for event handling
|
|
418
|
-
*/
|
|
419
|
-
eventKey?: string | number;
|
|
420
713
|
}
|
|
421
714
|
|
|
422
|
-
declare const
|
|
715
|
+
declare const InternalMenu: React__default.ForwardRefExoticComponent<MenuProps & React__default.RefAttributes<HTMLUListElement>>;
|
|
716
|
+
declare const MenuItem: React__default.ForwardRefExoticComponent<MenuItemProps & React__default.RefAttributes<HTMLLIElement>>;
|
|
717
|
+
type MenuComponent = typeof InternalMenu & {
|
|
423
718
|
Item: typeof MenuItem;
|
|
424
719
|
};
|
|
425
|
-
declare const
|
|
720
|
+
declare const Menu: MenuComponent;
|
|
426
721
|
|
|
722
|
+
/**
|
|
723
|
+
* Dropdown component properties
|
|
724
|
+
*/
|
|
427
725
|
interface DropdownProps {
|
|
428
726
|
/**
|
|
429
727
|
* Trigger mode
|
|
@@ -460,13 +758,43 @@ interface DropdownProps {
|
|
|
460
758
|
*/
|
|
461
759
|
disabled?: boolean;
|
|
462
760
|
/**
|
|
463
|
-
* Custom class name
|
|
761
|
+
* Custom root element class name
|
|
464
762
|
*/
|
|
465
763
|
className?: string;
|
|
466
764
|
/**
|
|
467
|
-
* Custom style
|
|
765
|
+
* Custom root element style
|
|
468
766
|
*/
|
|
469
767
|
style?: React__default.CSSProperties;
|
|
768
|
+
/**
|
|
769
|
+
* Custom overlay element class name
|
|
770
|
+
*/
|
|
771
|
+
overlayClassName?: string;
|
|
772
|
+
/**
|
|
773
|
+
* Custom overlay element style
|
|
774
|
+
*/
|
|
775
|
+
overlayStyle?: React__default.CSSProperties;
|
|
776
|
+
/**
|
|
777
|
+
* Semantic class names for internal elements
|
|
778
|
+
*/
|
|
779
|
+
classNames?: {
|
|
780
|
+
/** Class name for the trigger element */
|
|
781
|
+
trigger?: string;
|
|
782
|
+
/** Class name for the overlay container */
|
|
783
|
+
overlay?: string;
|
|
784
|
+
/** Class name for the content wrapper */
|
|
785
|
+
content?: string;
|
|
786
|
+
};
|
|
787
|
+
/**
|
|
788
|
+
* Semantic styles for internal elements
|
|
789
|
+
*/
|
|
790
|
+
styles?: {
|
|
791
|
+
/** Style for the trigger element */
|
|
792
|
+
trigger?: React__default.CSSProperties;
|
|
793
|
+
/** Style for the overlay container */
|
|
794
|
+
overlay?: React__default.CSSProperties;
|
|
795
|
+
/** Style for the content wrapper */
|
|
796
|
+
content?: React__default.CSSProperties;
|
|
797
|
+
};
|
|
470
798
|
/**
|
|
471
799
|
* Whether to close the dropdown when a menu item is selected
|
|
472
800
|
* @default true
|
|
@@ -482,20 +810,9 @@ interface InputFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLIn
|
|
|
482
810
|
* @default 'text'
|
|
483
811
|
*/
|
|
484
812
|
type?: 'text' | 'password' | 'search';
|
|
485
|
-
/**
|
|
486
|
-
* The label content.
|
|
487
|
-
*/
|
|
488
|
-
label?: React__default.ReactNode;
|
|
489
|
-
/**
|
|
490
|
-
* The error content.
|
|
491
|
-
*/
|
|
492
|
-
error?: boolean | React__default.ReactNode;
|
|
493
|
-
/**
|
|
494
|
-
* The helper text content.
|
|
495
|
-
*/
|
|
496
|
-
helperText?: React__default.ReactNode;
|
|
497
813
|
/**
|
|
498
814
|
* If `true`, the input will take up the full width of its container.
|
|
815
|
+
* @default false
|
|
499
816
|
*/
|
|
500
817
|
fullWidth?: boolean;
|
|
501
818
|
/**
|
|
@@ -508,6 +825,7 @@ interface InputFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLIn
|
|
|
508
825
|
suffix?: React__default.ReactNode;
|
|
509
826
|
/**
|
|
510
827
|
* If `true`, a clear icon will appear when the input has value.
|
|
828
|
+
* @default false
|
|
511
829
|
*/
|
|
512
830
|
allowClear?: boolean;
|
|
513
831
|
/**
|
|
@@ -527,6 +845,40 @@ interface InputFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLIn
|
|
|
527
845
|
* The callback function that is triggered when Enter key is pressed.
|
|
528
846
|
*/
|
|
529
847
|
onPressEnter?: (event: React__default.KeyboardEvent<HTMLInputElement>) => void;
|
|
848
|
+
/**
|
|
849
|
+
* The validation status.
|
|
850
|
+
*/
|
|
851
|
+
status?: 'error' | 'warning';
|
|
852
|
+
/**
|
|
853
|
+
* Semantic class names for internal elements
|
|
854
|
+
*/
|
|
855
|
+
classNames?: {
|
|
856
|
+
/** Class name for the root element */
|
|
857
|
+
root?: string;
|
|
858
|
+
/** Class name for the input element */
|
|
859
|
+
input?: string;
|
|
860
|
+
/** Class name for the prefix element */
|
|
861
|
+
prefix?: string;
|
|
862
|
+
/** Class name for the suffix element */
|
|
863
|
+
suffix?: string;
|
|
864
|
+
/** Class name for the clear button */
|
|
865
|
+
clear?: string;
|
|
866
|
+
};
|
|
867
|
+
/**
|
|
868
|
+
* Semantic styles for internal elements
|
|
869
|
+
*/
|
|
870
|
+
styles?: {
|
|
871
|
+
/** Style for the root element */
|
|
872
|
+
root?: React__default.CSSProperties;
|
|
873
|
+
/** Style for the input element */
|
|
874
|
+
input?: React__default.CSSProperties;
|
|
875
|
+
/** Style for the prefix element */
|
|
876
|
+
prefix?: React__default.CSSProperties;
|
|
877
|
+
/** Style for the suffix element */
|
|
878
|
+
suffix?: React__default.CSSProperties;
|
|
879
|
+
/** Style for the clear button */
|
|
880
|
+
clear?: React__default.CSSProperties;
|
|
881
|
+
};
|
|
530
882
|
}
|
|
531
883
|
|
|
532
884
|
/**
|
|
@@ -534,6 +886,77 @@ interface InputFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLIn
|
|
|
534
886
|
*/
|
|
535
887
|
declare const InputField: React__default.ForwardRefExoticComponent<InputFieldProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
536
888
|
|
|
889
|
+
interface AutoCompleteOption {
|
|
890
|
+
/** The value of the option */
|
|
891
|
+
value: string;
|
|
892
|
+
/** The label to display for the option */
|
|
893
|
+
label?: React__default.ReactNode;
|
|
894
|
+
/** Whether the option is disabled */
|
|
895
|
+
disabled?: boolean;
|
|
896
|
+
/** Allow additional custom fields */
|
|
897
|
+
[key: string]: unknown;
|
|
898
|
+
}
|
|
899
|
+
interface AutoCompleteProps extends Omit<InputFieldProps, 'onChange' | 'onSelect'> {
|
|
900
|
+
/**
|
|
901
|
+
* Current value of the input
|
|
902
|
+
*/
|
|
903
|
+
value?: string;
|
|
904
|
+
/**
|
|
905
|
+
* Default value of the input
|
|
906
|
+
*/
|
|
907
|
+
defaultValue?: string;
|
|
908
|
+
/**
|
|
909
|
+
* Data source for suggestions
|
|
910
|
+
*/
|
|
911
|
+
options?: AutoCompleteOption[];
|
|
912
|
+
/**
|
|
913
|
+
* Callback when searching (search value change)
|
|
914
|
+
*/
|
|
915
|
+
onSearch?: (value: string) => void;
|
|
916
|
+
/**
|
|
917
|
+
* Callback when selecting an option
|
|
918
|
+
*/
|
|
919
|
+
onSelect?: (value: string, option: AutoCompleteOption) => void;
|
|
920
|
+
/**
|
|
921
|
+
* Callback when input value changes
|
|
922
|
+
*/
|
|
923
|
+
onChange?: (value: string) => void;
|
|
924
|
+
/**
|
|
925
|
+
* Custom filter function or true to filter by label
|
|
926
|
+
* default: true
|
|
927
|
+
*/
|
|
928
|
+
filterOption?: boolean | ((inputValue: string, option: AutoCompleteOption) => boolean);
|
|
929
|
+
/**
|
|
930
|
+
* Whether the dropdown width should match the input width
|
|
931
|
+
* default: true
|
|
932
|
+
*/
|
|
933
|
+
dropdownMatchSelectWidth?: boolean | number;
|
|
934
|
+
/**
|
|
935
|
+
* Content to show when no options match
|
|
936
|
+
*/
|
|
937
|
+
notFoundContent?: React__default.ReactNode;
|
|
938
|
+
/**
|
|
939
|
+
* Semantic DOM class names
|
|
940
|
+
*/
|
|
941
|
+
classNames?: {
|
|
942
|
+
root?: string;
|
|
943
|
+
input?: string;
|
|
944
|
+
dropdown?: string;
|
|
945
|
+
option?: string;
|
|
946
|
+
};
|
|
947
|
+
/**
|
|
948
|
+
* Semantic DOM styles
|
|
949
|
+
*/
|
|
950
|
+
styles?: {
|
|
951
|
+
root?: React__default.CSSProperties;
|
|
952
|
+
input?: React__default.CSSProperties;
|
|
953
|
+
dropdown?: React__default.CSSProperties;
|
|
954
|
+
option?: React__default.CSSProperties;
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
declare const AutoComplete: React__default.FC<AutoCompleteProps>;
|
|
959
|
+
|
|
537
960
|
type MessageType$1 = 'info' | 'success' | 'error' | 'warning' | 'loading';
|
|
538
961
|
interface MessageProps {
|
|
539
962
|
key?: string;
|
|
@@ -593,6 +1016,8 @@ interface ModalBaseProps {
|
|
|
593
1016
|
style?: CSSProperties;
|
|
594
1017
|
/** Modal title */
|
|
595
1018
|
title?: React__default.ReactNode;
|
|
1019
|
+
/** Custom header content */
|
|
1020
|
+
header?: React__default.ReactNode;
|
|
596
1021
|
/** Whether to show the close button */
|
|
597
1022
|
closable?: boolean;
|
|
598
1023
|
/** Width of the modal */
|
|
@@ -608,7 +1033,26 @@ interface ModalBaseProps {
|
|
|
608
1033
|
/** Whether the OK button is loading */
|
|
609
1034
|
confirmLoading?: boolean;
|
|
610
1035
|
/** Callback when the modal is completely closed (after animation) */
|
|
1036
|
+
/** Callback when the modal is completely closed (after animation) */
|
|
611
1037
|
afterClose?: () => void;
|
|
1038
|
+
/** Granular styles */
|
|
1039
|
+
styles?: {
|
|
1040
|
+
root?: React__default.CSSProperties;
|
|
1041
|
+
mask?: React__default.CSSProperties;
|
|
1042
|
+
content?: React__default.CSSProperties;
|
|
1043
|
+
header?: React__default.CSSProperties;
|
|
1044
|
+
body?: React__default.CSSProperties;
|
|
1045
|
+
footer?: React__default.CSSProperties;
|
|
1046
|
+
};
|
|
1047
|
+
/** Granular class names */
|
|
1048
|
+
classNames?: {
|
|
1049
|
+
root?: string;
|
|
1050
|
+
mask?: string;
|
|
1051
|
+
content?: string;
|
|
1052
|
+
header?: string;
|
|
1053
|
+
body?: string;
|
|
1054
|
+
footer?: string;
|
|
1055
|
+
};
|
|
612
1056
|
}
|
|
613
1057
|
|
|
614
1058
|
declare const Modal: (props: ModalBaseProps) => React__default.ReactPortal;
|
|
@@ -714,51 +1158,26 @@ interface ProgressProps {
|
|
|
714
1158
|
*/
|
|
715
1159
|
declare const Progress: React__default.ForwardRefExoticComponent<ProgressProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
716
1160
|
|
|
717
|
-
interface PaginationProps {
|
|
718
|
-
/** Current page number */
|
|
719
|
-
current?: number;
|
|
720
|
-
/** Default initial page number */
|
|
721
|
-
defaultCurrent?: number;
|
|
722
|
-
/** Total number of data items */
|
|
723
|
-
total?: number;
|
|
724
|
-
/** Number of data items per page */
|
|
725
|
-
pageSize?: number;
|
|
726
|
-
/** Default number of data items per page */
|
|
727
|
-
defaultPageSize?: number;
|
|
728
|
-
/** Callback executed when page number or pageSize is changed */
|
|
729
|
-
onChange?: (page: number, pageSize: number) => void;
|
|
730
|
-
/** Disable pagination */
|
|
731
|
-
disabled?: boolean;
|
|
732
|
-
/** Determine whether to show the size changer */
|
|
733
|
-
showSizeChanger?: boolean;
|
|
734
|
-
/** Specify the size changer options */
|
|
735
|
-
pageSizeOptions?: number[];
|
|
736
|
-
/** Determine whether you can jump to pages directly */
|
|
737
|
-
showQuickJumper?: boolean;
|
|
738
|
-
/** To display the total number and range */
|
|
739
|
-
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
|
740
|
-
/** Specify the alignment of total text */
|
|
741
|
-
totalAlign?: 'left' | 'right';
|
|
742
|
-
/** Whether to use simple mode */
|
|
743
|
-
simple?: boolean;
|
|
744
|
-
/** Specify the size of pagination component */
|
|
745
|
-
size?: 'default' | 'small';
|
|
746
|
-
/** Custom class name */
|
|
747
|
-
className?: string;
|
|
748
|
-
/** Custom style */
|
|
749
|
-
style?: React.CSSProperties;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
declare const Pagination: React__default.FC<PaginationProps>;
|
|
753
|
-
|
|
754
1161
|
type DatePickerMode = 'date' | 'week' | 'month' | 'quarter' | 'year';
|
|
755
|
-
interface
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
1162
|
+
interface DatePickerStyles {
|
|
1163
|
+
root?: React.CSSProperties;
|
|
1164
|
+
input?: React.CSSProperties;
|
|
1165
|
+
popup?: React.CSSProperties;
|
|
1166
|
+
header?: React.CSSProperties;
|
|
1167
|
+
body?: React.CSSProperties;
|
|
1168
|
+
footer?: React.CSSProperties;
|
|
1169
|
+
day?: React.CSSProperties;
|
|
1170
|
+
}
|
|
1171
|
+
interface DatePickerClassNames {
|
|
1172
|
+
root?: string;
|
|
1173
|
+
input?: string;
|
|
1174
|
+
popup?: string;
|
|
1175
|
+
header?: string;
|
|
1176
|
+
body?: string;
|
|
1177
|
+
footer?: string;
|
|
1178
|
+
day?: string;
|
|
1179
|
+
}
|
|
1180
|
+
interface DatePickerSharedProps {
|
|
762
1181
|
/** Picker mode */
|
|
763
1182
|
picker?: DatePickerMode;
|
|
764
1183
|
/** Whether to show time picker */
|
|
@@ -767,8 +1186,6 @@ interface DatePickerProps {
|
|
|
767
1186
|
format?: string;
|
|
768
1187
|
/** Disabled state */
|
|
769
1188
|
disabled?: boolean;
|
|
770
|
-
/** Placeholder text */
|
|
771
|
-
placeholder?: string;
|
|
772
1189
|
/** Clearable */
|
|
773
1190
|
clearable?: boolean;
|
|
774
1191
|
/** Custom class name */
|
|
@@ -777,32 +1194,36 @@ interface DatePickerProps {
|
|
|
777
1194
|
style?: React.CSSProperties;
|
|
778
1195
|
/** Whether the picker should take up the full width of its container */
|
|
779
1196
|
fullWidth?: boolean;
|
|
1197
|
+
/** Validation status */
|
|
1198
|
+
status?: 'error' | 'warning';
|
|
1199
|
+
/**
|
|
1200
|
+
* Granular styles for internal components
|
|
1201
|
+
*/
|
|
1202
|
+
styles?: DatePickerStyles;
|
|
1203
|
+
/**
|
|
1204
|
+
* Granular class names for internal components
|
|
1205
|
+
*/
|
|
1206
|
+
classNames?: DatePickerClassNames;
|
|
780
1207
|
}
|
|
781
|
-
interface
|
|
1208
|
+
interface DatePickerProps extends DatePickerSharedProps {
|
|
1209
|
+
/** Selected date (JS Date) */
|
|
1210
|
+
value?: Date | null;
|
|
1211
|
+
/** Default selected date (JS Date) (Only effective on mount) */
|
|
1212
|
+
defaultValue?: Date | null;
|
|
1213
|
+
/** Callback when date changes */
|
|
1214
|
+
onChange?: (date: Date | null) => void;
|
|
1215
|
+
/** Placeholder text */
|
|
1216
|
+
placeholder?: string;
|
|
1217
|
+
}
|
|
1218
|
+
interface DateRangePickerProps extends DatePickerSharedProps {
|
|
782
1219
|
/** Selected date range */
|
|
783
1220
|
value?: [Date | null, Date | null];
|
|
784
1221
|
/** Default selected date range */
|
|
785
1222
|
defaultValue?: [Date | null, Date | null];
|
|
786
1223
|
/** Callback when date range changes */
|
|
787
1224
|
onChange?: (dates: [Date | null, Date | null]) => void;
|
|
788
|
-
/** Picker mode */
|
|
789
|
-
picker?: DatePickerMode;
|
|
790
|
-
/** Whether to show time picker */
|
|
791
|
-
showTime?: boolean;
|
|
792
|
-
/** Date format string */
|
|
793
|
-
format?: string;
|
|
794
|
-
/** Disabled state */
|
|
795
|
-
disabled?: boolean;
|
|
796
1225
|
/** Placeholder text */
|
|
797
1226
|
placeholder?: [string, string];
|
|
798
|
-
/** Clearable */
|
|
799
|
-
clearable?: boolean;
|
|
800
|
-
/** Custom class name */
|
|
801
|
-
className?: string;
|
|
802
|
-
/** Custom style */
|
|
803
|
-
style?: React.CSSProperties;
|
|
804
|
-
/** Whether the picker should take up the full width of its container */
|
|
805
|
-
fullWidth?: boolean;
|
|
806
1227
|
}
|
|
807
1228
|
|
|
808
1229
|
declare const DatePicker$1: React__default.ForwardRefExoticComponent<DatePickerProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
@@ -818,8 +1239,8 @@ declare const DatePicker: DatePickerInterface;
|
|
|
818
1239
|
interface Theme {
|
|
819
1240
|
colors: {
|
|
820
1241
|
primary: string;
|
|
821
|
-
primaryHover
|
|
822
|
-
primaryActive
|
|
1242
|
+
primaryHover?: string;
|
|
1243
|
+
primaryActive?: string;
|
|
823
1244
|
success: string;
|
|
824
1245
|
warning: string;
|
|
825
1246
|
error: string;
|
|
@@ -831,9 +1252,11 @@ interface Theme {
|
|
|
831
1252
|
background: string;
|
|
832
1253
|
backgroundSecondary: string;
|
|
833
1254
|
backgroundTertiary: string;
|
|
1255
|
+
backgroundHover: string;
|
|
834
1256
|
border: string;
|
|
835
1257
|
borderSecondary: string;
|
|
836
1258
|
borderHover: string;
|
|
1259
|
+
white: string;
|
|
837
1260
|
};
|
|
838
1261
|
spacing: {
|
|
839
1262
|
xs: number;
|
|
@@ -903,8 +1326,18 @@ interface Theme {
|
|
|
903
1326
|
tree: TreeTheme;
|
|
904
1327
|
form: FormTheme;
|
|
905
1328
|
tabs: TabsTheme;
|
|
1329
|
+
table: TableTheme;
|
|
906
1330
|
};
|
|
907
1331
|
}
|
|
1332
|
+
interface TableTheme {
|
|
1333
|
+
headerBg: string;
|
|
1334
|
+
headerColor: string;
|
|
1335
|
+
rowHoverBg: string;
|
|
1336
|
+
borderColor: string;
|
|
1337
|
+
bodyBg: string;
|
|
1338
|
+
color: string;
|
|
1339
|
+
cellPadding: string;
|
|
1340
|
+
}
|
|
908
1341
|
interface FormTheme {
|
|
909
1342
|
itemMarginBottom: string;
|
|
910
1343
|
labelColor: string;
|
|
@@ -1021,9 +1454,12 @@ interface ButtonTheme {
|
|
|
1021
1454
|
md: string;
|
|
1022
1455
|
lg: string;
|
|
1023
1456
|
};
|
|
1457
|
+
rippleOpacity: number;
|
|
1024
1458
|
}
|
|
1025
1459
|
interface MessageTheme {
|
|
1026
1460
|
contentPadding: string;
|
|
1461
|
+
contentBg: string;
|
|
1462
|
+
contentColor: string;
|
|
1027
1463
|
borderRadius: string;
|
|
1028
1464
|
boxShadow: string;
|
|
1029
1465
|
zIndex: number;
|
|
@@ -1037,6 +1473,7 @@ interface ModalTheme {
|
|
|
1037
1473
|
bodyPadding: string;
|
|
1038
1474
|
footerPadding: string;
|
|
1039
1475
|
zIndex: number;
|
|
1476
|
+
padding: string;
|
|
1040
1477
|
}
|
|
1041
1478
|
interface ProgressTheme {
|
|
1042
1479
|
trackColor: string;
|
|
@@ -1162,6 +1599,8 @@ interface ThemeConfig {
|
|
|
1162
1599
|
light?: DeepPartial<Theme>;
|
|
1163
1600
|
dark?: DeepPartial<Theme>;
|
|
1164
1601
|
defaultMode?: ThemeMode;
|
|
1602
|
+
/** Whether to inject CSS variables to :root. */
|
|
1603
|
+
global?: boolean;
|
|
1165
1604
|
}
|
|
1166
1605
|
interface ConfigProviderProps {
|
|
1167
1606
|
/**
|
|
@@ -1222,14 +1661,40 @@ interface InputNumberProps extends Omit<InputFieldProps, 'onChange' | 'value' |
|
|
|
1222
1661
|
* @default true
|
|
1223
1662
|
*/
|
|
1224
1663
|
keyboard?: boolean;
|
|
1664
|
+
/**
|
|
1665
|
+
* Semantic class names for internal elements
|
|
1666
|
+
*/
|
|
1667
|
+
classNames?: {
|
|
1668
|
+
root?: string;
|
|
1669
|
+
input?: string;
|
|
1670
|
+
inputWrapper?: string;
|
|
1671
|
+
prefix?: string;
|
|
1672
|
+
suffix?: string;
|
|
1673
|
+
upHandler?: string;
|
|
1674
|
+
downHandler?: string;
|
|
1675
|
+
};
|
|
1676
|
+
/**
|
|
1677
|
+
* Semantic styles for internal elements
|
|
1678
|
+
*/
|
|
1679
|
+
styles?: {
|
|
1680
|
+
root?: React.CSSProperties;
|
|
1681
|
+
input?: React.CSSProperties;
|
|
1682
|
+
inputWrapper?: React.CSSProperties;
|
|
1683
|
+
prefix?: React.CSSProperties;
|
|
1684
|
+
suffix?: React.CSSProperties;
|
|
1685
|
+
upHandler?: React.CSSProperties;
|
|
1686
|
+
downHandler?: React.CSSProperties;
|
|
1687
|
+
};
|
|
1225
1688
|
}
|
|
1226
1689
|
|
|
1227
1690
|
declare const InputNumber: React__default.ForwardRefExoticComponent<InputNumberProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
1228
1691
|
|
|
1692
|
+
type InternalNamePath = (string | number)[];
|
|
1693
|
+
type NamePath = string | number | InternalNamePath;
|
|
1229
1694
|
type StoreValue = unknown;
|
|
1230
1695
|
type Store = Record<string, StoreValue>;
|
|
1231
1696
|
interface FieldData {
|
|
1232
|
-
name:
|
|
1697
|
+
name: InternalNamePath;
|
|
1233
1698
|
value?: StoreValue;
|
|
1234
1699
|
touched?: boolean;
|
|
1235
1700
|
validating?: boolean;
|
|
@@ -1243,16 +1708,11 @@ interface FieldEntity {
|
|
|
1243
1708
|
validateRules: (options?: {
|
|
1244
1709
|
triggerName?: string;
|
|
1245
1710
|
}) => Promise<string[] | null>;
|
|
1246
|
-
|
|
1711
|
+
getNamePath: () => InternalNamePath;
|
|
1247
1712
|
getErrors: () => string[];
|
|
1248
1713
|
isFieldValidating: () => boolean;
|
|
1249
1714
|
isFieldTouched: () => boolean;
|
|
1250
|
-
props:
|
|
1251
|
-
name?: string;
|
|
1252
|
-
rules?: RuleItem[];
|
|
1253
|
-
dependencies?: string[];
|
|
1254
|
-
initialValue?: unknown;
|
|
1255
|
-
};
|
|
1715
|
+
props: FormItemProps;
|
|
1256
1716
|
setErrors: (errors: string[]) => void;
|
|
1257
1717
|
}
|
|
1258
1718
|
interface Callbacks<Values = Record<string, unknown>> {
|
|
@@ -1264,72 +1724,122 @@ interface Callbacks<Values = Record<string, unknown>> {
|
|
|
1264
1724
|
interface ValidateErrorEntity<Values = Record<string, unknown>> {
|
|
1265
1725
|
values: Values;
|
|
1266
1726
|
errorFields: {
|
|
1267
|
-
name:
|
|
1727
|
+
name: InternalNamePath;
|
|
1268
1728
|
errors: string[];
|
|
1269
1729
|
}[];
|
|
1270
1730
|
outOfDate: boolean;
|
|
1271
1731
|
}
|
|
1272
1732
|
interface InternalHooks {
|
|
1273
1733
|
registerField: (entity: FieldEntity) => () => void;
|
|
1274
|
-
registerWatch: (callback: (
|
|
1734
|
+
registerWatch: (callback: (namePath: InternalNamePath) => void) => () => void;
|
|
1275
1735
|
setInitialValues: (values: Store, init: boolean) => void;
|
|
1276
1736
|
setCallbacks: (callbacks: Callbacks) => void;
|
|
1277
1737
|
dispatch: (action: ReducerAction) => void;
|
|
1278
|
-
getFieldValue: (name:
|
|
1279
|
-
notifyFieldChange: (name:
|
|
1738
|
+
getFieldValue: (name: NamePath) => StoreValue;
|
|
1739
|
+
notifyFieldChange: (name: InternalNamePath) => void;
|
|
1280
1740
|
}
|
|
1281
1741
|
interface FormInstance<Values = Record<string, unknown>> {
|
|
1282
|
-
getFieldValue: (name:
|
|
1742
|
+
getFieldValue: (name: NamePath) => StoreValue;
|
|
1283
1743
|
getFieldsValue: () => Values;
|
|
1284
|
-
getFieldError: (name:
|
|
1285
|
-
isFieldsTouched: (nameList?:
|
|
1286
|
-
isFieldTouched: (name:
|
|
1287
|
-
isFieldValidating: (name:
|
|
1288
|
-
resetFields: (fields?:
|
|
1744
|
+
getFieldError: (name: NamePath) => string[];
|
|
1745
|
+
isFieldsTouched: (nameList?: NamePath[]) => boolean;
|
|
1746
|
+
isFieldTouched: (name: NamePath) => boolean;
|
|
1747
|
+
isFieldValidating: (name: NamePath) => boolean;
|
|
1748
|
+
resetFields: (fields?: NamePath[]) => void;
|
|
1289
1749
|
setFields: (fields: FieldData[]) => void;
|
|
1290
|
-
setFieldValue: (name:
|
|
1750
|
+
setFieldValue: (name: NamePath, value: unknown) => void;
|
|
1291
1751
|
setFieldsValue: (values: RecursivePartial<Values>) => void;
|
|
1292
|
-
validateFields: (nameList?:
|
|
1752
|
+
validateFields: (nameList?: NamePath[]) => Promise<Values>;
|
|
1293
1753
|
submit: () => void;
|
|
1294
1754
|
getInternalHooks: (secret: string) => InternalHooks | null;
|
|
1295
1755
|
}
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
interface ReducerAction {
|
|
1300
|
-
type: string;
|
|
1301
|
-
payload: unknown;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1756
|
+
/**
|
|
1757
|
+
* Form properties
|
|
1758
|
+
*/
|
|
1304
1759
|
interface FormProps<Values = Record<string, unknown>> {
|
|
1760
|
+
/** Form instance */
|
|
1305
1761
|
form?: FormInstance<Values>;
|
|
1762
|
+
/** Form layout */
|
|
1763
|
+
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
1764
|
+
/** Initial values for the form */
|
|
1306
1765
|
initialValues?: Store;
|
|
1766
|
+
/** Form items and other content */
|
|
1307
1767
|
children?: ReactNode;
|
|
1768
|
+
/** Callback triggered after successfully submitting the form and validation */
|
|
1308
1769
|
onFinish?: (values: Values) => void;
|
|
1770
|
+
/** Callback triggered after submitting the form and validation fails */
|
|
1309
1771
|
onFinishFailed?: (errorInfo: ValidateErrorEntity<Values>) => void;
|
|
1772
|
+
/** Callback triggered when any field value changes */
|
|
1310
1773
|
onValuesChange?: (changedValues: Store, values: Values) => void;
|
|
1774
|
+
/** Callback triggered when any field state changes */
|
|
1311
1775
|
onFieldsChange?: (changedFields: FieldData[], allFields: FieldData[]) => void;
|
|
1776
|
+
/** Custom root element class name */
|
|
1312
1777
|
className?: string;
|
|
1778
|
+
/** Custom root element style */
|
|
1313
1779
|
style?: React__default.CSSProperties;
|
|
1780
|
+
/** Semantic class names for internal elements */
|
|
1781
|
+
classNames?: {
|
|
1782
|
+
/** Class name for the form element */
|
|
1783
|
+
form?: string;
|
|
1784
|
+
/** Class name for the form items */
|
|
1785
|
+
item?: string;
|
|
1786
|
+
/** Class name for the labels */
|
|
1787
|
+
label?: string;
|
|
1788
|
+
/** Class name for the error messages */
|
|
1789
|
+
error?: string;
|
|
1790
|
+
};
|
|
1791
|
+
/** Semantic styles for internal elements */
|
|
1792
|
+
styles?: {
|
|
1793
|
+
/** Style for the form element */
|
|
1794
|
+
form?: React__default.CSSProperties;
|
|
1795
|
+
/** Style for the form items */
|
|
1796
|
+
item?: React__default.CSSProperties;
|
|
1797
|
+
/** Style for the labels */
|
|
1798
|
+
label?: React__default.CSSProperties;
|
|
1799
|
+
/** Style for the error messages */
|
|
1800
|
+
error?: React__default.CSSProperties;
|
|
1801
|
+
};
|
|
1314
1802
|
}
|
|
1315
|
-
|
|
1316
|
-
|
|
1803
|
+
/**
|
|
1804
|
+
* Form Item properties
|
|
1805
|
+
*/
|
|
1317
1806
|
interface FormItemProps {
|
|
1318
|
-
name
|
|
1319
|
-
|
|
1807
|
+
/** Field name */
|
|
1808
|
+
name?: NamePath;
|
|
1809
|
+
/** Label text or node */
|
|
1810
|
+
label?: React__default.ReactNode;
|
|
1811
|
+
/** Validation rules */
|
|
1320
1812
|
rules?: RuleItem[];
|
|
1813
|
+
/** Field components */
|
|
1321
1814
|
children: ReactElement;
|
|
1815
|
+
/** Validation trigger */
|
|
1322
1816
|
validateTrigger?: string | string[];
|
|
1817
|
+
/** Initial value of the field */
|
|
1323
1818
|
initialValue?: unknown;
|
|
1819
|
+
/** Custom root element class name */
|
|
1324
1820
|
className?: string;
|
|
1821
|
+
/** Custom root element style */
|
|
1325
1822
|
style?: React__default.CSSProperties;
|
|
1823
|
+
/** The prompt message. If not provided, use the validation result. */
|
|
1326
1824
|
help?: React__default.ReactNode;
|
|
1825
|
+
/** Related fields. If any related field changes, this field will be validated. */
|
|
1826
|
+
dependencies?: NamePath[];
|
|
1827
|
+
}
|
|
1828
|
+
type RecursivePartial<T> = {
|
|
1829
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object ? RecursivePartial<T[P]> : T[P];
|
|
1830
|
+
};
|
|
1831
|
+
interface ReducerAction {
|
|
1832
|
+
type: string;
|
|
1833
|
+
payload: unknown;
|
|
1327
1834
|
}
|
|
1835
|
+
|
|
1836
|
+
declare const Form$1: React__default.ForwardRefExoticComponent<FormProps<Record<string, unknown>> & React__default.RefAttributes<HTMLFormElement>>;
|
|
1837
|
+
|
|
1328
1838
|
declare const FormItem: React__default.FC<FormItemProps>;
|
|
1329
1839
|
|
|
1330
1840
|
declare const useForm: <Values extends Record<string, unknown> = Record<string, unknown>>(form?: FormInstance<Values>) => [FormInstance<Values>];
|
|
1331
1841
|
|
|
1332
|
-
declare const useWatch: <T = unknown>(name:
|
|
1842
|
+
declare const useWatch: <T = unknown>(name: NamePath, form?: FormInstance) => T;
|
|
1333
1843
|
|
|
1334
1844
|
type InternalFormType = typeof Form$1;
|
|
1335
1845
|
interface FormInterface extends InternalFormType {
|
|
@@ -1360,14 +1870,30 @@ interface TabsProps {
|
|
|
1360
1870
|
type?: 'line' | 'card' | 'editable-card';
|
|
1361
1871
|
/** Tab size */
|
|
1362
1872
|
size?: 'small' | 'default' | 'large';
|
|
1363
|
-
/**
|
|
1364
|
-
|
|
1365
|
-
/** Custom style */
|
|
1366
|
-
style?: React__default.CSSProperties;
|
|
1873
|
+
/** Tab bar position (controls layout separate from styling) */
|
|
1874
|
+
tabBarPosition?: 'top' | 'right' | 'bottom' | 'left';
|
|
1367
1875
|
/** Children (TabPane components) */
|
|
1368
1876
|
children?: React__default.ReactNode;
|
|
1369
1877
|
/** Callback when tab is edited */
|
|
1370
1878
|
onEdit?: (targetKey: string, action: 'add' | 'remove') => void;
|
|
1879
|
+
/** Custom class name */
|
|
1880
|
+
className?: string;
|
|
1881
|
+
/** Custom style */
|
|
1882
|
+
style?: React__default.CSSProperties;
|
|
1883
|
+
/** Granular styles */
|
|
1884
|
+
styles?: {
|
|
1885
|
+
root?: React__default.CSSProperties;
|
|
1886
|
+
nav?: React__default.CSSProperties;
|
|
1887
|
+
inkBar?: React__default.CSSProperties;
|
|
1888
|
+
content?: React__default.CSSProperties;
|
|
1889
|
+
};
|
|
1890
|
+
/** Granular class names */
|
|
1891
|
+
classNames?: {
|
|
1892
|
+
root?: string;
|
|
1893
|
+
nav?: string;
|
|
1894
|
+
inkBar?: string;
|
|
1895
|
+
content?: string;
|
|
1896
|
+
};
|
|
1371
1897
|
}
|
|
1372
1898
|
interface TabItem {
|
|
1373
1899
|
key: string;
|
|
@@ -1402,4 +1928,4 @@ type TabsComponent = typeof Tabs & {
|
|
|
1402
1928
|
};
|
|
1403
1929
|
declare const _default: TabsComponent;
|
|
1404
1930
|
|
|
1405
|
-
export { Button, type ButtonProps, ConfigProvider, type ConfigProviderProps, type DataNode, DatePicker, type DatePickerProps, type DateRangePickerProps, Dropdown, type DropdownProps, type FieldData, Form, type FormInstance, type FormItemProps, type FormProps, InputField, type InputFieldProps, InputNumber, type InputNumberProps, type ItemType, Menu, type MenuItemProps, type MenuProps, messageWithHook as Message, type MessageProps, ModalWithStatics as Modal, type ModalBaseProps as ModalProps, Pagination, type PaginationProps, Progress, type ProgressProps, Select, type SelectOption, type SelectProps, type SelectValue, Steps, type StepsProps, type TabItem, type TabPaneProps, _default as Tabs, type TabsProps, Tree, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, type ValidateErrorEntity };
|
|
1931
|
+
export { AutoComplete, type AutoCompleteOption, type AutoCompleteProps, Button, type ButtonProps, type ColumnType, ConfigProvider, type ConfigProviderProps, type DataNode, DatePicker, type DatePickerProps, type DateRangePickerProps, Dropdown, type DropdownProps, type FieldData, Form, type FormInstance, type FormItemProps, type FormProps, InputField, type InputFieldProps, InputNumber, type InputNumberProps, type ItemType, Menu, type MenuItemProps, type MenuProps, messageWithHook as Message, type MessageProps, ModalWithStatics as Modal, type ModalBaseProps as ModalProps, type NamePath, Pagination, type PaginationProps, Progress, type ProgressProps, type RowSelection, Select, type SelectOption, type SelectProps, type SelectValue, Steps, type StepsProps, type TabItem, type TabPaneProps, Table, type TableProps, _default as Tabs, type TabsProps, Tree, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, type ValidateErrorEntity };
|