szld-libs 0.2.72 → 0.2.73

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.
@@ -18,6 +18,8 @@ export interface IformConfigItem {
18
18
  }
19
19
 
20
20
  export interface Ijson {
21
+ 'regexp-message'?: string; // 正则表达式提示信息
22
+ regexp: any; // 正则表达式
21
23
  'properties-width'?: number; // 属性集表单宽度
22
24
  'properties-multiple'?: boolean; // 是否支持可增减的表单列表
23
25
  propertiesID: string;
@@ -63,6 +65,7 @@ export interface Ijson {
63
65
  // 定义支持的输入类型枚举
64
66
  export type InputType =
65
67
  | 'text'
68
+ | 'password'
66
69
  | 'textarea'
67
70
  | 'number'
68
71
  | 'select'
@@ -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;
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) {
@@ -380,7 +380,7 @@ function useDynamicForm(props) {
380
380
  const { combinations = [] } = itemWithJson.json || {};
381
381
  if (combinations == null ? void 0 : combinations.length) {
382
382
  return /* @__PURE__ */ jsx(Col, { span: 24 / colNum, children: /* @__PURE__ */ jsx(Form.Item, { label: (_c = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _c["combination-name"], children: /* @__PURE__ */ jsx(Space.Compact, { children: combinations.map((item, index) => {
383
- var _a2, _b2;
383
+ var _a2, _b2, _c2, _d2;
384
384
  let initValue = handleSetFormItemInitialValue(item);
385
385
  let width = defaultWidth;
386
386
  const customWidth = {};
@@ -408,6 +408,12 @@ function useDynamicForm(props) {
408
408
  required: true,
409
409
  message: `${placeholder}${item.attrname}`
410
410
  }
411
+ ] : [],
412
+ ...((_c2 = itemWithJson.json) == null ? void 0 : _c2.regexp) ? [
413
+ {
414
+ pattern: new RegExp(itemWithJson.json.regexp),
415
+ message: ((_d2 = itemWithJson.json) == null ? void 0 : _d2["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
416
+ }
411
417
  ] : []
412
418
  ],
413
419
  ...handleSetFormItemProps(item),
@@ -439,6 +445,12 @@ function useDynamicForm(props) {
439
445
  required: true,
440
446
  message: `${placeholder}${itemWithJson.attrname}`
441
447
  }
448
+ ] : [],
449
+ ...((_e = itemWithJson.json) == null ? void 0 : _e.regexp) ? [
450
+ {
451
+ pattern: new RegExp(itemWithJson.json.regexp),
452
+ message: ((_f = itemWithJson.json) == null ? void 0 : _f["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
453
+ }
442
454
  ] : []
443
455
  ],
444
456
  ...handleSetFormItemProps(itemWithJson),
@@ -462,11 +474,17 @@ function useDynamicForm(props) {
462
474
  label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
463
475
  initialValue,
464
476
  rules: [
465
- ...((_e = itemWithJson.json) == null ? void 0 : _e.must) ? [
477
+ ...((_g = itemWithJson.json) == null ? void 0 : _g.must) ? [
466
478
  {
467
479
  required: true,
468
480
  message: `${placeholder}${itemWithJson.attrname}`
469
481
  }
482
+ ] : [],
483
+ ...((_h = itemWithJson.json) == null ? void 0 : _h.regexp) ? [
484
+ {
485
+ pattern: new RegExp(itemWithJson.json.regexp),
486
+ message: ((_i = itemWithJson.json) == null ? void 0 : _i["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
487
+ }
470
488
  ] : []
471
489
  ],
472
490
  ...handleSetFormItemProps(itemWithJson),
@@ -549,6 +567,17 @@ function useDynamicForm(props) {
549
567
  style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
550
568
  }
551
569
  );
570
+ case "password":
571
+ return /* @__PURE__ */ jsx(
572
+ Input.Password,
573
+ {
574
+ placeholder: "请输入",
575
+ ...params,
576
+ disabled: readonly,
577
+ allowClear: true,
578
+ style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
579
+ }
580
+ );
552
581
  case "textarea":
553
582
  return /* @__PURE__ */ jsx(
554
583
  Input.TextArea,
@@ -18,6 +18,8 @@ export interface IformConfigItem {
18
18
  }
19
19
 
20
20
  export interface Ijson {
21
+ 'regexp-message'?: string; // 正则表达式提示信息
22
+ regexp: any; // 正则表达式
21
23
  'properties-width'?: number; // 属性集表单宽度
22
24
  'properties-multiple'?: boolean; // 是否支持可增减的表单列表
23
25
  propertiesID: string;
@@ -63,6 +65,7 @@ export interface Ijson {
63
65
  // 定义支持的输入类型枚举
64
66
  export type InputType =
65
67
  | 'text'
68
+ | 'password'
66
69
  | 'textarea'
67
70
  | 'number'
68
71
  | 'select'
@@ -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;
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) {
@@ -381,7 +381,7 @@ function useDynamicForm(props) {
381
381
  const { combinations = [] } = itemWithJson.json || {};
382
382
  if (combinations == null ? void 0 : combinations.length) {
383
383
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { label: (_c = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _c["combination-name"], children: /* @__PURE__ */ jsxRuntime.jsx(antd.Space.Compact, { children: combinations.map((item, index) => {
384
- var _a2, _b2;
384
+ var _a2, _b2, _c2, _d2;
385
385
  let initValue = handleSetFormItemInitialValue(item);
386
386
  let width = defaultWidth;
387
387
  const customWidth = {};
@@ -409,6 +409,12 @@ function useDynamicForm(props) {
409
409
  required: true,
410
410
  message: `${placeholder}${item.attrname}`
411
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}格式不正确`
417
+ }
412
418
  ] : []
413
419
  ],
414
420
  ...handleSetFormItemProps(item),
@@ -440,6 +446,12 @@ function useDynamicForm(props) {
440
446
  required: true,
441
447
  message: `${placeholder}${itemWithJson.attrname}`
442
448
  }
449
+ ] : [],
450
+ ...((_e = itemWithJson.json) == null ? void 0 : _e.regexp) ? [
451
+ {
452
+ pattern: new RegExp(itemWithJson.json.regexp),
453
+ message: ((_f = itemWithJson.json) == null ? void 0 : _f["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
454
+ }
443
455
  ] : []
444
456
  ],
445
457
  ...handleSetFormItemProps(itemWithJson),
@@ -463,11 +475,17 @@ function useDynamicForm(props) {
463
475
  label: isShowLabel && handleDealInstruction(itemWithJson, instructionShowMode) || null,
464
476
  initialValue,
465
477
  rules: [
466
- ...((_e = itemWithJson.json) == null ? void 0 : _e.must) ? [
478
+ ...((_g = itemWithJson.json) == null ? void 0 : _g.must) ? [
467
479
  {
468
480
  required: true,
469
481
  message: `${placeholder}${itemWithJson.attrname}`
470
482
  }
483
+ ] : [],
484
+ ...((_h = itemWithJson.json) == null ? void 0 : _h.regexp) ? [
485
+ {
486
+ pattern: new RegExp(itemWithJson.json.regexp),
487
+ message: ((_i = itemWithJson.json) == null ? void 0 : _i["regexp-message"]) || `${itemWithJson.attrname}格式不正确`
488
+ }
471
489
  ] : []
472
490
  ],
473
491
  ...handleSetFormItemProps(itemWithJson),
@@ -550,6 +568,17 @@ function useDynamicForm(props) {
550
568
  style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
551
569
  }
552
570
  );
571
+ case "password":
572
+ return /* @__PURE__ */ jsxRuntime.jsx(
573
+ antd.Input.Password,
574
+ {
575
+ placeholder: "请输入",
576
+ ...params,
577
+ disabled: readonly,
578
+ allowClear: true,
579
+ style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
580
+ }
581
+ );
553
582
  case "textarea":
554
583
  return /* @__PURE__ */ jsxRuntime.jsx(
555
584
  antd.Input.TextArea,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.72",
4
+ "version": "0.2.73",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",