szld-libs 0.4.25 → 0.4.27
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 +6905 -6898
- package/dist/szld-components.umd.js +37 -37
- package/es/components/DynamicFormMobile/index.js +2 -1
- package/es/components/DynamicFormMobile/myCalendar/index.js +3 -3
- package/es/components/DynamicFormMobile/useDynamicForm.d.ts +1 -0
- package/es/components/DynamicFormMobile/useDynamicForm.js +11 -4
- package/es/index.js +22 -27
- package/lib/components/DynamicFormMobile/index.js +2 -1
- package/lib/components/DynamicFormMobile/myCalendar/index.js +3 -3
- package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +1 -0
- package/lib/components/DynamicFormMobile/useDynamicForm.js +11 -4
- package/lib/index.js +21 -26
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { Calendar, Cell } from "react-vant";
|
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
4
|
import { useState, useEffect } from "react";
|
|
5
5
|
const StringCompatibleCalendar = (props) => {
|
|
6
|
-
const { value, onChange, langId, type
|
|
6
|
+
const { value, onChange, langId, type } = props;
|
|
7
7
|
const [internalValue, setInternalValue] = useState(() => {
|
|
8
8
|
if (!value)
|
|
9
9
|
return void 0;
|
|
@@ -52,7 +52,7 @@ const StringCompatibleCalendar = (props) => {
|
|
|
52
52
|
onChange(str);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
return /* @__PURE__ */ jsx(Calendar, { type, value: internalValue, onConfirm: handleChange, children: (val, actions) => {
|
|
55
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Calendar, { type, value: internalValue, onConfirm: handleChange, children: (val, actions) => {
|
|
56
56
|
const valType = typeof val;
|
|
57
57
|
if (valType === "string") {
|
|
58
58
|
val = val.split("~");
|
|
@@ -72,7 +72,7 @@ const StringCompatibleCalendar = (props) => {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
|
-
} });
|
|
75
|
+
} }) });
|
|
76
76
|
};
|
|
77
77
|
export {
|
|
78
78
|
StringCompatibleCalendar as default
|
|
@@ -21,6 +21,7 @@ interface IDynamicFormProps {
|
|
|
21
21
|
hideAttrList?: string[];
|
|
22
22
|
langId?: string;
|
|
23
23
|
getTitle?: (pageID: string, dataID: string) => string;
|
|
24
|
+
formListItemName?: string;
|
|
24
25
|
}
|
|
25
26
|
type NestedFormListFieldData = FormListFieldData & {
|
|
26
27
|
parentName?: (string | number)[];
|
|
@@ -32,7 +32,8 @@ function useDynamicForm(props) {
|
|
|
32
32
|
CustomModalComponent,
|
|
33
33
|
hideAttrList = [],
|
|
34
34
|
langId = "10001",
|
|
35
|
-
getTitle
|
|
35
|
+
getTitle,
|
|
36
|
+
formListItemName = "customFormList"
|
|
36
37
|
} = props;
|
|
37
38
|
const formConfigRef = useRef([]);
|
|
38
39
|
const { message } = App.useApp();
|
|
@@ -329,7 +330,8 @@ function useDynamicForm(props) {
|
|
|
329
330
|
relatedid,
|
|
330
331
|
form,
|
|
331
332
|
defaultWidth: width,
|
|
332
|
-
customWidth: { width: "100%" }
|
|
333
|
+
customWidth: { width: "100%" },
|
|
334
|
+
formListField
|
|
333
335
|
})
|
|
334
336
|
},
|
|
335
337
|
index
|
|
@@ -370,7 +372,8 @@ function useDynamicForm(props) {
|
|
|
370
372
|
radioAlign,
|
|
371
373
|
relatedid,
|
|
372
374
|
form,
|
|
373
|
-
defaultWidth
|
|
375
|
+
defaultWidth,
|
|
376
|
+
formListField
|
|
374
377
|
})
|
|
375
378
|
},
|
|
376
379
|
itemWithJson.attrid
|
|
@@ -412,11 +415,13 @@ function useDynamicForm(props) {
|
|
|
412
415
|
relatedid,
|
|
413
416
|
form,
|
|
414
417
|
defaultWidth = 358,
|
|
415
|
-
customWidth = {}
|
|
418
|
+
customWidth = {},
|
|
419
|
+
formListField
|
|
416
420
|
}) => {
|
|
417
421
|
var _a, _b, _c;
|
|
418
422
|
const mode = item.json.input || "text";
|
|
419
423
|
const attrid = item.attrid;
|
|
424
|
+
const formItemName = formListField ? Array.isArray(formListField.name) ? [...formListField.name, item.attrid] : [formListItemName, formListField.name, item.attrid] : item.attrid;
|
|
420
425
|
const formatValue = handleSetFormItemInitialValue(item);
|
|
421
426
|
const message2 = ((_a = item.json) == null ? void 0 : _a["default-prompt"]) || "";
|
|
422
427
|
const placeholder = handleGetPlaceholder(item, langId);
|
|
@@ -609,6 +614,7 @@ function useDynamicForm(props) {
|
|
|
609
614
|
value: formatValue,
|
|
610
615
|
type: "range",
|
|
611
616
|
onChange: (date) => {
|
|
617
|
+
form.setFieldValue(formItemName, date);
|
|
612
618
|
}
|
|
613
619
|
}
|
|
614
620
|
);
|
|
@@ -620,6 +626,7 @@ function useDynamicForm(props) {
|
|
|
620
626
|
value: formatValue,
|
|
621
627
|
type: "multiple",
|
|
622
628
|
onChange: (date) => {
|
|
629
|
+
form.setFieldValue(formItemName, date);
|
|
623
630
|
}
|
|
624
631
|
}
|
|
625
632
|
);
|
package/es/index.js
CHANGED
|
@@ -4,13 +4,12 @@ import { handleAttrList } from "./utils/method";
|
|
|
4
4
|
import { BackHeader, DynamicFormMobile } from "./main";
|
|
5
5
|
import { BrowserRouter } from "react-router-dom";
|
|
6
6
|
import { ConfigProvider, App } from "antd";
|
|
7
|
-
import { Form } from "react-vant";
|
|
7
|
+
import { Form, Button } from "react-vant";
|
|
8
8
|
import { useRef, useState, useEffect } from "react";
|
|
9
9
|
import ReactDOM from "react-dom/client";
|
|
10
10
|
import zhCN from "antd/es/locale/zh_CN";
|
|
11
11
|
import { attrList } from "./mock";
|
|
12
12
|
import dayjs from "dayjs";
|
|
13
|
-
import "./utils/szxkFunc";
|
|
14
13
|
const index = "";
|
|
15
14
|
const tableDetail = "";
|
|
16
15
|
dayjs.locale("zh-cn");
|
|
@@ -24,37 +23,33 @@ const Demo = () => {
|
|
|
24
23
|
useEffect(() => {
|
|
25
24
|
setList(handleAttrList(attrList));
|
|
26
25
|
setTimeout(() => {
|
|
27
|
-
form.setFieldsValue({
|
|
28
|
-
customFormList: [
|
|
29
|
-
{
|
|
30
|
-
"30BDE6E7977E40069B55DDE61C8795AE": ["2026-05-21", "2026-05-28"]
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
});
|
|
34
26
|
}, 2e3);
|
|
35
27
|
}, []);
|
|
36
28
|
const onFinish = async (values) => {
|
|
37
29
|
};
|
|
38
30
|
return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
39
31
|
/* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
|
|
40
|
-
/* @__PURE__ */ jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
32
|
+
/* @__PURE__ */ jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxs(Form, { form, onValuesChange, onFinish, children: [
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
DynamicFormMobile,
|
|
35
|
+
{
|
|
36
|
+
formConfig: list,
|
|
37
|
+
readonly: false,
|
|
38
|
+
form,
|
|
39
|
+
relatedid: "guid",
|
|
40
|
+
colNum: 1,
|
|
41
|
+
defaultWidth: 358,
|
|
42
|
+
commonRequestWidthParams,
|
|
43
|
+
uploadAction: uploadFormAction,
|
|
44
|
+
commonRequest,
|
|
45
|
+
instructionShowMode: "icon",
|
|
46
|
+
ref: formRef,
|
|
47
|
+
formShowType: "table",
|
|
48
|
+
langId
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(Form.Item, { name: "submit", style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx(Button, { round: true, nativeType: "submit", type: "primary", block: true, children: "提交" }) })
|
|
52
|
+
] }) }),
|
|
58
53
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
59
54
|
"2. 测试循环滚动组件",
|
|
60
55
|
/* @__PURE__ */ jsx(
|
|
@@ -4,7 +4,7 @@ const reactVant = require("react-vant");
|
|
|
4
4
|
const dayjs = require("dayjs");
|
|
5
5
|
const react = require("react");
|
|
6
6
|
const StringCompatibleCalendar = (props) => {
|
|
7
|
-
const { value, onChange, langId, type
|
|
7
|
+
const { value, onChange, langId, type } = props;
|
|
8
8
|
const [internalValue, setInternalValue] = react.useState(() => {
|
|
9
9
|
if (!value)
|
|
10
10
|
return void 0;
|
|
@@ -53,7 +53,7 @@ const StringCompatibleCalendar = (props) => {
|
|
|
53
53
|
onChange(str);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactVant.Calendar, { type, value: internalValue, onConfirm: handleChange, children: (val, actions) => {
|
|
56
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(reactVant.Calendar, { type, value: internalValue, onConfirm: handleChange, children: (val, actions) => {
|
|
57
57
|
const valType = typeof val;
|
|
58
58
|
if (valType === "string") {
|
|
59
59
|
val = val.split("~");
|
|
@@ -73,6 +73,6 @@ const StringCompatibleCalendar = (props) => {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
|
-
} });
|
|
76
|
+
} }) });
|
|
77
77
|
};
|
|
78
78
|
module.exports = StringCompatibleCalendar;
|
|
@@ -21,6 +21,7 @@ interface IDynamicFormProps {
|
|
|
21
21
|
hideAttrList?: string[];
|
|
22
22
|
langId?: string;
|
|
23
23
|
getTitle?: (pageID: string, dataID: string) => string;
|
|
24
|
+
formListItemName?: string;
|
|
24
25
|
}
|
|
25
26
|
type NestedFormListFieldData = FormListFieldData & {
|
|
26
27
|
parentName?: (string | number)[];
|
|
@@ -33,7 +33,8 @@ function useDynamicForm(props) {
|
|
|
33
33
|
CustomModalComponent,
|
|
34
34
|
hideAttrList = [],
|
|
35
35
|
langId = "10001",
|
|
36
|
-
getTitle
|
|
36
|
+
getTitle,
|
|
37
|
+
formListItemName = "customFormList"
|
|
37
38
|
} = props;
|
|
38
39
|
const formConfigRef = react.useRef([]);
|
|
39
40
|
const { message } = antd.App.useApp();
|
|
@@ -330,7 +331,8 @@ function useDynamicForm(props) {
|
|
|
330
331
|
relatedid,
|
|
331
332
|
form,
|
|
332
333
|
defaultWidth: width,
|
|
333
|
-
customWidth: { width: "100%" }
|
|
334
|
+
customWidth: { width: "100%" },
|
|
335
|
+
formListField
|
|
334
336
|
})
|
|
335
337
|
},
|
|
336
338
|
index
|
|
@@ -371,7 +373,8 @@ function useDynamicForm(props) {
|
|
|
371
373
|
radioAlign,
|
|
372
374
|
relatedid,
|
|
373
375
|
form,
|
|
374
|
-
defaultWidth
|
|
376
|
+
defaultWidth,
|
|
377
|
+
formListField
|
|
375
378
|
})
|
|
376
379
|
},
|
|
377
380
|
itemWithJson.attrid
|
|
@@ -413,11 +416,13 @@ function useDynamicForm(props) {
|
|
|
413
416
|
relatedid,
|
|
414
417
|
form,
|
|
415
418
|
defaultWidth = 358,
|
|
416
|
-
customWidth = {}
|
|
419
|
+
customWidth = {},
|
|
420
|
+
formListField
|
|
417
421
|
}) => {
|
|
418
422
|
var _a, _b, _c;
|
|
419
423
|
const mode = item.json.input || "text";
|
|
420
424
|
const attrid = item.attrid;
|
|
425
|
+
const formItemName = formListField ? Array.isArray(formListField.name) ? [...formListField.name, item.attrid] : [formListItemName, formListField.name, item.attrid] : item.attrid;
|
|
421
426
|
const formatValue = func.handleSetFormItemInitialValue(item);
|
|
422
427
|
const message2 = ((_a = item.json) == null ? void 0 : _a["default-prompt"]) || "";
|
|
423
428
|
const placeholder = func.handleGetPlaceholder(item, langId);
|
|
@@ -610,6 +615,7 @@ function useDynamicForm(props) {
|
|
|
610
615
|
value: formatValue,
|
|
611
616
|
type: "range",
|
|
612
617
|
onChange: (date) => {
|
|
618
|
+
form.setFieldValue(formItemName, date);
|
|
613
619
|
}
|
|
614
620
|
}
|
|
615
621
|
);
|
|
@@ -621,6 +627,7 @@ function useDynamicForm(props) {
|
|
|
621
627
|
value: formatValue,
|
|
622
628
|
type: "multiple",
|
|
623
629
|
onChange: (date) => {
|
|
630
|
+
form.setFieldValue(formItemName, date);
|
|
624
631
|
}
|
|
625
632
|
}
|
|
626
633
|
);
|
package/lib/index.js
CHANGED
|
@@ -11,7 +11,6 @@ const ReactDOM = require("react-dom/client");
|
|
|
11
11
|
const zhCN = require("antd/es/locale/zh_CN");
|
|
12
12
|
const mock = require("./mock");
|
|
13
13
|
const dayjs = require("dayjs");
|
|
14
|
-
require("./utils/szxkFunc");
|
|
15
14
|
const index = "";
|
|
16
15
|
const tableDetail = "";
|
|
17
16
|
dayjs.locale("zh-cn");
|
|
@@ -25,37 +24,33 @@ const Demo = () => {
|
|
|
25
24
|
react.useEffect(() => {
|
|
26
25
|
setList(method.handleAttrList(mock.attrList));
|
|
27
26
|
setTimeout(() => {
|
|
28
|
-
form.setFieldsValue({
|
|
29
|
-
customFormList: [
|
|
30
|
-
{
|
|
31
|
-
"30BDE6E7977E40069B55DDE61C8795AE": ["2026-05-21", "2026-05-28"]
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
});
|
|
35
27
|
}, 2e3);
|
|
36
28
|
}, []);
|
|
37
29
|
const onFinish = async (values) => {
|
|
38
30
|
};
|
|
39
31
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
40
32
|
/* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
|
|
41
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(reactVant.Form, { form, onValuesChange, onFinish, children: [
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
+
main.DynamicFormMobile,
|
|
36
|
+
{
|
|
37
|
+
formConfig: list,
|
|
38
|
+
readonly: false,
|
|
39
|
+
form,
|
|
40
|
+
relatedid: "guid",
|
|
41
|
+
colNum: 1,
|
|
42
|
+
defaultWidth: 358,
|
|
43
|
+
commonRequestWidthParams: services.commonRequestWidthParams,
|
|
44
|
+
uploadAction: services.uploadFormAction,
|
|
45
|
+
commonRequest: services.commonRequest,
|
|
46
|
+
instructionShowMode: "icon",
|
|
47
|
+
ref: formRef,
|
|
48
|
+
formShowType: "table",
|
|
49
|
+
langId
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactVant.Form.Item, { name: "submit", style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(reactVant.Button, { round: true, nativeType: "submit", type: "primary", block: true, children: "提交" }) })
|
|
53
|
+
] }) }),
|
|
59
54
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
60
55
|
"2. 测试循环滚动组件",
|
|
61
56
|
/* @__PURE__ */ jsxRuntime.jsx(
|