@form-create/iview 2.7.14 → 2.7.16
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 +449 -440
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +3 -3
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/iview v2.7.
|
|
3
|
+
* @form-create/iview v2.7.16
|
|
4
4
|
* (c) 2018-2025 xaboy
|
|
5
5
|
* Github https://github.com/xaboy/form-create
|
|
6
6
|
* Site https://form-create.com/
|
|
@@ -11,7 +11,7 @@ var sr = Object.defineProperty, or = Object.defineProperties;
|
|
|
11
11
|
var ar = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var ot = Object.getOwnPropertySymbols;
|
|
13
13
|
var lr = Object.prototype.hasOwnProperty, ur = Object.prototype.propertyIsEnumerable;
|
|
14
|
-
var at = (t, e, r) => e in t ? sr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r,
|
|
14
|
+
var at = (t, e, r) => e in t ? sr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, _ = (t, e) => {
|
|
15
15
|
for (var r in e || (e = {}))
|
|
16
16
|
lr.call(e, r) && at(t, r, e[r]);
|
|
17
17
|
if (ot)
|
|
@@ -19,7 +19,7 @@ var at = (t, e, r) => e in t ? sr(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
19
19
|
ur.call(e, r) && at(t, r, e[r]);
|
|
20
20
|
return t;
|
|
21
21
|
}, U = (t, e) => or(t, ar(e));
|
|
22
|
-
import ye, { getCurrentInstance as fr, provide as cr, inject as hr, toRefs as lt, reactive as
|
|
22
|
+
import ye, { getCurrentInstance as fr, provide as cr, inject as hr, toRefs as lt, reactive as ie, onBeforeMount as dr, watch as B, onMounted as pr, onBeforeUnmount as mr, onUpdated as gr, nextTick as V, markRaw as me, computed as ge, toRef as De, ref as yr } from "vue";
|
|
23
23
|
function $r(t) {
|
|
24
24
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
25
25
|
}
|
|
@@ -50,12 +50,12 @@ var br = ["attrs", "props", "domProps"], vr = ["class", "style", "directives"],
|
|
|
50
50
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
51
51
|
};
|
|
52
52
|
}, Or = Cr;
|
|
53
|
-
const
|
|
53
|
+
const D = /* @__PURE__ */ $r(Or);
|
|
54
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
|
-
const
|
|
58
|
-
name:
|
|
57
|
+
const Fr = "fcCheckbox", kr = {
|
|
58
|
+
name: Fr,
|
|
59
59
|
props: {
|
|
60
60
|
formCreateInject: {
|
|
61
61
|
type: Object,
|
|
@@ -100,7 +100,7 @@ const kr = "fcCheckbox", Fr = {
|
|
|
100
100
|
},
|
|
101
101
|
render() {
|
|
102
102
|
const t = arguments[0];
|
|
103
|
-
return t("CheckboxGroup",
|
|
103
|
+
return t("CheckboxGroup", D([{}, this.formCreateInject.prop, {
|
|
104
104
|
ref: "el"
|
|
105
105
|
}, {
|
|
106
106
|
props: {
|
|
@@ -111,8 +111,8 @@ const kr = "fcCheckbox", Fr = {
|
|
|
111
111
|
input: this.onInput
|
|
112
112
|
}
|
|
113
113
|
}]), [this.options().map((e, r) => {
|
|
114
|
-
const i =
|
|
115
|
-
return delete i.value, t("Checkbox",
|
|
114
|
+
const i = _({}, e);
|
|
115
|
+
return delete i.value, t("Checkbox", D([{}, {
|
|
116
116
|
props: i
|
|
117
117
|
}, {
|
|
118
118
|
key: "" + r + "-" + e.value
|
|
@@ -127,7 +127,7 @@ function H(t) {
|
|
|
127
127
|
return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t];
|
|
128
128
|
}
|
|
129
129
|
const Sr = "fcFrame";
|
|
130
|
-
function
|
|
130
|
+
function Ft(t) {
|
|
131
131
|
return {
|
|
132
132
|
name: Sr,
|
|
133
133
|
props: {
|
|
@@ -286,7 +286,7 @@ function kt(t) {
|
|
|
286
286
|
readonly: !0,
|
|
287
287
|
clearable: !1
|
|
288
288
|
};
|
|
289
|
-
return e("Input",
|
|
289
|
+
return e("Input", D([{}, {
|
|
290
290
|
props: r
|
|
291
291
|
}, {}, {
|
|
292
292
|
on: {
|
|
@@ -325,7 +325,7 @@ function kt(t) {
|
|
|
325
325
|
},
|
|
326
326
|
makeHandleIcon(e, r) {
|
|
327
327
|
const i = this.$createElement;
|
|
328
|
-
return i("icon",
|
|
328
|
+
return i("icon", D([{}, {
|
|
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 kt(t) {
|
|
|
338
338
|
},
|
|
339
339
|
makeRemoveIcon(e, r) {
|
|
340
340
|
const i = this.$createElement;
|
|
341
|
-
return i("icon",
|
|
341
|
+
return i("icon", D([{}, {
|
|
342
342
|
props: {
|
|
343
343
|
type: "ios-trash-outline"
|
|
344
344
|
}
|
|
@@ -351,7 +351,7 @@ function kt(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", D([{}, {
|
|
355
355
|
props: {
|
|
356
356
|
type: t.fileIcon,
|
|
357
357
|
size: 40
|
|
@@ -378,7 +378,7 @@ function kt(t) {
|
|
|
378
378
|
click: () => this.showModel()
|
|
379
379
|
},
|
|
380
380
|
key: this.key("btn")
|
|
381
|
-
}, [e("icon",
|
|
381
|
+
}, [e("icon", D([{}, {
|
|
382
382
|
props: {
|
|
383
383
|
type: this.icon,
|
|
384
384
|
size: 20
|
|
@@ -450,7 +450,7 @@ function kt(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", D([{}, {
|
|
454
454
|
props: {
|
|
455
455
|
mask: this.previewMask,
|
|
456
456
|
title: l,
|
|
@@ -468,8 +468,8 @@ function kt(t) {
|
|
|
468
468
|
attrs: {
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
|
-
})]), e("Modal",
|
|
472
|
-
props:
|
|
471
|
+
})]), e("Modal", D([{}, {
|
|
472
|
+
props: _({
|
|
473
473
|
width: s,
|
|
474
474
|
title: a
|
|
475
475
|
}, this.modal)
|
|
@@ -503,11 +503,11 @@ function kt(t) {
|
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
const
|
|
506
|
+
const kt = Ft({
|
|
507
507
|
fileIcon: "md-document",
|
|
508
508
|
fileUpIcon: "ios-folder-open"
|
|
509
509
|
});
|
|
510
|
-
|
|
510
|
+
kt.v2 = Ft({
|
|
511
511
|
fileIcon: "document-text",
|
|
512
512
|
fileUpIcon: "folder"
|
|
513
513
|
});
|
|
@@ -553,7 +553,7 @@ const Rr = "fcRadio", Er = {
|
|
|
553
553
|
},
|
|
554
554
|
render() {
|
|
555
555
|
const t = arguments[0];
|
|
556
|
-
return t("RadioGroup",
|
|
556
|
+
return t("RadioGroup", D([{}, this.formCreateInject.prop, {}, {
|
|
557
557
|
props: {
|
|
558
558
|
value: this.trueValue
|
|
559
559
|
}
|
|
@@ -563,8 +563,8 @@ const Rr = "fcRadio", Er = {
|
|
|
563
563
|
input: this.onInput
|
|
564
564
|
}
|
|
565
565
|
}]), [this.options().map((e, r) => {
|
|
566
|
-
const i =
|
|
567
|
-
return delete i.value, t("Radio",
|
|
566
|
+
const i = _({}, e);
|
|
567
|
+
return delete i.value, t("Radio", D([{}, {
|
|
568
568
|
props: i
|
|
569
569
|
}, {
|
|
570
570
|
key: "" + r + "-" + e.value
|
|
@@ -604,11 +604,11 @@ const Rr = "fcRadio", Er = {
|
|
|
604
604
|
return h.type(e, t);
|
|
605
605
|
};
|
|
606
606
|
});
|
|
607
|
-
function
|
|
607
|
+
function j(t, e) {
|
|
608
608
|
return {}.hasOwnProperty.call(t, e);
|
|
609
609
|
}
|
|
610
|
-
const
|
|
611
|
-
name:
|
|
610
|
+
const jr = "fcSelect", Dr = {
|
|
611
|
+
name: jr,
|
|
612
612
|
functional: !0,
|
|
613
613
|
props: {
|
|
614
614
|
formCreateInject: {
|
|
@@ -619,7 +619,7 @@ const Dr = "fcSelect", jr = {
|
|
|
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", D([{}, {
|
|
623
623
|
props: n
|
|
624
624
|
}, {
|
|
625
625
|
key: "" + o + "-" + n.value
|
|
@@ -632,9 +632,9 @@ const Dr = "fcSelect", jr = {
|
|
|
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", D([{}, e.data, {
|
|
636
636
|
ref: "el"
|
|
637
|
-
}]), [(Array.isArray(s) ? s : []).map((n, o) =>
|
|
637
|
+
}]), [(Array.isArray(s) ? s : []).map((n, o) => j(n || "", "options") ? i(n, o) : r(n, o)), e.children]);
|
|
638
638
|
},
|
|
639
639
|
mounted() {
|
|
640
640
|
this.$emit("fc.el", this.$refs.el);
|
|
@@ -684,7 +684,7 @@ const Dr = "fcSelect", jr = {
|
|
|
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", D([{}, this.formCreateInject.prop, {
|
|
688
688
|
ref: "tree"
|
|
689
689
|
}, {
|
|
690
690
|
on: e
|
|
@@ -702,7 +702,7 @@ function ut(t) {
|
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
704
|
function ft(t) {
|
|
705
|
-
return U(
|
|
705
|
+
return U(_({}, t), {
|
|
706
706
|
file: t,
|
|
707
707
|
value: t
|
|
708
708
|
});
|
|
@@ -784,7 +784,7 @@ function St(t) {
|
|
|
784
784
|
src: e.url
|
|
785
785
|
},
|
|
786
786
|
key: this.key("img" + r)
|
|
787
|
-
}) : i("icon",
|
|
787
|
+
}) : i("icon", D([{}, {
|
|
788
788
|
props: {
|
|
789
789
|
type: t.fileIcon,
|
|
790
790
|
size: 40
|
|
@@ -819,7 +819,7 @@ function St(t) {
|
|
|
819
819
|
},
|
|
820
820
|
makeProgress(e, r) {
|
|
821
821
|
const i = this.$createElement;
|
|
822
|
-
return i("Progress",
|
|
822
|
+
return i("Progress", D([{}, {
|
|
823
823
|
props: {
|
|
824
824
|
percent: e.percentage,
|
|
825
825
|
hideInfo: !0
|
|
@@ -849,7 +849,7 @@ function St(t) {
|
|
|
849
849
|
},
|
|
850
850
|
makeUpload() {
|
|
851
851
|
const e = this.$createElement, r = !this.maxLength || this.maxLength > this.uploadList.length;
|
|
852
|
-
return e("Upload",
|
|
852
|
+
return e("Upload", D([{}, this.formCreateInject.prop, {}, {
|
|
853
853
|
style: {
|
|
854
854
|
display: "inline-block"
|
|
855
855
|
},
|
|
@@ -859,7 +859,7 @@ function St(t) {
|
|
|
859
859
|
slot: "default"
|
|
860
860
|
}, [this.$slots.default || e("div", {
|
|
861
861
|
class: "fc-upload-btn"
|
|
862
|
-
}, [e("icon",
|
|
862
|
+
}, [e("icon", D([{}, {
|
|
863
863
|
props: {
|
|
864
864
|
type: this.uploadType === "file" ? "ios-cloud-upload-outline" : t.imgUpIcon,
|
|
865
865
|
size: 20
|
|
@@ -878,7 +878,7 @@ function St(t) {
|
|
|
878
878
|
const e = arguments[0];
|
|
879
879
|
return this.$refs.upload && (this.formCreateInject.prop.props.showUploadList === void 0 && (this.formCreateInject.prop.props.showUploadList = this.$refs.upload.showUploadList), this.formCreateInject.prop.props.defaultFileList = this.$refs.upload.defaultFileList), e("div", {
|
|
880
880
|
class: "_fc-upload"
|
|
881
|
-
}, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], e("Modal",
|
|
881
|
+
}, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], e("Modal", D([{}, {
|
|
882
882
|
props: {
|
|
883
883
|
title: this.modalTitle,
|
|
884
884
|
footerHide: !0
|
|
@@ -915,13 +915,13 @@ Rt.v2 = St({
|
|
|
915
915
|
fileIcon: "document-text",
|
|
916
916
|
imgUpIcon: "image"
|
|
917
917
|
});
|
|
918
|
-
function
|
|
918
|
+
function F(t, e, r) {
|
|
919
919
|
ye.set(t, e, r);
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function re(t, e) {
|
|
922
922
|
(ye.del || ye.delete)(t, e);
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function we(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,36 +929,36 @@ function Ce(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 && F(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 && F(t, s, {});
|
|
936
936
|
else {
|
|
937
|
-
|
|
937
|
+
F(t, s, n._clone());
|
|
938
938
|
continue;
|
|
939
939
|
}
|
|
940
940
|
else
|
|
941
|
-
o &&
|
|
942
|
-
t[s] =
|
|
941
|
+
o && F(t, s, {});
|
|
942
|
+
t[s] = we(t[s], n, r);
|
|
943
943
|
} else
|
|
944
|
-
|
|
944
|
+
F(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
948
|
function G(t) {
|
|
949
|
-
return
|
|
949
|
+
return we({}, { value: t }).value;
|
|
950
950
|
}
|
|
951
951
|
const Lr = 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) && F(t, i, e[i]);
|
|
955
955
|
return t;
|
|
956
956
|
};
|
|
957
957
|
function C() {
|
|
958
958
|
return Lr.apply(this, arguments);
|
|
959
959
|
}
|
|
960
960
|
function Je(t) {
|
|
961
|
-
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] :
|
|
961
|
+
return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : _({}, t);
|
|
962
962
|
}
|
|
963
963
|
const Br = "fcGroup", Tr = {
|
|
964
964
|
name: Br,
|
|
@@ -1042,7 +1042,7 @@ const Br = "fcGroup", Tr = {
|
|
|
1042
1042
|
const s = i.$f.formData();
|
|
1043
1043
|
if (t === e)
|
|
1044
1044
|
i.$f.deferSyncValue(() => {
|
|
1045
|
-
|
|
1045
|
+
we(i.rule, t), i.$f.setValue(s);
|
|
1046
1046
|
}, !0);
|
|
1047
1047
|
else {
|
|
1048
1048
|
const n = i.$f.formData();
|
|
@@ -1082,7 +1082,7 @@ const Br = "fcGroup", Tr = {
|
|
|
1082
1082
|
},
|
|
1083
1083
|
methods: {
|
|
1084
1084
|
_value(t) {
|
|
1085
|
-
return t &&
|
|
1085
|
+
return t && j(t, this.field) ? t[this.field] : t;
|
|
1086
1086
|
},
|
|
1087
1087
|
cache(t, e) {
|
|
1088
1088
|
this.cacheValue[t] = JSON.stringify(e);
|
|
@@ -1095,7 +1095,7 @@ const Br = "fcGroup", Tr = {
|
|
|
1095
1095
|
if (i.filter((n) => r[n].$f).length !== i.length)
|
|
1096
1096
|
return;
|
|
1097
1097
|
const s = i.map((n) => {
|
|
1098
|
-
const o = t === n ? e :
|
|
1098
|
+
const o = t === n ? e : _({}, this.cacheRule[n].$f.form), a = this.field ? o[this.field] || null : o;
|
|
1099
1099
|
return this.cache(n, a), a;
|
|
1100
1100
|
});
|
|
1101
1101
|
this.input(s);
|
|
@@ -1107,7 +1107,7 @@ const Br = "fcGroup", Tr = {
|
|
|
1107
1107
|
}), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cache(t, e), i && i.coverValue(e || {}));
|
|
1108
1108
|
},
|
|
1109
1109
|
addRule(t, e) {
|
|
1110
|
-
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ?
|
|
1110
|
+
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? _({}, this.options) : {
|
|
1111
1111
|
submitBtn: !1,
|
|
1112
1112
|
resetBtn: !1
|
|
1113
1113
|
};
|
|
@@ -1235,7 +1235,7 @@ const Br = "fcGroup", Tr = {
|
|
|
1235
1235
|
return t("div", {
|
|
1236
1236
|
class: "_fc-group-container",
|
|
1237
1237
|
key: o
|
|
1238
|
-
}, [t(i,
|
|
1238
|
+
}, [t(i, D([{
|
|
1239
1239
|
key: o
|
|
1240
1240
|
}, {
|
|
1241
1241
|
on: {
|
|
@@ -1312,7 +1312,7 @@ const Br = "fcGroup", Tr = {
|
|
|
1312
1312
|
submitBtn: !1,
|
|
1313
1313
|
resetBtn: !1
|
|
1314
1314
|
};
|
|
1315
|
-
t.formData =
|
|
1315
|
+
t.formData = _({}, this.value || {}), this.cacheRule = {
|
|
1316
1316
|
rule: this.rule,
|
|
1317
1317
|
options: t
|
|
1318
1318
|
};
|
|
@@ -1334,7 +1334,7 @@ const Br = "fcGroup", Tr = {
|
|
|
1334
1334
|
rule: e,
|
|
1335
1335
|
options: r
|
|
1336
1336
|
} = this.cacheRule, i = this.type;
|
|
1337
|
-
return t(i,
|
|
1337
|
+
return t(i, D([{}, {
|
|
1338
1338
|
on: {
|
|
1339
1339
|
"update:value": this.formData,
|
|
1340
1340
|
"emit-event": this.emitEvent,
|
|
@@ -1350,16 +1350,16 @@ const Br = "fcGroup", Tr = {
|
|
|
1350
1350
|
}]));
|
|
1351
1351
|
}
|
|
1352
1352
|
}, Ur = [
|
|
1353
|
-
|
|
1353
|
+
kr,
|
|
1354
1354
|
Er,
|
|
1355
|
-
|
|
1355
|
+
Dr,
|
|
1356
1356
|
Ir,
|
|
1357
1357
|
Mr,
|
|
1358
|
-
|
|
1358
|
+
kt,
|
|
1359
1359
|
Rt,
|
|
1360
1360
|
Tr
|
|
1361
1361
|
];
|
|
1362
|
-
function
|
|
1362
|
+
function ne(t, e) {
|
|
1363
1363
|
var r = null;
|
|
1364
1364
|
return function(...i) {
|
|
1365
1365
|
r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
|
|
@@ -1372,15 +1372,15 @@ function $e(t) {
|
|
|
1372
1372
|
function qr(t) {
|
|
1373
1373
|
return t.replace(t[0], t[0].toLocaleUpperCase());
|
|
1374
1374
|
}
|
|
1375
|
-
const Et = ["attrs", "props", "domProps", "scopedSlots"],
|
|
1376
|
-
const i = [...Et, ...r.normal || []], s = [...
|
|
1375
|
+
const Et = ["attrs", "props", "domProps", "scopedSlots"], jt = ["class", "style", "directives"], Dt = ["on", "nativeOn", "hook"], x = (t, e = {}, r = {}) => {
|
|
1376
|
+
const i = [...Et, ...r.normal || []], s = [...jt, ...r.array || []], n = [...Dt, ...r.functional || []], o = r.props || [];
|
|
1377
1377
|
return t.reduce((a, l) => {
|
|
1378
1378
|
for (const u in l)
|
|
1379
1379
|
if (a[u])
|
|
1380
1380
|
if (o.indexOf(u) > -1)
|
|
1381
1381
|
a[u] = x([l[u]], a[u]);
|
|
1382
1382
|
else if (i.indexOf(u) > -1)
|
|
1383
|
-
a[u] =
|
|
1383
|
+
a[u] = _(_({}, a[u]), l[u]);
|
|
1384
1384
|
else if (s.indexOf(u) > -1) {
|
|
1385
1385
|
const f = a[u] instanceof Array ? a[u] : [a[u]], p = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1386
1386
|
a[u] = [...f, ...p];
|
|
@@ -1397,14 +1397,14 @@ const Et = ["attrs", "props", "domProps", "scopedSlots"], Dt = ["class", "style"
|
|
|
1397
1397
|
else
|
|
1398
1398
|
a[u] = l[u];
|
|
1399
1399
|
else
|
|
1400
|
-
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] =
|
|
1400
|
+
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = _({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? _({}, l[u]) : l[u] : a[u] = l[u];
|
|
1401
1401
|
return a;
|
|
1402
1402
|
}, e);
|
|
1403
1403
|
}, Gr = (t, e) => function() {
|
|
1404
1404
|
t && t.apply(this, arguments), e && e.apply(this, arguments);
|
|
1405
1405
|
}, At = ["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"], Qe = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
|
|
1406
1406
|
function It() {
|
|
1407
|
-
return [...At, ...Et, ...
|
|
1407
|
+
return [...At, ...Et, ...jt, ...Dt, ...Qe, ...Ye];
|
|
1408
1408
|
}
|
|
1409
1409
|
function Vt(t, e, r) {
|
|
1410
1410
|
return `[form-create ${t}]: ${e}`;
|
|
@@ -1419,8 +1419,8 @@ function zr(t) {
|
|
|
1419
1419
|
return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
|
|
1420
1420
|
}
|
|
1421
1421
|
const We = "[[FORM-CREATE-PREFIX-", Ke = "-FORM-CREATE-SUFFIX]]";
|
|
1422
|
-
function
|
|
1423
|
-
return JSON.stringify(
|
|
1422
|
+
function Ce(t, e) {
|
|
1423
|
+
return JSON.stringify(we(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
|
|
1424
1424
|
if (!(i && i._isVue === !0)) {
|
|
1425
1425
|
if (typeof i != "function")
|
|
1426
1426
|
return i;
|
|
@@ -1485,11 +1485,11 @@ function Ve() {
|
|
|
1485
1485
|
const t = 370 + ++Jr;
|
|
1486
1486
|
return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1488
|
+
function se(t, e, r) {
|
|
1489
1489
|
let i = t, s;
|
|
1490
1490
|
return (e || "").split(".").forEach((n) => {
|
|
1491
|
-
s && ((!i[s] || typeof i[s] != "object") &&
|
|
1492
|
-
}),
|
|
1491
|
+
s && ((!i[s] || typeof i[s] != "object") && F(i, s, {}), i = i[s]), s = n;
|
|
1492
|
+
}), F(i, s, r), i;
|
|
1493
1493
|
}
|
|
1494
1494
|
function Xe(t, e) {
|
|
1495
1495
|
return {
|
|
@@ -1503,7 +1503,7 @@ function Lt(t, e) {
|
|
|
1503
1503
|
return Bt([t], e || !1)[0];
|
|
1504
1504
|
}
|
|
1505
1505
|
function Bt(t, e) {
|
|
1506
|
-
return
|
|
1506
|
+
return we([], [...t], e || !1);
|
|
1507
1507
|
}
|
|
1508
1508
|
function Q(t, e) {
|
|
1509
1509
|
return x(Array.isArray(e) ? e : [e], t, { array: Qe, normal: Ye }), t;
|
|
@@ -1552,7 +1552,7 @@ function Kr(t, e) {
|
|
|
1552
1552
|
} else
|
|
1553
1553
|
return Ze(t, e);
|
|
1554
1554
|
}
|
|
1555
|
-
function
|
|
1555
|
+
function Se() {
|
|
1556
1556
|
const t = {}, e = (r) => r || "default";
|
|
1557
1557
|
return {
|
|
1558
1558
|
setSlot(r, i) {
|
|
@@ -1588,12 +1588,12 @@ function Fe() {
|
|
|
1588
1588
|
}
|
|
1589
1589
|
};
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function Re(t, e) {
|
|
1592
1592
|
return Object.setPrototypeOf(t, e), t;
|
|
1593
1593
|
}
|
|
1594
|
-
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e,
|
|
1594
|
+
const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, ce = {
|
|
1595
1595
|
"==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
|
|
1596
|
-
"!=": (t, e) => !
|
|
1596
|
+
"!=": (t, e) => !ce["=="](t, e),
|
|
1597
1597
|
">": (t, e) => t > e,
|
|
1598
1598
|
">=": (t, e) => t >= e,
|
|
1599
1599
|
"<": (t, e) => t < e,
|
|
@@ -1602,13 +1602,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
|
|
|
1602
1602
|
return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
|
|
1603
1603
|
},
|
|
1604
1604
|
notOn(t, e) {
|
|
1605
|
-
return !
|
|
1605
|
+
return !ce.on(t, e);
|
|
1606
1606
|
},
|
|
1607
1607
|
in(t, e) {
|
|
1608
1608
|
return e && e.indexOf && e.indexOf(t) > -1;
|
|
1609
1609
|
},
|
|
1610
1610
|
notIn(t, e) {
|
|
1611
|
-
return !
|
|
1611
|
+
return !ce.in(t, e);
|
|
1612
1612
|
},
|
|
1613
1613
|
between(t, e) {
|
|
1614
1614
|
return t > e[0] && t < e[1];
|
|
@@ -1726,77 +1726,77 @@ function Zr(t, e, r) {
|
|
|
1726
1726
|
a = a.parent;
|
|
1727
1727
|
else
|
|
1728
1728
|
a = n;
|
|
1729
|
-
const { rule: l, value: u, subForm: f, inFor: p } = lt(s), d =
|
|
1729
|
+
const { rule: l, value: u, subForm: f, inFor: p } = lt(s), d = ie({
|
|
1730
1730
|
ctxInject: {},
|
|
1731
1731
|
destroyed: !1,
|
|
1732
1732
|
isShow: !0,
|
|
1733
1733
|
unique: 1,
|
|
1734
1734
|
renderRule: [...l.value || []],
|
|
1735
1735
|
updateValue: JSON.stringify(u.value || {})
|
|
1736
|
-
}),
|
|
1736
|
+
}), g = new t(n), y = g.api(), v = p.value, E = () => {
|
|
1737
1737
|
if (o) {
|
|
1738
|
-
const
|
|
1739
|
-
if (
|
|
1738
|
+
const k = Ee(n, o);
|
|
1739
|
+
if (k) {
|
|
1740
1740
|
let S;
|
|
1741
|
-
|
|
1741
|
+
v ? (S = H(k.getSubForm()), S.push(y)) : S = y, k.subForm(S);
|
|
1742
1742
|
}
|
|
1743
1743
|
}
|
|
1744
1744
|
}, Y = () => {
|
|
1745
|
-
const
|
|
1746
|
-
if (
|
|
1747
|
-
if (
|
|
1748
|
-
const S = H(
|
|
1745
|
+
const k = Ee(n, o);
|
|
1746
|
+
if (k)
|
|
1747
|
+
if (v) {
|
|
1748
|
+
const S = H(k.getSubForm()), N = S.indexOf(y);
|
|
1749
1749
|
N > -1 && S.splice(N, 1);
|
|
1750
1750
|
} else
|
|
1751
|
-
|
|
1751
|
+
k.subForm();
|
|
1752
1752
|
};
|
|
1753
1753
|
let I = null;
|
|
1754
1754
|
dr(() => {
|
|
1755
1755
|
B(() => {
|
|
1756
|
-
let
|
|
1756
|
+
let k = "";
|
|
1757
1757
|
const S = s.option && s.option.globalClass || {};
|
|
1758
1758
|
Object.keys(S).forEach((N) => {
|
|
1759
|
-
let
|
|
1759
|
+
let pe = "";
|
|
1760
1760
|
S[N].style && Object.keys(S[N].style).forEach((z) => {
|
|
1761
|
-
|
|
1762
|
-
}), S[N].content && (
|
|
1763
|
-
}), s.option && s.option.style && (
|
|
1761
|
+
pe += $e(z) + ":" + S[N].style[z] + ";";
|
|
1762
|
+
}), S[N].content && (pe += S[N].content + ";"), pe && (k += `.${N}{${pe}}`);
|
|
1763
|
+
}), s.option && s.option.style && (k += s.option.style), I || (I = document.createElement("style"), I.type = "text/css", document.head.appendChild(I)), I.innerHTML = k || "";
|
|
1764
1764
|
}, () => {
|
|
1765
1765
|
});
|
|
1766
1766
|
});
|
|
1767
|
-
const T =
|
|
1768
|
-
|
|
1769
|
-
}, 100),
|
|
1770
|
-
|
|
1771
|
-
}, 100), Pe =
|
|
1772
|
-
|
|
1773
|
-
}, 100),
|
|
1774
|
-
|
|
1767
|
+
const T = ne(() => {
|
|
1768
|
+
g.bus.$emit("$loadData.$topForm");
|
|
1769
|
+
}, 100), he = ne(function() {
|
|
1770
|
+
g.bus.$emit("$loadData.$scopeForm");
|
|
1771
|
+
}, 100), Pe = ne(() => {
|
|
1772
|
+
g.bus.$emit("$loadData.$form");
|
|
1773
|
+
}, 100), de = (k) => {
|
|
1774
|
+
g.bus.$emit("change-$form." + k);
|
|
1775
1775
|
};
|
|
1776
1776
|
return pr(() => {
|
|
1777
|
-
o && (y.top.bus.$on("$loadData.$form", T), y.top.bus.$on("change",
|
|
1777
|
+
o && (y.top.bus.$on("$loadData.$form", T), y.top.bus.$on("change", de)), y !== y.scope && y.scope.bus.$on("$loadData.$scopeForm", he), g.mounted();
|
|
1778
1778
|
}), mr(() => {
|
|
1779
|
-
o && (y.top.bus.$off("$loadData.$form", T), y.top.bus.$off("change",
|
|
1779
|
+
o && (y.top.bus.$off("$loadData.$form", T), y.top.bus.$off("change", de)), y !== y.scope && y.scope.bus.$off("$loadData.$scopeForm", he), Y(), d.destroyed = !0, g.unmount(), I && (I.parentNode || I.parentElement) && document.head.removeChild(I);
|
|
1780
1780
|
}), gr(() => {
|
|
1781
|
-
|
|
1782
|
-
}), B(f, (
|
|
1783
|
-
|
|
1781
|
+
g.updated();
|
|
1782
|
+
}), B(f, (k) => {
|
|
1783
|
+
k ? E() : Y();
|
|
1784
1784
|
}, { immediate: !0 }), B(() => s.option, () => {
|
|
1785
|
-
|
|
1786
|
-
}, { deep: !0, flush: "sync" }), B(() => [...l.value], (
|
|
1787
|
-
|
|
1785
|
+
g.initOptions(), y.refresh();
|
|
1786
|
+
}, { deep: !0, flush: "sync" }), B(() => [...l.value], (k) => {
|
|
1787
|
+
g.$handle.isBreakWatch() || k.length === d.renderRule.length && k.every((S) => d.renderRule.indexOf(S) > -1) || (g.$handle.updateAppendData(), g.$handle.reloadRule(l.value), n.renderRule());
|
|
1788
1788
|
}), B(() => [s.disabled, s.preview], () => {
|
|
1789
1789
|
y.refresh();
|
|
1790
|
-
}), B(u, (
|
|
1791
|
-
|
|
1790
|
+
}), B(u, (k) => {
|
|
1791
|
+
Ce(k || {}) !== d.updateValue && (y.config.forceCoverValue ? y.coverValue(k || {}) : y.setValue(k || {}));
|
|
1792
1792
|
}, { deep: !0, flush: "post" }), B(() => s.index, () => {
|
|
1793
|
-
y.coverValue({}),
|
|
1793
|
+
y.coverValue({}), g.$handle.updateAppendData(), V(() => {
|
|
1794
1794
|
V(() => {
|
|
1795
1795
|
y.clearValidateState();
|
|
1796
1796
|
});
|
|
1797
1797
|
});
|
|
1798
|
-
}, { flush: "sync" }), U(
|
|
1799
|
-
fc: me(
|
|
1798
|
+
}, { flush: "sync" }), U(_({
|
|
1799
|
+
fc: me(g),
|
|
1800
1800
|
parent: o && me(o),
|
|
1801
1801
|
top: me(a),
|
|
1802
1802
|
fapi: me(y)
|
|
@@ -1808,11 +1808,11 @@ function Zr(t, e, r) {
|
|
|
1808
1808
|
renderRule() {
|
|
1809
1809
|
d.renderRule = [...l.value || []];
|
|
1810
1810
|
},
|
|
1811
|
-
updateValue(
|
|
1811
|
+
updateValue(k) {
|
|
1812
1812
|
if (d.destroyed) return;
|
|
1813
|
-
const S =
|
|
1814
|
-
d.updateValue !== S && (d.updateValue = S, n.$emit("update:value",
|
|
1815
|
-
Pe(), o ? f.value ||
|
|
1813
|
+
const S = Ce(k);
|
|
1814
|
+
d.updateValue !== S && (d.updateValue = S, n.$emit("update:value", k), V(() => {
|
|
1815
|
+
Pe(), o ? f.value || he() : (T(), he());
|
|
1816
1816
|
}));
|
|
1817
1817
|
}
|
|
1818
1818
|
});
|
|
@@ -1848,7 +1848,7 @@ C(tt.prototype, {
|
|
|
1848
1848
|
return this._data;
|
|
1849
1849
|
},
|
|
1850
1850
|
setProp(t, e) {
|
|
1851
|
-
return
|
|
1851
|
+
return F(this._data, t, e), this;
|
|
1852
1852
|
},
|
|
1853
1853
|
_clone() {
|
|
1854
1854
|
const t = new this.constructor();
|
|
@@ -1923,11 +1923,11 @@ function Gt(t) {
|
|
|
1923
1923
|
}
|
|
1924
1924
|
function gt(t, e, r) {
|
|
1925
1925
|
return new Promise((i, s) => {
|
|
1926
|
-
(e || Gt)(U(
|
|
1926
|
+
(e || Gt)(U(_({}, t), {
|
|
1927
1927
|
onSuccess(n) {
|
|
1928
1928
|
let o = (l) => l;
|
|
1929
1929
|
const a = W(t.parse);
|
|
1930
|
-
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n,
|
|
1930
|
+
h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n, t.targetRule, r));
|
|
1931
1931
|
},
|
|
1932
1932
|
onError(n) {
|
|
1933
1933
|
s(n);
|
|
@@ -1943,10 +1943,10 @@ function ei(t) {
|
|
|
1943
1943
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1944
1944
|
}
|
|
1945
1945
|
function r(n, o, a) {
|
|
1946
|
-
h.Undef(n) ? n = Object.keys(
|
|
1946
|
+
h.Undef(n) ? n = Object.keys(_(_({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
|
|
1947
1947
|
const u = t.fieldCtx[l] || t.nameCtx[l];
|
|
1948
1948
|
u && u.forEach((f) => {
|
|
1949
|
-
|
|
1949
|
+
F(f.rule, o, a), t.$render.clearCache(f);
|
|
1950
1950
|
});
|
|
1951
1951
|
});
|
|
1952
1952
|
}
|
|
@@ -2016,7 +2016,7 @@ function ei(t) {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
},
|
|
2018
2018
|
get formulas() {
|
|
2019
|
-
return
|
|
2019
|
+
return _({}, t.fc.formulas);
|
|
2020
2020
|
},
|
|
2021
2021
|
formData(n) {
|
|
2022
2022
|
if (n == null || typeof n == "boolean") {
|
|
@@ -2029,17 +2029,17 @@ function ei(t) {
|
|
|
2029
2029
|
},
|
|
2030
2030
|
getValue(n) {
|
|
2031
2031
|
const o = t.getFieldCtx(n);
|
|
2032
|
-
return o ? ve(o.rule.value) : t.options.appendValue !== !1 &&
|
|
2032
|
+
return o ? ve(o.rule.value) : t.options.appendValue !== !1 && j(t.appendData, n) ? ve(t.appendData[n]) : void 0;
|
|
2033
2033
|
},
|
|
2034
2034
|
coverValue(n) {
|
|
2035
|
-
const o =
|
|
2035
|
+
const o = _({}, n || {});
|
|
2036
2036
|
t.deferSyncValue(() => {
|
|
2037
2037
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
2038
2038
|
const l = t.fieldCtx[a];
|
|
2039
2039
|
if (l) {
|
|
2040
|
-
const u =
|
|
2040
|
+
const u = j(n, a);
|
|
2041
2041
|
l.forEach((f) => {
|
|
2042
|
-
|
|
2042
|
+
F(f.rule, "value", u ? n[a] : void 0);
|
|
2043
2043
|
}), delete o[a];
|
|
2044
2044
|
}
|
|
2045
2045
|
}), C(t.appendData, o);
|
|
@@ -2052,7 +2052,7 @@ function ei(t) {
|
|
|
2052
2052
|
const l = t.fieldCtx[a];
|
|
2053
2053
|
if (!l) return t.appendData[a] = o[a];
|
|
2054
2054
|
l.forEach((u) => {
|
|
2055
|
-
|
|
2055
|
+
F(u.rule, "value", o[a]);
|
|
2056
2056
|
});
|
|
2057
2057
|
});
|
|
2058
2058
|
}, !0);
|
|
@@ -2116,7 +2116,7 @@ function ei(t) {
|
|
|
2116
2116
|
disabled(n, o) {
|
|
2117
2117
|
e(o).forEach((a) => {
|
|
2118
2118
|
t.getCtxs(a).forEach((l) => {
|
|
2119
|
-
|
|
2119
|
+
F(l.rule.props, "disabled", !!n);
|
|
2120
2120
|
});
|
|
2121
2121
|
}), t.refresh();
|
|
2122
2122
|
},
|
|
@@ -2174,7 +2174,7 @@ function ei(t) {
|
|
|
2174
2174
|
t.$manager.updateOptions(t.options), s.refresh();
|
|
2175
2175
|
},
|
|
2176
2176
|
hideForm: (n) => {
|
|
2177
|
-
|
|
2177
|
+
F(t.vm, "isShow", !n);
|
|
2178
2178
|
},
|
|
2179
2179
|
changeStatus: () => t.changeStatus,
|
|
2180
2180
|
clearChangeStatus: () => {
|
|
@@ -2233,7 +2233,7 @@ function ei(t) {
|
|
|
2233
2233
|
},
|
|
2234
2234
|
setEffect(n, o, a) {
|
|
2235
2235
|
const l = t.getCtx(n);
|
|
2236
|
-
l && o && (o[0] === "$" && (o = o.substr(1)),
|
|
2236
|
+
l && o && (o[0] === "$" && (o = o.substr(1)), j(l.rule, "$" + o) && F(l.rule, "$" + o, a), j(l.rule, "effect") || F(l.rule, "effect", {}), F(l.rule.effect, o, a));
|
|
2237
2237
|
},
|
|
2238
2238
|
clearEffectData(n, o) {
|
|
2239
2239
|
const a = t.getCtx(n);
|
|
@@ -2273,7 +2273,7 @@ function ei(t) {
|
|
|
2273
2273
|
return O(() => s.method(n, o)(...a));
|
|
2274
2274
|
},
|
|
2275
2275
|
toJson(n) {
|
|
2276
|
-
return
|
|
2276
|
+
return Ce(s.rule, n);
|
|
2277
2277
|
},
|
|
2278
2278
|
trigger(n, o, ...a) {
|
|
2279
2279
|
const l = s.el(n);
|
|
@@ -2320,7 +2320,7 @@ function ei(t) {
|
|
|
2320
2320
|
const l = s.getChildrenRuleList(n);
|
|
2321
2321
|
t.deferSyncValue(() => {
|
|
2322
2322
|
l.forEach((u) => {
|
|
2323
|
-
|
|
2323
|
+
j(o, u.field) ? F(u, "value", o[u.field]) : a && F(u, "value", void 0);
|
|
2324
2324
|
});
|
|
2325
2325
|
});
|
|
2326
2326
|
},
|
|
@@ -2364,6 +2364,10 @@ function ei(t) {
|
|
|
2364
2364
|
t.deferSyncValue(n, o);
|
|
2365
2365
|
},
|
|
2366
2366
|
bus: t.bus,
|
|
2367
|
+
getCurrentFormRule() {
|
|
2368
|
+
var n;
|
|
2369
|
+
return (n = t.vm.getGroupInject()) == null ? void 0 : n.rule;
|
|
2370
|
+
},
|
|
2367
2371
|
fetch(n) {
|
|
2368
2372
|
return new Promise((o, a) => {
|
|
2369
2373
|
n = G(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
|
|
@@ -2470,7 +2474,7 @@ function ri(t) {
|
|
|
2470
2474
|
if (!this.vm.isShow)
|
|
2471
2475
|
return;
|
|
2472
2476
|
this.$manager.beforeRender();
|
|
2473
|
-
const e =
|
|
2477
|
+
const e = Se();
|
|
2474
2478
|
return this.sort.forEach((r) => {
|
|
2475
2479
|
this.renderSlot(e, this.$handle.ctxs[r]);
|
|
2476
2480
|
}), this.$manager.render(e);
|
|
@@ -2488,12 +2492,12 @@ function ri(t) {
|
|
|
2488
2492
|
},
|
|
2489
2493
|
setOptions(e) {
|
|
2490
2494
|
const r = e.loadPending({ key: "options", origin: e.prop.options, def: [] });
|
|
2491
|
-
e.prop.options = r, e.prop.optionsTo && r &&
|
|
2495
|
+
e.prop.options = r, e.prop.optionsTo && r && se(e.prop, e.prop.optionsTo, r);
|
|
2492
2496
|
},
|
|
2493
2497
|
deepSet(e) {
|
|
2494
2498
|
const r = e.rule.deep;
|
|
2495
2499
|
r && Object.keys(r).sort((i, s) => i.length < s.length ? -1 : 1).forEach((i) => {
|
|
2496
|
-
|
|
2500
|
+
se(e.prop, i, r[i]);
|
|
2497
2501
|
});
|
|
2498
2502
|
},
|
|
2499
2503
|
parseSide(e, r) {
|
|
@@ -2541,13 +2545,13 @@ function ri(t) {
|
|
|
2541
2545
|
}, (() => {
|
|
2542
2546
|
if (h.Function(n.renderSlots[y]))
|
|
2543
2547
|
return O(() => n.renderSlots[y]());
|
|
2544
|
-
const
|
|
2545
|
-
return this.renderRule(
|
|
2548
|
+
const v = this.parseSide(n.renderSlots[y], e);
|
|
2549
|
+
return this.renderRule(v);
|
|
2546
2550
|
})()));
|
|
2547
2551
|
});
|
|
2548
2552
|
const d = this.getTypeSlot(e);
|
|
2549
|
-
let
|
|
2550
|
-
return d ? (u.children = f,
|
|
2553
|
+
let g;
|
|
2554
|
+
return d ? (u.children = f, g = d(u)) : g = a ? e.parser.preview(Je(f), e) : e.parser.render(Je(f), e), g = this.renderSides(g, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), g = this.$manager.makeWrap(e, g)), e.none && (Array.isArray(g) ? g = g.map((y) => !y || !y.tag ? y : this.none(y)) : g = this.none(g)), o && this.setCache(e, () => this.stable(g), r), g;
|
|
2551
2555
|
}, this.setCache(e, s, r);
|
|
2552
2556
|
}
|
|
2553
2557
|
return (...s) => {
|
|
@@ -2589,11 +2593,11 @@ function ri(t) {
|
|
|
2589
2593
|
},
|
|
2590
2594
|
injectProp(e) {
|
|
2591
2595
|
const r = this.vm;
|
|
2592
|
-
r.ctxInject[e.id] || (r.ctxInject
|
|
2596
|
+
r.ctxInject[e.id] || F(r.ctxInject, e.id, {
|
|
2593
2597
|
api: this.$handle.api,
|
|
2594
2598
|
form: this.fc.create,
|
|
2595
|
-
subForm: (
|
|
2596
|
-
this.$handle.addSubForm(e,
|
|
2599
|
+
subForm: (n) => {
|
|
2600
|
+
this.$handle.addSubForm(e, n);
|
|
2597
2601
|
},
|
|
2598
2602
|
getSubForm: () => this.$handle.subForm[e.id],
|
|
2599
2603
|
slots: () => this.vm.top.$scopedSlots,
|
|
@@ -2605,26 +2609,28 @@ function ri(t) {
|
|
|
2605
2609
|
field: e.field,
|
|
2606
2610
|
rule: e.rule,
|
|
2607
2611
|
input: e.input,
|
|
2608
|
-
t: (...
|
|
2609
|
-
updateValue: (
|
|
2610
|
-
this.$handle.onUpdateValue(e,
|
|
2612
|
+
t: (...n) => this.$handle.api.t(...n),
|
|
2613
|
+
updateValue: (n) => {
|
|
2614
|
+
this.$handle.onUpdateValue(e, n);
|
|
2611
2615
|
}
|
|
2612
2616
|
});
|
|
2613
|
-
const i = r.ctxInject[e.id]
|
|
2614
|
-
return C(i, {
|
|
2617
|
+
const i = r.ctxInject[e.id], s = {
|
|
2615
2618
|
preview: e.prop.preview,
|
|
2616
2619
|
options: e.prop.options,
|
|
2617
2620
|
prop: function() {
|
|
2618
|
-
const
|
|
2619
|
-
return
|
|
2621
|
+
const n = _({}, e.prop);
|
|
2622
|
+
return n.on = n.on ? _({}, n.on) : {}, delete n.model, n;
|
|
2620
2623
|
}(),
|
|
2621
2624
|
children: e.loadChildrenPending()
|
|
2625
|
+
};
|
|
2626
|
+
return Object.keys(s).forEach((n) => {
|
|
2627
|
+
F(i, n, s[n]);
|
|
2622
2628
|
}), i;
|
|
2623
2629
|
},
|
|
2624
2630
|
ctxProp(e) {
|
|
2625
2631
|
const { ref: r, key: i, rule: s } = e;
|
|
2626
2632
|
this.$manager.mergeProp(e), e.parser.mergeProp(e);
|
|
2627
|
-
const n =
|
|
2633
|
+
const n = _({}, e.prop.on || {}), o = {};
|
|
2628
2634
|
Object.keys(n).forEach((l) => {
|
|
2629
2635
|
if (l.indexOf("native.") === 0)
|
|
2630
2636
|
o[l.replace("native.", "")] = n[l], delete n[l];
|
|
@@ -2685,7 +2691,7 @@ function ri(t) {
|
|
|
2685
2691
|
},
|
|
2686
2692
|
renderChildren(e, r, i) {
|
|
2687
2693
|
if (!h.trueArray(e)) return [];
|
|
2688
|
-
const s =
|
|
2694
|
+
const s = Se();
|
|
2689
2695
|
return e.map((n) => {
|
|
2690
2696
|
if (n) {
|
|
2691
2697
|
if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
|
|
@@ -2711,7 +2717,7 @@ function ri(t) {
|
|
|
2711
2717
|
},
|
|
2712
2718
|
createRuleVnode(e, r, i) {
|
|
2713
2719
|
this.force = i !== !1, this.tmpInput = r;
|
|
2714
|
-
const s =
|
|
2720
|
+
const s = Se();
|
|
2715
2721
|
return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
|
|
2716
2722
|
},
|
|
2717
2723
|
renderRule(e, r, i) {
|
|
@@ -2726,11 +2732,11 @@ function ri(t) {
|
|
|
2726
2732
|
a && (s = q(a));
|
|
2727
2733
|
}
|
|
2728
2734
|
if (!s) return;
|
|
2729
|
-
const n =
|
|
2735
|
+
const n = Se();
|
|
2730
2736
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2731
2737
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2732
2738
|
});
|
|
2733
|
-
const o =
|
|
2739
|
+
const o = _({}, e);
|
|
2734
2740
|
return delete o.type, delete o.is, this.vNode.make(s, o, n.mergeBag(r).getSlots());
|
|
2735
2741
|
}
|
|
2736
2742
|
});
|
|
@@ -2742,7 +2748,7 @@ function rt(t) {
|
|
|
2742
2748
|
fc: t.fc,
|
|
2743
2749
|
vm: t.vm,
|
|
2744
2750
|
$manager: t.$manager,
|
|
2745
|
-
vNode: new t.fc.CreateNode(t
|
|
2751
|
+
vNode: new t.fc.CreateNode(t),
|
|
2746
2752
|
force: !1,
|
|
2747
2753
|
tmpInput: null,
|
|
2748
2754
|
id: ii++
|
|
@@ -2787,14 +2793,14 @@ function ni(t) {
|
|
|
2787
2793
|
let p, d = n || o || a;
|
|
2788
2794
|
if (h.Object(f) && (p = f.inject, f = f.name, d = f.prefix || d), d) {
|
|
2789
2795
|
r || (d = `native-${d}`);
|
|
2790
|
-
const
|
|
2791
|
-
this.vm.$emit(
|
|
2796
|
+
const g = $e(`${d}-${f}`), y = (...v) => {
|
|
2797
|
+
this.vm.$emit(g, ...v), this.vm.$emit("emit-event", g, ...v), this.bus.$emit(g, ...v);
|
|
2792
2798
|
};
|
|
2793
2799
|
if (y.__emit = !0, !p && l === !1)
|
|
2794
2800
|
i[f] = y;
|
|
2795
2801
|
else {
|
|
2796
|
-
let
|
|
2797
|
-
i[f] = h.Undef(
|
|
2802
|
+
let v = p || l || this.options.injectEvent;
|
|
2803
|
+
i[f] = h.Undef(v) ? y : this.inject(s, y, v);
|
|
2798
2804
|
}
|
|
2799
2805
|
}
|
|
2800
2806
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2828,7 +2834,7 @@ function ni(t) {
|
|
|
2828
2834
|
let f = !1, p;
|
|
2829
2835
|
if (i && u.indexOf("$form.") === 0) {
|
|
2830
2836
|
const d = u.split(".");
|
|
2831
|
-
d.shift(),
|
|
2837
|
+
d.shift(), j(i.value, d[0]) && (f = !0, p = r ? r({
|
|
2832
2838
|
id: "$form." + d[0] + "_" + i.rule.__fc__.id,
|
|
2833
2839
|
getValue: () => L(i.value, d)
|
|
2834
2840
|
}) : L(i.value, d));
|
|
@@ -2840,16 +2846,16 @@ function ni(t) {
|
|
|
2840
2846
|
d.key ? f.push(d.key) : d.children && f.push(a(d.children));
|
|
2841
2847
|
});
|
|
2842
2848
|
let p = !1;
|
|
2843
|
-
return f.forEach((d,
|
|
2844
|
-
d != null && (d.indexOf("'") === 0 || d.indexOf('"') === 0) && (f[
|
|
2849
|
+
return f.forEach((d, g) => {
|
|
2850
|
+
d != null && (d.indexOf("'") === 0 || d.indexOf('"') === 0) && (f[g] = d.slice(1, -1), p = !0);
|
|
2845
2851
|
}), f.length === 1 && (p || !isNaN(Number(f[0]))) ? f[0] : o(f.join("."));
|
|
2846
2852
|
};
|
|
2847
2853
|
let l;
|
|
2848
2854
|
if (n.forEach((u) => {
|
|
2849
2855
|
const f = u.split("||"), p = f[0].trim();
|
|
2850
2856
|
if (p) {
|
|
2851
|
-
const d = (f[1] || "").trim(),
|
|
2852
|
-
let y = O(() => a(
|
|
2857
|
+
const d = (f[1] || "").trim(), g = Nt(p);
|
|
2858
|
+
let y = O(() => a(g));
|
|
2853
2859
|
(y == null || y === "") && f.length > 1 && (y = d), l = y, e = e.replaceAll(`{{${u}}}`, y == null ? "" : y);
|
|
2854
2860
|
}
|
|
2855
2861
|
}), n.length === 1 && s === `{{${n[0]}}}`)
|
|
@@ -2937,7 +2943,7 @@ function zt(t, e, r) {
|
|
|
2937
2943
|
parent: null,
|
|
2938
2944
|
group: e.subRule ? this : null,
|
|
2939
2945
|
cacheConfig: null,
|
|
2940
|
-
prop:
|
|
2946
|
+
prop: _({}, e),
|
|
2941
2947
|
computed: {},
|
|
2942
2948
|
payload: {},
|
|
2943
2949
|
refRule: {},
|
|
@@ -3008,7 +3014,7 @@ C(zt.prototype, {
|
|
|
3008
3014
|
setPending(t, e, r) {
|
|
3009
3015
|
this.pending[t] = {
|
|
3010
3016
|
origin: e,
|
|
3011
|
-
value:
|
|
3017
|
+
value: ie(r)
|
|
3012
3018
|
};
|
|
3013
3019
|
},
|
|
3014
3020
|
effectData(t) {
|
|
@@ -3028,7 +3034,7 @@ C(zt.prototype, {
|
|
|
3028
3034
|
},
|
|
3029
3035
|
initProp() {
|
|
3030
3036
|
var e, r;
|
|
3031
|
-
const t =
|
|
3037
|
+
const t = _({}, this.rule);
|
|
3032
3038
|
delete t.children, delete t.validate, this.prop = Q({}, [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 || []];
|
|
3033
3039
|
},
|
|
3034
3040
|
initNone() {
|
|
@@ -3160,23 +3166,23 @@ function ui(t) {
|
|
|
3160
3166
|
let l = ct(o);
|
|
3161
3167
|
const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
|
|
3162
3168
|
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);
|
|
3163
|
-
let f, p = !1, d = !!o.__fc__,
|
|
3169
|
+
let f, p = !1, d = !!o.__fc__, g = l.value;
|
|
3164
3170
|
if (d) {
|
|
3165
|
-
if (f = o.__fc__,
|
|
3171
|
+
if (f = o.__fc__, g = f.defaultValue, f.deleted) {
|
|
3166
3172
|
if ($t(f))
|
|
3167
3173
|
return;
|
|
3168
3174
|
f.update(this);
|
|
3169
3175
|
} else if (!f.check(this)) {
|
|
3170
3176
|
if ($t(f))
|
|
3171
3177
|
return;
|
|
3172
|
-
e[a] = o = o._clone ? o._clone() : Pt(
|
|
3178
|
+
e[a] = o = o._clone ? o._clone() : Pt(Ce(o)), f = null, p = !0;
|
|
3173
3179
|
}
|
|
3174
3180
|
}
|
|
3175
3181
|
if (f)
|
|
3176
3182
|
f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
|
|
3177
3183
|
else {
|
|
3178
3184
|
const E = this.parseRule(o);
|
|
3179
|
-
f = new zt(this, E,
|
|
3185
|
+
f = new zt(this, E, g), this.bindParser(f);
|
|
3180
3186
|
}
|
|
3181
3187
|
[!1, !0].forEach((E) => this.parseEmit(f, E)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !p && !d && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
|
|
3182
3188
|
const y = f.loadChildrenPending();
|
|
@@ -3184,9 +3190,9 @@ function ui(t) {
|
|
|
3184
3190
|
const E = i(a);
|
|
3185
3191
|
E > -1 || !a ? this.sort.splice(E + 1, 0, f.id) : this.sort.push(f.id);
|
|
3186
3192
|
}
|
|
3187
|
-
const
|
|
3188
|
-
return f.updated || (f.updated = !0, h.Function(
|
|
3189
|
-
this.refreshUpdate(f,
|
|
3193
|
+
const v = f.rule;
|
|
3194
|
+
return f.updated || (f.updated = !0, h.Function(v.update) && this.bus.$once("load-end", () => {
|
|
3195
|
+
this.refreshUpdate(f, v.value, "init");
|
|
3190
3196
|
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3191
3197
|
}).filter((o) => !!o);
|
|
3192
3198
|
r && (r.children = n);
|
|
@@ -3199,10 +3205,10 @@ function ui(t) {
|
|
|
3199
3205
|
if (!r.length) return !1;
|
|
3200
3206
|
for (let a = 0; a < r.length; a++) {
|
|
3201
3207
|
const l = r[a], u = l.handle || function(p) {
|
|
3202
|
-
return (
|
|
3208
|
+
return (ce[l.condition || "=="] || ce["=="])(p, l.value);
|
|
3203
3209
|
};
|
|
3204
3210
|
if (!h.trueArray(l.rule)) continue;
|
|
3205
|
-
const f = U(
|
|
3211
|
+
const f = U(_({}, l), {
|
|
3206
3212
|
valid: O(() => u(e.rule.value, s)),
|
|
3207
3213
|
ctrl: hi(e, l.rule),
|
|
3208
3214
|
isHidden: h.String(l.rule[0])
|
|
@@ -3213,34 +3219,34 @@ function ui(t) {
|
|
|
3213
3219
|
const n = [];
|
|
3214
3220
|
let o = !1;
|
|
3215
3221
|
return this.deferSyncValue(() => {
|
|
3216
|
-
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl:
|
|
3222
|
+
i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: p, child: d, ctrl: g, method: y }) => {
|
|
3217
3223
|
if (a) {
|
|
3218
3224
|
l ? e.ctrlRule.push({
|
|
3219
3225
|
__ctrl: !0,
|
|
3220
3226
|
children: u,
|
|
3221
3227
|
valid: l
|
|
3222
|
-
}) :
|
|
3223
|
-
y === "disabled" || y === "enabled" ? this.api.disabled(!l, u) : y === "display" || y === "show" ? this.api.display(l, u) : y === "required" ? (u.forEach((
|
|
3224
|
-
this.api.setEffect(
|
|
3228
|
+
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3229
|
+
y === "disabled" || y === "enabled" ? this.api.disabled(!l, u) : y === "display" || y === "show" ? this.api.display(l, u) : y === "required" ? (u.forEach((v) => {
|
|
3230
|
+
this.api.setEffect(v, "required", l);
|
|
3225
3231
|
}), l || this.api.clearValidateState(u)) : y === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
3226
3232
|
});
|
|
3227
3233
|
return;
|
|
3228
3234
|
}
|
|
3229
3235
|
if (l) {
|
|
3230
3236
|
o = !0;
|
|
3231
|
-
const
|
|
3237
|
+
const v = {
|
|
3232
3238
|
type: "fragment",
|
|
3233
3239
|
native: !0,
|
|
3234
3240
|
__ctrl: !0,
|
|
3235
3241
|
children: u
|
|
3236
3242
|
};
|
|
3237
|
-
e.ctrlRule.push(
|
|
3238
|
-
f ? s.prepend(
|
|
3243
|
+
e.ctrlRule.push(v), this.bus.$once("load-start", () => {
|
|
3244
|
+
f ? s.prepend(v, f, d) : p || d ? s.append(v, p || e.id, d) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, v);
|
|
3239
3245
|
});
|
|
3240
3246
|
} else {
|
|
3241
|
-
e.ctrlRule.splice(e.ctrlRule.indexOf(
|
|
3242
|
-
const
|
|
3243
|
-
|
|
3247
|
+
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3248
|
+
const v = Z(g);
|
|
3249
|
+
v && v.rm();
|
|
3244
3250
|
}
|
|
3245
3251
|
});
|
|
3246
3252
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
@@ -3254,7 +3260,7 @@ function ui(t) {
|
|
|
3254
3260
|
},
|
|
3255
3261
|
_reloadRule(e) {
|
|
3256
3262
|
e || (e = this.rules);
|
|
3257
|
-
const r =
|
|
3263
|
+
const r = _({}, this.ctxs);
|
|
3258
3264
|
this.clearNextTick(), this.initData(e), this.fc.rules = e, this.deferSyncValue(() => {
|
|
3259
3265
|
this.bus.$once("load-end", () => {
|
|
3260
3266
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
@@ -3270,7 +3276,7 @@ function ui(t) {
|
|
|
3270
3276
|
function fi(t) {
|
|
3271
3277
|
const e = Mt();
|
|
3272
3278
|
return Object.keys(e).forEach((r) => {
|
|
3273
|
-
|
|
3279
|
+
j(t, r) || F(t, r, e[r]);
|
|
3274
3280
|
}), t;
|
|
3275
3281
|
}
|
|
3276
3282
|
function ci(t) {
|
|
@@ -3310,7 +3316,7 @@ function di(t) {
|
|
|
3310
3316
|
this.deferSyncValue(() => {
|
|
3311
3317
|
const i = e.getParentGroup(), s = i ? this.subRuleData[i.id] : null, n = {};
|
|
3312
3318
|
Object.keys(r || {}).forEach((o) => {
|
|
3313
|
-
s &&
|
|
3319
|
+
s && j(s, o) ? n[o] = r[o] : j(this.api.form, o) ? this.api.form[o] = r[o] : this.api.top !== this.api && j(this.api.top.form, o) && (this.api.top.form[o] = r[o]);
|
|
3314
3320
|
}), Object.keys(n).length && this.api.setChildrenFormData(i.rule, n);
|
|
3315
3321
|
});
|
|
3316
3322
|
},
|
|
@@ -3320,27 +3326,27 @@ function di(t) {
|
|
|
3320
3326
|
setFormData(e, r) {
|
|
3321
3327
|
e.modelValue = r;
|
|
3322
3328
|
const i = e.getParentGroup();
|
|
3323
|
-
i && (this.subRuleData[i.id] ||
|
|
3329
|
+
i && (this.subRuleData[i.id] || F(this.subRuleData, i.id, {}), F(this.subRuleData[i.id], e.field, e.rule.value)), F(this.formData, e.id, r);
|
|
3324
3330
|
},
|
|
3325
3331
|
rmSubRuleData(e) {
|
|
3326
3332
|
const r = e.getParentGroup();
|
|
3327
|
-
r && this.subRuleData[r.id] &&
|
|
3333
|
+
r && this.subRuleData[r.id] && re(this.subRuleData[r.id], e.field);
|
|
3328
3334
|
},
|
|
3329
3335
|
getFormData(e) {
|
|
3330
3336
|
return this.formData[e.id];
|
|
3331
3337
|
},
|
|
3332
3338
|
syncForm() {
|
|
3333
3339
|
const e = {}, r = this.fields(), i = [];
|
|
3334
|
-
this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] =
|
|
3340
|
+
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) => {
|
|
3335
3341
|
let o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a))[0];
|
|
3336
|
-
return o || (o = this.fieldCtx[n][0], i.push(n)), s[n] =
|
|
3337
|
-
}, e), this.form =
|
|
3342
|
+
return o || (o = this.fieldCtx[n][0], i.push(n)), s[n] = De(o.rule, "value"), s;
|
|
3343
|
+
}, e), this.form = ie(e), this.ignoreFields = i, this.syncValue();
|
|
3338
3344
|
},
|
|
3339
3345
|
isIgnore(e) {
|
|
3340
3346
|
return e.rule.ignore === !0 || (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields) && e.hasHidden();
|
|
3341
3347
|
},
|
|
3342
3348
|
appendValue(e) {
|
|
3343
|
-
(!e.field || !
|
|
3349
|
+
(!e.field || !j(this.appendData, e.field)) && !this.options.forceCoverValue || (e.value = this.appendData[e.field], delete this.appendData[e.field]);
|
|
3344
3350
|
},
|
|
3345
3351
|
addSubForm(e, r) {
|
|
3346
3352
|
this.subForm[e.id] = r;
|
|
@@ -3393,7 +3399,7 @@ function di(t) {
|
|
|
3393
3399
|
function bt(t, e) {
|
|
3394
3400
|
return typeof e == "function" ? "" + e : e;
|
|
3395
3401
|
}
|
|
3396
|
-
const
|
|
3402
|
+
const je = {
|
|
3397
3403
|
init(t) {
|
|
3398
3404
|
},
|
|
3399
3405
|
toFormValue(t, e) {
|
|
@@ -3412,7 +3418,7 @@ const De = {
|
|
|
3412
3418
|
},
|
|
3413
3419
|
mergeProp(t) {
|
|
3414
3420
|
}
|
|
3415
|
-
}, pi = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"],
|
|
3421
|
+
}, pi = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"], _e = Symbol("oldValue");
|
|
3416
3422
|
function mi(t) {
|
|
3417
3423
|
C(t.prototype, {
|
|
3418
3424
|
getCtx(e) {
|
|
@@ -3448,7 +3454,7 @@ function mi(t) {
|
|
|
3448
3454
|
if (n)
|
|
3449
3455
|
return n;
|
|
3450
3456
|
}
|
|
3451
|
-
return r[e.originType] || r[q(e.type)] || r[e.trueType] ||
|
|
3457
|
+
return r[e.originType] || r[q(e.type)] || r[e.trueType] || je;
|
|
3452
3458
|
},
|
|
3453
3459
|
bindParser(e) {
|
|
3454
3460
|
e.setParser(this.getParser(e));
|
|
@@ -3462,7 +3468,7 @@ function mi(t) {
|
|
|
3462
3468
|
},
|
|
3463
3469
|
watchCtx(e) {
|
|
3464
3470
|
if (It().filter((i) => i[0] !== "_" && i[0] !== "$" && pi.indexOf(i) === -1).forEach((i) => {
|
|
3465
|
-
const s =
|
|
3471
|
+
const s = De(e.rule, i), n = i === "children";
|
|
3466
3472
|
e.refRule[i] = s, e.watch.push(B(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
|
|
3467
3473
|
let l = s.value;
|
|
3468
3474
|
if (!this.isBreakWatch()) {
|
|
@@ -3504,7 +3510,7 @@ function mi(t) {
|
|
|
3504
3510
|
return n ? this.api.t(n[1], { title: (a = (o = e.refRule) == null ? void 0 : o.__$title) == null ? void 0 : a.value }) : s;
|
|
3505
3511
|
};
|
|
3506
3512
|
return H(e.rule.validate).map((s) => {
|
|
3507
|
-
const n =
|
|
3513
|
+
const n = _({}, s);
|
|
3508
3514
|
if (n.message && (n.message = i(n.message)), h.Function(n.validator)) {
|
|
3509
3515
|
const o = e;
|
|
3510
3516
|
n.validator = function(...a) {
|
|
@@ -3519,7 +3525,7 @@ function mi(t) {
|
|
|
3519
3525
|
}
|
|
3520
3526
|
if (n.adapter) {
|
|
3521
3527
|
if (typeof n.error == "object") {
|
|
3522
|
-
const o =
|
|
3528
|
+
const o = _({}, n.error);
|
|
3523
3529
|
Object.keys(o).forEach((a) => {
|
|
3524
3530
|
o[a] = i(o[a]);
|
|
3525
3531
|
}), n.error = o;
|
|
@@ -3529,7 +3535,7 @@ function mi(t) {
|
|
|
3529
3535
|
return n;
|
|
3530
3536
|
});
|
|
3531
3537
|
}), e.input) {
|
|
3532
|
-
const i =
|
|
3538
|
+
const i = De(e.rule, "value");
|
|
3533
3539
|
e.watch.push(B(() => i.value, () => {
|
|
3534
3540
|
let s = e.parser.toFormValue(i.value, e);
|
|
3535
3541
|
this.isChange(e, s) && this.setValue(e, i.value, s, !0);
|
|
@@ -3542,12 +3548,12 @@ function mi(t) {
|
|
|
3542
3548
|
const a = i[s];
|
|
3543
3549
|
if (!a) return;
|
|
3544
3550
|
const l = this.compute(e, a);
|
|
3545
|
-
return a.linkage && l ===
|
|
3551
|
+
return (a.linkage || a.linkageVariable) && l === _e ? _e : l;
|
|
3546
3552
|
}), o = (a) => {
|
|
3547
|
-
s === "value" ? this.onInput(e, a) : s[0] === "$" ? this.api.setEffect(e.id, s, a) :
|
|
3553
|
+
s === "value" ? this.onInput(e, a) : s[0] === "$" ? this.api.setEffect(e.id, s, a) : se(e.rule, s, a);
|
|
3548
3554
|
};
|
|
3549
3555
|
(s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : n.value !== L(e.rule, s)) && o(n.value), e.watch.push(B(n, (a, l) => {
|
|
3550
|
-
a ===
|
|
3556
|
+
a === _e || a === l || setTimeout(() => {
|
|
3551
3557
|
o(a);
|
|
3552
3558
|
});
|
|
3553
3559
|
}, { deep: !0 }));
|
|
@@ -3677,22 +3683,22 @@ function mi(t) {
|
|
|
3677
3683
|
let u = !0;
|
|
3678
3684
|
for (let f = 0; f < a.group.length; f++) {
|
|
3679
3685
|
const p = a.group[f];
|
|
3680
|
-
let d,
|
|
3686
|
+
let d, g = null;
|
|
3681
3687
|
if (p.variable)
|
|
3682
|
-
|
|
3688
|
+
g = JSON.stringify(this.fc.getLoadData(p.variable)) || "";
|
|
3683
3689
|
else if (p.field)
|
|
3684
|
-
|
|
3690
|
+
g = dt(p.field || "");
|
|
3685
3691
|
else if (!p.mode)
|
|
3686
3692
|
return !0;
|
|
3687
3693
|
let y = p.compare;
|
|
3688
|
-
if (y && (y = dt(y || "")), p.mode ? d = n(p) :
|
|
3694
|
+
if (y && (y = dt(y || "")), p.mode ? d = n(p) : ce[p.condition] ? h.Function(p.handler) ? d = O(() => p.handler(this.api, e.rule)) : d = O(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${p.condition}'](${g}, ${y || "$val"}); }}}}`).call(this.api.form, ce, p.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : d = !1, l && d)
|
|
3689
3695
|
return !0;
|
|
3690
3696
|
l || (u = u && d);
|
|
3691
3697
|
}
|
|
3692
3698
|
return l ? !1 : u;
|
|
3693
3699
|
};
|
|
3694
3700
|
let o = n(r);
|
|
3695
|
-
return o = r.invert === !0 ? !o : o, r.linkage ? o ? O(() => this.computeValue(r.linkage, e, s), void 0) :
|
|
3701
|
+
return o = r.invert === !0 ? !o : o, r.linkage ? o ? O(() => this.computeValue(r.linkage, e, s), void 0) : _e : r.linkageVariable ? o ? O(() => this.fc.getLoadData(r.linkageVariable), void 0) : _e : o;
|
|
3696
3702
|
} else if (h.Function(r))
|
|
3697
3703
|
i = () => r(this.api.form, this.api);
|
|
3698
3704
|
else {
|
|
@@ -3727,9 +3733,9 @@ function mi(t) {
|
|
|
3727
3733
|
rmCtx(e) {
|
|
3728
3734
|
if (e.deleted) return;
|
|
3729
3735
|
const { id: r, field: i, input: s, name: n } = e;
|
|
3730
|
-
|
|
3736
|
+
re(this.ctxs, r), re(this.formData, r), re(this.subForm, r), re(this.vm.ctxInject, r);
|
|
3731
3737
|
const o = e.getParentGroup();
|
|
3732
|
-
o && this.subRuleData[o.id] &&
|
|
3738
|
+
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 && !j(this.fieldCtx, i) && re(this.form, i), this.deferSyncValue(() => {
|
|
3733
3739
|
if (!this.reloading) {
|
|
3734
3740
|
if (e.parser.loadChildren !== !1) {
|
|
3735
3741
|
const l = e.getPending("children", e.rule.children);
|
|
@@ -3764,12 +3770,12 @@ function gi(t) {
|
|
|
3764
3770
|
},
|
|
3765
3771
|
targetHook(e, r, i) {
|
|
3766
3772
|
var l, u, f, p;
|
|
3767
|
-
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d,
|
|
3773
|
+
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d, g) => {
|
|
3768
3774
|
d && (d = Array.isArray(d) ? d : [d], d.forEach((y) => {
|
|
3769
|
-
O(() => y(U(
|
|
3775
|
+
O(() => y(U(_({}, i || {}), {
|
|
3770
3776
|
self: e.rule,
|
|
3771
3777
|
rule: e.rule,
|
|
3772
|
-
parent:
|
|
3778
|
+
parent: g == null ? void 0 : g.rule,
|
|
3773
3779
|
$f: this.api,
|
|
3774
3780
|
api: this.api,
|
|
3775
3781
|
option: this.vm.$props.option
|
|
@@ -3791,23 +3797,23 @@ function yi(t) {
|
|
|
3791
3797
|
const e = this.fc.providers;
|
|
3792
3798
|
Object.keys(e).forEach((r) => {
|
|
3793
3799
|
let i = e[r];
|
|
3794
|
-
h.Function(i) && (i = i(this.fc)), i._c = bi(i), this.onEffect(i), this.providers[r] = i;
|
|
3800
|
+
h.Function(i) && (i = i(this.fc)), i._c = bi(i), this.onEffect(i, r), this.providers[r] = i;
|
|
3795
3801
|
});
|
|
3796
3802
|
},
|
|
3797
|
-
onEffect(e) {
|
|
3798
|
-
const
|
|
3799
|
-
(e._c || ["*"]).forEach((
|
|
3800
|
-
const
|
|
3801
|
-
|
|
3802
|
-
e[
|
|
3803
|
+
onEffect(e, r) {
|
|
3804
|
+
const i = [];
|
|
3805
|
+
(e._c || ["*"]).forEach((s) => {
|
|
3806
|
+
const n = s === "*" ? "*" : this.getType(s);
|
|
3807
|
+
i.indexOf(n) > -1 || (i.push(n), this.bus.$on(`p:${r || e.name}:${n}:${e.input ? 1 : 0}`, (o, a) => {
|
|
3808
|
+
e[o] && e[o](...a);
|
|
3803
3809
|
}));
|
|
3804
|
-
}), e._used =
|
|
3810
|
+
}), e._used = i;
|
|
3805
3811
|
},
|
|
3806
3812
|
watchEffect(e) {
|
|
3807
3813
|
let r = {
|
|
3808
3814
|
required: () => {
|
|
3809
3815
|
var i, s;
|
|
3810
|
-
return (
|
|
3816
|
+
return (j(e.rule, "$required") ? e.rule.$required : (s = (i = e.rule) == null ? void 0 : i.effect) == null ? void 0 : s.required) || !1;
|
|
3811
3817
|
}
|
|
3812
3818
|
};
|
|
3813
3819
|
Object.keys(e.rule.effect || {}).forEach((i) => {
|
|
@@ -3837,14 +3843,14 @@ function yi(t) {
|
|
|
3837
3843
|
}, r);
|
|
3838
3844
|
},
|
|
3839
3845
|
getEffect(e, r) {
|
|
3840
|
-
if (
|
|
3846
|
+
if (j(e, "$" + r))
|
|
3841
3847
|
return e["$" + r];
|
|
3842
|
-
if (
|
|
3848
|
+
if (j(e, "effect") && j(e.effect, r))
|
|
3843
3849
|
return e.effect[r];
|
|
3844
3850
|
},
|
|
3845
3851
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3846
3852
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3847
|
-
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u),
|
|
3853
|
+
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), _({}, r.effect || {}));
|
|
3848
3854
|
Object.keys(l).forEach((u) => {
|
|
3849
3855
|
const f = this.providers[u];
|
|
3850
3856
|
if (!f || f.input && !i) return;
|
|
@@ -3855,8 +3861,8 @@ function yi(t) {
|
|
|
3855
3861
|
p = s;
|
|
3856
3862
|
else
|
|
3857
3863
|
return;
|
|
3858
|
-
const d =
|
|
3859
|
-
e && (d.getProp = () => e.effectData(u), d.clearProp = () => e.clearEffectData(u), d.mergeProp = (
|
|
3864
|
+
const d = _({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3865
|
+
e && (d.getProp = () => e.effectData(u), d.clearProp = () => e.clearEffectData(u), d.mergeProp = (g) => Q(d.getProp(), [g]), d.id = e.id), this.bus.$emit(`p:${u}:${p}:${f.input ? 1 : 0}`, o, [d, r, this.api]);
|
|
3860
3866
|
});
|
|
3861
3867
|
}
|
|
3862
3868
|
});
|
|
@@ -3882,7 +3888,7 @@ function K(t) {
|
|
|
3882
3888
|
return t.bus;
|
|
3883
3889
|
},
|
|
3884
3890
|
preview() {
|
|
3885
|
-
return t.vm.$
|
|
3891
|
+
return t.vm.$props.preview != null ? t.vm.$props.preview : t.vm.parent && t.vm.parent.$props.preview != null ? t.vm.parent.$props.preview : t.options.value.preview || !1;
|
|
3886
3892
|
}
|
|
3887
3893
|
}), C(this, {
|
|
3888
3894
|
fc: t,
|
|
@@ -3893,10 +3899,10 @@ function K(t) {
|
|
|
3893
3899
|
noWatchFn: null,
|
|
3894
3900
|
deferSyncFn: null,
|
|
3895
3901
|
isMounted: !1,
|
|
3896
|
-
formData:
|
|
3897
|
-
subRuleData:
|
|
3902
|
+
formData: ie({}),
|
|
3903
|
+
subRuleData: ie({}),
|
|
3898
3904
|
subForm: {},
|
|
3899
|
-
form:
|
|
3905
|
+
form: ie({}),
|
|
3900
3906
|
appendData: {},
|
|
3901
3907
|
ignoreFields: [],
|
|
3902
3908
|
providers: {},
|
|
@@ -3927,7 +3933,7 @@ C(K.prototype, {
|
|
|
3927
3933
|
this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
|
|
3928
3934
|
},
|
|
3929
3935
|
updateAppendData() {
|
|
3930
|
-
this.appendData =
|
|
3936
|
+
this.appendData = _(_(_({}, this.options.formData || {}), this.fc.vm.$props.value || {}), this.appendData);
|
|
3931
3937
|
},
|
|
3932
3938
|
isBreakWatch() {
|
|
3933
3939
|
return this.loading || this.noWatchFn || this.reloading;
|
|
@@ -3977,22 +3983,24 @@ function Ci() {
|
|
|
3977
3983
|
}
|
|
3978
3984
|
return C(e.prototype, {
|
|
3979
3985
|
setVm(r) {
|
|
3980
|
-
this.vm = r, this.h = this.$h = r.$createElement;
|
|
3986
|
+
this.handle = r, this.vm = r.vm, this.h = this.$h = r.vm.$createElement;
|
|
3981
3987
|
},
|
|
3982
3988
|
make(r, i, s) {
|
|
3983
3989
|
var n, o, a;
|
|
3984
3990
|
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);
|
|
3985
3991
|
},
|
|
3986
3992
|
makeComponent(r, i, s) {
|
|
3987
|
-
var
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
+
var a;
|
|
3994
|
+
const n = this.handle.fc.prop.components[r];
|
|
3995
|
+
n && (r = n);
|
|
3996
|
+
let o = this.$h(r, _i(i), s || []);
|
|
3997
|
+
if ((a = o == null ? void 0 : o.componentOptions) != null && a.propsData && (i != null && i.props)) {
|
|
3998
|
+
const l = Object.keys(o.componentOptions.propsData);
|
|
3999
|
+
o.data.attrs || (o.data.attrs = {}), Object.keys(i.props).forEach((u) => {
|
|
4000
|
+
o.data.attrs[u] == null && l.indexOf(u) === -1 && ["string", "number", "boolean"].indexOf(typeof i.props[u]) > -1 && (o.data.attrs[u] = i.props[u]);
|
|
3993
4001
|
});
|
|
3994
4002
|
}
|
|
3995
|
-
return
|
|
4003
|
+
return o.context = this.vm, o;
|
|
3996
4004
|
},
|
|
3997
4005
|
aliasMap: t
|
|
3998
4006
|
}), C(e, {
|
|
@@ -4003,9 +4011,9 @@ function Ci() {
|
|
|
4003
4011
|
use(r) {
|
|
4004
4012
|
Object.keys(r).forEach((i) => {
|
|
4005
4013
|
const s = $e(i), n = zr(i).toLocaleLowerCase(), o = r[i];
|
|
4006
|
-
[i, s, n].forEach((a) => {
|
|
4007
|
-
e.
|
|
4008
|
-
return this.make(
|
|
4014
|
+
e.alias(i, o), [i, s, n].forEach((a) => {
|
|
4015
|
+
e.prototype[a] = function(l, u) {
|
|
4016
|
+
return this.make(t[i] || a, l, u);
|
|
4009
4017
|
};
|
|
4010
4018
|
});
|
|
4011
4019
|
});
|
|
@@ -4091,13 +4099,13 @@ const Oi = function(t) {
|
|
|
4091
4099
|
let l = (p) => {
|
|
4092
4100
|
let d;
|
|
4093
4101
|
i && i.__fc__ && (d = i.__fc__.getParentGroup());
|
|
4094
|
-
let
|
|
4095
|
-
a.template ?
|
|
4102
|
+
let g;
|
|
4103
|
+
a.template ? g = t.$handle.loadStrVar(a.template, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null) : a.handler && h.Function(a.handler) ? g = a.handler(p, i, s) : g = t.$handle.loadStrVar(`{{${a.attr}}}`, p, d ? { rule: i, value: t.$handle.subRuleData[d.id] || {} } : null), (g == null || g === "") && a.default != null && (g = a.default), a.copy !== !1 && (g = G(g));
|
|
4096
4104
|
const y = a.modify ? i : r.getProp();
|
|
4097
|
-
a.to === "child" ? y.children ?
|
|
4105
|
+
a.to === "child" ? y.children ? F(y.children, 0, g) : F(y, "children", [g]) : se(y, a.to || "options", g), s.sync(i);
|
|
4098
4106
|
}, u = (p) => l(p);
|
|
4099
4107
|
const f = t.watchLoadData(u);
|
|
4100
|
-
l =
|
|
4108
|
+
l = ne(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
|
|
4101
4109
|
}
|
|
4102
4110
|
}), this._fn[r.id] = o;
|
|
4103
4111
|
});
|
|
@@ -4109,7 +4117,7 @@ const Oi = function(t) {
|
|
|
4109
4117
|
}
|
|
4110
4118
|
};
|
|
4111
4119
|
return e.watch = e.loaded, e;
|
|
4112
|
-
},
|
|
4120
|
+
}, Fi = function(t) {
|
|
4113
4121
|
const e = {
|
|
4114
4122
|
name: "t",
|
|
4115
4123
|
_fn: [],
|
|
@@ -4121,13 +4129,13 @@ const Oi = function(t) {
|
|
|
4121
4129
|
const l = n[a];
|
|
4122
4130
|
if (l) {
|
|
4123
4131
|
const u = typeof l == "object";
|
|
4124
|
-
let f = (
|
|
4125
|
-
let y = t.t(u ? l.attr : l, u ? l.params : null,
|
|
4126
|
-
const
|
|
4127
|
-
a === "child" ?
|
|
4128
|
-
}, p = (
|
|
4132
|
+
let f = (g) => {
|
|
4133
|
+
let y = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
4134
|
+
const v = u && l.modify ? i : r.getProp();
|
|
4135
|
+
a === "child" ? v.children ? F(v.children, 0, y) : F(v, "children", [y]) : se(v, a, y), s.sync(i);
|
|
4136
|
+
}, p = (g) => f(g);
|
|
4129
4137
|
const d = t.watchLoadData(p);
|
|
4130
|
-
f =
|
|
4138
|
+
f = ne(f, l.wait || 300), l.watch !== !1 ? o.push(d) : d();
|
|
4131
4139
|
}
|
|
4132
4140
|
}), this._fn[r.id] = o;
|
|
4133
4141
|
},
|
|
@@ -4146,7 +4154,7 @@ const Oi = function(t) {
|
|
|
4146
4154
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4147
4155
|
else {
|
|
4148
4156
|
h.Object(i) || (i = { method: i });
|
|
4149
|
-
const s = i.method, n = U(
|
|
4157
|
+
const s = i.method, n = U(_({}, i), {
|
|
4150
4158
|
validator(...o) {
|
|
4151
4159
|
const a = Z(e);
|
|
4152
4160
|
if (a)
|
|
@@ -4163,7 +4171,7 @@ const Oi = function(t) {
|
|
|
4163
4171
|
watch(...t) {
|
|
4164
4172
|
Wt.load(...t);
|
|
4165
4173
|
}
|
|
4166
|
-
},
|
|
4174
|
+
}, ki = function(t) {
|
|
4167
4175
|
function e(s) {
|
|
4168
4176
|
return h.String(s) && (s = {
|
|
4169
4177
|
action: s,
|
|
@@ -4174,55 +4182,53 @@ const Oi = function(t) {
|
|
|
4174
4182
|
let a = s.value;
|
|
4175
4183
|
i.deleted(s), h.Function(a) && (a = a(n, o)), a = e(a);
|
|
4176
4184
|
const l = (p) => {
|
|
4177
|
-
p === void 0 ? s.clearProp() :
|
|
4185
|
+
p === void 0 ? s.clearProp() : se(s.getProp(), a.to || "options", p), o.sync(n);
|
|
4178
4186
|
};
|
|
4179
4187
|
if (!a || !a.action && !a.key) {
|
|
4180
4188
|
l(void 0);
|
|
4181
4189
|
return;
|
|
4182
4190
|
}
|
|
4183
|
-
|
|
4184
|
-
const p = t.$handle.options.globalData[a.key];
|
|
4185
|
-
if (!p) {
|
|
4186
|
-
l(void 0);
|
|
4187
|
-
return;
|
|
4188
|
-
}
|
|
4189
|
-
if (p.type === "static") {
|
|
4190
|
-
l(p.data);
|
|
4191
|
-
return;
|
|
4192
|
-
} else
|
|
4193
|
-
a = v(v({}, a), p);
|
|
4194
|
-
}
|
|
4191
|
+
a = G(a), a.to || (a.to = "options");
|
|
4195
4192
|
const u = a.onError, f = () => {
|
|
4196
4193
|
if (!s.getValue())
|
|
4197
4194
|
return s.clearProp(), o.sync(n), !0;
|
|
4198
4195
|
};
|
|
4199
|
-
i._fn[s.id] = t.watchLoadData(
|
|
4196
|
+
i._fn[s.id] = t.watchLoadData(ne((p, d) => {
|
|
4200
4197
|
if (d && a.watch === !1)
|
|
4201
4198
|
return i._fn[s.id]();
|
|
4202
|
-
|
|
4199
|
+
if (a.key) {
|
|
4200
|
+
t.targetRule = n;
|
|
4201
|
+
const v = p("$globalData." + a.key);
|
|
4202
|
+
if (delete t.targetRule, v) {
|
|
4203
|
+
if (f()) return;
|
|
4204
|
+
l(v);
|
|
4205
|
+
}
|
|
4206
|
+
return;
|
|
4207
|
+
}
|
|
4208
|
+
const g = t.$handle.loadFetchVar(G(a), p, n), y = U(_({
|
|
4203
4209
|
headers: {}
|
|
4204
|
-
},
|
|
4205
|
-
onSuccess(
|
|
4210
|
+
}, g), {
|
|
4211
|
+
onSuccess(v, E) {
|
|
4206
4212
|
if (f()) return;
|
|
4207
|
-
let Y = (T) => E ? T :
|
|
4208
|
-
const I = W(
|
|
4209
|
-
h.Function(I) ? Y = I : I && h.String(I) && (Y = (T) => L(T, I)), l(Y(
|
|
4213
|
+
let Y = (T) => E ? T : j(T, "data") ? T.data : T;
|
|
4214
|
+
const I = W(g.parse);
|
|
4215
|
+
h.Function(I) ? Y = I : I && h.String(I) && (Y = (T) => L(T, I)), l(Y(v, n, o));
|
|
4210
4216
|
},
|
|
4211
|
-
onError(
|
|
4212
|
-
l(void 0), !f() && (u || ((E) => et(E.message || "fetch fail " +
|
|
4217
|
+
onError(v) {
|
|
4218
|
+
l(void 0), !f() && (u || ((E) => et(E.message || "fetch fail " + g.action)))(v, n, o);
|
|
4213
4219
|
}
|
|
4214
4220
|
});
|
|
4215
4221
|
t.$handle.beforeFetch(y, { rule: n, api: o }).then(() => {
|
|
4216
|
-
if (h.Function(
|
|
4217
|
-
|
|
4218
|
-
y.onSuccess(
|
|
4219
|
-
}).catch((
|
|
4220
|
-
y.onError(
|
|
4222
|
+
if (h.Function(g.action)) {
|
|
4223
|
+
g.action(n, o).then((v) => {
|
|
4224
|
+
y.onSuccess(v, !0);
|
|
4225
|
+
}).catch((v) => {
|
|
4226
|
+
y.onError(v);
|
|
4221
4227
|
});
|
|
4222
4228
|
return;
|
|
4223
4229
|
}
|
|
4224
4230
|
O(() => t.create.fetch(y, { inject: s, rule: n, api: o }));
|
|
4225
|
-
}).catch((
|
|
4231
|
+
}).catch((v) => {
|
|
4226
4232
|
});
|
|
4227
4233
|
}, a.wait || 600));
|
|
4228
4234
|
}
|
|
@@ -4241,9 +4247,9 @@ const Oi = function(t) {
|
|
|
4241
4247
|
};
|
|
4242
4248
|
return i;
|
|
4243
4249
|
}, Si = {
|
|
4244
|
-
fetch:
|
|
4250
|
+
fetch: ki,
|
|
4245
4251
|
loadData: Oi,
|
|
4246
|
-
t:
|
|
4252
|
+
t: Fi,
|
|
4247
4253
|
componentValidate: Wt
|
|
4248
4254
|
};
|
|
4249
4255
|
function Ri(t) {
|
|
@@ -4270,7 +4276,7 @@ function Ri(t) {
|
|
|
4270
4276
|
};
|
|
4271
4277
|
return e;
|
|
4272
4278
|
}
|
|
4273
|
-
const Ei = "html",
|
|
4279
|
+
const Ei = "html", ji = {
|
|
4274
4280
|
name: Ei,
|
|
4275
4281
|
loadChildren: !1,
|
|
4276
4282
|
render(t, e) {
|
|
@@ -4280,7 +4286,7 @@ const Ei = "html", Di = {
|
|
|
4280
4286
|
return Array.isArray(t) ? t.filter((e) => h.String(e)).join("") : "";
|
|
4281
4287
|
}
|
|
4282
4288
|
};
|
|
4283
|
-
function
|
|
4289
|
+
function Di(t) {
|
|
4284
4290
|
t = t + "=";
|
|
4285
4291
|
const r = decodeURIComponent(document.cookie).split(";");
|
|
4286
4292
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -4326,7 +4332,7 @@ function it(t, e) {
|
|
|
4326
4332
|
return r.length ? i == null ? null : L(i, r) : i;
|
|
4327
4333
|
}
|
|
4328
4334
|
function Vi(t) {
|
|
4329
|
-
return it(
|
|
4335
|
+
return it(Di, t);
|
|
4330
4336
|
}
|
|
4331
4337
|
function Pi(t) {
|
|
4332
4338
|
return it(Ai, t);
|
|
@@ -4416,18 +4422,18 @@ function Kt(t) {
|
|
|
4416
4422
|
[Ne.name]: Ne
|
|
4417
4423
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4418
4424
|
t.extendApi
|
|
4419
|
-
], u =
|
|
4425
|
+
], u = _({}, Si), f = Qr();
|
|
4420
4426
|
let p = { global: {} };
|
|
4421
|
-
const d = t.isMobile === !0,
|
|
4427
|
+
const d = t.isMobile === !0, g = ie({
|
|
4422
4428
|
$mobile: d
|
|
4423
|
-
}), y = Ci(),
|
|
4429
|
+
}), y = Ci(), v = {}, E = {};
|
|
4424
4430
|
Ui(t.attrs || {});
|
|
4425
4431
|
function Y(c) {
|
|
4426
|
-
const
|
|
4427
|
-
if (Array.isArray(
|
|
4428
|
-
return
|
|
4429
|
-
if (
|
|
4430
|
-
return
|
|
4432
|
+
const m = M[c];
|
|
4433
|
+
if (Array.isArray(m))
|
|
4434
|
+
return m.map(($) => $.api());
|
|
4435
|
+
if (m)
|
|
4436
|
+
return m.api();
|
|
4431
4437
|
}
|
|
4432
4438
|
function I(c) {
|
|
4433
4439
|
o.push(c);
|
|
@@ -4436,31 +4442,31 @@ function Kt(t) {
|
|
|
4436
4442
|
const c = Me(...arguments);
|
|
4437
4443
|
c.id && c.prop && (i[c.id] = c.prop);
|
|
4438
4444
|
}
|
|
4439
|
-
function
|
|
4445
|
+
function he() {
|
|
4440
4446
|
const c = Me(...arguments);
|
|
4441
|
-
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(
|
|
4447
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : U(_({}, c.prop), {
|
|
4442
4448
|
name: c.id
|
|
4443
4449
|
}));
|
|
4444
4450
|
}
|
|
4445
4451
|
function Pe(c) {
|
|
4446
4452
|
y.use(c);
|
|
4447
4453
|
}
|
|
4448
|
-
function
|
|
4454
|
+
function de() {
|
|
4449
4455
|
const c = Me(...arguments);
|
|
4450
|
-
if (!c.id || !c.prop) return
|
|
4451
|
-
const
|
|
4452
|
-
r[
|
|
4456
|
+
if (!c.id || !c.prop) return je;
|
|
4457
|
+
const m = q(c.id), $ = c.prop, b = $.merge === !0 ? r[m] : void 0;
|
|
4458
|
+
r[m] = Re($, b || je), f[m] = P(m), $.maker && C(f, $.maker);
|
|
4453
4459
|
}
|
|
4454
|
-
function
|
|
4460
|
+
function k(c, m) {
|
|
4455
4461
|
let $;
|
|
4456
4462
|
if (h.String(c)) {
|
|
4457
|
-
if ($ = c,
|
|
4463
|
+
if ($ = c, m === void 0)
|
|
4458
4464
|
return ["form-create", "formcreate"].indexOf($) > -1 ? S() : e[$];
|
|
4459
4465
|
} else
|
|
4460
|
-
$ = q(c.name),
|
|
4461
|
-
if (!$ || !
|
|
4466
|
+
$ = q(c.name), m = c;
|
|
4467
|
+
if (!$ || !m) return;
|
|
4462
4468
|
const b = q($);
|
|
4463
|
-
e[$] =
|
|
4469
|
+
e[$] = m, e[b] = m, delete y.aliasMap[$], delete y.aliasMap[b], delete r[$], delete r[b], m.formCreateParser && de($, m.formCreateParser);
|
|
4464
4470
|
}
|
|
4465
4471
|
function S() {
|
|
4466
4472
|
return Zr(Be, e, i);
|
|
@@ -4468,18 +4474,18 @@ function Kt(t) {
|
|
|
4468
4474
|
function N() {
|
|
4469
4475
|
return Ne;
|
|
4470
4476
|
}
|
|
4471
|
-
function
|
|
4472
|
-
return h.Function(c.install) ? c.install(z,
|
|
4477
|
+
function pe(c, m) {
|
|
4478
|
+
return h.Function(c.install) ? c.install(z, m) : h.Function(c) && c(z, m), this;
|
|
4473
4479
|
}
|
|
4474
|
-
function z(c,
|
|
4475
|
-
let b = Mi(c,
|
|
4480
|
+
function z(c, m, $) {
|
|
4481
|
+
let b = Mi(c, m || {});
|
|
4476
4482
|
const w = b.$refs.fc.formCreate;
|
|
4477
4483
|
return w.$parent = $, Ni(w.options).appendChild(b.$el), w.api();
|
|
4478
4484
|
}
|
|
4479
|
-
|
|
4485
|
+
Re(z, E);
|
|
4480
4486
|
function Zt(c) {
|
|
4481
|
-
let
|
|
4482
|
-
return c ?
|
|
4487
|
+
let m = _({}, t);
|
|
4488
|
+
return c ? m.inherit = {
|
|
4483
4489
|
components: e,
|
|
4484
4490
|
parsers: r,
|
|
4485
4491
|
directives: i,
|
|
@@ -4487,54 +4493,54 @@ function Kt(t) {
|
|
|
4487
4493
|
providers: u,
|
|
4488
4494
|
useApps: o,
|
|
4489
4495
|
maker: f,
|
|
4490
|
-
formulas:
|
|
4491
|
-
loadData:
|
|
4492
|
-
} : delete
|
|
4496
|
+
formulas: v,
|
|
4497
|
+
loadData: g
|
|
4498
|
+
} : delete m.inherit, Kt(m);
|
|
4493
4499
|
}
|
|
4494
|
-
function xt(c,
|
|
4495
|
-
s[c] =
|
|
4500
|
+
function xt(c, m) {
|
|
4501
|
+
s[c] = m;
|
|
4496
4502
|
}
|
|
4497
|
-
function Qt(c,
|
|
4498
|
-
|
|
4503
|
+
function Qt(c, m) {
|
|
4504
|
+
v[c] = m;
|
|
4499
4505
|
}
|
|
4500
|
-
function Yt(c,
|
|
4506
|
+
function Yt(c, m) {
|
|
4501
4507
|
const $ = n[c] || {}, b = $.parsers || {};
|
|
4502
|
-
|
|
4503
|
-
b[w] =
|
|
4504
|
-
}),
|
|
4508
|
+
m.parsers && Object.keys(m.parsers).forEach((w) => {
|
|
4509
|
+
b[w] = Re(m.parsers[w], je);
|
|
4510
|
+
}), m.name = c, n[c] = U(_(_({}, $), m), { parsers: b });
|
|
4505
4511
|
}
|
|
4506
|
-
function
|
|
4507
|
-
c && Object.keys(M).forEach((
|
|
4508
|
-
(Array.isArray(M[
|
|
4512
|
+
function Oe(c) {
|
|
4513
|
+
c && Object.keys(M).forEach((m) => {
|
|
4514
|
+
(Array.isArray(M[m]) ? M[m] : [M[m]]).forEach((b) => {
|
|
4509
4515
|
b.bus.$emit("$loadData." + c);
|
|
4510
4516
|
});
|
|
4511
4517
|
});
|
|
4512
4518
|
}
|
|
4513
|
-
function Le(c,
|
|
4514
|
-
|
|
4519
|
+
function Le(c, m) {
|
|
4520
|
+
se(g, c, m), Oe(c);
|
|
4515
4521
|
}
|
|
4516
|
-
function
|
|
4517
|
-
const $ = (...b) => O(() =>
|
|
4522
|
+
function Fe(c, m) {
|
|
4523
|
+
const $ = (...b) => O(() => m(...b));
|
|
4518
4524
|
$._driver = !0, Le(c, $);
|
|
4519
4525
|
}
|
|
4520
|
-
function nt(c,
|
|
4526
|
+
function nt(c, m) {
|
|
4521
4527
|
const $ = (c || "").split(".");
|
|
4522
4528
|
c = $.shift();
|
|
4523
4529
|
const b = $.join(".");
|
|
4524
|
-
if (
|
|
4525
|
-
let w =
|
|
4526
|
-
return w && w._driver ? w = w(b) : $.length && (w = L(w, $)), w == null || w === "" ?
|
|
4530
|
+
if (j(g, c) || F(g, c, vt), g[c] !== vt) {
|
|
4531
|
+
let w = g[c];
|
|
4532
|
+
return w && w._driver ? w = w(b) : $.length && (w = L(w, $)), w == null || w === "" ? m : w;
|
|
4527
4533
|
} else
|
|
4528
|
-
return
|
|
4534
|
+
return m;
|
|
4529
4535
|
}
|
|
4530
4536
|
function er(c) {
|
|
4531
4537
|
l.push(c);
|
|
4532
4538
|
}
|
|
4533
4539
|
function tr(c) {
|
|
4534
|
-
delete
|
|
4540
|
+
delete g[c], Oe(c);
|
|
4535
4541
|
}
|
|
4536
|
-
function rr(c,
|
|
4537
|
-
a.push({ name: c, callback:
|
|
4542
|
+
function rr(c, m) {
|
|
4543
|
+
a.push({ name: c, callback: m });
|
|
4538
4544
|
}
|
|
4539
4545
|
function Be(c) {
|
|
4540
4546
|
C(this, {
|
|
@@ -4545,11 +4551,11 @@ function Kt(t) {
|
|
|
4545
4551
|
parsers: r,
|
|
4546
4552
|
providers: u,
|
|
4547
4553
|
modelFields: s,
|
|
4548
|
-
formulas:
|
|
4554
|
+
formulas: v,
|
|
4549
4555
|
isMobile: d,
|
|
4550
|
-
rules: c.$
|
|
4551
|
-
name: c.$
|
|
4552
|
-
inFor: c.$
|
|
4556
|
+
rules: c.$props.rule,
|
|
4557
|
+
name: c.$props.name || Ve(),
|
|
4558
|
+
inFor: c.$props.inFor,
|
|
4553
4559
|
prop: {
|
|
4554
4560
|
components: e,
|
|
4555
4561
|
directives: i
|
|
@@ -4557,17 +4563,17 @@ function Kt(t) {
|
|
|
4557
4563
|
get: null,
|
|
4558
4564
|
drivers: n,
|
|
4559
4565
|
renderDriver: null,
|
|
4560
|
-
refreshData:
|
|
4561
|
-
loadData:
|
|
4566
|
+
refreshData: Oe,
|
|
4567
|
+
loadData: g,
|
|
4562
4568
|
CreateNode: y,
|
|
4563
4569
|
bus: new Ri(),
|
|
4564
4570
|
unwatch: [],
|
|
4565
4571
|
options: yr({}),
|
|
4566
4572
|
extendApiFn: l,
|
|
4567
4573
|
fetchCache: /* @__PURE__ */ new WeakMap(),
|
|
4568
|
-
tmpData:
|
|
4569
|
-
}), a.forEach((
|
|
4570
|
-
this.bus.$on(
|
|
4574
|
+
tmpData: ie({})
|
|
4575
|
+
}), a.forEach((m) => {
|
|
4576
|
+
this.bus.$on(m.name, m.callback);
|
|
4571
4577
|
}), V(() => {
|
|
4572
4578
|
B(this.options, () => {
|
|
4573
4579
|
this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
|
|
@@ -4578,55 +4584,55 @@ function Kt(t) {
|
|
|
4578
4584
|
init() {
|
|
4579
4585
|
this.isSub() && this.unwatch.push(B(() => this.vm.parent.fc.options.value, () => {
|
|
4580
4586
|
this.initOptions(), this.$handle.api.refresh();
|
|
4581
|
-
}, { deep: !0, flush: "sync" })), this.vm.$
|
|
4587
|
+
}, { deep: !0, flush: "sync" })), this.vm.$props.driver && (this.renderDriver = typeof this.vm.$props.driver == "object" ? this.vm.$props.driver : this.drivers[this.vm.$props.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();
|
|
4582
4588
|
},
|
|
4583
|
-
targetFormDriver(c, ...
|
|
4584
|
-
if (this.renderDriver && this.renderDriver[c])
|
|
4585
|
-
return O(() => this.renderDriver[c](...
|
|
4589
|
+
targetFormDriver(c, ...m) {
|
|
4590
|
+
if (this.bus.$emit(c, ...m), this.renderDriver && this.renderDriver[c])
|
|
4591
|
+
return O(() => this.renderDriver[c](...m));
|
|
4586
4592
|
},
|
|
4587
|
-
t(c,
|
|
4593
|
+
t(c, m, $) {
|
|
4588
4594
|
let b = $ ? $("$t." + c) : this.globalLanguageDriver(c);
|
|
4589
|
-
return b == null && (b = ""), b &&
|
|
4595
|
+
return b == null && (b = ""), b && m && Object.keys(m).forEach((w) => {
|
|
4590
4596
|
const A = new RegExp(`{${w}}`, "g");
|
|
4591
|
-
b = b.replace(A,
|
|
4597
|
+
b = b.replace(A, m[w]);
|
|
4592
4598
|
}), b;
|
|
4593
4599
|
},
|
|
4594
4600
|
globalDataDriver(c) {
|
|
4595
|
-
let
|
|
4596
|
-
const $ =
|
|
4601
|
+
let m = c.split(".");
|
|
4602
|
+
const $ = m.shift(), b = this.options.value.globalData && this.options.value.globalData[$];
|
|
4597
4603
|
if (b) {
|
|
4598
4604
|
if (b.type === "static")
|
|
4599
|
-
return L(b.data,
|
|
4605
|
+
return L(b.data, m);
|
|
4600
4606
|
{
|
|
4601
4607
|
let w;
|
|
4602
4608
|
const A = this.fetchCache.get(b);
|
|
4603
4609
|
if (A) {
|
|
4604
|
-
if (A.status && (w = L(A.data,
|
|
4610
|
+
if (A.status && (w = L(A.data, m)), !A.loading)
|
|
4605
4611
|
return w;
|
|
4606
4612
|
A.loading = !1, this.fetchCache.set(b, A);
|
|
4607
4613
|
} else
|
|
4608
4614
|
this.fetchCache.set(b, { status: !1 });
|
|
4609
|
-
const R =
|
|
4610
|
-
|
|
4615
|
+
const R = ne(() => {
|
|
4616
|
+
ee();
|
|
4611
4617
|
const J = this.fetchCache.get(b);
|
|
4612
4618
|
this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (J && (J.loading = !0, this.fetchCache.set(b, J)), this.bus.$emit("$loadData.$globalData." + $)) : this.fetchCache.delete(b);
|
|
4613
4619
|
}, b.wait || 600), be = (J) => {
|
|
4614
4620
|
this.fetchCache.set(b, { status: !0, data: J }), this.bus.$emit("$loadData.$globalData." + $);
|
|
4615
|
-
},
|
|
4621
|
+
}, ae = (J, le) => {
|
|
4616
4622
|
if (le && b.watch === !1)
|
|
4617
|
-
return
|
|
4623
|
+
return ee();
|
|
4618
4624
|
if (le) {
|
|
4619
4625
|
R();
|
|
4620
4626
|
return;
|
|
4621
4627
|
}
|
|
4622
|
-
const
|
|
4623
|
-
this.$handle.api.fetch(
|
|
4624
|
-
be(
|
|
4625
|
-
}).catch((
|
|
4628
|
+
const ue = this.$handle.loadFetchVar(Je(b), J);
|
|
4629
|
+
ue.targetRule = this.targetRule, this.$handle.api.fetch(ue).then((te) => {
|
|
4630
|
+
be(te);
|
|
4631
|
+
}).catch((te) => {
|
|
4626
4632
|
be(null);
|
|
4627
4633
|
});
|
|
4628
|
-
},
|
|
4629
|
-
return this.unwatch.push(
|
|
4634
|
+
}, ee = this.watchLoadData(ae);
|
|
4635
|
+
return b.watch === !1 && ee(), this.unwatch.push(ee), w;
|
|
4630
4636
|
}
|
|
4631
4637
|
}
|
|
4632
4638
|
},
|
|
@@ -4635,28 +4641,28 @@ function Kt(t) {
|
|
|
4635
4641
|
return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
|
|
4636
4642
|
},
|
|
4637
4643
|
globalLanguageDriver(c) {
|
|
4638
|
-
let
|
|
4639
|
-
if (
|
|
4644
|
+
let m = this.vm.top.$props.t, $ = this.vm.top.$props.locale, b;
|
|
4645
|
+
if (m && (b = O(() => m(c))), b == null && $ && typeof $ == "object" && (b = L($, c)), b == null) {
|
|
4640
4646
|
const w = this.options.value.language || {}, A = this.getLocale();
|
|
4641
4647
|
b = L(w[A] || {}, c), b == null && (b = L(Bi[A] || {}, c));
|
|
4642
4648
|
}
|
|
4643
4649
|
return b;
|
|
4644
4650
|
},
|
|
4645
4651
|
globalVarDriver(c) {
|
|
4646
|
-
let
|
|
4647
|
-
const $ =
|
|
4652
|
+
let m = c.split(".");
|
|
4653
|
+
const $ = m.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[$];
|
|
4648
4654
|
if (b) {
|
|
4649
4655
|
const w = h.Function(b) ? b : W(b.handle);
|
|
4650
4656
|
if (w) {
|
|
4651
4657
|
let A = w((...R) => this.$handle.api.getData(...R), this.$handle.api);
|
|
4652
|
-
return L(A,
|
|
4658
|
+
return L(A, m);
|
|
4653
4659
|
}
|
|
4654
4660
|
}
|
|
4655
4661
|
},
|
|
4656
|
-
setData(c,
|
|
4657
|
-
$ ? Le(c,
|
|
4662
|
+
setData(c, m, $) {
|
|
4663
|
+
$ ? Le(c, m) : (se(this.vm.top.fc.tmpData, c, m), this.bus.$emit("$loadData." + c));
|
|
4658
4664
|
},
|
|
4659
|
-
getLoadData(c,
|
|
4665
|
+
getLoadData(c, m) {
|
|
4660
4666
|
let $ = null;
|
|
4661
4667
|
if (c != null) {
|
|
4662
4668
|
let b = c.split(".");
|
|
@@ -4686,32 +4692,32 @@ function Kt(t) {
|
|
|
4686
4692
|
}
|
|
4687
4693
|
$ && b.length && ($ = L($, b));
|
|
4688
4694
|
}
|
|
4689
|
-
return $ == null || $ === "" ?
|
|
4695
|
+
return $ == null || $ === "" ? m : $;
|
|
4690
4696
|
},
|
|
4691
|
-
watchLoadData(c,
|
|
4697
|
+
watchLoadData(c, m) {
|
|
4692
4698
|
let $ = {};
|
|
4693
4699
|
const b = (R) => {
|
|
4694
4700
|
this.get || (this.get = w), O(() => {
|
|
4695
4701
|
c(w, R);
|
|
4696
4702
|
}), this.get === w && (this.get = void 0);
|
|
4697
4703
|
}, w = (R, be) => {
|
|
4698
|
-
let
|
|
4699
|
-
if (typeof R == "object" && (
|
|
4704
|
+
let ae;
|
|
4705
|
+
if (typeof R == "object" && (ae = R.getValue, R = R.id), $[R])
|
|
4700
4706
|
return $[R].val;
|
|
4701
|
-
const
|
|
4702
|
-
const
|
|
4707
|
+
const ee = ge(() => ae ? ae() : this.getLoadData(R, be)), J = R.split("."), le = J.shift(), ue = J.shift() || "", te = ne(() => {
|
|
4708
|
+
const fe = ae ? ae() : this.getLoadData(R, be);
|
|
4703
4709
|
if ($[R])
|
|
4704
|
-
((
|
|
4710
|
+
((fe instanceof Function || h.Object(fe) || Array.isArray(fe)) && fe === $[R].val || JSON.stringify(fe) !== JSON.stringify($[R].val)) && ($[R].val = fe, b(!0));
|
|
4705
4711
|
else return;
|
|
4706
|
-
},
|
|
4707
|
-
|
|
4712
|
+
}, m || 0), nr = B(ee, (fe) => {
|
|
4713
|
+
te();
|
|
4708
4714
|
});
|
|
4709
|
-
return this.bus.$on("$loadData." + le,
|
|
4715
|
+
return this.bus.$on("$loadData." + le, te), ue && this.bus.$on("$loadData." + le + "." + ue, te), $[R] = {
|
|
4710
4716
|
fn: () => {
|
|
4711
|
-
this.bus.$off("$loadData." + le,
|
|
4717
|
+
this.bus.$off("$loadData." + le, te), ue && this.bus.$off("$loadData." + le + "." + ue, te), nr();
|
|
4712
4718
|
},
|
|
4713
|
-
val:
|
|
4714
|
-
},
|
|
4719
|
+
val: ee.value
|
|
4720
|
+
}, ee.value;
|
|
4715
4721
|
};
|
|
4716
4722
|
b(!1);
|
|
4717
4723
|
const A = () => {
|
|
@@ -4724,19 +4730,22 @@ function Kt(t) {
|
|
|
4724
4730
|
},
|
|
4725
4731
|
initOptions() {
|
|
4726
4732
|
this.options.value = {};
|
|
4727
|
-
let c =
|
|
4733
|
+
let c = _({
|
|
4728
4734
|
formData: {},
|
|
4729
4735
|
submitBtn: {},
|
|
4730
4736
|
resetBtn: {},
|
|
4731
4737
|
globalEvent: {},
|
|
4732
4738
|
globalData: {}
|
|
4733
4739
|
}, G(p));
|
|
4734
|
-
|
|
4740
|
+
const m = this.isSub();
|
|
4741
|
+
m && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$props.option || {});
|
|
4742
|
+
const $ = this.api();
|
|
4743
|
+
this.targetFormDriver("initOptions", c, { api: $, isSubForm: m }), this.updateOptions(c);
|
|
4735
4744
|
},
|
|
4736
|
-
mergeOptions(c,
|
|
4737
|
-
return
|
|
4738
|
-
delete
|
|
4739
|
-
}),
|
|
4745
|
+
mergeOptions(c, m, $) {
|
|
4746
|
+
return m = _({}, m || {}), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4747
|
+
delete m[b];
|
|
4748
|
+
}), m.global && (c.global = Wr(c.global, m.global), delete m.global), this.$handle.$manager.mergeOptions([m], c), c;
|
|
4740
4749
|
},
|
|
4741
4750
|
updateOptions(c) {
|
|
4742
4751
|
this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
|
|
@@ -4772,20 +4781,20 @@ function Kt(t) {
|
|
|
4772
4781
|
isMobile: d,
|
|
4773
4782
|
extendApi: er,
|
|
4774
4783
|
getData: nt,
|
|
4775
|
-
setDataDriver:
|
|
4784
|
+
setDataDriver: Fe,
|
|
4776
4785
|
setData: Le,
|
|
4777
4786
|
removeData: tr,
|
|
4778
|
-
refreshData:
|
|
4787
|
+
refreshData: Oe,
|
|
4779
4788
|
maker: f,
|
|
4780
|
-
component:
|
|
4789
|
+
component: k,
|
|
4781
4790
|
directive: T,
|
|
4782
4791
|
setModelField: xt,
|
|
4783
4792
|
setFormula: Qt,
|
|
4784
4793
|
setDriver: Yt,
|
|
4785
|
-
register:
|
|
4794
|
+
register: he,
|
|
4786
4795
|
$vnode: N,
|
|
4787
|
-
parser:
|
|
4788
|
-
use:
|
|
4796
|
+
parser: de,
|
|
4797
|
+
use: pe,
|
|
4789
4798
|
factory: Zt,
|
|
4790
4799
|
componentAlias: Pe,
|
|
4791
4800
|
copyRule: Lt,
|
|
@@ -4795,7 +4804,7 @@ function Kt(t) {
|
|
|
4795
4804
|
$form: S,
|
|
4796
4805
|
parseFn: W,
|
|
4797
4806
|
parseJson: Pt,
|
|
4798
|
-
toJson:
|
|
4807
|
+
toJson: Ce,
|
|
4799
4808
|
useApp: I,
|
|
4800
4809
|
getApi: Y,
|
|
4801
4810
|
on: rr
|
|
@@ -4804,26 +4813,26 @@ function Kt(t) {
|
|
|
4804
4813
|
function ir(c) {
|
|
4805
4814
|
C(c, {
|
|
4806
4815
|
create: z,
|
|
4807
|
-
install(
|
|
4808
|
-
if (p =
|
|
4809
|
-
|
|
4816
|
+
install(m, $) {
|
|
4817
|
+
if (p = _(_({}, p), $ || {}), m._installedFormCreate === !0) return;
|
|
4818
|
+
m._installedFormCreate = !0;
|
|
4810
4819
|
const b = function(A, R = {}) {
|
|
4811
4820
|
return z(A, R, this);
|
|
4812
4821
|
};
|
|
4813
|
-
st(b),
|
|
4822
|
+
st(b), m.prototype.$formCreate = b;
|
|
4814
4823
|
const w = S();
|
|
4815
|
-
|
|
4816
|
-
O(() => A(c,
|
|
4824
|
+
m.component(w.name, w), m.component("FcFragment", N()), o.forEach((A) => {
|
|
4825
|
+
O(() => A(c, m));
|
|
4817
4826
|
});
|
|
4818
4827
|
}
|
|
4819
4828
|
});
|
|
4820
4829
|
}
|
|
4821
|
-
if (st(E), ir(E),
|
|
4830
|
+
if (st(E), ir(E), Fe("$cookie", Vi), Fe("$localStorage", Pi), Fe("$sessionStorage", Li), y.use({ fragment: "fcFragment" }), t.install && z.use(t), de(ji), t.inherit) {
|
|
4822
4831
|
const c = t.inherit;
|
|
4823
|
-
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(
|
|
4832
|
+
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(v, c.formulas);
|
|
4824
4833
|
}
|
|
4825
4834
|
const ke = S();
|
|
4826
|
-
return
|
|
4835
|
+
return Re(ke, E), Object.defineProperties(ke, {
|
|
4827
4836
|
fetch: {
|
|
4828
4837
|
get() {
|
|
4829
4838
|
return E.fetch;
|
|
@@ -4995,16 +5004,16 @@ function Qi() {
|
|
|
4995
5004
|
};
|
|
4996
5005
|
}
|
|
4997
5006
|
function wt(t, e) {
|
|
4998
|
-
|
|
5007
|
+
j(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
|
|
4999
5008
|
}
|
|
5000
5009
|
function X(t) {
|
|
5001
5010
|
return t === !1;
|
|
5002
5011
|
}
|
|
5003
5012
|
function Yi(t, e) {
|
|
5004
|
-
|
|
5013
|
+
j(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
5005
5014
|
}
|
|
5006
5015
|
function He(t) {
|
|
5007
|
-
const e =
|
|
5016
|
+
const e = _({}, t);
|
|
5008
5017
|
return delete e.children, e;
|
|
5009
5018
|
}
|
|
5010
5019
|
const en = {
|
|
@@ -5052,7 +5061,7 @@ const en = {
|
|
|
5052
5061
|
update() {
|
|
5053
5062
|
const t = this.options.form;
|
|
5054
5063
|
this.rule = {
|
|
5055
|
-
props:
|
|
5064
|
+
props: _({}, t),
|
|
5056
5065
|
nativeOn: {
|
|
5057
5066
|
submit: (e) => {
|
|
5058
5067
|
e.preventDefault();
|
|
@@ -5075,7 +5084,7 @@ const en = {
|
|
|
5075
5084
|
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, u = r.wrap.class;
|
|
5076
5085
|
delete r.wrap.class, delete r.wrap.title;
|
|
5077
5086
|
const f = X(r.wrap.show) ? e : this.$r(x([r.wrap, {
|
|
5078
|
-
props: U(
|
|
5087
|
+
props: U(_({
|
|
5079
5088
|
labelWidth: o
|
|
5080
5089
|
}, He(r.wrap || {})), {
|
|
5081
5090
|
prop: t.id,
|
|
@@ -5085,7 +5094,7 @@ const en = {
|
|
|
5085
5094
|
key: `${i}fi`,
|
|
5086
5095
|
ref: t.wrapRef,
|
|
5087
5096
|
type: "formItem"
|
|
5088
|
-
}]),
|
|
5097
|
+
}]), _({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
5089
5098
|
return a === !0 || X(l) || X(s.show) ? f : this.makeCol(r, i, [f]);
|
|
5090
5099
|
},
|
|
5091
5100
|
isTitle(t) {
|
|
@@ -5094,22 +5103,22 @@ const en = {
|
|
|
5094
5103
|
return !(!e.title && !e.native || X(e.show));
|
|
5095
5104
|
},
|
|
5096
5105
|
makeInfo(t, e, r) {
|
|
5097
|
-
var u, f, p, d,
|
|
5098
|
-
const i =
|
|
5106
|
+
var u, f, p, d, g, y;
|
|
5107
|
+
const i = _({}, t.title), s = _({}, t.info), n = this.options.form, o = this.getSlot("title"), a = [o ? o({
|
|
5099
5108
|
title: (f = (u = r.refRule) == null ? void 0 : u.__$title) == null ? void 0 : f.value,
|
|
5100
5109
|
rule: r.rule,
|
|
5101
5110
|
options: this.options
|
|
5102
5111
|
}) : ((d = (p = r.refRule) == null ? void 0 : p.__$title) == null ? void 0 : d.value) + (n.labelSuffix || n["label-suffix"] || "")];
|
|
5103
5112
|
if (!X(s.show) && (s.info || s.native) && !X(s.icon)) {
|
|
5104
|
-
const
|
|
5113
|
+
const v = {
|
|
5105
5114
|
type: s.type || "poptip",
|
|
5106
5115
|
props: He(s),
|
|
5107
5116
|
key: `${e}pop`,
|
|
5108
5117
|
slot: "label"
|
|
5109
5118
|
};
|
|
5110
|
-
delete
|
|
5119
|
+
delete v.props.icon, delete v.props.show, delete v.props.info, delete v.props.align, delete v.props.native;
|
|
5111
5120
|
const E = "content";
|
|
5112
|
-
s.info && !
|
|
5121
|
+
s.info && !j(v.props, E) && (v.props[E] = (y = (g = r.refRule) == null ? void 0 : g.__$info) == null ? void 0 : y.value), a[s.align !== "left" ? "unshift" : "push"](this.$r(x([s, v]), [
|
|
5113
5122
|
this.$r({
|
|
5114
5123
|
type: "icon",
|
|
5115
5124
|
props: { type: s.icon === !0 ? Ae.infoIcon : s.icon, size: 16 },
|
|
@@ -5162,7 +5171,7 @@ const en = {
|
|
|
5162
5171
|
}, [e]);
|
|
5163
5172
|
},
|
|
5164
5173
|
makeResetBtn() {
|
|
5165
|
-
const t =
|
|
5174
|
+
const t = _({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
|
|
5166
5175
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
5167
5176
|
type: "button",
|
|
5168
5177
|
props: t,
|
|
@@ -5178,7 +5187,7 @@ const en = {
|
|
|
5178
5187
|
}, [e]);
|
|
5179
5188
|
},
|
|
5180
5189
|
makeSubmitBtn() {
|
|
5181
|
-
const t =
|
|
5190
|
+
const t = _({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
|
|
5182
5191
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
5183
5192
|
type: "button",
|
|
5184
5193
|
props: t,
|
|
@@ -5194,7 +5203,7 @@ const en = {
|
|
|
5194
5203
|
key: `${this.key}b1`
|
|
5195
5204
|
}, [e]);
|
|
5196
5205
|
}
|
|
5197
|
-
},
|
|
5206
|
+
}, oe = {}, tn = ["upload", "select", "tree", "checkbox", "autoComplete", "cascader", "colorPicker", "frame", "inputNumber", "radio", "rate", "timePicker", "group"];
|
|
5198
5207
|
function rn(t) {
|
|
5199
5208
|
tn.forEach((e) => {
|
|
5200
5209
|
t[e] = P(e);
|
|
@@ -5232,12 +5241,12 @@ function ln(t) {
|
|
|
5232
5241
|
};
|
|
5233
5242
|
Object.keys(r).reduce((i, s) => (i[s] = P(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;
|
|
5234
5243
|
}
|
|
5235
|
-
rn(
|
|
5236
|
-
nn(
|
|
5237
|
-
sn(
|
|
5238
|
-
an(
|
|
5239
|
-
ln(
|
|
5240
|
-
on(
|
|
5244
|
+
rn(oe);
|
|
5245
|
+
nn(oe);
|
|
5246
|
+
sn(oe);
|
|
5247
|
+
an(oe);
|
|
5248
|
+
ln(oe);
|
|
5249
|
+
on(oe);
|
|
5241
5250
|
function Ot(t, e) {
|
|
5242
5251
|
return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
|
|
5243
5252
|
}
|
|
@@ -5347,7 +5356,7 @@ const Xt = {
|
|
|
5347
5356
|
if (i.required === !1)
|
|
5348
5357
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5349
5358
|
else {
|
|
5350
|
-
const o =
|
|
5359
|
+
const o = _({
|
|
5351
5360
|
required: !0,
|
|
5352
5361
|
validator(l, u, f) {
|
|
5353
5362
|
h.empty(u) ? f(o.message) : f();
|
|
@@ -5375,14 +5384,14 @@ function cn(t) {
|
|
|
5375
5384
|
t.component(e.name, e);
|
|
5376
5385
|
}), t.register(Xt), Xi.forEach((e) => {
|
|
5377
5386
|
t.parser(e);
|
|
5378
|
-
}), Object.keys(
|
|
5379
|
-
t.maker[e] =
|
|
5387
|
+
}), Object.keys(oe).forEach((e) => {
|
|
5388
|
+
t.maker[e] = oe[e];
|
|
5380
5389
|
});
|
|
5381
5390
|
}
|
|
5382
5391
|
function hn() {
|
|
5383
5392
|
return Kt({
|
|
5384
5393
|
ui: "iview",
|
|
5385
|
-
version: "2.7.
|
|
5394
|
+
version: "2.7.16",
|
|
5386
5395
|
manager: en,
|
|
5387
5396
|
install: cn,
|
|
5388
5397
|
extendApi: un,
|