@faasjs/ant-design 0.0.3-beta.27 → 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.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
- (_a2 = propsCopy.items.find((item2) => item2.id === key)) == null ? void 0 : _a2.type,
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 && ((_b2 = propsCopy.submit.to) == null ? void 0 : _b2.action)) {
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 ? {
@@ -1473,9 +1472,7 @@ function Title(props) {
1473
1472
  ConfigProvider,
1474
1473
  Description,
1475
1474
  Drawer,
1476
- FaasDataInjection,
1477
1475
  FaasDataWrapper,
1478
- FaasDataWrapperProps,
1479
1476
  Form,
1480
1477
  FormItem,
1481
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
- (_a2 = propsCopy.items.find((item2) => item2.id === key)) == null ? void 0 : _a2.type,
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 && ((_b2 = propsCopy.submit.to) == null ? void 0 : _b2.action)) {
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 ? {
@@ -1480,9 +1477,7 @@ export {
1480
1477
  ConfigProvider,
1481
1478
  Description,
1482
1479
  Drawer,
1483
- FaasDataInjection,
1484
1480
  FaasDataWrapper,
1485
- FaasDataWrapperProps,
1486
1481
  Form,
1487
1482
  FormItem,
1488
1483
  Link,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.3-beta.27",
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.27",
31
+ "@faasjs/react": "^0.0.3-beta.28",
32
32
  "react-router-dom": "*",
33
33
  "dayjs": "*"
34
34
  },