form-custom-test 3.0.107 → 3.0.108

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
@@ -9032,6 +9032,58 @@ var fieldMixin = {
9032
9032
  setLabel(newLabel) {
9033
9033
  this.field.options.label = newLabel;
9034
9034
  },
9035
+ updateFieldLabel(fieldName, newLabel) {
9036
+ if (!fieldName)
9037
+ return false;
9038
+ const labelText = newLabel == null ? "" : String(newLabel);
9039
+ const widgetRef = this.getWidgetRef(fieldName, false);
9040
+ if (widgetRef && widgetRef.field && widgetRef.field.options) {
9041
+ widgetRef.field.options.label = labelText;
9042
+ const formRef2 = this.getFormRef();
9043
+ if (formRef2 && typeof formRef2.$forceUpdate === "function") {
9044
+ formRef2.$forceUpdate();
9045
+ }
9046
+ return true;
9047
+ }
9048
+ const formRef = this.getFormRef();
9049
+ if (!formRef || typeof formRef.getFormJson !== "function" || typeof formRef.setFormJson !== "function") {
9050
+ return false;
9051
+ }
9052
+ const formJson = formRef.getFormJson();
9053
+ let updated = false;
9054
+ const walk = (list) => {
9055
+ if (!Array.isArray(list) || updated)
9056
+ return;
9057
+ list.forEach((w) => {
9058
+ if (updated || !w)
9059
+ return;
9060
+ if (w.options && w.options.name === fieldName) {
9061
+ w.options.label = labelText;
9062
+ updated = true;
9063
+ return;
9064
+ }
9065
+ if (Array.isArray(w.widgetList))
9066
+ walk(w.widgetList);
9067
+ if (Array.isArray(w.cols)) {
9068
+ w.cols.forEach((c) => walk(c && c.widgetList));
9069
+ }
9070
+ if (Array.isArray(w.rows)) {
9071
+ w.rows.forEach((r) => Array.isArray(r && r.cols) && r.cols.forEach((c) => walk(c && c.widgetList)));
9072
+ }
9073
+ if (Array.isArray(w.tabs)) {
9074
+ w.tabs.forEach((t) => walk(t && t.widgetList));
9075
+ }
9076
+ });
9077
+ };
9078
+ walk(formJson && formJson.widgetList);
9079
+ if (!updated)
9080
+ return false;
9081
+ formRef.setFormJson(formJson);
9082
+ return true;
9083
+ },
9084
+ setFieldLabel(fieldName, newLabel) {
9085
+ return this.updateFieldLabel(fieldName, newLabel);
9086
+ },
9035
9087
  focus() {
9036
9088
  if (!!this.getFieldEditor() && !!this.getFieldEditor().focus) {
9037
9089
  this.getFieldEditor().focus();
@@ -26109,13 +26161,13 @@ function registerIcon(app) {
26109
26161
  if (typeof window !== "undefined") {
26110
26162
  let loadSvg = function() {
26111
26163
  var body = document.body;
26112
- var svgDom = document.getElementById("__svg__icons__dom__1777279330591__");
26164
+ var svgDom = document.getElementById("__svg__icons__dom__1777281642687__");
26113
26165
  if (!svgDom) {
26114
26166
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26115
26167
  svgDom.style.position = "absolute";
26116
26168
  svgDom.style.width = "0";
26117
26169
  svgDom.style.height = "0";
26118
- svgDom.id = "__svg__icons__dom__1777279330591__";
26170
+ svgDom.id = "__svg__icons__dom__1777281642687__";
26119
26171
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26120
26172
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26121
26173
  }
@@ -62151,7 +62203,6 @@ const _sfc_main$3 = {
62151
62203
  methods: {
62152
62204
  handleClick() {
62153
62205
  this.dialogVisible = true;
62154
- this.triggerEvent("onOpen");
62155
62206
  },
62156
62207
  handleConfirm(selectedRows) {
62157
62208
  this.dialogVisible = false;
@@ -62259,7 +62310,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
62259
62310
  _: 1
62260
62311
  }, 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"]);
62261
62312
  }
62262
- var AssetSelectWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-4b5abf49"]]);
62313
+ var AssetSelectWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-1cb25748"]]);
62263
62314
  var detailDialog_vue_vue_type_style_index_0_scoped_true_lang = "";
62264
62315
  const _sfc_main$2 = {
62265
62316
  name: "detail-dialog",