@form-create/element-ui 2.7.2 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form-create.esm.js +849 -781
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
- package/src/core/manager.js +3 -3
- package/src/core/provider.js +1 -1
package/dist/form-create.esm.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/element-ui v2.7.
|
|
3
|
+
* @form-create/element-ui v2.7.4
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
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 $e, { getCurrentInstance as or, provide as ar, inject as lr, toRefs as lt, reactive as ne, onBeforeMount as ur, watch as B, onMounted as cr, onBeforeUnmount as fr, onUpdated as hr, nextTick as T, markRaw as ge, computed as ye, toRef as De, ref as dr } from "vue";
|
|
23
|
+
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", Fr = {
|
|
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,7 +496,7 @@ const Cr = "fcFrame", wr = {
|
|
|
496
496
|
mounted() {
|
|
497
497
|
this.$on("fc.closeModal", this.closeModal);
|
|
498
498
|
}
|
|
499
|
-
}, Or = "fcRadio",
|
|
499
|
+
}, Or = "fcRadio", Rr = {
|
|
500
500
|
name: Or,
|
|
501
501
|
props: {
|
|
502
502
|
formCreateInject: {
|
|
@@ -591,11 +591,11 @@ const Cr = "fcFrame", wr = {
|
|
|
591
591
|
return h.type(e, t);
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
|
-
function
|
|
594
|
+
function D(t, e) {
|
|
595
595
|
return {}.hasOwnProperty.call(t, e);
|
|
596
596
|
}
|
|
597
|
-
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) => D(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
625
625
|
},
|
|
626
626
|
mounted() {
|
|
627
627
|
this.$emit("fc.el", this.$refs.el);
|
|
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,7 +687,7 @@ 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
|
}
|
|
@@ -697,11 +697,11 @@ function ct(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(ct);
|
|
753
753
|
},
|
|
754
754
|
watch: {
|
|
755
755
|
value(t) {
|
|
756
|
-
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles =
|
|
756
|
+
this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(ct), this.uploadList = this.$refs.upload.uploadFiles);
|
|
757
757
|
},
|
|
758
758
|
limit(t, e) {
|
|
759
759
|
(e === 1 || t === 1) && this.update();
|
|
@@ -911,13 +911,13 @@ const jr = "fcUpload", Ar = {
|
|
|
911
911
|
}), this.$emit("fc.el", this.$refs.upload);
|
|
912
912
|
}
|
|
913
913
|
};
|
|
914
|
-
function
|
|
915
|
-
|
|
914
|
+
function E(t, e, r) {
|
|
915
|
+
$e.set(t, e, r);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
(
|
|
917
|
+
function ie(t, e) {
|
|
918
|
+
($e.del || $e.delete)(t, e);
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function _e(t, e = {}, r) {
|
|
921
921
|
let i = !1;
|
|
922
922
|
for (let s in e)
|
|
923
923
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
@@ -925,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 && E(t, s, []);
|
|
929
929
|
else if (n._clone && r !== void 0)
|
|
930
930
|
if (r)
|
|
931
|
-
n = n.getRule(), o &&
|
|
931
|
+
n = n.getRule(), o && E(t, s, {});
|
|
932
932
|
else {
|
|
933
|
-
|
|
933
|
+
E(t, s, n._clone());
|
|
934
934
|
continue;
|
|
935
935
|
}
|
|
936
936
|
else
|
|
937
|
-
o &&
|
|
938
|
-
t[s] =
|
|
937
|
+
o && E(t, s, {});
|
|
938
|
+
t[s] = _e(t[s], n, r);
|
|
939
939
|
} else
|
|
940
|
-
|
|
940
|
+
E(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
941
941
|
}
|
|
942
942
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
return
|
|
944
|
+
function X(t) {
|
|
945
|
+
return _e({}, { value: t }).value;
|
|
946
946
|
}
|
|
947
|
-
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) && E(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,13 +1038,13 @@ const Ir = "fcGroup", Pr = {
|
|
|
1038
1038
|
const s = i.$f.formData();
|
|
1039
1039
|
if (t === e)
|
|
1040
1040
|
i.$f.deferSyncValue(() => {
|
|
1041
|
-
|
|
1041
|
+
_e(i.rule, t), i.$f.setValue(s);
|
|
1042
1042
|
}, !0);
|
|
1043
1043
|
else {
|
|
1044
1044
|
const n = i.$f.formData();
|
|
1045
1045
|
i.$f.once("reloading", () => {
|
|
1046
1046
|
i.$f.setValue(n);
|
|
1047
|
-
}), i.rule =
|
|
1047
|
+
}), i.rule = X(t);
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
1050
|
});
|
|
@@ -1078,7 +1078,7 @@ const Ir = "fcGroup", Pr = {
|
|
|
1078
1078
|
},
|
|
1079
1079
|
methods: {
|
|
1080
1080
|
_value(t) {
|
|
1081
|
-
return t &&
|
|
1081
|
+
return t && D(t, this.field) ? t[this.field] : t;
|
|
1082
1082
|
},
|
|
1083
1083
|
cache(t, e) {
|
|
1084
1084
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1109,7 +1109,7 @@ const Ir = "fcGroup", Pr = {
|
|
|
1109
1109
|
};
|
|
1110
1110
|
if (this.defaultValue) {
|
|
1111
1111
|
i.formData || (i.formData = {});
|
|
1112
|
-
const s =
|
|
1112
|
+
const s = X(this.defaultValue);
|
|
1113
1113
|
_(i.formData, this.field ? {
|
|
1114
1114
|
[this.field]: s
|
|
1115
1115
|
} : s);
|
|
@@ -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, ...m) => this.emitEvent(d, m, a, o),
|
|
1237
|
+
input: (d) => this.add$f(a, o, d)
|
|
1238
1238
|
}
|
|
1239
1239
|
}, {}, {
|
|
1240
1240
|
props: {
|
|
@@ -1258,8 +1258,8 @@ const Ir = "fcGroup", Pr = {
|
|
|
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
|
-
wr,
|
|
1345
|
+
}, Mr = [
|
|
1346
|
+
Cr,
|
|
1348
1347
|
Fr,
|
|
1349
|
-
|
|
1348
|
+
Rr,
|
|
1350
1349
|
Sr,
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1350
|
+
Dr,
|
|
1351
|
+
Vr,
|
|
1352
|
+
Tr,
|
|
1353
|
+
Lr
|
|
1354
1354
|
];
|
|
1355
|
-
function
|
|
1355
|
+
function se(t, e) {
|
|
1356
1356
|
var r = null;
|
|
1357
1357
|
return function(...i) {
|
|
1358
1358
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1359
1359
|
};
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1361
|
+
function be(t) {
|
|
1362
1362
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1363
1363
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1364
1364
|
}
|
|
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,102 @@ 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: c, inFor:
|
|
1433
|
+
const { rule: l, value: u, subForm: c, inFor: d } = lt(s), m = ne({
|
|
1434
1434
|
ctxInject: {},
|
|
1435
1435
|
destroyed: !1,
|
|
1436
1436
|
isShow: !0,
|
|
1437
1437
|
unique: 1,
|
|
1438
1438
|
renderRule: [...l.value || []],
|
|
1439
1439
|
updateValue: JSON.stringify(u.value || {})
|
|
1440
|
-
}),
|
|
1440
|
+
}), g = new t(n), $ = g.api(), w = d.value, O = () => {
|
|
1441
1441
|
if (o) {
|
|
1442
|
-
const
|
|
1443
|
-
if (
|
|
1442
|
+
const R = Se(n, o);
|
|
1443
|
+
if (R) {
|
|
1444
1444
|
let S;
|
|
1445
|
-
w ? (S =
|
|
1445
|
+
w ? (S = H(R.getSubForm()), S.push($)) : S = $, R.subForm(S);
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
},
|
|
1449
|
-
const
|
|
1450
|
-
if (
|
|
1448
|
+
}, G = () => {
|
|
1449
|
+
const R = Se(n, o);
|
|
1450
|
+
if (R)
|
|
1451
1451
|
if (w) {
|
|
1452
|
-
const S =
|
|
1453
|
-
|
|
1452
|
+
const S = H(R.getSubForm()), N = S.indexOf($);
|
|
1453
|
+
N > -1 && S.splice(N, 1);
|
|
1454
1454
|
} else
|
|
1455
|
-
|
|
1455
|
+
R.subForm();
|
|
1456
1456
|
};
|
|
1457
1457
|
let P = null;
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
let
|
|
1458
|
+
ur(() => {
|
|
1459
|
+
B(() => {
|
|
1460
|
+
let R = "";
|
|
1461
1461
|
const S = s.option && s.option.globalClass || {};
|
|
1462
|
-
Object.keys(S).forEach((
|
|
1463
|
-
let
|
|
1464
|
-
S[
|
|
1465
|
-
|
|
1466
|
-
}), S[
|
|
1467
|
-
}), s.option && s.option.style && (
|
|
1462
|
+
Object.keys(S).forEach((N) => {
|
|
1463
|
+
let pe = "";
|
|
1464
|
+
S[N].style && Object.keys(S[N].style).forEach((W) => {
|
|
1465
|
+
pe += be(W) + ":" + S[N].style[W] + ";";
|
|
1466
|
+
}), S[N].content && (pe += S[N].content + ";"), pe && (R += `.${N}{${pe}}`);
|
|
1467
|
+
}), s.option && s.option.style && (R += s.option.style), P || (P = document.createElement("style"), P.type = "text/css", document.head.appendChild(P)), P.innerHTML = R || "";
|
|
1468
1468
|
}, () => {
|
|
1469
1469
|
});
|
|
1470
1470
|
});
|
|
1471
|
-
const M =
|
|
1472
|
-
|
|
1473
|
-
}, 100),
|
|
1474
|
-
|
|
1475
|
-
}, 100),
|
|
1476
|
-
|
|
1471
|
+
const M = se(() => {
|
|
1472
|
+
g.bus.$emit("$loadData.$topForm");
|
|
1473
|
+
}, 100), he = se(function() {
|
|
1474
|
+
g.bus.$emit("$loadData.$scopeForm");
|
|
1475
|
+
}, 100), Ae = se(() => {
|
|
1476
|
+
g.bus.$emit("$loadData.$form");
|
|
1477
|
+
}, 100), de = (R) => {
|
|
1478
|
+
g.bus.$emit("change-$form." + R);
|
|
1477
1479
|
};
|
|
1478
|
-
return
|
|
1479
|
-
o && (
|
|
1480
|
-
}), cr(() => {
|
|
1481
|
-
o && (v.top.bus.$off("$loadData.$form", M), v.top.bus.$off("change", ve)), P && document.head.removeChild(P), Y(), m.destroyed = !0, y.unmount();
|
|
1480
|
+
return cr(() => {
|
|
1481
|
+
o && ($.top.bus.$on("$loadData.$form", M), $.top.bus.$on("change", de)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", he), g.mounted();
|
|
1482
1482
|
}), fr(() => {
|
|
1483
|
-
|
|
1484
|
-
}),
|
|
1485
|
-
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
}),
|
|
1489
|
-
|
|
1490
|
-
}, { deep: !0 }),
|
|
1491
|
-
|
|
1492
|
-
}),
|
|
1493
|
-
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1483
|
+
o && ($.top.bus.$off("$loadData.$form", M), $.top.bus.$off("change", de)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", he), P && document.head.removeChild(P), G(), m.destroyed = !0, g.unmount();
|
|
1484
|
+
}), hr(() => {
|
|
1485
|
+
g.updated();
|
|
1486
|
+
}), B(c, (R) => {
|
|
1487
|
+
R ? O() : G();
|
|
1488
|
+
}, { immediate: !0 }), B(() => s.option, () => {
|
|
1489
|
+
g.initOptions(), $.refresh();
|
|
1490
|
+
}, { deep: !0 }), B(() => [...l.value], (R) => {
|
|
1491
|
+
g.$handle.isBreakWatch() || R.length === m.renderRule.length && R.every((S) => m.renderRule.indexOf(S) > -1) || (g.$handle.updateAppendData(), g.$handle.reloadRule(l.value), n.renderRule());
|
|
1492
|
+
}), B(() => [s.disabled, s.preview], () => {
|
|
1493
|
+
$.refresh();
|
|
1494
|
+
}), B(u, (R) => {
|
|
1495
|
+
JSON.stringify(R || {}) !== m.updateValue && ($.config.forceCoverValue ? $.coverValue(R || {}) : $.setValue(R || {}));
|
|
1496
|
+
}, { deep: !0, flush: "post" }), B(() => s.index, () => {
|
|
1497
|
+
$.coverValue({}), g.$handle.updateAppendData(), T(() => {
|
|
1496
1498
|
T(() => {
|
|
1497
|
-
|
|
1499
|
+
$.clearValidateState();
|
|
1498
1500
|
});
|
|
1499
1501
|
});
|
|
1500
1502
|
}, { flush: "sync" }), q(b({
|
|
1501
|
-
fc:
|
|
1502
|
-
parent: o &&
|
|
1503
|
-
top:
|
|
1504
|
-
fapi:
|
|
1503
|
+
fc: ge(g),
|
|
1504
|
+
parent: o && ge(o),
|
|
1505
|
+
top: ge(a),
|
|
1506
|
+
fapi: ge($)
|
|
1505
1507
|
}, lt(m)), {
|
|
1506
|
-
getGroupInject: () =>
|
|
1508
|
+
getGroupInject: () => Se(n, o),
|
|
1507
1509
|
refresh() {
|
|
1508
1510
|
++m.unique;
|
|
1509
1511
|
},
|
|
1510
1512
|
renderRule() {
|
|
1511
1513
|
m.renderRule = [...l.value || []];
|
|
1512
1514
|
},
|
|
1513
|
-
updateValue(
|
|
1515
|
+
updateValue(R) {
|
|
1514
1516
|
if (m.destroyed) return;
|
|
1515
|
-
const S = JSON.stringify(
|
|
1516
|
-
m.updateValue !== S && (m.updateValue = S, n.$emit("update:value",
|
|
1517
|
-
|
|
1517
|
+
const S = JSON.stringify(R);
|
|
1518
|
+
m.updateValue !== S && (m.updateValue = S, n.$emit("update:value", R), T(() => {
|
|
1519
|
+
Ae(), o ? c.value || he() : (M(), he());
|
|
1518
1520
|
}));
|
|
1519
1521
|
}
|
|
1520
1522
|
});
|
|
@@ -1524,39 +1526,39 @@ function Mr(t, e, r) {
|
|
|
1524
1526
|
}
|
|
1525
1527
|
};
|
|
1526
1528
|
}
|
|
1527
|
-
const
|
|
1528
|
-
const i = [...
|
|
1529
|
+
const Ot = ["attrs", "props", "domProps", "scopedSlots"], Rt = ["class", "style", "directives"], Et = ["on", "nativeOn", "hook"], ee = (t, e = {}, r = {}) => {
|
|
1530
|
+
const i = [...Ot, ...r.normal || []], s = [...Rt, ...r.array || []], n = [...Et, ...r.functional || []], o = r.props || [];
|
|
1529
1531
|
return t.reduce((a, l) => {
|
|
1530
1532
|
for (const u in l)
|
|
1531
1533
|
if (a[u])
|
|
1532
1534
|
if (o.indexOf(u) > -1)
|
|
1533
|
-
a[u] =
|
|
1535
|
+
a[u] = ee([l[u]], a[u]);
|
|
1534
1536
|
else if (i.indexOf(u) > -1)
|
|
1535
1537
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1536
1538
|
else if (s.indexOf(u) > -1) {
|
|
1537
|
-
const c = a[u] instanceof Array ? a[u] : [a[u]],
|
|
1538
|
-
a[u] = [...c, ...
|
|
1539
|
+
const c = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1540
|
+
a[u] = [...c, ...d];
|
|
1539
1541
|
} else if (n.indexOf(u) > -1)
|
|
1540
1542
|
for (const c in l[u])
|
|
1541
1543
|
if (a[u][c]) {
|
|
1542
|
-
const
|
|
1543
|
-
a[u][c] = [...
|
|
1544
|
+
const d = a[u][c] instanceof Array ? a[u][c] : [a[u][c]], m = l[u][c] instanceof Array ? l[u][c] : [l[u][c]];
|
|
1545
|
+
a[u][c] = [...d, ...m];
|
|
1544
1546
|
} else
|
|
1545
1547
|
a[u][c] = l[u][c];
|
|
1546
1548
|
else if (u === "hook")
|
|
1547
1549
|
for (let c in l[u])
|
|
1548
|
-
a[u][c] ? a[u][c] =
|
|
1550
|
+
a[u][c] ? a[u][c] = qr(a[u][c], l[u][c]) : a[u][c] = l[u][c];
|
|
1549
1551
|
else
|
|
1550
1552
|
a[u] = l[u];
|
|
1551
1553
|
else
|
|
1552
1554
|
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
1555
|
return a;
|
|
1554
1556
|
}, e);
|
|
1555
|
-
},
|
|
1557
|
+
}, qr = (t, e) => function() {
|
|
1556
1558
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1557
|
-
},
|
|
1558
|
-
function
|
|
1559
|
-
return [...
|
|
1559
|
+
}, St = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Ze = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1560
|
+
function kt() {
|
|
1561
|
+
return [...St, ...Ot, ...Rt, ...Et, ...Ze, ...Ye];
|
|
1560
1562
|
}
|
|
1561
1563
|
function Dt(t, e, r) {
|
|
1562
1564
|
return `[form-create ${t}]: ${e}`;
|
|
@@ -1564,7 +1566,7 @@ function Dt(t, e, r) {
|
|
|
1564
1566
|
function xe(t, e) {
|
|
1565
1567
|
console.error(Dt("err", t));
|
|
1566
1568
|
}
|
|
1567
|
-
function
|
|
1569
|
+
function Ur(t) {
|
|
1568
1570
|
xe(t.toString()), console.error(t);
|
|
1569
1571
|
}
|
|
1570
1572
|
function jt(t) {
|
|
@@ -1572,7 +1574,7 @@ function jt(t) {
|
|
|
1572
1574
|
}
|
|
1573
1575
|
const Je = "[[FORM-CREATE-PREFIX-", We = "-FORM-CREATE-SUFFIX]]";
|
|
1574
1576
|
function et(t, e) {
|
|
1575
|
-
return JSON.stringify(
|
|
1577
|
+
return JSON.stringify(_e(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1576
1578
|
if (!(i && i._isVue === !0)) {
|
|
1577
1579
|
if (typeof i != "function")
|
|
1578
1580
|
return i;
|
|
@@ -1583,10 +1585,10 @@ function et(t, e) {
|
|
|
1583
1585
|
}
|
|
1584
1586
|
}, e);
|
|
1585
1587
|
}
|
|
1586
|
-
function
|
|
1588
|
+
function Te(t) {
|
|
1587
1589
|
return new Function("return " + t)();
|
|
1588
1590
|
}
|
|
1589
|
-
function
|
|
1591
|
+
function z(t, e) {
|
|
1590
1592
|
if (t && h.String(t) && t.length > 4) {
|
|
1591
1593
|
let r = t.trim(), i = !1;
|
|
1592
1594
|
try {
|
|
@@ -1605,15 +1607,15 @@ function K(t, e) {
|
|
|
1605
1607
|
}, r.__json = t, r.__inject = !0, r;
|
|
1606
1608
|
} else {
|
|
1607
1609
|
if (r.indexOf("$FNX:") === 0)
|
|
1608
|
-
return r =
|
|
1610
|
+
return r = Te("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1609
1611
|
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1610
1612
|
}
|
|
1611
1613
|
if (!i) return t;
|
|
1612
1614
|
let s;
|
|
1613
1615
|
try {
|
|
1614
|
-
s =
|
|
1616
|
+
s = Te(r);
|
|
1615
1617
|
} catch (n) {
|
|
1616
|
-
s =
|
|
1618
|
+
s = Te("function " + r);
|
|
1617
1619
|
}
|
|
1618
1620
|
return s.__json = t, s;
|
|
1619
1621
|
} catch (s) {
|
|
@@ -1627,19 +1629,19 @@ err: ${s}`);
|
|
|
1627
1629
|
}
|
|
1628
1630
|
function At(t, e) {
|
|
1629
1631
|
return JSON.parse(t, function(r, i) {
|
|
1630
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1632
|
+
return h.Undef(i) || !i.indexOf ? i : z(i, e);
|
|
1631
1633
|
});
|
|
1632
1634
|
}
|
|
1633
|
-
let
|
|
1634
|
-
function
|
|
1635
|
-
const t = 370 + ++
|
|
1635
|
+
let Hr = 0;
|
|
1636
|
+
function je() {
|
|
1637
|
+
const t = 370 + ++Hr;
|
|
1636
1638
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1637
1639
|
}
|
|
1638
|
-
function
|
|
1640
|
+
function oe(t, e, r) {
|
|
1639
1641
|
let i = t, s;
|
|
1640
1642
|
return (e || "").split(".").forEach((n) => {
|
|
1641
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1642
|
-
}),
|
|
1643
|
+
s && ((!i[s] || typeof i[s] != "object") && E(i, s, {}), i = i[s]), s = n;
|
|
1644
|
+
}), E(i, s, r), i;
|
|
1643
1645
|
}
|
|
1644
1646
|
function Ke(t, e) {
|
|
1645
1647
|
return {
|
|
@@ -1653,18 +1655,18 @@ function Vt(t, e) {
|
|
|
1653
1655
|
return It([t], e || !1)[0];
|
|
1654
1656
|
}
|
|
1655
1657
|
function It(t, e) {
|
|
1656
|
-
return
|
|
1658
|
+
return _e([], [...t], e || !1);
|
|
1657
1659
|
}
|
|
1658
|
-
function
|
|
1659
|
-
return
|
|
1660
|
+
function te(t, e) {
|
|
1661
|
+
return ee(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
|
|
1660
1662
|
}
|
|
1661
1663
|
function ft(t) {
|
|
1662
1664
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1663
1665
|
return e.type || (e.type = "input"), e;
|
|
1664
1666
|
}
|
|
1665
|
-
function
|
|
1667
|
+
function Gr(t, e) {
|
|
1666
1668
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1667
|
-
e[r] && (t[r] =
|
|
1669
|
+
e[r] && (t[r] = te(t[r] || {}, e[r]));
|
|
1668
1670
|
}), t) : e;
|
|
1669
1671
|
}
|
|
1670
1672
|
function Pt(t, e) {
|
|
@@ -1674,26 +1676,26 @@ function Pt(t, e) {
|
|
|
1674
1676
|
}
|
|
1675
1677
|
}, r), {}));
|
|
1676
1678
|
}
|
|
1677
|
-
function
|
|
1679
|
+
function x(t) {
|
|
1678
1680
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1679
1681
|
}
|
|
1680
1682
|
function F(t, e) {
|
|
1681
1683
|
try {
|
|
1682
1684
|
e = t();
|
|
1683
1685
|
} catch (r) {
|
|
1684
|
-
|
|
1686
|
+
Ur(r);
|
|
1685
1687
|
}
|
|
1686
1688
|
return e;
|
|
1687
1689
|
}
|
|
1688
1690
|
function Xe(t, e) {
|
|
1689
1691
|
let r = null;
|
|
1690
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e &&
|
|
1692
|
+
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
1693
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1692
1694
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
1693
1695
|
});
|
|
1694
1696
|
}), r;
|
|
1695
1697
|
}
|
|
1696
|
-
function
|
|
1698
|
+
function Jr(t, e) {
|
|
1697
1699
|
if (h.Object(t)) {
|
|
1698
1700
|
const r = {};
|
|
1699
1701
|
return Object.keys(t).forEach((i) => {
|
|
@@ -1702,7 +1704,7 @@ function Gr(t, e) {
|
|
|
1702
1704
|
} else
|
|
1703
1705
|
return Xe(t, e);
|
|
1704
1706
|
}
|
|
1705
|
-
function
|
|
1707
|
+
function Oe() {
|
|
1706
1708
|
const t = {}, e = (r) => r || "default";
|
|
1707
1709
|
return {
|
|
1708
1710
|
setSlot(r, i) {
|
|
@@ -1718,7 +1720,7 @@ function Te() {
|
|
|
1718
1720
|
const n = s();
|
|
1719
1721
|
Array.isArray(n) ? i.push(...n) : i.push(n);
|
|
1720
1722
|
} else h.Undef(s) || i.push(s);
|
|
1721
|
-
}),
|
|
1723
|
+
}), Jr(i, r);
|
|
1722
1724
|
},
|
|
1723
1725
|
getSlots() {
|
|
1724
1726
|
let r = [];
|
|
@@ -1738,12 +1740,12 @@ function Te() {
|
|
|
1738
1740
|
}
|
|
1739
1741
|
};
|
|
1740
1742
|
}
|
|
1741
|
-
function
|
|
1743
|
+
function Re(t, e) {
|
|
1742
1744
|
return Object.setPrototypeOf(t, e), t;
|
|
1743
1745
|
}
|
|
1744
|
-
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1746
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, ce = {
|
|
1745
1747
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1746
|
-
"!=": (t, e) => !
|
|
1748
|
+
"!=": (t, e) => !ce["=="](t, e),
|
|
1747
1749
|
">": (t, e) => t > e,
|
|
1748
1750
|
">=": (t, e) => t >= e,
|
|
1749
1751
|
"<": (t, e) => t < e,
|
|
@@ -1752,13 +1754,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1752
1754
|
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1753
1755
|
},
|
|
1754
1756
|
notOn(t, e) {
|
|
1755
|
-
return !
|
|
1757
|
+
return !ce.on(t, e);
|
|
1756
1758
|
},
|
|
1757
1759
|
in(t, e) {
|
|
1758
1760
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1759
1761
|
},
|
|
1760
1762
|
notIn(t, e) {
|
|
1761
|
-
return !
|
|
1763
|
+
return !ce.in(t, e);
|
|
1762
1764
|
},
|
|
1763
1765
|
between(t, e) {
|
|
1764
1766
|
return t > e[0] && t < e[1];
|
|
@@ -1776,12 +1778,12 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1776
1778
|
return new RegExp(e, "g").test(t);
|
|
1777
1779
|
}
|
|
1778
1780
|
};
|
|
1779
|
-
function
|
|
1781
|
+
function L(t, e) {
|
|
1780
1782
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1781
1783
|
t != null && (t = t[r]);
|
|
1782
1784
|
}), t;
|
|
1783
1785
|
}
|
|
1784
|
-
function
|
|
1786
|
+
function Wr(t) {
|
|
1785
1787
|
const e = /{{\s*(.*?)\s*}}/g;
|
|
1786
1788
|
let r;
|
|
1787
1789
|
const i = {};
|
|
@@ -1821,7 +1823,7 @@ _(tt.prototype, {
|
|
|
1821
1823
|
return this._data;
|
|
1822
1824
|
},
|
|
1823
1825
|
setProp(t, e) {
|
|
1824
|
-
return
|
|
1826
|
+
return E(this._data, t, e), this;
|
|
1825
1827
|
},
|
|
1826
1828
|
_clone() {
|
|
1827
1829
|
const t = new this.constructor();
|
|
@@ -1831,13 +1833,13 @@ _(tt.prototype, {
|
|
|
1831
1833
|
function Bt(t) {
|
|
1832
1834
|
t.forEach((e) => {
|
|
1833
1835
|
tt.prototype[e] = function(r) {
|
|
1834
|
-
return
|
|
1836
|
+
return te(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1835
1837
|
};
|
|
1836
1838
|
});
|
|
1837
1839
|
}
|
|
1838
|
-
Bt(
|
|
1840
|
+
Bt(kt());
|
|
1839
1841
|
const Lt = I("");
|
|
1840
|
-
function
|
|
1842
|
+
function Kr(t, e, r) {
|
|
1841
1843
|
let i = Lt("", e);
|
|
1842
1844
|
return i._data.type = t, i._data.title = r, i;
|
|
1843
1845
|
}
|
|
@@ -1845,15 +1847,15 @@ function pt(t, e, r, i) {
|
|
|
1845
1847
|
let s = Lt("", r);
|
|
1846
1848
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1847
1849
|
}
|
|
1848
|
-
function
|
|
1850
|
+
function Xr() {
|
|
1849
1851
|
return {
|
|
1850
|
-
create:
|
|
1852
|
+
create: Kr,
|
|
1851
1853
|
createTmp: pt,
|
|
1852
1854
|
template: pt,
|
|
1853
1855
|
factory: I
|
|
1854
1856
|
};
|
|
1855
1857
|
}
|
|
1856
|
-
function
|
|
1858
|
+
function zr(t, e, r) {
|
|
1857
1859
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1858
1860
|
return s.status = r.status, s.url = t, s;
|
|
1859
1861
|
}
|
|
@@ -1876,13 +1878,13 @@ function Mt(t) {
|
|
|
1876
1878
|
n.percent = n.total > 0 ? n.loaded / n.total * 100 : 0, t.onProgress(n);
|
|
1877
1879
|
}), t.query) {
|
|
1878
1880
|
const n = new URLSearchParams(t.query).toString();
|
|
1879
|
-
r.includes("?") ? r += `&${n}` : r += `?${n}
|
|
1881
|
+
n && (r.includes("?") ? r += `&${n}` : r += `?${n}`);
|
|
1880
1882
|
}
|
|
1881
1883
|
e.onerror = function(o) {
|
|
1882
1884
|
t.onError(o);
|
|
1883
1885
|
}, e.onload = function() {
|
|
1884
1886
|
if (e.status < 200 || e.status >= 300)
|
|
1885
|
-
return t.onError(
|
|
1887
|
+
return t.onError(zr(r, t, e), mt(e));
|
|
1886
1888
|
t.onSuccess(mt(e));
|
|
1887
1889
|
}, e.open(t.method || "get", r, !0);
|
|
1888
1890
|
let i;
|
|
@@ -1899,8 +1901,8 @@ function gt(t, e, r) {
|
|
|
1899
1901
|
(e || Mt)(q(b({}, t), {
|
|
1900
1902
|
onSuccess(n) {
|
|
1901
1903
|
let o = (l) => l;
|
|
1902
|
-
const a =
|
|
1903
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1904
|
+
const a = z(t.parse);
|
|
1905
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n, void 0, r));
|
|
1904
1906
|
},
|
|
1905
1907
|
onError(n) {
|
|
1906
1908
|
s(n);
|
|
@@ -1908,17 +1910,17 @@ function gt(t, e, r) {
|
|
|
1908
1910
|
}));
|
|
1909
1911
|
});
|
|
1910
1912
|
}
|
|
1911
|
-
function
|
|
1912
|
-
return
|
|
1913
|
+
function ve(t) {
|
|
1914
|
+
return X(t);
|
|
1913
1915
|
}
|
|
1914
|
-
function
|
|
1916
|
+
function Qr(t) {
|
|
1915
1917
|
function e(n) {
|
|
1916
1918
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1917
1919
|
}
|
|
1918
1920
|
function r(n, o, a) {
|
|
1919
1921
|
e(n).forEach((l) => {
|
|
1920
1922
|
t.getCtxs(l).forEach((u) => {
|
|
1921
|
-
|
|
1923
|
+
E(u.rule, o, a), t.$render.clearCache(u);
|
|
1922
1924
|
});
|
|
1923
1925
|
});
|
|
1924
1926
|
}
|
|
@@ -1954,6 +1956,15 @@ function zr(t) {
|
|
|
1954
1956
|
get top() {
|
|
1955
1957
|
return s.parent ? s.parent.top : s;
|
|
1956
1958
|
},
|
|
1959
|
+
get scope() {
|
|
1960
|
+
let n = t.vm;
|
|
1961
|
+
for (; n && n.fapi; )
|
|
1962
|
+
if (n.$props.subForm)
|
|
1963
|
+
n = n.parent;
|
|
1964
|
+
else
|
|
1965
|
+
return n.fapi;
|
|
1966
|
+
return s.top;
|
|
1967
|
+
},
|
|
1957
1968
|
get children() {
|
|
1958
1969
|
return i();
|
|
1959
1970
|
},
|
|
@@ -1973,17 +1984,17 @@ function zr(t) {
|
|
|
1973
1984
|
}
|
|
1974
1985
|
},
|
|
1975
1986
|
formData(n) {
|
|
1976
|
-
if (n == null) {
|
|
1987
|
+
if (n == null || typeof n == "boolean") {
|
|
1977
1988
|
const o = {};
|
|
1978
1989
|
return Object.keys(t.form).forEach((a) => {
|
|
1979
|
-
t.ignoreFields.indexOf(a) === -1 && (o[a] =
|
|
1990
|
+
(n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] = ve(t.form[a]));
|
|
1980
1991
|
}), o;
|
|
1981
1992
|
} else
|
|
1982
1993
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
1983
1994
|
},
|
|
1984
1995
|
getValue(n) {
|
|
1985
1996
|
const o = t.getFieldCtx(n);
|
|
1986
|
-
return o ?
|
|
1997
|
+
return o ? ve(o.rule.value) : t.options.appendValue !== !1 && D(t.appendData, n) ? ve(t.appendData[n]) : void 0;
|
|
1987
1998
|
},
|
|
1988
1999
|
coverValue(n) {
|
|
1989
2000
|
const o = b({}, n || {});
|
|
@@ -1991,7 +2002,7 @@ function zr(t) {
|
|
|
1991
2002
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
1992
2003
|
const l = t.fieldCtx[a];
|
|
1993
2004
|
if (l) {
|
|
1994
|
-
const u =
|
|
2005
|
+
const u = D(n, a);
|
|
1995
2006
|
l.forEach((c) => {
|
|
1996
2007
|
c.rule.value = u ? n[a] : void 0;
|
|
1997
2008
|
}), delete o[a];
|
|
@@ -2020,7 +2031,7 @@ function zr(t) {
|
|
|
2020
2031
|
}, !0), o ? o.origin : void 0;
|
|
2021
2032
|
},
|
|
2022
2033
|
removeRule(n) {
|
|
2023
|
-
const o = n &&
|
|
2034
|
+
const o = n && x(n);
|
|
2024
2035
|
if (o)
|
|
2025
2036
|
return o.rm(), o.origin;
|
|
2026
2037
|
},
|
|
@@ -2070,7 +2081,7 @@ function zr(t) {
|
|
|
2070
2081
|
disabled(n, o) {
|
|
2071
2082
|
e(o).forEach((a) => {
|
|
2072
2083
|
t.getCtxs(a).forEach((l) => {
|
|
2073
|
-
|
|
2084
|
+
E(l.rule.props, "disabled", !!n);
|
|
2074
2085
|
});
|
|
2075
2086
|
}), t.refresh();
|
|
2076
2087
|
},
|
|
@@ -2109,7 +2120,7 @@ function zr(t) {
|
|
|
2109
2120
|
n.forEach((a) => s.sync(a));
|
|
2110
2121
|
return;
|
|
2111
2122
|
}
|
|
2112
|
-
let o = h.Object(n) ?
|
|
2123
|
+
let o = h.Object(n) ? x(n) : t.getCtxs(n);
|
|
2113
2124
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2114
2125
|
if (!a.deleted) {
|
|
2115
2126
|
const l = t.subForm[a.id];
|
|
@@ -2128,7 +2139,7 @@ function zr(t) {
|
|
|
2128
2139
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2129
2140
|
},
|
|
2130
2141
|
hideForm: (n) => {
|
|
2131
|
-
|
|
2142
|
+
E(t.vm, "isShow", !n);
|
|
2132
2143
|
},
|
|
2133
2144
|
changeStatus: () => t.changeStatus,
|
|
2134
2145
|
clearChangeStatus: () => {
|
|
@@ -2146,7 +2157,7 @@ function zr(t) {
|
|
|
2146
2157
|
},
|
|
2147
2158
|
mergeRule: (n, o) => {
|
|
2148
2159
|
t.getCtxs(n).forEach((a) => {
|
|
2149
|
-
|
|
2160
|
+
te(a.rule, o);
|
|
2150
2161
|
});
|
|
2151
2162
|
},
|
|
2152
2163
|
mergeRules(n) {
|
|
@@ -2173,7 +2184,7 @@ function zr(t) {
|
|
|
2173
2184
|
},
|
|
2174
2185
|
setEffect(n, o, a) {
|
|
2175
2186
|
const l = t.getCtx(n);
|
|
2176
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2187
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), D(l.rule, "$" + o) && E(l.rule, "$" + o, a), D(l.rule, "effect") || E(l.rule, "effect", {}), E(l.rule.effect, o, a));
|
|
2177
2188
|
},
|
|
2178
2189
|
clearEffectData(n, o) {
|
|
2179
2190
|
const a = t.getCtx(n);
|
|
@@ -2193,7 +2204,7 @@ function zr(t) {
|
|
|
2193
2204
|
resetFields(n) {
|
|
2194
2205
|
e(n).forEach((o) => {
|
|
2195
2206
|
t.getCtxs(o).forEach((a) => {
|
|
2196
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2207
|
+
t.$render.clearCache(a), a.rule.value = ve(a.defaultValue);
|
|
2197
2208
|
});
|
|
2198
2209
|
}), T(() => {
|
|
2199
2210
|
T(() => {
|
|
@@ -2232,21 +2243,21 @@ function zr(t) {
|
|
|
2232
2243
|
return o ? t.subForm[o.id] : void 0;
|
|
2233
2244
|
},
|
|
2234
2245
|
getChildrenRuleList(n) {
|
|
2235
|
-
const o = typeof n == "object", a = o ?
|
|
2246
|
+
const o = typeof n == "object", a = o ? x(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2236
2247
|
if (!l)
|
|
2237
2248
|
return [];
|
|
2238
2249
|
const u = [];
|
|
2239
|
-
return ((
|
|
2240
|
-
|
|
2250
|
+
return ((d) => {
|
|
2251
|
+
d && d.forEach((m) => {
|
|
2241
2252
|
typeof m == "object" && (m.field && u.push(m), u.push(...s.getChildrenRuleList(m)));
|
|
2242
2253
|
});
|
|
2243
2254
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2244
2255
|
},
|
|
2245
2256
|
getParentRule(n) {
|
|
2246
|
-
return (typeof n == "object" ?
|
|
2257
|
+
return (typeof n == "object" ? x(n) : t.getCtx(n)).parent.rule;
|
|
2247
2258
|
},
|
|
2248
2259
|
getParentSubRule(n) {
|
|
2249
|
-
const a = typeof n == "object" ?
|
|
2260
|
+
const a = typeof n == "object" ? x(n) : t.getCtx(n);
|
|
2250
2261
|
if (a) {
|
|
2251
2262
|
const l = a.getParentGroup();
|
|
2252
2263
|
if (l)
|
|
@@ -2254,20 +2265,20 @@ function zr(t) {
|
|
|
2254
2265
|
}
|
|
2255
2266
|
},
|
|
2256
2267
|
getChildrenFormData(n) {
|
|
2257
|
-
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] =
|
|
2268
|
+
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] = ve(l.value), a), {});
|
|
2258
2269
|
},
|
|
2259
2270
|
setChildrenFormData(n, o, a) {
|
|
2260
2271
|
const l = s.getChildrenRuleList(n);
|
|
2261
2272
|
t.deferSyncValue(() => {
|
|
2262
2273
|
l.forEach((u) => {
|
|
2263
|
-
|
|
2274
|
+
D(o, u.field) ? u.value = o[u.field] : a && (u.value = void 0);
|
|
2264
2275
|
});
|
|
2265
2276
|
});
|
|
2266
2277
|
},
|
|
2267
2278
|
getGlobalEvent(n) {
|
|
2268
2279
|
let o = s.options.globalEvent[n];
|
|
2269
2280
|
if (o)
|
|
2270
|
-
return typeof o == "object" && (o = o.handle),
|
|
2281
|
+
return typeof o == "object" && (o = o.handle), z(o);
|
|
2271
2282
|
},
|
|
2272
2283
|
getGlobalData(n) {
|
|
2273
2284
|
return new Promise((o, a) => {
|
|
@@ -2277,6 +2288,14 @@ function zr(t) {
|
|
|
2277
2288
|
}).catch(a) : o(l.data);
|
|
2278
2289
|
});
|
|
2279
2290
|
},
|
|
2291
|
+
renderRule(n, o, a) {
|
|
2292
|
+
const u = typeof n == "object" ? x(n) : t.getCtx(n);
|
|
2293
|
+
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2294
|
+
},
|
|
2295
|
+
renderChildren(n, o, a) {
|
|
2296
|
+
const u = typeof n == "object" ? x(n) : t.getCtx(n);
|
|
2297
|
+
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2298
|
+
},
|
|
2280
2299
|
nextTick(n) {
|
|
2281
2300
|
t.bus.$once("next-tick", n), t.refresh();
|
|
2282
2301
|
},
|
|
@@ -2292,7 +2311,7 @@ function zr(t) {
|
|
|
2292
2311
|
bus: t.bus,
|
|
2293
2312
|
fetch(n) {
|
|
2294
2313
|
return new Promise((o, a) => {
|
|
2295
|
-
n =
|
|
2314
|
+
n = X(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2296
2315
|
F(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2297
2316
|
}).catch((l) => {
|
|
2298
2317
|
F(() => n.onError && n.onError(l)), a(l);
|
|
@@ -2301,16 +2320,16 @@ function zr(t) {
|
|
|
2301
2320
|
},
|
|
2302
2321
|
watchFetch(n, o, a, l) {
|
|
2303
2322
|
return t.fc.watchLoadData((u, c) => {
|
|
2304
|
-
let
|
|
2305
|
-
|
|
2306
|
-
F(() =>
|
|
2323
|
+
let d = X(n);
|
|
2324
|
+
d = t.loadFetchVar(d, u), !(l && l(d, c) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((m) => {
|
|
2325
|
+
F(() => d.onSuccess && d.onSuccess(m)), o && o(m, c);
|
|
2307
2326
|
}).catch((m) => {
|
|
2308
|
-
F(() =>
|
|
2327
|
+
F(() => d.onError && d.onError(m)), a && a(m);
|
|
2309
2328
|
}));
|
|
2310
2329
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2311
2330
|
},
|
|
2312
2331
|
getData(n, o) {
|
|
2313
|
-
return t.fc.getLoadData(n, o);
|
|
2332
|
+
return t.fc.get ? t.fc.get(n, o) : t.fc.getLoadData(n, o);
|
|
2314
2333
|
},
|
|
2315
2334
|
setData(n, o, a) {
|
|
2316
2335
|
return t.fc.setData(n, o, a);
|
|
@@ -2335,7 +2354,7 @@ function zr(t) {
|
|
|
2335
2354
|
};
|
|
2336
2355
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2337
2356
|
}
|
|
2338
|
-
function
|
|
2357
|
+
function Zr(t) {
|
|
2339
2358
|
_(t.prototype, {
|
|
2340
2359
|
initCache() {
|
|
2341
2360
|
this.clearCacheAll();
|
|
@@ -2376,7 +2395,7 @@ function J(t) {
|
|
|
2376
2395
|
function Nt(t) {
|
|
2377
2396
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2378
2397
|
}
|
|
2379
|
-
function
|
|
2398
|
+
function Yr(t) {
|
|
2380
2399
|
_(t.prototype, {
|
|
2381
2400
|
initRender() {
|
|
2382
2401
|
this.cacheConfig = {};
|
|
@@ -2385,7 +2404,7 @@ function Zr(t) {
|
|
|
2385
2404
|
const r = (i) => {
|
|
2386
2405
|
if (i) {
|
|
2387
2406
|
let s;
|
|
2388
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2407
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + be(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + be(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2389
2408
|
}
|
|
2390
2409
|
};
|
|
2391
2410
|
return r(this.vm);
|
|
@@ -2394,7 +2413,7 @@ function Zr(t) {
|
|
|
2394
2413
|
if (!this.vm.isShow)
|
|
2395
2414
|
return;
|
|
2396
2415
|
this.$manager.beforeRender();
|
|
2397
|
-
const e =
|
|
2416
|
+
const e = Oe();
|
|
2398
2417
|
return this.sort.forEach((r) => {
|
|
2399
2418
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2400
2419
|
}), this.$manager.render(e);
|
|
@@ -2405,23 +2424,23 @@ function Zr(t) {
|
|
|
2405
2424
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2406
2425
|
},
|
|
2407
2426
|
mergeGlobal(e) {
|
|
2408
|
-
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] =
|
|
2427
|
+
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = ye(() => {
|
|
2409
2428
|
const i = this.$handle.options.global;
|
|
2410
|
-
return
|
|
2411
|
-
})), e.prop =
|
|
2429
|
+
return te({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2430
|
+
})), e.prop = te({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2412
2431
|
},
|
|
2413
2432
|
setOptions(e) {
|
|
2414
2433
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2415
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2434
|
+
e.prop.options = r, e.prop.optionsTo && r && oe(e.prop, e.prop.optionsTo, r);
|
|
2416
2435
|
},
|
|
2417
2436
|
deepSet(e) {
|
|
2418
2437
|
const r = e.rule.deep;
|
|
2419
2438
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2420
|
-
|
|
2439
|
+
oe(e.prop, i, r[i]);
|
|
2421
2440
|
});
|
|
2422
2441
|
},
|
|
2423
2442
|
parseSide(e, r) {
|
|
2424
|
-
return h.Object(e) ?
|
|
2443
|
+
return h.Object(e) ? te({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2425
2444
|
},
|
|
2426
2445
|
renderSides(e, r, i) {
|
|
2427
2446
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2435,7 +2454,7 @@ function Zr(t) {
|
|
|
2435
2454
|
try {
|
|
2436
2455
|
if (e.type === "hidden") return;
|
|
2437
2456
|
const i = e.rule;
|
|
2438
|
-
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2457
|
+
if (this.force || !this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2439
2458
|
let s;
|
|
2440
2459
|
e.initProp(), this.mergeGlobal(e), e.initNone(), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2441
2460
|
let n = e.prop;
|
|
@@ -2457,19 +2476,21 @@ function Zr(t) {
|
|
|
2457
2476
|
};
|
|
2458
2477
|
l.length && i.slotUpdate && F(() => i.slotUpdate(u));
|
|
2459
2478
|
let c = [];
|
|
2460
|
-
const
|
|
2461
|
-
e.parser.renderChildren ? c = e.parser.renderChildren(
|
|
2479
|
+
const d = e.loadChildrenPending();
|
|
2480
|
+
e.parser.renderChildren ? c = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
|
|
2462
2481
|
c.push(this.renderRule({
|
|
2463
2482
|
type: "template",
|
|
2464
|
-
slot:
|
|
2483
|
+
slot: $
|
|
2465
2484
|
}, (() => {
|
|
2466
|
-
|
|
2485
|
+
if (h.Function(n.renderSlots[$]))
|
|
2486
|
+
return F(() => n.renderSlots[$]());
|
|
2487
|
+
const w = this.parseSide(n.renderSlots[$], e);
|
|
2467
2488
|
return this.renderRule(w);
|
|
2468
2489
|
})()));
|
|
2469
2490
|
});
|
|
2470
2491
|
const m = this.getTypeSlot(e);
|
|
2471
|
-
let
|
|
2472
|
-
return m ? (u.children = c,
|
|
2492
|
+
let g;
|
|
2493
|
+
return m ? (u.children = c, g = m(u)) : g = a ? e.parser.preview(Ge(c), e) : e.parser.render(Ge(c), e), g = this.renderSides(g, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), g = this.$manager.makeWrap(e, g)), e.none && (Array.isArray(g) ? g = g.map(($) => !$ || !$.tag ? $ : this.none($)) : g = this.none(g)), o && this.setCache(e, () => this.stable(g), r), g;
|
|
2473
2494
|
}, this.setCache(e, s, r);
|
|
2474
2495
|
}
|
|
2475
2496
|
return (...s) => {
|
|
@@ -2563,17 +2584,21 @@ function Zr(t) {
|
|
|
2563
2584
|
}
|
|
2564
2585
|
}
|
|
2565
2586
|
];
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
this.
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2587
|
+
if (e.input) {
|
|
2588
|
+
const o = this.tmpInput;
|
|
2589
|
+
this.vm.$props.disabled === !0 && (e.prop.props.disabled = !0), e.prop.model = {
|
|
2590
|
+
value: this.$handle.getFormData(e),
|
|
2591
|
+
callback: (a) => {
|
|
2592
|
+
o && o(e.field, a, e.rule), this.onInput(e, a);
|
|
2593
|
+
},
|
|
2594
|
+
expression: `formData.${e.id}`
|
|
2595
|
+
}, e.prop.modelEmit && n.push({
|
|
2596
|
+
on: {
|
|
2597
|
+
[e.prop.modelEmit]: () => this.onEmitInput(e)
|
|
2598
|
+
}
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
return ee(n, e.prop), e.prop;
|
|
2577
2602
|
},
|
|
2578
2603
|
onMounted(e) {
|
|
2579
2604
|
e.el = this.vm.$refs[e.ref], e.el && ((e.el.$el || e.el).__rule__ = e.rule), e.parser.mounted(e), this.$handle.effect(e, "mounted"), this.$handle.targetHook(e, "mounted");
|
|
@@ -2590,7 +2615,7 @@ function Zr(t) {
|
|
|
2590
2615
|
},
|
|
2591
2616
|
renderChildren(e, r, i) {
|
|
2592
2617
|
if (!h.trueArray(e)) return [];
|
|
2593
|
-
const s =
|
|
2618
|
+
const s = Oe();
|
|
2594
2619
|
return e.map((n) => {
|
|
2595
2620
|
if (n) {
|
|
2596
2621
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2609,6 +2634,16 @@ function Zr(t) {
|
|
|
2609
2634
|
const i = e.prop;
|
|
2610
2635
|
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
2636
|
},
|
|
2637
|
+
createChildrenVnodes(e, r, i) {
|
|
2638
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2639
|
+
const s = this.renderChildren(e.rule.children, e);
|
|
2640
|
+
return this.force = !1, this.tmpInput = null, s;
|
|
2641
|
+
},
|
|
2642
|
+
createRuleVnode(e, r, i) {
|
|
2643
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2644
|
+
const s = Oe();
|
|
2645
|
+
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2646
|
+
},
|
|
2612
2647
|
renderRule(e, r, i) {
|
|
2613
2648
|
if (!e) return;
|
|
2614
2649
|
if (h.String(e)) return e;
|
|
@@ -2621,7 +2656,7 @@ function Zr(t) {
|
|
|
2621
2656
|
a && (s = J(a));
|
|
2622
2657
|
}
|
|
2623
2658
|
if (!s) return;
|
|
2624
|
-
const n =
|
|
2659
|
+
const n = Oe();
|
|
2625
2660
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2626
2661
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2627
2662
|
});
|
|
@@ -2630,7 +2665,7 @@ function Zr(t) {
|
|
|
2630
2665
|
}
|
|
2631
2666
|
});
|
|
2632
2667
|
}
|
|
2633
|
-
let
|
|
2668
|
+
let xr = 1;
|
|
2634
2669
|
function rt(t) {
|
|
2635
2670
|
_(this, {
|
|
2636
2671
|
$handle: t,
|
|
@@ -2638,7 +2673,9 @@ function rt(t) {
|
|
|
2638
2673
|
vm: t.vm,
|
|
2639
2674
|
$manager: t.$manager,
|
|
2640
2675
|
vNode: new t.fc.CreateNode(t.vm),
|
|
2641
|
-
|
|
2676
|
+
force: !1,
|
|
2677
|
+
tmpInput: null,
|
|
2678
|
+
id: xr++
|
|
2642
2679
|
}), Pt(this, {
|
|
2643
2680
|
options() {
|
|
2644
2681
|
return t.options;
|
|
@@ -2648,9 +2685,9 @@ function rt(t) {
|
|
|
2648
2685
|
}
|
|
2649
2686
|
}), this.initCache(), this.initRender();
|
|
2650
2687
|
}
|
|
2651
|
-
Qr(rt);
|
|
2652
2688
|
Zr(rt);
|
|
2653
|
-
|
|
2689
|
+
Yr(rt);
|
|
2690
|
+
function ei(t) {
|
|
2654
2691
|
_(t.prototype, {
|
|
2655
2692
|
parseInjectEvent(e, r) {
|
|
2656
2693
|
const i = e.inject || this.options.injectEvent;
|
|
@@ -2668,7 +2705,7 @@ function xr(t) {
|
|
|
2668
2705
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2669
2706
|
return this.parseEventLst(e, r, i, !0);
|
|
2670
2707
|
if (h.String(r)) {
|
|
2671
|
-
const n =
|
|
2708
|
+
const n = z(r);
|
|
2672
2709
|
if (n && r !== n)
|
|
2673
2710
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2674
2711
|
}
|
|
@@ -2677,17 +2714,17 @@ function xr(t) {
|
|
|
2677
2714
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2678
2715
|
return h.trueArray(u) && u.forEach((c) => {
|
|
2679
2716
|
if (!c) return;
|
|
2680
|
-
let
|
|
2681
|
-
if (h.Object(c) && (
|
|
2717
|
+
let d, m = n || o || a;
|
|
2718
|
+
if (h.Object(c) && (d = c.inject, c = c.name, m = c.prefix || m), m) {
|
|
2682
2719
|
r || (m = `native-${m}`);
|
|
2683
|
-
const
|
|
2684
|
-
this.vm.$emit(
|
|
2720
|
+
const g = be(`${m}-${c}`), $ = (...w) => {
|
|
2721
|
+
this.vm.$emit(g, ...w), this.vm.$emit("emit-event", g, ...w), this.bus.$emit(g, ...w);
|
|
2685
2722
|
};
|
|
2686
|
-
if (
|
|
2687
|
-
i[c] =
|
|
2723
|
+
if ($.__emit = !0, !d && l === !1)
|
|
2724
|
+
i[c] = $;
|
|
2688
2725
|
else {
|
|
2689
|
-
let w =
|
|
2690
|
-
i[c] = h.Undef(w) ?
|
|
2726
|
+
let w = d || l || this.options.injectEvent;
|
|
2727
|
+
i[c] = h.Undef(w) ? $ : this.inject(s, $, w);
|
|
2691
2728
|
}
|
|
2692
2729
|
}
|
|
2693
2730
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2715,41 +2752,51 @@ function xr(t) {
|
|
|
2715
2752
|
};
|
|
2716
2753
|
return n.__origin = r, n.__json = r.__json, n;
|
|
2717
2754
|
},
|
|
2718
|
-
loadStrVar(e, r) {
|
|
2755
|
+
loadStrVar(e, r, i) {
|
|
2719
2756
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2720
|
-
const
|
|
2721
|
-
let
|
|
2722
|
-
if (
|
|
2723
|
-
const
|
|
2724
|
-
if (
|
|
2725
|
-
const
|
|
2726
|
-
|
|
2757
|
+
const s = e, n = Wr(e);
|
|
2758
|
+
let o;
|
|
2759
|
+
if (n.forEach((a) => {
|
|
2760
|
+
const l = a.split("||"), u = l[0].trim();
|
|
2761
|
+
if (u) {
|
|
2762
|
+
const c = (l[1] || "").trim();
|
|
2763
|
+
let d, m = !1;
|
|
2764
|
+
if (i && u.indexOf("$form.") === 0) {
|
|
2765
|
+
const g = u.split(".");
|
|
2766
|
+
g.shift(), D(i.value, g[0]) && (m = !0, d = r ? r({
|
|
2767
|
+
id: "$form." + g[0] + "_" + i.rule.__fc__.id,
|
|
2768
|
+
getValue: () => L(i.value, g)
|
|
2769
|
+
}) : L(i.value, g));
|
|
2770
|
+
}
|
|
2771
|
+
m || (d = r ? r(u, c) : this.fc.getLoadData(u, c)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2727
2772
|
}
|
|
2728
|
-
}),
|
|
2729
|
-
return
|
|
2773
|
+
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2774
|
+
return o;
|
|
2730
2775
|
}
|
|
2731
2776
|
return e;
|
|
2732
2777
|
},
|
|
2733
|
-
loadFetchVar(e, r) {
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2778
|
+
loadFetchVar(e, r, i) {
|
|
2779
|
+
let s;
|
|
2780
|
+
i && i.__fc__ && (s = i.__fc__.getParentGroup());
|
|
2781
|
+
const n = (o) => this.loadStrVar(o, r, s ? { rule: i, value: this.subRuleData[s.id] || {} } : null);
|
|
2782
|
+
return e.action = n(e.action || ""), ["headers", "data", "query"].forEach((o) => {
|
|
2783
|
+
if (e[o]) {
|
|
2784
|
+
const a = {};
|
|
2785
|
+
Object.keys(e[o]).forEach((l) => {
|
|
2786
|
+
a[n(l)] = n(e[o][l]);
|
|
2787
|
+
}), e[o] = a;
|
|
2741
2788
|
}
|
|
2742
2789
|
}), e;
|
|
2743
2790
|
}
|
|
2744
2791
|
});
|
|
2745
2792
|
}
|
|
2746
2793
|
const yt = ["hook:updated", "hook:mounted"];
|
|
2747
|
-
function
|
|
2794
|
+
function ti(t) {
|
|
2748
2795
|
_(t.prototype, {
|
|
2749
2796
|
usePage() {
|
|
2750
2797
|
const e = this.options.page;
|
|
2751
2798
|
if (!e) return;
|
|
2752
|
-
let r = 25, i =
|
|
2799
|
+
let r = 25, i = ri(this.rules);
|
|
2753
2800
|
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), _(this, {
|
|
2754
2801
|
first: r,
|
|
2755
2802
|
limit: i,
|
|
@@ -2764,10 +2811,10 @@ function ei(t) {
|
|
|
2764
2811
|
}
|
|
2765
2812
|
});
|
|
2766
2813
|
}
|
|
2767
|
-
function
|
|
2814
|
+
function ri(t) {
|
|
2768
2815
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2769
2816
|
}
|
|
2770
|
-
function
|
|
2817
|
+
function ii(t) {
|
|
2771
2818
|
_(t.prototype, {
|
|
2772
2819
|
clearNextTick() {
|
|
2773
2820
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
@@ -2782,15 +2829,15 @@ function ri(t) {
|
|
|
2782
2829
|
}
|
|
2783
2830
|
});
|
|
2784
2831
|
}
|
|
2785
|
-
function
|
|
2832
|
+
function ni(t) {
|
|
2786
2833
|
Object.defineProperties(t.origin, {
|
|
2787
|
-
__fc__: Ke(
|
|
2834
|
+
__fc__: Ke(ge(t), !0)
|
|
2788
2835
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2789
|
-
__fc__: Ke(
|
|
2836
|
+
__fc__: Ke(ge(t), !0)
|
|
2790
2837
|
});
|
|
2791
2838
|
}
|
|
2792
2839
|
function qt(t, e, r) {
|
|
2793
|
-
const i =
|
|
2840
|
+
const i = je(), s = !!e.field;
|
|
2794
2841
|
_(this, {
|
|
2795
2842
|
id: i,
|
|
2796
2843
|
ref: i,
|
|
@@ -2815,9 +2862,9 @@ function qt(t, e, r) {
|
|
|
2815
2862
|
input: s,
|
|
2816
2863
|
el: void 0,
|
|
2817
2864
|
exportEl: void 0,
|
|
2818
|
-
defaultValue: s ?
|
|
2865
|
+
defaultValue: s ? X(r) : void 0,
|
|
2819
2866
|
field: e.field || void 0
|
|
2820
|
-
}), this.updateKey(),
|
|
2867
|
+
}), this.updateKey(), ni(this), this.update(t, !0);
|
|
2821
2868
|
}
|
|
2822
2869
|
_(qt.prototype, {
|
|
2823
2870
|
getParentGroup() {
|
|
@@ -2856,8 +2903,8 @@ _(qt.prototype, {
|
|
|
2856
2903
|
rule: this.rule,
|
|
2857
2904
|
api: this.$api,
|
|
2858
2905
|
update: (u) => {
|
|
2859
|
-
const c = u || i,
|
|
2860
|
-
this.setPending(e, r, c), o && o(c,
|
|
2906
|
+
const c = u || i, d = this.getPending(e, i);
|
|
2907
|
+
this.setPending(e, r, c), o && o(c, d);
|
|
2861
2908
|
},
|
|
2862
2909
|
reload: () => {
|
|
2863
2910
|
const u = this.getPending(e, i);
|
|
@@ -2879,7 +2926,7 @@ _(qt.prototype, {
|
|
|
2879
2926
|
setPending(t, e, r) {
|
|
2880
2927
|
this.pending[t] = {
|
|
2881
2928
|
origin: e,
|
|
2882
|
-
value:
|
|
2929
|
+
value: ne(r)
|
|
2883
2930
|
};
|
|
2884
2931
|
},
|
|
2885
2932
|
effectData(t) {
|
|
@@ -2889,7 +2936,7 @@ _(qt.prototype, {
|
|
|
2889
2936
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2890
2937
|
},
|
|
2891
2938
|
updateKey(t) {
|
|
2892
|
-
this.key =
|
|
2939
|
+
this.key = je(), t && this.parent && this.parent.updateKey(t);
|
|
2893
2940
|
},
|
|
2894
2941
|
updateType() {
|
|
2895
2942
|
this.originType = this.rule.type, this.type = J(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
@@ -2900,7 +2947,7 @@ _(qt.prototype, {
|
|
|
2900
2947
|
initProp() {
|
|
2901
2948
|
var e, r;
|
|
2902
2949
|
const t = b({}, this.rule);
|
|
2903
|
-
delete t.children, delete t.validate, this.prop =
|
|
2950
|
+
delete t.children, delete t.validate, this.prop = te({}, [t, ...Object.keys(this.payload).map((i) => this.payload[i]), this.computed]), this.prop.validate = [...((r = (e = this.refRule) == null ? void 0 : e.__$validate) == null ? void 0 : r.value) || [], ...this.prop.validate || []];
|
|
2904
2951
|
},
|
|
2905
2952
|
initNone() {
|
|
2906
2953
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -2966,7 +3013,7 @@ _(qt.prototype, {
|
|
|
2966
3013
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2967
3014
|
}
|
|
2968
3015
|
});
|
|
2969
|
-
function
|
|
3016
|
+
function si(t) {
|
|
2970
3017
|
_(t.prototype, {
|
|
2971
3018
|
nextRefresh(e) {
|
|
2972
3019
|
const r = this.loadedId;
|
|
@@ -2978,9 +3025,9 @@ function ni(t) {
|
|
|
2978
3025
|
const r = ft(e);
|
|
2979
3026
|
return Object.defineProperties(r, {
|
|
2980
3027
|
__origin__: Ke(e, !0)
|
|
2981
|
-
}),
|
|
3028
|
+
}), oi(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
2982
3029
|
i && this.loadFn(i, r);
|
|
2983
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
3030
|
+
}), this.loadCtrl(r), r.update && (r.update = z(r.update)), r;
|
|
2984
3031
|
},
|
|
2985
3032
|
loadFn(e, r) {
|
|
2986
3033
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -2989,12 +3036,12 @@ function ni(t) {
|
|
|
2989
3036
|
},
|
|
2990
3037
|
loadCtrl(e) {
|
|
2991
3038
|
e.control && e.control.forEach((r) => {
|
|
2992
|
-
r.handle && (r.handle =
|
|
3039
|
+
r.handle && (r.handle = z(r.handle));
|
|
2993
3040
|
});
|
|
2994
3041
|
},
|
|
2995
3042
|
syncProp(e) {
|
|
2996
3043
|
const r = e.rule;
|
|
2997
|
-
h.trueArray(r.sync) &&
|
|
3044
|
+
h.trueArray(r.sync) && ee([{
|
|
2998
3045
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
2999
3046
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3000
3047
|
}, i), {})
|
|
@@ -3028,29 +3075,29 @@ function ni(t) {
|
|
|
3028
3075
|
let l = ft(o);
|
|
3029
3076
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3030
3077
|
this.fc.targetFormDriver("loadRule", { rule: l, api: this.api }, this.fc), this.ruleEffect(l, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", o, this.api);
|
|
3031
|
-
let c,
|
|
3078
|
+
let c, d = !1, m = !!o.__fc__, g = l.value;
|
|
3032
3079
|
if (m) {
|
|
3033
|
-
if (c = o.__fc__,
|
|
3080
|
+
if (c = o.__fc__, g = c.defaultValue, c.deleted) {
|
|
3034
3081
|
if ($t(c))
|
|
3035
3082
|
return;
|
|
3036
3083
|
c.update(this);
|
|
3037
3084
|
} else if (!c.check(this)) {
|
|
3038
3085
|
if ($t(c))
|
|
3039
3086
|
return;
|
|
3040
|
-
e[a] = o = o._clone ? o._clone() : At(et(o)), c = null,
|
|
3087
|
+
e[a] = o = o._clone ? o._clone() : At(et(o)), c = null, d = !0;
|
|
3041
3088
|
}
|
|
3042
3089
|
}
|
|
3043
3090
|
if (c)
|
|
3044
3091
|
c.originType !== c.rule.type && c.updateType(), this.bindParser(c), this.appendValue(c.rule), c.parent && c.parent !== r && this.rmSubRuleData(c);
|
|
3045
3092
|
else {
|
|
3046
|
-
const
|
|
3047
|
-
c = new qt(this,
|
|
3093
|
+
const O = this.parseRule(o);
|
|
3094
|
+
c = new qt(this, O, g), this.bindParser(c);
|
|
3048
3095
|
}
|
|
3049
|
-
[!1, !0].forEach((
|
|
3050
|
-
const
|
|
3051
|
-
if (c.parser.loadChildren === !1 || s(
|
|
3052
|
-
const
|
|
3053
|
-
|
|
3096
|
+
[!1, !0].forEach((O) => this.parseEmit(c, O)), this.syncProp(c), c.parent = r || null, c.root = e, this.setCtx(c), !d && !m && (this.effect(c, "load"), this.targetHook(c, "load")), this.effect(c, "created");
|
|
3097
|
+
const $ = c.loadChildrenPending();
|
|
3098
|
+
if (c.parser.loadChildren === !1 || s($, c), !r) {
|
|
3099
|
+
const O = i(a);
|
|
3100
|
+
O > -1 || !a ? this.sort.splice(O + 1, 0, c.id) : this.sort.push(c.id);
|
|
3054
3101
|
}
|
|
3055
3102
|
const w = c.rule;
|
|
3056
3103
|
return c.updated || (c.updated = !0, h.Function(w.update) && this.bus.$once("load-end", () => {
|
|
@@ -3063,16 +3110,16 @@ function ni(t) {
|
|
|
3063
3110
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
3064
3111
|
},
|
|
3065
3112
|
useCtrl(e) {
|
|
3066
|
-
const r =
|
|
3113
|
+
const r = ai(e), i = [], s = this.api;
|
|
3067
3114
|
if (!r.length) return !1;
|
|
3068
3115
|
for (let a = 0; a < r.length; a++) {
|
|
3069
|
-
const l = r[a], u = l.handle || function(
|
|
3070
|
-
return (
|
|
3116
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3117
|
+
return (ce[l.condition || "=="] || ce["=="])(d, l.value);
|
|
3071
3118
|
};
|
|
3072
3119
|
if (!h.trueArray(l.rule)) continue;
|
|
3073
3120
|
const c = q(b({}, l), {
|
|
3074
3121
|
valid: F(() => u(e.rule.value, s)),
|
|
3075
|
-
ctrl:
|
|
3122
|
+
ctrl: li(e, l.rule),
|
|
3076
3123
|
isHidden: h.String(l.rule[0])
|
|
3077
3124
|
});
|
|
3078
3125
|
c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
|
|
@@ -3081,16 +3128,16 @@ function ni(t) {
|
|
|
3081
3128
|
const n = [];
|
|
3082
3129
|
let o = !1;
|
|
3083
3130
|
return this.deferSyncValue(() => {
|
|
3084
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: c, append:
|
|
3131
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: c, append: d, child: m, ctrl: g, method: $ }) => {
|
|
3085
3132
|
if (a) {
|
|
3086
3133
|
l ? e.ctrlRule.push({
|
|
3087
3134
|
__ctrl: !0,
|
|
3088
3135
|
children: u,
|
|
3089
3136
|
valid: l
|
|
3090
|
-
}) :
|
|
3091
|
-
|
|
3137
|
+
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3138
|
+
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((w) => {
|
|
3092
3139
|
this.api.setEffect(w, "required", l);
|
|
3093
|
-
}), l || this.api.clearValidateState(u)) : this.api.hidden(!l, u);
|
|
3140
|
+
}), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
3094
3141
|
});
|
|
3095
3142
|
return;
|
|
3096
3143
|
}
|
|
@@ -3103,11 +3150,11 @@ function ni(t) {
|
|
|
3103
3150
|
children: u
|
|
3104
3151
|
};
|
|
3105
3152
|
e.ctrlRule.push(w), this.bus.$once("load-start", () => {
|
|
3106
|
-
c ? s.prepend(w, c, m) :
|
|
3153
|
+
c ? s.prepend(w, c, m) : d || m ? s.append(w, d || e.id, m) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
|
|
3107
3154
|
});
|
|
3108
3155
|
} else {
|
|
3109
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3110
|
-
const w =
|
|
3156
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3157
|
+
const w = x(g);
|
|
3111
3158
|
w && w.rm();
|
|
3112
3159
|
}
|
|
3113
3160
|
});
|
|
@@ -3135,17 +3182,17 @@ function ni(t) {
|
|
|
3135
3182
|
}
|
|
3136
3183
|
});
|
|
3137
3184
|
}
|
|
3138
|
-
function
|
|
3185
|
+
function oi(t) {
|
|
3139
3186
|
const e = Tt();
|
|
3140
3187
|
return Object.keys(e).forEach((r) => {
|
|
3141
|
-
|
|
3188
|
+
D(t, r) || E(t, r, e[r]);
|
|
3142
3189
|
}), t;
|
|
3143
3190
|
}
|
|
3144
|
-
function
|
|
3191
|
+
function ai(t) {
|
|
3145
3192
|
const e = t.rule.control || [];
|
|
3146
3193
|
return h.Object(e) ? [e] : e;
|
|
3147
3194
|
}
|
|
3148
|
-
function
|
|
3195
|
+
function li(t, e) {
|
|
3149
3196
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
3150
3197
|
const i = t.ctrlRule[r];
|
|
3151
3198
|
if (i.children === e)
|
|
@@ -3155,7 +3202,7 @@ function ai(t, e) {
|
|
|
3155
3202
|
function $t(t) {
|
|
3156
3203
|
return !!t.rule.__ctrl;
|
|
3157
3204
|
}
|
|
3158
|
-
function
|
|
3205
|
+
function ui(t) {
|
|
3159
3206
|
_(t.prototype, {
|
|
3160
3207
|
setValue(e, r, i, s) {
|
|
3161
3208
|
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 +3225,7 @@ function li(t) {
|
|
|
3178
3225
|
this.deferSyncValue(() => {
|
|
3179
3226
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3180
3227
|
Object.keys(r || {}).forEach((o) => {
|
|
3181
|
-
s &&
|
|
3228
|
+
s && D(s, o) ? n[o] = r[o] : D(this.api.form, o) ? this.api.form[o] = r[o] : this.api.top !== this.api && D(this.api.top.form, o) && (this.api.top.form[o] = r[o]);
|
|
3182
3229
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3183
3230
|
});
|
|
3184
3231
|
},
|
|
@@ -3188,27 +3235,27 @@ function li(t) {
|
|
|
3188
3235
|
setFormData(e, r) {
|
|
3189
3236
|
e.modelValue = r;
|
|
3190
3237
|
const i = e.getParentGroup();
|
|
3191
|
-
i && (this.subRuleData[i.id] ||
|
|
3238
|
+
i && (this.subRuleData[i.id] || E(this.subRuleData, i.id, {}), E(this.subRuleData[i.id], e.field, e.rule.value)), E(this.formData, e.id, r);
|
|
3192
3239
|
},
|
|
3193
3240
|
rmSubRuleData(e) {
|
|
3194
3241
|
const r = e.getParentGroup();
|
|
3195
|
-
r && this.subRuleData[r.id] &&
|
|
3242
|
+
r && this.subRuleData[r.id] && ie(this.subRuleData[r.id], e.field);
|
|
3196
3243
|
},
|
|
3197
3244
|
getFormData(e) {
|
|
3198
3245
|
return this.formData[e.id];
|
|
3199
3246
|
},
|
|
3200
3247
|
syncForm() {
|
|
3201
3248
|
const e = {}, r = this.fields(), i = [];
|
|
3202
|
-
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] =
|
|
3249
|
+
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = De(this.appendData, n)), s), e), r.reduce((s, n) => {
|
|
3203
3250
|
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 =
|
|
3251
|
+
return this.isIgnore(o.rule) && i.push(n), s[n] = De(o.rule, "value"), s;
|
|
3252
|
+
}, e), this.form = ne(e), this.ignoreFields = i, this.syncValue();
|
|
3206
3253
|
},
|
|
3207
3254
|
isIgnore(e) {
|
|
3208
3255
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
3209
3256
|
},
|
|
3210
3257
|
appendValue(e) {
|
|
3211
|
-
(!e.field || !
|
|
3258
|
+
(!e.field || !D(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3212
3259
|
},
|
|
3213
3260
|
addSubForm(e, r) {
|
|
3214
3261
|
this.subForm[e.id] = r;
|
|
@@ -3261,7 +3308,7 @@ function li(t) {
|
|
|
3261
3308
|
function vt(t, e) {
|
|
3262
3309
|
return typeof e == "function" ? "" + e : e;
|
|
3263
3310
|
}
|
|
3264
|
-
const
|
|
3311
|
+
const ke = {
|
|
3265
3312
|
init(t) {
|
|
3266
3313
|
},
|
|
3267
3314
|
toFormValue(t, e) {
|
|
@@ -3280,8 +3327,8 @@ const Re = {
|
|
|
3280
3327
|
},
|
|
3281
3328
|
mergeProp(t) {
|
|
3282
3329
|
}
|
|
3283
|
-
},
|
|
3284
|
-
function
|
|
3330
|
+
}, ci = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3331
|
+
function fi(t) {
|
|
3285
3332
|
_(t.prototype, {
|
|
3286
3333
|
getCtx(e) {
|
|
3287
3334
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
@@ -3316,7 +3363,7 @@ function ci(t) {
|
|
|
3316
3363
|
if (n)
|
|
3317
3364
|
return n;
|
|
3318
3365
|
}
|
|
3319
|
-
return r[e.originType] || r[J(e.type)] || r[e.trueType] ||
|
|
3366
|
+
return r[e.originType] || r[J(e.type)] || r[e.trueType] || ke;
|
|
3320
3367
|
},
|
|
3321
3368
|
bindParser(e) {
|
|
3322
3369
|
e.setParser(this.getParser(e));
|
|
@@ -3329,9 +3376,9 @@ function ci(t) {
|
|
|
3329
3376
|
this.noWatchFn || (this.noWatchFn = e), F(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3330
3377
|
},
|
|
3331
3378
|
watchCtx(e) {
|
|
3332
|
-
if (
|
|
3333
|
-
const s =
|
|
3334
|
-
e.refRule[i] = s, e.watch.push(
|
|
3379
|
+
if (kt().filter((i) => i[0] !== "_" && i[0] !== "$" && ci.indexOf(i) === -1).forEach((i) => {
|
|
3380
|
+
const s = De(e.rule, i), n = i === "children";
|
|
3381
|
+
e.refRule[i] = s, e.watch.push(B(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3335
3382
|
let l = s.value;
|
|
3336
3383
|
if (!this.isBreakWatch()) {
|
|
3337
3384
|
if (n && e.parser.loadChildren === !1) {
|
|
@@ -3351,42 +3398,43 @@ function ci(t) {
|
|
|
3351
3398
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3352
3399
|
}
|
|
3353
3400
|
}, { deep: !n, sync: n }));
|
|
3354
|
-
}), e.refRule.__$title =
|
|
3401
|
+
}), e.refRule.__$title = ye(() => {
|
|
3355
3402
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3356
3403
|
if (i) {
|
|
3357
3404
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3358
3405
|
s && (i = this.api.t(s[1]));
|
|
3359
3406
|
}
|
|
3360
3407
|
return i;
|
|
3361
|
-
}), e.refRule.__$info =
|
|
3408
|
+
}), e.refRule.__$info = ye(() => {
|
|
3362
3409
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3363
3410
|
if (i) {
|
|
3364
3411
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3365
3412
|
s && (i = this.api.t(s[1]));
|
|
3366
3413
|
}
|
|
3367
3414
|
return i;
|
|
3368
|
-
}), e.refRule.__$validate =
|
|
3415
|
+
}), e.refRule.__$validate = ye(() => H(e.rule.validate).map((i) => {
|
|
3416
|
+
var n, o;
|
|
3369
3417
|
const s = b({}, i);
|
|
3370
3418
|
if (s.message) {
|
|
3371
|
-
const
|
|
3372
|
-
|
|
3419
|
+
const a = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3420
|
+
a && (s.message = this.api.t(a[1], { title: (o = (n = e.refRule) == null ? void 0 : n.__$title) == null ? void 0 : o.value }));
|
|
3373
3421
|
}
|
|
3374
3422
|
if (h.Function(s.validator)) {
|
|
3375
|
-
const
|
|
3376
|
-
return s.validator = function(...
|
|
3423
|
+
const a = e;
|
|
3424
|
+
return s.validator = function(...l) {
|
|
3377
3425
|
return i.validator.call({
|
|
3378
3426
|
that: this,
|
|
3379
|
-
id:
|
|
3380
|
-
field:
|
|
3381
|
-
rule:
|
|
3382
|
-
api:
|
|
3383
|
-
}, ...
|
|
3427
|
+
id: a.id,
|
|
3428
|
+
field: a.field,
|
|
3429
|
+
rule: a.rule,
|
|
3430
|
+
api: a.$handle.api
|
|
3431
|
+
}, ...l);
|
|
3384
3432
|
}, s;
|
|
3385
3433
|
}
|
|
3386
3434
|
return s;
|
|
3387
3435
|
})), e.input) {
|
|
3388
|
-
const i =
|
|
3389
|
-
e.watch.push(
|
|
3436
|
+
const i = De(e.rule, "value");
|
|
3437
|
+
e.watch.push(B(() => i.value, () => {
|
|
3390
3438
|
let s = e.parser.toFormValue(i.value, e);
|
|
3391
3439
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
3392
3440
|
}));
|
|
@@ -3395,15 +3443,15 @@ function ci(t) {
|
|
|
3395
3443
|
let i = e.rule.computed;
|
|
3396
3444
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3397
3445
|
let n;
|
|
3398
|
-
const o =
|
|
3446
|
+
const o = ye(() => {
|
|
3399
3447
|
const l = i[s];
|
|
3400
3448
|
if (!l) return;
|
|
3401
3449
|
const u = this.compute(e, l);
|
|
3402
3450
|
return l.linkage && u === void 0 ? n : u;
|
|
3403
3451
|
}), a = (l) => {
|
|
3404
|
-
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) :
|
|
3452
|
+
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : oe(e.rule, s, l);
|
|
3405
3453
|
};
|
|
3406
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3454
|
+
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== L(e.rule, s)) && a(o.value), e.watch.push(B(o, (l) => {
|
|
3407
3455
|
n = l, setTimeout(() => {
|
|
3408
3456
|
a(l);
|
|
3409
3457
|
});
|
|
@@ -3420,16 +3468,16 @@ function ci(t) {
|
|
|
3420
3468
|
const l = a.mode === "OR";
|
|
3421
3469
|
let u = !0;
|
|
3422
3470
|
for (let c = 0; c < a.group.length; c++) {
|
|
3423
|
-
const
|
|
3424
|
-
let m,
|
|
3425
|
-
if (
|
|
3426
|
-
|
|
3427
|
-
else if (
|
|
3428
|
-
|
|
3471
|
+
const d = a.group[c];
|
|
3472
|
+
let m, g = null;
|
|
3473
|
+
if (d.variable)
|
|
3474
|
+
g = JSON.stringify(this.fc.getLoadData(d.variable) || "");
|
|
3475
|
+
else if (d.field)
|
|
3476
|
+
g = dt(d.field || "");
|
|
3429
3477
|
else
|
|
3430
3478
|
return !0;
|
|
3431
|
-
let
|
|
3432
|
-
if (
|
|
3479
|
+
let $ = d.compare;
|
|
3480
|
+
if ($ && ($ = dt($ || "")), d.mode ? m = n(d) : ce[d.condition] ? h.Function(d.handler) ? m = F(() => d.handler(this.api, e.rule)) : m = F(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${g}, ${$ || "$val"}); }}}}`).call(this.api.form, ce, d.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : m = !1, l && m)
|
|
3433
3481
|
return !0;
|
|
3434
3482
|
l || (u = u && m);
|
|
3435
3483
|
}
|
|
@@ -3454,7 +3502,7 @@ function ci(t) {
|
|
|
3454
3502
|
fc: s.fc
|
|
3455
3503
|
}, ...l);
|
|
3456
3504
|
}, o), {});
|
|
3457
|
-
return new Function("$formulas", "$form", "$group", "$rule", "$api", `with($form){with(this){with($group){with($formulas){ return ${e} }}}}`).call(this.api.form, n, this.api.top.form, i ? this.subRuleData[i.id] || {} : {}, r.rule, this.api);
|
|
3505
|
+
return new Function("$formulas", "$form", "$scope", "$group", "$rule", "$api", `with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form, n, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, i ? this.subRuleData[i.id] || {} : {}, r.rule, this.api);
|
|
3458
3506
|
},
|
|
3459
3507
|
updateChildren(e, r, i) {
|
|
3460
3508
|
this.deferSyncValue(() => {
|
|
@@ -3471,9 +3519,9 @@ function ci(t) {
|
|
|
3471
3519
|
rmCtx(e) {
|
|
3472
3520
|
if (e.deleted) return;
|
|
3473
3521
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3474
|
-
|
|
3522
|
+
ie(this.ctxs, r), ie(this.formData, r), ie(this.subForm, r), ie(this.vm.ctxInject, r);
|
|
3475
3523
|
const o = e.getParentGroup();
|
|
3476
|
-
o && this.subRuleData[o.id] &&
|
|
3524
|
+
o && this.subRuleData[o.id] && ie(this.subRuleData[o.id], i), e.group && ie(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !D(this.fieldCtx, i) && ie(this.form, i), this.deferSyncValue(() => {
|
|
3477
3525
|
if (!this.reloading) {
|
|
3478
3526
|
if (e.parser.loadChildren !== !1) {
|
|
3479
3527
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3487,7 +3535,7 @@ function ci(t) {
|
|
|
3487
3535
|
}
|
|
3488
3536
|
});
|
|
3489
3537
|
}
|
|
3490
|
-
function
|
|
3538
|
+
function hi(t) {
|
|
3491
3539
|
_(t.prototype, {
|
|
3492
3540
|
mounted() {
|
|
3493
3541
|
const e = () => {
|
|
@@ -3501,7 +3549,7 @@ function fi(t) {
|
|
|
3501
3549
|
emitEvent(e, ...r) {
|
|
3502
3550
|
const i = this.options[e] || this.options[J("on-" + e)];
|
|
3503
3551
|
if (i) {
|
|
3504
|
-
const s =
|
|
3552
|
+
const s = z(i);
|
|
3505
3553
|
h.Function(s) && F(() => s(...r));
|
|
3506
3554
|
}
|
|
3507
3555
|
this.bus.$emit(e, ...r);
|
|
@@ -3510,18 +3558,18 @@ function fi(t) {
|
|
|
3510
3558
|
var n, o;
|
|
3511
3559
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3512
3560
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3513
|
-
F(() => a(q(b({}, i || {}), { rule: e.rule, api: this.api })));
|
|
3561
|
+
F(() => a(q(b({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
|
|
3514
3562
|
}));
|
|
3515
3563
|
}
|
|
3516
3564
|
});
|
|
3517
3565
|
}
|
|
3518
|
-
function
|
|
3566
|
+
function di(t) {
|
|
3519
3567
|
_(t.prototype, {
|
|
3520
3568
|
useProvider() {
|
|
3521
3569
|
const e = this.fc.providers;
|
|
3522
3570
|
Object.keys(e).forEach((r) => {
|
|
3523
3571
|
let i = e[r];
|
|
3524
|
-
h.Function(i) && (i = i(this.fc)), i._c =
|
|
3572
|
+
h.Function(i) && (i = i(this.fc)), i._c = mi(i), this.onEffect(i), this.providers[r] = i;
|
|
3525
3573
|
});
|
|
3526
3574
|
},
|
|
3527
3575
|
onEffect(e) {
|
|
@@ -3537,7 +3585,7 @@ function hi(t) {
|
|
|
3537
3585
|
let r = {
|
|
3538
3586
|
required: () => {
|
|
3539
3587
|
var i, s;
|
|
3540
|
-
return (
|
|
3588
|
+
return (D(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3541
3589
|
}
|
|
3542
3590
|
};
|
|
3543
3591
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3545,7 +3593,7 @@ function hi(t) {
|
|
|
3545
3593
|
}), Object.keys(e.rule).forEach((i) => {
|
|
3546
3594
|
i[0] === "$" && (r[i.substr(1)] = () => e.rule[i]);
|
|
3547
3595
|
}), Object.keys(r).forEach((i) => {
|
|
3548
|
-
e.watch.push(
|
|
3596
|
+
e.watch.push(B(r[i], (s) => {
|
|
3549
3597
|
this.effect(e, "watch", { [i]: s });
|
|
3550
3598
|
}, { deep: !0 }));
|
|
3551
3599
|
});
|
|
@@ -3567,9 +3615,9 @@ function hi(t) {
|
|
|
3567
3615
|
}, r);
|
|
3568
3616
|
},
|
|
3569
3617
|
getEffect(e, r) {
|
|
3570
|
-
if (
|
|
3618
|
+
if (D(e, "$" + r))
|
|
3571
3619
|
return e["$" + r];
|
|
3572
|
-
if (
|
|
3620
|
+
if (D(e, "effect") && D(e.effect, r))
|
|
3573
3621
|
return e.effect[r];
|
|
3574
3622
|
},
|
|
3575
3623
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3578,32 +3626,32 @@ function hi(t) {
|
|
|
3578
3626
|
Object.keys(l).forEach((u) => {
|
|
3579
3627
|
const c = this.providers[u];
|
|
3580
3628
|
if (!c || c.input && !i) return;
|
|
3581
|
-
let
|
|
3629
|
+
let d;
|
|
3582
3630
|
if (!c._c)
|
|
3583
|
-
|
|
3631
|
+
d = "*";
|
|
3584
3632
|
else if (c._used.indexOf(s) > -1)
|
|
3585
|
-
|
|
3633
|
+
d = s;
|
|
3586
3634
|
else
|
|
3587
3635
|
return;
|
|
3588
3636
|
const m = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3589
|
-
e && (m.getProp = () => e.effectData(u), m.clearProp = () => e.clearEffectData(u), m.mergeProp = (
|
|
3637
|
+
e && (m.getProp = () => e.effectData(u), m.clearProp = () => e.clearEffectData(u), m.mergeProp = (g) => te(m.getProp(), [g]), m.id = e.id), this.bus.$emit(`p:${u}:${d}:${c.input ? 1 : 0}`, o, [m, r, this.api]);
|
|
3590
3638
|
});
|
|
3591
3639
|
}
|
|
3592
3640
|
});
|
|
3593
3641
|
}
|
|
3594
|
-
function
|
|
3642
|
+
function pi(t) {
|
|
3595
3643
|
return t.filter(function(e, r, i) {
|
|
3596
3644
|
return i.indexOf(e, 0) === r;
|
|
3597
3645
|
});
|
|
3598
3646
|
}
|
|
3599
|
-
function
|
|
3647
|
+
function mi(t) {
|
|
3600
3648
|
const e = t.components;
|
|
3601
3649
|
if (Array.isArray(e)) {
|
|
3602
|
-
const r =
|
|
3650
|
+
const r = pi(e.filter((i) => i !== "*"));
|
|
3603
3651
|
return r.length ? r : !1;
|
|
3604
3652
|
} else return h.String(e) ? [e] : !1;
|
|
3605
3653
|
}
|
|
3606
|
-
function
|
|
3654
|
+
function Q(t) {
|
|
3607
3655
|
Pt(this, {
|
|
3608
3656
|
options() {
|
|
3609
3657
|
return t.options.value || {};
|
|
@@ -3623,10 +3671,10 @@ function X(t) {
|
|
|
3623
3671
|
noWatchFn: null,
|
|
3624
3672
|
deferSyncFn: null,
|
|
3625
3673
|
isMounted: !1,
|
|
3626
|
-
formData:
|
|
3627
|
-
subRuleData:
|
|
3674
|
+
formData: ne({}),
|
|
3675
|
+
subRuleData: ne({}),
|
|
3628
3676
|
subForm: {},
|
|
3629
|
-
form:
|
|
3677
|
+
form: ne({}),
|
|
3630
3678
|
appendData: {},
|
|
3631
3679
|
ignoreFields: [],
|
|
3632
3680
|
providers: {},
|
|
@@ -3641,9 +3689,9 @@ function X(t) {
|
|
|
3641
3689
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3642
3690
|
const i = F(() => r(e, this));
|
|
3643
3691
|
return i && i !== e && _(e, i), e;
|
|
3644
|
-
},
|
|
3692
|
+
}, Qr(this));
|
|
3645
3693
|
}
|
|
3646
|
-
_(
|
|
3694
|
+
_(Q.prototype, {
|
|
3647
3695
|
initData(t) {
|
|
3648
3696
|
_(this, {
|
|
3649
3697
|
ctxs: {},
|
|
@@ -3662,33 +3710,39 @@ _(X.prototype, {
|
|
|
3662
3710
|
isBreakWatch() {
|
|
3663
3711
|
return this.loading || this.noWatchFn || this.reloading;
|
|
3664
3712
|
},
|
|
3665
|
-
|
|
3666
|
-
return new Promise((e) => {
|
|
3667
|
-
const
|
|
3668
|
-
|
|
3713
|
+
globalBeforeFetch(t) {
|
|
3714
|
+
return new Promise((e, r) => {
|
|
3715
|
+
const i = this.options.beforeFetch && F(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3716
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : e();
|
|
3669
3717
|
});
|
|
3718
|
+
},
|
|
3719
|
+
beforeFetch(t) {
|
|
3720
|
+
return new Promise((e, r) => {
|
|
3721
|
+
const i = t && t.beforeFetch && F(() => t.beforeFetch(t, { api: this.api }));
|
|
3722
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3723
|
+
}).then(() => this.globalBeforeFetch(t));
|
|
3670
3724
|
}
|
|
3671
3725
|
});
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
const
|
|
3681
|
-
name:
|
|
3726
|
+
ei(Q);
|
|
3727
|
+
ti(Q);
|
|
3728
|
+
ii(Q);
|
|
3729
|
+
si(Q);
|
|
3730
|
+
ui(Q);
|
|
3731
|
+
fi(Q);
|
|
3732
|
+
hi(Q);
|
|
3733
|
+
di(Q);
|
|
3734
|
+
const gi = "fcFragment", Be = {
|
|
3735
|
+
name: gi,
|
|
3682
3736
|
functional: !0,
|
|
3683
3737
|
props: ["vnode"],
|
|
3684
3738
|
render(t, e) {
|
|
3685
3739
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3686
3740
|
}
|
|
3687
3741
|
};
|
|
3688
|
-
function
|
|
3742
|
+
function yi(t) {
|
|
3689
3743
|
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3690
3744
|
}
|
|
3691
|
-
function
|
|
3745
|
+
function $i() {
|
|
3692
3746
|
const t = {};
|
|
3693
3747
|
function e(r) {
|
|
3694
3748
|
r && this.setVm(r);
|
|
@@ -3699,11 +3753,11 @@ function yi() {
|
|
|
3699
3753
|
},
|
|
3700
3754
|
make(r, i, s) {
|
|
3701
3755
|
var n, o, a;
|
|
3702
|
-
return (
|
|
3756
|
+
return ($e.isReservedTag ? $e.isReservedTag(r) : (o = (n = $e) == null ? void 0 : n.config) != null && o.isReservedTag(r)) && (i == null || delete i.nativeOn, (a = i == null ? void 0 : i.props) == null || delete a.formCreateInject), this.makeComponent(r, i, s);
|
|
3703
3757
|
},
|
|
3704
3758
|
makeComponent(r, i, s) {
|
|
3705
3759
|
var o;
|
|
3706
|
-
let n = this.$h(r,
|
|
3760
|
+
let n = this.$h(r, yi(i), s || []);
|
|
3707
3761
|
if ((o = n == null ? void 0 : n.componentOptions) != null && o.propsData && (i != null && i.props)) {
|
|
3708
3762
|
const a = Object.keys(n.componentOptions.propsData);
|
|
3709
3763
|
n.data.attrs || (n.data.attrs = {}), Object.keys(i.props).forEach((l) => {
|
|
@@ -3720,7 +3774,7 @@ function yi() {
|
|
|
3720
3774
|
},
|
|
3721
3775
|
use(r) {
|
|
3722
3776
|
Object.keys(r).forEach((i) => {
|
|
3723
|
-
const s =
|
|
3777
|
+
const s = be(i), n = jt(i).toLocaleLowerCase(), o = r[i];
|
|
3724
3778
|
[i, s, n].forEach((a) => {
|
|
3725
3779
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3726
3780
|
return this.make(o, l, u);
|
|
@@ -3730,7 +3784,7 @@ function yi() {
|
|
|
3730
3784
|
}
|
|
3731
3785
|
}), e;
|
|
3732
3786
|
}
|
|
3733
|
-
function
|
|
3787
|
+
function vi(t) {
|
|
3734
3788
|
class e extends Ut {
|
|
3735
3789
|
}
|
|
3736
3790
|
return Object.assign(e.prototype, t), e;
|
|
@@ -3751,7 +3805,7 @@ _(Ut.prototype, {
|
|
|
3751
3805
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3752
3806
|
},
|
|
3753
3807
|
updateKey() {
|
|
3754
|
-
this.key =
|
|
3808
|
+
this.key = je();
|
|
3755
3809
|
},
|
|
3756
3810
|
//TODO interface
|
|
3757
3811
|
init() {
|
|
@@ -3773,7 +3827,7 @@ _(Ut.prototype, {
|
|
|
3773
3827
|
return e(this.vm);
|
|
3774
3828
|
},
|
|
3775
3829
|
mergeOptions(t, e) {
|
|
3776
|
-
return
|
|
3830
|
+
return ee(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3777
3831
|
},
|
|
3778
3832
|
updateOptions(t) {
|
|
3779
3833
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3791,24 +3845,24 @@ _(Ut.prototype, {
|
|
|
3791
3845
|
render(t) {
|
|
3792
3846
|
}
|
|
3793
3847
|
});
|
|
3794
|
-
const
|
|
3848
|
+
const bi = function(t) {
|
|
3795
3849
|
const e = {
|
|
3796
3850
|
name: "loadData",
|
|
3797
3851
|
_fn: [],
|
|
3798
|
-
|
|
3852
|
+
mounted(r, i, s) {
|
|
3799
3853
|
this.deleted(r);
|
|
3800
|
-
let n =
|
|
3854
|
+
let n = H(r.getValue());
|
|
3801
3855
|
const o = [];
|
|
3802
3856
|
n.forEach((a) => {
|
|
3803
3857
|
if (a && (a.attr || a.template)) {
|
|
3804
|
-
let l = (
|
|
3858
|
+
let l = (d) => {
|
|
3805
3859
|
let m;
|
|
3806
|
-
a.template ? m = t.$handle.loadStrVar(a.template,
|
|
3807
|
-
const
|
|
3808
|
-
a.to === "child" ?
|
|
3809
|
-
}, u = (
|
|
3860
|
+
a.template ? m = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? m = a.handler(d, i, s) : m = d(a.attr, a.default), a.copy !== !1 && (m = X(m));
|
|
3861
|
+
const g = a.modify ? i : r.getProp();
|
|
3862
|
+
a.to === "child" ? g.children ? E(g.children, 0, m) : E(g, "children", [m]) : oe(g, a.to || "options", m), s.sync(i);
|
|
3863
|
+
}, u = (d) => l(d);
|
|
3810
3864
|
const c = t.watchLoadData(u);
|
|
3811
|
-
l =
|
|
3865
|
+
l = se(l, a.wait || 300), a.watch !== !1 ? o.push(c) : c();
|
|
3812
3866
|
}
|
|
3813
3867
|
}), this._fn[r.id] = o;
|
|
3814
3868
|
},
|
|
@@ -3819,7 +3873,7 @@ const vi = function(t) {
|
|
|
3819
3873
|
}
|
|
3820
3874
|
};
|
|
3821
3875
|
return e.watch = e.mounted, e;
|
|
3822
|
-
},
|
|
3876
|
+
}, _i = function(t) {
|
|
3823
3877
|
const e = {
|
|
3824
3878
|
name: "t",
|
|
3825
3879
|
_fn: [],
|
|
@@ -3831,13 +3885,13 @@ const vi = function(t) {
|
|
|
3831
3885
|
const l = n[a];
|
|
3832
3886
|
if (l) {
|
|
3833
3887
|
const u = typeof l == "object";
|
|
3834
|
-
let c = (
|
|
3835
|
-
let
|
|
3888
|
+
let c = (g) => {
|
|
3889
|
+
let $ = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
3836
3890
|
const w = u && l.modify ? i : r.getProp();
|
|
3837
|
-
a === "child" ? w.children ?
|
|
3838
|
-
},
|
|
3839
|
-
const m = t.watchLoadData(
|
|
3840
|
-
c =
|
|
3891
|
+
a === "child" ? w.children ? E(w.children, 0, $) : E(w, "children", [$]) : oe(w, a, $), s.sync(i);
|
|
3892
|
+
}, d = (g) => c(g);
|
|
3893
|
+
const m = t.watchLoadData(d);
|
|
3894
|
+
c = se(c, l.wait || 300), l.watch !== !1 ? o.push(m) : m();
|
|
3841
3895
|
}
|
|
3842
3896
|
}), this._fn[r.id] = o;
|
|
3843
3897
|
},
|
|
@@ -3859,7 +3913,7 @@ const vi = function(t) {
|
|
|
3859
3913
|
const s = i.method;
|
|
3860
3914
|
delete i.method, t.getProp().validate = [q(b({}, i), {
|
|
3861
3915
|
validator(...n) {
|
|
3862
|
-
const o =
|
|
3916
|
+
const o = x(e);
|
|
3863
3917
|
if (o)
|
|
3864
3918
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3865
3919
|
attr: t,
|
|
@@ -3873,7 +3927,7 @@ const vi = function(t) {
|
|
|
3873
3927
|
watch(...t) {
|
|
3874
3928
|
Ht.load(...t);
|
|
3875
3929
|
}
|
|
3876
|
-
},
|
|
3930
|
+
}, Ci = function(t) {
|
|
3877
3931
|
function e(s) {
|
|
3878
3932
|
return h.String(s) && (s = {
|
|
3879
3933
|
action: s,
|
|
@@ -3883,55 +3937,55 @@ const vi = function(t) {
|
|
|
3883
3937
|
function r(s, n, o) {
|
|
3884
3938
|
let a = s.value;
|
|
3885
3939
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3886
|
-
const l = (
|
|
3887
|
-
|
|
3940
|
+
const l = (d) => {
|
|
3941
|
+
d === void 0 ? s.clearProp() : oe(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3888
3942
|
};
|
|
3889
3943
|
if (!a || !a.action && !a.key) {
|
|
3890
3944
|
l(void 0);
|
|
3891
3945
|
return;
|
|
3892
3946
|
}
|
|
3893
|
-
if (a =
|
|
3894
|
-
const
|
|
3895
|
-
if (!
|
|
3947
|
+
if (a = X(a), a.to || (a.to = "options"), a.key) {
|
|
3948
|
+
const d = t.$handle.options.globalData[a.key];
|
|
3949
|
+
if (!d) {
|
|
3896
3950
|
l(void 0);
|
|
3897
3951
|
return;
|
|
3898
3952
|
}
|
|
3899
|
-
if (
|
|
3900
|
-
l(
|
|
3953
|
+
if (d.type === "static") {
|
|
3954
|
+
l(d.data);
|
|
3901
3955
|
return;
|
|
3902
3956
|
} else
|
|
3903
|
-
a = b(b({}, a),
|
|
3957
|
+
a = b(b({}, a), d);
|
|
3904
3958
|
}
|
|
3905
3959
|
const u = a.onError, c = () => {
|
|
3906
3960
|
if (!s.getValue())
|
|
3907
3961
|
return s.clearProp(), o.sync(n), !0;
|
|
3908
3962
|
};
|
|
3909
|
-
i._fn[s.id] = t.watchLoadData(
|
|
3963
|
+
i._fn[s.id] = t.watchLoadData(se((d, m) => {
|
|
3910
3964
|
if (m && a.watch === !1)
|
|
3911
3965
|
return i._fn[s.id]();
|
|
3912
|
-
const
|
|
3966
|
+
const g = t.$handle.loadFetchVar(X(a), d, n), $ = q(b({
|
|
3913
3967
|
headers: {}
|
|
3914
|
-
},
|
|
3915
|
-
onSuccess(w,
|
|
3968
|
+
}, g), {
|
|
3969
|
+
onSuccess(w, O) {
|
|
3916
3970
|
if (c()) return;
|
|
3917
|
-
let
|
|
3918
|
-
const P =
|
|
3919
|
-
h.Function(P) ?
|
|
3971
|
+
let G = (M) => O ? M : D(M, "data") ? M.data : M;
|
|
3972
|
+
const P = z(g.parse);
|
|
3973
|
+
h.Function(P) ? G = P : P && h.String(P) && (G = (M) => L(M, P)), l(G(w, n, o)), o.sync(n);
|
|
3920
3974
|
},
|
|
3921
3975
|
onError(w) {
|
|
3922
|
-
l(void 0), !c() && (u || ((
|
|
3976
|
+
l(void 0), !c() && (u || ((O) => xe(O.message || "fetch fail " + g.action)))(w, n, o);
|
|
3923
3977
|
}
|
|
3924
3978
|
});
|
|
3925
|
-
t.$handle.beforeFetch(
|
|
3926
|
-
if (h.Function(
|
|
3927
|
-
|
|
3928
|
-
|
|
3979
|
+
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
3980
|
+
if (h.Function(g.action)) {
|
|
3981
|
+
g.action(n, o).then((w) => {
|
|
3982
|
+
$.onSuccess(w, !0);
|
|
3929
3983
|
}).catch((w) => {
|
|
3930
|
-
|
|
3984
|
+
$.onError(w);
|
|
3931
3985
|
});
|
|
3932
3986
|
return;
|
|
3933
3987
|
}
|
|
3934
|
-
F(() => t.create.fetch(
|
|
3988
|
+
F(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
3935
3989
|
});
|
|
3936
3990
|
}, a.wait || 600));
|
|
3937
3991
|
}
|
|
@@ -3949,13 +4003,13 @@ const vi = function(t) {
|
|
|
3949
4003
|
}
|
|
3950
4004
|
};
|
|
3951
4005
|
return i;
|
|
3952
|
-
},
|
|
3953
|
-
fetch:
|
|
3954
|
-
loadData:
|
|
3955
|
-
t:
|
|
4006
|
+
}, wi = {
|
|
4007
|
+
fetch: Ci,
|
|
4008
|
+
loadData: bi,
|
|
4009
|
+
t: _i,
|
|
3956
4010
|
componentValidate: Ht
|
|
3957
4011
|
};
|
|
3958
|
-
function
|
|
4012
|
+
function Fi(t) {
|
|
3959
4013
|
t = t || /* @__PURE__ */ new Map();
|
|
3960
4014
|
const e = {
|
|
3961
4015
|
$on(r, i) {
|
|
@@ -3979,7 +4033,7 @@ function wi(t) {
|
|
|
3979
4033
|
};
|
|
3980
4034
|
return e;
|
|
3981
4035
|
}
|
|
3982
|
-
const Oi = "html",
|
|
4036
|
+
const Oi = "html", Ri = {
|
|
3983
4037
|
name: Oi,
|
|
3984
4038
|
loadChildren: !1,
|
|
3985
4039
|
render(t, e) {
|
|
@@ -3989,7 +4043,7 @@ const Oi = "html", Fi = {
|
|
|
3989
4043
|
return Array.isArray(t) ? t.filter((e) => h.String(e)).join("") : "";
|
|
3990
4044
|
}
|
|
3991
4045
|
};
|
|
3992
|
-
function
|
|
4046
|
+
function Ei(t) {
|
|
3993
4047
|
t = t + "=";
|
|
3994
4048
|
const r = decodeURIComponent(document.cookie).split(";");
|
|
3995
4049
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -4007,7 +4061,7 @@ function ki(t) {
|
|
|
4007
4061
|
}
|
|
4008
4062
|
return null;
|
|
4009
4063
|
}
|
|
4010
|
-
function
|
|
4064
|
+
function Si(t) {
|
|
4011
4065
|
const e = localStorage.getItem(t);
|
|
4012
4066
|
if (e)
|
|
4013
4067
|
try {
|
|
@@ -4017,7 +4071,7 @@ function Ei(t) {
|
|
|
4017
4071
|
}
|
|
4018
4072
|
return null;
|
|
4019
4073
|
}
|
|
4020
|
-
function
|
|
4074
|
+
function ki(t) {
|
|
4021
4075
|
const e = sessionStorage.getItem(t);
|
|
4022
4076
|
if (e)
|
|
4023
4077
|
try {
|
|
@@ -4032,28 +4086,28 @@ function it(t, e) {
|
|
|
4032
4086
|
return null;
|
|
4033
4087
|
const r = e.split(".");
|
|
4034
4088
|
let i = t(r.shift());
|
|
4035
|
-
return r.length ? i == null ? null :
|
|
4036
|
-
}
|
|
4037
|
-
function Si(t) {
|
|
4038
|
-
return it(ki, t);
|
|
4089
|
+
return r.length ? i == null ? null : L(i, r) : i;
|
|
4039
4090
|
}
|
|
4040
4091
|
function Di(t) {
|
|
4041
4092
|
return it(Ei, t);
|
|
4042
4093
|
}
|
|
4043
4094
|
function ji(t) {
|
|
4044
|
-
return it(
|
|
4095
|
+
return it(Si, t);
|
|
4045
4096
|
}
|
|
4046
|
-
function Ai(t
|
|
4097
|
+
function Ai(t) {
|
|
4098
|
+
return it(ki, t);
|
|
4099
|
+
}
|
|
4100
|
+
function Vi(t, e) {
|
|
4047
4101
|
let r;
|
|
4048
4102
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4049
4103
|
}
|
|
4050
4104
|
function Le() {
|
|
4051
|
-
return
|
|
4105
|
+
return Vi("name", ...arguments);
|
|
4052
4106
|
}
|
|
4053
|
-
function
|
|
4107
|
+
function Ii(t) {
|
|
4054
4108
|
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
4055
4109
|
}
|
|
4056
|
-
function
|
|
4110
|
+
function Pi(t, e) {
|
|
4057
4111
|
const r = new Vue({
|
|
4058
4112
|
data() {
|
|
4059
4113
|
return { rule: t, option: e || {} };
|
|
@@ -4064,27 +4118,29 @@ function Ii(t, e) {
|
|
|
4064
4118
|
});
|
|
4065
4119
|
return r.$mount(), r;
|
|
4066
4120
|
}
|
|
4067
|
-
function
|
|
4121
|
+
function Ti(t) {
|
|
4068
4122
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4069
|
-
|
|
4123
|
+
St.push(...e), Ze.push(...r), Ye.push(...i), Bt([...e, ...r, ...i]);
|
|
4070
4124
|
}
|
|
4071
|
-
let
|
|
4072
|
-
const U = {},
|
|
4125
|
+
let Bi = 1;
|
|
4126
|
+
const U = {}, Ee = Symbol("defValue");
|
|
4073
4127
|
function Gt(t) {
|
|
4074
4128
|
const e = {
|
|
4075
4129
|
[Be.name]: Be
|
|
4076
4130
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4077
4131
|
t.extendApi
|
|
4078
|
-
], u = b({},
|
|
4079
|
-
let
|
|
4080
|
-
const m =
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
if (
|
|
4087
|
-
return
|
|
4132
|
+
], u = b({}, wi), c = Xr();
|
|
4133
|
+
let d = { global: {} };
|
|
4134
|
+
const m = t.isMobile === !0, g = ne({
|
|
4135
|
+
$mobile: m
|
|
4136
|
+
}), $ = $i(), w = {}, O = {};
|
|
4137
|
+
Ti(t.attrs || {});
|
|
4138
|
+
function G(f) {
|
|
4139
|
+
const p = U[f];
|
|
4140
|
+
if (Array.isArray(p))
|
|
4141
|
+
return p.map((y) => y.api());
|
|
4142
|
+
if (p)
|
|
4143
|
+
return p.api();
|
|
4088
4144
|
}
|
|
4089
4145
|
function P(f) {
|
|
4090
4146
|
o.push(f);
|
|
@@ -4093,50 +4149,50 @@ function Gt(t) {
|
|
|
4093
4149
|
const f = Le(...arguments);
|
|
4094
4150
|
f.id && f.prop && (i[f.id] = f.prop);
|
|
4095
4151
|
}
|
|
4096
|
-
function
|
|
4152
|
+
function he() {
|
|
4097
4153
|
const f = Le(...arguments);
|
|
4098
4154
|
f.id && f.prop && (u[f.id] = h.Function(f.prop) ? f.prop : q(b({}, f.prop), {
|
|
4099
4155
|
name: f.id
|
|
4100
4156
|
}));
|
|
4101
4157
|
}
|
|
4102
|
-
function
|
|
4103
|
-
|
|
4158
|
+
function Ae(f) {
|
|
4159
|
+
$.use(f);
|
|
4104
4160
|
}
|
|
4105
|
-
function
|
|
4161
|
+
function de() {
|
|
4106
4162
|
const f = Le(...arguments);
|
|
4107
|
-
if (!f.id || !f.prop) return
|
|
4108
|
-
const
|
|
4109
|
-
r[
|
|
4163
|
+
if (!f.id || !f.prop) return ke;
|
|
4164
|
+
const p = J(f.id), y = f.prop, v = y.merge === !0 ? r[p] : void 0;
|
|
4165
|
+
r[p] = Re(y, v || ke), c[p] = I(p), y.maker && _(c, y.maker);
|
|
4110
4166
|
}
|
|
4111
|
-
function
|
|
4112
|
-
let
|
|
4167
|
+
function R(f, p) {
|
|
4168
|
+
let y;
|
|
4113
4169
|
if (h.String(f)) {
|
|
4114
|
-
if (
|
|
4115
|
-
return ["form-create", "formcreate"].indexOf(
|
|
4170
|
+
if (y = f, p === void 0)
|
|
4171
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? S() : e[y];
|
|
4116
4172
|
} else
|
|
4117
|
-
|
|
4118
|
-
if (!
|
|
4119
|
-
const
|
|
4120
|
-
e[
|
|
4173
|
+
y = J(f.name), p = f;
|
|
4174
|
+
if (!y || !p) return;
|
|
4175
|
+
const v = J(y);
|
|
4176
|
+
e[y] = p, e[v] = p, delete $.aliasMap[y], delete $.aliasMap[v], delete r[y], delete r[v], p.formCreateParser && de(y, p.formCreateParser);
|
|
4121
4177
|
}
|
|
4122
|
-
function
|
|
4123
|
-
return
|
|
4178
|
+
function S() {
|
|
4179
|
+
return Nr(Ie, e, i);
|
|
4124
4180
|
}
|
|
4125
|
-
function
|
|
4181
|
+
function N() {
|
|
4126
4182
|
return Be;
|
|
4127
4183
|
}
|
|
4128
|
-
function
|
|
4129
|
-
return h.Function(f.install) ? f.install(
|
|
4184
|
+
function pe(f, p) {
|
|
4185
|
+
return h.Function(f.install) ? f.install(W, p) : h.Function(f) && f(W, p), this;
|
|
4130
4186
|
}
|
|
4131
|
-
function
|
|
4132
|
-
let
|
|
4133
|
-
const C =
|
|
4134
|
-
return C.$parent =
|
|
4187
|
+
function W(f, p, y) {
|
|
4188
|
+
let v = Pi(f, p || {});
|
|
4189
|
+
const C = v.$refs.fc.formCreate;
|
|
4190
|
+
return C.$parent = y, Ii(C.options).appendChild(v.$el), C.api();
|
|
4135
4191
|
}
|
|
4136
|
-
|
|
4192
|
+
Re(W, O);
|
|
4137
4193
|
function Wt(f) {
|
|
4138
|
-
let
|
|
4139
|
-
return f ?
|
|
4194
|
+
let p = b({}, t);
|
|
4195
|
+
return f ? p.inherit = {
|
|
4140
4196
|
components: e,
|
|
4141
4197
|
parsers: r,
|
|
4142
4198
|
directives: i,
|
|
@@ -4144,146 +4200,146 @@ function Gt(t) {
|
|
|
4144
4200
|
providers: u,
|
|
4145
4201
|
useApps: o,
|
|
4146
4202
|
maker: c,
|
|
4147
|
-
formulas:
|
|
4148
|
-
loadData:
|
|
4149
|
-
} : delete
|
|
4203
|
+
formulas: w,
|
|
4204
|
+
loadData: g
|
|
4205
|
+
} : delete p.inherit, Gt(p);
|
|
4150
4206
|
}
|
|
4151
|
-
function Kt(f,
|
|
4152
|
-
s[f] =
|
|
4207
|
+
function Kt(f, p) {
|
|
4208
|
+
s[f] = p;
|
|
4153
4209
|
}
|
|
4154
|
-
function Xt(f,
|
|
4155
|
-
|
|
4210
|
+
function Xt(f, p) {
|
|
4211
|
+
w[f] = p;
|
|
4156
4212
|
}
|
|
4157
|
-
function zt(f,
|
|
4158
|
-
const
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
}),
|
|
4213
|
+
function zt(f, p) {
|
|
4214
|
+
const y = n[f] || {}, v = y.parsers || {};
|
|
4215
|
+
p.parsers && Object.keys(p.parsers).forEach((C) => {
|
|
4216
|
+
v[C] = Re(p.parsers[C], ke);
|
|
4217
|
+
}), p.name = f, n[f] = q(b(b({}, y), p), { parsers: v });
|
|
4162
4218
|
}
|
|
4163
|
-
function
|
|
4164
|
-
f && Object.keys(U).forEach((
|
|
4165
|
-
(Array.isArray(U[
|
|
4166
|
-
|
|
4219
|
+
function Ce(f) {
|
|
4220
|
+
f && Object.keys(U).forEach((p) => {
|
|
4221
|
+
(Array.isArray(U[p]) ? U[p] : [U[p]]).forEach((v) => {
|
|
4222
|
+
v.bus.$emit("$loadData." + f);
|
|
4167
4223
|
});
|
|
4168
4224
|
});
|
|
4169
4225
|
}
|
|
4170
|
-
function
|
|
4171
|
-
|
|
4226
|
+
function Ve(f, p) {
|
|
4227
|
+
oe(g, f, p), Ce(f);
|
|
4172
4228
|
}
|
|
4173
|
-
function
|
|
4174
|
-
const
|
|
4175
|
-
|
|
4229
|
+
function we(f, p) {
|
|
4230
|
+
const y = (...v) => F(() => p(...v));
|
|
4231
|
+
y._driver = !0, Ve(f, y);
|
|
4176
4232
|
}
|
|
4177
|
-
function nt(f,
|
|
4178
|
-
const
|
|
4179
|
-
f =
|
|
4180
|
-
const
|
|
4181
|
-
if (
|
|
4182
|
-
let C =
|
|
4183
|
-
return C && C._driver ? C = C(
|
|
4233
|
+
function nt(f, p) {
|
|
4234
|
+
const y = (f || "").split(".");
|
|
4235
|
+
f = y.shift();
|
|
4236
|
+
const v = y.join(".");
|
|
4237
|
+
if (D(g, f) || E(g, f, Ee), g[f] !== Ee) {
|
|
4238
|
+
let C = g[f];
|
|
4239
|
+
return C && C._driver ? C = C(v) : y.length && (C = L(C, y)), C == null || C === "" ? p : C;
|
|
4184
4240
|
} else
|
|
4185
|
-
return
|
|
4241
|
+
return p;
|
|
4186
4242
|
}
|
|
4187
4243
|
function Qt(f) {
|
|
4188
4244
|
l.push(f);
|
|
4189
4245
|
}
|
|
4190
4246
|
function Zt(f) {
|
|
4191
|
-
delete
|
|
4247
|
+
delete g[f], Ce(f);
|
|
4192
4248
|
}
|
|
4193
|
-
function Yt(f,
|
|
4194
|
-
a.push({ name: f, callback:
|
|
4249
|
+
function Yt(f, p) {
|
|
4250
|
+
a.push({ name: f, callback: p });
|
|
4195
4251
|
}
|
|
4196
|
-
function
|
|
4252
|
+
function Ie(f) {
|
|
4197
4253
|
_(this, {
|
|
4198
|
-
id:
|
|
4199
|
-
create:
|
|
4254
|
+
id: Bi++,
|
|
4255
|
+
create: W,
|
|
4200
4256
|
vm: f,
|
|
4201
|
-
manager:
|
|
4257
|
+
manager: vi(t.manager),
|
|
4202
4258
|
parsers: r,
|
|
4203
4259
|
providers: u,
|
|
4204
4260
|
modelFields: s,
|
|
4205
|
-
formulas:
|
|
4206
|
-
isMobile:
|
|
4261
|
+
formulas: w,
|
|
4262
|
+
isMobile: m,
|
|
4207
4263
|
rules: f.$options.propsData.rule,
|
|
4208
|
-
name: f.$options.propsData.name ||
|
|
4264
|
+
name: f.$options.propsData.name || je(),
|
|
4209
4265
|
inFor: f.$options.propsData.inFor,
|
|
4210
4266
|
prop: {
|
|
4211
4267
|
components: e,
|
|
4212
4268
|
directives: i
|
|
4213
4269
|
},
|
|
4270
|
+
get: null,
|
|
4214
4271
|
drivers: n,
|
|
4215
4272
|
renderDriver: null,
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
bus: new wi(),
|
|
4273
|
+
refreshData: Ce,
|
|
4274
|
+
loadData: g,
|
|
4275
|
+
CreateNode: $,
|
|
4276
|
+
bus: new Fi(),
|
|
4221
4277
|
unwatch: [],
|
|
4222
|
-
options:
|
|
4278
|
+
options: dr({}),
|
|
4223
4279
|
extendApiFn: l,
|
|
4224
4280
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4225
|
-
tmpData:
|
|
4226
|
-
}), a.forEach((
|
|
4227
|
-
this.bus.$on(
|
|
4281
|
+
tmpData: ne({})
|
|
4282
|
+
}), a.forEach((p) => {
|
|
4283
|
+
this.bus.$on(p.name, p.callback);
|
|
4228
4284
|
}), T(() => {
|
|
4229
|
-
|
|
4285
|
+
B(this.options, () => {
|
|
4230
4286
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4231
4287
|
}, { deep: !0 });
|
|
4232
|
-
}), _(f.$options.components, e), _(f.$options.directives, i), this.$handle = new
|
|
4288
|
+
}), _(f.$options.components, e), _(f.$options.directives, i), this.$handle = new Q(this), this.name && (this.inFor ? (U[this.name] || (U[this.name] = []), U[this.name].push(this)) : U[this.name] = this);
|
|
4233
4289
|
}
|
|
4234
|
-
|
|
4290
|
+
Ie.isMobile = m, _(Ie.prototype, {
|
|
4235
4291
|
init() {
|
|
4236
|
-
this.isSub() && this.unwatch.push(
|
|
4292
|
+
this.isSub() && this.unwatch.push(B(() => this.vm.parent.fc.options.value, () => {
|
|
4237
4293
|
this.initOptions(), this.$handle.api.refresh();
|
|
4238
4294
|
}, { deep: !0 })), this.vm.$options.propsData.driver && (this.renderDriver = typeof this.vm.$options.propsData.driver == "object" ? this.vm.$options.propsData.driver : this.drivers[this.vm.$options.propsData.driver]), !this.renderDriver && this.vm.parent && (this.renderDriver = this.vm.parent.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
|
|
4239
4295
|
},
|
|
4240
|
-
targetFormDriver(f, ...
|
|
4296
|
+
targetFormDriver(f, ...p) {
|
|
4241
4297
|
if (this.renderDriver && this.renderDriver[f])
|
|
4242
|
-
return F(() => this.renderDriver[f](...
|
|
4298
|
+
return F(() => this.renderDriver[f](...p));
|
|
4243
4299
|
},
|
|
4244
|
-
t(f,
|
|
4245
|
-
let
|
|
4246
|
-
return
|
|
4247
|
-
const
|
|
4248
|
-
|
|
4249
|
-
}),
|
|
4300
|
+
t(f, p, y) {
|
|
4301
|
+
let v = y ? y("$t." + f) : this.globalLanguageDriver(f);
|
|
4302
|
+
return v == null && (v = ""), v && p && Object.keys(p).forEach((C) => {
|
|
4303
|
+
const j = new RegExp(`{${C}}`, "g");
|
|
4304
|
+
v = v.replace(j, p[C]);
|
|
4305
|
+
}), v;
|
|
4250
4306
|
},
|
|
4251
4307
|
globalDataDriver(f) {
|
|
4252
|
-
let
|
|
4253
|
-
const
|
|
4254
|
-
if (
|
|
4255
|
-
if (
|
|
4256
|
-
return
|
|
4308
|
+
let p = f.split(".");
|
|
4309
|
+
const y = p.shift(), v = this.options.value.globalData && this.options.value.globalData[y];
|
|
4310
|
+
if (v) {
|
|
4311
|
+
if (v.type === "static")
|
|
4312
|
+
return L(v.data, p);
|
|
4257
4313
|
{
|
|
4258
4314
|
let C;
|
|
4259
|
-
const
|
|
4260
|
-
if (
|
|
4261
|
-
if (
|
|
4315
|
+
const j = this.fetchCache.get(v);
|
|
4316
|
+
if (j) {
|
|
4317
|
+
if (j.status && (C = L(j.data, p)), !j.loading)
|
|
4262
4318
|
return C;
|
|
4263
|
-
|
|
4319
|
+
j.loading = !1, this.fetchCache.set(v, j);
|
|
4264
4320
|
} else
|
|
4265
|
-
this.fetchCache.set(
|
|
4266
|
-
const
|
|
4267
|
-
|
|
4268
|
-
const
|
|
4269
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(
|
|
4270
|
-
},
|
|
4271
|
-
this.fetchCache.set(
|
|
4272
|
-
},
|
|
4273
|
-
if (
|
|
4274
|
-
return
|
|
4275
|
-
if (
|
|
4276
|
-
|
|
4321
|
+
this.fetchCache.set(v, { status: !1 });
|
|
4322
|
+
const k = se(() => {
|
|
4323
|
+
le();
|
|
4324
|
+
const K = this.fetchCache.get(v);
|
|
4325
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(v) !== -1 ? (K && (K.loading = !0, this.fetchCache.set(v, K)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(v);
|
|
4326
|
+
}, v.wait || 600), ae = (K) => {
|
|
4327
|
+
this.fetchCache.set(v, { status: !0, data: K }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4328
|
+
}, Z = (K, ue) => {
|
|
4329
|
+
if (ue && v.watch === !1)
|
|
4330
|
+
return le();
|
|
4331
|
+
if (ue) {
|
|
4332
|
+
k();
|
|
4277
4333
|
return;
|
|
4278
4334
|
}
|
|
4279
|
-
const
|
|
4280
|
-
this.$handle.api.fetch(
|
|
4281
|
-
|
|
4282
|
-
}).catch((
|
|
4283
|
-
|
|
4335
|
+
const me = this.$handle.loadFetchVar(Ge(v), K);
|
|
4336
|
+
this.$handle.api.fetch(me).then((re) => {
|
|
4337
|
+
ae(re);
|
|
4338
|
+
}).catch((re) => {
|
|
4339
|
+
ae(null);
|
|
4284
4340
|
});
|
|
4285
|
-
},
|
|
4286
|
-
return this.unwatch.push(
|
|
4341
|
+
}, le = this.watchLoadData(Z);
|
|
4342
|
+
return this.unwatch.push(le), C;
|
|
4287
4343
|
}
|
|
4288
4344
|
}
|
|
4289
4345
|
},
|
|
@@ -4292,81 +4348,92 @@ function Gt(t) {
|
|
|
4292
4348
|
return f && typeof f == "object" ? f.name : typeof f == "string" ? f : "zh-cn";
|
|
4293
4349
|
},
|
|
4294
4350
|
globalLanguageDriver(f) {
|
|
4295
|
-
let
|
|
4296
|
-
if (
|
|
4297
|
-
const
|
|
4298
|
-
|
|
4351
|
+
let p = this.vm.top.$props.locale, y;
|
|
4352
|
+
if (p && typeof p == "object" && (y = L(p, f)), y == null) {
|
|
4353
|
+
const v = this.options.value.language || {}, C = this.getLocale();
|
|
4354
|
+
y = L(v[C], f);
|
|
4299
4355
|
}
|
|
4300
|
-
return
|
|
4356
|
+
return y;
|
|
4301
4357
|
},
|
|
4302
4358
|
globalVarDriver(f) {
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4359
|
+
const y = f.split(".").shift(), v = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4360
|
+
if (v) {
|
|
4361
|
+
const C = h.Function(v) ? v : z(v.handle);
|
|
4362
|
+
if (C) {
|
|
4363
|
+
let j;
|
|
4364
|
+
const k = this.watchLoadData((ae, Z) => {
|
|
4365
|
+
Z ? (this.bus.$emit("$loadData.$var." + y), k()) : j = C(ae, this.$handle.api);
|
|
4366
|
+
});
|
|
4367
|
+
return this.unwatch.push(k), j;
|
|
4368
|
+
}
|
|
4309
4369
|
}
|
|
4310
4370
|
},
|
|
4311
|
-
setData(f,
|
|
4312
|
-
|
|
4371
|
+
setData(f, p, y) {
|
|
4372
|
+
y ? Ve(f, p) : (oe(this.vm.top.fc.tmpData, f, p), this.bus.$emit("$loadData." + f));
|
|
4313
4373
|
},
|
|
4314
|
-
getLoadData(f,
|
|
4315
|
-
let
|
|
4374
|
+
getLoadData(f, p) {
|
|
4375
|
+
let y = null;
|
|
4316
4376
|
if (f != null) {
|
|
4317
|
-
let
|
|
4318
|
-
const C =
|
|
4377
|
+
let v = f.split(".");
|
|
4378
|
+
const C = v.shift();
|
|
4319
4379
|
if (C === "$topForm")
|
|
4320
|
-
|
|
4380
|
+
y = this.$handle.api.top.formData(!0);
|
|
4381
|
+
else if (C === "$scopeForm")
|
|
4382
|
+
y = this.$handle.api.scope.formData(!0);
|
|
4321
4383
|
else if (C === "$form")
|
|
4322
|
-
|
|
4384
|
+
y = this.$handle.api.formData(!0);
|
|
4323
4385
|
else if (C === "$options")
|
|
4324
|
-
|
|
4386
|
+
y = this.options.value;
|
|
4325
4387
|
else if (C === "$globalData")
|
|
4326
|
-
|
|
4388
|
+
y = this.globalDataDriver(v.join(".")), v = [];
|
|
4327
4389
|
else if (C === "$var")
|
|
4328
|
-
|
|
4390
|
+
y = this.globalVarDriver(v.join(".")), v = [];
|
|
4329
4391
|
else if (C === "$locale")
|
|
4330
|
-
|
|
4392
|
+
y = this.getLocale(), v = [];
|
|
4331
4393
|
else if (C === "$t")
|
|
4332
|
-
|
|
4394
|
+
y = this.globalLanguageDriver(v.join(".")), v = [];
|
|
4333
4395
|
else {
|
|
4334
|
-
|
|
4335
|
-
|
|
4396
|
+
if (C === "$preview")
|
|
4397
|
+
return this.$handle.preview;
|
|
4398
|
+
{
|
|
4399
|
+
const j = this.vm.top.fc.tmpData;
|
|
4400
|
+
D(j, C) || E(j, C, Ee), y = j[C] !== Ee ? L(j, f) : nt(f), v = [];
|
|
4401
|
+
}
|
|
4336
4402
|
}
|
|
4337
|
-
|
|
4403
|
+
y && v.length && (y = L(y, v));
|
|
4338
4404
|
}
|
|
4339
|
-
return
|
|
4405
|
+
return y == null || y === "" ? p : y;
|
|
4340
4406
|
},
|
|
4341
|
-
watchLoadData(f,
|
|
4342
|
-
let
|
|
4343
|
-
const
|
|
4407
|
+
watchLoadData(f, p) {
|
|
4408
|
+
let y = {};
|
|
4409
|
+
const v = (k) => {
|
|
4344
4410
|
this.get || (this.get = C), F(() => {
|
|
4345
|
-
f(C,
|
|
4411
|
+
f(C, k);
|
|
4346
4412
|
}), this.get === C && (this.get = void 0);
|
|
4347
|
-
}, C = (
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4413
|
+
}, C = (k, ae) => {
|
|
4414
|
+
let Z;
|
|
4415
|
+
if (typeof k == "object" && (Z = k.getValue, k = k.id), y[k])
|
|
4416
|
+
return y[k].val;
|
|
4417
|
+
const le = ye(() => Z ? Z() : this.getLoadData(k, ae)), K = k.split("."), ue = K.shift(), me = K.shift() || "", re = se(() => {
|
|
4418
|
+
const Pe = Z ? Z() : this.getLoadData(k, ae);
|
|
4419
|
+
if (y[k])
|
|
4420
|
+
JSON.stringify(Pe) !== JSON.stringify(y[k].val) && (y[k].val = Pe, v(!0));
|
|
4354
4421
|
else return;
|
|
4355
|
-
},
|
|
4356
|
-
|
|
4422
|
+
}, p || 0), er = B(le, (Pe) => {
|
|
4423
|
+
re();
|
|
4357
4424
|
});
|
|
4358
|
-
return this.bus.$on("$loadData." +
|
|
4425
|
+
return this.bus.$on("$loadData." + ue, re), me && this.bus.$on("$loadData." + ue + "." + me, re), y[k] = {
|
|
4359
4426
|
fn: () => {
|
|
4360
|
-
this.bus.$off("$loadData." +
|
|
4427
|
+
this.bus.$off("$loadData." + ue, re), me && this.bus.$off("$loadData." + ue + "." + me, re), er();
|
|
4361
4428
|
},
|
|
4362
|
-
val:
|
|
4363
|
-
},
|
|
4429
|
+
val: le.value
|
|
4430
|
+
}, le.value;
|
|
4364
4431
|
};
|
|
4365
|
-
|
|
4366
|
-
const
|
|
4367
|
-
Object.keys(
|
|
4432
|
+
v(!1);
|
|
4433
|
+
const j = () => {
|
|
4434
|
+
Object.keys(y).forEach((k) => y[k].fn()), y = {};
|
|
4368
4435
|
};
|
|
4369
|
-
return this.unwatch.push(
|
|
4436
|
+
return this.unwatch.push(j), j;
|
|
4370
4437
|
},
|
|
4371
4438
|
isSub() {
|
|
4372
4439
|
return this.vm.parent && this.vm.extendOption;
|
|
@@ -4379,13 +4446,13 @@ function Gt(t) {
|
|
|
4379
4446
|
resetBtn: {},
|
|
4380
4447
|
globalEvent: {},
|
|
4381
4448
|
globalData: {}
|
|
4382
|
-
},
|
|
4449
|
+
}, X(d));
|
|
4383
4450
|
this.isSub() && (f = this.mergeOptions(f, this.vm.parent.fc.options.value || {}, !0)), f = this.mergeOptions(f, this.vm.$options.propsData.option || {}), this.updateOptions(f);
|
|
4384
4451
|
},
|
|
4385
|
-
mergeOptions(f,
|
|
4386
|
-
return
|
|
4387
|
-
delete
|
|
4388
|
-
}),
|
|
4452
|
+
mergeOptions(f, p, y) {
|
|
4453
|
+
return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((v) => {
|
|
4454
|
+
delete p[v];
|
|
4455
|
+
}), p.global && (f.global = Gr(f.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], f), f;
|
|
4389
4456
|
},
|
|
4390
4457
|
updateOptions(f) {
|
|
4391
4458
|
this.options.value = this.mergeOptions(this.options.value, f), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4418,70 +4485,70 @@ function Gt(t) {
|
|
|
4418
4485
|
_(f, {
|
|
4419
4486
|
version: t.version,
|
|
4420
4487
|
ui: t.ui,
|
|
4421
|
-
isMobile:
|
|
4488
|
+
isMobile: m,
|
|
4422
4489
|
extendApi: Qt,
|
|
4423
4490
|
getData: nt,
|
|
4424
|
-
setDataDriver:
|
|
4425
|
-
setData:
|
|
4491
|
+
setDataDriver: we,
|
|
4492
|
+
setData: Ve,
|
|
4426
4493
|
removeData: Zt,
|
|
4427
|
-
refreshData:
|
|
4494
|
+
refreshData: Ce,
|
|
4428
4495
|
maker: c,
|
|
4429
|
-
component:
|
|
4496
|
+
component: R,
|
|
4430
4497
|
directive: M,
|
|
4431
4498
|
setModelField: Kt,
|
|
4432
4499
|
setFormula: Xt,
|
|
4433
4500
|
setDriver: zt,
|
|
4434
|
-
register:
|
|
4435
|
-
$vnode:
|
|
4436
|
-
parser:
|
|
4437
|
-
use:
|
|
4501
|
+
register: he,
|
|
4502
|
+
$vnode: N,
|
|
4503
|
+
parser: de,
|
|
4504
|
+
use: pe,
|
|
4438
4505
|
factory: Wt,
|
|
4439
|
-
componentAlias:
|
|
4506
|
+
componentAlias: Ae,
|
|
4440
4507
|
copyRule: Vt,
|
|
4441
4508
|
copyRules: It,
|
|
4442
|
-
mergeRule:
|
|
4509
|
+
mergeRule: te,
|
|
4443
4510
|
fetch: Mt,
|
|
4444
|
-
$form:
|
|
4445
|
-
parseFn:
|
|
4511
|
+
$form: S,
|
|
4512
|
+
parseFn: z,
|
|
4446
4513
|
parseJson: At,
|
|
4447
4514
|
toJson: et,
|
|
4448
4515
|
useApp: P,
|
|
4449
|
-
getApi:
|
|
4516
|
+
getApi: G,
|
|
4450
4517
|
on: Yt
|
|
4451
4518
|
});
|
|
4452
4519
|
}
|
|
4453
4520
|
function xt(f) {
|
|
4454
4521
|
_(f, {
|
|
4455
|
-
create:
|
|
4456
|
-
install(
|
|
4457
|
-
if (
|
|
4458
|
-
|
|
4459
|
-
const
|
|
4460
|
-
return
|
|
4522
|
+
create: W,
|
|
4523
|
+
install(p, y) {
|
|
4524
|
+
if (d = b(b({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4525
|
+
p._installedFormCreate = !0;
|
|
4526
|
+
const v = function(j, k = {}) {
|
|
4527
|
+
return W(j, k, this);
|
|
4461
4528
|
};
|
|
4462
|
-
st(
|
|
4463
|
-
const C =
|
|
4464
|
-
|
|
4465
|
-
F(() =>
|
|
4529
|
+
st(v), p.prototype.$formCreate = v;
|
|
4530
|
+
const C = S();
|
|
4531
|
+
p.component(C.name, C), p.component("FcFragment", N()), o.forEach((j) => {
|
|
4532
|
+
F(() => j(f, p));
|
|
4466
4533
|
});
|
|
4467
4534
|
}
|
|
4468
4535
|
});
|
|
4469
4536
|
}
|
|
4470
|
-
if (st(
|
|
4537
|
+
if (st(O), xt(O), we("$cookie", Di), we("$localStorage", ji), we("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install && W.use(t), de(Ri), t.inherit) {
|
|
4471
4538
|
const f = t.inherit;
|
|
4472
|
-
f.components && _(e, f.components), f.parsers && _(r, f.parsers), f.directives && _(i, f.directives), f.modelFields && _(s, f.modelFields), f.providers && _(u, f.providers), f.useApps && _(o, f.useApps), f.maker && _(c, f.maker), f.loadData && _(
|
|
4539
|
+
f.components && _(e, f.components), f.parsers && _(r, f.parsers), f.directives && _(i, f.directives), f.modelFields && _(s, f.modelFields), f.providers && _(u, f.providers), f.useApps && _(o, f.useApps), f.maker && _(c, f.maker), f.loadData && _(g, f.loadData), f.formulas && _(w, f.formulas);
|
|
4473
4540
|
}
|
|
4474
|
-
const
|
|
4475
|
-
return Fe
|
|
4541
|
+
const Fe = S();
|
|
4542
|
+
return Re(Fe, O), Object.defineProperties(Fe, {
|
|
4476
4543
|
fetch: {
|
|
4477
4544
|
get() {
|
|
4478
|
-
return
|
|
4545
|
+
return O.fetch;
|
|
4479
4546
|
},
|
|
4480
4547
|
set(f) {
|
|
4481
|
-
|
|
4548
|
+
O.fetch = f;
|
|
4482
4549
|
}
|
|
4483
4550
|
}
|
|
4484
|
-
}),
|
|
4551
|
+
}), Fe.util = O, Fe;
|
|
4485
4552
|
}
|
|
4486
4553
|
const bt = {
|
|
4487
4554
|
date: "yyyy-MM-dd",
|
|
@@ -4492,7 +4559,7 @@ const bt = {
|
|
|
4492
4559
|
monthrange: "yyyy-MM",
|
|
4493
4560
|
datetimerange: "yyyy-MM-dd HH:mm:ss",
|
|
4494
4561
|
year: "yyyy"
|
|
4495
|
-
}, _t = "datePicker",
|
|
4562
|
+
}, _t = "datePicker", Li = {
|
|
4496
4563
|
name: _t,
|
|
4497
4564
|
maker: function() {
|
|
4498
4565
|
return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = I(_t, { type: e.toLowerCase() }), t), {});
|
|
@@ -4501,7 +4568,7 @@ const bt = {
|
|
|
4501
4568
|
const e = t.prop.props;
|
|
4502
4569
|
e.valueFormat || (e.valueFormat = bt[e.type] || bt.date);
|
|
4503
4570
|
}
|
|
4504
|
-
}, Me = "hidden",
|
|
4571
|
+
}, Me = "hidden", Mi = {
|
|
4505
4572
|
name: Me,
|
|
4506
4573
|
maker: {
|
|
4507
4574
|
[Me]: (t, e) => I(Me)("", t, e)
|
|
@@ -4509,7 +4576,7 @@ const bt = {
|
|
|
4509
4576
|
render() {
|
|
4510
4577
|
return [];
|
|
4511
4578
|
}
|
|
4512
|
-
}, Ne = "input",
|
|
4579
|
+
}, Ne = "input", Ni = {
|
|
4513
4580
|
name: Ne,
|
|
4514
4581
|
maker: function() {
|
|
4515
4582
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = I(Ne, { type: r }), e), {});
|
|
@@ -4519,7 +4586,7 @@ const bt = {
|
|
|
4519
4586
|
let { props: e } = t.prop;
|
|
4520
4587
|
e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4521
4588
|
}
|
|
4522
|
-
}, Ct = "slider",
|
|
4589
|
+
}, Ct = "slider", qi = {
|
|
4523
4590
|
name: Ct,
|
|
4524
4591
|
maker: {
|
|
4525
4592
|
sliderRange: I(Ct, { range: !0 })
|
|
@@ -4528,7 +4595,7 @@ const bt = {
|
|
|
4528
4595
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
4529
4596
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
4530
4597
|
}
|
|
4531
|
-
}, qe = "timePicker",
|
|
4598
|
+
}, qe = "timePicker", Ui = {
|
|
4532
4599
|
name: qe,
|
|
4533
4600
|
maker: {
|
|
4534
4601
|
time: I(qe, (t) => t.props.isRange = !1),
|
|
@@ -4538,60 +4605,60 @@ const bt = {
|
|
|
4538
4605
|
const e = t.prop.props;
|
|
4539
4606
|
e.valueFormat || (e.valueFormat = "HH:mm:ss");
|
|
4540
4607
|
}
|
|
4541
|
-
},
|
|
4608
|
+
}, Hi = {
|
|
4542
4609
|
name: "FcRow",
|
|
4543
4610
|
render(t, e) {
|
|
4544
4611
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
4545
4612
|
e.vNode.row(e.prop, t)
|
|
4546
4613
|
]);
|
|
4547
4614
|
}
|
|
4548
|
-
},
|
|
4549
|
-
name:
|
|
4615
|
+
}, Gi = "select", Ji = {
|
|
4616
|
+
name: Gi,
|
|
4550
4617
|
toFormValue(t, e) {
|
|
4551
|
-
return e.prop.props.multiple && !Array.isArray(t) ?
|
|
4618
|
+
return e.prop.props.multiple && !Array.isArray(t) ? H(t) : t;
|
|
4552
4619
|
}
|
|
4553
|
-
},
|
|
4554
|
-
Bi,
|
|
4620
|
+
}, Wi = [
|
|
4555
4621
|
Li,
|
|
4556
4622
|
Mi,
|
|
4557
4623
|
Ni,
|
|
4558
4624
|
qi,
|
|
4559
4625
|
Ui,
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4626
|
+
Hi,
|
|
4627
|
+
Ji
|
|
4628
|
+
], A = "el", Ki = {
|
|
4629
|
+
button: A + "Button",
|
|
4563
4630
|
icon: "i",
|
|
4564
|
-
slider:
|
|
4565
|
-
rate:
|
|
4631
|
+
slider: A + "Slider",
|
|
4632
|
+
rate: A + "Rate",
|
|
4566
4633
|
upload: "fcUpload",
|
|
4567
|
-
cascader:
|
|
4568
|
-
popover:
|
|
4569
|
-
tooltip:
|
|
4570
|
-
colorPicker:
|
|
4571
|
-
timePicker:
|
|
4572
|
-
timeSelect:
|
|
4573
|
-
datePicker:
|
|
4574
|
-
switch:
|
|
4634
|
+
cascader: A + "Cascader",
|
|
4635
|
+
popover: A + "Popover",
|
|
4636
|
+
tooltip: A + "Tooltip",
|
|
4637
|
+
colorPicker: A + "ColorPicker",
|
|
4638
|
+
timePicker: A + "TimePicker",
|
|
4639
|
+
timeSelect: A + "TimeSelect",
|
|
4640
|
+
datePicker: A + "DatePicker",
|
|
4641
|
+
switch: A + "Switch",
|
|
4575
4642
|
select: "fcSelect",
|
|
4576
4643
|
checkbox: "fcCheckbox",
|
|
4577
4644
|
radio: "fcRadio",
|
|
4578
|
-
inputNumber:
|
|
4579
|
-
number:
|
|
4580
|
-
input:
|
|
4581
|
-
formItem:
|
|
4582
|
-
form:
|
|
4645
|
+
inputNumber: A + "InputNumber",
|
|
4646
|
+
number: A + "InputNumber",
|
|
4647
|
+
input: A + "Input",
|
|
4648
|
+
formItem: A + "FormItem",
|
|
4649
|
+
form: A + "Form",
|
|
4583
4650
|
frame: "fcFrame",
|
|
4584
|
-
col:
|
|
4585
|
-
row:
|
|
4651
|
+
col: A + "Col",
|
|
4652
|
+
row: A + "Row",
|
|
4586
4653
|
tree: "fcTree",
|
|
4587
|
-
autoComplete:
|
|
4588
|
-
auto:
|
|
4654
|
+
autoComplete: A + "Autocomplete",
|
|
4655
|
+
auto: A + "Autocomplete",
|
|
4589
4656
|
group: "fcGroup",
|
|
4590
4657
|
array: "fcGroup",
|
|
4591
4658
|
object: "fcSubForm",
|
|
4592
4659
|
subForm: "fcSubForm"
|
|
4593
4660
|
};
|
|
4594
|
-
function
|
|
4661
|
+
function Xi() {
|
|
4595
4662
|
return {
|
|
4596
4663
|
form: {
|
|
4597
4664
|
inline: !1,
|
|
@@ -4625,23 +4692,23 @@ function Ki() {
|
|
|
4625
4692
|
}
|
|
4626
4693
|
};
|
|
4627
4694
|
}
|
|
4628
|
-
function
|
|
4695
|
+
function zi(t) {
|
|
4629
4696
|
return t.type === "tooltip";
|
|
4630
4697
|
}
|
|
4631
4698
|
function wt(t, e) {
|
|
4632
|
-
|
|
4699
|
+
D(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4633
4700
|
}
|
|
4634
|
-
function
|
|
4701
|
+
function Y(t) {
|
|
4635
4702
|
return t === !1;
|
|
4636
4703
|
}
|
|
4637
|
-
function
|
|
4638
|
-
|
|
4704
|
+
function Qi(t, e) {
|
|
4705
|
+
D(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4639
4706
|
}
|
|
4640
4707
|
function Ue(t) {
|
|
4641
4708
|
const e = b({}, t);
|
|
4642
4709
|
return delete e.children, e;
|
|
4643
4710
|
}
|
|
4644
|
-
const
|
|
4711
|
+
const Zi = {
|
|
4645
4712
|
validate() {
|
|
4646
4713
|
const t = this.form();
|
|
4647
4714
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -4660,7 +4727,7 @@ const Qi = {
|
|
|
4660
4727
|
},
|
|
4661
4728
|
tidyOptions(t) {
|
|
4662
4729
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
4663
|
-
|
|
4730
|
+
Qi(t, e);
|
|
4664
4731
|
}), t;
|
|
4665
4732
|
},
|
|
4666
4733
|
tidyRule({ prop: t }) {
|
|
@@ -4678,11 +4745,11 @@ const Qi = {
|
|
|
4678
4745
|
wrap: {}
|
|
4679
4746
|
};
|
|
4680
4747
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4681
|
-
t.prop[r] =
|
|
4748
|
+
t.prop[r] = ee([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4682
4749
|
});
|
|
4683
4750
|
},
|
|
4684
4751
|
getDefaultOptions() {
|
|
4685
|
-
return
|
|
4752
|
+
return Xi();
|
|
4686
4753
|
},
|
|
4687
4754
|
update() {
|
|
4688
4755
|
const t = this.options.form;
|
|
@@ -4705,12 +4772,12 @@ const Qi = {
|
|
|
4705
4772
|
});
|
|
4706
4773
|
},
|
|
4707
4774
|
render(t) {
|
|
4708
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4775
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Y(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4709
4776
|
},
|
|
4710
4777
|
makeWrap(t, e) {
|
|
4711
4778
|
const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r) && r.wrap.title !== !1, o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: l } = this.rule.props;
|
|
4712
4779
|
delete r.wrap.title;
|
|
4713
|
-
const u =
|
|
4780
|
+
const u = Y(r.wrap.show) ? e : this.$r(ee([r.wrap, {
|
|
4714
4781
|
props: q(b({
|
|
4715
4782
|
labelWidth: o === void 0 ? o : jt(o),
|
|
4716
4783
|
label: n ? r.title.title : void 0
|
|
@@ -4723,30 +4790,30 @@ const Qi = {
|
|
|
4723
4790
|
ref: t.wrapRef,
|
|
4724
4791
|
type: "formItem"
|
|
4725
4792
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4726
|
-
return a === !0 ||
|
|
4793
|
+
return a === !0 || Y(l) || Y(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4727
4794
|
},
|
|
4728
4795
|
isTitle(t) {
|
|
4729
4796
|
if (this.options.form.title === !1) return !1;
|
|
4730
4797
|
const e = t.title;
|
|
4731
|
-
return !(!e.title && !e.native ||
|
|
4798
|
+
return !(!e.title && !e.native || Y(e.show));
|
|
4732
4799
|
},
|
|
4733
4800
|
makeInfo(t, e, r) {
|
|
4734
|
-
var c,
|
|
4735
|
-
const i = b({}, t.title), s = b({}, t.info), n =
|
|
4736
|
-
title: (c = r.refRule) == null ? void 0 : c.__$title.value,
|
|
4801
|
+
var c, d, m, g, $, w;
|
|
4802
|
+
const i = b({}, t.title), s = b({}, t.info), n = zi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
|
|
4803
|
+
title: (d = (c = r.refRule) == null ? void 0 : c.__$title) == null ? void 0 : d.value,
|
|
4737
4804
|
rule: r.rule,
|
|
4738
4805
|
options: this.options
|
|
4739
|
-
}) : ((
|
|
4740
|
-
if (!
|
|
4741
|
-
const
|
|
4806
|
+
}) : ((g = (m = r.refRule) == null ? void 0 : m.__$title) == null ? void 0 : g.value) + (o.labelSuffix || o["label-suffix"] || "")];
|
|
4807
|
+
if (!Y(s.show) && (s.info || s.native) && !Y(s.icon)) {
|
|
4808
|
+
const O = {
|
|
4742
4809
|
type: s.type || "popover",
|
|
4743
4810
|
slot: "label",
|
|
4744
4811
|
props: Ue(s),
|
|
4745
4812
|
key: `${e}pop`
|
|
4746
4813
|
};
|
|
4747
|
-
delete
|
|
4748
|
-
const
|
|
4749
|
-
s.info && !
|
|
4814
|
+
delete O.props.icon, delete O.props.show, delete O.props.info, delete O.props.align, delete O.props.native;
|
|
4815
|
+
const G = "content";
|
|
4816
|
+
s.info && !D(O.props, G) && (O.props[G] = (w = ($ = r.refRule) == null ? void 0 : $.__$info) == null ? void 0 : w.value), l[s.align !== "left" ? "unshift" : "push"](this.$r(ee([s, O]), [
|
|
4750
4817
|
this.$r({
|
|
4751
4818
|
type: "i",
|
|
4752
4819
|
slot: n ? "default" : "reference",
|
|
@@ -4755,7 +4822,7 @@ const Qi = {
|
|
|
4755
4822
|
})
|
|
4756
4823
|
]));
|
|
4757
4824
|
}
|
|
4758
|
-
const u =
|
|
4825
|
+
const u = ee([i, {
|
|
4759
4826
|
props: Ue(i),
|
|
4760
4827
|
key: `${e}tit`,
|
|
4761
4828
|
class: "fc-form-title",
|
|
@@ -4784,7 +4851,7 @@ const Qi = {
|
|
|
4784
4851
|
},
|
|
4785
4852
|
makeFormBtn() {
|
|
4786
4853
|
let t = [];
|
|
4787
|
-
if (
|
|
4854
|
+
if (Y(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Y(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4788
4855
|
return;
|
|
4789
4856
|
const e = this.$r({
|
|
4790
4857
|
type: "formItem",
|
|
@@ -4831,26 +4898,26 @@ const Qi = {
|
|
|
4831
4898
|
key: `${this.key}b1`
|
|
4832
4899
|
}, [e]);
|
|
4833
4900
|
}
|
|
4834
|
-
},
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
function
|
|
4901
|
+
}, fe = {};
|
|
4902
|
+
Yi(fe);
|
|
4903
|
+
xi(fe);
|
|
4904
|
+
en(fe);
|
|
4905
|
+
tn(fe);
|
|
4906
|
+
rn(fe);
|
|
4907
|
+
function Yi(t) {
|
|
4841
4908
|
["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
|
|
4842
4909
|
t[e] = I(e);
|
|
4843
4910
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4844
4911
|
}
|
|
4845
|
-
function
|
|
4912
|
+
function xi(t) {
|
|
4846
4913
|
const e = "select", r = "multiple";
|
|
4847
4914
|
t.selectMultiple = I(e, { [r]: !0 }), t.selectOne = I(e, { [r]: !1 });
|
|
4848
4915
|
}
|
|
4849
|
-
function
|
|
4916
|
+
function en(t) {
|
|
4850
4917
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4851
4918
|
Object.keys(r).reduce((i, s) => (i[s] = I(e, { type: r[s] }), i), t);
|
|
4852
4919
|
}
|
|
4853
|
-
function
|
|
4920
|
+
function tn(t) {
|
|
4854
4921
|
const e = "upload", r = {
|
|
4855
4922
|
image: ["image", 0],
|
|
4856
4923
|
file: ["file", 0],
|
|
@@ -4859,7 +4926,7 @@ function en(t) {
|
|
|
4859
4926
|
};
|
|
4860
4927
|
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
4928
|
}
|
|
4862
|
-
function
|
|
4929
|
+
function rn(t) {
|
|
4863
4930
|
const e = {
|
|
4864
4931
|
frameInputs: ["input", 0],
|
|
4865
4932
|
frameFiles: ["file", 0],
|
|
@@ -4870,10 +4937,10 @@ function tn(t) {
|
|
|
4870
4937
|
};
|
|
4871
4938
|
return Object.keys(e).reduce((r, i) => (r[i] = I("frame", (s) => s.props({ type: e[i][0], maxLength: e[i][1] })), r), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages, t;
|
|
4872
4939
|
}
|
|
4873
|
-
function
|
|
4940
|
+
function Ft(t, e) {
|
|
4874
4941
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4875
4942
|
}
|
|
4876
|
-
function
|
|
4943
|
+
function nn(t, e) {
|
|
4877
4944
|
return {
|
|
4878
4945
|
formEl() {
|
|
4879
4946
|
return e.$manager.form();
|
|
@@ -4900,7 +4967,7 @@ function rn(t, e) {
|
|
|
4900
4967
|
const o = e.getFieldCtx(r);
|
|
4901
4968
|
if (!o) return;
|
|
4902
4969
|
const a = e.subForm[o.id], l = [e.$manager.validateField(o.id)];
|
|
4903
|
-
|
|
4970
|
+
H(a).forEach((u) => {
|
|
4904
4971
|
l.push(u.validate());
|
|
4905
4972
|
}), Promise.all(l).then(() => {
|
|
4906
4973
|
s(null), i && i(null);
|
|
@@ -4949,11 +5016,11 @@ function rn(t, e) {
|
|
|
4949
5016
|
}
|
|
4950
5017
|
},
|
|
4951
5018
|
submitBtnProps: (r = {}) => {
|
|
4952
|
-
let i =
|
|
5019
|
+
let i = Ft(e.options.submitBtn, !0);
|
|
4953
5020
|
_(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4954
5021
|
},
|
|
4955
5022
|
resetBtnProps: (r = {}) => {
|
|
4956
|
-
let i =
|
|
5023
|
+
let i = Ft(e.options.resetBtn, !1);
|
|
4957
5024
|
_(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4958
5025
|
},
|
|
4959
5026
|
submit(r, i) {
|
|
@@ -4971,23 +5038,24 @@ function rn(t, e) {
|
|
|
4971
5038
|
const Jt = {
|
|
4972
5039
|
name: "required",
|
|
4973
5040
|
load(t, e, r) {
|
|
4974
|
-
|
|
5041
|
+
var s, n;
|
|
5042
|
+
const i = sn(t.getValue());
|
|
4975
5043
|
if (i.required === !1)
|
|
4976
5044
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4977
5045
|
else {
|
|
4978
|
-
const
|
|
5046
|
+
const o = b({
|
|
4979
5047
|
required: !0,
|
|
4980
|
-
validator(
|
|
4981
|
-
h.empty(
|
|
5048
|
+
validator(l, u, c) {
|
|
5049
|
+
h.empty(u) ? c(o.message) : c();
|
|
4982
5050
|
}
|
|
4983
|
-
}, i), n = e.__fc__.refRule.__$title.value;
|
|
4984
|
-
if (!
|
|
4985
|
-
|
|
5051
|
+
}, i), a = (n = (s = e.__fc__.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value;
|
|
5052
|
+
if (!o.message)
|
|
5053
|
+
o.message = r.t("required", { title: a }) || a + (r.getLocale() === "en" ? " is required" : "不能为空");
|
|
4986
5054
|
else {
|
|
4987
|
-
const
|
|
4988
|
-
|
|
5055
|
+
const l = o.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5056
|
+
l && (o.message = r.t(l[1], { title: a }));
|
|
4989
5057
|
}
|
|
4990
|
-
t.getProp().validate = [
|
|
5058
|
+
t.getProp().validate = [o];
|
|
4991
5059
|
}
|
|
4992
5060
|
r.sync(e);
|
|
4993
5061
|
},
|
|
@@ -4995,25 +5063,25 @@ const Jt = {
|
|
|
4995
5063
|
Jt.load(...t);
|
|
4996
5064
|
}
|
|
4997
5065
|
};
|
|
4998
|
-
function
|
|
5066
|
+
function sn(t) {
|
|
4999
5067
|
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
5068
|
}
|
|
5001
|
-
function
|
|
5002
|
-
t.componentAlias(
|
|
5069
|
+
function on(t) {
|
|
5070
|
+
t.componentAlias(Ki), Mr.forEach((e) => {
|
|
5003
5071
|
t.component(e.name, e);
|
|
5004
|
-
}), t.register(Jt),
|
|
5072
|
+
}), t.register(Jt), Wi.forEach((e) => {
|
|
5005
5073
|
t.parser(e);
|
|
5006
|
-
}), Object.keys(
|
|
5007
|
-
t.maker[e] =
|
|
5074
|
+
}), Object.keys(fe).forEach((e) => {
|
|
5075
|
+
t.maker[e] = fe[e];
|
|
5008
5076
|
});
|
|
5009
5077
|
}
|
|
5010
|
-
function
|
|
5078
|
+
function an() {
|
|
5011
5079
|
return Gt({
|
|
5012
5080
|
ui: "element-ui",
|
|
5013
|
-
version: "2.7.
|
|
5014
|
-
manager:
|
|
5015
|
-
extendApi:
|
|
5016
|
-
install:
|
|
5081
|
+
version: "2.7.4",
|
|
5082
|
+
manager: Zi,
|
|
5083
|
+
extendApi: nn,
|
|
5084
|
+
install: on,
|
|
5017
5085
|
attrs: {
|
|
5018
5086
|
normal: ["col", "wrap"],
|
|
5019
5087
|
array: ["className"],
|
|
@@ -5021,10 +5089,10 @@ function on() {
|
|
|
5021
5089
|
}
|
|
5022
5090
|
});
|
|
5023
5091
|
}
|
|
5024
|
-
const ze =
|
|
5092
|
+
const ze = an();
|
|
5025
5093
|
typeof window != "undefined" && (window.formCreate = ze, window.Vue && ze.install(window.Vue));
|
|
5026
|
-
const
|
|
5094
|
+
const cn = ze.maker;
|
|
5027
5095
|
export {
|
|
5028
5096
|
ze as default,
|
|
5029
|
-
|
|
5097
|
+
cn as maker
|
|
5030
5098
|
};
|