form-custom-test 3.0.60 → 3.0.62

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
@@ -23598,7 +23598,8 @@ const _sfc_main$z = {
23598
23598
  };
23599
23599
  },
23600
23600
  displayText() {
23601
- return this.fieldModel || this.field.options.textContent;
23601
+ var _a;
23602
+ return this.fieldModel != null && this.fieldModel !== "" ? this.fieldModel : (_a = this.field.options.textContent) != null ? _a : "";
23602
23603
  }
23603
23604
  },
23604
23605
  beforeCreate() {
@@ -23607,6 +23608,7 @@ const _sfc_main$z = {
23607
23608
  this.initFieldModel();
23608
23609
  this.registerToRefList();
23609
23610
  this.initEventHandler();
23611
+ this.buildFieldRules();
23610
23612
  this.handleOnCreated();
23611
23613
  },
23612
23614
  mounted() {
@@ -23615,7 +23617,20 @@ const _sfc_main$z = {
23615
23617
  beforeUnmount() {
23616
23618
  this.unregisterFromRefList();
23617
23619
  },
23618
- methods: {}
23620
+ methods: {},
23621
+ watch: {
23622
+ "field.options.textContent": {
23623
+ handler(newVal) {
23624
+ if (newVal === void 0)
23625
+ return;
23626
+ this.fieldModel = newVal;
23627
+ if (!this.designState) {
23628
+ this.syncUpdateFormModel(newVal);
23629
+ }
23630
+ },
23631
+ immediate: true
23632
+ }
23633
+ }
23619
23634
  };
23620
23635
  function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
23621
23636
  const _component_form_item_wrapper = resolveComponent("form-item-wrapper");
@@ -23638,13 +23653,13 @@ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
23638
23653
  }, [
23639
23654
  createElementVNode("div", {
23640
23655
  style: normalizeStyle($options.innerStyle)
23641
- }, toDisplayString($options.displayText), 5)
23656
+ }, toDisplayString($data.fieldModel), 5)
23642
23657
  ], 4)
23643
23658
  ]),
23644
23659
  _: 1
23645
23660
  }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
23646
23661
  }
23647
- var staticTextWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["render", _sfc_render$z], ["__scopeId", "data-v-55fc605c"]]);
23662
+ var staticTextWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["render", _sfc_render$z], ["__scopeId", "data-v-760822b6"]]);
23648
23663
  var __glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
23649
23664
  __proto__: null,
23650
23665
  "default": staticTextWidget
@@ -25333,6 +25348,7 @@ const _sfc_main$o = {
25333
25348
  }
25334
25349
  },
25335
25350
  buildDataFromWidget(wItem) {
25351
+ var _a;
25336
25352
  if (wItem.category === "container") {
25337
25353
  if (wItem.type === "grid") {
25338
25354
  if (!!wItem.cols && wItem.cols.length > 0) {
@@ -25393,11 +25409,19 @@ const _sfc_main$o = {
25393
25409
  }
25394
25410
  } else if (!!wItem.formItemFlag) {
25395
25411
  if (!this.formData.hasOwnProperty(wItem.options.name)) {
25396
- this.formDataModel[wItem.options.name] = wItem.options.defaultValue;
25412
+ const initVal = wItem.type === "static-text" ? (_a = wItem.options.textContent) != null ? _a : "" : wItem.options.defaultValue;
25413
+ this.formDataModel[wItem.options.name] = initVal;
25397
25414
  } else {
25398
25415
  let initialValue = this.formData[wItem.options.name];
25399
25416
  this.formDataModel[wItem.options.name] = deepClone(initialValue);
25400
25417
  }
25418
+ } else if (wItem.type === "static-text" && wItem.options && wItem.options.name) {
25419
+ const key = wItem.options.name;
25420
+ if (!this.formData.hasOwnProperty(key)) {
25421
+ this.formDataModel[key] = wItem.options.textContent;
25422
+ } else {
25423
+ this.formDataModel[key] = deepClone(this.formData[key]);
25424
+ }
25401
25425
  }
25402
25426
  },
25403
25427
  addFieldChangeEventHandler() {
@@ -25868,7 +25892,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
25868
25892
  _: 3
25869
25893
  }, 8, ["label-position", "size", "class", "label-width", "model"]);
25870
25894
  }
25871
- var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["render", _sfc_render$o], ["__scopeId", "data-v-1a5c4f64"]]);
25895
+ var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["render", _sfc_render$o], ["__scopeId", "data-v-6b16d674"]]);
25872
25896
  function registerIcon(app) {
25873
25897
  app.component("el-icon-edit", edit);
25874
25898
  app.component("el-icon-minus", minus);
@@ -25883,13 +25907,13 @@ function registerIcon(app) {
25883
25907
  if (typeof window !== "undefined") {
25884
25908
  let loadSvg = function() {
25885
25909
  var body = document.body;
25886
- var svgDom = document.getElementById("__svg__icons__dom__1773796342503__");
25910
+ var svgDom = document.getElementById("__svg__icons__dom__1773815233015__");
25887
25911
  if (!svgDom) {
25888
25912
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
25889
25913
  svgDom.style.position = "absolute";
25890
25914
  svgDom.style.width = "0";
25891
25915
  svgDom.style.height = "0";
25892
- svgDom.id = "__svg__icons__dom__1773796342503__";
25916
+ svgDom.id = "__svg__icons__dom__1773815233015__";
25893
25917
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
25894
25918
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
25895
25919
  }