szld-libs 0.4.49 → 0.4.50
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 +18408 -17763
- package/dist/szld-components.umd.js +217 -101
- package/es/components/DynamicForm/myRichText/index.d.ts +2 -1
- package/es/components/DynamicForm/myRichText/index.js +1 -1
- package/es/components/DynamicFormMobile/func.js +4 -0
- package/es/components/DynamicFormMobile/myRichText/enmu.d.ts +5 -0
- package/es/components/DynamicFormMobile/myRichText/enmu.js +68 -0
- package/es/components/DynamicFormMobile/myRichText/index.d.ts +11 -0
- package/es/components/DynamicFormMobile/myRichText/index.js +291 -0
- package/es/components/DynamicFormMobile/myRichText/vite.svg +1 -0
- package/es/components/DynamicFormMobile/mySelect/index.css +9 -1
- package/es/components/DynamicFormMobile/mySelect/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/mySelect/index.js +55 -24
- package/es/components/DynamicFormMobile/myUpload/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
- package/es/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
- package/es/components/DynamicFormMobile/useDynamicForm.js +19 -4
- package/es/index.js +6 -4
- package/es/mock/index.js +2 -2
- package/lib/components/DynamicForm/myRichText/index.d.ts +2 -1
- package/lib/components/DynamicForm/myRichText/index.js +1 -1
- package/lib/components/DynamicFormMobile/func.js +4 -0
- package/lib/components/DynamicFormMobile/myRichText/enmu.d.ts +5 -0
- package/lib/components/DynamicFormMobile/myRichText/enmu.js +68 -0
- package/lib/components/DynamicFormMobile/myRichText/index.d.ts +11 -0
- package/lib/components/DynamicFormMobile/myRichText/index.js +290 -0
- package/lib/components/DynamicFormMobile/myRichText/vite.svg +1 -0
- package/lib/components/DynamicFormMobile/mySelect/index.css +9 -1
- package/lib/components/DynamicFormMobile/mySelect/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/mySelect/index.js +55 -24
- package/lib/components/DynamicFormMobile/myUpload/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
- package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
- package/lib/components/DynamicFormMobile/useDynamicForm.js +19 -4
- package/lib/index.js +6 -4
- package/lib/mock/index.js +2 -2
- package/package.json +2 -1
- package/es/utils/enum.d.ts +0 -4
- package/es/utils/enum.js +0 -10
- package/lib/utils/enum.d.ts +0 -4
- package/lib/utils/enum.js +0 -10
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const szxkFunc = require("../../../utils/szxkFunc");
|
|
3
4
|
const func = require("../../DynamicForm/func");
|
|
4
5
|
const reactVant = require("react-vant");
|
|
5
6
|
const react = require("react");
|
|
6
7
|
const antd = require("antd");
|
|
7
|
-
const szxkFunc = require("../../../utils/szxkFunc");
|
|
8
8
|
const checkboxGroup = "index-module_checkbox-group_4684b";
|
|
9
9
|
const checkboxGroupHeader = "index-module_checkbox-group-header_192bd";
|
|
10
10
|
const checkboxGroupContent = "index-module_checkbox-group-content_f81a1";
|
|
11
11
|
const checkboxItem = "index-module_checkbox-item_1b36c";
|
|
12
12
|
const checkboxGroupCancel = "index-module_checkbox-group-cancel_c5cfb";
|
|
13
|
+
const checkboxGroupCheckAll = "index-module_checkbox-group-check-all_1e608";
|
|
14
|
+
const item = "index-module_item_4fef5";
|
|
13
15
|
const styles = {
|
|
14
16
|
"checkbox-group": "index-module_checkbox-group_4684b",
|
|
15
17
|
checkboxGroup,
|
|
@@ -20,10 +22,13 @@ const styles = {
|
|
|
20
22
|
"checkbox-item": "index-module_checkbox-item_1b36c",
|
|
21
23
|
checkboxItem,
|
|
22
24
|
"checkbox-group-cancel": "index-module_checkbox-group-cancel_c5cfb",
|
|
23
|
-
checkboxGroupCancel
|
|
25
|
+
checkboxGroupCancel,
|
|
26
|
+
"checkbox-group-check-all": "index-module_checkbox-group-check-all_1e608",
|
|
27
|
+
checkboxGroupCheckAll,
|
|
28
|
+
item
|
|
24
29
|
};
|
|
25
30
|
const MySelect = ({
|
|
26
|
-
item,
|
|
31
|
+
item: item2,
|
|
27
32
|
readonly,
|
|
28
33
|
style,
|
|
29
34
|
commonRequestWidthParams,
|
|
@@ -38,29 +43,34 @@ const MySelect = ({
|
|
|
38
43
|
getTitle,
|
|
39
44
|
attrid
|
|
40
45
|
}) => {
|
|
46
|
+
var _a;
|
|
41
47
|
const [options, setOptions] = react.useState([]);
|
|
42
48
|
const [instanceList, setInstanceList] = react.useState([]);
|
|
49
|
+
const [isAllChecked, setIsAllChecked] = react.useState(false);
|
|
50
|
+
const [showPopup, setShowPopup] = react.useState(false);
|
|
51
|
+
const [selectedValues, setSelectedValues] = react.useState([]);
|
|
52
|
+
const [confirmValues, setConfirmValues] = react.useState([]);
|
|
43
53
|
react.useEffect(() => {
|
|
44
|
-
if (
|
|
54
|
+
if (item2.input === "mult-select" && value && Array.isArray(value)) {
|
|
45
55
|
setSelectedValues(value || []);
|
|
46
56
|
setConfirmValues(value || []);
|
|
47
57
|
}
|
|
48
58
|
}, [value]);
|
|
49
59
|
react.useEffect(() => {
|
|
50
60
|
handleLoadOptions();
|
|
51
|
-
}, [
|
|
61
|
+
}, [item2.inputType, item2.classify, item2.data, item2.options]);
|
|
52
62
|
const handleLoadOptions = async () => {
|
|
53
|
-
if (
|
|
54
|
-
const keyField =
|
|
63
|
+
if (item2.inputType === "instance-url" && (item2 == null ? void 0 : item2["instance-source-number"]) && attrid) {
|
|
64
|
+
const keyField = item2 == null ? void 0 : item2["key-field"];
|
|
55
65
|
if (!keyField) {
|
|
56
66
|
reactVant.Toast("请配置key-field");
|
|
57
67
|
return;
|
|
58
68
|
}
|
|
59
69
|
const params = {
|
|
60
|
-
"source-number":
|
|
70
|
+
"source-number": item2 == null ? void 0 : item2["instance-source-number"]
|
|
61
71
|
};
|
|
62
72
|
let list2 = await szxkFunc.handleGetList(params, commonRequestWidthParams);
|
|
63
|
-
const controlPanelConfig = await szxkFunc.handleGetControlPanelConfig(
|
|
73
|
+
const controlPanelConfig = await szxkFunc.handleGetControlPanelConfig(item2 == null ? void 0 : item2["instance-source-number"], commonRequest);
|
|
64
74
|
if (controlPanelConfig) {
|
|
65
75
|
const nonUniversalHeader = (controlPanelConfig == null ? void 0 : controlPanelConfig["non-universal-header"]) || [];
|
|
66
76
|
const labelConfig = (nonUniversalHeader == null ? void 0 : nonUniversalHeader["label"]) || [];
|
|
@@ -89,14 +99,11 @@ const MySelect = ({
|
|
|
89
99
|
interfaceTypeSysDict,
|
|
90
100
|
actionUrlKey,
|
|
91
101
|
actionUrlExtraParams,
|
|
92
|
-
item
|
|
102
|
+
item: item2
|
|
93
103
|
});
|
|
94
104
|
setOptions(list);
|
|
95
105
|
};
|
|
96
|
-
|
|
97
|
-
const [selectedValues, setSelectedValues] = react.useState([]);
|
|
98
|
-
const [confirmValues, setConfirmValues] = react.useState([]);
|
|
99
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: item.input === "mult-select" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", ...style }, children: [
|
|
106
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: item2.input === "mult-select" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", ...style }, children: [
|
|
100
107
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
101
108
|
reactVant.Field,
|
|
102
109
|
{
|
|
@@ -110,7 +117,7 @@ const MySelect = ({
|
|
|
110
117
|
setSelectedValues([...confirmValues]);
|
|
111
118
|
setShowPopup(true);
|
|
112
119
|
},
|
|
113
|
-
placeholder: langId === "10001" ? (
|
|
120
|
+
placeholder: langId === "10001" ? (item2 == null ? void 0 : item2["default-prompt"]) || "请选择" : (item2 == null ? void 0 : item2["default-prompt"]) || "Please select"
|
|
114
121
|
}
|
|
115
122
|
),
|
|
116
123
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -136,14 +143,38 @@ const MySelect = ({
|
|
|
136
143
|
}
|
|
137
144
|
)
|
|
138
145
|
] }),
|
|
146
|
+
(item2 == null ? void 0 : item2["custom-operation"]) && item2.input === "mult-select" && ((_a = item2 == null ? void 0 : item2["operation-types"]) == null ? void 0 : _a.includes("check-all")) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles["checkbox-group-check-all"], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
147
|
+
reactVant.Checkbox,
|
|
148
|
+
{
|
|
149
|
+
className: styles["item"],
|
|
150
|
+
shape: "square",
|
|
151
|
+
checked: isAllChecked,
|
|
152
|
+
onChange: (v) => {
|
|
153
|
+
setIsAllChecked(v);
|
|
154
|
+
setSelectedValues(v ? options.map((item22) => item22.value) : []);
|
|
155
|
+
},
|
|
156
|
+
children: langId === "10001" ? "全选" : "check all"
|
|
157
|
+
}
|
|
158
|
+
) }),
|
|
139
159
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
140
160
|
"div",
|
|
141
161
|
{
|
|
142
162
|
style: {
|
|
143
|
-
height: " calc(60vh -
|
|
163
|
+
height: " calc(60vh - 126px)"
|
|
144
164
|
},
|
|
145
165
|
className: styles["checkbox-group-content"],
|
|
146
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
166
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
167
|
+
reactVant.Checkbox.Group,
|
|
168
|
+
{
|
|
169
|
+
iconSize: "18",
|
|
170
|
+
onChange: (v) => {
|
|
171
|
+
setSelectedValues(v);
|
|
172
|
+
setIsAllChecked((v == null ? void 0 : v.length) === (options == null ? void 0 : options.length));
|
|
173
|
+
},
|
|
174
|
+
value: selectedValues,
|
|
175
|
+
children: options.map((item22) => /* @__PURE__ */ jsxRuntime.jsx(reactVant.Checkbox, { shape: "square", className: styles["checkbox-item"], name: item22.value, children: item22.label }, item22.value))
|
|
176
|
+
}
|
|
177
|
+
)
|
|
147
178
|
}
|
|
148
179
|
)
|
|
149
180
|
] })
|
|
@@ -159,8 +190,8 @@ const MySelect = ({
|
|
|
159
190
|
text: "label"
|
|
160
191
|
},
|
|
161
192
|
onConfirm: (val) => {
|
|
162
|
-
if (attrid && (instanceList == null ? void 0 : instanceList.length) > 0 && (
|
|
163
|
-
const keyField =
|
|
193
|
+
if (attrid && (instanceList == null ? void 0 : instanceList.length) > 0 && (item2 == null ? void 0 : item2.inputType) === "instance-url") {
|
|
194
|
+
const keyField = item2 == null ? void 0 : item2["key-field"];
|
|
164
195
|
const row = func.findRowByValue(instanceList, String(val));
|
|
165
196
|
const keys = Object.keys(keyField || {});
|
|
166
197
|
const newObj = keys == null ? void 0 : keys.reduce((prev, cur) => {
|
|
@@ -175,16 +206,16 @@ const MySelect = ({
|
|
|
175
206
|
onChange(val);
|
|
176
207
|
},
|
|
177
208
|
children: (val, _, actions) => {
|
|
178
|
-
var
|
|
209
|
+
var _a2;
|
|
179
210
|
val = val || value;
|
|
180
211
|
let str = "";
|
|
181
212
|
if (Array.isArray(val)) {
|
|
182
213
|
str = (val == null ? void 0 : val.map((v) => {
|
|
183
|
-
var
|
|
184
|
-
return ((
|
|
214
|
+
var _a3;
|
|
215
|
+
return ((_a3 = options.find((x) => x.value === v)) == null ? void 0 : _a3.label) || v;
|
|
185
216
|
}).join(",")) || "";
|
|
186
217
|
}
|
|
187
|
-
str = ((
|
|
218
|
+
str = ((_a2 = options.find((v) => v.value === val)) == null ? void 0 : _a2.label) || val;
|
|
188
219
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
189
220
|
reactVant.Field,
|
|
190
221
|
{
|
|
@@ -192,7 +223,7 @@ const MySelect = ({
|
|
|
192
223
|
isLink: true,
|
|
193
224
|
readOnly: true,
|
|
194
225
|
clickable: true,
|
|
195
|
-
placeholder: langId === "10001" ? (
|
|
226
|
+
placeholder: langId === "10001" ? (item2 == null ? void 0 : item2["default-prompt"]) || "请选择" : (item2 == null ? void 0 : item2["default-prompt"]) || "Please select",
|
|
196
227
|
value: str,
|
|
197
228
|
onClick: () => {
|
|
198
229
|
if (readonly)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IformConfigItem, IformItemStyle } from '../DynamicForm/index.d';
|
|
3
|
-
import { AxiosResponse } from 'axios';
|
|
4
2
|
import { FormListFieldData, UploadFile } from 'antd';
|
|
3
|
+
import { IformConfigItem, IformItemStyle } from '../DynamicForm/index.d';
|
|
5
4
|
import { FormInstance } from 'react-vant';
|
|
5
|
+
import { AxiosResponse } from 'axios';
|
|
6
6
|
interface IDynamicFormProps {
|
|
7
7
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
8
8
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const icons = require("@ant-design/icons");
|
|
4
|
-
const
|
|
4
|
+
const antd = require("antd");
|
|
5
5
|
const method = require("../../utils/method");
|
|
6
|
+
const func = require("./func");
|
|
6
7
|
const SelectModelBackfillFormItem = require("./selectModelBackfillFormItem");
|
|
8
|
+
const reactVant = require("react-vant");
|
|
7
9
|
const react = require("react");
|
|
8
10
|
const isoWeek = require("dayjs/plugin/isoWeek");
|
|
9
11
|
const SelectModel = require("./selectModel");
|
|
10
12
|
const MyCheckbox = require("./myCheckbox");
|
|
11
13
|
const MyCascader = require("./myCascader");
|
|
14
|
+
const MyCalendar = require("./myCalendar");
|
|
15
|
+
const MyRichText = require("./myRichText");
|
|
12
16
|
const dayjs = require("dayjs");
|
|
13
17
|
const RadioCard = require("./radioCard");
|
|
14
18
|
const MySelect = require("./mySelect");
|
|
15
19
|
const MyUpload = require("./myUpload");
|
|
16
20
|
const MyRadio = require("./myRadio");
|
|
17
|
-
const antd = require("antd");
|
|
18
|
-
const reactVant = require("react-vant");
|
|
19
|
-
const MyCalendar = require("./myCalendar");
|
|
20
21
|
dayjs.extend(isoWeek);
|
|
21
22
|
function useDynamicForm(props) {
|
|
22
23
|
const {
|
|
@@ -758,6 +759,20 @@ function useDynamicForm(props) {
|
|
|
758
759
|
commonRequestWidthParams
|
|
759
760
|
}
|
|
760
761
|
);
|
|
762
|
+
case "rich-text":
|
|
763
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
764
|
+
MyRichText,
|
|
765
|
+
{
|
|
766
|
+
langId,
|
|
767
|
+
readonly,
|
|
768
|
+
item: item.json,
|
|
769
|
+
onChange: (val) => {
|
|
770
|
+
form.setFieldValue(item.attrid, val);
|
|
771
|
+
},
|
|
772
|
+
value: formatValue,
|
|
773
|
+
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
774
|
+
}
|
|
775
|
+
);
|
|
761
776
|
default:
|
|
762
777
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
763
778
|
reactVant.Input,
|
package/lib/index.js
CHANGED
|
@@ -4,6 +4,7 @@ const method = require("./utils/method");
|
|
|
4
4
|
const main = require("./main");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
6
|
const antd = require("antd");
|
|
7
|
+
const reactVant = require("react-vant");
|
|
7
8
|
const react = require("react");
|
|
8
9
|
const ReactDOM = require("react-dom/client");
|
|
9
10
|
const zhCN = require("antd/es/locale/zh_CN");
|
|
@@ -14,7 +15,7 @@ const tableDetail = "";
|
|
|
14
15
|
dayjs.locale("zh-cn");
|
|
15
16
|
const Demo = () => {
|
|
16
17
|
const formRef = react.useRef(null);
|
|
17
|
-
const [form] =
|
|
18
|
+
const [form] = reactVant.Form.useForm();
|
|
18
19
|
const [list, setList] = react.useState([]);
|
|
19
20
|
const [langId, setLangId] = react.useState("");
|
|
20
21
|
const onValuesChange = async (values, allValues) => {
|
|
@@ -32,15 +33,16 @@ const Demo = () => {
|
|
|
32
33
|
};
|
|
33
34
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
34
35
|
/* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
|
|
35
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(reactVant.Form, { form, onValuesChange, layout: "vertical", onFinish, children: [
|
|
36
37
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
-
main.
|
|
38
|
+
main.DynamicFormMobile,
|
|
38
39
|
{
|
|
39
40
|
formConfig: list,
|
|
40
41
|
readonly: false,
|
|
41
42
|
form,
|
|
42
43
|
relatedid: "guid",
|
|
43
44
|
colNum: 1,
|
|
45
|
+
defaultWidth: 358,
|
|
44
46
|
commonRequestWidthParams: () => {
|
|
45
47
|
return new Promise((resolve, reject) => {
|
|
46
48
|
});
|
|
@@ -55,7 +57,7 @@ const Demo = () => {
|
|
|
55
57
|
langId
|
|
56
58
|
}
|
|
57
59
|
),
|
|
58
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactVant.Form.Item, { name: "submit", style: { marginLeft: "auto" } })
|
|
59
61
|
] }) }),
|
|
60
62
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
61
63
|
"2. 测试循环滚动组件",
|
package/lib/mock/index.js
CHANGED
|
@@ -10,10 +10,10 @@ const attrList = [
|
|
|
10
10
|
attrid: "30BDE6E7977E40069B55DDE61C8795AE",
|
|
11
11
|
attrname: "Dates",
|
|
12
12
|
attrtype: 0,
|
|
13
|
-
info: '{"input":"
|
|
13
|
+
info: '{"input":"mult-select","dataType":"string","data":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"inputType":"local","length":500,"must":true}',
|
|
14
14
|
info_base64: 0,
|
|
15
15
|
createtime: "2026-02-11 15:12:26",
|
|
16
|
-
attrvalue: "
|
|
16
|
+
attrvalue: "",
|
|
17
17
|
serialnum: 1,
|
|
18
18
|
children: []
|
|
19
19
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "szld-libs",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.50",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"crypto-js": "^4.2.0",
|
|
25
25
|
"dayjs": "^1.11.19",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
|
+
"lucide-react": "^1.21.0",
|
|
27
28
|
"pako": "^2.1.0",
|
|
28
29
|
"query-string": "^9.3.1",
|
|
29
30
|
"react": "^18.2.0",
|
package/es/utils/enum.d.ts
DELETED
package/es/utils/enum.js
DELETED
package/lib/utils/enum.d.ts
DELETED
package/lib/utils/enum.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const encryptParamStrings = ["AppID", "Password", "PageName", "Controlname", "InterfaceType", "SessionID"];
|
|
4
|
-
const TOKEN = "TOKEN";
|
|
5
|
-
const USERINFO = "USERINFO";
|
|
6
|
-
const OEID = "OEID";
|
|
7
|
-
exports.OEID = OEID;
|
|
8
|
-
exports.TOKEN = TOKEN;
|
|
9
|
-
exports.USERINFO = USERINFO;
|
|
10
|
-
exports.encryptParamStrings = encryptParamStrings;
|