@form-create/element-ui 2.7.3 → 2.7.4
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 +672 -650
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
- package/src/core/manager.js +3 -3
- package/src/core/provider.js +1 -1
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.4
|
|
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 at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
19
19
|
sr.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
21
|
}, q = (t, e) => rr(t, ir(e));
|
|
22
|
-
import
|
|
22
|
+
import $e, { getCurrentInstance as or, provide as ar, inject as lr, toRefs as lt, reactive as ne, onBeforeMount as ur, watch as B, onMounted as cr, onBeforeUnmount as fr, onUpdated as hr, nextTick as T, markRaw as ge, computed as ye, toRef as De, ref as dr } from "vue";
|
|
23
23
|
function pr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
@@ -126,7 +126,7 @@ const _r = "fcCheckbox", Cr = {
|
|
|
126
126
|
function H(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const wr = "fcFrame",
|
|
129
|
+
const wr = "fcFrame", Fr = {
|
|
130
130
|
name: wr,
|
|
131
131
|
props: {
|
|
132
132
|
formCreateInject: {
|
|
@@ -496,8 +496,8 @@ const wr = "fcFrame", Or = {
|
|
|
496
496
|
mounted() {
|
|
497
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
498
498
|
}
|
|
499
|
-
},
|
|
500
|
-
name:
|
|
499
|
+
}, Or = "fcRadio", Rr = {
|
|
500
|
+
name: Or,
|
|
501
501
|
props: {
|
|
502
502
|
formCreateInject: {
|
|
503
503
|
type: Object,
|
|
@@ -591,7 +591,7 @@ const wr = "fcFrame", Or = {
|
|
|
591
591
|
return h.type(e, t);
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
|
-
function
|
|
594
|
+
function D(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
597
|
const Er = "fcSelect", Sr = {
|
|
@@ -621,7 +621,7 @@ const Er = "fcSelect", Sr = {
|
|
|
621
621
|
}, [h.trueArray(n.options) && n.options.map((a, l) => r(a, l))]), s = e.props.formCreateInject.options;
|
|
622
622
|
return t("ElSelect", V([{}, e.data, {
|
|
623
623
|
ref: "el"
|
|
624
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
624
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => D(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
625
625
|
},
|
|
626
626
|
mounted() {
|
|
627
627
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -691,7 +691,7 @@ function ut(t, e) {
|
|
|
691
691
|
uid: e
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function ct(t) {
|
|
695
695
|
return q(b({}, t), {
|
|
696
696
|
file: t,
|
|
697
697
|
value: t
|
|
@@ -749,11 +749,11 @@ const Ar = "fcUpload", Vr = {
|
|
|
749
749
|
};
|
|
750
750
|
},
|
|
751
751
|
created() {
|
|
752
|
-
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(ut).map(
|
|
752
|
+
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(ut).map(ct);
|
|
753
753
|
},
|
|
754
754
|
watch: {
|
|
755
755
|
value(t) {
|
|
756
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(
|
|
756
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(ct), this.uploadList = this.$refs.upload.uploadFiles);
|
|
757
757
|
},
|
|
758
758
|
limit(t, e) {
|
|
759
759
|
(e === 1 || t === 1) && this.update();
|
|
@@ -911,13 +911,13 @@ const Ar = "fcUpload", Vr = {
|
|
|
911
911
|
}), this.$emit("fc.el", this.$refs.upload);
|
|
912
912
|
}
|
|
913
913
|
};
|
|
914
|
-
function
|
|
915
|
-
|
|
914
|
+
function E(t, e, r) {
|
|
915
|
+
$e.set(t, e, r);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
(
|
|
917
|
+
function ie(t, e) {
|
|
918
|
+
($e.del || $e.delete)(t, e);
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function _e(t, e = {}, r) {
|
|
921
921
|
let i = !1;
|
|
922
922
|
for (let s in e)
|
|
923
923
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
@@ -925,29 +925,29 @@ function ve(t, e = {}, r) {
|
|
|
925
925
|
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
926
926
|
let o = t[s] === void 0;
|
|
927
927
|
if (i)
|
|
928
|
-
i = !1, o &&
|
|
928
|
+
i = !1, o && E(t, s, []);
|
|
929
929
|
else if (n._clone && r !== void 0)
|
|
930
930
|
if (r)
|
|
931
|
-
n = n.getRule(), o &&
|
|
931
|
+
n = n.getRule(), o && E(t, s, {});
|
|
932
932
|
else {
|
|
933
|
-
|
|
933
|
+
E(t, s, n._clone());
|
|
934
934
|
continue;
|
|
935
935
|
}
|
|
936
936
|
else
|
|
937
|
-
o &&
|
|
938
|
-
t[s] =
|
|
937
|
+
o && E(t, s, {});
|
|
938
|
+
t[s] = _e(t[s], n, r);
|
|
939
939
|
} else
|
|
940
|
-
|
|
940
|
+
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));
|
|
941
941
|
}
|
|
942
942
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
return
|
|
944
|
+
function X(t) {
|
|
945
|
+
return _e({}, { value: t }).value;
|
|
946
946
|
}
|
|
947
947
|
const Ir = Object.assign || function(t) {
|
|
948
948
|
for (let e, r = 1; r < arguments.length; r++)
|
|
949
949
|
for (let i in e = arguments[r], e)
|
|
950
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
950
|
+
Object.prototype.hasOwnProperty.call(e, i) && E(t, i, e[i]);
|
|
951
951
|
return t;
|
|
952
952
|
};
|
|
953
953
|
function _() {
|
|
@@ -1038,13 +1038,13 @@ const Pr = "fcGroup", Tr = {
|
|
|
1038
1038
|
const s = i.$f.formData();
|
|
1039
1039
|
if (t === e)
|
|
1040
1040
|
i.$f.deferSyncValue(() => {
|
|
1041
|
-
|
|
1041
|
+
_e(i.rule, t), i.$f.setValue(s);
|
|
1042
1042
|
}, !0);
|
|
1043
1043
|
else {
|
|
1044
1044
|
const n = i.$f.formData();
|
|
1045
1045
|
i.$f.once("reloading", () => {
|
|
1046
1046
|
i.$f.setValue(n);
|
|
1047
|
-
}), i.rule =
|
|
1047
|
+
}), i.rule = X(t);
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
1050
|
});
|
|
@@ -1078,7 +1078,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1078
1078
|
},
|
|
1079
1079
|
methods: {
|
|
1080
1080
|
_value(t) {
|
|
1081
|
-
return t &&
|
|
1081
|
+
return t && D(t, this.field) ? t[this.field] : t;
|
|
1082
1082
|
},
|
|
1083
1083
|
cache(t, e) {
|
|
1084
1084
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1109,7 +1109,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1109
1109
|
};
|
|
1110
1110
|
if (this.defaultValue) {
|
|
1111
1111
|
i.formData || (i.formData = {});
|
|
1112
|
-
const s =
|
|
1112
|
+
const s = X(this.defaultValue);
|
|
1113
1113
|
_(i.formData, this.field ? {
|
|
1114
1114
|
[this.field]: s
|
|
1115
1115
|
} : s);
|
|
@@ -1224,7 +1224,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1224
1224
|
const {
|
|
1225
1225
|
rule: l,
|
|
1226
1226
|
options: u
|
|
1227
|
-
} = this.cacheRule[o],
|
|
1227
|
+
} = this.cacheRule[o], c = r && !s ? this.makeIcon(e.length, a, o) : [];
|
|
1228
1228
|
return t("div", {
|
|
1229
1229
|
class: "_fc-group-container",
|
|
1230
1230
|
key: o
|
|
@@ -1233,7 +1233,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1233
1233
|
}, {
|
|
1234
1234
|
on: {
|
|
1235
1235
|
"update:value": (d) => this.formData(o, d),
|
|
1236
|
-
"emit-event": (d, ...
|
|
1236
|
+
"emit-event": (d, ...m) => this.emitEvent(d, m, a, o),
|
|
1237
1237
|
input: (d) => this.add$f(a, o, d)
|
|
1238
1238
|
}
|
|
1239
1239
|
}, {}, {
|
|
@@ -1249,9 +1249,9 @@ const Pr = "fcGroup", Tr = {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
}])), t("div", {
|
|
1251
1251
|
class: "_fc-group-idx"
|
|
1252
|
-
}, [a + 1]),
|
|
1252
|
+
}, [a + 1]), c.length ? t("div", {
|
|
1253
1253
|
class: "_fc-group-handle fc-clock"
|
|
1254
|
-
}, [
|
|
1254
|
+
}, [c]) : null]);
|
|
1255
1255
|
});
|
|
1256
1256
|
return t("div", {
|
|
1257
1257
|
key: "con",
|
|
@@ -1344,7 +1344,7 @@ const Pr = "fcGroup", Tr = {
|
|
|
1344
1344
|
}
|
|
1345
1345
|
}, Mr = [
|
|
1346
1346
|
Cr,
|
|
1347
|
-
|
|
1347
|
+
Fr,
|
|
1348
1348
|
Rr,
|
|
1349
1349
|
Sr,
|
|
1350
1350
|
Dr,
|
|
@@ -1352,13 +1352,13 @@ const Pr = "fcGroup", Tr = {
|
|
|
1352
1352
|
Tr,
|
|
1353
1353
|
Lr
|
|
1354
1354
|
];
|
|
1355
|
-
function
|
|
1355
|
+
function se(t, e) {
|
|
1356
1356
|
var r = null;
|
|
1357
1357
|
return function(...i) {
|
|
1358
1358
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1359
1359
|
};
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1361
|
+
function be(t) {
|
|
1362
1362
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1363
1363
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1364
1364
|
}
|
|
@@ -1430,91 +1430,93 @@ function Nr(t, e, r) {
|
|
|
1430
1430
|
a = a.parent;
|
|
1431
1431
|
else
|
|
1432
1432
|
a = n;
|
|
1433
|
-
const { rule: l, value: u, subForm:
|
|
1433
|
+
const { rule: l, value: u, subForm: c, inFor: d } = lt(s), m = ne({
|
|
1434
1434
|
ctxInject: {},
|
|
1435
1435
|
destroyed: !1,
|
|
1436
1436
|
isShow: !0,
|
|
1437
1437
|
unique: 1,
|
|
1438
1438
|
renderRule: [...l.value || []],
|
|
1439
1439
|
updateValue: JSON.stringify(u.value || {})
|
|
1440
|
-
}),
|
|
1440
|
+
}), g = new t(n), $ = g.api(), w = d.value, O = () => {
|
|
1441
1441
|
if (o) {
|
|
1442
|
-
const
|
|
1443
|
-
if (
|
|
1444
|
-
let
|
|
1445
|
-
w ? (
|
|
1442
|
+
const R = Se(n, o);
|
|
1443
|
+
if (R) {
|
|
1444
|
+
let S;
|
|
1445
|
+
w ? (S = H(R.getSubForm()), S.push($)) : S = $, R.subForm(S);
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
},
|
|
1449
|
-
const
|
|
1450
|
-
if (
|
|
1448
|
+
}, G = () => {
|
|
1449
|
+
const R = Se(n, o);
|
|
1450
|
+
if (R)
|
|
1451
1451
|
if (w) {
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1452
|
+
const S = H(R.getSubForm()), N = S.indexOf($);
|
|
1453
|
+
N > -1 && S.splice(N, 1);
|
|
1454
1454
|
} else
|
|
1455
|
-
|
|
1455
|
+
R.subForm();
|
|
1456
1456
|
};
|
|
1457
1457
|
let P = null;
|
|
1458
1458
|
ur(() => {
|
|
1459
|
-
|
|
1460
|
-
let
|
|
1461
|
-
const
|
|
1462
|
-
Object.keys(
|
|
1463
|
-
let
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
}),
|
|
1467
|
-
}), s.option && s.option.style && (
|
|
1459
|
+
B(() => {
|
|
1460
|
+
let R = "";
|
|
1461
|
+
const S = s.option && s.option.globalClass || {};
|
|
1462
|
+
Object.keys(S).forEach((N) => {
|
|
1463
|
+
let pe = "";
|
|
1464
|
+
S[N].style && Object.keys(S[N].style).forEach((W) => {
|
|
1465
|
+
pe += be(W) + ":" + S[N].style[W] + ";";
|
|
1466
|
+
}), S[N].content && (pe += S[N].content + ";"), pe && (R += `.${N}{${pe}}`);
|
|
1467
|
+
}), s.option && s.option.style && (R += s.option.style), P || (P = document.createElement("style"), P.type = "text/css", document.head.appendChild(P)), P.innerHTML = R || "";
|
|
1468
1468
|
}, () => {
|
|
1469
1469
|
});
|
|
1470
1470
|
});
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
}, 100),
|
|
1474
|
-
|
|
1475
|
-
}, 100),
|
|
1476
|
-
|
|
1471
|
+
const M = se(() => {
|
|
1472
|
+
g.bus.$emit("$loadData.$topForm");
|
|
1473
|
+
}, 100), he = se(function() {
|
|
1474
|
+
g.bus.$emit("$loadData.$scopeForm");
|
|
1475
|
+
}, 100), Ae = se(() => {
|
|
1476
|
+
g.bus.$emit("$loadData.$form");
|
|
1477
|
+
}, 100), de = (R) => {
|
|
1478
|
+
g.bus.$emit("change-$form." + R);
|
|
1477
1479
|
};
|
|
1478
|
-
return
|
|
1479
|
-
o && (
|
|
1480
|
-
}),
|
|
1481
|
-
o && (
|
|
1480
|
+
return cr(() => {
|
|
1481
|
+
o && ($.top.bus.$on("$loadData.$form", M), $.top.bus.$on("change", de)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", he), g.mounted();
|
|
1482
|
+
}), fr(() => {
|
|
1483
|
+
o && ($.top.bus.$off("$loadData.$form", M), $.top.bus.$off("change", de)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", he), P && document.head.removeChild(P), G(), m.destroyed = !0, g.unmount();
|
|
1482
1484
|
}), hr(() => {
|
|
1483
|
-
|
|
1484
|
-
}),
|
|
1485
|
-
|
|
1486
|
-
}, { immediate: !0 }),
|
|
1487
|
-
|
|
1488
|
-
}),
|
|
1489
|
-
m.
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
}),
|
|
1493
|
-
JSON.stringify(
|
|
1494
|
-
}, { deep: !0, flush: "post" }),
|
|
1495
|
-
|
|
1485
|
+
g.updated();
|
|
1486
|
+
}), B(c, (R) => {
|
|
1487
|
+
R ? O() : G();
|
|
1488
|
+
}, { immediate: !0 }), B(() => s.option, () => {
|
|
1489
|
+
g.initOptions(), $.refresh();
|
|
1490
|
+
}, { deep: !0 }), B(() => [...l.value], (R) => {
|
|
1491
|
+
g.$handle.isBreakWatch() || R.length === m.renderRule.length && R.every((S) => m.renderRule.indexOf(S) > -1) || (g.$handle.updateAppendData(), g.$handle.reloadRule(l.value), n.renderRule());
|
|
1492
|
+
}), B(() => [s.disabled, s.preview], () => {
|
|
1493
|
+
$.refresh();
|
|
1494
|
+
}), B(u, (R) => {
|
|
1495
|
+
JSON.stringify(R || {}) !== m.updateValue && ($.config.forceCoverValue ? $.coverValue(R || {}) : $.setValue(R || {}));
|
|
1496
|
+
}, { deep: !0, flush: "post" }), B(() => s.index, () => {
|
|
1497
|
+
$.coverValue({}), g.$handle.updateAppendData(), T(() => {
|
|
1496
1498
|
T(() => {
|
|
1497
|
-
|
|
1499
|
+
$.clearValidateState();
|
|
1498
1500
|
});
|
|
1499
1501
|
});
|
|
1500
1502
|
}, { flush: "sync" }), q(b({
|
|
1501
|
-
fc:
|
|
1502
|
-
parent: o &&
|
|
1503
|
-
top:
|
|
1504
|
-
fapi:
|
|
1505
|
-
}, lt(
|
|
1503
|
+
fc: ge(g),
|
|
1504
|
+
parent: o && ge(o),
|
|
1505
|
+
top: ge(a),
|
|
1506
|
+
fapi: ge($)
|
|
1507
|
+
}, lt(m)), {
|
|
1506
1508
|
getGroupInject: () => Se(n, o),
|
|
1507
1509
|
refresh() {
|
|
1508
|
-
++
|
|
1510
|
+
++m.unique;
|
|
1509
1511
|
},
|
|
1510
1512
|
renderRule() {
|
|
1511
|
-
|
|
1513
|
+
m.renderRule = [...l.value || []];
|
|
1512
1514
|
},
|
|
1513
|
-
updateValue(
|
|
1514
|
-
if (
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1517
|
-
Ae(), o ||
|
|
1515
|
+
updateValue(R) {
|
|
1516
|
+
if (m.destroyed) return;
|
|
1517
|
+
const S = JSON.stringify(R);
|
|
1518
|
+
m.updateValue !== S && (m.updateValue = S, n.$emit("update:value", R), T(() => {
|
|
1519
|
+
Ae(), o ? c.value || he() : (M(), he());
|
|
1518
1520
|
}));
|
|
1519
1521
|
}
|
|
1520
1522
|
});
|
|
@@ -1524,28 +1526,28 @@ function Nr(t, e, r) {
|
|
|
1524
1526
|
}
|
|
1525
1527
|
};
|
|
1526
1528
|
}
|
|
1527
|
-
const
|
|
1528
|
-
const i = [...
|
|
1529
|
+
const Ot = ["attrs", "props", "domProps", "scopedSlots"], Rt = ["class", "style", "directives"], Et = ["on", "nativeOn", "hook"], ee = (t, e = {}, r = {}) => {
|
|
1530
|
+
const i = [...Ot, ...r.normal || []], s = [...Rt, ...r.array || []], n = [...Et, ...r.functional || []], o = r.props || [];
|
|
1529
1531
|
return t.reduce((a, l) => {
|
|
1530
1532
|
for (const u in l)
|
|
1531
1533
|
if (a[u])
|
|
1532
1534
|
if (o.indexOf(u) > -1)
|
|
1533
|
-
a[u] =
|
|
1535
|
+
a[u] = ee([l[u]], a[u]);
|
|
1534
1536
|
else if (i.indexOf(u) > -1)
|
|
1535
1537
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1536
1538
|
else if (s.indexOf(u) > -1) {
|
|
1537
|
-
const
|
|
1538
|
-
a[u] = [...
|
|
1539
|
+
const c = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1540
|
+
a[u] = [...c, ...d];
|
|
1539
1541
|
} else if (n.indexOf(u) > -1)
|
|
1540
|
-
for (const
|
|
1541
|
-
if (a[u][
|
|
1542
|
-
const d = a[u][
|
|
1543
|
-
a[u][
|
|
1542
|
+
for (const c in l[u])
|
|
1543
|
+
if (a[u][c]) {
|
|
1544
|
+
const d = a[u][c] instanceof Array ? a[u][c] : [a[u][c]], m = l[u][c] instanceof Array ? l[u][c] : [l[u][c]];
|
|
1545
|
+
a[u][c] = [...d, ...m];
|
|
1544
1546
|
} else
|
|
1545
|
-
a[u][
|
|
1547
|
+
a[u][c] = l[u][c];
|
|
1546
1548
|
else if (u === "hook")
|
|
1547
|
-
for (let
|
|
1548
|
-
a[u][
|
|
1549
|
+
for (let c in l[u])
|
|
1550
|
+
a[u][c] ? a[u][c] = qr(a[u][c], l[u][c]) : a[u][c] = l[u][c];
|
|
1549
1551
|
else
|
|
1550
1552
|
a[u] = l[u];
|
|
1551
1553
|
else
|
|
@@ -1556,7 +1558,7 @@ const Ft = ["attrs", "props", "domProps", "scopedSlots"], Rt = ["class", "style"
|
|
|
1556
1558
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1557
1559
|
}, St = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Ze = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1558
1560
|
function kt() {
|
|
1559
|
-
return [...St, ...
|
|
1561
|
+
return [...St, ...Ot, ...Rt, ...Et, ...Ze, ...Ye];
|
|
1560
1562
|
}
|
|
1561
1563
|
function Dt(t, e, r) {
|
|
1562
1564
|
return `[form-create ${t}]: ${e}`;
|
|
@@ -1572,7 +1574,7 @@ function jt(t) {
|
|
|
1572
1574
|
}
|
|
1573
1575
|
const Je = "[[FORM-CREATE-PREFIX-", We = "-FORM-CREATE-SUFFIX]]";
|
|
1574
1576
|
function et(t, e) {
|
|
1575
|
-
return JSON.stringify(
|
|
1577
|
+
return JSON.stringify(_e(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1576
1578
|
if (!(i && i._isVue === !0)) {
|
|
1577
1579
|
if (typeof i != "function")
|
|
1578
1580
|
return i;
|
|
@@ -1586,7 +1588,7 @@ function et(t, e) {
|
|
|
1586
1588
|
function Te(t) {
|
|
1587
1589
|
return new Function("return " + t)();
|
|
1588
1590
|
}
|
|
1589
|
-
function
|
|
1591
|
+
function z(t, e) {
|
|
1590
1592
|
if (t && h.String(t) && t.length > 4) {
|
|
1591
1593
|
let r = t.trim(), i = !1;
|
|
1592
1594
|
try {
|
|
@@ -1627,7 +1629,7 @@ err: ${s}`);
|
|
|
1627
1629
|
}
|
|
1628
1630
|
function At(t, e) {
|
|
1629
1631
|
return JSON.parse(t, function(r, i) {
|
|
1630
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1632
|
+
return h.Undef(i) || !i.indexOf ? i : z(i, e);
|
|
1631
1633
|
});
|
|
1632
1634
|
}
|
|
1633
1635
|
let Hr = 0;
|
|
@@ -1635,11 +1637,11 @@ function je() {
|
|
|
1635
1637
|
const t = 370 + ++Hr;
|
|
1636
1638
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1637
1639
|
}
|
|
1638
|
-
function
|
|
1640
|
+
function oe(t, e, r) {
|
|
1639
1641
|
let i = t, s;
|
|
1640
1642
|
return (e || "").split(".").forEach((n) => {
|
|
1641
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1642
|
-
}),
|
|
1643
|
+
s && ((!i[s] || typeof i[s] != "object") && E(i, s, {}), i = i[s]), s = n;
|
|
1644
|
+
}), E(i, s, r), i;
|
|
1643
1645
|
}
|
|
1644
1646
|
function Ke(t, e) {
|
|
1645
1647
|
return {
|
|
@@ -1653,18 +1655,18 @@ function Vt(t, e) {
|
|
|
1653
1655
|
return It([t], e || !1)[0];
|
|
1654
1656
|
}
|
|
1655
1657
|
function It(t, e) {
|
|
1656
|
-
return
|
|
1658
|
+
return _e([], [...t], e || !1);
|
|
1657
1659
|
}
|
|
1658
|
-
function
|
|
1659
|
-
return
|
|
1660
|
+
function te(t, e) {
|
|
1661
|
+
return ee(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
|
|
1660
1662
|
}
|
|
1661
|
-
function
|
|
1663
|
+
function ft(t) {
|
|
1662
1664
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1663
1665
|
return e.type || (e.type = "input"), e;
|
|
1664
1666
|
}
|
|
1665
1667
|
function Gr(t, e) {
|
|
1666
1668
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1667
|
-
e[r] && (t[r] =
|
|
1669
|
+
e[r] && (t[r] = te(t[r] || {}, e[r]));
|
|
1668
1670
|
}), t) : e;
|
|
1669
1671
|
}
|
|
1670
1672
|
function Pt(t, e) {
|
|
@@ -1674,10 +1676,10 @@ function Pt(t, e) {
|
|
|
1674
1676
|
}
|
|
1675
1677
|
}, r), {}));
|
|
1676
1678
|
}
|
|
1677
|
-
function
|
|
1679
|
+
function x(t) {
|
|
1678
1680
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1679
1681
|
}
|
|
1680
|
-
function
|
|
1682
|
+
function F(t, e) {
|
|
1681
1683
|
try {
|
|
1682
1684
|
e = t();
|
|
1683
1685
|
} catch (r) {
|
|
@@ -1702,7 +1704,7 @@ function Jr(t, e) {
|
|
|
1702
1704
|
} else
|
|
1703
1705
|
return Xe(t, e);
|
|
1704
1706
|
}
|
|
1705
|
-
function
|
|
1707
|
+
function Oe() {
|
|
1706
1708
|
const t = {}, e = (r) => r || "default";
|
|
1707
1709
|
return {
|
|
1708
1710
|
setSlot(r, i) {
|
|
@@ -1741,9 +1743,9 @@ function Fe() {
|
|
|
1741
1743
|
function Re(t, e) {
|
|
1742
1744
|
return Object.setPrototypeOf(t, e), t;
|
|
1743
1745
|
}
|
|
1744
|
-
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1746
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, ce = {
|
|
1745
1747
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1746
|
-
"!=": (t, e) => !
|
|
1748
|
+
"!=": (t, e) => !ce["=="](t, e),
|
|
1747
1749
|
">": (t, e) => t > e,
|
|
1748
1750
|
">=": (t, e) => t >= e,
|
|
1749
1751
|
"<": (t, e) => t < e,
|
|
@@ -1752,13 +1754,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1752
1754
|
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1753
1755
|
},
|
|
1754
1756
|
notOn(t, e) {
|
|
1755
|
-
return !
|
|
1757
|
+
return !ce.on(t, e);
|
|
1756
1758
|
},
|
|
1757
1759
|
in(t, e) {
|
|
1758
1760
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1759
1761
|
},
|
|
1760
1762
|
notIn(t, e) {
|
|
1761
|
-
return !
|
|
1763
|
+
return !ce.in(t, e);
|
|
1762
1764
|
},
|
|
1763
1765
|
between(t, e) {
|
|
1764
1766
|
return t > e[0] && t < e[1];
|
|
@@ -1776,7 +1778,7 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1776
1778
|
return new RegExp(e, "g").test(t);
|
|
1777
1779
|
}
|
|
1778
1780
|
};
|
|
1779
|
-
function
|
|
1781
|
+
function L(t, e) {
|
|
1780
1782
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1781
1783
|
t != null && (t = t[r]);
|
|
1782
1784
|
}), t;
|
|
@@ -1821,7 +1823,7 @@ _(tt.prototype, {
|
|
|
1821
1823
|
return this._data;
|
|
1822
1824
|
},
|
|
1823
1825
|
setProp(t, e) {
|
|
1824
|
-
return
|
|
1826
|
+
return E(this._data, t, e), this;
|
|
1825
1827
|
},
|
|
1826
1828
|
_clone() {
|
|
1827
1829
|
const t = new this.constructor();
|
|
@@ -1831,7 +1833,7 @@ _(tt.prototype, {
|
|
|
1831
1833
|
function Bt(t) {
|
|
1832
1834
|
t.forEach((e) => {
|
|
1833
1835
|
tt.prototype[e] = function(r) {
|
|
1834
|
-
return
|
|
1836
|
+
return te(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1835
1837
|
};
|
|
1836
1838
|
});
|
|
1837
1839
|
}
|
|
@@ -1899,8 +1901,8 @@ function gt(t, e, r) {
|
|
|
1899
1901
|
(e || Mt)(q(b({}, t), {
|
|
1900
1902
|
onSuccess(n) {
|
|
1901
1903
|
let o = (l) => l;
|
|
1902
|
-
const a =
|
|
1903
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1904
|
+
const a = z(t.parse);
|
|
1905
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n, void 0, r));
|
|
1904
1906
|
},
|
|
1905
1907
|
onError(n) {
|
|
1906
1908
|
s(n);
|
|
@@ -1908,8 +1910,8 @@ function gt(t, e, r) {
|
|
|
1908
1910
|
}));
|
|
1909
1911
|
});
|
|
1910
1912
|
}
|
|
1911
|
-
function
|
|
1912
|
-
return
|
|
1913
|
+
function ve(t) {
|
|
1914
|
+
return X(t);
|
|
1913
1915
|
}
|
|
1914
1916
|
function Qr(t) {
|
|
1915
1917
|
function e(n) {
|
|
@@ -1918,7 +1920,7 @@ function Qr(t) {
|
|
|
1918
1920
|
function r(n, o, a) {
|
|
1919
1921
|
e(n).forEach((l) => {
|
|
1920
1922
|
t.getCtxs(l).forEach((u) => {
|
|
1921
|
-
|
|
1923
|
+
E(u.rule, o, a), t.$render.clearCache(u);
|
|
1922
1924
|
});
|
|
1923
1925
|
});
|
|
1924
1926
|
}
|
|
@@ -1954,6 +1956,15 @@ function Qr(t) {
|
|
|
1954
1956
|
get top() {
|
|
1955
1957
|
return s.parent ? s.parent.top : s;
|
|
1956
1958
|
},
|
|
1959
|
+
get scope() {
|
|
1960
|
+
let n = t.vm;
|
|
1961
|
+
for (; n && n.fapi; )
|
|
1962
|
+
if (n.$props.subForm)
|
|
1963
|
+
n = n.parent;
|
|
1964
|
+
else
|
|
1965
|
+
return n.fapi;
|
|
1966
|
+
return s.top;
|
|
1967
|
+
},
|
|
1957
1968
|
get children() {
|
|
1958
1969
|
return i();
|
|
1959
1970
|
},
|
|
@@ -1973,17 +1984,17 @@ function Qr(t) {
|
|
|
1973
1984
|
}
|
|
1974
1985
|
},
|
|
1975
1986
|
formData(n) {
|
|
1976
|
-
if (n == null) {
|
|
1987
|
+
if (n == null || typeof n == "boolean") {
|
|
1977
1988
|
const o = {};
|
|
1978
1989
|
return Object.keys(t.form).forEach((a) => {
|
|
1979
|
-
t.ignoreFields.indexOf(a) === -1 && (o[a] =
|
|
1990
|
+
(n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] = ve(t.form[a]));
|
|
1980
1991
|
}), o;
|
|
1981
1992
|
} else
|
|
1982
1993
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
1983
1994
|
},
|
|
1984
1995
|
getValue(n) {
|
|
1985
1996
|
const o = t.getFieldCtx(n);
|
|
1986
|
-
return o ?
|
|
1997
|
+
return o ? ve(o.rule.value) : t.options.appendValue !== !1 && D(t.appendData, n) ? ve(t.appendData[n]) : void 0;
|
|
1987
1998
|
},
|
|
1988
1999
|
coverValue(n) {
|
|
1989
2000
|
const o = b({}, n || {});
|
|
@@ -1991,9 +2002,9 @@ function Qr(t) {
|
|
|
1991
2002
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
1992
2003
|
const l = t.fieldCtx[a];
|
|
1993
2004
|
if (l) {
|
|
1994
|
-
const u =
|
|
1995
|
-
l.forEach((
|
|
1996
|
-
|
|
2005
|
+
const u = D(n, a);
|
|
2006
|
+
l.forEach((c) => {
|
|
2007
|
+
c.rule.value = u ? n[a] : void 0;
|
|
1997
2008
|
}), delete o[a];
|
|
1998
2009
|
}
|
|
1999
2010
|
}), _(t.appendData, o);
|
|
@@ -2020,7 +2031,7 @@ function Qr(t) {
|
|
|
2020
2031
|
}, !0), o ? o.origin : void 0;
|
|
2021
2032
|
},
|
|
2022
2033
|
removeRule(n) {
|
|
2023
|
-
const o = n &&
|
|
2034
|
+
const o = n && x(n);
|
|
2024
2035
|
if (o)
|
|
2025
2036
|
return o.rm(), o.origin;
|
|
2026
2037
|
},
|
|
@@ -2030,24 +2041,24 @@ function Qr(t) {
|
|
|
2030
2041
|
fields: () => t.fields(),
|
|
2031
2042
|
append: (n, o, a) => {
|
|
2032
2043
|
let l = t.sort.length - 1, u;
|
|
2033
|
-
const
|
|
2034
|
-
if (
|
|
2044
|
+
const c = t.getCtx(o);
|
|
2045
|
+
if (c)
|
|
2035
2046
|
if (a) {
|
|
2036
|
-
if (u =
|
|
2037
|
-
l =
|
|
2047
|
+
if (u = c.getPending("children", c.rule.children), !Array.isArray(u)) return;
|
|
2048
|
+
l = c.rule.children.length - 1;
|
|
2038
2049
|
} else
|
|
2039
|
-
l =
|
|
2050
|
+
l = c.root.indexOf(c.origin), u = c.root;
|
|
2040
2051
|
else u = t.rules;
|
|
2041
2052
|
u.splice(l + 1, 0, n);
|
|
2042
2053
|
},
|
|
2043
2054
|
prepend: (n, o, a) => {
|
|
2044
2055
|
let l = 0, u;
|
|
2045
|
-
const
|
|
2046
|
-
if (
|
|
2056
|
+
const c = t.getCtx(o);
|
|
2057
|
+
if (c)
|
|
2047
2058
|
if (a) {
|
|
2048
|
-
if (u =
|
|
2059
|
+
if (u = c.getPending("children", c.rule.children), !Array.isArray(u)) return;
|
|
2049
2060
|
} else
|
|
2050
|
-
l =
|
|
2061
|
+
l = c.root.indexOf(c.origin), u = c.root;
|
|
2051
2062
|
else u = t.rules;
|
|
2052
2063
|
u.splice(l, 0, n);
|
|
2053
2064
|
},
|
|
@@ -2070,7 +2081,7 @@ function Qr(t) {
|
|
|
2070
2081
|
disabled(n, o) {
|
|
2071
2082
|
e(o).forEach((a) => {
|
|
2072
2083
|
t.getCtxs(a).forEach((l) => {
|
|
2073
|
-
|
|
2084
|
+
E(l.rule.props, "disabled", !!n);
|
|
2074
2085
|
});
|
|
2075
2086
|
}), t.refresh();
|
|
2076
2087
|
},
|
|
@@ -2109,7 +2120,7 @@ function Qr(t) {
|
|
|
2109
2120
|
n.forEach((a) => s.sync(a));
|
|
2110
2121
|
return;
|
|
2111
2122
|
}
|
|
2112
|
-
let o = h.Object(n) ?
|
|
2123
|
+
let o = h.Object(n) ? x(n) : t.getCtxs(n);
|
|
2113
2124
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2114
2125
|
if (!a.deleted) {
|
|
2115
2126
|
const l = t.subForm[a.id];
|
|
@@ -2128,7 +2139,7 @@ function Qr(t) {
|
|
|
2128
2139
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2129
2140
|
},
|
|
2130
2141
|
hideForm: (n) => {
|
|
2131
|
-
|
|
2142
|
+
E(t.vm, "isShow", !n);
|
|
2132
2143
|
},
|
|
2133
2144
|
changeStatus: () => t.changeStatus,
|
|
2134
2145
|
clearChangeStatus: () => {
|
|
@@ -2146,7 +2157,7 @@ function Qr(t) {
|
|
|
2146
2157
|
},
|
|
2147
2158
|
mergeRule: (n, o) => {
|
|
2148
2159
|
t.getCtxs(n).forEach((a) => {
|
|
2149
|
-
|
|
2160
|
+
te(a.rule, o);
|
|
2150
2161
|
});
|
|
2151
2162
|
},
|
|
2152
2163
|
mergeRules(n) {
|
|
@@ -2173,7 +2184,7 @@ function Qr(t) {
|
|
|
2173
2184
|
},
|
|
2174
2185
|
setEffect(n, o, a) {
|
|
2175
2186
|
const l = t.getCtx(n);
|
|
2176
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2187
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), D(l.rule, "$" + o) && E(l.rule, "$" + o, a), D(l.rule, "effect") || E(l.rule, "effect", {}), E(l.rule.effect, o, a));
|
|
2177
2188
|
},
|
|
2178
2189
|
clearEffectData(n, o) {
|
|
2179
2190
|
const a = t.getCtx(n);
|
|
@@ -2193,7 +2204,7 @@ function Qr(t) {
|
|
|
2193
2204
|
resetFields(n) {
|
|
2194
2205
|
e(n).forEach((o) => {
|
|
2195
2206
|
t.getCtxs(o).forEach((a) => {
|
|
2196
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2207
|
+
t.$render.clearCache(a), a.rule.value = ve(a.defaultValue);
|
|
2197
2208
|
});
|
|
2198
2209
|
}), T(() => {
|
|
2199
2210
|
T(() => {
|
|
@@ -2201,7 +2212,7 @@ function Qr(t) {
|
|
|
2201
2212
|
s.clearValidateState(n);
|
|
2202
2213
|
});
|
|
2203
2214
|
});
|
|
2204
|
-
}), n == null && (h.Function(t.options.onReset) &&
|
|
2215
|
+
}), n == null && (h.Function(t.options.onReset) && F(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
2205
2216
|
},
|
|
2206
2217
|
method(n, o) {
|
|
2207
2218
|
const a = s.el(n);
|
|
@@ -2210,7 +2221,7 @@ function Qr(t) {
|
|
|
2210
2221
|
return (...l) => a[o](...l);
|
|
2211
2222
|
},
|
|
2212
2223
|
exec(n, o, ...a) {
|
|
2213
|
-
return
|
|
2224
|
+
return F(() => s.method(n, o)(...a));
|
|
2214
2225
|
},
|
|
2215
2226
|
toJson(n) {
|
|
2216
2227
|
return et(s.rule, n);
|
|
@@ -2232,21 +2243,21 @@ function Qr(t) {
|
|
|
2232
2243
|
return o ? t.subForm[o.id] : void 0;
|
|
2233
2244
|
},
|
|
2234
2245
|
getChildrenRuleList(n) {
|
|
2235
|
-
const o = typeof n == "object", a = o ?
|
|
2246
|
+
const o = typeof n == "object", a = o ? x(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2236
2247
|
if (!l)
|
|
2237
2248
|
return [];
|
|
2238
2249
|
const u = [];
|
|
2239
2250
|
return ((d) => {
|
|
2240
|
-
d && d.forEach((
|
|
2241
|
-
typeof
|
|
2251
|
+
d && d.forEach((m) => {
|
|
2252
|
+
typeof m == "object" && (m.field && u.push(m), u.push(...s.getChildrenRuleList(m)));
|
|
2242
2253
|
});
|
|
2243
2254
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2244
2255
|
},
|
|
2245
2256
|
getParentRule(n) {
|
|
2246
|
-
return (typeof n == "object" ?
|
|
2257
|
+
return (typeof n == "object" ? x(n) : t.getCtx(n)).parent.rule;
|
|
2247
2258
|
},
|
|
2248
2259
|
getParentSubRule(n) {
|
|
2249
|
-
const a = typeof n == "object" ?
|
|
2260
|
+
const a = typeof n == "object" ? x(n) : t.getCtx(n);
|
|
2250
2261
|
if (a) {
|
|
2251
2262
|
const l = a.getParentGroup();
|
|
2252
2263
|
if (l)
|
|
@@ -2254,20 +2265,20 @@ function Qr(t) {
|
|
|
2254
2265
|
}
|
|
2255
2266
|
},
|
|
2256
2267
|
getChildrenFormData(n) {
|
|
2257
|
-
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] =
|
|
2268
|
+
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] = ve(l.value), a), {});
|
|
2258
2269
|
},
|
|
2259
2270
|
setChildrenFormData(n, o, a) {
|
|
2260
2271
|
const l = s.getChildrenRuleList(n);
|
|
2261
2272
|
t.deferSyncValue(() => {
|
|
2262
2273
|
l.forEach((u) => {
|
|
2263
|
-
|
|
2274
|
+
D(o, u.field) ? u.value = o[u.field] : a && (u.value = void 0);
|
|
2264
2275
|
});
|
|
2265
2276
|
});
|
|
2266
2277
|
},
|
|
2267
2278
|
getGlobalEvent(n) {
|
|
2268
2279
|
let o = s.options.globalEvent[n];
|
|
2269
2280
|
if (o)
|
|
2270
|
-
return typeof o == "object" && (o = o.handle),
|
|
2281
|
+
return typeof o == "object" && (o = o.handle), z(o);
|
|
2271
2282
|
},
|
|
2272
2283
|
getGlobalData(n) {
|
|
2273
2284
|
return new Promise((o, a) => {
|
|
@@ -2278,18 +2289,18 @@ function Qr(t) {
|
|
|
2278
2289
|
});
|
|
2279
2290
|
},
|
|
2280
2291
|
renderRule(n, o, a) {
|
|
2281
|
-
const u = typeof n == "object" ?
|
|
2292
|
+
const u = typeof n == "object" ? x(n) : t.getCtx(n);
|
|
2282
2293
|
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2283
2294
|
},
|
|
2284
2295
|
renderChildren(n, o, a) {
|
|
2285
|
-
const u = typeof n == "object" ?
|
|
2296
|
+
const u = typeof n == "object" ? x(n) : t.getCtx(n);
|
|
2286
2297
|
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2287
2298
|
},
|
|
2288
2299
|
nextTick(n) {
|
|
2289
2300
|
t.bus.$once("next-tick", n), t.refresh();
|
|
2290
2301
|
},
|
|
2291
2302
|
nextRefresh(n) {
|
|
2292
|
-
t.nextRefresh(), n &&
|
|
2303
|
+
t.nextRefresh(), n && F(n);
|
|
2293
2304
|
},
|
|
2294
2305
|
emit(n, ...o) {
|
|
2295
2306
|
t.vm.$emit(n, ...o);
|
|
@@ -2300,25 +2311,25 @@ function Qr(t) {
|
|
|
2300
2311
|
bus: t.bus,
|
|
2301
2312
|
fetch(n) {
|
|
2302
2313
|
return new Promise((o, a) => {
|
|
2303
|
-
n =
|
|
2304
|
-
|
|
2314
|
+
n = X(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2315
|
+
F(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2305
2316
|
}).catch((l) => {
|
|
2306
|
-
|
|
2317
|
+
F(() => n.onError && n.onError(l)), a(l);
|
|
2307
2318
|
}));
|
|
2308
2319
|
});
|
|
2309
2320
|
},
|
|
2310
2321
|
watchFetch(n, o, a, l) {
|
|
2311
|
-
return t.fc.watchLoadData((u,
|
|
2312
|
-
let d =
|
|
2313
|
-
d = t.loadFetchVar(d, u), !(l && l(d,
|
|
2314
|
-
|
|
2315
|
-
}).catch((
|
|
2316
|
-
|
|
2322
|
+
return t.fc.watchLoadData((u, c) => {
|
|
2323
|
+
let d = X(n);
|
|
2324
|
+
d = t.loadFetchVar(d, u), !(l && l(d, c) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((m) => {
|
|
2325
|
+
F(() => d.onSuccess && d.onSuccess(m)), o && o(m, c);
|
|
2326
|
+
}).catch((m) => {
|
|
2327
|
+
F(() => d.onError && d.onError(m)), a && a(m);
|
|
2317
2328
|
}));
|
|
2318
2329
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2319
2330
|
},
|
|
2320
2331
|
getData(n, o) {
|
|
2321
|
-
return t.fc.getLoadData(n, o);
|
|
2332
|
+
return t.fc.get ? t.fc.get(n, o) : t.fc.getLoadData(n, o);
|
|
2322
2333
|
},
|
|
2323
2334
|
setData(n, o, a) {
|
|
2324
2335
|
return t.fc.setData(n, o, a);
|
|
@@ -2375,7 +2386,7 @@ function Zr(t) {
|
|
|
2375
2386
|
}
|
|
2376
2387
|
});
|
|
2377
2388
|
}
|
|
2378
|
-
function
|
|
2389
|
+
function J(t) {
|
|
2379
2390
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2380
2391
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2381
2392
|
});
|
|
@@ -2393,7 +2404,7 @@ function Yr(t) {
|
|
|
2393
2404
|
const r = (i) => {
|
|
2394
2405
|
if (i) {
|
|
2395
2406
|
let s;
|
|
2396
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2407
|
+
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);
|
|
2397
2408
|
}
|
|
2398
2409
|
};
|
|
2399
2410
|
return r(this.vm);
|
|
@@ -2402,7 +2413,7 @@ function Yr(t) {
|
|
|
2402
2413
|
if (!this.vm.isShow)
|
|
2403
2414
|
return;
|
|
2404
2415
|
this.$manager.beforeRender();
|
|
2405
|
-
const e =
|
|
2416
|
+
const e = Oe();
|
|
2406
2417
|
return this.sort.forEach((r) => {
|
|
2407
2418
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2408
2419
|
}), this.$manager.render(e);
|
|
@@ -2413,23 +2424,23 @@ function Yr(t) {
|
|
|
2413
2424
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2414
2425
|
},
|
|
2415
2426
|
mergeGlobal(e) {
|
|
2416
|
-
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] =
|
|
2427
|
+
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = ye(() => {
|
|
2417
2428
|
const i = this.$handle.options.global;
|
|
2418
|
-
return
|
|
2419
|
-
})), e.prop =
|
|
2429
|
+
return te({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2430
|
+
})), e.prop = te({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2420
2431
|
},
|
|
2421
2432
|
setOptions(e) {
|
|
2422
2433
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2423
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2434
|
+
e.prop.options = r, e.prop.optionsTo && r && oe(e.prop, e.prop.optionsTo, r);
|
|
2424
2435
|
},
|
|
2425
2436
|
deepSet(e) {
|
|
2426
2437
|
const r = e.rule.deep;
|
|
2427
2438
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2428
|
-
|
|
2439
|
+
oe(e.prop, i, r[i]);
|
|
2429
2440
|
});
|
|
2430
2441
|
},
|
|
2431
2442
|
parseSide(e, r) {
|
|
2432
|
-
return h.Object(e) ?
|
|
2443
|
+
return h.Object(e) ? te({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2433
2444
|
},
|
|
2434
2445
|
renderSides(e, r, i) {
|
|
2435
2446
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2463,23 +2474,23 @@ function Yr(t) {
|
|
|
2463
2474
|
model: n.model || {},
|
|
2464
2475
|
slotValue: l
|
|
2465
2476
|
};
|
|
2466
|
-
l.length && i.slotUpdate &&
|
|
2467
|
-
let
|
|
2477
|
+
l.length && i.slotUpdate && F(() => i.slotUpdate(u));
|
|
2478
|
+
let c = [];
|
|
2468
2479
|
const d = e.loadChildrenPending();
|
|
2469
|
-
e.parser.renderChildren ?
|
|
2470
|
-
|
|
2480
|
+
e.parser.renderChildren ? c = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
|
|
2481
|
+
c.push(this.renderRule({
|
|
2471
2482
|
type: "template",
|
|
2472
|
-
slot:
|
|
2483
|
+
slot: $
|
|
2473
2484
|
}, (() => {
|
|
2474
|
-
if (h.Function(n.renderSlots[
|
|
2475
|
-
return
|
|
2476
|
-
const w = this.parseSide(n.renderSlots[
|
|
2485
|
+
if (h.Function(n.renderSlots[$]))
|
|
2486
|
+
return F(() => n.renderSlots[$]());
|
|
2487
|
+
const w = this.parseSide(n.renderSlots[$], e);
|
|
2477
2488
|
return this.renderRule(w);
|
|
2478
2489
|
})()));
|
|
2479
2490
|
});
|
|
2480
|
-
const
|
|
2481
|
-
let
|
|
2482
|
-
return
|
|
2491
|
+
const m = this.getTypeSlot(e);
|
|
2492
|
+
let g;
|
|
2493
|
+
return m ? (u.children = c, g = m(u)) : g = a ? e.parser.preview(Ge(c), e) : e.parser.render(Ge(c), e), g = this.renderSides(g, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), g = this.$manager.makeWrap(e, g)), e.none && (Array.isArray(g) ? g = g.map(($) => !$ || !$.tag ? $ : this.none($)) : g = this.none(g)), o && this.setCache(e, () => this.stable(g), r), g;
|
|
2483
2494
|
}, this.setCache(e, s, r);
|
|
2484
2495
|
}
|
|
2485
2496
|
return (...s) => {
|
|
@@ -2587,7 +2598,7 @@ function Yr(t) {
|
|
|
2587
2598
|
}
|
|
2588
2599
|
});
|
|
2589
2600
|
}
|
|
2590
|
-
return
|
|
2601
|
+
return ee(n, e.prop), e.prop;
|
|
2591
2602
|
},
|
|
2592
2603
|
onMounted(e) {
|
|
2593
2604
|
e.el = this.vm.$refs[e.ref], e.el && ((e.el.$el || e.el).__rule__ = e.rule), e.parser.mounted(e), this.$handle.effect(e, "mounted"), this.$handle.targetHook(e, "mounted");
|
|
@@ -2604,7 +2615,7 @@ function Yr(t) {
|
|
|
2604
2615
|
},
|
|
2605
2616
|
renderChildren(e, r, i) {
|
|
2606
2617
|
if (!h.trueArray(e)) return [];
|
|
2607
|
-
const s =
|
|
2618
|
+
const s = Oe();
|
|
2608
2619
|
return e.map((n) => {
|
|
2609
2620
|
if (n) {
|
|
2610
2621
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2630,7 +2641,7 @@ function Yr(t) {
|
|
|
2630
2641
|
},
|
|
2631
2642
|
createRuleVnode(e, r, i) {
|
|
2632
2643
|
this.force = i !== !1, this.tmpInput = r;
|
|
2633
|
-
const s =
|
|
2644
|
+
const s = Oe();
|
|
2634
2645
|
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2635
2646
|
},
|
|
2636
2647
|
renderRule(e, r, i) {
|
|
@@ -2640,12 +2651,12 @@ function Yr(t) {
|
|
|
2640
2651
|
if (i)
|
|
2641
2652
|
s = e.type;
|
|
2642
2653
|
else if (s = e.is, e.type) {
|
|
2643
|
-
s =
|
|
2654
|
+
s = J(e.type);
|
|
2644
2655
|
const a = this.vNode.aliasMap[s];
|
|
2645
|
-
a && (s =
|
|
2656
|
+
a && (s = J(a));
|
|
2646
2657
|
}
|
|
2647
2658
|
if (!s) return;
|
|
2648
|
-
const n =
|
|
2659
|
+
const n = Oe();
|
|
2649
2660
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2650
2661
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2651
2662
|
});
|
|
@@ -2694,26 +2705,26 @@ function ei(t) {
|
|
|
2694
2705
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2695
2706
|
return this.parseEventLst(e, r, i, !0);
|
|
2696
2707
|
if (h.String(r)) {
|
|
2697
|
-
const n =
|
|
2708
|
+
const n = z(r);
|
|
2698
2709
|
if (n && r !== n)
|
|
2699
2710
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2700
2711
|
}
|
|
2701
2712
|
},
|
|
2702
2713
|
parseEmit(e, r) {
|
|
2703
2714
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2704
|
-
return h.trueArray(u) && u.forEach((
|
|
2705
|
-
if (!
|
|
2706
|
-
let d,
|
|
2707
|
-
if (h.Object(
|
|
2708
|
-
r || (
|
|
2709
|
-
const
|
|
2710
|
-
this.vm.$emit(
|
|
2715
|
+
return h.trueArray(u) && u.forEach((c) => {
|
|
2716
|
+
if (!c) return;
|
|
2717
|
+
let d, m = n || o || a;
|
|
2718
|
+
if (h.Object(c) && (d = c.inject, c = c.name, m = c.prefix || m), m) {
|
|
2719
|
+
r || (m = `native-${m}`);
|
|
2720
|
+
const g = be(`${m}-${c}`), $ = (...w) => {
|
|
2721
|
+
this.vm.$emit(g, ...w), this.vm.$emit("emit-event", g, ...w), this.bus.$emit(g, ...w);
|
|
2711
2722
|
};
|
|
2712
|
-
if (
|
|
2713
|
-
i[
|
|
2723
|
+
if ($.__emit = !0, !d && l === !1)
|
|
2724
|
+
i[c] = $;
|
|
2714
2725
|
else {
|
|
2715
2726
|
let w = d || l || this.options.injectEvent;
|
|
2716
|
-
i[
|
|
2727
|
+
i[c] = h.Undef(w) ? $ : this.inject(s, $, w);
|
|
2717
2728
|
}
|
|
2718
2729
|
}
|
|
2719
2730
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2748,16 +2759,16 @@ function ei(t) {
|
|
|
2748
2759
|
if (n.forEach((a) => {
|
|
2749
2760
|
const l = a.split("||"), u = l[0].trim();
|
|
2750
2761
|
if (u) {
|
|
2751
|
-
const
|
|
2752
|
-
let d,
|
|
2762
|
+
const c = (l[1] || "").trim();
|
|
2763
|
+
let d, m = !1;
|
|
2753
2764
|
if (i && u.indexOf("$form.") === 0) {
|
|
2754
|
-
const
|
|
2755
|
-
|
|
2756
|
-
id: "$form." +
|
|
2757
|
-
getValue: () =>
|
|
2758
|
-
}) :
|
|
2765
|
+
const g = u.split(".");
|
|
2766
|
+
g.shift(), D(i.value, g[0]) && (m = !0, d = r ? r({
|
|
2767
|
+
id: "$form." + g[0] + "_" + i.rule.__fc__.id,
|
|
2768
|
+
getValue: () => L(i.value, g)
|
|
2769
|
+
}) : L(i.value, g));
|
|
2759
2770
|
}
|
|
2760
|
-
|
|
2771
|
+
m || (d = r ? r(u, c) : this.fc.getLoadData(u, c)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2761
2772
|
}
|
|
2762
2773
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2763
2774
|
return o;
|
|
@@ -2820,9 +2831,9 @@ function ii(t) {
|
|
|
2820
2831
|
}
|
|
2821
2832
|
function ni(t) {
|
|
2822
2833
|
Object.defineProperties(t.origin, {
|
|
2823
|
-
__fc__: Ke(
|
|
2834
|
+
__fc__: Ke(ge(t), !0)
|
|
2824
2835
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2825
|
-
__fc__: Ke(
|
|
2836
|
+
__fc__: Ke(ge(t), !0)
|
|
2826
2837
|
});
|
|
2827
2838
|
}
|
|
2828
2839
|
function qt(t, e, r) {
|
|
@@ -2851,7 +2862,7 @@ function qt(t, e, r) {
|
|
|
2851
2862
|
input: s,
|
|
2852
2863
|
el: void 0,
|
|
2853
2864
|
exportEl: void 0,
|
|
2854
|
-
defaultValue: s ?
|
|
2865
|
+
defaultValue: s ? X(r) : void 0,
|
|
2855
2866
|
field: e.field || void 0
|
|
2856
2867
|
}), this.updateKey(), ni(this), this.update(t, !0);
|
|
2857
2868
|
}
|
|
@@ -2888,12 +2899,12 @@ _(qt.prototype, {
|
|
|
2888
2899
|
delete this.pending[e];
|
|
2889
2900
|
let a = r;
|
|
2890
2901
|
if (h.Function(r)) {
|
|
2891
|
-
let l =
|
|
2902
|
+
let l = F(() => r({
|
|
2892
2903
|
rule: this.rule,
|
|
2893
2904
|
api: this.$api,
|
|
2894
2905
|
update: (u) => {
|
|
2895
|
-
const
|
|
2896
|
-
this.setPending(e, r,
|
|
2906
|
+
const c = u || i, d = this.getPending(e, i);
|
|
2907
|
+
this.setPending(e, r, c), o && o(c, d);
|
|
2897
2908
|
},
|
|
2898
2909
|
reload: () => {
|
|
2899
2910
|
const u = this.getPending(e, i);
|
|
@@ -2901,8 +2912,8 @@ _(qt.prototype, {
|
|
|
2901
2912
|
}
|
|
2902
2913
|
}));
|
|
2903
2914
|
l && h.Function(l.then) ? (l.then((u) => {
|
|
2904
|
-
const
|
|
2905
|
-
this.setPending(e, r,
|
|
2915
|
+
const c = u || i;
|
|
2916
|
+
this.setPending(e, r, c), s && s(c), this.$api && this.$api.sync(this.rule);
|
|
2906
2917
|
}).catch((u) => {
|
|
2907
2918
|
console.error(u);
|
|
2908
2919
|
}), a = i, this.setPending(e, r, a)) : (a = l || i, this.setPending(e, r, a), s && s(a));
|
|
@@ -2915,7 +2926,7 @@ _(qt.prototype, {
|
|
|
2915
2926
|
setPending(t, e, r) {
|
|
2916
2927
|
this.pending[t] = {
|
|
2917
2928
|
origin: e,
|
|
2918
|
-
value:
|
|
2929
|
+
value: ne(r)
|
|
2919
2930
|
};
|
|
2920
2931
|
},
|
|
2921
2932
|
effectData(t) {
|
|
@@ -2928,7 +2939,7 @@ _(qt.prototype, {
|
|
|
2928
2939
|
this.key = je(), t && this.parent && this.parent.updateKey(t);
|
|
2929
2940
|
},
|
|
2930
2941
|
updateType() {
|
|
2931
|
-
this.originType = this.rule.type, this.type =
|
|
2942
|
+
this.originType = this.rule.type, this.type = J(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
2932
2943
|
},
|
|
2933
2944
|
setParser(t) {
|
|
2934
2945
|
this.parser = t, t.init(this);
|
|
@@ -2936,7 +2947,7 @@ _(qt.prototype, {
|
|
|
2936
2947
|
initProp() {
|
|
2937
2948
|
var e, r;
|
|
2938
2949
|
const t = b({}, this.rule);
|
|
2939
|
-
delete t.children, delete t.validate, this.prop =
|
|
2950
|
+
delete t.children, delete t.validate, this.prop = te({}, [t, ...Object.keys(this.payload).map((i) => this.payload[i]), this.computed]), this.prop.validate = [...((r = (e = this.refRule) == null ? void 0 : e.__$validate) == null ? void 0 : r.value) || [], ...this.prop.validate || []];
|
|
2940
2951
|
},
|
|
2941
2952
|
initNone() {
|
|
2942
2953
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -3011,12 +3022,12 @@ function si(t) {
|
|
|
3011
3022
|
});
|
|
3012
3023
|
},
|
|
3013
3024
|
parseRule(e) {
|
|
3014
|
-
const r =
|
|
3025
|
+
const r = ft(e);
|
|
3015
3026
|
return Object.defineProperties(r, {
|
|
3016
3027
|
__origin__: Ke(e, !0)
|
|
3017
3028
|
}), oi(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
3018
3029
|
i && this.loadFn(i, r);
|
|
3019
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
3030
|
+
}), this.loadCtrl(r), r.update && (r.update = z(r.update)), r;
|
|
3020
3031
|
},
|
|
3021
3032
|
loadFn(e, r) {
|
|
3022
3033
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -3025,12 +3036,12 @@ function si(t) {
|
|
|
3025
3036
|
},
|
|
3026
3037
|
loadCtrl(e) {
|
|
3027
3038
|
e.control && e.control.forEach((r) => {
|
|
3028
|
-
r.handle && (r.handle =
|
|
3039
|
+
r.handle && (r.handle = z(r.handle));
|
|
3029
3040
|
});
|
|
3030
3041
|
},
|
|
3031
3042
|
syncProp(e) {
|
|
3032
3043
|
const r = e.rule;
|
|
3033
|
-
h.trueArray(r.sync) &&
|
|
3044
|
+
h.trueArray(r.sync) && ee([{
|
|
3034
3045
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
3035
3046
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3036
3047
|
}, i), {})
|
|
@@ -3061,37 +3072,37 @@ function si(t) {
|
|
|
3061
3072
|
if (r && !h.Object(o) || !this.pageEnd && !r && a >= this.first) return;
|
|
3062
3073
|
if (o.__fc__ && o.__fc__.root === e && this.ctxs[o.__fc__.id])
|
|
3063
3074
|
return s(o.__fc__.loadChildrenPending(), o.__fc__), o.__fc__;
|
|
3064
|
-
let l =
|
|
3075
|
+
let l = ft(o);
|
|
3065
3076
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3066
3077
|
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);
|
|
3067
|
-
let
|
|
3068
|
-
if (
|
|
3069
|
-
if (
|
|
3070
|
-
if ($t(
|
|
3078
|
+
let c, d = !1, m = !!o.__fc__, g = l.value;
|
|
3079
|
+
if (m) {
|
|
3080
|
+
if (c = o.__fc__, g = c.defaultValue, c.deleted) {
|
|
3081
|
+
if ($t(c))
|
|
3071
3082
|
return;
|
|
3072
|
-
|
|
3073
|
-
} else if (!
|
|
3074
|
-
if ($t(
|
|
3083
|
+
c.update(this);
|
|
3084
|
+
} else if (!c.check(this)) {
|
|
3085
|
+
if ($t(c))
|
|
3075
3086
|
return;
|
|
3076
|
-
e[a] = o = o._clone ? o._clone() : At(et(o)),
|
|
3087
|
+
e[a] = o = o._clone ? o._clone() : At(et(o)), c = null, d = !0;
|
|
3077
3088
|
}
|
|
3078
3089
|
}
|
|
3079
|
-
if (
|
|
3080
|
-
|
|
3090
|
+
if (c)
|
|
3091
|
+
c.originType !== c.rule.type && c.updateType(), this.bindParser(c), this.appendValue(c.rule), c.parent && c.parent !== r && this.rmSubRuleData(c);
|
|
3081
3092
|
else {
|
|
3082
|
-
const
|
|
3083
|
-
|
|
3093
|
+
const O = this.parseRule(o);
|
|
3094
|
+
c = new qt(this, O, g), this.bindParser(c);
|
|
3084
3095
|
}
|
|
3085
|
-
[!1, !0].forEach((
|
|
3086
|
-
const
|
|
3087
|
-
if (
|
|
3088
|
-
const
|
|
3089
|
-
|
|
3096
|
+
[!1, !0].forEach((O) => this.parseEmit(c, O)), this.syncProp(c), c.parent = r || null, c.root = e, this.setCtx(c), !d && !m && (this.effect(c, "load"), this.targetHook(c, "load")), this.effect(c, "created");
|
|
3097
|
+
const $ = c.loadChildrenPending();
|
|
3098
|
+
if (c.parser.loadChildren === !1 || s($, c), !r) {
|
|
3099
|
+
const O = i(a);
|
|
3100
|
+
O > -1 || !a ? this.sort.splice(O + 1, 0, c.id) : this.sort.push(c.id);
|
|
3090
3101
|
}
|
|
3091
|
-
const w =
|
|
3092
|
-
return
|
|
3093
|
-
this.refreshUpdate(
|
|
3094
|
-
}), this.effect(
|
|
3102
|
+
const w = c.rule;
|
|
3103
|
+
return c.updated || (c.updated = !0, h.Function(w.update) && this.bus.$once("load-end", () => {
|
|
3104
|
+
this.refreshUpdate(c, w.value, "init");
|
|
3105
|
+
}), this.effect(c, "loaded")), this.refreshControl(c) && (this.cycleLoad = !0), c;
|
|
3095
3106
|
}).filter((o) => !!o);
|
|
3096
3107
|
r && (r.children = n);
|
|
3097
3108
|
},
|
|
@@ -3103,30 +3114,30 @@ function si(t) {
|
|
|
3103
3114
|
if (!r.length) return !1;
|
|
3104
3115
|
for (let a = 0; a < r.length; a++) {
|
|
3105
3116
|
const l = r[a], u = l.handle || function(d) {
|
|
3106
|
-
return (
|
|
3117
|
+
return (ce[l.condition || "=="] || ce["=="])(d, l.value);
|
|
3107
3118
|
};
|
|
3108
3119
|
if (!h.trueArray(l.rule)) continue;
|
|
3109
|
-
const
|
|
3110
|
-
valid:
|
|
3120
|
+
const c = q(b({}, l), {
|
|
3121
|
+
valid: F(() => u(e.rule.value, s)),
|
|
3111
3122
|
ctrl: li(e, l.rule),
|
|
3112
3123
|
isHidden: h.String(l.rule[0])
|
|
3113
3124
|
});
|
|
3114
|
-
|
|
3125
|
+
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
3115
3126
|
}
|
|
3116
3127
|
if (!i.length) return !1;
|
|
3117
3128
|
const n = [];
|
|
3118
3129
|
let o = !1;
|
|
3119
3130
|
return this.deferSyncValue(() => {
|
|
3120
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend:
|
|
3131
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: c, append: d, child: m, ctrl: g, method: $ }) => {
|
|
3121
3132
|
if (a) {
|
|
3122
3133
|
l ? e.ctrlRule.push({
|
|
3123
3134
|
__ctrl: !0,
|
|
3124
3135
|
children: u,
|
|
3125
3136
|
valid: l
|
|
3126
|
-
}) :
|
|
3127
|
-
|
|
3137
|
+
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3138
|
+
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((w) => {
|
|
3128
3139
|
this.api.setEffect(w, "required", l);
|
|
3129
|
-
}), l || this.api.clearValidateState(u)) : this.api.hidden(!l, u);
|
|
3140
|
+
}), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
3130
3141
|
});
|
|
3131
3142
|
return;
|
|
3132
3143
|
}
|
|
@@ -3139,11 +3150,11 @@ function si(t) {
|
|
|
3139
3150
|
children: u
|
|
3140
3151
|
};
|
|
3141
3152
|
e.ctrlRule.push(w), this.bus.$once("load-start", () => {
|
|
3142
|
-
|
|
3153
|
+
c ? s.prepend(w, c, m) : d || m ? s.append(w, d || e.id, m) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
|
|
3143
3154
|
});
|
|
3144
3155
|
} else {
|
|
3145
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3146
|
-
const w =
|
|
3156
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3157
|
+
const w = x(g);
|
|
3147
3158
|
w && w.rm();
|
|
3148
3159
|
}
|
|
3149
3160
|
});
|
|
@@ -3174,7 +3185,7 @@ function si(t) {
|
|
|
3174
3185
|
function oi(t) {
|
|
3175
3186
|
const e = Tt();
|
|
3176
3187
|
return Object.keys(e).forEach((r) => {
|
|
3177
|
-
|
|
3188
|
+
D(t, r) || E(t, r, e[r]);
|
|
3178
3189
|
}), t;
|
|
3179
3190
|
}
|
|
3180
3191
|
function ai(t) {
|
|
@@ -3214,7 +3225,7 @@ function ui(t) {
|
|
|
3214
3225
|
this.deferSyncValue(() => {
|
|
3215
3226
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3216
3227
|
Object.keys(r || {}).forEach((o) => {
|
|
3217
|
-
s &&
|
|
3228
|
+
s && D(s, o) ? n[o] = r[o] : D(this.api.form, o) ? this.api.form[o] = r[o] : this.api.top !== this.api && D(this.api.top.form, o) && (this.api.top.form[o] = r[o]);
|
|
3218
3229
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3219
3230
|
});
|
|
3220
3231
|
},
|
|
@@ -3224,11 +3235,11 @@ function ui(t) {
|
|
|
3224
3235
|
setFormData(e, r) {
|
|
3225
3236
|
e.modelValue = r;
|
|
3226
3237
|
const i = e.getParentGroup();
|
|
3227
|
-
i && (this.subRuleData[i.id] ||
|
|
3238
|
+
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);
|
|
3228
3239
|
},
|
|
3229
3240
|
rmSubRuleData(e) {
|
|
3230
3241
|
const r = e.getParentGroup();
|
|
3231
|
-
r && this.subRuleData[r.id] &&
|
|
3242
|
+
r && this.subRuleData[r.id] && ie(this.subRuleData[r.id], e.field);
|
|
3232
3243
|
},
|
|
3233
3244
|
getFormData(e) {
|
|
3234
3245
|
return this.formData[e.id];
|
|
@@ -3238,19 +3249,19 @@ function ui(t) {
|
|
|
3238
3249
|
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = De(this.appendData, n)), s), e), r.reduce((s, n) => {
|
|
3239
3250
|
const o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a.rule))[0] || this.fieldCtx[n][0];
|
|
3240
3251
|
return this.isIgnore(o.rule) && i.push(n), s[n] = De(o.rule, "value"), s;
|
|
3241
|
-
}, e), this.form =
|
|
3252
|
+
}, e), this.form = ne(e), this.ignoreFields = i, this.syncValue();
|
|
3242
3253
|
},
|
|
3243
3254
|
isIgnore(e) {
|
|
3244
3255
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
3245
3256
|
},
|
|
3246
3257
|
appendValue(e) {
|
|
3247
|
-
(!e.field || !
|
|
3258
|
+
(!e.field || !D(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3248
3259
|
},
|
|
3249
3260
|
addSubForm(e, r) {
|
|
3250
3261
|
this.subForm[e.id] = r;
|
|
3251
3262
|
},
|
|
3252
3263
|
deferSyncValue(e, r) {
|
|
3253
|
-
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r),
|
|
3264
|
+
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r), F(e), this.deferSyncFn === e && (this.deferSyncFn = null, e.sync && this.syncForm());
|
|
3254
3265
|
},
|
|
3255
3266
|
syncValue() {
|
|
3256
3267
|
if (this.deferSyncFn)
|
|
@@ -3268,7 +3279,7 @@ function ui(t) {
|
|
|
3268
3279
|
},
|
|
3269
3280
|
refreshUpdate(e, r, i, s) {
|
|
3270
3281
|
if (h.Function(e.rule.update)) {
|
|
3271
|
-
const n =
|
|
3282
|
+
const n = F(() => e.rule.update(r, e.origin, this.api, {
|
|
3272
3283
|
origin: i || "change",
|
|
3273
3284
|
linkField: s
|
|
3274
3285
|
}));
|
|
@@ -3316,8 +3327,8 @@ const ke = {
|
|
|
3316
3327
|
},
|
|
3317
3328
|
mergeProp(t) {
|
|
3318
3329
|
}
|
|
3319
|
-
},
|
|
3320
|
-
function
|
|
3330
|
+
}, ci = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3331
|
+
function fi(t) {
|
|
3321
3332
|
_(t.prototype, {
|
|
3322
3333
|
getCtx(e) {
|
|
3323
3334
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
@@ -3348,26 +3359,26 @@ function ci(t) {
|
|
|
3348
3359
|
getParser(e) {
|
|
3349
3360
|
const r = this.fc.parsers, i = this.fc.renderDriver;
|
|
3350
3361
|
if (i) {
|
|
3351
|
-
const s = i.parsers || {}, n = s[e.originType] || s[
|
|
3362
|
+
const s = i.parsers || {}, n = s[e.originType] || s[J(e.type)] || s[e.trueType];
|
|
3352
3363
|
if (n)
|
|
3353
3364
|
return n;
|
|
3354
3365
|
}
|
|
3355
|
-
return r[e.originType] || r[
|
|
3366
|
+
return r[e.originType] || r[J(e.type)] || r[e.trueType] || ke;
|
|
3356
3367
|
},
|
|
3357
3368
|
bindParser(e) {
|
|
3358
3369
|
e.setParser(this.getParser(e));
|
|
3359
3370
|
},
|
|
3360
3371
|
getType(e) {
|
|
3361
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
3362
|
-
return
|
|
3372
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[J(e)] || e;
|
|
3373
|
+
return J(i);
|
|
3363
3374
|
},
|
|
3364
3375
|
noWatch(e) {
|
|
3365
|
-
this.noWatchFn || (this.noWatchFn = e),
|
|
3376
|
+
this.noWatchFn || (this.noWatchFn = e), F(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3366
3377
|
},
|
|
3367
3378
|
watchCtx(e) {
|
|
3368
|
-
if (kt().filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
3379
|
+
if (kt().filter((i) => i[0] !== "_" && i[0] !== "$" && ci.indexOf(i) === -1).forEach((i) => {
|
|
3369
3380
|
const s = De(e.rule, i), n = i === "children";
|
|
3370
|
-
e.refRule[i] = s, e.watch.push(
|
|
3381
|
+
e.refRule[i] = s, e.watch.push(B(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3371
3382
|
let l = s.value;
|
|
3372
3383
|
if (!this.isBreakWatch()) {
|
|
3373
3384
|
if (n && e.parser.loadChildren === !1) {
|
|
@@ -3387,42 +3398,43 @@ function ci(t) {
|
|
|
3387
3398
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3388
3399
|
}
|
|
3389
3400
|
}, { deep: !n, sync: n }));
|
|
3390
|
-
}), e.refRule.__$title =
|
|
3401
|
+
}), e.refRule.__$title = ye(() => {
|
|
3391
3402
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3392
3403
|
if (i) {
|
|
3393
3404
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3394
3405
|
s && (i = this.api.t(s[1]));
|
|
3395
3406
|
}
|
|
3396
3407
|
return i;
|
|
3397
|
-
}), e.refRule.__$info =
|
|
3408
|
+
}), e.refRule.__$info = ye(() => {
|
|
3398
3409
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3399
3410
|
if (i) {
|
|
3400
3411
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3401
3412
|
s && (i = this.api.t(s[1]));
|
|
3402
3413
|
}
|
|
3403
3414
|
return i;
|
|
3404
|
-
}), e.refRule.__$validate =
|
|
3415
|
+
}), e.refRule.__$validate = ye(() => H(e.rule.validate).map((i) => {
|
|
3416
|
+
var n, o;
|
|
3405
3417
|
const s = b({}, i);
|
|
3406
3418
|
if (s.message) {
|
|
3407
|
-
const
|
|
3408
|
-
|
|
3419
|
+
const a = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3420
|
+
a && (s.message = this.api.t(a[1], { title: (o = (n = e.refRule) == null ? void 0 : n.__$title) == null ? void 0 : o.value }));
|
|
3409
3421
|
}
|
|
3410
3422
|
if (h.Function(s.validator)) {
|
|
3411
|
-
const
|
|
3412
|
-
return s.validator = function(...
|
|
3423
|
+
const a = e;
|
|
3424
|
+
return s.validator = function(...l) {
|
|
3413
3425
|
return i.validator.call({
|
|
3414
3426
|
that: this,
|
|
3415
|
-
id:
|
|
3416
|
-
field:
|
|
3417
|
-
rule:
|
|
3418
|
-
api:
|
|
3419
|
-
}, ...
|
|
3427
|
+
id: a.id,
|
|
3428
|
+
field: a.field,
|
|
3429
|
+
rule: a.rule,
|
|
3430
|
+
api: a.$handle.api
|
|
3431
|
+
}, ...l);
|
|
3420
3432
|
}, s;
|
|
3421
3433
|
}
|
|
3422
3434
|
return s;
|
|
3423
3435
|
})), e.input) {
|
|
3424
3436
|
const i = De(e.rule, "value");
|
|
3425
|
-
e.watch.push(
|
|
3437
|
+
e.watch.push(B(() => i.value, () => {
|
|
3426
3438
|
let s = e.parser.toFormValue(i.value, e);
|
|
3427
3439
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
3428
3440
|
}));
|
|
@@ -3431,15 +3443,15 @@ function ci(t) {
|
|
|
3431
3443
|
let i = e.rule.computed;
|
|
3432
3444
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3433
3445
|
let n;
|
|
3434
|
-
const o =
|
|
3446
|
+
const o = ye(() => {
|
|
3435
3447
|
const l = i[s];
|
|
3436
3448
|
if (!l) return;
|
|
3437
3449
|
const u = this.compute(e, l);
|
|
3438
3450
|
return l.linkage && u === void 0 ? n : u;
|
|
3439
3451
|
}), a = (l) => {
|
|
3440
|
-
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) :
|
|
3452
|
+
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : oe(e.rule, s, l);
|
|
3441
3453
|
};
|
|
3442
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3454
|
+
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== L(e.rule, s)) && a(o.value), e.watch.push(B(o, (l) => {
|
|
3443
3455
|
n = l, setTimeout(() => {
|
|
3444
3456
|
a(l);
|
|
3445
3457
|
});
|
|
@@ -3455,31 +3467,31 @@ function ci(t) {
|
|
|
3455
3467
|
return !0;
|
|
3456
3468
|
const l = a.mode === "OR";
|
|
3457
3469
|
let u = !0;
|
|
3458
|
-
for (let
|
|
3459
|
-
const d = a.group[
|
|
3460
|
-
let
|
|
3470
|
+
for (let c = 0; c < a.group.length; c++) {
|
|
3471
|
+
const d = a.group[c];
|
|
3472
|
+
let m, g = null;
|
|
3461
3473
|
if (d.variable)
|
|
3462
|
-
|
|
3474
|
+
g = JSON.stringify(this.fc.getLoadData(d.variable) || "");
|
|
3463
3475
|
else if (d.field)
|
|
3464
|
-
|
|
3476
|
+
g = dt(d.field || "");
|
|
3465
3477
|
else
|
|
3466
3478
|
return !0;
|
|
3467
|
-
let
|
|
3468
|
-
if (
|
|
3479
|
+
let $ = d.compare;
|
|
3480
|
+
if ($ && ($ = dt($ || "")), d.mode ? m = n(d) : ce[d.condition] ? h.Function(d.handler) ? m = F(() => d.handler(this.api, e.rule)) : m = F(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${g}, ${$ || "$val"}); }}}}`).call(this.api.form, ce, d.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : m = !1, l && m)
|
|
3469
3481
|
return !0;
|
|
3470
|
-
l || (u = u &&
|
|
3482
|
+
l || (u = u && m);
|
|
3471
3483
|
}
|
|
3472
3484
|
return l ? !1 : u;
|
|
3473
3485
|
};
|
|
3474
3486
|
let o = n(r);
|
|
3475
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ?
|
|
3487
|
+
return o = r.invert === !0 ? !o : o, r.linkage ? o ? F(() => this.computeValue(r.linkage, e, s), void 0) : void 0 : o;
|
|
3476
3488
|
} else if (h.Function(r))
|
|
3477
3489
|
i = () => r(this.api.form, this.api);
|
|
3478
3490
|
else {
|
|
3479
3491
|
const s = e.getParentGroup();
|
|
3480
3492
|
i = () => this.computeValue(r, e, s);
|
|
3481
3493
|
}
|
|
3482
|
-
return
|
|
3494
|
+
return F(i, void 0);
|
|
3483
3495
|
},
|
|
3484
3496
|
computeValue(e, r, i) {
|
|
3485
3497
|
const s = this, n = Object.keys(this.fc.formulas).reduce((o, a) => (o[a] = function(...l) {
|
|
@@ -3490,7 +3502,7 @@ function ci(t) {
|
|
|
3490
3502
|
fc: s.fc
|
|
3491
3503
|
}, ...l);
|
|
3492
3504
|
}, o), {});
|
|
3493
|
-
return new Function("$formulas", "$form", "$group", "$rule", "$api", `with($form){with(this){with($group){with($formulas){ return ${e} }}}}`).call(this.api.form, n, this.api.top.form, i ? this.subRuleData[i.id] || {} : {}, r.rule, this.api);
|
|
3505
|
+
return 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);
|
|
3494
3506
|
},
|
|
3495
3507
|
updateChildren(e, r, i) {
|
|
3496
3508
|
this.deferSyncValue(() => {
|
|
@@ -3507,9 +3519,9 @@ function ci(t) {
|
|
|
3507
3519
|
rmCtx(e) {
|
|
3508
3520
|
if (e.deleted) return;
|
|
3509
3521
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3510
|
-
|
|
3522
|
+
ie(this.ctxs, r), ie(this.formData, r), ie(this.subForm, r), ie(this.vm.ctxInject, r);
|
|
3511
3523
|
const o = e.getParentGroup();
|
|
3512
|
-
o && this.subRuleData[o.id] &&
|
|
3524
|
+
o && this.subRuleData[o.id] && ie(this.subRuleData[o.id], i), e.group && ie(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !D(this.fieldCtx, i) && ie(this.form, i), this.deferSyncValue(() => {
|
|
3513
3525
|
if (!this.reloading) {
|
|
3514
3526
|
if (e.parser.loadChildren !== !1) {
|
|
3515
3527
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3535,10 +3547,10 @@ function hi(t) {
|
|
|
3535
3547
|
this.fc.targetFormDriver(e, this.api, this.fc), this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3536
3548
|
},
|
|
3537
3549
|
emitEvent(e, ...r) {
|
|
3538
|
-
const i = this.options[e] || this.options[
|
|
3550
|
+
const i = this.options[e] || this.options[J("on-" + e)];
|
|
3539
3551
|
if (i) {
|
|
3540
|
-
const s =
|
|
3541
|
-
h.Function(s) &&
|
|
3552
|
+
const s = z(i);
|
|
3553
|
+
h.Function(s) && F(() => s(...r));
|
|
3542
3554
|
}
|
|
3543
3555
|
this.bus.$emit(e, ...r);
|
|
3544
3556
|
},
|
|
@@ -3546,7 +3558,7 @@ function hi(t) {
|
|
|
3546
3558
|
var n, o;
|
|
3547
3559
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3548
3560
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3549
|
-
|
|
3561
|
+
F(() => a(q(b({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
|
|
3550
3562
|
}));
|
|
3551
3563
|
}
|
|
3552
3564
|
});
|
|
@@ -3573,7 +3585,7 @@ function di(t) {
|
|
|
3573
3585
|
let r = {
|
|
3574
3586
|
required: () => {
|
|
3575
3587
|
var i, s;
|
|
3576
|
-
return (
|
|
3588
|
+
return (D(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3577
3589
|
}
|
|
3578
3590
|
};
|
|
3579
3591
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3581,7 +3593,7 @@ function di(t) {
|
|
|
3581
3593
|
}), Object.keys(e.rule).forEach((i) => {
|
|
3582
3594
|
i[0] === "$" && (r[i.substr(1)] = () => e.rule[i]);
|
|
3583
3595
|
}), Object.keys(r).forEach((i) => {
|
|
3584
|
-
e.watch.push(
|
|
3596
|
+
e.watch.push(B(r[i], (s) => {
|
|
3585
3597
|
this.effect(e, "watch", { [i]: s });
|
|
3586
3598
|
}, { deep: !0 }));
|
|
3587
3599
|
});
|
|
@@ -3603,26 +3615,26 @@ function di(t) {
|
|
|
3603
3615
|
}, r);
|
|
3604
3616
|
},
|
|
3605
3617
|
getEffect(e, r) {
|
|
3606
|
-
if (
|
|
3618
|
+
if (D(e, "$" + r))
|
|
3607
3619
|
return e["$" + r];
|
|
3608
|
-
if (
|
|
3620
|
+
if (D(e, "effect") && D(e.effect, r))
|
|
3609
3621
|
return e.effect[r];
|
|
3610
3622
|
},
|
|
3611
3623
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3612
3624
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3613
|
-
const l = n || Object.keys(r).reduce((u,
|
|
3625
|
+
const l = n || Object.keys(r).reduce((u, c) => (c[0] === "$" && (u[c.substr(1)] = r[c]), u), b({}, r.effect || {}));
|
|
3614
3626
|
Object.keys(l).forEach((u) => {
|
|
3615
|
-
const
|
|
3616
|
-
if (!
|
|
3627
|
+
const c = this.providers[u];
|
|
3628
|
+
if (!c || c.input && !i) return;
|
|
3617
3629
|
let d;
|
|
3618
|
-
if (!
|
|
3630
|
+
if (!c._c)
|
|
3619
3631
|
d = "*";
|
|
3620
|
-
else if (
|
|
3632
|
+
else if (c._used.indexOf(s) > -1)
|
|
3621
3633
|
d = s;
|
|
3622
3634
|
else
|
|
3623
3635
|
return;
|
|
3624
|
-
const
|
|
3625
|
-
e && (
|
|
3636
|
+
const m = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3637
|
+
e && (m.getProp = () => e.effectData(u), m.clearProp = () => e.clearEffectData(u), m.mergeProp = (g) => te(m.getProp(), [g]), m.id = e.id), this.bus.$emit(`p:${u}:${d}:${c.input ? 1 : 0}`, o, [m, r, this.api]);
|
|
3626
3638
|
});
|
|
3627
3639
|
}
|
|
3628
3640
|
});
|
|
@@ -3639,7 +3651,7 @@ function mi(t) {
|
|
|
3639
3651
|
return r.length ? r : !1;
|
|
3640
3652
|
} else return h.String(e) ? [e] : !1;
|
|
3641
3653
|
}
|
|
3642
|
-
function
|
|
3654
|
+
function Q(t) {
|
|
3643
3655
|
Pt(this, {
|
|
3644
3656
|
options() {
|
|
3645
3657
|
return t.options.value || {};
|
|
@@ -3659,10 +3671,10 @@ function X(t) {
|
|
|
3659
3671
|
noWatchFn: null,
|
|
3660
3672
|
deferSyncFn: null,
|
|
3661
3673
|
isMounted: !1,
|
|
3662
|
-
formData:
|
|
3663
|
-
subRuleData:
|
|
3674
|
+
formData: ne({}),
|
|
3675
|
+
subRuleData: ne({}),
|
|
3664
3676
|
subForm: {},
|
|
3665
|
-
form:
|
|
3677
|
+
form: ne({}),
|
|
3666
3678
|
appendData: {},
|
|
3667
3679
|
ignoreFields: [],
|
|
3668
3680
|
providers: {},
|
|
@@ -3675,11 +3687,11 @@ function X(t) {
|
|
|
3675
3687
|
this.lifecycle("reload");
|
|
3676
3688
|
}
|
|
3677
3689
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3678
|
-
const i =
|
|
3690
|
+
const i = F(() => r(e, this));
|
|
3679
3691
|
return i && i !== e && _(e, i), e;
|
|
3680
3692
|
}, Qr(this));
|
|
3681
3693
|
}
|
|
3682
|
-
_(
|
|
3694
|
+
_(Q.prototype, {
|
|
3683
3695
|
initData(t) {
|
|
3684
3696
|
_(this, {
|
|
3685
3697
|
ctxs: {},
|
|
@@ -3698,21 +3710,27 @@ _(X.prototype, {
|
|
|
3698
3710
|
isBreakWatch() {
|
|
3699
3711
|
return this.loading || this.noWatchFn || this.reloading;
|
|
3700
3712
|
},
|
|
3701
|
-
|
|
3702
|
-
return new Promise((e) => {
|
|
3703
|
-
const
|
|
3704
|
-
|
|
3713
|
+
globalBeforeFetch(t) {
|
|
3714
|
+
return new Promise((e, r) => {
|
|
3715
|
+
const i = this.options.beforeFetch && F(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3716
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : e();
|
|
3705
3717
|
});
|
|
3718
|
+
},
|
|
3719
|
+
beforeFetch(t) {
|
|
3720
|
+
return new Promise((e, r) => {
|
|
3721
|
+
const i = t && t.beforeFetch && F(() => t.beforeFetch(t, { api: this.api }));
|
|
3722
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3723
|
+
}).then(() => this.globalBeforeFetch(t));
|
|
3706
3724
|
}
|
|
3707
3725
|
});
|
|
3708
|
-
ei(
|
|
3709
|
-
ti(
|
|
3710
|
-
ii(
|
|
3711
|
-
si(
|
|
3712
|
-
ui(
|
|
3713
|
-
|
|
3714
|
-
hi(
|
|
3715
|
-
di(
|
|
3726
|
+
ei(Q);
|
|
3727
|
+
ti(Q);
|
|
3728
|
+
ii(Q);
|
|
3729
|
+
si(Q);
|
|
3730
|
+
ui(Q);
|
|
3731
|
+
fi(Q);
|
|
3732
|
+
hi(Q);
|
|
3733
|
+
di(Q);
|
|
3716
3734
|
const gi = "fcFragment", Be = {
|
|
3717
3735
|
name: gi,
|
|
3718
3736
|
functional: !0,
|
|
@@ -3735,7 +3753,7 @@ function $i() {
|
|
|
3735
3753
|
},
|
|
3736
3754
|
make(r, i, s) {
|
|
3737
3755
|
var n, o, a;
|
|
3738
|
-
return (
|
|
3756
|
+
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);
|
|
3739
3757
|
},
|
|
3740
3758
|
makeComponent(r, i, s) {
|
|
3741
3759
|
var o;
|
|
@@ -3756,7 +3774,7 @@ function $i() {
|
|
|
3756
3774
|
},
|
|
3757
3775
|
use(r) {
|
|
3758
3776
|
Object.keys(r).forEach((i) => {
|
|
3759
|
-
const s =
|
|
3777
|
+
const s = be(i), n = jt(i).toLocaleLowerCase(), o = r[i];
|
|
3760
3778
|
[i, s, n].forEach((a) => {
|
|
3761
3779
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3762
3780
|
return this.make(o, l, u);
|
|
@@ -3809,7 +3827,7 @@ _(Ut.prototype, {
|
|
|
3809
3827
|
return e(this.vm);
|
|
3810
3828
|
},
|
|
3811
3829
|
mergeOptions(t, e) {
|
|
3812
|
-
return
|
|
3830
|
+
return ee(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3813
3831
|
},
|
|
3814
3832
|
updateOptions(t) {
|
|
3815
3833
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3831,20 +3849,20 @@ const bi = function(t) {
|
|
|
3831
3849
|
const e = {
|
|
3832
3850
|
name: "loadData",
|
|
3833
3851
|
_fn: [],
|
|
3834
|
-
|
|
3852
|
+
mounted(r, i, s) {
|
|
3835
3853
|
this.deleted(r);
|
|
3836
3854
|
let n = H(r.getValue());
|
|
3837
3855
|
const o = [];
|
|
3838
3856
|
n.forEach((a) => {
|
|
3839
3857
|
if (a && (a.attr || a.template)) {
|
|
3840
3858
|
let l = (d) => {
|
|
3841
|
-
let
|
|
3842
|
-
a.template ?
|
|
3843
|
-
const
|
|
3844
|
-
a.to === "child" ?
|
|
3859
|
+
let m;
|
|
3860
|
+
a.template ? m = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? m = a.handler(d, i, s) : m = d(a.attr, a.default), a.copy !== !1 && (m = X(m));
|
|
3861
|
+
const g = a.modify ? i : r.getProp();
|
|
3862
|
+
a.to === "child" ? g.children ? E(g.children, 0, m) : E(g, "children", [m]) : oe(g, a.to || "options", m), s.sync(i);
|
|
3845
3863
|
}, u = (d) => l(d);
|
|
3846
|
-
const
|
|
3847
|
-
l =
|
|
3864
|
+
const c = t.watchLoadData(u);
|
|
3865
|
+
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(c) : c();
|
|
3848
3866
|
}
|
|
3849
3867
|
}), this._fn[r.id] = o;
|
|
3850
3868
|
},
|
|
@@ -3867,13 +3885,13 @@ const bi = function(t) {
|
|
|
3867
3885
|
const l = n[a];
|
|
3868
3886
|
if (l) {
|
|
3869
3887
|
const u = typeof l == "object";
|
|
3870
|
-
let
|
|
3871
|
-
let
|
|
3888
|
+
let c = (g) => {
|
|
3889
|
+
let $ = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
3872
3890
|
const w = u && l.modify ? i : r.getProp();
|
|
3873
|
-
a === "child" ? w.children ?
|
|
3874
|
-
}, d = (
|
|
3875
|
-
const
|
|
3876
|
-
|
|
3891
|
+
a === "child" ? w.children ? E(w.children, 0, $) : E(w, "children", [$]) : oe(w, a, $), s.sync(i);
|
|
3892
|
+
}, d = (g) => c(g);
|
|
3893
|
+
const m = t.watchLoadData(d);
|
|
3894
|
+
c = se(c, l.wait || 300), l.watch !== !1 ? o.push(m) : m();
|
|
3877
3895
|
}
|
|
3878
3896
|
}), this._fn[r.id] = o;
|
|
3879
3897
|
},
|
|
@@ -3895,7 +3913,7 @@ const bi = function(t) {
|
|
|
3895
3913
|
const s = i.method;
|
|
3896
3914
|
delete i.method, t.getProp().validate = [q(b({}, i), {
|
|
3897
3915
|
validator(...n) {
|
|
3898
|
-
const o =
|
|
3916
|
+
const o = x(e);
|
|
3899
3917
|
if (o)
|
|
3900
3918
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3901
3919
|
attr: t,
|
|
@@ -3920,13 +3938,13 @@ const bi = function(t) {
|
|
|
3920
3938
|
let a = s.value;
|
|
3921
3939
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3922
3940
|
const l = (d) => {
|
|
3923
|
-
d === void 0 ? s.clearProp() :
|
|
3941
|
+
d === void 0 ? s.clearProp() : oe(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3924
3942
|
};
|
|
3925
3943
|
if (!a || !a.action && !a.key) {
|
|
3926
3944
|
l(void 0);
|
|
3927
3945
|
return;
|
|
3928
3946
|
}
|
|
3929
|
-
if (a =
|
|
3947
|
+
if (a = X(a), a.to || (a.to = "options"), a.key) {
|
|
3930
3948
|
const d = t.$handle.options.globalData[a.key];
|
|
3931
3949
|
if (!d) {
|
|
3932
3950
|
l(void 0);
|
|
@@ -3938,36 +3956,36 @@ const bi = function(t) {
|
|
|
3938
3956
|
} else
|
|
3939
3957
|
a = b(b({}, a), d);
|
|
3940
3958
|
}
|
|
3941
|
-
const u = a.onError,
|
|
3959
|
+
const u = a.onError, c = () => {
|
|
3942
3960
|
if (!s.getValue())
|
|
3943
3961
|
return s.clearProp(), o.sync(n), !0;
|
|
3944
3962
|
};
|
|
3945
|
-
i._fn[s.id] = t.watchLoadData(
|
|
3946
|
-
if (
|
|
3963
|
+
i._fn[s.id] = t.watchLoadData(se((d, m) => {
|
|
3964
|
+
if (m && a.watch === !1)
|
|
3947
3965
|
return i._fn[s.id]();
|
|
3948
|
-
const
|
|
3966
|
+
const g = t.$handle.loadFetchVar(X(a), d, n), $ = q(b({
|
|
3949
3967
|
headers: {}
|
|
3950
|
-
},
|
|
3951
|
-
onSuccess(w,
|
|
3952
|
-
if (
|
|
3953
|
-
let
|
|
3954
|
-
const P =
|
|
3955
|
-
h.Function(P) ?
|
|
3968
|
+
}, g), {
|
|
3969
|
+
onSuccess(w, O) {
|
|
3970
|
+
if (c()) return;
|
|
3971
|
+
let G = (M) => O ? M : D(M, "data") ? M.data : M;
|
|
3972
|
+
const P = z(g.parse);
|
|
3973
|
+
h.Function(P) ? G = P : P && h.String(P) && (G = (M) => L(M, P)), l(G(w, n, o)), o.sync(n);
|
|
3956
3974
|
},
|
|
3957
3975
|
onError(w) {
|
|
3958
|
-
l(void 0), !
|
|
3976
|
+
l(void 0), !c() && (u || ((O) => xe(O.message || "fetch fail " + g.action)))(w, n, o);
|
|
3959
3977
|
}
|
|
3960
3978
|
});
|
|
3961
|
-
t.$handle.beforeFetch(
|
|
3962
|
-
if (h.Function(
|
|
3963
|
-
|
|
3964
|
-
|
|
3979
|
+
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
3980
|
+
if (h.Function(g.action)) {
|
|
3981
|
+
g.action(n, o).then((w) => {
|
|
3982
|
+
$.onSuccess(w, !0);
|
|
3965
3983
|
}).catch((w) => {
|
|
3966
|
-
|
|
3984
|
+
$.onError(w);
|
|
3967
3985
|
});
|
|
3968
3986
|
return;
|
|
3969
3987
|
}
|
|
3970
|
-
|
|
3988
|
+
F(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
3971
3989
|
});
|
|
3972
3990
|
}, a.wait || 600));
|
|
3973
3991
|
}
|
|
@@ -3991,7 +4009,7 @@ const bi = function(t) {
|
|
|
3991
4009
|
t: _i,
|
|
3992
4010
|
componentValidate: Ht
|
|
3993
4011
|
};
|
|
3994
|
-
function
|
|
4012
|
+
function Fi(t) {
|
|
3995
4013
|
t = t || /* @__PURE__ */ new Map();
|
|
3996
4014
|
const e = {
|
|
3997
4015
|
$on(r, i) {
|
|
@@ -4015,8 +4033,8 @@ function Oi(t) {
|
|
|
4015
4033
|
};
|
|
4016
4034
|
return e;
|
|
4017
4035
|
}
|
|
4018
|
-
const
|
|
4019
|
-
name:
|
|
4036
|
+
const Oi = "html", Ri = {
|
|
4037
|
+
name: Oi,
|
|
4020
4038
|
loadChildren: !1,
|
|
4021
4039
|
render(t, e) {
|
|
4022
4040
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
@@ -4068,7 +4086,7 @@ function it(t, e) {
|
|
|
4068
4086
|
return null;
|
|
4069
4087
|
const r = e.split(".");
|
|
4070
4088
|
let i = t(r.shift());
|
|
4071
|
-
return r.length ? i == null ? null :
|
|
4089
|
+
return r.length ? i == null ? null : L(i, r) : i;
|
|
4072
4090
|
}
|
|
4073
4091
|
function Di(t) {
|
|
4074
4092
|
return it(Ei, t);
|
|
@@ -4111,330 +4129,333 @@ function Gt(t) {
|
|
|
4111
4129
|
[Be.name]: Be
|
|
4112
4130
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4113
4131
|
t.extendApi
|
|
4114
|
-
], u = b({}, wi),
|
|
4132
|
+
], u = b({}, wi), c = Xr();
|
|
4115
4133
|
let d = { global: {} };
|
|
4116
|
-
const
|
|
4117
|
-
$mobile:
|
|
4118
|
-
}),
|
|
4134
|
+
const m = t.isMobile === !0, g = ne({
|
|
4135
|
+
$mobile: m
|
|
4136
|
+
}), $ = $i(), w = {}, O = {};
|
|
4119
4137
|
Ti(t.attrs || {});
|
|
4120
|
-
function
|
|
4121
|
-
const p = U[
|
|
4138
|
+
function G(f) {
|
|
4139
|
+
const p = U[f];
|
|
4122
4140
|
if (Array.isArray(p))
|
|
4123
4141
|
return p.map((y) => y.api());
|
|
4124
4142
|
if (p)
|
|
4125
4143
|
return p.api();
|
|
4126
4144
|
}
|
|
4127
|
-
function P(
|
|
4128
|
-
o.push(
|
|
4145
|
+
function P(f) {
|
|
4146
|
+
o.push(f);
|
|
4129
4147
|
}
|
|
4130
|
-
function
|
|
4131
|
-
const
|
|
4132
|
-
|
|
4148
|
+
function M() {
|
|
4149
|
+
const f = Le(...arguments);
|
|
4150
|
+
f.id && f.prop && (i[f.id] = f.prop);
|
|
4133
4151
|
}
|
|
4134
|
-
function
|
|
4135
|
-
const
|
|
4136
|
-
|
|
4137
|
-
name:
|
|
4152
|
+
function he() {
|
|
4153
|
+
const f = Le(...arguments);
|
|
4154
|
+
f.id && f.prop && (u[f.id] = h.Function(f.prop) ? f.prop : q(b({}, f.prop), {
|
|
4155
|
+
name: f.id
|
|
4138
4156
|
}));
|
|
4139
4157
|
}
|
|
4140
|
-
function
|
|
4141
|
-
|
|
4158
|
+
function Ae(f) {
|
|
4159
|
+
$.use(f);
|
|
4142
4160
|
}
|
|
4143
|
-
function
|
|
4144
|
-
const
|
|
4145
|
-
if (!
|
|
4146
|
-
const p =
|
|
4147
|
-
r[p] = Re(y,
|
|
4161
|
+
function de() {
|
|
4162
|
+
const f = Le(...arguments);
|
|
4163
|
+
if (!f.id || !f.prop) return ke;
|
|
4164
|
+
const p = J(f.id), y = f.prop, v = y.merge === !0 ? r[p] : void 0;
|
|
4165
|
+
r[p] = Re(y, v || ke), c[p] = I(p), y.maker && _(c, y.maker);
|
|
4148
4166
|
}
|
|
4149
|
-
function
|
|
4167
|
+
function R(f, p) {
|
|
4150
4168
|
let y;
|
|
4151
|
-
if (h.String(
|
|
4152
|
-
if (y =
|
|
4153
|
-
return ["form-create", "formcreate"].indexOf(y) > -1 ?
|
|
4169
|
+
if (h.String(f)) {
|
|
4170
|
+
if (y = f, p === void 0)
|
|
4171
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? S() : e[y];
|
|
4154
4172
|
} else
|
|
4155
|
-
y =
|
|
4173
|
+
y = J(f.name), p = f;
|
|
4156
4174
|
if (!y || !p) return;
|
|
4157
|
-
const
|
|
4158
|
-
e[y] = p, e[
|
|
4175
|
+
const v = J(y);
|
|
4176
|
+
e[y] = p, e[v] = p, delete $.aliasMap[y], delete $.aliasMap[v], delete r[y], delete r[v], p.formCreateParser && de(y, p.formCreateParser);
|
|
4159
4177
|
}
|
|
4160
|
-
function
|
|
4178
|
+
function S() {
|
|
4161
4179
|
return Nr(Ie, e, i);
|
|
4162
4180
|
}
|
|
4163
|
-
function
|
|
4181
|
+
function N() {
|
|
4164
4182
|
return Be;
|
|
4165
4183
|
}
|
|
4166
|
-
function
|
|
4167
|
-
return h.Function(
|
|
4184
|
+
function pe(f, p) {
|
|
4185
|
+
return h.Function(f.install) ? f.install(W, p) : h.Function(f) && f(W, p), this;
|
|
4168
4186
|
}
|
|
4169
|
-
function
|
|
4170
|
-
let
|
|
4171
|
-
const C =
|
|
4172
|
-
return C.$parent = y, Ii(C.options).appendChild(
|
|
4187
|
+
function W(f, p, y) {
|
|
4188
|
+
let v = Pi(f, p || {});
|
|
4189
|
+
const C = v.$refs.fc.formCreate;
|
|
4190
|
+
return C.$parent = y, Ii(C.options).appendChild(v.$el), C.api();
|
|
4173
4191
|
}
|
|
4174
|
-
Re(
|
|
4175
|
-
function Wt(
|
|
4192
|
+
Re(W, O);
|
|
4193
|
+
function Wt(f) {
|
|
4176
4194
|
let p = b({}, t);
|
|
4177
|
-
return
|
|
4195
|
+
return f ? p.inherit = {
|
|
4178
4196
|
components: e,
|
|
4179
4197
|
parsers: r,
|
|
4180
4198
|
directives: i,
|
|
4181
4199
|
modelFields: s,
|
|
4182
4200
|
providers: u,
|
|
4183
4201
|
useApps: o,
|
|
4184
|
-
maker:
|
|
4202
|
+
maker: c,
|
|
4185
4203
|
formulas: w,
|
|
4186
|
-
loadData:
|
|
4204
|
+
loadData: g
|
|
4187
4205
|
} : delete p.inherit, Gt(p);
|
|
4188
4206
|
}
|
|
4189
|
-
function Kt(
|
|
4190
|
-
s[
|
|
4207
|
+
function Kt(f, p) {
|
|
4208
|
+
s[f] = p;
|
|
4191
4209
|
}
|
|
4192
|
-
function Xt(
|
|
4193
|
-
w[
|
|
4210
|
+
function Xt(f, p) {
|
|
4211
|
+
w[f] = p;
|
|
4194
4212
|
}
|
|
4195
|
-
function zt(
|
|
4196
|
-
const y = n[
|
|
4213
|
+
function zt(f, p) {
|
|
4214
|
+
const y = n[f] || {}, v = y.parsers || {};
|
|
4197
4215
|
p.parsers && Object.keys(p.parsers).forEach((C) => {
|
|
4198
|
-
|
|
4199
|
-
}), p.name =
|
|
4216
|
+
v[C] = Re(p.parsers[C], ke);
|
|
4217
|
+
}), p.name = f, n[f] = q(b(b({}, y), p), { parsers: v });
|
|
4200
4218
|
}
|
|
4201
|
-
function Ce(
|
|
4202
|
-
|
|
4203
|
-
(Array.isArray(U[p]) ? U[p] : [U[p]]).forEach((
|
|
4204
|
-
|
|
4219
|
+
function Ce(f) {
|
|
4220
|
+
f && Object.keys(U).forEach((p) => {
|
|
4221
|
+
(Array.isArray(U[p]) ? U[p] : [U[p]]).forEach((v) => {
|
|
4222
|
+
v.bus.$emit("$loadData." + f);
|
|
4205
4223
|
});
|
|
4206
4224
|
});
|
|
4207
4225
|
}
|
|
4208
|
-
function Ve(
|
|
4209
|
-
|
|
4226
|
+
function Ve(f, p) {
|
|
4227
|
+
oe(g, f, p), Ce(f);
|
|
4210
4228
|
}
|
|
4211
|
-
function we(
|
|
4212
|
-
const y = (
|
|
4213
|
-
y._driver = !0, Ve(
|
|
4229
|
+
function we(f, p) {
|
|
4230
|
+
const y = (...v) => F(() => p(...v));
|
|
4231
|
+
y._driver = !0, Ve(f, y);
|
|
4214
4232
|
}
|
|
4215
|
-
function nt(
|
|
4216
|
-
const y = (
|
|
4217
|
-
|
|
4218
|
-
const
|
|
4219
|
-
if (
|
|
4220
|
-
let C =
|
|
4221
|
-
return C && C._driver ? C = C(
|
|
4233
|
+
function nt(f, p) {
|
|
4234
|
+
const y = (f || "").split(".");
|
|
4235
|
+
f = y.shift();
|
|
4236
|
+
const v = y.join(".");
|
|
4237
|
+
if (D(g, f) || E(g, f, Ee), g[f] !== Ee) {
|
|
4238
|
+
let C = g[f];
|
|
4239
|
+
return C && C._driver ? C = C(v) : y.length && (C = L(C, y)), C == null || C === "" ? p : C;
|
|
4222
4240
|
} else
|
|
4223
4241
|
return p;
|
|
4224
4242
|
}
|
|
4225
|
-
function Qt(
|
|
4226
|
-
l.push(
|
|
4243
|
+
function Qt(f) {
|
|
4244
|
+
l.push(f);
|
|
4227
4245
|
}
|
|
4228
|
-
function Zt(
|
|
4229
|
-
delete
|
|
4246
|
+
function Zt(f) {
|
|
4247
|
+
delete g[f], Ce(f);
|
|
4230
4248
|
}
|
|
4231
|
-
function Yt(
|
|
4232
|
-
a.push({ name:
|
|
4249
|
+
function Yt(f, p) {
|
|
4250
|
+
a.push({ name: f, callback: p });
|
|
4233
4251
|
}
|
|
4234
|
-
function Ie(
|
|
4252
|
+
function Ie(f) {
|
|
4235
4253
|
_(this, {
|
|
4236
4254
|
id: Bi++,
|
|
4237
|
-
create:
|
|
4238
|
-
vm:
|
|
4255
|
+
create: W,
|
|
4256
|
+
vm: f,
|
|
4239
4257
|
manager: vi(t.manager),
|
|
4240
4258
|
parsers: r,
|
|
4241
4259
|
providers: u,
|
|
4242
4260
|
modelFields: s,
|
|
4243
4261
|
formulas: w,
|
|
4244
|
-
isMobile:
|
|
4245
|
-
rules:
|
|
4246
|
-
name:
|
|
4247
|
-
inFor:
|
|
4262
|
+
isMobile: m,
|
|
4263
|
+
rules: f.$options.propsData.rule,
|
|
4264
|
+
name: f.$options.propsData.name || je(),
|
|
4265
|
+
inFor: f.$options.propsData.inFor,
|
|
4248
4266
|
prop: {
|
|
4249
4267
|
components: e,
|
|
4250
4268
|
directives: i
|
|
4251
4269
|
},
|
|
4270
|
+
get: null,
|
|
4252
4271
|
drivers: n,
|
|
4253
4272
|
renderDriver: null,
|
|
4254
4273
|
refreshData: Ce,
|
|
4255
|
-
loadData:
|
|
4256
|
-
CreateNode:
|
|
4257
|
-
bus: new
|
|
4274
|
+
loadData: g,
|
|
4275
|
+
CreateNode: $,
|
|
4276
|
+
bus: new Fi(),
|
|
4258
4277
|
unwatch: [],
|
|
4259
4278
|
options: dr({}),
|
|
4260
4279
|
extendApiFn: l,
|
|
4261
4280
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4262
|
-
tmpData:
|
|
4281
|
+
tmpData: ne({})
|
|
4263
4282
|
}), a.forEach((p) => {
|
|
4264
4283
|
this.bus.$on(p.name, p.callback);
|
|
4265
4284
|
}), T(() => {
|
|
4266
|
-
|
|
4285
|
+
B(this.options, () => {
|
|
4267
4286
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4268
4287
|
}, { deep: !0 });
|
|
4269
|
-
}), _(
|
|
4288
|
+
}), _(f.$options.components, e), _(f.$options.directives, i), this.$handle = new Q(this), this.name && (this.inFor ? (U[this.name] || (U[this.name] = []), U[this.name].push(this)) : U[this.name] = this);
|
|
4270
4289
|
}
|
|
4271
|
-
Ie.isMobile =
|
|
4290
|
+
Ie.isMobile = m, _(Ie.prototype, {
|
|
4272
4291
|
init() {
|
|
4273
|
-
this.isSub() && this.unwatch.push(
|
|
4292
|
+
this.isSub() && this.unwatch.push(B(() => this.vm.parent.fc.options.value, () => {
|
|
4274
4293
|
this.initOptions(), this.$handle.api.refresh();
|
|
4275
4294
|
}, { deep: !0 })), this.vm.$options.propsData.driver && (this.renderDriver = typeof this.vm.$options.propsData.driver == "object" ? this.vm.$options.propsData.driver : this.drivers[this.vm.$options.propsData.driver]), !this.renderDriver && this.vm.parent && (this.renderDriver = this.vm.parent.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
|
|
4276
4295
|
},
|
|
4277
|
-
targetFormDriver(
|
|
4278
|
-
if (this.renderDriver && this.renderDriver[
|
|
4279
|
-
return
|
|
4280
|
-
},
|
|
4281
|
-
t(
|
|
4282
|
-
let
|
|
4283
|
-
return
|
|
4284
|
-
const
|
|
4285
|
-
|
|
4286
|
-
}),
|
|
4287
|
-
},
|
|
4288
|
-
globalDataDriver(
|
|
4289
|
-
let p =
|
|
4290
|
-
const y = p.shift(),
|
|
4291
|
-
if (
|
|
4292
|
-
if (
|
|
4293
|
-
return
|
|
4296
|
+
targetFormDriver(f, ...p) {
|
|
4297
|
+
if (this.renderDriver && this.renderDriver[f])
|
|
4298
|
+
return F(() => this.renderDriver[f](...p));
|
|
4299
|
+
},
|
|
4300
|
+
t(f, p, y) {
|
|
4301
|
+
let v = y ? y("$t." + f) : this.globalLanguageDriver(f);
|
|
4302
|
+
return v == null && (v = ""), v && p && Object.keys(p).forEach((C) => {
|
|
4303
|
+
const j = new RegExp(`{${C}}`, "g");
|
|
4304
|
+
v = v.replace(j, p[C]);
|
|
4305
|
+
}), v;
|
|
4306
|
+
},
|
|
4307
|
+
globalDataDriver(f) {
|
|
4308
|
+
let p = f.split(".");
|
|
4309
|
+
const y = p.shift(), v = this.options.value.globalData && this.options.value.globalData[y];
|
|
4310
|
+
if (v) {
|
|
4311
|
+
if (v.type === "static")
|
|
4312
|
+
return L(v.data, p);
|
|
4294
4313
|
{
|
|
4295
4314
|
let C;
|
|
4296
|
-
const
|
|
4297
|
-
if (
|
|
4298
|
-
if (
|
|
4315
|
+
const j = this.fetchCache.get(v);
|
|
4316
|
+
if (j) {
|
|
4317
|
+
if (j.status && (C = L(j.data, p)), !j.loading)
|
|
4299
4318
|
return C;
|
|
4300
|
-
|
|
4319
|
+
j.loading = !1, this.fetchCache.set(v, j);
|
|
4301
4320
|
} else
|
|
4302
|
-
this.fetchCache.set(
|
|
4303
|
-
const
|
|
4321
|
+
this.fetchCache.set(v, { status: !1 });
|
|
4322
|
+
const k = se(() => {
|
|
4304
4323
|
le();
|
|
4305
|
-
const
|
|
4306
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(
|
|
4307
|
-
},
|
|
4308
|
-
this.fetchCache.set(
|
|
4309
|
-
},
|
|
4310
|
-
if (ue &&
|
|
4324
|
+
const K = this.fetchCache.get(v);
|
|
4325
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(v) !== -1 ? (K && (K.loading = !0, this.fetchCache.set(v, K)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(v);
|
|
4326
|
+
}, v.wait || 600), ae = (K) => {
|
|
4327
|
+
this.fetchCache.set(v, { status: !0, data: K }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4328
|
+
}, Z = (K, ue) => {
|
|
4329
|
+
if (ue && v.watch === !1)
|
|
4311
4330
|
return le();
|
|
4312
4331
|
if (ue) {
|
|
4313
|
-
|
|
4332
|
+
k();
|
|
4314
4333
|
return;
|
|
4315
4334
|
}
|
|
4316
|
-
const
|
|
4317
|
-
this.$handle.api.fetch(
|
|
4318
|
-
ae(
|
|
4319
|
-
}).catch((
|
|
4335
|
+
const me = this.$handle.loadFetchVar(Ge(v), K);
|
|
4336
|
+
this.$handle.api.fetch(me).then((re) => {
|
|
4337
|
+
ae(re);
|
|
4338
|
+
}).catch((re) => {
|
|
4320
4339
|
ae(null);
|
|
4321
4340
|
});
|
|
4322
|
-
}, le = this.watchLoadData(
|
|
4341
|
+
}, le = this.watchLoadData(Z);
|
|
4323
4342
|
return this.unwatch.push(le), C;
|
|
4324
4343
|
}
|
|
4325
4344
|
}
|
|
4326
4345
|
},
|
|
4327
4346
|
getLocale() {
|
|
4328
|
-
let
|
|
4329
|
-
return
|
|
4347
|
+
let f = this.vm.top.$props.locale;
|
|
4348
|
+
return f && typeof f == "object" ? f.name : typeof f == "string" ? f : "zh-cn";
|
|
4330
4349
|
},
|
|
4331
|
-
globalLanguageDriver(
|
|
4350
|
+
globalLanguageDriver(f) {
|
|
4332
4351
|
let p = this.vm.top.$props.locale, y;
|
|
4333
|
-
if (p && typeof p == "object" && (y =
|
|
4334
|
-
const
|
|
4335
|
-
y =
|
|
4352
|
+
if (p && typeof p == "object" && (y = L(p, f)), y == null) {
|
|
4353
|
+
const v = this.options.value.language || {}, C = this.getLocale();
|
|
4354
|
+
y = L(v[C], f);
|
|
4336
4355
|
}
|
|
4337
4356
|
return y;
|
|
4338
4357
|
},
|
|
4339
|
-
globalVarDriver(
|
|
4340
|
-
const y =
|
|
4341
|
-
if (
|
|
4342
|
-
const C = h.Function(
|
|
4358
|
+
globalVarDriver(f) {
|
|
4359
|
+
const y = f.split(".").shift(), v = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4360
|
+
if (v) {
|
|
4361
|
+
const C = h.Function(v) ? v : z(v.handle);
|
|
4343
4362
|
if (C) {
|
|
4344
|
-
let
|
|
4345
|
-
const
|
|
4346
|
-
|
|
4363
|
+
let j;
|
|
4364
|
+
const k = this.watchLoadData((ae, Z) => {
|
|
4365
|
+
Z ? (this.bus.$emit("$loadData.$var." + y), k()) : j = C(ae, this.$handle.api);
|
|
4347
4366
|
});
|
|
4348
|
-
return this.unwatch.push(
|
|
4367
|
+
return this.unwatch.push(k), j;
|
|
4349
4368
|
}
|
|
4350
4369
|
}
|
|
4351
4370
|
},
|
|
4352
|
-
setData(
|
|
4353
|
-
y ? Ve(
|
|
4371
|
+
setData(f, p, y) {
|
|
4372
|
+
y ? Ve(f, p) : (oe(this.vm.top.fc.tmpData, f, p), this.bus.$emit("$loadData." + f));
|
|
4354
4373
|
},
|
|
4355
|
-
getLoadData(
|
|
4374
|
+
getLoadData(f, p) {
|
|
4356
4375
|
let y = null;
|
|
4357
|
-
if (
|
|
4358
|
-
let
|
|
4359
|
-
const C =
|
|
4376
|
+
if (f != null) {
|
|
4377
|
+
let v = f.split(".");
|
|
4378
|
+
const C = v.shift();
|
|
4360
4379
|
if (C === "$topForm")
|
|
4361
|
-
y = this.$handle.api.top.formData();
|
|
4380
|
+
y = this.$handle.api.top.formData(!0);
|
|
4381
|
+
else if (C === "$scopeForm")
|
|
4382
|
+
y = this.$handle.api.scope.formData(!0);
|
|
4362
4383
|
else if (C === "$form")
|
|
4363
|
-
y = this.$handle.api.formData();
|
|
4384
|
+
y = this.$handle.api.formData(!0);
|
|
4364
4385
|
else if (C === "$options")
|
|
4365
4386
|
y = this.options.value;
|
|
4366
4387
|
else if (C === "$globalData")
|
|
4367
|
-
y = this.globalDataDriver(
|
|
4388
|
+
y = this.globalDataDriver(v.join(".")), v = [];
|
|
4368
4389
|
else if (C === "$var")
|
|
4369
|
-
y = this.globalVarDriver(
|
|
4390
|
+
y = this.globalVarDriver(v.join(".")), v = [];
|
|
4370
4391
|
else if (C === "$locale")
|
|
4371
|
-
y = this.getLocale(),
|
|
4392
|
+
y = this.getLocale(), v = [];
|
|
4372
4393
|
else if (C === "$t")
|
|
4373
|
-
y = this.globalLanguageDriver(
|
|
4394
|
+
y = this.globalLanguageDriver(v.join(".")), v = [];
|
|
4374
4395
|
else {
|
|
4375
4396
|
if (C === "$preview")
|
|
4376
4397
|
return this.$handle.preview;
|
|
4377
4398
|
{
|
|
4378
|
-
const
|
|
4379
|
-
|
|
4399
|
+
const j = this.vm.top.fc.tmpData;
|
|
4400
|
+
D(j, C) || E(j, C, Ee), y = j[C] !== Ee ? L(j, f) : nt(f), v = [];
|
|
4380
4401
|
}
|
|
4381
4402
|
}
|
|
4382
|
-
y &&
|
|
4403
|
+
y && v.length && (y = L(y, v));
|
|
4383
4404
|
}
|
|
4384
4405
|
return y == null || y === "" ? p : y;
|
|
4385
4406
|
},
|
|
4386
|
-
watchLoadData(
|
|
4407
|
+
watchLoadData(f, p) {
|
|
4387
4408
|
let y = {};
|
|
4388
|
-
const
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
});
|
|
4392
|
-
}, C = (
|
|
4393
|
-
let
|
|
4394
|
-
if (typeof
|
|
4395
|
-
return y[
|
|
4396
|
-
const le =
|
|
4397
|
-
const Pe =
|
|
4398
|
-
if (y[
|
|
4399
|
-
JSON.stringify(Pe) !== JSON.stringify(y[
|
|
4409
|
+
const v = (k) => {
|
|
4410
|
+
this.get || (this.get = C), F(() => {
|
|
4411
|
+
f(C, k);
|
|
4412
|
+
}), this.get === C && (this.get = void 0);
|
|
4413
|
+
}, C = (k, ae) => {
|
|
4414
|
+
let Z;
|
|
4415
|
+
if (typeof k == "object" && (Z = k.getValue, k = k.id), y[k])
|
|
4416
|
+
return y[k].val;
|
|
4417
|
+
const le = ye(() => Z ? Z() : this.getLoadData(k, ae)), K = k.split("."), ue = K.shift(), me = K.shift() || "", re = se(() => {
|
|
4418
|
+
const Pe = Z ? Z() : this.getLoadData(k, ae);
|
|
4419
|
+
if (y[k])
|
|
4420
|
+
JSON.stringify(Pe) !== JSON.stringify(y[k].val) && (y[k].val = Pe, v(!0));
|
|
4400
4421
|
else return;
|
|
4401
|
-
}, p || 0), er =
|
|
4402
|
-
|
|
4422
|
+
}, p || 0), er = B(le, (Pe) => {
|
|
4423
|
+
re();
|
|
4403
4424
|
});
|
|
4404
|
-
return this.bus.$on("$loadData." + ue,
|
|
4425
|
+
return this.bus.$on("$loadData." + ue, re), me && this.bus.$on("$loadData." + ue + "." + me, re), y[k] = {
|
|
4405
4426
|
fn: () => {
|
|
4406
|
-
this.bus.$off("$loadData." + ue,
|
|
4427
|
+
this.bus.$off("$loadData." + ue, re), me && this.bus.$off("$loadData." + ue + "." + me, re), er();
|
|
4407
4428
|
},
|
|
4408
4429
|
val: le.value
|
|
4409
4430
|
}, le.value;
|
|
4410
4431
|
};
|
|
4411
|
-
|
|
4412
|
-
const
|
|
4413
|
-
Object.keys(y).forEach((
|
|
4432
|
+
v(!1);
|
|
4433
|
+
const j = () => {
|
|
4434
|
+
Object.keys(y).forEach((k) => y[k].fn()), y = {};
|
|
4414
4435
|
};
|
|
4415
|
-
return this.unwatch.push(
|
|
4436
|
+
return this.unwatch.push(j), j;
|
|
4416
4437
|
},
|
|
4417
4438
|
isSub() {
|
|
4418
4439
|
return this.vm.parent && this.vm.extendOption;
|
|
4419
4440
|
},
|
|
4420
4441
|
initOptions() {
|
|
4421
4442
|
this.options.value = {};
|
|
4422
|
-
let
|
|
4443
|
+
let f = b({
|
|
4423
4444
|
formData: {},
|
|
4424
4445
|
submitBtn: {},
|
|
4425
4446
|
resetBtn: {},
|
|
4426
4447
|
globalEvent: {},
|
|
4427
4448
|
globalData: {}
|
|
4428
|
-
},
|
|
4429
|
-
this.isSub() && (
|
|
4449
|
+
}, X(d));
|
|
4450
|
+
this.isSub() && (f = this.mergeOptions(f, this.vm.parent.fc.options.value || {}, !0)), f = this.mergeOptions(f, this.vm.$options.propsData.option || {}), this.updateOptions(f);
|
|
4430
4451
|
},
|
|
4431
|
-
mergeOptions(
|
|
4432
|
-
return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((
|
|
4433
|
-
delete p[
|
|
4434
|
-
}), p.global && (
|
|
4452
|
+
mergeOptions(f, p, y) {
|
|
4453
|
+
return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((v) => {
|
|
4454
|
+
delete p[v];
|
|
4455
|
+
}), p.global && (f.global = Gr(f.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], f), f;
|
|
4435
4456
|
},
|
|
4436
|
-
updateOptions(
|
|
4437
|
-
this.options.value = this.mergeOptions(this.options.value,
|
|
4457
|
+
updateOptions(f) {
|
|
4458
|
+
this.options.value = this.mergeOptions(this.options.value, f), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
4438
4459
|
},
|
|
4439
4460
|
api() {
|
|
4440
4461
|
return this.$handle.api;
|
|
@@ -4448,86 +4469,86 @@ function Gt(t) {
|
|
|
4448
4469
|
unmount() {
|
|
4449
4470
|
if (this.name)
|
|
4450
4471
|
if (this.inFor) {
|
|
4451
|
-
const
|
|
4452
|
-
U[this.name].splice(
|
|
4472
|
+
const f = U[this.name].indexOf(this);
|
|
4473
|
+
U[this.name].splice(f, 1);
|
|
4453
4474
|
} else
|
|
4454
4475
|
delete U[this.name];
|
|
4455
|
-
a.forEach((
|
|
4456
|
-
this.bus.$off(
|
|
4457
|
-
}), this.tmpData = {}, this.unwatch.forEach((
|
|
4476
|
+
a.forEach((f) => {
|
|
4477
|
+
this.bus.$off(f.name, f.callback);
|
|
4478
|
+
}), this.tmpData = {}, this.unwatch.forEach((f) => f()), this.unwatch = [], this.$handle.reloadRule([]);
|
|
4458
4479
|
},
|
|
4459
4480
|
updated() {
|
|
4460
4481
|
this.$handle.bindNextTick(() => this.bus.$emit("next-tick", this.$handle.api));
|
|
4461
4482
|
}
|
|
4462
4483
|
});
|
|
4463
|
-
function st(
|
|
4464
|
-
_(
|
|
4484
|
+
function st(f) {
|
|
4485
|
+
_(f, {
|
|
4465
4486
|
version: t.version,
|
|
4466
4487
|
ui: t.ui,
|
|
4467
|
-
isMobile:
|
|
4488
|
+
isMobile: m,
|
|
4468
4489
|
extendApi: Qt,
|
|
4469
4490
|
getData: nt,
|
|
4470
4491
|
setDataDriver: we,
|
|
4471
4492
|
setData: Ve,
|
|
4472
4493
|
removeData: Zt,
|
|
4473
4494
|
refreshData: Ce,
|
|
4474
|
-
maker:
|
|
4475
|
-
component:
|
|
4476
|
-
directive:
|
|
4495
|
+
maker: c,
|
|
4496
|
+
component: R,
|
|
4497
|
+
directive: M,
|
|
4477
4498
|
setModelField: Kt,
|
|
4478
4499
|
setFormula: Xt,
|
|
4479
4500
|
setDriver: zt,
|
|
4480
|
-
register:
|
|
4481
|
-
$vnode:
|
|
4482
|
-
parser:
|
|
4483
|
-
use:
|
|
4501
|
+
register: he,
|
|
4502
|
+
$vnode: N,
|
|
4503
|
+
parser: de,
|
|
4504
|
+
use: pe,
|
|
4484
4505
|
factory: Wt,
|
|
4485
|
-
componentAlias:
|
|
4506
|
+
componentAlias: Ae,
|
|
4486
4507
|
copyRule: Vt,
|
|
4487
4508
|
copyRules: It,
|
|
4488
|
-
mergeRule:
|
|
4509
|
+
mergeRule: te,
|
|
4489
4510
|
fetch: Mt,
|
|
4490
|
-
$form:
|
|
4491
|
-
parseFn:
|
|
4511
|
+
$form: S,
|
|
4512
|
+
parseFn: z,
|
|
4492
4513
|
parseJson: At,
|
|
4493
4514
|
toJson: et,
|
|
4494
4515
|
useApp: P,
|
|
4495
|
-
getApi:
|
|
4516
|
+
getApi: G,
|
|
4496
4517
|
on: Yt
|
|
4497
4518
|
});
|
|
4498
4519
|
}
|
|
4499
|
-
function xt(
|
|
4500
|
-
_(
|
|
4501
|
-
create:
|
|
4520
|
+
function xt(f) {
|
|
4521
|
+
_(f, {
|
|
4522
|
+
create: W,
|
|
4502
4523
|
install(p, y) {
|
|
4503
4524
|
if (d = b(b({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4504
4525
|
p._installedFormCreate = !0;
|
|
4505
|
-
const
|
|
4506
|
-
return
|
|
4526
|
+
const v = function(j, k = {}) {
|
|
4527
|
+
return W(j, k, this);
|
|
4507
4528
|
};
|
|
4508
|
-
st(
|
|
4509
|
-
const C =
|
|
4510
|
-
p.component(C.name, C), p.component("FcFragment",
|
|
4511
|
-
|
|
4529
|
+
st(v), p.prototype.$formCreate = v;
|
|
4530
|
+
const C = S();
|
|
4531
|
+
p.component(C.name, C), p.component("FcFragment", N()), o.forEach((j) => {
|
|
4532
|
+
F(() => j(f, p));
|
|
4512
4533
|
});
|
|
4513
4534
|
}
|
|
4514
4535
|
});
|
|
4515
4536
|
}
|
|
4516
|
-
if (st(
|
|
4517
|
-
const
|
|
4518
|
-
|
|
4537
|
+
if (st(O), xt(O), we("$cookie", Di), we("$localStorage", ji), we("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install && W.use(t), de(Ri), t.inherit) {
|
|
4538
|
+
const f = t.inherit;
|
|
4539
|
+
f.components && _(e, f.components), f.parsers && _(r, f.parsers), f.directives && _(i, f.directives), f.modelFields && _(s, f.modelFields), f.providers && _(u, f.providers), f.useApps && _(o, f.useApps), f.maker && _(c, f.maker), f.loadData && _(g, f.loadData), f.formulas && _(w, f.formulas);
|
|
4519
4540
|
}
|
|
4520
|
-
const
|
|
4521
|
-
return Re(
|
|
4541
|
+
const Fe = S();
|
|
4542
|
+
return Re(Fe, O), Object.defineProperties(Fe, {
|
|
4522
4543
|
fetch: {
|
|
4523
4544
|
get() {
|
|
4524
|
-
return
|
|
4545
|
+
return O.fetch;
|
|
4525
4546
|
},
|
|
4526
|
-
set(
|
|
4527
|
-
|
|
4547
|
+
set(f) {
|
|
4548
|
+
O.fetch = f;
|
|
4528
4549
|
}
|
|
4529
4550
|
}
|
|
4530
|
-
}),
|
|
4551
|
+
}), Fe.util = O, Fe;
|
|
4531
4552
|
}
|
|
4532
4553
|
const bt = {
|
|
4533
4554
|
date: "yyyy-MM-dd",
|
|
@@ -4675,13 +4696,13 @@ function zi(t) {
|
|
|
4675
4696
|
return t.type === "tooltip";
|
|
4676
4697
|
}
|
|
4677
4698
|
function wt(t, e) {
|
|
4678
|
-
|
|
4699
|
+
D(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4679
4700
|
}
|
|
4680
|
-
function
|
|
4701
|
+
function Y(t) {
|
|
4681
4702
|
return t === !1;
|
|
4682
4703
|
}
|
|
4683
4704
|
function Qi(t, e) {
|
|
4684
|
-
|
|
4705
|
+
D(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4685
4706
|
}
|
|
4686
4707
|
function Ue(t) {
|
|
4687
4708
|
const e = b({}, t);
|
|
@@ -4724,7 +4745,7 @@ const Zi = {
|
|
|
4724
4745
|
wrap: {}
|
|
4725
4746
|
};
|
|
4726
4747
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4727
|
-
t.prop[r] =
|
|
4748
|
+
t.prop[r] = ee([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4728
4749
|
});
|
|
4729
4750
|
},
|
|
4730
4751
|
getDefaultOptions() {
|
|
@@ -4751,12 +4772,12 @@ const Zi = {
|
|
|
4751
4772
|
});
|
|
4752
4773
|
},
|
|
4753
4774
|
render(t) {
|
|
4754
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4775
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Y(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4755
4776
|
},
|
|
4756
4777
|
makeWrap(t, e) {
|
|
4757
4778
|
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;
|
|
4758
4779
|
delete r.wrap.title;
|
|
4759
|
-
const u =
|
|
4780
|
+
const u = Y(r.wrap.show) ? e : this.$r(ee([r.wrap, {
|
|
4760
4781
|
props: q(b({
|
|
4761
4782
|
labelWidth: o === void 0 ? o : jt(o),
|
|
4762
4783
|
label: n ? r.title.title : void 0
|
|
@@ -4769,30 +4790,30 @@ const Zi = {
|
|
|
4769
4790
|
ref: t.wrapRef,
|
|
4770
4791
|
type: "formItem"
|
|
4771
4792
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4772
|
-
return a === !0 ||
|
|
4793
|
+
return a === !0 || Y(l) || Y(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4773
4794
|
},
|
|
4774
4795
|
isTitle(t) {
|
|
4775
4796
|
if (this.options.form.title === !1) return !1;
|
|
4776
4797
|
const e = t.title;
|
|
4777
|
-
return !(!e.title && !e.native ||
|
|
4798
|
+
return !(!e.title && !e.native || Y(e.show));
|
|
4778
4799
|
},
|
|
4779
4800
|
makeInfo(t, e, r) {
|
|
4780
|
-
var
|
|
4801
|
+
var c, d, m, g, $, w;
|
|
4781
4802
|
const i = b({}, t.title), s = b({}, t.info), n = zi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
4782
|
-
title: (
|
|
4803
|
+
title: (d = (c = r.refRule) == null ? void 0 : c.__$title) == null ? void 0 : d.value,
|
|
4783
4804
|
rule: r.rule,
|
|
4784
4805
|
options: this.options
|
|
4785
|
-
}) : ((
|
|
4786
|
-
if (!
|
|
4787
|
-
const
|
|
4806
|
+
}) : ((g = (m = r.refRule) == null ? void 0 : m.__$title) == null ? void 0 : g.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
4807
|
+
if (!Y(s.show) && (s.info || s.native) && !Y(s.icon)) {
|
|
4808
|
+
const O = {
|
|
4788
4809
|
type: s.type || "popover",
|
|
4789
4810
|
slot: "label",
|
|
4790
4811
|
props: Ue(s),
|
|
4791
4812
|
key: `${e}pop`
|
|
4792
4813
|
};
|
|
4793
|
-
delete
|
|
4794
|
-
const
|
|
4795
|
-
s.info && !
|
|
4814
|
+
delete O.props.icon, delete O.props.show, delete O.props.info, delete O.props.align, delete O.props.native;
|
|
4815
|
+
const G = "content";
|
|
4816
|
+
s.info && !D(O.props, G) && (O.props[G] = (w = ($ = r.refRule) == null ? void 0 : $.__$info) == null ? void 0 : w.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(ee([s, O]), [
|
|
4796
4817
|
this.$r({
|
|
4797
4818
|
type: "i",
|
|
4798
4819
|
slot: n ? "default" : "reference",
|
|
@@ -4801,7 +4822,7 @@ const Zi = {
|
|
|
4801
4822
|
})
|
|
4802
4823
|
]));
|
|
4803
4824
|
}
|
|
4804
|
-
const u =
|
|
4825
|
+
const u = ee([i, {
|
|
4805
4826
|
props: Ue(i),
|
|
4806
4827
|
key: `${e}tit`,
|
|
4807
4828
|
class: "fc-form-title",
|
|
@@ -4830,7 +4851,7 @@ const Zi = {
|
|
|
4830
4851
|
},
|
|
4831
4852
|
makeFormBtn() {
|
|
4832
4853
|
let t = [];
|
|
4833
|
-
if (
|
|
4854
|
+
if (Y(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Y(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4834
4855
|
return;
|
|
4835
4856
|
const e = this.$r({
|
|
4836
4857
|
type: "formItem",
|
|
@@ -4877,12 +4898,12 @@ const Zi = {
|
|
|
4877
4898
|
key: `${this.key}b1`
|
|
4878
4899
|
}, [e]);
|
|
4879
4900
|
}
|
|
4880
|
-
},
|
|
4881
|
-
Yi(
|
|
4882
|
-
xi(
|
|
4883
|
-
en(
|
|
4884
|
-
tn(
|
|
4885
|
-
rn(
|
|
4901
|
+
}, fe = {};
|
|
4902
|
+
Yi(fe);
|
|
4903
|
+
xi(fe);
|
|
4904
|
+
en(fe);
|
|
4905
|
+
tn(fe);
|
|
4906
|
+
rn(fe);
|
|
4886
4907
|
function Yi(t) {
|
|
4887
4908
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4888
4909
|
t[e] = I(e);
|
|
@@ -4916,7 +4937,7 @@ function rn(t) {
|
|
|
4916
4937
|
};
|
|
4917
4938
|
return Object.keys(e).reduce((r, i) => (r[i] = I("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;
|
|
4918
4939
|
}
|
|
4919
|
-
function
|
|
4940
|
+
function Ft(t, e) {
|
|
4920
4941
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4921
4942
|
}
|
|
4922
4943
|
function nn(t, e) {
|
|
@@ -4995,20 +5016,20 @@ function nn(t, e) {
|
|
|
4995
5016
|
}
|
|
4996
5017
|
},
|
|
4997
5018
|
submitBtnProps: (r = {}) => {
|
|
4998
|
-
let i =
|
|
5019
|
+
let i = Ft(e.options.submitBtn, !0);
|
|
4999
5020
|
_(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
5000
5021
|
},
|
|
5001
5022
|
resetBtnProps: (r = {}) => {
|
|
5002
|
-
let i =
|
|
5023
|
+
let i = Ft(e.options.resetBtn, !1);
|
|
5003
5024
|
_(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
5004
5025
|
},
|
|
5005
5026
|
submit(r, i) {
|
|
5006
5027
|
return new Promise((s, n) => {
|
|
5007
5028
|
t.validate().then(() => {
|
|
5008
5029
|
let o = t.formData();
|
|
5009
|
-
h.Function(r) &&
|
|
5030
|
+
h.Function(r) && F(() => r(o, t)), h.Function(e.options.onSubmit) && F(() => e.options.onSubmit(o, t)), e.vm.$emit("submit", o, t), s(o);
|
|
5010
5031
|
}).catch((...o) => {
|
|
5011
|
-
h.Function(i) &&
|
|
5032
|
+
h.Function(i) && F(() => i(t, ...o)), n(...o);
|
|
5012
5033
|
});
|
|
5013
5034
|
});
|
|
5014
5035
|
}
|
|
@@ -5017,23 +5038,24 @@ function nn(t, e) {
|
|
|
5017
5038
|
const Jt = {
|
|
5018
5039
|
name: "required",
|
|
5019
5040
|
load(t, e, r) {
|
|
5041
|
+
var s, n;
|
|
5020
5042
|
const i = sn(t.getValue());
|
|
5021
5043
|
if (i.required === !1)
|
|
5022
5044
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5023
5045
|
else {
|
|
5024
|
-
const
|
|
5046
|
+
const o = b({
|
|
5025
5047
|
required: !0,
|
|
5026
|
-
validator(
|
|
5027
|
-
h.empty(
|
|
5048
|
+
validator(l, u, c) {
|
|
5049
|
+
h.empty(u) ? c(o.message) : c();
|
|
5028
5050
|
}
|
|
5029
|
-
}, i), n = e.__fc__.refRule.__$title.value;
|
|
5030
|
-
if (!
|
|
5031
|
-
|
|
5051
|
+
}, i), a = (n = (s = e.__fc__.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value;
|
|
5052
|
+
if (!o.message)
|
|
5053
|
+
o.message = r.t("required", { title: a }) || a + (r.getLocale() === "en" ? " is required" : "不能为空");
|
|
5032
5054
|
else {
|
|
5033
|
-
const
|
|
5034
|
-
|
|
5055
|
+
const l = o.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5056
|
+
l && (o.message = r.t(l[1], { title: a }));
|
|
5035
5057
|
}
|
|
5036
|
-
t.getProp().validate = [
|
|
5058
|
+
t.getProp().validate = [o];
|
|
5037
5059
|
}
|
|
5038
5060
|
r.sync(e);
|
|
5039
5061
|
},
|
|
@@ -5049,14 +5071,14 @@ function on(t) {
|
|
|
5049
5071
|
t.component(e.name, e);
|
|
5050
5072
|
}), t.register(Jt), Wi.forEach((e) => {
|
|
5051
5073
|
t.parser(e);
|
|
5052
|
-
}), Object.keys(
|
|
5053
|
-
t.maker[e] =
|
|
5074
|
+
}), Object.keys(fe).forEach((e) => {
|
|
5075
|
+
t.maker[e] = fe[e];
|
|
5054
5076
|
});
|
|
5055
5077
|
}
|
|
5056
5078
|
function an() {
|
|
5057
5079
|
return Gt({
|
|
5058
5080
|
ui: "element-ui",
|
|
5059
|
-
version: "2.7.
|
|
5081
|
+
version: "2.7.4",
|
|
5060
5082
|
manager: Zi,
|
|
5061
5083
|
extendApi: nn,
|
|
5062
5084
|
install: on,
|
|
@@ -5069,8 +5091,8 @@ function an() {
|
|
|
5069
5091
|
}
|
|
5070
5092
|
const ze = an();
|
|
5071
5093
|
typeof window != "undefined" && (window.formCreate = ze, window.Vue && ze.install(window.Vue));
|
|
5072
|
-
const
|
|
5094
|
+
const cn = ze.maker;
|
|
5073
5095
|
export {
|
|
5074
5096
|
ze as default,
|
|
5075
|
-
|
|
5097
|
+
cn as maker
|
|
5076
5098
|
};
|