@form-create/view-design 2.6.1 → 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 +505 -486
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +5 -5
package/dist/form-create.esm.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/view-design v2.6.
|
|
3
|
+
* @form-create/view-design 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-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;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 .ivu-upload-list{margin-top:0}._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn,._fc-frame .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;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;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 .ivu-upload-list{margin-top:0}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._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;box-shadow:2px 2px 5px #0000001a;margin-right:4px;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 .ivu-form-item{margin-bottom:24px}.form-create .form-create .ivu-form-item .ivu-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 yt = Object.defineProperty, gt = Object.defineProperties;
|
|
11
|
+
var $t = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var Se = Object.getOwnPropertySymbols;
|
|
13
|
+
var vt = Object.prototype.hasOwnProperty, bt = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var Ee = (t, e, r) => e in t ? yt(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
|
+
vt.call(e, r) && Ee(t, r, e[r]);
|
|
17
|
+
if (Se)
|
|
18
|
+
for (var r of Se(e))
|
|
19
|
+
bt.call(e, r) && Ee(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
}, q = (t, e) =>
|
|
21
|
+
}, q = (t, e) => gt(t, $t(e));
|
|
22
22
|
import P from "vue";
|
|
23
|
-
function
|
|
23
|
+
function Ct(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
26
|
function ae() {
|
|
@@ -29,33 +29,33 @@ function ae() {
|
|
|
29
29
|
return t;
|
|
30
30
|
}, ae.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var _t = ["attrs", "props", "domProps"], Ot = ["class", "style", "directives"], kt = ["on", "nativeOn"], wt = 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 (_t.indexOf(i) !== -1) e[i] = ae({}, e[i], r[i]);
|
|
36
|
+
else if (Ot.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 (kt.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] ? Ft(e[i][l], r[i][l]) : r[i][l];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, Ft = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const C = /* @__PURE__ */
|
|
54
|
-
function
|
|
52
|
+
}, St = wt;
|
|
53
|
+
const C = /* @__PURE__ */ Ct(St);
|
|
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 Et = "fcCheckbox", Rt = {
|
|
58
|
+
name: Et,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -117,7 +117,7 @@ const jt = "fcCheckbox", At = {
|
|
|
117
117
|
}, {
|
|
118
118
|
key: "" + r + "-" + e.value
|
|
119
119
|
}]));
|
|
120
|
-
}),
|
|
120
|
+
}), Y(this.$slots)]);
|
|
121
121
|
},
|
|
122
122
|
mounted() {
|
|
123
123
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -126,10 +126,10 @@ const jt = "fcCheckbox", At = {
|
|
|
126
126
|
function I(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
function
|
|
129
|
+
const It = "fcFrame";
|
|
130
|
+
function ze(t) {
|
|
131
131
|
return {
|
|
132
|
-
name:
|
|
132
|
+
name: It,
|
|
133
133
|
props: {
|
|
134
134
|
formCreateInject: {
|
|
135
135
|
type: Object,
|
|
@@ -503,16 +503,16 @@ function xe(t) {
|
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
const
|
|
506
|
+
const We = ze({
|
|
507
507
|
fileIcon: "md-document",
|
|
508
508
|
fileUpIcon: "ios-folder-open"
|
|
509
509
|
});
|
|
510
|
-
|
|
510
|
+
We.v2 = ze({
|
|
511
511
|
fileIcon: "document-text",
|
|
512
512
|
fileUpIcon: "folder"
|
|
513
513
|
});
|
|
514
|
-
const
|
|
515
|
-
name:
|
|
514
|
+
const jt = "fcRadio", At = {
|
|
515
|
+
name: jt,
|
|
516
516
|
props: {
|
|
517
517
|
formCreateInject: {
|
|
518
518
|
type: Object,
|
|
@@ -569,12 +569,12 @@ const Pt = "fcRadio", Dt = {
|
|
|
569
569
|
}, {
|
|
570
570
|
key: "" + r + "-" + e.value
|
|
571
571
|
}]));
|
|
572
|
-
}),
|
|
572
|
+
}), Y(this.$slots)]);
|
|
573
573
|
},
|
|
574
574
|
mounted() {
|
|
575
575
|
this.$emit("fc.el", this.$refs.el);
|
|
576
576
|
}
|
|
577
|
-
},
|
|
577
|
+
}, h = {
|
|
578
578
|
type(t, e) {
|
|
579
579
|
return Object.prototype.toString.call(t) === "[object " + e + "]";
|
|
580
580
|
},
|
|
@@ -582,7 +582,7 @@ const Pt = "fcRadio", Dt = {
|
|
|
582
582
|
return t == null;
|
|
583
583
|
},
|
|
584
584
|
Element(t) {
|
|
585
|
-
return typeof t == "object" && t !== null && t.nodeType === 1 && !
|
|
585
|
+
return typeof t == "object" && t !== null && t.nodeType === 1 && !h.Object(t);
|
|
586
586
|
},
|
|
587
587
|
trueArray(t) {
|
|
588
588
|
return Array.isArray(t) && t.length > 0;
|
|
@@ -600,15 +600,15 @@ const Pt = "fcRadio", Dt = {
|
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
602
|
["Date", "Object", "String", "Boolean", "Array", "Number"].forEach((t) => {
|
|
603
|
-
|
|
604
|
-
return
|
|
603
|
+
h[t] = function(e) {
|
|
604
|
+
return h.type(e, t);
|
|
605
605
|
};
|
|
606
606
|
});
|
|
607
607
|
function k(t, e) {
|
|
608
608
|
return {}.hasOwnProperty.call(t, e);
|
|
609
609
|
}
|
|
610
|
-
const
|
|
611
|
-
name:
|
|
610
|
+
const Vt = "fcSelect", Pt = {
|
|
611
|
+
name: Vt,
|
|
612
612
|
functional: !0,
|
|
613
613
|
props: {
|
|
614
614
|
formCreateInject: {
|
|
@@ -625,13 +625,13 @@ const Tt = "fcSelect", Bt = {
|
|
|
625
625
|
key: "" + o + "-" + n.value
|
|
626
626
|
}]), [a ? t("template", {
|
|
627
627
|
slot: n.slotName || "default"
|
|
628
|
-
}, [
|
|
628
|
+
}, [h.Function(a) ? n.slot(t) : a]) : null]);
|
|
629
629
|
}, i = (n, o) => t("OptionGroup", {
|
|
630
630
|
attrs: {
|
|
631
631
|
label: n.label
|
|
632
632
|
},
|
|
633
633
|
key: "" + o + "-" + n.label
|
|
634
|
-
}, [
|
|
634
|
+
}, [h.trueArray(n.options) && n.options.map((a, u) => r(a, u))]), s = e.props.formCreateInject.options;
|
|
635
635
|
return t("Select", C([{}, e.data, {
|
|
636
636
|
ref: "el"
|
|
637
637
|
}]), [(Array.isArray(s) ? s : []).map((n, o) => k(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
@@ -639,8 +639,8 @@ const Tt = "fcSelect", Bt = {
|
|
|
639
639
|
mounted() {
|
|
640
640
|
this.$emit("fc.el", this.$refs.el);
|
|
641
641
|
}
|
|
642
|
-
},
|
|
643
|
-
name:
|
|
642
|
+
}, Dt = "fcTree", Tt = {
|
|
643
|
+
name: Dt,
|
|
644
644
|
props: {
|
|
645
645
|
formCreateInject: {
|
|
646
646
|
type: Object,
|
|
@@ -688,25 +688,25 @@ const Tt = "fcSelect", Bt = {
|
|
|
688
688
|
ref: "tree"
|
|
689
689
|
}, {
|
|
690
690
|
on: e
|
|
691
|
-
}]), [
|
|
691
|
+
}]), [Y(this.$slots)]);
|
|
692
692
|
},
|
|
693
693
|
mounted() {
|
|
694
694
|
this.$emit("fc.el", this.$refs.tree);
|
|
695
695
|
}
|
|
696
696
|
};
|
|
697
|
-
function
|
|
697
|
+
function Re(t) {
|
|
698
698
|
return {
|
|
699
699
|
url: t,
|
|
700
|
-
name:
|
|
700
|
+
name: Bt(t)
|
|
701
701
|
};
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function Bt(t) {
|
|
704
704
|
return ("" + t).split("/").pop();
|
|
705
705
|
}
|
|
706
|
-
const
|
|
707
|
-
function
|
|
706
|
+
const Lt = "fcUpload";
|
|
707
|
+
function Ge(t) {
|
|
708
708
|
return {
|
|
709
|
-
name:
|
|
709
|
+
name: Lt,
|
|
710
710
|
props: {
|
|
711
711
|
formCreateInject: {
|
|
712
712
|
type: Object,
|
|
@@ -747,11 +747,11 @@ function Ke(t) {
|
|
|
747
747
|
};
|
|
748
748
|
},
|
|
749
749
|
created() {
|
|
750
|
-
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList = I(this.value).map(
|
|
750
|
+
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList = I(this.value).map(Re);
|
|
751
751
|
},
|
|
752
752
|
watch: {
|
|
753
753
|
value(e) {
|
|
754
|
-
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList = I(e).map(
|
|
754
|
+
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList = I(e).map(Re), this.uploadList = this.$refs.upload.fileList);
|
|
755
755
|
},
|
|
756
756
|
maxLength(e, r) {
|
|
757
757
|
(r === 1 || e === 1) && this.update();
|
|
@@ -857,7 +857,7 @@ function Ke(t) {
|
|
|
857
857
|
type: this.uploadType === "file" ? "ios-cloud-upload-outline" : t.imgUpIcon,
|
|
858
858
|
size: 20
|
|
859
859
|
}
|
|
860
|
-
}]))])]) : null,
|
|
860
|
+
}]))])]) : null, Y(this.$slots, ["default"])]);
|
|
861
861
|
},
|
|
862
862
|
update() {
|
|
863
863
|
let e = this.$refs.upload.fileList.map((r) => r.url).filter((r) => r !== void 0);
|
|
@@ -900,11 +900,11 @@ function Ke(t) {
|
|
|
900
900
|
}
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
|
-
const
|
|
903
|
+
const Ke = Ge({
|
|
904
904
|
fileIcon: "md-document",
|
|
905
905
|
imgUpIcon: "md-images"
|
|
906
906
|
});
|
|
907
|
-
|
|
907
|
+
Ke.v2 = Ge({
|
|
908
908
|
fileIcon: "document-text",
|
|
909
909
|
imgUpIcon: "image"
|
|
910
910
|
});
|
|
@@ -914,12 +914,12 @@ function w(t, e, r) {
|
|
|
914
914
|
function T(t, e) {
|
|
915
915
|
P.delete(t, e);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function z(t, e = {}, r) {
|
|
918
918
|
let i = !1;
|
|
919
919
|
for (let s in e)
|
|
920
920
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
921
921
|
let n = e[s];
|
|
922
|
-
if ((i = Array.isArray(n)) ||
|
|
922
|
+
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
923
923
|
let o = t[s] === void 0;
|
|
924
924
|
if (i)
|
|
925
925
|
i = !1, o && w(t, s, []);
|
|
@@ -932,26 +932,26 @@ function W(t, e = {}, r) {
|
|
|
932
932
|
}
|
|
933
933
|
else
|
|
934
934
|
o && w(t, s, {});
|
|
935
|
-
t[s] =
|
|
935
|
+
t[s] = z(t[s], n, r);
|
|
936
936
|
} else
|
|
937
|
-
w(t, s, n),
|
|
937
|
+
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));
|
|
938
938
|
}
|
|
939
939
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
940
940
|
}
|
|
941
941
|
function B(t) {
|
|
942
|
-
return
|
|
942
|
+
return z({}, { value: t }).value;
|
|
943
943
|
}
|
|
944
|
-
const
|
|
944
|
+
const Nt = Object.assign || function(t) {
|
|
945
945
|
for (let e, r = 1; r < arguments.length; r++)
|
|
946
946
|
for (let i in e = arguments[r], e)
|
|
947
947
|
Object.prototype.hasOwnProperty.call(e, i) && w(t, i, e[i]);
|
|
948
948
|
return t;
|
|
949
949
|
};
|
|
950
950
|
function p() {
|
|
951
|
-
return
|
|
951
|
+
return Nt.apply(this, arguments);
|
|
952
952
|
}
|
|
953
|
-
const
|
|
954
|
-
name:
|
|
953
|
+
const Mt = "fcGroup", Ut = {
|
|
954
|
+
name: Mt,
|
|
955
955
|
props: {
|
|
956
956
|
field: String,
|
|
957
957
|
rule: [Array, Object],
|
|
@@ -1032,7 +1032,7 @@ const Ht = "fcGroup", Jt = {
|
|
|
1032
1032
|
const s = i.$f.formData();
|
|
1033
1033
|
if (t === e)
|
|
1034
1034
|
i.$f.deferSyncValue(() => {
|
|
1035
|
-
|
|
1035
|
+
z(i.rule, t), i.$f.setValue(s);
|
|
1036
1036
|
}, !0);
|
|
1037
1037
|
else {
|
|
1038
1038
|
const n = i.$f.formData();
|
|
@@ -1250,8 +1250,8 @@ const Ht = "fcGroup", Jt = {
|
|
|
1250
1250
|
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1251
1251
|
}, [n]);
|
|
1252
1252
|
}
|
|
1253
|
-
},
|
|
1254
|
-
name:
|
|
1253
|
+
}, qt = "fcSubForm", Ht = {
|
|
1254
|
+
name: qt,
|
|
1255
1255
|
props: {
|
|
1256
1256
|
rule: Array,
|
|
1257
1257
|
options: Object,
|
|
@@ -1334,16 +1334,16 @@ const Ht = "fcGroup", Jt = {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
}]));
|
|
1336
1336
|
}
|
|
1337
|
-
},
|
|
1337
|
+
}, Jt = [
|
|
1338
|
+
Rt,
|
|
1338
1339
|
At,
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
], Re = "FormCreate", le = (t, e) => {
|
|
1340
|
+
Pt,
|
|
1341
|
+
Tt,
|
|
1342
|
+
Ht,
|
|
1343
|
+
We,
|
|
1344
|
+
Ke,
|
|
1345
|
+
Ut
|
|
1346
|
+
], Ie = "FormCreate", le = (t, e) => {
|
|
1347
1347
|
if (!(!t || t === e)) {
|
|
1348
1348
|
if (t.formCreateInject)
|
|
1349
1349
|
return t.formCreateInject;
|
|
@@ -1351,10 +1351,10 @@ const Ht = "fcGroup", Jt = {
|
|
|
1351
1351
|
return le(t.$parent, e);
|
|
1352
1352
|
}
|
|
1353
1353
|
};
|
|
1354
|
-
function
|
|
1354
|
+
function zt(t, e, r) {
|
|
1355
1355
|
return {
|
|
1356
|
-
name:
|
|
1357
|
-
componentName:
|
|
1356
|
+
name: Ie,
|
|
1357
|
+
componentName: Ie,
|
|
1358
1358
|
model: {
|
|
1359
1359
|
prop: "api"
|
|
1360
1360
|
},
|
|
@@ -1430,8 +1430,8 @@ function Gt(t, e, r) {
|
|
|
1430
1430
|
},
|
|
1431
1431
|
deep: !0
|
|
1432
1432
|
},
|
|
1433
|
-
rule(i) {
|
|
1434
|
-
i.length === this.renderRule.length && i.every((
|
|
1433
|
+
rule(i, s) {
|
|
1434
|
+
i.length === this.renderRule.length && i.every((n) => this.renderRule.indexOf(n) > -1) || (this.formCreate.$handle.reloadRule(i), this._renderRule(), i !== s && this.formCreate.$handle.targetReload());
|
|
1435
1435
|
},
|
|
1436
1436
|
disabled() {
|
|
1437
1437
|
this.$f.refresh();
|
|
@@ -1468,8 +1468,8 @@ function Gt(t, e, r) {
|
|
|
1468
1468
|
}
|
|
1469
1469
|
};
|
|
1470
1470
|
}
|
|
1471
|
-
const
|
|
1472
|
-
const i = [...
|
|
1471
|
+
const xe = ["attrs", "props", "domProps", "scopedSlots"], Xe = ["class", "style", "directives"], Qe = ["on", "nativeOn"], D = (t, e = {}, r = {}) => {
|
|
1472
|
+
const i = [...xe, ...r.normal || []], s = [...Xe, ...r.array || []], n = [...Qe, ...r.functional || []], o = r.props || [];
|
|
1473
1473
|
return t.reduce((a, u) => {
|
|
1474
1474
|
for (const l in u)
|
|
1475
1475
|
if (a[l])
|
|
@@ -1489,65 +1489,79 @@ const Qe = ["attrs", "props", "domProps", "scopedSlots"], Ze = ["class", "style"
|
|
|
1489
1489
|
a[l][c] = u[l][c];
|
|
1490
1490
|
else if (l === "hook")
|
|
1491
1491
|
for (let c in u[l])
|
|
1492
|
-
a[l][c] ? a[l][c] =
|
|
1492
|
+
a[l][c] ? a[l][c] = Wt(a[l][c], u[l][c]) : a[l][c] = u[l][c];
|
|
1493
1493
|
else
|
|
1494
1494
|
a[l] = u[l];
|
|
1495
1495
|
else
|
|
1496
1496
|
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];
|
|
1497
1497
|
return a;
|
|
1498
1498
|
}, e);
|
|
1499
|
-
},
|
|
1499
|
+
}, Wt = (t, e) => function() {
|
|
1500
1500
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1501
|
-
},
|
|
1502
|
-
function
|
|
1503
|
-
return [...
|
|
1501
|
+
}, Ze = ["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"];
|
|
1502
|
+
function Gt() {
|
|
1503
|
+
return [...Ze, ...xe, ...Xe, ...Qe, ...pe, ...me];
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function ye(t, e, r) {
|
|
1506
1506
|
return `[form-create ${t}]: ${e}`;
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1509
|
-
console.warn(
|
|
1508
|
+
function Kt(t, e) {
|
|
1509
|
+
console.warn(ye("tip", t));
|
|
1510
1510
|
}
|
|
1511
|
-
function
|
|
1512
|
-
console.error(
|
|
1511
|
+
function ge(t, e) {
|
|
1512
|
+
console.error(ye("err", t));
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1515
|
-
|
|
1514
|
+
function xt(t) {
|
|
1515
|
+
ge(t.toString()), console.error(t);
|
|
1516
1516
|
}
|
|
1517
|
-
const ue = "[[FORM-CREATE-PREFIX-",
|
|
1518
|
-
function
|
|
1519
|
-
return JSON.stringify(
|
|
1517
|
+
const ue = "[[FORM-CREATE-PREFIX-", fe = "-FORM-CREATE-SUFFIX]]";
|
|
1518
|
+
function Ye(t, e) {
|
|
1519
|
+
return JSON.stringify(z(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1520
1520
|
if (!(i && i._isVue === !0)) {
|
|
1521
|
-
if (typeof i
|
|
1521
|
+
if (typeof i != "function")
|
|
1522
1522
|
return i;
|
|
1523
1523
|
if (i.__json)
|
|
1524
1524
|
return i.__json;
|
|
1525
1525
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1526
|
-
return ue + i +
|
|
1526
|
+
return ue + i + fe;
|
|
1527
1527
|
}
|
|
1528
1528
|
}, e);
|
|
1529
1529
|
}
|
|
1530
|
-
function
|
|
1530
|
+
function te(t) {
|
|
1531
1531
|
return new Function("return " + t)();
|
|
1532
1532
|
}
|
|
1533
1533
|
function M(t, e) {
|
|
1534
|
-
if (t &&
|
|
1534
|
+
if (t && h.String(t) && t.length > 4) {
|
|
1535
1535
|
let r = t.trim(), i = !1;
|
|
1536
1536
|
try {
|
|
1537
|
-
if (r.indexOf(
|
|
1538
|
-
r = r.replace(
|
|
1539
|
-
else if (r.indexOf(
|
|
1540
|
-
r = r.
|
|
1541
|
-
else
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1537
|
+
if (r.indexOf(fe) > 0 && r.indexOf(ue) === 0)
|
|
1538
|
+
r = r.replace(fe, "").replace(ue, ""), i = !0;
|
|
1539
|
+
else if (r.indexOf("$FN:") === 0)
|
|
1540
|
+
r = r.substring(4), i = !0;
|
|
1541
|
+
else if (r.indexOf("$EXEC:") === 0)
|
|
1542
|
+
r = r.substring(6), i = !0;
|
|
1543
|
+
else if (r.indexOf("$GLOBAL:") === 0) {
|
|
1544
|
+
const n = r.substring(8);
|
|
1545
|
+
return r = function(...o) {
|
|
1546
|
+
const a = o[0].api.getGlobalEvent(n);
|
|
1547
|
+
if (a)
|
|
1548
|
+
return a.call(this, ...o);
|
|
1549
|
+
}, r.__json = t, r.__inject = !0, r;
|
|
1550
|
+
} else {
|
|
1551
|
+
if (r.indexOf("$FNX:") === 0)
|
|
1552
|
+
return r = te("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1553
|
+
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1545
1554
|
}
|
|
1546
1555
|
if (!i) return t;
|
|
1547
|
-
|
|
1556
|
+
let s;
|
|
1557
|
+
try {
|
|
1558
|
+
s = te(r);
|
|
1559
|
+
} catch (n) {
|
|
1560
|
+
s = te("function " + r);
|
|
1561
|
+
}
|
|
1548
1562
|
return s.__json = t, s;
|
|
1549
1563
|
} catch (s) {
|
|
1550
|
-
|
|
1564
|
+
ge(`解析失败:${r}
|
|
1551
1565
|
|
|
1552
1566
|
err: ${s}`);
|
|
1553
1567
|
return;
|
|
@@ -1555,12 +1569,12 @@ err: ${s}`);
|
|
|
1555
1569
|
}
|
|
1556
1570
|
return t;
|
|
1557
1571
|
}
|
|
1558
|
-
function
|
|
1572
|
+
function Xt(t, e) {
|
|
1559
1573
|
return JSON.parse(t, function(r, i) {
|
|
1560
|
-
return
|
|
1574
|
+
return h.Undef(i) || !i.indexOf ? i : M(i, e);
|
|
1561
1575
|
});
|
|
1562
1576
|
}
|
|
1563
|
-
function
|
|
1577
|
+
function he(t, e) {
|
|
1564
1578
|
return {
|
|
1565
1579
|
value: t,
|
|
1566
1580
|
enumerable: !1,
|
|
@@ -1568,60 +1582,60 @@ function rt(t, e) {
|
|
|
1568
1582
|
writable: !!e
|
|
1569
1583
|
};
|
|
1570
1584
|
}
|
|
1571
|
-
function
|
|
1572
|
-
return
|
|
1585
|
+
function $e(t) {
|
|
1586
|
+
return et([t])[0];
|
|
1573
1587
|
}
|
|
1574
|
-
function
|
|
1575
|
-
return
|
|
1588
|
+
function et(t, e) {
|
|
1589
|
+
return z([], [...t], e || !1);
|
|
1576
1590
|
}
|
|
1577
1591
|
function U(t, e) {
|
|
1578
|
-
return D(Array.isArray(e) ? e : [e], t, { array:
|
|
1592
|
+
return D(Array.isArray(e) ? e : [e], t, { array: pe, normal: me }), t;
|
|
1579
1593
|
}
|
|
1580
|
-
function
|
|
1581
|
-
const e =
|
|
1594
|
+
function je(t) {
|
|
1595
|
+
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1582
1596
|
return e.type || (e.type = "input"), e;
|
|
1583
1597
|
}
|
|
1584
|
-
function
|
|
1598
|
+
function Qt(t, e) {
|
|
1585
1599
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1586
1600
|
e[r] && (t[r] = U(t[r] || {}, e[r]));
|
|
1587
1601
|
}), t) : e;
|
|
1588
1602
|
}
|
|
1589
|
-
function
|
|
1603
|
+
function tt(t, e) {
|
|
1590
1604
|
Object.defineProperties(t, Object.keys(e).reduce((r, i) => (r[i] = {
|
|
1591
1605
|
get() {
|
|
1592
1606
|
return e[i]();
|
|
1593
1607
|
}
|
|
1594
1608
|
}, r), {}));
|
|
1595
1609
|
}
|
|
1596
|
-
function
|
|
1610
|
+
function x(t) {
|
|
1597
1611
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1598
1612
|
}
|
|
1599
1613
|
function E(t, e) {
|
|
1600
1614
|
try {
|
|
1601
1615
|
e = t();
|
|
1602
1616
|
} catch (r) {
|
|
1603
|
-
|
|
1617
|
+
xt(r);
|
|
1604
1618
|
}
|
|
1605
1619
|
return e;
|
|
1606
1620
|
}
|
|
1607
|
-
const
|
|
1608
|
-
"==": (t, e) => JSON.stringify(t) === JSON.stringify(
|
|
1609
|
-
"!=": (t, e) => !
|
|
1621
|
+
const Ae = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, J = {
|
|
1622
|
+
"==": (t, e) => JSON.stringify(t) === JSON.stringify(Ae(t, e)),
|
|
1623
|
+
"!=": (t, e) => !J["=="](t, e),
|
|
1610
1624
|
">": (t, e) => t > e,
|
|
1611
1625
|
">=": (t, e) => t >= e,
|
|
1612
1626
|
"<": (t, e) => t < e,
|
|
1613
1627
|
"<=": (t, e) => t <= e,
|
|
1614
1628
|
on(t, e) {
|
|
1615
|
-
return t && t.indexOf && t.indexOf(
|
|
1629
|
+
return t && t.indexOf && t.indexOf(Ae(t[0], e)) > -1;
|
|
1616
1630
|
},
|
|
1617
1631
|
notOn(t, e) {
|
|
1618
|
-
return !
|
|
1632
|
+
return !J.on(t, e);
|
|
1619
1633
|
},
|
|
1620
1634
|
in(t, e) {
|
|
1621
1635
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1622
1636
|
},
|
|
1623
1637
|
notIn(t, e) {
|
|
1624
|
-
return !
|
|
1638
|
+
return !J.in(t, e);
|
|
1625
1639
|
},
|
|
1626
1640
|
between(t, e) {
|
|
1627
1641
|
return t > e[0] && t < e[1];
|
|
@@ -1630,16 +1644,16 @@ const Pe = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1630
1644
|
return t < e[0] || t > e[1];
|
|
1631
1645
|
},
|
|
1632
1646
|
empty(t) {
|
|
1633
|
-
return
|
|
1647
|
+
return h.empty(t);
|
|
1634
1648
|
},
|
|
1635
1649
|
notEmpty(t) {
|
|
1636
|
-
return !
|
|
1650
|
+
return !h.empty(t);
|
|
1637
1651
|
},
|
|
1638
1652
|
pattern(t, e) {
|
|
1639
1653
|
return new RegExp(e, "g").test(t);
|
|
1640
1654
|
}
|
|
1641
1655
|
};
|
|
1642
|
-
function
|
|
1656
|
+
function rt() {
|
|
1643
1657
|
return {
|
|
1644
1658
|
props: {},
|
|
1645
1659
|
on: {},
|
|
@@ -1653,14 +1667,14 @@ function st() {
|
|
|
1653
1667
|
}
|
|
1654
1668
|
function F(t, e) {
|
|
1655
1669
|
return (r, i, s, n = {}) => {
|
|
1656
|
-
const o = new
|
|
1657
|
-
return e && (
|
|
1670
|
+
const o = new ve(t, r, i, s, n);
|
|
1671
|
+
return e && (h.Function(e) ? e(o) : o.props(e)), o;
|
|
1658
1672
|
};
|
|
1659
1673
|
}
|
|
1660
|
-
function
|
|
1661
|
-
this._data = p(
|
|
1674
|
+
function ve(t, e, r, i, s) {
|
|
1675
|
+
this._data = p(rt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1662
1676
|
}
|
|
1663
|
-
p(
|
|
1677
|
+
p(ve.prototype, {
|
|
1664
1678
|
getRule() {
|
|
1665
1679
|
return this._data;
|
|
1666
1680
|
},
|
|
@@ -1669,39 +1683,39 @@ p($e.prototype, {
|
|
|
1669
1683
|
},
|
|
1670
1684
|
_clone() {
|
|
1671
1685
|
const t = new this.constructor();
|
|
1672
|
-
return t._data =
|
|
1686
|
+
return t._data = $e(this._data), t;
|
|
1673
1687
|
}
|
|
1674
1688
|
});
|
|
1675
|
-
function
|
|
1689
|
+
function it(t) {
|
|
1676
1690
|
t.forEach((e) => {
|
|
1677
|
-
|
|
1691
|
+
ve.prototype[e] = function(r) {
|
|
1678
1692
|
return U(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1679
1693
|
};
|
|
1680
1694
|
});
|
|
1681
1695
|
}
|
|
1682
|
-
|
|
1683
|
-
const
|
|
1684
|
-
function
|
|
1685
|
-
let i =
|
|
1696
|
+
it(Gt());
|
|
1697
|
+
const nt = F("");
|
|
1698
|
+
function Zt(t, e, r) {
|
|
1699
|
+
let i = nt("", e);
|
|
1686
1700
|
return i._data.type = t, i._data.title = r, i;
|
|
1687
1701
|
}
|
|
1688
|
-
function
|
|
1689
|
-
let s =
|
|
1702
|
+
function Ve(t, e, r, i) {
|
|
1703
|
+
let s = nt("", r);
|
|
1690
1704
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1691
1705
|
}
|
|
1692
|
-
function
|
|
1706
|
+
function Yt() {
|
|
1693
1707
|
return {
|
|
1694
|
-
create:
|
|
1695
|
-
createTmp:
|
|
1696
|
-
template:
|
|
1708
|
+
create: Zt,
|
|
1709
|
+
createTmp: Ve,
|
|
1710
|
+
template: Ve,
|
|
1697
1711
|
factory: F
|
|
1698
1712
|
};
|
|
1699
1713
|
}
|
|
1700
|
-
function
|
|
1714
|
+
function er(t, e, r) {
|
|
1701
1715
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1702
1716
|
return s.status = r.status, s.url = t, s;
|
|
1703
1717
|
}
|
|
1704
|
-
function
|
|
1718
|
+
function Pe(t) {
|
|
1705
1719
|
const e = t.responseText || t.response;
|
|
1706
1720
|
if (!e)
|
|
1707
1721
|
return e;
|
|
@@ -1711,7 +1725,7 @@ function Te(t) {
|
|
|
1711
1725
|
return e;
|
|
1712
1726
|
}
|
|
1713
1727
|
}
|
|
1714
|
-
function
|
|
1728
|
+
function st(t) {
|
|
1715
1729
|
if (typeof XMLHttpRequest == "undefined")
|
|
1716
1730
|
return;
|
|
1717
1731
|
const e = new XMLHttpRequest(), r = t.action;
|
|
@@ -1719,8 +1733,8 @@ function lt(t) {
|
|
|
1719
1733
|
t.onError(o);
|
|
1720
1734
|
}, e.onload = function() {
|
|
1721
1735
|
if (e.status < 200 || e.status >= 300)
|
|
1722
|
-
return t.onError(
|
|
1723
|
-
t.onSuccess(
|
|
1736
|
+
return t.onError(er(r, t, e), Pe(e));
|
|
1737
|
+
t.onSuccess(Pe(e));
|
|
1724
1738
|
}, e.open(t.method || "get", r, !0);
|
|
1725
1739
|
let i;
|
|
1726
1740
|
t.data && ((t.dataType || "").toLowerCase() !== "json" ? (i = new FormData(), Object.keys(t.data).map((n) => {
|
|
@@ -1731,13 +1745,13 @@ function lt(t) {
|
|
|
1731
1745
|
s[n] !== null && e.setRequestHeader(n, s[n]);
|
|
1732
1746
|
}), e.send(i);
|
|
1733
1747
|
}
|
|
1734
|
-
function
|
|
1748
|
+
function tr(t) {
|
|
1735
1749
|
return new Promise((e, r) => {
|
|
1736
|
-
|
|
1750
|
+
st(q(y({}, t), {
|
|
1737
1751
|
onSuccess(i) {
|
|
1738
1752
|
let s = (o) => o;
|
|
1739
1753
|
const n = M(t.parse);
|
|
1740
|
-
|
|
1754
|
+
h.Function(n) ? s = n : n && h.String(n) && (s = (o) => (n.split(".").forEach((a) => {
|
|
1741
1755
|
o && (o = o[a]);
|
|
1742
1756
|
}), o)), e(s(i));
|
|
1743
1757
|
},
|
|
@@ -1750,9 +1764,9 @@ function nr(t) {
|
|
|
1750
1764
|
function K(t) {
|
|
1751
1765
|
return B(t);
|
|
1752
1766
|
}
|
|
1753
|
-
function
|
|
1767
|
+
function rr(t) {
|
|
1754
1768
|
function e(n) {
|
|
1755
|
-
return
|
|
1769
|
+
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1756
1770
|
}
|
|
1757
1771
|
function r(n, o, a) {
|
|
1758
1772
|
e(n).forEach((u) => {
|
|
@@ -1836,7 +1850,7 @@ function sr(t) {
|
|
|
1836
1850
|
}, !0), o ? o.origin : void 0;
|
|
1837
1851
|
},
|
|
1838
1852
|
removeRule(n) {
|
|
1839
|
-
const o = n &&
|
|
1853
|
+
const o = n && x(n);
|
|
1840
1854
|
if (o)
|
|
1841
1855
|
return o.rm(), o.origin;
|
|
1842
1856
|
},
|
|
@@ -1912,7 +1926,7 @@ function sr(t) {
|
|
|
1912
1926
|
n.forEach((a) => s.sync(a));
|
|
1913
1927
|
return;
|
|
1914
1928
|
}
|
|
1915
|
-
let o =
|
|
1929
|
+
let o = h.Object(n) ? x(n) : t.getCtxs(n);
|
|
1916
1930
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
1917
1931
|
if (!a.deleted) {
|
|
1918
1932
|
const u = t.subForm[a.id];
|
|
@@ -2000,19 +2014,19 @@ function sr(t) {
|
|
|
2000
2014
|
});
|
|
2001
2015
|
}), t.vm.$nextTick(() => {
|
|
2002
2016
|
s.clearValidateState();
|
|
2003
|
-
}), n == null && (
|
|
2017
|
+
}), n == null && (h.Function(t.options.onReset) && E(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
2004
2018
|
},
|
|
2005
2019
|
method(n, o) {
|
|
2006
2020
|
const a = s.el(n);
|
|
2007
2021
|
if (!a || !a[o])
|
|
2008
|
-
throw new Error(
|
|
2022
|
+
throw new Error(ye("err", `${o}方法不存在`));
|
|
2009
2023
|
return (...u) => a[o](...u);
|
|
2010
2024
|
},
|
|
2011
2025
|
exec(n, o, ...a) {
|
|
2012
2026
|
return E(() => s.method(n, o)(...a));
|
|
2013
2027
|
},
|
|
2014
2028
|
toJson(n) {
|
|
2015
|
-
return
|
|
2029
|
+
return Ye(s.rule, n);
|
|
2016
2030
|
},
|
|
2017
2031
|
trigger(n, o, ...a) {
|
|
2018
2032
|
const u = s.el(n);
|
|
@@ -2044,7 +2058,7 @@ function sr(t) {
|
|
|
2044
2058
|
},
|
|
2045
2059
|
fetch(n) {
|
|
2046
2060
|
return new Promise((o, a) => {
|
|
2047
|
-
t.beforeFetch(n).then(() =>
|
|
2061
|
+
t.beforeFetch(n).then(() => tr(n).then(o).catch(a));
|
|
2048
2062
|
});
|
|
2049
2063
|
},
|
|
2050
2064
|
getData(n, o) {
|
|
@@ -2064,7 +2078,7 @@ function sr(t) {
|
|
|
2064
2078
|
};
|
|
2065
2079
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2066
2080
|
}
|
|
2067
|
-
function
|
|
2081
|
+
function ir(t) {
|
|
2068
2082
|
p(t.prototype, {
|
|
2069
2083
|
initCache() {
|
|
2070
2084
|
this.clearCacheAll();
|
|
@@ -2102,30 +2116,30 @@ function R(t) {
|
|
|
2102
2116
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2103
2117
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2104
2118
|
});
|
|
2105
|
-
return
|
|
2119
|
+
return ot(e);
|
|
2106
2120
|
}
|
|
2107
|
-
function
|
|
2121
|
+
function ot(t) {
|
|
2108
2122
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2109
2123
|
}
|
|
2110
|
-
function
|
|
2124
|
+
function nr(t) {
|
|
2111
2125
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
2112
2126
|
}
|
|
2113
|
-
function
|
|
2127
|
+
function X(t) {
|
|
2114
2128
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
2115
2129
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
2116
2130
|
}
|
|
2117
|
-
let
|
|
2118
|
-
function
|
|
2119
|
-
const t = 370 + ++
|
|
2131
|
+
let sr = 0;
|
|
2132
|
+
function ee() {
|
|
2133
|
+
const t = 370 + ++sr;
|
|
2120
2134
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
2121
2135
|
}
|
|
2122
|
-
function
|
|
2136
|
+
function Q(t, e, r) {
|
|
2123
2137
|
let i = t, s;
|
|
2124
2138
|
return (e || "").split(".").forEach((n) => {
|
|
2125
2139
|
s && ((!i[s] || typeof i[s] != "object") && (i[s] = {}), i = i[s]), s = n;
|
|
2126
2140
|
}), i[s] = r, i;
|
|
2127
2141
|
}
|
|
2128
|
-
function
|
|
2142
|
+
function or(t) {
|
|
2129
2143
|
p(t.prototype, {
|
|
2130
2144
|
initRender() {
|
|
2131
2145
|
this.tempList = {}, this.clearOrgChildren();
|
|
@@ -2135,7 +2149,7 @@ function ur(t) {
|
|
|
2135
2149
|
this.orgChildren = Object.keys(e).reduce((r, i) => {
|
|
2136
2150
|
if (e[i].parser.loadChildren !== !1) {
|
|
2137
2151
|
const s = e[i].rule.children;
|
|
2138
|
-
r[i] =
|
|
2152
|
+
r[i] = h.trueArray(s) ? [...s] : [];
|
|
2139
2153
|
}
|
|
2140
2154
|
return r;
|
|
2141
2155
|
}, {});
|
|
@@ -2147,7 +2161,7 @@ function ur(t) {
|
|
|
2147
2161
|
const r = (i) => {
|
|
2148
2162
|
if (i) {
|
|
2149
2163
|
let s;
|
|
2150
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2164
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + X(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + X(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2151
2165
|
}
|
|
2152
2166
|
};
|
|
2153
2167
|
return r(this.vm);
|
|
@@ -2166,7 +2180,7 @@ function ur(t) {
|
|
|
2166
2180
|
makeVm(e) {
|
|
2167
2181
|
const r = e.vm;
|
|
2168
2182
|
if (r) {
|
|
2169
|
-
if (
|
|
2183
|
+
if (h.Function(r))
|
|
2170
2184
|
return E(() => e.vm(this.$handle.getInjectData(e)));
|
|
2171
2185
|
if (!r._isVue)
|
|
2172
2186
|
return new P(r);
|
|
@@ -2178,12 +2192,12 @@ function ur(t) {
|
|
|
2178
2192
|
r && (e.cacheConfig || (e.cacheConfig = r[e.originType] || r[e.type] || r[e.trueType] || {}), e.prop = U({}, [r["*"], e.cacheConfig, e.prop]));
|
|
2179
2193
|
},
|
|
2180
2194
|
setOptions(e) {
|
|
2181
|
-
e.prop.optionsTo && e.prop.options &&
|
|
2195
|
+
e.prop.optionsTo && e.prop.options && Q(e.prop, e.prop.optionsTo, e.prop.options);
|
|
2182
2196
|
},
|
|
2183
2197
|
deepSet(e) {
|
|
2184
2198
|
const r = e.rule.deep;
|
|
2185
2199
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2186
|
-
|
|
2200
|
+
Q(e.prop, i, r[i]);
|
|
2187
2201
|
});
|
|
2188
2202
|
},
|
|
2189
2203
|
setTempProps(e, r) {
|
|
@@ -2197,7 +2211,7 @@ function ur(t) {
|
|
|
2197
2211
|
},
|
|
2198
2212
|
renderTemp(e) {
|
|
2199
2213
|
if (!P.compile)
|
|
2200
|
-
return
|
|
2214
|
+
return Kt("当前使用的Vue构建版本不支持compile,无法使用template功能"), [];
|
|
2201
2215
|
const r = e.prop, { id: i, key: s } = e;
|
|
2202
2216
|
if (!this.tempList[i]) {
|
|
2203
2217
|
e.el || (e.el = this.makeVm(r), this.vm.$nextTick(() => e.parser.mounted(e)));
|
|
@@ -2212,10 +2226,10 @@ function ur(t) {
|
|
|
2212
2226
|
const { vm: n, template: o } = this.tempList[i];
|
|
2213
2227
|
this.setTempProps(n, e);
|
|
2214
2228
|
const a = o.render.call(n);
|
|
2215
|
-
return
|
|
2229
|
+
return h.Undef(a.data) && (a.data = {}), a.key = s, a.data.ref = e.ref, a.data.key = s, a;
|
|
2216
2230
|
},
|
|
2217
2231
|
parseSide(e, r) {
|
|
2218
|
-
return
|
|
2232
|
+
return h.Object(e) ? U({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2219
2233
|
},
|
|
2220
2234
|
renderSides(e, r, i) {
|
|
2221
2235
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2233,7 +2247,7 @@ function ur(t) {
|
|
|
2233
2247
|
const i = e.rule;
|
|
2234
2248
|
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2235
2249
|
let s, n = i.cache !== !1;
|
|
2236
|
-
const o = e.trueType, a = !(
|
|
2250
|
+
const o = e.trueType, a = !(h.Undef(i.display) || i.display);
|
|
2237
2251
|
if (o === "template" && !i.template)
|
|
2238
2252
|
s = this.renderSides(this.renderChildren(e), e, !0), a && this.display(s), s = this.item(e, s);
|
|
2239
2253
|
else if (o === "fcFragment")
|
|
@@ -2262,7 +2276,7 @@ function ur(t) {
|
|
|
2262
2276
|
model: u.model || {}
|
|
2263
2277
|
}) : s = l ? e.parser.preview(c, e) : e.parser.render(c, e);
|
|
2264
2278
|
}
|
|
2265
|
-
s = this.renderSides(s, e), !(!e.input &&
|
|
2279
|
+
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);
|
|
2266
2280
|
}
|
|
2267
2281
|
return n && this.setCache(e, s, r), s;
|
|
2268
2282
|
}
|
|
@@ -2280,7 +2294,7 @@ function ur(t) {
|
|
|
2280
2294
|
},
|
|
2281
2295
|
none(e) {
|
|
2282
2296
|
if (e && e.data)
|
|
2283
|
-
return Array.isArray(e.data.style) ? e.data.style.push({ display: "none" }) :
|
|
2297
|
+
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;
|
|
2284
2298
|
},
|
|
2285
2299
|
item(e, r) {
|
|
2286
2300
|
return this.$h("fcFragment", {
|
|
@@ -2352,8 +2366,8 @@ function ur(t) {
|
|
|
2352
2366
|
this.$handle.onInput(e, r);
|
|
2353
2367
|
},
|
|
2354
2368
|
renderChildren(e) {
|
|
2355
|
-
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !
|
|
2356
|
-
return !
|
|
2369
|
+
const { children: r } = e.rule, i = this.orgChildren[e.id], s = (n) => !h.String(n) && n.__fc__ && !this.$handle.ctxs[n.__fc__.id];
|
|
2370
|
+
return !h.trueArray(r) && i ? (this.$handle.deferSyncValue(() => {
|
|
2357
2371
|
i.forEach((n) => {
|
|
2358
2372
|
n && s(n) && this.$handle.rmCtx(n.__fc__);
|
|
2359
2373
|
});
|
|
@@ -2363,7 +2377,7 @@ function ur(t) {
|
|
|
2363
2377
|
});
|
|
2364
2378
|
}), r.map((n) => {
|
|
2365
2379
|
if (n) {
|
|
2366
|
-
if (
|
|
2380
|
+
if (h.String(n)) return n;
|
|
2367
2381
|
if (n.__fc__)
|
|
2368
2382
|
return this.renderCtx(n.__fc__, e);
|
|
2369
2383
|
n.type && this.vm.$nextTick(() => {
|
|
@@ -2374,11 +2388,11 @@ function ur(t) {
|
|
|
2374
2388
|
},
|
|
2375
2389
|
defaultRender(e, r) {
|
|
2376
2390
|
const i = e.prop;
|
|
2377
|
-
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(
|
|
2391
|
+
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(ot(e.originType), i, r);
|
|
2378
2392
|
},
|
|
2379
2393
|
renderRule(e, r, i) {
|
|
2380
2394
|
if (!e) return;
|
|
2381
|
-
if (
|
|
2395
|
+
if (h.String(e)) return e;
|
|
2382
2396
|
let s;
|
|
2383
2397
|
if (i)
|
|
2384
2398
|
s = e.type;
|
|
@@ -2389,18 +2403,18 @@ function ur(t) {
|
|
|
2389
2403
|
}
|
|
2390
2404
|
if (!s) return;
|
|
2391
2405
|
let n = [[r]];
|
|
2392
|
-
return
|
|
2406
|
+
return h.trueArray(e.children) && n.push(e.children.map((o) => this.renderRule(o))), this.$h(s, y({}, e), n);
|
|
2393
2407
|
}
|
|
2394
2408
|
});
|
|
2395
2409
|
}
|
|
2396
|
-
function
|
|
2410
|
+
function be(t) {
|
|
2397
2411
|
p(this, {
|
|
2398
2412
|
$handle: t,
|
|
2399
2413
|
fc: t.fc,
|
|
2400
2414
|
vm: t.vm,
|
|
2401
2415
|
$manager: t.$manager,
|
|
2402
2416
|
vNode: new t.fc.CreateNode(t.vm)
|
|
2403
|
-
}),
|
|
2417
|
+
}), tt(this, {
|
|
2404
2418
|
options() {
|
|
2405
2419
|
return t.options;
|
|
2406
2420
|
},
|
|
@@ -2409,9 +2423,9 @@ function ve(t) {
|
|
|
2409
2423
|
}
|
|
2410
2424
|
}), this.initCache(), this.initRender();
|
|
2411
2425
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
function
|
|
2426
|
+
ir(be);
|
|
2427
|
+
or(be);
|
|
2428
|
+
function ar(t) {
|
|
2415
2429
|
p(t.prototype, {
|
|
2416
2430
|
parseInjectEvent(e, r) {
|
|
2417
2431
|
const i = e.inject || this.options.injectEvent;
|
|
@@ -2424,11 +2438,11 @@ function hr(t) {
|
|
|
2424
2438
|
}), r;
|
|
2425
2439
|
},
|
|
2426
2440
|
parseEvent(e, r, i, s) {
|
|
2427
|
-
if (
|
|
2441
|
+
if (h.Function(r) && (i !== !1 && !h.Undef(i) || r.__inject))
|
|
2428
2442
|
return this.inject(e, r, i);
|
|
2429
|
-
if (!s && Array.isArray(r) && r[0] && (
|
|
2443
|
+
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2430
2444
|
return this.parseEventLst(e, r, i, !0);
|
|
2431
|
-
if (
|
|
2445
|
+
if (h.String(r)) {
|
|
2432
2446
|
const n = M(r);
|
|
2433
2447
|
if (n && r !== n)
|
|
2434
2448
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
@@ -2436,19 +2450,19 @@ function hr(t) {
|
|
|
2436
2450
|
},
|
|
2437
2451
|
parseEmit(e, r) {
|
|
2438
2452
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: u } = s, l = s[r ? "emit" : "nativeEmit"] || [];
|
|
2439
|
-
return
|
|
2453
|
+
return h.trueArray(l) && l.forEach((c) => {
|
|
2440
2454
|
if (!c) return;
|
|
2441
2455
|
let m, v = n || o || a;
|
|
2442
|
-
if (
|
|
2456
|
+
if (h.Object(c) && (m = c.inject, c = c.name, v = c.prefix || v), v) {
|
|
2443
2457
|
r || (v = `native-${v}`);
|
|
2444
|
-
const _ =
|
|
2458
|
+
const _ = X(`${v}-${c}`), g = (...O) => {
|
|
2445
2459
|
this.vm.$emit(_, ...O), this.vm.$emit("emit-event", _, ...O);
|
|
2446
2460
|
};
|
|
2447
2461
|
if (g.__emit = !0, !m && u === !1)
|
|
2448
2462
|
i[c] = g;
|
|
2449
2463
|
else {
|
|
2450
2464
|
let O = m || u || this.options.injectEvent;
|
|
2451
|
-
i[c] =
|
|
2465
|
+
i[c] = h.Undef(O) ? g : this.inject(s, g, O);
|
|
2452
2466
|
}
|
|
2453
2467
|
}
|
|
2454
2468
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2478,14 +2492,14 @@ function hr(t) {
|
|
|
2478
2492
|
}
|
|
2479
2493
|
});
|
|
2480
2494
|
}
|
|
2481
|
-
const
|
|
2482
|
-
function
|
|
2495
|
+
const De = ["hook:updated", "hook:mounted"];
|
|
2496
|
+
function lr(t) {
|
|
2483
2497
|
p(t.prototype, {
|
|
2484
2498
|
usePage() {
|
|
2485
2499
|
const e = this.options.page;
|
|
2486
2500
|
if (!e) return;
|
|
2487
|
-
let r = 25, i =
|
|
2488
|
-
|
|
2501
|
+
let r = 25, i = ur(this.rules);
|
|
2502
|
+
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), p(this, {
|
|
2489
2503
|
first: r,
|
|
2490
2504
|
limit: i,
|
|
2491
2505
|
pageEnd: this.rules.length <= r
|
|
@@ -2493,16 +2507,16 @@ function fr(t) {
|
|
|
2493
2507
|
},
|
|
2494
2508
|
pageLoad() {
|
|
2495
2509
|
const e = () => {
|
|
2496
|
-
this.pageEnd ? (this.vm.$off(
|
|
2510
|
+
this.pageEnd ? (this.vm.$off(De, e), this.bus.$emit("page-end")) : (this.first += this.limit, this.pageEnd = this.rules.length <= this.first, this.loadRule(), this.refresh());
|
|
2497
2511
|
};
|
|
2498
|
-
this.vm.$on(
|
|
2512
|
+
this.vm.$on(De, e);
|
|
2499
2513
|
}
|
|
2500
2514
|
});
|
|
2501
2515
|
}
|
|
2502
|
-
function
|
|
2516
|
+
function ur(t) {
|
|
2503
2517
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2504
2518
|
}
|
|
2505
|
-
function
|
|
2519
|
+
function fr(t) {
|
|
2506
2520
|
p(t.prototype, {
|
|
2507
2521
|
clearNextTick() {
|
|
2508
2522
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
@@ -2517,13 +2531,15 @@ function dr(t) {
|
|
|
2517
2531
|
}
|
|
2518
2532
|
});
|
|
2519
2533
|
}
|
|
2520
|
-
function
|
|
2534
|
+
function hr(t) {
|
|
2521
2535
|
Object.defineProperties(t.origin, {
|
|
2522
|
-
__fc__:
|
|
2536
|
+
__fc__: he(t, !0)
|
|
2537
|
+
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2538
|
+
__fc__: he(t, !0)
|
|
2523
2539
|
});
|
|
2524
2540
|
}
|
|
2525
|
-
function
|
|
2526
|
-
const i =
|
|
2541
|
+
function at(t, e, r) {
|
|
2542
|
+
const i = ee();
|
|
2527
2543
|
p(this, {
|
|
2528
2544
|
id: i,
|
|
2529
2545
|
ref: i,
|
|
@@ -2545,9 +2561,9 @@ function ht(t, e, r) {
|
|
|
2545
2561
|
exportEl: void 0,
|
|
2546
2562
|
defaultValue: e.field ? B(r) : void 0,
|
|
2547
2563
|
field: e.field || void 0
|
|
2548
|
-
}), this.updateKey(),
|
|
2564
|
+
}), this.updateKey(), hr(this), this.update(t, !0);
|
|
2549
2565
|
}
|
|
2550
|
-
p(
|
|
2566
|
+
p(at.prototype, {
|
|
2551
2567
|
effectData(t) {
|
|
2552
2568
|
return this.payload[t] || (this.payload[t] = {}), this.payload[t];
|
|
2553
2569
|
},
|
|
@@ -2555,7 +2571,7 @@ p(ht.prototype, {
|
|
|
2555
2571
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2556
2572
|
},
|
|
2557
2573
|
updateKey(t) {
|
|
2558
|
-
this.key =
|
|
2574
|
+
this.key = ee(), t && this.parent && this.parent.updateKey(t);
|
|
2559
2575
|
},
|
|
2560
2576
|
updateType() {
|
|
2561
2577
|
this.originType = this.rule.type, this.type = R(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
@@ -2569,7 +2585,7 @@ p(ht.prototype, {
|
|
|
2569
2585
|
},
|
|
2570
2586
|
injectValidate() {
|
|
2571
2587
|
return I(this.prop.validate).map((t) => {
|
|
2572
|
-
if (
|
|
2588
|
+
if (h.Function(t.validator)) {
|
|
2573
2589
|
const e = y({}, t), r = this;
|
|
2574
2590
|
return e.validator = function(...i) {
|
|
2575
2591
|
return t.validator.call({
|
|
@@ -2647,7 +2663,7 @@ p(ht.prototype, {
|
|
|
2647
2663
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2648
2664
|
}
|
|
2649
2665
|
});
|
|
2650
|
-
function
|
|
2666
|
+
function cr(t) {
|
|
2651
2667
|
p(t.prototype, {
|
|
2652
2668
|
nextRefresh(e) {
|
|
2653
2669
|
const r = this.loadedId;
|
|
@@ -2656,10 +2672,10 @@ function mr(t) {
|
|
|
2656
2672
|
});
|
|
2657
2673
|
},
|
|
2658
2674
|
parseRule(e) {
|
|
2659
|
-
const r =
|
|
2675
|
+
const r = je(e);
|
|
2660
2676
|
return Object.defineProperties(r, {
|
|
2661
|
-
__origin__:
|
|
2662
|
-
}),
|
|
2677
|
+
__origin__: he(e, !0)
|
|
2678
|
+
}), dr(r), this.appendValue(r), r.options = Array.isArray(r.options) ? r.options : [], [r, r.prefix, r.suffix].forEach((i) => {
|
|
2663
2679
|
i && this.loadFn(i, r);
|
|
2664
2680
|
}), this.loadCtrl(r), r.update && (r.update = M(r.update)), r;
|
|
2665
2681
|
},
|
|
@@ -2675,7 +2691,7 @@ function mr(t) {
|
|
|
2675
2691
|
},
|
|
2676
2692
|
syncProp(e) {
|
|
2677
2693
|
const r = e.rule;
|
|
2678
|
-
|
|
2694
|
+
h.trueArray(r.sync) && D([{
|
|
2679
2695
|
on: r.sync.reduce((i, s) => (i[`update:${s}`] = (n) => {
|
|
2680
2696
|
r.props[s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
2681
2697
|
}, i), {})
|
|
@@ -2701,13 +2717,13 @@ function mr(t) {
|
|
|
2701
2717
|
let a = this.sort.indexOf(o.__fc__.id);
|
|
2702
2718
|
return a > -1 ? a : i(n - 1);
|
|
2703
2719
|
}, s = (n, o) => {
|
|
2704
|
-
|
|
2720
|
+
h.trueArray(n) && this._loadRule(n, o);
|
|
2705
2721
|
};
|
|
2706
2722
|
e.map((n, o) => {
|
|
2707
|
-
if (r && !
|
|
2723
|
+
if (r && !h.Object(n) || !this.pageEnd && !r && o >= this.first) return;
|
|
2708
2724
|
if (n.__fc__ && n.__fc__.root === e && this.ctxs[n.__fc__.id])
|
|
2709
2725
|
return s(n.__fc__.rule.children, n.__fc__), n.__fc__;
|
|
2710
|
-
let a =
|
|
2726
|
+
let a = je(n);
|
|
2711
2727
|
const u = () => !!(a.field && this.fieldCtx[a.field] && this.fieldCtx[a.field][0] !== n.__fc__);
|
|
2712
2728
|
this.ruleEffect(a, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", n, this.api);
|
|
2713
2729
|
let l, c = !1, m = !!n.__fc__, v = a.value;
|
|
@@ -2716,28 +2732,28 @@ function mr(t) {
|
|
|
2716
2732
|
const g = !l.check(this);
|
|
2717
2733
|
if (l.deleted) {
|
|
2718
2734
|
if (g) {
|
|
2719
|
-
if (
|
|
2735
|
+
if (Te(l))
|
|
2720
2736
|
return;
|
|
2721
2737
|
l.update(this);
|
|
2722
2738
|
}
|
|
2723
2739
|
} else if (g) {
|
|
2724
|
-
if (
|
|
2740
|
+
if (Te(l))
|
|
2725
2741
|
return;
|
|
2726
|
-
e[o] = n = n._clone ? n._clone() :
|
|
2742
|
+
e[o] = n = n._clone ? n._clone() : $e(n), l = null, c = !0;
|
|
2727
2743
|
}
|
|
2728
2744
|
}
|
|
2729
2745
|
if (l)
|
|
2730
2746
|
l.originType !== l.rule.type && l.updateType(), this.bindParser(l), this.appendValue(l.rule);
|
|
2731
2747
|
else {
|
|
2732
2748
|
const g = this.parseRule(n);
|
|
2733
|
-
l = new
|
|
2749
|
+
l = new at(this, g, v), this.bindParser(l);
|
|
2734
2750
|
}
|
|
2735
2751
|
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) {
|
|
2736
2752
|
const g = i(o);
|
|
2737
2753
|
g > -1 || !o ? this.sort.splice(g + 1, 0, l.id) : this.sort.push(l.id);
|
|
2738
2754
|
}
|
|
2739
2755
|
const _ = l.rule;
|
|
2740
|
-
return l.updated || (l.updated = !0,
|
|
2756
|
+
return l.updated || (l.updated = !0, h.Function(_.update) && this.bus.$once("load-end", () => {
|
|
2741
2757
|
this.refreshUpdate(l, _.value, "init");
|
|
2742
2758
|
}), this.effect(l, "loaded")), l.input && Object.defineProperty(_, "value", this.valueHandle(l)), this.refreshControl(l) && (this.cycleLoad = !0), l;
|
|
2743
2759
|
});
|
|
@@ -2746,17 +2762,17 @@ function mr(t) {
|
|
|
2746
2762
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
2747
2763
|
},
|
|
2748
2764
|
useCtrl(e) {
|
|
2749
|
-
const r =
|
|
2765
|
+
const r = pr(e), i = [], s = this.api;
|
|
2750
2766
|
if (!r.length) return !1;
|
|
2751
2767
|
for (let a = 0; a < r.length; a++) {
|
|
2752
2768
|
const u = r[a], l = u.handle || function(m) {
|
|
2753
|
-
return (
|
|
2769
|
+
return (J[u.condition || "=="] || J["=="])(m, u.value);
|
|
2754
2770
|
};
|
|
2755
|
-
if (!
|
|
2771
|
+
if (!h.trueArray(u.rule)) continue;
|
|
2756
2772
|
const c = q(y({}, u), {
|
|
2757
2773
|
valid: E(() => l(e.rule.value, s)),
|
|
2758
|
-
ctrl:
|
|
2759
|
-
isHidden:
|
|
2774
|
+
ctrl: mr(e, u.rule),
|
|
2775
|
+
isHidden: h.String(u.rule[0])
|
|
2760
2776
|
});
|
|
2761
2777
|
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
2762
2778
|
}
|
|
@@ -2790,7 +2806,7 @@ function mr(t) {
|
|
|
2790
2806
|
});
|
|
2791
2807
|
} else {
|
|
2792
2808
|
e.ctrlRule.splice(e.ctrlRule.indexOf(_), 1);
|
|
2793
|
-
const O =
|
|
2809
|
+
const O = x(_);
|
|
2794
2810
|
O && O.rm();
|
|
2795
2811
|
}
|
|
2796
2812
|
});
|
|
@@ -2808,7 +2824,7 @@ function mr(t) {
|
|
|
2808
2824
|
this.bus.$once("load-end", () => {
|
|
2809
2825
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
2810
2826
|
}), this.reloading = !0, this.loadRule(), this.reloading = !1, this.refresh(), this.vm.$emit("reloading", this.api);
|
|
2811
|
-
}), this.
|
|
2827
|
+
}), this.vm.$emit("update", this.api);
|
|
2812
2828
|
},
|
|
2813
2829
|
//todo 组件生成全部通过 alias
|
|
2814
2830
|
refresh() {
|
|
@@ -2816,30 +2832,30 @@ function mr(t) {
|
|
|
2816
2832
|
}
|
|
2817
2833
|
});
|
|
2818
2834
|
}
|
|
2819
|
-
function
|
|
2820
|
-
const e =
|
|
2835
|
+
function dr(t) {
|
|
2836
|
+
const e = rt();
|
|
2821
2837
|
return Object.keys(e).forEach((r) => {
|
|
2822
2838
|
k(t, r) || w(t, r, e[r]);
|
|
2823
2839
|
}), t;
|
|
2824
2840
|
}
|
|
2825
|
-
function
|
|
2841
|
+
function pr(t) {
|
|
2826
2842
|
const e = t.rule.control || [];
|
|
2827
|
-
return
|
|
2843
|
+
return h.Object(e) ? [e] : e;
|
|
2828
2844
|
}
|
|
2829
|
-
function
|
|
2845
|
+
function mr(t, e) {
|
|
2830
2846
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
2831
2847
|
const i = t.ctrlRule[r];
|
|
2832
2848
|
if (i.children === e)
|
|
2833
2849
|
return i;
|
|
2834
2850
|
}
|
|
2835
2851
|
}
|
|
2836
|
-
function
|
|
2852
|
+
function Te(t) {
|
|
2837
2853
|
return !!t.rule.__ctrl;
|
|
2838
2854
|
}
|
|
2839
|
-
function
|
|
2855
|
+
function yr(t) {
|
|
2840
2856
|
p(t.prototype, {
|
|
2841
2857
|
getValue(e) {
|
|
2842
|
-
return
|
|
2858
|
+
return h.Undef(e.cacheValue) && (e.cacheValue = e.parser.toValue(this.getFormData(e), e)), e.cacheValue;
|
|
2843
2859
|
},
|
|
2844
2860
|
setValue(e, r, i, s) {
|
|
2845
2861
|
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, {
|
|
@@ -2859,14 +2875,14 @@ function vr(t) {
|
|
|
2859
2875
|
return this.formData[e.id];
|
|
2860
2876
|
},
|
|
2861
2877
|
validate() {
|
|
2862
|
-
return
|
|
2878
|
+
return Le(this.vm.validate), this.fields().forEach((e) => {
|
|
2863
2879
|
this.fieldCtx[e].forEach((r) => {
|
|
2864
2880
|
this.vm.validate[r.id] = I(r.rule.validate);
|
|
2865
2881
|
});
|
|
2866
2882
|
}), this.vm.validate;
|
|
2867
2883
|
},
|
|
2868
2884
|
syncForm() {
|
|
2869
|
-
|
|
2885
|
+
Le(this.form), Object.defineProperties(this.form, this.fields().reduce((e, r) => {
|
|
2870
2886
|
const i = this.getFieldCtx(r), s = this.valueHandle(i);
|
|
2871
2887
|
return s.configurable = !0, e[r] = s, e;
|
|
2872
2888
|
}, this.options.appendValue !== !1 ? Object.keys(this.appendData).reduce((e, r) => (e[r] = {
|
|
@@ -2902,13 +2918,13 @@ function vr(t) {
|
|
|
2902
2918
|
this.vm._updateValue(y(y({}, this.options.appendValue !== !1 ? this.appendData : {}), this.form));
|
|
2903
2919
|
},
|
|
2904
2920
|
isChange(e, r) {
|
|
2905
|
-
return JSON.stringify(e.rule.value,
|
|
2921
|
+
return JSON.stringify(e.rule.value, Be) !== JSON.stringify(r === null ? void 0 : r, Be);
|
|
2906
2922
|
},
|
|
2907
2923
|
isQuote(e, r) {
|
|
2908
|
-
return (
|
|
2924
|
+
return (h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
2909
2925
|
},
|
|
2910
2926
|
refreshUpdate(e, r, i, s) {
|
|
2911
|
-
if (
|
|
2927
|
+
if (h.Function(e.rule.update)) {
|
|
2912
2928
|
const n = E(() => e.rule.update(r, e.origin, this.api, {
|
|
2913
2929
|
origin: i || "change",
|
|
2914
2930
|
linkField: s
|
|
@@ -2925,7 +2941,7 @@ function vr(t) {
|
|
|
2925
2941
|
},
|
|
2926
2942
|
appendLink(e) {
|
|
2927
2943
|
const r = e.rule.link;
|
|
2928
|
-
|
|
2944
|
+
h.trueArray(r) && r.forEach((i) => {
|
|
2929
2945
|
const s = () => this.refreshRule(e, e.rule.value, "link", i);
|
|
2930
2946
|
this.bus.$on("change-" + i, s), e.linkOn.push(() => this.bus.$off("change-" + i, s));
|
|
2931
2947
|
});
|
|
@@ -2935,13 +2951,13 @@ function vr(t) {
|
|
|
2935
2951
|
}
|
|
2936
2952
|
});
|
|
2937
2953
|
}
|
|
2938
|
-
function
|
|
2954
|
+
function Be(t, e) {
|
|
2939
2955
|
return typeof e == "function" ? "" + e : e;
|
|
2940
2956
|
}
|
|
2941
|
-
function
|
|
2957
|
+
function Le(t) {
|
|
2942
2958
|
Object.keys(t).forEach((e) => delete t[e]);
|
|
2943
2959
|
}
|
|
2944
|
-
const
|
|
2960
|
+
const ce = {
|
|
2945
2961
|
init(t) {
|
|
2946
2962
|
},
|
|
2947
2963
|
toFormValue(t, e) {
|
|
@@ -2960,8 +2976,8 @@ const fe = {
|
|
|
2960
2976
|
},
|
|
2961
2977
|
mergeProp(t) {
|
|
2962
2978
|
}
|
|
2963
|
-
},
|
|
2964
|
-
function
|
|
2979
|
+
}, gr = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "component", "cache"];
|
|
2980
|
+
function $r(t) {
|
|
2965
2981
|
p(t.prototype, {
|
|
2966
2982
|
getCtx(e) {
|
|
2967
2983
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
@@ -2991,7 +3007,7 @@ function Cr(t) {
|
|
|
2991
3007
|
},
|
|
2992
3008
|
getParser(e) {
|
|
2993
3009
|
const r = this.fc.parsers;
|
|
2994
|
-
return r[e.originType] || r[R(e.type)] || r[e.trueType] ||
|
|
3010
|
+
return r[e.originType] || r[R(e.type)] || r[e.trueType] || ce;
|
|
2995
3011
|
},
|
|
2996
3012
|
bindParser(e) {
|
|
2997
3013
|
e.setParser(this.getParser(e));
|
|
@@ -3005,7 +3021,7 @@ function Cr(t) {
|
|
|
3005
3021
|
},
|
|
3006
3022
|
watchCtx(e) {
|
|
3007
3023
|
const r = this.vm;
|
|
3008
|
-
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
3024
|
+
Object.keys(e.rule).filter((i) => i[0] !== "_" && i[0] !== "$" && gr.indexOf(i) === -1).forEach((i) => {
|
|
3009
3025
|
const s = i === "children";
|
|
3010
3026
|
e.watch.push(r.$watch(() => e.rule[i], (n, o) => {
|
|
3011
3027
|
if (!(this.loading || this.noWatchFn || this.reloading)) {
|
|
@@ -3025,7 +3041,7 @@ function Cr(t) {
|
|
|
3025
3041
|
else if (i === "type")
|
|
3026
3042
|
e.updateType(), this.bindParser(e);
|
|
3027
3043
|
else if (i === "children") {
|
|
3028
|
-
const a =
|
|
3044
|
+
const a = h.trueArray(n);
|
|
3029
3045
|
this.deferSyncValue(() => {
|
|
3030
3046
|
n !== o && (this.rmSub(o, e), this.$render.initOrgChildren()), a && this.loadChildren(n, e), this.vm.$emit("update", this.api);
|
|
3031
3047
|
});
|
|
@@ -3036,7 +3052,7 @@ function Cr(t) {
|
|
|
3036
3052
|
}), this.watchEffect(e);
|
|
3037
3053
|
},
|
|
3038
3054
|
rmSub(e, r) {
|
|
3039
|
-
|
|
3055
|
+
h.trueArray(e) && e.forEach((i) => {
|
|
3040
3056
|
i && i.__fc__ && i.__fc__.parent === r && this.rmCtx(i.__fc__);
|
|
3041
3057
|
});
|
|
3042
3058
|
},
|
|
@@ -3047,14 +3063,14 @@ function Cr(t) {
|
|
|
3047
3063
|
value: e.rule.value,
|
|
3048
3064
|
writable: !0
|
|
3049
3065
|
}), T(this.ctxs, r), T(this.$render.tempList, r), T(this.$render.orgChildren, r), T(this.vm.ctxInject, r), T(this.formData, r), T(this.subForm, r), T(e, "cacheValue"), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !k(this.fieldCtx, i) && T(this.form, i), this.deferSyncValue(() => {
|
|
3050
|
-
this.reloading || (e.parser.loadChildren !== !1 &&
|
|
3066
|
+
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());
|
|
3051
3067
|
}, s);
|
|
3052
3068
|
const o = this.sort.indexOf(r);
|
|
3053
3069
|
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;
|
|
3054
3070
|
}
|
|
3055
3071
|
});
|
|
3056
3072
|
}
|
|
3057
|
-
function
|
|
3073
|
+
function vr(t) {
|
|
3058
3074
|
p(t.prototype, {
|
|
3059
3075
|
mounted() {
|
|
3060
3076
|
const e = () => {
|
|
@@ -3065,23 +3081,26 @@ function _r(t) {
|
|
|
3065
3081
|
lifecycle(e) {
|
|
3066
3082
|
this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3067
3083
|
},
|
|
3084
|
+
targetReload() {
|
|
3085
|
+
this.bus.$off("next-tick", this.nextReload), this.bus.$once("next-tick", this.nextReload);
|
|
3086
|
+
},
|
|
3068
3087
|
emitEvent(e, ...r) {
|
|
3069
3088
|
const i = this.options[e] || this.options[R("on-" + e)];
|
|
3070
3089
|
if (i) {
|
|
3071
3090
|
const s = M(i);
|
|
3072
|
-
|
|
3091
|
+
h.Function(s) && E(() => s(...r));
|
|
3073
3092
|
}
|
|
3074
3093
|
this.bus.$emit(e, ...r);
|
|
3075
3094
|
}
|
|
3076
3095
|
});
|
|
3077
3096
|
}
|
|
3078
|
-
function
|
|
3097
|
+
function br(t) {
|
|
3079
3098
|
p(t.prototype, {
|
|
3080
3099
|
useProvider() {
|
|
3081
3100
|
const e = this.fc.providers;
|
|
3082
3101
|
Object.keys(e).forEach((r) => {
|
|
3083
3102
|
let i = e[r];
|
|
3084
|
-
|
|
3103
|
+
h.Function(i) && (i = i(this.fc)), i._c = _r(i), this.onEffect(i), this.providers[r] = i;
|
|
3085
3104
|
});
|
|
3086
3105
|
},
|
|
3087
3106
|
onEffect(e) {
|
|
@@ -3152,17 +3171,17 @@ function Or(t) {
|
|
|
3152
3171
|
}
|
|
3153
3172
|
});
|
|
3154
3173
|
}
|
|
3155
|
-
function
|
|
3174
|
+
function Cr(t) {
|
|
3156
3175
|
return t.filter(function(e, r, i) {
|
|
3157
3176
|
return i.indexOf(e, 0) === r;
|
|
3158
3177
|
});
|
|
3159
3178
|
}
|
|
3160
|
-
function
|
|
3179
|
+
function _r(t) {
|
|
3161
3180
|
const e = t.components;
|
|
3162
3181
|
if (Array.isArray(e)) {
|
|
3163
|
-
const r =
|
|
3182
|
+
const r = Cr(e.filter((i) => i !== "*"));
|
|
3164
3183
|
return r.length ? r : !1;
|
|
3165
|
-
} else return
|
|
3184
|
+
} else return h.String(e) ? [e] : !1;
|
|
3166
3185
|
}
|
|
3167
3186
|
function A(t) {
|
|
3168
3187
|
p(this, {
|
|
@@ -3187,14 +3206,14 @@ function A(t) {
|
|
|
3187
3206
|
nextReload: () => {
|
|
3188
3207
|
this.lifecycle("reload");
|
|
3189
3208
|
}
|
|
3190
|
-
}),
|
|
3209
|
+
}), tt(this, {
|
|
3191
3210
|
options() {
|
|
3192
3211
|
return t.options;
|
|
3193
3212
|
},
|
|
3194
3213
|
bus() {
|
|
3195
3214
|
return t.bus;
|
|
3196
3215
|
}
|
|
3197
|
-
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new
|
|
3216
|
+
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new be(this), this.api = t.extendApi(rr(this), this);
|
|
3198
3217
|
}
|
|
3199
3218
|
p(A.prototype, {
|
|
3200
3219
|
initData(t) {
|
|
@@ -3212,30 +3231,30 @@ p(A.prototype, {
|
|
|
3212
3231
|
beforeFetch(t) {
|
|
3213
3232
|
return new Promise((e) => {
|
|
3214
3233
|
const r = this.options.beforeFetch && E(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3215
|
-
r &&
|
|
3234
|
+
r && h.Function(r.then) ? r.then(e) : e();
|
|
3216
3235
|
});
|
|
3217
3236
|
}
|
|
3218
3237
|
});
|
|
3219
|
-
|
|
3238
|
+
ar(A);
|
|
3239
|
+
lr(A);
|
|
3220
3240
|
fr(A);
|
|
3221
|
-
|
|
3222
|
-
|
|
3241
|
+
cr(A);
|
|
3242
|
+
yr(A);
|
|
3243
|
+
$r(A);
|
|
3223
3244
|
vr(A);
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
Or
|
|
3227
|
-
const Fr = "fcFragment", re = {
|
|
3228
|
-
name: Fr,
|
|
3245
|
+
br(A);
|
|
3246
|
+
const Or = "fcFragment", re = {
|
|
3247
|
+
name: Or,
|
|
3229
3248
|
functional: !0,
|
|
3230
3249
|
props: ["vnode"],
|
|
3231
3250
|
render(t, e) {
|
|
3232
3251
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3233
3252
|
}
|
|
3234
3253
|
};
|
|
3235
|
-
function
|
|
3236
|
-
return
|
|
3254
|
+
function kr(t) {
|
|
3255
|
+
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3237
3256
|
}
|
|
3238
|
-
function
|
|
3257
|
+
function wr() {
|
|
3239
3258
|
const t = {};
|
|
3240
3259
|
function e(r) {
|
|
3241
3260
|
r && this.setVm(r);
|
|
@@ -3248,7 +3267,7 @@ function Er() {
|
|
|
3248
3267
|
return P.config.isReservedTag(r) && i.nativeOn && delete i.nativeOn, this.makeComponent(r, i, s);
|
|
3249
3268
|
},
|
|
3250
3269
|
makeComponent(r, i, s) {
|
|
3251
|
-
let n = this.$h(r,
|
|
3270
|
+
let n = this.$h(r, kr(i), s || []);
|
|
3252
3271
|
return n.context = this.vm, n;
|
|
3253
3272
|
},
|
|
3254
3273
|
aliasMap: t
|
|
@@ -3259,7 +3278,7 @@ function Er() {
|
|
|
3259
3278
|
},
|
|
3260
3279
|
use(r) {
|
|
3261
3280
|
Object.keys(r).forEach((i) => {
|
|
3262
|
-
const s =
|
|
3281
|
+
const s = X(i), n = nr(i).toLocaleLowerCase(), o = r[i];
|
|
3263
3282
|
[i, s, n].forEach((a) => {
|
|
3264
3283
|
e.alias(i, o), e.prototype[a] = function(u, l) {
|
|
3265
3284
|
return this.make(o, u, l);
|
|
@@ -3269,12 +3288,12 @@ function Er() {
|
|
|
3269
3288
|
}
|
|
3270
3289
|
}), e;
|
|
3271
3290
|
}
|
|
3272
|
-
function
|
|
3273
|
-
class e extends
|
|
3291
|
+
function Fr(t) {
|
|
3292
|
+
class e extends lt {
|
|
3274
3293
|
}
|
|
3275
3294
|
return Object.assign(e.prototype, t), e;
|
|
3276
3295
|
}
|
|
3277
|
-
function
|
|
3296
|
+
function lt(t) {
|
|
3278
3297
|
p(this, {
|
|
3279
3298
|
$handle: t,
|
|
3280
3299
|
vm: t.vm,
|
|
@@ -3285,12 +3304,12 @@ function ft(t) {
|
|
|
3285
3304
|
}
|
|
3286
3305
|
}), this.updateKey(), this.init();
|
|
3287
3306
|
}
|
|
3288
|
-
p(
|
|
3307
|
+
p(lt.prototype, {
|
|
3289
3308
|
__init() {
|
|
3290
3309
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3291
3310
|
},
|
|
3292
3311
|
updateKey() {
|
|
3293
|
-
this.key =
|
|
3312
|
+
this.key = ee();
|
|
3294
3313
|
},
|
|
3295
3314
|
//TODO interface
|
|
3296
3315
|
init() {
|
|
@@ -3330,7 +3349,7 @@ p(ft.prototype, {
|
|
|
3330
3349
|
render(t) {
|
|
3331
3350
|
}
|
|
3332
3351
|
});
|
|
3333
|
-
const
|
|
3352
|
+
const Sr = function(t) {
|
|
3334
3353
|
const e = {
|
|
3335
3354
|
name: "loadData",
|
|
3336
3355
|
_fn: [],
|
|
@@ -3343,7 +3362,7 @@ const Ir = function(t) {
|
|
|
3343
3362
|
const u = () => {
|
|
3344
3363
|
a.watch !== !1 && (t.bus.$off("p.loadData." + a.attr, u), t.bus.$once("p.loadData." + a.attr, u));
|
|
3345
3364
|
let l;
|
|
3346
|
-
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = B(l))),
|
|
3365
|
+
a.attr && (l = t.loadData[a.attr] || a.default, a.copy !== !1 && (l = B(l))), Q(r.getProp(), a.to || "options", l), s.sync(i);
|
|
3347
3366
|
};
|
|
3348
3367
|
o.push(() => t.bus.$off("p.loadData." + a.attr, u)), u();
|
|
3349
3368
|
}
|
|
@@ -3356,13 +3375,13 @@ const Ir = function(t) {
|
|
|
3356
3375
|
}
|
|
3357
3376
|
};
|
|
3358
3377
|
return e.watch = e.created, e;
|
|
3359
|
-
},
|
|
3378
|
+
}, ut = {
|
|
3360
3379
|
name: "componentValidate",
|
|
3361
3380
|
load(t, e, r) {
|
|
3362
3381
|
const i = t.getValue();
|
|
3363
3382
|
i ? t.getProp().validate = [{
|
|
3364
3383
|
validator(...s) {
|
|
3365
|
-
const n =
|
|
3384
|
+
const n = x(e);
|
|
3366
3385
|
if (n)
|
|
3367
3386
|
return r.exec(n.id, i === !0 ? "formCreateValidate" : i, ...s, {
|
|
3368
3387
|
attr: t,
|
|
@@ -3373,11 +3392,11 @@ const Ir = function(t) {
|
|
|
3373
3392
|
}] : (t.clearProp(), r.clearValidateState([e.field]));
|
|
3374
3393
|
},
|
|
3375
3394
|
watch(...t) {
|
|
3376
|
-
|
|
3395
|
+
ut.load(...t);
|
|
3377
3396
|
}
|
|
3378
|
-
},
|
|
3397
|
+
}, Er = function(t) {
|
|
3379
3398
|
function e(i) {
|
|
3380
|
-
return
|
|
3399
|
+
return h.String(i) && (i = {
|
|
3381
3400
|
action: i,
|
|
3382
3401
|
to: "options"
|
|
3383
3402
|
}), i;
|
|
@@ -3385,9 +3404,9 @@ const Ir = function(t) {
|
|
|
3385
3404
|
function r(i, s, n) {
|
|
3386
3405
|
let o = i.value;
|
|
3387
3406
|
const a = (m) => {
|
|
3388
|
-
m === void 0 ? (i.clearProp(), n.sync(s)) :
|
|
3407
|
+
m === void 0 ? (i.clearProp(), n.sync(s)) : Q(i.getProp(), o.to || "options", m);
|
|
3389
3408
|
};
|
|
3390
|
-
if (
|
|
3409
|
+
if (h.Function(o) && (o = o(s, n)), o = e(o), !o || !o.action) {
|
|
3391
3410
|
a(void 0);
|
|
3392
3411
|
return;
|
|
3393
3412
|
}
|
|
@@ -3401,16 +3420,16 @@ const Ir = function(t) {
|
|
|
3401
3420
|
onSuccess(m, v) {
|
|
3402
3421
|
if (l()) return;
|
|
3403
3422
|
let _ = (g) => v ? g : k(g, "data") ? g.data : g;
|
|
3404
|
-
|
|
3423
|
+
h.Function(o.parse) ? _ = o.parse : o.parse && h.String(o.parse) && (_ = (g) => (o.parse.split(".").forEach((O) => {
|
|
3405
3424
|
g && (g = g[O]);
|
|
3406
3425
|
}), g)), a(_(m, s, n)), n.sync(s);
|
|
3407
3426
|
},
|
|
3408
3427
|
onError(m) {
|
|
3409
|
-
a(void 0), !l() && (u || ((v) =>
|
|
3428
|
+
a(void 0), !l() && (u || ((v) => ge(v.message || "fetch fail " + o.action)))(m, s, n);
|
|
3410
3429
|
}
|
|
3411
3430
|
});
|
|
3412
3431
|
t.$handle.beforeFetch(c, { rule: s, api: n }).then(() => {
|
|
3413
|
-
if (
|
|
3432
|
+
if (h.Function(o.action)) {
|
|
3414
3433
|
o.action(s, n).then((m) => {
|
|
3415
3434
|
c.onSuccess(m, !0);
|
|
3416
3435
|
}).catch((m) => {
|
|
@@ -3430,17 +3449,17 @@ const Ir = function(t) {
|
|
|
3430
3449
|
r(...i);
|
|
3431
3450
|
}
|
|
3432
3451
|
};
|
|
3433
|
-
},
|
|
3452
|
+
}, ft = {
|
|
3434
3453
|
name: "required",
|
|
3435
3454
|
load(t, e, r) {
|
|
3436
|
-
const i =
|
|
3455
|
+
const i = Rr(t.getValue());
|
|
3437
3456
|
if (i.required === !1)
|
|
3438
3457
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
3439
3458
|
else {
|
|
3440
3459
|
const s = y({
|
|
3441
3460
|
required: !0,
|
|
3442
3461
|
validator(n, o, a) {
|
|
3443
|
-
|
|
3462
|
+
h.empty(o) ? a(s.message) : a();
|
|
3444
3463
|
}
|
|
3445
3464
|
}, i);
|
|
3446
3465
|
if (!s.message) {
|
|
@@ -3452,38 +3471,38 @@ const Ir = function(t) {
|
|
|
3452
3471
|
r.sync(e);
|
|
3453
3472
|
},
|
|
3454
3473
|
watch(...t) {
|
|
3455
|
-
|
|
3474
|
+
ft.load(...t);
|
|
3456
3475
|
}
|
|
3457
3476
|
};
|
|
3458
|
-
function
|
|
3459
|
-
return
|
|
3477
|
+
function Rr(t) {
|
|
3478
|
+
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 : {};
|
|
3460
3479
|
}
|
|
3461
|
-
const
|
|
3462
|
-
fetch:
|
|
3463
|
-
loadData:
|
|
3464
|
-
required:
|
|
3465
|
-
componentValidate:
|
|
3466
|
-
},
|
|
3467
|
-
name:
|
|
3480
|
+
const Ir = {
|
|
3481
|
+
fetch: Er,
|
|
3482
|
+
loadData: Sr,
|
|
3483
|
+
required: ft,
|
|
3484
|
+
componentValidate: ut
|
|
3485
|
+
}, jr = "html", Ar = {
|
|
3486
|
+
name: jr,
|
|
3468
3487
|
loadChildren: !1,
|
|
3469
3488
|
render(t, e) {
|
|
3470
3489
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
3471
3490
|
},
|
|
3472
3491
|
renderChildren(t) {
|
|
3473
|
-
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) =>
|
|
3492
|
+
return Array.isArray(t.rule.children) ? t.rule.children.filter((e) => h.String(e)).join("") : "";
|
|
3474
3493
|
}
|
|
3475
3494
|
};
|
|
3476
|
-
function
|
|
3495
|
+
function Vr(t, e) {
|
|
3477
3496
|
let r;
|
|
3478
3497
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
3479
3498
|
}
|
|
3480
3499
|
function ie() {
|
|
3481
|
-
return
|
|
3500
|
+
return Vr("name", ...arguments);
|
|
3482
3501
|
}
|
|
3483
|
-
function
|
|
3484
|
-
return !t || !t.el ? window.document.body :
|
|
3502
|
+
function Ne(t) {
|
|
3503
|
+
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
3485
3504
|
}
|
|
3486
|
-
function
|
|
3505
|
+
function Me(t, e) {
|
|
3487
3506
|
const r = new P({
|
|
3488
3507
|
data() {
|
|
3489
3508
|
return { rule: t, option: e || {} };
|
|
@@ -3494,116 +3513,116 @@ function qe(t, e) {
|
|
|
3494
3513
|
});
|
|
3495
3514
|
return r.$mount(), r;
|
|
3496
3515
|
}
|
|
3497
|
-
function
|
|
3516
|
+
function Pr(t) {
|
|
3498
3517
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
3499
|
-
|
|
3518
|
+
Ze.push(...e), pe.push(...r), me.push(...i), it([...e, ...r, ...i]);
|
|
3500
3519
|
}
|
|
3501
|
-
let
|
|
3520
|
+
let Dr = 1;
|
|
3502
3521
|
const S = {};
|
|
3503
|
-
function
|
|
3522
|
+
function ht(t) {
|
|
3504
3523
|
const e = {
|
|
3505
3524
|
[re.name]: re
|
|
3506
|
-
}, r = {}, i = {}, s = y({},
|
|
3525
|
+
}, r = {}, i = {}, s = y({}, Ir), n = Yt();
|
|
3507
3526
|
let o = { global: {} };
|
|
3508
|
-
const a = {}, u =
|
|
3509
|
-
|
|
3510
|
-
function c(
|
|
3511
|
-
const d = S[
|
|
3527
|
+
const a = {}, u = wr(), l = {};
|
|
3528
|
+
Pr(t.attrs || {});
|
|
3529
|
+
function c(f) {
|
|
3530
|
+
const d = S[f];
|
|
3512
3531
|
if (Array.isArray(d))
|
|
3513
3532
|
return d.map(($) => $.api());
|
|
3514
3533
|
if (d)
|
|
3515
3534
|
return d.api();
|
|
3516
3535
|
}
|
|
3517
3536
|
function m() {
|
|
3518
|
-
const
|
|
3519
|
-
|
|
3537
|
+
const f = ie(...arguments);
|
|
3538
|
+
f.id && f.prop && (i[f.id] = f.prop);
|
|
3520
3539
|
}
|
|
3521
3540
|
function v() {
|
|
3522
|
-
const
|
|
3523
|
-
|
|
3541
|
+
const f = ie(...arguments);
|
|
3542
|
+
f.id && f.prop && (s[f.id] = q(y({}, f.prop), { name: f.id }));
|
|
3524
3543
|
}
|
|
3525
|
-
function _(
|
|
3526
|
-
u.use(
|
|
3544
|
+
function _(f) {
|
|
3545
|
+
u.use(f);
|
|
3527
3546
|
}
|
|
3528
3547
|
function g() {
|
|
3529
|
-
const
|
|
3530
|
-
if (!
|
|
3531
|
-
const d = R(
|
|
3532
|
-
r[d] = $, Object.setPrototypeOf($, b ||
|
|
3548
|
+
const f = ie(...arguments);
|
|
3549
|
+
if (!f.id || !f.prop) return ce;
|
|
3550
|
+
const d = R(f.id), $ = f.prop, b = $.merge === !0 ? r[d] : void 0;
|
|
3551
|
+
r[d] = $, Object.setPrototypeOf($, b || ce), n[d] = F(d), $.maker && p(n, $.maker);
|
|
3533
3552
|
}
|
|
3534
|
-
function O(
|
|
3553
|
+
function O(f, d) {
|
|
3535
3554
|
let $;
|
|
3536
|
-
if (
|
|
3537
|
-
if ($ = R(
|
|
3538
|
-
return
|
|
3555
|
+
if (h.String(f)) {
|
|
3556
|
+
if ($ = R(f), ["form-create", "formcreate"].indexOf($) > -1)
|
|
3557
|
+
return W();
|
|
3539
3558
|
if (d === void 0)
|
|
3540
3559
|
return e[$];
|
|
3541
3560
|
} else
|
|
3542
|
-
$ = R(
|
|
3561
|
+
$ = R(f.name), d = f;
|
|
3543
3562
|
if (!$ || !d) return;
|
|
3544
3563
|
const b = R($);
|
|
3545
3564
|
e[$] = d, e[b] = d, delete u.aliasMap[$], delete u.aliasMap[b], delete r[$], delete r[b], d.formCreateParser && g($, d.formCreateParser);
|
|
3546
3565
|
}
|
|
3547
|
-
function
|
|
3566
|
+
function Ce(f) {
|
|
3548
3567
|
Object.keys(S).forEach((d) => {
|
|
3549
3568
|
(Array.isArray(S[d]) ? S[d] : [S[d]]).forEach((b) => {
|
|
3550
|
-
b.bus.$emit("p.loadData." +
|
|
3569
|
+
b.bus.$emit("p.loadData." + f);
|
|
3551
3570
|
});
|
|
3552
3571
|
});
|
|
3553
3572
|
}
|
|
3554
|
-
function
|
|
3555
|
-
a[
|
|
3573
|
+
function _e(f, d) {
|
|
3574
|
+
a[f] = d, Ce(f);
|
|
3556
3575
|
}
|
|
3557
|
-
function
|
|
3558
|
-
return k(a,
|
|
3576
|
+
function Oe(f, d) {
|
|
3577
|
+
return k(a, f) ? a[f] : d;
|
|
3559
3578
|
}
|
|
3560
|
-
function
|
|
3561
|
-
delete a[
|
|
3579
|
+
function ct(f) {
|
|
3580
|
+
delete a[f], Ce(f);
|
|
3562
3581
|
}
|
|
3563
|
-
function
|
|
3564
|
-
return
|
|
3582
|
+
function W() {
|
|
3583
|
+
return zt(we, e, i);
|
|
3565
3584
|
}
|
|
3566
|
-
function
|
|
3585
|
+
function ke() {
|
|
3567
3586
|
return re;
|
|
3568
3587
|
}
|
|
3569
|
-
function
|
|
3570
|
-
return
|
|
3588
|
+
function dt(f, d) {
|
|
3589
|
+
return h.Function(f.install) ? f.install(N, d) : h.Function(f) && f(N, d), this;
|
|
3571
3590
|
}
|
|
3572
|
-
function N(
|
|
3573
|
-
let b =
|
|
3591
|
+
function N(f, d, $) {
|
|
3592
|
+
let b = Me(f, d || {});
|
|
3574
3593
|
const j = b.$refs.fc.formCreate;
|
|
3575
|
-
return j.$parent = $,
|
|
3594
|
+
return j.$parent = $, Ne(j.options).appendChild(b.$el), j.api();
|
|
3576
3595
|
}
|
|
3577
3596
|
Object.setPrototypeOf(N, l);
|
|
3578
|
-
function
|
|
3597
|
+
function pt(f) {
|
|
3579
3598
|
let d = y({}, t);
|
|
3580
|
-
return
|
|
3599
|
+
return f ? d.inherit = {
|
|
3581
3600
|
components: e,
|
|
3582
3601
|
parsers: r,
|
|
3583
3602
|
directives: i,
|
|
3584
3603
|
providers: s,
|
|
3585
3604
|
maker: n,
|
|
3586
3605
|
loadData: a
|
|
3587
|
-
} : delete d.inherit,
|
|
3606
|
+
} : delete d.inherit, ht(d);
|
|
3588
3607
|
}
|
|
3589
|
-
function
|
|
3590
|
-
const d =
|
|
3608
|
+
function we(f) {
|
|
3609
|
+
const d = f.$options.propsData.rule;
|
|
3591
3610
|
p(this, {
|
|
3592
|
-
id:
|
|
3593
|
-
vm:
|
|
3611
|
+
id: Dr++,
|
|
3612
|
+
vm: f,
|
|
3594
3613
|
create: N,
|
|
3595
|
-
manager:
|
|
3614
|
+
manager: Fr(t.manager),
|
|
3596
3615
|
parsers: r,
|
|
3597
3616
|
providers: s,
|
|
3598
3617
|
rules: Array.isArray(d) ? d : [],
|
|
3599
|
-
name:
|
|
3600
|
-
inFor:
|
|
3618
|
+
name: f.$options.propsData.name || ee(),
|
|
3619
|
+
inFor: f.$options.propsData.inFor,
|
|
3601
3620
|
prop: {
|
|
3602
3621
|
components: e,
|
|
3603
3622
|
directives: i
|
|
3604
3623
|
},
|
|
3605
|
-
setData:
|
|
3606
|
-
getData:
|
|
3624
|
+
setData: _e,
|
|
3625
|
+
getData: Oe,
|
|
3607
3626
|
loadData: a,
|
|
3608
3627
|
CreateNode: u,
|
|
3609
3628
|
bus: new P(),
|
|
@@ -3612,23 +3631,23 @@ function pt(t) {
|
|
|
3612
3631
|
extendApi: t.extendApi || (($) => $)
|
|
3613
3632
|
}), this.init(), this.initOptions(), this.name && (this.inFor ? (S[this.name] || (S[this.name] = []), S[this.name].push(this)) : S[this.name] = this);
|
|
3614
3633
|
}
|
|
3615
|
-
p(
|
|
3634
|
+
p(we.prototype, {
|
|
3616
3635
|
init() {
|
|
3617
|
-
const
|
|
3618
|
-
this.$handle = d,
|
|
3619
|
-
this.isSub() && (this.unwatch =
|
|
3620
|
-
this.initOptions(),
|
|
3636
|
+
const f = this.vm, d = new A(this);
|
|
3637
|
+
this.$handle = d, f.$f = d.api, f.$emit("input", d.api), f.$on("hook:created", () => {
|
|
3638
|
+
this.isSub() && (this.unwatch = f.$watch(() => f.$pfc.option, () => {
|
|
3639
|
+
this.initOptions(), f.$f.refresh();
|
|
3621
3640
|
}, { deep: !0 }), this.initOptions()), this.created();
|
|
3622
|
-
}),
|
|
3641
|
+
}), f.$on("hook:mounted", () => {
|
|
3623
3642
|
this.mounted();
|
|
3624
|
-
}),
|
|
3625
|
-
if (
|
|
3643
|
+
}), f.$on("hook:beforeDestroy", () => {
|
|
3644
|
+
if (f.destroyed = !0, this.unwatch && this.unwatch(), d.reloadRule([]), this.name)
|
|
3626
3645
|
if (this.inFor) {
|
|
3627
3646
|
const $ = S[this.name].indexOf(this);
|
|
3628
3647
|
S[this.name].splice($, 1), S[this.name].length || delete S[this.name];
|
|
3629
3648
|
} else
|
|
3630
3649
|
delete S[this.name];
|
|
3631
|
-
}),
|
|
3650
|
+
}), f.$on("hook:updated", () => {
|
|
3632
3651
|
d.bindNextTick(() => this.bus.$emit("next-tick", d.api));
|
|
3633
3652
|
});
|
|
3634
3653
|
},
|
|
@@ -3637,16 +3656,16 @@ function pt(t) {
|
|
|
3637
3656
|
},
|
|
3638
3657
|
initOptions() {
|
|
3639
3658
|
this.options = {};
|
|
3640
|
-
let
|
|
3641
|
-
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0),
|
|
3659
|
+
let f = y({ formData: {}, submitBtn: {}, resetBtn: {} }, B(o));
|
|
3660
|
+
this.isSub() && this.mergeOptions(this.options, this.vm.$pfc.$f.config || {}, !0), f = this.mergeOptions(f, this.vm.$options.propsData.option), this.updateOptions(f);
|
|
3642
3661
|
},
|
|
3643
|
-
mergeOptions(
|
|
3644
|
-
return d = B(d), $ && ["page", "onSubmit", "mounted", "reload", "formData", "el"].forEach((b) => {
|
|
3662
|
+
mergeOptions(f, d, $) {
|
|
3663
|
+
return d = B(d), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el"].forEach((b) => {
|
|
3645
3664
|
delete d[b];
|
|
3646
|
-
}), d.global && (
|
|
3665
|
+
}), d.global && (f.global = Qt(f.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], f), f;
|
|
3647
3666
|
},
|
|
3648
|
-
updateOptions(
|
|
3649
|
-
this.mergeOptions(this.options,
|
|
3667
|
+
updateOptions(f) {
|
|
3668
|
+
this.mergeOptions(this.options, f), this.$handle.$manager.updateOptions(this.options);
|
|
3650
3669
|
},
|
|
3651
3670
|
created() {
|
|
3652
3671
|
this.$handle.init(), this.vm.$emit("created", this.api());
|
|
@@ -3661,35 +3680,35 @@ function pt(t) {
|
|
|
3661
3680
|
this.$handle.mounted();
|
|
3662
3681
|
}
|
|
3663
3682
|
});
|
|
3664
|
-
function
|
|
3665
|
-
p(
|
|
3683
|
+
function Fe(f) {
|
|
3684
|
+
p(f, {
|
|
3666
3685
|
version: t.version,
|
|
3667
3686
|
ui: t.ui,
|
|
3668
|
-
setData:
|
|
3669
|
-
getData:
|
|
3670
|
-
removeData:
|
|
3687
|
+
setData: _e,
|
|
3688
|
+
getData: Oe,
|
|
3689
|
+
removeData: ct,
|
|
3671
3690
|
maker: n,
|
|
3672
3691
|
component: O,
|
|
3673
3692
|
directive: m,
|
|
3674
3693
|
register: v,
|
|
3675
|
-
$vnode:
|
|
3694
|
+
$vnode: ke,
|
|
3676
3695
|
parser: g,
|
|
3677
|
-
use:
|
|
3678
|
-
factory:
|
|
3696
|
+
use: dt,
|
|
3697
|
+
factory: pt,
|
|
3679
3698
|
componentAlias: _,
|
|
3680
|
-
copyRule:
|
|
3681
|
-
copyRules:
|
|
3682
|
-
fetch:
|
|
3683
|
-
$form:
|
|
3699
|
+
copyRule: $e,
|
|
3700
|
+
copyRules: et,
|
|
3701
|
+
fetch: st,
|
|
3702
|
+
$form: W,
|
|
3684
3703
|
parseFn: M,
|
|
3685
|
-
parseJson:
|
|
3686
|
-
toJson:
|
|
3704
|
+
parseJson: Xt,
|
|
3705
|
+
toJson: Ye,
|
|
3687
3706
|
getApi: c,
|
|
3688
3707
|
init(d, $ = {}) {
|
|
3689
|
-
let b =
|
|
3708
|
+
let b = Me(d, $), j = b.$refs.fc.formCreate;
|
|
3690
3709
|
return {
|
|
3691
3710
|
mount(H) {
|
|
3692
|
-
return H &&
|
|
3711
|
+
return H && h.Element(H) && (j.options.el = H), Ne(j.options).appendChild(b.$el), j.api();
|
|
3693
3712
|
},
|
|
3694
3713
|
remove() {
|
|
3695
3714
|
b.$el.parentNode && b.$el.parentNode.removeChild(b.$el);
|
|
@@ -3702,8 +3721,8 @@ function pt(t) {
|
|
|
3702
3721
|
}
|
|
3703
3722
|
});
|
|
3704
3723
|
}
|
|
3705
|
-
function
|
|
3706
|
-
p(
|
|
3724
|
+
function mt(f) {
|
|
3725
|
+
p(f, {
|
|
3707
3726
|
create: N,
|
|
3708
3727
|
install(d, $) {
|
|
3709
3728
|
if (o = y(y({}, o), $ || {}), d._installedFormCreate === !0) return;
|
|
@@ -3711,38 +3730,38 @@ function pt(t) {
|
|
|
3711
3730
|
const b = function(j, H = {}) {
|
|
3712
3731
|
return N(j, H, this);
|
|
3713
3732
|
};
|
|
3714
|
-
|
|
3733
|
+
Fe(b), d.prototype.$formCreate = b, d.component("FormCreate", W()), d.component("FcFragment", ke());
|
|
3715
3734
|
}
|
|
3716
3735
|
});
|
|
3717
3736
|
}
|
|
3718
|
-
if (
|
|
3719
|
-
const
|
|
3720
|
-
|
|
3737
|
+
if (Fe(l), mt(l), u.use({ fragment: "fcFragment" }), g(Ar), t.install && N.use(t), t.inherit) {
|
|
3738
|
+
const f = t.inherit;
|
|
3739
|
+
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);
|
|
3721
3740
|
}
|
|
3722
|
-
const G =
|
|
3741
|
+
const G = W();
|
|
3723
3742
|
return Object.setPrototypeOf(G, l), Object.defineProperties(G, {
|
|
3724
3743
|
fetch: {
|
|
3725
3744
|
get() {
|
|
3726
3745
|
return l.fetch;
|
|
3727
3746
|
},
|
|
3728
|
-
set(
|
|
3729
|
-
l.fetch =
|
|
3747
|
+
set(f) {
|
|
3748
|
+
l.fetch = f;
|
|
3730
3749
|
}
|
|
3731
3750
|
}
|
|
3732
3751
|
}), G.util = l, G;
|
|
3733
3752
|
}
|
|
3734
3753
|
function ne(t) {
|
|
3735
|
-
if (
|
|
3754
|
+
if (h.Date(t))
|
|
3736
3755
|
return t;
|
|
3737
3756
|
{
|
|
3738
3757
|
let e = new Date(t);
|
|
3739
3758
|
return e.toString() === "Invalid Date" ? t : e;
|
|
3740
3759
|
}
|
|
3741
3760
|
}
|
|
3742
|
-
const
|
|
3743
|
-
name:
|
|
3761
|
+
const Ue = "datePicker", Tr = {
|
|
3762
|
+
name: Ue,
|
|
3744
3763
|
maker: function() {
|
|
3745
|
-
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = F(
|
|
3764
|
+
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = F(Ue, { type: e.toLowerCase() }), t), {});
|
|
3746
3765
|
}(),
|
|
3747
3766
|
mergeProp(t) {
|
|
3748
3767
|
let e = t.prop.props;
|
|
@@ -3771,7 +3790,7 @@ const He = "datePicker", Nr = {
|
|
|
3771
3790
|
mounted(t) {
|
|
3772
3791
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
3773
3792
|
}
|
|
3774
|
-
}, se = "hidden",
|
|
3793
|
+
}, se = "hidden", Br = {
|
|
3775
3794
|
name: se,
|
|
3776
3795
|
maker: {
|
|
3777
3796
|
[se]: (t, e) => F(se)("", t, e)
|
|
@@ -3779,7 +3798,7 @@ const He = "datePicker", Nr = {
|
|
|
3779
3798
|
render() {
|
|
3780
3799
|
return [];
|
|
3781
3800
|
}
|
|
3782
|
-
}, oe = "input",
|
|
3801
|
+
}, oe = "input", Lr = {
|
|
3783
3802
|
name: oe,
|
|
3784
3803
|
maker: function() {
|
|
3785
3804
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = F(oe, { type: r }), e), {});
|
|
@@ -3789,36 +3808,36 @@ const He = "datePicker", Nr = {
|
|
|
3789
3808
|
let { props: e } = t.prop;
|
|
3790
3809
|
e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
3791
3810
|
}
|
|
3792
|
-
},
|
|
3793
|
-
name:
|
|
3811
|
+
}, qe = "slider", Nr = {
|
|
3812
|
+
name: qe,
|
|
3794
3813
|
maker: {
|
|
3795
|
-
sliderRange: F(
|
|
3814
|
+
sliderRange: F(qe, { range: !0 })
|
|
3796
3815
|
},
|
|
3797
3816
|
toFormValue(t, e) {
|
|
3798
3817
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
3799
3818
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
3800
3819
|
}
|
|
3801
|
-
},
|
|
3820
|
+
}, Mr = {
|
|
3802
3821
|
name: "switch",
|
|
3803
3822
|
mergeProp(t) {
|
|
3804
3823
|
const e = t.prop.props.slot || {}, r = t.prop.scopedSlots || {};
|
|
3805
3824
|
e.open && (r.open = () => e.open), e.close && (r.close = () => e.close), t.prop.scopedSlots = r;
|
|
3806
3825
|
}
|
|
3807
|
-
},
|
|
3826
|
+
}, Ur = {
|
|
3808
3827
|
name: "FcRow",
|
|
3809
3828
|
render(t, e) {
|
|
3810
3829
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
3811
3830
|
e.vNode.row(e.prop, t)
|
|
3812
3831
|
]);
|
|
3813
3832
|
}
|
|
3814
|
-
},
|
|
3833
|
+
}, qr = [
|
|
3834
|
+
Tr,
|
|
3835
|
+
Br,
|
|
3836
|
+
Lr,
|
|
3815
3837
|
Nr,
|
|
3816
3838
|
Mr,
|
|
3817
|
-
Ur
|
|
3818
|
-
|
|
3819
|
-
Hr,
|
|
3820
|
-
Jr
|
|
3821
|
-
], Wr = {
|
|
3839
|
+
Ur
|
|
3840
|
+
], Hr = {
|
|
3822
3841
|
button: "iButton",
|
|
3823
3842
|
icon: "Icon",
|
|
3824
3843
|
slider: "Slider",
|
|
@@ -3844,21 +3863,21 @@ const He = "datePicker", Nr = {
|
|
|
3844
3863
|
group: "fcGroup",
|
|
3845
3864
|
subForm: "fcSubForm",
|
|
3846
3865
|
object: "fcSubForm"
|
|
3847
|
-
},
|
|
3866
|
+
}, Z = {
|
|
3848
3867
|
resetBtnType: "default",
|
|
3849
3868
|
resetBtnIcon: "md-refresh",
|
|
3850
3869
|
infoIcon: "ios-information-circle-outline"
|
|
3851
3870
|
};
|
|
3852
|
-
function
|
|
3871
|
+
function Jr() {
|
|
3853
3872
|
return {
|
|
3854
3873
|
type: "poptip",
|
|
3855
3874
|
trigger: "hover",
|
|
3856
3875
|
placement: "top-start",
|
|
3857
3876
|
wordWrap: !0,
|
|
3858
|
-
icon:
|
|
3877
|
+
icon: Z.infoIcon
|
|
3859
3878
|
};
|
|
3860
3879
|
}
|
|
3861
|
-
function
|
|
3880
|
+
function zr() {
|
|
3862
3881
|
return {
|
|
3863
3882
|
form: {
|
|
3864
3883
|
inline: !1,
|
|
@@ -3880,9 +3899,9 @@ function Gr() {
|
|
|
3880
3899
|
click: void 0
|
|
3881
3900
|
},
|
|
3882
3901
|
resetBtn: {
|
|
3883
|
-
type:
|
|
3902
|
+
type: Z.resetBtnType,
|
|
3884
3903
|
disabled: !1,
|
|
3885
|
-
icon:
|
|
3904
|
+
icon: Z.resetBtnIcon,
|
|
3886
3905
|
innerText: "重置",
|
|
3887
3906
|
loading: !1,
|
|
3888
3907
|
show: !1,
|
|
@@ -3890,16 +3909,16 @@ function Gr() {
|
|
|
3890
3909
|
}
|
|
3891
3910
|
};
|
|
3892
3911
|
}
|
|
3893
|
-
function
|
|
3894
|
-
k(t, e) &&
|
|
3912
|
+
function He(t, e) {
|
|
3913
|
+
k(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
3895
3914
|
}
|
|
3896
3915
|
function V(t) {
|
|
3897
3916
|
return t === !1;
|
|
3898
3917
|
}
|
|
3899
|
-
function
|
|
3900
|
-
k(t, e) && !
|
|
3918
|
+
function Wr(t, e) {
|
|
3919
|
+
k(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
3901
3920
|
}
|
|
3902
|
-
const
|
|
3921
|
+
const Gr = {
|
|
3903
3922
|
validate() {
|
|
3904
3923
|
const t = this.form();
|
|
3905
3924
|
return t ? new Promise((e, r) => {
|
|
@@ -3922,11 +3941,11 @@ const Xr = {
|
|
|
3922
3941
|
},
|
|
3923
3942
|
tidyOptions(t) {
|
|
3924
3943
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
3925
|
-
|
|
3944
|
+
Wr(t, e);
|
|
3926
3945
|
}), t;
|
|
3927
3946
|
},
|
|
3928
3947
|
tidyRule({ prop: t }) {
|
|
3929
|
-
return
|
|
3948
|
+
return He(t, "title"), He(t, "info"), t;
|
|
3930
3949
|
},
|
|
3931
3950
|
mergeProp(t) {
|
|
3932
3951
|
t.prop = D([{
|
|
@@ -3935,7 +3954,7 @@ const Xr = {
|
|
|
3935
3954
|
col: this.options.col || {},
|
|
3936
3955
|
title: this.options.title || {}
|
|
3937
3956
|
}, t.prop], {
|
|
3938
|
-
info:
|
|
3957
|
+
info: Jr(),
|
|
3939
3958
|
title: {},
|
|
3940
3959
|
col: { span: 24 },
|
|
3941
3960
|
wrap: {}
|
|
@@ -3945,7 +3964,7 @@ const Xr = {
|
|
|
3945
3964
|
!t.size && this.options.form.size && (t.size = this.options.form.size);
|
|
3946
3965
|
},
|
|
3947
3966
|
getDefaultOptions() {
|
|
3948
|
-
return
|
|
3967
|
+
return zr();
|
|
3949
3968
|
},
|
|
3950
3969
|
update() {
|
|
3951
3970
|
const t = this.options.form;
|
|
@@ -4003,7 +4022,7 @@ const Xr = {
|
|
|
4003
4022
|
s.info && !k(a.props, u) && (a.props[u] = s.info), o[s.align !== "left" ? "unshift" : "push"](this.$r(D([s, a]), [
|
|
4004
4023
|
this.$r({
|
|
4005
4024
|
type: "icon",
|
|
4006
|
-
props: { type: s.icon === !0 ?
|
|
4025
|
+
props: { type: s.icon === !0 ? Z.infoIcon : s.icon, size: 16 },
|
|
4007
4026
|
style: "margin-top: -1px",
|
|
4008
4027
|
key: `${e}i`
|
|
4009
4028
|
})
|
|
@@ -4078,13 +4097,13 @@ const Xr = {
|
|
|
4078
4097
|
key: `${this.key}b1`
|
|
4079
4098
|
}, [t.innerText]);
|
|
4080
4099
|
}
|
|
4081
|
-
}, L = {},
|
|
4082
|
-
function
|
|
4083
|
-
|
|
4100
|
+
}, L = {}, Kr = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4101
|
+
function xr(t) {
|
|
4102
|
+
Kr.forEach((e) => {
|
|
4084
4103
|
t[e] = F(e);
|
|
4085
4104
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4086
4105
|
}
|
|
4087
|
-
function
|
|
4106
|
+
function Xr(t) {
|
|
4088
4107
|
const e = "upload", r = {
|
|
4089
4108
|
image: ["image", 0],
|
|
4090
4109
|
file: ["file", 0],
|
|
@@ -4093,19 +4112,19 @@ function Yr(t) {
|
|
|
4093
4112
|
};
|
|
4094
4113
|
Object.keys(r).reduce((i, s) => (i[s] = F(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4095
4114
|
}
|
|
4096
|
-
function
|
|
4115
|
+
function Qr(t) {
|
|
4097
4116
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4098
4117
|
Object.keys(r).reduce((i, s) => (i[s] = F(e, { type: r[s] }), i), t);
|
|
4099
4118
|
}
|
|
4100
|
-
function
|
|
4119
|
+
function Zr(t) {
|
|
4101
4120
|
const e = "timePicker";
|
|
4102
4121
|
t.time = F(e, { type: "time" }), t.timeRange = F(e, { type: "timerange" });
|
|
4103
4122
|
}
|
|
4104
|
-
function
|
|
4123
|
+
function Yr(t) {
|
|
4105
4124
|
const e = "select";
|
|
4106
4125
|
t.selectMultiple = F(e, { multiple: !0 }), t.selectOne = F(e, { multiple: !1 });
|
|
4107
4126
|
}
|
|
4108
|
-
function
|
|
4127
|
+
function ei(t) {
|
|
4109
4128
|
const e = "frame", r = {
|
|
4110
4129
|
frameInputs: ["input", 0],
|
|
4111
4130
|
frameFiles: ["file", 0],
|
|
@@ -4116,16 +4135,16 @@ function ii(t) {
|
|
|
4116
4135
|
};
|
|
4117
4136
|
Object.keys(r).reduce((i, s) => (i[s] = F(e, (n) => n.props({ type: r[s][0], maxLength: r[s][1] })), i), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages;
|
|
4118
4137
|
}
|
|
4119
|
-
|
|
4138
|
+
xr(L);
|
|
4139
|
+
Xr(L);
|
|
4140
|
+
Qr(L);
|
|
4120
4141
|
Yr(L);
|
|
4121
4142
|
ei(L);
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
function We(t, e) {
|
|
4126
|
-
return f.Boolean(t) ? t = { show: t } : !f.Undef(t) && !f.Object(t) && (t = { show: e }), t;
|
|
4143
|
+
Zr(L);
|
|
4144
|
+
function Je(t, e) {
|
|
4145
|
+
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4127
4146
|
}
|
|
4128
|
-
function
|
|
4147
|
+
function ti(t, e) {
|
|
4129
4148
|
return p(t, {
|
|
4130
4149
|
formEl() {
|
|
4131
4150
|
return e.$manager.form();
|
|
@@ -4199,41 +4218,41 @@ function ni(t, e) {
|
|
|
4199
4218
|
}
|
|
4200
4219
|
},
|
|
4201
4220
|
submitBtnProps: (r = {}) => {
|
|
4202
|
-
let i =
|
|
4221
|
+
let i = Je(e.options.submitBtn, !0);
|
|
4203
4222
|
p(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4204
4223
|
},
|
|
4205
4224
|
resetBtnProps: (r = {}) => {
|
|
4206
|
-
let i =
|
|
4225
|
+
let i = Je(e.options.resetBtn, !1);
|
|
4207
4226
|
p(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4208
4227
|
},
|
|
4209
4228
|
submit(r, i) {
|
|
4210
4229
|
t.validate((s) => {
|
|
4211
4230
|
if (s) {
|
|
4212
4231
|
let n = t.formData();
|
|
4213
|
-
|
|
4232
|
+
h.Function(r) ? E(() => r(n, this)) : (h.Function(e.options.onSubmit) && E(() => e.options.onSubmit(n, this)), e.vm.$emit("submit", n, this));
|
|
4214
4233
|
} else
|
|
4215
|
-
|
|
4234
|
+
h.Function(i) && E(() => i(this, ...arguments));
|
|
4216
4235
|
}).catch((s) => {
|
|
4217
4236
|
});
|
|
4218
4237
|
}
|
|
4219
4238
|
}), t;
|
|
4220
4239
|
}
|
|
4221
|
-
function
|
|
4222
|
-
t.componentAlias(
|
|
4240
|
+
function ri(t) {
|
|
4241
|
+
t.componentAlias(Hr), Jt.forEach((e) => {
|
|
4223
4242
|
t.component(e.name, e);
|
|
4224
|
-
}),
|
|
4243
|
+
}), qr.forEach((e) => {
|
|
4225
4244
|
t.parser(e);
|
|
4226
4245
|
}), Object.keys(L).forEach((e) => {
|
|
4227
4246
|
t.maker[e] = L[e];
|
|
4228
4247
|
});
|
|
4229
4248
|
}
|
|
4230
|
-
function
|
|
4231
|
-
return
|
|
4249
|
+
function ii() {
|
|
4250
|
+
return ht({
|
|
4232
4251
|
ui: "view-design",
|
|
4233
|
-
version: "2.6.
|
|
4234
|
-
manager:
|
|
4235
|
-
install:
|
|
4236
|
-
extendApi:
|
|
4252
|
+
version: "2.6.3",
|
|
4253
|
+
manager: Gr,
|
|
4254
|
+
install: ri,
|
|
4255
|
+
extendApi: ti,
|
|
4237
4256
|
attrs: {
|
|
4238
4257
|
normal: ["col", "wrap"],
|
|
4239
4258
|
array: ["className"],
|
|
@@ -4241,10 +4260,10 @@ function oi() {
|
|
|
4241
4260
|
}
|
|
4242
4261
|
});
|
|
4243
4262
|
}
|
|
4244
|
-
const
|
|
4245
|
-
typeof window != "undefined" && (window.formCreate =
|
|
4246
|
-
const
|
|
4263
|
+
const de = ii();
|
|
4264
|
+
typeof window != "undefined" && (window.formCreate = de, window.Vue && de.install(window.Vue));
|
|
4265
|
+
const oi = de.maker;
|
|
4247
4266
|
export {
|
|
4248
|
-
|
|
4249
|
-
|
|
4267
|
+
de as default,
|
|
4268
|
+
oi as maker
|
|
4250
4269
|
};
|