szld-libs 0.4.39 → 0.4.41
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 +3546 -3534
- package/dist/szld-components.umd.js +29 -29
- package/es/components/DynamicForm/func.js +4 -1
- package/es/components/DynamicFormMobile/func.js +4 -1
- package/es/components/DynamicFormMobile/myCalendar/index.js +4 -2
- package/es/components/DynamicFormMobile/useDynamicForm.js +2 -2
- package/es/index.js +19 -8
- package/es/mock/index.js +225 -366
- package/es/utils/method.js +7 -4
- package/es/utils/szxkFunc.d.ts +1 -0
- package/es/utils/szxkFunc.js +10 -1
- package/lib/components/DynamicForm/func.js +4 -1
- package/lib/components/DynamicFormMobile/func.js +4 -1
- package/lib/components/DynamicFormMobile/myCalendar/index.js +4 -2
- package/lib/components/DynamicFormMobile/useDynamicForm.js +2 -2
- package/lib/index.js +17 -6
- package/lib/mock/index.js +225 -366
- package/lib/utils/method.js +7 -4
- package/lib/utils/szxkFunc.d.ts +1 -0
- package/lib/utils/szxkFunc.js +9 -0
- package/package.json +1 -1
- package/es/services/index.d.ts +0 -6
- package/es/services/index.js +0 -83
- package/es/services/request.d.ts +0 -6
- package/es/services/request.js +0 -140
- package/es/services/status.d.ts +0 -1
- package/es/services/status.js +0 -44
- package/es/services/vite.svg +0 -1
- package/lib/services/index.d.ts +0 -6
- package/lib/services/index.js +0 -83
- package/lib/services/request.d.ts +0 -6
- package/lib/services/request.js +0 -140
- package/lib/services/status.d.ts +0 -1
- package/lib/services/status.js +0 -44
- package/lib/services/vite.svg +0 -1
|
@@ -34,7 +34,7 @@ const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
|
34
34
|
return defaultMessage;
|
|
35
35
|
};
|
|
36
36
|
const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
37
|
-
var _a, _b, _c, _d, _e, _f;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
38
38
|
const inputType = (_a = itemWithJson.json) == null ? void 0 : _a.input;
|
|
39
39
|
let initialValue = itemWithJson.attrvalue || ((_b = itemWithJson.json) == null ? void 0 : _b.default);
|
|
40
40
|
if (inputType === "label" && initialValue) {
|
|
@@ -81,6 +81,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
81
81
|
if (inputType === "time-picker" && !initialValue && ((_e = itemWithJson.json) == null ? void 0 : _e["auto-generate"]) && ((_f = itemWithJson.json) == null ? void 0 : _f["auto-generate-type"]) === "currenttime") {
|
|
82
82
|
initialValue = dayjs().format("YYYY-MM-DD HH:mm:ss:ss");
|
|
83
83
|
}
|
|
84
|
+
if (inputType === "time-picker" && !initialValue && ((_g = itemWithJson.json) == null ? void 0 : _g["auto-generate"]) && ((_h = itemWithJson.json) == null ? void 0 : _h["auto-generate-type"]) === "currenttimestamp") {
|
|
85
|
+
initialValue = dayjs().unix().toString();
|
|
86
|
+
}
|
|
84
87
|
if (itemWithJson.attrtype === 1) {
|
|
85
88
|
initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
|
|
86
89
|
}
|
|
@@ -34,7 +34,7 @@ const handleGetPlaceholder = (itemWithJson, langId) => {
|
|
|
34
34
|
return defaultMessage;
|
|
35
35
|
};
|
|
36
36
|
const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
37
|
-
var _a, _b, _c, _d, _e, _f;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
38
38
|
const inputType = (_a = itemWithJson.json) == null ? void 0 : _a.input;
|
|
39
39
|
let initialValue = itemWithJson.attrvalue || ((_b = itemWithJson.json) == null ? void 0 : _b.default) || "";
|
|
40
40
|
if (inputType === "label" && initialValue) {
|
|
@@ -80,6 +80,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
|
|
|
80
80
|
if (inputType === "time-picker" && !initialValue && ((_e = itemWithJson.json) == null ? void 0 : _e["auto-generate"]) && ((_f = itemWithJson.json) == null ? void 0 : _f["auto-generate-type"]) === "currenttime") {
|
|
81
81
|
initialValue = dayjs().format("YYYY-MM-DD HH:mm:ss:ss");
|
|
82
82
|
}
|
|
83
|
+
if (inputType === "time-picker" && !initialValue && ((_g = itemWithJson.json) == null ? void 0 : _g["auto-generate"]) && ((_h = itemWithJson.json) == null ? void 0 : _h["auto-generate-type"]) === "currenttimestamp") {
|
|
84
|
+
initialValue = dayjs().unix().toString();
|
|
85
|
+
}
|
|
83
86
|
if (itemWithJson.attrtype === 1) {
|
|
84
87
|
initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
|
|
85
88
|
}
|
|
@@ -52,10 +52,12 @@ const StringCompatibleCalendar = (props) => {
|
|
|
52
52
|
onChange(str);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
+
const placeholder = langId === "10001" ? "请选择日期" : "Please select a date";
|
|
55
56
|
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Calendar, { type, value: internalValue, onConfirm: handleChange, children: (val, actions) => {
|
|
56
57
|
const valType = typeof val;
|
|
58
|
+
const delimiter = type === "multiple" ? "," : "~";
|
|
57
59
|
if (valType === "string") {
|
|
58
|
-
val = val.split(
|
|
60
|
+
val = val.split(delimiter);
|
|
59
61
|
if (val.length === 1) {
|
|
60
62
|
val = [val[0], val[1]];
|
|
61
63
|
}
|
|
@@ -66,7 +68,7 @@ const StringCompatibleCalendar = (props) => {
|
|
|
66
68
|
style: { padding: 0 },
|
|
67
69
|
value: val ? val.map(
|
|
68
70
|
(el) => dayjs(el).format("YYYY-MM-DD")
|
|
69
|
-
).join(
|
|
71
|
+
).join(delimiter) : placeholder,
|
|
70
72
|
onClick: (e) => {
|
|
71
73
|
actions.open();
|
|
72
74
|
}
|
|
@@ -303,7 +303,7 @@ function useDynamicForm(props) {
|
|
|
303
303
|
flex: width,
|
|
304
304
|
pointerEvents: readonly ? "none" : "auto",
|
|
305
305
|
opacity: readonly ? 0.5 : 1,
|
|
306
|
-
display: hidden ? "none" : "
|
|
306
|
+
display: hidden ? "none" : "flex"
|
|
307
307
|
},
|
|
308
308
|
label: index === 0 ? (_b2 = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _b2["combination-name"] : /* @__PURE__ */ jsx("div", { style: { visibility: "hidden" }, children: (_c2 = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _c2["combination-name"] }),
|
|
309
309
|
required: index === 0 ? ((_d2 = item.json) == null ? void 0 : _d2.must) && !hidden : false,
|
|
@@ -351,7 +351,7 @@ function useDynamicForm(props) {
|
|
|
351
351
|
style: {
|
|
352
352
|
pointerEvents: readonly ? "none" : "auto",
|
|
353
353
|
opacity: readonly ? 0.5 : 1,
|
|
354
|
-
display: hidden ? "none" : "
|
|
354
|
+
display: hidden ? "none" : "flex"
|
|
355
355
|
},
|
|
356
356
|
rules: [
|
|
357
357
|
...((_e = itemWithJson.json) == null ? void 0 : _e.must) && !hidden ? [
|
package/es/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { handleAttrList } from "./utils/method";
|
|
2
|
+
import { handleAttrList, handleSubmitForm } from "./utils/method";
|
|
4
3
|
import { BackHeader, DynamicFormMobile } from "./main";
|
|
5
4
|
import { BrowserRouter } from "react-router-dom";
|
|
6
5
|
import { ConfigProvider, App } from "antd";
|
|
7
|
-
import { Form
|
|
6
|
+
import { Form } from "react-vant";
|
|
8
7
|
import { useRef, useState, useEffect } from "react";
|
|
9
8
|
import ReactDOM from "react-dom/client";
|
|
10
9
|
import zhCN from "antd/es/locale/zh_CN";
|
|
@@ -26,10 +25,16 @@ const Demo = () => {
|
|
|
26
25
|
}, 2e3);
|
|
27
26
|
}, []);
|
|
28
27
|
const onFinish = async (values) => {
|
|
28
|
+
handleSubmitForm(
|
|
29
|
+
{
|
|
30
|
+
attr_list: attrList
|
|
31
|
+
},
|
|
32
|
+
values
|
|
33
|
+
);
|
|
29
34
|
};
|
|
30
35
|
return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
31
36
|
/* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
|
|
32
|
-
/* @__PURE__ */ jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxs(Form, { form, onValuesChange, onFinish, children: [
|
|
37
|
+
/* @__PURE__ */ jsx("div", { style: { padding: "20px" }, children: /* @__PURE__ */ jsxs(Form, { form, onValuesChange, layout: "vertical", onFinish, children: [
|
|
33
38
|
/* @__PURE__ */ jsx(
|
|
34
39
|
DynamicFormMobile,
|
|
35
40
|
{
|
|
@@ -39,15 +44,21 @@ const Demo = () => {
|
|
|
39
44
|
relatedid: "guid",
|
|
40
45
|
colNum: 1,
|
|
41
46
|
defaultWidth: 358,
|
|
42
|
-
commonRequestWidthParams
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
commonRequestWidthParams: () => {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
uploadAction: () => "",
|
|
52
|
+
commonRequest: () => {
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
});
|
|
55
|
+
},
|
|
45
56
|
instructionShowMode: "icon",
|
|
46
57
|
ref: formRef,
|
|
47
58
|
langId
|
|
48
59
|
}
|
|
49
60
|
),
|
|
50
|
-
/* @__PURE__ */ jsx(Form.Item, { name: "submit", style: { marginLeft: "auto" }
|
|
61
|
+
/* @__PURE__ */ jsx(Form.Item, { name: "submit", style: { marginLeft: "auto" } })
|
|
51
62
|
] }) }),
|
|
52
63
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
53
64
|
"2. 测试循环滚动组件",
|