@form-create/view-design 2.7.19 → 2.7.21
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 +316 -289
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +4 -4
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/view-design v2.7.
|
|
3
|
+
* @form-create/view-design v2.7.21
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -19,7 +19,7 @@ var lt = (t, e, r) => e in t ? or(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
19
19
|
fr.call(e, r) && lt(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
21
|
}, q = (t, e) => ar(t, lr(e));
|
|
22
|
-
import
|
|
22
|
+
import $e, { getCurrentInstance as cr, provide as hr, inject as dr, toRefs as ut, reactive as ie, onBeforeMount as pr, watch as T, onMounted as mr, onBeforeUnmount as gr, onUpdated as yr, nextTick as V, markRaw as ge, computed as ye, toRef as De, ref as $r } from "vue";
|
|
23
23
|
function br(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
@@ -49,13 +49,13 @@ var vr = ["attrs", "props", "domProps"], _r = ["class", "style", "directives"],
|
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const D = /* @__PURE__ */ br(
|
|
52
|
+
}, kr = wr;
|
|
53
|
+
const D = /* @__PURE__ */ br(kr);
|
|
54
54
|
function Ve(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const Fr = "fcCheckbox", Sr = {
|
|
58
|
+
name: Fr,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -127,7 +127,7 @@ function H(t) {
|
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
129
|
const Rr = "fcFrame";
|
|
130
|
-
function
|
|
130
|
+
function Ft(t) {
|
|
131
131
|
return {
|
|
132
132
|
name: Rr,
|
|
133
133
|
props: {
|
|
@@ -503,11 +503,11 @@ function kt(t) {
|
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
const St =
|
|
506
|
+
const St = Ft({
|
|
507
507
|
fileIcon: "md-document",
|
|
508
508
|
fileUpIcon: "ios-folder-open"
|
|
509
509
|
});
|
|
510
|
-
St.v2 =
|
|
510
|
+
St.v2 = Ft({
|
|
511
511
|
fileIcon: "document-text",
|
|
512
512
|
fileUpIcon: "folder"
|
|
513
513
|
});
|
|
@@ -915,11 +915,11 @@ Et.v2 = Rt({
|
|
|
915
915
|
fileIcon: "document-text",
|
|
916
916
|
imgUpIcon: "image"
|
|
917
917
|
});
|
|
918
|
-
function
|
|
919
|
-
|
|
918
|
+
function k(t, e, r) {
|
|
919
|
+
$e.set(t, e, r);
|
|
920
920
|
}
|
|
921
921
|
function re(t, e) {
|
|
922
|
-
(
|
|
922
|
+
($e.del || $e.delete)(t, e);
|
|
923
923
|
}
|
|
924
924
|
function we(t, e = {}, r) {
|
|
925
925
|
let i = !1;
|
|
@@ -929,19 +929,19 @@ function we(t, e = {}, r) {
|
|
|
929
929
|
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
930
930
|
let o = t[s] === void 0;
|
|
931
931
|
if (i)
|
|
932
|
-
i = !1, o &&
|
|
932
|
+
i = !1, o && k(t, s, []);
|
|
933
933
|
else if (n._clone && r !== void 0)
|
|
934
934
|
if (r)
|
|
935
|
-
n = n.getRule(), o &&
|
|
935
|
+
n = n.getRule(), o && k(t, s, {});
|
|
936
936
|
else {
|
|
937
|
-
|
|
937
|
+
k(t, s, n._clone());
|
|
938
938
|
continue;
|
|
939
939
|
}
|
|
940
940
|
else
|
|
941
|
-
o &&
|
|
941
|
+
o && k(t, s, {});
|
|
942
942
|
t[s] = we(t[s], n, r);
|
|
943
943
|
} else
|
|
944
|
-
|
|
944
|
+
k(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
945
945
|
}
|
|
946
946
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
947
947
|
}
|
|
@@ -951,7 +951,7 @@ function G(t) {
|
|
|
951
951
|
const Br = Object.assign || function(t) {
|
|
952
952
|
for (let e, r = 1; r < arguments.length; r++)
|
|
953
953
|
for (let i in e = arguments[r], e)
|
|
954
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
954
|
+
Object.prototype.hasOwnProperty.call(e, i) && k(t, i, e[i]);
|
|
955
955
|
return t;
|
|
956
956
|
};
|
|
957
957
|
function C() {
|
|
@@ -975,7 +975,7 @@ function Nr(t) {
|
|
|
975
975
|
function Ae(t) {
|
|
976
976
|
return Nr(t) ? t : Promise.resolve(t);
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function be(t) {
|
|
979
979
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
980
980
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
981
981
|
}
|
|
@@ -1061,8 +1061,8 @@ function Pe() {
|
|
|
1061
1061
|
function se(t, e, r) {
|
|
1062
1062
|
let i = t, s;
|
|
1063
1063
|
return (e || "").split(".").forEach((n) => {
|
|
1064
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1065
|
-
}),
|
|
1064
|
+
s && ((!i[s] || typeof i[s] != "object") && k(i, s, {}), i = i[s]), s = n;
|
|
1065
|
+
}), k(i, s, r), i;
|
|
1066
1066
|
}
|
|
1067
1067
|
const Gr = "fcGroup", Hr = {
|
|
1068
1068
|
name: Gr,
|
|
@@ -1601,9 +1601,9 @@ function Se() {
|
|
|
1601
1601
|
function Re(t, e) {
|
|
1602
1602
|
return Object.setPrototypeOf(t, e), t;
|
|
1603
1603
|
}
|
|
1604
|
-
const dt = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1604
|
+
const dt = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, he = {
|
|
1605
1605
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(dt(t, e)),
|
|
1606
|
-
"!=": (t, e) => !
|
|
1606
|
+
"!=": (t, e) => !he["=="](t, e),
|
|
1607
1607
|
">": (t, e) => t > e,
|
|
1608
1608
|
">=": (t, e) => t >= e,
|
|
1609
1609
|
"<": (t, e) => t < e,
|
|
@@ -1612,13 +1612,13 @@ const dt = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1612
1612
|
return t && t.indexOf && t.indexOf(dt(t[0], e)) > -1;
|
|
1613
1613
|
},
|
|
1614
1614
|
notOn(t, e) {
|
|
1615
|
-
return !
|
|
1615
|
+
return !he.on(t, e);
|
|
1616
1616
|
},
|
|
1617
1617
|
in(t, e) {
|
|
1618
1618
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1619
1619
|
},
|
|
1620
1620
|
notIn(t, e) {
|
|
1621
|
-
return !
|
|
1621
|
+
return !he.in(t, e);
|
|
1622
1622
|
},
|
|
1623
1623
|
between(t, e) {
|
|
1624
1624
|
return t > e[0] && t < e[1];
|
|
@@ -1743,73 +1743,73 @@ function Qr(t, e, r) {
|
|
|
1743
1743
|
unique: 1,
|
|
1744
1744
|
renderRule: [...l.value || []],
|
|
1745
1745
|
updateValue: JSON.stringify(u.value || {})
|
|
1746
|
-
}),
|
|
1746
|
+
}), m = new t(n), y = m.api(), v = p.value, E = () => {
|
|
1747
1747
|
if (o) {
|
|
1748
|
-
const
|
|
1749
|
-
if (
|
|
1750
|
-
let
|
|
1751
|
-
v ? (
|
|
1748
|
+
const F = Ee(n, o);
|
|
1749
|
+
if (F) {
|
|
1750
|
+
let R;
|
|
1751
|
+
v ? (R = H(F.getSubForm()), R.push(y)) : R = y, F.subForm(R);
|
|
1752
1752
|
}
|
|
1753
1753
|
}
|
|
1754
1754
|
}, Y = () => {
|
|
1755
|
-
const
|
|
1756
|
-
if (
|
|
1755
|
+
const F = Ee(n, o);
|
|
1756
|
+
if (F)
|
|
1757
1757
|
if (v) {
|
|
1758
|
-
const
|
|
1759
|
-
N > -1 &&
|
|
1758
|
+
const R = H(F.getSubForm()), N = R.indexOf(y);
|
|
1759
|
+
N > -1 && R.splice(N, 1);
|
|
1760
1760
|
} else
|
|
1761
|
-
|
|
1761
|
+
F.subForm();
|
|
1762
1762
|
};
|
|
1763
1763
|
let I = null;
|
|
1764
1764
|
pr(() => {
|
|
1765
1765
|
T(() => {
|
|
1766
|
-
let
|
|
1767
|
-
const
|
|
1768
|
-
Object.keys(
|
|
1769
|
-
let
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
}),
|
|
1773
|
-
}), s.option && s.option.style && (
|
|
1766
|
+
let F = "";
|
|
1767
|
+
const R = s.option && s.option.globalClass || {};
|
|
1768
|
+
Object.keys(R).forEach((N) => {
|
|
1769
|
+
let me = "";
|
|
1770
|
+
R[N].style && Object.keys(R[N].style).forEach((z) => {
|
|
1771
|
+
me += be(z) + ":" + R[N].style[z] + ";";
|
|
1772
|
+
}), R[N].content && (me += R[N].content + ";"), me && (F += `.${N}{${me}}`);
|
|
1773
|
+
}), s.option && s.option.style && (F += s.option.style), I || (I = document.createElement("style"), I.type = "text/css", document.head.appendChild(I)), I.innerHTML = F || "";
|
|
1774
1774
|
}, () => {
|
|
1775
1775
|
});
|
|
1776
1776
|
});
|
|
1777
1777
|
const B = ne(() => {
|
|
1778
|
-
|
|
1779
|
-
}, 100),
|
|
1780
|
-
|
|
1778
|
+
m.bus.$emit("$loadData.$topForm");
|
|
1779
|
+
}, 100), de = ne(function() {
|
|
1780
|
+
m.bus.$emit("$loadData.$scopeForm");
|
|
1781
1781
|
}, 100), Le = ne(() => {
|
|
1782
|
-
|
|
1783
|
-
}, 100),
|
|
1784
|
-
|
|
1782
|
+
m.bus.$emit("$loadData.$form");
|
|
1783
|
+
}, 100), pe = (F) => {
|
|
1784
|
+
m.bus.$emit("change-$form." + F);
|
|
1785
1785
|
};
|
|
1786
1786
|
return mr(() => {
|
|
1787
|
-
o && (y.top.bus.$on("$loadData.$form", B), y.top.bus.$on("change",
|
|
1787
|
+
o && (y.top.bus.$on("$loadData.$form", B), y.top.bus.$on("change", pe)), y !== y.scope && y.scope.bus.$on("$loadData.$scopeForm", de), m.mounted();
|
|
1788
1788
|
}), gr(() => {
|
|
1789
|
-
o && (y.top.bus.$off("$loadData.$form", B), y.top.bus.$off("change",
|
|
1789
|
+
o && (y.top.bus.$off("$loadData.$form", B), y.top.bus.$off("change", pe)), y !== y.scope && y.scope.bus.$off("$loadData.$scopeForm", de), Y(), d.destroyed = !0, m.unmount(), I && (I.parentNode || I.parentElement) && document.head.removeChild(I);
|
|
1790
1790
|
}), yr(() => {
|
|
1791
|
-
|
|
1792
|
-
}), T(f, (
|
|
1793
|
-
|
|
1791
|
+
m.updated();
|
|
1792
|
+
}), T(f, (F) => {
|
|
1793
|
+
F ? E() : Y();
|
|
1794
1794
|
}, { immediate: !0 }), T(() => s.option, () => {
|
|
1795
|
-
|
|
1796
|
-
}, { deep: !0, flush: "sync" }), T(() => [...l.value], (
|
|
1797
|
-
|
|
1795
|
+
m.initOptions(), y.refresh();
|
|
1796
|
+
}, { deep: !0, flush: "sync" }), T(() => [...l.value], (F) => {
|
|
1797
|
+
m.$handle.isBreakWatch() || F.length === d.renderRule.length && F.every((R) => d.renderRule.indexOf(R) > -1) || (m.$handle.updateAppendData(), m.$handle.reloadRule(l.value), n.renderRule());
|
|
1798
1798
|
}), T(() => [s.disabled, s.preview], () => {
|
|
1799
1799
|
y.refresh();
|
|
1800
|
-
}), T(u, (
|
|
1801
|
-
Ce(
|
|
1800
|
+
}), T(u, (F) => {
|
|
1801
|
+
Ce(F || {}) !== d.updateValue && (y.config.forceCoverValue ? y.coverValue(F || {}) : y.setValue(F || {}));
|
|
1802
1802
|
}, { deep: !0, flush: "post" }), T(() => s.index, () => {
|
|
1803
|
-
y.coverValue({}),
|
|
1803
|
+
y.coverValue({}), m.$handle.updateAppendData(), V(() => {
|
|
1804
1804
|
V(() => {
|
|
1805
1805
|
y.clearValidateState();
|
|
1806
1806
|
});
|
|
1807
1807
|
});
|
|
1808
1808
|
}, { flush: "sync" }), q(_({
|
|
1809
|
-
fc:
|
|
1810
|
-
parent: o &&
|
|
1811
|
-
top:
|
|
1812
|
-
fapi:
|
|
1809
|
+
fc: ge(m),
|
|
1810
|
+
parent: o && ge(o),
|
|
1811
|
+
top: ge(a),
|
|
1812
|
+
fapi: ge(y)
|
|
1813
1813
|
}, ut(d)), {
|
|
1814
1814
|
getGroupInject: () => Ee(n, o),
|
|
1815
1815
|
refresh() {
|
|
@@ -1818,11 +1818,11 @@ function Qr(t, e, r) {
|
|
|
1818
1818
|
renderRule() {
|
|
1819
1819
|
d.renderRule = [...l.value || []];
|
|
1820
1820
|
},
|
|
1821
|
-
updateValue(
|
|
1821
|
+
updateValue(F) {
|
|
1822
1822
|
if (d.destroyed) return;
|
|
1823
|
-
const
|
|
1824
|
-
d.updateValue !==
|
|
1825
|
-
Le(), o ? f.value ||
|
|
1823
|
+
const R = Ce(F);
|
|
1824
|
+
d.updateValue !== R && (d.updateValue = R, n.$emit("update:value", F), V(() => {
|
|
1825
|
+
Le(), o ? f.value || de() : (B(), de());
|
|
1826
1826
|
}));
|
|
1827
1827
|
}
|
|
1828
1828
|
});
|
|
@@ -1858,7 +1858,7 @@ C(rt.prototype, {
|
|
|
1858
1858
|
return this._data;
|
|
1859
1859
|
},
|
|
1860
1860
|
setProp(t, e) {
|
|
1861
|
-
return
|
|
1861
|
+
return k(this._data, t, e), this;
|
|
1862
1862
|
},
|
|
1863
1863
|
_clone() {
|
|
1864
1864
|
const t = new this.constructor();
|
|
@@ -1958,7 +1958,7 @@ function ri(t) {
|
|
|
1958
1958
|
h.Undef(n) ? n = Object.keys(_(_({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
|
|
1959
1959
|
const u = t.fieldCtx[l] || t.nameCtx[l];
|
|
1960
1960
|
u && u.forEach((f) => {
|
|
1961
|
-
|
|
1961
|
+
k(f.rule, o, a), t.$render.clearCache(f);
|
|
1962
1962
|
});
|
|
1963
1963
|
});
|
|
1964
1964
|
}
|
|
@@ -2051,7 +2051,7 @@ function ri(t) {
|
|
|
2051
2051
|
if (l) {
|
|
2052
2052
|
const u = j(n, a);
|
|
2053
2053
|
l.forEach((f) => {
|
|
2054
|
-
|
|
2054
|
+
k(f.rule, "value", u ? n[a] : void 0);
|
|
2055
2055
|
}), delete o[a];
|
|
2056
2056
|
}
|
|
2057
2057
|
}), C(t.appendData, o);
|
|
@@ -2064,7 +2064,7 @@ function ri(t) {
|
|
|
2064
2064
|
const l = t.fieldCtx[a];
|
|
2065
2065
|
if (!l) return t.appendData[a] = o[a];
|
|
2066
2066
|
l.forEach((u) => {
|
|
2067
|
-
|
|
2067
|
+
k(u.rule, "value", o[a]);
|
|
2068
2068
|
});
|
|
2069
2069
|
});
|
|
2070
2070
|
}, !0);
|
|
@@ -2128,7 +2128,7 @@ function ri(t) {
|
|
|
2128
2128
|
disabled(n, o) {
|
|
2129
2129
|
e(o).forEach((a) => {
|
|
2130
2130
|
t.getCtxs(a).forEach((l) => {
|
|
2131
|
-
|
|
2131
|
+
k(l.rule.props, "disabled", !!n);
|
|
2132
2132
|
});
|
|
2133
2133
|
}), t.refresh();
|
|
2134
2134
|
},
|
|
@@ -2186,7 +2186,7 @@ function ri(t) {
|
|
|
2186
2186
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2187
2187
|
},
|
|
2188
2188
|
hideForm: (n) => {
|
|
2189
|
-
|
|
2189
|
+
k(t.vm, "isShow", !n);
|
|
2190
2190
|
},
|
|
2191
2191
|
changeStatus: () => t.changeStatus,
|
|
2192
2192
|
clearChangeStatus: () => {
|
|
@@ -2245,7 +2245,7 @@ function ri(t) {
|
|
|
2245
2245
|
},
|
|
2246
2246
|
setEffect(n, o, a) {
|
|
2247
2247
|
const l = t.getCtx(n);
|
|
2248
|
-
l && o && (o[0] === "$" && (o = o.substr(1)), j(l.rule, "$" + o) &&
|
|
2248
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), j(l.rule, "$" + o) && k(l.rule, "$" + o, a), j(l.rule, "effect") || k(l.rule, "effect", {}), k(l.rule.effect, o, a));
|
|
2249
2249
|
},
|
|
2250
2250
|
clearEffectData(n, o) {
|
|
2251
2251
|
const a = t.getCtx(n);
|
|
@@ -2332,7 +2332,7 @@ function ri(t) {
|
|
|
2332
2332
|
const l = s.getChildrenRuleList(n);
|
|
2333
2333
|
t.deferSyncValue(() => {
|
|
2334
2334
|
l.forEach((u) => {
|
|
2335
|
-
j(o, u.field) ?
|
|
2335
|
+
j(o, u.field) ? k(u, "value", o[u.field]) : a && k(u, "value", void 0);
|
|
2336
2336
|
});
|
|
2337
2337
|
});
|
|
2338
2338
|
},
|
|
@@ -2349,6 +2349,13 @@ function ri(t) {
|
|
|
2349
2349
|
}).catch(a) : o(l.data) : o(t.fc.loadData[n]);
|
|
2350
2350
|
});
|
|
2351
2351
|
},
|
|
2352
|
+
emitGlobalEvent(n, ...o) {
|
|
2353
|
+
const a = s.getGlobalEvent(n);
|
|
2354
|
+
if (a) {
|
|
2355
|
+
const l = t.getInjectData({}, void 0);
|
|
2356
|
+
return l.args = [...o], o.unshift(l), a.apply(null, o);
|
|
2357
|
+
}
|
|
2358
|
+
},
|
|
2352
2359
|
setGlobalData(n, o) {
|
|
2353
2360
|
s.setData("$globalData." + n, o);
|
|
2354
2361
|
},
|
|
@@ -2382,22 +2389,32 @@ function ri(t) {
|
|
|
2382
2389
|
},
|
|
2383
2390
|
fetch(n) {
|
|
2384
2391
|
return new Promise((o, a) => {
|
|
2385
|
-
n = G(n), n = t.loadFetchVar(n)
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2392
|
+
n = G(n), n = t.loadFetchVar(n);
|
|
2393
|
+
const l = (u) => {
|
|
2394
|
+
O(() => n.onError && n.onError(u)), a(u);
|
|
2395
|
+
};
|
|
2396
|
+
t.beforeFetch(n).then(() => yt(n, t.fc.create.fetch, s).then((u) => {
|
|
2397
|
+
O(() => n.onSuccess && n.onSuccess(u)), o(u);
|
|
2398
|
+
}).catch((u) => {
|
|
2399
|
+
l(u);
|
|
2400
|
+
})).catch((u) => {
|
|
2401
|
+
l(u);
|
|
2390
2402
|
});
|
|
2391
2403
|
});
|
|
2392
2404
|
},
|
|
2393
2405
|
watchFetch(n, o, a, l) {
|
|
2394
2406
|
return t.fc.watchLoadData((u, f) => {
|
|
2395
2407
|
let p = G(n);
|
|
2396
|
-
p = t.loadFetchVar(p, u)
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2408
|
+
p = t.loadFetchVar(p, u);
|
|
2409
|
+
const d = (m) => {
|
|
2410
|
+
O(() => p.onError && p.onError(m)), a && a(m);
|
|
2411
|
+
};
|
|
2412
|
+
l && l(p, f) === !1 || t.beforeFetch(p).then(() => yt(p, t.fc.create.fetch, s).then((m) => {
|
|
2413
|
+
O(() => p.onSuccess && p.onSuccess(m)), o && o(m, f);
|
|
2414
|
+
}).catch((m) => {
|
|
2415
|
+
d(m);
|
|
2416
|
+
})).catch((m) => {
|
|
2417
|
+
d(m);
|
|
2401
2418
|
});
|
|
2402
2419
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2403
2420
|
},
|
|
@@ -2477,7 +2494,7 @@ function ni(t) {
|
|
|
2477
2494
|
const r = (i) => {
|
|
2478
2495
|
if (i) {
|
|
2479
2496
|
let s;
|
|
2480
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2497
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + be(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + be(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2481
2498
|
}
|
|
2482
2499
|
};
|
|
2483
2500
|
return r(this.vm);
|
|
@@ -2497,7 +2514,7 @@ function ni(t) {
|
|
|
2497
2514
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2498
2515
|
},
|
|
2499
2516
|
mergeGlobal(e) {
|
|
2500
|
-
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] =
|
|
2517
|
+
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = ye(() => {
|
|
2501
2518
|
const i = this.$handle.options.global;
|
|
2502
2519
|
return Q({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2503
2520
|
})), e.prop = Q({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
@@ -2562,8 +2579,8 @@ function ni(t) {
|
|
|
2562
2579
|
})()));
|
|
2563
2580
|
});
|
|
2564
2581
|
const d = this.getTypeSlot(e);
|
|
2565
|
-
let
|
|
2566
|
-
return d ? (u.children = f,
|
|
2582
|
+
let m;
|
|
2583
|
+
return d ? (u.children = f, m = d(u)) : m = a ? e.parser.preview(We(f), e) : e.parser.render(We(f), e), m = this.renderSides(m, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), m = this.$manager.makeWrap(e, m)), e.none && (Array.isArray(m) ? m = m.map((y) => !y || !y.tag ? y : this.none(y)) : m = this.none(m)), o && this.setCache(e, () => this.stable(m), r), m;
|
|
2567
2584
|
}, this.setCache(e, s, r);
|
|
2568
2585
|
}
|
|
2569
2586
|
return (...s) => {
|
|
@@ -2605,7 +2622,7 @@ function ni(t) {
|
|
|
2605
2622
|
},
|
|
2606
2623
|
injectProp(e) {
|
|
2607
2624
|
const r = this.vm;
|
|
2608
|
-
r.ctxInject[e.id] ||
|
|
2625
|
+
r.ctxInject[e.id] || k(r.ctxInject, e.id, {
|
|
2609
2626
|
api: this.$handle.api,
|
|
2610
2627
|
form: this.fc.create,
|
|
2611
2628
|
subForm: (n) => {
|
|
@@ -2636,7 +2653,7 @@ function ni(t) {
|
|
|
2636
2653
|
children: e.loadChildrenPending()
|
|
2637
2654
|
};
|
|
2638
2655
|
return Object.keys(s).forEach((n) => {
|
|
2639
|
-
|
|
2656
|
+
k(i, n, s[n]);
|
|
2640
2657
|
}), i;
|
|
2641
2658
|
},
|
|
2642
2659
|
ctxProp(e) {
|
|
@@ -2647,7 +2664,7 @@ function ni(t) {
|
|
|
2647
2664
|
if (l.indexOf("native.") === 0)
|
|
2648
2665
|
o[l.replace("native.", "")] = n[l], delete n[l];
|
|
2649
2666
|
else if (this.$handle.options.transformEventName !== !1) {
|
|
2650
|
-
const u =
|
|
2667
|
+
const u = be(l);
|
|
2651
2668
|
u !== l.toLowerCase() && !n[u] && (n[u] = n[l]);
|
|
2652
2669
|
}
|
|
2653
2670
|
}), e.prop.on = n;
|
|
@@ -2706,10 +2723,10 @@ function ni(t) {
|
|
|
2706
2723
|
const s = Se();
|
|
2707
2724
|
return e.map((n) => {
|
|
2708
2725
|
if (n) {
|
|
2709
|
-
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
2726
|
+
if (h.String(n) || h.Number(n)) return s.setSlot(null, i ? this.renderRule({
|
|
2710
2727
|
type: "template",
|
|
2711
|
-
children: [n]
|
|
2712
|
-
}) : n);
|
|
2728
|
+
children: [`${n}`]
|
|
2729
|
+
}) : `${n}`);
|
|
2713
2730
|
if (n.__fc__)
|
|
2714
2731
|
return this.renderSlot(s, n.__fc__, r);
|
|
2715
2732
|
n.type && V(() => {
|
|
@@ -2734,7 +2751,7 @@ function ni(t) {
|
|
|
2734
2751
|
},
|
|
2735
2752
|
renderRule(e, r, i) {
|
|
2736
2753
|
if (!e) return;
|
|
2737
|
-
if (h.String(e)) return e
|
|
2754
|
+
if (h.String(e) || h.Number(e)) return `${e}`;
|
|
2738
2755
|
let s;
|
|
2739
2756
|
if (i)
|
|
2740
2757
|
s = e.type;
|
|
@@ -2805,8 +2822,8 @@ function oi(t) {
|
|
|
2805
2822
|
let p, d = n || o || a;
|
|
2806
2823
|
if (h.Object(f) && (p = f.inject, f = f.name, d = f.prefix || d), d) {
|
|
2807
2824
|
r || (d = `native-${d}`);
|
|
2808
|
-
const
|
|
2809
|
-
this.vm.$emit(
|
|
2825
|
+
const m = be(`${d}-${f}`), y = (...v) => {
|
|
2826
|
+
this.vm.$emit(m, ...v), this.vm.$emit("emit-event", m, ...v), this.bus.$emit(m, ...v);
|
|
2810
2827
|
};
|
|
2811
2828
|
if (y.__emit = !0, !p && l === !1)
|
|
2812
2829
|
i[f] = y;
|
|
@@ -2858,16 +2875,16 @@ function oi(t) {
|
|
|
2858
2875
|
d.key ? f.push(d.key) : d.children && f.push(a(d.children));
|
|
2859
2876
|
});
|
|
2860
2877
|
let p = !1;
|
|
2861
|
-
return f.forEach((d,
|
|
2862
|
-
d != null && (d.indexOf("'") === 0 || d.indexOf('"') === 0) && (f[
|
|
2878
|
+
return f.forEach((d, m) => {
|
|
2879
|
+
d != null && (d.indexOf("'") === 0 || d.indexOf('"') === 0) && (f[m] = d.slice(1, -1), p = !0);
|
|
2863
2880
|
}), f.length === 1 && (p || !isNaN(Number(f[0]))) ? f[0] : o(f.join("."));
|
|
2864
2881
|
};
|
|
2865
2882
|
let l;
|
|
2866
2883
|
if (n.forEach((u) => {
|
|
2867
2884
|
const f = u.split("||"), p = f[0].trim();
|
|
2868
2885
|
if (p) {
|
|
2869
|
-
const d = (f[1] || "").trim(),
|
|
2870
|
-
let y = O(() => a(
|
|
2886
|
+
const d = (f[1] || "").trim(), m = Mt(p);
|
|
2887
|
+
let y = O(() => a(m));
|
|
2871
2888
|
(y == null || y === "") && f.length > 1 && (y = d), l = y, e = e.replaceAll(`{{${u}}}`, y == null ? "" : y);
|
|
2872
2889
|
}
|
|
2873
2890
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
@@ -2931,9 +2948,9 @@ function ui(t) {
|
|
|
2931
2948
|
}
|
|
2932
2949
|
function fi(t) {
|
|
2933
2950
|
Object.defineProperties(t.origin, {
|
|
2934
|
-
__fc__: Ze(
|
|
2951
|
+
__fc__: Ze(ge(t), !0)
|
|
2935
2952
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2936
|
-
__fc__: Ze(
|
|
2953
|
+
__fc__: Ze(ge(t), !0)
|
|
2937
2954
|
});
|
|
2938
2955
|
}
|
|
2939
2956
|
function Jt(t, e, r) {
|
|
@@ -3180,9 +3197,9 @@ function ci(t) {
|
|
|
3180
3197
|
let l = ht(o);
|
|
3181
3198
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3182
3199
|
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);
|
|
3183
|
-
let f, p = !1, d = !!o.__fc__,
|
|
3200
|
+
let f, p = !1, d = !!o.__fc__, m = l.value;
|
|
3184
3201
|
if (d) {
|
|
3185
|
-
if (f = o.__fc__,
|
|
3202
|
+
if (f = o.__fc__, m = f.defaultValue, f.deleted) {
|
|
3186
3203
|
if (bt(f))
|
|
3187
3204
|
return;
|
|
3188
3205
|
f.update(this);
|
|
@@ -3196,7 +3213,7 @@ function ci(t) {
|
|
|
3196
3213
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3197
3214
|
else {
|
|
3198
3215
|
const E = this.parseRule(o);
|
|
3199
|
-
f = new Jt(this, E,
|
|
3216
|
+
f = new Jt(this, E, m), this.bindParser(f);
|
|
3200
3217
|
}
|
|
3201
3218
|
[!1, !0].forEach((E) => this.parseEmit(f, E)), 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");
|
|
3202
3219
|
const y = f.loadChildrenPending();
|
|
@@ -3219,7 +3236,7 @@ function ci(t) {
|
|
|
3219
3236
|
if (!r.length) return !1;
|
|
3220
3237
|
for (let a = 0; a < r.length; a++) {
|
|
3221
3238
|
const l = r[a], u = l.handle || function(p) {
|
|
3222
|
-
return (
|
|
3239
|
+
return (he[l.condition || "=="] || he["=="])(p, l.value);
|
|
3223
3240
|
};
|
|
3224
3241
|
if (!h.trueArray(l.rule)) continue;
|
|
3225
3242
|
const f = q(_({}, l), {
|
|
@@ -3233,13 +3250,13 @@ function ci(t) {
|
|
|
3233
3250
|
const n = [];
|
|
3234
3251
|
let o = !1;
|
|
3235
3252
|
return this.deferSyncValue(() => {
|
|
3236
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl:
|
|
3253
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl: m, method: y }) => {
|
|
3237
3254
|
if (a) {
|
|
3238
3255
|
l ? e.ctrlRule.push({
|
|
3239
3256
|
__ctrl: !0,
|
|
3240
3257
|
children: u,
|
|
3241
3258
|
valid: l
|
|
3242
|
-
}) :
|
|
3259
|
+
}) : m && e.ctrlRule.splice(e.ctrlRule.indexOf(m) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3243
3260
|
y === "disabled" || y === "enabled" ? this.api.disabled(!l, u) : y === "display" || y === "show" ? this.api.display(l, u) : y === "required" ? (u.forEach((v) => {
|
|
3244
3261
|
this.api.setEffect(v, "required", l);
|
|
3245
3262
|
}), l || this.api.clearValidateState(u)) : y === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
@@ -3258,8 +3275,8 @@ function ci(t) {
|
|
|
3258
3275
|
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);
|
|
3259
3276
|
});
|
|
3260
3277
|
} else {
|
|
3261
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3262
|
-
const v = Z(
|
|
3278
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3279
|
+
const v = Z(m);
|
|
3263
3280
|
v && v.rm();
|
|
3264
3281
|
}
|
|
3265
3282
|
});
|
|
@@ -3290,7 +3307,7 @@ function ci(t) {
|
|
|
3290
3307
|
function hi(t) {
|
|
3291
3308
|
const e = qt();
|
|
3292
3309
|
return Object.keys(e).forEach((r) => {
|
|
3293
|
-
j(t, r) ||
|
|
3310
|
+
j(t, r) || k(t, r, e[r]);
|
|
3294
3311
|
}), t;
|
|
3295
3312
|
}
|
|
3296
3313
|
function di(t) {
|
|
@@ -3340,7 +3357,7 @@ function mi(t) {
|
|
|
3340
3357
|
setFormData(e, r) {
|
|
3341
3358
|
e.modelValue = r;
|
|
3342
3359
|
const i = e.getParentGroup();
|
|
3343
|
-
i && (this.subRuleData[i.id] ||
|
|
3360
|
+
i && (this.subRuleData[i.id] || k(this.subRuleData, i.id, {}), k(this.subRuleData[i.id], e.field, e.rule.value)), k(this.formData, e.id, r);
|
|
3344
3361
|
},
|
|
3345
3362
|
rmSubRuleData(e) {
|
|
3346
3363
|
const r = e.getParentGroup();
|
|
@@ -3494,7 +3511,7 @@ function yi(t) {
|
|
|
3494
3511
|
this.targetHook(e, "watch", { key: i, oldValue: a, newValue: l });
|
|
3495
3512
|
}), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(), V(() => {
|
|
3496
3513
|
this.targetHook(e, "hidden", { value: l });
|
|
3497
|
-
})), i === "ignore" && e.input || i === "hidden" &&
|
|
3514
|
+
})), i === "ignore" && e.input || i === "hidden" && (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields))
|
|
3498
3515
|
this.syncForm();
|
|
3499
3516
|
else if (i === "link") {
|
|
3500
3517
|
e.link();
|
|
@@ -3503,21 +3520,21 @@ function yi(t) {
|
|
|
3503
3520
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3504
3521
|
}
|
|
3505
3522
|
}, { deep: !n, sync: n }));
|
|
3506
|
-
}), e.refRule.__$title =
|
|
3523
|
+
}), e.refRule.__$title = ye(() => {
|
|
3507
3524
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3508
3525
|
if (i) {
|
|
3509
3526
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3510
3527
|
s && (i = this.api.t(s[1]));
|
|
3511
3528
|
}
|
|
3512
3529
|
return i;
|
|
3513
|
-
}), e.refRule.__$info =
|
|
3530
|
+
}), e.refRule.__$info = ye(() => {
|
|
3514
3531
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3515
3532
|
if (i) {
|
|
3516
3533
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3517
3534
|
s && (i = this.api.t(s[1]));
|
|
3518
3535
|
}
|
|
3519
3536
|
return i;
|
|
3520
|
-
}), e.refRule.__$validate =
|
|
3537
|
+
}), e.refRule.__$validate = ye(() => {
|
|
3521
3538
|
const i = (s) => {
|
|
3522
3539
|
var o, a;
|
|
3523
3540
|
const n = s.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
@@ -3558,7 +3575,7 @@ function yi(t) {
|
|
|
3558
3575
|
this.bus.$once("load-end", () => {
|
|
3559
3576
|
let i = e.rule.computed;
|
|
3560
3577
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3561
|
-
const n =
|
|
3578
|
+
const n = ye(() => {
|
|
3562
3579
|
const a = i[s];
|
|
3563
3580
|
if (!a) return;
|
|
3564
3581
|
const l = this.compute(e, a);
|
|
@@ -3697,17 +3714,15 @@ function yi(t) {
|
|
|
3697
3714
|
let u = !0;
|
|
3698
3715
|
for (let f = 0; f < a.group.length; f++) {
|
|
3699
3716
|
const p = a.group[f];
|
|
3700
|
-
let d,
|
|
3717
|
+
let d, m = null, y = null;
|
|
3701
3718
|
if (p.variable)
|
|
3702
3719
|
y = this.fc.getLoadData(p.variable);
|
|
3703
3720
|
else if (p.field)
|
|
3704
|
-
|
|
3721
|
+
m = pt(p.field || "");
|
|
3705
3722
|
else if (!p.mode)
|
|
3706
3723
|
return !0;
|
|
3707
|
-
if (!p.variable && !p.field)
|
|
3708
|
-
return !1;
|
|
3709
3724
|
let v = p.compare;
|
|
3710
|
-
if (v && (v = pt(v || "")), p.mode ? d = n(p) :
|
|
3725
|
+
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, y, p.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : d = !1, l && d)
|
|
3711
3726
|
return !0;
|
|
3712
3727
|
l || (u = u && d);
|
|
3713
3728
|
}
|
|
@@ -3786,12 +3801,13 @@ function $i(t) {
|
|
|
3786
3801
|
},
|
|
3787
3802
|
targetHook(e, r, i) {
|
|
3788
3803
|
var l, u, f, p;
|
|
3789
|
-
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d,
|
|
3804
|
+
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d, m) => {
|
|
3790
3805
|
d && (d = Array.isArray(d) ? d : [d], d.forEach((y) => {
|
|
3791
3806
|
O(() => y(q(_({}, i || {}), {
|
|
3807
|
+
args: Object.values(i),
|
|
3792
3808
|
self: e.rule,
|
|
3793
3809
|
rule: e.rule,
|
|
3794
|
-
parent:
|
|
3810
|
+
parent: m == null ? void 0 : m.rule,
|
|
3795
3811
|
$f: this.api,
|
|
3796
3812
|
api: this.api,
|
|
3797
3813
|
option: this.vm.$props.option
|
|
@@ -3878,7 +3894,7 @@ function bi(t) {
|
|
|
3878
3894
|
else
|
|
3879
3895
|
return;
|
|
3880
3896
|
const d = _({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3881
|
-
e && (d.getProp = () => e.effectData(u), d.clearProp = () => e.clearEffectData(u), d.mergeProp = (
|
|
3897
|
+
e && (d.getProp = () => e.effectData(u), d.clearProp = () => e.clearEffectData(u), d.mergeProp = (m) => Q(d.getProp(), [m]), d.id = e.id), this.bus.$emit(`p:${u}:${p}:${f.input ? 1 : 0}`, o, [d, r, this.api]);
|
|
3882
3898
|
});
|
|
3883
3899
|
}
|
|
3884
3900
|
});
|
|
@@ -4003,7 +4019,7 @@ function Oi() {
|
|
|
4003
4019
|
},
|
|
4004
4020
|
make(r, i, s) {
|
|
4005
4021
|
var n, o, a;
|
|
4006
|
-
return (
|
|
4022
|
+
return ($e.isReservedTag ? $e.isReservedTag(r) : (o = (n = $e) == null ? void 0 : n.config) != null && o.isReservedTag(r)) && (i == null || delete i.nativeOn, (a = i == null ? void 0 : i.props) == null || delete a.formCreateInject), this.makeComponent(r, i, s);
|
|
4007
4023
|
},
|
|
4008
4024
|
makeComponent(r, i, s) {
|
|
4009
4025
|
var a;
|
|
@@ -4026,7 +4042,7 @@ function Oi() {
|
|
|
4026
4042
|
},
|
|
4027
4043
|
use(r) {
|
|
4028
4044
|
Object.keys(r).forEach((i) => {
|
|
4029
|
-
const s =
|
|
4045
|
+
const s = be(i), n = Tr(i).toLocaleLowerCase(), o = r[i];
|
|
4030
4046
|
e.alias(i, o), [i, s, n].forEach((a) => {
|
|
4031
4047
|
e.prototype[a] = function(l, u) {
|
|
4032
4048
|
return this.make(t[i] || a, l, u);
|
|
@@ -4036,7 +4052,7 @@ function Oi() {
|
|
|
4036
4052
|
}
|
|
4037
4053
|
}), e;
|
|
4038
4054
|
}
|
|
4039
|
-
function
|
|
4055
|
+
function ki(t) {
|
|
4040
4056
|
class e extends Wt {
|
|
4041
4057
|
}
|
|
4042
4058
|
return Object.assign(e.prototype, t), e;
|
|
@@ -4102,7 +4118,7 @@ C(Wt.prototype, {
|
|
|
4102
4118
|
render(t) {
|
|
4103
4119
|
}
|
|
4104
4120
|
});
|
|
4105
|
-
const
|
|
4121
|
+
const Fi = function(t) {
|
|
4106
4122
|
const e = {
|
|
4107
4123
|
name: "loadData",
|
|
4108
4124
|
_fn: [],
|
|
@@ -4115,10 +4131,10 @@ const ki = function(t) {
|
|
|
4115
4131
|
let l = (p) => {
|
|
4116
4132
|
let d;
|
|
4117
4133
|
i && i.__fc__ && (d = i.__fc__.getParentGroup());
|
|
4118
|
-
let
|
|
4119
|
-
a.template ?
|
|
4134
|
+
let m;
|
|
4135
|
+
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 = G(m));
|
|
4120
4136
|
const y = a.modify ? i : r.getProp();
|
|
4121
|
-
a.to === "child" ? y.children ?
|
|
4137
|
+
a.to === "child" ? y.children ? k(y.children, 0, m) : k(y, "children", [m]) : se(y, a.to || "options", m), s.sync(i);
|
|
4122
4138
|
}, u = (p) => l(p);
|
|
4123
4139
|
const f = t.watchLoadData(u);
|
|
4124
4140
|
l = ne(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
@@ -4145,11 +4161,11 @@ const ki = function(t) {
|
|
|
4145
4161
|
const l = n[a];
|
|
4146
4162
|
if (l) {
|
|
4147
4163
|
const u = typeof l == "object";
|
|
4148
|
-
let f = (
|
|
4149
|
-
let y = t.t(u ? l.attr : l, u ? l.params : null,
|
|
4164
|
+
let f = (m) => {
|
|
4165
|
+
let y = t.t(u ? l.attr : l, u ? l.params : null, m);
|
|
4150
4166
|
const v = u && l.modify ? i : r.getProp();
|
|
4151
|
-
a === "child" ? v.children ?
|
|
4152
|
-
}, p = (
|
|
4167
|
+
a === "child" ? v.children ? k(v.children, 0, y) : k(v, "children", [y]) : se(v, a, y), s.sync(i);
|
|
4168
|
+
}, p = (m) => f(m);
|
|
4153
4169
|
const d = t.watchLoadData(p);
|
|
4154
4170
|
f = ne(f, l.wait || 300), l.watch !== !1 ? o.push(d) : d();
|
|
4155
4171
|
}
|
|
@@ -4223,24 +4239,24 @@ const ki = function(t) {
|
|
|
4223
4239
|
i._fn[s.id] = t.watchLoadData(ne((p, d) => {
|
|
4224
4240
|
if (d && a.watch === !1)
|
|
4225
4241
|
return i._fn[s.id]();
|
|
4226
|
-
const
|
|
4242
|
+
const m = t.$handle.loadFetchVar(G(a), p, n), y = q(_({
|
|
4227
4243
|
headers: {}
|
|
4228
|
-
},
|
|
4244
|
+
}, m), {
|
|
4229
4245
|
onSuccess(v, E) {
|
|
4230
4246
|
if (f()) return;
|
|
4231
4247
|
let Y = (B) => E ? B : j(B, "data") ? B.data : B;
|
|
4232
|
-
const I = W(
|
|
4248
|
+
const I = W(m.parse);
|
|
4233
4249
|
h.Function(I) ? Y = I : I && h.String(I) && (Y = (B) => L(B, I)), Ae(Y(v, n, o)).then((B) => {
|
|
4234
4250
|
l(B);
|
|
4235
4251
|
});
|
|
4236
4252
|
},
|
|
4237
4253
|
onError(v) {
|
|
4238
|
-
l(void 0), !f() && (u || ((E) => Ye(E.message || "fetch fail " +
|
|
4254
|
+
l(void 0), !f() && (u || ((E) => Ye(E.message || "fetch fail " + m.action)))(v, n, o);
|
|
4239
4255
|
}
|
|
4240
4256
|
});
|
|
4241
4257
|
t.$handle.beforeFetch(y, { rule: n, api: o }).then(() => {
|
|
4242
|
-
if (h.Function(
|
|
4243
|
-
Ae(
|
|
4258
|
+
if (h.Function(m.action)) {
|
|
4259
|
+
Ae(m.action(n, o)).then((v) => {
|
|
4244
4260
|
y.onSuccess(v, !0);
|
|
4245
4261
|
}).catch((v) => {
|
|
4246
4262
|
y.onError(v);
|
|
@@ -4268,7 +4284,7 @@ const ki = function(t) {
|
|
|
4268
4284
|
return i;
|
|
4269
4285
|
}, Ei = {
|
|
4270
4286
|
fetch: Ri,
|
|
4271
|
-
loadData:
|
|
4287
|
+
loadData: Fi,
|
|
4272
4288
|
t: Si,
|
|
4273
4289
|
componentValidate: Kt
|
|
4274
4290
|
};
|
|
@@ -4444,16 +4460,16 @@ function Xt(t) {
|
|
|
4444
4460
|
t.extendApi
|
|
4445
4461
|
], u = _({}, Ei), f = ei();
|
|
4446
4462
|
let p = { global: {} };
|
|
4447
|
-
const d = t.isMobile === !0,
|
|
4463
|
+
const d = t.isMobile === !0, m = ie({
|
|
4448
4464
|
$mobile: d
|
|
4449
4465
|
}), y = Oi(), v = {}, E = {};
|
|
4450
4466
|
Gi(t.attrs || {});
|
|
4451
4467
|
function Y(c) {
|
|
4452
|
-
const
|
|
4453
|
-
if (Array.isArray(
|
|
4454
|
-
return
|
|
4455
|
-
if (
|
|
4456
|
-
return
|
|
4468
|
+
const g = M[c];
|
|
4469
|
+
if (Array.isArray(g))
|
|
4470
|
+
return g.map(($) => $.api());
|
|
4471
|
+
if (g)
|
|
4472
|
+
return g.api();
|
|
4457
4473
|
}
|
|
4458
4474
|
function I(c) {
|
|
4459
4475
|
o.push(c);
|
|
@@ -4462,7 +4478,7 @@ function Xt(t) {
|
|
|
4462
4478
|
const c = qe(...arguments);
|
|
4463
4479
|
c.id && c.prop && (i[c.id] = c.prop);
|
|
4464
4480
|
}
|
|
4465
|
-
function
|
|
4481
|
+
function de() {
|
|
4466
4482
|
const c = qe(...arguments);
|
|
4467
4483
|
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(_({}, c.prop), {
|
|
4468
4484
|
name: c.id
|
|
@@ -4471,41 +4487,41 @@ function Xt(t) {
|
|
|
4471
4487
|
function Le(c) {
|
|
4472
4488
|
y.use(c);
|
|
4473
4489
|
}
|
|
4474
|
-
function
|
|
4490
|
+
function pe() {
|
|
4475
4491
|
const c = qe(...arguments);
|
|
4476
4492
|
if (!c.id || !c.prop) return je;
|
|
4477
|
-
const
|
|
4478
|
-
r[
|
|
4493
|
+
const g = U(c.id), $ = c.prop, b = $.merge === !0 ? r[g] : void 0;
|
|
4494
|
+
r[g] = Re($, b || je), f[g] = P(g), $.maker && C(f, $.maker);
|
|
4479
4495
|
}
|
|
4480
|
-
function
|
|
4496
|
+
function F(c, g) {
|
|
4481
4497
|
let $;
|
|
4482
4498
|
if (h.String(c)) {
|
|
4483
|
-
if ($ = c,
|
|
4484
|
-
return ["form-create", "formcreate"].indexOf($) > -1 ?
|
|
4499
|
+
if ($ = c, g === void 0)
|
|
4500
|
+
return ["form-create", "formcreate"].indexOf($) > -1 ? R() : e[$];
|
|
4485
4501
|
} else
|
|
4486
|
-
$ = U(c.name),
|
|
4487
|
-
if (!$ || !
|
|
4502
|
+
$ = U(c.name), g = c;
|
|
4503
|
+
if (!$ || !g) return;
|
|
4488
4504
|
const b = U($);
|
|
4489
|
-
e[$] =
|
|
4505
|
+
e[$] = g, e[b] = g, delete y.aliasMap[$], delete y.aliasMap[b], delete r[$], delete r[b], g.formCreateParser && pe($, g.formCreateParser);
|
|
4490
4506
|
}
|
|
4491
|
-
function
|
|
4507
|
+
function R() {
|
|
4492
4508
|
return Qr(Te, e, i);
|
|
4493
4509
|
}
|
|
4494
4510
|
function N() {
|
|
4495
4511
|
return Me;
|
|
4496
4512
|
}
|
|
4497
|
-
function
|
|
4498
|
-
return h.Function(c.install) ? c.install(z,
|
|
4513
|
+
function me(c, g) {
|
|
4514
|
+
return h.Function(c.install) ? c.install(z, g) : h.Function(c) && c(z, g), this;
|
|
4499
4515
|
}
|
|
4500
|
-
function z(c,
|
|
4501
|
-
let b = Ui(c,
|
|
4516
|
+
function z(c, g, $) {
|
|
4517
|
+
let b = Ui(c, g || {});
|
|
4502
4518
|
const w = b.$refs.fc.formCreate;
|
|
4503
4519
|
return w.$parent = $, qi(w.options).appendChild(b.$el), w.api();
|
|
4504
4520
|
}
|
|
4505
4521
|
Re(z, E);
|
|
4506
4522
|
function xt(c) {
|
|
4507
|
-
let
|
|
4508
|
-
return c ?
|
|
4523
|
+
let g = _({}, t);
|
|
4524
|
+
return c ? g.inherit = {
|
|
4509
4525
|
components: e,
|
|
4510
4526
|
parsers: r,
|
|
4511
4527
|
directives: i,
|
|
@@ -4514,60 +4530,60 @@ function Xt(t) {
|
|
|
4514
4530
|
useApps: o,
|
|
4515
4531
|
maker: f,
|
|
4516
4532
|
formulas: v,
|
|
4517
|
-
loadData:
|
|
4518
|
-
} : delete
|
|
4533
|
+
loadData: m
|
|
4534
|
+
} : delete g.inherit, Xt(g);
|
|
4519
4535
|
}
|
|
4520
|
-
function Qt(c,
|
|
4521
|
-
s[c] =
|
|
4536
|
+
function Qt(c, g) {
|
|
4537
|
+
s[c] = g;
|
|
4522
4538
|
}
|
|
4523
|
-
function Yt(c,
|
|
4524
|
-
v[c] =
|
|
4539
|
+
function Yt(c, g) {
|
|
4540
|
+
v[c] = g;
|
|
4525
4541
|
}
|
|
4526
|
-
function er(c,
|
|
4542
|
+
function er(c, g) {
|
|
4527
4543
|
const $ = n[c] || {}, b = $.parsers || {};
|
|
4528
|
-
|
|
4529
|
-
b[w] = Re(
|
|
4530
|
-
}),
|
|
4544
|
+
g.parsers && Object.keys(g.parsers).forEach((w) => {
|
|
4545
|
+
b[w] = Re(g.parsers[w], je);
|
|
4546
|
+
}), g.name = c, n[c] = q(_(_({}, $), g), { parsers: b });
|
|
4531
4547
|
}
|
|
4532
4548
|
function Oe(c) {
|
|
4533
|
-
c && Object.keys(M).forEach((
|
|
4534
|
-
(Array.isArray(M[
|
|
4549
|
+
c && Object.keys(M).forEach((g) => {
|
|
4550
|
+
(Array.isArray(M[g]) ? M[g] : [M[g]]).forEach((b) => {
|
|
4535
4551
|
b.bus.$emit("$loadData." + c);
|
|
4536
4552
|
});
|
|
4537
4553
|
});
|
|
4538
4554
|
}
|
|
4539
|
-
function Be(c,
|
|
4540
|
-
se(
|
|
4555
|
+
function Be(c, g) {
|
|
4556
|
+
se(m, c, g), Oe(c);
|
|
4541
4557
|
}
|
|
4542
|
-
function
|
|
4543
|
-
const $ = (...b) => O(() =>
|
|
4558
|
+
function ke(c, g) {
|
|
4559
|
+
const $ = (...b) => O(() => g(...b));
|
|
4544
4560
|
$._driver = !0, Be(c, $);
|
|
4545
4561
|
}
|
|
4546
|
-
function st(c,
|
|
4562
|
+
function st(c, g) {
|
|
4547
4563
|
const $ = (c || "").split(".");
|
|
4548
4564
|
c = $.shift();
|
|
4549
4565
|
const b = $.join(".");
|
|
4550
|
-
if (j(
|
|
4551
|
-
let w =
|
|
4552
|
-
return w && w._driver ? w = w(b) : $.length && (w = L(w, $)), w == null || w === "" ?
|
|
4566
|
+
if (j(m, c) || k(m, c, _t), m[c] !== _t) {
|
|
4567
|
+
let w = m[c];
|
|
4568
|
+
return w && w._driver ? w = w(b) : $.length && (w = L(w, $)), w == null || w === "" ? g : w;
|
|
4553
4569
|
} else
|
|
4554
|
-
return
|
|
4570
|
+
return g;
|
|
4555
4571
|
}
|
|
4556
4572
|
function tr(c) {
|
|
4557
4573
|
l.push(c);
|
|
4558
4574
|
}
|
|
4559
4575
|
function rr(c) {
|
|
4560
|
-
delete
|
|
4576
|
+
delete m[c], Oe(c);
|
|
4561
4577
|
}
|
|
4562
|
-
function ir(c,
|
|
4563
|
-
a.push({ name: c, callback:
|
|
4578
|
+
function ir(c, g) {
|
|
4579
|
+
a.push({ name: c, callback: g });
|
|
4564
4580
|
}
|
|
4565
4581
|
function Te(c) {
|
|
4566
4582
|
C(this, {
|
|
4567
4583
|
id: Hi++,
|
|
4568
4584
|
create: z,
|
|
4569
4585
|
vm: c,
|
|
4570
|
-
manager:
|
|
4586
|
+
manager: ki(t.manager),
|
|
4571
4587
|
parsers: r,
|
|
4572
4588
|
providers: u,
|
|
4573
4589
|
modelFields: s,
|
|
@@ -4584,7 +4600,7 @@ function Xt(t) {
|
|
|
4584
4600
|
drivers: n,
|
|
4585
4601
|
renderDriver: null,
|
|
4586
4602
|
refreshData: Oe,
|
|
4587
|
-
loadData:
|
|
4603
|
+
loadData: m,
|
|
4588
4604
|
CreateNode: y,
|
|
4589
4605
|
bus: new ji(),
|
|
4590
4606
|
unwatch: [],
|
|
@@ -4592,8 +4608,8 @@ function Xt(t) {
|
|
|
4592
4608
|
extendApiFn: l,
|
|
4593
4609
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4594
4610
|
tmpData: ie({})
|
|
4595
|
-
}), a.forEach((
|
|
4596
|
-
this.bus.$on(
|
|
4611
|
+
}), a.forEach((g) => {
|
|
4612
|
+
this.bus.$on(g.name, g.callback);
|
|
4597
4613
|
}), V(() => {
|
|
4598
4614
|
T(this.options, () => {
|
|
4599
4615
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
@@ -4606,52 +4622,52 @@ function Xt(t) {
|
|
|
4606
4622
|
this.initOptions(), this.$handle.api.refresh();
|
|
4607
4623
|
}, { deep: !0, flush: "sync" })), this.vm.$props.driver && (this.renderDriver = typeof this.vm.$props.driver == "object" ? this.vm.$props.driver : this.drivers[this.vm.$props.driver]), !this.renderDriver && this.vm.parent && (this.renderDriver = this.vm.parent.fc.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
|
|
4608
4624
|
},
|
|
4609
|
-
targetFormDriver(c, ...
|
|
4610
|
-
if (this.bus.$emit(c, ...
|
|
4611
|
-
return O(() => this.renderDriver[c](...
|
|
4625
|
+
targetFormDriver(c, ...g) {
|
|
4626
|
+
if (this.bus.$emit(c, ...g), this.renderDriver && this.renderDriver[c])
|
|
4627
|
+
return O(() => this.renderDriver[c](...g));
|
|
4612
4628
|
},
|
|
4613
|
-
t(c,
|
|
4629
|
+
t(c, g, $) {
|
|
4614
4630
|
let b = $ ? $("$t." + c) : this.globalLanguageDriver(c);
|
|
4615
|
-
return b == null && (b = ""), b &&
|
|
4631
|
+
return b == null && (b = ""), b && g && Object.keys(g).forEach((w) => {
|
|
4616
4632
|
const A = new RegExp(`{${w}}`, "g");
|
|
4617
|
-
b = b.replace(A,
|
|
4633
|
+
b = b.replace(A, g[w]);
|
|
4618
4634
|
}), b;
|
|
4619
4635
|
},
|
|
4620
4636
|
globalDataDriver(c) {
|
|
4621
|
-
let
|
|
4622
|
-
const $ =
|
|
4637
|
+
let g = c.split(".");
|
|
4638
|
+
const $ = g.shift(), b = this.options.value.globalData && this.options.value.globalData[$];
|
|
4623
4639
|
if (b) {
|
|
4624
4640
|
if (b.type === "static")
|
|
4625
|
-
return L(b.data,
|
|
4641
|
+
return L(b.data, g);
|
|
4626
4642
|
{
|
|
4627
4643
|
let w;
|
|
4628
4644
|
const A = this.fetchCache.get(b);
|
|
4629
4645
|
if (A) {
|
|
4630
|
-
if (A.status && (w = L(A.data,
|
|
4646
|
+
if (A.status && (w = L(A.data, g)), !A.loading)
|
|
4631
4647
|
return w;
|
|
4632
4648
|
A.loading = !1, this.fetchCache.set(b, A);
|
|
4633
4649
|
} else
|
|
4634
4650
|
this.fetchCache.set(b, { status: !1 });
|
|
4635
|
-
const
|
|
4651
|
+
const S = ne(() => {
|
|
4636
4652
|
ee();
|
|
4637
4653
|
const J = this.fetchCache.get(b);
|
|
4638
4654
|
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (J && (J.loading = !0, this.fetchCache.set(b, J)), this.bus.$emit("$loadData.$globalData." + $)) : this.fetchCache.delete(b);
|
|
4639
|
-
}, b.wait || 600),
|
|
4655
|
+
}, b.wait || 600), ae = (J) => {
|
|
4640
4656
|
this.fetchCache.set(b, { status: !0, data: J }), this.bus.$emit("$loadData.$globalData." + $);
|
|
4641
|
-
},
|
|
4642
|
-
if (
|
|
4657
|
+
}, le = (J, ue) => {
|
|
4658
|
+
if (ue && b.watch === !1)
|
|
4643
4659
|
return ee();
|
|
4644
|
-
if (
|
|
4645
|
-
|
|
4660
|
+
if (ue) {
|
|
4661
|
+
S();
|
|
4646
4662
|
return;
|
|
4647
4663
|
}
|
|
4648
|
-
const
|
|
4649
|
-
|
|
4650
|
-
|
|
4664
|
+
const fe = this.$handle.loadFetchVar(We(b), J);
|
|
4665
|
+
fe.targetRule = this.targetRule, this.$handle.api.fetch(fe).then((te) => {
|
|
4666
|
+
ae(te);
|
|
4651
4667
|
}).catch((te) => {
|
|
4652
|
-
|
|
4668
|
+
ae(null);
|
|
4653
4669
|
});
|
|
4654
|
-
}, ee = this.watchLoadData(
|
|
4670
|
+
}, ee = this.watchLoadData(le);
|
|
4655
4671
|
return b.watch === !1 && ee(), this.unwatch.push(ee), w;
|
|
4656
4672
|
}
|
|
4657
4673
|
}
|
|
@@ -4661,28 +4677,28 @@ function Xt(t) {
|
|
|
4661
4677
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4662
4678
|
},
|
|
4663
4679
|
globalLanguageDriver(c) {
|
|
4664
|
-
let
|
|
4665
|
-
if (
|
|
4680
|
+
let g = this.vm.top.$props.t, $ = this.vm.top.$props.locale, b;
|
|
4681
|
+
if (g && (b = O(() => g(c))), b == null && $ && typeof $ == "object" && (b = L($, c)), b == null) {
|
|
4666
4682
|
const w = this.options.value.language || {}, A = this.getLocale();
|
|
4667
4683
|
b = L(w[A] || {}, c), b == null && (b = L(Ni[A] || {}, c));
|
|
4668
4684
|
}
|
|
4669
4685
|
return b;
|
|
4670
4686
|
},
|
|
4671
4687
|
globalVarDriver(c) {
|
|
4672
|
-
let
|
|
4673
|
-
const $ =
|
|
4688
|
+
let g = c.split(".");
|
|
4689
|
+
const $ = g.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[$];
|
|
4674
4690
|
if (b) {
|
|
4675
4691
|
const w = h.Function(b) ? b : W(b.handle);
|
|
4676
4692
|
if (w) {
|
|
4677
|
-
let A = w((...
|
|
4678
|
-
return L(A,
|
|
4693
|
+
let A = w((...S) => this.$handle.api.getData(...S), this.$handle.api);
|
|
4694
|
+
return L(A, g);
|
|
4679
4695
|
}
|
|
4680
4696
|
}
|
|
4681
4697
|
},
|
|
4682
|
-
setData(c,
|
|
4683
|
-
$ ? Be(c,
|
|
4698
|
+
setData(c, g, $) {
|
|
4699
|
+
$ ? Be(c, g) : (se(this.vm.top.fc.tmpData, c, g), this.bus.$emit("$loadData." + c));
|
|
4684
4700
|
},
|
|
4685
|
-
getLoadData(c,
|
|
4701
|
+
getLoadData(c, g) {
|
|
4686
4702
|
let $ = null;
|
|
4687
4703
|
if (c != null) {
|
|
4688
4704
|
let b = c.split(".");
|
|
@@ -4712,36 +4728,36 @@ function Xt(t) {
|
|
|
4712
4728
|
}
|
|
4713
4729
|
$ && b.length && ($ = L($, b));
|
|
4714
4730
|
}
|
|
4715
|
-
return $ == null || $ === "" ?
|
|
4731
|
+
return $ == null || $ === "" ? g : $;
|
|
4716
4732
|
},
|
|
4717
|
-
watchLoadData(c,
|
|
4733
|
+
watchLoadData(c, g) {
|
|
4718
4734
|
let $ = {};
|
|
4719
|
-
const b = (
|
|
4735
|
+
const b = (S) => {
|
|
4720
4736
|
this.get || (this.get = w), O(() => {
|
|
4721
|
-
c(w,
|
|
4737
|
+
c(w, S);
|
|
4722
4738
|
}), this.get === w && (this.get = void 0);
|
|
4723
|
-
}, w = (
|
|
4724
|
-
let
|
|
4725
|
-
if (typeof
|
|
4726
|
-
return $[
|
|
4727
|
-
const ee =
|
|
4728
|
-
const
|
|
4729
|
-
if ($[
|
|
4730
|
-
((
|
|
4739
|
+
}, w = (S, ae) => {
|
|
4740
|
+
let le;
|
|
4741
|
+
if (typeof S == "object" && (le = S.getValue, S = S.id), $[S])
|
|
4742
|
+
return $[S].val;
|
|
4743
|
+
const ee = ye(() => le ? le() : this.getLoadData(S, ae)), J = S.split("."), ue = J.shift(), fe = J.shift() || "", te = ne(() => {
|
|
4744
|
+
const ce = le ? le() : this.getLoadData(S, ae);
|
|
4745
|
+
if ($[S])
|
|
4746
|
+
((ce instanceof Function || h.Object(ce) || Array.isArray(ce)) && ce === $[S].val || JSON.stringify(ce) !== JSON.stringify($[S].val)) && ($[S].val = ce, b(!0));
|
|
4731
4747
|
else return;
|
|
4732
|
-
},
|
|
4748
|
+
}, g || 0), sr = T(ee, (ce) => {
|
|
4733
4749
|
te();
|
|
4734
4750
|
});
|
|
4735
|
-
return this.bus.$on("$loadData." +
|
|
4751
|
+
return this.bus.$on("$loadData." + ue, te), fe && this.bus.$on("$loadData." + ue + "." + fe, te), $[S] = {
|
|
4736
4752
|
fn: () => {
|
|
4737
|
-
this.bus.$off("$loadData." +
|
|
4753
|
+
this.bus.$off("$loadData." + ue, te), fe && this.bus.$off("$loadData." + ue + "." + fe, te), sr();
|
|
4738
4754
|
},
|
|
4739
4755
|
val: ee.value
|
|
4740
4756
|
}, ee.value;
|
|
4741
4757
|
};
|
|
4742
4758
|
b(!1);
|
|
4743
4759
|
const A = () => {
|
|
4744
|
-
Object.keys($).forEach((
|
|
4760
|
+
Object.keys($).forEach((S) => $[S].fn()), $ = {};
|
|
4745
4761
|
};
|
|
4746
4762
|
return this.unwatch.push(A), A;
|
|
4747
4763
|
},
|
|
@@ -4757,15 +4773,15 @@ function Xt(t) {
|
|
|
4757
4773
|
globalEvent: {},
|
|
4758
4774
|
globalData: {}
|
|
4759
4775
|
}, G(p));
|
|
4760
|
-
const
|
|
4761
|
-
|
|
4776
|
+
const g = this.isSub();
|
|
4777
|
+
g && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$props.option || {});
|
|
4762
4778
|
const $ = this.api();
|
|
4763
|
-
this.targetFormDriver("initOptions", c, { api: $, isSubForm:
|
|
4779
|
+
this.targetFormDriver("initOptions", c, { api: $, isSubForm: g }), this.updateOptions(c);
|
|
4764
4780
|
},
|
|
4765
|
-
mergeOptions(c,
|
|
4766
|
-
return
|
|
4767
|
-
delete
|
|
4768
|
-
}),
|
|
4781
|
+
mergeOptions(c, g, $) {
|
|
4782
|
+
return g = _({}, g || {}), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4783
|
+
delete g[b];
|
|
4784
|
+
}), g.global && (c.global = Xr(c.global, g.global), delete g.global), this.$handle.$manager.mergeOptions([g], c), c;
|
|
4769
4785
|
},
|
|
4770
4786
|
updateOptions(c) {
|
|
4771
4787
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4801,27 +4817,27 @@ function Xt(t) {
|
|
|
4801
4817
|
isMobile: d,
|
|
4802
4818
|
extendApi: tr,
|
|
4803
4819
|
getData: st,
|
|
4804
|
-
setDataDriver:
|
|
4820
|
+
setDataDriver: ke,
|
|
4805
4821
|
setData: Be,
|
|
4806
4822
|
removeData: rr,
|
|
4807
4823
|
refreshData: Oe,
|
|
4808
4824
|
maker: f,
|
|
4809
|
-
component:
|
|
4825
|
+
component: F,
|
|
4810
4826
|
directive: B,
|
|
4811
4827
|
setModelField: Qt,
|
|
4812
4828
|
setFormula: Yt,
|
|
4813
4829
|
setDriver: er,
|
|
4814
|
-
register:
|
|
4830
|
+
register: de,
|
|
4815
4831
|
$vnode: N,
|
|
4816
|
-
parser:
|
|
4817
|
-
use:
|
|
4832
|
+
parser: pe,
|
|
4833
|
+
use: me,
|
|
4818
4834
|
factory: xt,
|
|
4819
4835
|
componentAlias: Le,
|
|
4820
4836
|
copyRule: Bt,
|
|
4821
4837
|
copyRules: Tt,
|
|
4822
4838
|
mergeRule: Q,
|
|
4823
4839
|
fetch: Ht,
|
|
4824
|
-
$form:
|
|
4840
|
+
$form: R,
|
|
4825
4841
|
parseFn: W,
|
|
4826
4842
|
parseJson: Dt,
|
|
4827
4843
|
toJson: Ce,
|
|
@@ -4833,26 +4849,28 @@ function Xt(t) {
|
|
|
4833
4849
|
function nr(c) {
|
|
4834
4850
|
C(c, {
|
|
4835
4851
|
create: z,
|
|
4836
|
-
install(
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4852
|
+
install(g, $) {
|
|
4853
|
+
p = _(_({}, p), $ || {});
|
|
4854
|
+
const b = `_installedFormCreate${d ? "Mobile" : ""}_${t.ui}`;
|
|
4855
|
+
if (g[b] === !0) return;
|
|
4856
|
+
g[b] = !0;
|
|
4857
|
+
const w = function(S, ae = {}) {
|
|
4858
|
+
return z(S, ae, this);
|
|
4841
4859
|
};
|
|
4842
|
-
ot(
|
|
4843
|
-
const
|
|
4844
|
-
|
|
4845
|
-
O(() =>
|
|
4860
|
+
ot(w), g.prototype.$formCreate = w;
|
|
4861
|
+
const A = R();
|
|
4862
|
+
g.component(A.name, A), g.component("FcFragment", N()), o.forEach((S) => {
|
|
4863
|
+
O(() => S(c, g));
|
|
4846
4864
|
});
|
|
4847
4865
|
}
|
|
4848
4866
|
});
|
|
4849
4867
|
}
|
|
4850
|
-
if (ot(E), nr(E),
|
|
4868
|
+
if (ot(E), nr(E), ke("$cookie", Li), ke("$localStorage", Bi), ke("$sessionStorage", Ti), y.use({ fragment: "fcFragment" }), t.install && z.use(t), pe(Ai), t.inherit) {
|
|
4851
4869
|
const c = t.inherit;
|
|
4852
|
-
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(
|
|
4870
|
+
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);
|
|
4853
4871
|
}
|
|
4854
|
-
const
|
|
4855
|
-
return Re(
|
|
4872
|
+
const Fe = R();
|
|
4873
|
+
return Re(Fe, E), Object.defineProperties(Fe, {
|
|
4856
4874
|
fetch: {
|
|
4857
4875
|
get() {
|
|
4858
4876
|
return E.fetch;
|
|
@@ -4861,7 +4879,7 @@ function Xt(t) {
|
|
|
4861
4879
|
E.fetch = c;
|
|
4862
4880
|
}
|
|
4863
4881
|
}
|
|
4864
|
-
}),
|
|
4882
|
+
}), Fe.util = E, Fe;
|
|
4865
4883
|
}
|
|
4866
4884
|
function Ue(t) {
|
|
4867
4885
|
if (h.Date(t))
|
|
@@ -5123,7 +5141,7 @@ const rn = {
|
|
|
5123
5141
|
return !(!e.title && !e.native || X(e.show));
|
|
5124
5142
|
},
|
|
5125
5143
|
makeInfo(t, e, r) {
|
|
5126
|
-
var u, f, p, d,
|
|
5144
|
+
var u, f, p, d, m, y;
|
|
5127
5145
|
const i = _({}, t.title), s = _({}, t.info), n = this.options.form, o = this.getSlot("title"), a = [o ? o({
|
|
5128
5146
|
title: (f = (u = r.refRule) == null ? void 0 : u.__$title) == null ? void 0 : f.value,
|
|
5129
5147
|
rule: r.rule,
|
|
@@ -5138,7 +5156,7 @@ const rn = {
|
|
|
5138
5156
|
};
|
|
5139
5157
|
delete v.props.icon, delete v.props.show, delete v.props.info, delete v.props.align, delete v.props.native;
|
|
5140
5158
|
const E = "content";
|
|
5141
|
-
s.info && !j(v.props, E) && (v.props[E] = (y = (
|
|
5159
|
+
s.info && !j(v.props, E) && (v.props[E] = (y = (m = r.refRule) == null ? void 0 : m.__$info) == null ? void 0 : y.value), a[s.align !== "left" ? "unshift" : "push"](this.$r(x([s, v]), [
|
|
5142
5160
|
this.$r({
|
|
5143
5161
|
type: "icon",
|
|
5144
5162
|
props: { type: s.icon === !0 ? Ie.infoIcon : s.icon, size: 16 },
|
|
@@ -5152,7 +5170,12 @@ const rn = {
|
|
|
5152
5170
|
key: `${e}tit`,
|
|
5153
5171
|
class: "fc-form-title",
|
|
5154
5172
|
slot: i.slot || "label",
|
|
5155
|
-
type: i.type || "span"
|
|
5173
|
+
type: i.type || "span",
|
|
5174
|
+
on: {
|
|
5175
|
+
click: (...v) => {
|
|
5176
|
+
this.$handle.targetHook(r, "titleClick", { args: v });
|
|
5177
|
+
}
|
|
5178
|
+
}
|
|
5156
5179
|
}]);
|
|
5157
5180
|
return delete l.props.show, delete l.props.title, delete l.props.native, this.$r(l, a);
|
|
5158
5181
|
},
|
|
@@ -5267,7 +5290,7 @@ an(oe);
|
|
|
5267
5290
|
un(oe);
|
|
5268
5291
|
fn(oe);
|
|
5269
5292
|
ln(oe);
|
|
5270
|
-
function
|
|
5293
|
+
function kt(t, e) {
|
|
5271
5294
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
5272
5295
|
}
|
|
5273
5296
|
function cn(t, e) {
|
|
@@ -5350,11 +5373,11 @@ function cn(t, e) {
|
|
|
5350
5373
|
}
|
|
5351
5374
|
},
|
|
5352
5375
|
submitBtnProps: (r = {}) => {
|
|
5353
|
-
let i =
|
|
5376
|
+
let i = kt(e.options.submitBtn, !0);
|
|
5354
5377
|
C(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
5355
5378
|
},
|
|
5356
5379
|
resetBtnProps: (r = {}) => {
|
|
5357
|
-
let i =
|
|
5380
|
+
let i = kt(e.options.resetBtn, !1);
|
|
5358
5381
|
C(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
5359
5382
|
},
|
|
5360
5383
|
submit(r, i) {
|
|
@@ -5375,24 +5398,28 @@ function cn(t, e) {
|
|
|
5375
5398
|
const Zt = {
|
|
5376
5399
|
name: "required",
|
|
5377
5400
|
load(t, e, r) {
|
|
5378
|
-
var s, n;
|
|
5379
5401
|
const i = hn(t.getValue());
|
|
5402
|
+
let s;
|
|
5380
5403
|
if (i.required === !1)
|
|
5381
5404
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5382
5405
|
else {
|
|
5383
|
-
const
|
|
5406
|
+
const n = _({
|
|
5384
5407
|
required: !0,
|
|
5385
|
-
validator(l, u
|
|
5386
|
-
h.empty(
|
|
5408
|
+
validator(a, l, u) {
|
|
5409
|
+
o(), h.empty(l) ? u(n.message) : u();
|
|
5387
5410
|
}
|
|
5388
|
-
}, i),
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5411
|
+
}, i), o = () => {
|
|
5412
|
+
var l, u;
|
|
5413
|
+
const a = (u = (l = e.__fc__.refRule) == null ? void 0 : l.__$title) == null ? void 0 : u.value;
|
|
5414
|
+
if (s !== a)
|
|
5415
|
+
if (s = a, !i.message)
|
|
5416
|
+
n.message = r.t("required", { title: a }) || a + (r.getLocale() === "en" ? " is required" : "不能为空");
|
|
5417
|
+
else {
|
|
5418
|
+
const f = i.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5419
|
+
f && (n.message = r.t(f[1], { title: a }));
|
|
5420
|
+
}
|
|
5421
|
+
};
|
|
5422
|
+
o(), t.getProp().validate = [n];
|
|
5396
5423
|
}
|
|
5397
5424
|
r.sync(e);
|
|
5398
5425
|
},
|
|
@@ -5415,7 +5442,7 @@ function dn(t) {
|
|
|
5415
5442
|
function pn() {
|
|
5416
5443
|
return Xt({
|
|
5417
5444
|
ui: "view-design",
|
|
5418
|
-
version: "2.7.
|
|
5445
|
+
version: "2.7.21",
|
|
5419
5446
|
manager: rn,
|
|
5420
5447
|
install: dn,
|
|
5421
5448
|
extendApi: cn,
|