@form-create/view-design 2.7.5 → 2.7.6
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 +711 -525
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +4 -4
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/view-design v2.7.
|
|
3
|
+
* @form-create/view-design v2.7.6
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -11,7 +11,7 @@ var ir = Object.defineProperty, nr = Object.defineProperties;
|
|
|
11
11
|
var sr = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var ot = Object.getOwnPropertySymbols;
|
|
13
13
|
var or = Object.prototype.hasOwnProperty, ar = Object.prototype.propertyIsEnumerable;
|
|
14
|
-
var at = (t, e, r) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r,
|
|
14
|
+
var at = (t, e, r) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, v = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
16
|
or.call(e, r) && at(t, r, e[r]);
|
|
17
17
|
if (ot)
|
|
@@ -19,24 +19,24 @@ var at = (t, e, r) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
19
19
|
ar.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
21
|
}, U = (t, e) => nr(t, sr(e));
|
|
22
|
-
import ye, { getCurrentInstance as lr, provide as ur, inject as fr, toRefs as lt, reactive as ie, onBeforeMount as cr, watch as
|
|
22
|
+
import ye, { getCurrentInstance as lr, provide as ur, inject as fr, toRefs as lt, reactive as ie, onBeforeMount as cr, watch as B, onMounted as hr, onBeforeUnmount as dr, onUpdated as pr, nextTick as A, markRaw as me, computed as ge, toRef as De, ref as mr } from "vue";
|
|
23
23
|
function gr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function ze() {
|
|
27
|
+
return ze = Object.assign ? Object.assign.bind() : function(t) {
|
|
28
28
|
for (var e, r = 1; r < arguments.length; r++) for (var i in e = arguments[r], e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
|
|
29
29
|
return t;
|
|
30
|
-
},
|
|
30
|
+
}, ze.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var yr = ["attrs", "props", "domProps"], $r = ["class", "style", "directives"],
|
|
32
|
+
var yr = ["attrs", "props", "domProps"], $r = ["class", "style", "directives"], br = ["on", "nativeOn"], vr = function(t) {
|
|
33
33
|
return t.reduce(function(e, r) {
|
|
34
34
|
for (var i in r) if (!e[i]) e[i] = r[i];
|
|
35
|
-
else if (yr.indexOf(i) !== -1) e[i] =
|
|
35
|
+
else if (yr.indexOf(i) !== -1) e[i] = ze({}, e[i], r[i]);
|
|
36
36
|
else if ($r.indexOf(i) !== -1) {
|
|
37
37
|
var s = e[i] instanceof Array ? e[i] : [e[i]], n = r[i] instanceof Array ? r[i] : [r[i]];
|
|
38
38
|
e[i] = [].concat(s, n);
|
|
39
|
-
} else if (
|
|
39
|
+
} else if (br.indexOf(i) !== -1)
|
|
40
40
|
for (var o in r[i]) if (e[i][o]) {
|
|
41
41
|
var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], l = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, l);
|
|
@@ -49,7 +49,7 @@ var yr = ["attrs", "props", "domProps"], $r = ["class", "style", "directives"],
|
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
}, Cr =
|
|
52
|
+
}, Cr = vr;
|
|
53
53
|
const I = /* @__PURE__ */ gr(Cr);
|
|
54
54
|
function Ie(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
@@ -111,7 +111,7 @@ const wr = "fcCheckbox", Or = {
|
|
|
111
111
|
input: this.onInput
|
|
112
112
|
}
|
|
113
113
|
}]), [this.options().map((e, r) => {
|
|
114
|
-
const i =
|
|
114
|
+
const i = v({}, e);
|
|
115
115
|
return delete i.value, t("Checkbox", I([{}, {
|
|
116
116
|
props: i
|
|
117
117
|
}, {
|
|
@@ -469,7 +469,7 @@ function Ot(t) {
|
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
471
|
})]), e("Modal", I([{}, {
|
|
472
|
-
props:
|
|
472
|
+
props: v({
|
|
473
473
|
width: s,
|
|
474
474
|
title: a
|
|
475
475
|
}, this.modal)
|
|
@@ -511,7 +511,7 @@ Ft.v2 = Ot({
|
|
|
511
511
|
fileIcon: "document-text",
|
|
512
512
|
fileUpIcon: "folder"
|
|
513
513
|
});
|
|
514
|
-
const Sr = "fcRadio",
|
|
514
|
+
const Sr = "fcRadio", kr = {
|
|
515
515
|
name: Sr,
|
|
516
516
|
props: {
|
|
517
517
|
formCreateInject: {
|
|
@@ -563,7 +563,7 @@ const Sr = "fcRadio", Rr = {
|
|
|
563
563
|
input: this.onInput
|
|
564
564
|
}
|
|
565
565
|
}]), [this.options().map((e, r) => {
|
|
566
|
-
const i =
|
|
566
|
+
const i = v({}, e);
|
|
567
567
|
return delete i.value, t("Radio", I([{}, {
|
|
568
568
|
props: i
|
|
569
569
|
}, {
|
|
@@ -607,8 +607,8 @@ const Sr = "fcRadio", Rr = {
|
|
|
607
607
|
function E(t, e) {
|
|
608
608
|
return {}.hasOwnProperty.call(t, e);
|
|
609
609
|
}
|
|
610
|
-
const
|
|
611
|
-
name:
|
|
610
|
+
const Rr = "fcSelect", Er = {
|
|
611
|
+
name: Rr,
|
|
612
612
|
functional: !0,
|
|
613
613
|
props: {
|
|
614
614
|
formCreateInject: {
|
|
@@ -702,7 +702,7 @@ function ut(t) {
|
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
704
|
function ft(t) {
|
|
705
|
-
return U(
|
|
705
|
+
return U(v({}, t), {
|
|
706
706
|
file: t,
|
|
707
707
|
value: t
|
|
708
708
|
});
|
|
@@ -907,11 +907,11 @@ function St(t) {
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
|
-
const
|
|
910
|
+
const kt = St({
|
|
911
911
|
fileIcon: "md-document",
|
|
912
912
|
imgUpIcon: "md-images"
|
|
913
913
|
});
|
|
914
|
-
|
|
914
|
+
kt.v2 = St({
|
|
915
915
|
fileIcon: "document-text",
|
|
916
916
|
imgUpIcon: "image"
|
|
917
917
|
});
|
|
@@ -957,10 +957,10 @@ const Vr = Object.assign || function(t) {
|
|
|
957
957
|
function C() {
|
|
958
958
|
return Vr.apply(this, arguments);
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] :
|
|
960
|
+
function Je(t) {
|
|
961
|
+
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : v({}, t);
|
|
962
962
|
}
|
|
963
|
-
const Pr = "fcGroup",
|
|
963
|
+
const Pr = "fcGroup", Lr = {
|
|
964
964
|
name: Pr,
|
|
965
965
|
props: {
|
|
966
966
|
field: String,
|
|
@@ -1095,7 +1095,7 @@ const Pr = "fcGroup", Br = {
|
|
|
1095
1095
|
if (i.filter((n) => r[n].$f).length !== i.length)
|
|
1096
1096
|
return;
|
|
1097
1097
|
const s = i.map((n) => {
|
|
1098
|
-
const o = t === n ? e :
|
|
1098
|
+
const o = t === n ? e : v({}, this.cacheRule[n].$f.form), a = this.field ? o[this.field] || null : o;
|
|
1099
1099
|
return this.cache(n, a), a;
|
|
1100
1100
|
});
|
|
1101
1101
|
this.input(s);
|
|
@@ -1107,7 +1107,7 @@ const Pr = "fcGroup", Br = {
|
|
|
1107
1107
|
}), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cache(t, e), i && i.coverValue(e || {}));
|
|
1108
1108
|
},
|
|
1109
1109
|
addRule(t, e) {
|
|
1110
|
-
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ?
|
|
1110
|
+
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? v({}, this.options) : {
|
|
1111
1111
|
submitBtn: !1,
|
|
1112
1112
|
resetBtn: !1
|
|
1113
1113
|
};
|
|
@@ -1239,9 +1239,9 @@ const Pr = "fcGroup", Br = {
|
|
|
1239
1239
|
key: o
|
|
1240
1240
|
}, {
|
|
1241
1241
|
on: {
|
|
1242
|
-
"update:value": (
|
|
1243
|
-
"emit-event": (
|
|
1244
|
-
input: (
|
|
1242
|
+
"update:value": (d) => this.formData(o, d),
|
|
1243
|
+
"emit-event": (d, ...g) => this.emitEvent(d, g, a, o),
|
|
1244
|
+
input: (d) => this.add$f(a, o, d)
|
|
1245
1245
|
}
|
|
1246
1246
|
}, {}, {
|
|
1247
1247
|
props: {
|
|
@@ -1265,8 +1265,8 @@ const Pr = "fcGroup", Br = {
|
|
|
1265
1265
|
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1266
1266
|
}, [n]);
|
|
1267
1267
|
}
|
|
1268
|
-
},
|
|
1269
|
-
name:
|
|
1268
|
+
}, Br = "fcSubForm", Tr = {
|
|
1269
|
+
name: Br,
|
|
1270
1270
|
props: {
|
|
1271
1271
|
rule: Array,
|
|
1272
1272
|
options: Object,
|
|
@@ -1312,7 +1312,7 @@ const Pr = "fcGroup", Br = {
|
|
|
1312
1312
|
submitBtn: !1,
|
|
1313
1313
|
resetBtn: !1
|
|
1314
1314
|
};
|
|
1315
|
-
t.formData =
|
|
1315
|
+
t.formData = v({}, this.value || {}), this.cacheRule = {
|
|
1316
1316
|
rule: this.rule,
|
|
1317
1317
|
options: t
|
|
1318
1318
|
};
|
|
@@ -1351,13 +1351,13 @@ const Pr = "fcGroup", Br = {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
}, Nr = [
|
|
1353
1353
|
Or,
|
|
1354
|
-
|
|
1354
|
+
kr,
|
|
1355
1355
|
Er,
|
|
1356
1356
|
jr,
|
|
1357
1357
|
Tr,
|
|
1358
1358
|
Ft,
|
|
1359
|
-
|
|
1360
|
-
|
|
1359
|
+
kt,
|
|
1360
|
+
Lr
|
|
1361
1361
|
];
|
|
1362
1362
|
function ne(t, e) {
|
|
1363
1363
|
var r = null;
|
|
@@ -1365,27 +1365,27 @@ function ne(t, e) {
|
|
|
1365
1365
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1368
|
+
function be(t) {
|
|
1369
1369
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1370
1370
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1371
1371
|
}
|
|
1372
|
-
const
|
|
1373
|
-
const i = [...
|
|
1372
|
+
const Rt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"], x = (t, e = {}, r = {}) => {
|
|
1373
|
+
const i = [...Rt, ...r.normal || []], s = [...Et, ...r.array || []], n = [...Dt, ...r.functional || []], o = r.props || [];
|
|
1374
1374
|
return t.reduce((a, l) => {
|
|
1375
1375
|
for (const u in l)
|
|
1376
1376
|
if (a[u])
|
|
1377
1377
|
if (o.indexOf(u) > -1)
|
|
1378
|
-
a[u] =
|
|
1378
|
+
a[u] = x([l[u]], a[u]);
|
|
1379
1379
|
else if (i.indexOf(u) > -1)
|
|
1380
|
-
a[u] =
|
|
1380
|
+
a[u] = v(v({}, a[u]), l[u]);
|
|
1381
1381
|
else if (s.indexOf(u) > -1) {
|
|
1382
|
-
const f = a[u] instanceof Array ? a[u] : [a[u]],
|
|
1383
|
-
a[u] = [...f, ...
|
|
1382
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1383
|
+
a[u] = [...f, ...d];
|
|
1384
1384
|
} else if (n.indexOf(u) > -1)
|
|
1385
1385
|
for (const f in l[u])
|
|
1386
1386
|
if (a[u][f]) {
|
|
1387
|
-
const
|
|
1388
|
-
a[u][f] = [...
|
|
1387
|
+
const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], g = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1388
|
+
a[u][f] = [...d, ...g];
|
|
1389
1389
|
} else
|
|
1390
1390
|
a[u][f] = l[u][f];
|
|
1391
1391
|
else if (u === "hook")
|
|
@@ -1394,14 +1394,14 @@ const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style"
|
|
|
1394
1394
|
else
|
|
1395
1395
|
a[u] = l[u];
|
|
1396
1396
|
else
|
|
1397
|
-
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] =
|
|
1397
|
+
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = v({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? v({}, l[u]) : l[u] : a[u] = l[u];
|
|
1398
1398
|
return a;
|
|
1399
1399
|
}, e);
|
|
1400
1400
|
}, Mr = (t, e) => function() {
|
|
1401
1401
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1402
|
-
}, jt = ["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"],
|
|
1402
|
+
}, jt = ["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"], xe = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1403
1403
|
function It() {
|
|
1404
|
-
return [...jt, ...
|
|
1404
|
+
return [...jt, ...Rt, ...Et, ...Dt, ...xe, ...Ye];
|
|
1405
1405
|
}
|
|
1406
1406
|
function At(t, e, r) {
|
|
1407
1407
|
return `[form-create ${t}]: ${e}`;
|
|
@@ -1415,8 +1415,8 @@ function Ur(t) {
|
|
|
1415
1415
|
function qr(t) {
|
|
1416
1416
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
1417
1417
|
}
|
|
1418
|
-
const
|
|
1419
|
-
function
|
|
1418
|
+
const We = "[[FORM-CREATE-PREFIX-", Ke = "-FORM-CREATE-SUFFIX]]";
|
|
1419
|
+
function ve(t, e) {
|
|
1420
1420
|
return JSON.stringify(_e(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1421
1421
|
if (!(i && i._isVue === !0)) {
|
|
1422
1422
|
if (typeof i != "function")
|
|
@@ -1424,19 +1424,19 @@ function be(t, e) {
|
|
|
1424
1424
|
if (i.__json)
|
|
1425
1425
|
return i.__json;
|
|
1426
1426
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1427
|
-
return
|
|
1427
|
+
return We + i + Ke;
|
|
1428
1428
|
}
|
|
1429
1429
|
}, e);
|
|
1430
1430
|
}
|
|
1431
1431
|
function Te(t) {
|
|
1432
1432
|
return new Function("return " + t)();
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function W(t, e) {
|
|
1435
1435
|
if (t && h.String(t) && t.length > 4) {
|
|
1436
1436
|
let r = t.trim(), i = !1;
|
|
1437
1437
|
try {
|
|
1438
|
-
if (r.indexOf(Ke) > 0 && r.indexOf(
|
|
1439
|
-
r = r.replace(Ke, "").replace(
|
|
1438
|
+
if (r.indexOf(Ke) > 0 && r.indexOf(We) === 0)
|
|
1439
|
+
r = r.replace(Ke, "").replace(We, ""), i = !0;
|
|
1440
1440
|
else if (r.indexOf("$FN:") === 0)
|
|
1441
1441
|
r = r.substring(4), i = !0;
|
|
1442
1442
|
else if (r.indexOf("$EXEC:") === 0)
|
|
@@ -1472,7 +1472,7 @@ err: ${s}`);
|
|
|
1472
1472
|
}
|
|
1473
1473
|
function Vt(t, e) {
|
|
1474
1474
|
return JSON.parse(t, function(r, i) {
|
|
1475
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1475
|
+
return h.Undef(i) || !i.indexOf ? i : W(i, e);
|
|
1476
1476
|
});
|
|
1477
1477
|
}
|
|
1478
1478
|
let Gr = 0;
|
|
@@ -1495,13 +1495,13 @@ function Xe(t, e) {
|
|
|
1495
1495
|
};
|
|
1496
1496
|
}
|
|
1497
1497
|
function Pt(t, e) {
|
|
1498
|
-
return
|
|
1498
|
+
return Lt([t], e || !1)[0];
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function Lt(t, e) {
|
|
1501
1501
|
return _e([], [...t], e || !1);
|
|
1502
1502
|
}
|
|
1503
|
-
function
|
|
1504
|
-
return
|
|
1503
|
+
function Y(t, e) {
|
|
1504
|
+
return x(Array.isArray(e) ? e : [e], t, { array: xe, normal: Ye }), t;
|
|
1505
1505
|
}
|
|
1506
1506
|
function ct(t) {
|
|
1507
1507
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
@@ -1509,17 +1509,17 @@ function ct(t) {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
function Hr(t, e) {
|
|
1511
1511
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1512
|
-
e[r] && (t[r] =
|
|
1512
|
+
e[r] && (t[r] = Y(t[r] || {}, e[r]));
|
|
1513
1513
|
}), t) : e;
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1515
|
+
function Bt(t, e) {
|
|
1516
1516
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1517
1517
|
get() {
|
|
1518
1518
|
return e[i]();
|
|
1519
1519
|
}
|
|
1520
1520
|
}, r), {}));
|
|
1521
1521
|
}
|
|
1522
|
-
function
|
|
1522
|
+
function Q(t) {
|
|
1523
1523
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1524
1524
|
}
|
|
1525
1525
|
function O(t, e) {
|
|
@@ -1530,22 +1530,22 @@ function O(t, e) {
|
|
|
1530
1530
|
}
|
|
1531
1531
|
return e;
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1533
|
+
function Ze(t, e) {
|
|
1534
1534
|
let r = null;
|
|
1535
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) =>
|
|
1535
|
+
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Ze(i, e)) : r = t, r && e && H(r).forEach((i) => {
|
|
1536
1536
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1537
1537
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
1538
1538
|
});
|
|
1539
1539
|
}), r;
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1541
|
+
function zr(t, e) {
|
|
1542
1542
|
if (h.Object(t)) {
|
|
1543
1543
|
const r = {};
|
|
1544
1544
|
return Object.keys(t).forEach((i) => {
|
|
1545
|
-
r[i] =
|
|
1545
|
+
r[i] = Ze(t[i], i);
|
|
1546
1546
|
}), r;
|
|
1547
1547
|
} else
|
|
1548
|
-
return
|
|
1548
|
+
return Ze(t, e);
|
|
1549
1549
|
}
|
|
1550
1550
|
function Fe() {
|
|
1551
1551
|
const t = {}, e = (r) => r || "default";
|
|
@@ -1563,7 +1563,7 @@ function Fe() {
|
|
|
1563
1563
|
const n = s();
|
|
1564
1564
|
Array.isArray(n) ? i.push(...n) : i.push(n);
|
|
1565
1565
|
} else h.Undef(s) || i.push(s);
|
|
1566
|
-
}),
|
|
1566
|
+
}), zr(i, r);
|
|
1567
1567
|
},
|
|
1568
1568
|
getSlots() {
|
|
1569
1569
|
let r = [];
|
|
@@ -1621,12 +1621,12 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1621
1621
|
return new RegExp(e, "g").test(t);
|
|
1622
1622
|
}
|
|
1623
1623
|
};
|
|
1624
|
-
function
|
|
1624
|
+
function L(t, e) {
|
|
1625
1625
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1626
1626
|
t != null && (t = t[r]);
|
|
1627
1627
|
}), t;
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1629
|
+
function Jr(t) {
|
|
1630
1630
|
const e = /{{\s*(.*?)\s*}}/g;
|
|
1631
1631
|
let r;
|
|
1632
1632
|
const i = {};
|
|
@@ -1640,15 +1640,15 @@ function dt(t) {
|
|
|
1640
1640
|
n === 0 ? i = s : i += "." + s, r.push(i);
|
|
1641
1641
|
}), r.join(" && ");
|
|
1642
1642
|
}
|
|
1643
|
-
const
|
|
1643
|
+
const Re = (t, e) => {
|
|
1644
1644
|
if (!(!t || t === e || !t.$props)) {
|
|
1645
1645
|
if (t.$props.formCreateInject)
|
|
1646
1646
|
return t.$props.formCreateInject;
|
|
1647
1647
|
if (t.$parent)
|
|
1648
|
-
return
|
|
1648
|
+
return Re(t.$parent, e);
|
|
1649
1649
|
}
|
|
1650
1650
|
};
|
|
1651
|
-
function
|
|
1651
|
+
function Wr(t, e, r) {
|
|
1652
1652
|
const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
|
|
1653
1653
|
return {
|
|
1654
1654
|
name: i,
|
|
@@ -1708,92 +1708,92 @@ function zr(t, e, r) {
|
|
|
1708
1708
|
a = a.parent;
|
|
1709
1709
|
else
|
|
1710
1710
|
a = n;
|
|
1711
|
-
const { rule: l, value: u, subForm: f, inFor:
|
|
1711
|
+
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), g = ie({
|
|
1712
1712
|
ctxInject: {},
|
|
1713
1713
|
destroyed: !1,
|
|
1714
1714
|
isShow: !0,
|
|
1715
1715
|
unique: 1,
|
|
1716
1716
|
renderRule: [...l.value || []],
|
|
1717
1717
|
updateValue: JSON.stringify(u.value || {})
|
|
1718
|
-
}),
|
|
1718
|
+
}), m = new t(n), $ = m.api(), _ = d.value, D = () => {
|
|
1719
1719
|
if (o) {
|
|
1720
|
-
const F =
|
|
1720
|
+
const F = Re(n, o);
|
|
1721
1721
|
if (F) {
|
|
1722
|
-
let
|
|
1723
|
-
_ ? (
|
|
1722
|
+
let k;
|
|
1723
|
+
_ ? (k = H(F.getSubForm()), k.push($)) : k = $, F.subForm(k);
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
1726
|
}, ee = () => {
|
|
1727
|
-
const F =
|
|
1727
|
+
const F = Re(n, o);
|
|
1728
1728
|
if (F)
|
|
1729
1729
|
if (_) {
|
|
1730
|
-
const
|
|
1731
|
-
N > -1 &&
|
|
1730
|
+
const k = H(F.getSubForm()), N = k.indexOf($);
|
|
1731
|
+
N > -1 && k.splice(N, 1);
|
|
1732
1732
|
} else
|
|
1733
1733
|
F.subForm();
|
|
1734
1734
|
};
|
|
1735
1735
|
let P = null;
|
|
1736
1736
|
cr(() => {
|
|
1737
|
-
|
|
1737
|
+
B(() => {
|
|
1738
1738
|
let F = "";
|
|
1739
|
-
const
|
|
1740
|
-
Object.keys(
|
|
1739
|
+
const k = s.option && s.option.globalClass || {};
|
|
1740
|
+
Object.keys(k).forEach((N) => {
|
|
1741
1741
|
let de = "";
|
|
1742
|
-
|
|
1743
|
-
de +=
|
|
1744
|
-
}),
|
|
1742
|
+
k[N].style && Object.keys(k[N].style).forEach((z) => {
|
|
1743
|
+
de += be(z) + ":" + k[N].style[z] + ";";
|
|
1744
|
+
}), k[N].content && (de += k[N].content + ";"), de && (F += `.${N}{${de}}`);
|
|
1745
1745
|
}), s.option && s.option.style && (F += s.option.style), P || (P = document.createElement("style"), P.type = "text/css", document.head.appendChild(P)), P.innerHTML = F || "";
|
|
1746
1746
|
}, () => {
|
|
1747
1747
|
});
|
|
1748
1748
|
});
|
|
1749
1749
|
const T = ne(() => {
|
|
1750
|
-
|
|
1750
|
+
m.bus.$emit("$loadData.$topForm");
|
|
1751
1751
|
}, 100), ce = ne(function() {
|
|
1752
|
-
|
|
1752
|
+
m.bus.$emit("$loadData.$scopeForm");
|
|
1753
1753
|
}, 100), Ve = ne(() => {
|
|
1754
|
-
|
|
1754
|
+
m.bus.$emit("$loadData.$form");
|
|
1755
1755
|
}, 100), he = (F) => {
|
|
1756
|
-
|
|
1756
|
+
m.bus.$emit("change-$form." + F);
|
|
1757
1757
|
};
|
|
1758
1758
|
return hr(() => {
|
|
1759
|
-
o && ($.top.bus.$on("$loadData.$form", T), $.top.bus.$on("change", he)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", ce),
|
|
1759
|
+
o && ($.top.bus.$on("$loadData.$form", T), $.top.bus.$on("change", he)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", ce), m.mounted();
|
|
1760
1760
|
}), dr(() => {
|
|
1761
|
-
o && ($.top.bus.$off("$loadData.$form", T), $.top.bus.$off("change", he)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", ce), P && document.head.removeChild(P), ee(),
|
|
1761
|
+
o && ($.top.bus.$off("$loadData.$form", T), $.top.bus.$off("change", he)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", ce), P && document.head.removeChild(P), ee(), g.destroyed = !0, m.unmount();
|
|
1762
1762
|
}), pr(() => {
|
|
1763
|
-
|
|
1764
|
-
}),
|
|
1763
|
+
m.updated();
|
|
1764
|
+
}), B(f, (F) => {
|
|
1765
1765
|
F ? D() : ee();
|
|
1766
|
-
}, { immediate: !0 }),
|
|
1767
|
-
|
|
1768
|
-
}, { deep: !0 }),
|
|
1769
|
-
|
|
1770
|
-
}),
|
|
1766
|
+
}, { immediate: !0 }), B(() => s.option, () => {
|
|
1767
|
+
m.initOptions(), $.refresh();
|
|
1768
|
+
}, { deep: !0 }), B(() => [...l.value], (F) => {
|
|
1769
|
+
m.$handle.isBreakWatch() || F.length === g.renderRule.length && F.every((k) => g.renderRule.indexOf(k) > -1) || (m.$handle.updateAppendData(), m.$handle.reloadRule(l.value), n.renderRule());
|
|
1770
|
+
}), B(() => [s.disabled, s.preview], () => {
|
|
1771
1771
|
$.refresh();
|
|
1772
|
-
}),
|
|
1773
|
-
|
|
1774
|
-
}, { deep: !0, flush: "post" }),
|
|
1775
|
-
$.coverValue({}),
|
|
1772
|
+
}), B(u, (F) => {
|
|
1773
|
+
ve(F || {}) !== g.updateValue && ($.config.forceCoverValue ? $.coverValue(F || {}) : $.setValue(F || {}));
|
|
1774
|
+
}, { deep: !0, flush: "post" }), B(() => s.index, () => {
|
|
1775
|
+
$.coverValue({}), m.$handle.updateAppendData(), A(() => {
|
|
1776
1776
|
A(() => {
|
|
1777
1777
|
$.clearValidateState();
|
|
1778
1778
|
});
|
|
1779
1779
|
});
|
|
1780
|
-
}, { flush: "sync" }), U(
|
|
1781
|
-
fc: me(
|
|
1780
|
+
}, { flush: "sync" }), U(v({
|
|
1781
|
+
fc: me(m),
|
|
1782
1782
|
parent: o && me(o),
|
|
1783
1783
|
top: me(a),
|
|
1784
1784
|
fapi: me($)
|
|
1785
|
-
}, lt(
|
|
1786
|
-
getGroupInject: () =>
|
|
1785
|
+
}, lt(g)), {
|
|
1786
|
+
getGroupInject: () => Re(n, o),
|
|
1787
1787
|
refresh() {
|
|
1788
|
-
++
|
|
1788
|
+
++g.unique;
|
|
1789
1789
|
},
|
|
1790
1790
|
renderRule() {
|
|
1791
|
-
|
|
1791
|
+
g.renderRule = [...l.value || []];
|
|
1792
1792
|
},
|
|
1793
1793
|
updateValue(F) {
|
|
1794
|
-
if (
|
|
1795
|
-
const
|
|
1796
|
-
|
|
1794
|
+
if (g.destroyed) return;
|
|
1795
|
+
const k = ve(F);
|
|
1796
|
+
g.updateValue !== k && (g.updateValue = k, n.$emit("update:value", F), A(() => {
|
|
1797
1797
|
Ve(), o ? f.value || ce() : (T(), ce());
|
|
1798
1798
|
}));
|
|
1799
1799
|
}
|
|
@@ -1840,7 +1840,7 @@ C(tt.prototype, {
|
|
|
1840
1840
|
function Nt(t) {
|
|
1841
1841
|
t.forEach((e) => {
|
|
1842
1842
|
tt.prototype[e] = function(r) {
|
|
1843
|
-
return
|
|
1843
|
+
return Y(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1844
1844
|
};
|
|
1845
1845
|
});
|
|
1846
1846
|
}
|
|
@@ -1862,7 +1862,7 @@ function Xr() {
|
|
|
1862
1862
|
factory: V
|
|
1863
1863
|
};
|
|
1864
1864
|
}
|
|
1865
|
-
function
|
|
1865
|
+
function Zr(t, e, r) {
|
|
1866
1866
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1867
1867
|
return s.status = r.status, s.url = t, s;
|
|
1868
1868
|
}
|
|
@@ -1891,7 +1891,7 @@ function Ut(t) {
|
|
|
1891
1891
|
t.onError(o);
|
|
1892
1892
|
}, e.onload = function() {
|
|
1893
1893
|
if (e.status < 200 || e.status >= 300)
|
|
1894
|
-
return t.onError(
|
|
1894
|
+
return t.onError(Zr(r, t, e), mt(e));
|
|
1895
1895
|
t.onSuccess(mt(e));
|
|
1896
1896
|
}, e.open(t.method || "get", r, !0);
|
|
1897
1897
|
let i;
|
|
@@ -1905,11 +1905,11 @@ function Ut(t) {
|
|
|
1905
1905
|
}
|
|
1906
1906
|
function gt(t, e, r) {
|
|
1907
1907
|
return new Promise((i, s) => {
|
|
1908
|
-
(e || Ut)(U(
|
|
1908
|
+
(e || Ut)(U(v({}, t), {
|
|
1909
1909
|
onSuccess(n) {
|
|
1910
1910
|
let o = (l) => l;
|
|
1911
|
-
const a =
|
|
1912
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1911
|
+
const a = W(t.parse);
|
|
1912
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n, void 0, r));
|
|
1913
1913
|
},
|
|
1914
1914
|
onError(n) {
|
|
1915
1915
|
s(n);
|
|
@@ -1920,12 +1920,12 @@ function gt(t, e, r) {
|
|
|
1920
1920
|
function $e(t) {
|
|
1921
1921
|
return G(t);
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1923
|
+
function Qr(t) {
|
|
1924
1924
|
function e(n) {
|
|
1925
1925
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1926
1926
|
}
|
|
1927
1927
|
function r(n, o, a) {
|
|
1928
|
-
h.Undef(n) ? n = Object.keys(
|
|
1928
|
+
h.Undef(n) ? n = Object.keys(v(v({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
|
|
1929
1929
|
const u = t.fieldCtx[l] || t.nameCtx[l];
|
|
1930
1930
|
u && u.forEach((f) => {
|
|
1931
1931
|
S(f.rule, o, a), t.$render.clearCache(f);
|
|
@@ -1997,6 +1997,9 @@ function Zr(t) {
|
|
|
1997
1997
|
return o > -1 ? o : void 0;
|
|
1998
1998
|
}
|
|
1999
1999
|
},
|
|
2000
|
+
get formulas() {
|
|
2001
|
+
return v({}, t.fc.formulas);
|
|
2002
|
+
},
|
|
2000
2003
|
formData(n) {
|
|
2001
2004
|
if (n == null || typeof n == "boolean") {
|
|
2002
2005
|
const o = {};
|
|
@@ -2011,7 +2014,7 @@ function Zr(t) {
|
|
|
2011
2014
|
return o ? $e(o.rule.value) : t.options.appendValue !== !1 && E(t.appendData, n) ? $e(t.appendData[n]) : void 0;
|
|
2012
2015
|
},
|
|
2013
2016
|
coverValue(n) {
|
|
2014
|
-
const o =
|
|
2017
|
+
const o = v({}, n || {});
|
|
2015
2018
|
t.deferSyncValue(() => {
|
|
2016
2019
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
2017
2020
|
const l = t.fieldCtx[a];
|
|
@@ -2045,7 +2048,7 @@ function Zr(t) {
|
|
|
2045
2048
|
}, !0), o ? o.origin : void 0;
|
|
2046
2049
|
},
|
|
2047
2050
|
removeRule(n) {
|
|
2048
|
-
const o = n &&
|
|
2051
|
+
const o = n && Q(n);
|
|
2049
2052
|
if (o)
|
|
2050
2053
|
return o.rm(), o.origin;
|
|
2051
2054
|
},
|
|
@@ -2134,7 +2137,7 @@ function Zr(t) {
|
|
|
2134
2137
|
n.forEach((a) => s.sync(a));
|
|
2135
2138
|
return;
|
|
2136
2139
|
}
|
|
2137
|
-
let o = h.Object(n) ?
|
|
2140
|
+
let o = h.Object(n) ? Q(n) : t.getCtxs(n);
|
|
2138
2141
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2139
2142
|
if (!a.deleted) {
|
|
2140
2143
|
const l = t.subForm[a.id];
|
|
@@ -2171,7 +2174,7 @@ function Zr(t) {
|
|
|
2171
2174
|
},
|
|
2172
2175
|
mergeRule: (n, o) => {
|
|
2173
2176
|
t.getCtxs(n).forEach((a) => {
|
|
2174
|
-
|
|
2177
|
+
Y(a.rule, o);
|
|
2175
2178
|
});
|
|
2176
2179
|
},
|
|
2177
2180
|
mergeRules(n) {
|
|
@@ -2238,7 +2241,7 @@ function Zr(t) {
|
|
|
2238
2241
|
return O(() => s.method(n, o)(...a));
|
|
2239
2242
|
},
|
|
2240
2243
|
toJson(n) {
|
|
2241
|
-
return
|
|
2244
|
+
return ve(s.rule, n);
|
|
2242
2245
|
},
|
|
2243
2246
|
trigger(n, o, ...a) {
|
|
2244
2247
|
const l = s.el(n);
|
|
@@ -2257,29 +2260,29 @@ function Zr(t) {
|
|
|
2257
2260
|
return o ? t.subForm[o.id] : void 0;
|
|
2258
2261
|
},
|
|
2259
2262
|
getChildrenRuleList(n) {
|
|
2260
|
-
const o = typeof n == "object", a = o ?
|
|
2263
|
+
const o = typeof n == "object", a = o ? Q(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2261
2264
|
if (!l)
|
|
2262
2265
|
return [];
|
|
2263
2266
|
const u = [];
|
|
2264
|
-
return ((
|
|
2265
|
-
|
|
2266
|
-
typeof
|
|
2267
|
+
return ((d) => {
|
|
2268
|
+
d && d.forEach((g) => {
|
|
2269
|
+
typeof g == "object" && (g.field && u.push(g), u.push(...s.getChildrenRuleList(g)));
|
|
2267
2270
|
});
|
|
2268
2271
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2269
2272
|
},
|
|
2270
2273
|
getParentRule(n) {
|
|
2271
|
-
return (typeof n == "object" ?
|
|
2274
|
+
return (typeof n == "object" ? Q(n) : t.getCtx(n)).parent.rule;
|
|
2272
2275
|
},
|
|
2273
2276
|
getParentSubRule(n) {
|
|
2274
|
-
const a = typeof n == "object" ?
|
|
2277
|
+
const a = typeof n == "object" ? Q(n) : t.getCtx(n);
|
|
2275
2278
|
if (a) {
|
|
2276
2279
|
const l = a.getParentGroup();
|
|
2277
2280
|
if (l)
|
|
2278
2281
|
return l.rule;
|
|
2279
2282
|
}
|
|
2280
2283
|
},
|
|
2281
|
-
getChildrenFormData(n) {
|
|
2282
|
-
return s.getChildrenRuleList(n).reduce((
|
|
2284
|
+
getChildrenFormData(n, o) {
|
|
2285
|
+
return s.getChildrenRuleList(n).reduce((l, u) => ((u.ignore !== !0 || o === !0) && (l[u.field] = $e(u.value)), l), {});
|
|
2283
2286
|
},
|
|
2284
2287
|
setChildrenFormData(n, o, a) {
|
|
2285
2288
|
const l = s.getChildrenRuleList(n);
|
|
@@ -2292,7 +2295,7 @@ function Zr(t) {
|
|
|
2292
2295
|
getGlobalEvent(n) {
|
|
2293
2296
|
let o = s.options.globalEvent[n];
|
|
2294
2297
|
if (o)
|
|
2295
|
-
return typeof o == "object" && (o = o.handle),
|
|
2298
|
+
return typeof o == "object" && (o = o.handle), W(o);
|
|
2296
2299
|
},
|
|
2297
2300
|
getGlobalData(n) {
|
|
2298
2301
|
return new Promise((o, a) => {
|
|
@@ -2303,11 +2306,11 @@ function Zr(t) {
|
|
|
2303
2306
|
});
|
|
2304
2307
|
},
|
|
2305
2308
|
renderRule(n, o, a) {
|
|
2306
|
-
const u = typeof n == "object" ?
|
|
2309
|
+
const u = typeof n == "object" ? Q(n) : t.getCtx(n);
|
|
2307
2310
|
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2308
2311
|
},
|
|
2309
2312
|
renderChildren(n, o, a) {
|
|
2310
|
-
const u = typeof n == "object" ?
|
|
2313
|
+
const u = typeof n == "object" ? Q(n) : t.getCtx(n);
|
|
2311
2314
|
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2312
2315
|
},
|
|
2313
2316
|
nextTick(n) {
|
|
@@ -2329,17 +2332,19 @@ function Zr(t) {
|
|
|
2329
2332
|
O(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2330
2333
|
}).catch((l) => {
|
|
2331
2334
|
O(() => n.onError && n.onError(l)), a(l);
|
|
2332
|
-
}))
|
|
2335
|
+
})).catch((l) => {
|
|
2336
|
+
});
|
|
2333
2337
|
});
|
|
2334
2338
|
},
|
|
2335
2339
|
watchFetch(n, o, a, l) {
|
|
2336
2340
|
return t.fc.watchLoadData((u, f) => {
|
|
2337
|
-
let
|
|
2338
|
-
|
|
2339
|
-
O(() =>
|
|
2340
|
-
}).catch((
|
|
2341
|
-
O(() =>
|
|
2342
|
-
}))
|
|
2341
|
+
let d = G(n);
|
|
2342
|
+
d = t.loadFetchVar(d, u), !(l && l(d, f) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((g) => {
|
|
2343
|
+
O(() => d.onSuccess && d.onSuccess(g)), o && o(g, f);
|
|
2344
|
+
}).catch((g) => {
|
|
2345
|
+
O(() => d.onError && d.onError(g)), a && a(g);
|
|
2346
|
+
})).catch((g) => {
|
|
2347
|
+
});
|
|
2343
2348
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2344
2349
|
},
|
|
2345
2350
|
getData(n, o) {
|
|
@@ -2368,7 +2373,7 @@ function Zr(t) {
|
|
|
2368
2373
|
};
|
|
2369
2374
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2370
2375
|
}
|
|
2371
|
-
function
|
|
2376
|
+
function xr(t) {
|
|
2372
2377
|
C(t.prototype, {
|
|
2373
2378
|
initCache() {
|
|
2374
2379
|
this.clearCacheAll();
|
|
@@ -2409,7 +2414,7 @@ function q(t) {
|
|
|
2409
2414
|
function qt(t) {
|
|
2410
2415
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2411
2416
|
}
|
|
2412
|
-
function
|
|
2417
|
+
function Yr(t) {
|
|
2413
2418
|
C(t.prototype, {
|
|
2414
2419
|
initRender() {
|
|
2415
2420
|
this.cacheConfig = {};
|
|
@@ -2418,7 +2423,7 @@ function xr(t) {
|
|
|
2418
2423
|
const r = (i) => {
|
|
2419
2424
|
if (i) {
|
|
2420
2425
|
let s;
|
|
2421
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2426
|
+
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);
|
|
2422
2427
|
}
|
|
2423
2428
|
};
|
|
2424
2429
|
return r(this.vm);
|
|
@@ -2440,8 +2445,8 @@ function xr(t) {
|
|
|
2440
2445
|
mergeGlobal(e) {
|
|
2441
2446
|
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = ge(() => {
|
|
2442
2447
|
const i = this.$handle.options.global;
|
|
2443
|
-
return
|
|
2444
|
-
})), e.prop =
|
|
2448
|
+
return Y({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2449
|
+
})), e.prop = Y({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2445
2450
|
},
|
|
2446
2451
|
setOptions(e) {
|
|
2447
2452
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
@@ -2454,7 +2459,7 @@ function xr(t) {
|
|
|
2454
2459
|
});
|
|
2455
2460
|
},
|
|
2456
2461
|
parseSide(e, r) {
|
|
2457
|
-
return h.Object(e) ?
|
|
2462
|
+
return h.Object(e) ? Y({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2458
2463
|
},
|
|
2459
2464
|
renderSides(e, r, i) {
|
|
2460
2465
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2490,8 +2495,8 @@ function xr(t) {
|
|
|
2490
2495
|
};
|
|
2491
2496
|
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2492
2497
|
let f = [];
|
|
2493
|
-
const
|
|
2494
|
-
e.parser.renderChildren ? f = e.parser.renderChildren(
|
|
2498
|
+
const d = e.loadChildrenPending();
|
|
2499
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
|
|
2495
2500
|
f.push(this.renderRule({
|
|
2496
2501
|
type: "template",
|
|
2497
2502
|
slot: $
|
|
@@ -2502,9 +2507,9 @@ function xr(t) {
|
|
|
2502
2507
|
return this.renderRule(_);
|
|
2503
2508
|
})()));
|
|
2504
2509
|
});
|
|
2505
|
-
const
|
|
2506
|
-
let
|
|
2507
|
-
return
|
|
2510
|
+
const g = this.getTypeSlot(e);
|
|
2511
|
+
let m;
|
|
2512
|
+
return g ? (u.children = f, m = g(u)) : m = a ? e.parser.preview(Je(f), e) : e.parser.render(Je(f), e), m = this.renderSides(m, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), m = this.$manager.makeWrap(e, m)), e.none && (Array.isArray(m) ? m = m.map(($) => !$ || !$.tag ? $ : this.none($)) : m = this.none(m)), o && this.setCache(e, () => this.stable(m), r), m;
|
|
2508
2513
|
}, this.setCache(e, s, r);
|
|
2509
2514
|
}
|
|
2510
2515
|
return (...s) => {
|
|
@@ -2571,8 +2576,8 @@ function xr(t) {
|
|
|
2571
2576
|
preview: e.prop.preview,
|
|
2572
2577
|
options: e.prop.options,
|
|
2573
2578
|
prop: function() {
|
|
2574
|
-
const s =
|
|
2575
|
-
return s.on = s.on ?
|
|
2579
|
+
const s = v({}, e.prop);
|
|
2580
|
+
return s.on = s.on ? v({}, s.on) : {}, delete s.model, s;
|
|
2576
2581
|
}(),
|
|
2577
2582
|
children: e.loadChildrenPending()
|
|
2578
2583
|
}), i;
|
|
@@ -2580,7 +2585,7 @@ function xr(t) {
|
|
|
2580
2585
|
ctxProp(e) {
|
|
2581
2586
|
const { ref: r, key: i, rule: s } = e;
|
|
2582
2587
|
this.$manager.mergeProp(e), e.parser.mergeProp(e);
|
|
2583
|
-
const n =
|
|
2588
|
+
const n = v({}, e.prop.on || {}), o = {};
|
|
2584
2589
|
Object.keys(n).forEach((l) => {
|
|
2585
2590
|
l.indexOf("native.") === 0 && (o[l.replace("native.", "")] = n[l], delete n[l]);
|
|
2586
2591
|
}), e.prop.on = n;
|
|
@@ -2619,7 +2624,7 @@ function xr(t) {
|
|
|
2619
2624
|
}
|
|
2620
2625
|
});
|
|
2621
2626
|
}
|
|
2622
|
-
return
|
|
2627
|
+
return x(a, e.prop), e.prop;
|
|
2623
2628
|
},
|
|
2624
2629
|
onMounted(e) {
|
|
2625
2630
|
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");
|
|
@@ -2681,7 +2686,7 @@ function xr(t) {
|
|
|
2681
2686
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2682
2687
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2683
2688
|
});
|
|
2684
|
-
const o =
|
|
2689
|
+
const o = v({}, e);
|
|
2685
2690
|
return delete o.type, delete o.is, this.vNode.make(s, o, n.mergeBag(r).getSlots());
|
|
2686
2691
|
}
|
|
2687
2692
|
});
|
|
@@ -2697,7 +2702,7 @@ function rt(t) {
|
|
|
2697
2702
|
force: !1,
|
|
2698
2703
|
tmpInput: null,
|
|
2699
2704
|
id: ei++
|
|
2700
|
-
}),
|
|
2705
|
+
}), Bt(this, {
|
|
2701
2706
|
options() {
|
|
2702
2707
|
return t.options;
|
|
2703
2708
|
},
|
|
@@ -2706,8 +2711,8 @@ function rt(t) {
|
|
|
2706
2711
|
}
|
|
2707
2712
|
}), this.initCache(), this.initRender();
|
|
2708
2713
|
}
|
|
2709
|
-
Yr(rt);
|
|
2710
2714
|
xr(rt);
|
|
2715
|
+
Yr(rt);
|
|
2711
2716
|
function ti(t) {
|
|
2712
2717
|
C(t.prototype, {
|
|
2713
2718
|
parseInjectEvent(e, r) {
|
|
@@ -2726,7 +2731,7 @@ function ti(t) {
|
|
|
2726
2731
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2727
2732
|
return this.parseEventLst(e, r, i, !0);
|
|
2728
2733
|
if (h.String(r)) {
|
|
2729
|
-
const n =
|
|
2734
|
+
const n = W(r);
|
|
2730
2735
|
if (n && r !== n)
|
|
2731
2736
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2732
2737
|
}
|
|
@@ -2735,16 +2740,16 @@ function ti(t) {
|
|
|
2735
2740
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2736
2741
|
return h.trueArray(u) && u.forEach((f) => {
|
|
2737
2742
|
if (!f) return;
|
|
2738
|
-
let
|
|
2739
|
-
if (h.Object(f) && (
|
|
2740
|
-
r || (
|
|
2741
|
-
const
|
|
2742
|
-
this.vm.$emit(
|
|
2743
|
+
let d, g = n || o || a;
|
|
2744
|
+
if (h.Object(f) && (d = f.inject, f = f.name, g = f.prefix || g), g) {
|
|
2745
|
+
r || (g = `native-${g}`);
|
|
2746
|
+
const m = be(`${g}-${f}`), $ = (..._) => {
|
|
2747
|
+
this.vm.$emit(m, ..._), this.vm.$emit("emit-event", m, ..._), this.bus.$emit(m, ..._);
|
|
2743
2748
|
};
|
|
2744
|
-
if ($.__emit = !0, !
|
|
2749
|
+
if ($.__emit = !0, !d && l === !1)
|
|
2745
2750
|
i[f] = $;
|
|
2746
2751
|
else {
|
|
2747
|
-
let _ =
|
|
2752
|
+
let _ = d || l || this.options.injectEvent;
|
|
2748
2753
|
i[f] = h.Undef(_) ? $ : this.inject(s, $, _);
|
|
2749
2754
|
}
|
|
2750
2755
|
}
|
|
@@ -2775,21 +2780,21 @@ function ti(t) {
|
|
|
2775
2780
|
},
|
|
2776
2781
|
loadStrVar(e, r, i) {
|
|
2777
2782
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2778
|
-
const s = e, n =
|
|
2783
|
+
const s = e, n = Jr(e);
|
|
2779
2784
|
let o;
|
|
2780
2785
|
if (n.forEach((a) => {
|
|
2781
2786
|
const l = a.split("||"), u = l[0].trim();
|
|
2782
2787
|
if (u) {
|
|
2783
2788
|
const f = (l[1] || "").trim();
|
|
2784
|
-
let
|
|
2789
|
+
let d, g = !1;
|
|
2785
2790
|
if (i && u.indexOf("$form.") === 0) {
|
|
2786
|
-
const
|
|
2787
|
-
|
|
2788
|
-
id: "$form." +
|
|
2789
|
-
getValue: () =>
|
|
2790
|
-
}) :
|
|
2791
|
+
const m = u.split(".");
|
|
2792
|
+
m.shift(), E(i.value, m[0]) && (g = !0, d = r ? r({
|
|
2793
|
+
id: "$form." + m[0] + "_" + i.rule.__fc__.id,
|
|
2794
|
+
getValue: () => L(i.value, m)
|
|
2795
|
+
}) : L(i.value, m));
|
|
2791
2796
|
}
|
|
2792
|
-
|
|
2797
|
+
g || (d = r ? r(u, f) : this.fc.getLoadData(u, f)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2793
2798
|
}
|
|
2794
2799
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2795
2800
|
return o;
|
|
@@ -2876,7 +2881,7 @@ function Gt(t, e, r) {
|
|
|
2876
2881
|
parent: null,
|
|
2877
2882
|
group: e.subRule ? this : null,
|
|
2878
2883
|
cacheConfig: null,
|
|
2879
|
-
prop:
|
|
2884
|
+
prop: v({}, e),
|
|
2880
2885
|
computed: {},
|
|
2881
2886
|
payload: {},
|
|
2882
2887
|
refRule: {},
|
|
@@ -2924,8 +2929,8 @@ C(Gt.prototype, {
|
|
|
2924
2929
|
rule: this.rule,
|
|
2925
2930
|
api: this.$api,
|
|
2926
2931
|
update: (u) => {
|
|
2927
|
-
const f = u || i,
|
|
2928
|
-
this.setPending(e, r, f), o && o(f,
|
|
2932
|
+
const f = u || i, d = this.getPending(e, i);
|
|
2933
|
+
this.setPending(e, r, f), o && o(f, d);
|
|
2929
2934
|
},
|
|
2930
2935
|
reload: () => {
|
|
2931
2936
|
const u = this.getPending(e, i);
|
|
@@ -2967,8 +2972,8 @@ C(Gt.prototype, {
|
|
|
2967
2972
|
},
|
|
2968
2973
|
initProp() {
|
|
2969
2974
|
var e, r;
|
|
2970
|
-
const t =
|
|
2971
|
-
delete t.children, delete t.validate, this.prop =
|
|
2975
|
+
const t = v({}, this.rule);
|
|
2976
|
+
delete t.children, delete t.validate, this.prop = Y({}, [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 || []];
|
|
2972
2977
|
},
|
|
2973
2978
|
initNone() {
|
|
2974
2979
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -3048,7 +3053,7 @@ function oi(t) {
|
|
|
3048
3053
|
__origin__: Xe(e, !0)
|
|
3049
3054
|
}), ai(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
3050
3055
|
i && this.loadFn(i, r);
|
|
3051
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
3056
|
+
}), this.loadCtrl(r), r.update && (r.update = W(r.update)), r;
|
|
3052
3057
|
},
|
|
3053
3058
|
loadFn(e, r) {
|
|
3054
3059
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -3057,12 +3062,12 @@ function oi(t) {
|
|
|
3057
3062
|
},
|
|
3058
3063
|
loadCtrl(e) {
|
|
3059
3064
|
e.control && e.control.forEach((r) => {
|
|
3060
|
-
r.handle && (r.handle =
|
|
3065
|
+
r.handle && (r.handle = W(r.handle));
|
|
3061
3066
|
});
|
|
3062
3067
|
},
|
|
3063
3068
|
syncProp(e) {
|
|
3064
3069
|
const r = e.rule;
|
|
3065
|
-
h.trueArray(r.sync) &&
|
|
3070
|
+
h.trueArray(r.sync) && x([{
|
|
3066
3071
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
3067
3072
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3068
3073
|
}, i), {})
|
|
@@ -3096,25 +3101,25 @@ function oi(t) {
|
|
|
3096
3101
|
let l = ct(o);
|
|
3097
3102
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3098
3103
|
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);
|
|
3099
|
-
let f,
|
|
3100
|
-
if (
|
|
3101
|
-
if (f = o.__fc__,
|
|
3104
|
+
let f, d = !1, g = !!o.__fc__, m = l.value;
|
|
3105
|
+
if (g) {
|
|
3106
|
+
if (f = o.__fc__, m = f.defaultValue, f.deleted) {
|
|
3102
3107
|
if ($t(f))
|
|
3103
3108
|
return;
|
|
3104
3109
|
f.update(this);
|
|
3105
3110
|
} else if (!f.check(this)) {
|
|
3106
3111
|
if ($t(f))
|
|
3107
3112
|
return;
|
|
3108
|
-
e[a] = o = o._clone ? o._clone() : Vt(
|
|
3113
|
+
e[a] = o = o._clone ? o._clone() : Vt(ve(o)), f = null, d = !0;
|
|
3109
3114
|
}
|
|
3110
3115
|
}
|
|
3111
3116
|
if (f)
|
|
3112
3117
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3113
3118
|
else {
|
|
3114
3119
|
const D = this.parseRule(o);
|
|
3115
|
-
f = new Gt(this, D,
|
|
3120
|
+
f = new Gt(this, D, m), this.bindParser(f);
|
|
3116
3121
|
}
|
|
3117
|
-
[!1, !0].forEach((D) => this.parseEmit(f, D)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !
|
|
3122
|
+
[!1, !0].forEach((D) => this.parseEmit(f, D)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !d && !g && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3118
3123
|
const $ = f.loadChildrenPending();
|
|
3119
3124
|
if (f.parser.loadChildren === !1 || s($, f), !r) {
|
|
3120
3125
|
const D = i(a);
|
|
@@ -3134,11 +3139,11 @@ function oi(t) {
|
|
|
3134
3139
|
const r = li(e), i = [], s = this.api;
|
|
3135
3140
|
if (!r.length) return !1;
|
|
3136
3141
|
for (let a = 0; a < r.length; a++) {
|
|
3137
|
-
const l = r[a], u = l.handle || function(
|
|
3138
|
-
return (fe[l.condition || "=="] || fe["=="])(
|
|
3142
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3143
|
+
return (fe[l.condition || "=="] || fe["=="])(d, l.value);
|
|
3139
3144
|
};
|
|
3140
3145
|
if (!h.trueArray(l.rule)) continue;
|
|
3141
|
-
const f = U(
|
|
3146
|
+
const f = U(v({}, l), {
|
|
3142
3147
|
valid: O(() => u(e.rule.value, s)),
|
|
3143
3148
|
ctrl: ui(e, l.rule),
|
|
3144
3149
|
isHidden: h.String(l.rule[0])
|
|
@@ -3149,13 +3154,13 @@ function oi(t) {
|
|
|
3149
3154
|
const n = [];
|
|
3150
3155
|
let o = !1;
|
|
3151
3156
|
return this.deferSyncValue(() => {
|
|
3152
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append:
|
|
3157
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: g, ctrl: m, method: $ }) => {
|
|
3153
3158
|
if (a) {
|
|
3154
3159
|
l ? e.ctrlRule.push({
|
|
3155
3160
|
__ctrl: !0,
|
|
3156
3161
|
children: u,
|
|
3157
3162
|
valid: l
|
|
3158
|
-
}) :
|
|
3163
|
+
}) : m && e.ctrlRule.splice(e.ctrlRule.indexOf(m) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3159
3164
|
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((_) => {
|
|
3160
3165
|
this.api.setEffect(_, "required", l);
|
|
3161
3166
|
}), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
@@ -3171,11 +3176,11 @@ function oi(t) {
|
|
|
3171
3176
|
children: u
|
|
3172
3177
|
};
|
|
3173
3178
|
e.ctrlRule.push(_), this.bus.$once("load-start", () => {
|
|
3174
|
-
f ? s.prepend(_, f,
|
|
3179
|
+
f ? s.prepend(_, f, g) : d || g ? s.append(_, d || e.id, g) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, _);
|
|
3175
3180
|
});
|
|
3176
3181
|
} else {
|
|
3177
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3178
|
-
const _ =
|
|
3182
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3183
|
+
const _ = Q(m);
|
|
3179
3184
|
_ && _.rm();
|
|
3180
3185
|
}
|
|
3181
3186
|
});
|
|
@@ -3190,7 +3195,7 @@ function oi(t) {
|
|
|
3190
3195
|
},
|
|
3191
3196
|
_reloadRule(e) {
|
|
3192
3197
|
e || (e = this.rules);
|
|
3193
|
-
const r =
|
|
3198
|
+
const r = v({}, this.ctxs);
|
|
3194
3199
|
this.clearNextTick(), this.initData(e), this.fc.rules = e, this.deferSyncValue(() => {
|
|
3195
3200
|
this.bus.$once("load-end", () => {
|
|
3196
3201
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
@@ -3293,7 +3298,7 @@ function fi(t) {
|
|
|
3293
3298
|
}), this.vm.updateValue(e);
|
|
3294
3299
|
},
|
|
3295
3300
|
isChange(e, r) {
|
|
3296
|
-
return JSON.stringify(this.getFormData(e),
|
|
3301
|
+
return JSON.stringify(this.getFormData(e), bt) !== JSON.stringify(r, bt);
|
|
3297
3302
|
},
|
|
3298
3303
|
isQuote(e, r) {
|
|
3299
3304
|
return (r instanceof Function || h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
@@ -3326,7 +3331,7 @@ function fi(t) {
|
|
|
3326
3331
|
}
|
|
3327
3332
|
});
|
|
3328
3333
|
}
|
|
3329
|
-
function
|
|
3334
|
+
function bt(t, e) {
|
|
3330
3335
|
return typeof e == "function" ? "" + e : e;
|
|
3331
3336
|
}
|
|
3332
3337
|
const Ee = {
|
|
@@ -3399,7 +3404,7 @@ function hi(t) {
|
|
|
3399
3404
|
watchCtx(e) {
|
|
3400
3405
|
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" && ci.indexOf(i) === -1).forEach((i) => {
|
|
3401
3406
|
const s = De(e.rule, i), n = i === "children";
|
|
3402
|
-
e.refRule[i] = s, e.watch.push(
|
|
3407
|
+
e.refRule[i] = s, e.watch.push(B(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3403
3408
|
let l = s.value;
|
|
3404
3409
|
if (!this.isBreakWatch()) {
|
|
3405
3410
|
if (n && e.parser.loadChildren === !1) {
|
|
@@ -3433,29 +3438,40 @@ function hi(t) {
|
|
|
3433
3438
|
s && (i = this.api.t(s[1]));
|
|
3434
3439
|
}
|
|
3435
3440
|
return i;
|
|
3436
|
-
}), e.refRule.__$validate = ge(() =>
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3441
|
+
}), e.refRule.__$validate = ge(() => {
|
|
3442
|
+
const i = (s) => {
|
|
3443
|
+
var o, a;
|
|
3444
|
+
const n = s.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3445
|
+
return n ? this.api.t(n[1], { title: (a = (o = e.refRule) == null ? void 0 : o.__$title) == null ? void 0 : a.value }) : s;
|
|
3446
|
+
};
|
|
3447
|
+
return H(e.rule.validate).map((s) => {
|
|
3448
|
+
const n = v({}, s);
|
|
3449
|
+
if (n.message && (n.message = i(n.message)), h.Function(n.validator)) {
|
|
3450
|
+
const o = e;
|
|
3451
|
+
n.validator = function(...a) {
|
|
3452
|
+
return s.validator.call({
|
|
3453
|
+
that: this,
|
|
3454
|
+
id: o.id,
|
|
3455
|
+
field: o.field,
|
|
3456
|
+
rule: o.rule,
|
|
3457
|
+
api: o.$handle.api
|
|
3458
|
+
}, ...a);
|
|
3459
|
+
};
|
|
3460
|
+
}
|
|
3461
|
+
if (n.adapter) {
|
|
3462
|
+
if (typeof n.error == "object") {
|
|
3463
|
+
const o = v({}, n.error);
|
|
3464
|
+
Object.keys(o).forEach((a) => {
|
|
3465
|
+
o[a] = i(o[a]);
|
|
3466
|
+
}), n.error = o;
|
|
3467
|
+
}
|
|
3468
|
+
return this.adapterValidate(n, e);
|
|
3469
|
+
}
|
|
3470
|
+
return n;
|
|
3471
|
+
});
|
|
3472
|
+
}), e.input) {
|
|
3457
3473
|
const i = De(e.rule, "value");
|
|
3458
|
-
e.watch.push(
|
|
3474
|
+
e.watch.push(B(() => i.value, () => {
|
|
3459
3475
|
let s = e.parser.toFormValue(i.value, e);
|
|
3460
3476
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
3461
3477
|
}));
|
|
@@ -3472,7 +3488,7 @@ function hi(t) {
|
|
|
3472
3488
|
}), a = (l) => {
|
|
3473
3489
|
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : se(e.rule, s, l);
|
|
3474
3490
|
};
|
|
3475
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3491
|
+
(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) => {
|
|
3476
3492
|
n = l, setTimeout(() => {
|
|
3477
3493
|
a(l);
|
|
3478
3494
|
});
|
|
@@ -3480,6 +3496,115 @@ function hi(t) {
|
|
|
3480
3496
|
}));
|
|
3481
3497
|
}), this.watchEffect(e);
|
|
3482
3498
|
},
|
|
3499
|
+
adapterValidate(e, r) {
|
|
3500
|
+
const i = (s, n) => {
|
|
3501
|
+
if ((e.beforeValidate && O(() => e.beforeValidate({
|
|
3502
|
+
value: s,
|
|
3503
|
+
api: this.api,
|
|
3504
|
+
validate: e,
|
|
3505
|
+
rule: r.rule
|
|
3506
|
+
}))) === !1)
|
|
3507
|
+
n();
|
|
3508
|
+
else {
|
|
3509
|
+
const a = this.validator(s, e);
|
|
3510
|
+
if (a) {
|
|
3511
|
+
let l = "";
|
|
3512
|
+
typeof e.error == "object" && (l = e.error[a] || e.error.default), !l && typeof e.message == "string" && (l = e.message), l || (l = this.getValidateMessage(r, { key: a, rule: e[a] })), n(l);
|
|
3513
|
+
} else if (e.validator) {
|
|
3514
|
+
const l = e.validator && O(() => e.validator(s, n));
|
|
3515
|
+
l && h.Function(l.then) && l.then(() => n()).catch((u) => n(u));
|
|
3516
|
+
} else
|
|
3517
|
+
n();
|
|
3518
|
+
}
|
|
3519
|
+
};
|
|
3520
|
+
return this.$manager.adapterValidate({
|
|
3521
|
+
required: e.required,
|
|
3522
|
+
message: e.message,
|
|
3523
|
+
target: e.trigger
|
|
3524
|
+
}, i);
|
|
3525
|
+
},
|
|
3526
|
+
getValidateMessage(e, r) {
|
|
3527
|
+
var s, n;
|
|
3528
|
+
const i = Array.isArray(r.rule) ? r.rule.join(",") : "" + r.rule;
|
|
3529
|
+
return this.api.t(r.key === "required" ? r.key : "validate." + r.key, {
|
|
3530
|
+
[r.key]: i,
|
|
3531
|
+
title: (n = (s = e.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value
|
|
3532
|
+
});
|
|
3533
|
+
},
|
|
3534
|
+
validator(e, r) {
|
|
3535
|
+
if (h.empty(e))
|
|
3536
|
+
return r.required ? "required" : void 0;
|
|
3537
|
+
for (const [s, n] of Object.entries(r))
|
|
3538
|
+
switch (s) {
|
|
3539
|
+
case "len":
|
|
3540
|
+
case "maxLen":
|
|
3541
|
+
case "minLen":
|
|
3542
|
+
const o = (m) => s === "len" ? m === n : s === "maxLen" ? m <= n : m >= n;
|
|
3543
|
+
if (Array.isArray(e)) {
|
|
3544
|
+
if (!o(e.length))
|
|
3545
|
+
return s;
|
|
3546
|
+
} else {
|
|
3547
|
+
if (typeof e == "object")
|
|
3548
|
+
return s;
|
|
3549
|
+
if (!o(("" + e).length))
|
|
3550
|
+
return s;
|
|
3551
|
+
}
|
|
3552
|
+
break;
|
|
3553
|
+
case "pattern":
|
|
3554
|
+
if (!(typeof n == "string" ? new RegExp(n) : n).test("" + e))
|
|
3555
|
+
return s;
|
|
3556
|
+
break;
|
|
3557
|
+
case "uppercase":
|
|
3558
|
+
if (n && (typeof e != "string" || !/^[A-Z]*$/.test(e)))
|
|
3559
|
+
return s;
|
|
3560
|
+
break;
|
|
3561
|
+
case "lowercase":
|
|
3562
|
+
if (n && (typeof e != "string" || !/^[a-z]*$/.test(e)))
|
|
3563
|
+
return s;
|
|
3564
|
+
break;
|
|
3565
|
+
case "min":
|
|
3566
|
+
case "max":
|
|
3567
|
+
case "positive":
|
|
3568
|
+
case "negative":
|
|
3569
|
+
case "integer":
|
|
3570
|
+
case "number":
|
|
3571
|
+
const l = Number(e);
|
|
3572
|
+
if (Number.isNaN(l) || s === "min" && l < n || s === "max" && l > n || s === "positive" && l <= 0 || s === "negative" && l >= 0 || s === "integer" && !Number.isInteger(l))
|
|
3573
|
+
return s;
|
|
3574
|
+
break;
|
|
3575
|
+
case "equal":
|
|
3576
|
+
if (e !== n)
|
|
3577
|
+
return s;
|
|
3578
|
+
break;
|
|
3579
|
+
case "enum":
|
|
3580
|
+
if (Array.isArray(n) && !n.includes(e))
|
|
3581
|
+
return s;
|
|
3582
|
+
break;
|
|
3583
|
+
case "hasKeys":
|
|
3584
|
+
if (typeof e != "object" || Array.isArray(n) && n.some((m) => !(m in e)))
|
|
3585
|
+
return s;
|
|
3586
|
+
break;
|
|
3587
|
+
case "email":
|
|
3588
|
+
if (!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test("" + e))
|
|
3589
|
+
return s;
|
|
3590
|
+
break;
|
|
3591
|
+
case "url":
|
|
3592
|
+
if (!new RegExp(
|
|
3593
|
+
"^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
|
|
3594
|
+
"i"
|
|
3595
|
+
).test("" + e))
|
|
3596
|
+
return s;
|
|
3597
|
+
break;
|
|
3598
|
+
case "ip":
|
|
3599
|
+
if (!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test("" + e))
|
|
3600
|
+
return s;
|
|
3601
|
+
break;
|
|
3602
|
+
case "phone":
|
|
3603
|
+
if (!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test("" + e))
|
|
3604
|
+
return s;
|
|
3605
|
+
break;
|
|
3606
|
+
}
|
|
3607
|
+
},
|
|
3483
3608
|
compute(e, r) {
|
|
3484
3609
|
let i;
|
|
3485
3610
|
if (typeof r == "object") {
|
|
@@ -3489,18 +3614,18 @@ function hi(t) {
|
|
|
3489
3614
|
const l = a.mode === "OR";
|
|
3490
3615
|
let u = !0;
|
|
3491
3616
|
for (let f = 0; f < a.group.length; f++) {
|
|
3492
|
-
const
|
|
3493
|
-
let
|
|
3494
|
-
if (
|
|
3495
|
-
|
|
3496
|
-
else if (
|
|
3497
|
-
|
|
3498
|
-
else if (!
|
|
3617
|
+
const d = a.group[f];
|
|
3618
|
+
let g, m = null;
|
|
3619
|
+
if (d.variable)
|
|
3620
|
+
m = JSON.stringify(this.fc.getLoadData(d.variable) || "");
|
|
3621
|
+
else if (d.field)
|
|
3622
|
+
m = dt(d.field || "");
|
|
3623
|
+
else if (!d.mode)
|
|
3499
3624
|
return !0;
|
|
3500
|
-
let $ =
|
|
3501
|
-
if ($ && ($ = dt($ || "")),
|
|
3625
|
+
let $ = d.compare;
|
|
3626
|
+
if ($ && ($ = dt($ || "")), d.mode ? g = n(d) : fe[d.condition] ? h.Function(d.handler) ? g = O(() => d.handler(this.api, e.rule)) : g = O(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${m}, ${$ || "$val"}); }}}}`).call(this.api.form, fe, d.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : g = !1, l && g)
|
|
3502
3627
|
return !0;
|
|
3503
|
-
l || (u = u &&
|
|
3628
|
+
l || (u = u && g);
|
|
3504
3629
|
}
|
|
3505
3630
|
return l ? !1 : u;
|
|
3506
3631
|
};
|
|
@@ -3570,7 +3695,7 @@ function di(t) {
|
|
|
3570
3695
|
emitEvent(e, ...r) {
|
|
3571
3696
|
const i = this.options[e] || this.options[q("on-" + e)];
|
|
3572
3697
|
if (i) {
|
|
3573
|
-
const s =
|
|
3698
|
+
const s = W(i);
|
|
3574
3699
|
h.Function(s) && O(() => s(...r));
|
|
3575
3700
|
}
|
|
3576
3701
|
this.bus.$emit(e, ...r);
|
|
@@ -3579,7 +3704,7 @@ function di(t) {
|
|
|
3579
3704
|
var n, o;
|
|
3580
3705
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3581
3706
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3582
|
-
O(() => a(U(
|
|
3707
|
+
O(() => a(U(v({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
|
|
3583
3708
|
}));
|
|
3584
3709
|
}
|
|
3585
3710
|
});
|
|
@@ -3614,7 +3739,7 @@ function pi(t) {
|
|
|
3614
3739
|
}), Object.keys(e.rule).forEach((i) => {
|
|
3615
3740
|
i[0] === "$" && (r[i.substr(1)] = () => e.rule[i]);
|
|
3616
3741
|
}), Object.keys(r).forEach((i) => {
|
|
3617
|
-
e.watch.push(
|
|
3742
|
+
e.watch.push(B(r[i], (s) => {
|
|
3618
3743
|
this.effect(e, "watch", { [i]: s });
|
|
3619
3744
|
}, { deep: !0 }));
|
|
3620
3745
|
});
|
|
@@ -3643,19 +3768,19 @@ function pi(t) {
|
|
|
3643
3768
|
},
|
|
3644
3769
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3645
3770
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3646
|
-
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u),
|
|
3771
|
+
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), v({}, r.effect || {}));
|
|
3647
3772
|
Object.keys(l).forEach((u) => {
|
|
3648
3773
|
const f = this.providers[u];
|
|
3649
3774
|
if (!f || f.input && !i) return;
|
|
3650
|
-
let
|
|
3775
|
+
let d;
|
|
3651
3776
|
if (!f._c)
|
|
3652
|
-
|
|
3777
|
+
d = "*";
|
|
3653
3778
|
else if (f._used.indexOf(s) > -1)
|
|
3654
|
-
|
|
3779
|
+
d = s;
|
|
3655
3780
|
else
|
|
3656
3781
|
return;
|
|
3657
|
-
const
|
|
3658
|
-
e && (
|
|
3782
|
+
const g = v({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3783
|
+
e && (g.getProp = () => e.effectData(u), g.clearProp = () => e.clearEffectData(u), g.mergeProp = (m) => Y(g.getProp(), [m]), g.id = e.id), this.bus.$emit(`p:${u}:${d}:${f.input ? 1 : 0}`, o, [g, r, this.api]);
|
|
3659
3784
|
});
|
|
3660
3785
|
}
|
|
3661
3786
|
});
|
|
@@ -3673,7 +3798,7 @@ function gi(t) {
|
|
|
3673
3798
|
} else return h.String(e) ? [e] : !1;
|
|
3674
3799
|
}
|
|
3675
3800
|
function K(t) {
|
|
3676
|
-
|
|
3801
|
+
Bt(this, {
|
|
3677
3802
|
options() {
|
|
3678
3803
|
return t.options.value || {};
|
|
3679
3804
|
},
|
|
@@ -3710,7 +3835,7 @@ function K(t) {
|
|
|
3710
3835
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3711
3836
|
const i = O(() => r(e, this));
|
|
3712
3837
|
return i && i !== e && C(e, i), e;
|
|
3713
|
-
},
|
|
3838
|
+
}, Qr(this));
|
|
3714
3839
|
}
|
|
3715
3840
|
C(K.prototype, {
|
|
3716
3841
|
initData(t) {
|
|
@@ -3726,7 +3851,7 @@ C(K.prototype, {
|
|
|
3726
3851
|
this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
|
|
3727
3852
|
},
|
|
3728
3853
|
updateAppendData() {
|
|
3729
|
-
this.appendData =
|
|
3854
|
+
this.appendData = v(v(v({}, this.options.formData || {}), this.fc.vm.$options.propsData.value || {}), this.appendData);
|
|
3730
3855
|
},
|
|
3731
3856
|
isBreakWatch() {
|
|
3732
3857
|
return this.loading || this.noWatchFn || this.reloading;
|
|
@@ -3741,7 +3866,12 @@ C(K.prototype, {
|
|
|
3741
3866
|
return new Promise((e, r) => {
|
|
3742
3867
|
const i = t && t.beforeFetch && O(() => t.beforeFetch(t, { api: this.api }));
|
|
3743
3868
|
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3744
|
-
}).then(() => this.globalBeforeFetch(t))
|
|
3869
|
+
}).then(() => this.globalBeforeFetch(t));
|
|
3870
|
+
},
|
|
3871
|
+
beforeSubmit(t) {
|
|
3872
|
+
return new Promise((e, r) => {
|
|
3873
|
+
const i = this.options.beforeSubmit && O(() => this.options.beforeSubmit(t, { api: this.api }));
|
|
3874
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3745
3875
|
});
|
|
3746
3876
|
}
|
|
3747
3877
|
});
|
|
@@ -3764,7 +3894,7 @@ const yi = "fcFragment", Ne = {
|
|
|
3764
3894
|
function $i(t) {
|
|
3765
3895
|
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3766
3896
|
}
|
|
3767
|
-
function
|
|
3897
|
+
function bi() {
|
|
3768
3898
|
const t = {};
|
|
3769
3899
|
function e(r) {
|
|
3770
3900
|
r && this.setVm(r);
|
|
@@ -3796,7 +3926,7 @@ function vi() {
|
|
|
3796
3926
|
},
|
|
3797
3927
|
use(r) {
|
|
3798
3928
|
Object.keys(r).forEach((i) => {
|
|
3799
|
-
const s =
|
|
3929
|
+
const s = be(i), n = qr(i).toLocaleLowerCase(), o = r[i];
|
|
3800
3930
|
[i, s, n].forEach((a) => {
|
|
3801
3931
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3802
3932
|
return this.make(o, l, u);
|
|
@@ -3806,7 +3936,7 @@ function vi() {
|
|
|
3806
3936
|
}
|
|
3807
3937
|
}), e;
|
|
3808
3938
|
}
|
|
3809
|
-
function
|
|
3939
|
+
function vi(t) {
|
|
3810
3940
|
class e extends Ht {
|
|
3811
3941
|
}
|
|
3812
3942
|
return Object.assign(e.prototype, t), e;
|
|
@@ -3839,6 +3969,9 @@ C(Ht.prototype, {
|
|
|
3839
3969
|
form() {
|
|
3840
3970
|
return this.vm.$refs[this.ref];
|
|
3841
3971
|
},
|
|
3972
|
+
adapterValidate(t, e) {
|
|
3973
|
+
return t.validator = (r, i, s) => e(i, s), t;
|
|
3974
|
+
},
|
|
3842
3975
|
getSlot(t) {
|
|
3843
3976
|
const e = (r) => {
|
|
3844
3977
|
if (r) {
|
|
@@ -3849,7 +3982,7 @@ C(Ht.prototype, {
|
|
|
3849
3982
|
return e(this.vm);
|
|
3850
3983
|
},
|
|
3851
3984
|
mergeOptions(t, e) {
|
|
3852
|
-
return
|
|
3985
|
+
return x(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3853
3986
|
},
|
|
3854
3987
|
updateOptions(t) {
|
|
3855
3988
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3877,12 +4010,12 @@ const _i = function(t) {
|
|
|
3877
4010
|
const o = [];
|
|
3878
4011
|
n.forEach((a) => {
|
|
3879
4012
|
if (a && (a.attr || a.template)) {
|
|
3880
|
-
let l = (
|
|
3881
|
-
let
|
|
3882
|
-
a.template ?
|
|
3883
|
-
const
|
|
3884
|
-
a.to === "child" ?
|
|
3885
|
-
}, u = (
|
|
4013
|
+
let l = (d) => {
|
|
4014
|
+
let g;
|
|
4015
|
+
a.template ? g = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? g = a.handler(d, i, s) : g = d(a.attr, a.default), a.copy !== !1 && (g = G(g));
|
|
4016
|
+
const m = a.modify ? i : r.getProp();
|
|
4017
|
+
a.to === "child" ? m.children ? S(m.children, 0, g) : S(m, "children", [g]) : se(m, a.to || "options", g), s.sync(i);
|
|
4018
|
+
}, u = (d) => l(d);
|
|
3886
4019
|
const f = t.watchLoadData(u);
|
|
3887
4020
|
l = ne(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3888
4021
|
}
|
|
@@ -3908,13 +4041,13 @@ const _i = function(t) {
|
|
|
3908
4041
|
const l = n[a];
|
|
3909
4042
|
if (l) {
|
|
3910
4043
|
const u = typeof l == "object";
|
|
3911
|
-
let f = (
|
|
3912
|
-
let $ = t.t(u ? l.attr : l, u ? l.params : null,
|
|
4044
|
+
let f = (m) => {
|
|
4045
|
+
let $ = t.t(u ? l.attr : l, u ? l.params : null, m);
|
|
3913
4046
|
const _ = u && l.modify ? i : r.getProp();
|
|
3914
4047
|
a === "child" ? _.children ? S(_.children, 0, $) : S(_, "children", [$]) : se(_, a, $), s.sync(i);
|
|
3915
|
-
},
|
|
3916
|
-
const
|
|
3917
|
-
f = ne(f, l.wait || 300), l.watch !== !1 ? o.push(
|
|
4048
|
+
}, d = (m) => f(m);
|
|
4049
|
+
const g = t.watchLoadData(d);
|
|
4050
|
+
f = ne(f, l.wait || 300), l.watch !== !1 ? o.push(g) : g();
|
|
3918
4051
|
}
|
|
3919
4052
|
}), this._fn[r.id] = o;
|
|
3920
4053
|
},
|
|
@@ -3925,7 +4058,7 @@ const _i = function(t) {
|
|
|
3925
4058
|
}
|
|
3926
4059
|
};
|
|
3927
4060
|
return e.watch = e.loaded, e;
|
|
3928
|
-
},
|
|
4061
|
+
}, zt = {
|
|
3929
4062
|
name: "componentValidate",
|
|
3930
4063
|
load(t, e, r) {
|
|
3931
4064
|
let i = t.getValue();
|
|
@@ -3934,9 +4067,9 @@ const _i = function(t) {
|
|
|
3934
4067
|
else {
|
|
3935
4068
|
h.Object(i) || (i = { method: i });
|
|
3936
4069
|
const s = i.method;
|
|
3937
|
-
delete i.method, t.getProp().validate = [U(
|
|
4070
|
+
delete i.method, t.getProp().validate = [U(v({}, i), {
|
|
3938
4071
|
validator(...n) {
|
|
3939
|
-
const o =
|
|
4072
|
+
const o = Q(e);
|
|
3940
4073
|
if (o)
|
|
3941
4074
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3942
4075
|
attr: t,
|
|
@@ -3948,7 +4081,7 @@ const _i = function(t) {
|
|
|
3948
4081
|
}
|
|
3949
4082
|
},
|
|
3950
4083
|
watch(...t) {
|
|
3951
|
-
|
|
4084
|
+
zt.load(...t);
|
|
3952
4085
|
}
|
|
3953
4086
|
}, wi = function(t) {
|
|
3954
4087
|
function e(s) {
|
|
@@ -3960,48 +4093,48 @@ const _i = function(t) {
|
|
|
3960
4093
|
function r(s, n, o) {
|
|
3961
4094
|
let a = s.value;
|
|
3962
4095
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3963
|
-
const l = (
|
|
3964
|
-
|
|
4096
|
+
const l = (d) => {
|
|
4097
|
+
d === void 0 ? s.clearProp() : se(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3965
4098
|
};
|
|
3966
4099
|
if (!a || !a.action && !a.key) {
|
|
3967
4100
|
l(void 0);
|
|
3968
4101
|
return;
|
|
3969
4102
|
}
|
|
3970
4103
|
if (a = G(a), a.to || (a.to = "options"), a.key) {
|
|
3971
|
-
const
|
|
3972
|
-
if (!
|
|
4104
|
+
const d = t.$handle.options.globalData[a.key];
|
|
4105
|
+
if (!d) {
|
|
3973
4106
|
l(void 0);
|
|
3974
4107
|
return;
|
|
3975
4108
|
}
|
|
3976
|
-
if (
|
|
3977
|
-
l(
|
|
4109
|
+
if (d.type === "static") {
|
|
4110
|
+
l(d.data);
|
|
3978
4111
|
return;
|
|
3979
4112
|
} else
|
|
3980
|
-
a =
|
|
4113
|
+
a = v(v({}, a), d);
|
|
3981
4114
|
}
|
|
3982
4115
|
const u = a.onError, f = () => {
|
|
3983
4116
|
if (!s.getValue())
|
|
3984
4117
|
return s.clearProp(), o.sync(n), !0;
|
|
3985
4118
|
};
|
|
3986
|
-
i._fn[s.id] = t.watchLoadData(ne((
|
|
3987
|
-
if (
|
|
4119
|
+
i._fn[s.id] = t.watchLoadData(ne((d, g) => {
|
|
4120
|
+
if (g && a.watch === !1)
|
|
3988
4121
|
return i._fn[s.id]();
|
|
3989
|
-
const
|
|
4122
|
+
const m = t.$handle.loadFetchVar(G(a), d, n), $ = U(v({
|
|
3990
4123
|
headers: {}
|
|
3991
|
-
},
|
|
4124
|
+
}, m), {
|
|
3992
4125
|
onSuccess(_, D) {
|
|
3993
4126
|
if (f()) return;
|
|
3994
4127
|
let ee = (T) => D ? T : E(T, "data") ? T.data : T;
|
|
3995
|
-
const P =
|
|
3996
|
-
h.Function(P) ? ee = P : P && h.String(P) && (ee = (T) =>
|
|
4128
|
+
const P = W(m.parse);
|
|
4129
|
+
h.Function(P) ? ee = P : P && h.String(P) && (ee = (T) => L(T, P)), l(ee(_, n, o));
|
|
3997
4130
|
},
|
|
3998
4131
|
onError(_) {
|
|
3999
|
-
l(void 0), !f() && (u || ((D) => et(D.message || "fetch fail " +
|
|
4132
|
+
l(void 0), !f() && (u || ((D) => et(D.message || "fetch fail " + m.action)))(_, n, o);
|
|
4000
4133
|
}
|
|
4001
4134
|
});
|
|
4002
4135
|
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
4003
|
-
if (h.Function(
|
|
4004
|
-
|
|
4136
|
+
if (h.Function(m.action)) {
|
|
4137
|
+
m.action(n, o).then((_) => {
|
|
4005
4138
|
$.onSuccess(_, !0);
|
|
4006
4139
|
}).catch((_) => {
|
|
4007
4140
|
$.onError(_);
|
|
@@ -4009,6 +4142,7 @@ const _i = function(t) {
|
|
|
4009
4142
|
return;
|
|
4010
4143
|
}
|
|
4011
4144
|
O(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
4145
|
+
}).catch((_) => {
|
|
4012
4146
|
});
|
|
4013
4147
|
}, a.wait || 600));
|
|
4014
4148
|
}
|
|
@@ -4030,7 +4164,7 @@ const _i = function(t) {
|
|
|
4030
4164
|
fetch: wi,
|
|
4031
4165
|
loadData: _i,
|
|
4032
4166
|
t: Ci,
|
|
4033
|
-
componentValidate:
|
|
4167
|
+
componentValidate: zt
|
|
4034
4168
|
};
|
|
4035
4169
|
function Fi(t) {
|
|
4036
4170
|
t = t || /* @__PURE__ */ new Map();
|
|
@@ -4056,7 +4190,7 @@ function Fi(t) {
|
|
|
4056
4190
|
};
|
|
4057
4191
|
return e;
|
|
4058
4192
|
}
|
|
4059
|
-
const Si = "html",
|
|
4193
|
+
const Si = "html", ki = {
|
|
4060
4194
|
name: Si,
|
|
4061
4195
|
loadChildren: !1,
|
|
4062
4196
|
render(t, e) {
|
|
@@ -4066,7 +4200,7 @@ const Si = "html", Ri = {
|
|
|
4066
4200
|
return Array.isArray(t) ? t.filter((e) => h.String(e)).join("") : "";
|
|
4067
4201
|
}
|
|
4068
4202
|
};
|
|
4069
|
-
function
|
|
4203
|
+
function Ri(t) {
|
|
4070
4204
|
t = t + "=";
|
|
4071
4205
|
const r = decodeURIComponent(document.cookie).split(";");
|
|
4072
4206
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -4109,10 +4243,10 @@ function it(t, e) {
|
|
|
4109
4243
|
return null;
|
|
4110
4244
|
const r = e.split(".");
|
|
4111
4245
|
let i = t(r.shift());
|
|
4112
|
-
return r.length ? i == null ? null :
|
|
4246
|
+
return r.length ? i == null ? null : L(i, r) : i;
|
|
4113
4247
|
}
|
|
4114
4248
|
function ji(t) {
|
|
4115
|
-
return it(
|
|
4249
|
+
return it(Ri, t);
|
|
4116
4250
|
}
|
|
4117
4251
|
function Ii(t) {
|
|
4118
4252
|
return it(Ei, t);
|
|
@@ -4120,14 +4254,64 @@ function Ii(t) {
|
|
|
4120
4254
|
function Ai(t) {
|
|
4121
4255
|
return it(Di, t);
|
|
4122
4256
|
}
|
|
4123
|
-
|
|
4257
|
+
const Vi = {
|
|
4258
|
+
en: {
|
|
4259
|
+
required: "{title} is required",
|
|
4260
|
+
validate: {
|
|
4261
|
+
url: "{title} is not a valid url",
|
|
4262
|
+
email: "{title} is not a valid email",
|
|
4263
|
+
ip: "{title} {title} is not a valid ip",
|
|
4264
|
+
phone: "{title} {title} is not a valid phone",
|
|
4265
|
+
pattern: "{title} does not match pattern {pattern}",
|
|
4266
|
+
uppercase: "{title} must be all uppercase",
|
|
4267
|
+
lowercase: "{title} must be all lowercased",
|
|
4268
|
+
positive: "{title} is not a positive number",
|
|
4269
|
+
negative: "{title} is not a negative number",
|
|
4270
|
+
equal: "{title} is not equal to {equal}",
|
|
4271
|
+
min: "{title} cannot be less than {min}",
|
|
4272
|
+
max: "{title} cannot be greater than {max}",
|
|
4273
|
+
enum: "{title} must be one of {enum}",
|
|
4274
|
+
hasKeys: "{title} does not contain required fields {hasKeys}",
|
|
4275
|
+
minLen: "{title} must be at least {minLen}",
|
|
4276
|
+
maxLen: "{title} cannot be longer than {maxLen}",
|
|
4277
|
+
len: "{title} must be exactly {len}",
|
|
4278
|
+
integer: "{title} is not an integer",
|
|
4279
|
+
number: "{title} is not an number"
|
|
4280
|
+
}
|
|
4281
|
+
},
|
|
4282
|
+
"zh-cn": {
|
|
4283
|
+
required: "{title}不能为空",
|
|
4284
|
+
validate: {
|
|
4285
|
+
url: "{title}不是有效的 url 地址",
|
|
4286
|
+
email: "{title}不是有效的邮箱地址",
|
|
4287
|
+
ip: "{title}不是有效的 IP 地址",
|
|
4288
|
+
phone: "{title}不是正确的手机号",
|
|
4289
|
+
pattern: "{title}必须匹配 {pattern}",
|
|
4290
|
+
uppercase: "{title}必须全大写",
|
|
4291
|
+
lowercase: "{title}必须全小写",
|
|
4292
|
+
positive: "{title}不是正数",
|
|
4293
|
+
negative: "{title}不是负数",
|
|
4294
|
+
equal: "{title}必须等于 {equal}",
|
|
4295
|
+
min: "{title}必须大于等于 {min}",
|
|
4296
|
+
max: "{title}必须小于等于 {max}",
|
|
4297
|
+
enum: "{title}必须是 {enum} 之一",
|
|
4298
|
+
hasKeys: "{title}必须包含 {hasKeys} 字段",
|
|
4299
|
+
minLen: "{title}长度必须大于 {minLen}",
|
|
4300
|
+
maxLen: "{title}长度必须小于 {maxLen}",
|
|
4301
|
+
len: "{title}长度必须为 {len}",
|
|
4302
|
+
integer: "{title}必须为整数",
|
|
4303
|
+
number: "{title}必须为数字"
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4306
|
+
};
|
|
4307
|
+
function Pi(t, e) {
|
|
4124
4308
|
let r;
|
|
4125
4309
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4126
4310
|
}
|
|
4127
4311
|
function Me() {
|
|
4128
|
-
return
|
|
4312
|
+
return Pi("name", ...arguments);
|
|
4129
4313
|
}
|
|
4130
|
-
function
|
|
4314
|
+
function Li(t) {
|
|
4131
4315
|
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
4132
4316
|
}
|
|
4133
4317
|
function Bi(t, e) {
|
|
@@ -4141,29 +4325,29 @@ function Bi(t, e) {
|
|
|
4141
4325
|
});
|
|
4142
4326
|
return r.$mount(), r;
|
|
4143
4327
|
}
|
|
4144
|
-
function
|
|
4328
|
+
function Ti(t) {
|
|
4145
4329
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4146
|
-
jt.push(...e),
|
|
4330
|
+
jt.push(...e), xe.push(...r), Ye.push(...i), Nt([...e, ...r, ...i]);
|
|
4147
4331
|
}
|
|
4148
|
-
let
|
|
4149
|
-
const M = {},
|
|
4150
|
-
function
|
|
4332
|
+
let Ni = 1;
|
|
4333
|
+
const M = {}, ke = Symbol("defValue");
|
|
4334
|
+
function Jt(t) {
|
|
4151
4335
|
const e = {
|
|
4152
4336
|
[Ne.name]: Ne
|
|
4153
4337
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4154
4338
|
t.extendApi
|
|
4155
|
-
], u =
|
|
4156
|
-
let
|
|
4157
|
-
const
|
|
4158
|
-
$mobile:
|
|
4159
|
-
}), $ =
|
|
4160
|
-
|
|
4339
|
+
], u = v({}, Oi), f = Xr();
|
|
4340
|
+
let d = { global: {} };
|
|
4341
|
+
const g = t.isMobile === !0, m = ie({
|
|
4342
|
+
$mobile: g
|
|
4343
|
+
}), $ = bi(), _ = {}, D = {};
|
|
4344
|
+
Ti(t.attrs || {});
|
|
4161
4345
|
function ee(c) {
|
|
4162
|
-
const
|
|
4163
|
-
if (Array.isArray(
|
|
4164
|
-
return
|
|
4165
|
-
if (
|
|
4166
|
-
return
|
|
4346
|
+
const p = M[c];
|
|
4347
|
+
if (Array.isArray(p))
|
|
4348
|
+
return p.map((y) => y.api());
|
|
4349
|
+
if (p)
|
|
4350
|
+
return p.api();
|
|
4167
4351
|
}
|
|
4168
4352
|
function P(c) {
|
|
4169
4353
|
o.push(c);
|
|
@@ -4174,7 +4358,7 @@ function Wt(t) {
|
|
|
4174
4358
|
}
|
|
4175
4359
|
function ce() {
|
|
4176
4360
|
const c = Me(...arguments);
|
|
4177
|
-
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(
|
|
4361
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(v({}, c.prop), {
|
|
4178
4362
|
name: c.id
|
|
4179
4363
|
}));
|
|
4180
4364
|
}
|
|
@@ -4184,38 +4368,38 @@ function Wt(t) {
|
|
|
4184
4368
|
function he() {
|
|
4185
4369
|
const c = Me(...arguments);
|
|
4186
4370
|
if (!c.id || !c.prop) return Ee;
|
|
4187
|
-
const
|
|
4188
|
-
r[
|
|
4371
|
+
const p = q(c.id), y = c.prop, b = y.merge === !0 ? r[p] : void 0;
|
|
4372
|
+
r[p] = Se(y, b || Ee), f[p] = V(p), y.maker && C(f, y.maker);
|
|
4189
4373
|
}
|
|
4190
|
-
function F(c,
|
|
4374
|
+
function F(c, p) {
|
|
4191
4375
|
let y;
|
|
4192
4376
|
if (h.String(c)) {
|
|
4193
|
-
if (y = c,
|
|
4194
|
-
return ["form-create", "formcreate"].indexOf(y) > -1 ?
|
|
4377
|
+
if (y = c, p === void 0)
|
|
4378
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? k() : e[y];
|
|
4195
4379
|
} else
|
|
4196
|
-
y = q(c.name),
|
|
4197
|
-
if (!y || !
|
|
4198
|
-
const
|
|
4199
|
-
e[y] =
|
|
4380
|
+
y = q(c.name), p = c;
|
|
4381
|
+
if (!y || !p) return;
|
|
4382
|
+
const b = q(y);
|
|
4383
|
+
e[y] = p, e[b] = p, delete $.aliasMap[y], delete $.aliasMap[b], delete r[y], delete r[b], p.formCreateParser && he(y, p.formCreateParser);
|
|
4200
4384
|
}
|
|
4201
|
-
function
|
|
4202
|
-
return
|
|
4385
|
+
function k() {
|
|
4386
|
+
return Wr(Le, e, i);
|
|
4203
4387
|
}
|
|
4204
4388
|
function N() {
|
|
4205
4389
|
return Ne;
|
|
4206
4390
|
}
|
|
4207
|
-
function de(c,
|
|
4208
|
-
return h.Function(c.install) ? c.install(
|
|
4391
|
+
function de(c, p) {
|
|
4392
|
+
return h.Function(c.install) ? c.install(z, p) : h.Function(c) && c(z, p), this;
|
|
4209
4393
|
}
|
|
4210
|
-
function
|
|
4211
|
-
let
|
|
4212
|
-
const w =
|
|
4213
|
-
return w.$parent = y,
|
|
4394
|
+
function z(c, p, y) {
|
|
4395
|
+
let b = Bi(c, p || {});
|
|
4396
|
+
const w = b.$refs.fc.formCreate;
|
|
4397
|
+
return w.$parent = y, Li(w.options).appendChild(b.$el), w.api();
|
|
4214
4398
|
}
|
|
4215
|
-
Se(
|
|
4399
|
+
Se(z, D);
|
|
4216
4400
|
function Kt(c) {
|
|
4217
|
-
let
|
|
4218
|
-
return c ?
|
|
4401
|
+
let p = v({}, t);
|
|
4402
|
+
return c ? p.inherit = {
|
|
4219
4403
|
components: e,
|
|
4220
4404
|
parsers: r,
|
|
4221
4405
|
directives: i,
|
|
@@ -4224,65 +4408,65 @@ function Wt(t) {
|
|
|
4224
4408
|
useApps: o,
|
|
4225
4409
|
maker: f,
|
|
4226
4410
|
formulas: _,
|
|
4227
|
-
loadData:
|
|
4228
|
-
} : delete
|
|
4411
|
+
loadData: m
|
|
4412
|
+
} : delete p.inherit, Jt(p);
|
|
4229
4413
|
}
|
|
4230
|
-
function Xt(c,
|
|
4231
|
-
s[c] =
|
|
4414
|
+
function Xt(c, p) {
|
|
4415
|
+
s[c] = p;
|
|
4232
4416
|
}
|
|
4233
|
-
function
|
|
4234
|
-
_[c] =
|
|
4417
|
+
function Zt(c, p) {
|
|
4418
|
+
_[c] = p;
|
|
4235
4419
|
}
|
|
4236
|
-
function
|
|
4237
|
-
const y = n[c] || {},
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
}),
|
|
4420
|
+
function Qt(c, p) {
|
|
4421
|
+
const y = n[c] || {}, b = y.parsers || {};
|
|
4422
|
+
p.parsers && Object.keys(p.parsers).forEach((w) => {
|
|
4423
|
+
b[w] = Se(p.parsers[w], Ee);
|
|
4424
|
+
}), p.name = c, n[c] = U(v(v({}, y), p), { parsers: b });
|
|
4241
4425
|
}
|
|
4242
4426
|
function Ce(c) {
|
|
4243
|
-
c && Object.keys(M).forEach((
|
|
4244
|
-
(Array.isArray(M[
|
|
4245
|
-
|
|
4427
|
+
c && Object.keys(M).forEach((p) => {
|
|
4428
|
+
(Array.isArray(M[p]) ? M[p] : [M[p]]).forEach((b) => {
|
|
4429
|
+
b.bus.$emit("$loadData." + c);
|
|
4246
4430
|
});
|
|
4247
4431
|
});
|
|
4248
4432
|
}
|
|
4249
|
-
function Pe(c,
|
|
4250
|
-
se(
|
|
4433
|
+
function Pe(c, p) {
|
|
4434
|
+
se(m, c, p), Ce(c);
|
|
4251
4435
|
}
|
|
4252
|
-
function we(c,
|
|
4253
|
-
const y = (...
|
|
4436
|
+
function we(c, p) {
|
|
4437
|
+
const y = (...b) => O(() => p(...b));
|
|
4254
4438
|
y._driver = !0, Pe(c, y);
|
|
4255
4439
|
}
|
|
4256
|
-
function nt(c,
|
|
4440
|
+
function nt(c, p) {
|
|
4257
4441
|
const y = (c || "").split(".");
|
|
4258
4442
|
c = y.shift();
|
|
4259
|
-
const
|
|
4260
|
-
if (E(
|
|
4261
|
-
let w =
|
|
4262
|
-
return w && w._driver ? w = w(
|
|
4443
|
+
const b = y.join(".");
|
|
4444
|
+
if (E(m, c) || S(m, c, ke), m[c] !== ke) {
|
|
4445
|
+
let w = m[c];
|
|
4446
|
+
return w && w._driver ? w = w(b) : y.length && (w = L(w, y)), w == null || w === "" ? p : w;
|
|
4263
4447
|
} else
|
|
4264
|
-
return
|
|
4448
|
+
return p;
|
|
4265
4449
|
}
|
|
4266
|
-
function
|
|
4450
|
+
function xt(c) {
|
|
4267
4451
|
l.push(c);
|
|
4268
4452
|
}
|
|
4269
|
-
function
|
|
4270
|
-
delete
|
|
4453
|
+
function Yt(c) {
|
|
4454
|
+
delete m[c], Ce(c);
|
|
4271
4455
|
}
|
|
4272
|
-
function er(c,
|
|
4273
|
-
a.push({ name: c, callback:
|
|
4456
|
+
function er(c, p) {
|
|
4457
|
+
a.push({ name: c, callback: p });
|
|
4274
4458
|
}
|
|
4275
|
-
function
|
|
4459
|
+
function Le(c) {
|
|
4276
4460
|
C(this, {
|
|
4277
|
-
id:
|
|
4278
|
-
create:
|
|
4461
|
+
id: Ni++,
|
|
4462
|
+
create: z,
|
|
4279
4463
|
vm: c,
|
|
4280
|
-
manager:
|
|
4464
|
+
manager: vi(t.manager),
|
|
4281
4465
|
parsers: r,
|
|
4282
4466
|
providers: u,
|
|
4283
4467
|
modelFields: s,
|
|
4284
4468
|
formulas: _,
|
|
4285
|
-
isMobile:
|
|
4469
|
+
isMobile: g,
|
|
4286
4470
|
rules: c.$options.propsData.rule,
|
|
4287
4471
|
name: c.$options.propsData.name || Ae(),
|
|
4288
4472
|
inFor: c.$options.propsData.inFor,
|
|
@@ -4294,7 +4478,7 @@ function Wt(t) {
|
|
|
4294
4478
|
drivers: n,
|
|
4295
4479
|
renderDriver: null,
|
|
4296
4480
|
refreshData: Ce,
|
|
4297
|
-
loadData:
|
|
4481
|
+
loadData: m,
|
|
4298
4482
|
CreateNode: $,
|
|
4299
4483
|
bus: new Fi(),
|
|
4300
4484
|
unwatch: [],
|
|
@@ -4302,60 +4486,60 @@ function Wt(t) {
|
|
|
4302
4486
|
extendApiFn: l,
|
|
4303
4487
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4304
4488
|
tmpData: ie({})
|
|
4305
|
-
}), a.forEach((
|
|
4306
|
-
this.bus.$on(
|
|
4489
|
+
}), a.forEach((p) => {
|
|
4490
|
+
this.bus.$on(p.name, p.callback);
|
|
4307
4491
|
}), A(() => {
|
|
4308
|
-
|
|
4492
|
+
B(this.options, () => {
|
|
4309
4493
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4310
4494
|
}, { deep: !0 });
|
|
4311
4495
|
}), C(c.$options.components, e), C(c.$options.directives, i), this.$handle = new K(this), this.name && (this.inFor ? (M[this.name] || (M[this.name] = []), M[this.name].push(this)) : M[this.name] = this);
|
|
4312
4496
|
}
|
|
4313
|
-
|
|
4497
|
+
Le.isMobile = g, C(Le.prototype, {
|
|
4314
4498
|
init() {
|
|
4315
|
-
this.isSub() && this.unwatch.push(
|
|
4499
|
+
this.isSub() && this.unwatch.push(B(() => this.vm.parent.fc.options.value, () => {
|
|
4316
4500
|
this.initOptions(), this.$handle.api.refresh();
|
|
4317
4501
|
}, { 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.fc.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
|
|
4318
4502
|
},
|
|
4319
|
-
targetFormDriver(c, ...
|
|
4503
|
+
targetFormDriver(c, ...p) {
|
|
4320
4504
|
if (this.renderDriver && this.renderDriver[c])
|
|
4321
|
-
return O(() => this.renderDriver[c](...
|
|
4505
|
+
return O(() => this.renderDriver[c](...p));
|
|
4322
4506
|
},
|
|
4323
|
-
t(c,
|
|
4324
|
-
let
|
|
4325
|
-
return
|
|
4507
|
+
t(c, p, y) {
|
|
4508
|
+
let b = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
4509
|
+
return b == null && (b = ""), b && p && Object.keys(p).forEach((w) => {
|
|
4326
4510
|
const j = new RegExp(`{${w}}`, "g");
|
|
4327
|
-
|
|
4328
|
-
}),
|
|
4511
|
+
b = b.replace(j, p[w]);
|
|
4512
|
+
}), b;
|
|
4329
4513
|
},
|
|
4330
4514
|
globalDataDriver(c) {
|
|
4331
|
-
let
|
|
4332
|
-
const y =
|
|
4333
|
-
if (
|
|
4334
|
-
if (
|
|
4335
|
-
return
|
|
4515
|
+
let p = c.split(".");
|
|
4516
|
+
const y = p.shift(), b = this.options.value.globalData && this.options.value.globalData[y];
|
|
4517
|
+
if (b) {
|
|
4518
|
+
if (b.type === "static")
|
|
4519
|
+
return L(b.data, p);
|
|
4336
4520
|
{
|
|
4337
4521
|
let w;
|
|
4338
|
-
const j = this.fetchCache.get(
|
|
4522
|
+
const j = this.fetchCache.get(b);
|
|
4339
4523
|
if (j) {
|
|
4340
|
-
if (j.status && (w =
|
|
4524
|
+
if (j.status && (w = L(j.data, p)), !j.loading)
|
|
4341
4525
|
return w;
|
|
4342
|
-
j.loading = !1, this.fetchCache.set(
|
|
4526
|
+
j.loading = !1, this.fetchCache.set(b, j);
|
|
4343
4527
|
} else
|
|
4344
|
-
this.fetchCache.set(
|
|
4345
|
-
const
|
|
4528
|
+
this.fetchCache.set(b, { status: !1 });
|
|
4529
|
+
const R = ne(() => {
|
|
4346
4530
|
le();
|
|
4347
|
-
const
|
|
4348
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(
|
|
4349
|
-
},
|
|
4350
|
-
this.fetchCache.set(
|
|
4351
|
-
}, X = (
|
|
4352
|
-
if (ue &&
|
|
4531
|
+
const J = this.fetchCache.get(b);
|
|
4532
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (J && (J.loading = !0, this.fetchCache.set(b, J)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(b);
|
|
4533
|
+
}, b.wait || 600), ae = (J) => {
|
|
4534
|
+
this.fetchCache.set(b, { status: !0, data: J }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4535
|
+
}, X = (J, ue) => {
|
|
4536
|
+
if (ue && b.watch === !1)
|
|
4353
4537
|
return le();
|
|
4354
4538
|
if (ue) {
|
|
4355
|
-
|
|
4539
|
+
R();
|
|
4356
4540
|
return;
|
|
4357
4541
|
}
|
|
4358
|
-
const pe = this.$handle.loadFetchVar(
|
|
4542
|
+
const pe = this.$handle.loadFetchVar(Je(b), J);
|
|
4359
4543
|
this.$handle.api.fetch(pe).then((te) => {
|
|
4360
4544
|
ae(te);
|
|
4361
4545
|
}).catch((te) => {
|
|
@@ -4371,35 +4555,35 @@ function Wt(t) {
|
|
|
4371
4555
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4372
4556
|
},
|
|
4373
4557
|
globalLanguageDriver(c) {
|
|
4374
|
-
let
|
|
4375
|
-
if (
|
|
4376
|
-
const
|
|
4377
|
-
y =
|
|
4558
|
+
let p = this.vm.top.$props.locale, y;
|
|
4559
|
+
if (p && typeof p == "object" && (y = L(p, c)), y == null) {
|
|
4560
|
+
const b = this.options.value.language || {}, w = this.getLocale();
|
|
4561
|
+
y = L(b[w] || {}, c), y == null && (y = L(Vi[w] || {}, c));
|
|
4378
4562
|
}
|
|
4379
4563
|
return y;
|
|
4380
4564
|
},
|
|
4381
4565
|
globalVarDriver(c) {
|
|
4382
|
-
let
|
|
4383
|
-
const y =
|
|
4384
|
-
if (
|
|
4385
|
-
const w = h.Function(
|
|
4566
|
+
let p = c.split(".");
|
|
4567
|
+
const y = p.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4568
|
+
if (b) {
|
|
4569
|
+
const w = h.Function(b) ? b : W(b.handle);
|
|
4386
4570
|
if (w) {
|
|
4387
4571
|
let j;
|
|
4388
|
-
const
|
|
4389
|
-
X ? (this.bus.$emit("$loadData.$var." + y),
|
|
4572
|
+
const R = this.watchLoadData((ae, X) => {
|
|
4573
|
+
X ? (this.bus.$emit("$loadData.$var." + y), R()) : j = w(ae, this.$handle.api);
|
|
4390
4574
|
});
|
|
4391
|
-
return this.unwatch.push(
|
|
4575
|
+
return this.unwatch.push(R), L(j, p);
|
|
4392
4576
|
}
|
|
4393
4577
|
}
|
|
4394
4578
|
},
|
|
4395
|
-
setData(c,
|
|
4396
|
-
y ? Pe(c,
|
|
4579
|
+
setData(c, p, y) {
|
|
4580
|
+
y ? Pe(c, p) : (se(this.vm.top.fc.tmpData, c, p), this.bus.$emit("$loadData." + c));
|
|
4397
4581
|
},
|
|
4398
|
-
getLoadData(c,
|
|
4582
|
+
getLoadData(c, p) {
|
|
4399
4583
|
let y = null;
|
|
4400
4584
|
if (c != null) {
|
|
4401
|
-
let
|
|
4402
|
-
const w =
|
|
4585
|
+
let b = c.split(".");
|
|
4586
|
+
const w = b.shift();
|
|
4403
4587
|
if (w === "$topForm")
|
|
4404
4588
|
y = this.$handle.api.top.formData(!0);
|
|
4405
4589
|
else if (w === "$scopeForm")
|
|
@@ -4409,53 +4593,53 @@ function Wt(t) {
|
|
|
4409
4593
|
else if (w === "$options")
|
|
4410
4594
|
y = this.options.value;
|
|
4411
4595
|
else if (w === "$globalData")
|
|
4412
|
-
y = this.globalDataDriver(
|
|
4596
|
+
y = this.globalDataDriver(b.join(".")), b = [];
|
|
4413
4597
|
else if (w === "$var")
|
|
4414
|
-
y = this.globalVarDriver(
|
|
4598
|
+
y = this.globalVarDriver(b.join(".")), b = [];
|
|
4415
4599
|
else if (w === "$locale")
|
|
4416
|
-
y = this.getLocale(),
|
|
4600
|
+
y = this.getLocale(), b = [];
|
|
4417
4601
|
else if (w === "$t")
|
|
4418
|
-
y = this.globalLanguageDriver(
|
|
4602
|
+
y = this.globalLanguageDriver(b.join(".")), b = [];
|
|
4419
4603
|
else {
|
|
4420
4604
|
if (w === "$preview")
|
|
4421
4605
|
return this.$handle.preview;
|
|
4422
4606
|
{
|
|
4423
4607
|
const j = this.vm.top.fc.tmpData;
|
|
4424
|
-
E(j, w) || S(j, w,
|
|
4608
|
+
E(j, w) || S(j, w, ke), y = j[w] !== ke ? L(j, c) : nt(c), b = [];
|
|
4425
4609
|
}
|
|
4426
4610
|
}
|
|
4427
|
-
y &&
|
|
4611
|
+
y && b.length && (y = L(y, b));
|
|
4428
4612
|
}
|
|
4429
|
-
return y == null || y === "" ?
|
|
4613
|
+
return y == null || y === "" ? p : y;
|
|
4430
4614
|
},
|
|
4431
|
-
watchLoadData(c,
|
|
4615
|
+
watchLoadData(c, p) {
|
|
4432
4616
|
let y = {};
|
|
4433
|
-
const
|
|
4617
|
+
const b = (R) => {
|
|
4434
4618
|
this.get || (this.get = w), O(() => {
|
|
4435
|
-
c(w,
|
|
4619
|
+
c(w, R);
|
|
4436
4620
|
}), this.get === w && (this.get = void 0);
|
|
4437
|
-
}, w = (
|
|
4621
|
+
}, w = (R, ae) => {
|
|
4438
4622
|
let X;
|
|
4439
|
-
if (typeof
|
|
4440
|
-
return y[
|
|
4441
|
-
const le = ge(() => X ? X() : this.getLoadData(
|
|
4442
|
-
const
|
|
4443
|
-
if (y[
|
|
4444
|
-
JSON.stringify(
|
|
4623
|
+
if (typeof R == "object" && (X = R.getValue, R = R.id), y[R])
|
|
4624
|
+
return y[R].val;
|
|
4625
|
+
const le = ge(() => X ? X() : this.getLoadData(R, ae)), J = R.split("."), ue = J.shift(), pe = J.shift() || "", te = ne(() => {
|
|
4626
|
+
const Be = X ? X() : this.getLoadData(R, ae);
|
|
4627
|
+
if (y[R])
|
|
4628
|
+
JSON.stringify(Be) !== JSON.stringify(y[R].val) && (y[R].val = Be, b(!0));
|
|
4445
4629
|
else return;
|
|
4446
|
-
},
|
|
4630
|
+
}, p || 0), rr = B(le, (Be) => {
|
|
4447
4631
|
te();
|
|
4448
4632
|
});
|
|
4449
|
-
return this.bus.$on("$loadData." + ue, te), pe && this.bus.$on("$loadData." + ue + "." + pe, te), y[
|
|
4633
|
+
return this.bus.$on("$loadData." + ue, te), pe && this.bus.$on("$loadData." + ue + "." + pe, te), y[R] = {
|
|
4450
4634
|
fn: () => {
|
|
4451
4635
|
this.bus.$off("$loadData." + ue, te), pe && this.bus.$off("$loadData." + ue + "." + pe, te), rr();
|
|
4452
4636
|
},
|
|
4453
4637
|
val: le.value
|
|
4454
4638
|
}, le.value;
|
|
4455
4639
|
};
|
|
4456
|
-
|
|
4640
|
+
b(!1);
|
|
4457
4641
|
const j = () => {
|
|
4458
|
-
Object.keys(y).forEach((
|
|
4642
|
+
Object.keys(y).forEach((R) => y[R].fn()), y = {};
|
|
4459
4643
|
};
|
|
4460
4644
|
return this.unwatch.push(j), j;
|
|
4461
4645
|
},
|
|
@@ -4464,19 +4648,19 @@ function Wt(t) {
|
|
|
4464
4648
|
},
|
|
4465
4649
|
initOptions() {
|
|
4466
4650
|
this.options.value = {};
|
|
4467
|
-
let c =
|
|
4651
|
+
let c = v({
|
|
4468
4652
|
formData: {},
|
|
4469
4653
|
submitBtn: {},
|
|
4470
4654
|
resetBtn: {},
|
|
4471
4655
|
globalEvent: {},
|
|
4472
4656
|
globalData: {}
|
|
4473
|
-
}, G(
|
|
4657
|
+
}, G(d));
|
|
4474
4658
|
this.isSub() && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$options.propsData.option || {}), this.updateOptions(c);
|
|
4475
4659
|
},
|
|
4476
|
-
mergeOptions(c,
|
|
4477
|
-
return
|
|
4478
|
-
delete
|
|
4479
|
-
}),
|
|
4660
|
+
mergeOptions(c, p, y) {
|
|
4661
|
+
return p = v({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4662
|
+
delete p[b];
|
|
4663
|
+
}), p.global && (c.global = Hr(c.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], c), c;
|
|
4480
4664
|
},
|
|
4481
4665
|
updateOptions(c) {
|
|
4482
4666
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4509,19 +4693,19 @@ function Wt(t) {
|
|
|
4509
4693
|
C(c, {
|
|
4510
4694
|
version: t.version,
|
|
4511
4695
|
ui: t.ui,
|
|
4512
|
-
isMobile:
|
|
4513
|
-
extendApi:
|
|
4696
|
+
isMobile: g,
|
|
4697
|
+
extendApi: xt,
|
|
4514
4698
|
getData: nt,
|
|
4515
4699
|
setDataDriver: we,
|
|
4516
4700
|
setData: Pe,
|
|
4517
|
-
removeData:
|
|
4701
|
+
removeData: Yt,
|
|
4518
4702
|
refreshData: Ce,
|
|
4519
4703
|
maker: f,
|
|
4520
4704
|
component: F,
|
|
4521
4705
|
directive: T,
|
|
4522
4706
|
setModelField: Xt,
|
|
4523
|
-
setFormula:
|
|
4524
|
-
setDriver:
|
|
4707
|
+
setFormula: Zt,
|
|
4708
|
+
setDriver: Qt,
|
|
4525
4709
|
register: ce,
|
|
4526
4710
|
$vnode: N,
|
|
4527
4711
|
parser: he,
|
|
@@ -4529,13 +4713,13 @@ function Wt(t) {
|
|
|
4529
4713
|
factory: Kt,
|
|
4530
4714
|
componentAlias: Ve,
|
|
4531
4715
|
copyRule: Pt,
|
|
4532
|
-
copyRules:
|
|
4533
|
-
mergeRule:
|
|
4716
|
+
copyRules: Lt,
|
|
4717
|
+
mergeRule: Y,
|
|
4534
4718
|
fetch: Ut,
|
|
4535
|
-
$form:
|
|
4536
|
-
parseFn:
|
|
4719
|
+
$form: k,
|
|
4720
|
+
parseFn: W,
|
|
4537
4721
|
parseJson: Vt,
|
|
4538
|
-
toJson:
|
|
4722
|
+
toJson: ve,
|
|
4539
4723
|
useApp: P,
|
|
4540
4724
|
getApi: ee,
|
|
4541
4725
|
on: er
|
|
@@ -4543,26 +4727,26 @@ function Wt(t) {
|
|
|
4543
4727
|
}
|
|
4544
4728
|
function tr(c) {
|
|
4545
4729
|
C(c, {
|
|
4546
|
-
create:
|
|
4547
|
-
install(
|
|
4548
|
-
if (
|
|
4549
|
-
|
|
4550
|
-
const
|
|
4551
|
-
return
|
|
4730
|
+
create: z,
|
|
4731
|
+
install(p, y) {
|
|
4732
|
+
if (d = v(v({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4733
|
+
p._installedFormCreate = !0;
|
|
4734
|
+
const b = function(j, R = {}) {
|
|
4735
|
+
return z(j, R, this);
|
|
4552
4736
|
};
|
|
4553
|
-
st(
|
|
4554
|
-
const w =
|
|
4555
|
-
|
|
4556
|
-
O(() => j(c,
|
|
4737
|
+
st(b), p.prototype.$formCreate = b;
|
|
4738
|
+
const w = k();
|
|
4739
|
+
p.component(w.name, w), p.component("FcFragment", N()), o.forEach((j) => {
|
|
4740
|
+
O(() => j(c, p));
|
|
4557
4741
|
});
|
|
4558
4742
|
}
|
|
4559
4743
|
});
|
|
4560
4744
|
}
|
|
4561
|
-
if (st(D), tr(D), we("$cookie", ji), we("$localStorage", Ii), we("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install &&
|
|
4745
|
+
if (st(D), tr(D), we("$cookie", ji), we("$localStorage", Ii), we("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install && z.use(t), he(ki), t.inherit) {
|
|
4562
4746
|
const c = t.inherit;
|
|
4563
|
-
c.components && C(e, c.components), c.parsers && C(r, c.parsers), c.directives && C(i, c.directives), c.modelFields && C(s, c.modelFields), c.providers && C(u, c.providers), c.useApps && C(o, c.useApps), c.maker && C(f, c.maker), c.loadData && C(
|
|
4747
|
+
c.components && C(e, c.components), c.parsers && C(r, c.parsers), c.directives && C(i, c.directives), c.modelFields && C(s, c.modelFields), c.providers && C(u, c.providers), c.useApps && C(o, c.useApps), c.maker && C(f, c.maker), c.loadData && C(m, c.loadData), c.formulas && C(_, c.formulas);
|
|
4564
4748
|
}
|
|
4565
|
-
const Oe =
|
|
4749
|
+
const Oe = k();
|
|
4566
4750
|
return Se(Oe, D), Object.defineProperties(Oe, {
|
|
4567
4751
|
fetch: {
|
|
4568
4752
|
get() {
|
|
@@ -4582,10 +4766,10 @@ function Ue(t) {
|
|
|
4582
4766
|
return e.toString() === "Invalid Date" ? t : e;
|
|
4583
4767
|
}
|
|
4584
4768
|
}
|
|
4585
|
-
const
|
|
4586
|
-
name:
|
|
4769
|
+
const vt = "datePicker", Mi = {
|
|
4770
|
+
name: vt,
|
|
4587
4771
|
maker: function() {
|
|
4588
|
-
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = V(
|
|
4772
|
+
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = V(vt, { type: e.toLowerCase() }), t), {});
|
|
4589
4773
|
}(),
|
|
4590
4774
|
mergeProp(t) {
|
|
4591
4775
|
let e = t.prop.props;
|
|
@@ -4614,7 +4798,7 @@ const bt = "datePicker", Ni = {
|
|
|
4614
4798
|
mounted(t) {
|
|
4615
4799
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
4616
4800
|
}
|
|
4617
|
-
}, qe = "hidden",
|
|
4801
|
+
}, qe = "hidden", Ui = {
|
|
4618
4802
|
name: qe,
|
|
4619
4803
|
maker: {
|
|
4620
4804
|
[qe]: (t, e) => V(qe)("", t, e)
|
|
@@ -4622,7 +4806,7 @@ const bt = "datePicker", Ni = {
|
|
|
4622
4806
|
render() {
|
|
4623
4807
|
return [];
|
|
4624
4808
|
}
|
|
4625
|
-
}, Ge = "input",
|
|
4809
|
+
}, Ge = "input", qi = {
|
|
4626
4810
|
name: Ge,
|
|
4627
4811
|
maker: function() {
|
|
4628
4812
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = V(Ge, { type: r }), e), {});
|
|
@@ -4632,7 +4816,7 @@ const bt = "datePicker", Ni = {
|
|
|
4632
4816
|
let { props: e } = t.prop;
|
|
4633
4817
|
e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4634
4818
|
}
|
|
4635
|
-
}, _t = "slider",
|
|
4819
|
+
}, _t = "slider", Gi = {
|
|
4636
4820
|
name: _t,
|
|
4637
4821
|
maker: {
|
|
4638
4822
|
sliderRange: V(_t, { range: !0 })
|
|
@@ -4641,13 +4825,13 @@ const bt = "datePicker", Ni = {
|
|
|
4641
4825
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
4642
4826
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
4643
4827
|
}
|
|
4644
|
-
},
|
|
4828
|
+
}, Hi = {
|
|
4645
4829
|
name: "switch",
|
|
4646
4830
|
mergeProp(t) {
|
|
4647
4831
|
const e = t.prop.props.slot || {}, r = t.prop.scopedSlots || {};
|
|
4648
4832
|
e.open && (r.open = () => e.open), e.close && (r.close = () => e.close), t.prop.scopedSlots = r;
|
|
4649
4833
|
}
|
|
4650
|
-
},
|
|
4834
|
+
}, zi = {
|
|
4651
4835
|
name: "FcRow",
|
|
4652
4836
|
render(t, e) {
|
|
4653
4837
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
@@ -4655,12 +4839,12 @@ const bt = "datePicker", Ni = {
|
|
|
4655
4839
|
]);
|
|
4656
4840
|
}
|
|
4657
4841
|
}, Ji = [
|
|
4658
|
-
Ni,
|
|
4659
4842
|
Mi,
|
|
4660
4843
|
Ui,
|
|
4661
4844
|
qi,
|
|
4662
4845
|
Gi,
|
|
4663
|
-
Hi
|
|
4846
|
+
Hi,
|
|
4847
|
+
zi
|
|
4664
4848
|
], Wi = {
|
|
4665
4849
|
button: "iButton",
|
|
4666
4850
|
icon: "Icon",
|
|
@@ -4693,7 +4877,7 @@ const bt = "datePicker", Ni = {
|
|
|
4693
4877
|
resetBtnIcon: "md-refresh",
|
|
4694
4878
|
infoIcon: "ios-information-circle-outline"
|
|
4695
4879
|
};
|
|
4696
|
-
function
|
|
4880
|
+
function Ki() {
|
|
4697
4881
|
return {
|
|
4698
4882
|
type: "poptip",
|
|
4699
4883
|
trigger: "hover",
|
|
@@ -4702,7 +4886,7 @@ function zi() {
|
|
|
4702
4886
|
icon: je.infoIcon
|
|
4703
4887
|
};
|
|
4704
4888
|
}
|
|
4705
|
-
function
|
|
4889
|
+
function Xi() {
|
|
4706
4890
|
return {
|
|
4707
4891
|
form: {
|
|
4708
4892
|
inline: !1,
|
|
@@ -4737,14 +4921,14 @@ function Ki() {
|
|
|
4737
4921
|
function Ct(t, e) {
|
|
4738
4922
|
E(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4739
4923
|
}
|
|
4740
|
-
function
|
|
4924
|
+
function Z(t) {
|
|
4741
4925
|
return t === !1;
|
|
4742
4926
|
}
|
|
4743
|
-
function
|
|
4927
|
+
function Zi(t, e) {
|
|
4744
4928
|
E(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4745
4929
|
}
|
|
4746
4930
|
function He(t) {
|
|
4747
|
-
const e =
|
|
4931
|
+
const e = v({}, t);
|
|
4748
4932
|
return delete e.children, e;
|
|
4749
4933
|
}
|
|
4750
4934
|
const Qi = {
|
|
@@ -4766,7 +4950,7 @@ const Qi = {
|
|
|
4766
4950
|
},
|
|
4767
4951
|
tidyOptions(t) {
|
|
4768
4952
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
4769
|
-
|
|
4953
|
+
Zi(t, e);
|
|
4770
4954
|
}), t;
|
|
4771
4955
|
},
|
|
4772
4956
|
tidyRule({ prop: t }) {
|
|
@@ -4774,49 +4958,48 @@ const Qi = {
|
|
|
4774
4958
|
},
|
|
4775
4959
|
mergeProp(t) {
|
|
4776
4960
|
const e = {
|
|
4777
|
-
info:
|
|
4961
|
+
info: Ki(),
|
|
4778
4962
|
title: {},
|
|
4779
4963
|
col: { span: 24 },
|
|
4780
4964
|
wrap: {}
|
|
4781
4965
|
};
|
|
4782
4966
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4783
|
-
t.prop[r] =
|
|
4967
|
+
t.prop[r] = x([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4784
4968
|
}), this.setSize(t.prop.props);
|
|
4785
4969
|
},
|
|
4786
4970
|
setSize(t) {
|
|
4787
4971
|
!t.size && this.options.form.size && (t.size = this.options.form.size);
|
|
4788
4972
|
},
|
|
4789
4973
|
getDefaultOptions() {
|
|
4790
|
-
return
|
|
4974
|
+
return Xi();
|
|
4791
4975
|
},
|
|
4792
4976
|
update() {
|
|
4793
4977
|
const t = this.options.form;
|
|
4794
4978
|
this.rule = {
|
|
4795
|
-
props:
|
|
4979
|
+
props: v({}, t),
|
|
4796
4980
|
nativeOn: {
|
|
4797
4981
|
submit: (e) => {
|
|
4798
4982
|
e.preventDefault();
|
|
4799
4983
|
}
|
|
4800
4984
|
},
|
|
4801
|
-
class: [t.className, t.class, "form-create", this.$handle.preview ? "is-preview" : ""],
|
|
4802
4985
|
style: t.style,
|
|
4803
4986
|
type: "form"
|
|
4804
4987
|
};
|
|
4805
4988
|
},
|
|
4806
4989
|
beforeRender() {
|
|
4807
|
-
const { key: t, ref: e, $handle: r } = this;
|
|
4808
|
-
C(this.rule, { key: t, ref: e }), C(this.rule.props, {
|
|
4990
|
+
const { key: t, ref: e, $handle: r } = this, i = this.options.form;
|
|
4991
|
+
C(this.rule, { key: t, ref: e, class: [i.className, i.class, "form-create", this.$handle.preview ? "is-preview" : ""] }), C(this.rule.props, {
|
|
4809
4992
|
model: r.formData
|
|
4810
4993
|
});
|
|
4811
4994
|
},
|
|
4812
4995
|
render(t) {
|
|
4813
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4996
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Z(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4814
4997
|
},
|
|
4815
4998
|
makeWrap(t, e) {
|
|
4816
4999
|
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;
|
|
4817
5000
|
delete r.wrap.title;
|
|
4818
|
-
const u =
|
|
4819
|
-
props: U(
|
|
5001
|
+
const u = Z(r.wrap.show) ? e : this.$r(x([r.wrap, {
|
|
5002
|
+
props: U(v({
|
|
4820
5003
|
labelWidth: o
|
|
4821
5004
|
}, He(r.wrap || {})), {
|
|
4822
5005
|
prop: t.id,
|
|
@@ -4826,22 +5009,22 @@ const Qi = {
|
|
|
4826
5009
|
key: `${i}fi`,
|
|
4827
5010
|
ref: t.wrapRef,
|
|
4828
5011
|
type: "formItem"
|
|
4829
|
-
}]),
|
|
4830
|
-
return a === !0 ||
|
|
5012
|
+
}]), v({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
5013
|
+
return a === !0 || Z(l) || Z(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4831
5014
|
},
|
|
4832
5015
|
isTitle(t) {
|
|
4833
5016
|
if (this.options.form.title === !1) return !1;
|
|
4834
5017
|
const e = t.title;
|
|
4835
|
-
return !(!e.title && !e.native ||
|
|
5018
|
+
return !(!e.title && !e.native || Z(e.show));
|
|
4836
5019
|
},
|
|
4837
5020
|
makeInfo(t, e, r) {
|
|
4838
|
-
var u, f,
|
|
4839
|
-
const i =
|
|
5021
|
+
var u, f, d, g, m, $;
|
|
5022
|
+
const i = v({}, t.title), s = v({}, t.info), n = this.options.form, o = this.getSlot("title"), a = [o ? o({
|
|
4840
5023
|
title: (f = (u = r.refRule) == null ? void 0 : u.__$title) == null ? void 0 : f.value,
|
|
4841
5024
|
rule: r.rule,
|
|
4842
5025
|
options: this.options
|
|
4843
|
-
}) : ((
|
|
4844
|
-
if (!
|
|
5026
|
+
}) : ((g = (d = r.refRule) == null ? void 0 : d.__$title) == null ? void 0 : g.value) + (n.labelSuffix || n["label-suffix"] || "")];
|
|
5027
|
+
if (!Z(s.show) && (s.info || s.native) && !Z(s.icon)) {
|
|
4845
5028
|
const _ = {
|
|
4846
5029
|
type: s.type || "poptip",
|
|
4847
5030
|
props: He(s),
|
|
@@ -4850,7 +5033,7 @@ const Qi = {
|
|
|
4850
5033
|
};
|
|
4851
5034
|
delete _.props.icon, delete _.props.show, delete _.props.info, delete _.props.align, delete _.props.native;
|
|
4852
5035
|
const D = "content";
|
|
4853
|
-
s.info && !E(_.props, D) && (_.props[D] = ($ = (
|
|
5036
|
+
s.info && !E(_.props, D) && (_.props[D] = ($ = (m = r.refRule) == null ? void 0 : m.__$info) == null ? void 0 : $.value), a[s.align !== "left" ? "unshift" : "push"](this.$r(x([s, _]), [
|
|
4854
5037
|
this.$r({
|
|
4855
5038
|
type: "icon",
|
|
4856
5039
|
props: { type: s.icon === !0 ? je.infoIcon : s.icon, size: 16 },
|
|
@@ -4859,7 +5042,7 @@ const Qi = {
|
|
|
4859
5042
|
})
|
|
4860
5043
|
]));
|
|
4861
5044
|
}
|
|
4862
|
-
const l =
|
|
5045
|
+
const l = x([i, {
|
|
4863
5046
|
props: He(i),
|
|
4864
5047
|
key: `${e}tit`,
|
|
4865
5048
|
class: "fc-form-title",
|
|
@@ -4888,7 +5071,7 @@ const Qi = {
|
|
|
4888
5071
|
},
|
|
4889
5072
|
makeFormBtn() {
|
|
4890
5073
|
let t = [];
|
|
4891
|
-
if (
|
|
5074
|
+
if (Z(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Z(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4892
5075
|
return;
|
|
4893
5076
|
const e = this.$r({
|
|
4894
5077
|
type: "formItem",
|
|
@@ -4903,7 +5086,7 @@ const Qi = {
|
|
|
4903
5086
|
}, [e]);
|
|
4904
5087
|
},
|
|
4905
5088
|
makeResetBtn() {
|
|
4906
|
-
const t =
|
|
5089
|
+
const t = v({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
|
|
4907
5090
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
4908
5091
|
type: "button",
|
|
4909
5092
|
props: t,
|
|
@@ -4919,7 +5102,7 @@ const Qi = {
|
|
|
4919
5102
|
}, [e]);
|
|
4920
5103
|
},
|
|
4921
5104
|
makeSubmitBtn() {
|
|
4922
|
-
const t =
|
|
5105
|
+
const t = v({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
|
|
4923
5106
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
4924
5107
|
type: "button",
|
|
4925
5108
|
props: t,
|
|
@@ -4935,13 +5118,13 @@ const Qi = {
|
|
|
4935
5118
|
key: `${this.key}b1`
|
|
4936
5119
|
}, [e]);
|
|
4937
5120
|
}
|
|
4938
|
-
}, oe = {},
|
|
5121
|
+
}, oe = {}, xi = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4939
5122
|
function Yi(t) {
|
|
4940
|
-
|
|
5123
|
+
xi.forEach((e) => {
|
|
4941
5124
|
t[e] = V(e);
|
|
4942
5125
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4943
5126
|
}
|
|
4944
|
-
function
|
|
5127
|
+
function en(t) {
|
|
4945
5128
|
const e = "upload", r = {
|
|
4946
5129
|
image: ["image", 0],
|
|
4947
5130
|
file: ["file", 0],
|
|
@@ -4950,19 +5133,19 @@ function xi(t) {
|
|
|
4950
5133
|
};
|
|
4951
5134
|
Object.keys(r).reduce((i, s) => (i[s] = V(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4952
5135
|
}
|
|
4953
|
-
function
|
|
5136
|
+
function tn(t) {
|
|
4954
5137
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4955
5138
|
Object.keys(r).reduce((i, s) => (i[s] = V(e, { type: r[s] }), i), t);
|
|
4956
5139
|
}
|
|
4957
|
-
function
|
|
5140
|
+
function rn(t) {
|
|
4958
5141
|
const e = "timePicker";
|
|
4959
5142
|
t.time = V(e, { type: "time" }), t.timeRange = V(e, { type: "timerange" });
|
|
4960
5143
|
}
|
|
4961
|
-
function
|
|
5144
|
+
function nn(t) {
|
|
4962
5145
|
const e = "select";
|
|
4963
5146
|
t.selectMultiple = V(e, { multiple: !0 }), t.selectOne = V(e, { multiple: !1 });
|
|
4964
5147
|
}
|
|
4965
|
-
function
|
|
5148
|
+
function sn(t) {
|
|
4966
5149
|
const e = "frame", r = {
|
|
4967
5150
|
frameInputs: ["input", 0],
|
|
4968
5151
|
frameFiles: ["file", 0],
|
|
@@ -4974,15 +5157,15 @@ function nn(t) {
|
|
|
4974
5157
|
Object.keys(r).reduce((i, s) => (i[s] = V(e, (n) => n.props({ type: r[s][0], maxLength: r[s][1] })), i), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages;
|
|
4975
5158
|
}
|
|
4976
5159
|
Yi(oe);
|
|
4977
|
-
xi(oe);
|
|
4978
5160
|
en(oe);
|
|
4979
|
-
rn(oe);
|
|
4980
|
-
nn(oe);
|
|
4981
5161
|
tn(oe);
|
|
5162
|
+
nn(oe);
|
|
5163
|
+
sn(oe);
|
|
5164
|
+
rn(oe);
|
|
4982
5165
|
function wt(t, e) {
|
|
4983
5166
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4984
5167
|
}
|
|
4985
|
-
function
|
|
5168
|
+
function on(t, e) {
|
|
4986
5169
|
return {
|
|
4987
5170
|
formEl() {
|
|
4988
5171
|
return e.$manager.form();
|
|
@@ -5069,7 +5252,10 @@ function sn(t, e) {
|
|
|
5069
5252
|
return new Promise((s, n) => {
|
|
5070
5253
|
(e.options.validateOnSubmit === !1 ? Promise.resolve() : t.validate()).then(() => {
|
|
5071
5254
|
let a = t.formData();
|
|
5072
|
-
|
|
5255
|
+
e.beforeSubmit(a).then(() => {
|
|
5256
|
+
h.Function(r) && O(() => r(a, t)), h.Function(e.options.onSubmit) && O(() => e.options.onSubmit(a, t)), e.vm.$emit("submit", a, t), s(a);
|
|
5257
|
+
}).catch((l) => {
|
|
5258
|
+
});
|
|
5073
5259
|
}).catch((...a) => {
|
|
5074
5260
|
h.Function(i) && O(() => i(t, ...a)), n(...a);
|
|
5075
5261
|
});
|
|
@@ -5077,15 +5263,15 @@ function sn(t, e) {
|
|
|
5077
5263
|
}
|
|
5078
5264
|
};
|
|
5079
5265
|
}
|
|
5080
|
-
const
|
|
5266
|
+
const Wt = {
|
|
5081
5267
|
name: "required",
|
|
5082
5268
|
load(t, e, r) {
|
|
5083
5269
|
var s, n;
|
|
5084
|
-
const i =
|
|
5270
|
+
const i = an(t.getValue());
|
|
5085
5271
|
if (i.required === !1)
|
|
5086
5272
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5087
5273
|
else {
|
|
5088
|
-
const o =
|
|
5274
|
+
const o = v({
|
|
5089
5275
|
required: !0,
|
|
5090
5276
|
validator(l, u, f) {
|
|
5091
5277
|
h.empty(u) ? f(o.message) : f();
|
|
@@ -5102,28 +5288,28 @@ const zt = {
|
|
|
5102
5288
|
r.sync(e);
|
|
5103
5289
|
},
|
|
5104
5290
|
watch(...t) {
|
|
5105
|
-
|
|
5291
|
+
Wt.load(...t);
|
|
5106
5292
|
}
|
|
5107
5293
|
};
|
|
5108
|
-
function
|
|
5294
|
+
function an(t) {
|
|
5109
5295
|
return h.Boolean(t) ? { required: t } : h.String(t) ? { message: t } : h.Undef(t) ? { required: !1 } : h.Function(t) ? { validator: t } : h.Object(t) ? t : {};
|
|
5110
5296
|
}
|
|
5111
|
-
function
|
|
5297
|
+
function ln(t) {
|
|
5112
5298
|
t.componentAlias(Wi), Nr.forEach((e) => {
|
|
5113
5299
|
t.component(e.name, e);
|
|
5114
|
-
}), t.register(
|
|
5300
|
+
}), t.register(Wt), Ji.forEach((e) => {
|
|
5115
5301
|
t.parser(e);
|
|
5116
5302
|
}), Object.keys(oe).forEach((e) => {
|
|
5117
5303
|
t.maker[e] = oe[e];
|
|
5118
5304
|
});
|
|
5119
5305
|
}
|
|
5120
|
-
function
|
|
5121
|
-
return
|
|
5306
|
+
function un() {
|
|
5307
|
+
return Jt({
|
|
5122
5308
|
ui: "view-design",
|
|
5123
|
-
version: "2.7.
|
|
5309
|
+
version: "2.7.6",
|
|
5124
5310
|
manager: Qi,
|
|
5125
|
-
install:
|
|
5126
|
-
extendApi:
|
|
5311
|
+
install: ln,
|
|
5312
|
+
extendApi: on,
|
|
5127
5313
|
attrs: {
|
|
5128
5314
|
normal: ["col", "wrap"],
|
|
5129
5315
|
array: ["className"],
|
|
@@ -5131,10 +5317,10 @@ function ln() {
|
|
|
5131
5317
|
}
|
|
5132
5318
|
});
|
|
5133
5319
|
}
|
|
5134
|
-
const
|
|
5135
|
-
typeof window != "undefined" && (window.formCreate =
|
|
5136
|
-
const
|
|
5320
|
+
const Qe = un();
|
|
5321
|
+
typeof window != "undefined" && (window.formCreate = Qe, window.Vue && Qe.install(window.Vue));
|
|
5322
|
+
const hn = Qe.maker;
|
|
5137
5323
|
export {
|
|
5138
|
-
|
|
5139
|
-
|
|
5324
|
+
Qe as default,
|
|
5325
|
+
hn as maker
|
|
5140
5326
|
};
|