szld-libs 0.3.28 → 0.3.29
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/style.css +1 -1
- package/dist/szld-components.es.js +3493 -3498
- package/dist/szld-components.umd.js +38 -38
- package/es/components/CreateForm/index.css +3 -0
- package/es/components/CreateForm/index.js +31 -35
- package/lib/components/CreateForm/index.css +3 -0
- package/lib/components/CreateForm/index.js +30 -34
- 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 {
|
|
3
|
+
import { 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";
|
|
@@ -8,11 +8,14 @@ const fieldModal = "create-form-module_fieldModal_8bf3d";
|
|
|
8
8
|
const content = "create-form-module_content_61f84";
|
|
9
9
|
const suffix = "create-form-module_suffix_42205";
|
|
10
10
|
const placeholder = "create-form-module_placeholder_90d6a";
|
|
11
|
+
const createFormSelectPopup = "create-form-module_create-form-select-popup_a5ca5";
|
|
11
12
|
const styles = {
|
|
12
13
|
fieldModal,
|
|
13
14
|
content,
|
|
14
15
|
suffix,
|
|
15
|
-
placeholder
|
|
16
|
+
placeholder,
|
|
17
|
+
"create-form-select-popup": "create-form-module_create-form-select-popup_a5ca5",
|
|
18
|
+
createFormSelectPopup
|
|
16
19
|
};
|
|
17
20
|
const formLayout = {
|
|
18
21
|
labelCol: {
|
|
@@ -65,43 +68,31 @@ const CreateForm = (props) => {
|
|
|
65
68
|
}
|
|
66
69
|
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
70
|
};
|
|
68
|
-
return /* @__PURE__ */ jsx(
|
|
69
|
-
|
|
71
|
+
return /* @__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(
|
|
72
|
+
Form.Item,
|
|
70
73
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
Form.Item,
|
|
74
|
+
...item.valueType === "upload" ? {
|
|
75
|
+
getValueFromEvent: normFile
|
|
76
|
+
} : {},
|
|
77
|
+
label: !hiddenTitle ? item.title : "",
|
|
78
|
+
name: item.valueType === "btns" ? void 0 : item.dataIndex,
|
|
79
|
+
...item.formItemProps,
|
|
80
|
+
children: item.readonly ? /* @__PURE__ */ jsx("div", { children: renderReadOnly(item) }) : item.readonly === void 0 && readonly ? /* @__PURE__ */ jsx("div", { children: renderReadOnly(item) }) : /* @__PURE__ */ jsx(
|
|
81
|
+
FormFields,
|
|
80
82
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
)
|
|
83
|
+
onChange: (e) => {
|
|
84
|
+
var _a;
|
|
85
|
+
return (_a = item == null ? void 0 : item.onChange) == null ? void 0 : _a.call(item, e);
|
|
86
|
+
},
|
|
87
|
+
valueType: item.valueType,
|
|
88
|
+
onBtnClick,
|
|
89
|
+
valueProps: item.valueProps,
|
|
90
|
+
formItemProps: item.formItemProps,
|
|
91
|
+
langId
|
|
101
92
|
}
|
|
102
|
-
)
|
|
93
|
+
)
|
|
103
94
|
}
|
|
104
|
-
);
|
|
95
|
+
) }, item.dataIndex || index)) }) });
|
|
105
96
|
};
|
|
106
97
|
const FormFields = (props) => {
|
|
107
98
|
const { valueType, valueProps, value, onChange, onBtnClick, inputRef, formItemProps, langId } = props;
|
|
@@ -125,6 +116,11 @@ const FormFields = (props) => {
|
|
|
125
116
|
Select,
|
|
126
117
|
{
|
|
127
118
|
placeholder: langId === "10001" ? "请选择" : "Please select",
|
|
119
|
+
classNames: {
|
|
120
|
+
popup: {
|
|
121
|
+
root: styles["create-form-select-popup"]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
128
124
|
allowClear: true,
|
|
129
125
|
...valueProps
|
|
130
126
|
}
|
|
@@ -10,11 +10,14 @@ const fieldModal = "create-form-module_fieldModal_8bf3d";
|
|
|
10
10
|
const content = "create-form-module_content_61f84";
|
|
11
11
|
const suffix = "create-form-module_suffix_42205";
|
|
12
12
|
const placeholder = "create-form-module_placeholder_90d6a";
|
|
13
|
+
const createFormSelectPopup = "create-form-module_create-form-select-popup_a5ca5";
|
|
13
14
|
const styles = {
|
|
14
15
|
fieldModal,
|
|
15
16
|
content,
|
|
16
17
|
suffix,
|
|
17
|
-
placeholder
|
|
18
|
+
placeholder,
|
|
19
|
+
"create-form-select-popup": "create-form-module_create-form-select-popup_a5ca5",
|
|
20
|
+
createFormSelectPopup
|
|
18
21
|
};
|
|
19
22
|
const formLayout = {
|
|
20
23
|
labelCol: {
|
|
@@ -67,43 +70,31 @@ const CreateForm = (props) => {
|
|
|
67
70
|
}
|
|
68
71
|
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
72
|
};
|
|
70
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
-
antd.
|
|
73
|
+
return /* @__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(
|
|
74
|
+
antd.Form.Item,
|
|
72
75
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
antd.Form.Item,
|
|
76
|
+
...item.valueType === "upload" ? {
|
|
77
|
+
getValueFromEvent: normFile
|
|
78
|
+
} : {},
|
|
79
|
+
label: !hiddenTitle ? item.title : "",
|
|
80
|
+
name: item.valueType === "btns" ? void 0 : item.dataIndex,
|
|
81
|
+
...item.formItemProps,
|
|
82
|
+
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(
|
|
83
|
+
FormFields,
|
|
82
84
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
)
|
|
85
|
+
onChange: (e) => {
|
|
86
|
+
var _a;
|
|
87
|
+
return (_a = item == null ? void 0 : item.onChange) == null ? void 0 : _a.call(item, e);
|
|
88
|
+
},
|
|
89
|
+
valueType: item.valueType,
|
|
90
|
+
onBtnClick,
|
|
91
|
+
valueProps: item.valueProps,
|
|
92
|
+
formItemProps: item.formItemProps,
|
|
93
|
+
langId
|
|
103
94
|
}
|
|
104
|
-
)
|
|
95
|
+
)
|
|
105
96
|
}
|
|
106
|
-
);
|
|
97
|
+
) }, item.dataIndex || index)) }) });
|
|
107
98
|
};
|
|
108
99
|
const FormFields = (props) => {
|
|
109
100
|
const { valueType, valueProps, value, onChange, onBtnClick, inputRef, formItemProps, langId } = props;
|
|
@@ -127,6 +118,11 @@ const FormFields = (props) => {
|
|
|
127
118
|
antd.Select,
|
|
128
119
|
{
|
|
129
120
|
placeholder: langId === "10001" ? "请选择" : "Please select",
|
|
121
|
+
classNames: {
|
|
122
|
+
popup: {
|
|
123
|
+
root: styles["create-form-select-popup"]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
130
126
|
allowClear: true,
|
|
131
127
|
...valueProps
|
|
132
128
|
}
|