@gopowerteam/form-render 0.0.1 → 0.0.3
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/cjs/config/provide.config.d.ts +6 -0
- package/dist/cjs/defines/define-form.d.ts +2 -0
- package/dist/cjs/form-items/date/index.d.ts +15 -0
- package/dist/cjs/form-items/date-range/index.d.ts +16 -0
- package/dist/cjs/form-items/index.d.ts +16 -0
- package/dist/cjs/form-items/input/index.d.ts +7 -0
- package/dist/cjs/form-items/render/index.d.ts +5 -0
- package/dist/cjs/form-items/select/index.d.ts +11 -0
- package/dist/cjs/form-items/switch/index.d.ts +12 -0
- package/dist/cjs/form-items/textarea/index.d.ts +12 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/interfaces/form-item-options.d.ts +32 -0
- package/dist/cjs/interfaces/index.d.ts +7 -0
- package/dist/cjs/render/form-item-render.d.ts +9 -0
- package/dist/cjs/render/form-render.d.ts +330 -0
- package/dist/cjs/utils/create-form-source.d.ts +3 -0
- package/dist/es/config/provide.config.d.ts +6 -0
- package/dist/es/defines/define-form.d.ts +2 -0
- package/dist/es/form-items/date/index.d.ts +15 -0
- package/dist/es/form-items/date-range/index.d.ts +16 -0
- package/dist/es/form-items/index.d.ts +16 -0
- package/dist/es/form-items/input/index.d.ts +7 -0
- package/dist/es/form-items/render/index.d.ts +5 -0
- package/dist/es/form-items/select/index.d.ts +11 -0
- package/dist/es/form-items/switch/index.d.ts +12 -0
- package/dist/es/form-items/textarea/index.d.ts +12 -0
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.mjs +4429 -0
- package/dist/es/interfaces/form-item-options.d.ts +32 -0
- package/dist/es/interfaces/index.d.ts +7 -0
- package/dist/es/render/form-item-render.d.ts +9 -0
- package/dist/es/render/form-render.d.ts +330 -0
- package/dist/es/utils/create-form-source.d.ts +3 -0
- package/dist/style.css +1 -0
- package/package.json +20 -10
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -14
|
@@ -0,0 +1,4429 @@
|
|
|
1
|
+
import { getCurrentInstance as qr, inject as J, computed as d, defineComponent as I, ref as F, toRefs as ye, reactive as le, provide as ge, openBlock as L, createElementBlock as H, normalizeClass as D, withModifiers as $n, renderSlot as R, onMounted as he, onUnmounted as Wr, normalizeStyle as Ce, createCommentVNode as se, watchEffect as At, watch as Te, onUpdated as ft, cloneVNode as On, onBeforeUnmount as Ge, readonly as Sn, onDeactivated as jn, createVNode as C, Fragment as Wt, Teleport as kn, mergeProps as Le, Transition as Dt, withDirectives as Pn, vShow as Fn, nextTick as qe, resolveComponent as pe, createBlock as ue, withCtx as ne, createTextVNode as me, toDisplayString as Me, createElementVNode as ee, resolveDynamicComponent as Ln, renderList as Tn, toRef as Bt, createSlots as Mn, Comment as An, isVNode as Rr, h as Dn } from "vue";
|
|
2
|
+
import { DatePicker as Bn, YearPicker as Vn, QuarterPicker as xn, MonthPicker as Nn, WeekPicker as In, Input as zn, InputNumber as qn, Select as Wn, Option as Rn, Switch as Hn, RangePicker as Gn, Textarea as Un } from "@arco-design/web-vue";
|
|
3
|
+
import er from "dayjs";
|
|
4
|
+
const ht = Symbol("ArcoConfigProvider");
|
|
5
|
+
var Yn = Object.defineProperty, Kn = Object.defineProperties, Xn = Object.getOwnPropertyDescriptors, tr = Object.getOwnPropertySymbols, Zn = Object.prototype.hasOwnProperty, Qn = Object.prototype.propertyIsEnumerable, rr = (e, t, r) => t in e ? Yn(e, t, {
|
|
6
|
+
enumerable: !0,
|
|
7
|
+
configurable: !0,
|
|
8
|
+
writable: !0,
|
|
9
|
+
value: r
|
|
10
|
+
}) : e[t] = r, Jn = (e, t) => {
|
|
11
|
+
for (var r in t || (t = {}))
|
|
12
|
+
Zn.call(t, r) && rr(e, r, t[r]);
|
|
13
|
+
if (tr)
|
|
14
|
+
for (var r of tr(t))
|
|
15
|
+
Qn.call(t, r) && rr(e, r, t[r]);
|
|
16
|
+
return e;
|
|
17
|
+
}, el = (e, t) => Kn(e, Xn(t));
|
|
18
|
+
const tl = "A", rl = "arco", Vt = "$arco", De = (e) => {
|
|
19
|
+
var t;
|
|
20
|
+
return (t = e == null ? void 0 : e.componentPrefix) != null ? t : tl;
|
|
21
|
+
}, Be = (e, t) => {
|
|
22
|
+
var r;
|
|
23
|
+
t && t.classPrefix && (e.config.globalProperties[Vt] = el(Jn({}, (r = e.config.globalProperties[Vt]) != null ? r : {}), {
|
|
24
|
+
classPrefix: t.classPrefix
|
|
25
|
+
}));
|
|
26
|
+
}, G = (e) => {
|
|
27
|
+
var t, r, n;
|
|
28
|
+
const l = qr(), o = J(ht, void 0), i = (n = (r = o == null ? void 0 : o.prefixCls) != null ? r : (t = l == null ? void 0 : l.appContext.config.globalProperties[Vt]) == null ? void 0 : t.classPrefix) != null ? n : rl;
|
|
29
|
+
return e ? `${i}-${e}` : i;
|
|
30
|
+
};
|
|
31
|
+
function nr(e) {
|
|
32
|
+
return typeof e == "object" && e != null && e.nodeType === 1;
|
|
33
|
+
}
|
|
34
|
+
function lr(e, t) {
|
|
35
|
+
return (!t || e !== "hidden") && e !== "visible" && e !== "clip";
|
|
36
|
+
}
|
|
37
|
+
function gt(e, t) {
|
|
38
|
+
if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) {
|
|
39
|
+
var r = getComputedStyle(e, null);
|
|
40
|
+
return lr(r.overflowY, t) || lr(r.overflowX, t) || function(n) {
|
|
41
|
+
var l = function(o) {
|
|
42
|
+
if (!o.ownerDocument || !o.ownerDocument.defaultView)
|
|
43
|
+
return null;
|
|
44
|
+
try {
|
|
45
|
+
return o.ownerDocument.defaultView.frameElement;
|
|
46
|
+
} catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}(n);
|
|
50
|
+
return !!l && (l.clientHeight < n.scrollHeight || l.clientWidth < n.scrollWidth);
|
|
51
|
+
}(e);
|
|
52
|
+
}
|
|
53
|
+
return !1;
|
|
54
|
+
}
|
|
55
|
+
function Qe(e, t, r, n, l, o, i, a) {
|
|
56
|
+
return o < e && i > t || o > e && i < t ? 0 : o <= e && a <= r || i >= t && a >= r ? o - e - n : i > t && a < r || o < e && a > r ? i - t + l : 0;
|
|
57
|
+
}
|
|
58
|
+
var or = function(e, t) {
|
|
59
|
+
var r = window, n = t.scrollMode, l = t.block, o = t.inline, i = t.boundary, a = t.skipOverflowHiddenElements, s = typeof i == "function" ? i : function(Xe) {
|
|
60
|
+
return Xe !== i;
|
|
61
|
+
};
|
|
62
|
+
if (!nr(e))
|
|
63
|
+
throw new TypeError("Invalid target");
|
|
64
|
+
for (var u, c, h = document.scrollingElement || document.documentElement, p = [], b = e; nr(b) && s(b); ) {
|
|
65
|
+
if ((b = (c = (u = b).parentElement) == null ? u.getRootNode().host || null : c) === h) {
|
|
66
|
+
p.push(b);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
b != null && b === document.body && gt(b) && !gt(document.documentElement) || b != null && gt(b, a) && p.push(b);
|
|
70
|
+
}
|
|
71
|
+
for (var O = r.visualViewport ? r.visualViewport.width : innerWidth, _ = r.visualViewport ? r.visualViewport.height : innerHeight, w = window.scrollX || pageXOffset, m = window.scrollY || pageYOffset, S = e.getBoundingClientRect(), B = S.height, M = S.width, N = S.top, Y = S.right, j = S.bottom, T = S.left, z = l === "start" || l === "nearest" ? N : l === "end" ? j : N + B / 2, x = o === "center" ? T + M / 2 : o === "end" ? Y : T, Q = [], U = 0; U < p.length; U++) {
|
|
72
|
+
var P = p[U], oe = P.getBoundingClientRect(), te = oe.height, q = oe.width, W = oe.top, E = oe.right, k = oe.bottom, f = oe.left;
|
|
73
|
+
if (n === "if-needed" && N >= 0 && T >= 0 && j <= _ && Y <= O && N >= W && j <= k && T >= f && Y <= E)
|
|
74
|
+
return Q;
|
|
75
|
+
var y = getComputedStyle(P), $ = parseInt(y.borderLeftWidth, 10), A = parseInt(y.borderTopWidth, 10), Z = parseInt(y.borderRightWidth, 10), re = parseInt(y.borderBottomWidth, 10), V = 0, ie = 0, ae = "offsetWidth" in P ? P.offsetWidth - P.clientWidth - $ - Z : 0, ve = "offsetHeight" in P ? P.offsetHeight - P.clientHeight - A - re : 0, Ke = "offsetWidth" in P ? P.offsetWidth === 0 ? 0 : q / P.offsetWidth : 0, ke = "offsetHeight" in P ? P.offsetHeight === 0 ? 0 : te / P.offsetHeight : 0;
|
|
76
|
+
if (h === P)
|
|
77
|
+
V = l === "start" ? z : l === "end" ? z - _ : l === "nearest" ? Qe(m, m + _, _, A, re, m + z, m + z + B, B) : z - _ / 2, ie = o === "start" ? x : o === "center" ? x - O / 2 : o === "end" ? x - O : Qe(w, w + O, O, $, Z, w + x, w + x + M, M), V = Math.max(0, V + m), ie = Math.max(0, ie + w);
|
|
78
|
+
else {
|
|
79
|
+
V = l === "start" ? z - W - A : l === "end" ? z - k + re + ve : l === "nearest" ? Qe(W, k, te, A, re + ve, z, z + B, B) : z - (W + te / 2) + ve / 2, ie = o === "start" ? x - f - $ : o === "center" ? x - (f + q / 2) + ae / 2 : o === "end" ? x - E + Z + ae : Qe(f, E, q, $, Z + ae, x, x + M, M);
|
|
80
|
+
var xe = P.scrollLeft, $e = P.scrollTop;
|
|
81
|
+
z += $e - (V = Math.max(0, Math.min($e + V / ke, P.scrollHeight - te / ke + ve))), x += xe - (ie = Math.max(0, Math.min(xe + ie / Ke, P.scrollWidth - q / Ke + ae)));
|
|
82
|
+
}
|
|
83
|
+
Q.push({ el: P, top: V, left: ie });
|
|
84
|
+
}
|
|
85
|
+
return Q;
|
|
86
|
+
};
|
|
87
|
+
function Hr(e) {
|
|
88
|
+
return e === Object(e) && Object.keys(e).length !== 0;
|
|
89
|
+
}
|
|
90
|
+
function nl(e, t) {
|
|
91
|
+
t === void 0 && (t = "auto");
|
|
92
|
+
var r = "scrollBehavior" in document.body.style;
|
|
93
|
+
e.forEach(function(n) {
|
|
94
|
+
var l = n.el, o = n.top, i = n.left;
|
|
95
|
+
l.scroll && r ? l.scroll({
|
|
96
|
+
top: o,
|
|
97
|
+
left: i,
|
|
98
|
+
behavior: t
|
|
99
|
+
}) : (l.scrollTop = o, l.scrollLeft = i);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function ll(e) {
|
|
103
|
+
return e === !1 ? {
|
|
104
|
+
block: "end",
|
|
105
|
+
inline: "nearest"
|
|
106
|
+
} : Hr(e) ? e : {
|
|
107
|
+
block: "start",
|
|
108
|
+
inline: "nearest"
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function ol(e, t) {
|
|
112
|
+
var r = e.isConnected || e.ownerDocument.documentElement.contains(e);
|
|
113
|
+
if (Hr(t) && typeof t.behavior == "function")
|
|
114
|
+
return t.behavior(r ? or(e, t) : []);
|
|
115
|
+
if (r) {
|
|
116
|
+
var n = ll(t);
|
|
117
|
+
return nl(or(e, n), n.behavior);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const xt = Symbol("ArcoFormItemContext"), Rt = Symbol("ArcoFormContext"), Ue = Object.prototype.toString;
|
|
121
|
+
function Ee(e) {
|
|
122
|
+
return Ue.call(e) === "[object Array]";
|
|
123
|
+
}
|
|
124
|
+
function il(e) {
|
|
125
|
+
return Ue.call(e) === "[object Boolean]";
|
|
126
|
+
}
|
|
127
|
+
function Ye(e) {
|
|
128
|
+
return Ue.call(e) === "[object Object]";
|
|
129
|
+
}
|
|
130
|
+
function He(e) {
|
|
131
|
+
return Ue.call(e) === "[object String]";
|
|
132
|
+
}
|
|
133
|
+
function ce(e) {
|
|
134
|
+
return Ue.call(e) === "[object Number]" && e === e;
|
|
135
|
+
}
|
|
136
|
+
function Gr(e) {
|
|
137
|
+
return e === void 0;
|
|
138
|
+
}
|
|
139
|
+
function it(e) {
|
|
140
|
+
return typeof e == "function";
|
|
141
|
+
}
|
|
142
|
+
const Ur = (e, {
|
|
143
|
+
defaultValue: t = "medium"
|
|
144
|
+
} = {}) => {
|
|
145
|
+
const r = J(ht, void 0);
|
|
146
|
+
return {
|
|
147
|
+
mergedSize: d(() => {
|
|
148
|
+
var l, o;
|
|
149
|
+
return (o = (l = e == null ? void 0 : e.value) != null ? l : r == null ? void 0 : r.size) != null ? o : t;
|
|
150
|
+
})
|
|
151
|
+
};
|
|
152
|
+
}, ir = ["success", "warning", "error", "validating"], al = (e) => {
|
|
153
|
+
let t = "";
|
|
154
|
+
for (const r of Object.keys(e)) {
|
|
155
|
+
const n = e[r];
|
|
156
|
+
n && (!t || ir.indexOf(n) > ir.indexOf(t)) && (t = e[r]);
|
|
157
|
+
}
|
|
158
|
+
return t;
|
|
159
|
+
}, sl = (e) => {
|
|
160
|
+
const t = [];
|
|
161
|
+
for (const r of Object.keys(e)) {
|
|
162
|
+
const n = e[r];
|
|
163
|
+
n && t.push(n);
|
|
164
|
+
}
|
|
165
|
+
return t;
|
|
166
|
+
}, Yr = (e, t) => {
|
|
167
|
+
const r = t.replace(/[[.]/g, "_").replace(/\]/g, "");
|
|
168
|
+
return e ? `${e}-${r}` : `${r}`;
|
|
169
|
+
};
|
|
170
|
+
var X = (e, t) => {
|
|
171
|
+
for (const [r, n] of t)
|
|
172
|
+
e[r] = n;
|
|
173
|
+
return e;
|
|
174
|
+
}, ul = Object.defineProperty, ar = Object.getOwnPropertySymbols, cl = Object.prototype.hasOwnProperty, dl = Object.prototype.propertyIsEnumerable, sr = (e, t, r) => t in e ? ul(e, t, {
|
|
175
|
+
enumerable: !0,
|
|
176
|
+
configurable: !0,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: r
|
|
179
|
+
}) : e[t] = r, fl = (e, t) => {
|
|
180
|
+
for (var r in t || (t = {}))
|
|
181
|
+
cl.call(t, r) && sr(e, r, t[r]);
|
|
182
|
+
if (ar)
|
|
183
|
+
for (var r of ar(t))
|
|
184
|
+
dl.call(t, r) && sr(e, r, t[r]);
|
|
185
|
+
return e;
|
|
186
|
+
};
|
|
187
|
+
const hl = I({
|
|
188
|
+
name: "Form",
|
|
189
|
+
props: {
|
|
190
|
+
model: {
|
|
191
|
+
type: Object,
|
|
192
|
+
required: !0
|
|
193
|
+
},
|
|
194
|
+
layout: {
|
|
195
|
+
type: String,
|
|
196
|
+
default: "horizontal"
|
|
197
|
+
},
|
|
198
|
+
size: {
|
|
199
|
+
type: String
|
|
200
|
+
},
|
|
201
|
+
labelColProps: {
|
|
202
|
+
type: Object,
|
|
203
|
+
default: () => ({
|
|
204
|
+
span: 5,
|
|
205
|
+
offset: 0
|
|
206
|
+
})
|
|
207
|
+
},
|
|
208
|
+
wrapperColProps: {
|
|
209
|
+
type: Object,
|
|
210
|
+
default: () => ({
|
|
211
|
+
span: 19,
|
|
212
|
+
offset: 0
|
|
213
|
+
})
|
|
214
|
+
},
|
|
215
|
+
labelColStyle: Object,
|
|
216
|
+
wrapperColStyle: Object,
|
|
217
|
+
labelAlign: {
|
|
218
|
+
type: String,
|
|
219
|
+
default: "right"
|
|
220
|
+
},
|
|
221
|
+
disabled: {
|
|
222
|
+
type: Boolean,
|
|
223
|
+
default: void 0
|
|
224
|
+
},
|
|
225
|
+
rules: {
|
|
226
|
+
type: Object
|
|
227
|
+
},
|
|
228
|
+
autoLabelWidth: {
|
|
229
|
+
type: Boolean,
|
|
230
|
+
default: !1
|
|
231
|
+
},
|
|
232
|
+
id: {
|
|
233
|
+
type: String
|
|
234
|
+
},
|
|
235
|
+
scrollToFirstError: {
|
|
236
|
+
type: Boolean,
|
|
237
|
+
default: !1
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
emits: {
|
|
241
|
+
submit: (e, t) => !0,
|
|
242
|
+
submitSuccess: (e, t) => !0,
|
|
243
|
+
submitFailed: (e, t) => !0
|
|
244
|
+
},
|
|
245
|
+
setup(e, {
|
|
246
|
+
emit: t
|
|
247
|
+
}) {
|
|
248
|
+
const r = G("form"), n = F(), {
|
|
249
|
+
id: l,
|
|
250
|
+
model: o,
|
|
251
|
+
layout: i,
|
|
252
|
+
disabled: a,
|
|
253
|
+
labelAlign: s,
|
|
254
|
+
labelColProps: u,
|
|
255
|
+
wrapperColProps: c,
|
|
256
|
+
labelColStyle: h,
|
|
257
|
+
wrapperColStyle: p,
|
|
258
|
+
size: b,
|
|
259
|
+
rules: O
|
|
260
|
+
} = ye(e), {
|
|
261
|
+
mergedSize: _
|
|
262
|
+
} = Ur(b), w = d(() => e.layout === "horizontal" && e.autoLabelWidth), m = [], S = [], B = le({}), M = d(() => Math.max(...Object.values(B))), N = (E) => {
|
|
263
|
+
E && E.field && m.push(E);
|
|
264
|
+
}, Y = (E) => {
|
|
265
|
+
E && E.field && m.splice(m.indexOf(E), 1);
|
|
266
|
+
}, j = (E) => {
|
|
267
|
+
m.forEach((k) => {
|
|
268
|
+
E[k.field] && k.setField(E[k.field]);
|
|
269
|
+
});
|
|
270
|
+
}, T = (E, k) => {
|
|
271
|
+
k && B[k] !== E && (B[k] = E);
|
|
272
|
+
}, z = (E) => {
|
|
273
|
+
E && delete B[E];
|
|
274
|
+
}, x = (E) => {
|
|
275
|
+
const k = E ? [].concat(E) : [];
|
|
276
|
+
m.forEach((f) => {
|
|
277
|
+
(k.length === 0 || k.includes(f.field)) && f.resetField();
|
|
278
|
+
});
|
|
279
|
+
}, Q = (E) => {
|
|
280
|
+
const k = E ? [].concat(E) : [];
|
|
281
|
+
m.forEach((f) => {
|
|
282
|
+
(k.length === 0 || k.includes(f.field)) && f.clearValidate();
|
|
283
|
+
});
|
|
284
|
+
}, U = (E, k) => {
|
|
285
|
+
const y = (n.value || document.body).querySelector(`#${Yr(e.id, E)}`);
|
|
286
|
+
y && ol(y, fl({
|
|
287
|
+
behavior: "smooth",
|
|
288
|
+
block: "nearest",
|
|
289
|
+
scrollMode: "if-needed"
|
|
290
|
+
}, k));
|
|
291
|
+
}, P = (E) => {
|
|
292
|
+
const k = il(e.scrollToFirstError) ? void 0 : e.scrollToFirstError;
|
|
293
|
+
U(E, k);
|
|
294
|
+
}, oe = (E) => {
|
|
295
|
+
const k = [];
|
|
296
|
+
return m.forEach((f) => {
|
|
297
|
+
k.push(f.validate());
|
|
298
|
+
}), Promise.all(k).then((f) => {
|
|
299
|
+
const y = {};
|
|
300
|
+
let $ = !1;
|
|
301
|
+
return f.forEach((A) => {
|
|
302
|
+
A && ($ = !0, y[A.field] = A);
|
|
303
|
+
}), $ && e.scrollToFirstError && P(Object.keys(y)[0]), it(E) && E($ ? y : void 0), $ ? y : void 0;
|
|
304
|
+
});
|
|
305
|
+
}, te = (E, k) => {
|
|
306
|
+
const f = [];
|
|
307
|
+
for (const y of m)
|
|
308
|
+
(Ee(E) && E.includes(y.field) || E === y.field) && f.push(y.validate());
|
|
309
|
+
return Promise.all(f).then((y) => {
|
|
310
|
+
const $ = {};
|
|
311
|
+
let A = !1;
|
|
312
|
+
return y.forEach((Z) => {
|
|
313
|
+
Z && (A = !0, $[Z.field] = Z);
|
|
314
|
+
}), A && e.scrollToFirstError && P(Object.keys($)[0]), it(k) && k(A ? $ : void 0), A ? $ : void 0;
|
|
315
|
+
});
|
|
316
|
+
}, q = (E) => {
|
|
317
|
+
const k = [];
|
|
318
|
+
m.forEach((f) => {
|
|
319
|
+
k.push(f.validate());
|
|
320
|
+
}), Promise.all(k).then((f) => {
|
|
321
|
+
const y = {};
|
|
322
|
+
let $ = !1;
|
|
323
|
+
f.forEach((A) => {
|
|
324
|
+
A && ($ = !0, y[A.field] = A);
|
|
325
|
+
}), $ ? (e.scrollToFirstError && P(Object.keys(y)[0]), t("submitFailed", {
|
|
326
|
+
values: o.value,
|
|
327
|
+
errors: y
|
|
328
|
+
}, E)) : t("submitSuccess", o.value, E), t("submit", {
|
|
329
|
+
values: o.value,
|
|
330
|
+
errors: $ ? y : void 0
|
|
331
|
+
}, E);
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
return ge(Rt, le({
|
|
335
|
+
id: l,
|
|
336
|
+
layout: i,
|
|
337
|
+
disabled: a,
|
|
338
|
+
labelAlign: s,
|
|
339
|
+
labelColProps: u,
|
|
340
|
+
wrapperColProps: c,
|
|
341
|
+
labelColStyle: h,
|
|
342
|
+
wrapperColStyle: p,
|
|
343
|
+
model: o,
|
|
344
|
+
size: _,
|
|
345
|
+
rules: O,
|
|
346
|
+
fields: m,
|
|
347
|
+
touchedFields: S,
|
|
348
|
+
addField: N,
|
|
349
|
+
removeField: Y,
|
|
350
|
+
validateField: te,
|
|
351
|
+
setLabelWidth: T,
|
|
352
|
+
removeLabelWidth: z,
|
|
353
|
+
maxLabelWidth: M,
|
|
354
|
+
autoLabelWidth: w
|
|
355
|
+
})), {
|
|
356
|
+
cls: d(() => [r, `${r}-layout-${e.layout}`, `${r}-size-${_.value}`, {
|
|
357
|
+
[`${r}-auto-label-width`]: e.autoLabelWidth
|
|
358
|
+
}]),
|
|
359
|
+
formRef: n,
|
|
360
|
+
handleSubmit: q,
|
|
361
|
+
innerValidate: oe,
|
|
362
|
+
innerValidateField: te,
|
|
363
|
+
innerResetFields: x,
|
|
364
|
+
innerClearValidate: Q,
|
|
365
|
+
innerSetFields: j,
|
|
366
|
+
innerScrollToField: U
|
|
367
|
+
};
|
|
368
|
+
},
|
|
369
|
+
methods: {
|
|
370
|
+
validate(e) {
|
|
371
|
+
return this.innerValidate(e);
|
|
372
|
+
},
|
|
373
|
+
validateField(e, t) {
|
|
374
|
+
return this.innerValidateField(e, t);
|
|
375
|
+
},
|
|
376
|
+
resetFields(e) {
|
|
377
|
+
return this.innerResetFields(e);
|
|
378
|
+
},
|
|
379
|
+
clearValidate(e) {
|
|
380
|
+
return this.innerClearValidate(e);
|
|
381
|
+
},
|
|
382
|
+
setFields(e) {
|
|
383
|
+
return this.innerSetFields(e);
|
|
384
|
+
},
|
|
385
|
+
scrollToField(e) {
|
|
386
|
+
return this.innerScrollToField(e);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
function vl(e, t, r, n, l, o) {
|
|
391
|
+
return L(), H("form", {
|
|
392
|
+
ref: "formRef",
|
|
393
|
+
class: D(e.cls),
|
|
394
|
+
onSubmit: t[0] || (t[0] = $n((...i) => e.handleSubmit && e.handleSubmit(...i), ["prevent"]))
|
|
395
|
+
}, [R(e.$slots, "default")], 34);
|
|
396
|
+
}
|
|
397
|
+
var wt = /* @__PURE__ */ X(hl, [["render", vl]]), Ve = Object.prototype.toString;
|
|
398
|
+
function vt(e) {
|
|
399
|
+
return Ve.call(e) === "[object Array]";
|
|
400
|
+
}
|
|
401
|
+
function be(e) {
|
|
402
|
+
return Ve.call(e) === "[object Object]";
|
|
403
|
+
}
|
|
404
|
+
function Nt(e) {
|
|
405
|
+
return Ve.call(e) === "[object String]";
|
|
406
|
+
}
|
|
407
|
+
function pl(e) {
|
|
408
|
+
return Ve.call(e) === "[object Number]" && e === e;
|
|
409
|
+
}
|
|
410
|
+
function ml(e) {
|
|
411
|
+
return Ve.call(e) === "[object Boolean]";
|
|
412
|
+
}
|
|
413
|
+
function It(e) {
|
|
414
|
+
return Ve.call(e) === "[object Function]";
|
|
415
|
+
}
|
|
416
|
+
function bl(e) {
|
|
417
|
+
return be(e) && Object.keys(e).length === 0;
|
|
418
|
+
}
|
|
419
|
+
function je(e) {
|
|
420
|
+
return e == null || e === "";
|
|
421
|
+
}
|
|
422
|
+
function Kr(e) {
|
|
423
|
+
return vt(e) && !e.length;
|
|
424
|
+
}
|
|
425
|
+
var Ht = function(e, t) {
|
|
426
|
+
if (typeof e != "object" || typeof t != "object")
|
|
427
|
+
return e === t;
|
|
428
|
+
if (It(e) && It(t))
|
|
429
|
+
return e === t || e.toString() === t.toString();
|
|
430
|
+
if (Object.keys(e).length !== Object.keys(t).length)
|
|
431
|
+
return !1;
|
|
432
|
+
for (var r in e) {
|
|
433
|
+
var n = Ht(e[r], t[r]);
|
|
434
|
+
if (!n)
|
|
435
|
+
return !1;
|
|
436
|
+
}
|
|
437
|
+
return !0;
|
|
438
|
+
}, Gt = function(e, t) {
|
|
439
|
+
var r = Object.assign({}, e);
|
|
440
|
+
return Object.keys(t || {}).forEach(function(n) {
|
|
441
|
+
var l = r[n], o = t == null ? void 0 : t[n];
|
|
442
|
+
r[n] = be(l) ? Object.assign(Object.assign({}, l), o) : o || l;
|
|
443
|
+
}), r;
|
|
444
|
+
}, yl = function(e, t) {
|
|
445
|
+
for (var r = t.split("."), n = e, l = 0; l < r.length; l++)
|
|
446
|
+
if (n = n && n[r[l]], n === void 0)
|
|
447
|
+
return n;
|
|
448
|
+
return n;
|
|
449
|
+
}, we = "#{field} is not a #{type} type", gl = {
|
|
450
|
+
required: "#{field} is required",
|
|
451
|
+
type: {
|
|
452
|
+
ip: we,
|
|
453
|
+
email: we,
|
|
454
|
+
url: we,
|
|
455
|
+
string: we,
|
|
456
|
+
number: we,
|
|
457
|
+
array: we,
|
|
458
|
+
object: we,
|
|
459
|
+
boolean: we
|
|
460
|
+
},
|
|
461
|
+
number: {
|
|
462
|
+
min: "`#{value}` is not greater than `#{min}`",
|
|
463
|
+
max: "`#{value}` is not less than `#{max}`",
|
|
464
|
+
equal: "`#{value}` is not equal to `#{equal}`",
|
|
465
|
+
range: "`#{value}` is not in range `#{min} ~ #{max}`",
|
|
466
|
+
positive: "`#{value}` is not a positive number",
|
|
467
|
+
negative: "`#{value}` is not a negative number"
|
|
468
|
+
},
|
|
469
|
+
string: {
|
|
470
|
+
maxLength: "#{field} cannot be longer than #{maxLength} characters",
|
|
471
|
+
minLength: "#{field} must be at least #{minLength} characters",
|
|
472
|
+
length: "#{field} must be exactly #{length} characters",
|
|
473
|
+
match: "`#{value}` does not match pattern #{pattern}",
|
|
474
|
+
uppercase: "`#{value}` must be all uppercase",
|
|
475
|
+
lowercase: "`#{value}` must be all lowercased"
|
|
476
|
+
},
|
|
477
|
+
array: {
|
|
478
|
+
length: "#{field} must be exactly #{length} in length",
|
|
479
|
+
minLength: "#{field} cannot be less than #{minLength} in length",
|
|
480
|
+
maxLength: "#{field} cannot be greater than #{maxLength} in length",
|
|
481
|
+
includes: "#{field} is not includes #{includes}",
|
|
482
|
+
deepEqual: "#{field} is not deep equal with #{deepEqual}",
|
|
483
|
+
empty: "#{field} is not an empty array"
|
|
484
|
+
},
|
|
485
|
+
object: {
|
|
486
|
+
deepEqual: "#{field} is not deep equal to expected value",
|
|
487
|
+
hasKeys: "#{field} does not contain required fields",
|
|
488
|
+
empty: "#{field} is not an empty object"
|
|
489
|
+
},
|
|
490
|
+
boolean: {
|
|
491
|
+
true: "Expect true but got `#{value}`",
|
|
492
|
+
false: "Expect false but got `#{value}`"
|
|
493
|
+
}
|
|
494
|
+
}, de = function(t, r) {
|
|
495
|
+
var n = this;
|
|
496
|
+
this.getValidateMsg = function(l, o) {
|
|
497
|
+
o === void 0 && (o = {});
|
|
498
|
+
var i = Object.assign(Object.assign({}, o), {
|
|
499
|
+
value: n.obj,
|
|
500
|
+
field: n.field,
|
|
501
|
+
type: n.type
|
|
502
|
+
}), a = yl(n.validateMessages, l);
|
|
503
|
+
return It(a) ? a(i) : Nt(a) ? a.replace(/\#\{.+?\}/g, function(s) {
|
|
504
|
+
var u = s.slice(2, -1);
|
|
505
|
+
if (u in i) {
|
|
506
|
+
if (be(i[u]) || vt(i[u]))
|
|
507
|
+
try {
|
|
508
|
+
return JSON.stringify(i[u]);
|
|
509
|
+
} catch {
|
|
510
|
+
return i[u];
|
|
511
|
+
}
|
|
512
|
+
return String(i[u]);
|
|
513
|
+
}
|
|
514
|
+
return s;
|
|
515
|
+
}) : a;
|
|
516
|
+
}, be(r) && Nt(t) && r.trim ? this.obj = t.trim() : be(r) && r.ignoreEmptyString && t === "" ? this.obj = void 0 : this.obj = t, this.message = r.message, this.type = r.type, this.error = null, this.field = r.field || r.type, this.validateMessages = Gt(gl, r.validateMessages);
|
|
517
|
+
}, pt = {
|
|
518
|
+
not: {
|
|
519
|
+
configurable: !0
|
|
520
|
+
},
|
|
521
|
+
isRequired: {
|
|
522
|
+
configurable: !0
|
|
523
|
+
},
|
|
524
|
+
end: {
|
|
525
|
+
configurable: !0
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
pt.not.get = function() {
|
|
529
|
+
return this._not = !this._not, this;
|
|
530
|
+
};
|
|
531
|
+
pt.isRequired.get = function() {
|
|
532
|
+
if (je(this.obj) || Kr(this.obj)) {
|
|
533
|
+
var e = this.getValidateMsg("required");
|
|
534
|
+
this.error = {
|
|
535
|
+
value: this.obj,
|
|
536
|
+
type: this.type,
|
|
537
|
+
requiredError: !0,
|
|
538
|
+
message: this.message || (be(e) ? e : (this._not ? "[NOT MODE]:" : "") + e)
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
return this;
|
|
542
|
+
};
|
|
543
|
+
pt.end.get = function() {
|
|
544
|
+
return this.error;
|
|
545
|
+
};
|
|
546
|
+
de.prototype.addError = function(t) {
|
|
547
|
+
!this.error && t && (this.error = {
|
|
548
|
+
value: this.obj,
|
|
549
|
+
type: this.type,
|
|
550
|
+
message: this.message || (be(t) ? t : (this._not ? "[NOT MODE]:" : "") + t)
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
de.prototype.validate = function(t, r) {
|
|
554
|
+
var n = this._not ? t : !t;
|
|
555
|
+
return n && this.addError(r), this;
|
|
556
|
+
};
|
|
557
|
+
de.prototype.collect = function(t) {
|
|
558
|
+
t && t(this.error);
|
|
559
|
+
};
|
|
560
|
+
Object.defineProperties(de.prototype, pt);
|
|
561
|
+
var wl = /* @__PURE__ */ function(e) {
|
|
562
|
+
function t(n, l) {
|
|
563
|
+
e.call(this, n, Object.assign(Object.assign({}, l), {
|
|
564
|
+
type: "string"
|
|
565
|
+
})), this.validate(l && l.strict ? Nt(this.obj) : !0, this.getValidateMsg("type.string"));
|
|
566
|
+
}
|
|
567
|
+
e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
|
|
568
|
+
var r = {
|
|
569
|
+
uppercase: {
|
|
570
|
+
configurable: !0
|
|
571
|
+
},
|
|
572
|
+
lowercase: {
|
|
573
|
+
configurable: !0
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
return t.prototype.maxLength = function(l) {
|
|
577
|
+
return this.obj ? this.validate(this.obj.length <= l, this.getValidateMsg("string.maxLength", {
|
|
578
|
+
maxLength: l
|
|
579
|
+
})) : this;
|
|
580
|
+
}, t.prototype.minLength = function(l) {
|
|
581
|
+
return this.obj ? this.validate(this.obj.length >= l, this.getValidateMsg("string.minLength", {
|
|
582
|
+
minLength: l
|
|
583
|
+
})) : this;
|
|
584
|
+
}, t.prototype.length = function(l) {
|
|
585
|
+
return this.obj ? this.validate(this.obj.length === l, this.getValidateMsg("string.length", {
|
|
586
|
+
length: l
|
|
587
|
+
})) : this;
|
|
588
|
+
}, t.prototype.match = function(l) {
|
|
589
|
+
var o = l instanceof RegExp;
|
|
590
|
+
return o && (l.lastIndex = 0), this.validate(this.obj === void 0 || o && l.test(this.obj), this.getValidateMsg("string.match", {
|
|
591
|
+
pattern: l
|
|
592
|
+
}));
|
|
593
|
+
}, r.uppercase.get = function() {
|
|
594
|
+
return this.obj ? this.validate(this.obj.toUpperCase() === this.obj, this.getValidateMsg("string.uppercase")) : this;
|
|
595
|
+
}, r.lowercase.get = function() {
|
|
596
|
+
return this.obj ? this.validate(this.obj.toLowerCase() === this.obj, this.getValidateMsg("string.lowercase")) : this;
|
|
597
|
+
}, Object.defineProperties(t.prototype, r), t;
|
|
598
|
+
}(de), _l = /* @__PURE__ */ function(e) {
|
|
599
|
+
function t(n, l) {
|
|
600
|
+
e.call(this, n, Object.assign(Object.assign({}, l), {
|
|
601
|
+
type: "number"
|
|
602
|
+
})), this.validate(l && l.strict ? pl(this.obj) : !0, this.getValidateMsg("type.number"));
|
|
603
|
+
}
|
|
604
|
+
e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
|
|
605
|
+
var r = {
|
|
606
|
+
positive: {
|
|
607
|
+
configurable: !0
|
|
608
|
+
},
|
|
609
|
+
negative: {
|
|
610
|
+
configurable: !0
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
return t.prototype.min = function(l) {
|
|
614
|
+
return je(this.obj) ? this : this.validate(this.obj >= l, this.getValidateMsg("number.min", {
|
|
615
|
+
min: l
|
|
616
|
+
}));
|
|
617
|
+
}, t.prototype.max = function(l) {
|
|
618
|
+
return je(this.obj) ? this : this.validate(this.obj <= l, this.getValidateMsg("number.max", {
|
|
619
|
+
max: l
|
|
620
|
+
}));
|
|
621
|
+
}, t.prototype.equal = function(l) {
|
|
622
|
+
return je(this.obj) ? this : this.validate(this.obj === l, this.getValidateMsg("number.equal", {
|
|
623
|
+
equal: l
|
|
624
|
+
}));
|
|
625
|
+
}, t.prototype.range = function(l, o) {
|
|
626
|
+
return je(this.obj) ? this : this.validate(this.obj >= l && this.obj <= o, this.getValidateMsg("number.range", {
|
|
627
|
+
min: l,
|
|
628
|
+
max: o
|
|
629
|
+
}));
|
|
630
|
+
}, r.positive.get = function() {
|
|
631
|
+
return je(this.obj) ? this : this.validate(this.obj > 0, this.getValidateMsg("number.positive"));
|
|
632
|
+
}, r.negative.get = function() {
|
|
633
|
+
return je(this.obj) ? this : this.validate(this.obj < 0, this.getValidateMsg("number.negative"));
|
|
634
|
+
}, Object.defineProperties(t.prototype, r), t;
|
|
635
|
+
}(de), El = /* @__PURE__ */ function(e) {
|
|
636
|
+
function t(n, l) {
|
|
637
|
+
e.call(this, n, Object.assign(Object.assign({}, l), {
|
|
638
|
+
type: "array"
|
|
639
|
+
})), this.validate(l && l.strict ? vt(this.obj) : !0, this.getValidateMsg("type.array", {
|
|
640
|
+
value: this.obj,
|
|
641
|
+
type: this.type
|
|
642
|
+
}));
|
|
643
|
+
}
|
|
644
|
+
e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
|
|
645
|
+
var r = {
|
|
646
|
+
empty: {
|
|
647
|
+
configurable: !0
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
return t.prototype.length = function(l) {
|
|
651
|
+
return this.obj ? this.validate(this.obj.length === l, this.getValidateMsg("array.length", {
|
|
652
|
+
value: this.obj,
|
|
653
|
+
length: l
|
|
654
|
+
})) : this;
|
|
655
|
+
}, t.prototype.minLength = function(l) {
|
|
656
|
+
return this.obj ? this.validate(this.obj.length >= l, this.getValidateMsg("array.minLength", {
|
|
657
|
+
value: this.obj,
|
|
658
|
+
minLength: l
|
|
659
|
+
})) : this;
|
|
660
|
+
}, t.prototype.maxLength = function(l) {
|
|
661
|
+
return this.obj ? this.validate(this.obj.length <= l, this.getValidateMsg("array.maxLength", {
|
|
662
|
+
value: this.obj,
|
|
663
|
+
maxLength: l
|
|
664
|
+
})) : this;
|
|
665
|
+
}, t.prototype.includes = function(l) {
|
|
666
|
+
var o = this;
|
|
667
|
+
return this.obj ? this.validate(l.every(function(i) {
|
|
668
|
+
return o.obj.indexOf(i) !== -1;
|
|
669
|
+
}), this.getValidateMsg("array.includes", {
|
|
670
|
+
value: this.obj,
|
|
671
|
+
includes: l
|
|
672
|
+
})) : this;
|
|
673
|
+
}, t.prototype.deepEqual = function(l) {
|
|
674
|
+
return this.obj ? this.validate(Ht(this.obj, l), this.getValidateMsg("array.deepEqual", {
|
|
675
|
+
value: this.obj,
|
|
676
|
+
deepEqual: l
|
|
677
|
+
})) : this;
|
|
678
|
+
}, r.empty.get = function() {
|
|
679
|
+
return this.validate(Kr(this.obj), this.getValidateMsg("array.empty", {
|
|
680
|
+
value: this.obj
|
|
681
|
+
}));
|
|
682
|
+
}, Object.defineProperties(t.prototype, r), t;
|
|
683
|
+
}(de), Cl = /* @__PURE__ */ function(e) {
|
|
684
|
+
function t(n, l) {
|
|
685
|
+
e.call(this, n, Object.assign(Object.assign({}, l), {
|
|
686
|
+
type: "object"
|
|
687
|
+
})), this.validate(l && l.strict ? be(this.obj) : !0, this.getValidateMsg("type.object"));
|
|
688
|
+
}
|
|
689
|
+
e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
|
|
690
|
+
var r = {
|
|
691
|
+
empty: {
|
|
692
|
+
configurable: !0
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
return t.prototype.deepEqual = function(l) {
|
|
696
|
+
return this.obj ? this.validate(Ht(this.obj, l), this.getValidateMsg("object.deepEqual", {
|
|
697
|
+
deepEqual: l
|
|
698
|
+
})) : this;
|
|
699
|
+
}, t.prototype.hasKeys = function(l) {
|
|
700
|
+
var o = this;
|
|
701
|
+
return this.obj ? this.validate(l.every(function(i) {
|
|
702
|
+
return o.obj[i];
|
|
703
|
+
}), this.getValidateMsg("object.hasKeys", {
|
|
704
|
+
keys: l
|
|
705
|
+
})) : this;
|
|
706
|
+
}, r.empty.get = function() {
|
|
707
|
+
return this.validate(bl(this.obj), this.getValidateMsg("object.empty"));
|
|
708
|
+
}, Object.defineProperties(t.prototype, r), t;
|
|
709
|
+
}(de), $l = /* @__PURE__ */ function(e) {
|
|
710
|
+
function t(n, l) {
|
|
711
|
+
e.call(this, n, Object.assign(Object.assign({}, l), {
|
|
712
|
+
type: "boolean"
|
|
713
|
+
})), this.validate(l && l.strict ? ml(this.obj) : !0, this.getValidateMsg("type.boolean"));
|
|
714
|
+
}
|
|
715
|
+
e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
|
|
716
|
+
var r = {
|
|
717
|
+
true: {
|
|
718
|
+
configurable: !0
|
|
719
|
+
},
|
|
720
|
+
false: {
|
|
721
|
+
configurable: !0
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
return r.true.get = function() {
|
|
725
|
+
return this.validate(this.obj === !0, this.getValidateMsg("boolean.true"));
|
|
726
|
+
}, r.false.get = function() {
|
|
727
|
+
return this.validate(this.obj === !1, this.getValidateMsg("boolean.false"));
|
|
728
|
+
}, Object.defineProperties(t.prototype, r), t;
|
|
729
|
+
}(de), Ol = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, Sl = new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"), jl = /^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/, kl = /* @__PURE__ */ function(e) {
|
|
730
|
+
function t(n, l) {
|
|
731
|
+
e.call(this, n, Object.assign(Object.assign({}, l), {
|
|
732
|
+
type: "type"
|
|
733
|
+
}));
|
|
734
|
+
}
|
|
735
|
+
e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
|
|
736
|
+
var r = {
|
|
737
|
+
email: {
|
|
738
|
+
configurable: !0
|
|
739
|
+
},
|
|
740
|
+
url: {
|
|
741
|
+
configurable: !0
|
|
742
|
+
},
|
|
743
|
+
ip: {
|
|
744
|
+
configurable: !0
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
return r.email.get = function() {
|
|
748
|
+
return this.type = "email", this.validate(this.obj === void 0 || Ol.test(this.obj), this.getValidateMsg("type.email"));
|
|
749
|
+
}, r.url.get = function() {
|
|
750
|
+
return this.type = "url", this.validate(this.obj === void 0 || Sl.test(this.obj), this.getValidateMsg("type.url"));
|
|
751
|
+
}, r.ip.get = function() {
|
|
752
|
+
return this.type = "ip", this.validate(this.obj === void 0 || jl.test(this.obj), this.getValidateMsg("type.ip"));
|
|
753
|
+
}, Object.defineProperties(t.prototype, r), t;
|
|
754
|
+
}(de), Pl = /* @__PURE__ */ function(e) {
|
|
755
|
+
function t(n, l) {
|
|
756
|
+
e.call(this, n, Object.assign(Object.assign({}, l), {
|
|
757
|
+
type: "custom"
|
|
758
|
+
}));
|
|
759
|
+
}
|
|
760
|
+
e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
|
|
761
|
+
var r = {
|
|
762
|
+
validate: {
|
|
763
|
+
configurable: !0
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
return r.validate.get = function() {
|
|
767
|
+
var n = this;
|
|
768
|
+
return function(l, o) {
|
|
769
|
+
var i;
|
|
770
|
+
if (l)
|
|
771
|
+
return i = l(n.obj, n.addError.bind(n)), i && i.then ? (o && i.then(function() {
|
|
772
|
+
o && o(n.error);
|
|
773
|
+
}, function(a) {
|
|
774
|
+
console.error(a);
|
|
775
|
+
}), [i, n]) : (o && o(n.error), n.error);
|
|
776
|
+
};
|
|
777
|
+
}, Object.defineProperties(t.prototype, r), t;
|
|
778
|
+
}(de), at = function(e, t) {
|
|
779
|
+
return new Xr(e, Object.assign({
|
|
780
|
+
field: "value"
|
|
781
|
+
}, t));
|
|
782
|
+
};
|
|
783
|
+
at.globalConfig = {};
|
|
784
|
+
at.setGlobalConfig = function(e) {
|
|
785
|
+
at.globalConfig = e || {};
|
|
786
|
+
};
|
|
787
|
+
var Xr = function(t, r) {
|
|
788
|
+
var n = at.globalConfig, l = Object.assign(Object.assign(Object.assign({}, n), r), {
|
|
789
|
+
validateMessages: Gt(n.validateMessages, r.validateMessages)
|
|
790
|
+
});
|
|
791
|
+
this.string = new wl(t, l), this.number = new _l(t, l), this.array = new El(t, l), this.object = new Cl(t, l), this.boolean = new $l(t, l), this.type = new kl(t, l), this.custom = new Pl(t, l);
|
|
792
|
+
}, Ut = function(t, r) {
|
|
793
|
+
r === void 0 && (r = {}), this.schema = t, this.options = r;
|
|
794
|
+
};
|
|
795
|
+
Ut.prototype.messages = function(t) {
|
|
796
|
+
this.options = Object.assign(Object.assign({}, this.options), {
|
|
797
|
+
validateMessages: Gt(this.options.validateMessages, t)
|
|
798
|
+
});
|
|
799
|
+
};
|
|
800
|
+
Ut.prototype.validate = function(t, r) {
|
|
801
|
+
var n = this;
|
|
802
|
+
if (!be(t))
|
|
803
|
+
return;
|
|
804
|
+
var l = [], o = null;
|
|
805
|
+
function i(a, s) {
|
|
806
|
+
o || (o = {}), (!o[a] || s.requiredError) && (o[a] = s);
|
|
807
|
+
}
|
|
808
|
+
this.schema && Object.keys(this.schema).forEach(function(a) {
|
|
809
|
+
if (vt(n.schema[a]))
|
|
810
|
+
for (var s = function(h) {
|
|
811
|
+
var p = n.schema[a][h], b = p.type, O = p.message;
|
|
812
|
+
if (!b && !p.validator)
|
|
813
|
+
throw "You must specify a type to field " + a + "!";
|
|
814
|
+
var _ = Object.assign(Object.assign({}, n.options), {
|
|
815
|
+
message: O,
|
|
816
|
+
field: a
|
|
817
|
+
});
|
|
818
|
+
"ignoreEmptyString" in p && (_.ignoreEmptyString = p.ignoreEmptyString), "strict" in p && (_.strict = p.strict);
|
|
819
|
+
var w = new Xr(t[a], _), m = w.type[b] || null;
|
|
820
|
+
if (!m)
|
|
821
|
+
if (p.validator) {
|
|
822
|
+
m = w.custom.validate(p.validator), Object.prototype.toString.call(m) === "[object Array]" && m[0].then ? l.push({
|
|
823
|
+
function: m[0],
|
|
824
|
+
_this: m[1],
|
|
825
|
+
key: a
|
|
826
|
+
}) : m && i(a, m);
|
|
827
|
+
return;
|
|
828
|
+
} else
|
|
829
|
+
m = w[b];
|
|
830
|
+
if (Object.keys(p).forEach(function(S) {
|
|
831
|
+
p.required && (m = m.isRequired), S !== "message" && m[S] && p[S] && typeof m[S] == "object" && (m = m[S]), m[S] && p[S] !== void 0 && typeof m[S] == "function" && (m = m[S](p[S]));
|
|
832
|
+
}), m.collect(function(S) {
|
|
833
|
+
S && i(a, S);
|
|
834
|
+
}), o)
|
|
835
|
+
return "break";
|
|
836
|
+
}, u = 0; u < n.schema[a].length; u++) {
|
|
837
|
+
var c = s(u);
|
|
838
|
+
if (c === "break")
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
}), l.length > 0 ? Promise.all(l.map(function(a) {
|
|
842
|
+
return a.function;
|
|
843
|
+
})).then(function() {
|
|
844
|
+
l.forEach(function(a) {
|
|
845
|
+
a._this.error && i(a.key, a._this.error);
|
|
846
|
+
}), r && r(o);
|
|
847
|
+
}) : r && r(o);
|
|
848
|
+
};
|
|
849
|
+
const Zr = Symbol("RowContextInjectionKey"), Qr = Symbol("GridContextInjectionKey"), Jr = Symbol("GridDataCollectorInjectionKey");
|
|
850
|
+
var Fl = Object.defineProperty, Ll = Object.defineProperties, Tl = Object.getOwnPropertyDescriptors, ur = Object.getOwnPropertySymbols, Ml = Object.prototype.hasOwnProperty, Al = Object.prototype.propertyIsEnumerable, cr = (e, t, r) => t in e ? Fl(e, t, {
|
|
851
|
+
enumerable: !0,
|
|
852
|
+
configurable: !0,
|
|
853
|
+
writable: !0,
|
|
854
|
+
value: r
|
|
855
|
+
}) : e[t] = r, Dl = (e, t) => {
|
|
856
|
+
for (var r in t || (t = {}))
|
|
857
|
+
Ml.call(t, r) && cr(e, r, t[r]);
|
|
858
|
+
if (ur)
|
|
859
|
+
for (var r of ur(t))
|
|
860
|
+
Al.call(t, r) && cr(e, r, t[r]);
|
|
861
|
+
return e;
|
|
862
|
+
}, Bl = (e, t) => Ll(e, Tl(t));
|
|
863
|
+
const st = ["xxl", "xl", "lg", "md", "sm", "xs"], Je = {
|
|
864
|
+
xs: "(max-width: 575px)",
|
|
865
|
+
sm: "(min-width: 576px)",
|
|
866
|
+
md: "(min-width: 768px)",
|
|
867
|
+
lg: "(min-width: 992px)",
|
|
868
|
+
xl: "(min-width: 1200px)",
|
|
869
|
+
xxl: "(min-width: 1600px)"
|
|
870
|
+
};
|
|
871
|
+
let Se = [], Vl = -1, et = {};
|
|
872
|
+
const dr = {
|
|
873
|
+
matchHandlers: {},
|
|
874
|
+
dispatch(e, t) {
|
|
875
|
+
return et = e, Se.length < 1 ? !1 : (Se.forEach((r) => {
|
|
876
|
+
r.func(et, t);
|
|
877
|
+
}), !0);
|
|
878
|
+
},
|
|
879
|
+
subscribe(e) {
|
|
880
|
+
Se.length === 0 && this.register();
|
|
881
|
+
const t = (++Vl).toString();
|
|
882
|
+
return Se.push({
|
|
883
|
+
token: t,
|
|
884
|
+
func: e
|
|
885
|
+
}), e(et, null), t;
|
|
886
|
+
},
|
|
887
|
+
unsubscribe(e) {
|
|
888
|
+
Se = Se.filter((t) => t.token !== e), Se.length === 0 && this.unregister();
|
|
889
|
+
},
|
|
890
|
+
unregister() {
|
|
891
|
+
Object.keys(Je).forEach((e) => {
|
|
892
|
+
const t = Je[e];
|
|
893
|
+
if (!t)
|
|
894
|
+
return;
|
|
895
|
+
const r = this.matchHandlers[t];
|
|
896
|
+
r && r.mql && r.listener && (r.mql.removeEventListener ? r.mql.removeEventListener("change", r.listener) : r.mql.removeListener(r.listener));
|
|
897
|
+
});
|
|
898
|
+
},
|
|
899
|
+
register() {
|
|
900
|
+
Object.keys(Je).forEach((e) => {
|
|
901
|
+
const t = Je[e];
|
|
902
|
+
if (!t)
|
|
903
|
+
return;
|
|
904
|
+
const r = ({
|
|
905
|
+
matches: l
|
|
906
|
+
}) => {
|
|
907
|
+
this.dispatch(Bl(Dl({}, et), {
|
|
908
|
+
[e]: l
|
|
909
|
+
}), e);
|
|
910
|
+
}, n = window.matchMedia(t);
|
|
911
|
+
n.addEventListener ? n.addEventListener("change", r) : n.addListener(r), this.matchHandlers[t] = {
|
|
912
|
+
mql: n,
|
|
913
|
+
listener: r
|
|
914
|
+
}, r(n);
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
function fr(e) {
|
|
919
|
+
return Ye(e);
|
|
920
|
+
}
|
|
921
|
+
function _e(e, t, r = !1) {
|
|
922
|
+
const n = F({
|
|
923
|
+
xs: !0,
|
|
924
|
+
sm: !0,
|
|
925
|
+
md: !0,
|
|
926
|
+
lg: !0,
|
|
927
|
+
xl: !0,
|
|
928
|
+
xxl: !0
|
|
929
|
+
}), l = d(() => {
|
|
930
|
+
let i = t;
|
|
931
|
+
if (fr(e.value))
|
|
932
|
+
for (let a = 0; a < st.length; a++) {
|
|
933
|
+
const s = st[a];
|
|
934
|
+
if ((n.value[s] || s === "xs" && r) && e.value[s] !== void 0) {
|
|
935
|
+
i = e.value[s];
|
|
936
|
+
break;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
else
|
|
940
|
+
i = e.value;
|
|
941
|
+
return i;
|
|
942
|
+
});
|
|
943
|
+
let o = "";
|
|
944
|
+
return he(() => {
|
|
945
|
+
o = dr.subscribe((i) => {
|
|
946
|
+
fr(e.value) && (n.value = i);
|
|
947
|
+
});
|
|
948
|
+
}), Wr(() => {
|
|
949
|
+
o && dr.unsubscribe(o);
|
|
950
|
+
}), l;
|
|
951
|
+
}
|
|
952
|
+
const xl = I({
|
|
953
|
+
name: "Row",
|
|
954
|
+
props: {
|
|
955
|
+
gutter: {
|
|
956
|
+
type: [Number, Object, Array],
|
|
957
|
+
default: 0
|
|
958
|
+
},
|
|
959
|
+
justify: {
|
|
960
|
+
type: String,
|
|
961
|
+
default: "start"
|
|
962
|
+
},
|
|
963
|
+
align: {
|
|
964
|
+
type: String,
|
|
965
|
+
default: "start"
|
|
966
|
+
},
|
|
967
|
+
div: {
|
|
968
|
+
type: Boolean
|
|
969
|
+
},
|
|
970
|
+
wrap: {
|
|
971
|
+
type: Boolean,
|
|
972
|
+
default: !0
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
setup(e) {
|
|
976
|
+
const {
|
|
977
|
+
gutter: t,
|
|
978
|
+
align: r,
|
|
979
|
+
justify: n,
|
|
980
|
+
div: l,
|
|
981
|
+
wrap: o
|
|
982
|
+
} = ye(e), i = G("row"), a = d(() => ({
|
|
983
|
+
[`${i}`]: !l.value,
|
|
984
|
+
[`${i}-nowrap`]: !o.value,
|
|
985
|
+
[`${i}-align-${r.value}`]: r.value,
|
|
986
|
+
[`${i}-justify-${n.value}`]: n.value
|
|
987
|
+
})), s = d(() => Array.isArray(t.value) ? t.value[0] : t.value), u = d(() => Array.isArray(t.value) ? t.value[1] : 0), c = _e(s, 0), h = _e(u, 0), p = d(() => {
|
|
988
|
+
const O = {};
|
|
989
|
+
if ((c.value || h.value) && !l.value) {
|
|
990
|
+
const _ = -c.value / 2, w = -h.value / 2;
|
|
991
|
+
_ && (O.marginLeft = `${_}px`, O.marginRight = `${_}px`), w && (O.marginTop = `${w}px`, O.marginBottom = `${w}px`);
|
|
992
|
+
}
|
|
993
|
+
return O;
|
|
994
|
+
}), b = d(() => [c.value, h.value]);
|
|
995
|
+
return ge(Zr, le({
|
|
996
|
+
gutter: b,
|
|
997
|
+
div: l
|
|
998
|
+
})), {
|
|
999
|
+
classNames: a,
|
|
1000
|
+
styles: p
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
});
|
|
1004
|
+
function Nl(e, t, r, n, l, o) {
|
|
1005
|
+
return L(), H("div", {
|
|
1006
|
+
class: D(e.classNames),
|
|
1007
|
+
style: Ce(e.styles)
|
|
1008
|
+
}, [R(e.$slots, "default")], 6);
|
|
1009
|
+
}
|
|
1010
|
+
var nt = /* @__PURE__ */ X(xl, [["render", Nl]]);
|
|
1011
|
+
function Il(e) {
|
|
1012
|
+
return d(() => {
|
|
1013
|
+
const {
|
|
1014
|
+
val: r,
|
|
1015
|
+
key: n,
|
|
1016
|
+
xs: l,
|
|
1017
|
+
sm: o,
|
|
1018
|
+
md: i,
|
|
1019
|
+
lg: a,
|
|
1020
|
+
xl: s,
|
|
1021
|
+
xxl: u
|
|
1022
|
+
} = e.value;
|
|
1023
|
+
if (!l && !o && !i && !a && !s && !u)
|
|
1024
|
+
return r;
|
|
1025
|
+
const c = {};
|
|
1026
|
+
return st.forEach((h) => {
|
|
1027
|
+
const p = e.value[h];
|
|
1028
|
+
ce(p) ? c[h] = p : Ye(p) && ce(p[n]) && (c[h] = p[n]);
|
|
1029
|
+
}), c;
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
function zl(e, t) {
|
|
1033
|
+
const r = {};
|
|
1034
|
+
return t.forEach((n) => {
|
|
1035
|
+
const l = n;
|
|
1036
|
+
n in e && (r[l] = e[l]);
|
|
1037
|
+
}), r;
|
|
1038
|
+
}
|
|
1039
|
+
var ql = Object.defineProperty, hr = Object.getOwnPropertySymbols, Wl = Object.prototype.hasOwnProperty, Rl = Object.prototype.propertyIsEnumerable, vr = (e, t, r) => t in e ? ql(e, t, {
|
|
1040
|
+
enumerable: !0,
|
|
1041
|
+
configurable: !0,
|
|
1042
|
+
writable: !0,
|
|
1043
|
+
value: r
|
|
1044
|
+
}) : e[t] = r, _t = (e, t) => {
|
|
1045
|
+
for (var r in t || (t = {}))
|
|
1046
|
+
Wl.call(t, r) && vr(e, r, t[r]);
|
|
1047
|
+
if (hr)
|
|
1048
|
+
for (var r of hr(t))
|
|
1049
|
+
Rl.call(t, r) && vr(e, r, t[r]);
|
|
1050
|
+
return e;
|
|
1051
|
+
};
|
|
1052
|
+
function Hl(e) {
|
|
1053
|
+
if (He(e) && (["initial", "auto", "none"].includes(e) || /^\d+$/.test(e)) || ce(e))
|
|
1054
|
+
return e;
|
|
1055
|
+
if (He(e) && /^\d+(px|em|rem|%)$/.test(e))
|
|
1056
|
+
return `0 0 ${e}`;
|
|
1057
|
+
}
|
|
1058
|
+
const Gl = I({
|
|
1059
|
+
name: "Col",
|
|
1060
|
+
props: {
|
|
1061
|
+
span: {
|
|
1062
|
+
type: Number,
|
|
1063
|
+
default: 24
|
|
1064
|
+
},
|
|
1065
|
+
offset: {
|
|
1066
|
+
type: Number
|
|
1067
|
+
},
|
|
1068
|
+
order: {
|
|
1069
|
+
type: Number
|
|
1070
|
+
},
|
|
1071
|
+
xs: {
|
|
1072
|
+
type: [Number, Object]
|
|
1073
|
+
},
|
|
1074
|
+
sm: {
|
|
1075
|
+
type: [Number, Object]
|
|
1076
|
+
},
|
|
1077
|
+
md: {
|
|
1078
|
+
type: [Number, Object]
|
|
1079
|
+
},
|
|
1080
|
+
lg: {
|
|
1081
|
+
type: [Number, Object]
|
|
1082
|
+
},
|
|
1083
|
+
xl: {
|
|
1084
|
+
type: [Number, Object]
|
|
1085
|
+
},
|
|
1086
|
+
xxl: {
|
|
1087
|
+
type: [Number, Object]
|
|
1088
|
+
},
|
|
1089
|
+
flex: {
|
|
1090
|
+
type: [Number, String]
|
|
1091
|
+
}
|
|
1092
|
+
},
|
|
1093
|
+
setup(e) {
|
|
1094
|
+
const t = G("col"), r = J(Zr, {}), n = d(() => Hl(e.flex)), l = d(() => {
|
|
1095
|
+
const {
|
|
1096
|
+
div: h
|
|
1097
|
+
} = r, {
|
|
1098
|
+
span: p,
|
|
1099
|
+
offset: b,
|
|
1100
|
+
order: O,
|
|
1101
|
+
xs: _,
|
|
1102
|
+
sm: w,
|
|
1103
|
+
md: m,
|
|
1104
|
+
lg: S,
|
|
1105
|
+
xl: B,
|
|
1106
|
+
xxl: M
|
|
1107
|
+
} = e, N = {
|
|
1108
|
+
[`${t}`]: !h,
|
|
1109
|
+
[`${t}-order-${O}`]: O,
|
|
1110
|
+
[`${t}-${p}`]: !h && !_ && !w && !m && !S && !B && !M,
|
|
1111
|
+
[`${t}-offset-${b}`]: b && b > 0
|
|
1112
|
+
}, Y = {
|
|
1113
|
+
xs: _,
|
|
1114
|
+
sm: w,
|
|
1115
|
+
md: m,
|
|
1116
|
+
lg: S,
|
|
1117
|
+
xl: B,
|
|
1118
|
+
xxl: M
|
|
1119
|
+
};
|
|
1120
|
+
return Object.keys(Y).forEach((j) => {
|
|
1121
|
+
const T = Y[j];
|
|
1122
|
+
T && ce(T) ? N[`${t}-${j}-${T}`] = !0 : T && Ye(T) && (N[`${t}-${j}-${T.span}`] = T.span, N[`${t}-${j}-offset-${T.offset}`] = T.offset, N[`${t}-${j}-order-${T.order}`] = T.order);
|
|
1123
|
+
}), N;
|
|
1124
|
+
}), o = d(() => n.value ? t : l.value), i = d(() => {
|
|
1125
|
+
const {
|
|
1126
|
+
gutter: h,
|
|
1127
|
+
div: p
|
|
1128
|
+
} = r, b = {};
|
|
1129
|
+
if (Array.isArray(h) && !p) {
|
|
1130
|
+
const O = h[0] && h[0] / 2 || 0, _ = h[1] && h[1] / 2 || 0;
|
|
1131
|
+
O && (b.paddingLeft = `${O}px`, b.paddingRight = `${O}px`), _ && (b.paddingTop = `${_}px`, b.paddingBottom = `${_}px`);
|
|
1132
|
+
}
|
|
1133
|
+
return b;
|
|
1134
|
+
}), a = d(() => n.value ? {
|
|
1135
|
+
flex: n.value
|
|
1136
|
+
} : {}), s = d(() => zl(e, st)), u = Il(d(() => _t({
|
|
1137
|
+
val: e.span,
|
|
1138
|
+
key: "span"
|
|
1139
|
+
}, s.value))), c = _e(u, 24, !0);
|
|
1140
|
+
return {
|
|
1141
|
+
visible: d(() => !!c.value),
|
|
1142
|
+
classNames: o,
|
|
1143
|
+
styles: d(() => _t(_t({}, i.value), a.value))
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
function Ul(e, t, r, n, l, o) {
|
|
1148
|
+
return e.visible ? (L(), H("div", {
|
|
1149
|
+
key: 0,
|
|
1150
|
+
class: D(e.classNames),
|
|
1151
|
+
style: Ce(e.styles)
|
|
1152
|
+
}, [R(e.$slots, "default")], 6)) : se("v-if", !0);
|
|
1153
|
+
}
|
|
1154
|
+
var lt = /* @__PURE__ */ X(Gl, [["render", Ul]]);
|
|
1155
|
+
function Yl(e, t) {
|
|
1156
|
+
var r, n;
|
|
1157
|
+
const l = (r = t.span) != null ? r : 1, o = (n = t.offset) != null ? n : 0, i = Math.min(o, e);
|
|
1158
|
+
return {
|
|
1159
|
+
span: Math.min(i > 0 ? l + o : l, e),
|
|
1160
|
+
offset: i,
|
|
1161
|
+
suffix: "suffix" in t ? t.suffix !== !1 : !1
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
function Kl({
|
|
1165
|
+
cols: e,
|
|
1166
|
+
collapsed: t,
|
|
1167
|
+
collapsedRows: r,
|
|
1168
|
+
itemDataList: n
|
|
1169
|
+
}) {
|
|
1170
|
+
let l = !1, o = [];
|
|
1171
|
+
function i(a) {
|
|
1172
|
+
return Math.ceil(a / e) > r;
|
|
1173
|
+
}
|
|
1174
|
+
if (t) {
|
|
1175
|
+
let a = 0;
|
|
1176
|
+
for (let s = 0; s < n.length; s++)
|
|
1177
|
+
n[s].suffix && (a += n[s].span, o.push(s));
|
|
1178
|
+
if (!i(a)) {
|
|
1179
|
+
let s = 0;
|
|
1180
|
+
for (; s < n.length; ) {
|
|
1181
|
+
const u = n[s];
|
|
1182
|
+
if (!u.suffix) {
|
|
1183
|
+
if (a += u.span, i(a))
|
|
1184
|
+
break;
|
|
1185
|
+
o.push(s);
|
|
1186
|
+
}
|
|
1187
|
+
s++;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
l = n.some((s, u) => !s.suffix && !o.includes(u));
|
|
1191
|
+
} else
|
|
1192
|
+
o = n.map((a, s) => s);
|
|
1193
|
+
return {
|
|
1194
|
+
overflow: l,
|
|
1195
|
+
displayIndexList: o
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1198
|
+
const Xl = I({
|
|
1199
|
+
name: "Grid",
|
|
1200
|
+
props: {
|
|
1201
|
+
cols: {
|
|
1202
|
+
type: [Number, Object],
|
|
1203
|
+
default: 24
|
|
1204
|
+
},
|
|
1205
|
+
rowGap: {
|
|
1206
|
+
type: [Number, Object],
|
|
1207
|
+
default: 0
|
|
1208
|
+
},
|
|
1209
|
+
colGap: {
|
|
1210
|
+
type: [Number, Object],
|
|
1211
|
+
default: 0
|
|
1212
|
+
},
|
|
1213
|
+
collapsed: {
|
|
1214
|
+
type: Boolean,
|
|
1215
|
+
default: !1
|
|
1216
|
+
},
|
|
1217
|
+
collapsedRows: {
|
|
1218
|
+
type: Number,
|
|
1219
|
+
default: 1
|
|
1220
|
+
}
|
|
1221
|
+
},
|
|
1222
|
+
setup(e) {
|
|
1223
|
+
const {
|
|
1224
|
+
cols: t,
|
|
1225
|
+
rowGap: r,
|
|
1226
|
+
colGap: n,
|
|
1227
|
+
collapsedRows: l,
|
|
1228
|
+
collapsed: o
|
|
1229
|
+
} = ye(e), i = _e(t, 24), a = _e(n, 0), s = _e(r, 0), u = G("grid"), c = d(() => [u]), h = d(() => [{
|
|
1230
|
+
gap: `${s.value}px ${a.value}px`,
|
|
1231
|
+
"grid-template-columns": `repeat(${i.value}, minmax(0px, 1fr))`
|
|
1232
|
+
}]), p = le(/* @__PURE__ */ new Map()), b = d(() => {
|
|
1233
|
+
const _ = [];
|
|
1234
|
+
for (const [w, m] of p.entries())
|
|
1235
|
+
_[w] = m;
|
|
1236
|
+
return _;
|
|
1237
|
+
}), O = le({
|
|
1238
|
+
overflow: !1,
|
|
1239
|
+
displayIndexList: [],
|
|
1240
|
+
cols: i.value,
|
|
1241
|
+
colGap: a.value
|
|
1242
|
+
});
|
|
1243
|
+
return At(() => {
|
|
1244
|
+
O.cols = i.value, O.colGap = a.value;
|
|
1245
|
+
}), At(() => {
|
|
1246
|
+
const _ = Kl({
|
|
1247
|
+
cols: i.value,
|
|
1248
|
+
collapsed: o.value,
|
|
1249
|
+
collapsedRows: l.value,
|
|
1250
|
+
itemDataList: b.value
|
|
1251
|
+
});
|
|
1252
|
+
O.overflow = _.overflow, O.displayIndexList = _.displayIndexList;
|
|
1253
|
+
}), ge(Qr, O), ge(Jr, {
|
|
1254
|
+
collectItemData(_, w) {
|
|
1255
|
+
p.set(_, w);
|
|
1256
|
+
},
|
|
1257
|
+
removeItemData(_) {
|
|
1258
|
+
p.delete(_);
|
|
1259
|
+
}
|
|
1260
|
+
}), {
|
|
1261
|
+
classNames: c,
|
|
1262
|
+
style: h
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
});
|
|
1266
|
+
function Zl(e, t, r, n, l, o) {
|
|
1267
|
+
return L(), H("div", {
|
|
1268
|
+
class: D(e.classNames),
|
|
1269
|
+
style: Ce(e.style)
|
|
1270
|
+
}, [R(e.$slots, "default")], 6);
|
|
1271
|
+
}
|
|
1272
|
+
var Et = /* @__PURE__ */ X(Xl, [["render", Zl]]);
|
|
1273
|
+
const Ql = ({
|
|
1274
|
+
itemRef: e,
|
|
1275
|
+
selector: t,
|
|
1276
|
+
index: r,
|
|
1277
|
+
parentClassName: n
|
|
1278
|
+
}) => {
|
|
1279
|
+
const l = F(-1), o = d(() => {
|
|
1280
|
+
var u;
|
|
1281
|
+
return (u = r == null ? void 0 : r.value) != null ? u : l.value;
|
|
1282
|
+
}), i = F(), a = () => {
|
|
1283
|
+
var u, c, h;
|
|
1284
|
+
let p = (c = (u = e.value) == null ? void 0 : u.parentElement) != null ? c : void 0;
|
|
1285
|
+
if (n)
|
|
1286
|
+
for (; p && !p.className.includes(n); )
|
|
1287
|
+
p = (h = p.parentElement) != null ? h : void 0;
|
|
1288
|
+
return p;
|
|
1289
|
+
}, s = () => {
|
|
1290
|
+
if (Gr(r == null ? void 0 : r.value) && i.value && e.value) {
|
|
1291
|
+
const u = Array.from(i.value.querySelectorAll(t)).indexOf(e.value);
|
|
1292
|
+
u !== l.value && (l.value = u);
|
|
1293
|
+
}
|
|
1294
|
+
};
|
|
1295
|
+
return Te(e, () => {
|
|
1296
|
+
e.value && !i.value && (i.value = a());
|
|
1297
|
+
}), he(() => {
|
|
1298
|
+
e.value && (i.value = a()), s();
|
|
1299
|
+
}), ft(() => s()), {
|
|
1300
|
+
computedIndex: o
|
|
1301
|
+
};
|
|
1302
|
+
};
|
|
1303
|
+
var Jl = Object.defineProperty, eo = Object.defineProperties, to = Object.getOwnPropertyDescriptors, pr = Object.getOwnPropertySymbols, ro = Object.prototype.hasOwnProperty, no = Object.prototype.propertyIsEnumerable, mr = (e, t, r) => t in e ? Jl(e, t, {
|
|
1304
|
+
enumerable: !0,
|
|
1305
|
+
configurable: !0,
|
|
1306
|
+
writable: !0,
|
|
1307
|
+
value: r
|
|
1308
|
+
}) : e[t] = r, lo = (e, t) => {
|
|
1309
|
+
for (var r in t || (t = {}))
|
|
1310
|
+
ro.call(t, r) && mr(e, r, t[r]);
|
|
1311
|
+
if (pr)
|
|
1312
|
+
for (var r of pr(t))
|
|
1313
|
+
no.call(t, r) && mr(e, r, t[r]);
|
|
1314
|
+
return e;
|
|
1315
|
+
}, oo = (e, t) => eo(e, to(t));
|
|
1316
|
+
const io = I({
|
|
1317
|
+
name: "GridItem",
|
|
1318
|
+
props: {
|
|
1319
|
+
span: {
|
|
1320
|
+
type: [Number, Object],
|
|
1321
|
+
default: 1
|
|
1322
|
+
},
|
|
1323
|
+
offset: {
|
|
1324
|
+
type: [Number, Object],
|
|
1325
|
+
default: 0
|
|
1326
|
+
},
|
|
1327
|
+
suffix: {
|
|
1328
|
+
type: Boolean,
|
|
1329
|
+
default: !1
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
setup(e) {
|
|
1333
|
+
const t = G("grid-item"), r = F(), {
|
|
1334
|
+
computedIndex: n
|
|
1335
|
+
} = Ql({
|
|
1336
|
+
itemRef: r,
|
|
1337
|
+
selector: `.${t}`
|
|
1338
|
+
}), l = J(Qr, {
|
|
1339
|
+
overflow: !1,
|
|
1340
|
+
displayIndexList: [],
|
|
1341
|
+
cols: 24,
|
|
1342
|
+
colGap: 0
|
|
1343
|
+
}), o = J(Jr), i = d(() => {
|
|
1344
|
+
var w;
|
|
1345
|
+
return (w = l == null ? void 0 : l.displayIndexList) == null ? void 0 : w.includes(n.value);
|
|
1346
|
+
}), {
|
|
1347
|
+
span: a,
|
|
1348
|
+
offset: s
|
|
1349
|
+
} = ye(e), u = _e(a, 1), c = _e(s, 0), h = d(() => Yl(l.cols, oo(lo({}, e), {
|
|
1350
|
+
span: u.value,
|
|
1351
|
+
offset: c.value
|
|
1352
|
+
}))), p = d(() => [t]), b = d(() => {
|
|
1353
|
+
const {
|
|
1354
|
+
offset: w,
|
|
1355
|
+
span: m
|
|
1356
|
+
} = h.value, {
|
|
1357
|
+
colGap: S
|
|
1358
|
+
} = l;
|
|
1359
|
+
return w > 0 ? {
|
|
1360
|
+
"margin-left": `calc((${`(100% - ${S * (m - 1)}px) / ${m}`} * ${w}) + ${S * w}px)`
|
|
1361
|
+
} : {};
|
|
1362
|
+
}), O = d(() => {
|
|
1363
|
+
const {
|
|
1364
|
+
suffix: w,
|
|
1365
|
+
span: m
|
|
1366
|
+
} = h.value, {
|
|
1367
|
+
cols: S
|
|
1368
|
+
} = l;
|
|
1369
|
+
return w ? `${S - m + 1}` : `span ${m}`;
|
|
1370
|
+
}), _ = d(() => {
|
|
1371
|
+
const {
|
|
1372
|
+
span: w
|
|
1373
|
+
} = h.value;
|
|
1374
|
+
return r.value ? [{
|
|
1375
|
+
"grid-column": `${O.value} / span ${w}`
|
|
1376
|
+
}, b.value, !i.value || w === 0 ? {
|
|
1377
|
+
display: "none"
|
|
1378
|
+
} : {}] : [];
|
|
1379
|
+
});
|
|
1380
|
+
return At(() => {
|
|
1381
|
+
n.value !== -1 && (o == null || o.collectItemData(n.value, h.value));
|
|
1382
|
+
}), Wr(() => {
|
|
1383
|
+
n.value !== -1 && (o == null || o.removeItemData(n.value));
|
|
1384
|
+
}), {
|
|
1385
|
+
classNames: p,
|
|
1386
|
+
style: _,
|
|
1387
|
+
domRef: r,
|
|
1388
|
+
overflow: d(() => l.overflow)
|
|
1389
|
+
};
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
function ao(e, t, r, n, l, o) {
|
|
1393
|
+
return L(), H("div", {
|
|
1394
|
+
ref: "domRef",
|
|
1395
|
+
class: D(e.classNames),
|
|
1396
|
+
style: Ce(e.style)
|
|
1397
|
+
}, [R(e.$slots, "default", {
|
|
1398
|
+
overflow: e.overflow
|
|
1399
|
+
})], 6);
|
|
1400
|
+
}
|
|
1401
|
+
var We = /* @__PURE__ */ X(io, [["render", ao]]);
|
|
1402
|
+
const so = Object.assign(Et, {
|
|
1403
|
+
Row: nt,
|
|
1404
|
+
Col: lt,
|
|
1405
|
+
Item: We,
|
|
1406
|
+
install: (e, t) => {
|
|
1407
|
+
Be(e, t);
|
|
1408
|
+
const r = De(t);
|
|
1409
|
+
e.component(r + nt.name, nt), e.component(r + lt.name, lt), e.component(r + Et.name, Et), e.component(r + We.name, We);
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
var en = function() {
|
|
1413
|
+
if (typeof Map < "u")
|
|
1414
|
+
return Map;
|
|
1415
|
+
function e(t, r) {
|
|
1416
|
+
var n = -1;
|
|
1417
|
+
return t.some(function(l, o) {
|
|
1418
|
+
return l[0] === r ? (n = o, !0) : !1;
|
|
1419
|
+
}), n;
|
|
1420
|
+
}
|
|
1421
|
+
return (
|
|
1422
|
+
/** @class */
|
|
1423
|
+
function() {
|
|
1424
|
+
function t() {
|
|
1425
|
+
this.__entries__ = [];
|
|
1426
|
+
}
|
|
1427
|
+
return Object.defineProperty(t.prototype, "size", {
|
|
1428
|
+
/**
|
|
1429
|
+
* @returns {boolean}
|
|
1430
|
+
*/
|
|
1431
|
+
get: function() {
|
|
1432
|
+
return this.__entries__.length;
|
|
1433
|
+
},
|
|
1434
|
+
enumerable: !0,
|
|
1435
|
+
configurable: !0
|
|
1436
|
+
}), t.prototype.get = function(r) {
|
|
1437
|
+
var n = e(this.__entries__, r), l = this.__entries__[n];
|
|
1438
|
+
return l && l[1];
|
|
1439
|
+
}, t.prototype.set = function(r, n) {
|
|
1440
|
+
var l = e(this.__entries__, r);
|
|
1441
|
+
~l ? this.__entries__[l][1] = n : this.__entries__.push([r, n]);
|
|
1442
|
+
}, t.prototype.delete = function(r) {
|
|
1443
|
+
var n = this.__entries__, l = e(n, r);
|
|
1444
|
+
~l && n.splice(l, 1);
|
|
1445
|
+
}, t.prototype.has = function(r) {
|
|
1446
|
+
return !!~e(this.__entries__, r);
|
|
1447
|
+
}, t.prototype.clear = function() {
|
|
1448
|
+
this.__entries__.splice(0);
|
|
1449
|
+
}, t.prototype.forEach = function(r, n) {
|
|
1450
|
+
n === void 0 && (n = null);
|
|
1451
|
+
for (var l = 0, o = this.__entries__; l < o.length; l++) {
|
|
1452
|
+
var i = o[l];
|
|
1453
|
+
r.call(n, i[1], i[0]);
|
|
1454
|
+
}
|
|
1455
|
+
}, t;
|
|
1456
|
+
}()
|
|
1457
|
+
);
|
|
1458
|
+
}(), zt = typeof window < "u" && typeof document < "u" && window.document === document, ut = function() {
|
|
1459
|
+
return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
|
|
1460
|
+
}(), uo = function() {
|
|
1461
|
+
return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(ut) : function(e) {
|
|
1462
|
+
return setTimeout(function() {
|
|
1463
|
+
return e(Date.now());
|
|
1464
|
+
}, 1e3 / 60);
|
|
1465
|
+
};
|
|
1466
|
+
}(), co = 2;
|
|
1467
|
+
function fo(e, t) {
|
|
1468
|
+
var r = !1, n = !1, l = 0;
|
|
1469
|
+
function o() {
|
|
1470
|
+
r && (r = !1, e()), n && a();
|
|
1471
|
+
}
|
|
1472
|
+
function i() {
|
|
1473
|
+
uo(o);
|
|
1474
|
+
}
|
|
1475
|
+
function a() {
|
|
1476
|
+
var s = Date.now();
|
|
1477
|
+
if (r) {
|
|
1478
|
+
if (s - l < co)
|
|
1479
|
+
return;
|
|
1480
|
+
n = !0;
|
|
1481
|
+
} else
|
|
1482
|
+
r = !0, n = !1, setTimeout(i, t);
|
|
1483
|
+
l = s;
|
|
1484
|
+
}
|
|
1485
|
+
return a;
|
|
1486
|
+
}
|
|
1487
|
+
var ho = 20, vo = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], po = typeof MutationObserver < "u", mo = (
|
|
1488
|
+
/** @class */
|
|
1489
|
+
function() {
|
|
1490
|
+
function e() {
|
|
1491
|
+
this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = fo(this.refresh.bind(this), ho);
|
|
1492
|
+
}
|
|
1493
|
+
return e.prototype.addObserver = function(t) {
|
|
1494
|
+
~this.observers_.indexOf(t) || this.observers_.push(t), this.connected_ || this.connect_();
|
|
1495
|
+
}, e.prototype.removeObserver = function(t) {
|
|
1496
|
+
var r = this.observers_, n = r.indexOf(t);
|
|
1497
|
+
~n && r.splice(n, 1), !r.length && this.connected_ && this.disconnect_();
|
|
1498
|
+
}, e.prototype.refresh = function() {
|
|
1499
|
+
var t = this.updateObservers_();
|
|
1500
|
+
t && this.refresh();
|
|
1501
|
+
}, e.prototype.updateObservers_ = function() {
|
|
1502
|
+
var t = this.observers_.filter(function(r) {
|
|
1503
|
+
return r.gatherActive(), r.hasActive();
|
|
1504
|
+
});
|
|
1505
|
+
return t.forEach(function(r) {
|
|
1506
|
+
return r.broadcastActive();
|
|
1507
|
+
}), t.length > 0;
|
|
1508
|
+
}, e.prototype.connect_ = function() {
|
|
1509
|
+
!zt || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), po ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
|
|
1510
|
+
attributes: !0,
|
|
1511
|
+
childList: !0,
|
|
1512
|
+
characterData: !0,
|
|
1513
|
+
subtree: !0
|
|
1514
|
+
})) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
|
|
1515
|
+
}, e.prototype.disconnect_ = function() {
|
|
1516
|
+
!zt || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
|
|
1517
|
+
}, e.prototype.onTransitionEnd_ = function(t) {
|
|
1518
|
+
var r = t.propertyName, n = r === void 0 ? "" : r, l = vo.some(function(o) {
|
|
1519
|
+
return !!~n.indexOf(o);
|
|
1520
|
+
});
|
|
1521
|
+
l && this.refresh();
|
|
1522
|
+
}, e.getInstance = function() {
|
|
1523
|
+
return this.instance_ || (this.instance_ = new e()), this.instance_;
|
|
1524
|
+
}, e.instance_ = null, e;
|
|
1525
|
+
}()
|
|
1526
|
+
), tn = function(e, t) {
|
|
1527
|
+
for (var r = 0, n = Object.keys(t); r < n.length; r++) {
|
|
1528
|
+
var l = n[r];
|
|
1529
|
+
Object.defineProperty(e, l, {
|
|
1530
|
+
value: t[l],
|
|
1531
|
+
enumerable: !1,
|
|
1532
|
+
writable: !1,
|
|
1533
|
+
configurable: !0
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
return e;
|
|
1537
|
+
}, Ae = function(e) {
|
|
1538
|
+
var t = e && e.ownerDocument && e.ownerDocument.defaultView;
|
|
1539
|
+
return t || ut;
|
|
1540
|
+
}, rn = mt(0, 0, 0, 0);
|
|
1541
|
+
function ct(e) {
|
|
1542
|
+
return parseFloat(e) || 0;
|
|
1543
|
+
}
|
|
1544
|
+
function br(e) {
|
|
1545
|
+
for (var t = [], r = 1; r < arguments.length; r++)
|
|
1546
|
+
t[r - 1] = arguments[r];
|
|
1547
|
+
return t.reduce(function(n, l) {
|
|
1548
|
+
var o = e["border-" + l + "-width"];
|
|
1549
|
+
return n + ct(o);
|
|
1550
|
+
}, 0);
|
|
1551
|
+
}
|
|
1552
|
+
function bo(e) {
|
|
1553
|
+
for (var t = ["top", "right", "bottom", "left"], r = {}, n = 0, l = t; n < l.length; n++) {
|
|
1554
|
+
var o = l[n], i = e["padding-" + o];
|
|
1555
|
+
r[o] = ct(i);
|
|
1556
|
+
}
|
|
1557
|
+
return r;
|
|
1558
|
+
}
|
|
1559
|
+
function yo(e) {
|
|
1560
|
+
var t = e.getBBox();
|
|
1561
|
+
return mt(0, 0, t.width, t.height);
|
|
1562
|
+
}
|
|
1563
|
+
function go(e) {
|
|
1564
|
+
var t = e.clientWidth, r = e.clientHeight;
|
|
1565
|
+
if (!t && !r)
|
|
1566
|
+
return rn;
|
|
1567
|
+
var n = Ae(e).getComputedStyle(e), l = bo(n), o = l.left + l.right, i = l.top + l.bottom, a = ct(n.width), s = ct(n.height);
|
|
1568
|
+
if (n.boxSizing === "border-box" && (Math.round(a + o) !== t && (a -= br(n, "left", "right") + o), Math.round(s + i) !== r && (s -= br(n, "top", "bottom") + i)), !_o(e)) {
|
|
1569
|
+
var u = Math.round(a + o) - t, c = Math.round(s + i) - r;
|
|
1570
|
+
Math.abs(u) !== 1 && (a -= u), Math.abs(c) !== 1 && (s -= c);
|
|
1571
|
+
}
|
|
1572
|
+
return mt(l.left, l.top, a, s);
|
|
1573
|
+
}
|
|
1574
|
+
var wo = function() {
|
|
1575
|
+
return typeof SVGGraphicsElement < "u" ? function(e) {
|
|
1576
|
+
return e instanceof Ae(e).SVGGraphicsElement;
|
|
1577
|
+
} : function(e) {
|
|
1578
|
+
return e instanceof Ae(e).SVGElement && typeof e.getBBox == "function";
|
|
1579
|
+
};
|
|
1580
|
+
}();
|
|
1581
|
+
function _o(e) {
|
|
1582
|
+
return e === Ae(e).document.documentElement;
|
|
1583
|
+
}
|
|
1584
|
+
function Eo(e) {
|
|
1585
|
+
return zt ? wo(e) ? yo(e) : go(e) : rn;
|
|
1586
|
+
}
|
|
1587
|
+
function Co(e) {
|
|
1588
|
+
var t = e.x, r = e.y, n = e.width, l = e.height, o = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, i = Object.create(o.prototype);
|
|
1589
|
+
return tn(i, {
|
|
1590
|
+
x: t,
|
|
1591
|
+
y: r,
|
|
1592
|
+
width: n,
|
|
1593
|
+
height: l,
|
|
1594
|
+
top: r,
|
|
1595
|
+
right: t + n,
|
|
1596
|
+
bottom: l + r,
|
|
1597
|
+
left: t
|
|
1598
|
+
}), i;
|
|
1599
|
+
}
|
|
1600
|
+
function mt(e, t, r, n) {
|
|
1601
|
+
return {
|
|
1602
|
+
x: e,
|
|
1603
|
+
y: t,
|
|
1604
|
+
width: r,
|
|
1605
|
+
height: n
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
var $o = (
|
|
1609
|
+
/** @class */
|
|
1610
|
+
function() {
|
|
1611
|
+
function e(t) {
|
|
1612
|
+
this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = mt(0, 0, 0, 0), this.target = t;
|
|
1613
|
+
}
|
|
1614
|
+
return e.prototype.isActive = function() {
|
|
1615
|
+
var t = Eo(this.target);
|
|
1616
|
+
return this.contentRect_ = t, t.width !== this.broadcastWidth || t.height !== this.broadcastHeight;
|
|
1617
|
+
}, e.prototype.broadcastRect = function() {
|
|
1618
|
+
var t = this.contentRect_;
|
|
1619
|
+
return this.broadcastWidth = t.width, this.broadcastHeight = t.height, t;
|
|
1620
|
+
}, e;
|
|
1621
|
+
}()
|
|
1622
|
+
), Oo = (
|
|
1623
|
+
/** @class */
|
|
1624
|
+
function() {
|
|
1625
|
+
function e(t, r) {
|
|
1626
|
+
var n = Co(r);
|
|
1627
|
+
tn(this, {
|
|
1628
|
+
target: t,
|
|
1629
|
+
contentRect: n
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
return e;
|
|
1633
|
+
}()
|
|
1634
|
+
), So = (
|
|
1635
|
+
/** @class */
|
|
1636
|
+
function() {
|
|
1637
|
+
function e(t, r, n) {
|
|
1638
|
+
if (this.activeObservations_ = [], this.observations_ = new en(), typeof t != "function")
|
|
1639
|
+
throw new TypeError("The callback provided as parameter 1 is not a function.");
|
|
1640
|
+
this.callback_ = t, this.controller_ = r, this.callbackCtx_ = n;
|
|
1641
|
+
}
|
|
1642
|
+
return e.prototype.observe = function(t) {
|
|
1643
|
+
if (!arguments.length)
|
|
1644
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
1645
|
+
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
1646
|
+
if (!(t instanceof Ae(t).Element))
|
|
1647
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
1648
|
+
var r = this.observations_;
|
|
1649
|
+
r.has(t) || (r.set(t, new $o(t)), this.controller_.addObserver(this), this.controller_.refresh());
|
|
1650
|
+
}
|
|
1651
|
+
}, e.prototype.unobserve = function(t) {
|
|
1652
|
+
if (!arguments.length)
|
|
1653
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
1654
|
+
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
1655
|
+
if (!(t instanceof Ae(t).Element))
|
|
1656
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
1657
|
+
var r = this.observations_;
|
|
1658
|
+
r.has(t) && (r.delete(t), r.size || this.controller_.removeObserver(this));
|
|
1659
|
+
}
|
|
1660
|
+
}, e.prototype.disconnect = function() {
|
|
1661
|
+
this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
|
|
1662
|
+
}, e.prototype.gatherActive = function() {
|
|
1663
|
+
var t = this;
|
|
1664
|
+
this.clearActive(), this.observations_.forEach(function(r) {
|
|
1665
|
+
r.isActive() && t.activeObservations_.push(r);
|
|
1666
|
+
});
|
|
1667
|
+
}, e.prototype.broadcastActive = function() {
|
|
1668
|
+
if (this.hasActive()) {
|
|
1669
|
+
var t = this.callbackCtx_, r = this.activeObservations_.map(function(n) {
|
|
1670
|
+
return new Oo(n.target, n.broadcastRect());
|
|
1671
|
+
});
|
|
1672
|
+
this.callback_.call(t, r, t), this.clearActive();
|
|
1673
|
+
}
|
|
1674
|
+
}, e.prototype.clearActive = function() {
|
|
1675
|
+
this.activeObservations_.splice(0);
|
|
1676
|
+
}, e.prototype.hasActive = function() {
|
|
1677
|
+
return this.activeObservations_.length > 0;
|
|
1678
|
+
}, e;
|
|
1679
|
+
}()
|
|
1680
|
+
), nn = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new en(), ln = (
|
|
1681
|
+
/** @class */
|
|
1682
|
+
function() {
|
|
1683
|
+
function e(t) {
|
|
1684
|
+
if (!(this instanceof e))
|
|
1685
|
+
throw new TypeError("Cannot call a class as a function.");
|
|
1686
|
+
if (!arguments.length)
|
|
1687
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
1688
|
+
var r = mo.getInstance(), n = new So(t, r, this);
|
|
1689
|
+
nn.set(this, n);
|
|
1690
|
+
}
|
|
1691
|
+
return e;
|
|
1692
|
+
}()
|
|
1693
|
+
);
|
|
1694
|
+
["observe", "unobserve", "disconnect"].forEach(function(e) {
|
|
1695
|
+
ln.prototype[e] = function() {
|
|
1696
|
+
var t;
|
|
1697
|
+
return (t = nn.get(this))[e].apply(t, arguments);
|
|
1698
|
+
};
|
|
1699
|
+
});
|
|
1700
|
+
var on = function() {
|
|
1701
|
+
return typeof ut.ResizeObserver < "u" ? ut.ResizeObserver : ln;
|
|
1702
|
+
}(), yr;
|
|
1703
|
+
(function(e) {
|
|
1704
|
+
e[e.ELEMENT = 1] = "ELEMENT", e[e.FUNCTIONAL_COMPONENT = 2] = "FUNCTIONAL_COMPONENT", e[e.STATEFUL_COMPONENT = 4] = "STATEFUL_COMPONENT", e[e.COMPONENT = 6] = "COMPONENT", e[e.TEXT_CHILDREN = 8] = "TEXT_CHILDREN", e[e.ARRAY_CHILDREN = 16] = "ARRAY_CHILDREN", e[e.SLOTS_CHILDREN = 32] = "SLOTS_CHILDREN", e[e.TELEPORT = 64] = "TELEPORT", e[e.SUSPENSE = 128] = "SUSPENSE", e[e.COMPONENT_SHOULD_KEEP_ALIVE = 256] = "COMPONENT_SHOULD_KEEP_ALIVE", e[e.COMPONENT_KEPT_ALIVE = 512] = "COMPONENT_KEPT_ALIVE";
|
|
1705
|
+
})(yr || (yr = {}));
|
|
1706
|
+
var gr;
|
|
1707
|
+
(function(e) {
|
|
1708
|
+
e[e.TEXT = 1] = "TEXT", e[e.CLASS = 2] = "CLASS", e[e.STYLE = 4] = "STYLE", e[e.PROPS = 8] = "PROPS", e[e.FULL_PROPS = 16] = "FULL_PROPS", e[e.HYDRATE_EVENTS = 32] = "HYDRATE_EVENTS", e[e.STABLE_FRAGMENT = 64] = "STABLE_FRAGMENT", e[e.KEYED_FRAGMENT = 128] = "KEYED_FRAGMENT", e[e.UNKEYED_FRAGMENT = 256] = "UNKEYED_FRAGMENT", e[e.NEED_PATCH = 512] = "NEED_PATCH", e[e.DYNAMIC_SLOTS = 1024] = "DYNAMIC_SLOTS", e[e.DEV_ROOT_FRAGMENT = 2048] = "DEV_ROOT_FRAGMENT", e[e.HOISTED = -1] = "HOISTED", e[e.BAIL = -2] = "BAIL";
|
|
1709
|
+
})(gr || (gr = {}));
|
|
1710
|
+
const Yt = (e) => !!(e && e.shapeFlag & 1), Kt = (e, t) => !!(e && e.shapeFlag & 6), jo = (e, t) => !!(e && e.shapeFlag & 8), an = (e, t) => !!(e && e.shapeFlag & 16), ko = (e, t) => !!(e && e.shapeFlag & 32), Po = (e) => {
|
|
1711
|
+
if (!e)
|
|
1712
|
+
return !0;
|
|
1713
|
+
for (const t of e)
|
|
1714
|
+
if (t.children)
|
|
1715
|
+
return !1;
|
|
1716
|
+
return !0;
|
|
1717
|
+
}, sn = (e, t) => {
|
|
1718
|
+
if (e && e.length > 0)
|
|
1719
|
+
for (let r = 0; r < e.length; r++) {
|
|
1720
|
+
const n = e[r];
|
|
1721
|
+
if (Yt(n) || Kt(n)) {
|
|
1722
|
+
const o = it(t) ? t(n) : t;
|
|
1723
|
+
return e[r] = On(n, o, !0), !0;
|
|
1724
|
+
}
|
|
1725
|
+
const l = un(n);
|
|
1726
|
+
if (l && l.length > 0 && sn(l, t))
|
|
1727
|
+
return !0;
|
|
1728
|
+
}
|
|
1729
|
+
return !1;
|
|
1730
|
+
}, un = (e) => {
|
|
1731
|
+
if (an(e, e.children))
|
|
1732
|
+
return e.children;
|
|
1733
|
+
if (Ee(e))
|
|
1734
|
+
return e;
|
|
1735
|
+
}, cn = (e) => {
|
|
1736
|
+
var t, r;
|
|
1737
|
+
if (Yt(e))
|
|
1738
|
+
return e.el;
|
|
1739
|
+
if (Kt(e)) {
|
|
1740
|
+
if (((t = e.el) == null ? void 0 : t.nodeType) === 1)
|
|
1741
|
+
return e.el;
|
|
1742
|
+
if ((r = e.component) != null && r.subTree) {
|
|
1743
|
+
const n = cn(e.component.subTree);
|
|
1744
|
+
if (n)
|
|
1745
|
+
return n;
|
|
1746
|
+
}
|
|
1747
|
+
} else {
|
|
1748
|
+
const n = un(e);
|
|
1749
|
+
return dn(n);
|
|
1750
|
+
}
|
|
1751
|
+
}, dn = (e) => {
|
|
1752
|
+
if (e && e.length > 0)
|
|
1753
|
+
for (const t of e) {
|
|
1754
|
+
const r = cn(t);
|
|
1755
|
+
if (r)
|
|
1756
|
+
return r;
|
|
1757
|
+
}
|
|
1758
|
+
}, ot = (e, t = !1) => {
|
|
1759
|
+
var r, n;
|
|
1760
|
+
const l = [];
|
|
1761
|
+
for (const o of e ?? [])
|
|
1762
|
+
Yt(o) || Kt(o) || t && jo(o, o.children) ? l.push(o) : an(o, o.children) ? l.push(...ot(o.children, t)) : ko(o, o.children) ? l.push(...ot((n = (r = o.children).default) == null ? void 0 : n.call(r), t)) : Ee(o) && l.push(...ot(o, t));
|
|
1763
|
+
return l;
|
|
1764
|
+
}, fn = () => {
|
|
1765
|
+
const e = {}, t = F(), r = () => {
|
|
1766
|
+
const n = dn(e.value);
|
|
1767
|
+
n !== t.value && (t.value = n);
|
|
1768
|
+
};
|
|
1769
|
+
return he(() => r()), ft(() => r()), {
|
|
1770
|
+
children: e,
|
|
1771
|
+
firstElement: t
|
|
1772
|
+
};
|
|
1773
|
+
};
|
|
1774
|
+
var qt = I({
|
|
1775
|
+
name: "ResizeObserver",
|
|
1776
|
+
props: {
|
|
1777
|
+
watchOnUpdated: Boolean
|
|
1778
|
+
},
|
|
1779
|
+
emits: ["resize"],
|
|
1780
|
+
setup(e, {
|
|
1781
|
+
emit: t,
|
|
1782
|
+
slots: r
|
|
1783
|
+
}) {
|
|
1784
|
+
const {
|
|
1785
|
+
children: n,
|
|
1786
|
+
firstElement: l
|
|
1787
|
+
} = fn();
|
|
1788
|
+
let o;
|
|
1789
|
+
const i = (s) => {
|
|
1790
|
+
s && (o = new on((u) => {
|
|
1791
|
+
const c = u[0];
|
|
1792
|
+
t("resize", c);
|
|
1793
|
+
}), o.observe(s));
|
|
1794
|
+
}, a = () => {
|
|
1795
|
+
o && (o.disconnect(), o = null);
|
|
1796
|
+
};
|
|
1797
|
+
return Te(l, (s) => {
|
|
1798
|
+
o && a(), s && i(s);
|
|
1799
|
+
}), Ge(() => {
|
|
1800
|
+
o && a();
|
|
1801
|
+
}), () => {
|
|
1802
|
+
var s;
|
|
1803
|
+
return n.value = (s = r.default) == null ? void 0 : s.call(r), n.value;
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
const Xt = () => {
|
|
1808
|
+
}, Fo = () => {
|
|
1809
|
+
const {
|
|
1810
|
+
body: e
|
|
1811
|
+
} = document, t = document.documentElement;
|
|
1812
|
+
let r;
|
|
1813
|
+
try {
|
|
1814
|
+
r = (window.top || window.self || window).document.body;
|
|
1815
|
+
} catch {
|
|
1816
|
+
}
|
|
1817
|
+
return {
|
|
1818
|
+
height: Math.max(e.scrollHeight, e.offsetHeight, t.clientHeight, t.scrollHeight, t.offsetHeight, (r == null ? void 0 : r.scrollHeight) || 0, (r == null ? void 0 : r.clientHeight) || 0),
|
|
1819
|
+
width: Math.max(e.scrollWidth, e.offsetWidth, t.clientWidth, t.scrollWidth, t.offsetWidth, (r == null ? void 0 : r.scrollWidth) || 0, (r == null ? void 0 : r.clientWidth) || 0)
|
|
1820
|
+
};
|
|
1821
|
+
}, Zt = (() => {
|
|
1822
|
+
try {
|
|
1823
|
+
return !(typeof window < "u" && document !== void 0);
|
|
1824
|
+
} catch {
|
|
1825
|
+
return !0;
|
|
1826
|
+
}
|
|
1827
|
+
})(), Ct = (() => Zt ? Xt : (e, t, r, n = !1) => {
|
|
1828
|
+
e.addEventListener(t, r, n);
|
|
1829
|
+
})(), wr = (() => Zt ? Xt : (e, t, r, n = !1) => {
|
|
1830
|
+
e.removeEventListener(t, r, n);
|
|
1831
|
+
})(), Lo = (e, t) => {
|
|
1832
|
+
var r;
|
|
1833
|
+
return Zt ? Xt() : (r = (t ?? document).querySelector(e)) != null ? r : void 0;
|
|
1834
|
+
}, _r = (e, t) => {
|
|
1835
|
+
if (He(e)) {
|
|
1836
|
+
const r = e[0] === "#" ? `[id='${e.slice(1)}']` : e;
|
|
1837
|
+
return Lo(r, t);
|
|
1838
|
+
}
|
|
1839
|
+
return e;
|
|
1840
|
+
};
|
|
1841
|
+
var To = Object.defineProperty, Er = Object.getOwnPropertySymbols, Mo = Object.prototype.hasOwnProperty, Ao = Object.prototype.propertyIsEnumerable, Cr = (e, t, r) => t in e ? To(e, t, {
|
|
1842
|
+
enumerable: !0,
|
|
1843
|
+
configurable: !0,
|
|
1844
|
+
writable: !0,
|
|
1845
|
+
value: r
|
|
1846
|
+
}) : e[t] = r, Ie = (e, t) => {
|
|
1847
|
+
for (var r in t || (t = {}))
|
|
1848
|
+
Mo.call(t, r) && Cr(e, r, t[r]);
|
|
1849
|
+
if (Er)
|
|
1850
|
+
for (var r of Er(t))
|
|
1851
|
+
Ao.call(t, r) && Cr(e, r, t[r]);
|
|
1852
|
+
return e;
|
|
1853
|
+
};
|
|
1854
|
+
const Do = () => {
|
|
1855
|
+
const {
|
|
1856
|
+
height: e,
|
|
1857
|
+
width: t
|
|
1858
|
+
} = Fo();
|
|
1859
|
+
return {
|
|
1860
|
+
width: Math.min(t, window.innerWidth),
|
|
1861
|
+
height: Math.min(e, window.innerHeight)
|
|
1862
|
+
};
|
|
1863
|
+
}, $r = (e, t) => {
|
|
1864
|
+
var r, n;
|
|
1865
|
+
const l = e.getBoundingClientRect();
|
|
1866
|
+
return {
|
|
1867
|
+
top: l.top,
|
|
1868
|
+
bottom: l.bottom,
|
|
1869
|
+
left: l.left,
|
|
1870
|
+
right: l.right,
|
|
1871
|
+
scrollTop: l.top - t.top,
|
|
1872
|
+
scrollBottom: l.bottom - t.top,
|
|
1873
|
+
scrollLeft: l.left - t.left,
|
|
1874
|
+
scrollRight: l.right - t.left,
|
|
1875
|
+
width: (r = e.offsetWidth) != null ? r : e.clientWidth,
|
|
1876
|
+
height: (n = e.offsetHeight) != null ? n : e.clientHeight
|
|
1877
|
+
};
|
|
1878
|
+
}, Bo = (e) => {
|
|
1879
|
+
switch (e) {
|
|
1880
|
+
case "top":
|
|
1881
|
+
case "tl":
|
|
1882
|
+
case "tr":
|
|
1883
|
+
return "top";
|
|
1884
|
+
case "bottom":
|
|
1885
|
+
case "bl":
|
|
1886
|
+
case "br":
|
|
1887
|
+
return "bottom";
|
|
1888
|
+
case "left":
|
|
1889
|
+
case "lt":
|
|
1890
|
+
case "lb":
|
|
1891
|
+
return "left";
|
|
1892
|
+
case "right":
|
|
1893
|
+
case "rt":
|
|
1894
|
+
case "rb":
|
|
1895
|
+
return "right";
|
|
1896
|
+
default:
|
|
1897
|
+
return "top";
|
|
1898
|
+
}
|
|
1899
|
+
}, tt = (e, t) => {
|
|
1900
|
+
switch (t) {
|
|
1901
|
+
case "top":
|
|
1902
|
+
switch (e) {
|
|
1903
|
+
case "bottom":
|
|
1904
|
+
return "top";
|
|
1905
|
+
case "bl":
|
|
1906
|
+
return "tl";
|
|
1907
|
+
case "br":
|
|
1908
|
+
return "tr";
|
|
1909
|
+
default:
|
|
1910
|
+
return e;
|
|
1911
|
+
}
|
|
1912
|
+
case "bottom":
|
|
1913
|
+
switch (e) {
|
|
1914
|
+
case "top":
|
|
1915
|
+
return "bottom";
|
|
1916
|
+
case "tl":
|
|
1917
|
+
return "bl";
|
|
1918
|
+
case "tr":
|
|
1919
|
+
return "br";
|
|
1920
|
+
default:
|
|
1921
|
+
return e;
|
|
1922
|
+
}
|
|
1923
|
+
case "left":
|
|
1924
|
+
switch (e) {
|
|
1925
|
+
case "right":
|
|
1926
|
+
return "left";
|
|
1927
|
+
case "rt":
|
|
1928
|
+
return "lt";
|
|
1929
|
+
case "rb":
|
|
1930
|
+
return "lb";
|
|
1931
|
+
default:
|
|
1932
|
+
return e;
|
|
1933
|
+
}
|
|
1934
|
+
case "right":
|
|
1935
|
+
switch (e) {
|
|
1936
|
+
case "left":
|
|
1937
|
+
return "right";
|
|
1938
|
+
case "lt":
|
|
1939
|
+
return "rt";
|
|
1940
|
+
case "lb":
|
|
1941
|
+
return "rb";
|
|
1942
|
+
default:
|
|
1943
|
+
return e;
|
|
1944
|
+
}
|
|
1945
|
+
default:
|
|
1946
|
+
return e;
|
|
1947
|
+
}
|
|
1948
|
+
}, Vo = (e, t, {
|
|
1949
|
+
containerRect: r,
|
|
1950
|
+
triggerRect: n,
|
|
1951
|
+
popupRect: l,
|
|
1952
|
+
offset: o,
|
|
1953
|
+
translate: i
|
|
1954
|
+
}) => {
|
|
1955
|
+
const a = Bo(e), s = Do(), u = {
|
|
1956
|
+
top: r.top + t.top,
|
|
1957
|
+
bottom: s.height - (r.top + t.top + l.height),
|
|
1958
|
+
left: r.left + t.left,
|
|
1959
|
+
right: s.width - (r.left + t.left + l.width)
|
|
1960
|
+
};
|
|
1961
|
+
let c = e;
|
|
1962
|
+
if (a === "top" && u.top < 0)
|
|
1963
|
+
if (n.top > l.height)
|
|
1964
|
+
t.top = -r.top;
|
|
1965
|
+
else {
|
|
1966
|
+
const h = ze("bottom", n, l, {
|
|
1967
|
+
offset: o,
|
|
1968
|
+
translate: i
|
|
1969
|
+
});
|
|
1970
|
+
s.height - (r.top + h.top + l.height) > 0 && (c = tt(e, "bottom"), t.top = h.top);
|
|
1971
|
+
}
|
|
1972
|
+
if (a === "bottom" && u.bottom < 0)
|
|
1973
|
+
if (s.height - n.bottom > l.height)
|
|
1974
|
+
t.top = -r.top + (s.height - l.height);
|
|
1975
|
+
else {
|
|
1976
|
+
const h = ze("top", n, l, {
|
|
1977
|
+
offset: o,
|
|
1978
|
+
translate: i
|
|
1979
|
+
});
|
|
1980
|
+
r.top + h.top > 0 && (c = tt(e, "top"), t.top = h.top);
|
|
1981
|
+
}
|
|
1982
|
+
if (a === "left" && u.left < 0)
|
|
1983
|
+
if (n.left > l.width)
|
|
1984
|
+
t.left = -r.left;
|
|
1985
|
+
else {
|
|
1986
|
+
const h = ze("right", n, l, {
|
|
1987
|
+
offset: o,
|
|
1988
|
+
translate: i
|
|
1989
|
+
});
|
|
1990
|
+
s.width - (r.left + h.left + l.width) > 0 && (c = tt(e, "right"), t.left = h.left);
|
|
1991
|
+
}
|
|
1992
|
+
if (a === "right" && u.right < 0)
|
|
1993
|
+
if (s.width - n.right > l.width)
|
|
1994
|
+
t.left = -r.left + (s.width - l.width);
|
|
1995
|
+
else {
|
|
1996
|
+
const h = ze("left", n, l, {
|
|
1997
|
+
offset: o,
|
|
1998
|
+
translate: i
|
|
1999
|
+
});
|
|
2000
|
+
r.left + h.left > 0 && (c = tt(e, "left"), t.left = h.left);
|
|
2001
|
+
}
|
|
2002
|
+
return (a === "top" || a === "bottom") && (u.left < 0 ? t.left = -r.left : u.right < 0 && (t.left = -r.left + (s.width - l.width))), (a === "left" || a === "right") && (u.top < 0 ? t.top = -r.top : u.bottom < 0 && (t.top = -r.top + (s.height - l.height))), {
|
|
2003
|
+
popupPosition: t,
|
|
2004
|
+
position: c
|
|
2005
|
+
};
|
|
2006
|
+
}, ze = (e, t, r, {
|
|
2007
|
+
offset: n = 0,
|
|
2008
|
+
translate: l = [0, 0]
|
|
2009
|
+
} = {}) => {
|
|
2010
|
+
var o;
|
|
2011
|
+
const i = (o = Ee(l) ? l : l[e]) != null ? o : [0, 0];
|
|
2012
|
+
switch (e) {
|
|
2013
|
+
case "top":
|
|
2014
|
+
return {
|
|
2015
|
+
left: t.scrollLeft + Math.round(t.width / 2) - Math.round(r.width / 2) + i[0],
|
|
2016
|
+
top: t.scrollTop - r.height - n + i[1]
|
|
2017
|
+
};
|
|
2018
|
+
case "tl":
|
|
2019
|
+
return {
|
|
2020
|
+
left: t.scrollLeft + i[0],
|
|
2021
|
+
top: t.scrollTop - r.height - n + i[1]
|
|
2022
|
+
};
|
|
2023
|
+
case "tr":
|
|
2024
|
+
return {
|
|
2025
|
+
left: t.scrollRight - r.width + i[0],
|
|
2026
|
+
top: t.scrollTop - r.height - n + i[1]
|
|
2027
|
+
};
|
|
2028
|
+
case "bottom":
|
|
2029
|
+
return {
|
|
2030
|
+
left: t.scrollLeft + Math.round(t.width / 2) - Math.round(r.width / 2) + i[0],
|
|
2031
|
+
top: t.scrollBottom + n + i[1]
|
|
2032
|
+
};
|
|
2033
|
+
case "bl":
|
|
2034
|
+
return {
|
|
2035
|
+
left: t.scrollLeft + i[0],
|
|
2036
|
+
top: t.scrollBottom + n + i[1]
|
|
2037
|
+
};
|
|
2038
|
+
case "br":
|
|
2039
|
+
return {
|
|
2040
|
+
left: t.scrollRight - r.width + i[0],
|
|
2041
|
+
top: t.scrollBottom + n + i[1]
|
|
2042
|
+
};
|
|
2043
|
+
case "left":
|
|
2044
|
+
return {
|
|
2045
|
+
left: t.scrollLeft - r.width - n + i[0],
|
|
2046
|
+
top: t.scrollTop + Math.round(t.height / 2) - Math.round(r.height / 2) + i[1]
|
|
2047
|
+
};
|
|
2048
|
+
case "lt":
|
|
2049
|
+
return {
|
|
2050
|
+
left: t.scrollLeft - r.width - n + i[0],
|
|
2051
|
+
top: t.scrollTop + i[1]
|
|
2052
|
+
};
|
|
2053
|
+
case "lb":
|
|
2054
|
+
return {
|
|
2055
|
+
left: t.scrollLeft - r.width - n + i[0],
|
|
2056
|
+
top: t.scrollBottom - r.height + i[1]
|
|
2057
|
+
};
|
|
2058
|
+
case "right":
|
|
2059
|
+
return {
|
|
2060
|
+
left: t.scrollRight + n + i[0],
|
|
2061
|
+
top: t.scrollTop + Math.round(t.height / 2) - Math.round(r.height / 2) + i[1]
|
|
2062
|
+
};
|
|
2063
|
+
case "rt":
|
|
2064
|
+
return {
|
|
2065
|
+
left: t.scrollRight + n + i[0],
|
|
2066
|
+
top: t.scrollTop + i[1]
|
|
2067
|
+
};
|
|
2068
|
+
case "rb":
|
|
2069
|
+
return {
|
|
2070
|
+
left: t.scrollRight + n + i[0],
|
|
2071
|
+
top: t.scrollBottom - r.height + i[1]
|
|
2072
|
+
};
|
|
2073
|
+
default:
|
|
2074
|
+
return {
|
|
2075
|
+
left: 0,
|
|
2076
|
+
top: 0
|
|
2077
|
+
};
|
|
2078
|
+
}
|
|
2079
|
+
}, xo = (e) => {
|
|
2080
|
+
let t = "0";
|
|
2081
|
+
["top", "bottom"].includes(e) ? t = "50%" : ["left", "lt", "lb", "tr", "br"].includes(e) && (t = "100%");
|
|
2082
|
+
let r = "0";
|
|
2083
|
+
return ["left", "right"].includes(e) ? r = "50%" : ["top", "tl", "tr", "lt", "rt"].includes(e) && (r = "100%"), `${t} ${r}`;
|
|
2084
|
+
}, No = (e, t, r, n, {
|
|
2085
|
+
offset: l = 0,
|
|
2086
|
+
translate: o = [0, 0],
|
|
2087
|
+
customStyle: i = {},
|
|
2088
|
+
autoFitPosition: a = !1
|
|
2089
|
+
} = {}) => {
|
|
2090
|
+
let s = e, u = ze(e, r, n, {
|
|
2091
|
+
offset: l,
|
|
2092
|
+
translate: o
|
|
2093
|
+
});
|
|
2094
|
+
if (a) {
|
|
2095
|
+
const h = Vo(e, u, {
|
|
2096
|
+
containerRect: t,
|
|
2097
|
+
popupRect: n,
|
|
2098
|
+
triggerRect: r,
|
|
2099
|
+
offset: l,
|
|
2100
|
+
translate: o
|
|
2101
|
+
});
|
|
2102
|
+
u = h.popupPosition, s = h.position;
|
|
2103
|
+
}
|
|
2104
|
+
return {
|
|
2105
|
+
style: Ie({
|
|
2106
|
+
left: `${u.left}px`,
|
|
2107
|
+
top: `${u.top}px`
|
|
2108
|
+
}, i),
|
|
2109
|
+
position: s
|
|
2110
|
+
};
|
|
2111
|
+
}, Io = (e, t, r, {
|
|
2112
|
+
customStyle: n = {}
|
|
2113
|
+
}) => {
|
|
2114
|
+
if (["top", "tl", "tr", "bottom", "bl", "br"].includes(e)) {
|
|
2115
|
+
let o = Math.abs(t.scrollLeft + t.width / 2 - r.scrollLeft);
|
|
2116
|
+
return o > r.width - 8 && (t.width > r.width ? o = r.width / 2 : o = r.width - 8), ["top", "tl", "tr"].includes(e) ? Ie({
|
|
2117
|
+
left: `${o}px`,
|
|
2118
|
+
bottom: "0",
|
|
2119
|
+
transform: "translate(-50%,50%) rotate(45deg)"
|
|
2120
|
+
}, n) : Ie({
|
|
2121
|
+
left: `${o}px`,
|
|
2122
|
+
top: "0",
|
|
2123
|
+
transform: "translate(-50%,-50%) rotate(45deg)"
|
|
2124
|
+
}, n);
|
|
2125
|
+
}
|
|
2126
|
+
let l = Math.abs(t.scrollTop + t.height / 2 - r.scrollTop);
|
|
2127
|
+
return l > r.height - 8 && (t.height > r.height ? l = r.height / 2 : l = r.height - 8), ["left", "lt", "lb"].includes(e) ? Ie({
|
|
2128
|
+
top: `${l}px`,
|
|
2129
|
+
right: "0",
|
|
2130
|
+
transform: "translate(50%,-50%) rotate(45deg)"
|
|
2131
|
+
}, n) : Ie({
|
|
2132
|
+
top: `${l}px`,
|
|
2133
|
+
left: "0",
|
|
2134
|
+
transform: "translate(-50%,-50%) rotate(45deg)"
|
|
2135
|
+
}, n);
|
|
2136
|
+
}, zo = (e) => e.scrollHeight > e.offsetHeight || e.scrollWidth > e.offsetWidth, Or = (e) => {
|
|
2137
|
+
var t;
|
|
2138
|
+
const r = [];
|
|
2139
|
+
let n = e;
|
|
2140
|
+
for (; n && n !== document.documentElement; )
|
|
2141
|
+
zo(n) && r.push(n), n = (t = n.parentElement) != null ? t : void 0;
|
|
2142
|
+
return r;
|
|
2143
|
+
};
|
|
2144
|
+
function qo(e, t) {
|
|
2145
|
+
const r = F(e[t]);
|
|
2146
|
+
return ft(() => {
|
|
2147
|
+
const n = e[t];
|
|
2148
|
+
r.value !== n && (r.value = n);
|
|
2149
|
+
}), r;
|
|
2150
|
+
}
|
|
2151
|
+
const Sr = Symbol("ArcoTrigger"), hn = typeof window > "u" ? global : window, Wo = hn.requestAnimationFrame, jr = hn.cancelAnimationFrame;
|
|
2152
|
+
function kr(e) {
|
|
2153
|
+
let t = 0;
|
|
2154
|
+
const r = (...n) => {
|
|
2155
|
+
t && jr(t), t = Wo(() => {
|
|
2156
|
+
e(...n), t = 0;
|
|
2157
|
+
});
|
|
2158
|
+
};
|
|
2159
|
+
return r.cancel = () => {
|
|
2160
|
+
jr(t), t = 0;
|
|
2161
|
+
}, r;
|
|
2162
|
+
}
|
|
2163
|
+
const Ro = 1e3, Ho = 5e3, Go = 1;
|
|
2164
|
+
class Uo {
|
|
2165
|
+
constructor() {
|
|
2166
|
+
this.popupStack = {
|
|
2167
|
+
popup: /* @__PURE__ */ new Set(),
|
|
2168
|
+
dialog: /* @__PURE__ */ new Set(),
|
|
2169
|
+
message: /* @__PURE__ */ new Set()
|
|
2170
|
+
}, this.getNextZIndex = (t) => (t === "message" ? Array.from(this.popupStack.message).pop() || Ho : Array.from(this.popupStack.popup).pop() || Ro) + Go, this.add = (t) => {
|
|
2171
|
+
const r = this.getNextZIndex(t);
|
|
2172
|
+
return this.popupStack[t].add(r), t === "dialog" && this.popupStack.popup.add(r), r;
|
|
2173
|
+
}, this.delete = (t, r) => {
|
|
2174
|
+
this.popupStack[r].delete(t), r === "dialog" && this.popupStack.popup.delete(t);
|
|
2175
|
+
}, this.isLastDialog = (t) => this.popupStack.dialog.size > 1 ? t === Array.from(this.popupStack.dialog).pop() : !0;
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
const $t = new Uo();
|
|
2179
|
+
function Yo(e, {
|
|
2180
|
+
visible: t,
|
|
2181
|
+
runOnMounted: r
|
|
2182
|
+
} = {}) {
|
|
2183
|
+
const n = F(0), l = () => {
|
|
2184
|
+
n.value = $t.add(e);
|
|
2185
|
+
}, o = () => {
|
|
2186
|
+
$t.delete(n.value, e);
|
|
2187
|
+
}, i = () => e === "dialog" ? $t.isLastDialog(n.value) : !1;
|
|
2188
|
+
return Te(() => t == null ? void 0 : t.value, (a) => {
|
|
2189
|
+
a ? l() : o();
|
|
2190
|
+
}, {
|
|
2191
|
+
immediate: !0
|
|
2192
|
+
}), r && (he(() => {
|
|
2193
|
+
l();
|
|
2194
|
+
}), Ge(() => {
|
|
2195
|
+
o();
|
|
2196
|
+
})), {
|
|
2197
|
+
zIndex: Sn(n),
|
|
2198
|
+
open: l,
|
|
2199
|
+
close: o,
|
|
2200
|
+
isLastDialog: i
|
|
2201
|
+
};
|
|
2202
|
+
}
|
|
2203
|
+
const Ko = ({
|
|
2204
|
+
elementRef: e,
|
|
2205
|
+
onResize: t
|
|
2206
|
+
}) => {
|
|
2207
|
+
let r;
|
|
2208
|
+
return {
|
|
2209
|
+
createResizeObserver: () => {
|
|
2210
|
+
e.value && (r = new on((o) => {
|
|
2211
|
+
const i = o[0];
|
|
2212
|
+
it(t) && t(i);
|
|
2213
|
+
}), r.observe(e.value));
|
|
2214
|
+
},
|
|
2215
|
+
destroyResizeObserver: () => {
|
|
2216
|
+
r && (r.disconnect(), r = null);
|
|
2217
|
+
}
|
|
2218
|
+
};
|
|
2219
|
+
};
|
|
2220
|
+
var Xo = I({
|
|
2221
|
+
name: "ClientOnly",
|
|
2222
|
+
setup(e, {
|
|
2223
|
+
slots: t
|
|
2224
|
+
}) {
|
|
2225
|
+
const r = F(!1);
|
|
2226
|
+
return he(() => r.value = !0), () => {
|
|
2227
|
+
var n;
|
|
2228
|
+
return r.value ? (n = t.default) == null ? void 0 : n.call(t) : null;
|
|
2229
|
+
};
|
|
2230
|
+
}
|
|
2231
|
+
});
|
|
2232
|
+
const Zo = ({
|
|
2233
|
+
popupContainer: e,
|
|
2234
|
+
visible: t,
|
|
2235
|
+
defaultContainer: r = "body",
|
|
2236
|
+
documentContainer: n
|
|
2237
|
+
}) => {
|
|
2238
|
+
const l = F(e.value), o = F(), i = () => {
|
|
2239
|
+
const a = _r(e.value), s = a ? e.value : r, u = a ?? (n ? document.documentElement : _r(r));
|
|
2240
|
+
s !== l.value && (l.value = s), u !== o.value && (o.value = u);
|
|
2241
|
+
};
|
|
2242
|
+
return he(() => i()), Te(t, (a) => {
|
|
2243
|
+
l.value !== e.value && a && i();
|
|
2244
|
+
}), {
|
|
2245
|
+
teleportContainer: l,
|
|
2246
|
+
containerRef: o
|
|
2247
|
+
};
|
|
2248
|
+
};
|
|
2249
|
+
var Qo = Object.defineProperty, Pr = Object.getOwnPropertySymbols, Jo = Object.prototype.hasOwnProperty, ei = Object.prototype.propertyIsEnumerable, Fr = (e, t, r) => t in e ? Qo(e, t, {
|
|
2250
|
+
enumerable: !0,
|
|
2251
|
+
configurable: !0,
|
|
2252
|
+
writable: !0,
|
|
2253
|
+
value: r
|
|
2254
|
+
}) : e[t] = r, ti = (e, t) => {
|
|
2255
|
+
for (var r in t || (t = {}))
|
|
2256
|
+
Jo.call(t, r) && Fr(e, r, t[r]);
|
|
2257
|
+
if (Pr)
|
|
2258
|
+
for (var r of Pr(t))
|
|
2259
|
+
ei.call(t, r) && Fr(e, r, t[r]);
|
|
2260
|
+
return e;
|
|
2261
|
+
};
|
|
2262
|
+
const ri = (e, t) => {
|
|
2263
|
+
const r = ti({}, e);
|
|
2264
|
+
for (const n of t)
|
|
2265
|
+
n in r && delete r[n];
|
|
2266
|
+
return r;
|
|
2267
|
+
};
|
|
2268
|
+
var ni = Object.defineProperty, li = Object.defineProperties, oi = Object.getOwnPropertyDescriptors, Lr = Object.getOwnPropertySymbols, ii = Object.prototype.hasOwnProperty, ai = Object.prototype.propertyIsEnumerable, Tr = (e, t, r) => t in e ? ni(e, t, {
|
|
2269
|
+
enumerable: !0,
|
|
2270
|
+
configurable: !0,
|
|
2271
|
+
writable: !0,
|
|
2272
|
+
value: r
|
|
2273
|
+
}) : e[t] = r, si = (e, t) => {
|
|
2274
|
+
for (var r in t || (t = {}))
|
|
2275
|
+
ii.call(t, r) && Tr(e, r, t[r]);
|
|
2276
|
+
if (Lr)
|
|
2277
|
+
for (var r of Lr(t))
|
|
2278
|
+
ai.call(t, r) && Tr(e, r, t[r]);
|
|
2279
|
+
return e;
|
|
2280
|
+
}, ui = (e, t) => li(e, oi(t));
|
|
2281
|
+
const ci = ["onClick", "onMouseenter", "onMouseleave", "onFocusin", "onFocusout", "onContextmenu"];
|
|
2282
|
+
var Ot = I({
|
|
2283
|
+
name: "Trigger",
|
|
2284
|
+
inheritAttrs: !1,
|
|
2285
|
+
props: {
|
|
2286
|
+
popupVisible: {
|
|
2287
|
+
type: Boolean,
|
|
2288
|
+
default: void 0
|
|
2289
|
+
},
|
|
2290
|
+
defaultPopupVisible: {
|
|
2291
|
+
type: Boolean,
|
|
2292
|
+
default: !1
|
|
2293
|
+
},
|
|
2294
|
+
trigger: {
|
|
2295
|
+
type: [String, Array],
|
|
2296
|
+
default: "hover"
|
|
2297
|
+
},
|
|
2298
|
+
position: {
|
|
2299
|
+
type: String,
|
|
2300
|
+
default: "bottom"
|
|
2301
|
+
},
|
|
2302
|
+
disabled: {
|
|
2303
|
+
type: Boolean,
|
|
2304
|
+
default: !1
|
|
2305
|
+
},
|
|
2306
|
+
popupOffset: {
|
|
2307
|
+
type: Number,
|
|
2308
|
+
default: 0
|
|
2309
|
+
},
|
|
2310
|
+
popupTranslate: {
|
|
2311
|
+
type: [Array, Object]
|
|
2312
|
+
},
|
|
2313
|
+
showArrow: {
|
|
2314
|
+
type: Boolean,
|
|
2315
|
+
default: !1
|
|
2316
|
+
},
|
|
2317
|
+
alignPoint: {
|
|
2318
|
+
type: Boolean,
|
|
2319
|
+
default: !1
|
|
2320
|
+
},
|
|
2321
|
+
popupHoverStay: {
|
|
2322
|
+
type: Boolean,
|
|
2323
|
+
default: !0
|
|
2324
|
+
},
|
|
2325
|
+
blurToClose: {
|
|
2326
|
+
type: Boolean,
|
|
2327
|
+
default: !0
|
|
2328
|
+
},
|
|
2329
|
+
clickToClose: {
|
|
2330
|
+
type: Boolean,
|
|
2331
|
+
default: !0
|
|
2332
|
+
},
|
|
2333
|
+
clickOutsideToClose: {
|
|
2334
|
+
type: Boolean,
|
|
2335
|
+
default: !0
|
|
2336
|
+
},
|
|
2337
|
+
unmountOnClose: {
|
|
2338
|
+
type: Boolean,
|
|
2339
|
+
default: !0
|
|
2340
|
+
},
|
|
2341
|
+
contentClass: {
|
|
2342
|
+
type: [String, Array, Object]
|
|
2343
|
+
},
|
|
2344
|
+
contentStyle: {
|
|
2345
|
+
type: Object
|
|
2346
|
+
},
|
|
2347
|
+
arrowClass: {
|
|
2348
|
+
type: [String, Array, Object]
|
|
2349
|
+
},
|
|
2350
|
+
arrowStyle: {
|
|
2351
|
+
type: Object
|
|
2352
|
+
},
|
|
2353
|
+
popupStyle: {
|
|
2354
|
+
type: Object
|
|
2355
|
+
},
|
|
2356
|
+
animationName: {
|
|
2357
|
+
type: String,
|
|
2358
|
+
default: "fade-in"
|
|
2359
|
+
},
|
|
2360
|
+
duration: {
|
|
2361
|
+
type: [Number, Object]
|
|
2362
|
+
},
|
|
2363
|
+
mouseEnterDelay: {
|
|
2364
|
+
type: Number,
|
|
2365
|
+
default: 100
|
|
2366
|
+
},
|
|
2367
|
+
mouseLeaveDelay: {
|
|
2368
|
+
type: Number,
|
|
2369
|
+
default: 100
|
|
2370
|
+
},
|
|
2371
|
+
focusDelay: {
|
|
2372
|
+
type: Number,
|
|
2373
|
+
default: 0
|
|
2374
|
+
},
|
|
2375
|
+
autoFitPopupWidth: {
|
|
2376
|
+
type: Boolean,
|
|
2377
|
+
default: !1
|
|
2378
|
+
},
|
|
2379
|
+
autoFitPopupMinWidth: {
|
|
2380
|
+
type: Boolean,
|
|
2381
|
+
default: !1
|
|
2382
|
+
},
|
|
2383
|
+
autoFixPosition: {
|
|
2384
|
+
type: Boolean,
|
|
2385
|
+
default: !0
|
|
2386
|
+
},
|
|
2387
|
+
popupContainer: {
|
|
2388
|
+
type: [String, Object]
|
|
2389
|
+
},
|
|
2390
|
+
updateAtScroll: {
|
|
2391
|
+
type: Boolean,
|
|
2392
|
+
default: !1
|
|
2393
|
+
},
|
|
2394
|
+
autoFitTransformOrigin: {
|
|
2395
|
+
type: Boolean,
|
|
2396
|
+
default: !1
|
|
2397
|
+
},
|
|
2398
|
+
hideEmpty: {
|
|
2399
|
+
type: Boolean,
|
|
2400
|
+
default: !1
|
|
2401
|
+
},
|
|
2402
|
+
openedClass: {
|
|
2403
|
+
type: [String, Array, Object]
|
|
2404
|
+
},
|
|
2405
|
+
autoFitPosition: {
|
|
2406
|
+
type: Boolean,
|
|
2407
|
+
default: !0
|
|
2408
|
+
},
|
|
2409
|
+
renderToBody: {
|
|
2410
|
+
type: Boolean,
|
|
2411
|
+
default: !0
|
|
2412
|
+
},
|
|
2413
|
+
preventFocus: {
|
|
2414
|
+
type: Boolean,
|
|
2415
|
+
default: !1
|
|
2416
|
+
},
|
|
2417
|
+
scrollToClose: {
|
|
2418
|
+
type: Boolean,
|
|
2419
|
+
default: !1
|
|
2420
|
+
},
|
|
2421
|
+
scrollToCloseDistance: {
|
|
2422
|
+
type: Number,
|
|
2423
|
+
default: 0
|
|
2424
|
+
}
|
|
2425
|
+
},
|
|
2426
|
+
emits: {
|
|
2427
|
+
"update:popupVisible": (e) => !0,
|
|
2428
|
+
popupVisibleChange: (e) => !0,
|
|
2429
|
+
show: () => !0,
|
|
2430
|
+
hide: () => !0,
|
|
2431
|
+
resize: () => !0
|
|
2432
|
+
},
|
|
2433
|
+
setup(e, {
|
|
2434
|
+
emit: t,
|
|
2435
|
+
slots: r,
|
|
2436
|
+
attrs: n
|
|
2437
|
+
}) {
|
|
2438
|
+
const {
|
|
2439
|
+
popupContainer: l
|
|
2440
|
+
} = ye(e), o = G("trigger"), i = d(() => ri(n, ci)), a = J(ht, void 0), s = d(() => [].concat(e.trigger)), u = /* @__PURE__ */ new Set(), c = J(Sr, void 0), {
|
|
2441
|
+
children: h,
|
|
2442
|
+
firstElement: p
|
|
2443
|
+
} = fn(), b = F(), O = F(e.defaultPopupVisible), _ = F(e.position), w = F({}), m = F({}), S = F({}), B = F(), M = F({
|
|
2444
|
+
top: 0,
|
|
2445
|
+
left: 0
|
|
2446
|
+
});
|
|
2447
|
+
let N = null, Y = null;
|
|
2448
|
+
const j = d(() => {
|
|
2449
|
+
var v;
|
|
2450
|
+
return (v = e.popupVisible) != null ? v : O.value;
|
|
2451
|
+
}), {
|
|
2452
|
+
teleportContainer: T,
|
|
2453
|
+
containerRef: z
|
|
2454
|
+
} = Zo({
|
|
2455
|
+
popupContainer: l,
|
|
2456
|
+
visible: j,
|
|
2457
|
+
documentContainer: !0
|
|
2458
|
+
}), {
|
|
2459
|
+
zIndex: x
|
|
2460
|
+
} = Yo("popup", {
|
|
2461
|
+
visible: j
|
|
2462
|
+
});
|
|
2463
|
+
let Q = 0, U = !1, P = !1;
|
|
2464
|
+
const oe = () => {
|
|
2465
|
+
Q && (window.clearTimeout(Q), Q = 0);
|
|
2466
|
+
}, te = (v) => {
|
|
2467
|
+
if (e.alignPoint) {
|
|
2468
|
+
const {
|
|
2469
|
+
pageX: g,
|
|
2470
|
+
pageY: K
|
|
2471
|
+
} = v;
|
|
2472
|
+
M.value = {
|
|
2473
|
+
top: K,
|
|
2474
|
+
left: g
|
|
2475
|
+
};
|
|
2476
|
+
}
|
|
2477
|
+
}, q = () => {
|
|
2478
|
+
if (!p.value || !b.value || !z.value)
|
|
2479
|
+
return;
|
|
2480
|
+
const v = z.value.getBoundingClientRect(), g = e.alignPoint ? {
|
|
2481
|
+
top: M.value.top,
|
|
2482
|
+
bottom: M.value.top,
|
|
2483
|
+
left: M.value.left,
|
|
2484
|
+
right: M.value.left,
|
|
2485
|
+
scrollTop: M.value.top,
|
|
2486
|
+
scrollBottom: M.value.top,
|
|
2487
|
+
scrollLeft: M.value.left,
|
|
2488
|
+
scrollRight: M.value.left,
|
|
2489
|
+
width: 0,
|
|
2490
|
+
height: 0
|
|
2491
|
+
} : $r(p.value, v), K = () => $r(b.value, v), Pe = K(), {
|
|
2492
|
+
style: Oe,
|
|
2493
|
+
position: Fe
|
|
2494
|
+
} = No(e.position, v, g, Pe, {
|
|
2495
|
+
offset: e.popupOffset,
|
|
2496
|
+
translate: e.popupTranslate,
|
|
2497
|
+
customStyle: e.popupStyle,
|
|
2498
|
+
autoFitPosition: e.autoFitPosition
|
|
2499
|
+
});
|
|
2500
|
+
e.autoFitTransformOrigin && (m.value = {
|
|
2501
|
+
transformOrigin: xo(Fe)
|
|
2502
|
+
}), e.autoFitPopupMinWidth ? Oe.minWidth = `${g.width}px` : e.autoFitPopupWidth && (Oe.width = `${g.width}px`), _.value !== Fe && (_.value = Fe), w.value = Oe, e.showArrow && qe(() => {
|
|
2503
|
+
S.value = Io(Fe, g, K(), {
|
|
2504
|
+
customStyle: e.arrowStyle
|
|
2505
|
+
});
|
|
2506
|
+
});
|
|
2507
|
+
}, W = (v, g) => {
|
|
2508
|
+
if (v === j.value && Q === 0)
|
|
2509
|
+
return;
|
|
2510
|
+
const K = () => {
|
|
2511
|
+
O.value = v, t("update:popupVisible", v), t("popupVisibleChange", v), v && qe(() => {
|
|
2512
|
+
q();
|
|
2513
|
+
});
|
|
2514
|
+
};
|
|
2515
|
+
v || (N = null, Y = null), g ? (oe(), v !== j.value && (Q = window.setTimeout(K, g))) : K();
|
|
2516
|
+
}, E = (v) => {
|
|
2517
|
+
var g;
|
|
2518
|
+
(g = n.onClick) == null || g.call(n, v), !(e.disabled || j.value && !e.clickToClose) && (s.value.includes("click") ? (te(v), W(!j.value)) : s.value.includes("contextMenu") && j.value && W(!1));
|
|
2519
|
+
}, k = (v) => {
|
|
2520
|
+
var g;
|
|
2521
|
+
(g = n.onMouseenter) == null || g.call(n, v), !(e.disabled || !s.value.includes("hover")) && (te(v), W(!0, e.mouseEnterDelay));
|
|
2522
|
+
}, f = (v) => {
|
|
2523
|
+
c == null || c.onMouseenter(v), k(v);
|
|
2524
|
+
}, y = (v) => {
|
|
2525
|
+
var g;
|
|
2526
|
+
(g = n.onMouseleave) == null || g.call(n, v), !(e.disabled || !s.value.includes("hover")) && W(!1, e.mouseLeaveDelay);
|
|
2527
|
+
}, $ = (v) => {
|
|
2528
|
+
c == null || c.onMouseleave(v), y(v);
|
|
2529
|
+
}, A = (v) => {
|
|
2530
|
+
var g;
|
|
2531
|
+
(g = n.onFocusin) == null || g.call(n, v), !(e.disabled || !s.value.includes("focus")) && W(!0, e.focusDelay);
|
|
2532
|
+
}, Z = (v) => {
|
|
2533
|
+
var g;
|
|
2534
|
+
(g = n.onFocusout) == null || g.call(n, v), !(e.disabled || !s.value.includes("focus")) && e.blurToClose && W(!1);
|
|
2535
|
+
}, re = (v) => {
|
|
2536
|
+
var g;
|
|
2537
|
+
(g = n.onContextmenu) == null || g.call(n, v), !(e.disabled || !s.value.includes("contextMenu") || j.value && !e.clickToClose) && (te(v), W(!j.value), v.preventDefault());
|
|
2538
|
+
};
|
|
2539
|
+
ge(Sr, le({
|
|
2540
|
+
onMouseenter: f,
|
|
2541
|
+
onMouseleave: $,
|
|
2542
|
+
addChildRef: (v) => {
|
|
2543
|
+
u.add(v), c == null || c.addChildRef(v);
|
|
2544
|
+
},
|
|
2545
|
+
removeChildRef: (v) => {
|
|
2546
|
+
u.delete(v), c == null || c.removeChildRef(v);
|
|
2547
|
+
}
|
|
2548
|
+
}));
|
|
2549
|
+
const ae = () => {
|
|
2550
|
+
wr(document.documentElement, "mousedown", ke), U = !1;
|
|
2551
|
+
}, ve = qo(r, "content"), Ke = d(() => {
|
|
2552
|
+
var v;
|
|
2553
|
+
return e.hideEmpty && Po((v = ve.value) == null ? void 0 : v.call(ve));
|
|
2554
|
+
}), ke = (v) => {
|
|
2555
|
+
var g, K, Pe;
|
|
2556
|
+
if (!((g = p.value) != null && g.contains(v.target) || (K = b.value) != null && K.contains(v.target))) {
|
|
2557
|
+
for (const Oe of u)
|
|
2558
|
+
if ((Pe = Oe.value) != null && Pe.contains(v.target))
|
|
2559
|
+
return;
|
|
2560
|
+
ae(), W(!1);
|
|
2561
|
+
}
|
|
2562
|
+
}, xe = (v, g) => {
|
|
2563
|
+
const [K, Pe] = v, {
|
|
2564
|
+
scrollTop: Oe,
|
|
2565
|
+
scrollLeft: Fe
|
|
2566
|
+
} = g;
|
|
2567
|
+
return Math.abs(Oe - K) >= e.scrollToCloseDistance || Math.abs(Fe - Pe) >= e.scrollToCloseDistance;
|
|
2568
|
+
}, $e = kr((v) => {
|
|
2569
|
+
if (j.value)
|
|
2570
|
+
if (e.scrollToClose || a != null && a.scrollToClose) {
|
|
2571
|
+
const g = v.target;
|
|
2572
|
+
N || (N = [g.scrollTop, g.scrollLeft]), xe(N, g) ? W(!1) : q();
|
|
2573
|
+
} else
|
|
2574
|
+
q();
|
|
2575
|
+
}), Xe = () => {
|
|
2576
|
+
wr(window, "scroll", Qt), P = !1;
|
|
2577
|
+
}, Qt = kr((v) => {
|
|
2578
|
+
const g = v.target.documentElement;
|
|
2579
|
+
Y || (Y = [g.scrollTop, g.scrollLeft]), xe(Y, g) && (W(!1), Xe());
|
|
2580
|
+
}), bt = () => {
|
|
2581
|
+
j.value && q();
|
|
2582
|
+
}, bn = () => {
|
|
2583
|
+
bt(), t("resize");
|
|
2584
|
+
}, yn = (v) => {
|
|
2585
|
+
e.preventFocus && v.preventDefault();
|
|
2586
|
+
};
|
|
2587
|
+
c == null || c.addChildRef(b);
|
|
2588
|
+
const gn = d(() => j.value ? e.openedClass : void 0);
|
|
2589
|
+
let fe;
|
|
2590
|
+
Te(j, (v) => {
|
|
2591
|
+
if (e.clickOutsideToClose && (!v && U ? ae() : v && !U && (Ct(document.documentElement, "mousedown", ke), U = !0)), (e.scrollToClose || a != null && a.scrollToClose) && (Ct(window, "scroll", Qt), P = !0), e.updateAtScroll || a != null && a.updateAtScroll) {
|
|
2592
|
+
if (v) {
|
|
2593
|
+
fe = Or(p.value);
|
|
2594
|
+
for (const g of fe)
|
|
2595
|
+
g.addEventListener("scroll", $e);
|
|
2596
|
+
} else if (fe) {
|
|
2597
|
+
for (const g of fe)
|
|
2598
|
+
g.removeEventListener("scroll", $e);
|
|
2599
|
+
fe = void 0;
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
v && (yt.value = !0);
|
|
2603
|
+
}), Te(() => [e.autoFitPopupWidth, e.autoFitPopupMinWidth], () => {
|
|
2604
|
+
j.value && q();
|
|
2605
|
+
});
|
|
2606
|
+
const {
|
|
2607
|
+
createResizeObserver: wn,
|
|
2608
|
+
destroyResizeObserver: _n
|
|
2609
|
+
} = Ko({
|
|
2610
|
+
elementRef: z,
|
|
2611
|
+
onResize: bt
|
|
2612
|
+
});
|
|
2613
|
+
he(() => {
|
|
2614
|
+
if (wn(), j.value && (q(), e.clickOutsideToClose && !U && (Ct(document.documentElement, "mousedown", ke), U = !0), e.updateAtScroll || a != null && a.updateAtScroll)) {
|
|
2615
|
+
fe = Or(p.value);
|
|
2616
|
+
for (const v of fe)
|
|
2617
|
+
v.addEventListener("scroll", $e);
|
|
2618
|
+
}
|
|
2619
|
+
}), ft(() => {
|
|
2620
|
+
j.value && q();
|
|
2621
|
+
}), jn(() => {
|
|
2622
|
+
W(!1);
|
|
2623
|
+
}), Ge(() => {
|
|
2624
|
+
if (c == null || c.removeChildRef(b), _n(), U && ae(), P && Xe(), fe) {
|
|
2625
|
+
for (const v of fe)
|
|
2626
|
+
v.removeEventListener("scroll", $e);
|
|
2627
|
+
fe = void 0;
|
|
2628
|
+
}
|
|
2629
|
+
});
|
|
2630
|
+
const yt = F(j.value), Ze = F(!1), Jt = () => {
|
|
2631
|
+
Ze.value = !0;
|
|
2632
|
+
}, En = () => {
|
|
2633
|
+
Ze.value = !1, j.value && t("show");
|
|
2634
|
+
}, Cn = () => {
|
|
2635
|
+
Ze.value = !1, j.value || (yt.value = !1, t("hide"));
|
|
2636
|
+
};
|
|
2637
|
+
return () => {
|
|
2638
|
+
var v, g;
|
|
2639
|
+
return h.value = (g = (v = r.default) == null ? void 0 : v.call(r)) != null ? g : [], sn(h.value, {
|
|
2640
|
+
class: gn.value,
|
|
2641
|
+
onClick: E,
|
|
2642
|
+
onMouseenter: k,
|
|
2643
|
+
onMouseleave: y,
|
|
2644
|
+
onFocusin: A,
|
|
2645
|
+
onFocusout: Z,
|
|
2646
|
+
onContextmenu: re
|
|
2647
|
+
}), C(Wt, null, [e.autoFixPosition ? C(qt, {
|
|
2648
|
+
onResize: bn
|
|
2649
|
+
}, {
|
|
2650
|
+
default: () => [h.value]
|
|
2651
|
+
}) : h.value, C(Xo, null, {
|
|
2652
|
+
default: () => [C(kn, {
|
|
2653
|
+
to: T.value,
|
|
2654
|
+
disabled: !e.renderToBody
|
|
2655
|
+
}, {
|
|
2656
|
+
default: () => [(!e.unmountOnClose || j.value || yt.value) && !Ke.value && C(qt, {
|
|
2657
|
+
onResize: bt
|
|
2658
|
+
}, {
|
|
2659
|
+
default: () => [C("div", Le({
|
|
2660
|
+
ref: b,
|
|
2661
|
+
class: [`${o}-popup`, `${o}-position-${_.value}`],
|
|
2662
|
+
style: ui(si({}, w.value), {
|
|
2663
|
+
zIndex: x.value,
|
|
2664
|
+
pointerEvents: Ze.value ? "none" : "auto"
|
|
2665
|
+
}),
|
|
2666
|
+
"trigger-placement": _.value,
|
|
2667
|
+
onMouseenter: f,
|
|
2668
|
+
onMouseleave: $,
|
|
2669
|
+
onMousedown: yn
|
|
2670
|
+
}, i.value), [C(Dt, {
|
|
2671
|
+
name: e.animationName,
|
|
2672
|
+
duration: e.duration,
|
|
2673
|
+
appear: !0,
|
|
2674
|
+
onBeforeEnter: Jt,
|
|
2675
|
+
onAfterEnter: En,
|
|
2676
|
+
onBeforeLeave: Jt,
|
|
2677
|
+
onAfterLeave: Cn
|
|
2678
|
+
}, {
|
|
2679
|
+
default: () => {
|
|
2680
|
+
var K;
|
|
2681
|
+
return [Pn(C("div", {
|
|
2682
|
+
class: `${o}-popup-wrapper`,
|
|
2683
|
+
style: m.value
|
|
2684
|
+
}, [C("div", {
|
|
2685
|
+
class: [`${o}-content`, e.contentClass],
|
|
2686
|
+
style: e.contentStyle
|
|
2687
|
+
}, [(K = r.content) == null ? void 0 : K.call(r)]), e.showArrow && C("div", {
|
|
2688
|
+
ref: B,
|
|
2689
|
+
class: [`${o}-arrow`, e.arrowClass],
|
|
2690
|
+
style: S.value
|
|
2691
|
+
}, null)]), [[Fn, j.value]])];
|
|
2692
|
+
}
|
|
2693
|
+
})])]
|
|
2694
|
+
})]
|
|
2695
|
+
})]
|
|
2696
|
+
})]);
|
|
2697
|
+
};
|
|
2698
|
+
}
|
|
2699
|
+
});
|
|
2700
|
+
const di = Object.assign(Ot, {
|
|
2701
|
+
install: (e, t) => {
|
|
2702
|
+
Be(e, t);
|
|
2703
|
+
const r = De(t);
|
|
2704
|
+
e.component(r + Ot.name, Ot);
|
|
2705
|
+
}
|
|
2706
|
+
});
|
|
2707
|
+
var fi = Object.defineProperty, Mr = Object.getOwnPropertySymbols, hi = Object.prototype.hasOwnProperty, vi = Object.prototype.propertyIsEnumerable, Ar = (e, t, r) => t in e ? fi(e, t, {
|
|
2708
|
+
enumerable: !0,
|
|
2709
|
+
configurable: !0,
|
|
2710
|
+
writable: !0,
|
|
2711
|
+
value: r
|
|
2712
|
+
}) : e[t] = r, Dr = (e, t) => {
|
|
2713
|
+
for (var r in t || (t = {}))
|
|
2714
|
+
hi.call(t, r) && Ar(e, r, t[r]);
|
|
2715
|
+
if (Mr)
|
|
2716
|
+
for (var r of Mr(t))
|
|
2717
|
+
vi.call(t, r) && Ar(e, r, t[r]);
|
|
2718
|
+
return e;
|
|
2719
|
+
};
|
|
2720
|
+
const pi = I({
|
|
2721
|
+
name: "Tooltip",
|
|
2722
|
+
components: {
|
|
2723
|
+
Trigger: di
|
|
2724
|
+
},
|
|
2725
|
+
props: {
|
|
2726
|
+
popupVisible: {
|
|
2727
|
+
type: Boolean,
|
|
2728
|
+
default: void 0
|
|
2729
|
+
},
|
|
2730
|
+
defaultPopupVisible: {
|
|
2731
|
+
type: Boolean,
|
|
2732
|
+
default: !1
|
|
2733
|
+
},
|
|
2734
|
+
content: String,
|
|
2735
|
+
position: {
|
|
2736
|
+
type: String,
|
|
2737
|
+
default: "top"
|
|
2738
|
+
},
|
|
2739
|
+
mini: {
|
|
2740
|
+
type: Boolean,
|
|
2741
|
+
default: !1
|
|
2742
|
+
},
|
|
2743
|
+
backgroundColor: {
|
|
2744
|
+
type: String
|
|
2745
|
+
},
|
|
2746
|
+
contentClass: {
|
|
2747
|
+
type: [String, Array, Object]
|
|
2748
|
+
},
|
|
2749
|
+
contentStyle: {
|
|
2750
|
+
type: Object
|
|
2751
|
+
},
|
|
2752
|
+
arrowClass: {
|
|
2753
|
+
type: [String, Array, Object]
|
|
2754
|
+
},
|
|
2755
|
+
arrowStyle: {
|
|
2756
|
+
type: Object
|
|
2757
|
+
},
|
|
2758
|
+
popupContainer: {
|
|
2759
|
+
type: [String, Object]
|
|
2760
|
+
}
|
|
2761
|
+
},
|
|
2762
|
+
emits: {
|
|
2763
|
+
"update:popupVisible": (e) => !0,
|
|
2764
|
+
popupVisibleChange: (e) => !0
|
|
2765
|
+
},
|
|
2766
|
+
setup(e, {
|
|
2767
|
+
emit: t
|
|
2768
|
+
}) {
|
|
2769
|
+
const r = G("tooltip"), n = F(e.defaultPopupVisible), l = d(() => {
|
|
2770
|
+
var c;
|
|
2771
|
+
return (c = e.popupVisible) != null ? c : n.value;
|
|
2772
|
+
}), o = (c) => {
|
|
2773
|
+
n.value = c, t("update:popupVisible", c), t("popupVisibleChange", c);
|
|
2774
|
+
}, i = d(() => [`${r}-content`, e.contentClass, {
|
|
2775
|
+
[`${r}-mini`]: e.mini
|
|
2776
|
+
}]), a = d(() => {
|
|
2777
|
+
if (e.backgroundColor || e.contentStyle)
|
|
2778
|
+
return Dr({
|
|
2779
|
+
backgroundColor: e.backgroundColor
|
|
2780
|
+
}, e.contentStyle);
|
|
2781
|
+
}), s = d(() => [`${r}-popup-arrow`, e.arrowClass]), u = d(() => {
|
|
2782
|
+
if (e.backgroundColor || e.arrowStyle)
|
|
2783
|
+
return Dr({
|
|
2784
|
+
backgroundColor: e.backgroundColor
|
|
2785
|
+
}, e.arrowStyle);
|
|
2786
|
+
});
|
|
2787
|
+
return {
|
|
2788
|
+
prefixCls: r,
|
|
2789
|
+
computedPopupVisible: l,
|
|
2790
|
+
contentCls: i,
|
|
2791
|
+
computedContentStyle: a,
|
|
2792
|
+
arrowCls: s,
|
|
2793
|
+
computedArrowStyle: u,
|
|
2794
|
+
handlePopupVisibleChange: o
|
|
2795
|
+
};
|
|
2796
|
+
}
|
|
2797
|
+
});
|
|
2798
|
+
function mi(e, t, r, n, l, o) {
|
|
2799
|
+
const i = pe("Trigger");
|
|
2800
|
+
return L(), ue(i, {
|
|
2801
|
+
class: D(e.prefixCls),
|
|
2802
|
+
trigger: "hover",
|
|
2803
|
+
position: e.position,
|
|
2804
|
+
"popup-visible": e.computedPopupVisible,
|
|
2805
|
+
"popup-offset": 10,
|
|
2806
|
+
"show-arrow": "",
|
|
2807
|
+
"content-class": e.contentCls,
|
|
2808
|
+
"content-style": e.computedContentStyle,
|
|
2809
|
+
"arrow-class": e.arrowCls,
|
|
2810
|
+
"arrow-style": e.computedArrowStyle,
|
|
2811
|
+
"popup-container": e.popupContainer,
|
|
2812
|
+
"animation-name": "zoom-in-fade-out",
|
|
2813
|
+
"auto-fit-transform-origin": "",
|
|
2814
|
+
role: "tooltip",
|
|
2815
|
+
onPopupVisibleChange: e.handlePopupVisibleChange
|
|
2816
|
+
}, {
|
|
2817
|
+
content: ne(() => [R(e.$slots, "content", {}, () => [me(Me(e.content), 1)])]),
|
|
2818
|
+
default: ne(() => [R(e.$slots, "default")]),
|
|
2819
|
+
_: 3
|
|
2820
|
+
}, 8, ["class", "position", "popup-visible", "content-class", "content-style", "arrow-class", "arrow-style", "popup-container", "onPopupVisibleChange"]);
|
|
2821
|
+
}
|
|
2822
|
+
var St = /* @__PURE__ */ X(pi, [["render", mi]]);
|
|
2823
|
+
const bi = Object.assign(St, {
|
|
2824
|
+
install: (e, t) => {
|
|
2825
|
+
Be(e, t);
|
|
2826
|
+
const r = De(t);
|
|
2827
|
+
e.component(r + St.name, St);
|
|
2828
|
+
}
|
|
2829
|
+
}), yi = I({
|
|
2830
|
+
name: "IconQuestionCircle",
|
|
2831
|
+
props: {
|
|
2832
|
+
size: {
|
|
2833
|
+
type: [Number, String]
|
|
2834
|
+
},
|
|
2835
|
+
strokeWidth: {
|
|
2836
|
+
type: Number,
|
|
2837
|
+
default: 4
|
|
2838
|
+
},
|
|
2839
|
+
strokeLinecap: {
|
|
2840
|
+
type: String,
|
|
2841
|
+
default: "butt",
|
|
2842
|
+
validator: (e) => ["butt", "round", "square"].includes(e)
|
|
2843
|
+
},
|
|
2844
|
+
strokeLinejoin: {
|
|
2845
|
+
type: String,
|
|
2846
|
+
default: "miter",
|
|
2847
|
+
validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
|
|
2848
|
+
},
|
|
2849
|
+
rotate: Number,
|
|
2850
|
+
spin: Boolean
|
|
2851
|
+
},
|
|
2852
|
+
emits: {
|
|
2853
|
+
click: (e) => !0
|
|
2854
|
+
},
|
|
2855
|
+
setup(e, {
|
|
2856
|
+
emit: t
|
|
2857
|
+
}) {
|
|
2858
|
+
const r = G("icon"), n = d(() => [r, `${r}-question-circle`, {
|
|
2859
|
+
[`${r}-spin`]: e.spin
|
|
2860
|
+
}]), l = d(() => {
|
|
2861
|
+
const i = {};
|
|
2862
|
+
return e.size && (i.fontSize = ce(e.size) ? `${e.size}px` : e.size), e.rotate && (i.transform = `rotate(${e.rotate}deg)`), i;
|
|
2863
|
+
});
|
|
2864
|
+
return {
|
|
2865
|
+
cls: n,
|
|
2866
|
+
innerStyle: l,
|
|
2867
|
+
onClick: (i) => {
|
|
2868
|
+
t("click", i);
|
|
2869
|
+
}
|
|
2870
|
+
};
|
|
2871
|
+
}
|
|
2872
|
+
}), gi = ["stroke-width", "stroke-linecap", "stroke-linejoin"], wi = /* @__PURE__ */ ee("path", {
|
|
2873
|
+
d: "M42 24c0 9.941-8.059 18-18 18S6 33.941 6 24 14.059 6 24 6s18 8.059 18 18Z"
|
|
2874
|
+
}, null, -1), _i = /* @__PURE__ */ ee("path", {
|
|
2875
|
+
d: "M24.006 31v4.008m0-6.008L24 28c0-3 3-4 4.78-6.402C30.558 19.195 28.288 15 23.987 15c-4.014 0-5.382 2.548-5.388 4.514v.465"
|
|
2876
|
+
}, null, -1), Ei = [wi, _i];
|
|
2877
|
+
function Ci(e, t, r, n, l, o) {
|
|
2878
|
+
return L(), H("svg", {
|
|
2879
|
+
viewBox: "0 0 48 48",
|
|
2880
|
+
fill: "none",
|
|
2881
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2882
|
+
stroke: "currentColor",
|
|
2883
|
+
class: D(e.cls),
|
|
2884
|
+
style: Ce(e.innerStyle),
|
|
2885
|
+
"stroke-width": e.strokeWidth,
|
|
2886
|
+
"stroke-linecap": e.strokeLinecap,
|
|
2887
|
+
"stroke-linejoin": e.strokeLinejoin,
|
|
2888
|
+
onClick: t[0] || (t[0] = (...i) => e.onClick && e.onClick(...i))
|
|
2889
|
+
}, Ei, 14, gi);
|
|
2890
|
+
}
|
|
2891
|
+
var jt = /* @__PURE__ */ X(yi, [["render", Ci]]);
|
|
2892
|
+
const $i = Object.assign(jt, {
|
|
2893
|
+
install: (e, t) => {
|
|
2894
|
+
var r;
|
|
2895
|
+
const n = (r = t == null ? void 0 : t.iconPrefix) != null ? r : "";
|
|
2896
|
+
e.component(n + jt.name, jt);
|
|
2897
|
+
}
|
|
2898
|
+
}), Oi = I({
|
|
2899
|
+
name: "FormItemLabel",
|
|
2900
|
+
components: {
|
|
2901
|
+
ResizeObserver: qt,
|
|
2902
|
+
Tooltip: bi,
|
|
2903
|
+
IconQuestionCircle: $i
|
|
2904
|
+
},
|
|
2905
|
+
props: {
|
|
2906
|
+
required: {
|
|
2907
|
+
type: Boolean,
|
|
2908
|
+
default: !1
|
|
2909
|
+
},
|
|
2910
|
+
showColon: {
|
|
2911
|
+
type: Boolean,
|
|
2912
|
+
default: !1
|
|
2913
|
+
},
|
|
2914
|
+
component: {
|
|
2915
|
+
type: String,
|
|
2916
|
+
default: "label"
|
|
2917
|
+
},
|
|
2918
|
+
asteriskPosition: {
|
|
2919
|
+
type: String,
|
|
2920
|
+
default: "start"
|
|
2921
|
+
},
|
|
2922
|
+
tooltip: {
|
|
2923
|
+
type: String
|
|
2924
|
+
},
|
|
2925
|
+
attrs: Object
|
|
2926
|
+
},
|
|
2927
|
+
setup() {
|
|
2928
|
+
const e = G("form-item-label"), t = J(Rt, void 0), r = qr(), n = F(), l = () => {
|
|
2929
|
+
n.value && ce(n.value.offsetWidth) && (t == null || t.setLabelWidth(n.value.offsetWidth, r == null ? void 0 : r.uid));
|
|
2930
|
+
};
|
|
2931
|
+
return he(() => {
|
|
2932
|
+
n.value && ce(n.value.offsetWidth) && (t == null || t.setLabelWidth(n.value.offsetWidth, r == null ? void 0 : r.uid));
|
|
2933
|
+
}), Ge(() => {
|
|
2934
|
+
t == null || t.removeLabelWidth(r == null ? void 0 : r.uid);
|
|
2935
|
+
}), {
|
|
2936
|
+
prefixCls: e,
|
|
2937
|
+
labelRef: n,
|
|
2938
|
+
handleResize: l
|
|
2939
|
+
};
|
|
2940
|
+
}
|
|
2941
|
+
}), Si = /* @__PURE__ */ ee("svg", {
|
|
2942
|
+
fill: "currentColor",
|
|
2943
|
+
viewBox: "0 0 1024 1024",
|
|
2944
|
+
width: "1em",
|
|
2945
|
+
height: "1em"
|
|
2946
|
+
}, [/* @__PURE__ */ ee("path", {
|
|
2947
|
+
d: "M583.338667 17.066667c18.773333 0 34.133333 15.36 34.133333 34.133333v349.013333l313.344-101.888a34.133333 34.133333 0 0 1 43.008 22.016l42.154667 129.706667a34.133333 34.133333 0 0 1-21.845334 43.178667l-315.733333 102.4 208.896 287.744a34.133333 34.133333 0 0 1-7.509333 47.786666l-110.421334 80.213334a34.133333 34.133333 0 0 1-47.786666-7.509334L505.685333 706.218667 288.426667 1005.226667a34.133333 34.133333 0 0 1-47.786667 7.509333l-110.421333-80.213333a34.133333 34.133333 0 0 1-7.509334-47.786667l214.186667-295.253333L29.013333 489.813333a34.133333 34.133333 0 0 1-22.016-43.008l42.154667-129.877333a34.133333 34.133333 0 0 1 43.008-22.016l320.512 104.106667L412.672 51.2c0-18.773333 15.36-34.133333 34.133333-34.133333h136.533334z"
|
|
2948
|
+
})], -1), ji = [Si], ki = /* @__PURE__ */ ee("svg", {
|
|
2949
|
+
fill: "currentColor",
|
|
2950
|
+
viewBox: "0 0 1024 1024",
|
|
2951
|
+
width: "1em",
|
|
2952
|
+
height: "1em"
|
|
2953
|
+
}, [/* @__PURE__ */ ee("path", {
|
|
2954
|
+
d: "M583.338667 17.066667c18.773333 0 34.133333 15.36 34.133333 34.133333v349.013333l313.344-101.888a34.133333 34.133333 0 0 1 43.008 22.016l42.154667 129.706667a34.133333 34.133333 0 0 1-21.845334 43.178667l-315.733333 102.4 208.896 287.744a34.133333 34.133333 0 0 1-7.509333 47.786666l-110.421334 80.213334a34.133333 34.133333 0 0 1-47.786666-7.509334L505.685333 706.218667 288.426667 1005.226667a34.133333 34.133333 0 0 1-47.786667 7.509333l-110.421333-80.213333a34.133333 34.133333 0 0 1-7.509334-47.786667l214.186667-295.253333L29.013333 489.813333a34.133333 34.133333 0 0 1-22.016-43.008l42.154667-129.877333a34.133333 34.133333 0 0 1 43.008-22.016l320.512 104.106667L412.672 51.2c0-18.773333 15.36-34.133333 34.133333-34.133333h136.533334z"
|
|
2955
|
+
})], -1), Pi = [ki];
|
|
2956
|
+
function Fi(e, t, r, n, l, o) {
|
|
2957
|
+
const i = pe("icon-question-circle"), a = pe("Tooltip"), s = pe("ResizeObserver");
|
|
2958
|
+
return L(), ue(s, {
|
|
2959
|
+
onResize: e.handleResize
|
|
2960
|
+
}, {
|
|
2961
|
+
default: ne(() => [(L(), ue(Ln(e.component), Le({
|
|
2962
|
+
ref: "labelRef",
|
|
2963
|
+
class: e.prefixCls
|
|
2964
|
+
}, e.attrs), {
|
|
2965
|
+
default: ne(() => [e.required && e.asteriskPosition === "start" ? (L(), H("strong", {
|
|
2966
|
+
key: 0,
|
|
2967
|
+
class: D(`${e.prefixCls}-required-symbol`)
|
|
2968
|
+
}, ji, 2)) : se("v-if", !0), R(e.$slots, "default"), e.tooltip ? (L(), ue(a, {
|
|
2969
|
+
key: 1,
|
|
2970
|
+
content: e.tooltip
|
|
2971
|
+
}, {
|
|
2972
|
+
default: ne(() => [C(i, {
|
|
2973
|
+
class: D(`${e.prefixCls}-tooltip`)
|
|
2974
|
+
}, null, 8, ["class"])]),
|
|
2975
|
+
_: 1
|
|
2976
|
+
}, 8, ["content"])) : se("v-if", !0), e.required && e.asteriskPosition === "end" ? (L(), H("strong", {
|
|
2977
|
+
key: 2,
|
|
2978
|
+
class: D(`${e.prefixCls}-required-symbol`)
|
|
2979
|
+
}, Pi, 2)) : se("v-if", !0), me(" " + Me(e.showColon ? ":" : ""), 1)]),
|
|
2980
|
+
_: 3
|
|
2981
|
+
}, 16, ["class"]))]),
|
|
2982
|
+
_: 3
|
|
2983
|
+
}, 8, ["onResize"]);
|
|
2984
|
+
}
|
|
2985
|
+
var Li = /* @__PURE__ */ X(Oi, [["render", Fi]]);
|
|
2986
|
+
const Ti = I({
|
|
2987
|
+
name: "FormItemMessage",
|
|
2988
|
+
props: {
|
|
2989
|
+
error: {
|
|
2990
|
+
type: Array,
|
|
2991
|
+
default: () => []
|
|
2992
|
+
},
|
|
2993
|
+
help: String
|
|
2994
|
+
},
|
|
2995
|
+
setup() {
|
|
2996
|
+
return {
|
|
2997
|
+
prefixCls: G("form-item-message")
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
});
|
|
3001
|
+
function Mi(e, t, r, n, l, o) {
|
|
3002
|
+
return e.error.length > 0 ? (L(!0), H(Wt, {
|
|
3003
|
+
key: 0
|
|
3004
|
+
}, Tn(e.error, (i) => (L(), ue(Dt, {
|
|
3005
|
+
key: i,
|
|
3006
|
+
name: "form-blink",
|
|
3007
|
+
appear: ""
|
|
3008
|
+
}, {
|
|
3009
|
+
default: ne(() => [ee("div", {
|
|
3010
|
+
role: "alert",
|
|
3011
|
+
class: D([e.prefixCls])
|
|
3012
|
+
}, Me(i), 3)]),
|
|
3013
|
+
_: 2
|
|
3014
|
+
}, 1024))), 128)) : e.help || e.$slots.help ? (L(), ue(Dt, {
|
|
3015
|
+
key: 1,
|
|
3016
|
+
name: "form-blink",
|
|
3017
|
+
appear: ""
|
|
3018
|
+
}, {
|
|
3019
|
+
default: ne(() => [ee("div", {
|
|
3020
|
+
class: D([e.prefixCls, `${e.prefixCls}-help`])
|
|
3021
|
+
}, [R(e.$slots, "help", {}, () => [me(Me(e.help), 1)])], 2)]),
|
|
3022
|
+
_: 3
|
|
3023
|
+
})) : se("v-if", !0);
|
|
3024
|
+
}
|
|
3025
|
+
var Ai = /* @__PURE__ */ X(Ti, [["render", Mi]]);
|
|
3026
|
+
const Br = (e, t) => {
|
|
3027
|
+
if (!e || !t)
|
|
3028
|
+
return;
|
|
3029
|
+
t = t.replace(/\[(\w+)\]/g, ".$1");
|
|
3030
|
+
const r = t.split(".");
|
|
3031
|
+
if (r.length === 0)
|
|
3032
|
+
return;
|
|
3033
|
+
let n = e;
|
|
3034
|
+
for (let l = 0; l < r.length; l++) {
|
|
3035
|
+
if (!Ye(n) && !Ee(n) || !r[l])
|
|
3036
|
+
return;
|
|
3037
|
+
if (l !== r.length - 1)
|
|
3038
|
+
n = n[r[l]];
|
|
3039
|
+
else
|
|
3040
|
+
return n[r[l]];
|
|
3041
|
+
}
|
|
3042
|
+
}, Vr = (e, t, r, {
|
|
3043
|
+
addPath: n
|
|
3044
|
+
} = {}) => {
|
|
3045
|
+
if (!e || !t)
|
|
3046
|
+
return;
|
|
3047
|
+
t = t.replace(/\[(\w+)\]/g, ".$1");
|
|
3048
|
+
const l = t.split(".");
|
|
3049
|
+
if (l.length === 0)
|
|
3050
|
+
return;
|
|
3051
|
+
let o = e;
|
|
3052
|
+
for (let i = 0; i < l.length; i++) {
|
|
3053
|
+
if (!Ye(o) && !Ee(o) || !l[i])
|
|
3054
|
+
return;
|
|
3055
|
+
i !== l.length - 1 ? (n && Gr(o[l[i]]) && (o[l[i]] = {}), o = o[l[i]]) : o[l[i]] = r;
|
|
3056
|
+
}
|
|
3057
|
+
}, rt = {
|
|
3058
|
+
formatYear: "YYYY 年",
|
|
3059
|
+
formatMonth: "YYYY 年 MM 月",
|
|
3060
|
+
today: "今天",
|
|
3061
|
+
view: {
|
|
3062
|
+
month: "月",
|
|
3063
|
+
year: "年",
|
|
3064
|
+
week: "周",
|
|
3065
|
+
day: "日"
|
|
3066
|
+
},
|
|
3067
|
+
month: {
|
|
3068
|
+
long: {
|
|
3069
|
+
January: "一月",
|
|
3070
|
+
February: "二月",
|
|
3071
|
+
March: "三月",
|
|
3072
|
+
April: "四月",
|
|
3073
|
+
May: "五月",
|
|
3074
|
+
June: "六月",
|
|
3075
|
+
July: "七月",
|
|
3076
|
+
August: "八月",
|
|
3077
|
+
September: "九月",
|
|
3078
|
+
October: "十月",
|
|
3079
|
+
November: "十一月",
|
|
3080
|
+
December: "十二月"
|
|
3081
|
+
},
|
|
3082
|
+
short: {
|
|
3083
|
+
January: "一月",
|
|
3084
|
+
February: "二月",
|
|
3085
|
+
March: "三月",
|
|
3086
|
+
April: "四月",
|
|
3087
|
+
May: "五月",
|
|
3088
|
+
June: "六月",
|
|
3089
|
+
July: "七月",
|
|
3090
|
+
August: "八月",
|
|
3091
|
+
September: "九月",
|
|
3092
|
+
October: "十月",
|
|
3093
|
+
November: "十一月",
|
|
3094
|
+
December: "十二月"
|
|
3095
|
+
}
|
|
3096
|
+
},
|
|
3097
|
+
week: {
|
|
3098
|
+
long: {
|
|
3099
|
+
self: "周",
|
|
3100
|
+
monday: "周一",
|
|
3101
|
+
tuesday: "周二",
|
|
3102
|
+
wednesday: "周三",
|
|
3103
|
+
thursday: "周四",
|
|
3104
|
+
friday: "周五",
|
|
3105
|
+
saturday: "周六",
|
|
3106
|
+
sunday: "周日"
|
|
3107
|
+
},
|
|
3108
|
+
short: {
|
|
3109
|
+
self: "周",
|
|
3110
|
+
monday: "一",
|
|
3111
|
+
tuesday: "二",
|
|
3112
|
+
wednesday: "三",
|
|
3113
|
+
thursday: "四",
|
|
3114
|
+
friday: "五",
|
|
3115
|
+
saturday: "六",
|
|
3116
|
+
sunday: "日"
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
}, Di = {
|
|
3120
|
+
locale: "zh-CN",
|
|
3121
|
+
empty: {
|
|
3122
|
+
description: "暂无数据"
|
|
3123
|
+
},
|
|
3124
|
+
drawer: {
|
|
3125
|
+
okText: "确定",
|
|
3126
|
+
cancelText: "取消"
|
|
3127
|
+
},
|
|
3128
|
+
popconfirm: {
|
|
3129
|
+
okText: "确定",
|
|
3130
|
+
cancelText: "取消"
|
|
3131
|
+
},
|
|
3132
|
+
modal: {
|
|
3133
|
+
okText: "确定",
|
|
3134
|
+
cancelText: "取消"
|
|
3135
|
+
},
|
|
3136
|
+
pagination: {
|
|
3137
|
+
goto: "前往",
|
|
3138
|
+
page: "页",
|
|
3139
|
+
countPerPage: "条/页",
|
|
3140
|
+
total: "共 {0} 条"
|
|
3141
|
+
},
|
|
3142
|
+
table: {
|
|
3143
|
+
okText: "确定",
|
|
3144
|
+
resetText: "重置"
|
|
3145
|
+
},
|
|
3146
|
+
upload: {
|
|
3147
|
+
start: "开始",
|
|
3148
|
+
cancel: "取消",
|
|
3149
|
+
delete: "删除",
|
|
3150
|
+
retry: "点击重试",
|
|
3151
|
+
buttonText: "点击上传",
|
|
3152
|
+
preview: "预览",
|
|
3153
|
+
drag: "点击或拖拽文件到此处上传",
|
|
3154
|
+
dragHover: "释放文件并开始上传",
|
|
3155
|
+
error: "上传失败"
|
|
3156
|
+
},
|
|
3157
|
+
calendar: rt,
|
|
3158
|
+
datePicker: {
|
|
3159
|
+
view: rt.view,
|
|
3160
|
+
month: rt.month,
|
|
3161
|
+
week: rt.week,
|
|
3162
|
+
placeholder: {
|
|
3163
|
+
date: "请选择日期",
|
|
3164
|
+
week: "请选择周",
|
|
3165
|
+
month: "请选择月份",
|
|
3166
|
+
year: "请选择年份",
|
|
3167
|
+
quarter: "请选择季度",
|
|
3168
|
+
time: "请选择时间"
|
|
3169
|
+
},
|
|
3170
|
+
rangePlaceholder: {
|
|
3171
|
+
date: ["开始日期", "结束日期"],
|
|
3172
|
+
week: ["开始周", "结束周"],
|
|
3173
|
+
month: ["开始月份", "结束月份"],
|
|
3174
|
+
year: ["开始年份", "结束年份"],
|
|
3175
|
+
quarter: ["开始季度", "结束季度"],
|
|
3176
|
+
time: ["开始时间", "结束时间"]
|
|
3177
|
+
},
|
|
3178
|
+
selectTime: "选择时间",
|
|
3179
|
+
today: "今天",
|
|
3180
|
+
now: "此刻",
|
|
3181
|
+
ok: "确定"
|
|
3182
|
+
},
|
|
3183
|
+
image: {
|
|
3184
|
+
loading: "加载中"
|
|
3185
|
+
},
|
|
3186
|
+
imagePreview: {
|
|
3187
|
+
fullScreen: "全屏",
|
|
3188
|
+
rotateRight: "向右旋转",
|
|
3189
|
+
rotateLeft: "向左旋转",
|
|
3190
|
+
zoomIn: "放大",
|
|
3191
|
+
zoomOut: "缩小",
|
|
3192
|
+
originalSize: "原始尺寸"
|
|
3193
|
+
},
|
|
3194
|
+
typography: {
|
|
3195
|
+
copied: "已复制",
|
|
3196
|
+
copy: "复制",
|
|
3197
|
+
expand: "展开",
|
|
3198
|
+
collapse: "折叠",
|
|
3199
|
+
edit: "编辑"
|
|
3200
|
+
},
|
|
3201
|
+
form: {
|
|
3202
|
+
validateMessages: {
|
|
3203
|
+
required: "#{field} 是必填项",
|
|
3204
|
+
type: {
|
|
3205
|
+
string: "#{field} 不是合法的文本类型",
|
|
3206
|
+
number: "#{field} 不是合法的数字类型",
|
|
3207
|
+
boolean: "#{field} 不是合法的布尔类型",
|
|
3208
|
+
array: "#{field} 不是合法的数组类型",
|
|
3209
|
+
object: "#{field} 不是合法的对象类型",
|
|
3210
|
+
url: "#{field} 不是合法的 url 地址",
|
|
3211
|
+
email: "#{field} 不是合法的邮箱地址",
|
|
3212
|
+
ip: "#{field} 不是合法的 IP 地址"
|
|
3213
|
+
},
|
|
3214
|
+
number: {
|
|
3215
|
+
min: "`#{value}` 小于最小值 `#{min}`",
|
|
3216
|
+
max: "`#{value}` 大于最大值 `#{max}`",
|
|
3217
|
+
equal: "`#{value}` 不等于 `#{equal}`",
|
|
3218
|
+
range: "`#{value}` 不在 `#{min} ~ #{max}` 范围内",
|
|
3219
|
+
positive: "`#{value}` 不是正数",
|
|
3220
|
+
negative: "`#{value}` 不是负数"
|
|
3221
|
+
},
|
|
3222
|
+
array: {
|
|
3223
|
+
length: "`#{field}` 个数不等于 #{length}",
|
|
3224
|
+
minLength: "`#{field}` 个数最少为 #{minLength}",
|
|
3225
|
+
maxLength: "`#{field}` 个数最多为 #{maxLength}",
|
|
3226
|
+
includes: "#{field} 不包含 #{includes}",
|
|
3227
|
+
deepEqual: "#{field} 不等于 #{deepEqual}",
|
|
3228
|
+
empty: "`#{field}` 不是空数组"
|
|
3229
|
+
},
|
|
3230
|
+
string: {
|
|
3231
|
+
minLength: "字符数最少为 #{minLength}",
|
|
3232
|
+
maxLength: "字符数最多为 #{maxLength}",
|
|
3233
|
+
length: "字符数必须是 #{length}",
|
|
3234
|
+
match: "`#{value}` 不符合模式 #{pattern}",
|
|
3235
|
+
uppercase: "`#{value}` 必须全大写",
|
|
3236
|
+
lowercase: "`#{value}` 必须全小写"
|
|
3237
|
+
},
|
|
3238
|
+
object: {
|
|
3239
|
+
deepEqual: "`#{field}` 不等于期望值",
|
|
3240
|
+
hasKeys: "`#{field}` 不包含必须字段",
|
|
3241
|
+
empty: "`#{field}` 不是对象"
|
|
3242
|
+
},
|
|
3243
|
+
boolean: {
|
|
3244
|
+
true: "期望是 `true`",
|
|
3245
|
+
false: "期望是 `false`"
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
}, Bi = F("zh-CN"), Vi = le({
|
|
3250
|
+
"zh-CN": Di
|
|
3251
|
+
}), xi = () => {
|
|
3252
|
+
const e = J(ht, void 0), t = d(() => {
|
|
3253
|
+
var l;
|
|
3254
|
+
return (l = e == null ? void 0 : e.locale) != null ? l : Vi[Bi.value];
|
|
3255
|
+
}), r = d(() => t.value.locale);
|
|
3256
|
+
return {
|
|
3257
|
+
i18nMessage: t,
|
|
3258
|
+
locale: r,
|
|
3259
|
+
t: (l, ...o) => {
|
|
3260
|
+
const i = l.split(".");
|
|
3261
|
+
let a = t.value;
|
|
3262
|
+
for (const s of i) {
|
|
3263
|
+
if (!a[s])
|
|
3264
|
+
return l;
|
|
3265
|
+
a = a[s];
|
|
3266
|
+
}
|
|
3267
|
+
return He(a) && o.length > 0 ? a.replace(/{(\d+)}/g, (s, u) => {
|
|
3268
|
+
var c;
|
|
3269
|
+
return (c = o[u]) != null ? c : s;
|
|
3270
|
+
}) : a;
|
|
3271
|
+
}
|
|
3272
|
+
};
|
|
3273
|
+
};
|
|
3274
|
+
var Ni = Object.defineProperty, dt = Object.getOwnPropertySymbols, vn = Object.prototype.hasOwnProperty, pn = Object.prototype.propertyIsEnumerable, xr = (e, t, r) => t in e ? Ni(e, t, {
|
|
3275
|
+
enumerable: !0,
|
|
3276
|
+
configurable: !0,
|
|
3277
|
+
writable: !0,
|
|
3278
|
+
value: r
|
|
3279
|
+
}) : e[t] = r, Nr = (e, t) => {
|
|
3280
|
+
for (var r in t || (t = {}))
|
|
3281
|
+
vn.call(t, r) && xr(e, r, t[r]);
|
|
3282
|
+
if (dt)
|
|
3283
|
+
for (var r of dt(t))
|
|
3284
|
+
pn.call(t, r) && xr(e, r, t[r]);
|
|
3285
|
+
return e;
|
|
3286
|
+
}, Ii = (e, t) => {
|
|
3287
|
+
var r = {};
|
|
3288
|
+
for (var n in e)
|
|
3289
|
+
vn.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
3290
|
+
if (e != null && dt)
|
|
3291
|
+
for (var n of dt(e))
|
|
3292
|
+
t.indexOf(n) < 0 && pn.call(e, n) && (r[n] = e[n]);
|
|
3293
|
+
return r;
|
|
3294
|
+
};
|
|
3295
|
+
const zi = I({
|
|
3296
|
+
name: "FormItem",
|
|
3297
|
+
components: {
|
|
3298
|
+
ArcoRow: nt,
|
|
3299
|
+
ArcoCol: lt,
|
|
3300
|
+
FormItemLabel: Li,
|
|
3301
|
+
FormItemMessage: Ai
|
|
3302
|
+
},
|
|
3303
|
+
props: {
|
|
3304
|
+
field: {
|
|
3305
|
+
type: String,
|
|
3306
|
+
default: ""
|
|
3307
|
+
},
|
|
3308
|
+
label: String,
|
|
3309
|
+
tooltip: {
|
|
3310
|
+
type: String
|
|
3311
|
+
},
|
|
3312
|
+
showColon: {
|
|
3313
|
+
type: Boolean,
|
|
3314
|
+
default: !1
|
|
3315
|
+
},
|
|
3316
|
+
noStyle: {
|
|
3317
|
+
type: Boolean,
|
|
3318
|
+
default: !1
|
|
3319
|
+
},
|
|
3320
|
+
disabled: {
|
|
3321
|
+
type: Boolean,
|
|
3322
|
+
default: void 0
|
|
3323
|
+
},
|
|
3324
|
+
help: String,
|
|
3325
|
+
extra: String,
|
|
3326
|
+
required: {
|
|
3327
|
+
type: Boolean,
|
|
3328
|
+
default: !1
|
|
3329
|
+
},
|
|
3330
|
+
asteriskPosition: {
|
|
3331
|
+
type: String,
|
|
3332
|
+
default: "start"
|
|
3333
|
+
},
|
|
3334
|
+
rules: {
|
|
3335
|
+
type: [Object, Array]
|
|
3336
|
+
},
|
|
3337
|
+
validateStatus: {
|
|
3338
|
+
type: String
|
|
3339
|
+
},
|
|
3340
|
+
validateTrigger: {
|
|
3341
|
+
type: [String, Array],
|
|
3342
|
+
default: "change"
|
|
3343
|
+
},
|
|
3344
|
+
labelColProps: Object,
|
|
3345
|
+
wrapperColProps: Object,
|
|
3346
|
+
hideLabel: {
|
|
3347
|
+
type: Boolean,
|
|
3348
|
+
default: !1
|
|
3349
|
+
},
|
|
3350
|
+
hideAsterisk: {
|
|
3351
|
+
type: Boolean,
|
|
3352
|
+
default: !1
|
|
3353
|
+
},
|
|
3354
|
+
labelColStyle: Object,
|
|
3355
|
+
wrapperColStyle: Object,
|
|
3356
|
+
rowProps: Object,
|
|
3357
|
+
rowClass: [String, Array, Object],
|
|
3358
|
+
contentClass: [String, Array, Object],
|
|
3359
|
+
contentFlex: {
|
|
3360
|
+
type: Boolean,
|
|
3361
|
+
default: !0
|
|
3362
|
+
},
|
|
3363
|
+
mergeProps: {
|
|
3364
|
+
type: [Boolean, Function],
|
|
3365
|
+
default: !0
|
|
3366
|
+
},
|
|
3367
|
+
labelColFlex: {
|
|
3368
|
+
type: [Number, String]
|
|
3369
|
+
},
|
|
3370
|
+
feedback: {
|
|
3371
|
+
type: Boolean,
|
|
3372
|
+
default: !1
|
|
3373
|
+
},
|
|
3374
|
+
labelComponent: {
|
|
3375
|
+
type: String,
|
|
3376
|
+
default: "label"
|
|
3377
|
+
},
|
|
3378
|
+
labelAttrs: Object
|
|
3379
|
+
},
|
|
3380
|
+
setup(e) {
|
|
3381
|
+
const t = G("form-item"), {
|
|
3382
|
+
field: r
|
|
3383
|
+
} = ye(e), n = J(Rt, {}), {
|
|
3384
|
+
autoLabelWidth: l,
|
|
3385
|
+
layout: o
|
|
3386
|
+
} = ye(n), {
|
|
3387
|
+
i18nMessage: i
|
|
3388
|
+
} = xi(), a = d(() => {
|
|
3389
|
+
var f;
|
|
3390
|
+
const y = Nr({}, (f = e.labelColProps) != null ? f : n.labelColProps);
|
|
3391
|
+
return e.labelColFlex ? y.flex = e.labelColFlex : n.autoLabelWidth && (y.flex = `${n.maxLabelWidth}px`), y;
|
|
3392
|
+
}), s = d(() => {
|
|
3393
|
+
var f;
|
|
3394
|
+
const y = Nr({}, (f = e.wrapperColProps) != null ? f : n.wrapperColProps);
|
|
3395
|
+
return r.value && (y.id = Yr(n.id, r.value)), (e.labelColFlex || n.autoLabelWidth) && (y.flex = "auto"), y;
|
|
3396
|
+
}), u = d(() => {
|
|
3397
|
+
var f;
|
|
3398
|
+
return (f = e.labelColStyle) != null ? f : n.labelColStyle;
|
|
3399
|
+
}), c = d(() => {
|
|
3400
|
+
var f;
|
|
3401
|
+
return (f = e.wrapperColStyle) != null ? f : n.wrapperColStyle;
|
|
3402
|
+
}), h = Br(n.model, e.field), p = le({}), b = le({}), O = d(() => al(p)), _ = d(() => sl(b)), w = F(!1), m = d(() => Br(n.model, e.field)), S = d(() => {
|
|
3403
|
+
var f;
|
|
3404
|
+
return !!((f = e.disabled) != null ? f : n != null && n.disabled);
|
|
3405
|
+
}), B = d(() => {
|
|
3406
|
+
var f;
|
|
3407
|
+
return (f = e.validateStatus) != null ? f : O.value;
|
|
3408
|
+
}), M = d(() => B.value === "error"), N = d(() => {
|
|
3409
|
+
var f, y, $;
|
|
3410
|
+
const A = [].concat(($ = (y = e.rules) != null ? y : (f = n == null ? void 0 : n.rules) == null ? void 0 : f[e.field]) != null ? $ : []), Z = A.some((re) => re.required);
|
|
3411
|
+
return e.required && !Z ? [{
|
|
3412
|
+
required: !0
|
|
3413
|
+
}].concat(A) : A;
|
|
3414
|
+
}), Y = d(() => N.value.some((f) => f.required)), j = e.noStyle ? J(xt, void 0) : void 0, T = (f, {
|
|
3415
|
+
status: y,
|
|
3416
|
+
message: $
|
|
3417
|
+
}) => {
|
|
3418
|
+
p[f] = y, b[f] = $, e.noStyle && (j == null || j.updateValidateState(f, {
|
|
3419
|
+
status: y,
|
|
3420
|
+
message: $
|
|
3421
|
+
}));
|
|
3422
|
+
}, z = d(() => e.feedback && B.value ? B.value : void 0), x = () => {
|
|
3423
|
+
var f;
|
|
3424
|
+
if (w.value)
|
|
3425
|
+
return Promise.resolve();
|
|
3426
|
+
const y = N.value;
|
|
3427
|
+
if (!r.value || y.length === 0)
|
|
3428
|
+
return O.value && P(), Promise.resolve();
|
|
3429
|
+
const $ = r.value, A = m.value;
|
|
3430
|
+
T($, {
|
|
3431
|
+
status: "",
|
|
3432
|
+
message: ""
|
|
3433
|
+
});
|
|
3434
|
+
const Z = new Ut({
|
|
3435
|
+
[$]: y.map((re) => {
|
|
3436
|
+
var V = Ii(re, []);
|
|
3437
|
+
return !V.type && !V.validator && (V.type = "string"), V;
|
|
3438
|
+
})
|
|
3439
|
+
}, {
|
|
3440
|
+
ignoreEmptyString: !0,
|
|
3441
|
+
validateMessages: (f = i.value.form) == null ? void 0 : f.validateMessages
|
|
3442
|
+
});
|
|
3443
|
+
return new Promise((re) => {
|
|
3444
|
+
Z.validate({
|
|
3445
|
+
[$]: A
|
|
3446
|
+
}, (V) => {
|
|
3447
|
+
var ie;
|
|
3448
|
+
const ae = !!(V != null && V[$]);
|
|
3449
|
+
T($, {
|
|
3450
|
+
status: ae ? "error" : "",
|
|
3451
|
+
message: (ie = V == null ? void 0 : V[$].message) != null ? ie : ""
|
|
3452
|
+
});
|
|
3453
|
+
const ve = ae ? {
|
|
3454
|
+
label: e.label,
|
|
3455
|
+
field: r.value,
|
|
3456
|
+
value: V[$].value,
|
|
3457
|
+
type: V[$].type,
|
|
3458
|
+
isRequiredError: !!V[$].requiredError,
|
|
3459
|
+
message: V[$].message
|
|
3460
|
+
} : void 0;
|
|
3461
|
+
re(ve);
|
|
3462
|
+
});
|
|
3463
|
+
});
|
|
3464
|
+
}, Q = d(() => [].concat(e.validateTrigger)), U = d(() => Q.value.reduce((f, y) => {
|
|
3465
|
+
switch (y) {
|
|
3466
|
+
case "change":
|
|
3467
|
+
return f.onChange = () => {
|
|
3468
|
+
x();
|
|
3469
|
+
}, f;
|
|
3470
|
+
case "input":
|
|
3471
|
+
return f.onInput = () => {
|
|
3472
|
+
qe(() => {
|
|
3473
|
+
x();
|
|
3474
|
+
});
|
|
3475
|
+
}, f;
|
|
3476
|
+
case "focus":
|
|
3477
|
+
return f.onFocus = () => {
|
|
3478
|
+
x();
|
|
3479
|
+
}, f;
|
|
3480
|
+
case "blur":
|
|
3481
|
+
return f.onBlur = () => {
|
|
3482
|
+
x();
|
|
3483
|
+
}, f;
|
|
3484
|
+
default:
|
|
3485
|
+
return f;
|
|
3486
|
+
}
|
|
3487
|
+
}, {}));
|
|
3488
|
+
ge(xt, le({
|
|
3489
|
+
eventHandlers: U,
|
|
3490
|
+
size: n && Bt(n, "size"),
|
|
3491
|
+
disabled: S,
|
|
3492
|
+
error: M,
|
|
3493
|
+
feedback: z,
|
|
3494
|
+
updateValidateState: T
|
|
3495
|
+
}));
|
|
3496
|
+
const P = () => {
|
|
3497
|
+
r.value && T(r.value, {
|
|
3498
|
+
status: "",
|
|
3499
|
+
message: ""
|
|
3500
|
+
});
|
|
3501
|
+
}, q = le({
|
|
3502
|
+
field: r,
|
|
3503
|
+
disabled: S,
|
|
3504
|
+
error: M,
|
|
3505
|
+
validate: x,
|
|
3506
|
+
clearValidate: P,
|
|
3507
|
+
resetField: () => {
|
|
3508
|
+
P(), w.value = !0, n != null && n.model && r.value && Vr(n.model, r.value, h), qe(() => {
|
|
3509
|
+
w.value = !1;
|
|
3510
|
+
});
|
|
3511
|
+
},
|
|
3512
|
+
setField: (f) => {
|
|
3513
|
+
var y, $;
|
|
3514
|
+
r.value && (w.value = !0, "value" in f && (n != null && n.model) && r.value && Vr(n.model, r.value, f.value), (f.status || f.message) && T(r.value, {
|
|
3515
|
+
status: (y = f.status) != null ? y : "",
|
|
3516
|
+
message: ($ = f.message) != null ? $ : ""
|
|
3517
|
+
}), qe(() => {
|
|
3518
|
+
w.value = !1;
|
|
3519
|
+
}));
|
|
3520
|
+
}
|
|
3521
|
+
});
|
|
3522
|
+
he(() => {
|
|
3523
|
+
var f;
|
|
3524
|
+
q.field && ((f = n.addField) == null || f.call(n, q));
|
|
3525
|
+
}), Ge(() => {
|
|
3526
|
+
var f;
|
|
3527
|
+
q.field && ((f = n.removeField) == null || f.call(n, q));
|
|
3528
|
+
});
|
|
3529
|
+
const W = d(() => [t, `${t}-layout-${n.layout}`, {
|
|
3530
|
+
[`${t}-error`]: M.value,
|
|
3531
|
+
[`${t}-status-${B.value}`]: !!B.value
|
|
3532
|
+
}, e.rowClass]), E = d(() => [`${t}-label-col`, {
|
|
3533
|
+
[`${t}-label-col-left`]: n.labelAlign === "left",
|
|
3534
|
+
[`${t}-label-col-flex`]: n.autoLabelWidth || e.labelColFlex
|
|
3535
|
+
}]), k = d(() => [`${t}-wrapper-col`, {
|
|
3536
|
+
[`${t}-wrapper-col-flex`]: !s.value
|
|
3537
|
+
}]);
|
|
3538
|
+
return {
|
|
3539
|
+
prefixCls: t,
|
|
3540
|
+
cls: W,
|
|
3541
|
+
isRequired: Y,
|
|
3542
|
+
isError: M,
|
|
3543
|
+
finalMessage: _,
|
|
3544
|
+
mergedLabelCol: a,
|
|
3545
|
+
mergedWrapperCol: s,
|
|
3546
|
+
labelColCls: E,
|
|
3547
|
+
autoLabelWidth: l,
|
|
3548
|
+
layout: o,
|
|
3549
|
+
mergedLabelStyle: u,
|
|
3550
|
+
wrapperColCls: k,
|
|
3551
|
+
mergedWrapperStyle: c
|
|
3552
|
+
};
|
|
3553
|
+
}
|
|
3554
|
+
});
|
|
3555
|
+
function qi(e, t, r, n, l, o) {
|
|
3556
|
+
var i;
|
|
3557
|
+
const a = pe("FormItemLabel"), s = pe("ArcoCol"), u = pe("FormItemMessage"), c = pe("ArcoRow");
|
|
3558
|
+
return e.noStyle ? R(e.$slots, "default", {
|
|
3559
|
+
key: 0
|
|
3560
|
+
}) : (L(), ue(c, Le({
|
|
3561
|
+
key: 1,
|
|
3562
|
+
class: [e.cls, {
|
|
3563
|
+
[`${e.prefixCls}-has-help`]: !!((i = e.$slots.help) != null ? i : e.help)
|
|
3564
|
+
}],
|
|
3565
|
+
wrap: !(e.labelColFlex || e.autoLabelWidth),
|
|
3566
|
+
div: e.layout !== "horizontal" || e.hideLabel
|
|
3567
|
+
}, e.rowProps), {
|
|
3568
|
+
default: ne(() => [e.hideLabel ? se("v-if", !0) : (L(), ue(s, Le({
|
|
3569
|
+
key: 0,
|
|
3570
|
+
class: e.labelColCls,
|
|
3571
|
+
style: e.mergedLabelStyle
|
|
3572
|
+
}, e.mergedLabelCol), {
|
|
3573
|
+
default: ne(() => [C(a, {
|
|
3574
|
+
required: e.hideAsterisk ? !1 : e.isRequired,
|
|
3575
|
+
"show-colon": e.showColon,
|
|
3576
|
+
"asterisk-position": e.asteriskPosition,
|
|
3577
|
+
component: e.labelComponent,
|
|
3578
|
+
attrs: e.labelAttrs,
|
|
3579
|
+
tooltip: e.tooltip
|
|
3580
|
+
}, {
|
|
3581
|
+
default: ne(() => [e.$slots.label || e.label ? R(e.$slots, "label", {
|
|
3582
|
+
key: 0
|
|
3583
|
+
}, () => [me(Me(e.label), 1)]) : se("v-if", !0)]),
|
|
3584
|
+
_: 3
|
|
3585
|
+
}, 8, ["required", "show-colon", "asterisk-position", "component", "attrs", "tooltip"])]),
|
|
3586
|
+
_: 3
|
|
3587
|
+
}, 16, ["class", "style"])), C(s, Le({
|
|
3588
|
+
class: e.wrapperColCls,
|
|
3589
|
+
style: e.mergedWrapperStyle
|
|
3590
|
+
}, e.mergedWrapperCol), {
|
|
3591
|
+
default: ne(() => [ee("div", {
|
|
3592
|
+
class: D(`${e.prefixCls}-content-wrapper`)
|
|
3593
|
+
}, [ee("div", {
|
|
3594
|
+
class: D([`${e.prefixCls}-content`, {
|
|
3595
|
+
[`${e.prefixCls}-content-flex`]: e.contentFlex
|
|
3596
|
+
}, e.contentClass])
|
|
3597
|
+
}, [R(e.$slots, "default")], 2)], 2), e.isError || e.$slots.help || e.help ? (L(), ue(u, {
|
|
3598
|
+
key: 0,
|
|
3599
|
+
error: e.finalMessage,
|
|
3600
|
+
help: e.help
|
|
3601
|
+
}, Mn({
|
|
3602
|
+
_: 2
|
|
3603
|
+
}, [e.$slots.help ? {
|
|
3604
|
+
name: "help",
|
|
3605
|
+
fn: ne(() => [R(e.$slots, "help")])
|
|
3606
|
+
} : void 0]), 1032, ["error", "help"])) : se("v-if", !0), e.$slots.extra || e.extra ? (L(), H("div", {
|
|
3607
|
+
key: 1,
|
|
3608
|
+
class: D(`${e.prefixCls}-extra`)
|
|
3609
|
+
}, [R(e.$slots, "extra", {}, () => [me(Me(e.extra), 1)])], 2)) : se("v-if", !0)]),
|
|
3610
|
+
_: 3
|
|
3611
|
+
}, 16, ["class", "style"])]),
|
|
3612
|
+
_: 3
|
|
3613
|
+
}, 16, ["class", "wrap", "div"]));
|
|
3614
|
+
}
|
|
3615
|
+
var Re = /* @__PURE__ */ X(zi, [["render", qi]]);
|
|
3616
|
+
const Wi = Object.assign(wt, {
|
|
3617
|
+
Item: Re,
|
|
3618
|
+
install: (e, t) => {
|
|
3619
|
+
Be(e, t);
|
|
3620
|
+
const r = De(t);
|
|
3621
|
+
e.component(r + wt.name, wt), e.component(r + Re.name, Re);
|
|
3622
|
+
}
|
|
3623
|
+
}), Ri = I({
|
|
3624
|
+
name: "IconLoading",
|
|
3625
|
+
props: {
|
|
3626
|
+
size: {
|
|
3627
|
+
type: [Number, String]
|
|
3628
|
+
},
|
|
3629
|
+
strokeWidth: {
|
|
3630
|
+
type: Number,
|
|
3631
|
+
default: 4
|
|
3632
|
+
},
|
|
3633
|
+
strokeLinecap: {
|
|
3634
|
+
type: String,
|
|
3635
|
+
default: "butt",
|
|
3636
|
+
validator: (e) => ["butt", "round", "square"].includes(e)
|
|
3637
|
+
},
|
|
3638
|
+
strokeLinejoin: {
|
|
3639
|
+
type: String,
|
|
3640
|
+
default: "miter",
|
|
3641
|
+
validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
|
|
3642
|
+
},
|
|
3643
|
+
rotate: Number,
|
|
3644
|
+
spin: Boolean
|
|
3645
|
+
},
|
|
3646
|
+
emits: {
|
|
3647
|
+
click: (e) => !0
|
|
3648
|
+
},
|
|
3649
|
+
setup(e, {
|
|
3650
|
+
emit: t
|
|
3651
|
+
}) {
|
|
3652
|
+
const r = G("icon"), n = d(() => [r, `${r}-loading`, {
|
|
3653
|
+
[`${r}-spin`]: e.spin
|
|
3654
|
+
}]), l = d(() => {
|
|
3655
|
+
const i = {};
|
|
3656
|
+
return e.size && (i.fontSize = ce(e.size) ? `${e.size}px` : e.size), e.rotate && (i.transform = `rotate(${e.rotate}deg)`), i;
|
|
3657
|
+
});
|
|
3658
|
+
return {
|
|
3659
|
+
cls: n,
|
|
3660
|
+
innerStyle: l,
|
|
3661
|
+
onClick: (i) => {
|
|
3662
|
+
t("click", i);
|
|
3663
|
+
}
|
|
3664
|
+
};
|
|
3665
|
+
}
|
|
3666
|
+
}), Hi = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Gi = /* @__PURE__ */ ee("path", {
|
|
3667
|
+
d: "M42 24c0 9.941-8.059 18-18 18S6 33.941 6 24 14.059 6 24 6"
|
|
3668
|
+
}, null, -1), Ui = [Gi];
|
|
3669
|
+
function Yi(e, t, r, n, l, o) {
|
|
3670
|
+
return L(), H("svg", {
|
|
3671
|
+
viewBox: "0 0 48 48",
|
|
3672
|
+
fill: "none",
|
|
3673
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3674
|
+
stroke: "currentColor",
|
|
3675
|
+
class: D(e.cls),
|
|
3676
|
+
style: Ce(e.innerStyle),
|
|
3677
|
+
"stroke-width": e.strokeWidth,
|
|
3678
|
+
"stroke-linecap": e.strokeLinecap,
|
|
3679
|
+
"stroke-linejoin": e.strokeLinejoin,
|
|
3680
|
+
onClick: t[0] || (t[0] = (...i) => e.onClick && e.onClick(...i))
|
|
3681
|
+
}, Ui, 14, Hi);
|
|
3682
|
+
}
|
|
3683
|
+
var kt = /* @__PURE__ */ X(Ri, [["render", Yi]]);
|
|
3684
|
+
const Ki = Object.assign(kt, {
|
|
3685
|
+
install: (e, t) => {
|
|
3686
|
+
var r;
|
|
3687
|
+
const n = (r = t == null ? void 0 : t.iconPrefix) != null ? r : "";
|
|
3688
|
+
e.component(n + kt.name, kt);
|
|
3689
|
+
}
|
|
3690
|
+
}), Xi = ({
|
|
3691
|
+
size: e,
|
|
3692
|
+
disabled: t,
|
|
3693
|
+
error: r,
|
|
3694
|
+
uninject: n
|
|
3695
|
+
} = {}) => {
|
|
3696
|
+
const l = n ? {} : J(xt, {}), o = d(() => {
|
|
3697
|
+
var c;
|
|
3698
|
+
return (c = e == null ? void 0 : e.value) != null ? c : l.size;
|
|
3699
|
+
}), i = d(() => (t == null ? void 0 : t.value) || l.disabled), a = d(() => (r == null ? void 0 : r.value) || l.error), s = Bt(l, "feedback"), u = Bt(l, "eventHandlers");
|
|
3700
|
+
return {
|
|
3701
|
+
formItemCtx: l,
|
|
3702
|
+
mergedSize: o,
|
|
3703
|
+
mergedDisabled: i,
|
|
3704
|
+
mergedError: a,
|
|
3705
|
+
feedback: s,
|
|
3706
|
+
eventHandlers: u
|
|
3707
|
+
};
|
|
3708
|
+
}, mn = Symbol("ArcoButtonGroup"), Zi = I({
|
|
3709
|
+
name: "Button",
|
|
3710
|
+
components: {
|
|
3711
|
+
IconLoading: Ki
|
|
3712
|
+
},
|
|
3713
|
+
props: {
|
|
3714
|
+
type: {
|
|
3715
|
+
type: String
|
|
3716
|
+
},
|
|
3717
|
+
shape: {
|
|
3718
|
+
type: String
|
|
3719
|
+
},
|
|
3720
|
+
status: {
|
|
3721
|
+
type: String
|
|
3722
|
+
},
|
|
3723
|
+
size: {
|
|
3724
|
+
type: String
|
|
3725
|
+
},
|
|
3726
|
+
long: {
|
|
3727
|
+
type: Boolean,
|
|
3728
|
+
default: !1
|
|
3729
|
+
},
|
|
3730
|
+
loading: {
|
|
3731
|
+
type: Boolean,
|
|
3732
|
+
default: !1
|
|
3733
|
+
},
|
|
3734
|
+
disabled: {
|
|
3735
|
+
type: Boolean
|
|
3736
|
+
},
|
|
3737
|
+
htmlType: {
|
|
3738
|
+
type: String,
|
|
3739
|
+
default: "button"
|
|
3740
|
+
},
|
|
3741
|
+
href: String
|
|
3742
|
+
},
|
|
3743
|
+
emits: {
|
|
3744
|
+
click: (e) => !0
|
|
3745
|
+
},
|
|
3746
|
+
setup(e, {
|
|
3747
|
+
emit: t
|
|
3748
|
+
}) {
|
|
3749
|
+
const {
|
|
3750
|
+
size: r,
|
|
3751
|
+
disabled: n
|
|
3752
|
+
} = ye(e), l = G("btn"), o = J(mn, void 0), i = d(() => {
|
|
3753
|
+
var b;
|
|
3754
|
+
return (b = r.value) != null ? b : o == null ? void 0 : o.size;
|
|
3755
|
+
}), a = d(() => !!(n.value || o != null && o.disabled)), {
|
|
3756
|
+
mergedSize: s,
|
|
3757
|
+
mergedDisabled: u
|
|
3758
|
+
} = Xi({
|
|
3759
|
+
size: i,
|
|
3760
|
+
disabled: a
|
|
3761
|
+
}), {
|
|
3762
|
+
mergedSize: c
|
|
3763
|
+
} = Ur(s), h = d(() => {
|
|
3764
|
+
var b, O, _, w, m, S;
|
|
3765
|
+
return [l, `${l}-${(O = (b = e.type) != null ? b : o == null ? void 0 : o.type) != null ? O : "secondary"}`, `${l}-shape-${(w = (_ = e.shape) != null ? _ : o == null ? void 0 : o.shape) != null ? w : "square"}`, `${l}-size-${c.value}`, `${l}-status-${(S = (m = e.status) != null ? m : o == null ? void 0 : o.status) != null ? S : "normal"}`, {
|
|
3766
|
+
[`${l}-long`]: e.long,
|
|
3767
|
+
[`${l}-loading`]: e.loading,
|
|
3768
|
+
[`${l}-disabled`]: u.value,
|
|
3769
|
+
[`${l}-link`]: He(e.href)
|
|
3770
|
+
}];
|
|
3771
|
+
});
|
|
3772
|
+
return {
|
|
3773
|
+
prefixCls: l,
|
|
3774
|
+
cls: h,
|
|
3775
|
+
mergedDisabled: u,
|
|
3776
|
+
handleClick: (b) => {
|
|
3777
|
+
if (e.disabled || e.loading) {
|
|
3778
|
+
b.preventDefault();
|
|
3779
|
+
return;
|
|
3780
|
+
}
|
|
3781
|
+
t("click", b);
|
|
3782
|
+
}
|
|
3783
|
+
};
|
|
3784
|
+
}
|
|
3785
|
+
}), Qi = ["href"], Ji = ["type", "disabled"];
|
|
3786
|
+
function ea(e, t, r, n, l, o) {
|
|
3787
|
+
const i = pe("icon-loading");
|
|
3788
|
+
return e.href ? (L(), H("a", {
|
|
3789
|
+
key: 0,
|
|
3790
|
+
class: D([e.cls, {
|
|
3791
|
+
[`${e.prefixCls}-only-icon`]: e.$slots.icon && !e.$slots.default
|
|
3792
|
+
}]),
|
|
3793
|
+
href: e.mergedDisabled || e.loading ? void 0 : e.href,
|
|
3794
|
+
onClick: t[0] || (t[0] = (...a) => e.handleClick && e.handleClick(...a))
|
|
3795
|
+
}, [e.loading || e.$slots.icon ? (L(), H("span", {
|
|
3796
|
+
key: 0,
|
|
3797
|
+
class: D(`${e.prefixCls}-icon`)
|
|
3798
|
+
}, [e.loading ? (L(), ue(i, {
|
|
3799
|
+
key: 0,
|
|
3800
|
+
spin: "true"
|
|
3801
|
+
})) : R(e.$slots, "icon", {
|
|
3802
|
+
key: 1
|
|
3803
|
+
})], 2)) : se("v-if", !0), R(e.$slots, "default")], 10, Qi)) : (L(), H("button", {
|
|
3804
|
+
key: 1,
|
|
3805
|
+
class: D([e.cls, {
|
|
3806
|
+
[`${e.prefixCls}-only-icon`]: e.$slots.icon && !e.$slots.default
|
|
3807
|
+
}]),
|
|
3808
|
+
type: e.htmlType,
|
|
3809
|
+
disabled: e.mergedDisabled,
|
|
3810
|
+
onClick: t[1] || (t[1] = (...a) => e.handleClick && e.handleClick(...a))
|
|
3811
|
+
}, [e.loading || e.$slots.icon ? (L(), H("span", {
|
|
3812
|
+
key: 0,
|
|
3813
|
+
class: D(`${e.prefixCls}-icon`)
|
|
3814
|
+
}, [e.loading ? (L(), ue(i, {
|
|
3815
|
+
key: 0,
|
|
3816
|
+
spin: !0
|
|
3817
|
+
})) : R(e.$slots, "icon", {
|
|
3818
|
+
key: 1
|
|
3819
|
+
})], 2)) : se("v-if", !0), R(e.$slots, "default")], 10, Ji));
|
|
3820
|
+
}
|
|
3821
|
+
var Pt = /* @__PURE__ */ X(Zi, [["render", ea]]);
|
|
3822
|
+
const ta = I({
|
|
3823
|
+
name: "ButtonGroup",
|
|
3824
|
+
props: {
|
|
3825
|
+
type: {
|
|
3826
|
+
type: String
|
|
3827
|
+
},
|
|
3828
|
+
status: {
|
|
3829
|
+
type: String
|
|
3830
|
+
},
|
|
3831
|
+
shape: {
|
|
3832
|
+
type: String
|
|
3833
|
+
},
|
|
3834
|
+
size: {
|
|
3835
|
+
type: String
|
|
3836
|
+
},
|
|
3837
|
+
disabled: {
|
|
3838
|
+
type: Boolean
|
|
3839
|
+
}
|
|
3840
|
+
},
|
|
3841
|
+
setup(e) {
|
|
3842
|
+
const {
|
|
3843
|
+
type: t,
|
|
3844
|
+
size: r,
|
|
3845
|
+
status: n,
|
|
3846
|
+
disabled: l,
|
|
3847
|
+
shape: o
|
|
3848
|
+
} = ye(e), i = G("btn-group");
|
|
3849
|
+
return ge(mn, le({
|
|
3850
|
+
type: t,
|
|
3851
|
+
size: r,
|
|
3852
|
+
shape: o,
|
|
3853
|
+
status: n,
|
|
3854
|
+
disabled: l
|
|
3855
|
+
})), {
|
|
3856
|
+
prefixCls: i
|
|
3857
|
+
};
|
|
3858
|
+
}
|
|
3859
|
+
});
|
|
3860
|
+
function ra(e, t, r, n, l, o) {
|
|
3861
|
+
return L(), H("div", {
|
|
3862
|
+
class: D(e.prefixCls)
|
|
3863
|
+
}, [R(e.$slots, "default")], 2);
|
|
3864
|
+
}
|
|
3865
|
+
var Ft = /* @__PURE__ */ X(ta, [["render", ra]]);
|
|
3866
|
+
const Ne = Object.assign(Pt, {
|
|
3867
|
+
Group: Ft,
|
|
3868
|
+
install: (e, t) => {
|
|
3869
|
+
Be(e, t);
|
|
3870
|
+
const r = De(t);
|
|
3871
|
+
e.component(r + Pt.name, Pt), e.component(r + Ft.name, Ft);
|
|
3872
|
+
}
|
|
3873
|
+
});
|
|
3874
|
+
var Lt = I({
|
|
3875
|
+
name: "Space",
|
|
3876
|
+
props: {
|
|
3877
|
+
align: {
|
|
3878
|
+
type: String
|
|
3879
|
+
},
|
|
3880
|
+
direction: {
|
|
3881
|
+
type: String,
|
|
3882
|
+
default: "horizontal"
|
|
3883
|
+
},
|
|
3884
|
+
size: {
|
|
3885
|
+
type: [Number, String, Array],
|
|
3886
|
+
default: "small"
|
|
3887
|
+
},
|
|
3888
|
+
wrap: {
|
|
3889
|
+
type: Boolean
|
|
3890
|
+
},
|
|
3891
|
+
fill: {
|
|
3892
|
+
type: Boolean
|
|
3893
|
+
}
|
|
3894
|
+
},
|
|
3895
|
+
setup(e, {
|
|
3896
|
+
slots: t
|
|
3897
|
+
}) {
|
|
3898
|
+
const r = G("space"), n = d(() => {
|
|
3899
|
+
var a;
|
|
3900
|
+
return (a = e.align) != null ? a : e.direction === "horizontal" ? "center" : "";
|
|
3901
|
+
}), l = d(() => [r, {
|
|
3902
|
+
[`${r}-${e.direction}`]: e.direction,
|
|
3903
|
+
[`${r}-align-${n.value}`]: n.value,
|
|
3904
|
+
[`${r}-wrap`]: e.wrap,
|
|
3905
|
+
[`${r}-fill`]: e.fill
|
|
3906
|
+
}]);
|
|
3907
|
+
function o(a) {
|
|
3908
|
+
if (ce(a))
|
|
3909
|
+
return a;
|
|
3910
|
+
switch (a) {
|
|
3911
|
+
case "mini":
|
|
3912
|
+
return 4;
|
|
3913
|
+
case "small":
|
|
3914
|
+
return 8;
|
|
3915
|
+
case "medium":
|
|
3916
|
+
return 16;
|
|
3917
|
+
case "large":
|
|
3918
|
+
return 24;
|
|
3919
|
+
default:
|
|
3920
|
+
return 8;
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
const i = (a) => {
|
|
3924
|
+
const s = {}, u = `${o(Ee(e.size) ? e.size[0] : e.size)}px`, c = `${o(Ee(e.size) ? e.size[1] : e.size)}px`;
|
|
3925
|
+
return a ? e.wrap ? {
|
|
3926
|
+
marginBottom: c
|
|
3927
|
+
} : {} : (e.direction === "horizontal" && (s.marginRight = u), (e.direction === "vertical" || e.wrap) && (s.marginBottom = c), s);
|
|
3928
|
+
};
|
|
3929
|
+
return () => {
|
|
3930
|
+
var a;
|
|
3931
|
+
const s = ot((a = t.default) == null ? void 0 : a.call(t), !0).filter((u) => u.type !== An);
|
|
3932
|
+
return C("div", {
|
|
3933
|
+
class: l.value
|
|
3934
|
+
}, [s.map((u, c) => {
|
|
3935
|
+
var h, p;
|
|
3936
|
+
const b = t.split && c > 0;
|
|
3937
|
+
return C(Wt, {
|
|
3938
|
+
key: (h = u.key) != null ? h : `item-${c}`
|
|
3939
|
+
}, [b && C("div", {
|
|
3940
|
+
class: `${r}-item-split`,
|
|
3941
|
+
style: i(!1)
|
|
3942
|
+
}, [(p = t.split) == null ? void 0 : p.call(t)]), C("div", {
|
|
3943
|
+
class: `${r}-item`,
|
|
3944
|
+
style: i(c === s.length - 1)
|
|
3945
|
+
}, [u])]);
|
|
3946
|
+
})]);
|
|
3947
|
+
};
|
|
3948
|
+
}
|
|
3949
|
+
});
|
|
3950
|
+
const na = Object.assign(Lt, {
|
|
3951
|
+
install: (e, t) => {
|
|
3952
|
+
Be(e, t);
|
|
3953
|
+
const r = De(t);
|
|
3954
|
+
e.component(r + Lt.name, Lt);
|
|
3955
|
+
}
|
|
3956
|
+
}), la = I({
|
|
3957
|
+
name: "IconDown",
|
|
3958
|
+
props: {
|
|
3959
|
+
size: {
|
|
3960
|
+
type: [Number, String]
|
|
3961
|
+
},
|
|
3962
|
+
strokeWidth: {
|
|
3963
|
+
type: Number,
|
|
3964
|
+
default: 4
|
|
3965
|
+
},
|
|
3966
|
+
strokeLinecap: {
|
|
3967
|
+
type: String,
|
|
3968
|
+
default: "butt",
|
|
3969
|
+
validator: (e) => ["butt", "round", "square"].includes(e)
|
|
3970
|
+
},
|
|
3971
|
+
strokeLinejoin: {
|
|
3972
|
+
type: String,
|
|
3973
|
+
default: "miter",
|
|
3974
|
+
validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
|
|
3975
|
+
},
|
|
3976
|
+
rotate: Number,
|
|
3977
|
+
spin: Boolean
|
|
3978
|
+
},
|
|
3979
|
+
emits: {
|
|
3980
|
+
click: (e) => !0
|
|
3981
|
+
},
|
|
3982
|
+
setup(e, {
|
|
3983
|
+
emit: t
|
|
3984
|
+
}) {
|
|
3985
|
+
const r = G("icon"), n = d(() => [r, `${r}-down`, {
|
|
3986
|
+
[`${r}-spin`]: e.spin
|
|
3987
|
+
}]), l = d(() => {
|
|
3988
|
+
const i = {};
|
|
3989
|
+
return e.size && (i.fontSize = ce(e.size) ? `${e.size}px` : e.size), e.rotate && (i.transform = `rotate(${e.rotate}deg)`), i;
|
|
3990
|
+
});
|
|
3991
|
+
return {
|
|
3992
|
+
cls: n,
|
|
3993
|
+
innerStyle: l,
|
|
3994
|
+
onClick: (i) => {
|
|
3995
|
+
t("click", i);
|
|
3996
|
+
}
|
|
3997
|
+
};
|
|
3998
|
+
}
|
|
3999
|
+
}), oa = ["stroke-width", "stroke-linecap", "stroke-linejoin"], ia = /* @__PURE__ */ ee("path", {
|
|
4000
|
+
d: "M39.6 17.443 24.043 33 8.487 17.443"
|
|
4001
|
+
}, null, -1), aa = [ia];
|
|
4002
|
+
function sa(e, t, r, n, l, o) {
|
|
4003
|
+
return L(), H("svg", {
|
|
4004
|
+
viewBox: "0 0 48 48",
|
|
4005
|
+
fill: "none",
|
|
4006
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4007
|
+
stroke: "currentColor",
|
|
4008
|
+
class: D(e.cls),
|
|
4009
|
+
style: Ce(e.innerStyle),
|
|
4010
|
+
"stroke-width": e.strokeWidth,
|
|
4011
|
+
"stroke-linecap": e.strokeLinecap,
|
|
4012
|
+
"stroke-linejoin": e.strokeLinejoin,
|
|
4013
|
+
onClick: t[0] || (t[0] = (...i) => e.onClick && e.onClick(...i))
|
|
4014
|
+
}, aa, 14, oa);
|
|
4015
|
+
}
|
|
4016
|
+
var Tt = /* @__PURE__ */ X(la, [["render", sa]]);
|
|
4017
|
+
const ua = Object.assign(Tt, {
|
|
4018
|
+
install: (e, t) => {
|
|
4019
|
+
var r;
|
|
4020
|
+
const n = (r = t == null ? void 0 : t.iconPrefix) != null ? r : "";
|
|
4021
|
+
e.component(n + Tt.name, Tt);
|
|
4022
|
+
}
|
|
4023
|
+
}), ca = I({
|
|
4024
|
+
name: "IconUp",
|
|
4025
|
+
props: {
|
|
4026
|
+
size: {
|
|
4027
|
+
type: [Number, String]
|
|
4028
|
+
},
|
|
4029
|
+
strokeWidth: {
|
|
4030
|
+
type: Number,
|
|
4031
|
+
default: 4
|
|
4032
|
+
},
|
|
4033
|
+
strokeLinecap: {
|
|
4034
|
+
type: String,
|
|
4035
|
+
default: "butt",
|
|
4036
|
+
validator: (e) => ["butt", "round", "square"].includes(e)
|
|
4037
|
+
},
|
|
4038
|
+
strokeLinejoin: {
|
|
4039
|
+
type: String,
|
|
4040
|
+
default: "miter",
|
|
4041
|
+
validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
|
|
4042
|
+
},
|
|
4043
|
+
rotate: Number,
|
|
4044
|
+
spin: Boolean
|
|
4045
|
+
},
|
|
4046
|
+
emits: {
|
|
4047
|
+
click: (e) => !0
|
|
4048
|
+
},
|
|
4049
|
+
setup(e, {
|
|
4050
|
+
emit: t
|
|
4051
|
+
}) {
|
|
4052
|
+
const r = G("icon"), n = d(() => [r, `${r}-up`, {
|
|
4053
|
+
[`${r}-spin`]: e.spin
|
|
4054
|
+
}]), l = d(() => {
|
|
4055
|
+
const i = {};
|
|
4056
|
+
return e.size && (i.fontSize = ce(e.size) ? `${e.size}px` : e.size), e.rotate && (i.transform = `rotate(${e.rotate}deg)`), i;
|
|
4057
|
+
});
|
|
4058
|
+
return {
|
|
4059
|
+
cls: n,
|
|
4060
|
+
innerStyle: l,
|
|
4061
|
+
onClick: (i) => {
|
|
4062
|
+
t("click", i);
|
|
4063
|
+
}
|
|
4064
|
+
};
|
|
4065
|
+
}
|
|
4066
|
+
}), da = ["stroke-width", "stroke-linecap", "stroke-linejoin"], fa = /* @__PURE__ */ ee("path", {
|
|
4067
|
+
d: "M39.6 30.557 24.043 15 8.487 30.557"
|
|
4068
|
+
}, null, -1), ha = [fa];
|
|
4069
|
+
function va(e, t, r, n, l, o) {
|
|
4070
|
+
return L(), H("svg", {
|
|
4071
|
+
viewBox: "0 0 48 48",
|
|
4072
|
+
fill: "none",
|
|
4073
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4074
|
+
stroke: "currentColor",
|
|
4075
|
+
class: D(e.cls),
|
|
4076
|
+
style: Ce(e.innerStyle),
|
|
4077
|
+
"stroke-width": e.strokeWidth,
|
|
4078
|
+
"stroke-linecap": e.strokeLinecap,
|
|
4079
|
+
"stroke-linejoin": e.strokeLinejoin,
|
|
4080
|
+
onClick: t[0] || (t[0] = (...i) => e.onClick && e.onClick(...i))
|
|
4081
|
+
}, ha, 14, da);
|
|
4082
|
+
}
|
|
4083
|
+
var Mt = /* @__PURE__ */ X(ca, [["render", va]]);
|
|
4084
|
+
const pa = Object.assign(Mt, {
|
|
4085
|
+
install: (e, t) => {
|
|
4086
|
+
var r;
|
|
4087
|
+
const n = (r = t == null ? void 0 : t.iconPrefix) != null ? r : "";
|
|
4088
|
+
e.component(n + Mt.name, Mt);
|
|
4089
|
+
}
|
|
4090
|
+
}), Ir = {
|
|
4091
|
+
id: Symbol("ID"),
|
|
4092
|
+
source: Symbol("Source")
|
|
4093
|
+
};
|
|
4094
|
+
function ma(e) {
|
|
4095
|
+
const t = F({});
|
|
4096
|
+
return e == null || e.forEach((n) => {
|
|
4097
|
+
t.value[n.key] = (typeof n.default == "function" ? n.default() : n.default) || null;
|
|
4098
|
+
}), [t, (n) => {
|
|
4099
|
+
t.value = n;
|
|
4100
|
+
}];
|
|
4101
|
+
}
|
|
4102
|
+
function ba(e) {
|
|
4103
|
+
function t(r, n) {
|
|
4104
|
+
return e != null && e.disabledDate ? e.disabledDate(r, n) : !1;
|
|
4105
|
+
}
|
|
4106
|
+
return (r, n) => {
|
|
4107
|
+
switch (e == null ? void 0 : e.type) {
|
|
4108
|
+
case "week":
|
|
4109
|
+
return C(In, {
|
|
4110
|
+
modelValue: r[n.key],
|
|
4111
|
+
"onUpdate:modelValue": (l) => r[n.key] = l,
|
|
4112
|
+
"disabled-date": t,
|
|
4113
|
+
format: e == null ? void 0 : e.labelFormat,
|
|
4114
|
+
"value-format": e == null ? void 0 : e.valueFormat
|
|
4115
|
+
}, null);
|
|
4116
|
+
case "month":
|
|
4117
|
+
return C(Nn, {
|
|
4118
|
+
modelValue: r[n.key],
|
|
4119
|
+
"onUpdate:modelValue": (l) => r[n.key] = l,
|
|
4120
|
+
"disabled-date": t,
|
|
4121
|
+
format: e == null ? void 0 : e.labelFormat,
|
|
4122
|
+
"value-format": e == null ? void 0 : e.valueFormat
|
|
4123
|
+
}, null);
|
|
4124
|
+
case "quarter":
|
|
4125
|
+
return C(xn, {
|
|
4126
|
+
modelValue: r[n.key],
|
|
4127
|
+
"onUpdate:modelValue": (l) => r[n.key] = l,
|
|
4128
|
+
"disabled-date": t,
|
|
4129
|
+
format: e == null ? void 0 : e.labelFormat,
|
|
4130
|
+
"value-format": e == null ? void 0 : e.valueFormat
|
|
4131
|
+
}, null);
|
|
4132
|
+
case "year":
|
|
4133
|
+
return C(Vn, {
|
|
4134
|
+
modelValue: r[n.key],
|
|
4135
|
+
"onUpdate:modelValue": (l) => r[n.key] = l,
|
|
4136
|
+
"disabled-date": t,
|
|
4137
|
+
format: e == null ? void 0 : e.labelFormat,
|
|
4138
|
+
"value-format": e == null ? void 0 : e.valueFormat
|
|
4139
|
+
}, null);
|
|
4140
|
+
case "date":
|
|
4141
|
+
default:
|
|
4142
|
+
return C(Bn, {
|
|
4143
|
+
modelValue: r[n.key],
|
|
4144
|
+
"onUpdate:modelValue": (l) => r[n.key] = l,
|
|
4145
|
+
"disabled-date": t,
|
|
4146
|
+
format: e == null ? void 0 : e.labelFormat,
|
|
4147
|
+
"value-format": e == null ? void 0 : e.valueFormat
|
|
4148
|
+
}, null);
|
|
4149
|
+
}
|
|
4150
|
+
};
|
|
4151
|
+
}
|
|
4152
|
+
function ya(e) {
|
|
4153
|
+
return (t, r) => {
|
|
4154
|
+
switch (e == null ? void 0 : e.type) {
|
|
4155
|
+
case "number":
|
|
4156
|
+
return C(qn, {
|
|
4157
|
+
modelValue: t[r.key],
|
|
4158
|
+
"onUpdate:modelValue": (n) => t[r.key] = n,
|
|
4159
|
+
hideButton: !0,
|
|
4160
|
+
placeholder: e == null ? void 0 : e.placeholder,
|
|
4161
|
+
allowClear: e == null ? void 0 : e.clearable
|
|
4162
|
+
}, null);
|
|
4163
|
+
case "string":
|
|
4164
|
+
default:
|
|
4165
|
+
return C(zn, {
|
|
4166
|
+
modelValue: t[r.key],
|
|
4167
|
+
"onUpdate:modelValue": (n) => t[r.key] = n,
|
|
4168
|
+
placeholder: e == null ? void 0 : e.placeholder,
|
|
4169
|
+
allowClear: e == null ? void 0 : e.clearable
|
|
4170
|
+
}, null);
|
|
4171
|
+
}
|
|
4172
|
+
};
|
|
4173
|
+
}
|
|
4174
|
+
function ga(e) {
|
|
4175
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Rr(e);
|
|
4176
|
+
}
|
|
4177
|
+
function wa(e) {
|
|
4178
|
+
let t = !1;
|
|
4179
|
+
const r = F(/* @__PURE__ */ new Map());
|
|
4180
|
+
e.options instanceof Function ? e.options().then((l) => r.value = l) : e.options instanceof Promise ? e.options.then((l) => r.value = l) : r.value = e.options;
|
|
4181
|
+
function n() {
|
|
4182
|
+
e.autoSumbit;
|
|
4183
|
+
}
|
|
4184
|
+
return (l, o) => {
|
|
4185
|
+
let i;
|
|
4186
|
+
return e.default && !t && (l[o.key] = e.default, t = !0), C(Wn, {
|
|
4187
|
+
multiple: e.multiple,
|
|
4188
|
+
modelValue: l[o.key],
|
|
4189
|
+
"onUpdate:modelValue": (a) => l[o.key] = a,
|
|
4190
|
+
placeholder: e.placeholder,
|
|
4191
|
+
allowClear: e.clearable,
|
|
4192
|
+
onChange: n
|
|
4193
|
+
}, ga(i = Array.from(r.value.entries()).map(([a, s]) => C(Rn, {
|
|
4194
|
+
key: a,
|
|
4195
|
+
value: a,
|
|
4196
|
+
label: s
|
|
4197
|
+
}, null))) ? i : {
|
|
4198
|
+
default: () => [i]
|
|
4199
|
+
});
|
|
4200
|
+
};
|
|
4201
|
+
}
|
|
4202
|
+
function _a(e) {
|
|
4203
|
+
function t() {
|
|
4204
|
+
e != null && e.autoSumbit;
|
|
4205
|
+
}
|
|
4206
|
+
return (r, n) => (e != null && e.default && (r[n.key] = e.default), C(Hn, {
|
|
4207
|
+
modelValue: r[n.key],
|
|
4208
|
+
"onUpdate:modelValue": (l) => r[n.key] = l,
|
|
4209
|
+
checkedText: (e == null ? void 0 : e.openLabel) ?? "是",
|
|
4210
|
+
uncheckedText: (e == null ? void 0 : e.closeLabel) ?? "否",
|
|
4211
|
+
checkedValue: (e == null ? void 0 : e.openValue) ?? !0,
|
|
4212
|
+
uncheckedValue: (e == null ? void 0 : e.closeValue) ?? !1,
|
|
4213
|
+
onChange: t
|
|
4214
|
+
}, null));
|
|
4215
|
+
}
|
|
4216
|
+
function Ea(e) {
|
|
4217
|
+
return (t, r) => {
|
|
4218
|
+
let n = [];
|
|
4219
|
+
function l(a) {
|
|
4220
|
+
n = a;
|
|
4221
|
+
}
|
|
4222
|
+
function o(a) {
|
|
4223
|
+
if (a && a.length === 2) {
|
|
4224
|
+
const [s, u] = a.sort(), c = er(s).startOf("days"), h = er(u).endOf("days");
|
|
4225
|
+
t[r.key] = [c.format((e == null ? void 0 : e.valueFormat) || "YYYY-MM-DD"), h.format((e == null ? void 0 : e.valueFormat) || "YYYY-MM-DD")];
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
function i(a) {
|
|
4229
|
+
return e != null && e.disabledDate ? e.disabledDate(n, a) : !1;
|
|
4230
|
+
}
|
|
4231
|
+
return C("div", null, [C(Gn, {
|
|
4232
|
+
style: {
|
|
4233
|
+
width: "300px"
|
|
4234
|
+
},
|
|
4235
|
+
modelValue: t[r.key],
|
|
4236
|
+
"onUpdate:modelValue": (a) => t[r.key] = a,
|
|
4237
|
+
onSelect: l,
|
|
4238
|
+
onChange: o,
|
|
4239
|
+
mode: e == null ? void 0 : e.type,
|
|
4240
|
+
allowClear: e == null ? void 0 : e.clearable,
|
|
4241
|
+
"disabled-date": i,
|
|
4242
|
+
format: e == null ? void 0 : e.labelFormat,
|
|
4243
|
+
"value-format": e == null ? void 0 : e.valueFormat
|
|
4244
|
+
}, null)]);
|
|
4245
|
+
};
|
|
4246
|
+
}
|
|
4247
|
+
function Ca(e) {
|
|
4248
|
+
return (t, r) => C(Un, {
|
|
4249
|
+
modelValue: t[r.key],
|
|
4250
|
+
"onUpdate:modelValue": (n) => t[r.key] = n,
|
|
4251
|
+
placeholder: e == null ? void 0 : e.placeholder,
|
|
4252
|
+
autoSize: e == null ? void 0 : e.autosize,
|
|
4253
|
+
maxLength: e == null ? void 0 : e.maxLength
|
|
4254
|
+
}, null);
|
|
4255
|
+
}
|
|
4256
|
+
function $a(e) {
|
|
4257
|
+
return (t) => e(t);
|
|
4258
|
+
}
|
|
4259
|
+
const Oa = {
|
|
4260
|
+
input: ya,
|
|
4261
|
+
textarea: Ca,
|
|
4262
|
+
select: wa,
|
|
4263
|
+
date: ba,
|
|
4264
|
+
switch: _a,
|
|
4265
|
+
dateRange: Ea,
|
|
4266
|
+
render: $a
|
|
4267
|
+
};
|
|
4268
|
+
function Sa(e, t) {
|
|
4269
|
+
t.render || (t.render = (n) => n.input());
|
|
4270
|
+
const r = t.render({
|
|
4271
|
+
...Oa
|
|
4272
|
+
});
|
|
4273
|
+
return {
|
|
4274
|
+
default: () => r(e, t)
|
|
4275
|
+
};
|
|
4276
|
+
}
|
|
4277
|
+
function ja(e, t) {
|
|
4278
|
+
return Dn(Re, {
|
|
4279
|
+
field: t.key,
|
|
4280
|
+
label: t.title
|
|
4281
|
+
}, Sa(e, t));
|
|
4282
|
+
}
|
|
4283
|
+
function zr(e) {
|
|
4284
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Rr(e);
|
|
4285
|
+
}
|
|
4286
|
+
const La = /* @__PURE__ */ I({
|
|
4287
|
+
props: {
|
|
4288
|
+
form: {
|
|
4289
|
+
type: Object,
|
|
4290
|
+
required: !0
|
|
4291
|
+
},
|
|
4292
|
+
minWidth: {
|
|
4293
|
+
type: Number,
|
|
4294
|
+
required: !1,
|
|
4295
|
+
default: 300
|
|
4296
|
+
},
|
|
4297
|
+
name: {
|
|
4298
|
+
type: String,
|
|
4299
|
+
required: !1,
|
|
4300
|
+
default: "form"
|
|
4301
|
+
},
|
|
4302
|
+
submitable: {
|
|
4303
|
+
type: Boolean,
|
|
4304
|
+
required: !1,
|
|
4305
|
+
default: !1
|
|
4306
|
+
},
|
|
4307
|
+
searchable: {
|
|
4308
|
+
type: Boolean,
|
|
4309
|
+
required: !1,
|
|
4310
|
+
default: !1
|
|
4311
|
+
},
|
|
4312
|
+
footer: {
|
|
4313
|
+
type: Boolean,
|
|
4314
|
+
required: !1,
|
|
4315
|
+
default: !1
|
|
4316
|
+
}
|
|
4317
|
+
},
|
|
4318
|
+
emits: ["submit", "cancel"],
|
|
4319
|
+
expose: ["formSource"],
|
|
4320
|
+
setup(e) {
|
|
4321
|
+
const t = Math.random().toString(32).slice(2).toUpperCase(), r = F(), [n] = ma(e.form), l = F(0), o = F(!0), i = () => o.value = !o.value;
|
|
4322
|
+
ge(Ir.id, t), ge(Ir.source, n);
|
|
4323
|
+
const a = d(() => {
|
|
4324
|
+
if (!l.value)
|
|
4325
|
+
return 1;
|
|
4326
|
+
const c = e.form.reduce((h, p) => h + ((p == null ? void 0 : p.span) || 1), 0);
|
|
4327
|
+
return l.value - c % l.value;
|
|
4328
|
+
}), s = d(() => e.form.reduce((c, h) => (h.rule && (c[h.key] = h.rule), c), {}));
|
|
4329
|
+
function u() {
|
|
4330
|
+
var h;
|
|
4331
|
+
const c = (h = r.value) == null ? void 0 : h.$el;
|
|
4332
|
+
l.value = Math.floor(c.offsetWidth / e.minWidth);
|
|
4333
|
+
}
|
|
4334
|
+
return he(() => {
|
|
4335
|
+
u();
|
|
4336
|
+
}), window.addEventListener("resize", u), {
|
|
4337
|
+
formId: t,
|
|
4338
|
+
formSource: n,
|
|
4339
|
+
formInstance: r,
|
|
4340
|
+
formColumns: l,
|
|
4341
|
+
formRules: s,
|
|
4342
|
+
formCollspased: o,
|
|
4343
|
+
formActiosSpan: a,
|
|
4344
|
+
toggleFormCollapsed: i
|
|
4345
|
+
};
|
|
4346
|
+
},
|
|
4347
|
+
render() {
|
|
4348
|
+
const e = () => {
|
|
4349
|
+
this.$emit("submit", this.formSource);
|
|
4350
|
+
}, t = () => {
|
|
4351
|
+
const r = [], n = this.footer ? {
|
|
4352
|
+
span: this.formColumns
|
|
4353
|
+
} : {
|
|
4354
|
+
span: this.formActiosSpan
|
|
4355
|
+
};
|
|
4356
|
+
if (this.searchable && (r.push(C(Ne, {
|
|
4357
|
+
type: "primary",
|
|
4358
|
+
htmlType: "submit"
|
|
4359
|
+
}, {
|
|
4360
|
+
default: () => [me("搜索")]
|
|
4361
|
+
})), r.push(C(Ne, {
|
|
4362
|
+
type: "secondary",
|
|
4363
|
+
onClick: () => {
|
|
4364
|
+
var l;
|
|
4365
|
+
return (l = this.formInstance) == null ? void 0 : l.resetFields();
|
|
4366
|
+
}
|
|
4367
|
+
}, {
|
|
4368
|
+
default: () => [me("重置")]
|
|
4369
|
+
}))), this.submitable && (r.push(C(Ne, {
|
|
4370
|
+
type: "primary",
|
|
4371
|
+
htmlType: "submit"
|
|
4372
|
+
}, {
|
|
4373
|
+
default: () => [me("提交")]
|
|
4374
|
+
})), r.push(C(Ne, {
|
|
4375
|
+
type: "secondary",
|
|
4376
|
+
onClick: () => this.$emit("cancel")
|
|
4377
|
+
}, {
|
|
4378
|
+
default: () => [me("取消")]
|
|
4379
|
+
}))), this.form.some((l) => !!l.collapsed) && r.push(C(Ne, {
|
|
4380
|
+
onClick: this.toggleFormCollapsed
|
|
4381
|
+
}, {
|
|
4382
|
+
default: () => this.formCollspased ? "展开" : "收起",
|
|
4383
|
+
icon: () => this.formCollspased ? C(ua, null, null) : C(pa, null, null)
|
|
4384
|
+
})), this.$slots.actions && r.push(...this.$slots.actions()), r.length)
|
|
4385
|
+
return C(We, n, {
|
|
4386
|
+
default: () => [C(Re, {
|
|
4387
|
+
hideLabel: !0,
|
|
4388
|
+
contentClass: this.footer ? "form-footer" : ""
|
|
4389
|
+
}, {
|
|
4390
|
+
default: () => [C(na, null, zr(r) ? r : {
|
|
4391
|
+
default: () => [r]
|
|
4392
|
+
})]
|
|
4393
|
+
})]
|
|
4394
|
+
});
|
|
4395
|
+
};
|
|
4396
|
+
return C(Wi, Le({
|
|
4397
|
+
rules: this.formRules,
|
|
4398
|
+
onSubmitSuccess: e
|
|
4399
|
+
}, {
|
|
4400
|
+
name: this.name
|
|
4401
|
+
}, {
|
|
4402
|
+
"auto-label-width": !0,
|
|
4403
|
+
ref: (r) => this.formInstance = r,
|
|
4404
|
+
model: this.formSource
|
|
4405
|
+
}), {
|
|
4406
|
+
default: () => [C(so, {
|
|
4407
|
+
cols: this.formColumns,
|
|
4408
|
+
"col-gap": 10,
|
|
4409
|
+
"rol-gap": 10
|
|
4410
|
+
}, {
|
|
4411
|
+
default: () => [this.form.filter((r) => this.formCollspased ? !r.collapsed : !0).map((r) => {
|
|
4412
|
+
let n;
|
|
4413
|
+
return C(We, {
|
|
4414
|
+
span: r.span
|
|
4415
|
+
}, zr(n = ja(this.formSource, r)) ? n : {
|
|
4416
|
+
default: () => [n]
|
|
4417
|
+
});
|
|
4418
|
+
}), t()]
|
|
4419
|
+
})]
|
|
4420
|
+
});
|
|
4421
|
+
}
|
|
4422
|
+
});
|
|
4423
|
+
function Ta(e) {
|
|
4424
|
+
return e;
|
|
4425
|
+
}
|
|
4426
|
+
export {
|
|
4427
|
+
La as FormRender,
|
|
4428
|
+
Ta as defineForm
|
|
4429
|
+
};
|