fj-form 0.0.28 → 0.0.30
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/fj-form.css +1 -1
- package/dist/fj-form.js +215 -214
- package/dist/fj-form.umd.cjs +5 -5
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/fj-form.js
CHANGED
|
@@ -240,12 +240,12 @@ var Er = typeof exports == "object" && exports && !exports.nodeType && exports,
|
|
|
240
240
|
})(), En = Ue && Ue.isTypedArray, Ka = En ? on(En) : Wa, Ga = Object.prototype, Ya = Ga.hasOwnProperty;
|
|
241
241
|
function Fr(e, t) {
|
|
242
242
|
var n = we(e), r = !n && Sr(e), o = !n && !r && Cr(e), i = !n && !r && !o && Ka(e), a = n || r || o || i, s = a ? pa(e.length, String) : [], l = s.length;
|
|
243
|
-
for (var
|
|
244
|
-
(t || Ya.call(e,
|
|
245
|
-
(
|
|
246
|
-
o && (
|
|
247
|
-
i && (
|
|
248
|
-
en(
|
|
243
|
+
for (var f in e)
|
|
244
|
+
(t || Ya.call(e, f)) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
245
|
+
(f == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
246
|
+
o && (f == "offset" || f == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
247
|
+
i && (f == "buffer" || f == "byteLength" || f == "byteOffset") || // Skip index properties.
|
|
248
|
+
en(f, l))) && s.push(f);
|
|
249
249
|
return s;
|
|
250
250
|
}
|
|
251
251
|
function jr(e, t) {
|
|
@@ -649,13 +649,13 @@ var zn = Ue && Ue.isSet, Rs = zn ? on(zn) : Bs, zs = 1, Ws = 2, Us = 4, qr = "[o
|
|
|
649
649
|
P[qr] = P[Ks] = P[ol] = P[al] = P[Gs] = P[Ys] = P[il] = P[sl] = P[ll] = P[ul] = P[cl] = P[Zs] = P[Xs] = P[Br] = P[Qs] = P[el] = P[tl] = P[nl] = P[dl] = P[fl] = P[pl] = P[ml] = !0;
|
|
650
650
|
P[Hs] = P[Dr] = P[rl] = !1;
|
|
651
651
|
function Qe(e, t, n, r, o, i) {
|
|
652
|
-
var a, s = t & zs, l = t & Ws,
|
|
652
|
+
var a, s = t & zs, l = t & Ws, f = t & Us;
|
|
653
653
|
if (a !== void 0)
|
|
654
654
|
return a;
|
|
655
655
|
if (!Ce(e))
|
|
656
656
|
return e;
|
|
657
|
-
var
|
|
658
|
-
if (
|
|
657
|
+
var p = we(e);
|
|
658
|
+
if (p) {
|
|
659
659
|
if (a = cs(e), !s)
|
|
660
660
|
return aa(e, a);
|
|
661
661
|
} else {
|
|
@@ -680,7 +680,7 @@ function Qe(e, t, n, r, o, i) {
|
|
|
680
680
|
}) : qs(e) && e.forEach(function(v, u) {
|
|
681
681
|
a.set(u, Qe(v, t, n, u, e, i));
|
|
682
682
|
});
|
|
683
|
-
var O =
|
|
683
|
+
var O = f ? l ? ts : es : l ? sn : an, m = p ? void 0 : O(e);
|
|
684
684
|
return ia(m || e, function(v, u) {
|
|
685
685
|
m && (u = v, v = e[u]), tn(a, u, Qe(v, t, n, u, e, i));
|
|
686
686
|
}), a;
|
|
@@ -722,14 +722,14 @@ function $l(e, t, n, r) {
|
|
|
722
722
|
return e;
|
|
723
723
|
t = un(t, e);
|
|
724
724
|
for (var o = -1, i = t.length, a = i - 1, s = e; s != null && ++o < i; ) {
|
|
725
|
-
var l = cn(t[o]),
|
|
725
|
+
var l = cn(t[o]), f = n;
|
|
726
726
|
if (l === "__proto__" || l === "constructor" || l === "prototype")
|
|
727
727
|
return e;
|
|
728
728
|
if (o != a) {
|
|
729
|
-
var
|
|
730
|
-
|
|
729
|
+
var p = s[l];
|
|
730
|
+
f = void 0, f === void 0 && (f = Ce(p) ? p : en(t[o + 1]) ? [] : {});
|
|
731
731
|
}
|
|
732
|
-
tn(s, l,
|
|
732
|
+
tn(s, l, f), s = s[l];
|
|
733
733
|
}
|
|
734
734
|
return e;
|
|
735
735
|
}
|
|
@@ -771,12 +771,12 @@ function Vl(e, t = {}) {
|
|
|
771
771
|
clearTimeout(s), o(), o = Bt;
|
|
772
772
|
};
|
|
773
773
|
return (s) => {
|
|
774
|
-
const l = it(e),
|
|
775
|
-
return n && i(n), l <= 0 ||
|
|
776
|
-
o = t.rejectOnCancel ? c :
|
|
777
|
-
n && i(n), r = null,
|
|
778
|
-
},
|
|
779
|
-
r && i(r), r = null,
|
|
774
|
+
const l = it(e), f = it(t.maxWait);
|
|
775
|
+
return n && i(n), l <= 0 || f !== void 0 && f <= 0 ? (r && (i(r), r = null), Promise.resolve(s())) : new Promise((p, c) => {
|
|
776
|
+
o = t.rejectOnCancel ? c : p, f && !r && (r = setTimeout(() => {
|
|
777
|
+
n && i(n), r = null, p(s());
|
|
778
|
+
}, f)), n = setTimeout(() => {
|
|
779
|
+
r && i(r), r = null, p(s());
|
|
780
780
|
}, l);
|
|
781
781
|
});
|
|
782
782
|
};
|
|
@@ -804,9 +804,9 @@ function Nl(e, t, n = {}) {
|
|
|
804
804
|
function s() {
|
|
805
805
|
o.value = !1, a();
|
|
806
806
|
}
|
|
807
|
-
function l(...
|
|
807
|
+
function l(...f) {
|
|
808
808
|
a(), o.value = !0, i = setTimeout(() => {
|
|
809
|
-
o.value = !1, i = null, e(...
|
|
809
|
+
o.value = !1, i = null, e(...f);
|
|
810
810
|
}, it(t));
|
|
811
811
|
}
|
|
812
812
|
return r && (o.value = !0, Pe && l()), pn(s), {
|
|
@@ -827,22 +827,22 @@ function Ll(...e) {
|
|
|
827
827
|
return Bt;
|
|
828
828
|
Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]);
|
|
829
829
|
const i = [], a = () => {
|
|
830
|
-
i.forEach((
|
|
831
|
-
}, s = (
|
|
830
|
+
i.forEach((p) => p()), i.length = 0;
|
|
831
|
+
}, s = (p, c, h, T) => (p.addEventListener(c, h, T), () => p.removeEventListener(c, h, T)), l = le(
|
|
832
832
|
() => [Rt(t), it(o)],
|
|
833
|
-
([
|
|
834
|
-
if (a(), !
|
|
833
|
+
([p, c]) => {
|
|
834
|
+
if (a(), !p)
|
|
835
835
|
return;
|
|
836
836
|
const h = Fl(c) ? { ...c } : c;
|
|
837
837
|
i.push(
|
|
838
|
-
...n.flatMap((T) => r.map((O) => s(
|
|
838
|
+
...n.flatMap((T) => r.map((O) => s(p, T, O, h)))
|
|
839
839
|
);
|
|
840
840
|
},
|
|
841
841
|
{ immediate: !0, flush: "post" }
|
|
842
|
-
),
|
|
842
|
+
), f = () => {
|
|
843
843
|
l(), a();
|
|
844
844
|
};
|
|
845
|
-
return pn(
|
|
845
|
+
return pn(f), f;
|
|
846
846
|
}
|
|
847
847
|
function kl() {
|
|
848
848
|
const e = A(!1), t = ge();
|
|
@@ -859,7 +859,7 @@ function zr(e, t, n = {}) {
|
|
|
859
859
|
let i;
|
|
860
860
|
const a = Ml(() => r && "ResizeObserver" in r), s = () => {
|
|
861
861
|
i && (i.disconnect(), i = void 0);
|
|
862
|
-
}, l = y(() => Array.isArray(e) ? e.map((c) => Rt(c)) : [Rt(e)]),
|
|
862
|
+
}, l = y(() => Array.isArray(e) ? e.map((c) => Rt(c)) : [Rt(e)]), f = le(
|
|
863
863
|
l,
|
|
864
864
|
(c) => {
|
|
865
865
|
if (s(), a.value && r) {
|
|
@@ -869,12 +869,12 @@ function zr(e, t, n = {}) {
|
|
|
869
869
|
}
|
|
870
870
|
},
|
|
871
871
|
{ immediate: !0, flush: "post" }
|
|
872
|
-
),
|
|
873
|
-
s(),
|
|
872
|
+
), p = () => {
|
|
873
|
+
s(), f();
|
|
874
874
|
};
|
|
875
|
-
return pn(
|
|
875
|
+
return pn(p), {
|
|
876
876
|
isSupported: a,
|
|
877
|
-
stop:
|
|
877
|
+
stop: p
|
|
878
878
|
};
|
|
879
879
|
}
|
|
880
880
|
class Wr extends Error {
|
|
@@ -1124,17 +1124,17 @@ const Rl = (e) => (t, n) => zl(t, n, _(e)), zl = (e, t, n) => Vr(n, e, e).replac
|
|
|
1124
1124
|
const { values: n, required: r, default: o, type: i, validator: a } = e, l = {
|
|
1125
1125
|
type: i,
|
|
1126
1126
|
required: !!r,
|
|
1127
|
-
validator: n || a ? (
|
|
1128
|
-
let
|
|
1129
|
-
if (n && (c = Array.from(n), Nt(e, "default") && c.push(o),
|
|
1127
|
+
validator: n || a ? (f) => {
|
|
1128
|
+
let p = !1, c = [];
|
|
1129
|
+
if (n && (c = Array.from(n), Nt(e, "default") && c.push(o), p || (p = c.includes(f))), a && (p || (p = a(f))), !p && c.length > 0) {
|
|
1130
1130
|
const h = [...new Set(c)].map((T) => JSON.stringify(T)).join(", ");
|
|
1131
1131
|
To(
|
|
1132
1132
|
`Invalid prop: validation failed${t ? ` for prop "${t}"` : ""}. Expected one of [${h}], got value ${JSON.stringify(
|
|
1133
|
-
|
|
1133
|
+
f
|
|
1134
1134
|
)}.`
|
|
1135
1135
|
);
|
|
1136
1136
|
}
|
|
1137
|
-
return
|
|
1137
|
+
return p;
|
|
1138
1138
|
} : void 0,
|
|
1139
1139
|
[Yr]: !0
|
|
1140
1140
|
};
|
|
@@ -1616,13 +1616,13 @@ const Fu = ct(Eu), ju = ce({
|
|
|
1616
1616
|
return n.value && (a.paddingLeft = a.paddingRight = `${n.value / 2}px`), a;
|
|
1617
1617
|
}), i = y(() => {
|
|
1618
1618
|
const a = [];
|
|
1619
|
-
return ["span", "offset", "pull", "push"].forEach((
|
|
1620
|
-
const
|
|
1621
|
-
me(
|
|
1622
|
-
}), ["xs", "sm", "md", "lg", "xl"].forEach((
|
|
1623
|
-
me(t[
|
|
1619
|
+
return ["span", "offset", "pull", "push"].forEach((f) => {
|
|
1620
|
+
const p = t[f];
|
|
1621
|
+
me(p) && (f === "span" ? a.push(r.b(`${t[f]}`)) : p > 0 && a.push(r.b(`${f}-${t[f]}`)));
|
|
1622
|
+
}), ["xs", "sm", "md", "lg", "xl"].forEach((f) => {
|
|
1623
|
+
me(t[f]) ? a.push(r.b(`${f}-${t[f]}`)) : Xt(t[f]) && Object.entries(t[f]).forEach(([p, c]) => {
|
|
1624
1624
|
a.push(
|
|
1625
|
-
|
|
1625
|
+
p !== "span" ? r.b(`${f}-${p}-${c}`) : r.b(`${f}-${c}`)
|
|
1626
1626
|
);
|
|
1627
1627
|
});
|
|
1628
1628
|
}), n.value && a.push(r.is("guttered")), [r.b(), a];
|
|
@@ -1784,7 +1784,7 @@ const ft = (e, t) => {
|
|
|
1784
1784
|
props: Lu,
|
|
1785
1785
|
emits: ku,
|
|
1786
1786
|
setup(e, { expose: t, emit: n }) {
|
|
1787
|
-
const r = e, o = n, i = A(), a = At([]), s = Qr(), l = _e("form"),
|
|
1787
|
+
const r = e, o = n, i = A(), a = At([]), s = Qr(), l = _e("form"), f = y(() => {
|
|
1788
1788
|
const { labelPosition: w, inline: S } = r;
|
|
1789
1789
|
return [
|
|
1790
1790
|
l.b(),
|
|
@@ -1794,7 +1794,7 @@ const ft = (e, t) => {
|
|
|
1794
1794
|
[l.m("inline")]: S
|
|
1795
1795
|
}
|
|
1796
1796
|
];
|
|
1797
|
-
}),
|
|
1797
|
+
}), p = (w) => ft(a, [w])[0], c = (w) => {
|
|
1798
1798
|
a.push(w);
|
|
1799
1799
|
}, h = (w) => {
|
|
1800
1800
|
w.prop && a.splice(a.indexOf(w), 1);
|
|
@@ -1832,7 +1832,7 @@ const ft = (e, t) => {
|
|
|
1832
1832
|
return [];
|
|
1833
1833
|
const S = ft(a, w);
|
|
1834
1834
|
return S.length ? S : (te(qe, "please pass correct props!"), []);
|
|
1835
|
-
},
|
|
1835
|
+
}, d = async (w) => b(void 0, w), g = async (w = []) => {
|
|
1836
1836
|
if (!v.value)
|
|
1837
1837
|
return !1;
|
|
1838
1838
|
const S = u(w);
|
|
@@ -1866,13 +1866,13 @@ const ft = (e, t) => {
|
|
|
1866
1866
|
}
|
|
1867
1867
|
}, F = (w) => {
|
|
1868
1868
|
var S;
|
|
1869
|
-
const j =
|
|
1869
|
+
const j = p(w);
|
|
1870
1870
|
j && ((S = j.$el) == null || S.scrollIntoView(r.scrollIntoViewOptions));
|
|
1871
1871
|
};
|
|
1872
1872
|
return le(
|
|
1873
1873
|
() => r.rules,
|
|
1874
1874
|
() => {
|
|
1875
|
-
r.validateOnRuleChange &&
|
|
1875
|
+
r.validateOnRuleChange && d().catch((w) => te(w));
|
|
1876
1876
|
},
|
|
1877
1877
|
{ deep: !0, flush: "post" }
|
|
1878
1878
|
), wt(
|
|
@@ -1883,19 +1883,19 @@ const ft = (e, t) => {
|
|
|
1883
1883
|
resetFields: O,
|
|
1884
1884
|
clearValidate: m,
|
|
1885
1885
|
validateField: b,
|
|
1886
|
-
getField:
|
|
1886
|
+
getField: p,
|
|
1887
1887
|
addField: c,
|
|
1888
1888
|
removeField: h,
|
|
1889
1889
|
setInitialValues: T,
|
|
1890
1890
|
...qu()
|
|
1891
1891
|
})
|
|
1892
1892
|
), t({
|
|
1893
|
-
validate:
|
|
1893
|
+
validate: d,
|
|
1894
1894
|
validateField: b,
|
|
1895
1895
|
resetFields: O,
|
|
1896
1896
|
clearValidate: m,
|
|
1897
1897
|
scrollToField: F,
|
|
1898
|
-
getField:
|
|
1898
|
+
getField: p,
|
|
1899
1899
|
fields: a,
|
|
1900
1900
|
setInitialValues: T
|
|
1901
1901
|
}), (w, S) => ($(), C(
|
|
@@ -1903,7 +1903,7 @@ const ft = (e, t) => {
|
|
|
1903
1903
|
{
|
|
1904
1904
|
ref_key: "formRef",
|
|
1905
1905
|
ref: i,
|
|
1906
|
-
class: H(
|
|
1906
|
+
class: H(f.value)
|
|
1907
1907
|
},
|
|
1908
1908
|
[
|
|
1909
1909
|
ae(w.$slots, "default")
|
|
@@ -1950,8 +1950,8 @@ function yt(e, t, n) {
|
|
|
1950
1950
|
return zu() ? yt = Reflect.construct.bind() : yt = function(o, i, a) {
|
|
1951
1951
|
var s = [null];
|
|
1952
1952
|
s.push.apply(s, i);
|
|
1953
|
-
var l = Function.bind.apply(o, s),
|
|
1954
|
-
return a && lt(
|
|
1953
|
+
var l = Function.bind.apply(o, s), f = new l();
|
|
1954
|
+
return a && lt(f, a.prototype), f;
|
|
1955
1955
|
}, yt.apply(null, arguments);
|
|
1956
1956
|
}
|
|
1957
1957
|
function Wu(e) {
|
|
@@ -2080,12 +2080,12 @@ function Hu(e, t, n, r, o) {
|
|
|
2080
2080
|
return h;
|
|
2081
2081
|
}), i;
|
|
2082
2082
|
}
|
|
2083
|
-
var a = t.firstFields === !0 ? Object.keys(e) : t.firstFields || [], s = Object.keys(e), l = s.length,
|
|
2083
|
+
var a = t.firstFields === !0 ? Object.keys(e) : t.firstFields || [], s = Object.keys(e), l = s.length, f = 0, p = [], c = new Promise(function(h, T) {
|
|
2084
2084
|
var O = function(v) {
|
|
2085
|
-
if (
|
|
2086
|
-
return r(
|
|
2085
|
+
if (p.push.apply(p, v), f++, f === l)
|
|
2086
|
+
return r(p), p.length ? T(new Qn(p, Gt(p))) : h(o);
|
|
2087
2087
|
};
|
|
2088
|
-
s.length || (r(
|
|
2088
|
+
s.length || (r(p), h(o)), s.forEach(function(m) {
|
|
2089
2089
|
var v = e[m];
|
|
2090
2090
|
a.indexOf(m) !== -1 ? Xn(v, n, O) : Gu(v, n, O);
|
|
2091
2091
|
});
|
|
@@ -2153,8 +2153,8 @@ var no = function(t, n, r, o, i, a) {
|
|
|
2153
2153
|
}, l.v6 = function(g) {
|
|
2154
2154
|
return g && g.exact ? s : new RegExp("" + t(g) + o + t(g), "g");
|
|
2155
2155
|
};
|
|
2156
|
-
var
|
|
2157
|
-
return pt = new RegExp("(?:^" +
|
|
2156
|
+
var f = "(?:(?:[a-z]+:)?//)", p = "(?:\\S+(?::\\S*)?@)?", c = l.v4().source, h = l.v6().source, T = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", O = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", m = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", v = "(?::\\d{2,5})?", u = '(?:[/?#][^\\s"]*)?', d = "(?:" + f + "|www\\.)" + p + "(?:localhost|" + c + "|" + h + "|" + T + O + m + ")" + v + u;
|
|
2157
|
+
return pt = new RegExp("(?:^" + d + "$)", "i"), pt;
|
|
2158
2158
|
}), nr = {
|
|
2159
2159
|
// http://emailregex.com/
|
|
2160
2160
|
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
@@ -2211,10 +2211,10 @@ var no = function(t, n, r, o, i, a) {
|
|
|
2211
2211
|
var a = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], s = t.type;
|
|
2212
2212
|
a.indexOf(s) > -1 ? Ze[s](n) || o.push(ne(i.messages.types[s], t.fullField, t.type)) : s && typeof n !== t.type && o.push(ne(i.messages.types[s], t.fullField, t.type));
|
|
2213
2213
|
}, tc = function(t, n, r, o, i) {
|
|
2214
|
-
var a = typeof t.len == "number", s = typeof t.min == "number", l = typeof t.max == "number",
|
|
2214
|
+
var a = typeof t.len == "number", s = typeof t.min == "number", l = typeof t.max == "number", f = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, p = n, c = null, h = typeof n == "number", T = typeof n == "string", O = Array.isArray(n);
|
|
2215
2215
|
if (h ? c = "number" : T ? c = "string" : O && (c = "array"), !c)
|
|
2216
2216
|
return !1;
|
|
2217
|
-
O && (
|
|
2217
|
+
O && (p = n.length), T && (p = n.replace(f, "_").length), a ? p !== t.len && o.push(ne(i.messages[c].len, t.fullField, t.len)) : s && !l && p < t.min ? o.push(ne(i.messages[c].min, t.fullField, t.min)) : l && !s && p > t.max ? o.push(ne(i.messages[c].max, t.fullField, t.max)) : s && l && (p < t.min || p > t.max) && o.push(ne(i.messages[c].range, t.fullField, t.min, t.max));
|
|
2218
2218
|
}, De = "enum", nc = function(t, n, r, o, i) {
|
|
2219
2219
|
t[De] = Array.isArray(t[De]) ? t[De] : [], t[De].indexOf(n) === -1 && o.push(ne(i.messages[De], t.fullField, t[De].join(", ")));
|
|
2220
2220
|
}, rc = function(t, n, r, o, i) {
|
|
@@ -2444,12 +2444,12 @@ var Ht = Yt(), dt = /* @__PURE__ */ (function() {
|
|
|
2444
2444
|
var a = this;
|
|
2445
2445
|
o === void 0 && (o = {}), i === void 0 && (i = function() {
|
|
2446
2446
|
});
|
|
2447
|
-
var s = r, l = o,
|
|
2448
|
-
if (typeof l == "function" && (
|
|
2449
|
-
return
|
|
2450
|
-
function
|
|
2447
|
+
var s = r, l = o, f = i;
|
|
2448
|
+
if (typeof l == "function" && (f = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
2449
|
+
return f && f(null, s), Promise.resolve(s);
|
|
2450
|
+
function p(m) {
|
|
2451
2451
|
var v = [], u = {};
|
|
2452
|
-
function
|
|
2452
|
+
function d(b) {
|
|
2453
2453
|
if (Array.isArray(b)) {
|
|
2454
2454
|
var F;
|
|
2455
2455
|
v = (F = v).concat.apply(F, b);
|
|
@@ -2457,8 +2457,8 @@ var Ht = Yt(), dt = /* @__PURE__ */ (function() {
|
|
|
2457
2457
|
v.push(b);
|
|
2458
2458
|
}
|
|
2459
2459
|
for (var g = 0; g < m.length; g++)
|
|
2460
|
-
|
|
2461
|
-
v.length ? (u = Gt(v),
|
|
2460
|
+
d(m[g]);
|
|
2461
|
+
v.length ? (u = Gt(v), f(v, u)) : f(null, s);
|
|
2462
2462
|
}
|
|
2463
2463
|
if (l.messages) {
|
|
2464
2464
|
var c = this.messages();
|
|
@@ -2468,8 +2468,8 @@ var Ht = Yt(), dt = /* @__PURE__ */ (function() {
|
|
|
2468
2468
|
var h = {}, T = l.keys || Object.keys(this.rules);
|
|
2469
2469
|
T.forEach(function(m) {
|
|
2470
2470
|
var v = a.rules[m], u = s[m];
|
|
2471
|
-
v.forEach(function(
|
|
2472
|
-
var g =
|
|
2471
|
+
v.forEach(function(d) {
|
|
2472
|
+
var g = d;
|
|
2473
2473
|
typeof g.transform == "function" && (s === r && (s = Ie({}, s)), u = s[m] = g.transform(u)), typeof g == "function" ? g = {
|
|
2474
2474
|
validator: g
|
|
2475
2475
|
} : g = Ie({}, g), g.validator = a.getValidationMethod(g), g.validator && (g.field = m, g.fullField = g.fullField || m, g.type = a.getType(g), h[m] = h[m] || [], h[m].push({
|
|
@@ -2482,8 +2482,8 @@ var Ht = Yt(), dt = /* @__PURE__ */ (function() {
|
|
|
2482
2482
|
});
|
|
2483
2483
|
var O = {};
|
|
2484
2484
|
return Hu(h, l, function(m, v) {
|
|
2485
|
-
var u = m.rule,
|
|
2486
|
-
|
|
2485
|
+
var u = m.rule, d = (u.type === "object" || u.type === "array") && (typeof u.fields == "object" || typeof u.defaultField == "object");
|
|
2486
|
+
d = d && (u.required || !u.required && m.value), u.field = m.field;
|
|
2487
2487
|
function g(w, S) {
|
|
2488
2488
|
return Ie({}, S, {
|
|
2489
2489
|
fullField: u.fullField + "." + w,
|
|
@@ -2497,7 +2497,7 @@ var Ht = Yt(), dt = /* @__PURE__ */ (function() {
|
|
|
2497
2497
|
var j = S.map(er(u, s));
|
|
2498
2498
|
if (l.first && j.length)
|
|
2499
2499
|
return O[u.field] = 1, v(j);
|
|
2500
|
-
if (!
|
|
2500
|
+
if (!d)
|
|
2501
2501
|
v(j);
|
|
2502
2502
|
else {
|
|
2503
2503
|
if (u.required && !m.value)
|
|
@@ -2537,7 +2537,7 @@ var Ht = Yt(), dt = /* @__PURE__ */ (function() {
|
|
|
2537
2537
|
return b(w);
|
|
2538
2538
|
});
|
|
2539
2539
|
}, function(m) {
|
|
2540
|
-
|
|
2540
|
+
p(m);
|
|
2541
2541
|
}, s);
|
|
2542
2542
|
}, t.getType = function(r) {
|
|
2543
2543
|
if (r.type === void 0 && r.pattern instanceof RegExp && (r.type = "pattern"), typeof r.validator != "function" && r.type && !tt.hasOwnProperty(r.type))
|
|
@@ -2614,28 +2614,28 @@ var wc = M({
|
|
|
2614
2614
|
const n = X(Ot, void 0), r = X(_t);
|
|
2615
2615
|
r || ql(rr, "usage: <el-form-item><label-wrap /></el-form-item>");
|
|
2616
2616
|
const o = _e("form"), i = A(), a = A(0), s = () => {
|
|
2617
|
-
var
|
|
2618
|
-
if ((
|
|
2617
|
+
var p;
|
|
2618
|
+
if ((p = i.value) != null && p.firstElementChild) {
|
|
2619
2619
|
const c = window.getComputedStyle(i.value.firstElementChild).width;
|
|
2620
2620
|
return Math.ceil(Number.parseFloat(c));
|
|
2621
2621
|
} else
|
|
2622
2622
|
return 0;
|
|
2623
|
-
}, l = (
|
|
2623
|
+
}, l = (p = "update") => {
|
|
2624
2624
|
Zt(() => {
|
|
2625
|
-
t.default && e.isAutoWidth && (
|
|
2625
|
+
t.default && e.isAutoWidth && (p === "update" ? a.value = s() : p === "remove" && n?.deregisterLabelWidth(a.value));
|
|
2626
2626
|
});
|
|
2627
|
-
},
|
|
2627
|
+
}, f = () => l("update");
|
|
2628
2628
|
return Ke(() => {
|
|
2629
|
-
|
|
2629
|
+
f();
|
|
2630
2630
|
}), dr(() => {
|
|
2631
2631
|
l("remove");
|
|
2632
|
-
}), $o(() =>
|
|
2633
|
-
e.updateAll && n?.registerLabelWidth(
|
|
2632
|
+
}), $o(() => f()), le(a, (p, c) => {
|
|
2633
|
+
e.updateAll && n?.registerLabelWidth(p, c);
|
|
2634
2634
|
}), zr(y(() => {
|
|
2635
|
-
var
|
|
2636
|
-
return (c = (
|
|
2637
|
-
}),
|
|
2638
|
-
var
|
|
2635
|
+
var p, c;
|
|
2636
|
+
return (c = (p = i.value) == null ? void 0 : p.firstElementChild) != null ? c : null;
|
|
2637
|
+
}), f), () => {
|
|
2638
|
+
var p, c;
|
|
2639
2639
|
if (!t)
|
|
2640
2640
|
return null;
|
|
2641
2641
|
const {
|
|
@@ -2644,14 +2644,14 @@ var wc = M({
|
|
|
2644
2644
|
if (h) {
|
|
2645
2645
|
const T = n?.autoLabelWidth, O = r?.hasLabel, m = {};
|
|
2646
2646
|
if (O && T && T !== "auto") {
|
|
2647
|
-
const v = Math.max(0, Number.parseInt(T, 10) - a.value),
|
|
2648
|
-
v && (m[
|
|
2647
|
+
const v = Math.max(0, Number.parseInt(T, 10) - a.value), d = (r.labelPosition || n.labelPosition) === "left" ? "marginRight" : "marginLeft";
|
|
2648
|
+
v && (m[d] = `${v}px`);
|
|
2649
2649
|
}
|
|
2650
2650
|
return N("div", {
|
|
2651
2651
|
ref: i,
|
|
2652
2652
|
class: [o.be("item", "label-wrap")],
|
|
2653
2653
|
style: m
|
|
2654
|
-
}, [(
|
|
2654
|
+
}, [(p = t.default) == null ? void 0 : p.call(t)]);
|
|
2655
2655
|
} else
|
|
2656
2656
|
return N(nt, {
|
|
2657
2657
|
ref: i
|
|
@@ -2664,14 +2664,14 @@ const xc = ["role", "aria-labelledby"], Tc = M({
|
|
|
2664
2664
|
__name: "form-item",
|
|
2665
2665
|
props: _c,
|
|
2666
2666
|
setup(e, { expose: t }) {
|
|
2667
|
-
const n = e, r = fr(), o = X(Ot, void 0), i = X(_t, void 0), a = Qr(void 0, { formItem: !1 }), s = _e("form-item"), l = Tu().value,
|
|
2667
|
+
const n = e, r = fr(), o = X(Ot, void 0), i = X(_t, void 0), a = Qr(void 0, { formItem: !1 }), s = _e("form-item"), l = Tu().value, f = A([]), p = A(""), c = Pl(p, 100), h = A(""), T = A();
|
|
2668
2668
|
let O, m = !1;
|
|
2669
2669
|
const v = y(
|
|
2670
2670
|
() => n.labelPosition || o?.labelPosition
|
|
2671
2671
|
), u = y(() => {
|
|
2672
2672
|
var x;
|
|
2673
2673
|
return v.value === "top" ? {} : { width: st((x = n.labelWidth) != null ? x : o?.labelWidth) };
|
|
2674
|
-
}),
|
|
2674
|
+
}), d = y(() => {
|
|
2675
2675
|
var x;
|
|
2676
2676
|
if (v.value === "top" || o?.inline)
|
|
2677
2677
|
return {};
|
|
@@ -2682,9 +2682,9 @@ const xc = ["role", "aria-labelledby"], Tc = M({
|
|
|
2682
2682
|
}), g = y(() => [
|
|
2683
2683
|
s.b(),
|
|
2684
2684
|
s.m(a.value),
|
|
2685
|
-
s.is("error",
|
|
2686
|
-
s.is("validating",
|
|
2687
|
-
s.is("success",
|
|
2685
|
+
s.is("error", p.value === "error"),
|
|
2686
|
+
s.is("validating", p.value === "validating"),
|
|
2687
|
+
s.is("success", p.value === "success"),
|
|
2688
2688
|
s.is("required", St.value || n.required),
|
|
2689
2689
|
s.is("no-asterisk", o?.hideRequiredAsterisk),
|
|
2690
2690
|
o?.requireAsteriskPosition === "right" ? "asterisk-right" : "asterisk-left",
|
|
@@ -2699,7 +2699,7 @@ const xc = ["role", "aria-labelledby"], Tc = M({
|
|
|
2699
2699
|
{ [s.em("error", "inline")]: b.value }
|
|
2700
2700
|
]), w = y(() => n.prop ? rt(n.prop) ? n.prop.join(".") : n.prop : ""), S = y(() => !!(n.label || r.label)), j = y(() => {
|
|
2701
2701
|
var x;
|
|
2702
|
-
return (x = n.for) != null ? x :
|
|
2702
|
+
return (x = n.for) != null ? x : f.value.length === 1 ? f.value[0] : void 0;
|
|
2703
2703
|
}), B = y(() => !j.value && S.value), ee = !!i, Q = y(() => {
|
|
2704
2704
|
const x = o?.model;
|
|
2705
2705
|
if (!(!x || !n.prop))
|
|
@@ -2734,7 +2734,7 @@ const xc = ["role", "aria-labelledby"], Tc = M({
|
|
|
2734
2734
|
), vn = y(
|
|
2735
2735
|
() => `${n.label || ""}${o?.labelSuffix || ""}`
|
|
2736
2736
|
), ke = (x) => {
|
|
2737
|
-
|
|
2737
|
+
p.value = x;
|
|
2738
2738
|
}, vo = (x) => {
|
|
2739
2739
|
var V, K;
|
|
2740
2740
|
const { errors: U, fields: se } = x;
|
|
@@ -2766,9 +2766,9 @@ const xc = ["role", "aria-labelledby"], Tc = M({
|
|
|
2766
2766
|
const V = gt(x, n.prop);
|
|
2767
2767
|
m = !0, V.value = jt(O), await Zt(), It(), m = !1;
|
|
2768
2768
|
}, ho = (x) => {
|
|
2769
|
-
|
|
2769
|
+
f.value.includes(x) || f.value.push(x);
|
|
2770
2770
|
}, bo = (x) => {
|
|
2771
|
-
|
|
2771
|
+
f.value = f.value.filter((V) => V !== x);
|
|
2772
2772
|
}, hn = (x) => {
|
|
2773
2773
|
O = jt(x);
|
|
2774
2774
|
};
|
|
@@ -2787,9 +2787,9 @@ const xc = ["role", "aria-labelledby"], Tc = M({
|
|
|
2787
2787
|
$el: T,
|
|
2788
2788
|
size: a,
|
|
2789
2789
|
validateMessage: h,
|
|
2790
|
-
validateState:
|
|
2790
|
+
validateState: p,
|
|
2791
2791
|
labelId: l,
|
|
2792
|
-
inputIds:
|
|
2792
|
+
inputIds: f,
|
|
2793
2793
|
isGroup: B,
|
|
2794
2794
|
hasLabel: S,
|
|
2795
2795
|
fieldValue: Q,
|
|
@@ -2808,7 +2808,7 @@ const xc = ["role", "aria-labelledby"], Tc = M({
|
|
|
2808
2808
|
}), t({
|
|
2809
2809
|
size: a,
|
|
2810
2810
|
validateMessage: h,
|
|
2811
|
-
validateState:
|
|
2811
|
+
validateState: p,
|
|
2812
2812
|
validate: gn,
|
|
2813
2813
|
clearValidate: It,
|
|
2814
2814
|
resetField: yn,
|
|
@@ -2851,7 +2851,7 @@ const xc = ["role", "aria-labelledby"], Tc = M({
|
|
|
2851
2851
|
"div",
|
|
2852
2852
|
{
|
|
2853
2853
|
class: H(_(s).e("content")),
|
|
2854
|
-
style: ze(
|
|
2854
|
+
style: ze(d.value)
|
|
2855
2855
|
},
|
|
2856
2856
|
[
|
|
2857
2857
|
ae(x.$slots, "default"),
|
|
@@ -3053,7 +3053,7 @@ const or = ct(Fc), oo = [
|
|
|
3053
3053
|
props: jc,
|
|
3054
3054
|
emits: Vc,
|
|
3055
3055
|
setup(e, { expose: t, emit: n }) {
|
|
3056
|
-
const { Close: r } = bu, o = e, i = n, a = A(!1), { ns: s, zIndex: l } = Zl("message"), { currentZIndex:
|
|
3056
|
+
const { Close: r } = bu, o = e, i = n, a = A(!1), { ns: s, zIndex: l } = Zl("message"), { currentZIndex: f, nextZIndex: p } = l, c = A(), h = A(!1), T = A(0);
|
|
3057
3057
|
let O;
|
|
3058
3058
|
const m = y(
|
|
3059
3059
|
() => o.type ? o.type === "error" ? "danger" : o.type : "info"
|
|
@@ -3062,11 +3062,11 @@ const or = ct(Fc), oo = [
|
|
|
3062
3062
|
return { [s.bm("icon", I)]: I && Jn[I] };
|
|
3063
3063
|
}), u = y(
|
|
3064
3064
|
() => o.icon || Jn[o.type] || ""
|
|
3065
|
-
),
|
|
3066
|
-
() =>
|
|
3065
|
+
), d = y(() => o.placement || Re), g = y(() => Nc(o.id, d.value)), b = y(() => Lc(o.id, o.offset, d.value) + g.value), F = y(() => T.value + b.value), w = y(() => d.value.includes("left") ? s.is("left") : d.value.includes("right") ? s.is("right") : s.is("center")), S = y(
|
|
3066
|
+
() => d.value.startsWith("top") ? "top" : "bottom"
|
|
3067
3067
|
), j = y(() => ({
|
|
3068
3068
|
[S.value]: `${b.value}px`,
|
|
3069
|
-
zIndex:
|
|
3069
|
+
zIndex: f.value
|
|
3070
3070
|
}));
|
|
3071
3071
|
function B() {
|
|
3072
3072
|
o.duration !== 0 && ({ stop: O } = Nl(() => {
|
|
@@ -3086,7 +3086,7 @@ const or = ct(Fc), oo = [
|
|
|
3086
3086
|
Ou(I) === Wt.esc && Q();
|
|
3087
3087
|
}
|
|
3088
3088
|
return Ke(() => {
|
|
3089
|
-
B(),
|
|
3089
|
+
B(), p(), h.value = !0;
|
|
3090
3090
|
}), le(
|
|
3091
3091
|
() => o.repeatNum,
|
|
3092
3092
|
() => {
|
|
@@ -3214,7 +3214,7 @@ const Rc = (e) => {
|
|
|
3214
3214
|
...t,
|
|
3215
3215
|
id: r,
|
|
3216
3216
|
onClose: () => {
|
|
3217
|
-
o?.(), Wc(
|
|
3217
|
+
o?.(), Wc(p);
|
|
3218
3218
|
},
|
|
3219
3219
|
onDestroy: () => {
|
|
3220
3220
|
bn(null, i);
|
|
@@ -3227,7 +3227,7 @@ const Rc = (e) => {
|
|
|
3227
3227
|
} : null
|
|
3228
3228
|
);
|
|
3229
3229
|
s.appContext = n || Fe._context, bn(s, i), e.appendChild(i.firstElementChild);
|
|
3230
|
-
const l = s.component,
|
|
3230
|
+
const l = s.component, p = {
|
|
3231
3231
|
id: r,
|
|
3232
3232
|
vnode: s,
|
|
3233
3233
|
vm: l,
|
|
@@ -3238,7 +3238,7 @@ const Rc = (e) => {
|
|
|
3238
3238
|
},
|
|
3239
3239
|
props: s.component.props
|
|
3240
3240
|
};
|
|
3241
|
-
return
|
|
3241
|
+
return p;
|
|
3242
3242
|
}, Fe = (e = {}, t) => {
|
|
3243
3243
|
if (!Pe)
|
|
3244
3244
|
return { close: () => {
|
|
@@ -3302,21 +3302,21 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3302
3302
|
},
|
|
3303
3303
|
setup(e) {
|
|
3304
3304
|
const t = e, n = ye(t, "modelValue"), r = A("input"), o = y(() => {
|
|
3305
|
-
const { clearable:
|
|
3306
|
-
return { clearable:
|
|
3305
|
+
const { clearable: p, disabled: c, required: h, readonly: T, placeholder: O, maxlength: m, minlength: v, showWordLimit: u, initValue: d } = t.data;
|
|
3306
|
+
return { clearable: p, disabled: c, required: h, readonly: T, placeholder: O, maxlength: m, minlength: v, showWordLimit: u, initValue: d };
|
|
3307
3307
|
}), i = y(() => t.data.changeType && !t.data.readonly && !t.data.disabled), a = A(t.data.type || "text"), s = A(!0);
|
|
3308
3308
|
function l() {
|
|
3309
3309
|
s.value = !s.value, s.value ? a.value = "password" : a.value = "text";
|
|
3310
3310
|
}
|
|
3311
|
-
function
|
|
3312
|
-
if (
|
|
3311
|
+
function f(p) {
|
|
3312
|
+
if (p === "string")
|
|
3313
3313
|
n.value = String(n.value), r.value = "input";
|
|
3314
|
-
else if (
|
|
3314
|
+
else if (p === "number") {
|
|
3315
3315
|
const c = Number(n.value);
|
|
3316
3316
|
n.value = isNaN(c) ? "" : c, r.value = "number";
|
|
3317
|
-
} else
|
|
3317
|
+
} else p === "boolean" && (r.value = "switch", n.value === "true" || n.value === !0 ? n.value = !0 : n.value === "false" || n.value === !1 ? n.value = !1 : n.value = !!n.value);
|
|
3318
3318
|
}
|
|
3319
|
-
return (
|
|
3319
|
+
return (p, c) => {
|
|
3320
3320
|
const h = Z("el-switch"), T = Z("el-input-number"), O = Z("el-button"), m = Z("el-input"), v = Z("el-button-group");
|
|
3321
3321
|
return $(), C("div", Yc, [
|
|
3322
3322
|
t.data.readonly ? ($(), C("div", Hc, re(_(n)), 1)) : ($(), C("div", Jc, [
|
|
@@ -3350,7 +3350,7 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3350
3350
|
N(v, null, {
|
|
3351
3351
|
default: L(() => [
|
|
3352
3352
|
N(O, {
|
|
3353
|
-
onClick: c[3] || (c[3] = (u) =>
|
|
3353
|
+
onClick: c[3] || (c[3] = (u) => f("string"))
|
|
3354
3354
|
}, {
|
|
3355
3355
|
default: L(() => [...c[6] || (c[6] = [
|
|
3356
3356
|
oe("字符串", -1)
|
|
@@ -3358,7 +3358,7 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3358
3358
|
_: 1
|
|
3359
3359
|
}),
|
|
3360
3360
|
N(O, {
|
|
3361
|
-
onClick: c[4] || (c[4] = (u) =>
|
|
3361
|
+
onClick: c[4] || (c[4] = (u) => f("number"))
|
|
3362
3362
|
}, {
|
|
3363
3363
|
default: L(() => [...c[7] || (c[7] = [
|
|
3364
3364
|
oe("数字", -1)
|
|
@@ -3366,7 +3366,7 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3366
3366
|
_: 1
|
|
3367
3367
|
}),
|
|
3368
3368
|
N(O, {
|
|
3369
|
-
onClick: c[5] || (c[5] = (u) =>
|
|
3369
|
+
onClick: c[5] || (c[5] = (u) => f("boolean"))
|
|
3370
3370
|
}, {
|
|
3371
3371
|
default: L(() => [...c[8] || (c[8] = [
|
|
3372
3372
|
oe("布尔值", -1)
|
|
@@ -3402,22 +3402,22 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3402
3402
|
},
|
|
3403
3403
|
setup(e) {
|
|
3404
3404
|
const t = e, n = ye(t, "modelValue"), r = y(() => {
|
|
3405
|
-
const { clearable: a, filterable: s, disabled: l, required:
|
|
3406
|
-
return { clearable: a, filterable: s, disabled: l, required:
|
|
3405
|
+
const { clearable: a, filterable: s, disabled: l, required: f, readonly: p, placeholder: c, options: h = [], mergeOptions: T = [], multiple: O, allowCreate: m, multipleLimit: v, initValue: u, optionKeys: d } = t.data;
|
|
3406
|
+
return { clearable: a, filterable: s, disabled: l, required: f, readonly: p, placeholder: c, options: h, mergeOptions: T, multiple: O, allowCreate: m, multipleLimit: v, initValue: u, defaultFirstOption: m, optionKeys: d };
|
|
3407
3407
|
}), o = y(() => (console.log(t.data), t.data.optionKeys || [])), i = y(() => {
|
|
3408
3408
|
const a = t.dictList;
|
|
3409
3409
|
return a && t.data.dictId ? t.data.dictId === "all" ? a.map((s) => (s.value = s.id, s)) || [] : [...a.find((l) => l.id === t.data.dictId)?.children || [], ...r.value.mergeOptions] : r.value.options && r.value.options.length > 0 ? r.value.options : [];
|
|
3410
3410
|
});
|
|
3411
3411
|
return (a, s) => {
|
|
3412
|
-
const l = Z("el-text"),
|
|
3412
|
+
const l = Z("el-text"), f = Z("el-option"), p = Z("el-select");
|
|
3413
3413
|
return $(), C("div", ed, [
|
|
3414
3414
|
t.data.readonly ? ($(), C("div", td, re(_(n)), 1)) : ($(), C("div", nd, [
|
|
3415
|
-
N(
|
|
3415
|
+
N(p, je({
|
|
3416
3416
|
modelValue: _(n),
|
|
3417
3417
|
"onUpdate:modelValue": s[0] || (s[0] = (c) => pe(n) ? n.value = c : null)
|
|
3418
3418
|
}, r.value), {
|
|
3419
3419
|
default: L(() => [
|
|
3420
|
-
($(!0), C(nt, null, Pt(i.value, (c) => ($(), J(
|
|
3420
|
+
($(!0), C(nt, null, Pt(i.value, (c) => ($(), J(f, {
|
|
3421
3421
|
key: c.value,
|
|
3422
3422
|
value: c.value,
|
|
3423
3423
|
label: c.label,
|
|
@@ -3466,8 +3466,8 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3466
3466
|
},
|
|
3467
3467
|
setup(e) {
|
|
3468
3468
|
const t = e, n = ye(t, "modelValue"), r = y(() => {
|
|
3469
|
-
const { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, min:
|
|
3470
|
-
return { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, min:
|
|
3469
|
+
const { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, min: f, max: p, step: c, precision: h, controls: T, initValue: O } = t.data;
|
|
3470
|
+
return { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, min: f, max: p, step: c, precision: h, controls: T, initValue: O };
|
|
3471
3471
|
});
|
|
3472
3472
|
return (o, i) => {
|
|
3473
3473
|
const a = Z("el-input-number");
|
|
@@ -3496,8 +3496,8 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3496
3496
|
},
|
|
3497
3497
|
setup(e) {
|
|
3498
3498
|
const t = e, n = ye(t, "modelValue"), r = y(() => {
|
|
3499
|
-
const { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, loading:
|
|
3500
|
-
return { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, loading:
|
|
3499
|
+
const { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, loading: f, width: p, activeText: c, inactiveText: h, activeValue: T, inactiveValue: O, initValue: m } = t.data;
|
|
3500
|
+
return { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, loading: f, width: p, activeText: c, inactiveText: h, activeValue: T, inactiveValue: O, initValue: m };
|
|
3501
3501
|
});
|
|
3502
3502
|
return (o, i) => {
|
|
3503
3503
|
const a = Z("el-switch");
|
|
@@ -3526,8 +3526,8 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3526
3526
|
},
|
|
3527
3527
|
setup(e) {
|
|
3528
3528
|
const t = e, n = ye(t, "modelValue"), r = y(() => {
|
|
3529
|
-
const { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, type:
|
|
3530
|
-
return { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, type:
|
|
3529
|
+
const { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, type: f, defaultValue: p, defaultTime: c, dateFormat: h, timeFormat: T, valueFormat: O = "YYYY-MM-DDTHH:mm:ss[Z]", initValue: m } = t.data;
|
|
3530
|
+
return { clearable: o, disabled: i, required: a, readonly: s, placeholder: l, type: f, defaultValue: p, defaultTime: c, dateFormat: h, timeFormat: T, valueFormat: O, initValue: m };
|
|
3531
3531
|
});
|
|
3532
3532
|
return (o, i) => {
|
|
3533
3533
|
const a = Z("el-date-picker");
|
|
@@ -3557,8 +3557,8 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3557
3557
|
},
|
|
3558
3558
|
setup(e) {
|
|
3559
3559
|
const t = e, n = ye(t, "modelValue"), r = y(() => {
|
|
3560
|
-
const { clearable: i, disabled: a, required: s, readonly: l, placeholder:
|
|
3561
|
-
return { clearable: i, disabled: a, required: s, readonly: l, placeholder:
|
|
3560
|
+
const { clearable: i, disabled: a, required: s, readonly: l, placeholder: f, options: p, mergeOptions: c = [], border: h, textColor: T, fill: O, type: m, initValue: v } = t.data;
|
|
3561
|
+
return { clearable: i, disabled: a, required: s, readonly: l, placeholder: f, options: p, mergeOptions: c, border: h, textColor: T, fill: O, type: m, initValue: v };
|
|
3562
3562
|
}), o = y(() => {
|
|
3563
3563
|
const i = t.dictList;
|
|
3564
3564
|
return i && t.data.dictId ? t.data.dictId === "all" ? i.map((a) => (a.value = a.id, a)) || [] : [...i.find((s) => s.id === t.data.dictId)?.children || [], ...r.value.mergeOptions] : r.value.options && r.value.options.length > 0 ? r.value.options : [];
|
|
@@ -3569,14 +3569,14 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3569
3569
|
t.data.readonly ? ($(), C("div", hd, re(_(n)), 1)) : ($(), C("div", bd, [
|
|
3570
3570
|
N(l, je({
|
|
3571
3571
|
modelValue: _(n),
|
|
3572
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
3572
|
+
"onUpdate:modelValue": a[0] || (a[0] = (f) => pe(n) ? n.value = f : null)
|
|
3573
3573
|
}, r.value), {
|
|
3574
3574
|
default: L(() => [
|
|
3575
|
-
($(!0), C(nt, null, Pt(o.value, (
|
|
3576
|
-
key:
|
|
3577
|
-
value:
|
|
3578
|
-
label:
|
|
3579
|
-
disabled:
|
|
3575
|
+
($(!0), C(nt, null, Pt(o.value, (f) => ($(), J(s, {
|
|
3576
|
+
key: f.value,
|
|
3577
|
+
value: f.value,
|
|
3578
|
+
label: f.label,
|
|
3579
|
+
disabled: f.disabled,
|
|
3580
3580
|
border: r.value.border
|
|
3581
3581
|
}, null, 8, ["value", "label", "disabled", "border"]))), 128))
|
|
3582
3582
|
]),
|
|
@@ -3598,131 +3598,131 @@ const mt = Ql(Fe, "$message"), Yc = { class: "item-content" }, Hc = {
|
|
|
3598
3598
|
},
|
|
3599
3599
|
emits: ["change", "remove"],
|
|
3600
3600
|
setup(e, { expose: t, emit: n }) {
|
|
3601
|
-
const r = fr(), o = n, i = e, a = A(), s = ye(i, "data"), l = ye(i, "config"),
|
|
3602
|
-
le(s, (
|
|
3603
|
-
o("change",
|
|
3601
|
+
const r = fr(), o = n, i = e, a = A(), s = ye(i, "data"), l = ye(i, "config"), f = Oe();
|
|
3602
|
+
le(s, (d) => {
|
|
3603
|
+
o("change", d);
|
|
3604
3604
|
}, {
|
|
3605
3605
|
deep: !0
|
|
3606
3606
|
}), Ke(() => {
|
|
3607
|
-
|
|
3607
|
+
f.value = ht(s.value);
|
|
3608
3608
|
});
|
|
3609
|
-
function
|
|
3609
|
+
function p() {
|
|
3610
3610
|
return R("div", { class: "form-content" }, {
|
|
3611
3611
|
default: () => [R($c, { model: s.value, ref: a, style: "width: 100%", labelWidth: l.value?.[0]?.labelWidth }, {
|
|
3612
3612
|
default: () => R(or, { id: "dragzone" }, {
|
|
3613
3613
|
default: () => {
|
|
3614
|
-
const
|
|
3615
|
-
if (
|
|
3616
|
-
return l.value.map((g) => c(g,
|
|
3614
|
+
const d = l.value[0];
|
|
3615
|
+
if (d)
|
|
3616
|
+
return l.value.map((g) => c(g, d));
|
|
3617
3617
|
}
|
|
3618
3618
|
})
|
|
3619
3619
|
}), r.default ? r.default() : ""]
|
|
3620
3620
|
});
|
|
3621
3621
|
}
|
|
3622
|
-
function c(
|
|
3623
|
-
return
|
|
3622
|
+
function c(d, g) {
|
|
3623
|
+
return d.formType === "block" ? h(d, g) : g ? T({ ...d, readonly: g.readonly || d.readonly, disabled: g.disabled || d.disabled, labelWidth: d.labelWidth || g.labelWidth, placeholder: g.showPlaceholder ? d.placeholder : "" }) : null;
|
|
3624
3624
|
}
|
|
3625
|
-
function h(
|
|
3625
|
+
function h(d, g) {
|
|
3626
3626
|
return R(Zn, { span: 24 }, {
|
|
3627
3627
|
default: () => R("div", { class: "fj-block" }, {
|
|
3628
|
-
default: () => [R("div", { class: "block-title" },
|
|
3629
|
-
default: () =>
|
|
3628
|
+
default: () => [R("div", { class: "block-title" }, d.label), R(or, {}, {
|
|
3629
|
+
default: () => d?.children?.length ? d.children.map((b) => c(b, g)) : null
|
|
3630
3630
|
})]
|
|
3631
3631
|
})
|
|
3632
3632
|
});
|
|
3633
3633
|
}
|
|
3634
|
-
function T(
|
|
3635
|
-
return R(Zn, { xs: 24, sm: 24, md:
|
|
3634
|
+
function T(d) {
|
|
3635
|
+
return R(Zn, { xs: 24, sm: 24, md: d.span, lg: d.span, xl: d.span }, {
|
|
3636
3636
|
default: () => R("div", { class: "fj-form-item" }, {
|
|
3637
|
-
default: () => [R(Oc, { prop:
|
|
3638
|
-
default: () => O(
|
|
3639
|
-
label: () => R("div", { class: "label-content" }, { default: () =>
|
|
3640
|
-
}), i.edit ? R("div", { class: "remove", onClick: () => m(
|
|
3637
|
+
default: () => [R(Oc, { prop: d.key, rules: d.rules, style: "width: 100%", labelWidth: d.labelWidth }, {
|
|
3638
|
+
default: () => O(d),
|
|
3639
|
+
label: () => R("div", { class: "label-content" }, { default: () => d.label })
|
|
3640
|
+
}), i.edit ? R("div", { class: "remove", onClick: () => m(d) }, { default: () => null }) : null]
|
|
3641
3641
|
})
|
|
3642
3642
|
});
|
|
3643
3643
|
}
|
|
3644
|
-
function O(
|
|
3645
|
-
const g = l.value?.[0]?.readonly ||
|
|
3646
|
-
switch (
|
|
3644
|
+
function O(d) {
|
|
3645
|
+
const g = l.value?.[0]?.readonly || d.readonly;
|
|
3646
|
+
switch (d = { ...d, readonly: g }, d.formType) {
|
|
3647
3647
|
case "input":
|
|
3648
3648
|
return R(so, {
|
|
3649
|
-
modelValue: s.value[
|
|
3649
|
+
modelValue: s.value[d.key],
|
|
3650
3650
|
"onUpdate:modelValue": (b) => {
|
|
3651
|
-
s.value = { ...s.value, [
|
|
3651
|
+
s.value = { ...s.value, [d.key]: b };
|
|
3652
3652
|
},
|
|
3653
|
-
data:
|
|
3653
|
+
data: d,
|
|
3654
3654
|
dictList: i.dictList
|
|
3655
3655
|
}, {});
|
|
3656
3656
|
case "select":
|
|
3657
3657
|
return R(lo, {
|
|
3658
|
-
modelValue: s.value[
|
|
3658
|
+
modelValue: s.value[d.key],
|
|
3659
3659
|
"onUpdate:modelValue": (b) => {
|
|
3660
|
-
s.value = { ...s.value, [
|
|
3660
|
+
s.value = { ...s.value, [d.key]: b };
|
|
3661
3661
|
},
|
|
3662
|
-
data:
|
|
3662
|
+
data: d,
|
|
3663
3663
|
dictList: i.dictList
|
|
3664
3664
|
}, {});
|
|
3665
3665
|
case "number":
|
|
3666
3666
|
return R(uo, {
|
|
3667
|
-
modelValue: s.value[
|
|
3667
|
+
modelValue: s.value[d.key],
|
|
3668
3668
|
"onUpdate:modelValue": (b) => {
|
|
3669
|
-
s.value = { ...s.value, [
|
|
3669
|
+
s.value = { ...s.value, [d.key]: b };
|
|
3670
3670
|
},
|
|
3671
|
-
data:
|
|
3671
|
+
data: d,
|
|
3672
3672
|
dictList: i.dictList
|
|
3673
3673
|
}, {});
|
|
3674
3674
|
case "switch":
|
|
3675
3675
|
return R(co, {
|
|
3676
|
-
modelValue: s.value[
|
|
3676
|
+
modelValue: s.value[d.key],
|
|
3677
3677
|
"onUpdate:modelValue": (b) => {
|
|
3678
|
-
s.value = { ...s.value, [
|
|
3678
|
+
s.value = { ...s.value, [d.key]: b };
|
|
3679
3679
|
},
|
|
3680
|
-
data:
|
|
3680
|
+
data: d,
|
|
3681
3681
|
dictList: i.dictList
|
|
3682
3682
|
}, {});
|
|
3683
3683
|
case "date":
|
|
3684
3684
|
return R(fo, {
|
|
3685
|
-
modelValue: s.value[
|
|
3685
|
+
modelValue: s.value[d.key],
|
|
3686
3686
|
"onUpdate:modelValue": (b) => {
|
|
3687
|
-
s.value = { ...s.value, [
|
|
3687
|
+
s.value = { ...s.value, [d.key]: b };
|
|
3688
3688
|
},
|
|
3689
|
-
data:
|
|
3689
|
+
data: d,
|
|
3690
3690
|
dictList: i.dictList
|
|
3691
3691
|
}, {});
|
|
3692
3692
|
case "radio":
|
|
3693
3693
|
return R(po, {
|
|
3694
|
-
modelValue: s.value[
|
|
3694
|
+
modelValue: s.value[d.key],
|
|
3695
3695
|
"onUpdate:modelValue": (b) => {
|
|
3696
|
-
s.value = { ...s.value, [
|
|
3696
|
+
s.value = { ...s.value, [d.key]: b };
|
|
3697
3697
|
},
|
|
3698
|
-
data:
|
|
3698
|
+
data: d,
|
|
3699
3699
|
dictList: i.dictList
|
|
3700
3700
|
}, {});
|
|
3701
3701
|
default:
|
|
3702
3702
|
return R("div", {}, { default: () => "invalid node" });
|
|
3703
3703
|
}
|
|
3704
3704
|
}
|
|
3705
|
-
function m(
|
|
3706
|
-
o("remove",
|
|
3705
|
+
function m(d) {
|
|
3706
|
+
o("remove", d);
|
|
3707
3707
|
}
|
|
3708
3708
|
function v() {
|
|
3709
|
-
s.value = ht(
|
|
3709
|
+
s.value = ht(f.value);
|
|
3710
3710
|
}
|
|
3711
3711
|
function u() {
|
|
3712
|
-
return new Promise((
|
|
3712
|
+
return new Promise((d, g) => {
|
|
3713
3713
|
a.value ? a.value.validate((b, F) => {
|
|
3714
|
-
b ?
|
|
3714
|
+
b ? d(s.value) : g(F);
|
|
3715
3715
|
}) : g("表单ref不存在");
|
|
3716
3716
|
});
|
|
3717
3717
|
}
|
|
3718
3718
|
return t({
|
|
3719
3719
|
submit: u,
|
|
3720
3720
|
reset: v
|
|
3721
|
-
}), (
|
|
3722
|
-
($(), J(ut(
|
|
3721
|
+
}), (d, g) => ($(), C("div", wd, [
|
|
3722
|
+
($(), J(ut(p())))
|
|
3723
3723
|
]));
|
|
3724
3724
|
}
|
|
3725
|
-
}), Jt = /* @__PURE__ */ Te(xd, [["__scopeId", "data-v-
|
|
3725
|
+
}), Jt = /* @__PURE__ */ Te(xd, [["__scopeId", "data-v-e43b3fd2"]]), Td = [{
|
|
3726
3726
|
label: "text",
|
|
3727
3727
|
value: "text"
|
|
3728
3728
|
}, {
|
|
@@ -4176,6 +4176,7 @@ class ar extends Le {
|
|
|
4176
4176
|
children = [];
|
|
4177
4177
|
initValue = "";
|
|
4178
4178
|
formType = "block";
|
|
4179
|
+
showPlaceholder = !0;
|
|
4179
4180
|
constructor(t) {
|
|
4180
4181
|
super(t);
|
|
4181
4182
|
}
|
|
@@ -4244,7 +4245,7 @@ class Vd extends Le {
|
|
|
4244
4245
|
timeFormat = "HH:mm:ss";
|
|
4245
4246
|
initValue = null;
|
|
4246
4247
|
constructor(t) {
|
|
4247
|
-
super(t), this.type = t.type || "datetime", this.defaultValue = t.defaultValue || null, this.defaultTime = t.defaultTime ||
|
|
4248
|
+
super(t), this.type = t.type || "datetime", this.defaultValue = t.defaultValue || null, this.defaultTime = t.defaultTime || void 0, this.valueFormat = t.valueFormat || "YYYY-MM-DDTHH:mm:ss[Z]", this.dateFormat = t.dateFormat || "YYYY-MM-DD", this.timeFormat = t.timeFormat || "HH:mm:ss", this.placeholder = `请选择${t.key}`;
|
|
4248
4249
|
}
|
|
4249
4250
|
}
|
|
4250
4251
|
class Ad extends Le {
|
|
@@ -4275,18 +4276,18 @@ const Pd = { class: "edit-container" }, Nd = { class: "aside" }, Ld = { class: "
|
|
|
4275
4276
|
date: { comp: fo, ins: Vd },
|
|
4276
4277
|
radio: { comp: po, ins: Ad }
|
|
4277
4278
|
};
|
|
4278
|
-
function
|
|
4279
|
+
function f() {
|
|
4279
4280
|
r.value = [new ar({ key: "root", label: "生成结果,输入内容设置默认值" })], o.value = {}, localStorage.setItem("edit_form_config", JSON.stringify(r.value)), localStorage.setItem("edit_form_data", JSON.stringify(o.value));
|
|
4280
4281
|
}
|
|
4281
|
-
function
|
|
4282
|
+
function p() {
|
|
4282
4283
|
n.value?.submit().then((u) => {
|
|
4283
4284
|
if (Object.keys(o.value).includes(u.key)) {
|
|
4284
4285
|
mt.error(`重复key: ${u.key}`);
|
|
4285
4286
|
return;
|
|
4286
4287
|
} else {
|
|
4287
|
-
const
|
|
4288
|
-
if (
|
|
4289
|
-
const g = new
|
|
4288
|
+
const d = l[u.formItemType].ins;
|
|
4289
|
+
if (d) {
|
|
4290
|
+
const g = new d(u);
|
|
4290
4291
|
o.value = { ...o.value, [u.key]: g.initValue }, r.value.forEach((b) => {
|
|
4291
4292
|
b.children && u.key && b.children.push(g);
|
|
4292
4293
|
});
|
|
@@ -4299,10 +4300,10 @@ const Pd = { class: "edit-container" }, Nd = { class: "aside" }, Ld = { class: "
|
|
|
4299
4300
|
localStorage.setItem("edit_form_data", JSON.stringify(u));
|
|
4300
4301
|
}
|
|
4301
4302
|
function h(u) {
|
|
4302
|
-
const
|
|
4303
|
-
if (u?.key &&
|
|
4304
|
-
const b =
|
|
4305
|
-
|
|
4303
|
+
const d = ht(r.value), g = ht(o.value);
|
|
4304
|
+
if (u?.key && d?.[0]?.children) {
|
|
4305
|
+
const b = d[0].children.filter((F) => F.key != u.key) || [];
|
|
4306
|
+
d[0].children = b, r.value = d, delete g[u.key], o.value = g;
|
|
4306
4307
|
}
|
|
4307
4308
|
localStorage.setItem("edit_form_config", JSON.stringify(r.value)), localStorage.setItem("edit_form_data", JSON.stringify(o.value));
|
|
4308
4309
|
}
|
|
@@ -4335,24 +4336,24 @@ const Pd = { class: "edit-container" }, Nd = { class: "aside" }, Ld = { class: "
|
|
|
4335
4336
|
}
|
|
4336
4337
|
return Ke(() => {
|
|
4337
4338
|
console.log(123);
|
|
4338
|
-
const u = localStorage.getItem("edit_form_config"),
|
|
4339
|
-
if (u &&
|
|
4339
|
+
const u = localStorage.getItem("edit_form_config"), d = localStorage.getItem("edit_form_data");
|
|
4340
|
+
if (u && d)
|
|
4340
4341
|
try {
|
|
4341
|
-
const g = JSON.parse(u), b = JSON.parse(
|
|
4342
|
+
const g = JSON.parse(u), b = JSON.parse(d);
|
|
4342
4343
|
g && b && (r.value = g, o.value = b);
|
|
4343
4344
|
} catch {
|
|
4344
4345
|
mt.error({ message: "本地数据异常,请重新创建" }), localStorage.removeItem("edit_form_config"), localStorage.removeItem("edit_form_data");
|
|
4345
4346
|
}
|
|
4346
|
-
}), (u,
|
|
4347
|
+
}), (u, d) => {
|
|
4347
4348
|
const g = Z("el-button"), b = Z("el-button-group");
|
|
4348
4349
|
return $(), C("div", Pd, [
|
|
4349
4350
|
D("div", Nd, [
|
|
4350
4351
|
D("div", Ld, [
|
|
4351
4352
|
N(_(Jt), {
|
|
4352
4353
|
config: r.value,
|
|
4353
|
-
"onUpdate:config":
|
|
4354
|
+
"onUpdate:config": d[0] || (d[0] = (F) => r.value = F),
|
|
4354
4355
|
data: o.value,
|
|
4355
|
-
"onUpdate:data":
|
|
4356
|
+
"onUpdate:data": d[1] || (d[1] = (F) => o.value = F),
|
|
4356
4357
|
edit: !0,
|
|
4357
4358
|
onChange: c,
|
|
4358
4359
|
onRemove: h,
|
|
@@ -4364,9 +4365,9 @@ const Pd = { class: "edit-container" }, Nd = { class: "aside" }, Ld = { class: "
|
|
|
4364
4365
|
default: L(() => [
|
|
4365
4366
|
N(g, {
|
|
4366
4367
|
type: "danger",
|
|
4367
|
-
onClick:
|
|
4368
|
+
onClick: f
|
|
4368
4369
|
}, {
|
|
4369
|
-
default: L(() => [...
|
|
4370
|
+
default: L(() => [...d[4] || (d[4] = [
|
|
4370
4371
|
oe("清空", -1)
|
|
4371
4372
|
])]),
|
|
4372
4373
|
_: 1
|
|
@@ -4382,9 +4383,9 @@ const Pd = { class: "edit-container" }, Nd = { class: "aside" }, Ld = { class: "
|
|
|
4382
4383
|
ref_key: "formRef",
|
|
4383
4384
|
ref: n,
|
|
4384
4385
|
config: s.value,
|
|
4385
|
-
"onUpdate:config":
|
|
4386
|
+
"onUpdate:config": d[2] || (d[2] = (F) => s.value = F),
|
|
4386
4387
|
data: a.value,
|
|
4387
|
-
"onUpdate:data":
|
|
4388
|
+
"onUpdate:data": d[3] || (d[3] = (F) => a.value = F),
|
|
4388
4389
|
"dict-list": t.dictList
|
|
4389
4390
|
}, {
|
|
4390
4391
|
default: L(() => [
|
|
@@ -4393,9 +4394,9 @@ const Pd = { class: "edit-container" }, Nd = { class: "aside" }, Ld = { class: "
|
|
|
4393
4394
|
default: L(() => [
|
|
4394
4395
|
N(g, {
|
|
4395
4396
|
type: "warning",
|
|
4396
|
-
onClick:
|
|
4397
|
+
onClick: p
|
|
4397
4398
|
}, {
|
|
4398
|
-
default: L(() => [...
|
|
4399
|
+
default: L(() => [...d[5] || (d[5] = [
|
|
4399
4400
|
oe("添加", -1)
|
|
4400
4401
|
])]),
|
|
4401
4402
|
_: 1
|
|
@@ -4404,7 +4405,7 @@ const Pd = { class: "edit-container" }, Nd = { class: "aside" }, Ld = { class: "
|
|
|
4404
4405
|
type: "warning",
|
|
4405
4406
|
onClick: T
|
|
4406
4407
|
}, {
|
|
4407
|
-
default: L(() => [...
|
|
4408
|
+
default: L(() => [...d[6] || (d[6] = [
|
|
4408
4409
|
oe("打印", -1)
|
|
4409
4410
|
])]),
|
|
4410
4411
|
_: 1
|
|
@@ -4413,7 +4414,7 @@ const Pd = { class: "edit-container" }, Nd = { class: "aside" }, Ld = { class: "
|
|
|
4413
4414
|
type: "warning",
|
|
4414
4415
|
onClick: v
|
|
4415
4416
|
}, {
|
|
4416
|
-
default: L(() => [...
|
|
4417
|
+
default: L(() => [...d[7] || (d[7] = [
|
|
4417
4418
|
oe("重置", -1)
|
|
4418
4419
|
])]),
|
|
4419
4420
|
_: 1
|