@form-create/view-design 2.7.18 → 2.7.19
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/README.md +1 -1
- package/dist/form-create.esm.js +100 -94
- package/dist/form-create.js +3 -3
- package/dist/form-create.min.js +3 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
**FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。支持6个UI框架,适配移动端,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。**
|
|
26
26
|
|
|
27
|
-
[](https://pro.form-create.com/view)
|
|
27
|
+
[](https://pro.form-create.com/view)
|
|
28
28
|
|
|
29
29
|
## 特点
|
|
30
30
|
- 使用JSON数据生成表单
|
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* FormCreate 低代码表单渲染器
|
|
3
|
-
* @form-create/view-design v2.7.
|
|
3
|
+
* @form-create/view-design v2.7.19
|
|
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 or = Object.defineProperty, ar = Object.defineProperties;
|
|
|
11
11
|
var lr = Object.getOwnPropertyDescriptors;
|
|
12
12
|
var at = Object.getOwnPropertySymbols;
|
|
13
13
|
var ur = Object.prototype.hasOwnProperty, fr = Object.prototype.propertyIsEnumerable;
|
|
14
|
-
var lt = (t, e, r) => e in t ? or(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r,
|
|
14
|
+
var lt = (t, e, r) => e in t ? or(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
|
ur.call(e, r) && lt(t, r, e[r]);
|
|
17
17
|
if (at)
|
|
@@ -111,7 +111,7 @@ const kr = "fcCheckbox", Sr = {
|
|
|
111
111
|
input: this.onInput
|
|
112
112
|
}
|
|
113
113
|
}]), [this.options().map((e, r) => {
|
|
114
|
-
const i =
|
|
114
|
+
const i = _({}, e);
|
|
115
115
|
return delete i.value, t("Checkbox", D([{}, {
|
|
116
116
|
props: i
|
|
117
117
|
}, {
|
|
@@ -469,7 +469,7 @@ function kt(t) {
|
|
|
469
469
|
src: this.previewImage
|
|
470
470
|
}
|
|
471
471
|
})]), e("Modal", D([{}, {
|
|
472
|
-
props:
|
|
472
|
+
props: _({
|
|
473
473
|
width: s,
|
|
474
474
|
title: a
|
|
475
475
|
}, this.modal)
|
|
@@ -563,7 +563,7 @@ const Er = "fcRadio", jr = {
|
|
|
563
563
|
input: this.onInput
|
|
564
564
|
}
|
|
565
565
|
}]), [this.options().map((e, r) => {
|
|
566
|
-
const i =
|
|
566
|
+
const i = _({}, e);
|
|
567
567
|
return delete i.value, t("Radio", D([{}, {
|
|
568
568
|
props: i
|
|
569
569
|
}, {
|
|
@@ -702,7 +702,7 @@ function ft(t) {
|
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
704
|
function ct(t) {
|
|
705
|
-
return q(
|
|
705
|
+
return q(_({}, t), {
|
|
706
706
|
file: t,
|
|
707
707
|
value: t
|
|
708
708
|
});
|
|
@@ -958,7 +958,7 @@ function C() {
|
|
|
958
958
|
return Br.apply(this, arguments);
|
|
959
959
|
}
|
|
960
960
|
function We(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
|
function ne(t, e) {
|
|
964
964
|
var r = null;
|
|
@@ -1199,7 +1199,7 @@ const Gr = "fcGroup", Hr = {
|
|
|
1199
1199
|
if (i.filter((n) => r[n].$f).length !== i.length)
|
|
1200
1200
|
return;
|
|
1201
1201
|
const s = i.map((n) => {
|
|
1202
|
-
const o = t === n ? e :
|
|
1202
|
+
const o = t === n ? e : _({}, this.cacheRule[n].$f.form), a = this.field ? o[this.field] || null : o;
|
|
1203
1203
|
return this.cache(n, a), a;
|
|
1204
1204
|
});
|
|
1205
1205
|
this.input(s);
|
|
@@ -1211,7 +1211,7 @@ const Gr = "fcGroup", Hr = {
|
|
|
1211
1211
|
}), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cache(t, e), i && i.coverValue(e || {}));
|
|
1212
1212
|
},
|
|
1213
1213
|
addRule(t, e) {
|
|
1214
|
-
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ?
|
|
1214
|
+
const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? _({}, this.options) : {
|
|
1215
1215
|
submitBtn: !1,
|
|
1216
1216
|
resetBtn: !1
|
|
1217
1217
|
};
|
|
@@ -1421,7 +1421,7 @@ const Gr = "fcGroup", Hr = {
|
|
|
1421
1421
|
submitBtn: !1,
|
|
1422
1422
|
resetBtn: !1
|
|
1423
1423
|
};
|
|
1424
|
-
t.formData =
|
|
1424
|
+
t.formData = _({}, this.value || {}), this.cacheRule = {
|
|
1425
1425
|
rule: this.rule,
|
|
1426
1426
|
options: t
|
|
1427
1427
|
};
|
|
@@ -1475,7 +1475,7 @@ const Gr = "fcGroup", Hr = {
|
|
|
1475
1475
|
if (o.indexOf(u) > -1)
|
|
1476
1476
|
a[u] = x([l[u]], a[u]);
|
|
1477
1477
|
else if (i.indexOf(u) > -1)
|
|
1478
|
-
a[u] =
|
|
1478
|
+
a[u] = _(_({}, a[u]), l[u]);
|
|
1479
1479
|
else if (s.indexOf(u) > -1) {
|
|
1480
1480
|
const f = a[u] instanceof Array ? a[u] : [a[u]], p = l[u] instanceof Array ? l[u] : [l[u]];
|
|
1481
1481
|
a[u] = [...f, ...p];
|
|
@@ -1492,7 +1492,7 @@ const Gr = "fcGroup", Hr = {
|
|
|
1492
1492
|
else
|
|
1493
1493
|
a[u] = l[u];
|
|
1494
1494
|
else
|
|
1495
|
-
i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] =
|
|
1495
|
+
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];
|
|
1496
1496
|
return a;
|
|
1497
1497
|
}, e);
|
|
1498
1498
|
}, Kr = (t, e) => function() {
|
|
@@ -1743,18 +1743,18 @@ function Qr(t, e, r) {
|
|
|
1743
1743
|
unique: 1,
|
|
1744
1744
|
renderRule: [...l.value || []],
|
|
1745
1745
|
updateValue: JSON.stringify(u.value || {})
|
|
1746
|
-
}), g = new t(n), y = g.api(),
|
|
1746
|
+
}), g = new t(n), y = g.api(), v = p.value, E = () => {
|
|
1747
1747
|
if (o) {
|
|
1748
1748
|
const k = Ee(n, o);
|
|
1749
1749
|
if (k) {
|
|
1750
1750
|
let S;
|
|
1751
|
-
|
|
1751
|
+
v ? (S = H(k.getSubForm()), S.push(y)) : S = y, k.subForm(S);
|
|
1752
1752
|
}
|
|
1753
1753
|
}
|
|
1754
1754
|
}, Y = () => {
|
|
1755
1755
|
const k = Ee(n, o);
|
|
1756
1756
|
if (k)
|
|
1757
|
-
if (
|
|
1757
|
+
if (v) {
|
|
1758
1758
|
const S = H(k.getSubForm()), N = S.indexOf(y);
|
|
1759
1759
|
N > -1 && S.splice(N, 1);
|
|
1760
1760
|
} else
|
|
@@ -1805,7 +1805,7 @@ function Qr(t, e, r) {
|
|
|
1805
1805
|
y.clearValidateState();
|
|
1806
1806
|
});
|
|
1807
1807
|
});
|
|
1808
|
-
}, { flush: "sync" }), q(
|
|
1808
|
+
}, { flush: "sync" }), q(_({
|
|
1809
1809
|
fc: me(g),
|
|
1810
1810
|
parent: o && me(o),
|
|
1811
1811
|
top: me(a),
|
|
@@ -1933,7 +1933,7 @@ function Ht(t) {
|
|
|
1933
1933
|
}
|
|
1934
1934
|
function yt(t, e, r) {
|
|
1935
1935
|
return new Promise((i, s) => {
|
|
1936
|
-
(e || Ht)(q(
|
|
1936
|
+
(e || Ht)(q(_({}, t), {
|
|
1937
1937
|
onSuccess(n) {
|
|
1938
1938
|
let o = (l) => l;
|
|
1939
1939
|
const a = W(t.parse);
|
|
@@ -1955,7 +1955,7 @@ function ri(t) {
|
|
|
1955
1955
|
return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
|
|
1956
1956
|
}
|
|
1957
1957
|
function r(n, o, a) {
|
|
1958
|
-
h.Undef(n) ? n = Object.keys(
|
|
1958
|
+
h.Undef(n) ? n = Object.keys(_(_({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
|
|
1959
1959
|
const u = t.fieldCtx[l] || t.nameCtx[l];
|
|
1960
1960
|
u && u.forEach((f) => {
|
|
1961
1961
|
F(f.rule, o, a), t.$render.clearCache(f);
|
|
@@ -2028,7 +2028,7 @@ function ri(t) {
|
|
|
2028
2028
|
}
|
|
2029
2029
|
},
|
|
2030
2030
|
get formulas() {
|
|
2031
|
-
return
|
|
2031
|
+
return _({}, t.fc.formulas);
|
|
2032
2032
|
},
|
|
2033
2033
|
formData(n) {
|
|
2034
2034
|
if (n == null || typeof n == "boolean") {
|
|
@@ -2044,7 +2044,7 @@ function ri(t) {
|
|
|
2044
2044
|
return o ? ve(o.rule.value) : t.options.appendValue !== !1 && j(t.appendData, n) ? ve(t.appendData[n]) : void 0;
|
|
2045
2045
|
},
|
|
2046
2046
|
coverValue(n) {
|
|
2047
|
-
const o =
|
|
2047
|
+
const o = _({}, n || {});
|
|
2048
2048
|
t.deferSyncValue(() => {
|
|
2049
2049
|
t.appendData = {}, s.fields().forEach((a) => {
|
|
2050
2050
|
const l = t.fieldCtx[a];
|
|
@@ -2557,8 +2557,8 @@ function ni(t) {
|
|
|
2557
2557
|
}, (() => {
|
|
2558
2558
|
if (h.Function(n.renderSlots[y]))
|
|
2559
2559
|
return O(() => n.renderSlots[y]());
|
|
2560
|
-
const
|
|
2561
|
-
return this.renderRule(
|
|
2560
|
+
const v = this.parseSide(n.renderSlots[y], e);
|
|
2561
|
+
return this.renderRule(v);
|
|
2562
2562
|
})()));
|
|
2563
2563
|
});
|
|
2564
2564
|
const d = this.getTypeSlot(e);
|
|
@@ -2630,8 +2630,8 @@ function ni(t) {
|
|
|
2630
2630
|
preview: e.prop.preview,
|
|
2631
2631
|
options: e.prop.options,
|
|
2632
2632
|
prop: function() {
|
|
2633
|
-
const n =
|
|
2634
|
-
return n.on = n.on ?
|
|
2633
|
+
const n = _({}, e.prop);
|
|
2634
|
+
return n.on = n.on ? _({}, n.on) : {}, delete n.model, n;
|
|
2635
2635
|
}(),
|
|
2636
2636
|
children: e.loadChildrenPending()
|
|
2637
2637
|
};
|
|
@@ -2642,7 +2642,7 @@ function ni(t) {
|
|
|
2642
2642
|
ctxProp(e) {
|
|
2643
2643
|
const { ref: r, key: i, rule: s } = e;
|
|
2644
2644
|
this.$manager.mergeProp(e), e.parser.mergeProp(e);
|
|
2645
|
-
const n =
|
|
2645
|
+
const n = _({}, e.prop.on || {}), o = {};
|
|
2646
2646
|
Object.keys(n).forEach((l) => {
|
|
2647
2647
|
if (l.indexOf("native.") === 0)
|
|
2648
2648
|
o[l.replace("native.", "")] = n[l], delete n[l];
|
|
@@ -2748,7 +2748,7 @@ function ni(t) {
|
|
|
2748
2748
|
h.trueArray(e.children) && e.children.forEach((a) => {
|
|
2749
2749
|
a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
|
|
2750
2750
|
});
|
|
2751
|
-
const o =
|
|
2751
|
+
const o = _({}, e);
|
|
2752
2752
|
return delete o.type, delete o.is, this.vNode.make(s, o, n.mergeBag(r).getSlots());
|
|
2753
2753
|
}
|
|
2754
2754
|
});
|
|
@@ -2805,14 +2805,14 @@ function oi(t) {
|
|
|
2805
2805
|
let p, d = n || o || a;
|
|
2806
2806
|
if (h.Object(f) && (p = f.inject, f = f.name, d = f.prefix || d), d) {
|
|
2807
2807
|
r || (d = `native-${d}`);
|
|
2808
|
-
const g = $e(`${d}-${f}`), y = (...
|
|
2809
|
-
this.vm.$emit(g, ...
|
|
2808
|
+
const g = $e(`${d}-${f}`), y = (...v) => {
|
|
2809
|
+
this.vm.$emit(g, ...v), this.vm.$emit("emit-event", g, ...v), this.bus.$emit(g, ...v);
|
|
2810
2810
|
};
|
|
2811
2811
|
if (y.__emit = !0, !p && l === !1)
|
|
2812
2812
|
i[f] = y;
|
|
2813
2813
|
else {
|
|
2814
|
-
let
|
|
2815
|
-
i[f] = h.Undef(
|
|
2814
|
+
let v = p || l || this.options.injectEvent;
|
|
2815
|
+
i[f] = h.Undef(v) ? y : this.inject(s, y, v);
|
|
2816
2816
|
}
|
|
2817
2817
|
}
|
|
2818
2818
|
}), e.computed[r ? "on" : "nativeOn"] = i, i;
|
|
@@ -2955,7 +2955,7 @@ function Jt(t, e, r) {
|
|
|
2955
2955
|
parent: null,
|
|
2956
2956
|
group: e.subRule ? this : null,
|
|
2957
2957
|
cacheConfig: null,
|
|
2958
|
-
prop:
|
|
2958
|
+
prop: _({}, e),
|
|
2959
2959
|
computed: {},
|
|
2960
2960
|
payload: {},
|
|
2961
2961
|
refRule: {},
|
|
@@ -3046,7 +3046,7 @@ C(Jt.prototype, {
|
|
|
3046
3046
|
},
|
|
3047
3047
|
initProp() {
|
|
3048
3048
|
var e, r;
|
|
3049
|
-
const t =
|
|
3049
|
+
const t = _({}, this.rule);
|
|
3050
3050
|
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 || []];
|
|
3051
3051
|
},
|
|
3052
3052
|
initNone() {
|
|
@@ -3204,9 +3204,9 @@ function ci(t) {
|
|
|
3204
3204
|
const E = i(a);
|
|
3205
3205
|
E > -1 || !a ? this.sort.splice(E + 1, 0, f.id) : this.sort.push(f.id);
|
|
3206
3206
|
}
|
|
3207
|
-
const
|
|
3208
|
-
return f.updated || (f.updated = !0, h.Function(
|
|
3209
|
-
this.refreshUpdate(f,
|
|
3207
|
+
const v = f.rule;
|
|
3208
|
+
return f.updated || (f.updated = !0, h.Function(v.update) && this.bus.$once("load-end", () => {
|
|
3209
|
+
this.refreshUpdate(f, v.value, "init");
|
|
3210
3210
|
}), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
|
|
3211
3211
|
}).filter((o) => !!o);
|
|
3212
3212
|
r && (r.children = n);
|
|
@@ -3222,7 +3222,7 @@ function ci(t) {
|
|
|
3222
3222
|
return (ce[l.condition || "=="] || ce["=="])(p, l.value);
|
|
3223
3223
|
};
|
|
3224
3224
|
if (!h.trueArray(l.rule)) continue;
|
|
3225
|
-
const f = q(
|
|
3225
|
+
const f = q(_({}, l), {
|
|
3226
3226
|
valid: O(() => u(e.rule.value, s)),
|
|
3227
3227
|
ctrl: pi(e, l.rule),
|
|
3228
3228
|
isHidden: h.String(l.rule[0])
|
|
@@ -3240,27 +3240,27 @@ function ci(t) {
|
|
|
3240
3240
|
children: u,
|
|
3241
3241
|
valid: l
|
|
3242
3242
|
}) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
|
|
3243
|
-
y === "disabled" || y === "enabled" ? this.api.disabled(!l, u) : y === "display" || y === "show" ? this.api.display(l, u) : y === "required" ? (u.forEach((
|
|
3244
|
-
this.api.setEffect(
|
|
3243
|
+
y === "disabled" || y === "enabled" ? this.api.disabled(!l, u) : y === "display" || y === "show" ? this.api.display(l, u) : y === "required" ? (u.forEach((v) => {
|
|
3244
|
+
this.api.setEffect(v, "required", l);
|
|
3245
3245
|
}), l || this.api.clearValidateState(u)) : y === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
|
|
3246
3246
|
});
|
|
3247
3247
|
return;
|
|
3248
3248
|
}
|
|
3249
3249
|
if (l) {
|
|
3250
3250
|
o = !0;
|
|
3251
|
-
const
|
|
3251
|
+
const v = {
|
|
3252
3252
|
type: "fragment",
|
|
3253
3253
|
native: !0,
|
|
3254
3254
|
__ctrl: !0,
|
|
3255
3255
|
children: u
|
|
3256
3256
|
};
|
|
3257
|
-
e.ctrlRule.push(
|
|
3258
|
-
f ? s.prepend(
|
|
3257
|
+
e.ctrlRule.push(v), this.bus.$once("load-start", () => {
|
|
3258
|
+
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);
|
|
3259
3259
|
});
|
|
3260
3260
|
} else {
|
|
3261
3261
|
e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
|
|
3262
|
-
const
|
|
3263
|
-
|
|
3262
|
+
const v = Z(g);
|
|
3263
|
+
v && v.rm();
|
|
3264
3264
|
}
|
|
3265
3265
|
});
|
|
3266
3266
|
}), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
|
|
@@ -3274,7 +3274,7 @@ function ci(t) {
|
|
|
3274
3274
|
},
|
|
3275
3275
|
_reloadRule(e) {
|
|
3276
3276
|
e || (e = this.rules);
|
|
3277
|
-
const r =
|
|
3277
|
+
const r = _({}, this.ctxs);
|
|
3278
3278
|
this.clearNextTick(), this.initData(e), this.fc.rules = e, this.deferSyncValue(() => {
|
|
3279
3279
|
this.bus.$once("load-end", () => {
|
|
3280
3280
|
Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
|
|
@@ -3524,7 +3524,7 @@ function yi(t) {
|
|
|
3524
3524
|
return n ? this.api.t(n[1], { title: (a = (o = e.refRule) == null ? void 0 : o.__$title) == null ? void 0 : a.value }) : s;
|
|
3525
3525
|
};
|
|
3526
3526
|
return H(e.rule.validate).map((s) => {
|
|
3527
|
-
const n =
|
|
3527
|
+
const n = _({}, s);
|
|
3528
3528
|
if (n.message && (n.message = i(n.message)), h.Function(n.validator)) {
|
|
3529
3529
|
const o = e;
|
|
3530
3530
|
n.validator = function(...a) {
|
|
@@ -3539,7 +3539,7 @@ function yi(t) {
|
|
|
3539
3539
|
}
|
|
3540
3540
|
if (n.adapter) {
|
|
3541
3541
|
if (typeof n.error == "object") {
|
|
3542
|
-
const o =
|
|
3542
|
+
const o = _({}, n.error);
|
|
3543
3543
|
Object.keys(o).forEach((a) => {
|
|
3544
3544
|
o[a] = i(o[a]);
|
|
3545
3545
|
}), n.error = o;
|
|
@@ -3598,7 +3598,7 @@ function yi(t) {
|
|
|
3598
3598
|
return this.$manager.adapterValidate({
|
|
3599
3599
|
required: e.required,
|
|
3600
3600
|
message: e.message,
|
|
3601
|
-
|
|
3601
|
+
trigger: e.trigger
|
|
3602
3602
|
}, i);
|
|
3603
3603
|
},
|
|
3604
3604
|
getValidateMessage(e, r) {
|
|
@@ -3697,15 +3697,17 @@ function yi(t) {
|
|
|
3697
3697
|
let u = !0;
|
|
3698
3698
|
for (let f = 0; f < a.group.length; f++) {
|
|
3699
3699
|
const p = a.group[f];
|
|
3700
|
-
let d, g = null;
|
|
3700
|
+
let d, g = null, y = null;
|
|
3701
3701
|
if (p.variable)
|
|
3702
|
-
|
|
3702
|
+
y = this.fc.getLoadData(p.variable);
|
|
3703
3703
|
else if (p.field)
|
|
3704
3704
|
g = pt(p.field || "");
|
|
3705
3705
|
else if (!p.mode)
|
|
3706
3706
|
return !0;
|
|
3707
|
-
|
|
3708
|
-
|
|
3707
|
+
if (!p.variable && !p.field)
|
|
3708
|
+
return !1;
|
|
3709
|
+
let v = p.compare;
|
|
3710
|
+
if (v && (v = pt(v || "")), 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", "$variableVal", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${p.condition}'](${p.variable ? "$variableVal" : g}, ${v || "$val"}); }}}}`).call(this.api.form, ce, y, 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)
|
|
3709
3711
|
return !0;
|
|
3710
3712
|
l || (u = u && d);
|
|
3711
3713
|
}
|
|
@@ -3786,7 +3788,7 @@ function $i(t) {
|
|
|
3786
3788
|
var l, u, f, p;
|
|
3787
3789
|
let s = (u = (l = e.prop) == null ? void 0 : l.hook) == null ? void 0 : u[r], n = (d, g) => {
|
|
3788
3790
|
d && (d = Array.isArray(d) ? d : [d], d.forEach((y) => {
|
|
3789
|
-
O(() => y(q(
|
|
3791
|
+
O(() => y(q(_({}, i || {}), {
|
|
3790
3792
|
self: e.rule,
|
|
3791
3793
|
rule: e.rule,
|
|
3792
3794
|
parent: g == null ? void 0 : g.rule,
|
|
@@ -3864,7 +3866,7 @@ function bi(t) {
|
|
|
3864
3866
|
},
|
|
3865
3867
|
emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
|
|
3866
3868
|
if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
|
|
3867
|
-
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u),
|
|
3869
|
+
const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), _({}, r.effect || {}));
|
|
3868
3870
|
Object.keys(l).forEach((u) => {
|
|
3869
3871
|
const f = this.providers[u];
|
|
3870
3872
|
if (!f || f.input && !i) return;
|
|
@@ -3875,7 +3877,7 @@ function bi(t) {
|
|
|
3875
3877
|
p = s;
|
|
3876
3878
|
else
|
|
3877
3879
|
return;
|
|
3878
|
-
const d =
|
|
3880
|
+
const d = _({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
|
|
3879
3881
|
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]);
|
|
3880
3882
|
});
|
|
3881
3883
|
}
|
|
@@ -3947,7 +3949,7 @@ C(K.prototype, {
|
|
|
3947
3949
|
this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
|
|
3948
3950
|
},
|
|
3949
3951
|
updateAppendData() {
|
|
3950
|
-
this.appendData =
|
|
3952
|
+
this.appendData = _(_(_({}, this.options.formData || {}), this.fc.vm.$props.value || {}), this.appendData);
|
|
3951
3953
|
},
|
|
3952
3954
|
isBreakWatch() {
|
|
3953
3955
|
return this.loading || this.noWatchFn || this.reloading;
|
|
@@ -4145,8 +4147,8 @@ const ki = function(t) {
|
|
|
4145
4147
|
const u = typeof l == "object";
|
|
4146
4148
|
let f = (g) => {
|
|
4147
4149
|
let y = t.t(u ? l.attr : l, u ? l.params : null, g);
|
|
4148
|
-
const
|
|
4149
|
-
a === "child" ?
|
|
4150
|
+
const v = u && l.modify ? i : r.getProp();
|
|
4151
|
+
a === "child" ? v.children ? F(v.children, 0, y) : F(v, "children", [y]) : se(v, a, y), s.sync(i);
|
|
4150
4152
|
}, p = (g) => f(g);
|
|
4151
4153
|
const d = t.watchLoadData(p);
|
|
4152
4154
|
f = ne(f, l.wait || 300), l.watch !== !1 ? o.push(d) : d();
|
|
@@ -4168,7 +4170,7 @@ const ki = function(t) {
|
|
|
4168
4170
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
4169
4171
|
else {
|
|
4170
4172
|
h.Object(i) || (i = { method: i });
|
|
4171
|
-
const s = i.method, n = q(
|
|
4173
|
+
const s = i.method, n = q(_({}, i), {
|
|
4172
4174
|
validator(...o) {
|
|
4173
4175
|
const a = Z(e);
|
|
4174
4176
|
if (a)
|
|
@@ -4212,7 +4214,7 @@ const ki = function(t) {
|
|
|
4212
4214
|
l(p.data);
|
|
4213
4215
|
return;
|
|
4214
4216
|
} else
|
|
4215
|
-
a =
|
|
4217
|
+
a = _(_({}, a), p);
|
|
4216
4218
|
}
|
|
4217
4219
|
const u = a.onError, f = () => {
|
|
4218
4220
|
if (!s.getValue())
|
|
@@ -4221,32 +4223,32 @@ const ki = function(t) {
|
|
|
4221
4223
|
i._fn[s.id] = t.watchLoadData(ne((p, d) => {
|
|
4222
4224
|
if (d && a.watch === !1)
|
|
4223
4225
|
return i._fn[s.id]();
|
|
4224
|
-
const g = t.$handle.loadFetchVar(G(a), p, n), y = q(
|
|
4226
|
+
const g = t.$handle.loadFetchVar(G(a), p, n), y = q(_({
|
|
4225
4227
|
headers: {}
|
|
4226
4228
|
}, g), {
|
|
4227
|
-
onSuccess(
|
|
4229
|
+
onSuccess(v, E) {
|
|
4228
4230
|
if (f()) return;
|
|
4229
4231
|
let Y = (B) => E ? B : j(B, "data") ? B.data : B;
|
|
4230
4232
|
const I = W(g.parse);
|
|
4231
|
-
h.Function(I) ? Y = I : I && h.String(I) && (Y = (B) => L(B, I)), Ae(Y(
|
|
4233
|
+
h.Function(I) ? Y = I : I && h.String(I) && (Y = (B) => L(B, I)), Ae(Y(v, n, o)).then((B) => {
|
|
4232
4234
|
l(B);
|
|
4233
4235
|
});
|
|
4234
4236
|
},
|
|
4235
|
-
onError(
|
|
4236
|
-
l(void 0), !f() && (u || ((E) => Ye(E.message || "fetch fail " + g.action)))(
|
|
4237
|
+
onError(v) {
|
|
4238
|
+
l(void 0), !f() && (u || ((E) => Ye(E.message || "fetch fail " + g.action)))(v, n, o);
|
|
4237
4239
|
}
|
|
4238
4240
|
});
|
|
4239
4241
|
t.$handle.beforeFetch(y, { rule: n, api: o }).then(() => {
|
|
4240
4242
|
if (h.Function(g.action)) {
|
|
4241
|
-
Ae(g.action(n, o)).then((
|
|
4242
|
-
y.onSuccess(
|
|
4243
|
-
}).catch((
|
|
4244
|
-
y.onError(
|
|
4243
|
+
Ae(g.action(n, o)).then((v) => {
|
|
4244
|
+
y.onSuccess(v, !0);
|
|
4245
|
+
}).catch((v) => {
|
|
4246
|
+
y.onError(v);
|
|
4245
4247
|
});
|
|
4246
4248
|
return;
|
|
4247
4249
|
}
|
|
4248
4250
|
O(() => t.create.fetch(y, { inject: s, rule: n, api: o }));
|
|
4249
|
-
}).catch((
|
|
4251
|
+
}).catch((v) => {
|
|
4250
4252
|
});
|
|
4251
4253
|
}, a.wait || 600));
|
|
4252
4254
|
}
|
|
@@ -4440,11 +4442,11 @@ function Xt(t) {
|
|
|
4440
4442
|
[Me.name]: Me
|
|
4441
4443
|
}, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
|
|
4442
4444
|
t.extendApi
|
|
4443
|
-
], u =
|
|
4445
|
+
], u = _({}, Ei), f = ei();
|
|
4444
4446
|
let p = { global: {} };
|
|
4445
4447
|
const d = t.isMobile === !0, g = ie({
|
|
4446
4448
|
$mobile: d
|
|
4447
|
-
}), y = Oi(),
|
|
4449
|
+
}), y = Oi(), v = {}, E = {};
|
|
4448
4450
|
Gi(t.attrs || {});
|
|
4449
4451
|
function Y(c) {
|
|
4450
4452
|
const m = M[c];
|
|
@@ -4462,7 +4464,7 @@ function Xt(t) {
|
|
|
4462
4464
|
}
|
|
4463
4465
|
function he() {
|
|
4464
4466
|
const c = qe(...arguments);
|
|
4465
|
-
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(
|
|
4467
|
+
c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(_({}, c.prop), {
|
|
4466
4468
|
name: c.id
|
|
4467
4469
|
}));
|
|
4468
4470
|
}
|
|
@@ -4502,7 +4504,7 @@ function Xt(t) {
|
|
|
4502
4504
|
}
|
|
4503
4505
|
Re(z, E);
|
|
4504
4506
|
function xt(c) {
|
|
4505
|
-
let m =
|
|
4507
|
+
let m = _({}, t);
|
|
4506
4508
|
return c ? m.inherit = {
|
|
4507
4509
|
components: e,
|
|
4508
4510
|
parsers: r,
|
|
@@ -4511,7 +4513,7 @@ function Xt(t) {
|
|
|
4511
4513
|
providers: u,
|
|
4512
4514
|
useApps: o,
|
|
4513
4515
|
maker: f,
|
|
4514
|
-
formulas:
|
|
4516
|
+
formulas: v,
|
|
4515
4517
|
loadData: g
|
|
4516
4518
|
} : delete m.inherit, Xt(m);
|
|
4517
4519
|
}
|
|
@@ -4519,13 +4521,13 @@ function Xt(t) {
|
|
|
4519
4521
|
s[c] = m;
|
|
4520
4522
|
}
|
|
4521
4523
|
function Yt(c, m) {
|
|
4522
|
-
|
|
4524
|
+
v[c] = m;
|
|
4523
4525
|
}
|
|
4524
4526
|
function er(c, m) {
|
|
4525
4527
|
const $ = n[c] || {}, b = $.parsers || {};
|
|
4526
4528
|
m.parsers && Object.keys(m.parsers).forEach((w) => {
|
|
4527
4529
|
b[w] = Re(m.parsers[w], je);
|
|
4528
|
-
}), m.name = c, n[c] = q(
|
|
4530
|
+
}), m.name = c, n[c] = q(_(_({}, $), m), { parsers: b });
|
|
4529
4531
|
}
|
|
4530
4532
|
function Oe(c) {
|
|
4531
4533
|
c && Object.keys(M).forEach((m) => {
|
|
@@ -4569,7 +4571,7 @@ function Xt(t) {
|
|
|
4569
4571
|
parsers: r,
|
|
4570
4572
|
providers: u,
|
|
4571
4573
|
modelFields: s,
|
|
4572
|
-
formulas:
|
|
4574
|
+
formulas: v,
|
|
4573
4575
|
isMobile: d,
|
|
4574
4576
|
rules: c.$props.rule,
|
|
4575
4577
|
name: c.$props.name || Pe(),
|
|
@@ -4748,7 +4750,7 @@ function Xt(t) {
|
|
|
4748
4750
|
},
|
|
4749
4751
|
initOptions() {
|
|
4750
4752
|
this.options.value = {};
|
|
4751
|
-
let c =
|
|
4753
|
+
let c = _({
|
|
4752
4754
|
formData: {},
|
|
4753
4755
|
submitBtn: {},
|
|
4754
4756
|
resetBtn: {},
|
|
@@ -4761,7 +4763,7 @@ function Xt(t) {
|
|
|
4761
4763
|
this.targetFormDriver("initOptions", c, { api: $, isSubForm: m }), this.updateOptions(c);
|
|
4762
4764
|
},
|
|
4763
4765
|
mergeOptions(c, m, $) {
|
|
4764
|
-
return m =
|
|
4766
|
+
return m = _({}, m || {}), $ && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
|
|
4765
4767
|
delete m[b];
|
|
4766
4768
|
}), m.global && (c.global = Xr(c.global, m.global), delete m.global), this.$handle.$manager.mergeOptions([m], c), c;
|
|
4767
4769
|
},
|
|
@@ -4832,7 +4834,7 @@ function Xt(t) {
|
|
|
4832
4834
|
C(c, {
|
|
4833
4835
|
create: z,
|
|
4834
4836
|
install(m, $) {
|
|
4835
|
-
if (p =
|
|
4837
|
+
if (p = _(_({}, p), $ || {}), m._installedFormCreate === !0) return;
|
|
4836
4838
|
m._installedFormCreate = !0;
|
|
4837
4839
|
const b = function(A, R = {}) {
|
|
4838
4840
|
return z(A, R, this);
|
|
@@ -4847,7 +4849,7 @@ function Xt(t) {
|
|
|
4847
4849
|
}
|
|
4848
4850
|
if (ot(E), nr(E), Fe("$cookie", Li), Fe("$localStorage", Bi), Fe("$sessionStorage", Ti), y.use({ fragment: "fcFragment" }), t.install && z.use(t), de(Ai), t.inherit) {
|
|
4849
4851
|
const c = t.inherit;
|
|
4850
|
-
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(
|
|
4852
|
+
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);
|
|
4851
4853
|
}
|
|
4852
4854
|
const ke = S();
|
|
4853
4855
|
return Re(ke, E), Object.defineProperties(ke, {
|
|
@@ -5031,7 +5033,7 @@ function tn(t, e) {
|
|
|
5031
5033
|
j(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
|
|
5032
5034
|
}
|
|
5033
5035
|
function ze(t) {
|
|
5034
|
-
const e =
|
|
5036
|
+
const e = _({}, t);
|
|
5035
5037
|
return delete e.children, e;
|
|
5036
5038
|
}
|
|
5037
5039
|
const rn = {
|
|
@@ -5079,7 +5081,7 @@ const rn = {
|
|
|
5079
5081
|
update() {
|
|
5080
5082
|
const t = this.options.form;
|
|
5081
5083
|
this.rule = {
|
|
5082
|
-
props:
|
|
5084
|
+
props: _({}, t),
|
|
5083
5085
|
nativeOn: {
|
|
5084
5086
|
submit: (e) => {
|
|
5085
5087
|
e.preventDefault();
|
|
@@ -5102,7 +5104,7 @@ const rn = {
|
|
|
5102
5104
|
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;
|
|
5103
5105
|
delete r.wrap.class, delete r.wrap.title;
|
|
5104
5106
|
const f = X(r.wrap.show) ? e : this.$r(x([r.wrap, {
|
|
5105
|
-
props: q(
|
|
5107
|
+
props: q(_({
|
|
5106
5108
|
labelWidth: o
|
|
5107
5109
|
}, ze(r.wrap || {})), {
|
|
5108
5110
|
prop: t.id,
|
|
@@ -5112,7 +5114,7 @@ const rn = {
|
|
|
5112
5114
|
key: `${i}fi`,
|
|
5113
5115
|
ref: t.wrapRef,
|
|
5114
5116
|
type: "formItem"
|
|
5115
|
-
}]),
|
|
5117
|
+
}]), _({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
|
|
5116
5118
|
return a === !0 || X(l) || X(s.show) ? f : this.makeCol(r, i, [f]);
|
|
5117
5119
|
},
|
|
5118
5120
|
isTitle(t) {
|
|
@@ -5122,21 +5124,21 @@ const rn = {
|
|
|
5122
5124
|
},
|
|
5123
5125
|
makeInfo(t, e, r) {
|
|
5124
5126
|
var u, f, p, d, g, y;
|
|
5125
|
-
const i =
|
|
5127
|
+
const i = _({}, t.title), s = _({}, t.info), n = this.options.form, o = this.getSlot("title"), a = [o ? o({
|
|
5126
5128
|
title: (f = (u = r.refRule) == null ? void 0 : u.__$title) == null ? void 0 : f.value,
|
|
5127
5129
|
rule: r.rule,
|
|
5128
5130
|
options: this.options
|
|
5129
5131
|
}) : ((d = (p = r.refRule) == null ? void 0 : p.__$title) == null ? void 0 : d.value) + (n.labelSuffix || n["label-suffix"] || "")];
|
|
5130
5132
|
if (!X(s.show) && (s.info || s.native) && !X(s.icon)) {
|
|
5131
|
-
const
|
|
5133
|
+
const v = {
|
|
5132
5134
|
type: s.type || "poptip",
|
|
5133
5135
|
props: ze(s),
|
|
5134
5136
|
key: `${e}pop`,
|
|
5135
5137
|
slot: "label"
|
|
5136
5138
|
};
|
|
5137
|
-
delete
|
|
5139
|
+
delete v.props.icon, delete v.props.show, delete v.props.info, delete v.props.align, delete v.props.native;
|
|
5138
5140
|
const E = "content";
|
|
5139
|
-
s.info && !j(
|
|
5141
|
+
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]), [
|
|
5140
5142
|
this.$r({
|
|
5141
5143
|
type: "icon",
|
|
5142
5144
|
props: { type: s.icon === !0 ? Ie.infoIcon : s.icon, size: 16 },
|
|
@@ -5189,7 +5191,7 @@ const rn = {
|
|
|
5189
5191
|
}, [e]);
|
|
5190
5192
|
},
|
|
5191
5193
|
makeResetBtn() {
|
|
5192
|
-
const t =
|
|
5194
|
+
const t = _({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
|
|
5193
5195
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
5194
5196
|
type: "button",
|
|
5195
5197
|
props: t,
|
|
@@ -5205,7 +5207,7 @@ const rn = {
|
|
|
5205
5207
|
}, [e]);
|
|
5206
5208
|
},
|
|
5207
5209
|
makeSubmitBtn() {
|
|
5208
|
-
const t =
|
|
5210
|
+
const t = _({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
|
|
5209
5211
|
return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
|
|
5210
5212
|
type: "button",
|
|
5211
5213
|
props: t,
|
|
@@ -5280,7 +5282,11 @@ function cn(t, e) {
|
|
|
5280
5282
|
},
|
|
5281
5283
|
validate(r) {
|
|
5282
5284
|
return new Promise((i, s) => {
|
|
5283
|
-
const n = t.children, o = [
|
|
5285
|
+
const n = t.children, o = [new Promise((a, l) => {
|
|
5286
|
+
e.$manager.validate().then((u) => {
|
|
5287
|
+
u ? a(u) : l();
|
|
5288
|
+
});
|
|
5289
|
+
})];
|
|
5284
5290
|
n.filter((a) => !a.isScope).forEach((a) => {
|
|
5285
5291
|
o.push(a.validate());
|
|
5286
5292
|
}), Promise.all(o).then(() => {
|
|
@@ -5374,7 +5380,7 @@ const Zt = {
|
|
|
5374
5380
|
if (i.required === !1)
|
|
5375
5381
|
t.clearProp(), r.clearValidateState([e.field]);
|
|
5376
5382
|
else {
|
|
5377
|
-
const o =
|
|
5383
|
+
const o = _({
|
|
5378
5384
|
required: !0,
|
|
5379
5385
|
validator(l, u, f) {
|
|
5380
5386
|
h.empty(u) ? f(o.message) : f();
|
|
@@ -5409,7 +5415,7 @@ function dn(t) {
|
|
|
5409
5415
|
function pn() {
|
|
5410
5416
|
return Xt({
|
|
5411
5417
|
ui: "view-design",
|
|
5412
|
-
version: "2.7.
|
|
5418
|
+
version: "2.7.19",
|
|
5413
5419
|
manager: rn,
|
|
5414
5420
|
install: dn,
|
|
5415
5421
|
extendApi: cn,
|