@form-create/view-design 2.7.3 → 2.7.5
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 +908 -866
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +4 -4
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/view-design v2.7.
|
|
3
|
+
* @form-create/view-design v2.7.5
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -19,20 +19,20 @@ 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 L, onMounted as hr, onBeforeUnmount as dr, onUpdated as pr, nextTick as A, markRaw as me, computed as ge, toRef as De, 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
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function Je() {
|
|
27
|
+
return Je = Object.assign ? Object.assign.bind() : function(t) {
|
|
28
28
|
for (var e, r = 1; r < arguments.length; r++) for (var i in e = arguments[r], e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
|
|
29
29
|
return t;
|
|
30
|
-
},
|
|
30
|
+
}, Je.apply(this, arguments);
|
|
31
31
|
}
|
|
32
32
|
var yr = ["attrs", "props", "domProps"], $r = ["class", "style", "directives"], vr = ["on", "nativeOn"], br = function(t) {
|
|
33
33
|
return t.reduce(function(e, r) {
|
|
34
34
|
for (var i in r) if (!e[i]) e[i] = r[i];
|
|
35
|
-
else if (yr.indexOf(i) !== -1) e[i] =
|
|
35
|
+
else if (yr.indexOf(i) !== -1) e[i] = Je({}, e[i], r[i]);
|
|
36
36
|
else if ($r.indexOf(i) !== -1) {
|
|
37
37
|
var s = e[i] instanceof Array ? e[i] : [e[i]], n = r[i] instanceof Array ? r[i] : [r[i]];
|
|
38
38
|
e[i] = [].concat(s, n);
|
|
@@ -50,8 +50,8 @@ 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
|
|
54
|
-
function
|
|
53
|
+
const I = /* @__PURE__ */ gr(Cr);
|
|
54
|
+
function Ie(t, e) {
|
|
55
55
|
return Object.keys(t).reduce((r, i) => ((!e || e.indexOf(i) === -1) && r.push(t[i]), r), []);
|
|
56
56
|
}
|
|
57
57
|
const wr = "fcCheckbox", Or = {
|
|
@@ -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,24 +112,24 @@ 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
|
|
119
119
|
}]));
|
|
120
|
-
}),
|
|
120
|
+
}), Ie(this.$slots)]);
|
|
121
121
|
},
|
|
122
122
|
mounted() {
|
|
123
123
|
this.$emit("fc.el", this.$refs.el);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function H(t) {
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
|
-
const
|
|
129
|
+
const Fr = "fcFrame";
|
|
130
130
|
function Ot(t) {
|
|
131
131
|
return {
|
|
132
|
-
name:
|
|
132
|
+
name: Fr,
|
|
133
133
|
props: {
|
|
134
134
|
formCreateInject: {
|
|
135
135
|
type: Object,
|
|
@@ -250,7 +250,7 @@ function Ot(t) {
|
|
|
250
250
|
},
|
|
251
251
|
data() {
|
|
252
252
|
return {
|
|
253
|
-
fileList:
|
|
253
|
+
fileList: H(this.value),
|
|
254
254
|
previewVisible: !1,
|
|
255
255
|
frameVisible: !1,
|
|
256
256
|
previewImage: ""
|
|
@@ -258,7 +258,7 @@ function Ot(t) {
|
|
|
258
258
|
},
|
|
259
259
|
watch: {
|
|
260
260
|
value(e) {
|
|
261
|
-
this.fileList =
|
|
261
|
+
this.fileList = H(e);
|
|
262
262
|
},
|
|
263
263
|
fileList(e) {
|
|
264
264
|
const r = this.maxLength === 1 ? e[0] || "" : e;
|
|
@@ -286,7 +286,7 @@ function Ot(t) {
|
|
|
286
286
|
readonly: !0,
|
|
287
287
|
clearable: !1
|
|
288
288
|
};
|
|
289
|
-
return e("Input",
|
|
289
|
+
return e("Input", I([{}, {
|
|
290
290
|
props: r
|
|
291
291
|
}, {}, {
|
|
292
292
|
on: {
|
|
@@ -325,7 +325,7 @@ function Ot(t) {
|
|
|
325
325
|
},
|
|
326
326
|
makeHandleIcon(e, r) {
|
|
327
327
|
const i = this.$createElement;
|
|
328
|
-
return i("icon",
|
|
328
|
+
return i("icon", I([{}, {
|
|
329
329
|
props: {
|
|
330
330
|
type: this.handleIcon === !0 || this.handleIcon === void 0 ? "ios-eye-outline" : this.handleIcon
|
|
331
331
|
}
|
|
@@ -338,7 +338,7 @@ function Ot(t) {
|
|
|
338
338
|
},
|
|
339
339
|
makeRemoveIcon(e, r) {
|
|
340
340
|
const i = this.$createElement;
|
|
341
|
-
return i("icon",
|
|
341
|
+
return i("icon", I([{}, {
|
|
342
342
|
props: {
|
|
343
343
|
type: "ios-trash-outline"
|
|
344
344
|
}
|
|
@@ -351,7 +351,7 @@ function Ot(t) {
|
|
|
351
351
|
},
|
|
352
352
|
makeFiles() {
|
|
353
353
|
const e = this.$createElement;
|
|
354
|
-
return this.makeGroup(this.fileList.map((r, i) => this.makeItem(i, [e("icon",
|
|
354
|
+
return this.makeGroup(this.fileList.map((r, i) => this.makeItem(i, [e("icon", I([{}, {
|
|
355
355
|
props: {
|
|
356
356
|
type: t.fileIcon,
|
|
357
357
|
size: 40
|
|
@@ -378,7 +378,7 @@ function Ot(t) {
|
|
|
378
378
|
click: () => this.showModel()
|
|
379
379
|
},
|
|
380
380
|
key: this.key("btn")
|
|
381
|
-
}, [e("icon",
|
|
381
|
+
}, [e("icon", I([{}, {
|
|
382
382
|
props: {
|
|
383
383
|
type: this.icon,
|
|
384
384
|
size: 20
|
|
@@ -450,7 +450,7 @@ function Ot(t) {
|
|
|
450
450
|
this.$refs.frame && this.frameLoad(this.$refs.frame.contentWindow || {});
|
|
451
451
|
}), e("div", {
|
|
452
452
|
class: "_fc-frame"
|
|
453
|
-
}, [i, e("Modal",
|
|
453
|
+
}, [i, e("Modal", I([{}, {
|
|
454
454
|
props: {
|
|
455
455
|
mask: this.previewMask,
|
|
456
456
|
title: l,
|
|
@@ -468,7 +468,7 @@ function Ot(t) {
|
|
|
468
468
|
attrs: {
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
|
-
})]), e("Modal",
|
|
471
|
+
})]), e("Modal", I([{}, {
|
|
472
472
|
props: b({
|
|
473
473
|
width: s,
|
|
474
474
|
title: a
|
|
@@ -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,12 +564,12 @@ 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
|
|
571
571
|
}]));
|
|
572
|
-
}),
|
|
572
|
+
}), Ie(this.$slots)]);
|
|
573
573
|
},
|
|
574
574
|
mounted() {
|
|
575
575
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -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);
|
|
@@ -670,7 +670,7 @@ const kr = "fcSelect", Er = {
|
|
|
670
670
|
},
|
|
671
671
|
methods: {
|
|
672
672
|
setStatus(t) {
|
|
673
|
-
const e =
|
|
673
|
+
const e = H(t), r = this.formCreateInject.prop.props.data;
|
|
674
674
|
this.type === "selected" ? this.checked(r, e, "selected") : this.checked(r, e, "checked"), this.$forceUpdate();
|
|
675
675
|
},
|
|
676
676
|
checked(t, e, r) {
|
|
@@ -684,11 +684,11 @@ const kr = "fcSelect", 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
|
|
691
|
-
}]), [
|
|
691
|
+
}]), [Ie(this.$slots)]);
|
|
692
692
|
},
|
|
693
693
|
mounted() {
|
|
694
694
|
this.$emit("fc.el", this.$refs.tree);
|
|
@@ -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: {
|
|
@@ -754,11 +754,11 @@ function Ft(t) {
|
|
|
754
754
|
};
|
|
755
755
|
},
|
|
756
756
|
created() {
|
|
757
|
-
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList =
|
|
757
|
+
this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = !1), this.formCreateInject.prop.props.defaultFileList = H(this.value).map(ut).map(ft);
|
|
758
758
|
},
|
|
759
759
|
watch: {
|
|
760
760
|
value(e) {
|
|
761
|
-
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList =
|
|
761
|
+
this.$refs.upload.fileList.every((r) => !r.status || r.status === "finished") && (this.$refs.upload.fileList = H(e).map(ut).map(ft), this.uploadList = this.$refs.upload.fileList);
|
|
762
762
|
},
|
|
763
763
|
maxLength(e, r) {
|
|
764
764
|
(r === 1 || e === 1) && this.update();
|
|
@@ -784,7 +784,7 @@ function 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,12 +859,12 @@ 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
|
|
866
866
|
}
|
|
867
|
-
}]))])]) : null,
|
|
867
|
+
}]))])]) : null, Ie(this.$slots, ["default"])]);
|
|
868
868
|
},
|
|
869
869
|
update() {
|
|
870
870
|
let e = this.$refs.upload.fileList.map((r) => r.is_string ? r.url : r.value || r.url).filter((r) => r !== void 0);
|
|
@@ -878,7 +878,7 @@ function 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 _e(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,35 +929,35 @@ 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] = _e(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 G(t) {
|
|
949
|
+
return _e({}, { 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
|
-
function
|
|
960
|
+
function We(t) {
|
|
961
961
|
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : b({}, t);
|
|
962
962
|
}
|
|
963
963
|
const Pr = "fcGroup", Br = {
|
|
@@ -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
|
+
_e(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 = G(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 = G(this.defaultValue);
|
|
1117
|
+
C(i.formData, this.field ? {
|
|
1118
1118
|
[this.field]: s
|
|
1119
1119
|
} : s);
|
|
1120
1120
|
}
|
|
@@ -1137,7 +1137,10 @@ const Pr = "fcGroup", Br = {
|
|
|
1137
1137
|
this.$delete(this.cacheRule, t), this.$delete(this.cacheValue, t), e && this.$nextTick(() => this.$emit("remove", r));
|
|
1138
1138
|
},
|
|
1139
1139
|
add(t) {
|
|
1140
|
-
this.disabled || this.onBeforeAdd(this.value) === !1
|
|
1140
|
+
if (this.disabled || this.onBeforeAdd(this.value) === !1)
|
|
1141
|
+
return;
|
|
1142
|
+
const e = [...this.value];
|
|
1143
|
+
e.push(this.defaultValue ? G(this.defaultValue) : this.field ? null : {}), this.input(e);
|
|
1141
1144
|
},
|
|
1142
1145
|
del(t, e) {
|
|
1143
1146
|
if (this.disabled || this.onBeforeRemove(this.value, t) === !1)
|
|
@@ -1232,13 +1235,13 @@ const Pr = "fcGroup", Br = {
|
|
|
1232
1235
|
return t("div", {
|
|
1233
1236
|
class: "_fc-group-container",
|
|
1234
1237
|
key: o
|
|
1235
|
-
}, [t(i,
|
|
1238
|
+
}, [t(i, I([{
|
|
1236
1239
|
key: o
|
|
1237
1240
|
}, {
|
|
1238
1241
|
on: {
|
|
1239
|
-
"update:value": (
|
|
1240
|
-
"emit-event": (
|
|
1241
|
-
input: (
|
|
1242
|
+
"update:value": (p) => this.formData(o, p),
|
|
1243
|
+
"emit-event": (p, ...m) => this.emitEvent(p, m, a, o),
|
|
1244
|
+
input: (p) => this.add$f(a, o, p)
|
|
1242
1245
|
}
|
|
1243
1246
|
}, {}, {
|
|
1244
1247
|
props: {
|
|
@@ -1331,7 +1334,7 @@ const Pr = "fcGroup", Br = {
|
|
|
1331
1334
|
rule: e,
|
|
1332
1335
|
options: r
|
|
1333
1336
|
} = this.cacheRule, i = this.type;
|
|
1334
|
-
return t(i,
|
|
1337
|
+
return t(i, I([{}, {
|
|
1335
1338
|
on: {
|
|
1336
1339
|
"update:value": this.formData,
|
|
1337
1340
|
"emit-event": this.emitEvent,
|
|
@@ -1352,250 +1355,88 @@ const Pr = "fcGroup", Br = {
|
|
|
1352
1355
|
Er,
|
|
1353
1356
|
jr,
|
|
1354
1357
|
Tr,
|
|
1355
|
-
|
|
1358
|
+
Ft,
|
|
1356
1359
|
Rt,
|
|
1357
1360
|
Br
|
|
1358
1361
|
];
|
|
1359
|
-
function
|
|
1362
|
+
function ne(t, e) {
|
|
1360
1363
|
var r = null;
|
|
1361
1364
|
return function(...i) {
|
|
1362
1365
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
1363
1366
|
};
|
|
1364
1367
|
}
|
|
1365
|
-
function
|
|
1368
|
+
function ve(t) {
|
|
1366
1369
|
let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
|
|
1367
1370
|
return e.indexOf("-") === 0 && (e = e.substr(1)), e;
|
|
1368
1371
|
}
|
|
1369
|
-
const
|
|
1370
|
-
if (!(!t || t === e || !t.$props)) {
|
|
1371
|
-
if (t.$props.formCreateInject)
|
|
1372
|
-
return t.$props.formCreateInject;
|
|
1373
|
-
if (t.$parent)
|
|
1374
|
-
return Re(t.$parent, e);
|
|
1375
|
-
}
|
|
1376
|
-
};
|
|
1377
|
-
function Mr(t, e, r) {
|
|
1378
|
-
const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
|
|
1379
|
-
return {
|
|
1380
|
-
name: i,
|
|
1381
|
-
componentName: i,
|
|
1382
|
-
model: {
|
|
1383
|
-
prop: "api"
|
|
1384
|
-
},
|
|
1385
|
-
components: e,
|
|
1386
|
-
directives: r,
|
|
1387
|
-
provide() {
|
|
1388
|
-
return {
|
|
1389
|
-
$pfc: this
|
|
1390
|
-
};
|
|
1391
|
-
},
|
|
1392
|
-
inject: { $pfc: { default: null } },
|
|
1393
|
-
props: {
|
|
1394
|
-
rule: {
|
|
1395
|
-
type: Array,
|
|
1396
|
-
required: !0,
|
|
1397
|
-
default: () => []
|
|
1398
|
-
},
|
|
1399
|
-
option: {
|
|
1400
|
-
type: Object,
|
|
1401
|
-
default: () => ({})
|
|
1402
|
-
},
|
|
1403
|
-
extendOption: Boolean,
|
|
1404
|
-
driver: [String, Object],
|
|
1405
|
-
value: Object,
|
|
1406
|
-
disabled: {
|
|
1407
|
-
type: Boolean,
|
|
1408
|
-
default: void 0
|
|
1409
|
-
},
|
|
1410
|
-
preview: {
|
|
1411
|
-
type: Boolean,
|
|
1412
|
-
default: void 0
|
|
1413
|
-
},
|
|
1414
|
-
index: [String, Number],
|
|
1415
|
-
api: Object,
|
|
1416
|
-
locale: [String, Object],
|
|
1417
|
-
name: String,
|
|
1418
|
-
subForm: {
|
|
1419
|
-
type: Boolean,
|
|
1420
|
-
default: !0
|
|
1421
|
-
},
|
|
1422
|
-
inFor: Boolean
|
|
1423
|
-
},
|
|
1424
|
-
render() {
|
|
1425
|
-
return this.fc.render();
|
|
1426
|
-
},
|
|
1427
|
-
setup(s) {
|
|
1428
|
-
const n = lr().proxy;
|
|
1429
|
-
ur("parentFC", n);
|
|
1430
|
-
const o = fr("parentFC", null);
|
|
1431
|
-
let a = o;
|
|
1432
|
-
if (o)
|
|
1433
|
-
for (; a.parent; )
|
|
1434
|
-
a = a.parent;
|
|
1435
|
-
else
|
|
1436
|
-
a = n;
|
|
1437
|
-
const { rule: l, value: u, subForm: f, inFor: d } = lt(s), m = re({
|
|
1438
|
-
ctxInject: {},
|
|
1439
|
-
destroyed: !1,
|
|
1440
|
-
isShow: !0,
|
|
1441
|
-
unique: 1,
|
|
1442
|
-
renderRule: [...l.value || []],
|
|
1443
|
-
updateValue: JSON.stringify(u.value || {})
|
|
1444
|
-
}), g = new t(n), v = g.api(), w = d.value, I = () => {
|
|
1445
|
-
if (o) {
|
|
1446
|
-
const S = Re(n, o);
|
|
1447
|
-
if (S) {
|
|
1448
|
-
let D;
|
|
1449
|
-
w ? (D = G(S.getSubForm()), D.push(v)) : D = v, S.subForm(D);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
}, x = () => {
|
|
1453
|
-
const S = Re(n, o);
|
|
1454
|
-
if (S)
|
|
1455
|
-
if (w) {
|
|
1456
|
-
const D = G(S.getSubForm()), B = D.indexOf(v);
|
|
1457
|
-
B > -1 && D.splice(B, 1);
|
|
1458
|
-
} else
|
|
1459
|
-
S.subForm();
|
|
1460
|
-
};
|
|
1461
|
-
let V = null;
|
|
1462
|
-
cr(() => {
|
|
1463
|
-
L(() => {
|
|
1464
|
-
let S = "";
|
|
1465
|
-
const D = s.option && s.option.globalClass || {};
|
|
1466
|
-
Object.keys(D).forEach((B) => {
|
|
1467
|
-
let se = "";
|
|
1468
|
-
D[B].style && Object.keys(D[B].style).forEach((be) => {
|
|
1469
|
-
se += ye(be) + ":" + D[B].style[be] + ";";
|
|
1470
|
-
}), D[B].content && (se += D[B].content + ";"), se && (S += `.${B}{${se}}`);
|
|
1471
|
-
}), s.option && s.option.style && (S += s.option.style), V || (V = document.createElement("style"), V.type = "text/css", document.head.appendChild(V)), V.innerHTML = S || "";
|
|
1472
|
-
}, () => {
|
|
1473
|
-
});
|
|
1474
|
-
});
|
|
1475
|
-
const N = ce(() => {
|
|
1476
|
-
g.bus.$emit("$loadData.$topForm");
|
|
1477
|
-
}, 100), Ae = ce(() => {
|
|
1478
|
-
g.bus.$emit("$loadData.$form");
|
|
1479
|
-
}, 100), ve = (S) => {
|
|
1480
|
-
g.bus.$emit("change-$form." + S);
|
|
1481
|
-
};
|
|
1482
|
-
return hr(() => {
|
|
1483
|
-
o && (v.top.bus.$on("$loadData.$form", N), v.top.bus.$on("change", ve)), g.mounted();
|
|
1484
|
-
}), dr(() => {
|
|
1485
|
-
o && (v.top.bus.$off("$loadData.$form", N), v.top.bus.$off("change", ve)), V && document.head.removeChild(V), x(), m.destroyed = !0, g.unmount();
|
|
1486
|
-
}), pr(() => {
|
|
1487
|
-
g.updated();
|
|
1488
|
-
}), L(f, (S) => {
|
|
1489
|
-
S ? I() : x();
|
|
1490
|
-
}, { immediate: !0 }), L(() => [...l.value], (S) => {
|
|
1491
|
-
g.$handle.isBreakWatch() || S.length === m.renderRule.length && S.every((D) => m.renderRule.indexOf(D) > -1) || (g.$handle.updateAppendData(), g.$handle.reloadRule(l.value), n.renderRule());
|
|
1492
|
-
}), L(() => s.option, () => {
|
|
1493
|
-
g.initOptions(), v.refresh();
|
|
1494
|
-
}, { deep: !0 }), L(() => [s.disabled, s.preview], () => {
|
|
1495
|
-
v.refresh();
|
|
1496
|
-
}), L(u, (S) => {
|
|
1497
|
-
JSON.stringify(S || {}) !== m.updateValue && (v.config.forceCoverValue ? v.coverValue(S || {}) : v.setValue(S || {}));
|
|
1498
|
-
}, { deep: !0, flush: "post" }), L(() => s.index, () => {
|
|
1499
|
-
v.coverValue({}), g.$handle.updateAppendData(), P(() => {
|
|
1500
|
-
P(() => {
|
|
1501
|
-
v.clearValidateState();
|
|
1502
|
-
});
|
|
1503
|
-
});
|
|
1504
|
-
}, { flush: "sync" }), U(b({
|
|
1505
|
-
fc: de(g),
|
|
1506
|
-
parent: o && de(o),
|
|
1507
|
-
top: de(a),
|
|
1508
|
-
fapi: de(v)
|
|
1509
|
-
}, lt(m)), {
|
|
1510
|
-
getGroupInject: () => Re(n, o),
|
|
1511
|
-
refresh() {
|
|
1512
|
-
++m.unique;
|
|
1513
|
-
},
|
|
1514
|
-
renderRule() {
|
|
1515
|
-
m.renderRule = [...l.value || []];
|
|
1516
|
-
},
|
|
1517
|
-
updateValue(S) {
|
|
1518
|
-
if (m.destroyed) return;
|
|
1519
|
-
const D = JSON.stringify(S);
|
|
1520
|
-
m.updateValue !== D && (m.updateValue = D, n.$emit("update:value", S), P(() => {
|
|
1521
|
-
Ae(), o || N();
|
|
1522
|
-
}));
|
|
1523
|
-
}
|
|
1524
|
-
});
|
|
1525
|
-
},
|
|
1526
|
-
created() {
|
|
1527
|
-
this.$emit("input", this.fapi), this.fc.init();
|
|
1528
|
-
}
|
|
1529
|
-
};
|
|
1530
|
-
}
|
|
1531
|
-
const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"], Z = (t, e = {}, r = {}) => {
|
|
1372
|
+
const kt = ["attrs", "props", "domProps", "scopedSlots"], Et = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"], Y = (t, e = {}, r = {}) => {
|
|
1532
1373
|
const i = [...kt, ...r.normal || []], s = [...Et, ...r.array || []], n = [...Dt, ...r.functional || []], o = r.props || [];
|
|
1533
1374
|
return t.reduce((a, l) => {
|
|
1534
1375
|
for (const u in l)
|
|
1535
1376
|
if (a[u])
|
|
1536
1377
|
if (o.indexOf(u) > -1)
|
|
1537
|
-
a[u] =
|
|
1378
|
+
a[u] = Y([l[u]], a[u]);
|
|
1538
1379
|
else if (i.indexOf(u) > -1)
|
|
1539
1380
|
a[u] = b(b({}, a[u]), l[u]);
|
|
1540
1381
|
else if (s.indexOf(u) > -1) {
|
|
1541
|
-
const f = a[u] instanceof Array ? a[u] : [a[u]],
|
|
1542
|
-
a[u] = [...f, ...
|
|
1382
|
+
const f = a[u] instanceof Array ? a[u] : [a[u]], p = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1383
|
+
a[u] = [...f, ...p];
|
|
1543
1384
|
} else if (n.indexOf(u) > -1)
|
|
1544
1385
|
for (const f in l[u])
|
|
1545
1386
|
if (a[u][f]) {
|
|
1546
|
-
const
|
|
1547
|
-
a[u][f] = [...
|
|
1387
|
+
const p = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], m = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
|
|
1388
|
+
a[u][f] = [...p, ...m];
|
|
1548
1389
|
} else
|
|
1549
1390
|
a[u][f] = l[u][f];
|
|
1550
1391
|
else if (u === "hook")
|
|
1551
1392
|
for (let f in l[u])
|
|
1552
|
-
a[u][f] ? a[u][f] =
|
|
1393
|
+
a[u][f] ? a[u][f] = Mr(a[u][f], l[u][f]) : a[u][f] = l[u][f];
|
|
1553
1394
|
else
|
|
1554
1395
|
a[u] = l[u];
|
|
1555
1396
|
else
|
|
1556
1397
|
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = b({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? b({}, l[u]) : l[u] : a[u] = l[u];
|
|
1557
1398
|
return a;
|
|
1558
1399
|
}, e);
|
|
1559
|
-
},
|
|
1400
|
+
}, Mr = (t, e) => function() {
|
|
1560
1401
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1561
|
-
}, jt = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"],
|
|
1402
|
+
}, jt = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Ye = ["validate", "children", "control"], xe = ["effect", "deep", "renderSlots"];
|
|
1562
1403
|
function It() {
|
|
1563
|
-
return [...jt, ...kt, ...Et, ...Dt, ...
|
|
1404
|
+
return [...jt, ...kt, ...Et, ...Dt, ...Ye, ...xe];
|
|
1564
1405
|
}
|
|
1565
1406
|
function At(t, e, r) {
|
|
1566
1407
|
return `[form-create ${t}]: ${e}`;
|
|
1567
1408
|
}
|
|
1568
|
-
function
|
|
1409
|
+
function et(t, e) {
|
|
1569
1410
|
console.error(At("err", t));
|
|
1570
1411
|
}
|
|
1571
|
-
function
|
|
1572
|
-
|
|
1412
|
+
function Ur(t) {
|
|
1413
|
+
et(t.toString()), console.error(t);
|
|
1573
1414
|
}
|
|
1574
|
-
function
|
|
1415
|
+
function qr(t) {
|
|
1575
1416
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
1576
1417
|
}
|
|
1577
|
-
const
|
|
1578
|
-
function
|
|
1579
|
-
return JSON.stringify(
|
|
1418
|
+
const ze = "[[FORM-CREATE-PREFIX-", Ke = "-FORM-CREATE-SUFFIX]]";
|
|
1419
|
+
function be(t, e) {
|
|
1420
|
+
return JSON.stringify(_e(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1580
1421
|
if (!(i && i._isVue === !0)) {
|
|
1581
1422
|
if (typeof i != "function")
|
|
1582
1423
|
return i;
|
|
1583
1424
|
if (i.__json)
|
|
1584
1425
|
return i.__json;
|
|
1585
1426
|
if (i.__origin && (i = i.__origin), !i.__emit)
|
|
1586
|
-
return
|
|
1427
|
+
return ze + i + Ke;
|
|
1587
1428
|
}
|
|
1588
1429
|
}, e);
|
|
1589
1430
|
}
|
|
1590
|
-
function
|
|
1431
|
+
function Te(t) {
|
|
1591
1432
|
return new Function("return " + t)();
|
|
1592
1433
|
}
|
|
1593
|
-
function
|
|
1434
|
+
function z(t, e) {
|
|
1594
1435
|
if (t && h.String(t) && t.length > 4) {
|
|
1595
1436
|
let r = t.trim(), i = !1;
|
|
1596
1437
|
try {
|
|
1597
|
-
if (r.indexOf(
|
|
1598
|
-
r = r.replace(
|
|
1438
|
+
if (r.indexOf(Ke) > 0 && r.indexOf(ze) === 0)
|
|
1439
|
+
r = r.replace(Ke, "").replace(ze, ""), i = !0;
|
|
1599
1440
|
else if (r.indexOf("$FN:") === 0)
|
|
1600
1441
|
r = r.substring(4), i = !0;
|
|
1601
1442
|
else if (r.indexOf("$EXEC:") === 0)
|
|
@@ -1609,19 +1450,19 @@ function W(t, e) {
|
|
|
1609
1450
|
}, r.__json = t, r.__inject = !0, r;
|
|
1610
1451
|
} else {
|
|
1611
1452
|
if (r.indexOf("$FNX:") === 0)
|
|
1612
|
-
return r =
|
|
1453
|
+
return r = Te("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
|
|
1613
1454
|
(!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
|
|
1614
1455
|
}
|
|
1615
1456
|
if (!i) return t;
|
|
1616
1457
|
let s;
|
|
1617
1458
|
try {
|
|
1618
|
-
s =
|
|
1459
|
+
s = Te(r);
|
|
1619
1460
|
} catch (n) {
|
|
1620
|
-
s =
|
|
1461
|
+
s = Te("function " + r);
|
|
1621
1462
|
}
|
|
1622
1463
|
return s.__json = t, s;
|
|
1623
1464
|
} catch (s) {
|
|
1624
|
-
|
|
1465
|
+
et(`解析失败:${r}
|
|
1625
1466
|
|
|
1626
1467
|
err: ${s}`);
|
|
1627
1468
|
return;
|
|
@@ -1631,21 +1472,21 @@ err: ${s}`);
|
|
|
1631
1472
|
}
|
|
1632
1473
|
function Vt(t, e) {
|
|
1633
1474
|
return JSON.parse(t, function(r, i) {
|
|
1634
|
-
return h.Undef(i) || !i.indexOf ? i :
|
|
1475
|
+
return h.Undef(i) || !i.indexOf ? i : z(i, e);
|
|
1635
1476
|
});
|
|
1636
1477
|
}
|
|
1637
|
-
let
|
|
1638
|
-
function
|
|
1639
|
-
const t = 370 + ++
|
|
1478
|
+
let Gr = 0;
|
|
1479
|
+
function Ae() {
|
|
1480
|
+
const t = 370 + ++Gr;
|
|
1640
1481
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1641
1482
|
}
|
|
1642
|
-
function
|
|
1483
|
+
function se(t, e, r) {
|
|
1643
1484
|
let i = t, s;
|
|
1644
1485
|
return (e || "").split(".").forEach((n) => {
|
|
1645
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1646
|
-
}),
|
|
1486
|
+
s && ((!i[s] || typeof i[s] != "object") && S(i, s, {}), i = i[s]), s = n;
|
|
1487
|
+
}), S(i, s, r), i;
|
|
1647
1488
|
}
|
|
1648
|
-
function
|
|
1489
|
+
function Xe(t, e) {
|
|
1649
1490
|
return {
|
|
1650
1491
|
value: t,
|
|
1651
1492
|
enumerable: !1,
|
|
@@ -1657,18 +1498,18 @@ function Pt(t, e) {
|
|
|
1657
1498
|
return Bt([t], e || !1)[0];
|
|
1658
1499
|
}
|
|
1659
1500
|
function Bt(t, e) {
|
|
1660
|
-
return
|
|
1501
|
+
return _e([], [...t], e || !1);
|
|
1661
1502
|
}
|
|
1662
|
-
function
|
|
1663
|
-
return
|
|
1503
|
+
function x(t, e) {
|
|
1504
|
+
return Y(Array.isArray(e) ? e : [e], t, { array: Ye, normal: xe }), t;
|
|
1664
1505
|
}
|
|
1665
1506
|
function ct(t) {
|
|
1666
1507
|
const e = h.Function(t.getRule) ? t.getRule() : t;
|
|
1667
1508
|
return e.type || (e.type = "input"), e;
|
|
1668
1509
|
}
|
|
1669
|
-
function
|
|
1510
|
+
function Hr(t, e) {
|
|
1670
1511
|
return t ? (Object.keys(e || {}).forEach((r) => {
|
|
1671
|
-
e[r] && (t[r] =
|
|
1512
|
+
e[r] && (t[r] = x(t[r] || {}, e[r]));
|
|
1672
1513
|
}), t) : e;
|
|
1673
1514
|
}
|
|
1674
1515
|
function Lt(t, e) {
|
|
@@ -1678,35 +1519,35 @@ function Lt(t, e) {
|
|
|
1678
1519
|
}
|
|
1679
1520
|
}, r), {}));
|
|
1680
1521
|
}
|
|
1681
|
-
function
|
|
1522
|
+
function Z(t) {
|
|
1682
1523
|
return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
|
|
1683
1524
|
}
|
|
1684
1525
|
function O(t, e) {
|
|
1685
1526
|
try {
|
|
1686
1527
|
e = t();
|
|
1687
1528
|
} catch (r) {
|
|
1688
|
-
|
|
1529
|
+
Ur(r);
|
|
1689
1530
|
}
|
|
1690
1531
|
return e;
|
|
1691
1532
|
}
|
|
1692
|
-
function
|
|
1533
|
+
function Qe(t, e) {
|
|
1693
1534
|
let r = null;
|
|
1694
|
-
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) =>
|
|
1535
|
+
return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Qe(i, e)) : r = t, r && e && H(r).forEach((i) => {
|
|
1695
1536
|
(Array.isArray(i) ? i : [i]).forEach((n) => {
|
|
1696
1537
|
n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
|
|
1697
1538
|
});
|
|
1698
1539
|
}), r;
|
|
1699
1540
|
}
|
|
1700
|
-
function
|
|
1541
|
+
function Jr(t, e) {
|
|
1701
1542
|
if (h.Object(t)) {
|
|
1702
1543
|
const r = {};
|
|
1703
1544
|
return Object.keys(t).forEach((i) => {
|
|
1704
|
-
r[i] =
|
|
1545
|
+
r[i] = Qe(t[i], i);
|
|
1705
1546
|
}), r;
|
|
1706
1547
|
} else
|
|
1707
|
-
return
|
|
1548
|
+
return Qe(t, e);
|
|
1708
1549
|
}
|
|
1709
|
-
function
|
|
1550
|
+
function Fe() {
|
|
1710
1551
|
const t = {}, e = (r) => r || "default";
|
|
1711
1552
|
return {
|
|
1712
1553
|
setSlot(r, i) {
|
|
@@ -1722,7 +1563,7 @@ function Oe() {
|
|
|
1722
1563
|
const n = s();
|
|
1723
1564
|
Array.isArray(n) ? i.push(...n) : i.push(n);
|
|
1724
1565
|
} else h.Undef(s) || i.push(s);
|
|
1725
|
-
}),
|
|
1566
|
+
}), Jr(i, r);
|
|
1726
1567
|
},
|
|
1727
1568
|
getSlots() {
|
|
1728
1569
|
let r = [];
|
|
@@ -1780,12 +1621,12 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1780
1621
|
return new RegExp(e, "g").test(t);
|
|
1781
1622
|
}
|
|
1782
1623
|
};
|
|
1783
|
-
function
|
|
1624
|
+
function B(t, e) {
|
|
1784
1625
|
return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
|
|
1785
1626
|
t != null && (t = t[r]);
|
|
1786
1627
|
}), t;
|
|
1787
1628
|
}
|
|
1788
|
-
function
|
|
1629
|
+
function Wr(t) {
|
|
1789
1630
|
const e = /{{\s*(.*?)\s*}}/g;
|
|
1790
1631
|
let r;
|
|
1791
1632
|
const i = {};
|
|
@@ -1799,6 +1640,170 @@ function dt(t) {
|
|
|
1799
1640
|
n === 0 ? i = s : i += "." + s, r.push(i);
|
|
1800
1641
|
}), r.join(" && ");
|
|
1801
1642
|
}
|
|
1643
|
+
const ke = (t, e) => {
|
|
1644
|
+
if (!(!t || t === e || !t.$props)) {
|
|
1645
|
+
if (t.$props.formCreateInject)
|
|
1646
|
+
return t.$props.formCreateInject;
|
|
1647
|
+
if (t.$parent)
|
|
1648
|
+
return ke(t.$parent, e);
|
|
1649
|
+
}
|
|
1650
|
+
};
|
|
1651
|
+
function zr(t, e, r) {
|
|
1652
|
+
const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
|
|
1653
|
+
return {
|
|
1654
|
+
name: i,
|
|
1655
|
+
componentName: i,
|
|
1656
|
+
model: {
|
|
1657
|
+
prop: "api"
|
|
1658
|
+
},
|
|
1659
|
+
components: e,
|
|
1660
|
+
directives: r,
|
|
1661
|
+
provide() {
|
|
1662
|
+
return {
|
|
1663
|
+
$pfc: this
|
|
1664
|
+
};
|
|
1665
|
+
},
|
|
1666
|
+
inject: { $pfc: { default: null } },
|
|
1667
|
+
props: {
|
|
1668
|
+
rule: {
|
|
1669
|
+
type: Array,
|
|
1670
|
+
required: !0,
|
|
1671
|
+
default: () => []
|
|
1672
|
+
},
|
|
1673
|
+
option: {
|
|
1674
|
+
type: Object,
|
|
1675
|
+
default: () => ({})
|
|
1676
|
+
},
|
|
1677
|
+
extendOption: Boolean,
|
|
1678
|
+
driver: [String, Object],
|
|
1679
|
+
value: Object,
|
|
1680
|
+
disabled: {
|
|
1681
|
+
type: Boolean,
|
|
1682
|
+
default: void 0
|
|
1683
|
+
},
|
|
1684
|
+
preview: {
|
|
1685
|
+
type: Boolean,
|
|
1686
|
+
default: void 0
|
|
1687
|
+
},
|
|
1688
|
+
index: [String, Number],
|
|
1689
|
+
api: Object,
|
|
1690
|
+
locale: [String, Object],
|
|
1691
|
+
name: String,
|
|
1692
|
+
subForm: {
|
|
1693
|
+
type: Boolean,
|
|
1694
|
+
default: !0
|
|
1695
|
+
},
|
|
1696
|
+
inFor: Boolean
|
|
1697
|
+
},
|
|
1698
|
+
render() {
|
|
1699
|
+
return this.fc.render();
|
|
1700
|
+
},
|
|
1701
|
+
setup(s) {
|
|
1702
|
+
const n = lr().proxy;
|
|
1703
|
+
ur("parentFC", n);
|
|
1704
|
+
const o = fr("parentFC", null);
|
|
1705
|
+
let a = o;
|
|
1706
|
+
if (o)
|
|
1707
|
+
for (; a.parent; )
|
|
1708
|
+
a = a.parent;
|
|
1709
|
+
else
|
|
1710
|
+
a = n;
|
|
1711
|
+
const { rule: l, value: u, subForm: f, inFor: p } = lt(s), m = ie({
|
|
1712
|
+
ctxInject: {},
|
|
1713
|
+
destroyed: !1,
|
|
1714
|
+
isShow: !0,
|
|
1715
|
+
unique: 1,
|
|
1716
|
+
renderRule: [...l.value || []],
|
|
1717
|
+
updateValue: JSON.stringify(u.value || {})
|
|
1718
|
+
}), g = new t(n), $ = g.api(), _ = p.value, D = () => {
|
|
1719
|
+
if (o) {
|
|
1720
|
+
const F = ke(n, o);
|
|
1721
|
+
if (F) {
|
|
1722
|
+
let R;
|
|
1723
|
+
_ ? (R = H(F.getSubForm()), R.push($)) : R = $, F.subForm(R);
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
}, ee = () => {
|
|
1727
|
+
const F = ke(n, o);
|
|
1728
|
+
if (F)
|
|
1729
|
+
if (_) {
|
|
1730
|
+
const R = H(F.getSubForm()), N = R.indexOf($);
|
|
1731
|
+
N > -1 && R.splice(N, 1);
|
|
1732
|
+
} else
|
|
1733
|
+
F.subForm();
|
|
1734
|
+
};
|
|
1735
|
+
let P = null;
|
|
1736
|
+
cr(() => {
|
|
1737
|
+
L(() => {
|
|
1738
|
+
let F = "";
|
|
1739
|
+
const R = s.option && s.option.globalClass || {};
|
|
1740
|
+
Object.keys(R).forEach((N) => {
|
|
1741
|
+
let de = "";
|
|
1742
|
+
R[N].style && Object.keys(R[N].style).forEach((J) => {
|
|
1743
|
+
de += ve(J) + ":" + R[N].style[J] + ";";
|
|
1744
|
+
}), R[N].content && (de += R[N].content + ";"), de && (F += `.${N}{${de}}`);
|
|
1745
|
+
}), s.option && s.option.style && (F += s.option.style), P || (P = document.createElement("style"), P.type = "text/css", document.head.appendChild(P)), P.innerHTML = F || "";
|
|
1746
|
+
}, () => {
|
|
1747
|
+
});
|
|
1748
|
+
});
|
|
1749
|
+
const T = ne(() => {
|
|
1750
|
+
g.bus.$emit("$loadData.$topForm");
|
|
1751
|
+
}, 100), ce = ne(function() {
|
|
1752
|
+
g.bus.$emit("$loadData.$scopeForm");
|
|
1753
|
+
}, 100), Ve = ne(() => {
|
|
1754
|
+
g.bus.$emit("$loadData.$form");
|
|
1755
|
+
}, 100), he = (F) => {
|
|
1756
|
+
g.bus.$emit("change-$form." + F);
|
|
1757
|
+
};
|
|
1758
|
+
return hr(() => {
|
|
1759
|
+
o && ($.top.bus.$on("$loadData.$form", T), $.top.bus.$on("change", he)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", ce), g.mounted();
|
|
1760
|
+
}), dr(() => {
|
|
1761
|
+
o && ($.top.bus.$off("$loadData.$form", T), $.top.bus.$off("change", he)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", ce), P && document.head.removeChild(P), ee(), m.destroyed = !0, g.unmount();
|
|
1762
|
+
}), pr(() => {
|
|
1763
|
+
g.updated();
|
|
1764
|
+
}), L(f, (F) => {
|
|
1765
|
+
F ? D() : ee();
|
|
1766
|
+
}, { immediate: !0 }), L(() => s.option, () => {
|
|
1767
|
+
g.initOptions(), $.refresh();
|
|
1768
|
+
}, { deep: !0 }), L(() => [...l.value], (F) => {
|
|
1769
|
+
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());
|
|
1770
|
+
}), L(() => [s.disabled, s.preview], () => {
|
|
1771
|
+
$.refresh();
|
|
1772
|
+
}), L(u, (F) => {
|
|
1773
|
+
be(F || {}) !== m.updateValue && ($.config.forceCoverValue ? $.coverValue(F || {}) : $.setValue(F || {}));
|
|
1774
|
+
}, { deep: !0, flush: "post" }), L(() => s.index, () => {
|
|
1775
|
+
$.coverValue({}), g.$handle.updateAppendData(), A(() => {
|
|
1776
|
+
A(() => {
|
|
1777
|
+
$.clearValidateState();
|
|
1778
|
+
});
|
|
1779
|
+
});
|
|
1780
|
+
}, { flush: "sync" }), U(b({
|
|
1781
|
+
fc: me(g),
|
|
1782
|
+
parent: o && me(o),
|
|
1783
|
+
top: me(a),
|
|
1784
|
+
fapi: me($)
|
|
1785
|
+
}, lt(m)), {
|
|
1786
|
+
getGroupInject: () => ke(n, o),
|
|
1787
|
+
refresh() {
|
|
1788
|
+
++m.unique;
|
|
1789
|
+
},
|
|
1790
|
+
renderRule() {
|
|
1791
|
+
m.renderRule = [...l.value || []];
|
|
1792
|
+
},
|
|
1793
|
+
updateValue(F) {
|
|
1794
|
+
if (m.destroyed) return;
|
|
1795
|
+
const R = be(F);
|
|
1796
|
+
m.updateValue !== R && (m.updateValue = R, n.$emit("update:value", F), A(() => {
|
|
1797
|
+
Ve(), o ? f.value || ce() : (T(), ce());
|
|
1798
|
+
}));
|
|
1799
|
+
}
|
|
1800
|
+
});
|
|
1801
|
+
},
|
|
1802
|
+
created() {
|
|
1803
|
+
this.$emit("input", this.fapi), this.fc.init();
|
|
1804
|
+
}
|
|
1805
|
+
};
|
|
1806
|
+
}
|
|
1802
1807
|
function Tt() {
|
|
1803
1808
|
return {
|
|
1804
1809
|
props: {},
|
|
@@ -1811,21 +1816,21 @@ function Tt() {
|
|
|
1811
1816
|
value: void 0
|
|
1812
1817
|
};
|
|
1813
1818
|
}
|
|
1814
|
-
function
|
|
1819
|
+
function V(t, e) {
|
|
1815
1820
|
return (r, i, s, n = {}) => {
|
|
1816
1821
|
const o = new tt(t, r, i, s, n);
|
|
1817
1822
|
return e && (h.Function(e) ? e(o) : o.props(e)), o;
|
|
1818
1823
|
};
|
|
1819
1824
|
}
|
|
1820
1825
|
function tt(t, e, r, i, s) {
|
|
1821
|
-
this._data =
|
|
1826
|
+
this._data = C(Tt(), { type: t, title: e, field: r, value: i, props: s || {} }), this.event = this.on;
|
|
1822
1827
|
}
|
|
1823
|
-
|
|
1828
|
+
C(tt.prototype, {
|
|
1824
1829
|
getRule() {
|
|
1825
1830
|
return this._data;
|
|
1826
1831
|
},
|
|
1827
1832
|
setProp(t, e) {
|
|
1828
|
-
return
|
|
1833
|
+
return S(this._data, t, e), this;
|
|
1829
1834
|
},
|
|
1830
1835
|
_clone() {
|
|
1831
1836
|
const t = new this.constructor();
|
|
@@ -1835,12 +1840,12 @@ _(tt.prototype, {
|
|
|
1835
1840
|
function Nt(t) {
|
|
1836
1841
|
t.forEach((e) => {
|
|
1837
1842
|
tt.prototype[e] = function(r) {
|
|
1838
|
-
return
|
|
1843
|
+
return x(this._data, { [e]: arguments.length < 2 ? r : { [r]: arguments[1] } }), this;
|
|
1839
1844
|
};
|
|
1840
1845
|
});
|
|
1841
1846
|
}
|
|
1842
1847
|
Nt(It());
|
|
1843
|
-
const Mt =
|
|
1848
|
+
const Mt = V("");
|
|
1844
1849
|
function Kr(t, e, r) {
|
|
1845
1850
|
let i = Mt("", e);
|
|
1846
1851
|
return i._data.type = t, i._data.title = r, i;
|
|
@@ -1854,7 +1859,7 @@ function Xr() {
|
|
|
1854
1859
|
create: Kr,
|
|
1855
1860
|
createTmp: pt,
|
|
1856
1861
|
template: pt,
|
|
1857
|
-
factory:
|
|
1862
|
+
factory: V
|
|
1858
1863
|
};
|
|
1859
1864
|
}
|
|
1860
1865
|
function Qr(t, e, r) {
|
|
@@ -1903,8 +1908,8 @@ function gt(t, e, r) {
|
|
|
1903
1908
|
(e || Ut)(U(b({}, t), {
|
|
1904
1909
|
onSuccess(n) {
|
|
1905
1910
|
let o = (l) => l;
|
|
1906
|
-
const a =
|
|
1907
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) =>
|
|
1911
|
+
const a = z(t.parse);
|
|
1912
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => B(l, a)), i(o(n, void 0, r));
|
|
1908
1913
|
},
|
|
1909
1914
|
onError(n) {
|
|
1910
1915
|
s(n);
|
|
@@ -1912,17 +1917,18 @@ function gt(t, e, r) {
|
|
|
1912
1917
|
}));
|
|
1913
1918
|
});
|
|
1914
1919
|
}
|
|
1915
|
-
function
|
|
1916
|
-
return
|
|
1920
|
+
function $e(t) {
|
|
1921
|
+
return G(t);
|
|
1917
1922
|
}
|
|
1918
1923
|
function Zr(t) {
|
|
1919
1924
|
function e(n) {
|
|
1920
1925
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1921
1926
|
}
|
|
1922
1927
|
function r(n, o, a) {
|
|
1923
|
-
|
|
1924
|
-
t.
|
|
1925
|
-
|
|
1928
|
+
h.Undef(n) ? n = Object.keys(b(b({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
|
|
1929
|
+
const u = t.fieldCtx[l] || t.nameCtx[l];
|
|
1930
|
+
u && u.forEach((f) => {
|
|
1931
|
+
S(f.rule, o, a), t.$render.clearCache(f);
|
|
1926
1932
|
});
|
|
1927
1933
|
});
|
|
1928
1934
|
}
|
|
@@ -1934,6 +1940,12 @@ function Zr(t) {
|
|
|
1934
1940
|
}, []);
|
|
1935
1941
|
}
|
|
1936
1942
|
const s = {
|
|
1943
|
+
get isScope() {
|
|
1944
|
+
return t.vm.$props.subForm === !1;
|
|
1945
|
+
},
|
|
1946
|
+
get isPreview() {
|
|
1947
|
+
return t.preview;
|
|
1948
|
+
},
|
|
1937
1949
|
get config() {
|
|
1938
1950
|
return t.options;
|
|
1939
1951
|
},
|
|
@@ -1958,6 +1970,15 @@ function Zr(t) {
|
|
|
1958
1970
|
get top() {
|
|
1959
1971
|
return s.parent ? s.parent.top : s;
|
|
1960
1972
|
},
|
|
1973
|
+
get scope() {
|
|
1974
|
+
let n = t.vm;
|
|
1975
|
+
for (; n && n.fapi; )
|
|
1976
|
+
if (n.$props.subForm)
|
|
1977
|
+
n = n.parent;
|
|
1978
|
+
else
|
|
1979
|
+
return n.fapi;
|
|
1980
|
+
return s.top;
|
|
1981
|
+
},
|
|
1961
1982
|
get children() {
|
|
1962
1983
|
return i();
|
|
1963
1984
|
},
|
|
@@ -1977,17 +1998,17 @@ function Zr(t) {
|
|
|
1977
1998
|
}
|
|
1978
1999
|
},
|
|
1979
2000
|
formData(n) {
|
|
1980
|
-
if (n == null) {
|
|
2001
|
+
if (n == null || typeof n == "boolean") {
|
|
1981
2002
|
const o = {};
|
|
1982
2003
|
return Object.keys(t.form).forEach((a) => {
|
|
1983
|
-
t.ignoreFields.indexOf(a) === -1 && (o[a] =
|
|
2004
|
+
(n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] = $e(t.form[a]));
|
|
1984
2005
|
}), o;
|
|
1985
2006
|
} else
|
|
1986
2007
|
return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
|
|
1987
2008
|
},
|
|
1988
2009
|
getValue(n) {
|
|
1989
2010
|
const o = t.getFieldCtx(n);
|
|
1990
|
-
return o ?
|
|
2011
|
+
return o ? $e(o.rule.value) : t.options.appendValue !== !1 && E(t.appendData, n) ? $e(t.appendData[n]) : void 0;
|
|
1991
2012
|
},
|
|
1992
2013
|
coverValue(n) {
|
|
1993
2014
|
const o = b({}, n || {});
|
|
@@ -1995,12 +2016,12 @@ function Zr(t) {
|
|
|
1995
2016
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
1996
2017
|
const l = t.fieldCtx[a];
|
|
1997
2018
|
if (l) {
|
|
1998
|
-
const u =
|
|
2019
|
+
const u = E(n, a);
|
|
1999
2020
|
l.forEach((f) => {
|
|
2000
2021
|
f.rule.value = u ? n[a] : void 0;
|
|
2001
2022
|
}), delete o[a];
|
|
2002
2023
|
}
|
|
2003
|
-
}),
|
|
2024
|
+
}), C(t.appendData, o);
|
|
2004
2025
|
}, !0);
|
|
2005
2026
|
},
|
|
2006
2027
|
setValue(n) {
|
|
@@ -2024,7 +2045,7 @@ function Zr(t) {
|
|
|
2024
2045
|
}, !0), o ? o.origin : void 0;
|
|
2025
2046
|
},
|
|
2026
2047
|
removeRule(n) {
|
|
2027
|
-
const o = n &&
|
|
2048
|
+
const o = n && Z(n);
|
|
2028
2049
|
if (o)
|
|
2029
2050
|
return o.rm(), o.origin;
|
|
2030
2051
|
},
|
|
@@ -2074,7 +2095,7 @@ function Zr(t) {
|
|
|
2074
2095
|
disabled(n, o) {
|
|
2075
2096
|
e(o).forEach((a) => {
|
|
2076
2097
|
t.getCtxs(a).forEach((l) => {
|
|
2077
|
-
|
|
2098
|
+
S(l.rule.props, "disabled", !!n);
|
|
2078
2099
|
});
|
|
2079
2100
|
}), t.refresh();
|
|
2080
2101
|
},
|
|
@@ -2113,7 +2134,7 @@ function Zr(t) {
|
|
|
2113
2134
|
n.forEach((a) => s.sync(a));
|
|
2114
2135
|
return;
|
|
2115
2136
|
}
|
|
2116
|
-
let o = h.Object(n) ?
|
|
2137
|
+
let o = h.Object(n) ? Z(n) : t.getCtxs(n);
|
|
2117
2138
|
o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
|
|
2118
2139
|
if (!a.deleted) {
|
|
2119
2140
|
const l = t.subForm[a.id];
|
|
@@ -2132,7 +2153,7 @@ function Zr(t) {
|
|
|
2132
2153
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2133
2154
|
},
|
|
2134
2155
|
hideForm: (n) => {
|
|
2135
|
-
|
|
2156
|
+
S(t.vm, "isShow", !n);
|
|
2136
2157
|
},
|
|
2137
2158
|
changeStatus: () => t.changeStatus,
|
|
2138
2159
|
clearChangeStatus: () => {
|
|
@@ -2140,7 +2161,7 @@ function Zr(t) {
|
|
|
2140
2161
|
},
|
|
2141
2162
|
updateRule(n, o) {
|
|
2142
2163
|
t.getCtxs(n).forEach((a) => {
|
|
2143
|
-
|
|
2164
|
+
C(a.rule, o);
|
|
2144
2165
|
});
|
|
2145
2166
|
},
|
|
2146
2167
|
updateRules(n) {
|
|
@@ -2150,7 +2171,7 @@ function Zr(t) {
|
|
|
2150
2171
|
},
|
|
2151
2172
|
mergeRule: (n, o) => {
|
|
2152
2173
|
t.getCtxs(n).forEach((a) => {
|
|
2153
|
-
|
|
2174
|
+
x(a.rule, o);
|
|
2154
2175
|
});
|
|
2155
2176
|
},
|
|
2156
2177
|
mergeRules(n) {
|
|
@@ -2177,7 +2198,7 @@ function Zr(t) {
|
|
|
2177
2198
|
},
|
|
2178
2199
|
setEffect(n, o, a) {
|
|
2179
2200
|
const l = t.getCtx(n);
|
|
2180
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2201
|
+
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
2202
|
},
|
|
2182
2203
|
clearEffectData(n, o) {
|
|
2183
2204
|
const a = t.getCtx(n);
|
|
@@ -2197,11 +2218,11 @@ function Zr(t) {
|
|
|
2197
2218
|
resetFields(n) {
|
|
2198
2219
|
e(n).forEach((o) => {
|
|
2199
2220
|
t.getCtxs(o).forEach((a) => {
|
|
2200
|
-
t.$render.clearCache(a), a.rule.value =
|
|
2221
|
+
t.$render.clearCache(a), a.rule.value = $e(a.defaultValue);
|
|
2201
2222
|
});
|
|
2202
|
-
}),
|
|
2203
|
-
|
|
2204
|
-
|
|
2223
|
+
}), A(() => {
|
|
2224
|
+
A(() => {
|
|
2225
|
+
A(() => {
|
|
2205
2226
|
s.clearValidateState(n);
|
|
2206
2227
|
});
|
|
2207
2228
|
});
|
|
@@ -2217,7 +2238,7 @@ function Zr(t) {
|
|
|
2217
2238
|
return O(() => s.method(n, o)(...a));
|
|
2218
2239
|
},
|
|
2219
2240
|
toJson(n) {
|
|
2220
|
-
return
|
|
2241
|
+
return be(s.rule, n);
|
|
2221
2242
|
},
|
|
2222
2243
|
trigger(n, o, ...a) {
|
|
2223
2244
|
const l = s.el(n);
|
|
@@ -2236,21 +2257,21 @@ function Zr(t) {
|
|
|
2236
2257
|
return o ? t.subForm[o.id] : void 0;
|
|
2237
2258
|
},
|
|
2238
2259
|
getChildrenRuleList(n) {
|
|
2239
|
-
const o = typeof n == "object", a = o ?
|
|
2260
|
+
const o = typeof n == "object", a = o ? Z(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
|
|
2240
2261
|
if (!l)
|
|
2241
2262
|
return [];
|
|
2242
2263
|
const u = [];
|
|
2243
|
-
return ((
|
|
2244
|
-
|
|
2264
|
+
return ((p) => {
|
|
2265
|
+
p && p.forEach((m) => {
|
|
2245
2266
|
typeof m == "object" && (m.field && u.push(m), u.push(...s.getChildrenRuleList(m)));
|
|
2246
2267
|
});
|
|
2247
2268
|
})(a ? a.loadChildrenPending() : l.children), u;
|
|
2248
2269
|
},
|
|
2249
2270
|
getParentRule(n) {
|
|
2250
|
-
return (typeof n == "object" ?
|
|
2271
|
+
return (typeof n == "object" ? Z(n) : t.getCtx(n)).parent.rule;
|
|
2251
2272
|
},
|
|
2252
2273
|
getParentSubRule(n) {
|
|
2253
|
-
const a = typeof n == "object" ?
|
|
2274
|
+
const a = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2254
2275
|
if (a) {
|
|
2255
2276
|
const l = a.getParentGroup();
|
|
2256
2277
|
if (l)
|
|
@@ -2258,20 +2279,20 @@ function Zr(t) {
|
|
|
2258
2279
|
}
|
|
2259
2280
|
},
|
|
2260
2281
|
getChildrenFormData(n) {
|
|
2261
|
-
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] =
|
|
2282
|
+
return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] = $e(l.value), a), {});
|
|
2262
2283
|
},
|
|
2263
2284
|
setChildrenFormData(n, o, a) {
|
|
2264
2285
|
const l = s.getChildrenRuleList(n);
|
|
2265
2286
|
t.deferSyncValue(() => {
|
|
2266
2287
|
l.forEach((u) => {
|
|
2267
|
-
|
|
2288
|
+
E(o, u.field) ? u.value = o[u.field] : a && (u.value = void 0);
|
|
2268
2289
|
});
|
|
2269
2290
|
});
|
|
2270
2291
|
},
|
|
2271
2292
|
getGlobalEvent(n) {
|
|
2272
2293
|
let o = s.options.globalEvent[n];
|
|
2273
2294
|
if (o)
|
|
2274
|
-
return typeof o == "object" && (o = o.handle),
|
|
2295
|
+
return typeof o == "object" && (o = o.handle), z(o);
|
|
2275
2296
|
},
|
|
2276
2297
|
getGlobalData(n) {
|
|
2277
2298
|
return new Promise((o, a) => {
|
|
@@ -2282,11 +2303,11 @@ function Zr(t) {
|
|
|
2282
2303
|
});
|
|
2283
2304
|
},
|
|
2284
2305
|
renderRule(n, o, a) {
|
|
2285
|
-
const u = typeof n == "object" ?
|
|
2306
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2286
2307
|
return u ? t.$render.createRuleVnode(u, o, a) : void 0;
|
|
2287
2308
|
},
|
|
2288
2309
|
renderChildren(n, o, a) {
|
|
2289
|
-
const u = typeof n == "object" ?
|
|
2310
|
+
const u = typeof n == "object" ? Z(n) : t.getCtx(n);
|
|
2290
2311
|
return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
|
|
2291
2312
|
},
|
|
2292
2313
|
nextTick(n) {
|
|
@@ -2304,7 +2325,7 @@ function Zr(t) {
|
|
|
2304
2325
|
bus: t.bus,
|
|
2305
2326
|
fetch(n) {
|
|
2306
2327
|
return new Promise((o, a) => {
|
|
2307
|
-
n =
|
|
2328
|
+
n = G(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
2308
2329
|
O(() => n.onSuccess && n.onSuccess(l)), o(l);
|
|
2309
2330
|
}).catch((l) => {
|
|
2310
2331
|
O(() => n.onError && n.onError(l)), a(l);
|
|
@@ -2313,16 +2334,16 @@ function Zr(t) {
|
|
|
2313
2334
|
},
|
|
2314
2335
|
watchFetch(n, o, a, l) {
|
|
2315
2336
|
return t.fc.watchLoadData((u, f) => {
|
|
2316
|
-
let
|
|
2317
|
-
|
|
2318
|
-
O(() =>
|
|
2337
|
+
let p = G(n);
|
|
2338
|
+
p = t.loadFetchVar(p, u), !(l && l(p, f) === !1) && t.beforeFetch(p).then(() => gt(p, t.fc.create.fetch, s).then((m) => {
|
|
2339
|
+
O(() => p.onSuccess && p.onSuccess(m)), o && o(m, f);
|
|
2319
2340
|
}).catch((m) => {
|
|
2320
|
-
O(() =>
|
|
2341
|
+
O(() => p.onError && p.onError(m)), a && a(m);
|
|
2321
2342
|
}));
|
|
2322
2343
|
}, n.wait == null ? 1e3 : n.wait);
|
|
2323
2344
|
},
|
|
2324
2345
|
getData(n, o) {
|
|
2325
|
-
return t.fc.getLoadData(n, o);
|
|
2346
|
+
return t.fc.get ? t.fc.get(n, o) : t.fc.getLoadData(n, o);
|
|
2326
2347
|
},
|
|
2327
2348
|
setData(n, o, a) {
|
|
2328
2349
|
return t.fc.setData(n, o, a);
|
|
@@ -2348,7 +2369,7 @@ function Zr(t) {
|
|
|
2348
2369
|
}), s.changeValue = s.changeField = s.setValue, s;
|
|
2349
2370
|
}
|
|
2350
2371
|
function Yr(t) {
|
|
2351
|
-
|
|
2372
|
+
C(t.prototype, {
|
|
2352
2373
|
initCache() {
|
|
2353
2374
|
this.clearCacheAll();
|
|
2354
2375
|
},
|
|
@@ -2389,7 +2410,7 @@ function qt(t) {
|
|
|
2389
2410
|
return t.replace(t[0], t[0].toLowerCase());
|
|
2390
2411
|
}
|
|
2391
2412
|
function xr(t) {
|
|
2392
|
-
|
|
2413
|
+
C(t.prototype, {
|
|
2393
2414
|
initRender() {
|
|
2394
2415
|
this.cacheConfig = {};
|
|
2395
2416
|
},
|
|
@@ -2397,7 +2418,7 @@ function xr(t) {
|
|
|
2397
2418
|
const r = (i) => {
|
|
2398
2419
|
if (i) {
|
|
2399
2420
|
let s;
|
|
2400
|
-
return e.rule.field && (s = i.$scopedSlots["field-" +
|
|
2421
|
+
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
2422
|
}
|
|
2402
2423
|
};
|
|
2403
2424
|
return r(this.vm);
|
|
@@ -2406,7 +2427,7 @@ function xr(t) {
|
|
|
2406
2427
|
if (!this.vm.isShow)
|
|
2407
2428
|
return;
|
|
2408
2429
|
this.$manager.beforeRender();
|
|
2409
|
-
const e =
|
|
2430
|
+
const e = Fe();
|
|
2410
2431
|
return this.sort.forEach((r) => {
|
|
2411
2432
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2412
2433
|
}), this.$manager.render(e);
|
|
@@ -2417,23 +2438,23 @@ function xr(t) {
|
|
|
2417
2438
|
})) : e.setSlot(r.rule.slot, this.renderCtx(r, i));
|
|
2418
2439
|
},
|
|
2419
2440
|
mergeGlobal(e) {
|
|
2420
|
-
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] =
|
|
2441
|
+
this.$handle.options.global && (this.cacheConfig[e.trueType] || (this.cacheConfig[e.trueType] = ge(() => {
|
|
2421
2442
|
const i = this.$handle.options.global;
|
|
2422
|
-
return
|
|
2423
|
-
})), e.prop =
|
|
2443
|
+
return x({}, [i["*"] || i.default || {}, i[e.originType] || i[e.type] || i[e.type] || {}]);
|
|
2444
|
+
})), e.prop = x({}, [this.cacheConfig[e.trueType].value, e.prop]));
|
|
2424
2445
|
},
|
|
2425
2446
|
setOptions(e) {
|
|
2426
2447
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2427
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2448
|
+
e.prop.options = r, e.prop.optionsTo && r && se(e.prop, e.prop.optionsTo, r);
|
|
2428
2449
|
},
|
|
2429
2450
|
deepSet(e) {
|
|
2430
2451
|
const r = e.rule.deep;
|
|
2431
2452
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2432
|
-
|
|
2453
|
+
se(e.prop, i, r[i]);
|
|
2433
2454
|
});
|
|
2434
2455
|
},
|
|
2435
2456
|
parseSide(e, r) {
|
|
2436
|
-
return h.Object(e) ?
|
|
2457
|
+
return h.Object(e) ? x({ props: { formCreateInject: r.prop.props.formCreateInject } }, e) : e;
|
|
2437
2458
|
},
|
|
2438
2459
|
renderSides(e, r, i) {
|
|
2439
2460
|
const s = r[i ? "rule" : "prop"];
|
|
@@ -2469,21 +2490,21 @@ function xr(t) {
|
|
|
2469
2490
|
};
|
|
2470
2491
|
l.length && i.slotUpdate && O(() => i.slotUpdate(u));
|
|
2471
2492
|
let f = [];
|
|
2472
|
-
const
|
|
2473
|
-
e.parser.renderChildren ? f = e.parser.renderChildren(
|
|
2493
|
+
const p = e.loadChildrenPending();
|
|
2494
|
+
e.parser.renderChildren ? f = e.parser.renderChildren(p, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(p, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
|
|
2474
2495
|
f.push(this.renderRule({
|
|
2475
2496
|
type: "template",
|
|
2476
|
-
slot:
|
|
2497
|
+
slot: $
|
|
2477
2498
|
}, (() => {
|
|
2478
|
-
if (h.Function(n.renderSlots[
|
|
2479
|
-
return O(() => n.renderSlots[
|
|
2480
|
-
const
|
|
2481
|
-
return this.renderRule(
|
|
2499
|
+
if (h.Function(n.renderSlots[$]))
|
|
2500
|
+
return O(() => n.renderSlots[$]());
|
|
2501
|
+
const _ = this.parseSide(n.renderSlots[$], e);
|
|
2502
|
+
return this.renderRule(_);
|
|
2482
2503
|
})()));
|
|
2483
2504
|
});
|
|
2484
2505
|
const m = this.getTypeSlot(e);
|
|
2485
2506
|
let g;
|
|
2486
|
-
return m ? (u.children = f, g = m(u)) : g = a ? e.parser.preview(
|
|
2507
|
+
return m ? (u.children = f, g = m(u)) : g = a ? e.parser.preview(We(f), e) : e.parser.render(We(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
2508
|
}, this.setCache(e, s, r);
|
|
2488
2509
|
}
|
|
2489
2510
|
return (...s) => {
|
|
@@ -2546,7 +2567,7 @@ function xr(t) {
|
|
|
2546
2567
|
}
|
|
2547
2568
|
});
|
|
2548
2569
|
const i = r.ctxInject[e.id];
|
|
2549
|
-
return
|
|
2570
|
+
return C(i, {
|
|
2550
2571
|
preview: e.prop.preview,
|
|
2551
2572
|
options: e.prop.options,
|
|
2552
2573
|
prop: function() {
|
|
@@ -2559,7 +2580,11 @@ function xr(t) {
|
|
|
2559
2580
|
ctxProp(e) {
|
|
2560
2581
|
const { ref: r, key: i, rule: s } = e;
|
|
2561
2582
|
this.$manager.mergeProp(e), e.parser.mergeProp(e);
|
|
2562
|
-
const n =
|
|
2583
|
+
const n = b({}, e.prop.on || {}), o = {};
|
|
2584
|
+
Object.keys(n).forEach((l) => {
|
|
2585
|
+
l.indexOf("native.") === 0 && (o[l.replace("native.", "")] = n[l], delete n[l]);
|
|
2586
|
+
}), e.prop.on = n;
|
|
2587
|
+
const a = [
|
|
2563
2588
|
{
|
|
2564
2589
|
ref: r,
|
|
2565
2590
|
key: s.key || `${i}fc`,
|
|
@@ -2568,30 +2593,33 @@ function xr(t) {
|
|
|
2568
2593
|
"hook:mounted": () => {
|
|
2569
2594
|
this.onMounted(e);
|
|
2570
2595
|
},
|
|
2571
|
-
"fc.updateValue": (
|
|
2572
|
-
this.$handle.onUpdateValue(e,
|
|
2596
|
+
"fc.updateValue": (l) => {
|
|
2597
|
+
this.$handle.onUpdateValue(e, l);
|
|
2573
2598
|
},
|
|
2574
|
-
"fc.el": (
|
|
2575
|
-
e.exportEl =
|
|
2599
|
+
"fc.el": (l) => {
|
|
2600
|
+
e.exportEl = l, l && ((l.$el || l).__rule__ = e.rule);
|
|
2576
2601
|
}
|
|
2577
2602
|
}
|
|
2603
|
+
},
|
|
2604
|
+
{
|
|
2605
|
+
nativeOn: o
|
|
2578
2606
|
}
|
|
2579
2607
|
];
|
|
2580
2608
|
if (e.input) {
|
|
2581
|
-
const
|
|
2609
|
+
const l = this.tmpInput;
|
|
2582
2610
|
this.vm.$props.disabled === !0 && (e.prop.props.disabled = !0), e.prop.model = {
|
|
2583
2611
|
value: this.$handle.getFormData(e),
|
|
2584
|
-
callback: (
|
|
2585
|
-
|
|
2612
|
+
callback: (u) => {
|
|
2613
|
+
l && l(e.field, u, e.rule), this.onInput(e, u);
|
|
2586
2614
|
},
|
|
2587
2615
|
expression: `formData.${e.id}`
|
|
2588
|
-
}, e.prop.modelEmit &&
|
|
2616
|
+
}, e.prop.modelEmit && a.push({
|
|
2589
2617
|
on: {
|
|
2590
2618
|
[e.prop.modelEmit]: () => this.onEmitInput(e)
|
|
2591
2619
|
}
|
|
2592
2620
|
});
|
|
2593
2621
|
}
|
|
2594
|
-
return
|
|
2622
|
+
return Y(a, e.prop), e.prop;
|
|
2595
2623
|
},
|
|
2596
2624
|
onMounted(e) {
|
|
2597
2625
|
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");
|
|
@@ -2608,7 +2636,7 @@ function xr(t) {
|
|
|
2608
2636
|
},
|
|
2609
2637
|
renderChildren(e, r, i) {
|
|
2610
2638
|
if (!h.trueArray(e)) return [];
|
|
2611
|
-
const s =
|
|
2639
|
+
const s = Fe();
|
|
2612
2640
|
return e.map((n) => {
|
|
2613
2641
|
if (n) {
|
|
2614
2642
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2617,7 +2645,7 @@ function xr(t) {
|
|
|
2617
2645
|
}) : n);
|
|
2618
2646
|
if (n.__fc__)
|
|
2619
2647
|
return this.renderSlot(s, n.__fc__, r);
|
|
2620
|
-
n.type &&
|
|
2648
|
+
n.type && A(() => {
|
|
2621
2649
|
this.$handle.loadChildren(e, r), this.$handle.refresh();
|
|
2622
2650
|
});
|
|
2623
2651
|
}
|
|
@@ -2634,7 +2662,7 @@ function xr(t) {
|
|
|
2634
2662
|
},
|
|
2635
2663
|
createRuleVnode(e, r, i) {
|
|
2636
2664
|
this.force = i !== !1, this.tmpInput = r;
|
|
2637
|
-
const s =
|
|
2665
|
+
const s = Fe();
|
|
2638
2666
|
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2639
2667
|
},
|
|
2640
2668
|
renderRule(e, r, i) {
|
|
@@ -2649,7 +2677,7 @@ function xr(t) {
|
|
|
2649
2677
|
a && (s = q(a));
|
|
2650
2678
|
}
|
|
2651
2679
|
if (!s) return;
|
|
2652
|
-
const n =
|
|
2680
|
+
const n = Fe();
|
|
2653
2681
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2654
2682
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2655
2683
|
});
|
|
@@ -2660,7 +2688,7 @@ function xr(t) {
|
|
|
2660
2688
|
}
|
|
2661
2689
|
let ei = 1;
|
|
2662
2690
|
function rt(t) {
|
|
2663
|
-
|
|
2691
|
+
C(this, {
|
|
2664
2692
|
$handle: t,
|
|
2665
2693
|
fc: t.fc,
|
|
2666
2694
|
vm: t.vm,
|
|
@@ -2681,7 +2709,7 @@ function rt(t) {
|
|
|
2681
2709
|
Yr(rt);
|
|
2682
2710
|
xr(rt);
|
|
2683
2711
|
function ti(t) {
|
|
2684
|
-
|
|
2712
|
+
C(t.prototype, {
|
|
2685
2713
|
parseInjectEvent(e, r) {
|
|
2686
2714
|
const i = e.inject || this.options.injectEvent;
|
|
2687
2715
|
return this.parseEventLst(e, r, i);
|
|
@@ -2698,7 +2726,7 @@ function ti(t) {
|
|
|
2698
2726
|
if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
|
|
2699
2727
|
return this.parseEventLst(e, r, i, !0);
|
|
2700
2728
|
if (h.String(r)) {
|
|
2701
|
-
const n =
|
|
2729
|
+
const n = z(r);
|
|
2702
2730
|
if (n && r !== n)
|
|
2703
2731
|
return n.__inject ? this.parseEvent(e, n, i, !0) : n;
|
|
2704
2732
|
}
|
|
@@ -2707,17 +2735,17 @@ function ti(t) {
|
|
|
2707
2735
|
let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
|
|
2708
2736
|
return h.trueArray(u) && u.forEach((f) => {
|
|
2709
2737
|
if (!f) return;
|
|
2710
|
-
let
|
|
2711
|
-
if (h.Object(f) && (
|
|
2738
|
+
let p, m = n || o || a;
|
|
2739
|
+
if (h.Object(f) && (p = f.inject, f = f.name, m = f.prefix || m), m) {
|
|
2712
2740
|
r || (m = `native-${m}`);
|
|
2713
|
-
const g =
|
|
2714
|
-
this.vm.$emit(g, ...
|
|
2741
|
+
const g = ve(`${m}-${f}`), $ = (..._) => {
|
|
2742
|
+
this.vm.$emit(g, ..._), this.vm.$emit("emit-event", g, ..._), this.bus.$emit(g, ..._);
|
|
2715
2743
|
};
|
|
2716
|
-
if (
|
|
2717
|
-
i[f] =
|
|
2744
|
+
if ($.__emit = !0, !p && l === !1)
|
|
2745
|
+
i[f] = $;
|
|
2718
2746
|
else {
|
|
2719
|
-
let
|
|
2720
|
-
i[f] = h.Undef(
|
|
2747
|
+
let _ = p || l || this.options.injectEvent;
|
|
2748
|
+
i[f] = h.Undef(_) ? $ : this.inject(s, $, _);
|
|
2721
2749
|
}
|
|
2722
2750
|
}
|
|
2723
2751
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2747,21 +2775,21 @@ function ti(t) {
|
|
|
2747
2775
|
},
|
|
2748
2776
|
loadStrVar(e, r, i) {
|
|
2749
2777
|
if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
|
|
2750
|
-
const s = e, n =
|
|
2778
|
+
const s = e, n = Wr(e);
|
|
2751
2779
|
let o;
|
|
2752
2780
|
if (n.forEach((a) => {
|
|
2753
2781
|
const l = a.split("||"), u = l[0].trim();
|
|
2754
2782
|
if (u) {
|
|
2755
2783
|
const f = (l[1] || "").trim();
|
|
2756
|
-
let
|
|
2784
|
+
let p, m = !1;
|
|
2757
2785
|
if (i && u.indexOf("$form.") === 0) {
|
|
2758
2786
|
const g = u.split(".");
|
|
2759
|
-
g.shift(),
|
|
2787
|
+
g.shift(), E(i.value, g[0]) && (m = !0, p = r ? r({
|
|
2760
2788
|
id: "$form." + g[0] + "_" + i.rule.__fc__.id,
|
|
2761
|
-
getValue: () =>
|
|
2762
|
-
}) :
|
|
2789
|
+
getValue: () => B(i.value, g)
|
|
2790
|
+
}) : B(i.value, g));
|
|
2763
2791
|
}
|
|
2764
|
-
m || (
|
|
2792
|
+
m || (p = r ? r(u, f) : this.fc.getLoadData(u, f)), o = p, e = e.replaceAll(`{{${a}}}`, p == null ? "" : p);
|
|
2765
2793
|
}
|
|
2766
2794
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
2767
2795
|
return o;
|
|
@@ -2785,12 +2813,12 @@ function ti(t) {
|
|
|
2785
2813
|
}
|
|
2786
2814
|
const yt = ["hook:updated", "hook:mounted"];
|
|
2787
2815
|
function ri(t) {
|
|
2788
|
-
|
|
2816
|
+
C(t.prototype, {
|
|
2789
2817
|
usePage() {
|
|
2790
2818
|
const e = this.options.page;
|
|
2791
2819
|
if (!e) return;
|
|
2792
2820
|
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)),
|
|
2821
|
+
h.Object(e) && (e.first && (r = parseInt(e.first, 10) || r), e.limit && (i = parseInt(e.limit, 10) || i)), C(this, {
|
|
2794
2822
|
first: r,
|
|
2795
2823
|
limit: i,
|
|
2796
2824
|
pageEnd: this.rules.length <= r
|
|
@@ -2808,7 +2836,7 @@ function ii(t) {
|
|
|
2808
2836
|
return t.length < 31 ? 31 : Math.ceil(t.length / 3);
|
|
2809
2837
|
}
|
|
2810
2838
|
function ni(t) {
|
|
2811
|
-
|
|
2839
|
+
C(t.prototype, {
|
|
2812
2840
|
clearNextTick() {
|
|
2813
2841
|
this.nextTick && clearTimeout(this.nextTick), this.nextTick = null;
|
|
2814
2842
|
},
|
|
@@ -2824,14 +2852,14 @@ function ni(t) {
|
|
|
2824
2852
|
}
|
|
2825
2853
|
function si(t) {
|
|
2826
2854
|
Object.defineProperties(t.origin, {
|
|
2827
|
-
__fc__:
|
|
2855
|
+
__fc__: Xe(me(t), !0)
|
|
2828
2856
|
}), t.rule !== t.origin && Object.defineProperties(t.rule, {
|
|
2829
|
-
__fc__:
|
|
2857
|
+
__fc__: Xe(me(t), !0)
|
|
2830
2858
|
});
|
|
2831
2859
|
}
|
|
2832
2860
|
function Gt(t, e, r) {
|
|
2833
|
-
const i =
|
|
2834
|
-
|
|
2861
|
+
const i = Ae(), s = !!e.field;
|
|
2862
|
+
C(this, {
|
|
2835
2863
|
id: i,
|
|
2836
2864
|
ref: i,
|
|
2837
2865
|
wrapRef: i + "fi",
|
|
@@ -2855,11 +2883,11 @@ function Gt(t, e, r) {
|
|
|
2855
2883
|
input: s,
|
|
2856
2884
|
el: void 0,
|
|
2857
2885
|
exportEl: void 0,
|
|
2858
|
-
defaultValue: s ?
|
|
2886
|
+
defaultValue: s ? G(r) : void 0,
|
|
2859
2887
|
field: e.field || void 0
|
|
2860
2888
|
}), this.updateKey(), si(this), this.update(t, !0);
|
|
2861
2889
|
}
|
|
2862
|
-
|
|
2890
|
+
C(Gt.prototype, {
|
|
2863
2891
|
getParentGroup() {
|
|
2864
2892
|
let t = this.parent;
|
|
2865
2893
|
for (; t; ) {
|
|
@@ -2896,8 +2924,8 @@ _(Gt.prototype, {
|
|
|
2896
2924
|
rule: this.rule,
|
|
2897
2925
|
api: this.$api,
|
|
2898
2926
|
update: (u) => {
|
|
2899
|
-
const f = u || i,
|
|
2900
|
-
this.setPending(e, r, f), o && o(f,
|
|
2927
|
+
const f = u || i, p = this.getPending(e, i);
|
|
2928
|
+
this.setPending(e, r, f), o && o(f, p);
|
|
2901
2929
|
},
|
|
2902
2930
|
reload: () => {
|
|
2903
2931
|
const u = this.getPending(e, i);
|
|
@@ -2919,7 +2947,7 @@ _(Gt.prototype, {
|
|
|
2919
2947
|
setPending(t, e, r) {
|
|
2920
2948
|
this.pending[t] = {
|
|
2921
2949
|
origin: e,
|
|
2922
|
-
value:
|
|
2950
|
+
value: ie(r)
|
|
2923
2951
|
};
|
|
2924
2952
|
},
|
|
2925
2953
|
effectData(t) {
|
|
@@ -2929,7 +2957,7 @@ _(Gt.prototype, {
|
|
|
2929
2957
|
t === void 0 ? this.payload = {} : delete this.payload[t];
|
|
2930
2958
|
},
|
|
2931
2959
|
updateKey(t) {
|
|
2932
|
-
this.key =
|
|
2960
|
+
this.key = Ae(), t && this.parent && this.parent.updateKey(t);
|
|
2933
2961
|
},
|
|
2934
2962
|
updateType() {
|
|
2935
2963
|
this.originType = this.rule.type, this.type = q(this.rule.type), this.trueType = this.$handle.getType(this.originType);
|
|
@@ -2940,7 +2968,7 @@ _(Gt.prototype, {
|
|
|
2940
2968
|
initProp() {
|
|
2941
2969
|
var e, r;
|
|
2942
2970
|
const t = b({}, this.rule);
|
|
2943
|
-
delete t.children, delete t.validate, this.prop =
|
|
2971
|
+
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
2972
|
},
|
|
2945
2973
|
initNone() {
|
|
2946
2974
|
this.none = !(h.Undef(this.prop.display) || this.prop.display);
|
|
@@ -2964,7 +2992,7 @@ _(Gt.prototype, {
|
|
|
2964
2992
|
this.$handle.watchCtx(this);
|
|
2965
2993
|
},
|
|
2966
2994
|
delete() {
|
|
2967
|
-
this.unwatch(), this.unlink(), this.rmCtrl(), this.parent && this.parent.children.splice(this.parent.children.indexOf(this) >>> 0, 1),
|
|
2995
|
+
this.unwatch(), this.unlink(), this.rmCtrl(), this.parent && this.parent.children.splice(this.parent.children.indexOf(this) >>> 0, 1), C(this, {
|
|
2968
2996
|
deleted: !0,
|
|
2969
2997
|
computed: {},
|
|
2970
2998
|
parent: null,
|
|
@@ -2987,14 +3015,14 @@ _(Gt.prototype, {
|
|
|
2987
3015
|
}
|
|
2988
3016
|
this.$handle.noWatch(() => {
|
|
2989
3017
|
this.$handle.deferSyncValue(() => {
|
|
2990
|
-
this.rmCtrl(), t(), this.$handle.rmCtx(this),
|
|
3018
|
+
this.rmCtrl(), t(), this.$handle.rmCtx(this), C(this, {
|
|
2991
3019
|
root: []
|
|
2992
3020
|
});
|
|
2993
3021
|
}, this.input);
|
|
2994
3022
|
});
|
|
2995
3023
|
},
|
|
2996
3024
|
update(t, e) {
|
|
2997
|
-
|
|
3025
|
+
C(this, {
|
|
2998
3026
|
deleted: !1,
|
|
2999
3027
|
$handle: t,
|
|
3000
3028
|
$render: t.$render,
|
|
@@ -3007,20 +3035,20 @@ _(Gt.prototype, {
|
|
|
3007
3035
|
}
|
|
3008
3036
|
});
|
|
3009
3037
|
function oi(t) {
|
|
3010
|
-
|
|
3038
|
+
C(t.prototype, {
|
|
3011
3039
|
nextRefresh(e) {
|
|
3012
3040
|
const r = this.loadedId;
|
|
3013
|
-
|
|
3041
|
+
A(() => {
|
|
3014
3042
|
r === this.loadedId && (e ? e() : this.refresh());
|
|
3015
3043
|
});
|
|
3016
3044
|
},
|
|
3017
3045
|
parseRule(e) {
|
|
3018
3046
|
const r = ct(e);
|
|
3019
3047
|
return Object.defineProperties(r, {
|
|
3020
|
-
__origin__:
|
|
3048
|
+
__origin__: Xe(e, !0)
|
|
3021
3049
|
}), ai(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
|
|
3022
3050
|
i && this.loadFn(i, r);
|
|
3023
|
-
}), this.loadCtrl(r), r.update && (r.update =
|
|
3051
|
+
}), this.loadCtrl(r), r.update && (r.update = z(r.update)), r;
|
|
3024
3052
|
},
|
|
3025
3053
|
loadFn(e, r) {
|
|
3026
3054
|
["on", "props", "nativeOn", "deep"].forEach((i) => {
|
|
@@ -3029,12 +3057,12 @@ function oi(t) {
|
|
|
3029
3057
|
},
|
|
3030
3058
|
loadCtrl(e) {
|
|
3031
3059
|
e.control && e.control.forEach((r) => {
|
|
3032
|
-
r.handle && (r.handle =
|
|
3060
|
+
r.handle && (r.handle = z(r.handle));
|
|
3033
3061
|
});
|
|
3034
3062
|
},
|
|
3035
3063
|
syncProp(e) {
|
|
3036
3064
|
const r = e.rule;
|
|
3037
|
-
h.trueArray(r.sync) &&
|
|
3065
|
+
h.trueArray(r.sync) && Y([{
|
|
3038
3066
|
on: r.sync.reduce((i, s) => (i[typeof s == "object" && s.event || `update:${s}`] = (n) => {
|
|
3039
3067
|
r.props[typeof s == "object" && s.prop || s] = n, this.vm.$emit("sync", s, n, r, this.fapi);
|
|
3040
3068
|
}, i), {})
|
|
@@ -3068,7 +3096,7 @@ function oi(t) {
|
|
|
3068
3096
|
let l = ct(o);
|
|
3069
3097
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3070
3098
|
this.fc.targetFormDriver("loadRule", { rule: l, api: this.api }, this.fc), this.ruleEffect(l, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", o, this.api);
|
|
3071
|
-
let f,
|
|
3099
|
+
let f, p = !1, m = !!o.__fc__, g = l.value;
|
|
3072
3100
|
if (m) {
|
|
3073
3101
|
if (f = o.__fc__, g = f.defaultValue, f.deleted) {
|
|
3074
3102
|
if ($t(f))
|
|
@@ -3077,24 +3105,24 @@ function oi(t) {
|
|
|
3077
3105
|
} else if (!f.check(this)) {
|
|
3078
3106
|
if ($t(f))
|
|
3079
3107
|
return;
|
|
3080
|
-
e[a] = o = o._clone ? o._clone() : Vt(
|
|
3108
|
+
e[a] = o = o._clone ? o._clone() : Vt(be(o)), f = null, p = !0;
|
|
3081
3109
|
}
|
|
3082
3110
|
}
|
|
3083
3111
|
if (f)
|
|
3084
3112
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3085
3113
|
else {
|
|
3086
|
-
const
|
|
3087
|
-
f = new Gt(this,
|
|
3114
|
+
const D = this.parseRule(o);
|
|
3115
|
+
f = new Gt(this, D, g), this.bindParser(f);
|
|
3088
3116
|
}
|
|
3089
|
-
[!1, !0].forEach((
|
|
3090
|
-
const
|
|
3091
|
-
if (f.parser.loadChildren === !1 || s(
|
|
3092
|
-
const
|
|
3093
|
-
|
|
3117
|
+
[!1, !0].forEach((D) => this.parseEmit(f, D)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !p && !m && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3118
|
+
const $ = f.loadChildrenPending();
|
|
3119
|
+
if (f.parser.loadChildren === !1 || s($, f), !r) {
|
|
3120
|
+
const D = i(a);
|
|
3121
|
+
D > -1 || !a ? this.sort.splice(D + 1, 0, f.id) : this.sort.push(f.id);
|
|
3094
3122
|
}
|
|
3095
|
-
const
|
|
3096
|
-
return f.updated || (f.updated = !0, h.Function(
|
|
3097
|
-
this.refreshUpdate(f,
|
|
3123
|
+
const _ = f.rule;
|
|
3124
|
+
return f.updated || (f.updated = !0, h.Function(_.update) && this.bus.$once("load-end", () => {
|
|
3125
|
+
this.refreshUpdate(f, _.value, "init");
|
|
3098
3126
|
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3099
3127
|
}).filter((o) => !!o);
|
|
3100
3128
|
r && (r.children = n);
|
|
@@ -3106,8 +3134,8 @@ function oi(t) {
|
|
|
3106
3134
|
const r = li(e), i = [], s = this.api;
|
|
3107
3135
|
if (!r.length) return !1;
|
|
3108
3136
|
for (let a = 0; a < r.length; a++) {
|
|
3109
|
-
const l = r[a], u = l.handle || function(
|
|
3110
|
-
return (fe[l.condition || "=="] || fe["=="])(
|
|
3137
|
+
const l = r[a], u = l.handle || function(p) {
|
|
3138
|
+
return (fe[l.condition || "=="] || fe["=="])(p, l.value);
|
|
3111
3139
|
};
|
|
3112
3140
|
if (!h.trueArray(l.rule)) continue;
|
|
3113
3141
|
const f = U(b({}, l), {
|
|
@@ -3121,39 +3149,39 @@ function oi(t) {
|
|
|
3121
3149
|
const n = [];
|
|
3122
3150
|
let o = !1;
|
|
3123
3151
|
return this.deferSyncValue(() => {
|
|
3124
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append:
|
|
3152
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: m, ctrl: g, method: $ }) => {
|
|
3125
3153
|
if (a) {
|
|
3126
3154
|
l ? e.ctrlRule.push({
|
|
3127
3155
|
__ctrl: !0,
|
|
3128
3156
|
children: u,
|
|
3129
3157
|
valid: l
|
|
3130
3158
|
}) : 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);
|
|
3159
|
+
$ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((_) => {
|
|
3160
|
+
this.api.setEffect(_, "required", l);
|
|
3161
|
+
}), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
3134
3162
|
});
|
|
3135
3163
|
return;
|
|
3136
3164
|
}
|
|
3137
3165
|
if (l) {
|
|
3138
3166
|
o = !0;
|
|
3139
|
-
const
|
|
3167
|
+
const _ = {
|
|
3140
3168
|
type: "fragment",
|
|
3141
3169
|
native: !0,
|
|
3142
3170
|
__ctrl: !0,
|
|
3143
3171
|
children: u
|
|
3144
3172
|
};
|
|
3145
|
-
e.ctrlRule.push(
|
|
3146
|
-
f ? s.prepend(
|
|
3173
|
+
e.ctrlRule.push(_), this.bus.$once("load-start", () => {
|
|
3174
|
+
f ? s.prepend(_, f, m) : p || m ? s.append(_, p || e.id, m) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, _);
|
|
3147
3175
|
});
|
|
3148
3176
|
} else {
|
|
3149
3177
|
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3150
|
-
const
|
|
3151
|
-
|
|
3178
|
+
const _ = Z(g);
|
|
3179
|
+
_ && _.rm();
|
|
3152
3180
|
}
|
|
3153
3181
|
});
|
|
3154
3182
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
3155
3183
|
n.forEach((a) => a());
|
|
3156
|
-
}) : n.length &&
|
|
3184
|
+
}) : n.length && A(() => {
|
|
3157
3185
|
n.forEach((a) => a());
|
|
3158
3186
|
})), this.vm.$emit("control", e.origin, this.api), this.effect(e, "control"), o;
|
|
3159
3187
|
},
|
|
@@ -3178,7 +3206,7 @@ function oi(t) {
|
|
|
3178
3206
|
function ai(t) {
|
|
3179
3207
|
const e = Tt();
|
|
3180
3208
|
return Object.keys(e).forEach((r) => {
|
|
3181
|
-
|
|
3209
|
+
E(t, r) || S(t, r, e[r]);
|
|
3182
3210
|
}), t;
|
|
3183
3211
|
}
|
|
3184
3212
|
function li(t) {
|
|
@@ -3196,15 +3224,15 @@ function $t(t) {
|
|
|
3196
3224
|
return !!t.rule.__ctrl;
|
|
3197
3225
|
}
|
|
3198
3226
|
function fi(t) {
|
|
3199
|
-
|
|
3227
|
+
C(t.prototype, {
|
|
3200
3228
|
setValue(e, r, i, s) {
|
|
3201
3229
|
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
3230
|
rule: e.origin,
|
|
3203
3231
|
api: this.api,
|
|
3204
3232
|
setFlag: s || !1
|
|
3205
|
-
}), s &&
|
|
3206
|
-
|
|
3207
|
-
|
|
3233
|
+
}), s && A(() => {
|
|
3234
|
+
A(() => {
|
|
3235
|
+
A(() => {
|
|
3208
3236
|
this.api.clearValidateState(e.id);
|
|
3209
3237
|
});
|
|
3210
3238
|
});
|
|
@@ -3218,7 +3246,7 @@ function fi(t) {
|
|
|
3218
3246
|
this.deferSyncValue(() => {
|
|
3219
3247
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3220
3248
|
Object.keys(r || {}).forEach((o) => {
|
|
3221
|
-
s &&
|
|
3249
|
+
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
3250
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3223
3251
|
});
|
|
3224
3252
|
},
|
|
@@ -3228,27 +3256,27 @@ function fi(t) {
|
|
|
3228
3256
|
setFormData(e, r) {
|
|
3229
3257
|
e.modelValue = r;
|
|
3230
3258
|
const i = e.getParentGroup();
|
|
3231
|
-
i && (this.subRuleData[i.id] ||
|
|
3259
|
+
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
3260
|
},
|
|
3233
3261
|
rmSubRuleData(e) {
|
|
3234
3262
|
const r = e.getParentGroup();
|
|
3235
|
-
r && this.subRuleData[r.id] &&
|
|
3263
|
+
r && this.subRuleData[r.id] && re(this.subRuleData[r.id], e.field);
|
|
3236
3264
|
},
|
|
3237
3265
|
getFormData(e) {
|
|
3238
3266
|
return this.formData[e.id];
|
|
3239
3267
|
},
|
|
3240
3268
|
syncForm() {
|
|
3241
3269
|
const e = {}, r = this.fields(), i = [];
|
|
3242
|
-
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] =
|
|
3270
|
+
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = De(this.appendData, n)), s), e), r.reduce((s, n) => {
|
|
3243
3271
|
const o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a.rule))[0] || this.fieldCtx[n][0];
|
|
3244
|
-
return this.isIgnore(o.rule) && i.push(n), s[n] =
|
|
3245
|
-
}, e), this.form =
|
|
3272
|
+
return this.isIgnore(o.rule) && i.push(n), s[n] = De(o.rule, "value"), s;
|
|
3273
|
+
}, e), this.form = ie(e), this.ignoreFields = i, this.syncValue();
|
|
3246
3274
|
},
|
|
3247
3275
|
isIgnore(e) {
|
|
3248
3276
|
return e.ignore === !0 || e.ignore === "hidden" && e.hidden || this.options.ignoreHiddenFields && e.hidden;
|
|
3249
3277
|
},
|
|
3250
3278
|
appendValue(e) {
|
|
3251
|
-
(!e.field || !
|
|
3279
|
+
(!e.field || !E(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3252
3280
|
},
|
|
3253
3281
|
addSubForm(e, r) {
|
|
3254
3282
|
this.subForm[e.id] = r;
|
|
@@ -3268,7 +3296,7 @@ function fi(t) {
|
|
|
3268
3296
|
return JSON.stringify(this.getFormData(e), vt) !== JSON.stringify(r, vt);
|
|
3269
3297
|
},
|
|
3270
3298
|
isQuote(e, r) {
|
|
3271
|
-
return (h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
3299
|
+
return (r instanceof Function || h.Object(r) || Array.isArray(r)) && r === e.rule.value;
|
|
3272
3300
|
},
|
|
3273
3301
|
refreshUpdate(e, r, i, s) {
|
|
3274
3302
|
if (h.Function(e.rule.update)) {
|
|
@@ -3301,7 +3329,7 @@ function fi(t) {
|
|
|
3301
3329
|
function vt(t, e) {
|
|
3302
3330
|
return typeof e == "function" ? "" + e : e;
|
|
3303
3331
|
}
|
|
3304
|
-
const
|
|
3332
|
+
const Ee = {
|
|
3305
3333
|
init(t) {
|
|
3306
3334
|
},
|
|
3307
3335
|
toFormValue(t, e) {
|
|
@@ -3322,7 +3350,7 @@ const ke = {
|
|
|
3322
3350
|
}
|
|
3323
3351
|
}, ci = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
|
|
3324
3352
|
function hi(t) {
|
|
3325
|
-
|
|
3353
|
+
C(t.prototype, {
|
|
3326
3354
|
getCtx(e) {
|
|
3327
3355
|
return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
|
|
3328
3356
|
},
|
|
@@ -3356,7 +3384,7 @@ function hi(t) {
|
|
|
3356
3384
|
if (n)
|
|
3357
3385
|
return n;
|
|
3358
3386
|
}
|
|
3359
|
-
return r[e.originType] || r[q(e.type)] || r[e.trueType] ||
|
|
3387
|
+
return r[e.originType] || r[q(e.type)] || r[e.trueType] || Ee;
|
|
3360
3388
|
},
|
|
3361
3389
|
bindParser(e) {
|
|
3362
3390
|
e.setParser(this.getParser(e));
|
|
@@ -3370,7 +3398,7 @@ function hi(t) {
|
|
|
3370
3398
|
},
|
|
3371
3399
|
watchCtx(e) {
|
|
3372
3400
|
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" && ci.indexOf(i) === -1).forEach((i) => {
|
|
3373
|
-
const s =
|
|
3401
|
+
const s = De(e.rule, i), n = i === "children";
|
|
3374
3402
|
e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3375
3403
|
let l = s.value;
|
|
3376
3404
|
if (!this.isBreakWatch()) {
|
|
@@ -3378,9 +3406,9 @@ function hi(t) {
|
|
|
3378
3406
|
this.$render.clearCache(e), this.nextRefresh();
|
|
3379
3407
|
return;
|
|
3380
3408
|
}
|
|
3381
|
-
if (this.watching = !0,
|
|
3409
|
+
if (this.watching = !0, A(() => {
|
|
3382
3410
|
this.targetHook(e, "watch", { key: i, oldValue: a, newValue: l });
|
|
3383
|
-
}), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(),
|
|
3411
|
+
}), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(), A(() => {
|
|
3384
3412
|
this.targetHook(e, "hidden", { value: l });
|
|
3385
3413
|
})), i === "ignore" && e.input || i === "hidden" && e.input && (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields))
|
|
3386
3414
|
this.syncForm();
|
|
@@ -3391,41 +3419,42 @@ function hi(t) {
|
|
|
3391
3419
|
this.$render.clearCache(e), this.refresh(), this.watching = !1;
|
|
3392
3420
|
}
|
|
3393
3421
|
}, { deep: !n, sync: n }));
|
|
3394
|
-
}), e.refRule.__$title =
|
|
3422
|
+
}), e.refRule.__$title = ge(() => {
|
|
3395
3423
|
let i = (typeof e.rule.title == "object" ? e.rule.title.title : e.rule.title) || "";
|
|
3396
3424
|
if (i) {
|
|
3397
3425
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3398
3426
|
s && (i = this.api.t(s[1]));
|
|
3399
3427
|
}
|
|
3400
3428
|
return i;
|
|
3401
|
-
}), e.refRule.__$info =
|
|
3429
|
+
}), e.refRule.__$info = ge(() => {
|
|
3402
3430
|
let i = (typeof e.rule.info == "object" ? e.rule.info.info : e.rule.info) || "";
|
|
3403
3431
|
if (i) {
|
|
3404
3432
|
const s = i.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3405
3433
|
s && (i = this.api.t(s[1]));
|
|
3406
3434
|
}
|
|
3407
3435
|
return i;
|
|
3408
|
-
}), e.refRule.__$validate =
|
|
3436
|
+
}), e.refRule.__$validate = ge(() => H(e.rule.validate).map((i) => {
|
|
3437
|
+
var n, o;
|
|
3409
3438
|
const s = b({}, i);
|
|
3410
3439
|
if (s.message) {
|
|
3411
|
-
const
|
|
3412
|
-
|
|
3440
|
+
const a = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
3441
|
+
a && (s.message = this.api.t(a[1], { title: (o = (n = e.refRule) == null ? void 0 : n.__$title) == null ? void 0 : o.value }));
|
|
3413
3442
|
}
|
|
3414
3443
|
if (h.Function(s.validator)) {
|
|
3415
|
-
const
|
|
3416
|
-
return s.validator = function(...
|
|
3444
|
+
const a = e;
|
|
3445
|
+
return s.validator = function(...l) {
|
|
3417
3446
|
return i.validator.call({
|
|
3418
3447
|
that: this,
|
|
3419
|
-
id:
|
|
3420
|
-
field:
|
|
3421
|
-
rule:
|
|
3422
|
-
api:
|
|
3423
|
-
}, ...
|
|
3448
|
+
id: a.id,
|
|
3449
|
+
field: a.field,
|
|
3450
|
+
rule: a.rule,
|
|
3451
|
+
api: a.$handle.api
|
|
3452
|
+
}, ...l);
|
|
3424
3453
|
}, s;
|
|
3425
3454
|
}
|
|
3426
3455
|
return s;
|
|
3427
3456
|
})), e.input) {
|
|
3428
|
-
const i =
|
|
3457
|
+
const i = De(e.rule, "value");
|
|
3429
3458
|
e.watch.push(L(() => i.value, () => {
|
|
3430
3459
|
let s = e.parser.toFormValue(i.value, e);
|
|
3431
3460
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
@@ -3435,15 +3464,15 @@ function hi(t) {
|
|
|
3435
3464
|
let i = e.rule.computed;
|
|
3436
3465
|
i && (typeof i != "object" && (i = { value: i }), Object.keys(i).forEach((s) => {
|
|
3437
3466
|
let n;
|
|
3438
|
-
const o =
|
|
3467
|
+
const o = ge(() => {
|
|
3439
3468
|
const l = i[s];
|
|
3440
3469
|
if (!l) return;
|
|
3441
3470
|
const u = this.compute(e, l);
|
|
3442
3471
|
return l.linkage && u === void 0 ? n : u;
|
|
3443
3472
|
}), a = (l) => {
|
|
3444
|
-
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) :
|
|
3473
|
+
s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : se(e.rule, s, l);
|
|
3445
3474
|
};
|
|
3446
|
-
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !==
|
|
3475
|
+
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== B(e.rule, s)) && a(o.value), e.watch.push(L(o, (l) => {
|
|
3447
3476
|
n = l, setTimeout(() => {
|
|
3448
3477
|
a(l);
|
|
3449
3478
|
});
|
|
@@ -3460,16 +3489,16 @@ function hi(t) {
|
|
|
3460
3489
|
const l = a.mode === "OR";
|
|
3461
3490
|
let u = !0;
|
|
3462
3491
|
for (let f = 0; f < a.group.length; f++) {
|
|
3463
|
-
const
|
|
3492
|
+
const p = a.group[f];
|
|
3464
3493
|
let m, g = null;
|
|
3465
|
-
if (
|
|
3466
|
-
g = JSON.stringify(this.fc.getLoadData(
|
|
3467
|
-
else if (
|
|
3468
|
-
g = dt(
|
|
3469
|
-
else
|
|
3494
|
+
if (p.variable)
|
|
3495
|
+
g = JSON.stringify(this.fc.getLoadData(p.variable) || "");
|
|
3496
|
+
else if (p.field)
|
|
3497
|
+
g = dt(p.field || "");
|
|
3498
|
+
else if (!p.mode)
|
|
3470
3499
|
return !0;
|
|
3471
|
-
let
|
|
3472
|
-
if (
|
|
3500
|
+
let $ = p.compare;
|
|
3501
|
+
if ($ && ($ = dt($ || "")), p.mode ? m = n(p) : fe[p.condition] ? h.Function(p.handler) ? m = O(() => p.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['${p.condition}'](${g}, ${$ || "$val"}); }}}}`).call(this.api.form, fe, p.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
3502
|
return !0;
|
|
3474
3503
|
l || (u = u && m);
|
|
3475
3504
|
}
|
|
@@ -3494,7 +3523,7 @@ function hi(t) {
|
|
|
3494
3523
|
fc: s.fc
|
|
3495
3524
|
}, ...l);
|
|
3496
3525
|
}, 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);
|
|
3526
|
+
return O(() => 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
3527
|
},
|
|
3499
3528
|
updateChildren(e, r, i) {
|
|
3500
3529
|
this.deferSyncValue(() => {
|
|
@@ -3511,9 +3540,9 @@ function hi(t) {
|
|
|
3511
3540
|
rmCtx(e) {
|
|
3512
3541
|
if (e.deleted) return;
|
|
3513
3542
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3514
|
-
|
|
3543
|
+
re(this.ctxs, r), re(this.formData, r), re(this.subForm, r), re(this.vm.ctxInject, r);
|
|
3515
3544
|
const o = e.getParentGroup();
|
|
3516
|
-
o && this.subRuleData[o.id] &&
|
|
3545
|
+
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
3546
|
if (!this.reloading) {
|
|
3518
3547
|
if (e.parser.loadChildren !== !1) {
|
|
3519
3548
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3528,7 +3557,7 @@ function hi(t) {
|
|
|
3528
3557
|
});
|
|
3529
3558
|
}
|
|
3530
3559
|
function di(t) {
|
|
3531
|
-
|
|
3560
|
+
C(t.prototype, {
|
|
3532
3561
|
mounted() {
|
|
3533
3562
|
const e = () => {
|
|
3534
3563
|
this.isMounted = !0, this.lifecycle("mounted");
|
|
@@ -3541,7 +3570,7 @@ function di(t) {
|
|
|
3541
3570
|
emitEvent(e, ...r) {
|
|
3542
3571
|
const i = this.options[e] || this.options[q("on-" + e)];
|
|
3543
3572
|
if (i) {
|
|
3544
|
-
const s =
|
|
3573
|
+
const s = z(i);
|
|
3545
3574
|
h.Function(s) && O(() => s(...r));
|
|
3546
3575
|
}
|
|
3547
3576
|
this.bus.$emit(e, ...r);
|
|
@@ -3550,13 +3579,13 @@ function di(t) {
|
|
|
3550
3579
|
var n, o;
|
|
3551
3580
|
let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
|
|
3552
3581
|
s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
|
|
3553
|
-
O(() => a(U(b({}, i || {}), { rule: e.rule, api: this.api })));
|
|
3582
|
+
O(() => a(U(b({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
|
|
3554
3583
|
}));
|
|
3555
3584
|
}
|
|
3556
3585
|
});
|
|
3557
3586
|
}
|
|
3558
3587
|
function pi(t) {
|
|
3559
|
-
|
|
3588
|
+
C(t.prototype, {
|
|
3560
3589
|
useProvider() {
|
|
3561
3590
|
const e = this.fc.providers;
|
|
3562
3591
|
Object.keys(e).forEach((r) => {
|
|
@@ -3577,7 +3606,7 @@ function pi(t) {
|
|
|
3577
3606
|
let r = {
|
|
3578
3607
|
required: () => {
|
|
3579
3608
|
var i, s;
|
|
3580
|
-
return (
|
|
3609
|
+
return (E(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3581
3610
|
}
|
|
3582
3611
|
};
|
|
3583
3612
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3607,9 +3636,9 @@ function pi(t) {
|
|
|
3607
3636
|
}, r);
|
|
3608
3637
|
},
|
|
3609
3638
|
getEffect(e, r) {
|
|
3610
|
-
if (
|
|
3639
|
+
if (E(e, "$" + r))
|
|
3611
3640
|
return e["$" + r];
|
|
3612
|
-
if (
|
|
3641
|
+
if (E(e, "effect") && E(e.effect, r))
|
|
3613
3642
|
return e.effect[r];
|
|
3614
3643
|
},
|
|
3615
3644
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
@@ -3618,15 +3647,15 @@ function pi(t) {
|
|
|
3618
3647
|
Object.keys(l).forEach((u) => {
|
|
3619
3648
|
const f = this.providers[u];
|
|
3620
3649
|
if (!f || f.input && !i) return;
|
|
3621
|
-
let
|
|
3650
|
+
let p;
|
|
3622
3651
|
if (!f._c)
|
|
3623
|
-
|
|
3652
|
+
p = "*";
|
|
3624
3653
|
else if (f._used.indexOf(s) > -1)
|
|
3625
|
-
|
|
3654
|
+
p = s;
|
|
3626
3655
|
else
|
|
3627
3656
|
return;
|
|
3628
3657
|
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) =>
|
|
3658
|
+
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}:${p}:${f.input ? 1 : 0}`, o, [m, r, this.api]);
|
|
3630
3659
|
});
|
|
3631
3660
|
}
|
|
3632
3661
|
});
|
|
@@ -3643,7 +3672,7 @@ function gi(t) {
|
|
|
3643
3672
|
return r.length ? r : !1;
|
|
3644
3673
|
} else return h.String(e) ? [e] : !1;
|
|
3645
3674
|
}
|
|
3646
|
-
function
|
|
3675
|
+
function K(t) {
|
|
3647
3676
|
Lt(this, {
|
|
3648
3677
|
options() {
|
|
3649
3678
|
return t.options.value || {};
|
|
@@ -3652,9 +3681,9 @@ function z(t) {
|
|
|
3652
3681
|
return t.bus;
|
|
3653
3682
|
},
|
|
3654
3683
|
preview() {
|
|
3655
|
-
return t.vm.$options.propsData.preview != null ? t.vm.$options.propsData.preview : t.options.value.preview || !1;
|
|
3684
|
+
return t.vm.$options.propsData.preview != null ? t.vm.$options.propsData.preview : t.vm.parent && t.vm.parent.$props.preview != null ? t.vm.parent.$props.preview : t.options.value.preview || !1;
|
|
3656
3685
|
}
|
|
3657
|
-
}),
|
|
3686
|
+
}), C(this, {
|
|
3658
3687
|
fc: t,
|
|
3659
3688
|
vm: t.vm,
|
|
3660
3689
|
watching: !1,
|
|
@@ -3663,10 +3692,10 @@ function z(t) {
|
|
|
3663
3692
|
noWatchFn: null,
|
|
3664
3693
|
deferSyncFn: null,
|
|
3665
3694
|
isMounted: !1,
|
|
3666
|
-
formData:
|
|
3667
|
-
subRuleData:
|
|
3695
|
+
formData: ie({}),
|
|
3696
|
+
subRuleData: ie({}),
|
|
3668
3697
|
subForm: {},
|
|
3669
|
-
form:
|
|
3698
|
+
form: ie({}),
|
|
3670
3699
|
appendData: {},
|
|
3671
3700
|
ignoreFields: [],
|
|
3672
3701
|
providers: {},
|
|
@@ -3680,12 +3709,12 @@ function z(t) {
|
|
|
3680
3709
|
}
|
|
3681
3710
|
}), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
|
|
3682
3711
|
const i = O(() => r(e, this));
|
|
3683
|
-
return i && i !== e &&
|
|
3712
|
+
return i && i !== e && C(e, i), e;
|
|
3684
3713
|
}, Zr(this));
|
|
3685
3714
|
}
|
|
3686
|
-
|
|
3715
|
+
C(K.prototype, {
|
|
3687
3716
|
initData(t) {
|
|
3688
|
-
|
|
3717
|
+
C(this, {
|
|
3689
3718
|
ctxs: {},
|
|
3690
3719
|
fieldCtx: {},
|
|
3691
3720
|
nameCtx: {},
|
|
@@ -3702,22 +3731,29 @@ _(z.prototype, {
|
|
|
3702
3731
|
isBreakWatch() {
|
|
3703
3732
|
return this.loading || this.noWatchFn || this.reloading;
|
|
3704
3733
|
},
|
|
3734
|
+
globalBeforeFetch(t) {
|
|
3735
|
+
return new Promise((e, r) => {
|
|
3736
|
+
const i = this.options.beforeFetch && O(() => this.options.beforeFetch(t, { api: this.api }));
|
|
3737
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : e();
|
|
3738
|
+
});
|
|
3739
|
+
},
|
|
3705
3740
|
beforeFetch(t) {
|
|
3706
|
-
return new Promise((e) => {
|
|
3707
|
-
const
|
|
3708
|
-
|
|
3741
|
+
return new Promise((e, r) => {
|
|
3742
|
+
const i = t && t.beforeFetch && O(() => t.beforeFetch(t, { api: this.api }));
|
|
3743
|
+
i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
|
|
3744
|
+
}).then(() => this.globalBeforeFetch(t)).catch(() => {
|
|
3709
3745
|
});
|
|
3710
3746
|
}
|
|
3711
3747
|
});
|
|
3712
|
-
ti(
|
|
3713
|
-
ri(
|
|
3714
|
-
ni(
|
|
3715
|
-
oi(
|
|
3716
|
-
fi(
|
|
3717
|
-
hi(
|
|
3718
|
-
di(
|
|
3719
|
-
pi(
|
|
3720
|
-
const yi = "fcFragment",
|
|
3748
|
+
ti(K);
|
|
3749
|
+
ri(K);
|
|
3750
|
+
ni(K);
|
|
3751
|
+
oi(K);
|
|
3752
|
+
fi(K);
|
|
3753
|
+
hi(K);
|
|
3754
|
+
di(K);
|
|
3755
|
+
pi(K);
|
|
3756
|
+
const yi = "fcFragment", Ne = {
|
|
3721
3757
|
name: yi,
|
|
3722
3758
|
functional: !0,
|
|
3723
3759
|
props: ["vnode"],
|
|
@@ -3733,13 +3769,13 @@ function vi() {
|
|
|
3733
3769
|
function e(r) {
|
|
3734
3770
|
r && this.setVm(r);
|
|
3735
3771
|
}
|
|
3736
|
-
return
|
|
3772
|
+
return C(e.prototype, {
|
|
3737
3773
|
setVm(r) {
|
|
3738
3774
|
this.vm = r, this.h = this.$h = r.$createElement;
|
|
3739
3775
|
},
|
|
3740
3776
|
make(r, i, s) {
|
|
3741
3777
|
var n, o, a;
|
|
3742
|
-
return (
|
|
3778
|
+
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
3779
|
},
|
|
3744
3780
|
makeComponent(r, i, s) {
|
|
3745
3781
|
var o;
|
|
@@ -3753,14 +3789,14 @@ function vi() {
|
|
|
3753
3789
|
return n.context = this.vm, n;
|
|
3754
3790
|
},
|
|
3755
3791
|
aliasMap: t
|
|
3756
|
-
}),
|
|
3792
|
+
}), C(e, {
|
|
3757
3793
|
aliasMap: t,
|
|
3758
3794
|
alias(r, i) {
|
|
3759
3795
|
t[r] = i;
|
|
3760
3796
|
},
|
|
3761
3797
|
use(r) {
|
|
3762
3798
|
Object.keys(r).forEach((i) => {
|
|
3763
|
-
const s =
|
|
3799
|
+
const s = ve(i), n = qr(i).toLocaleLowerCase(), o = r[i];
|
|
3764
3800
|
[i, s, n].forEach((a) => {
|
|
3765
3801
|
e.alias(i, o), e.prototype[a] = function(l, u) {
|
|
3766
3802
|
return this.make(o, l, u);
|
|
@@ -3776,7 +3812,7 @@ function bi(t) {
|
|
|
3776
3812
|
return Object.assign(e.prototype, t), e;
|
|
3777
3813
|
}
|
|
3778
3814
|
function Ht(t) {
|
|
3779
|
-
|
|
3815
|
+
C(this, {
|
|
3780
3816
|
$handle: t,
|
|
3781
3817
|
vm: t.vm,
|
|
3782
3818
|
options: {},
|
|
@@ -3786,12 +3822,12 @@ function Ht(t) {
|
|
|
3786
3822
|
}
|
|
3787
3823
|
}), this.updateKey(), this.init();
|
|
3788
3824
|
}
|
|
3789
|
-
|
|
3825
|
+
C(Ht.prototype, {
|
|
3790
3826
|
__init() {
|
|
3791
3827
|
this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
|
|
3792
3828
|
},
|
|
3793
3829
|
updateKey() {
|
|
3794
|
-
this.key =
|
|
3830
|
+
this.key = Ae();
|
|
3795
3831
|
},
|
|
3796
3832
|
//TODO interface
|
|
3797
3833
|
init() {
|
|
@@ -3813,7 +3849,7 @@ _(Ht.prototype, {
|
|
|
3813
3849
|
return e(this.vm);
|
|
3814
3850
|
},
|
|
3815
3851
|
mergeOptions(t, e) {
|
|
3816
|
-
return
|
|
3852
|
+
return Y(t.map((r) => this.tidyOptions(r)), e, this.mergeOptionsRule);
|
|
3817
3853
|
},
|
|
3818
3854
|
updateOptions(t) {
|
|
3819
3855
|
this.$handle.fc.targetFormDriver("updateOptions", t, { handle: this.$handle, api: this.$handle.api }), this.options = this.mergeOptions([t], this.getDefaultOptions()), this.update();
|
|
@@ -3836,21 +3872,22 @@ const _i = function(t) {
|
|
|
3836
3872
|
name: "loadData",
|
|
3837
3873
|
_fn: [],
|
|
3838
3874
|
loaded(r, i, s) {
|
|
3839
|
-
this.deleted(r)
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3875
|
+
this.deleted(r), A(() => {
|
|
3876
|
+
let n = H(r.getValue());
|
|
3877
|
+
const o = [];
|
|
3878
|
+
n.forEach((a) => {
|
|
3879
|
+
if (a && (a.attr || a.template)) {
|
|
3880
|
+
let l = (p) => {
|
|
3881
|
+
let m;
|
|
3882
|
+
a.template ? m = t.$handle.loadStrVar(a.template, p) : a.handler && h.Function(a.handler) ? m = a.handler(p, i, s) : m = p(a.attr, a.default), a.copy !== !1 && (m = G(m));
|
|
3883
|
+
const g = a.modify ? i : r.getProp();
|
|
3884
|
+
a.to === "child" ? g.children ? S(g.children, 0, m) : S(g, "children", [m]) : se(g, a.to || "options", m), s.sync(i);
|
|
3885
|
+
}, u = (p) => l(p);
|
|
3886
|
+
const f = t.watchLoadData(u);
|
|
3887
|
+
l = ne(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
3888
|
+
}
|
|
3889
|
+
}), this._fn[r.id] = o;
|
|
3890
|
+
});
|
|
3854
3891
|
},
|
|
3855
3892
|
deleted(r) {
|
|
3856
3893
|
this._fn[r.id] && (this._fn[r.id].forEach((i) => {
|
|
@@ -3858,7 +3895,7 @@ const _i = function(t) {
|
|
|
3858
3895
|
}), delete this._fn[r.id]), r.clearProp();
|
|
3859
3896
|
}
|
|
3860
3897
|
};
|
|
3861
|
-
return e.watch = e.
|
|
3898
|
+
return e.watch = e.loaded, e;
|
|
3862
3899
|
}, Ci = function(t) {
|
|
3863
3900
|
const e = {
|
|
3864
3901
|
name: "t",
|
|
@@ -3872,12 +3909,12 @@ const _i = function(t) {
|
|
|
3872
3909
|
if (l) {
|
|
3873
3910
|
const u = typeof l == "object";
|
|
3874
3911
|
let f = (g) => {
|
|
3875
|
-
let
|
|
3876
|
-
const
|
|
3877
|
-
a === "child" ?
|
|
3878
|
-
},
|
|
3879
|
-
const m = t.watchLoadData(
|
|
3880
|
-
f =
|
|
3912
|
+
let $ = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
3913
|
+
const _ = u && l.modify ? i : r.getProp();
|
|
3914
|
+
a === "child" ? _.children ? S(_.children, 0, $) : S(_, "children", [$]) : se(_, a, $), s.sync(i);
|
|
3915
|
+
}, p = (g) => f(g);
|
|
3916
|
+
const m = t.watchLoadData(p);
|
|
3917
|
+
f = ne(f, l.wait || 300), l.watch !== !1 ? o.push(m) : m();
|
|
3881
3918
|
}
|
|
3882
3919
|
}), this._fn[r.id] = o;
|
|
3883
3920
|
},
|
|
@@ -3899,7 +3936,7 @@ const _i = function(t) {
|
|
|
3899
3936
|
const s = i.method;
|
|
3900
3937
|
delete i.method, t.getProp().validate = [U(b({}, i), {
|
|
3901
3938
|
validator(...n) {
|
|
3902
|
-
const o =
|
|
3939
|
+
const o = Z(e);
|
|
3903
3940
|
if (o)
|
|
3904
3941
|
return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
|
|
3905
3942
|
attr: t,
|
|
@@ -3923,55 +3960,55 @@ const _i = function(t) {
|
|
|
3923
3960
|
function r(s, n, o) {
|
|
3924
3961
|
let a = s.value;
|
|
3925
3962
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
3926
|
-
const l = (
|
|
3927
|
-
|
|
3963
|
+
const l = (p) => {
|
|
3964
|
+
p === void 0 ? s.clearProp() : se(s.getProp(), a.to || "options", p), o.sync(n);
|
|
3928
3965
|
};
|
|
3929
3966
|
if (!a || !a.action && !a.key) {
|
|
3930
3967
|
l(void 0);
|
|
3931
3968
|
return;
|
|
3932
3969
|
}
|
|
3933
|
-
if (a =
|
|
3934
|
-
const
|
|
3935
|
-
if (!
|
|
3970
|
+
if (a = G(a), a.to || (a.to = "options"), a.key) {
|
|
3971
|
+
const p = t.$handle.options.globalData[a.key];
|
|
3972
|
+
if (!p) {
|
|
3936
3973
|
l(void 0);
|
|
3937
3974
|
return;
|
|
3938
3975
|
}
|
|
3939
|
-
if (
|
|
3940
|
-
l(
|
|
3976
|
+
if (p.type === "static") {
|
|
3977
|
+
l(p.data);
|
|
3941
3978
|
return;
|
|
3942
3979
|
} else
|
|
3943
|
-
a = b(b({}, a),
|
|
3980
|
+
a = b(b({}, a), p);
|
|
3944
3981
|
}
|
|
3945
3982
|
const u = a.onError, f = () => {
|
|
3946
3983
|
if (!s.getValue())
|
|
3947
3984
|
return s.clearProp(), o.sync(n), !0;
|
|
3948
3985
|
};
|
|
3949
|
-
i._fn[s.id] = t.watchLoadData(
|
|
3986
|
+
i._fn[s.id] = t.watchLoadData(ne((p, m) => {
|
|
3950
3987
|
if (m && a.watch === !1)
|
|
3951
3988
|
return i._fn[s.id]();
|
|
3952
|
-
const g = t.$handle.loadFetchVar(
|
|
3989
|
+
const g = t.$handle.loadFetchVar(G(a), p, n), $ = U(b({
|
|
3953
3990
|
headers: {}
|
|
3954
3991
|
}, g), {
|
|
3955
|
-
onSuccess(
|
|
3992
|
+
onSuccess(_, D) {
|
|
3956
3993
|
if (f()) return;
|
|
3957
|
-
let
|
|
3958
|
-
const
|
|
3959
|
-
h.Function(
|
|
3994
|
+
let ee = (T) => D ? T : E(T, "data") ? T.data : T;
|
|
3995
|
+
const P = z(g.parse);
|
|
3996
|
+
h.Function(P) ? ee = P : P && h.String(P) && (ee = (T) => B(T, P)), l(ee(_, n, o));
|
|
3960
3997
|
},
|
|
3961
|
-
onError(
|
|
3962
|
-
l(void 0), !f() && (u || ((
|
|
3998
|
+
onError(_) {
|
|
3999
|
+
l(void 0), !f() && (u || ((D) => et(D.message || "fetch fail " + g.action)))(_, n, o);
|
|
3963
4000
|
}
|
|
3964
4001
|
});
|
|
3965
|
-
t.$handle.beforeFetch(
|
|
4002
|
+
t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
|
|
3966
4003
|
if (h.Function(g.action)) {
|
|
3967
|
-
g.action(n, o).then((
|
|
3968
|
-
|
|
3969
|
-
}).catch((
|
|
3970
|
-
|
|
4004
|
+
g.action(n, o).then((_) => {
|
|
4005
|
+
$.onSuccess(_, !0);
|
|
4006
|
+
}).catch((_) => {
|
|
4007
|
+
$.onError(_);
|
|
3971
4008
|
});
|
|
3972
4009
|
return;
|
|
3973
4010
|
}
|
|
3974
|
-
O(() => t.create.fetch(
|
|
4011
|
+
O(() => t.create.fetch($, { inject: s, rule: n, api: o }));
|
|
3975
4012
|
});
|
|
3976
4013
|
}, a.wait || 600));
|
|
3977
4014
|
}
|
|
@@ -3995,7 +4032,7 @@ const _i = function(t) {
|
|
|
3995
4032
|
t: Ci,
|
|
3996
4033
|
componentValidate: Jt
|
|
3997
4034
|
};
|
|
3998
|
-
function
|
|
4035
|
+
function Fi(t) {
|
|
3999
4036
|
t = t || /* @__PURE__ */ new Map();
|
|
4000
4037
|
const e = {
|
|
4001
4038
|
$on(r, i) {
|
|
@@ -4019,8 +4056,8 @@ function Si(t) {
|
|
|
4019
4056
|
};
|
|
4020
4057
|
return e;
|
|
4021
4058
|
}
|
|
4022
|
-
const
|
|
4023
|
-
name:
|
|
4059
|
+
const Si = "html", Ri = {
|
|
4060
|
+
name: Si,
|
|
4024
4061
|
loadChildren: !1,
|
|
4025
4062
|
render(t, e) {
|
|
4026
4063
|
return e.prop.domProps || (e.prop.domProps = {}), e.prop.domProps.innerHTML = t, e.vNode.make(e.prop.props.tag || "div", e.prop);
|
|
@@ -4072,7 +4109,7 @@ function it(t, e) {
|
|
|
4072
4109
|
return null;
|
|
4073
4110
|
const r = e.split(".");
|
|
4074
4111
|
let i = t(r.shift());
|
|
4075
|
-
return r.length ? i == null ? null :
|
|
4112
|
+
return r.length ? i == null ? null : B(i, r) : i;
|
|
4076
4113
|
}
|
|
4077
4114
|
function ji(t) {
|
|
4078
4115
|
return it(ki, t);
|
|
@@ -4087,7 +4124,7 @@ function Vi(t, e) {
|
|
|
4087
4124
|
let r;
|
|
4088
4125
|
return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
|
|
4089
4126
|
}
|
|
4090
|
-
function
|
|
4127
|
+
function Me() {
|
|
4091
4128
|
return Vi("name", ...arguments);
|
|
4092
4129
|
}
|
|
4093
4130
|
function Pi(t) {
|
|
@@ -4106,79 +4143,79 @@ function Bi(t, e) {
|
|
|
4106
4143
|
}
|
|
4107
4144
|
function Li(t) {
|
|
4108
4145
|
const e = t.key || [], r = t.array || [], i = t.normal || [];
|
|
4109
|
-
jt.push(...e),
|
|
4146
|
+
jt.push(...e), Ye.push(...r), xe.push(...i), Nt([...e, ...r, ...i]);
|
|
4110
4147
|
}
|
|
4111
4148
|
let Ti = 1;
|
|
4112
|
-
const M = {},
|
|
4149
|
+
const M = {}, Re = Symbol("defValue");
|
|
4113
4150
|
function Wt(t) {
|
|
4114
4151
|
const e = {
|
|
4115
|
-
[
|
|
4152
|
+
[Ne.name]: Ne
|
|
4116
4153
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4117
4154
|
t.extendApi
|
|
4118
4155
|
], u = b({}, Oi), f = Xr();
|
|
4119
|
-
let
|
|
4120
|
-
const m = t.isMobile === !0, g =
|
|
4156
|
+
let p = { global: {} };
|
|
4157
|
+
const m = t.isMobile === !0, g = ie({
|
|
4121
4158
|
$mobile: m
|
|
4122
|
-
}),
|
|
4159
|
+
}), $ = vi(), _ = {}, D = {};
|
|
4123
4160
|
Li(t.attrs || {});
|
|
4124
|
-
function
|
|
4125
|
-
const
|
|
4126
|
-
if (Array.isArray(
|
|
4127
|
-
return
|
|
4128
|
-
if (
|
|
4129
|
-
return
|
|
4161
|
+
function ee(c) {
|
|
4162
|
+
const d = M[c];
|
|
4163
|
+
if (Array.isArray(d))
|
|
4164
|
+
return d.map((y) => y.api());
|
|
4165
|
+
if (d)
|
|
4166
|
+
return d.api();
|
|
4130
4167
|
}
|
|
4131
|
-
function
|
|
4168
|
+
function P(c) {
|
|
4132
4169
|
o.push(c);
|
|
4133
4170
|
}
|
|
4134
|
-
function
|
|
4135
|
-
const c =
|
|
4171
|
+
function T() {
|
|
4172
|
+
const c = Me(...arguments);
|
|
4136
4173
|
c.id && c.prop && (i[c.id] = c.prop);
|
|
4137
4174
|
}
|
|
4138
|
-
function
|
|
4139
|
-
const c =
|
|
4175
|
+
function ce() {
|
|
4176
|
+
const c = Me(...arguments);
|
|
4140
4177
|
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(b({}, c.prop), {
|
|
4141
4178
|
name: c.id
|
|
4142
4179
|
}));
|
|
4143
4180
|
}
|
|
4144
|
-
function
|
|
4145
|
-
|
|
4181
|
+
function Ve(c) {
|
|
4182
|
+
$.use(c);
|
|
4146
4183
|
}
|
|
4147
|
-
function
|
|
4148
|
-
const c =
|
|
4149
|
-
if (!c.id || !c.prop) return
|
|
4150
|
-
const
|
|
4151
|
-
r[
|
|
4184
|
+
function he() {
|
|
4185
|
+
const c = Me(...arguments);
|
|
4186
|
+
if (!c.id || !c.prop) return Ee;
|
|
4187
|
+
const d = q(c.id), y = c.prop, v = y.merge === !0 ? r[d] : void 0;
|
|
4188
|
+
r[d] = Se(y, v || Ee), f[d] = V(d), y.maker && C(f, y.maker);
|
|
4152
4189
|
}
|
|
4153
|
-
function
|
|
4190
|
+
function F(c, d) {
|
|
4154
4191
|
let y;
|
|
4155
4192
|
if (h.String(c)) {
|
|
4156
|
-
if (y = c,
|
|
4157
|
-
return ["form-create", "formcreate"].indexOf(y) > -1 ?
|
|
4193
|
+
if (y = c, d === void 0)
|
|
4194
|
+
return ["form-create", "formcreate"].indexOf(y) > -1 ? R() : e[y];
|
|
4158
4195
|
} else
|
|
4159
|
-
y = q(c.name),
|
|
4160
|
-
if (!y || !
|
|
4161
|
-
const
|
|
4162
|
-
e[y] =
|
|
4196
|
+
y = q(c.name), d = c;
|
|
4197
|
+
if (!y || !d) return;
|
|
4198
|
+
const v = q(y);
|
|
4199
|
+
e[y] = d, e[v] = d, delete $.aliasMap[y], delete $.aliasMap[v], delete r[y], delete r[v], d.formCreateParser && he(y, d.formCreateParser);
|
|
4163
4200
|
}
|
|
4164
|
-
function
|
|
4165
|
-
return
|
|
4201
|
+
function R() {
|
|
4202
|
+
return zr(Be, e, i);
|
|
4166
4203
|
}
|
|
4167
|
-
function
|
|
4168
|
-
return
|
|
4204
|
+
function N() {
|
|
4205
|
+
return Ne;
|
|
4169
4206
|
}
|
|
4170
|
-
function
|
|
4171
|
-
return h.Function(c.install) ? c.install(
|
|
4207
|
+
function de(c, d) {
|
|
4208
|
+
return h.Function(c.install) ? c.install(J, d) : h.Function(c) && c(J, d), this;
|
|
4172
4209
|
}
|
|
4173
|
-
function
|
|
4174
|
-
let
|
|
4175
|
-
const
|
|
4176
|
-
return
|
|
4210
|
+
function J(c, d, y) {
|
|
4211
|
+
let v = Bi(c, d || {});
|
|
4212
|
+
const w = v.$refs.fc.formCreate;
|
|
4213
|
+
return w.$parent = y, Pi(w.options).appendChild(v.$el), w.api();
|
|
4177
4214
|
}
|
|
4178
|
-
Se(
|
|
4215
|
+
Se(J, D);
|
|
4179
4216
|
function Kt(c) {
|
|
4180
|
-
let
|
|
4181
|
-
return c ?
|
|
4217
|
+
let d = b({}, t);
|
|
4218
|
+
return c ? d.inherit = {
|
|
4182
4219
|
components: e,
|
|
4183
4220
|
parsers: r,
|
|
4184
4221
|
directives: i,
|
|
@@ -4186,145 +4223,146 @@ function Wt(t) {
|
|
|
4186
4223
|
providers: u,
|
|
4187
4224
|
useApps: o,
|
|
4188
4225
|
maker: f,
|
|
4189
|
-
formulas:
|
|
4226
|
+
formulas: _,
|
|
4190
4227
|
loadData: g
|
|
4191
|
-
} : delete
|
|
4228
|
+
} : delete d.inherit, Wt(d);
|
|
4192
4229
|
}
|
|
4193
|
-
function Xt(c,
|
|
4194
|
-
s[c] =
|
|
4230
|
+
function Xt(c, d) {
|
|
4231
|
+
s[c] = d;
|
|
4195
4232
|
}
|
|
4196
|
-
function Qt(c,
|
|
4197
|
-
|
|
4233
|
+
function Qt(c, d) {
|
|
4234
|
+
_[c] = d;
|
|
4198
4235
|
}
|
|
4199
|
-
function Zt(c,
|
|
4200
|
-
const y = n[c] || {},
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
}),
|
|
4236
|
+
function Zt(c, d) {
|
|
4237
|
+
const y = n[c] || {}, v = y.parsers || {};
|
|
4238
|
+
d.parsers && Object.keys(d.parsers).forEach((w) => {
|
|
4239
|
+
v[w] = Se(d.parsers[w], Ee);
|
|
4240
|
+
}), d.name = c, n[c] = U(b(b({}, y), d), { parsers: v });
|
|
4204
4241
|
}
|
|
4205
|
-
function
|
|
4206
|
-
c && Object.keys(M).forEach((
|
|
4207
|
-
(Array.isArray(M[
|
|
4208
|
-
|
|
4242
|
+
function Ce(c) {
|
|
4243
|
+
c && Object.keys(M).forEach((d) => {
|
|
4244
|
+
(Array.isArray(M[d]) ? M[d] : [M[d]]).forEach((v) => {
|
|
4245
|
+
v.bus.$emit("$loadData." + c);
|
|
4209
4246
|
});
|
|
4210
4247
|
});
|
|
4211
4248
|
}
|
|
4212
|
-
function
|
|
4213
|
-
|
|
4249
|
+
function Pe(c, d) {
|
|
4250
|
+
se(g, c, d), Ce(c);
|
|
4214
4251
|
}
|
|
4215
|
-
function
|
|
4216
|
-
const y = (
|
|
4217
|
-
y._driver = !0,
|
|
4252
|
+
function we(c, d) {
|
|
4253
|
+
const y = (...v) => O(() => d(...v));
|
|
4254
|
+
y._driver = !0, Pe(c, y);
|
|
4218
4255
|
}
|
|
4219
|
-
function nt(c,
|
|
4256
|
+
function nt(c, d) {
|
|
4220
4257
|
const y = (c || "").split(".");
|
|
4221
4258
|
c = y.shift();
|
|
4222
|
-
const
|
|
4223
|
-
if (
|
|
4224
|
-
let
|
|
4225
|
-
return
|
|
4259
|
+
const v = y.join(".");
|
|
4260
|
+
if (E(g, c) || S(g, c, Re), g[c] !== Re) {
|
|
4261
|
+
let w = g[c];
|
|
4262
|
+
return w && w._driver ? w = w(v) : y.length && (w = B(w, y)), w == null || w === "" ? d : w;
|
|
4226
4263
|
} else
|
|
4227
|
-
return
|
|
4264
|
+
return d;
|
|
4228
4265
|
}
|
|
4229
4266
|
function Yt(c) {
|
|
4230
4267
|
l.push(c);
|
|
4231
4268
|
}
|
|
4232
4269
|
function xt(c) {
|
|
4233
|
-
delete g[c],
|
|
4270
|
+
delete g[c], Ce(c);
|
|
4234
4271
|
}
|
|
4235
|
-
function er(c,
|
|
4236
|
-
a.push({ name: c, callback:
|
|
4272
|
+
function er(c, d) {
|
|
4273
|
+
a.push({ name: c, callback: d });
|
|
4237
4274
|
}
|
|
4238
|
-
function
|
|
4239
|
-
|
|
4275
|
+
function Be(c) {
|
|
4276
|
+
C(this, {
|
|
4240
4277
|
id: Ti++,
|
|
4241
|
-
create:
|
|
4278
|
+
create: J,
|
|
4242
4279
|
vm: c,
|
|
4243
4280
|
manager: bi(t.manager),
|
|
4244
4281
|
parsers: r,
|
|
4245
4282
|
providers: u,
|
|
4246
4283
|
modelFields: s,
|
|
4247
|
-
formulas:
|
|
4284
|
+
formulas: _,
|
|
4248
4285
|
isMobile: m,
|
|
4249
4286
|
rules: c.$options.propsData.rule,
|
|
4250
|
-
name: c.$options.propsData.name ||
|
|
4287
|
+
name: c.$options.propsData.name || Ae(),
|
|
4251
4288
|
inFor: c.$options.propsData.inFor,
|
|
4252
4289
|
prop: {
|
|
4253
4290
|
components: e,
|
|
4254
4291
|
directives: i
|
|
4255
4292
|
},
|
|
4293
|
+
get: null,
|
|
4256
4294
|
drivers: n,
|
|
4257
4295
|
renderDriver: null,
|
|
4258
|
-
refreshData:
|
|
4296
|
+
refreshData: Ce,
|
|
4259
4297
|
loadData: g,
|
|
4260
|
-
CreateNode:
|
|
4261
|
-
bus: new
|
|
4298
|
+
CreateNode: $,
|
|
4299
|
+
bus: new Fi(),
|
|
4262
4300
|
unwatch: [],
|
|
4263
4301
|
options: mr({}),
|
|
4264
4302
|
extendApiFn: l,
|
|
4265
4303
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4266
|
-
tmpData:
|
|
4267
|
-
}), a.forEach((
|
|
4268
|
-
this.bus.$on(
|
|
4269
|
-
}),
|
|
4304
|
+
tmpData: ie({})
|
|
4305
|
+
}), a.forEach((d) => {
|
|
4306
|
+
this.bus.$on(d.name, d.callback);
|
|
4307
|
+
}), A(() => {
|
|
4270
4308
|
L(this.options, () => {
|
|
4271
4309
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
4272
4310
|
}, { deep: !0 });
|
|
4273
|
-
}),
|
|
4311
|
+
}), 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
4312
|
}
|
|
4275
|
-
|
|
4313
|
+
Be.isMobile = m, C(Be.prototype, {
|
|
4276
4314
|
init() {
|
|
4277
4315
|
this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
|
|
4278
4316
|
this.initOptions(), this.$handle.api.refresh();
|
|
4279
|
-
}, { 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();
|
|
4317
|
+
}, { 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.fc.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
|
|
4280
4318
|
},
|
|
4281
|
-
targetFormDriver(c, ...
|
|
4319
|
+
targetFormDriver(c, ...d) {
|
|
4282
4320
|
if (this.renderDriver && this.renderDriver[c])
|
|
4283
|
-
return O(() => this.renderDriver[c](...
|
|
4321
|
+
return O(() => this.renderDriver[c](...d));
|
|
4284
4322
|
},
|
|
4285
|
-
t(c,
|
|
4286
|
-
let
|
|
4287
|
-
return
|
|
4288
|
-
const
|
|
4289
|
-
|
|
4290
|
-
}),
|
|
4323
|
+
t(c, d, y) {
|
|
4324
|
+
let v = y ? y("$t." + c) : this.globalLanguageDriver(c);
|
|
4325
|
+
return v == null && (v = ""), v && d && Object.keys(d).forEach((w) => {
|
|
4326
|
+
const j = new RegExp(`{${w}}`, "g");
|
|
4327
|
+
v = v.replace(j, d[w]);
|
|
4328
|
+
}), v;
|
|
4291
4329
|
},
|
|
4292
4330
|
globalDataDriver(c) {
|
|
4293
|
-
let
|
|
4294
|
-
const y =
|
|
4295
|
-
if (
|
|
4296
|
-
if (
|
|
4297
|
-
return
|
|
4331
|
+
let d = c.split(".");
|
|
4332
|
+
const y = d.shift(), v = this.options.value.globalData && this.options.value.globalData[y];
|
|
4333
|
+
if (v) {
|
|
4334
|
+
if (v.type === "static")
|
|
4335
|
+
return B(v.data, d);
|
|
4298
4336
|
{
|
|
4299
|
-
let
|
|
4300
|
-
const
|
|
4301
|
-
if (
|
|
4302
|
-
if (
|
|
4303
|
-
return
|
|
4304
|
-
|
|
4337
|
+
let w;
|
|
4338
|
+
const j = this.fetchCache.get(v);
|
|
4339
|
+
if (j) {
|
|
4340
|
+
if (j.status && (w = B(j.data, d)), !j.loading)
|
|
4341
|
+
return w;
|
|
4342
|
+
j.loading = !1, this.fetchCache.set(v, j);
|
|
4305
4343
|
} else
|
|
4306
|
-
this.fetchCache.set(
|
|
4307
|
-
const
|
|
4344
|
+
this.fetchCache.set(v, { status: !1 });
|
|
4345
|
+
const k = ne(() => {
|
|
4308
4346
|
le();
|
|
4309
|
-
const
|
|
4310
|
-
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(
|
|
4311
|
-
},
|
|
4312
|
-
this.fetchCache.set(
|
|
4313
|
-
},
|
|
4314
|
-
if (ue &&
|
|
4347
|
+
const W = this.fetchCache.get(v);
|
|
4348
|
+
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(v) !== -1 ? (W && (W.loading = !0, this.fetchCache.set(v, W)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(v);
|
|
4349
|
+
}, v.wait || 600), ae = (W) => {
|
|
4350
|
+
this.fetchCache.set(v, { status: !0, data: W }), this.bus.$emit("$loadData.$globalData." + y);
|
|
4351
|
+
}, X = (W, ue) => {
|
|
4352
|
+
if (ue && v.watch === !1)
|
|
4315
4353
|
return le();
|
|
4316
4354
|
if (ue) {
|
|
4317
|
-
|
|
4355
|
+
k();
|
|
4318
4356
|
return;
|
|
4319
4357
|
}
|
|
4320
|
-
const
|
|
4321
|
-
this.$handle.api.fetch(
|
|
4322
|
-
ae(
|
|
4323
|
-
}).catch((
|
|
4358
|
+
const pe = this.$handle.loadFetchVar(We(v), W);
|
|
4359
|
+
this.$handle.api.fetch(pe).then((te) => {
|
|
4360
|
+
ae(te);
|
|
4361
|
+
}).catch((te) => {
|
|
4324
4362
|
ae(null);
|
|
4325
4363
|
});
|
|
4326
|
-
}, le = this.watchLoadData(
|
|
4327
|
-
return this.unwatch.push(le),
|
|
4364
|
+
}, le = this.watchLoadData(X);
|
|
4365
|
+
return this.unwatch.push(le), w;
|
|
4328
4366
|
}
|
|
4329
4367
|
}
|
|
4330
4368
|
},
|
|
@@ -4333,90 +4371,93 @@ function Wt(t) {
|
|
|
4333
4371
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4334
4372
|
},
|
|
4335
4373
|
globalLanguageDriver(c) {
|
|
4336
|
-
let
|
|
4337
|
-
if (
|
|
4338
|
-
const
|
|
4339
|
-
y =
|
|
4374
|
+
let d = this.vm.top.$props.locale, y;
|
|
4375
|
+
if (d && typeof d == "object" && (y = B(d, c)), y == null) {
|
|
4376
|
+
const v = this.options.value.language || {}, w = this.getLocale();
|
|
4377
|
+
y = B(v[w], c);
|
|
4340
4378
|
}
|
|
4341
4379
|
return y;
|
|
4342
4380
|
},
|
|
4343
4381
|
globalVarDriver(c) {
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4382
|
+
let d = c.split(".");
|
|
4383
|
+
const y = d.shift(), v = this.options.value.globalVariable && this.options.value.globalVariable[y];
|
|
4384
|
+
if (v) {
|
|
4385
|
+
const w = h.Function(v) ? v : z(v.handle);
|
|
4386
|
+
if (w) {
|
|
4387
|
+
let j;
|
|
4388
|
+
const k = this.watchLoadData((ae, X) => {
|
|
4389
|
+
X ? (this.bus.$emit("$loadData.$var." + y), k()) : j = w(ae, this.$handle.api);
|
|
4351
4390
|
});
|
|
4352
|
-
return this.unwatch.push(
|
|
4391
|
+
return this.unwatch.push(k), B(j, d);
|
|
4353
4392
|
}
|
|
4354
4393
|
}
|
|
4355
4394
|
},
|
|
4356
|
-
setData(c,
|
|
4357
|
-
y ?
|
|
4395
|
+
setData(c, d, y) {
|
|
4396
|
+
y ? Pe(c, d) : (se(this.vm.top.fc.tmpData, c, d), this.bus.$emit("$loadData." + c));
|
|
4358
4397
|
},
|
|
4359
|
-
getLoadData(c,
|
|
4398
|
+
getLoadData(c, d) {
|
|
4360
4399
|
let y = null;
|
|
4361
4400
|
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 (
|
|
4401
|
+
let v = c.split(".");
|
|
4402
|
+
const w = v.shift();
|
|
4403
|
+
if (w === "$topForm")
|
|
4404
|
+
y = this.$handle.api.top.formData(!0);
|
|
4405
|
+
else if (w === "$scopeForm")
|
|
4406
|
+
y = this.$handle.api.scope.formData(!0);
|
|
4407
|
+
else if (w === "$form")
|
|
4408
|
+
y = this.$handle.api.formData(!0);
|
|
4409
|
+
else if (w === "$options")
|
|
4369
4410
|
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(
|
|
4411
|
+
else if (w === "$globalData")
|
|
4412
|
+
y = this.globalDataDriver(v.join(".")), v = [];
|
|
4413
|
+
else if (w === "$var")
|
|
4414
|
+
y = this.globalVarDriver(v.join(".")), v = [];
|
|
4415
|
+
else if (w === "$locale")
|
|
4416
|
+
y = this.getLocale(), v = [];
|
|
4417
|
+
else if (w === "$t")
|
|
4418
|
+
y = this.globalLanguageDriver(v.join(".")), v = [];
|
|
4378
4419
|
else {
|
|
4379
|
-
if (
|
|
4420
|
+
if (w === "$preview")
|
|
4380
4421
|
return this.$handle.preview;
|
|
4381
4422
|
{
|
|
4382
|
-
const
|
|
4383
|
-
|
|
4423
|
+
const j = this.vm.top.fc.tmpData;
|
|
4424
|
+
E(j, w) || S(j, w, Re), y = j[w] !== Re ? B(j, c) : nt(c), v = [];
|
|
4384
4425
|
}
|
|
4385
4426
|
}
|
|
4386
|
-
y &&
|
|
4427
|
+
y && v.length && (y = B(y, v));
|
|
4387
4428
|
}
|
|
4388
|
-
return y == null || y === "" ?
|
|
4429
|
+
return y == null || y === "" ? d : y;
|
|
4389
4430
|
},
|
|
4390
|
-
watchLoadData(c,
|
|
4431
|
+
watchLoadData(c, d) {
|
|
4391
4432
|
let y = {};
|
|
4392
|
-
const
|
|
4393
|
-
O(() => {
|
|
4394
|
-
c(
|
|
4395
|
-
});
|
|
4396
|
-
},
|
|
4397
|
-
let
|
|
4398
|
-
if (typeof
|
|
4399
|
-
return y[
|
|
4400
|
-
const le =
|
|
4401
|
-
const
|
|
4402
|
-
if (y[
|
|
4403
|
-
JSON.stringify(
|
|
4433
|
+
const v = (k) => {
|
|
4434
|
+
this.get || (this.get = w), O(() => {
|
|
4435
|
+
c(w, k);
|
|
4436
|
+
}), this.get === w && (this.get = void 0);
|
|
4437
|
+
}, w = (k, ae) => {
|
|
4438
|
+
let X;
|
|
4439
|
+
if (typeof k == "object" && (X = k.getValue, k = k.id), y[k])
|
|
4440
|
+
return y[k].val;
|
|
4441
|
+
const le = ge(() => X ? X() : this.getLoadData(k, ae)), W = k.split("."), ue = W.shift(), pe = W.shift() || "", te = ne(() => {
|
|
4442
|
+
const Le = X ? X() : this.getLoadData(k, ae);
|
|
4443
|
+
if (y[k])
|
|
4444
|
+
JSON.stringify(Le) !== JSON.stringify(y[k].val) && (y[k].val = Le, v(!0));
|
|
4404
4445
|
else return;
|
|
4405
|
-
},
|
|
4406
|
-
|
|
4446
|
+
}, d || 0), rr = L(le, (Le) => {
|
|
4447
|
+
te();
|
|
4407
4448
|
});
|
|
4408
|
-
return this.bus.$on("$loadData." + ue,
|
|
4449
|
+
return this.bus.$on("$loadData." + ue, te), pe && this.bus.$on("$loadData." + ue + "." + pe, te), y[k] = {
|
|
4409
4450
|
fn: () => {
|
|
4410
|
-
this.bus.$off("$loadData." + ue,
|
|
4451
|
+
this.bus.$off("$loadData." + ue, te), pe && this.bus.$off("$loadData." + ue + "." + pe, te), rr();
|
|
4411
4452
|
},
|
|
4412
4453
|
val: le.value
|
|
4413
4454
|
}, le.value;
|
|
4414
4455
|
};
|
|
4415
|
-
|
|
4416
|
-
const
|
|
4417
|
-
Object.keys(y).forEach((
|
|
4456
|
+
v(!1);
|
|
4457
|
+
const j = () => {
|
|
4458
|
+
Object.keys(y).forEach((k) => y[k].fn()), y = {};
|
|
4418
4459
|
};
|
|
4419
|
-
return this.unwatch.push(
|
|
4460
|
+
return this.unwatch.push(j), j;
|
|
4420
4461
|
},
|
|
4421
4462
|
isSub() {
|
|
4422
4463
|
return this.vm.parent && this.vm.extendOption;
|
|
@@ -4429,13 +4470,13 @@ function Wt(t) {
|
|
|
4429
4470
|
resetBtn: {},
|
|
4430
4471
|
globalEvent: {},
|
|
4431
4472
|
globalData: {}
|
|
4432
|
-
},
|
|
4473
|
+
}, G(p));
|
|
4433
4474
|
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
4475
|
},
|
|
4435
|
-
mergeOptions(c,
|
|
4436
|
-
return
|
|
4437
|
-
delete
|
|
4438
|
-
}),
|
|
4476
|
+
mergeOptions(c, d, y) {
|
|
4477
|
+
return d = b({}, d || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((v) => {
|
|
4478
|
+
delete d[v];
|
|
4479
|
+
}), d.global && (c.global = Hr(c.global, d.global), delete d.global), this.$handle.$manager.mergeOptions([d], c), c;
|
|
4439
4480
|
},
|
|
4440
4481
|
updateOptions(c) {
|
|
4441
4482
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4465,75 +4506,75 @@ function Wt(t) {
|
|
|
4465
4506
|
}
|
|
4466
4507
|
});
|
|
4467
4508
|
function st(c) {
|
|
4468
|
-
|
|
4509
|
+
C(c, {
|
|
4469
4510
|
version: t.version,
|
|
4470
4511
|
ui: t.ui,
|
|
4471
4512
|
isMobile: m,
|
|
4472
4513
|
extendApi: Yt,
|
|
4473
4514
|
getData: nt,
|
|
4474
|
-
setDataDriver:
|
|
4475
|
-
setData:
|
|
4515
|
+
setDataDriver: we,
|
|
4516
|
+
setData: Pe,
|
|
4476
4517
|
removeData: xt,
|
|
4477
|
-
refreshData:
|
|
4518
|
+
refreshData: Ce,
|
|
4478
4519
|
maker: f,
|
|
4479
|
-
component:
|
|
4480
|
-
directive:
|
|
4520
|
+
component: F,
|
|
4521
|
+
directive: T,
|
|
4481
4522
|
setModelField: Xt,
|
|
4482
4523
|
setFormula: Qt,
|
|
4483
4524
|
setDriver: Zt,
|
|
4484
|
-
register:
|
|
4485
|
-
$vnode:
|
|
4486
|
-
parser:
|
|
4487
|
-
use:
|
|
4525
|
+
register: ce,
|
|
4526
|
+
$vnode: N,
|
|
4527
|
+
parser: he,
|
|
4528
|
+
use: de,
|
|
4488
4529
|
factory: Kt,
|
|
4489
|
-
componentAlias:
|
|
4530
|
+
componentAlias: Ve,
|
|
4490
4531
|
copyRule: Pt,
|
|
4491
4532
|
copyRules: Bt,
|
|
4492
|
-
mergeRule:
|
|
4533
|
+
mergeRule: x,
|
|
4493
4534
|
fetch: Ut,
|
|
4494
|
-
$form:
|
|
4495
|
-
parseFn:
|
|
4535
|
+
$form: R,
|
|
4536
|
+
parseFn: z,
|
|
4496
4537
|
parseJson: Vt,
|
|
4497
|
-
toJson:
|
|
4498
|
-
useApp:
|
|
4499
|
-
getApi:
|
|
4538
|
+
toJson: be,
|
|
4539
|
+
useApp: P,
|
|
4540
|
+
getApi: ee,
|
|
4500
4541
|
on: er
|
|
4501
4542
|
});
|
|
4502
4543
|
}
|
|
4503
4544
|
function tr(c) {
|
|
4504
|
-
|
|
4505
|
-
create:
|
|
4506
|
-
install(
|
|
4507
|
-
if (
|
|
4508
|
-
|
|
4509
|
-
const
|
|
4510
|
-
return
|
|
4545
|
+
C(c, {
|
|
4546
|
+
create: J,
|
|
4547
|
+
install(d, y) {
|
|
4548
|
+
if (p = b(b({}, p), y || {}), d._installedFormCreate === !0) return;
|
|
4549
|
+
d._installedFormCreate = !0;
|
|
4550
|
+
const v = function(j, k = {}) {
|
|
4551
|
+
return J(j, k, this);
|
|
4511
4552
|
};
|
|
4512
|
-
st(
|
|
4513
|
-
const
|
|
4514
|
-
|
|
4515
|
-
O(() =>
|
|
4553
|
+
st(v), d.prototype.$formCreate = v;
|
|
4554
|
+
const w = R();
|
|
4555
|
+
d.component(w.name, w), d.component("FcFragment", N()), o.forEach((j) => {
|
|
4556
|
+
O(() => j(c, d));
|
|
4516
4557
|
});
|
|
4517
4558
|
}
|
|
4518
4559
|
});
|
|
4519
4560
|
}
|
|
4520
|
-
if (st(
|
|
4561
|
+
if (st(D), tr(D), we("$cookie", ji), we("$localStorage", Ii), we("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install && J.use(t), he(Ri), t.inherit) {
|
|
4521
4562
|
const c = t.inherit;
|
|
4522
|
-
c.components &&
|
|
4563
|
+
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
4564
|
}
|
|
4524
|
-
const
|
|
4525
|
-
return Se(
|
|
4565
|
+
const Oe = R();
|
|
4566
|
+
return Se(Oe, D), Object.defineProperties(Oe, {
|
|
4526
4567
|
fetch: {
|
|
4527
4568
|
get() {
|
|
4528
|
-
return
|
|
4569
|
+
return D.fetch;
|
|
4529
4570
|
},
|
|
4530
4571
|
set(c) {
|
|
4531
|
-
|
|
4572
|
+
D.fetch = c;
|
|
4532
4573
|
}
|
|
4533
4574
|
}
|
|
4534
|
-
}),
|
|
4575
|
+
}), Oe.util = D, Oe;
|
|
4535
4576
|
}
|
|
4536
|
-
function
|
|
4577
|
+
function Ue(t) {
|
|
4537
4578
|
if (h.Date(t))
|
|
4538
4579
|
return t;
|
|
4539
4580
|
{
|
|
@@ -4544,11 +4585,11 @@ function Me(t) {
|
|
|
4544
4585
|
const bt = "datePicker", Ni = {
|
|
4545
4586
|
name: bt,
|
|
4546
4587
|
maker: function() {
|
|
4547
|
-
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] =
|
|
4588
|
+
return ["date", "dateRange", "datetime", "datetimeRange", "year", "month"].reduce((t, e) => (t[e] = V(bt, { type: e.toLowerCase() }), t), {});
|
|
4548
4589
|
}(),
|
|
4549
4590
|
mergeProp(t) {
|
|
4550
4591
|
let e = t.prop.props;
|
|
4551
|
-
e.startDate && (e.startDate = e.startDate &&
|
|
4592
|
+
e.startDate && (e.startDate = e.startDate && Ue(e.startDate));
|
|
4552
4593
|
},
|
|
4553
4594
|
isRange(t) {
|
|
4554
4595
|
return t.type.includes("range") || t.multiple;
|
|
@@ -4567,25 +4608,25 @@ const bt = "datePicker", Ni = {
|
|
|
4567
4608
|
return this.isRange(e.el) ? r : r[0];
|
|
4568
4609
|
} else {
|
|
4569
4610
|
let r = Array.isArray(t), i = e.prop.props, s, n = i.type || "date";
|
|
4570
|
-
return ["daterange", "datetimerange"].indexOf(n) !== -1 ? r ? s = t.map((o) => o ?
|
|
4611
|
+
return ["daterange", "datetimerange"].indexOf(n) !== -1 ? r ? s = t.map((o) => o ? Ue(o) : "") : s = ["", ""] : n === "date" && i.multiple === !0 ? s = toString(t) : (s = r ? t[0] || "" : t, s = s ? Ue(s) : ""), s;
|
|
4571
4612
|
}
|
|
4572
4613
|
},
|
|
4573
4614
|
mounted(t) {
|
|
4574
4615
|
t.rule.value = this.toValue(t.$handle.getFormData(t), t);
|
|
4575
4616
|
}
|
|
4576
|
-
},
|
|
4577
|
-
name:
|
|
4617
|
+
}, qe = "hidden", Mi = {
|
|
4618
|
+
name: qe,
|
|
4578
4619
|
maker: {
|
|
4579
|
-
[
|
|
4620
|
+
[qe]: (t, e) => V(qe)("", t, e)
|
|
4580
4621
|
},
|
|
4581
4622
|
render() {
|
|
4582
4623
|
return [];
|
|
4583
4624
|
}
|
|
4584
|
-
},
|
|
4585
|
-
name:
|
|
4625
|
+
}, Ge = "input", Ui = {
|
|
4626
|
+
name: Ge,
|
|
4586
4627
|
maker: function() {
|
|
4587
|
-
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] =
|
|
4588
|
-
return t.idate =
|
|
4628
|
+
const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = V(Ge, { type: r }), e), {});
|
|
4629
|
+
return t.idate = V(Ge, { type: "date" }), t;
|
|
4589
4630
|
}(),
|
|
4590
4631
|
mergeProp(t) {
|
|
4591
4632
|
let { props: e } = t.prop;
|
|
@@ -4594,7 +4635,7 @@ const bt = "datePicker", Ni = {
|
|
|
4594
4635
|
}, _t = "slider", qi = {
|
|
4595
4636
|
name: _t,
|
|
4596
4637
|
maker: {
|
|
4597
|
-
sliderRange:
|
|
4638
|
+
sliderRange: V(_t, { range: !0 })
|
|
4598
4639
|
},
|
|
4599
4640
|
toFormValue(t, e) {
|
|
4600
4641
|
let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
|
|
@@ -4647,7 +4688,7 @@ const bt = "datePicker", Ni = {
|
|
|
4647
4688
|
array: "fcGroup",
|
|
4648
4689
|
subForm: "fcSubForm",
|
|
4649
4690
|
object: "fcSubForm"
|
|
4650
|
-
},
|
|
4691
|
+
}, je = {
|
|
4651
4692
|
resetBtnType: "default",
|
|
4652
4693
|
resetBtnIcon: "md-refresh",
|
|
4653
4694
|
infoIcon: "ios-information-circle-outline"
|
|
@@ -4658,7 +4699,7 @@ function zi() {
|
|
|
4658
4699
|
trigger: "hover",
|
|
4659
4700
|
placement: "top-start",
|
|
4660
4701
|
wordWrap: !0,
|
|
4661
|
-
icon:
|
|
4702
|
+
icon: je.infoIcon
|
|
4662
4703
|
};
|
|
4663
4704
|
}
|
|
4664
4705
|
function Ki() {
|
|
@@ -4683,9 +4724,9 @@ function Ki() {
|
|
|
4683
4724
|
click: void 0
|
|
4684
4725
|
},
|
|
4685
4726
|
resetBtn: {
|
|
4686
|
-
type:
|
|
4727
|
+
type: je.resetBtnType,
|
|
4687
4728
|
disabled: !1,
|
|
4688
|
-
icon:
|
|
4729
|
+
icon: je.resetBtnIcon,
|
|
4689
4730
|
innerText: "",
|
|
4690
4731
|
loading: !1,
|
|
4691
4732
|
show: !1,
|
|
@@ -4694,15 +4735,15 @@ function Ki() {
|
|
|
4694
4735
|
};
|
|
4695
4736
|
}
|
|
4696
4737
|
function Ct(t, e) {
|
|
4697
|
-
|
|
4738
|
+
E(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4698
4739
|
}
|
|
4699
|
-
function
|
|
4740
|
+
function Q(t) {
|
|
4700
4741
|
return t === !1;
|
|
4701
4742
|
}
|
|
4702
4743
|
function Xi(t, e) {
|
|
4703
|
-
|
|
4744
|
+
E(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
4704
4745
|
}
|
|
4705
|
-
function
|
|
4746
|
+
function He(t) {
|
|
4706
4747
|
const e = b({}, t);
|
|
4707
4748
|
return delete e.children, e;
|
|
4708
4749
|
}
|
|
@@ -4739,7 +4780,7 @@ const Qi = {
|
|
|
4739
4780
|
wrap: {}
|
|
4740
4781
|
};
|
|
4741
4782
|
["info", "wrap", "col", "title"].forEach((r) => {
|
|
4742
|
-
t.prop[r] =
|
|
4783
|
+
t.prop[r] = Y([this.options[r] || {}, t.prop[r] || {}], e[r]);
|
|
4743
4784
|
}), this.setSize(t.prop.props);
|
|
4744
4785
|
},
|
|
4745
4786
|
setSize(t) {
|
|
@@ -4764,20 +4805,20 @@ const Qi = {
|
|
|
4764
4805
|
},
|
|
4765
4806
|
beforeRender() {
|
|
4766
4807
|
const { key: t, ref: e, $handle: r } = this;
|
|
4767
|
-
|
|
4808
|
+
C(this.rule, { key: t, ref: e }), C(this.rule.props, {
|
|
4768
4809
|
model: r.formData
|
|
4769
4810
|
});
|
|
4770
4811
|
},
|
|
4771
4812
|
render(t) {
|
|
4772
|
-
return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule,
|
|
4813
|
+
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
4814
|
},
|
|
4774
4815
|
makeWrap(t, e) {
|
|
4775
4816
|
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
4817
|
delete r.wrap.title;
|
|
4777
|
-
const u =
|
|
4818
|
+
const u = Q(r.wrap.show) ? e : this.$r(Y([r.wrap, {
|
|
4778
4819
|
props: U(b({
|
|
4779
4820
|
labelWidth: o
|
|
4780
|
-
},
|
|
4821
|
+
}, He(r.wrap || {})), {
|
|
4781
4822
|
prop: t.id,
|
|
4782
4823
|
rules: t.injectValidate()
|
|
4783
4824
|
}),
|
|
@@ -4786,40 +4827,40 @@ const Qi = {
|
|
|
4786
4827
|
ref: t.wrapRef,
|
|
4787
4828
|
type: "formItem"
|
|
4788
4829
|
}]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
4789
|
-
return a === !0 ||
|
|
4830
|
+
return a === !0 || Q(l) || Q(s.show) ? u : this.makeCol(r, i, [u]);
|
|
4790
4831
|
},
|
|
4791
4832
|
isTitle(t) {
|
|
4792
4833
|
if (this.options.form.title === !1) return !1;
|
|
4793
4834
|
const e = t.title;
|
|
4794
|
-
return !(!e.title && !e.native ||
|
|
4835
|
+
return !(!e.title && !e.native || Q(e.show));
|
|
4795
4836
|
},
|
|
4796
4837
|
makeInfo(t, e, r) {
|
|
4797
|
-
var u, f,
|
|
4838
|
+
var u, f, p, m, g, $;
|
|
4798
4839
|
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,
|
|
4840
|
+
title: (f = (u = r.refRule) == null ? void 0 : u.__$title) == null ? void 0 : f.value,
|
|
4800
4841
|
rule: r.rule,
|
|
4801
4842
|
options: this.options
|
|
4802
|
-
}) : ((
|
|
4803
|
-
if (!
|
|
4804
|
-
const
|
|
4843
|
+
}) : ((m = (p = r.refRule) == null ? void 0 : p.__$title) == null ? void 0 : m.value) + (n.labelSuffix || n["label-suffix"] || "")];
|
|
4844
|
+
if (!Q(s.show) && (s.info || s.native) && !Q(s.icon)) {
|
|
4845
|
+
const _ = {
|
|
4805
4846
|
type: s.type || "poptip",
|
|
4806
|
-
props:
|
|
4847
|
+
props: He(s),
|
|
4807
4848
|
key: `${e}pop`,
|
|
4808
4849
|
slot: "label"
|
|
4809
4850
|
};
|
|
4810
|
-
delete
|
|
4811
|
-
const
|
|
4812
|
-
s.info && !
|
|
4851
|
+
delete _.props.icon, delete _.props.show, delete _.props.info, delete _.props.align, delete _.props.native;
|
|
4852
|
+
const D = "content";
|
|
4853
|
+
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
4854
|
this.$r({
|
|
4814
4855
|
type: "icon",
|
|
4815
|
-
props: { type: s.icon === !0 ?
|
|
4856
|
+
props: { type: s.icon === !0 ? je.infoIcon : s.icon, size: 16 },
|
|
4816
4857
|
style: "margin-top: -1px",
|
|
4817
4858
|
key: `${e}i`
|
|
4818
4859
|
})
|
|
4819
4860
|
]));
|
|
4820
4861
|
}
|
|
4821
|
-
const l =
|
|
4822
|
-
props:
|
|
4862
|
+
const l = Y([i, {
|
|
4863
|
+
props: He(i),
|
|
4823
4864
|
key: `${e}tit`,
|
|
4824
4865
|
class: "fc-form-title",
|
|
4825
4866
|
slot: i.slot || "label",
|
|
@@ -4847,7 +4888,7 @@ const Qi = {
|
|
|
4847
4888
|
},
|
|
4848
4889
|
makeFormBtn() {
|
|
4849
4890
|
let t = [];
|
|
4850
|
-
if (
|
|
4891
|
+
if (Q(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Q(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
|
|
4851
4892
|
return;
|
|
4852
4893
|
const e = this.$r({
|
|
4853
4894
|
type: "formItem",
|
|
@@ -4894,10 +4935,10 @@ const Qi = {
|
|
|
4894
4935
|
key: `${this.key}b1`
|
|
4895
4936
|
}, [e]);
|
|
4896
4937
|
}
|
|
4897
|
-
},
|
|
4938
|
+
}, oe = {}, Zi = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
4898
4939
|
function Yi(t) {
|
|
4899
4940
|
Zi.forEach((e) => {
|
|
4900
|
-
t[e] =
|
|
4941
|
+
t[e] = V(e);
|
|
4901
4942
|
}), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
|
|
4902
4943
|
}
|
|
4903
4944
|
function xi(t) {
|
|
@@ -4907,19 +4948,19 @@ function xi(t) {
|
|
|
4907
4948
|
uploadFileOne: ["file", 1],
|
|
4908
4949
|
uploadImageOne: ["image", 1]
|
|
4909
4950
|
};
|
|
4910
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4951
|
+
Object.keys(r).reduce((i, s) => (i[s] = V(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
|
|
4911
4952
|
}
|
|
4912
4953
|
function en(t) {
|
|
4913
4954
|
const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
|
|
4914
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4955
|
+
Object.keys(r).reduce((i, s) => (i[s] = V(e, { type: r[s] }), i), t);
|
|
4915
4956
|
}
|
|
4916
4957
|
function tn(t) {
|
|
4917
4958
|
const e = "timePicker";
|
|
4918
|
-
t.time =
|
|
4959
|
+
t.time = V(e, { type: "time" }), t.timeRange = V(e, { type: "timerange" });
|
|
4919
4960
|
}
|
|
4920
4961
|
function rn(t) {
|
|
4921
4962
|
const e = "select";
|
|
4922
|
-
t.selectMultiple =
|
|
4963
|
+
t.selectMultiple = V(e, { multiple: !0 }), t.selectOne = V(e, { multiple: !1 });
|
|
4923
4964
|
}
|
|
4924
4965
|
function nn(t) {
|
|
4925
4966
|
const e = "frame", r = {
|
|
@@ -4930,14 +4971,14 @@ function nn(t) {
|
|
|
4930
4971
|
frameFileOne: ["file", 1],
|
|
4931
4972
|
frameImageOne: ["image", 1]
|
|
4932
4973
|
};
|
|
4933
|
-
Object.keys(r).reduce((i, s) => (i[s] =
|
|
4974
|
+
Object.keys(r).reduce((i, s) => (i[s] = V(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
4975
|
}
|
|
4935
|
-
Yi(
|
|
4936
|
-
xi(
|
|
4937
|
-
en(
|
|
4938
|
-
rn(
|
|
4939
|
-
nn(
|
|
4940
|
-
tn(
|
|
4976
|
+
Yi(oe);
|
|
4977
|
+
xi(oe);
|
|
4978
|
+
en(oe);
|
|
4979
|
+
rn(oe);
|
|
4980
|
+
nn(oe);
|
|
4981
|
+
tn(oe);
|
|
4941
4982
|
function wt(t, e) {
|
|
4942
4983
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
4943
4984
|
}
|
|
@@ -4954,7 +4995,7 @@ function sn(t, e) {
|
|
|
4954
4995
|
validate(r) {
|
|
4955
4996
|
return new Promise((i, s) => {
|
|
4956
4997
|
const n = t.children, o = [e.$manager.validate()];
|
|
4957
|
-
n.forEach((a) => {
|
|
4998
|
+
n.filter((a) => !a.isScope).forEach((a) => {
|
|
4958
4999
|
o.push(a.validate());
|
|
4959
5000
|
}), Promise.all(o).then(() => {
|
|
4960
5001
|
i(!0), r && r(!0);
|
|
@@ -4968,7 +5009,7 @@ function sn(t, e) {
|
|
|
4968
5009
|
const o = e.getFieldCtx(r);
|
|
4969
5010
|
if (!o) return;
|
|
4970
5011
|
const a = e.subForm[o.id], l = [e.$manager.validateField(o.id)];
|
|
4971
|
-
|
|
5012
|
+
H(a).filter((u) => !u.isScope).forEach((u) => {
|
|
4972
5013
|
l.push(u.validate());
|
|
4973
5014
|
}), Promise.all(l).then(() => {
|
|
4974
5015
|
s(null), i && i(null);
|
|
@@ -5018,19 +5059,19 @@ function sn(t, e) {
|
|
|
5018
5059
|
},
|
|
5019
5060
|
submitBtnProps: (r = {}) => {
|
|
5020
5061
|
let i = wt(e.options.submitBtn, !0);
|
|
5021
|
-
|
|
5062
|
+
C(i, r), e.options.submitBtn = i, t.refreshOptions();
|
|
5022
5063
|
},
|
|
5023
5064
|
resetBtnProps: (r = {}) => {
|
|
5024
5065
|
let i = wt(e.options.resetBtn, !1);
|
|
5025
|
-
|
|
5066
|
+
C(i, r), e.options.resetBtn = i, t.refreshOptions();
|
|
5026
5067
|
},
|
|
5027
5068
|
submit(r, i) {
|
|
5028
5069
|
return new Promise((s, n) => {
|
|
5029
|
-
t.validate().then(() => {
|
|
5030
|
-
let
|
|
5031
|
-
h.Function(r) && O(() => r(
|
|
5032
|
-
}).catch((...
|
|
5033
|
-
h.Function(i) && O(() => i(t, ...
|
|
5070
|
+
(e.options.validateOnSubmit === !1 ? Promise.resolve() : t.validate()).then(() => {
|
|
5071
|
+
let a = t.formData();
|
|
5072
|
+
h.Function(r) && O(() => r(a, t)), h.Function(e.options.onSubmit) && O(() => e.options.onSubmit(a, t)), e.vm.emit("submit", a, t), s(a);
|
|
5073
|
+
}).catch((...a) => {
|
|
5074
|
+
h.Function(i) && O(() => i(t, ...a)), n(...a);
|
|
5034
5075
|
});
|
|
5035
5076
|
});
|
|
5036
5077
|
}
|
|
@@ -5039,23 +5080,24 @@ function sn(t, e) {
|
|
|
5039
5080
|
const zt = {
|
|
5040
5081
|
name: "required",
|
|
5041
5082
|
load(t, e, r) {
|
|
5083
|
+
var s, n;
|
|
5042
5084
|
const i = on(t.getValue());
|
|
5043
5085
|
if (i.required === !1)
|
|
5044
5086
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5045
5087
|
else {
|
|
5046
|
-
const
|
|
5088
|
+
const o = b({
|
|
5047
5089
|
required: !0,
|
|
5048
|
-
validator(
|
|
5049
|
-
h.empty(
|
|
5090
|
+
validator(l, u, f) {
|
|
5091
|
+
h.empty(u) ? f(o.message) : f();
|
|
5050
5092
|
}
|
|
5051
|
-
}, i), n = e.__fc__.refRule.__$title.value;
|
|
5052
|
-
if (!
|
|
5053
|
-
|
|
5093
|
+
}, i), a = (n = (s = e.__fc__.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value;
|
|
5094
|
+
if (!o.message)
|
|
5095
|
+
o.message = r.t("required", { title: a }) || a + (r.getLocale() === "en" ? " is required" : "不能为空");
|
|
5054
5096
|
else {
|
|
5055
|
-
const
|
|
5056
|
-
|
|
5097
|
+
const l = o.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5098
|
+
l && (o.message = r.t(l[1], { title: a }));
|
|
5057
5099
|
}
|
|
5058
|
-
t.getProp().validate = [
|
|
5100
|
+
t.getProp().validate = [o];
|
|
5059
5101
|
}
|
|
5060
5102
|
r.sync(e);
|
|
5061
5103
|
},
|
|
@@ -5071,14 +5113,14 @@ function an(t) {
|
|
|
5071
5113
|
t.component(e.name, e);
|
|
5072
5114
|
}), t.register(zt), Ji.forEach((e) => {
|
|
5073
5115
|
t.parser(e);
|
|
5074
|
-
}), Object.keys(
|
|
5075
|
-
t.maker[e] =
|
|
5116
|
+
}), Object.keys(oe).forEach((e) => {
|
|
5117
|
+
t.maker[e] = oe[e];
|
|
5076
5118
|
});
|
|
5077
5119
|
}
|
|
5078
5120
|
function ln() {
|
|
5079
5121
|
return Wt({
|
|
5080
5122
|
ui: "view-design",
|
|
5081
|
-
version: "2.7.
|
|
5123
|
+
version: "2.7.5",
|
|
5082
5124
|
manager: Qi,
|
|
5083
5125
|
install: an,
|
|
5084
5126
|
extendApi: sn,
|
|
@@ -5089,10 +5131,10 @@ function ln() {
|
|
|
5089
5131
|
}
|
|
5090
5132
|
});
|
|
5091
5133
|
}
|
|
5092
|
-
const
|
|
5093
|
-
typeof window != "undefined" && (window.formCreate =
|
|
5094
|
-
const cn =
|
|
5134
|
+
const Ze = ln();
|
|
5135
|
+
typeof window != "undefined" && (window.formCreate = Ze, window.Vue && Ze.install(window.Vue));
|
|
5136
|
+
const cn = Ze.maker;
|
|
5095
5137
|
export {
|
|
5096
|
-
|
|
5138
|
+
Ze as default,
|
|
5097
5139
|
cn as maker
|
|
5098
5140
|
};
|