@squirrel-cloud/ui-vue 0.6.0 → 0.6.1
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/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { WarningFilled as rt, CloseFilled as ut, InfoFilled as Qe, CheckFilled as ct, CaretUp as Mt, Loading as De, Check as dt, Close as Xe, View as
|
|
3
|
-
import { autoUpdate as
|
|
1
|
+
import { defineComponent as B, computed as y, openBlock as v, createBlock as q, unref as a, normalizeClass as j, withCtx as N, resolveDynamicComponent as re, createCommentVNode as L, createTextVNode as Te, toDisplayString as X, createElementBlock as _, renderSlot as F, createElementVNode as z, ref as w, watch as te, normalizeStyle as K, onMounted as oe, onBeforeUnmount as ye, Transition as _e, withDirectives as ue, vShow as ve, useSlots as Ae, createVNode as D, inject as fe, shallowRef as ce, provide as qe, toRef as ne, useModel as ie, vModelCheckbox as at, mergeModels as G, toRaw as ge, Fragment as se, renderList as de, useAttrs as Ke, Teleport as lt, mergeProps as pe, withModifiers as he, nextTick as Se, vModelDynamic as Ct, vModelText as wt, render as Pe, cloneVNode as St, Text as zt, Comment as Bt, vModelRadio as it } from "vue";
|
|
2
|
+
import { WarningFilled as rt, CloseFilled as ut, InfoFilled as Qe, CheckFilled as ct, CaretUp as Mt, Loading as De, Check as dt, Close as Xe, View as pt, ArrowLeft as ft, ArrowRight as vt, ZoomIn as Lt, ZoomOut as Tt, FlipHorizontal as At, FlipVertical as It, Clockwise as Rt, Couterclockwise as Et, FitSize as Pt, Fullscreen as Dt, Hide as Nt, Ellipsis as Ft, ArrowDown as Vt } from "@squirrel-cloud/icons-vue";
|
|
3
|
+
import { autoUpdate as Ot, computePosition as Ht, offset as Ut, flip as jt, shift as Wt } from "@floating-ui/dom";
|
|
4
4
|
const Ge = {
|
|
5
5
|
primary: Qe,
|
|
6
6
|
success: ct,
|
|
7
7
|
info: Qe,
|
|
8
8
|
error: ut,
|
|
9
9
|
warn: rt
|
|
10
|
-
}, Yt = "sq-alert",
|
|
10
|
+
}, Yt = "sq-alert", jo = /* @__PURE__ */ B({
|
|
11
11
|
name: Yt,
|
|
12
12
|
__name: "Alert",
|
|
13
13
|
props: {
|
|
@@ -21,17 +21,17 @@ const Ge = {
|
|
|
21
21
|
const e = [];
|
|
22
22
|
return n.type && e.push(`is-${n.type}`), e;
|
|
23
23
|
}), t = y(() => n.icon ? n.icon : n.showIcon && n.type ? Ge[n.type] : void 0);
|
|
24
|
-
return (e, o) => (v(),
|
|
24
|
+
return (e, o) => (v(), q(a(be), {
|
|
25
25
|
class: j(["sq-alert", s.value])
|
|
26
26
|
}, {
|
|
27
27
|
default: N(() => [
|
|
28
|
-
t.value ? (v(),
|
|
28
|
+
t.value ? (v(), q(re(t.value), { key: 0 })) : L("", !0),
|
|
29
29
|
Te(" " + X(n.text), 1)
|
|
30
30
|
]),
|
|
31
31
|
_: 1
|
|
32
32
|
}, 8, ["class"]));
|
|
33
33
|
}
|
|
34
|
-
}), Kt = { class: "sq-article" }, Xt = ["innerHTML"], Gt = "sq-article",
|
|
34
|
+
}), Kt = { class: "sq-article" }, Xt = ["innerHTML"], Gt = "sq-article", Wo = /* @__PURE__ */ B({
|
|
35
35
|
name: Gt,
|
|
36
36
|
__name: "Article",
|
|
37
37
|
props: {
|
|
@@ -41,7 +41,7 @@ const Ge = {
|
|
|
41
41
|
const n = i;
|
|
42
42
|
return (s, t) => (v(), _("article", Kt, [
|
|
43
43
|
F(s.$slots, "default", {}, () => [
|
|
44
|
-
|
|
44
|
+
z("div", {
|
|
45
45
|
class: "sq-article-content",
|
|
46
46
|
innerHTML: n.content
|
|
47
47
|
}, null, 8, Xt)
|
|
@@ -86,8 +86,8 @@ function Zt() {
|
|
|
86
86
|
}
|
|
87
87
|
function Jt() {
|
|
88
88
|
function i(n = [0.3, 0.8], s = [0.1, 0.3], t = [0, 360]) {
|
|
89
|
-
const { getRandomNum: e } = Qt(), o = e(n, 4), l = e(s, 4),
|
|
90
|
-
return `oklch(${o} ${l} ${
|
|
89
|
+
const { getRandomNum: e } = Qt(), o = e(n, 4), l = e(s, 4), p = e(t, 4);
|
|
90
|
+
return `oklch(${o} ${l} ${p})`;
|
|
91
91
|
}
|
|
92
92
|
return {
|
|
93
93
|
/**
|
|
@@ -135,11 +135,11 @@ function en() {
|
|
|
135
135
|
function i(n, s) {
|
|
136
136
|
const t = Object.keys(n), e = Object.keys(s);
|
|
137
137
|
return t.length !== e.length ? !1 : t.every((o) => {
|
|
138
|
-
const l = n[o],
|
|
139
|
-
if (typeof l != typeof
|
|
140
|
-
if (Array.isArray(l) && Array.isArray(
|
|
141
|
-
const
|
|
142
|
-
return
|
|
138
|
+
const l = n[o], p = s[o];
|
|
139
|
+
if (typeof l != typeof p) return !1;
|
|
140
|
+
if (Array.isArray(l) && Array.isArray(p)) {
|
|
141
|
+
const f = l.length === p.length, d = l.every((r, c) => r === p[c]);
|
|
142
|
+
return f && d;
|
|
143
143
|
}
|
|
144
144
|
return n[o] === s[o];
|
|
145
145
|
});
|
|
@@ -204,23 +204,23 @@ function an() {
|
|
|
204
204
|
};
|
|
205
205
|
const l = Ue[e];
|
|
206
206
|
if (l !== void 0) {
|
|
207
|
-
const
|
|
207
|
+
const c = await l;
|
|
208
208
|
return me[e] = (me[e] ?? 0) + 1, {
|
|
209
209
|
key: e,
|
|
210
|
-
highlighter:
|
|
210
|
+
highlighter: c
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
const { createHighlighterCore:
|
|
213
|
+
const { createHighlighterCore: p } = await import("@shikijs/core"), { createJavaScriptRegexEngine: f } = await import("@shikijs/engine-javascript"), d = f(), r = new Promise((c) => {
|
|
214
214
|
try {
|
|
215
|
-
|
|
215
|
+
p({
|
|
216
216
|
langs: s.map((h) => nn[h]()),
|
|
217
217
|
themes: t.map((h) => sn[h]()),
|
|
218
218
|
engine: d
|
|
219
219
|
}).then((h) => {
|
|
220
|
-
|
|
220
|
+
c(h), Ee[e] = h, me[e] = (me[e] ?? 0) + 1, delete Ue[e];
|
|
221
221
|
});
|
|
222
222
|
} catch {
|
|
223
|
-
delete Ue[e],
|
|
223
|
+
delete Ue[e], c(!1);
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
226
|
return { key: e, highlighter: await r };
|
|
@@ -231,7 +231,7 @@ function an() {
|
|
|
231
231
|
}
|
|
232
232
|
return { getHighlighterAsync: i, releaseHighlighter: n };
|
|
233
233
|
}
|
|
234
|
-
const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar",
|
|
234
|
+
const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Yo = /* @__PURE__ */ B({
|
|
235
235
|
name: un,
|
|
236
236
|
__name: "Avatar",
|
|
237
237
|
props: {
|
|
@@ -243,13 +243,13 @@ const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Ko = /* @__PU
|
|
|
243
243
|
},
|
|
244
244
|
setup(i) {
|
|
245
245
|
const n = i, s = w(!0), t = y(() => {
|
|
246
|
-
const
|
|
247
|
-
return n.size !== "md" &&
|
|
246
|
+
const p = [];
|
|
247
|
+
return n.size !== "md" && p.push(`sq-avatar--${n.size}`), n.round && p.push("is-round"), p;
|
|
248
248
|
}), e = y(() => {
|
|
249
249
|
if (!n.randomColor) return;
|
|
250
|
-
const { getRandomColor:
|
|
250
|
+
const { getRandomColor: p } = Jt();
|
|
251
251
|
return {
|
|
252
|
-
"--avatar-bg-color":
|
|
252
|
+
"--avatar-bg-color": p()
|
|
253
253
|
};
|
|
254
254
|
}), o = y(() => n.alt.charAt(0).toUpperCase());
|
|
255
255
|
te(
|
|
@@ -261,7 +261,7 @@ const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Ko = /* @__PU
|
|
|
261
261
|
function l() {
|
|
262
262
|
s.value = !1;
|
|
263
263
|
}
|
|
264
|
-
return (
|
|
264
|
+
return (p, f) => (v(), _("div", {
|
|
265
265
|
class: j(["sq-avatar", t.value]),
|
|
266
266
|
style: K(e.value)
|
|
267
267
|
}, [
|
|
@@ -276,7 +276,7 @@ const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Ko = /* @__PU
|
|
|
276
276
|
}, null, 8, rn))
|
|
277
277
|
], 6));
|
|
278
278
|
}
|
|
279
|
-
}), cn = { class: "sq-backtop" }, dn = "sq-backtop",
|
|
279
|
+
}), cn = { class: "sq-backtop" }, dn = "sq-backtop", Ko = /* @__PURE__ */ B({
|
|
280
280
|
name: dn,
|
|
281
281
|
__name: "Backtop",
|
|
282
282
|
props: {
|
|
@@ -288,61 +288,61 @@ const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Ko = /* @__PU
|
|
|
288
288
|
progressProps: {}
|
|
289
289
|
},
|
|
290
290
|
setup(i) {
|
|
291
|
-
const { throttle: n } = tn(), s = n(
|
|
291
|
+
const { throttle: n } = tn(), s = n(f), t = new ResizeObserver(d), e = i, o = w(100), l = w(0), p = y(() => l.value > e.visibilityHeight);
|
|
292
292
|
oe(() => {
|
|
293
293
|
var h;
|
|
294
294
|
d(), s(), window.addEventListener("scroll", s);
|
|
295
|
-
const
|
|
296
|
-
t.observe(
|
|
295
|
+
const c = document.querySelector(e.target) ?? document.body;
|
|
296
|
+
t.observe(c), (h = window.visualViewport) == null || h.addEventListener("resize", d);
|
|
297
297
|
}), ye(() => {
|
|
298
|
-
var
|
|
299
|
-
window.removeEventListener("scroll", s), t.disconnect(), (
|
|
298
|
+
var c;
|
|
299
|
+
window.removeEventListener("scroll", s), t.disconnect(), (c = window.visualViewport) == null || c.removeEventListener("resize", d);
|
|
300
300
|
});
|
|
301
|
-
function
|
|
301
|
+
function f() {
|
|
302
302
|
l.value = window.scrollY;
|
|
303
303
|
}
|
|
304
304
|
function d() {
|
|
305
|
-
const
|
|
306
|
-
o.value =
|
|
305
|
+
const c = (document.scrollingElement ?? document.body).scrollHeight, h = window.innerHeight;
|
|
306
|
+
o.value = c - h;
|
|
307
307
|
}
|
|
308
308
|
function r() {
|
|
309
309
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
310
310
|
}
|
|
311
|
-
return (
|
|
311
|
+
return (c, h) => (v(), q(_e, {
|
|
312
312
|
name: e.transition
|
|
313
313
|
}, {
|
|
314
314
|
default: N(() => {
|
|
315
|
-
var m,
|
|
315
|
+
var m, u, k;
|
|
316
316
|
return [
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
ue(z("div", cn, [
|
|
318
|
+
z("div", {
|
|
319
319
|
class: "sq-backtop-wrap",
|
|
320
320
|
onClick: r
|
|
321
321
|
}, [
|
|
322
|
-
e.progress ? (v(),
|
|
322
|
+
e.progress ? (v(), q(a(Zs), {
|
|
323
323
|
key: 0,
|
|
324
324
|
variant: "circle",
|
|
325
325
|
label: !1,
|
|
326
326
|
value: l.value,
|
|
327
327
|
max: o.value,
|
|
328
328
|
type: (m = e.progressProps) == null ? void 0 : m.type,
|
|
329
|
-
stroke: (
|
|
329
|
+
stroke: (u = e.progressProps) == null ? void 0 : u.stroke,
|
|
330
330
|
color: (k = e.progressProps) == null ? void 0 : k.color
|
|
331
331
|
}, null, 8, ["value", "max", "type", "stroke", "color"])) : L("", !0),
|
|
332
|
-
F(
|
|
333
|
-
(v(),
|
|
332
|
+
F(c.$slots, "default", {}, () => [
|
|
333
|
+
(v(), q(re(e.icon)))
|
|
334
334
|
])
|
|
335
335
|
])
|
|
336
336
|
], 512), [
|
|
337
|
-
[ve,
|
|
337
|
+
[ve, p.value]
|
|
338
338
|
])
|
|
339
339
|
];
|
|
340
340
|
}),
|
|
341
341
|
_: 3
|
|
342
342
|
}, 8, ["name"]));
|
|
343
343
|
}
|
|
344
|
-
}),
|
|
345
|
-
name:
|
|
344
|
+
}), pn = ["textContent"], fn = "sq-badge", nt = /* @__PURE__ */ B({
|
|
345
|
+
name: fn,
|
|
346
346
|
__name: "Badge",
|
|
347
347
|
props: {
|
|
348
348
|
type: { default: "error" },
|
|
@@ -355,18 +355,18 @@ const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Ko = /* @__PU
|
|
|
355
355
|
},
|
|
356
356
|
setup(i) {
|
|
357
357
|
const n = Ae(), s = i, t = y(() => {
|
|
358
|
-
const
|
|
359
|
-
return s.dot &&
|
|
358
|
+
const p = [`is-${s.type}`];
|
|
359
|
+
return s.dot && p.push("is-dot"), p;
|
|
360
360
|
}), e = y(() => n.default ? "sup" : "div"), o = y(() => !s.dot && s.text || s.showZero ? !0 : s.count > 0), l = y(() => s.dot ? "" : s.text ? s.text : s.max && s.count > s.max ? `${s.max}+` : `${s.count}`);
|
|
361
|
-
return (
|
|
361
|
+
return (p, f) => (v(), q(_e, { name: "sq-zoom" }, {
|
|
362
362
|
default: N(() => [
|
|
363
363
|
a(n).default || o.value ? (v(), _("span", {
|
|
364
364
|
key: 0,
|
|
365
365
|
class: j(["sq-badge", t.value]),
|
|
366
366
|
style: K({ "--badge-color": s.color })
|
|
367
367
|
}, [
|
|
368
|
-
F(
|
|
369
|
-
(v(),
|
|
368
|
+
F(p.$slots, "default"),
|
|
369
|
+
(v(), q(re(e.value), { class: "sq-badge-label" }, {
|
|
370
370
|
default: N(() => [
|
|
371
371
|
D(_e, {
|
|
372
372
|
name: a(n).default ? "sq-zoom" : ""
|
|
@@ -376,7 +376,7 @@ const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Ko = /* @__PU
|
|
|
376
376
|
key: 0,
|
|
377
377
|
class: "sq-badge-label-inner",
|
|
378
378
|
textContent: X(l.value)
|
|
379
|
-
}, null, 8,
|
|
379
|
+
}, null, 8, pn)) : L("", !0)
|
|
380
380
|
]),
|
|
381
381
|
_: 1
|
|
382
382
|
}, 8, ["name"])
|
|
@@ -388,11 +388,11 @@ const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Ko = /* @__PU
|
|
|
388
388
|
_: 3
|
|
389
389
|
}));
|
|
390
390
|
}
|
|
391
|
-
}), vn = "sq-blur",
|
|
391
|
+
}), vn = "sq-blur", Xo = /* @__PURE__ */ B({
|
|
392
392
|
name: vn,
|
|
393
393
|
__name: "Blur",
|
|
394
394
|
setup(i) {
|
|
395
|
-
return (n, s) => (v(),
|
|
395
|
+
return (n, s) => (v(), q(a(be), { class: "sq-blur" }, {
|
|
396
396
|
default: N(() => [
|
|
397
397
|
F(n.$slots, "default")
|
|
398
398
|
]),
|
|
@@ -401,7 +401,7 @@ const ln = ["src", "alt"], rn = ["textContent"], un = "sq-avatar", Ko = /* @__PU
|
|
|
401
401
|
}
|
|
402
402
|
});
|
|
403
403
|
function mn(i) {
|
|
404
|
-
const { getOption: n } = ze(), s =
|
|
404
|
+
const { getOption: n } = ze(), s = fe(Me, void 0), t = fe(gt, void 0), e = y(
|
|
405
405
|
() => a(t) ? void 0 : i.text
|
|
406
406
|
), o = y(
|
|
407
407
|
() => {
|
|
@@ -418,7 +418,7 @@ function mn(i) {
|
|
|
418
418
|
var d;
|
|
419
419
|
return n((d = a(t)) == null ? void 0 : d.type, i.type);
|
|
420
420
|
}
|
|
421
|
-
),
|
|
421
|
+
), p = y(
|
|
422
422
|
() => {
|
|
423
423
|
var d, r;
|
|
424
424
|
return n(
|
|
@@ -427,21 +427,21 @@ function mn(i) {
|
|
|
427
427
|
(r = a(s)) == null ? void 0 : r.round
|
|
428
428
|
);
|
|
429
429
|
}
|
|
430
|
-
),
|
|
430
|
+
), f = y(
|
|
431
431
|
() => {
|
|
432
|
-
var d, r,
|
|
432
|
+
var d, r, c;
|
|
433
433
|
return n(
|
|
434
434
|
(d = a(s)) == null ? void 0 : d.disabled,
|
|
435
435
|
(r = a(s)) == null ? void 0 : r.readonly,
|
|
436
|
-
(
|
|
436
|
+
(c = a(t)) == null ? void 0 : c.disabled,
|
|
437
437
|
i.disabled
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
440
|
);
|
|
441
|
-
return { btnTextType: e, btnSize: o, btnType: l, btnRound:
|
|
441
|
+
return { btnTextType: e, btnSize: o, btnType: l, btnRound: p, btnDisabled: f };
|
|
442
442
|
}
|
|
443
443
|
function gn(i) {
|
|
444
|
-
const { getOption: n } = ze(), s =
|
|
444
|
+
const { getOption: n } = ze(), s = fe(Me, void 0), t = fe(ht, void 0), e = y(
|
|
445
445
|
() => {
|
|
446
446
|
var d, r;
|
|
447
447
|
return n(
|
|
@@ -461,18 +461,18 @@ function gn(i) {
|
|
|
461
461
|
var d;
|
|
462
462
|
return n((d = a(t)) == null ? void 0 : d.name, i.name);
|
|
463
463
|
}
|
|
464
|
-
),
|
|
464
|
+
), p = y(
|
|
465
465
|
() => {
|
|
466
466
|
var d;
|
|
467
467
|
return n((d = a(t)) == null ? void 0 : d.variant, i.variant);
|
|
468
468
|
}
|
|
469
|
-
),
|
|
469
|
+
), f = y(
|
|
470
470
|
() => {
|
|
471
|
-
var d, r,
|
|
471
|
+
var d, r, c;
|
|
472
472
|
return n(
|
|
473
473
|
(d = a(s)) == null ? void 0 : d.disabled,
|
|
474
474
|
(r = a(s)) == null ? void 0 : r.readonly,
|
|
475
|
-
(
|
|
475
|
+
(c = a(t)) == null ? void 0 : c.disabled,
|
|
476
476
|
i.disabled
|
|
477
477
|
);
|
|
478
478
|
}
|
|
@@ -481,46 +481,46 @@ function gn(i) {
|
|
|
481
481
|
checkboxSize: e,
|
|
482
482
|
checkboxForm: o,
|
|
483
483
|
checkboxName: l,
|
|
484
|
-
checkboxVariant:
|
|
485
|
-
checkboxDisabled:
|
|
484
|
+
checkboxVariant: p,
|
|
485
|
+
checkboxDisabled: f,
|
|
486
486
|
groupContext: t
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
489
|
function mt() {
|
|
490
490
|
const i = { x: 0, y: 0 }, n = w(!1), s = w(1), t = w(), e = w({ x: 0, y: 0 }), o = ce(null);
|
|
491
|
-
function l(
|
|
492
|
-
|
|
491
|
+
function l(u) {
|
|
492
|
+
u.pointerType !== "touch" && (n.value = !0, i.x = u.x, i.y = u.y);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
495
|
-
|
|
494
|
+
function p(u) {
|
|
495
|
+
u.pointerType !== "touch" && (n.value = !1);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
if (
|
|
499
|
-
n.value = !0, i.x =
|
|
500
|
-
else if (
|
|
501
|
-
const k =
|
|
497
|
+
function f(u) {
|
|
498
|
+
if (u.touches.length === 1)
|
|
499
|
+
n.value = !0, i.x = u.touches[0].screenX, i.y = u.touches[0].screenY;
|
|
500
|
+
else if (u.touches.length === 2) {
|
|
501
|
+
const k = u.touches.item(0), b = u.touches.item(1);
|
|
502
502
|
t.value = h(k, b);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
function d(
|
|
506
|
-
n.value = !1, t.value = void 0,
|
|
505
|
+
function d(u) {
|
|
506
|
+
n.value = !1, t.value = void 0, u == null || u();
|
|
507
507
|
}
|
|
508
|
-
function r(
|
|
509
|
-
const T = s.value / R, A =
|
|
508
|
+
function r(u, k, b, C, R) {
|
|
509
|
+
const T = s.value / R, A = u * T, Y = k * T, [H, ee] = m(b, C);
|
|
510
510
|
return [H - A, ee - Y];
|
|
511
511
|
}
|
|
512
|
-
function u
|
|
513
|
-
const b =
|
|
514
|
-
i.x =
|
|
515
|
-
const R = e.value.x + b * 2, T = e.value.y +
|
|
512
|
+
function c(u, k) {
|
|
513
|
+
const b = u - i.x, C = k - i.y;
|
|
514
|
+
i.x = u, i.y = k;
|
|
515
|
+
const R = e.value.x + b * 2, T = e.value.y + C * 2;
|
|
516
516
|
e.value.x = R, e.value.y = T;
|
|
517
517
|
}
|
|
518
|
-
function h(
|
|
519
|
-
const b = k.clientX -
|
|
520
|
-
return Math.sqrt(b * b +
|
|
518
|
+
function h(u, k) {
|
|
519
|
+
const b = k.clientX - u.clientX, C = k.clientY - u.clientY;
|
|
520
|
+
return Math.sqrt(b * b + C * C);
|
|
521
521
|
}
|
|
522
|
-
function m(
|
|
523
|
-
const { left: b, top:
|
|
522
|
+
function m(u, k) {
|
|
523
|
+
const { left: b, top: C } = o.value.getBoundingClientRect(), R = u - b, T = k - C;
|
|
524
524
|
return [R, T];
|
|
525
525
|
}
|
|
526
526
|
return {
|
|
@@ -531,38 +531,38 @@ function mt() {
|
|
|
531
531
|
transform: e,
|
|
532
532
|
imgRef: o,
|
|
533
533
|
handlePointerdown: l,
|
|
534
|
-
handlePointerup:
|
|
535
|
-
handleTouchstart:
|
|
534
|
+
handlePointerup: p,
|
|
535
|
+
handleTouchstart: f,
|
|
536
536
|
handleTouchend: d,
|
|
537
537
|
calcPointDiff: r,
|
|
538
|
-
moveImage:
|
|
538
|
+
moveImage: c,
|
|
539
539
|
getLength: h,
|
|
540
540
|
getImagePoint: m
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
543
|
function hn(i) {
|
|
544
|
-
const { getOption: n } = ze(), s =
|
|
544
|
+
const { getOption: n } = ze(), s = fe(Me, void 0), t = fe(Je, void 0), e = y(
|
|
545
545
|
() => {
|
|
546
|
-
var
|
|
547
|
-
return n(i.size, (
|
|
546
|
+
var f;
|
|
547
|
+
return n(i.size, (f = a(s)) == null ? void 0 : f.size, "md");
|
|
548
548
|
}
|
|
549
549
|
), o = y(
|
|
550
550
|
() => {
|
|
551
|
-
var
|
|
552
|
-
return n(i.round, (
|
|
551
|
+
var f;
|
|
552
|
+
return n(i.round, (f = a(s)) == null ? void 0 : f.round);
|
|
553
553
|
}
|
|
554
554
|
), l = y(
|
|
555
555
|
() => {
|
|
556
|
-
var
|
|
557
|
-
return n((
|
|
556
|
+
var f;
|
|
557
|
+
return n((f = a(s)) == null ? void 0 : f.disabled, i.disabled);
|
|
558
558
|
}
|
|
559
|
-
),
|
|
559
|
+
), p = y(
|
|
560
560
|
() => {
|
|
561
|
-
var
|
|
562
|
-
return n((
|
|
561
|
+
var f;
|
|
562
|
+
return n((f = a(s)) == null ? void 0 : f.readonly, i.readonly);
|
|
563
563
|
}
|
|
564
564
|
);
|
|
565
|
-
return { inputSize: e, inputRound: o, inputDisabled: l, inputReadonly:
|
|
565
|
+
return { inputSize: e, inputRound: o, inputDisabled: l, inputReadonly: p, id: t };
|
|
566
566
|
}
|
|
567
567
|
function Be() {
|
|
568
568
|
function i(n) {
|
|
@@ -577,7 +577,7 @@ function Be() {
|
|
|
577
577
|
return { getText: i };
|
|
578
578
|
}
|
|
579
579
|
function yn(i) {
|
|
580
|
-
const { getOption: n } = ze(), s =
|
|
580
|
+
const { getOption: n } = ze(), s = fe(Me, void 0), t = fe(_t, void 0), e = y(
|
|
581
581
|
() => {
|
|
582
582
|
var d, r;
|
|
583
583
|
return n(
|
|
@@ -597,18 +597,18 @@ function yn(i) {
|
|
|
597
597
|
var d;
|
|
598
598
|
return n((d = a(t)) == null ? void 0 : d.name, i.name);
|
|
599
599
|
}
|
|
600
|
-
),
|
|
600
|
+
), p = y(
|
|
601
601
|
() => {
|
|
602
602
|
var d;
|
|
603
603
|
return n((d = a(t)) == null ? void 0 : d.variant, i.variant);
|
|
604
604
|
}
|
|
605
|
-
),
|
|
605
|
+
), f = y(
|
|
606
606
|
() => {
|
|
607
|
-
var d, r,
|
|
607
|
+
var d, r, c;
|
|
608
608
|
return n(
|
|
609
609
|
(d = a(s)) == null ? void 0 : d.disabled,
|
|
610
610
|
(r = a(s)) == null ? void 0 : r.readonly,
|
|
611
|
-
(
|
|
611
|
+
(c = a(t)) == null ? void 0 : c.disabled,
|
|
612
612
|
i.disabled
|
|
613
613
|
);
|
|
614
614
|
}
|
|
@@ -617,13 +617,13 @@ function yn(i) {
|
|
|
617
617
|
radioSize: e,
|
|
618
618
|
radioForm: o,
|
|
619
619
|
radioName: l,
|
|
620
|
-
radioVariant:
|
|
621
|
-
radioDisabled:
|
|
620
|
+
radioVariant: p,
|
|
621
|
+
radioDisabled: f,
|
|
622
622
|
groupContext: t
|
|
623
623
|
};
|
|
624
624
|
}
|
|
625
625
|
function bn(i) {
|
|
626
|
-
const { getOption: n } = ze(), s =
|
|
626
|
+
const { getOption: n } = ze(), s = fe(kt, void 0);
|
|
627
627
|
return {
|
|
628
628
|
segmentedDisabled: y(
|
|
629
629
|
() => {
|
|
@@ -636,28 +636,28 @@ function bn(i) {
|
|
|
636
636
|
}
|
|
637
637
|
function xn() {
|
|
638
638
|
return {
|
|
639
|
-
parentContext:
|
|
639
|
+
parentContext: fe(qt, void 0)
|
|
640
640
|
};
|
|
641
641
|
}
|
|
642
642
|
function $n(i) {
|
|
643
|
-
const { getOption: n } = ze(), s =
|
|
643
|
+
const { getOption: n } = ze(), s = fe(Me, void 0), t = fe(Je, void 0), e = y(
|
|
644
644
|
() => {
|
|
645
645
|
var l;
|
|
646
646
|
return n(i.size, (l = a(s)) == null ? void 0 : l.size, "md");
|
|
647
647
|
}
|
|
648
648
|
), o = y(
|
|
649
649
|
() => {
|
|
650
|
-
var l,
|
|
650
|
+
var l, p;
|
|
651
651
|
return n(
|
|
652
652
|
(l = a(s)) == null ? void 0 : l.disabled,
|
|
653
|
-
(
|
|
653
|
+
(p = a(s)) == null ? void 0 : p.readonly,
|
|
654
654
|
i.disabled
|
|
655
655
|
);
|
|
656
656
|
}
|
|
657
657
|
);
|
|
658
658
|
return { switchSize: e, switchDisabled: o, id: t };
|
|
659
659
|
}
|
|
660
|
-
const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
660
|
+
const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */ B({
|
|
661
661
|
name: kn,
|
|
662
662
|
__name: "Button",
|
|
663
663
|
props: {
|
|
@@ -674,29 +674,29 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
674
674
|
},
|
|
675
675
|
emits: ["click"],
|
|
676
676
|
setup(i, { emit: n }) {
|
|
677
|
-
const s = n, t = i, { btnTextType: e, btnSize: o, btnType: l, btnRound:
|
|
678
|
-
const h = [], m = a(o),
|
|
679
|
-
return m !== "md" && h.push(`sq-button--${m}`),
|
|
680
|
-
}), r = y(() => t.loading ? De : t.icon),
|
|
677
|
+
const s = n, t = i, { btnTextType: e, btnSize: o, btnType: l, btnRound: p, btnDisabled: f } = mn(t), d = y(() => {
|
|
678
|
+
const h = [], m = a(o), u = a(l), k = a(p), b = a(e);
|
|
679
|
+
return m !== "md" && h.push(`sq-button--${m}`), u && h.push(`is-${u}`), k && h.push("is-round"), b && h.push("is-text"), b && t.bg && h.push("has-bg"), h;
|
|
680
|
+
}), r = y(() => t.loading ? De : t.icon), c = y(() => t.loading || a(f));
|
|
681
681
|
return (h, m) => (v(), _("button", {
|
|
682
682
|
class: j(["sq-button", d.value]),
|
|
683
|
-
disabled:
|
|
683
|
+
disabled: c.value,
|
|
684
684
|
form: t.form,
|
|
685
685
|
type: t.nativeType,
|
|
686
|
-
onClick: m[0] || (m[0] = (
|
|
686
|
+
onClick: m[0] || (m[0] = (u) => s("click", u))
|
|
687
687
|
}, [
|
|
688
688
|
D(a(be), {
|
|
689
689
|
size: a(o) === "lg" ? "md" : a(o)
|
|
690
690
|
}, {
|
|
691
691
|
default: N(() => [
|
|
692
|
-
r.value ? (v(),
|
|
692
|
+
r.value ? (v(), q(re(r.value), { key: 0 })) : L("", !0),
|
|
693
693
|
F(h.$slots, "default")
|
|
694
694
|
]),
|
|
695
695
|
_: 3
|
|
696
696
|
}, 8, ["size"])
|
|
697
697
|
], 10, _n));
|
|
698
698
|
}
|
|
699
|
-
}), qn = { class: "sq-button-group" }, Cn = "sq-button-group",
|
|
699
|
+
}), qn = { class: "sq-button-group" }, Cn = "sq-button-group", Go = /* @__PURE__ */ B({
|
|
700
700
|
name: Cn,
|
|
701
701
|
__name: "ButtonGroup",
|
|
702
702
|
props: {
|
|
@@ -725,7 +725,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
725
725
|
}, zn = ["textContent"], Bn = {
|
|
726
726
|
key: 1,
|
|
727
727
|
class: "sq-card-footer"
|
|
728
|
-
}, Mn = "sq-card",
|
|
728
|
+
}, Mn = "sq-card", Zo = /* @__PURE__ */ B({
|
|
729
729
|
name: Mn,
|
|
730
730
|
__name: "Card",
|
|
731
731
|
props: {
|
|
@@ -736,7 +736,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
736
736
|
const n = Ae(), s = i;
|
|
737
737
|
return (t, e) => (v(), _("section", wn, [
|
|
738
738
|
s.title || a(n).title ? (v(), _("div", Sn, [
|
|
739
|
-
|
|
739
|
+
z("h2", {
|
|
740
740
|
class: j({ "has-decorative": s.decorative }),
|
|
741
741
|
textContent: X(s.title)
|
|
742
742
|
}, null, 10, zn),
|
|
@@ -748,7 +748,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
748
748
|
])) : L("", !0)
|
|
749
749
|
]));
|
|
750
750
|
}
|
|
751
|
-
}), Ln = ["autofocus", "name", "form", "value", "disabled"], Tn = ["textContent"], An = "sq-checkbox", In = /* @__PURE__ */
|
|
751
|
+
}), Ln = ["autofocus", "name", "form", "value", "disabled"], Tn = ["textContent"], An = "sq-checkbox", In = /* @__PURE__ */ B({
|
|
752
752
|
name: An,
|
|
753
753
|
__name: "Checkbox",
|
|
754
754
|
props: /* @__PURE__ */ G({
|
|
@@ -771,12 +771,12 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
771
771
|
checkboxSize: e,
|
|
772
772
|
checkboxDisabled: o,
|
|
773
773
|
checkboxForm: l,
|
|
774
|
-
checkboxName:
|
|
775
|
-
checkboxVariant:
|
|
774
|
+
checkboxName: p,
|
|
775
|
+
checkboxVariant: f,
|
|
776
776
|
groupContext: d
|
|
777
|
-
} = gn(t), r = ie(i, "checked"),
|
|
778
|
-
const m = [],
|
|
779
|
-
return
|
|
777
|
+
} = gn(t), r = ie(i, "checked"), c = y(() => {
|
|
778
|
+
const m = [], u = a(e), k = a(o), b = a(f);
|
|
779
|
+
return u !== "md" && m.push(`sq-selection--${u}`), h.value && m.push("is-checked"), k && m.push("is-disabled"), b && m.push(`is-${b}`), m;
|
|
780
780
|
}), h = y(() => d ? a(d).list.includes(t.value) : r.value);
|
|
781
781
|
return te(h, (m) => {
|
|
782
782
|
if (r.value !== m) {
|
|
@@ -787,26 +787,26 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
787
787
|
h.value !== m && d && d.value.toggleItem(t.value);
|
|
788
788
|
}), oe(() => {
|
|
789
789
|
r.value = h.value;
|
|
790
|
-
}), (m,
|
|
791
|
-
class: j(["sq-selection sq-checkbox",
|
|
790
|
+
}), (m, u) => (v(), _("label", {
|
|
791
|
+
class: j(["sq-selection sq-checkbox", c.value])
|
|
792
792
|
}, [
|
|
793
|
-
|
|
793
|
+
ue(z("input", {
|
|
794
794
|
type: "checkbox",
|
|
795
795
|
autofocus: t.autofocus,
|
|
796
|
-
name: a(
|
|
796
|
+
name: a(p),
|
|
797
797
|
form: a(l),
|
|
798
798
|
value: t.value,
|
|
799
799
|
disabled: a(o),
|
|
800
|
-
"onUpdate:modelValue":
|
|
801
|
-
onChange:
|
|
800
|
+
"onUpdate:modelValue": u[0] || (u[0] = (k) => r.value = k),
|
|
801
|
+
onChange: u[1] || (u[1] = (k) => s("change", r.value))
|
|
802
802
|
}, null, 40, Ln), [
|
|
803
803
|
[at, r.value]
|
|
804
804
|
]),
|
|
805
|
-
a(
|
|
805
|
+
a(f) !== "solid" ? (v(), _("span", {
|
|
806
806
|
key: 0,
|
|
807
807
|
class: j(["sq-checkbox-box", { "is-indeterminate": t.indeterminate && !h.value }])
|
|
808
808
|
}, [
|
|
809
|
-
h.value ? (v(),
|
|
809
|
+
h.value ? (v(), q(a(dt), {
|
|
810
810
|
key: 0,
|
|
811
811
|
class: "sq-checkbox-inner"
|
|
812
812
|
})) : L("", !0)
|
|
@@ -818,7 +818,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
818
818
|
}, null, 8, Tn)) : L("", !0)
|
|
819
819
|
], 2));
|
|
820
820
|
}
|
|
821
|
-
}), Rn = { class: "sq-checkbox-group sq-selection-group" }, En = "sq-checkbox-group", Pn = /* @__PURE__ */
|
|
821
|
+
}), Rn = { class: "sq-checkbox-group sq-selection-group" }, En = "sq-checkbox-group", Pn = /* @__PURE__ */ B({
|
|
822
822
|
name: En,
|
|
823
823
|
__name: "CheckboxGroup",
|
|
824
824
|
props: {
|
|
@@ -832,7 +832,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
832
832
|
},
|
|
833
833
|
emits: ["change", "update:value"],
|
|
834
834
|
setup(i, { emit: n }) {
|
|
835
|
-
const { nextId: s } = Ne(), { getText: t } = Be(), e = n, o = i, l = w(o.value ?? []),
|
|
835
|
+
const { nextId: s } = Ne(), { getText: t } = Be(), e = n, o = i, l = w(o.value ?? []), p = y(() => o.name ?? `sq-checkbox-${s()}`), f = y(() => o.items.map((r) => typeof r == "string" ? {
|
|
836
836
|
text: r,
|
|
837
837
|
value: r
|
|
838
838
|
} : typeof r == "number" ? {
|
|
@@ -843,7 +843,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
843
843
|
ht,
|
|
844
844
|
w({
|
|
845
845
|
form: ne(o, "form"),
|
|
846
|
-
name:
|
|
846
|
+
name: p,
|
|
847
847
|
disabled: ne(o, "disabled"),
|
|
848
848
|
size: ne(o, "size"),
|
|
849
849
|
variant: ne(o, "variant"),
|
|
@@ -853,16 +853,16 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
853
853
|
), te(
|
|
854
854
|
() => o.value,
|
|
855
855
|
(r) => {
|
|
856
|
-
const
|
|
857
|
-
h.length ===
|
|
856
|
+
const c = r || [], h = [.../* @__PURE__ */ new Set([...c, l.value])];
|
|
857
|
+
h.length === c.length && h.length === l.value.length || (l.value = c);
|
|
858
858
|
}
|
|
859
859
|
);
|
|
860
860
|
function d(r) {
|
|
861
|
-
l.value.includes(r) ? l.value = l.value.filter((
|
|
861
|
+
l.value.includes(r) ? l.value = l.value.filter((c) => c !== r) : l.value.push(r), e("change", ge(l.value)), e("update:value", ge(l.value));
|
|
862
862
|
}
|
|
863
|
-
return (r,
|
|
863
|
+
return (r, c) => (v(), _("div", Rn, [
|
|
864
864
|
F(r.$slots, "default", {}, () => [
|
|
865
|
-
(v(!0), _(se, null, de(
|
|
865
|
+
(v(!0), _(se, null, de(f.value, (h, m) => (v(), q(a(In), {
|
|
866
866
|
key: m,
|
|
867
867
|
disabled: h.disabled === !0,
|
|
868
868
|
label: a(t)(h),
|
|
@@ -871,7 +871,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
871
871
|
])
|
|
872
872
|
]));
|
|
873
873
|
}
|
|
874
|
-
}), ht = Symbol("checkbox-group-context-keys"), Dn = ["innerHTML"], Nn = "sq-code",
|
|
874
|
+
}), ht = Symbol("checkbox-group-context-keys"), Dn = ["innerHTML"], Nn = "sq-code", Jo = /* @__PURE__ */ B({
|
|
875
875
|
name: Nn,
|
|
876
876
|
__name: "Code",
|
|
877
877
|
props: {
|
|
@@ -887,19 +887,19 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
887
887
|
lang: e.lang
|
|
888
888
|
}) : `<pre>${e.code}</pre>`);
|
|
889
889
|
return oe(async () => {
|
|
890
|
-
const
|
|
890
|
+
const p = e.lang ? [e.lang] : void 0, f = e.theme ? [e.theme] : void 0, d = await n(p, f);
|
|
891
891
|
if (t = d.key, o.value = d.highlighter, !o.value) {
|
|
892
892
|
console.warn("[squirrel-cloud/ui-vue] SqCode 组件代码高亮依赖 shiki");
|
|
893
893
|
return;
|
|
894
894
|
}
|
|
895
895
|
}), ye(() => {
|
|
896
896
|
t && s(t);
|
|
897
|
-
}), (
|
|
897
|
+
}), (p, f) => (v(), _("div", {
|
|
898
898
|
class: "sq-code",
|
|
899
899
|
innerHTML: l.value
|
|
900
900
|
}, null, 8, Dn));
|
|
901
901
|
}
|
|
902
|
-
}), Fn = "sq-mask", yt = /* @__PURE__ */
|
|
902
|
+
}), Fn = "sq-mask", yt = /* @__PURE__ */ B({
|
|
903
903
|
name: Fn,
|
|
904
904
|
inheritAttrs: !1,
|
|
905
905
|
__name: "Mask",
|
|
@@ -915,17 +915,17 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
915
915
|
setup(i, { emit: n }) {
|
|
916
916
|
const { nextZIndex: s } = Ze(), t = Ke();
|
|
917
917
|
let e;
|
|
918
|
-
const o = n, l = i,
|
|
919
|
-
|
|
920
|
-
const
|
|
921
|
-
m ? (e =
|
|
918
|
+
const o = n, l = i, p = w(0), f = w(!1), d = ie(i, "visible");
|
|
919
|
+
f.value = d.value, te(d, (m) => {
|
|
920
|
+
const u = document.scrollingElement;
|
|
921
|
+
m ? (e = u.style.overflow, u.style.overflow = "hidden", p.value = s(), f.value = !0, document.addEventListener("keydown", r)) : (u.style.overflow = e, document.removeEventListener("keydown", r));
|
|
922
922
|
}), ye(() => {
|
|
923
923
|
document.removeEventListener("keydown", r);
|
|
924
924
|
});
|
|
925
925
|
function r(m) {
|
|
926
926
|
m.key === "Escape" && l.keyboard && h();
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function c() {
|
|
929
929
|
l.maskCloseable && h();
|
|
930
930
|
}
|
|
931
931
|
function h() {
|
|
@@ -934,25 +934,25 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
934
934
|
return;
|
|
935
935
|
}
|
|
936
936
|
const m = l.beforeClose();
|
|
937
|
-
m instanceof Promise ? m.then((
|
|
938
|
-
|
|
937
|
+
m instanceof Promise ? m.then((u) => {
|
|
938
|
+
u && (d.value = !1);
|
|
939
939
|
}).catch(() => {
|
|
940
940
|
}) : m && (d.value = !1);
|
|
941
941
|
}
|
|
942
|
-
return (m,
|
|
942
|
+
return (m, u) => (v(), q(lt, { to: "body" }, [
|
|
943
943
|
D(_e, {
|
|
944
944
|
name: "sq-fade",
|
|
945
|
-
onBeforeEnter:
|
|
946
|
-
onAfterEnter:
|
|
947
|
-
onBeforeLeave:
|
|
948
|
-
onAfterLeave:
|
|
945
|
+
onBeforeEnter: u[0] || (u[0] = (k) => o("open")),
|
|
946
|
+
onAfterEnter: u[1] || (u[1] = (k) => o("opened")),
|
|
947
|
+
onBeforeLeave: u[2] || (u[2] = (k) => o("close")),
|
|
948
|
+
onAfterLeave: u[3] || (u[3] = (k) => o("closed"))
|
|
949
949
|
}, {
|
|
950
950
|
default: N(() => [
|
|
951
|
-
|
|
951
|
+
f.value ? ue((v(), _("div", pe({
|
|
952
952
|
key: 0,
|
|
953
953
|
class: "sq-mask",
|
|
954
|
-
style: { zIndex:
|
|
955
|
-
}, a(t), { onClick:
|
|
954
|
+
style: { zIndex: p.value }
|
|
955
|
+
}, a(t), { onClick: c }), [
|
|
956
956
|
F(m.$slots, "default")
|
|
957
957
|
], 16)), [
|
|
958
958
|
[ve, d.value]
|
|
@@ -962,14 +962,14 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
962
962
|
})
|
|
963
963
|
]));
|
|
964
964
|
}
|
|
965
|
-
}),
|
|
965
|
+
}), Vn = {
|
|
966
966
|
key: 0,
|
|
967
967
|
class: "sq-dialog-header"
|
|
968
|
-
},
|
|
968
|
+
}, On = { class: "sq-dialog-header-title" }, Hn = ["textContent"], Un = { class: "sq-dialog-body" }, jn = {
|
|
969
969
|
key: 1,
|
|
970
970
|
class: "sq-dialog-footer"
|
|
971
|
-
},
|
|
972
|
-
name:
|
|
971
|
+
}, Wn = "sq-dialog", Yn = /* @__PURE__ */ B({
|
|
972
|
+
name: Wn,
|
|
973
973
|
inheritAttrs: !1,
|
|
974
974
|
__name: "Dialog",
|
|
975
975
|
props: /* @__PURE__ */ G({
|
|
@@ -991,25 +991,25 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
991
991
|
}),
|
|
992
992
|
emits: /* @__PURE__ */ G(["open", "opened", "close", "closed"], ["update:visible"]),
|
|
993
993
|
setup(i, { emit: n }) {
|
|
994
|
-
const s = Ae(), t = Ke(), e = n, o = i, l = w(!1),
|
|
994
|
+
const s = Ae(), t = Ke(), e = n, o = i, l = w(!1), p = w(!1), f = ie(i, "visible"), d = y(() => !!o.title || !!s.header), r = y(() => {
|
|
995
995
|
const R = [];
|
|
996
996
|
return o.type && R.push(`is-${o.type}`), d.value && R.push("has-header"), [R];
|
|
997
|
-
}),
|
|
997
|
+
}), c = y(() => o.type ? Ge[o.type] : void 0), h = y(() => ({
|
|
998
998
|
type: o.type ?? "primary",
|
|
999
|
-
loading: l.value &&
|
|
1000
|
-
disabled: l.value && !
|
|
999
|
+
loading: l.value && p.value,
|
|
1000
|
+
disabled: l.value && !p.value,
|
|
1001
1001
|
...o.okButtonProps
|
|
1002
1002
|
})), m = y(() => ({
|
|
1003
1003
|
text: !0,
|
|
1004
1004
|
bg: !0,
|
|
1005
|
-
loading: l.value && !
|
|
1006
|
-
disabled: l.value &&
|
|
1005
|
+
loading: l.value && !p.value,
|
|
1006
|
+
disabled: l.value && p.value,
|
|
1007
1007
|
...o.cancelButtonProps
|
|
1008
|
-
})),
|
|
1009
|
-
() => h.value.loading || m.value.loading || !
|
|
1008
|
+
})), u = y(
|
|
1009
|
+
() => h.value.loading || m.value.loading || !f.value
|
|
1010
1010
|
);
|
|
1011
1011
|
function k(R) {
|
|
1012
|
-
if (
|
|
1012
|
+
if (u.value) return !1;
|
|
1013
1013
|
if (typeof R != "function") return !0;
|
|
1014
1014
|
const T = R();
|
|
1015
1015
|
return T instanceof Promise ? (l.value = !0, T.finally(() => {
|
|
@@ -1017,15 +1017,15 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1017
1017
|
})) : T;
|
|
1018
1018
|
}
|
|
1019
1019
|
async function b() {
|
|
1020
|
-
if (
|
|
1021
|
-
|
|
1020
|
+
if (u.value) return !1;
|
|
1021
|
+
p.value = !1, await k(o.beforeClose) && (f.value = !1);
|
|
1022
1022
|
}
|
|
1023
|
-
async function
|
|
1024
|
-
|
|
1023
|
+
async function C() {
|
|
1024
|
+
p.value = !0, await k(o.onOk) && (f.value = !1);
|
|
1025
1025
|
}
|
|
1026
|
-
return (R, T) => (v(),
|
|
1027
|
-
visible:
|
|
1028
|
-
"onUpdate:visible": T[0] || (T[0] = (A) =>
|
|
1026
|
+
return (R, T) => (v(), q(a(yt), {
|
|
1027
|
+
visible: f.value,
|
|
1028
|
+
"onUpdate:visible": T[0] || (T[0] = (A) => f.value = A),
|
|
1029
1029
|
"mask-closeable": o.maskCloseable,
|
|
1030
1030
|
keyboard: o.keyboard,
|
|
1031
1031
|
"before-close": () => k(o.beforeClose),
|
|
@@ -1035,38 +1035,39 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1035
1035
|
onClosed: T[4] || (T[4] = (A) => e("closed"))
|
|
1036
1036
|
}, {
|
|
1037
1037
|
default: N(() => [
|
|
1038
|
-
|
|
1038
|
+
z("div", {
|
|
1039
1039
|
class: j(["sq-dialog", [r.value, a(t).class]]),
|
|
1040
1040
|
style: K(a(t).style)
|
|
1041
1041
|
}, [
|
|
1042
|
-
d.value ? (v(), _("div",
|
|
1043
|
-
u.value ? (v(), C(ue(u.value), {
|
|
1044
|
-
key: 0,
|
|
1045
|
-
class: "sq-dialog-header-icon"
|
|
1046
|
-
})) : L("", !0),
|
|
1042
|
+
d.value ? (v(), _("div", Vn, [
|
|
1047
1043
|
F(R.$slots, "header", {}, () => [
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1044
|
+
z("span", On, [
|
|
1045
|
+
c.value ? (v(), q(re(c.value), {
|
|
1046
|
+
key: 0,
|
|
1047
|
+
class: "sq-dialog-header-icon"
|
|
1048
|
+
})) : L("", !0),
|
|
1049
|
+
z("span", {
|
|
1050
|
+
textContent: X(o.title)
|
|
1051
|
+
}, null, 8, Hn)
|
|
1052
|
+
])
|
|
1052
1053
|
]),
|
|
1053
1054
|
D(a(Xe), {
|
|
1054
1055
|
class: "sq-dialog-close",
|
|
1055
1056
|
onClick: b
|
|
1056
1057
|
})
|
|
1057
1058
|
])) : L("", !0),
|
|
1058
|
-
|
|
1059
|
+
z("div", Un, [
|
|
1059
1060
|
F(R.$slots, "default")
|
|
1060
1061
|
]),
|
|
1061
|
-
o.footer ? (v(), _("div",
|
|
1062
|
+
o.footer ? (v(), _("div", jn, [
|
|
1062
1063
|
F(R.$slots, "footer", {}, () => [
|
|
1063
|
-
D(a(le),
|
|
1064
|
+
D(a(le), pe(m.value, { onClick: b }), {
|
|
1064
1065
|
default: N(() => [
|
|
1065
1066
|
Te(X(o.cancelText), 1)
|
|
1066
1067
|
]),
|
|
1067
1068
|
_: 1
|
|
1068
1069
|
}, 16),
|
|
1069
|
-
D(a(le),
|
|
1070
|
+
D(a(le), pe(h.value, { onClick: C }), {
|
|
1070
1071
|
default: N(() => [
|
|
1071
1072
|
Te(X(o.okText), 1)
|
|
1072
1073
|
]),
|
|
@@ -1079,8 +1080,8 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1079
1080
|
_: 3
|
|
1080
1081
|
}, 8, ["visible", "mask-closeable", "keyboard", "before-close"]));
|
|
1081
1082
|
}
|
|
1082
|
-
}),
|
|
1083
|
-
name:
|
|
1083
|
+
}), Kn = "sq-divider", je = /* @__PURE__ */ B({
|
|
1084
|
+
name: Kn,
|
|
1084
1085
|
__name: "Divider",
|
|
1085
1086
|
props: {
|
|
1086
1087
|
direction: { default: "horizontal" },
|
|
@@ -1098,7 +1099,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1098
1099
|
class: j(["sq-divider", t.value]),
|
|
1099
1100
|
style: K({ "--divider-line-type": s.variant })
|
|
1100
1101
|
}, [
|
|
1101
|
-
a(n).default && s.direction !== "vertical" ? (v(),
|
|
1102
|
+
a(n).default && s.direction !== "vertical" ? (v(), q(a(be), {
|
|
1102
1103
|
key: 0,
|
|
1103
1104
|
ellipsis: s.ellipsis,
|
|
1104
1105
|
size: s.size
|
|
@@ -1110,8 +1111,8 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1110
1111
|
}, 8, ["ellipsis", "size"])) : L("", !0)
|
|
1111
1112
|
], 6));
|
|
1112
1113
|
}
|
|
1113
|
-
}),
|
|
1114
|
-
name:
|
|
1114
|
+
}), Xn = ["textContent", "for"], Gn = { class: "sq-form-item-content" }, Zn = ["textContent"], Jn = "sq-form-item", Qn = /* @__PURE__ */ B({
|
|
1115
|
+
name: Jn,
|
|
1115
1116
|
__name: "FormItem",
|
|
1116
1117
|
props: {
|
|
1117
1118
|
label: {},
|
|
@@ -1125,21 +1126,21 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1125
1126
|
const { nextId: n } = Ne(), s = i, t = w(""), e = w("");
|
|
1126
1127
|
qe(Je, t);
|
|
1127
1128
|
const o = y(() => {
|
|
1128
|
-
const
|
|
1129
|
-
return s.isRequired &&
|
|
1129
|
+
const f = [];
|
|
1130
|
+
return s.isRequired && f.push("is-required"), f;
|
|
1130
1131
|
}), l = y(() => ["input", "switch", "select"].includes(s.type));
|
|
1131
1132
|
te(
|
|
1132
1133
|
() => s.errorMsg,
|
|
1133
|
-
(
|
|
1134
|
-
|
|
1134
|
+
(f) => {
|
|
1135
|
+
f && (e.value = f);
|
|
1135
1136
|
}
|
|
1136
1137
|
), oe(() => {
|
|
1137
1138
|
l.value && (t.value = `sq-form-item-${n()}`);
|
|
1138
1139
|
});
|
|
1139
|
-
function
|
|
1140
|
+
function p() {
|
|
1140
1141
|
e.value = "";
|
|
1141
1142
|
}
|
|
1142
|
-
return (
|
|
1143
|
+
return (f, d) => (v(), _("div", {
|
|
1143
1144
|
class: "sq-form-item",
|
|
1144
1145
|
style: K({ "--form-label-width": s.labelWidth })
|
|
1145
1146
|
}, [
|
|
@@ -1148,19 +1149,19 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1148
1149
|
class: j(["sq-form-item-label", o.value]),
|
|
1149
1150
|
textContent: X(s.label),
|
|
1150
1151
|
for: s.type !== "custom" ? t.value : void 0
|
|
1151
|
-
}, null, 10,
|
|
1152
|
-
|
|
1153
|
-
F(
|
|
1152
|
+
}, null, 10, Xn)) : L("", !0),
|
|
1153
|
+
z("div", Gn, [
|
|
1154
|
+
F(f.$slots, "default"),
|
|
1154
1155
|
D(_e, {
|
|
1155
1156
|
appear: "",
|
|
1156
1157
|
name: "sq-zoom-top",
|
|
1157
|
-
onAfterLeave:
|
|
1158
|
+
onAfterLeave: p
|
|
1158
1159
|
}, {
|
|
1159
1160
|
default: N(() => [
|
|
1160
|
-
|
|
1161
|
+
ue(z("span", {
|
|
1161
1162
|
class: "sq-form-item-check",
|
|
1162
1163
|
textContent: X(e.value)
|
|
1163
|
-
}, null, 8,
|
|
1164
|
+
}, null, 8, Zn), [
|
|
1164
1165
|
[ve, s.errorMsg]
|
|
1165
1166
|
])
|
|
1166
1167
|
]),
|
|
@@ -1169,8 +1170,8 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1169
1170
|
])
|
|
1170
1171
|
], 4));
|
|
1171
1172
|
}
|
|
1172
|
-
}),
|
|
1173
|
-
name:
|
|
1173
|
+
}), es = "sq-form", Qo = /* @__PURE__ */ B({
|
|
1174
|
+
name: es,
|
|
1174
1175
|
__name: "Form",
|
|
1175
1176
|
props: {
|
|
1176
1177
|
round: { type: Boolean, default: void 0 },
|
|
@@ -1201,7 +1202,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1201
1202
|
readonly: ne(l, "readonly")
|
|
1202
1203
|
})
|
|
1203
1204
|
);
|
|
1204
|
-
const
|
|
1205
|
+
const p = w({}), f = w([]), d = w({}), r = w({}), c = y(() => {
|
|
1205
1206
|
const $ = [`is-${l.layout}`];
|
|
1206
1207
|
return l.size !== "md" && $.push(`sq-form--${l.size}`), l.requiredMark !== "hidden" && $.push(`required-${l.requiredMark}`), $;
|
|
1207
1208
|
}), h = y(() => ({
|
|
@@ -1229,14 +1230,14 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1229
1230
|
), oe(() => {
|
|
1230
1231
|
e = structuredClone(ge(l.formData)), r.value = structuredClone(ge(l.formData));
|
|
1231
1232
|
});
|
|
1232
|
-
function
|
|
1233
|
+
function u($) {
|
|
1233
1234
|
var x;
|
|
1234
1235
|
return (x = $.rule) == null ? void 0 : x.required;
|
|
1235
1236
|
}
|
|
1236
1237
|
function k($) {
|
|
1237
1238
|
if (d.value[$]) return De;
|
|
1238
|
-
if (
|
|
1239
|
-
if (
|
|
1239
|
+
if (f.value.includes($)) return ct;
|
|
1240
|
+
if (p.value[$])
|
|
1240
1241
|
return l.invalidStatus === "error" ? ut : rt;
|
|
1241
1242
|
}
|
|
1242
1243
|
async function b($, x, g, S = !0) {
|
|
@@ -1246,19 +1247,19 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1246
1247
|
if (W === "array" && !M.includes(x)) return;
|
|
1247
1248
|
if (W === "string" && M !== x) return;
|
|
1248
1249
|
}
|
|
1249
|
-
|
|
1250
|
+
f.value = f.value.filter((Q) => Q !== $), ae($), d.value[$] = new AbortController(), await Se();
|
|
1250
1251
|
const J = r.value[$];
|
|
1251
1252
|
let E = !1;
|
|
1252
|
-
const
|
|
1253
|
-
return g.validateFunc ? E = await R($, J, g, x) :
|
|
1253
|
+
const V = g.validateType ?? "string";
|
|
1254
|
+
return g.validateFunc ? E = await R($, J, g, x) : V === "string" ? E = T($, J, g) : V === "boolean" ? E = A($, J, g) : V === "list" && (E = Y($, J, g)), S && o("validate", $, E, ge(f.value)), d.value[$].signal.aborted || ae($), E;
|
|
1254
1255
|
}
|
|
1255
|
-
function
|
|
1256
|
-
if (
|
|
1256
|
+
function C($) {
|
|
1257
|
+
if (p.value[$]) return l.invalidStatus;
|
|
1257
1258
|
}
|
|
1258
1259
|
async function R($, x, g, S) {
|
|
1259
1260
|
const M = d.value[$].signal, W = await g.validateFunc(x, M, S);
|
|
1260
1261
|
if (W === void 0) {
|
|
1261
|
-
|
|
1262
|
+
f.value = f.value.filter((J) => J !== $), delete p.value[$];
|
|
1262
1263
|
return;
|
|
1263
1264
|
}
|
|
1264
1265
|
return W === !0 ? ee($) : W === !1 ? H($, "字段验证失败") : W ? H($, W) : ee($), W === !0 || typeof W == "string" && !W;
|
|
@@ -1273,57 +1274,57 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1273
1274
|
return g.required && (!x || !x.length) ? (H($, g.requiredText ?? "字段必填"), !1) : g.pattern && x && x.map((W) => W.toString()).map((W) => g.pattern.test(W)).includes(!1) ? (H($, g.patternText ?? "字段验证失败"), !1) : (ee($), !0);
|
|
1274
1275
|
}
|
|
1275
1276
|
function H($, x) {
|
|
1276
|
-
|
|
1277
|
+
f.value = f.value.filter((g) => g !== $), p.value[$] = x;
|
|
1277
1278
|
}
|
|
1278
1279
|
function ee($) {
|
|
1279
|
-
|
|
1280
|
+
f.value.push($), delete p.value[$];
|
|
1280
1281
|
}
|
|
1281
1282
|
function ae($) {
|
|
1282
1283
|
var x;
|
|
1283
1284
|
(x = d.value[$]) == null || x.abort(), delete d.value[$];
|
|
1284
1285
|
}
|
|
1285
|
-
function
|
|
1286
|
-
o("update:formData", structuredClone(e)),
|
|
1286
|
+
function O() {
|
|
1287
|
+
o("update:formData", structuredClone(e)), p.value = {}, f.value = [], o("validate", "SQFORM", !1, ge(f.value));
|
|
1287
1288
|
}
|
|
1288
1289
|
function P($ = !0) {
|
|
1289
1290
|
const g = ($ ? l.items : m.value).filter(
|
|
1290
|
-
(S) => S.type !== "custom" && S.rule && !
|
|
1291
|
+
(S) => S.type !== "custom" && S.rule && !f.value.includes(S.binding)
|
|
1291
1292
|
).map((S) => {
|
|
1292
1293
|
const M = S;
|
|
1293
1294
|
return b(M.binding, void 0, M.rule, !1);
|
|
1294
1295
|
});
|
|
1295
|
-
return Promise.all(g).then((S) => (o("validate", "SQFORM", !S.includes(!1), ge(
|
|
1296
|
+
return Promise.all(g).then((S) => (o("validate", "SQFORM", !S.includes(!1), ge(f.value)), S));
|
|
1296
1297
|
}
|
|
1297
|
-
return n({ resetFields:
|
|
1298
|
-
class: j(["sq-form",
|
|
1298
|
+
return n({ resetFields: O, validate: P }), ($, x) => (v(), _("form", {
|
|
1299
|
+
class: j(["sq-form", c.value]),
|
|
1299
1300
|
style: K(h.value),
|
|
1300
1301
|
onSubmit: x[0] || (x[0] = he(() => {
|
|
1301
1302
|
}, ["prevent"]))
|
|
1302
1303
|
}, [
|
|
1303
|
-
(v(!0), _(se, null, de(m.value, (g, S) => (v(),
|
|
1304
|
+
(v(!0), _(se, null, de(m.value, (g, S) => (v(), q(Qn, {
|
|
1304
1305
|
class: j(g.itemClass),
|
|
1305
1306
|
type: g.type,
|
|
1306
1307
|
key: S,
|
|
1307
1308
|
"label-width": g.labelWidth,
|
|
1308
1309
|
label: g.label,
|
|
1309
1310
|
"show-label": g.showLabel && l.layout !== "vertical",
|
|
1310
|
-
"is-required":
|
|
1311
|
-
"error-msg": l.hasFeedback ?
|
|
1311
|
+
"is-required": u(g),
|
|
1312
|
+
"error-msg": l.hasFeedback ? p.value[g.binding] : ""
|
|
1312
1313
|
}, {
|
|
1313
1314
|
default: N(() => [
|
|
1314
|
-
g.type === "input" ? (v(),
|
|
1315
|
+
g.type === "input" ? (v(), q(a(bt), pe({
|
|
1315
1316
|
key: 0,
|
|
1316
1317
|
ref_for: !0
|
|
1317
1318
|
}, g.props, {
|
|
1318
1319
|
name: g.name,
|
|
1319
|
-
status:
|
|
1320
|
+
status: C(g.binding),
|
|
1320
1321
|
"suffix-icon": k(g.binding),
|
|
1321
1322
|
value: r.value[g.binding],
|
|
1322
1323
|
"onUpdate:value": (M) => r.value[g.binding] = M,
|
|
1323
1324
|
onChange: (M) => b(g.binding, "change", g.rule),
|
|
1324
1325
|
onInput: (M) => b(g.binding, "input", g.rule),
|
|
1325
1326
|
onBlur: (M) => b(g.binding, "blur", g.rule)
|
|
1326
|
-
}), null, 16, ["name", "status", "suffix-icon", "value", "onUpdate:value", "onChange", "onInput", "onBlur"])) : g.type === "checkbox" ? (v(),
|
|
1327
|
+
}), null, 16, ["name", "status", "suffix-icon", "value", "onUpdate:value", "onChange", "onInput", "onBlur"])) : g.type === "checkbox" ? (v(), q(a(Pn), pe({
|
|
1327
1328
|
key: 1,
|
|
1328
1329
|
ref_for: !0
|
|
1329
1330
|
}, g.props, {
|
|
@@ -1331,7 +1332,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1331
1332
|
value: r.value[g.binding],
|
|
1332
1333
|
"onUpdate:value": (M) => r.value[g.binding] = M,
|
|
1333
1334
|
onChange: (M) => b(g.binding, "change", g.rule)
|
|
1334
|
-
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : g.type === "radio" ? (v(),
|
|
1335
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : g.type === "radio" ? (v(), q(a(ao), pe({
|
|
1335
1336
|
key: 2,
|
|
1336
1337
|
ref_for: !0
|
|
1337
1338
|
}, g.props, {
|
|
@@ -1339,7 +1340,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1339
1340
|
value: r.value[g.binding],
|
|
1340
1341
|
"onUpdate:value": (M) => r.value[g.binding] = M,
|
|
1341
1342
|
onChange: (M) => b(g.binding, "change", g.rule)
|
|
1342
|
-
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : g.type === "switch" ? (v(),
|
|
1343
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : g.type === "switch" ? (v(), q(a($o), pe({
|
|
1343
1344
|
key: 3,
|
|
1344
1345
|
ref_for: !0
|
|
1345
1346
|
}, g.props, {
|
|
@@ -1348,7 +1349,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1348
1349
|
checked: r.value[g.binding],
|
|
1349
1350
|
"onUpdate:checked": (M) => r.value[g.binding] = M,
|
|
1350
1351
|
onChange: (M) => b(g.binding, "change", g.rule)
|
|
1351
|
-
}), null, 16, ["name", "loading", "checked", "onUpdate:checked", "onChange"])) : g.type === "select" ? (v(),
|
|
1352
|
+
}), null, 16, ["name", "loading", "checked", "onUpdate:checked", "onChange"])) : g.type === "select" ? (v(), q(a(mo), pe({
|
|
1352
1353
|
key: 4,
|
|
1353
1354
|
ref_for: !0
|
|
1354
1355
|
}, g.props, {
|
|
@@ -1362,17 +1363,17 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1362
1363
|
}, 1032, ["class", "type", "label-width", "label", "show-label", "is-required", "error-msg"]))), 128))
|
|
1363
1364
|
], 38));
|
|
1364
1365
|
}
|
|
1365
|
-
}), Me = Symbol("form-context-keys"), Je = Symbol("form-item-id-keys"),
|
|
1366
|
+
}), Me = Symbol("form-context-keys"), Je = Symbol("form-item-id-keys"), ts = {
|
|
1366
1367
|
key: 0,
|
|
1367
1368
|
class: "sq-image-mask"
|
|
1368
|
-
},
|
|
1369
|
+
}, ns = {
|
|
1369
1370
|
key: 0,
|
|
1370
1371
|
class: "sq-image-picture"
|
|
1371
|
-
},
|
|
1372
|
+
}, ss = ["srcset", "media", "type"], os = ["crossorigin", "alt", "src"], as = {
|
|
1372
1373
|
key: 2,
|
|
1373
1374
|
class: "sq-image-error"
|
|
1374
|
-
},
|
|
1375
|
-
name:
|
|
1375
|
+
}, ls = "sq-image", st = /* @__PURE__ */ B({
|
|
1376
|
+
name: ls,
|
|
1376
1377
|
__name: "Image",
|
|
1377
1378
|
props: {
|
|
1378
1379
|
alt: { default: "图片" },
|
|
@@ -1387,37 +1388,37 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1387
1388
|
},
|
|
1388
1389
|
emits: ["load", "error"],
|
|
1389
1390
|
setup(i, { emit: n }) {
|
|
1390
|
-
const s = new IntersectionObserver(k), t = n, e = i, o = w(!1), l = w(e.src),
|
|
1391
|
-
height:
|
|
1392
|
-
aspectRatio:
|
|
1391
|
+
const s = new IntersectionObserver(k), t = n, e = i, o = w(!1), l = w(e.src), p = w(!1), f = w(!1), d = w(!1), r = ce(null), c = y(() => o.value && !p.value), h = y(() => ({
|
|
1392
|
+
height: c.value ? void 0 : "var(--image-placeholder-height)",
|
|
1393
|
+
aspectRatio: c.value ? void 0 : e.aspectRatio
|
|
1393
1394
|
}));
|
|
1394
1395
|
te(
|
|
1395
1396
|
() => e.src,
|
|
1396
1397
|
() => {
|
|
1397
|
-
|
|
1398
|
+
p.value = !1, o.value = !1, l.value = e.src;
|
|
1398
1399
|
}
|
|
1399
1400
|
), oe(() => {
|
|
1400
1401
|
s.observe(r.value);
|
|
1401
1402
|
}), ye(() => {
|
|
1402
1403
|
s.disconnect();
|
|
1403
1404
|
});
|
|
1404
|
-
function m(
|
|
1405
|
-
o.value = !0, t("load",
|
|
1405
|
+
function m(C) {
|
|
1406
|
+
o.value = !0, t("load", C);
|
|
1406
1407
|
}
|
|
1407
|
-
function
|
|
1408
|
+
function u(C) {
|
|
1408
1409
|
if (l.value !== e.fallback && e.fallback) {
|
|
1409
1410
|
l.value = e.fallback;
|
|
1410
1411
|
return;
|
|
1411
1412
|
}
|
|
1412
|
-
|
|
1413
|
+
p.value = !0, o.value = !0, t("error", C);
|
|
1413
1414
|
}
|
|
1414
|
-
function k(
|
|
1415
|
-
|
|
1415
|
+
function k(C) {
|
|
1416
|
+
C[0].isIntersecting && (f.value = !0, s.disconnect());
|
|
1416
1417
|
}
|
|
1417
1418
|
function b() {
|
|
1418
1419
|
d.value = !0;
|
|
1419
1420
|
}
|
|
1420
|
-
return (
|
|
1421
|
+
return (C, R) => (v(), _("div", {
|
|
1421
1422
|
class: "sq-image",
|
|
1422
1423
|
style: K(h.value),
|
|
1423
1424
|
ref_key: "imgRef",
|
|
@@ -1425,39 +1426,39 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1425
1426
|
}, [
|
|
1426
1427
|
D(_e, { name: "sq-fade" }, {
|
|
1427
1428
|
default: N(() => [
|
|
1428
|
-
o.value ? L("", !0) : (v(), _("div",
|
|
1429
|
+
o.value ? L("", !0) : (v(), _("div", ts))
|
|
1429
1430
|
]),
|
|
1430
1431
|
_: 1
|
|
1431
1432
|
}),
|
|
1432
|
-
!
|
|
1433
|
+
!p.value && f.value ? (v(), _("picture", ns, [
|
|
1433
1434
|
(v(!0), _(se, null, de(e.source, (T, A) => (v(), _("source", {
|
|
1434
1435
|
key: A,
|
|
1435
1436
|
srcset: T.src,
|
|
1436
1437
|
media: T.media,
|
|
1437
1438
|
type: T.type
|
|
1438
|
-
}, null, 8,
|
|
1439
|
-
|
|
1439
|
+
}, null, 8, ss))), 128)),
|
|
1440
|
+
z("img", {
|
|
1440
1441
|
style: K({ objectFit: e.objectFit }),
|
|
1441
1442
|
crossorigin: e.crossorigin,
|
|
1442
1443
|
alt: e.alt,
|
|
1443
1444
|
src: l.value,
|
|
1444
1445
|
onLoad: m,
|
|
1445
|
-
onError:
|
|
1446
|
-
}, null, 44,
|
|
1446
|
+
onError: u
|
|
1447
|
+
}, null, 44, os)
|
|
1447
1448
|
])) : L("", !0),
|
|
1448
|
-
!
|
|
1449
|
+
!p.value && f.value && e.preview ? (v(), _("div", {
|
|
1449
1450
|
key: 1,
|
|
1450
1451
|
class: "sq-image-control",
|
|
1451
1452
|
onClick: b
|
|
1452
1453
|
}, [
|
|
1453
|
-
D(a(
|
|
1454
|
+
D(a(pt))
|
|
1454
1455
|
])) : L("", !0),
|
|
1455
|
-
|
|
1456
|
-
F(
|
|
1457
|
-
R[1] || (R[1] =
|
|
1456
|
+
p.value ? (v(), _("div", as, [
|
|
1457
|
+
F(C.$slots, "error", {}, () => [
|
|
1458
|
+
R[1] || (R[1] = z("span", null, "图片加载失败", -1))
|
|
1458
1459
|
])
|
|
1459
1460
|
])) : L("", !0),
|
|
1460
|
-
e.preview ? (v(),
|
|
1461
|
+
e.preview ? (v(), q(a(us), {
|
|
1461
1462
|
key: 3,
|
|
1462
1463
|
"src-list": [l.value],
|
|
1463
1464
|
visible: d.value,
|
|
@@ -1465,8 +1466,8 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1465
1466
|
}, null, 8, ["src-list", "visible"])) : L("", !0)
|
|
1466
1467
|
], 4));
|
|
1467
1468
|
}
|
|
1468
|
-
}),
|
|
1469
|
-
name:
|
|
1469
|
+
}), is = ["src"], rs = "sq-image-viewer", us = /* @__PURE__ */ B({
|
|
1470
|
+
name: rs,
|
|
1470
1471
|
__name: "ImageViewer",
|
|
1471
1472
|
props: /* @__PURE__ */ G({
|
|
1472
1473
|
srcList: {},
|
|
@@ -1491,17 +1492,17 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1491
1492
|
transform: e,
|
|
1492
1493
|
imgRef: o,
|
|
1493
1494
|
handlePointerdown: l,
|
|
1494
|
-
handlePointerup:
|
|
1495
|
-
handleTouchstart:
|
|
1495
|
+
handlePointerup: p,
|
|
1496
|
+
handleTouchstart: f,
|
|
1496
1497
|
handleTouchend: d,
|
|
1497
1498
|
calcPointDiff: r,
|
|
1498
|
-
moveImage:
|
|
1499
|
+
moveImage: c,
|
|
1499
1500
|
getLength: h,
|
|
1500
1501
|
getImagePoint: m
|
|
1501
|
-
} = mt(),
|
|
1502
|
+
} = mt(), u = { x: 0, y: 0 };
|
|
1502
1503
|
let k = 0;
|
|
1503
|
-
const b = i,
|
|
1504
|
-
const U =
|
|
1504
|
+
const b = i, C = w(!1), R = w(!1), T = w(0), A = w(0), Y = w(!0), H = ie(i, "visible"), ee = y(() => b.srcList[A.value]), ae = y(() => {
|
|
1505
|
+
const U = C.value ? -1 : 1, I = R.value ? -1 : 1;
|
|
1505
1506
|
return {
|
|
1506
1507
|
transform: [
|
|
1507
1508
|
`scale(${t.value * U}, ${t.value * I})`,
|
|
@@ -1512,36 +1513,36 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1512
1513
|
transition: Y.value ? void 0 : "none"
|
|
1513
1514
|
};
|
|
1514
1515
|
});
|
|
1515
|
-
function
|
|
1516
|
+
function O() {
|
|
1516
1517
|
Y.value = !0;
|
|
1517
1518
|
}
|
|
1518
1519
|
function P(U) {
|
|
1519
1520
|
U.deltaY < 0 ? W(U.x, U.y) : J(U.x, U.y);
|
|
1520
1521
|
}
|
|
1521
1522
|
function $(U) {
|
|
1522
|
-
!n.value || !b.moveable || U.pointerType === "touch" ||
|
|
1523
|
+
!n.value || !b.moveable || U.pointerType === "touch" || c(U.x, U.y);
|
|
1523
1524
|
}
|
|
1524
1525
|
function x(U) {
|
|
1525
1526
|
if (U.touches.length === 1) {
|
|
1526
1527
|
if (!n.value || !b.moveable) return;
|
|
1527
1528
|
const I = U.touches[0];
|
|
1528
|
-
|
|
1529
|
+
c(I.screenX, I.screenY);
|
|
1529
1530
|
} else if (U.touches.length === 2) {
|
|
1530
1531
|
if (!s.value) return;
|
|
1531
1532
|
n.value = !1, Y.value = !1;
|
|
1532
1533
|
const I = U.touches.item(0), Z = U.touches.item(1), xe = h(I, Z), Le = xe / s.value;
|
|
1533
1534
|
let ke = t.value * Le;
|
|
1534
1535
|
ke = Math.min(b.maxScale, ke), ke = Math.max(b.minScale, ke);
|
|
1535
|
-
const
|
|
1536
|
-
E(ke,
|
|
1536
|
+
const Oe = (I.clientX + Z.clientX) / 2, He = (I.clientY + Z.clientY) / 2;
|
|
1537
|
+
E(ke, Oe, He), s.value = xe;
|
|
1537
1538
|
}
|
|
1538
1539
|
}
|
|
1539
1540
|
function g(U) {
|
|
1540
1541
|
const Z = U.target.getBoundingClientRect(), xe = window.innerWidth, Le = window.innerHeight;
|
|
1541
|
-
|
|
1542
|
+
u.x = xe / Z.width, u.y = Le / Z.height, k = Math.min(u.x, u.y), t.value = Math.min(k, 1);
|
|
1542
1543
|
}
|
|
1543
1544
|
function S() {
|
|
1544
|
-
t.value = Math.min(
|
|
1545
|
+
t.value = Math.min(u.x, u.y, 1), C.value = !1, R.value = !1, T.value = 0, e.value = { x: 0, y: 0 };
|
|
1545
1546
|
}
|
|
1546
1547
|
function M(U) {
|
|
1547
1548
|
A.value += U;
|
|
@@ -1565,18 +1566,18 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1565
1566
|
Y.value = !1;
|
|
1566
1567
|
const xe = t.value, [Le, ke] = m(I, Z);
|
|
1567
1568
|
t.value = U, Se(() => {
|
|
1568
|
-
const [
|
|
1569
|
-
e.value.x +=
|
|
1569
|
+
const [Oe, He] = r(Le, ke, I, Z, xe);
|
|
1570
|
+
e.value.x += Oe * 2, e.value.y += He * 2, Y.value = !0;
|
|
1570
1571
|
});
|
|
1571
1572
|
}
|
|
1572
|
-
function
|
|
1573
|
-
t.value = Math.min(
|
|
1573
|
+
function V() {
|
|
1574
|
+
t.value = Math.min(u.x, u.y), e.value = { x: 0, y: 0 };
|
|
1574
1575
|
}
|
|
1575
1576
|
function Q() {
|
|
1576
1577
|
t.value = 1, e.value = { x: 0, y: 0 };
|
|
1577
1578
|
}
|
|
1578
1579
|
function Ce() {
|
|
1579
|
-
|
|
1580
|
+
C.value = !C.value;
|
|
1580
1581
|
}
|
|
1581
1582
|
function Ie() {
|
|
1582
1583
|
R.value = !R.value;
|
|
@@ -1584,10 +1585,10 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1584
1585
|
function Re(U) {
|
|
1585
1586
|
T.value += U;
|
|
1586
1587
|
}
|
|
1587
|
-
function
|
|
1588
|
+
function Ve() {
|
|
1588
1589
|
H.value = !1;
|
|
1589
1590
|
}
|
|
1590
|
-
return (U, I) => (v(),
|
|
1591
|
+
return (U, I) => (v(), q(a(yt), {
|
|
1591
1592
|
class: "sq-image-viewer-mask",
|
|
1592
1593
|
visible: H.value,
|
|
1593
1594
|
"onUpdate:visible": I[10] || (I[10] = (Z) => H.value = Z),
|
|
@@ -1595,13 +1596,13 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1595
1596
|
"mask-closeable": b.maskCloseable,
|
|
1596
1597
|
onWheelPassive: P,
|
|
1597
1598
|
onPointermove: $,
|
|
1598
|
-
onPointerup: a(
|
|
1599
|
+
onPointerup: a(p),
|
|
1599
1600
|
onTouchmovePassive: x,
|
|
1600
|
-
onTouchend: I[11] || (I[11] = () => a(d)(
|
|
1601
|
+
onTouchend: I[11] || (I[11] = () => a(d)(O)),
|
|
1601
1602
|
onClosed: S
|
|
1602
1603
|
}, {
|
|
1603
1604
|
default: N(() => [
|
|
1604
|
-
|
|
1605
|
+
z("img", {
|
|
1605
1606
|
ref_key: "imgRef",
|
|
1606
1607
|
ref: o,
|
|
1607
1608
|
style: K(ae.value),
|
|
@@ -1615,19 +1616,19 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1615
1616
|
["prevent"]
|
|
1616
1617
|
)),
|
|
1617
1618
|
onTouchstartPassive: I[2] || (I[2] = //@ts-ignore
|
|
1618
|
-
(...Z) => a(
|
|
1619
|
-
}, null, 44,
|
|
1619
|
+
(...Z) => a(f) && a(f)(...Z))
|
|
1620
|
+
}, null, 44, is),
|
|
1620
1621
|
D(a(le), {
|
|
1621
1622
|
class: "sq-image-viewer-close",
|
|
1622
1623
|
round: "",
|
|
1623
1624
|
icon: a(Xe),
|
|
1624
|
-
onClick: he(
|
|
1625
|
+
onClick: he(Ve, ["stop"])
|
|
1625
1626
|
}, null, 8, ["icon"]),
|
|
1626
1627
|
b.srcList.length > 1 ? (v(), _(se, { key: 0 }, [
|
|
1627
1628
|
D(a(le), {
|
|
1628
1629
|
class: "sq-image-viewer-prev",
|
|
1629
1630
|
round: "",
|
|
1630
|
-
icon: a(
|
|
1631
|
+
icon: a(ft),
|
|
1631
1632
|
disabled: A.value === 0,
|
|
1632
1633
|
onClick: I[3] || (I[3] = (Z) => M(-1))
|
|
1633
1634
|
}, null, 8, ["icon", "disabled"]),
|
|
@@ -1749,7 +1750,7 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1749
1750
|
D(a(le), {
|
|
1750
1751
|
text: "",
|
|
1751
1752
|
icon: a(Dt),
|
|
1752
|
-
onClick:
|
|
1753
|
+
onClick: V
|
|
1753
1754
|
}, null, 8, ["icon"])
|
|
1754
1755
|
]),
|
|
1755
1756
|
_: 1
|
|
@@ -1759,8 +1760,8 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1759
1760
|
_: 1
|
|
1760
1761
|
}, 8, ["visible", "keyboard", "mask-closeable", "onPointerup"]));
|
|
1761
1762
|
}
|
|
1762
|
-
}),
|
|
1763
|
-
name:
|
|
1763
|
+
}), cs = ["src"], ds = "sq-image-crop", ea = /* @__PURE__ */ B({
|
|
1764
|
+
name: ds,
|
|
1764
1765
|
__name: "ImageCrop",
|
|
1765
1766
|
props: {
|
|
1766
1767
|
aspectRatio: { default: 1 },
|
|
@@ -1774,17 +1775,17 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1774
1775
|
scale: e,
|
|
1775
1776
|
transform: o,
|
|
1776
1777
|
imgRef: l,
|
|
1777
|
-
handlePointerdown:
|
|
1778
|
-
handlePointerup:
|
|
1778
|
+
handlePointerdown: p,
|
|
1779
|
+
handlePointerup: f,
|
|
1779
1780
|
handleTouchstart: d,
|
|
1780
1781
|
handleTouchend: r,
|
|
1781
|
-
calcPointDiff:
|
|
1782
|
+
calcPointDiff: c,
|
|
1782
1783
|
moveImage: h,
|
|
1783
1784
|
getLength: m,
|
|
1784
|
-
getImagePoint:
|
|
1785
|
+
getImagePoint: u
|
|
1785
1786
|
} = mt();
|
|
1786
1787
|
let k = 0;
|
|
1787
|
-
const b = i,
|
|
1788
|
+
const b = i, C = ce(null), R = y(() => ({
|
|
1788
1789
|
transform: `scale(${e.value})`,
|
|
1789
1790
|
marginInlineStart: `${o.value.x}px`,
|
|
1790
1791
|
marginBlockStart: `${o.value.y}px`
|
|
@@ -1795,15 +1796,15 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1795
1796
|
Se(T);
|
|
1796
1797
|
}
|
|
1797
1798
|
), oe(() => {
|
|
1798
|
-
document.addEventListener("pointermove", Y), document.addEventListener("pointerup",
|
|
1799
|
+
document.addEventListener("pointermove", Y), document.addEventListener("pointerup", f);
|
|
1799
1800
|
}), ye(() => {
|
|
1800
|
-
document.removeEventListener("pointermove", Y), document.removeEventListener("pointerup",
|
|
1801
|
+
document.removeEventListener("pointermove", Y), document.removeEventListener("pointerup", f);
|
|
1801
1802
|
});
|
|
1802
1803
|
function T() {
|
|
1803
1804
|
const x = l.value;
|
|
1804
1805
|
if (!x) return;
|
|
1805
1806
|
o.value = { x: 0, y: 0 };
|
|
1806
|
-
const g =
|
|
1807
|
+
const g = C.value.getBoundingClientRect(), S = x.naturalWidth, M = x.naturalHeight, W = g.width / S, J = g.height / M;
|
|
1807
1808
|
k = Math.max(W, J), e.value = k;
|
|
1808
1809
|
}
|
|
1809
1810
|
function A(x) {
|
|
@@ -1823,30 +1824,30 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1823
1824
|
const g = x.touches.item(0), S = x.touches.item(1), M = m(g, S), W = M / t.value;
|
|
1824
1825
|
let J = e.value * W;
|
|
1825
1826
|
J = Math.min(b.maxScale, J), J = Math.max(k, J);
|
|
1826
|
-
const E = (g.clientX + S.clientX) / 2,
|
|
1827
|
-
|
|
1827
|
+
const E = (g.clientX + S.clientX) / 2, V = (g.clientY + S.clientY) / 2;
|
|
1828
|
+
O(E, V, J), t.value = M;
|
|
1828
1829
|
}
|
|
1829
1830
|
}
|
|
1830
1831
|
function ee(x, g) {
|
|
1831
1832
|
if (e.value >= b.maxScale) return;
|
|
1832
1833
|
const S = Math.min(b.maxScale, e.value * (1 + 0.1));
|
|
1833
|
-
|
|
1834
|
+
O(x, g, S);
|
|
1834
1835
|
}
|
|
1835
1836
|
function ae(x, g) {
|
|
1836
1837
|
if (e.value <= k) return;
|
|
1837
1838
|
const S = Math.max(k, e.value / (1 + 0.1));
|
|
1838
|
-
|
|
1839
|
+
O(x, g, S);
|
|
1839
1840
|
}
|
|
1840
|
-
function
|
|
1841
|
-
const M = e.value, [W, J] =
|
|
1841
|
+
function O(x, g, S) {
|
|
1842
|
+
const M = e.value, [W, J] = u(x, g);
|
|
1842
1843
|
e.value = S, Se(() => {
|
|
1843
|
-
const [E,
|
|
1844
|
-
o.value.x += E * 2, o.value.y +=
|
|
1844
|
+
const [E, V] = c(W, J, x, g, M);
|
|
1845
|
+
o.value.x += E * 2, o.value.y += V * 2, P();
|
|
1845
1846
|
});
|
|
1846
1847
|
}
|
|
1847
1848
|
function P() {
|
|
1848
1849
|
Se(() => {
|
|
1849
|
-
const x = l.value.getBoundingClientRect(), g =
|
|
1850
|
+
const x = l.value.getBoundingClientRect(), g = C.value.getBoundingClientRect(), S = x.left >= g.left, M = x.right <= g.right;
|
|
1850
1851
|
S ? o.value.x -= (x.left - g.left) * 2 : M && (o.value.x += (g.right - x.right) * 2);
|
|
1851
1852
|
const W = x.top >= g.top, J = x.bottom <= g.bottom;
|
|
1852
1853
|
W ? o.value.y -= (x.top - g.top) * 2 : J && (o.value.y += (g.bottom - x.bottom) * 2);
|
|
@@ -1855,22 +1856,22 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1855
1856
|
async function $(x = "base64") {
|
|
1856
1857
|
if (!b.src) return;
|
|
1857
1858
|
const g = l.value.naturalWidth, S = l.value.naturalHeight, M = g / S, J = g > S && M < b.aspectRatio || g < S && M > b.aspectRatio ? g / S : 1, E = e.value / k / J;
|
|
1858
|
-
let
|
|
1859
|
-
|
|
1860
|
-
let Q =
|
|
1861
|
-
const Ce = l.value.getBoundingClientRect(), Ie =
|
|
1859
|
+
let V = document.createElement("canvas");
|
|
1860
|
+
V.style.display = "none", b.aspectRatio >= M ? (V.width = g, V.height = g / b.aspectRatio) : (V.width = S * b.aspectRatio, V.height = S);
|
|
1861
|
+
let Q = V.getContext("2d");
|
|
1862
|
+
const Ce = l.value.getBoundingClientRect(), Ie = C.value.getBoundingClientRect(), Re = (Ce.left - Ie.left) / e.value, Ve = (Ce.top - Ie.top) / e.value;
|
|
1862
1863
|
return Q == null || Q.drawImage(
|
|
1863
1864
|
l.value,
|
|
1864
1865
|
Re * E,
|
|
1865
|
-
|
|
1866
|
+
Ve * E,
|
|
1866
1867
|
g * E,
|
|
1867
1868
|
S * E
|
|
1868
1869
|
), new Promise((U) => {
|
|
1869
|
-
x === "base64" ? U(
|
|
1870
|
+
x === "base64" ? U(V.toDataURL("image/png")) : V == null || V.toBlob((I) => {
|
|
1870
1871
|
U(I ?? void 0);
|
|
1871
1872
|
}, "image/png");
|
|
1872
1873
|
}).finally(() => {
|
|
1873
|
-
Q = void 0,
|
|
1874
|
+
Q = void 0, V = void 0;
|
|
1874
1875
|
});
|
|
1875
1876
|
}
|
|
1876
1877
|
return n({ cropImageAsync: $ }), (x, g) => (v(), _("div", {
|
|
@@ -1878,17 +1879,17 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1878
1879
|
style: K({ "--image-crop-ratio": b.aspectRatio }),
|
|
1879
1880
|
onWheel: he(A, ["prevent", "stop"]),
|
|
1880
1881
|
onPointerdown: g[0] || (g[0] = //@ts-ignore
|
|
1881
|
-
(...S) => a(
|
|
1882
|
+
(...S) => a(p) && a(p)(...S)),
|
|
1882
1883
|
onTouchstartPassive: g[1] || (g[1] = //@ts-ignore
|
|
1883
1884
|
(...S) => a(d) && a(d)(...S)),
|
|
1884
1885
|
onTouchmovePassive: H,
|
|
1885
1886
|
onTouchend: g[2] || (g[2] = () => a(r)())
|
|
1886
1887
|
}, [
|
|
1887
|
-
|
|
1888
|
+
z("div", {
|
|
1888
1889
|
class: "sq-image-crop-cropper",
|
|
1889
1890
|
style: K(`${b.aspectRatio > 1 ? "width" : "height"}: 100%`),
|
|
1890
1891
|
ref_key: "cropperRef",
|
|
1891
|
-
ref:
|
|
1892
|
+
ref: C
|
|
1892
1893
|
}, null, 4),
|
|
1893
1894
|
b.src ? (v(), _("img", {
|
|
1894
1895
|
key: 0,
|
|
@@ -1897,14 +1898,14 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1897
1898
|
style: K(R.value),
|
|
1898
1899
|
src: b.src,
|
|
1899
1900
|
onLoad: T
|
|
1900
|
-
}, null, 44,
|
|
1901
|
+
}, null, 44, cs)) : L("", !0)
|
|
1901
1902
|
], 36));
|
|
1902
1903
|
}
|
|
1903
|
-
}),
|
|
1904
|
+
}), ps = {
|
|
1904
1905
|
key: 0,
|
|
1905
1906
|
class: "sq-input-prefix"
|
|
1906
|
-
}, fs = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode"],
|
|
1907
|
-
name:
|
|
1907
|
+
}, fs = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode"], vs = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode", "rows", "cols"], ms = { class: "sq-input-suffix" }, gs = "sq-input", bt = /* @__PURE__ */ B({
|
|
1908
|
+
name: gs,
|
|
1908
1909
|
__name: "Input",
|
|
1909
1910
|
props: /* @__PURE__ */ G({
|
|
1910
1911
|
status: {},
|
|
@@ -1934,14 +1935,14 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1934
1935
|
}),
|
|
1935
1936
|
emits: /* @__PURE__ */ G(["click", "focus", "blur", "input", "change", "clear"], ["update:value"]),
|
|
1936
1937
|
setup(i, { expose: n, emit: s }) {
|
|
1937
|
-
const t = Ae(), e = s, o = i, { inputSize: l, inputRound:
|
|
1938
|
-
const E = [],
|
|
1939
|
-
return
|
|
1940
|
-
}), b = y(() => a(m) ? Nt :
|
|
1938
|
+
const t = Ae(), e = s, o = i, { inputSize: l, inputRound: p, inputDisabled: f, inputReadonly: d, id: r } = hn(o), c = ie(i, "value"), h = w(!1), m = w(!1), u = ce(null), k = y(() => {
|
|
1939
|
+
const E = [], V = a(l), Q = a(p), Ce = a(ae);
|
|
1940
|
+
return V !== "md" && E.push(`sq-input--${V}`), o.status && E.push(`is-${o.status}`), Q && E.push("is-round"), Ce && E.push("is-disabled"), E;
|
|
1941
|
+
}), b = y(() => a(m) ? Nt : pt), C = y(() => a(m) ? "text" : o.type), R = y(() => t.prefix || o.prefixIcon), T = y(() => a(h) && a(c).length), A = y(
|
|
1941
1942
|
() => o.type === "password" && a(T)
|
|
1942
1943
|
), Y = y(() => o.clearable && a(T)), H = y(() => o.loading ? De : o.suffixIcon), ee = y(
|
|
1943
1944
|
() => a(A) || a(Y) || a(H) || t.suffix
|
|
1944
|
-
), ae = y(() => o.loading || a(
|
|
1945
|
+
), ae = y(() => o.loading || a(f)), O = y(() => {
|
|
1945
1946
|
if (o.type === "textarea")
|
|
1946
1947
|
return a(ae) || a(d) ? "none" : o.resize;
|
|
1947
1948
|
});
|
|
@@ -1958,38 +1959,38 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1958
1959
|
e("click", E);
|
|
1959
1960
|
}
|
|
1960
1961
|
function S() {
|
|
1961
|
-
|
|
1962
|
+
c.value = "", e("clear");
|
|
1962
1963
|
}
|
|
1963
1964
|
function M() {
|
|
1964
1965
|
m.value = !m.value;
|
|
1965
1966
|
}
|
|
1966
1967
|
function W() {
|
|
1967
1968
|
var E;
|
|
1968
|
-
(E =
|
|
1969
|
+
(E = u.value) == null || E.focus();
|
|
1969
1970
|
}
|
|
1970
1971
|
function J() {
|
|
1971
1972
|
var E;
|
|
1972
|
-
h.value = !1, (E =
|
|
1973
|
+
h.value = !1, (E = u.value) == null || E.blur();
|
|
1973
1974
|
}
|
|
1974
|
-
return n({ focus: W, blur: J }), (E,
|
|
1975
|
+
return n({ focus: W, blur: J }), (E, V) => (v(), _("div", {
|
|
1975
1976
|
class: j(["sq-input", k.value]),
|
|
1976
1977
|
onClick: g,
|
|
1977
1978
|
onPointerdown: x
|
|
1978
1979
|
}, [
|
|
1979
|
-
R.value ? (v(), _("span",
|
|
1980
|
+
R.value ? (v(), _("span", ps, [
|
|
1980
1981
|
F(E.$slots, "prefix", {}, () => [
|
|
1981
|
-
(v(),
|
|
1982
|
+
(v(), q(re(o.prefixIcon)))
|
|
1982
1983
|
])
|
|
1983
1984
|
])) : L("", !0),
|
|
1984
|
-
o.type !== "textarea" ?
|
|
1985
|
+
o.type !== "textarea" ? ue((v(), _("input", {
|
|
1985
1986
|
key: 1,
|
|
1986
1987
|
class: "sq-input-inner",
|
|
1987
|
-
"onUpdate:modelValue":
|
|
1988
|
+
"onUpdate:modelValue": V[0] || (V[0] = (Q) => c.value = Q),
|
|
1988
1989
|
id: a(r),
|
|
1989
1990
|
disabled: ae.value,
|
|
1990
1991
|
readonly: a(d),
|
|
1991
1992
|
placeholder: o.placeholder,
|
|
1992
|
-
type:
|
|
1993
|
+
type: C.value,
|
|
1993
1994
|
maxlength: o.maxlength,
|
|
1994
1995
|
minlength: o.minlength,
|
|
1995
1996
|
autocomplete: o.autocomplete,
|
|
@@ -1998,23 +1999,23 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
1998
1999
|
form: o.form,
|
|
1999
2000
|
inputmode: o.inputmode,
|
|
2000
2001
|
ref_key: "inputRef",
|
|
2001
|
-
ref:
|
|
2002
|
+
ref: u,
|
|
2002
2003
|
onFocus: P,
|
|
2003
2004
|
onBlur: $,
|
|
2004
|
-
onInput:
|
|
2005
|
-
onChange:
|
|
2005
|
+
onInput: V[1] || (V[1] = (Q) => e("input", Q)),
|
|
2006
|
+
onChange: V[2] || (V[2] = (Q) => e("change", Q))
|
|
2006
2007
|
}, null, 40, fs)), [
|
|
2007
|
-
[Ct,
|
|
2008
|
-
]) :
|
|
2008
|
+
[Ct, c.value]
|
|
2009
|
+
]) : ue((v(), _("textarea", {
|
|
2009
2010
|
key: 2,
|
|
2010
2011
|
class: "sq-input-inner",
|
|
2011
|
-
style: K({ resize:
|
|
2012
|
-
"onUpdate:modelValue":
|
|
2012
|
+
style: K({ resize: O.value }),
|
|
2013
|
+
"onUpdate:modelValue": V[3] || (V[3] = (Q) => c.value = Q),
|
|
2013
2014
|
id: a(r),
|
|
2014
2015
|
disabled: ae.value,
|
|
2015
2016
|
readonly: a(d),
|
|
2016
2017
|
placeholder: o.placeholder,
|
|
2017
|
-
type:
|
|
2018
|
+
type: C.value,
|
|
2018
2019
|
maxlength: o.maxlength,
|
|
2019
2020
|
minlength: o.minlength,
|
|
2020
2021
|
autocomplete: o.autocomplete,
|
|
@@ -2025,35 +2026,35 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
2025
2026
|
rows: o.rows,
|
|
2026
2027
|
cols: o.cols,
|
|
2027
2028
|
ref_key: "inputRef",
|
|
2028
|
-
ref:
|
|
2029
|
+
ref: u,
|
|
2029
2030
|
onFocus: P,
|
|
2030
2031
|
onBlur: $,
|
|
2031
|
-
onInput:
|
|
2032
|
-
onChange:
|
|
2033
|
-
}, null, 44,
|
|
2034
|
-
[wt,
|
|
2032
|
+
onInput: V[4] || (V[4] = (Q) => e("input", Q)),
|
|
2033
|
+
onChange: V[5] || (V[5] = (Q) => e("change", Q))
|
|
2034
|
+
}, null, 44, vs)), [
|
|
2035
|
+
[wt, c.value]
|
|
2035
2036
|
]),
|
|
2036
|
-
|
|
2037
|
-
A.value ? (v(),
|
|
2037
|
+
ue(z("span", ms, [
|
|
2038
|
+
A.value ? (v(), q(re(b.value), {
|
|
2038
2039
|
key: 0,
|
|
2039
2040
|
class: "sq-input-suffix-pwd",
|
|
2040
2041
|
onPointerdown: M
|
|
2041
2042
|
}, null, 32)) : L("", !0),
|
|
2042
|
-
Y.value ? (v(),
|
|
2043
|
+
Y.value ? (v(), q(a(Xe), {
|
|
2043
2044
|
key: 1,
|
|
2044
2045
|
class: "sq-input-suffix-clear",
|
|
2045
2046
|
onPointerdown: S
|
|
2046
2047
|
})) : L("", !0),
|
|
2047
2048
|
F(E.$slots, "suffix", {}, () => [
|
|
2048
|
-
H.value ? (v(),
|
|
2049
|
+
H.value ? (v(), q(re(H.value), { key: 0 })) : L("", !0)
|
|
2049
2050
|
])
|
|
2050
2051
|
], 512), [
|
|
2051
2052
|
[ve, ee.value]
|
|
2052
2053
|
])
|
|
2053
2054
|
], 34));
|
|
2054
2055
|
}
|
|
2055
|
-
}),
|
|
2056
|
-
name:
|
|
2056
|
+
}), hs = ["onClick"], ys = ["textContent"], bs = ["onClick"], xs = ["textContent"], $s = "sq-menu", ta = /* @__PURE__ */ B({
|
|
2057
|
+
name: $s,
|
|
2057
2058
|
__name: "Menu",
|
|
2058
2059
|
props: /* @__PURE__ */ G({
|
|
2059
2060
|
router: { type: Boolean },
|
|
@@ -2065,40 +2066,40 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
2065
2066
|
}),
|
|
2066
2067
|
emits: /* @__PURE__ */ G(["click", "change"], ["update:active"]),
|
|
2067
2068
|
setup(i, { emit: n }) {
|
|
2068
|
-
const { getText: s } = Be(), t = n, e = i, o = w(!1), l = ce(null),
|
|
2069
|
+
const { getText: s } = Be(), t = n, e = i, o = w(!1), l = ce(null), p = ie(i, "active"), f = y(() => [`sq-menu--${e.direction}`]);
|
|
2069
2070
|
oe(async () => {
|
|
2070
2071
|
try {
|
|
2071
|
-
const { RouterLink:
|
|
2072
|
-
l.value =
|
|
2072
|
+
const { RouterLink: c } = await import("vue-router");
|
|
2073
|
+
l.value = c, o.value = !0;
|
|
2073
2074
|
} catch {
|
|
2074
2075
|
console.warn("[squirrel-cloud/ui-vue] SqMenu 组件路由依赖 vue-router"), o.value = !1;
|
|
2075
2076
|
}
|
|
2076
2077
|
});
|
|
2077
|
-
function d(
|
|
2078
|
-
|
|
2078
|
+
function d(c, h) {
|
|
2079
|
+
c.disabled || h();
|
|
2079
2080
|
}
|
|
2080
|
-
function r(
|
|
2081
|
-
t("click",
|
|
2081
|
+
function r(c, h) {
|
|
2082
|
+
t("click", c.value, h), !(c.disabled || c.value === p.value) && (t("change", c.value), p.value = c.value);
|
|
2082
2083
|
}
|
|
2083
|
-
return (
|
|
2084
|
-
class: j(["sq-menu",
|
|
2084
|
+
return (c, h) => (v(), _("menu", {
|
|
2085
|
+
class: j(["sq-menu", f.value])
|
|
2085
2086
|
}, [
|
|
2086
|
-
e.router && o.value ? (v(!0), _(se, { key: 0 }, de(e.items, (m) => (v(),
|
|
2087
|
+
e.router && o.value ? (v(!0), _(se, { key: 0 }, de(e.items, (m) => (v(), q(re(l.value), {
|
|
2087
2088
|
custom: "",
|
|
2088
2089
|
to: { name: m.value },
|
|
2089
2090
|
key: m.value
|
|
2090
2091
|
}, {
|
|
2091
|
-
default: N(({ navigate:
|
|
2092
|
-
|
|
2092
|
+
default: N(({ navigate: u, isActive: k }) => [
|
|
2093
|
+
z("li", {
|
|
2093
2094
|
class: j(["sq-menu-item", { "is-active": k, "is-disabled": m.disabled }]),
|
|
2094
|
-
onClick: (b) => d(m,
|
|
2095
|
+
onClick: (b) => d(m, u)
|
|
2095
2096
|
}, [
|
|
2096
|
-
F(
|
|
2097
|
-
m.icon ? (v(),
|
|
2098
|
-
|
|
2097
|
+
F(c.$slots, "default", pe({ ref_for: !0 }, m), () => [
|
|
2098
|
+
m.icon ? (v(), q(re(m.icon), { key: 0 })) : L("", !0),
|
|
2099
|
+
z("span", {
|
|
2099
2100
|
textContent: X(a(s)(m))
|
|
2100
|
-
}, null, 8,
|
|
2101
|
-
e.direction === "vertical" ?
|
|
2101
|
+
}, null, 8, ys),
|
|
2102
|
+
e.direction === "vertical" ? ue((v(), q(a(nt), {
|
|
2102
2103
|
key: 1,
|
|
2103
2104
|
dot: "",
|
|
2104
2105
|
"show-zero": "",
|
|
@@ -2107,36 +2108,36 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
2107
2108
|
[ve, k]
|
|
2108
2109
|
]) : L("", !0)
|
|
2109
2110
|
])
|
|
2110
|
-
], 10,
|
|
2111
|
+
], 10, hs)
|
|
2111
2112
|
]),
|
|
2112
2113
|
_: 2
|
|
2113
2114
|
}, 1032, ["to"]))), 128)) : (v(!0), _(se, { key: 1 }, de(e.items, (m) => (v(), _("li", {
|
|
2114
2115
|
class: j(["sq-menu-item", {
|
|
2115
|
-
"is-active":
|
|
2116
|
+
"is-active": p.value === m.value,
|
|
2116
2117
|
"is-disabled": m.disabled
|
|
2117
2118
|
}]),
|
|
2118
2119
|
key: m.value,
|
|
2119
|
-
onClick: (
|
|
2120
|
+
onClick: (u) => r(m, u)
|
|
2120
2121
|
}, [
|
|
2121
|
-
F(
|
|
2122
|
-
m.icon ? (v(),
|
|
2123
|
-
|
|
2122
|
+
F(c.$slots, "default", pe({ ref_for: !0 }, m), () => [
|
|
2123
|
+
m.icon ? (v(), q(re(m.icon), { key: 0 })) : L("", !0),
|
|
2124
|
+
z("span", {
|
|
2124
2125
|
textContent: X(a(s)(m))
|
|
2125
|
-
}, null, 8,
|
|
2126
|
-
e.direction === "vertical" ?
|
|
2126
|
+
}, null, 8, xs),
|
|
2127
|
+
e.direction === "vertical" ? ue((v(), q(a(nt), {
|
|
2127
2128
|
key: 1,
|
|
2128
2129
|
dot: "",
|
|
2129
2130
|
"show-zero": "",
|
|
2130
2131
|
type: "primary"
|
|
2131
2132
|
}, null, 512)), [
|
|
2132
|
-
[ve,
|
|
2133
|
+
[ve, p.value === m.value]
|
|
2133
2134
|
]) : L("", !0)
|
|
2134
2135
|
])
|
|
2135
|
-
], 10,
|
|
2136
|
+
], 10, bs))), 128))
|
|
2136
2137
|
], 2));
|
|
2137
2138
|
}
|
|
2138
|
-
}),
|
|
2139
|
-
name:
|
|
2139
|
+
}), _s = ["id"], ks = ["textContent"], qs = "sq-message", Cs = /* @__PURE__ */ B({
|
|
2140
|
+
name: qs,
|
|
2140
2141
|
__name: "Message",
|
|
2141
2142
|
props: {
|
|
2142
2143
|
message: {},
|
|
@@ -2155,44 +2156,44 @@ const _n = ["disabled", "form", "type"], kn = "sq-button", le = /* @__PURE__ */
|
|
|
2155
2156
|
function o() {
|
|
2156
2157
|
t.value = !1;
|
|
2157
2158
|
}
|
|
2158
|
-
return n({ close: o }), (l,
|
|
2159
|
+
return n({ close: o }), (l, p) => (v(), q(_e, {
|
|
2159
2160
|
appear: "",
|
|
2160
2161
|
name: "sq-zoom-top",
|
|
2161
2162
|
onBeforeLeave: s.onClose,
|
|
2162
2163
|
onAfterLeave: s.onDestroy
|
|
2163
2164
|
}, {
|
|
2164
2165
|
default: N(() => [
|
|
2165
|
-
|
|
2166
|
+
ue(z("div", {
|
|
2166
2167
|
class: j(["sq-message", `is-${s.type}`]),
|
|
2167
2168
|
id: s.id,
|
|
2168
2169
|
style: K({ top: `${s.offsetTop}px` })
|
|
2169
2170
|
}, [
|
|
2170
2171
|
D(a(be), { class: "sq-message-inner" }, {
|
|
2171
2172
|
default: N(() => [
|
|
2172
|
-
s.type && e.value ? (v(),
|
|
2173
|
+
s.type && e.value ? (v(), q(re(e.value), {
|
|
2173
2174
|
key: 0,
|
|
2174
2175
|
class: "sq-message-icon"
|
|
2175
2176
|
})) : L("", !0),
|
|
2176
|
-
|
|
2177
|
+
z("div", {
|
|
2177
2178
|
class: "sq-message-content",
|
|
2178
2179
|
textContent: X(s.message)
|
|
2179
|
-
}, null, 8,
|
|
2180
|
+
}, null, 8, ks)
|
|
2180
2181
|
]),
|
|
2181
2182
|
_: 1
|
|
2182
2183
|
})
|
|
2183
|
-
], 14,
|
|
2184
|
+
], 14, _s), [
|
|
2184
2185
|
[ve, t.value]
|
|
2185
2186
|
])
|
|
2186
2187
|
]),
|
|
2187
2188
|
_: 1
|
|
2188
2189
|
}, 8, ["onBeforeLeave", "onAfterLeave"]));
|
|
2189
2190
|
}
|
|
2190
|
-
}), { getCssVar:
|
|
2191
|
-
let
|
|
2191
|
+
}), { getCssVar: ws } = Fe(), { nextZIndex: Ss } = Ze(), we = [], zs = ["primary", "success", "info", "warn", "error"], We = parseInt(ws("--sq-padding-md"));
|
|
2192
|
+
let Bs = 0;
|
|
2192
2193
|
const Ye = (i = {}) => {
|
|
2193
|
-
const n = `sq-message-${
|
|
2194
|
+
const n = `sq-message-${Bs++}`;
|
|
2194
2195
|
let s = document.querySelector(".sq-message-wrap");
|
|
2195
|
-
s || (s = document.createElement("div"), s.classList.add("sq-message-wrap"), document.body.appendChild(s)), s.style.zIndex =
|
|
2196
|
+
s || (s = document.createElement("div"), s.classList.add("sq-message-wrap"), document.body.appendChild(s)), s.style.zIndex = Ss().toString();
|
|
2196
2197
|
let t = We;
|
|
2197
2198
|
we.forEach((d) => {
|
|
2198
2199
|
var r;
|
|
@@ -2211,33 +2212,33 @@ const Ye = (i = {}) => {
|
|
|
2211
2212
|
e.onClose = () => {
|
|
2212
2213
|
l == null || l();
|
|
2213
2214
|
const d = we.findIndex(
|
|
2214
|
-
(m) => m.vm.component.props.id ===
|
|
2215
|
-
),
|
|
2215
|
+
(m) => m.vm.component.props.id === f.component.props.id
|
|
2216
|
+
), c = we.splice(d, 1)[0].vm.el.offsetHeight;
|
|
2216
2217
|
if (!(we.length < 1))
|
|
2217
2218
|
for (const m of we) {
|
|
2218
|
-
let
|
|
2219
|
-
|
|
2219
|
+
let u = Number(parseInt(m.vm.el.style.top));
|
|
2220
|
+
u -= c, u -= We, m.vm.component.props.offsetTop = u;
|
|
2220
2221
|
}
|
|
2221
2222
|
};
|
|
2222
|
-
const
|
|
2223
|
+
const p = e.onDestroy;
|
|
2223
2224
|
e.onDestroy = () => {
|
|
2224
|
-
|
|
2225
|
+
p == null || p(), Pe(null, o), o.remove(), o = null;
|
|
2225
2226
|
};
|
|
2226
|
-
const
|
|
2227
|
-
return Pe(
|
|
2227
|
+
const f = D(Cs, e);
|
|
2228
|
+
return Pe(f, o), we.push({ vm: f }), s.appendChild(o.firstElementChild), {
|
|
2228
2229
|
close: () => {
|
|
2229
2230
|
var d, r;
|
|
2230
|
-
(r = (d =
|
|
2231
|
+
(r = (d = f.component) == null ? void 0 : d.exposed) == null || r.close();
|
|
2231
2232
|
}
|
|
2232
2233
|
};
|
|
2233
2234
|
};
|
|
2234
|
-
|
|
2235
|
+
zs.forEach((i) => {
|
|
2235
2236
|
Ye[i] = (n = {}) => (typeof n == "string" && (n = {
|
|
2236
2237
|
message: n
|
|
2237
2238
|
}), Ye({ ...n, type: i }));
|
|
2238
2239
|
});
|
|
2239
|
-
const
|
|
2240
|
-
name:
|
|
2240
|
+
const na = Ye, Ms = ["textContent"], Ls = "sq-message-box", Ts = /* @__PURE__ */ B({
|
|
2241
|
+
name: Ls,
|
|
2241
2242
|
__name: "MessageBox",
|
|
2242
2243
|
props: {
|
|
2243
2244
|
message: {},
|
|
@@ -2259,9 +2260,9 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2259
2260
|
function e() {
|
|
2260
2261
|
t.value = !1;
|
|
2261
2262
|
}
|
|
2262
|
-
return n({ close: e }), (o, l) => (v(),
|
|
2263
|
+
return n({ close: e }), (o, l) => (v(), q(a(Yn), {
|
|
2263
2264
|
visible: t.value,
|
|
2264
|
-
"onUpdate:visible": l[0] || (l[0] = (
|
|
2265
|
+
"onUpdate:visible": l[0] || (l[0] = (p) => t.value = p),
|
|
2265
2266
|
type: s.type,
|
|
2266
2267
|
"mask-closeable": s.maskCloseable,
|
|
2267
2268
|
keyboard: s.keyboard,
|
|
@@ -2273,14 +2274,14 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2273
2274
|
onClosed: s.onDestroy
|
|
2274
2275
|
}, {
|
|
2275
2276
|
default: N(() => [
|
|
2276
|
-
|
|
2277
|
+
z("span", {
|
|
2277
2278
|
textContent: X(s.message)
|
|
2278
|
-
}, null, 8,
|
|
2279
|
+
}, null, 8, Ms)
|
|
2279
2280
|
]),
|
|
2280
2281
|
_: 1
|
|
2281
2282
|
}, 8, ["visible", "type", "mask-closeable", "keyboard", "ok-text", "cancel-text", "title", "before-close", "onOk", "onClosed"]));
|
|
2282
2283
|
}
|
|
2283
|
-
}),
|
|
2284
|
+
}), As = (i, n = {}) => {
|
|
2284
2285
|
const s = {
|
|
2285
2286
|
type: "warn",
|
|
2286
2287
|
message: i,
|
|
@@ -2291,17 +2292,17 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2291
2292
|
t == null || t(), Pe(null, e), e.remove(), e = null;
|
|
2292
2293
|
};
|
|
2293
2294
|
let e = document.createElement("div");
|
|
2294
|
-
const o = D(
|
|
2295
|
+
const o = D(Ts, s);
|
|
2295
2296
|
return Pe(o, e), {
|
|
2296
2297
|
close: () => {
|
|
2297
|
-
var l,
|
|
2298
|
-
(
|
|
2298
|
+
var l, p;
|
|
2299
|
+
(p = (l = o.component) == null ? void 0 : l.exposed) == null || p.close();
|
|
2299
2300
|
}
|
|
2300
2301
|
};
|
|
2301
|
-
},
|
|
2302
|
-
confirm: (i, n) =>
|
|
2303
|
-
},
|
|
2304
|
-
name:
|
|
2302
|
+
}, sa = {
|
|
2303
|
+
confirm: (i, n) => As(i, { title: "警告", ...n ?? {} })
|
|
2304
|
+
}, Is = "sq-pagination-prev", Rs = /* @__PURE__ */ B({
|
|
2305
|
+
name: Is,
|
|
2305
2306
|
__name: "PaginationPrev",
|
|
2306
2307
|
props: /* @__PURE__ */ G({
|
|
2307
2308
|
disabled: { type: Boolean },
|
|
@@ -2316,15 +2317,15 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2316
2317
|
const n = i, s = ie(i, "current"), t = (e) => {
|
|
2317
2318
|
s.value += e;
|
|
2318
2319
|
};
|
|
2319
|
-
return (e, o) => (v(),
|
|
2320
|
-
icon: a(
|
|
2320
|
+
return (e, o) => (v(), q(a(le), {
|
|
2321
|
+
icon: a(ft),
|
|
2321
2322
|
size: n.size,
|
|
2322
2323
|
disabled: s.value === 1 || n.disabled,
|
|
2323
2324
|
onClick: o[0] || (o[0] = (l) => t(-1))
|
|
2324
2325
|
}, null, 8, ["icon", "size", "disabled"]));
|
|
2325
2326
|
}
|
|
2326
|
-
}),
|
|
2327
|
-
name:
|
|
2327
|
+
}), Es = "sq-pagination-next", Ps = /* @__PURE__ */ B({
|
|
2328
|
+
name: Es,
|
|
2328
2329
|
__name: "PaginationNext",
|
|
2329
2330
|
props: /* @__PURE__ */ G({
|
|
2330
2331
|
disabled: { type: Boolean },
|
|
@@ -2339,15 +2340,15 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2339
2340
|
const n = i, s = ie(i, "current"), t = (e) => {
|
|
2340
2341
|
s.value += e;
|
|
2341
2342
|
};
|
|
2342
|
-
return (e, o) => (v(),
|
|
2343
|
+
return (e, o) => (v(), q(a(le), {
|
|
2343
2344
|
icon: a(vt),
|
|
2344
2345
|
size: n.size,
|
|
2345
2346
|
disabled: s.value === n.maxPage || n.disabled,
|
|
2346
2347
|
onClick: o[0] || (o[0] = (l) => t(1))
|
|
2347
2348
|
}, null, 8, ["icon", "size", "disabled"]));
|
|
2348
2349
|
}
|
|
2349
|
-
}),
|
|
2350
|
-
name:
|
|
2350
|
+
}), Ds = { class: "sq-pagination-pager" }, Ns = "sq-pagination-pager", Fs = /* @__PURE__ */ B({
|
|
2351
|
+
name: Ns,
|
|
2351
2352
|
__name: "PaginationPager",
|
|
2352
2353
|
props: /* @__PURE__ */ G({
|
|
2353
2354
|
disabled: { type: Boolean },
|
|
@@ -2362,20 +2363,20 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2362
2363
|
const n = i, s = ie(i, "current"), t = (e) => {
|
|
2363
2364
|
s.value = e;
|
|
2364
2365
|
};
|
|
2365
|
-
return (e, o) => (v(), _("div",
|
|
2366
|
+
return (e, o) => (v(), _("div", Ds, [
|
|
2366
2367
|
(v(!0), _(se, null, de(n.list, (l) => (v(), _(se, { key: l }, [
|
|
2367
|
-
l ? (v(),
|
|
2368
|
+
l ? (v(), q(a(le), {
|
|
2368
2369
|
key: 0,
|
|
2369
2370
|
type: s.value === l ? "primary" : void 0,
|
|
2370
2371
|
size: n.size,
|
|
2371
2372
|
disabled: n.disabled,
|
|
2372
|
-
onClick: (
|
|
2373
|
+
onClick: (p) => t(l)
|
|
2373
2374
|
}, {
|
|
2374
2375
|
default: N(() => [
|
|
2375
2376
|
Te(X(l), 1)
|
|
2376
2377
|
]),
|
|
2377
2378
|
_: 2
|
|
2378
|
-
}, 1032, ["type", "size", "disabled", "onClick"])) : (v(),
|
|
2379
|
+
}, 1032, ["type", "size", "disabled", "onClick"])) : (v(), q(a(le), {
|
|
2379
2380
|
key: 1,
|
|
2380
2381
|
icon: a(Ft),
|
|
2381
2382
|
size: n.size,
|
|
@@ -2384,8 +2385,8 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2384
2385
|
], 64))), 128))
|
|
2385
2386
|
]));
|
|
2386
2387
|
}
|
|
2387
|
-
}),
|
|
2388
|
-
name:
|
|
2388
|
+
}), Vs = "sq-pagination-next", Os = /* @__PURE__ */ B({
|
|
2389
|
+
name: Vs,
|
|
2389
2390
|
__name: "PaginationTotal",
|
|
2390
2391
|
props: {
|
|
2391
2392
|
size: {},
|
|
@@ -2393,17 +2394,17 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2393
2394
|
},
|
|
2394
2395
|
setup(i) {
|
|
2395
2396
|
const n = i;
|
|
2396
|
-
return (s, t) => (v(),
|
|
2397
|
+
return (s, t) => (v(), q(a(be), {
|
|
2397
2398
|
size: n.size === "sm" ? "sm" : "md"
|
|
2398
2399
|
}, {
|
|
2399
2400
|
default: N(() => [
|
|
2400
|
-
|
|
2401
|
+
z("span", null, "共 " + X(n.total) + " 条", 1)
|
|
2401
2402
|
]),
|
|
2402
2403
|
_: 1
|
|
2403
2404
|
}, 8, ["size"]));
|
|
2404
2405
|
}
|
|
2405
|
-
}),
|
|
2406
|
-
name:
|
|
2406
|
+
}), Hs = { class: "sq-pagination" }, Us = "sq-pagination", oa = /* @__PURE__ */ B({
|
|
2407
|
+
name: Us,
|
|
2407
2408
|
__name: "Pagination",
|
|
2408
2409
|
props: /* @__PURE__ */ G({
|
|
2409
2410
|
total: { default: 0 },
|
|
@@ -2420,33 +2421,33 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2420
2421
|
emits: ["update:current", "update:pageSize"],
|
|
2421
2422
|
setup(i) {
|
|
2422
2423
|
const n = i, s = ie(i, "current"), t = ie(i, "pageSize"), e = y(() => Math.ceil(n.total / t.value) || 1), o = y(() => {
|
|
2423
|
-
const
|
|
2424
|
-
let d = s.value -
|
|
2425
|
-
d < 2 && (d = 2, r = d +
|
|
2426
|
-
for (let
|
|
2427
|
-
|
|
2428
|
-
return
|
|
2424
|
+
const p = [], f = Math.floor(n.pagerCount / 2) - 1;
|
|
2425
|
+
let d = s.value - f, r = s.value + f;
|
|
2426
|
+
d < 2 && (d = 2, r = d + f * 2), r > e.value - 1 && (r = e.value - 1, d = r - f * 2);
|
|
2427
|
+
for (let c = 1; c <= e.value; c++)
|
|
2428
|
+
c === 1 || c === e.value || c >= d && c <= r ? p.push(c) : (c === d - 1 || c === r + 1) && p.push(0);
|
|
2429
|
+
return p;
|
|
2429
2430
|
}), l = y(() => {
|
|
2430
|
-
const
|
|
2431
|
-
for (const d of
|
|
2431
|
+
const p = n.layout ?? ["prev", "pager", "next"], f = [];
|
|
2432
|
+
for (const d of p)
|
|
2432
2433
|
switch (d) {
|
|
2433
2434
|
case "prev":
|
|
2434
|
-
|
|
2435
|
+
f.push(Rs);
|
|
2435
2436
|
break;
|
|
2436
2437
|
case "pager":
|
|
2437
|
-
|
|
2438
|
+
f.push(Fs);
|
|
2438
2439
|
break;
|
|
2439
2440
|
case "next":
|
|
2440
|
-
|
|
2441
|
+
f.push(Ps);
|
|
2441
2442
|
break;
|
|
2442
2443
|
case "total":
|
|
2443
|
-
|
|
2444
|
+
f.push(Os);
|
|
2444
2445
|
break;
|
|
2445
2446
|
}
|
|
2446
|
-
return
|
|
2447
|
+
return f;
|
|
2447
2448
|
});
|
|
2448
|
-
return (
|
|
2449
|
-
(v(!0), _(se, null, de(l.value, (d, r) => (v(),
|
|
2449
|
+
return (p, f) => (v(), _("div", Hs, [
|
|
2450
|
+
(v(!0), _(se, null, de(l.value, (d, r) => (v(), q(re(d), {
|
|
2450
2451
|
key: r,
|
|
2451
2452
|
size: n.size,
|
|
2452
2453
|
disabled: n.disabled,
|
|
@@ -2454,12 +2455,12 @@ const sa = Ye, Bs = ["textContent"], Ms = "sq-message-box", Ls = /* @__PURE__ */
|
|
|
2454
2455
|
"max-page": e.value,
|
|
2455
2456
|
total: n.total,
|
|
2456
2457
|
current: s.value,
|
|
2457
|
-
"onUpdate:current":
|
|
2458
|
+
"onUpdate:current": f[0] || (f[0] = (c) => s.value = c)
|
|
2458
2459
|
}, null, 40, ["size", "disabled", "list", "max-page", "total", "current"]))), 128))
|
|
2459
2460
|
]));
|
|
2460
2461
|
}
|
|
2461
|
-
}),
|
|
2462
|
-
name:
|
|
2462
|
+
}), js = "sq-only-child", Ws = /* @__PURE__ */ B({
|
|
2463
|
+
name: js,
|
|
2463
2464
|
setup(i, {
|
|
2464
2465
|
slots: n,
|
|
2465
2466
|
attrs: s
|
|
@@ -2494,8 +2495,8 @@ function xt(i) {
|
|
|
2494
2495
|
function ot(i) {
|
|
2495
2496
|
return D("span", null, [i]);
|
|
2496
2497
|
}
|
|
2497
|
-
const
|
|
2498
|
-
name:
|
|
2498
|
+
const Ys = "sq-popover", $t = /* @__PURE__ */ B({
|
|
2499
|
+
name: Ys,
|
|
2499
2500
|
__name: "Popover",
|
|
2500
2501
|
props: /* @__PURE__ */ G({
|
|
2501
2502
|
placement: { default: "top" },
|
|
@@ -2516,37 +2517,37 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2516
2517
|
emits: /* @__PURE__ */ G(["openChange"], ["update:visible"]),
|
|
2517
2518
|
setup(i, { emit: n }) {
|
|
2518
2519
|
const { getCssVar: s } = Fe(), { nextZIndex: t } = Ze(), e = Ke(), o = parseInt(s("--sq-padding-sm")), l = parseInt(s("--sq-padding-md"));
|
|
2519
|
-
let
|
|
2520
|
-
const r = n,
|
|
2520
|
+
let p, f, d = !1;
|
|
2521
|
+
const r = n, c = i, h = ie(i, "visible"), m = w(0), u = w({}), k = w(!1), b = ce(null), C = ce(null), R = y(() => {
|
|
2521
2522
|
const P = [];
|
|
2522
|
-
return
|
|
2523
|
+
return c.shadow && P.push("has-shadow"), [P];
|
|
2523
2524
|
});
|
|
2524
2525
|
te(h, (P) => {
|
|
2525
2526
|
if (P === d) return;
|
|
2526
|
-
d = P,
|
|
2527
|
-
const $ = P ?
|
|
2528
|
-
|
|
2527
|
+
d = P, O();
|
|
2528
|
+
const $ = P ? c.showAfter : c.hideAfter;
|
|
2529
|
+
p = setTimeout(() => {
|
|
2529
2530
|
k.value = P;
|
|
2530
2531
|
}, $);
|
|
2531
2532
|
}), te(k, (P) => {
|
|
2532
|
-
P ? (m.value = t(), ae(),
|
|
2533
|
+
P ? (m.value = t(), ae(), f = Ot(
|
|
2533
2534
|
b.value.$el,
|
|
2534
|
-
|
|
2535
|
+
C.value,
|
|
2535
2536
|
ae
|
|
2536
|
-
)) :
|
|
2537
|
+
)) : f == null || f(), r("openChange", P);
|
|
2537
2538
|
}), oe(() => {
|
|
2538
2539
|
ae();
|
|
2539
2540
|
}), ye(() => {
|
|
2540
|
-
|
|
2541
|
+
O(), document.removeEventListener("click", ee);
|
|
2541
2542
|
});
|
|
2542
2543
|
function T() {
|
|
2543
|
-
|
|
2544
|
+
c.trigger !== "hover" || c.disabled || H(!1);
|
|
2544
2545
|
}
|
|
2545
2546
|
function A() {
|
|
2546
|
-
|
|
2547
|
+
c.trigger === "hover" && ee();
|
|
2547
2548
|
}
|
|
2548
2549
|
function Y(P) {
|
|
2549
|
-
|
|
2550
|
+
c.trigger === "click" && !c.disabled && !h.value && (P.stopPropagation(), H());
|
|
2550
2551
|
}
|
|
2551
2552
|
function H(P = !0) {
|
|
2552
2553
|
h.value = !0, P && document.addEventListener("click", ee);
|
|
@@ -2556,26 +2557,26 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2556
2557
|
}
|
|
2557
2558
|
async function ae() {
|
|
2558
2559
|
var M, W;
|
|
2559
|
-
const P = typeof ((M = b.value) == null ? void 0 : M.$el.getBoundingClientRect), $ = typeof ((W =
|
|
2560
|
+
const P = typeof ((M = b.value) == null ? void 0 : M.$el.getBoundingClientRect), $ = typeof ((W = C.value) == null ? void 0 : W.getBoundingClientRect);
|
|
2560
2561
|
if (P !== "function" || $ !== "function") return;
|
|
2561
|
-
const x = await Ht(b.value.$el,
|
|
2562
|
-
placement:
|
|
2562
|
+
const x = await Ht(b.value.$el, C.value, {
|
|
2563
|
+
placement: c.placement,
|
|
2563
2564
|
middleware: [
|
|
2564
|
-
Ut(
|
|
2565
|
+
Ut(c.offset ?? o),
|
|
2565
2566
|
jt(),
|
|
2566
2567
|
Wt({ padding: l })
|
|
2567
2568
|
]
|
|
2568
2569
|
}), { x: g, y: S } = x;
|
|
2569
|
-
|
|
2570
|
+
u.value = {
|
|
2570
2571
|
left: `${g}px`,
|
|
2571
2572
|
top: `${S}px`
|
|
2572
2573
|
};
|
|
2573
2574
|
}
|
|
2574
|
-
function
|
|
2575
|
-
|
|
2575
|
+
function O() {
|
|
2576
|
+
p && (clearTimeout(p), p = void 0);
|
|
2576
2577
|
}
|
|
2577
2578
|
return (P, $) => (v(), _(se, null, [
|
|
2578
|
-
D(a(
|
|
2579
|
+
D(a(Ws), {
|
|
2579
2580
|
class: j(["sq-popover-trigger", a(e).class]),
|
|
2580
2581
|
style: K(a(e).style),
|
|
2581
2582
|
ref_key: "triggerRef",
|
|
@@ -2589,19 +2590,19 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2589
2590
|
]),
|
|
2590
2591
|
_: 3
|
|
2591
2592
|
}, 8, ["class", "style"]),
|
|
2592
|
-
(v(),
|
|
2593
|
+
(v(), q(lt, {
|
|
2593
2594
|
to: "body",
|
|
2594
|
-
disabled: !
|
|
2595
|
+
disabled: !c.teleported
|
|
2595
2596
|
}, [
|
|
2596
2597
|
D(_e, {
|
|
2597
|
-
name:
|
|
2598
|
+
name: c.transition
|
|
2598
2599
|
}, {
|
|
2599
2600
|
default: N(() => [
|
|
2600
|
-
|
|
2601
|
-
class: j(["sq-popover", [R.value,
|
|
2602
|
-
style: K([{ ...
|
|
2601
|
+
ue(z("div", {
|
|
2602
|
+
class: j(["sq-popover", [R.value, c.popoverClass]]),
|
|
2603
|
+
style: K([{ ...u.value, zIndex: m.value }, c.popoverStyle]),
|
|
2603
2604
|
ref_key: "popverRef",
|
|
2604
|
-
ref:
|
|
2605
|
+
ref: C,
|
|
2605
2606
|
onClick: $[0] || ($[0] = he(() => {
|
|
2606
2607
|
}, ["stop"]))
|
|
2607
2608
|
}, [
|
|
@@ -2615,11 +2616,11 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2615
2616
|
], 8, ["disabled"]))
|
|
2616
2617
|
], 64));
|
|
2617
2618
|
}
|
|
2618
|
-
}),
|
|
2619
|
+
}), Ks = {
|
|
2619
2620
|
key: 0,
|
|
2620
2621
|
class: "sq-progress-label"
|
|
2621
|
-
},
|
|
2622
|
-
name:
|
|
2622
|
+
}, Xs = ["textContent"], Gs = "sq-progress", Zs = /* @__PURE__ */ B({
|
|
2623
|
+
name: Gs,
|
|
2623
2624
|
__name: "Progress",
|
|
2624
2625
|
props: {
|
|
2625
2626
|
value: {},
|
|
@@ -2638,13 +2639,13 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2638
2639
|
}), l = y(() => {
|
|
2639
2640
|
const r = s.max - s.min;
|
|
2640
2641
|
return (s.value - s.min) * 100 / r;
|
|
2641
|
-
}),
|
|
2642
|
+
}), p = y(() => `${Math.round(l.value * 10) / 10} %`), f = y(() => {
|
|
2642
2643
|
const r = {};
|
|
2643
2644
|
if (r["--progress-stroke"] = `${s.stroke}px`, !s.variant)
|
|
2644
2645
|
r["--progress-value"] = `${l.value}%`;
|
|
2645
2646
|
else if (e.value) {
|
|
2646
|
-
const
|
|
2647
|
-
r["--progress-circle-r"] = `${h}px`, r["--progress-circle-l"] = `${m}px`, r["--progress-circle-stroke"] = `${
|
|
2647
|
+
const c = 100 / t.value * s.stroke, h = (100 - c) / 2, m = Math.PI * h * 2, u = l.value / 100;
|
|
2648
|
+
r["--progress-circle-r"] = `${h}px`, r["--progress-circle-l"] = `${m}px`, r["--progress-circle-stroke"] = `${c}px`, r["--progress-value"] = `${m * u}`, l.value === 0 && (r["--progress-circle-opaciry"] = "0");
|
|
2648
2649
|
}
|
|
2649
2650
|
if (s.color) {
|
|
2650
2651
|
const h = typeof s.color == "string" ? s.color : s.color(l.value);
|
|
@@ -2660,44 +2661,44 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2660
2661
|
function d() {
|
|
2661
2662
|
t.value = e.value.getBoundingClientRect().width;
|
|
2662
2663
|
}
|
|
2663
|
-
return (r,
|
|
2664
|
+
return (r, c) => (v(), _("div", {
|
|
2664
2665
|
class: j(["sq-progress", o.value]),
|
|
2665
2666
|
ref_key: "progressRef",
|
|
2666
2667
|
ref: e,
|
|
2667
|
-
style: K(
|
|
2668
|
+
style: K(f.value)
|
|
2668
2669
|
}, [
|
|
2669
2670
|
s.variant === "circle" ? (v(), _(se, { key: 0 }, [
|
|
2670
|
-
|
|
2671
|
+
c[0] || (c[0] = z("svg", {
|
|
2671
2672
|
viewBox: "0 0 100 100",
|
|
2672
2673
|
version: "1.1",
|
|
2673
2674
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2674
2675
|
}, [
|
|
2675
|
-
|
|
2676
|
+
z("circle", {
|
|
2676
2677
|
class: "sq-progress-track",
|
|
2677
2678
|
cx: "50",
|
|
2678
2679
|
cy: "50"
|
|
2679
2680
|
}),
|
|
2680
|
-
|
|
2681
|
+
z("circle", {
|
|
2681
2682
|
class: "sq-progress-path",
|
|
2682
2683
|
cx: "50",
|
|
2683
2684
|
cy: "50"
|
|
2684
2685
|
})
|
|
2685
2686
|
], -1)),
|
|
2686
|
-
s.label ? (v(), _("div",
|
|
2687
|
+
s.label ? (v(), _("div", Ks, [
|
|
2687
2688
|
F(r.$slots, "default", { percentage: l.value }, () => [
|
|
2688
|
-
|
|
2689
|
-
textContent: X(
|
|
2690
|
-
}, null, 8,
|
|
2689
|
+
z("span", {
|
|
2690
|
+
textContent: X(p.value)
|
|
2691
|
+
}, null, 8, Xs)
|
|
2691
2692
|
])
|
|
2692
2693
|
])) : L("", !0)
|
|
2693
2694
|
], 64)) : L("", !0)
|
|
2694
2695
|
], 6));
|
|
2695
2696
|
}
|
|
2696
|
-
}),
|
|
2697
|
+
}), Js = ["autofocus", "name", "form", "value", "disabled"], Qs = {
|
|
2697
2698
|
key: 0,
|
|
2698
2699
|
class: "sq-radio-box"
|
|
2699
|
-
},
|
|
2700
|
-
name:
|
|
2700
|
+
}, eo = ["textContent"], to = "sq-radio", no = /* @__PURE__ */ B({
|
|
2701
|
+
name: to,
|
|
2701
2702
|
__name: "Radio",
|
|
2702
2703
|
props: /* @__PURE__ */ G({
|
|
2703
2704
|
form: {},
|
|
@@ -2718,49 +2719,49 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2718
2719
|
radioSize: e,
|
|
2719
2720
|
radioDisabled: o,
|
|
2720
2721
|
radioForm: l,
|
|
2721
|
-
radioName:
|
|
2722
|
-
radioVariant:
|
|
2722
|
+
radioName: p,
|
|
2723
|
+
radioVariant: f,
|
|
2723
2724
|
groupContext: d
|
|
2724
|
-
} = yn(t), r = w(),
|
|
2725
|
-
const
|
|
2726
|
-
return k !== "md" &&
|
|
2727
|
-
}), m = y(() => d ? a(d).checked === t.value :
|
|
2728
|
-
return te(r, (
|
|
2729
|
-
|
|
2730
|
-
}), te(m, (
|
|
2731
|
-
if (
|
|
2732
|
-
|
|
2725
|
+
} = yn(t), r = w(), c = ie(i, "checked"), h = y(() => {
|
|
2726
|
+
const u = [], k = a(e), b = a(o), C = a(f);
|
|
2727
|
+
return k !== "md" && u.push(`sq-selection--${k}`), m.value && u.push("is-checked"), b && u.push("is-disabled"), C && u.push(`is-${C}`), u;
|
|
2728
|
+
}), m = y(() => d ? a(d).checked === t.value : c.value);
|
|
2729
|
+
return te(r, (u) => {
|
|
2730
|
+
c.value = u === t.value;
|
|
2731
|
+
}), te(m, (u) => {
|
|
2732
|
+
if (u ? r.value = t.value ?? "on" : r.value = void 0, c.value !== u) {
|
|
2733
|
+
c.value = u;
|
|
2733
2734
|
return;
|
|
2734
2735
|
}
|
|
2735
|
-
}), te(
|
|
2736
|
-
m.value !==
|
|
2736
|
+
}), te(c, (u) => {
|
|
2737
|
+
m.value !== u && d && d.value.toggleItem(t.value);
|
|
2737
2738
|
}), oe(() => {
|
|
2738
|
-
|
|
2739
|
-
}), (
|
|
2739
|
+
c.value = m.value, r.value = c.value ? t.value ?? "on" : void 0;
|
|
2740
|
+
}), (u, k) => (v(), _("label", {
|
|
2740
2741
|
class: j(["sq-selection sq-radio", h.value])
|
|
2741
2742
|
}, [
|
|
2742
|
-
|
|
2743
|
+
ue(z("input", {
|
|
2743
2744
|
type: "radio",
|
|
2744
2745
|
autofocus: t.autofocus,
|
|
2745
|
-
name: a(
|
|
2746
|
+
name: a(p),
|
|
2746
2747
|
form: a(l),
|
|
2747
2748
|
value: t.value,
|
|
2748
2749
|
disabled: a(o),
|
|
2749
2750
|
"onUpdate:modelValue": k[0] || (k[0] = (b) => r.value = b),
|
|
2750
2751
|
onChange: k[1] || (k[1] = (b) => s("change", m.value))
|
|
2751
|
-
}, null, 40,
|
|
2752
|
+
}, null, 40, Js), [
|
|
2752
2753
|
[it, r.value]
|
|
2753
2754
|
]),
|
|
2754
|
-
a(
|
|
2755
|
+
a(f) !== "solid" ? (v(), _("span", Qs)) : L("", !0),
|
|
2755
2756
|
t.label ? (v(), _("span", {
|
|
2756
2757
|
key: 1,
|
|
2757
2758
|
class: "sq-selection-label",
|
|
2758
2759
|
textContent: X(t.label)
|
|
2759
|
-
}, null, 8,
|
|
2760
|
+
}, null, 8, eo)) : L("", !0)
|
|
2760
2761
|
], 2));
|
|
2761
2762
|
}
|
|
2762
|
-
}),
|
|
2763
|
-
name:
|
|
2763
|
+
}), so = { class: "sq-radio-group sq-selection-group" }, oo = "sq-radio-group", ao = /* @__PURE__ */ B({
|
|
2764
|
+
name: oo,
|
|
2764
2765
|
__name: "RadioGroup",
|
|
2765
2766
|
props: {
|
|
2766
2767
|
items: { default: () => [] },
|
|
@@ -2773,7 +2774,7 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2773
2774
|
},
|
|
2774
2775
|
emits: ["change", "update:value"],
|
|
2775
2776
|
setup(i, { emit: n }) {
|
|
2776
|
-
const { nextId: s } = Ne(), { getText: t } = Be(), e = n, o = i, l = w(o.value),
|
|
2777
|
+
const { nextId: s } = Ne(), { getText: t } = Be(), e = n, o = i, l = w(o.value), p = y(() => o.name ?? `sq-radio-${s()}`), f = y(() => o.items.map((r) => typeof r == "string" ? {
|
|
2777
2778
|
text: r,
|
|
2778
2779
|
value: r
|
|
2779
2780
|
} : typeof r == "number" ? {
|
|
@@ -2784,7 +2785,7 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2784
2785
|
_t,
|
|
2785
2786
|
w({
|
|
2786
2787
|
form: ne(o, "form"),
|
|
2787
|
-
name:
|
|
2788
|
+
name: p,
|
|
2788
2789
|
disabled: ne(o, "disabled"),
|
|
2789
2790
|
size: ne(o, "size"),
|
|
2790
2791
|
variant: ne(o, "variant"),
|
|
@@ -2800,9 +2801,9 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2800
2801
|
function d(r) {
|
|
2801
2802
|
l.value = r, e("change", l.value), e("update:value", l.value);
|
|
2802
2803
|
}
|
|
2803
|
-
return (r,
|
|
2804
|
+
return (r, c) => (v(), _("div", so, [
|
|
2804
2805
|
F(r.$slots, "default", {}, () => [
|
|
2805
|
-
(v(!0), _(se, null, de(
|
|
2806
|
+
(v(!0), _(se, null, de(f.value, (h, m) => (v(), q(a(no), {
|
|
2806
2807
|
key: m,
|
|
2807
2808
|
disabled: h.disabled === !0,
|
|
2808
2809
|
label: a(t)(h),
|
|
@@ -2811,8 +2812,8 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2811
2812
|
])
|
|
2812
2813
|
]));
|
|
2813
2814
|
}
|
|
2814
|
-
}), _t = Symbol("radio-group-context-keys"),
|
|
2815
|
-
name:
|
|
2815
|
+
}), _t = Symbol("radio-group-context-keys"), lo = "sq-segmented", aa = /* @__PURE__ */ B({
|
|
2816
|
+
name: lo,
|
|
2816
2817
|
__name: "Segmented",
|
|
2817
2818
|
props: /* @__PURE__ */ G({
|
|
2818
2819
|
name: {},
|
|
@@ -2826,52 +2827,52 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2826
2827
|
}),
|
|
2827
2828
|
emits: /* @__PURE__ */ G(["change", "update:value"], ["update:value"]),
|
|
2828
2829
|
setup(i, { emit: n }) {
|
|
2829
|
-
const { nextId: s } = Ne(), t = n, e = i, o = w(), l = w(),
|
|
2830
|
-
text:
|
|
2831
|
-
value:
|
|
2832
|
-
} :
|
|
2833
|
-
const
|
|
2834
|
-
return e.size !== "md" &&
|
|
2830
|
+
const { nextId: s } = Ne(), t = n, e = i, o = w(), l = w(), p = ie(i, "value"), f = y(() => e.items.map((u) => typeof u == "string" ? {
|
|
2831
|
+
text: u,
|
|
2832
|
+
value: u
|
|
2833
|
+
} : u)), d = y(() => {
|
|
2834
|
+
const u = [];
|
|
2835
|
+
return e.size !== "md" && u.push(`sq-segmented--${e.size}`), e.round && u.push("is-round"), u;
|
|
2835
2836
|
}), r = y(() => {
|
|
2836
|
-
const
|
|
2837
|
-
return o.value && (
|
|
2838
|
-
}),
|
|
2837
|
+
const u = {};
|
|
2838
|
+
return o.value && (u.width = `${o.value}px`), l.value && (u.left = `${l.value}px`), u;
|
|
2839
|
+
}), c = y(() => e.name ?? `sq-segmented-${s()}`);
|
|
2839
2840
|
qe(
|
|
2840
2841
|
kt,
|
|
2841
2842
|
w({
|
|
2842
|
-
name:
|
|
2843
|
+
name: c,
|
|
2843
2844
|
disabled: ne(e, "disabled"),
|
|
2844
2845
|
size: ne(e, "size"),
|
|
2845
|
-
active:
|
|
2846
|
+
active: p,
|
|
2846
2847
|
toggleItem: h,
|
|
2847
2848
|
updateThumb: m
|
|
2848
2849
|
})
|
|
2849
2850
|
), oe(() => {
|
|
2850
|
-
var
|
|
2851
|
-
|
|
2851
|
+
var u;
|
|
2852
|
+
p.value || (p.value = (u = f.value[0]) == null ? void 0 : u.value);
|
|
2852
2853
|
});
|
|
2853
|
-
function h(
|
|
2854
|
-
|
|
2854
|
+
function h(u) {
|
|
2855
|
+
p.value = u, t("change", u);
|
|
2855
2856
|
}
|
|
2856
|
-
function m(
|
|
2857
|
-
l.value =
|
|
2857
|
+
function m(u) {
|
|
2858
|
+
l.value = u == null ? void 0 : u.offsetLeft, o.value = u == null ? void 0 : u.clientWidth;
|
|
2858
2859
|
}
|
|
2859
|
-
return (
|
|
2860
|
+
return (u, k) => (v(), _("div", {
|
|
2860
2861
|
class: j(["sq-segmented", d.value])
|
|
2861
2862
|
}, [
|
|
2862
|
-
|
|
2863
|
+
z("div", {
|
|
2863
2864
|
class: "sq-segmented-thumb",
|
|
2864
2865
|
style: K(r.value)
|
|
2865
2866
|
}, null, 4),
|
|
2866
|
-
F(
|
|
2867
|
-
(v(!0), _(se, null, de(
|
|
2867
|
+
F(u.$slots, "default", {}, () => [
|
|
2868
|
+
(v(!0), _(se, null, de(f.value, (b) => (v(), q(a(uo), pe({
|
|
2868
2869
|
key: b.value
|
|
2869
2870
|
}, { ref_for: !0 }, b), null, 16))), 128))
|
|
2870
2871
|
])
|
|
2871
2872
|
], 2));
|
|
2872
2873
|
}
|
|
2873
|
-
}),
|
|
2874
|
-
name:
|
|
2874
|
+
}), io = ["name", "value", "disabled"], ro = "sq-segmented-item", uo = /* @__PURE__ */ B({
|
|
2875
|
+
name: ro,
|
|
2875
2876
|
__name: "SegmentedItem",
|
|
2876
2877
|
props: {
|
|
2877
2878
|
icon: {},
|
|
@@ -2880,42 +2881,42 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2880
2881
|
disabled: { type: Boolean }
|
|
2881
2882
|
},
|
|
2882
2883
|
setup(i) {
|
|
2883
|
-
const n = i, { segmentedDisabled: s, parentContext: t } = bn(n), { getText: e } = Be(), o = w(), l = ce(null),
|
|
2884
|
-
const
|
|
2885
|
-
return
|
|
2886
|
-
}),
|
|
2887
|
-
te(
|
|
2888
|
-
if (
|
|
2884
|
+
const n = i, { segmentedDisabled: s, parentContext: t } = bn(n), { getText: e } = Be(), o = w(), l = ce(null), p = y(() => {
|
|
2885
|
+
const c = [], h = a(s);
|
|
2886
|
+
return f.value && c.push("is-active"), h && c.push("is-disabled"), c;
|
|
2887
|
+
}), f = y(() => a(t).active === n.value), d = y(() => a(t).size !== "sm" ? "md" : "sm");
|
|
2888
|
+
te(f, (c) => {
|
|
2889
|
+
if (c) {
|
|
2889
2890
|
if (o.value = n.value ?? "on", !t) return;
|
|
2890
2891
|
t.value.updateThumb(l.value);
|
|
2891
2892
|
} else o.value = void 0;
|
|
2892
2893
|
}), oe(() => {
|
|
2893
|
-
o.value =
|
|
2894
|
+
o.value = f.value ? n.value ?? "on" : void 0, !(!f.value || !t) && t.value.updateThumb(l.value);
|
|
2894
2895
|
});
|
|
2895
2896
|
function r() {
|
|
2896
2897
|
t && t.value.toggleItem(n.value);
|
|
2897
2898
|
}
|
|
2898
|
-
return (
|
|
2899
|
+
return (c, h) => {
|
|
2899
2900
|
var m;
|
|
2900
2901
|
return v(), _("label", {
|
|
2901
|
-
class: j(["sq-segmented-item",
|
|
2902
|
+
class: j(["sq-segmented-item", p.value]),
|
|
2902
2903
|
ref_key: "itemRef",
|
|
2903
2904
|
ref: l
|
|
2904
2905
|
}, [
|
|
2905
|
-
|
|
2906
|
+
ue(z("input", {
|
|
2906
2907
|
type: "radio",
|
|
2907
2908
|
name: (m = a(t)) == null ? void 0 : m.name,
|
|
2908
2909
|
value: n.value,
|
|
2909
2910
|
disabled: a(s),
|
|
2910
|
-
"onUpdate:modelValue": h[0] || (h[0] = (
|
|
2911
|
+
"onUpdate:modelValue": h[0] || (h[0] = (u) => o.value = u),
|
|
2911
2912
|
onChange: r
|
|
2912
|
-
}, null, 40,
|
|
2913
|
+
}, null, 40, io), [
|
|
2913
2914
|
[it, o.value]
|
|
2914
2915
|
]),
|
|
2915
|
-
F(
|
|
2916
|
+
F(c.$slots, "default", {}, () => [
|
|
2916
2917
|
D(a(be), { size: d.value }, {
|
|
2917
2918
|
default: N(() => [
|
|
2918
|
-
n.icon ? (v(),
|
|
2919
|
+
n.icon ? (v(), q(re(n.icon), { key: 0 })) : L("", !0),
|
|
2919
2920
|
Te(" " + X(a(e)(n)), 1)
|
|
2920
2921
|
]),
|
|
2921
2922
|
_: 1
|
|
@@ -2926,7 +2927,7 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2926
2927
|
}
|
|
2927
2928
|
}), kt = Symbol(
|
|
2928
2929
|
"segmented-context-keys"
|
|
2929
|
-
),
|
|
2930
|
+
), co = ["textContent"], po = /* @__PURE__ */ B({
|
|
2930
2931
|
__name: "SelectItem",
|
|
2931
2932
|
props: {
|
|
2932
2933
|
value: {},
|
|
@@ -2935,24 +2936,24 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2935
2936
|
},
|
|
2936
2937
|
setup(i) {
|
|
2937
2938
|
const { parentContext: n } = xn(), s = i, { getText: t } = Be(), e = y(() => {
|
|
2938
|
-
const
|
|
2939
|
-
return o.value &&
|
|
2939
|
+
const p = [];
|
|
2940
|
+
return o.value && p.push("is-active"), s.disabled && p.push("is-disabled"), p;
|
|
2940
2941
|
}), o = y(() => a(n).active === s.value);
|
|
2941
|
-
function l(
|
|
2942
|
-
!n ||
|
|
2942
|
+
function l(p) {
|
|
2943
|
+
!n || p.disabled || o.value || n.value.toggleItem(s.value);
|
|
2943
2944
|
}
|
|
2944
|
-
return (
|
|
2945
|
+
return (p, f) => (v(), _("li", {
|
|
2945
2946
|
class: j(e.value),
|
|
2946
|
-
onClick:
|
|
2947
|
+
onClick: f[0] || (f[0] = (d) => l(s))
|
|
2947
2948
|
}, [
|
|
2948
|
-
|
|
2949
|
+
z("span", {
|
|
2949
2950
|
textContent: X(a(t)(s))
|
|
2950
|
-
}, null, 8,
|
|
2951
|
-
o.value ? (v(),
|
|
2951
|
+
}, null, 8, co),
|
|
2952
|
+
o.value ? (v(), q(a(dt), { key: 0 })) : L("", !0)
|
|
2952
2953
|
], 2));
|
|
2953
2954
|
}
|
|
2954
|
-
}), fo = ["textContent"],
|
|
2955
|
-
name:
|
|
2955
|
+
}), fo = ["textContent"], vo = "sq-select", mo = /* @__PURE__ */ B({
|
|
2956
|
+
name: vo,
|
|
2956
2957
|
__name: "Select",
|
|
2957
2958
|
props: /* @__PURE__ */ G({
|
|
2958
2959
|
status: {},
|
|
@@ -2975,7 +2976,7 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2975
2976
|
setup(i, { emit: n }) {
|
|
2976
2977
|
const { getText: s } = Be();
|
|
2977
2978
|
let t = "";
|
|
2978
|
-
const e = n, o = i, l = w(!1),
|
|
2979
|
+
const e = n, o = i, l = w(!1), p = w(), f = w(""), d = ce(null), r = ie(i, "value"), c = y(() => o.items.map((A) => typeof A == "string" ? {
|
|
2979
2980
|
text: A,
|
|
2980
2981
|
value: A
|
|
2981
2982
|
} : A));
|
|
@@ -2986,26 +2987,26 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
2986
2987
|
toggleItem: m
|
|
2987
2988
|
})
|
|
2988
2989
|
), te(l, () => {
|
|
2989
|
-
t =
|
|
2990
|
-
}), te(r,
|
|
2991
|
-
|
|
2990
|
+
t = f.value;
|
|
2991
|
+
}), te(r, u), te(() => o.items, u), oe(() => {
|
|
2992
|
+
u();
|
|
2992
2993
|
});
|
|
2993
2994
|
function h(A) {
|
|
2994
2995
|
var H;
|
|
2995
|
-
if (!A || typeof
|
|
2996
|
+
if (!A || typeof p.value < "u") return;
|
|
2996
2997
|
const Y = (H = d.value) == null ? void 0 : H.$el;
|
|
2997
|
-
|
|
2998
|
+
p.value = Y.getBoundingClientRect().width;
|
|
2998
2999
|
}
|
|
2999
3000
|
function m(A) {
|
|
3000
3001
|
l.value && (r.value = A, l.value = !1, e("select", A));
|
|
3001
3002
|
}
|
|
3002
|
-
function
|
|
3003
|
-
const A =
|
|
3003
|
+
function u() {
|
|
3004
|
+
const A = c.value.find((Y) => Y.value === r.value);
|
|
3004
3005
|
if (!A) {
|
|
3005
|
-
|
|
3006
|
+
f.value = "";
|
|
3006
3007
|
return;
|
|
3007
3008
|
}
|
|
3008
|
-
|
|
3009
|
+
f.value = s(A);
|
|
3009
3010
|
}
|
|
3010
3011
|
function k() {
|
|
3011
3012
|
l.value = !0;
|
|
@@ -3013,35 +3014,35 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3013
3014
|
function b(A) {
|
|
3014
3015
|
l.value = !0, e("focus", A);
|
|
3015
3016
|
}
|
|
3016
|
-
function
|
|
3017
|
+
function C(A) {
|
|
3017
3018
|
l.value = !1, e("blur", A);
|
|
3018
3019
|
}
|
|
3019
3020
|
function R() {
|
|
3020
3021
|
r.value = "", e("clear");
|
|
3021
3022
|
}
|
|
3022
3023
|
function T() {
|
|
3023
|
-
|
|
3024
|
+
f.value = t;
|
|
3024
3025
|
}
|
|
3025
|
-
return (A, Y) => (v(),
|
|
3026
|
+
return (A, Y) => (v(), q(a($t), {
|
|
3026
3027
|
class: j(["sq-select", { "dropdown-opened": l.value }]),
|
|
3027
3028
|
placement: "bottom-start",
|
|
3028
3029
|
trigger: "manual",
|
|
3029
3030
|
"popover-class": "sq-select-dropdown",
|
|
3030
3031
|
disabled: o.disabled,
|
|
3031
3032
|
"hide-after": 100,
|
|
3032
|
-
"popover-style": { width: `${
|
|
3033
|
+
"popover-style": { width: `${p.value}px` },
|
|
3033
3034
|
visible: l.value,
|
|
3034
3035
|
"onUpdate:visible": Y[3] || (Y[3] = (H) => l.value = H),
|
|
3035
3036
|
onOpenChange: h
|
|
3036
3037
|
}, {
|
|
3037
3038
|
reference: N(() => [
|
|
3038
3039
|
D(a(bt), {
|
|
3039
|
-
value:
|
|
3040
|
-
"onUpdate:value": Y[0] || (Y[0] = (H) =>
|
|
3040
|
+
value: f.value,
|
|
3041
|
+
"onUpdate:value": Y[0] || (Y[0] = (H) => f.value = H),
|
|
3041
3042
|
disabled: o.disabled,
|
|
3042
3043
|
placeholder: o.placeholder,
|
|
3043
3044
|
"prefix-icon": o.prefixIcon,
|
|
3044
|
-
"suffix-icon": a(
|
|
3045
|
+
"suffix-icon": a(Vt),
|
|
3045
3046
|
size: o.size,
|
|
3046
3047
|
round: o.round,
|
|
3047
3048
|
status: o.status,
|
|
@@ -3053,18 +3054,18 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3053
3054
|
ref: d,
|
|
3054
3055
|
onClick: k,
|
|
3055
3056
|
onFocus: b,
|
|
3056
|
-
onBlur:
|
|
3057
|
+
onBlur: C,
|
|
3057
3058
|
onClear: R,
|
|
3058
3059
|
onInput: T
|
|
3059
3060
|
}, null, 8, ["value", "disabled", "placeholder", "prefix-icon", "suffix-icon", "size", "round", "status", "autofocus", "clearable", "name", "form"])
|
|
3060
3061
|
]),
|
|
3061
3062
|
default: N(() => [
|
|
3062
|
-
|
|
3063
|
+
c.value.length ? (v(), _("menu", {
|
|
3063
3064
|
key: 1,
|
|
3064
3065
|
onMousedown: Y[2] || (Y[2] = he(() => {
|
|
3065
3066
|
}, ["prevent"]))
|
|
3066
3067
|
}, [
|
|
3067
|
-
(v(!0), _(se, null, de(
|
|
3068
|
+
(v(!0), _(se, null, de(c.value, (H) => (v(), q(po, pe({
|
|
3068
3069
|
key: H.value
|
|
3069
3070
|
}, { ref_for: !0 }, H), null, 16))), 128))
|
|
3070
3071
|
], 32)) : (v(), _("div", {
|
|
@@ -3080,8 +3081,8 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3080
3081
|
}
|
|
3081
3082
|
}), qt = Symbol(
|
|
3082
3083
|
"select-context-keys"
|
|
3083
|
-
),
|
|
3084
|
-
name:
|
|
3084
|
+
), go = "sq-swipe", la = /* @__PURE__ */ B({
|
|
3085
|
+
name: go,
|
|
3085
3086
|
__name: "Swipe",
|
|
3086
3087
|
props: /* @__PURE__ */ G({
|
|
3087
3088
|
direction: { default: "horizontal" },
|
|
@@ -3100,106 +3101,106 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3100
3101
|
emits: /* @__PURE__ */ G(["change"], ["update:value"]),
|
|
3101
3102
|
setup(i, { emit: n }) {
|
|
3102
3103
|
const { getCssVar: s } = Fe(), t = { x: 0, y: 0 }, e = s("--sq-component-size-md"), o = parseInt(e), l = o / 2;
|
|
3103
|
-
let
|
|
3104
|
-
const r = n,
|
|
3105
|
-
const
|
|
3106
|
-
return
|
|
3107
|
-
}),
|
|
3108
|
-
() =>
|
|
3109
|
-
), R = y(() =>
|
|
3110
|
-
`to ${
|
|
3104
|
+
let p = !1, f = 0, d = [0, 0];
|
|
3105
|
+
const r = n, c = i, h = w(0), m = ce(null), u = ie(i, "value"), k = y(() => [`sq-swipe-${c.direction}`]), b = y(() => {
|
|
3106
|
+
const O = {}, P = c.direction === "horizontal" ? "left" : "top";
|
|
3107
|
+
return O[P] = `${h.value}px`, O;
|
|
3108
|
+
}), C = y(
|
|
3109
|
+
() => c.direction === "horizontal" ? "right" : "bottom"
|
|
3110
|
+
), R = y(() => c.disabled ? void 0 : `linear-gradient(${[
|
|
3111
|
+
`to ${C.value}`,
|
|
3111
3112
|
`#000 ${h.value}px`,
|
|
3112
3113
|
`transparent ${h.value + 1}px`
|
|
3113
|
-
].join(",")})`), T = y(() =>
|
|
3114
|
-
`to ${
|
|
3114
|
+
].join(",")})`), T = y(() => c.disabled ? void 0 : `linear-gradient(${[
|
|
3115
|
+
`to ${C.value}`,
|
|
3115
3116
|
`transparent ${h.value}px`,
|
|
3116
3117
|
`#000 ${h.value + 1}px`
|
|
3117
3118
|
].join(",")})`);
|
|
3118
|
-
te(
|
|
3119
|
-
|
|
3119
|
+
te(u, () => {
|
|
3120
|
+
p || A();
|
|
3120
3121
|
}), oe(() => {
|
|
3121
3122
|
A(), document.addEventListener("pointermove", ee), document.addEventListener("pointerup", H);
|
|
3122
3123
|
}), ye(() => {
|
|
3123
3124
|
document.removeEventListener("pointermove", ee), document.removeEventListener("pointerup", H);
|
|
3124
3125
|
});
|
|
3125
3126
|
function A() {
|
|
3126
|
-
const
|
|
3127
|
-
if (
|
|
3128
|
-
d = [l,
|
|
3129
|
-
const $ = (
|
|
3127
|
+
const O = m.value.getBoundingClientRect(), P = u.value >= 0 && u.value <= 1 ? u.value : 0.5;
|
|
3128
|
+
if (c.direction === "horizontal") {
|
|
3129
|
+
d = [l, O.width - l];
|
|
3130
|
+
const $ = (O.width - o) * P;
|
|
3130
3131
|
h.value = l + $;
|
|
3131
3132
|
} else {
|
|
3132
|
-
d = [l,
|
|
3133
|
-
const $ = (
|
|
3133
|
+
d = [l, O.height - l];
|
|
3134
|
+
const $ = (O.height - o) * P;
|
|
3134
3135
|
h.value = l + $;
|
|
3135
3136
|
}
|
|
3136
|
-
|
|
3137
|
+
f = h.value;
|
|
3137
3138
|
}
|
|
3138
|
-
function Y(
|
|
3139
|
-
|
|
3139
|
+
function Y(O) {
|
|
3140
|
+
p = !0, t.x = O.x, t.y = O.y;
|
|
3140
3141
|
}
|
|
3141
3142
|
function H() {
|
|
3142
|
-
|
|
3143
|
+
p = !1;
|
|
3143
3144
|
}
|
|
3144
|
-
function ee(
|
|
3145
|
-
|
|
3145
|
+
function ee(O) {
|
|
3146
|
+
p && ae(O.x, O.y);
|
|
3146
3147
|
}
|
|
3147
|
-
function ae(
|
|
3148
|
+
function ae(O, P) {
|
|
3148
3149
|
let $ = 0;
|
|
3149
|
-
|
|
3150
|
+
c.direction === "horizontal" ? ($ = t.x - O, t.x = O) : ($ = t.y - P, t.y = P);
|
|
3150
3151
|
const [x, g] = d;
|
|
3151
|
-
|
|
3152
|
+
f -= $;
|
|
3152
3153
|
const S = h.value;
|
|
3153
|
-
|
|
3154
|
+
f < x ? h.value = x : f > g ? h.value = g : h.value = f, S !== h.value && (u.value = (h.value - l) / (g - x), r("change", h.value / (g + l)));
|
|
3154
3155
|
}
|
|
3155
|
-
return (
|
|
3156
|
+
return (O, P) => (v(), _("div", {
|
|
3156
3157
|
class: j(["sq-swipe", k.value]),
|
|
3157
3158
|
ref_key: "swipeRef",
|
|
3158
3159
|
ref: m
|
|
3159
3160
|
}, [
|
|
3160
|
-
F(
|
|
3161
|
-
|
|
3161
|
+
F(O.$slots, "default", {}, () => [
|
|
3162
|
+
z("div", {
|
|
3162
3163
|
class: "sq-swipe-top",
|
|
3163
3164
|
style: K({ mask: R.value })
|
|
3164
3165
|
}, [
|
|
3165
|
-
F(
|
|
3166
|
-
|
|
3166
|
+
F(O.$slots, "top", {}, () => [
|
|
3167
|
+
c.topSrc ? (v(), q(a(st), {
|
|
3167
3168
|
key: 0,
|
|
3168
|
-
src:
|
|
3169
|
-
alt:
|
|
3169
|
+
src: c.topSrc,
|
|
3170
|
+
alt: c.topAlt,
|
|
3170
3171
|
preview: !1
|
|
3171
3172
|
}, null, 8, ["src", "alt"])) : L("", !0)
|
|
3172
3173
|
])
|
|
3173
3174
|
], 4),
|
|
3174
|
-
|
|
3175
|
+
z("div", {
|
|
3175
3176
|
class: "sq-swipe-bottom",
|
|
3176
3177
|
style: K({ mask: T.value })
|
|
3177
3178
|
}, [
|
|
3178
|
-
F(
|
|
3179
|
-
|
|
3179
|
+
F(O.$slots, "bottom", {}, () => [
|
|
3180
|
+
c.bottomSrc ? (v(), q(a(st), {
|
|
3180
3181
|
key: 0,
|
|
3181
|
-
src:
|
|
3182
|
-
alt:
|
|
3182
|
+
src: c.bottomSrc,
|
|
3183
|
+
alt: c.bottomAlt,
|
|
3183
3184
|
preview: !1
|
|
3184
3185
|
}, null, 8, ["src", "alt"])) : L("", !0)
|
|
3185
3186
|
])
|
|
3186
3187
|
], 4)
|
|
3187
3188
|
]),
|
|
3188
|
-
|
|
3189
|
+
ue(z("div", {
|
|
3189
3190
|
class: "sq-swipe-separator",
|
|
3190
3191
|
style: K(b.value)
|
|
3191
3192
|
}, [
|
|
3192
|
-
|
|
3193
|
+
z("button", {
|
|
3193
3194
|
class: "sq-swipe-slider",
|
|
3194
3195
|
onPointerdown: Y
|
|
3195
3196
|
}, null, 32)
|
|
3196
3197
|
], 4), [
|
|
3197
|
-
[ve, !
|
|
3198
|
+
[ve, !c.disabled]
|
|
3198
3199
|
])
|
|
3199
3200
|
], 2));
|
|
3200
3201
|
}
|
|
3201
|
-
}),
|
|
3202
|
-
name:
|
|
3202
|
+
}), ho = ["id", "autofocus", "name", "form", "disabled"], yo = { class: "sq-switch-track" }, bo = { class: "sq-switch-thumb" }, xo = "sq-switch", $o = /* @__PURE__ */ B({
|
|
3203
|
+
name: xo,
|
|
3203
3204
|
__name: "Switch",
|
|
3204
3205
|
props: /* @__PURE__ */ G({
|
|
3205
3206
|
form: {},
|
|
@@ -3215,48 +3216,38 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3215
3216
|
}),
|
|
3216
3217
|
emits: /* @__PURE__ */ G(["change", "click"], ["update:checked"]),
|
|
3217
3218
|
setup(i, { emit: n }) {
|
|
3218
|
-
const s = n, t = i, { switchSize: e, switchDisabled: o, id: l } = $n(t),
|
|
3219
|
-
const d = [], r = a(e),
|
|
3220
|
-
return r !== "md" && d.push(`sq-switch--${r}`),
|
|
3219
|
+
const s = n, t = i, { switchSize: e, switchDisabled: o, id: l } = $n(t), p = ie(i, "checked"), f = y(() => {
|
|
3220
|
+
const d = [], r = a(e), c = a(o);
|
|
3221
|
+
return r !== "md" && d.push(`sq-switch--${r}`), p.value && d.push("is-checked"), (c || t.loading) && d.push("is-disabled"), t.variant && d.push(`is-${t.variant}`), d;
|
|
3221
3222
|
});
|
|
3222
3223
|
return (d, r) => (v(), _("label", {
|
|
3223
|
-
class: j(["sq-switch",
|
|
3224
|
+
class: j(["sq-switch", f.value])
|
|
3224
3225
|
}, [
|
|
3225
|
-
|
|
3226
|
+
ue(z("input", {
|
|
3226
3227
|
type: "checkbox",
|
|
3227
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
3228
|
+
"onUpdate:modelValue": r[0] || (r[0] = (c) => p.value = c),
|
|
3228
3229
|
id: a(l),
|
|
3229
3230
|
autofocus: t.autofocus,
|
|
3230
3231
|
name: t.name,
|
|
3231
3232
|
form: t.form,
|
|
3232
3233
|
disabled: a(o) || t.loading,
|
|
3233
|
-
onChange: r[1] || (r[1] = (
|
|
3234
|
-
onClick: r[2] || (r[2] = (
|
|
3235
|
-
}, null, 40,
|
|
3236
|
-
[at,
|
|
3234
|
+
onChange: r[1] || (r[1] = (c) => s("change", p.value, c)),
|
|
3235
|
+
onClick: r[2] || (r[2] = (c) => s("click", p.value, c))
|
|
3236
|
+
}, null, 40, ho), [
|
|
3237
|
+
[at, p.value]
|
|
3237
3238
|
]),
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
t.loading ? (v(),
|
|
3239
|
+
z("span", yo, [
|
|
3240
|
+
z("span", bo, [
|
|
3241
|
+
t.loading ? (v(), q(a(De), { key: 0 })) : L("", !0)
|
|
3241
3242
|
])
|
|
3242
3243
|
])
|
|
3243
3244
|
], 2));
|
|
3244
3245
|
}
|
|
3245
|
-
}),
|
|
3246
|
-
name: $o,
|
|
3247
|
-
props: {
|
|
3248
|
-
content: {
|
|
3249
|
-
type: Object
|
|
3250
|
-
}
|
|
3251
|
-
},
|
|
3252
|
-
render() {
|
|
3253
|
-
return this.content;
|
|
3254
|
-
}
|
|
3255
|
-
}), ko = { class: "sq-table-wrap" }, qo = ["textContent"], Co = ["textContent"], wo = {
|
|
3246
|
+
}), _o = { class: "sq-table-wrap" }, ko = ["textContent"], qo = ["textContent"], Co = {
|
|
3256
3247
|
key: 0,
|
|
3257
3248
|
class: "sq-table-empty"
|
|
3258
|
-
},
|
|
3259
|
-
name:
|
|
3249
|
+
}, wo = ["textContent"], So = "sq-table", ia = /* @__PURE__ */ B({
|
|
3250
|
+
name: So,
|
|
3260
3251
|
__name: "Table",
|
|
3261
3252
|
props: {
|
|
3262
3253
|
emptyText: { default: "暂无数据" },
|
|
@@ -3271,11 +3262,11 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3271
3262
|
const { getCssUnit: n } = Fe(), s = new ResizeObserver(d), t = i, e = w(!1), o = ce(null), l = y(() => {
|
|
3272
3263
|
const m = [];
|
|
3273
3264
|
return t.stripe && m.push("is-striped"), t.border && m.push("has-border"), m;
|
|
3274
|
-
}),
|
|
3265
|
+
}), p = y(() => ({
|
|
3275
3266
|
gridTemplateColumns: t.cols.map((m) => m.width ? n(m.width) : "1fr").join(" ")
|
|
3276
|
-
})),
|
|
3277
|
-
...
|
|
3278
|
-
paddingInlineEnd: e.value ? "
|
|
3267
|
+
})), f = y(() => ({
|
|
3268
|
+
...p.value,
|
|
3269
|
+
paddingInlineEnd: e.value ? "4px" : "0"
|
|
3279
3270
|
}));
|
|
3280
3271
|
oe(() => {
|
|
3281
3272
|
s.observe(o.value);
|
|
@@ -3289,14 +3280,14 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3289
3280
|
}
|
|
3290
3281
|
Se(() => {
|
|
3291
3282
|
var k, b;
|
|
3292
|
-
const m = ((k = o.value) == null ? void 0 : k.clientHeight) ?? 0,
|
|
3293
|
-
e.value =
|
|
3283
|
+
const m = ((k = o.value) == null ? void 0 : k.clientHeight) ?? 0, u = ((b = o.value) == null ? void 0 : b.scrollHeight) ?? 0;
|
|
3284
|
+
e.value = u > m;
|
|
3294
3285
|
});
|
|
3295
3286
|
}
|
|
3296
|
-
function r(m,
|
|
3297
|
-
return t.rowKey &&
|
|
3287
|
+
function r(m, u) {
|
|
3288
|
+
return t.rowKey && Object.hasOwnProperty.call(m, t.rowKey) ? m[t.rowKey] : u;
|
|
3298
3289
|
}
|
|
3299
|
-
function
|
|
3290
|
+
function c(m) {
|
|
3300
3291
|
switch (m) {
|
|
3301
3292
|
case "left":
|
|
3302
3293
|
return "flex-start";
|
|
@@ -3308,66 +3299,63 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3308
3299
|
return "flex-start";
|
|
3309
3300
|
}
|
|
3310
3301
|
}
|
|
3311
|
-
function h(m,
|
|
3312
|
-
return typeof
|
|
3302
|
+
function h(m, u) {
|
|
3303
|
+
return u.binding ? typeof u.formatter == "function" ? u.formatter(m, m[u.binding]) || t.emptyValue : typeof m[u.binding] > "u" ? t.emptyValue : m[u.binding] : t.emptyValue;
|
|
3313
3304
|
}
|
|
3314
|
-
return (m,
|
|
3305
|
+
return (m, u) => (v(), _("div", {
|
|
3315
3306
|
class: j(["sq-table", l.value])
|
|
3316
3307
|
}, [
|
|
3317
|
-
|
|
3318
|
-
|
|
3308
|
+
z("div", _o, [
|
|
3309
|
+
z("div", {
|
|
3319
3310
|
class: "sq-table-header",
|
|
3320
|
-
style: K(
|
|
3311
|
+
style: K(f.value)
|
|
3321
3312
|
}, [
|
|
3322
3313
|
(v(!0), _(se, null, de(t.cols, (k) => (v(), _("div", {
|
|
3323
3314
|
class: "sq-table-cell",
|
|
3324
|
-
style: K({ "justify-content":
|
|
3325
|
-
key: k.
|
|
3315
|
+
style: K({ "justify-content": c(k.align) }),
|
|
3316
|
+
key: k.key
|
|
3326
3317
|
}, [
|
|
3327
|
-
|
|
3318
|
+
z("span", {
|
|
3328
3319
|
textContent: X(k.title)
|
|
3329
|
-
}, null, 8,
|
|
3320
|
+
}, null, 8, ko)
|
|
3330
3321
|
], 4))), 128))
|
|
3331
3322
|
], 4),
|
|
3332
|
-
|
|
3323
|
+
ue(z("div", {
|
|
3333
3324
|
class: "sq-table-body",
|
|
3334
3325
|
ref_key: "bodyRef",
|
|
3335
3326
|
ref: o
|
|
3336
3327
|
}, [
|
|
3337
3328
|
(v(!0), _(se, null, de(t.data, (k, b) => (v(), _("div", {
|
|
3338
3329
|
class: "sq-table-row",
|
|
3339
|
-
style: K(
|
|
3330
|
+
style: K(p.value),
|
|
3340
3331
|
key: r(k, b)
|
|
3341
3332
|
}, [
|
|
3342
|
-
(v(!0), _(se, null, de(t.cols, (
|
|
3343
|
-
class: j(["sq-table-cell",
|
|
3344
|
-
style: K({ "justify-content":
|
|
3345
|
-
key: `${
|
|
3333
|
+
(v(!0), _(se, null, de(t.cols, (C, R) => (v(), _("div", {
|
|
3334
|
+
class: j(["sq-table-cell", C.columnClass]),
|
|
3335
|
+
style: K({ "justify-content": c(C.align) }),
|
|
3336
|
+
key: `${C.key}-${r(k, R)}`
|
|
3346
3337
|
}, [
|
|
3347
|
-
typeof
|
|
3348
|
-
key: 0,
|
|
3349
|
-
content: q.cellRender(k, k[q.binding])
|
|
3350
|
-
}, null, 8, ["content"])) : (v(), _("span", {
|
|
3338
|
+
typeof C.cellRender == "function" ? (v(), q(re(C.cellRender(k)), { key: 0 })) : (v(), _("span", {
|
|
3351
3339
|
key: 1,
|
|
3352
|
-
textContent: X(h(k,
|
|
3353
|
-
}, null, 8,
|
|
3340
|
+
textContent: X(h(k, C))
|
|
3341
|
+
}, null, 8, qo))
|
|
3354
3342
|
], 6))), 128))
|
|
3355
3343
|
], 4))), 128))
|
|
3356
3344
|
], 512), [
|
|
3357
3345
|
[ve, t.data.length]
|
|
3358
3346
|
]),
|
|
3359
|
-
t.data.length ? L("", !0) : (v(), _("div",
|
|
3347
|
+
t.data.length ? L("", !0) : (v(), _("div", Co, [
|
|
3360
3348
|
F(m.$slots, "empty", {}, () => [
|
|
3361
|
-
|
|
3349
|
+
z("span", {
|
|
3362
3350
|
textContent: X(t.emptyText)
|
|
3363
|
-
}, null, 8,
|
|
3351
|
+
}, null, 8, wo)
|
|
3364
3352
|
])
|
|
3365
3353
|
]))
|
|
3366
3354
|
])
|
|
3367
3355
|
], 2));
|
|
3368
3356
|
}
|
|
3369
|
-
}),
|
|
3370
|
-
name:
|
|
3357
|
+
}), zo = "sq-tag", ra = /* @__PURE__ */ B({
|
|
3358
|
+
name: zo,
|
|
3371
3359
|
__name: "Tag",
|
|
3372
3360
|
props: {
|
|
3373
3361
|
type: {},
|
|
@@ -3380,7 +3368,7 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3380
3368
|
const e = [];
|
|
3381
3369
|
return n.size !== "md" && e.push(`sq-tag--${n.size}`), n.variant && n.type && e.push(`is-${n.variant}`), n.type && e.push(`is-${n.type}`), n.round && e.push("is-round"), e;
|
|
3382
3370
|
}), t = y(() => n.size === "lg" ? "md" : "sm");
|
|
3383
|
-
return (e, o) => (v(),
|
|
3371
|
+
return (e, o) => (v(), q(a(be), {
|
|
3384
3372
|
class: j(["sq-tag", s.value]),
|
|
3385
3373
|
size: t.value
|
|
3386
3374
|
}, {
|
|
@@ -3390,8 +3378,8 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3390
3378
|
_: 3
|
|
3391
3379
|
}, 8, ["class", "size"]));
|
|
3392
3380
|
}
|
|
3393
|
-
}),
|
|
3394
|
-
name:
|
|
3381
|
+
}), Bo = "sq-check-tag", ua = /* @__PURE__ */ B({
|
|
3382
|
+
name: Bo,
|
|
3395
3383
|
__name: "CheckTag",
|
|
3396
3384
|
props: {
|
|
3397
3385
|
checked: { type: Boolean, default: !1 },
|
|
@@ -3405,10 +3393,10 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3405
3393
|
const l = [];
|
|
3406
3394
|
return t.size !== "md" && l.push(`sq-tag--${t.size}`), t.type && l.push(`is-${t.type}`), t.round && l.push("is-round"), t.checked && l.push("is-checked"), l;
|
|
3407
3395
|
}), o = y(() => t.size === "lg" ? "md" : "sm");
|
|
3408
|
-
return (l,
|
|
3396
|
+
return (l, p) => (v(), q(a(be), {
|
|
3409
3397
|
class: j(["sq-check-tag", e.value]),
|
|
3410
3398
|
size: o.value,
|
|
3411
|
-
onClick:
|
|
3399
|
+
onClick: p[0] || (p[0] = (f) => s("change", !t.checked))
|
|
3412
3400
|
}, {
|
|
3413
3401
|
default: N(() => [
|
|
3414
3402
|
F(l.$slots, "default")
|
|
@@ -3416,8 +3404,8 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3416
3404
|
_: 3
|
|
3417
3405
|
}, 8, ["class", "size"]));
|
|
3418
3406
|
}
|
|
3419
|
-
}),
|
|
3420
|
-
name:
|
|
3407
|
+
}), Mo = "sq-text", be = /* @__PURE__ */ B({
|
|
3408
|
+
name: Mo,
|
|
3421
3409
|
__name: "Text",
|
|
3422
3410
|
props: {
|
|
3423
3411
|
ellipsis: { type: [Boolean, Number], default: !1 },
|
|
@@ -3437,8 +3425,8 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3437
3425
|
F(o.$slots, "default")
|
|
3438
3426
|
], 6));
|
|
3439
3427
|
}
|
|
3440
|
-
}),
|
|
3441
|
-
name:
|
|
3428
|
+
}), Lo = "sq-timeline", ca = /* @__PURE__ */ B({
|
|
3429
|
+
name: Lo,
|
|
3442
3430
|
__name: "Timeline",
|
|
3443
3431
|
props: {
|
|
3444
3432
|
align: { default: "left" },
|
|
@@ -3455,8 +3443,8 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3455
3443
|
F(t.$slots, "default")
|
|
3456
3444
|
], 2));
|
|
3457
3445
|
}
|
|
3458
|
-
}),
|
|
3459
|
-
name:
|
|
3446
|
+
}), To = { class: "sq-timeline-dot" }, Ao = { class: "sq-timeline-content" }, Io = ["textContent"], Ro = ["textContent"], Eo = { class: "content-info" }, Po = "sq-timeline-item", da = /* @__PURE__ */ B({
|
|
3447
|
+
name: Po,
|
|
3460
3448
|
__name: "TimelineItem",
|
|
3461
3449
|
props: {
|
|
3462
3450
|
color: {},
|
|
@@ -3478,28 +3466,28 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3478
3466
|
class: j(["sq-timeline-item", s.value]),
|
|
3479
3467
|
style: K(t.value)
|
|
3480
3468
|
}, [
|
|
3481
|
-
|
|
3482
|
-
n.icon ? (v(),
|
|
3469
|
+
z("span", To, [
|
|
3470
|
+
n.icon ? (v(), q(re(n.icon), { key: 0 })) : L("", !0)
|
|
3483
3471
|
]),
|
|
3484
|
-
|
|
3472
|
+
z("div", Ao, [
|
|
3485
3473
|
n.title ? (v(), _("h2", {
|
|
3486
3474
|
key: 0,
|
|
3487
3475
|
class: "content-title",
|
|
3488
3476
|
textContent: X(n.title)
|
|
3489
|
-
}, null, 8,
|
|
3477
|
+
}, null, 8, Io)) : L("", !0),
|
|
3490
3478
|
n.timestamp ? (v(), _("span", {
|
|
3491
3479
|
key: 1,
|
|
3492
3480
|
class: "content-time",
|
|
3493
3481
|
textContent: X(n.timestamp)
|
|
3494
|
-
}, null, 8,
|
|
3495
|
-
|
|
3482
|
+
}, null, 8, Ro)) : L("", !0),
|
|
3483
|
+
z("div", Eo, [
|
|
3496
3484
|
F(e.$slots, "default")
|
|
3497
3485
|
])
|
|
3498
3486
|
])
|
|
3499
3487
|
], 6));
|
|
3500
3488
|
}
|
|
3501
|
-
}),
|
|
3502
|
-
name:
|
|
3489
|
+
}), Do = ["textContent"], No = "sq-tooltip", $e = /* @__PURE__ */ B({
|
|
3490
|
+
name: No,
|
|
3503
3491
|
__name: "Tooltip",
|
|
3504
3492
|
props: {
|
|
3505
3493
|
placement: {},
|
|
@@ -3515,7 +3503,7 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3515
3503
|
const t = ["sq-tooltip"], e = n.popoverClass;
|
|
3516
3504
|
return Array.isArray(e) ? t.push(...e) : typeof e == "string" && t.push(e), t;
|
|
3517
3505
|
});
|
|
3518
|
-
return (t, e) => (v(),
|
|
3506
|
+
return (t, e) => (v(), q(a($t), {
|
|
3519
3507
|
placement: n.placement,
|
|
3520
3508
|
disabled: n.disabled,
|
|
3521
3509
|
"show-after": 300,
|
|
@@ -3529,14 +3517,14 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3529
3517
|
F(t.$slots, "default")
|
|
3530
3518
|
]),
|
|
3531
3519
|
default: N(() => [
|
|
3532
|
-
|
|
3520
|
+
z("span", {
|
|
3533
3521
|
textContent: X(n.tip)
|
|
3534
|
-
}, null, 8,
|
|
3522
|
+
}, null, 8, Do)
|
|
3535
3523
|
]),
|
|
3536
3524
|
_: 3
|
|
3537
3525
|
}, 8, ["placement", "disabled", "popover-class", "teleported", "transition", "shadow"]));
|
|
3538
3526
|
}
|
|
3539
|
-
}),
|
|
3527
|
+
}), Fo = ["name", "form", "disabled", "accept", "multiple"], Vo = "sq-upload", pa = /* @__PURE__ */ B({
|
|
3540
3528
|
name: Vo,
|
|
3541
3529
|
__name: "Upload",
|
|
3542
3530
|
props: {
|
|
@@ -3555,11 +3543,11 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3555
3543
|
var h;
|
|
3556
3544
|
r(((h = o.value) == null ? void 0 : h.files) ?? void 0);
|
|
3557
3545
|
}
|
|
3558
|
-
function
|
|
3546
|
+
function p(h) {
|
|
3559
3547
|
var m;
|
|
3560
3548
|
h.target === o.value || e.disabled || (m = o.value) == null || m.click();
|
|
3561
3549
|
}
|
|
3562
|
-
function
|
|
3550
|
+
function f(h) {
|
|
3563
3551
|
e.allowDrop && h.preventDefault();
|
|
3564
3552
|
}
|
|
3565
3553
|
function d(h) {
|
|
@@ -3567,23 +3555,23 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3567
3555
|
e.disabled || (e.allowDrop && h.preventDefault(), r(((m = h.dataTransfer) == null ? void 0 : m.files) ?? void 0));
|
|
3568
3556
|
}
|
|
3569
3557
|
function r(h) {
|
|
3570
|
-
const m = h ?? new FileList(),
|
|
3558
|
+
const m = h ?? new FileList(), u = [], k = e.max ? Math.min(m.length, e.max) : m.length;
|
|
3571
3559
|
for (let b = 0; b < k; b++) {
|
|
3572
|
-
const
|
|
3573
|
-
|
|
3560
|
+
const C = m[b];
|
|
3561
|
+
u.push(C);
|
|
3574
3562
|
}
|
|
3575
|
-
t("change",
|
|
3563
|
+
t("change", u);
|
|
3576
3564
|
}
|
|
3577
|
-
function
|
|
3565
|
+
function c() {
|
|
3578
3566
|
o.value.value = "", o.value.files = null, t("change", []);
|
|
3579
3567
|
}
|
|
3580
|
-
return n({ clearFiles:
|
|
3568
|
+
return n({ clearFiles: c }), (h, m) => (v(), _("div", {
|
|
3581
3569
|
class: "sq-upload",
|
|
3582
|
-
onClick:
|
|
3583
|
-
onDragover:
|
|
3570
|
+
onClick: p,
|
|
3571
|
+
onDragover: f,
|
|
3584
3572
|
onDrop: d
|
|
3585
3573
|
}, [
|
|
3586
|
-
|
|
3574
|
+
z("input", {
|
|
3587
3575
|
type: "file",
|
|
3588
3576
|
ref_key: "inputRef",
|
|
3589
3577
|
ref: o,
|
|
@@ -3593,7 +3581,7 @@ const Ws = "sq-popover", $t = /* @__PURE__ */ z({
|
|
|
3593
3581
|
accept: e.accept,
|
|
3594
3582
|
multiple: e.multiple,
|
|
3595
3583
|
onChange: l
|
|
3596
|
-
}, null, 40,
|
|
3584
|
+
}, null, 40, Fo),
|
|
3597
3585
|
F(h.$slots, "default")
|
|
3598
3586
|
], 32));
|
|
3599
3587
|
}
|
|
@@ -3606,44 +3594,44 @@ export {
|
|
|
3606
3594
|
_t as RadioGroupContextKeys,
|
|
3607
3595
|
kt as SegmentedContextKeys,
|
|
3608
3596
|
qt as SelectContextKeys,
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3597
|
+
jo as SqAlert,
|
|
3598
|
+
Wo as SqArticle,
|
|
3599
|
+
Yo as SqAvatar,
|
|
3600
|
+
Ko as SqBacktop,
|
|
3613
3601
|
nt as SqBadge,
|
|
3614
|
-
|
|
3602
|
+
Xo as SqBlur,
|
|
3615
3603
|
le as SqButton,
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3604
|
+
Go as SqButtonGroup,
|
|
3605
|
+
Zo as SqCard,
|
|
3606
|
+
ua as SqCheckTag,
|
|
3619
3607
|
In as SqCheckbox,
|
|
3620
3608
|
Pn as SqCheckboxGroup,
|
|
3621
|
-
|
|
3622
|
-
|
|
3609
|
+
Jo as SqCode,
|
|
3610
|
+
Yn as SqDialog,
|
|
3623
3611
|
je as SqDivider,
|
|
3624
|
-
|
|
3612
|
+
Qo as SqForm,
|
|
3625
3613
|
st as SqImage,
|
|
3626
|
-
|
|
3627
|
-
|
|
3614
|
+
ea as SqImageCrop,
|
|
3615
|
+
us as SqImageViewer,
|
|
3628
3616
|
bt as SqInput,
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3617
|
+
ta as SqMenu,
|
|
3618
|
+
na as SqMessage,
|
|
3619
|
+
sa as SqMessageBox,
|
|
3620
|
+
oa as SqPagination,
|
|
3633
3621
|
$t as SqPopover,
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3622
|
+
Zs as SqProgress,
|
|
3623
|
+
no as SqRadio,
|
|
3624
|
+
ao as SqRadioGroup,
|
|
3625
|
+
aa as SqSegmented,
|
|
3626
|
+
uo as SqSegmentedItem,
|
|
3627
|
+
mo as SqSelect,
|
|
3628
|
+
la as SqSwipe,
|
|
3629
|
+
$o as SqSwitch,
|
|
3630
|
+
ia as SqTable,
|
|
3631
|
+
ra as SqTag,
|
|
3644
3632
|
be as SqText,
|
|
3645
|
-
|
|
3646
|
-
|
|
3633
|
+
ca as SqTimeline,
|
|
3634
|
+
da as SqTimelineItem,
|
|
3647
3635
|
$e as SqTooltip,
|
|
3648
3636
|
pa as SqUpload
|
|
3649
3637
|
};
|