@form-create/element-ui 2.7.2 → 2.7.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 +882 -836
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
package/dist/form-create.esm.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/element-ui v2.7.
|
|
3
|
+
* @form-create/element-ui v2.7.3
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
7
7
|
* Released under the MIT License.
|
|
8
8
|
*/
|
|
9
9
|
(function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode('._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame .fc-files:hover .fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame .fc-upload-btn,.fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-upload .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-upload .fc-files:hover .fc-upload-cover{opacity:1}._fc-upload .fc-upload-btn,._fc-upload .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px #0000001a;margin-right:4px;-webkit-box-sizing:border-box;box-sizing:border-box}._fc-group{display:flex;min-height:42px;justify-content:center;flex-direction:column}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;padding:20px 20px 25px;margin:5px 5px 25px;border-radius:5px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}.form-create .form-create .el-form-item{margin-bottom:22px}.form-create{width:100%}.fc-form-row{box-sizing:border-box;display:flex;flex-wrap:wrap;position:relative}.form-create.is-preview .fc-clock,.form-create .fc-none,.form-create.is-preview .el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before,.form-create.is-preview .el-form-item.is-required>.el-form-item__label:before{display:none!important}.fc-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.fc-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.fc-wrap-top.el-form-item{display:block}.fc-wrap-top.el-form-item>.el-form-item__label{display:block;height:auto;line-height:22px;margin-bottom:8px;text-align:left}.fc-wrap-top.el-form-item>.el-form-item__content{margin-left:0!important}.el-form--large .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .fc-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.fc-form-footer{margin-top:12px}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var tr = Object.defineProperty, rr = Object.defineProperties;
|
|
11
|
+
var ir = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var ot = Object.getOwnPropertySymbols;
|
|
13
|
-
var
|
|
14
|
-
var at = (t, e, r) => e in t ?
|
|
13
|
+
var nr = Object.prototype.hasOwnProperty, sr = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, b = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
|
-
|
|
16
|
+
nr.call(e, r) && at(t, r, e[r]);
|
|
17
17
|
if (ot)
|
|
18
18
|
for (var r of ot(e))
|
|
19
|
-
|
|
19
|
+
sr.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
}, q = (t, e) =>
|
|
22
|
-
import
|
|
23
|
-
function
|
|
21
|
+
}, q = (t, e) => rr(t, ir(e));
|
|
22
|
+
import ge, { getCurrentInstance as or, provide as ar, inject as lr, toRefs as lt, reactive as ie, onBeforeMount as ur, watch as L, onMounted as fr, onBeforeUnmount as cr, onUpdated as hr, nextTick as T, markRaw as pe, computed as me, toRef as De, ref as dr } from "vue";
|
|
23
|
+
function pr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
26
26
|
function He() {
|
|
@@ -29,33 +29,33 @@ function He() {
|
|
|
29
29
|
return t;
|
|
30
30
|
}, He.apply(this, arguments);
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var mr = ["attrs", "props", "domProps"], gr = ["class", "style", "directives"], yr = ["on", "nativeOn"], $r = 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 (mr.indexOf(i) !== -1) e[i] = He({}, e[i], r[i]);
|
|
36
|
+
else if (gr.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 (yr.indexOf(i) !== -1)
|
|
40
40
|
for (var o in r[i]) if (e[i][o]) {
|
|
41
41
|
var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], l = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
|
|
42
42
|
e[i][o] = [].concat(a, l);
|
|
43
43
|
} else e[i][o] = r[i][o];
|
|
44
|
-
else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ?
|
|
44
|
+
else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ? vr(e[i][u], r[i][u]) : r[i][u];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, vr = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const V = /* @__PURE__ */
|
|
52
|
+
}, br = $r;
|
|
53
|
+
const V = /* @__PURE__ */ pr(br);
|
|
54
54
|
function Qe(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => (r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const _r = "fcCheckbox", Cr = {
|
|
58
|
+
name: _r,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -123,11 +123,11 @@ const br = "fcCheckbox", _r = {
|
|
|
123
123
|
this.$emit("fc.el", this.$refs.el);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function H(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
name:
|
|
129
|
+
const wr = "fcFrame", Or = {
|
|
130
|
+
name: wr,
|
|
131
131
|
props: {
|
|
132
132
|
formCreateInject: {
|
|
133
133
|
type: Object,
|
|
@@ -248,7 +248,7 @@ const Cr = "fcFrame", wr = {
|
|
|
248
248
|
},
|
|
249
249
|
data() {
|
|
250
250
|
return {
|
|
251
|
-
fileList:
|
|
251
|
+
fileList: H(this.value),
|
|
252
252
|
previewVisible: !1,
|
|
253
253
|
frameVisible: !1,
|
|
254
254
|
previewImage: ""
|
|
@@ -256,7 +256,7 @@ const Cr = "fcFrame", wr = {
|
|
|
256
256
|
},
|
|
257
257
|
watch: {
|
|
258
258
|
value(t) {
|
|
259
|
-
this.fileList =
|
|
259
|
+
this.fileList = H(t);
|
|
260
260
|
},
|
|
261
261
|
fileList(t) {
|
|
262
262
|
const e = this.maxLength === 1 ? t[0] || "" : t;
|
|
@@ -496,8 +496,8 @@ const Cr = "fcFrame", wr = {
|
|
|
496
496
|
mounted() {
|
|
497
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
498
498
|
}
|
|
499
|
-
},
|
|
500
|
-
name:
|
|
499
|
+
}, Fr = "fcRadio", Rr = {
|
|
500
|
+
name: Fr,
|
|
501
501
|
props: {
|
|
502
502
|
formCreateInject: {
|
|
503
503
|
type: Object,
|
|
@@ -591,11 +591,11 @@ const Cr = "fcFrame", wr = {
|
|
|
591
591
|
return h.type(e, t);
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
|
-
function
|
|
594
|
+
function S(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
name:
|
|
597
|
+
const Er = "fcSelect", Sr = {
|
|
598
|
+
name: Er,
|
|
599
599
|
functional: !0,
|
|
600
600
|
props: {
|
|
601
601
|
formCreateInject: {
|
|
@@ -621,13 +621,13 @@ const kr = "fcSelect", Er = {
|
|
|
621
621
|
}, [h.trueArray(n.options) && n.options.map((a, l) => r(a, l))]), s = e.props.formCreateInject.options;
|
|
622
622
|
return t("ElSelect", V([{}, e.data, {
|
|
623
623
|
ref: "el"
|
|
624
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
624
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => S(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
625
625
|
},
|
|
626
626
|
mounted() {
|
|
627
627
|
this.$emit("fc.el", this.$refs.el);
|
|
628
628
|
}
|
|
629
|
-
},
|
|
630
|
-
name:
|
|
629
|
+
}, kr = "fcTree", Dr = {
|
|
630
|
+
name: kr,
|
|
631
631
|
formCreateParser: {
|
|
632
632
|
mergeProp(t) {
|
|
633
633
|
const e = t.prop.props;
|
|
@@ -666,7 +666,7 @@ const kr = "fcSelect", Er = {
|
|
|
666
666
|
t === "selected" ? e = this.$refs.tree.getCurrentKey() : e = this.$refs.tree.getCheckedKeys(), this.$emit("input", e);
|
|
667
667
|
},
|
|
668
668
|
setValue() {
|
|
669
|
-
this.type.toLocaleLowerCase() === "selected" ? this.$refs.tree.setCurrentKey(this.value) : this.$refs.tree.setCheckedKeys(
|
|
669
|
+
this.type.toLocaleLowerCase() === "selected" ? this.$refs.tree.setCurrentKey(this.value) : this.$refs.tree.setCheckedKeys(H(this.value));
|
|
670
670
|
}
|
|
671
671
|
},
|
|
672
672
|
render() {
|
|
@@ -687,21 +687,21 @@ function ut(t, e) {
|
|
|
687
687
|
return typeof t == "object" ? t : {
|
|
688
688
|
url: t,
|
|
689
689
|
is_string: !0,
|
|
690
|
-
name:
|
|
690
|
+
name: jr(t),
|
|
691
691
|
uid: e
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function ft(t) {
|
|
695
695
|
return q(b({}, t), {
|
|
696
696
|
file: t,
|
|
697
697
|
value: t
|
|
698
698
|
});
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function jr(t) {
|
|
701
701
|
return ("" + t).split("/").pop();
|
|
702
702
|
}
|
|
703
|
-
const
|
|
704
|
-
name:
|
|
703
|
+
const Ar = "fcUpload", Vr = {
|
|
704
|
+
name: Ar,
|
|
705
705
|
props: {
|
|
706
706
|
formCreateInject: {
|
|
707
707
|
type: Object,
|
|
@@ -749,11 +749,11 @@ const jr = "fcUpload", Ar = {
|
|
|
749
749
|
};
|
|
750
750
|
},
|
|
751
751
|
created() {
|
|
752
|
-
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList =
|
|
752
|
+
this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(ut).map(ft);
|
|
753
753
|
},
|
|
754
754
|
watch: {
|
|
755
755
|
value(t) {
|
|
756
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles =
|
|
756
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(ft), this.uploadList = this.$refs.upload.uploadFiles);
|
|
757
757
|
},
|
|
758
758
|
limit(t, e) {
|
|
759
759
|
(e === 1 || t === 1) && this.update();
|
|
@@ -911,13 +911,13 @@ const jr = "fcUpload", Ar = {
|
|
|
911
911
|
}), this.$emit("fc.el", this.$refs.upload);
|
|
912
912
|
}
|
|
913
913
|
};
|
|
914
|
-
function
|
|
915
|
-
|
|
914
|
+
function R(t, e, r) {
|
|
915
|
+
ge.set(t, e, r);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
(
|
|
917
|
+
function re(t, e) {
|
|
918
|
+
(ge.del || ge.delete)(t, e);
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function ve(t, e = {}, r) {
|
|
921
921
|
let i = !1;
|
|
922
922
|
for (let s in e)
|
|
923
923
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
@@ -925,39 +925,39 @@ function $e(t, e = {}, r) {
|
|
|
925
925
|
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
926
926
|
let o = t[s] === void 0;
|
|
927
927
|
if (i)
|
|
928
|
-
i = !1, o &&
|
|
928
|
+
i = !1, o && R(t, s, []);
|
|
929
929
|
else if (n._clone && r !== void 0)
|
|
930
930
|
if (r)
|
|
931
|
-
n = n.getRule(), o &&
|
|
931
|
+
n = n.getRule(), o && R(t, s, {});
|
|
932
932
|
else {
|
|
933
|
-
|
|
933
|
+
R(t, s, n._clone());
|
|
934
934
|
continue;
|
|
935
935
|
}
|
|
936
936
|
else
|
|
937
|
-
o &&
|
|
938
|
-
t[s] =
|
|
937
|
+
o && R(t, s, {});
|
|
938
|
+
t[s] = ve(t[s], n, r);
|
|
939
939
|
} else
|
|
940
|
-
|
|
940
|
+
R(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
941
941
|
}
|
|
942
942
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
943
943
|
}
|
|
944
944
|
function W(t) {
|
|
945
|
-
return
|
|
945
|
+
return ve({}, { value: t }).value;
|
|
946
946
|
}
|
|
947
|
-
const
|
|
947
|
+
const Ir = Object.assign || function(t) {
|
|
948
948
|
for (let e, r = 1; r < arguments.length; r++)
|
|
949
949
|
for (let i in e = arguments[r], e)
|
|
950
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
950
|
+
Object.prototype.hasOwnProperty.call(e, i) && R(t, i, e[i]);
|
|
951
951
|
return t;
|
|
952
952
|
};
|
|
953
953
|
function _() {
|
|
954
|
-
return
|
|
954
|
+
return Ir.apply(this, arguments);
|
|
955
955
|
}
|
|
956
956
|
function Ge(t) {
|
|
957
957
|
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : b({}, t);
|
|
958
958
|
}
|
|
959
|
-
const
|
|
960
|
-
name:
|
|
959
|
+
const Pr = "fcGroup", Tr = {
|
|
960
|
+
name: Pr,
|
|
961
961
|
props: {
|
|
962
962
|
field: String,
|
|
963
963
|
rule: [Array, Object],
|
|
@@ -1038,7 +1038,7 @@ const Ir = "fcGroup", Pr = {
|
|
|
1038
1038
|
const s = i.$f.formData();
|
|
1039
1039
|
if (t === e)
|
|
1040
1040
|
i.$f.deferSyncValue(() => {
|
|
1041
|
-
|
|
1041
|
+
ve(i.rule, t), i.$f.setValue(s);
|
|
1042
1042
|
}, !0);
|
|
1043
1043
|
else {
|
|
1044
1044
|
const n = i.$f.formData();
|
|
@@ -1078,7 +1078,7 @@ const Ir = "fcGroup", Pr = {
|
|
|
1078
1078
|
},
|
|
1079
1079
|
methods: {
|
|
1080
1080
|
_value(t) {
|
|
1081
|
-
return t &&
|
|
1081
|
+
return t && S(t, this.field) ? t[this.field] : t;
|
|
1082
1082
|
},
|
|
1083
1083
|
cache(t, e) {
|
|
1084
1084
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1224,7 +1224,7 @@ const Ir = "fcGroup", Pr = {
|
|
|
1224
1224
|
const {
|
|
1225
1225
|
rule: l,
|
|
1226
1226
|
options: u
|
|
1227
|
-
} = this.cacheRule[o],
|
|
1227
|
+
} = this.cacheRule[o], f = r && !s ? this.makeIcon(e.length, a, o) : [];
|
|
1228
1228
|
return t("div", {
|
|
1229
1229
|
class: "_fc-group-container",
|
|
1230
1230
|
key: o
|
|
@@ -1232,9 +1232,9 @@ const Ir = "fcGroup", Pr = {
|
|
|
1232
1232
|
key: o
|
|
1233
1233
|
}, {
|
|
1234
1234
|
on: {
|
|
1235
|
-
"update:value": (
|
|
1236
|
-
"emit-event": (
|
|
1237
|
-
input: (
|
|
1235
|
+
"update:value": (d) => this.formData(o, d),
|
|
1236
|
+
"emit-event": (d, ...g) => this.emitEvent(d, g, a, o),
|
|
1237
|
+
input: (d) => this.add$f(a, o, d)
|
|
1238
1238
|
}
|
|
1239
1239
|
}, {}, {
|
|
1240
1240
|
props: {
|
|
@@ -1249,17 +1249,17 @@ const Ir = "fcGroup", Pr = {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
}])), t("div", {
|
|
1251
1251
|
class: "_fc-group-idx"
|
|
1252
|
-
}, [a + 1]),
|
|
1252
|
+
}, [a + 1]), f.length ? t("div", {
|
|
1253
1253
|
class: "_fc-group-handle fc-clock"
|
|
1254
|
-
}, [
|
|
1254
|
+
}, [f]) : null]);
|
|
1255
1255
|
});
|
|
1256
1256
|
return t("div", {
|
|
1257
1257
|
key: "con",
|
|
1258
1258
|
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1259
1259
|
}, [n]);
|
|
1260
1260
|
}
|
|
1261
|
-
},
|
|
1262
|
-
name:
|
|
1261
|
+
}, Br = "fcSubForm", Lr = {
|
|
1262
|
+
name: Br,
|
|
1263
1263
|
props: {
|
|
1264
1264
|
rule: Array,
|
|
1265
1265
|
options: Object,
|
|
@@ -1342,35 +1342,35 @@ const Ir = "fcGroup", Pr = {
|
|
|
1342
1342
|
}
|
|
1343
1343
|
}]));
|
|
1344
1344
|
}
|
|
1345
|
-
},
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
Er,
|
|
1345
|
+
}, Mr = [
|
|
1346
|
+
Cr,
|
|
1347
|
+
Or,
|
|
1348
|
+
Rr,
|
|
1350
1349
|
Sr,
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1350
|
+
Dr,
|
|
1351
|
+
Vr,
|
|
1352
|
+
Tr,
|
|
1353
|
+
Lr
|
|
1354
1354
|
];
|
|
1355
|
-
function
|
|
1355
|
+
function ce(t, e) {
|
|
1356
1356
|
var r = null;
|
|
1357
1357
|
return function(...i) {
|
|
1358
1358
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1359
1359
|
};
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1361
|
+
function $e(t) {
|
|
1362
1362
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1363
1363
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1364
1364
|
}
|
|
1365
|
-
const
|
|
1365
|
+
const Se = (t, e) => {
|
|
1366
1366
|
if (!(!t || t === e || !t.$props)) {
|
|
1367
1367
|
if (t.$props.formCreateInject)
|
|
1368
1368
|
return t.$props.formCreateInject;
|
|
1369
1369
|
if (t.$parent)
|
|
1370
|
-
return
|
|
1370
|
+
return Se(t.$parent, e);
|
|
1371
1371
|
}
|
|
1372
1372
|
};
|
|
1373
|
-
function
|
|
1373
|
+
function Nr(t, e, r) {
|
|
1374
1374
|
const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
|
|
1375
1375
|
return {
|
|
1376
1376
|
name: i,
|
|
@@ -1421,100 +1421,100 @@ function Mr(t, e, r) {
|
|
|
1421
1421
|
return this.fc.render();
|
|
1422
1422
|
},
|
|
1423
1423
|
setup(s) {
|
|
1424
|
-
const n =
|
|
1425
|
-
|
|
1426
|
-
const o =
|
|
1424
|
+
const n = or().proxy;
|
|
1425
|
+
ar("parentFC", n);
|
|
1426
|
+
const o = lr("parentFC", null);
|
|
1427
1427
|
let a = o;
|
|
1428
1428
|
if (o)
|
|
1429
1429
|
for (; a.parent; )
|
|
1430
1430
|
a = a.parent;
|
|
1431
1431
|
else
|
|
1432
1432
|
a = n;
|
|
1433
|
-
const { rule: l, value: u, subForm:
|
|
1433
|
+
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), g = ie({
|
|
1434
1434
|
ctxInject: {},
|
|
1435
1435
|
destroyed: !1,
|
|
1436
1436
|
isShow: !0,
|
|
1437
1437
|
unique: 1,
|
|
1438
1438
|
renderRule: [...l.value || []],
|
|
1439
1439
|
updateValue: JSON.stringify(u.value || {})
|
|
1440
|
-
}),
|
|
1440
|
+
}), m = new t(n), v = m.api(), w = d.value, j = () => {
|
|
1441
1441
|
if (o) {
|
|
1442
|
-
const
|
|
1443
|
-
if (
|
|
1444
|
-
let
|
|
1445
|
-
w ? (
|
|
1442
|
+
const F = Se(n, o);
|
|
1443
|
+
if (F) {
|
|
1444
|
+
let D;
|
|
1445
|
+
w ? (D = H(F.getSubForm()), D.push(v)) : D = v, F.subForm(D);
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
},
|
|
1449
|
-
const
|
|
1450
|
-
if (
|
|
1448
|
+
}, ee = () => {
|
|
1449
|
+
const F = Se(n, o);
|
|
1450
|
+
if (F)
|
|
1451
1451
|
if (w) {
|
|
1452
|
-
const
|
|
1453
|
-
B > -1 &&
|
|
1452
|
+
const D = H(F.getSubForm()), B = D.indexOf(v);
|
|
1453
|
+
B > -1 && D.splice(B, 1);
|
|
1454
1454
|
} else
|
|
1455
|
-
|
|
1455
|
+
F.subForm();
|
|
1456
1456
|
};
|
|
1457
1457
|
let P = null;
|
|
1458
|
-
|
|
1458
|
+
ur(() => {
|
|
1459
1459
|
L(() => {
|
|
1460
|
-
let
|
|
1461
|
-
const
|
|
1462
|
-
Object.keys(
|
|
1463
|
-
let
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
}),
|
|
1467
|
-
}), s.option && s.option.style && (
|
|
1460
|
+
let F = "";
|
|
1461
|
+
const D = s.option && s.option.globalClass || {};
|
|
1462
|
+
Object.keys(D).forEach((B) => {
|
|
1463
|
+
let se = "";
|
|
1464
|
+
D[B].style && Object.keys(D[B].style).forEach((_e) => {
|
|
1465
|
+
se += $e(_e) + ":" + D[B].style[_e] + ";";
|
|
1466
|
+
}), D[B].content && (se += D[B].content + ";"), se && (F += `.${B}{${se}}`);
|
|
1467
|
+
}), s.option && s.option.style && (F += s.option.style), P || (P = document.createElement("style"), P.type = "text/css", document.head.appendChild(P)), P.innerHTML = F || "";
|
|
1468
1468
|
}, () => {
|
|
1469
1469
|
});
|
|
1470
1470
|
});
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
}, 100),
|
|
1474
|
-
|
|
1475
|
-
}, 100),
|
|
1476
|
-
|
|
1471
|
+
const N = ce(() => {
|
|
1472
|
+
m.bus.$emit("$loadData.$topForm");
|
|
1473
|
+
}, 100), Ae = ce(() => {
|
|
1474
|
+
m.bus.$emit("$loadData.$form");
|
|
1475
|
+
}, 100), be = (F) => {
|
|
1476
|
+
m.bus.$emit("change-$form." + F);
|
|
1477
1477
|
};
|
|
1478
|
-
return
|
|
1479
|
-
o && (v.top.bus.$on("$loadData.$form",
|
|
1478
|
+
return fr(() => {
|
|
1479
|
+
o && (v.top.bus.$on("$loadData.$form", N), v.top.bus.$on("change", be)), m.mounted();
|
|
1480
1480
|
}), cr(() => {
|
|
1481
|
-
o && (v.top.bus.$off("$loadData.$form",
|
|
1482
|
-
}),
|
|
1483
|
-
|
|
1484
|
-
}), L(
|
|
1485
|
-
|
|
1486
|
-
}, { immediate: !0 }), L(() => [...l.value], (
|
|
1487
|
-
|
|
1481
|
+
o && (v.top.bus.$off("$loadData.$form", N), v.top.bus.$off("change", be)), P && document.head.removeChild(P), ee(), g.destroyed = !0, m.unmount();
|
|
1482
|
+
}), hr(() => {
|
|
1483
|
+
m.updated();
|
|
1484
|
+
}), L(f, (F) => {
|
|
1485
|
+
F ? j() : ee();
|
|
1486
|
+
}, { immediate: !0 }), L(() => [...l.value], (F) => {
|
|
1487
|
+
m.$handle.isBreakWatch() || F.length === g.renderRule.length && F.every((D) => g.renderRule.indexOf(D) > -1) || (m.$handle.updateAppendData(), m.$handle.reloadRule(l.value), n.renderRule());
|
|
1488
1488
|
}), L(() => s.option, () => {
|
|
1489
|
-
|
|
1489
|
+
m.initOptions(), v.refresh();
|
|
1490
1490
|
}, { deep: !0 }), L(() => [s.disabled, s.preview], () => {
|
|
1491
1491
|
v.refresh();
|
|
1492
|
-
}), L(u, (
|
|
1493
|
-
JSON.stringify(
|
|
1492
|
+
}), L(u, (F) => {
|
|
1493
|
+
JSON.stringify(F || {}) !== g.updateValue && (v.config.forceCoverValue ? v.coverValue(F || {}) : v.setValue(F || {}));
|
|
1494
1494
|
}, { deep: !0, flush: "post" }), L(() => s.index, () => {
|
|
1495
|
-
v.coverValue({}),
|
|
1495
|
+
v.coverValue({}), m.$handle.updateAppendData(), T(() => {
|
|
1496
1496
|
T(() => {
|
|
1497
1497
|
v.clearValidateState();
|
|
1498
1498
|
});
|
|
1499
1499
|
});
|
|
1500
1500
|
}, { flush: "sync" }), q(b({
|
|
1501
|
-
fc:
|
|
1502
|
-
parent: o &&
|
|
1503
|
-
top:
|
|
1504
|
-
fapi:
|
|
1505
|
-
}, lt(
|
|
1506
|
-
getGroupInject: () =>
|
|
1501
|
+
fc: pe(m),
|
|
1502
|
+
parent: o && pe(o),
|
|
1503
|
+
top: pe(a),
|
|
1504
|
+
fapi: pe(v)
|
|
1505
|
+
}, lt(g)), {
|
|
1506
|
+
getGroupInject: () => Se(n, o),
|
|
1507
1507
|
refresh() {
|
|
1508
|
-
++
|
|
1508
|
+
++g.unique;
|
|
1509
1509
|
},
|
|
1510
1510
|
renderRule() {
|
|
1511
|
-
|
|
1511
|
+
g.renderRule = [...l.value || []];
|
|
1512
1512
|
},
|
|
1513
|
-
updateValue(
|
|
1514
|
-
if (
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1517
|
-
|
|
1513
|
+
updateValue(F) {
|
|
1514
|
+
if (g.destroyed) return;
|
|
1515
|
+
const D = JSON.stringify(F);
|
|
1516
|
+
g.updateValue !== D && (g.updateValue = D, n.$emit("update:value", F), T(() => {
|
|
1517
|
+
Ae(), o || N();
|
|
1518
1518
|
}));
|
|
1519
1519
|
}
|
|
1520
1520
|
});
|
|
@@ -1524,39 +1524,39 @@ function Mr(t, e, r) {
|
|
|
1524
1524
|
}
|
|
1525
1525
|
};
|
|
1526
1526
|
}
|
|
1527
|
-
const Ft = ["attrs", "props", "domProps", "scopedSlots"],
|
|
1528
|
-
const i = [...Ft, ...r.normal || []], s = [...
|
|
1527
|
+
const Ft = ["attrs", "props", "domProps", "scopedSlots"], Rt = ["class", "style", "directives"], Et = ["on", "nativeOn", "hook"], Y = (t, e = {}, r = {}) => {
|
|
1528
|
+
const i = [...Ft, ...r.normal || []], s = [...Rt, ...r.array || []], n = [...Et, ...r.functional || []], o = r.props || [];
|
|
1529
1529
|
return t.reduce((a, l) => {
|
|
1530
1530
|
for (const u in l)
|
|
1531
1531
|
if (a[u])
|
|
1532
1532
|
if (o.indexOf(u) > -1)
|
|
1533
|
-
a[u] =
|
|
1533
|
+
a[u] = Y([l[u]], a[u]);
|
|
1534
1534
|
else if (i.indexOf(u) > -1)
|
|
1535
1535
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1536
1536
|
else if (s.indexOf(u) > -1) {
|
|
1537
|
-
const
|
|
1538
|
-
a[u] = [...
|
|
1537
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1538
|
+
a[u] = [...f, ...d];
|
|
1539
1539
|
} else if (n.indexOf(u) > -1)
|
|
1540
|
-
for (const
|
|
1541
|
-
if (a[u][
|
|
1542
|
-
const
|
|
1543
|
-
a[u][
|
|
1540
|
+
for (const f in l[u])
|
|
1541
|
+
if (a[u][f]) {
|
|
1542
|
+
const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], g = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1543
|
+
a[u][f] = [...d, ...g];
|
|
1544
1544
|
} else
|
|
1545
|
-
a[u][
|
|
1545
|
+
a[u][f] = l[u][f];
|
|
1546
1546
|
else if (u === "hook")
|
|
1547
|
-
for (let
|
|
1548
|
-
a[u][
|
|
1547
|
+
for (let f in l[u])
|
|
1548
|
+
a[u][f] ? a[u][f] = qr(a[u][f], l[u][f]) : a[u][f] = l[u][f];
|
|
1549
1549
|
else
|
|
1550
1550
|
a[u] = l[u];
|
|
1551
1551
|
else
|
|
1552
1552
|
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = b({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? b({}, l[u]) : l[u] : a[u] = l[u];
|
|
1553
1553
|
return a;
|
|
1554
1554
|
}, e);
|
|
1555
|
-
},
|
|
1555
|
+
}, qr = (t, e) => function() {
|
|
1556
1556
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1557
|
-
},
|
|
1558
|
-
function
|
|
1559
|
-
return [...
|
|
1557
|
+
}, St = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Ze = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1558
|
+
function kt() {
|
|
1559
|
+
return [...St, ...Ft, ...Rt, ...Et, ...Ze, ...Ye];
|
|
1560
1560
|
}
|
|
1561
1561
|
function Dt(t, e, r) {
|
|
1562
1562
|
return `[form-create ${t}]: ${e}`;
|
|
@@ -1564,7 +1564,7 @@ function Dt(t, e, r) {
|
|
|
1564
1564
|
function xe(t, e) {
|
|
1565
1565
|
console.error(Dt("err", t));
|
|
1566
1566
|
}
|
|
1567
|
-
function
|
|
1567
|
+
function Ur(t) {
|
|
1568
1568
|
xe(t.toString()), console.error(t);
|
|
1569
1569
|
}
|
|
1570
1570
|
function jt(t) {
|
|
@@ -1572,7 +1572,7 @@ function jt(t) {
|
|
|
1572
1572
|
}
|
|
1573
1573
|
const Je = "[[FORM-CREATE-PREFIX-", We = "-FORM-CREATE-SUFFIX]]";
|
|
1574
1574
|
function et(t, e) {
|
|
1575
|
-
return JSON.stringify(
|
|
1575
|
+
return JSON.stringify(ve(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1576
1576
|
if (!(i && i._isVue === !0)) {
|
|
1577
1577
|
if (typeof i != "function")
|
|
1578
1578
|
return i;
|
|
@@ -1583,7 +1583,7 @@ function et(t, e) {
|
|
|
1583
1583
|
}
|
|
1584
1584
|
}, e);
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function Te(t) {
|
|
1587
1587
|
return new Function("return " + t)();
|
|
1588
1588
|
}
|
|
1589
1589
|
function K(t, e) {
|
|
@@ -1605,15 +1605,15 @@ function K(t, e) {
|
|
|
1605
1605
|
}, r.__json = t, r.__inject = !0, r;
|
|
1606
1606
|
} else {
|
|
1607
1607
|
if (r.indexOf("$FNX:") === 0)
|
|
1608
|
-
return r =
|
|
1608
|
+
return r = Te("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1609
1609
|
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1610
1610
|
}
|
|
1611
1611
|
if (!i) return t;
|
|
1612
1612
|
let s;
|
|
1613
1613
|
try {
|
|
1614
|
-
s =
|
|
1614
|
+
s = Te(r);
|
|
1615
1615
|
} catch (n) {
|
|
1616
|
-
s =
|
|
1616
|
+
s = Te("function " + r);
|
|
1617
1617
|
}
|
|
1618
1618
|
return s.__json = t, s;
|
|
1619
1619
|
} catch (s) {
|
|
@@ -1630,16 +1630,16 @@ function At(t, e) {
|
|
|
1630
1630
|
return h.Undef(i) || !i.indexOf ? i : K(i, e);
|
|
1631
1631
|
});
|
|
1632
1632
|
}
|
|
1633
|
-
let
|
|
1634
|
-
function
|
|
1635
|
-
const t = 370 + ++
|
|
1633
|
+
let Hr = 0;
|
|
1634
|
+
function je() {
|
|
1635
|
+
const t = 370 + ++Hr;
|
|
1636
1636
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1638
|
+
function ne(t, e, r) {
|
|
1639
1639
|
let i = t, s;
|
|
1640
1640
|
return (e || "").split(".").forEach((n) => {
|
|
1641
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1642
|
-
}),
|
|
1641
|
+
s && ((!i[s] || typeof i[s] != "object") && R(i, s, {}), i = i[s]), s = n;
|
|
1642
|
+
}), R(i, s, r), i;
|
|
1643
1643
|
}
|
|
1644
1644
|
function Ke(t, e) {
|
|
1645
1645
|
return {
|
|
@@ -1653,18 +1653,18 @@ function Vt(t, e) {
|
|
|
1653
1653
|
return It([t], e || !1)[0];
|
|
1654
1654
|
}
|
|
1655
1655
|
function It(t, e) {
|
|
1656
|
-
return
|
|
1656
|
+
return ve([], [...t], e || !1);
|
|
1657
1657
|
}
|
|
1658
|
-
function
|
|
1659
|
-
return
|
|
1658
|
+
function x(t, e) {
|
|
1659
|
+
return Y(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1661
|
+
function ct(t) {
|
|
1662
1662
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1663
1663
|
return e.type || (e.type = "input"), e;
|
|
1664
1664
|
}
|
|
1665
|
-
function
|
|
1665
|
+
function Gr(t, e) {
|
|
1666
1666
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1667
|
-
e[r] && (t[r] =
|
|
1667
|
+
e[r] && (t[r] = x(t[r] || {}, e[r]));
|
|
1668
1668
|
}), t) : e;
|
|
1669
1669
|
}
|
|
1670
1670
|
function Pt(t, e) {
|
|
@@ -1674,26 +1674,26 @@ function Pt(t, e) {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
}, r), {}));
|
|
1676
1676
|
}
|
|
1677
|
-
function
|
|
1677
|
+
function Z(t) {
|
|
1678
1678
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1680
|
+
function O(t, e) {
|
|
1681
1681
|
try {
|
|
1682
1682
|
e = t();
|
|
1683
1683
|
} catch (r) {
|
|
1684
|
-
|
|
1684
|
+
Ur(r);
|
|
1685
1685
|
}
|
|
1686
1686
|
return e;
|
|
1687
1687
|
}
|
|
1688
1688
|
function Xe(t, e) {
|
|
1689
1689
|
let r = null;
|
|
1690
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e &&
|
|
1690
|
+
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e && H(r).forEach((i) => {
|
|
1691
1691
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1692
1692
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
1693
1693
|
});
|
|
1694
1694
|
}), r;
|
|
1695
1695
|
}
|
|
1696
|
-
function
|
|
1696
|
+
function Jr(t, e) {
|
|
1697
1697
|
if (h.Object(t)) {
|
|
1698
1698
|
const r = {};
|
|
1699
1699
|
return Object.keys(t).forEach((i) => {
|
|
@@ -1702,7 +1702,7 @@ function Gr(t, e) {
|
|
|
1702
1702
|
} else
|
|
1703
1703
|
return Xe(t, e);
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1705
|
+
function Fe() {
|
|
1706
1706
|
const t = {}, e = (r) => r || "default";
|
|
1707
1707
|
return {
|
|
1708
1708
|
setSlot(r, i) {
|
|
@@ -1718,7 +1718,7 @@ function Te() {
|
|
|
1718
1718
|
const n = s();
|
|
1719
1719
|
Array.isArray(n) ? i.push(...n) : i.push(n);
|
|
1720
1720
|
} else h.Undef(s) || i.push(s);
|
|
1721
|
-
}),
|
|
1721
|
+
}), Jr(i, r);
|
|
1722
1722
|
},
|
|
1723
1723
|
getSlots() {
|
|
1724
1724
|
let r = [];
|
|
@@ -1738,12 +1738,12 @@ function Te() {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
};
|
|
1740
1740
|
}
|
|
1741
|
-
function
|
|
1741
|
+
function Re(t, e) {
|
|
1742
1742
|
return Object.setPrototypeOf(t, e), t;
|
|
1743
1743
|
}
|
|
1744
|
-
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1744
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
|
|
1745
1745
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1746
|
-
"!=": (t, e) => !
|
|
1746
|
+
"!=": (t, e) => !fe["=="](t, e),
|
|
1747
1747
|
">": (t, e) => t > e,
|
|
1748
1748
|
">=": (t, e) => t >= e,
|
|
1749
1749
|
"<": (t, e) => t < e,
|
|
@@ -1752,13 +1752,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1752
1752
|
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1753
1753
|
},
|
|
1754
1754
|
notOn(t, e) {
|
|
1755
|
-
return !
|
|
1755
|
+
return !fe.on(t, e);
|
|
1756
1756
|
},
|
|
1757
1757
|
in(t, e) {
|
|
1758
1758
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1759
1759
|
},
|
|
1760
1760
|
notIn(t, e) {
|
|
1761
|
-
return !
|
|
1761
|
+
return !fe.in(t, e);
|
|
1762
1762
|
},
|
|
1763
1763
|
between(t, e) {
|
|
1764
1764
|
return t > e[0] && t < e[1];
|
|
@@ -1776,12 +1776,12 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1776
1776
|
return new RegExp(e, "g").test(t);
|
|
1777
1777
|
}
|
|
1778
1778
|
};
|
|
1779
|
-
function
|
|
1779
|
+
function M(t, e) {
|
|
1780
1780
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1781
1781
|
t != null && (t = t[r]);
|
|
1782
1782
|
}), t;
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1784
|
+
function Wr(t) {
|
|
1785
1785
|
const e = /{{\s*(.*?)\s*}}/g;
|
|
1786
1786
|
let r;
|
|
1787
1787
|
const i = {};
|
|
@@ -1821,7 +1821,7 @@ _(tt.prototype, {
|
|
|
1821
1821
|
return this._data;
|
|
1822
1822
|
},
|
|
1823
1823
|
setProp(t, e) {
|
|
1824
|
-
return
|
|
1824
|
+
return R(this._data, t, e), this;
|
|
1825
1825
|
},
|
|
1826
1826
|
_clone() {
|
|
1827
1827
|
const t = new this.constructor();
|
|
@@ -1831,13 +1831,13 @@ _(tt.prototype, {
|
|
|
1831
1831
|
function Bt(t) {
|
|
1832
1832
|
t.forEach((e) => {
|
|
1833
1833
|
tt.prototype[e] = function(r) {
|
|
1834
|
-
return
|
|
1834
|
+
return x(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1835
1835
|
};
|
|
1836
1836
|
});
|
|
1837
1837
|
}
|
|
1838
|
-
Bt(
|
|
1838
|
+
Bt(kt());
|
|
1839
1839
|
const Lt = I("");
|
|
1840
|
-
function
|
|
1840
|
+
function Kr(t, e, r) {
|
|
1841
1841
|
let i = Lt("", e);
|
|
1842
1842
|
return i._data.type = t, i._data.title = r, i;
|
|
1843
1843
|
}
|
|
@@ -1845,15 +1845,15 @@ function pt(t, e, r, i) {
|
|
|
1845
1845
|
let s = Lt("", r);
|
|
1846
1846
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1847
1847
|
}
|
|
1848
|
-
function
|
|
1848
|
+
function Xr() {
|
|
1849
1849
|
return {
|
|
1850
|
-
create:
|
|
1850
|
+
create: Kr,
|
|
1851
1851
|
createTmp: pt,
|
|
1852
1852
|
template: pt,
|
|
1853
1853
|
factory: I
|
|
1854
1854
|
};
|
|
1855
1855
|
}
|
|
1856
|
-
function
|
|
1856
|
+
function zr(t, e, r) {
|
|
1857
1857
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1858
1858
|
return s.status = r.status, s.url = t, s;
|
|
1859
1859
|
}
|
|
@@ -1876,13 +1876,13 @@ function Mt(t) {
|
|
|
1876
1876
|
n.percent = n.total > 0 ? n.loaded / n.total * 100 : 0, t.onProgress(n);
|
|
1877
1877
|
}), t.query) {
|
|
1878
1878
|
const n = new URLSearchParams(t.query).toString();
|
|
1879
|
-
r.includes("?") ? r += `&${n}` : r += `?${n}
|
|
1879
|
+
n && (r.includes("?") ? r += `&${n}` : r += `?${n}`);
|
|
1880
1880
|
}
|
|
1881
1881
|
e.onerror = function(o) {
|
|
1882
1882
|
t.onError(o);
|
|
1883
1883
|
}, e.onload = function() {
|
|
1884
1884
|
if (e.status < 200 || e.status >= 300)
|
|
1885
|
-
return t.onError(
|
|
1885
|
+
return t.onError(zr(r, t, e), mt(e));
|
|
1886
1886
|
t.onSuccess(mt(e));
|
|
1887
1887
|
}, e.open(t.method || "get", r, !0);
|
|
1888
1888
|
let i;
|
|
@@ -1900,7 +1900,7 @@ function gt(t, e, r) {
|
|
|
1900
1900
|
onSuccess(n) {
|
|
1901
1901
|
let o = (l) => l;
|
|
1902
1902
|
const a = K(t.parse);
|
|
1903
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1903
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => M(l, a)), i(o(n, void 0, r));
|
|
1904
1904
|
},
|
|
1905
1905
|
onError(n) {
|
|
1906
1906
|
s(n);
|
|
@@ -1908,17 +1908,17 @@ function gt(t, e, r) {
|
|
|
1908
1908
|
}));
|
|
1909
1909
|
});
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1911
|
+
function ye(t) {
|
|
1912
1912
|
return W(t);
|
|
1913
1913
|
}
|
|
1914
|
-
function
|
|
1914
|
+
function Qr(t) {
|
|
1915
1915
|
function e(n) {
|
|
1916
1916
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1917
1917
|
}
|
|
1918
1918
|
function r(n, o, a) {
|
|
1919
1919
|
e(n).forEach((l) => {
|
|
1920
1920
|
t.getCtxs(l).forEach((u) => {
|
|
1921
|
-
|
|
1921
|
+
R(u.rule, o, a), t.$render.clearCache(u);
|
|
1922
1922
|
});
|
|
1923
1923
|
});
|
|
1924
1924
|
}
|
|
@@ -1976,14 +1976,14 @@ function zr(t) {
|
|
|
1976
1976
|
if (n == null) {
|
|
1977
1977
|
const o = {};
|
|
1978
1978
|
return Object.keys(t.form).forEach((a) => {
|
|
1979
|
-
t.ignoreFields.indexOf(a) === -1 && (o[a] =
|
|
1979
|
+
t.ignoreFields.indexOf(a) === -1 && (o[a] = ye(t.form[a]));
|
|
1980
1980
|
}), o;
|
|
1981
1981
|
} else
|
|
1982
1982
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
1983
1983
|
},
|
|
1984
1984
|
getValue(n) {
|
|
1985
1985
|
const o = t.getFieldCtx(n);
|
|
1986
|
-
return o ?
|
|
1986
|
+
return o ? ye(o.rule.value) : t.options.appendValue !== !1 && S(t.appendData, n) ? ye(t.appendData[n]) : void 0;
|
|
1987
1987
|
},
|
|
1988
1988
|
coverValue(n) {
|
|
1989
1989
|
const o = b({}, n || {});
|
|
@@ -1991,9 +1991,9 @@ function zr(t) {
|
|
|
1991
1991
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
1992
1992
|
const l = t.fieldCtx[a];
|
|
1993
1993
|
if (l) {
|
|
1994
|
-
const u =
|
|
1995
|
-
l.forEach((
|
|
1996
|
-
|
|
1994
|
+
const u = S(n, a);
|
|
1995
|
+
l.forEach((f) => {
|
|
1996
|
+
f.rule.value = u ? n[a] : void 0;
|
|
1997
1997
|
}), delete o[a];
|
|
1998
1998
|
}
|
|
1999
1999
|
}), _(t.appendData, o);
|
|
@@ -2020,7 +2020,7 @@ function zr(t) {
|
|
|
2020
2020
|
}, !0), o ? o.origin : void 0;
|
|
2021
2021
|
},
|
|
2022
2022
|
removeRule(n) {
|
|
2023
|
-
const o = n &&
|
|
2023
|
+
const o = n && Z(n);
|
|
2024
2024
|
if (o)
|
|
2025
2025
|
return o.rm(), o.origin;
|
|
2026
2026
|
},
|
|
@@ -2030,24 +2030,24 @@ function zr(t) {
|
|
|
2030
2030
|
fields: () => t.fields(),
|
|
2031
2031
|
append: (n, o, a) => {
|
|
2032
2032
|
let l = t.sort.length - 1, u;
|
|
2033
|
-
const
|
|
2034
|
-
if (
|
|
2033
|
+
const f = t.getCtx(o);
|
|
2034
|
+
if (f)
|
|
2035
2035
|
if (a) {
|
|
2036
|
-
if (u =
|
|
2037
|
-
l =
|
|
2036
|
+
if (u = f.getPending("children", f.rule.children), !Array.isArray(u)) return;
|
|
2037
|
+
l = f.rule.children.length - 1;
|
|
2038
2038
|
} else
|
|
2039
|
-
l =
|
|
2039
|
+
l = f.root.indexOf(f.origin), u = f.root;
|
|
2040
2040
|
else u = t.rules;
|
|
2041
2041
|
u.splice(l + 1, 0, n);
|
|
2042
2042
|
},
|
|
2043
2043
|
prepend: (n, o, a) => {
|
|
2044
2044
|
let l = 0, u;
|
|
2045
|
-
const
|
|
2046
|
-
if (
|
|
2045
|
+
const f = t.getCtx(o);
|
|
2046
|
+
if (f)
|
|
2047
2047
|
if (a) {
|
|
2048
|
-
if (u =
|
|
2048
|
+
if (u = f.getPending("children", f.rule.children), !Array.isArray(u)) return;
|
|
2049
2049
|
} else
|
|
2050
|
-
l =
|
|
2050
|
+
l = f.root.indexOf(f.origin), u = f.root;
|
|
2051
2051
|
else u = t.rules;
|
|
2052
2052
|
u.splice(l, 0, n);
|
|
2053
2053
|
},
|
|
@@ -2070,7 +2070,7 @@ function zr(t) {
|
|
|
2070
2070
|
disabled(n, o) {
|
|
2071
2071
|
e(o).forEach((a) => {
|
|
2072
2072
|
t.getCtxs(a).forEach((l) => {
|
|
2073
|
-
|
|
2073
|
+
R(l.rule.props, "disabled", !!n);
|
|
2074
2074
|
});
|
|
2075
2075
|
}), t.refresh();
|
|
2076
2076
|
},
|
|
@@ -2109,7 +2109,7 @@ function zr(t) {
|
|
|
2109
2109
|
n.forEach((a) => s.sync(a));
|
|
2110
2110
|
return;
|
|
2111
2111
|
}
|
|
2112
|
-
let o = h.Object(n) ?
|
|
2112
|
+
let o = h.Object(n) ? Z(n) : t.getCtxs(n);
|
|
2113
2113
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2114
2114
|
if (!a.deleted) {
|
|
2115
2115
|
const l = t.subForm[a.id];
|
|
@@ -2128,7 +2128,7 @@ function zr(t) {
|
|
|
2128
2128
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2129
2129
|
},
|
|
2130
2130
|
hideForm: (n) => {
|
|
2131
|
-
|
|
2131
|
+
R(t.vm, "isShow", !n);
|
|
2132
2132
|
},
|
|
2133
2133
|
changeStatus: () => t.changeStatus,
|
|
2134
2134
|
clearChangeStatus: () => {
|
|
@@ -2146,7 +2146,7 @@ function zr(t) {
|
|
|
2146
2146
|
},
|
|
2147
2147
|
mergeRule: (n, o) => {
|
|
2148
2148
|
t.getCtxs(n).forEach((a) => {
|
|
2149
|
-
|
|
2149
|
+
x(a.rule, o);
|
|
2150
2150
|
});
|
|
2151
2151
|
},
|
|
2152
2152
|
mergeRules(n) {
|
|
@@ -2173,7 +2173,7 @@ function zr(t) {
|
|
|
2173
2173
|
},
|
|
2174
2174
|
setEffect(n, o, a) {
|
|
2175
2175
|
const l = t.getCtx(n);
|
|
2176
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2176
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), S(l.rule, "$" + o) && R(l.rule, "$" + o, a), S(l.rule, "effect") || R(l.rule, "effect", {}), R(l.rule.effect, o, a));
|
|
2177
2177
|
},
|
|
2178
2178
|
clearEffectData(n, o) {
|
|
2179
2179
|
const a = t.getCtx(n);
|
|
@@ -2193,7 +2193,7 @@ function zr(t) {
|
|
|
2193
2193
|
resetFields(n) {
|
|
2194
2194
|
e(n).forEach((o) => {
|
|
2195
2195
|
t.getCtxs(o).forEach((a) => {
|
|
2196
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2196
|
+
t.$render.clearCache(a), a.rule.value = ye(a.defaultValue);
|
|
2197
2197
|
});
|
|
2198
2198
|
}), T(() => {
|
|
2199
2199
|
T(() => {
|
|
@@ -2201,7 +2201,7 @@ function zr(t) {
|
|
|
2201
2201
|
s.clearValidateState(n);
|
|
2202
2202
|
});
|
|
2203
2203
|
});
|
|
2204
|
-
}), n == null && (h.Function(t.options.onReset) &&
|
|
2204
|
+
}), n == null && (h.Function(t.options.onReset) && O(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
2205
2205
|
},
|
|
2206
2206
|
method(n, o) {
|
|
2207
2207
|
const a = s.el(n);
|
|
@@ -2210,7 +2210,7 @@ function zr(t) {
|
|
|
2210
2210
|
return (...l) => a[o](...l);
|
|
2211
2211
|
},
|
|
2212
2212
|
exec(n, o, ...a) {
|
|
2213
|
-
return
|
|
2213
|
+
return O(() => s.method(n, o)(...a));
|
|
2214
2214
|
},
|
|
2215
2215
|
toJson(n) {
|
|
2216
2216
|
return et(s.rule, n);
|
|
@@ -2232,21 +2232,21 @@ function zr(t) {
|
|
|
2232
2232
|
return o ? t.subForm[o.id] : void 0;
|
|
2233
2233
|
},
|
|
2234
2234
|
getChildrenRuleList(n) {
|
|
2235
|
-
const o = typeof n == "object", a = o ?
|
|
2235
|
+
const o = typeof n == "object", a = o ? Z(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2236
2236
|
if (!l)
|
|
2237
2237
|
return [];
|
|
2238
2238
|
const u = [];
|
|
2239
|
-
return ((
|
|
2240
|
-
|
|
2241
|
-
typeof
|
|
2239
|
+
return ((d) => {
|
|
2240
|
+
d && d.forEach((g) => {
|
|
2241
|
+
typeof g == "object" && (g.field && u.push(g), u.push(...s.getChildrenRuleList(g)));
|
|
2242
2242
|
});
|
|
2243
2243
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2244
2244
|
},
|
|
2245
2245
|
getParentRule(n) {
|
|
2246
|
-
return (typeof n == "object" ?
|
|
2246
|
+
return (typeof n == "object" ? Z(n) : t.getCtx(n)).parent.rule;
|
|
2247
2247
|
},
|
|
2248
2248
|
getParentSubRule(n) {
|
|
2249
|
-
const a = typeof n == "object" ?
|
|
2249
|
+
const a = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2250
2250
|
if (a) {
|
|
2251
2251
|
const l = a.getParentGroup();
|
|
2252
2252
|
if (l)
|
|
@@ -2254,13 +2254,13 @@ function zr(t) {
|
|
|
2254
2254
|
}
|
|
2255
2255
|
},
|
|
2256
2256
|
getChildrenFormData(n) {
|
|
2257
|
-
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] =
|
|
2257
|
+
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] = ye(l.value), a), {});
|
|
2258
2258
|
},
|
|
2259
2259
|
setChildrenFormData(n, o, a) {
|
|
2260
2260
|
const l = s.getChildrenRuleList(n);
|
|
2261
2261
|
t.deferSyncValue(() => {
|
|
2262
2262
|
l.forEach((u) => {
|
|
2263
|
-
|
|
2263
|
+
S(o, u.field) ? u.value = o[u.field] : a && (u.value = void 0);
|
|
2264
2264
|
});
|
|
2265
2265
|
});
|
|
2266
2266
|
},
|
|
@@ -2277,11 +2277,19 @@ function zr(t) {
|
|
|
2277
2277
|
}).catch(a) : o(l.data);
|
|
2278
2278
|
});
|
|
2279
2279
|
},
|
|
2280
|
+
renderRule(n, o, a) {
|
|
2281
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2282
|
+
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2283
|
+
},
|
|
2284
|
+
renderChildren(n, o, a) {
|
|
2285
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2286
|
+
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2287
|
+
},
|
|
2280
2288
|
nextTick(n) {
|
|
2281
2289
|
t.bus.$once("next-tick", n), t.refresh();
|
|
2282
2290
|
},
|
|
2283
2291
|
nextRefresh(n) {
|
|
2284
|
-
t.nextRefresh(), n &&
|
|
2292
|
+
t.nextRefresh(), n && O(n);
|
|
2285
2293
|
},
|
|
2286
2294
|
emit(n, ...o) {
|
|
2287
2295
|
t.vm.$emit(n, ...o);
|
|
@@ -2293,19 +2301,19 @@ function zr(t) {
|
|
|
2293
2301
|
fetch(n) {
|
|
2294
2302
|
return new Promise((o, a) => {
|
|
2295
2303
|
n = W(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2296
|
-
|
|
2304
|
+
O(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2297
2305
|
}).catch((l) => {
|
|
2298
|
-
|
|
2306
|
+
O(() => n.onError && n.onError(l)), a(l);
|
|
2299
2307
|
}));
|
|
2300
2308
|
});
|
|
2301
2309
|
},
|
|
2302
2310
|
watchFetch(n, o, a, l) {
|
|
2303
|
-
return t.fc.watchLoadData((u,
|
|
2304
|
-
let
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
}).catch((
|
|
2308
|
-
|
|
2311
|
+
return t.fc.watchLoadData((u, f) => {
|
|
2312
|
+
let d = W(n);
|
|
2313
|
+
d = t.loadFetchVar(d, u), !(l && l(d, f) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((g) => {
|
|
2314
|
+
O(() => d.onSuccess && d.onSuccess(g)), o && o(g, f);
|
|
2315
|
+
}).catch((g) => {
|
|
2316
|
+
O(() => d.onError && d.onError(g)), a && a(g);
|
|
2309
2317
|
}));
|
|
2310
2318
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2311
2319
|
},
|
|
@@ -2335,7 +2343,7 @@ function zr(t) {
|
|
|
2335
2343
|
};
|
|
2336
2344
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2337
2345
|
}
|
|
2338
|
-
function
|
|
2346
|
+
function Zr(t) {
|
|
2339
2347
|
_(t.prototype, {
|
|
2340
2348
|
initCache() {
|
|
2341
2349
|
this.clearCacheAll();
|
|
@@ -2367,7 +2375,7 @@ function Qr(t) {
|
|
|
2367
2375
|
}
|
|
2368
2376
|
});
|
|
2369
2377
|
}
|
|
2370
|
-
function
|
|
2378
|
+
function G(t) {
|
|
2371
2379
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2372
2380
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2373
2381
|
});
|
|
@@ -2376,7 +2384,7 @@ function J(t) {
|
|
|
2376
2384
|
function Nt(t) {
|
|
2377
2385
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2378
2386
|
}
|
|
2379
|
-
function
|
|
2387
|
+
function Yr(t) {
|
|
2380
2388
|
_(t.prototype, {
|
|
2381
2389
|
initRender() {
|
|
2382
2390
|
this.cacheConfig = {};
|
|
@@ -2385,7 +2393,7 @@ function Zr(t) {
|
|
|
2385
2393
|
const r = (i) => {
|
|
2386
2394
|
if (i) {
|
|
2387
2395
|
let s;
|
|
2388
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2396
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + $e(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + $e(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2389
2397
|
}
|
|
2390
2398
|
};
|
|
2391
2399
|
return r(this.vm);
|
|
@@ -2394,7 +2402,7 @@ function Zr(t) {
|
|
|
2394
2402
|
if (!this.vm.isShow)
|
|
2395
2403
|
return;
|
|
2396
2404
|
this.$manager.beforeRender();
|
|
2397
|
-
const e =
|
|
2405
|
+
const e = Fe();
|
|
2398
2406
|
return this.sort.forEach((r) => {
|
|
2399
2407
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2400
2408
|
}), this.$manager.render(e);
|
|
@@ -2405,23 +2413,23 @@ function Zr(t) {
|
|
|
2405
2413
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2406
2414
|
},
|
|
2407
2415
|
mergeGlobal(e) {
|
|
2408
|
-
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] =
|
|
2416
|
+
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = me(() => {
|
|
2409
2417
|
const i = this.$handle.options.global;
|
|
2410
|
-
return
|
|
2411
|
-
})), e.prop =
|
|
2418
|
+
return x({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2419
|
+
})), e.prop = x({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2412
2420
|
},
|
|
2413
2421
|
setOptions(e) {
|
|
2414
2422
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2415
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2423
|
+
e.prop.options = r, e.prop.optionsTo && r && ne(e.prop, e.prop.optionsTo, r);
|
|
2416
2424
|
},
|
|
2417
2425
|
deepSet(e) {
|
|
2418
2426
|
const r = e.rule.deep;
|
|
2419
2427
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2420
|
-
|
|
2428
|
+
ne(e.prop, i, r[i]);
|
|
2421
2429
|
});
|
|
2422
2430
|
},
|
|
2423
2431
|
parseSide(e, r) {
|
|
2424
|
-
return h.Object(e) ?
|
|
2432
|
+
return h.Object(e) ? x({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2425
2433
|
},
|
|
2426
2434
|
renderSides(e, r, i) {
|
|
2427
2435
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2435,7 +2443,7 @@ function Zr(t) {
|
|
|
2435
2443
|
try {
|
|
2436
2444
|
if (e.type === "hidden") return;
|
|
2437
2445
|
const i = e.rule;
|
|
2438
|
-
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2446
|
+
if (this.force || !this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2439
2447
|
let s;
|
|
2440
2448
|
e.initProp(), this.mergeGlobal(e), e.initNone(), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2441
2449
|
let n = e.prop;
|
|
@@ -2455,21 +2463,23 @@ function Zr(t) {
|
|
|
2455
2463
|
model: n.model || {},
|
|
2456
2464
|
slotValue: l
|
|
2457
2465
|
};
|
|
2458
|
-
l.length && i.slotUpdate &&
|
|
2459
|
-
let
|
|
2460
|
-
const
|
|
2461
|
-
e.parser.renderChildren ?
|
|
2462
|
-
|
|
2466
|
+
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2467
|
+
let f = [];
|
|
2468
|
+
const d = e.loadChildrenPending();
|
|
2469
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach((v) => {
|
|
2470
|
+
f.push(this.renderRule({
|
|
2463
2471
|
type: "template",
|
|
2464
2472
|
slot: v
|
|
2465
2473
|
}, (() => {
|
|
2474
|
+
if (h.Function(n.renderSlots[v]))
|
|
2475
|
+
return O(() => n.renderSlots[v]());
|
|
2466
2476
|
const w = this.parseSide(n.renderSlots[v], e);
|
|
2467
2477
|
return this.renderRule(w);
|
|
2468
2478
|
})()));
|
|
2469
2479
|
});
|
|
2470
|
-
const
|
|
2471
|
-
let
|
|
2472
|
-
return
|
|
2480
|
+
const g = this.getTypeSlot(e);
|
|
2481
|
+
let m;
|
|
2482
|
+
return g ? (u.children = f, m = g(u)) : m = a ? e.parser.preview(Ge(f), e) : e.parser.render(Ge(f), e), m = this.renderSides(m, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), m = this.$manager.makeWrap(e, m)), e.none && (Array.isArray(m) ? m = m.map((v) => !v || !v.tag ? v : this.none(v)) : m = this.none(m)), o && this.setCache(e, () => this.stable(m), r), m;
|
|
2473
2483
|
}, this.setCache(e, s, r);
|
|
2474
2484
|
}
|
|
2475
2485
|
return (...s) => {
|
|
@@ -2563,17 +2573,21 @@ function Zr(t) {
|
|
|
2563
2573
|
}
|
|
2564
2574
|
}
|
|
2565
2575
|
];
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
this.
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2576
|
+
if (e.input) {
|
|
2577
|
+
const o = this.tmpInput;
|
|
2578
|
+
this.vm.$props.disabled === !0 && (e.prop.props.disabled = !0), e.prop.model = {
|
|
2579
|
+
value: this.$handle.getFormData(e),
|
|
2580
|
+
callback: (a) => {
|
|
2581
|
+
o && o(e.field, a, e.rule), this.onInput(e, a);
|
|
2582
|
+
},
|
|
2583
|
+
expression: `formData.${e.id}`
|
|
2584
|
+
}, e.prop.modelEmit && n.push({
|
|
2585
|
+
on: {
|
|
2586
|
+
[e.prop.modelEmit]: () => this.onEmitInput(e)
|
|
2587
|
+
}
|
|
2588
|
+
});
|
|
2589
|
+
}
|
|
2590
|
+
return Y(n, e.prop), e.prop;
|
|
2577
2591
|
},
|
|
2578
2592
|
onMounted(e) {
|
|
2579
2593
|
e.el = this.vm.$refs[e.ref], e.el && ((e.el.$el || e.el).__rule__ = e.rule), e.parser.mounted(e), this.$handle.effect(e, "mounted"), this.$handle.targetHook(e, "mounted");
|
|
@@ -2590,7 +2604,7 @@ function Zr(t) {
|
|
|
2590
2604
|
},
|
|
2591
2605
|
renderChildren(e, r, i) {
|
|
2592
2606
|
if (!h.trueArray(e)) return [];
|
|
2593
|
-
const s =
|
|
2607
|
+
const s = Fe();
|
|
2594
2608
|
return e.map((n) => {
|
|
2595
2609
|
if (n) {
|
|
2596
2610
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2609,6 +2623,16 @@ function Zr(t) {
|
|
|
2609
2623
|
const i = e.prop;
|
|
2610
2624
|
return i.component ? typeof i.component == "string" ? this.vNode.make(i.component, i, r) : 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(Nt(i.type), i, r);
|
|
2611
2625
|
},
|
|
2626
|
+
createChildrenVnodes(e, r, i) {
|
|
2627
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2628
|
+
const s = this.renderChildren(e.rule.children, e);
|
|
2629
|
+
return this.force = !1, this.tmpInput = null, s;
|
|
2630
|
+
},
|
|
2631
|
+
createRuleVnode(e, r, i) {
|
|
2632
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2633
|
+
const s = Fe();
|
|
2634
|
+
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2635
|
+
},
|
|
2612
2636
|
renderRule(e, r, i) {
|
|
2613
2637
|
if (!e) return;
|
|
2614
2638
|
if (h.String(e)) return e;
|
|
@@ -2616,12 +2640,12 @@ function Zr(t) {
|
|
|
2616
2640
|
if (i)
|
|
2617
2641
|
s = e.type;
|
|
2618
2642
|
else if (s = e.is, e.type) {
|
|
2619
|
-
s =
|
|
2643
|
+
s = G(e.type);
|
|
2620
2644
|
const a = this.vNode.aliasMap[s];
|
|
2621
|
-
a && (s =
|
|
2645
|
+
a && (s = G(a));
|
|
2622
2646
|
}
|
|
2623
2647
|
if (!s) return;
|
|
2624
|
-
const n =
|
|
2648
|
+
const n = Fe();
|
|
2625
2649
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2626
2650
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2627
2651
|
});
|
|
@@ -2630,7 +2654,7 @@ function Zr(t) {
|
|
|
2630
2654
|
}
|
|
2631
2655
|
});
|
|
2632
2656
|
}
|
|
2633
|
-
let
|
|
2657
|
+
let xr = 1;
|
|
2634
2658
|
function rt(t) {
|
|
2635
2659
|
_(this, {
|
|
2636
2660
|
$handle: t,
|
|
@@ -2638,7 +2662,9 @@ function rt(t) {
|
|
|
2638
2662
|
vm: t.vm,
|
|
2639
2663
|
$manager: t.$manager,
|
|
2640
2664
|
vNode: new t.fc.CreateNode(t.vm),
|
|
2641
|
-
|
|
2665
|
+
force: !1,
|
|
2666
|
+
tmpInput: null,
|
|
2667
|
+
id: xr++
|
|
2642
2668
|
}), Pt(this, {
|
|
2643
2669
|
options() {
|
|
2644
2670
|
return t.options;
|
|
@@ -2648,9 +2674,9 @@ function rt(t) {
|
|
|
2648
2674
|
}
|
|
2649
2675
|
}), this.initCache(), this.initRender();
|
|
2650
2676
|
}
|
|
2651
|
-
Qr(rt);
|
|
2652
2677
|
Zr(rt);
|
|
2653
|
-
|
|
2678
|
+
Yr(rt);
|
|
2679
|
+
function ei(t) {
|
|
2654
2680
|
_(t.prototype, {
|
|
2655
2681
|
parseInjectEvent(e, r) {
|
|
2656
2682
|
const i = e.inject || this.options.injectEvent;
|
|
@@ -2675,19 +2701,19 @@ function xr(t) {
|
|
|
2675
2701
|
},
|
|
2676
2702
|
parseEmit(e, r) {
|
|
2677
2703
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2678
|
-
return h.trueArray(u) && u.forEach((
|
|
2679
|
-
if (!
|
|
2680
|
-
let
|
|
2681
|
-
if (h.Object(
|
|
2682
|
-
r || (
|
|
2683
|
-
const
|
|
2684
|
-
this.vm.$emit(
|
|
2704
|
+
return h.trueArray(u) && u.forEach((f) => {
|
|
2705
|
+
if (!f) return;
|
|
2706
|
+
let d, g = n || o || a;
|
|
2707
|
+
if (h.Object(f) && (d = f.inject, f = f.name, g = f.prefix || g), g) {
|
|
2708
|
+
r || (g = `native-${g}`);
|
|
2709
|
+
const m = $e(`${g}-${f}`), v = (...w) => {
|
|
2710
|
+
this.vm.$emit(m, ...w), this.vm.$emit("emit-event", m, ...w), this.bus.$emit(m, ...w);
|
|
2685
2711
|
};
|
|
2686
|
-
if (v.__emit = !0, !
|
|
2687
|
-
i[
|
|
2712
|
+
if (v.__emit = !0, !d && l === !1)
|
|
2713
|
+
i[f] = v;
|
|
2688
2714
|
else {
|
|
2689
|
-
let w =
|
|
2690
|
-
i[
|
|
2715
|
+
let w = d || l || this.options.injectEvent;
|
|
2716
|
+
i[f] = h.Undef(w) ? v : this.inject(s, v, w);
|
|
2691
2717
|
}
|
|
2692
2718
|
}
|
|
2693
2719
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2715,41 +2741,51 @@ function xr(t) {
|
|
|
2715
2741
|
};
|
|
2716
2742
|
return n.__origin = r, n.__json = r.__json, n;
|
|
2717
2743
|
},
|
|
2718
|
-
loadStrVar(e, r) {
|
|
2744
|
+
loadStrVar(e, r, i) {
|
|
2719
2745
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2720
|
-
const
|
|
2721
|
-
let
|
|
2722
|
-
if (
|
|
2723
|
-
const
|
|
2724
|
-
if (
|
|
2725
|
-
const
|
|
2726
|
-
|
|
2746
|
+
const s = e, n = Wr(e);
|
|
2747
|
+
let o;
|
|
2748
|
+
if (n.forEach((a) => {
|
|
2749
|
+
const l = a.split("||"), u = l[0].trim();
|
|
2750
|
+
if (u) {
|
|
2751
|
+
const f = (l[1] || "").trim();
|
|
2752
|
+
let d, g = !1;
|
|
2753
|
+
if (i && u.indexOf("$form.") === 0) {
|
|
2754
|
+
const m = u.split(".");
|
|
2755
|
+
m.shift(), S(i.value, m[0]) && (g = !0, d = r ? r({
|
|
2756
|
+
id: "$form." + m[0] + "_" + i.rule.__fc__.id,
|
|
2757
|
+
getValue: () => M(i.value, m)
|
|
2758
|
+
}) : M(i.value, m));
|
|
2759
|
+
}
|
|
2760
|
+
g || (d = r ? r(u, f) : this.fc.getLoadData(u, f)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2727
2761
|
}
|
|
2728
|
-
}),
|
|
2729
|
-
return
|
|
2762
|
+
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2763
|
+
return o;
|
|
2730
2764
|
}
|
|
2731
2765
|
return e;
|
|
2732
2766
|
},
|
|
2733
|
-
loadFetchVar(e, r) {
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2767
|
+
loadFetchVar(e, r, i) {
|
|
2768
|
+
let s;
|
|
2769
|
+
i && i.__fc__ && (s = i.__fc__.getParentGroup());
|
|
2770
|
+
const n = (o) => this.loadStrVar(o, r, s ? { rule: i, value: this.subRuleData[s.id] || {} } : null);
|
|
2771
|
+
return e.action = n(e.action || ""), ["headers", "data", "query"].forEach((o) => {
|
|
2772
|
+
if (e[o]) {
|
|
2773
|
+
const a = {};
|
|
2774
|
+
Object.keys(e[o]).forEach((l) => {
|
|
2775
|
+
a[n(l)] = n(e[o][l]);
|
|
2776
|
+
}), e[o] = a;
|
|
2741
2777
|
}
|
|
2742
2778
|
}), e;
|
|
2743
2779
|
}
|
|
2744
2780
|
});
|
|
2745
2781
|
}
|
|
2746
2782
|
const yt = ["hook:updated", "hook:mounted"];
|
|
2747
|
-
function
|
|
2783
|
+
function ti(t) {
|
|
2748
2784
|
_(t.prototype, {
|
|
2749
2785
|
usePage() {
|
|
2750
2786
|
const e = this.options.page;
|
|
2751
2787
|
if (!e) return;
|
|
2752
|
-
let r = 25, i =
|
|
2788
|
+
let r = 25, i = ri(this.rules);
|
|
2753
2789
|
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), _(this, {
|
|
2754
2790
|
first: r,
|
|
2755
2791
|
limit: i,
|
|
@@ -2764,10 +2800,10 @@ function ei(t) {
|
|
|
2764
2800
|
}
|
|
2765
2801
|
});
|
|
2766
2802
|
}
|
|
2767
|
-
function
|
|
2803
|
+
function ri(t) {
|
|
2768
2804
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2769
2805
|
}
|
|
2770
|
-
function
|
|
2806
|
+
function ii(t) {
|
|
2771
2807
|
_(t.prototype, {
|
|
2772
2808
|
clearNextTick() {
|
|
2773
2809
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
@@ -2782,15 +2818,15 @@ function ri(t) {
|
|
|
2782
2818
|
}
|
|
2783
2819
|
});
|
|
2784
2820
|
}
|
|
2785
|
-
function
|
|
2821
|
+
function ni(t) {
|
|
2786
2822
|
Object.defineProperties(t.origin, {
|
|
2787
|
-
__fc__: Ke(
|
|
2823
|
+
__fc__: Ke(pe(t), !0)
|
|
2788
2824
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2789
|
-
__fc__: Ke(
|
|
2825
|
+
__fc__: Ke(pe(t), !0)
|
|
2790
2826
|
});
|
|
2791
2827
|
}
|
|
2792
2828
|
function qt(t, e, r) {
|
|
2793
|
-
const i =
|
|
2829
|
+
const i = je(), s = !!e.field;
|
|
2794
2830
|
_(this, {
|
|
2795
2831
|
id: i,
|
|
2796
2832
|
ref: i,
|
|
@@ -2817,7 +2853,7 @@ function qt(t, e, r) {
|
|
|
2817
2853
|
exportEl: void 0,
|
|
2818
2854
|
defaultValue: s ? W(r) : void 0,
|
|
2819
2855
|
field: e.field || void 0
|
|
2820
|
-
}), this.updateKey(),
|
|
2856
|
+
}), this.updateKey(), ni(this), this.update(t, !0);
|
|
2821
2857
|
}
|
|
2822
2858
|
_(qt.prototype, {
|
|
2823
2859
|
getParentGroup() {
|
|
@@ -2852,12 +2888,12 @@ _(qt.prototype, {
|
|
|
2852
2888
|
delete this.pending[e];
|
|
2853
2889
|
let a = r;
|
|
2854
2890
|
if (h.Function(r)) {
|
|
2855
|
-
let l =
|
|
2891
|
+
let l = O(() => r({
|
|
2856
2892
|
rule: this.rule,
|
|
2857
2893
|
api: this.$api,
|
|
2858
2894
|
update: (u) => {
|
|
2859
|
-
const
|
|
2860
|
-
this.setPending(e, r,
|
|
2895
|
+
const f = u || i, d = this.getPending(e, i);
|
|
2896
|
+
this.setPending(e, r, f), o && o(f, d);
|
|
2861
2897
|
},
|
|
2862
2898
|
reload: () => {
|
|
2863
2899
|
const u = this.getPending(e, i);
|
|
@@ -2865,8 +2901,8 @@ _(qt.prototype, {
|
|
|
2865
2901
|
}
|
|
2866
2902
|
}));
|
|
2867
2903
|
l && h.Function(l.then) ? (l.then((u) => {
|
|
2868
|
-
const
|
|
2869
|
-
this.setPending(e, r,
|
|
2904
|
+
const f = u || i;
|
|
2905
|
+
this.setPending(e, r, f), s && s(f), this.$api && this.$api.sync(this.rule);
|
|
2870
2906
|
}).catch((u) => {
|
|
2871
2907
|
console.error(u);
|
|
2872
2908
|
}), a = i, this.setPending(e, r, a)) : (a = l || i, this.setPending(e, r, a), s && s(a));
|
|
@@ -2879,7 +2915,7 @@ _(qt.prototype, {
|
|
|
2879
2915
|
setPending(t, e, r) {
|
|
2880
2916
|
this.pending[t] = {
|
|
2881
2917
|
origin: e,
|
|
2882
|
-
value:
|
|
2918
|
+
value: ie(r)
|
|
2883
2919
|
};
|
|
2884
2920
|
},
|
|
2885
2921
|
effectData(t) {
|
|
@@ -2889,10 +2925,10 @@ _(qt.prototype, {
|
|
|
2889
2925
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2890
2926
|
},
|
|
2891
2927
|
updateKey(t) {
|
|
2892
|
-
this.key =
|
|
2928
|
+
this.key = je(), t && this.parent && this.parent.updateKey(t);
|
|
2893
2929
|
},
|
|
2894
2930
|
updateType() {
|
|
2895
|
-
this.originType = this.rule.type, this.type =
|
|
2931
|
+
this.originType = this.rule.type, this.type = G(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
2896
2932
|
},
|
|
2897
2933
|
setParser(t) {
|
|
2898
2934
|
this.parser = t, t.init(this);
|
|
@@ -2900,7 +2936,7 @@ _(qt.prototype, {
|
|
|
2900
2936
|
initProp() {
|
|
2901
2937
|
var e, r;
|
|
2902
2938
|
const t = b({}, this.rule);
|
|
2903
|
-
delete t.children, delete t.validate, this.prop =
|
|
2939
|
+
delete t.children, delete t.validate, this.prop = x({}, [t, ...Object.keys(this.payload).map((i) => this.payload[i]), this.computed]), this.prop.validate = [...((r = (e = this.refRule) == null ? void 0 : e.__$validate) == null ? void 0 : r.value) || [], ...this.prop.validate || []];
|
|
2904
2940
|
},
|
|
2905
2941
|
initNone() {
|
|
2906
2942
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -2966,7 +3002,7 @@ _(qt.prototype, {
|
|
|
2966
3002
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2967
3003
|
}
|
|
2968
3004
|
});
|
|
2969
|
-
function
|
|
3005
|
+
function si(t) {
|
|
2970
3006
|
_(t.prototype, {
|
|
2971
3007
|
nextRefresh(e) {
|
|
2972
3008
|
const r = this.loadedId;
|
|
@@ -2975,10 +3011,10 @@ function ni(t) {
|
|
|
2975
3011
|
});
|
|
2976
3012
|
},
|
|
2977
3013
|
parseRule(e) {
|
|
2978
|
-
const r =
|
|
3014
|
+
const r = ct(e);
|
|
2979
3015
|
return Object.defineProperties(r, {
|
|
2980
3016
|
__origin__: Ke(e, !0)
|
|
2981
|
-
}),
|
|
3017
|
+
}), oi(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
2982
3018
|
i && this.loadFn(i, r);
|
|
2983
3019
|
}), this.loadCtrl(r), r.update && (r.update = K(r.update)), r;
|
|
2984
3020
|
},
|
|
@@ -2994,7 +3030,7 @@ function ni(t) {
|
|
|
2994
3030
|
},
|
|
2995
3031
|
syncProp(e) {
|
|
2996
3032
|
const r = e.rule;
|
|
2997
|
-
h.trueArray(r.sync) &&
|
|
3033
|
+
h.trueArray(r.sync) && Y([{
|
|
2998
3034
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
2999
3035
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3000
3036
|
}, i), {})
|
|
@@ -3025,37 +3061,37 @@ function ni(t) {
|
|
|
3025
3061
|
if (r && !h.Object(o) || !this.pageEnd && !r && a >= this.first) return;
|
|
3026
3062
|
if (o.__fc__ && o.__fc__.root === e && this.ctxs[o.__fc__.id])
|
|
3027
3063
|
return s(o.__fc__.loadChildrenPending(), o.__fc__), o.__fc__;
|
|
3028
|
-
let l =
|
|
3064
|
+
let l = ct(o);
|
|
3029
3065
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3030
3066
|
this.fc.targetFormDriver("loadRule", { rule: l, api: this.api }, this.fc), this.ruleEffect(l, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", o, this.api);
|
|
3031
|
-
let
|
|
3032
|
-
if (
|
|
3033
|
-
if (
|
|
3034
|
-
if ($t(
|
|
3067
|
+
let f, d = !1, g = !!o.__fc__, m = l.value;
|
|
3068
|
+
if (g) {
|
|
3069
|
+
if (f = o.__fc__, m = f.defaultValue, f.deleted) {
|
|
3070
|
+
if ($t(f))
|
|
3035
3071
|
return;
|
|
3036
|
-
|
|
3037
|
-
} else if (!
|
|
3038
|
-
if ($t(
|
|
3072
|
+
f.update(this);
|
|
3073
|
+
} else if (!f.check(this)) {
|
|
3074
|
+
if ($t(f))
|
|
3039
3075
|
return;
|
|
3040
|
-
e[a] = o = o._clone ? o._clone() : At(et(o)),
|
|
3076
|
+
e[a] = o = o._clone ? o._clone() : At(et(o)), f = null, d = !0;
|
|
3041
3077
|
}
|
|
3042
3078
|
}
|
|
3043
|
-
if (
|
|
3044
|
-
|
|
3079
|
+
if (f)
|
|
3080
|
+
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3045
3081
|
else {
|
|
3046
|
-
const
|
|
3047
|
-
|
|
3082
|
+
const j = this.parseRule(o);
|
|
3083
|
+
f = new qt(this, j, m), this.bindParser(f);
|
|
3048
3084
|
}
|
|
3049
|
-
[!1, !0].forEach((
|
|
3050
|
-
const v =
|
|
3051
|
-
if (
|
|
3052
|
-
const
|
|
3053
|
-
|
|
3085
|
+
[!1, !0].forEach((j) => this.parseEmit(f, j)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !d && !g && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3086
|
+
const v = f.loadChildrenPending();
|
|
3087
|
+
if (f.parser.loadChildren === !1 || s(v, f), !r) {
|
|
3088
|
+
const j = i(a);
|
|
3089
|
+
j > -1 || !a ? this.sort.splice(j + 1, 0, f.id) : this.sort.push(f.id);
|
|
3054
3090
|
}
|
|
3055
|
-
const w =
|
|
3056
|
-
return
|
|
3057
|
-
this.refreshUpdate(
|
|
3058
|
-
}), this.effect(
|
|
3091
|
+
const w = f.rule;
|
|
3092
|
+
return f.updated || (f.updated = !0, h.Function(w.update) && this.bus.$once("load-end", () => {
|
|
3093
|
+
this.refreshUpdate(f, w.value, "init");
|
|
3094
|
+
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3059
3095
|
}).filter((o) => !!o);
|
|
3060
3096
|
r && (r.children = n);
|
|
3061
3097
|
},
|
|
@@ -3063,31 +3099,31 @@ function ni(t) {
|
|
|
3063
3099
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
3064
3100
|
},
|
|
3065
3101
|
useCtrl(e) {
|
|
3066
|
-
const r =
|
|
3102
|
+
const r = ai(e), i = [], s = this.api;
|
|
3067
3103
|
if (!r.length) return !1;
|
|
3068
3104
|
for (let a = 0; a < r.length; a++) {
|
|
3069
|
-
const l = r[a], u = l.handle || function(
|
|
3070
|
-
return (
|
|
3105
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3106
|
+
return (fe[l.condition || "=="] || fe["=="])(d, l.value);
|
|
3071
3107
|
};
|
|
3072
3108
|
if (!h.trueArray(l.rule)) continue;
|
|
3073
|
-
const
|
|
3074
|
-
valid:
|
|
3075
|
-
ctrl:
|
|
3109
|
+
const f = q(b({}, l), {
|
|
3110
|
+
valid: O(() => u(e.rule.value, s)),
|
|
3111
|
+
ctrl: li(e, l.rule),
|
|
3076
3112
|
isHidden: h.String(l.rule[0])
|
|
3077
3113
|
});
|
|
3078
|
-
|
|
3114
|
+
f.valid && f.ctrl || !f.valid && !f.ctrl && !f.isHidden || i.push(f);
|
|
3079
3115
|
}
|
|
3080
3116
|
if (!i.length) return !1;
|
|
3081
3117
|
const n = [];
|
|
3082
3118
|
let o = !1;
|
|
3083
3119
|
return this.deferSyncValue(() => {
|
|
3084
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend:
|
|
3120
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: g, ctrl: m, method: v }) => {
|
|
3085
3121
|
if (a) {
|
|
3086
3122
|
l ? e.ctrlRule.push({
|
|
3087
3123
|
__ctrl: !0,
|
|
3088
3124
|
children: u,
|
|
3089
3125
|
valid: l
|
|
3090
|
-
}) :
|
|
3126
|
+
}) : m && e.ctrlRule.splice(e.ctrlRule.indexOf(m) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3091
3127
|
v === "disabled" || v === "enabled" ? this.api.disabled(!l, u) : v === "display" ? this.api.display(l, u) : v === "required" ? (u.forEach((w) => {
|
|
3092
3128
|
this.api.setEffect(w, "required", l);
|
|
3093
3129
|
}), l || this.api.clearValidateState(u)) : this.api.hidden(!l, u);
|
|
@@ -3103,11 +3139,11 @@ function ni(t) {
|
|
|
3103
3139
|
children: u
|
|
3104
3140
|
};
|
|
3105
3141
|
e.ctrlRule.push(w), this.bus.$once("load-start", () => {
|
|
3106
|
-
|
|
3142
|
+
f ? s.prepend(w, f, g) : d || g ? s.append(w, d || e.id, g) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
|
|
3107
3143
|
});
|
|
3108
3144
|
} else {
|
|
3109
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3110
|
-
const w =
|
|
3145
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
|
|
3146
|
+
const w = Z(m);
|
|
3111
3147
|
w && w.rm();
|
|
3112
3148
|
}
|
|
3113
3149
|
});
|
|
@@ -3135,17 +3171,17 @@ function ni(t) {
|
|
|
3135
3171
|
}
|
|
3136
3172
|
});
|
|
3137
3173
|
}
|
|
3138
|
-
function
|
|
3174
|
+
function oi(t) {
|
|
3139
3175
|
const e = Tt();
|
|
3140
3176
|
return Object.keys(e).forEach((r) => {
|
|
3141
|
-
|
|
3177
|
+
S(t, r) || R(t, r, e[r]);
|
|
3142
3178
|
}), t;
|
|
3143
3179
|
}
|
|
3144
|
-
function
|
|
3180
|
+
function ai(t) {
|
|
3145
3181
|
const e = t.rule.control || [];
|
|
3146
3182
|
return h.Object(e) ? [e] : e;
|
|
3147
3183
|
}
|
|
3148
|
-
function
|
|
3184
|
+
function li(t, e) {
|
|
3149
3185
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
3150
3186
|
const i = t.ctrlRule[r];
|
|
3151
3187
|
if (i.children === e)
|
|
@@ -3155,7 +3191,7 @@ function ai(t, e) {
|
|
|
3155
3191
|
function $t(t) {
|
|
3156
3192
|
return !!t.rule.__ctrl;
|
|
3157
3193
|
}
|
|
3158
|
-
function
|
|
3194
|
+
function ui(t) {
|
|
3159
3195
|
_(t.prototype, {
|
|
3160
3196
|
setValue(e, r, i, s) {
|
|
3161
3197
|
e.deleted || (e.rule.value = 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.targetHook(e, "value", { value: r }), this.emitEvent("change", e.field, r, {
|
|
@@ -3178,7 +3214,7 @@ function li(t) {
|
|
|
3178
3214
|
this.deferSyncValue(() => {
|
|
3179
3215
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3180
3216
|
Object.keys(r || {}).forEach((o) => {
|
|
3181
|
-
s &&
|
|
3217
|
+
s && S(s, o) ? n[o] = r[o] : S(this.api.form, o) ? this.api.form[o] = r[o] : this.api.top !== this.api && S(this.api.top.form, o) && (this.api.top.form[o] = r[o]);
|
|
3182
3218
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3183
3219
|
});
|
|
3184
3220
|
},
|
|
@@ -3188,33 +3224,33 @@ function li(t) {
|
|
|
3188
3224
|
setFormData(e, r) {
|
|
3189
3225
|
e.modelValue = r;
|
|
3190
3226
|
const i = e.getParentGroup();
|
|
3191
|
-
i && (this.subRuleData[i.id] ||
|
|
3227
|
+
i && (this.subRuleData[i.id] || R(this.subRuleData, i.id, {}), R(this.subRuleData[i.id], e.field, e.rule.value)), R(this.formData, e.id, r);
|
|
3192
3228
|
},
|
|
3193
3229
|
rmSubRuleData(e) {
|
|
3194
3230
|
const r = e.getParentGroup();
|
|
3195
|
-
r && this.subRuleData[r.id] &&
|
|
3231
|
+
r && this.subRuleData[r.id] && re(this.subRuleData[r.id], e.field);
|
|
3196
3232
|
},
|
|
3197
3233
|
getFormData(e) {
|
|
3198
3234
|
return this.formData[e.id];
|
|
3199
3235
|
},
|
|
3200
3236
|
syncForm() {
|
|
3201
3237
|
const e = {}, r = this.fields(), i = [];
|
|
3202
|
-
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] =
|
|
3238
|
+
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = De(this.appendData, n)), s), e), r.reduce((s, n) => {
|
|
3203
3239
|
const o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a.rule))[0] || this.fieldCtx[n][0];
|
|
3204
|
-
return this.isIgnore(o.rule) && i.push(n), s[n] =
|
|
3205
|
-
}, e), this.form =
|
|
3240
|
+
return this.isIgnore(o.rule) && i.push(n), s[n] = De(o.rule, "value"), s;
|
|
3241
|
+
}, e), this.form = ie(e), this.ignoreFields = i, this.syncValue();
|
|
3206
3242
|
},
|
|
3207
3243
|
isIgnore(e) {
|
|
3208
3244
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
3209
3245
|
},
|
|
3210
3246
|
appendValue(e) {
|
|
3211
|
-
(!e.field || !
|
|
3247
|
+
(!e.field || !S(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3212
3248
|
},
|
|
3213
3249
|
addSubForm(e, r) {
|
|
3214
3250
|
this.subForm[e.id] = r;
|
|
3215
3251
|
},
|
|
3216
3252
|
deferSyncValue(e, r) {
|
|
3217
|
-
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r),
|
|
3253
|
+
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r), O(e), this.deferSyncFn === e && (this.deferSyncFn = null, e.sync && this.syncForm());
|
|
3218
3254
|
},
|
|
3219
3255
|
syncValue() {
|
|
3220
3256
|
if (this.deferSyncFn)
|
|
@@ -3232,7 +3268,7 @@ function li(t) {
|
|
|
3232
3268
|
},
|
|
3233
3269
|
refreshUpdate(e, r, i, s) {
|
|
3234
3270
|
if (h.Function(e.rule.update)) {
|
|
3235
|
-
const n =
|
|
3271
|
+
const n = O(() => e.rule.update(r, e.origin, this.api, {
|
|
3236
3272
|
origin: i || "change",
|
|
3237
3273
|
linkField: s
|
|
3238
3274
|
}));
|
|
@@ -3261,7 +3297,7 @@ function li(t) {
|
|
|
3261
3297
|
function vt(t, e) {
|
|
3262
3298
|
return typeof e == "function" ? "" + e : e;
|
|
3263
3299
|
}
|
|
3264
|
-
const
|
|
3300
|
+
const ke = {
|
|
3265
3301
|
init(t) {
|
|
3266
3302
|
},
|
|
3267
3303
|
toFormValue(t, e) {
|
|
@@ -3280,7 +3316,7 @@ const Re = {
|
|
|
3280
3316
|
},
|
|
3281
3317
|
mergeProp(t) {
|
|
3282
3318
|
}
|
|
3283
|
-
},
|
|
3319
|
+
}, fi = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3284
3320
|
function ci(t) {
|
|
3285
3321
|
_(t.prototype, {
|
|
3286
3322
|
getCtx(e) {
|
|
@@ -3312,25 +3348,25 @@ function ci(t) {
|
|
|
3312
3348
|
getParser(e) {
|
|
3313
3349
|
const r = this.fc.parsers, i = this.fc.renderDriver;
|
|
3314
3350
|
if (i) {
|
|
3315
|
-
const s = i.parsers || {}, n = s[e.originType] || s[
|
|
3351
|
+
const s = i.parsers || {}, n = s[e.originType] || s[G(e.type)] || s[e.trueType];
|
|
3316
3352
|
if (n)
|
|
3317
3353
|
return n;
|
|
3318
3354
|
}
|
|
3319
|
-
return r[e.originType] || r[
|
|
3355
|
+
return r[e.originType] || r[G(e.type)] || r[e.trueType] || ke;
|
|
3320
3356
|
},
|
|
3321
3357
|
bindParser(e) {
|
|
3322
3358
|
e.setParser(this.getParser(e));
|
|
3323
3359
|
},
|
|
3324
3360
|
getType(e) {
|
|
3325
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
3326
|
-
return
|
|
3361
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[G(e)] || e;
|
|
3362
|
+
return G(i);
|
|
3327
3363
|
},
|
|
3328
3364
|
noWatch(e) {
|
|
3329
|
-
this.noWatchFn || (this.noWatchFn = e),
|
|
3365
|
+
this.noWatchFn || (this.noWatchFn = e), O(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3330
3366
|
},
|
|
3331
3367
|
watchCtx(e) {
|
|
3332
|
-
if (
|
|
3333
|
-
const s =
|
|
3368
|
+
if (kt().filter((i) => i[0] !== "_" && i[0] !== "$" && fi.indexOf(i) === -1).forEach((i) => {
|
|
3369
|
+
const s = De(e.rule, i), n = i === "children";
|
|
3334
3370
|
e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3335
3371
|
let l = s.value;
|
|
3336
3372
|
if (!this.isBreakWatch()) {
|
|
@@ -3351,21 +3387,21 @@ function ci(t) {
|
|
|
3351
3387
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3352
3388
|
}
|
|
3353
3389
|
}, { deep: !n, sync: n }));
|
|
3354
|
-
}), e.refRule.__$title =
|
|
3390
|
+
}), e.refRule.__$title = me(() => {
|
|
3355
3391
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3356
3392
|
if (i) {
|
|
3357
3393
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3358
3394
|
s && (i = this.api.t(s[1]));
|
|
3359
3395
|
}
|
|
3360
3396
|
return i;
|
|
3361
|
-
}), e.refRule.__$info =
|
|
3397
|
+
}), e.refRule.__$info = me(() => {
|
|
3362
3398
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3363
3399
|
if (i) {
|
|
3364
3400
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3365
3401
|
s && (i = this.api.t(s[1]));
|
|
3366
3402
|
}
|
|
3367
3403
|
return i;
|
|
3368
|
-
}), e.refRule.__$validate =
|
|
3404
|
+
}), e.refRule.__$validate = me(() => H(e.rule.validate).map((i) => {
|
|
3369
3405
|
const s = b({}, i);
|
|
3370
3406
|
if (s.message) {
|
|
3371
3407
|
const n = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
@@ -3385,7 +3421,7 @@ function ci(t) {
|
|
|
3385
3421
|
}
|
|
3386
3422
|
return s;
|
|
3387
3423
|
})), e.input) {
|
|
3388
|
-
const i =
|
|
3424
|
+
const i = De(e.rule, "value");
|
|
3389
3425
|
e.watch.push(L(() => i.value, () => {
|
|
3390
3426
|
let s = e.parser.toFormValue(i.value, e);
|
|
3391
3427
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
@@ -3395,15 +3431,15 @@ function ci(t) {
|
|
|
3395
3431
|
let i = e.rule.computed;
|
|
3396
3432
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3397
3433
|
let n;
|
|
3398
|
-
const o =
|
|
3434
|
+
const o = me(() => {
|
|
3399
3435
|
const l = i[s];
|
|
3400
3436
|
if (!l) return;
|
|
3401
3437
|
const u = this.compute(e, l);
|
|
3402
3438
|
return l.linkage && u === void 0 ? n : u;
|
|
3403
3439
|
}), a = (l) => {
|
|
3404
|
-
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) :
|
|
3440
|
+
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : ne(e.rule, s, l);
|
|
3405
3441
|
};
|
|
3406
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3442
|
+
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== M(e.rule, s)) && a(o.value), e.watch.push(L(o, (l) => {
|
|
3407
3443
|
n = l, setTimeout(() => {
|
|
3408
3444
|
a(l);
|
|
3409
3445
|
});
|
|
@@ -3419,31 +3455,31 @@ function ci(t) {
|
|
|
3419
3455
|
return !0;
|
|
3420
3456
|
const l = a.mode === "OR";
|
|
3421
3457
|
let u = !0;
|
|
3422
|
-
for (let
|
|
3423
|
-
const
|
|
3424
|
-
let
|
|
3425
|
-
if (
|
|
3426
|
-
|
|
3427
|
-
else if (
|
|
3428
|
-
|
|
3458
|
+
for (let f = 0; f < a.group.length; f++) {
|
|
3459
|
+
const d = a.group[f];
|
|
3460
|
+
let g, m = null;
|
|
3461
|
+
if (d.variable)
|
|
3462
|
+
m = JSON.stringify(this.fc.getLoadData(d.variable) || "");
|
|
3463
|
+
else if (d.field)
|
|
3464
|
+
m = dt(d.field || "");
|
|
3429
3465
|
else
|
|
3430
3466
|
return !0;
|
|
3431
|
-
let v =
|
|
3432
|
-
if (v && (v = dt(v || "")),
|
|
3467
|
+
let v = d.compare;
|
|
3468
|
+
if (v && (v = dt(v || "")), d.mode ? g = n(d) : fe[d.condition] ? h.Function(d.handler) ? g = O(() => d.handler(this.api, e.rule)) : g = O(() => new Function("$condition", "$val", "$form", "$group", "$rule", `with($form){with(this){with($group){ return $condition['${d.condition}'](${m}, ${v || "$val"}); }}}`).call(this.api.form, fe, d.value, this.api.top.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : g = !1, l && g)
|
|
3433
3469
|
return !0;
|
|
3434
|
-
l || (u = u &&
|
|
3470
|
+
l || (u = u && g);
|
|
3435
3471
|
}
|
|
3436
3472
|
return l ? !1 : u;
|
|
3437
3473
|
};
|
|
3438
3474
|
let o = n(r);
|
|
3439
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ?
|
|
3475
|
+
return o = r.invert === !0 ? !o : o, r.linkage ? o ? O(() => this.computeValue(r.linkage, e, s), void 0) : void 0 : o;
|
|
3440
3476
|
} else if (h.Function(r))
|
|
3441
3477
|
i = () => r(this.api.form, this.api);
|
|
3442
3478
|
else {
|
|
3443
3479
|
const s = e.getParentGroup();
|
|
3444
3480
|
i = () => this.computeValue(r, e, s);
|
|
3445
3481
|
}
|
|
3446
|
-
return
|
|
3482
|
+
return O(i, void 0);
|
|
3447
3483
|
},
|
|
3448
3484
|
computeValue(e, r, i) {
|
|
3449
3485
|
const s = this, n = Object.keys(this.fc.formulas).reduce((o, a) => (o[a] = function(...l) {
|
|
@@ -3471,9 +3507,9 @@ function ci(t) {
|
|
|
3471
3507
|
rmCtx(e) {
|
|
3472
3508
|
if (e.deleted) return;
|
|
3473
3509
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3474
|
-
|
|
3510
|
+
re(this.ctxs, r), re(this.formData, r), re(this.subForm, r), re(this.vm.ctxInject, r);
|
|
3475
3511
|
const o = e.getParentGroup();
|
|
3476
|
-
o && this.subRuleData[o.id] &&
|
|
3512
|
+
o && this.subRuleData[o.id] && re(this.subRuleData[o.id], i), e.group && re(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !S(this.fieldCtx, i) && re(this.form, i), this.deferSyncValue(() => {
|
|
3477
3513
|
if (!this.reloading) {
|
|
3478
3514
|
if (e.parser.loadChildren !== !1) {
|
|
3479
3515
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3487,7 +3523,7 @@ function ci(t) {
|
|
|
3487
3523
|
}
|
|
3488
3524
|
});
|
|
3489
3525
|
}
|
|
3490
|
-
function
|
|
3526
|
+
function hi(t) {
|
|
3491
3527
|
_(t.prototype, {
|
|
3492
3528
|
mounted() {
|
|
3493
3529
|
const e = () => {
|
|
@@ -3499,10 +3535,10 @@ function fi(t) {
|
|
|
3499
3535
|
this.fc.targetFormDriver(e, this.api, this.fc), this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3500
3536
|
},
|
|
3501
3537
|
emitEvent(e, ...r) {
|
|
3502
|
-
const i = this.options[e] || this.options[
|
|
3538
|
+
const i = this.options[e] || this.options[G("on-" + e)];
|
|
3503
3539
|
if (i) {
|
|
3504
3540
|
const s = K(i);
|
|
3505
|
-
h.Function(s) &&
|
|
3541
|
+
h.Function(s) && O(() => s(...r));
|
|
3506
3542
|
}
|
|
3507
3543
|
this.bus.$emit(e, ...r);
|
|
3508
3544
|
},
|
|
@@ -3510,18 +3546,18 @@ function fi(t) {
|
|
|
3510
3546
|
var n, o;
|
|
3511
3547
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3512
3548
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3513
|
-
|
|
3549
|
+
O(() => a(q(b({}, i || {}), { rule: e.rule, api: this.api })));
|
|
3514
3550
|
}));
|
|
3515
3551
|
}
|
|
3516
3552
|
});
|
|
3517
3553
|
}
|
|
3518
|
-
function
|
|
3554
|
+
function di(t) {
|
|
3519
3555
|
_(t.prototype, {
|
|
3520
3556
|
useProvider() {
|
|
3521
3557
|
const e = this.fc.providers;
|
|
3522
3558
|
Object.keys(e).forEach((r) => {
|
|
3523
3559
|
let i = e[r];
|
|
3524
|
-
h.Function(i) && (i = i(this.fc)), i._c =
|
|
3560
|
+
h.Function(i) && (i = i(this.fc)), i._c = mi(i), this.onEffect(i), this.providers[r] = i;
|
|
3525
3561
|
});
|
|
3526
3562
|
},
|
|
3527
3563
|
onEffect(e) {
|
|
@@ -3537,7 +3573,7 @@ function hi(t) {
|
|
|
3537
3573
|
let r = {
|
|
3538
3574
|
required: () => {
|
|
3539
3575
|
var i, s;
|
|
3540
|
-
return (
|
|
3576
|
+
return (S(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3541
3577
|
}
|
|
3542
3578
|
};
|
|
3543
3579
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3567,39 +3603,39 @@ function hi(t) {
|
|
|
3567
3603
|
}, r);
|
|
3568
3604
|
},
|
|
3569
3605
|
getEffect(e, r) {
|
|
3570
|
-
if (
|
|
3606
|
+
if (S(e, "$" + r))
|
|
3571
3607
|
return e["$" + r];
|
|
3572
|
-
if (
|
|
3608
|
+
if (S(e, "effect") && S(e.effect, r))
|
|
3573
3609
|
return e.effect[r];
|
|
3574
3610
|
},
|
|
3575
3611
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3576
3612
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3577
|
-
const l = n || Object.keys(r).reduce((u,
|
|
3613
|
+
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), b({}, r.effect || {}));
|
|
3578
3614
|
Object.keys(l).forEach((u) => {
|
|
3579
|
-
const
|
|
3580
|
-
if (!
|
|
3581
|
-
let
|
|
3582
|
-
if (!
|
|
3583
|
-
|
|
3584
|
-
else if (
|
|
3585
|
-
|
|
3615
|
+
const f = this.providers[u];
|
|
3616
|
+
if (!f || f.input && !i) return;
|
|
3617
|
+
let d;
|
|
3618
|
+
if (!f._c)
|
|
3619
|
+
d = "*";
|
|
3620
|
+
else if (f._used.indexOf(s) > -1)
|
|
3621
|
+
d = s;
|
|
3586
3622
|
else
|
|
3587
3623
|
return;
|
|
3588
|
-
const
|
|
3589
|
-
e && (
|
|
3624
|
+
const g = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3625
|
+
e && (g.getProp = () => e.effectData(u), g.clearProp = () => e.clearEffectData(u), g.mergeProp = (m) => x(g.getProp(), [m]), g.id = e.id), this.bus.$emit(`p:${u}:${d}:${f.input ? 1 : 0}`, o, [g, r, this.api]);
|
|
3590
3626
|
});
|
|
3591
3627
|
}
|
|
3592
3628
|
});
|
|
3593
3629
|
}
|
|
3594
|
-
function
|
|
3630
|
+
function pi(t) {
|
|
3595
3631
|
return t.filter(function(e, r, i) {
|
|
3596
3632
|
return i.indexOf(e, 0) === r;
|
|
3597
3633
|
});
|
|
3598
3634
|
}
|
|
3599
|
-
function
|
|
3635
|
+
function mi(t) {
|
|
3600
3636
|
const e = t.components;
|
|
3601
3637
|
if (Array.isArray(e)) {
|
|
3602
|
-
const r =
|
|
3638
|
+
const r = pi(e.filter((i) => i !== "*"));
|
|
3603
3639
|
return r.length ? r : !1;
|
|
3604
3640
|
} else return h.String(e) ? [e] : !1;
|
|
3605
3641
|
}
|
|
@@ -3623,10 +3659,10 @@ function X(t) {
|
|
|
3623
3659
|
noWatchFn: null,
|
|
3624
3660
|
deferSyncFn: null,
|
|
3625
3661
|
isMounted: !1,
|
|
3626
|
-
formData:
|
|
3627
|
-
subRuleData:
|
|
3662
|
+
formData: ie({}),
|
|
3663
|
+
subRuleData: ie({}),
|
|
3628
3664
|
subForm: {},
|
|
3629
|
-
form:
|
|
3665
|
+
form: ie({}),
|
|
3630
3666
|
appendData: {},
|
|
3631
3667
|
ignoreFields: [],
|
|
3632
3668
|
providers: {},
|
|
@@ -3639,9 +3675,9 @@ function X(t) {
|
|
|
3639
3675
|
this.lifecycle("reload");
|
|
3640
3676
|
}
|
|
3641
3677
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3642
|
-
const i =
|
|
3678
|
+
const i = O(() => r(e, this));
|
|
3643
3679
|
return i && i !== e && _(e, i), e;
|
|
3644
|
-
},
|
|
3680
|
+
}, Qr(this));
|
|
3645
3681
|
}
|
|
3646
3682
|
_(X.prototype, {
|
|
3647
3683
|
initData(t) {
|
|
@@ -3664,31 +3700,31 @@ _(X.prototype, {
|
|
|
3664
3700
|
},
|
|
3665
3701
|
beforeFetch(t) {
|
|
3666
3702
|
return new Promise((e) => {
|
|
3667
|
-
const r = this.options.beforeFetch &&
|
|
3703
|
+
const r = this.options.beforeFetch && O(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3668
3704
|
r && h.Function(r.then) ? r.then(e) : e();
|
|
3669
3705
|
});
|
|
3670
3706
|
}
|
|
3671
3707
|
});
|
|
3672
|
-
xr(X);
|
|
3673
3708
|
ei(X);
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3709
|
+
ti(X);
|
|
3710
|
+
ii(X);
|
|
3711
|
+
si(X);
|
|
3712
|
+
ui(X);
|
|
3677
3713
|
ci(X);
|
|
3678
|
-
fi(X);
|
|
3679
3714
|
hi(X);
|
|
3680
|
-
|
|
3681
|
-
|
|
3715
|
+
di(X);
|
|
3716
|
+
const gi = "fcFragment", Be = {
|
|
3717
|
+
name: gi,
|
|
3682
3718
|
functional: !0,
|
|
3683
3719
|
props: ["vnode"],
|
|
3684
3720
|
render(t, e) {
|
|
3685
3721
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3686
3722
|
}
|
|
3687
3723
|
};
|
|
3688
|
-
function
|
|
3724
|
+
function yi(t) {
|
|
3689
3725
|
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3690
3726
|
}
|
|
3691
|
-
function
|
|
3727
|
+
function $i() {
|
|
3692
3728
|
const t = {};
|
|
3693
3729
|
function e(r) {
|
|
3694
3730
|
r && this.setVm(r);
|
|
@@ -3699,11 +3735,11 @@ function yi() {
|
|
|
3699
3735
|
},
|
|
3700
3736
|
make(r, i, s) {
|
|
3701
3737
|
var n, o, a;
|
|
3702
|
-
return (
|
|
3738
|
+
return (ge.isReservedTag ? ge.isReservedTag(r) : (o = (n = ge) == null ? void 0 : n.config) != null && o.isReservedTag(r)) && (i == null || delete i.nativeOn, (a = i == null ? void 0 : i.props) == null || delete a.formCreateInject), this.makeComponent(r, i, s);
|
|
3703
3739
|
},
|
|
3704
3740
|
makeComponent(r, i, s) {
|
|
3705
3741
|
var o;
|
|
3706
|
-
let n = this.$h(r,
|
|
3742
|
+
let n = this.$h(r, yi(i), s || []);
|
|
3707
3743
|
if ((o = n == null ? void 0 : n.componentOptions) != null && o.propsData && (i != null && i.props)) {
|
|
3708
3744
|
const a = Object.keys(n.componentOptions.propsData);
|
|
3709
3745
|
n.data.attrs || (n.data.attrs = {}), Object.keys(i.props).forEach((l) => {
|
|
@@ -3720,7 +3756,7 @@ function yi() {
|
|
|
3720
3756
|
},
|
|
3721
3757
|
use(r) {
|
|
3722
3758
|
Object.keys(r).forEach((i) => {
|
|
3723
|
-
const s =
|
|
3759
|
+
const s = $e(i), n = jt(i).toLocaleLowerCase(), o = r[i];
|
|
3724
3760
|
[i, s, n].forEach((a) => {
|
|
3725
3761
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3726
3762
|
return this.make(o, l, u);
|
|
@@ -3730,7 +3766,7 @@ function yi() {
|
|
|
3730
3766
|
}
|
|
3731
3767
|
}), e;
|
|
3732
3768
|
}
|
|
3733
|
-
function
|
|
3769
|
+
function vi(t) {
|
|
3734
3770
|
class e extends Ut {
|
|
3735
3771
|
}
|
|
3736
3772
|
return Object.assign(e.prototype, t), e;
|
|
@@ -3751,7 +3787,7 @@ _(Ut.prototype, {
|
|
|
3751
3787
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3752
3788
|
},
|
|
3753
3789
|
updateKey() {
|
|
3754
|
-
this.key =
|
|
3790
|
+
this.key = je();
|
|
3755
3791
|
},
|
|
3756
3792
|
//TODO interface
|
|
3757
3793
|
init() {
|
|
@@ -3773,7 +3809,7 @@ _(Ut.prototype, {
|
|
|
3773
3809
|
return e(this.vm);
|
|
3774
3810
|
},
|
|
3775
3811
|
mergeOptions(t, e) {
|
|
3776
|
-
return
|
|
3812
|
+
return Y(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3777
3813
|
},
|
|
3778
3814
|
updateOptions(t) {
|
|
3779
3815
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3791,24 +3827,24 @@ _(Ut.prototype, {
|
|
|
3791
3827
|
render(t) {
|
|
3792
3828
|
}
|
|
3793
3829
|
});
|
|
3794
|
-
const
|
|
3830
|
+
const bi = function(t) {
|
|
3795
3831
|
const e = {
|
|
3796
3832
|
name: "loadData",
|
|
3797
3833
|
_fn: [],
|
|
3798
3834
|
loaded(r, i, s) {
|
|
3799
3835
|
this.deleted(r);
|
|
3800
|
-
let n =
|
|
3836
|
+
let n = H(r.getValue());
|
|
3801
3837
|
const o = [];
|
|
3802
3838
|
n.forEach((a) => {
|
|
3803
3839
|
if (a && (a.attr || a.template)) {
|
|
3804
|
-
let l = (
|
|
3805
|
-
let
|
|
3806
|
-
a.template ?
|
|
3807
|
-
const
|
|
3808
|
-
a.to === "child" ?
|
|
3809
|
-
}, u = (
|
|
3810
|
-
const
|
|
3811
|
-
l =
|
|
3840
|
+
let l = (d) => {
|
|
3841
|
+
let g;
|
|
3842
|
+
a.template ? g = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? g = a.handler(d, i, s) : g = d(a.attr, a.default), a.copy !== !1 && (g = W(g));
|
|
3843
|
+
const m = a.modify ? i : r.getProp();
|
|
3844
|
+
a.to === "child" ? m.children ? R(m.children, 0, g) : R(m, "children", [g]) : ne(m, a.to || "options", g), s.sync(i);
|
|
3845
|
+
}, u = (d) => l(d);
|
|
3846
|
+
const f = t.watchLoadData(u);
|
|
3847
|
+
l = ce(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3812
3848
|
}
|
|
3813
3849
|
}), this._fn[r.id] = o;
|
|
3814
3850
|
},
|
|
@@ -3819,7 +3855,7 @@ const vi = function(t) {
|
|
|
3819
3855
|
}
|
|
3820
3856
|
};
|
|
3821
3857
|
return e.watch = e.mounted, e;
|
|
3822
|
-
},
|
|
3858
|
+
}, _i = function(t) {
|
|
3823
3859
|
const e = {
|
|
3824
3860
|
name: "t",
|
|
3825
3861
|
_fn: [],
|
|
@@ -3831,13 +3867,13 @@ const vi = function(t) {
|
|
|
3831
3867
|
const l = n[a];
|
|
3832
3868
|
if (l) {
|
|
3833
3869
|
const u = typeof l == "object";
|
|
3834
|
-
let
|
|
3835
|
-
let v = t.t(u ? l.attr : l, u ? l.params : null,
|
|
3870
|
+
let f = (m) => {
|
|
3871
|
+
let v = t.t(u ? l.attr : l, u ? l.params : null, m);
|
|
3836
3872
|
const w = u && l.modify ? i : r.getProp();
|
|
3837
|
-
a === "child" ? w.children ?
|
|
3838
|
-
},
|
|
3839
|
-
const
|
|
3840
|
-
|
|
3873
|
+
a === "child" ? w.children ? R(w.children, 0, v) : R(w, "children", [v]) : ne(w, a, v), s.sync(i);
|
|
3874
|
+
}, d = (m) => f(m);
|
|
3875
|
+
const g = t.watchLoadData(d);
|
|
3876
|
+
f = ce(f, l.wait || 300), l.watch !== !1 ? o.push(g) : g();
|
|
3841
3877
|
}
|
|
3842
3878
|
}), this._fn[r.id] = o;
|
|
3843
3879
|
},
|
|
@@ -3859,7 +3895,7 @@ const vi = function(t) {
|
|
|
3859
3895
|
const s = i.method;
|
|
3860
3896
|
delete i.method, t.getProp().validate = [q(b({}, i), {
|
|
3861
3897
|
validator(...n) {
|
|
3862
|
-
const o =
|
|
3898
|
+
const o = Z(e);
|
|
3863
3899
|
if (o)
|
|
3864
3900
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3865
3901
|
attr: t,
|
|
@@ -3873,7 +3909,7 @@ const vi = function(t) {
|
|
|
3873
3909
|
watch(...t) {
|
|
3874
3910
|
Ht.load(...t);
|
|
3875
3911
|
}
|
|
3876
|
-
},
|
|
3912
|
+
}, Ci = function(t) {
|
|
3877
3913
|
function e(s) {
|
|
3878
3914
|
return h.String(s) && (s = {
|
|
3879
3915
|
action: s,
|
|
@@ -3883,55 +3919,55 @@ const vi = function(t) {
|
|
|
3883
3919
|
function r(s, n, o) {
|
|
3884
3920
|
let a = s.value;
|
|
3885
3921
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3886
|
-
const l = (
|
|
3887
|
-
|
|
3922
|
+
const l = (d) => {
|
|
3923
|
+
d === void 0 ? s.clearProp() : ne(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3888
3924
|
};
|
|
3889
3925
|
if (!a || !a.action && !a.key) {
|
|
3890
3926
|
l(void 0);
|
|
3891
3927
|
return;
|
|
3892
3928
|
}
|
|
3893
3929
|
if (a = W(a), a.to || (a.to = "options"), a.key) {
|
|
3894
|
-
const
|
|
3895
|
-
if (!
|
|
3930
|
+
const d = t.$handle.options.globalData[a.key];
|
|
3931
|
+
if (!d) {
|
|
3896
3932
|
l(void 0);
|
|
3897
3933
|
return;
|
|
3898
3934
|
}
|
|
3899
|
-
if (
|
|
3900
|
-
l(
|
|
3935
|
+
if (d.type === "static") {
|
|
3936
|
+
l(d.data);
|
|
3901
3937
|
return;
|
|
3902
3938
|
} else
|
|
3903
|
-
a = b(b({}, a),
|
|
3939
|
+
a = b(b({}, a), d);
|
|
3904
3940
|
}
|
|
3905
|
-
const u = a.onError,
|
|
3941
|
+
const u = a.onError, f = () => {
|
|
3906
3942
|
if (!s.getValue())
|
|
3907
3943
|
return s.clearProp(), o.sync(n), !0;
|
|
3908
3944
|
};
|
|
3909
|
-
i._fn[s.id] = t.watchLoadData(
|
|
3910
|
-
if (
|
|
3945
|
+
i._fn[s.id] = t.watchLoadData(ce((d, g) => {
|
|
3946
|
+
if (g && a.watch === !1)
|
|
3911
3947
|
return i._fn[s.id]();
|
|
3912
|
-
const
|
|
3948
|
+
const m = t.$handle.loadFetchVar(W(a), d, n), v = q(b({
|
|
3913
3949
|
headers: {}
|
|
3914
|
-
},
|
|
3915
|
-
onSuccess(w,
|
|
3916
|
-
if (
|
|
3917
|
-
let
|
|
3918
|
-
const P = K(
|
|
3919
|
-
h.Function(P) ?
|
|
3950
|
+
}, m), {
|
|
3951
|
+
onSuccess(w, j) {
|
|
3952
|
+
if (f()) return;
|
|
3953
|
+
let ee = (N) => j ? N : S(N, "data") ? N.data : N;
|
|
3954
|
+
const P = K(m.parse);
|
|
3955
|
+
h.Function(P) ? ee = P : P && h.String(P) && (ee = (N) => M(N, P)), l(ee(w, n, o)), o.sync(n);
|
|
3920
3956
|
},
|
|
3921
3957
|
onError(w) {
|
|
3922
|
-
l(void 0), !
|
|
3958
|
+
l(void 0), !f() && (u || ((j) => xe(j.message || "fetch fail " + m.action)))(w, n, o);
|
|
3923
3959
|
}
|
|
3924
3960
|
});
|
|
3925
3961
|
t.$handle.beforeFetch(v, { rule: n, api: o }).then(() => {
|
|
3926
|
-
if (h.Function(
|
|
3927
|
-
|
|
3962
|
+
if (h.Function(m.action)) {
|
|
3963
|
+
m.action(n, o).then((w) => {
|
|
3928
3964
|
v.onSuccess(w, !0);
|
|
3929
3965
|
}).catch((w) => {
|
|
3930
3966
|
v.onError(w);
|
|
3931
3967
|
});
|
|
3932
3968
|
return;
|
|
3933
3969
|
}
|
|
3934
|
-
|
|
3970
|
+
O(() => t.create.fetch(v, { inject: s, rule: n, api: o }));
|
|
3935
3971
|
});
|
|
3936
3972
|
}, a.wait || 600));
|
|
3937
3973
|
}
|
|
@@ -3949,13 +3985,13 @@ const vi = function(t) {
|
|
|
3949
3985
|
}
|
|
3950
3986
|
};
|
|
3951
3987
|
return i;
|
|
3952
|
-
},
|
|
3953
|
-
fetch:
|
|
3954
|
-
loadData:
|
|
3955
|
-
t:
|
|
3988
|
+
}, wi = {
|
|
3989
|
+
fetch: Ci,
|
|
3990
|
+
loadData: bi,
|
|
3991
|
+
t: _i,
|
|
3956
3992
|
componentValidate: Ht
|
|
3957
3993
|
};
|
|
3958
|
-
function
|
|
3994
|
+
function Oi(t) {
|
|
3959
3995
|
t = t || /* @__PURE__ */ new Map();
|
|
3960
3996
|
const e = {
|
|
3961
3997
|
$on(r, i) {
|
|
@@ -3979,8 +4015,8 @@ function wi(t) {
|
|
|
3979
4015
|
};
|
|
3980
4016
|
return e;
|
|
3981
4017
|
}
|
|
3982
|
-
const
|
|
3983
|
-
name:
|
|
4018
|
+
const Fi = "html", Ri = {
|
|
4019
|
+
name: Fi,
|
|
3984
4020
|
loadChildren: !1,
|
|
3985
4021
|
render(t, e) {
|
|
3986
4022
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
@@ -3989,7 +4025,7 @@ const Oi = "html", Fi = {
|
|
|
3989
4025
|
return Array.isArray(t) ? t.filter((e) => h.String(e)).join("") : "";
|
|
3990
4026
|
}
|
|
3991
4027
|
};
|
|
3992
|
-
function
|
|
4028
|
+
function Ei(t) {
|
|
3993
4029
|
t = t + "=";
|
|
3994
4030
|
const r = decodeURIComponent(document.cookie).split(";");
|
|
3995
4031
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -4007,7 +4043,7 @@ function ki(t) {
|
|
|
4007
4043
|
}
|
|
4008
4044
|
return null;
|
|
4009
4045
|
}
|
|
4010
|
-
function
|
|
4046
|
+
function Si(t) {
|
|
4011
4047
|
const e = localStorage.getItem(t);
|
|
4012
4048
|
if (e)
|
|
4013
4049
|
try {
|
|
@@ -4017,7 +4053,7 @@ function Ei(t) {
|
|
|
4017
4053
|
}
|
|
4018
4054
|
return null;
|
|
4019
4055
|
}
|
|
4020
|
-
function
|
|
4056
|
+
function ki(t) {
|
|
4021
4057
|
const e = sessionStorage.getItem(t);
|
|
4022
4058
|
if (e)
|
|
4023
4059
|
try {
|
|
@@ -4032,28 +4068,28 @@ function it(t, e) {
|
|
|
4032
4068
|
return null;
|
|
4033
4069
|
const r = e.split(".");
|
|
4034
4070
|
let i = t(r.shift());
|
|
4035
|
-
return r.length ? i == null ? null :
|
|
4036
|
-
}
|
|
4037
|
-
function Si(t) {
|
|
4038
|
-
return it(ki, t);
|
|
4071
|
+
return r.length ? i == null ? null : M(i, r) : i;
|
|
4039
4072
|
}
|
|
4040
4073
|
function Di(t) {
|
|
4041
4074
|
return it(Ei, t);
|
|
4042
4075
|
}
|
|
4043
4076
|
function ji(t) {
|
|
4044
|
-
return it(
|
|
4077
|
+
return it(Si, t);
|
|
4078
|
+
}
|
|
4079
|
+
function Ai(t) {
|
|
4080
|
+
return it(ki, t);
|
|
4045
4081
|
}
|
|
4046
|
-
function
|
|
4082
|
+
function Vi(t, e) {
|
|
4047
4083
|
let r;
|
|
4048
4084
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4049
4085
|
}
|
|
4050
4086
|
function Le() {
|
|
4051
|
-
return
|
|
4087
|
+
return Vi("name", ...arguments);
|
|
4052
4088
|
}
|
|
4053
|
-
function
|
|
4089
|
+
function Ii(t) {
|
|
4054
4090
|
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
4055
4091
|
}
|
|
4056
|
-
function
|
|
4092
|
+
function Pi(t, e) {
|
|
4057
4093
|
const r = new Vue({
|
|
4058
4094
|
data() {
|
|
4059
4095
|
return { rule: t, option: e || {} };
|
|
@@ -4064,331 +4100,341 @@ function Ii(t, e) {
|
|
|
4064
4100
|
});
|
|
4065
4101
|
return r.$mount(), r;
|
|
4066
4102
|
}
|
|
4067
|
-
function
|
|
4103
|
+
function Ti(t) {
|
|
4068
4104
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4069
|
-
|
|
4105
|
+
St.push(...e), Ze.push(...r), Ye.push(...i), Bt([...e, ...r, ...i]);
|
|
4070
4106
|
}
|
|
4071
|
-
let
|
|
4072
|
-
const U = {},
|
|
4107
|
+
let Bi = 1;
|
|
4108
|
+
const U = {}, Ee = Symbol("defValue");
|
|
4073
4109
|
function Gt(t) {
|
|
4074
4110
|
const e = {
|
|
4075
4111
|
[Be.name]: Be
|
|
4076
4112
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4077
4113
|
t.extendApi
|
|
4078
|
-
], u = b({},
|
|
4079
|
-
let
|
|
4080
|
-
const
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
if (
|
|
4087
|
-
return
|
|
4114
|
+
], u = b({}, wi), f = Xr();
|
|
4115
|
+
let d = { global: {} };
|
|
4116
|
+
const g = t.isMobile === !0, m = ie({
|
|
4117
|
+
$mobile: g
|
|
4118
|
+
}), v = $i(), w = {}, j = {};
|
|
4119
|
+
Ti(t.attrs || {});
|
|
4120
|
+
function ee(c) {
|
|
4121
|
+
const p = U[c];
|
|
4122
|
+
if (Array.isArray(p))
|
|
4123
|
+
return p.map((y) => y.api());
|
|
4124
|
+
if (p)
|
|
4125
|
+
return p.api();
|
|
4088
4126
|
}
|
|
4089
|
-
function P(
|
|
4090
|
-
o.push(
|
|
4127
|
+
function P(c) {
|
|
4128
|
+
o.push(c);
|
|
4091
4129
|
}
|
|
4092
|
-
function
|
|
4093
|
-
const
|
|
4094
|
-
|
|
4130
|
+
function N() {
|
|
4131
|
+
const c = Le(...arguments);
|
|
4132
|
+
c.id && c.prop && (i[c.id] = c.prop);
|
|
4095
4133
|
}
|
|
4096
|
-
function
|
|
4097
|
-
const
|
|
4098
|
-
|
|
4099
|
-
name:
|
|
4134
|
+
function Ae() {
|
|
4135
|
+
const c = Le(...arguments);
|
|
4136
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(b({}, c.prop), {
|
|
4137
|
+
name: c.id
|
|
4100
4138
|
}));
|
|
4101
4139
|
}
|
|
4102
|
-
function
|
|
4103
|
-
|
|
4140
|
+
function be(c) {
|
|
4141
|
+
v.use(c);
|
|
4104
4142
|
}
|
|
4105
|
-
function
|
|
4106
|
-
const
|
|
4107
|
-
if (!
|
|
4108
|
-
const
|
|
4109
|
-
r[
|
|
4143
|
+
function F() {
|
|
4144
|
+
const c = Le(...arguments);
|
|
4145
|
+
if (!c.id || !c.prop) return ke;
|
|
4146
|
+
const p = G(c.id), y = c.prop, $ = y.merge === !0 ? r[p] : void 0;
|
|
4147
|
+
r[p] = Re(y, $ || ke), f[p] = I(p), y.maker && _(f, y.maker);
|
|
4110
4148
|
}
|
|
4111
|
-
function
|
|
4112
|
-
let
|
|
4113
|
-
if (h.String(
|
|
4114
|
-
if (
|
|
4115
|
-
return ["form-create", "formcreate"].indexOf(
|
|
4149
|
+
function D(c, p) {
|
|
4150
|
+
let y;
|
|
4151
|
+
if (h.String(c)) {
|
|
4152
|
+
if (y = c, p === void 0)
|
|
4153
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? B() : e[y];
|
|
4116
4154
|
} else
|
|
4117
|
-
|
|
4118
|
-
if (!
|
|
4119
|
-
const $ =
|
|
4120
|
-
e[
|
|
4155
|
+
y = G(c.name), p = c;
|
|
4156
|
+
if (!y || !p) return;
|
|
4157
|
+
const $ = G(y);
|
|
4158
|
+
e[y] = p, e[$] = p, delete v.aliasMap[y], delete v.aliasMap[$], delete r[y], delete r[$], p.formCreateParser && F(y, p.formCreateParser);
|
|
4121
4159
|
}
|
|
4122
4160
|
function B() {
|
|
4123
|
-
return
|
|
4161
|
+
return Nr(Ie, e, i);
|
|
4124
4162
|
}
|
|
4125
|
-
function
|
|
4163
|
+
function se() {
|
|
4126
4164
|
return Be;
|
|
4127
4165
|
}
|
|
4128
|
-
function
|
|
4129
|
-
return h.Function(
|
|
4166
|
+
function _e(c, p) {
|
|
4167
|
+
return h.Function(c.install) ? c.install(oe, p) : h.Function(c) && c(oe, p), this;
|
|
4130
4168
|
}
|
|
4131
|
-
function
|
|
4132
|
-
let $ =
|
|
4169
|
+
function oe(c, p, y) {
|
|
4170
|
+
let $ = Pi(c, p || {});
|
|
4133
4171
|
const C = $.$refs.fc.formCreate;
|
|
4134
|
-
return C.$parent =
|
|
4172
|
+
return C.$parent = y, Ii(C.options).appendChild($.$el), C.api();
|
|
4135
4173
|
}
|
|
4136
|
-
|
|
4137
|
-
function Wt(
|
|
4138
|
-
let
|
|
4139
|
-
return
|
|
4174
|
+
Re(oe, j);
|
|
4175
|
+
function Wt(c) {
|
|
4176
|
+
let p = b({}, t);
|
|
4177
|
+
return c ? p.inherit = {
|
|
4140
4178
|
components: e,
|
|
4141
4179
|
parsers: r,
|
|
4142
4180
|
directives: i,
|
|
4143
4181
|
modelFields: s,
|
|
4144
4182
|
providers: u,
|
|
4145
4183
|
useApps: o,
|
|
4146
|
-
maker:
|
|
4147
|
-
formulas:
|
|
4184
|
+
maker: f,
|
|
4185
|
+
formulas: w,
|
|
4148
4186
|
loadData: m
|
|
4149
|
-
} : delete
|
|
4187
|
+
} : delete p.inherit, Gt(p);
|
|
4150
4188
|
}
|
|
4151
|
-
function Kt(
|
|
4152
|
-
s[
|
|
4189
|
+
function Kt(c, p) {
|
|
4190
|
+
s[c] = p;
|
|
4153
4191
|
}
|
|
4154
|
-
function Xt(
|
|
4155
|
-
|
|
4192
|
+
function Xt(c, p) {
|
|
4193
|
+
w[c] = p;
|
|
4156
4194
|
}
|
|
4157
|
-
function zt(
|
|
4158
|
-
const
|
|
4159
|
-
|
|
4160
|
-
$[C] =
|
|
4161
|
-
}),
|
|
4195
|
+
function zt(c, p) {
|
|
4196
|
+
const y = n[c] || {}, $ = y.parsers || {};
|
|
4197
|
+
p.parsers && Object.keys(p.parsers).forEach((C) => {
|
|
4198
|
+
$[C] = Re(p.parsers[C], ke);
|
|
4199
|
+
}), p.name = c, n[c] = q(b(b({}, y), p), { parsers: $ });
|
|
4162
4200
|
}
|
|
4163
|
-
function
|
|
4164
|
-
|
|
4165
|
-
(Array.isArray(U[
|
|
4166
|
-
$.bus.$emit("$loadData." +
|
|
4201
|
+
function Ce(c) {
|
|
4202
|
+
c && Object.keys(U).forEach((p) => {
|
|
4203
|
+
(Array.isArray(U[p]) ? U[p] : [U[p]]).forEach(($) => {
|
|
4204
|
+
$.bus.$emit("$loadData." + c);
|
|
4167
4205
|
});
|
|
4168
4206
|
});
|
|
4169
4207
|
}
|
|
4170
|
-
function
|
|
4171
|
-
|
|
4208
|
+
function Ve(c, p) {
|
|
4209
|
+
ne(m, c, p), Ce(c);
|
|
4172
4210
|
}
|
|
4173
|
-
function
|
|
4174
|
-
const
|
|
4175
|
-
|
|
4211
|
+
function we(c, p) {
|
|
4212
|
+
const y = (...$) => O(() => p(...$));
|
|
4213
|
+
y._driver = !0, Ve(c, y);
|
|
4176
4214
|
}
|
|
4177
|
-
function nt(
|
|
4178
|
-
const
|
|
4179
|
-
|
|
4180
|
-
const $ =
|
|
4181
|
-
if (
|
|
4182
|
-
let C = m[
|
|
4183
|
-
return C && C._driver ? C = C($) :
|
|
4215
|
+
function nt(c, p) {
|
|
4216
|
+
const y = (c || "").split(".");
|
|
4217
|
+
c = y.shift();
|
|
4218
|
+
const $ = y.join(".");
|
|
4219
|
+
if (S(m, c) || R(m, c, Ee), m[c] !== Ee) {
|
|
4220
|
+
let C = m[c];
|
|
4221
|
+
return C && C._driver ? C = C($) : y.length && (C = M(C, y)), C == null || C === "" ? p : C;
|
|
4184
4222
|
} else
|
|
4185
|
-
return
|
|
4223
|
+
return p;
|
|
4186
4224
|
}
|
|
4187
|
-
function Qt(
|
|
4188
|
-
l.push(
|
|
4225
|
+
function Qt(c) {
|
|
4226
|
+
l.push(c);
|
|
4189
4227
|
}
|
|
4190
|
-
function Zt(
|
|
4191
|
-
delete m[
|
|
4228
|
+
function Zt(c) {
|
|
4229
|
+
delete m[c], Ce(c);
|
|
4192
4230
|
}
|
|
4193
|
-
function Yt(
|
|
4194
|
-
a.push({ name:
|
|
4231
|
+
function Yt(c, p) {
|
|
4232
|
+
a.push({ name: c, callback: p });
|
|
4195
4233
|
}
|
|
4196
|
-
function
|
|
4234
|
+
function Ie(c) {
|
|
4197
4235
|
_(this, {
|
|
4198
|
-
id:
|
|
4199
|
-
create:
|
|
4200
|
-
vm:
|
|
4201
|
-
manager:
|
|
4236
|
+
id: Bi++,
|
|
4237
|
+
create: oe,
|
|
4238
|
+
vm: c,
|
|
4239
|
+
manager: vi(t.manager),
|
|
4202
4240
|
parsers: r,
|
|
4203
4241
|
providers: u,
|
|
4204
4242
|
modelFields: s,
|
|
4205
|
-
formulas:
|
|
4206
|
-
isMobile:
|
|
4207
|
-
rules:
|
|
4208
|
-
name:
|
|
4209
|
-
inFor:
|
|
4243
|
+
formulas: w,
|
|
4244
|
+
isMobile: g,
|
|
4245
|
+
rules: c.$options.propsData.rule,
|
|
4246
|
+
name: c.$options.propsData.name || je(),
|
|
4247
|
+
inFor: c.$options.propsData.inFor,
|
|
4210
4248
|
prop: {
|
|
4211
4249
|
components: e,
|
|
4212
4250
|
directives: i
|
|
4213
4251
|
},
|
|
4214
4252
|
drivers: n,
|
|
4215
4253
|
renderDriver: null,
|
|
4216
|
-
|
|
4217
|
-
refreshData: _e,
|
|
4254
|
+
refreshData: Ce,
|
|
4218
4255
|
loadData: m,
|
|
4219
|
-
CreateNode:
|
|
4220
|
-
bus: new
|
|
4256
|
+
CreateNode: v,
|
|
4257
|
+
bus: new Oi(),
|
|
4221
4258
|
unwatch: [],
|
|
4222
|
-
options:
|
|
4259
|
+
options: dr({}),
|
|
4223
4260
|
extendApiFn: l,
|
|
4224
4261
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4225
|
-
tmpData:
|
|
4226
|
-
}), a.forEach((
|
|
4227
|
-
this.bus.$on(
|
|
4262
|
+
tmpData: ie({})
|
|
4263
|
+
}), a.forEach((p) => {
|
|
4264
|
+
this.bus.$on(p.name, p.callback);
|
|
4228
4265
|
}), T(() => {
|
|
4229
4266
|
L(this.options, () => {
|
|
4230
4267
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4231
4268
|
}, { deep: !0 });
|
|
4232
|
-
}), _(
|
|
4269
|
+
}), _(c.$options.components, e), _(c.$options.directives, i), this.$handle = new X(this), this.name && (this.inFor ? (U[this.name] || (U[this.name] = []), U[this.name].push(this)) : U[this.name] = this);
|
|
4233
4270
|
}
|
|
4234
|
-
|
|
4271
|
+
Ie.isMobile = g, _(Ie.prototype, {
|
|
4235
4272
|
init() {
|
|
4236
4273
|
this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
|
|
4237
4274
|
this.initOptions(), this.$handle.api.refresh();
|
|
4238
4275
|
}, { deep: !0 })), this.vm.$options.propsData.driver && (this.renderDriver = typeof this.vm.$options.propsData.driver == "object" ? this.vm.$options.propsData.driver : this.drivers[this.vm.$options.propsData.driver]), !this.renderDriver && this.vm.parent && (this.renderDriver = this.vm.parent.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
|
|
4239
4276
|
},
|
|
4240
|
-
targetFormDriver(
|
|
4241
|
-
if (this.renderDriver && this.renderDriver[
|
|
4242
|
-
return
|
|
4277
|
+
targetFormDriver(c, ...p) {
|
|
4278
|
+
if (this.renderDriver && this.renderDriver[c])
|
|
4279
|
+
return O(() => this.renderDriver[c](...p));
|
|
4243
4280
|
},
|
|
4244
|
-
t(
|
|
4245
|
-
let $ =
|
|
4246
|
-
return $ == null && ($ = ""), $ &&
|
|
4247
|
-
const
|
|
4248
|
-
$ = $.replace(
|
|
4281
|
+
t(c, p, y) {
|
|
4282
|
+
let $ = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
4283
|
+
return $ == null && ($ = ""), $ && p && Object.keys(p).forEach((C) => {
|
|
4284
|
+
const k = new RegExp(`{${C}}`, "g");
|
|
4285
|
+
$ = $.replace(k, p[C]);
|
|
4249
4286
|
}), $;
|
|
4250
4287
|
},
|
|
4251
|
-
globalDataDriver(
|
|
4252
|
-
let
|
|
4253
|
-
const
|
|
4288
|
+
globalDataDriver(c) {
|
|
4289
|
+
let p = c.split(".");
|
|
4290
|
+
const y = p.shift(), $ = this.options.value.globalData && this.options.value.globalData[y];
|
|
4254
4291
|
if ($) {
|
|
4255
4292
|
if ($.type === "static")
|
|
4256
|
-
return
|
|
4293
|
+
return M($.data, p);
|
|
4257
4294
|
{
|
|
4258
4295
|
let C;
|
|
4259
|
-
const
|
|
4260
|
-
if (
|
|
4261
|
-
if (
|
|
4296
|
+
const k = this.fetchCache.get($);
|
|
4297
|
+
if (k) {
|
|
4298
|
+
if (k.status && (C = M(k.data, p)), !k.loading)
|
|
4262
4299
|
return C;
|
|
4263
|
-
|
|
4300
|
+
k.loading = !1, this.fetchCache.set($, k);
|
|
4264
4301
|
} else
|
|
4265
4302
|
this.fetchCache.set($, { status: !1 });
|
|
4266
|
-
const
|
|
4267
|
-
|
|
4268
|
-
const
|
|
4269
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf($) !== -1 ? (
|
|
4270
|
-
}, $.wait || 600),
|
|
4271
|
-
this.fetchCache.set($, { status: !0, data:
|
|
4272
|
-
},
|
|
4273
|
-
if (
|
|
4274
|
-
return
|
|
4275
|
-
if (
|
|
4276
|
-
|
|
4303
|
+
const E = ce(() => {
|
|
4304
|
+
le();
|
|
4305
|
+
const J = this.fetchCache.get($);
|
|
4306
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf($) !== -1 ? (J && (J.loading = !0, this.fetchCache.set($, J)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete($);
|
|
4307
|
+
}, $.wait || 600), ae = (J) => {
|
|
4308
|
+
this.fetchCache.set($, { status: !0, data: J }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4309
|
+
}, z = (J, ue) => {
|
|
4310
|
+
if (ue && $.watch === !1)
|
|
4311
|
+
return le();
|
|
4312
|
+
if (ue) {
|
|
4313
|
+
E();
|
|
4277
4314
|
return;
|
|
4278
4315
|
}
|
|
4279
|
-
const
|
|
4280
|
-
this.$handle.api.fetch(
|
|
4281
|
-
|
|
4282
|
-
}).catch((
|
|
4283
|
-
|
|
4316
|
+
const de = this.$handle.loadFetchVar(Ge($), J);
|
|
4317
|
+
this.$handle.api.fetch(de).then((te) => {
|
|
4318
|
+
ae(te);
|
|
4319
|
+
}).catch((te) => {
|
|
4320
|
+
ae(null);
|
|
4284
4321
|
});
|
|
4285
|
-
},
|
|
4286
|
-
return this.unwatch.push(
|
|
4322
|
+
}, le = this.watchLoadData(z);
|
|
4323
|
+
return this.unwatch.push(le), C;
|
|
4287
4324
|
}
|
|
4288
4325
|
}
|
|
4289
4326
|
},
|
|
4290
4327
|
getLocale() {
|
|
4291
|
-
let
|
|
4292
|
-
return
|
|
4328
|
+
let c = this.vm.top.$props.locale;
|
|
4329
|
+
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4293
4330
|
},
|
|
4294
|
-
globalLanguageDriver(
|
|
4295
|
-
let
|
|
4296
|
-
if (
|
|
4331
|
+
globalLanguageDriver(c) {
|
|
4332
|
+
let p = this.vm.top.$props.locale, y;
|
|
4333
|
+
if (p && typeof p == "object" && (y = M(p, c)), y == null) {
|
|
4297
4334
|
const $ = this.options.value.language || {}, C = this.getLocale();
|
|
4298
|
-
|
|
4335
|
+
y = M($[C], c);
|
|
4299
4336
|
}
|
|
4300
|
-
return
|
|
4337
|
+
return y;
|
|
4301
4338
|
},
|
|
4302
|
-
globalVarDriver(
|
|
4303
|
-
|
|
4304
|
-
const g = d.shift(), $ = this.options.value.globalVariable && this.options.value.globalVariable[g];
|
|
4339
|
+
globalVarDriver(c) {
|
|
4340
|
+
const y = c.split(".").shift(), $ = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4305
4341
|
if ($) {
|
|
4306
4342
|
const C = h.Function($) ? $ : K($.handle);
|
|
4307
|
-
if (C)
|
|
4308
|
-
|
|
4343
|
+
if (C) {
|
|
4344
|
+
let k;
|
|
4345
|
+
const E = this.watchLoadData((ae, z) => {
|
|
4346
|
+
z ? (this.bus.$emit("$loadData.$var." + y), E()) : k = C(ae, this.$handle.api);
|
|
4347
|
+
});
|
|
4348
|
+
return this.unwatch.push(E), k;
|
|
4349
|
+
}
|
|
4309
4350
|
}
|
|
4310
4351
|
},
|
|
4311
|
-
setData(
|
|
4312
|
-
|
|
4352
|
+
setData(c, p, y) {
|
|
4353
|
+
y ? Ve(c, p) : (ne(this.vm.top.fc.tmpData, c, p), this.bus.$emit("$loadData." + c));
|
|
4313
4354
|
},
|
|
4314
|
-
getLoadData(
|
|
4315
|
-
let
|
|
4316
|
-
if (
|
|
4317
|
-
let $ =
|
|
4355
|
+
getLoadData(c, p) {
|
|
4356
|
+
let y = null;
|
|
4357
|
+
if (c != null) {
|
|
4358
|
+
let $ = c.split(".");
|
|
4318
4359
|
const C = $.shift();
|
|
4319
4360
|
if (C === "$topForm")
|
|
4320
|
-
|
|
4361
|
+
y = this.$handle.api.top.formData();
|
|
4321
4362
|
else if (C === "$form")
|
|
4322
|
-
|
|
4363
|
+
y = this.$handle.api.formData();
|
|
4323
4364
|
else if (C === "$options")
|
|
4324
|
-
|
|
4365
|
+
y = this.options.value;
|
|
4325
4366
|
else if (C === "$globalData")
|
|
4326
|
-
|
|
4367
|
+
y = this.globalDataDriver($.join(".")), $ = [];
|
|
4327
4368
|
else if (C === "$var")
|
|
4328
|
-
|
|
4369
|
+
y = this.globalVarDriver($.join(".")), $ = [];
|
|
4329
4370
|
else if (C === "$locale")
|
|
4330
|
-
|
|
4371
|
+
y = this.getLocale(), $ = [];
|
|
4331
4372
|
else if (C === "$t")
|
|
4332
|
-
|
|
4373
|
+
y = this.globalLanguageDriver($.join(".")), $ = [];
|
|
4333
4374
|
else {
|
|
4334
|
-
|
|
4335
|
-
|
|
4375
|
+
if (C === "$preview")
|
|
4376
|
+
return this.$handle.preview;
|
|
4377
|
+
{
|
|
4378
|
+
const k = this.vm.top.fc.tmpData;
|
|
4379
|
+
S(k, C) || R(k, C, Ee), y = k[C] !== Ee ? M(k, c) : nt(c), $ = [];
|
|
4380
|
+
}
|
|
4336
4381
|
}
|
|
4337
|
-
|
|
4382
|
+
y && $.length && (y = M(y, $));
|
|
4338
4383
|
}
|
|
4339
|
-
return
|
|
4340
|
-
},
|
|
4341
|
-
watchLoadData(
|
|
4342
|
-
let
|
|
4343
|
-
const $ = (
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
})
|
|
4347
|
-
}, C = (
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4384
|
+
return y == null || y === "" ? p : y;
|
|
4385
|
+
},
|
|
4386
|
+
watchLoadData(c, p) {
|
|
4387
|
+
let y = {};
|
|
4388
|
+
const $ = (E) => {
|
|
4389
|
+
O(() => {
|
|
4390
|
+
c(C, E);
|
|
4391
|
+
});
|
|
4392
|
+
}, C = (E, ae) => {
|
|
4393
|
+
let z;
|
|
4394
|
+
if (typeof E == "object" && (z = E.getValue, E = E.id), y[E])
|
|
4395
|
+
return y[E].val;
|
|
4396
|
+
const le = me(() => z ? z() : this.getLoadData(E, ae)), J = E.split("."), ue = J.shift(), de = J.shift() || "", te = ce(() => {
|
|
4397
|
+
const Pe = z ? z() : this.getLoadData(E, ae);
|
|
4398
|
+
if (y[E])
|
|
4399
|
+
JSON.stringify(Pe) !== JSON.stringify(y[E].val) && (y[E].val = Pe, $(!0));
|
|
4354
4400
|
else return;
|
|
4355
|
-
},
|
|
4356
|
-
|
|
4401
|
+
}, p || 0), er = L(le, (Pe) => {
|
|
4402
|
+
te();
|
|
4357
4403
|
});
|
|
4358
|
-
return this.bus.$on("$loadData." +
|
|
4404
|
+
return this.bus.$on("$loadData." + ue, te), de && this.bus.$on("$loadData." + ue + "." + de, te), y[E] = {
|
|
4359
4405
|
fn: () => {
|
|
4360
|
-
this.bus.$off("$loadData." +
|
|
4406
|
+
this.bus.$off("$loadData." + ue, te), de && this.bus.$off("$loadData." + ue + "." + de, te), er();
|
|
4361
4407
|
},
|
|
4362
|
-
val:
|
|
4363
|
-
},
|
|
4408
|
+
val: le.value
|
|
4409
|
+
}, le.value;
|
|
4364
4410
|
};
|
|
4365
4411
|
$(!1);
|
|
4366
|
-
const
|
|
4367
|
-
Object.keys(
|
|
4412
|
+
const k = () => {
|
|
4413
|
+
Object.keys(y).forEach((E) => y[E].fn()), y = {};
|
|
4368
4414
|
};
|
|
4369
|
-
return this.unwatch.push(
|
|
4415
|
+
return this.unwatch.push(k), k;
|
|
4370
4416
|
},
|
|
4371
4417
|
isSub() {
|
|
4372
4418
|
return this.vm.parent && this.vm.extendOption;
|
|
4373
4419
|
},
|
|
4374
4420
|
initOptions() {
|
|
4375
4421
|
this.options.value = {};
|
|
4376
|
-
let
|
|
4422
|
+
let c = b({
|
|
4377
4423
|
formData: {},
|
|
4378
4424
|
submitBtn: {},
|
|
4379
4425
|
resetBtn: {},
|
|
4380
4426
|
globalEvent: {},
|
|
4381
4427
|
globalData: {}
|
|
4382
|
-
}, W(
|
|
4383
|
-
this.isSub() && (
|
|
4428
|
+
}, W(d));
|
|
4429
|
+
this.isSub() && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$options.propsData.option || {}), this.updateOptions(c);
|
|
4384
4430
|
},
|
|
4385
|
-
mergeOptions(
|
|
4386
|
-
return
|
|
4387
|
-
delete
|
|
4388
|
-
}),
|
|
4431
|
+
mergeOptions(c, p, y) {
|
|
4432
|
+
return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach(($) => {
|
|
4433
|
+
delete p[$];
|
|
4434
|
+
}), p.global && (c.global = Gr(c.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], c), c;
|
|
4389
4435
|
},
|
|
4390
|
-
updateOptions(
|
|
4391
|
-
this.options.value = this.mergeOptions(this.options.value,
|
|
4436
|
+
updateOptions(c) {
|
|
4437
|
+
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
4392
4438
|
},
|
|
4393
4439
|
api() {
|
|
4394
4440
|
return this.$handle.api;
|
|
@@ -4402,86 +4448,86 @@ function Gt(t) {
|
|
|
4402
4448
|
unmount() {
|
|
4403
4449
|
if (this.name)
|
|
4404
4450
|
if (this.inFor) {
|
|
4405
|
-
const
|
|
4406
|
-
U[this.name].splice(
|
|
4451
|
+
const c = U[this.name].indexOf(this);
|
|
4452
|
+
U[this.name].splice(c, 1);
|
|
4407
4453
|
} else
|
|
4408
4454
|
delete U[this.name];
|
|
4409
|
-
a.forEach((
|
|
4410
|
-
this.bus.$off(
|
|
4411
|
-
}), this.tmpData = {}, this.unwatch.forEach((
|
|
4455
|
+
a.forEach((c) => {
|
|
4456
|
+
this.bus.$off(c.name, c.callback);
|
|
4457
|
+
}), this.tmpData = {}, this.unwatch.forEach((c) => c()), this.unwatch = [], this.$handle.reloadRule([]);
|
|
4412
4458
|
},
|
|
4413
4459
|
updated() {
|
|
4414
4460
|
this.$handle.bindNextTick(() => this.bus.$emit("next-tick", this.$handle.api));
|
|
4415
4461
|
}
|
|
4416
4462
|
});
|
|
4417
|
-
function st(
|
|
4418
|
-
_(
|
|
4463
|
+
function st(c) {
|
|
4464
|
+
_(c, {
|
|
4419
4465
|
version: t.version,
|
|
4420
4466
|
ui: t.ui,
|
|
4421
|
-
isMobile:
|
|
4467
|
+
isMobile: g,
|
|
4422
4468
|
extendApi: Qt,
|
|
4423
4469
|
getData: nt,
|
|
4424
|
-
setDataDriver:
|
|
4425
|
-
setData:
|
|
4470
|
+
setDataDriver: we,
|
|
4471
|
+
setData: Ve,
|
|
4426
4472
|
removeData: Zt,
|
|
4427
|
-
refreshData:
|
|
4428
|
-
maker:
|
|
4429
|
-
component:
|
|
4430
|
-
directive:
|
|
4473
|
+
refreshData: Ce,
|
|
4474
|
+
maker: f,
|
|
4475
|
+
component: D,
|
|
4476
|
+
directive: N,
|
|
4431
4477
|
setModelField: Kt,
|
|
4432
4478
|
setFormula: Xt,
|
|
4433
4479
|
setDriver: zt,
|
|
4434
|
-
register:
|
|
4435
|
-
$vnode:
|
|
4436
|
-
parser:
|
|
4437
|
-
use:
|
|
4480
|
+
register: Ae,
|
|
4481
|
+
$vnode: se,
|
|
4482
|
+
parser: F,
|
|
4483
|
+
use: _e,
|
|
4438
4484
|
factory: Wt,
|
|
4439
|
-
componentAlias:
|
|
4485
|
+
componentAlias: be,
|
|
4440
4486
|
copyRule: Vt,
|
|
4441
4487
|
copyRules: It,
|
|
4442
|
-
mergeRule:
|
|
4488
|
+
mergeRule: x,
|
|
4443
4489
|
fetch: Mt,
|
|
4444
4490
|
$form: B,
|
|
4445
4491
|
parseFn: K,
|
|
4446
4492
|
parseJson: At,
|
|
4447
4493
|
toJson: et,
|
|
4448
4494
|
useApp: P,
|
|
4449
|
-
getApi:
|
|
4495
|
+
getApi: ee,
|
|
4450
4496
|
on: Yt
|
|
4451
4497
|
});
|
|
4452
4498
|
}
|
|
4453
|
-
function xt(
|
|
4454
|
-
_(
|
|
4455
|
-
create:
|
|
4456
|
-
install(
|
|
4457
|
-
if (
|
|
4458
|
-
|
|
4459
|
-
const $ = function(
|
|
4460
|
-
return
|
|
4499
|
+
function xt(c) {
|
|
4500
|
+
_(c, {
|
|
4501
|
+
create: oe,
|
|
4502
|
+
install(p, y) {
|
|
4503
|
+
if (d = b(b({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4504
|
+
p._installedFormCreate = !0;
|
|
4505
|
+
const $ = function(k, E = {}) {
|
|
4506
|
+
return oe(k, E, this);
|
|
4461
4507
|
};
|
|
4462
|
-
st($),
|
|
4508
|
+
st($), p.prototype.$formCreate = $;
|
|
4463
4509
|
const C = B();
|
|
4464
|
-
|
|
4465
|
-
|
|
4510
|
+
p.component(C.name, C), p.component("FcFragment", se()), o.forEach((k) => {
|
|
4511
|
+
O(() => k(c, p));
|
|
4466
4512
|
});
|
|
4467
4513
|
}
|
|
4468
4514
|
});
|
|
4469
4515
|
}
|
|
4470
|
-
if (st(
|
|
4471
|
-
const
|
|
4472
|
-
|
|
4516
|
+
if (st(j), xt(j), we("$cookie", Di), we("$localStorage", ji), we("$sessionStorage", Ai), v.use({ fragment: "fcFragment" }), t.install && oe.use(t), F(Ri), t.inherit) {
|
|
4517
|
+
const c = t.inherit;
|
|
4518
|
+
c.components && _(e, c.components), c.parsers && _(r, c.parsers), c.directives && _(i, c.directives), c.modelFields && _(s, c.modelFields), c.providers && _(u, c.providers), c.useApps && _(o, c.useApps), c.maker && _(f, c.maker), c.loadData && _(m, c.loadData), c.formulas && _(w, c.formulas);
|
|
4473
4519
|
}
|
|
4474
|
-
const
|
|
4475
|
-
return
|
|
4520
|
+
const Oe = B();
|
|
4521
|
+
return Re(Oe, j), Object.defineProperties(Oe, {
|
|
4476
4522
|
fetch: {
|
|
4477
4523
|
get() {
|
|
4478
|
-
return
|
|
4524
|
+
return j.fetch;
|
|
4479
4525
|
},
|
|
4480
|
-
set(
|
|
4481
|
-
|
|
4526
|
+
set(c) {
|
|
4527
|
+
j.fetch = c;
|
|
4482
4528
|
}
|
|
4483
4529
|
}
|
|
4484
|
-
}),
|
|
4530
|
+
}), Oe.util = j, Oe;
|
|
4485
4531
|
}
|
|
4486
4532
|
const bt = {
|
|
4487
4533
|
date: "yyyy-MM-dd",
|
|
@@ -4492,7 +4538,7 @@ const bt = {
|
|
|
4492
4538
|
monthrange: "yyyy-MM",
|
|
4493
4539
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
4494
4540
|
year: "yyyy"
|
|
4495
|
-
}, _t = "datePicker",
|
|
4541
|
+
}, _t = "datePicker", Li = {
|
|
4496
4542
|
name: _t,
|
|
4497
4543
|
maker: function() {
|
|
4498
4544
|
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = I(_t, { type: e.toLowerCase() }), t), {});
|
|
@@ -4501,7 +4547,7 @@ const bt = {
|
|
|
4501
4547
|
const e = t.prop.props;
|
|
4502
4548
|
e.valueFormat || (e.valueFormat = bt[e.type] || bt.date);
|
|
4503
4549
|
}
|
|
4504
|
-
}, Me = "hidden",
|
|
4550
|
+
}, Me = "hidden", Mi = {
|
|
4505
4551
|
name: Me,
|
|
4506
4552
|
maker: {
|
|
4507
4553
|
[Me]: (t, e) => I(Me)("", t, e)
|
|
@@ -4509,7 +4555,7 @@ const bt = {
|
|
|
4509
4555
|
render() {
|
|
4510
4556
|
return [];
|
|
4511
4557
|
}
|
|
4512
|
-
}, Ne = "input",
|
|
4558
|
+
}, Ne = "input", Ni = {
|
|
4513
4559
|
name: Ne,
|
|
4514
4560
|
maker: function() {
|
|
4515
4561
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = I(Ne, { type: r }), e), {});
|
|
@@ -4519,7 +4565,7 @@ const bt = {
|
|
|
4519
4565
|
let { props: e } = t.prop;
|
|
4520
4566
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4521
4567
|
}
|
|
4522
|
-
}, Ct = "slider",
|
|
4568
|
+
}, Ct = "slider", qi = {
|
|
4523
4569
|
name: Ct,
|
|
4524
4570
|
maker: {
|
|
4525
4571
|
sliderRange: I(Ct, { range: !0 })
|
|
@@ -4528,7 +4574,7 @@ const bt = {
|
|
|
4528
4574
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
4529
4575
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
4530
4576
|
}
|
|
4531
|
-
}, qe = "timePicker",
|
|
4577
|
+
}, qe = "timePicker", Ui = {
|
|
4532
4578
|
name: qe,
|
|
4533
4579
|
maker: {
|
|
4534
4580
|
time: I(qe, (t) => t.props.isRange = !1),
|
|
@@ -4538,60 +4584,60 @@ const bt = {
|
|
|
4538
4584
|
const e = t.prop.props;
|
|
4539
4585
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
4540
4586
|
}
|
|
4541
|
-
},
|
|
4587
|
+
}, Hi = {
|
|
4542
4588
|
name: "FcRow",
|
|
4543
4589
|
render(t, e) {
|
|
4544
4590
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
4545
4591
|
e.vNode.row(e.prop, t)
|
|
4546
4592
|
]);
|
|
4547
4593
|
}
|
|
4548
|
-
},
|
|
4549
|
-
name:
|
|
4594
|
+
}, Gi = "select", Ji = {
|
|
4595
|
+
name: Gi,
|
|
4550
4596
|
toFormValue(t, e) {
|
|
4551
|
-
return e.prop.props.multiple && !Array.isArray(t) ?
|
|
4597
|
+
return e.prop.props.multiple && !Array.isArray(t) ? H(t) : t;
|
|
4552
4598
|
}
|
|
4553
|
-
},
|
|
4554
|
-
Bi,
|
|
4599
|
+
}, Wi = [
|
|
4555
4600
|
Li,
|
|
4556
4601
|
Mi,
|
|
4557
4602
|
Ni,
|
|
4558
4603
|
qi,
|
|
4559
4604
|
Ui,
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4605
|
+
Hi,
|
|
4606
|
+
Ji
|
|
4607
|
+
], A = "el", Ki = {
|
|
4608
|
+
button: A + "Button",
|
|
4563
4609
|
icon: "i",
|
|
4564
|
-
slider:
|
|
4565
|
-
rate:
|
|
4610
|
+
slider: A + "Slider",
|
|
4611
|
+
rate: A + "Rate",
|
|
4566
4612
|
upload: "fcUpload",
|
|
4567
|
-
cascader:
|
|
4568
|
-
popover:
|
|
4569
|
-
tooltip:
|
|
4570
|
-
colorPicker:
|
|
4571
|
-
timePicker:
|
|
4572
|
-
timeSelect:
|
|
4573
|
-
datePicker:
|
|
4574
|
-
switch:
|
|
4613
|
+
cascader: A + "Cascader",
|
|
4614
|
+
popover: A + "Popover",
|
|
4615
|
+
tooltip: A + "Tooltip",
|
|
4616
|
+
colorPicker: A + "ColorPicker",
|
|
4617
|
+
timePicker: A + "TimePicker",
|
|
4618
|
+
timeSelect: A + "TimeSelect",
|
|
4619
|
+
datePicker: A + "DatePicker",
|
|
4620
|
+
switch: A + "Switch",
|
|
4575
4621
|
select: "fcSelect",
|
|
4576
4622
|
checkbox: "fcCheckbox",
|
|
4577
4623
|
radio: "fcRadio",
|
|
4578
|
-
inputNumber:
|
|
4579
|
-
number:
|
|
4580
|
-
input:
|
|
4581
|
-
formItem:
|
|
4582
|
-
form:
|
|
4624
|
+
inputNumber: A + "InputNumber",
|
|
4625
|
+
number: A + "InputNumber",
|
|
4626
|
+
input: A + "Input",
|
|
4627
|
+
formItem: A + "FormItem",
|
|
4628
|
+
form: A + "Form",
|
|
4583
4629
|
frame: "fcFrame",
|
|
4584
|
-
col:
|
|
4585
|
-
row:
|
|
4630
|
+
col: A + "Col",
|
|
4631
|
+
row: A + "Row",
|
|
4586
4632
|
tree: "fcTree",
|
|
4587
|
-
autoComplete:
|
|
4588
|
-
auto:
|
|
4633
|
+
autoComplete: A + "Autocomplete",
|
|
4634
|
+
auto: A + "Autocomplete",
|
|
4589
4635
|
group: "fcGroup",
|
|
4590
4636
|
array: "fcGroup",
|
|
4591
4637
|
object: "fcSubForm",
|
|
4592
4638
|
subForm: "fcSubForm"
|
|
4593
4639
|
};
|
|
4594
|
-
function
|
|
4640
|
+
function Xi() {
|
|
4595
4641
|
return {
|
|
4596
4642
|
form: {
|
|
4597
4643
|
inline: !1,
|
|
@@ -4625,23 +4671,23 @@ function Ki() {
|
|
|
4625
4671
|
}
|
|
4626
4672
|
};
|
|
4627
4673
|
}
|
|
4628
|
-
function
|
|
4674
|
+
function zi(t) {
|
|
4629
4675
|
return t.type === "tooltip";
|
|
4630
4676
|
}
|
|
4631
4677
|
function wt(t, e) {
|
|
4632
|
-
|
|
4678
|
+
S(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4633
4679
|
}
|
|
4634
|
-
function
|
|
4680
|
+
function Q(t) {
|
|
4635
4681
|
return t === !1;
|
|
4636
4682
|
}
|
|
4637
|
-
function
|
|
4638
|
-
|
|
4683
|
+
function Qi(t, e) {
|
|
4684
|
+
S(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4639
4685
|
}
|
|
4640
4686
|
function Ue(t) {
|
|
4641
4687
|
const e = b({}, t);
|
|
4642
4688
|
return delete e.children, e;
|
|
4643
4689
|
}
|
|
4644
|
-
const
|
|
4690
|
+
const Zi = {
|
|
4645
4691
|
validate() {
|
|
4646
4692
|
const t = this.form();
|
|
4647
4693
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -4660,7 +4706,7 @@ const Qi = {
|
|
|
4660
4706
|
},
|
|
4661
4707
|
tidyOptions(t) {
|
|
4662
4708
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
4663
|
-
|
|
4709
|
+
Qi(t, e);
|
|
4664
4710
|
}), t;
|
|
4665
4711
|
},
|
|
4666
4712
|
tidyRule({ prop: t }) {
|
|
@@ -4678,11 +4724,11 @@ const Qi = {
|
|
|
4678
4724
|
wrap: {}
|
|
4679
4725
|
};
|
|
4680
4726
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4681
|
-
t.prop[r] =
|
|
4727
|
+
t.prop[r] = Y([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4682
4728
|
});
|
|
4683
4729
|
},
|
|
4684
4730
|
getDefaultOptions() {
|
|
4685
|
-
return
|
|
4731
|
+
return Xi();
|
|
4686
4732
|
},
|
|
4687
4733
|
update() {
|
|
4688
4734
|
const t = this.options.form;
|
|
@@ -4705,12 +4751,12 @@ const Qi = {
|
|
|
4705
4751
|
});
|
|
4706
4752
|
},
|
|
4707
4753
|
render(t) {
|
|
4708
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4754
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Q(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4709
4755
|
},
|
|
4710
4756
|
makeWrap(t, e) {
|
|
4711
4757
|
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r) && r.wrap.title !== !1, o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: l } = this.rule.props;
|
|
4712
4758
|
delete r.wrap.title;
|
|
4713
|
-
const u =
|
|
4759
|
+
const u = Q(r.wrap.show) ? e : this.$r(Y([r.wrap, {
|
|
4714
4760
|
props: q(b({
|
|
4715
4761
|
labelWidth: o === void 0 ? o : jt(o),
|
|
4716
4762
|
label: n ? r.title.title : void 0
|
|
@@ -4723,30 +4769,30 @@ const Qi = {
|
|
|
4723
4769
|
ref: t.wrapRef,
|
|
4724
4770
|
type: "formItem"
|
|
4725
4771
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4726
|
-
return a === !0 ||
|
|
4772
|
+
return a === !0 || Q(l) || Q(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4727
4773
|
},
|
|
4728
4774
|
isTitle(t) {
|
|
4729
4775
|
if (this.options.form.title === !1) return !1;
|
|
4730
4776
|
const e = t.title;
|
|
4731
|
-
return !(!e.title && !e.native ||
|
|
4777
|
+
return !(!e.title && !e.native || Q(e.show));
|
|
4732
4778
|
},
|
|
4733
4779
|
makeInfo(t, e, r) {
|
|
4734
|
-
var
|
|
4735
|
-
const i = b({}, t.title), s = b({}, t.info), n =
|
|
4736
|
-
title: (
|
|
4780
|
+
var f, d, g;
|
|
4781
|
+
const i = b({}, t.title), s = b({}, t.info), n = zi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
4782
|
+
title: (f = r.refRule) == null ? void 0 : f.__$title.value,
|
|
4737
4783
|
rule: r.rule,
|
|
4738
4784
|
options: this.options
|
|
4739
|
-
}) : ((
|
|
4740
|
-
if (!
|
|
4741
|
-
const
|
|
4785
|
+
}) : ((d = r.refRule) == null ? void 0 : d.__$title.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
4786
|
+
if (!Q(s.show) && (s.info || s.native) && !Q(s.icon)) {
|
|
4787
|
+
const m = {
|
|
4742
4788
|
type: s.type || "popover",
|
|
4743
4789
|
slot: "label",
|
|
4744
4790
|
props: Ue(s),
|
|
4745
4791
|
key: `${e}pop`
|
|
4746
4792
|
};
|
|
4747
|
-
delete
|
|
4793
|
+
delete m.props.icon, delete m.props.show, delete m.props.info, delete m.props.align, delete m.props.native;
|
|
4748
4794
|
const v = "content";
|
|
4749
|
-
s.info && !
|
|
4795
|
+
s.info && !S(m.props, v) && (m.props[v] = (g = r.refRule) == null ? void 0 : g.__$info.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(Y([s, m]), [
|
|
4750
4796
|
this.$r({
|
|
4751
4797
|
type: "i",
|
|
4752
4798
|
slot: n ? "default" : "reference",
|
|
@@ -4755,7 +4801,7 @@ const Qi = {
|
|
|
4755
4801
|
})
|
|
4756
4802
|
]));
|
|
4757
4803
|
}
|
|
4758
|
-
const u =
|
|
4804
|
+
const u = Y([i, {
|
|
4759
4805
|
props: Ue(i),
|
|
4760
4806
|
key: `${e}tit`,
|
|
4761
4807
|
class: "fc-form-title",
|
|
@@ -4784,7 +4830,7 @@ const Qi = {
|
|
|
4784
4830
|
},
|
|
4785
4831
|
makeFormBtn() {
|
|
4786
4832
|
let t = [];
|
|
4787
|
-
if (
|
|
4833
|
+
if (Q(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Q(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4788
4834
|
return;
|
|
4789
4835
|
const e = this.$r({
|
|
4790
4836
|
type: "formItem",
|
|
@@ -4831,26 +4877,26 @@ const Qi = {
|
|
|
4831
4877
|
key: `${this.key}b1`
|
|
4832
4878
|
}, [e]);
|
|
4833
4879
|
}
|
|
4834
|
-
},
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
function
|
|
4880
|
+
}, he = {};
|
|
4881
|
+
Yi(he);
|
|
4882
|
+
xi(he);
|
|
4883
|
+
en(he);
|
|
4884
|
+
tn(he);
|
|
4885
|
+
rn(he);
|
|
4886
|
+
function Yi(t) {
|
|
4841
4887
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4842
4888
|
t[e] = I(e);
|
|
4843
4889
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4844
4890
|
}
|
|
4845
|
-
function
|
|
4891
|
+
function xi(t) {
|
|
4846
4892
|
const e = "select", r = "multiple";
|
|
4847
4893
|
t.selectMultiple = I(e, { [r]: !0 }), t.selectOne = I(e, { [r]: !1 });
|
|
4848
4894
|
}
|
|
4849
|
-
function
|
|
4895
|
+
function en(t) {
|
|
4850
4896
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4851
4897
|
Object.keys(r).reduce((i, s) => (i[s] = I(e, { type: r[s] }), i), t);
|
|
4852
4898
|
}
|
|
4853
|
-
function
|
|
4899
|
+
function tn(t) {
|
|
4854
4900
|
const e = "upload", r = {
|
|
4855
4901
|
image: ["image", 0],
|
|
4856
4902
|
file: ["file", 0],
|
|
@@ -4859,7 +4905,7 @@ function en(t) {
|
|
|
4859
4905
|
};
|
|
4860
4906
|
Object.keys(r).reduce((i, s) => (i[s] = I(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4861
4907
|
}
|
|
4862
|
-
function
|
|
4908
|
+
function rn(t) {
|
|
4863
4909
|
const e = {
|
|
4864
4910
|
frameInputs: ["input", 0],
|
|
4865
4911
|
frameFiles: ["file", 0],
|
|
@@ -4873,7 +4919,7 @@ function tn(t) {
|
|
|
4873
4919
|
function Ot(t, e) {
|
|
4874
4920
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4875
4921
|
}
|
|
4876
|
-
function
|
|
4922
|
+
function nn(t, e) {
|
|
4877
4923
|
return {
|
|
4878
4924
|
formEl() {
|
|
4879
4925
|
return e.$manager.form();
|
|
@@ -4900,7 +4946,7 @@ function rn(t, e) {
|
|
|
4900
4946
|
const o = e.getFieldCtx(r);
|
|
4901
4947
|
if (!o) return;
|
|
4902
4948
|
const a = e.subForm[o.id], l = [e.$manager.validateField(o.id)];
|
|
4903
|
-
|
|
4949
|
+
H(a).forEach((u) => {
|
|
4904
4950
|
l.push(u.validate());
|
|
4905
4951
|
}), Promise.all(l).then(() => {
|
|
4906
4952
|
s(null), i && i(null);
|
|
@@ -4960,9 +5006,9 @@ function rn(t, e) {
|
|
|
4960
5006
|
return new Promise((s, n) => {
|
|
4961
5007
|
t.validate().then(() => {
|
|
4962
5008
|
let o = t.formData();
|
|
4963
|
-
h.Function(r) &&
|
|
5009
|
+
h.Function(r) && O(() => r(o, t)), h.Function(e.options.onSubmit) && O(() => e.options.onSubmit(o, t)), e.vm.$emit("submit", o, t), s(o);
|
|
4964
5010
|
}).catch((...o) => {
|
|
4965
|
-
h.Function(i) &&
|
|
5011
|
+
h.Function(i) && O(() => i(t, ...o)), n(...o);
|
|
4966
5012
|
});
|
|
4967
5013
|
});
|
|
4968
5014
|
}
|
|
@@ -4971,7 +5017,7 @@ function rn(t, e) {
|
|
|
4971
5017
|
const Jt = {
|
|
4972
5018
|
name: "required",
|
|
4973
5019
|
load(t, e, r) {
|
|
4974
|
-
const i =
|
|
5020
|
+
const i = sn(t.getValue());
|
|
4975
5021
|
if (i.required === !1)
|
|
4976
5022
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4977
5023
|
else {
|
|
@@ -4995,25 +5041,25 @@ const Jt = {
|
|
|
4995
5041
|
Jt.load(...t);
|
|
4996
5042
|
}
|
|
4997
5043
|
};
|
|
4998
|
-
function
|
|
5044
|
+
function sn(t) {
|
|
4999
5045
|
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 : {};
|
|
5000
5046
|
}
|
|
5001
|
-
function
|
|
5002
|
-
t.componentAlias(
|
|
5047
|
+
function on(t) {
|
|
5048
|
+
t.componentAlias(Ki), Mr.forEach((e) => {
|
|
5003
5049
|
t.component(e.name, e);
|
|
5004
|
-
}), t.register(Jt),
|
|
5050
|
+
}), t.register(Jt), Wi.forEach((e) => {
|
|
5005
5051
|
t.parser(e);
|
|
5006
|
-
}), Object.keys(
|
|
5007
|
-
t.maker[e] =
|
|
5052
|
+
}), Object.keys(he).forEach((e) => {
|
|
5053
|
+
t.maker[e] = he[e];
|
|
5008
5054
|
});
|
|
5009
5055
|
}
|
|
5010
|
-
function
|
|
5056
|
+
function an() {
|
|
5011
5057
|
return Gt({
|
|
5012
5058
|
ui: "element-ui",
|
|
5013
|
-
version: "2.7.
|
|
5014
|
-
manager:
|
|
5015
|
-
extendApi:
|
|
5016
|
-
install:
|
|
5059
|
+
version: "2.7.3",
|
|
5060
|
+
manager: Zi,
|
|
5061
|
+
extendApi: nn,
|
|
5062
|
+
install: on,
|
|
5017
5063
|
attrs: {
|
|
5018
5064
|
normal: ["col", "wrap"],
|
|
5019
5065
|
array: ["className"],
|
|
@@ -5021,10 +5067,10 @@ function on() {
|
|
|
5021
5067
|
}
|
|
5022
5068
|
});
|
|
5023
5069
|
}
|
|
5024
|
-
const ze =
|
|
5070
|
+
const ze = an();
|
|
5025
5071
|
typeof window != "undefined" && (window.formCreate = ze, window.Vue && ze.install(window.Vue));
|
|
5026
|
-
const
|
|
5072
|
+
const fn = ze.maker;
|
|
5027
5073
|
export {
|
|
5028
5074
|
ze as default,
|
|
5029
|
-
|
|
5075
|
+
fn as maker
|
|
5030
5076
|
};
|