@faasjs/ant-design 0.0.3-beta.7 → 0.0.3-beta.70

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.
Files changed (5) hide show
  1. package/README.md +249 -266
  2. package/dist/index.d.ts +355 -245
  3. package/dist/index.js +1107 -756
  4. package/dist/index.mjs +1101 -749
  5. package/package.json +8 -7
package/README.md CHANGED
@@ -8,7 +8,7 @@ UI components based on [FaasJS](https://faasjs.com), [Ant Design](https://ant.de
8
8
 
9
9
  ## Install
10
10
 
11
- npm install @faasjs/ant-design
11
+ npm install @faasjs/ant-design antd react react-dom @faasjs/react react-router-dom
12
12
 
13
13
  ## Usage
14
14
 
@@ -41,218 +41,139 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
41
41
 
42
42
  ### Namespaces
43
43
 
44
+ - [App](modules/App.md)
44
45
  - [Form](modules/Form.md)
46
+ - [FormItem](modules/FormItem.md)
47
+
48
+ ### Classes
49
+
50
+ - [ErrorBoundary](classes/ErrorBoundary.md)
51
+
52
+ ### Interfaces
53
+
54
+ - [AppProps](interfaces/AppProps.md)
55
+ - [BaseItemProps](interfaces/BaseItemProps.md)
56
+ - [BlankProps](interfaces/BlankProps.md)
57
+ - [ConfigProviderProps](interfaces/ConfigProviderProps.md)
58
+ - [DescriptionItemContentProps](interfaces/DescriptionItemContentProps.md)
59
+ - [DescriptionItemProps](interfaces/DescriptionItemProps.md)
60
+ - [DescriptionProps](interfaces/DescriptionProps.md)
61
+ - [DrawerProps](interfaces/DrawerProps.md)
62
+ - [ErrorBoundaryProps](interfaces/ErrorBoundaryProps.md)
63
+ - [ExtendDescriptionTypeProps](interfaces/ExtendDescriptionTypeProps.md)
64
+ - [FaasDataWrapperProps](interfaces/FaasDataWrapperProps.md)
65
+ - [FaasItemProps](interfaces/FaasItemProps.md)
66
+ - [FormItemProps](interfaces/FormItemProps.md)
67
+ - [FormProps](interfaces/FormProps.md)
68
+ - [LinkProps](interfaces/LinkProps.md)
69
+ - [ModalProps](interfaces/ModalProps.md)
70
+ - [RoutesProps](interfaces/RoutesProps.md)
71
+ - [TableItemProps](interfaces/TableItemProps.md)
72
+ - [TitleProps](interfaces/TitleProps.md)
73
+ - [UnionFaasItemProps](interfaces/UnionFaasItemProps.md)
74
+ - [useAppProps](interfaces/useAppProps.md)
45
75
 
46
76
  ### Type Aliases
47
77
 
48
- - [BaseItemProps](#baseitemprops)
49
78
  - [BaseOption](#baseoption)
50
- - [BlankProps](#blankprops)
51
- - [CalendarProps](#calendarprops)
52
- - [ConfigProviderProps](#configproviderprops)
53
- - [DatePickerProps](#datepickerprops)
54
- - [DescriptionItemProps](#descriptionitemprops)
55
- - [DescriptionProps](#descriptionprops)
56
- - [DrawerProps](#drawerprops)
57
79
  - [ExtendDescriptionItemProps](#extenddescriptionitemprops)
58
- - [ExtendDescriptionTypeProps](#extenddescriptiontypeprops)
59
80
  - [ExtendFormItemProps](#extendformitemprops)
60
81
  - [ExtendFormTypeProps](#extendformtypeprops)
61
82
  - [ExtendTableItemProps](#extendtableitemprops)
62
83
  - [ExtendTableTypeProps](#extendtabletypeprops)
63
84
  - [ExtendTypes](#extendtypes)
64
- - [FaasItemProps](#faasitemprops)
85
+ - [FaasDataInjection](#faasdatainjection)
65
86
  - [FaasItemType](#faasitemtype)
66
87
  - [FaasItemTypeValue](#faasitemtypevalue)
67
- - [FormItemProps](#formitemprops)
68
- - [FormProps](#formprops)
69
- - [LinkProps](#linkprops)
70
- - [ModalProps](#modalprops)
71
- - [RoutesProps](#routesprops)
72
- - [TableItemProps](#tableitemprops)
88
+ - [FormSubmitProps](#formsubmitprops)
89
+ - [LoadingProps](#loadingprops)
73
90
  - [TableProps](#tableprops)
74
- - [TimePickerProps](#timepickerprops)
75
- - [TitleProps](#titleprops)
91
+ - [UnionFaasItemElement](#unionfaasitemelement)
92
+ - [UnionFaasItemInjection](#unionfaasiteminjection)
93
+ - [UnionFaasItemRender](#unionfaasitemrender)
94
+ - [UnionScene](#unionscene)
76
95
  - [setDrawerProps](#setdrawerprops)
77
96
  - [setModalProps](#setmodalprops)
78
97
 
79
98
  ### Variables
80
99
 
81
100
  - [ConfigContext](#configcontext)
82
- - [DatePicker](#datepicker)
83
101
 
84
102
  ### Functions
85
103
 
104
+ - [App](#app)
86
105
  - [Blank](#blank)
87
- - [Calendar](#calendar)
88
106
  - [ConfigProvider](#configprovider)
89
107
  - [Description](#description)
108
+ - [FaasDataWrapper](#faasdatawrapper)
90
109
  - [Form](#form)
91
110
  - [FormItem](#formitem)
92
111
  - [Link](#link)
112
+ - [Loading](#loading)
93
113
  - [PageNotFound](#pagenotfound)
94
114
  - [Routes](#routes)
95
115
  - [Table](#table)
96
- - [TimePicker](#timepicker)
97
116
  - [Title](#title)
98
117
  - [transferOptions](#transferoptions)
99
118
  - [transferValue](#transfervalue)
119
+ - [useApp](#useapp)
100
120
  - [useConfigContext](#useconfigcontext)
101
121
  - [useDrawer](#usedrawer)
102
122
  - [useModal](#usemodal)
103
123
 
104
124
  ## Type Aliases
105
125
 
106
- ### BaseItemProps
107
-
108
- Ƭ **BaseItemProps**: `Object`
109
-
110
- #### Type declaration
111
-
112
- | Name | Type |
113
- | :------ | :------ |
114
- | `id` | `string` |
115
- | `options?` | [`BaseOption`](#baseoption)[] |
116
- | `title?` | `string` |
117
-
118
- ___
119
-
120
126
  ### BaseOption
121
127
 
122
128
  Ƭ **BaseOption**: `string` \| `number` \| { `label`: `string` ; `value?`: `string` \| `number` }
123
129
 
124
130
  ___
125
131
 
126
- ### BlankProps
127
-
128
- Ƭ **BlankProps**: `Object`
129
-
130
- #### Type declaration
131
-
132
- | Name | Type |
133
- | :------ | :------ |
134
- | `text?` | `string` |
135
- | `value?` | `any` |
136
-
137
- ___
138
-
139
- ### CalendarProps
140
-
141
- Ƭ **CalendarProps**: `AntdProps`<`Dayjs`\>
142
-
143
- ___
144
-
145
- ### ConfigProviderProps
146
-
147
- Ƭ **ConfigProviderProps**: `Object`
148
-
149
- #### Type declaration
150
-
151
- | Name | Type |
152
- | :------ | :------ |
153
- | `Blank?` | { `text?`: `string` } |
154
- | `Blank.text?` | `string` |
155
- | `Form?` | { `submit?`: { `text?`: `string` } } |
156
- | `Form.submit?` | { `text?`: `string` } |
157
- | `Form.submit.text?` | `string` |
158
- | `Link?` | { `style?`: `CSSProperties` ; `target?`: `string` } |
159
- | `Link.style?` | `CSSProperties` |
160
- | `Link.target?` | `string` |
161
- | `Title?` | { `separator?`: `string` ; `suffix?`: `string` } |
162
- | `Title.separator?` | `string` |
163
- | `Title.suffix?` | `string` |
164
- | `antd?` | `AntdConfigProviderProps` |
165
- | `common?` | { `add?`: `string` ; `all?`: `string` ; `blank?`: `string` ; `delete?`: `string` ; `pageNotFound?`: `string` ; `required?`: `string` ; `reset?`: `string` ; `search?`: `string` ; `submit?`: `string` } |
166
- | `common.add?` | `string` |
167
- | `common.all?` | `string` |
168
- | `common.blank?` | `string` |
169
- | `common.delete?` | `string` |
170
- | `common.pageNotFound?` | `string` |
171
- | `common.required?` | `string` |
172
- | `common.reset?` | `string` |
173
- | `common.search?` | `string` |
174
- | `common.submit?` | `string` |
175
- | `lang?` | `string` |
176
-
177
- ___
178
-
179
- ### DatePickerProps
132
+ ### ExtendDescriptionItemProps
180
133
 
181
- Ƭ **DatePickerProps**: `PickerDateProps`<`Dayjs`\>
134
+ Ƭ **ExtendDescriptionItemProps**: [`BaseItemProps`](interfaces/BaseItemProps.md)
182
135
 
183
136
  ___
184
137
 
185
- ### DescriptionItemProps
186
-
187
- Ƭ **DescriptionItemProps**<`T`\>: { `children?`: `JSX.Element` ; `if?`: (`values`: `Record`<`string`, `any`\>) => `boolean` ; `render?`: (`value`: `T`, `values`: `any`) => `ReactNode` \| `JSX.Element` } & [`FaasItemProps`](#faasitemprops) & { `object?`: [`DescriptionItemProps`](#descriptionitemprops)[] }
188
-
189
- #### Type parameters
138
+ ### ExtendFormItemProps
190
139
 
191
- | Name | Type |
192
- | :------ | :------ |
193
- | `T` | `any` |
140
+ Ƭ **ExtendFormItemProps**: [`BaseItemProps`](interfaces/BaseItemProps.md) & `AntdFormItemProps`
194
141
 
195
142
  ___
196
143
 
197
- ### DescriptionProps
144
+ ### ExtendFormTypeProps
198
145
 
199
- Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { `[key: string]`: [`ExtendDescriptionTypeProps`](#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](#descriptionitemprops) \| `ExtendItemProps`)[] ; `renderTitle?`: (`values`: `T`) => `ReactNode` \| `JSX.Element` } & `DescriptionsProps`
146
+ Ƭ **ExtendFormTypeProps**<`T`\>: `Object`
200
147
 
201
148
  #### Type parameters
202
149
 
203
150
  | Name | Type |
204
151
  | :------ | :------ |
205
152
  | `T` | `any` |
206
- | `ExtendItemProps` | `any` |
207
-
208
- ___
209
-
210
- ### DrawerProps
211
-
212
- Ƭ **DrawerProps**: `AntdDrawerProps` & { `children?`: `JSX.Element` \| `JSX.Element`[] }
213
-
214
- ___
215
-
216
- ### ExtendDescriptionItemProps
217
-
218
- Ƭ **ExtendDescriptionItemProps**: [`BaseItemProps`](#baseitemprops)
219
-
220
- ___
221
-
222
- ### ExtendDescriptionTypeProps
223
-
224
- Ƭ **ExtendDescriptionTypeProps**: `Object`
225
153
 
226
154
  #### Type declaration
227
155
 
228
156
  | Name | Type |
229
157
  | :------ | :------ |
230
- | `children?` | `JSX.Element` \| ``null`` |
231
- | `render?` | (`value`: `any`, `values`: `any`) => `ReactNode` \| `JSX.Element` |
158
+ | `children?` | [`UnionFaasItemElement`](#unionfaasitemelement)<`T`\> |
232
159
 
233
160
  ___
234
161
 
235
- ### ExtendFormItemProps
236
-
237
- Ƭ **ExtendFormItemProps**: [`BaseItemProps`](#baseitemprops) & `AntdFormItemProps`
238
-
239
- ___
240
-
241
- ### ExtendFormTypeProps
162
+ ### ExtendTableItemProps
242
163
 
243
- Ƭ **ExtendFormTypeProps**: `Object`
164
+ Ƭ **ExtendTableItemProps**<`T`\>: [`BaseItemProps`](interfaces/BaseItemProps.md) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
244
165
 
245
- #### Type declaration
166
+ #### Type parameters
246
167
 
247
168
  | Name | Type |
248
169
  | :------ | :------ |
249
- | `children?` | `ReactNode` |
170
+ | `T` | `any` |
250
171
 
251
172
  ___
252
173
 
253
- ### ExtendTableItemProps
174
+ ### ExtendTableTypeProps
254
175
 
255
- Ƭ **ExtendTableItemProps**<`T`\>: [`BaseItemProps`](#baseitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
176
+ Ƭ **ExtendTableTypeProps**<`T`\>: `Object`
256
177
 
257
178
  #### Type parameters
258
179
 
@@ -260,18 +181,12 @@ ___
260
181
  | :------ | :------ |
261
182
  | `T` | `any` |
262
183
 
263
- ___
264
-
265
- ### ExtendTableTypeProps
266
-
267
- Ƭ **ExtendTableTypeProps**: `Object`
268
-
269
184
  #### Type declaration
270
185
 
271
186
  | Name | Type |
272
187
  | :------ | :------ |
273
- | `children?` | `JSX.Element` \| ``null`` |
274
- | `render?` | (`value`: `any`, `values`: `any`, `index`: `number`) => `JSX.Element` \| `string` \| `number` \| `boolean` \| ``null`` |
188
+ | `children?` | `JSX.Element` |
189
+ | `render?` | [`UnionFaasItemRender`](#unionfaasitemrender)<`T`\> |
275
190
 
276
191
  ___
277
192
 
@@ -285,9 +200,15 @@ ___
285
200
 
286
201
  ___
287
202
 
288
- ### FaasItemProps
203
+ ### FaasDataInjection
289
204
 
290
- Ƭ **FaasItemProps**: [`BaseItemProps`](#baseitemprops) & { `type?`: [`FaasItemType`](#faasitemtype) }
205
+ Ƭ **FaasDataInjection**<`T`\>: `Partial`<`OriginFaasDataInjection`<`T`\>\>
206
+
207
+ #### Type parameters
208
+
209
+ | Name | Type |
210
+ | :------ | :------ |
211
+ | `T` | `any` |
291
212
 
292
213
  ___
293
214
 
@@ -319,120 +240,126 @@ FaasItemType's value type
319
240
 
320
241
  ___
321
242
 
322
- ### FormItemProps
243
+ ### FormSubmitProps
323
244
 
324
- Ƭ **FormItemProps**<`T`\>: { `children?`: `ReactNode` ; `extendTypes?`: [`ExtendTypes`](#extendtypes) ; `if?`: (`values`: `Record`<`string`, `any`\>) => `boolean` ; `label?`: `string` \| ``false`` ; `onValueChange?`: (`value`: `T`, `values`: `any`, `form`: `FormInstance`) => `void` ; `render?`: (`value?`: `T`) => `ReactNode` \| `JSX.Element` ; `rules?`: `RuleObject`[] } & `FormItemInputProps` & [`FaasItemProps`](#faasitemprops) & `Omit`<`AntdFormItemProps`<`T`\>, ``"children"``\>
245
+ Ƭ **FormSubmitProps**: `Object`
325
246
 
326
- #### Type parameters
247
+ #### Type declaration
248
+
249
+ | Name | Type | Description |
250
+ | :------ | :------ | :------ |
251
+ | `text?` | `string` | Default: Submit |
252
+ | `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 } } ``` |
253
+ | `to.action` | `string` | - |
254
+ | `to.catch?` | (`error`: `any`) => `void` | - |
255
+ | `to.finally?` | () => `void` | - |
256
+ | `to.params?` | `Record`<`string`, `any`\> | params will overwrite form values before submit |
257
+ | `to.then?` | (`result`: `any`) => `void` | - |
258
+
259
+ ___
260
+
261
+ ### LoadingProps
262
+
263
+ Ƭ **LoadingProps**: `Object`
264
+
265
+ #### Type declaration
327
266
 
328
267
  | Name | Type |
329
268
  | :------ | :------ |
330
- | `T` | `any` |
269
+ | `children?` | `React.ReactNode` |
270
+ | `loading?` | `boolean` |
271
+ | `size?` | ``"small"`` \| ``"default"`` \| ``"large"`` |
272
+ | `style?` | `React.CSSProperties` |
331
273
 
332
274
  ___
333
275
 
334
- ### FormProps
276
+ ### TableProps
335
277
 
336
- Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `beforeItems?`: `JSX.Element` \| `JSX.Element`[] ; `children?`: `ReactNode` ; `extendTypes?`: [`ExtendTypes`](#extendtypes) ; `footer?`: `JSX.Element` \| `JSX.Element`[] ; `initialValues?`: `Values` ; `items?`: ([`FormItemProps`](#formitemprops) \| `ExtendItemProps`)[] ; `onFinish?`: (`values`: `Values`, `submit?`: (`values`: `any`) => `Promise`<`any`\>) => `Promise`<`any`\> ; `submit?`: ``false`` \| { `text?`: `string` ; `to?`: { `action`: `string` ; `params?`: `Record`<`string`, `any`\> } } } & `Omit`<`AntdFormProps`<`Values`\>, ``"onFinish"`` \| ``"children"`` \| ``"initialValues"``\>
278
+ Ƭ **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`\>
337
279
 
338
280
  #### Type parameters
339
281
 
340
282
  | Name | Type |
341
283
  | :------ | :------ |
342
- | `Values` | extends `Record`<`string`, `any`\> = `any` |
343
- | `ExtendItemProps` | `any` |
284
+ | `T` | `any` |
285
+ | `ExtendTypes` | `any` |
344
286
 
345
287
  ___
346
288
 
347
- ### LinkProps
289
+ ### UnionFaasItemElement
348
290
 
349
- Ƭ **LinkProps**: `Object`
291
+ Ƭ **UnionFaasItemElement**<`Value`, `Values`\>: `ReactElement`<[`UnionFaasItemInjection`](#unionfaasiteminjection)<`Value`, `Values`\>\> \| ``null``
350
292
 
351
- #### Type declaration
293
+ #### Type parameters
352
294
 
353
295
  | Name | Type |
354
296
  | :------ | :------ |
355
- | `button?` | `ButtonProps` |
356
- | `children?` | `ReactNode` |
357
- | `href` | `string` |
358
- | `style?` | `CSSProperties` |
359
- | `target?` | `string` |
360
- | `text?` | `string` \| `number` |
297
+ | `Value` | `any` |
298
+ | `Values` | `any` |
361
299
 
362
300
  ___
363
301
 
364
- ### ModalProps
302
+ ### UnionFaasItemInjection
365
303
 
366
- Ƭ **ModalProps**: `AntdModalProps` & { `children?`: `JSX.Element` \| `JSX.Element`[] \| `string` }
304
+ Ƭ **UnionFaasItemInjection**<`Value`, `Values`\>: `Object`
367
305
 
368
- ___
369
-
370
- ### RoutesProps
306
+ #### Type parameters
371
307
 
372
- Ƭ **RoutesProps**: `Object`
308
+ | Name | Type |
309
+ | :------ | :------ |
310
+ | `Value` | `any` |
311
+ | `Values` | `any` |
373
312
 
374
313
  #### Type declaration
375
314
 
376
315
  | Name | Type |
377
316
  | :------ | :------ |
378
- | `fallback?` | `JSX.Element` |
379
- | `notFound?` | `JSX.Element` |
380
- | `routes` | `RouteProps` & { `page?`: `LazyExoticComponent`<`ComponentType`<`any`\>\> }[] |
317
+ | `index?` | `number` |
318
+ | `scene?` | [`UnionScene`](#unionscene) |
319
+ | `value?` | `Value` |
320
+ | `values?` | `Values` |
381
321
 
382
322
  ___
383
323
 
384
- ### TableItemProps
324
+ ### UnionFaasItemRender
385
325
 
386
- Ƭ **TableItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `object?`: [`TableItemProps`](#tableitemprops)[] ; `optionsType?`: ``"auto"`` } & [`FaasItemProps`](#faasitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
326
+ Ƭ **UnionFaasItemRender**<`Value`, `Values`\>: (`value`: `Value`, `values`: `Values`, `index`: `number`, `scene`: [`UnionScene`](#unionscene)) => `JSX.Element` \| ``null``
387
327
 
388
328
  #### Type parameters
389
329
 
390
330
  | Name | Type |
391
331
  | :------ | :------ |
392
- | `T` | `any` |
393
-
394
- ___
332
+ | `Value` | `any` |
333
+ | `Values` | `any` |
395
334
 
396
- ### TableProps
335
+ #### Type declaration
397
336
 
398
- Ƭ **TableProps**<`T`, `ExtendTypes`\>: { `extendTypes?`: { `[key: string]`: [`ExtendTableTypeProps`](#extendtabletypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`TableItemProps`](#tableitemprops) \| `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`\>
337
+ (`value`, `values`, `index`, `scene`): `JSX.Element` \| ``null``
399
338
 
400
- #### Type parameters
339
+ ##### Parameters
401
340
 
402
341
  | Name | Type |
403
342
  | :------ | :------ |
404
- | `T` | `any` |
405
- | `ExtendTypes` | `any` |
343
+ | `value` | `Value` |
344
+ | `values` | `Values` |
345
+ | `index` | `number` |
346
+ | `scene` | [`UnionScene`](#unionscene) |
406
347
 
407
- ___
408
-
409
- ### TimePickerProps
348
+ ##### Returns
410
349
 
411
- Ƭ **TimePickerProps**: `Omit`<`PickerTimeProps`<`Dayjs`\>, ``"picker"``\>
350
+ `JSX.Element` \| ``null``
412
351
 
413
352
  ___
414
353
 
415
- ### TitleProps
416
-
417
- Ƭ **TitleProps**: `Object`
354
+ ### UnionScene
418
355
 
419
- #### Type declaration
420
-
421
- | Name | Type | Description |
422
- | :------ | :------ | :------ |
423
- | `children?` | `JSX.Element` | return children |
424
- | `h1?` | `boolean` \| { `className?`: `string` ; `style?`: `React.CSSProperties` } | return a h1 element |
425
- | `header?` | `PageHeaderProps` | return a PageHeader element |
426
- | `plain?` | `boolean` | return a pure text element |
427
- | `separator?` | `string` | ` - ` as default |
428
- | `suffix?` | `string` | - |
429
- | `title` | `string` \| `string`[] | - |
356
+ Ƭ **UnionScene**: ``"form"`` \| ``"description"`` \| ``"table"``
430
357
 
431
358
  ___
432
359
 
433
360
  ### setDrawerProps
434
361
 
435
- Ƭ **setDrawerProps**: (`changes`: `Partial`<[`DrawerProps`](#drawerprops)\>) => `void`
362
+ Ƭ **setDrawerProps**: (`changes`: `Partial`<[`DrawerProps`](interfaces/DrawerProps.md)\>) => `void`
436
363
 
437
364
  #### Type declaration
438
365
 
@@ -442,7 +369,7 @@ ___
442
369
 
443
370
  | Name | Type |
444
371
  | :------ | :------ |
445
- | `changes` | `Partial`<[`DrawerProps`](#drawerprops)\> |
372
+ | `changes` | `Partial`<[`DrawerProps`](interfaces/DrawerProps.md)\> |
446
373
 
447
374
  ##### Returns
448
375
 
@@ -452,7 +379,7 @@ ___
452
379
 
453
380
  ### setModalProps
454
381
 
455
- Ƭ **setModalProps**: (`changes`: `Partial`<[`ModalProps`](#modalprops)\>) => `void`
382
+ Ƭ **setModalProps**: (`changes`: `Partial`<[`ModalProps`](interfaces/ModalProps.md)\>) => `void`
456
383
 
457
384
  #### Type declaration
458
385
 
@@ -462,7 +389,7 @@ ___
462
389
 
463
390
  | Name | Type |
464
391
  | :------ | :------ |
465
- | `changes` | `Partial`<[`ModalProps`](#modalprops)\> |
392
+ | `changes` | `Partial`<[`ModalProps`](interfaces/ModalProps.md)\> |
466
393
 
467
394
  ##### Returns
468
395
 
@@ -472,27 +399,39 @@ ___
472
399
 
473
400
  ### ConfigContext
474
401
 
475
- • `Const` **ConfigContext**: `Context`<[`ConfigProviderProps`](#configproviderprops)\>
402
+ • `Const` **ConfigContext**: `Context`<[`ConfigProviderProps`](interfaces/ConfigProviderProps.md)\>
476
403
 
477
- ___
404
+ ## Functions
478
405
 
479
- ### DatePicker
406
+ ### App
480
407
 
481
- `Const` **DatePicker**: `PickerComponentClass`<`Object`, `unknown`\> & {}
408
+ **App**(`props`): `Element`
482
409
 
483
- ## Functions
410
+ #### Parameters
411
+
412
+ | Name | Type |
413
+ | :------ | :------ |
414
+ | `props` | [`AppProps`](interfaces/AppProps.md) |
415
+
416
+ #### Returns
417
+
418
+ `Element`
419
+
420
+ ___
484
421
 
485
422
  ### Blank
486
423
 
487
424
  ▸ **Blank**(`options?`): `JSX.Element`
488
425
 
426
+ Blank component.
427
+
489
428
  If value is undefined or null, return text, otherwise return value.
490
429
 
491
430
  #### Parameters
492
431
 
493
432
  | Name | Type | Description |
494
433
  | :------ | :------ | :------ |
495
- | `options?` | [`BlankProps`](#blankprops) | {object} |
434
+ | `options?` | [`BlankProps`](interfaces/BlankProps.md) | {object} |
496
435
 
497
436
  #### Returns
498
437
 
@@ -504,25 +443,9 @@ If value is undefined or null, return text, otherwise return value.
504
443
 
505
444
  ___
506
445
 
507
- ### Calendar
508
-
509
- ▸ **Calendar**(`props`): `Element`
510
-
511
- #### Parameters
512
-
513
- | Name | Type |
514
- | :------ | :------ |
515
- | `props` | `CalendarProps`<`Dayjs`\> |
516
-
517
- #### Returns
518
-
519
- `Element`
520
-
521
- ___
522
-
523
446
  ### ConfigProvider
524
447
 
525
- ▸ **ConfigProvider**(`__namedParameters`): `Element`
448
+ ▸ **ConfigProvider**(`«destructured»`): `Element`
526
449
 
527
450
  Config for @faasjs/ant-design components.
528
451
 
@@ -540,9 +463,9 @@ Config for @faasjs/ant-design components.
540
463
 
541
464
  | Name | Type |
542
465
  | :------ | :------ |
543
- | `__namedParameters` | `Object` |
544
- | `__namedParameters.children` | `ReactNode` |
545
- | `__namedParameters.config` | [`ConfigProviderProps`](#configproviderprops) |
466
+ | `«destructured»` | `Object` |
467
+ | › `children` | `ReactNode` |
468
+ | › `config` | [`ConfigProviderProps`](interfaces/ConfigProviderProps.md) |
546
469
 
547
470
  #### Returns
548
471
 
@@ -554,6 +477,8 @@ ___
554
477
 
555
478
  ▸ **Description**<`T`\>(`props`): `Element`
556
479
 
480
+ Description component.
481
+
557
482
  #### Type parameters
558
483
 
559
484
  | Name | Type |
@@ -564,7 +489,7 @@ ___
564
489
 
565
490
  | Name | Type |
566
491
  | :------ | :------ |
567
- | `props` | [`DescriptionProps`](#descriptionprops)<`T`, `any`\> |
492
+ | `props` | [`DescriptionProps`](interfaces/DescriptionProps.md)<`T`, `any`\> |
568
493
 
569
494
  #### Returns
570
495
 
@@ -572,6 +497,42 @@ ___
572
497
 
573
498
  ___
574
499
 
500
+ ### FaasDataWrapper
501
+
502
+ ▸ **FaasDataWrapper**<`T`\>(`props`): `JSX.Element`
503
+
504
+ FaasDataWrapper component with Loading
505
+
506
+ ```tsx
507
+ function MyComponent (props: FaasDataInjection) {
508
+ return <div>{ props.data }</div>
509
+ }
510
+
511
+ function MyPage () {
512
+ return <FaasDataWrapper action="test" params={{ a: 1 }}>
513
+ <MyComponent />
514
+ </FaasDataWrapper>
515
+ }
516
+ ```
517
+
518
+ #### Type parameters
519
+
520
+ | Name | Type |
521
+ | :------ | :------ |
522
+ | `T` | `any` |
523
+
524
+ #### Parameters
525
+
526
+ | Name | Type |
527
+ | :------ | :------ |
528
+ | `props` | [`FaasDataWrapperProps`](interfaces/FaasDataWrapperProps.md)<`T`\> |
529
+
530
+ #### Returns
531
+
532
+ `JSX.Element`
533
+
534
+ ___
535
+
575
536
  ### Form
576
537
 
577
538
  ▸ **Form**<`Values`\>(`props`): `Element`
@@ -592,7 +553,7 @@ https://ant.design/components/form/
592
553
 
593
554
  | Name | Type |
594
555
  | :------ | :------ |
595
- | `props` | [`FormProps`](#formprops)<`Values`, `any`\> |
556
+ | `props` | [`FormProps`](interfaces/FormProps.md)<`Values`, `any`\> |
596
557
 
597
558
  #### Returns
598
559
 
@@ -608,10 +569,10 @@ FormItem, can be used without Form.
608
569
 
609
570
  ```ts
610
571
  // use inline type
611
- <FormItem item={{ type: 'string', id: 'name' }} />
572
+ <FormItem type='string' id='name' />
612
573
 
613
574
  // use custom type
614
- <FormItem item={{ id: 'password' }}>
575
+ <FormItem id='password'>
615
576
  <Input.Password />
616
577
  </>
617
578
  ```
@@ -626,7 +587,7 @@ FormItem, can be used without Form.
626
587
 
627
588
  | Name | Type |
628
589
  | :------ | :------ |
629
- | `props` | [`FormItemProps`](#formitemprops)<`T`\> |
590
+ | `props` | [`FormItemProps`](interfaces/FormItemProps.md)<`T`\> |
630
591
 
631
592
  #### Returns
632
593
 
@@ -636,21 +597,49 @@ ___
636
597
 
637
598
  ### Link
638
599
 
639
- ▸ **Link**(`__namedParameters`): `Element`
600
+ ▸ **Link**(`props`): `Element`
601
+
602
+ Link component with button.
640
603
 
641
604
  ```ts
642
605
  // pure link
643
606
  <Link href="/">Home</Link>
644
607
 
645
608
  // link with button
646
- <Link href="/" button={{type:'primary'}}>Home</Link>
609
+ <Link href="/" button={{ type:'primary' }}>Home</Link>
647
610
  ```
648
611
 
649
612
  #### Parameters
650
613
 
651
614
  | Name | Type |
652
615
  | :------ | :------ |
653
- | `__namedParameters` | [`LinkProps`](#linkprops) |
616
+ | `props` | [`LinkProps`](interfaces/LinkProps.md) |
617
+
618
+ #### Returns
619
+
620
+ `Element`
621
+
622
+ ___
623
+
624
+ ### Loading
625
+
626
+ ▸ **Loading**(`props`): `Element`
627
+
628
+ Loading component based on Spin
629
+
630
+ ```tsx
631
+ <Loading /> // display loading
632
+
633
+ <Loading loading={ !remoteData }>
634
+ <div>{remoteData}</div>
635
+ </Loading>
636
+ ```
637
+
638
+ #### Parameters
639
+
640
+ | Name | Type |
641
+ | :------ | :------ |
642
+ | `props` | [`LoadingProps`](#loadingprops) |
654
643
 
655
644
  #### Returns
656
645
 
@@ -675,7 +664,7 @@ ___
675
664
  Routes with lazy loading and 404 page.
676
665
 
677
666
  ```tsx
678
- import { lazy } from 'react'
667
+ import { Routes, lazy } from '@faasjs/ant-design'
679
668
  import { BrowserRouter } from 'react-router-dom'
680
669
 
681
670
  export function App () {
@@ -694,7 +683,7 @@ export function App () {
694
683
 
695
684
  | Name | Type |
696
685
  | :------ | :------ |
697
- | `props` | [`RoutesProps`](#routesprops) |
686
+ | `props` | [`RoutesProps`](interfaces/RoutesProps.md) |
698
687
 
699
688
  #### Returns
700
689
 
@@ -716,7 +705,7 @@ https://ant.design/components/table/
716
705
 
717
706
  | Name | Type |
718
707
  | :------ | :------ |
719
- | `T` | `any` |
708
+ | `T` | extends `Record`<`string`, `any`\> |
720
709
  | `ExtendTypes` | `any` |
721
710
 
722
711
  #### Parameters
@@ -731,24 +720,6 @@ https://ant.design/components/table/
731
720
 
732
721
  ___
733
722
 
734
- ### TimePicker
735
-
736
- ▸ **TimePicker**(`props`): `ReactElement`<`any`, `string` \| `JSXElementConstructor`<`any`\>\>
737
-
738
- **NOTE**: Exotic components are not callable.
739
-
740
- #### Parameters
741
-
742
- | Name | Type |
743
- | :------ | :------ |
744
- | `props` | [`TimePickerProps`](#timepickerprops) & `RefAttributes`<`any`\> |
745
-
746
- #### Returns
747
-
748
- `ReactElement`<`any`, `string` \| `JSXElementConstructor`<`any`\>\>
749
-
750
- ___
751
-
752
723
  ### Title
753
724
 
754
725
  ▸ **Title**(`props`): `JSX.Element`
@@ -773,7 +744,7 @@ Return null by default.
773
744
 
774
745
  | Name | Type |
775
746
  | :------ | :------ |
776
- | `props` | [`TitleProps`](#titleprops) |
747
+ | `props` | [`TitleProps`](interfaces/TitleProps.md) |
777
748
 
778
749
  #### Returns
779
750
 
@@ -785,6 +756,8 @@ ___
785
756
 
786
757
  ▸ **transferOptions**(`options`): { `label`: `string` ; `value?`: `string` \| `number` }[]
787
758
 
759
+ convert options to { label, value }[]
760
+
788
761
  #### Parameters
789
762
 
790
763
  | Name | Type |
@@ -814,13 +787,23 @@ ___
814
787
 
815
788
  ___
816
789
 
790
+ ### useApp
791
+
792
+ ▸ **useApp**(): [`useAppProps`](interfaces/useAppProps.md)
793
+
794
+ #### Returns
795
+
796
+ [`useAppProps`](interfaces/useAppProps.md)
797
+
798
+ ___
799
+
817
800
  ### useConfigContext
818
801
 
819
- ▸ **useConfigContext**(): [`ConfigProviderProps`](#configproviderprops)
802
+ ▸ **useConfigContext**(): [`ConfigProviderProps`](interfaces/ConfigProviderProps.md)
820
803
 
821
804
  #### Returns
822
805
 
823
- [`ConfigProviderProps`](#configproviderprops)
806
+ [`ConfigProviderProps`](interfaces/ConfigProviderProps.md)
824
807
 
825
808
  ___
826
809
 
@@ -834,7 +817,7 @@ Hook style drawer.
834
817
 
835
818
  | Name | Type | Description |
836
819
  | :------ | :------ | :------ |
837
- | `init?` | [`DrawerProps`](#drawerprops) | initial props ```ts function Example() { const { drawer, setDrawerProps } = useDrawer() return <> <Button onClick={ () => setDrawerProps(prev => ({ open: !prev.open})) }> Toggle </Button> {drawer} </> } ``` |
820
+ | `init?` | [`DrawerProps`](interfaces/DrawerProps.md) | initial props ```ts function Example() { const { drawer, setDrawerProps } = useDrawer() return <> <Button onClick={ () => setDrawerProps(prev => ({ open: !prev.open})) }> Toggle </Button> {drawer} </> } ``` |
838
821
 
839
822
  #### Returns
840
823
 
@@ -843,8 +826,8 @@ Hook style drawer.
843
826
  | Name | Type |
844
827
  | :------ | :------ |
845
828
  | `drawer` | `Element` |
846
- | `drawerProps` | [`DrawerProps`](#drawerprops) |
847
- | `setDrawerProps` | (`changes`: `Partial`<[`DrawerProps`](#drawerprops)\>) => `void` |
829
+ | `drawerProps` | [`DrawerProps`](interfaces/DrawerProps.md) |
830
+ | `setDrawerProps` | (`changes`: `Partial`<[`DrawerProps`](interfaces/DrawerProps.md)\>) => `void` |
848
831
 
849
832
  ___
850
833
 
@@ -858,7 +841,7 @@ Hook style modal.
858
841
 
859
842
  | Name | Type | Description |
860
843
  | :------ | :------ | :------ |
861
- | `init?` | [`ModalProps`](#modalprops) | initial props ```ts function Example() { const { modal, setModalProps } = useModal() return <> <Button onClick={() => setModalProps({ open: true })}>Open Modal</Button> {modal}</> } ``` |
844
+ | `init?` | [`ModalProps`](interfaces/ModalProps.md) | initial props ```ts function Example() { const { modal, setModalProps } = useModal() return <> <Button onClick={() => setModalProps({ open: true })}>Open Modal</Button> {modal}</> } ``` |
862
845
 
863
846
  #### Returns
864
847
 
@@ -867,5 +850,5 @@ Hook style modal.
867
850
  | Name | Type |
868
851
  | :------ | :------ |
869
852
  | `modal` | `Element` |
870
- | `modalProps` | [`ModalProps`](#modalprops) |
871
- | `setModalProps` | (`changes`: `Partial`<[`ModalProps`](#modalprops)\>) => `void` |
853
+ | `modalProps` | [`ModalProps`](interfaces/ModalProps.md) |
854
+ | `setModalProps` | (`changes`: `Partial`<[`ModalProps`](interfaces/ModalProps.md)\>) => `void` |