@faasjs/ant-design 0.0.4-beta.8 → 0.0.5-beta.1

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 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**<`T`\>: `Object`
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)<`T`\> |
160
+ | `children?` | [`UnionFaasItemElement`](#unionfaasitemelement)\<`T`\> |
161
161
 
162
162
  ___
163
163
 
164
164
  ### ExtendTableItemProps
165
165
 
166
- Ƭ **ExtendTableItemProps**<`T`\>: [`BaseItemProps`](interfaces/BaseItemProps.md) & `Omit`<`AntdTableColumnProps`<`T`\>, ``"children"``\>
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**<`T`\>: `Object`
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)<`T`\> |
191
+ | `render?` | [`UnionFaasItemRender`](#unionfaasitemrender)\<`T`\> |
192
192
 
193
193
  ___
194
194
 
@@ -204,7 +204,7 @@ ___
204
204
 
205
205
  ### FaasDataInjection
206
206
 
207
- Ƭ **FaasDataInjection**<`T`\>: `Partial`<`OriginFaasDataInjection`<`T`\>\>
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`<`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 } } ``` |
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`<`string`, `any`\> | params will overwrite form values before submit |
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**<`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`\>
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**<`Value`, `Values`\>: `ReactElement`<[`UnionFaasItemInjection`](#unionfaasiteminjection)<`Value`, `Values`\>\> \| ``null``
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**<`Value`, `Values`\>: `Object`
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**<`Value`, `Values`\>: (`value`: `Value`, `values`: `Values`, `index`: `number`, `scene`: [`UnionScene`](#unionscene)) => `React.ReactNode`
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`<[`DrawerProps`](interfaces/DrawerProps.md)\>) => `void`
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`<[`DrawerProps`](interfaces/DrawerProps.md)\> |
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`<[`ModalProps`](interfaces/ModalProps.md)\>) => `void`
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`<[`ModalProps`](interfaces/ModalProps.md)\> |
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`<[`ConfigProviderProps`](interfaces/ConfigProviderProps.md)\>
404
+ • `Const` **ConfigContext**: `Context`\<`Partial`\<[`ConfigProviderProps`](interfaces/ConfigProviderProps.md)\>\>
405
405
 
406
406
  ## Functions
407
407
 
@@ -447,16 +447,12 @@ ___
447
447
 
448
448
  ### ConfigProvider
449
449
 
450
- ▸ **ConfigProvider**(`«destructured»`): `Element`
450
+ ▸ **ConfigProvider**(`props`): `Element`
451
451
 
452
452
  Config for @faasjs/ant-design components.
453
453
 
454
454
  ```ts
455
- <ConfigProvider config={{
456
- common: {
457
- blank: 'Empty',
458
- },
459
- }}>
455
+ <ConfigProvider theme={{ common: { blank: 'Empty' } }}>
460
456
  <Blank />
461
457
  </ConfigProvider>
462
458
  ```
@@ -465,9 +461,7 @@ Config for @faasjs/ant-design components.
465
461
 
466
462
  | Name | Type |
467
463
  | :------ | :------ |
468
- | `«destructured»` | `Object` |
469
- | › `children` | `ReactNode` |
470
- | › `config` | [`ConfigProviderProps`](interfaces/ConfigProviderProps.md) |
464
+ | `props` | [`ConfigProviderProps`](interfaces/ConfigProviderProps.md) |
471
465
 
472
466
  #### Returns
473
467
 
@@ -477,7 +471,7 @@ ___
477
471
 
478
472
  ### Description
479
473
 
480
- ▸ **Description**<`T`\>(`props`): `Element`
474
+ ▸ **Description**\<`T`\>(`props`): `Element`
481
475
 
482
476
  Description component.
483
477
 
@@ -491,7 +485,7 @@ Description component.
491
485
 
492
486
  | Name | Type |
493
487
  | :------ | :------ |
494
- | `props` | [`DescriptionProps`](interfaces/DescriptionProps.md)<`T`, `any`\> |
488
+ | `props` | [`DescriptionProps`](interfaces/DescriptionProps.md)\<`T`, `any`\> |
495
489
 
496
490
  #### Returns
497
491
 
@@ -517,7 +511,7 @@ ___
517
511
 
518
512
  ### FaasDataWrapper
519
513
 
520
- ▸ **FaasDataWrapper**<`T`\>(`props`): `JSX.Element`
514
+ ▸ **FaasDataWrapper**\<`T`\>(`props`): `JSX.Element`
521
515
 
522
516
  FaasDataWrapper component with Loading
523
517
 
@@ -543,7 +537,7 @@ function MyPage () {
543
537
 
544
538
  | Name | Type |
545
539
  | :------ | :------ |
546
- | `props` | [`FaasDataWrapperProps`](interfaces/FaasDataWrapperProps.md)<`T`\> |
540
+ | `props` | [`FaasDataWrapperProps`](interfaces/FaasDataWrapperProps.md)\<`T`\> |
547
541
 
548
542
  #### Returns
549
543
 
@@ -553,7 +547,7 @@ ___
553
547
 
554
548
  ### Form
555
549
 
556
- ▸ **Form**<`Values`\>(`props`): `Element`
550
+ ▸ **Form**\<`Values`\>(`props`): `Element`
557
551
 
558
552
  Form component with Ant Design & FaasJS
559
553
 
@@ -567,7 +561,7 @@ Form component with Ant Design & FaasJS
567
561
 
568
562
  | Name | Type |
569
563
  | :------ | :------ |
570
- | `props` | [`FormProps`](interfaces/FormProps.md)<`Values`, `any`\> |
564
+ | `props` | [`FormProps`](interfaces/FormProps.md)\<`Values`, `any`\> |
571
565
 
572
566
  #### Returns
573
567
 
@@ -581,7 +575,7 @@ ___
581
575
 
582
576
  ### FormItem
583
577
 
584
- ▸ **FormItem**<`T`\>(`props`): `Element`
578
+ ▸ **FormItem**\<`T`\>(`props`): `Element`
585
579
 
586
580
  FormItem, can be used without Form.
587
581
 
@@ -605,7 +599,7 @@ FormItem, can be used without Form.
605
599
 
606
600
  | Name | Type |
607
601
  | :------ | :------ |
608
- | `props` | [`FormItemProps`](interfaces/FormItemProps.md)<`T`\> |
602
+ | `props` | [`FormItemProps`](interfaces/FormItemProps.md)\<`T`\> |
609
603
 
610
604
  #### Returns
611
605
 
@@ -711,22 +705,27 @@ ___
711
705
 
712
706
  ### Table
713
707
 
714
- ▸ **Table**<`T`, `ExtendTypes`\>(`props`): `Element`
708
+ ▸ **Table**\<`T`, `ExtendTypes`\>(`props`): `Element`
715
709
 
716
710
  Table component with Ant Design & FaasJS
717
711
 
712
+ - Support all Ant Design Table props.
713
+ - Support FaasJS injection.
714
+ - Auto generate filter dropdown (disable with `filterDropdown: false`).
715
+ - Auto generate sorter (disable with `sorter: false`).
716
+
718
717
  #### Type parameters
719
718
 
720
719
  | Name | Type |
721
720
  | :------ | :------ |
722
- | `T` | extends `Record`<`string`, `any`\> |
721
+ | `T` | extends `Record`\<`string`, `any`\> |
723
722
  | `ExtendTypes` | `any` |
724
723
 
725
724
  #### Parameters
726
725
 
727
726
  | Name | Type |
728
727
  | :------ | :------ |
729
- | `props` | [`TableProps`](#tableprops)<`T`, `ExtendTypes`\> |
728
+ | `props` | [`TableProps`](#tableprops)\<`T`, `ExtendTypes`\> |
730
729
 
731
730
  #### Returns
732
731
 
@@ -794,7 +793,7 @@ ___
794
793
 
795
794
  ### faas
796
795
 
797
- ▸ **faas**<`PathOrData`\>(`action`, `params`): `Promise`<`Response`<`FaasData`<`PathOrData`\>\>\>
796
+ ▸ **faas**\<`PathOrData`\>(`action`, `params`): `Promise`\<`Response`\<`FaasData`\<`PathOrData`\>\>\>
798
797
 
799
798
  Request faas server
800
799
 
@@ -802,18 +801,18 @@ Request faas server
802
801
 
803
802
  | Name | Type |
804
803
  | :------ | :------ |
805
- | `PathOrData` | extends `Record`<`string`, `any`\> |
804
+ | `PathOrData` | extends `Record`\<`string`, `any`\> |
806
805
 
807
806
  #### Parameters
808
807
 
809
808
  | Name | Type | Description |
810
809
  | :------ | :------ | :------ |
811
810
  | `action` | `string` \| `PathOrData` | {string} action name |
812
- | `params` | `FaasParams`<`PathOrData`\> | {object} action params |
811
+ | `params` | `FaasParams`\<`PathOrData`\> | {object} action params |
813
812
 
814
813
  #### Returns
815
814
 
816
- `Promise`<`Response`<`FaasData`<`PathOrData`\>\>\>
815
+ `Promise`\<`Response`\<`FaasData`\<`PathOrData`\>\>\>
817
816
 
818
817
  ```ts
819
818
  faas<{ title: string }>('post/get', { id: 1 }).then(res => {
@@ -825,9 +824,9 @@ ___
825
824
 
826
825
  ### transferOptions
827
826
 
828
- ▸ **transferOptions**(`options`): { `label`: `string` ; `value?`: `string` \| `number` }[]
827
+ ▸ **transferOptions**(`options`): \{ `label`: `string` ; `value?`: `string` \| `number` }[]
829
828
 
830
- convert options to { label, value }[]
829
+ convert string[] or number[] to { label, value }[]
831
830
 
832
831
  #### Parameters
833
832
 
@@ -837,7 +836,7 @@ convert options to { label, value }[]
837
836
 
838
837
  #### Returns
839
838
 
840
- { `label`: `string` ; `value?`: `string` \| `number` }[]
839
+ \{ `label`: `string` ; `value?`: `string` \| `number` }[]
841
840
 
842
841
  ___
843
842
 
@@ -862,6 +861,14 @@ ___
862
861
 
863
862
  ▸ **useApp**(): [`useAppProps`](interfaces/useAppProps.md)
864
863
 
864
+ Get app context.
865
+
866
+ ```ts
867
+ import { useApp } from '@faasjs/ant-design'
868
+
869
+ const { message, notification, setModalProps, setDrawerProps } = useApp()
870
+ ```
871
+
865
872
  #### Returns
866
873
 
867
874
  [`useAppProps`](interfaces/useAppProps.md)
@@ -870,11 +877,11 @@ ___
870
877
 
871
878
  ### useConfigContext
872
879
 
873
- ▸ **useConfigContext**(): [`ConfigProviderProps`](interfaces/ConfigProviderProps.md)
880
+ ▸ **useConfigContext**(): `Partial`\<[`ConfigProviderProps`](interfaces/ConfigProviderProps.md)\>
874
881
 
875
882
  #### Returns
876
883
 
877
- [`ConfigProviderProps`](interfaces/ConfigProviderProps.md)
884
+ `Partial`\<[`ConfigProviderProps`](interfaces/ConfigProviderProps.md)\>
878
885
 
879
886
  ___
880
887
 
@@ -898,13 +905,13 @@ Hook style drawer.
898
905
  | :------ | :------ |
899
906
  | `drawer` | `Element` |
900
907
  | `drawerProps` | [`DrawerProps`](interfaces/DrawerProps.md) |
901
- | `setDrawerProps` | (`changes`: `Partial`<[`DrawerProps`](interfaces/DrawerProps.md)\>) => `void` |
908
+ | `setDrawerProps` | (`changes`: `Partial`\<[`DrawerProps`](interfaces/DrawerProps.md)\>) => `void` |
902
909
 
903
910
  ___
904
911
 
905
912
  ### useFaas
906
913
 
907
- ▸ **useFaas**<`PathOrData`\>(`action`, `defaultParams`, `options?`): `FaasDataInjection`<`FaasData`<`PathOrData`\>\>
914
+ ▸ **useFaas**\<`PathOrData`\>(`action`, `defaultParams`, `options?`): `FaasDataInjection`\<`FaasData`\<`PathOrData`\>\>
908
915
 
909
916
  Request faas server with React hook
910
917
 
@@ -912,19 +919,19 @@ Request faas server with React hook
912
919
 
913
920
  | Name | Type |
914
921
  | :------ | :------ |
915
- | `PathOrData` | extends `Record`<`string`, `any`\> |
922
+ | `PathOrData` | extends `Record`\<`string`, `any`\> |
916
923
 
917
924
  #### Parameters
918
925
 
919
926
  | Name | Type | Description |
920
927
  | :------ | :------ | :------ |
921
928
  | `action` | `string` \| `PathOrData` | {string} action name |
922
- | `defaultParams` | `FaasParams`<`PathOrData`\> | {object} initial action params |
923
- | `options?` | `useFaasOptions`<`PathOrData`\> | - |
929
+ | `defaultParams` | `FaasParams`\<`PathOrData`\> | {object} initial action params |
930
+ | `options?` | `useFaasOptions`\<`PathOrData`\> | - |
924
931
 
925
932
  #### Returns
926
933
 
927
- `FaasDataInjection`<`FaasData`<`PathOrData`\>\>
934
+ `FaasDataInjection`\<`FaasData`\<`PathOrData`\>\>
928
935
 
929
936
  ```ts
930
937
  function Post ({ id }) {
@@ -955,4 +962,4 @@ Hook style modal.
955
962
  | :------ | :------ |
956
963
  | `modal` | `Element` |
957
964
  | `modalProps` | [`ModalProps`](interfaces/ModalProps.md) |
958
- | `setModalProps` | (`changes`: `Partial`<[`ModalProps`](interfaces/ModalProps.md)\>) => `void` |
965
+ | `setModalProps` | (`changes`: `Partial`\<[`ModalProps`](interfaces/ModalProps.md)\>) => `void` |
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1, ErrorBoundaryProps } from '@faasjs/react';
1
+ import { ErrorBoundaryProps, FaasReactClientOptions, FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1 } from '@faasjs/react';
2
2
  export { ErrorBoundaryProps, faas, useFaas } from '@faasjs/react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ConfigProviderProps as ConfigProviderProps$1 } from 'antd/es/config-provider';
@@ -73,11 +73,64 @@ declare function useDrawer(init?: DrawerProps): {
73
73
  setDrawerProps(changes: Partial<DrawerProps>): void;
74
74
  };
75
75
 
76
+ declare function ErrorBoundary(props: ErrorBoundaryProps): react_jsx_runtime.JSX.Element;
77
+
78
+ interface ConfigProviderProps {
79
+ faasClientOptions?: FaasReactClientOptions;
80
+ children: React.ReactNode;
81
+ theme?: {
82
+ lang?: string;
83
+ common?: {
84
+ blank?: string;
85
+ all?: string;
86
+ submit?: string;
87
+ pageNotFound?: string;
88
+ add?: string;
89
+ delete?: string;
90
+ required?: string;
91
+ search?: string;
92
+ reset?: string;
93
+ };
94
+ Blank?: {
95
+ text?: string;
96
+ };
97
+ Form?: {
98
+ submit?: {
99
+ text?: string;
100
+ };
101
+ };
102
+ Title?: {
103
+ /** ' - ' as default */
104
+ separator?: string;
105
+ suffix?: string;
106
+ };
107
+ Link?: {
108
+ /** '_blank' as default */
109
+ target?: string;
110
+ style?: CSSProperties;
111
+ };
112
+ };
113
+ }
114
+ declare const ConfigContext: react.Context<Partial<ConfigProviderProps>>;
115
+ /**
116
+ * Config for @faasjs/ant-design components.
117
+ *
118
+ * ```ts
119
+ * <ConfigProvider theme={{ common: { blank: 'Empty' } }}>
120
+ * <Blank />
121
+ * </ConfigProvider>
122
+ * ```
123
+ */
124
+ declare function ConfigProvider(props: ConfigProviderProps): react_jsx_runtime.JSX.Element;
125
+ declare function useConfigContext(): Partial<ConfigProviderProps>;
126
+
76
127
  interface AppProps {
77
128
  children: React.ReactNode;
78
129
  styleProviderProps?: StyleProviderProps;
79
130
  configProviderProps?: ConfigProviderProps$1;
80
131
  browserRouterProps?: BrowserRouterProps;
132
+ errorBoundaryProps?: Omit<ErrorBoundaryProps, 'children'>;
133
+ faasConfigProviderProps?: Omit<ConfigProviderProps, 'children'>;
81
134
  }
82
135
  interface useAppProps {
83
136
  message: MessageInstance;
@@ -89,6 +142,15 @@ declare function App(props: AppProps): react_jsx_runtime.JSX.Element;
89
142
  declare namespace App {
90
143
  var useApp: typeof useApp;
91
144
  }
145
+ /**
146
+ * Get app context.
147
+ *
148
+ * ```ts
149
+ * import { useApp } from '@faasjs/ant-design'
150
+ *
151
+ * const { message, notification, setModalProps, setDrawerProps } = useApp()
152
+ * ```
153
+ */
92
154
  declare function useApp(): useAppProps;
93
155
 
94
156
  interface BlankProps {
@@ -111,58 +173,6 @@ interface BlankProps {
111
173
  */
112
174
  declare function Blank(options?: BlankProps): JSX.Element;
113
175
 
114
- interface ConfigProviderProps {
115
- lang?: string;
116
- common?: {
117
- blank?: string;
118
- all?: string;
119
- submit?: string;
120
- pageNotFound?: string;
121
- add?: string;
122
- delete?: string;
123
- required?: string;
124
- search?: string;
125
- reset?: string;
126
- };
127
- Blank?: {
128
- text?: string;
129
- };
130
- Form?: {
131
- submit?: {
132
- text?: string;
133
- };
134
- };
135
- Title?: {
136
- /** ' - ' as default */
137
- separator?: string;
138
- suffix?: string;
139
- };
140
- Link?: {
141
- /** '_blank' as default */
142
- target?: string;
143
- style?: CSSProperties;
144
- };
145
- }
146
- declare const ConfigContext: react.Context<ConfigProviderProps>;
147
- /**
148
- * Config for @faasjs/ant-design components.
149
- *
150
- * ```ts
151
- * <ConfigProvider config={{
152
- * common: {
153
- * blank: 'Empty',
154
- * },
155
- * }}>
156
- * <Blank />
157
- * </ConfigProvider>
158
- * ```
159
- */
160
- declare function ConfigProvider({ config, children, }: {
161
- config: ConfigProviderProps;
162
- children: React.ReactNode;
163
- }): react_jsx_runtime.JSX.Element;
164
- declare function useConfigContext(): ConfigProviderProps;
165
-
166
176
  type ExtendFormTypeProps<T = any> = {
167
177
  children?: UnionFaasItemElement<T>;
168
178
  };
@@ -316,6 +326,11 @@ type TableProps<T = any, ExtendTypes = any> = {
316
326
  /**
317
327
  * Table component with Ant Design & FaasJS
318
328
  *
329
+ * - Support all Ant Design Table props.
330
+ * - Support FaasJS injection.
331
+ * - Auto generate filter dropdown (disable with `filterDropdown: false`).
332
+ * - Auto generate sorter (disable with `sorter: false`).
333
+ *
319
334
  * @ref https://ant.design/components/table/
320
335
  */
321
336
  declare function Table<T extends Record<string, any>, ExtendTypes = any>(props: TableProps<T, ExtendTypes>): react_jsx_runtime.JSX.Element;
@@ -350,7 +365,7 @@ interface FaasItemProps extends BaseItemProps {
350
365
  type?: FaasItemType;
351
366
  }
352
367
  /**
353
- * convert options to { label, value }[]
368
+ * convert string[] or number[] to { label, value }[]
354
369
  */
355
370
  declare function transferOptions(options: BaseOption[]): {
356
371
  label: string;
@@ -372,8 +387,6 @@ interface UnionFaasItemProps<Value = any, Values = any> extends FormItemProps, D
372
387
  object?: UnionFaasItemProps<Value, Values>[];
373
388
  }
374
389
 
375
- declare function ErrorBoundary(props: ErrorBoundaryProps): react_jsx_runtime.JSX.Element;
376
-
377
390
  type FormSubmitProps = {
378
391
  /** Default: Submit */
379
392
  text?: string;
@@ -542,4 +555,4 @@ interface TitleProps {
542
555
  */
543
556
  declare function Title(props: TitleProps): JSX.Element;
544
557
 
545
- export { App, AppProps, BaseItemProps, BaseOption, Blank, BlankProps, ConfigContext, ConfigProvider, ConfigProviderProps, Description, DescriptionItemContentProps, DescriptionItemProps, DescriptionProps, DrawerProps, ErrorBoundary, ExtendDescriptionItemProps, ExtendDescriptionTypeProps, ExtendFormItemProps, ExtendFormTypeProps, ExtendTableItemProps, ExtendTableTypeProps, ExtendTypes, FaasDataInjection, FaasDataWrapper, FaasDataWrapperProps, FaasItemProps, FaasItemType, FaasItemTypeValue, Form, FormItem, FormItemProps, FormProps, FormSubmitProps, Link, LinkProps, Loading, LoadingProps, ModalProps, PageNotFound, Routes, RoutesProps, TabProps, Table, TableItemProps, TableProps, Tabs, TabsProps, Title, TitleProps, UnionFaasItemElement, UnionFaasItemInjection, UnionFaasItemProps, UnionFaasItemRender, UnionScene, setDrawerProps, setModalProps, transferOptions, transferValue, useApp, useAppProps, useConfigContext, useDrawer, useModal };
558
+ export { App, type AppProps, type BaseItemProps, type BaseOption, Blank, type BlankProps, ConfigContext, ConfigProvider, type ConfigProviderProps, Description, type DescriptionItemContentProps, type DescriptionItemProps, type DescriptionProps, type DrawerProps, ErrorBoundary, type ExtendDescriptionItemProps, type ExtendDescriptionTypeProps, type ExtendFormItemProps, type ExtendFormTypeProps, type ExtendTableItemProps, type ExtendTableTypeProps, type ExtendTypes, type FaasDataInjection, FaasDataWrapper, type FaasDataWrapperProps, type FaasItemProps, type FaasItemType, type FaasItemTypeValue, Form, FormItem, type FormItemProps, type FormProps, type FormSubmitProps, Link, type LinkProps, Loading, type LoadingProps, type ModalProps, PageNotFound, Routes, type RoutesProps, type TabProps, Table, type TableItemProps, type TableProps, Tabs, type TabsProps, Title, type TitleProps, type UnionFaasItemElement, type UnionFaasItemInjection, type UnionFaasItemProps, type UnionFaasItemRender, type UnionScene, type setDrawerProps, type setModalProps, transferOptions, transferValue, useApp, type useAppProps, useConfigContext, useDrawer, useModal };