form-custom-test 3.0.243 → 3.0.244

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
@@ -9053,9 +9053,7 @@ var fieldMixin = {
9053
9053
  if (Array.isArray(colName)) {
9054
9054
  let anySet = false;
9055
9055
  colName.forEach((cName) => {
9056
- const col2 = this.findColByName(cName);
9057
- if (col2 && col2.options) {
9058
- col2.options.hidden = hiddenVal;
9056
+ if (this.setColHidden(cName, hiddenVal)) {
9059
9057
  anySet = true;
9060
9058
  }
9061
9059
  });
@@ -9065,8 +9063,41 @@ var fieldMixin = {
9065
9063
  if (!col || !col.options)
9066
9064
  return false;
9067
9065
  col.options.hidden = hiddenVal;
9066
+ this.syncColFieldsHidden(col, hiddenVal);
9068
9067
  return true;
9069
9068
  },
9069
+ syncColFieldsHidden(col, hidden) {
9070
+ if (!col)
9071
+ return;
9072
+ const hiddenVal = !!hidden;
9073
+ const walk = (list) => {
9074
+ if (!Array.isArray(list))
9075
+ return;
9076
+ list.forEach((w) => {
9077
+ if (!w)
9078
+ return;
9079
+ if (w.formItemFlag && w.options && w.options.name) {
9080
+ w.options.hidden = hiddenVal;
9081
+ const fieldRef = this.getWidgetRef(w.options.name, false);
9082
+ if (fieldRef && typeof fieldRef.setHidden === "function") {
9083
+ fieldRef.setHidden(hiddenVal);
9084
+ } else if (fieldRef) {
9085
+ if (hiddenVal && typeof fieldRef.clearFieldRules === "function") {
9086
+ fieldRef.clearFieldRules();
9087
+ } else if (!hiddenVal && typeof fieldRef.buildFieldRules === "function") {
9088
+ fieldRef.buildFieldRules();
9089
+ }
9090
+ }
9091
+ }
9092
+ if (Array.isArray(w.widgetList))
9093
+ walk(w.widgetList);
9094
+ if (Array.isArray(w.cols)) {
9095
+ w.cols.forEach((c) => walk(c && c.widgetList));
9096
+ }
9097
+ });
9098
+ };
9099
+ walk(col.widgetList);
9100
+ },
9070
9101
  getWidgetRef(widgetName, showError, rowId) {
9071
9102
  let foundRef = null;
9072
9103
  if (this.subFormItemFlag && !this.designState) {
@@ -24682,10 +24713,13 @@ const _sfc_main$P = {
24682
24713
  if (!fieldWidget.formItemFlag || !fieldWidget.options || !fieldWidget.options.name) {
24683
24714
  return;
24684
24715
  }
24716
+ fieldWidget.options.hidden = hiddenFlag;
24685
24717
  const fieldRef = this.getWidgetRef(fieldWidget.options.name);
24686
24718
  if (!fieldRef)
24687
24719
  return;
24688
- if (hiddenFlag) {
24720
+ if (typeof fieldRef.setHidden === "function") {
24721
+ fieldRef.setHidden(hiddenFlag);
24722
+ } else if (hiddenFlag) {
24689
24723
  if (typeof fieldRef.clearFieldRules === "function") {
24690
24724
  fieldRef.clearFieldRules();
24691
24725
  }
@@ -24799,7 +24833,7 @@ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
24799
24833
  [vShow, $options.colVisible]
24800
24834
  ]) : createCommentVNode("", true);
24801
24835
  }
24802
- var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$P, [["render", _sfc_render$P], ["__scopeId", "data-v-20705201"]]);
24836
+ var GridColItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$P, [["render", _sfc_render$P], ["__scopeId", "data-v-535c3a84"]]);
24803
24837
  var __glob_0_1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24804
24838
  __proto__: null,
24805
24839
  "default": GridColItem
@@ -26566,16 +26600,7 @@ const _sfc_main$J = {
26566
26600
  if (!fieldWidget.formItemFlag || !fieldWidget.options || !fieldWidget.options.name) {
26567
26601
  return;
26568
26602
  }
26569
- const fieldRef = this.getWidgetRef(fieldWidget.options.name);
26570
- if (!fieldRef)
26571
- return;
26572
- if (hiddenFlag) {
26573
- if (typeof fieldRef.clearFieldRules === "function") {
26574
- fieldRef.clearFieldRules();
26575
- }
26576
- } else if (typeof fieldRef.buildFieldRules === "function") {
26577
- fieldRef.buildFieldRules();
26578
- }
26603
+ this.findWidgetAndSetHidden(fieldWidget.options.name, hiddenFlag);
26579
26604
  });
26580
26605
  },
26581
26606
  setColHidden(colName, hidden) {
@@ -26655,7 +26680,7 @@ function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
26655
26680
  _: 3
26656
26681
  }, 8, ["label-position", "size", "class", "label-width", "model"]);
26657
26682
  }
26658
- var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$J, [["render", _sfc_render$J], ["__scopeId", "data-v-7ef95586"]]);
26683
+ var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$J, [["render", _sfc_render$J], ["__scopeId", "data-v-289ea27b"]]);
26659
26684
  function registerIcon(app) {
26660
26685
  app.component("el-icon-edit", edit);
26661
26686
  app.component("el-icon-minus", minus);
@@ -26670,13 +26695,13 @@ function registerIcon(app) {
26670
26695
  if (typeof window !== "undefined") {
26671
26696
  let loadSvg = function() {
26672
26697
  var body = document.body;
26673
- var svgDom = document.getElementById("__svg__icons__dom__1787635195147__");
26698
+ var svgDom = document.getElementById("__svg__icons__dom__1789605624806__");
26674
26699
  if (!svgDom) {
26675
26700
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26676
26701
  svgDom.style.position = "absolute";
26677
26702
  svgDom.style.width = "0";
26678
26703
  svgDom.style.height = "0";
26679
- svgDom.id = "__svg__icons__dom__1787635195147__";
26704
+ svgDom.id = "__svg__icons__dom__1789605624806__";
26680
26705
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26681
26706
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26682
26707
  }