form-custom-test 3.0.244 → 3.0.246

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.
@@ -10870,6 +10870,10 @@ var fieldMixin = {
10870
10870
  return;
10871
10871
  }
10872
10872
  this.rules.splice(0, this.rules.length);
10873
+ const formRef = this.getFormRef && this.getFormRef();
10874
+ if (formRef && typeof formRef.clearValidate === "function") {
10875
+ formRef.clearValidate(this.getPropName());
10876
+ }
10873
10877
  },
10874
10878
  getFieldRules() {
10875
10879
  return FormValidators;
@@ -10882,6 +10886,9 @@ var fieldMixin = {
10882
10886
  if (!!this.field.options.hidden && !this.designState) {
10883
10887
  return;
10884
10888
  }
10889
+ if (!this.designState && this.isInsideHiddenCol()) {
10890
+ return;
10891
+ }
10885
10892
  if (!!this.field.options.required) {
10886
10893
  this.rules.push({
10887
10894
  required: true,
@@ -11169,6 +11176,68 @@ var fieldMixin = {
11169
11176
  setAppendButtonDisabled(flag) {
11170
11177
  this.field.options.appendButtonDisabled = flag;
11171
11178
  },
11179
+ isInsideHiddenCol() {
11180
+ var _a2, _b2, _c2;
11181
+ const formRef = this.getFormRef && this.getFormRef();
11182
+ const widgetList2 = ((_a2 = formRef == null ? void 0 : formRef.formJsonObj) == null ? void 0 : _a2.widgetList) || (formRef == null ? void 0 : formRef.widgetList);
11183
+ if (!widgetList2 || !((_c2 = (_b2 = this.field) == null ? void 0 : _b2.options) == null ? void 0 : _c2.name)) {
11184
+ return false;
11185
+ }
11186
+ const fieldName = this.field.options.name;
11187
+ const findHiddenCol = (list) => {
11188
+ var _a3, _b3;
11189
+ if (!Array.isArray(list))
11190
+ return false;
11191
+ for (const w of list) {
11192
+ if (!w)
11193
+ continue;
11194
+ if (w.type === "grid" && Array.isArray(w.cols)) {
11195
+ for (const col of w.cols) {
11196
+ if (((_a3 = col == null ? void 0 : col.options) == null ? void 0 : _a3.hidden) && this.fieldExistsInList(col.widgetList, fieldName)) {
11197
+ return true;
11198
+ }
11199
+ if (findHiddenCol(col == null ? void 0 : col.widgetList))
11200
+ return true;
11201
+ }
11202
+ }
11203
+ if (w.type === "grid-col" && ((_b3 = w.options) == null ? void 0 : _b3.hidden) && this.fieldExistsInList(w.widgetList, fieldName)) {
11204
+ return true;
11205
+ }
11206
+ if (Array.isArray(w.widgetList) && findHiddenCol(w.widgetList))
11207
+ return true;
11208
+ if (Array.isArray(w.cols) && findHiddenCol(w.cols))
11209
+ return true;
11210
+ if (Array.isArray(w.tabs)) {
11211
+ for (const t of w.tabs) {
11212
+ if (findHiddenCol(t == null ? void 0 : t.widgetList))
11213
+ return true;
11214
+ }
11215
+ }
11216
+ }
11217
+ return false;
11218
+ };
11219
+ return findHiddenCol(widgetList2);
11220
+ },
11221
+ fieldExistsInList(list, fieldName) {
11222
+ var _a2;
11223
+ if (!Array.isArray(list) || !fieldName)
11224
+ return false;
11225
+ for (const w of list) {
11226
+ if (!w)
11227
+ continue;
11228
+ if (((_a2 = w.options) == null ? void 0 : _a2.name) === fieldName)
11229
+ return true;
11230
+ if (this.fieldExistsInList(w.widgetList, fieldName))
11231
+ return true;
11232
+ if (Array.isArray(w.cols)) {
11233
+ for (const c of w.cols) {
11234
+ if (this.fieldExistsInList(c == null ? void 0 : c.widgetList, fieldName))
11235
+ return true;
11236
+ }
11237
+ }
11238
+ }
11239
+ return false;
11240
+ },
11172
11241
  setHidden(flag) {
11173
11242
  this.field.options.hidden = flag;
11174
11243
  if (!!flag) {
@@ -26708,7 +26777,8 @@ const _sfc_main$3f = {
26708
26777
  if (this.designState)
26709
26778
  return;
26710
26779
  this.syncColFieldValidation(!!val);
26711
- }
26780
+ },
26781
+ immediate: true
26712
26782
  }
26713
26783
  },
26714
26784
  methods: {
@@ -26810,7 +26880,7 @@ function _sfc_render$3f(_ctx, _cache, $props, $setup, $data, $options) {
26810
26880
  key: $props.fieldSchemaData && $props.fieldSchemaData[swIdx] ? $props.fieldSchemaData[swIdx].id : swIdx,
26811
26881
  "parent-list": $props.widget.widgetList,
26812
26882
  "index-of-parent-list": swIdx,
26813
- "parent-widget": $props.parentWidget,
26883
+ "parent-widget": $props.widget,
26814
26884
  "sub-form-row-index": $props.subFormRowIndex,
26815
26885
  "sub-form-row-id": $props.subFormRowId,
26816
26886
  "sub-form-disabled": $props.subFormDisabled,
@@ -26840,7 +26910,7 @@ function _sfc_render$3f(_ctx, _cache, $props, $setup, $data, $options) {
26840
26910
  [vShow, $options.colVisible]
26841
26911
  ]) : createCommentVNode("", true);
26842
26912
  }
26843
- var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$3f, [["render", _sfc_render$3f], ["__scopeId", "data-v-535c3a84"]]);
26913
+ var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$3f, [["render", _sfc_render$3f], ["__scopeId", "data-v-315cc820"]]);
26844
26914
  var __glob_0_1$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26845
26915
  __proto__: null,
26846
26916
  "default": GridColItem
@@ -28359,6 +28429,7 @@ const _sfc_main$39 = {
28359
28429
  if (!needValidation) {
28360
28430
  return this.formDataModel;
28361
28431
  }
28432
+ this.syncAllHiddenColFieldRules();
28362
28433
  let callback2 = function nullFunc() {
28363
28434
  };
28364
28435
  let promise = new window.Promise(function(resolve, reject) {
@@ -28383,6 +28454,43 @@ const _sfc_main$39 = {
28383
28454
  });
28384
28455
  return promise;
28385
28456
  },
28457
+ syncAllHiddenColFieldRules() {
28458
+ const walk = (list) => {
28459
+ if (!Array.isArray(list))
28460
+ return;
28461
+ list.forEach((w) => {
28462
+ var _a2;
28463
+ if (!w)
28464
+ return;
28465
+ if (w.type === "grid" && Array.isArray(w.cols)) {
28466
+ w.cols.forEach((col) => {
28467
+ var _a3;
28468
+ if ((_a3 = col == null ? void 0 : col.options) == null ? void 0 : _a3.hidden) {
28469
+ this.syncFieldRulesByCol(col, true);
28470
+ }
28471
+ walk(col == null ? void 0 : col.widgetList);
28472
+ });
28473
+ } else if (w.type === "grid-col") {
28474
+ if ((_a2 = w == null ? void 0 : w.options) == null ? void 0 : _a2.hidden) {
28475
+ this.syncFieldRulesByCol(w, true);
28476
+ }
28477
+ walk(w.widgetList);
28478
+ } else {
28479
+ if (Array.isArray(w.widgetList))
28480
+ walk(w.widgetList);
28481
+ if (Array.isArray(w.cols))
28482
+ walk(w.cols);
28483
+ if (Array.isArray(w.tabs)) {
28484
+ w.tabs.forEach((t) => walk(t == null ? void 0 : t.widgetList));
28485
+ }
28486
+ if (Array.isArray(w.rows)) {
28487
+ w.rows.forEach((r) => Array.isArray(r == null ? void 0 : r.cols) && r.cols.forEach((c) => walk(c == null ? void 0 : c.widgetList)));
28488
+ }
28489
+ }
28490
+ });
28491
+ };
28492
+ walk(this.widgetList);
28493
+ },
28386
28494
  setFormData(formData) {
28387
28495
  Object.keys(this.formDataModel).forEach((propName) => {
28388
28496
  if (!!formData && formData.hasOwnProperty(propName)) {
@@ -28481,6 +28589,7 @@ const _sfc_main$39 = {
28481
28589
  this.$refs.renderForm.clearValidate(props);
28482
28590
  },
28483
28591
  validateForm(callback2) {
28592
+ this.syncAllHiddenColFieldRules();
28484
28593
  this.$refs["renderForm"].validate((valid) => {
28485
28594
  if (valid && !!this.formConfig && !!this.formConfig.onFormValidateSuccess) {
28486
28595
  this.emitFormValidateSuccess(this.formDataModel);
@@ -28687,7 +28796,7 @@ function _sfc_render$39(_ctx, _cache, $props, $setup, $data, $options) {
28687
28796
  _: 3
28688
28797
  }, 8, ["label-position", "size", "class", "label-width", "model"]);
28689
28798
  }
28690
- var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$39, [["render", _sfc_render$39], ["__scopeId", "data-v-289ea27b"]]);
28799
+ var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$39, [["render", _sfc_render$39], ["__scopeId", "data-v-cd88fba4"]]);
28691
28800
  var ace$2 = { exports: {} };
28692
28801
  (function(module, exports) {
28693
28802
  (function() {
@@ -69444,13 +69553,13 @@ function registerIcon(app) {
69444
69553
  if (typeof window !== "undefined") {
69445
69554
  let loadSvg = function() {
69446
69555
  var body = document.body;
69447
- var svgDom = document.getElementById("__svg__icons__dom__1789605616296__");
69556
+ var svgDom = document.getElementById("__svg__icons__dom__1789607301980__");
69448
69557
  if (!svgDom) {
69449
69558
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
69450
69559
  svgDom.style.position = "absolute";
69451
69560
  svgDom.style.width = "0";
69452
69561
  svgDom.style.height = "0";
69453
- svgDom.id = "__svg__icons__dom__1789605616296__";
69562
+ svgDom.id = "__svg__icons__dom__1789607301980__";
69454
69563
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
69455
69564
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
69456
69565
  }