@form-create/element-ui 2.7.23 → 2.7.24
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/form-create.esm.js +181 -180
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/element-ui v2.7.
|
|
3
|
+
* @form-create/element-ui v2.7.24
|
|
4
4
|
* (c) 2018-2026 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -11,7 +11,7 @@ var nr = Object.defineProperty, sr = Object.defineProperties;
|
|
|
11
11
|
var or = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var at = Object.getOwnPropertySymbols;
|
|
13
13
|
var ar = Object.prototype.hasOwnProperty, lr = Object.prototype.propertyIsEnumerable;
|
|
14
|
-
var lt = (t, e, r) => e in t ? nr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r,
|
|
14
|
+
var lt = (t, e, r) => e in t ? nr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, _ = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
16
|
ar.call(e, r) && lt(t, r, e[r]);
|
|
17
17
|
if (at)
|
|
@@ -111,7 +111,7 @@ const Or = "fcCheckbox", Fr = {
|
|
|
111
111
|
input: this.onInput
|
|
112
112
|
}
|
|
113
113
|
}]), [this.options().map((e, r) => {
|
|
114
|
-
const i =
|
|
114
|
+
const i = _({}, e), s = this.type === "button" ? "ElCheckboxButton" : "ElCheckbox";
|
|
115
115
|
return delete i.value, t(s, I([{}, {
|
|
116
116
|
props: i
|
|
117
117
|
}, {
|
|
@@ -469,7 +469,7 @@ const kr = "fcFrame", Er = {
|
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
471
|
})]), t("el-dialog", I([{}, {
|
|
472
|
-
props: q(
|
|
472
|
+
props: q(_({
|
|
473
473
|
width: i,
|
|
474
474
|
title: o,
|
|
475
475
|
appendToBody: !0
|
|
@@ -550,7 +550,7 @@ const kr = "fcFrame", Er = {
|
|
|
550
550
|
input: this.onInput
|
|
551
551
|
}
|
|
552
552
|
}]), [this.options().map((e, r) => {
|
|
553
|
-
const i =
|
|
553
|
+
const i = _({}, e), s = this.type === "button" ? "ElRadioButton" : "ElRadio";
|
|
554
554
|
return delete i.value, t(s, I([{}, {
|
|
555
555
|
props: i
|
|
556
556
|
}, {
|
|
@@ -692,7 +692,7 @@ function ft(t, e) {
|
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
694
|
function ct(t) {
|
|
695
|
-
return q(
|
|
695
|
+
return q(_({}, t), {
|
|
696
696
|
file: t,
|
|
697
697
|
value: t
|
|
698
698
|
});
|
|
@@ -955,7 +955,7 @@ function C() {
|
|
|
955
955
|
return Br.apply(this, arguments);
|
|
956
956
|
}
|
|
957
957
|
function Ke(t) {
|
|
958
|
-
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] :
|
|
958
|
+
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : _({}, t);
|
|
959
959
|
}
|
|
960
960
|
function se(t, e) {
|
|
961
961
|
var r = null;
|
|
@@ -1196,7 +1196,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1196
1196
|
if (i.filter((n) => r[n].$f).length !== i.length)
|
|
1197
1197
|
return;
|
|
1198
1198
|
const s = i.map((n) => {
|
|
1199
|
-
const o = t === n ? e :
|
|
1199
|
+
const o = t === n ? e : _({}, this.cacheRule[n].$f.form), a = this.field ? o[this.field] || null : o;
|
|
1200
1200
|
return this.cache(n, a), a;
|
|
1201
1201
|
});
|
|
1202
1202
|
this.input(s);
|
|
@@ -1208,7 +1208,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1208
1208
|
}), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cache(t, e), i && i.coverValue(e || {}));
|
|
1209
1209
|
},
|
|
1210
1210
|
addRule(t, e) {
|
|
1211
|
-
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ?
|
|
1211
|
+
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? _({}, this.options) : {
|
|
1212
1212
|
submitBtn: !1,
|
|
1213
1213
|
resetBtn: !1
|
|
1214
1214
|
};
|
|
@@ -1418,7 +1418,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1418
1418
|
submitBtn: !1,
|
|
1419
1419
|
resetBtn: !1
|
|
1420
1420
|
};
|
|
1421
|
-
t.formData =
|
|
1421
|
+
t.formData = _({}, this.value || {}), this.cacheRule = {
|
|
1422
1422
|
rule: this.rule,
|
|
1423
1423
|
options: t
|
|
1424
1424
|
};
|
|
@@ -1472,7 +1472,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1472
1472
|
if (o.indexOf(u) > -1)
|
|
1473
1473
|
a[u] = Y([l[u]], a[u]);
|
|
1474
1474
|
else if (i.indexOf(u) > -1)
|
|
1475
|
-
a[u] =
|
|
1475
|
+
a[u] = _(_({}, a[u]), l[u]);
|
|
1476
1476
|
else if (s.indexOf(u) > -1) {
|
|
1477
1477
|
const f = a[u] instanceof Array ? a[u] : [a[u]], p = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1478
1478
|
a[u] = [...f, ...p];
|
|
@@ -1489,7 +1489,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1489
1489
|
else
|
|
1490
1490
|
a[u] = l[u];
|
|
1491
1491
|
else
|
|
1492
|
-
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] =
|
|
1492
|
+
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = _({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? _({}, l[u]) : l[u] : a[u] = l[u];
|
|
1493
1493
|
return a;
|
|
1494
1494
|
}, e);
|
|
1495
1495
|
}, Wr = (t, e) => function() {
|
|
@@ -1740,19 +1740,19 @@ function Zr(t, e, r) {
|
|
|
1740
1740
|
unique: 1,
|
|
1741
1741
|
renderRule: [...l.value || []],
|
|
1742
1742
|
updateValue: JSON.stringify(u.value || {})
|
|
1743
|
-
}), m = new t(n),
|
|
1743
|
+
}), m = new t(n), $ = m.api(), v = p.value, F = () => {
|
|
1744
1744
|
if (o) {
|
|
1745
1745
|
const E = De(n, o);
|
|
1746
1746
|
if (E) {
|
|
1747
1747
|
let S;
|
|
1748
|
-
|
|
1748
|
+
v ? (S = G(E.getSubForm()), S.push($)) : S = $, E.subForm(S);
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
1751
|
}, J = () => {
|
|
1752
1752
|
const E = De(n, o);
|
|
1753
1753
|
if (E)
|
|
1754
|
-
if (
|
|
1755
|
-
const S = G(E.getSubForm()), M = S.indexOf(
|
|
1754
|
+
if (v) {
|
|
1755
|
+
const S = G(E.getSubForm()), M = S.indexOf($);
|
|
1756
1756
|
M > -1 && S.splice(M, 1);
|
|
1757
1757
|
} else
|
|
1758
1758
|
E.subForm();
|
|
@@ -1781,32 +1781,32 @@ function Zr(t, e, r) {
|
|
|
1781
1781
|
m.bus.$emit("change-$form." + E);
|
|
1782
1782
|
};
|
|
1783
1783
|
return dr(() => {
|
|
1784
|
-
o && (
|
|
1784
|
+
o && ($.top.bus.$on("$loadData.$form", L), $.top.bus.$on("change", me)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", pe), m.mounted();
|
|
1785
1785
|
}), pr(() => {
|
|
1786
|
-
o && (
|
|
1786
|
+
o && ($.top.bus.$off("$loadData.$form", L), $.top.bus.$off("change", me)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", pe), J(), d.destroyed = !0, m.unmount(), A && (A.parentNode || A.parentElement) && document.head.removeChild(A);
|
|
1787
1787
|
}), mr(() => {
|
|
1788
1788
|
m.updated();
|
|
1789
1789
|
}), N(f, (E) => {
|
|
1790
1790
|
E ? F() : J();
|
|
1791
1791
|
}, { immediate: !0 }), N(() => s.option, () => {
|
|
1792
|
-
m.initOptions(),
|
|
1792
|
+
m.initOptions(), $.refresh();
|
|
1793
1793
|
}, { deep: !0, flush: "sync" }), N(() => [...l.value], (E) => {
|
|
1794
1794
|
m.$handle.isBreakWatch() || E.length === d.renderRule.length && E.every((S) => d.renderRule.indexOf(S) > -1) || (m.$handle.updateAppendData(), m.$handle.reloadRule(l.value), n.renderRule());
|
|
1795
1795
|
}), N(() => [s.disabled, s.preview], () => {
|
|
1796
|
-
|
|
1796
|
+
$.refresh();
|
|
1797
1797
|
}), N(u, (E) => {
|
|
1798
|
-
Oe(E || {}) !== d.updateValue && (
|
|
1798
|
+
Oe(E || {}) !== d.updateValue && ($.config.forceCoverValue ? $.coverValue(E || {}) : $.setValue(E || {}));
|
|
1799
1799
|
}, { deep: !0, flush: "post" }), N(() => s.index, () => {
|
|
1800
|
-
|
|
1800
|
+
$.coverValue({}), m.$handle.updateAppendData(), P(() => {
|
|
1801
1801
|
P(() => {
|
|
1802
|
-
|
|
1802
|
+
$.clearValidateState();
|
|
1803
1803
|
});
|
|
1804
1804
|
});
|
|
1805
|
-
}, { flush: "sync" }), q(
|
|
1805
|
+
}, { flush: "sync" }), q(_({
|
|
1806
1806
|
fc: ye(m),
|
|
1807
1807
|
parent: o && ye(o),
|
|
1808
1808
|
top: ye(a),
|
|
1809
|
-
fapi: ye(
|
|
1809
|
+
fapi: ye($)
|
|
1810
1810
|
}, ut(d)), {
|
|
1811
1811
|
getGroupInject: () => De(n, o),
|
|
1812
1812
|
refresh() {
|
|
@@ -1930,7 +1930,7 @@ function Ut(t) {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
function yt(t, e, r) {
|
|
1932
1932
|
return new Promise((i, s) => {
|
|
1933
|
-
(e || Ut)(q(
|
|
1933
|
+
(e || Ut)(q(_({}, t), {
|
|
1934
1934
|
onSuccess(n) {
|
|
1935
1935
|
let o = (l) => l;
|
|
1936
1936
|
const a = x(t.parse);
|
|
@@ -1952,7 +1952,7 @@ function ti(t) {
|
|
|
1952
1952
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1953
1953
|
}
|
|
1954
1954
|
function r(n, o, a) {
|
|
1955
|
-
h.Undef(n) ? n = Object.keys(
|
|
1955
|
+
h.Undef(n) ? n = Object.keys(_(_({}, 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
1958
|
k(f.rule, o, a), t.$render.clearCache(f);
|
|
@@ -2025,7 +2025,7 @@ function ti(t) {
|
|
|
2025
2025
|
}
|
|
2026
2026
|
},
|
|
2027
2027
|
get formulas() {
|
|
2028
|
-
return
|
|
2028
|
+
return _({}, t.fc.formulas);
|
|
2029
2029
|
},
|
|
2030
2030
|
formData(n) {
|
|
2031
2031
|
if (n == null || typeof n == "boolean") {
|
|
@@ -2041,7 +2041,7 @@ function ti(t) {
|
|
|
2041
2041
|
return o ? _e(o.rule.value) : t.options.appendValue !== !1 && j(t.appendData, n) ? _e(t.appendData[n]) : void 0;
|
|
2042
2042
|
},
|
|
2043
2043
|
coverValue(n) {
|
|
2044
|
-
const o =
|
|
2044
|
+
const o = _({}, n || {});
|
|
2045
2045
|
t.deferSyncValue(() => {
|
|
2046
2046
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
2047
2047
|
const l = t.fieldCtx[a];
|
|
@@ -2553,6 +2553,7 @@ function ii(t) {
|
|
|
2553
2553
|
return;
|
|
2554
2554
|
}
|
|
2555
2555
|
s = (...l) => {
|
|
2556
|
+
var $;
|
|
2556
2557
|
const u = {
|
|
2557
2558
|
rule: i,
|
|
2558
2559
|
prop: n,
|
|
@@ -2564,20 +2565,20 @@ function ii(t) {
|
|
|
2564
2565
|
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2565
2566
|
let f = [];
|
|
2566
2567
|
const p = e.loadChildrenPending();
|
|
2567
|
-
e.parser.renderChildren ? f = e.parser.renderChildren(p, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(p, e)), Object.keys(n.renderSlots || {}).forEach((
|
|
2568
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(p, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(p, e)), Object.keys(n.renderSlots || {}).forEach((v) => {
|
|
2568
2569
|
f.push(this.renderRule({
|
|
2569
2570
|
type: "template",
|
|
2570
|
-
slot:
|
|
2571
|
+
slot: v
|
|
2571
2572
|
}, (() => {
|
|
2572
|
-
if (h.Function(n.renderSlots[
|
|
2573
|
-
return O(() => n.renderSlots[
|
|
2574
|
-
const
|
|
2575
|
-
return this.renderRule(
|
|
2573
|
+
if (h.Function(n.renderSlots[v]))
|
|
2574
|
+
return O(() => n.renderSlots[v]());
|
|
2575
|
+
const F = this.parseSide(n.renderSlots[v], e);
|
|
2576
|
+
return this.renderRule(F);
|
|
2576
2577
|
})()));
|
|
2577
2578
|
});
|
|
2578
2579
|
const d = this.getTypeSlot(e);
|
|
2579
2580
|
let m;
|
|
2580
|
-
return d ? (u.children = f, m = d(u)) : m = a ? e.parser.preview(Ke(f), e) : e.parser.render(Ke(f), e), m = this.renderSides(m, e), (e.input
|
|
2581
|
+
return d ? (u.children = f, m = d(u)) : m = a ? e.parser.preview(Ke(f), e) : e.parser.render(Ke(f), e), m = this.renderSides(m, e), (!(!e.input && h.Undef(n.native)) || (($ = n.col) == null ? void 0 : $.show) === !0) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), m = this.$manager.makeWrap(e, m)), e.none && (Array.isArray(m) ? m = m.map((v) => !v || !v.tag ? v : this.none(v)) : m = this.none(m)), o && this.setCache(e, () => this.stable(m), r), m;
|
|
2581
2582
|
}, this.setCache(e, s, r);
|
|
2582
2583
|
}
|
|
2583
2584
|
return (...s) => {
|
|
@@ -2644,8 +2645,8 @@ function ii(t) {
|
|
|
2644
2645
|
preview: e.prop.preview,
|
|
2645
2646
|
options: e.prop.options,
|
|
2646
2647
|
prop: function() {
|
|
2647
|
-
const n =
|
|
2648
|
-
return n.on = n.on ?
|
|
2648
|
+
const n = _({}, e.prop);
|
|
2649
|
+
return n.on = n.on ? _({}, n.on) : {}, delete n.model, n;
|
|
2649
2650
|
}(),
|
|
2650
2651
|
children: e.loadChildrenPending()
|
|
2651
2652
|
};
|
|
@@ -2656,7 +2657,7 @@ function ii(t) {
|
|
|
2656
2657
|
ctxProp(e) {
|
|
2657
2658
|
const { ref: r, key: i, rule: s } = e;
|
|
2658
2659
|
this.$manager.mergeProp(e), e.parser.mergeProp(e);
|
|
2659
|
-
const n =
|
|
2660
|
+
const n = _({}, e.prop.on || {}), o = {};
|
|
2660
2661
|
Object.keys(n).forEach((l) => {
|
|
2661
2662
|
if (l.indexOf("native.") === 0)
|
|
2662
2663
|
o[l.replace("native.", "")] = n[l], delete n[l];
|
|
@@ -2765,7 +2766,7 @@ function ii(t) {
|
|
|
2765
2766
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2766
2767
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2767
2768
|
});
|
|
2768
|
-
const o =
|
|
2769
|
+
const o = _({}, e);
|
|
2769
2770
|
return delete o.type, delete o.is, this.vNode.make(s, o, n.mergeBag(r).getSlots());
|
|
2770
2771
|
}
|
|
2771
2772
|
});
|
|
@@ -2822,14 +2823,14 @@ function si(t) {
|
|
|
2822
2823
|
let p, d = n || o || a;
|
|
2823
2824
|
if (h.Object(f) && (p = f.inject, f = f.name, d = f.prefix || d), d) {
|
|
2824
2825
|
r || (d = `native-${d}`);
|
|
2825
|
-
const m = ve(`${d}-${f}`),
|
|
2826
|
-
this.vm.$emit(m, ...
|
|
2826
|
+
const m = ve(`${d}-${f}`), $ = (...v) => {
|
|
2827
|
+
this.vm.$emit(m, ...v), this.vm.$emit("emit-event", m, ...v), this.bus.$emit(m, ...v);
|
|
2827
2828
|
};
|
|
2828
|
-
if (
|
|
2829
|
-
i[f] =
|
|
2829
|
+
if ($.__emit = !0, !p && l === !1)
|
|
2830
|
+
i[f] = $;
|
|
2830
2831
|
else {
|
|
2831
|
-
let
|
|
2832
|
-
i[f] = h.Undef(
|
|
2832
|
+
let v = p || l || this.options.injectEvent;
|
|
2833
|
+
i[f] = h.Undef(v) ? $ : this.inject(s, $, v);
|
|
2833
2834
|
}
|
|
2834
2835
|
}
|
|
2835
2836
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2884,8 +2885,8 @@ function si(t) {
|
|
|
2884
2885
|
const f = u.split("||"), p = f[0].trim();
|
|
2885
2886
|
if (p) {
|
|
2886
2887
|
const d = (f[1] || "").trim(), m = Lt(p);
|
|
2887
|
-
let
|
|
2888
|
-
(
|
|
2888
|
+
let $ = O(() => a(m));
|
|
2889
|
+
($ == null || $ === "") && f.length > 1 && ($ = d), l = $, e = e.replaceAll(`{{${u}}}`, $ == null ? "" : $);
|
|
2889
2890
|
}
|
|
2890
2891
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2891
2892
|
return l;
|
|
@@ -2972,7 +2973,7 @@ function Gt(t, e, r) {
|
|
|
2972
2973
|
parent: null,
|
|
2973
2974
|
group: e.subRule ? this : null,
|
|
2974
2975
|
cacheConfig: null,
|
|
2975
|
-
prop:
|
|
2976
|
+
prop: _({}, e),
|
|
2976
2977
|
computed: {},
|
|
2977
2978
|
payload: {},
|
|
2978
2979
|
refRule: {},
|
|
@@ -3062,9 +3063,9 @@ C(Gt.prototype, {
|
|
|
3062
3063
|
this.parser = t, t.init(this);
|
|
3063
3064
|
},
|
|
3064
3065
|
initProp() {
|
|
3065
|
-
var e, r;
|
|
3066
|
-
const t =
|
|
3067
|
-
delete t.children, delete t.validate, this.prop = ee({}, [t, ...Object.keys(this.payload).map((
|
|
3066
|
+
var e, r, i;
|
|
3067
|
+
const t = _({}, this.rule);
|
|
3068
|
+
delete t.children, delete t.validate, this.prop = ee({}, [t, ...Object.keys(this.payload).map((s) => this.payload[s]), this.computed]), t.col && ((e = t.col) == null ? void 0 : e.show) !== !1 && (this.prop.col.show = !0), this.prop.validate = [...((i = (r = this.refRule) == null ? void 0 : r.__$validate) == null ? void 0 : i.value) || [], ...this.prop.validate || []];
|
|
3068
3069
|
},
|
|
3069
3070
|
initNone() {
|
|
3070
3071
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -3216,14 +3217,14 @@ function fi(t) {
|
|
|
3216
3217
|
f = new Gt(this, F, m), this.bindParser(f);
|
|
3217
3218
|
}
|
|
3218
3219
|
[!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");
|
|
3219
|
-
const
|
|
3220
|
-
if (f.parser.loadChildren === !1 || s(
|
|
3220
|
+
const $ = f.loadChildrenPending();
|
|
3221
|
+
if (f.parser.loadChildren === !1 || s($, f), !r) {
|
|
3221
3222
|
const F = i(a);
|
|
3222
3223
|
F > -1 || !a ? this.sort.splice(F + 1, 0, f.id) : this.sort.push(f.id);
|
|
3223
3224
|
}
|
|
3224
|
-
const
|
|
3225
|
-
return f.updated || (f.updated = !0, h.Function(
|
|
3226
|
-
this.refreshUpdate(f,
|
|
3225
|
+
const v = f.rule;
|
|
3226
|
+
return f.updated || (f.updated = !0, h.Function(v.update) && this.bus.$once("load-end", () => {
|
|
3227
|
+
this.refreshUpdate(f, v.value, "init");
|
|
3227
3228
|
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3228
3229
|
}).filter((o) => !!o);
|
|
3229
3230
|
r && (r.children = n);
|
|
@@ -3239,7 +3240,7 @@ function fi(t) {
|
|
|
3239
3240
|
return (he[l.condition || "=="] || he["=="])(p, l.value);
|
|
3240
3241
|
};
|
|
3241
3242
|
if (!h.trueArray(l.rule)) continue;
|
|
3242
|
-
const f = q(
|
|
3243
|
+
const f = q(_({}, l), {
|
|
3243
3244
|
valid: O(() => u(e.rule.value, s)),
|
|
3244
3245
|
ctrl: di(e, l.rule),
|
|
3245
3246
|
isHidden: h.String(l.rule[0])
|
|
@@ -3250,34 +3251,34 @@ function fi(t) {
|
|
|
3250
3251
|
const n = [];
|
|
3251
3252
|
let o = !1;
|
|
3252
3253
|
return this.deferSyncValue(() => {
|
|
3253
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl: m, method:
|
|
3254
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl: m, method: $ }) => {
|
|
3254
3255
|
if (a) {
|
|
3255
3256
|
l ? e.ctrlRule.push({
|
|
3256
3257
|
__ctrl: !0,
|
|
3257
3258
|
children: u,
|
|
3258
3259
|
valid: l
|
|
3259
3260
|
}) : m && e.ctrlRule.splice(e.ctrlRule.indexOf(m) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3260
|
-
|
|
3261
|
-
this.api.setEffect(
|
|
3262
|
-
}), l || this.api.clearValidateState(u)) :
|
|
3261
|
+
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((v) => {
|
|
3262
|
+
this.api.setEffect(v, "required", l);
|
|
3263
|
+
}), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
3263
3264
|
});
|
|
3264
3265
|
return;
|
|
3265
3266
|
}
|
|
3266
3267
|
if (l) {
|
|
3267
3268
|
o = !0;
|
|
3268
|
-
const
|
|
3269
|
+
const v = {
|
|
3269
3270
|
type: "fragment",
|
|
3270
3271
|
native: !0,
|
|
3271
3272
|
__ctrl: !0,
|
|
3272
3273
|
children: u
|
|
3273
3274
|
};
|
|
3274
|
-
e.ctrlRule.push(
|
|
3275
|
-
f ? s.prepend(
|
|
3275
|
+
e.ctrlRule.push(v), this.bus.$once("load-start", () => {
|
|
3276
|
+
f ? s.prepend(v, f, d) : p || d ? s.append(v, p || e.id, d) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, v);
|
|
3276
3277
|
});
|
|
3277
3278
|
} else {
|
|
3278
3279
|
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3279
|
-
const
|
|
3280
|
-
|
|
3280
|
+
const v = Q(m);
|
|
3281
|
+
v && v.rm();
|
|
3281
3282
|
}
|
|
3282
3283
|
});
|
|
3283
3284
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
@@ -3291,7 +3292,7 @@ function fi(t) {
|
|
|
3291
3292
|
},
|
|
3292
3293
|
_reloadRule(e) {
|
|
3293
3294
|
e || (e = this.rules);
|
|
3294
|
-
const r =
|
|
3295
|
+
const r = _({}, this.ctxs);
|
|
3295
3296
|
this.clearNextTick(), this.initData(e), this.fc.rules = e, this.deferSyncValue(() => {
|
|
3296
3297
|
this.bus.$once("load-end", () => {
|
|
3297
3298
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
@@ -3541,7 +3542,7 @@ function gi(t) {
|
|
|
3541
3542
|
return n ? this.api.t(n[1], { title: (a = (o = e.refRule) == null ? void 0 : o.__$title) == null ? void 0 : a.value }) : s;
|
|
3542
3543
|
};
|
|
3543
3544
|
return G(e.rule.validate).map((s) => {
|
|
3544
|
-
const n =
|
|
3545
|
+
const n = _({}, s);
|
|
3545
3546
|
if (n.message && (n.message = i(n.message)), h.Function(n.validator)) {
|
|
3546
3547
|
const o = e;
|
|
3547
3548
|
n.validator = function(...a) {
|
|
@@ -3556,7 +3557,7 @@ function gi(t) {
|
|
|
3556
3557
|
}
|
|
3557
3558
|
if (n.adapter) {
|
|
3558
3559
|
if (typeof n.error == "object") {
|
|
3559
|
-
const o =
|
|
3560
|
+
const o = _({}, n.error);
|
|
3560
3561
|
Object.keys(o).forEach((a) => {
|
|
3561
3562
|
o[a] = i(o[a]);
|
|
3562
3563
|
}), n.error = o;
|
|
@@ -3634,7 +3635,7 @@ function gi(t) {
|
|
|
3634
3635
|
case "len":
|
|
3635
3636
|
case "maxLen":
|
|
3636
3637
|
case "minLen":
|
|
3637
|
-
const a = (
|
|
3638
|
+
const a = ($) => n === "len" ? $ === o : n === "maxLen" ? $ <= o : $ >= o;
|
|
3638
3639
|
if (Array.isArray(r)) {
|
|
3639
3640
|
if (!a(r.length))
|
|
3640
3641
|
return n;
|
|
@@ -3676,7 +3677,7 @@ function gi(t) {
|
|
|
3676
3677
|
return n;
|
|
3677
3678
|
break;
|
|
3678
3679
|
case "hasKeys":
|
|
3679
|
-
if (typeof r != "object" || Array.isArray(o) && o.some((
|
|
3680
|
+
if (typeof r != "object" || Array.isArray(o) && o.some(($) => !($ in r)))
|
|
3680
3681
|
return n;
|
|
3681
3682
|
break;
|
|
3682
3683
|
case "email":
|
|
@@ -3714,15 +3715,15 @@ function gi(t) {
|
|
|
3714
3715
|
let u = !0;
|
|
3715
3716
|
for (let f = 0; f < a.group.length; f++) {
|
|
3716
3717
|
const p = a.group[f];
|
|
3717
|
-
let d, m = null,
|
|
3718
|
+
let d, m = null, $ = null;
|
|
3718
3719
|
if (p.variable)
|
|
3719
|
-
|
|
3720
|
+
$ = this.fc.getLoadData(p.variable);
|
|
3720
3721
|
else if (p.field)
|
|
3721
3722
|
m = pt(p.field || "");
|
|
3722
3723
|
else if (!p.mode)
|
|
3723
3724
|
return !0;
|
|
3724
|
-
let
|
|
3725
|
-
if (
|
|
3725
|
+
let v = p.compare;
|
|
3726
|
+
if (v && (v = pt(v || "")), p.mode ? d = n(p) : he[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" : m}, ${v || "$val"}); }}}}`).call(this.api.form, he, $, 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)
|
|
3726
3727
|
return !0;
|
|
3727
3728
|
l || (u = u && d);
|
|
3728
3729
|
}
|
|
@@ -3802,8 +3803,8 @@ function yi(t) {
|
|
|
3802
3803
|
targetHook(e, r, i) {
|
|
3803
3804
|
var l, u, f, p;
|
|
3804
3805
|
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d, m) => {
|
|
3805
|
-
d && (d = Array.isArray(d) ? d : [d], d.forEach((
|
|
3806
|
-
O(() =>
|
|
3806
|
+
d && (d = Array.isArray(d) ? d : [d], d.forEach(($) => {
|
|
3807
|
+
O(() => $(q(_({
|
|
3807
3808
|
args: Object.values(i || {})
|
|
3808
3809
|
}, i || {}), {
|
|
3809
3810
|
self: e.rule,
|
|
@@ -3883,7 +3884,7 @@ function $i(t) {
|
|
|
3883
3884
|
},
|
|
3884
3885
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3885
3886
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3886
|
-
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u),
|
|
3887
|
+
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), _({}, r.effect || {}));
|
|
3887
3888
|
Object.keys(l).forEach((u) => {
|
|
3888
3889
|
const f = this.providers[u];
|
|
3889
3890
|
if (!f || f.input && !i) return;
|
|
@@ -3894,7 +3895,7 @@ function $i(t) {
|
|
|
3894
3895
|
p = s;
|
|
3895
3896
|
else
|
|
3896
3897
|
return;
|
|
3897
|
-
const d =
|
|
3898
|
+
const d = _({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3898
3899
|
e && (d.getProp = () => e.effectData(u), d.clearProp = () => e.clearEffectData(u), d.mergeProp = (m) => ee(d.getProp(), [m]), d.id = e.id), this.bus.$emit(`p:${u}:${p}:${f.input ? 1 : 0}`, o, [d, r, this.api]);
|
|
3899
3900
|
});
|
|
3900
3901
|
}
|
|
@@ -3966,7 +3967,7 @@ C(X.prototype, {
|
|
|
3966
3967
|
this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
|
|
3967
3968
|
},
|
|
3968
3969
|
updateAppendData() {
|
|
3969
|
-
this.appendData =
|
|
3970
|
+
this.appendData = _(_(_({}, this.options.formData || {}), this.fc.vm.$props.value || {}), this.appendData);
|
|
3970
3971
|
},
|
|
3971
3972
|
isBreakWatch() {
|
|
3972
3973
|
return this.loading || this.noWatchFn || this.reloading;
|
|
@@ -4134,8 +4135,8 @@ const Fi = function(t) {
|
|
|
4134
4135
|
i && i.__fc__ && (d = i.__fc__.getParentGroup());
|
|
4135
4136
|
let m;
|
|
4136
4137
|
a.template ? m = t.$handle.loadStrVar(a.template, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null) : a.handler && h.Function(a.handler) ? m = a.handler(p, i, s) : m = t.$handle.loadStrVar(`{{${a.attr}}}`, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null), (m == null || m === "") && a.default != null && (m = a.default), a.copy !== !1 && (m = K(m));
|
|
4137
|
-
const
|
|
4138
|
-
a.to === "child" ?
|
|
4138
|
+
const $ = a.modify ? i : r.getProp();
|
|
4139
|
+
a.to === "child" ? $.children ? k($.children, 0, m) : k($, "children", [m]) : oe($, a.to || "options", m), s.sync(i);
|
|
4139
4140
|
}, u = (p) => l(p);
|
|
4140
4141
|
const f = t.watchLoadData(u);
|
|
4141
4142
|
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
@@ -4163,9 +4164,9 @@ const Fi = function(t) {
|
|
|
4163
4164
|
if (l) {
|
|
4164
4165
|
const u = typeof l == "object";
|
|
4165
4166
|
let f = (m) => {
|
|
4166
|
-
let
|
|
4167
|
-
const
|
|
4168
|
-
a === "child" ?
|
|
4167
|
+
let $ = t.t(u ? l.attr : l, u ? l.params : null, m);
|
|
4168
|
+
const v = u && l.modify ? i : r.getProp();
|
|
4169
|
+
a === "child" ? v.children ? k(v.children, 0, $) : k(v, "children", [$]) : oe(v, a, $), s.sync(i);
|
|
4169
4170
|
}, p = (m) => f(m);
|
|
4170
4171
|
const d = t.watchLoadData(p);
|
|
4171
4172
|
f = se(f, l.wait || 300), l.watch !== !1 ? o.push(d) : d();
|
|
@@ -4187,7 +4188,7 @@ const Fi = function(t) {
|
|
|
4187
4188
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4188
4189
|
else {
|
|
4189
4190
|
h.Object(i) || (i = { method: i });
|
|
4190
|
-
const s = i.method, n = q(
|
|
4191
|
+
const s = i.method, n = q(_({}, i), {
|
|
4191
4192
|
validator(...o) {
|
|
4192
4193
|
const a = Q(e);
|
|
4193
4194
|
if (a)
|
|
@@ -4231,7 +4232,7 @@ const Fi = function(t) {
|
|
|
4231
4232
|
l(p.data);
|
|
4232
4233
|
return;
|
|
4233
4234
|
} else
|
|
4234
|
-
a =
|
|
4235
|
+
a = _(_({}, a), p);
|
|
4235
4236
|
}
|
|
4236
4237
|
const u = a.onError, f = () => {
|
|
4237
4238
|
if (!s.getValue())
|
|
@@ -4240,32 +4241,32 @@ const Fi = function(t) {
|
|
|
4240
4241
|
i._fn[s.id] = t.watchLoadData(se((p, d) => {
|
|
4241
4242
|
if (d && a.watch === !1)
|
|
4242
4243
|
return i._fn[s.id]();
|
|
4243
|
-
const m = t.$handle.loadFetchVar(K(a), p, n),
|
|
4244
|
+
const m = t.$handle.loadFetchVar(K(a), p, n), $ = q(_({
|
|
4244
4245
|
headers: {}
|
|
4245
4246
|
}, m), {
|
|
4246
|
-
onSuccess(
|
|
4247
|
+
onSuccess(v, F) {
|
|
4247
4248
|
if (f()) return;
|
|
4248
4249
|
let J = (L) => F ? L : j(L, "data") ? L.data : L;
|
|
4249
4250
|
const A = x(m.parse);
|
|
4250
|
-
h.Function(A) ? J = A : A && h.String(A) && (J = (L) => B(L, A)), Ae(J(
|
|
4251
|
+
h.Function(A) ? J = A : A && h.String(A) && (J = (L) => B(L, A)), Ae(J(v, n, o)).then((L) => {
|
|
4251
4252
|
l(L);
|
|
4252
4253
|
});
|
|
4253
4254
|
},
|
|
4254
|
-
onError(
|
|
4255
|
-
l(void 0), !f() && (u || ((F) => Ye(F.message || "fetch fail " + m.action)))(
|
|
4255
|
+
onError(v) {
|
|
4256
|
+
l(void 0), !f() && (u || ((F) => Ye(F.message || "fetch fail " + m.action)))(v, n, o);
|
|
4256
4257
|
}
|
|
4257
4258
|
});
|
|
4258
|
-
t.$handle.beforeFetch(
|
|
4259
|
+
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
4259
4260
|
if (h.Function(m.action)) {
|
|
4260
|
-
Ae(m.action(n, o)).then((
|
|
4261
|
-
|
|
4262
|
-
}).catch((
|
|
4263
|
-
|
|
4261
|
+
Ae(m.action(n, o)).then((v) => {
|
|
4262
|
+
$.onSuccess(v, !0);
|
|
4263
|
+
}).catch((v) => {
|
|
4264
|
+
$.onError(v);
|
|
4264
4265
|
});
|
|
4265
4266
|
return;
|
|
4266
4267
|
}
|
|
4267
|
-
O(() => t.create.fetch(
|
|
4268
|
-
}).catch((
|
|
4268
|
+
O(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
4269
|
+
}).catch((v) => {
|
|
4269
4270
|
});
|
|
4270
4271
|
}, a.wait || 600));
|
|
4271
4272
|
}
|
|
@@ -4459,16 +4460,16 @@ function Wt(t) {
|
|
|
4459
4460
|
[Ne.name]: Ne
|
|
4460
4461
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4461
4462
|
t.extendApi
|
|
4462
|
-
], u =
|
|
4463
|
+
], u = _({}, Ri), f = Yr();
|
|
4463
4464
|
let p = { global: {} };
|
|
4464
4465
|
const d = t.isMobile === !0, m = ne({
|
|
4465
4466
|
$mobile: d
|
|
4466
|
-
}),
|
|
4467
|
+
}), $ = wi(), v = {}, F = {};
|
|
4467
4468
|
Ui(t.attrs || {});
|
|
4468
4469
|
function J(c) {
|
|
4469
4470
|
const g = U[c];
|
|
4470
4471
|
if (Array.isArray(g))
|
|
4471
|
-
return g.map((
|
|
4472
|
+
return g.map((y) => y.api());
|
|
4472
4473
|
if (g)
|
|
4473
4474
|
return g.api();
|
|
4474
4475
|
}
|
|
@@ -4481,12 +4482,12 @@ function Wt(t) {
|
|
|
4481
4482
|
}
|
|
4482
4483
|
function pe() {
|
|
4483
4484
|
const c = Me(...arguments);
|
|
4484
|
-
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(
|
|
4485
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(_({}, c.prop), {
|
|
4485
4486
|
name: c.id
|
|
4486
4487
|
}));
|
|
4487
4488
|
}
|
|
4488
4489
|
function Pe(c) {
|
|
4489
|
-
|
|
4490
|
+
$.use(c);
|
|
4490
4491
|
}
|
|
4491
4492
|
function me(c) {
|
|
4492
4493
|
if (arguments.length === 0)
|
|
@@ -4495,19 +4496,19 @@ function Wt(t) {
|
|
|
4495
4496
|
return r[H(c)];
|
|
4496
4497
|
const g = Me(...arguments);
|
|
4497
4498
|
if (!g.id || !g.prop) return we;
|
|
4498
|
-
const
|
|
4499
|
-
r[
|
|
4499
|
+
const y = H(g.id), b = g.prop, w = b.merge === !0 ? r[y] : void 0;
|
|
4500
|
+
r[y] = je(b, w || we), f[y] = T(y), b.maker && C(f, b.maker);
|
|
4500
4501
|
}
|
|
4501
4502
|
function E(c, g) {
|
|
4502
|
-
let
|
|
4503
|
+
let y;
|
|
4503
4504
|
if (h.String(c)) {
|
|
4504
|
-
if (
|
|
4505
|
-
return ["form-create", "formcreate"].indexOf(
|
|
4505
|
+
if (y = c, g === void 0)
|
|
4506
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? S() : e[y];
|
|
4506
4507
|
} else
|
|
4507
|
-
|
|
4508
|
-
if (
|
|
4509
|
-
const b = H(
|
|
4510
|
-
e[
|
|
4508
|
+
y = H(c.name), g = c;
|
|
4509
|
+
if (!y || !g) return;
|
|
4510
|
+
const b = H(y);
|
|
4511
|
+
e[y] = g, e[b] = g, delete $.aliasMap[y], delete $.aliasMap[b], delete r[y], delete r[b], g.formCreateParser && me(y, g.formCreateParser);
|
|
4511
4512
|
}
|
|
4512
4513
|
function S() {
|
|
4513
4514
|
return Zr(Be, e, i);
|
|
@@ -4518,14 +4519,14 @@ function Wt(t) {
|
|
|
4518
4519
|
function ge(c, g) {
|
|
4519
4520
|
return h.Function(c.install) ? c.install(W, g) : h.Function(c) && c(W, g), this;
|
|
4520
4521
|
}
|
|
4521
|
-
function W(c, g,
|
|
4522
|
+
function W(c, g, y) {
|
|
4522
4523
|
let b = qi(c, g || {});
|
|
4523
4524
|
const w = b.$refs.fc.formCreate;
|
|
4524
|
-
return w.$parent =
|
|
4525
|
+
return w.$parent = y, Mi(w.options).appendChild(b.$el), w.api();
|
|
4525
4526
|
}
|
|
4526
4527
|
je(W, F);
|
|
4527
4528
|
function xt(c) {
|
|
4528
|
-
let g =
|
|
4529
|
+
let g = _({}, t);
|
|
4529
4530
|
return c ? g.inherit = {
|
|
4530
4531
|
components: e,
|
|
4531
4532
|
parsers: r,
|
|
@@ -4534,7 +4535,7 @@ function Wt(t) {
|
|
|
4534
4535
|
providers: u,
|
|
4535
4536
|
useApps: o,
|
|
4536
4537
|
maker: f,
|
|
4537
|
-
formulas:
|
|
4538
|
+
formulas: v,
|
|
4538
4539
|
loadData: m
|
|
4539
4540
|
} : delete g.inherit, Wt(g);
|
|
4540
4541
|
}
|
|
@@ -4542,13 +4543,13 @@ function Wt(t) {
|
|
|
4542
4543
|
s[c] = g;
|
|
4543
4544
|
}
|
|
4544
4545
|
function Zt(c, g) {
|
|
4545
|
-
|
|
4546
|
+
v[c] = g;
|
|
4546
4547
|
}
|
|
4547
4548
|
function Qt(c, g) {
|
|
4548
|
-
const
|
|
4549
|
+
const y = n[c] || {}, b = y.parsers || {};
|
|
4549
4550
|
g.parsers && Object.keys(g.parsers).forEach((w) => {
|
|
4550
4551
|
b[w] = je(g.parsers[w], we);
|
|
4551
|
-
}), g.name = c, n[c] = q(
|
|
4552
|
+
}), g.name = c, n[c] = q(_(_({}, y), g), { parsers: b });
|
|
4552
4553
|
}
|
|
4553
4554
|
function ke(c) {
|
|
4554
4555
|
c && Object.keys(U).forEach((g) => {
|
|
@@ -4561,16 +4562,16 @@ function Wt(t) {
|
|
|
4561
4562
|
oe(m, c, g), ke(c);
|
|
4562
4563
|
}
|
|
4563
4564
|
function Ee(c, g) {
|
|
4564
|
-
const
|
|
4565
|
-
|
|
4565
|
+
const y = (...b) => O(() => g(...b));
|
|
4566
|
+
y._driver = !0, Te(c, y);
|
|
4566
4567
|
}
|
|
4567
4568
|
function st(c, g) {
|
|
4568
|
-
const
|
|
4569
|
-
c =
|
|
4570
|
-
const b =
|
|
4569
|
+
const y = (c || "").split(".");
|
|
4570
|
+
c = y.shift();
|
|
4571
|
+
const b = y.join(".");
|
|
4571
4572
|
if (j(m, c) || k(m, c, _t), m[c] !== _t) {
|
|
4572
4573
|
let w = m[c];
|
|
4573
|
-
return w && w._driver ? w = w(b) :
|
|
4574
|
+
return w && w._driver ? w = w(b) : y.length && (w = B(w, y)), w == null || w === "" ? g : w;
|
|
4574
4575
|
} else
|
|
4575
4576
|
return g;
|
|
4576
4577
|
}
|
|
@@ -4592,7 +4593,7 @@ function Wt(t) {
|
|
|
4592
4593
|
parsers: r,
|
|
4593
4594
|
providers: u,
|
|
4594
4595
|
modelFields: s,
|
|
4595
|
-
formulas:
|
|
4596
|
+
formulas: v,
|
|
4596
4597
|
isMobile: d,
|
|
4597
4598
|
rules: c.$props.rule,
|
|
4598
4599
|
name: c.$props.name || Ie(),
|
|
@@ -4606,7 +4607,7 @@ function Wt(t) {
|
|
|
4606
4607
|
renderDriver: null,
|
|
4607
4608
|
refreshData: ke,
|
|
4608
4609
|
loadData: m,
|
|
4609
|
-
CreateNode:
|
|
4610
|
+
CreateNode: $,
|
|
4610
4611
|
bus: new Si(),
|
|
4611
4612
|
unwatch: [],
|
|
4612
4613
|
options: gr({}),
|
|
@@ -4631,8 +4632,8 @@ function Wt(t) {
|
|
|
4631
4632
|
if (this.bus.$emit(c, ...g), this.renderDriver && this.renderDriver[c])
|
|
4632
4633
|
return O(() => this.renderDriver[c](...g));
|
|
4633
4634
|
},
|
|
4634
|
-
t(c, g,
|
|
4635
|
-
let b =
|
|
4635
|
+
t(c, g, y) {
|
|
4636
|
+
let b = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
4636
4637
|
return b == null && (b = ""), b && g && Object.keys(g).forEach((w) => {
|
|
4637
4638
|
const V = new RegExp(`{${w}}`, "g");
|
|
4638
4639
|
b = b.replace(V, g[w]);
|
|
@@ -4640,7 +4641,7 @@ function Wt(t) {
|
|
|
4640
4641
|
},
|
|
4641
4642
|
globalDataDriver(c) {
|
|
4642
4643
|
let g = c.split(".");
|
|
4643
|
-
const
|
|
4644
|
+
const y = g.shift(), b = this.options.value.globalData && this.options.value.globalData[y];
|
|
4644
4645
|
if (b) {
|
|
4645
4646
|
if (b.type === "static")
|
|
4646
4647
|
return B(b.data, g);
|
|
@@ -4656,9 +4657,9 @@ function Wt(t) {
|
|
|
4656
4657
|
const R = se(() => {
|
|
4657
4658
|
te();
|
|
4658
4659
|
const z = this.fetchCache.get(b);
|
|
4659
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (z && (z.loading = !0, this.fetchCache.set(b, z)), this.bus.$emit("$loadData.$globalData." +
|
|
4660
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (z && (z.loading = !0, this.fetchCache.set(b, z)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(b);
|
|
4660
4661
|
}, b.wait || 600), ae = (z) => {
|
|
4661
|
-
this.fetchCache.set(b, { status: !0, data: z }), this.bus.$emit("$loadData.$globalData." +
|
|
4662
|
+
this.fetchCache.set(b, { status: !0, data: z }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4662
4663
|
}, le = (z, ue) => {
|
|
4663
4664
|
if (ue && b.watch === !1)
|
|
4664
4665
|
return te();
|
|
@@ -4682,8 +4683,8 @@ function Wt(t) {
|
|
|
4682
4683
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4683
4684
|
},
|
|
4684
4685
|
globalLanguageDriver(c) {
|
|
4685
|
-
let g = this.vm.top.$props.t,
|
|
4686
|
-
if (g && (b = O(() => g(c))), b == null &&
|
|
4686
|
+
let g = this.vm.top.$props.t, y = this.vm.top.$props.locale, b;
|
|
4687
|
+
if (g && (b = O(() => g(c))), b == null && y && typeof y == "object" && (b = B(y, c)), b == null) {
|
|
4687
4688
|
const w = this.options.value.language || {}, V = this.getLocale();
|
|
4688
4689
|
b = B(w[V] || {}, c), b == null && (b = B(Li[V] || {}, c));
|
|
4689
4690
|
}
|
|
@@ -4691,7 +4692,7 @@ function Wt(t) {
|
|
|
4691
4692
|
},
|
|
4692
4693
|
globalVarDriver(c) {
|
|
4693
4694
|
let g = c.split(".");
|
|
4694
|
-
const
|
|
4695
|
+
const y = g.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4695
4696
|
if (b) {
|
|
4696
4697
|
const w = h.Function(b) ? b : x(b.handle);
|
|
4697
4698
|
if (w) {
|
|
@@ -4700,60 +4701,60 @@ function Wt(t) {
|
|
|
4700
4701
|
}
|
|
4701
4702
|
}
|
|
4702
4703
|
},
|
|
4703
|
-
setData(c, g,
|
|
4704
|
-
|
|
4704
|
+
setData(c, g, y) {
|
|
4705
|
+
y ? Te(c, g) : (oe(this.vm.top.fc.tmpData, c, g), this.bus.$emit("$loadData." + c));
|
|
4705
4706
|
},
|
|
4706
4707
|
getLoadData(c, g) {
|
|
4707
|
-
let
|
|
4708
|
+
let y = null;
|
|
4708
4709
|
if (c != null) {
|
|
4709
4710
|
let b = c.split(".");
|
|
4710
4711
|
const w = b.shift();
|
|
4711
|
-
if (
|
|
4712
|
-
return
|
|
4712
|
+
if (y = B(this.vm.top.fc.tmpData, c), y != null)
|
|
4713
|
+
return y;
|
|
4713
4714
|
if (w === "$topForm")
|
|
4714
|
-
|
|
4715
|
+
y = this.$handle.api.top.formData(!0);
|
|
4715
4716
|
else if (w === "$scopeForm")
|
|
4716
|
-
|
|
4717
|
+
y = this.$handle.api.scope.formData(!0);
|
|
4717
4718
|
else if (w === "$form")
|
|
4718
|
-
|
|
4719
|
+
y = this.$handle.api.formData(!0);
|
|
4719
4720
|
else if (w === "$options")
|
|
4720
|
-
|
|
4721
|
+
y = this.options.value;
|
|
4721
4722
|
else if (w === "$globalData")
|
|
4722
|
-
|
|
4723
|
+
y = this.globalDataDriver(b.join(".")), b = [];
|
|
4723
4724
|
else if (w === "$var")
|
|
4724
|
-
|
|
4725
|
+
y = this.globalVarDriver(b.join(".")), b = [];
|
|
4725
4726
|
else if (w === "$locale")
|
|
4726
|
-
|
|
4727
|
+
y = this.getLocale(), b = [];
|
|
4727
4728
|
else if (w === "$t")
|
|
4728
|
-
|
|
4729
|
+
y = this.globalLanguageDriver(b.join(".")), b = [];
|
|
4729
4730
|
else {
|
|
4730
4731
|
if (w === "$preview")
|
|
4731
4732
|
return this.$handle.preview;
|
|
4732
|
-
|
|
4733
|
+
y = st(c), b = [];
|
|
4733
4734
|
}
|
|
4734
|
-
|
|
4735
|
+
y && b.length && (y = B(y, b));
|
|
4735
4736
|
}
|
|
4736
|
-
return
|
|
4737
|
+
return y == null || y === "" ? g : y;
|
|
4737
4738
|
},
|
|
4738
4739
|
watchLoadData(c, g) {
|
|
4739
|
-
let
|
|
4740
|
+
let y = {};
|
|
4740
4741
|
const b = (R) => {
|
|
4741
4742
|
this.get || (this.get = w), O(() => {
|
|
4742
4743
|
c(w, R);
|
|
4743
4744
|
}), this.get === w && (this.get = void 0);
|
|
4744
4745
|
}, w = (R, ae) => {
|
|
4745
4746
|
let le;
|
|
4746
|
-
if (typeof R == "object" && (le = R.getValue, R = R.id),
|
|
4747
|
-
return
|
|
4747
|
+
if (typeof R == "object" && (le = R.getValue, R = R.id), y[R])
|
|
4748
|
+
return y[R].val;
|
|
4748
4749
|
const te = $e(() => le ? le() : this.getLoadData(R, ae)), z = R.split("."), ue = z.shift(), fe = z.shift() || "", re = se(() => {
|
|
4749
4750
|
const ce = le ? le() : this.getLoadData(R, ae);
|
|
4750
|
-
if (
|
|
4751
|
-
((ce instanceof Function || h.Object(ce) || Array.isArray(ce)) && ce ===
|
|
4751
|
+
if (y[R])
|
|
4752
|
+
((ce instanceof Function || h.Object(ce) || Array.isArray(ce)) && ce === y[R].val || JSON.stringify(ce) !== JSON.stringify(y[R].val)) && (y[R].val = ce, b(!0));
|
|
4752
4753
|
else return;
|
|
4753
4754
|
}, g || 0), ir = N(te, (ce) => {
|
|
4754
4755
|
re();
|
|
4755
4756
|
});
|
|
4756
|
-
return this.bus.$on("$loadData." + ue, re), fe && this.bus.$on("$loadData." + ue + "." + fe, re),
|
|
4757
|
+
return this.bus.$on("$loadData." + ue, re), fe && this.bus.$on("$loadData." + ue + "." + fe, re), y[R] = {
|
|
4757
4758
|
fn: () => {
|
|
4758
4759
|
this.bus.$off("$loadData." + ue, re), fe && this.bus.$off("$loadData." + ue + "." + fe, re), ir();
|
|
4759
4760
|
},
|
|
@@ -4762,7 +4763,7 @@ function Wt(t) {
|
|
|
4762
4763
|
};
|
|
4763
4764
|
b(!1);
|
|
4764
4765
|
const V = () => {
|
|
4765
|
-
Object.keys(
|
|
4766
|
+
Object.keys(y).forEach((R) => y[R].fn()), y = {};
|
|
4766
4767
|
};
|
|
4767
4768
|
return this.unwatch.push(V), V;
|
|
4768
4769
|
},
|
|
@@ -4771,7 +4772,7 @@ function Wt(t) {
|
|
|
4771
4772
|
},
|
|
4772
4773
|
initOptions() {
|
|
4773
4774
|
this.options.value = {};
|
|
4774
|
-
let c =
|
|
4775
|
+
let c = _({
|
|
4775
4776
|
formData: {},
|
|
4776
4777
|
submitBtn: {},
|
|
4777
4778
|
resetBtn: {},
|
|
@@ -4780,11 +4781,11 @@ function Wt(t) {
|
|
|
4780
4781
|
}, K(p));
|
|
4781
4782
|
const g = this.isSub();
|
|
4782
4783
|
g && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$props.option || {});
|
|
4783
|
-
const
|
|
4784
|
-
this.targetFormDriver("initOptions", c, { api:
|
|
4784
|
+
const y = this.api();
|
|
4785
|
+
this.targetFormDriver("initOptions", c, { api: y, isSubForm: g }), this.updateOptions(c);
|
|
4785
4786
|
},
|
|
4786
|
-
mergeOptions(c, g,
|
|
4787
|
-
return g =
|
|
4787
|
+
mergeOptions(c, g, y) {
|
|
4788
|
+
return g = _({}, g || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4788
4789
|
delete g[b];
|
|
4789
4790
|
}), g.global && (c.global = zr(c.global, g.global), delete g.global), this.$handle.$manager.mergeOptions([g], c), c;
|
|
4790
4791
|
},
|
|
@@ -4854,8 +4855,8 @@ function Wt(t) {
|
|
|
4854
4855
|
function rr(c) {
|
|
4855
4856
|
C(c, {
|
|
4856
4857
|
create: W,
|
|
4857
|
-
install(g,
|
|
4858
|
-
p =
|
|
4858
|
+
install(g, y) {
|
|
4859
|
+
p = _(_({}, p), y || {});
|
|
4859
4860
|
const b = `_installedFormCreate${d ? "Mobile" : ""}_${t.ui}`;
|
|
4860
4861
|
if (g[b] === !0) return;
|
|
4861
4862
|
g[b] = !0;
|
|
@@ -4870,9 +4871,9 @@ function Wt(t) {
|
|
|
4870
4871
|
}
|
|
4871
4872
|
});
|
|
4872
4873
|
}
|
|
4873
|
-
if (ot(F), rr(F), Ee("$cookie", Pi), Ee("$localStorage", Ti), Ee("$sessionStorage", Bi),
|
|
4874
|
+
if (ot(F), rr(F), Ee("$cookie", Pi), Ee("$localStorage", Ti), Ee("$sessionStorage", Bi), $.use({ fragment: "fcFragment" }), t.install && W.use(t), me(Di), t.inherit) {
|
|
4874
4875
|
const c = t.inherit;
|
|
4875
|
-
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(m, c.loadData), c.formulas && C(
|
|
4876
|
+
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(m, c.loadData), c.formulas && C(v, c.formulas);
|
|
4876
4877
|
}
|
|
4877
4878
|
const Re = S();
|
|
4878
4879
|
return je(Re, F), Object.defineProperties(Re, {
|
|
@@ -5049,7 +5050,7 @@ function sn(t, e) {
|
|
|
5049
5050
|
j(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
5050
5051
|
}
|
|
5051
5052
|
function Ge(t) {
|
|
5052
|
-
const e =
|
|
5053
|
+
const e = _({}, t);
|
|
5053
5054
|
return delete e.children, e;
|
|
5054
5055
|
}
|
|
5055
5056
|
const on = {
|
|
@@ -5102,7 +5103,7 @@ const on = {
|
|
|
5102
5103
|
update() {
|
|
5103
5104
|
const t = this.options.form;
|
|
5104
5105
|
this.rule = {
|
|
5105
|
-
props:
|
|
5106
|
+
props: _({}, t),
|
|
5106
5107
|
nativeOn: {
|
|
5107
5108
|
submit: (e) => {
|
|
5108
5109
|
e.preventDefault();
|
|
@@ -5125,7 +5126,7 @@ const on = {
|
|
|
5125
5126
|
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r) && r.wrap.title !== !1, o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: l } = this.rule.props, u = r.wrap.class;
|
|
5126
5127
|
delete r.wrap.class, delete r.wrap.title;
|
|
5127
5128
|
const f = (h.Undef(r.wrap.show) ? !t.input : Z(r.wrap.show)) ? e : this.$r(Y([r.wrap, {
|
|
5128
|
-
props: q(
|
|
5129
|
+
props: q(_({
|
|
5129
5130
|
labelWidth: o === void 0 ? o : Et(o),
|
|
5130
5131
|
label: n ? r.title.title : void 0
|
|
5131
5132
|
}, Ge(r.wrap || {})), {
|
|
@@ -5136,7 +5137,7 @@ const on = {
|
|
|
5136
5137
|
key: `${i}fi`,
|
|
5137
5138
|
ref: t.wrapRef,
|
|
5138
5139
|
type: "formItem"
|
|
5139
|
-
}]),
|
|
5140
|
+
}]), _({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
5140
5141
|
return a === !0 || Z(l) || Z(s.show) ? f : this.makeCol(r, i, [f]);
|
|
5141
5142
|
},
|
|
5142
5143
|
isTitle(t) {
|
|
@@ -5145,8 +5146,8 @@ const on = {
|
|
|
5145
5146
|
return !(!e.title && !e.native || Z(e.show));
|
|
5146
5147
|
},
|
|
5147
5148
|
makeInfo(t, e, r) {
|
|
5148
|
-
var f, p, d, m,
|
|
5149
|
-
const i =
|
|
5149
|
+
var f, p, d, m, $, v;
|
|
5150
|
+
const i = _({}, t.title), s = _({}, t.info), n = nn(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
5150
5151
|
title: (p = (f = r.refRule) == null ? void 0 : f.__$title) == null ? void 0 : p.value,
|
|
5151
5152
|
rule: r.rule,
|
|
5152
5153
|
options: this.options
|
|
@@ -5160,7 +5161,7 @@ const on = {
|
|
|
5160
5161
|
};
|
|
5161
5162
|
delete F.props.icon, delete F.props.show, delete F.props.info, delete F.props.align, delete F.props.native;
|
|
5162
5163
|
const J = "content";
|
|
5163
|
-
s.info && !j(F.props, J) && (F.props[J] = (
|
|
5164
|
+
s.info && !j(F.props, J) && (F.props[J] = (v = ($ = r.refRule) == null ? void 0 : $.__$info) == null ? void 0 : v.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(Y([s, F]), [
|
|
5164
5165
|
this.$r({
|
|
5165
5166
|
type: "i",
|
|
5166
5167
|
slot: n ? "default" : "reference",
|
|
@@ -5218,7 +5219,7 @@ const on = {
|
|
|
5218
5219
|
}, [e]);
|
|
5219
5220
|
},
|
|
5220
5221
|
makeResetBtn() {
|
|
5221
|
-
const t =
|
|
5222
|
+
const t = _({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
|
|
5222
5223
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
5223
5224
|
type: "button",
|
|
5224
5225
|
props: t,
|
|
@@ -5234,7 +5235,7 @@ const on = {
|
|
|
5234
5235
|
}, [e]);
|
|
5235
5236
|
},
|
|
5236
5237
|
makeSubmitBtn() {
|
|
5237
|
-
const t =
|
|
5238
|
+
const t = _({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
|
|
5238
5239
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
5239
5240
|
type: "button",
|
|
5240
5241
|
props: t,
|
|
@@ -5398,7 +5399,7 @@ const zt = {
|
|
|
5398
5399
|
if (i.required === !1)
|
|
5399
5400
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5400
5401
|
else {
|
|
5401
|
-
const n =
|
|
5402
|
+
const n = _({
|
|
5402
5403
|
required: !0,
|
|
5403
5404
|
validator(a, l, u) {
|
|
5404
5405
|
o(), h.empty(l) ? u(n.message) : u();
|
|
@@ -5437,7 +5438,7 @@ function pn(t) {
|
|
|
5437
5438
|
function mn() {
|
|
5438
5439
|
return Wt({
|
|
5439
5440
|
ui: "element-ui",
|
|
5440
|
-
version: "2.7.
|
|
5441
|
+
version: "2.7.24",
|
|
5441
5442
|
manager: on,
|
|
5442
5443
|
extendApi: hn,
|
|
5443
5444
|
install: pn,
|