@form-create/element-ui 2.7.25 → 2.7.27
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 +437 -403
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +4 -4
- package/src/core/api.js +22 -3
- 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.27
|
|
4
4
|
* (c) 2018-2026 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -11,7 +11,7 @@ var nr = Object.defineProperty, sr = Object.defineProperties;
|
|
|
11
11
|
var or = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var at = Object.getOwnPropertySymbols;
|
|
13
13
|
var ar = Object.prototype.hasOwnProperty, lr = Object.prototype.propertyIsEnumerable;
|
|
14
|
-
var lt = (t, e, r) => e in t ? nr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r,
|
|
14
|
+
var lt = (t, e, r) => e in t ? nr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, v = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
16
|
ar.call(e, r) && lt(t, r, e[r]);
|
|
17
17
|
if (at)
|
|
@@ -111,7 +111,7 @@ const Or = "fcCheckbox", Fr = {
|
|
|
111
111
|
input: this.onInput
|
|
112
112
|
}
|
|
113
113
|
}]), [this.options().map((e, r) => {
|
|
114
|
-
const i =
|
|
114
|
+
const i = v({}, e), s = this.type === "button" ? "ElCheckboxButton" : "ElCheckbox";
|
|
115
115
|
return delete i.value, t(s, I([{}, {
|
|
116
116
|
props: i
|
|
117
117
|
}, {
|
|
@@ -123,11 +123,11 @@ const Or = "fcCheckbox", Fr = {
|
|
|
123
123
|
this.$emit("fc.el", this.$refs.el);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function J(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,
|
|
@@ -248,7 +248,7 @@ const kr = "fcFrame", Er = {
|
|
|
248
248
|
},
|
|
249
249
|
data() {
|
|
250
250
|
return {
|
|
251
|
-
fileList:
|
|
251
|
+
fileList: J(this.value),
|
|
252
252
|
previewVisible: !1,
|
|
253
253
|
frameVisible: !1,
|
|
254
254
|
previewImage: ""
|
|
@@ -256,7 +256,7 @@ const kr = "fcFrame", Er = {
|
|
|
256
256
|
},
|
|
257
257
|
watch: {
|
|
258
258
|
value(t) {
|
|
259
|
-
this.fileList =
|
|
259
|
+
this.fileList = J(t);
|
|
260
260
|
},
|
|
261
261
|
fileList(t) {
|
|
262
262
|
const e = this.maxLength === 1 ? t[0] || "" : t;
|
|
@@ -469,7 +469,7 @@ const kr = "fcFrame", Er = {
|
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
471
|
})]), t("el-dialog", I([{}, {
|
|
472
|
-
props: q(
|
|
472
|
+
props: q(v({
|
|
473
473
|
width: i,
|
|
474
474
|
title: o,
|
|
475
475
|
appendToBody: !0
|
|
@@ -550,7 +550,7 @@ const kr = "fcFrame", Er = {
|
|
|
550
550
|
input: this.onInput
|
|
551
551
|
}
|
|
552
552
|
}]), [this.options().map((e, r) => {
|
|
553
|
-
const i =
|
|
553
|
+
const i = v({}, e), s = this.type === "button" ? "ElRadioButton" : "ElRadio";
|
|
554
554
|
return delete i.value, t(s, I([{}, {
|
|
555
555
|
props: i
|
|
556
556
|
}, {
|
|
@@ -666,7 +666,7 @@ const jr = "fcSelect", Dr = {
|
|
|
666
666
|
t === "selected" ? e = this.$refs.tree.getCurrentKey() : e = this.$refs.tree.getCheckedKeys(), this.$emit("input", e);
|
|
667
667
|
},
|
|
668
668
|
setValue() {
|
|
669
|
-
this.type.toLocaleLowerCase() === "selected" ? this.$refs.tree.setCurrentKey(this.value) : this.$refs.tree.setCheckedKeys(
|
|
669
|
+
this.type.toLocaleLowerCase() === "selected" ? this.$refs.tree.setCurrentKey(this.value) : this.$refs.tree.setCheckedKeys(J(this.value));
|
|
670
670
|
}
|
|
671
671
|
},
|
|
672
672
|
render() {
|
|
@@ -692,7 +692,7 @@ function ft(t, e) {
|
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
694
|
function ct(t) {
|
|
695
|
-
return q(
|
|
695
|
+
return q(v({}, t), {
|
|
696
696
|
file: t,
|
|
697
697
|
value: t
|
|
698
698
|
});
|
|
@@ -750,11 +750,11 @@ const Pr = "fcUpload", Tr = {
|
|
|
750
750
|
};
|
|
751
751
|
},
|
|
752
752
|
created() {
|
|
753
|
-
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList =
|
|
753
|
+
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = J(this.value).map(ft).map(ct);
|
|
754
754
|
},
|
|
755
755
|
watch: {
|
|
756
756
|
value(t) {
|
|
757
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles =
|
|
757
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = J(t).map(ft).map(ct), this.uploadList = this.$refs.upload.uploadFiles);
|
|
758
758
|
},
|
|
759
759
|
limit(t, e) {
|
|
760
760
|
(e === 1 || t === 1) && this.update();
|
|
@@ -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,19 +926,19 @@ 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
|
}
|
|
@@ -948,14 +948,14 @@ function Y(t) {
|
|
|
948
948
|
const Br = Object.assign || function(t) {
|
|
949
949
|
for (let e, r = 1; r < arguments.length; r++)
|
|
950
950
|
for (let i in e = arguments[r], e)
|
|
951
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
951
|
+
Object.prototype.hasOwnProperty.call(e, i) && E(t, i, e[i]);
|
|
952
952
|
return t;
|
|
953
953
|
};
|
|
954
954
|
function C() {
|
|
955
955
|
return Br.apply(this, arguments);
|
|
956
956
|
}
|
|
957
957
|
function Ke(t) {
|
|
958
|
-
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] :
|
|
958
|
+
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : v({}, t);
|
|
959
959
|
}
|
|
960
960
|
function se(t, e) {
|
|
961
961
|
var r = null;
|
|
@@ -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 z(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,
|
|
@@ -1196,7 +1196,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1196
1196
|
if (i.filter((n) => r[n].$f).length !== i.length)
|
|
1197
1197
|
return;
|
|
1198
1198
|
const s = i.map((n) => {
|
|
1199
|
-
const o = t === n ? e :
|
|
1199
|
+
const o = t === n ? e : v({}, this.cacheRule[n].$f.form), a = this.field ? h.Undef(o[this.field]) ? null : o[this.field] : o;
|
|
1200
1200
|
return this.cache(n, a), a;
|
|
1201
1201
|
});
|
|
1202
1202
|
this.input(s);
|
|
@@ -1208,7 +1208,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1208
1208
|
}), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cache(t, e), i && i.coverValue(e || {}));
|
|
1209
1209
|
},
|
|
1210
1210
|
addRule(t, e) {
|
|
1211
|
-
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ?
|
|
1211
|
+
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? v({}, this.options) : {
|
|
1212
1212
|
submitBtn: !1,
|
|
1213
1213
|
resetBtn: !1
|
|
1214
1214
|
};
|
|
@@ -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: {
|
|
@@ -1418,7 +1418,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1418
1418
|
submitBtn: !1,
|
|
1419
1419
|
resetBtn: !1
|
|
1420
1420
|
};
|
|
1421
|
-
t.formData =
|
|
1421
|
+
t.formData = v({}, this.value || {}), this.cacheRule = {
|
|
1422
1422
|
rule: this.rule,
|
|
1423
1423
|
options: t
|
|
1424
1424
|
};
|
|
@@ -1457,7 +1457,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1457
1457
|
}
|
|
1458
1458
|
}, Kr = [
|
|
1459
1459
|
Fr,
|
|
1460
|
-
|
|
1460
|
+
kr,
|
|
1461
1461
|
Sr,
|
|
1462
1462
|
Dr,
|
|
1463
1463
|
Ar,
|
|
@@ -1472,15 +1472,15 @@ const Ur = "fcGroup", Hr = {
|
|
|
1472
1472
|
if (o.indexOf(u) > -1)
|
|
1473
1473
|
a[u] = Q([l[u]], a[u]);
|
|
1474
1474
|
else if (i.indexOf(u) > -1)
|
|
1475
|
-
a[u] =
|
|
1475
|
+
a[u] = v(v({}, 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")
|
|
@@ -1489,7 +1489,7 @@ const Ur = "fcGroup", Hr = {
|
|
|
1489
1489
|
else
|
|
1490
1490
|
a[u] = l[u];
|
|
1491
1491
|
else
|
|
1492
|
-
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] =
|
|
1492
|
+
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = v({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? v({}, l[u]) : l[u] : a[u] = l[u];
|
|
1493
1493
|
return a;
|
|
1494
1494
|
}, e);
|
|
1495
1495
|
}, Wr = (t, e) => function() {
|
|
@@ -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,
|
|
@@ -1519,7 +1519,7 @@ 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,10 +1531,10 @@ function Bt(t, e) {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
}, r), {}));
|
|
1533
1533
|
}
|
|
1534
|
-
function
|
|
1534
|
+
function x(t) {
|
|
1535
1535
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1536
1536
|
}
|
|
1537
|
-
function
|
|
1537
|
+
function F(t, e) {
|
|
1538
1538
|
try {
|
|
1539
1539
|
e = t();
|
|
1540
1540
|
} catch (r) {
|
|
@@ -1544,13 +1544,13 @@ function O(t, e) {
|
|
|
1544
1544
|
}
|
|
1545
1545
|
function Xe(t, e) {
|
|
1546
1546
|
let r = null;
|
|
1547
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e &&
|
|
1547
|
+
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e && J(r).forEach((i) => {
|
|
1548
1548
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1549
1549
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
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(),
|
|
1743
|
+
}), m = new t(n), $ = m.api(), _ = d.value, O = () => {
|
|
1744
1744
|
if (o) {
|
|
1745
|
-
const
|
|
1746
|
-
if (
|
|
1745
|
+
const k = De(n, o);
|
|
1746
|
+
if (k) {
|
|
1747
1747
|
let S;
|
|
1748
|
-
|
|
1748
|
+
_ ? (S = J(k.getSubForm()), S.push($)) : S = $, k.subForm(S);
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
|
-
},
|
|
1752
|
-
const
|
|
1753
|
-
if (
|
|
1754
|
-
if (
|
|
1755
|
-
const S =
|
|
1756
|
-
|
|
1751
|
+
}, M = () => {
|
|
1752
|
+
const k = De(n, o);
|
|
1753
|
+
if (k)
|
|
1754
|
+
if (_) {
|
|
1755
|
+
const S = J(k.getSubForm()), U = S.indexOf($);
|
|
1756
|
+
U > -1 && S.splice(U, 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
|
-
Object.keys(S).forEach((
|
|
1765
|
+
Object.keys(S).forEach((U) => {
|
|
1766
1766
|
let ge = "";
|
|
1767
|
-
S[
|
|
1768
|
-
ge += ve(K) + ":" + S[
|
|
1769
|
-
}), S[
|
|
1770
|
-
}), s.option && s.option.style && (
|
|
1767
|
+
S[U].style && Object.keys(S[U].style).forEach((K) => {
|
|
1768
|
+
ge += ve(K) + ":" + S[U].style[K] + ";";
|
|
1769
|
+
}), S[U].content && (ge += S[U].content + ";"), ge && (k += `.${U}{${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,48 +1777,48 @@ 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),
|
|
1786
|
+
o && ($.top.bus.$off("$loadData.$form", L), $.top.bus.$off("change", me)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", pe), M(), 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 ? O() : M();
|
|
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(() => {
|
|
1802
1802
|
$.clearValidateState();
|
|
1803
1803
|
});
|
|
1804
1804
|
});
|
|
1805
|
-
}, { flush: "sync" }), q(
|
|
1805
|
+
}, { flush: "sync" }), q(v({
|
|
1806
1806
|
fc: ye(m),
|
|
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();
|
|
@@ -1930,7 +1930,7 @@ function Ut(t) {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
function yt(t, e, r) {
|
|
1932
1932
|
return new Promise((i, s) => {
|
|
1933
|
-
(e || Ut)(q(
|
|
1933
|
+
(e || Ut)(q(v({}, t), {
|
|
1934
1934
|
onSuccess(n) {
|
|
1935
1935
|
let o = (l) => l;
|
|
1936
1936
|
const a = z(t.parse);
|
|
@@ -1952,10 +1952,10 @@ function ti(t) {
|
|
|
1952
1952
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1953
1953
|
}
|
|
1954
1954
|
function r(n, o, a) {
|
|
1955
|
-
h.Undef(n) ? n = Object.keys(
|
|
1955
|
+
h.Undef(n) ? n = Object.keys(v(v({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
|
|
1956
1956
|
const u = t.fieldCtx[l] || t.nameCtx[l];
|
|
1957
1957
|
u && u.forEach((f) => {
|
|
1958
|
-
|
|
1958
|
+
E(f.rule, o, a), t.$render.clearCache(f);
|
|
1959
1959
|
});
|
|
1960
1960
|
});
|
|
1961
1961
|
}
|
|
@@ -2025,7 +2025,7 @@ function ti(t) {
|
|
|
2025
2025
|
}
|
|
2026
2026
|
},
|
|
2027
2027
|
get formulas() {
|
|
2028
|
-
return
|
|
2028
|
+
return v({}, t.fc.formulas);
|
|
2029
2029
|
},
|
|
2030
2030
|
formData(n) {
|
|
2031
2031
|
if (n == null || typeof n == "boolean") {
|
|
@@ -2041,14 +2041,14 @@ function ti(t) {
|
|
|
2041
2041
|
return o ? _e(o.rule.value) : t.options.appendValue !== !1 && j(t.appendData, n) ? _e(t.appendData[n]) : void 0;
|
|
2042
2042
|
},
|
|
2043
2043
|
coverValue(n) {
|
|
2044
|
-
const o =
|
|
2044
|
+
const o = v({}, n || {});
|
|
2045
2045
|
t.deferSyncValue(() => {
|
|
2046
2046
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
2047
2047
|
const l = t.fieldCtx[a];
|
|
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 && x(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) ? x(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);
|
|
@@ -2270,7 +2270,7 @@ function ti(t) {
|
|
|
2270
2270
|
s.clearValidateState(n);
|
|
2271
2271
|
});
|
|
2272
2272
|
});
|
|
2273
|
-
}), n == null && (h.Function(t.options.onReset) &&
|
|
2273
|
+
}), n == null && (h.Function(t.options.onReset) && F(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
2274
2274
|
},
|
|
2275
2275
|
method(n, o) {
|
|
2276
2276
|
const a = s.el(n);
|
|
@@ -2279,7 +2279,7 @@ function ti(t) {
|
|
|
2279
2279
|
return (...l) => a[o](...l);
|
|
2280
2280
|
},
|
|
2281
2281
|
exec(n, o, ...a) {
|
|
2282
|
-
return
|
|
2282
|
+
return F(() => s.method(n, o)(...a));
|
|
2283
2283
|
},
|
|
2284
2284
|
toJson(n) {
|
|
2285
2285
|
return Oe(s.rule, 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 : (F(() => 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 ? x(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" ? x(n) : t.getCtx(n)).parent.rule;
|
|
2316
2336
|
},
|
|
2317
2337
|
getParentSubRule(n) {
|
|
2318
|
-
const a = typeof n == "object" ?
|
|
2338
|
+
const a = typeof n == "object" ? x(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,18 +2380,18 @@ 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" ? x(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" ? x(n) : t.getCtx(n);
|
|
2368
2388
|
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2369
2389
|
},
|
|
2370
2390
|
nextTick(n) {
|
|
2371
2391
|
t.bus.$once("next-tick", n), t.refresh();
|
|
2372
2392
|
},
|
|
2373
2393
|
nextRefresh(n) {
|
|
2374
|
-
t.nextRefresh(), n &&
|
|
2394
|
+
t.nextRefresh(), n && F(n);
|
|
2375
2395
|
},
|
|
2376
2396
|
emit(n, ...o) {
|
|
2377
2397
|
t.vm.$emit(n, ...o);
|
|
@@ -2386,13 +2406,13 @@ function ti(t) {
|
|
|
2386
2406
|
},
|
|
2387
2407
|
fetch(n) {
|
|
2388
2408
|
return new Promise((o, a) => {
|
|
2389
|
-
let l =
|
|
2409
|
+
let l = v({}, n);
|
|
2390
2410
|
l = t.loadFetchVar(l);
|
|
2391
2411
|
const u = (f) => {
|
|
2392
|
-
|
|
2412
|
+
F(() => l.onError && l.onError(f)), a(f);
|
|
2393
2413
|
};
|
|
2394
2414
|
t.beforeFetch(l).then(() => yt(l, t.fc.create.fetch, s).then((f) => {
|
|
2395
|
-
|
|
2415
|
+
F(() => l.onSuccess && l.onSuccess(f)), o(f);
|
|
2396
2416
|
}).catch((f) => {
|
|
2397
2417
|
u(f);
|
|
2398
2418
|
})).catch((f) => {
|
|
@@ -2402,17 +2422,17 @@ function ti(t) {
|
|
|
2402
2422
|
},
|
|
2403
2423
|
watchFetch(n, o, a, l) {
|
|
2404
2424
|
return t.fc.watchLoadData((u, f) => {
|
|
2405
|
-
let
|
|
2406
|
-
|
|
2407
|
-
const
|
|
2408
|
-
|
|
2425
|
+
let d = v({}, n);
|
|
2426
|
+
d = t.loadFetchVar(d, u);
|
|
2427
|
+
const p = (m) => {
|
|
2428
|
+
F(() => d.onError && d.onError(m)), a && a(m);
|
|
2409
2429
|
};
|
|
2410
|
-
l && l(
|
|
2411
|
-
|
|
2430
|
+
l && l(d, f) === !1 || t.beforeFetch(d).then(() => yt(d, t.fc.create.fetch, s).then((m) => {
|
|
2431
|
+
F(() => d.onSuccess && d.onSuccess(m)), o && o(m, f);
|
|
2412
2432
|
}).catch((m) => {
|
|
2413
|
-
|
|
2433
|
+
p(m);
|
|
2414
2434
|
})).catch((m) => {
|
|
2415
|
-
|
|
2435
|
+
p(m);
|
|
2416
2436
|
});
|
|
2417
2437
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2418
2438
|
},
|
|
@@ -2474,7 +2494,7 @@ function ri(t) {
|
|
|
2474
2494
|
}
|
|
2475
2495
|
});
|
|
2476
2496
|
}
|
|
2477
|
-
function
|
|
2497
|
+
function G(t) {
|
|
2478
2498
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2479
2499
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2480
2500
|
});
|
|
@@ -2554,7 +2574,7 @@ function ii(t) {
|
|
|
2554
2574
|
return;
|
|
2555
2575
|
}
|
|
2556
2576
|
s = (...l) => {
|
|
2557
|
-
var
|
|
2577
|
+
var $, _;
|
|
2558
2578
|
const u = {
|
|
2559
2579
|
rule: i,
|
|
2560
2580
|
prop: n,
|
|
@@ -2563,23 +2583,23 @@ function ii(t) {
|
|
|
2563
2583
|
model: n.model || {},
|
|
2564
2584
|
slotValue: l
|
|
2565
2585
|
};
|
|
2566
|
-
l.length && i.slotUpdate &&
|
|
2586
|
+
l.length && i.slotUpdate && F(() => i.slotUpdate(u));
|
|
2567
2587
|
let f = [];
|
|
2568
|
-
const
|
|
2569
|
-
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((O) => {
|
|
2570
2590
|
f.push(this.renderRule({
|
|
2571
2591
|
type: "template",
|
|
2572
|
-
slot:
|
|
2592
|
+
slot: O
|
|
2573
2593
|
}, (() => {
|
|
2574
|
-
if (h.Function(n.renderSlots[
|
|
2575
|
-
return
|
|
2576
|
-
const
|
|
2577
|
-
return this.renderRule(
|
|
2594
|
+
if (h.Function(n.renderSlots[O]))
|
|
2595
|
+
return F(() => n.renderSlots[O]());
|
|
2596
|
+
const M = this.parseSide(n.renderSlots[O], e);
|
|
2597
|
+
return this.renderRule(M);
|
|
2578
2598
|
})()));
|
|
2579
2599
|
});
|
|
2580
|
-
const
|
|
2600
|
+
const p = this.getTypeSlot(e);
|
|
2581
2601
|
let m;
|
|
2582
|
-
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), ($ = n.title) != null && $.show && (n.wrap = q(v({}, n.wrap || {}), { show: !0 }), n.native || (n.native = !1)), (!(!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((O) => !O || !O.tag ? O : this.none(O)) : m = this.none(m)), o && this.setCache(e, () => this.stable(m), r), m;
|
|
2583
2603
|
}, this.setCache(e, s, r);
|
|
2584
2604
|
}
|
|
2585
2605
|
return (...s) => {
|
|
@@ -2621,7 +2641,7 @@ function ii(t) {
|
|
|
2621
2641
|
},
|
|
2622
2642
|
injectProp(e) {
|
|
2623
2643
|
const r = this.vm;
|
|
2624
|
-
r.ctxInject[e.id] ||
|
|
2644
|
+
r.ctxInject[e.id] || E(r.ctxInject, e.id, {
|
|
2625
2645
|
api: this.$handle.api,
|
|
2626
2646
|
form: this.fc.create,
|
|
2627
2647
|
subForm: (n) => {
|
|
@@ -2646,19 +2666,19 @@ function ii(t) {
|
|
|
2646
2666
|
preview: e.prop.preview,
|
|
2647
2667
|
options: e.prop.options,
|
|
2648
2668
|
prop: function() {
|
|
2649
|
-
const n =
|
|
2650
|
-
return n.on = n.on ?
|
|
2669
|
+
const n = v({}, e.prop);
|
|
2670
|
+
return n.on = n.on ? v({}, n.on) : {}, delete n.model, n;
|
|
2651
2671
|
}(),
|
|
2652
2672
|
children: e.loadChildrenPending()
|
|
2653
2673
|
};
|
|
2654
2674
|
return Object.keys(s).forEach((n) => {
|
|
2655
|
-
|
|
2675
|
+
E(i, n, s[n]);
|
|
2656
2676
|
}), i;
|
|
2657
2677
|
},
|
|
2658
2678
|
ctxProp(e) {
|
|
2659
2679
|
const { ref: r, key: i, rule: s } = e;
|
|
2660
2680
|
this.$manager.mergeProp(e), e.parser.mergeProp(e);
|
|
2661
|
-
const n =
|
|
2681
|
+
const n = v({}, e.prop.on || {}), o = {};
|
|
2662
2682
|
Object.keys(n).forEach((l) => {
|
|
2663
2683
|
if (l.indexOf("native.") === 0)
|
|
2664
2684
|
o[l.replace("native.", "")] = n[l], delete n[l];
|
|
@@ -2758,16 +2778,16 @@ function ii(t) {
|
|
|
2758
2778
|
if (i)
|
|
2759
2779
|
s = e.type;
|
|
2760
2780
|
else if (s = e.is, e.type) {
|
|
2761
|
-
s =
|
|
2781
|
+
s = G(e.type);
|
|
2762
2782
|
const a = this.vNode.aliasMap[s];
|
|
2763
|
-
a && (s =
|
|
2783
|
+
a && (s = G(a));
|
|
2764
2784
|
}
|
|
2765
2785
|
if (!s) return;
|
|
2766
2786
|
const n = Se();
|
|
2767
2787
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2768
2788
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2769
2789
|
});
|
|
2770
|
-
const o =
|
|
2790
|
+
const o = v({}, e);
|
|
2771
2791
|
return delete o.type, delete o.is, this.vNode.make(s, o, n.mergeBag(r).getSlots());
|
|
2772
2792
|
}
|
|
2773
2793
|
});
|
|
@@ -2821,17 +2841,17 @@ function si(t) {
|
|
|
2821
2841
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2822
2842
|
return h.trueArray(u) && u.forEach((f) => {
|
|
2823
2843
|
if (!f) return;
|
|
2824
|
-
let
|
|
2825
|
-
if (h.Object(f) && (
|
|
2826
|
-
r || (
|
|
2827
|
-
const m = ve(`${
|
|
2828
|
-
this.vm.$emit(m, ...
|
|
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}`), $ = (..._) => {
|
|
2848
|
+
this.vm.$emit(m, ..._), this.vm.$emit("emit-event", m, ..._), this.bus.$emit(m, ..._);
|
|
2829
2849
|
};
|
|
2830
|
-
if ($.__emit = !0, !
|
|
2850
|
+
if ($.__emit = !0, !d && l === !1)
|
|
2831
2851
|
i[f] = $;
|
|
2832
2852
|
else {
|
|
2833
|
-
let
|
|
2834
|
-
i[f] = h.Undef(
|
|
2853
|
+
let _ = d || l || this.options.injectEvent;
|
|
2854
|
+
i[f] = h.Undef(_) ? $ : this.inject(s, $, _);
|
|
2835
2855
|
}
|
|
2836
2856
|
}
|
|
2837
2857
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2862,32 +2882,32 @@ function si(t) {
|
|
|
2862
2882
|
loadStrVar(e, r, i) {
|
|
2863
2883
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2864
2884
|
const s = e, n = Xr(e), o = (u) => {
|
|
2865
|
-
let f = !1,
|
|
2885
|
+
let f = !1, d;
|
|
2866
2886
|
if (i && u.indexOf("$form.") === 0) {
|
|
2867
|
-
const
|
|
2868
|
-
|
|
2869
|
-
id: "$form." +
|
|
2870
|
-
getValue: () => B(i.value,
|
|
2871
|
-
}) : 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));
|
|
2872
2892
|
}
|
|
2873
|
-
return f || (
|
|
2893
|
+
return f || (d = r ? r(u) : this.fc.getLoadData(u)), d;
|
|
2874
2894
|
}, a = (u) => {
|
|
2875
2895
|
const f = [];
|
|
2876
|
-
u.forEach((
|
|
2877
|
-
|
|
2896
|
+
u.forEach((p) => {
|
|
2897
|
+
p.key ? f.push(p.key) : p.children && f.push(a(p.children));
|
|
2878
2898
|
});
|
|
2879
|
-
let
|
|
2880
|
-
return f.forEach((
|
|
2881
|
-
|
|
2882
|
-
}), 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("."));
|
|
2883
2903
|
};
|
|
2884
2904
|
let l;
|
|
2885
2905
|
if (n.forEach((u) => {
|
|
2886
|
-
const f = u.split("||"),
|
|
2887
|
-
if (
|
|
2888
|
-
const
|
|
2889
|
-
let $ =
|
|
2890
|
-
($ == null || $ === "") && f.length > 1 && ($ =
|
|
2906
|
+
const f = u.split("||"), d = f[0].trim();
|
|
2907
|
+
if (d) {
|
|
2908
|
+
const p = (f[1] || "").trim(), m = Lt(d);
|
|
2909
|
+
let $ = F(() => a(m));
|
|
2910
|
+
($ == null || $ === "") && f.length > 1 && ($ = p), l = $, e = e.replaceAll(`{{${u}}}`, $ == null ? "" : $);
|
|
2891
2911
|
}
|
|
2892
2912
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2893
2913
|
return l;
|
|
@@ -2950,9 +2970,9 @@ function li(t) {
|
|
|
2950
2970
|
}
|
|
2951
2971
|
function ui(t) {
|
|
2952
2972
|
Object.defineProperties(t.origin, {
|
|
2953
|
-
__fc__:
|
|
2973
|
+
__fc__: ze(ye(t), !0)
|
|
2954
2974
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2955
|
-
__fc__:
|
|
2975
|
+
__fc__: ze(ye(t), !0)
|
|
2956
2976
|
});
|
|
2957
2977
|
}
|
|
2958
2978
|
function Gt(t, e, r) {
|
|
@@ -2974,7 +2994,7 @@ function Gt(t, e, r) {
|
|
|
2974
2994
|
parent: null,
|
|
2975
2995
|
group: e.subRule ? this : null,
|
|
2976
2996
|
cacheConfig: null,
|
|
2977
|
-
prop:
|
|
2997
|
+
prop: v({}, e),
|
|
2978
2998
|
computed: {},
|
|
2979
2999
|
payload: {},
|
|
2980
3000
|
refRule: {},
|
|
@@ -3018,12 +3038,12 @@ C(Gt.prototype, {
|
|
|
3018
3038
|
delete this.pending[e];
|
|
3019
3039
|
let a = r;
|
|
3020
3040
|
if (h.Function(r)) {
|
|
3021
|
-
let l =
|
|
3041
|
+
let l = F(() => r({
|
|
3022
3042
|
rule: this.rule,
|
|
3023
3043
|
api: this.$api,
|
|
3024
3044
|
update: (u) => {
|
|
3025
|
-
const f = u || i,
|
|
3026
|
-
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);
|
|
3027
3047
|
},
|
|
3028
3048
|
reload: () => {
|
|
3029
3049
|
const u = this.getPending(e, i);
|
|
@@ -3058,14 +3078,14 @@ C(Gt.prototype, {
|
|
|
3058
3078
|
this.key = Ie(), t && this.parent && this.parent.updateKey(t);
|
|
3059
3079
|
},
|
|
3060
3080
|
updateType() {
|
|
3061
|
-
this.originType = this.rule.type, this.type =
|
|
3081
|
+
this.originType = this.rule.type, this.type = G(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
3062
3082
|
},
|
|
3063
3083
|
setParser(t) {
|
|
3064
3084
|
this.parser = t, t.init(this);
|
|
3065
3085
|
},
|
|
3066
3086
|
initProp() {
|
|
3067
3087
|
var e, r, i;
|
|
3068
|
-
const t =
|
|
3088
|
+
const t = v({}, this.rule);
|
|
3069
3089
|
delete t.children, delete t.validate, this.prop = ee({}, [t, ...Object.keys(this.payload).map((s) => this.payload[s]), this.computed]), t.col && ((e = t.col) == null ? void 0 : e.show) !== !1 && (this.prop.col.show = !0), this.prop.validate = [...((i = (r = this.refRule) == null ? void 0 : r.__$validate) == null ? void 0 : i.value) || [], ...this.prop.validate || []];
|
|
3070
3090
|
},
|
|
3071
3091
|
initNone() {
|
|
@@ -3148,7 +3168,7 @@ function fi(t) {
|
|
|
3148
3168
|
parseRule(e) {
|
|
3149
3169
|
const r = ht(e);
|
|
3150
3170
|
return Object.defineProperties(r, {
|
|
3151
|
-
__origin__:
|
|
3171
|
+
__origin__: ze(e, !0)
|
|
3152
3172
|
}), ci(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
3153
3173
|
i && this.loadFn(i, r);
|
|
3154
3174
|
}), this.loadCtrl(r), r.update && (r.update = z(r.update)), r;
|
|
@@ -3199,8 +3219,8 @@ function fi(t) {
|
|
|
3199
3219
|
let l = ht(o);
|
|
3200
3220
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3201
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);
|
|
3202
|
-
let f,
|
|
3203
|
-
if (
|
|
3222
|
+
let f, d = !1, p = !!o.__fc__, m = l.value;
|
|
3223
|
+
if (p) {
|
|
3204
3224
|
if (f = o.__fc__, m = f.defaultValue, f.deleted) {
|
|
3205
3225
|
if (bt(f))
|
|
3206
3226
|
return;
|
|
@@ -3208,24 +3228,24 @@ function fi(t) {
|
|
|
3208
3228
|
} else if (!f.check(this)) {
|
|
3209
3229
|
if (bt(f))
|
|
3210
3230
|
return;
|
|
3211
|
-
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;
|
|
3212
3232
|
}
|
|
3213
3233
|
}
|
|
3214
3234
|
if (f)
|
|
3215
3235
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3216
3236
|
else {
|
|
3217
|
-
const
|
|
3218
|
-
f = new Gt(this,
|
|
3237
|
+
const O = this.parseRule(o);
|
|
3238
|
+
f = new Gt(this, O, m), this.bindParser(f);
|
|
3219
3239
|
}
|
|
3220
|
-
[!1, !0].forEach((
|
|
3240
|
+
[!1, !0].forEach((O) => this.parseEmit(f, O)), 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");
|
|
3221
3241
|
const $ = f.loadChildrenPending();
|
|
3222
3242
|
if (f.parser.loadChildren === !1 || s($, f), !r) {
|
|
3223
|
-
const
|
|
3224
|
-
|
|
3243
|
+
const O = i(a);
|
|
3244
|
+
O > -1 || !a ? this.sort.splice(O + 1, 0, f.id) : this.sort.push(f.id);
|
|
3225
3245
|
}
|
|
3226
|
-
const
|
|
3227
|
-
return f.updated || (f.updated = !0, h.Function(
|
|
3228
|
-
this.refreshUpdate(f,
|
|
3246
|
+
const _ = f.rule;
|
|
3247
|
+
return f.updated || (f.updated = !0, h.Function(_.update) && this.bus.$once("load-end", () => {
|
|
3248
|
+
this.refreshUpdate(f, _.value, "init");
|
|
3229
3249
|
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3230
3250
|
}).filter((o) => !!o);
|
|
3231
3251
|
r && (r.children = n);
|
|
@@ -3237,12 +3257,12 @@ function fi(t) {
|
|
|
3237
3257
|
const r = hi(e), i = [], s = this.api;
|
|
3238
3258
|
if (!r.length) return !1;
|
|
3239
3259
|
for (let a = 0; a < r.length; a++) {
|
|
3240
|
-
const l = r[a], u = l.handle || function(
|
|
3241
|
-
return (he[l.condition || "=="] || he["=="])(
|
|
3260
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3261
|
+
return (he[l.condition || "=="] || he["=="])(d, l.value);
|
|
3242
3262
|
};
|
|
3243
3263
|
if (!h.trueArray(l.rule)) continue;
|
|
3244
|
-
const f = q(
|
|
3245
|
-
valid:
|
|
3264
|
+
const f = q(v({}, l), {
|
|
3265
|
+
valid: F(() => u(e.rule.value, s)),
|
|
3246
3266
|
ctrl: di(e, l.rule),
|
|
3247
3267
|
isHidden: h.String(l.rule[0])
|
|
3248
3268
|
});
|
|
@@ -3252,34 +3272,34 @@ function fi(t) {
|
|
|
3252
3272
|
const n = [];
|
|
3253
3273
|
let o = !1;
|
|
3254
3274
|
return this.deferSyncValue(() => {
|
|
3255
|
-
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: $ }) => {
|
|
3256
3276
|
if (a) {
|
|
3257
3277
|
l ? e.ctrlRule.push({
|
|
3258
3278
|
__ctrl: !0,
|
|
3259
3279
|
children: u,
|
|
3260
3280
|
valid: l
|
|
3261
3281
|
}) : m && e.ctrlRule.splice(e.ctrlRule.indexOf(m) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3262
|
-
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((
|
|
3263
|
-
this.api.setEffect(
|
|
3282
|
+
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((_) => {
|
|
3283
|
+
this.api.setEffect(_, "required", l);
|
|
3264
3284
|
}), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
3265
3285
|
});
|
|
3266
3286
|
return;
|
|
3267
3287
|
}
|
|
3268
3288
|
if (l) {
|
|
3269
3289
|
o = !0;
|
|
3270
|
-
const
|
|
3290
|
+
const _ = {
|
|
3271
3291
|
type: "fragment",
|
|
3272
3292
|
native: !0,
|
|
3273
3293
|
__ctrl: !0,
|
|
3274
3294
|
children: u
|
|
3275
3295
|
};
|
|
3276
|
-
e.ctrlRule.push(
|
|
3277
|
-
f ? s.prepend(
|
|
3296
|
+
e.ctrlRule.push(_), this.bus.$once("load-start", () => {
|
|
3297
|
+
f ? s.prepend(_, f, p) : d || p ? s.append(_, d || e.id, p) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, _);
|
|
3278
3298
|
});
|
|
3279
3299
|
} else {
|
|
3280
3300
|
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3281
|
-
const
|
|
3282
|
-
|
|
3301
|
+
const _ = x(m);
|
|
3302
|
+
_ && _.rm();
|
|
3283
3303
|
}
|
|
3284
3304
|
});
|
|
3285
3305
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
@@ -3293,7 +3313,7 @@ function fi(t) {
|
|
|
3293
3313
|
},
|
|
3294
3314
|
_reloadRule(e) {
|
|
3295
3315
|
e || (e = this.rules);
|
|
3296
|
-
const r =
|
|
3316
|
+
const r = v({}, this.ctxs);
|
|
3297
3317
|
this.clearNextTick(), this.initData(e), this.fc.rules = e, this.deferSyncValue(() => {
|
|
3298
3318
|
this.bus.$once("load-end", () => {
|
|
3299
3319
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
@@ -3309,7 +3329,7 @@ function fi(t) {
|
|
|
3309
3329
|
function ci(t) {
|
|
3310
3330
|
const e = Nt();
|
|
3311
3331
|
return Object.keys(e).forEach((r) => {
|
|
3312
|
-
j(t, r) ||
|
|
3332
|
+
j(t, r) || E(t, r, e[r]);
|
|
3313
3333
|
}), t;
|
|
3314
3334
|
}
|
|
3315
3335
|
function hi(t) {
|
|
@@ -3359,7 +3379,7 @@ function pi(t) {
|
|
|
3359
3379
|
setFormData(e, r) {
|
|
3360
3380
|
e.modelValue = r;
|
|
3361
3381
|
const i = e.getParentGroup();
|
|
3362
|
-
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);
|
|
3363
3383
|
},
|
|
3364
3384
|
rmSubRuleData(e) {
|
|
3365
3385
|
const r = e.getParentGroup();
|
|
@@ -3385,7 +3405,7 @@ function pi(t) {
|
|
|
3385
3405
|
this.subForm[e.id] = r;
|
|
3386
3406
|
},
|
|
3387
3407
|
deferSyncValue(e, r) {
|
|
3388
|
-
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r),
|
|
3408
|
+
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r), F(e), this.deferSyncFn === e && (this.deferSyncFn = null, e.sync && this.syncForm());
|
|
3389
3409
|
},
|
|
3390
3410
|
syncValue() {
|
|
3391
3411
|
if (this.deferSyncFn)
|
|
@@ -3403,7 +3423,7 @@ function pi(t) {
|
|
|
3403
3423
|
},
|
|
3404
3424
|
refreshUpdate(e, r, i, s) {
|
|
3405
3425
|
if (h.Function(e.rule.update)) {
|
|
3406
|
-
const n =
|
|
3426
|
+
const n = F(() => e.rule.update(r, e.origin, this.api, {
|
|
3407
3427
|
origin: i || "change",
|
|
3408
3428
|
linkField: s
|
|
3409
3429
|
}));
|
|
@@ -3483,21 +3503,21 @@ function gi(t) {
|
|
|
3483
3503
|
getParser(e) {
|
|
3484
3504
|
const r = this.fc.parsers, i = this.fc.renderDriver;
|
|
3485
3505
|
if (i) {
|
|
3486
|
-
const s = i.parsers || {}, n = s[e.originType] || s[
|
|
3506
|
+
const s = i.parsers || {}, n = s[e.originType] || s[G(e.type)] || s[e.trueType];
|
|
3487
3507
|
if (n)
|
|
3488
3508
|
return n;
|
|
3489
3509
|
}
|
|
3490
|
-
return r[e.originType] || r[
|
|
3510
|
+
return r[e.originType] || r[G(e.type)] || r[e.trueType] || we;
|
|
3491
3511
|
},
|
|
3492
3512
|
bindParser(e) {
|
|
3493
3513
|
e.setParser(this.getParser(e));
|
|
3494
3514
|
},
|
|
3495
3515
|
getType(e) {
|
|
3496
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
3497
|
-
return
|
|
3516
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[G(e)] || e;
|
|
3517
|
+
return G(i);
|
|
3498
3518
|
},
|
|
3499
3519
|
noWatch(e) {
|
|
3500
|
-
this.noWatchFn || (this.noWatchFn = e),
|
|
3520
|
+
this.noWatchFn || (this.noWatchFn = e), F(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3501
3521
|
},
|
|
3502
3522
|
watchCtx(e) {
|
|
3503
3523
|
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" && mi.indexOf(i) === -1).forEach((i) => {
|
|
@@ -3542,8 +3562,8 @@ function gi(t) {
|
|
|
3542
3562
|
const n = s.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3543
3563
|
return n ? this.api.t(n[1], { title: (a = (o = e.refRule) == null ? void 0 : o.__$title) == null ? void 0 : a.value }) : s;
|
|
3544
3564
|
};
|
|
3545
|
-
return
|
|
3546
|
-
const n =
|
|
3565
|
+
return J(e.rule.validate).map((s) => {
|
|
3566
|
+
const n = v({}, s);
|
|
3547
3567
|
if (n.message && (n.message = i(n.message)), h.Function(n.validator)) {
|
|
3548
3568
|
const o = e;
|
|
3549
3569
|
n.validator = function(...a) {
|
|
@@ -3558,7 +3578,7 @@ function gi(t) {
|
|
|
3558
3578
|
}
|
|
3559
3579
|
if (n.adapter) {
|
|
3560
3580
|
if (typeof n.error == "object") {
|
|
3561
|
-
const o =
|
|
3581
|
+
const o = v({}, n.error);
|
|
3562
3582
|
Object.keys(o).forEach((a) => {
|
|
3563
3583
|
o[a] = i(o[a]);
|
|
3564
3584
|
}), n.error = o;
|
|
@@ -3595,7 +3615,7 @@ function gi(t) {
|
|
|
3595
3615
|
},
|
|
3596
3616
|
adapterValidate(e, r) {
|
|
3597
3617
|
const i = (s, n) => {
|
|
3598
|
-
if ((e.beforeValidate &&
|
|
3618
|
+
if ((e.beforeValidate && F(() => e.beforeValidate({
|
|
3599
3619
|
value: s,
|
|
3600
3620
|
api: this.api,
|
|
3601
3621
|
validate: e,
|
|
@@ -3608,7 +3628,7 @@ function gi(t) {
|
|
|
3608
3628
|
let l = "";
|
|
3609
3629
|
typeof e.error == "object" && (l = e.error[a] || e.error.default), !l && typeof e.message == "string" && (l = e.message), l || (l = this.getValidateMessage(r, { key: a, rule: e[a] })), n(l);
|
|
3610
3630
|
} else if (e.validator) {
|
|
3611
|
-
const l = e.validator &&
|
|
3631
|
+
const l = e.validator && F(() => e.validator(s, n));
|
|
3612
3632
|
l && h.Function(l.then) && l.then(() => n()).catch((u) => n(u));
|
|
3613
3633
|
} else
|
|
3614
3634
|
n();
|
|
@@ -3715,30 +3735,30 @@ function gi(t) {
|
|
|
3715
3735
|
const l = a.mode === "OR";
|
|
3716
3736
|
let u = !0;
|
|
3717
3737
|
for (let f = 0; f < a.group.length; f++) {
|
|
3718
|
-
const
|
|
3719
|
-
let
|
|
3720
|
-
if (
|
|
3721
|
-
$ = this.fc.getLoadData(
|
|
3722
|
-
else if (
|
|
3723
|
-
m = pt(
|
|
3724
|
-
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)
|
|
3725
3745
|
return !0;
|
|
3726
|
-
let
|
|
3727
|
-
if (
|
|
3746
|
+
let _ = d.compare;
|
|
3747
|
+
if (_ && (_ = pt(_ || "")), d.mode ? p = n(d) : he[d.condition] ? h.Function(d.handler) ? p = F(() => d.handler(this.api, e.rule)) : p = F(() => 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}, ${_ || "$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)
|
|
3728
3748
|
return !0;
|
|
3729
|
-
l || (u = u &&
|
|
3749
|
+
l || (u = u && p);
|
|
3730
3750
|
}
|
|
3731
3751
|
return l ? !1 : u;
|
|
3732
3752
|
};
|
|
3733
3753
|
let o = n(r);
|
|
3734
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ?
|
|
3754
|
+
return o = r.invert === !0 ? !o : o, r.linkage ? o ? F(() => this.computeValue(r.linkage, e, s), void 0) : Ce : r.linkageVariable ? o ? F(() => this.fc.getLoadData(r.linkageVariable), void 0) : Ce : o;
|
|
3735
3755
|
} else if (h.Function(r))
|
|
3736
3756
|
i = () => r(this.api.form, this.api, e.rule);
|
|
3737
3757
|
else {
|
|
3738
3758
|
const s = e.getParentGroup();
|
|
3739
3759
|
i = () => this.computeValue(r, e, s);
|
|
3740
3760
|
}
|
|
3741
|
-
return
|
|
3761
|
+
return F(i, void 0);
|
|
3742
3762
|
},
|
|
3743
3763
|
computeValue(e, r, i) {
|
|
3744
3764
|
const s = this, n = Object.keys(this.fc.formulas).reduce((o, a) => (o[a] = function(...l) {
|
|
@@ -3749,7 +3769,7 @@ function gi(t) {
|
|
|
3749
3769
|
fc: s.fc
|
|
3750
3770
|
}, ...l);
|
|
3751
3771
|
}, o), {});
|
|
3752
|
-
return
|
|
3772
|
+
return F(() => new Function("$formulas", "$form", "$scope", "$group", "$rule", "$api", `with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form, n, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, i ? this.subRuleData[i.id] || {} : {}, r.rule, this.api));
|
|
3753
3773
|
},
|
|
3754
3774
|
updateChildren(e, r, i) {
|
|
3755
3775
|
this.deferSyncValue(() => {
|
|
@@ -3794,18 +3814,18 @@ function yi(t) {
|
|
|
3794
3814
|
this.fc.targetFormDriver(e, this.api, this.fc), this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3795
3815
|
},
|
|
3796
3816
|
emitEvent(e, ...r) {
|
|
3797
|
-
const i = this.options[e] || this.options[
|
|
3817
|
+
const i = this.options[e] || this.options[G("on-" + e)];
|
|
3798
3818
|
if (i) {
|
|
3799
3819
|
const s = z(i);
|
|
3800
|
-
h.Function(s) &&
|
|
3820
|
+
h.Function(s) && F(() => s(...r));
|
|
3801
3821
|
}
|
|
3802
3822
|
this.bus.$emit(e, ...r);
|
|
3803
3823
|
},
|
|
3804
3824
|
targetHook(e, r, i) {
|
|
3805
|
-
var l, u, f,
|
|
3806
|
-
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (
|
|
3807
|
-
|
|
3808
|
-
|
|
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(($) => {
|
|
3828
|
+
F(() => $(q(v({
|
|
3809
3829
|
args: Object.values(i || {})
|
|
3810
3830
|
}, i || {}), {
|
|
3811
3831
|
self: e.rule,
|
|
@@ -3820,8 +3840,8 @@ function yi(t) {
|
|
|
3820
3840
|
n(s);
|
|
3821
3841
|
let o = "deep" + Nr(r), a = e.parent;
|
|
3822
3842
|
for (; a; ) {
|
|
3823
|
-
let
|
|
3824
|
-
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;
|
|
3825
3845
|
}
|
|
3826
3846
|
}
|
|
3827
3847
|
});
|
|
@@ -3885,19 +3905,19 @@ function $i(t) {
|
|
|
3885
3905
|
},
|
|
3886
3906
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3887
3907
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3888
|
-
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u),
|
|
3908
|
+
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), v({}, r.effect || {}));
|
|
3889
3909
|
Object.keys(l).forEach((u) => {
|
|
3890
3910
|
const f = this.providers[u];
|
|
3891
3911
|
if (!f || f.input && !i) return;
|
|
3892
|
-
let
|
|
3912
|
+
let d;
|
|
3893
3913
|
if (!f._c)
|
|
3894
|
-
|
|
3914
|
+
d = "*";
|
|
3895
3915
|
else if (f._used.indexOf(s) > -1)
|
|
3896
|
-
|
|
3916
|
+
d = s;
|
|
3897
3917
|
else
|
|
3898
3918
|
return;
|
|
3899
|
-
const
|
|
3900
|
-
e && (
|
|
3919
|
+
const p = v({ 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]);
|
|
3901
3921
|
});
|
|
3902
3922
|
}
|
|
3903
3923
|
});
|
|
@@ -3914,7 +3934,7 @@ function vi(t) {
|
|
|
3914
3934
|
return r.length ? r : !1;
|
|
3915
3935
|
} else return h.String(e) ? [e] : !1;
|
|
3916
3936
|
}
|
|
3917
|
-
function
|
|
3937
|
+
function X(t) {
|
|
3918
3938
|
Bt(this, {
|
|
3919
3939
|
options() {
|
|
3920
3940
|
return t.options.value || {};
|
|
@@ -3950,11 +3970,11 @@ function x(t) {
|
|
|
3950
3970
|
this.lifecycle("reload");
|
|
3951
3971
|
}
|
|
3952
3972
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new it(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3953
|
-
const i =
|
|
3973
|
+
const i = F(() => r(e, this));
|
|
3954
3974
|
return i && i !== e && C(e, i), e;
|
|
3955
3975
|
}, ti(this));
|
|
3956
3976
|
}
|
|
3957
|
-
C(
|
|
3977
|
+
C(X.prototype, {
|
|
3958
3978
|
initData(t) {
|
|
3959
3979
|
C(this, {
|
|
3960
3980
|
ctxs: {},
|
|
@@ -3968,38 +3988,38 @@ C(x.prototype, {
|
|
|
3968
3988
|
this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
|
|
3969
3989
|
},
|
|
3970
3990
|
updateAppendData() {
|
|
3971
|
-
this.appendData =
|
|
3991
|
+
this.appendData = v(v(v({}, this.options.formData || {}), this.fc.vm.$props.value || {}), this.appendData);
|
|
3972
3992
|
},
|
|
3973
3993
|
isBreakWatch() {
|
|
3974
3994
|
return this.loading || this.noWatchFn || this.reloading;
|
|
3975
3995
|
},
|
|
3976
3996
|
globalBeforeFetch(t) {
|
|
3977
3997
|
return new Promise((e, r) => {
|
|
3978
|
-
const i = this.options.beforeFetch &&
|
|
3998
|
+
const i = this.options.beforeFetch && F(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3979
3999
|
i && h.Function(i.then) ? i.then(e).catch(r) : e();
|
|
3980
4000
|
});
|
|
3981
4001
|
},
|
|
3982
4002
|
beforeFetch(t) {
|
|
3983
4003
|
return new Promise((e, r) => {
|
|
3984
|
-
const i = t && t.beforeFetch &&
|
|
4004
|
+
const i = t && t.beforeFetch && F(() => t.beforeFetch(t, { api: this.api }));
|
|
3985
4005
|
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3986
4006
|
}).then(() => this.globalBeforeFetch(t));
|
|
3987
4007
|
},
|
|
3988
4008
|
beforeSubmit(t) {
|
|
3989
4009
|
return new Promise((e, r) => {
|
|
3990
|
-
const i = this.options.beforeSubmit &&
|
|
4010
|
+
const i = this.options.beforeSubmit && F(() => this.options.beforeSubmit(t, { api: this.api }));
|
|
3991
4011
|
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3992
4012
|
});
|
|
3993
4013
|
}
|
|
3994
4014
|
});
|
|
3995
|
-
si(
|
|
3996
|
-
oi(
|
|
3997
|
-
li(
|
|
3998
|
-
fi(
|
|
3999
|
-
pi(
|
|
4000
|
-
gi(
|
|
4001
|
-
yi(
|
|
4002
|
-
$i(
|
|
4015
|
+
si(X);
|
|
4016
|
+
oi(X);
|
|
4017
|
+
li(X);
|
|
4018
|
+
fi(X);
|
|
4019
|
+
pi(X);
|
|
4020
|
+
gi(X);
|
|
4021
|
+
yi(X);
|
|
4022
|
+
$i(X);
|
|
4003
4023
|
const _i = "fcFragment", Ne = {
|
|
4004
4024
|
name: _i,
|
|
4005
4025
|
functional: !0,
|
|
@@ -4045,7 +4065,7 @@ function wi() {
|
|
|
4045
4065
|
},
|
|
4046
4066
|
use(r) {
|
|
4047
4067
|
Object.keys(r).forEach((i) => {
|
|
4048
|
-
const s = ve(i), n =
|
|
4068
|
+
const s = ve(i), n = kt(i).toLocaleLowerCase(), o = r[i];
|
|
4049
4069
|
e.alias(i, o), [i, s, n].forEach((a) => {
|
|
4050
4070
|
e.prototype[a] = function(l, u) {
|
|
4051
4071
|
return this.make(t[i] || a, l, u);
|
|
@@ -4127,18 +4147,18 @@ const Fi = function(t) {
|
|
|
4127
4147
|
_fn: [],
|
|
4128
4148
|
loaded(r, i, s) {
|
|
4129
4149
|
this.deleted(r), P(() => {
|
|
4130
|
-
let n =
|
|
4150
|
+
let n = J(r.getValue());
|
|
4131
4151
|
const o = [];
|
|
4132
4152
|
n.forEach((a) => {
|
|
4133
4153
|
if (a && (a.attr || a.template)) {
|
|
4134
|
-
let l = (
|
|
4135
|
-
let
|
|
4136
|
-
i && i.__fc__ && (
|
|
4154
|
+
let l = (d) => {
|
|
4155
|
+
let p;
|
|
4156
|
+
i && i.__fc__ && (p = i.__fc__.getParentGroup());
|
|
4137
4157
|
let m;
|
|
4138
|
-
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));
|
|
4139
4159
|
const $ = a.modify ? i : r.getProp();
|
|
4140
|
-
a.to === "child" ? $.children ?
|
|
4141
|
-
}, 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);
|
|
4142
4162
|
const f = t.watchLoadData(u);
|
|
4143
4163
|
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
4144
4164
|
}
|
|
@@ -4152,7 +4172,7 @@ const Fi = function(t) {
|
|
|
4152
4172
|
}
|
|
4153
4173
|
};
|
|
4154
4174
|
return e.watch = e.loaded, e;
|
|
4155
|
-
},
|
|
4175
|
+
}, Ei = function(t) {
|
|
4156
4176
|
const e = {
|
|
4157
4177
|
name: "t",
|
|
4158
4178
|
_fn: [],
|
|
@@ -4166,11 +4186,11 @@ const Fi = function(t) {
|
|
|
4166
4186
|
const u = typeof l == "object";
|
|
4167
4187
|
let f = (m) => {
|
|
4168
4188
|
let $ = t.t(u ? l.attr : l, u ? l.params : null, m);
|
|
4169
|
-
const
|
|
4170
|
-
a === "child" ?
|
|
4171
|
-
},
|
|
4172
|
-
const
|
|
4173
|
-
f = se(f, l.wait || 300), l.watch !== !1 ? o.push(
|
|
4189
|
+
const _ = u && l.modify ? i : r.getProp();
|
|
4190
|
+
a === "child" ? _.children ? E(_.children, 0, $) : E(_, "children", [$]) : oe(_, 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();
|
|
4174
4194
|
}
|
|
4175
4195
|
}), this._fn[r.id] = o;
|
|
4176
4196
|
},
|
|
@@ -4189,9 +4209,9 @@ const Fi = function(t) {
|
|
|
4189
4209
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4190
4210
|
else {
|
|
4191
4211
|
h.Object(i) || (i = { method: i });
|
|
4192
|
-
const s = i.method, n = q(
|
|
4212
|
+
const s = i.method, n = q(v({}, i), {
|
|
4193
4213
|
validator(...o) {
|
|
4194
|
-
const a =
|
|
4214
|
+
const a = x(e);
|
|
4195
4215
|
if (a)
|
|
4196
4216
|
return r.exec(a.id, h.String(s) ? s : "formCreateValidate", ...o, {
|
|
4197
4217
|
attr: t,
|
|
@@ -4206,7 +4226,7 @@ const Fi = function(t) {
|
|
|
4206
4226
|
watch(...t) {
|
|
4207
4227
|
Kt.load(...t);
|
|
4208
4228
|
}
|
|
4209
|
-
},
|
|
4229
|
+
}, ki = function(t) {
|
|
4210
4230
|
function e(s) {
|
|
4211
4231
|
return h.String(s) && (s = {
|
|
4212
4232
|
action: s,
|
|
@@ -4216,58 +4236,58 @@ const Fi = function(t) {
|
|
|
4216
4236
|
function r(s, n, o) {
|
|
4217
4237
|
let a = s.value;
|
|
4218
4238
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
4219
|
-
const l = (
|
|
4220
|
-
|
|
4239
|
+
const l = (d) => {
|
|
4240
|
+
d === void 0 ? s.clearProp() : oe(s.getProp(), a.to || "options", d), o.sync(n);
|
|
4221
4241
|
};
|
|
4222
4242
|
if (!a || !a.action && !a.key) {
|
|
4223
4243
|
l(void 0);
|
|
4224
4244
|
return;
|
|
4225
4245
|
}
|
|
4226
4246
|
if (a = Y(a), a.to || (a.to = "options"), a.key) {
|
|
4227
|
-
const
|
|
4228
|
-
if (!
|
|
4247
|
+
const d = t.$handle.options.globalData[a.key];
|
|
4248
|
+
if (!d) {
|
|
4229
4249
|
l(void 0);
|
|
4230
4250
|
return;
|
|
4231
4251
|
}
|
|
4232
|
-
if (
|
|
4233
|
-
l(
|
|
4252
|
+
if (d.type === "static") {
|
|
4253
|
+
l(d.data);
|
|
4234
4254
|
return;
|
|
4235
4255
|
} else
|
|
4236
|
-
a =
|
|
4256
|
+
a = v(v({}, a), d);
|
|
4237
4257
|
}
|
|
4238
4258
|
const u = a.onError, f = () => {
|
|
4239
4259
|
if (!s.getValue())
|
|
4240
4260
|
return s.clearProp(), o.sync(n), !0;
|
|
4241
4261
|
};
|
|
4242
|
-
i._fn[s.id] = t.watchLoadData(se((
|
|
4243
|
-
if (
|
|
4262
|
+
i._fn[s.id] = t.watchLoadData(se((d, p) => {
|
|
4263
|
+
if (p && a.watch === !1)
|
|
4244
4264
|
return i._fn[s.id]();
|
|
4245
|
-
const m = t.$handle.loadFetchVar(Y(a),
|
|
4265
|
+
const m = t.$handle.loadFetchVar(Y(a), d, n), $ = q(v({
|
|
4246
4266
|
headers: {}
|
|
4247
4267
|
}, m), {
|
|
4248
|
-
onSuccess(
|
|
4268
|
+
onSuccess(_, O) {
|
|
4249
4269
|
if (f()) return;
|
|
4250
|
-
let
|
|
4270
|
+
let M = (L) => O ? L : j(L, "data") ? L.data : L;
|
|
4251
4271
|
const A = z(m.parse);
|
|
4252
|
-
h.Function(A) ?
|
|
4272
|
+
h.Function(A) ? M = A : A && h.String(A) && (M = (L) => B(L, A)), Ae(M(_, n, o)).then((L) => {
|
|
4253
4273
|
l(L);
|
|
4254
4274
|
});
|
|
4255
4275
|
},
|
|
4256
|
-
onError(
|
|
4257
|
-
l(void 0), !f() && (u || ((
|
|
4276
|
+
onError(_) {
|
|
4277
|
+
l(void 0), !f() && (u || ((O) => Ye(O.message || "fetch fail " + m.action)))(_, n, o);
|
|
4258
4278
|
}
|
|
4259
4279
|
});
|
|
4260
4280
|
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
4261
4281
|
if (h.Function(m.action)) {
|
|
4262
|
-
Ae(m.action(n, o)).then((
|
|
4263
|
-
$.onSuccess(
|
|
4264
|
-
}).catch((
|
|
4265
|
-
$.onError(
|
|
4282
|
+
Ae(m.action(n, o)).then((_) => {
|
|
4283
|
+
$.onSuccess(_, !0);
|
|
4284
|
+
}).catch((_) => {
|
|
4285
|
+
$.onError(_);
|
|
4266
4286
|
});
|
|
4267
4287
|
return;
|
|
4268
4288
|
}
|
|
4269
|
-
|
|
4270
|
-
}).catch((
|
|
4289
|
+
F(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
4290
|
+
}).catch((_) => {
|
|
4271
4291
|
});
|
|
4272
4292
|
}, a.wait || 600));
|
|
4273
4293
|
}
|
|
@@ -4286,9 +4306,9 @@ const Fi = function(t) {
|
|
|
4286
4306
|
};
|
|
4287
4307
|
return i;
|
|
4288
4308
|
}, Ri = {
|
|
4289
|
-
fetch:
|
|
4309
|
+
fetch: ki,
|
|
4290
4310
|
loadData: Fi,
|
|
4291
|
-
t:
|
|
4311
|
+
t: Ei,
|
|
4292
4312
|
componentValidate: Kt
|
|
4293
4313
|
};
|
|
4294
4314
|
function Si(t) {
|
|
@@ -4455,20 +4475,20 @@ function Ui(t) {
|
|
|
4455
4475
|
At.push(...e), et.push(...r), tt.push(...i), Mt([...e, ...r, ...i]);
|
|
4456
4476
|
}
|
|
4457
4477
|
let Hi = 1;
|
|
4458
|
-
const
|
|
4478
|
+
const H = {}, _t = Symbol("defValue");
|
|
4459
4479
|
function Wt(t) {
|
|
4460
4480
|
const e = {
|
|
4461
4481
|
[Ne.name]: Ne
|
|
4462
4482
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4463
4483
|
t.extendApi
|
|
4464
|
-
], u =
|
|
4465
|
-
let
|
|
4466
|
-
const
|
|
4467
|
-
$mobile:
|
|
4468
|
-
}), $ = wi(),
|
|
4484
|
+
], u = v({}, Ri), f = Yr();
|
|
4485
|
+
let d = { global: {} };
|
|
4486
|
+
const p = t.isMobile === !0, m = ne({
|
|
4487
|
+
$mobile: p
|
|
4488
|
+
}), $ = wi(), _ = {}, O = {};
|
|
4469
4489
|
Ui(t.attrs || {});
|
|
4470
|
-
function
|
|
4471
|
-
const g =
|
|
4490
|
+
function M(c) {
|
|
4491
|
+
const g = H[c];
|
|
4472
4492
|
if (Array.isArray(g))
|
|
4473
4493
|
return g.map((y) => y.api());
|
|
4474
4494
|
if (g)
|
|
@@ -4483,7 +4503,7 @@ function Wt(t) {
|
|
|
4483
4503
|
}
|
|
4484
4504
|
function pe() {
|
|
4485
4505
|
const c = Me(...arguments);
|
|
4486
|
-
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(
|
|
4506
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(v({}, c.prop), {
|
|
4487
4507
|
name: c.id
|
|
4488
4508
|
}));
|
|
4489
4509
|
}
|
|
@@ -4494,27 +4514,27 @@ function Wt(t) {
|
|
|
4494
4514
|
if (arguments.length === 0)
|
|
4495
4515
|
return we;
|
|
4496
4516
|
if (typeof c == "string" && arguments.length === 1)
|
|
4497
|
-
return r[
|
|
4517
|
+
return r[G(c)];
|
|
4498
4518
|
const g = Me(...arguments);
|
|
4499
4519
|
if (!g.id || !g.prop) return we;
|
|
4500
|
-
const y =
|
|
4520
|
+
const y = G(g.id), b = g.prop, w = b.merge === !0 ? r[y] : void 0;
|
|
4501
4521
|
r[y] = je(b, w || we), f[y] = T(y), b.maker && C(f, b.maker);
|
|
4502
4522
|
}
|
|
4503
|
-
function
|
|
4523
|
+
function k(c, g) {
|
|
4504
4524
|
let y;
|
|
4505
4525
|
if (h.String(c)) {
|
|
4506
4526
|
if (y = c, g === void 0)
|
|
4507
4527
|
return ["form-create", "formcreate"].indexOf(y) > -1 ? S() : e[y];
|
|
4508
4528
|
} else
|
|
4509
|
-
y =
|
|
4529
|
+
y = G(c.name), g = c;
|
|
4510
4530
|
if (!y || !g) return;
|
|
4511
|
-
const b =
|
|
4531
|
+
const b = G(y);
|
|
4512
4532
|
e[y] = g, e[b] = g, delete $.aliasMap[y], delete $.aliasMap[b], delete r[y], delete r[b], g.formCreateParser && me(y, g.formCreateParser);
|
|
4513
4533
|
}
|
|
4514
4534
|
function S() {
|
|
4515
4535
|
return Zr(Be, e, i);
|
|
4516
4536
|
}
|
|
4517
|
-
function
|
|
4537
|
+
function U() {
|
|
4518
4538
|
return Ne;
|
|
4519
4539
|
}
|
|
4520
4540
|
function ge(c, g) {
|
|
@@ -4525,9 +4545,9 @@ function Wt(t) {
|
|
|
4525
4545
|
const w = b.$refs.fc.formCreate;
|
|
4526
4546
|
return w.$parent = y, Mi(w.options).appendChild(b.$el), w.api();
|
|
4527
4547
|
}
|
|
4528
|
-
je(K,
|
|
4529
|
-
function
|
|
4530
|
-
let g =
|
|
4548
|
+
je(K, O);
|
|
4549
|
+
function zt(c) {
|
|
4550
|
+
let g = v({}, t);
|
|
4531
4551
|
return c ? g.inherit = {
|
|
4532
4552
|
components: e,
|
|
4533
4553
|
parsers: r,
|
|
@@ -4536,7 +4556,7 @@ function Wt(t) {
|
|
|
4536
4556
|
providers: u,
|
|
4537
4557
|
useApps: o,
|
|
4538
4558
|
maker: f,
|
|
4539
|
-
formulas:
|
|
4559
|
+
formulas: _,
|
|
4540
4560
|
loadData: m
|
|
4541
4561
|
} : delete g.inherit, Wt(g);
|
|
4542
4562
|
}
|
|
@@ -4544,33 +4564,33 @@ function Wt(t) {
|
|
|
4544
4564
|
s[c] = g;
|
|
4545
4565
|
}
|
|
4546
4566
|
function Zt(c, g) {
|
|
4547
|
-
|
|
4567
|
+
_[c] = g;
|
|
4548
4568
|
}
|
|
4549
4569
|
function Qt(c, g) {
|
|
4550
4570
|
const y = n[c] || {}, b = y.parsers || {};
|
|
4551
4571
|
g.parsers && Object.keys(g.parsers).forEach((w) => {
|
|
4552
4572
|
b[w] = je(g.parsers[w], we);
|
|
4553
|
-
}), g.name = c, n[c] = q(
|
|
4573
|
+
}), g.name = c, n[c] = q(v(v({}, y), g), { parsers: b });
|
|
4554
4574
|
}
|
|
4555
|
-
function
|
|
4556
|
-
c && Object.keys(
|
|
4557
|
-
(Array.isArray(
|
|
4575
|
+
function Ee(c) {
|
|
4576
|
+
c && Object.keys(H).forEach((g) => {
|
|
4577
|
+
(Array.isArray(H[g]) ? H[g] : [H[g]]).forEach((b) => {
|
|
4558
4578
|
b.bus.$emit("$loadData." + c);
|
|
4559
4579
|
});
|
|
4560
4580
|
});
|
|
4561
4581
|
}
|
|
4562
4582
|
function Te(c, g) {
|
|
4563
|
-
oe(m, c, g),
|
|
4583
|
+
oe(m, c, g), Ee(c);
|
|
4564
4584
|
}
|
|
4565
|
-
function
|
|
4566
|
-
const y = (...b) =>
|
|
4585
|
+
function ke(c, g) {
|
|
4586
|
+
const y = (...b) => F(() => g(...b));
|
|
4567
4587
|
y._driver = !0, Te(c, y);
|
|
4568
4588
|
}
|
|
4569
4589
|
function st(c, g) {
|
|
4570
4590
|
const y = (c || "").split(".");
|
|
4571
4591
|
c = y.shift();
|
|
4572
4592
|
const b = y.join(".");
|
|
4573
|
-
if (j(m, c) ||
|
|
4593
|
+
if (j(m, c) || E(m, c, _t), m[c] !== _t) {
|
|
4574
4594
|
let w = m[c];
|
|
4575
4595
|
return w && w._driver ? w = w(b) : y.length && (w = B(w, y)), w == null || w === "" ? g : w;
|
|
4576
4596
|
} else
|
|
@@ -4580,7 +4600,7 @@ function Wt(t) {
|
|
|
4580
4600
|
l.push(c);
|
|
4581
4601
|
}
|
|
4582
4602
|
function er(c) {
|
|
4583
|
-
delete m[c],
|
|
4603
|
+
delete m[c], Ee(c);
|
|
4584
4604
|
}
|
|
4585
4605
|
function tr(c, g) {
|
|
4586
4606
|
a.push({ name: c, callback: g });
|
|
@@ -4594,8 +4614,8 @@ function Wt(t) {
|
|
|
4594
4614
|
parsers: r,
|
|
4595
4615
|
providers: u,
|
|
4596
4616
|
modelFields: s,
|
|
4597
|
-
formulas:
|
|
4598
|
-
isMobile:
|
|
4617
|
+
formulas: _,
|
|
4618
|
+
isMobile: p,
|
|
4599
4619
|
rules: c.$props.rule,
|
|
4600
4620
|
name: c.$props.name || Ie(),
|
|
4601
4621
|
inFor: c.$props.inFor,
|
|
@@ -4606,7 +4626,7 @@ function Wt(t) {
|
|
|
4606
4626
|
get: null,
|
|
4607
4627
|
drivers: n,
|
|
4608
4628
|
renderDriver: null,
|
|
4609
|
-
refreshData:
|
|
4629
|
+
refreshData: Ee,
|
|
4610
4630
|
loadData: m,
|
|
4611
4631
|
CreateNode: $,
|
|
4612
4632
|
bus: new Si(),
|
|
@@ -4621,9 +4641,9 @@ function Wt(t) {
|
|
|
4621
4641
|
N(this.options, () => {
|
|
4622
4642
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4623
4643
|
}, { deep: !0 });
|
|
4624
|
-
}), 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 X(this), this.name && (this.inFor ? (H[this.name] || (H[this.name] = []), H[this.name].push(this)) : H[this.name] = this);
|
|
4625
4645
|
}
|
|
4626
|
-
Be.isMobile =
|
|
4646
|
+
Be.isMobile = p, C(Be.prototype, {
|
|
4627
4647
|
init() {
|
|
4628
4648
|
this.isSub() && this.unwatch.push(N(() => this.vm.parent.fc.options.value, () => {
|
|
4629
4649
|
this.initOptions(), this.$handle.api.refresh();
|
|
@@ -4631,7 +4651,7 @@ function Wt(t) {
|
|
|
4631
4651
|
},
|
|
4632
4652
|
targetFormDriver(c, ...g) {
|
|
4633
4653
|
if (this.bus.$emit(c, ...g), this.renderDriver && this.renderDriver[c])
|
|
4634
|
-
return
|
|
4654
|
+
return F(() => this.renderDriver[c](...g));
|
|
4635
4655
|
},
|
|
4636
4656
|
t(c, g, y) {
|
|
4637
4657
|
let b = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
@@ -4685,7 +4705,7 @@ function Wt(t) {
|
|
|
4685
4705
|
},
|
|
4686
4706
|
globalLanguageDriver(c) {
|
|
4687
4707
|
let g = this.vm.top.$props.t, y = this.vm.top.$props.locale, b;
|
|
4688
|
-
if (g && (b =
|
|
4708
|
+
if (g && (b = F(() => g(c))), b == null && y && typeof y == "object" && (b = B(y, c)), b == null) {
|
|
4689
4709
|
const w = this.options.value.language || {}, V = this.getLocale();
|
|
4690
4710
|
b = B(w[V] || {}, c), b == null && (b = B(Li[V] || {}, c));
|
|
4691
4711
|
}
|
|
@@ -4740,7 +4760,7 @@ function Wt(t) {
|
|
|
4740
4760
|
watchLoadData(c, g) {
|
|
4741
4761
|
let y = {};
|
|
4742
4762
|
const b = (R) => {
|
|
4743
|
-
this.get || (this.get = w),
|
|
4763
|
+
this.get || (this.get = w), F(() => {
|
|
4744
4764
|
c(w, R);
|
|
4745
4765
|
}), this.get === w && (this.get = void 0);
|
|
4746
4766
|
}, w = (R, ae) => {
|
|
@@ -4773,22 +4793,22 @@ function Wt(t) {
|
|
|
4773
4793
|
},
|
|
4774
4794
|
initOptions() {
|
|
4775
4795
|
this.options.value = {};
|
|
4776
|
-
let c =
|
|
4796
|
+
let c = v({
|
|
4777
4797
|
formData: {},
|
|
4778
4798
|
submitBtn: {},
|
|
4779
4799
|
resetBtn: {},
|
|
4780
4800
|
globalEvent: {},
|
|
4781
4801
|
globalData: {}
|
|
4782
|
-
}, Y(
|
|
4802
|
+
}, Y(d));
|
|
4783
4803
|
const g = this.isSub();
|
|
4784
4804
|
g && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$props.option || {});
|
|
4785
4805
|
const y = this.api();
|
|
4786
4806
|
this.targetFormDriver("initOptions", c, { api: y, isSubForm: g }), this.updateOptions(c);
|
|
4787
4807
|
},
|
|
4788
4808
|
mergeOptions(c, g, y) {
|
|
4789
|
-
return g =
|
|
4809
|
+
return g = v({}, g || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "beforeUnmount", "beforeSubmit", "onBeforeUnmount", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4790
4810
|
delete g[b];
|
|
4791
|
-
}), g.global && (c.global =
|
|
4811
|
+
}), g.global && (c.global = xr(c.global, g.global), delete g.global), this.$handle.$manager.mergeOptions([g], c), c;
|
|
4792
4812
|
},
|
|
4793
4813
|
updateOptions(c) {
|
|
4794
4814
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4803,12 +4823,12 @@ function Wt(t) {
|
|
|
4803
4823
|
this.$handle.mounted();
|
|
4804
4824
|
},
|
|
4805
4825
|
unmount() {
|
|
4806
|
-
if (
|
|
4826
|
+
if (F(() => this.$handle.lifecycle("beforeUnmount")), this.name)
|
|
4807
4827
|
if (this.inFor) {
|
|
4808
|
-
const c =
|
|
4809
|
-
|
|
4828
|
+
const c = H[this.name].indexOf(this);
|
|
4829
|
+
H[this.name].splice(c, 1);
|
|
4810
4830
|
} else
|
|
4811
|
-
delete
|
|
4831
|
+
delete H[this.name];
|
|
4812
4832
|
a.forEach((c) => {
|
|
4813
4833
|
this.bus.$off(c.name, c.callback);
|
|
4814
4834
|
}), this.tmpData = {}, this.unwatch.forEach((c) => c()), this.unwatch = [], this.$handle.reloadRule([]);
|
|
@@ -4821,24 +4841,24 @@ function Wt(t) {
|
|
|
4821
4841
|
C(c, {
|
|
4822
4842
|
version: t.version,
|
|
4823
4843
|
ui: t.ui,
|
|
4824
|
-
isMobile:
|
|
4844
|
+
isMobile: p,
|
|
4825
4845
|
extendApi: Yt,
|
|
4826
4846
|
getData: st,
|
|
4827
|
-
setDataDriver:
|
|
4847
|
+
setDataDriver: ke,
|
|
4828
4848
|
setData: Te,
|
|
4829
4849
|
removeData: er,
|
|
4830
|
-
refreshData:
|
|
4850
|
+
refreshData: Ee,
|
|
4831
4851
|
maker: f,
|
|
4832
|
-
component:
|
|
4852
|
+
component: k,
|
|
4833
4853
|
directive: L,
|
|
4834
4854
|
setModelField: Xt,
|
|
4835
4855
|
setFormula: Zt,
|
|
4836
4856
|
setDriver: Qt,
|
|
4837
4857
|
register: pe,
|
|
4838
|
-
$vnode:
|
|
4858
|
+
$vnode: U,
|
|
4839
4859
|
parser: me,
|
|
4840
4860
|
use: ge,
|
|
4841
|
-
factory:
|
|
4861
|
+
factory: zt,
|
|
4842
4862
|
componentAlias: Pe,
|
|
4843
4863
|
copyRule: Pt,
|
|
4844
4864
|
copyRules: Tt,
|
|
@@ -4849,7 +4869,7 @@ function Wt(t) {
|
|
|
4849
4869
|
parseJson: St,
|
|
4850
4870
|
toJson: Oe,
|
|
4851
4871
|
useApp: A,
|
|
4852
|
-
getApi:
|
|
4872
|
+
getApi: M,
|
|
4853
4873
|
on: tr
|
|
4854
4874
|
});
|
|
4855
4875
|
}
|
|
@@ -4857,8 +4877,8 @@ function Wt(t) {
|
|
|
4857
4877
|
C(c, {
|
|
4858
4878
|
create: K,
|
|
4859
4879
|
install(g, y) {
|
|
4860
|
-
|
|
4861
|
-
const b = `_installedFormCreate${
|
|
4880
|
+
d = v(v({}, d), y || {});
|
|
4881
|
+
const b = `_installedFormCreate${p ? "Mobile" : ""}_${t.ui}`;
|
|
4862
4882
|
if (g[b] === !0) return;
|
|
4863
4883
|
g[b] = !0;
|
|
4864
4884
|
const w = function(R, ae = {}) {
|
|
@@ -4866,27 +4886,27 @@ function Wt(t) {
|
|
|
4866
4886
|
};
|
|
4867
4887
|
ot(w), g.prototype.$formCreate = w;
|
|
4868
4888
|
const V = S();
|
|
4869
|
-
g.component(V.name, V), g.component("FcFragment",
|
|
4870
|
-
|
|
4889
|
+
g.component(V.name, V), g.component("FcFragment", U()), o.forEach((R) => {
|
|
4890
|
+
F(() => R(c, g));
|
|
4871
4891
|
});
|
|
4872
4892
|
}
|
|
4873
4893
|
});
|
|
4874
4894
|
}
|
|
4875
|
-
if (ot(
|
|
4895
|
+
if (ot(O), rr(O), ke("$cookie", Pi), ke("$localStorage", Ti), ke("$sessionStorage", Bi), $.use({ fragment: "fcFragment" }), t.install && K.use(t), me(Di), t.inherit) {
|
|
4876
4896
|
const c = t.inherit;
|
|
4877
|
-
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(
|
|
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(_, c.formulas);
|
|
4878
4898
|
}
|
|
4879
4899
|
const Re = S();
|
|
4880
|
-
return je(Re,
|
|
4900
|
+
return je(Re, O), Object.defineProperties(Re, {
|
|
4881
4901
|
fetch: {
|
|
4882
4902
|
get() {
|
|
4883
|
-
return
|
|
4903
|
+
return O.fetch;
|
|
4884
4904
|
},
|
|
4885
4905
|
set(c) {
|
|
4886
|
-
|
|
4906
|
+
O.fetch = c;
|
|
4887
4907
|
}
|
|
4888
4908
|
}
|
|
4889
|
-
}), Re.util =
|
|
4909
|
+
}), Re.util = O, Re;
|
|
4890
4910
|
}
|
|
4891
4911
|
const Ct = {
|
|
4892
4912
|
date: "yyyy-MM-dd",
|
|
@@ -4924,13 +4944,13 @@ const Ct = {
|
|
|
4924
4944
|
let { props: e } = t.prop;
|
|
4925
4945
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4926
4946
|
}
|
|
4927
|
-
}, Wi = "textarea",
|
|
4947
|
+
}, Wi = "textarea", xi = {
|
|
4928
4948
|
name: Wi,
|
|
4929
4949
|
mergeProp(t) {
|
|
4930
4950
|
let { props: e } = t.prop;
|
|
4931
4951
|
e.type = "textarea", e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4932
4952
|
}
|
|
4933
|
-
}, Ot = "slider",
|
|
4953
|
+
}, Ot = "slider", zi = {
|
|
4934
4954
|
name: Ot,
|
|
4935
4955
|
maker: {
|
|
4936
4956
|
sliderRange: T(Ot, { range: !0 })
|
|
@@ -4959,14 +4979,14 @@ const Ct = {
|
|
|
4959
4979
|
}, Qi = "select", Yi = {
|
|
4960
4980
|
name: Qi,
|
|
4961
4981
|
toFormValue(t, e) {
|
|
4962
|
-
return e.prop.props.multiple && !Array.isArray(t) ?
|
|
4982
|
+
return e.prop.props.multiple && !Array.isArray(t) ? J(t) : t;
|
|
4963
4983
|
}
|
|
4964
4984
|
}, en = [
|
|
4965
4985
|
Gi,
|
|
4966
4986
|
Ji,
|
|
4967
4987
|
Ki,
|
|
4968
|
-
zi,
|
|
4969
4988
|
xi,
|
|
4989
|
+
zi,
|
|
4970
4990
|
Xi,
|
|
4971
4991
|
Zi,
|
|
4972
4992
|
Yi
|
|
@@ -5044,14 +5064,14 @@ function nn(t) {
|
|
|
5044
5064
|
function Ft(t, e) {
|
|
5045
5065
|
j(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
5046
5066
|
}
|
|
5047
|
-
function
|
|
5067
|
+
function Z(t) {
|
|
5048
5068
|
return t === !1;
|
|
5049
5069
|
}
|
|
5050
5070
|
function sn(t, e) {
|
|
5051
5071
|
j(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
5052
5072
|
}
|
|
5053
5073
|
function Ge(t) {
|
|
5054
|
-
const e =
|
|
5074
|
+
const e = v({}, t);
|
|
5055
5075
|
return delete e.children, e;
|
|
5056
5076
|
}
|
|
5057
5077
|
const on = {
|
|
@@ -5104,7 +5124,7 @@ const on = {
|
|
|
5104
5124
|
update() {
|
|
5105
5125
|
const t = this.options.form;
|
|
5106
5126
|
this.rule = {
|
|
5107
|
-
props:
|
|
5127
|
+
props: v({}, t),
|
|
5108
5128
|
nativeOn: {
|
|
5109
5129
|
submit: (e) => {
|
|
5110
5130
|
e.preventDefault();
|
|
@@ -5121,14 +5141,14 @@ const on = {
|
|
|
5121
5141
|
});
|
|
5122
5142
|
},
|
|
5123
5143
|
render(t) {
|
|
5124
|
-
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, Z(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
5125
5145
|
},
|
|
5126
5146
|
makeWrap(t, e) {
|
|
5127
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;
|
|
5128
5148
|
delete r.wrap.class, delete r.wrap.title;
|
|
5129
|
-
const f = (h.Undef(r.wrap.show) ? !t.input :
|
|
5130
|
-
props: q(
|
|
5131
|
-
labelWidth: o === void 0 ? o :
|
|
5149
|
+
const f = (h.Undef(r.wrap.show) ? !t.input : Z(r.wrap.show)) ? e : this.$r(Q([r.wrap, {
|
|
5150
|
+
props: q(v({
|
|
5151
|
+
labelWidth: o === void 0 ? o : kt(o),
|
|
5132
5152
|
label: n ? r.title.title : void 0
|
|
5133
5153
|
}, Ge(r.wrap || {})), {
|
|
5134
5154
|
prop: t.id,
|
|
@@ -5138,31 +5158,31 @@ const on = {
|
|
|
5138
5158
|
key: `${i}fi`,
|
|
5139
5159
|
ref: t.wrapRef,
|
|
5140
5160
|
type: "formItem"
|
|
5141
|
-
}]),
|
|
5142
|
-
return a === !0 ||
|
|
5161
|
+
}]), v({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
5162
|
+
return a === !0 || Z(l) || Z(s.show) ? f : this.makeCol(r, i, [f]);
|
|
5143
5163
|
},
|
|
5144
5164
|
isTitle(t) {
|
|
5145
5165
|
if (this.options.form.title === !1) return !1;
|
|
5146
5166
|
const e = t.title;
|
|
5147
|
-
return !(!e.title && !e.native ||
|
|
5167
|
+
return !(!e.title && !e.native || Z(e.show));
|
|
5148
5168
|
},
|
|
5149
5169
|
makeInfo(t, e, r) {
|
|
5150
|
-
var f,
|
|
5151
|
-
const i =
|
|
5152
|
-
title: (
|
|
5170
|
+
var f, d, p, m, $, _;
|
|
5171
|
+
const i = v({}, t.title), s = v({}, t.info), n = nn(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
5172
|
+
title: (d = (f = r.refRule) == null ? void 0 : f.__$title) == null ? void 0 : d.value,
|
|
5153
5173
|
rule: r.rule,
|
|
5154
5174
|
options: this.options
|
|
5155
|
-
}) : ((m = (
|
|
5156
|
-
if (!
|
|
5157
|
-
const
|
|
5175
|
+
}) : ((m = (p = r.refRule) == null ? void 0 : p.__$title) == null ? void 0 : m.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
5176
|
+
if (!Z(s.show) && (s.info || s.native) && !Z(s.icon)) {
|
|
5177
|
+
const O = {
|
|
5158
5178
|
type: s.type || "popover",
|
|
5159
5179
|
slot: "label",
|
|
5160
5180
|
props: Ge(s),
|
|
5161
5181
|
key: `${e}pop`
|
|
5162
5182
|
};
|
|
5163
|
-
delete
|
|
5164
|
-
const
|
|
5165
|
-
s.info && !j(
|
|
5183
|
+
delete O.props.icon, delete O.props.show, delete O.props.info, delete O.props.align, delete O.props.native;
|
|
5184
|
+
const M = "content";
|
|
5185
|
+
s.info && !j(O.props, M) && (O.props[M] = (_ = ($ = r.refRule) == null ? void 0 : $.__$info) == null ? void 0 : _.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(Q([s, O]), [
|
|
5166
5186
|
this.$r({
|
|
5167
5187
|
type: "i",
|
|
5168
5188
|
slot: n ? "default" : "reference",
|
|
@@ -5178,8 +5198,8 @@ const on = {
|
|
|
5178
5198
|
slot: i.slot || "label",
|
|
5179
5199
|
type: i.type || "span",
|
|
5180
5200
|
on: {
|
|
5181
|
-
click: (...
|
|
5182
|
-
this.$handle.targetHook(r, "titleClick", { args:
|
|
5201
|
+
click: (...O) => {
|
|
5202
|
+
this.$handle.targetHook(r, "titleClick", { args: O });
|
|
5183
5203
|
}
|
|
5184
5204
|
}
|
|
5185
5205
|
}]);
|
|
@@ -5205,7 +5225,7 @@ const on = {
|
|
|
5205
5225
|
},
|
|
5206
5226
|
makeFormBtn() {
|
|
5207
5227
|
let t = [];
|
|
5208
|
-
if (
|
|
5228
|
+
if (Z(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Z(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
5209
5229
|
return;
|
|
5210
5230
|
const e = this.$r({
|
|
5211
5231
|
type: "formItem",
|
|
@@ -5220,7 +5240,7 @@ const on = {
|
|
|
5220
5240
|
}, [e]);
|
|
5221
5241
|
},
|
|
5222
5242
|
makeResetBtn() {
|
|
5223
|
-
const t =
|
|
5243
|
+
const t = v({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
|
|
5224
5244
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
5225
5245
|
type: "button",
|
|
5226
5246
|
props: t,
|
|
@@ -5236,7 +5256,7 @@ const on = {
|
|
|
5236
5256
|
}, [e]);
|
|
5237
5257
|
},
|
|
5238
5258
|
makeSubmitBtn() {
|
|
5239
|
-
const t =
|
|
5259
|
+
const t = v({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
|
|
5240
5260
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
5241
5261
|
type: "button",
|
|
5242
5262
|
props: t,
|
|
@@ -5291,7 +5311,7 @@ function cn(t) {
|
|
|
5291
5311
|
};
|
|
5292
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;
|
|
5293
5313
|
}
|
|
5294
|
-
function
|
|
5314
|
+
function Et(t, e) {
|
|
5295
5315
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
5296
5316
|
}
|
|
5297
5317
|
function hn(t, e) {
|
|
@@ -5318,15 +5338,29 @@ function hn(t, e) {
|
|
|
5318
5338
|
},
|
|
5319
5339
|
validateField(r, i) {
|
|
5320
5340
|
return new Promise((s, n) => {
|
|
5321
|
-
const
|
|
5322
|
-
if (!
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5341
|
+
const a = typeof r == "object" ? x(r) : e.getCtx(r);
|
|
5342
|
+
if (!a) {
|
|
5343
|
+
s(null), i && i(null);
|
|
5344
|
+
return;
|
|
5345
|
+
}
|
|
5346
|
+
const l = e.subForm[a.id], u = [e.$manager.validateField(a.id)];
|
|
5347
|
+
J(l).filter((f) => !f.isScope).forEach((f) => {
|
|
5348
|
+
u.push(f.validate());
|
|
5349
|
+
}), Promise.all(u).then(() => {
|
|
5350
|
+
s(null), i && i(null);
|
|
5351
|
+
}).catch((f) => {
|
|
5352
|
+
n(f), i && i(f), e.vm.$emit("validate-field-fail", f, { field: r, api: t });
|
|
5353
|
+
});
|
|
5354
|
+
});
|
|
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(() => {
|
|
5327
5361
|
s(null), i && i(null);
|
|
5328
|
-
}).catch((
|
|
5329
|
-
n(
|
|
5362
|
+
}).catch((a) => {
|
|
5363
|
+
n(a), i && i(a);
|
|
5330
5364
|
});
|
|
5331
5365
|
});
|
|
5332
5366
|
},
|
|
@@ -5370,11 +5404,11 @@ function hn(t, e) {
|
|
|
5370
5404
|
}
|
|
5371
5405
|
},
|
|
5372
5406
|
submitBtnProps: (r = {}) => {
|
|
5373
|
-
let i =
|
|
5407
|
+
let i = Et(e.options.submitBtn, !0);
|
|
5374
5408
|
C(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
5375
5409
|
},
|
|
5376
5410
|
resetBtnProps: (r = {}) => {
|
|
5377
|
-
let i =
|
|
5411
|
+
let i = Et(e.options.resetBtn, !1);
|
|
5378
5412
|
C(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
5379
5413
|
},
|
|
5380
5414
|
submit(r, i) {
|
|
@@ -5382,17 +5416,17 @@ function hn(t, e) {
|
|
|
5382
5416
|
(e.options.validateOnSubmit === !1 ? Promise.resolve() : t.validate()).then(() => {
|
|
5383
5417
|
let a = t.formData();
|
|
5384
5418
|
e.beforeSubmit(a).then(() => {
|
|
5385
|
-
h.Function(r) &&
|
|
5419
|
+
h.Function(r) && F(() => r(a, t)), h.Function(e.options.onSubmit) && F(() => e.options.onSubmit(a, t)), e.vm.$emit("submit", a, t), s(a);
|
|
5386
5420
|
}).catch((l) => {
|
|
5387
5421
|
});
|
|
5388
5422
|
}).catch((...a) => {
|
|
5389
|
-
h.Function(i) &&
|
|
5423
|
+
h.Function(i) && F(() => i(t, ...a)), n(...a);
|
|
5390
5424
|
});
|
|
5391
5425
|
});
|
|
5392
5426
|
}
|
|
5393
5427
|
};
|
|
5394
5428
|
}
|
|
5395
|
-
const
|
|
5429
|
+
const xt = {
|
|
5396
5430
|
name: "required",
|
|
5397
5431
|
load(t, e, r) {
|
|
5398
5432
|
const i = dn(t.getValue());
|
|
@@ -5400,7 +5434,7 @@ const zt = {
|
|
|
5400
5434
|
if (i.required === !1)
|
|
5401
5435
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5402
5436
|
else {
|
|
5403
|
-
const n =
|
|
5437
|
+
const n = v({
|
|
5404
5438
|
required: !0,
|
|
5405
5439
|
validator(a, l, u) {
|
|
5406
5440
|
o(), h.empty(l) ? u(n.message) : u();
|
|
@@ -5421,7 +5455,7 @@ const zt = {
|
|
|
5421
5455
|
r.sync(e);
|
|
5422
5456
|
},
|
|
5423
5457
|
watch(...t) {
|
|
5424
|
-
|
|
5458
|
+
xt.load(...t);
|
|
5425
5459
|
}
|
|
5426
5460
|
};
|
|
5427
5461
|
function dn(t) {
|
|
@@ -5430,7 +5464,7 @@ function dn(t) {
|
|
|
5430
5464
|
function pn(t) {
|
|
5431
5465
|
t.componentAlias(tn), Kr.forEach((e) => {
|
|
5432
5466
|
t.component(e.name, e);
|
|
5433
|
-
}), t.register(
|
|
5467
|
+
}), t.register(xt), en.forEach((e) => {
|
|
5434
5468
|
t.parser(e);
|
|
5435
5469
|
}), Object.keys(de).forEach((e) => {
|
|
5436
5470
|
t.maker[e] = de[e];
|
|
@@ -5439,7 +5473,7 @@ function pn(t) {
|
|
|
5439
5473
|
function mn() {
|
|
5440
5474
|
return Wt({
|
|
5441
5475
|
ui: "element-ui",
|
|
5442
|
-
version: "2.7.
|
|
5476
|
+
version: "2.7.27",
|
|
5443
5477
|
manager: on,
|
|
5444
5478
|
extendApi: hn,
|
|
5445
5479
|
install: pn,
|