@form-create/element-ui 2.7.24 → 2.7.26
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 +309 -274
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
- package/src/core/api.js +19 -1
- package/types/config.d.ts +2 -0
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.26
|
|
4
4
|
* (c) 2018-2026 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -126,8 +126,8 @@ const Or = "fcCheckbox", Fr = {
|
|
|
126
126
|
function G(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
name:
|
|
129
|
+
const Er = "fcFrame", kr = {
|
|
130
|
+
name: Er,
|
|
131
131
|
props: {
|
|
132
132
|
formCreateInject: {
|
|
133
133
|
type: Object,
|
|
@@ -912,7 +912,7 @@ const Pr = "fcUpload", Tr = {
|
|
|
912
912
|
}), this.$emit("fc.el", this.$refs.upload);
|
|
913
913
|
}
|
|
914
914
|
};
|
|
915
|
-
function
|
|
915
|
+
function E(t, e, r) {
|
|
916
916
|
be.set(t, e, r);
|
|
917
917
|
}
|
|
918
918
|
function ie(t, e) {
|
|
@@ -926,29 +926,29 @@ function Fe(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 &&
|
|
929
|
+
i = !1, o && E(t, s, []);
|
|
930
930
|
else if (n._clone && r !== void 0)
|
|
931
931
|
if (r)
|
|
932
|
-
n = n.getRule(), o &&
|
|
932
|
+
n = n.getRule(), o && E(t, s, {});
|
|
933
933
|
else {
|
|
934
|
-
|
|
934
|
+
E(t, s, n._clone());
|
|
935
935
|
continue;
|
|
936
936
|
}
|
|
937
937
|
else
|
|
938
|
-
o &&
|
|
938
|
+
o && E(t, s, {});
|
|
939
939
|
t[s] = Fe(t[s], n, r);
|
|
940
940
|
} else
|
|
941
|
-
|
|
941
|
+
E(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
|
}
|
|
945
|
-
function
|
|
945
|
+
function Y(t) {
|
|
946
946
|
return Fe({}, { value: t }).value;
|
|
947
947
|
}
|
|
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) &&
|
|
951
|
+
Object.prototype.hasOwnProperty.call(e, i) && E(t, i, e[i]);
|
|
952
952
|
return t;
|
|
953
953
|
};
|
|
954
954
|
function C() {
|
|
@@ -963,7 +963,7 @@ function se(t, e) {
|
|
|
963
963
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
964
964
|
};
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function kt(t) {
|
|
967
967
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
968
968
|
}
|
|
969
969
|
function Lr(t) {
|
|
@@ -988,7 +988,7 @@ function Ye(t, e) {
|
|
|
988
988
|
function Mr(t) {
|
|
989
989
|
Ye(t.toString()), console.error(t);
|
|
990
990
|
}
|
|
991
|
-
const We = "[[FORM-CREATE-PREFIX-",
|
|
991
|
+
const We = "[[FORM-CREATE-PREFIX-", xe = "-FORM-CREATE-SUFFIX]]";
|
|
992
992
|
function Oe(t, e) {
|
|
993
993
|
return JSON.stringify(Fe(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
994
994
|
if (!(i && i._isVue === !0)) {
|
|
@@ -997,7 +997,7 @@ function Oe(t, e) {
|
|
|
997
997
|
if (i.__json)
|
|
998
998
|
return i.__json;
|
|
999
999
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1000
|
-
return We + i +
|
|
1000
|
+
return We + i + xe;
|
|
1001
1001
|
}
|
|
1002
1002
|
}, e);
|
|
1003
1003
|
}
|
|
@@ -1008,8 +1008,8 @@ function x(t, e) {
|
|
|
1008
1008
|
if (t && h.String(t) && t.length > 4) {
|
|
1009
1009
|
let r = t.trim(), i = !1;
|
|
1010
1010
|
try {
|
|
1011
|
-
if (r.indexOf(
|
|
1012
|
-
r = r.replace(
|
|
1011
|
+
if (r.indexOf(xe) > 0 && r.indexOf(We) === 0)
|
|
1012
|
+
r = r.replace(xe, "").replace(We, ""), i = !0;
|
|
1013
1013
|
else if (r.indexOf("$FN:") === 0)
|
|
1014
1014
|
r = r.substring(4), i = !0;
|
|
1015
1015
|
else if (r.indexOf("$EXEC:") === 0)
|
|
@@ -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") &&
|
|
1062
|
-
}),
|
|
1061
|
+
s && ((!i[s] || typeof i[s] != "object") && E(i, s, {}), i = i[s]), s = n;
|
|
1062
|
+
}), E(i, s, r), i;
|
|
1063
1063
|
}
|
|
1064
1064
|
const Ur = "fcGroup", Hr = {
|
|
1065
1065
|
name: Ur,
|
|
@@ -1149,7 +1149,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1149
1149
|
const n = i.$f.formData();
|
|
1150
1150
|
i.$f.once("reloading", () => {
|
|
1151
1151
|
i.$f.setValue(n);
|
|
1152
|
-
}), i.rule =
|
|
1152
|
+
}), i.rule = Y(t);
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
1155
|
});
|
|
@@ -1214,7 +1214,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1214
1214
|
};
|
|
1215
1215
|
if (this.defaultValue) {
|
|
1216
1216
|
i.formData || (i.formData = {});
|
|
1217
|
-
const s =
|
|
1217
|
+
const s = Y(this.defaultValue);
|
|
1218
1218
|
C(i.formData, this.field ? {
|
|
1219
1219
|
[this.field]: s
|
|
1220
1220
|
} : s);
|
|
@@ -1241,7 +1241,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1241
1241
|
if (this.disabled || this.onBeforeAdd(this.value) === !1)
|
|
1242
1242
|
return;
|
|
1243
1243
|
const e = [...this.value];
|
|
1244
|
-
e.push(this.defaultValue ?
|
|
1244
|
+
e.push(this.defaultValue ? Y(this.defaultValue) : this.field ? null : {}), this.input(e);
|
|
1245
1245
|
},
|
|
1246
1246
|
del(t, e) {
|
|
1247
1247
|
if (this.disabled)
|
|
@@ -1345,9 +1345,9 @@ const Ur = "fcGroup", Hr = {
|
|
|
1345
1345
|
key: o
|
|
1346
1346
|
}, {
|
|
1347
1347
|
on: {
|
|
1348
|
-
"update:value": (
|
|
1349
|
-
"emit-event": (
|
|
1350
|
-
input: (
|
|
1348
|
+
"update:value": (d) => this.formData(o, d),
|
|
1349
|
+
"emit-event": (d, ...p) => this.emitEvent(d, p, a, o),
|
|
1350
|
+
input: (d) => this.add$f(a, o, d)
|
|
1351
1351
|
}
|
|
1352
1352
|
}, {}, {
|
|
1353
1353
|
props: {
|
|
@@ -1457,30 +1457,30 @@ const Ur = "fcGroup", Hr = {
|
|
|
1457
1457
|
}
|
|
1458
1458
|
}, Kr = [
|
|
1459
1459
|
Fr,
|
|
1460
|
-
|
|
1460
|
+
kr,
|
|
1461
1461
|
Sr,
|
|
1462
1462
|
Dr,
|
|
1463
1463
|
Ar,
|
|
1464
1464
|
Tr,
|
|
1465
1465
|
Hr,
|
|
1466
1466
|
Jr
|
|
1467
|
-
], jt = ["attrs", "props", "domProps", "scopedSlots"], Dt = ["class", "style", "directives"], Vt = ["on", "nativeOn", "hook"],
|
|
1467
|
+
], jt = ["attrs", "props", "domProps", "scopedSlots"], Dt = ["class", "style", "directives"], Vt = ["on", "nativeOn", "hook"], Q = (t, e = {}, r = {}) => {
|
|
1468
1468
|
const i = [...jt, ...r.normal || []], s = [...Dt, ...r.array || []], n = [...Vt, ...r.functional || []], o = r.props || [];
|
|
1469
1469
|
return t.reduce((a, l) => {
|
|
1470
1470
|
for (const u in l)
|
|
1471
1471
|
if (a[u])
|
|
1472
1472
|
if (o.indexOf(u) > -1)
|
|
1473
|
-
a[u] =
|
|
1473
|
+
a[u] = Q([l[u]], a[u]);
|
|
1474
1474
|
else if (i.indexOf(u) > -1)
|
|
1475
1475
|
a[u] = _(_({}, a[u]), l[u]);
|
|
1476
1476
|
else if (s.indexOf(u) > -1) {
|
|
1477
|
-
const f = a[u] instanceof Array ? a[u] : [a[u]],
|
|
1478
|
-
a[u] = [...f, ...
|
|
1477
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1478
|
+
a[u] = [...f, ...d];
|
|
1479
1479
|
} else if (n.indexOf(u) > -1)
|
|
1480
1480
|
for (const f in l[u])
|
|
1481
1481
|
if (a[u][f]) {
|
|
1482
|
-
const
|
|
1483
|
-
a[u][f] = [...
|
|
1482
|
+
const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], p = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1483
|
+
a[u][f] = [...d, ...p];
|
|
1484
1484
|
} else
|
|
1485
1485
|
a[u][f] = l[u][f];
|
|
1486
1486
|
else if (u === "hook")
|
|
@@ -1498,7 +1498,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1498
1498
|
function It() {
|
|
1499
1499
|
return [...At, ...jt, ...Dt, ...Vt, ...et, ...tt];
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1501
|
+
function ze(t, e) {
|
|
1502
1502
|
return {
|
|
1503
1503
|
value: t,
|
|
1504
1504
|
enumerable: !1,
|
|
@@ -1513,13 +1513,13 @@ function Tt(t, e) {
|
|
|
1513
1513
|
return Fe([], [...t], e || !1);
|
|
1514
1514
|
}
|
|
1515
1515
|
function ee(t, e) {
|
|
1516
|
-
return
|
|
1516
|
+
return Q(Array.isArray(e) ? e : [e], t, { array: et, normal: tt }), t;
|
|
1517
1517
|
}
|
|
1518
1518
|
function ht(t) {
|
|
1519
1519
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1520
1520
|
return e.type || (e.type = "input"), e;
|
|
1521
1521
|
}
|
|
1522
|
-
function
|
|
1522
|
+
function xr(t, e) {
|
|
1523
1523
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1524
1524
|
e[r] && (t[r] = ee(t[r] || {}, e[r]));
|
|
1525
1525
|
}), t) : e;
|
|
@@ -1531,7 +1531,7 @@ function Bt(t, e) {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
}, r), {}));
|
|
1533
1533
|
}
|
|
1534
|
-
function
|
|
1534
|
+
function Z(t) {
|
|
1535
1535
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1536
1536
|
}
|
|
1537
1537
|
function O(t, e) {
|
|
@@ -1550,7 +1550,7 @@ function Xe(t, e) {
|
|
|
1550
1550
|
});
|
|
1551
1551
|
}), r;
|
|
1552
1552
|
}
|
|
1553
|
-
function
|
|
1553
|
+
function zr(t, e) {
|
|
1554
1554
|
if (h.Object(t)) {
|
|
1555
1555
|
const r = {};
|
|
1556
1556
|
return Object.keys(t).forEach((i) => {
|
|
@@ -1575,7 +1575,7 @@ function Se() {
|
|
|
1575
1575
|
const n = s();
|
|
1576
1576
|
Array.isArray(n) ? i.push(...n) : i.push(n);
|
|
1577
1577
|
} else h.Undef(s) || i.push(s);
|
|
1578
|
-
}),
|
|
1578
|
+
}), zr(i, r);
|
|
1579
1579
|
},
|
|
1580
1580
|
getSlots() {
|
|
1581
1581
|
let r = [];
|
|
@@ -1733,41 +1733,41 @@ function Zr(t, e, r) {
|
|
|
1733
1733
|
a = a.parent;
|
|
1734
1734
|
else
|
|
1735
1735
|
a = n;
|
|
1736
|
-
const { rule: l, value: u, subForm: f, inFor:
|
|
1736
|
+
const { rule: l, value: u, subForm: f, inFor: d } = ut(s), p = ne({
|
|
1737
1737
|
ctxInject: {},
|
|
1738
1738
|
destroyed: !1,
|
|
1739
1739
|
isShow: !0,
|
|
1740
1740
|
unique: 1,
|
|
1741
1741
|
renderRule: [...l.value || []],
|
|
1742
1742
|
updateValue: JSON.stringify(u.value || {})
|
|
1743
|
-
}), m = new t(n), $ = m.api(), v =
|
|
1743
|
+
}), m = new t(n), $ = m.api(), v = d.value, F = () => {
|
|
1744
1744
|
if (o) {
|
|
1745
|
-
const
|
|
1746
|
-
if (
|
|
1745
|
+
const k = De(n, o);
|
|
1746
|
+
if (k) {
|
|
1747
1747
|
let S;
|
|
1748
|
-
v ? (S = G(
|
|
1748
|
+
v ? (S = G(k.getSubForm()), S.push($)) : S = $, k.subForm(S);
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
1751
|
}, J = () => {
|
|
1752
|
-
const
|
|
1753
|
-
if (
|
|
1752
|
+
const k = De(n, o);
|
|
1753
|
+
if (k)
|
|
1754
1754
|
if (v) {
|
|
1755
|
-
const S = G(
|
|
1755
|
+
const S = G(k.getSubForm()), M = S.indexOf($);
|
|
1756
1756
|
M > -1 && S.splice(M, 1);
|
|
1757
1757
|
} else
|
|
1758
|
-
|
|
1758
|
+
k.subForm();
|
|
1759
1759
|
};
|
|
1760
1760
|
let A = null;
|
|
1761
1761
|
hr(() => {
|
|
1762
1762
|
N(() => {
|
|
1763
|
-
let
|
|
1763
|
+
let k = "";
|
|
1764
1764
|
const S = s.option && s.option.globalClass || {};
|
|
1765
1765
|
Object.keys(S).forEach((M) => {
|
|
1766
1766
|
let ge = "";
|
|
1767
|
-
S[M].style && Object.keys(S[M].style).forEach((
|
|
1768
|
-
ge += ve(
|
|
1769
|
-
}), S[M].content && (ge += S[M].content + ";"), ge && (
|
|
1770
|
-
}), s.option && s.option.style && (
|
|
1767
|
+
S[M].style && Object.keys(S[M].style).forEach((K) => {
|
|
1768
|
+
ge += ve(K) + ":" + S[M].style[K] + ";";
|
|
1769
|
+
}), S[M].content && (ge += S[M].content + ";"), ge && (k += `.${M}{${ge}}`);
|
|
1770
|
+
}), s.option && s.option.style && (k += s.option.style), A || (A = document.createElement("style"), A.type = "text/css", document.head.appendChild(A)), A.innerHTML = k || "";
|
|
1771
1771
|
}, () => {
|
|
1772
1772
|
});
|
|
1773
1773
|
});
|
|
@@ -1777,25 +1777,25 @@ function Zr(t, e, r) {
|
|
|
1777
1777
|
m.bus.$emit("$loadData.$scopeForm");
|
|
1778
1778
|
}, 100), Pe = se(() => {
|
|
1779
1779
|
m.bus.$emit("$loadData.$form");
|
|
1780
|
-
}, 100), me = (
|
|
1781
|
-
m.bus.$emit("change-$form." +
|
|
1780
|
+
}, 100), me = (k) => {
|
|
1781
|
+
m.bus.$emit("change-$form." + k);
|
|
1782
1782
|
};
|
|
1783
1783
|
return dr(() => {
|
|
1784
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 && ($.top.bus.$off("$loadData.$form", L), $.top.bus.$off("change", me)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", pe), J(),
|
|
1786
|
+
o && ($.top.bus.$off("$loadData.$form", L), $.top.bus.$off("change", me)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", pe), J(), p.destroyed = !0, m.unmount(), A && (A.parentNode || A.parentElement) && document.head.removeChild(A);
|
|
1787
1787
|
}), mr(() => {
|
|
1788
1788
|
m.updated();
|
|
1789
|
-
}), N(f, (
|
|
1790
|
-
|
|
1789
|
+
}), N(f, (k) => {
|
|
1790
|
+
k ? F() : J();
|
|
1791
1791
|
}, { immediate: !0 }), N(() => s.option, () => {
|
|
1792
1792
|
m.initOptions(), $.refresh();
|
|
1793
|
-
}, { deep: !0, flush: "sync" }), N(() => [...l.value], (
|
|
1794
|
-
m.$handle.isBreakWatch() ||
|
|
1793
|
+
}, { deep: !0, flush: "sync" }), N(() => [...l.value], (k) => {
|
|
1794
|
+
m.$handle.isBreakWatch() || k.length === p.renderRule.length && k.every((S) => p.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
|
-
}), N(u, (
|
|
1798
|
-
Oe(
|
|
1797
|
+
}), N(u, (k) => {
|
|
1798
|
+
Oe(k || {}) !== p.updateValue && ($.config.forceCoverValue ? $.coverValue(k || {}) : $.setValue(k || {}));
|
|
1799
1799
|
}, { deep: !0, flush: "post" }), N(() => s.index, () => {
|
|
1800
1800
|
$.coverValue({}), m.$handle.updateAppendData(), P(() => {
|
|
1801
1801
|
P(() => {
|
|
@@ -1807,18 +1807,18 @@ function Zr(t, e, r) {
|
|
|
1807
1807
|
parent: o && ye(o),
|
|
1808
1808
|
top: ye(a),
|
|
1809
1809
|
fapi: ye($)
|
|
1810
|
-
}, ut(
|
|
1810
|
+
}, ut(p)), {
|
|
1811
1811
|
getGroupInject: () => De(n, o),
|
|
1812
1812
|
refresh() {
|
|
1813
|
-
++
|
|
1813
|
+
++p.unique;
|
|
1814
1814
|
},
|
|
1815
1815
|
renderRule() {
|
|
1816
|
-
|
|
1816
|
+
p.renderRule = [...l.value || []];
|
|
1817
1817
|
},
|
|
1818
|
-
updateValue(
|
|
1819
|
-
if (
|
|
1820
|
-
const S = Oe(
|
|
1821
|
-
|
|
1818
|
+
updateValue(k) {
|
|
1819
|
+
if (p.destroyed) return;
|
|
1820
|
+
const S = Oe(k);
|
|
1821
|
+
p.updateValue !== S && (p.updateValue = S, n.$emit("update:value", k), P(() => {
|
|
1822
1822
|
Pe(), o ? f.value || pe() : (L(), pe());
|
|
1823
1823
|
}));
|
|
1824
1824
|
}
|
|
@@ -1855,7 +1855,7 @@ C(rt.prototype, {
|
|
|
1855
1855
|
return this._data;
|
|
1856
1856
|
},
|
|
1857
1857
|
setProp(t, e) {
|
|
1858
|
-
return
|
|
1858
|
+
return E(this._data, t, e), this;
|
|
1859
1859
|
},
|
|
1860
1860
|
_clone() {
|
|
1861
1861
|
const t = new this.constructor();
|
|
@@ -1945,7 +1945,7 @@ function yt(t, e, r) {
|
|
|
1945
1945
|
});
|
|
1946
1946
|
}
|
|
1947
1947
|
function _e(t) {
|
|
1948
|
-
return
|
|
1948
|
+
return Y(t);
|
|
1949
1949
|
}
|
|
1950
1950
|
function ti(t) {
|
|
1951
1951
|
function e(n) {
|
|
@@ -1955,7 +1955,7 @@ function ti(t) {
|
|
|
1955
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
|
+
E(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
|
-
|
|
2051
|
+
E(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
|
-
|
|
2064
|
+
E(u.rule, "value", o[a]);
|
|
2065
2065
|
});
|
|
2066
2066
|
});
|
|
2067
2067
|
}, !0);
|
|
@@ -2075,7 +2075,7 @@ function ti(t) {
|
|
|
2075
2075
|
}, !0), o ? o.origin : void 0;
|
|
2076
2076
|
},
|
|
2077
2077
|
removeRule(n) {
|
|
2078
|
-
const o = n &&
|
|
2078
|
+
const o = n && Z(n);
|
|
2079
2079
|
if (o)
|
|
2080
2080
|
return o.rm(), o.origin;
|
|
2081
2081
|
},
|
|
@@ -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
|
-
|
|
2128
|
+
E(l.rule.props, "disabled", !!n);
|
|
2129
2129
|
});
|
|
2130
2130
|
}), t.refresh();
|
|
2131
2131
|
},
|
|
@@ -2164,7 +2164,7 @@ function ti(t) {
|
|
|
2164
2164
|
n.forEach((a) => s.sync(a));
|
|
2165
2165
|
return;
|
|
2166
2166
|
}
|
|
2167
|
-
let o = h.Object(n) ?
|
|
2167
|
+
let o = h.Object(n) ? Z(n) : t.getCtxs(n);
|
|
2168
2168
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2169
2169
|
if (!a.deleted) {
|
|
2170
2170
|
const l = t.subForm[a.id];
|
|
@@ -2183,7 +2183,7 @@ function ti(t) {
|
|
|
2183
2183
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2184
2184
|
},
|
|
2185
2185
|
hideForm: (n) => {
|
|
2186
|
-
|
|
2186
|
+
E(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) &&
|
|
2245
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), j(l.rule, "$" + o) && E(l.rule, "$" + o, a), j(l.rule, "effect") || E(l.rule, "effect", {}), E(l.rule.effect, o, a));
|
|
2246
2246
|
},
|
|
2247
2247
|
clearEffectData(n, o) {
|
|
2248
2248
|
const a = t.getCtx(n);
|
|
@@ -2292,6 +2292,26 @@ function ti(t) {
|
|
|
2292
2292
|
const o = t.getCtx(n);
|
|
2293
2293
|
if (o) return o.exportEl || o.el || t.vm.$refs[o.ref];
|
|
2294
2294
|
},
|
|
2295
|
+
scrollTo(n, o = { block: "center", inline: "nearest", behavior: "smooth" }) {
|
|
2296
|
+
const a = s.el(n);
|
|
2297
|
+
if (!a) return;
|
|
2298
|
+
const l = a.$el !== void 0 ? a.$el : a;
|
|
2299
|
+
if (!l) return;
|
|
2300
|
+
const u = l.nodeType === 1 ? l : l.firstElementChild;
|
|
2301
|
+
u && typeof u.scrollIntoView == "function" && u.scrollIntoView(o);
|
|
2302
|
+
},
|
|
2303
|
+
focus(n) {
|
|
2304
|
+
const o = s.el(n);
|
|
2305
|
+
if (!o) return;
|
|
2306
|
+
const a = (d) => !d || typeof d.focus != "function" ? !1 : (O(() => d.focus()), !0);
|
|
2307
|
+
if (a(o)) return;
|
|
2308
|
+
const l = o.$el !== void 0 ? o.$el : o;
|
|
2309
|
+
if (a(l)) return;
|
|
2310
|
+
const u = l && (l.nodeType === 1 ? l : l.firstElementChild);
|
|
2311
|
+
if (a(u) || !u || !u.querySelector) return;
|
|
2312
|
+
const f = u.querySelector('input:not([type=hidden]):not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])');
|
|
2313
|
+
a(f);
|
|
2314
|
+
},
|
|
2295
2315
|
closeModal: (n) => {
|
|
2296
2316
|
const o = s.el(n);
|
|
2297
2317
|
o && o.$emit && o.$emit("close-modal");
|
|
@@ -2301,21 +2321,21 @@ function ti(t) {
|
|
|
2301
2321
|
return o ? t.subForm[o.id] : void 0;
|
|
2302
2322
|
},
|
|
2303
2323
|
getChildrenRuleList(n) {
|
|
2304
|
-
const o = typeof n == "object", a = o ?
|
|
2324
|
+
const o = typeof n == "object", a = o ? Z(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2305
2325
|
if (!l)
|
|
2306
2326
|
return [];
|
|
2307
2327
|
const u = [];
|
|
2308
|
-
return ((
|
|
2309
|
-
|
|
2310
|
-
typeof
|
|
2328
|
+
return ((d) => {
|
|
2329
|
+
d && d.forEach((p) => {
|
|
2330
|
+
typeof p == "object" && (p.field && u.push(p), u.push(...s.getChildrenRuleList(p)));
|
|
2311
2331
|
});
|
|
2312
2332
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2313
2333
|
},
|
|
2314
2334
|
getParentRule(n) {
|
|
2315
|
-
return (typeof n == "object" ?
|
|
2335
|
+
return (typeof n == "object" ? Z(n) : t.getCtx(n)).parent.rule;
|
|
2316
2336
|
},
|
|
2317
2337
|
getParentSubRule(n) {
|
|
2318
|
-
const a = typeof n == "object" ?
|
|
2338
|
+
const a = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2319
2339
|
if (a) {
|
|
2320
2340
|
const l = a.getParentGroup();
|
|
2321
2341
|
if (l)
|
|
@@ -2329,7 +2349,7 @@ function ti(t) {
|
|
|
2329
2349
|
const l = s.getChildrenRuleList(n);
|
|
2330
2350
|
t.deferSyncValue(() => {
|
|
2331
2351
|
l.forEach((u) => {
|
|
2332
|
-
j(o, u.field) ?
|
|
2352
|
+
j(o, u.field) ? E(u, "value", o[u.field]) : a && E(u, "value", void 0);
|
|
2333
2353
|
});
|
|
2334
2354
|
});
|
|
2335
2355
|
},
|
|
@@ -2360,11 +2380,11 @@ function ti(t) {
|
|
|
2360
2380
|
s.setData("$var." + n, o);
|
|
2361
2381
|
},
|
|
2362
2382
|
renderRule(n, o, a) {
|
|
2363
|
-
const u = typeof n == "object" ?
|
|
2383
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2364
2384
|
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2365
2385
|
},
|
|
2366
2386
|
renderChildren(n, o, a) {
|
|
2367
|
-
const u = typeof n == "object" ?
|
|
2387
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2368
2388
|
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2369
2389
|
},
|
|
2370
2390
|
nextTick(n) {
|
|
@@ -2386,32 +2406,33 @@ function ti(t) {
|
|
|
2386
2406
|
},
|
|
2387
2407
|
fetch(n) {
|
|
2388
2408
|
return new Promise((o, a) => {
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2409
|
+
let l = _({}, n);
|
|
2410
|
+
l = t.loadFetchVar(l);
|
|
2411
|
+
const u = (f) => {
|
|
2412
|
+
O(() => l.onError && l.onError(f)), a(f);
|
|
2392
2413
|
};
|
|
2393
|
-
t.beforeFetch(
|
|
2394
|
-
O(() =>
|
|
2395
|
-
}).catch((
|
|
2396
|
-
|
|
2397
|
-
})).catch((
|
|
2398
|
-
|
|
2414
|
+
t.beforeFetch(l).then(() => yt(l, t.fc.create.fetch, s).then((f) => {
|
|
2415
|
+
O(() => l.onSuccess && l.onSuccess(f)), o(f);
|
|
2416
|
+
}).catch((f) => {
|
|
2417
|
+
u(f);
|
|
2418
|
+
})).catch((f) => {
|
|
2419
|
+
u(f);
|
|
2399
2420
|
});
|
|
2400
2421
|
});
|
|
2401
2422
|
},
|
|
2402
2423
|
watchFetch(n, o, a, l) {
|
|
2403
2424
|
return t.fc.watchLoadData((u, f) => {
|
|
2404
|
-
let
|
|
2405
|
-
|
|
2406
|
-
const
|
|
2407
|
-
O(() =>
|
|
2425
|
+
let d = _({}, n);
|
|
2426
|
+
d = t.loadFetchVar(d, u);
|
|
2427
|
+
const p = (m) => {
|
|
2428
|
+
O(() => d.onError && d.onError(m)), a && a(m);
|
|
2408
2429
|
};
|
|
2409
|
-
l && l(
|
|
2410
|
-
O(() =>
|
|
2430
|
+
l && l(d, f) === !1 || t.beforeFetch(d).then(() => yt(d, t.fc.create.fetch, s).then((m) => {
|
|
2431
|
+
O(() => d.onSuccess && d.onSuccess(m)), o && o(m, f);
|
|
2411
2432
|
}).catch((m) => {
|
|
2412
|
-
|
|
2433
|
+
p(m);
|
|
2413
2434
|
})).catch((m) => {
|
|
2414
|
-
|
|
2435
|
+
p(m);
|
|
2415
2436
|
});
|
|
2416
2437
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2417
2438
|
},
|
|
@@ -2564,8 +2585,8 @@ function ii(t) {
|
|
|
2564
2585
|
};
|
|
2565
2586
|
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2566
2587
|
let f = [];
|
|
2567
|
-
const
|
|
2568
|
-
e.parser.renderChildren ? f = e.parser.renderChildren(
|
|
2588
|
+
const d = e.loadChildrenPending();
|
|
2589
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach((v) => {
|
|
2569
2590
|
f.push(this.renderRule({
|
|
2570
2591
|
type: "template",
|
|
2571
2592
|
slot: v
|
|
@@ -2576,9 +2597,9 @@ function ii(t) {
|
|
|
2576
2597
|
return this.renderRule(F);
|
|
2577
2598
|
})()));
|
|
2578
2599
|
});
|
|
2579
|
-
const
|
|
2600
|
+
const p = this.getTypeSlot(e);
|
|
2580
2601
|
let m;
|
|
2581
|
-
return
|
|
2602
|
+
return p ? (u.children = f, m = p(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;
|
|
2582
2603
|
}, this.setCache(e, s, r);
|
|
2583
2604
|
}
|
|
2584
2605
|
return (...s) => {
|
|
@@ -2620,7 +2641,7 @@ function ii(t) {
|
|
|
2620
2641
|
},
|
|
2621
2642
|
injectProp(e) {
|
|
2622
2643
|
const r = this.vm;
|
|
2623
|
-
r.ctxInject[e.id] ||
|
|
2644
|
+
r.ctxInject[e.id] || E(r.ctxInject, e.id, {
|
|
2624
2645
|
api: this.$handle.api,
|
|
2625
2646
|
form: this.fc.create,
|
|
2626
2647
|
subForm: (n) => {
|
|
@@ -2651,7 +2672,7 @@ function ii(t) {
|
|
|
2651
2672
|
children: e.loadChildrenPending()
|
|
2652
2673
|
};
|
|
2653
2674
|
return Object.keys(s).forEach((n) => {
|
|
2654
|
-
|
|
2675
|
+
E(i, n, s[n]);
|
|
2655
2676
|
}), i;
|
|
2656
2677
|
},
|
|
2657
2678
|
ctxProp(e) {
|
|
@@ -2704,7 +2725,7 @@ function ii(t) {
|
|
|
2704
2725
|
}
|
|
2705
2726
|
});
|
|
2706
2727
|
}
|
|
2707
|
-
return
|
|
2728
|
+
return Q(a, e.prop), e.prop;
|
|
2708
2729
|
},
|
|
2709
2730
|
onMounted(e) {
|
|
2710
2731
|
e.el = this.vm.$refs[e.ref], e.el && ((e.el.$el || e.el).__rule__ = e.rule), e.parser.mounted(e), this.$handle.effect(e, "mounted"), this.$handle.targetHook(e, "mounted");
|
|
@@ -2820,16 +2841,16 @@ function si(t) {
|
|
|
2820
2841
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2821
2842
|
return h.trueArray(u) && u.forEach((f) => {
|
|
2822
2843
|
if (!f) return;
|
|
2823
|
-
let
|
|
2824
|
-
if (h.Object(f) && (
|
|
2825
|
-
r || (
|
|
2826
|
-
const m = ve(`${
|
|
2844
|
+
let d, p = n || o || a;
|
|
2845
|
+
if (h.Object(f) && (d = f.inject, f = f.name, p = f.prefix || p), p) {
|
|
2846
|
+
r || (p = `native-${p}`);
|
|
2847
|
+
const m = ve(`${p}-${f}`), $ = (...v) => {
|
|
2827
2848
|
this.vm.$emit(m, ...v), this.vm.$emit("emit-event", m, ...v), this.bus.$emit(m, ...v);
|
|
2828
2849
|
};
|
|
2829
|
-
if ($.__emit = !0, !
|
|
2850
|
+
if ($.__emit = !0, !d && l === !1)
|
|
2830
2851
|
i[f] = $;
|
|
2831
2852
|
else {
|
|
2832
|
-
let v =
|
|
2853
|
+
let v = d || l || this.options.injectEvent;
|
|
2833
2854
|
i[f] = h.Undef(v) ? $ : this.inject(s, $, v);
|
|
2834
2855
|
}
|
|
2835
2856
|
}
|
|
@@ -2861,32 +2882,32 @@ function si(t) {
|
|
|
2861
2882
|
loadStrVar(e, r, i) {
|
|
2862
2883
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2863
2884
|
const s = e, n = Xr(e), o = (u) => {
|
|
2864
|
-
let f = !1,
|
|
2885
|
+
let f = !1, d;
|
|
2865
2886
|
if (i && u.indexOf("$form.") === 0) {
|
|
2866
|
-
const
|
|
2867
|
-
|
|
2868
|
-
id: "$form." +
|
|
2869
|
-
getValue: () => B(i.value,
|
|
2870
|
-
}) : B(i.value,
|
|
2887
|
+
const p = u.split(".");
|
|
2888
|
+
p.shift(), j(i.value, p[0]) && (f = !0, d = r ? r({
|
|
2889
|
+
id: "$form." + p[0] + "_" + i.rule.__fc__.id,
|
|
2890
|
+
getValue: () => B(i.value, p)
|
|
2891
|
+
}) : B(i.value, p));
|
|
2871
2892
|
}
|
|
2872
|
-
return f || (
|
|
2893
|
+
return f || (d = r ? r(u) : this.fc.getLoadData(u)), d;
|
|
2873
2894
|
}, a = (u) => {
|
|
2874
2895
|
const f = [];
|
|
2875
|
-
u.forEach((
|
|
2876
|
-
|
|
2896
|
+
u.forEach((p) => {
|
|
2897
|
+
p.key ? f.push(p.key) : p.children && f.push(a(p.children));
|
|
2877
2898
|
});
|
|
2878
|
-
let
|
|
2879
|
-
return f.forEach((
|
|
2880
|
-
|
|
2881
|
-
}), f.length === 1 && (
|
|
2899
|
+
let d = !1;
|
|
2900
|
+
return f.forEach((p, m) => {
|
|
2901
|
+
p != null && (p.indexOf("'") === 0 || p.indexOf('"') === 0) && (f[m] = p.slice(1, -1), d = !0);
|
|
2902
|
+
}), f.length === 1 && (d || !isNaN(Number(f[0]))) ? f[0] : o(f.join("."));
|
|
2882
2903
|
};
|
|
2883
2904
|
let l;
|
|
2884
2905
|
if (n.forEach((u) => {
|
|
2885
|
-
const f = u.split("||"),
|
|
2886
|
-
if (
|
|
2887
|
-
const
|
|
2906
|
+
const f = u.split("||"), d = f[0].trim();
|
|
2907
|
+
if (d) {
|
|
2908
|
+
const p = (f[1] || "").trim(), m = Lt(d);
|
|
2888
2909
|
let $ = O(() => a(m));
|
|
2889
|
-
($ == null || $ === "") && f.length > 1 && ($ =
|
|
2910
|
+
($ == null || $ === "") && f.length > 1 && ($ = p), l = $, e = e.replaceAll(`{{${u}}}`, $ == null ? "" : $);
|
|
2890
2911
|
}
|
|
2891
2912
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2892
2913
|
return l;
|
|
@@ -2895,7 +2916,7 @@ function si(t) {
|
|
|
2895
2916
|
},
|
|
2896
2917
|
loadFetchVar(e, r, i) {
|
|
2897
2918
|
let s;
|
|
2898
|
-
i && i.__fc__ && (s = i.__fc__.getParentGroup());
|
|
2919
|
+
i && i.__fc__ && (s = i.__fc__.getParentGroup()), !s && e.targetRule && e.targetRule.__fc__ && (s = e.targetRule.__fc__.getParentGroup());
|
|
2899
2920
|
const n = (o) => this.loadStrVar(o, r, s ? { rule: i, value: this.subRuleData[s.id] || {} } : null);
|
|
2900
2921
|
return e.action = n(e.action || ""), ["headers", "data", "query"].forEach((o) => {
|
|
2901
2922
|
if (e[o]) {
|
|
@@ -2949,9 +2970,9 @@ function li(t) {
|
|
|
2949
2970
|
}
|
|
2950
2971
|
function ui(t) {
|
|
2951
2972
|
Object.defineProperties(t.origin, {
|
|
2952
|
-
__fc__:
|
|
2973
|
+
__fc__: ze(ye(t), !0)
|
|
2953
2974
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2954
|
-
__fc__:
|
|
2975
|
+
__fc__: ze(ye(t), !0)
|
|
2955
2976
|
});
|
|
2956
2977
|
}
|
|
2957
2978
|
function Gt(t, e, r) {
|
|
@@ -2980,7 +3001,7 @@ function Gt(t, e, r) {
|
|
|
2980
3001
|
input: s,
|
|
2981
3002
|
el: void 0,
|
|
2982
3003
|
exportEl: void 0,
|
|
2983
|
-
defaultValue: s ?
|
|
3004
|
+
defaultValue: s ? Y(r) : void 0,
|
|
2984
3005
|
field: e.field || void 0
|
|
2985
3006
|
}), this.updateKey(), ui(this), this.update(t, !0);
|
|
2986
3007
|
}
|
|
@@ -3021,8 +3042,8 @@ C(Gt.prototype, {
|
|
|
3021
3042
|
rule: this.rule,
|
|
3022
3043
|
api: this.$api,
|
|
3023
3044
|
update: (u) => {
|
|
3024
|
-
const f = u || i,
|
|
3025
|
-
this.setPending(e, r, f), o && o(f,
|
|
3045
|
+
const f = u || i, d = this.getPending(e, i);
|
|
3046
|
+
this.setPending(e, r, f), o && o(f, d);
|
|
3026
3047
|
},
|
|
3027
3048
|
reload: () => {
|
|
3028
3049
|
const u = this.getPending(e, i);
|
|
@@ -3147,7 +3168,7 @@ function fi(t) {
|
|
|
3147
3168
|
parseRule(e) {
|
|
3148
3169
|
const r = ht(e);
|
|
3149
3170
|
return Object.defineProperties(r, {
|
|
3150
|
-
__origin__:
|
|
3171
|
+
__origin__: ze(e, !0)
|
|
3151
3172
|
}), ci(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
3152
3173
|
i && this.loadFn(i, r);
|
|
3153
3174
|
}), this.loadCtrl(r), r.update && (r.update = x(r.update)), r;
|
|
@@ -3164,7 +3185,7 @@ function fi(t) {
|
|
|
3164
3185
|
},
|
|
3165
3186
|
syncProp(e) {
|
|
3166
3187
|
const r = e.rule;
|
|
3167
|
-
h.trueArray(r.sync) &&
|
|
3188
|
+
h.trueArray(r.sync) && Q([{
|
|
3168
3189
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
3169
3190
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3170
3191
|
}, i), {})
|
|
@@ -3198,8 +3219,8 @@ function fi(t) {
|
|
|
3198
3219
|
let l = ht(o);
|
|
3199
3220
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3200
3221
|
this.fc.targetFormDriver("loadRule", { rule: l, api: this.api }, this.fc), this.ruleEffect(l, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", o, this.api);
|
|
3201
|
-
let f,
|
|
3202
|
-
if (
|
|
3222
|
+
let f, d = !1, p = !!o.__fc__, m = l.value;
|
|
3223
|
+
if (p) {
|
|
3203
3224
|
if (f = o.__fc__, m = f.defaultValue, f.deleted) {
|
|
3204
3225
|
if (bt(f))
|
|
3205
3226
|
return;
|
|
@@ -3207,7 +3228,7 @@ function fi(t) {
|
|
|
3207
3228
|
} else if (!f.check(this)) {
|
|
3208
3229
|
if (bt(f))
|
|
3209
3230
|
return;
|
|
3210
|
-
e[a] = o = o._clone ? o._clone() : St(Oe(o)), f = null,
|
|
3231
|
+
e[a] = o = o._clone ? o._clone() : St(Oe(o)), f = null, d = !0;
|
|
3211
3232
|
}
|
|
3212
3233
|
}
|
|
3213
3234
|
if (f)
|
|
@@ -3216,7 +3237,7 @@ function fi(t) {
|
|
|
3216
3237
|
const F = this.parseRule(o);
|
|
3217
3238
|
f = new Gt(this, F, m), this.bindParser(f);
|
|
3218
3239
|
}
|
|
3219
|
-
[!1, !0].forEach((F) => this.parseEmit(f, F)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !
|
|
3240
|
+
[!1, !0].forEach((F) => this.parseEmit(f, F)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !d && !p && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3220
3241
|
const $ = f.loadChildrenPending();
|
|
3221
3242
|
if (f.parser.loadChildren === !1 || s($, f), !r) {
|
|
3222
3243
|
const F = i(a);
|
|
@@ -3236,8 +3257,8 @@ function fi(t) {
|
|
|
3236
3257
|
const r = hi(e), i = [], s = this.api;
|
|
3237
3258
|
if (!r.length) return !1;
|
|
3238
3259
|
for (let a = 0; a < r.length; a++) {
|
|
3239
|
-
const l = r[a], u = l.handle || function(
|
|
3240
|
-
return (he[l.condition || "=="] || he["=="])(
|
|
3260
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3261
|
+
return (he[l.condition || "=="] || he["=="])(d, l.value);
|
|
3241
3262
|
};
|
|
3242
3263
|
if (!h.trueArray(l.rule)) continue;
|
|
3243
3264
|
const f = q(_({}, l), {
|
|
@@ -3251,7 +3272,7 @@ function fi(t) {
|
|
|
3251
3272
|
const n = [];
|
|
3252
3273
|
let o = !1;
|
|
3253
3274
|
return this.deferSyncValue(() => {
|
|
3254
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append:
|
|
3275
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: p, ctrl: m, method: $ }) => {
|
|
3255
3276
|
if (a) {
|
|
3256
3277
|
l ? e.ctrlRule.push({
|
|
3257
3278
|
__ctrl: !0,
|
|
@@ -3273,11 +3294,11 @@ function fi(t) {
|
|
|
3273
3294
|
children: u
|
|
3274
3295
|
};
|
|
3275
3296
|
e.ctrlRule.push(v), this.bus.$once("load-start", () => {
|
|
3276
|
-
f ? s.prepend(v, f,
|
|
3297
|
+
f ? s.prepend(v, f, p) : d || p ? s.append(v, d || e.id, p) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, v);
|
|
3277
3298
|
});
|
|
3278
3299
|
} else {
|
|
3279
3300
|
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3280
|
-
const v =
|
|
3301
|
+
const v = Z(m);
|
|
3281
3302
|
v && v.rm();
|
|
3282
3303
|
}
|
|
3283
3304
|
});
|
|
@@ -3308,7 +3329,7 @@ function fi(t) {
|
|
|
3308
3329
|
function ci(t) {
|
|
3309
3330
|
const e = Nt();
|
|
3310
3331
|
return Object.keys(e).forEach((r) => {
|
|
3311
|
-
j(t, r) ||
|
|
3332
|
+
j(t, r) || E(t, r, e[r]);
|
|
3312
3333
|
}), t;
|
|
3313
3334
|
}
|
|
3314
3335
|
function hi(t) {
|
|
@@ -3358,7 +3379,7 @@ function pi(t) {
|
|
|
3358
3379
|
setFormData(e, r) {
|
|
3359
3380
|
e.modelValue = r;
|
|
3360
3381
|
const i = e.getParentGroup();
|
|
3361
|
-
i && (this.subRuleData[i.id] ||
|
|
3382
|
+
i && (this.subRuleData[i.id] || E(this.subRuleData, i.id, {}), E(this.subRuleData[i.id], e.field, e.rule.value)), E(this.formData, e.id, r);
|
|
3362
3383
|
},
|
|
3363
3384
|
rmSubRuleData(e) {
|
|
3364
3385
|
const r = e.getParentGroup();
|
|
@@ -3714,18 +3735,18 @@ function gi(t) {
|
|
|
3714
3735
|
const l = a.mode === "OR";
|
|
3715
3736
|
let u = !0;
|
|
3716
3737
|
for (let f = 0; f < a.group.length; f++) {
|
|
3717
|
-
const
|
|
3718
|
-
let
|
|
3719
|
-
if (
|
|
3720
|
-
$ = this.fc.getLoadData(
|
|
3721
|
-
else if (
|
|
3722
|
-
m = pt(
|
|
3723
|
-
else if (!
|
|
3738
|
+
const d = a.group[f];
|
|
3739
|
+
let p, m = null, $ = null;
|
|
3740
|
+
if (d.variable)
|
|
3741
|
+
$ = this.fc.getLoadData(d.variable);
|
|
3742
|
+
else if (d.field)
|
|
3743
|
+
m = pt(d.field || "");
|
|
3744
|
+
else if (!d.mode)
|
|
3724
3745
|
return !0;
|
|
3725
|
-
let v =
|
|
3726
|
-
if (v && (v = pt(v || "")),
|
|
3746
|
+
let v = d.compare;
|
|
3747
|
+
if (v && (v = pt(v || "")), d.mode ? p = n(d) : he[d.condition] ? h.Function(d.handler) ? p = O(() => d.handler(this.api, e.rule)) : p = O(() => new Function("$condition", "$variableVal", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${d.variable ? "$variableVal" : m}, ${v || "$val"}); }}}}`).call(this.api.form, he, $, d.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : p = !1, l && p)
|
|
3727
3748
|
return !0;
|
|
3728
|
-
l || (u = u &&
|
|
3749
|
+
l || (u = u && p);
|
|
3729
3750
|
}
|
|
3730
3751
|
return l ? !1 : u;
|
|
3731
3752
|
};
|
|
@@ -3801,9 +3822,9 @@ function yi(t) {
|
|
|
3801
3822
|
this.bus.$emit(e, ...r);
|
|
3802
3823
|
},
|
|
3803
3824
|
targetHook(e, r, i) {
|
|
3804
|
-
var l, u, f,
|
|
3805
|
-
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (
|
|
3806
|
-
|
|
3825
|
+
var l, u, f, d;
|
|
3826
|
+
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (p, m) => {
|
|
3827
|
+
p && (p = Array.isArray(p) ? p : [p], p.forEach(($) => {
|
|
3807
3828
|
O(() => $(q(_({
|
|
3808
3829
|
args: Object.values(i || {})
|
|
3809
3830
|
}, i || {}), {
|
|
@@ -3819,8 +3840,8 @@ function yi(t) {
|
|
|
3819
3840
|
n(s);
|
|
3820
3841
|
let o = "deep" + Nr(r), a = e.parent;
|
|
3821
3842
|
for (; a; ) {
|
|
3822
|
-
let
|
|
3823
|
-
n(
|
|
3843
|
+
let p = (d = (f = a.prop) == null ? void 0 : f.hook) == null ? void 0 : d[o];
|
|
3844
|
+
n(p, a), a = a.parent;
|
|
3824
3845
|
}
|
|
3825
3846
|
}
|
|
3826
3847
|
});
|
|
@@ -3888,15 +3909,15 @@ function $i(t) {
|
|
|
3888
3909
|
Object.keys(l).forEach((u) => {
|
|
3889
3910
|
const f = this.providers[u];
|
|
3890
3911
|
if (!f || f.input && !i) return;
|
|
3891
|
-
let
|
|
3912
|
+
let d;
|
|
3892
3913
|
if (!f._c)
|
|
3893
|
-
|
|
3914
|
+
d = "*";
|
|
3894
3915
|
else if (f._used.indexOf(s) > -1)
|
|
3895
|
-
|
|
3916
|
+
d = s;
|
|
3896
3917
|
else
|
|
3897
3918
|
return;
|
|
3898
|
-
const
|
|
3899
|
-
e && (
|
|
3919
|
+
const p = _({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3920
|
+
e && (p.getProp = () => e.effectData(u), p.clearProp = () => e.clearEffectData(u), p.mergeProp = (m) => ee(p.getProp(), [m]), p.id = e.id), this.bus.$emit(`p:${u}:${d}:${f.input ? 1 : 0}`, o, [p, r, this.api]);
|
|
3900
3921
|
});
|
|
3901
3922
|
}
|
|
3902
3923
|
});
|
|
@@ -3913,7 +3934,7 @@ function vi(t) {
|
|
|
3913
3934
|
return r.length ? r : !1;
|
|
3914
3935
|
} else return h.String(e) ? [e] : !1;
|
|
3915
3936
|
}
|
|
3916
|
-
function
|
|
3937
|
+
function z(t) {
|
|
3917
3938
|
Bt(this, {
|
|
3918
3939
|
options() {
|
|
3919
3940
|
return t.options.value || {};
|
|
@@ -3953,7 +3974,7 @@ function X(t) {
|
|
|
3953
3974
|
return i && i !== e && C(e, i), e;
|
|
3954
3975
|
}, ti(this));
|
|
3955
3976
|
}
|
|
3956
|
-
C(
|
|
3977
|
+
C(z.prototype, {
|
|
3957
3978
|
initData(t) {
|
|
3958
3979
|
C(this, {
|
|
3959
3980
|
ctxs: {},
|
|
@@ -3991,14 +4012,14 @@ C(X.prototype, {
|
|
|
3991
4012
|
});
|
|
3992
4013
|
}
|
|
3993
4014
|
});
|
|
3994
|
-
si(
|
|
3995
|
-
oi(
|
|
3996
|
-
li(
|
|
3997
|
-
fi(
|
|
3998
|
-
pi(
|
|
3999
|
-
gi(
|
|
4000
|
-
yi(
|
|
4001
|
-
$i(
|
|
4015
|
+
si(z);
|
|
4016
|
+
oi(z);
|
|
4017
|
+
li(z);
|
|
4018
|
+
fi(z);
|
|
4019
|
+
pi(z);
|
|
4020
|
+
gi(z);
|
|
4021
|
+
yi(z);
|
|
4022
|
+
$i(z);
|
|
4002
4023
|
const _i = "fcFragment", Ne = {
|
|
4003
4024
|
name: _i,
|
|
4004
4025
|
functional: !0,
|
|
@@ -4044,7 +4065,7 @@ function wi() {
|
|
|
4044
4065
|
},
|
|
4045
4066
|
use(r) {
|
|
4046
4067
|
Object.keys(r).forEach((i) => {
|
|
4047
|
-
const s = ve(i), n =
|
|
4068
|
+
const s = ve(i), n = kt(i).toLocaleLowerCase(), o = r[i];
|
|
4048
4069
|
e.alias(i, o), [i, s, n].forEach((a) => {
|
|
4049
4070
|
e.prototype[a] = function(l, u) {
|
|
4050
4071
|
return this.make(t[i] || a, l, u);
|
|
@@ -4100,7 +4121,7 @@ C(Jt.prototype, {
|
|
|
4100
4121
|
return e(this.vm);
|
|
4101
4122
|
},
|
|
4102
4123
|
mergeOptions(t, e) {
|
|
4103
|
-
return
|
|
4124
|
+
return Q(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
4104
4125
|
},
|
|
4105
4126
|
updateOptions(t) {
|
|
4106
4127
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -4130,14 +4151,14 @@ const Fi = function(t) {
|
|
|
4130
4151
|
const o = [];
|
|
4131
4152
|
n.forEach((a) => {
|
|
4132
4153
|
if (a && (a.attr || a.template)) {
|
|
4133
|
-
let l = (
|
|
4134
|
-
let
|
|
4135
|
-
i && i.__fc__ && (
|
|
4154
|
+
let l = (d) => {
|
|
4155
|
+
let p;
|
|
4156
|
+
i && i.__fc__ && (p = i.__fc__.getParentGroup());
|
|
4136
4157
|
let m;
|
|
4137
|
-
a.template ? m = t.$handle.loadStrVar(a.template,
|
|
4158
|
+
a.template ? m = t.$handle.loadStrVar(a.template, d, p ? { rule: i, value: t.$handle.subRuleData[p.id] || {} } : null) : a.handler && h.Function(a.handler) ? m = a.handler(d, i, s) : m = t.$handle.loadStrVar(`{{${a.attr}}}`, d, p ? { rule: i, value: t.$handle.subRuleData[p.id] || {} } : null), (m == null || m === "") && a.default != null && (m = a.default), a.copy !== !1 && (m = Y(m));
|
|
4138
4159
|
const $ = a.modify ? i : r.getProp();
|
|
4139
|
-
a.to === "child" ? $.children ?
|
|
4140
|
-
}, u = (
|
|
4160
|
+
a.to === "child" ? $.children ? E($.children, 0, m) : E($, "children", [m]) : oe($, a.to || "options", m), s.sync(i);
|
|
4161
|
+
}, u = (d) => l(d);
|
|
4141
4162
|
const f = t.watchLoadData(u);
|
|
4142
4163
|
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
4143
4164
|
}
|
|
@@ -4151,7 +4172,7 @@ const Fi = function(t) {
|
|
|
4151
4172
|
}
|
|
4152
4173
|
};
|
|
4153
4174
|
return e.watch = e.loaded, e;
|
|
4154
|
-
},
|
|
4175
|
+
}, Ei = function(t) {
|
|
4155
4176
|
const e = {
|
|
4156
4177
|
name: "t",
|
|
4157
4178
|
_fn: [],
|
|
@@ -4166,10 +4187,10 @@ const Fi = function(t) {
|
|
|
4166
4187
|
let f = (m) => {
|
|
4167
4188
|
let $ = t.t(u ? l.attr : l, u ? l.params : null, m);
|
|
4168
4189
|
const v = u && l.modify ? i : r.getProp();
|
|
4169
|
-
a === "child" ? v.children ?
|
|
4170
|
-
},
|
|
4171
|
-
const
|
|
4172
|
-
f = se(f, l.wait || 300), l.watch !== !1 ? o.push(
|
|
4190
|
+
a === "child" ? v.children ? E(v.children, 0, $) : E(v, "children", [$]) : oe(v, a, $), s.sync(i);
|
|
4191
|
+
}, d = (m) => f(m);
|
|
4192
|
+
const p = t.watchLoadData(d);
|
|
4193
|
+
f = se(f, l.wait || 300), l.watch !== !1 ? o.push(p) : p();
|
|
4173
4194
|
}
|
|
4174
4195
|
}), this._fn[r.id] = o;
|
|
4175
4196
|
},
|
|
@@ -4190,7 +4211,7 @@ const Fi = function(t) {
|
|
|
4190
4211
|
h.Object(i) || (i = { method: i });
|
|
4191
4212
|
const s = i.method, n = q(_({}, i), {
|
|
4192
4213
|
validator(...o) {
|
|
4193
|
-
const a =
|
|
4214
|
+
const a = Z(e);
|
|
4194
4215
|
if (a)
|
|
4195
4216
|
return r.exec(a.id, h.String(s) ? s : "formCreateValidate", ...o, {
|
|
4196
4217
|
attr: t,
|
|
@@ -4205,7 +4226,7 @@ const Fi = function(t) {
|
|
|
4205
4226
|
watch(...t) {
|
|
4206
4227
|
Kt.load(...t);
|
|
4207
4228
|
}
|
|
4208
|
-
},
|
|
4229
|
+
}, ki = function(t) {
|
|
4209
4230
|
function e(s) {
|
|
4210
4231
|
return h.String(s) && (s = {
|
|
4211
4232
|
action: s,
|
|
@@ -4215,33 +4236,33 @@ const Fi = function(t) {
|
|
|
4215
4236
|
function r(s, n, o) {
|
|
4216
4237
|
let a = s.value;
|
|
4217
4238
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
4218
|
-
const l = (
|
|
4219
|
-
|
|
4239
|
+
const l = (d) => {
|
|
4240
|
+
d === void 0 ? s.clearProp() : oe(s.getProp(), a.to || "options", d), o.sync(n);
|
|
4220
4241
|
};
|
|
4221
4242
|
if (!a || !a.action && !a.key) {
|
|
4222
4243
|
l(void 0);
|
|
4223
4244
|
return;
|
|
4224
4245
|
}
|
|
4225
|
-
if (a =
|
|
4226
|
-
const
|
|
4227
|
-
if (!
|
|
4246
|
+
if (a = Y(a), a.to || (a.to = "options"), a.key) {
|
|
4247
|
+
const d = t.$handle.options.globalData[a.key];
|
|
4248
|
+
if (!d) {
|
|
4228
4249
|
l(void 0);
|
|
4229
4250
|
return;
|
|
4230
4251
|
}
|
|
4231
|
-
if (
|
|
4232
|
-
l(
|
|
4252
|
+
if (d.type === "static") {
|
|
4253
|
+
l(d.data);
|
|
4233
4254
|
return;
|
|
4234
4255
|
} else
|
|
4235
|
-
a = _(_({}, a),
|
|
4256
|
+
a = _(_({}, a), d);
|
|
4236
4257
|
}
|
|
4237
4258
|
const u = a.onError, f = () => {
|
|
4238
4259
|
if (!s.getValue())
|
|
4239
4260
|
return s.clearProp(), o.sync(n), !0;
|
|
4240
4261
|
};
|
|
4241
|
-
i._fn[s.id] = t.watchLoadData(se((
|
|
4242
|
-
if (
|
|
4262
|
+
i._fn[s.id] = t.watchLoadData(se((d, p) => {
|
|
4263
|
+
if (p && a.watch === !1)
|
|
4243
4264
|
return i._fn[s.id]();
|
|
4244
|
-
const m = t.$handle.loadFetchVar(
|
|
4265
|
+
const m = t.$handle.loadFetchVar(Y(a), d, n), $ = q(_({
|
|
4245
4266
|
headers: {}
|
|
4246
4267
|
}, m), {
|
|
4247
4268
|
onSuccess(v, F) {
|
|
@@ -4285,9 +4306,9 @@ const Fi = function(t) {
|
|
|
4285
4306
|
};
|
|
4286
4307
|
return i;
|
|
4287
4308
|
}, Ri = {
|
|
4288
|
-
fetch:
|
|
4309
|
+
fetch: ki,
|
|
4289
4310
|
loadData: Fi,
|
|
4290
|
-
t:
|
|
4311
|
+
t: Ei,
|
|
4291
4312
|
componentValidate: Kt
|
|
4292
4313
|
};
|
|
4293
4314
|
function Si(t) {
|
|
@@ -4461,9 +4482,9 @@ function Wt(t) {
|
|
|
4461
4482
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4462
4483
|
t.extendApi
|
|
4463
4484
|
], u = _({}, Ri), f = Yr();
|
|
4464
|
-
let
|
|
4465
|
-
const
|
|
4466
|
-
$mobile:
|
|
4485
|
+
let d = { global: {} };
|
|
4486
|
+
const p = t.isMobile === !0, m = ne({
|
|
4487
|
+
$mobile: p
|
|
4467
4488
|
}), $ = wi(), v = {}, F = {};
|
|
4468
4489
|
Ui(t.attrs || {});
|
|
4469
4490
|
function J(c) {
|
|
@@ -4499,7 +4520,7 @@ function Wt(t) {
|
|
|
4499
4520
|
const y = H(g.id), b = g.prop, w = b.merge === !0 ? r[y] : void 0;
|
|
4500
4521
|
r[y] = je(b, w || we), f[y] = T(y), b.maker && C(f, b.maker);
|
|
4501
4522
|
}
|
|
4502
|
-
function
|
|
4523
|
+
function k(c, g) {
|
|
4503
4524
|
let y;
|
|
4504
4525
|
if (h.String(c)) {
|
|
4505
4526
|
if (y = c, g === void 0)
|
|
@@ -4517,15 +4538,15 @@ function Wt(t) {
|
|
|
4517
4538
|
return Ne;
|
|
4518
4539
|
}
|
|
4519
4540
|
function ge(c, g) {
|
|
4520
|
-
return h.Function(c.install) ? c.install(
|
|
4541
|
+
return h.Function(c.install) ? c.install(K, g) : h.Function(c) && c(K, g), this;
|
|
4521
4542
|
}
|
|
4522
|
-
function
|
|
4543
|
+
function K(c, g, y) {
|
|
4523
4544
|
let b = qi(c, g || {});
|
|
4524
4545
|
const w = b.$refs.fc.formCreate;
|
|
4525
4546
|
return w.$parent = y, Mi(w.options).appendChild(b.$el), w.api();
|
|
4526
4547
|
}
|
|
4527
|
-
je(
|
|
4528
|
-
function
|
|
4548
|
+
je(K, F);
|
|
4549
|
+
function zt(c) {
|
|
4529
4550
|
let g = _({}, t);
|
|
4530
4551
|
return c ? g.inherit = {
|
|
4531
4552
|
components: e,
|
|
@@ -4551,7 +4572,7 @@ function Wt(t) {
|
|
|
4551
4572
|
b[w] = je(g.parsers[w], we);
|
|
4552
4573
|
}), g.name = c, n[c] = q(_(_({}, y), g), { parsers: b });
|
|
4553
4574
|
}
|
|
4554
|
-
function
|
|
4575
|
+
function Ee(c) {
|
|
4555
4576
|
c && Object.keys(U).forEach((g) => {
|
|
4556
4577
|
(Array.isArray(U[g]) ? U[g] : [U[g]]).forEach((b) => {
|
|
4557
4578
|
b.bus.$emit("$loadData." + c);
|
|
@@ -4559,9 +4580,9 @@ function Wt(t) {
|
|
|
4559
4580
|
});
|
|
4560
4581
|
}
|
|
4561
4582
|
function Te(c, g) {
|
|
4562
|
-
oe(m, c, g),
|
|
4583
|
+
oe(m, c, g), Ee(c);
|
|
4563
4584
|
}
|
|
4564
|
-
function
|
|
4585
|
+
function ke(c, g) {
|
|
4565
4586
|
const y = (...b) => O(() => g(...b));
|
|
4566
4587
|
y._driver = !0, Te(c, y);
|
|
4567
4588
|
}
|
|
@@ -4569,7 +4590,7 @@ function Wt(t) {
|
|
|
4569
4590
|
const y = (c || "").split(".");
|
|
4570
4591
|
c = y.shift();
|
|
4571
4592
|
const b = y.join(".");
|
|
4572
|
-
if (j(m, c) ||
|
|
4593
|
+
if (j(m, c) || E(m, c, _t), m[c] !== _t) {
|
|
4573
4594
|
let w = m[c];
|
|
4574
4595
|
return w && w._driver ? w = w(b) : y.length && (w = B(w, y)), w == null || w === "" ? g : w;
|
|
4575
4596
|
} else
|
|
@@ -4579,7 +4600,7 @@ function Wt(t) {
|
|
|
4579
4600
|
l.push(c);
|
|
4580
4601
|
}
|
|
4581
4602
|
function er(c) {
|
|
4582
|
-
delete m[c],
|
|
4603
|
+
delete m[c], Ee(c);
|
|
4583
4604
|
}
|
|
4584
4605
|
function tr(c, g) {
|
|
4585
4606
|
a.push({ name: c, callback: g });
|
|
@@ -4587,14 +4608,14 @@ function Wt(t) {
|
|
|
4587
4608
|
function Be(c) {
|
|
4588
4609
|
C(this, {
|
|
4589
4610
|
id: Hi++,
|
|
4590
|
-
create:
|
|
4611
|
+
create: K,
|
|
4591
4612
|
vm: c,
|
|
4592
4613
|
manager: Oi(t.manager),
|
|
4593
4614
|
parsers: r,
|
|
4594
4615
|
providers: u,
|
|
4595
4616
|
modelFields: s,
|
|
4596
4617
|
formulas: v,
|
|
4597
|
-
isMobile:
|
|
4618
|
+
isMobile: p,
|
|
4598
4619
|
rules: c.$props.rule,
|
|
4599
4620
|
name: c.$props.name || Ie(),
|
|
4600
4621
|
inFor: c.$props.inFor,
|
|
@@ -4605,7 +4626,7 @@ function Wt(t) {
|
|
|
4605
4626
|
get: null,
|
|
4606
4627
|
drivers: n,
|
|
4607
4628
|
renderDriver: null,
|
|
4608
|
-
refreshData:
|
|
4629
|
+
refreshData: Ee,
|
|
4609
4630
|
loadData: m,
|
|
4610
4631
|
CreateNode: $,
|
|
4611
4632
|
bus: new Si(),
|
|
@@ -4620,9 +4641,9 @@ function Wt(t) {
|
|
|
4620
4641
|
N(this.options, () => {
|
|
4621
4642
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4622
4643
|
}, { deep: !0 });
|
|
4623
|
-
}), C(c.$options.components, e), C(c.$options.directives, i), this.$handle = new
|
|
4644
|
+
}), C(c.$options.components, e), C(c.$options.directives, i), this.$handle = new z(this), this.name && (this.inFor ? (U[this.name] || (U[this.name] = []), U[this.name].push(this)) : U[this.name] = this);
|
|
4624
4645
|
}
|
|
4625
|
-
Be.isMobile =
|
|
4646
|
+
Be.isMobile = p, C(Be.prototype, {
|
|
4626
4647
|
init() {
|
|
4627
4648
|
this.isSub() && this.unwatch.push(N(() => this.vm.parent.fc.options.value, () => {
|
|
4628
4649
|
this.initOptions(), this.$handle.api.refresh();
|
|
@@ -4656,18 +4677,18 @@ function Wt(t) {
|
|
|
4656
4677
|
this.fetchCache.set(b, { status: !1 });
|
|
4657
4678
|
const R = se(() => {
|
|
4658
4679
|
te();
|
|
4659
|
-
const
|
|
4660
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (
|
|
4661
|
-
}, b.wait || 600), ae = (
|
|
4662
|
-
this.fetchCache.set(b, { status: !0, data:
|
|
4663
|
-
}, le = (
|
|
4680
|
+
const W = this.fetchCache.get(b);
|
|
4681
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (W && (W.loading = !0, this.fetchCache.set(b, W)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(b);
|
|
4682
|
+
}, b.wait || 600), ae = (W) => {
|
|
4683
|
+
this.fetchCache.set(b, { status: !0, data: W }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4684
|
+
}, le = (W, ue) => {
|
|
4664
4685
|
if (ue && b.watch === !1)
|
|
4665
4686
|
return te();
|
|
4666
4687
|
if (ue) {
|
|
4667
4688
|
R();
|
|
4668
4689
|
return;
|
|
4669
4690
|
}
|
|
4670
|
-
const fe = this.$handle.loadFetchVar(Ke(b),
|
|
4691
|
+
const fe = this.$handle.loadFetchVar(Ke(b), W);
|
|
4671
4692
|
fe.targetRule = this.targetRule, this.$handle.api.fetch(fe).then((re) => {
|
|
4672
4693
|
ae(re);
|
|
4673
4694
|
}).catch((re) => {
|
|
@@ -4746,7 +4767,7 @@ function Wt(t) {
|
|
|
4746
4767
|
let le;
|
|
4747
4768
|
if (typeof R == "object" && (le = R.getValue, R = R.id), y[R])
|
|
4748
4769
|
return y[R].val;
|
|
4749
|
-
const te = $e(() => le ? le() : this.getLoadData(R, ae)),
|
|
4770
|
+
const te = $e(() => le ? le() : this.getLoadData(R, ae)), W = R.split("."), ue = W.shift(), fe = W.shift() || "", re = se(() => {
|
|
4750
4771
|
const ce = le ? le() : this.getLoadData(R, ae);
|
|
4751
4772
|
if (y[R])
|
|
4752
4773
|
((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));
|
|
@@ -4778,16 +4799,16 @@ function Wt(t) {
|
|
|
4778
4799
|
resetBtn: {},
|
|
4779
4800
|
globalEvent: {},
|
|
4780
4801
|
globalData: {}
|
|
4781
|
-
},
|
|
4802
|
+
}, Y(d));
|
|
4782
4803
|
const g = this.isSub();
|
|
4783
4804
|
g && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$props.option || {});
|
|
4784
4805
|
const y = this.api();
|
|
4785
4806
|
this.targetFormDriver("initOptions", c, { api: y, isSubForm: g }), this.updateOptions(c);
|
|
4786
4807
|
},
|
|
4787
4808
|
mergeOptions(c, g, y) {
|
|
4788
|
-
return g = _({}, g || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4809
|
+
return g = _({}, g || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "beforeUnmount", "beforeSubmit", "onBeforeUnmount", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4789
4810
|
delete g[b];
|
|
4790
|
-
}), g.global && (c.global =
|
|
4811
|
+
}), g.global && (c.global = xr(c.global, g.global), delete g.global), this.$handle.$manager.mergeOptions([g], c), c;
|
|
4791
4812
|
},
|
|
4792
4813
|
updateOptions(c) {
|
|
4793
4814
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4802,7 +4823,7 @@ function Wt(t) {
|
|
|
4802
4823
|
this.$handle.mounted();
|
|
4803
4824
|
},
|
|
4804
4825
|
unmount() {
|
|
4805
|
-
if (this.name)
|
|
4826
|
+
if (O(() => this.$handle.lifecycle("beforeUnmount")), this.name)
|
|
4806
4827
|
if (this.inFor) {
|
|
4807
4828
|
const c = U[this.name].indexOf(this);
|
|
4808
4829
|
U[this.name].splice(c, 1);
|
|
@@ -4820,15 +4841,15 @@ function Wt(t) {
|
|
|
4820
4841
|
C(c, {
|
|
4821
4842
|
version: t.version,
|
|
4822
4843
|
ui: t.ui,
|
|
4823
|
-
isMobile:
|
|
4844
|
+
isMobile: p,
|
|
4824
4845
|
extendApi: Yt,
|
|
4825
4846
|
getData: st,
|
|
4826
|
-
setDataDriver:
|
|
4847
|
+
setDataDriver: ke,
|
|
4827
4848
|
setData: Te,
|
|
4828
4849
|
removeData: er,
|
|
4829
|
-
refreshData:
|
|
4850
|
+
refreshData: Ee,
|
|
4830
4851
|
maker: f,
|
|
4831
|
-
component:
|
|
4852
|
+
component: k,
|
|
4832
4853
|
directive: L,
|
|
4833
4854
|
setModelField: Xt,
|
|
4834
4855
|
setFormula: Zt,
|
|
@@ -4837,7 +4858,7 @@ function Wt(t) {
|
|
|
4837
4858
|
$vnode: M,
|
|
4838
4859
|
parser: me,
|
|
4839
4860
|
use: ge,
|
|
4840
|
-
factory:
|
|
4861
|
+
factory: zt,
|
|
4841
4862
|
componentAlias: Pe,
|
|
4842
4863
|
copyRule: Pt,
|
|
4843
4864
|
copyRules: Tt,
|
|
@@ -4854,14 +4875,14 @@ function Wt(t) {
|
|
|
4854
4875
|
}
|
|
4855
4876
|
function rr(c) {
|
|
4856
4877
|
C(c, {
|
|
4857
|
-
create:
|
|
4878
|
+
create: K,
|
|
4858
4879
|
install(g, y) {
|
|
4859
|
-
|
|
4860
|
-
const b = `_installedFormCreate${
|
|
4880
|
+
d = _(_({}, d), y || {});
|
|
4881
|
+
const b = `_installedFormCreate${p ? "Mobile" : ""}_${t.ui}`;
|
|
4861
4882
|
if (g[b] === !0) return;
|
|
4862
4883
|
g[b] = !0;
|
|
4863
4884
|
const w = function(R, ae = {}) {
|
|
4864
|
-
return
|
|
4885
|
+
return K(R, ae, this);
|
|
4865
4886
|
};
|
|
4866
4887
|
ot(w), g.prototype.$formCreate = w;
|
|
4867
4888
|
const V = S();
|
|
@@ -4871,7 +4892,7 @@ function Wt(t) {
|
|
|
4871
4892
|
}
|
|
4872
4893
|
});
|
|
4873
4894
|
}
|
|
4874
|
-
if (ot(F), rr(F),
|
|
4895
|
+
if (ot(F), rr(F), ke("$cookie", Pi), ke("$localStorage", Ti), ke("$sessionStorage", Bi), $.use({ fragment: "fcFragment" }), t.install && K.use(t), me(Di), t.inherit) {
|
|
4875
4896
|
const c = t.inherit;
|
|
4876
4897
|
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);
|
|
4877
4898
|
}
|
|
@@ -4923,13 +4944,13 @@ const Ct = {
|
|
|
4923
4944
|
let { props: e } = t.prop;
|
|
4924
4945
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4925
4946
|
}
|
|
4926
|
-
}, Wi = "textarea",
|
|
4947
|
+
}, Wi = "textarea", xi = {
|
|
4927
4948
|
name: Wi,
|
|
4928
4949
|
mergeProp(t) {
|
|
4929
4950
|
let { props: e } = t.prop;
|
|
4930
4951
|
e.type = "textarea", e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4931
4952
|
}
|
|
4932
|
-
}, Ot = "slider",
|
|
4953
|
+
}, Ot = "slider", zi = {
|
|
4933
4954
|
name: Ot,
|
|
4934
4955
|
maker: {
|
|
4935
4956
|
sliderRange: T(Ot, { range: !0 })
|
|
@@ -4964,8 +4985,8 @@ const Ct = {
|
|
|
4964
4985
|
Gi,
|
|
4965
4986
|
Ji,
|
|
4966
4987
|
Ki,
|
|
4967
|
-
zi,
|
|
4968
4988
|
xi,
|
|
4989
|
+
zi,
|
|
4969
4990
|
Xi,
|
|
4970
4991
|
Zi,
|
|
4971
4992
|
Yi
|
|
@@ -5043,7 +5064,7 @@ function nn(t) {
|
|
|
5043
5064
|
function Ft(t, e) {
|
|
5044
5065
|
j(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
5045
5066
|
}
|
|
5046
|
-
function
|
|
5067
|
+
function X(t) {
|
|
5047
5068
|
return t === !1;
|
|
5048
5069
|
}
|
|
5049
5070
|
function sn(t, e) {
|
|
@@ -5094,7 +5115,7 @@ const on = {
|
|
|
5094
5115
|
wrap: {}
|
|
5095
5116
|
};
|
|
5096
5117
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
5097
|
-
t.prop[r] =
|
|
5118
|
+
t.prop[r] = Q([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
5098
5119
|
});
|
|
5099
5120
|
},
|
|
5100
5121
|
getDefaultOptions() {
|
|
@@ -5120,14 +5141,14 @@ const on = {
|
|
|
5120
5141
|
});
|
|
5121
5142
|
},
|
|
5122
5143
|
render(t) {
|
|
5123
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
5144
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, X(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
5124
5145
|
},
|
|
5125
5146
|
makeWrap(t, e) {
|
|
5126
5147
|
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;
|
|
5127
5148
|
delete r.wrap.class, delete r.wrap.title;
|
|
5128
|
-
const f = (h.Undef(r.wrap.show) ? !t.input :
|
|
5149
|
+
const f = (h.Undef(r.wrap.show) ? !t.input : X(r.wrap.show)) ? e : this.$r(Q([r.wrap, {
|
|
5129
5150
|
props: q(_({
|
|
5130
|
-
labelWidth: o === void 0 ? o :
|
|
5151
|
+
labelWidth: o === void 0 ? o : kt(o),
|
|
5131
5152
|
label: n ? r.title.title : void 0
|
|
5132
5153
|
}, Ge(r.wrap || {})), {
|
|
5133
5154
|
prop: t.id,
|
|
@@ -5138,21 +5159,21 @@ const on = {
|
|
|
5138
5159
|
ref: t.wrapRef,
|
|
5139
5160
|
type: "formItem"
|
|
5140
5161
|
}]), _({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
5141
|
-
return a === !0 ||
|
|
5162
|
+
return a === !0 || X(l) || X(s.show) ? f : this.makeCol(r, i, [f]);
|
|
5142
5163
|
},
|
|
5143
5164
|
isTitle(t) {
|
|
5144
5165
|
if (this.options.form.title === !1) return !1;
|
|
5145
5166
|
const e = t.title;
|
|
5146
|
-
return !(!e.title && !e.native ||
|
|
5167
|
+
return !(!e.title && !e.native || X(e.show));
|
|
5147
5168
|
},
|
|
5148
5169
|
makeInfo(t, e, r) {
|
|
5149
|
-
var f,
|
|
5170
|
+
var f, d, p, m, $, v;
|
|
5150
5171
|
const i = _({}, t.title), s = _({}, t.info), n = nn(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
5151
|
-
title: (
|
|
5172
|
+
title: (d = (f = r.refRule) == null ? void 0 : f.__$title) == null ? void 0 : d.value,
|
|
5152
5173
|
rule: r.rule,
|
|
5153
5174
|
options: this.options
|
|
5154
|
-
}) : ((m = (
|
|
5155
|
-
if (!
|
|
5175
|
+
}) : ((m = (p = r.refRule) == null ? void 0 : p.__$title) == null ? void 0 : m.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
5176
|
+
if (!X(s.show) && (s.info || s.native) && !X(s.icon)) {
|
|
5156
5177
|
const F = {
|
|
5157
5178
|
type: s.type || "popover",
|
|
5158
5179
|
slot: "label",
|
|
@@ -5161,7 +5182,7 @@ const on = {
|
|
|
5161
5182
|
};
|
|
5162
5183
|
delete F.props.icon, delete F.props.show, delete F.props.info, delete F.props.align, delete F.props.native;
|
|
5163
5184
|
const J = "content";
|
|
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(
|
|
5185
|
+
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(Q([s, F]), [
|
|
5165
5186
|
this.$r({
|
|
5166
5187
|
type: "i",
|
|
5167
5188
|
slot: n ? "default" : "reference",
|
|
@@ -5170,7 +5191,7 @@ const on = {
|
|
|
5170
5191
|
})
|
|
5171
5192
|
]));
|
|
5172
5193
|
}
|
|
5173
|
-
const u =
|
|
5194
|
+
const u = Q([i, {
|
|
5174
5195
|
props: Ge(i),
|
|
5175
5196
|
key: `${e}tit`,
|
|
5176
5197
|
class: "fc-form-title",
|
|
@@ -5204,7 +5225,7 @@ const on = {
|
|
|
5204
5225
|
},
|
|
5205
5226
|
makeFormBtn() {
|
|
5206
5227
|
let t = [];
|
|
5207
|
-
if (
|
|
5228
|
+
if (X(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), X(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
5208
5229
|
return;
|
|
5209
5230
|
const e = this.$r({
|
|
5210
5231
|
type: "formItem",
|
|
@@ -5290,7 +5311,7 @@ function cn(t) {
|
|
|
5290
5311
|
};
|
|
5291
5312
|
return Object.keys(e).reduce((r, i) => (r[i] = T("frame", (s) => s.props({ type: e[i][0], maxLength: e[i][1] })), r), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages, t;
|
|
5292
5313
|
}
|
|
5293
|
-
function
|
|
5314
|
+
function Et(t, e) {
|
|
5294
5315
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
5295
5316
|
}
|
|
5296
5317
|
function hn(t, e) {
|
|
@@ -5318,7 +5339,10 @@ function hn(t, e) {
|
|
|
5318
5339
|
validateField(r, i) {
|
|
5319
5340
|
return new Promise((s, n) => {
|
|
5320
5341
|
const o = e.getFieldCtx(r);
|
|
5321
|
-
if (!o)
|
|
5342
|
+
if (!o) {
|
|
5343
|
+
s(null), i && i(null);
|
|
5344
|
+
return;
|
|
5345
|
+
}
|
|
5322
5346
|
const a = e.subForm[o.id], l = [e.$manager.validateField(o.id)];
|
|
5323
5347
|
G(a).filter((u) => !u.isScope).forEach((u) => {
|
|
5324
5348
|
l.push(u.validate());
|
|
@@ -5329,6 +5353,17 @@ function hn(t, e) {
|
|
|
5329
5353
|
});
|
|
5330
5354
|
});
|
|
5331
5355
|
},
|
|
5356
|
+
validateFields(r, i) {
|
|
5357
|
+
return new Promise((s, n) => {
|
|
5358
|
+
Array.isArray(r) || (r = [r]);
|
|
5359
|
+
const o = r.map((a) => t.validateField(a));
|
|
5360
|
+
Promise.all(o).then(() => {
|
|
5361
|
+
s(null), i && i(null);
|
|
5362
|
+
}).catch((a) => {
|
|
5363
|
+
n(a), i && i(a);
|
|
5364
|
+
});
|
|
5365
|
+
});
|
|
5366
|
+
},
|
|
5332
5367
|
clearValidateState(r, i = !0) {
|
|
5333
5368
|
t.helper.tidyFields(r).forEach((s) => {
|
|
5334
5369
|
i && this.clearSubValidateState(s), e.getCtxs(s).forEach((n) => {
|
|
@@ -5369,11 +5404,11 @@ function hn(t, e) {
|
|
|
5369
5404
|
}
|
|
5370
5405
|
},
|
|
5371
5406
|
submitBtnProps: (r = {}) => {
|
|
5372
|
-
let i =
|
|
5407
|
+
let i = Et(e.options.submitBtn, !0);
|
|
5373
5408
|
C(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
5374
5409
|
},
|
|
5375
5410
|
resetBtnProps: (r = {}) => {
|
|
5376
|
-
let i =
|
|
5411
|
+
let i = Et(e.options.resetBtn, !1);
|
|
5377
5412
|
C(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
5378
5413
|
},
|
|
5379
5414
|
submit(r, i) {
|
|
@@ -5391,7 +5426,7 @@ function hn(t, e) {
|
|
|
5391
5426
|
}
|
|
5392
5427
|
};
|
|
5393
5428
|
}
|
|
5394
|
-
const
|
|
5429
|
+
const xt = {
|
|
5395
5430
|
name: "required",
|
|
5396
5431
|
load(t, e, r) {
|
|
5397
5432
|
const i = dn(t.getValue());
|
|
@@ -5420,7 +5455,7 @@ const zt = {
|
|
|
5420
5455
|
r.sync(e);
|
|
5421
5456
|
},
|
|
5422
5457
|
watch(...t) {
|
|
5423
|
-
|
|
5458
|
+
xt.load(...t);
|
|
5424
5459
|
}
|
|
5425
5460
|
};
|
|
5426
5461
|
function dn(t) {
|
|
@@ -5429,7 +5464,7 @@ function dn(t) {
|
|
|
5429
5464
|
function pn(t) {
|
|
5430
5465
|
t.componentAlias(tn), Kr.forEach((e) => {
|
|
5431
5466
|
t.component(e.name, e);
|
|
5432
|
-
}), t.register(
|
|
5467
|
+
}), t.register(xt), en.forEach((e) => {
|
|
5433
5468
|
t.parser(e);
|
|
5434
5469
|
}), Object.keys(de).forEach((e) => {
|
|
5435
5470
|
t.maker[e] = de[e];
|
|
@@ -5438,7 +5473,7 @@ function pn(t) {
|
|
|
5438
5473
|
function mn() {
|
|
5439
5474
|
return Wt({
|
|
5440
5475
|
ui: "element-ui",
|
|
5441
|
-
version: "2.7.
|
|
5476
|
+
version: "2.7.26",
|
|
5442
5477
|
manager: on,
|
|
5443
5478
|
extendApi: hn,
|
|
5444
5479
|
install: pn,
|