@hsu-react/ui 0.0.2 → 0.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 -0
- package/es/components/ChainGraph/_components/SearchSelect/index.js +13 -10
- package/es/components/ChainGraph/_components/SearchSelect/index.module.less +8 -2
- package/es/components/DatePicker/index.module.less +1 -0
- package/es/components/FormItem/FormInput/FormPasswordStrength/index.js +2 -2
- package/es/components/FormItem/FormInput/FormPasswordStrength/index.module.less +12 -0
- package/es/components/Input/Range/index.module.less +4 -4
- package/es/components/Input/index.module.less +3 -0
- package/es/components/Select/_utils/getElementPosition.d.ts +6 -2
- package/es/components/Select/_utils/getElementPosition.js +8 -6
- package/es/components/Select/index.module.less +3 -0
- package/es/components/Slider/index.module.less +1 -0
- package/es/components/Switch/index.js +12 -8
- package/es/components/Switch/index.module.less +7 -0
- package/lib/components/ChainGraph/_components/SearchSelect/index.js +10 -7
- package/lib/components/ChainGraph/_components/SearchSelect/index.module.less +8 -2
- package/lib/components/DatePicker/index.module.less +1 -0
- package/lib/components/FormItem/FormInput/FormPasswordStrength/index.js +2 -1
- package/lib/components/FormItem/FormInput/FormPasswordStrength/index.module.less +12 -0
- package/lib/components/Input/Range/index.module.less +4 -4
- package/lib/components/Input/index.module.less +3 -0
- package/lib/components/Select/_utils/getElementPosition.d.ts +6 -2
- package/lib/components/Select/_utils/getElementPosition.js +8 -6
- package/lib/components/Select/index.module.less +3 -0
- package/lib/components/Slider/index.module.less +1 -0
- package/lib/components/Switch/index.js +8 -4
- package/lib/components/Switch/index.module.less +7 -0
- package/package.json +1 -1
- package/src/components/Button/index.md +18 -1
- package/src/components/ChainGraph/_components/SearchSelect/index.module.less +8 -2
- package/src/components/ChainGraph/_components/SearchSelect/index.tsx +18 -16
- package/src/components/ChainGraph/index.md +2 -1
- package/src/components/Chart/index.md +290 -17
- package/src/components/Chat/index.md +44 -1
- package/src/components/Checkbox/index.md +33 -1
- package/src/components/CodeMirror/index.md +1 -1
- package/src/components/Copy/index.md +1 -1
- package/src/components/DatePicker/index.md +41 -2
- package/src/components/DatePicker/index.module.less +1 -0
- package/src/components/Descriptions/index.md +1 -1
- package/src/components/Editor/index.md +1 -1
- package/src/components/FileCol/index.md +1 -1
- package/src/components/FilePreview/index.md +1 -1
- package/src/components/FlexFill/index.md +1 -1
- package/src/components/Form/index.md +88 -1
- package/src/components/FormItem/FormInput/FormPasswordStrength/index.module.less +12 -0
- package/src/components/FormItem/FormInput/FormPasswordStrength/index.tsx +2 -2
- package/src/components/FormItem/index.md +147 -92
- package/src/components/Icon/index.md +3 -1
- package/src/components/Input/Range/index.module.less +4 -4
- package/src/components/Input/index.md +115 -2
- package/src/components/Input/index.module.less +3 -0
- package/src/components/Markdown/index.md +3 -1
- package/src/components/Modal/index.md +1 -1
- package/src/components/Operate/index.md +1 -1
- package/src/components/Panel/index.md +68 -21
- package/src/components/Search/index.md +184 -9
- package/src/components/SecondConf/index.md +1 -1
- package/src/components/Select/_utils/getElementPosition.ts +8 -6
- package/src/components/Select/index.md +1 -1
- package/src/components/Select/index.module.less +3 -0
- package/src/components/Slider/index.md +1 -2
- package/src/components/Slider/index.module.less +1 -0
- package/src/components/Spreadsheet/index.md +1 -1
- package/src/components/Switch/index.md +1 -1
- package/src/components/Switch/index.module.less +7 -0
- package/src/components/Switch/index.tsx +14 -11
- package/src/components/TabBar/index.md +28 -11
- package/src/components/Table/index.md +1 -1
- package/src/components/Tags/index.md +1 -1
- package/src/components/TextEllipsis/index.md +1 -1
- package/src/components/Tree/index.md +1 -1
- package/src/components/Upload/index.md +1 -1
|
@@ -16,13 +16,9 @@ title: FormItem 表单项
|
|
|
16
16
|
import { FormItem } from "@hsu-react/ui";
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
## 基础用法
|
|
20
|
-
|
|
21
19
|
`FormItem` 通过 `type` 指定控件类型,业务参数统一放在 `componentProps` 中,需置于 antd `Form` 之内。下面按类型分别演示:
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
#### INPUT 输入框
|
|
21
|
+
## 输入框
|
|
26
22
|
|
|
27
23
|
```tsx
|
|
28
24
|
import React from "react";
|
|
@@ -30,13 +26,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
30
26
|
import { Form } from "antd";
|
|
31
27
|
|
|
32
28
|
export default () => (
|
|
33
|
-
<Form
|
|
34
|
-
<FormItem type="INPUT" name="input" label="输入框"
|
|
29
|
+
<Form>
|
|
30
|
+
<FormItem type="INPUT" name="input" label="输入框" />
|
|
35
31
|
</Form>
|
|
36
32
|
);
|
|
37
33
|
```
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
## 多行文本
|
|
40
36
|
|
|
41
37
|
```tsx
|
|
42
38
|
import React from "react";
|
|
@@ -44,13 +40,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
44
40
|
import { Form } from "antd";
|
|
45
41
|
|
|
46
42
|
export default () => (
|
|
47
|
-
<Form
|
|
43
|
+
<Form>
|
|
48
44
|
<FormItem type="TEXTAREA" name="textarea" label="多行文本" />
|
|
49
45
|
</Form>
|
|
50
46
|
);
|
|
51
47
|
```
|
|
52
48
|
|
|
53
|
-
|
|
49
|
+
## 密码
|
|
54
50
|
|
|
55
51
|
```tsx
|
|
56
52
|
import React from "react";
|
|
@@ -58,13 +54,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
58
54
|
import { Form } from "antd";
|
|
59
55
|
|
|
60
56
|
export default () => (
|
|
61
|
-
<Form
|
|
57
|
+
<Form>
|
|
62
58
|
<FormItem type="PASSWORD" name="password" label="密码" />
|
|
63
59
|
</Form>
|
|
64
60
|
);
|
|
65
61
|
```
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
## 密码强度
|
|
68
64
|
|
|
69
65
|
```tsx
|
|
70
66
|
import React from "react";
|
|
@@ -72,13 +68,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
72
68
|
import { Form } from "antd";
|
|
73
69
|
|
|
74
70
|
export default () => (
|
|
75
|
-
<Form
|
|
71
|
+
<Form>
|
|
76
72
|
<FormItem type="PASSWORDSTRENGTH" name="pwd" label="密码强度" />
|
|
77
73
|
</Form>
|
|
78
74
|
);
|
|
79
75
|
```
|
|
80
76
|
|
|
81
|
-
|
|
77
|
+
## 数字
|
|
82
78
|
|
|
83
79
|
```tsx
|
|
84
80
|
import React from "react";
|
|
@@ -86,13 +82,18 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
86
82
|
import { Form } from "antd";
|
|
87
83
|
|
|
88
84
|
export default () => (
|
|
89
|
-
<Form
|
|
90
|
-
<FormItem
|
|
85
|
+
<Form>
|
|
86
|
+
<FormItem
|
|
87
|
+
type="INPUTNUMBER"
|
|
88
|
+
name="number"
|
|
89
|
+
label="数字"
|
|
90
|
+
componentProps={{ min: 0, max: 100 }}
|
|
91
|
+
/>
|
|
91
92
|
</Form>
|
|
92
93
|
);
|
|
93
94
|
```
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
## 范围输入
|
|
96
97
|
|
|
97
98
|
```tsx
|
|
98
99
|
import React from "react";
|
|
@@ -100,13 +101,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
100
101
|
import { Form } from "antd";
|
|
101
102
|
|
|
102
103
|
export default () => (
|
|
103
|
-
<Form
|
|
104
|
+
<Form>
|
|
104
105
|
<FormItem type="RANGEINPUT" name="range" label="范围输入" />
|
|
105
106
|
</Form>
|
|
106
107
|
);
|
|
107
108
|
```
|
|
108
109
|
|
|
109
|
-
|
|
110
|
+
## 滑块
|
|
110
111
|
|
|
111
112
|
```tsx
|
|
112
113
|
import React from "react";
|
|
@@ -114,13 +115,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
114
115
|
import { Form } from "antd";
|
|
115
116
|
|
|
116
117
|
export default () => (
|
|
117
|
-
<Form
|
|
118
|
-
<FormItem type="SLIDER" name="slider" label="滑块" />
|
|
118
|
+
<Form>
|
|
119
|
+
<FormItem type="SLIDER" name="slider" label="滑块" initialValue={30} />
|
|
119
120
|
</Form>
|
|
120
121
|
);
|
|
121
122
|
```
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
## 只读文本
|
|
124
125
|
|
|
125
126
|
```tsx
|
|
126
127
|
import React from "react";
|
|
@@ -128,13 +129,18 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
128
129
|
import { Form } from "antd";
|
|
129
130
|
|
|
130
131
|
export default () => (
|
|
131
|
-
<Form
|
|
132
|
-
<FormItem
|
|
132
|
+
<Form>
|
|
133
|
+
<FormItem
|
|
134
|
+
type="TEXT"
|
|
135
|
+
name="text"
|
|
136
|
+
label="只读文本"
|
|
137
|
+
initialValue="只读文本内容"
|
|
138
|
+
/>
|
|
133
139
|
</Form>
|
|
134
140
|
);
|
|
135
141
|
```
|
|
136
142
|
|
|
137
|
-
|
|
143
|
+
## 自定义控件
|
|
138
144
|
|
|
139
145
|
```tsx
|
|
140
146
|
import React from "react";
|
|
@@ -142,15 +148,18 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
142
148
|
import { Form, Input } from "antd";
|
|
143
149
|
|
|
144
150
|
export default () => (
|
|
145
|
-
<Form
|
|
146
|
-
<FormItem
|
|
151
|
+
<Form>
|
|
152
|
+
<FormItem
|
|
153
|
+
type="AUTO"
|
|
154
|
+
name="auto"
|
|
155
|
+
label="自定义控件"
|
|
156
|
+
element={<Input placeholder="任意自定义控件" />}
|
|
157
|
+
/>
|
|
147
158
|
</Form>
|
|
148
159
|
);
|
|
149
160
|
```
|
|
150
161
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
#### SELECT 选择器
|
|
162
|
+
## 下拉选择
|
|
154
163
|
|
|
155
164
|
```tsx
|
|
156
165
|
import React from "react";
|
|
@@ -164,13 +173,18 @@ const options = [
|
|
|
164
173
|
];
|
|
165
174
|
|
|
166
175
|
export default () => (
|
|
167
|
-
<Form
|
|
168
|
-
<FormItem
|
|
176
|
+
<Form>
|
|
177
|
+
<FormItem
|
|
178
|
+
type="SELECT"
|
|
179
|
+
name="select"
|
|
180
|
+
label="选择器"
|
|
181
|
+
componentProps={{ options }}
|
|
182
|
+
/>
|
|
169
183
|
</Form>
|
|
170
184
|
);
|
|
171
185
|
```
|
|
172
186
|
|
|
173
|
-
|
|
187
|
+
## 自动完成
|
|
174
188
|
|
|
175
189
|
```tsx
|
|
176
190
|
import React from "react";
|
|
@@ -184,13 +198,18 @@ const options = [
|
|
|
184
198
|
];
|
|
185
199
|
|
|
186
200
|
export default () => (
|
|
187
|
-
<Form
|
|
188
|
-
<FormItem
|
|
201
|
+
<Form>
|
|
202
|
+
<FormItem
|
|
203
|
+
type="AUTOCOMPLETESELECT"
|
|
204
|
+
name="ac"
|
|
205
|
+
label="自动完成"
|
|
206
|
+
componentProps={{ options }}
|
|
207
|
+
/>
|
|
189
208
|
</Form>
|
|
190
209
|
);
|
|
191
210
|
```
|
|
192
211
|
|
|
193
|
-
|
|
212
|
+
## 树选择
|
|
194
213
|
|
|
195
214
|
```tsx
|
|
196
215
|
import React from "react";
|
|
@@ -210,13 +229,18 @@ const treeData = [
|
|
|
210
229
|
];
|
|
211
230
|
|
|
212
231
|
export default () => (
|
|
213
|
-
<Form
|
|
214
|
-
<FormItem
|
|
232
|
+
<Form>
|
|
233
|
+
<FormItem
|
|
234
|
+
type="TREESELECT"
|
|
235
|
+
name="treeSelect"
|
|
236
|
+
label="树选择"
|
|
237
|
+
componentProps={{ treeData }}
|
|
238
|
+
/>
|
|
215
239
|
</Form>
|
|
216
240
|
);
|
|
217
241
|
```
|
|
218
242
|
|
|
219
|
-
|
|
243
|
+
## 图标选择
|
|
220
244
|
|
|
221
245
|
```tsx
|
|
222
246
|
import React from "react";
|
|
@@ -224,13 +248,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
224
248
|
import { Form } from "antd";
|
|
225
249
|
|
|
226
250
|
export default () => (
|
|
227
|
-
<Form
|
|
251
|
+
<Form>
|
|
228
252
|
<FormItem type="ICONSELECT" name="icon" label="图标选择" />
|
|
229
253
|
</Form>
|
|
230
254
|
);
|
|
231
255
|
```
|
|
232
256
|
|
|
233
|
-
|
|
257
|
+
## 分段控制
|
|
234
258
|
|
|
235
259
|
```tsx
|
|
236
260
|
import React from "react";
|
|
@@ -244,13 +268,18 @@ const options = [
|
|
|
244
268
|
];
|
|
245
269
|
|
|
246
270
|
export default () => (
|
|
247
|
-
<Form
|
|
248
|
-
<FormItem
|
|
271
|
+
<Form>
|
|
272
|
+
<FormItem
|
|
273
|
+
type="SEGMENTED"
|
|
274
|
+
name="segmented"
|
|
275
|
+
label="分段控制"
|
|
276
|
+
componentProps={{ options }}
|
|
277
|
+
/>
|
|
249
278
|
</Form>
|
|
250
279
|
);
|
|
251
280
|
```
|
|
252
281
|
|
|
253
|
-
|
|
282
|
+
## 单选
|
|
254
283
|
|
|
255
284
|
```tsx
|
|
256
285
|
import React from "react";
|
|
@@ -264,13 +293,18 @@ const options = [
|
|
|
264
293
|
];
|
|
265
294
|
|
|
266
295
|
export default () => (
|
|
267
|
-
<Form
|
|
268
|
-
<FormItem
|
|
296
|
+
<Form>
|
|
297
|
+
<FormItem
|
|
298
|
+
type="RADIO"
|
|
299
|
+
name="radio"
|
|
300
|
+
label="单选"
|
|
301
|
+
componentProps={{ options }}
|
|
302
|
+
/>
|
|
269
303
|
</Form>
|
|
270
304
|
);
|
|
271
305
|
```
|
|
272
306
|
|
|
273
|
-
|
|
307
|
+
## 单个多选框
|
|
274
308
|
|
|
275
309
|
```tsx
|
|
276
310
|
import React from "react";
|
|
@@ -278,13 +312,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
278
312
|
import { Form } from "antd";
|
|
279
313
|
|
|
280
314
|
export default () => (
|
|
281
|
-
<Form
|
|
315
|
+
<Form>
|
|
282
316
|
<FormItem type="CHECKBOX" name="checkbox" label="多选框" />
|
|
283
317
|
</Form>
|
|
284
318
|
);
|
|
285
319
|
```
|
|
286
320
|
|
|
287
|
-
|
|
321
|
+
## 多选组
|
|
288
322
|
|
|
289
323
|
```tsx
|
|
290
324
|
import React from "react";
|
|
@@ -298,13 +332,18 @@ const options = [
|
|
|
298
332
|
];
|
|
299
333
|
|
|
300
334
|
export default () => (
|
|
301
|
-
<Form
|
|
302
|
-
<FormItem
|
|
335
|
+
<Form>
|
|
336
|
+
<FormItem
|
|
337
|
+
type="CHECKBOXGROUP"
|
|
338
|
+
name="checkboxGroup"
|
|
339
|
+
label="多选组"
|
|
340
|
+
componentProps={{ options }}
|
|
341
|
+
/>
|
|
303
342
|
</Form>
|
|
304
343
|
);
|
|
305
344
|
```
|
|
306
345
|
|
|
307
|
-
|
|
346
|
+
## 开关
|
|
308
347
|
|
|
309
348
|
```tsx
|
|
310
349
|
import React from "react";
|
|
@@ -312,13 +351,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
312
351
|
import { Form } from "antd";
|
|
313
352
|
|
|
314
353
|
export default () => (
|
|
315
|
-
<Form
|
|
354
|
+
<Form>
|
|
316
355
|
<FormItem type="SWITCH" name="switch" label="开关" />
|
|
317
356
|
</Form>
|
|
318
357
|
);
|
|
319
358
|
```
|
|
320
359
|
|
|
321
|
-
|
|
360
|
+
## 日期选择
|
|
322
361
|
|
|
323
362
|
```tsx
|
|
324
363
|
import React from "react";
|
|
@@ -326,13 +365,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
326
365
|
import { Form } from "antd";
|
|
327
366
|
|
|
328
367
|
export default () => (
|
|
329
|
-
<Form
|
|
368
|
+
<Form>
|
|
330
369
|
<FormItem type="DATEPICKER" name="date" label="日期" />
|
|
331
370
|
</Form>
|
|
332
371
|
);
|
|
333
372
|
```
|
|
334
373
|
|
|
335
|
-
|
|
374
|
+
## 日期范围
|
|
336
375
|
|
|
337
376
|
```tsx
|
|
338
377
|
import React from "react";
|
|
@@ -340,13 +379,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
340
379
|
import { Form } from "antd";
|
|
341
380
|
|
|
342
381
|
export default () => (
|
|
343
|
-
<Form
|
|
382
|
+
<Form>
|
|
344
383
|
<FormItem type="RANGEPICKER" name="dateRange" label="日期范围" />
|
|
345
384
|
</Form>
|
|
346
385
|
);
|
|
347
386
|
```
|
|
348
387
|
|
|
349
|
-
|
|
388
|
+
## 步进日期
|
|
350
389
|
|
|
351
390
|
```tsx
|
|
352
391
|
import React from "react";
|
|
@@ -354,13 +393,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
354
393
|
import { Form } from "antd";
|
|
355
394
|
|
|
356
395
|
export default () => (
|
|
357
|
-
<Form
|
|
396
|
+
<Form>
|
|
358
397
|
<FormItem type="STEPPICKER" name="step" label="步进日期" />
|
|
359
398
|
</Form>
|
|
360
399
|
);
|
|
361
400
|
```
|
|
362
401
|
|
|
363
|
-
|
|
402
|
+
## 树形控件
|
|
364
403
|
|
|
365
404
|
```tsx
|
|
366
405
|
import React from "react";
|
|
@@ -380,15 +419,18 @@ const treeData = [
|
|
|
380
419
|
];
|
|
381
420
|
|
|
382
421
|
export default () => (
|
|
383
|
-
<Form
|
|
384
|
-
<FormItem
|
|
422
|
+
<Form>
|
|
423
|
+
<FormItem
|
|
424
|
+
type="TREE"
|
|
425
|
+
name="tree"
|
|
426
|
+
label="树形控件"
|
|
427
|
+
componentProps={{ treeData }}
|
|
428
|
+
/>
|
|
385
429
|
</Form>
|
|
386
430
|
);
|
|
387
431
|
```
|
|
388
432
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
#### EDITOR 富文本
|
|
433
|
+
## 富文本
|
|
392
434
|
|
|
393
435
|
```tsx
|
|
394
436
|
import React from "react";
|
|
@@ -396,13 +438,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
396
438
|
import { Form } from "antd";
|
|
397
439
|
|
|
398
440
|
export default () => (
|
|
399
|
-
<Form
|
|
441
|
+
<Form>
|
|
400
442
|
<FormItem type="EDITOR" name="editor" label="富文本" />
|
|
401
443
|
</Form>
|
|
402
444
|
);
|
|
403
445
|
```
|
|
404
446
|
|
|
405
|
-
|
|
447
|
+
## 代码
|
|
406
448
|
|
|
407
449
|
```tsx
|
|
408
450
|
import React from "react";
|
|
@@ -410,15 +452,18 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
410
452
|
import { Form } from "antd";
|
|
411
453
|
|
|
412
454
|
export default () => (
|
|
413
|
-
<Form
|
|
414
|
-
<FormItem
|
|
455
|
+
<Form>
|
|
456
|
+
<FormItem
|
|
457
|
+
type="CODEMIRROR"
|
|
458
|
+
name="code"
|
|
459
|
+
label="代码"
|
|
460
|
+
componentProps={{ language: "json" }}
|
|
461
|
+
/>
|
|
415
462
|
</Form>
|
|
416
463
|
);
|
|
417
464
|
```
|
|
418
465
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
#### FILE 文件上传
|
|
466
|
+
## 文件上传
|
|
422
467
|
|
|
423
468
|
```tsx
|
|
424
469
|
import React from "react";
|
|
@@ -426,13 +471,18 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
426
471
|
import { Form } from "antd";
|
|
427
472
|
|
|
428
473
|
export default () => (
|
|
429
|
-
<Form
|
|
430
|
-
<FormItem
|
|
474
|
+
<Form>
|
|
475
|
+
<FormItem
|
|
476
|
+
type="FILE"
|
|
477
|
+
name="file"
|
|
478
|
+
label="文件上传"
|
|
479
|
+
componentProps={{ action: "/api/upload" }}
|
|
480
|
+
/>
|
|
431
481
|
</Form>
|
|
432
482
|
);
|
|
433
483
|
```
|
|
434
484
|
|
|
435
|
-
|
|
485
|
+
## 图片上传
|
|
436
486
|
|
|
437
487
|
```tsx
|
|
438
488
|
import React from "react";
|
|
@@ -440,8 +490,13 @@ import { FormItem } from "@hsu-react/ui";
|
|
|
440
490
|
import { Form } from "antd";
|
|
441
491
|
|
|
442
492
|
export default () => (
|
|
443
|
-
<Form
|
|
444
|
-
<FormItem
|
|
493
|
+
<Form>
|
|
494
|
+
<FormItem
|
|
495
|
+
type="IMAGEFILE"
|
|
496
|
+
name="image"
|
|
497
|
+
label="图片上传"
|
|
498
|
+
componentProps={{ action: "/api/upload" }}
|
|
499
|
+
/>
|
|
445
500
|
</Form>
|
|
446
501
|
);
|
|
447
502
|
```
|
|
@@ -450,21 +505,21 @@ export default () => (
|
|
|
450
505
|
|
|
451
506
|
`FormItemProps` 是按 `type` 区分的联合类型:`{ type } & BaseFormItem & 对应控件 Props`。除 `type`、`visible` 外,其余通用属性继承自 `ItemContainerProps`(扩展自 antd `FormItemProps`),各控件的专有参数通过 `componentProps` 传入。
|
|
452
507
|
|
|
453
|
-
| 属性
|
|
454
|
-
|
|
|
455
|
-
| type
|
|
456
|
-
| visible
|
|
457
|
-
| name
|
|
458
|
-
| label
|
|
459
|
-
| componentProps | 透传给底层控件的属性(如 `options`、`placeholder` 等) | 对应控件 Props
|
|
460
|
-
| labelWidth
|
|
461
|
-
| layout
|
|
462
|
-
| requiredMsg
|
|
463
|
-
| tips
|
|
464
|
-
| hasPermi
|
|
465
|
-
| disabled
|
|
466
|
-
| en
|
|
467
|
-
| hideLabel
|
|
508
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
509
|
+
| -------------- | ------------------------------------------------------ | ---------------------------- | -------------- |
|
|
510
|
+
| type | 表单项类型,决定渲染的控件 | `FormItemType` | - |
|
|
511
|
+
| visible | 是否渲染该项,为 `false` 时不渲染 | `boolean` | `true` |
|
|
512
|
+
| name | 字段名(antd Form 字段) | `NamePath` | - |
|
|
513
|
+
| label | 标签内容 | `ReactNode` | - |
|
|
514
|
+
| componentProps | 透传给底层控件的属性(如 `options`、`placeholder` 等) | 对应控件 Props | - |
|
|
515
|
+
| labelWidth | 标签宽度 | `string \| number` | - |
|
|
516
|
+
| layout | 标签与控件的排列方向 | `'horizontal' \| 'vertical'` | `'horizontal'` |
|
|
517
|
+
| requiredMsg | 必填校验提示文案 | `string` | - |
|
|
518
|
+
| tips | 标签旁的提示气泡(antd `TooltipProps` + 图标配置) | `TipsProps & TooltipProps` | - |
|
|
519
|
+
| hasPermi | 权限码;无权限时不渲染 | `string[]` | - |
|
|
520
|
+
| disabled | 是否禁用 | `boolean` | - |
|
|
521
|
+
| en | 是否使用英文占位文案 | `boolean` | - |
|
|
522
|
+
| hideLabel | 是否隐藏标签 | `boolean` | `false` |
|
|
468
523
|
|
|
469
524
|
`type` 可选值(`FormItemType`):
|
|
470
525
|
|
|
@@ -16,7 +16,7 @@ title: Icon 图标
|
|
|
16
16
|
import { Icon } from "@hsu-react/ui";
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## antd 图标
|
|
20
20
|
|
|
21
21
|
antd 图标名(驼峰):
|
|
22
22
|
|
|
@@ -34,6 +34,8 @@ export default () => (
|
|
|
34
34
|
);
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
## iconify 图标
|
|
38
|
+
|
|
37
39
|
iconify 图标名(`集合:名称`,需先注册对应图标集):
|
|
38
40
|
|
|
39
41
|
```tsx
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
.RangeInput {
|
|
32
32
|
display: flex;
|
|
33
33
|
align-items: center;
|
|
34
|
+
column-gap: 5px;
|
|
34
35
|
|
|
35
36
|
width: 100%;
|
|
36
37
|
height: 100%;
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
transition: border-color 0.3s, box-shadow 0.3s;
|
|
39
|
+
transition:
|
|
40
|
+
border-color 0.3s,
|
|
41
|
+
box-shadow 0.3s;
|
|
42
42
|
|
|
43
43
|
[class*="antdInput-"] {
|
|
44
44
|
border: none !important;
|