@faasjs/ant-design 0.0.4-beta.10 → 0.0.4-beta.12
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 +43 -43
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -127,7 +127,7 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
|
|
|
127
127
|
|
|
128
128
|
### BaseOption
|
|
129
129
|
|
|
130
|
-
Ƭ **BaseOption**: `string` \| `number` \| { `label`: `string` ; `value?`: `any` }
|
|
130
|
+
Ƭ **BaseOption**: `string` \| `number` \| \{ `label`: `string` ; `value?`: `any` }
|
|
131
131
|
|
|
132
132
|
___
|
|
133
133
|
|
|
@@ -145,7 +145,7 @@ ___
|
|
|
145
145
|
|
|
146
146
|
### ExtendFormTypeProps
|
|
147
147
|
|
|
148
|
-
Ƭ **ExtendFormTypeProps
|
|
148
|
+
Ƭ **ExtendFormTypeProps**\<`T`\>: `Object`
|
|
149
149
|
|
|
150
150
|
#### Type parameters
|
|
151
151
|
|
|
@@ -157,13 +157,13 @@ ___
|
|
|
157
157
|
|
|
158
158
|
| Name | Type |
|
|
159
159
|
| :------ | :------ |
|
|
160
|
-
| `children?` | [`UnionFaasItemElement`](#unionfaasitemelement)
|
|
160
|
+
| `children?` | [`UnionFaasItemElement`](#unionfaasitemelement)\<`T`\> |
|
|
161
161
|
|
|
162
162
|
___
|
|
163
163
|
|
|
164
164
|
### ExtendTableItemProps
|
|
165
165
|
|
|
166
|
-
Ƭ **ExtendTableItemProps
|
|
166
|
+
Ƭ **ExtendTableItemProps**\<`T`\>: [`BaseItemProps`](interfaces/BaseItemProps.md) & `Omit`\<`AntdTableColumnProps`\<`T`\>, ``"children"``\>
|
|
167
167
|
|
|
168
168
|
#### Type parameters
|
|
169
169
|
|
|
@@ -175,7 +175,7 @@ ___
|
|
|
175
175
|
|
|
176
176
|
### ExtendTableTypeProps
|
|
177
177
|
|
|
178
|
-
Ƭ **ExtendTableTypeProps
|
|
178
|
+
Ƭ **ExtendTableTypeProps**\<`T`\>: `Object`
|
|
179
179
|
|
|
180
180
|
#### Type parameters
|
|
181
181
|
|
|
@@ -188,7 +188,7 @@ ___
|
|
|
188
188
|
| Name | Type |
|
|
189
189
|
| :------ | :------ |
|
|
190
190
|
| `children?` | `JSX.Element` |
|
|
191
|
-
| `render?` | [`UnionFaasItemRender`](#unionfaasitemrender)
|
|
191
|
+
| `render?` | [`UnionFaasItemRender`](#unionfaasitemrender)\<`T`\> |
|
|
192
192
|
|
|
193
193
|
___
|
|
194
194
|
|
|
@@ -204,7 +204,7 @@ ___
|
|
|
204
204
|
|
|
205
205
|
### FaasDataInjection
|
|
206
206
|
|
|
207
|
-
Ƭ **FaasDataInjection
|
|
207
|
+
Ƭ **FaasDataInjection**\<`T`\>: `Partial`\<`OriginFaasDataInjection`\<`T`\>\>
|
|
208
208
|
|
|
209
209
|
#### Type parameters
|
|
210
210
|
|
|
@@ -251,11 +251,11 @@ ___
|
|
|
251
251
|
| Name | Type | Description |
|
|
252
252
|
| :------ | :------ | :------ |
|
|
253
253
|
| `text?` | `string` | Default: Submit |
|
|
254
|
-
| `to?` | { `action`: `string` ; `catch?`: (`error`: `any`) => `void` ; `finally?`: () => `void` ; `params?`: `Record
|
|
254
|
+
| `to?` | \{ `action`: `string` ; `catch?`: (`error`: `any`) => `void` ; `finally?`: () => `void` ; `params?`: `Record`\<`string`, `any`\> ; `then?`: (`result`: `any`) => `void` } | Submit to FaasJS server. If use onFinish, you should call submit manually. ```ts { submit: { to: { action: 'action_name' } }, onFinish: (values, submit) => { // do something before submit // submit await submit({ ...values, extraProps: 'some extra props' }) // do something after submit } } ``` |
|
|
255
255
|
| `to.action` | `string` | - |
|
|
256
256
|
| `to.catch?` | (`error`: `any`) => `void` | - |
|
|
257
257
|
| `to.finally?` | () => `void` | - |
|
|
258
|
-
| `to.params?` | `Record
|
|
258
|
+
| `to.params?` | `Record`\<`string`, `any`\> | params will overwrite form values before submit |
|
|
259
259
|
| `to.then?` | (`result`: `any`) => `void` | - |
|
|
260
260
|
|
|
261
261
|
___
|
|
@@ -277,7 +277,7 @@ ___
|
|
|
277
277
|
|
|
278
278
|
### TableProps
|
|
279
279
|
|
|
280
|
-
Ƭ **TableProps
|
|
280
|
+
Ƭ **TableProps**\<`T`, `ExtendTypes`\>: \{ `extendTypes?`: \{ `[key: string]`: [`ExtendTableTypeProps`](#extendtabletypeprops); } ; `faasData?`: [`FaasDataWrapperProps`](interfaces/FaasDataWrapperProps.md)\<`T`\> ; `items`: ([`TableItemProps`](interfaces/TableItemProps.md) \| `ExtendTypes` & [`ExtendTableItemProps`](#extendtableitemprops))[] ; `onChange?`: (`pagination`: `TablePaginationConfig`, `filters`: `Record`\<`string`, `FilterValue` \| ``null``\>, `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`\>
|
|
281
281
|
|
|
282
282
|
#### Type parameters
|
|
283
283
|
|
|
@@ -290,7 +290,7 @@ ___
|
|
|
290
290
|
|
|
291
291
|
### UnionFaasItemElement
|
|
292
292
|
|
|
293
|
-
Ƭ **UnionFaasItemElement
|
|
293
|
+
Ƭ **UnionFaasItemElement**\<`Value`, `Values`\>: `ReactElement`\<[`UnionFaasItemInjection`](#unionfaasiteminjection)\<`Value`, `Values`\>\> \| ``null``
|
|
294
294
|
|
|
295
295
|
#### Type parameters
|
|
296
296
|
|
|
@@ -303,7 +303,7 @@ ___
|
|
|
303
303
|
|
|
304
304
|
### UnionFaasItemInjection
|
|
305
305
|
|
|
306
|
-
Ƭ **UnionFaasItemInjection
|
|
306
|
+
Ƭ **UnionFaasItemInjection**\<`Value`, `Values`\>: `Object`
|
|
307
307
|
|
|
308
308
|
#### Type parameters
|
|
309
309
|
|
|
@@ -325,7 +325,7 @@ ___
|
|
|
325
325
|
|
|
326
326
|
### UnionFaasItemRender
|
|
327
327
|
|
|
328
|
-
Ƭ **UnionFaasItemRender
|
|
328
|
+
Ƭ **UnionFaasItemRender**\<`Value`, `Values`\>: (`value`: `Value`, `values`: `Values`, `index`: `number`, `scene`: [`UnionScene`](#unionscene)) => `React.ReactNode`
|
|
329
329
|
|
|
330
330
|
#### Type parameters
|
|
331
331
|
|
|
@@ -361,7 +361,7 @@ ___
|
|
|
361
361
|
|
|
362
362
|
### setDrawerProps
|
|
363
363
|
|
|
364
|
-
Ƭ **setDrawerProps**: (`changes`: `Partial
|
|
364
|
+
Ƭ **setDrawerProps**: (`changes`: `Partial`\<[`DrawerProps`](interfaces/DrawerProps.md)\>) => `void`
|
|
365
365
|
|
|
366
366
|
#### Type declaration
|
|
367
367
|
|
|
@@ -371,7 +371,7 @@ ___
|
|
|
371
371
|
|
|
372
372
|
| Name | Type |
|
|
373
373
|
| :------ | :------ |
|
|
374
|
-
| `changes` | `Partial
|
|
374
|
+
| `changes` | `Partial`\<[`DrawerProps`](interfaces/DrawerProps.md)\> |
|
|
375
375
|
|
|
376
376
|
##### Returns
|
|
377
377
|
|
|
@@ -381,7 +381,7 @@ ___
|
|
|
381
381
|
|
|
382
382
|
### setModalProps
|
|
383
383
|
|
|
384
|
-
Ƭ **setModalProps**: (`changes`: `Partial
|
|
384
|
+
Ƭ **setModalProps**: (`changes`: `Partial`\<[`ModalProps`](interfaces/ModalProps.md)\>) => `void`
|
|
385
385
|
|
|
386
386
|
#### Type declaration
|
|
387
387
|
|
|
@@ -391,7 +391,7 @@ ___
|
|
|
391
391
|
|
|
392
392
|
| Name | Type |
|
|
393
393
|
| :------ | :------ |
|
|
394
|
-
| `changes` | `Partial
|
|
394
|
+
| `changes` | `Partial`\<[`ModalProps`](interfaces/ModalProps.md)\> |
|
|
395
395
|
|
|
396
396
|
##### Returns
|
|
397
397
|
|
|
@@ -401,7 +401,7 @@ ___
|
|
|
401
401
|
|
|
402
402
|
### ConfigContext
|
|
403
403
|
|
|
404
|
-
• `Const` **ConfigContext**: `Context
|
|
404
|
+
• `Const` **ConfigContext**: `Context`\<[`ConfigProviderProps`](interfaces/ConfigProviderProps.md)\>
|
|
405
405
|
|
|
406
406
|
## Functions
|
|
407
407
|
|
|
@@ -477,7 +477,7 @@ ___
|
|
|
477
477
|
|
|
478
478
|
### Description
|
|
479
479
|
|
|
480
|
-
▸ **Description
|
|
480
|
+
▸ **Description**\<`T`\>(`props`): `Element`
|
|
481
481
|
|
|
482
482
|
Description component.
|
|
483
483
|
|
|
@@ -491,7 +491,7 @@ Description component.
|
|
|
491
491
|
|
|
492
492
|
| Name | Type |
|
|
493
493
|
| :------ | :------ |
|
|
494
|
-
| `props` | [`DescriptionProps`](interfaces/DescriptionProps.md)
|
|
494
|
+
| `props` | [`DescriptionProps`](interfaces/DescriptionProps.md)\<`T`, `any`\> |
|
|
495
495
|
|
|
496
496
|
#### Returns
|
|
497
497
|
|
|
@@ -517,7 +517,7 @@ ___
|
|
|
517
517
|
|
|
518
518
|
### FaasDataWrapper
|
|
519
519
|
|
|
520
|
-
▸ **FaasDataWrapper
|
|
520
|
+
▸ **FaasDataWrapper**\<`T`\>(`props`): `JSX.Element`
|
|
521
521
|
|
|
522
522
|
FaasDataWrapper component with Loading
|
|
523
523
|
|
|
@@ -543,7 +543,7 @@ function MyPage () {
|
|
|
543
543
|
|
|
544
544
|
| Name | Type |
|
|
545
545
|
| :------ | :------ |
|
|
546
|
-
| `props` | [`FaasDataWrapperProps`](interfaces/FaasDataWrapperProps.md)
|
|
546
|
+
| `props` | [`FaasDataWrapperProps`](interfaces/FaasDataWrapperProps.md)\<`T`\> |
|
|
547
547
|
|
|
548
548
|
#### Returns
|
|
549
549
|
|
|
@@ -553,7 +553,7 @@ ___
|
|
|
553
553
|
|
|
554
554
|
### Form
|
|
555
555
|
|
|
556
|
-
▸ **Form
|
|
556
|
+
▸ **Form**\<`Values`\>(`props`): `Element`
|
|
557
557
|
|
|
558
558
|
Form component with Ant Design & FaasJS
|
|
559
559
|
|
|
@@ -567,7 +567,7 @@ Form component with Ant Design & FaasJS
|
|
|
567
567
|
|
|
568
568
|
| Name | Type |
|
|
569
569
|
| :------ | :------ |
|
|
570
|
-
| `props` | [`FormProps`](interfaces/FormProps.md)
|
|
570
|
+
| `props` | [`FormProps`](interfaces/FormProps.md)\<`Values`, `any`\> |
|
|
571
571
|
|
|
572
572
|
#### Returns
|
|
573
573
|
|
|
@@ -581,7 +581,7 @@ ___
|
|
|
581
581
|
|
|
582
582
|
### FormItem
|
|
583
583
|
|
|
584
|
-
▸ **FormItem
|
|
584
|
+
▸ **FormItem**\<`T`\>(`props`): `Element`
|
|
585
585
|
|
|
586
586
|
FormItem, can be used without Form.
|
|
587
587
|
|
|
@@ -605,7 +605,7 @@ FormItem, can be used without Form.
|
|
|
605
605
|
|
|
606
606
|
| Name | Type |
|
|
607
607
|
| :------ | :------ |
|
|
608
|
-
| `props` | [`FormItemProps`](interfaces/FormItemProps.md)
|
|
608
|
+
| `props` | [`FormItemProps`](interfaces/FormItemProps.md)\<`T`\> |
|
|
609
609
|
|
|
610
610
|
#### Returns
|
|
611
611
|
|
|
@@ -711,7 +711,7 @@ ___
|
|
|
711
711
|
|
|
712
712
|
### Table
|
|
713
713
|
|
|
714
|
-
▸ **Table
|
|
714
|
+
▸ **Table**\<`T`, `ExtendTypes`\>(`props`): `Element`
|
|
715
715
|
|
|
716
716
|
Table component with Ant Design & FaasJS
|
|
717
717
|
|
|
@@ -719,14 +719,14 @@ Table component with Ant Design & FaasJS
|
|
|
719
719
|
|
|
720
720
|
| Name | Type |
|
|
721
721
|
| :------ | :------ |
|
|
722
|
-
| `T` | extends `Record
|
|
722
|
+
| `T` | extends `Record`\<`string`, `any`\> |
|
|
723
723
|
| `ExtendTypes` | `any` |
|
|
724
724
|
|
|
725
725
|
#### Parameters
|
|
726
726
|
|
|
727
727
|
| Name | Type |
|
|
728
728
|
| :------ | :------ |
|
|
729
|
-
| `props` | [`TableProps`](#tableprops)
|
|
729
|
+
| `props` | [`TableProps`](#tableprops)\<`T`, `ExtendTypes`\> |
|
|
730
730
|
|
|
731
731
|
#### Returns
|
|
732
732
|
|
|
@@ -794,7 +794,7 @@ ___
|
|
|
794
794
|
|
|
795
795
|
### faas
|
|
796
796
|
|
|
797
|
-
▸ **faas
|
|
797
|
+
▸ **faas**\<`PathOrData`\>(`action`, `params`): `Promise`\<`Response`\<`FaasData`\<`PathOrData`\>\>\>
|
|
798
798
|
|
|
799
799
|
Request faas server
|
|
800
800
|
|
|
@@ -802,18 +802,18 @@ Request faas server
|
|
|
802
802
|
|
|
803
803
|
| Name | Type |
|
|
804
804
|
| :------ | :------ |
|
|
805
|
-
| `PathOrData` | extends `Record
|
|
805
|
+
| `PathOrData` | extends `Record`\<`string`, `any`\> |
|
|
806
806
|
|
|
807
807
|
#### Parameters
|
|
808
808
|
|
|
809
809
|
| Name | Type | Description |
|
|
810
810
|
| :------ | :------ | :------ |
|
|
811
811
|
| `action` | `string` \| `PathOrData` | {string} action name |
|
|
812
|
-
| `params` | `FaasParams
|
|
812
|
+
| `params` | `FaasParams`\<`PathOrData`\> | {object} action params |
|
|
813
813
|
|
|
814
814
|
#### Returns
|
|
815
815
|
|
|
816
|
-
`Promise
|
|
816
|
+
`Promise`\<`Response`\<`FaasData`\<`PathOrData`\>\>\>
|
|
817
817
|
|
|
818
818
|
```ts
|
|
819
819
|
faas<{ title: string }>('post/get', { id: 1 }).then(res => {
|
|
@@ -825,9 +825,9 @@ ___
|
|
|
825
825
|
|
|
826
826
|
### transferOptions
|
|
827
827
|
|
|
828
|
-
▸ **transferOptions**(`options`): { `label`: `string` ; `value?`: `string` \| `number` }[]
|
|
828
|
+
▸ **transferOptions**(`options`): \{ `label`: `string` ; `value?`: `string` \| `number` }[]
|
|
829
829
|
|
|
830
|
-
convert
|
|
830
|
+
convert string[] or number[] to { label, value }[]
|
|
831
831
|
|
|
832
832
|
#### Parameters
|
|
833
833
|
|
|
@@ -837,7 +837,7 @@ convert options to { label, value }[]
|
|
|
837
837
|
|
|
838
838
|
#### Returns
|
|
839
839
|
|
|
840
|
-
{ `label`: `string` ; `value?`: `string` \| `number` }[]
|
|
840
|
+
\{ `label`: `string` ; `value?`: `string` \| `number` }[]
|
|
841
841
|
|
|
842
842
|
___
|
|
843
843
|
|
|
@@ -898,13 +898,13 @@ Hook style drawer.
|
|
|
898
898
|
| :------ | :------ |
|
|
899
899
|
| `drawer` | `Element` |
|
|
900
900
|
| `drawerProps` | [`DrawerProps`](interfaces/DrawerProps.md) |
|
|
901
|
-
| `setDrawerProps` | (`changes`: `Partial
|
|
901
|
+
| `setDrawerProps` | (`changes`: `Partial`\<[`DrawerProps`](interfaces/DrawerProps.md)\>) => `void` |
|
|
902
902
|
|
|
903
903
|
___
|
|
904
904
|
|
|
905
905
|
### useFaas
|
|
906
906
|
|
|
907
|
-
▸ **useFaas
|
|
907
|
+
▸ **useFaas**\<`PathOrData`\>(`action`, `defaultParams`, `options?`): `FaasDataInjection`\<`FaasData`\<`PathOrData`\>\>
|
|
908
908
|
|
|
909
909
|
Request faas server with React hook
|
|
910
910
|
|
|
@@ -912,19 +912,19 @@ Request faas server with React hook
|
|
|
912
912
|
|
|
913
913
|
| Name | Type |
|
|
914
914
|
| :------ | :------ |
|
|
915
|
-
| `PathOrData` | extends `Record
|
|
915
|
+
| `PathOrData` | extends `Record`\<`string`, `any`\> |
|
|
916
916
|
|
|
917
917
|
#### Parameters
|
|
918
918
|
|
|
919
919
|
| Name | Type | Description |
|
|
920
920
|
| :------ | :------ | :------ |
|
|
921
921
|
| `action` | `string` \| `PathOrData` | {string} action name |
|
|
922
|
-
| `defaultParams` | `FaasParams
|
|
923
|
-
| `options?` | `useFaasOptions
|
|
922
|
+
| `defaultParams` | `FaasParams`\<`PathOrData`\> | {object} initial action params |
|
|
923
|
+
| `options?` | `useFaasOptions`\<`PathOrData`\> | - |
|
|
924
924
|
|
|
925
925
|
#### Returns
|
|
926
926
|
|
|
927
|
-
`FaasDataInjection
|
|
927
|
+
`FaasDataInjection`\<`FaasData`\<`PathOrData`\>\>
|
|
928
928
|
|
|
929
929
|
```ts
|
|
930
930
|
function Post ({ id }) {
|
|
@@ -955,4 +955,4 @@ Hook style modal.
|
|
|
955
955
|
| :------ | :------ |
|
|
956
956
|
| `modal` | `Element` |
|
|
957
957
|
| `modalProps` | [`ModalProps`](interfaces/ModalProps.md) |
|
|
958
|
-
| `setModalProps` | (`changes`: `Partial
|
|
958
|
+
| `setModalProps` | (`changes`: `Partial`\<[`ModalProps`](interfaces/ModalProps.md)\>) => `void` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.4-beta.
|
|
3
|
+
"version": "0.0.4-beta.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lodash-es": "*"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@faasjs/react": "0.0.4-beta.
|
|
29
|
+
"@faasjs/react": "0.0.4-beta.12",
|
|
30
30
|
"antd": "*",
|
|
31
31
|
"react": "*",
|
|
32
32
|
"react-dom": "*",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@testing-library/jest-dom": "*",
|
|
38
38
|
"@testing-library/react": "*",
|
|
39
39
|
"@testing-library/user-event": "*",
|
|
40
|
-
"@faasjs/react": "0.0.4-beta.
|
|
40
|
+
"@faasjs/react": "0.0.4-beta.12",
|
|
41
41
|
"antd": "*",
|
|
42
42
|
"react": "*",
|
|
43
43
|
"react-dom": "*",
|