szld-libs 0.2.72 → 0.2.74
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 +5840 -5809
- package/dist/szld-components.umd.js +41 -41
- package/es/components/DynamicForm/index.d.ts +4 -0
- package/es/components/DynamicForm/mySelect/index.js +1 -1
- package/es/components/DynamicForm/selectModel/index.js +1 -1
- package/es/components/DynamicForm/useDynamicForm.js +42 -11
- package/lib/components/DynamicForm/index.d.ts +4 -0
- package/lib/components/DynamicForm/mySelect/index.js +1 -1
- package/lib/components/DynamicForm/selectModel/index.js +1 -1
- package/lib/components/DynamicForm/useDynamicForm.js +42 -11
- package/package.json +1 -1
|
@@ -18,6 +18,9 @@ export interface IformConfigItem {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface Ijson {
|
|
21
|
+
message?: string; // 提示信息
|
|
22
|
+
'regexp-message'?: string; // 正则表达式提示信息
|
|
23
|
+
regexp: any; // 正则表达式
|
|
21
24
|
'properties-width'?: number; // 属性集表单宽度
|
|
22
25
|
'properties-multiple'?: boolean; // 是否支持可增减的表单列表
|
|
23
26
|
propertiesID: string;
|
|
@@ -63,6 +66,7 @@ export interface Ijson {
|
|
|
63
66
|
// 定义支持的输入类型枚举
|
|
64
67
|
export type InputType =
|
|
65
68
|
| 'text'
|
|
69
|
+
| 'password'
|
|
66
70
|
| 'textarea'
|
|
67
71
|
| 'number'
|
|
68
72
|
| 'select'
|
|
@@ -113,7 +113,7 @@ const MySelect = ({
|
|
|
113
113
|
return /* @__PURE__ */ jsx(
|
|
114
114
|
Select,
|
|
115
115
|
{
|
|
116
|
-
placeholder: "请选择",
|
|
116
|
+
placeholder: (item == null ? void 0 : item["message"]) || "请选择",
|
|
117
117
|
mode: item.input === "mult-select" ? "multiple" : void 0,
|
|
118
118
|
disabled: readonly,
|
|
119
119
|
loading,
|
|
@@ -241,7 +241,7 @@ function useDynamicForm(props) {
|
|
|
241
241
|
formListField,
|
|
242
242
|
isShowLabel = true
|
|
243
243
|
}) => {
|
|
244
|
-
var _a, _b, _c, _d, _e;
|
|
244
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
245
245
|
const isFormList = (_a = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _a["properties-multiple"];
|
|
246
246
|
let formListInitValue = [];
|
|
247
247
|
if (isFormList) {
|
|
@@ -354,6 +354,7 @@ function useDynamicForm(props) {
|
|
|
354
354
|
}
|
|
355
355
|
if (itemWithJson.attrtype === 0) {
|
|
356
356
|
let initialValue = handleSetFormItemInitialValue(itemWithJson);
|
|
357
|
+
const message2 = (_c = itemWithJson.json) == null ? void 0 : _c["message"];
|
|
357
358
|
let placeholder = "请输入";
|
|
358
359
|
const { input = "" } = itemWithJson.json || {};
|
|
359
360
|
if ([
|
|
@@ -379,8 +380,8 @@ function useDynamicForm(props) {
|
|
|
379
380
|
}
|
|
380
381
|
const { combinations = [] } = itemWithJson.json || {};
|
|
381
382
|
if (combinations == null ? void 0 : combinations.length) {
|
|
382
|
-
return /* @__PURE__ */ jsx(Col, { span: 24 / colNum, children: /* @__PURE__ */ jsx(Form.Item, { label: (
|
|
383
|
-
var _a2, _b2;
|
|
383
|
+
return /* @__PURE__ */ jsx(Col, { span: 24 / colNum, children: /* @__PURE__ */ jsx(Form.Item, { label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"], children: /* @__PURE__ */ jsx(Space.Compact, { children: combinations.map((item, index) => {
|
|
384
|
+
var _a2, _b2, _c2, _d2;
|
|
384
385
|
let initValue = handleSetFormItemInitialValue(item);
|
|
385
386
|
let width = defaultWidth;
|
|
386
387
|
const customWidth = {};
|
|
@@ -406,7 +407,13 @@ function useDynamicForm(props) {
|
|
|
406
407
|
...((_b2 = item.json) == null ? void 0 : _b2.must) ? [
|
|
407
408
|
{
|
|
408
409
|
required: true,
|
|
409
|
-
message: `${placeholder}${item.attrname}`
|
|
410
|
+
message: message2 || `${placeholder}${item.attrname}`
|
|
411
|
+
}
|
|
412
|
+
] : [],
|
|
413
|
+
...((_c2 = itemWithJson.json) == null ? void 0 : _c2.regexp) ? [
|
|
414
|
+
{
|
|
415
|
+
pattern: new RegExp(itemWithJson.json.regexp),
|
|
416
|
+
message: ((_d2 = itemWithJson.json) == null ? void 0 : _d2["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
|
|
410
417
|
}
|
|
411
418
|
] : []
|
|
412
419
|
],
|
|
@@ -434,11 +441,17 @@ function useDynamicForm(props) {
|
|
|
434
441
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
435
442
|
initialValue,
|
|
436
443
|
rules: [
|
|
437
|
-
...((
|
|
444
|
+
...((_e = itemWithJson.json) == null ? void 0 : _e.must) ? [
|
|
438
445
|
{
|
|
439
446
|
required: true,
|
|
440
447
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
441
448
|
}
|
|
449
|
+
] : [],
|
|
450
|
+
...((_f = itemWithJson.json) == null ? void 0 : _f.regexp) ? [
|
|
451
|
+
{
|
|
452
|
+
pattern: new RegExp(itemWithJson.json.regexp),
|
|
453
|
+
message: ((_g = itemWithJson.json) == null ? void 0 : _g["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
|
|
454
|
+
}
|
|
442
455
|
] : []
|
|
443
456
|
],
|
|
444
457
|
...handleSetFormItemProps(itemWithJson),
|
|
@@ -462,11 +475,17 @@ function useDynamicForm(props) {
|
|
|
462
475
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
463
476
|
initialValue,
|
|
464
477
|
rules: [
|
|
465
|
-
...((
|
|
478
|
+
...((_h = itemWithJson.json) == null ? void 0 : _h.must) ? [
|
|
466
479
|
{
|
|
467
480
|
required: true,
|
|
468
481
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
469
482
|
}
|
|
483
|
+
] : [],
|
|
484
|
+
...((_i = itemWithJson.json) == null ? void 0 : _i.regexp) ? [
|
|
485
|
+
{
|
|
486
|
+
pattern: new RegExp(itemWithJson.json.regexp),
|
|
487
|
+
message: ((_j = itemWithJson.json) == null ? void 0 : _j["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
|
|
488
|
+
}
|
|
470
489
|
] : []
|
|
471
490
|
],
|
|
472
491
|
...handleSetFormItemProps(itemWithJson),
|
|
@@ -521,9 +540,10 @@ function useDynamicForm(props) {
|
|
|
521
540
|
defaultWidth = 358,
|
|
522
541
|
customWidth = {}
|
|
523
542
|
}) => {
|
|
524
|
-
var _a, _b;
|
|
543
|
+
var _a, _b, _c;
|
|
525
544
|
const mode = item.json.input || "text";
|
|
526
545
|
const formatValue = handleSetFormItemInitialValue(item);
|
|
546
|
+
const message2 = ((_a = item.json) == null ? void 0 : _a.message) || "";
|
|
527
547
|
const params = item.json.length && {
|
|
528
548
|
maxLength: item.json.length
|
|
529
549
|
} || {};
|
|
@@ -534,7 +554,7 @@ function useDynamicForm(props) {
|
|
|
534
554
|
Input,
|
|
535
555
|
{
|
|
536
556
|
disabled: true,
|
|
537
|
-
value: ((
|
|
557
|
+
value: ((_b = item.json) == null ? void 0 : _b["label-value"]) || item.attrvalue || ((_c = item.json) == null ? void 0 : _c.default) || "-",
|
|
538
558
|
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
539
559
|
}
|
|
540
560
|
);
|
|
@@ -542,7 +562,18 @@ function useDynamicForm(props) {
|
|
|
542
562
|
return /* @__PURE__ */ jsx(
|
|
543
563
|
Input,
|
|
544
564
|
{
|
|
545
|
-
placeholder: "请输入",
|
|
565
|
+
placeholder: message2 || "请输入",
|
|
566
|
+
...params,
|
|
567
|
+
disabled: readonly,
|
|
568
|
+
allowClear: true,
|
|
569
|
+
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
570
|
+
}
|
|
571
|
+
);
|
|
572
|
+
case "password":
|
|
573
|
+
return /* @__PURE__ */ jsx(
|
|
574
|
+
Input.Password,
|
|
575
|
+
{
|
|
576
|
+
placeholder: message2 || "请输入",
|
|
546
577
|
...params,
|
|
547
578
|
disabled: readonly,
|
|
548
579
|
allowClear: true,
|
|
@@ -554,7 +585,7 @@ function useDynamicForm(props) {
|
|
|
554
585
|
Input.TextArea,
|
|
555
586
|
{
|
|
556
587
|
allowClear: true,
|
|
557
|
-
placeholder: "请输入",
|
|
588
|
+
placeholder: message2 || "请输入",
|
|
558
589
|
rows: 5,
|
|
559
590
|
...params,
|
|
560
591
|
disabled: readonly,
|
|
@@ -566,7 +597,7 @@ function useDynamicForm(props) {
|
|
|
566
597
|
InputNumber,
|
|
567
598
|
{
|
|
568
599
|
controls: false,
|
|
569
|
-
placeholder: "请输入",
|
|
600
|
+
placeholder: message2 || "请输入",
|
|
570
601
|
...params,
|
|
571
602
|
disabled: readonly,
|
|
572
603
|
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
@@ -18,6 +18,9 @@ export interface IformConfigItem {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface Ijson {
|
|
21
|
+
message?: string; // 提示信息
|
|
22
|
+
'regexp-message'?: string; // 正则表达式提示信息
|
|
23
|
+
regexp: any; // 正则表达式
|
|
21
24
|
'properties-width'?: number; // 属性集表单宽度
|
|
22
25
|
'properties-multiple'?: boolean; // 是否支持可增减的表单列表
|
|
23
26
|
propertiesID: string;
|
|
@@ -63,6 +66,7 @@ export interface Ijson {
|
|
|
63
66
|
// 定义支持的输入类型枚举
|
|
64
67
|
export type InputType =
|
|
65
68
|
| 'text'
|
|
69
|
+
| 'password'
|
|
66
70
|
| 'textarea'
|
|
67
71
|
| 'number'
|
|
68
72
|
| 'select'
|
|
@@ -114,7 +114,7 @@ const MySelect = ({
|
|
|
114
114
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
115
115
|
antd.Select,
|
|
116
116
|
{
|
|
117
|
-
placeholder: "请选择",
|
|
117
|
+
placeholder: (item == null ? void 0 : item["message"]) || "请选择",
|
|
118
118
|
mode: item.input === "mult-select" ? "multiple" : void 0,
|
|
119
119
|
disabled: readonly,
|
|
120
120
|
loading,
|
|
@@ -242,7 +242,7 @@ function useDynamicForm(props) {
|
|
|
242
242
|
formListField,
|
|
243
243
|
isShowLabel = true
|
|
244
244
|
}) => {
|
|
245
|
-
var _a, _b, _c, _d, _e;
|
|
245
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
246
246
|
const isFormList = (_a = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _a["properties-multiple"];
|
|
247
247
|
let formListInitValue = [];
|
|
248
248
|
if (isFormList) {
|
|
@@ -355,6 +355,7 @@ function useDynamicForm(props) {
|
|
|
355
355
|
}
|
|
356
356
|
if (itemWithJson.attrtype === 0) {
|
|
357
357
|
let initialValue = handleSetFormItemInitialValue(itemWithJson);
|
|
358
|
+
const message2 = (_c = itemWithJson.json) == null ? void 0 : _c["message"];
|
|
358
359
|
let placeholder = "请输入";
|
|
359
360
|
const { input = "" } = itemWithJson.json || {};
|
|
360
361
|
if ([
|
|
@@ -380,8 +381,8 @@ function useDynamicForm(props) {
|
|
|
380
381
|
}
|
|
381
382
|
const { combinations = [] } = itemWithJson.json || {};
|
|
382
383
|
if (combinations == null ? void 0 : combinations.length) {
|
|
383
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { label: (
|
|
384
|
-
var _a2, _b2;
|
|
384
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"], children: /* @__PURE__ */ jsxRuntime.jsx(antd.Space.Compact, { children: combinations.map((item, index) => {
|
|
385
|
+
var _a2, _b2, _c2, _d2;
|
|
385
386
|
let initValue = handleSetFormItemInitialValue(item);
|
|
386
387
|
let width = defaultWidth;
|
|
387
388
|
const customWidth = {};
|
|
@@ -407,7 +408,13 @@ function useDynamicForm(props) {
|
|
|
407
408
|
...((_b2 = item.json) == null ? void 0 : _b2.must) ? [
|
|
408
409
|
{
|
|
409
410
|
required: true,
|
|
410
|
-
message: `${placeholder}${item.attrname}`
|
|
411
|
+
message: message2 || `${placeholder}${item.attrname}`
|
|
412
|
+
}
|
|
413
|
+
] : [],
|
|
414
|
+
...((_c2 = itemWithJson.json) == null ? void 0 : _c2.regexp) ? [
|
|
415
|
+
{
|
|
416
|
+
pattern: new RegExp(itemWithJson.json.regexp),
|
|
417
|
+
message: ((_d2 = itemWithJson.json) == null ? void 0 : _d2["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
|
|
411
418
|
}
|
|
412
419
|
] : []
|
|
413
420
|
],
|
|
@@ -435,11 +442,17 @@ function useDynamicForm(props) {
|
|
|
435
442
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
436
443
|
initialValue,
|
|
437
444
|
rules: [
|
|
438
|
-
...((
|
|
445
|
+
...((_e = itemWithJson.json) == null ? void 0 : _e.must) ? [
|
|
439
446
|
{
|
|
440
447
|
required: true,
|
|
441
448
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
442
449
|
}
|
|
450
|
+
] : [],
|
|
451
|
+
...((_f = itemWithJson.json) == null ? void 0 : _f.regexp) ? [
|
|
452
|
+
{
|
|
453
|
+
pattern: new RegExp(itemWithJson.json.regexp),
|
|
454
|
+
message: ((_g = itemWithJson.json) == null ? void 0 : _g["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
|
|
455
|
+
}
|
|
443
456
|
] : []
|
|
444
457
|
],
|
|
445
458
|
...handleSetFormItemProps(itemWithJson),
|
|
@@ -463,11 +476,17 @@ function useDynamicForm(props) {
|
|
|
463
476
|
label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
|
|
464
477
|
initialValue,
|
|
465
478
|
rules: [
|
|
466
|
-
...((
|
|
479
|
+
...((_h = itemWithJson.json) == null ? void 0 : _h.must) ? [
|
|
467
480
|
{
|
|
468
481
|
required: true,
|
|
469
482
|
message: `${placeholder}${itemWithJson.attrname}`
|
|
470
483
|
}
|
|
484
|
+
] : [],
|
|
485
|
+
...((_i = itemWithJson.json) == null ? void 0 : _i.regexp) ? [
|
|
486
|
+
{
|
|
487
|
+
pattern: new RegExp(itemWithJson.json.regexp),
|
|
488
|
+
message: ((_j = itemWithJson.json) == null ? void 0 : _j["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
|
|
489
|
+
}
|
|
471
490
|
] : []
|
|
472
491
|
],
|
|
473
492
|
...handleSetFormItemProps(itemWithJson),
|
|
@@ -522,9 +541,10 @@ function useDynamicForm(props) {
|
|
|
522
541
|
defaultWidth = 358,
|
|
523
542
|
customWidth = {}
|
|
524
543
|
}) => {
|
|
525
|
-
var _a, _b;
|
|
544
|
+
var _a, _b, _c;
|
|
526
545
|
const mode = item.json.input || "text";
|
|
527
546
|
const formatValue = handleSetFormItemInitialValue(item);
|
|
547
|
+
const message2 = ((_a = item.json) == null ? void 0 : _a.message) || "";
|
|
528
548
|
const params = item.json.length && {
|
|
529
549
|
maxLength: item.json.length
|
|
530
550
|
} || {};
|
|
@@ -535,7 +555,7 @@ function useDynamicForm(props) {
|
|
|
535
555
|
antd.Input,
|
|
536
556
|
{
|
|
537
557
|
disabled: true,
|
|
538
|
-
value: ((
|
|
558
|
+
value: ((_b = item.json) == null ? void 0 : _b["label-value"]) || item.attrvalue || ((_c = item.json) == null ? void 0 : _c.default) || "-",
|
|
539
559
|
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
540
560
|
}
|
|
541
561
|
);
|
|
@@ -543,7 +563,18 @@ function useDynamicForm(props) {
|
|
|
543
563
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
544
564
|
antd.Input,
|
|
545
565
|
{
|
|
546
|
-
placeholder: "请输入",
|
|
566
|
+
placeholder: message2 || "请输入",
|
|
567
|
+
...params,
|
|
568
|
+
disabled: readonly,
|
|
569
|
+
allowClear: true,
|
|
570
|
+
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
571
|
+
}
|
|
572
|
+
);
|
|
573
|
+
case "password":
|
|
574
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
575
|
+
antd.Input.Password,
|
|
576
|
+
{
|
|
577
|
+
placeholder: message2 || "请输入",
|
|
547
578
|
...params,
|
|
548
579
|
disabled: readonly,
|
|
549
580
|
allowClear: true,
|
|
@@ -555,7 +586,7 @@ function useDynamicForm(props) {
|
|
|
555
586
|
antd.Input.TextArea,
|
|
556
587
|
{
|
|
557
588
|
allowClear: true,
|
|
558
|
-
placeholder: "请输入",
|
|
589
|
+
placeholder: message2 || "请输入",
|
|
559
590
|
rows: 5,
|
|
560
591
|
...params,
|
|
561
592
|
disabled: readonly,
|
|
@@ -567,7 +598,7 @@ function useDynamicForm(props) {
|
|
|
567
598
|
antd.InputNumber,
|
|
568
599
|
{
|
|
569
600
|
controls: false,
|
|
570
|
-
placeholder: "请输入",
|
|
601
|
+
placeholder: message2 || "请输入",
|
|
571
602
|
...params,
|
|
572
603
|
disabled: readonly,
|
|
573
604
|
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|