form-custom-test 3.0.195 → 3.0.197

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.
@@ -69045,13 +69045,13 @@ function registerIcon(app) {
69045
69045
  if (typeof window !== "undefined") {
69046
69046
  let loadSvg = function() {
69047
69047
  var body = document.body;
69048
- var svgDom = document.getElementById("__svg__icons__dom__1780624786015__");
69048
+ var svgDom = document.getElementById("__svg__icons__dom__1780637039927__");
69049
69049
  if (!svgDom) {
69050
69050
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
69051
69051
  svgDom.style.position = "absolute";
69052
69052
  svgDom.style.width = "0";
69053
69053
  svgDom.style.height = "0";
69054
- svgDom.id = "__svg__icons__dom__1780624786015__";
69054
+ svgDom.id = "__svg__icons__dom__1780637039927__";
69055
69055
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
69056
69056
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
69057
69057
  }
@@ -77938,6 +77938,13 @@ const _sfc_main$c = {
77938
77938
  });
77939
77939
  }
77940
77940
  }
77941
+ if (this.isTextColumn(col) && col.maxLength) {
77942
+ colRules.push({
77943
+ max: col.maxLength,
77944
+ message: `${col.label}\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7${col.maxLength}\u4E2A\u5B57\u7B26`,
77945
+ trigger: ["blur", "change"]
77946
+ });
77947
+ }
77941
77948
  if (colRules.length > 0) {
77942
77949
  rules[col.prop] = colRules;
77943
77950
  }
@@ -78018,6 +78025,12 @@ const _sfc_main$c = {
78018
78025
  this.dialogFormData._columnOptions = {};
78019
78026
  }
78020
78027
  },
78028
+ isTextColumn(col) {
78029
+ return !col.type || col.type === "input" || col.type === "textarea";
78030
+ },
78031
+ getColMaxLength(col) {
78032
+ return col.maxLength && col.maxLength > 0 ? col.maxLength : void 0;
78033
+ },
78021
78034
  getValue() {
78022
78035
  return this.tableData;
78023
78036
  },
@@ -78310,15 +78323,19 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78310
78323
  "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
78311
78324
  placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
78312
78325
  disabled: $props.widget.options.disabled,
78313
- onChange: ($event) => $options.handleInputChange(col)
78314
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "number" ? (openBlock(), createBlock(_component_el_input_number, {
78326
+ maxlength: $options.getColMaxLength(col),
78327
+ "show-word-limit": !!col.showWordLimit && !!col.maxLength,
78328
+ onChange: ($event) => $options.handleInputChange(col),
78329
+ clearable: ""
78330
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "maxlength", "show-word-limit", "onChange"])) : col.type === "number" ? (openBlock(), createBlock(_component_el_input_number, {
78315
78331
  key: 1,
78316
78332
  modelValue: $data.dialogFormData[col.prop],
78317
78333
  "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
78318
78334
  placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
78319
78335
  disabled: $props.widget.options.disabled,
78320
78336
  style: { "width": "100%" },
78321
- onChange: ($event) => $options.handleInputChange(col)
78337
+ onChange: ($event) => $options.handleInputChange(col),
78338
+ clearable: ""
78322
78339
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "date" ? (openBlock(), createBlock(_component_el_date_picker, {
78323
78340
  key: 2,
78324
78341
  modelValue: $data.dialogFormData[col.prop],
@@ -78328,7 +78345,8 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78328
78345
  disabled: $props.widget.options.disabled,
78329
78346
  style: { "width": "100%" },
78330
78347
  "value-format": "YYYY-MM-DD",
78331
- onChange: ($event) => $options.handleInputChange(col)
78348
+ onChange: ($event) => $options.handleInputChange(col),
78349
+ clearable: ""
78332
78350
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "datetime" ? (openBlock(), createBlock(_component_el_date_picker, {
78333
78351
  key: 3,
78334
78352
  modelValue: $data.dialogFormData[col.prop],
@@ -78336,6 +78354,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78336
78354
  type: "datetime",
78337
78355
  placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
78338
78356
  disabled: $props.widget.options.disabled,
78357
+ clearable: "",
78339
78358
  style: { "width": "100%" },
78340
78359
  "value-format": "YYYY-MM-DD HH:mm:ss"
78341
78360
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : col.type === "month" ? (openBlock(), createBlock(_component_el_date_picker, {
@@ -78347,12 +78366,14 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78347
78366
  disabled: $props.widget.options.disabled,
78348
78367
  style: { "width": "100%" },
78349
78368
  "value-format": "YYYY-MM",
78369
+ clearable: "",
78350
78370
  onChange: ($event) => $options.handleInputChange(col)
78351
78371
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "select" ? (openBlock(), createBlock(_component_el_select, {
78352
78372
  modelValue: $data.dialogFormData[col.prop],
78353
78373
  "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
78354
78374
  placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
78355
78375
  disabled: $props.widget.options.disabled,
78376
+ clearable: "",
78356
78377
  style: { "width": "100%" },
78357
78378
  ref_for: true,
78358
78379
  ref: (el) => $options.handleSelectMounted(el, col),
@@ -78376,8 +78397,11 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78376
78397
  placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
78377
78398
  disabled: $props.widget.options.disabled,
78378
78399
  rows: col.rows || 3,
78400
+ maxlength: $options.getColMaxLength(col),
78401
+ "show-word-limit": !!col.showWordLimit && !!col.maxLength,
78402
+ clearable: "",
78379
78403
  onChange: ($event) => $options.handleInputChange(col)
78380
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "rows", "onChange"])) : createCommentVNode("", true)
78404
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "rows", "maxlength", "show-word-limit", "onChange"])) : createCommentVNode("", true)
78381
78405
  ]),
78382
78406
  _: 2
78383
78407
  }, 1032, ["label", "prop", "required"]);
@@ -78395,7 +78419,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78395
78419
  _: 1
78396
78420
  }, 8, ["widget"]);
78397
78421
  }
78398
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-407a6f2b"]]);
78422
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-0b6beffd"]]);
78399
78423
  var subTableColumnsEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
78400
78424
  const _sfc_main$b = {
78401
78425
  name: "sub-table-columns-editor",
@@ -78442,6 +78466,17 @@ const _sfc_main$b = {
78442
78466
  }
78443
78467
  },
78444
78468
  methods: {
78469
+ isTextColumn(col) {
78470
+ return !col.type || col.type === "input" || col.type === "textarea";
78471
+ },
78472
+ handleMaxLengthInput(col, val) {
78473
+ if (!val || isNaN(val)) {
78474
+ col.maxLength = null;
78475
+ col.showWordLimit = false;
78476
+ } else {
78477
+ col.maxLength = Number(val);
78478
+ }
78479
+ },
78445
78480
  addNewColumn() {
78446
78481
  if (!this.optionModel.columns) {
78447
78482
  this.optionModel.columns = [];
@@ -78453,6 +78488,8 @@ const _sfc_main$b = {
78453
78488
  width: "",
78454
78489
  minWidth: "",
78455
78490
  placeholder: "",
78491
+ maxLength: null,
78492
+ showWordLimit: false,
78456
78493
  required: false,
78457
78494
  validation: "",
78458
78495
  validationHint: "",
@@ -78782,6 +78819,36 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78782
78819
  ]),
78783
78820
  _: 2
78784
78821
  }, 1024),
78822
+ $options.isTextColumn(col) ? (openBlock(), createBlock(_component_el_form_item, {
78823
+ key: 1,
78824
+ label: _ctx.i18nt("designer.setting.maxLength")
78825
+ }, {
78826
+ default: withCtx(() => [
78827
+ createVNode(_component_el_input, {
78828
+ type: "number",
78829
+ class: "hide-spin-button",
78830
+ min: "1",
78831
+ "model-value": col.maxLength,
78832
+ placeholder: "\u4E0D\u9650",
78833
+ onInput: (val) => $options.handleMaxLengthInput(col, val),
78834
+ onChange: $options.handleColumnChange
78835
+ }, null, 8, ["model-value", "onInput", "onChange"])
78836
+ ]),
78837
+ _: 2
78838
+ }, 1032, ["label"])) : createCommentVNode("", true),
78839
+ $options.isTextColumn(col) && col.maxLength ? (openBlock(), createBlock(_component_el_form_item, {
78840
+ key: 2,
78841
+ label: _ctx.i18nt("designer.setting.showWordLimit")
78842
+ }, {
78843
+ default: withCtx(() => [
78844
+ createVNode(_component_el_switch, {
78845
+ modelValue: col.showWordLimit,
78846
+ "onUpdate:modelValue": ($event) => col.showWordLimit = $event,
78847
+ onChange: $options.handleColumnChange
78848
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
78849
+ ]),
78850
+ _: 2
78851
+ }, 1032, ["label"])) : createCommentVNode("", true),
78785
78852
  createVNode(_component_el_form_item, { label: "\u662F\u5426\u5FC5\u586B" }, {
78786
78853
  default: withCtx(() => [
78787
78854
  createVNode(_component_el_switch, {
@@ -78818,7 +78885,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78818
78885
  _: 2
78819
78886
  }, 1024),
78820
78887
  col.validation ? (openBlock(), createBlock(_component_el_form_item, {
78821
- key: 1,
78888
+ key: 3,
78822
78889
  label: "\u6821\u9A8C\u5931\u8D25\u63D0\u793A"
78823
78890
  }, {
78824
78891
  default: withCtx(() => [
@@ -78832,7 +78899,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78832
78899
  _: 2
78833
78900
  }, 1024)) : createCommentVNode("", true),
78834
78901
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78835
- key: 2,
78902
+ key: 4,
78836
78903
  label: "\u9009\u9879\u6570\u636E"
78837
78904
  }, {
78838
78905
  default: withCtx(() => [
@@ -78849,7 +78916,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78849
78916
  _: 2
78850
78917
  }, 1024)) : createCommentVNode("", true),
78851
78918
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78852
- key: 3,
78919
+ key: 5,
78853
78920
  label: "onMounted\u4E8B\u4EF6"
78854
78921
  }, {
78855
78922
  default: withCtx(() => [
@@ -78877,7 +78944,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78877
78944
  _: 2
78878
78945
  }, 1024)) : createCommentVNode("", true),
78879
78946
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78880
- key: 4,
78947
+ key: 6,
78881
78948
  label: "\u4F9D\u8D56\u5217\uFF08\u8054\u52A8\uFF09"
78882
78949
  }, {
78883
78950
  default: withCtx(() => [
@@ -78910,7 +78977,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78910
78977
  _: 2
78911
78978
  }, 1024)) : createCommentVNode("", true),
78912
78979
  col.type === "select" && col.dependOn ? (openBlock(), createBlock(_component_el_form_item, {
78913
- key: 5,
78980
+ key: 7,
78914
78981
  label: "\u8054\u52A8\u5904\u7406\u51FD\u6570"
78915
78982
  }, {
78916
78983
  default: withCtx(() => [
@@ -78994,7 +79061,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78994
79061
  _: 2
78995
79062
  }, 1024),
78996
79063
  col.type === "textarea" ? (openBlock(), createBlock(_component_el_form_item, {
78997
- key: 6,
79064
+ key: 8,
78998
79065
  label: "\u884C\u6570"
78999
79066
  }, {
79000
79067
  default: withCtx(() => [
@@ -79075,7 +79142,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
79075
79142
  }, 8, ["modelValue", "title"])
79076
79143
  ], 64);
79077
79144
  }
79078
- var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-2d1b4989"]]);
79145
+ var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-2401420e"]]);
79079
79146
  const _sfc_main$a = {
79080
79147
  name: "current-user-widget",
79081
79148
  componentName: "FieldWidget",