@faasjs/ant-design 0.0.3-beta.41 → 0.0.3-beta.43

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
@@ -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 antd
11
+ npm install @faasjs/ant-design antd react react-dom @faasjs/react react-router-dom
12
12
 
13
13
  ## Usage
14
14
 
@@ -44,6 +44,10 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
44
44
  - [Form](modules/Form.md)
45
45
  - [FormItem](modules/FormItem.md)
46
46
 
47
+ ### Classes
48
+
49
+ - [ErrorBoundary](classes/ErrorBoundary.md)
50
+
47
51
  ### Interfaces
48
52
 
49
53
  - [BaseItemProps](interfaces/BaseItemProps.md)
@@ -53,7 +57,10 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
53
57
  - [DescriptionItemProps](interfaces/DescriptionItemProps.md)
54
58
  - [DescriptionProps](interfaces/DescriptionProps.md)
55
59
  - [DrawerProps](interfaces/DrawerProps.md)
60
+ - [ErrorBoundaryProps](interfaces/ErrorBoundaryProps.md)
56
61
  - [ExtendDescriptionTypeProps](interfaces/ExtendDescriptionTypeProps.md)
62
+ - [FaasDataInjection](interfaces/FaasDataInjection.md)
63
+ - [FaasDataWrapperProps](interfaces/FaasDataWrapperProps.md)
57
64
  - [FaasItemProps](interfaces/FaasItemProps.md)
58
65
  - [FormItemProps](interfaces/FormItemProps.md)
59
66
  - [FormProps](interfaces/FormProps.md)
@@ -73,8 +80,6 @@ Form are based on [Ant Design's Form.Item component](https://ant.design/componen
73
80
  - [ExtendTableItemProps](#extendtableitemprops)
74
81
  - [ExtendTableTypeProps](#extendtabletypeprops)
75
82
  - [ExtendTypes](#extendtypes)
76
- - [FaasDataInjection](#faasdatainjection)
77
- - [FaasDataWrapperProps](#faasdatawrapperprops)
78
83
  - [FaasItemType](#faasitemtype)
79
84
  - [FaasItemTypeValue](#faasitemtypevalue)
80
85
  - [FormSubmitProps](#formsubmitprops)
@@ -190,48 +195,6 @@ ___
190
195
 
191
196
  ___
192
197
 
193
- ### FaasDataInjection
194
-
195
- Ƭ **FaasDataInjection**<`Data`\>: `Object`
196
-
197
- Injects FaasData props.
198
-
199
- #### Type parameters
200
-
201
- | Name | Type |
202
- | :------ | :------ |
203
- | `Data` | `any` |
204
-
205
- #### Type declaration
206
-
207
- | Name | Type |
208
- | :------ | :------ |
209
- | `action` | `string` \| `any` |
210
- | `data` | `Data` |
211
- | `error` | `any` |
212
- | `loading` | `boolean` |
213
- | `params` | `Record`<`string`, `any`\> |
214
- | `promise` | `Promise`<`Response`<`Data`\>\> |
215
- | `setData` | `React.Dispatch`<`React.SetStateAction`<`Data`\>\> |
216
- | `setError` | `React.Dispatch`<`React.SetStateAction`<`any`\>\> |
217
- | `setLoading` | `React.Dispatch`<`React.SetStateAction`<`boolean`\>\> |
218
- | `setPromise` | `React.Dispatch`<`React.SetStateAction`<`Promise`<`Response`<`Data`\>\>\>\> |
219
- | `reload` | (`params?`: `Record`<`string`, `any`\>) => `Promise`<`Response`<`Data`\>\> |
220
-
221
- ___
222
-
223
- ### FaasDataWrapperProps
224
-
225
- Ƭ **FaasDataWrapperProps**<`T`\>: `OriginProps`<`T`\> & { `loading?`: `JSX.Element` ; `loadingProps?`: [`LoadingProps`](#loadingprops) }
226
-
227
- #### Type parameters
228
-
229
- | Name | Type |
230
- | :------ | :------ |
231
- | `T` | `any` |
232
-
233
- ___
234
-
235
198
  ### FaasItemType
236
199
 
237
200
  Ƭ **FaasItemType**: ``"string"`` \| ``"string[]"`` \| ``"number"`` \| ``"number[]"`` \| ``"boolean"`` \| ``"date"`` \| ``"time"`` \| ``"object"`` \| ``"object[]"``
@@ -295,7 +258,7 @@ ___
295
258
 
296
259
  ### TableProps
297
260
 
298
- Ƭ **TableProps**<`T`, `ExtendTypes`\>: { `extendTypes?`: { `[key: string]`: [`ExtendTableTypeProps`](#extendtabletypeprops); } ; `faasData?`: [`FaasDataWrapperProps`](#faasdatawrapperprops)<`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`\>
261
+ Ƭ **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`\>
299
262
 
300
263
  #### Type parameters
301
264
 
@@ -505,7 +468,7 @@ ___
505
468
 
506
469
  ▸ **FaasDataWrapper**<`T`\>(`props`): `JSX.Element`
507
470
 
508
- FaasDataWrapper component with Loading and ErrorBoundary
471
+ FaasDataWrapper component with Loading
509
472
 
510
473
  #### Type parameters
511
474
 
@@ -517,7 +480,7 @@ FaasDataWrapper component with Loading and ErrorBoundary
517
480
 
518
481
  | Name | Type |
519
482
  | :------ | :------ |
520
- | `props` | [`FaasDataWrapperProps`](#faasdatawrapperprops)<`T`\> |
483
+ | `props` | [`FaasDataWrapperProps`](interfaces/FaasDataWrapperProps.md)<`T`\> |
521
484
 
522
485
  #### Returns
523
486
 
@@ -589,7 +552,7 @@ ___
589
552
 
590
553
  ### Link
591
554
 
592
- ▸ **Link**(`«destructured»`): `Element`
555
+ ▸ **Link**(`props`): `Element`
593
556
 
594
557
  Link component with button.
595
558
 
@@ -605,7 +568,7 @@ Link component with button.
605
568
 
606
569
  | Name | Type |
607
570
  | :------ | :------ |
608
- | `«destructured»` | [`LinkProps`](interfaces/LinkProps.md) |
571
+ | `props` | [`LinkProps`](interfaces/LinkProps.md) |
609
572
 
610
573
  #### Returns
611
574
 
@@ -748,6 +711,8 @@ ___
748
711
 
749
712
  ▸ **transferOptions**(`options`): { `label`: `string` ; `value?`: `string` \| `number` }[]
750
713
 
714
+ convert options to { label, value }[]
715
+
751
716
  #### Parameters
752
717
 
753
718
  | Name | Type |
package/dist/index.js CHANGED
@@ -638,6 +638,10 @@ function FormItem(props) {
638
638
  onClick: () => add(),
639
639
  icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
640
640
  }),
641
+ computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
642
+ className: "ant-form-item-extra",
643
+ children: computedProps.extra
644
+ }),
641
645
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
642
646
  errors
643
647
  })
@@ -720,6 +724,10 @@ function FormItem(props) {
720
724
  onClick: () => add(),
721
725
  icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
722
726
  }),
727
+ computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
728
+ className: "ant-form-item-extra",
729
+ children: computedProps.extra
730
+ }),
723
731
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
724
732
  errors
725
733
  })
@@ -815,6 +823,10 @@ function FormItem(props) {
815
823
  computedProps.label
816
824
  ]
817
825
  }),
826
+ computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
827
+ className: "ant-form-item-extra",
828
+ children: computedProps.extra
829
+ }),
818
830
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
819
831
  errors
820
832
  })
package/dist/index.mjs CHANGED
@@ -621,6 +621,10 @@ function FormItem(props) {
621
621
  onClick: () => add(),
622
622
  icon: /* @__PURE__ */ jsx8(PlusOutlined, {})
623
623
  }),
624
+ computedProps.extra && /* @__PURE__ */ jsx8("div", {
625
+ className: "ant-form-item-extra",
626
+ children: computedProps.extra
627
+ }),
624
628
  /* @__PURE__ */ jsx8(AntdForm.ErrorList, {
625
629
  errors
626
630
  })
@@ -703,6 +707,10 @@ function FormItem(props) {
703
707
  onClick: () => add(),
704
708
  icon: /* @__PURE__ */ jsx8(PlusOutlined, {})
705
709
  }),
710
+ computedProps.extra && /* @__PURE__ */ jsx8("div", {
711
+ className: "ant-form-item-extra",
712
+ children: computedProps.extra
713
+ }),
706
714
  /* @__PURE__ */ jsx8(AntdForm.ErrorList, {
707
715
  errors
708
716
  })
@@ -798,6 +806,10 @@ function FormItem(props) {
798
806
  computedProps.label
799
807
  ]
800
808
  }),
809
+ computedProps.extra && /* @__PURE__ */ jsx8("div", {
810
+ className: "ant-form-item-extra",
811
+ children: computedProps.extra
812
+ }),
801
813
  /* @__PURE__ */ jsx8(AntdForm.ErrorList, {
802
814
  errors
803
815
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.3-beta.41",
3
+ "version": "0.0.3-beta.43",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,15 +22,17 @@
22
22
  "files": [
23
23
  "dist"
24
24
  ],
25
- "peerDependencies": {
25
+ "dependencies": {
26
26
  "@ant-design/icons": "*",
27
- "antd": "*",
28
27
  "lodash-es": "*",
28
+ "dayjs": "*"
29
+ },
30
+ "peerDependencies": {
31
+ "antd": "*",
29
32
  "react": "*",
30
33
  "react-dom": "*",
31
34
  "@faasjs/react": "*",
32
- "react-router-dom": "*",
33
- "dayjs": "*"
35
+ "react-router-dom": "*"
34
36
  },
35
37
  "devDependencies": {
36
38
  "@types/lodash-es": "*",