@form-create/view-design 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 +953 -883
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +4 -4
package/dist/form-create.esm.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/view-design v2.7.
|
|
3
|
+
* @form-create/view-design 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-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-frame .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-frame .fc-files:hover .fc-upload-cover{opacity:1}._fc-frame .ivu-upload-list{margin-top:0}._fc-frame .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame .fc-upload-btn,._fc-frame .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-upload .fc-upload-cover i{color:#fff;font-size:20px;cursor:pointer;margin:0 2px}._fc-upload .fc-files:hover .fc-upload-cover{opacity:1}._fc-upload .ivu-upload-list{margin-top:0}._fc-upload .fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-upload .fc-upload-btn,._fc-upload .fc-files{display:inline-block;width:58px;height:58px;text-align:center;line-height:58px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-group{display:flex;min-height:42px;justify-content:center;flex-direction:column}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;padding:20px 20px 25px;margin:5px 5px 25px;border-radius:5px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}.form-create .form-create .ivu-form-item{margin-bottom:24px}.form-create .form-create .ivu-form-item .ivu-form-item{margin-bottom:0}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var ir = Object.defineProperty, nr = Object.defineProperties;
|
|
11
|
+
var sr = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var ot = Object.getOwnPropertySymbols;
|
|
13
|
-
var
|
|
14
|
-
var at = (t, e, r) => e in t ?
|
|
13
|
+
var or = Object.prototype.hasOwnProperty, ar = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var at = (t, e, r) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, b = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
|
-
|
|
16
|
+
or.call(e, r) && at(t, r, e[r]);
|
|
17
17
|
if (ot)
|
|
18
18
|
for (var r of ot(e))
|
|
19
|
-
|
|
19
|
+
ar.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
|
-
},
|
|
22
|
-
import
|
|
23
|
-
function
|
|
21
|
+
}, U = (t, e) => nr(t, sr(e));
|
|
22
|
+
import ye, { getCurrentInstance as lr, provide as ur, inject as fr, toRefs as lt, reactive as ie, onBeforeMount as cr, watch as B, onMounted as hr, onBeforeUnmount as dr, onUpdated as pr, nextTick as P, markRaw as me, computed as ge, toRef as Ee, ref as mr } from "vue";
|
|
23
|
+
function gr(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 yr = ["attrs", "props", "domProps"], $r = ["class", "style", "directives"], vr = ["on", "nativeOn"], br = 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 (yr.indexOf(i) !== -1) e[i] = He({}, e[i], r[i]);
|
|
36
|
+
else if ($r.indexOf(i) !== -1) {
|
|
37
37
|
var s = e[i] instanceof Array ? e[i] : [e[i]], n = r[i] instanceof Array ? r[i] : [r[i]];
|
|
38
38
|
e[i] = [].concat(s, n);
|
|
39
|
-
} else if (
|
|
39
|
+
} else if (vr.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] ? _r(e[i][u], r[i][u]) : r[i][u];
|
|
45
45
|
else e[i] = r[i];
|
|
46
46
|
return e;
|
|
47
47
|
}, {});
|
|
48
|
-
},
|
|
48
|
+
}, _r = function(t, e) {
|
|
49
49
|
return function() {
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
function
|
|
52
|
+
}, Cr = br;
|
|
53
|
+
const I = /* @__PURE__ */ gr(Cr);
|
|
54
|
+
function je(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const wr = "fcCheckbox", Or = {
|
|
58
|
+
name: wr,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -100,7 +100,7 @@ const Cr = "fcCheckbox", wr = {
|
|
|
100
100
|
},
|
|
101
101
|
render() {
|
|
102
102
|
const t = arguments[0];
|
|
103
|
-
return t("CheckboxGroup",
|
|
103
|
+
return t("CheckboxGroup", I([{}, this.formCreateInject.prop, {
|
|
104
104
|
ref: "el"
|
|
105
105
|
}, {
|
|
106
106
|
props: {
|
|
@@ -112,24 +112,24 @@ const Cr = "fcCheckbox", wr = {
|
|
|
112
112
|
}
|
|
113
113
|
}]), [this.options().map((e, r) => {
|
|
114
114
|
const i = b({}, e);
|
|
115
|
-
return delete i.value, t("Checkbox",
|
|
115
|
+
return delete i.value, t("Checkbox", I([{}, {
|
|
116
116
|
props: i
|
|
117
117
|
}, {
|
|
118
118
|
key: "" + r + "-" + e.value
|
|
119
119
|
}]));
|
|
120
|
-
}),
|
|
120
|
+
}), je(this.$slots)]);
|
|
121
121
|
},
|
|
122
122
|
mounted() {
|
|
123
123
|
this.$emit("fc.el", this.$refs.el);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function G(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
129
|
+
const Fr = "fcFrame";
|
|
130
130
|
function Ot(t) {
|
|
131
131
|
return {
|
|
132
|
-
name:
|
|
132
|
+
name: Fr,
|
|
133
133
|
props: {
|
|
134
134
|
formCreateInject: {
|
|
135
135
|
type: Object,
|
|
@@ -250,7 +250,7 @@ function Ot(t) {
|
|
|
250
250
|
},
|
|
251
251
|
data() {
|
|
252
252
|
return {
|
|
253
|
-
fileList:
|
|
253
|
+
fileList: G(this.value),
|
|
254
254
|
previewVisible: !1,
|
|
255
255
|
frameVisible: !1,
|
|
256
256
|
previewImage: ""
|
|
@@ -258,7 +258,7 @@ function Ot(t) {
|
|
|
258
258
|
},
|
|
259
259
|
watch: {
|
|
260
260
|
value(e) {
|
|
261
|
-
this.fileList =
|
|
261
|
+
this.fileList = G(e);
|
|
262
262
|
},
|
|
263
263
|
fileList(e) {
|
|
264
264
|
const r = this.maxLength === 1 ? e[0] || "" : e;
|
|
@@ -286,7 +286,7 @@ function Ot(t) {
|
|
|
286
286
|
readonly: !0,
|
|
287
287
|
clearable: !1
|
|
288
288
|
};
|
|
289
|
-
return e("Input",
|
|
289
|
+
return e("Input", I([{}, {
|
|
290
290
|
props: r
|
|
291
291
|
}, {}, {
|
|
292
292
|
on: {
|
|
@@ -325,7 +325,7 @@ function Ot(t) {
|
|
|
325
325
|
},
|
|
326
326
|
makeHandleIcon(e, r) {
|
|
327
327
|
const i = this.$createElement;
|
|
328
|
-
return i("icon",
|
|
328
|
+
return i("icon", I([{}, {
|
|
329
329
|
props: {
|
|
330
330
|
type: this.handleIcon === !0 || this.handleIcon === void 0 ? "ios-eye-outline" : this.handleIcon
|
|
331
331
|
}
|
|
@@ -338,7 +338,7 @@ function Ot(t) {
|
|
|
338
338
|
},
|
|
339
339
|
makeRemoveIcon(e, r) {
|
|
340
340
|
const i = this.$createElement;
|
|
341
|
-
return i("icon",
|
|
341
|
+
return i("icon", I([{}, {
|
|
342
342
|
props: {
|
|
343
343
|
type: "ios-trash-outline"
|
|
344
344
|
}
|
|
@@ -351,7 +351,7 @@ function Ot(t) {
|
|
|
351
351
|
},
|
|
352
352
|
makeFiles() {
|
|
353
353
|
const e = this.$createElement;
|
|
354
|
-
return this.makeGroup(this.fileList.map((r, i) => this.makeItem(i, [e("icon",
|
|
354
|
+
return this.makeGroup(this.fileList.map((r, i) => this.makeItem(i, [e("icon", I([{}, {
|
|
355
355
|
props: {
|
|
356
356
|
type: t.fileIcon,
|
|
357
357
|
size: 40
|
|
@@ -378,7 +378,7 @@ function Ot(t) {
|
|
|
378
378
|
click: () => this.showModel()
|
|
379
379
|
},
|
|
380
380
|
key: this.key("btn")
|
|
381
|
-
}, [e("icon",
|
|
381
|
+
}, [e("icon", I([{}, {
|
|
382
382
|
props: {
|
|
383
383
|
type: this.icon,
|
|
384
384
|
size: 20
|
|
@@ -450,7 +450,7 @@ function Ot(t) {
|
|
|
450
450
|
this.$refs.frame && this.frameLoad(this.$refs.frame.contentWindow || {});
|
|
451
451
|
}), e("div", {
|
|
452
452
|
class: "_fc-frame"
|
|
453
|
-
}, [i, e("Modal",
|
|
453
|
+
}, [i, e("Modal", I([{}, {
|
|
454
454
|
props: {
|
|
455
455
|
mask: this.previewMask,
|
|
456
456
|
title: l,
|
|
@@ -468,7 +468,7 @@ function Ot(t) {
|
|
|
468
468
|
attrs: {
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
|
-
})]), e("Modal",
|
|
471
|
+
})]), e("Modal", I([{}, {
|
|
472
472
|
props: b({
|
|
473
473
|
width: s,
|
|
474
474
|
title: a
|
|
@@ -511,8 +511,8 @@ Ft.v2 = Ot({
|
|
|
511
511
|
fileIcon: "document-text",
|
|
512
512
|
fileUpIcon: "folder"
|
|
513
513
|
});
|
|
514
|
-
const
|
|
515
|
-
name:
|
|
514
|
+
const Sr = "fcRadio", Rr = {
|
|
515
|
+
name: Sr,
|
|
516
516
|
props: {
|
|
517
517
|
formCreateInject: {
|
|
518
518
|
type: Object,
|
|
@@ -553,7 +553,7 @@ const Fr = "fcRadio", Sr = {
|
|
|
553
553
|
},
|
|
554
554
|
render() {
|
|
555
555
|
const t = arguments[0];
|
|
556
|
-
return t("RadioGroup",
|
|
556
|
+
return t("RadioGroup", I([{}, this.formCreateInject.prop, {}, {
|
|
557
557
|
props: {
|
|
558
558
|
value: this.trueValue
|
|
559
559
|
}
|
|
@@ -564,12 +564,12 @@ const Fr = "fcRadio", Sr = {
|
|
|
564
564
|
}
|
|
565
565
|
}]), [this.options().map((e, r) => {
|
|
566
566
|
const i = b({}, e);
|
|
567
|
-
return delete i.value, t("Radio",
|
|
567
|
+
return delete i.value, t("Radio", I([{}, {
|
|
568
568
|
props: i
|
|
569
569
|
}, {
|
|
570
570
|
key: "" + r + "-" + e.value
|
|
571
571
|
}]));
|
|
572
|
-
}),
|
|
572
|
+
}), je(this.$slots)]);
|
|
573
573
|
},
|
|
574
574
|
mounted() {
|
|
575
575
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -604,10 +604,10 @@ const Fr = "fcRadio", Sr = {
|
|
|
604
604
|
return h.type(e, t);
|
|
605
605
|
};
|
|
606
606
|
});
|
|
607
|
-
function
|
|
607
|
+
function E(t, e) {
|
|
608
608
|
return {}.hasOwnProperty.call(t, e);
|
|
609
609
|
}
|
|
610
|
-
const kr = "fcSelect",
|
|
610
|
+
const kr = "fcSelect", Er = {
|
|
611
611
|
name: kr,
|
|
612
612
|
functional: !0,
|
|
613
613
|
props: {
|
|
@@ -619,7 +619,7 @@ const kr = "fcSelect", Rr = {
|
|
|
619
619
|
render(t, e) {
|
|
620
620
|
const r = (n, o) => {
|
|
621
621
|
const a = n.slot;
|
|
622
|
-
return t("Option",
|
|
622
|
+
return t("Option", I([{}, {
|
|
623
623
|
props: n
|
|
624
624
|
}, {
|
|
625
625
|
key: "" + o + "-" + n.value
|
|
@@ -632,15 +632,15 @@ const kr = "fcSelect", Rr = {
|
|
|
632
632
|
},
|
|
633
633
|
key: "" + o + "-" + n.label
|
|
634
634
|
}, [h.trueArray(n.options) && n.options.map((a, l) => r(a, l))]), s = e.props.formCreateInject.options;
|
|
635
|
-
return t("Select",
|
|
635
|
+
return t("Select", I([{}, e.data, {
|
|
636
636
|
ref: "el"
|
|
637
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
637
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => E(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
638
638
|
},
|
|
639
639
|
mounted() {
|
|
640
640
|
this.$emit("fc.el", this.$refs.el);
|
|
641
641
|
}
|
|
642
|
-
},
|
|
643
|
-
name:
|
|
642
|
+
}, Dr = "fcTree", jr = {
|
|
643
|
+
name: Dr,
|
|
644
644
|
props: {
|
|
645
645
|
formCreateInject: {
|
|
646
646
|
type: Object,
|
|
@@ -670,7 +670,7 @@ const kr = "fcSelect", Rr = {
|
|
|
670
670
|
},
|
|
671
671
|
methods: {
|
|
672
672
|
setStatus(t) {
|
|
673
|
-
const e =
|
|
673
|
+
const e = G(t), r = this.formCreateInject.prop.props.data;
|
|
674
674
|
this.type === "selected" ? this.checked(r, e, "selected") : this.checked(r, e, "checked"), this.$forceUpdate();
|
|
675
675
|
},
|
|
676
676
|
checked(t, e, r) {
|
|
@@ -684,11 +684,11 @@ const kr = "fcSelect", Rr = {
|
|
|
684
684
|
},
|
|
685
685
|
render() {
|
|
686
686
|
const t = arguments[0], e = {};
|
|
687
|
-
return this.type === "selected" ? e["on-select-change"] = this.onInput : e["on-check-change"] = this.onInput, t("Tree",
|
|
687
|
+
return this.type === "selected" ? e["on-select-change"] = this.onInput : e["on-check-change"] = this.onInput, t("Tree", I([{}, this.formCreateInject.prop, {
|
|
688
688
|
ref: "tree"
|
|
689
689
|
}, {
|
|
690
690
|
on: e
|
|
691
|
-
}]), [
|
|
691
|
+
}]), [je(this.$slots)]);
|
|
692
692
|
},
|
|
693
693
|
mounted() {
|
|
694
694
|
this.$emit("fc.el", this.$refs.tree);
|
|
@@ -698,22 +698,22 @@ function ut(t) {
|
|
|
698
698
|
return typeof t == "object" ? t : {
|
|
699
699
|
url: t,
|
|
700
700
|
is_string: !0,
|
|
701
|
-
name:
|
|
701
|
+
name: Ir(t)
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
704
|
function ft(t) {
|
|
705
|
-
return
|
|
705
|
+
return U(b({}, t), {
|
|
706
706
|
file: t,
|
|
707
707
|
value: t
|
|
708
708
|
});
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Ir(t) {
|
|
711
711
|
return ("" + t).split("/").pop();
|
|
712
712
|
}
|
|
713
|
-
const
|
|
713
|
+
const Ar = "fcUpload";
|
|
714
714
|
function St(t) {
|
|
715
715
|
return {
|
|
716
|
-
name:
|
|
716
|
+
name: Ar,
|
|
717
717
|
props: {
|
|
718
718
|
formCreateInject: {
|
|
719
719
|
type: Object,
|
|
@@ -754,11 +754,11 @@ function St(t) {
|
|
|
754
754
|
};
|
|
755
755
|
},
|
|
756
756
|
created() {
|
|
757
|
-
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList =
|
|
757
|
+
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList = G(this.value).map(ut).map(ft);
|
|
758
758
|
},
|
|
759
759
|
watch: {
|
|
760
760
|
value(e) {
|
|
761
|
-
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList =
|
|
761
|
+
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList = G(e).map(ut).map(ft), this.uploadList = this.$refs.upload.fileList);
|
|
762
762
|
},
|
|
763
763
|
maxLength(e, r) {
|
|
764
764
|
(r === 1 || e === 1) && this.update();
|
|
@@ -784,7 +784,7 @@ function St(t) {
|
|
|
784
784
|
src: e.url
|
|
785
785
|
},
|
|
786
786
|
key: this.key("img" + r)
|
|
787
|
-
}) : i("icon",
|
|
787
|
+
}) : i("icon", I([{}, {
|
|
788
788
|
props: {
|
|
789
789
|
type: t.fileIcon,
|
|
790
790
|
size: 40
|
|
@@ -819,7 +819,7 @@ function St(t) {
|
|
|
819
819
|
},
|
|
820
820
|
makeProgress(e, r) {
|
|
821
821
|
const i = this.$createElement;
|
|
822
|
-
return i("Progress",
|
|
822
|
+
return i("Progress", I([{}, {
|
|
823
823
|
props: {
|
|
824
824
|
percent: e.percentage,
|
|
825
825
|
hideInfo: !0
|
|
@@ -849,7 +849,7 @@ function St(t) {
|
|
|
849
849
|
},
|
|
850
850
|
makeUpload() {
|
|
851
851
|
const e = this.$createElement, r = !this.maxLength || this.maxLength > this.uploadList.length;
|
|
852
|
-
return e("Upload",
|
|
852
|
+
return e("Upload", I([{}, this.formCreateInject.prop, {}, {
|
|
853
853
|
style: {
|
|
854
854
|
display: "inline-block"
|
|
855
855
|
},
|
|
@@ -859,12 +859,12 @@ function St(t) {
|
|
|
859
859
|
slot: "default"
|
|
860
860
|
}, [this.$slots.default || e("div", {
|
|
861
861
|
class: "fc-upload-btn"
|
|
862
|
-
}, [e("icon",
|
|
862
|
+
}, [e("icon", I([{}, {
|
|
863
863
|
props: {
|
|
864
864
|
type: this.uploadType === "file" ? "ios-cloud-upload-outline" : t.imgUpIcon,
|
|
865
865
|
size: 20
|
|
866
866
|
}
|
|
867
|
-
}]))])]) : null,
|
|
867
|
+
}]))])]) : null, je(this.$slots, ["default"])]);
|
|
868
868
|
},
|
|
869
869
|
update() {
|
|
870
870
|
let e = this.$refs.upload.fileList.map((r) => r.is_string ? r.url : r.value || r.url).filter((r) => r !== void 0);
|
|
@@ -878,7 +878,7 @@ function St(t) {
|
|
|
878
878
|
const e = arguments[0];
|
|
879
879
|
return this.$refs.upload && (this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = this.$refs.upload.showUploadList), this.formCreateInject.prop.props.defaultFileList = this.$refs.upload.defaultFileList), e("div", {
|
|
880
880
|
class: "_fc-upload"
|
|
881
|
-
}, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], e("Modal",
|
|
881
|
+
}, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], e("Modal", I([{}, {
|
|
882
882
|
props: {
|
|
883
883
|
title: this.modalTitle,
|
|
884
884
|
footerHide: !0
|
|
@@ -907,21 +907,21 @@ function St(t) {
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
|
-
const
|
|
910
|
+
const Rt = St({
|
|
911
911
|
fileIcon: "md-document",
|
|
912
912
|
imgUpIcon: "md-images"
|
|
913
913
|
});
|
|
914
|
-
|
|
914
|
+
Rt.v2 = St({
|
|
915
915
|
fileIcon: "document-text",
|
|
916
916
|
imgUpIcon: "image"
|
|
917
917
|
});
|
|
918
918
|
function S(t, e, r) {
|
|
919
|
-
|
|
919
|
+
ye.set(t, e, r);
|
|
920
920
|
}
|
|
921
|
-
function
|
|
922
|
-
(
|
|
921
|
+
function re(t, e) {
|
|
922
|
+
(ye.del || ye.delete)(t, e);
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function be(t, e = {}, r) {
|
|
925
925
|
let i = !1;
|
|
926
926
|
for (let s in e)
|
|
927
927
|
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
@@ -939,29 +939,29 @@ function ye(t, e = {}, r) {
|
|
|
939
939
|
}
|
|
940
940
|
else
|
|
941
941
|
o && S(t, s, {});
|
|
942
|
-
t[s] =
|
|
942
|
+
t[s] = be(t[s], n, r);
|
|
943
943
|
} else
|
|
944
944
|
S(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
|
|
945
945
|
}
|
|
946
946
|
return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
|
|
947
947
|
}
|
|
948
|
-
function
|
|
949
|
-
return
|
|
948
|
+
function W(t) {
|
|
949
|
+
return be({}, { value: t }).value;
|
|
950
950
|
}
|
|
951
|
-
const
|
|
951
|
+
const Vr = Object.assign || function(t) {
|
|
952
952
|
for (let e, r = 1; r < arguments.length; r++)
|
|
953
953
|
for (let i in e = arguments[r], e)
|
|
954
954
|
Object.prototype.hasOwnProperty.call(e, i) && S(t, i, e[i]);
|
|
955
955
|
return t;
|
|
956
956
|
};
|
|
957
|
-
function
|
|
958
|
-
return
|
|
957
|
+
function C() {
|
|
958
|
+
return Vr.apply(this, arguments);
|
|
959
959
|
}
|
|
960
960
|
function Je(t) {
|
|
961
961
|
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : b({}, t);
|
|
962
962
|
}
|
|
963
|
-
const
|
|
964
|
-
name:
|
|
963
|
+
const Pr = "fcGroup", Br = {
|
|
964
|
+
name: Pr,
|
|
965
965
|
props: {
|
|
966
966
|
field: String,
|
|
967
967
|
rule: [Array, Object],
|
|
@@ -1042,13 +1042,13 @@ const Vr = "fcGroup", Pr = {
|
|
|
1042
1042
|
const s = i.$f.formData();
|
|
1043
1043
|
if (t === e)
|
|
1044
1044
|
i.$f.deferSyncValue(() => {
|
|
1045
|
-
|
|
1045
|
+
be(i.rule, t), i.$f.setValue(s);
|
|
1046
1046
|
}, !0);
|
|
1047
1047
|
else {
|
|
1048
1048
|
const n = i.$f.formData();
|
|
1049
1049
|
i.$f.once("reloading", () => {
|
|
1050
1050
|
i.$f.setValue(n);
|
|
1051
|
-
}), i.rule =
|
|
1051
|
+
}), i.rule = W(t);
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
1054
|
});
|
|
@@ -1069,10 +1069,12 @@ const Vr = "fcGroup", Pr = {
|
|
|
1069
1069
|
for (let n = 0; n < i; n++)
|
|
1070
1070
|
this.setValue(r[n], t[n]);
|
|
1071
1071
|
} else {
|
|
1072
|
-
if (s > 0)
|
|
1072
|
+
if (s > 0) {
|
|
1073
1073
|
for (let n = 0; n < s; n++)
|
|
1074
1074
|
this.removeRule(r[i - n - 1]);
|
|
1075
|
-
|
|
1075
|
+
this.sort = Object.keys(this.cacheRule);
|
|
1076
|
+
}
|
|
1077
|
+
t.forEach((n, o) => {
|
|
1076
1078
|
this.setValue(r[o], t[o]);
|
|
1077
1079
|
});
|
|
1078
1080
|
}
|
|
@@ -1080,7 +1082,7 @@ const Vr = "fcGroup", Pr = {
|
|
|
1080
1082
|
},
|
|
1081
1083
|
methods: {
|
|
1082
1084
|
_value(t) {
|
|
1083
|
-
return t &&
|
|
1085
|
+
return t && E(t, this.field) ? t[this.field] : t;
|
|
1084
1086
|
},
|
|
1085
1087
|
cache(t, e) {
|
|
1086
1088
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1111,8 +1113,8 @@ const Vr = "fcGroup", Pr = {
|
|
|
1111
1113
|
};
|
|
1112
1114
|
if (this.defaultValue) {
|
|
1113
1115
|
i.formData || (i.formData = {});
|
|
1114
|
-
const s =
|
|
1115
|
-
|
|
1116
|
+
const s = W(this.defaultValue);
|
|
1117
|
+
C(i.formData, this.field ? {
|
|
1116
1118
|
[this.field]: s
|
|
1117
1119
|
} : s);
|
|
1118
1120
|
}
|
|
@@ -1230,13 +1232,13 @@ const Vr = "fcGroup", Pr = {
|
|
|
1230
1232
|
return t("div", {
|
|
1231
1233
|
class: "_fc-group-container",
|
|
1232
1234
|
key: o
|
|
1233
|
-
}, [t(i,
|
|
1235
|
+
}, [t(i, I([{
|
|
1234
1236
|
key: o
|
|
1235
1237
|
}, {
|
|
1236
1238
|
on: {
|
|
1237
|
-
"update:value": (
|
|
1238
|
-
"emit-event": (
|
|
1239
|
-
input: (
|
|
1239
|
+
"update:value": (d) => this.formData(o, d),
|
|
1240
|
+
"emit-event": (d, ...m) => this.emitEvent(d, m, a, o),
|
|
1241
|
+
input: (d) => this.add$f(a, o, d)
|
|
1240
1242
|
}
|
|
1241
1243
|
}, {}, {
|
|
1242
1244
|
props: {
|
|
@@ -1260,8 +1262,8 @@ const Vr = "fcGroup", Pr = {
|
|
|
1260
1262
|
class: "_fc-group " + (s ? "_fc-group-disabled" : "")
|
|
1261
1263
|
}, [n]);
|
|
1262
1264
|
}
|
|
1263
|
-
},
|
|
1264
|
-
name:
|
|
1265
|
+
}, Lr = "fcSubForm", Tr = {
|
|
1266
|
+
name: Lr,
|
|
1265
1267
|
props: {
|
|
1266
1268
|
rule: Array,
|
|
1267
1269
|
options: Object,
|
|
@@ -1329,7 +1331,7 @@ const Vr = "fcGroup", Pr = {
|
|
|
1329
1331
|
rule: e,
|
|
1330
1332
|
options: r
|
|
1331
1333
|
} = this.cacheRule, i = this.type;
|
|
1332
|
-
return t(i,
|
|
1334
|
+
return t(i, I([{}, {
|
|
1333
1335
|
on: {
|
|
1334
1336
|
"update:value": this.formData,
|
|
1335
1337
|
"emit-event": this.emitEvent,
|
|
@@ -1344,35 +1346,35 @@ const Vr = "fcGroup", Pr = {
|
|
|
1344
1346
|
}
|
|
1345
1347
|
}]));
|
|
1346
1348
|
}
|
|
1347
|
-
},
|
|
1348
|
-
|
|
1349
|
-
Sr,
|
|
1349
|
+
}, Nr = [
|
|
1350
|
+
Or,
|
|
1350
1351
|
Rr,
|
|
1351
|
-
|
|
1352
|
-
|
|
1352
|
+
Er,
|
|
1353
|
+
jr,
|
|
1354
|
+
Tr,
|
|
1353
1355
|
Ft,
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
+
Rt,
|
|
1357
|
+
Br
|
|
1356
1358
|
];
|
|
1357
|
-
function
|
|
1359
|
+
function ne(t, e) {
|
|
1358
1360
|
var r = null;
|
|
1359
1361
|
return function(...i) {
|
|
1360
1362
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1361
1363
|
};
|
|
1362
1364
|
}
|
|
1363
|
-
function
|
|
1365
|
+
function ve(t) {
|
|
1364
1366
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1365
1367
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1366
1368
|
}
|
|
1367
|
-
const
|
|
1369
|
+
const Re = (t, e) => {
|
|
1368
1370
|
if (!(!t || t === e || !t.$props)) {
|
|
1369
1371
|
if (t.$props.formCreateInject)
|
|
1370
1372
|
return t.$props.formCreateInject;
|
|
1371
1373
|
if (t.$parent)
|
|
1372
|
-
return
|
|
1374
|
+
return Re(t.$parent, e);
|
|
1373
1375
|
}
|
|
1374
1376
|
};
|
|
1375
|
-
function
|
|
1377
|
+
function Mr(t, e, r) {
|
|
1376
1378
|
const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
|
|
1377
1379
|
return {
|
|
1378
1380
|
name: i,
|
|
@@ -1423,100 +1425,102 @@ function Nr(t, e, r) {
|
|
|
1423
1425
|
return this.fc.render();
|
|
1424
1426
|
},
|
|
1425
1427
|
setup(s) {
|
|
1426
|
-
const n =
|
|
1427
|
-
|
|
1428
|
-
const o =
|
|
1428
|
+
const n = lr().proxy;
|
|
1429
|
+
ur("parentFC", n);
|
|
1430
|
+
const o = fr("parentFC", null);
|
|
1429
1431
|
let a = o;
|
|
1430
1432
|
if (o)
|
|
1431
1433
|
for (; a.parent; )
|
|
1432
1434
|
a = a.parent;
|
|
1433
1435
|
else
|
|
1434
1436
|
a = n;
|
|
1435
|
-
const { rule: l, value: u, subForm: f, inFor:
|
|
1437
|
+
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), m = ie({
|
|
1436
1438
|
ctxInject: {},
|
|
1437
1439
|
destroyed: !1,
|
|
1438
1440
|
isShow: !0,
|
|
1439
1441
|
unique: 1,
|
|
1440
1442
|
renderRule: [...l.value || []],
|
|
1441
1443
|
updateValue: JSON.stringify(u.value || {})
|
|
1442
|
-
}),
|
|
1444
|
+
}), g = new t(n), $ = g.api(), _ = d.value, D = () => {
|
|
1443
1445
|
if (o) {
|
|
1444
|
-
const
|
|
1445
|
-
if (
|
|
1446
|
-
let
|
|
1447
|
-
|
|
1446
|
+
const F = Re(n, o);
|
|
1447
|
+
if (F) {
|
|
1448
|
+
let R;
|
|
1449
|
+
_ ? (R = G(F.getSubForm()), R.push($)) : R = $, F.subForm(R);
|
|
1448
1450
|
}
|
|
1449
1451
|
}
|
|
1450
|
-
},
|
|
1451
|
-
const
|
|
1452
|
-
if (
|
|
1453
|
-
if (
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1452
|
+
}, ee = () => {
|
|
1453
|
+
const F = Re(n, o);
|
|
1454
|
+
if (F)
|
|
1455
|
+
if (_) {
|
|
1456
|
+
const R = G(F.getSubForm()), N = R.indexOf($);
|
|
1457
|
+
N > -1 && R.splice(N, 1);
|
|
1456
1458
|
} else
|
|
1457
|
-
|
|
1459
|
+
F.subForm();
|
|
1458
1460
|
};
|
|
1459
1461
|
let V = null;
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
let
|
|
1463
|
-
const
|
|
1464
|
-
Object.keys(
|
|
1465
|
-
let
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
}),
|
|
1469
|
-
}), s.option && s.option.style && (
|
|
1462
|
+
cr(() => {
|
|
1463
|
+
B(() => {
|
|
1464
|
+
let F = "";
|
|
1465
|
+
const R = s.option && s.option.globalClass || {};
|
|
1466
|
+
Object.keys(R).forEach((N) => {
|
|
1467
|
+
let de = "";
|
|
1468
|
+
R[N].style && Object.keys(R[N].style).forEach((H) => {
|
|
1469
|
+
de += ve(H) + ":" + R[N].style[H] + ";";
|
|
1470
|
+
}), R[N].content && (de += R[N].content + ";"), de && (F += `.${N}{${de}}`);
|
|
1471
|
+
}), s.option && s.option.style && (F += s.option.style), V || (V = document.createElement("style"), V.type = "text/css", document.head.appendChild(V)), V.innerHTML = F || "";
|
|
1470
1472
|
}, () => {
|
|
1471
1473
|
});
|
|
1472
1474
|
});
|
|
1473
|
-
const T =
|
|
1474
|
-
|
|
1475
|
-
}, 100),
|
|
1476
|
-
|
|
1477
|
-
}, 100),
|
|
1478
|
-
|
|
1475
|
+
const T = ne(() => {
|
|
1476
|
+
g.bus.$emit("$loadData.$topForm");
|
|
1477
|
+
}, 100), ce = ne(function() {
|
|
1478
|
+
g.bus.$emit("$loadData.$scopeForm");
|
|
1479
|
+
}, 100), Ae = ne(() => {
|
|
1480
|
+
g.bus.$emit("$loadData.$form");
|
|
1481
|
+
}, 100), he = (F) => {
|
|
1482
|
+
g.bus.$emit("change-$form." + F);
|
|
1479
1483
|
};
|
|
1480
|
-
return
|
|
1481
|
-
o && (
|
|
1482
|
-
}), hr(() => {
|
|
1483
|
-
o && (v.top.bus.$off("$loadData.$form", T), v.top.bus.$off("change", $e)), V && document.head.removeChild(V), Z(), p.destroyed = !0, y.unmount();
|
|
1484
|
+
return hr(() => {
|
|
1485
|
+
o && ($.top.bus.$on("$loadData.$form", T), $.top.bus.$on("change", he)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", ce), g.mounted();
|
|
1484
1486
|
}), dr(() => {
|
|
1485
|
-
|
|
1486
|
-
}),
|
|
1487
|
-
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
}),
|
|
1491
|
-
|
|
1492
|
-
}, { deep: !0 }),
|
|
1493
|
-
|
|
1494
|
-
}),
|
|
1495
|
-
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1487
|
+
o && ($.top.bus.$off("$loadData.$form", T), $.top.bus.$off("change", he)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", ce), V && document.head.removeChild(V), ee(), m.destroyed = !0, g.unmount();
|
|
1488
|
+
}), pr(() => {
|
|
1489
|
+
g.updated();
|
|
1490
|
+
}), B(f, (F) => {
|
|
1491
|
+
F ? D() : ee();
|
|
1492
|
+
}, { immediate: !0 }), B(() => s.option, () => {
|
|
1493
|
+
g.initOptions(), $.refresh();
|
|
1494
|
+
}, { deep: !0 }), B(() => [...l.value], (F) => {
|
|
1495
|
+
g.$handle.isBreakWatch() || F.length === m.renderRule.length && F.every((R) => m.renderRule.indexOf(R) > -1) || (g.$handle.updateAppendData(), g.$handle.reloadRule(l.value), n.renderRule());
|
|
1496
|
+
}), B(() => [s.disabled, s.preview], () => {
|
|
1497
|
+
$.refresh();
|
|
1498
|
+
}), B(u, (F) => {
|
|
1499
|
+
JSON.stringify(F || {}) !== m.updateValue && ($.config.forceCoverValue ? $.coverValue(F || {}) : $.setValue(F || {}));
|
|
1500
|
+
}, { deep: !0, flush: "post" }), B(() => s.index, () => {
|
|
1501
|
+
$.coverValue({}), g.$handle.updateAppendData(), P(() => {
|
|
1498
1502
|
P(() => {
|
|
1499
|
-
|
|
1503
|
+
$.clearValidateState();
|
|
1500
1504
|
});
|
|
1501
1505
|
});
|
|
1502
|
-
}, { flush: "sync" }),
|
|
1503
|
-
fc:
|
|
1504
|
-
parent: o &&
|
|
1505
|
-
top:
|
|
1506
|
-
fapi:
|
|
1507
|
-
}, lt(
|
|
1508
|
-
getGroupInject: () =>
|
|
1506
|
+
}, { flush: "sync" }), U(b({
|
|
1507
|
+
fc: me(g),
|
|
1508
|
+
parent: o && me(o),
|
|
1509
|
+
top: me(a),
|
|
1510
|
+
fapi: me($)
|
|
1511
|
+
}, lt(m)), {
|
|
1512
|
+
getGroupInject: () => Re(n, o),
|
|
1509
1513
|
refresh() {
|
|
1510
|
-
++
|
|
1514
|
+
++m.unique;
|
|
1511
1515
|
},
|
|
1512
1516
|
renderRule() {
|
|
1513
|
-
|
|
1517
|
+
m.renderRule = [...l.value || []];
|
|
1514
1518
|
},
|
|
1515
|
-
updateValue(
|
|
1516
|
-
if (
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1519
|
-
|
|
1519
|
+
updateValue(F) {
|
|
1520
|
+
if (m.destroyed) return;
|
|
1521
|
+
const R = JSON.stringify(F);
|
|
1522
|
+
m.updateValue !== R && (m.updateValue = R, n.$emit("update:value", F), P(() => {
|
|
1523
|
+
Ae(), o ? f.value || ce() : (T(), ce());
|
|
1520
1524
|
}));
|
|
1521
1525
|
}
|
|
1522
1526
|
});
|
|
@@ -1526,39 +1530,39 @@ function Nr(t, e, r) {
|
|
|
1526
1530
|
}
|
|
1527
1531
|
};
|
|
1528
1532
|
}
|
|
1529
|
-
const
|
|
1530
|
-
const i = [...
|
|
1533
|
+
const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"], Y = (t, e = {}, r = {}) => {
|
|
1534
|
+
const i = [...kt, ...r.normal || []], s = [...Et, ...r.array || []], n = [...Dt, ...r.functional || []], o = r.props || [];
|
|
1531
1535
|
return t.reduce((a, l) => {
|
|
1532
1536
|
for (const u in l)
|
|
1533
1537
|
if (a[u])
|
|
1534
1538
|
if (o.indexOf(u) > -1)
|
|
1535
|
-
a[u] =
|
|
1539
|
+
a[u] = Y([l[u]], a[u]);
|
|
1536
1540
|
else if (i.indexOf(u) > -1)
|
|
1537
1541
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1538
1542
|
else if (s.indexOf(u) > -1) {
|
|
1539
|
-
const f = a[u] instanceof Array ? a[u] : [a[u]],
|
|
1540
|
-
a[u] = [...f, ...
|
|
1543
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1544
|
+
a[u] = [...f, ...d];
|
|
1541
1545
|
} else if (n.indexOf(u) > -1)
|
|
1542
1546
|
for (const f in l[u])
|
|
1543
1547
|
if (a[u][f]) {
|
|
1544
|
-
const
|
|
1545
|
-
a[u][f] = [...
|
|
1548
|
+
const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], m = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1549
|
+
a[u][f] = [...d, ...m];
|
|
1546
1550
|
} else
|
|
1547
1551
|
a[u][f] = l[u][f];
|
|
1548
1552
|
else if (u === "hook")
|
|
1549
1553
|
for (let f in l[u])
|
|
1550
|
-
a[u][f] ? a[u][f] =
|
|
1554
|
+
a[u][f] ? a[u][f] = Ur(a[u][f], l[u][f]) : a[u][f] = l[u][f];
|
|
1551
1555
|
else
|
|
1552
1556
|
a[u] = l[u];
|
|
1553
1557
|
else
|
|
1554
1558
|
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];
|
|
1555
1559
|
return a;
|
|
1556
1560
|
}, e);
|
|
1557
|
-
},
|
|
1561
|
+
}, Ur = (t, e) => function() {
|
|
1558
1562
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1559
1563
|
}, jt = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Ze = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1560
1564
|
function It() {
|
|
1561
|
-
return [...jt, ...
|
|
1565
|
+
return [...jt, ...kt, ...Et, ...Dt, ...Ze, ...Ye];
|
|
1562
1566
|
}
|
|
1563
1567
|
function At(t, e, r) {
|
|
1564
1568
|
return `[form-create ${t}]: ${e}`;
|
|
@@ -1566,15 +1570,15 @@ function At(t, e, r) {
|
|
|
1566
1570
|
function xe(t, e) {
|
|
1567
1571
|
console.error(At("err", t));
|
|
1568
1572
|
}
|
|
1569
|
-
function
|
|
1573
|
+
function qr(t) {
|
|
1570
1574
|
xe(t.toString()), console.error(t);
|
|
1571
1575
|
}
|
|
1572
|
-
function
|
|
1576
|
+
function Gr(t) {
|
|
1573
1577
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
1574
1578
|
}
|
|
1575
1579
|
const We = "[[FORM-CREATE-PREFIX-", ze = "-FORM-CREATE-SUFFIX]]";
|
|
1576
1580
|
function et(t, e) {
|
|
1577
|
-
return JSON.stringify(
|
|
1581
|
+
return JSON.stringify(be(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1578
1582
|
if (!(i && i._isVue === !0)) {
|
|
1579
1583
|
if (typeof i != "function")
|
|
1580
1584
|
return i;
|
|
@@ -1585,10 +1589,10 @@ function et(t, e) {
|
|
|
1585
1589
|
}
|
|
1586
1590
|
}, e);
|
|
1587
1591
|
}
|
|
1588
|
-
function
|
|
1592
|
+
function Le(t) {
|
|
1589
1593
|
return new Function("return " + t)();
|
|
1590
1594
|
}
|
|
1591
|
-
function
|
|
1595
|
+
function z(t, e) {
|
|
1592
1596
|
if (t && h.String(t) && t.length > 4) {
|
|
1593
1597
|
let r = t.trim(), i = !1;
|
|
1594
1598
|
try {
|
|
@@ -1607,15 +1611,15 @@ function W(t, e) {
|
|
|
1607
1611
|
}, r.__json = t, r.__inject = !0, r;
|
|
1608
1612
|
} else {
|
|
1609
1613
|
if (r.indexOf("$FNX:") === 0)
|
|
1610
|
-
return r =
|
|
1614
|
+
return r = Le("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1611
1615
|
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1612
1616
|
}
|
|
1613
1617
|
if (!i) return t;
|
|
1614
1618
|
let s;
|
|
1615
1619
|
try {
|
|
1616
|
-
s =
|
|
1620
|
+
s = Le(r);
|
|
1617
1621
|
} catch (n) {
|
|
1618
|
-
s =
|
|
1622
|
+
s = Le("function " + r);
|
|
1619
1623
|
}
|
|
1620
1624
|
return s.__json = t, s;
|
|
1621
1625
|
} catch (s) {
|
|
@@ -1629,15 +1633,15 @@ err: ${s}`);
|
|
|
1629
1633
|
}
|
|
1630
1634
|
function Vt(t, e) {
|
|
1631
1635
|
return JSON.parse(t, function(r, i) {
|
|
1632
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1636
|
+
return h.Undef(i) || !i.indexOf ? i : z(i, e);
|
|
1633
1637
|
});
|
|
1634
1638
|
}
|
|
1635
|
-
let
|
|
1636
|
-
function
|
|
1637
|
-
const t = 370 + ++
|
|
1639
|
+
let Hr = 0;
|
|
1640
|
+
function Ie() {
|
|
1641
|
+
const t = 370 + ++Hr;
|
|
1638
1642
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1639
1643
|
}
|
|
1640
|
-
function
|
|
1644
|
+
function se(t, e, r) {
|
|
1641
1645
|
let i = t, s;
|
|
1642
1646
|
return (e || "").split(".").forEach((n) => {
|
|
1643
1647
|
s && ((!i[s] || typeof i[s] != "object") && S(i, s, {}), i = i[s]), s = n;
|
|
@@ -1655,18 +1659,18 @@ function Pt(t, e) {
|
|
|
1655
1659
|
return Bt([t], e || !1)[0];
|
|
1656
1660
|
}
|
|
1657
1661
|
function Bt(t, e) {
|
|
1658
|
-
return
|
|
1662
|
+
return be([], [...t], e || !1);
|
|
1659
1663
|
}
|
|
1660
|
-
function
|
|
1661
|
-
return
|
|
1664
|
+
function x(t, e) {
|
|
1665
|
+
return Y(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
|
|
1662
1666
|
}
|
|
1663
1667
|
function ct(t) {
|
|
1664
1668
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1665
1669
|
return e.type || (e.type = "input"), e;
|
|
1666
1670
|
}
|
|
1667
|
-
function
|
|
1671
|
+
function Jr(t, e) {
|
|
1668
1672
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1669
|
-
e[r] && (t[r] =
|
|
1673
|
+
e[r] && (t[r] = x(t[r] || {}, e[r]));
|
|
1670
1674
|
}), t) : e;
|
|
1671
1675
|
}
|
|
1672
1676
|
function Lt(t, e) {
|
|
@@ -1676,26 +1680,26 @@ function Lt(t, e) {
|
|
|
1676
1680
|
}
|
|
1677
1681
|
}, r), {}));
|
|
1678
1682
|
}
|
|
1679
|
-
function
|
|
1683
|
+
function Z(t) {
|
|
1680
1684
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1681
1685
|
}
|
|
1682
|
-
function
|
|
1686
|
+
function O(t, e) {
|
|
1683
1687
|
try {
|
|
1684
1688
|
e = t();
|
|
1685
1689
|
} catch (r) {
|
|
1686
|
-
|
|
1690
|
+
qr(r);
|
|
1687
1691
|
}
|
|
1688
1692
|
return e;
|
|
1689
1693
|
}
|
|
1690
1694
|
function Xe(t, e) {
|
|
1691
1695
|
let r = null;
|
|
1692
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e &&
|
|
1696
|
+
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e && G(r).forEach((i) => {
|
|
1693
1697
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1694
1698
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
1695
1699
|
});
|
|
1696
1700
|
}), r;
|
|
1697
1701
|
}
|
|
1698
|
-
function
|
|
1702
|
+
function Wr(t, e) {
|
|
1699
1703
|
if (h.Object(t)) {
|
|
1700
1704
|
const r = {};
|
|
1701
1705
|
return Object.keys(t).forEach((i) => {
|
|
@@ -1704,7 +1708,7 @@ function Jr(t, e) {
|
|
|
1704
1708
|
} else
|
|
1705
1709
|
return Xe(t, e);
|
|
1706
1710
|
}
|
|
1707
|
-
function
|
|
1711
|
+
function Oe() {
|
|
1708
1712
|
const t = {}, e = (r) => r || "default";
|
|
1709
1713
|
return {
|
|
1710
1714
|
setSlot(r, i) {
|
|
@@ -1720,7 +1724,7 @@ function Le() {
|
|
|
1720
1724
|
const n = s();
|
|
1721
1725
|
Array.isArray(n) ? i.push(...n) : i.push(n);
|
|
1722
1726
|
} else h.Undef(s) || i.push(s);
|
|
1723
|
-
}),
|
|
1727
|
+
}), Wr(i, r);
|
|
1724
1728
|
},
|
|
1725
1729
|
getSlots() {
|
|
1726
1730
|
let r = [];
|
|
@@ -1740,12 +1744,12 @@ function Le() {
|
|
|
1740
1744
|
}
|
|
1741
1745
|
};
|
|
1742
1746
|
}
|
|
1743
|
-
function
|
|
1747
|
+
function Fe(t, e) {
|
|
1744
1748
|
return Object.setPrototypeOf(t, e), t;
|
|
1745
1749
|
}
|
|
1746
|
-
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1750
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
|
|
1747
1751
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1748
|
-
"!=": (t, e) => !
|
|
1752
|
+
"!=": (t, e) => !fe["=="](t, e),
|
|
1749
1753
|
">": (t, e) => t > e,
|
|
1750
1754
|
">=": (t, e) => t >= e,
|
|
1751
1755
|
"<": (t, e) => t < e,
|
|
@@ -1754,13 +1758,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1754
1758
|
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1755
1759
|
},
|
|
1756
1760
|
notOn(t, e) {
|
|
1757
|
-
return !
|
|
1761
|
+
return !fe.on(t, e);
|
|
1758
1762
|
},
|
|
1759
1763
|
in(t, e) {
|
|
1760
1764
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1761
1765
|
},
|
|
1762
1766
|
notIn(t, e) {
|
|
1763
|
-
return !
|
|
1767
|
+
return !fe.in(t, e);
|
|
1764
1768
|
},
|
|
1765
1769
|
between(t, e) {
|
|
1766
1770
|
return t > e[0] && t < e[1];
|
|
@@ -1778,12 +1782,12 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1778
1782
|
return new RegExp(e, "g").test(t);
|
|
1779
1783
|
}
|
|
1780
1784
|
};
|
|
1781
|
-
function
|
|
1785
|
+
function L(t, e) {
|
|
1782
1786
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1783
1787
|
t != null && (t = t[r]);
|
|
1784
1788
|
}), t;
|
|
1785
1789
|
}
|
|
1786
|
-
function
|
|
1790
|
+
function zr(t) {
|
|
1787
1791
|
const e = /{{\s*(.*?)\s*}}/g;
|
|
1788
1792
|
let r;
|
|
1789
1793
|
const i = {};
|
|
@@ -1816,9 +1820,9 @@ function A(t, e) {
|
|
|
1816
1820
|
};
|
|
1817
1821
|
}
|
|
1818
1822
|
function tt(t, e, r, i, s) {
|
|
1819
|
-
this._data =
|
|
1823
|
+
this._data = C(Tt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1820
1824
|
}
|
|
1821
|
-
|
|
1825
|
+
C(tt.prototype, {
|
|
1822
1826
|
getRule() {
|
|
1823
1827
|
return this._data;
|
|
1824
1828
|
},
|
|
@@ -1833,13 +1837,13 @@ _(tt.prototype, {
|
|
|
1833
1837
|
function Nt(t) {
|
|
1834
1838
|
t.forEach((e) => {
|
|
1835
1839
|
tt.prototype[e] = function(r) {
|
|
1836
|
-
return
|
|
1840
|
+
return x(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1837
1841
|
};
|
|
1838
1842
|
});
|
|
1839
1843
|
}
|
|
1840
1844
|
Nt(It());
|
|
1841
1845
|
const Mt = A("");
|
|
1842
|
-
function
|
|
1846
|
+
function Kr(t, e, r) {
|
|
1843
1847
|
let i = Mt("", e);
|
|
1844
1848
|
return i._data.type = t, i._data.title = r, i;
|
|
1845
1849
|
}
|
|
@@ -1847,15 +1851,15 @@ function pt(t, e, r, i) {
|
|
|
1847
1851
|
let s = Mt("", r);
|
|
1848
1852
|
return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
|
|
1849
1853
|
}
|
|
1850
|
-
function
|
|
1854
|
+
function Xr() {
|
|
1851
1855
|
return {
|
|
1852
|
-
create:
|
|
1856
|
+
create: Kr,
|
|
1853
1857
|
createTmp: pt,
|
|
1854
1858
|
template: pt,
|
|
1855
1859
|
factory: A
|
|
1856
1860
|
};
|
|
1857
1861
|
}
|
|
1858
|
-
function
|
|
1862
|
+
function Qr(t, e, r) {
|
|
1859
1863
|
const i = `fail to ${t} ${r.status}'`, s = new Error(i);
|
|
1860
1864
|
return s.status = r.status, s.url = t, s;
|
|
1861
1865
|
}
|
|
@@ -1878,13 +1882,13 @@ function Ut(t) {
|
|
|
1878
1882
|
n.percent = n.total > 0 ? n.loaded / n.total * 100 : 0, t.onProgress(n);
|
|
1879
1883
|
}), t.query) {
|
|
1880
1884
|
const n = new URLSearchParams(t.query).toString();
|
|
1881
|
-
r.includes("?") ? r += `&${n}` : r += `?${n}
|
|
1885
|
+
n && (r.includes("?") ? r += `&${n}` : r += `?${n}`);
|
|
1882
1886
|
}
|
|
1883
1887
|
e.onerror = function(o) {
|
|
1884
1888
|
t.onError(o);
|
|
1885
1889
|
}, e.onload = function() {
|
|
1886
1890
|
if (e.status < 200 || e.status >= 300)
|
|
1887
|
-
return t.onError(
|
|
1891
|
+
return t.onError(Qr(r, t, e), mt(e));
|
|
1888
1892
|
t.onSuccess(mt(e));
|
|
1889
1893
|
}, e.open(t.method || "get", r, !0);
|
|
1890
1894
|
let i;
|
|
@@ -1898,11 +1902,11 @@ function Ut(t) {
|
|
|
1898
1902
|
}
|
|
1899
1903
|
function gt(t, e, r) {
|
|
1900
1904
|
return new Promise((i, s) => {
|
|
1901
|
-
(e || Ut)(
|
|
1905
|
+
(e || Ut)(U(b({}, t), {
|
|
1902
1906
|
onSuccess(n) {
|
|
1903
1907
|
let o = (l) => l;
|
|
1904
|
-
const a =
|
|
1905
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1908
|
+
const a = z(t.parse);
|
|
1909
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n, void 0, r));
|
|
1906
1910
|
},
|
|
1907
1911
|
onError(n) {
|
|
1908
1912
|
s(n);
|
|
@@ -1910,10 +1914,10 @@ function gt(t, e, r) {
|
|
|
1910
1914
|
}));
|
|
1911
1915
|
});
|
|
1912
1916
|
}
|
|
1913
|
-
function
|
|
1914
|
-
return
|
|
1917
|
+
function $e(t) {
|
|
1918
|
+
return W(t);
|
|
1915
1919
|
}
|
|
1916
|
-
function
|
|
1920
|
+
function Zr(t) {
|
|
1917
1921
|
function e(n) {
|
|
1918
1922
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1919
1923
|
}
|
|
@@ -1956,6 +1960,15 @@ function Qr(t) {
|
|
|
1956
1960
|
get top() {
|
|
1957
1961
|
return s.parent ? s.parent.top : s;
|
|
1958
1962
|
},
|
|
1963
|
+
get scope() {
|
|
1964
|
+
let n = t.vm;
|
|
1965
|
+
for (; n && n.fapi; )
|
|
1966
|
+
if (n.$props.subForm)
|
|
1967
|
+
n = n.parent;
|
|
1968
|
+
else
|
|
1969
|
+
return n.fapi;
|
|
1970
|
+
return s.top;
|
|
1971
|
+
},
|
|
1959
1972
|
get children() {
|
|
1960
1973
|
return i();
|
|
1961
1974
|
},
|
|
@@ -1975,17 +1988,17 @@ function Qr(t) {
|
|
|
1975
1988
|
}
|
|
1976
1989
|
},
|
|
1977
1990
|
formData(n) {
|
|
1978
|
-
if (n == null) {
|
|
1991
|
+
if (n == null || typeof n == "boolean") {
|
|
1979
1992
|
const o = {};
|
|
1980
1993
|
return Object.keys(t.form).forEach((a) => {
|
|
1981
|
-
t.ignoreFields.indexOf(a) === -1 && (o[a] =
|
|
1994
|
+
(n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] = $e(t.form[a]));
|
|
1982
1995
|
}), o;
|
|
1983
1996
|
} else
|
|
1984
1997
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
1985
1998
|
},
|
|
1986
1999
|
getValue(n) {
|
|
1987
2000
|
const o = t.getFieldCtx(n);
|
|
1988
|
-
return o ?
|
|
2001
|
+
return o ? $e(o.rule.value) : t.options.appendValue !== !1 && E(t.appendData, n) ? $e(t.appendData[n]) : void 0;
|
|
1989
2002
|
},
|
|
1990
2003
|
coverValue(n) {
|
|
1991
2004
|
const o = b({}, n || {});
|
|
@@ -1993,12 +2006,12 @@ function Qr(t) {
|
|
|
1993
2006
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
1994
2007
|
const l = t.fieldCtx[a];
|
|
1995
2008
|
if (l) {
|
|
1996
|
-
const u =
|
|
2009
|
+
const u = E(n, a);
|
|
1997
2010
|
l.forEach((f) => {
|
|
1998
2011
|
f.rule.value = u ? n[a] : void 0;
|
|
1999
2012
|
}), delete o[a];
|
|
2000
2013
|
}
|
|
2001
|
-
}),
|
|
2014
|
+
}), C(t.appendData, o);
|
|
2002
2015
|
}, !0);
|
|
2003
2016
|
},
|
|
2004
2017
|
setValue(n) {
|
|
@@ -2022,7 +2035,7 @@ function Qr(t) {
|
|
|
2022
2035
|
}, !0), o ? o.origin : void 0;
|
|
2023
2036
|
},
|
|
2024
2037
|
removeRule(n) {
|
|
2025
|
-
const o = n &&
|
|
2038
|
+
const o = n && Z(n);
|
|
2026
2039
|
if (o)
|
|
2027
2040
|
return o.rm(), o.origin;
|
|
2028
2041
|
},
|
|
@@ -2111,7 +2124,7 @@ function Qr(t) {
|
|
|
2111
2124
|
n.forEach((a) => s.sync(a));
|
|
2112
2125
|
return;
|
|
2113
2126
|
}
|
|
2114
|
-
let o = h.Object(n) ?
|
|
2127
|
+
let o = h.Object(n) ? Z(n) : t.getCtxs(n);
|
|
2115
2128
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2116
2129
|
if (!a.deleted) {
|
|
2117
2130
|
const l = t.subForm[a.id];
|
|
@@ -2138,7 +2151,7 @@ function Qr(t) {
|
|
|
2138
2151
|
},
|
|
2139
2152
|
updateRule(n, o) {
|
|
2140
2153
|
t.getCtxs(n).forEach((a) => {
|
|
2141
|
-
|
|
2154
|
+
C(a.rule, o);
|
|
2142
2155
|
});
|
|
2143
2156
|
},
|
|
2144
2157
|
updateRules(n) {
|
|
@@ -2148,7 +2161,7 @@ function Qr(t) {
|
|
|
2148
2161
|
},
|
|
2149
2162
|
mergeRule: (n, o) => {
|
|
2150
2163
|
t.getCtxs(n).forEach((a) => {
|
|
2151
|
-
|
|
2164
|
+
x(a.rule, o);
|
|
2152
2165
|
});
|
|
2153
2166
|
},
|
|
2154
2167
|
mergeRules(n) {
|
|
@@ -2175,7 +2188,7 @@ function Qr(t) {
|
|
|
2175
2188
|
},
|
|
2176
2189
|
setEffect(n, o, a) {
|
|
2177
2190
|
const l = t.getCtx(n);
|
|
2178
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2191
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), E(l.rule, "$" + o) && S(l.rule, "$" + o, a), E(l.rule, "effect") || S(l.rule, "effect", {}), S(l.rule.effect, o, a));
|
|
2179
2192
|
},
|
|
2180
2193
|
clearEffectData(n, o) {
|
|
2181
2194
|
const a = t.getCtx(n);
|
|
@@ -2195,7 +2208,7 @@ function Qr(t) {
|
|
|
2195
2208
|
resetFields(n) {
|
|
2196
2209
|
e(n).forEach((o) => {
|
|
2197
2210
|
t.getCtxs(o).forEach((a) => {
|
|
2198
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2211
|
+
t.$render.clearCache(a), a.rule.value = $e(a.defaultValue);
|
|
2199
2212
|
});
|
|
2200
2213
|
}), P(() => {
|
|
2201
2214
|
P(() => {
|
|
@@ -2203,7 +2216,7 @@ function Qr(t) {
|
|
|
2203
2216
|
s.clearValidateState(n);
|
|
2204
2217
|
});
|
|
2205
2218
|
});
|
|
2206
|
-
}), n == null && (h.Function(t.options.onReset) &&
|
|
2219
|
+
}), n == null && (h.Function(t.options.onReset) && O(() => t.options.onReset(s)), t.vm.$emit("reset", s));
|
|
2207
2220
|
},
|
|
2208
2221
|
method(n, o) {
|
|
2209
2222
|
const a = s.el(n);
|
|
@@ -2212,7 +2225,7 @@ function Qr(t) {
|
|
|
2212
2225
|
return (...l) => a[o](...l);
|
|
2213
2226
|
},
|
|
2214
2227
|
exec(n, o, ...a) {
|
|
2215
|
-
return
|
|
2228
|
+
return O(() => s.method(n, o)(...a));
|
|
2216
2229
|
},
|
|
2217
2230
|
toJson(n) {
|
|
2218
2231
|
return et(s.rule, n);
|
|
@@ -2234,21 +2247,21 @@ function Qr(t) {
|
|
|
2234
2247
|
return o ? t.subForm[o.id] : void 0;
|
|
2235
2248
|
},
|
|
2236
2249
|
getChildrenRuleList(n) {
|
|
2237
|
-
const o = typeof n == "object", a = o ?
|
|
2250
|
+
const o = typeof n == "object", a = o ? Z(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2238
2251
|
if (!l)
|
|
2239
2252
|
return [];
|
|
2240
2253
|
const u = [];
|
|
2241
|
-
return ((
|
|
2242
|
-
|
|
2243
|
-
typeof
|
|
2254
|
+
return ((d) => {
|
|
2255
|
+
d && d.forEach((m) => {
|
|
2256
|
+
typeof m == "object" && (m.field && u.push(m), u.push(...s.getChildrenRuleList(m)));
|
|
2244
2257
|
});
|
|
2245
2258
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2246
2259
|
},
|
|
2247
2260
|
getParentRule(n) {
|
|
2248
|
-
return (typeof n == "object" ?
|
|
2261
|
+
return (typeof n == "object" ? Z(n) : t.getCtx(n)).parent.rule;
|
|
2249
2262
|
},
|
|
2250
2263
|
getParentSubRule(n) {
|
|
2251
|
-
const a = typeof n == "object" ?
|
|
2264
|
+
const a = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2252
2265
|
if (a) {
|
|
2253
2266
|
const l = a.getParentGroup();
|
|
2254
2267
|
if (l)
|
|
@@ -2256,20 +2269,20 @@ function Qr(t) {
|
|
|
2256
2269
|
}
|
|
2257
2270
|
},
|
|
2258
2271
|
getChildrenFormData(n) {
|
|
2259
|
-
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] =
|
|
2272
|
+
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] = $e(l.value), a), {});
|
|
2260
2273
|
},
|
|
2261
2274
|
setChildrenFormData(n, o, a) {
|
|
2262
2275
|
const l = s.getChildrenRuleList(n);
|
|
2263
2276
|
t.deferSyncValue(() => {
|
|
2264
2277
|
l.forEach((u) => {
|
|
2265
|
-
|
|
2278
|
+
E(o, u.field) ? u.value = o[u.field] : a && (u.value = void 0);
|
|
2266
2279
|
});
|
|
2267
2280
|
});
|
|
2268
2281
|
},
|
|
2269
2282
|
getGlobalEvent(n) {
|
|
2270
2283
|
let o = s.options.globalEvent[n];
|
|
2271
2284
|
if (o)
|
|
2272
|
-
return typeof o == "object" && (o = o.handle),
|
|
2285
|
+
return typeof o == "object" && (o = o.handle), z(o);
|
|
2273
2286
|
},
|
|
2274
2287
|
getGlobalData(n) {
|
|
2275
2288
|
return new Promise((o, a) => {
|
|
@@ -2279,11 +2292,19 @@ function Qr(t) {
|
|
|
2279
2292
|
}).catch(a) : o(l.data);
|
|
2280
2293
|
});
|
|
2281
2294
|
},
|
|
2295
|
+
renderRule(n, o, a) {
|
|
2296
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2297
|
+
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2298
|
+
},
|
|
2299
|
+
renderChildren(n, o, a) {
|
|
2300
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2301
|
+
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2302
|
+
},
|
|
2282
2303
|
nextTick(n) {
|
|
2283
2304
|
t.bus.$once("next-tick", n), t.refresh();
|
|
2284
2305
|
},
|
|
2285
2306
|
nextRefresh(n) {
|
|
2286
|
-
t.nextRefresh(), n &&
|
|
2307
|
+
t.nextRefresh(), n && O(n);
|
|
2287
2308
|
},
|
|
2288
2309
|
emit(n, ...o) {
|
|
2289
2310
|
t.vm.$emit(n, ...o);
|
|
@@ -2294,25 +2315,25 @@ function Qr(t) {
|
|
|
2294
2315
|
bus: t.bus,
|
|
2295
2316
|
fetch(n) {
|
|
2296
2317
|
return new Promise((o, a) => {
|
|
2297
|
-
n =
|
|
2298
|
-
|
|
2318
|
+
n = W(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2319
|
+
O(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2299
2320
|
}).catch((l) => {
|
|
2300
|
-
|
|
2321
|
+
O(() => n.onError && n.onError(l)), a(l);
|
|
2301
2322
|
}));
|
|
2302
2323
|
});
|
|
2303
2324
|
},
|
|
2304
2325
|
watchFetch(n, o, a, l) {
|
|
2305
2326
|
return t.fc.watchLoadData((u, f) => {
|
|
2306
|
-
let
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
}).catch((
|
|
2310
|
-
|
|
2327
|
+
let d = W(n);
|
|
2328
|
+
d = t.loadFetchVar(d, u), !(l && l(d, f) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((m) => {
|
|
2329
|
+
O(() => d.onSuccess && d.onSuccess(m)), o && o(m, f);
|
|
2330
|
+
}).catch((m) => {
|
|
2331
|
+
O(() => d.onError && d.onError(m)), a && a(m);
|
|
2311
2332
|
}));
|
|
2312
2333
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2313
2334
|
},
|
|
2314
2335
|
getData(n, o) {
|
|
2315
|
-
return t.fc.getLoadData(n, o);
|
|
2336
|
+
return t.fc.get ? t.fc.get(n, o) : t.fc.getLoadData(n, o);
|
|
2316
2337
|
},
|
|
2317
2338
|
setData(n, o, a) {
|
|
2318
2339
|
return t.fc.setData(n, o, a);
|
|
@@ -2337,8 +2358,8 @@ function Qr(t) {
|
|
|
2337
2358
|
};
|
|
2338
2359
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2339
2360
|
}
|
|
2340
|
-
function
|
|
2341
|
-
|
|
2361
|
+
function Yr(t) {
|
|
2362
|
+
C(t.prototype, {
|
|
2342
2363
|
initCache() {
|
|
2343
2364
|
this.clearCacheAll();
|
|
2344
2365
|
},
|
|
@@ -2369,7 +2390,7 @@ function Zr(t) {
|
|
|
2369
2390
|
}
|
|
2370
2391
|
});
|
|
2371
2392
|
}
|
|
2372
|
-
function
|
|
2393
|
+
function q(t) {
|
|
2373
2394
|
const e = t.replace(/(-[a-z])/g, function(r) {
|
|
2374
2395
|
return r.replace("-", "").toLocaleUpperCase();
|
|
2375
2396
|
});
|
|
@@ -2378,8 +2399,8 @@ function G(t) {
|
|
|
2378
2399
|
function qt(t) {
|
|
2379
2400
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2380
2401
|
}
|
|
2381
|
-
function
|
|
2382
|
-
|
|
2402
|
+
function xr(t) {
|
|
2403
|
+
C(t.prototype, {
|
|
2383
2404
|
initRender() {
|
|
2384
2405
|
this.cacheConfig = {};
|
|
2385
2406
|
},
|
|
@@ -2387,7 +2408,7 @@ function Yr(t) {
|
|
|
2387
2408
|
const r = (i) => {
|
|
2388
2409
|
if (i) {
|
|
2389
2410
|
let s;
|
|
2390
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2411
|
+
return e.rule.field && (s = i.$scopedSlots["field-" + ve(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + ve(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
|
|
2391
2412
|
}
|
|
2392
2413
|
};
|
|
2393
2414
|
return r(this.vm);
|
|
@@ -2396,7 +2417,7 @@ function Yr(t) {
|
|
|
2396
2417
|
if (!this.vm.isShow)
|
|
2397
2418
|
return;
|
|
2398
2419
|
this.$manager.beforeRender();
|
|
2399
|
-
const e =
|
|
2420
|
+
const e = Oe();
|
|
2400
2421
|
return this.sort.forEach((r) => {
|
|
2401
2422
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2402
2423
|
}), this.$manager.render(e);
|
|
@@ -2407,23 +2428,23 @@ function Yr(t) {
|
|
|
2407
2428
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2408
2429
|
},
|
|
2409
2430
|
mergeGlobal(e) {
|
|
2410
|
-
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] =
|
|
2431
|
+
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = ge(() => {
|
|
2411
2432
|
const i = this.$handle.options.global;
|
|
2412
|
-
return
|
|
2413
|
-
})), e.prop =
|
|
2433
|
+
return x({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2434
|
+
})), e.prop = x({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2414
2435
|
},
|
|
2415
2436
|
setOptions(e) {
|
|
2416
2437
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2417
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2438
|
+
e.prop.options = r, e.prop.optionsTo && r && se(e.prop, e.prop.optionsTo, r);
|
|
2418
2439
|
},
|
|
2419
2440
|
deepSet(e) {
|
|
2420
2441
|
const r = e.rule.deep;
|
|
2421
2442
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2422
|
-
|
|
2443
|
+
se(e.prop, i, r[i]);
|
|
2423
2444
|
});
|
|
2424
2445
|
},
|
|
2425
2446
|
parseSide(e, r) {
|
|
2426
|
-
return h.Object(e) ?
|
|
2447
|
+
return h.Object(e) ? x({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2427
2448
|
},
|
|
2428
2449
|
renderSides(e, r, i) {
|
|
2429
2450
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2437,7 +2458,7 @@ function Yr(t) {
|
|
|
2437
2458
|
try {
|
|
2438
2459
|
if (e.type === "hidden") return;
|
|
2439
2460
|
const i = e.rule;
|
|
2440
|
-
if (!this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2461
|
+
if (this.force || !this.cache[e.id] || this.cache[e.id].slot !== i.slot) {
|
|
2441
2462
|
let s;
|
|
2442
2463
|
e.initProp(), this.mergeGlobal(e), e.initNone(), this.$manager.tidyRule(e), this.deepSet(e), this.setOptions(e), this.ctxProp(e);
|
|
2443
2464
|
let n = e.prop;
|
|
@@ -2457,21 +2478,23 @@ function Yr(t) {
|
|
|
2457
2478
|
model: n.model || {},
|
|
2458
2479
|
slotValue: l
|
|
2459
2480
|
};
|
|
2460
|
-
l.length && i.slotUpdate &&
|
|
2481
|
+
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2461
2482
|
let f = [];
|
|
2462
|
-
const
|
|
2463
|
-
e.parser.renderChildren ? f = e.parser.renderChildren(
|
|
2483
|
+
const d = e.loadChildrenPending();
|
|
2484
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
|
|
2464
2485
|
f.push(this.renderRule({
|
|
2465
2486
|
type: "template",
|
|
2466
|
-
slot:
|
|
2487
|
+
slot: $
|
|
2467
2488
|
}, (() => {
|
|
2468
|
-
|
|
2469
|
-
|
|
2489
|
+
if (h.Function(n.renderSlots[$]))
|
|
2490
|
+
return O(() => n.renderSlots[$]());
|
|
2491
|
+
const _ = this.parseSide(n.renderSlots[$], e);
|
|
2492
|
+
return this.renderRule(_);
|
|
2470
2493
|
})()));
|
|
2471
2494
|
});
|
|
2472
|
-
const
|
|
2473
|
-
let
|
|
2474
|
-
return
|
|
2495
|
+
const m = this.getTypeSlot(e);
|
|
2496
|
+
let g;
|
|
2497
|
+
return m ? (u.children = f, g = m(u)) : g = a ? e.parser.preview(Je(f), e) : e.parser.render(Je(f), 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;
|
|
2475
2498
|
}, this.setCache(e, s, r);
|
|
2476
2499
|
}
|
|
2477
2500
|
return (...s) => {
|
|
@@ -2534,7 +2557,7 @@ function Yr(t) {
|
|
|
2534
2557
|
}
|
|
2535
2558
|
});
|
|
2536
2559
|
const i = r.ctxInject[e.id];
|
|
2537
|
-
return
|
|
2560
|
+
return C(i, {
|
|
2538
2561
|
preview: e.prop.preview,
|
|
2539
2562
|
options: e.prop.options,
|
|
2540
2563
|
prop: function() {
|
|
@@ -2565,17 +2588,21 @@ function Yr(t) {
|
|
|
2565
2588
|
}
|
|
2566
2589
|
}
|
|
2567
2590
|
];
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
this.
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2591
|
+
if (e.input) {
|
|
2592
|
+
const o = this.tmpInput;
|
|
2593
|
+
this.vm.$props.disabled === !0 && (e.prop.props.disabled = !0), e.prop.model = {
|
|
2594
|
+
value: this.$handle.getFormData(e),
|
|
2595
|
+
callback: (a) => {
|
|
2596
|
+
o && o(e.field, a, e.rule), this.onInput(e, a);
|
|
2597
|
+
},
|
|
2598
|
+
expression: `formData.${e.id}`
|
|
2599
|
+
}, e.prop.modelEmit && n.push({
|
|
2600
|
+
on: {
|
|
2601
|
+
[e.prop.modelEmit]: () => this.onEmitInput(e)
|
|
2602
|
+
}
|
|
2603
|
+
});
|
|
2604
|
+
}
|
|
2605
|
+
return Y(n, e.prop), e.prop;
|
|
2579
2606
|
},
|
|
2580
2607
|
onMounted(e) {
|
|
2581
2608
|
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");
|
|
@@ -2592,7 +2619,7 @@ function Yr(t) {
|
|
|
2592
2619
|
},
|
|
2593
2620
|
renderChildren(e, r, i) {
|
|
2594
2621
|
if (!h.trueArray(e)) return [];
|
|
2595
|
-
const s =
|
|
2622
|
+
const s = Oe();
|
|
2596
2623
|
return e.map((n) => {
|
|
2597
2624
|
if (n) {
|
|
2598
2625
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2611,6 +2638,16 @@ function Yr(t) {
|
|
|
2611
2638
|
const i = e.prop;
|
|
2612
2639
|
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(qt(i.type), i, r);
|
|
2613
2640
|
},
|
|
2641
|
+
createChildrenVnodes(e, r, i) {
|
|
2642
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2643
|
+
const s = this.renderChildren(e.rule.children, e);
|
|
2644
|
+
return this.force = !1, this.tmpInput = null, s;
|
|
2645
|
+
},
|
|
2646
|
+
createRuleVnode(e, r, i) {
|
|
2647
|
+
this.force = i !== !1, this.tmpInput = r;
|
|
2648
|
+
const s = Oe();
|
|
2649
|
+
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2650
|
+
},
|
|
2614
2651
|
renderRule(e, r, i) {
|
|
2615
2652
|
if (!e) return;
|
|
2616
2653
|
if (h.String(e)) return e;
|
|
@@ -2618,12 +2655,12 @@ function Yr(t) {
|
|
|
2618
2655
|
if (i)
|
|
2619
2656
|
s = e.type;
|
|
2620
2657
|
else if (s = e.is, e.type) {
|
|
2621
|
-
s =
|
|
2658
|
+
s = q(e.type);
|
|
2622
2659
|
const a = this.vNode.aliasMap[s];
|
|
2623
|
-
a && (s =
|
|
2660
|
+
a && (s = q(a));
|
|
2624
2661
|
}
|
|
2625
2662
|
if (!s) return;
|
|
2626
|
-
const n =
|
|
2663
|
+
const n = Oe();
|
|
2627
2664
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2628
2665
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2629
2666
|
});
|
|
@@ -2632,15 +2669,17 @@ function Yr(t) {
|
|
|
2632
2669
|
}
|
|
2633
2670
|
});
|
|
2634
2671
|
}
|
|
2635
|
-
let
|
|
2672
|
+
let ei = 1;
|
|
2636
2673
|
function rt(t) {
|
|
2637
|
-
|
|
2674
|
+
C(this, {
|
|
2638
2675
|
$handle: t,
|
|
2639
2676
|
fc: t.fc,
|
|
2640
2677
|
vm: t.vm,
|
|
2641
2678
|
$manager: t.$manager,
|
|
2642
2679
|
vNode: new t.fc.CreateNode(t.vm),
|
|
2643
|
-
|
|
2680
|
+
force: !1,
|
|
2681
|
+
tmpInput: null,
|
|
2682
|
+
id: ei++
|
|
2644
2683
|
}), Lt(this, {
|
|
2645
2684
|
options() {
|
|
2646
2685
|
return t.options;
|
|
@@ -2650,10 +2689,10 @@ function rt(t) {
|
|
|
2650
2689
|
}
|
|
2651
2690
|
}), this.initCache(), this.initRender();
|
|
2652
2691
|
}
|
|
2653
|
-
Zr(rt);
|
|
2654
2692
|
Yr(rt);
|
|
2655
|
-
|
|
2656
|
-
|
|
2693
|
+
xr(rt);
|
|
2694
|
+
function ti(t) {
|
|
2695
|
+
C(t.prototype, {
|
|
2657
2696
|
parseInjectEvent(e, r) {
|
|
2658
2697
|
const i = e.inject || this.options.injectEvent;
|
|
2659
2698
|
return this.parseEventLst(e, r, i);
|
|
@@ -2670,7 +2709,7 @@ function ei(t) {
|
|
|
2670
2709
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2671
2710
|
return this.parseEventLst(e, r, i, !0);
|
|
2672
2711
|
if (h.String(r)) {
|
|
2673
|
-
const n =
|
|
2712
|
+
const n = z(r);
|
|
2674
2713
|
if (n && r !== n)
|
|
2675
2714
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2676
2715
|
}
|
|
@@ -2679,17 +2718,17 @@ function ei(t) {
|
|
|
2679
2718
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2680
2719
|
return h.trueArray(u) && u.forEach((f) => {
|
|
2681
2720
|
if (!f) return;
|
|
2682
|
-
let
|
|
2683
|
-
if (h.Object(f) && (
|
|
2684
|
-
r || (
|
|
2685
|
-
const
|
|
2686
|
-
this.vm.$emit(
|
|
2721
|
+
let d, m = n || o || a;
|
|
2722
|
+
if (h.Object(f) && (d = f.inject, f = f.name, m = f.prefix || m), m) {
|
|
2723
|
+
r || (m = `native-${m}`);
|
|
2724
|
+
const g = ve(`${m}-${f}`), $ = (..._) => {
|
|
2725
|
+
this.vm.$emit(g, ..._), this.vm.$emit("emit-event", g, ..._), this.bus.$emit(g, ..._);
|
|
2687
2726
|
};
|
|
2688
|
-
if (
|
|
2689
|
-
i[f] =
|
|
2727
|
+
if ($.__emit = !0, !d && l === !1)
|
|
2728
|
+
i[f] = $;
|
|
2690
2729
|
else {
|
|
2691
|
-
let
|
|
2692
|
-
i[f] = h.Undef(
|
|
2730
|
+
let _ = d || l || this.options.injectEvent;
|
|
2731
|
+
i[f] = h.Undef(_) ? $ : this.inject(s, $, _);
|
|
2693
2732
|
}
|
|
2694
2733
|
}
|
|
2695
2734
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2717,42 +2756,52 @@ function ei(t) {
|
|
|
2717
2756
|
};
|
|
2718
2757
|
return n.__origin = r, n.__json = r.__json, n;
|
|
2719
2758
|
},
|
|
2720
|
-
loadStrVar(e, r) {
|
|
2759
|
+
loadStrVar(e, r, i) {
|
|
2721
2760
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2722
|
-
const
|
|
2723
|
-
let
|
|
2724
|
-
if (
|
|
2725
|
-
const
|
|
2726
|
-
if (
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2761
|
+
const s = e, n = zr(e);
|
|
2762
|
+
let o;
|
|
2763
|
+
if (n.forEach((a) => {
|
|
2764
|
+
const l = a.split("||"), u = l[0].trim();
|
|
2765
|
+
if (u) {
|
|
2766
|
+
const f = (l[1] || "").trim();
|
|
2767
|
+
let d, m = !1;
|
|
2768
|
+
if (i && u.indexOf("$form.") === 0) {
|
|
2769
|
+
const g = u.split(".");
|
|
2770
|
+
g.shift(), E(i.value, g[0]) && (m = !0, d = r ? r({
|
|
2771
|
+
id: "$form." + g[0] + "_" + i.rule.__fc__.id,
|
|
2772
|
+
getValue: () => L(i.value, g)
|
|
2773
|
+
}) : L(i.value, g));
|
|
2774
|
+
}
|
|
2775
|
+
m || (d = r ? r(u, f) : this.fc.getLoadData(u, f)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2729
2776
|
}
|
|
2730
|
-
}),
|
|
2731
|
-
return
|
|
2777
|
+
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2778
|
+
return o;
|
|
2732
2779
|
}
|
|
2733
2780
|
return e;
|
|
2734
2781
|
},
|
|
2735
|
-
loadFetchVar(e, r) {
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2782
|
+
loadFetchVar(e, r, i) {
|
|
2783
|
+
let s;
|
|
2784
|
+
i && i.__fc__ && (s = i.__fc__.getParentGroup());
|
|
2785
|
+
const n = (o) => this.loadStrVar(o, r, s ? { rule: i, value: this.subRuleData[s.id] || {} } : null);
|
|
2786
|
+
return e.action = n(e.action || ""), ["headers", "data", "query"].forEach((o) => {
|
|
2787
|
+
if (e[o]) {
|
|
2788
|
+
const a = {};
|
|
2789
|
+
Object.keys(e[o]).forEach((l) => {
|
|
2790
|
+
a[n(l)] = n(e[o][l]);
|
|
2791
|
+
}), e[o] = a;
|
|
2743
2792
|
}
|
|
2744
2793
|
}), e;
|
|
2745
2794
|
}
|
|
2746
2795
|
});
|
|
2747
2796
|
}
|
|
2748
2797
|
const yt = ["hook:updated", "hook:mounted"];
|
|
2749
|
-
function
|
|
2750
|
-
|
|
2798
|
+
function ri(t) {
|
|
2799
|
+
C(t.prototype, {
|
|
2751
2800
|
usePage() {
|
|
2752
2801
|
const e = this.options.page;
|
|
2753
2802
|
if (!e) return;
|
|
2754
|
-
let r = 25, i =
|
|
2755
|
-
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)),
|
|
2803
|
+
let r = 25, i = ii(this.rules);
|
|
2804
|
+
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), C(this, {
|
|
2756
2805
|
first: r,
|
|
2757
2806
|
limit: i,
|
|
2758
2807
|
pageEnd: this.rules.length <= r
|
|
@@ -2766,11 +2815,11 @@ function ti(t) {
|
|
|
2766
2815
|
}
|
|
2767
2816
|
});
|
|
2768
2817
|
}
|
|
2769
|
-
function
|
|
2818
|
+
function ii(t) {
|
|
2770
2819
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2771
2820
|
}
|
|
2772
|
-
function
|
|
2773
|
-
|
|
2821
|
+
function ni(t) {
|
|
2822
|
+
C(t.prototype, {
|
|
2774
2823
|
clearNextTick() {
|
|
2775
2824
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
2776
2825
|
},
|
|
@@ -2784,16 +2833,16 @@ function ii(t) {
|
|
|
2784
2833
|
}
|
|
2785
2834
|
});
|
|
2786
2835
|
}
|
|
2787
|
-
function
|
|
2836
|
+
function si(t) {
|
|
2788
2837
|
Object.defineProperties(t.origin, {
|
|
2789
|
-
__fc__: Ke(
|
|
2838
|
+
__fc__: Ke(me(t), !0)
|
|
2790
2839
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2791
|
-
__fc__: Ke(
|
|
2840
|
+
__fc__: Ke(me(t), !0)
|
|
2792
2841
|
});
|
|
2793
2842
|
}
|
|
2794
2843
|
function Gt(t, e, r) {
|
|
2795
|
-
const i =
|
|
2796
|
-
|
|
2844
|
+
const i = Ie(), s = !!e.field;
|
|
2845
|
+
C(this, {
|
|
2797
2846
|
id: i,
|
|
2798
2847
|
ref: i,
|
|
2799
2848
|
wrapRef: i + "fi",
|
|
@@ -2817,11 +2866,11 @@ function Gt(t, e, r) {
|
|
|
2817
2866
|
input: s,
|
|
2818
2867
|
el: void 0,
|
|
2819
2868
|
exportEl: void 0,
|
|
2820
|
-
defaultValue: s ?
|
|
2869
|
+
defaultValue: s ? W(r) : void 0,
|
|
2821
2870
|
field: e.field || void 0
|
|
2822
|
-
}), this.updateKey(),
|
|
2871
|
+
}), this.updateKey(), si(this), this.update(t, !0);
|
|
2823
2872
|
}
|
|
2824
|
-
|
|
2873
|
+
C(Gt.prototype, {
|
|
2825
2874
|
getParentGroup() {
|
|
2826
2875
|
let t = this.parent;
|
|
2827
2876
|
for (; t; ) {
|
|
@@ -2854,12 +2903,12 @@ _(Gt.prototype, {
|
|
|
2854
2903
|
delete this.pending[e];
|
|
2855
2904
|
let a = r;
|
|
2856
2905
|
if (h.Function(r)) {
|
|
2857
|
-
let l =
|
|
2906
|
+
let l = O(() => r({
|
|
2858
2907
|
rule: this.rule,
|
|
2859
2908
|
api: this.$api,
|
|
2860
2909
|
update: (u) => {
|
|
2861
|
-
const f = u || i,
|
|
2862
|
-
this.setPending(e, r, f), o && o(f,
|
|
2910
|
+
const f = u || i, d = this.getPending(e, i);
|
|
2911
|
+
this.setPending(e, r, f), o && o(f, d);
|
|
2863
2912
|
},
|
|
2864
2913
|
reload: () => {
|
|
2865
2914
|
const u = this.getPending(e, i);
|
|
@@ -2881,7 +2930,7 @@ _(Gt.prototype, {
|
|
|
2881
2930
|
setPending(t, e, r) {
|
|
2882
2931
|
this.pending[t] = {
|
|
2883
2932
|
origin: e,
|
|
2884
|
-
value:
|
|
2933
|
+
value: ie(r)
|
|
2885
2934
|
};
|
|
2886
2935
|
},
|
|
2887
2936
|
effectData(t) {
|
|
@@ -2891,10 +2940,10 @@ _(Gt.prototype, {
|
|
|
2891
2940
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2892
2941
|
},
|
|
2893
2942
|
updateKey(t) {
|
|
2894
|
-
this.key =
|
|
2943
|
+
this.key = Ie(), t && this.parent && this.parent.updateKey(t);
|
|
2895
2944
|
},
|
|
2896
2945
|
updateType() {
|
|
2897
|
-
this.originType = this.rule.type, this.type =
|
|
2946
|
+
this.originType = this.rule.type, this.type = q(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
2898
2947
|
},
|
|
2899
2948
|
setParser(t) {
|
|
2900
2949
|
this.parser = t, t.init(this);
|
|
@@ -2902,7 +2951,7 @@ _(Gt.prototype, {
|
|
|
2902
2951
|
initProp() {
|
|
2903
2952
|
var e, r;
|
|
2904
2953
|
const t = b({}, this.rule);
|
|
2905
|
-
delete t.children, delete t.validate, this.prop =
|
|
2954
|
+
delete t.children, delete t.validate, this.prop = x({}, [t, ...Object.keys(this.payload).map((i) => this.payload[i]), this.computed]), this.prop.validate = [...((r = (e = this.refRule) == null ? void 0 : e.__$validate) == null ? void 0 : r.value) || [], ...this.prop.validate || []];
|
|
2906
2955
|
},
|
|
2907
2956
|
initNone() {
|
|
2908
2957
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -2926,7 +2975,7 @@ _(Gt.prototype, {
|
|
|
2926
2975
|
this.$handle.watchCtx(this);
|
|
2927
2976
|
},
|
|
2928
2977
|
delete() {
|
|
2929
|
-
this.unwatch(), this.unlink(), this.rmCtrl(), this.parent && this.parent.children.splice(this.parent.children.indexOf(this) >>> 0, 1),
|
|
2978
|
+
this.unwatch(), this.unlink(), this.rmCtrl(), this.parent && this.parent.children.splice(this.parent.children.indexOf(this) >>> 0, 1), C(this, {
|
|
2930
2979
|
deleted: !0,
|
|
2931
2980
|
computed: {},
|
|
2932
2981
|
parent: null,
|
|
@@ -2949,14 +2998,14 @@ _(Gt.prototype, {
|
|
|
2949
2998
|
}
|
|
2950
2999
|
this.$handle.noWatch(() => {
|
|
2951
3000
|
this.$handle.deferSyncValue(() => {
|
|
2952
|
-
this.rmCtrl(), t(), this.$handle.rmCtx(this),
|
|
3001
|
+
this.rmCtrl(), t(), this.$handle.rmCtx(this), C(this, {
|
|
2953
3002
|
root: []
|
|
2954
3003
|
});
|
|
2955
3004
|
}, this.input);
|
|
2956
3005
|
});
|
|
2957
3006
|
},
|
|
2958
3007
|
update(t, e) {
|
|
2959
|
-
|
|
3008
|
+
C(this, {
|
|
2960
3009
|
deleted: !1,
|
|
2961
3010
|
$handle: t,
|
|
2962
3011
|
$render: t.$render,
|
|
@@ -2968,8 +3017,8 @@ _(Gt.prototype, {
|
|
|
2968
3017
|
}), !e && this.unwatch(), this.watchTo(), this.link(), this.updateType();
|
|
2969
3018
|
}
|
|
2970
3019
|
});
|
|
2971
|
-
function
|
|
2972
|
-
|
|
3020
|
+
function oi(t) {
|
|
3021
|
+
C(t.prototype, {
|
|
2973
3022
|
nextRefresh(e) {
|
|
2974
3023
|
const r = this.loadedId;
|
|
2975
3024
|
P(() => {
|
|
@@ -2980,9 +3029,9 @@ function si(t) {
|
|
|
2980
3029
|
const r = ct(e);
|
|
2981
3030
|
return Object.defineProperties(r, {
|
|
2982
3031
|
__origin__: Ke(e, !0)
|
|
2983
|
-
}),
|
|
3032
|
+
}), ai(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
2984
3033
|
i && this.loadFn(i, r);
|
|
2985
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
3034
|
+
}), this.loadCtrl(r), r.update && (r.update = z(r.update)), r;
|
|
2986
3035
|
},
|
|
2987
3036
|
loadFn(e, r) {
|
|
2988
3037
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -2991,12 +3040,12 @@ function si(t) {
|
|
|
2991
3040
|
},
|
|
2992
3041
|
loadCtrl(e) {
|
|
2993
3042
|
e.control && e.control.forEach((r) => {
|
|
2994
|
-
r.handle && (r.handle =
|
|
3043
|
+
r.handle && (r.handle = z(r.handle));
|
|
2995
3044
|
});
|
|
2996
3045
|
},
|
|
2997
3046
|
syncProp(e) {
|
|
2998
3047
|
const r = e.rule;
|
|
2999
|
-
h.trueArray(r.sync) &&
|
|
3048
|
+
h.trueArray(r.sync) && Y([{
|
|
3000
3049
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
3001
3050
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3002
3051
|
}, i), {})
|
|
@@ -3030,33 +3079,33 @@ function si(t) {
|
|
|
3030
3079
|
let l = ct(o);
|
|
3031
3080
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3032
3081
|
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);
|
|
3033
|
-
let f,
|
|
3034
|
-
if (
|
|
3035
|
-
if (f = o.__fc__,
|
|
3082
|
+
let f, d = !1, m = !!o.__fc__, g = l.value;
|
|
3083
|
+
if (m) {
|
|
3084
|
+
if (f = o.__fc__, g = f.defaultValue, f.deleted) {
|
|
3036
3085
|
if ($t(f))
|
|
3037
3086
|
return;
|
|
3038
3087
|
f.update(this);
|
|
3039
3088
|
} else if (!f.check(this)) {
|
|
3040
3089
|
if ($t(f))
|
|
3041
3090
|
return;
|
|
3042
|
-
e[a] = o = o._clone ? o._clone() : Vt(et(o)), f = null,
|
|
3091
|
+
e[a] = o = o._clone ? o._clone() : Vt(et(o)), f = null, d = !0;
|
|
3043
3092
|
}
|
|
3044
3093
|
}
|
|
3045
3094
|
if (f)
|
|
3046
3095
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3047
3096
|
else {
|
|
3048
|
-
const
|
|
3049
|
-
f = new Gt(this,
|
|
3097
|
+
const D = this.parseRule(o);
|
|
3098
|
+
f = new Gt(this, D, g), this.bindParser(f);
|
|
3050
3099
|
}
|
|
3051
|
-
[!1, !0].forEach((
|
|
3052
|
-
const
|
|
3053
|
-
if (f.parser.loadChildren === !1 || s(
|
|
3054
|
-
const
|
|
3055
|
-
|
|
3100
|
+
[!1, !0].forEach((D) => this.parseEmit(f, D)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !d && !m && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3101
|
+
const $ = f.loadChildrenPending();
|
|
3102
|
+
if (f.parser.loadChildren === !1 || s($, f), !r) {
|
|
3103
|
+
const D = i(a);
|
|
3104
|
+
D > -1 || !a ? this.sort.splice(D + 1, 0, f.id) : this.sort.push(f.id);
|
|
3056
3105
|
}
|
|
3057
|
-
const
|
|
3058
|
-
return f.updated || (f.updated = !0, h.Function(
|
|
3059
|
-
this.refreshUpdate(f,
|
|
3106
|
+
const _ = f.rule;
|
|
3107
|
+
return f.updated || (f.updated = !0, h.Function(_.update) && this.bus.$once("load-end", () => {
|
|
3108
|
+
this.refreshUpdate(f, _.value, "init");
|
|
3060
3109
|
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3061
3110
|
}).filter((o) => !!o);
|
|
3062
3111
|
r && (r.children = n);
|
|
@@ -3065,16 +3114,16 @@ function si(t) {
|
|
|
3065
3114
|
return e.input && e.rule.control && this.useCtrl(e);
|
|
3066
3115
|
},
|
|
3067
3116
|
useCtrl(e) {
|
|
3068
|
-
const r =
|
|
3117
|
+
const r = li(e), i = [], s = this.api;
|
|
3069
3118
|
if (!r.length) return !1;
|
|
3070
3119
|
for (let a = 0; a < r.length; a++) {
|
|
3071
|
-
const l = r[a], u = l.handle || function(
|
|
3072
|
-
return (
|
|
3120
|
+
const l = r[a], u = l.handle || function(d) {
|
|
3121
|
+
return (fe[l.condition || "=="] || fe["=="])(d, l.value);
|
|
3073
3122
|
};
|
|
3074
3123
|
if (!h.trueArray(l.rule)) continue;
|
|
3075
|
-
const f =
|
|
3076
|
-
valid:
|
|
3077
|
-
ctrl:
|
|
3124
|
+
const f = U(b({}, l), {
|
|
3125
|
+
valid: O(() => u(e.rule.value, s)),
|
|
3126
|
+
ctrl: ui(e, l.rule),
|
|
3078
3127
|
isHidden: h.String(l.rule[0])
|
|
3079
3128
|
});
|
|
3080
3129
|
f.valid && f.ctrl || !f.valid && !f.ctrl && !f.isHidden || i.push(f);
|
|
@@ -3083,34 +3132,34 @@ function si(t) {
|
|
|
3083
3132
|
const n = [];
|
|
3084
3133
|
let o = !1;
|
|
3085
3134
|
return this.deferSyncValue(() => {
|
|
3086
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append:
|
|
3135
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: m, ctrl: g, method: $ }) => {
|
|
3087
3136
|
if (a) {
|
|
3088
3137
|
l ? e.ctrlRule.push({
|
|
3089
3138
|
__ctrl: !0,
|
|
3090
3139
|
children: u,
|
|
3091
3140
|
valid: l
|
|
3092
|
-
}) :
|
|
3093
|
-
|
|
3094
|
-
this.api.setEffect(
|
|
3095
|
-
}), l || this.api.clearValidateState(u)) : this.api.hidden(!l, u);
|
|
3141
|
+
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3142
|
+
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((_) => {
|
|
3143
|
+
this.api.setEffect(_, "required", l);
|
|
3144
|
+
}), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
3096
3145
|
});
|
|
3097
3146
|
return;
|
|
3098
3147
|
}
|
|
3099
3148
|
if (l) {
|
|
3100
3149
|
o = !0;
|
|
3101
|
-
const
|
|
3150
|
+
const _ = {
|
|
3102
3151
|
type: "fragment",
|
|
3103
3152
|
native: !0,
|
|
3104
3153
|
__ctrl: !0,
|
|
3105
3154
|
children: u
|
|
3106
3155
|
};
|
|
3107
|
-
e.ctrlRule.push(
|
|
3108
|
-
f ? s.prepend(
|
|
3156
|
+
e.ctrlRule.push(_), this.bus.$once("load-start", () => {
|
|
3157
|
+
f ? s.prepend(_, f, m) : d || m ? s.append(_, d || e.id, m) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, _);
|
|
3109
3158
|
});
|
|
3110
3159
|
} else {
|
|
3111
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3112
|
-
const
|
|
3113
|
-
|
|
3160
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3161
|
+
const _ = Z(g);
|
|
3162
|
+
_ && _.rm();
|
|
3114
3163
|
}
|
|
3115
3164
|
});
|
|
3116
3165
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
@@ -3137,17 +3186,17 @@ function si(t) {
|
|
|
3137
3186
|
}
|
|
3138
3187
|
});
|
|
3139
3188
|
}
|
|
3140
|
-
function
|
|
3189
|
+
function ai(t) {
|
|
3141
3190
|
const e = Tt();
|
|
3142
3191
|
return Object.keys(e).forEach((r) => {
|
|
3143
|
-
|
|
3192
|
+
E(t, r) || S(t, r, e[r]);
|
|
3144
3193
|
}), t;
|
|
3145
3194
|
}
|
|
3146
|
-
function
|
|
3195
|
+
function li(t) {
|
|
3147
3196
|
const e = t.rule.control || [];
|
|
3148
3197
|
return h.Object(e) ? [e] : e;
|
|
3149
3198
|
}
|
|
3150
|
-
function
|
|
3199
|
+
function ui(t, e) {
|
|
3151
3200
|
for (let r = 0; r < t.ctrlRule.length; r++) {
|
|
3152
3201
|
const i = t.ctrlRule[r];
|
|
3153
3202
|
if (i.children === e)
|
|
@@ -3157,8 +3206,8 @@ function li(t, e) {
|
|
|
3157
3206
|
function $t(t) {
|
|
3158
3207
|
return !!t.rule.__ctrl;
|
|
3159
3208
|
}
|
|
3160
|
-
function
|
|
3161
|
-
|
|
3209
|
+
function fi(t) {
|
|
3210
|
+
C(t.prototype, {
|
|
3162
3211
|
setValue(e, r, i, s) {
|
|
3163
3212
|
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, {
|
|
3164
3213
|
rule: e.origin,
|
|
@@ -3180,7 +3229,7 @@ function ui(t) {
|
|
|
3180
3229
|
this.deferSyncValue(() => {
|
|
3181
3230
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3182
3231
|
Object.keys(r || {}).forEach((o) => {
|
|
3183
|
-
s &&
|
|
3232
|
+
s && E(s, o) ? n[o] = r[o] : E(this.api.form, o) ? this.api.form[o] = r[o] : this.api.top !== this.api && E(this.api.top.form, o) && (this.api.top.form[o] = r[o]);
|
|
3184
3233
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3185
3234
|
});
|
|
3186
3235
|
},
|
|
@@ -3194,29 +3243,29 @@ function ui(t) {
|
|
|
3194
3243
|
},
|
|
3195
3244
|
rmSubRuleData(e) {
|
|
3196
3245
|
const r = e.getParentGroup();
|
|
3197
|
-
r && this.subRuleData[r.id] &&
|
|
3246
|
+
r && this.subRuleData[r.id] && re(this.subRuleData[r.id], e.field);
|
|
3198
3247
|
},
|
|
3199
3248
|
getFormData(e) {
|
|
3200
3249
|
return this.formData[e.id];
|
|
3201
3250
|
},
|
|
3202
3251
|
syncForm() {
|
|
3203
3252
|
const e = {}, r = this.fields(), i = [];
|
|
3204
|
-
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] =
|
|
3253
|
+
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = Ee(this.appendData, n)), s), e), r.reduce((s, n) => {
|
|
3205
3254
|
const o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a.rule))[0] || this.fieldCtx[n][0];
|
|
3206
|
-
return this.isIgnore(o.rule) && i.push(n), s[n] =
|
|
3207
|
-
}, e), this.form =
|
|
3255
|
+
return this.isIgnore(o.rule) && i.push(n), s[n] = Ee(o.rule, "value"), s;
|
|
3256
|
+
}, e), this.form = ie(e), this.ignoreFields = i, this.syncValue();
|
|
3208
3257
|
},
|
|
3209
3258
|
isIgnore(e) {
|
|
3210
3259
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
3211
3260
|
},
|
|
3212
3261
|
appendValue(e) {
|
|
3213
|
-
(!e.field || !
|
|
3262
|
+
(!e.field || !E(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3214
3263
|
},
|
|
3215
3264
|
addSubForm(e, r) {
|
|
3216
3265
|
this.subForm[e.id] = r;
|
|
3217
3266
|
},
|
|
3218
3267
|
deferSyncValue(e, r) {
|
|
3219
|
-
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r),
|
|
3268
|
+
this.deferSyncFn || (this.deferSyncFn = e), this.deferSyncFn.sync || (this.deferSyncFn.sync = r), O(e), this.deferSyncFn === e && (this.deferSyncFn = null, e.sync && this.syncForm());
|
|
3220
3269
|
},
|
|
3221
3270
|
syncValue() {
|
|
3222
3271
|
if (this.deferSyncFn)
|
|
@@ -3234,7 +3283,7 @@ function ui(t) {
|
|
|
3234
3283
|
},
|
|
3235
3284
|
refreshUpdate(e, r, i, s) {
|
|
3236
3285
|
if (h.Function(e.rule.update)) {
|
|
3237
|
-
const n =
|
|
3286
|
+
const n = O(() => e.rule.update(r, e.origin, this.api, {
|
|
3238
3287
|
origin: i || "change",
|
|
3239
3288
|
linkField: s
|
|
3240
3289
|
}));
|
|
@@ -3282,9 +3331,9 @@ const ke = {
|
|
|
3282
3331
|
},
|
|
3283
3332
|
mergeProp(t) {
|
|
3284
3333
|
}
|
|
3285
|
-
},
|
|
3286
|
-
function
|
|
3287
|
-
|
|
3334
|
+
}, ci = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3335
|
+
function hi(t) {
|
|
3336
|
+
C(t.prototype, {
|
|
3288
3337
|
getCtx(e) {
|
|
3289
3338
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
3290
3339
|
},
|
|
@@ -3314,26 +3363,26 @@ function ci(t) {
|
|
|
3314
3363
|
getParser(e) {
|
|
3315
3364
|
const r = this.fc.parsers, i = this.fc.renderDriver;
|
|
3316
3365
|
if (i) {
|
|
3317
|
-
const s = i.parsers || {}, n = s[e.originType] || s[
|
|
3366
|
+
const s = i.parsers || {}, n = s[e.originType] || s[q(e.type)] || s[e.trueType];
|
|
3318
3367
|
if (n)
|
|
3319
3368
|
return n;
|
|
3320
3369
|
}
|
|
3321
|
-
return r[e.originType] || r[
|
|
3370
|
+
return r[e.originType] || r[q(e.type)] || r[e.trueType] || ke;
|
|
3322
3371
|
},
|
|
3323
3372
|
bindParser(e) {
|
|
3324
3373
|
e.setParser(this.getParser(e));
|
|
3325
3374
|
},
|
|
3326
3375
|
getType(e) {
|
|
3327
|
-
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[
|
|
3328
|
-
return
|
|
3376
|
+
const r = this.fc.CreateNode.aliasMap, i = r[e] || r[q(e)] || e;
|
|
3377
|
+
return q(i);
|
|
3329
3378
|
},
|
|
3330
3379
|
noWatch(e) {
|
|
3331
|
-
this.noWatchFn || (this.noWatchFn = e),
|
|
3380
|
+
this.noWatchFn || (this.noWatchFn = e), O(e), this.noWatchFn === e && (this.noWatchFn = null);
|
|
3332
3381
|
},
|
|
3333
3382
|
watchCtx(e) {
|
|
3334
|
-
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" &&
|
|
3335
|
-
const s =
|
|
3336
|
-
e.refRule[i] = s, e.watch.push(
|
|
3383
|
+
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" && ci.indexOf(i) === -1).forEach((i) => {
|
|
3384
|
+
const s = Ee(e.rule, i), n = i === "children";
|
|
3385
|
+
e.refRule[i] = s, e.watch.push(B(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3337
3386
|
let l = s.value;
|
|
3338
3387
|
if (!this.isBreakWatch()) {
|
|
3339
3388
|
if (n && e.parser.loadChildren === !1) {
|
|
@@ -3353,42 +3402,43 @@ function ci(t) {
|
|
|
3353
3402
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3354
3403
|
}
|
|
3355
3404
|
}, { deep: !n, sync: n }));
|
|
3356
|
-
}), e.refRule.__$title =
|
|
3405
|
+
}), e.refRule.__$title = ge(() => {
|
|
3357
3406
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3358
3407
|
if (i) {
|
|
3359
3408
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3360
3409
|
s && (i = this.api.t(s[1]));
|
|
3361
3410
|
}
|
|
3362
3411
|
return i;
|
|
3363
|
-
}), e.refRule.__$info =
|
|
3412
|
+
}), e.refRule.__$info = ge(() => {
|
|
3364
3413
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3365
3414
|
if (i) {
|
|
3366
3415
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3367
3416
|
s && (i = this.api.t(s[1]));
|
|
3368
3417
|
}
|
|
3369
3418
|
return i;
|
|
3370
|
-
}), e.refRule.__$validate =
|
|
3419
|
+
}), e.refRule.__$validate = ge(() => G(e.rule.validate).map((i) => {
|
|
3420
|
+
var n, o;
|
|
3371
3421
|
const s = b({}, i);
|
|
3372
3422
|
if (s.message) {
|
|
3373
|
-
const
|
|
3374
|
-
|
|
3423
|
+
const a = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3424
|
+
a && (s.message = this.api.t(a[1], { title: (o = (n = e.refRule) == null ? void 0 : n.__$title) == null ? void 0 : o.value }));
|
|
3375
3425
|
}
|
|
3376
3426
|
if (h.Function(s.validator)) {
|
|
3377
|
-
const
|
|
3378
|
-
return s.validator = function(...
|
|
3427
|
+
const a = e;
|
|
3428
|
+
return s.validator = function(...l) {
|
|
3379
3429
|
return i.validator.call({
|
|
3380
3430
|
that: this,
|
|
3381
|
-
id:
|
|
3382
|
-
field:
|
|
3383
|
-
rule:
|
|
3384
|
-
api:
|
|
3385
|
-
}, ...
|
|
3431
|
+
id: a.id,
|
|
3432
|
+
field: a.field,
|
|
3433
|
+
rule: a.rule,
|
|
3434
|
+
api: a.$handle.api
|
|
3435
|
+
}, ...l);
|
|
3386
3436
|
}, s;
|
|
3387
3437
|
}
|
|
3388
3438
|
return s;
|
|
3389
3439
|
})), e.input) {
|
|
3390
|
-
const i =
|
|
3391
|
-
e.watch.push(
|
|
3440
|
+
const i = Ee(e.rule, "value");
|
|
3441
|
+
e.watch.push(B(() => i.value, () => {
|
|
3392
3442
|
let s = e.parser.toFormValue(i.value, e);
|
|
3393
3443
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
3394
3444
|
}));
|
|
@@ -3397,15 +3447,15 @@ function ci(t) {
|
|
|
3397
3447
|
let i = e.rule.computed;
|
|
3398
3448
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3399
3449
|
let n;
|
|
3400
|
-
const o =
|
|
3450
|
+
const o = ge(() => {
|
|
3401
3451
|
const l = i[s];
|
|
3402
3452
|
if (!l) return;
|
|
3403
3453
|
const u = this.compute(e, l);
|
|
3404
3454
|
return l.linkage && u === void 0 ? n : u;
|
|
3405
3455
|
}), a = (l) => {
|
|
3406
|
-
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) :
|
|
3456
|
+
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : se(e.rule, s, l);
|
|
3407
3457
|
};
|
|
3408
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3458
|
+
(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) => {
|
|
3409
3459
|
n = l, setTimeout(() => {
|
|
3410
3460
|
a(l);
|
|
3411
3461
|
});
|
|
@@ -3422,30 +3472,30 @@ function ci(t) {
|
|
|
3422
3472
|
const l = a.mode === "OR";
|
|
3423
3473
|
let u = !0;
|
|
3424
3474
|
for (let f = 0; f < a.group.length; f++) {
|
|
3425
|
-
const
|
|
3426
|
-
let
|
|
3427
|
-
if (
|
|
3428
|
-
|
|
3429
|
-
else if (
|
|
3430
|
-
|
|
3475
|
+
const d = a.group[f];
|
|
3476
|
+
let m, g = null;
|
|
3477
|
+
if (d.variable)
|
|
3478
|
+
g = JSON.stringify(this.fc.getLoadData(d.variable) || "");
|
|
3479
|
+
else if (d.field)
|
|
3480
|
+
g = dt(d.field || "");
|
|
3431
3481
|
else
|
|
3432
3482
|
return !0;
|
|
3433
|
-
let
|
|
3434
|
-
if (
|
|
3483
|
+
let $ = d.compare;
|
|
3484
|
+
if ($ && ($ = dt($ || "")), d.mode ? m = n(d) : fe[d.condition] ? h.Function(d.handler) ? m = O(() => d.handler(this.api, e.rule)) : m = O(() => 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, fe, 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)
|
|
3435
3485
|
return !0;
|
|
3436
|
-
l || (u = u &&
|
|
3486
|
+
l || (u = u && m);
|
|
3437
3487
|
}
|
|
3438
3488
|
return l ? !1 : u;
|
|
3439
3489
|
};
|
|
3440
3490
|
let o = n(r);
|
|
3441
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ?
|
|
3491
|
+
return o = r.invert === !0 ? !o : o, r.linkage ? o ? O(() => this.computeValue(r.linkage, e, s), void 0) : void 0 : o;
|
|
3442
3492
|
} else if (h.Function(r))
|
|
3443
3493
|
i = () => r(this.api.form, this.api);
|
|
3444
3494
|
else {
|
|
3445
3495
|
const s = e.getParentGroup();
|
|
3446
3496
|
i = () => this.computeValue(r, e, s);
|
|
3447
3497
|
}
|
|
3448
|
-
return
|
|
3498
|
+
return O(i, void 0);
|
|
3449
3499
|
},
|
|
3450
3500
|
computeValue(e, r, i) {
|
|
3451
3501
|
const s = this, n = Object.keys(this.fc.formulas).reduce((o, a) => (o[a] = function(...l) {
|
|
@@ -3456,7 +3506,7 @@ function ci(t) {
|
|
|
3456
3506
|
fc: s.fc
|
|
3457
3507
|
}, ...l);
|
|
3458
3508
|
}, o), {});
|
|
3459
|
-
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);
|
|
3509
|
+
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);
|
|
3460
3510
|
},
|
|
3461
3511
|
updateChildren(e, r, i) {
|
|
3462
3512
|
this.deferSyncValue(() => {
|
|
@@ -3473,9 +3523,9 @@ function ci(t) {
|
|
|
3473
3523
|
rmCtx(e) {
|
|
3474
3524
|
if (e.deleted) return;
|
|
3475
3525
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3476
|
-
|
|
3526
|
+
re(this.ctxs, r), re(this.formData, r), re(this.subForm, r), re(this.vm.ctxInject, r);
|
|
3477
3527
|
const o = e.getParentGroup();
|
|
3478
|
-
o && this.subRuleData[o.id] &&
|
|
3528
|
+
o && this.subRuleData[o.id] && re(this.subRuleData[o.id], i), e.group && re(this.subRuleData, r), s && this.rmIdCtx(e, i, "field"), n && this.rmIdCtx(e, n, "name"), s && !E(this.fieldCtx, i) && re(this.form, i), this.deferSyncValue(() => {
|
|
3479
3529
|
if (!this.reloading) {
|
|
3480
3530
|
if (e.parser.loadChildren !== !1) {
|
|
3481
3531
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3489,8 +3539,8 @@ function ci(t) {
|
|
|
3489
3539
|
}
|
|
3490
3540
|
});
|
|
3491
3541
|
}
|
|
3492
|
-
function
|
|
3493
|
-
|
|
3542
|
+
function di(t) {
|
|
3543
|
+
C(t.prototype, {
|
|
3494
3544
|
mounted() {
|
|
3495
3545
|
const e = () => {
|
|
3496
3546
|
this.isMounted = !0, this.lifecycle("mounted");
|
|
@@ -3501,10 +3551,10 @@ function hi(t) {
|
|
|
3501
3551
|
this.fc.targetFormDriver(e, this.api, this.fc), this.vm.$emit(e, this.api), this.emitEvent(e, this.api);
|
|
3502
3552
|
},
|
|
3503
3553
|
emitEvent(e, ...r) {
|
|
3504
|
-
const i = this.options[e] || this.options[
|
|
3554
|
+
const i = this.options[e] || this.options[q("on-" + e)];
|
|
3505
3555
|
if (i) {
|
|
3506
|
-
const s =
|
|
3507
|
-
h.Function(s) &&
|
|
3556
|
+
const s = z(i);
|
|
3557
|
+
h.Function(s) && O(() => s(...r));
|
|
3508
3558
|
}
|
|
3509
3559
|
this.bus.$emit(e, ...r);
|
|
3510
3560
|
},
|
|
@@ -3512,18 +3562,18 @@ function hi(t) {
|
|
|
3512
3562
|
var n, o;
|
|
3513
3563
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3514
3564
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3515
|
-
|
|
3565
|
+
O(() => a(U(b({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
|
|
3516
3566
|
}));
|
|
3517
3567
|
}
|
|
3518
3568
|
});
|
|
3519
3569
|
}
|
|
3520
|
-
function
|
|
3521
|
-
|
|
3570
|
+
function pi(t) {
|
|
3571
|
+
C(t.prototype, {
|
|
3522
3572
|
useProvider() {
|
|
3523
3573
|
const e = this.fc.providers;
|
|
3524
3574
|
Object.keys(e).forEach((r) => {
|
|
3525
3575
|
let i = e[r];
|
|
3526
|
-
h.Function(i) && (i = i(this.fc)), i._c =
|
|
3576
|
+
h.Function(i) && (i = i(this.fc)), i._c = gi(i), this.onEffect(i), this.providers[r] = i;
|
|
3527
3577
|
});
|
|
3528
3578
|
},
|
|
3529
3579
|
onEffect(e) {
|
|
@@ -3539,7 +3589,7 @@ function di(t) {
|
|
|
3539
3589
|
let r = {
|
|
3540
3590
|
required: () => {
|
|
3541
3591
|
var i, s;
|
|
3542
|
-
return (
|
|
3592
|
+
return (E(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3543
3593
|
}
|
|
3544
3594
|
};
|
|
3545
3595
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3547,7 +3597,7 @@ function di(t) {
|
|
|
3547
3597
|
}), Object.keys(e.rule).forEach((i) => {
|
|
3548
3598
|
i[0] === "$" && (r[i.substr(1)] = () => e.rule[i]);
|
|
3549
3599
|
}), Object.keys(r).forEach((i) => {
|
|
3550
|
-
e.watch.push(
|
|
3600
|
+
e.watch.push(B(r[i], (s) => {
|
|
3551
3601
|
this.effect(e, "watch", { [i]: s });
|
|
3552
3602
|
}, { deep: !0 }));
|
|
3553
3603
|
});
|
|
@@ -3569,9 +3619,9 @@ function di(t) {
|
|
|
3569
3619
|
}, r);
|
|
3570
3620
|
},
|
|
3571
3621
|
getEffect(e, r) {
|
|
3572
|
-
if (
|
|
3622
|
+
if (E(e, "$" + r))
|
|
3573
3623
|
return e["$" + r];
|
|
3574
|
-
if (
|
|
3624
|
+
if (E(e, "effect") && E(e.effect, r))
|
|
3575
3625
|
return e.effect[r];
|
|
3576
3626
|
},
|
|
3577
3627
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3580,32 +3630,32 @@ function di(t) {
|
|
|
3580
3630
|
Object.keys(l).forEach((u) => {
|
|
3581
3631
|
const f = this.providers[u];
|
|
3582
3632
|
if (!f || f.input && !i) return;
|
|
3583
|
-
let
|
|
3633
|
+
let d;
|
|
3584
3634
|
if (!f._c)
|
|
3585
|
-
|
|
3635
|
+
d = "*";
|
|
3586
3636
|
else if (f._used.indexOf(s) > -1)
|
|
3587
|
-
|
|
3637
|
+
d = s;
|
|
3588
3638
|
else
|
|
3589
3639
|
return;
|
|
3590
|
-
const
|
|
3591
|
-
e && (
|
|
3640
|
+
const m = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3641
|
+
e && (m.getProp = () => e.effectData(u), m.clearProp = () => e.clearEffectData(u), m.mergeProp = (g) => x(m.getProp(), [g]), m.id = e.id), this.bus.$emit(`p:${u}:${d}:${f.input ? 1 : 0}`, o, [m, r, this.api]);
|
|
3592
3642
|
});
|
|
3593
3643
|
}
|
|
3594
3644
|
});
|
|
3595
3645
|
}
|
|
3596
|
-
function
|
|
3646
|
+
function mi(t) {
|
|
3597
3647
|
return t.filter(function(e, r, i) {
|
|
3598
3648
|
return i.indexOf(e, 0) === r;
|
|
3599
3649
|
});
|
|
3600
3650
|
}
|
|
3601
|
-
function
|
|
3651
|
+
function gi(t) {
|
|
3602
3652
|
const e = t.components;
|
|
3603
3653
|
if (Array.isArray(e)) {
|
|
3604
|
-
const r =
|
|
3654
|
+
const r = mi(e.filter((i) => i !== "*"));
|
|
3605
3655
|
return r.length ? r : !1;
|
|
3606
3656
|
} else return h.String(e) ? [e] : !1;
|
|
3607
3657
|
}
|
|
3608
|
-
function
|
|
3658
|
+
function K(t) {
|
|
3609
3659
|
Lt(this, {
|
|
3610
3660
|
options() {
|
|
3611
3661
|
return t.options.value || {};
|
|
@@ -3616,7 +3666,7 @@ function z(t) {
|
|
|
3616
3666
|
preview() {
|
|
3617
3667
|
return t.vm.$options.propsData.preview != null ? t.vm.$options.propsData.preview : t.options.value.preview || !1;
|
|
3618
3668
|
}
|
|
3619
|
-
}),
|
|
3669
|
+
}), C(this, {
|
|
3620
3670
|
fc: t,
|
|
3621
3671
|
vm: t.vm,
|
|
3622
3672
|
watching: !1,
|
|
@@ -3625,10 +3675,10 @@ function z(t) {
|
|
|
3625
3675
|
noWatchFn: null,
|
|
3626
3676
|
deferSyncFn: null,
|
|
3627
3677
|
isMounted: !1,
|
|
3628
|
-
formData:
|
|
3629
|
-
subRuleData:
|
|
3678
|
+
formData: ie({}),
|
|
3679
|
+
subRuleData: ie({}),
|
|
3630
3680
|
subForm: {},
|
|
3631
|
-
form:
|
|
3681
|
+
form: ie({}),
|
|
3632
3682
|
appendData: {},
|
|
3633
3683
|
ignoreFields: [],
|
|
3634
3684
|
providers: {},
|
|
@@ -3641,13 +3691,13 @@ function z(t) {
|
|
|
3641
3691
|
this.lifecycle("reload");
|
|
3642
3692
|
}
|
|
3643
3693
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3644
|
-
const i =
|
|
3645
|
-
return i && i !== e &&
|
|
3646
|
-
},
|
|
3694
|
+
const i = O(() => r(e, this));
|
|
3695
|
+
return i && i !== e && C(e, i), e;
|
|
3696
|
+
}, Zr(this));
|
|
3647
3697
|
}
|
|
3648
|
-
|
|
3698
|
+
C(K.prototype, {
|
|
3649
3699
|
initData(t) {
|
|
3650
|
-
|
|
3700
|
+
C(this, {
|
|
3651
3701
|
ctxs: {},
|
|
3652
3702
|
fieldCtx: {},
|
|
3653
3703
|
nameCtx: {},
|
|
@@ -3664,48 +3714,54 @@ _(z.prototype, {
|
|
|
3664
3714
|
isBreakWatch() {
|
|
3665
3715
|
return this.loading || this.noWatchFn || this.reloading;
|
|
3666
3716
|
},
|
|
3667
|
-
|
|
3668
|
-
return new Promise((e) => {
|
|
3669
|
-
const
|
|
3670
|
-
|
|
3717
|
+
globalBeforeFetch(t) {
|
|
3718
|
+
return new Promise((e, r) => {
|
|
3719
|
+
const i = this.options.beforeFetch && O(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3720
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : e();
|
|
3671
3721
|
});
|
|
3722
|
+
},
|
|
3723
|
+
beforeFetch(t) {
|
|
3724
|
+
return new Promise((e, r) => {
|
|
3725
|
+
const i = t && t.beforeFetch && O(() => t.beforeFetch(t, { api: this.api }));
|
|
3726
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3727
|
+
}).then(() => this.globalBeforeFetch(t));
|
|
3672
3728
|
}
|
|
3673
3729
|
});
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
const
|
|
3683
|
-
name:
|
|
3730
|
+
ti(K);
|
|
3731
|
+
ri(K);
|
|
3732
|
+
ni(K);
|
|
3733
|
+
oi(K);
|
|
3734
|
+
fi(K);
|
|
3735
|
+
hi(K);
|
|
3736
|
+
di(K);
|
|
3737
|
+
pi(K);
|
|
3738
|
+
const yi = "fcFragment", Te = {
|
|
3739
|
+
name: yi,
|
|
3684
3740
|
functional: !0,
|
|
3685
3741
|
props: ["vnode"],
|
|
3686
3742
|
render(t, e) {
|
|
3687
3743
|
return e.props.vnode ? e.props.vnode : e.children;
|
|
3688
3744
|
}
|
|
3689
3745
|
};
|
|
3690
|
-
function
|
|
3746
|
+
function $i(t) {
|
|
3691
3747
|
return h.String(t) ? { domProps: { innerHTML: t } } : t;
|
|
3692
3748
|
}
|
|
3693
|
-
function
|
|
3749
|
+
function vi() {
|
|
3694
3750
|
const t = {};
|
|
3695
3751
|
function e(r) {
|
|
3696
3752
|
r && this.setVm(r);
|
|
3697
3753
|
}
|
|
3698
|
-
return
|
|
3754
|
+
return C(e.prototype, {
|
|
3699
3755
|
setVm(r) {
|
|
3700
3756
|
this.vm = r, this.h = this.$h = r.$createElement;
|
|
3701
3757
|
},
|
|
3702
3758
|
make(r, i, s) {
|
|
3703
3759
|
var n, o, a;
|
|
3704
|
-
return (
|
|
3760
|
+
return (ye.isReservedTag ? ye.isReservedTag(r) : (o = (n = ye) == 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);
|
|
3705
3761
|
},
|
|
3706
3762
|
makeComponent(r, i, s) {
|
|
3707
3763
|
var o;
|
|
3708
|
-
let n = this.$h(r,
|
|
3764
|
+
let n = this.$h(r, $i(i), s || []);
|
|
3709
3765
|
if ((o = n == null ? void 0 : n.componentOptions) != null && o.propsData && (i != null && i.props)) {
|
|
3710
3766
|
const a = Object.keys(n.componentOptions.propsData);
|
|
3711
3767
|
n.data.attrs || (n.data.attrs = {}), Object.keys(i.props).forEach((l) => {
|
|
@@ -3715,14 +3771,14 @@ function $i() {
|
|
|
3715
3771
|
return n.context = this.vm, n;
|
|
3716
3772
|
},
|
|
3717
3773
|
aliasMap: t
|
|
3718
|
-
}),
|
|
3774
|
+
}), C(e, {
|
|
3719
3775
|
aliasMap: t,
|
|
3720
3776
|
alias(r, i) {
|
|
3721
3777
|
t[r] = i;
|
|
3722
3778
|
},
|
|
3723
3779
|
use(r) {
|
|
3724
3780
|
Object.keys(r).forEach((i) => {
|
|
3725
|
-
const s =
|
|
3781
|
+
const s = ve(i), n = Gr(i).toLocaleLowerCase(), o = r[i];
|
|
3726
3782
|
[i, s, n].forEach((a) => {
|
|
3727
3783
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3728
3784
|
return this.make(o, l, u);
|
|
@@ -3732,13 +3788,13 @@ function $i() {
|
|
|
3732
3788
|
}
|
|
3733
3789
|
}), e;
|
|
3734
3790
|
}
|
|
3735
|
-
function
|
|
3791
|
+
function bi(t) {
|
|
3736
3792
|
class e extends Ht {
|
|
3737
3793
|
}
|
|
3738
3794
|
return Object.assign(e.prototype, t), e;
|
|
3739
3795
|
}
|
|
3740
3796
|
function Ht(t) {
|
|
3741
|
-
|
|
3797
|
+
C(this, {
|
|
3742
3798
|
$handle: t,
|
|
3743
3799
|
vm: t.vm,
|
|
3744
3800
|
options: {},
|
|
@@ -3748,12 +3804,12 @@ function Ht(t) {
|
|
|
3748
3804
|
}
|
|
3749
3805
|
}), this.updateKey(), this.init();
|
|
3750
3806
|
}
|
|
3751
|
-
|
|
3807
|
+
C(Ht.prototype, {
|
|
3752
3808
|
__init() {
|
|
3753
3809
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3754
3810
|
},
|
|
3755
3811
|
updateKey() {
|
|
3756
|
-
this.key =
|
|
3812
|
+
this.key = Ie();
|
|
3757
3813
|
},
|
|
3758
3814
|
//TODO interface
|
|
3759
3815
|
init() {
|
|
@@ -3775,7 +3831,7 @@ _(Ht.prototype, {
|
|
|
3775
3831
|
return e(this.vm);
|
|
3776
3832
|
},
|
|
3777
3833
|
mergeOptions(t, e) {
|
|
3778
|
-
return
|
|
3834
|
+
return Y(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3779
3835
|
},
|
|
3780
3836
|
updateOptions(t) {
|
|
3781
3837
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3793,24 +3849,24 @@ _(Ht.prototype, {
|
|
|
3793
3849
|
render(t) {
|
|
3794
3850
|
}
|
|
3795
3851
|
});
|
|
3796
|
-
const
|
|
3852
|
+
const _i = function(t) {
|
|
3797
3853
|
const e = {
|
|
3798
3854
|
name: "loadData",
|
|
3799
3855
|
_fn: [],
|
|
3800
|
-
|
|
3856
|
+
mounted(r, i, s) {
|
|
3801
3857
|
this.deleted(r);
|
|
3802
|
-
let n =
|
|
3858
|
+
let n = G(r.getValue());
|
|
3803
3859
|
const o = [];
|
|
3804
3860
|
n.forEach((a) => {
|
|
3805
3861
|
if (a && (a.attr || a.template)) {
|
|
3806
|
-
let l = (
|
|
3807
|
-
let
|
|
3808
|
-
a.template ?
|
|
3809
|
-
const
|
|
3810
|
-
a.to === "child" ?
|
|
3811
|
-
}, u = (
|
|
3862
|
+
let l = (d) => {
|
|
3863
|
+
let m;
|
|
3864
|
+
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 = W(m));
|
|
3865
|
+
const g = a.modify ? i : r.getProp();
|
|
3866
|
+
a.to === "child" ? g.children ? S(g.children, 0, m) : S(g, "children", [m]) : se(g, a.to || "options", m), s.sync(i);
|
|
3867
|
+
}, u = (d) => l(d);
|
|
3812
3868
|
const f = t.watchLoadData(u);
|
|
3813
|
-
l =
|
|
3869
|
+
l = ne(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3814
3870
|
}
|
|
3815
3871
|
}), this._fn[r.id] = o;
|
|
3816
3872
|
},
|
|
@@ -3821,7 +3877,7 @@ const bi = function(t) {
|
|
|
3821
3877
|
}
|
|
3822
3878
|
};
|
|
3823
3879
|
return e.watch = e.mounted, e;
|
|
3824
|
-
},
|
|
3880
|
+
}, Ci = function(t) {
|
|
3825
3881
|
const e = {
|
|
3826
3882
|
name: "t",
|
|
3827
3883
|
_fn: [],
|
|
@@ -3833,13 +3889,13 @@ const bi = function(t) {
|
|
|
3833
3889
|
const l = n[a];
|
|
3834
3890
|
if (l) {
|
|
3835
3891
|
const u = typeof l == "object";
|
|
3836
|
-
let f = (
|
|
3837
|
-
let
|
|
3838
|
-
const
|
|
3839
|
-
a === "child" ?
|
|
3840
|
-
},
|
|
3841
|
-
const
|
|
3842
|
-
f =
|
|
3892
|
+
let f = (g) => {
|
|
3893
|
+
let $ = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
3894
|
+
const _ = u && l.modify ? i : r.getProp();
|
|
3895
|
+
a === "child" ? _.children ? S(_.children, 0, $) : S(_, "children", [$]) : se(_, a, $), s.sync(i);
|
|
3896
|
+
}, d = (g) => f(g);
|
|
3897
|
+
const m = t.watchLoadData(d);
|
|
3898
|
+
f = ne(f, l.wait || 300), l.watch !== !1 ? o.push(m) : m();
|
|
3843
3899
|
}
|
|
3844
3900
|
}), this._fn[r.id] = o;
|
|
3845
3901
|
},
|
|
@@ -3859,9 +3915,9 @@ const bi = function(t) {
|
|
|
3859
3915
|
else {
|
|
3860
3916
|
h.Object(i) || (i = { method: i });
|
|
3861
3917
|
const s = i.method;
|
|
3862
|
-
delete i.method, t.getProp().validate = [
|
|
3918
|
+
delete i.method, t.getProp().validate = [U(b({}, i), {
|
|
3863
3919
|
validator(...n) {
|
|
3864
|
-
const o =
|
|
3920
|
+
const o = Z(e);
|
|
3865
3921
|
if (o)
|
|
3866
3922
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3867
3923
|
attr: t,
|
|
@@ -3875,7 +3931,7 @@ const bi = function(t) {
|
|
|
3875
3931
|
watch(...t) {
|
|
3876
3932
|
Jt.load(...t);
|
|
3877
3933
|
}
|
|
3878
|
-
},
|
|
3934
|
+
}, wi = function(t) {
|
|
3879
3935
|
function e(s) {
|
|
3880
3936
|
return h.String(s) && (s = {
|
|
3881
3937
|
action: s,
|
|
@@ -3885,55 +3941,55 @@ const bi = function(t) {
|
|
|
3885
3941
|
function r(s, n, o) {
|
|
3886
3942
|
let a = s.value;
|
|
3887
3943
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3888
|
-
const l = (
|
|
3889
|
-
|
|
3944
|
+
const l = (d) => {
|
|
3945
|
+
d === void 0 ? s.clearProp() : se(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3890
3946
|
};
|
|
3891
3947
|
if (!a || !a.action && !a.key) {
|
|
3892
3948
|
l(void 0);
|
|
3893
3949
|
return;
|
|
3894
3950
|
}
|
|
3895
|
-
if (a =
|
|
3896
|
-
const
|
|
3897
|
-
if (!
|
|
3951
|
+
if (a = W(a), a.to || (a.to = "options"), a.key) {
|
|
3952
|
+
const d = t.$handle.options.globalData[a.key];
|
|
3953
|
+
if (!d) {
|
|
3898
3954
|
l(void 0);
|
|
3899
3955
|
return;
|
|
3900
3956
|
}
|
|
3901
|
-
if (
|
|
3902
|
-
l(
|
|
3957
|
+
if (d.type === "static") {
|
|
3958
|
+
l(d.data);
|
|
3903
3959
|
return;
|
|
3904
3960
|
} else
|
|
3905
|
-
a = b(b({}, a),
|
|
3961
|
+
a = b(b({}, a), d);
|
|
3906
3962
|
}
|
|
3907
3963
|
const u = a.onError, f = () => {
|
|
3908
3964
|
if (!s.getValue())
|
|
3909
3965
|
return s.clearProp(), o.sync(n), !0;
|
|
3910
3966
|
};
|
|
3911
|
-
i._fn[s.id] = t.watchLoadData(
|
|
3912
|
-
if (
|
|
3967
|
+
i._fn[s.id] = t.watchLoadData(ne((d, m) => {
|
|
3968
|
+
if (m && a.watch === !1)
|
|
3913
3969
|
return i._fn[s.id]();
|
|
3914
|
-
const
|
|
3970
|
+
const g = t.$handle.loadFetchVar(W(a), d, n), $ = U(b({
|
|
3915
3971
|
headers: {}
|
|
3916
|
-
},
|
|
3917
|
-
onSuccess(
|
|
3972
|
+
}, g), {
|
|
3973
|
+
onSuccess(_, D) {
|
|
3918
3974
|
if (f()) return;
|
|
3919
|
-
let
|
|
3920
|
-
const V =
|
|
3921
|
-
h.Function(V) ?
|
|
3975
|
+
let ee = (T) => D ? T : E(T, "data") ? T.data : T;
|
|
3976
|
+
const V = z(g.parse);
|
|
3977
|
+
h.Function(V) ? ee = V : V && h.String(V) && (ee = (T) => L(T, V)), l(ee(_, n, o)), o.sync(n);
|
|
3922
3978
|
},
|
|
3923
|
-
onError(
|
|
3924
|
-
l(void 0), !f() && (u || ((
|
|
3979
|
+
onError(_) {
|
|
3980
|
+
l(void 0), !f() && (u || ((D) => xe(D.message || "fetch fail " + g.action)))(_, n, o);
|
|
3925
3981
|
}
|
|
3926
3982
|
});
|
|
3927
|
-
t.$handle.beforeFetch(
|
|
3928
|
-
if (h.Function(
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
}).catch((
|
|
3932
|
-
|
|
3983
|
+
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
3984
|
+
if (h.Function(g.action)) {
|
|
3985
|
+
g.action(n, o).then((_) => {
|
|
3986
|
+
$.onSuccess(_, !0);
|
|
3987
|
+
}).catch((_) => {
|
|
3988
|
+
$.onError(_);
|
|
3933
3989
|
});
|
|
3934
3990
|
return;
|
|
3935
3991
|
}
|
|
3936
|
-
|
|
3992
|
+
O(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
3937
3993
|
});
|
|
3938
3994
|
}, a.wait || 600));
|
|
3939
3995
|
}
|
|
@@ -3951,13 +4007,13 @@ const bi = function(t) {
|
|
|
3951
4007
|
}
|
|
3952
4008
|
};
|
|
3953
4009
|
return i;
|
|
3954
|
-
},
|
|
3955
|
-
fetch:
|
|
3956
|
-
loadData:
|
|
3957
|
-
t:
|
|
4010
|
+
}, Oi = {
|
|
4011
|
+
fetch: wi,
|
|
4012
|
+
loadData: _i,
|
|
4013
|
+
t: Ci,
|
|
3958
4014
|
componentValidate: Jt
|
|
3959
4015
|
};
|
|
3960
|
-
function
|
|
4016
|
+
function Fi(t) {
|
|
3961
4017
|
t = t || /* @__PURE__ */ new Map();
|
|
3962
4018
|
const e = {
|
|
3963
4019
|
$on(r, i) {
|
|
@@ -3981,8 +4037,8 @@ function Oi(t) {
|
|
|
3981
4037
|
};
|
|
3982
4038
|
return e;
|
|
3983
4039
|
}
|
|
3984
|
-
const
|
|
3985
|
-
name:
|
|
4040
|
+
const Si = "html", Ri = {
|
|
4041
|
+
name: Si,
|
|
3986
4042
|
loadChildren: !1,
|
|
3987
4043
|
render(t, e) {
|
|
3988
4044
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
@@ -4009,7 +4065,7 @@ function ki(t) {
|
|
|
4009
4065
|
}
|
|
4010
4066
|
return null;
|
|
4011
4067
|
}
|
|
4012
|
-
function
|
|
4068
|
+
function Ei(t) {
|
|
4013
4069
|
const e = localStorage.getItem(t);
|
|
4014
4070
|
if (e)
|
|
4015
4071
|
try {
|
|
@@ -4019,7 +4075,7 @@ function Ri(t) {
|
|
|
4019
4075
|
}
|
|
4020
4076
|
return null;
|
|
4021
4077
|
}
|
|
4022
|
-
function
|
|
4078
|
+
function Di(t) {
|
|
4023
4079
|
const e = sessionStorage.getItem(t);
|
|
4024
4080
|
if (e)
|
|
4025
4081
|
try {
|
|
@@ -4034,28 +4090,28 @@ function it(t, e) {
|
|
|
4034
4090
|
return null;
|
|
4035
4091
|
const r = e.split(".");
|
|
4036
4092
|
let i = t(r.shift());
|
|
4037
|
-
return r.length ? i == null ? null :
|
|
4038
|
-
}
|
|
4039
|
-
function Di(t) {
|
|
4040
|
-
return it(ki, t);
|
|
4093
|
+
return r.length ? i == null ? null : L(i, r) : i;
|
|
4041
4094
|
}
|
|
4042
4095
|
function ji(t) {
|
|
4043
|
-
return it(
|
|
4096
|
+
return it(ki, t);
|
|
4044
4097
|
}
|
|
4045
4098
|
function Ii(t) {
|
|
4046
4099
|
return it(Ei, t);
|
|
4047
4100
|
}
|
|
4048
|
-
function Ai(t
|
|
4101
|
+
function Ai(t) {
|
|
4102
|
+
return it(Di, t);
|
|
4103
|
+
}
|
|
4104
|
+
function Vi(t, e) {
|
|
4049
4105
|
let r;
|
|
4050
4106
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4051
4107
|
}
|
|
4052
4108
|
function Ne() {
|
|
4053
|
-
return
|
|
4109
|
+
return Vi("name", ...arguments);
|
|
4054
4110
|
}
|
|
4055
|
-
function
|
|
4111
|
+
function Pi(t) {
|
|
4056
4112
|
return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
|
|
4057
4113
|
}
|
|
4058
|
-
function
|
|
4114
|
+
function Bi(t, e) {
|
|
4059
4115
|
const r = new Vue({
|
|
4060
4116
|
data() {
|
|
4061
4117
|
return { rule: t, option: e || {} };
|
|
@@ -4066,27 +4122,29 @@ function Pi(t, e) {
|
|
|
4066
4122
|
});
|
|
4067
4123
|
return r.$mount(), r;
|
|
4068
4124
|
}
|
|
4069
|
-
function
|
|
4125
|
+
function Li(t) {
|
|
4070
4126
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4071
4127
|
jt.push(...e), Ze.push(...r), Ye.push(...i), Nt([...e, ...r, ...i]);
|
|
4072
4128
|
}
|
|
4073
|
-
let
|
|
4074
|
-
const M = {},
|
|
4129
|
+
let Ti = 1;
|
|
4130
|
+
const M = {}, Se = Symbol("defValue");
|
|
4075
4131
|
function Wt(t) {
|
|
4076
4132
|
const e = {
|
|
4077
4133
|
[Te.name]: Te
|
|
4078
4134
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4079
4135
|
t.extendApi
|
|
4080
|
-
], u = b({},
|
|
4081
|
-
let
|
|
4082
|
-
const
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
if (
|
|
4089
|
-
return
|
|
4136
|
+
], u = b({}, Oi), f = Xr();
|
|
4137
|
+
let d = { global: {} };
|
|
4138
|
+
const m = t.isMobile === !0, g = ie({
|
|
4139
|
+
$mobile: m
|
|
4140
|
+
}), $ = vi(), _ = {}, D = {};
|
|
4141
|
+
Li(t.attrs || {});
|
|
4142
|
+
function ee(c) {
|
|
4143
|
+
const p = M[c];
|
|
4144
|
+
if (Array.isArray(p))
|
|
4145
|
+
return p.map((y) => y.api());
|
|
4146
|
+
if (p)
|
|
4147
|
+
return p.api();
|
|
4090
4148
|
}
|
|
4091
4149
|
function V(c) {
|
|
4092
4150
|
o.push(c);
|
|
@@ -4095,50 +4153,50 @@ function Wt(t) {
|
|
|
4095
4153
|
const c = Ne(...arguments);
|
|
4096
4154
|
c.id && c.prop && (i[c.id] = c.prop);
|
|
4097
4155
|
}
|
|
4098
|
-
function
|
|
4156
|
+
function ce() {
|
|
4099
4157
|
const c = Ne(...arguments);
|
|
4100
|
-
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop :
|
|
4158
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(b({}, c.prop), {
|
|
4101
4159
|
name: c.id
|
|
4102
4160
|
}));
|
|
4103
4161
|
}
|
|
4104
|
-
function
|
|
4105
|
-
|
|
4162
|
+
function Ae(c) {
|
|
4163
|
+
$.use(c);
|
|
4106
4164
|
}
|
|
4107
|
-
function
|
|
4165
|
+
function he() {
|
|
4108
4166
|
const c = Ne(...arguments);
|
|
4109
4167
|
if (!c.id || !c.prop) return ke;
|
|
4110
|
-
const
|
|
4111
|
-
r[
|
|
4168
|
+
const p = q(c.id), y = c.prop, v = y.merge === !0 ? r[p] : void 0;
|
|
4169
|
+
r[p] = Fe(y, v || ke), f[p] = A(p), y.maker && C(f, y.maker);
|
|
4112
4170
|
}
|
|
4113
|
-
function
|
|
4114
|
-
let
|
|
4171
|
+
function F(c, p) {
|
|
4172
|
+
let y;
|
|
4115
4173
|
if (h.String(c)) {
|
|
4116
|
-
if (
|
|
4117
|
-
return ["form-create", "formcreate"].indexOf(
|
|
4174
|
+
if (y = c, p === void 0)
|
|
4175
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? R() : e[y];
|
|
4118
4176
|
} else
|
|
4119
|
-
|
|
4120
|
-
if (!
|
|
4121
|
-
const
|
|
4122
|
-
e[
|
|
4177
|
+
y = q(c.name), p = c;
|
|
4178
|
+
if (!y || !p) return;
|
|
4179
|
+
const v = q(y);
|
|
4180
|
+
e[y] = p, e[v] = p, delete $.aliasMap[y], delete $.aliasMap[v], delete r[y], delete r[v], p.formCreateParser && he(y, p.formCreateParser);
|
|
4123
4181
|
}
|
|
4124
|
-
function
|
|
4125
|
-
return
|
|
4182
|
+
function R() {
|
|
4183
|
+
return Mr(Pe, e, i);
|
|
4126
4184
|
}
|
|
4127
|
-
function
|
|
4185
|
+
function N() {
|
|
4128
4186
|
return Te;
|
|
4129
4187
|
}
|
|
4130
|
-
function
|
|
4131
|
-
return h.Function(c.install) ? c.install(
|
|
4188
|
+
function de(c, p) {
|
|
4189
|
+
return h.Function(c.install) ? c.install(H, p) : h.Function(c) && c(H, p), this;
|
|
4132
4190
|
}
|
|
4133
|
-
function
|
|
4134
|
-
let
|
|
4135
|
-
const
|
|
4136
|
-
return
|
|
4191
|
+
function H(c, p, y) {
|
|
4192
|
+
let v = Bi(c, p || {});
|
|
4193
|
+
const w = v.$refs.fc.formCreate;
|
|
4194
|
+
return w.$parent = y, Pi(w.options).appendChild(v.$el), w.api();
|
|
4137
4195
|
}
|
|
4138
|
-
|
|
4196
|
+
Fe(H, D);
|
|
4139
4197
|
function Kt(c) {
|
|
4140
|
-
let
|
|
4141
|
-
return c ?
|
|
4198
|
+
let p = b({}, t);
|
|
4199
|
+
return c ? p.inherit = {
|
|
4142
4200
|
components: e,
|
|
4143
4201
|
parsers: r,
|
|
4144
4202
|
directives: i,
|
|
@@ -4146,146 +4204,146 @@ function Wt(t) {
|
|
|
4146
4204
|
providers: u,
|
|
4147
4205
|
useApps: o,
|
|
4148
4206
|
maker: f,
|
|
4149
|
-
formulas:
|
|
4150
|
-
loadData:
|
|
4151
|
-
} : delete
|
|
4207
|
+
formulas: _,
|
|
4208
|
+
loadData: g
|
|
4209
|
+
} : delete p.inherit, Wt(p);
|
|
4152
4210
|
}
|
|
4153
|
-
function Xt(c,
|
|
4154
|
-
s[c] =
|
|
4211
|
+
function Xt(c, p) {
|
|
4212
|
+
s[c] = p;
|
|
4155
4213
|
}
|
|
4156
|
-
function Qt(c,
|
|
4157
|
-
|
|
4214
|
+
function Qt(c, p) {
|
|
4215
|
+
_[c] = p;
|
|
4158
4216
|
}
|
|
4159
|
-
function Zt(c,
|
|
4160
|
-
const
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
}),
|
|
4217
|
+
function Zt(c, p) {
|
|
4218
|
+
const y = n[c] || {}, v = y.parsers || {};
|
|
4219
|
+
p.parsers && Object.keys(p.parsers).forEach((w) => {
|
|
4220
|
+
v[w] = Fe(p.parsers[w], ke);
|
|
4221
|
+
}), p.name = c, n[c] = U(b(b({}, y), p), { parsers: v });
|
|
4164
4222
|
}
|
|
4165
|
-
function
|
|
4166
|
-
c && Object.keys(M).forEach((
|
|
4167
|
-
(Array.isArray(M[
|
|
4168
|
-
|
|
4223
|
+
function _e(c) {
|
|
4224
|
+
c && Object.keys(M).forEach((p) => {
|
|
4225
|
+
(Array.isArray(M[p]) ? M[p] : [M[p]]).forEach((v) => {
|
|
4226
|
+
v.bus.$emit("$loadData." + c);
|
|
4169
4227
|
});
|
|
4170
4228
|
});
|
|
4171
4229
|
}
|
|
4172
|
-
function
|
|
4173
|
-
|
|
4230
|
+
function Ve(c, p) {
|
|
4231
|
+
se(g, c, p), _e(c);
|
|
4174
4232
|
}
|
|
4175
|
-
function
|
|
4176
|
-
const
|
|
4177
|
-
|
|
4233
|
+
function Ce(c, p) {
|
|
4234
|
+
const y = (...v) => O(() => p(...v));
|
|
4235
|
+
y._driver = !0, Ve(c, y);
|
|
4178
4236
|
}
|
|
4179
|
-
function nt(c,
|
|
4180
|
-
const
|
|
4181
|
-
c =
|
|
4182
|
-
const
|
|
4183
|
-
if (
|
|
4184
|
-
let
|
|
4185
|
-
return
|
|
4237
|
+
function nt(c, p) {
|
|
4238
|
+
const y = (c || "").split(".");
|
|
4239
|
+
c = y.shift();
|
|
4240
|
+
const v = y.join(".");
|
|
4241
|
+
if (E(g, c) || S(g, c, Se), g[c] !== Se) {
|
|
4242
|
+
let w = g[c];
|
|
4243
|
+
return w && w._driver ? w = w(v) : y.length && (w = L(w, y)), w == null || w === "" ? p : w;
|
|
4186
4244
|
} else
|
|
4187
|
-
return
|
|
4245
|
+
return p;
|
|
4188
4246
|
}
|
|
4189
4247
|
function Yt(c) {
|
|
4190
4248
|
l.push(c);
|
|
4191
4249
|
}
|
|
4192
4250
|
function xt(c) {
|
|
4193
|
-
delete
|
|
4251
|
+
delete g[c], _e(c);
|
|
4194
4252
|
}
|
|
4195
|
-
function er(c,
|
|
4196
|
-
a.push({ name: c, callback:
|
|
4253
|
+
function er(c, p) {
|
|
4254
|
+
a.push({ name: c, callback: p });
|
|
4197
4255
|
}
|
|
4198
|
-
function
|
|
4199
|
-
|
|
4200
|
-
id:
|
|
4201
|
-
create:
|
|
4256
|
+
function Pe(c) {
|
|
4257
|
+
C(this, {
|
|
4258
|
+
id: Ti++,
|
|
4259
|
+
create: H,
|
|
4202
4260
|
vm: c,
|
|
4203
|
-
manager:
|
|
4261
|
+
manager: bi(t.manager),
|
|
4204
4262
|
parsers: r,
|
|
4205
4263
|
providers: u,
|
|
4206
4264
|
modelFields: s,
|
|
4207
|
-
formulas:
|
|
4208
|
-
isMobile:
|
|
4265
|
+
formulas: _,
|
|
4266
|
+
isMobile: m,
|
|
4209
4267
|
rules: c.$options.propsData.rule,
|
|
4210
|
-
name: c.$options.propsData.name ||
|
|
4268
|
+
name: c.$options.propsData.name || Ie(),
|
|
4211
4269
|
inFor: c.$options.propsData.inFor,
|
|
4212
4270
|
prop: {
|
|
4213
4271
|
components: e,
|
|
4214
4272
|
directives: i
|
|
4215
4273
|
},
|
|
4274
|
+
get: null,
|
|
4216
4275
|
drivers: n,
|
|
4217
4276
|
renderDriver: null,
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
bus: new Oi(),
|
|
4277
|
+
refreshData: _e,
|
|
4278
|
+
loadData: g,
|
|
4279
|
+
CreateNode: $,
|
|
4280
|
+
bus: new Fi(),
|
|
4223
4281
|
unwatch: [],
|
|
4224
|
-
options:
|
|
4282
|
+
options: mr({}),
|
|
4225
4283
|
extendApiFn: l,
|
|
4226
4284
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4227
|
-
tmpData:
|
|
4228
|
-
}), a.forEach((
|
|
4229
|
-
this.bus.$on(
|
|
4285
|
+
tmpData: ie({})
|
|
4286
|
+
}), a.forEach((p) => {
|
|
4287
|
+
this.bus.$on(p.name, p.callback);
|
|
4230
4288
|
}), P(() => {
|
|
4231
|
-
|
|
4289
|
+
B(this.options, () => {
|
|
4232
4290
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4233
4291
|
}, { deep: !0 });
|
|
4234
|
-
}),
|
|
4292
|
+
}), C(c.$options.components, e), C(c.$options.directives, i), this.$handle = new K(this), this.name && (this.inFor ? (M[this.name] || (M[this.name] = []), M[this.name].push(this)) : M[this.name] = this);
|
|
4235
4293
|
}
|
|
4236
|
-
|
|
4294
|
+
Pe.isMobile = m, C(Pe.prototype, {
|
|
4237
4295
|
init() {
|
|
4238
|
-
this.isSub() && this.unwatch.push(
|
|
4296
|
+
this.isSub() && this.unwatch.push(B(() => this.vm.parent.fc.options.value, () => {
|
|
4239
4297
|
this.initOptions(), this.$handle.api.refresh();
|
|
4240
4298
|
}, { 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();
|
|
4241
4299
|
},
|
|
4242
|
-
targetFormDriver(c, ...
|
|
4300
|
+
targetFormDriver(c, ...p) {
|
|
4243
4301
|
if (this.renderDriver && this.renderDriver[c])
|
|
4244
|
-
return
|
|
4302
|
+
return O(() => this.renderDriver[c](...p));
|
|
4245
4303
|
},
|
|
4246
|
-
t(c,
|
|
4247
|
-
let
|
|
4248
|
-
return
|
|
4249
|
-
const
|
|
4250
|
-
|
|
4251
|
-
}),
|
|
4304
|
+
t(c, p, y) {
|
|
4305
|
+
let v = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
4306
|
+
return v == null && (v = ""), v && p && Object.keys(p).forEach((w) => {
|
|
4307
|
+
const j = new RegExp(`{${w}}`, "g");
|
|
4308
|
+
v = v.replace(j, p[w]);
|
|
4309
|
+
}), v;
|
|
4252
4310
|
},
|
|
4253
4311
|
globalDataDriver(c) {
|
|
4254
|
-
let
|
|
4255
|
-
const
|
|
4256
|
-
if (
|
|
4257
|
-
if (
|
|
4258
|
-
return
|
|
4312
|
+
let p = c.split(".");
|
|
4313
|
+
const y = p.shift(), v = this.options.value.globalData && this.options.value.globalData[y];
|
|
4314
|
+
if (v) {
|
|
4315
|
+
if (v.type === "static")
|
|
4316
|
+
return L(v.data, p);
|
|
4259
4317
|
{
|
|
4260
|
-
let
|
|
4261
|
-
const
|
|
4262
|
-
if (
|
|
4263
|
-
if (
|
|
4264
|
-
return
|
|
4265
|
-
|
|
4318
|
+
let w;
|
|
4319
|
+
const j = this.fetchCache.get(v);
|
|
4320
|
+
if (j) {
|
|
4321
|
+
if (j.status && (w = L(j.data, p)), !j.loading)
|
|
4322
|
+
return w;
|
|
4323
|
+
j.loading = !1, this.fetchCache.set(v, j);
|
|
4266
4324
|
} else
|
|
4267
|
-
this.fetchCache.set(
|
|
4268
|
-
const
|
|
4269
|
-
|
|
4270
|
-
const
|
|
4271
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(
|
|
4272
|
-
},
|
|
4273
|
-
this.fetchCache.set(
|
|
4274
|
-
},
|
|
4275
|
-
if (
|
|
4276
|
-
return
|
|
4277
|
-
if (
|
|
4278
|
-
|
|
4325
|
+
this.fetchCache.set(v, { status: !1 });
|
|
4326
|
+
const k = ne(() => {
|
|
4327
|
+
le();
|
|
4328
|
+
const J = this.fetchCache.get(v);
|
|
4329
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(v) !== -1 ? (J && (J.loading = !0, this.fetchCache.set(v, J)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(v);
|
|
4330
|
+
}, v.wait || 600), ae = (J) => {
|
|
4331
|
+
this.fetchCache.set(v, { status: !0, data: J }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4332
|
+
}, X = (J, ue) => {
|
|
4333
|
+
if (ue && v.watch === !1)
|
|
4334
|
+
return le();
|
|
4335
|
+
if (ue) {
|
|
4336
|
+
k();
|
|
4279
4337
|
return;
|
|
4280
4338
|
}
|
|
4281
|
-
const
|
|
4282
|
-
this.$handle.api.fetch(
|
|
4283
|
-
|
|
4284
|
-
}).catch((
|
|
4285
|
-
|
|
4339
|
+
const pe = this.$handle.loadFetchVar(Je(v), J);
|
|
4340
|
+
this.$handle.api.fetch(pe).then((te) => {
|
|
4341
|
+
ae(te);
|
|
4342
|
+
}).catch((te) => {
|
|
4343
|
+
ae(null);
|
|
4286
4344
|
});
|
|
4287
|
-
},
|
|
4288
|
-
return this.unwatch.push(
|
|
4345
|
+
}, le = this.watchLoadData(X);
|
|
4346
|
+
return this.unwatch.push(le), w;
|
|
4289
4347
|
}
|
|
4290
4348
|
}
|
|
4291
4349
|
},
|
|
@@ -4294,81 +4352,92 @@ function Wt(t) {
|
|
|
4294
4352
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4295
4353
|
},
|
|
4296
4354
|
globalLanguageDriver(c) {
|
|
4297
|
-
let
|
|
4298
|
-
if (
|
|
4299
|
-
const
|
|
4300
|
-
|
|
4355
|
+
let p = this.vm.top.$props.locale, y;
|
|
4356
|
+
if (p && typeof p == "object" && (y = L(p, c)), y == null) {
|
|
4357
|
+
const v = this.options.value.language || {}, w = this.getLocale();
|
|
4358
|
+
y = L(v[w], c);
|
|
4301
4359
|
}
|
|
4302
|
-
return
|
|
4360
|
+
return y;
|
|
4303
4361
|
},
|
|
4304
4362
|
globalVarDriver(c) {
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4363
|
+
const y = c.split(".").shift(), v = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4364
|
+
if (v) {
|
|
4365
|
+
const w = h.Function(v) ? v : z(v.handle);
|
|
4366
|
+
if (w) {
|
|
4367
|
+
let j;
|
|
4368
|
+
const k = this.watchLoadData((ae, X) => {
|
|
4369
|
+
X ? (this.bus.$emit("$loadData.$var." + y), k()) : j = w(ae, this.$handle.api);
|
|
4370
|
+
});
|
|
4371
|
+
return this.unwatch.push(k), j;
|
|
4372
|
+
}
|
|
4311
4373
|
}
|
|
4312
4374
|
},
|
|
4313
|
-
setData(c,
|
|
4314
|
-
|
|
4375
|
+
setData(c, p, y) {
|
|
4376
|
+
y ? Ve(c, p) : (se(this.vm.top.fc.tmpData, c, p), this.bus.$emit("$loadData." + c));
|
|
4315
4377
|
},
|
|
4316
|
-
getLoadData(c,
|
|
4317
|
-
let
|
|
4378
|
+
getLoadData(c, p) {
|
|
4379
|
+
let y = null;
|
|
4318
4380
|
if (c != null) {
|
|
4319
|
-
let
|
|
4320
|
-
const
|
|
4321
|
-
if (
|
|
4322
|
-
|
|
4323
|
-
else if (
|
|
4324
|
-
|
|
4325
|
-
else if (
|
|
4326
|
-
|
|
4327
|
-
else if (
|
|
4328
|
-
|
|
4329
|
-
else if (
|
|
4330
|
-
|
|
4331
|
-
else if (
|
|
4332
|
-
|
|
4333
|
-
else if (
|
|
4334
|
-
|
|
4381
|
+
let v = c.split(".");
|
|
4382
|
+
const w = v.shift();
|
|
4383
|
+
if (w === "$topForm")
|
|
4384
|
+
y = this.$handle.api.top.formData(!0);
|
|
4385
|
+
else if (w === "$scopeForm")
|
|
4386
|
+
y = this.$handle.api.scope.formData(!0);
|
|
4387
|
+
else if (w === "$form")
|
|
4388
|
+
y = this.$handle.api.formData(!0);
|
|
4389
|
+
else if (w === "$options")
|
|
4390
|
+
y = this.options.value;
|
|
4391
|
+
else if (w === "$globalData")
|
|
4392
|
+
y = this.globalDataDriver(v.join(".")), v = [];
|
|
4393
|
+
else if (w === "$var")
|
|
4394
|
+
y = this.globalVarDriver(v.join(".")), v = [];
|
|
4395
|
+
else if (w === "$locale")
|
|
4396
|
+
y = this.getLocale(), v = [];
|
|
4397
|
+
else if (w === "$t")
|
|
4398
|
+
y = this.globalLanguageDriver(v.join(".")), v = [];
|
|
4335
4399
|
else {
|
|
4336
|
-
|
|
4337
|
-
|
|
4400
|
+
if (w === "$preview")
|
|
4401
|
+
return this.$handle.preview;
|
|
4402
|
+
{
|
|
4403
|
+
const j = this.vm.top.fc.tmpData;
|
|
4404
|
+
E(j, w) || S(j, w, Se), y = j[w] !== Se ? L(j, c) : nt(c), v = [];
|
|
4405
|
+
}
|
|
4338
4406
|
}
|
|
4339
|
-
|
|
4407
|
+
y && v.length && (y = L(y, v));
|
|
4340
4408
|
}
|
|
4341
|
-
return
|
|
4342
|
-
},
|
|
4343
|
-
watchLoadData(c,
|
|
4344
|
-
let
|
|
4345
|
-
const
|
|
4346
|
-
this.get || (this.get =
|
|
4347
|
-
c(
|
|
4348
|
-
}), this.get ===
|
|
4349
|
-
},
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4409
|
+
return y == null || y === "" ? p : y;
|
|
4410
|
+
},
|
|
4411
|
+
watchLoadData(c, p) {
|
|
4412
|
+
let y = {};
|
|
4413
|
+
const v = (k) => {
|
|
4414
|
+
this.get || (this.get = w), O(() => {
|
|
4415
|
+
c(w, k);
|
|
4416
|
+
}), this.get === w && (this.get = void 0);
|
|
4417
|
+
}, w = (k, ae) => {
|
|
4418
|
+
let X;
|
|
4419
|
+
if (typeof k == "object" && (X = k.getValue, k = k.id), y[k])
|
|
4420
|
+
return y[k].val;
|
|
4421
|
+
const le = ge(() => X ? X() : this.getLoadData(k, ae)), J = k.split("."), ue = J.shift(), pe = J.shift() || "", te = ne(() => {
|
|
4422
|
+
const Be = X ? X() : this.getLoadData(k, ae);
|
|
4423
|
+
if (y[k])
|
|
4424
|
+
JSON.stringify(Be) !== JSON.stringify(y[k].val) && (y[k].val = Be, v(!0));
|
|
4356
4425
|
else return;
|
|
4357
|
-
},
|
|
4358
|
-
|
|
4426
|
+
}, p || 0), rr = B(le, (Be) => {
|
|
4427
|
+
te();
|
|
4359
4428
|
});
|
|
4360
|
-
return this.bus.$on("$loadData." +
|
|
4429
|
+
return this.bus.$on("$loadData." + ue, te), pe && this.bus.$on("$loadData." + ue + "." + pe, te), y[k] = {
|
|
4361
4430
|
fn: () => {
|
|
4362
|
-
this.bus.$off("$loadData." +
|
|
4431
|
+
this.bus.$off("$loadData." + ue, te), pe && this.bus.$off("$loadData." + ue + "." + pe, te), rr();
|
|
4363
4432
|
},
|
|
4364
|
-
val:
|
|
4365
|
-
},
|
|
4433
|
+
val: le.value
|
|
4434
|
+
}, le.value;
|
|
4366
4435
|
};
|
|
4367
|
-
|
|
4368
|
-
const
|
|
4369
|
-
Object.keys(
|
|
4436
|
+
v(!1);
|
|
4437
|
+
const j = () => {
|
|
4438
|
+
Object.keys(y).forEach((k) => y[k].fn()), y = {};
|
|
4370
4439
|
};
|
|
4371
|
-
return this.unwatch.push(
|
|
4440
|
+
return this.unwatch.push(j), j;
|
|
4372
4441
|
},
|
|
4373
4442
|
isSub() {
|
|
4374
4443
|
return this.vm.parent && this.vm.extendOption;
|
|
@@ -4381,13 +4450,13 @@ function Wt(t) {
|
|
|
4381
4450
|
resetBtn: {},
|
|
4382
4451
|
globalEvent: {},
|
|
4383
4452
|
globalData: {}
|
|
4384
|
-
},
|
|
4453
|
+
}, W(d));
|
|
4385
4454
|
this.isSub() && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$options.propsData.option || {}), this.updateOptions(c);
|
|
4386
4455
|
},
|
|
4387
|
-
mergeOptions(c,
|
|
4388
|
-
return
|
|
4389
|
-
delete
|
|
4390
|
-
}),
|
|
4456
|
+
mergeOptions(c, p, y) {
|
|
4457
|
+
return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((v) => {
|
|
4458
|
+
delete p[v];
|
|
4459
|
+
}), p.global && (c.global = Jr(c.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], c), c;
|
|
4391
4460
|
},
|
|
4392
4461
|
updateOptions(c) {
|
|
4393
4462
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4417,73 +4486,73 @@ function Wt(t) {
|
|
|
4417
4486
|
}
|
|
4418
4487
|
});
|
|
4419
4488
|
function st(c) {
|
|
4420
|
-
|
|
4489
|
+
C(c, {
|
|
4421
4490
|
version: t.version,
|
|
4422
4491
|
ui: t.ui,
|
|
4423
|
-
isMobile:
|
|
4492
|
+
isMobile: m,
|
|
4424
4493
|
extendApi: Yt,
|
|
4425
4494
|
getData: nt,
|
|
4426
|
-
setDataDriver:
|
|
4427
|
-
setData:
|
|
4495
|
+
setDataDriver: Ce,
|
|
4496
|
+
setData: Ve,
|
|
4428
4497
|
removeData: xt,
|
|
4429
|
-
refreshData:
|
|
4498
|
+
refreshData: _e,
|
|
4430
4499
|
maker: f,
|
|
4431
|
-
component:
|
|
4500
|
+
component: F,
|
|
4432
4501
|
directive: T,
|
|
4433
4502
|
setModelField: Xt,
|
|
4434
4503
|
setFormula: Qt,
|
|
4435
4504
|
setDriver: Zt,
|
|
4436
|
-
register:
|
|
4437
|
-
$vnode:
|
|
4438
|
-
parser:
|
|
4439
|
-
use:
|
|
4505
|
+
register: ce,
|
|
4506
|
+
$vnode: N,
|
|
4507
|
+
parser: he,
|
|
4508
|
+
use: de,
|
|
4440
4509
|
factory: Kt,
|
|
4441
|
-
componentAlias:
|
|
4510
|
+
componentAlias: Ae,
|
|
4442
4511
|
copyRule: Pt,
|
|
4443
4512
|
copyRules: Bt,
|
|
4444
|
-
mergeRule:
|
|
4513
|
+
mergeRule: x,
|
|
4445
4514
|
fetch: Ut,
|
|
4446
|
-
$form:
|
|
4447
|
-
parseFn:
|
|
4515
|
+
$form: R,
|
|
4516
|
+
parseFn: z,
|
|
4448
4517
|
parseJson: Vt,
|
|
4449
4518
|
toJson: et,
|
|
4450
4519
|
useApp: V,
|
|
4451
|
-
getApi:
|
|
4520
|
+
getApi: ee,
|
|
4452
4521
|
on: er
|
|
4453
4522
|
});
|
|
4454
4523
|
}
|
|
4455
4524
|
function tr(c) {
|
|
4456
|
-
|
|
4457
|
-
create:
|
|
4458
|
-
install(
|
|
4459
|
-
if (
|
|
4460
|
-
|
|
4461
|
-
const
|
|
4462
|
-
return
|
|
4525
|
+
C(c, {
|
|
4526
|
+
create: H,
|
|
4527
|
+
install(p, y) {
|
|
4528
|
+
if (d = b(b({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4529
|
+
p._installedFormCreate = !0;
|
|
4530
|
+
const v = function(j, k = {}) {
|
|
4531
|
+
return H(j, k, this);
|
|
4463
4532
|
};
|
|
4464
|
-
st(
|
|
4465
|
-
const
|
|
4466
|
-
|
|
4467
|
-
|
|
4533
|
+
st(v), p.prototype.$formCreate = v;
|
|
4534
|
+
const w = R();
|
|
4535
|
+
p.component(w.name, w), p.component("FcFragment", N()), o.forEach((j) => {
|
|
4536
|
+
O(() => j(c, p));
|
|
4468
4537
|
});
|
|
4469
4538
|
}
|
|
4470
4539
|
});
|
|
4471
4540
|
}
|
|
4472
|
-
if (st(
|
|
4541
|
+
if (st(D), tr(D), Ce("$cookie", ji), Ce("$localStorage", Ii), Ce("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install && H.use(t), he(Ri), t.inherit) {
|
|
4473
4542
|
const c = t.inherit;
|
|
4474
|
-
c.components &&
|
|
4543
|
+
c.components && C(e, c.components), c.parsers && C(r, c.parsers), c.directives && C(i, c.directives), c.modelFields && C(s, c.modelFields), c.providers && C(u, c.providers), c.useApps && C(o, c.useApps), c.maker && C(f, c.maker), c.loadData && C(g, c.loadData), c.formulas && C(_, c.formulas);
|
|
4475
4544
|
}
|
|
4476
|
-
const
|
|
4477
|
-
return
|
|
4545
|
+
const we = R();
|
|
4546
|
+
return Fe(we, D), Object.defineProperties(we, {
|
|
4478
4547
|
fetch: {
|
|
4479
4548
|
get() {
|
|
4480
|
-
return
|
|
4549
|
+
return D.fetch;
|
|
4481
4550
|
},
|
|
4482
4551
|
set(c) {
|
|
4483
|
-
|
|
4552
|
+
D.fetch = c;
|
|
4484
4553
|
}
|
|
4485
4554
|
}
|
|
4486
|
-
}),
|
|
4555
|
+
}), we.util = D, we;
|
|
4487
4556
|
}
|
|
4488
4557
|
function Me(t) {
|
|
4489
4558
|
if (h.Date(t))
|
|
@@ -4493,7 +4562,7 @@ function Me(t) {
|
|
|
4493
4562
|
return e.toString() === "Invalid Date" ? t : e;
|
|
4494
4563
|
}
|
|
4495
4564
|
}
|
|
4496
|
-
const bt = "datePicker",
|
|
4565
|
+
const bt = "datePicker", Ni = {
|
|
4497
4566
|
name: bt,
|
|
4498
4567
|
maker: function() {
|
|
4499
4568
|
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = A(bt, { type: e.toLowerCase() }), t), {});
|
|
@@ -4525,7 +4594,7 @@ const bt = "datePicker", Ti = {
|
|
|
4525
4594
|
mounted(t) {
|
|
4526
4595
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
4527
4596
|
}
|
|
4528
|
-
}, Ue = "hidden",
|
|
4597
|
+
}, Ue = "hidden", Mi = {
|
|
4529
4598
|
name: Ue,
|
|
4530
4599
|
maker: {
|
|
4531
4600
|
[Ue]: (t, e) => A(Ue)("", t, e)
|
|
@@ -4533,7 +4602,7 @@ const bt = "datePicker", Ti = {
|
|
|
4533
4602
|
render() {
|
|
4534
4603
|
return [];
|
|
4535
4604
|
}
|
|
4536
|
-
}, qe = "input",
|
|
4605
|
+
}, qe = "input", Ui = {
|
|
4537
4606
|
name: qe,
|
|
4538
4607
|
maker: function() {
|
|
4539
4608
|
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = A(qe, { type: r }), e), {});
|
|
@@ -4543,7 +4612,7 @@ const bt = "datePicker", Ti = {
|
|
|
4543
4612
|
let { props: e } = t.prop;
|
|
4544
4613
|
e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
|
|
4545
4614
|
}
|
|
4546
|
-
}, _t = "slider",
|
|
4615
|
+
}, _t = "slider", qi = {
|
|
4547
4616
|
name: _t,
|
|
4548
4617
|
maker: {
|
|
4549
4618
|
sliderRange: A(_t, { range: !0 })
|
|
@@ -4552,27 +4621,27 @@ const bt = "datePicker", Ti = {
|
|
|
4552
4621
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
4553
4622
|
return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
|
|
4554
4623
|
}
|
|
4555
|
-
},
|
|
4624
|
+
}, Gi = {
|
|
4556
4625
|
name: "switch",
|
|
4557
4626
|
mergeProp(t) {
|
|
4558
4627
|
const e = t.prop.props.slot || {}, r = t.prop.scopedSlots || {};
|
|
4559
4628
|
e.open && (r.open = () => e.open), e.close && (r.close = () => e.close), t.prop.scopedSlots = r;
|
|
4560
4629
|
}
|
|
4561
|
-
},
|
|
4630
|
+
}, Hi = {
|
|
4562
4631
|
name: "FcRow",
|
|
4563
4632
|
render(t, e) {
|
|
4564
4633
|
return e.vNode.col({ props: { span: 24 } }, [
|
|
4565
4634
|
e.vNode.row(e.prop, t)
|
|
4566
4635
|
]);
|
|
4567
4636
|
}
|
|
4568
|
-
},
|
|
4569
|
-
Ti,
|
|
4637
|
+
}, Ji = [
|
|
4570
4638
|
Ni,
|
|
4571
4639
|
Mi,
|
|
4572
4640
|
Ui,
|
|
4573
4641
|
qi,
|
|
4574
|
-
Gi
|
|
4575
|
-
|
|
4642
|
+
Gi,
|
|
4643
|
+
Hi
|
|
4644
|
+
], Wi = {
|
|
4576
4645
|
button: "iButton",
|
|
4577
4646
|
icon: "Icon",
|
|
4578
4647
|
slider: "Slider",
|
|
@@ -4599,21 +4668,21 @@ const bt = "datePicker", Ti = {
|
|
|
4599
4668
|
array: "fcGroup",
|
|
4600
4669
|
subForm: "fcSubForm",
|
|
4601
4670
|
object: "fcSubForm"
|
|
4602
|
-
},
|
|
4671
|
+
}, De = {
|
|
4603
4672
|
resetBtnType: "default",
|
|
4604
4673
|
resetBtnIcon: "md-refresh",
|
|
4605
4674
|
infoIcon: "ios-information-circle-outline"
|
|
4606
4675
|
};
|
|
4607
|
-
function
|
|
4676
|
+
function zi() {
|
|
4608
4677
|
return {
|
|
4609
4678
|
type: "poptip",
|
|
4610
4679
|
trigger: "hover",
|
|
4611
4680
|
placement: "top-start",
|
|
4612
4681
|
wordWrap: !0,
|
|
4613
|
-
icon:
|
|
4682
|
+
icon: De.infoIcon
|
|
4614
4683
|
};
|
|
4615
4684
|
}
|
|
4616
|
-
function
|
|
4685
|
+
function Ki() {
|
|
4617
4686
|
return {
|
|
4618
4687
|
form: {
|
|
4619
4688
|
inline: !1,
|
|
@@ -4635,9 +4704,9 @@ function zi() {
|
|
|
4635
4704
|
click: void 0
|
|
4636
4705
|
},
|
|
4637
4706
|
resetBtn: {
|
|
4638
|
-
type:
|
|
4707
|
+
type: De.resetBtnType,
|
|
4639
4708
|
disabled: !1,
|
|
4640
|
-
icon:
|
|
4709
|
+
icon: De.resetBtnIcon,
|
|
4641
4710
|
innerText: "",
|
|
4642
4711
|
loading: !1,
|
|
4643
4712
|
show: !1,
|
|
@@ -4646,19 +4715,19 @@ function zi() {
|
|
|
4646
4715
|
};
|
|
4647
4716
|
}
|
|
4648
4717
|
function Ct(t, e) {
|
|
4649
|
-
|
|
4718
|
+
E(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4650
4719
|
}
|
|
4651
|
-
function
|
|
4720
|
+
function Q(t) {
|
|
4652
4721
|
return t === !1;
|
|
4653
4722
|
}
|
|
4654
|
-
function
|
|
4655
|
-
|
|
4723
|
+
function Xi(t, e) {
|
|
4724
|
+
E(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4656
4725
|
}
|
|
4657
4726
|
function Ge(t) {
|
|
4658
4727
|
const e = b({}, t);
|
|
4659
4728
|
return delete e.children, e;
|
|
4660
4729
|
}
|
|
4661
|
-
const
|
|
4730
|
+
const Qi = {
|
|
4662
4731
|
validate() {
|
|
4663
4732
|
const t = this.form();
|
|
4664
4733
|
return t ? t.validate() : new Promise((e) => e());
|
|
@@ -4677,7 +4746,7 @@ const Xi = {
|
|
|
4677
4746
|
},
|
|
4678
4747
|
tidyOptions(t) {
|
|
4679
4748
|
return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
|
|
4680
|
-
|
|
4749
|
+
Xi(t, e);
|
|
4681
4750
|
}), t;
|
|
4682
4751
|
},
|
|
4683
4752
|
tidyRule({ prop: t }) {
|
|
@@ -4685,20 +4754,20 @@ const Xi = {
|
|
|
4685
4754
|
},
|
|
4686
4755
|
mergeProp(t) {
|
|
4687
4756
|
const e = {
|
|
4688
|
-
info:
|
|
4757
|
+
info: zi(),
|
|
4689
4758
|
title: {},
|
|
4690
4759
|
col: { span: 24 },
|
|
4691
4760
|
wrap: {}
|
|
4692
4761
|
};
|
|
4693
4762
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4694
|
-
t.prop[r] =
|
|
4763
|
+
t.prop[r] = Y([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4695
4764
|
}), this.setSize(t.prop.props);
|
|
4696
4765
|
},
|
|
4697
4766
|
setSize(t) {
|
|
4698
4767
|
!t.size && this.options.form.size && (t.size = this.options.form.size);
|
|
4699
4768
|
},
|
|
4700
4769
|
getDefaultOptions() {
|
|
4701
|
-
return
|
|
4770
|
+
return Ki();
|
|
4702
4771
|
},
|
|
4703
4772
|
update() {
|
|
4704
4773
|
const t = this.options.form;
|
|
@@ -4716,18 +4785,18 @@ const Xi = {
|
|
|
4716
4785
|
},
|
|
4717
4786
|
beforeRender() {
|
|
4718
4787
|
const { key: t, ref: e, $handle: r } = this;
|
|
4719
|
-
|
|
4788
|
+
C(this.rule, { key: t, ref: e }), C(this.rule.props, {
|
|
4720
4789
|
model: r.formData
|
|
4721
4790
|
});
|
|
4722
4791
|
},
|
|
4723
4792
|
render(t) {
|
|
4724
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4793
|
+
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Q(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
|
|
4725
4794
|
},
|
|
4726
4795
|
makeWrap(t, e) {
|
|
4727
4796
|
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;
|
|
4728
4797
|
delete r.wrap.title;
|
|
4729
|
-
const u =
|
|
4730
|
-
props:
|
|
4798
|
+
const u = Q(r.wrap.show) ? e : this.$r(Y([r.wrap, {
|
|
4799
|
+
props: U(b({
|
|
4731
4800
|
labelWidth: o
|
|
4732
4801
|
}, Ge(r.wrap || {})), {
|
|
4733
4802
|
prop: t.id,
|
|
@@ -4738,39 +4807,39 @@ const Xi = {
|
|
|
4738
4807
|
ref: t.wrapRef,
|
|
4739
4808
|
type: "formItem"
|
|
4740
4809
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4741
|
-
return a === !0 ||
|
|
4810
|
+
return a === !0 || Q(l) || Q(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4742
4811
|
},
|
|
4743
4812
|
isTitle(t) {
|
|
4744
4813
|
if (this.options.form.title === !1) return !1;
|
|
4745
4814
|
const e = t.title;
|
|
4746
|
-
return !(!e.title && !e.native ||
|
|
4815
|
+
return !(!e.title && !e.native || Q(e.show));
|
|
4747
4816
|
},
|
|
4748
4817
|
makeInfo(t, e, r) {
|
|
4749
|
-
var u, f, m
|
|
4818
|
+
var u, f, d, m, g, $;
|
|
4750
4819
|
const i = b({}, t.title), s = b({}, t.info), n = this.options.form, o = this.getSlot("title"), a = [o ? o({
|
|
4751
|
-
title: (u = r.refRule) == null ? void 0 : u.__$title.value,
|
|
4820
|
+
title: (f = (u = r.refRule) == null ? void 0 : u.__$title) == null ? void 0 : f.value,
|
|
4752
4821
|
rule: r.rule,
|
|
4753
4822
|
options: this.options
|
|
4754
|
-
}) : ((
|
|
4755
|
-
if (!
|
|
4756
|
-
const
|
|
4823
|
+
}) : ((m = (d = r.refRule) == null ? void 0 : d.__$title) == null ? void 0 : m.value) + (n.labelSuffix || n["label-suffix"] || "")];
|
|
4824
|
+
if (!Q(s.show) && (s.info || s.native) && !Q(s.icon)) {
|
|
4825
|
+
const _ = {
|
|
4757
4826
|
type: s.type || "poptip",
|
|
4758
4827
|
props: Ge(s),
|
|
4759
4828
|
key: `${e}pop`,
|
|
4760
4829
|
slot: "label"
|
|
4761
4830
|
};
|
|
4762
|
-
delete
|
|
4763
|
-
const
|
|
4764
|
-
s.info && !
|
|
4831
|
+
delete _.props.icon, delete _.props.show, delete _.props.info, delete _.props.align, delete _.props.native;
|
|
4832
|
+
const D = "content";
|
|
4833
|
+
s.info && !E(_.props, D) && (_.props[D] = ($ = (g = r.refRule) == null ? void 0 : g.__$info) == null ? void 0 : $.value), a[s.align !== "left" ? "unshift" : "push"](this.$r(Y([s, _]), [
|
|
4765
4834
|
this.$r({
|
|
4766
4835
|
type: "icon",
|
|
4767
|
-
props: { type: s.icon === !0 ?
|
|
4836
|
+
props: { type: s.icon === !0 ? De.infoIcon : s.icon, size: 16 },
|
|
4768
4837
|
style: "margin-top: -1px",
|
|
4769
4838
|
key: `${e}i`
|
|
4770
4839
|
})
|
|
4771
4840
|
]));
|
|
4772
4841
|
}
|
|
4773
|
-
const l =
|
|
4842
|
+
const l = Y([i, {
|
|
4774
4843
|
props: Ge(i),
|
|
4775
4844
|
key: `${e}tit`,
|
|
4776
4845
|
class: "fc-form-title",
|
|
@@ -4799,7 +4868,7 @@ const Xi = {
|
|
|
4799
4868
|
},
|
|
4800
4869
|
makeFormBtn() {
|
|
4801
4870
|
let t = [];
|
|
4802
|
-
if (
|
|
4871
|
+
if (Q(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Q(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4803
4872
|
return;
|
|
4804
4873
|
const e = this.$r({
|
|
4805
4874
|
type: "formItem",
|
|
@@ -4846,13 +4915,13 @@ const Xi = {
|
|
|
4846
4915
|
key: `${this.key}b1`
|
|
4847
4916
|
}, [e]);
|
|
4848
4917
|
}
|
|
4849
|
-
},
|
|
4850
|
-
function
|
|
4851
|
-
|
|
4918
|
+
}, oe = {}, Zi = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4919
|
+
function Yi(t) {
|
|
4920
|
+
Zi.forEach((e) => {
|
|
4852
4921
|
t[e] = A(e);
|
|
4853
4922
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4854
4923
|
}
|
|
4855
|
-
function
|
|
4924
|
+
function xi(t) {
|
|
4856
4925
|
const e = "upload", r = {
|
|
4857
4926
|
image: ["image", 0],
|
|
4858
4927
|
file: ["file", 0],
|
|
@@ -4861,19 +4930,19 @@ function Yi(t) {
|
|
|
4861
4930
|
};
|
|
4862
4931
|
Object.keys(r).reduce((i, s) => (i[s] = A(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4863
4932
|
}
|
|
4864
|
-
function
|
|
4933
|
+
function en(t) {
|
|
4865
4934
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4866
4935
|
Object.keys(r).reduce((i, s) => (i[s] = A(e, { type: r[s] }), i), t);
|
|
4867
4936
|
}
|
|
4868
|
-
function
|
|
4937
|
+
function tn(t) {
|
|
4869
4938
|
const e = "timePicker";
|
|
4870
4939
|
t.time = A(e, { type: "time" }), t.timeRange = A(e, { type: "timerange" });
|
|
4871
4940
|
}
|
|
4872
|
-
function
|
|
4941
|
+
function rn(t) {
|
|
4873
4942
|
const e = "select";
|
|
4874
4943
|
t.selectMultiple = A(e, { multiple: !0 }), t.selectOne = A(e, { multiple: !1 });
|
|
4875
4944
|
}
|
|
4876
|
-
function
|
|
4945
|
+
function nn(t) {
|
|
4877
4946
|
const e = "frame", r = {
|
|
4878
4947
|
frameInputs: ["input", 0],
|
|
4879
4948
|
frameFiles: ["file", 0],
|
|
@@ -4884,16 +4953,16 @@ function rn(t) {
|
|
|
4884
4953
|
};
|
|
4885
4954
|
Object.keys(r).reduce((i, s) => (i[s] = A(e, (n) => n.props({ type: r[s][0], maxLength: r[s][1] })), i), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages;
|
|
4886
4955
|
}
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4956
|
+
Yi(oe);
|
|
4957
|
+
xi(oe);
|
|
4958
|
+
en(oe);
|
|
4959
|
+
rn(oe);
|
|
4960
|
+
nn(oe);
|
|
4961
|
+
tn(oe);
|
|
4893
4962
|
function wt(t, e) {
|
|
4894
4963
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4895
4964
|
}
|
|
4896
|
-
function
|
|
4965
|
+
function sn(t, e) {
|
|
4897
4966
|
return {
|
|
4898
4967
|
formEl() {
|
|
4899
4968
|
return e.$manager.form();
|
|
@@ -4920,7 +4989,7 @@ function nn(t, e) {
|
|
|
4920
4989
|
const o = e.getFieldCtx(r);
|
|
4921
4990
|
if (!o) return;
|
|
4922
4991
|
const a = e.subForm[o.id], l = [e.$manager.validateField(o.id)];
|
|
4923
|
-
|
|
4992
|
+
G(a).forEach((u) => {
|
|
4924
4993
|
l.push(u.validate());
|
|
4925
4994
|
}), Promise.all(l).then(() => {
|
|
4926
4995
|
s(null), i && i(null);
|
|
@@ -4970,19 +5039,19 @@ function nn(t, e) {
|
|
|
4970
5039
|
},
|
|
4971
5040
|
submitBtnProps: (r = {}) => {
|
|
4972
5041
|
let i = wt(e.options.submitBtn, !0);
|
|
4973
|
-
|
|
5042
|
+
C(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
4974
5043
|
},
|
|
4975
5044
|
resetBtnProps: (r = {}) => {
|
|
4976
5045
|
let i = wt(e.options.resetBtn, !1);
|
|
4977
|
-
|
|
5046
|
+
C(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
4978
5047
|
},
|
|
4979
5048
|
submit(r, i) {
|
|
4980
5049
|
return new Promise((s, n) => {
|
|
4981
5050
|
t.validate().then(() => {
|
|
4982
5051
|
let o = t.formData();
|
|
4983
|
-
h.Function(r) &&
|
|
5052
|
+
h.Function(r) && O(() => r(o, t)), h.Function(e.options.onSubmit) && O(() => e.options.onSubmit(o, t)), e.vm.emit("submit", o, t), s(o);
|
|
4984
5053
|
}).catch((...o) => {
|
|
4985
|
-
h.Function(i) &&
|
|
5054
|
+
h.Function(i) && O(() => i(t, ...o)), n(...o);
|
|
4986
5055
|
});
|
|
4987
5056
|
});
|
|
4988
5057
|
}
|
|
@@ -4991,23 +5060,24 @@ function nn(t, e) {
|
|
|
4991
5060
|
const zt = {
|
|
4992
5061
|
name: "required",
|
|
4993
5062
|
load(t, e, r) {
|
|
4994
|
-
|
|
5063
|
+
var s, n;
|
|
5064
|
+
const i = on(t.getValue());
|
|
4995
5065
|
if (i.required === !1)
|
|
4996
5066
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4997
5067
|
else {
|
|
4998
|
-
const
|
|
5068
|
+
const o = b({
|
|
4999
5069
|
required: !0,
|
|
5000
|
-
validator(
|
|
5001
|
-
h.empty(
|
|
5070
|
+
validator(l, u, f) {
|
|
5071
|
+
h.empty(u) ? f(o.message) : f();
|
|
5002
5072
|
}
|
|
5003
|
-
}, i), n = e.__fc__.refRule.__$title.value;
|
|
5004
|
-
if (!
|
|
5005
|
-
|
|
5073
|
+
}, i), a = (n = (s = e.__fc__.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value;
|
|
5074
|
+
if (!o.message)
|
|
5075
|
+
o.message = r.t("required", { title: a }) || a + (r.getLocale() === "en" ? " is required" : "不能为空");
|
|
5006
5076
|
else {
|
|
5007
|
-
const
|
|
5008
|
-
|
|
5077
|
+
const l = o.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5078
|
+
l && (o.message = r.t(l[1], { title: a }));
|
|
5009
5079
|
}
|
|
5010
|
-
t.getProp().validate = [
|
|
5080
|
+
t.getProp().validate = [o];
|
|
5011
5081
|
}
|
|
5012
5082
|
r.sync(e);
|
|
5013
5083
|
},
|
|
@@ -5015,25 +5085,25 @@ const zt = {
|
|
|
5015
5085
|
zt.load(...t);
|
|
5016
5086
|
}
|
|
5017
5087
|
};
|
|
5018
|
-
function
|
|
5088
|
+
function on(t) {
|
|
5019
5089
|
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 : {};
|
|
5020
5090
|
}
|
|
5021
|
-
function
|
|
5022
|
-
t.componentAlias(
|
|
5091
|
+
function an(t) {
|
|
5092
|
+
t.componentAlias(Wi), Nr.forEach((e) => {
|
|
5023
5093
|
t.component(e.name, e);
|
|
5024
|
-
}), t.register(zt),
|
|
5094
|
+
}), t.register(zt), Ji.forEach((e) => {
|
|
5025
5095
|
t.parser(e);
|
|
5026
|
-
}), Object.keys(
|
|
5027
|
-
t.maker[e] =
|
|
5096
|
+
}), Object.keys(oe).forEach((e) => {
|
|
5097
|
+
t.maker[e] = oe[e];
|
|
5028
5098
|
});
|
|
5029
5099
|
}
|
|
5030
|
-
function
|
|
5100
|
+
function ln() {
|
|
5031
5101
|
return Wt({
|
|
5032
5102
|
ui: "view-design",
|
|
5033
|
-
version: "2.7.
|
|
5034
|
-
manager:
|
|
5035
|
-
install:
|
|
5036
|
-
extendApi:
|
|
5103
|
+
version: "2.7.4",
|
|
5104
|
+
manager: Qi,
|
|
5105
|
+
install: an,
|
|
5106
|
+
extendApi: sn,
|
|
5037
5107
|
attrs: {
|
|
5038
5108
|
normal: ["col", "wrap"],
|
|
5039
5109
|
array: ["className"],
|
|
@@ -5041,10 +5111,10 @@ function an() {
|
|
|
5041
5111
|
}
|
|
5042
5112
|
});
|
|
5043
5113
|
}
|
|
5044
|
-
const Qe =
|
|
5114
|
+
const Qe = ln();
|
|
5045
5115
|
typeof window != "undefined" && (window.formCreate = Qe, window.Vue && Qe.install(window.Vue));
|
|
5046
|
-
const
|
|
5116
|
+
const cn = Qe.maker;
|
|
5047
5117
|
export {
|
|
5048
5118
|
Qe as default,
|
|
5049
|
-
|
|
5119
|
+
cn as maker
|
|
5050
5120
|
};
|