@form-create/iview 2.7.3 → 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 +537 -515
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
- package/src/core/manager.js +3 -3
- package/src/core/provider.js +1 -1
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/iview v2.7.
|
|
3
|
+
* @form-create/iview 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/
|
|
@@ -19,7 +19,7 @@ var at = (t, e, r) => e in t ? ir(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
19
19
|
ar.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
21
|
}, U = (t, e) => nr(t, sr(e));
|
|
22
|
-
import
|
|
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
23
|
function gr(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
@@ -50,7 +50,7 @@ var yr = ["attrs", "props", "domProps"], $r = ["class", "style", "directives"],
|
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
52
|
}, Cr = br;
|
|
53
|
-
const
|
|
53
|
+
const I = /* @__PURE__ */ gr(Cr);
|
|
54
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
|
}
|
|
@@ -100,7 +100,7 @@ const wr = "fcCheckbox", Or = {
|
|
|
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,7 +112,7 @@ const wr = "fcCheckbox", Or = {
|
|
|
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
|
|
@@ -126,10 +126,10 @@ const wr = "fcCheckbox", Or = {
|
|
|
126
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,
|
|
@@ -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
|
|
@@ -503,16 +503,16 @@ function Ot(t) {
|
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
const
|
|
506
|
+
const Ft = Ot({
|
|
507
507
|
fileIcon: "md-document",
|
|
508
508
|
fileUpIcon: "ios-folder-open"
|
|
509
509
|
});
|
|
510
|
-
|
|
510
|
+
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", Rr = {
|
|
|
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,7 +564,7 @@ const Fr = "fcRadio", Rr = {
|
|
|
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
|
|
@@ -604,7 +604,7 @@ const Fr = "fcRadio", Rr = {
|
|
|
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
610
|
const kr = "fcSelect", Er = {
|
|
@@ -619,7 +619,7 @@ const kr = "fcSelect", Er = {
|
|
|
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,9 +632,9 @@ const kr = "fcSelect", Er = {
|
|
|
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);
|
|
@@ -684,7 +684,7 @@ const kr = "fcSelect", Er = {
|
|
|
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
|
|
@@ -711,7 +711,7 @@ function Ir(t) {
|
|
|
711
711
|
return ("" + t).split("/").pop();
|
|
712
712
|
}
|
|
713
713
|
const Ar = "fcUpload";
|
|
714
|
-
function
|
|
714
|
+
function St(t) {
|
|
715
715
|
return {
|
|
716
716
|
name: Ar,
|
|
717
717
|
props: {
|
|
@@ -784,7 +784,7 @@ function Ft(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 Ft(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 Ft(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,7 +859,7 @@ function Ft(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
|
|
@@ -878,7 +878,7 @@ function Ft(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 Ft(t) {
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
|
-
const Rt =
|
|
910
|
+
const Rt = St({
|
|
911
911
|
fileIcon: "md-document",
|
|
912
912
|
imgUpIcon: "md-images"
|
|
913
913
|
});
|
|
914
|
-
Rt.v2 =
|
|
914
|
+
Rt.v2 = St({
|
|
915
915
|
fileIcon: "document-text",
|
|
916
916
|
imgUpIcon: "image"
|
|
917
917
|
});
|
|
918
|
-
function
|
|
919
|
-
|
|
918
|
+
function S(t, e, r) {
|
|
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)) {
|
|
@@ -929,32 +929,32 @@ function $e(t, e = {}, r) {
|
|
|
929
929
|
if ((i = Array.isArray(n)) || h.Object(n)) {
|
|
930
930
|
let o = t[s] === void 0;
|
|
931
931
|
if (i)
|
|
932
|
-
i = !1, o &&
|
|
932
|
+
i = !1, o && S(t, s, []);
|
|
933
933
|
else if (n._clone && r !== void 0)
|
|
934
934
|
if (r)
|
|
935
|
-
n = n.getRule(), o &&
|
|
935
|
+
n = n.getRule(), o && S(t, s, {});
|
|
936
936
|
else {
|
|
937
|
-
|
|
937
|
+
S(t, s, n._clone());
|
|
938
938
|
continue;
|
|
939
939
|
}
|
|
940
940
|
else
|
|
941
|
-
o &&
|
|
942
|
-
t[s] =
|
|
941
|
+
o && S(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
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
|
-
Object.prototype.hasOwnProperty.call(e, i) &&
|
|
954
|
+
Object.prototype.hasOwnProperty.call(e, i) && S(t, i, e[i]);
|
|
955
955
|
return t;
|
|
956
956
|
};
|
|
957
|
-
function
|
|
957
|
+
function C() {
|
|
958
958
|
return Vr.apply(this, arguments);
|
|
959
959
|
}
|
|
960
960
|
function Je(t) {
|
|
@@ -1042,13 +1042,13 @@ const Pr = "fcGroup", Br = {
|
|
|
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
|
});
|
|
@@ -1082,7 +1082,7 @@ const Pr = "fcGroup", Br = {
|
|
|
1082
1082
|
},
|
|
1083
1083
|
methods: {
|
|
1084
1084
|
_value(t) {
|
|
1085
|
-
return t &&
|
|
1085
|
+
return t && E(t, this.field) ? t[this.field] : t;
|
|
1086
1086
|
},
|
|
1087
1087
|
cache(t, e) {
|
|
1088
1088
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1113,8 +1113,8 @@ const Pr = "fcGroup", Br = {
|
|
|
1113
1113
|
};
|
|
1114
1114
|
if (this.defaultValue) {
|
|
1115
1115
|
i.formData || (i.formData = {});
|
|
1116
|
-
const s =
|
|
1117
|
-
|
|
1116
|
+
const s = W(this.defaultValue);
|
|
1117
|
+
C(i.formData, this.field ? {
|
|
1118
1118
|
[this.field]: s
|
|
1119
1119
|
} : s);
|
|
1120
1120
|
}
|
|
@@ -1232,7 +1232,7 @@ const Pr = "fcGroup", Br = {
|
|
|
1232
1232
|
return t("div", {
|
|
1233
1233
|
class: "_fc-group-container",
|
|
1234
1234
|
key: o
|
|
1235
|
-
}, [t(i,
|
|
1235
|
+
}, [t(i, I([{
|
|
1236
1236
|
key: o
|
|
1237
1237
|
}, {
|
|
1238
1238
|
on: {
|
|
@@ -1331,7 +1331,7 @@ const Pr = "fcGroup", Br = {
|
|
|
1331
1331
|
rule: e,
|
|
1332
1332
|
options: r
|
|
1333
1333
|
} = this.cacheRule, i = this.type;
|
|
1334
|
-
return t(i,
|
|
1334
|
+
return t(i, I([{}, {
|
|
1335
1335
|
on: {
|
|
1336
1336
|
"update:value": this.formData,
|
|
1337
1337
|
"emit-event": this.emitEvent,
|
|
@@ -1352,17 +1352,17 @@ const Pr = "fcGroup", Br = {
|
|
|
1352
1352
|
Er,
|
|
1353
1353
|
jr,
|
|
1354
1354
|
Tr,
|
|
1355
|
-
|
|
1355
|
+
Ft,
|
|
1356
1356
|
Rt,
|
|
1357
1357
|
Br
|
|
1358
1358
|
];
|
|
1359
|
-
function
|
|
1359
|
+
function ne(t, e) {
|
|
1360
1360
|
var r = null;
|
|
1361
1361
|
return function(...i) {
|
|
1362
1362
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1363
1363
|
};
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1365
|
+
function ve(t) {
|
|
1366
1366
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1367
1367
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1368
1368
|
}
|
|
@@ -1434,78 +1434,80 @@ function Mr(t, e, r) {
|
|
|
1434
1434
|
a = a.parent;
|
|
1435
1435
|
else
|
|
1436
1436
|
a = n;
|
|
1437
|
-
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), m =
|
|
1437
|
+
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), m = ie({
|
|
1438
1438
|
ctxInject: {},
|
|
1439
1439
|
destroyed: !1,
|
|
1440
1440
|
isShow: !0,
|
|
1441
1441
|
unique: 1,
|
|
1442
1442
|
renderRule: [...l.value || []],
|
|
1443
1443
|
updateValue: JSON.stringify(u.value || {})
|
|
1444
|
-
}), g = new t(n),
|
|
1444
|
+
}), g = new t(n), $ = g.api(), _ = d.value, D = () => {
|
|
1445
1445
|
if (o) {
|
|
1446
|
-
const
|
|
1447
|
-
if (
|
|
1448
|
-
let
|
|
1449
|
-
|
|
1446
|
+
const F = Re(n, o);
|
|
1447
|
+
if (F) {
|
|
1448
|
+
let R;
|
|
1449
|
+
_ ? (R = G(F.getSubForm()), R.push($)) : R = $, F.subForm(R);
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
|
-
},
|
|
1453
|
-
const
|
|
1454
|
-
if (
|
|
1455
|
-
if (
|
|
1456
|
-
const
|
|
1457
|
-
|
|
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);
|
|
1458
1458
|
} else
|
|
1459
|
-
|
|
1459
|
+
F.subForm();
|
|
1460
1460
|
};
|
|
1461
1461
|
let V = null;
|
|
1462
1462
|
cr(() => {
|
|
1463
|
-
|
|
1464
|
-
let
|
|
1465
|
-
const
|
|
1466
|
-
Object.keys(
|
|
1467
|
-
let
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
}),
|
|
1471
|
-
}), s.option && s.option.style && (
|
|
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 || "";
|
|
1472
1472
|
}, () => {
|
|
1473
1473
|
});
|
|
1474
1474
|
});
|
|
1475
|
-
const
|
|
1475
|
+
const T = ne(() => {
|
|
1476
1476
|
g.bus.$emit("$loadData.$topForm");
|
|
1477
|
-
}, 100),
|
|
1477
|
+
}, 100), ce = ne(function() {
|
|
1478
|
+
g.bus.$emit("$loadData.$scopeForm");
|
|
1479
|
+
}, 100), Ae = ne(() => {
|
|
1478
1480
|
g.bus.$emit("$loadData.$form");
|
|
1479
|
-
}, 100),
|
|
1480
|
-
g.bus.$emit("change-$form." +
|
|
1481
|
+
}, 100), he = (F) => {
|
|
1482
|
+
g.bus.$emit("change-$form." + F);
|
|
1481
1483
|
};
|
|
1482
1484
|
return hr(() => {
|
|
1483
|
-
o && (
|
|
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
|
-
o && (
|
|
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();
|
|
1486
1488
|
}), pr(() => {
|
|
1487
1489
|
g.updated();
|
|
1488
|
-
}),
|
|
1489
|
-
|
|
1490
|
-
}, { immediate: !0 }),
|
|
1491
|
-
g
|
|
1492
|
-
}),
|
|
1493
|
-
g.
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
}),
|
|
1497
|
-
JSON.stringify(
|
|
1498
|
-
}, { deep: !0, flush: "post" }),
|
|
1499
|
-
|
|
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(() => {
|
|
1500
1502
|
P(() => {
|
|
1501
|
-
|
|
1503
|
+
$.clearValidateState();
|
|
1502
1504
|
});
|
|
1503
1505
|
});
|
|
1504
1506
|
}, { flush: "sync" }), U(b({
|
|
1505
|
-
fc:
|
|
1506
|
-
parent: o &&
|
|
1507
|
-
top:
|
|
1508
|
-
fapi:
|
|
1507
|
+
fc: me(g),
|
|
1508
|
+
parent: o && me(o),
|
|
1509
|
+
top: me(a),
|
|
1510
|
+
fapi: me($)
|
|
1509
1511
|
}, lt(m)), {
|
|
1510
1512
|
getGroupInject: () => Re(n, o),
|
|
1511
1513
|
refresh() {
|
|
@@ -1514,11 +1516,11 @@ function Mr(t, e, r) {
|
|
|
1514
1516
|
renderRule() {
|
|
1515
1517
|
m.renderRule = [...l.value || []];
|
|
1516
1518
|
},
|
|
1517
|
-
updateValue(
|
|
1519
|
+
updateValue(F) {
|
|
1518
1520
|
if (m.destroyed) return;
|
|
1519
|
-
const
|
|
1520
|
-
m.updateValue !==
|
|
1521
|
-
Ae(), o ||
|
|
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());
|
|
1522
1524
|
}));
|
|
1523
1525
|
}
|
|
1524
1526
|
});
|
|
@@ -1528,13 +1530,13 @@ function Mr(t, e, r) {
|
|
|
1528
1530
|
}
|
|
1529
1531
|
};
|
|
1530
1532
|
}
|
|
1531
|
-
const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"],
|
|
1533
|
+
const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"], Y = (t, e = {}, r = {}) => {
|
|
1532
1534
|
const i = [...kt, ...r.normal || []], s = [...Et, ...r.array || []], n = [...Dt, ...r.functional || []], o = r.props || [];
|
|
1533
1535
|
return t.reduce((a, l) => {
|
|
1534
1536
|
for (const u in l)
|
|
1535
1537
|
if (a[u])
|
|
1536
1538
|
if (o.indexOf(u) > -1)
|
|
1537
|
-
a[u] =
|
|
1539
|
+
a[u] = Y([l[u]], a[u]);
|
|
1538
1540
|
else if (i.indexOf(u) > -1)
|
|
1539
1541
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1540
1542
|
else if (s.indexOf(u) > -1) {
|
|
@@ -1576,7 +1578,7 @@ function Gr(t) {
|
|
|
1576
1578
|
}
|
|
1577
1579
|
const We = "[[FORM-CREATE-PREFIX-", ze = "-FORM-CREATE-SUFFIX]]";
|
|
1578
1580
|
function et(t, e) {
|
|
1579
|
-
return JSON.stringify(
|
|
1581
|
+
return JSON.stringify(be(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1580
1582
|
if (!(i && i._isVue === !0)) {
|
|
1581
1583
|
if (typeof i != "function")
|
|
1582
1584
|
return i;
|
|
@@ -1590,7 +1592,7 @@ function et(t, e) {
|
|
|
1590
1592
|
function Le(t) {
|
|
1591
1593
|
return new Function("return " + t)();
|
|
1592
1594
|
}
|
|
1593
|
-
function
|
|
1595
|
+
function z(t, e) {
|
|
1594
1596
|
if (t && h.String(t) && t.length > 4) {
|
|
1595
1597
|
let r = t.trim(), i = !1;
|
|
1596
1598
|
try {
|
|
@@ -1631,7 +1633,7 @@ err: ${s}`);
|
|
|
1631
1633
|
}
|
|
1632
1634
|
function Vt(t, e) {
|
|
1633
1635
|
return JSON.parse(t, function(r, i) {
|
|
1634
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1636
|
+
return h.Undef(i) || !i.indexOf ? i : z(i, e);
|
|
1635
1637
|
});
|
|
1636
1638
|
}
|
|
1637
1639
|
let Hr = 0;
|
|
@@ -1639,11 +1641,11 @@ function Ie() {
|
|
|
1639
1641
|
const t = 370 + ++Hr;
|
|
1640
1642
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1641
1643
|
}
|
|
1642
|
-
function
|
|
1644
|
+
function se(t, e, r) {
|
|
1643
1645
|
let i = t, s;
|
|
1644
1646
|
return (e || "").split(".").forEach((n) => {
|
|
1645
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1646
|
-
}),
|
|
1647
|
+
s && ((!i[s] || typeof i[s] != "object") && S(i, s, {}), i = i[s]), s = n;
|
|
1648
|
+
}), S(i, s, r), i;
|
|
1647
1649
|
}
|
|
1648
1650
|
function Ke(t, e) {
|
|
1649
1651
|
return {
|
|
@@ -1657,10 +1659,10 @@ function Pt(t, e) {
|
|
|
1657
1659
|
return Bt([t], e || !1)[0];
|
|
1658
1660
|
}
|
|
1659
1661
|
function Bt(t, e) {
|
|
1660
|
-
return
|
|
1662
|
+
return be([], [...t], e || !1);
|
|
1661
1663
|
}
|
|
1662
|
-
function
|
|
1663
|
-
return
|
|
1664
|
+
function x(t, e) {
|
|
1665
|
+
return Y(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
|
|
1664
1666
|
}
|
|
1665
1667
|
function ct(t) {
|
|
1666
1668
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
@@ -1668,7 +1670,7 @@ function ct(t) {
|
|
|
1668
1670
|
}
|
|
1669
1671
|
function Jr(t, e) {
|
|
1670
1672
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1671
|
-
e[r] && (t[r] =
|
|
1673
|
+
e[r] && (t[r] = x(t[r] || {}, e[r]));
|
|
1672
1674
|
}), t) : e;
|
|
1673
1675
|
}
|
|
1674
1676
|
function Lt(t, e) {
|
|
@@ -1678,7 +1680,7 @@ function Lt(t, e) {
|
|
|
1678
1680
|
}
|
|
1679
1681
|
}, r), {}));
|
|
1680
1682
|
}
|
|
1681
|
-
function
|
|
1683
|
+
function Z(t) {
|
|
1682
1684
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1683
1685
|
}
|
|
1684
1686
|
function O(t, e) {
|
|
@@ -1742,7 +1744,7 @@ function Oe() {
|
|
|
1742
1744
|
}
|
|
1743
1745
|
};
|
|
1744
1746
|
}
|
|
1745
|
-
function
|
|
1747
|
+
function Fe(t, e) {
|
|
1746
1748
|
return Object.setPrototypeOf(t, e), t;
|
|
1747
1749
|
}
|
|
1748
1750
|
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
|
|
@@ -1780,7 +1782,7 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1780
1782
|
return new RegExp(e, "g").test(t);
|
|
1781
1783
|
}
|
|
1782
1784
|
};
|
|
1783
|
-
function
|
|
1785
|
+
function L(t, e) {
|
|
1784
1786
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1785
1787
|
t != null && (t = t[r]);
|
|
1786
1788
|
}), t;
|
|
@@ -1818,14 +1820,14 @@ function A(t, e) {
|
|
|
1818
1820
|
};
|
|
1819
1821
|
}
|
|
1820
1822
|
function tt(t, e, r, i, s) {
|
|
1821
|
-
this._data =
|
|
1823
|
+
this._data = C(Tt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1822
1824
|
}
|
|
1823
|
-
|
|
1825
|
+
C(tt.prototype, {
|
|
1824
1826
|
getRule() {
|
|
1825
1827
|
return this._data;
|
|
1826
1828
|
},
|
|
1827
1829
|
setProp(t, e) {
|
|
1828
|
-
return
|
|
1830
|
+
return S(this._data, t, e), this;
|
|
1829
1831
|
},
|
|
1830
1832
|
_clone() {
|
|
1831
1833
|
const t = new this.constructor();
|
|
@@ -1835,7 +1837,7 @@ _(tt.prototype, {
|
|
|
1835
1837
|
function Nt(t) {
|
|
1836
1838
|
t.forEach((e) => {
|
|
1837
1839
|
tt.prototype[e] = function(r) {
|
|
1838
|
-
return
|
|
1840
|
+
return x(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1839
1841
|
};
|
|
1840
1842
|
});
|
|
1841
1843
|
}
|
|
@@ -1903,8 +1905,8 @@ function gt(t, e, r) {
|
|
|
1903
1905
|
(e || Ut)(U(b({}, t), {
|
|
1904
1906
|
onSuccess(n) {
|
|
1905
1907
|
let o = (l) => l;
|
|
1906
|
-
const a =
|
|
1907
|
-
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));
|
|
1908
1910
|
},
|
|
1909
1911
|
onError(n) {
|
|
1910
1912
|
s(n);
|
|
@@ -1912,8 +1914,8 @@ function gt(t, e, r) {
|
|
|
1912
1914
|
}));
|
|
1913
1915
|
});
|
|
1914
1916
|
}
|
|
1915
|
-
function
|
|
1916
|
-
return
|
|
1917
|
+
function $e(t) {
|
|
1918
|
+
return W(t);
|
|
1917
1919
|
}
|
|
1918
1920
|
function Zr(t) {
|
|
1919
1921
|
function e(n) {
|
|
@@ -1922,7 +1924,7 @@ function Zr(t) {
|
|
|
1922
1924
|
function r(n, o, a) {
|
|
1923
1925
|
e(n).forEach((l) => {
|
|
1924
1926
|
t.getCtxs(l).forEach((u) => {
|
|
1925
|
-
|
|
1927
|
+
S(u.rule, o, a), t.$render.clearCache(u);
|
|
1926
1928
|
});
|
|
1927
1929
|
});
|
|
1928
1930
|
}
|
|
@@ -1958,6 +1960,15 @@ function Zr(t) {
|
|
|
1958
1960
|
get top() {
|
|
1959
1961
|
return s.parent ? s.parent.top : s;
|
|
1960
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
|
+
},
|
|
1961
1972
|
get children() {
|
|
1962
1973
|
return i();
|
|
1963
1974
|
},
|
|
@@ -1977,17 +1988,17 @@ function Zr(t) {
|
|
|
1977
1988
|
}
|
|
1978
1989
|
},
|
|
1979
1990
|
formData(n) {
|
|
1980
|
-
if (n == null) {
|
|
1991
|
+
if (n == null || typeof n == "boolean") {
|
|
1981
1992
|
const o = {};
|
|
1982
1993
|
return Object.keys(t.form).forEach((a) => {
|
|
1983
|
-
t.ignoreFields.indexOf(a) === -1 && (o[a] =
|
|
1994
|
+
(n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] = $e(t.form[a]));
|
|
1984
1995
|
}), o;
|
|
1985
1996
|
} else
|
|
1986
1997
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
1987
1998
|
},
|
|
1988
1999
|
getValue(n) {
|
|
1989
2000
|
const o = t.getFieldCtx(n);
|
|
1990
|
-
return o ?
|
|
2001
|
+
return o ? $e(o.rule.value) : t.options.appendValue !== !1 && E(t.appendData, n) ? $e(t.appendData[n]) : void 0;
|
|
1991
2002
|
},
|
|
1992
2003
|
coverValue(n) {
|
|
1993
2004
|
const o = b({}, n || {});
|
|
@@ -1995,12 +2006,12 @@ function Zr(t) {
|
|
|
1995
2006
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
1996
2007
|
const l = t.fieldCtx[a];
|
|
1997
2008
|
if (l) {
|
|
1998
|
-
const u =
|
|
2009
|
+
const u = E(n, a);
|
|
1999
2010
|
l.forEach((f) => {
|
|
2000
2011
|
f.rule.value = u ? n[a] : void 0;
|
|
2001
2012
|
}), delete o[a];
|
|
2002
2013
|
}
|
|
2003
|
-
}),
|
|
2014
|
+
}), C(t.appendData, o);
|
|
2004
2015
|
}, !0);
|
|
2005
2016
|
},
|
|
2006
2017
|
setValue(n) {
|
|
@@ -2024,7 +2035,7 @@ function Zr(t) {
|
|
|
2024
2035
|
}, !0), o ? o.origin : void 0;
|
|
2025
2036
|
},
|
|
2026
2037
|
removeRule(n) {
|
|
2027
|
-
const o = n &&
|
|
2038
|
+
const o = n && Z(n);
|
|
2028
2039
|
if (o)
|
|
2029
2040
|
return o.rm(), o.origin;
|
|
2030
2041
|
},
|
|
@@ -2074,7 +2085,7 @@ function Zr(t) {
|
|
|
2074
2085
|
disabled(n, o) {
|
|
2075
2086
|
e(o).forEach((a) => {
|
|
2076
2087
|
t.getCtxs(a).forEach((l) => {
|
|
2077
|
-
|
|
2088
|
+
S(l.rule.props, "disabled", !!n);
|
|
2078
2089
|
});
|
|
2079
2090
|
}), t.refresh();
|
|
2080
2091
|
},
|
|
@@ -2113,7 +2124,7 @@ function Zr(t) {
|
|
|
2113
2124
|
n.forEach((a) => s.sync(a));
|
|
2114
2125
|
return;
|
|
2115
2126
|
}
|
|
2116
|
-
let o = h.Object(n) ?
|
|
2127
|
+
let o = h.Object(n) ? Z(n) : t.getCtxs(n);
|
|
2117
2128
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2118
2129
|
if (!a.deleted) {
|
|
2119
2130
|
const l = t.subForm[a.id];
|
|
@@ -2132,7 +2143,7 @@ function Zr(t) {
|
|
|
2132
2143
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2133
2144
|
},
|
|
2134
2145
|
hideForm: (n) => {
|
|
2135
|
-
|
|
2146
|
+
S(t.vm, "isShow", !n);
|
|
2136
2147
|
},
|
|
2137
2148
|
changeStatus: () => t.changeStatus,
|
|
2138
2149
|
clearChangeStatus: () => {
|
|
@@ -2140,7 +2151,7 @@ function Zr(t) {
|
|
|
2140
2151
|
},
|
|
2141
2152
|
updateRule(n, o) {
|
|
2142
2153
|
t.getCtxs(n).forEach((a) => {
|
|
2143
|
-
|
|
2154
|
+
C(a.rule, o);
|
|
2144
2155
|
});
|
|
2145
2156
|
},
|
|
2146
2157
|
updateRules(n) {
|
|
@@ -2150,7 +2161,7 @@ function Zr(t) {
|
|
|
2150
2161
|
},
|
|
2151
2162
|
mergeRule: (n, o) => {
|
|
2152
2163
|
t.getCtxs(n).forEach((a) => {
|
|
2153
|
-
|
|
2164
|
+
x(a.rule, o);
|
|
2154
2165
|
});
|
|
2155
2166
|
},
|
|
2156
2167
|
mergeRules(n) {
|
|
@@ -2177,7 +2188,7 @@ function Zr(t) {
|
|
|
2177
2188
|
},
|
|
2178
2189
|
setEffect(n, o, a) {
|
|
2179
2190
|
const l = t.getCtx(n);
|
|
2180
|
-
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));
|
|
2181
2192
|
},
|
|
2182
2193
|
clearEffectData(n, o) {
|
|
2183
2194
|
const a = t.getCtx(n);
|
|
@@ -2197,7 +2208,7 @@ function Zr(t) {
|
|
|
2197
2208
|
resetFields(n) {
|
|
2198
2209
|
e(n).forEach((o) => {
|
|
2199
2210
|
t.getCtxs(o).forEach((a) => {
|
|
2200
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2211
|
+
t.$render.clearCache(a), a.rule.value = $e(a.defaultValue);
|
|
2201
2212
|
});
|
|
2202
2213
|
}), P(() => {
|
|
2203
2214
|
P(() => {
|
|
@@ -2236,7 +2247,7 @@ function Zr(t) {
|
|
|
2236
2247
|
return o ? t.subForm[o.id] : void 0;
|
|
2237
2248
|
},
|
|
2238
2249
|
getChildrenRuleList(n) {
|
|
2239
|
-
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);
|
|
2240
2251
|
if (!l)
|
|
2241
2252
|
return [];
|
|
2242
2253
|
const u = [];
|
|
@@ -2247,10 +2258,10 @@ function Zr(t) {
|
|
|
2247
2258
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2248
2259
|
},
|
|
2249
2260
|
getParentRule(n) {
|
|
2250
|
-
return (typeof n == "object" ?
|
|
2261
|
+
return (typeof n == "object" ? Z(n) : t.getCtx(n)).parent.rule;
|
|
2251
2262
|
},
|
|
2252
2263
|
getParentSubRule(n) {
|
|
2253
|
-
const a = typeof n == "object" ?
|
|
2264
|
+
const a = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2254
2265
|
if (a) {
|
|
2255
2266
|
const l = a.getParentGroup();
|
|
2256
2267
|
if (l)
|
|
@@ -2258,20 +2269,20 @@ function Zr(t) {
|
|
|
2258
2269
|
}
|
|
2259
2270
|
},
|
|
2260
2271
|
getChildrenFormData(n) {
|
|
2261
|
-
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), {});
|
|
2262
2273
|
},
|
|
2263
2274
|
setChildrenFormData(n, o, a) {
|
|
2264
2275
|
const l = s.getChildrenRuleList(n);
|
|
2265
2276
|
t.deferSyncValue(() => {
|
|
2266
2277
|
l.forEach((u) => {
|
|
2267
|
-
|
|
2278
|
+
E(o, u.field) ? u.value = o[u.field] : a && (u.value = void 0);
|
|
2268
2279
|
});
|
|
2269
2280
|
});
|
|
2270
2281
|
},
|
|
2271
2282
|
getGlobalEvent(n) {
|
|
2272
2283
|
let o = s.options.globalEvent[n];
|
|
2273
2284
|
if (o)
|
|
2274
|
-
return typeof o == "object" && (o = o.handle),
|
|
2285
|
+
return typeof o == "object" && (o = o.handle), z(o);
|
|
2275
2286
|
},
|
|
2276
2287
|
getGlobalData(n) {
|
|
2277
2288
|
return new Promise((o, a) => {
|
|
@@ -2282,11 +2293,11 @@ function Zr(t) {
|
|
|
2282
2293
|
});
|
|
2283
2294
|
},
|
|
2284
2295
|
renderRule(n, o, a) {
|
|
2285
|
-
const u = typeof n == "object" ?
|
|
2296
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2286
2297
|
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2287
2298
|
},
|
|
2288
2299
|
renderChildren(n, o, a) {
|
|
2289
|
-
const u = typeof n == "object" ?
|
|
2300
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2290
2301
|
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2291
2302
|
},
|
|
2292
2303
|
nextTick(n) {
|
|
@@ -2304,7 +2315,7 @@ function Zr(t) {
|
|
|
2304
2315
|
bus: t.bus,
|
|
2305
2316
|
fetch(n) {
|
|
2306
2317
|
return new Promise((o, a) => {
|
|
2307
|
-
n =
|
|
2318
|
+
n = W(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2308
2319
|
O(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2309
2320
|
}).catch((l) => {
|
|
2310
2321
|
O(() => n.onError && n.onError(l)), a(l);
|
|
@@ -2313,7 +2324,7 @@ function Zr(t) {
|
|
|
2313
2324
|
},
|
|
2314
2325
|
watchFetch(n, o, a, l) {
|
|
2315
2326
|
return t.fc.watchLoadData((u, f) => {
|
|
2316
|
-
let d =
|
|
2327
|
+
let d = W(n);
|
|
2317
2328
|
d = t.loadFetchVar(d, u), !(l && l(d, f) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((m) => {
|
|
2318
2329
|
O(() => d.onSuccess && d.onSuccess(m)), o && o(m, f);
|
|
2319
2330
|
}).catch((m) => {
|
|
@@ -2322,7 +2333,7 @@ function Zr(t) {
|
|
|
2322
2333
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2323
2334
|
},
|
|
2324
2335
|
getData(n, o) {
|
|
2325
|
-
return t.fc.getLoadData(n, o);
|
|
2336
|
+
return t.fc.get ? t.fc.get(n, o) : t.fc.getLoadData(n, o);
|
|
2326
2337
|
},
|
|
2327
2338
|
setData(n, o, a) {
|
|
2328
2339
|
return t.fc.setData(n, o, a);
|
|
@@ -2348,7 +2359,7 @@ function Zr(t) {
|
|
|
2348
2359
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2349
2360
|
}
|
|
2350
2361
|
function Yr(t) {
|
|
2351
|
-
|
|
2362
|
+
C(t.prototype, {
|
|
2352
2363
|
initCache() {
|
|
2353
2364
|
this.clearCacheAll();
|
|
2354
2365
|
},
|
|
@@ -2389,7 +2400,7 @@ function qt(t) {
|
|
|
2389
2400
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2390
2401
|
}
|
|
2391
2402
|
function xr(t) {
|
|
2392
|
-
|
|
2403
|
+
C(t.prototype, {
|
|
2393
2404
|
initRender() {
|
|
2394
2405
|
this.cacheConfig = {};
|
|
2395
2406
|
},
|
|
@@ -2397,7 +2408,7 @@ function xr(t) {
|
|
|
2397
2408
|
const r = (i) => {
|
|
2398
2409
|
if (i) {
|
|
2399
2410
|
let s;
|
|
2400
|
-
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);
|
|
2401
2412
|
}
|
|
2402
2413
|
};
|
|
2403
2414
|
return r(this.vm);
|
|
@@ -2417,23 +2428,23 @@ function xr(t) {
|
|
|
2417
2428
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2418
2429
|
},
|
|
2419
2430
|
mergeGlobal(e) {
|
|
2420
|
-
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(() => {
|
|
2421
2432
|
const i = this.$handle.options.global;
|
|
2422
|
-
return
|
|
2423
|
-
})), 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]));
|
|
2424
2435
|
},
|
|
2425
2436
|
setOptions(e) {
|
|
2426
2437
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2427
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2438
|
+
e.prop.options = r, e.prop.optionsTo && r && se(e.prop, e.prop.optionsTo, r);
|
|
2428
2439
|
},
|
|
2429
2440
|
deepSet(e) {
|
|
2430
2441
|
const r = e.rule.deep;
|
|
2431
2442
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2432
|
-
|
|
2443
|
+
se(e.prop, i, r[i]);
|
|
2433
2444
|
});
|
|
2434
2445
|
},
|
|
2435
2446
|
parseSide(e, r) {
|
|
2436
|
-
return h.Object(e) ?
|
|
2447
|
+
return h.Object(e) ? x({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2437
2448
|
},
|
|
2438
2449
|
renderSides(e, r, i) {
|
|
2439
2450
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2470,20 +2481,20 @@ function xr(t) {
|
|
|
2470
2481
|
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2471
2482
|
let f = [];
|
|
2472
2483
|
const d = e.loadChildrenPending();
|
|
2473
|
-
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach((
|
|
2484
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
|
|
2474
2485
|
f.push(this.renderRule({
|
|
2475
2486
|
type: "template",
|
|
2476
|
-
slot:
|
|
2487
|
+
slot: $
|
|
2477
2488
|
}, (() => {
|
|
2478
|
-
if (h.Function(n.renderSlots[
|
|
2479
|
-
return O(() => n.renderSlots[
|
|
2480
|
-
const
|
|
2481
|
-
return this.renderRule(
|
|
2489
|
+
if (h.Function(n.renderSlots[$]))
|
|
2490
|
+
return O(() => n.renderSlots[$]());
|
|
2491
|
+
const _ = this.parseSide(n.renderSlots[$], e);
|
|
2492
|
+
return this.renderRule(_);
|
|
2482
2493
|
})()));
|
|
2483
2494
|
});
|
|
2484
2495
|
const m = this.getTypeSlot(e);
|
|
2485
2496
|
let g;
|
|
2486
|
-
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((
|
|
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;
|
|
2487
2498
|
}, this.setCache(e, s, r);
|
|
2488
2499
|
}
|
|
2489
2500
|
return (...s) => {
|
|
@@ -2546,7 +2557,7 @@ function xr(t) {
|
|
|
2546
2557
|
}
|
|
2547
2558
|
});
|
|
2548
2559
|
const i = r.ctxInject[e.id];
|
|
2549
|
-
return
|
|
2560
|
+
return C(i, {
|
|
2550
2561
|
preview: e.prop.preview,
|
|
2551
2562
|
options: e.prop.options,
|
|
2552
2563
|
prop: function() {
|
|
@@ -2591,7 +2602,7 @@ function xr(t) {
|
|
|
2591
2602
|
}
|
|
2592
2603
|
});
|
|
2593
2604
|
}
|
|
2594
|
-
return
|
|
2605
|
+
return Y(n, e.prop), e.prop;
|
|
2595
2606
|
},
|
|
2596
2607
|
onMounted(e) {
|
|
2597
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");
|
|
@@ -2660,7 +2671,7 @@ function xr(t) {
|
|
|
2660
2671
|
}
|
|
2661
2672
|
let ei = 1;
|
|
2662
2673
|
function rt(t) {
|
|
2663
|
-
|
|
2674
|
+
C(this, {
|
|
2664
2675
|
$handle: t,
|
|
2665
2676
|
fc: t.fc,
|
|
2666
2677
|
vm: t.vm,
|
|
@@ -2681,7 +2692,7 @@ function rt(t) {
|
|
|
2681
2692
|
Yr(rt);
|
|
2682
2693
|
xr(rt);
|
|
2683
2694
|
function ti(t) {
|
|
2684
|
-
|
|
2695
|
+
C(t.prototype, {
|
|
2685
2696
|
parseInjectEvent(e, r) {
|
|
2686
2697
|
const i = e.inject || this.options.injectEvent;
|
|
2687
2698
|
return this.parseEventLst(e, r, i);
|
|
@@ -2698,7 +2709,7 @@ function ti(t) {
|
|
|
2698
2709
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2699
2710
|
return this.parseEventLst(e, r, i, !0);
|
|
2700
2711
|
if (h.String(r)) {
|
|
2701
|
-
const n =
|
|
2712
|
+
const n = z(r);
|
|
2702
2713
|
if (n && r !== n)
|
|
2703
2714
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2704
2715
|
}
|
|
@@ -2710,14 +2721,14 @@ function ti(t) {
|
|
|
2710
2721
|
let d, m = n || o || a;
|
|
2711
2722
|
if (h.Object(f) && (d = f.inject, f = f.name, m = f.prefix || m), m) {
|
|
2712
2723
|
r || (m = `native-${m}`);
|
|
2713
|
-
const g =
|
|
2714
|
-
this.vm.$emit(g, ...
|
|
2724
|
+
const g = ve(`${m}-${f}`), $ = (..._) => {
|
|
2725
|
+
this.vm.$emit(g, ..._), this.vm.$emit("emit-event", g, ..._), this.bus.$emit(g, ..._);
|
|
2715
2726
|
};
|
|
2716
|
-
if (
|
|
2717
|
-
i[f] =
|
|
2727
|
+
if ($.__emit = !0, !d && l === !1)
|
|
2728
|
+
i[f] = $;
|
|
2718
2729
|
else {
|
|
2719
|
-
let
|
|
2720
|
-
i[f] = h.Undef(
|
|
2730
|
+
let _ = d || l || this.options.injectEvent;
|
|
2731
|
+
i[f] = h.Undef(_) ? $ : this.inject(s, $, _);
|
|
2721
2732
|
}
|
|
2722
2733
|
}
|
|
2723
2734
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2756,10 +2767,10 @@ function ti(t) {
|
|
|
2756
2767
|
let d, m = !1;
|
|
2757
2768
|
if (i && u.indexOf("$form.") === 0) {
|
|
2758
2769
|
const g = u.split(".");
|
|
2759
|
-
g.shift(),
|
|
2770
|
+
g.shift(), E(i.value, g[0]) && (m = !0, d = r ? r({
|
|
2760
2771
|
id: "$form." + g[0] + "_" + i.rule.__fc__.id,
|
|
2761
|
-
getValue: () =>
|
|
2762
|
-
}) :
|
|
2772
|
+
getValue: () => L(i.value, g)
|
|
2773
|
+
}) : L(i.value, g));
|
|
2763
2774
|
}
|
|
2764
2775
|
m || (d = r ? r(u, f) : this.fc.getLoadData(u, f)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
|
|
2765
2776
|
}
|
|
@@ -2785,12 +2796,12 @@ function ti(t) {
|
|
|
2785
2796
|
}
|
|
2786
2797
|
const yt = ["hook:updated", "hook:mounted"];
|
|
2787
2798
|
function ri(t) {
|
|
2788
|
-
|
|
2799
|
+
C(t.prototype, {
|
|
2789
2800
|
usePage() {
|
|
2790
2801
|
const e = this.options.page;
|
|
2791
2802
|
if (!e) return;
|
|
2792
2803
|
let r = 25, i = ii(this.rules);
|
|
2793
|
-
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)),
|
|
2804
|
+
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), C(this, {
|
|
2794
2805
|
first: r,
|
|
2795
2806
|
limit: i,
|
|
2796
2807
|
pageEnd: this.rules.length <= r
|
|
@@ -2808,7 +2819,7 @@ function ii(t) {
|
|
|
2808
2819
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2809
2820
|
}
|
|
2810
2821
|
function ni(t) {
|
|
2811
|
-
|
|
2822
|
+
C(t.prototype, {
|
|
2812
2823
|
clearNextTick() {
|
|
2813
2824
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
2814
2825
|
},
|
|
@@ -2824,14 +2835,14 @@ function ni(t) {
|
|
|
2824
2835
|
}
|
|
2825
2836
|
function si(t) {
|
|
2826
2837
|
Object.defineProperties(t.origin, {
|
|
2827
|
-
__fc__: Ke(
|
|
2838
|
+
__fc__: Ke(me(t), !0)
|
|
2828
2839
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2829
|
-
__fc__: Ke(
|
|
2840
|
+
__fc__: Ke(me(t), !0)
|
|
2830
2841
|
});
|
|
2831
2842
|
}
|
|
2832
2843
|
function Gt(t, e, r) {
|
|
2833
2844
|
const i = Ie(), s = !!e.field;
|
|
2834
|
-
|
|
2845
|
+
C(this, {
|
|
2835
2846
|
id: i,
|
|
2836
2847
|
ref: i,
|
|
2837
2848
|
wrapRef: i + "fi",
|
|
@@ -2855,11 +2866,11 @@ function Gt(t, e, r) {
|
|
|
2855
2866
|
input: s,
|
|
2856
2867
|
el: void 0,
|
|
2857
2868
|
exportEl: void 0,
|
|
2858
|
-
defaultValue: s ?
|
|
2869
|
+
defaultValue: s ? W(r) : void 0,
|
|
2859
2870
|
field: e.field || void 0
|
|
2860
2871
|
}), this.updateKey(), si(this), this.update(t, !0);
|
|
2861
2872
|
}
|
|
2862
|
-
|
|
2873
|
+
C(Gt.prototype, {
|
|
2863
2874
|
getParentGroup() {
|
|
2864
2875
|
let t = this.parent;
|
|
2865
2876
|
for (; t; ) {
|
|
@@ -2919,7 +2930,7 @@ _(Gt.prototype, {
|
|
|
2919
2930
|
setPending(t, e, r) {
|
|
2920
2931
|
this.pending[t] = {
|
|
2921
2932
|
origin: e,
|
|
2922
|
-
value:
|
|
2933
|
+
value: ie(r)
|
|
2923
2934
|
};
|
|
2924
2935
|
},
|
|
2925
2936
|
effectData(t) {
|
|
@@ -2940,7 +2951,7 @@ _(Gt.prototype, {
|
|
|
2940
2951
|
initProp() {
|
|
2941
2952
|
var e, r;
|
|
2942
2953
|
const t = b({}, this.rule);
|
|
2943
|
-
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 || []];
|
|
2944
2955
|
},
|
|
2945
2956
|
initNone() {
|
|
2946
2957
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -2964,7 +2975,7 @@ _(Gt.prototype, {
|
|
|
2964
2975
|
this.$handle.watchCtx(this);
|
|
2965
2976
|
},
|
|
2966
2977
|
delete() {
|
|
2967
|
-
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, {
|
|
2968
2979
|
deleted: !0,
|
|
2969
2980
|
computed: {},
|
|
2970
2981
|
parent: null,
|
|
@@ -2987,14 +2998,14 @@ _(Gt.prototype, {
|
|
|
2987
2998
|
}
|
|
2988
2999
|
this.$handle.noWatch(() => {
|
|
2989
3000
|
this.$handle.deferSyncValue(() => {
|
|
2990
|
-
this.rmCtrl(), t(), this.$handle.rmCtx(this),
|
|
3001
|
+
this.rmCtrl(), t(), this.$handle.rmCtx(this), C(this, {
|
|
2991
3002
|
root: []
|
|
2992
3003
|
});
|
|
2993
3004
|
}, this.input);
|
|
2994
3005
|
});
|
|
2995
3006
|
},
|
|
2996
3007
|
update(t, e) {
|
|
2997
|
-
|
|
3008
|
+
C(this, {
|
|
2998
3009
|
deleted: !1,
|
|
2999
3010
|
$handle: t,
|
|
3000
3011
|
$render: t.$render,
|
|
@@ -3007,7 +3018,7 @@ _(Gt.prototype, {
|
|
|
3007
3018
|
}
|
|
3008
3019
|
});
|
|
3009
3020
|
function oi(t) {
|
|
3010
|
-
|
|
3021
|
+
C(t.prototype, {
|
|
3011
3022
|
nextRefresh(e) {
|
|
3012
3023
|
const r = this.loadedId;
|
|
3013
3024
|
P(() => {
|
|
@@ -3020,7 +3031,7 @@ function oi(t) {
|
|
|
3020
3031
|
__origin__: Ke(e, !0)
|
|
3021
3032
|
}), ai(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
3022
3033
|
i && this.loadFn(i, r);
|
|
3023
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
3034
|
+
}), this.loadCtrl(r), r.update && (r.update = z(r.update)), r;
|
|
3024
3035
|
},
|
|
3025
3036
|
loadFn(e, r) {
|
|
3026
3037
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -3029,12 +3040,12 @@ function oi(t) {
|
|
|
3029
3040
|
},
|
|
3030
3041
|
loadCtrl(e) {
|
|
3031
3042
|
e.control && e.control.forEach((r) => {
|
|
3032
|
-
r.handle && (r.handle =
|
|
3043
|
+
r.handle && (r.handle = z(r.handle));
|
|
3033
3044
|
});
|
|
3034
3045
|
},
|
|
3035
3046
|
syncProp(e) {
|
|
3036
3047
|
const r = e.rule;
|
|
3037
|
-
h.trueArray(r.sync) &&
|
|
3048
|
+
h.trueArray(r.sync) && Y([{
|
|
3038
3049
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
3039
3050
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3040
3051
|
}, i), {})
|
|
@@ -3083,18 +3094,18 @@ function oi(t) {
|
|
|
3083
3094
|
if (f)
|
|
3084
3095
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3085
3096
|
else {
|
|
3086
|
-
const
|
|
3087
|
-
f = new Gt(this,
|
|
3097
|
+
const D = this.parseRule(o);
|
|
3098
|
+
f = new Gt(this, D, g), this.bindParser(f);
|
|
3088
3099
|
}
|
|
3089
|
-
[!1, !0].forEach((
|
|
3090
|
-
const
|
|
3091
|
-
if (f.parser.loadChildren === !1 || s(
|
|
3092
|
-
const
|
|
3093
|
-
|
|
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);
|
|
3094
3105
|
}
|
|
3095
|
-
const
|
|
3096
|
-
return f.updated || (f.updated = !0, h.Function(
|
|
3097
|
-
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");
|
|
3098
3109
|
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3099
3110
|
}).filter((o) => !!o);
|
|
3100
3111
|
r && (r.children = n);
|
|
@@ -3121,34 +3132,34 @@ function oi(t) {
|
|
|
3121
3132
|
const n = [];
|
|
3122
3133
|
let o = !1;
|
|
3123
3134
|
return this.deferSyncValue(() => {
|
|
3124
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: m, ctrl: g, method:
|
|
3135
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: m, ctrl: g, method: $ }) => {
|
|
3125
3136
|
if (a) {
|
|
3126
3137
|
l ? e.ctrlRule.push({
|
|
3127
3138
|
__ctrl: !0,
|
|
3128
3139
|
children: u,
|
|
3129
3140
|
valid: l
|
|
3130
3141
|
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3131
|
-
|
|
3132
|
-
this.api.setEffect(
|
|
3133
|
-
}), l || this.api.clearValidateState(u)) : this.api.hidden(!l, u);
|
|
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);
|
|
3134
3145
|
});
|
|
3135
3146
|
return;
|
|
3136
3147
|
}
|
|
3137
3148
|
if (l) {
|
|
3138
3149
|
o = !0;
|
|
3139
|
-
const
|
|
3150
|
+
const _ = {
|
|
3140
3151
|
type: "fragment",
|
|
3141
3152
|
native: !0,
|
|
3142
3153
|
__ctrl: !0,
|
|
3143
3154
|
children: u
|
|
3144
3155
|
};
|
|
3145
|
-
e.ctrlRule.push(
|
|
3146
|
-
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, _);
|
|
3147
3158
|
});
|
|
3148
3159
|
} else {
|
|
3149
3160
|
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3150
|
-
const
|
|
3151
|
-
|
|
3161
|
+
const _ = Z(g);
|
|
3162
|
+
_ && _.rm();
|
|
3152
3163
|
}
|
|
3153
3164
|
});
|
|
3154
3165
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
@@ -3178,7 +3189,7 @@ function oi(t) {
|
|
|
3178
3189
|
function ai(t) {
|
|
3179
3190
|
const e = Tt();
|
|
3180
3191
|
return Object.keys(e).forEach((r) => {
|
|
3181
|
-
|
|
3192
|
+
E(t, r) || S(t, r, e[r]);
|
|
3182
3193
|
}), t;
|
|
3183
3194
|
}
|
|
3184
3195
|
function li(t) {
|
|
@@ -3196,7 +3207,7 @@ function $t(t) {
|
|
|
3196
3207
|
return !!t.rule.__ctrl;
|
|
3197
3208
|
}
|
|
3198
3209
|
function fi(t) {
|
|
3199
|
-
|
|
3210
|
+
C(t.prototype, {
|
|
3200
3211
|
setValue(e, r, i, s) {
|
|
3201
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, {
|
|
3202
3213
|
rule: e.origin,
|
|
@@ -3218,7 +3229,7 @@ function fi(t) {
|
|
|
3218
3229
|
this.deferSyncValue(() => {
|
|
3219
3230
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3220
3231
|
Object.keys(r || {}).forEach((o) => {
|
|
3221
|
-
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]);
|
|
3222
3233
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3223
3234
|
});
|
|
3224
3235
|
},
|
|
@@ -3228,11 +3239,11 @@ function fi(t) {
|
|
|
3228
3239
|
setFormData(e, r) {
|
|
3229
3240
|
e.modelValue = r;
|
|
3230
3241
|
const i = e.getParentGroup();
|
|
3231
|
-
i && (this.subRuleData[i.id] ||
|
|
3242
|
+
i && (this.subRuleData[i.id] || S(this.subRuleData, i.id, {}), S(this.subRuleData[i.id], e.field, e.rule.value)), S(this.formData, e.id, r);
|
|
3232
3243
|
},
|
|
3233
3244
|
rmSubRuleData(e) {
|
|
3234
3245
|
const r = e.getParentGroup();
|
|
3235
|
-
r && this.subRuleData[r.id] &&
|
|
3246
|
+
r && this.subRuleData[r.id] && re(this.subRuleData[r.id], e.field);
|
|
3236
3247
|
},
|
|
3237
3248
|
getFormData(e) {
|
|
3238
3249
|
return this.formData[e.id];
|
|
@@ -3242,13 +3253,13 @@ function fi(t) {
|
|
|
3242
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) => {
|
|
3243
3254
|
const o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a.rule))[0] || this.fieldCtx[n][0];
|
|
3244
3255
|
return this.isIgnore(o.rule) && i.push(n), s[n] = Ee(o.rule, "value"), s;
|
|
3245
|
-
}, e), this.form =
|
|
3256
|
+
}, e), this.form = ie(e), this.ignoreFields = i, this.syncValue();
|
|
3246
3257
|
},
|
|
3247
3258
|
isIgnore(e) {
|
|
3248
3259
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
3249
3260
|
},
|
|
3250
3261
|
appendValue(e) {
|
|
3251
|
-
(!e.field || !
|
|
3262
|
+
(!e.field || !E(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3252
3263
|
},
|
|
3253
3264
|
addSubForm(e, r) {
|
|
3254
3265
|
this.subForm[e.id] = r;
|
|
@@ -3322,7 +3333,7 @@ const ke = {
|
|
|
3322
3333
|
}
|
|
3323
3334
|
}, ci = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3324
3335
|
function hi(t) {
|
|
3325
|
-
|
|
3336
|
+
C(t.prototype, {
|
|
3326
3337
|
getCtx(e) {
|
|
3327
3338
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
3328
3339
|
},
|
|
@@ -3371,7 +3382,7 @@ function hi(t) {
|
|
|
3371
3382
|
watchCtx(e) {
|
|
3372
3383
|
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" && ci.indexOf(i) === -1).forEach((i) => {
|
|
3373
3384
|
const s = Ee(e.rule, i), n = i === "children";
|
|
3374
|
-
e.refRule[i] = s, e.watch.push(
|
|
3385
|
+
e.refRule[i] = s, e.watch.push(B(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3375
3386
|
let l = s.value;
|
|
3376
3387
|
if (!this.isBreakWatch()) {
|
|
3377
3388
|
if (n && e.parser.loadChildren === !1) {
|
|
@@ -3391,42 +3402,43 @@ function hi(t) {
|
|
|
3391
3402
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3392
3403
|
}
|
|
3393
3404
|
}, { deep: !n, sync: n }));
|
|
3394
|
-
}), e.refRule.__$title =
|
|
3405
|
+
}), e.refRule.__$title = ge(() => {
|
|
3395
3406
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3396
3407
|
if (i) {
|
|
3397
3408
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3398
3409
|
s && (i = this.api.t(s[1]));
|
|
3399
3410
|
}
|
|
3400
3411
|
return i;
|
|
3401
|
-
}), e.refRule.__$info =
|
|
3412
|
+
}), e.refRule.__$info = ge(() => {
|
|
3402
3413
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3403
3414
|
if (i) {
|
|
3404
3415
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3405
3416
|
s && (i = this.api.t(s[1]));
|
|
3406
3417
|
}
|
|
3407
3418
|
return i;
|
|
3408
|
-
}), e.refRule.__$validate =
|
|
3419
|
+
}), e.refRule.__$validate = ge(() => G(e.rule.validate).map((i) => {
|
|
3420
|
+
var n, o;
|
|
3409
3421
|
const s = b({}, i);
|
|
3410
3422
|
if (s.message) {
|
|
3411
|
-
const
|
|
3412
|
-
|
|
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 }));
|
|
3413
3425
|
}
|
|
3414
3426
|
if (h.Function(s.validator)) {
|
|
3415
|
-
const
|
|
3416
|
-
return s.validator = function(...
|
|
3427
|
+
const a = e;
|
|
3428
|
+
return s.validator = function(...l) {
|
|
3417
3429
|
return i.validator.call({
|
|
3418
3430
|
that: this,
|
|
3419
|
-
id:
|
|
3420
|
-
field:
|
|
3421
|
-
rule:
|
|
3422
|
-
api:
|
|
3423
|
-
}, ...
|
|
3431
|
+
id: a.id,
|
|
3432
|
+
field: a.field,
|
|
3433
|
+
rule: a.rule,
|
|
3434
|
+
api: a.$handle.api
|
|
3435
|
+
}, ...l);
|
|
3424
3436
|
}, s;
|
|
3425
3437
|
}
|
|
3426
3438
|
return s;
|
|
3427
3439
|
})), e.input) {
|
|
3428
3440
|
const i = Ee(e.rule, "value");
|
|
3429
|
-
e.watch.push(
|
|
3441
|
+
e.watch.push(B(() => i.value, () => {
|
|
3430
3442
|
let s = e.parser.toFormValue(i.value, e);
|
|
3431
3443
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
3432
3444
|
}));
|
|
@@ -3435,15 +3447,15 @@ function hi(t) {
|
|
|
3435
3447
|
let i = e.rule.computed;
|
|
3436
3448
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3437
3449
|
let n;
|
|
3438
|
-
const o =
|
|
3450
|
+
const o = ge(() => {
|
|
3439
3451
|
const l = i[s];
|
|
3440
3452
|
if (!l) return;
|
|
3441
3453
|
const u = this.compute(e, l);
|
|
3442
3454
|
return l.linkage && u === void 0 ? n : u;
|
|
3443
3455
|
}), a = (l) => {
|
|
3444
|
-
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);
|
|
3445
3457
|
};
|
|
3446
|
-
(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) => {
|
|
3447
3459
|
n = l, setTimeout(() => {
|
|
3448
3460
|
a(l);
|
|
3449
3461
|
});
|
|
@@ -3468,8 +3480,8 @@ function hi(t) {
|
|
|
3468
3480
|
g = dt(d.field || "");
|
|
3469
3481
|
else
|
|
3470
3482
|
return !0;
|
|
3471
|
-
let
|
|
3472
|
-
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)
|
|
3473
3485
|
return !0;
|
|
3474
3486
|
l || (u = u && m);
|
|
3475
3487
|
}
|
|
@@ -3494,7 +3506,7 @@ function hi(t) {
|
|
|
3494
3506
|
fc: s.fc
|
|
3495
3507
|
}, ...l);
|
|
3496
3508
|
}, o), {});
|
|
3497
|
-
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);
|
|
3498
3510
|
},
|
|
3499
3511
|
updateChildren(e, r, i) {
|
|
3500
3512
|
this.deferSyncValue(() => {
|
|
@@ -3511,9 +3523,9 @@ function hi(t) {
|
|
|
3511
3523
|
rmCtx(e) {
|
|
3512
3524
|
if (e.deleted) return;
|
|
3513
3525
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3514
|
-
|
|
3526
|
+
re(this.ctxs, r), re(this.formData, r), re(this.subForm, r), re(this.vm.ctxInject, r);
|
|
3515
3527
|
const o = e.getParentGroup();
|
|
3516
|
-
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(() => {
|
|
3517
3529
|
if (!this.reloading) {
|
|
3518
3530
|
if (e.parser.loadChildren !== !1) {
|
|
3519
3531
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3528,7 +3540,7 @@ function hi(t) {
|
|
|
3528
3540
|
});
|
|
3529
3541
|
}
|
|
3530
3542
|
function di(t) {
|
|
3531
|
-
|
|
3543
|
+
C(t.prototype, {
|
|
3532
3544
|
mounted() {
|
|
3533
3545
|
const e = () => {
|
|
3534
3546
|
this.isMounted = !0, this.lifecycle("mounted");
|
|
@@ -3541,7 +3553,7 @@ function di(t) {
|
|
|
3541
3553
|
emitEvent(e, ...r) {
|
|
3542
3554
|
const i = this.options[e] || this.options[q("on-" + e)];
|
|
3543
3555
|
if (i) {
|
|
3544
|
-
const s =
|
|
3556
|
+
const s = z(i);
|
|
3545
3557
|
h.Function(s) && O(() => s(...r));
|
|
3546
3558
|
}
|
|
3547
3559
|
this.bus.$emit(e, ...r);
|
|
@@ -3550,13 +3562,13 @@ function di(t) {
|
|
|
3550
3562
|
var n, o;
|
|
3551
3563
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3552
3564
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3553
|
-
O(() => a(U(b({}, i || {}), { rule: e.rule, api: this.api })));
|
|
3565
|
+
O(() => a(U(b({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
|
|
3554
3566
|
}));
|
|
3555
3567
|
}
|
|
3556
3568
|
});
|
|
3557
3569
|
}
|
|
3558
3570
|
function pi(t) {
|
|
3559
|
-
|
|
3571
|
+
C(t.prototype, {
|
|
3560
3572
|
useProvider() {
|
|
3561
3573
|
const e = this.fc.providers;
|
|
3562
3574
|
Object.keys(e).forEach((r) => {
|
|
@@ -3577,7 +3589,7 @@ function pi(t) {
|
|
|
3577
3589
|
let r = {
|
|
3578
3590
|
required: () => {
|
|
3579
3591
|
var i, s;
|
|
3580
|
-
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;
|
|
3581
3593
|
}
|
|
3582
3594
|
};
|
|
3583
3595
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3585,7 +3597,7 @@ function pi(t) {
|
|
|
3585
3597
|
}), Object.keys(e.rule).forEach((i) => {
|
|
3586
3598
|
i[0] === "$" && (r[i.substr(1)] = () => e.rule[i]);
|
|
3587
3599
|
}), Object.keys(r).forEach((i) => {
|
|
3588
|
-
e.watch.push(
|
|
3600
|
+
e.watch.push(B(r[i], (s) => {
|
|
3589
3601
|
this.effect(e, "watch", { [i]: s });
|
|
3590
3602
|
}, { deep: !0 }));
|
|
3591
3603
|
});
|
|
@@ -3607,9 +3619,9 @@ function pi(t) {
|
|
|
3607
3619
|
}, r);
|
|
3608
3620
|
},
|
|
3609
3621
|
getEffect(e, r) {
|
|
3610
|
-
if (
|
|
3622
|
+
if (E(e, "$" + r))
|
|
3611
3623
|
return e["$" + r];
|
|
3612
|
-
if (
|
|
3624
|
+
if (E(e, "effect") && E(e.effect, r))
|
|
3613
3625
|
return e.effect[r];
|
|
3614
3626
|
},
|
|
3615
3627
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3626,7 +3638,7 @@ function pi(t) {
|
|
|
3626
3638
|
else
|
|
3627
3639
|
return;
|
|
3628
3640
|
const m = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3629
|
-
e && (m.getProp = () => e.effectData(u), m.clearProp = () => e.clearEffectData(u), m.mergeProp = (g) =>
|
|
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]);
|
|
3630
3642
|
});
|
|
3631
3643
|
}
|
|
3632
3644
|
});
|
|
@@ -3643,7 +3655,7 @@ function gi(t) {
|
|
|
3643
3655
|
return r.length ? r : !1;
|
|
3644
3656
|
} else return h.String(e) ? [e] : !1;
|
|
3645
3657
|
}
|
|
3646
|
-
function
|
|
3658
|
+
function K(t) {
|
|
3647
3659
|
Lt(this, {
|
|
3648
3660
|
options() {
|
|
3649
3661
|
return t.options.value || {};
|
|
@@ -3654,7 +3666,7 @@ function z(t) {
|
|
|
3654
3666
|
preview() {
|
|
3655
3667
|
return t.vm.$options.propsData.preview != null ? t.vm.$options.propsData.preview : t.options.value.preview || !1;
|
|
3656
3668
|
}
|
|
3657
|
-
}),
|
|
3669
|
+
}), C(this, {
|
|
3658
3670
|
fc: t,
|
|
3659
3671
|
vm: t.vm,
|
|
3660
3672
|
watching: !1,
|
|
@@ -3663,10 +3675,10 @@ function z(t) {
|
|
|
3663
3675
|
noWatchFn: null,
|
|
3664
3676
|
deferSyncFn: null,
|
|
3665
3677
|
isMounted: !1,
|
|
3666
|
-
formData:
|
|
3667
|
-
subRuleData:
|
|
3678
|
+
formData: ie({}),
|
|
3679
|
+
subRuleData: ie({}),
|
|
3668
3680
|
subForm: {},
|
|
3669
|
-
form:
|
|
3681
|
+
form: ie({}),
|
|
3670
3682
|
appendData: {},
|
|
3671
3683
|
ignoreFields: [],
|
|
3672
3684
|
providers: {},
|
|
@@ -3680,12 +3692,12 @@ function z(t) {
|
|
|
3680
3692
|
}
|
|
3681
3693
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3682
3694
|
const i = O(() => r(e, this));
|
|
3683
|
-
return i && i !== e &&
|
|
3695
|
+
return i && i !== e && C(e, i), e;
|
|
3684
3696
|
}, Zr(this));
|
|
3685
3697
|
}
|
|
3686
|
-
|
|
3698
|
+
C(K.prototype, {
|
|
3687
3699
|
initData(t) {
|
|
3688
|
-
|
|
3700
|
+
C(this, {
|
|
3689
3701
|
ctxs: {},
|
|
3690
3702
|
fieldCtx: {},
|
|
3691
3703
|
nameCtx: {},
|
|
@@ -3702,21 +3714,27 @@ _(z.prototype, {
|
|
|
3702
3714
|
isBreakWatch() {
|
|
3703
3715
|
return this.loading || this.noWatchFn || this.reloading;
|
|
3704
3716
|
},
|
|
3705
|
-
|
|
3706
|
-
return new Promise((e) => {
|
|
3707
|
-
const
|
|
3708
|
-
|
|
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();
|
|
3709
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));
|
|
3710
3728
|
}
|
|
3711
3729
|
});
|
|
3712
|
-
ti(
|
|
3713
|
-
ri(
|
|
3714
|
-
ni(
|
|
3715
|
-
oi(
|
|
3716
|
-
fi(
|
|
3717
|
-
hi(
|
|
3718
|
-
di(
|
|
3719
|
-
pi(
|
|
3730
|
+
ti(K);
|
|
3731
|
+
ri(K);
|
|
3732
|
+
ni(K);
|
|
3733
|
+
oi(K);
|
|
3734
|
+
fi(K);
|
|
3735
|
+
hi(K);
|
|
3736
|
+
di(K);
|
|
3737
|
+
pi(K);
|
|
3720
3738
|
const yi = "fcFragment", Te = {
|
|
3721
3739
|
name: yi,
|
|
3722
3740
|
functional: !0,
|
|
@@ -3733,13 +3751,13 @@ function vi() {
|
|
|
3733
3751
|
function e(r) {
|
|
3734
3752
|
r && this.setVm(r);
|
|
3735
3753
|
}
|
|
3736
|
-
return
|
|
3754
|
+
return C(e.prototype, {
|
|
3737
3755
|
setVm(r) {
|
|
3738
3756
|
this.vm = r, this.h = this.$h = r.$createElement;
|
|
3739
3757
|
},
|
|
3740
3758
|
make(r, i, s) {
|
|
3741
3759
|
var n, o, a;
|
|
3742
|
-
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);
|
|
3743
3761
|
},
|
|
3744
3762
|
makeComponent(r, i, s) {
|
|
3745
3763
|
var o;
|
|
@@ -3753,14 +3771,14 @@ function vi() {
|
|
|
3753
3771
|
return n.context = this.vm, n;
|
|
3754
3772
|
},
|
|
3755
3773
|
aliasMap: t
|
|
3756
|
-
}),
|
|
3774
|
+
}), C(e, {
|
|
3757
3775
|
aliasMap: t,
|
|
3758
3776
|
alias(r, i) {
|
|
3759
3777
|
t[r] = i;
|
|
3760
3778
|
},
|
|
3761
3779
|
use(r) {
|
|
3762
3780
|
Object.keys(r).forEach((i) => {
|
|
3763
|
-
const s =
|
|
3781
|
+
const s = ve(i), n = Gr(i).toLocaleLowerCase(), o = r[i];
|
|
3764
3782
|
[i, s, n].forEach((a) => {
|
|
3765
3783
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3766
3784
|
return this.make(o, l, u);
|
|
@@ -3776,7 +3794,7 @@ function bi(t) {
|
|
|
3776
3794
|
return Object.assign(e.prototype, t), e;
|
|
3777
3795
|
}
|
|
3778
3796
|
function Ht(t) {
|
|
3779
|
-
|
|
3797
|
+
C(this, {
|
|
3780
3798
|
$handle: t,
|
|
3781
3799
|
vm: t.vm,
|
|
3782
3800
|
options: {},
|
|
@@ -3786,7 +3804,7 @@ function Ht(t) {
|
|
|
3786
3804
|
}
|
|
3787
3805
|
}), this.updateKey(), this.init();
|
|
3788
3806
|
}
|
|
3789
|
-
|
|
3807
|
+
C(Ht.prototype, {
|
|
3790
3808
|
__init() {
|
|
3791
3809
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3792
3810
|
},
|
|
@@ -3813,7 +3831,7 @@ _(Ht.prototype, {
|
|
|
3813
3831
|
return e(this.vm);
|
|
3814
3832
|
},
|
|
3815
3833
|
mergeOptions(t, e) {
|
|
3816
|
-
return
|
|
3834
|
+
return Y(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3817
3835
|
},
|
|
3818
3836
|
updateOptions(t) {
|
|
3819
3837
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3835,7 +3853,7 @@ const _i = function(t) {
|
|
|
3835
3853
|
const e = {
|
|
3836
3854
|
name: "loadData",
|
|
3837
3855
|
_fn: [],
|
|
3838
|
-
|
|
3856
|
+
mounted(r, i, s) {
|
|
3839
3857
|
this.deleted(r);
|
|
3840
3858
|
let n = G(r.getValue());
|
|
3841
3859
|
const o = [];
|
|
@@ -3843,12 +3861,12 @@ const _i = function(t) {
|
|
|
3843
3861
|
if (a && (a.attr || a.template)) {
|
|
3844
3862
|
let l = (d) => {
|
|
3845
3863
|
let m;
|
|
3846
|
-
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 =
|
|
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));
|
|
3847
3865
|
const g = a.modify ? i : r.getProp();
|
|
3848
|
-
a.to === "child" ? g.children ?
|
|
3866
|
+
a.to === "child" ? g.children ? S(g.children, 0, m) : S(g, "children", [m]) : se(g, a.to || "options", m), s.sync(i);
|
|
3849
3867
|
}, u = (d) => l(d);
|
|
3850
3868
|
const f = t.watchLoadData(u);
|
|
3851
|
-
l =
|
|
3869
|
+
l = ne(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3852
3870
|
}
|
|
3853
3871
|
}), this._fn[r.id] = o;
|
|
3854
3872
|
},
|
|
@@ -3872,12 +3890,12 @@ const _i = function(t) {
|
|
|
3872
3890
|
if (l) {
|
|
3873
3891
|
const u = typeof l == "object";
|
|
3874
3892
|
let f = (g) => {
|
|
3875
|
-
let
|
|
3876
|
-
const
|
|
3877
|
-
a === "child" ?
|
|
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);
|
|
3878
3896
|
}, d = (g) => f(g);
|
|
3879
3897
|
const m = t.watchLoadData(d);
|
|
3880
|
-
f =
|
|
3898
|
+
f = ne(f, l.wait || 300), l.watch !== !1 ? o.push(m) : m();
|
|
3881
3899
|
}
|
|
3882
3900
|
}), this._fn[r.id] = o;
|
|
3883
3901
|
},
|
|
@@ -3899,7 +3917,7 @@ const _i = function(t) {
|
|
|
3899
3917
|
const s = i.method;
|
|
3900
3918
|
delete i.method, t.getProp().validate = [U(b({}, i), {
|
|
3901
3919
|
validator(...n) {
|
|
3902
|
-
const o =
|
|
3920
|
+
const o = Z(e);
|
|
3903
3921
|
if (o)
|
|
3904
3922
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3905
3923
|
attr: t,
|
|
@@ -3924,13 +3942,13 @@ const _i = function(t) {
|
|
|
3924
3942
|
let a = s.value;
|
|
3925
3943
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3926
3944
|
const l = (d) => {
|
|
3927
|
-
d === void 0 ? s.clearProp() :
|
|
3945
|
+
d === void 0 ? s.clearProp() : se(s.getProp(), a.to || "options", d), o.sync(n);
|
|
3928
3946
|
};
|
|
3929
3947
|
if (!a || !a.action && !a.key) {
|
|
3930
3948
|
l(void 0);
|
|
3931
3949
|
return;
|
|
3932
3950
|
}
|
|
3933
|
-
if (a =
|
|
3951
|
+
if (a = W(a), a.to || (a.to = "options"), a.key) {
|
|
3934
3952
|
const d = t.$handle.options.globalData[a.key];
|
|
3935
3953
|
if (!d) {
|
|
3936
3954
|
l(void 0);
|
|
@@ -3946,32 +3964,32 @@ const _i = function(t) {
|
|
|
3946
3964
|
if (!s.getValue())
|
|
3947
3965
|
return s.clearProp(), o.sync(n), !0;
|
|
3948
3966
|
};
|
|
3949
|
-
i._fn[s.id] = t.watchLoadData(
|
|
3967
|
+
i._fn[s.id] = t.watchLoadData(ne((d, m) => {
|
|
3950
3968
|
if (m && a.watch === !1)
|
|
3951
3969
|
return i._fn[s.id]();
|
|
3952
|
-
const g = t.$handle.loadFetchVar(
|
|
3970
|
+
const g = t.$handle.loadFetchVar(W(a), d, n), $ = U(b({
|
|
3953
3971
|
headers: {}
|
|
3954
3972
|
}, g), {
|
|
3955
|
-
onSuccess(
|
|
3973
|
+
onSuccess(_, D) {
|
|
3956
3974
|
if (f()) return;
|
|
3957
|
-
let
|
|
3958
|
-
const V =
|
|
3959
|
-
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);
|
|
3960
3978
|
},
|
|
3961
|
-
onError(
|
|
3962
|
-
l(void 0), !f() && (u || ((
|
|
3979
|
+
onError(_) {
|
|
3980
|
+
l(void 0), !f() && (u || ((D) => xe(D.message || "fetch fail " + g.action)))(_, n, o);
|
|
3963
3981
|
}
|
|
3964
3982
|
});
|
|
3965
|
-
t.$handle.beforeFetch(
|
|
3983
|
+
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
3966
3984
|
if (h.Function(g.action)) {
|
|
3967
|
-
g.action(n, o).then((
|
|
3968
|
-
|
|
3969
|
-
}).catch((
|
|
3970
|
-
|
|
3985
|
+
g.action(n, o).then((_) => {
|
|
3986
|
+
$.onSuccess(_, !0);
|
|
3987
|
+
}).catch((_) => {
|
|
3988
|
+
$.onError(_);
|
|
3971
3989
|
});
|
|
3972
3990
|
return;
|
|
3973
3991
|
}
|
|
3974
|
-
O(() => t.create.fetch(
|
|
3992
|
+
O(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
3975
3993
|
});
|
|
3976
3994
|
}, a.wait || 600));
|
|
3977
3995
|
}
|
|
@@ -3995,7 +4013,7 @@ const _i = function(t) {
|
|
|
3995
4013
|
t: Ci,
|
|
3996
4014
|
componentValidate: Jt
|
|
3997
4015
|
};
|
|
3998
|
-
function
|
|
4016
|
+
function Fi(t) {
|
|
3999
4017
|
t = t || /* @__PURE__ */ new Map();
|
|
4000
4018
|
const e = {
|
|
4001
4019
|
$on(r, i) {
|
|
@@ -4019,8 +4037,8 @@ function Si(t) {
|
|
|
4019
4037
|
};
|
|
4020
4038
|
return e;
|
|
4021
4039
|
}
|
|
4022
|
-
const
|
|
4023
|
-
name:
|
|
4040
|
+
const Si = "html", Ri = {
|
|
4041
|
+
name: Si,
|
|
4024
4042
|
loadChildren: !1,
|
|
4025
4043
|
render(t, e) {
|
|
4026
4044
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
@@ -4072,7 +4090,7 @@ function it(t, e) {
|
|
|
4072
4090
|
return null;
|
|
4073
4091
|
const r = e.split(".");
|
|
4074
4092
|
let i = t(r.shift());
|
|
4075
|
-
return r.length ? i == null ? null :
|
|
4093
|
+
return r.length ? i == null ? null : L(i, r) : i;
|
|
4076
4094
|
}
|
|
4077
4095
|
function ji(t) {
|
|
4078
4096
|
return it(ki, t);
|
|
@@ -4109,7 +4127,7 @@ function Li(t) {
|
|
|
4109
4127
|
jt.push(...e), Ze.push(...r), Ye.push(...i), Nt([...e, ...r, ...i]);
|
|
4110
4128
|
}
|
|
4111
4129
|
let Ti = 1;
|
|
4112
|
-
const M = {},
|
|
4130
|
+
const M = {}, Se = Symbol("defValue");
|
|
4113
4131
|
function Wt(t) {
|
|
4114
4132
|
const e = {
|
|
4115
4133
|
[Te.name]: Te
|
|
@@ -4117,11 +4135,11 @@ function Wt(t) {
|
|
|
4117
4135
|
t.extendApi
|
|
4118
4136
|
], u = b({}, Oi), f = Xr();
|
|
4119
4137
|
let d = { global: {} };
|
|
4120
|
-
const m = t.isMobile === !0, g =
|
|
4138
|
+
const m = t.isMobile === !0, g = ie({
|
|
4121
4139
|
$mobile: m
|
|
4122
|
-
}),
|
|
4140
|
+
}), $ = vi(), _ = {}, D = {};
|
|
4123
4141
|
Li(t.attrs || {});
|
|
4124
|
-
function
|
|
4142
|
+
function ee(c) {
|
|
4125
4143
|
const p = M[c];
|
|
4126
4144
|
if (Array.isArray(p))
|
|
4127
4145
|
return p.map((y) => y.api());
|
|
@@ -4131,51 +4149,51 @@ function Wt(t) {
|
|
|
4131
4149
|
function V(c) {
|
|
4132
4150
|
o.push(c);
|
|
4133
4151
|
}
|
|
4134
|
-
function
|
|
4152
|
+
function T() {
|
|
4135
4153
|
const c = Ne(...arguments);
|
|
4136
4154
|
c.id && c.prop && (i[c.id] = c.prop);
|
|
4137
4155
|
}
|
|
4138
|
-
function
|
|
4156
|
+
function ce() {
|
|
4139
4157
|
const c = Ne(...arguments);
|
|
4140
4158
|
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(b({}, c.prop), {
|
|
4141
4159
|
name: c.id
|
|
4142
4160
|
}));
|
|
4143
4161
|
}
|
|
4144
|
-
function
|
|
4145
|
-
|
|
4162
|
+
function Ae(c) {
|
|
4163
|
+
$.use(c);
|
|
4146
4164
|
}
|
|
4147
|
-
function
|
|
4165
|
+
function he() {
|
|
4148
4166
|
const c = Ne(...arguments);
|
|
4149
4167
|
if (!c.id || !c.prop) return ke;
|
|
4150
|
-
const p = q(c.id), y = c.prop,
|
|
4151
|
-
r[p] =
|
|
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);
|
|
4152
4170
|
}
|
|
4153
|
-
function
|
|
4171
|
+
function F(c, p) {
|
|
4154
4172
|
let y;
|
|
4155
4173
|
if (h.String(c)) {
|
|
4156
4174
|
if (y = c, p === void 0)
|
|
4157
|
-
return ["form-create", "formcreate"].indexOf(y) > -1 ?
|
|
4175
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? R() : e[y];
|
|
4158
4176
|
} else
|
|
4159
4177
|
y = q(c.name), p = c;
|
|
4160
4178
|
if (!y || !p) return;
|
|
4161
|
-
const
|
|
4162
|
-
e[y] = p, e[
|
|
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);
|
|
4163
4181
|
}
|
|
4164
|
-
function
|
|
4182
|
+
function R() {
|
|
4165
4183
|
return Mr(Pe, e, i);
|
|
4166
4184
|
}
|
|
4167
|
-
function
|
|
4185
|
+
function N() {
|
|
4168
4186
|
return Te;
|
|
4169
4187
|
}
|
|
4170
|
-
function
|
|
4171
|
-
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;
|
|
4172
4190
|
}
|
|
4173
|
-
function
|
|
4174
|
-
let
|
|
4175
|
-
const
|
|
4176
|
-
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();
|
|
4177
4195
|
}
|
|
4178
|
-
|
|
4196
|
+
Fe(H, D);
|
|
4179
4197
|
function Kt(c) {
|
|
4180
4198
|
let p = b({}, t);
|
|
4181
4199
|
return c ? p.inherit = {
|
|
@@ -4186,7 +4204,7 @@ function Wt(t) {
|
|
|
4186
4204
|
providers: u,
|
|
4187
4205
|
useApps: o,
|
|
4188
4206
|
maker: f,
|
|
4189
|
-
formulas:
|
|
4207
|
+
formulas: _,
|
|
4190
4208
|
loadData: g
|
|
4191
4209
|
} : delete p.inherit, Wt(p);
|
|
4192
4210
|
}
|
|
@@ -4194,35 +4212,35 @@ function Wt(t) {
|
|
|
4194
4212
|
s[c] = p;
|
|
4195
4213
|
}
|
|
4196
4214
|
function Qt(c, p) {
|
|
4197
|
-
|
|
4215
|
+
_[c] = p;
|
|
4198
4216
|
}
|
|
4199
4217
|
function Zt(c, p) {
|
|
4200
|
-
const y = n[c] || {},
|
|
4201
|
-
p.parsers && Object.keys(p.parsers).forEach((
|
|
4202
|
-
|
|
4203
|
-
}), p.name = c, n[c] = U(b(b({}, y), p), { parsers:
|
|
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 });
|
|
4204
4222
|
}
|
|
4205
4223
|
function _e(c) {
|
|
4206
4224
|
c && Object.keys(M).forEach((p) => {
|
|
4207
|
-
(Array.isArray(M[p]) ? M[p] : [M[p]]).forEach((
|
|
4208
|
-
|
|
4225
|
+
(Array.isArray(M[p]) ? M[p] : [M[p]]).forEach((v) => {
|
|
4226
|
+
v.bus.$emit("$loadData." + c);
|
|
4209
4227
|
});
|
|
4210
4228
|
});
|
|
4211
4229
|
}
|
|
4212
4230
|
function Ve(c, p) {
|
|
4213
|
-
|
|
4231
|
+
se(g, c, p), _e(c);
|
|
4214
4232
|
}
|
|
4215
4233
|
function Ce(c, p) {
|
|
4216
|
-
const y = (
|
|
4234
|
+
const y = (...v) => O(() => p(...v));
|
|
4217
4235
|
y._driver = !0, Ve(c, y);
|
|
4218
4236
|
}
|
|
4219
4237
|
function nt(c, p) {
|
|
4220
4238
|
const y = (c || "").split(".");
|
|
4221
4239
|
c = y.shift();
|
|
4222
|
-
const
|
|
4223
|
-
if (
|
|
4224
|
-
let
|
|
4225
|
-
return
|
|
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;
|
|
4226
4244
|
} else
|
|
4227
4245
|
return p;
|
|
4228
4246
|
}
|
|
@@ -4236,15 +4254,15 @@ function Wt(t) {
|
|
|
4236
4254
|
a.push({ name: c, callback: p });
|
|
4237
4255
|
}
|
|
4238
4256
|
function Pe(c) {
|
|
4239
|
-
|
|
4257
|
+
C(this, {
|
|
4240
4258
|
id: Ti++,
|
|
4241
|
-
create:
|
|
4259
|
+
create: H,
|
|
4242
4260
|
vm: c,
|
|
4243
4261
|
manager: bi(t.manager),
|
|
4244
4262
|
parsers: r,
|
|
4245
4263
|
providers: u,
|
|
4246
4264
|
modelFields: s,
|
|
4247
|
-
formulas:
|
|
4265
|
+
formulas: _,
|
|
4248
4266
|
isMobile: m,
|
|
4249
4267
|
rules: c.$options.propsData.rule,
|
|
4250
4268
|
name: c.$options.propsData.name || Ie(),
|
|
@@ -4253,28 +4271,29 @@ function Wt(t) {
|
|
|
4253
4271
|
components: e,
|
|
4254
4272
|
directives: i
|
|
4255
4273
|
},
|
|
4274
|
+
get: null,
|
|
4256
4275
|
drivers: n,
|
|
4257
4276
|
renderDriver: null,
|
|
4258
4277
|
refreshData: _e,
|
|
4259
4278
|
loadData: g,
|
|
4260
|
-
CreateNode:
|
|
4261
|
-
bus: new
|
|
4279
|
+
CreateNode: $,
|
|
4280
|
+
bus: new Fi(),
|
|
4262
4281
|
unwatch: [],
|
|
4263
4282
|
options: mr({}),
|
|
4264
4283
|
extendApiFn: l,
|
|
4265
4284
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4266
|
-
tmpData:
|
|
4285
|
+
tmpData: ie({})
|
|
4267
4286
|
}), a.forEach((p) => {
|
|
4268
4287
|
this.bus.$on(p.name, p.callback);
|
|
4269
4288
|
}), P(() => {
|
|
4270
|
-
|
|
4289
|
+
B(this.options, () => {
|
|
4271
4290
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4272
4291
|
}, { deep: !0 });
|
|
4273
|
-
}),
|
|
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);
|
|
4274
4293
|
}
|
|
4275
|
-
Pe.isMobile = m,
|
|
4294
|
+
Pe.isMobile = m, C(Pe.prototype, {
|
|
4276
4295
|
init() {
|
|
4277
|
-
this.isSub() && this.unwatch.push(
|
|
4296
|
+
this.isSub() && this.unwatch.push(B(() => this.vm.parent.fc.options.value, () => {
|
|
4278
4297
|
this.initOptions(), this.$handle.api.refresh();
|
|
4279
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();
|
|
4280
4299
|
},
|
|
@@ -4283,48 +4302,48 @@ function Wt(t) {
|
|
|
4283
4302
|
return O(() => this.renderDriver[c](...p));
|
|
4284
4303
|
},
|
|
4285
4304
|
t(c, p, y) {
|
|
4286
|
-
let
|
|
4287
|
-
return
|
|
4288
|
-
const
|
|
4289
|
-
|
|
4290
|
-
}),
|
|
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;
|
|
4291
4310
|
},
|
|
4292
4311
|
globalDataDriver(c) {
|
|
4293
4312
|
let p = c.split(".");
|
|
4294
|
-
const y = p.shift(),
|
|
4295
|
-
if (
|
|
4296
|
-
if (
|
|
4297
|
-
return
|
|
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);
|
|
4298
4317
|
{
|
|
4299
|
-
let
|
|
4300
|
-
const
|
|
4301
|
-
if (
|
|
4302
|
-
if (
|
|
4303
|
-
return
|
|
4304
|
-
|
|
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);
|
|
4305
4324
|
} else
|
|
4306
|
-
this.fetchCache.set(
|
|
4307
|
-
const
|
|
4325
|
+
this.fetchCache.set(v, { status: !1 });
|
|
4326
|
+
const k = ne(() => {
|
|
4308
4327
|
le();
|
|
4309
|
-
const
|
|
4310
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(
|
|
4311
|
-
},
|
|
4312
|
-
this.fetchCache.set(
|
|
4313
|
-
},
|
|
4314
|
-
if (ue &&
|
|
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)
|
|
4315
4334
|
return le();
|
|
4316
4335
|
if (ue) {
|
|
4317
|
-
|
|
4336
|
+
k();
|
|
4318
4337
|
return;
|
|
4319
4338
|
}
|
|
4320
|
-
const
|
|
4321
|
-
this.$handle.api.fetch(
|
|
4322
|
-
ae(
|
|
4323
|
-
}).catch((
|
|
4339
|
+
const pe = this.$handle.loadFetchVar(Je(v), J);
|
|
4340
|
+
this.$handle.api.fetch(pe).then((te) => {
|
|
4341
|
+
ae(te);
|
|
4342
|
+
}).catch((te) => {
|
|
4324
4343
|
ae(null);
|
|
4325
4344
|
});
|
|
4326
|
-
}, le = this.watchLoadData(
|
|
4327
|
-
return this.unwatch.push(le),
|
|
4345
|
+
}, le = this.watchLoadData(X);
|
|
4346
|
+
return this.unwatch.push(le), w;
|
|
4328
4347
|
}
|
|
4329
4348
|
}
|
|
4330
4349
|
},
|
|
@@ -4334,89 +4353,91 @@ function Wt(t) {
|
|
|
4334
4353
|
},
|
|
4335
4354
|
globalLanguageDriver(c) {
|
|
4336
4355
|
let p = this.vm.top.$props.locale, y;
|
|
4337
|
-
if (p && typeof p == "object" && (y =
|
|
4338
|
-
const
|
|
4339
|
-
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);
|
|
4340
4359
|
}
|
|
4341
4360
|
return y;
|
|
4342
4361
|
},
|
|
4343
4362
|
globalVarDriver(c) {
|
|
4344
|
-
const y = c.split(".").shift(),
|
|
4345
|
-
if (
|
|
4346
|
-
const
|
|
4347
|
-
if (
|
|
4348
|
-
let
|
|
4349
|
-
const
|
|
4350
|
-
|
|
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);
|
|
4351
4370
|
});
|
|
4352
|
-
return this.unwatch.push(
|
|
4371
|
+
return this.unwatch.push(k), j;
|
|
4353
4372
|
}
|
|
4354
4373
|
}
|
|
4355
4374
|
},
|
|
4356
4375
|
setData(c, p, y) {
|
|
4357
|
-
y ? Ve(c, p) : (
|
|
4376
|
+
y ? Ve(c, p) : (se(this.vm.top.fc.tmpData, c, p), this.bus.$emit("$loadData." + c));
|
|
4358
4377
|
},
|
|
4359
4378
|
getLoadData(c, p) {
|
|
4360
4379
|
let y = null;
|
|
4361
4380
|
if (c != null) {
|
|
4362
|
-
let
|
|
4363
|
-
const
|
|
4364
|
-
if (
|
|
4365
|
-
y = this.$handle.api.top.formData();
|
|
4366
|
-
else if (
|
|
4367
|
-
y = this.$handle.api.formData();
|
|
4368
|
-
else if (
|
|
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")
|
|
4369
4390
|
y = this.options.value;
|
|
4370
|
-
else if (
|
|
4371
|
-
y = this.globalDataDriver(
|
|
4372
|
-
else if (
|
|
4373
|
-
y = this.globalVarDriver(
|
|
4374
|
-
else if (
|
|
4375
|
-
y = this.getLocale(),
|
|
4376
|
-
else if (
|
|
4377
|
-
y = this.globalLanguageDriver(
|
|
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 = [];
|
|
4378
4399
|
else {
|
|
4379
|
-
if (
|
|
4400
|
+
if (w === "$preview")
|
|
4380
4401
|
return this.$handle.preview;
|
|
4381
4402
|
{
|
|
4382
|
-
const
|
|
4383
|
-
|
|
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 = [];
|
|
4384
4405
|
}
|
|
4385
4406
|
}
|
|
4386
|
-
y &&
|
|
4407
|
+
y && v.length && (y = L(y, v));
|
|
4387
4408
|
}
|
|
4388
4409
|
return y == null || y === "" ? p : y;
|
|
4389
4410
|
},
|
|
4390
4411
|
watchLoadData(c, p) {
|
|
4391
4412
|
let y = {};
|
|
4392
|
-
const
|
|
4393
|
-
O(() => {
|
|
4394
|
-
c(
|
|
4395
|
-
});
|
|
4396
|
-
},
|
|
4397
|
-
let
|
|
4398
|
-
if (typeof
|
|
4399
|
-
return y[
|
|
4400
|
-
const le =
|
|
4401
|
-
const Be =
|
|
4402
|
-
if (y[
|
|
4403
|
-
JSON.stringify(Be) !== JSON.stringify(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));
|
|
4404
4425
|
else return;
|
|
4405
|
-
}, p || 0), rr =
|
|
4406
|
-
|
|
4426
|
+
}, p || 0), rr = B(le, (Be) => {
|
|
4427
|
+
te();
|
|
4407
4428
|
});
|
|
4408
|
-
return this.bus.$on("$loadData." + ue,
|
|
4429
|
+
return this.bus.$on("$loadData." + ue, te), pe && this.bus.$on("$loadData." + ue + "." + pe, te), y[k] = {
|
|
4409
4430
|
fn: () => {
|
|
4410
|
-
this.bus.$off("$loadData." + ue,
|
|
4431
|
+
this.bus.$off("$loadData." + ue, te), pe && this.bus.$off("$loadData." + ue + "." + pe, te), rr();
|
|
4411
4432
|
},
|
|
4412
4433
|
val: le.value
|
|
4413
4434
|
}, le.value;
|
|
4414
4435
|
};
|
|
4415
|
-
|
|
4416
|
-
const
|
|
4417
|
-
Object.keys(y).forEach((
|
|
4436
|
+
v(!1);
|
|
4437
|
+
const j = () => {
|
|
4438
|
+
Object.keys(y).forEach((k) => y[k].fn()), y = {};
|
|
4418
4439
|
};
|
|
4419
|
-
return this.unwatch.push(
|
|
4440
|
+
return this.unwatch.push(j), j;
|
|
4420
4441
|
},
|
|
4421
4442
|
isSub() {
|
|
4422
4443
|
return this.vm.parent && this.vm.extendOption;
|
|
@@ -4429,12 +4450,12 @@ function Wt(t) {
|
|
|
4429
4450
|
resetBtn: {},
|
|
4430
4451
|
globalEvent: {},
|
|
4431
4452
|
globalData: {}
|
|
4432
|
-
},
|
|
4453
|
+
}, W(d));
|
|
4433
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);
|
|
4434
4455
|
},
|
|
4435
4456
|
mergeOptions(c, p, y) {
|
|
4436
|
-
return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((
|
|
4437
|
-
delete p[
|
|
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];
|
|
4438
4459
|
}), p.global && (c.global = Jr(c.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], c), c;
|
|
4439
4460
|
},
|
|
4440
4461
|
updateOptions(c) {
|
|
@@ -4465,7 +4486,7 @@ function Wt(t) {
|
|
|
4465
4486
|
}
|
|
4466
4487
|
});
|
|
4467
4488
|
function st(c) {
|
|
4468
|
-
|
|
4489
|
+
C(c, {
|
|
4469
4490
|
version: t.version,
|
|
4470
4491
|
ui: t.ui,
|
|
4471
4492
|
isMobile: m,
|
|
@@ -4476,62 +4497,62 @@ function Wt(t) {
|
|
|
4476
4497
|
removeData: xt,
|
|
4477
4498
|
refreshData: _e,
|
|
4478
4499
|
maker: f,
|
|
4479
|
-
component:
|
|
4480
|
-
directive:
|
|
4500
|
+
component: F,
|
|
4501
|
+
directive: T,
|
|
4481
4502
|
setModelField: Xt,
|
|
4482
4503
|
setFormula: Qt,
|
|
4483
4504
|
setDriver: Zt,
|
|
4484
|
-
register:
|
|
4485
|
-
$vnode:
|
|
4486
|
-
parser:
|
|
4487
|
-
use:
|
|
4505
|
+
register: ce,
|
|
4506
|
+
$vnode: N,
|
|
4507
|
+
parser: he,
|
|
4508
|
+
use: de,
|
|
4488
4509
|
factory: Kt,
|
|
4489
|
-
componentAlias:
|
|
4510
|
+
componentAlias: Ae,
|
|
4490
4511
|
copyRule: Pt,
|
|
4491
4512
|
copyRules: Bt,
|
|
4492
|
-
mergeRule:
|
|
4513
|
+
mergeRule: x,
|
|
4493
4514
|
fetch: Ut,
|
|
4494
|
-
$form:
|
|
4495
|
-
parseFn:
|
|
4515
|
+
$form: R,
|
|
4516
|
+
parseFn: z,
|
|
4496
4517
|
parseJson: Vt,
|
|
4497
4518
|
toJson: et,
|
|
4498
4519
|
useApp: V,
|
|
4499
|
-
getApi:
|
|
4520
|
+
getApi: ee,
|
|
4500
4521
|
on: er
|
|
4501
4522
|
});
|
|
4502
4523
|
}
|
|
4503
4524
|
function tr(c) {
|
|
4504
|
-
|
|
4505
|
-
create:
|
|
4525
|
+
C(c, {
|
|
4526
|
+
create: H,
|
|
4506
4527
|
install(p, y) {
|
|
4507
4528
|
if (d = b(b({}, d), y || {}), p._installedFormCreate === !0) return;
|
|
4508
4529
|
p._installedFormCreate = !0;
|
|
4509
|
-
const
|
|
4510
|
-
return
|
|
4530
|
+
const v = function(j, k = {}) {
|
|
4531
|
+
return H(j, k, this);
|
|
4511
4532
|
};
|
|
4512
|
-
st(
|
|
4513
|
-
const
|
|
4514
|
-
p.component(
|
|
4515
|
-
O(() =>
|
|
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));
|
|
4516
4537
|
});
|
|
4517
4538
|
}
|
|
4518
4539
|
});
|
|
4519
4540
|
}
|
|
4520
|
-
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) {
|
|
4521
4542
|
const c = t.inherit;
|
|
4522
|
-
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);
|
|
4523
4544
|
}
|
|
4524
|
-
const we =
|
|
4525
|
-
return
|
|
4545
|
+
const we = R();
|
|
4546
|
+
return Fe(we, D), Object.defineProperties(we, {
|
|
4526
4547
|
fetch: {
|
|
4527
4548
|
get() {
|
|
4528
|
-
return
|
|
4549
|
+
return D.fetch;
|
|
4529
4550
|
},
|
|
4530
4551
|
set(c) {
|
|
4531
|
-
|
|
4552
|
+
D.fetch = c;
|
|
4532
4553
|
}
|
|
4533
4554
|
}
|
|
4534
|
-
}), we.util =
|
|
4555
|
+
}), we.util = D, we;
|
|
4535
4556
|
}
|
|
4536
4557
|
function Me(t) {
|
|
4537
4558
|
if (h.Date(t))
|
|
@@ -4694,13 +4715,13 @@ function Ki() {
|
|
|
4694
4715
|
};
|
|
4695
4716
|
}
|
|
4696
4717
|
function Ct(t, e) {
|
|
4697
|
-
|
|
4718
|
+
E(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4698
4719
|
}
|
|
4699
|
-
function
|
|
4720
|
+
function Q(t) {
|
|
4700
4721
|
return t === !1;
|
|
4701
4722
|
}
|
|
4702
4723
|
function Xi(t, e) {
|
|
4703
|
-
|
|
4724
|
+
E(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4704
4725
|
}
|
|
4705
4726
|
function Ge(t) {
|
|
4706
4727
|
const e = b({}, t);
|
|
@@ -4739,7 +4760,7 @@ const Qi = {
|
|
|
4739
4760
|
wrap: {}
|
|
4740
4761
|
};
|
|
4741
4762
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4742
|
-
t.prop[r] =
|
|
4763
|
+
t.prop[r] = Y([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4743
4764
|
}), this.setSize(t.prop.props);
|
|
4744
4765
|
},
|
|
4745
4766
|
setSize(t) {
|
|
@@ -4764,17 +4785,17 @@ const Qi = {
|
|
|
4764
4785
|
},
|
|
4765
4786
|
beforeRender() {
|
|
4766
4787
|
const { key: t, ref: e, $handle: r } = this;
|
|
4767
|
-
|
|
4788
|
+
C(this.rule, { key: t, ref: e }), C(this.rule.props, {
|
|
4768
4789
|
model: r.formData
|
|
4769
4790
|
});
|
|
4770
4791
|
},
|
|
4771
4792
|
render(t) {
|
|
4772
|
-
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)]);
|
|
4773
4794
|
},
|
|
4774
4795
|
makeWrap(t, e) {
|
|
4775
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;
|
|
4776
4797
|
delete r.wrap.title;
|
|
4777
|
-
const u =
|
|
4798
|
+
const u = Q(r.wrap.show) ? e : this.$r(Y([r.wrap, {
|
|
4778
4799
|
props: U(b({
|
|
4779
4800
|
labelWidth: o
|
|
4780
4801
|
}, Ge(r.wrap || {})), {
|
|
@@ -4786,30 +4807,30 @@ const Qi = {
|
|
|
4786
4807
|
ref: t.wrapRef,
|
|
4787
4808
|
type: "formItem"
|
|
4788
4809
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4789
|
-
return a === !0 ||
|
|
4810
|
+
return a === !0 || Q(l) || Q(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4790
4811
|
},
|
|
4791
4812
|
isTitle(t) {
|
|
4792
4813
|
if (this.options.form.title === !1) return !1;
|
|
4793
4814
|
const e = t.title;
|
|
4794
|
-
return !(!e.title && !e.native ||
|
|
4815
|
+
return !(!e.title && !e.native || Q(e.show));
|
|
4795
4816
|
},
|
|
4796
4817
|
makeInfo(t, e, r) {
|
|
4797
|
-
var u, f, d
|
|
4818
|
+
var u, f, d, m, g, $;
|
|
4798
4819
|
const i = b({}, t.title), s = b({}, t.info), n = this.options.form, o = this.getSlot("title"), a = [o ? o({
|
|
4799
|
-
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,
|
|
4800
4821
|
rule: r.rule,
|
|
4801
4822
|
options: this.options
|
|
4802
|
-
}) : ((
|
|
4803
|
-
if (!
|
|
4804
|
-
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 _ = {
|
|
4805
4826
|
type: s.type || "poptip",
|
|
4806
4827
|
props: Ge(s),
|
|
4807
4828
|
key: `${e}pop`,
|
|
4808
4829
|
slot: "label"
|
|
4809
4830
|
};
|
|
4810
|
-
delete
|
|
4811
|
-
const
|
|
4812
|
-
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, _]), [
|
|
4813
4834
|
this.$r({
|
|
4814
4835
|
type: "icon",
|
|
4815
4836
|
props: { type: s.icon === !0 ? De.infoIcon : s.icon, size: 16 },
|
|
@@ -4818,7 +4839,7 @@ const Qi = {
|
|
|
4818
4839
|
})
|
|
4819
4840
|
]));
|
|
4820
4841
|
}
|
|
4821
|
-
const l =
|
|
4842
|
+
const l = Y([i, {
|
|
4822
4843
|
props: Ge(i),
|
|
4823
4844
|
key: `${e}tit`,
|
|
4824
4845
|
class: "fc-form-title",
|
|
@@ -4847,7 +4868,7 @@ const Qi = {
|
|
|
4847
4868
|
},
|
|
4848
4869
|
makeFormBtn() {
|
|
4849
4870
|
let t = [];
|
|
4850
|
-
if (
|
|
4871
|
+
if (Q(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Q(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4851
4872
|
return;
|
|
4852
4873
|
const e = this.$r({
|
|
4853
4874
|
type: "formItem",
|
|
@@ -4894,7 +4915,7 @@ const Qi = {
|
|
|
4894
4915
|
key: `${this.key}b1`
|
|
4895
4916
|
}, [e]);
|
|
4896
4917
|
}
|
|
4897
|
-
},
|
|
4918
|
+
}, oe = {}, Zi = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4898
4919
|
function Yi(t) {
|
|
4899
4920
|
Zi.forEach((e) => {
|
|
4900
4921
|
t[e] = A(e);
|
|
@@ -4932,12 +4953,12 @@ function nn(t) {
|
|
|
4932
4953
|
};
|
|
4933
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;
|
|
4934
4955
|
}
|
|
4935
|
-
Yi(
|
|
4936
|
-
xi(
|
|
4937
|
-
en(
|
|
4938
|
-
rn(
|
|
4939
|
-
nn(
|
|
4940
|
-
tn(
|
|
4956
|
+
Yi(oe);
|
|
4957
|
+
xi(oe);
|
|
4958
|
+
en(oe);
|
|
4959
|
+
rn(oe);
|
|
4960
|
+
nn(oe);
|
|
4961
|
+
tn(oe);
|
|
4941
4962
|
function wt(t, e) {
|
|
4942
4963
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4943
4964
|
}
|
|
@@ -5018,11 +5039,11 @@ function sn(t, e) {
|
|
|
5018
5039
|
},
|
|
5019
5040
|
submitBtnProps: (r = {}) => {
|
|
5020
5041
|
let i = wt(e.options.submitBtn, !0);
|
|
5021
|
-
|
|
5042
|
+
C(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
5022
5043
|
},
|
|
5023
5044
|
resetBtnProps: (r = {}) => {
|
|
5024
5045
|
let i = wt(e.options.resetBtn, !1);
|
|
5025
|
-
|
|
5046
|
+
C(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
5026
5047
|
},
|
|
5027
5048
|
submit(r, i) {
|
|
5028
5049
|
return new Promise((s, n) => {
|
|
@@ -5039,23 +5060,24 @@ function sn(t, e) {
|
|
|
5039
5060
|
const zt = {
|
|
5040
5061
|
name: "required",
|
|
5041
5062
|
load(t, e, r) {
|
|
5063
|
+
var s, n;
|
|
5042
5064
|
const i = on(t.getValue());
|
|
5043
5065
|
if (i.required === !1)
|
|
5044
5066
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5045
5067
|
else {
|
|
5046
|
-
const
|
|
5068
|
+
const o = b({
|
|
5047
5069
|
required: !0,
|
|
5048
|
-
validator(
|
|
5049
|
-
h.empty(
|
|
5070
|
+
validator(l, u, f) {
|
|
5071
|
+
h.empty(u) ? f(o.message) : f();
|
|
5050
5072
|
}
|
|
5051
|
-
}, i), n = e.__fc__.refRule.__$title.value;
|
|
5052
|
-
if (!
|
|
5053
|
-
|
|
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" : "不能为空");
|
|
5054
5076
|
else {
|
|
5055
|
-
const
|
|
5056
|
-
|
|
5077
|
+
const l = o.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5078
|
+
l && (o.message = r.t(l[1], { title: a }));
|
|
5057
5079
|
}
|
|
5058
|
-
t.getProp().validate = [
|
|
5080
|
+
t.getProp().validate = [o];
|
|
5059
5081
|
}
|
|
5060
5082
|
r.sync(e);
|
|
5061
5083
|
},
|
|
@@ -5071,14 +5093,14 @@ function an(t) {
|
|
|
5071
5093
|
t.component(e.name, e);
|
|
5072
5094
|
}), t.register(zt), Ji.forEach((e) => {
|
|
5073
5095
|
t.parser(e);
|
|
5074
|
-
}), Object.keys(
|
|
5075
|
-
t.maker[e] =
|
|
5096
|
+
}), Object.keys(oe).forEach((e) => {
|
|
5097
|
+
t.maker[e] = oe[e];
|
|
5076
5098
|
});
|
|
5077
5099
|
}
|
|
5078
5100
|
function ln() {
|
|
5079
5101
|
return Wt({
|
|
5080
5102
|
ui: "iview",
|
|
5081
|
-
version: "2.7.
|
|
5103
|
+
version: "2.7.4",
|
|
5082
5104
|
manager: Qi,
|
|
5083
5105
|
install: an,
|
|
5084
5106
|
extendApi: sn,
|