@form-create/element-ui 2.6.2 → 2.6.3
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 +498 -482
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +11 -11
package/dist/form-create.esm.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/element-ui v2.6.
|
|
3
|
+
* @form-create/element-ui v2.6.3
|
|
4
4
|
* (c) 2018-2024 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
9
9
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame .fc-files:hover .fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame .fc-upload-btn,.fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-upload .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-upload .fc-files:hover .fc-upload-cover{opacity:1}._fc-upload .el-upload{display:block}._fc-upload .fc-upload-btn,._fc-upload .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-group{display:flex;min-height:42px;justify-content:center;flex-direction:column}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;padding:20px 20px 25px;margin:5px 5px 25px;border-radius:5px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}.form-create .form-create .el-form-item{margin-bottom:22px}.form-create .form-create .el-form-item .el-form-item{margin-bottom:0}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
10
|
+
var pt = Object.defineProperty, mt = Object.defineProperties;
|
|
11
|
+
var yt = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var Ee = Object.getOwnPropertySymbols;
|
|
13
|
+
var gt = Object.prototype.hasOwnProperty, $t = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var Se = (t, e, r) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, y = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
for (var r of
|
|
19
|
-
|
|
16
|
+
gt.call(e, r) && Se(t, r, e[r]);
|
|
17
|
+
if (Ee)
|
|
18
|
+
for (var r of Ee(e))
|
|
19
|
+
$t.call(e, r) && Se(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
}, N = (t, e) =>
|
|
21
|
+
}, N = (t, e) => mt(t, yt(e));
|
|
22
22
|
import T from "vue";
|
|
23
|
-
function
|
|
23
|
+
function vt(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function ae() {
|
|
27
|
+
return ae = 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
|
+
}, ae.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var bt = ["attrs", "props", "domProps"], Ct = ["class", "style", "directives"], _t = ["on", "nativeOn"], Ot = 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 (
|
|
36
|
-
else if (
|
|
35
|
+
else if (bt.indexOf(i) !== -1) e[i] = ae({}, e[i], r[i]);
|
|
36
|
+
else if (Ct.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 (_t.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]], u = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, u);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ?
|
|
44
|
+
else if (i === "hook") for (var l in r[i]) e[i][l] = e[i][l] ? kt(e[i][l], r[i][l]) : r[i][l];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, kt = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const F = /* @__PURE__ */
|
|
52
|
+
}, wt = Ot;
|
|
53
|
+
const F = /* @__PURE__ */ vt(wt);
|
|
54
54
|
function Y(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const Ft = "fcCheckbox", Et = {
|
|
58
|
+
name: Ft,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -126,8 +126,8 @@ const St = "fcCheckbox", Rt = {
|
|
|
126
126
|
function j(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
name:
|
|
129
|
+
const St = "fcFrame", Rt = {
|
|
130
|
+
name: St,
|
|
131
131
|
props: {
|
|
132
132
|
formCreateInject: {
|
|
133
133
|
type: Object,
|
|
@@ -496,8 +496,8 @@ const jt = "fcFrame", It = {
|
|
|
496
496
|
mounted() {
|
|
497
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
498
498
|
}
|
|
499
|
-
},
|
|
500
|
-
name:
|
|
499
|
+
}, jt = "fcRadio", It = {
|
|
500
|
+
name: jt,
|
|
501
501
|
props: {
|
|
502
502
|
formCreateInject: {
|
|
503
503
|
type: Object,
|
|
@@ -561,7 +561,7 @@ const jt = "fcFrame", It = {
|
|
|
561
561
|
mounted() {
|
|
562
562
|
this.$emit("fc.el", this.$refs.el);
|
|
563
563
|
}
|
|
564
|
-
},
|
|
564
|
+
}, h = {
|
|
565
565
|
type(t, e) {
|
|
566
566
|
return Object.prototype.toString.call(t) === "[object " + e + "]";
|
|
567
567
|
},
|
|
@@ -569,7 +569,7 @@ const jt = "fcFrame", It = {
|
|
|
569
569
|
return t == null;
|
|
570
570
|
},
|
|
571
571
|
Element(t) {
|
|
572
|
-
return typeof t == "object" && t !== null && t.nodeType === 1 && !
|
|
572
|
+
return typeof t == "object" && t !== null && t.nodeType === 1 && !h.Object(t);
|
|
573
573
|
},
|
|
574
574
|
trueArray(t) {
|
|
575
575
|
return Array.isArray(t) && t.length > 0;
|
|
@@ -587,15 +587,15 @@ const jt = "fcFrame", It = {
|
|
|
587
587
|
}
|
|
588
588
|
};
|
|
589
589
|
["Date", "Object", "String", "Boolean", "Array", "Number"].forEach((t) => {
|
|
590
|
-
|
|
591
|
-
return
|
|
590
|
+
h[t] = function(e) {
|
|
591
|
+
return h.type(e, t);
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
|
-
function
|
|
594
|
+
function k(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
name:
|
|
597
|
+
const At = "fcSelect", Vt = {
|
|
598
|
+
name: At,
|
|
599
599
|
functional: !0,
|
|
600
600
|
props: {
|
|
601
601
|
formCreateInject: {
|
|
@@ -612,22 +612,22 @@ const Pt = "fcSelect", Tt = {
|
|
|
612
612
|
key: "" + o + "-" + n.value
|
|
613
613
|
}]), [a ? t("template", {
|
|
614
614
|
slot: n.slotName || "default"
|
|
615
|
-
}, [
|
|
615
|
+
}, [h.Function(a) ? n.slot(t) : a]) : null]);
|
|
616
616
|
}, i = (n, o) => t("ElOptionGroup", {
|
|
617
617
|
attrs: {
|
|
618
618
|
label: n.label
|
|
619
619
|
},
|
|
620
620
|
key: "" + o + "-" + n.label
|
|
621
|
-
}, [
|
|
621
|
+
}, [h.trueArray(n.options) && n.options.map((a, u) => r(a, u))]), s = e.props.formCreateInject.options;
|
|
622
622
|
return t("ElSelect", F([{}, e.data, {
|
|
623
623
|
ref: "el"
|
|
624
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
624
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => k(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
625
625
|
},
|
|
626
626
|
mounted() {
|
|
627
627
|
this.$emit("fc.el", this.$refs.el);
|
|
628
628
|
}
|
|
629
|
-
},
|
|
630
|
-
name:
|
|
629
|
+
}, Pt = "fcTree", Tt = {
|
|
630
|
+
name: Pt,
|
|
631
631
|
formCreateParser: {
|
|
632
632
|
mergeProp(t) {
|
|
633
633
|
const e = t.prop.props;
|
|
@@ -683,18 +683,18 @@ const Pt = "fcSelect", Tt = {
|
|
|
683
683
|
this.setValue(), this.$emit("fc.el", this.$refs.tree);
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
|
-
function
|
|
686
|
+
function Re(t, e) {
|
|
687
687
|
return {
|
|
688
688
|
url: t,
|
|
689
|
-
name:
|
|
689
|
+
name: Dt(t),
|
|
690
690
|
uid: e
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function Dt(t) {
|
|
694
694
|
return ("" + t).split("/").pop();
|
|
695
695
|
}
|
|
696
|
-
const
|
|
697
|
-
name:
|
|
696
|
+
const Bt = "fcUpload", Lt = {
|
|
697
|
+
name: Bt,
|
|
698
698
|
props: {
|
|
699
699
|
formCreateInject: {
|
|
700
700
|
type: Object,
|
|
@@ -736,11 +736,11 @@ const Mt = "fcUpload", Nt = {
|
|
|
736
736
|
};
|
|
737
737
|
},
|
|
738
738
|
created() {
|
|
739
|
-
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = j(this.value).map(
|
|
739
|
+
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = j(this.value).map(Re);
|
|
740
740
|
},
|
|
741
741
|
watch: {
|
|
742
742
|
value(t) {
|
|
743
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = j(t).map(
|
|
743
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = j(t).map(Re), this.uploadList = this.$refs.upload.uploadFiles);
|
|
744
744
|
},
|
|
745
745
|
limit(t, e) {
|
|
746
746
|
(e === 1 || t === 1) && this.update();
|
|
@@ -888,7 +888,7 @@ function K(t, e = {}, r) {
|
|
|
888
888
|
for (let s in e)
|
|
889
889
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
890
890
|
let n = e[s];
|
|
891
|
-
if ((i = Array.isArray(n)) ||
|
|
891
|
+
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
892
892
|
let o = t[s] === void 0;
|
|
893
893
|
if (i)
|
|
894
894
|
i = !1, o && w(t, s, []);
|
|
@@ -903,24 +903,24 @@ function K(t, e = {}, r) {
|
|
|
903
903
|
o && w(t, s, {});
|
|
904
904
|
t[s] = K(t[s], n, r);
|
|
905
905
|
} else
|
|
906
|
-
w(t, s, n),
|
|
906
|
+
w(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
907
907
|
}
|
|
908
908
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
909
909
|
}
|
|
910
910
|
function L(t) {
|
|
911
911
|
return K({}, { value: t }).value;
|
|
912
912
|
}
|
|
913
|
-
const
|
|
913
|
+
const Mt = Object.assign || function(t) {
|
|
914
914
|
for (let e, r = 1; r < arguments.length; r++)
|
|
915
915
|
for (let i in e = arguments[r], e)
|
|
916
916
|
Object.prototype.hasOwnProperty.call(e, i) && w(t, i, e[i]);
|
|
917
917
|
return t;
|
|
918
918
|
};
|
|
919
919
|
function p() {
|
|
920
|
-
return
|
|
920
|
+
return Mt.apply(this, arguments);
|
|
921
921
|
}
|
|
922
|
-
const
|
|
923
|
-
name:
|
|
922
|
+
const Nt = "fcGroup", qt = {
|
|
923
|
+
name: Nt,
|
|
924
924
|
props: {
|
|
925
925
|
field: String,
|
|
926
926
|
rule: [Array, Object],
|
|
@@ -1041,7 +1041,7 @@ const Ut = "fcGroup", Ht = {
|
|
|
1041
1041
|
},
|
|
1042
1042
|
methods: {
|
|
1043
1043
|
_value(t) {
|
|
1044
|
-
return t &&
|
|
1044
|
+
return t && k(t, this.field) ? t[this.field] : t;
|
|
1045
1045
|
},
|
|
1046
1046
|
cache(t, e) {
|
|
1047
1047
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1221,8 +1221,8 @@ const Ut = "fcGroup", Ht = {
|
|
|
1221
1221
|
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1222
1222
|
}, [n]);
|
|
1223
1223
|
}
|
|
1224
|
-
},
|
|
1225
|
-
name:
|
|
1224
|
+
}, Ut = "fcSubForm", Ht = {
|
|
1225
|
+
name: Ut,
|
|
1226
1226
|
props: {
|
|
1227
1227
|
rule: Array,
|
|
1228
1228
|
options: Object,
|
|
@@ -1305,27 +1305,27 @@ const Ut = "fcGroup", Ht = {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
}]));
|
|
1307
1307
|
}
|
|
1308
|
-
},
|
|
1308
|
+
}, Jt = [
|
|
1309
|
+
Et,
|
|
1309
1310
|
Rt,
|
|
1310
1311
|
It,
|
|
1311
1312
|
Vt,
|
|
1312
1313
|
Tt,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
Ht
|
|
1316
|
-
|
|
1317
|
-
], Se = "FormCreate", ae = (t, e) => {
|
|
1314
|
+
Lt,
|
|
1315
|
+
qt,
|
|
1316
|
+
Ht
|
|
1317
|
+
], je = "FormCreate", le = (t, e) => {
|
|
1318
1318
|
if (!(!t || t === e)) {
|
|
1319
1319
|
if (t.formCreateInject)
|
|
1320
1320
|
return t.formCreateInject;
|
|
1321
1321
|
if (t.$parent)
|
|
1322
|
-
return
|
|
1322
|
+
return le(t.$parent, e);
|
|
1323
1323
|
}
|
|
1324
1324
|
};
|
|
1325
|
-
function
|
|
1325
|
+
function xt(t, e, r) {
|
|
1326
1326
|
return {
|
|
1327
|
-
name:
|
|
1328
|
-
componentName:
|
|
1327
|
+
name: je,
|
|
1328
|
+
componentName: je,
|
|
1329
1329
|
model: {
|
|
1330
1330
|
prop: "api"
|
|
1331
1331
|
},
|
|
@@ -1416,14 +1416,14 @@ function Wt(t, e, r) {
|
|
|
1416
1416
|
created() {
|
|
1417
1417
|
const i = this, s = this.formCreate.api(), n = () => {
|
|
1418
1418
|
if (i.$pfc) {
|
|
1419
|
-
const a =
|
|
1419
|
+
const a = le(i, i.$pfc);
|
|
1420
1420
|
if (a) {
|
|
1421
1421
|
let u;
|
|
1422
1422
|
i.isMore ? (u = j(a.getSubForm()), u.push(s)) : u = s, a.subForm(u);
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
1425
|
}, o = () => {
|
|
1426
|
-
const a =
|
|
1426
|
+
const a = le(i, i.$pfc);
|
|
1427
1427
|
if (a)
|
|
1428
1428
|
if (i.isMore) {
|
|
1429
1429
|
const u = j(a.getSubForm()), l = u.indexOf(s);
|
|
@@ -1439,8 +1439,8 @@ function Wt(t, e, r) {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
};
|
|
1441
1441
|
}
|
|
1442
|
-
const
|
|
1443
|
-
const i = [...
|
|
1442
|
+
const Ke = ["attrs", "props", "domProps", "scopedSlots"], We = ["class", "style", "directives"], Ge = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1443
|
+
const i = [...Ke, ...r.normal || []], s = [...We, ...r.array || []], n = [...Ge, ...r.functional || []], o = r.props || [];
|
|
1444
1444
|
return t.reduce((a, u) => {
|
|
1445
1445
|
for (const l in u)
|
|
1446
1446
|
if (a[l])
|
|
@@ -1460,33 +1460,33 @@ const We = ["attrs", "props", "domProps", "scopedSlots"], Ge = ["class", "style"
|
|
|
1460
1460
|
a[l][c] = u[l][c];
|
|
1461
1461
|
else if (l === "hook")
|
|
1462
1462
|
for (let c in u[l])
|
|
1463
|
-
a[l][c] ? a[l][c] =
|
|
1463
|
+
a[l][c] ? a[l][c] = Kt(a[l][c], u[l][c]) : a[l][c] = u[l][c];
|
|
1464
1464
|
else
|
|
1465
1465
|
a[l] = u[l];
|
|
1466
1466
|
else
|
|
1467
1467
|
i.indexOf(l) > -1 || n.indexOf(l) > -1 || o.indexOf(l) > -1 ? a[l] = y({}, u[l]) : s.indexOf(l) > -1 ? a[l] = u[l] instanceof Array ? [...u[l]] : typeof u[l] == "object" ? y({}, u[l]) : u[l] : a[l] = u[l];
|
|
1468
1468
|
return a;
|
|
1469
1469
|
}, e);
|
|
1470
|
-
},
|
|
1470
|
+
}, Kt = (t, e) => function() {
|
|
1471
1471
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1472
|
-
},
|
|
1473
|
-
function
|
|
1474
|
-
return [...
|
|
1472
|
+
}, Xe = ["type", "slot", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "preview", "component", "cache"], pe = ["validate", "children", "control"], me = ["effect", "deep"];
|
|
1473
|
+
function Wt() {
|
|
1474
|
+
return [...Xe, ...Ke, ...We, ...Ge, ...pe, ...me];
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function ye(t, e, r) {
|
|
1477
1477
|
return `[form-create ${t}]: ${e}`;
|
|
1478
1478
|
}
|
|
1479
|
-
function
|
|
1480
|
-
console.warn(
|
|
1479
|
+
function Gt(t, e) {
|
|
1480
|
+
console.warn(ye("tip", t));
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1483
|
-
console.error(
|
|
1482
|
+
function ge(t, e) {
|
|
1483
|
+
console.error(ye("err", t));
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1486
|
-
|
|
1485
|
+
function Xt(t) {
|
|
1486
|
+
ge(t.toString()), console.error(t);
|
|
1487
1487
|
}
|
|
1488
|
-
const
|
|
1489
|
-
function
|
|
1488
|
+
const ue = "[[FORM-CREATE-PREFIX-", fe = "-FORM-CREATE-SUFFIX]]";
|
|
1489
|
+
function ze(t, e) {
|
|
1490
1490
|
return JSON.stringify(K(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1491
1491
|
if (!(i && i._isVue === !0)) {
|
|
1492
1492
|
if (typeof i != "function")
|
|
@@ -1494,31 +1494,45 @@ function Qe(t, e) {
|
|
|
1494
1494
|
if (i.__json)
|
|
1495
1495
|
return i.__json;
|
|
1496
1496
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1497
|
-
return
|
|
1497
|
+
return ue + i + fe;
|
|
1498
1498
|
}
|
|
1499
1499
|
}, e);
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1501
|
+
function te(t) {
|
|
1502
1502
|
return new Function("return " + t)();
|
|
1503
1503
|
}
|
|
1504
1504
|
function q(t, e) {
|
|
1505
|
-
if (t &&
|
|
1505
|
+
if (t && h.String(t) && t.length > 4) {
|
|
1506
1506
|
let r = t.trim(), i = !1;
|
|
1507
1507
|
try {
|
|
1508
|
-
if (r.indexOf(
|
|
1509
|
-
r = r.replace(
|
|
1510
|
-
else if (r.indexOf(
|
|
1511
|
-
r = r.
|
|
1512
|
-
else
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1508
|
+
if (r.indexOf(fe) > 0 && r.indexOf(ue) === 0)
|
|
1509
|
+
r = r.replace(fe, "").replace(ue, ""), i = !0;
|
|
1510
|
+
else if (r.indexOf("$FN:") === 0)
|
|
1511
|
+
r = r.substring(4), i = !0;
|
|
1512
|
+
else if (r.indexOf("$EXEC:") === 0)
|
|
1513
|
+
r = r.substring(6), i = !0;
|
|
1514
|
+
else if (r.indexOf("$GLOBAL:") === 0) {
|
|
1515
|
+
const n = r.substring(8);
|
|
1516
|
+
return r = function(...o) {
|
|
1517
|
+
const a = o[0].api.getGlobalEvent(n);
|
|
1518
|
+
if (a)
|
|
1519
|
+
return a.call(this, ...o);
|
|
1520
|
+
}, r.__json = t, r.__inject = !0, r;
|
|
1521
|
+
} else {
|
|
1522
|
+
if (r.indexOf("$FNX:") === 0)
|
|
1523
|
+
return r = te("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1524
|
+
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1516
1525
|
}
|
|
1517
1526
|
if (!i) return t;
|
|
1518
|
-
|
|
1527
|
+
let s;
|
|
1528
|
+
try {
|
|
1529
|
+
s = te(r);
|
|
1530
|
+
} catch (n) {
|
|
1531
|
+
s = te("function " + r);
|
|
1532
|
+
}
|
|
1519
1533
|
return s.__json = t, s;
|
|
1520
1534
|
} catch (s) {
|
|
1521
|
-
|
|
1535
|
+
ge(`解析失败:${r}
|
|
1522
1536
|
|
|
1523
1537
|
err: ${s}`);
|
|
1524
1538
|
return;
|
|
@@ -1526,12 +1540,12 @@ err: ${s}`);
|
|
|
1526
1540
|
}
|
|
1527
1541
|
return t;
|
|
1528
1542
|
}
|
|
1529
|
-
function
|
|
1543
|
+
function zt(t, e) {
|
|
1530
1544
|
return JSON.parse(t, function(r, i) {
|
|
1531
|
-
return
|
|
1545
|
+
return h.Undef(i) || !i.indexOf ? i : q(i, e);
|
|
1532
1546
|
});
|
|
1533
1547
|
}
|
|
1534
|
-
function
|
|
1548
|
+
function he(t, e) {
|
|
1535
1549
|
return {
|
|
1536
1550
|
value: t,
|
|
1537
1551
|
enumerable: !1,
|
|
@@ -1539,25 +1553,25 @@ function Ze(t, e) {
|
|
|
1539
1553
|
writable: !!e
|
|
1540
1554
|
};
|
|
1541
1555
|
}
|
|
1542
|
-
function
|
|
1543
|
-
return
|
|
1556
|
+
function $e(t) {
|
|
1557
|
+
return Qe([t])[0];
|
|
1544
1558
|
}
|
|
1545
|
-
function
|
|
1559
|
+
function Qe(t, e) {
|
|
1546
1560
|
return K([], [...t], e || !1);
|
|
1547
1561
|
}
|
|
1548
1562
|
function U(t, e) {
|
|
1549
|
-
return D(Array.isArray(e) ? e : [e], t, { array:
|
|
1563
|
+
return D(Array.isArray(e) ? e : [e], t, { array: pe, normal: me }), t;
|
|
1550
1564
|
}
|
|
1551
|
-
function
|
|
1552
|
-
const e =
|
|
1565
|
+
function Ie(t) {
|
|
1566
|
+
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1553
1567
|
return e.type || (e.type = "input"), e;
|
|
1554
1568
|
}
|
|
1555
|
-
function
|
|
1569
|
+
function Qt(t, e) {
|
|
1556
1570
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1557
1571
|
e[r] && (t[r] = U(t[r] || {}, e[r]));
|
|
1558
1572
|
}), t) : e;
|
|
1559
1573
|
}
|
|
1560
|
-
function
|
|
1574
|
+
function Ze(t, e) {
|
|
1561
1575
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1562
1576
|
get() {
|
|
1563
1577
|
return e[i]();
|
|
@@ -1571,28 +1585,28 @@ function R(t, e) {
|
|
|
1571
1585
|
try {
|
|
1572
1586
|
e = t();
|
|
1573
1587
|
} catch (r) {
|
|
1574
|
-
|
|
1588
|
+
Xt(r);
|
|
1575
1589
|
}
|
|
1576
1590
|
return e;
|
|
1577
1591
|
}
|
|
1578
|
-
const
|
|
1579
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1580
|
-
"!=": (t, e) => !
|
|
1592
|
+
const Ae = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, x = {
|
|
1593
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Ae(t, e)),
|
|
1594
|
+
"!=": (t, e) => !x["=="](t, e),
|
|
1581
1595
|
">": (t, e) => t > e,
|
|
1582
1596
|
">=": (t, e) => t >= e,
|
|
1583
1597
|
"<": (t, e) => t < e,
|
|
1584
1598
|
"<=": (t, e) => t <= e,
|
|
1585
1599
|
on(t, e) {
|
|
1586
|
-
return t && t.indexOf && t.indexOf(
|
|
1600
|
+
return t && t.indexOf && t.indexOf(Ae(t[0], e)) > -1;
|
|
1587
1601
|
},
|
|
1588
1602
|
notOn(t, e) {
|
|
1589
|
-
return !
|
|
1603
|
+
return !x.on(t, e);
|
|
1590
1604
|
},
|
|
1591
1605
|
in(t, e) {
|
|
1592
1606
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1593
1607
|
},
|
|
1594
1608
|
notIn(t, e) {
|
|
1595
|
-
return !
|
|
1609
|
+
return !x.in(t, e);
|
|
1596
1610
|
},
|
|
1597
1611
|
between(t, e) {
|
|
1598
1612
|
return t > e[0] && t < e[1];
|
|
@@ -1601,16 +1615,16 @@ const Ve = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1601
1615
|
return t < e[0] || t > e[1];
|
|
1602
1616
|
},
|
|
1603
1617
|
empty(t) {
|
|
1604
|
-
return
|
|
1618
|
+
return h.empty(t);
|
|
1605
1619
|
},
|
|
1606
1620
|
notEmpty(t) {
|
|
1607
|
-
return !
|
|
1621
|
+
return !h.empty(t);
|
|
1608
1622
|
},
|
|
1609
1623
|
pattern(t, e) {
|
|
1610
1624
|
return new RegExp(e, "g").test(t);
|
|
1611
1625
|
}
|
|
1612
1626
|
};
|
|
1613
|
-
function
|
|
1627
|
+
function Ye() {
|
|
1614
1628
|
return {
|
|
1615
1629
|
props: {},
|
|
1616
1630
|
on: {},
|
|
@@ -1624,14 +1638,14 @@ function tt() {
|
|
|
1624
1638
|
}
|
|
1625
1639
|
function E(t, e) {
|
|
1626
1640
|
return (r, i, s, n = {}) => {
|
|
1627
|
-
const o = new
|
|
1628
|
-
return e && (
|
|
1641
|
+
const o = new ve(t, r, i, s, n);
|
|
1642
|
+
return e && (h.Function(e) ? e(o) : o.props(e)), o;
|
|
1629
1643
|
};
|
|
1630
1644
|
}
|
|
1631
|
-
function
|
|
1632
|
-
this._data = p(
|
|
1645
|
+
function ve(t, e, r, i, s) {
|
|
1646
|
+
this._data = p(Ye(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1633
1647
|
}
|
|
1634
|
-
p(
|
|
1648
|
+
p(ve.prototype, {
|
|
1635
1649
|
getRule() {
|
|
1636
1650
|
return this._data;
|
|
1637
1651
|
},
|
|
@@ -1640,39 +1654,39 @@ p(ge.prototype, {
|
|
|
1640
1654
|
},
|
|
1641
1655
|
_clone() {
|
|
1642
1656
|
const t = new this.constructor();
|
|
1643
|
-
return t._data =
|
|
1657
|
+
return t._data = $e(this._data), t;
|
|
1644
1658
|
}
|
|
1645
1659
|
});
|
|
1646
|
-
function
|
|
1660
|
+
function et(t) {
|
|
1647
1661
|
t.forEach((e) => {
|
|
1648
|
-
|
|
1662
|
+
ve.prototype[e] = function(r) {
|
|
1649
1663
|
return U(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1650
1664
|
};
|
|
1651
1665
|
});
|
|
1652
1666
|
}
|
|
1653
|
-
|
|
1654
|
-
const
|
|
1655
|
-
function
|
|
1656
|
-
let i =
|
|
1667
|
+
et(Wt());
|
|
1668
|
+
const tt = E("");
|
|
1669
|
+
function Zt(t, e, r) {
|
|
1670
|
+
let i = tt("", e);
|
|
1657
1671
|
return i._data.type = t, i._data.title = r, i;
|
|
1658
1672
|
}
|
|
1659
|
-
function
|
|
1660
|
-
let s =
|
|
1673
|
+
function Ve(t, e, r, i) {
|
|
1674
|
+
let s = tt("", r);
|
|
1661
1675
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1662
1676
|
}
|
|
1663
|
-
function
|
|
1677
|
+
function Yt() {
|
|
1664
1678
|
return {
|
|
1665
|
-
create:
|
|
1666
|
-
createTmp:
|
|
1667
|
-
template:
|
|
1679
|
+
create: Zt,
|
|
1680
|
+
createTmp: Ve,
|
|
1681
|
+
template: Ve,
|
|
1668
1682
|
factory: E
|
|
1669
1683
|
};
|
|
1670
1684
|
}
|
|
1671
|
-
function
|
|
1685
|
+
function er(t, e, r) {
|
|
1672
1686
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1673
1687
|
return s.status = r.status, s.url = t, s;
|
|
1674
1688
|
}
|
|
1675
|
-
function
|
|
1689
|
+
function Pe(t) {
|
|
1676
1690
|
const e = t.responseText || t.response;
|
|
1677
1691
|
if (!e)
|
|
1678
1692
|
return e;
|
|
@@ -1682,7 +1696,7 @@ function Te(t) {
|
|
|
1682
1696
|
return e;
|
|
1683
1697
|
}
|
|
1684
1698
|
}
|
|
1685
|
-
function
|
|
1699
|
+
function rt(t) {
|
|
1686
1700
|
if (typeof XMLHttpRequest == "undefined")
|
|
1687
1701
|
return;
|
|
1688
1702
|
const e = new XMLHttpRequest(), r = t.action;
|
|
@@ -1690,8 +1704,8 @@ function nt(t) {
|
|
|
1690
1704
|
t.onError(o);
|
|
1691
1705
|
}, e.onload = function() {
|
|
1692
1706
|
if (e.status < 200 || e.status >= 300)
|
|
1693
|
-
return t.onError(
|
|
1694
|
-
t.onSuccess(
|
|
1707
|
+
return t.onError(er(r, t, e), Pe(e));
|
|
1708
|
+
t.onSuccess(Pe(e));
|
|
1695
1709
|
}, e.open(t.method || "get", r, !0);
|
|
1696
1710
|
let i;
|
|
1697
1711
|
t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
|
|
@@ -1702,13 +1716,13 @@ function nt(t) {
|
|
|
1702
1716
|
s[n] !== null && e.setRequestHeader(n, s[n]);
|
|
1703
1717
|
}), e.send(i);
|
|
1704
1718
|
}
|
|
1705
|
-
function
|
|
1719
|
+
function tr(t) {
|
|
1706
1720
|
return new Promise((e, r) => {
|
|
1707
|
-
|
|
1721
|
+
rt(N(y({}, t), {
|
|
1708
1722
|
onSuccess(i) {
|
|
1709
1723
|
let s = (o) => o;
|
|
1710
1724
|
const n = q(t.parse);
|
|
1711
|
-
|
|
1725
|
+
h.Function(n) ? s = n : n && h.String(n) && (s = (o) => (n.split(".").forEach((a) => {
|
|
1712
1726
|
o && (o = o[a]);
|
|
1713
1727
|
}), o)), e(s(i));
|
|
1714
1728
|
},
|
|
@@ -1721,9 +1735,9 @@ function ir(t) {
|
|
|
1721
1735
|
function X(t) {
|
|
1722
1736
|
return L(t);
|
|
1723
1737
|
}
|
|
1724
|
-
function
|
|
1738
|
+
function rr(t) {
|
|
1725
1739
|
function e(n) {
|
|
1726
|
-
return
|
|
1740
|
+
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1727
1741
|
}
|
|
1728
1742
|
function r(n, o, a) {
|
|
1729
1743
|
e(n).forEach((u) => {
|
|
@@ -1778,7 +1792,7 @@ function nr(t) {
|
|
|
1778
1792
|
s.fields().forEach((a) => {
|
|
1779
1793
|
const u = t.fieldCtx[a];
|
|
1780
1794
|
if (u) {
|
|
1781
|
-
const l =
|
|
1795
|
+
const l = k(o, a);
|
|
1782
1796
|
u.forEach((c) => {
|
|
1783
1797
|
c.rule.value = l ? o[a] : void 0;
|
|
1784
1798
|
}), delete o[a];
|
|
@@ -1883,7 +1897,7 @@ function nr(t) {
|
|
|
1883
1897
|
n.forEach((a) => s.sync(a));
|
|
1884
1898
|
return;
|
|
1885
1899
|
}
|
|
1886
|
-
let o =
|
|
1900
|
+
let o = h.Object(n) ? z(n) : t.getCtxs(n);
|
|
1887
1901
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
1888
1902
|
if (!a.deleted) {
|
|
1889
1903
|
const u = t.subForm[a.id];
|
|
@@ -1947,7 +1961,7 @@ function nr(t) {
|
|
|
1947
1961
|
},
|
|
1948
1962
|
setEffect(n, o, a) {
|
|
1949
1963
|
const u = t.getCtx(n);
|
|
1950
|
-
u && o && (o[0] === "$" && (o = o.substr(1)),
|
|
1964
|
+
u && o && (o[0] === "$" && (o = o.substr(1)), k(u.rule, "$" + o) && w(u.rule, "$" + o, a), k(u.rule, "effect") || w(u.rule, "effect", {}), w(u.rule.effect, o, a));
|
|
1951
1965
|
},
|
|
1952
1966
|
clearEffectData(n, o) {
|
|
1953
1967
|
const a = t.getCtx(n);
|
|
@@ -1971,19 +1985,19 @@ function nr(t) {
|
|
|
1971
1985
|
});
|
|
1972
1986
|
}), t.vm.$nextTick(() => {
|
|
1973
1987
|
s.clearValidateState();
|
|
1974
|
-
}), n == null && (
|
|
1988
|
+
}), n == null && (h.Function(t.options.onReset) && R(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
1975
1989
|
},
|
|
1976
1990
|
method(n, o) {
|
|
1977
1991
|
const a = s.el(n);
|
|
1978
1992
|
if (!a || !a[o])
|
|
1979
|
-
throw new Error(
|
|
1993
|
+
throw new Error(ye("err", `${o}方法不存在`));
|
|
1980
1994
|
return (...u) => a[o](...u);
|
|
1981
1995
|
},
|
|
1982
1996
|
exec(n, o, ...a) {
|
|
1983
1997
|
return R(() => s.method(n, o)(...a));
|
|
1984
1998
|
},
|
|
1985
1999
|
toJson(n) {
|
|
1986
|
-
return
|
|
2000
|
+
return ze(s.rule, n);
|
|
1987
2001
|
},
|
|
1988
2002
|
trigger(n, o, ...a) {
|
|
1989
2003
|
const u = s.el(n);
|
|
@@ -2015,7 +2029,7 @@ function nr(t) {
|
|
|
2015
2029
|
},
|
|
2016
2030
|
fetch(n) {
|
|
2017
2031
|
return new Promise((o, a) => {
|
|
2018
|
-
t.beforeFetch(n).then(() =>
|
|
2032
|
+
t.beforeFetch(n).then(() => tr(n).then(o).catch(a));
|
|
2019
2033
|
});
|
|
2020
2034
|
},
|
|
2021
2035
|
getData(n, o) {
|
|
@@ -2035,7 +2049,7 @@ function nr(t) {
|
|
|
2035
2049
|
};
|
|
2036
2050
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2037
2051
|
}
|
|
2038
|
-
function
|
|
2052
|
+
function ir(t) {
|
|
2039
2053
|
p(t.prototype, {
|
|
2040
2054
|
initCache() {
|
|
2041
2055
|
this.clearCacheAll();
|
|
@@ -2073,21 +2087,21 @@ function I(t) {
|
|
|
2073
2087
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2074
2088
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2075
2089
|
});
|
|
2076
|
-
return
|
|
2090
|
+
return it(e);
|
|
2077
2091
|
}
|
|
2078
|
-
function
|
|
2092
|
+
function it(t) {
|
|
2079
2093
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2080
2094
|
}
|
|
2081
|
-
function
|
|
2095
|
+
function nt(t) {
|
|
2082
2096
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2083
2097
|
}
|
|
2084
2098
|
function Q(t) {
|
|
2085
2099
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
2086
2100
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
2087
2101
|
}
|
|
2088
|
-
let
|
|
2102
|
+
let nr = 0;
|
|
2089
2103
|
function ee() {
|
|
2090
|
-
const t = 370 + ++
|
|
2104
|
+
const t = 370 + ++nr;
|
|
2091
2105
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
2092
2106
|
}
|
|
2093
2107
|
function Z(t, e, r) {
|
|
@@ -2096,7 +2110,7 @@ function Z(t, e, r) {
|
|
|
2096
2110
|
s && ((!i[s] || typeof i[s] != "object") && (i[s] = {}), i = i[s]), s = n;
|
|
2097
2111
|
}), i[s] = r, i;
|
|
2098
2112
|
}
|
|
2099
|
-
function
|
|
2113
|
+
function sr(t) {
|
|
2100
2114
|
p(t.prototype, {
|
|
2101
2115
|
initRender() {
|
|
2102
2116
|
this.tempList = {}, this.clearOrgChildren();
|
|
@@ -2106,7 +2120,7 @@ function ar(t) {
|
|
|
2106
2120
|
this.orgChildren = Object.keys(e).reduce((r, i) => {
|
|
2107
2121
|
if (e[i].parser.loadChildren !== !1) {
|
|
2108
2122
|
const s = e[i].rule.children;
|
|
2109
|
-
r[i] =
|
|
2123
|
+
r[i] = h.trueArray(s) ? [...s] : [];
|
|
2110
2124
|
}
|
|
2111
2125
|
return r;
|
|
2112
2126
|
}, {});
|
|
@@ -2137,7 +2151,7 @@ function ar(t) {
|
|
|
2137
2151
|
makeVm(e) {
|
|
2138
2152
|
const r = e.vm;
|
|
2139
2153
|
if (r) {
|
|
2140
|
-
if (
|
|
2154
|
+
if (h.Function(r))
|
|
2141
2155
|
return R(() => e.vm(this.$handle.getInjectData(e)));
|
|
2142
2156
|
if (!r._isVue)
|
|
2143
2157
|
return new T(r);
|
|
@@ -2161,14 +2175,14 @@ function ar(t) {
|
|
|
2161
2175
|
if (!e.$props) return;
|
|
2162
2176
|
const { prop: i } = r, s = Object.keys(e.$props), n = this.injectProp(r), o = Object.keys(n);
|
|
2163
2177
|
s.forEach((u) => {
|
|
2164
|
-
|
|
2178
|
+
k(i.props, u) ? e.$props[u] = i.props[u] : o.indexOf(u) > -1 && (e.$props[u] = n[u]);
|
|
2165
2179
|
});
|
|
2166
2180
|
const a = e.$options.model && e.$options.model.prop || "value";
|
|
2167
2181
|
s.indexOf(a) > -1 && (e.$props[a] = i.value);
|
|
2168
2182
|
},
|
|
2169
2183
|
renderTemp(e) {
|
|
2170
2184
|
if (!T.compile)
|
|
2171
|
-
return
|
|
2185
|
+
return Gt("当前使用的Vue构建版本不支持compile,无法使用template功能"), [];
|
|
2172
2186
|
const r = e.prop, { id: i, key: s } = e;
|
|
2173
2187
|
if (!this.tempList[i]) {
|
|
2174
2188
|
e.el || (e.el = this.makeVm(r), this.vm.$nextTick(() => e.parser.mounted(e)));
|
|
@@ -2183,10 +2197,10 @@ function ar(t) {
|
|
|
2183
2197
|
const { vm: n, template: o } = this.tempList[i];
|
|
2184
2198
|
this.setTempProps(n, e);
|
|
2185
2199
|
const a = o.render.call(n);
|
|
2186
|
-
return
|
|
2200
|
+
return h.Undef(a.data) && (a.data = {}), a.key = s, a.data.ref = e.ref, a.data.key = s, a;
|
|
2187
2201
|
},
|
|
2188
2202
|
parseSide(e, r) {
|
|
2189
|
-
return
|
|
2203
|
+
return h.Object(e) ? U({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2190
2204
|
},
|
|
2191
2205
|
renderSides(e, r, i) {
|
|
2192
2206
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2204,7 +2218,7 @@ function ar(t) {
|
|
|
2204
2218
|
const i = e.rule;
|
|
2205
2219
|
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2206
2220
|
let s, n = i.cache !== !1;
|
|
2207
|
-
const o = e.trueType, a = !(
|
|
2221
|
+
const o = e.trueType, a = !(h.Undef(i.display) || i.display);
|
|
2208
2222
|
if (o === "template" && !i.template)
|
|
2209
2223
|
s = this.renderSides(this.renderChildren(e), e, !0), a && this.display(s), s = this.item(e, s);
|
|
2210
2224
|
else if (o === "fcFragment")
|
|
@@ -2212,7 +2226,7 @@ function ar(t) {
|
|
|
2212
2226
|
else {
|
|
2213
2227
|
e.initProp(), this.mergeGlobal(e), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2214
2228
|
let u = e.prop;
|
|
2215
|
-
u.preview = !!(
|
|
2229
|
+
u.preview = !!(k(u, "preview") ? u.preview : this.options.preview), u.props.formCreateInject = this.injectProp(e);
|
|
2216
2230
|
const l = u.preview;
|
|
2217
2231
|
if (u.hidden) {
|
|
2218
2232
|
this.setCache(e, void 0, r);
|
|
@@ -2233,7 +2247,7 @@ function ar(t) {
|
|
|
2233
2247
|
model: u.model || {}
|
|
2234
2248
|
}) : s = l ? e.parser.preview(c, e) : e.parser.render(c, e);
|
|
2235
2249
|
}
|
|
2236
|
-
s = this.renderSides(s, e), !(!e.input &&
|
|
2250
|
+
s = this.renderSides(s, e), !(!e.input && h.Undef(u.native)) && u.native !== !0 && (s = this.$manager.makeWrap(e, s)), a && (s = this.display(s)), s = this.item(e, s);
|
|
2237
2251
|
}
|
|
2238
2252
|
return n && this.setCache(e, s, r), s;
|
|
2239
2253
|
}
|
|
@@ -2251,7 +2265,7 @@ function ar(t) {
|
|
|
2251
2265
|
},
|
|
2252
2266
|
none(e) {
|
|
2253
2267
|
if (e && e.data)
|
|
2254
|
-
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) :
|
|
2268
|
+
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) : h.String(e.data.style) ? e.data.style += ";display:none;" : e.data.style = [e.data.style, { display: "none" }], e;
|
|
2255
2269
|
},
|
|
2256
2270
|
item(e, r) {
|
|
2257
2271
|
return this.$h("fcFragment", {
|
|
@@ -2323,8 +2337,8 @@ function ar(t) {
|
|
|
2323
2337
|
this.$handle.onInput(e, r);
|
|
2324
2338
|
},
|
|
2325
2339
|
renderChildren(e) {
|
|
2326
|
-
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !
|
|
2327
|
-
return !
|
|
2340
|
+
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !h.String(n) && n.__fc__ && !this.$handle.ctxs[n.__fc__.id];
|
|
2341
|
+
return !h.trueArray(r) && i ? (this.$handle.deferSyncValue(() => {
|
|
2328
2342
|
i.forEach((n) => {
|
|
2329
2343
|
n && s(n) && this.$handle.rmCtx(n.__fc__);
|
|
2330
2344
|
});
|
|
@@ -2334,7 +2348,7 @@ function ar(t) {
|
|
|
2334
2348
|
});
|
|
2335
2349
|
}), r.map((n) => {
|
|
2336
2350
|
if (n) {
|
|
2337
|
-
if (
|
|
2351
|
+
if (h.String(n)) return n;
|
|
2338
2352
|
if (n.__fc__)
|
|
2339
2353
|
return this.renderCtx(n.__fc__, e);
|
|
2340
2354
|
n.type && this.vm.$nextTick(() => {
|
|
@@ -2345,11 +2359,11 @@ function ar(t) {
|
|
|
2345
2359
|
},
|
|
2346
2360
|
defaultRender(e, r) {
|
|
2347
2361
|
const i = e.prop;
|
|
2348
|
-
return i.component ? this.vNode.makeComponent(i.component, i, r) : this.vNode[e.type] ? this.vNode[e.type](i, r) : this.vNode[e.originType] ? this.vNode[e.originType](i, r) : this.vNode.make(
|
|
2362
|
+
return i.component ? this.vNode.makeComponent(i.component, i, r) : this.vNode[e.type] ? this.vNode[e.type](i, r) : this.vNode[e.originType] ? this.vNode[e.originType](i, r) : this.vNode.make(it(e.originType), i, r);
|
|
2349
2363
|
},
|
|
2350
2364
|
renderRule(e, r, i) {
|
|
2351
2365
|
if (!e) return;
|
|
2352
|
-
if (
|
|
2366
|
+
if (h.String(e)) return e;
|
|
2353
2367
|
let s;
|
|
2354
2368
|
if (i)
|
|
2355
2369
|
s = e.type;
|
|
@@ -2360,18 +2374,18 @@ function ar(t) {
|
|
|
2360
2374
|
}
|
|
2361
2375
|
if (!s) return;
|
|
2362
2376
|
let n = [[r]];
|
|
2363
|
-
return
|
|
2377
|
+
return h.trueArray(e.children) && n.push(e.children.map((o) => this.renderRule(o))), this.$h(s, y({}, e), n);
|
|
2364
2378
|
}
|
|
2365
2379
|
});
|
|
2366
2380
|
}
|
|
2367
|
-
function
|
|
2381
|
+
function be(t) {
|
|
2368
2382
|
p(this, {
|
|
2369
2383
|
$handle: t,
|
|
2370
2384
|
fc: t.fc,
|
|
2371
2385
|
vm: t.vm,
|
|
2372
2386
|
$manager: t.$manager,
|
|
2373
2387
|
vNode: new t.fc.CreateNode(t.vm)
|
|
2374
|
-
}),
|
|
2388
|
+
}), Ze(this, {
|
|
2375
2389
|
options() {
|
|
2376
2390
|
return t.options;
|
|
2377
2391
|
},
|
|
@@ -2380,9 +2394,9 @@ function $e(t) {
|
|
|
2380
2394
|
}
|
|
2381
2395
|
}), this.initCache(), this.initRender();
|
|
2382
2396
|
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
function
|
|
2397
|
+
ir(be);
|
|
2398
|
+
sr(be);
|
|
2399
|
+
function or(t) {
|
|
2386
2400
|
p(t.prototype, {
|
|
2387
2401
|
parseInjectEvent(e, r) {
|
|
2388
2402
|
const i = e.inject || this.options.injectEvent;
|
|
@@ -2395,11 +2409,11 @@ function lr(t) {
|
|
|
2395
2409
|
}), r;
|
|
2396
2410
|
},
|
|
2397
2411
|
parseEvent(e, r, i, s) {
|
|
2398
|
-
if (
|
|
2412
|
+
if (h.Function(r) && (i !== !1 && !h.Undef(i) || r.__inject))
|
|
2399
2413
|
return this.inject(e, r, i);
|
|
2400
|
-
if (!s && Array.isArray(r) && r[0] && (
|
|
2414
|
+
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2401
2415
|
return this.parseEventLst(e, r, i, !0);
|
|
2402
|
-
if (
|
|
2416
|
+
if (h.String(r)) {
|
|
2403
2417
|
const n = q(r);
|
|
2404
2418
|
if (n && r !== n)
|
|
2405
2419
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
@@ -2407,19 +2421,19 @@ function lr(t) {
|
|
|
2407
2421
|
},
|
|
2408
2422
|
parseEmit(e, r) {
|
|
2409
2423
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: u } = s, l = s[r ? "emit" : "nativeEmit"] || [];
|
|
2410
|
-
return
|
|
2424
|
+
return h.trueArray(l) && l.forEach((c) => {
|
|
2411
2425
|
if (!c) return;
|
|
2412
2426
|
let m, v = n || o || a;
|
|
2413
|
-
if (
|
|
2427
|
+
if (h.Object(c) && (m = c.inject, c = c.name, v = c.prefix || v), v) {
|
|
2414
2428
|
r || (v = `native-${v}`);
|
|
2415
|
-
const _ = Q(`${v}-${c}`), g = (...
|
|
2416
|
-
this.vm.$emit(_, ...
|
|
2429
|
+
const _ = Q(`${v}-${c}`), g = (...O) => {
|
|
2430
|
+
this.vm.$emit(_, ...O), this.vm.$emit("emit-event", _, ...O);
|
|
2417
2431
|
};
|
|
2418
2432
|
if (g.__emit = !0, !m && u === !1)
|
|
2419
2433
|
i[c] = g;
|
|
2420
2434
|
else {
|
|
2421
|
-
let
|
|
2422
|
-
i[c] =
|
|
2435
|
+
let O = m || u || this.options.injectEvent;
|
|
2436
|
+
i[c] = h.Undef(O) ? g : this.inject(s, g, O);
|
|
2423
2437
|
}
|
|
2424
2438
|
}
|
|
2425
2439
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2449,14 +2463,14 @@ function lr(t) {
|
|
|
2449
2463
|
}
|
|
2450
2464
|
});
|
|
2451
2465
|
}
|
|
2452
|
-
const
|
|
2453
|
-
function
|
|
2466
|
+
const Te = ["hook:updated", "hook:mounted"];
|
|
2467
|
+
function ar(t) {
|
|
2454
2468
|
p(t.prototype, {
|
|
2455
2469
|
usePage() {
|
|
2456
2470
|
const e = this.options.page;
|
|
2457
2471
|
if (!e) return;
|
|
2458
|
-
let r = 25, i =
|
|
2459
|
-
|
|
2472
|
+
let r = 25, i = lr(this.rules);
|
|
2473
|
+
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), p(this, {
|
|
2460
2474
|
first: r,
|
|
2461
2475
|
limit: i,
|
|
2462
2476
|
pageEnd: this.rules.length <= r
|
|
@@ -2464,16 +2478,16 @@ function ur(t) {
|
|
|
2464
2478
|
},
|
|
2465
2479
|
pageLoad() {
|
|
2466
2480
|
const e = () => {
|
|
2467
|
-
this.pageEnd ? (this.vm.$off(
|
|
2481
|
+
this.pageEnd ? (this.vm.$off(Te, e), this.bus.$emit("page-end")) : (this.first += this.limit, this.pageEnd = this.rules.length <= this.first, this.loadRule(), this.refresh());
|
|
2468
2482
|
};
|
|
2469
|
-
this.vm.$on(
|
|
2483
|
+
this.vm.$on(Te, e);
|
|
2470
2484
|
}
|
|
2471
2485
|
});
|
|
2472
2486
|
}
|
|
2473
|
-
function
|
|
2487
|
+
function lr(t) {
|
|
2474
2488
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2475
2489
|
}
|
|
2476
|
-
function
|
|
2490
|
+
function ur(t) {
|
|
2477
2491
|
p(t.prototype, {
|
|
2478
2492
|
clearNextTick() {
|
|
2479
2493
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
@@ -2488,12 +2502,14 @@ function fr(t) {
|
|
|
2488
2502
|
}
|
|
2489
2503
|
});
|
|
2490
2504
|
}
|
|
2491
|
-
function
|
|
2505
|
+
function fr(t) {
|
|
2492
2506
|
Object.defineProperties(t.origin, {
|
|
2493
|
-
__fc__:
|
|
2507
|
+
__fc__: he(t, !0)
|
|
2508
|
+
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2509
|
+
__fc__: he(t, !0)
|
|
2494
2510
|
});
|
|
2495
2511
|
}
|
|
2496
|
-
function
|
|
2512
|
+
function st(t, e, r) {
|
|
2497
2513
|
const i = ee();
|
|
2498
2514
|
p(this, {
|
|
2499
2515
|
id: i,
|
|
@@ -2516,9 +2532,9 @@ function at(t, e, r) {
|
|
|
2516
2532
|
exportEl: void 0,
|
|
2517
2533
|
defaultValue: e.field ? L(r) : void 0,
|
|
2518
2534
|
field: e.field || void 0
|
|
2519
|
-
}), this.updateKey(),
|
|
2535
|
+
}), this.updateKey(), fr(this), this.update(t, !0);
|
|
2520
2536
|
}
|
|
2521
|
-
p(
|
|
2537
|
+
p(st.prototype, {
|
|
2522
2538
|
effectData(t) {
|
|
2523
2539
|
return this.payload[t] || (this.payload[t] = {}), this.payload[t];
|
|
2524
2540
|
},
|
|
@@ -2540,7 +2556,7 @@ p(at.prototype, {
|
|
|
2540
2556
|
},
|
|
2541
2557
|
injectValidate() {
|
|
2542
2558
|
return j(this.prop.validate).map((t) => {
|
|
2543
|
-
if (
|
|
2559
|
+
if (h.Function(t.validator)) {
|
|
2544
2560
|
const e = y({}, t), r = this;
|
|
2545
2561
|
return e.validator = function(...i) {
|
|
2546
2562
|
return t.validator.call({
|
|
@@ -2618,7 +2634,7 @@ p(at.prototype, {
|
|
|
2618
2634
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2619
2635
|
}
|
|
2620
2636
|
});
|
|
2621
|
-
function
|
|
2637
|
+
function hr(t) {
|
|
2622
2638
|
p(t.prototype, {
|
|
2623
2639
|
nextRefresh(e) {
|
|
2624
2640
|
const r = this.loadedId;
|
|
@@ -2627,10 +2643,10 @@ function dr(t) {
|
|
|
2627
2643
|
});
|
|
2628
2644
|
},
|
|
2629
2645
|
parseRule(e) {
|
|
2630
|
-
const r =
|
|
2646
|
+
const r = Ie(e);
|
|
2631
2647
|
return Object.defineProperties(r, {
|
|
2632
|
-
__origin__:
|
|
2633
|
-
}),
|
|
2648
|
+
__origin__: he(e, !0)
|
|
2649
|
+
}), cr(r), this.appendValue(r), r.options = Array.isArray(r.options) ? r.options : [], [r, r.prefix, r.suffix].forEach((i) => {
|
|
2634
2650
|
i && this.loadFn(i, r);
|
|
2635
2651
|
}), this.loadCtrl(r), r.update && (r.update = q(r.update)), r;
|
|
2636
2652
|
},
|
|
@@ -2646,7 +2662,7 @@ function dr(t) {
|
|
|
2646
2662
|
},
|
|
2647
2663
|
syncProp(e) {
|
|
2648
2664
|
const r = e.rule;
|
|
2649
|
-
|
|
2665
|
+
h.trueArray(r.sync) && D([{
|
|
2650
2666
|
on: r.sync.reduce((i, s) => (i[`update:${s}`] = (n) => {
|
|
2651
2667
|
r.props[s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2652
2668
|
}, i), {})
|
|
@@ -2672,13 +2688,13 @@ function dr(t) {
|
|
|
2672
2688
|
let a = this.sort.indexOf(o.__fc__.id);
|
|
2673
2689
|
return a > -1 ? a : i(n - 1);
|
|
2674
2690
|
}, s = (n, o) => {
|
|
2675
|
-
|
|
2691
|
+
h.trueArray(n) && this._loadRule(n, o);
|
|
2676
2692
|
};
|
|
2677
2693
|
e.map((n, o) => {
|
|
2678
|
-
if (r && !
|
|
2694
|
+
if (r && !h.Object(n) || !this.pageEnd && !r && o >= this.first) return;
|
|
2679
2695
|
if (n.__fc__ && n.__fc__.root === e && this.ctxs[n.__fc__.id])
|
|
2680
2696
|
return s(n.__fc__.rule.children, n.__fc__), n.__fc__;
|
|
2681
|
-
let a =
|
|
2697
|
+
let a = Ie(n);
|
|
2682
2698
|
const u = () => !!(a.field && this.fieldCtx[a.field] && this.fieldCtx[a.field][0] !== n.__fc__);
|
|
2683
2699
|
this.ruleEffect(a, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", n, this.api);
|
|
2684
2700
|
let l, c = !1, m = !!n.__fc__, v = a.value;
|
|
@@ -2687,28 +2703,28 @@ function dr(t) {
|
|
|
2687
2703
|
const g = !l.check(this);
|
|
2688
2704
|
if (l.deleted) {
|
|
2689
2705
|
if (g) {
|
|
2690
|
-
if (
|
|
2706
|
+
if (De(l))
|
|
2691
2707
|
return;
|
|
2692
2708
|
l.update(this);
|
|
2693
2709
|
}
|
|
2694
2710
|
} else if (g) {
|
|
2695
|
-
if (
|
|
2711
|
+
if (De(l))
|
|
2696
2712
|
return;
|
|
2697
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2713
|
+
e[o] = n = n._clone ? n._clone() : $e(n), l = null, c = !0;
|
|
2698
2714
|
}
|
|
2699
2715
|
}
|
|
2700
2716
|
if (l)
|
|
2701
2717
|
l.originType !== l.rule.type && l.updateType(), this.bindParser(l), this.appendValue(l.rule);
|
|
2702
2718
|
else {
|
|
2703
2719
|
const g = this.parseRule(n);
|
|
2704
|
-
l = new
|
|
2720
|
+
l = new st(this, g, v), this.bindParser(l);
|
|
2705
2721
|
}
|
|
2706
2722
|
if ([!1, !0].forEach((g) => this.parseEmit(l, g)), this.syncProp(l), l.parent = r || null, l.root = e, this.setCtx(l), !c && !m && this.effect(l, "load"), this.effect(l, "created"), l.parser.loadChildren === !1 || s(l.rule.children, l), !r) {
|
|
2707
2723
|
const g = i(o);
|
|
2708
2724
|
g > -1 || !o ? this.sort.splice(g + 1, 0, l.id) : this.sort.push(l.id);
|
|
2709
2725
|
}
|
|
2710
2726
|
const _ = l.rule;
|
|
2711
|
-
return l.updated || (l.updated = !0,
|
|
2727
|
+
return l.updated || (l.updated = !0, h.Function(_.update) && this.bus.$once("load-end", () => {
|
|
2712
2728
|
this.refreshUpdate(l, _.value, "init");
|
|
2713
2729
|
}), this.effect(l, "loaded")), l.input && Object.defineProperty(_, "value", this.valueHandle(l)), this.refreshControl(l) && (this.cycleLoad = !0), l;
|
|
2714
2730
|
});
|
|
@@ -2717,17 +2733,17 @@ function dr(t) {
|
|
|
2717
2733
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
2718
2734
|
},
|
|
2719
2735
|
useCtrl(e) {
|
|
2720
|
-
const r =
|
|
2736
|
+
const r = dr(e), i = [], s = this.api;
|
|
2721
2737
|
if (!r.length) return !1;
|
|
2722
2738
|
for (let a = 0; a < r.length; a++) {
|
|
2723
2739
|
const u = r[a], l = u.handle || function(m) {
|
|
2724
|
-
return (
|
|
2740
|
+
return (x[u.condition || "=="] || x["=="])(m, u.value);
|
|
2725
2741
|
};
|
|
2726
|
-
if (!
|
|
2742
|
+
if (!h.trueArray(u.rule)) continue;
|
|
2727
2743
|
const c = N(y({}, u), {
|
|
2728
2744
|
valid: R(() => l(e.rule.value, s)),
|
|
2729
|
-
ctrl:
|
|
2730
|
-
isHidden:
|
|
2745
|
+
ctrl: pr(e, u.rule),
|
|
2746
|
+
isHidden: h.String(u.rule[0])
|
|
2731
2747
|
});
|
|
2732
2748
|
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
2733
2749
|
}
|
|
@@ -2742,27 +2758,27 @@ function dr(t) {
|
|
|
2742
2758
|
children: l,
|
|
2743
2759
|
valid: u
|
|
2744
2760
|
}) : _ && e.ctrlRule.splice(e.ctrlRule.indexOf(_) >>> 0, 1), n[u ? "push" : "unshift"](() => {
|
|
2745
|
-
g === "disabled" || g === "enabled" ? this.api.disabled(!u, l) : g === "display" ? this.api.display(u, l) : g === "required" ? (l.forEach((
|
|
2746
|
-
this.api.setEffect(
|
|
2761
|
+
g === "disabled" || g === "enabled" ? this.api.disabled(!u, l) : g === "display" ? this.api.display(u, l) : g === "required" ? (l.forEach((O) => {
|
|
2762
|
+
this.api.setEffect(O, "required", u);
|
|
2747
2763
|
}), u || this.api.clearValidateState(l)) : this.api.hidden(!u, l);
|
|
2748
2764
|
});
|
|
2749
2765
|
return;
|
|
2750
2766
|
}
|
|
2751
2767
|
if (u) {
|
|
2752
2768
|
o = !0;
|
|
2753
|
-
const
|
|
2769
|
+
const O = {
|
|
2754
2770
|
type: "fcFragment",
|
|
2755
2771
|
native: !0,
|
|
2756
2772
|
__ctrl: !0,
|
|
2757
2773
|
children: l
|
|
2758
2774
|
};
|
|
2759
|
-
e.ctrlRule.push(
|
|
2760
|
-
c ? s.prepend(
|
|
2775
|
+
e.ctrlRule.push(O), this.bus.$once("load-start", () => {
|
|
2776
|
+
c ? s.prepend(O, c, v) : m || v ? s.append(O, m || e.id, v) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, O);
|
|
2761
2777
|
});
|
|
2762
2778
|
} else {
|
|
2763
2779
|
e.ctrlRule.splice(e.ctrlRule.indexOf(_), 1);
|
|
2764
|
-
const
|
|
2765
|
-
|
|
2780
|
+
const O = z(_);
|
|
2781
|
+
O && O.rm();
|
|
2766
2782
|
}
|
|
2767
2783
|
});
|
|
2768
2784
|
}), n.length && this.vm.$nextTick(() => {
|
|
@@ -2787,30 +2803,30 @@ function dr(t) {
|
|
|
2787
2803
|
}
|
|
2788
2804
|
});
|
|
2789
2805
|
}
|
|
2790
|
-
function
|
|
2791
|
-
const e =
|
|
2806
|
+
function cr(t) {
|
|
2807
|
+
const e = Ye();
|
|
2792
2808
|
return Object.keys(e).forEach((r) => {
|
|
2793
|
-
|
|
2809
|
+
k(t, r) || w(t, r, e[r]);
|
|
2794
2810
|
}), t;
|
|
2795
2811
|
}
|
|
2796
|
-
function
|
|
2812
|
+
function dr(t) {
|
|
2797
2813
|
const e = t.rule.control || [];
|
|
2798
|
-
return
|
|
2814
|
+
return h.Object(e) ? [e] : e;
|
|
2799
2815
|
}
|
|
2800
|
-
function
|
|
2816
|
+
function pr(t, e) {
|
|
2801
2817
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
2802
2818
|
const i = t.ctrlRule[r];
|
|
2803
2819
|
if (i.children === e)
|
|
2804
2820
|
return i;
|
|
2805
2821
|
}
|
|
2806
2822
|
}
|
|
2807
|
-
function
|
|
2823
|
+
function De(t) {
|
|
2808
2824
|
return !!t.rule.__ctrl;
|
|
2809
2825
|
}
|
|
2810
|
-
function
|
|
2826
|
+
function mr(t) {
|
|
2811
2827
|
p(t.prototype, {
|
|
2812
2828
|
getValue(e) {
|
|
2813
|
-
return
|
|
2829
|
+
return h.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
|
|
2814
2830
|
},
|
|
2815
2831
|
setValue(e, r, i, s) {
|
|
2816
2832
|
e.deleted || (e.cacheValue = r, this.changeStatus = !0, this.nextRefresh(), this.$render.clearCache(e), this.setFormData(e, i), this.syncValue(), this.valueChange(e, r), this.vm.$emit("change", e.field, r, e.origin, this.api, s || !1), this.effect(e, "value"), this.emitEvent("change", e.field, r, {
|
|
@@ -2830,14 +2846,14 @@ function gr(t) {
|
|
|
2830
2846
|
return this.formData[e.id];
|
|
2831
2847
|
},
|
|
2832
2848
|
validate() {
|
|
2833
|
-
return
|
|
2849
|
+
return Le(this.vm.validate), this.fields().forEach((e) => {
|
|
2834
2850
|
this.fieldCtx[e].forEach((r) => {
|
|
2835
2851
|
this.vm.validate[r.id] = j(r.rule.validate);
|
|
2836
2852
|
});
|
|
2837
2853
|
}), this.vm.validate;
|
|
2838
2854
|
},
|
|
2839
2855
|
syncForm() {
|
|
2840
|
-
|
|
2856
|
+
Le(this.form), Object.defineProperties(this.form, this.fields().reduce((e, r) => {
|
|
2841
2857
|
const i = this.getFieldCtx(r), s = this.valueHandle(i);
|
|
2842
2858
|
return s.configurable = !0, e[r] = s, e;
|
|
2843
2859
|
}, this.options.appendValue !== !1 ? Object.keys(this.appendData).reduce((e, r) => (e[r] = {
|
|
@@ -2859,7 +2875,7 @@ function gr(t) {
|
|
|
2859
2875
|
};
|
|
2860
2876
|
},
|
|
2861
2877
|
appendValue(e) {
|
|
2862
|
-
!e.field || !
|
|
2878
|
+
!e.field || !k(this.appendData, e.field) || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
2863
2879
|
},
|
|
2864
2880
|
addSubForm(e, r) {
|
|
2865
2881
|
this.subForm[e.id] = r;
|
|
@@ -2873,13 +2889,13 @@ function gr(t) {
|
|
|
2873
2889
|
this.vm._updateValue(y(y({}, this.options.appendValue !== !1 ? this.appendData : {}), this.form));
|
|
2874
2890
|
},
|
|
2875
2891
|
isChange(e, r) {
|
|
2876
|
-
return JSON.stringify(e.rule.value,
|
|
2892
|
+
return JSON.stringify(e.rule.value, Be) !== JSON.stringify(r === null ? void 0 : r, Be);
|
|
2877
2893
|
},
|
|
2878
2894
|
isQuote(e, r) {
|
|
2879
|
-
return (
|
|
2895
|
+
return (h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
2880
2896
|
},
|
|
2881
2897
|
refreshUpdate(e, r, i, s) {
|
|
2882
|
-
if (
|
|
2898
|
+
if (h.Function(e.rule.update)) {
|
|
2883
2899
|
const n = R(() => e.rule.update(r, e.origin, this.api, {
|
|
2884
2900
|
origin: i || "change",
|
|
2885
2901
|
linkField: s
|
|
@@ -2896,7 +2912,7 @@ function gr(t) {
|
|
|
2896
2912
|
},
|
|
2897
2913
|
appendLink(e) {
|
|
2898
2914
|
const r = e.rule.link;
|
|
2899
|
-
|
|
2915
|
+
h.trueArray(r) && r.forEach((i) => {
|
|
2900
2916
|
const s = () => this.refreshRule(e, e.rule.value, "link", i);
|
|
2901
2917
|
this.bus.$on("change-" + i, s), e.linkOn.push(() => this.bus.$off("change-" + i, s));
|
|
2902
2918
|
});
|
|
@@ -2906,13 +2922,13 @@ function gr(t) {
|
|
|
2906
2922
|
}
|
|
2907
2923
|
});
|
|
2908
2924
|
}
|
|
2909
|
-
function
|
|
2925
|
+
function Be(t, e) {
|
|
2910
2926
|
return typeof e == "function" ? "" + e : e;
|
|
2911
2927
|
}
|
|
2912
|
-
function
|
|
2928
|
+
function Le(t) {
|
|
2913
2929
|
Object.keys(t).forEach((e) => delete t[e]);
|
|
2914
2930
|
}
|
|
2915
|
-
const
|
|
2931
|
+
const ce = {
|
|
2916
2932
|
init(t) {
|
|
2917
2933
|
},
|
|
2918
2934
|
toFormValue(t, e) {
|
|
@@ -2931,8 +2947,8 @@ const he = {
|
|
|
2931
2947
|
},
|
|
2932
2948
|
mergeProp(t) {
|
|
2933
2949
|
}
|
|
2934
|
-
},
|
|
2935
|
-
function
|
|
2950
|
+
}, yr = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2951
|
+
function gr(t) {
|
|
2936
2952
|
p(t.prototype, {
|
|
2937
2953
|
getCtx(e) {
|
|
2938
2954
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
@@ -2962,7 +2978,7 @@ function vr(t) {
|
|
|
2962
2978
|
},
|
|
2963
2979
|
getParser(e) {
|
|
2964
2980
|
const r = this.fc.parsers;
|
|
2965
|
-
return r[e.originType] || r[I(e.type)] || r[e.trueType] ||
|
|
2981
|
+
return r[e.originType] || r[I(e.type)] || r[e.trueType] || ce;
|
|
2966
2982
|
},
|
|
2967
2983
|
bindParser(e) {
|
|
2968
2984
|
e.setParser(this.getParser(e));
|
|
@@ -2976,7 +2992,7 @@ function vr(t) {
|
|
|
2976
2992
|
},
|
|
2977
2993
|
watchCtx(e) {
|
|
2978
2994
|
const r = this.vm;
|
|
2979
|
-
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
2995
|
+
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" && yr.indexOf(i) === -1).forEach((i) => {
|
|
2980
2996
|
const s = i === "children";
|
|
2981
2997
|
e.watch.push(r.$watch(() => e.rule[i], (n, o) => {
|
|
2982
2998
|
if (!(this.loading || this.noWatchFn || this.reloading)) {
|
|
@@ -2996,7 +3012,7 @@ function vr(t) {
|
|
|
2996
3012
|
else if (i === "type")
|
|
2997
3013
|
e.updateType(), this.bindParser(e);
|
|
2998
3014
|
else if (i === "children") {
|
|
2999
|
-
const a =
|
|
3015
|
+
const a = h.trueArray(n);
|
|
3000
3016
|
this.deferSyncValue(() => {
|
|
3001
3017
|
n !== o && (this.rmSub(o, e), this.$render.initOrgChildren()), a && this.loadChildren(n, e), this.vm.$emit("update", this.api);
|
|
3002
3018
|
});
|
|
@@ -3007,7 +3023,7 @@ function vr(t) {
|
|
|
3007
3023
|
}), this.watchEffect(e);
|
|
3008
3024
|
},
|
|
3009
3025
|
rmSub(e, r) {
|
|
3010
|
-
|
|
3026
|
+
h.trueArray(e) && e.forEach((i) => {
|
|
3011
3027
|
i && i.__fc__ && i.__fc__.parent === r && this.rmCtx(i.__fc__);
|
|
3012
3028
|
});
|
|
3013
3029
|
},
|
|
@@ -3017,15 +3033,15 @@ function vr(t) {
|
|
|
3017
3033
|
e.input && Object.defineProperty(e.rule, "value", {
|
|
3018
3034
|
value: e.rule.value,
|
|
3019
3035
|
writable: !0
|
|
3020
|
-
}), B(this.ctxs, r), B(this.$render.tempList, r), B(this.$render.orgChildren, r), B(this.vm.ctxInject, r), B(this.formData, r), B(this.subForm, r), B(e, "cacheValue"), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !
|
|
3021
|
-
this.reloading || (e.parser.loadChildren !== !1 &&
|
|
3036
|
+
}), B(this.ctxs, r), B(this.$render.tempList, r), B(this.$render.orgChildren, r), B(this.vm.ctxInject, r), B(this.formData, r), B(this.subForm, r), B(e, "cacheValue"), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !k(this.fieldCtx, i) && B(this.form, i), this.deferSyncValue(() => {
|
|
3037
|
+
this.reloading || (e.parser.loadChildren !== !1 && h.trueArray(e.rule.children) && e.rule.children.forEach((a) => a.__fc__ && this.rmCtx(a.__fc__)), e.root === this.rules && this.vm._renderRule());
|
|
3022
3038
|
}, s);
|
|
3023
3039
|
const o = this.sort.indexOf(r);
|
|
3024
3040
|
return o > -1 && this.sort.splice(o, 1), this.$render.clearCache(e), e.delete(), this.effect(e, "deleted"), s && !this.fieldCtx[i] && this.vm.$emit("removeField", i, e.rule, this.api), e.rule.__ctrl || this.vm.$emit("removeRule", e.rule, this.api), e;
|
|
3025
3041
|
}
|
|
3026
3042
|
});
|
|
3027
3043
|
}
|
|
3028
|
-
function
|
|
3044
|
+
function $r(t) {
|
|
3029
3045
|
p(t.prototype, {
|
|
3030
3046
|
mounted() {
|
|
3031
3047
|
const e = () => {
|
|
@@ -3043,19 +3059,19 @@ function br(t) {
|
|
|
3043
3059
|
const i = this.options[e] || this.options[I("on-" + e)];
|
|
3044
3060
|
if (i) {
|
|
3045
3061
|
const s = q(i);
|
|
3046
|
-
|
|
3062
|
+
h.Function(s) && R(() => s(...r));
|
|
3047
3063
|
}
|
|
3048
3064
|
this.bus.$emit(e, ...r);
|
|
3049
3065
|
}
|
|
3050
3066
|
});
|
|
3051
3067
|
}
|
|
3052
|
-
function
|
|
3068
|
+
function vr(t) {
|
|
3053
3069
|
p(t.prototype, {
|
|
3054
3070
|
useProvider() {
|
|
3055
3071
|
const e = this.fc.providers;
|
|
3056
3072
|
Object.keys(e).forEach((r) => {
|
|
3057
3073
|
let i = e[r];
|
|
3058
|
-
|
|
3074
|
+
h.Function(i) && (i = i(this.fc)), i._c = Cr(i), this.onEffect(i), this.providers[r] = i;
|
|
3059
3075
|
});
|
|
3060
3076
|
},
|
|
3061
3077
|
onEffect(e) {
|
|
@@ -3072,7 +3088,7 @@ function Cr(t) {
|
|
|
3072
3088
|
let i = {
|
|
3073
3089
|
required: () => {
|
|
3074
3090
|
var s, n;
|
|
3075
|
-
return (
|
|
3091
|
+
return (k(e.rule, "$required") ? e.rule.$required : (n = (s = e.rule) == null ? void 0 : s.effect) == null ? void 0 : n.required) || !1;
|
|
3076
3092
|
}
|
|
3077
3093
|
};
|
|
3078
3094
|
Object.keys(e.rule.effect || {}).forEach((s) => {
|
|
@@ -3102,9 +3118,9 @@ function Cr(t) {
|
|
|
3102
3118
|
}, r);
|
|
3103
3119
|
},
|
|
3104
3120
|
getEffect(e, r) {
|
|
3105
|
-
if (
|
|
3121
|
+
if (k(e, "$" + r))
|
|
3106
3122
|
return e["$" + r];
|
|
3107
|
-
if (
|
|
3123
|
+
if (k(e, "effect") && k(e.effect, r))
|
|
3108
3124
|
return e.effect[r];
|
|
3109
3125
|
},
|
|
3110
3126
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3126,17 +3142,17 @@ function Cr(t) {
|
|
|
3126
3142
|
}
|
|
3127
3143
|
});
|
|
3128
3144
|
}
|
|
3129
|
-
function
|
|
3145
|
+
function br(t) {
|
|
3130
3146
|
return t.filter(function(e, r, i) {
|
|
3131
3147
|
return i.indexOf(e, 0) === r;
|
|
3132
3148
|
});
|
|
3133
3149
|
}
|
|
3134
|
-
function
|
|
3150
|
+
function Cr(t) {
|
|
3135
3151
|
const e = t.components;
|
|
3136
3152
|
if (Array.isArray(e)) {
|
|
3137
|
-
const r =
|
|
3153
|
+
const r = br(e.filter((i) => i !== "*"));
|
|
3138
3154
|
return r.length ? r : !1;
|
|
3139
|
-
} else return
|
|
3155
|
+
} else return h.String(e) ? [e] : !1;
|
|
3140
3156
|
}
|
|
3141
3157
|
function V(t) {
|
|
3142
3158
|
p(this, {
|
|
@@ -3161,14 +3177,14 @@ function V(t) {
|
|
|
3161
3177
|
nextReload: () => {
|
|
3162
3178
|
this.lifecycle("reload");
|
|
3163
3179
|
}
|
|
3164
|
-
}),
|
|
3180
|
+
}), Ze(this, {
|
|
3165
3181
|
options() {
|
|
3166
3182
|
return t.options;
|
|
3167
3183
|
},
|
|
3168
3184
|
bus() {
|
|
3169
3185
|
return t.bus;
|
|
3170
3186
|
}
|
|
3171
|
-
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new
|
|
3187
|
+
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new be(this), this.api = t.extendApi(rr(this), this);
|
|
3172
3188
|
}
|
|
3173
3189
|
p(V.prototype, {
|
|
3174
3190
|
initData(t) {
|
|
@@ -3186,30 +3202,30 @@ p(V.prototype, {
|
|
|
3186
3202
|
beforeFetch(t) {
|
|
3187
3203
|
return new Promise((e) => {
|
|
3188
3204
|
const r = this.options.beforeFetch && R(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3189
|
-
r &&
|
|
3205
|
+
r && h.Function(r.then) ? r.then(e) : e();
|
|
3190
3206
|
});
|
|
3191
3207
|
}
|
|
3192
3208
|
});
|
|
3193
|
-
|
|
3209
|
+
or(V);
|
|
3210
|
+
ar(V);
|
|
3194
3211
|
ur(V);
|
|
3195
|
-
|
|
3196
|
-
|
|
3212
|
+
hr(V);
|
|
3213
|
+
mr(V);
|
|
3197
3214
|
gr(V);
|
|
3215
|
+
$r(V);
|
|
3198
3216
|
vr(V);
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
const Or = "fcFragment", te = {
|
|
3202
|
-
name: Or,
|
|
3217
|
+
const _r = "fcFragment", re = {
|
|
3218
|
+
name: _r,
|
|
3203
3219
|
functional: !0,
|
|
3204
3220
|
props: ["vnode"],
|
|
3205
3221
|
render(t, e) {
|
|
3206
3222
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3207
3223
|
}
|
|
3208
3224
|
};
|
|
3209
|
-
function
|
|
3210
|
-
return
|
|
3225
|
+
function Or(t) {
|
|
3226
|
+
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3211
3227
|
}
|
|
3212
|
-
function
|
|
3228
|
+
function kr() {
|
|
3213
3229
|
const t = {};
|
|
3214
3230
|
function e(r) {
|
|
3215
3231
|
r && this.setVm(r);
|
|
@@ -3222,7 +3238,7 @@ function Fr() {
|
|
|
3222
3238
|
return T.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3223
3239
|
},
|
|
3224
3240
|
makeComponent(r, i, s) {
|
|
3225
|
-
let n = this.$h(r,
|
|
3241
|
+
let n = this.$h(r, Or(i), s || []);
|
|
3226
3242
|
return n.context = this.vm, n;
|
|
3227
3243
|
},
|
|
3228
3244
|
aliasMap: t
|
|
@@ -3233,7 +3249,7 @@ function Fr() {
|
|
|
3233
3249
|
},
|
|
3234
3250
|
use(r) {
|
|
3235
3251
|
Object.keys(r).forEach((i) => {
|
|
3236
|
-
const s = Q(i), n =
|
|
3252
|
+
const s = Q(i), n = nt(i).toLocaleLowerCase(), o = r[i];
|
|
3237
3253
|
[i, s, n].forEach((a) => {
|
|
3238
3254
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3239
3255
|
return this.make(o, u, l);
|
|
@@ -3243,12 +3259,12 @@ function Fr() {
|
|
|
3243
3259
|
}
|
|
3244
3260
|
}), e;
|
|
3245
3261
|
}
|
|
3246
|
-
function
|
|
3247
|
-
class e extends
|
|
3262
|
+
function wr(t) {
|
|
3263
|
+
class e extends ot {
|
|
3248
3264
|
}
|
|
3249
3265
|
return Object.assign(e.prototype, t), e;
|
|
3250
3266
|
}
|
|
3251
|
-
function
|
|
3267
|
+
function ot(t) {
|
|
3252
3268
|
p(this, {
|
|
3253
3269
|
$handle: t,
|
|
3254
3270
|
vm: t.vm,
|
|
@@ -3259,7 +3275,7 @@ function lt(t) {
|
|
|
3259
3275
|
}
|
|
3260
3276
|
}), this.updateKey(), this.init();
|
|
3261
3277
|
}
|
|
3262
|
-
p(
|
|
3278
|
+
p(ot.prototype, {
|
|
3263
3279
|
__init() {
|
|
3264
3280
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3265
3281
|
},
|
|
@@ -3304,7 +3320,7 @@ p(lt.prototype, {
|
|
|
3304
3320
|
render(t) {
|
|
3305
3321
|
}
|
|
3306
3322
|
});
|
|
3307
|
-
const
|
|
3323
|
+
const Fr = function(t) {
|
|
3308
3324
|
const e = {
|
|
3309
3325
|
name: "loadData",
|
|
3310
3326
|
_fn: [],
|
|
@@ -3330,7 +3346,7 @@ const Sr = function(t) {
|
|
|
3330
3346
|
}
|
|
3331
3347
|
};
|
|
3332
3348
|
return e.watch = e.created, e;
|
|
3333
|
-
},
|
|
3349
|
+
}, at = {
|
|
3334
3350
|
name: "componentValidate",
|
|
3335
3351
|
load(t, e, r) {
|
|
3336
3352
|
const i = t.getValue();
|
|
@@ -3347,11 +3363,11 @@ const Sr = function(t) {
|
|
|
3347
3363
|
}] : (t.clearProp(), r.clearValidateState([e.field]));
|
|
3348
3364
|
},
|
|
3349
3365
|
watch(...t) {
|
|
3350
|
-
|
|
3366
|
+
at.load(...t);
|
|
3351
3367
|
}
|
|
3352
|
-
},
|
|
3368
|
+
}, Er = function(t) {
|
|
3353
3369
|
function e(i) {
|
|
3354
|
-
return
|
|
3370
|
+
return h.String(i) && (i = {
|
|
3355
3371
|
action: i,
|
|
3356
3372
|
to: "options"
|
|
3357
3373
|
}), i;
|
|
@@ -3361,7 +3377,7 @@ const Sr = function(t) {
|
|
|
3361
3377
|
const a = (m) => {
|
|
3362
3378
|
m === void 0 ? (i.clearProp(), n.sync(s)) : Z(i.getProp(), o.to || "options", m);
|
|
3363
3379
|
};
|
|
3364
|
-
if (
|
|
3380
|
+
if (h.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3365
3381
|
a(void 0);
|
|
3366
3382
|
return;
|
|
3367
3383
|
}
|
|
@@ -3374,17 +3390,17 @@ const Sr = function(t) {
|
|
|
3374
3390
|
}, o), {
|
|
3375
3391
|
onSuccess(m, v) {
|
|
3376
3392
|
if (l()) return;
|
|
3377
|
-
let _ = (g) => v ? g :
|
|
3378
|
-
|
|
3379
|
-
g && (g = g[
|
|
3393
|
+
let _ = (g) => v ? g : k(g, "data") ? g.data : g;
|
|
3394
|
+
h.Function(o.parse) ? _ = o.parse : o.parse && h.String(o.parse) && (_ = (g) => (o.parse.split(".").forEach((O) => {
|
|
3395
|
+
g && (g = g[O]);
|
|
3380
3396
|
}), g)), a(_(m, s, n)), n.sync(s);
|
|
3381
3397
|
},
|
|
3382
3398
|
onError(m) {
|
|
3383
|
-
a(void 0), !l() && (u || ((v) =>
|
|
3399
|
+
a(void 0), !l() && (u || ((v) => ge(v.message || "fetch fail " + o.action)))(m, s, n);
|
|
3384
3400
|
}
|
|
3385
3401
|
});
|
|
3386
3402
|
t.$handle.beforeFetch(c, { rule: s, api: n }).then(() => {
|
|
3387
|
-
if (
|
|
3403
|
+
if (h.Function(o.action)) {
|
|
3388
3404
|
o.action(s, n).then((m) => {
|
|
3389
3405
|
c.onSuccess(m, !0);
|
|
3390
3406
|
}).catch((m) => {
|
|
@@ -3404,17 +3420,17 @@ const Sr = function(t) {
|
|
|
3404
3420
|
r(...i);
|
|
3405
3421
|
}
|
|
3406
3422
|
};
|
|
3407
|
-
},
|
|
3423
|
+
}, lt = {
|
|
3408
3424
|
name: "required",
|
|
3409
3425
|
load(t, e, r) {
|
|
3410
|
-
const i =
|
|
3426
|
+
const i = Sr(t.getValue());
|
|
3411
3427
|
if (i.required === !1)
|
|
3412
3428
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
3413
3429
|
else {
|
|
3414
3430
|
const s = y({
|
|
3415
3431
|
required: !0,
|
|
3416
3432
|
validator(n, o, a) {
|
|
3417
|
-
|
|
3433
|
+
h.empty(o) ? a(s.message) : a();
|
|
3418
3434
|
}
|
|
3419
3435
|
}, i);
|
|
3420
3436
|
if (!s.message) {
|
|
@@ -3426,38 +3442,38 @@ const Sr = function(t) {
|
|
|
3426
3442
|
r.sync(e);
|
|
3427
3443
|
},
|
|
3428
3444
|
watch(...t) {
|
|
3429
|
-
|
|
3445
|
+
lt.load(...t);
|
|
3430
3446
|
}
|
|
3431
3447
|
};
|
|
3432
|
-
function
|
|
3433
|
-
return
|
|
3448
|
+
function Sr(t) {
|
|
3449
|
+
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 : {};
|
|
3434
3450
|
}
|
|
3435
|
-
const
|
|
3436
|
-
fetch:
|
|
3437
|
-
loadData:
|
|
3438
|
-
required:
|
|
3439
|
-
componentValidate:
|
|
3440
|
-
},
|
|
3441
|
-
name:
|
|
3451
|
+
const Rr = {
|
|
3452
|
+
fetch: Er,
|
|
3453
|
+
loadData: Fr,
|
|
3454
|
+
required: lt,
|
|
3455
|
+
componentValidate: at
|
|
3456
|
+
}, jr = "html", Ir = {
|
|
3457
|
+
name: jr,
|
|
3442
3458
|
loadChildren: !1,
|
|
3443
3459
|
render(t, e) {
|
|
3444
3460
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
3445
3461
|
},
|
|
3446
3462
|
renderChildren(t) {
|
|
3447
|
-
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) =>
|
|
3463
|
+
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => h.String(e)).join("") : "";
|
|
3448
3464
|
}
|
|
3449
3465
|
};
|
|
3450
|
-
function
|
|
3466
|
+
function Ar(t, e) {
|
|
3451
3467
|
let r;
|
|
3452
3468
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3453
3469
|
}
|
|
3454
|
-
function
|
|
3455
|
-
return
|
|
3470
|
+
function ie() {
|
|
3471
|
+
return Ar("name", ...arguments);
|
|
3456
3472
|
}
|
|
3457
|
-
function
|
|
3458
|
-
return !t || !t.el ? window.document.body :
|
|
3473
|
+
function Me(t) {
|
|
3474
|
+
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3459
3475
|
}
|
|
3460
|
-
function
|
|
3476
|
+
function Ne(t, e) {
|
|
3461
3477
|
const r = new T({
|
|
3462
3478
|
data() {
|
|
3463
3479
|
return { rule: t, option: e || {} };
|
|
@@ -3468,116 +3484,116 @@ function qe(t, e) {
|
|
|
3468
3484
|
});
|
|
3469
3485
|
return r.$mount(), r;
|
|
3470
3486
|
}
|
|
3471
|
-
function
|
|
3487
|
+
function Vr(t) {
|
|
3472
3488
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3473
|
-
|
|
3489
|
+
Xe.push(...e), pe.push(...r), me.push(...i), et([...e, ...r, ...i]);
|
|
3474
3490
|
}
|
|
3475
|
-
let
|
|
3491
|
+
let Pr = 1;
|
|
3476
3492
|
const S = {};
|
|
3477
|
-
function
|
|
3493
|
+
function ut(t) {
|
|
3478
3494
|
const e = {
|
|
3479
|
-
[
|
|
3480
|
-
}, r = {}, i = {}, s = y({},
|
|
3495
|
+
[re.name]: re
|
|
3496
|
+
}, r = {}, i = {}, s = y({}, Rr), n = Yt();
|
|
3481
3497
|
let o = { global: {} };
|
|
3482
|
-
const a = {}, u =
|
|
3483
|
-
|
|
3484
|
-
function c(
|
|
3485
|
-
const d = S[
|
|
3498
|
+
const a = {}, u = kr(), l = {};
|
|
3499
|
+
Vr(t.attrs || {});
|
|
3500
|
+
function c(f) {
|
|
3501
|
+
const d = S[f];
|
|
3486
3502
|
if (Array.isArray(d))
|
|
3487
3503
|
return d.map(($) => $.api());
|
|
3488
3504
|
if (d)
|
|
3489
3505
|
return d.api();
|
|
3490
3506
|
}
|
|
3491
3507
|
function m() {
|
|
3492
|
-
const
|
|
3493
|
-
|
|
3508
|
+
const f = ie(...arguments);
|
|
3509
|
+
f.id && f.prop && (i[f.id] = f.prop);
|
|
3494
3510
|
}
|
|
3495
3511
|
function v() {
|
|
3496
|
-
const
|
|
3497
|
-
|
|
3512
|
+
const f = ie(...arguments);
|
|
3513
|
+
f.id && f.prop && (s[f.id] = N(y({}, f.prop), { name: f.id }));
|
|
3498
3514
|
}
|
|
3499
|
-
function _(
|
|
3500
|
-
u.use(
|
|
3515
|
+
function _(f) {
|
|
3516
|
+
u.use(f);
|
|
3501
3517
|
}
|
|
3502
3518
|
function g() {
|
|
3503
|
-
const
|
|
3504
|
-
if (!
|
|
3505
|
-
const d = I(
|
|
3506
|
-
r[d] = $, Object.setPrototypeOf($, b ||
|
|
3519
|
+
const f = ie(...arguments);
|
|
3520
|
+
if (!f.id || !f.prop) return ce;
|
|
3521
|
+
const d = I(f.id), $ = f.prop, b = $.merge === !0 ? r[d] : void 0;
|
|
3522
|
+
r[d] = $, Object.setPrototypeOf($, b || ce), n[d] = E(d), $.maker && p(n, $.maker);
|
|
3507
3523
|
}
|
|
3508
|
-
function
|
|
3524
|
+
function O(f, d) {
|
|
3509
3525
|
let $;
|
|
3510
|
-
if (
|
|
3511
|
-
if ($ = I(
|
|
3526
|
+
if (h.String(f)) {
|
|
3527
|
+
if ($ = I(f), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3512
3528
|
return W();
|
|
3513
3529
|
if (d === void 0)
|
|
3514
3530
|
return e[$];
|
|
3515
3531
|
} else
|
|
3516
|
-
$ = I(
|
|
3532
|
+
$ = I(f.name), d = f;
|
|
3517
3533
|
if (!$ || !d) return;
|
|
3518
3534
|
const b = I($);
|
|
3519
3535
|
e[$] = d, e[b] = d, delete u.aliasMap[$], delete u.aliasMap[b], delete r[$], delete r[b], d.formCreateParser && g($, d.formCreateParser);
|
|
3520
3536
|
}
|
|
3521
|
-
function
|
|
3537
|
+
function Ce(f) {
|
|
3522
3538
|
Object.keys(S).forEach((d) => {
|
|
3523
3539
|
(Array.isArray(S[d]) ? S[d] : [S[d]]).forEach((b) => {
|
|
3524
|
-
b.bus.$emit("p.loadData." +
|
|
3540
|
+
b.bus.$emit("p.loadData." + f);
|
|
3525
3541
|
});
|
|
3526
3542
|
});
|
|
3527
3543
|
}
|
|
3528
|
-
function
|
|
3529
|
-
a[
|
|
3544
|
+
function _e(f, d) {
|
|
3545
|
+
a[f] = d, Ce(f);
|
|
3530
3546
|
}
|
|
3531
|
-
function
|
|
3532
|
-
return
|
|
3547
|
+
function Oe(f, d) {
|
|
3548
|
+
return k(a, f) ? a[f] : d;
|
|
3533
3549
|
}
|
|
3534
|
-
function
|
|
3535
|
-
delete a[
|
|
3550
|
+
function ft(f) {
|
|
3551
|
+
delete a[f], Ce(f);
|
|
3536
3552
|
}
|
|
3537
3553
|
function W() {
|
|
3538
|
-
return
|
|
3554
|
+
return xt(we, e, i);
|
|
3539
3555
|
}
|
|
3540
|
-
function
|
|
3541
|
-
return
|
|
3556
|
+
function ke() {
|
|
3557
|
+
return re;
|
|
3542
3558
|
}
|
|
3543
|
-
function
|
|
3544
|
-
return
|
|
3559
|
+
function ht(f, d) {
|
|
3560
|
+
return h.Function(f.install) ? f.install(M, d) : h.Function(f) && f(M, d), this;
|
|
3545
3561
|
}
|
|
3546
|
-
function M(
|
|
3547
|
-
let b =
|
|
3562
|
+
function M(f, d, $) {
|
|
3563
|
+
let b = Ne(f, d || {});
|
|
3548
3564
|
const A = b.$refs.fc.formCreate;
|
|
3549
|
-
return A.$parent = $,
|
|
3565
|
+
return A.$parent = $, Me(A.options).appendChild(b.$el), A.api();
|
|
3550
3566
|
}
|
|
3551
3567
|
Object.setPrototypeOf(M, l);
|
|
3552
|
-
function
|
|
3568
|
+
function ct(f) {
|
|
3553
3569
|
let d = y({}, t);
|
|
3554
|
-
return
|
|
3570
|
+
return f ? d.inherit = {
|
|
3555
3571
|
components: e,
|
|
3556
3572
|
parsers: r,
|
|
3557
3573
|
directives: i,
|
|
3558
3574
|
providers: s,
|
|
3559
3575
|
maker: n,
|
|
3560
3576
|
loadData: a
|
|
3561
|
-
} : delete d.inherit,
|
|
3577
|
+
} : delete d.inherit, ut(d);
|
|
3562
3578
|
}
|
|
3563
|
-
function
|
|
3564
|
-
const d =
|
|
3579
|
+
function we(f) {
|
|
3580
|
+
const d = f.$options.propsData.rule;
|
|
3565
3581
|
p(this, {
|
|
3566
|
-
id:
|
|
3567
|
-
vm:
|
|
3582
|
+
id: Pr++,
|
|
3583
|
+
vm: f,
|
|
3568
3584
|
create: M,
|
|
3569
|
-
manager:
|
|
3585
|
+
manager: wr(t.manager),
|
|
3570
3586
|
parsers: r,
|
|
3571
3587
|
providers: s,
|
|
3572
3588
|
rules: Array.isArray(d) ? d : [],
|
|
3573
|
-
name:
|
|
3574
|
-
inFor:
|
|
3589
|
+
name: f.$options.propsData.name || ee(),
|
|
3590
|
+
inFor: f.$options.propsData.inFor,
|
|
3575
3591
|
prop: {
|
|
3576
3592
|
components: e,
|
|
3577
3593
|
directives: i
|
|
3578
3594
|
},
|
|
3579
|
-
setData:
|
|
3580
|
-
getData:
|
|
3595
|
+
setData: _e,
|
|
3596
|
+
getData: Oe,
|
|
3581
3597
|
loadData: a,
|
|
3582
3598
|
CreateNode: u,
|
|
3583
3599
|
bus: new T(),
|
|
@@ -3586,23 +3602,23 @@ function ft(t) {
|
|
|
3586
3602
|
extendApi: t.extendApi || (($) => $)
|
|
3587
3603
|
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3588
3604
|
}
|
|
3589
|
-
p(
|
|
3605
|
+
p(we.prototype, {
|
|
3590
3606
|
init() {
|
|
3591
|
-
const
|
|
3592
|
-
this.$handle = d,
|
|
3593
|
-
this.isSub() && (this.unwatch =
|
|
3594
|
-
this.initOptions(),
|
|
3607
|
+
const f = this.vm, d = new V(this);
|
|
3608
|
+
this.$handle = d, f.$f = d.api, f.$emit("input", d.api), f.$on("hook:created", () => {
|
|
3609
|
+
this.isSub() && (this.unwatch = f.$watch(() => f.$pfc.option, () => {
|
|
3610
|
+
this.initOptions(), f.$f.refresh();
|
|
3595
3611
|
}, { deep: !0 }), this.initOptions()), this.created();
|
|
3596
|
-
}),
|
|
3612
|
+
}), f.$on("hook:mounted", () => {
|
|
3597
3613
|
this.mounted();
|
|
3598
|
-
}),
|
|
3599
|
-
if (
|
|
3614
|
+
}), f.$on("hook:beforeDestroy", () => {
|
|
3615
|
+
if (f.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
|
|
3600
3616
|
if (this.inFor) {
|
|
3601
3617
|
const $ = S[this.name].indexOf(this);
|
|
3602
3618
|
S[this.name].splice($, 1), S[this.name].length || delete S[this.name];
|
|
3603
3619
|
} else
|
|
3604
3620
|
delete S[this.name];
|
|
3605
|
-
}),
|
|
3621
|
+
}), f.$on("hook:updated", () => {
|
|
3606
3622
|
d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
|
|
3607
3623
|
});
|
|
3608
3624
|
},
|
|
@@ -3611,16 +3627,16 @@ function ft(t) {
|
|
|
3611
3627
|
},
|
|
3612
3628
|
initOptions() {
|
|
3613
3629
|
this.options = {};
|
|
3614
|
-
let
|
|
3615
|
-
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0),
|
|
3630
|
+
let f = y({ formData: {}, submitBtn: {}, resetBtn: {} }, L(o));
|
|
3631
|
+
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0), f = this.mergeOptions(f, this.vm.$options.propsData.option), this.updateOptions(f);
|
|
3616
3632
|
},
|
|
3617
|
-
mergeOptions(
|
|
3633
|
+
mergeOptions(f, d, $) {
|
|
3618
3634
|
return d = L(d), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el"].forEach((b) => {
|
|
3619
3635
|
delete d[b];
|
|
3620
|
-
}), d.global && (
|
|
3636
|
+
}), d.global && (f.global = Qt(f.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], f), f;
|
|
3621
3637
|
},
|
|
3622
|
-
updateOptions(
|
|
3623
|
-
this.mergeOptions(this.options,
|
|
3638
|
+
updateOptions(f) {
|
|
3639
|
+
this.mergeOptions(this.options, f), this.$handle.$manager.updateOptions(this.options);
|
|
3624
3640
|
},
|
|
3625
3641
|
created() {
|
|
3626
3642
|
this.$handle.init(), this.vm.$emit("created", this.api());
|
|
@@ -3635,35 +3651,35 @@ function ft(t) {
|
|
|
3635
3651
|
this.$handle.mounted();
|
|
3636
3652
|
}
|
|
3637
3653
|
});
|
|
3638
|
-
function
|
|
3639
|
-
p(
|
|
3654
|
+
function Fe(f) {
|
|
3655
|
+
p(f, {
|
|
3640
3656
|
version: t.version,
|
|
3641
3657
|
ui: t.ui,
|
|
3642
|
-
setData:
|
|
3643
|
-
getData:
|
|
3644
|
-
removeData:
|
|
3658
|
+
setData: _e,
|
|
3659
|
+
getData: Oe,
|
|
3660
|
+
removeData: ft,
|
|
3645
3661
|
maker: n,
|
|
3646
|
-
component:
|
|
3662
|
+
component: O,
|
|
3647
3663
|
directive: m,
|
|
3648
3664
|
register: v,
|
|
3649
|
-
$vnode:
|
|
3665
|
+
$vnode: ke,
|
|
3650
3666
|
parser: g,
|
|
3651
|
-
use:
|
|
3652
|
-
factory:
|
|
3667
|
+
use: ht,
|
|
3668
|
+
factory: ct,
|
|
3653
3669
|
componentAlias: _,
|
|
3654
|
-
copyRule:
|
|
3655
|
-
copyRules:
|
|
3656
|
-
fetch:
|
|
3670
|
+
copyRule: $e,
|
|
3671
|
+
copyRules: Qe,
|
|
3672
|
+
fetch: rt,
|
|
3657
3673
|
$form: W,
|
|
3658
3674
|
parseFn: q,
|
|
3659
|
-
parseJson:
|
|
3660
|
-
toJson:
|
|
3675
|
+
parseJson: zt,
|
|
3676
|
+
toJson: ze,
|
|
3661
3677
|
getApi: c,
|
|
3662
3678
|
init(d, $ = {}) {
|
|
3663
|
-
let b =
|
|
3679
|
+
let b = Ne(d, $), A = b.$refs.fc.formCreate;
|
|
3664
3680
|
return {
|
|
3665
|
-
mount(
|
|
3666
|
-
return
|
|
3681
|
+
mount(J) {
|
|
3682
|
+
return J && h.Element(J) && (A.options.el = J), Me(A.options).appendChild(b.$el), A.api();
|
|
3667
3683
|
},
|
|
3668
3684
|
remove() {
|
|
3669
3685
|
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
@@ -3676,22 +3692,22 @@ function ft(t) {
|
|
|
3676
3692
|
}
|
|
3677
3693
|
});
|
|
3678
3694
|
}
|
|
3679
|
-
function
|
|
3680
|
-
p(
|
|
3695
|
+
function dt(f) {
|
|
3696
|
+
p(f, {
|
|
3681
3697
|
create: M,
|
|
3682
3698
|
install(d, $) {
|
|
3683
3699
|
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
3684
3700
|
d._installedFormCreate = !0;
|
|
3685
|
-
const b = function(A,
|
|
3686
|
-
return M(A,
|
|
3701
|
+
const b = function(A, J = {}) {
|
|
3702
|
+
return M(A, J, this);
|
|
3687
3703
|
};
|
|
3688
|
-
|
|
3704
|
+
Fe(b), d.prototype.$formCreate = b, d.component("FormCreate", W()), d.component("FcFragment", ke());
|
|
3689
3705
|
}
|
|
3690
3706
|
});
|
|
3691
3707
|
}
|
|
3692
|
-
if (
|
|
3693
|
-
const
|
|
3694
|
-
|
|
3708
|
+
if (Fe(l), dt(l), u.use({ fragment: "fcFragment" }), g(Ir), t.install && M.use(t), t.inherit) {
|
|
3709
|
+
const f = t.inherit;
|
|
3710
|
+
f.components && p(e, f.components), f.parsers && p(r, f.parsers), f.directives && p(i, f.directives), f.providers && p(s, f.providers), f.maker && p(n, f.maker), f.loadData && p(a, f.loadData);
|
|
3695
3711
|
}
|
|
3696
3712
|
const G = W();
|
|
3697
3713
|
return Object.setPrototypeOf(G, l), Object.defineProperties(G, {
|
|
@@ -3699,13 +3715,13 @@ function ft(t) {
|
|
|
3699
3715
|
get() {
|
|
3700
3716
|
return l.fetch;
|
|
3701
3717
|
},
|
|
3702
|
-
set(
|
|
3703
|
-
l.fetch =
|
|
3718
|
+
set(f) {
|
|
3719
|
+
l.fetch = f;
|
|
3704
3720
|
}
|
|
3705
3721
|
}
|
|
3706
3722
|
}), G.util = l, G;
|
|
3707
3723
|
}
|
|
3708
|
-
const
|
|
3724
|
+
const qe = {
|
|
3709
3725
|
date: "yyyy-MM-dd",
|
|
3710
3726
|
month: "yyyy-MM",
|
|
3711
3727
|
datetime: "yyyy-MM-dd HH:mm:ss",
|
|
@@ -3714,73 +3730,73 @@ const Ue = {
|
|
|
3714
3730
|
monthrange: "yyyy-MM",
|
|
3715
3731
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
3716
3732
|
year: "yyyy"
|
|
3717
|
-
},
|
|
3718
|
-
name:
|
|
3733
|
+
}, Ue = "datePicker", Tr = {
|
|
3734
|
+
name: Ue,
|
|
3719
3735
|
maker: function() {
|
|
3720
|
-
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = E(
|
|
3736
|
+
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = E(Ue, { type: e.toLowerCase() }), t), {});
|
|
3721
3737
|
}(),
|
|
3722
3738
|
mergeProp(t) {
|
|
3723
3739
|
const e = t.prop.props;
|
|
3724
|
-
e.valueFormat || (e.valueFormat =
|
|
3740
|
+
e.valueFormat || (e.valueFormat = qe[e.type] || qe.date);
|
|
3725
3741
|
}
|
|
3726
|
-
},
|
|
3727
|
-
name:
|
|
3742
|
+
}, ne = "hidden", Dr = {
|
|
3743
|
+
name: ne,
|
|
3728
3744
|
maker: {
|
|
3729
|
-
[
|
|
3745
|
+
[ne]: (t, e) => E(ne)("", t, e)
|
|
3730
3746
|
},
|
|
3731
3747
|
render() {
|
|
3732
3748
|
return [];
|
|
3733
3749
|
}
|
|
3734
|
-
},
|
|
3735
|
-
name:
|
|
3750
|
+
}, se = "input", Br = {
|
|
3751
|
+
name: se,
|
|
3736
3752
|
maker: function() {
|
|
3737
|
-
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = E(
|
|
3738
|
-
return t.idate = E(
|
|
3753
|
+
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = E(se, { type: r }), e), {});
|
|
3754
|
+
return t.idate = E(se, { type: "date" }), t;
|
|
3739
3755
|
}(),
|
|
3740
3756
|
mergeProp(t) {
|
|
3741
3757
|
let { props: e } = t.prop;
|
|
3742
3758
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
3743
3759
|
}
|
|
3744
|
-
},
|
|
3745
|
-
name:
|
|
3760
|
+
}, He = "slider", Lr = {
|
|
3761
|
+
name: He,
|
|
3746
3762
|
maker: {
|
|
3747
|
-
sliderRange: E(
|
|
3763
|
+
sliderRange: E(He, { range: !0 })
|
|
3748
3764
|
},
|
|
3749
3765
|
toFormValue(t, e) {
|
|
3750
3766
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
3751
3767
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
3752
3768
|
}
|
|
3753
|
-
},
|
|
3754
|
-
name:
|
|
3769
|
+
}, oe = "timePicker", Mr = {
|
|
3770
|
+
name: oe,
|
|
3755
3771
|
maker: {
|
|
3756
|
-
time: E(
|
|
3757
|
-
timeRange: E(
|
|
3772
|
+
time: E(oe, (t) => t.props.isRange = !1),
|
|
3773
|
+
timeRange: E(oe, (t) => t.props.isRange = !0)
|
|
3758
3774
|
},
|
|
3759
3775
|
mergeProp(t) {
|
|
3760
3776
|
const e = t.prop.props;
|
|
3761
3777
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
3762
3778
|
}
|
|
3763
|
-
},
|
|
3779
|
+
}, Nr = {
|
|
3764
3780
|
name: "FcRow",
|
|
3765
3781
|
render(t, e) {
|
|
3766
3782
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
3767
3783
|
e.vNode.row(e.prop, t)
|
|
3768
3784
|
]);
|
|
3769
3785
|
}
|
|
3770
|
-
},
|
|
3771
|
-
name:
|
|
3786
|
+
}, qr = "select", Ur = {
|
|
3787
|
+
name: qr,
|
|
3772
3788
|
toFormValue(t, e) {
|
|
3773
3789
|
return e.prop.props.multiple && !Array.isArray(t) ? j(t) : t;
|
|
3774
3790
|
}
|
|
3775
|
-
},
|
|
3791
|
+
}, Hr = [
|
|
3792
|
+
Tr,
|
|
3793
|
+
Dr,
|
|
3776
3794
|
Br,
|
|
3777
3795
|
Lr,
|
|
3778
3796
|
Mr,
|
|
3779
3797
|
Nr,
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
xr
|
|
3783
|
-
], C = "el", Kr = {
|
|
3798
|
+
Ur
|
|
3799
|
+
], C = "el", Jr = {
|
|
3784
3800
|
button: C + "Button",
|
|
3785
3801
|
icon: "i",
|
|
3786
3802
|
slider: C + "Slider",
|
|
@@ -3812,7 +3828,7 @@ const Ue = {
|
|
|
3812
3828
|
object: "fcSubForm",
|
|
3813
3829
|
subForm: "fcSubForm"
|
|
3814
3830
|
};
|
|
3815
|
-
function
|
|
3831
|
+
function xr() {
|
|
3816
3832
|
return {
|
|
3817
3833
|
form: {
|
|
3818
3834
|
inline: !1,
|
|
@@ -3846,23 +3862,23 @@ function Wr() {
|
|
|
3846
3862
|
}
|
|
3847
3863
|
};
|
|
3848
3864
|
}
|
|
3849
|
-
function
|
|
3865
|
+
function Kr(t) {
|
|
3850
3866
|
return t.type === "tooltip";
|
|
3851
3867
|
}
|
|
3852
|
-
const
|
|
3853
|
-
function
|
|
3854
|
-
return !
|
|
3868
|
+
const Wr = /[A-Z]/;
|
|
3869
|
+
function Gr(t, e) {
|
|
3870
|
+
return !Wr.test(t) && (h.String(e) || h.Number(e));
|
|
3855
3871
|
}
|
|
3856
3872
|
function Je(t, e) {
|
|
3857
|
-
|
|
3873
|
+
k(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3858
3874
|
}
|
|
3859
3875
|
function P(t) {
|
|
3860
3876
|
return t === !1;
|
|
3861
3877
|
}
|
|
3862
|
-
function
|
|
3863
|
-
|
|
3878
|
+
function Xr(t, e) {
|
|
3879
|
+
k(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3864
3880
|
}
|
|
3865
|
-
const
|
|
3881
|
+
const zr = {
|
|
3866
3882
|
validate() {
|
|
3867
3883
|
const t = this.form();
|
|
3868
3884
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -3881,7 +3897,7 @@ const Zr = {
|
|
|
3881
3897
|
},
|
|
3882
3898
|
tidyOptions(t) {
|
|
3883
3899
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
3884
|
-
|
|
3900
|
+
Xr(t, e);
|
|
3885
3901
|
}), t;
|
|
3886
3902
|
},
|
|
3887
3903
|
tidyRule({ prop: t }) {
|
|
@@ -3890,7 +3906,7 @@ const Zr = {
|
|
|
3890
3906
|
mergeProp(t) {
|
|
3891
3907
|
let e = t.prop.props;
|
|
3892
3908
|
t.prop = D([{
|
|
3893
|
-
attrs: Object.keys(e).reduce((r, i) => (
|
|
3909
|
+
attrs: Object.keys(e).reduce((r, i) => (Gr(i, e[i]) && (r[i] = e[i]), r), {}),
|
|
3894
3910
|
info: this.options.info || {},
|
|
3895
3911
|
wrap: this.options.wrap || {},
|
|
3896
3912
|
col: this.options.col || {},
|
|
@@ -3907,7 +3923,7 @@ const Zr = {
|
|
|
3907
3923
|
}, { normal: ["title", "info", "col", "wrap"] });
|
|
3908
3924
|
},
|
|
3909
3925
|
getDefaultOptions() {
|
|
3910
|
-
return
|
|
3926
|
+
return xr();
|
|
3911
3927
|
},
|
|
3912
3928
|
update() {
|
|
3913
3929
|
const t = this.options.form;
|
|
@@ -3936,7 +3952,7 @@ const Zr = {
|
|
|
3936
3952
|
makeWrap(t, e) {
|
|
3937
3953
|
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r), o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: u } = this.rule.props, l = P(r.wrap.show) ? e : this.$r(D([r.wrap, {
|
|
3938
3954
|
props: N(y({
|
|
3939
|
-
labelWidth: o === void 0 ? o :
|
|
3955
|
+
labelWidth: o === void 0 ? o : nt(o),
|
|
3940
3956
|
label: n ? r.title.title : void 0
|
|
3941
3957
|
}, r.wrap || {}), {
|
|
3942
3958
|
prop: t.id,
|
|
@@ -3955,7 +3971,7 @@ const Zr = {
|
|
|
3955
3971
|
return !(!e.title && !e.native || P(e.show));
|
|
3956
3972
|
},
|
|
3957
3973
|
makeInfo(t, e, r) {
|
|
3958
|
-
const i = t.title, s = t.info, n =
|
|
3974
|
+
const i = t.title, s = t.info, n = Kr(s), o = this.options.form, a = this.getSlot("title"), u = [a ? a({ title: i.title || "", rule: r.rule, options: this.options }) : (i.title || "") + (o.labelSuffix || o["label-suffix"] || "")];
|
|
3959
3975
|
if (!P(s.show) && (s.info || s.native) && !P(s.icon)) {
|
|
3960
3976
|
const l = {
|
|
3961
3977
|
type: s.type || "popover",
|
|
@@ -3963,7 +3979,7 @@ const Zr = {
|
|
|
3963
3979
|
key: `${e}pop`,
|
|
3964
3980
|
slot: "label"
|
|
3965
3981
|
}, c = "content";
|
|
3966
|
-
s.info && !
|
|
3982
|
+
s.info && !k(l.props, c) && (l.props[c] = s.info), u[s.align !== "left" ? "unshift" : "push"](this.$r(D([s, l]), [
|
|
3967
3983
|
this.$r({
|
|
3968
3984
|
type: "i",
|
|
3969
3985
|
slot: n ? "default" : "reference",
|
|
@@ -4042,25 +4058,25 @@ const Zr = {
|
|
|
4042
4058
|
}, [t.innerText]);
|
|
4043
4059
|
}
|
|
4044
4060
|
}, H = {};
|
|
4061
|
+
Qr(H);
|
|
4062
|
+
Zr(H);
|
|
4045
4063
|
Yr(H);
|
|
4046
4064
|
ei(H);
|
|
4047
4065
|
ti(H);
|
|
4048
|
-
|
|
4049
|
-
ii(H);
|
|
4050
|
-
function Yr(t) {
|
|
4066
|
+
function Qr(t) {
|
|
4051
4067
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4052
4068
|
t[e] = E(e);
|
|
4053
4069
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4054
4070
|
}
|
|
4055
|
-
function
|
|
4071
|
+
function Zr(t) {
|
|
4056
4072
|
const e = "select", r = "multiple";
|
|
4057
4073
|
t.selectMultiple = E(e, { [r]: !0 }), t.selectOne = E(e, { [r]: !1 });
|
|
4058
4074
|
}
|
|
4059
|
-
function
|
|
4075
|
+
function Yr(t) {
|
|
4060
4076
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4061
4077
|
Object.keys(r).reduce((i, s) => (i[s] = E(e, { type: r[s] }), i), t);
|
|
4062
4078
|
}
|
|
4063
|
-
function
|
|
4079
|
+
function ei(t) {
|
|
4064
4080
|
const e = "upload", r = {
|
|
4065
4081
|
image: ["image", 0],
|
|
4066
4082
|
file: ["file", 0],
|
|
@@ -4069,7 +4085,7 @@ function ri(t) {
|
|
|
4069
4085
|
};
|
|
4070
4086
|
Object.keys(r).reduce((i, s) => (i[s] = E(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4071
4087
|
}
|
|
4072
|
-
function
|
|
4088
|
+
function ti(t) {
|
|
4073
4089
|
const e = {
|
|
4074
4090
|
frameInputs: ["input", 0],
|
|
4075
4091
|
frameFiles: ["file", 0],
|
|
@@ -4080,10 +4096,10 @@ function ii(t) {
|
|
|
4080
4096
|
};
|
|
4081
4097
|
return Object.keys(e).reduce((r, i) => (r[i] = E("frame", (s) => s.props({ type: e[i][0], maxLength: e[i][1] })), r), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages, t;
|
|
4082
4098
|
}
|
|
4083
|
-
function
|
|
4084
|
-
return
|
|
4099
|
+
function xe(t, e) {
|
|
4100
|
+
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4085
4101
|
}
|
|
4086
|
-
function
|
|
4102
|
+
function ri(t, e) {
|
|
4087
4103
|
return p(t, {
|
|
4088
4104
|
formEl() {
|
|
4089
4105
|
return e.$manager.form();
|
|
@@ -4157,41 +4173,41 @@ function ni(t, e) {
|
|
|
4157
4173
|
}
|
|
4158
4174
|
},
|
|
4159
4175
|
submitBtnProps: (r = {}) => {
|
|
4160
|
-
let i =
|
|
4176
|
+
let i = xe(e.options.submitBtn, !0);
|
|
4161
4177
|
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4162
4178
|
},
|
|
4163
4179
|
resetBtnProps: (r = {}) => {
|
|
4164
|
-
let i =
|
|
4180
|
+
let i = xe(e.options.resetBtn, !1);
|
|
4165
4181
|
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4166
4182
|
},
|
|
4167
4183
|
submit(r, i) {
|
|
4168
4184
|
t.validate((s) => {
|
|
4169
4185
|
if (s) {
|
|
4170
4186
|
let n = t.formData();
|
|
4171
|
-
|
|
4187
|
+
h.Function(r) ? R(() => r(n, this)) : (h.Function(e.options.onSubmit) && R(() => e.options.onSubmit(n, this)), e.vm.$emit("submit", n, this));
|
|
4172
4188
|
} else
|
|
4173
|
-
|
|
4189
|
+
h.Function(i) && R(() => i(this, ...arguments));
|
|
4174
4190
|
}).catch((s) => {
|
|
4175
4191
|
});
|
|
4176
4192
|
}
|
|
4177
4193
|
}), t;
|
|
4178
4194
|
}
|
|
4179
|
-
function
|
|
4180
|
-
t.componentAlias(
|
|
4195
|
+
function ii(t) {
|
|
4196
|
+
t.componentAlias(Jr), Jt.forEach((e) => {
|
|
4181
4197
|
t.component(e.name, e);
|
|
4182
|
-
}),
|
|
4198
|
+
}), Hr.forEach((e) => {
|
|
4183
4199
|
t.parser(e);
|
|
4184
4200
|
}), Object.keys(H).forEach((e) => {
|
|
4185
4201
|
t.maker[e] = H[e];
|
|
4186
4202
|
});
|
|
4187
4203
|
}
|
|
4188
|
-
function
|
|
4189
|
-
return
|
|
4204
|
+
function ni() {
|
|
4205
|
+
return ut({
|
|
4190
4206
|
ui: "element-ui",
|
|
4191
|
-
version: "2.6.
|
|
4192
|
-
manager:
|
|
4193
|
-
extendApi:
|
|
4194
|
-
install:
|
|
4207
|
+
version: "2.6.3",
|
|
4208
|
+
manager: zr,
|
|
4209
|
+
extendApi: ri,
|
|
4210
|
+
install: ii,
|
|
4195
4211
|
attrs: {
|
|
4196
4212
|
normal: ["col", "wrap"],
|
|
4197
4213
|
array: ["className"],
|
|
@@ -4199,10 +4215,10 @@ function oi() {
|
|
|
4199
4215
|
}
|
|
4200
4216
|
});
|
|
4201
4217
|
}
|
|
4202
|
-
const
|
|
4203
|
-
typeof window != "undefined" && (window.formCreate =
|
|
4204
|
-
const
|
|
4218
|
+
const de = ni();
|
|
4219
|
+
typeof window != "undefined" && (window.formCreate = de, window.Vue && de.install(window.Vue));
|
|
4220
|
+
const ai = de.maker;
|
|
4205
4221
|
export {
|
|
4206
|
-
|
|
4207
|
-
|
|
4222
|
+
de as default,
|
|
4223
|
+
ai as maker
|
|
4208
4224
|
};
|