szld-libs 0.3.48 → 0.3.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/szld-components.es.js +1221 -1221
- package/dist/szld-components.umd.js +35 -35
- package/es/components/DynamicForm/func.js +1 -1
- package/es/components/DynamicForm/myCheckbox/index.js +1 -1
- package/es/components/DynamicForm/myRadio/index.js +1 -1
- package/es/components/DynamicForm/mySelect/index.js +1 -1
- package/es/components/DynamicForm/useDynamicForm.js +2 -2
- package/es/index.js +8 -12
- package/es/mock/index.d.ts +1 -1
- package/es/mock/index.js +994 -84
- package/lib/components/DynamicForm/func.js +1 -1
- package/lib/components/DynamicForm/myCheckbox/index.js +1 -1
- package/lib/components/DynamicForm/myRadio/index.js +1 -1
- package/lib/components/DynamicForm/mySelect/index.js +1 -1
- package/lib/components/DynamicForm/useDynamicForm.js +2 -2
- package/lib/index.js +7 -11
- package/lib/mock/index.d.ts +1 -1
- package/lib/mock/index.js +994 -84
- package/package.json +1 -1
|
@@ -195,7 +195,7 @@ const handleSelectOptions = async ({
|
|
|
195
195
|
};
|
|
196
196
|
if (item.inputType === "local") {
|
|
197
197
|
options = ((_a = item.data) == null ? void 0 : _a.map((val) => ({
|
|
198
|
-
label: val,
|
|
198
|
+
label: getTitle(langConfig || [], val),
|
|
199
199
|
value: val
|
|
200
200
|
}))) || [];
|
|
201
201
|
if (item.options && Array.isArray(item.options)) {
|
|
@@ -23,7 +23,7 @@ const MyCheckbox = (props) => {
|
|
|
23
23
|
const [val, setVal] = useState(value || []);
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
handleLoadOptions();
|
|
26
|
-
}, [item.inputType, item.classify, item.data, item.options]);
|
|
26
|
+
}, [item.inputType, item.classify, item.data, item.options, langConfig]);
|
|
27
27
|
const handleLoadOptions = async () => {
|
|
28
28
|
const list2 = await handleSelectOptions({
|
|
29
29
|
commonRequestWidthParams,
|
|
@@ -21,7 +21,7 @@ const MyRadio = (props) => {
|
|
|
21
21
|
const [list, setList] = useState([]);
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
handleLoadOptions();
|
|
24
|
-
}, [item.inputType, item.classify, item.data, item.options]);
|
|
24
|
+
}, [item.inputType, item.classify, item.data, item.options, langConfig]);
|
|
25
25
|
const handleLoadOptions = async () => {
|
|
26
26
|
const list2 = await handleSelectOptions({
|
|
27
27
|
commonRequestWidthParams,
|
|
@@ -21,7 +21,7 @@ const MySelect = ({
|
|
|
21
21
|
const [loading, setLoading] = useState(false);
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
handleLoadOptions();
|
|
24
|
-
}, [item.inputType, item.classify, item.data, item.options]);
|
|
24
|
+
}, [item.inputType, item.classify, item.data, item.options, langConfig]);
|
|
25
25
|
const handleLoadOptions = async () => {
|
|
26
26
|
setLoading(true);
|
|
27
27
|
const list = await handleSelectOptions({
|
|
@@ -302,7 +302,7 @@ function useDynamicForm(props) {
|
|
|
302
302
|
return /* @__PURE__ */ jsx(Col, { span: 24 / colNum, children: /* @__PURE__ */ jsx(
|
|
303
303
|
Form.Item,
|
|
304
304
|
{
|
|
305
|
-
label: (_c = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _c["combination-name"],
|
|
305
|
+
label: getTitle(langConfig, (_c = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _c["combination-name"]),
|
|
306
306
|
required: (_d = itemWithJson.json) == null ? void 0 : _d.must,
|
|
307
307
|
children: /* @__PURE__ */ jsx(Space.Compact, { children: combinations.map((item, index) => {
|
|
308
308
|
var _a2, _b2, _c2, _d2;
|
|
@@ -397,7 +397,7 @@ function useDynamicForm(props) {
|
|
|
397
397
|
}
|
|
398
398
|
return null;
|
|
399
399
|
},
|
|
400
|
-
[handleDealInstruction, handleSetFormItemInitialValue, handleSetFormItemProps, renderNestedFormList]
|
|
400
|
+
[handleDealInstruction, handleSetFormItemInitialValue, handleSetFormItemProps, renderNestedFormList, langConfig]
|
|
401
401
|
);
|
|
402
402
|
const handleOnRemove = async (file) => {
|
|
403
403
|
var _a;
|
package/es/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { handleAttrList } from "./utils/method";
|
|
|
4
4
|
import { BackHeader, DynamicForm } from "./main";
|
|
5
5
|
import { BrowserRouter } from "react-router-dom";
|
|
6
6
|
import { ConfigProvider, App, Form, Button } from "antd";
|
|
7
|
-
import { useRef, useState } from "react";
|
|
7
|
+
import { useRef, useState, useEffect } from "react";
|
|
8
8
|
import ReactDOM from "react-dom/client";
|
|
9
9
|
import zhCN from "antd/es/locale/zh_CN";
|
|
10
10
|
import { attrList, langConfig } from "./mock";
|
|
@@ -16,18 +16,14 @@ const Demo = () => {
|
|
|
16
16
|
const formRef = useRef(null);
|
|
17
17
|
const [form] = Form.useForm();
|
|
18
18
|
const [list, setList] = useState(handleAttrList(attrList));
|
|
19
|
+
const [langList, setLangList] = useState([]);
|
|
19
20
|
const onValuesChange = async (values, allValues) => {
|
|
20
|
-
const keys = Object.keys(values);
|
|
21
|
-
if (keys.includes("6A5984BD547449088172BD33F2A965E8")) {
|
|
22
|
-
list.forEach((item) => {
|
|
23
|
-
if (item.attrid === "4E507938BE7448E5883CFCD9C962707D") {
|
|
24
|
-
item.json.data = ["1", "2", "3"];
|
|
25
|
-
item.info = JSON.stringify(item == null ? void 0 : item.json);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
setList([...list]);
|
|
29
|
-
}
|
|
30
21
|
};
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
setLangList(langConfig);
|
|
25
|
+
}, 2e3);
|
|
26
|
+
}, [langConfig]);
|
|
31
27
|
return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|
|
32
28
|
/* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
|
|
33
29
|
/* @__PURE__ */ jsx("div", { style: {}, children: /* @__PURE__ */ jsxs(Form, { form, onValuesChange, children: [
|
|
@@ -46,7 +42,7 @@ const Demo = () => {
|
|
|
46
42
|
instructionShowMode: "icon",
|
|
47
43
|
ref: formRef,
|
|
48
44
|
langId: "10001",
|
|
49
|
-
langConfig
|
|
45
|
+
langConfig: langList
|
|
50
46
|
}
|
|
51
47
|
),
|
|
52
48
|
/* @__PURE__ */ jsx(Form.Item, { name: "submit", style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx(Button, { type: "primary", htmlType: "submit", children: "提交" }) })
|