@faasjs/ant-design 0.0.3-beta.40 → 0.0.3-beta.42

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
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.d.ts CHANGED
@@ -258,6 +258,9 @@ interface FaasItemProps extends BaseItemProps {
258
258
  */
259
259
  type?: FaasItemType;
260
260
  }
261
+ /**
262
+ * convert options to { label, value }[]
263
+ */
261
264
  declare function transferOptions(options: BaseOption[]): {
262
265
  label: string;
263
266
  value?: string | number;
package/dist/index.js CHANGED
@@ -330,7 +330,7 @@ function DescriptionItemContent(props) {
330
330
  }
331
331
  }
332
332
  function Description(props) {
333
- if (!props.faasData)
333
+ if (props.dataSource)
334
334
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions, {
335
335
  ...props,
336
336
  title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
@@ -1423,7 +1423,7 @@ function Table(props) {
1423
1423
  }, [props.dataSource, columns]);
1424
1424
  if (!columns)
1425
1425
  return null;
1426
- if (!props.faasData)
1426
+ if (props.dataSource)
1427
1427
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
1428
1428
  ...props,
1429
1429
  rowKey: props.rowKey || "id",
package/dist/index.mjs CHANGED
@@ -290,7 +290,7 @@ function DescriptionItemContent(props) {
290
290
  }
291
291
  }
292
292
  function Description(props) {
293
- if (!props.faasData)
293
+ if (props.dataSource)
294
294
  return /* @__PURE__ */ jsx5(Descriptions, {
295
295
  ...props,
296
296
  title: isFunction(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
@@ -1423,7 +1423,7 @@ function Table(props) {
1423
1423
  }, [props.dataSource, columns]);
1424
1424
  if (!columns)
1425
1425
  return null;
1426
- if (!props.faasData)
1426
+ if (props.dataSource)
1427
1427
  return /* @__PURE__ */ jsx13(AntdTable, {
1428
1428
  ...props,
1429
1429
  rowKey: props.rowKey || "id",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.3-beta.40",
3
+ "version": "0.0.3-beta.42",
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": "*",