szld-libs 0.4.53 → 0.4.54
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 +3786 -3786
- package/dist/szld-components.umd.js +86 -86
- package/es/components/DynamicForm/useDynamicForm.js +13 -13
- package/es/index.js +3 -3
- package/es/mock/index.d.ts +3 -0
- package/es/mock/index.js +628 -8
- package/lib/components/DynamicForm/useDynamicForm.js +13 -13
- package/lib/index.js +3 -3
- package/lib/mock/index.d.ts +3 -0
- package/lib/mock/index.js +627 -7
- package/package.json +1 -1
|
@@ -303,7 +303,7 @@ function useDynamicForm(props) {
|
|
|
303
303
|
formListField,
|
|
304
304
|
isShowLabel = true
|
|
305
305
|
}) => {
|
|
306
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
306
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
307
307
|
const hidden = (_a = itemWithJson.json) == null ? void 0 : _a.hidden;
|
|
308
308
|
if (((_b = itemWithJson.json) == null ? void 0 : _b.hide) === true) {
|
|
309
309
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
@@ -337,17 +337,17 @@ function useDynamicForm(props) {
|
|
|
337
337
|
{
|
|
338
338
|
label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"],
|
|
339
339
|
required: ((_e = itemWithJson.json) == null ? void 0 : _e.must) && !hidden,
|
|
340
|
-
extra: /* @__PURE__ */ jsxRuntime.jsx(
|
|
340
|
+
extra: ((_g = (_f = itemWithJson.json) == null ? void 0 : _f.extraDescObj) == null ? void 0 : _g.info) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
341
341
|
"span",
|
|
342
342
|
{
|
|
343
343
|
style: {
|
|
344
|
-
marginTop: ((
|
|
344
|
+
marginTop: ((_i = (_h = itemWithJson.json) == null ? void 0 : _h.extraDescObj) == null ? void 0 : _i.info) ? 10 : 0,
|
|
345
345
|
display: "inline-block",
|
|
346
|
-
color: (
|
|
346
|
+
color: (_k = (_j = itemWithJson.json) == null ? void 0 : _j.extraDescObj) == null ? void 0 : _k.color
|
|
347
347
|
},
|
|
348
|
-
children: (
|
|
348
|
+
children: (_m = (_l = itemWithJson.json) == null ? void 0 : _l.extraDescObj) == null ? void 0 : _m.info
|
|
349
349
|
}
|
|
350
|
-
),
|
|
350
|
+
) : null,
|
|
351
351
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Space.Compact, { children: combinations.map((item, index) => {
|
|
352
352
|
var _a2, _b2, _c2, _d2, _e2;
|
|
353
353
|
let initValue = func.handleSetFormItemInitialValue(item);
|
|
@@ -413,28 +413,28 @@ function useDynamicForm(props) {
|
|
|
413
413
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
414
414
|
initialValue,
|
|
415
415
|
hidden,
|
|
416
|
-
extra: ((
|
|
416
|
+
extra: ((_o = (_n = itemWithJson.json) == null ? void 0 : _n.extraDescObj) == null ? void 0 : _o.info) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
417
417
|
"span",
|
|
418
418
|
{
|
|
419
419
|
style: {
|
|
420
|
-
marginTop: ((
|
|
420
|
+
marginTop: ((_q = (_p = itemWithJson.json) == null ? void 0 : _p.extraDescObj) == null ? void 0 : _q.info) ? 10 : 0,
|
|
421
421
|
display: "inline-block",
|
|
422
|
-
color: (
|
|
422
|
+
color: (_s = (_r = itemWithJson.json) == null ? void 0 : _r.extraDescObj) == null ? void 0 : _s.color
|
|
423
423
|
},
|
|
424
|
-
children: (
|
|
424
|
+
children: (_u = (_t = itemWithJson.json) == null ? void 0 : _t.extraDescObj) == null ? void 0 : _u.info
|
|
425
425
|
}
|
|
426
426
|
) : null,
|
|
427
427
|
rules: [
|
|
428
|
-
...((
|
|
428
|
+
...((_v = itemWithJson.json) == null ? void 0 : _v.must) && !hidden ? [
|
|
429
429
|
{
|
|
430
430
|
required: true,
|
|
431
431
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
432
432
|
}
|
|
433
433
|
] : [],
|
|
434
|
-
...((
|
|
434
|
+
...((_w = itemWithJson.json) == null ? void 0 : _w.regexp) ? [
|
|
435
435
|
{
|
|
436
436
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
437
|
-
message: ((
|
|
437
|
+
message: ((_x = itemWithJson.json) == null ? void 0 : _x["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
438
438
|
}
|
|
439
439
|
] : []
|
|
440
440
|
],
|
package/lib/index.js
CHANGED
|
@@ -17,17 +17,17 @@ const Demo = () => {
|
|
|
17
17
|
const [form] = antd.Form.useForm();
|
|
18
18
|
const [list, setList] = react.useState([]);
|
|
19
19
|
const [langId, setLangId] = react.useState("10002");
|
|
20
|
-
const onValuesChange = async (
|
|
20
|
+
const onValuesChange = async (values2, allValues) => {
|
|
21
21
|
};
|
|
22
22
|
react.useEffect(() => {
|
|
23
23
|
setList(method.handleAttrList(mock.attrList));
|
|
24
24
|
}, []);
|
|
25
|
-
const onFinish = async (
|
|
25
|
+
const onFinish = async (values2) => {
|
|
26
26
|
method.handleSubmitForm(
|
|
27
27
|
{
|
|
28
28
|
attr_list: list
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
values2
|
|
31
31
|
);
|
|
32
32
|
};
|
|
33
33
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
|