@form-create/iview 2.7.15 → 2.7.16

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/iview v2.7.15
3
+ * @form-create/iview v2.7.16
4
4
  * (c) 2018-2025 xaboy
5
5
  * Github https://github.com/xaboy/form-create
6
6
  * Site https://form-create.com/
@@ -1591,9 +1591,9 @@ function Se() {
1591
1591
  function Re(t, e) {
1592
1592
  return Object.setPrototypeOf(t, e), t;
1593
1593
  }
1594
- const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
1594
+ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, ce = {
1595
1595
  "==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
1596
- "!=": (t, e) => !fe["=="](t, e),
1596
+ "!=": (t, e) => !ce["=="](t, e),
1597
1597
  ">": (t, e) => t > e,
1598
1598
  ">=": (t, e) => t >= e,
1599
1599
  "<": (t, e) => t < e,
@@ -1602,13 +1602,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
1602
1602
  return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
1603
1603
  },
1604
1604
  notOn(t, e) {
1605
- return !fe.on(t, e);
1605
+ return !ce.on(t, e);
1606
1606
  },
1607
1607
  in(t, e) {
1608
1608
  return e && e.indexOf && e.indexOf(t) > -1;
1609
1609
  },
1610
1610
  notIn(t, e) {
1611
- return !fe.in(t, e);
1611
+ return !ce.in(t, e);
1612
1612
  },
1613
1613
  between(t, e) {
1614
1614
  return t > e[0] && t < e[1];
@@ -1756,27 +1756,27 @@ function Zr(t, e, r) {
1756
1756
  let k = "";
1757
1757
  const S = s.option && s.option.globalClass || {};
1758
1758
  Object.keys(S).forEach((N) => {
1759
- let de = "";
1759
+ let pe = "";
1760
1760
  S[N].style && Object.keys(S[N].style).forEach((z) => {
1761
- de += $e(z) + ":" + S[N].style[z] + ";";
1762
- }), S[N].content && (de += S[N].content + ";"), de && (k += `.${N}{${de}}`);
1761
+ pe += $e(z) + ":" + S[N].style[z] + ";";
1762
+ }), S[N].content && (pe += S[N].content + ";"), pe && (k += `.${N}{${pe}}`);
1763
1763
  }), s.option && s.option.style && (k += s.option.style), I || (I = document.createElement("style"), I.type = "text/css", document.head.appendChild(I)), I.innerHTML = k || "";
1764
1764
  }, () => {
1765
1765
  });
1766
1766
  });
1767
1767
  const T = ne(() => {
1768
1768
  g.bus.$emit("$loadData.$topForm");
1769
- }, 100), ce = ne(function() {
1769
+ }, 100), he = ne(function() {
1770
1770
  g.bus.$emit("$loadData.$scopeForm");
1771
1771
  }, 100), Pe = ne(() => {
1772
1772
  g.bus.$emit("$loadData.$form");
1773
- }, 100), he = (k) => {
1773
+ }, 100), de = (k) => {
1774
1774
  g.bus.$emit("change-$form." + k);
1775
1775
  };
1776
1776
  return pr(() => {
1777
- o && (y.top.bus.$on("$loadData.$form", T), y.top.bus.$on("change", he)), y !== y.scope && y.scope.bus.$on("$loadData.$scopeForm", ce), g.mounted();
1777
+ o && (y.top.bus.$on("$loadData.$form", T), y.top.bus.$on("change", de)), y !== y.scope && y.scope.bus.$on("$loadData.$scopeForm", he), g.mounted();
1778
1778
  }), mr(() => {
1779
- o && (y.top.bus.$off("$loadData.$form", T), y.top.bus.$off("change", he)), y !== y.scope && y.scope.bus.$off("$loadData.$scopeForm", ce), Y(), d.destroyed = !0, g.unmount(), I && (I.parentNode || I.parentElement) && document.head.removeChild(I);
1779
+ o && (y.top.bus.$off("$loadData.$form", T), y.top.bus.$off("change", de)), y !== y.scope && y.scope.bus.$off("$loadData.$scopeForm", he), Y(), d.destroyed = !0, g.unmount(), I && (I.parentNode || I.parentElement) && document.head.removeChild(I);
1780
1780
  }), gr(() => {
1781
1781
  g.updated();
1782
1782
  }), B(f, (k) => {
@@ -1812,7 +1812,7 @@ function Zr(t, e, r) {
1812
1812
  if (d.destroyed) return;
1813
1813
  const S = Ce(k);
1814
1814
  d.updateValue !== S && (d.updateValue = S, n.$emit("update:value", k), V(() => {
1815
- Pe(), o ? f.value || ce() : (T(), ce());
1815
+ Pe(), o ? f.value || he() : (T(), he());
1816
1816
  }));
1817
1817
  }
1818
1818
  });
@@ -1927,7 +1927,7 @@ function gt(t, e, r) {
1927
1927
  onSuccess(n) {
1928
1928
  let o = (l) => l;
1929
1929
  const a = W(t.parse);
1930
- h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n, void 0, r));
1930
+ h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n, t.targetRule, r));
1931
1931
  },
1932
1932
  onError(n) {
1933
1933
  s(n);
@@ -2593,11 +2593,11 @@ function ri(t) {
2593
2593
  },
2594
2594
  injectProp(e) {
2595
2595
  const r = this.vm;
2596
- r.ctxInject[e.id] || (r.ctxInject[e.id] = {
2596
+ r.ctxInject[e.id] || F(r.ctxInject, e.id, {
2597
2597
  api: this.$handle.api,
2598
2598
  form: this.fc.create,
2599
- subForm: (s) => {
2600
- this.$handle.addSubForm(e, s);
2599
+ subForm: (n) => {
2600
+ this.$handle.addSubForm(e, n);
2601
2601
  },
2602
2602
  getSubForm: () => this.$handle.subForm[e.id],
2603
2603
  slots: () => this.vm.top.$scopedSlots,
@@ -2609,20 +2609,22 @@ function ri(t) {
2609
2609
  field: e.field,
2610
2610
  rule: e.rule,
2611
2611
  input: e.input,
2612
- t: (...s) => this.$handle.api.t(...s),
2613
- updateValue: (s) => {
2614
- this.$handle.onUpdateValue(e, s);
2612
+ t: (...n) => this.$handle.api.t(...n),
2613
+ updateValue: (n) => {
2614
+ this.$handle.onUpdateValue(e, n);
2615
2615
  }
2616
2616
  });
2617
- const i = r.ctxInject[e.id];
2618
- return C(i, {
2617
+ const i = r.ctxInject[e.id], s = {
2619
2618
  preview: e.prop.preview,
2620
2619
  options: e.prop.options,
2621
2620
  prop: function() {
2622
- const s = _({}, e.prop);
2623
- return s.on = s.on ? _({}, s.on) : {}, delete s.model, s;
2621
+ const n = _({}, e.prop);
2622
+ return n.on = n.on ? _({}, n.on) : {}, delete n.model, n;
2624
2623
  }(),
2625
2624
  children: e.loadChildrenPending()
2625
+ };
2626
+ return Object.keys(s).forEach((n) => {
2627
+ F(i, n, s[n]);
2626
2628
  }), i;
2627
2629
  },
2628
2630
  ctxProp(e) {
@@ -3203,7 +3205,7 @@ function ui(t) {
3203
3205
  if (!r.length) return !1;
3204
3206
  for (let a = 0; a < r.length; a++) {
3205
3207
  const l = r[a], u = l.handle || function(p) {
3206
- return (fe[l.condition || "=="] || fe["=="])(p, l.value);
3208
+ return (ce[l.condition || "=="] || ce["=="])(p, l.value);
3207
3209
  };
3208
3210
  if (!h.trueArray(l.rule)) continue;
3209
3211
  const f = U(_({}, l), {
@@ -3689,7 +3691,7 @@ function mi(t) {
3689
3691
  else if (!p.mode)
3690
3692
  return !0;
3691
3693
  let y = p.compare;
3692
- if (y && (y = dt(y || "")), p.mode ? d = n(p) : fe[p.condition] ? h.Function(p.handler) ? d = O(() => p.handler(this.api, e.rule)) : d = O(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${p.condition}'](${g}, ${y || "$val"}); }}}}`).call(this.api.form, fe, 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)
3694
+ if (y && (y = dt(y || "")), 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", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${p.condition}'](${g}, ${y || "$val"}); }}}}`).call(this.api.form, ce, 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)
3693
3695
  return !0;
3694
3696
  l || (u = u && d);
3695
3697
  }
@@ -4195,8 +4197,9 @@ const Oi = function(t) {
4195
4197
  if (d && a.watch === !1)
4196
4198
  return i._fn[s.id]();
4197
4199
  if (a.key) {
4200
+ t.targetRule = n;
4198
4201
  const v = p("$globalData." + a.key);
4199
- if (v) {
4202
+ if (delete t.targetRule, v) {
4200
4203
  if (f()) return;
4201
4204
  l(v);
4202
4205
  }
@@ -4439,7 +4442,7 @@ function Kt(t) {
4439
4442
  const c = Me(...arguments);
4440
4443
  c.id && c.prop && (i[c.id] = c.prop);
4441
4444
  }
4442
- function ce() {
4445
+ function he() {
4443
4446
  const c = Me(...arguments);
4444
4447
  c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(_({}, c.prop), {
4445
4448
  name: c.id
@@ -4448,7 +4451,7 @@ function Kt(t) {
4448
4451
  function Pe(c) {
4449
4452
  y.use(c);
4450
4453
  }
4451
- function he() {
4454
+ function de() {
4452
4455
  const c = Me(...arguments);
4453
4456
  if (!c.id || !c.prop) return je;
4454
4457
  const m = q(c.id), $ = c.prop, b = $.merge === !0 ? r[m] : void 0;
@@ -4463,7 +4466,7 @@ function Kt(t) {
4463
4466
  $ = q(c.name), m = c;
4464
4467
  if (!$ || !m) return;
4465
4468
  const b = q($);
4466
- e[$] = m, e[b] = m, delete y.aliasMap[$], delete y.aliasMap[b], delete r[$], delete r[b], m.formCreateParser && he($, m.formCreateParser);
4469
+ e[$] = m, e[b] = m, delete y.aliasMap[$], delete y.aliasMap[b], delete r[$], delete r[b], m.formCreateParser && de($, m.formCreateParser);
4467
4470
  }
4468
4471
  function S() {
4469
4472
  return Zr(Be, e, i);
@@ -4471,7 +4474,7 @@ function Kt(t) {
4471
4474
  function N() {
4472
4475
  return Ne;
4473
4476
  }
4474
- function de(c, m) {
4477
+ function pe(c, m) {
4475
4478
  return h.Function(c.install) ? c.install(z, m) : h.Function(c) && c(z, m), this;
4476
4479
  }
4477
4480
  function z(c, m, $) {
@@ -4622,8 +4625,8 @@ function Kt(t) {
4622
4625
  R();
4623
4626
  return;
4624
4627
  }
4625
- const pe = this.$handle.loadFetchVar(Je(b), J);
4626
- this.$handle.api.fetch(pe).then((te) => {
4628
+ const ue = this.$handle.loadFetchVar(Je(b), J);
4629
+ ue.targetRule = this.targetRule, this.$handle.api.fetch(ue).then((te) => {
4627
4630
  be(te);
4628
4631
  }).catch((te) => {
4629
4632
  be(null);
@@ -4701,17 +4704,17 @@ function Kt(t) {
4701
4704
  let ae;
4702
4705
  if (typeof R == "object" && (ae = R.getValue, R = R.id), $[R])
4703
4706
  return $[R].val;
4704
- const ee = ge(() => ae ? ae() : this.getLoadData(R, be)), J = R.split("."), le = J.shift(), pe = J.shift() || "", te = ne(() => {
4705
- const ue = ae ? ae() : this.getLoadData(R, be);
4707
+ const ee = ge(() => ae ? ae() : this.getLoadData(R, be)), J = R.split("."), le = J.shift(), ue = J.shift() || "", te = ne(() => {
4708
+ const fe = ae ? ae() : this.getLoadData(R, be);
4706
4709
  if ($[R])
4707
- ((ue instanceof Function || h.Object(ue) || Array.isArray(ue)) && ue === $[R].val || JSON.stringify(ue) !== JSON.stringify($[R].val)) && ($[R].val = ue, b(!0));
4710
+ ((fe instanceof Function || h.Object(fe) || Array.isArray(fe)) && fe === $[R].val || JSON.stringify(fe) !== JSON.stringify($[R].val)) && ($[R].val = fe, b(!0));
4708
4711
  else return;
4709
- }, m || 0), nr = B(ee, (ue) => {
4712
+ }, m || 0), nr = B(ee, (fe) => {
4710
4713
  te();
4711
4714
  });
4712
- return this.bus.$on("$loadData." + le, te), pe && this.bus.$on("$loadData." + le + "." + pe, te), $[R] = {
4715
+ return this.bus.$on("$loadData." + le, te), ue && this.bus.$on("$loadData." + le + "." + ue, te), $[R] = {
4713
4716
  fn: () => {
4714
- this.bus.$off("$loadData." + le, te), pe && this.bus.$off("$loadData." + le + "." + pe, te), nr();
4717
+ this.bus.$off("$loadData." + le, te), ue && this.bus.$off("$loadData." + le + "." + ue, te), nr();
4715
4718
  },
4716
4719
  val: ee.value
4717
4720
  }, ee.value;
@@ -4788,10 +4791,10 @@ function Kt(t) {
4788
4791
  setModelField: xt,
4789
4792
  setFormula: Qt,
4790
4793
  setDriver: Yt,
4791
- register: ce,
4794
+ register: he,
4792
4795
  $vnode: N,
4793
- parser: he,
4794
- use: de,
4796
+ parser: de,
4797
+ use: pe,
4795
4798
  factory: Zt,
4796
4799
  componentAlias: Pe,
4797
4800
  copyRule: Lt,
@@ -4824,7 +4827,7 @@ function Kt(t) {
4824
4827
  }
4825
4828
  });
4826
4829
  }
4827
- if (st(E), ir(E), Fe("$cookie", Vi), Fe("$localStorage", Pi), Fe("$sessionStorage", Li), y.use({ fragment: "fcFragment" }), t.install && z.use(t), he(ji), t.inherit) {
4830
+ if (st(E), ir(E), Fe("$cookie", Vi), Fe("$localStorage", Pi), Fe("$sessionStorage", Li), y.use({ fragment: "fcFragment" }), t.install && z.use(t), de(ji), t.inherit) {
4828
4831
  const c = t.inherit;
4829
4832
  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(v, c.formulas);
4830
4833
  }
@@ -5388,7 +5391,7 @@ function cn(t) {
5388
5391
  function hn() {
5389
5392
  return Kt({
5390
5393
  ui: "iview",
5391
- version: "2.7.15",
5394
+ version: "2.7.16",
5392
5395
  manager: en,
5393
5396
  install: cn,
5394
5397
  extendApi: un,