@faasjs/ant-design 0.0.3-beta.26 → 0.0.3-beta.28
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/dist/index.d.ts +7 -0
- package/dist/index.js +10 -9
- package/dist/index.mjs +11 -12
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ import { DescriptionsProps, DrawerProps as DrawerProps$1, FormItemProps as FormI
|
|
|
5
5
|
export { Drawer, Modal } from 'antd';
|
|
6
6
|
import { FaasDataWrapperProps } from '@faasjs/react';
|
|
7
7
|
export { FaasDataInjection, FaasDataWrapperProps } from '@faasjs/react';
|
|
8
|
+
import * as antd_es_form_context from 'antd/es/form/context';
|
|
9
|
+
import * as antd_es_form_ErrorList from 'antd/es/form/ErrorList';
|
|
10
|
+
import * as antd_es_form from 'antd/es/form';
|
|
8
11
|
import * as rc_field_form_es_useWatch from 'rc-field-form/es/useWatch';
|
|
9
12
|
import * as antd_es_form_hooks_useFormInstance from 'antd/es/form/hooks/useFormInstance';
|
|
10
13
|
import * as antd_es_form_Form from 'antd/es/form/Form';
|
|
@@ -283,6 +286,10 @@ declare namespace Form {
|
|
|
283
286
|
var useForm: typeof antd_es_form_Form.useForm;
|
|
284
287
|
var useFormInstance: typeof antd_es_form_hooks_useFormInstance.default;
|
|
285
288
|
var useWatch: typeof rc_field_form_es_useWatch.default;
|
|
289
|
+
var Item: typeof FormItem;
|
|
290
|
+
var List: react.FC<antd_es_form.FormListProps>;
|
|
291
|
+
var ErrorList: typeof antd_es_form_ErrorList.default;
|
|
292
|
+
var Provider: react.FC<antd_es_form_context.FormProviderProps>;
|
|
286
293
|
}
|
|
287
294
|
|
|
288
295
|
interface LinkProps {
|
package/dist/index.js
CHANGED
|
@@ -31,9 +31,7 @@ __export(src_exports, {
|
|
|
31
31
|
ConfigProvider: () => ConfigProvider,
|
|
32
32
|
Description: () => Description,
|
|
33
33
|
Drawer: () => import_antd5.Drawer,
|
|
34
|
-
FaasDataInjection: () => import_react3.FaasDataInjection,
|
|
35
34
|
FaasDataWrapper: () => FaasDataWrapper,
|
|
36
|
-
FaasDataWrapperProps: () => import_react3.FaasDataWrapperProps,
|
|
37
35
|
Form: () => Form,
|
|
38
36
|
FormItem: () => FormItem,
|
|
39
37
|
Link: () => Link,
|
|
@@ -768,15 +766,16 @@ function Form(props) {
|
|
|
768
766
|
const [form] = import_antd7.Form.useForm(props.form);
|
|
769
767
|
const [initialValues, setInitialValues] = (0, import_react8.useState)(props.initialValues);
|
|
770
768
|
(0, import_react8.useEffect)(() => {
|
|
771
|
-
var _a2, _b2;
|
|
769
|
+
var _a2, _b2, _c;
|
|
772
770
|
const propsCopy = {
|
|
773
771
|
...props,
|
|
774
|
-
form
|
|
772
|
+
form,
|
|
773
|
+
items: props.items
|
|
775
774
|
};
|
|
776
|
-
if (propsCopy.initialValues) {
|
|
775
|
+
if (propsCopy.initialValues && ((_a2 = propsCopy.items) == null ? void 0 : _a2.length)) {
|
|
777
776
|
for (const key in propsCopy.initialValues) {
|
|
778
777
|
propsCopy.initialValues[key] = transferValue(
|
|
779
|
-
(
|
|
778
|
+
(_b2 = propsCopy.items.find((item2) => item2.id === key)) == null ? void 0 : _b2.type,
|
|
780
779
|
propsCopy.initialValues[key]
|
|
781
780
|
);
|
|
782
781
|
const item = propsCopy.items.find((item2) => item2.id === key);
|
|
@@ -807,7 +806,7 @@ function Form(props) {
|
|
|
807
806
|
}
|
|
808
807
|
setLoading(false);
|
|
809
808
|
};
|
|
810
|
-
} else if (propsCopy.submit && ((
|
|
809
|
+
} else if (propsCopy.submit && ((_c = propsCopy.submit.to) == null ? void 0 : _c.action)) {
|
|
811
810
|
propsCopy.onFinish = async (values) => {
|
|
812
811
|
setLoading(true);
|
|
813
812
|
return (0, import_react7.faas)(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
|
|
@@ -867,6 +866,10 @@ function Form(props) {
|
|
|
867
866
|
Form.useForm = import_antd7.Form.useForm;
|
|
868
867
|
Form.useFormInstance = import_antd7.Form.useFormInstance;
|
|
869
868
|
Form.useWatch = import_antd7.Form.useWatch;
|
|
869
|
+
Form.Item = FormItem;
|
|
870
|
+
Form.List = import_antd7.Form.List;
|
|
871
|
+
Form.ErrorList = import_antd7.Form.ErrorList;
|
|
872
|
+
Form.Provider = import_antd7.Form.Provider;
|
|
870
873
|
|
|
871
874
|
// src/Link.tsx
|
|
872
875
|
var import_react_router_dom = require("react-router-dom");
|
|
@@ -1469,9 +1472,7 @@ function Title(props) {
|
|
|
1469
1472
|
ConfigProvider,
|
|
1470
1473
|
Description,
|
|
1471
1474
|
Drawer,
|
|
1472
|
-
FaasDataInjection,
|
|
1473
1475
|
FaasDataWrapper,
|
|
1474
|
-
FaasDataWrapperProps,
|
|
1475
1476
|
Form,
|
|
1476
1477
|
FormItem,
|
|
1477
1478
|
Link,
|
package/dist/index.mjs
CHANGED
|
@@ -130,11 +130,7 @@ import {
|
|
|
130
130
|
} from "react";
|
|
131
131
|
|
|
132
132
|
// src/FaasDataWrapper.tsx
|
|
133
|
-
import {
|
|
134
|
-
FaasDataWrapper as Origin,
|
|
135
|
-
FaasDataWrapperProps,
|
|
136
|
-
FaasDataInjection
|
|
137
|
-
} from "@faasjs/react";
|
|
133
|
+
import { FaasDataWrapper as Origin } from "@faasjs/react";
|
|
138
134
|
|
|
139
135
|
// src/Loading.tsx
|
|
140
136
|
import { Spin } from "antd";
|
|
@@ -754,15 +750,16 @@ function Form(props) {
|
|
|
754
750
|
const [form] = AntdForm2.useForm(props.form);
|
|
755
751
|
const [initialValues, setInitialValues] = useState5(props.initialValues);
|
|
756
752
|
useEffect4(() => {
|
|
757
|
-
var _a2, _b2;
|
|
753
|
+
var _a2, _b2, _c;
|
|
758
754
|
const propsCopy = {
|
|
759
755
|
...props,
|
|
760
|
-
form
|
|
756
|
+
form,
|
|
757
|
+
items: props.items
|
|
761
758
|
};
|
|
762
|
-
if (propsCopy.initialValues) {
|
|
759
|
+
if (propsCopy.initialValues && ((_a2 = propsCopy.items) == null ? void 0 : _a2.length)) {
|
|
763
760
|
for (const key in propsCopy.initialValues) {
|
|
764
761
|
propsCopy.initialValues[key] = transferValue(
|
|
765
|
-
(
|
|
762
|
+
(_b2 = propsCopy.items.find((item2) => item2.id === key)) == null ? void 0 : _b2.type,
|
|
766
763
|
propsCopy.initialValues[key]
|
|
767
764
|
);
|
|
768
765
|
const item = propsCopy.items.find((item2) => item2.id === key);
|
|
@@ -793,7 +790,7 @@ function Form(props) {
|
|
|
793
790
|
}
|
|
794
791
|
setLoading(false);
|
|
795
792
|
};
|
|
796
|
-
} else if (propsCopy.submit && ((
|
|
793
|
+
} else if (propsCopy.submit && ((_c = propsCopy.submit.to) == null ? void 0 : _c.action)) {
|
|
797
794
|
propsCopy.onFinish = async (values) => {
|
|
798
795
|
setLoading(true);
|
|
799
796
|
return faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
|
|
@@ -853,6 +850,10 @@ function Form(props) {
|
|
|
853
850
|
Form.useForm = AntdForm2.useForm;
|
|
854
851
|
Form.useFormInstance = AntdForm2.useFormInstance;
|
|
855
852
|
Form.useWatch = AntdForm2.useWatch;
|
|
853
|
+
Form.Item = FormItem;
|
|
854
|
+
Form.List = AntdForm2.List;
|
|
855
|
+
Form.ErrorList = AntdForm2.ErrorList;
|
|
856
|
+
Form.Provider = AntdForm2.Provider;
|
|
856
857
|
|
|
857
858
|
// src/Link.tsx
|
|
858
859
|
import { Link as RouterLink } from "react-router-dom";
|
|
@@ -1476,9 +1477,7 @@ export {
|
|
|
1476
1477
|
ConfigProvider,
|
|
1477
1478
|
Description,
|
|
1478
1479
|
Drawer,
|
|
1479
|
-
FaasDataInjection,
|
|
1480
1480
|
FaasDataWrapper,
|
|
1481
|
-
FaasDataWrapperProps,
|
|
1482
1481
|
Form,
|
|
1483
1482
|
FormItem,
|
|
1484
1483
|
Link,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.3-beta.
|
|
3
|
+
"version": "0.0.3-beta.28",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lodash-es": "*",
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-dom": "*",
|
|
31
|
-
"@faasjs/react": "^0.0.3-beta.
|
|
31
|
+
"@faasjs/react": "^0.0.3-beta.28",
|
|
32
32
|
"react-router-dom": "*",
|
|
33
33
|
"dayjs": "*"
|
|
34
34
|
},
|