form-custom-test 3.0.195 → 3.0.196

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/render.es.js CHANGED
@@ -26517,13 +26517,13 @@ function registerIcon(app) {
26517
26517
  if (typeof window !== "undefined") {
26518
26518
  let loadSvg = function() {
26519
26519
  var body = document.body;
26520
- var svgDom = document.getElementById("__svg__icons__dom__1780624794319__");
26520
+ var svgDom = document.getElementById("__svg__icons__dom__1780627781215__");
26521
26521
  if (!svgDom) {
26522
26522
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26523
26523
  svgDom.style.position = "absolute";
26524
26524
  svgDom.style.width = "0";
26525
26525
  svgDom.style.height = "0";
26526
- svgDom.id = "__svg__icons__dom__1780624794319__";
26526
+ svgDom.id = "__svg__icons__dom__1780627781215__";
26527
26527
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26528
26528
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26529
26529
  }
@@ -36410,6 +36410,13 @@ const _sfc_main$d = {
36410
36410
  });
36411
36411
  }
36412
36412
  }
36413
+ if (this.isTextColumn(col) && col.maxLength) {
36414
+ colRules.push({
36415
+ max: col.maxLength,
36416
+ message: `${col.label}\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7${col.maxLength}\u4E2A\u5B57\u7B26`,
36417
+ trigger: ["blur", "change"]
36418
+ });
36419
+ }
36413
36420
  if (colRules.length > 0) {
36414
36421
  rules[col.prop] = colRules;
36415
36422
  }
@@ -36490,6 +36497,12 @@ const _sfc_main$d = {
36490
36497
  this.dialogFormData._columnOptions = {};
36491
36498
  }
36492
36499
  },
36500
+ isTextColumn(col) {
36501
+ return !col.type || col.type === "input" || col.type === "textarea";
36502
+ },
36503
+ getColMaxLength(col) {
36504
+ return col.maxLength && col.maxLength > 0 ? col.maxLength : void 0;
36505
+ },
36493
36506
  getValue() {
36494
36507
  return this.tableData;
36495
36508
  },
@@ -36782,8 +36795,10 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
36782
36795
  "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
36783
36796
  placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
36784
36797
  disabled: $props.widget.options.disabled,
36798
+ maxlength: $options.getColMaxLength(col),
36799
+ "show-word-limit": !!col.showWordLimit && !!col.maxLength,
36785
36800
  onChange: ($event) => $options.handleInputChange(col)
36786
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "number" ? (openBlock(), createBlock(_component_el_input_number, {
36801
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "maxlength", "show-word-limit", "onChange"])) : col.type === "number" ? (openBlock(), createBlock(_component_el_input_number, {
36787
36802
  key: 1,
36788
36803
  modelValue: $data.dialogFormData[col.prop],
36789
36804
  "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
@@ -36848,8 +36863,10 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
36848
36863
  placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
36849
36864
  disabled: $props.widget.options.disabled,
36850
36865
  rows: col.rows || 3,
36866
+ maxlength: $options.getColMaxLength(col),
36867
+ "show-word-limit": !!col.showWordLimit && !!col.maxLength,
36851
36868
  onChange: ($event) => $options.handleInputChange(col)
36852
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "rows", "onChange"])) : createCommentVNode("", true)
36869
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "rows", "maxlength", "show-word-limit", "onChange"])) : createCommentVNode("", true)
36853
36870
  ]),
36854
36871
  _: 2
36855
36872
  }, 1032, ["label", "prop", "required"]);
@@ -36867,7 +36884,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
36867
36884
  _: 1
36868
36885
  }, 8, ["widget"]);
36869
36886
  }
36870
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-407a6f2b"]]);
36887
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-70478d6d"]]);
36871
36888
  var ace$2 = { exports: {} };
36872
36889
  (function(module, exports) {
36873
36890
  (function() {
@@ -61461,6 +61478,17 @@ const _sfc_main$b = {
61461
61478
  }
61462
61479
  },
61463
61480
  methods: {
61481
+ isTextColumn(col) {
61482
+ return !col.type || col.type === "input" || col.type === "textarea";
61483
+ },
61484
+ handleMaxLengthInput(col, val) {
61485
+ if (!val || isNaN(val)) {
61486
+ col.maxLength = null;
61487
+ col.showWordLimit = false;
61488
+ } else {
61489
+ col.maxLength = Number(val);
61490
+ }
61491
+ },
61464
61492
  addNewColumn() {
61465
61493
  if (!this.optionModel.columns) {
61466
61494
  this.optionModel.columns = [];
@@ -61472,6 +61500,8 @@ const _sfc_main$b = {
61472
61500
  width: "",
61473
61501
  minWidth: "",
61474
61502
  placeholder: "",
61503
+ maxLength: null,
61504
+ showWordLimit: false,
61475
61505
  required: false,
61476
61506
  validation: "",
61477
61507
  validationHint: "",
@@ -61801,6 +61831,36 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
61801
61831
  ]),
61802
61832
  _: 2
61803
61833
  }, 1024),
61834
+ $options.isTextColumn(col) ? (openBlock(), createBlock(_component_el_form_item, {
61835
+ key: 1,
61836
+ label: _ctx.i18nt("designer.setting.maxLength")
61837
+ }, {
61838
+ default: withCtx(() => [
61839
+ createVNode(_component_el_input, {
61840
+ type: "number",
61841
+ class: "hide-spin-button",
61842
+ min: "1",
61843
+ "model-value": col.maxLength,
61844
+ placeholder: "\u4E0D\u9650",
61845
+ onInput: (val) => $options.handleMaxLengthInput(col, val),
61846
+ onChange: $options.handleColumnChange
61847
+ }, null, 8, ["model-value", "onInput", "onChange"])
61848
+ ]),
61849
+ _: 2
61850
+ }, 1032, ["label"])) : createCommentVNode("", true),
61851
+ $options.isTextColumn(col) && col.maxLength ? (openBlock(), createBlock(_component_el_form_item, {
61852
+ key: 2,
61853
+ label: _ctx.i18nt("designer.setting.showWordLimit")
61854
+ }, {
61855
+ default: withCtx(() => [
61856
+ createVNode(_component_el_switch, {
61857
+ modelValue: col.showWordLimit,
61858
+ "onUpdate:modelValue": ($event) => col.showWordLimit = $event,
61859
+ onChange: $options.handleColumnChange
61860
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
61861
+ ]),
61862
+ _: 2
61863
+ }, 1032, ["label"])) : createCommentVNode("", true),
61804
61864
  createVNode(_component_el_form_item, { label: "\u662F\u5426\u5FC5\u586B" }, {
61805
61865
  default: withCtx(() => [
61806
61866
  createVNode(_component_el_switch, {
@@ -61837,7 +61897,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
61837
61897
  _: 2
61838
61898
  }, 1024),
61839
61899
  col.validation ? (openBlock(), createBlock(_component_el_form_item, {
61840
- key: 1,
61900
+ key: 3,
61841
61901
  label: "\u6821\u9A8C\u5931\u8D25\u63D0\u793A"
61842
61902
  }, {
61843
61903
  default: withCtx(() => [
@@ -61851,7 +61911,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
61851
61911
  _: 2
61852
61912
  }, 1024)) : createCommentVNode("", true),
61853
61913
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61854
- key: 2,
61914
+ key: 4,
61855
61915
  label: "\u9009\u9879\u6570\u636E"
61856
61916
  }, {
61857
61917
  default: withCtx(() => [
@@ -61868,7 +61928,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
61868
61928
  _: 2
61869
61929
  }, 1024)) : createCommentVNode("", true),
61870
61930
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61871
- key: 3,
61931
+ key: 5,
61872
61932
  label: "onMounted\u4E8B\u4EF6"
61873
61933
  }, {
61874
61934
  default: withCtx(() => [
@@ -61896,7 +61956,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
61896
61956
  _: 2
61897
61957
  }, 1024)) : createCommentVNode("", true),
61898
61958
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61899
- key: 4,
61959
+ key: 6,
61900
61960
  label: "\u4F9D\u8D56\u5217\uFF08\u8054\u52A8\uFF09"
61901
61961
  }, {
61902
61962
  default: withCtx(() => [
@@ -61929,7 +61989,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
61929
61989
  _: 2
61930
61990
  }, 1024)) : createCommentVNode("", true),
61931
61991
  col.type === "select" && col.dependOn ? (openBlock(), createBlock(_component_el_form_item, {
61932
- key: 5,
61992
+ key: 7,
61933
61993
  label: "\u8054\u52A8\u5904\u7406\u51FD\u6570"
61934
61994
  }, {
61935
61995
  default: withCtx(() => [
@@ -62013,7 +62073,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
62013
62073
  _: 2
62014
62074
  }, 1024),
62015
62075
  col.type === "textarea" ? (openBlock(), createBlock(_component_el_form_item, {
62016
- key: 6,
62076
+ key: 8,
62017
62077
  label: "\u884C\u6570"
62018
62078
  }, {
62019
62079
  default: withCtx(() => [
@@ -62094,7 +62154,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
62094
62154
  }, 8, ["modelValue", "title"])
62095
62155
  ], 64);
62096
62156
  }
62097
- var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-2d1b4989"]]);
62157
+ var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-2401420e"]]);
62098
62158
  const _sfc_main$a = {
62099
62159
  name: "current-user-widget",
62100
62160
  componentName: "FieldWidget",