@form-create/element-ui 2.7.19 → 2.7.20

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * FormCreate 低代码表单渲染器
3
- * @form-create/element-ui v2.7.19
3
+ * @form-create/element-ui v2.7.20
4
4
  * (c) 2018-2025 xaboy
5
5
  * Github https://github.com/xaboy/form-create
6
6
  * Site https://form-create.com/
@@ -912,7 +912,7 @@ const Pr = "fcUpload", Tr = {
912
912
  }), this.$emit("fc.el", this.$refs.upload);
913
913
  }
914
914
  };
915
- function F(t, e, r) {
915
+ function k(t, e, r) {
916
916
  $e.set(t, e, r);
917
917
  }
918
918
  function ie(t, e) {
@@ -926,19 +926,19 @@ function Oe(t, e = {}, r) {
926
926
  if ((i = Array.isArray(n)) || h.Object(n)) {
927
927
  let o = t[s] === void 0;
928
928
  if (i)
929
- i = !1, o && F(t, s, []);
929
+ i = !1, o && k(t, s, []);
930
930
  else if (n._clone && r !== void 0)
931
931
  if (r)
932
- n = n.getRule(), o && F(t, s, {});
932
+ n = n.getRule(), o && k(t, s, {});
933
933
  else {
934
- F(t, s, n._clone());
934
+ k(t, s, n._clone());
935
935
  continue;
936
936
  }
937
937
  else
938
- o && F(t, s, {});
938
+ o && k(t, s, {});
939
939
  t[s] = Oe(t[s], n, r);
940
940
  } else
941
- F(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
941
+ k(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
942
942
  }
943
943
  return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
944
944
  }
@@ -948,7 +948,7 @@ function K(t) {
948
948
  const Br = Object.assign || function(t) {
949
949
  for (let e, r = 1; r < arguments.length; r++)
950
950
  for (let i in e = arguments[r], e)
951
- Object.prototype.hasOwnProperty.call(e, i) && F(t, i, e[i]);
951
+ Object.prototype.hasOwnProperty.call(e, i) && k(t, i, e[i]);
952
952
  return t;
953
953
  };
954
954
  function C() {
@@ -1058,8 +1058,8 @@ function Ie() {
1058
1058
  function oe(t, e, r) {
1059
1059
  let i = t, s;
1060
1060
  return (e || "").split(".").forEach((n) => {
1061
- s && ((!i[s] || typeof i[s] != "object") && F(i, s, {}), i = i[s]), s = n;
1062
- }), F(i, s, r), i;
1061
+ s && ((!i[s] || typeof i[s] != "object") && k(i, s, {}), i = i[s]), s = n;
1062
+ }), k(i, s, r), i;
1063
1063
  }
1064
1064
  const Ur = "fcGroup", Hr = {
1065
1065
  name: Ur,
@@ -1740,7 +1740,7 @@ function Zr(t, e, r) {
1740
1740
  unique: 1,
1741
1741
  renderRule: [...l.value || []],
1742
1742
  updateValue: JSON.stringify(u.value || {})
1743
- }), g = new t(n), y = g.api(), _ = p.value, k = () => {
1743
+ }), g = new t(n), y = g.api(), _ = p.value, F = () => {
1744
1744
  if (o) {
1745
1745
  const E = je(n, o);
1746
1746
  if (E) {
@@ -1787,7 +1787,7 @@ function Zr(t, e, r) {
1787
1787
  }), mr(() => {
1788
1788
  g.updated();
1789
1789
  }), N(f, (E) => {
1790
- E ? k() : G();
1790
+ E ? F() : G();
1791
1791
  }, { immediate: !0 }), N(() => s.option, () => {
1792
1792
  g.initOptions(), y.refresh();
1793
1793
  }, { deep: !0, flush: "sync" }), N(() => [...l.value], (E) => {
@@ -1855,7 +1855,7 @@ C(rt.prototype, {
1855
1855
  return this._data;
1856
1856
  },
1857
1857
  setProp(t, e) {
1858
- return F(this._data, t, e), this;
1858
+ return k(this._data, t, e), this;
1859
1859
  },
1860
1860
  _clone() {
1861
1861
  const t = new this.constructor();
@@ -1955,7 +1955,7 @@ function ti(t) {
1955
1955
  h.Undef(n) ? n = Object.keys(v(v({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
1956
1956
  const u = t.fieldCtx[l] || t.nameCtx[l];
1957
1957
  u && u.forEach((f) => {
1958
- F(f.rule, o, a), t.$render.clearCache(f);
1958
+ k(f.rule, o, a), t.$render.clearCache(f);
1959
1959
  });
1960
1960
  });
1961
1961
  }
@@ -2048,7 +2048,7 @@ function ti(t) {
2048
2048
  if (l) {
2049
2049
  const u = j(n, a);
2050
2050
  l.forEach((f) => {
2051
- F(f.rule, "value", u ? n[a] : void 0);
2051
+ k(f.rule, "value", u ? n[a] : void 0);
2052
2052
  }), delete o[a];
2053
2053
  }
2054
2054
  }), C(t.appendData, o);
@@ -2061,7 +2061,7 @@ function ti(t) {
2061
2061
  const l = t.fieldCtx[a];
2062
2062
  if (!l) return t.appendData[a] = o[a];
2063
2063
  l.forEach((u) => {
2064
- F(u.rule, "value", o[a]);
2064
+ k(u.rule, "value", o[a]);
2065
2065
  });
2066
2066
  });
2067
2067
  }, !0);
@@ -2125,7 +2125,7 @@ function ti(t) {
2125
2125
  disabled(n, o) {
2126
2126
  e(o).forEach((a) => {
2127
2127
  t.getCtxs(a).forEach((l) => {
2128
- F(l.rule.props, "disabled", !!n);
2128
+ k(l.rule.props, "disabled", !!n);
2129
2129
  });
2130
2130
  }), t.refresh();
2131
2131
  },
@@ -2183,7 +2183,7 @@ function ti(t) {
2183
2183
  t.$manager.updateOptions(t.options), s.refresh();
2184
2184
  },
2185
2185
  hideForm: (n) => {
2186
- F(t.vm, "isShow", !n);
2186
+ k(t.vm, "isShow", !n);
2187
2187
  },
2188
2188
  changeStatus: () => t.changeStatus,
2189
2189
  clearChangeStatus: () => {
@@ -2242,7 +2242,7 @@ function ti(t) {
2242
2242
  },
2243
2243
  setEffect(n, o, a) {
2244
2244
  const l = t.getCtx(n);
2245
- l && o && (o[0] === "$" && (o = o.substr(1)), j(l.rule, "$" + o) && F(l.rule, "$" + o, a), j(l.rule, "effect") || F(l.rule, "effect", {}), F(l.rule.effect, o, a));
2245
+ l && o && (o[0] === "$" && (o = o.substr(1)), j(l.rule, "$" + o) && k(l.rule, "$" + o, a), j(l.rule, "effect") || k(l.rule, "effect", {}), k(l.rule.effect, o, a));
2246
2246
  },
2247
2247
  clearEffectData(n, o) {
2248
2248
  const a = t.getCtx(n);
@@ -2329,7 +2329,7 @@ function ti(t) {
2329
2329
  const l = s.getChildrenRuleList(n);
2330
2330
  t.deferSyncValue(() => {
2331
2331
  l.forEach((u) => {
2332
- j(o, u.field) ? F(u, "value", o[u.field]) : a && F(u, "value", void 0);
2332
+ j(o, u.field) ? k(u, "value", o[u.field]) : a && k(u, "value", void 0);
2333
2333
  });
2334
2334
  });
2335
2335
  },
@@ -2602,7 +2602,7 @@ function ii(t) {
2602
2602
  },
2603
2603
  injectProp(e) {
2604
2604
  const r = this.vm;
2605
- r.ctxInject[e.id] || F(r.ctxInject, e.id, {
2605
+ r.ctxInject[e.id] || k(r.ctxInject, e.id, {
2606
2606
  api: this.$handle.api,
2607
2607
  form: this.fc.create,
2608
2608
  subForm: (n) => {
@@ -2633,7 +2633,7 @@ function ii(t) {
2633
2633
  children: e.loadChildrenPending()
2634
2634
  };
2635
2635
  return Object.keys(s).forEach((n) => {
2636
- F(i, n, s[n]);
2636
+ k(i, n, s[n]);
2637
2637
  }), i;
2638
2638
  },
2639
2639
  ctxProp(e) {
@@ -2703,10 +2703,10 @@ function ii(t) {
2703
2703
  const s = Re();
2704
2704
  return e.map((n) => {
2705
2705
  if (n) {
2706
- if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
2706
+ if (h.String(n) || h.Number(n)) return s.setSlot(null, i ? this.renderRule({
2707
2707
  type: "template",
2708
- children: [n]
2709
- }) : n);
2708
+ children: [`${n}`]
2709
+ }) : `${n}`);
2710
2710
  if (n.__fc__)
2711
2711
  return this.renderSlot(s, n.__fc__, r);
2712
2712
  n.type && P(() => {
@@ -2731,7 +2731,7 @@ function ii(t) {
2731
2731
  },
2732
2732
  renderRule(e, r, i) {
2733
2733
  if (!e) return;
2734
- if (h.String(e)) return e;
2734
+ if (h.String(e) || h.Number(e)) return `${e}`;
2735
2735
  let s;
2736
2736
  if (i)
2737
2737
  s = e.type;
@@ -3192,14 +3192,14 @@ function fi(t) {
3192
3192
  if (f)
3193
3193
  f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
3194
3194
  else {
3195
- const k = this.parseRule(o);
3196
- f = new Gt(this, k, g), this.bindParser(f);
3195
+ const F = this.parseRule(o);
3196
+ f = new Gt(this, F, g), this.bindParser(f);
3197
3197
  }
3198
- [!1, !0].forEach((k) => this.parseEmit(f, k)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !p && !d && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
3198
+ [!1, !0].forEach((F) => this.parseEmit(f, F)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !p && !d && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
3199
3199
  const y = f.loadChildrenPending();
3200
3200
  if (f.parser.loadChildren === !1 || s(y, f), !r) {
3201
- const k = i(a);
3202
- k > -1 || !a ? this.sort.splice(k + 1, 0, f.id) : this.sort.push(f.id);
3201
+ const F = i(a);
3202
+ F > -1 || !a ? this.sort.splice(F + 1, 0, f.id) : this.sort.push(f.id);
3203
3203
  }
3204
3204
  const _ = f.rule;
3205
3205
  return f.updated || (f.updated = !0, h.Function(_.update) && this.bus.$once("load-end", () => {
@@ -3287,7 +3287,7 @@ function fi(t) {
3287
3287
  function ci(t) {
3288
3288
  const e = Nt();
3289
3289
  return Object.keys(e).forEach((r) => {
3290
- j(t, r) || F(t, r, e[r]);
3290
+ j(t, r) || k(t, r, e[r]);
3291
3291
  }), t;
3292
3292
  }
3293
3293
  function hi(t) {
@@ -3337,7 +3337,7 @@ function pi(t) {
3337
3337
  setFormData(e, r) {
3338
3338
  e.modelValue = r;
3339
3339
  const i = e.getParentGroup();
3340
- i && (this.subRuleData[i.id] || F(this.subRuleData, i.id, {}), F(this.subRuleData[i.id], e.field, e.rule.value)), F(this.formData, e.id, r);
3340
+ i && (this.subRuleData[i.id] || k(this.subRuleData, i.id, {}), k(this.subRuleData[i.id], e.field, e.rule.value)), k(this.formData, e.id, r);
3341
3341
  },
3342
3342
  rmSubRuleData(e) {
3343
3343
  const r = e.getParentGroup();
@@ -3491,7 +3491,7 @@ function gi(t) {
3491
3491
  this.targetHook(e, "watch", { key: i, oldValue: a, newValue: l });
3492
3492
  }), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(), P(() => {
3493
3493
  this.targetHook(e, "hidden", { value: l });
3494
- })), i === "ignore" && e.input || i === "hidden" && e.input && (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields))
3494
+ })), i === "ignore" && e.input || i === "hidden" && (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields))
3495
3495
  this.syncForm();
3496
3496
  else if (i === "link") {
3497
3497
  e.link();
@@ -3701,8 +3701,6 @@ function gi(t) {
3701
3701
  g = pt(p.field || "");
3702
3702
  else if (!p.mode)
3703
3703
  return !0;
3704
- if (!p.variable && !p.field)
3705
- return !1;
3706
3704
  let _ = p.compare;
3707
3705
  if (_ && (_ = pt(_ || "")), p.mode ? d = n(p) : ce[p.condition] ? h.Function(p.handler) ? d = O(() => p.handler(this.api, e.rule)) : d = O(() => new Function("$condition", "$variableVal", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${p.condition}'](${p.variable ? "$variableVal" : g}, ${_ || "$val"}); }}}}`).call(this.api.form, ce, y, p.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : d = !1, l && d)
3708
3706
  return !0;
@@ -4115,7 +4113,7 @@ const Fi = function(t) {
4115
4113
  let g;
4116
4114
  a.template ? g = t.$handle.loadStrVar(a.template, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null) : a.handler && h.Function(a.handler) ? g = a.handler(p, i, s) : g = t.$handle.loadStrVar(`{{${a.attr}}}`, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null), (g == null || g === "") && a.default != null && (g = a.default), a.copy !== !1 && (g = K(g));
4117
4115
  const y = a.modify ? i : r.getProp();
4118
- a.to === "child" ? y.children ? F(y.children, 0, g) : F(y, "children", [g]) : oe(y, a.to || "options", g), s.sync(i);
4116
+ a.to === "child" ? y.children ? k(y.children, 0, g) : k(y, "children", [g]) : oe(y, a.to || "options", g), s.sync(i);
4119
4117
  }, u = (p) => l(p);
4120
4118
  const f = t.watchLoadData(u);
4121
4119
  l = se(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
@@ -4145,7 +4143,7 @@ const Fi = function(t) {
4145
4143
  let f = (g) => {
4146
4144
  let y = t.t(u ? l.attr : l, u ? l.params : null, g);
4147
4145
  const _ = u && l.modify ? i : r.getProp();
4148
- a === "child" ? _.children ? F(_.children, 0, y) : F(_, "children", [y]) : oe(_, a, y), s.sync(i);
4146
+ a === "child" ? _.children ? k(_.children, 0, y) : k(_, "children", [y]) : oe(_, a, y), s.sync(i);
4149
4147
  }, p = (g) => f(g);
4150
4148
  const d = t.watchLoadData(p);
4151
4149
  f = se(f, l.wait || 300), l.watch !== !1 ? o.push(d) : d();
@@ -4223,16 +4221,16 @@ const Fi = function(t) {
4223
4221
  const g = t.$handle.loadFetchVar(K(a), p, n), y = q(v({
4224
4222
  headers: {}
4225
4223
  }, g), {
4226
- onSuccess(_, k) {
4224
+ onSuccess(_, F) {
4227
4225
  if (f()) return;
4228
- let G = (L) => k ? L : j(L, "data") ? L.data : L;
4226
+ let G = (L) => F ? L : j(L, "data") ? L.data : L;
4229
4227
  const A = z(g.parse);
4230
4228
  h.Function(A) ? G = A : A && h.String(A) && (G = (L) => B(L, A)), Ae(G(_, n, o)).then((L) => {
4231
4229
  l(L);
4232
4230
  });
4233
4231
  },
4234
4232
  onError(_) {
4235
- l(void 0), !f() && (u || ((k) => Ye(k.message || "fetch fail " + g.action)))(_, n, o);
4233
+ l(void 0), !f() && (u || ((F) => Ye(F.message || "fetch fail " + g.action)))(_, n, o);
4236
4234
  }
4237
4235
  });
4238
4236
  t.$handle.beforeFetch(y, { rule: n, api: o }).then(() => {
@@ -4443,7 +4441,7 @@ function Wt(t) {
4443
4441
  let p = { global: {} };
4444
4442
  const d = t.isMobile === !0, g = ne({
4445
4443
  $mobile: d
4446
- }), y = wi(), _ = {}, k = {};
4444
+ }), y = wi(), _ = {}, F = {};
4447
4445
  Ui(t.attrs || {});
4448
4446
  function G(c) {
4449
4447
  const m = U[c];
@@ -4499,7 +4497,7 @@ function Wt(t) {
4499
4497
  const w = b.$refs.fc.formCreate;
4500
4498
  return w.$parent = $, Mi(w.options).appendChild(b.$el), w.api();
4501
4499
  }
4502
- Se(W, k);
4500
+ Se(W, F);
4503
4501
  function zt(c) {
4504
4502
  let m = v({}, t);
4505
4503
  return c ? m.inherit = {
@@ -4544,7 +4542,7 @@ function Wt(t) {
4544
4542
  const $ = (c || "").split(".");
4545
4543
  c = $.shift();
4546
4544
  const b = $.join(".");
4547
- if (j(g, c) || F(g, c, _t), g[c] !== _t) {
4545
+ if (j(g, c) || k(g, c, _t), g[c] !== _t) {
4548
4546
  let w = g[c];
4549
4547
  return w && w._driver ? w = w(b) : $.length && (w = B(w, $)), w == null || w === "" ? m : w;
4550
4548
  } else
@@ -4844,21 +4842,21 @@ function Wt(t) {
4844
4842
  }
4845
4843
  });
4846
4844
  }
4847
- if (ot(k), rr(k), ke("$cookie", Pi), ke("$localStorage", Ti), ke("$sessionStorage", Bi), y.use({ fragment: "fcFragment" }), t.install && W.use(t), pe(Di), t.inherit) {
4845
+ if (ot(F), rr(F), ke("$cookie", Pi), ke("$localStorage", Ti), ke("$sessionStorage", Bi), y.use({ fragment: "fcFragment" }), t.install && W.use(t), pe(Di), t.inherit) {
4848
4846
  const c = t.inherit;
4849
4847
  c.components && C(e, c.components), c.parsers && C(r, c.parsers), c.directives && C(i, c.directives), c.modelFields && C(s, c.modelFields), c.providers && C(u, c.providers), c.useApps && C(o, c.useApps), c.maker && C(f, c.maker), c.loadData && C(g, c.loadData), c.formulas && C(_, c.formulas);
4850
4848
  }
4851
4849
  const Ee = R();
4852
- return Se(Ee, k), Object.defineProperties(Ee, {
4850
+ return Se(Ee, F), Object.defineProperties(Ee, {
4853
4851
  fetch: {
4854
4852
  get() {
4855
- return k.fetch;
4853
+ return F.fetch;
4856
4854
  },
4857
4855
  set(c) {
4858
- k.fetch = c;
4856
+ F.fetch = c;
4859
4857
  }
4860
4858
  }
4861
- }), Ee.util = k, Ee;
4859
+ }), Ee.util = F, Ee;
4862
4860
  }
4863
4861
  const Ct = {
4864
4862
  date: "yyyy-MM-dd",
@@ -5126,15 +5124,15 @@ const on = {
5126
5124
  options: this.options
5127
5125
  }) : ((g = (d = r.refRule) == null ? void 0 : d.__$title) == null ? void 0 : g.value) + (o.labelSuffix || o["label-suffix"] || "")];
5128
5126
  if (!Z(s.show) && (s.info || s.native) && !Z(s.icon)) {
5129
- const k = {
5127
+ const F = {
5130
5128
  type: s.type || "popover",
5131
5129
  slot: "label",
5132
5130
  props: Ge(s),
5133
5131
  key: `${e}pop`
5134
5132
  };
5135
- delete k.props.icon, delete k.props.show, delete k.props.info, delete k.props.align, delete k.props.native;
5133
+ delete F.props.icon, delete F.props.show, delete F.props.info, delete F.props.align, delete F.props.native;
5136
5134
  const G = "content";
5137
- s.info && !j(k.props, G) && (k.props[G] = (_ = (y = r.refRule) == null ? void 0 : y.__$info) == null ? void 0 : _.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(Y([s, k]), [
5135
+ s.info && !j(F.props, G) && (F.props[G] = (_ = (y = r.refRule) == null ? void 0 : y.__$info) == null ? void 0 : _.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(Y([s, F]), [
5138
5136
  this.$r({
5139
5137
  type: "i",
5140
5138
  slot: n ? "default" : "reference",
@@ -5148,7 +5146,12 @@ const on = {
5148
5146
  key: `${e}tit`,
5149
5147
  class: "fc-form-title",
5150
5148
  slot: i.slot || "label",
5151
- type: i.type || "span"
5149
+ type: i.type || "span",
5150
+ on: {
5151
+ click: (...F) => {
5152
+ this.$handle.targetHook(r, "titleClick", { args: F });
5153
+ }
5154
+ }
5152
5155
  }]);
5153
5156
  return delete u.props.show, delete u.props.title, delete u.props.native, this.$r(u, l);
5154
5157
  },
@@ -5402,7 +5405,7 @@ function pn(t) {
5402
5405
  function mn() {
5403
5406
  return Wt({
5404
5407
  ui: "element-ui",
5405
- version: "2.7.19",
5408
+ version: "2.7.20",
5406
5409
  manager: on,
5407
5410
  extendApi: hn,
5408
5411
  install: pn,