@faasjs/ant-design 0.0.2-beta.425 → 0.0.2-beta.427
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 +129 -38
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
|
|
|
47
47
|
- [BaseOption](#baseoption)
|
|
48
48
|
- [BlankProps](#blankprops)
|
|
49
49
|
- [CalendarProps](#calendarprops)
|
|
50
|
+
- [ConfigProviderProps](#configproviderprops)
|
|
50
51
|
- [DatePickerProps](#datepickerprops)
|
|
51
52
|
- [DescriptionItemProps](#descriptionitemprops)
|
|
52
53
|
- [DescriptionProps](#descriptionprops)
|
|
@@ -57,12 +58,13 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
|
|
|
57
58
|
- [ExtendFormTypeProps](#extendformtypeprops)
|
|
58
59
|
- [ExtendTableItemProps](#extendtableitemprops)
|
|
59
60
|
- [ExtendTableTypeProps](#extendtabletypeprops)
|
|
61
|
+
- [ExtendTypes](#extendtypes)
|
|
60
62
|
- [FaasItemProps](#faasitemprops)
|
|
61
63
|
- [FaasItemType](#faasitemtype)
|
|
62
64
|
- [FaasItemTypeValue](#faasitemtypevalue)
|
|
63
|
-
- [FaasState](#faasstate)
|
|
64
65
|
- [FormItemProps](#formitemprops)
|
|
65
66
|
- [FormProps](#formprops)
|
|
67
|
+
- [LinkProps](#linkprops)
|
|
66
68
|
- [ModalProps](#modalprops)
|
|
67
69
|
- [RoutesProps](#routesprops)
|
|
68
70
|
- [TableItemProps](#tableitemprops)
|
|
@@ -85,6 +87,8 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
|
|
|
85
87
|
- [Description](#description)
|
|
86
88
|
- [Form](#form)
|
|
87
89
|
- [FormItem](#formitem)
|
|
90
|
+
- [Link](#link)
|
|
91
|
+
- [PageNotFound](#pagenotfound)
|
|
88
92
|
- [Routes](#routes)
|
|
89
93
|
- [Table](#table)
|
|
90
94
|
- [TimePicker](#timepicker)
|
|
@@ -135,6 +139,40 @@ ___
|
|
|
135
139
|
|
|
136
140
|
___
|
|
137
141
|
|
|
142
|
+
### ConfigProviderProps
|
|
143
|
+
|
|
144
|
+
Ƭ **ConfigProviderProps**: `Object`
|
|
145
|
+
|
|
146
|
+
#### Type declaration
|
|
147
|
+
|
|
148
|
+
| Name | Type |
|
|
149
|
+
| :------ | :------ |
|
|
150
|
+
| `Blank?` | { `text?`: `string` } |
|
|
151
|
+
| `Blank.text?` | `string` |
|
|
152
|
+
| `Form?` | { `submit?`: { `text?`: `string` } } |
|
|
153
|
+
| `Form.submit?` | { `text?`: `string` } |
|
|
154
|
+
| `Form.submit.text?` | `string` |
|
|
155
|
+
| `Link?` | { `style?`: `CSSProperties` ; `target?`: `string` } |
|
|
156
|
+
| `Link.style?` | `CSSProperties` |
|
|
157
|
+
| `Link.target?` | `string` |
|
|
158
|
+
| `Title?` | { `separator?`: `string` ; `suffix?`: `string` } |
|
|
159
|
+
| `Title.separator?` | `string` |
|
|
160
|
+
| `Title.suffix?` | `string` |
|
|
161
|
+
| `antd?` | `AntdConfigProviderProps` |
|
|
162
|
+
| `common?` | { `add?`: `string` ; `all?`: `string` ; `blank?`: `string` ; `delete?`: `string` ; `pageNotFound?`: `string` ; `required?`: `string` ; `reset?`: `string` ; `search?`: `string` ; `submit?`: `string` } |
|
|
163
|
+
| `common.add?` | `string` |
|
|
164
|
+
| `common.all?` | `string` |
|
|
165
|
+
| `common.blank?` | `string` |
|
|
166
|
+
| `common.delete?` | `string` |
|
|
167
|
+
| `common.pageNotFound?` | `string` |
|
|
168
|
+
| `common.required?` | `string` |
|
|
169
|
+
| `common.reset?` | `string` |
|
|
170
|
+
| `common.search?` | `string` |
|
|
171
|
+
| `common.submit?` | `string` |
|
|
172
|
+
| `lang?` | `string` |
|
|
173
|
+
|
|
174
|
+
___
|
|
175
|
+
|
|
138
176
|
### DatePickerProps
|
|
139
177
|
|
|
140
178
|
Ƭ **DatePickerProps**: `PickerDateProps`<`Dayjs`\>
|
|
@@ -155,7 +193,7 @@ ___
|
|
|
155
193
|
|
|
156
194
|
### DescriptionProps
|
|
157
195
|
|
|
158
|
-
Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { `[key: string]`: [`ExtendDescriptionTypeProps`](#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](#descriptionitemprops) \| `ExtendItemProps`)[] } & `DescriptionsProps`
|
|
196
|
+
Ƭ **DescriptionProps**<`T`, `ExtendItemProps`\>: { `dataSource?`: `T` ; `extendTypes?`: { `[key: string]`: [`ExtendDescriptionTypeProps`](#extenddescriptiontypeprops); } ; `faasData?`: `FaasDataWrapperProps`<`T`\> ; `items`: ([`DescriptionItemProps`](#descriptionitemprops) \| `ExtendItemProps`)[] ; `renderTitle?`: (`values`: `T`) => `ReactNode` } & `DescriptionsProps`
|
|
159
197
|
|
|
160
198
|
#### Type parameters
|
|
161
199
|
|
|
@@ -234,6 +272,16 @@ ___
|
|
|
234
272
|
|
|
235
273
|
___
|
|
236
274
|
|
|
275
|
+
### ExtendTypes
|
|
276
|
+
|
|
277
|
+
Ƭ **ExtendTypes**: `Object`
|
|
278
|
+
|
|
279
|
+
#### Index signature
|
|
280
|
+
|
|
281
|
+
▪ [type: `string`]: [`ExtendFormTypeProps`](#extendformtypeprops)
|
|
282
|
+
|
|
283
|
+
___
|
|
284
|
+
|
|
237
285
|
### FaasItemProps
|
|
238
286
|
|
|
239
287
|
Ƭ **FaasItemProps**: [`BaseItemProps`](#baseitemprops) & { `type?`: [`FaasItemType`](#faasitemtype) }
|
|
@@ -266,56 +314,45 @@ ___
|
|
|
266
314
|
|
|
267
315
|
___
|
|
268
316
|
|
|
269
|
-
###
|
|
317
|
+
### FormItemProps
|
|
270
318
|
|
|
271
|
-
Ƭ **
|
|
319
|
+
Ƭ **FormItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `extendTypes?`: [`ExtendTypes`](#extendtypes) ; `label?`: `string` \| ``false`` ; `render?`: () => `JSX.Element` \| ``null`` ; `rules?`: `RuleObject`[] } & `FormItemInputProps` & [`FaasItemProps`](#faasitemprops) & `Omit`<`AntdFormItemProps`<`T`\>, ``"children"``\>
|
|
272
320
|
|
|
273
|
-
#### Type
|
|
321
|
+
#### Type parameters
|
|
274
322
|
|
|
275
323
|
| Name | Type |
|
|
276
324
|
| :------ | :------ |
|
|
277
|
-
| `
|
|
278
|
-
| `Blank.text` | `string` |
|
|
279
|
-
| `Form` | { `submit`: { `text`: `string` } } |
|
|
280
|
-
| `Form.submit` | { `text`: `string` } |
|
|
281
|
-
| `Form.submit.text` | `string` |
|
|
282
|
-
| `Title` | { `separator`: `string` ; `suffix`: `string` } |
|
|
283
|
-
| `Title.separator` | `string` |
|
|
284
|
-
| `Title.suffix` | `string` |
|
|
285
|
-
| `common` | { `add`: `string` ; `all`: `string` ; `blank`: `string` ; `delete`: `string` ; `pageNotFound`: `string` ; `required`: `string` ; `submit`: `string` } |
|
|
286
|
-
| `common.add` | `string` |
|
|
287
|
-
| `common.all` | `string` |
|
|
288
|
-
| `common.blank` | `string` |
|
|
289
|
-
| `common.delete` | `string` |
|
|
290
|
-
| `common.pageNotFound` | `string` |
|
|
291
|
-
| `common.required` | `string` |
|
|
292
|
-
| `common.submit` | `string` |
|
|
293
|
-
| `lang` | `string` |
|
|
325
|
+
| `T` | `any` |
|
|
294
326
|
|
|
295
327
|
___
|
|
296
328
|
|
|
297
|
-
###
|
|
329
|
+
### FormProps
|
|
298
330
|
|
|
299
|
-
Ƭ **
|
|
331
|
+
Ƭ **FormProps**<`Values`, `ExtendItemProps`\>: { `beforeItems?`: `JSX.Element` \| `JSX.Element`[] ; `children?`: `ReactNode` ; `extendTypes?`: [`ExtendTypes`](#extendtypes) ; `footer?`: `JSX.Element` \| `JSX.Element`[] ; `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"``\>
|
|
300
332
|
|
|
301
333
|
#### Type parameters
|
|
302
334
|
|
|
303
335
|
| Name | Type |
|
|
304
336
|
| :------ | :------ |
|
|
305
|
-
| `
|
|
337
|
+
| `Values` | `any` |
|
|
338
|
+
| `ExtendItemProps` | `any` |
|
|
306
339
|
|
|
307
340
|
___
|
|
308
341
|
|
|
309
|
-
###
|
|
342
|
+
### LinkProps
|
|
310
343
|
|
|
311
|
-
Ƭ **
|
|
344
|
+
Ƭ **LinkProps**: `Object`
|
|
312
345
|
|
|
313
|
-
#### Type
|
|
346
|
+
#### Type declaration
|
|
314
347
|
|
|
315
348
|
| Name | Type |
|
|
316
349
|
| :------ | :------ |
|
|
317
|
-
| `
|
|
318
|
-
| `
|
|
350
|
+
| `button?` | `ButtonProps` |
|
|
351
|
+
| `children?` | `ReactNode` |
|
|
352
|
+
| `href` | `string` |
|
|
353
|
+
| `style?` | `CSSProperties` |
|
|
354
|
+
| `target?` | `string` |
|
|
355
|
+
| `text?` | `string` \| `number` |
|
|
319
356
|
|
|
320
357
|
___
|
|
321
358
|
|
|
@@ -341,7 +378,7 @@ ___
|
|
|
341
378
|
|
|
342
379
|
### TableItemProps
|
|
343
380
|
|
|
344
|
-
Ƭ **TableItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` } & [`FaasItemProps`](#faasitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
|
|
381
|
+
Ƭ **TableItemProps**<`T`\>: { `children?`: `JSX.Element` \| ``null`` ; `optionsType?`: ``"auto"`` } & [`FaasItemProps`](#faasitemprops) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
|
|
345
382
|
|
|
346
383
|
#### Type parameters
|
|
347
384
|
|
|
@@ -380,6 +417,8 @@ ___
|
|
|
380
417
|
| :------ | :------ | :------ |
|
|
381
418
|
| `children?` | `JSX.Element` | return children |
|
|
382
419
|
| `h1?` | `boolean` \| { `className?`: `string` ; `style?`: `React.CSSProperties` } | return a h1 element |
|
|
420
|
+
| `header?` | `PageHeaderProps` | return a PageHeader element |
|
|
421
|
+
| `plain?` | `boolean` | return a pure text element |
|
|
383
422
|
| `separator?` | `string` | ` - ` as default |
|
|
384
423
|
| `suffix?` | `string` | - |
|
|
385
424
|
| `title` | `string` \| `string`[] | - |
|
|
@@ -428,13 +467,13 @@ ___
|
|
|
428
467
|
|
|
429
468
|
### ConfigContext
|
|
430
469
|
|
|
431
|
-
• `Const` **ConfigContext**: `Context`<[`
|
|
470
|
+
• `Const` **ConfigContext**: `Context`<[`ConfigProviderProps`](#configproviderprops)\>
|
|
432
471
|
|
|
433
472
|
___
|
|
434
473
|
|
|
435
474
|
### DatePicker
|
|
436
475
|
|
|
437
|
-
• `Const` **DatePicker**: `PickerComponentClass`<`
|
|
476
|
+
• `Const` **DatePicker**: `PickerComponentClass`<`Object`, `unknown`\> & {}
|
|
438
477
|
|
|
439
478
|
## Functions
|
|
440
479
|
|
|
@@ -498,7 +537,7 @@ Config for @faasjs/ant-design components.
|
|
|
498
537
|
| :------ | :------ |
|
|
499
538
|
| `__namedParameters` | `Object` |
|
|
500
539
|
| `__namedParameters.children` | `ReactNode` |
|
|
501
|
-
| `__namedParameters.config` |
|
|
540
|
+
| `__namedParameters.config` | [`ConfigProviderProps`](#configproviderprops) |
|
|
502
541
|
|
|
503
542
|
#### Returns
|
|
504
543
|
|
|
@@ -584,10 +623,62 @@ FormItem, can be used without Form.
|
|
|
584
623
|
|
|
585
624
|
___
|
|
586
625
|
|
|
626
|
+
### Link
|
|
627
|
+
|
|
628
|
+
▸ **Link**(`__namedParameters`): `Element`
|
|
629
|
+
|
|
630
|
+
```ts
|
|
631
|
+
// pure link
|
|
632
|
+
<Link href="/">Home</Link>
|
|
633
|
+
|
|
634
|
+
// link with button
|
|
635
|
+
<Link href="/" button={{type:'primary'}}>Home</Link>
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
#### Parameters
|
|
639
|
+
|
|
640
|
+
| Name | Type |
|
|
641
|
+
| :------ | :------ |
|
|
642
|
+
| `__namedParameters` | [`LinkProps`](#linkprops) |
|
|
643
|
+
|
|
644
|
+
#### Returns
|
|
645
|
+
|
|
646
|
+
`Element`
|
|
647
|
+
|
|
648
|
+
___
|
|
649
|
+
|
|
650
|
+
### PageNotFound
|
|
651
|
+
|
|
652
|
+
▸ **PageNotFound**(): `Element`
|
|
653
|
+
|
|
654
|
+
#### Returns
|
|
655
|
+
|
|
656
|
+
`Element`
|
|
657
|
+
|
|
658
|
+
___
|
|
659
|
+
|
|
587
660
|
### Routes
|
|
588
661
|
|
|
589
662
|
▸ **Routes**(`props`): `Element`
|
|
590
663
|
|
|
664
|
+
Routes with lazy loading and 404 page.
|
|
665
|
+
|
|
666
|
+
```tsx
|
|
667
|
+
import { lazy } from 'react'
|
|
668
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
669
|
+
|
|
670
|
+
export function App () {
|
|
671
|
+
return <BrowserRouter>
|
|
672
|
+
<Routes routes={[
|
|
673
|
+
{
|
|
674
|
+
path: '/',
|
|
675
|
+
page: lazy(() => import('./pages/home'))
|
|
676
|
+
}
|
|
677
|
+
]} />
|
|
678
|
+
</BrowserRouter>
|
|
679
|
+
}
|
|
680
|
+
```
|
|
681
|
+
|
|
591
682
|
#### Parameters
|
|
592
683
|
|
|
593
684
|
| Name | Type |
|
|
@@ -691,11 +782,11 @@ ___
|
|
|
691
782
|
|
|
692
783
|
### useConfigContext
|
|
693
784
|
|
|
694
|
-
▸ **useConfigContext**(): [`
|
|
785
|
+
▸ **useConfigContext**(): [`ConfigProviderProps`](#configproviderprops)
|
|
695
786
|
|
|
696
787
|
#### Returns
|
|
697
788
|
|
|
698
|
-
[`
|
|
789
|
+
[`ConfigProviderProps`](#configproviderprops)
|
|
699
790
|
|
|
700
791
|
___
|
|
701
792
|
|
|
@@ -709,7 +800,7 @@ Hook style drawer.
|
|
|
709
800
|
|
|
710
801
|
| Name | Type | Description |
|
|
711
802
|
| :------ | :------ | :------ |
|
|
712
|
-
| `init?` | [`DrawerProps`](#drawerprops) | initial props ```ts function Example() { const { drawer, setDrawerProps } = useDrawer() return <> <Button onClick={ () => setDrawerProps(prev => ({
|
|
803
|
+
| `init?` | [`DrawerProps`](#drawerprops) | initial props ```ts function Example() { const { drawer, setDrawerProps } = useDrawer() return <> <Button onClick={ () => setDrawerProps(prev => ({ open: !prev.open})) }> Toggle </Button> {drawer} </> } ``` |
|
|
713
804
|
|
|
714
805
|
#### Returns
|
|
715
806
|
|
|
@@ -733,7 +824,7 @@ Hook style modal.
|
|
|
733
824
|
|
|
734
825
|
| Name | Type | Description |
|
|
735
826
|
| :------ | :------ | :------ |
|
|
736
|
-
| `init?` | [`ModalProps`](#modalprops) | initial props ```ts function Example() { const { modal, setModalProps } = useModal() return <> <Button onClick={() => setModalProps({
|
|
827
|
+
| `init?` | [`ModalProps`](#modalprops) | initial props ```ts function Example() { const { modal, setModalProps } = useModal() return <> <Button onClick={() => setModalProps({ open: true })}>Open Modal</Button> {modal}</> } ``` |
|
|
737
828
|
|
|
738
829
|
#### Returns
|
|
739
830
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.427",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -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.427",
|
|
32
32
|
"react-router-dom": "*",
|
|
33
33
|
"dayjs": "*"
|
|
34
34
|
},
|