form-custom-test 3.0.160 → 3.0.161

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.
@@ -4850,7 +4850,7 @@ const getRegExp = function(validatorName2) {
4850
4850
  maxLen10Decimals2: "/^\\d{1,10}(\\.\\d{1,2})?$/",
4851
4851
  maxLen12Decimals2: "/^\\d{1,12}(\\.\\d{1,2})?$/",
4852
4852
  latitude: "/^-?(?:90(?:\\.0{1,6})?|[1-8]?\\d(?:\\.\\d{1,6})?|0(?:\\.\\d{1,6})?)$/",
4853
- sixFigures: "/^\\d{1,6}(\\.\\d{1,6})?$/",
4853
+ sixFigures: "/^(0|[1-9]\\d{0,5})(\\.\\d{1,6})?$/",
4854
4854
  percentage: "/^(?:100(?:\\.0{0,4})?|[1-9]?\\d(?:\\.\\d{0,4})?|0(?:\\.\\d{0,4})?)$/",
4855
4855
  longitude: "/^-?(?:180(?:\\.0{1,6})?|1[0-7]\\d(?:\\.\\d{1,6})?|[1-9]?\\d(?:\\.\\d{1,6})?|0(?:\\.\\d{1,6})?)$/"
4856
4856
  };
@@ -10568,10 +10568,13 @@ var fieldMixin = {
10568
10568
  this.rules.splice(0, this.rules.length);
10569
10569
  },
10570
10570
  buildFieldRules() {
10571
- if (!this.field.formItemFlag && this.field.options.hidden) {
10571
+ if (!this.field.formItemFlag) {
10572
10572
  return;
10573
10573
  }
10574
10574
  this.rules.splice(0, this.rules.length);
10575
+ if (!!this.field.options.hidden && !this.designState) {
10576
+ return;
10577
+ }
10575
10578
  if (!!this.field.options.required) {
10576
10579
  this.rules.push({
10577
10580
  required: true,
@@ -10743,6 +10746,10 @@ var fieldMixin = {
10743
10746
  return formRef && typeof formRef.findColByName === "function" ? formRef.findColByName(null, colName) : null;
10744
10747
  },
10745
10748
  setColHidden(colName, hidden) {
10749
+ const formRef = this.getFormRef();
10750
+ if (formRef && typeof formRef.setColHidden === "function") {
10751
+ return formRef.setColHidden(colName, hidden);
10752
+ }
10746
10753
  const hiddenVal = !!hidden;
10747
10754
  if (Array.isArray(colName)) {
10748
10755
  let anySet = false;
@@ -26231,6 +26238,12 @@ const _sfc_main$2Y = {
26231
26238
  this.initLayoutProps();
26232
26239
  this.initRefList();
26233
26240
  },
26241
+ mounted() {
26242
+ var _a2, _b2;
26243
+ if (!this.designState && ((_b2 = (_a2 = this.widget) == null ? void 0 : _a2.options) == null ? void 0 : _b2.hidden)) {
26244
+ this.$nextTick(() => this.syncColFieldValidation(true));
26245
+ }
26246
+ },
26234
26247
  beforeUnmount() {
26235
26248
  var _a2, _b2;
26236
26249
  if (this.refList != null && ((_b2 = (_a2 = this.widget) == null ? void 0 : _a2.options) == null ? void 0 : _b2.name)) {
@@ -26243,12 +26256,40 @@ const _sfc_main$2Y = {
26243
26256
  this.layoutProps.span = val;
26244
26257
  },
26245
26258
  immediate: true
26259
+ },
26260
+ "widget.options.hidden": {
26261
+ handler(val) {
26262
+ if (this.designState)
26263
+ return;
26264
+ this.syncColFieldValidation(!!val);
26265
+ }
26246
26266
  }
26247
26267
  },
26248
26268
  methods: {
26269
+ syncColFieldValidation(hidden) {
26270
+ if (!this.widget)
26271
+ return;
26272
+ const hiddenFlag = !!hidden;
26273
+ traverseFieldWidgetsOfContainer(this.widget, (fieldWidget2) => {
26274
+ if (!fieldWidget2.formItemFlag || !fieldWidget2.options || !fieldWidget2.options.name) {
26275
+ return;
26276
+ }
26277
+ const fieldRef = this.getWidgetRef(fieldWidget2.options.name);
26278
+ if (!fieldRef)
26279
+ return;
26280
+ if (hiddenFlag) {
26281
+ if (typeof fieldRef.clearFieldRules === "function") {
26282
+ fieldRef.clearFieldRules();
26283
+ }
26284
+ } else if (typeof fieldRef.buildFieldRules === "function") {
26285
+ fieldRef.buildFieldRules();
26286
+ }
26287
+ });
26288
+ },
26249
26289
  setHidden(flag) {
26250
26290
  if (this.widget && this.widget.options) {
26251
26291
  this.widget.options.hidden = !!flag;
26292
+ this.syncColFieldValidation(flag);
26252
26293
  this.$nextTick(() => this.$forceUpdate());
26253
26294
  }
26254
26295
  },
@@ -26350,7 +26391,7 @@ function _sfc_render$2Y(_ctx, _cache, $props, $setup, $data, $options) {
26350
26391
  [vShow, $options.colVisible]
26351
26392
  ]) : createCommentVNode("", true);
26352
26393
  }
26353
- var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$2Y, [["render", _sfc_render$2Y], ["__scopeId", "data-v-746165e2"]]);
26394
+ var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$2Y, [["render", _sfc_render$2Y], ["__scopeId", "data-v-20705201"]]);
26354
26395
  var __glob_0_1$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26355
26396
  __proto__: null,
26356
26397
  "default": GridColItem
@@ -27622,7 +27663,18 @@ const _sfc_main$2S = {
27622
27663
  const fieldSchema = this.findFieldByName(widgetName);
27623
27664
  if (fieldSchema && fieldSchema.options) {
27624
27665
  fieldSchema.options.hidden = !!hiddenFlag;
27625
- this.$nextTick(() => this.$forceUpdate());
27666
+ this.$nextTick(() => {
27667
+ const ref2 = this.getWidgetRef(widgetName);
27668
+ if (ref2) {
27669
+ if (hiddenFlag) {
27670
+ if (typeof ref2.clearFieldRules === "function")
27671
+ ref2.clearFieldRules();
27672
+ } else if (typeof ref2.buildFieldRules === "function") {
27673
+ ref2.buildFieldRules();
27674
+ }
27675
+ }
27676
+ this.$forceUpdate();
27677
+ });
27626
27678
  return;
27627
27679
  }
27628
27680
  this.findWidgetOfSubFormAndSetHidden(widgetName, hiddenFlag);
@@ -28050,11 +28102,41 @@ const _sfc_main$2S = {
28050
28102
  }
28051
28103
  return null;
28052
28104
  },
28105
+ syncFieldRulesByCol(col, hidden) {
28106
+ if (!col)
28107
+ return;
28108
+ const hiddenFlag = !!hidden;
28109
+ traverseFieldWidgetsOfContainer(col, (fieldWidget2) => {
28110
+ if (!fieldWidget2.formItemFlag || !fieldWidget2.options || !fieldWidget2.options.name) {
28111
+ return;
28112
+ }
28113
+ const fieldRef = this.getWidgetRef(fieldWidget2.options.name);
28114
+ if (!fieldRef)
28115
+ return;
28116
+ if (hiddenFlag) {
28117
+ if (typeof fieldRef.clearFieldRules === "function") {
28118
+ fieldRef.clearFieldRules();
28119
+ }
28120
+ } else if (typeof fieldRef.buildFieldRules === "function") {
28121
+ fieldRef.buildFieldRules();
28122
+ }
28123
+ });
28124
+ },
28053
28125
  setColHidden(colName, hidden) {
28126
+ if (Array.isArray(colName)) {
28127
+ let anySet = false;
28128
+ colName.forEach((name) => {
28129
+ if (this.setColHidden(name, hidden)) {
28130
+ anySet = true;
28131
+ }
28132
+ });
28133
+ return anySet;
28134
+ }
28054
28135
  const col = this.findColByName(null, colName);
28055
28136
  if (!col || !col.options)
28056
28137
  return false;
28057
28138
  col.options.hidden = !!hidden;
28139
+ this.syncFieldRulesByCol(col, hidden);
28058
28140
  this.$nextTick(() => this.$forceUpdate());
28059
28141
  return true;
28060
28142
  }
@@ -28115,7 +28197,7 @@ function _sfc_render$2S(_ctx, _cache, $props, $setup, $data, $options) {
28115
28197
  _: 3
28116
28198
  }, 8, ["label-position", "size", "class", "label-width", "model"]);
28117
28199
  }
28118
- var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2S, [["render", _sfc_render$2S], ["__scopeId", "data-v-2bb5a9c0"]]);
28200
+ var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2S, [["render", _sfc_render$2S], ["__scopeId", "data-v-3d429201"]]);
28119
28201
  var ace$2 = { exports: {} };
28120
28202
  (function(module, exports) {
28121
28203
  (function() {
@@ -68681,13 +68763,13 @@ function registerIcon(app) {
68681
68763
  if (typeof window !== "undefined") {
68682
68764
  let loadSvg = function() {
68683
68765
  var body = document.body;
68684
- var svgDom = document.getElementById("__svg__icons__dom__1779271944729__");
68766
+ var svgDom = document.getElementById("__svg__icons__dom__1779273144844__");
68685
68767
  if (!svgDom) {
68686
68768
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
68687
68769
  svgDom.style.position = "absolute";
68688
68770
  svgDom.style.width = "0";
68689
68771
  svgDom.style.height = "0";
68690
- svgDom.id = "__svg__icons__dom__1779271944729__";
68772
+ svgDom.id = "__svg__icons__dom__1779273144844__";
68691
68773
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
68692
68774
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
68693
68775
  }