szld-libs 0.4.15 → 0.4.16
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 +2798 -2796
- package/dist/szld-components.umd.js +42 -42
- package/es/components/DynamicForm/index.d.ts +1 -0
- package/es/components/DynamicForm/useDynamicForm.js +13 -10
- package/lib/components/DynamicForm/index.d.ts +1 -0
- package/lib/components/DynamicForm/useDynamicForm.js +13 -10
- package/package.json +1 -1
|
@@ -298,7 +298,7 @@ function useDynamicForm(props) {
|
|
|
298
298
|
formListField,
|
|
299
299
|
isShowLabel = true
|
|
300
300
|
}) => {
|
|
301
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
301
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
302
302
|
if (((_a = itemWithJson.json) == null ? void 0 : _a.hide) === true) {
|
|
303
303
|
return /* @__PURE__ */ jsx(Fragment$1, {});
|
|
304
304
|
}
|
|
@@ -323,16 +323,17 @@ function useDynamicForm(props) {
|
|
|
323
323
|
if (itemWithJson.attrtype === 0) {
|
|
324
324
|
const initialValue = handleSetFormItemInitialValue(itemWithJson);
|
|
325
325
|
const message2 = (_b = itemWithJson.json) == null ? void 0 : _b["default-prompt"];
|
|
326
|
+
const hidden = (_c = itemWithJson.json) == null ? void 0 : _c.hidden;
|
|
326
327
|
const placeholder = handleGetPlaceholder(itemWithJson, langId);
|
|
327
328
|
const { combinations = [] } = itemWithJson.json || {};
|
|
328
329
|
if (combinations == null ? void 0 : combinations.length) {
|
|
329
330
|
return /* @__PURE__ */ jsx(Col, { span: 24 / colNum, children: /* @__PURE__ */ jsx(
|
|
330
331
|
Form.Item,
|
|
331
332
|
{
|
|
332
|
-
label: (
|
|
333
|
-
required: (
|
|
333
|
+
label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"],
|
|
334
|
+
required: (_e = itemWithJson.json) == null ? void 0 : _e.must,
|
|
334
335
|
children: /* @__PURE__ */ jsx(Space.Compact, { children: combinations.map((item, index) => {
|
|
335
|
-
var _a2, _b2, _c2, _d2;
|
|
336
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
336
337
|
let initValue = handleSetFormItemInitialValue(item);
|
|
337
338
|
let width = defaultWidth;
|
|
338
339
|
const customWidth = {};
|
|
@@ -351,20 +352,21 @@ function useDynamicForm(props) {
|
|
|
351
352
|
return /* @__PURE__ */ jsx(
|
|
352
353
|
Form.Item,
|
|
353
354
|
{
|
|
355
|
+
hidden: (_b2 = item.json) == null ? void 0 : _b2.hidden,
|
|
354
356
|
name: formListField ? Array.isArray(formListField.name) ? [...formListField.name, item.attrid] : [formListField.name, item.attrid] : item.attrid,
|
|
355
357
|
noStyle: true,
|
|
356
358
|
initialValue: initValue,
|
|
357
359
|
rules: [
|
|
358
|
-
...((
|
|
360
|
+
...((_c2 = item.json) == null ? void 0 : _c2.must) ? [
|
|
359
361
|
{
|
|
360
362
|
required: true,
|
|
361
363
|
message: message2 || `${placeholder}${item.attrname}`
|
|
362
364
|
}
|
|
363
365
|
] : [],
|
|
364
|
-
...((
|
|
366
|
+
...((_d2 = itemWithJson.json) == null ? void 0 : _d2.regexp) ? [
|
|
365
367
|
{
|
|
366
368
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
367
|
-
message: ((
|
|
369
|
+
message: ((_e2 = itemWithJson.json) == null ? void 0 : _e2["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
368
370
|
}
|
|
369
371
|
] : []
|
|
370
372
|
],
|
|
@@ -394,17 +396,18 @@ function useDynamicForm(props) {
|
|
|
394
396
|
name: formItemName,
|
|
395
397
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
396
398
|
initialValue,
|
|
399
|
+
hidden,
|
|
397
400
|
rules: [
|
|
398
|
-
...((
|
|
401
|
+
...((_f = itemWithJson.json) == null ? void 0 : _f.must) ? [
|
|
399
402
|
{
|
|
400
403
|
required: true,
|
|
401
404
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
402
405
|
}
|
|
403
406
|
] : [],
|
|
404
|
-
...((
|
|
407
|
+
...((_g = itemWithJson.json) == null ? void 0 : _g.regexp) ? [
|
|
405
408
|
{
|
|
406
409
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
407
|
-
message: ((
|
|
410
|
+
message: ((_h = itemWithJson.json) == null ? void 0 : _h["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
408
411
|
}
|
|
409
412
|
] : []
|
|
410
413
|
],
|
|
@@ -299,7 +299,7 @@ function useDynamicForm(props) {
|
|
|
299
299
|
formListField,
|
|
300
300
|
isShowLabel = true
|
|
301
301
|
}) => {
|
|
302
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
302
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
303
303
|
if (((_a = itemWithJson.json) == null ? void 0 : _a.hide) === true) {
|
|
304
304
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
305
305
|
}
|
|
@@ -324,16 +324,17 @@ function useDynamicForm(props) {
|
|
|
324
324
|
if (itemWithJson.attrtype === 0) {
|
|
325
325
|
const initialValue = func.handleSetFormItemInitialValue(itemWithJson);
|
|
326
326
|
const message2 = (_b = itemWithJson.json) == null ? void 0 : _b["default-prompt"];
|
|
327
|
+
const hidden = (_c = itemWithJson.json) == null ? void 0 : _c.hidden;
|
|
327
328
|
const placeholder = func.handleGetPlaceholder(itemWithJson, langId);
|
|
328
329
|
const { combinations = [] } = itemWithJson.json || {};
|
|
329
330
|
if (combinations == null ? void 0 : combinations.length) {
|
|
330
331
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
331
332
|
antd.Form.Item,
|
|
332
333
|
{
|
|
333
|
-
label: (
|
|
334
|
-
required: (
|
|
334
|
+
label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"],
|
|
335
|
+
required: (_e = itemWithJson.json) == null ? void 0 : _e.must,
|
|
335
336
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Space.Compact, { children: combinations.map((item, index) => {
|
|
336
|
-
var _a2, _b2, _c2, _d2;
|
|
337
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
337
338
|
let initValue = func.handleSetFormItemInitialValue(item);
|
|
338
339
|
let width = defaultWidth;
|
|
339
340
|
const customWidth = {};
|
|
@@ -352,20 +353,21 @@ function useDynamicForm(props) {
|
|
|
352
353
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
353
354
|
antd.Form.Item,
|
|
354
355
|
{
|
|
356
|
+
hidden: (_b2 = item.json) == null ? void 0 : _b2.hidden,
|
|
355
357
|
name: formListField ? Array.isArray(formListField.name) ? [...formListField.name, item.attrid] : [formListField.name, item.attrid] : item.attrid,
|
|
356
358
|
noStyle: true,
|
|
357
359
|
initialValue: initValue,
|
|
358
360
|
rules: [
|
|
359
|
-
...((
|
|
361
|
+
...((_c2 = item.json) == null ? void 0 : _c2.must) ? [
|
|
360
362
|
{
|
|
361
363
|
required: true,
|
|
362
364
|
message: message2 || `${placeholder}${item.attrname}`
|
|
363
365
|
}
|
|
364
366
|
] : [],
|
|
365
|
-
...((
|
|
367
|
+
...((_d2 = itemWithJson.json) == null ? void 0 : _d2.regexp) ? [
|
|
366
368
|
{
|
|
367
369
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
368
|
-
message: ((
|
|
370
|
+
message: ((_e2 = itemWithJson.json) == null ? void 0 : _e2["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
369
371
|
}
|
|
370
372
|
] : []
|
|
371
373
|
],
|
|
@@ -395,17 +397,18 @@ function useDynamicForm(props) {
|
|
|
395
397
|
name: formItemName,
|
|
396
398
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
397
399
|
initialValue,
|
|
400
|
+
hidden,
|
|
398
401
|
rules: [
|
|
399
|
-
...((
|
|
402
|
+
...((_f = itemWithJson.json) == null ? void 0 : _f.must) ? [
|
|
400
403
|
{
|
|
401
404
|
required: true,
|
|
402
405
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
403
406
|
}
|
|
404
407
|
] : [],
|
|
405
|
-
...((
|
|
408
|
+
...((_g = itemWithJson.json) == null ? void 0 : _g.regexp) ? [
|
|
406
409
|
{
|
|
407
410
|
pattern: new RegExp(itemWithJson.json.regexp.replace(/^\/|\/$/g, "")),
|
|
408
|
-
message: ((
|
|
411
|
+
message: ((_h = itemWithJson.json) == null ? void 0 : _h["regexp-message"]) || `${itemWithJson.attrname}${langId === "10001" ? "格式不正确" : "Format is incorrect"}`
|
|
409
412
|
}
|
|
410
413
|
] : []
|
|
411
414
|
],
|