@faasjs/ant-design 0.0.2-beta.362 → 0.0.2-beta.366
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 +91 -63
- package/dist/index.d.ts +39 -0
- package/dist/index.js +59 -48
- package/dist/index.mjs +59 -48
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -47,42 +47,42 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
|
|
|
47
47
|
|
|
48
48
|
### Type aliases
|
|
49
49
|
|
|
50
|
-
- [BaseItemProps](
|
|
51
|
-
- [BaseOption](
|
|
52
|
-
- [BlankProps](
|
|
53
|
-
- [DescriptionItemProps](
|
|
54
|
-
- [DescriptionProps](
|
|
55
|
-
- [DrawerProps](
|
|
56
|
-
- [ExtendDescriptionItemProps](
|
|
57
|
-
- [ExtendDescriptionTypeProps](
|
|
58
|
-
- [ExtendFormItemProps](
|
|
59
|
-
- [ExtendFormTypeProps](
|
|
60
|
-
- [ExtendTableItemProps](
|
|
61
|
-
- [ExtendTableTypeProps](
|
|
62
|
-
- [FaasItemProps](
|
|
63
|
-
- [FaasItemType](
|
|
64
|
-
- [FaasItemTypeValue](
|
|
65
|
-
- [FaasState](
|
|
66
|
-
- [FormItemProps](
|
|
67
|
-
- [FormProps](
|
|
68
|
-
- [RoutesProps](
|
|
69
|
-
- [TableItemProps](
|
|
70
|
-
- [TableProps](
|
|
71
|
-
- [TitleProps](
|
|
50
|
+
- [BaseItemProps](#baseitemprops)
|
|
51
|
+
- [BaseOption](#baseoption)
|
|
52
|
+
- [BlankProps](#blankprops)
|
|
53
|
+
- [DescriptionItemProps](#descriptionitemprops)
|
|
54
|
+
- [DescriptionProps](#descriptionprops)
|
|
55
|
+
- [DrawerProps](#drawerprops)
|
|
56
|
+
- [ExtendDescriptionItemProps](#extenddescriptionitemprops)
|
|
57
|
+
- [ExtendDescriptionTypeProps](#extenddescriptiontypeprops)
|
|
58
|
+
- [ExtendFormItemProps](#extendformitemprops)
|
|
59
|
+
- [ExtendFormTypeProps](#extendformtypeprops)
|
|
60
|
+
- [ExtendTableItemProps](#extendtableitemprops)
|
|
61
|
+
- [ExtendTableTypeProps](#extendtabletypeprops)
|
|
62
|
+
- [FaasItemProps](#faasitemprops)
|
|
63
|
+
- [FaasItemType](#faasitemtype)
|
|
64
|
+
- [FaasItemTypeValue](#faasitemtypevalue)
|
|
65
|
+
- [FaasState](#faasstate)
|
|
66
|
+
- [FormItemProps](#formitemprops)
|
|
67
|
+
- [FormProps](#formprops)
|
|
68
|
+
- [RoutesProps](#routesprops)
|
|
69
|
+
- [TableItemProps](#tableitemprops)
|
|
70
|
+
- [TableProps](#tableprops)
|
|
71
|
+
- [TitleProps](#titleprops)
|
|
72
72
|
|
|
73
73
|
### Functions
|
|
74
74
|
|
|
75
|
-
- [Blank](
|
|
76
|
-
- [Config](
|
|
77
|
-
- [Description](
|
|
78
|
-
- [Form](
|
|
79
|
-
- [FormItem](
|
|
80
|
-
- [Routes](
|
|
81
|
-
- [Table](
|
|
82
|
-
- [Title](
|
|
83
|
-
- [transferOptions](
|
|
84
|
-
- [useDrawer](
|
|
85
|
-
- [useFaasState](
|
|
75
|
+
- [Blank](#blank)
|
|
76
|
+
- [Config](#config)
|
|
77
|
+
- [Description](#description)
|
|
78
|
+
- [Form](#form)
|
|
79
|
+
- [FormItem](#formitem)
|
|
80
|
+
- [Routes](#routes)
|
|
81
|
+
- [Table](#table)
|
|
82
|
+
- [Title](#title)
|
|
83
|
+
- [transferOptions](#transferoptions)
|
|
84
|
+
- [useDrawer](#usedrawer)
|
|
85
|
+
- [useFaasState](#usefaasstate)
|
|
86
86
|
|
|
87
87
|
## Type aliases
|
|
88
88
|
|
|
@@ -95,7 +95,7 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
|
|
|
95
95
|
| Name | Type |
|
|
96
96
|
| :------ | :------ |
|
|
97
97
|
| `id` | `string` |
|
|
98
|
-
| `options?` | [`BaseOption`](
|
|
98
|
+
| `options?` | [`BaseOption`](#baseoption)[] |
|
|
99
99
|
| `title?` | `string` |
|
|
100
100
|
|
|
101
101
|
___
|
|
@@ -121,7 +121,7 @@ ___
|
|
|
121
121
|
|
|
122
122
|
### DescriptionItemProps
|
|
123
123
|
|
|
124
|
-
Ƭ **DescriptionItemProps**<`T`\>: { `children?`: `JSX.Element` ; `render?`: (`value`: `T`, `values`: `any`) => `string` \| `number` \| `boolean` \| `Element` } & [`FaasItemProps`](
|
|
124
|
+
Ƭ **DescriptionItemProps**<`T`\>: { `children?`: `JSX.Element` ; `render?`: (`value`: `T`, `values`: `any`) => `string` \| `number` \| `boolean` \| `Element` } & [`FaasItemProps`](#faasitemprops)
|
|
125
125
|
|
|
126
126
|
#### Type parameters
|
|
127
127
|
|
|
@@ -133,7 +133,7 @@ ___
|
|
|
133
133
|
|
|
134
134
|
### DescriptionProps
|
|
135
135
|
|
|
136
|
-
Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { [key: string]: [`ExtendDescriptionTypeProps`](
|
|
136
|
+
Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { [key: string]: [`ExtendDescriptionTypeProps`](#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](#descriptionitemprops) \| `ExtendItemProps`)[] } & `DescriptionsProps`
|
|
137
137
|
|
|
138
138
|
#### Type parameters
|
|
139
139
|
|
|
@@ -152,7 +152,7 @@ ___
|
|
|
152
152
|
|
|
153
153
|
### ExtendDescriptionItemProps
|
|
154
154
|
|
|
155
|
-
Ƭ **ExtendDescriptionItemProps**: [`BaseItemProps`](
|
|
155
|
+
Ƭ **ExtendDescriptionItemProps**: [`BaseItemProps`](#baseitemprops)
|
|
156
156
|
|
|
157
157
|
___
|
|
158
158
|
|
|
@@ -171,7 +171,7 @@ ___
|
|
|
171
171
|
|
|
172
172
|
### ExtendFormItemProps
|
|
173
173
|
|
|
174
|
-
Ƭ **ExtendFormItemProps**: [`BaseItemProps`](
|
|
174
|
+
Ƭ **ExtendFormItemProps**: [`BaseItemProps`](#baseitemprops) & `AntdFormItemProps`
|
|
175
175
|
|
|
176
176
|
___
|
|
177
177
|
|
|
@@ -189,7 +189,7 @@ ___
|
|
|
189
189
|
|
|
190
190
|
### ExtendTableItemProps
|
|
191
191
|
|
|
192
|
-
Ƭ **ExtendTableItemProps**<`T`\>: [`BaseItemProps`](
|
|
192
|
+
Ƭ **ExtendTableItemProps**<`T`\>: [`BaseItemProps`](#baseitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
|
|
193
193
|
|
|
194
194
|
#### Type parameters
|
|
195
195
|
|
|
@@ -214,7 +214,7 @@ ___
|
|
|
214
214
|
|
|
215
215
|
### FaasItemProps
|
|
216
216
|
|
|
217
|
-
Ƭ **FaasItemProps**: [`BaseItemProps`](
|
|
217
|
+
Ƭ **FaasItemProps**: [`BaseItemProps`](#baseitemprops) & { `type?`: [`FaasItemType`](#faasitemtype) }
|
|
218
218
|
|
|
219
219
|
___
|
|
220
220
|
|
|
@@ -248,15 +248,15 @@ ___
|
|
|
248
248
|
|
|
249
249
|
| Name | Type |
|
|
250
250
|
| :------ | :------ |
|
|
251
|
-
| `Blank` | `
|
|
251
|
+
| `Blank` | { `text`: `string` } |
|
|
252
252
|
| `Blank.text` | `string` |
|
|
253
|
-
| `Form` | `
|
|
254
|
-
| `Form.submit` | `
|
|
253
|
+
| `Form` | { `submit`: { `text`: `string` } } |
|
|
254
|
+
| `Form.submit` | { `text`: `string` } |
|
|
255
255
|
| `Form.submit.text` | `string` |
|
|
256
|
-
| `Title` | `
|
|
256
|
+
| `Title` | { `separator`: `string` ; `suffix`: `string` } |
|
|
257
257
|
| `Title.separator` | `string` |
|
|
258
258
|
| `Title.suffix` | `string` |
|
|
259
|
-
| `common` | `
|
|
259
|
+
| `common` | { `all`: `string` ; `blank`: `string` ; `pageNotFound`: `string` ; `submit`: `string` } |
|
|
260
260
|
| `common.all` | `string` |
|
|
261
261
|
| `common.blank` | `string` |
|
|
262
262
|
| `common.pageNotFound` | `string` |
|
|
@@ -266,7 +266,7 @@ ___
|
|
|
266
266
|
|
|
267
267
|
### FormItemProps
|
|
268
268
|
|
|
269
|
-
Ƭ **FormItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](
|
|
269
|
+
Ƭ **FormItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](#extendformtypeprops); } ; `label?`: `string` \| ``false`` ; `rules?`: `RuleObject`[] ; `render?`: () => `Element` } & `FormItemInputProps`<`T`\> & [`FaasItemProps`](#faasitemprops) & `AntdFormItemProps`<`T`\>
|
|
270
270
|
|
|
271
271
|
#### Type parameters
|
|
272
272
|
|
|
@@ -278,7 +278,7 @@ ___
|
|
|
278
278
|
|
|
279
279
|
### FormProps
|
|
280
280
|
|
|
281
|
-
Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](
|
|
281
|
+
Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `extendTypes?`: { [type: string]: [`ExtendFormTypeProps`](#extendformtypeprops); } ; `items?`: ([`FormItemProps`](#formitemprops) \| `ExtendItemProps`)[] ; `submit?`: ``false`` \| { `text?`: `string` } } & `AntdFormProps`<`Values`\>
|
|
282
282
|
|
|
283
283
|
#### Type parameters
|
|
284
284
|
|
|
@@ -305,7 +305,7 @@ ___
|
|
|
305
305
|
|
|
306
306
|
### TableItemProps
|
|
307
307
|
|
|
308
|
-
Ƭ **TableItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` } & [`FaasItemProps`](
|
|
308
|
+
Ƭ **TableItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` } & [`FaasItemProps`](#faasitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
|
|
309
309
|
|
|
310
310
|
#### Type parameters
|
|
311
311
|
|
|
@@ -317,7 +317,7 @@ ___
|
|
|
317
317
|
|
|
318
318
|
### TableProps
|
|
319
319
|
|
|
320
|
-
Ƭ **TableProps**<`T`, `ExtendTypes`\>: { `extendTypes?`: { [key: string]: [`ExtendTableTypeProps`](
|
|
320
|
+
Ƭ **TableProps**<`T`, `ExtendTypes`\>: { `extendTypes?`: { [key: string]: [`ExtendTableTypeProps`](#extendtabletypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`TableItemProps`](#tableitemprops) \| `ExtendTypes` & [`ExtendTableItemProps`](#extendtableitemprops))[] ; `onChange?`: (`pagination`: `TablePaginationConfig`, `filters`: `Record`<`string`, `FilterValue`\>, `sorter`: `SorterResult`<`T`\> \| `SorterResult`<`T`\>[], `extra`: `TableCurrentDataSource`<`T`\>) => { `extra`: `TableCurrentDataSource`<`T`\> ; `filters`: `Record`<`string`, `FilterValue` \| ``null``\> ; `pagination`: `TablePaginationConfig` ; `sorter`: `SorterResult`<`T`\> \| `SorterResult`<`T`\>[] } } & `AntdTableProps`<`T`\>
|
|
321
321
|
|
|
322
322
|
#### Type parameters
|
|
323
323
|
|
|
@@ -346,33 +346,49 @@ ___
|
|
|
346
346
|
|
|
347
347
|
▸ **Blank**(`options?`): `any`
|
|
348
348
|
|
|
349
|
+
If value is undefined or null, return text, otherwise return value.
|
|
350
|
+
|
|
349
351
|
#### Parameters
|
|
350
352
|
|
|
351
353
|
| Name | Type |
|
|
352
354
|
| :------ | :------ |
|
|
353
|
-
| `options?` | [`BlankProps`](
|
|
355
|
+
| `options?` | [`BlankProps`](#blankprops) |
|
|
354
356
|
|
|
355
357
|
#### Returns
|
|
356
358
|
|
|
357
359
|
`any`
|
|
358
360
|
|
|
361
|
+
```ts
|
|
362
|
+
<Blank value={undefined} text="Empty" />
|
|
363
|
+
```
|
|
364
|
+
|
|
359
365
|
___
|
|
360
366
|
|
|
361
367
|
### Config
|
|
362
368
|
|
|
363
369
|
▸ **Config**(`props`): `JSX.Element`
|
|
364
370
|
|
|
371
|
+
Config for all @faasjs/ant-design components.
|
|
372
|
+
|
|
365
373
|
#### Parameters
|
|
366
374
|
|
|
367
375
|
| Name | Type |
|
|
368
376
|
| :------ | :------ |
|
|
369
377
|
| `props` | `Object` |
|
|
370
|
-
| `props.config` | `Partial`<[`FaasState`](
|
|
378
|
+
| `props.config` | `Partial`<[`FaasState`](#faasstate)\> |
|
|
371
379
|
|
|
372
380
|
#### Returns
|
|
373
381
|
|
|
374
382
|
`JSX.Element`
|
|
375
383
|
|
|
384
|
+
```ts
|
|
385
|
+
<Config config={{
|
|
386
|
+
common: {
|
|
387
|
+
blank: '空',
|
|
388
|
+
},
|
|
389
|
+
}} />
|
|
390
|
+
```
|
|
391
|
+
|
|
376
392
|
___
|
|
377
393
|
|
|
378
394
|
### Description
|
|
@@ -389,7 +405,7 @@ ___
|
|
|
389
405
|
|
|
390
406
|
| Name | Type |
|
|
391
407
|
| :------ | :------ |
|
|
392
|
-
| `props` | [`DescriptionProps`](
|
|
408
|
+
| `props` | [`DescriptionProps`](#descriptionprops)<`T`, `any`\> |
|
|
393
409
|
|
|
394
410
|
#### Returns
|
|
395
411
|
|
|
@@ -411,7 +427,7 @@ ___
|
|
|
411
427
|
|
|
412
428
|
| Name | Type |
|
|
413
429
|
| :------ | :------ |
|
|
414
|
-
| `props` | [`FormProps`](
|
|
430
|
+
| `props` | [`FormProps`](#formprops)<`Values`, `any`\> |
|
|
415
431
|
|
|
416
432
|
#### Returns
|
|
417
433
|
|
|
@@ -423,6 +439,18 @@ ___
|
|
|
423
439
|
|
|
424
440
|
▸ **FormItem**<`T`\>(`props`): `Element`
|
|
425
441
|
|
|
442
|
+
FormItem, can be used without Form.
|
|
443
|
+
Example:
|
|
444
|
+
```ts
|
|
445
|
+
// use inline type
|
|
446
|
+
<FormItem item={{ type: 'string', id: 'name' }} />
|
|
447
|
+
|
|
448
|
+
// use custom type
|
|
449
|
+
<FormItem item={{ id: 'password' }}>
|
|
450
|
+
<Input.Password />
|
|
451
|
+
</>
|
|
452
|
+
```
|
|
453
|
+
|
|
426
454
|
#### Type parameters
|
|
427
455
|
|
|
428
456
|
| Name | Type |
|
|
@@ -433,7 +461,7 @@ ___
|
|
|
433
461
|
|
|
434
462
|
| Name | Type |
|
|
435
463
|
| :------ | :------ |
|
|
436
|
-
| `props` | [`FormItemProps`](
|
|
464
|
+
| `props` | [`FormItemProps`](#formitemprops)<`T`\> |
|
|
437
465
|
|
|
438
466
|
#### Returns
|
|
439
467
|
|
|
@@ -449,7 +477,7 @@ ___
|
|
|
449
477
|
|
|
450
478
|
| Name | Type |
|
|
451
479
|
| :------ | :------ |
|
|
452
|
-
| `props` | [`RoutesProps`](
|
|
480
|
+
| `props` | [`RoutesProps`](#routesprops) |
|
|
453
481
|
|
|
454
482
|
#### Returns
|
|
455
483
|
|
|
@@ -472,7 +500,7 @@ ___
|
|
|
472
500
|
|
|
473
501
|
| Name | Type |
|
|
474
502
|
| :------ | :------ |
|
|
475
|
-
| `props` | [`TableProps`](
|
|
503
|
+
| `props` | [`TableProps`](#tableprops)<`T`, `ExtendTypes`\> |
|
|
476
504
|
|
|
477
505
|
#### Returns
|
|
478
506
|
|
|
@@ -488,7 +516,7 @@ ___
|
|
|
488
516
|
|
|
489
517
|
| Name | Type |
|
|
490
518
|
| :------ | :------ |
|
|
491
|
-
| `props` | [`TitleProps`](
|
|
519
|
+
| `props` | [`TitleProps`](#titleprops) |
|
|
492
520
|
|
|
493
521
|
#### Returns
|
|
494
522
|
|
|
@@ -504,7 +532,7 @@ ___
|
|
|
504
532
|
|
|
505
533
|
| Name | Type |
|
|
506
534
|
| :------ | :------ |
|
|
507
|
-
| `options` | [`BaseOption`](
|
|
535
|
+
| `options` | [`BaseOption`](#baseoption)[] |
|
|
508
536
|
|
|
509
537
|
#### Returns
|
|
510
538
|
|
|
@@ -520,7 +548,7 @@ ___
|
|
|
520
548
|
|
|
521
549
|
| Name | Type |
|
|
522
550
|
| :------ | :------ |
|
|
523
|
-
| `init?` | [`DrawerProps`](
|
|
551
|
+
| `init?` | [`DrawerProps`](#drawerprops) |
|
|
524
552
|
|
|
525
553
|
#### Returns
|
|
526
554
|
|
|
@@ -529,15 +557,15 @@ ___
|
|
|
529
557
|
| Name | Type |
|
|
530
558
|
| :------ | :------ |
|
|
531
559
|
| `drawer` | `Element` |
|
|
532
|
-
| `drawerProps` | [`DrawerProps`](
|
|
533
|
-
| `setDrawerProps` | (`changes`: `Partial`<[`DrawerProps`](
|
|
560
|
+
| `drawerProps` | [`DrawerProps`](#drawerprops) |
|
|
561
|
+
| `setDrawerProps` | (`changes`: `Partial`<[`DrawerProps`](#drawerprops)\>) => `void` |
|
|
534
562
|
|
|
535
563
|
___
|
|
536
564
|
|
|
537
565
|
### useFaasState
|
|
538
566
|
|
|
539
|
-
▸ `Const` **useFaasState**(): [[`FaasState`](
|
|
567
|
+
▸ `Const` **useFaasState**(): [[`FaasState`](#faasstate), (`state`: `IHookStateSetAction`<[`FaasState`](#faasstate)\>) => `void`]
|
|
540
568
|
|
|
541
569
|
#### Returns
|
|
542
570
|
|
|
543
|
-
[[`FaasState`](
|
|
571
|
+
[[`FaasState`](#faasstate), (`state`: `IHookStateSetAction`<[`FaasState`](#faasstate)\>) => `void`]
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,18 @@ declare type BlankProps = {
|
|
|
12
12
|
value?: any;
|
|
13
13
|
text?: string;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* If value is undefined or null, return text, otherwise return value.
|
|
17
|
+
*
|
|
18
|
+
* @param options {object}
|
|
19
|
+
* @param options.value {any}
|
|
20
|
+
* @param options.text {string} Default is 'Empty'
|
|
21
|
+
* @returns {JSX.Element}
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* <Blank value={undefined} text="Empty" />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
15
27
|
declare function Blank(options?: BlankProps): any;
|
|
16
28
|
|
|
17
29
|
declare type FaasState = {
|
|
@@ -35,6 +47,20 @@ declare type FaasState = {
|
|
|
35
47
|
};
|
|
36
48
|
};
|
|
37
49
|
declare const useFaasState: () => [FaasState, (state: react_use_lib_misc_hookState.IHookStateSetAction<FaasState>) => void];
|
|
50
|
+
/**
|
|
51
|
+
* Config for all @faasjs/ant-design components.
|
|
52
|
+
* @param props {object}
|
|
53
|
+
* @param props.config {Partial<FaasState>}
|
|
54
|
+
* @returns {null}
|
|
55
|
+
*
|
|
56
|
+
* ```ts
|
|
57
|
+
* <Config config={{
|
|
58
|
+
* common: {
|
|
59
|
+
* blank: '空',
|
|
60
|
+
* },
|
|
61
|
+
* }} />
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
38
64
|
declare function Config(props: {
|
|
39
65
|
config: Partial<FaasState>;
|
|
40
66
|
}): JSX.Element;
|
|
@@ -137,6 +163,19 @@ declare type FormItemProps<T = any> = {
|
|
|
137
163
|
[type: string]: ExtendFormTypeProps;
|
|
138
164
|
};
|
|
139
165
|
} & FormItemInputProps<T> & FaasItemProps & FormItemProps$1<T>;
|
|
166
|
+
/**
|
|
167
|
+
* FormItem, can be used without Form.
|
|
168
|
+
* Example:
|
|
169
|
+
* ```ts
|
|
170
|
+
* // use inline type
|
|
171
|
+
* <FormItem item={{ type: 'string', id: 'name' }} />
|
|
172
|
+
*
|
|
173
|
+
* // use custom type
|
|
174
|
+
* <FormItem item={{ id: 'password' }}>
|
|
175
|
+
* <Input.Password />
|
|
176
|
+
* </>
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
140
179
|
declare function FormItem<T = any>(props: FormItemProps<T>): JSX.Element;
|
|
141
180
|
|
|
142
181
|
declare type FormProps<Values = any, ExtendItemProps = any> = {
|
package/dist/index.js
CHANGED
|
@@ -302,34 +302,41 @@ function FormItem(props) {
|
|
|
302
302
|
return /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.List, {
|
|
303
303
|
name: computedProps.name,
|
|
304
304
|
rules: computedProps.rules
|
|
305
|
-
}, (fields, { add, remove }, { errors }) =>
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
305
|
+
}, (fields, { add, remove }, { errors }) => {
|
|
306
|
+
var _a;
|
|
307
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, computedProps.label && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
308
|
+
className: "ant-form-item-label"
|
|
309
|
+
}, /* @__PURE__ */ import_react.default.createElement("label", {
|
|
310
|
+
className: computedProps.rules.find((r) => r.required) && "ant-form-item-required"
|
|
311
|
+
}, computedProps.label)), fields.map((field) => {
|
|
312
|
+
var _a2;
|
|
313
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, {
|
|
314
|
+
key: field.key
|
|
315
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Row, {
|
|
316
|
+
gutter: 24,
|
|
317
|
+
style: { flexFlow: "row nowrap" }
|
|
318
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Col, {
|
|
319
|
+
span: 23
|
|
320
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, __spreadProps(__spreadValues({}, field), {
|
|
321
|
+
noStyle: true
|
|
322
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_antd4.Input, __spreadValues({}, computedProps.input)))), /* @__PURE__ */ import_react.default.createElement(import_antd4.Col, {
|
|
323
|
+
span: 1
|
|
324
|
+
}, !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ import_react.default.createElement(import_antd4.Button, {
|
|
325
|
+
danger: true,
|
|
326
|
+
type: "link",
|
|
327
|
+
style: { float: "right" },
|
|
328
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icons2.MinusCircleOutlined, null),
|
|
329
|
+
onClick: () => remove(field.name)
|
|
330
|
+
}))));
|
|
331
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, null, !((_a = computedProps.input) == null ? void 0 : _a.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ import_react.default.createElement(import_antd4.Button, {
|
|
332
|
+
type: "dashed",
|
|
333
|
+
block: true,
|
|
334
|
+
onClick: () => add(),
|
|
335
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icons2.PlusOutlined, null)
|
|
336
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.ErrorList, {
|
|
337
|
+
errors
|
|
338
|
+
})));
|
|
339
|
+
});
|
|
333
340
|
case "number":
|
|
334
341
|
return /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, __spreadValues({}, computedProps), computedProps.options ? /* @__PURE__ */ import_react.default.createElement(import_antd4.Select, __spreadValues({}, computedProps.input)) : /* @__PURE__ */ import_react.default.createElement(import_antd4.InputNumber, __spreadValues({
|
|
335
342
|
style: { width: "100%" }
|
|
@@ -343,30 +350,34 @@ function FormItem(props) {
|
|
|
343
350
|
name: computedProps.name,
|
|
344
351
|
rules: computedProps.rules
|
|
345
352
|
}, (fields, { add, remove }, { errors }) => {
|
|
346
|
-
var _a;
|
|
353
|
+
var _a, _b;
|
|
347
354
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, computedProps.label && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
348
355
|
className: "ant-form-item-label"
|
|
349
356
|
}, /* @__PURE__ */ import_react.default.createElement("label", {
|
|
350
357
|
className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required"
|
|
351
|
-
}, computedProps.label)), fields.map((field) =>
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
358
|
+
}, computedProps.label)), fields.map((field) => {
|
|
359
|
+
var _a2;
|
|
360
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, {
|
|
361
|
+
key: field.key
|
|
362
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Row, {
|
|
363
|
+
gutter: 24,
|
|
364
|
+
style: { flexFlow: "row nowrap" }
|
|
365
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Col, {
|
|
366
|
+
span: 23
|
|
367
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, __spreadProps(__spreadValues({}, field), {
|
|
368
|
+
noStyle: true
|
|
369
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_antd4.InputNumber, __spreadValues({
|
|
370
|
+
style: { width: "100%" }
|
|
371
|
+
}, computedProps.input)))), /* @__PURE__ */ import_react.default.createElement(import_antd4.Col, {
|
|
372
|
+
span: 1
|
|
373
|
+
}, !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ import_react.default.createElement(import_antd4.Button, {
|
|
374
|
+
danger: true,
|
|
375
|
+
type: "link",
|
|
376
|
+
style: { float: "right" },
|
|
377
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icons2.MinusCircleOutlined, null),
|
|
378
|
+
onClick: () => remove(field.name)
|
|
379
|
+
}))));
|
|
380
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, null, !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ import_react.default.createElement(import_antd4.Button, {
|
|
370
381
|
type: "dashed",
|
|
371
382
|
block: true,
|
|
372
383
|
onClick: () => add(),
|
package/dist/index.mjs
CHANGED
|
@@ -279,34 +279,41 @@ function FormItem(props) {
|
|
|
279
279
|
return /* @__PURE__ */ React.createElement(AntdForm.List, {
|
|
280
280
|
name: computedProps.name,
|
|
281
281
|
rules: computedProps.rules
|
|
282
|
-
}, (fields, { add, remove }, { errors }) =>
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
282
|
+
}, (fields, { add, remove }, { errors }) => {
|
|
283
|
+
var _a;
|
|
284
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.label && /* @__PURE__ */ React.createElement("div", {
|
|
285
|
+
className: "ant-form-item-label"
|
|
286
|
+
}, /* @__PURE__ */ React.createElement("label", {
|
|
287
|
+
className: computedProps.rules.find((r) => r.required) && "ant-form-item-required"
|
|
288
|
+
}, computedProps.label)), fields.map((field) => {
|
|
289
|
+
var _a2;
|
|
290
|
+
return /* @__PURE__ */ React.createElement(AntdForm.Item, {
|
|
291
|
+
key: field.key
|
|
292
|
+
}, /* @__PURE__ */ React.createElement(Row, {
|
|
293
|
+
gutter: 24,
|
|
294
|
+
style: { flexFlow: "row nowrap" }
|
|
295
|
+
}, /* @__PURE__ */ React.createElement(Col, {
|
|
296
|
+
span: 23
|
|
297
|
+
}, /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadProps(__spreadValues({}, field), {
|
|
298
|
+
noStyle: true
|
|
299
|
+
}), /* @__PURE__ */ React.createElement(Input, __spreadValues({}, computedProps.input)))), /* @__PURE__ */ React.createElement(Col, {
|
|
300
|
+
span: 1
|
|
301
|
+
}, !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ React.createElement(Button, {
|
|
302
|
+
danger: true,
|
|
303
|
+
type: "link",
|
|
304
|
+
style: { float: "right" },
|
|
305
|
+
icon: /* @__PURE__ */ React.createElement(MinusCircleOutlined, null),
|
|
306
|
+
onClick: () => remove(field.name)
|
|
307
|
+
}))));
|
|
308
|
+
}), /* @__PURE__ */ React.createElement(AntdForm.Item, null, !((_a = computedProps.input) == null ? void 0 : _a.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ React.createElement(Button, {
|
|
309
|
+
type: "dashed",
|
|
310
|
+
block: true,
|
|
311
|
+
onClick: () => add(),
|
|
312
|
+
icon: /* @__PURE__ */ React.createElement(PlusOutlined, null)
|
|
313
|
+
}), /* @__PURE__ */ React.createElement(AntdForm.ErrorList, {
|
|
314
|
+
errors
|
|
315
|
+
})));
|
|
316
|
+
});
|
|
310
317
|
case "number":
|
|
311
318
|
return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), computedProps.options ? /* @__PURE__ */ React.createElement(Select, __spreadValues({}, computedProps.input)) : /* @__PURE__ */ React.createElement(InputNumber, __spreadValues({
|
|
312
319
|
style: { width: "100%" }
|
|
@@ -320,30 +327,34 @@ function FormItem(props) {
|
|
|
320
327
|
name: computedProps.name,
|
|
321
328
|
rules: computedProps.rules
|
|
322
329
|
}, (fields, { add, remove }, { errors }) => {
|
|
323
|
-
var _a;
|
|
330
|
+
var _a, _b;
|
|
324
331
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.label && /* @__PURE__ */ React.createElement("div", {
|
|
325
332
|
className: "ant-form-item-label"
|
|
326
333
|
}, /* @__PURE__ */ React.createElement("label", {
|
|
327
334
|
className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required"
|
|
328
|
-
}, computedProps.label)), fields.map((field) =>
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
335
|
+
}, computedProps.label)), fields.map((field) => {
|
|
336
|
+
var _a2;
|
|
337
|
+
return /* @__PURE__ */ React.createElement(AntdForm.Item, {
|
|
338
|
+
key: field.key
|
|
339
|
+
}, /* @__PURE__ */ React.createElement(Row, {
|
|
340
|
+
gutter: 24,
|
|
341
|
+
style: { flexFlow: "row nowrap" }
|
|
342
|
+
}, /* @__PURE__ */ React.createElement(Col, {
|
|
343
|
+
span: 23
|
|
344
|
+
}, /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadProps(__spreadValues({}, field), {
|
|
345
|
+
noStyle: true
|
|
346
|
+
}), /* @__PURE__ */ React.createElement(InputNumber, __spreadValues({
|
|
347
|
+
style: { width: "100%" }
|
|
348
|
+
}, computedProps.input)))), /* @__PURE__ */ React.createElement(Col, {
|
|
349
|
+
span: 1
|
|
350
|
+
}, !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ React.createElement(Button, {
|
|
351
|
+
danger: true,
|
|
352
|
+
type: "link",
|
|
353
|
+
style: { float: "right" },
|
|
354
|
+
icon: /* @__PURE__ */ React.createElement(MinusCircleOutlined, null),
|
|
355
|
+
onClick: () => remove(field.name)
|
|
356
|
+
}))));
|
|
357
|
+
}), /* @__PURE__ */ React.createElement(AntdForm.Item, null, !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ React.createElement(Button, {
|
|
347
358
|
type: "dashed",
|
|
348
359
|
block: true,
|
|
349
360
|
onClick: () => add(),
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.366",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
-
"homepage": "https://faasjs.com/doc/ant-design
|
|
8
|
+
"homepage": "https://faasjs.com/doc/ant-design",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/faasjs/faasjs.git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lodash": "*",
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-dom": "*",
|
|
31
|
-
"@faasjs/react": "^0.0.2-beta.
|
|
31
|
+
"@faasjs/react": "^0.0.2-beta.366",
|
|
32
32
|
"react-use": "*",
|
|
33
33
|
"react-router-dom": "*"
|
|
34
34
|
},
|