szld-libs 0.4.41 → 0.4.43
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 +6432 -6388
- package/dist/szld-components.umd.js +41 -41
- package/es/components/DynamicForm/index.d.ts +1 -0
- package/es/components/DynamicForm/useDynamicForm.js +26 -4
- package/es/components/DynamicFormMobile/useDynamicForm.js +24 -2
- package/es/mock/index.js +323 -408
- package/lib/components/DynamicForm/index.d.ts +1 -0
- package/lib/components/DynamicForm/useDynamicForm.js +26 -4
- package/lib/components/DynamicFormMobile/useDynamicForm.js +24 -2
- package/lib/mock/index.js +323 -408
- package/package.json +1 -1
|
@@ -300,7 +300,7 @@ function useDynamicForm(props) {
|
|
|
300
300
|
formListField,
|
|
301
301
|
isShowLabel = true
|
|
302
302
|
}) => {
|
|
303
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
304
304
|
const hidden = (_a = itemWithJson.json) == null ? void 0 : _a.hidden;
|
|
305
305
|
if (((_b = itemWithJson.json) == null ? void 0 : _b.hide) === true) {
|
|
306
306
|
return /* @__PURE__ */ jsx(Fragment$1, {});
|
|
@@ -334,6 +334,17 @@ function useDynamicForm(props) {
|
|
|
334
334
|
{
|
|
335
335
|
label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"],
|
|
336
336
|
required: ((_e = itemWithJson.json) == null ? void 0 : _e.must) && !hidden,
|
|
337
|
+
extra: /* @__PURE__ */ jsx(
|
|
338
|
+
"span",
|
|
339
|
+
{
|
|
340
|
+
style: {
|
|
341
|
+
marginTop: ((_g = (_f = itemWithJson.json) == null ? void 0 : _f.extraDescObj) == null ? void 0 : _g.info) ? 10 : 0,
|
|
342
|
+
display: "inline-block",
|
|
343
|
+
color: (_i = (_h = itemWithJson.json) == null ? void 0 : _h.extraDescObj) == null ? void 0 : _i.color
|
|
344
|
+
},
|
|
345
|
+
children: (_k = (_j = itemWithJson.json) == null ? void 0 : _j.extraDescObj) == null ? void 0 : _k.info
|
|
346
|
+
}
|
|
347
|
+
),
|
|
337
348
|
children: /* @__PURE__ */ jsx(Space.Compact, { children: combinations.map((item, index) => {
|
|
338
349
|
var _a2, _b2, _c2, _d2, _e2;
|
|
339
350
|
let initValue = handleSetFormItemInitialValue(item);
|
|
@@ -399,17 +410,28 @@ function useDynamicForm(props) {
|
|
|
399
410
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
400
411
|
initialValue,
|
|
401
412
|
hidden,
|
|
413
|
+
extra: /* @__PURE__ */ jsx(
|
|
414
|
+
"span",
|
|
415
|
+
{
|
|
416
|
+
style: {
|
|
417
|
+
marginTop: ((_m = (_l = itemWithJson.json) == null ? void 0 : _l.extraDescObj) == null ? void 0 : _m.info) ? 10 : 0,
|
|
418
|
+
display: "inline-block",
|
|
419
|
+
color: (_o = (_n = itemWithJson.json) == null ? void 0 : _n.extraDescObj) == null ? void 0 : _o.color
|
|
420
|
+
},
|
|
421
|
+
children: (_q = (_p = itemWithJson.json) == null ? void 0 : _p.extraDescObj) == null ? void 0 : _q.info
|
|
422
|
+
}
|
|
423
|
+
),
|
|
402
424
|
rules: [
|
|
403
|
-
...((
|
|
425
|
+
...((_r = itemWithJson.json) == null ? void 0 : _r.must) && !hidden ? [
|
|
404
426
|
{
|
|
405
427
|
required: true,
|
|
406
428
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
407
429
|
}
|
|
408
430
|
] : [],
|
|
409
|
-
...((
|
|
431
|
+
...((_s = itemWithJson.json) == null ? void 0 : _s.regexp) ? [
|
|
410
432
|
{
|
|
411
433
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
412
|
-
message: ((
|
|
434
|
+
message: ((_t = itemWithJson.json) == null ? void 0 : _t["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
413
435
|
}
|
|
414
436
|
] : []
|
|
415
437
|
],
|
|
@@ -253,7 +253,7 @@ function useDynamicForm(props) {
|
|
|
253
253
|
formListField,
|
|
254
254
|
isShowLabel = true
|
|
255
255
|
}) => {
|
|
256
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
256
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
257
257
|
const hidden = (_a = itemWithJson.json) == null ? void 0 : _a.hidden;
|
|
258
258
|
if (((_b = itemWithJson.json) == null ? void 0 : _b.hide) === true || (hideAttrList == null ? void 0 : hideAttrList.includes(itemWithJson.attrid))) {
|
|
259
259
|
return /* @__PURE__ */ jsx(Fragment$1, {});
|
|
@@ -284,7 +284,7 @@ function useDynamicForm(props) {
|
|
|
284
284
|
const { combinations = [] } = itemWithJson.json || {};
|
|
285
285
|
if (combinations == null ? void 0 : combinations.length) {
|
|
286
286
|
return /* @__PURE__ */ jsx(Flex, { children: combinations.map((item, index) => {
|
|
287
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
287
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2;
|
|
288
288
|
let initValue = handleSetFormItemInitialValue(item);
|
|
289
289
|
let width = defaultWidth;
|
|
290
290
|
const mode = item.json.input || "text";
|
|
@@ -323,6 +323,17 @@ function useDynamicForm(props) {
|
|
|
323
323
|
}
|
|
324
324
|
] : []
|
|
325
325
|
],
|
|
326
|
+
intro: /* @__PURE__ */ jsx(
|
|
327
|
+
"span",
|
|
328
|
+
{
|
|
329
|
+
style: {
|
|
330
|
+
marginTop: ((_i2 = (_h2 = itemWithJson.json) == null ? void 0 : _h2.extraDescObj) == null ? void 0 : _i2.info) ? 10 : 0,
|
|
331
|
+
display: "inline-block",
|
|
332
|
+
color: (_k2 = (_j2 = itemWithJson.json) == null ? void 0 : _j2.extraDescObj) == null ? void 0 : _k2.color
|
|
333
|
+
},
|
|
334
|
+
children: (_m2 = (_l2 = itemWithJson.json) == null ? void 0 : _l2.extraDescObj) == null ? void 0 : _m2.info
|
|
335
|
+
}
|
|
336
|
+
),
|
|
326
337
|
...handleSetFormItemProps(item),
|
|
327
338
|
children: handleRenderItemInputMode({
|
|
328
339
|
item,
|
|
@@ -368,6 +379,17 @@ function useDynamicForm(props) {
|
|
|
368
379
|
] : []
|
|
369
380
|
],
|
|
370
381
|
...handleSetFormItemProps(itemWithJson),
|
|
382
|
+
intro: /* @__PURE__ */ jsx(
|
|
383
|
+
"span",
|
|
384
|
+
{
|
|
385
|
+
style: {
|
|
386
|
+
marginTop: ((_i = (_h = itemWithJson.json) == null ? void 0 : _h.extraDescObj) == null ? void 0 : _i.info) ? 10 : 0,
|
|
387
|
+
display: "inline-block",
|
|
388
|
+
color: (_k = (_j = itemWithJson.json) == null ? void 0 : _j.extraDescObj) == null ? void 0 : _k.color
|
|
389
|
+
},
|
|
390
|
+
children: (_m = (_l = itemWithJson.json) == null ? void 0 : _l.extraDescObj) == null ? void 0 : _m.info
|
|
391
|
+
}
|
|
392
|
+
),
|
|
371
393
|
children: handleRenderItemInputMode({
|
|
372
394
|
item: itemWithJson,
|
|
373
395
|
readonly,
|