szld-libs 0.3.27 → 0.3.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/szld-components.es.js +1362 -1350
- package/dist/szld-components.umd.js +1 -1
- package/es/components/CreateForm/index.js +34 -22
- package/lib/components/CreateForm/index.js +33 -21
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo, createElement } from "react";
|
|
3
|
-
import { Form, Row, Col, Input, Space, Button, Cascader, TimePicker, DatePicker, Switch, Radio, InputNumber, Select, Checkbox, Rate } from "antd";
|
|
3
|
+
import { ConfigProvider, Form, Row, Col, Input, Space, Button, Cascader, TimePicker, DatePicker, Switch, Radio, InputNumber, Select, Checkbox, Rate } from "antd";
|
|
4
4
|
import { CloseCircleFilled } from "@ant-design/icons";
|
|
5
5
|
import _ from "lodash";
|
|
6
6
|
import UploadFile from "../Upload";
|
|
@@ -65,31 +65,43 @@ const CreateForm = (props) => {
|
|
|
65
65
|
}
|
|
66
66
|
return ((_a = item.render) == null ? void 0 : _a.call(item, data == null ? void 0 : data[item.dataIndex], data)) || item.value || (data == null ? void 0 : data[item.dataIndex]);
|
|
67
67
|
};
|
|
68
|
-
return /* @__PURE__ */ jsx(
|
|
69
|
-
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
ConfigProvider,
|
|
70
70
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
theme: {
|
|
72
|
+
components: {
|
|
73
|
+
Select: {
|
|
74
|
+
zIndexPopup: 3e4
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
children: /* @__PURE__ */ jsx(Form, { layout: "horizontal", form: formProps == null ? void 0 : formProps.form, ...formLayout, ...formProps || {}, children: /* @__PURE__ */ jsx(Row, { gutter: 16, ...rowProps, children: items.filter((v) => !v.hidden).map((item, index) => /* @__PURE__ */ jsx(Col, { ...item.colProps || { span: 24 }, children: /* @__PURE__ */ jsx(
|
|
79
|
+
Form.Item,
|
|
79
80
|
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
valueType: item.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
...item.valueType === "upload" ? {
|
|
82
|
+
getValueFromEvent: normFile
|
|
83
|
+
} : {},
|
|
84
|
+
label: !hiddenTitle ? item.title : "",
|
|
85
|
+
name: item.valueType === "btns" ? void 0 : item.dataIndex,
|
|
86
|
+
...item.formItemProps,
|
|
87
|
+
children: item.readonly ? /* @__PURE__ */ jsx("div", { children: renderReadOnly(item) }) : item.readonly === void 0 && readonly ? /* @__PURE__ */ jsx("div", { children: renderReadOnly(item) }) : /* @__PURE__ */ jsx(
|
|
88
|
+
FormFields,
|
|
89
|
+
{
|
|
90
|
+
onChange: (e) => {
|
|
91
|
+
var _a;
|
|
92
|
+
return (_a = item == null ? void 0 : item.onChange) == null ? void 0 : _a.call(item, e);
|
|
93
|
+
},
|
|
94
|
+
valueType: item.valueType,
|
|
95
|
+
onBtnClick,
|
|
96
|
+
valueProps: item.valueProps,
|
|
97
|
+
formItemProps: item.formItemProps,
|
|
98
|
+
langId
|
|
99
|
+
}
|
|
100
|
+
)
|
|
89
101
|
}
|
|
90
|
-
)
|
|
102
|
+
) }, item.dataIndex || index)) }) })
|
|
91
103
|
}
|
|
92
|
-
)
|
|
104
|
+
);
|
|
93
105
|
};
|
|
94
106
|
const FormFields = (props) => {
|
|
95
107
|
const { valueType, valueProps, value, onChange, onBtnClick, inputRef, formItemProps, langId } = props;
|
|
@@ -67,31 +67,43 @@ const CreateForm = (props) => {
|
|
|
67
67
|
}
|
|
68
68
|
return ((_a = item.render) == null ? void 0 : _a.call(item, data == null ? void 0 : data[item.dataIndex], data)) || item.value || (data == null ? void 0 : data[item.dataIndex]);
|
|
69
69
|
};
|
|
70
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
-
antd.
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
+
antd.ConfigProvider,
|
|
72
72
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
theme: {
|
|
74
|
+
components: {
|
|
75
|
+
Select: {
|
|
76
|
+
zIndexPopup: 3e4
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form, { layout: "horizontal", form: formProps == null ? void 0 : formProps.form, ...formLayout, ...formProps || {}, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Row, { gutter: 16, ...rowProps, children: items.filter((v) => !v.hidden).map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { ...item.colProps || { span: 24 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
81
|
+
antd.Form.Item,
|
|
81
82
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
valueType: item.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
...item.valueType === "upload" ? {
|
|
84
|
+
getValueFromEvent: normFile
|
|
85
|
+
} : {},
|
|
86
|
+
label: !hiddenTitle ? item.title : "",
|
|
87
|
+
name: item.valueType === "btns" ? void 0 : item.dataIndex,
|
|
88
|
+
...item.formItemProps,
|
|
89
|
+
children: item.readonly ? /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderReadOnly(item) }) : item.readonly === void 0 && readonly ? /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderReadOnly(item) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
FormFields,
|
|
91
|
+
{
|
|
92
|
+
onChange: (e) => {
|
|
93
|
+
var _a;
|
|
94
|
+
return (_a = item == null ? void 0 : item.onChange) == null ? void 0 : _a.call(item, e);
|
|
95
|
+
},
|
|
96
|
+
valueType: item.valueType,
|
|
97
|
+
onBtnClick,
|
|
98
|
+
valueProps: item.valueProps,
|
|
99
|
+
formItemProps: item.formItemProps,
|
|
100
|
+
langId
|
|
101
|
+
}
|
|
102
|
+
)
|
|
91
103
|
}
|
|
92
|
-
)
|
|
104
|
+
) }, item.dataIndex || index)) }) })
|
|
93
105
|
}
|
|
94
|
-
)
|
|
106
|
+
);
|
|
95
107
|
};
|
|
96
108
|
const FormFields = (props) => {
|
|
97
109
|
const { valueType, valueProps, value, onChange, onBtnClick, inputRef, formItemProps, langId } = props;
|