@squirrel-cloud/ui-vue 0.4.30 → 0.4.31
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/squirrel-cloud-ui-vue.js +973 -962
- package/dist/squirrel-cloud-ui-vue.umd.cjs +9 -9
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as L, computed as b, createBlock as
|
|
1
|
+
import { defineComponent as L, computed as b, createBlock as C, openBlock as v, unref as c, normalizeClass as V, withCtx as A, createCommentVNode as D, createTextVNode as Te, resolveDynamicComponent as ce, toDisplayString as X, h as Oe, ref as R, watch as oe, createElementBlock as _, normalizeStyle as K, onMounted as ie, onBeforeUnmount as he, Transition as be, withDirectives as ae, createElementVNode as O, renderSlot as F, vShow as ve, useSlots as Re, createVNode as T, inject as pe, provide as qe, toRef as ne, mergeModels as G, useModel as le, vModelCheckbox as Qe, toRaw as ke, Fragment as te, renderList as de, useAttrs as Ne, Teleport as et, mergeProps as fe, shallowRef as ue, withModifiers as me, nextTick as Le, vModelDynamic as yt, vModelText as xt, render as Ie, cloneVNode as _t, Text as $t, Comment as kt, vModelRadio as tt } from "vue";
|
|
2
2
|
import { WarningFilled as st, CloseFilled as nt, InfoFilled as Xe, CheckFilled as ot, JumpTo as wt, CaretUp as qt, Loading as Me, Check as at, Close as Ue, Bold as Ct, Italic as St, Underline as Bt, Strikethrough as zt, Hide as lt, ListUl as Tt, ListOl as Rt, View as it, ArrowLeft as rt, ArrowRight as ut, ZoomIn as Lt, ZoomOut as It, FlipHorizontal as Mt, FlipVertical as Et, Clockwise as At, Couterclockwise as Dt, FitSize as Ot, Fullscreen as Pt, Ellipsis as Nt, ArrowDown as Ut } from "@squirrel-cloud/icons-vue";
|
|
3
3
|
import Ft from "markdown-it";
|
|
4
4
|
import { createHighlighter as Vt } from "shiki";
|
|
5
5
|
import { RouterLink as Ht } from "vue-router";
|
|
6
|
-
import { autoUpdate as
|
|
6
|
+
import { autoUpdate as jt, computePosition as Wt, offset as Xt, flip as Yt, shift as Kt } from "@floating-ui/dom";
|
|
7
7
|
const Fe = {
|
|
8
8
|
primary: Xe,
|
|
9
9
|
success: ot,
|
|
@@ -24,11 +24,11 @@ const Fe = {
|
|
|
24
24
|
const t = [];
|
|
25
25
|
return o.type && t.push(`is-${o.type}`), t;
|
|
26
26
|
}), e = b(() => o.icon ? o.icon : o.showIcon && o.type ? Fe[o.type] : void 0);
|
|
27
|
-
return (t, s) => (v(),
|
|
27
|
+
return (t, s) => (v(), C(c(ge), {
|
|
28
28
|
class: V(["sq-alert", n.value])
|
|
29
29
|
}, {
|
|
30
|
-
default:
|
|
31
|
-
e.value ? (v(),
|
|
30
|
+
default: A(() => [
|
|
31
|
+
e.value ? (v(), C(ce(e.value), { key: 0 })) : D("", !0),
|
|
32
32
|
Te(" " + X(o.text), 1)
|
|
33
33
|
]),
|
|
34
34
|
_: 1
|
|
@@ -145,16 +145,16 @@ function Qt(d) {
|
|
|
145
145
|
if (l.type === "list_item_open") {
|
|
146
146
|
const u = n[s + 2];
|
|
147
147
|
if (u && u.type === "inline") {
|
|
148
|
-
const
|
|
149
|
-
if (/^\[[ xX]\]/.test(
|
|
148
|
+
const r = u.content;
|
|
149
|
+
if (/^\[[ xX]\]/.test(r.trim())) {
|
|
150
150
|
l.attrSet("class", "sq-article-task-list-item");
|
|
151
151
|
const a = (e = u.children) == null ? void 0 : e[0];
|
|
152
152
|
a && (a.content = a.content.replace(/^\[[ xX]\]/, ""));
|
|
153
|
-
const
|
|
153
|
+
const i = /^\[[xX]\]/.test(r), f = [
|
|
154
154
|
["type", "checkbox"],
|
|
155
155
|
["disabled", ""]
|
|
156
156
|
];
|
|
157
|
-
|
|
157
|
+
i && f.push(["checked", ""]);
|
|
158
158
|
const g = new Se("input", "input", 0);
|
|
159
159
|
g.attrs = f, (t = u.children) == null || t.unshift(g);
|
|
160
160
|
}
|
|
@@ -170,7 +170,7 @@ function es() {
|
|
|
170
170
|
html: !0,
|
|
171
171
|
typographer: !0
|
|
172
172
|
});
|
|
173
|
-
return u.use(Qt), l && l.forEach((
|
|
173
|
+
return u.use(Qt), l && l.forEach((r) => u.use(r)), u.parse(s, "");
|
|
174
174
|
}
|
|
175
175
|
function o(s, l) {
|
|
176
176
|
const u = e(s, l) ?? [];
|
|
@@ -182,22 +182,22 @@ function es() {
|
|
|
182
182
|
if (typeof u == "string")
|
|
183
183
|
return u;
|
|
184
184
|
{
|
|
185
|
-
const
|
|
185
|
+
const r = n(u.children);
|
|
186
186
|
return Oe(
|
|
187
187
|
u.tag,
|
|
188
188
|
u.attrs,
|
|
189
|
-
typeof u.tag != "string" ? t(
|
|
189
|
+
typeof u.tag != "string" ? t(r) : r
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
return l.length > 1 ? l : l[0];
|
|
194
194
|
}
|
|
195
195
|
function e(s, l) {
|
|
196
|
-
const u = [],
|
|
197
|
-
let a =
|
|
198
|
-
return s.forEach((
|
|
199
|
-
var
|
|
200
|
-
const { type: f, children: g, content: h, attrs: p, tag:
|
|
196
|
+
const u = [], r = { children: [] };
|
|
197
|
+
let a = r;
|
|
198
|
+
return s.forEach((i) => {
|
|
199
|
+
var M, I, j, J, ee, se, Z, w, y, m, k, x;
|
|
200
|
+
const { type: f, children: g, content: h, attrs: p, tag: $, hidden: z, info: B } = i;
|
|
201
201
|
switch (f) {
|
|
202
202
|
case "heading_open":
|
|
203
203
|
case "paragraph_open":
|
|
@@ -215,25 +215,25 @@ function es() {
|
|
|
215
215
|
case "em_open":
|
|
216
216
|
case "s_open":
|
|
217
217
|
case "link_open": {
|
|
218
|
-
if (
|
|
219
|
-
const
|
|
220
|
-
tag: (l == null ? void 0 : l[
|
|
218
|
+
if (z) break;
|
|
219
|
+
const S = {
|
|
220
|
+
tag: (l == null ? void 0 : l[$]) ?? $,
|
|
221
221
|
children: [],
|
|
222
222
|
attrs: p ? Object.fromEntries(p) : {}
|
|
223
223
|
};
|
|
224
224
|
if (f === "link_open") {
|
|
225
|
-
const
|
|
226
|
-
|
|
225
|
+
const N = i.attrGet("href") ?? "", H = document.location.origin;
|
|
226
|
+
N != null && N.startsWith("http") && !N.includes(H) && (S.attrs.target = "_blank", S.attrs.rel = "noopener noreferrer", S.attrs.dataOuter = "", (M = S.children) == null || M.push({ tag: wt }));
|
|
227
227
|
}
|
|
228
228
|
if (f === "table_open") {
|
|
229
|
-
const
|
|
229
|
+
const N = {
|
|
230
230
|
tag: "div",
|
|
231
231
|
children: [],
|
|
232
232
|
attrs: { class: "sq-article-table" }
|
|
233
233
|
};
|
|
234
|
-
(
|
|
234
|
+
(I = a.children) == null || I.push(N), u.push(a), a = N;
|
|
235
235
|
}
|
|
236
|
-
(
|
|
236
|
+
(j = a.children) == null || j.push(S), u.push(a), a = S;
|
|
237
237
|
break;
|
|
238
238
|
}
|
|
239
239
|
case "heading_close":
|
|
@@ -252,13 +252,13 @@ function es() {
|
|
|
252
252
|
case "em_close":
|
|
253
253
|
case "s_close":
|
|
254
254
|
case "link_close": {
|
|
255
|
-
if (
|
|
255
|
+
if (z) break;
|
|
256
256
|
a = u.pop();
|
|
257
257
|
break;
|
|
258
258
|
}
|
|
259
259
|
case "code_inline": {
|
|
260
260
|
(J = a.children) == null || J.push({
|
|
261
|
-
tag: (l == null ? void 0 : l[
|
|
261
|
+
tag: (l == null ? void 0 : l[$]) ?? $,
|
|
262
262
|
children: [h],
|
|
263
263
|
attrs: p ? Object.fromEntries(p) : {}
|
|
264
264
|
});
|
|
@@ -266,10 +266,10 @@ function es() {
|
|
|
266
266
|
}
|
|
267
267
|
case "inline": {
|
|
268
268
|
if (g) {
|
|
269
|
-
const
|
|
270
|
-
(
|
|
269
|
+
const S = e(g, l);
|
|
270
|
+
(ee = a.children) == null || ee.push(...S ?? []);
|
|
271
271
|
} else
|
|
272
|
-
(
|
|
272
|
+
(se = a.children) == null || se.push(h);
|
|
273
273
|
break;
|
|
274
274
|
}
|
|
275
275
|
case "text": {
|
|
@@ -278,7 +278,7 @@ function es() {
|
|
|
278
278
|
}
|
|
279
279
|
case "image": {
|
|
280
280
|
(w = a.children) == null || w.push({
|
|
281
|
-
tag: (l == null ? void 0 : l[
|
|
281
|
+
tag: (l == null ? void 0 : l[$]) ?? $,
|
|
282
282
|
children: [],
|
|
283
283
|
attrs: p ? Object.fromEntries(p) : {}
|
|
284
284
|
});
|
|
@@ -289,40 +289,46 @@ function es() {
|
|
|
289
289
|
tag: (l == null ? void 0 : l.fence) ?? "pre",
|
|
290
290
|
attrs: p ? Object.fromEntries(p) : {
|
|
291
291
|
code: h,
|
|
292
|
-
lang: (
|
|
292
|
+
lang: (B ?? "").trim()
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
295
|
break;
|
|
296
296
|
}
|
|
297
297
|
case "hr": {
|
|
298
298
|
(m = a.children) == null || m.push({
|
|
299
|
-
tag: (l == null ? void 0 : l[
|
|
299
|
+
tag: (l == null ? void 0 : l[$]) ?? $
|
|
300
300
|
});
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
303
|
case "input": {
|
|
304
|
-
const
|
|
305
|
-
tag: (l == null ? void 0 : l[
|
|
304
|
+
const S = p ? Object.fromEntries(p) : {}, N = S.type ?? "text", H = `${$}-${N}`, E = {
|
|
305
|
+
tag: (l == null ? void 0 : l[H]) ?? $,
|
|
306
306
|
children: [],
|
|
307
|
-
attrs:
|
|
307
|
+
attrs: S
|
|
308
308
|
};
|
|
309
|
-
|
|
309
|
+
N === "checkbox" && (E.attrs.value = `task-list-${Ge}`, Ge++), (k = a.children) == null || k.push(E);
|
|
310
310
|
break;
|
|
311
311
|
}
|
|
312
312
|
case "html_inline": {
|
|
313
313
|
if (h.startsWith("</"))
|
|
314
314
|
a = u.pop();
|
|
315
315
|
else {
|
|
316
|
-
const
|
|
317
|
-
|
|
316
|
+
const S = h.match(/^<(\w+)/);
|
|
317
|
+
if (!S) return;
|
|
318
|
+
const N = S[1], H = {
|
|
319
|
+
tag: (l == null ? void 0 : l[N]) ?? N,
|
|
318
320
|
children: []
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
+
}, E = h.match(/<[^>]+>/);
|
|
322
|
+
if (E) {
|
|
323
|
+
const U = E[0], q = {};
|
|
324
|
+
U.replace(/(\w+)=["']?([^"'\s>]+)["']?/g, (P, W, Q) => (q[W] = Q, "")), Object.keys(q).length > 0 && (H.attrs = q);
|
|
325
|
+
}
|
|
326
|
+
(x = a.children) == null || x.push(H), u.push(a), a = H;
|
|
321
327
|
}
|
|
322
328
|
break;
|
|
323
329
|
}
|
|
324
330
|
}
|
|
325
|
-
}),
|
|
331
|
+
}), r.children;
|
|
326
332
|
}
|
|
327
333
|
function t(s) {
|
|
328
334
|
return s === void 0 ? void 0 : { default: () => s };
|
|
@@ -455,16 +461,16 @@ const { md2tokens: ns, tokens2vueh: os } = es(), as = "sq-article", ls = L({
|
|
|
455
461
|
function l() {
|
|
456
462
|
n.value = !1;
|
|
457
463
|
}
|
|
458
|
-
return (u,
|
|
464
|
+
return (u, r) => (v(), _("div", {
|
|
459
465
|
class: V(["sq-avatar", e.value]),
|
|
460
466
|
style: K(t.value)
|
|
461
467
|
}, [
|
|
462
|
-
o.img && n.value ? (v(),
|
|
468
|
+
o.img && n.value ? (v(), _("img", {
|
|
463
469
|
key: 0,
|
|
464
470
|
src: o.img,
|
|
465
471
|
alt: o.alt,
|
|
466
472
|
onError: l
|
|
467
|
-
}, null, 40, is)) : (v(),
|
|
473
|
+
}, null, 40, is)) : (v(), _("span", {
|
|
468
474
|
key: 1,
|
|
469
475
|
textContent: X(s.value)
|
|
470
476
|
}, null, 8, rs))
|
|
@@ -482,7 +488,7 @@ const { md2tokens: ns, tokens2vueh: os } = es(), as = "sq-article", ls = L({
|
|
|
482
488
|
progressProps: {}
|
|
483
489
|
},
|
|
484
490
|
setup(d) {
|
|
485
|
-
const { throttle: o } = ts(), n = o(
|
|
491
|
+
const { throttle: o } = ts(), n = o(r), e = new ResizeObserver(a), t = d, s = R(100), l = R(0), u = b(() => l.value > t.visibilityHeight);
|
|
486
492
|
ie(() => {
|
|
487
493
|
var g;
|
|
488
494
|
a(), n(), window.addEventListener("scroll", n);
|
|
@@ -492,28 +498,28 @@ const { md2tokens: ns, tokens2vueh: os } = es(), as = "sq-article", ls = L({
|
|
|
492
498
|
var f;
|
|
493
499
|
window.removeEventListener("scroll", n), e.disconnect(), (f = window.visualViewport) == null || f.removeEventListener("resize", a);
|
|
494
500
|
});
|
|
495
|
-
function
|
|
501
|
+
function r() {
|
|
496
502
|
l.value = window.scrollY;
|
|
497
503
|
}
|
|
498
504
|
function a() {
|
|
499
505
|
const f = (document.scrollingElement ?? document.body).scrollHeight, g = window.innerHeight;
|
|
500
506
|
s.value = f - g;
|
|
501
507
|
}
|
|
502
|
-
function
|
|
508
|
+
function i() {
|
|
503
509
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
504
510
|
}
|
|
505
|
-
return (f, g) => (v(),
|
|
511
|
+
return (f, g) => (v(), C(be, {
|
|
506
512
|
name: t.transition
|
|
507
513
|
}, {
|
|
508
|
-
default:
|
|
509
|
-
var h, p,
|
|
514
|
+
default: A(() => {
|
|
515
|
+
var h, p, $;
|
|
510
516
|
return [
|
|
511
|
-
ae(
|
|
512
|
-
|
|
517
|
+
ae(O("div", cs, [
|
|
518
|
+
O("div", {
|
|
513
519
|
class: "sq-backtop-wrap",
|
|
514
|
-
onClick:
|
|
520
|
+
onClick: i
|
|
515
521
|
}, [
|
|
516
|
-
t.progress ? (v(),
|
|
522
|
+
t.progress ? (v(), C(c(go), {
|
|
517
523
|
key: 0,
|
|
518
524
|
variant: "circle",
|
|
519
525
|
label: !1,
|
|
@@ -521,10 +527,10 @@ const { md2tokens: ns, tokens2vueh: os } = es(), as = "sq-article", ls = L({
|
|
|
521
527
|
max: s.value,
|
|
522
528
|
type: (h = t.progressProps) == null ? void 0 : h.type,
|
|
523
529
|
stroke: (p = t.progressProps) == null ? void 0 : p.stroke,
|
|
524
|
-
color: (
|
|
525
|
-
}, null, 8, ["value", "max", "type", "stroke", "color"])) :
|
|
526
|
-
|
|
527
|
-
(v(),
|
|
530
|
+
color: ($ = t.progressProps) == null ? void 0 : $.color
|
|
531
|
+
}, null, 8, ["value", "max", "type", "stroke", "color"])) : D("", !0),
|
|
532
|
+
F(f.$slots, "default", {}, () => [
|
|
533
|
+
(v(), C(ce(t.icon)))
|
|
528
534
|
])
|
|
529
535
|
])
|
|
530
536
|
], 512), [
|
|
@@ -552,32 +558,32 @@ const { md2tokens: ns, tokens2vueh: os } = es(), as = "sq-article", ls = L({
|
|
|
552
558
|
const u = [`is-${n.type}`];
|
|
553
559
|
return n.dot && u.push("is-dot"), u;
|
|
554
560
|
}), t = b(() => o.default ? "sup" : "div"), s = b(() => !n.dot && n.text || n.showZero ? !0 : n.count > 0), l = b(() => n.dot ? "" : n.text ? n.text : n.max && n.count > n.max ? `${n.max}+` : `${n.count}`);
|
|
555
|
-
return (u,
|
|
556
|
-
default:
|
|
557
|
-
c(o).default || s.value ? (v(),
|
|
561
|
+
return (u, r) => (v(), C(be, { name: "sq-zoom" }, {
|
|
562
|
+
default: A(() => [
|
|
563
|
+
c(o).default || s.value ? (v(), _("span", {
|
|
558
564
|
key: 0,
|
|
559
565
|
class: V(["sq-badge", e.value]),
|
|
560
566
|
style: K({ "--badge-color": n.color })
|
|
561
567
|
}, [
|
|
562
|
-
|
|
563
|
-
(v(),
|
|
564
|
-
default:
|
|
568
|
+
F(u.$slots, "default"),
|
|
569
|
+
(v(), C(ce(t.value), { class: "sq-badge-label" }, {
|
|
570
|
+
default: A(() => [
|
|
565
571
|
T(be, {
|
|
566
572
|
name: c(o).default ? "sq-zoom" : ""
|
|
567
573
|
}, {
|
|
568
|
-
default:
|
|
569
|
-
s.value ? (v(),
|
|
574
|
+
default: A(() => [
|
|
575
|
+
s.value ? (v(), _("span", {
|
|
570
576
|
key: 0,
|
|
571
577
|
class: "sq-badge-label-inner",
|
|
572
578
|
textContent: X(l.value)
|
|
573
|
-
}, null, 8, fs)) :
|
|
579
|
+
}, null, 8, fs)) : D("", !0)
|
|
574
580
|
]),
|
|
575
581
|
_: 1
|
|
576
582
|
}, 8, ["name"])
|
|
577
583
|
]),
|
|
578
584
|
_: 1
|
|
579
585
|
}))
|
|
580
|
-
], 6)) :
|
|
586
|
+
], 6)) : D("", !0)
|
|
581
587
|
]),
|
|
582
588
|
_: 3
|
|
583
589
|
}));
|
|
@@ -586,9 +592,9 @@ const { md2tokens: ns, tokens2vueh: os } = es(), as = "sq-article", ls = L({
|
|
|
586
592
|
name: vs,
|
|
587
593
|
__name: "blur",
|
|
588
594
|
setup(d) {
|
|
589
|
-
return (o, n) => (v(),
|
|
590
|
-
default:
|
|
591
|
-
|
|
595
|
+
return (o, n) => (v(), C(c(ge), { class: "sq-blur" }, {
|
|
596
|
+
default: A(() => [
|
|
597
|
+
F(o.$slots, "default")
|
|
592
598
|
]),
|
|
593
599
|
_: 3
|
|
594
600
|
}));
|
|
@@ -599,11 +605,11 @@ function hs(d) {
|
|
|
599
605
|
() => c(e) ? void 0 : d.text
|
|
600
606
|
), s = b(
|
|
601
607
|
() => {
|
|
602
|
-
var a,
|
|
608
|
+
var a, i;
|
|
603
609
|
return o(
|
|
604
610
|
(a = c(e)) == null ? void 0 : a.size,
|
|
605
611
|
d.size,
|
|
606
|
-
(
|
|
612
|
+
(i = c(n)) == null ? void 0 : i.size,
|
|
607
613
|
"md"
|
|
608
614
|
);
|
|
609
615
|
}
|
|
@@ -614,34 +620,34 @@ function hs(d) {
|
|
|
614
620
|
}
|
|
615
621
|
), u = b(
|
|
616
622
|
() => {
|
|
617
|
-
var a,
|
|
623
|
+
var a, i;
|
|
618
624
|
return o(
|
|
619
625
|
(a = c(e)) == null ? void 0 : a.round,
|
|
620
626
|
d.round,
|
|
621
|
-
(
|
|
627
|
+
(i = c(n)) == null ? void 0 : i.round
|
|
622
628
|
);
|
|
623
629
|
}
|
|
624
|
-
),
|
|
630
|
+
), r = b(
|
|
625
631
|
() => {
|
|
626
|
-
var a,
|
|
632
|
+
var a, i, f;
|
|
627
633
|
return o(
|
|
628
634
|
(a = c(n)) == null ? void 0 : a.disabled,
|
|
629
|
-
(
|
|
635
|
+
(i = c(n)) == null ? void 0 : i.readonly,
|
|
630
636
|
(f = c(e)) == null ? void 0 : f.disabled,
|
|
631
637
|
d.disabled
|
|
632
638
|
);
|
|
633
639
|
}
|
|
634
640
|
);
|
|
635
|
-
return { btnTextType: t, btnSize: s, btnType: l, btnRound: u, btnDisabled:
|
|
641
|
+
return { btnTextType: t, btnSize: s, btnType: l, btnRound: u, btnDisabled: r };
|
|
636
642
|
}
|
|
637
643
|
function gs(d) {
|
|
638
644
|
const { getOption: o } = Ce(), n = pe(Be, void 0), e = pe(ft, void 0), t = b(
|
|
639
645
|
() => {
|
|
640
|
-
var a,
|
|
646
|
+
var a, i;
|
|
641
647
|
return o(
|
|
642
648
|
(a = c(e)) == null ? void 0 : a.size,
|
|
643
649
|
d.size,
|
|
644
|
-
(
|
|
650
|
+
(i = c(n)) == null ? void 0 : i.size,
|
|
645
651
|
"md"
|
|
646
652
|
);
|
|
647
653
|
}
|
|
@@ -660,12 +666,12 @@ function gs(d) {
|
|
|
660
666
|
var a;
|
|
661
667
|
return o((a = c(e)) == null ? void 0 : a.variant, d.variant);
|
|
662
668
|
}
|
|
663
|
-
),
|
|
669
|
+
), r = b(
|
|
664
670
|
() => {
|
|
665
|
-
var a,
|
|
671
|
+
var a, i, f;
|
|
666
672
|
return o(
|
|
667
673
|
(a = c(n)) == null ? void 0 : a.disabled,
|
|
668
|
-
(
|
|
674
|
+
(i = c(n)) == null ? void 0 : i.readonly,
|
|
669
675
|
(f = c(e)) == null ? void 0 : f.disabled,
|
|
670
676
|
d.disabled
|
|
671
677
|
);
|
|
@@ -676,30 +682,30 @@ function gs(d) {
|
|
|
676
682
|
checkboxForm: s,
|
|
677
683
|
checkboxName: l,
|
|
678
684
|
checkboxVariant: u,
|
|
679
|
-
checkboxDisabled:
|
|
685
|
+
checkboxDisabled: r,
|
|
680
686
|
groupContext: e
|
|
681
687
|
};
|
|
682
688
|
}
|
|
683
689
|
function bs(d) {
|
|
684
|
-
const { getOption: o } = Ce(), n = pe(Be, void 0), e = pe(
|
|
690
|
+
const { getOption: o } = Ce(), n = pe(Be, void 0), e = pe(je, void 0), t = b(
|
|
685
691
|
() => {
|
|
686
|
-
var
|
|
687
|
-
return o(d.size, (
|
|
692
|
+
var r;
|
|
693
|
+
return o(d.size, (r = c(n)) == null ? void 0 : r.size, "md");
|
|
688
694
|
}
|
|
689
695
|
), s = b(
|
|
690
696
|
() => {
|
|
691
|
-
var
|
|
692
|
-
return o(d.round, (
|
|
697
|
+
var r;
|
|
698
|
+
return o(d.round, (r = c(n)) == null ? void 0 : r.round);
|
|
693
699
|
}
|
|
694
700
|
), l = b(
|
|
695
701
|
() => {
|
|
696
|
-
var
|
|
697
|
-
return o((
|
|
702
|
+
var r;
|
|
703
|
+
return o((r = c(n)) == null ? void 0 : r.disabled, d.disabled);
|
|
698
704
|
}
|
|
699
705
|
), u = b(
|
|
700
706
|
() => {
|
|
701
|
-
var
|
|
702
|
-
return o((
|
|
707
|
+
var r;
|
|
708
|
+
return o((r = c(n)) == null ? void 0 : r.readonly, d.readonly);
|
|
703
709
|
}
|
|
704
710
|
);
|
|
705
711
|
return { inputSize: t, inputRound: s, inputDisabled: l, inputReadonly: u, id: e };
|
|
@@ -707,11 +713,11 @@ function bs(d) {
|
|
|
707
713
|
function ys(d) {
|
|
708
714
|
const { getOption: o } = Ce(), n = pe(Be, void 0), e = pe(ht, void 0), t = b(
|
|
709
715
|
() => {
|
|
710
|
-
var a,
|
|
716
|
+
var a, i;
|
|
711
717
|
return o(
|
|
712
718
|
(a = c(e)) == null ? void 0 : a.size,
|
|
713
719
|
d.size,
|
|
714
|
-
(
|
|
720
|
+
(i = c(n)) == null ? void 0 : i.size,
|
|
715
721
|
"md"
|
|
716
722
|
);
|
|
717
723
|
}
|
|
@@ -730,12 +736,12 @@ function ys(d) {
|
|
|
730
736
|
var a;
|
|
731
737
|
return o((a = c(e)) == null ? void 0 : a.variant, d.variant);
|
|
732
738
|
}
|
|
733
|
-
),
|
|
739
|
+
), r = b(
|
|
734
740
|
() => {
|
|
735
|
-
var a,
|
|
741
|
+
var a, i, f;
|
|
736
742
|
return o(
|
|
737
743
|
(a = c(n)) == null ? void 0 : a.disabled,
|
|
738
|
-
(
|
|
744
|
+
(i = c(n)) == null ? void 0 : i.readonly,
|
|
739
745
|
(f = c(e)) == null ? void 0 : f.disabled,
|
|
740
746
|
d.disabled
|
|
741
747
|
);
|
|
@@ -746,7 +752,7 @@ function ys(d) {
|
|
|
746
752
|
radioForm: s,
|
|
747
753
|
radioName: l,
|
|
748
754
|
radioVariant: u,
|
|
749
|
-
radioDisabled:
|
|
755
|
+
radioDisabled: r,
|
|
750
756
|
groupContext: e
|
|
751
757
|
};
|
|
752
758
|
}
|
|
@@ -763,7 +769,7 @@ function xs(d) {
|
|
|
763
769
|
};
|
|
764
770
|
}
|
|
765
771
|
function _s(d) {
|
|
766
|
-
const { getOption: o } = Ce(), n = pe(Be, void 0), e = pe(
|
|
772
|
+
const { getOption: o } = Ce(), n = pe(Be, void 0), e = pe(je, void 0), t = b(
|
|
767
773
|
() => {
|
|
768
774
|
var l;
|
|
769
775
|
return o(d.size, (l = c(n)) == null ? void 0 : l.size, "md");
|
|
@@ -797,11 +803,11 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
797
803
|
},
|
|
798
804
|
emits: ["click"],
|
|
799
805
|
setup(d, { emit: o }) {
|
|
800
|
-
const n = o, e = d, { btnTextType: t, btnSize: s, btnType: l, btnRound: u, btnDisabled:
|
|
801
|
-
const g = [], h = c(s), p = c(l),
|
|
802
|
-
return h !== "md" && g.push(`sq-button--${h}`), p && g.push(`is-${p}`),
|
|
803
|
-
}),
|
|
804
|
-
return (g, h) => (v(),
|
|
806
|
+
const n = o, e = d, { btnTextType: t, btnSize: s, btnType: l, btnRound: u, btnDisabled: r } = hs(e), a = b(() => {
|
|
807
|
+
const g = [], h = c(s), p = c(l), $ = c(u), z = c(t);
|
|
808
|
+
return h !== "md" && g.push(`sq-button--${h}`), p && g.push(`is-${p}`), $ && g.push("is-round"), z && g.push("is-text"), z && e.bg && g.push("has-bg"), g;
|
|
809
|
+
}), i = b(() => e.loading ? Me : e.icon), f = b(() => e.loading || c(r));
|
|
810
|
+
return (g, h) => (v(), _("button", {
|
|
805
811
|
class: V(["sq-button", a.value]),
|
|
806
812
|
disabled: f.value,
|
|
807
813
|
form: e.form,
|
|
@@ -811,9 +817,9 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
811
817
|
T(c(ge), {
|
|
812
818
|
size: c(s) === "lg" ? "md" : c(s)
|
|
813
819
|
}, {
|
|
814
|
-
default:
|
|
815
|
-
|
|
816
|
-
|
|
820
|
+
default: A(() => [
|
|
821
|
+
i.value ? (v(), C(ce(i.value), { key: 0 })) : D("", !0),
|
|
822
|
+
F(g.$slots, "default")
|
|
817
823
|
]),
|
|
818
824
|
_: 3
|
|
819
825
|
}, 8, ["size"])
|
|
@@ -838,8 +844,8 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
838
844
|
round: ne(o, "round"),
|
|
839
845
|
disabled: ne(o, "disabled")
|
|
840
846
|
})
|
|
841
|
-
), (n, e) => (v(),
|
|
842
|
-
|
|
847
|
+
), (n, e) => (v(), _("div", ws, [
|
|
848
|
+
F(n.$slots, "default")
|
|
843
849
|
]));
|
|
844
850
|
}
|
|
845
851
|
}), ct = Symbol("button-group-context-keys"), Cs = { class: "sq-card" }, Ss = {
|
|
@@ -857,18 +863,18 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
857
863
|
},
|
|
858
864
|
setup(d) {
|
|
859
865
|
const o = Re(), n = d;
|
|
860
|
-
return (e, t) => (v(),
|
|
861
|
-
n.title || c(o).title ? (v(),
|
|
862
|
-
|
|
866
|
+
return (e, t) => (v(), _("section", Cs, [
|
|
867
|
+
n.title || c(o).title ? (v(), _("div", Ss, [
|
|
868
|
+
O("h2", {
|
|
863
869
|
class: V({ "has-decorative": n.decorative }),
|
|
864
870
|
textContent: X(n.title)
|
|
865
871
|
}, null, 10, Bs),
|
|
866
|
-
|
|
867
|
-
])) :
|
|
868
|
-
|
|
869
|
-
c(o).footer ? (v(),
|
|
870
|
-
|
|
871
|
-
])) :
|
|
872
|
+
F(e.$slots, "title")
|
|
873
|
+
])) : D("", !0),
|
|
874
|
+
F(e.$slots, "default"),
|
|
875
|
+
c(o).footer ? (v(), _("div", zs, [
|
|
876
|
+
F(e.$slots, "footer")
|
|
877
|
+
])) : D("", !0)
|
|
872
878
|
]));
|
|
873
879
|
}
|
|
874
880
|
}), Rs = ["autofocus", "name", "form", "value", "disabled"], Ls = ["textContent"], Is = "sq-checkbox", dt = /* @__PURE__ */ L({
|
|
@@ -895,50 +901,50 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
895
901
|
checkboxDisabled: s,
|
|
896
902
|
checkboxForm: l,
|
|
897
903
|
checkboxName: u,
|
|
898
|
-
checkboxVariant:
|
|
904
|
+
checkboxVariant: r,
|
|
899
905
|
groupContext: a
|
|
900
|
-
} = gs(e),
|
|
901
|
-
const h = [], p = c(t),
|
|
902
|
-
return p !== "md" && h.push(`sq-selection--${p}`), g.value && h.push("is-checked"),
|
|
903
|
-
}), g = b(() => a ? c(a).list.includes(e.value) :
|
|
906
|
+
} = gs(e), i = le(d, "checked"), f = b(() => {
|
|
907
|
+
const h = [], p = c(t), $ = c(s), z = c(r);
|
|
908
|
+
return p !== "md" && h.push(`sq-selection--${p}`), g.value && h.push("is-checked"), $ && h.push("is-disabled"), z && h.push(`is-${z}`), h;
|
|
909
|
+
}), g = b(() => a ? c(a).list.includes(e.value) : i.value);
|
|
904
910
|
return oe(g, (h) => {
|
|
905
|
-
if (
|
|
906
|
-
|
|
911
|
+
if (i.value !== h) {
|
|
912
|
+
i.value = h;
|
|
907
913
|
return;
|
|
908
914
|
}
|
|
909
|
-
}), oe(
|
|
915
|
+
}), oe(i, (h) => {
|
|
910
916
|
g.value !== h && a && a.value.toggleItem(e.value);
|
|
911
917
|
}), ie(() => {
|
|
912
|
-
|
|
913
|
-
}), (h, p) => (v(),
|
|
918
|
+
i.value = g.value;
|
|
919
|
+
}), (h, p) => (v(), _("label", {
|
|
914
920
|
class: V(["sq-selection sq-checkbox", f.value])
|
|
915
921
|
}, [
|
|
916
|
-
ae(
|
|
922
|
+
ae(O("input", {
|
|
917
923
|
type: "checkbox",
|
|
918
924
|
autofocus: e.autofocus,
|
|
919
925
|
name: c(u),
|
|
920
926
|
form: c(l),
|
|
921
927
|
value: e.value,
|
|
922
928
|
disabled: c(s),
|
|
923
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
924
|
-
onChange: p[1] || (p[1] = (
|
|
929
|
+
"onUpdate:modelValue": p[0] || (p[0] = ($) => i.value = $),
|
|
930
|
+
onChange: p[1] || (p[1] = ($) => n("change", i.value))
|
|
925
931
|
}, null, 40, Rs), [
|
|
926
|
-
[Qe,
|
|
932
|
+
[Qe, i.value]
|
|
927
933
|
]),
|
|
928
|
-
c(
|
|
934
|
+
c(r) !== "solid" ? (v(), _("span", {
|
|
929
935
|
key: 0,
|
|
930
936
|
class: V(["sq-checkbox-box", { "is-indeterminate": e.indeterminate && !g.value }])
|
|
931
937
|
}, [
|
|
932
|
-
g.value ? (v(),
|
|
938
|
+
g.value ? (v(), C(c(at), {
|
|
933
939
|
key: 0,
|
|
934
940
|
class: "sq-checkbox-inner"
|
|
935
|
-
})) :
|
|
936
|
-
], 2)) :
|
|
937
|
-
e.label ? (v(),
|
|
941
|
+
})) : D("", !0)
|
|
942
|
+
], 2)) : D("", !0),
|
|
943
|
+
e.label ? (v(), _("span", {
|
|
938
944
|
key: 1,
|
|
939
945
|
class: "sq-selection-label",
|
|
940
946
|
textContent: X(e.label)
|
|
941
|
-
}, null, 8, Ls)) :
|
|
947
|
+
}, null, 8, Ls)) : D("", !0)
|
|
942
948
|
], 2));
|
|
943
949
|
}
|
|
944
950
|
}), Ms = { class: "sq-checkbox-group sq-selection-group" }, Es = "sq-checkbox-group", As = /* @__PURE__ */ L({
|
|
@@ -969,20 +975,20 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
969
975
|
})
|
|
970
976
|
), oe(
|
|
971
977
|
() => t.value,
|
|
972
|
-
(
|
|
973
|
-
const a =
|
|
974
|
-
|
|
978
|
+
(r) => {
|
|
979
|
+
const a = r || [], i = [.../* @__PURE__ */ new Set([...a, s.value])];
|
|
980
|
+
i.length === a.length && i.length === s.value.length || (s.value = a);
|
|
975
981
|
}
|
|
976
982
|
);
|
|
977
|
-
function u(
|
|
978
|
-
s.value.includes(
|
|
983
|
+
function u(r) {
|
|
984
|
+
s.value.includes(r) ? s.value = s.value.filter((a) => a !== r) : s.value.push(r), e("change", ke(s.value)), e("update:value", ke(s.value));
|
|
979
985
|
}
|
|
980
|
-
return (
|
|
981
|
-
|
|
982
|
-
(v(!0),
|
|
986
|
+
return (r, a) => (v(), _("div", Ms, [
|
|
987
|
+
F(r.$slots, "default", {}, () => [
|
|
988
|
+
(v(!0), _(te, null, de(t.items, (i, f) => (v(), C(c(dt), {
|
|
983
989
|
key: f,
|
|
984
|
-
label:
|
|
985
|
-
value:
|
|
990
|
+
label: i.toString(),
|
|
991
|
+
value: i
|
|
986
992
|
}, null, 8, ["label", "value"]))), 128))
|
|
987
993
|
])
|
|
988
994
|
]));
|
|
@@ -1005,7 +1011,7 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1005
1011
|
});
|
|
1006
1012
|
}), he(() => {
|
|
1007
1013
|
n();
|
|
1008
|
-
}), (s, l) => (v(),
|
|
1014
|
+
}), (s, l) => (v(), _("div", {
|
|
1009
1015
|
class: "sq-code",
|
|
1010
1016
|
innerHTML: t.value
|
|
1011
1017
|
}, null, 8, Ds));
|
|
@@ -1026,14 +1032,14 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1026
1032
|
setup(d, { emit: o }) {
|
|
1027
1033
|
const { nextZIndex: n } = He(), e = Ne();
|
|
1028
1034
|
let t;
|
|
1029
|
-
const s = o, l = d, u = R(0),
|
|
1030
|
-
|
|
1035
|
+
const s = o, l = d, u = R(0), r = R(!1), a = le(d, "visible");
|
|
1036
|
+
r.value = a.value, oe(a, (h) => {
|
|
1031
1037
|
const p = document.scrollingElement;
|
|
1032
|
-
h ? (t = p.style.overflow, p.style.overflow = "hidden", u.value = n(),
|
|
1038
|
+
h ? (t = p.style.overflow, p.style.overflow = "hidden", u.value = n(), r.value = !0, document.addEventListener("keydown", i)) : (p.style.overflow = t, document.removeEventListener("keydown", i));
|
|
1033
1039
|
}), he(() => {
|
|
1034
|
-
document.removeEventListener("keydown",
|
|
1040
|
+
document.removeEventListener("keydown", i);
|
|
1035
1041
|
});
|
|
1036
|
-
function
|
|
1042
|
+
function i(h) {
|
|
1037
1043
|
h.key === "Escape" && l.keyboard && g();
|
|
1038
1044
|
}
|
|
1039
1045
|
function f() {
|
|
@@ -1050,24 +1056,24 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1050
1056
|
}).catch(() => {
|
|
1051
1057
|
}) : h && (a.value = !1);
|
|
1052
1058
|
}
|
|
1053
|
-
return (h, p) => (v(),
|
|
1059
|
+
return (h, p) => (v(), C(et, { to: "body" }, [
|
|
1054
1060
|
T(be, {
|
|
1055
1061
|
name: "sq-fade",
|
|
1056
|
-
onBeforeEnter: p[0] || (p[0] = (
|
|
1057
|
-
onAfterEnter: p[1] || (p[1] = (
|
|
1058
|
-
onBeforeLeave: p[2] || (p[2] = (
|
|
1059
|
-
onAfterLeave: p[3] || (p[3] = (
|
|
1062
|
+
onBeforeEnter: p[0] || (p[0] = ($) => s("open")),
|
|
1063
|
+
onAfterEnter: p[1] || (p[1] = ($) => s("opened")),
|
|
1064
|
+
onBeforeLeave: p[2] || (p[2] = ($) => s("close")),
|
|
1065
|
+
onAfterLeave: p[3] || (p[3] = ($) => s("closed"))
|
|
1060
1066
|
}, {
|
|
1061
|
-
default:
|
|
1062
|
-
|
|
1067
|
+
default: A(() => [
|
|
1068
|
+
r.value ? ae((v(), _("div", fe({
|
|
1063
1069
|
key: 0,
|
|
1064
1070
|
class: "sq-mask",
|
|
1065
1071
|
style: { zIndex: u.value }
|
|
1066
1072
|
}, c(e), { onClick: f }), [
|
|
1067
|
-
|
|
1073
|
+
F(h.$slots, "default")
|
|
1068
1074
|
], 16)), [
|
|
1069
1075
|
[ve, a.value]
|
|
1070
|
-
]) :
|
|
1076
|
+
]) : D("", !0)
|
|
1071
1077
|
]),
|
|
1072
1078
|
_: 3
|
|
1073
1079
|
})
|
|
@@ -1079,8 +1085,8 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1079
1085
|
}, Fs = ["textContent"], Vs = { class: "sq-dialog-body" }, Hs = {
|
|
1080
1086
|
key: 1,
|
|
1081
1087
|
class: "sq-dialog-footer"
|
|
1082
|
-
},
|
|
1083
|
-
name:
|
|
1088
|
+
}, js = "sq-dialog", Ws = /* @__PURE__ */ L({
|
|
1089
|
+
name: js,
|
|
1084
1090
|
inheritAttrs: !1,
|
|
1085
1091
|
__name: "dialog",
|
|
1086
1092
|
props: /* @__PURE__ */ G({
|
|
@@ -1102,9 +1108,9 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1102
1108
|
}),
|
|
1103
1109
|
emits: /* @__PURE__ */ G(["open", "opened", "close", "closed"], ["update:visible"]),
|
|
1104
1110
|
setup(d, { emit: o }) {
|
|
1105
|
-
const n = Re(), e = Ne(), t = o, s = d, l = R(!1), u = R(!1),
|
|
1106
|
-
const
|
|
1107
|
-
return s.type &&
|
|
1111
|
+
const n = Re(), e = Ne(), t = o, s = d, l = R(!1), u = R(!1), r = le(d, "visible"), a = b(() => !!s.title || !!n.header), i = b(() => {
|
|
1112
|
+
const M = [];
|
|
1113
|
+
return s.type && M.push(`is-${s.type}`), a.value && M.push("has-header"), [M];
|
|
1108
1114
|
}), f = b(() => s.type ? Fe[s.type] : void 0), g = b(() => ({
|
|
1109
1115
|
type: s.type ?? "primary",
|
|
1110
1116
|
loading: l.value && u.value,
|
|
@@ -1117,74 +1123,74 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1117
1123
|
disabled: l.value && u.value,
|
|
1118
1124
|
...s.cancelButtonProps
|
|
1119
1125
|
})), p = b(
|
|
1120
|
-
() => g.value.loading || h.value.loading || !
|
|
1126
|
+
() => g.value.loading || h.value.loading || !r.value
|
|
1121
1127
|
);
|
|
1122
|
-
function
|
|
1128
|
+
function $(M) {
|
|
1123
1129
|
if (p.value) return !1;
|
|
1124
|
-
if (typeof
|
|
1125
|
-
const
|
|
1126
|
-
return
|
|
1130
|
+
if (typeof M != "function") return !0;
|
|
1131
|
+
const I = M();
|
|
1132
|
+
return I instanceof Promise ? (l.value = !0, I.finally(() => {
|
|
1127
1133
|
l.value = !1;
|
|
1128
|
-
})) :
|
|
1134
|
+
})) : I;
|
|
1129
1135
|
}
|
|
1130
|
-
async function
|
|
1136
|
+
async function z() {
|
|
1131
1137
|
if (p.value) return !1;
|
|
1132
|
-
u.value = !1, await
|
|
1138
|
+
u.value = !1, await $(s.beforeClose) && (r.value = !1);
|
|
1133
1139
|
}
|
|
1134
|
-
async function
|
|
1135
|
-
u.value = !0, await
|
|
1140
|
+
async function B() {
|
|
1141
|
+
u.value = !0, await $(s.onOk) && (r.value = !1);
|
|
1136
1142
|
}
|
|
1137
|
-
return (
|
|
1138
|
-
visible:
|
|
1139
|
-
"onUpdate:visible":
|
|
1143
|
+
return (M, I) => (v(), C(c(pt), {
|
|
1144
|
+
visible: r.value,
|
|
1145
|
+
"onUpdate:visible": I[0] || (I[0] = (j) => r.value = j),
|
|
1140
1146
|
"mask-closeable": s.maskCloseable,
|
|
1141
1147
|
keyboard: s.keyboard,
|
|
1142
|
-
"before-close": () =>
|
|
1143
|
-
onOpen:
|
|
1144
|
-
onOpened:
|
|
1145
|
-
onClose:
|
|
1146
|
-
onClosed:
|
|
1148
|
+
"before-close": () => $(s.beforeClose),
|
|
1149
|
+
onOpen: I[1] || (I[1] = (j) => t("open")),
|
|
1150
|
+
onOpened: I[2] || (I[2] = (j) => t("opened")),
|
|
1151
|
+
onClose: I[3] || (I[3] = (j) => t("close")),
|
|
1152
|
+
onClosed: I[4] || (I[4] = (j) => t("closed"))
|
|
1147
1153
|
}, {
|
|
1148
|
-
default:
|
|
1149
|
-
|
|
1150
|
-
class: V(["sq-dialog", [
|
|
1154
|
+
default: A(() => [
|
|
1155
|
+
O("div", {
|
|
1156
|
+
class: V(["sq-dialog", [i.value, c(e).class]]),
|
|
1151
1157
|
style: K(c(e).style)
|
|
1152
1158
|
}, [
|
|
1153
|
-
a.value ? (v(),
|
|
1154
|
-
f.value ? (v(),
|
|
1159
|
+
a.value ? (v(), _("div", Us, [
|
|
1160
|
+
f.value ? (v(), C(ce(f.value), {
|
|
1155
1161
|
key: 0,
|
|
1156
1162
|
class: "sq-dialog-header-icon"
|
|
1157
|
-
})) :
|
|
1158
|
-
|
|
1159
|
-
|
|
1163
|
+
})) : D("", !0),
|
|
1164
|
+
F(M.$slots, "header", {}, () => [
|
|
1165
|
+
O("span", {
|
|
1160
1166
|
class: "sq-dialog-header-title",
|
|
1161
1167
|
textContent: X(s.title)
|
|
1162
1168
|
}, null, 8, Fs)
|
|
1163
1169
|
]),
|
|
1164
1170
|
T(c(Ue), {
|
|
1165
1171
|
class: "sq-dialog-close",
|
|
1166
|
-
onClick:
|
|
1172
|
+
onClick: z
|
|
1167
1173
|
})
|
|
1168
|
-
])) :
|
|
1169
|
-
|
|
1170
|
-
|
|
1174
|
+
])) : D("", !0),
|
|
1175
|
+
O("div", Vs, [
|
|
1176
|
+
F(M.$slots, "default")
|
|
1171
1177
|
]),
|
|
1172
|
-
s.footer ? (v(),
|
|
1173
|
-
|
|
1174
|
-
T(c(Y), fe(h.value, { onClick:
|
|
1175
|
-
default:
|
|
1178
|
+
s.footer ? (v(), _("div", Hs, [
|
|
1179
|
+
F(M.$slots, "footer", {}, () => [
|
|
1180
|
+
T(c(Y), fe(h.value, { onClick: z }), {
|
|
1181
|
+
default: A(() => [
|
|
1176
1182
|
Te(X(s.cancelText), 1)
|
|
1177
1183
|
]),
|
|
1178
1184
|
_: 1
|
|
1179
1185
|
}, 16),
|
|
1180
|
-
T(c(Y), fe(g.value, { onClick:
|
|
1181
|
-
default:
|
|
1186
|
+
T(c(Y), fe(g.value, { onClick: B }), {
|
|
1187
|
+
default: A(() => [
|
|
1182
1188
|
Te(X(s.okText), 1)
|
|
1183
1189
|
]),
|
|
1184
1190
|
_: 1
|
|
1185
1191
|
}, 16)
|
|
1186
1192
|
])
|
|
1187
|
-
])) :
|
|
1193
|
+
])) : D("", !0)
|
|
1188
1194
|
], 6)
|
|
1189
1195
|
]),
|
|
1190
1196
|
_: 3
|
|
@@ -1205,20 +1211,20 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1205
1211
|
const t = [`sq-divider--${n.direction}`];
|
|
1206
1212
|
return ["none", "solid", "dotted", "dashed"].includes(n.variant) && t.push("is-thin"), o.default && n.direction !== "vertical" && t.push(`text-${n.orientation}`), t;
|
|
1207
1213
|
});
|
|
1208
|
-
return (t, s) => (v(),
|
|
1214
|
+
return (t, s) => (v(), _("div", {
|
|
1209
1215
|
class: V(["sq-divider", e.value]),
|
|
1210
1216
|
style: K({ "--divider-line-type": n.variant })
|
|
1211
1217
|
}, [
|
|
1212
|
-
c(o).default && n.direction !== "vertical" ? (v(),
|
|
1218
|
+
c(o).default && n.direction !== "vertical" ? (v(), C(c(ge), {
|
|
1213
1219
|
key: 0,
|
|
1214
1220
|
ellipsis: n.ellipsis,
|
|
1215
1221
|
size: n.size
|
|
1216
1222
|
}, {
|
|
1217
|
-
default:
|
|
1218
|
-
|
|
1223
|
+
default: A(() => [
|
|
1224
|
+
F(t.$slots, "default")
|
|
1219
1225
|
]),
|
|
1220
1226
|
_: 3
|
|
1221
|
-
}, 8, ["ellipsis", "size"])) :
|
|
1227
|
+
}, 8, ["ellipsis", "size"])) : D("", !0)
|
|
1222
1228
|
], 6));
|
|
1223
1229
|
}
|
|
1224
1230
|
}), Ys = "sq-editor-bold", Ks = /* @__PURE__ */ L({
|
|
@@ -1236,23 +1242,23 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1236
1242
|
const e = n, t = d;
|
|
1237
1243
|
function s() {
|
|
1238
1244
|
if (t.disabled) return;
|
|
1239
|
-
const l = [...t.rows], u = l[t.selectedRow],
|
|
1240
|
-
let
|
|
1241
|
-
if (
|
|
1242
|
-
|
|
1245
|
+
const l = [...t.rows], u = l[t.selectedRow], r = u.substring(0, t.selectInfo.startOfRow), a = u.substring(t.selectInfo.endOfRow);
|
|
1246
|
+
let i = t.selectedVal ?? "";
|
|
1247
|
+
if (i.match(/\*\*\*.*?\*\*\*/)) {
|
|
1248
|
+
i = i.replaceAll("***", "*"), l[t.selectedRow] = `${r}${i}${a}`, e("updateText", l, 0, -4);
|
|
1243
1249
|
return;
|
|
1244
1250
|
}
|
|
1245
|
-
if (
|
|
1246
|
-
|
|
1251
|
+
if (i.match(/\*\*.*?\*\*/)) {
|
|
1252
|
+
i = i.replaceAll("**", ""), l[t.selectedRow] = `${r}${i}${a}`, e("updateText", l, 0, -4);
|
|
1247
1253
|
return;
|
|
1248
1254
|
}
|
|
1249
|
-
|
|
1255
|
+
i = `**${i}**`, l[t.selectedRow] = `${r}${i}${a}`, e("updateText", l, 0, 4);
|
|
1250
1256
|
}
|
|
1251
|
-
return o({ setBold: s }), (l, u) => (v(),
|
|
1257
|
+
return o({ setBold: s }), (l, u) => (v(), C(c(re), {
|
|
1252
1258
|
tip: "加粗 ( Ctrl + B )",
|
|
1253
1259
|
disabled: t.disabled
|
|
1254
1260
|
}, {
|
|
1255
|
-
default:
|
|
1261
|
+
default: A(() => [
|
|
1256
1262
|
T(c(Y), {
|
|
1257
1263
|
text: "",
|
|
1258
1264
|
icon: c(Ct),
|
|
@@ -1278,31 +1284,31 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1278
1284
|
const e = n, t = d;
|
|
1279
1285
|
function s() {
|
|
1280
1286
|
if (t.disabled) return;
|
|
1281
|
-
const l = [...t.rows], u = l[t.selectedRow],
|
|
1282
|
-
let
|
|
1283
|
-
if (
|
|
1284
|
-
|
|
1287
|
+
const l = [...t.rows], u = l[t.selectedRow], r = u.substring(0, t.selectInfo.startOfRow), a = u.substring(t.selectInfo.endOfRow);
|
|
1288
|
+
let i = t.selectedVal ?? "";
|
|
1289
|
+
if (i.match(/\*\*\*.*?\*\*\*/)) {
|
|
1290
|
+
i = i.replaceAll("***", "**"), l[t.selectedRow] = `${r}${i}${a}`, e("updateText", l, 0, -2);
|
|
1285
1291
|
return;
|
|
1286
1292
|
}
|
|
1287
|
-
const g =
|
|
1293
|
+
const g = i.match(/\*\*.*?\*\*/), p = ((g == null ? void 0 : g[0]) ?? "").replaceAll("**", "").match(/\*.*?\*/);
|
|
1288
1294
|
if (g && !p) {
|
|
1289
|
-
|
|
1295
|
+
i = `*${i}*`, l[t.selectedRow] = `${r}${i}${a}`, e("updateText", l, 0, 2);
|
|
1290
1296
|
return;
|
|
1291
1297
|
} else if (p) {
|
|
1292
|
-
|
|
1298
|
+
i = i.replaceAll("**", "[B]").replaceAll("*", "").replaceAll("[B]", "**"), l[t.selectedRow] = `${r}${i}${a}`, e("updateText", l, 0, -2);
|
|
1293
1299
|
return;
|
|
1294
1300
|
}
|
|
1295
|
-
if (
|
|
1296
|
-
|
|
1301
|
+
if (i.match(/\*.*?\*/)) {
|
|
1302
|
+
i = i.replaceAll("*", ""), l[t.selectedRow] = `${r}${i}${a}`, e("updateText", l, 0, -2);
|
|
1297
1303
|
return;
|
|
1298
1304
|
}
|
|
1299
|
-
|
|
1305
|
+
i = `*${i}*`, l[t.selectedRow] = `${r}${i}${a}`, e("updateText", l, 0, 2);
|
|
1300
1306
|
}
|
|
1301
|
-
return o({ setItalic: s }), (l, u) => (v(),
|
|
1307
|
+
return o({ setItalic: s }), (l, u) => (v(), C(c(re), {
|
|
1302
1308
|
tip: "斜体 ( Ctrl + I )",
|
|
1303
1309
|
disabled: t.disabled
|
|
1304
1310
|
}, {
|
|
1305
|
-
default:
|
|
1311
|
+
default: A(() => [
|
|
1306
1312
|
T(c(Y), {
|
|
1307
1313
|
text: "",
|
|
1308
1314
|
icon: c(St),
|
|
@@ -1329,22 +1335,22 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1329
1335
|
function s() {
|
|
1330
1336
|
var p;
|
|
1331
1337
|
if (t.disabled) return;
|
|
1332
|
-
const l = [...t.rows], u = l[t.selectedRow],
|
|
1338
|
+
const l = [...t.rows], u = l[t.selectedRow], r = u.substring(0, t.selectInfo.startOfRow), a = u.substring(t.selectInfo.endOfRow), i = /<u\b.*?>/;
|
|
1333
1339
|
let f = t.selectedVal ?? "";
|
|
1334
|
-
const g = ((p = f.match(
|
|
1340
|
+
const g = ((p = f.match(i)) == null ? void 0 : p[0]) ?? "";
|
|
1335
1341
|
if (f.match(/<u\b.*?>.*?<\/u>/)) {
|
|
1336
1342
|
f = f.replace(g, "").replace("</u>", "");
|
|
1337
|
-
const
|
|
1338
|
-
l[t.selectedRow] = `${
|
|
1343
|
+
const $ = g.length + 4;
|
|
1344
|
+
l[t.selectedRow] = `${r}${f}${a}`, e("updateText", l, 0, -$);
|
|
1339
1345
|
return;
|
|
1340
1346
|
}
|
|
1341
|
-
f = `<u>${f}</u>`, l[t.selectedRow] = `${
|
|
1347
|
+
f = `<u>${f}</u>`, l[t.selectedRow] = `${r}${f}${a}`, e("updateText", l, 0, 7);
|
|
1342
1348
|
}
|
|
1343
|
-
return o({ setUnderline: s }), (l, u) => (v(),
|
|
1349
|
+
return o({ setUnderline: s }), (l, u) => (v(), C(c(re), {
|
|
1344
1350
|
tip: "下划线 ( Ctrl + U )",
|
|
1345
1351
|
disabled: t.disabled
|
|
1346
1352
|
}, {
|
|
1347
|
-
default:
|
|
1353
|
+
default: A(() => [
|
|
1348
1354
|
T(c(Y), {
|
|
1349
1355
|
text: "",
|
|
1350
1356
|
icon: c(Bt),
|
|
@@ -1370,19 +1376,19 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1370
1376
|
const n = o, e = d;
|
|
1371
1377
|
function t() {
|
|
1372
1378
|
if (e.disabled) return;
|
|
1373
|
-
const s = [...e.rows], l = s[e.selectedRow], u = l.substring(0, e.selectInfo.startOfRow),
|
|
1379
|
+
const s = [...e.rows], l = s[e.selectedRow], u = l.substring(0, e.selectInfo.startOfRow), r = l.substring(e.selectInfo.endOfRow);
|
|
1374
1380
|
let a = e.selectedVal ?? "";
|
|
1375
1381
|
if (a.match(/\~\~.*?\~\~/)) {
|
|
1376
|
-
a = a.replaceAll("~~", ""), s[e.selectedRow] = `${u}${a}${
|
|
1382
|
+
a = a.replaceAll("~~", ""), s[e.selectedRow] = `${u}${a}${r}`, n("updateText", s, 0, -4);
|
|
1377
1383
|
return;
|
|
1378
1384
|
}
|
|
1379
|
-
a = `~~${a}~~`, s[e.selectedRow] = `${u}${a}${
|
|
1385
|
+
a = `~~${a}~~`, s[e.selectedRow] = `${u}${a}${r}`, n("updateText", s, 0, 4);
|
|
1380
1386
|
}
|
|
1381
|
-
return (s, l) => (v(),
|
|
1387
|
+
return (s, l) => (v(), C(c(re), {
|
|
1382
1388
|
tip: "删除线",
|
|
1383
1389
|
disabled: e.disabled
|
|
1384
1390
|
}, {
|
|
1385
|
-
default:
|
|
1391
|
+
default: A(() => [
|
|
1386
1392
|
T(c(Y), {
|
|
1387
1393
|
text: "",
|
|
1388
1394
|
icon: c(zt),
|
|
@@ -1409,22 +1415,22 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1409
1415
|
function t() {
|
|
1410
1416
|
var h;
|
|
1411
1417
|
if (e.disabled) return;
|
|
1412
|
-
const s = [...e.rows], l = s[e.selectedRow], u = l.substring(0, e.selectInfo.startOfRow),
|
|
1413
|
-
let
|
|
1414
|
-
const f = ((h =
|
|
1415
|
-
if (
|
|
1416
|
-
|
|
1418
|
+
const s = [...e.rows], l = s[e.selectedRow], u = l.substring(0, e.selectInfo.startOfRow), r = l.substring(e.selectInfo.endOfRow), a = /<blur\b.*?>/;
|
|
1419
|
+
let i = e.selectedVal ?? "";
|
|
1420
|
+
const f = ((h = i.match(a)) == null ? void 0 : h[0]) ?? "";
|
|
1421
|
+
if (i.match(/<blur\b.*?>.*?<\/blur>/)) {
|
|
1422
|
+
i = i.replace(f, "").replace("</blur>", "");
|
|
1417
1423
|
const p = f.length + 7;
|
|
1418
|
-
s[e.selectedRow] = `${u}${
|
|
1424
|
+
s[e.selectedRow] = `${u}${i}${r}`, n("updateText", s, 0, -p);
|
|
1419
1425
|
return;
|
|
1420
1426
|
}
|
|
1421
|
-
|
|
1427
|
+
i = `<blur>${i}</blur>`, s[e.selectedRow] = `${u}${i}${r}`, n("updateText", s, 0, 13);
|
|
1422
1428
|
}
|
|
1423
|
-
return (s, l) => (v(),
|
|
1429
|
+
return (s, l) => (v(), C(c(re), {
|
|
1424
1430
|
tip: "模糊块",
|
|
1425
1431
|
disabled: e.disabled
|
|
1426
1432
|
}, {
|
|
1427
|
-
default:
|
|
1433
|
+
default: A(() => [
|
|
1428
1434
|
T(c(Y), {
|
|
1429
1435
|
text: "",
|
|
1430
1436
|
icon: c(lt),
|
|
@@ -1449,32 +1455,32 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1449
1455
|
setup(d, { emit: o }) {
|
|
1450
1456
|
const n = o, e = d;
|
|
1451
1457
|
function t() {
|
|
1452
|
-
const
|
|
1453
|
-
if (s(
|
|
1454
|
-
a[
|
|
1458
|
+
const r = e.selectedRow, a = [...e.rows], i = a[r];
|
|
1459
|
+
if (s(i)) {
|
|
1460
|
+
a[r] = i.replace("- ", ""), n("updateText", a, -2, -2);
|
|
1455
1461
|
return;
|
|
1456
1462
|
}
|
|
1457
|
-
if (l(
|
|
1458
|
-
const f = u(
|
|
1459
|
-
a[
|
|
1463
|
+
if (l(i)) {
|
|
1464
|
+
const f = u(i), g = 2 - f.length;
|
|
1465
|
+
a[r] = i.replace(f, "- "), n("updateText", a, g, g);
|
|
1460
1466
|
return;
|
|
1461
1467
|
}
|
|
1462
|
-
a[
|
|
1468
|
+
a[r] = `- ${i}`, n("updateText", a, 2, 2);
|
|
1463
1469
|
}
|
|
1464
|
-
function s(
|
|
1465
|
-
return
|
|
1470
|
+
function s(r) {
|
|
1471
|
+
return r.replace(" ", "").startsWith("- ");
|
|
1466
1472
|
}
|
|
1467
|
-
function l(
|
|
1468
|
-
return /^\d+\.\s+/.test(
|
|
1473
|
+
function l(r) {
|
|
1474
|
+
return /^\d+\.\s+/.test(r.replace(" ", ""));
|
|
1469
1475
|
}
|
|
1470
|
-
function u(
|
|
1471
|
-
return
|
|
1476
|
+
function u(r) {
|
|
1477
|
+
return r.replace(" ", "").match(/^\d+\.\s/)[0];
|
|
1472
1478
|
}
|
|
1473
|
-
return (
|
|
1479
|
+
return (r, a) => (v(), C(c(re), {
|
|
1474
1480
|
tip: "无序列表",
|
|
1475
1481
|
disabled: e.disabled
|
|
1476
1482
|
}, {
|
|
1477
|
-
default:
|
|
1483
|
+
default: A(() => [
|
|
1478
1484
|
T(c(Y), {
|
|
1479
1485
|
text: "",
|
|
1480
1486
|
icon: c(Tt),
|
|
@@ -1499,37 +1505,37 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1499
1505
|
setup(d, { emit: o }) {
|
|
1500
1506
|
const n = o, e = d;
|
|
1501
1507
|
function t() {
|
|
1502
|
-
const
|
|
1508
|
+
const r = e.selectedRow, a = [...e.rows], i = a[r], f = r > 0 ? a[r - 1] : "";
|
|
1503
1509
|
let g = 1;
|
|
1504
|
-
if (s(
|
|
1510
|
+
if (s(i)) {
|
|
1505
1511
|
f && l(f) && (g = parseInt(u(f)) + 1);
|
|
1506
|
-
const
|
|
1507
|
-
a[
|
|
1512
|
+
const $ = `${g}. `, z = $.length - 2;
|
|
1513
|
+
a[r] = i.replace("- ", $), n("updateText", a, z, z);
|
|
1508
1514
|
return;
|
|
1509
1515
|
}
|
|
1510
|
-
if (l(
|
|
1511
|
-
const
|
|
1512
|
-
a[
|
|
1516
|
+
if (l(i)) {
|
|
1517
|
+
const $ = u(i), z = -$.length;
|
|
1518
|
+
a[r] = i.replace($, ""), n("updateText", a, z, z);
|
|
1513
1519
|
return;
|
|
1514
1520
|
}
|
|
1515
1521
|
f && l(f) && (g = parseInt(u(f)) + 1);
|
|
1516
1522
|
const h = `${g}. `, p = h.length;
|
|
1517
|
-
a[
|
|
1523
|
+
a[r] = `${h}${i}`, n("updateText", a, p, p);
|
|
1518
1524
|
}
|
|
1519
|
-
function s(
|
|
1520
|
-
return
|
|
1525
|
+
function s(r) {
|
|
1526
|
+
return r.replace(" ", "").startsWith("- ");
|
|
1521
1527
|
}
|
|
1522
|
-
function l(
|
|
1523
|
-
return /^\d+\.\s+/.test(
|
|
1528
|
+
function l(r) {
|
|
1529
|
+
return /^\d+\.\s+/.test(r.replace(" ", ""));
|
|
1524
1530
|
}
|
|
1525
|
-
function u(
|
|
1526
|
-
return
|
|
1531
|
+
function u(r) {
|
|
1532
|
+
return r.replace(" ", "").match(/^\d+\.\s/)[0];
|
|
1527
1533
|
}
|
|
1528
|
-
return (
|
|
1534
|
+
return (r, a) => (v(), C(c(re), {
|
|
1529
1535
|
tip: "有序列表",
|
|
1530
1536
|
disabled: e.disabled
|
|
1531
1537
|
}, {
|
|
1532
|
-
default:
|
|
1538
|
+
default: A(() => [
|
|
1533
1539
|
T(c(Y), {
|
|
1534
1540
|
text: "",
|
|
1535
1541
|
icon: c(Rt),
|
|
@@ -1569,105 +1575,105 @@ const $s = ["disabled", "form", "type"], ks = "sq-button", Y = /* @__PURE__ */ L
|
|
|
1569
1575
|
}
|
|
1570
1576
|
];
|
|
1571
1577
|
let n;
|
|
1572
|
-
const e = d, t = R("edit"), s = R([]), l = R(!1), u = R(""),
|
|
1578
|
+
const e = d, t = R("edit"), s = R([]), l = R(!1), u = R(""), r = R(), a = R({}), i = ue(null), f = ue(null), g = ue(null), h = ue(
|
|
1573
1579
|
null
|
|
1574
|
-
), p = le(d, "value"),
|
|
1580
|
+
), p = le(d, "value"), $ = b(() => {
|
|
1575
1581
|
const k = [];
|
|
1576
1582
|
return e.size !== "md" && k.push(`sq-editor--${e.size}`), e.round && k.push("is-round"), k;
|
|
1577
|
-
}),
|
|
1583
|
+
}), z = b(
|
|
1578
1584
|
() => u.value.length && !u.value.includes(`
|
|
1579
1585
|
`) && u.value !== " " && !e.disabled
|
|
1580
|
-
),
|
|
1581
|
-
() =>
|
|
1582
|
-
),
|
|
1586
|
+
), B = b(
|
|
1587
|
+
() => r.value !== void 0 && !u.value.length && !e.disabled
|
|
1588
|
+
), M = b(
|
|
1583
1589
|
() => typeof e.beforePreview == "function" ? e.beforePreview(p.value) : p.value
|
|
1584
1590
|
);
|
|
1585
1591
|
ie(() => {
|
|
1586
|
-
document.addEventListener("selectionchange", J), document.addEventListener("click",
|
|
1592
|
+
document.addEventListener("selectionchange", J), document.addEventListener("click", ee);
|
|
1587
1593
|
}), he(() => {
|
|
1588
|
-
document.removeEventListener("selectionchange", J), document.removeEventListener("click",
|
|
1594
|
+
document.removeEventListener("selectionchange", J), document.removeEventListener("click", ee);
|
|
1589
1595
|
});
|
|
1590
|
-
function
|
|
1596
|
+
function I(k) {
|
|
1591
1597
|
k === "edit" && Le(() => {
|
|
1592
|
-
var
|
|
1593
|
-
(
|
|
1598
|
+
var x;
|
|
1599
|
+
(x = i.value) == null || x.focus();
|
|
1594
1600
|
});
|
|
1595
1601
|
}
|
|
1596
|
-
function
|
|
1597
|
-
var
|
|
1598
|
-
const
|
|
1602
|
+
function j(k) {
|
|
1603
|
+
var N, H, E;
|
|
1604
|
+
const x = s.value[r.value], S = (x == null ? void 0 : x.replace(" ", "")) ?? "";
|
|
1599
1605
|
if (k.key === "Tab") {
|
|
1600
1606
|
k.preventDefault();
|
|
1601
|
-
const
|
|
1602
|
-
s.value[
|
|
1607
|
+
const U = x.substring(0, a.value.startOfRow), q = x.substring(a.value.endOfRow);
|
|
1608
|
+
s.value[r.value] = `${U} ${q}`, m(s.value, 1, 1);
|
|
1603
1609
|
return;
|
|
1604
1610
|
}
|
|
1605
1611
|
if (k.ctrlKey)
|
|
1606
1612
|
switch (k.key.toUpperCase()) {
|
|
1607
1613
|
case "B":
|
|
1608
|
-
(
|
|
1614
|
+
(N = f.value) == null || N.setBold();
|
|
1609
1615
|
return;
|
|
1610
1616
|
case "I":
|
|
1611
|
-
(
|
|
1617
|
+
(H = g.value) == null || H.setItalic();
|
|
1612
1618
|
return;
|
|
1613
1619
|
case "U":
|
|
1614
|
-
k.preventDefault(), (
|
|
1620
|
+
k.preventDefault(), (E = h.value) == null || E.setUnderline();
|
|
1615
1621
|
return;
|
|
1616
1622
|
}
|
|
1617
1623
|
if (k.key === "Enter") {
|
|
1618
|
-
if (w(
|
|
1624
|
+
if (w(x)) {
|
|
1619
1625
|
k.preventDefault();
|
|
1620
|
-
const
|
|
1621
|
-
if (
|
|
1622
|
-
const
|
|
1623
|
-
s.value[
|
|
1624
|
-
${
|
|
1626
|
+
const U = x.substring(0, x.indexOf("- "));
|
|
1627
|
+
if (S !== "- ") {
|
|
1628
|
+
const P = 3 + U.length;
|
|
1629
|
+
s.value[r.value] = `${x}
|
|
1630
|
+
${U}- `, se(k.target), m(s.value, P, P);
|
|
1625
1631
|
return;
|
|
1626
1632
|
}
|
|
1627
|
-
const
|
|
1628
|
-
s.value[
|
|
1633
|
+
const q = 2 + U.length;
|
|
1634
|
+
s.value[r.value] = x.substring(q), m(s.value, -q, -q);
|
|
1629
1635
|
return;
|
|
1630
1636
|
}
|
|
1631
|
-
if (y(
|
|
1637
|
+
if (y(x)) {
|
|
1632
1638
|
k.preventDefault();
|
|
1633
|
-
const
|
|
1634
|
-
if (
|
|
1635
|
-
const ye =
|
|
1636
|
-
s.value[
|
|
1637
|
-
${
|
|
1639
|
+
const U = S.match(/^\d+\.\s/)[0], P = `${parseInt(U) + 1}. `, W = x.substring(0, x.indexOf(U));
|
|
1640
|
+
if (S !== U) {
|
|
1641
|
+
const ye = P.length + W.length + 1;
|
|
1642
|
+
s.value[r.value] = `${x}
|
|
1643
|
+
${W}${P}`, se(k.target), m(s.value, ye, ye);
|
|
1638
1644
|
return;
|
|
1639
1645
|
}
|
|
1640
|
-
const
|
|
1641
|
-
s.value[
|
|
1646
|
+
const Q = U.length + W.length;
|
|
1647
|
+
s.value[r.value] = x.substring(Q), m(s.value, -Q, -Q);
|
|
1642
1648
|
return;
|
|
1643
1649
|
}
|
|
1644
1650
|
}
|
|
1645
1651
|
}
|
|
1646
1652
|
function J(k) {
|
|
1647
|
-
var
|
|
1648
|
-
const
|
|
1649
|
-
(
|
|
1653
|
+
var S;
|
|
1654
|
+
const x = window.getSelection();
|
|
1655
|
+
(x == null ? void 0 : x.focusNode) === ((S = i.value) == null ? void 0 : S.$el) && (n = k.target, !((n == null ? void 0 : n.selectionStart) === void 0 || (n == null ? void 0 : n.selectionEnd) === void 0) && (a.value.start = (n == null ? void 0 : n.selectionStart) ?? 0, a.value.end = (n == null ? void 0 : n.selectionEnd) ?? 0, u.value = p.value.substring(
|
|
1650
1656
|
a.value.start,
|
|
1651
1657
|
a.value.end
|
|
1652
1658
|
), Z()));
|
|
1653
1659
|
}
|
|
1654
|
-
function
|
|
1655
|
-
u.value = "",
|
|
1660
|
+
function ee() {
|
|
1661
|
+
u.value = "", r.value = void 0;
|
|
1656
1662
|
}
|
|
1657
|
-
function
|
|
1658
|
-
const
|
|
1659
|
-
`).length + 1,
|
|
1660
|
-
|
|
1661
|
-
k.scrollTo({ top:
|
|
1663
|
+
function se(k) {
|
|
1664
|
+
const x = k.selectionStart, N = p.value.substring(0, x ?? 0).split(`
|
|
1665
|
+
`).length + 1, H = k.scrollTop, E = window.getComputedStyle(k), U = parseFloat(E.lineHeight), q = parseFloat(E.height), W = parseFloat(E.paddingBlockStart) + U * N;
|
|
1666
|
+
q + H > W || requestAnimationFrame(() => {
|
|
1667
|
+
k.scrollTo({ top: W - q });
|
|
1662
1668
|
});
|
|
1663
1669
|
}
|
|
1664
1670
|
function Z() {
|
|
1665
|
-
const k = n.selectionStart,
|
|
1666
|
-
|
|
1671
|
+
const k = n.selectionStart, x = p.value.substring(0, k ?? 0);
|
|
1672
|
+
r.value = x.split(`
|
|
1667
1673
|
`).length - 1;
|
|
1668
|
-
const
|
|
1674
|
+
const S = Math.max(x.lastIndexOf(`
|
|
1669
1675
|
`) + 1, 0);
|
|
1670
|
-
a.value.startOfRow = a.value.start -
|
|
1676
|
+
a.value.startOfRow = a.value.start - S, a.value.endOfRow = a.value.startOfRow + u.value.length, s.value = p.value.split(`
|
|
1671
1677
|
`);
|
|
1672
1678
|
}
|
|
1673
1679
|
function w(k) {
|
|
@@ -1676,92 +1682,92 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
1676
1682
|
function y(k) {
|
|
1677
1683
|
return /^\d+\.\s+/.test(k.replace(" ", ""));
|
|
1678
1684
|
}
|
|
1679
|
-
function m(k,
|
|
1685
|
+
function m(k, x = 0, S = 0) {
|
|
1680
1686
|
l.value || (s.value = [...k], p.value = s.value.join(`
|
|
1681
|
-
`), a.value.start +=
|
|
1687
|
+
`), a.value.start += x, a.value.end += S, a.value.startOfRow += x, a.value.endOfRow += S, n == null || n.focus(), l.value = !0, Le(() => {
|
|
1682
1688
|
n == null || n.setSelectionRange(a.value.start, a.value.end), setTimeout(() => {
|
|
1683
1689
|
l.value = !1;
|
|
1684
1690
|
}, 100);
|
|
1685
1691
|
}));
|
|
1686
1692
|
}
|
|
1687
|
-
return (k,
|
|
1688
|
-
class: V(["sq-editor",
|
|
1689
|
-
onClick:
|
|
1693
|
+
return (k, x) => (v(), _("div", {
|
|
1694
|
+
class: V(["sq-editor", $.value]),
|
|
1695
|
+
onClick: x[2] || (x[2] = me(() => {
|
|
1690
1696
|
}, ["stop"]))
|
|
1691
1697
|
}, [
|
|
1692
|
-
ae(
|
|
1693
|
-
e.md ? (v(),
|
|
1694
|
-
|
|
1698
|
+
ae(O("div", un, [
|
|
1699
|
+
e.md ? (v(), _(te, { key: 0 }, [
|
|
1700
|
+
O("div", cn, [
|
|
1695
1701
|
T(Ks, {
|
|
1696
1702
|
ref_key: "boldRef",
|
|
1697
1703
|
ref: f,
|
|
1698
|
-
disabled: !
|
|
1704
|
+
disabled: !z.value,
|
|
1699
1705
|
rows: s.value,
|
|
1700
1706
|
"selected-val": u.value,
|
|
1701
|
-
"selected-row":
|
|
1707
|
+
"selected-row": r.value,
|
|
1702
1708
|
"select-info": a.value,
|
|
1703
1709
|
onUpdateText: m
|
|
1704
1710
|
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1705
1711
|
T(Zs, {
|
|
1706
1712
|
ref_key: "italicRef",
|
|
1707
1713
|
ref: g,
|
|
1708
|
-
disabled: !
|
|
1714
|
+
disabled: !z.value,
|
|
1709
1715
|
rows: s.value,
|
|
1710
1716
|
"selected-val": u.value,
|
|
1711
|
-
"selected-row":
|
|
1717
|
+
"selected-row": r.value,
|
|
1712
1718
|
"select-info": a.value,
|
|
1713
1719
|
onUpdateText: m
|
|
1714
1720
|
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1715
1721
|
T(Qs, {
|
|
1716
1722
|
ref_key: "underlineRef",
|
|
1717
1723
|
ref: h,
|
|
1718
|
-
disabled: !
|
|
1724
|
+
disabled: !z.value,
|
|
1719
1725
|
rows: s.value,
|
|
1720
1726
|
"selected-val": u.value,
|
|
1721
|
-
"selected-row":
|
|
1727
|
+
"selected-row": r.value,
|
|
1722
1728
|
"select-info": a.value,
|
|
1723
1729
|
onUpdateText: m
|
|
1724
1730
|
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1725
1731
|
T(tn, {
|
|
1726
|
-
disabled: !
|
|
1732
|
+
disabled: !z.value,
|
|
1727
1733
|
rows: s.value,
|
|
1728
1734
|
"selected-val": u.value,
|
|
1729
|
-
"selected-row":
|
|
1735
|
+
"selected-row": r.value,
|
|
1730
1736
|
"select-info": a.value,
|
|
1731
1737
|
onUpdateText: m
|
|
1732
1738
|
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1733
1739
|
T(nn, {
|
|
1734
|
-
disabled: !
|
|
1740
|
+
disabled: !z.value,
|
|
1735
1741
|
rows: s.value,
|
|
1736
1742
|
"selected-val": u.value,
|
|
1737
|
-
"selected-row":
|
|
1743
|
+
"selected-row": r.value,
|
|
1738
1744
|
"select-info": a.value,
|
|
1739
1745
|
onUpdateText: m
|
|
1740
1746
|
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1741
1747
|
T(c(we), { direction: "vertical" }),
|
|
1742
1748
|
T(an, {
|
|
1743
|
-
disabled: !
|
|
1749
|
+
disabled: !B.value,
|
|
1744
1750
|
rows: s.value,
|
|
1745
1751
|
"selected-val": u.value,
|
|
1746
|
-
"selected-row":
|
|
1752
|
+
"selected-row": r.value,
|
|
1747
1753
|
"select-info": a.value,
|
|
1748
1754
|
onUpdateText: m
|
|
1749
1755
|
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"]),
|
|
1750
1756
|
T(rn, {
|
|
1751
|
-
disabled: !
|
|
1757
|
+
disabled: !B.value,
|
|
1752
1758
|
rows: s.value,
|
|
1753
1759
|
"selected-val": u.value,
|
|
1754
|
-
"selected-row":
|
|
1760
|
+
"selected-row": r.value,
|
|
1755
1761
|
"select-info": a.value,
|
|
1756
1762
|
onUpdateText: m
|
|
1757
1763
|
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"])
|
|
1758
1764
|
]),
|
|
1759
1765
|
T(c(we))
|
|
1760
|
-
], 64)) :
|
|
1761
|
-
T(c(
|
|
1766
|
+
], 64)) : D("", !0),
|
|
1767
|
+
T(c(We), {
|
|
1762
1768
|
class: V({ "has-shadow": !e.md }),
|
|
1763
1769
|
ref_key: "inputRef",
|
|
1764
|
-
ref:
|
|
1770
|
+
ref: i,
|
|
1765
1771
|
type: "textarea",
|
|
1766
1772
|
resize: "none",
|
|
1767
1773
|
size: e.size,
|
|
@@ -1771,28 +1777,28 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
1771
1777
|
maxlength: e.maxlength,
|
|
1772
1778
|
minlength: e.minlength,
|
|
1773
1779
|
value: p.value,
|
|
1774
|
-
"onUpdate:value":
|
|
1775
|
-
onKeydown:
|
|
1780
|
+
"onUpdate:value": x[0] || (x[0] = (S) => p.value = S),
|
|
1781
|
+
onKeydown: j
|
|
1776
1782
|
}, null, 8, ["class", "size", "round", "disabled", "placeholder", "maxlength", "minlength", "value"])
|
|
1777
1783
|
], 512), [
|
|
1778
1784
|
[ve, t.value === "edit"]
|
|
1779
1785
|
]),
|
|
1780
|
-
t.value === "preview" ? (v(),
|
|
1786
|
+
t.value === "preview" ? (v(), C(c(ls), {
|
|
1781
1787
|
key: 0,
|
|
1782
|
-
text:
|
|
1788
|
+
text: M.value,
|
|
1783
1789
|
md: e.md
|
|
1784
|
-
}, null, 8, ["text", "md"])) :
|
|
1785
|
-
|
|
1790
|
+
}, null, 8, ["text", "md"])) : D("", !0),
|
|
1791
|
+
O("div", dn, [
|
|
1786
1792
|
T(c(So), {
|
|
1787
1793
|
size: e.size,
|
|
1788
1794
|
round: e.round,
|
|
1789
1795
|
disabled: e.disabled,
|
|
1790
1796
|
items: o,
|
|
1791
1797
|
value: t.value,
|
|
1792
|
-
"onUpdate:value":
|
|
1793
|
-
onChange:
|
|
1798
|
+
"onUpdate:value": x[1] || (x[1] = (S) => t.value = S),
|
|
1799
|
+
onChange: I
|
|
1794
1800
|
}, null, 8, ["size", "round", "disabled", "value"]),
|
|
1795
|
-
|
|
1801
|
+
F(k.$slots, "control")
|
|
1796
1802
|
])
|
|
1797
1803
|
], 2));
|
|
1798
1804
|
}
|
|
@@ -1809,15 +1815,15 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
1809
1815
|
},
|
|
1810
1816
|
setup(d) {
|
|
1811
1817
|
const { nextId: o } = Ee(), n = d, e = R(""), t = R("");
|
|
1812
|
-
qe(
|
|
1818
|
+
qe(je, e);
|
|
1813
1819
|
const s = b(() => {
|
|
1814
|
-
const
|
|
1815
|
-
return n.isRequired &&
|
|
1820
|
+
const r = [];
|
|
1821
|
+
return n.isRequired && r.push("is-required"), r;
|
|
1816
1822
|
}), l = b(() => ["input", "switch", "select"].includes(n.type));
|
|
1817
1823
|
oe(
|
|
1818
1824
|
() => n.errorMsg,
|
|
1819
|
-
(
|
|
1820
|
-
|
|
1825
|
+
(r) => {
|
|
1826
|
+
r && (t.value = r);
|
|
1821
1827
|
}
|
|
1822
1828
|
), ie(() => {
|
|
1823
1829
|
l.value && (e.value = `sq-form-item-${o()}`);
|
|
@@ -1825,25 +1831,25 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
1825
1831
|
function u() {
|
|
1826
1832
|
t.value = "";
|
|
1827
1833
|
}
|
|
1828
|
-
return (
|
|
1834
|
+
return (r, a) => (v(), _("div", {
|
|
1829
1835
|
class: "sq-form-item",
|
|
1830
1836
|
style: K({ "--form-label-width": n.labelWidth })
|
|
1831
1837
|
}, [
|
|
1832
|
-
n.label || n.showLabel ? (v(),
|
|
1838
|
+
n.label || n.showLabel ? (v(), _("label", {
|
|
1833
1839
|
key: 0,
|
|
1834
1840
|
class: V(["sq-form-item-label", s.value]),
|
|
1835
1841
|
textContent: X(n.label),
|
|
1836
1842
|
for: n.type !== "custom" ? e.value : void 0
|
|
1837
|
-
}, null, 10, pn)) :
|
|
1838
|
-
|
|
1839
|
-
|
|
1843
|
+
}, null, 10, pn)) : D("", !0),
|
|
1844
|
+
O("div", vn, [
|
|
1845
|
+
F(r.$slots, "default"),
|
|
1840
1846
|
T(be, {
|
|
1841
1847
|
appear: "",
|
|
1842
1848
|
name: "sq-zoom-top",
|
|
1843
1849
|
onAfterLeave: u
|
|
1844
1850
|
}, {
|
|
1845
|
-
default:
|
|
1846
|
-
ae(
|
|
1851
|
+
default: A(() => [
|
|
1852
|
+
ae(O("span", {
|
|
1847
1853
|
class: "sq-form-item-check",
|
|
1848
1854
|
textContent: X(t.value)
|
|
1849
1855
|
}, null, 8, mn), [
|
|
@@ -1886,10 +1892,10 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
1886
1892
|
readonly: ne(s, "readonly")
|
|
1887
1893
|
})
|
|
1888
1894
|
);
|
|
1889
|
-
const l = R({}), u = R([]),
|
|
1895
|
+
const l = R({}), u = R([]), r = R({}), a = b(() => {
|
|
1890
1896
|
const w = [`is-${s.layout}`];
|
|
1891
1897
|
return s.size !== "md" && w.push(`sq-form--${s.size}`), s.requiredMark !== "hidden" && w.push(`required-${s.requiredMark}`), w;
|
|
1892
|
-
}),
|
|
1898
|
+
}), i = b(() => ({
|
|
1893
1899
|
"--form-label-width": s.labelWidth
|
|
1894
1900
|
})), f = b(() => {
|
|
1895
1901
|
const w = s.step;
|
|
@@ -1903,73 +1909,73 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
1903
1909
|
return (y = w.rule) == null ? void 0 : y.required;
|
|
1904
1910
|
}
|
|
1905
1911
|
function h(w) {
|
|
1906
|
-
if (
|
|
1912
|
+
if (r.value[w]) return Me;
|
|
1907
1913
|
if (u.value.includes(w)) return ot;
|
|
1908
1914
|
if (l.value[w])
|
|
1909
1915
|
return s.invalidStatus === "error" ? nt : st;
|
|
1910
1916
|
}
|
|
1911
1917
|
async function p(w, y, m, k = !0) {
|
|
1912
1918
|
if (!m) return;
|
|
1913
|
-
const
|
|
1919
|
+
const x = m.trigger ?? "change", S = Array.isArray(x) ? "array" : "string";
|
|
1914
1920
|
if (y) {
|
|
1915
|
-
if (
|
|
1916
|
-
if (
|
|
1921
|
+
if (S === "array" && !x.includes(y)) return;
|
|
1922
|
+
if (S === "string" && x !== y) return;
|
|
1917
1923
|
}
|
|
1918
|
-
u.value = u.value.filter((
|
|
1919
|
-
const
|
|
1920
|
-
let
|
|
1921
|
-
const
|
|
1922
|
-
return m.validateFunc ?
|
|
1924
|
+
u.value = u.value.filter((U) => U !== w), ee(w), r.value[w] = new AbortController(), await Le();
|
|
1925
|
+
const N = s.formData[w];
|
|
1926
|
+
let H = !1;
|
|
1927
|
+
const E = m.validateType ?? "string";
|
|
1928
|
+
return m.validateFunc ? H = await z(w, N, m, y) : E === "string" ? H = B(w, N, m) : E === "boolean" ? H = M(w, N, m) : E === "list" && (H = I(w, N, m)), k && t("validate", w, H, ke(u.value)), r.value[w].signal.aborted || ee(w), H;
|
|
1923
1929
|
}
|
|
1924
|
-
function
|
|
1930
|
+
function $(w) {
|
|
1925
1931
|
if (l.value[w]) return s.invalidStatus;
|
|
1926
1932
|
}
|
|
1927
|
-
async function
|
|
1928
|
-
const
|
|
1929
|
-
if (
|
|
1930
|
-
u.value = u.value.filter((
|
|
1933
|
+
async function z(w, y, m, k) {
|
|
1934
|
+
const x = r.value[w].signal, S = await m.validateFunc(y, x, k);
|
|
1935
|
+
if (S === void 0) {
|
|
1936
|
+
u.value = u.value.filter((N) => N !== w), delete l.value[w];
|
|
1931
1937
|
return;
|
|
1932
1938
|
}
|
|
1933
|
-
return
|
|
1939
|
+
return S === !0 ? J(w) : S === !1 ? j(w, "字段验证失败") : S ? j(w, S) : J(w), S === !0 || typeof S == "string" && !S;
|
|
1934
1940
|
}
|
|
1935
|
-
function
|
|
1936
|
-
return m.required && !y ? (
|
|
1941
|
+
function B(w, y, m) {
|
|
1942
|
+
return m.required && !y ? (j(w, m.requiredText ?? "字段必填"), !1) : m.pattern && y && !m.pattern.test(y) ? (j(w, m.patternText ?? "字段验证失败"), !1) : (J(w), !0);
|
|
1937
1943
|
}
|
|
1938
|
-
function
|
|
1939
|
-
return m.required && y === void 0 ? (
|
|
1944
|
+
function M(w, y, m) {
|
|
1945
|
+
return m.required && y === void 0 ? (j(w, m.requiredText ?? "字段必填"), !1) : (J(w), !0);
|
|
1940
1946
|
}
|
|
1941
|
-
function
|
|
1942
|
-
return m.required && (!y || !y.length) ? (
|
|
1947
|
+
function I(w, y, m) {
|
|
1948
|
+
return m.required && (!y || !y.length) ? (j(w, m.requiredText ?? "字段必填"), !1) : m.pattern && y && y.map((S) => S.toString()).map((S) => m.pattern.test(S)).includes(!1) ? (j(w, m.patternText ?? "字段验证失败"), !1) : (J(w), !0);
|
|
1943
1949
|
}
|
|
1944
|
-
function
|
|
1950
|
+
function j(w, y) {
|
|
1945
1951
|
u.value = u.value.filter((m) => m !== w), l.value[w] = y;
|
|
1946
1952
|
}
|
|
1947
1953
|
function J(w) {
|
|
1948
1954
|
u.value.push(w), delete l.value[w];
|
|
1949
1955
|
}
|
|
1950
|
-
function
|
|
1956
|
+
function ee(w) {
|
|
1951
1957
|
var y;
|
|
1952
|
-
(y =
|
|
1958
|
+
(y = r.value[w]) == null || y.abort(), delete r.value[w];
|
|
1953
1959
|
}
|
|
1954
|
-
function
|
|
1960
|
+
function se() {
|
|
1955
1961
|
t("update:formData", structuredClone(e)), l.value = {}, u.value = [], t("validate", "SQFORM", !1, ke(u.value));
|
|
1956
1962
|
}
|
|
1957
1963
|
function Z(w = !0) {
|
|
1958
1964
|
const m = (w ? s.items : f.value).filter(
|
|
1959
1965
|
(k) => k.type !== "custom" && k.rule && !u.value.includes(k.binding)
|
|
1960
1966
|
).map((k) => {
|
|
1961
|
-
const
|
|
1962
|
-
return p(
|
|
1967
|
+
const x = k;
|
|
1968
|
+
return p(x.binding, void 0, x.rule, !1);
|
|
1963
1969
|
});
|
|
1964
1970
|
return Promise.all(m).then((k) => (t("validate", "SQFORM", !k.includes(!1), ke(u.value)), k));
|
|
1965
1971
|
}
|
|
1966
|
-
return o({ resetFields:
|
|
1972
|
+
return o({ resetFields: se, validate: Z }), (w, y) => (v(), _("form", {
|
|
1967
1973
|
class: V(["sq-form", a.value]),
|
|
1968
|
-
style: K(
|
|
1974
|
+
style: K(i.value),
|
|
1969
1975
|
onSubmit: y[0] || (y[0] = me(() => {
|
|
1970
1976
|
}, ["prevent"]))
|
|
1971
1977
|
}, [
|
|
1972
|
-
(v(!0),
|
|
1978
|
+
(v(!0), _(te, null, de(f.value, (m, k) => (v(), C(gn, {
|
|
1973
1979
|
class: V(m.itemClass),
|
|
1974
1980
|
type: m.type,
|
|
1975
1981
|
key: k,
|
|
@@ -1979,59 +1985,59 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
1979
1985
|
"is-required": g(m),
|
|
1980
1986
|
"error-msg": s.hasFeedback ? l.value[m.binding] : ""
|
|
1981
1987
|
}, {
|
|
1982
|
-
default:
|
|
1983
|
-
m.type === "input" ? (v(),
|
|
1988
|
+
default: A(() => [
|
|
1989
|
+
m.type === "input" ? (v(), C(c(We), fe({
|
|
1984
1990
|
key: 0,
|
|
1985
1991
|
ref_for: !0
|
|
1986
1992
|
}, m.props, {
|
|
1987
1993
|
name: m.name,
|
|
1988
|
-
status:
|
|
1994
|
+
status: $(m.binding),
|
|
1989
1995
|
"suffix-icon": h(m.binding),
|
|
1990
1996
|
value: s.formData[m.binding],
|
|
1991
|
-
"onUpdate:value": (
|
|
1992
|
-
onChange: (
|
|
1993
|
-
onInput: (
|
|
1994
|
-
onBlur: (
|
|
1995
|
-
}), null, 16, ["name", "status", "suffix-icon", "value", "onUpdate:value", "onChange", "onInput", "onBlur"])) : m.type === "checkbox" ? (v(),
|
|
1997
|
+
"onUpdate:value": (x) => s.formData[m.binding] = x,
|
|
1998
|
+
onChange: (x) => p(m.binding, "change", m.rule),
|
|
1999
|
+
onInput: (x) => p(m.binding, "input", m.rule),
|
|
2000
|
+
onBlur: (x) => p(m.binding, "blur", m.rule)
|
|
2001
|
+
}), null, 16, ["name", "status", "suffix-icon", "value", "onUpdate:value", "onChange", "onInput", "onBlur"])) : m.type === "checkbox" ? (v(), C(c(As), fe({
|
|
1996
2002
|
key: 1,
|
|
1997
2003
|
ref_for: !0
|
|
1998
2004
|
}, m.props, {
|
|
1999
2005
|
name: m.name,
|
|
2000
2006
|
value: s.formData[m.binding],
|
|
2001
|
-
"onUpdate:value": (
|
|
2002
|
-
onChange: (
|
|
2003
|
-
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : m.type === "radio" ? (v(),
|
|
2007
|
+
"onUpdate:value": (x) => s.formData[m.binding] = x,
|
|
2008
|
+
onChange: (x) => p(m.binding, "change", m.rule)
|
|
2009
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : m.type === "radio" ? (v(), C(c(qo), fe({
|
|
2004
2010
|
key: 2,
|
|
2005
2011
|
ref_for: !0
|
|
2006
2012
|
}, m.props, {
|
|
2007
2013
|
name: m.name,
|
|
2008
2014
|
value: s.formData[m.binding],
|
|
2009
|
-
"onUpdate:value": (
|
|
2010
|
-
onChange: (
|
|
2011
|
-
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : m.type === "switch" ? (v(),
|
|
2015
|
+
"onUpdate:value": (x) => s.formData[m.binding] = x,
|
|
2016
|
+
onChange: (x) => p(m.binding, "change", m.rule)
|
|
2017
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : m.type === "switch" ? (v(), C(c(Uo), fe({
|
|
2012
2018
|
key: 3,
|
|
2013
2019
|
ref_for: !0
|
|
2014
2020
|
}, m.props, {
|
|
2015
2021
|
name: m.name,
|
|
2016
|
-
loading:
|
|
2022
|
+
loading: r.value[m.binding] !== void 0,
|
|
2017
2023
|
checked: s.formData[m.binding],
|
|
2018
|
-
"onUpdate:checked": (
|
|
2019
|
-
onChange: (
|
|
2020
|
-
}), null, 16, ["name", "loading", "checked", "onUpdate:checked", "onChange"])) : m.type === "select" ? (v(),
|
|
2024
|
+
"onUpdate:checked": (x) => s.formData[m.binding] = x,
|
|
2025
|
+
onChange: (x) => p(m.binding, "change", m.rule)
|
|
2026
|
+
}), null, 16, ["name", "loading", "checked", "onUpdate:checked", "onChange"])) : m.type === "select" ? (v(), C(c(Ao), fe({
|
|
2021
2027
|
key: 4,
|
|
2022
2028
|
ref_for: !0
|
|
2023
2029
|
}, m.props, {
|
|
2024
2030
|
name: m.name,
|
|
2025
2031
|
value: s.formData[m.binding],
|
|
2026
|
-
"onUpdate:value": (
|
|
2027
|
-
onChange: (
|
|
2028
|
-
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) :
|
|
2032
|
+
"onUpdate:value": (x) => s.formData[m.binding] = x,
|
|
2033
|
+
onChange: (x) => p(m.binding, "change", m.rule)
|
|
2034
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : F(w.$slots, m.slot, { key: 5 })
|
|
2029
2035
|
]),
|
|
2030
2036
|
_: 2
|
|
2031
2037
|
}, 1032, ["class", "type", "label-width", "label", "show-label", "is-required", "error-msg"]))), 128))
|
|
2032
2038
|
], 38));
|
|
2033
2039
|
}
|
|
2034
|
-
}), Be = Symbol("form-context-keys"),
|
|
2040
|
+
}), Be = Symbol("form-context-keys"), je = Symbol("form-item-id-keys"), yn = {
|
|
2035
2041
|
key: 0,
|
|
2036
2042
|
class: "sq-image-mask"
|
|
2037
2043
|
}, xn = {
|
|
@@ -2056,51 +2062,51 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2056
2062
|
},
|
|
2057
2063
|
emits: ["load", "error"],
|
|
2058
2064
|
setup(d, { emit: o }) {
|
|
2059
|
-
const n = new IntersectionObserver(
|
|
2065
|
+
const n = new IntersectionObserver($), e = o, t = d, s = R(!1), l = R(t.src), u = R(!1), r = R(!1), a = R(!1), i = ue(null), f = b(() => s.value && !u.value), g = b(() => ({
|
|
2060
2066
|
height: f.value ? void 0 : "var(--image-placeholder-height)",
|
|
2061
2067
|
aspectRatio: f.value ? void 0 : t.aspectRatio
|
|
2062
2068
|
}));
|
|
2063
2069
|
ie(() => {
|
|
2064
|
-
n.observe(
|
|
2070
|
+
n.observe(i.value);
|
|
2065
2071
|
}), he(() => {
|
|
2066
2072
|
n.disconnect();
|
|
2067
2073
|
});
|
|
2068
|
-
function h(
|
|
2069
|
-
s.value = !0, e("load",
|
|
2074
|
+
function h(B) {
|
|
2075
|
+
s.value = !0, e("load", B);
|
|
2070
2076
|
}
|
|
2071
|
-
function p(
|
|
2077
|
+
function p(B) {
|
|
2072
2078
|
if (l.value !== t.fallback && t.fallback) {
|
|
2073
2079
|
l.value = t.fallback;
|
|
2074
2080
|
return;
|
|
2075
2081
|
}
|
|
2076
|
-
u.value = !0, s.value = !0, e("error",
|
|
2082
|
+
u.value = !0, s.value = !0, e("error", B);
|
|
2077
2083
|
}
|
|
2078
|
-
function
|
|
2079
|
-
|
|
2084
|
+
function $(B) {
|
|
2085
|
+
B[0].isIntersecting && (r.value = !0, n.disconnect());
|
|
2080
2086
|
}
|
|
2081
|
-
function
|
|
2087
|
+
function z() {
|
|
2082
2088
|
a.value = !0;
|
|
2083
2089
|
}
|
|
2084
|
-
return (
|
|
2090
|
+
return (B, M) => (v(), _("div", {
|
|
2085
2091
|
class: "sq-image",
|
|
2086
2092
|
style: K(g.value),
|
|
2087
2093
|
ref_key: "imgRef",
|
|
2088
|
-
ref:
|
|
2094
|
+
ref: i
|
|
2089
2095
|
}, [
|
|
2090
2096
|
T(be, { name: "sq-fade" }, {
|
|
2091
|
-
default:
|
|
2092
|
-
s.value ?
|
|
2097
|
+
default: A(() => [
|
|
2098
|
+
s.value ? D("", !0) : (v(), _("div", yn))
|
|
2093
2099
|
]),
|
|
2094
2100
|
_: 1
|
|
2095
2101
|
}),
|
|
2096
|
-
!u.value &&
|
|
2097
|
-
(v(!0),
|
|
2098
|
-
key:
|
|
2099
|
-
srcset:
|
|
2100
|
-
media:
|
|
2101
|
-
type:
|
|
2102
|
+
!u.value && r.value ? (v(), _("picture", xn, [
|
|
2103
|
+
(v(!0), _(te, null, de(t.source, (I, j) => (v(), _("source", {
|
|
2104
|
+
key: j,
|
|
2105
|
+
srcset: I.src,
|
|
2106
|
+
media: I.media,
|
|
2107
|
+
type: I.type
|
|
2102
2108
|
}, null, 8, _n))), 128)),
|
|
2103
|
-
|
|
2109
|
+
O("img", {
|
|
2104
2110
|
style: K({ objectFit: t.objectFit }),
|
|
2105
2111
|
crossorigin: t.crossorigin,
|
|
2106
2112
|
alt: t.alt,
|
|
@@ -2108,25 +2114,25 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2108
2114
|
onLoad: h,
|
|
2109
2115
|
onError: p
|
|
2110
2116
|
}, null, 44, $n)
|
|
2111
|
-
])) :
|
|
2112
|
-
!u.value &&
|
|
2117
|
+
])) : D("", !0),
|
|
2118
|
+
!u.value && r.value && t.preview ? (v(), _("div", {
|
|
2113
2119
|
key: 1,
|
|
2114
2120
|
class: "sq-image-control",
|
|
2115
|
-
onClick:
|
|
2121
|
+
onClick: z
|
|
2116
2122
|
}, [
|
|
2117
2123
|
T(c(it))
|
|
2118
|
-
])) :
|
|
2119
|
-
u.value ? (v(),
|
|
2120
|
-
|
|
2121
|
-
|
|
2124
|
+
])) : D("", !0),
|
|
2125
|
+
u.value ? (v(), _("div", kn, [
|
|
2126
|
+
F(B.$slots, "error", {}, () => [
|
|
2127
|
+
M[1] || (M[1] = O("span", null, "图片加载失败", -1))
|
|
2122
2128
|
])
|
|
2123
|
-
])) :
|
|
2124
|
-
t.preview ? (v(),
|
|
2129
|
+
])) : D("", !0),
|
|
2130
|
+
t.preview ? (v(), C(c(Bn), {
|
|
2125
2131
|
key: 3,
|
|
2126
2132
|
"src-list": [l.value],
|
|
2127
2133
|
visible: a.value,
|
|
2128
|
-
"onUpdate:visible":
|
|
2129
|
-
}, null, 8, ["src-list", "visible"])) :
|
|
2134
|
+
"onUpdate:visible": M[0] || (M[0] = (I) => a.value = I)
|
|
2135
|
+
}, null, 8, ["src-list", "visible"])) : D("", !0)
|
|
2130
2136
|
], 4));
|
|
2131
2137
|
}
|
|
2132
2138
|
}), Cn = ["src"], Sn = "sq-image-viewer", Bn = /* @__PURE__ */ L({
|
|
@@ -2150,11 +2156,11 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2150
2156
|
setup(d) {
|
|
2151
2157
|
const o = {}, n = {};
|
|
2152
2158
|
let e = !1, t;
|
|
2153
|
-
const s = d, l = R(1), u = R(!1),
|
|
2154
|
-
const
|
|
2159
|
+
const s = d, l = R(1), u = R(!1), r = R(!1), a = R(0), i = R(0), f = R(!0), g = R({ x: 0, y: 0 }), h = le(d, "visible"), p = b(() => s.srcList[i.value]), $ = b(() => {
|
|
2160
|
+
const q = u.value ? -1 : 1, P = r.value ? -1 : 1;
|
|
2155
2161
|
return {
|
|
2156
2162
|
transform: [
|
|
2157
|
-
`scale(${l.value *
|
|
2163
|
+
`scale(${l.value * q}, ${l.value * P})`,
|
|
2158
2164
|
`rotate(${a.value}deg)`
|
|
2159
2165
|
].join(" "),
|
|
2160
2166
|
marginInlineStart: `${g.value.x}px`,
|
|
@@ -2162,48 +2168,48 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2162
2168
|
transition: f.value ? void 0 : "none"
|
|
2163
2169
|
};
|
|
2164
2170
|
});
|
|
2165
|
-
function q
|
|
2166
|
-
|
|
2171
|
+
function z(q) {
|
|
2172
|
+
q.deltaY < 0 ? y() : m();
|
|
2167
2173
|
}
|
|
2168
|
-
function
|
|
2169
|
-
e = !0, o.x =
|
|
2174
|
+
function B(q) {
|
|
2175
|
+
e = !0, o.x = q.x, o.y = q.y;
|
|
2170
2176
|
}
|
|
2171
|
-
function
|
|
2177
|
+
function M() {
|
|
2172
2178
|
e = !1;
|
|
2173
2179
|
}
|
|
2174
|
-
function
|
|
2180
|
+
function I(q) {
|
|
2175
2181
|
if (!e || !s.moveable) return;
|
|
2176
|
-
const
|
|
2177
|
-
g.value.x +=
|
|
2182
|
+
const P = q.x - o.x, W = q.y - o.y;
|
|
2183
|
+
g.value.x += P * 2, g.value.y += W * 2, o.x = q.x, o.y = q.y;
|
|
2178
2184
|
}
|
|
2179
|
-
function
|
|
2180
|
-
|
|
2185
|
+
function j(q) {
|
|
2186
|
+
q.touches.length === 1 ? (e = !0, o.x = q.touches[0].screenX, o.y = q.touches[0].screenY) : q.touches.length === 2 && (t = w(q.touches[0], q.touches[1]));
|
|
2181
2187
|
}
|
|
2182
2188
|
function J() {
|
|
2183
2189
|
e = !1, t = void 0, f.value = !0;
|
|
2184
2190
|
}
|
|
2185
|
-
function
|
|
2186
|
-
if (
|
|
2191
|
+
function ee(q) {
|
|
2192
|
+
if (q.touches.length === 1) {
|
|
2187
2193
|
if (!e || !s.moveable) return;
|
|
2188
|
-
const
|
|
2189
|
-
g.value.x +=
|
|
2190
|
-
} else if (
|
|
2194
|
+
const P = q.touches[0], W = P.screenX - o.x, Q = P.screenY - o.y;
|
|
2195
|
+
g.value.x += W * 2, g.value.y += Q * 2, o.x = P.screenX, o.y = P.screenY;
|
|
2196
|
+
} else if (q.touches.length === 2) {
|
|
2191
2197
|
if (!t) return;
|
|
2192
2198
|
f.value = !1;
|
|
2193
|
-
const
|
|
2194
|
-
let
|
|
2195
|
-
|
|
2199
|
+
const P = w(q.touches[0], q.touches[1]), W = P / t;
|
|
2200
|
+
let Q = l.value * W;
|
|
2201
|
+
Q = Math.min(s.maxScale, Q), Q = Math.max(s.minScale, Q), l.value = Q, t = P;
|
|
2196
2202
|
}
|
|
2197
2203
|
}
|
|
2198
|
-
function
|
|
2199
|
-
l.value = Math.min(n.x, n.y, 1), u.value = !1,
|
|
2204
|
+
function se() {
|
|
2205
|
+
l.value = Math.min(n.x, n.y, 1), u.value = !1, r.value = !1, a.value = 0, g.value = { x: 0, y: 0 };
|
|
2200
2206
|
}
|
|
2201
|
-
function Z(
|
|
2202
|
-
|
|
2207
|
+
function Z(q) {
|
|
2208
|
+
i.value += q;
|
|
2203
2209
|
}
|
|
2204
|
-
function w(
|
|
2205
|
-
const
|
|
2206
|
-
return Math.sqrt(
|
|
2210
|
+
function w(q, P) {
|
|
2211
|
+
const W = P.clientX - q.clientX, Q = P.clientY - q.clientY;
|
|
2212
|
+
return Math.sqrt(W * W + Q * Q);
|
|
2207
2213
|
}
|
|
2208
2214
|
function y() {
|
|
2209
2215
|
l.value >= s.maxScale || (l.value = Math.min(s.maxScale, l.value * (1 + s.scaleStep)));
|
|
@@ -2214,81 +2220,81 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2214
2220
|
function k() {
|
|
2215
2221
|
l.value = Math.min(n.x, n.y), g.value = { x: 0, y: 0 };
|
|
2216
2222
|
}
|
|
2217
|
-
function
|
|
2223
|
+
function x() {
|
|
2218
2224
|
l.value = 1, g.value = { x: 0, y: 0 };
|
|
2219
2225
|
}
|
|
2220
|
-
function
|
|
2226
|
+
function S() {
|
|
2221
2227
|
u.value = !u.value;
|
|
2222
2228
|
}
|
|
2223
|
-
function
|
|
2224
|
-
|
|
2229
|
+
function N() {
|
|
2230
|
+
r.value = !r.value;
|
|
2225
2231
|
}
|
|
2226
|
-
function
|
|
2227
|
-
a.value +=
|
|
2232
|
+
function H(q) {
|
|
2233
|
+
a.value += q;
|
|
2228
2234
|
}
|
|
2229
|
-
function
|
|
2235
|
+
function E() {
|
|
2230
2236
|
h.value = !1;
|
|
2231
2237
|
}
|
|
2232
|
-
function
|
|
2233
|
-
const
|
|
2234
|
-
n.x =
|
|
2238
|
+
function U(q) {
|
|
2239
|
+
const W = q.target.getBoundingClientRect(), Q = window.innerWidth, ye = window.innerHeight;
|
|
2240
|
+
n.x = Q / W.width, n.y = ye / W.height, l.value = Math.min(n.x, n.y, 1);
|
|
2235
2241
|
}
|
|
2236
|
-
return (
|
|
2242
|
+
return (q, P) => (v(), C(c(pt), {
|
|
2237
2243
|
class: "sq-image-viewer-mask",
|
|
2238
2244
|
visible: h.value,
|
|
2239
|
-
"onUpdate:visible":
|
|
2245
|
+
"onUpdate:visible": P[6] || (P[6] = (W) => h.value = W),
|
|
2240
2246
|
keyboard: s.keyboard,
|
|
2241
2247
|
"mask-closeable": s.maskCloseable,
|
|
2242
|
-
onWheelPassive:
|
|
2243
|
-
onMousemove:
|
|
2244
|
-
onMouseup:
|
|
2245
|
-
onTouchmovePassive:
|
|
2248
|
+
onWheelPassive: z,
|
|
2249
|
+
onMousemove: I,
|
|
2250
|
+
onMouseup: M,
|
|
2251
|
+
onTouchmovePassive: ee,
|
|
2246
2252
|
onTouchend: J,
|
|
2247
|
-
onClosed:
|
|
2253
|
+
onClosed: se
|
|
2248
2254
|
}, {
|
|
2249
|
-
default:
|
|
2250
|
-
|
|
2251
|
-
style: K(
|
|
2255
|
+
default: A(() => [
|
|
2256
|
+
O("img", {
|
|
2257
|
+
style: K($.value),
|
|
2252
2258
|
src: p.value,
|
|
2253
|
-
onClick:
|
|
2259
|
+
onClick: P[0] || (P[0] = me(() => {
|
|
2254
2260
|
}, ["stop"])),
|
|
2255
|
-
onLoad:
|
|
2256
|
-
onMousedown: me(
|
|
2257
|
-
onTouchstartPassive:
|
|
2261
|
+
onLoad: U,
|
|
2262
|
+
onMousedown: me(B, ["prevent"]),
|
|
2263
|
+
onTouchstartPassive: j
|
|
2258
2264
|
}, null, 44, Cn),
|
|
2259
2265
|
T(c(Y), {
|
|
2260
2266
|
class: "sq-image-viewer-close",
|
|
2261
2267
|
round: "",
|
|
2262
2268
|
icon: c(Ue),
|
|
2263
|
-
onClick: me(
|
|
2269
|
+
onClick: me(E, ["stop"])
|
|
2264
2270
|
}, null, 8, ["icon"]),
|
|
2265
|
-
s.srcList.length > 1 ? (v(),
|
|
2271
|
+
s.srcList.length > 1 ? (v(), _(te, { key: 0 }, [
|
|
2266
2272
|
T(c(Y), {
|
|
2267
2273
|
class: "sq-image-viewer-prev",
|
|
2268
2274
|
round: "",
|
|
2269
2275
|
icon: c(rt),
|
|
2270
|
-
disabled:
|
|
2271
|
-
onClick:
|
|
2276
|
+
disabled: i.value === 0,
|
|
2277
|
+
onClick: P[1] || (P[1] = (W) => Z(-1))
|
|
2272
2278
|
}, null, 8, ["icon", "disabled"]),
|
|
2273
2279
|
T(c(Y), {
|
|
2274
2280
|
class: "sq-image-viewer-next",
|
|
2275
2281
|
round: "",
|
|
2276
2282
|
icon: c(ut),
|
|
2277
|
-
disabled:
|
|
2278
|
-
onClick:
|
|
2283
|
+
disabled: i.value === s.srcList.length - 1,
|
|
2284
|
+
onClick: P[2] || (P[2] = (W) => Z(1))
|
|
2279
2285
|
}, null, 8, ["icon", "disabled"])
|
|
2280
|
-
], 64)) :
|
|
2281
|
-
s.toolbar ? (v(),
|
|
2286
|
+
], 64)) : D("", !0),
|
|
2287
|
+
s.toolbar ? (v(), _("div", {
|
|
2282
2288
|
key: 1,
|
|
2283
2289
|
class: "sq-image-viewer-toolbar",
|
|
2284
|
-
onClick:
|
|
2290
|
+
onClick: P[5] || (P[5] = me(() => {
|
|
2285
2291
|
}, ["stop"]))
|
|
2286
2292
|
}, [
|
|
2287
2293
|
T(c(re), {
|
|
2288
2294
|
tip: "放大",
|
|
2289
2295
|
shadow: !1
|
|
2290
2296
|
}, {
|
|
2291
|
-
default:
|
|
2297
|
+
default: A(() => [
|
|
2292
2298
|
T(c(Y), {
|
|
2293
2299
|
text: "",
|
|
2294
2300
|
icon: c(Lt),
|
|
@@ -2302,7 +2308,7 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2302
2308
|
tip: "缩小",
|
|
2303
2309
|
shadow: !1
|
|
2304
2310
|
}, {
|
|
2305
|
-
default:
|
|
2311
|
+
default: A(() => [
|
|
2306
2312
|
T(c(Y), {
|
|
2307
2313
|
text: "",
|
|
2308
2314
|
icon: c(It),
|
|
@@ -2317,11 +2323,11 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2317
2323
|
tip: "水平翻转",
|
|
2318
2324
|
shadow: !1
|
|
2319
2325
|
}, {
|
|
2320
|
-
default:
|
|
2326
|
+
default: A(() => [
|
|
2321
2327
|
T(c(Y), {
|
|
2322
2328
|
text: "",
|
|
2323
2329
|
icon: c(Mt),
|
|
2324
|
-
onClick:
|
|
2330
|
+
onClick: S
|
|
2325
2331
|
}, null, 8, ["icon"])
|
|
2326
2332
|
]),
|
|
2327
2333
|
_: 1
|
|
@@ -2330,11 +2336,11 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2330
2336
|
tip: "垂直翻转",
|
|
2331
2337
|
shadow: !1
|
|
2332
2338
|
}, {
|
|
2333
|
-
default:
|
|
2339
|
+
default: A(() => [
|
|
2334
2340
|
T(c(Y), {
|
|
2335
2341
|
text: "",
|
|
2336
2342
|
icon: c(Et),
|
|
2337
|
-
onClick:
|
|
2343
|
+
onClick: N
|
|
2338
2344
|
}, null, 8, ["icon"])
|
|
2339
2345
|
]),
|
|
2340
2346
|
_: 1
|
|
@@ -2344,11 +2350,11 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2344
2350
|
tip: "顺时针旋转",
|
|
2345
2351
|
shadow: !1
|
|
2346
2352
|
}, {
|
|
2347
|
-
default:
|
|
2353
|
+
default: A(() => [
|
|
2348
2354
|
T(c(Y), {
|
|
2349
2355
|
text: "",
|
|
2350
2356
|
icon: c(At),
|
|
2351
|
-
onClick:
|
|
2357
|
+
onClick: P[3] || (P[3] = (W) => H(90))
|
|
2352
2358
|
}, null, 8, ["icon"])
|
|
2353
2359
|
]),
|
|
2354
2360
|
_: 1
|
|
@@ -2357,11 +2363,11 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2357
2363
|
tip: "逆时针旋转",
|
|
2358
2364
|
shadow: !1
|
|
2359
2365
|
}, {
|
|
2360
|
-
default:
|
|
2366
|
+
default: A(() => [
|
|
2361
2367
|
T(c(Y), {
|
|
2362
2368
|
text: "",
|
|
2363
2369
|
icon: c(Dt),
|
|
2364
|
-
onClick:
|
|
2370
|
+
onClick: P[4] || (P[4] = (W) => H(-90))
|
|
2365
2371
|
}, null, 8, ["icon"])
|
|
2366
2372
|
]),
|
|
2367
2373
|
_: 1
|
|
@@ -2371,11 +2377,11 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2371
2377
|
tip: "原始大小",
|
|
2372
2378
|
shadow: !1
|
|
2373
2379
|
}, {
|
|
2374
|
-
default:
|
|
2380
|
+
default: A(() => [
|
|
2375
2381
|
T(c(Y), {
|
|
2376
2382
|
text: "",
|
|
2377
2383
|
icon: c(Ot),
|
|
2378
|
-
onClick:
|
|
2384
|
+
onClick: x
|
|
2379
2385
|
}, null, 8, ["icon"])
|
|
2380
2386
|
]),
|
|
2381
2387
|
_: 1
|
|
@@ -2384,7 +2390,7 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2384
2390
|
tip: "全屏",
|
|
2385
2391
|
shadow: !1
|
|
2386
2392
|
}, {
|
|
2387
|
-
default:
|
|
2393
|
+
default: A(() => [
|
|
2388
2394
|
T(c(Y), {
|
|
2389
2395
|
text: "",
|
|
2390
2396
|
icon: c(Pt),
|
|
@@ -2393,7 +2399,7 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2393
2399
|
]),
|
|
2394
2400
|
_: 1
|
|
2395
2401
|
})
|
|
2396
|
-
])) :
|
|
2402
|
+
])) : D("", !0)
|
|
2397
2403
|
]),
|
|
2398
2404
|
_: 1
|
|
2399
2405
|
}, 8, ["visible", "keyboard", "mask-closeable"]));
|
|
@@ -2408,125 +2414,125 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2408
2414
|
setup(d, { expose: o }) {
|
|
2409
2415
|
const n = {};
|
|
2410
2416
|
let e = 0, t, s = !1, l;
|
|
2411
|
-
const u = d,
|
|
2412
|
-
transform: `scale(${
|
|
2417
|
+
const u = d, r = R(1), a = R({ x: 0, y: 0 }), i = ue(null), f = ue(null), g = b(() => ({
|
|
2418
|
+
transform: `scale(${r.value})`,
|
|
2413
2419
|
marginInlineStart: `${a.value.x}px`,
|
|
2414
2420
|
marginBlockStart: `${a.value.y}px`
|
|
2415
2421
|
}));
|
|
2416
2422
|
ie(() => {
|
|
2417
|
-
document.addEventListener("mousemove",
|
|
2423
|
+
document.addEventListener("mousemove", B), document.addEventListener("mouseup", z);
|
|
2418
2424
|
}), he(() => {
|
|
2419
|
-
document.removeEventListener("mousemove",
|
|
2425
|
+
document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", z);
|
|
2420
2426
|
});
|
|
2421
2427
|
function h(y) {
|
|
2422
|
-
a.value = { x: 0, y: 0 }, t =
|
|
2423
|
-
const m = y.target, k = m.naturalWidth,
|
|
2424
|
-
e = Math.max(
|
|
2428
|
+
a.value = { x: 0, y: 0 }, t = i.value.getBoundingClientRect();
|
|
2429
|
+
const m = y.target, k = m.naturalWidth, x = m.naturalHeight, S = t.width / k, N = t.height / x;
|
|
2430
|
+
e = Math.max(S, N), r.value = e;
|
|
2425
2431
|
}
|
|
2426
2432
|
function p(y) {
|
|
2427
|
-
y.deltaY < 0 ?
|
|
2433
|
+
y.deltaY < 0 ? ee() : se();
|
|
2428
2434
|
}
|
|
2429
|
-
function
|
|
2435
|
+
function $(y) {
|
|
2430
2436
|
s = !0, n.x = y.x, n.y = y.y;
|
|
2431
2437
|
}
|
|
2432
|
-
function
|
|
2438
|
+
function z() {
|
|
2433
2439
|
s = !1;
|
|
2434
2440
|
}
|
|
2435
|
-
function
|
|
2441
|
+
function B(y) {
|
|
2436
2442
|
if (!s) return;
|
|
2437
2443
|
const m = y.x - n.x, k = y.y - n.y;
|
|
2438
2444
|
n.x = y.x, n.y = y.y;
|
|
2439
|
-
const
|
|
2440
|
-
a.value.x =
|
|
2445
|
+
const x = a.value.x + m * 2, S = a.value.y + k * 2;
|
|
2446
|
+
a.value.x = x, a.value.y = S, Z();
|
|
2441
2447
|
}
|
|
2442
|
-
function
|
|
2448
|
+
function M(y) {
|
|
2443
2449
|
y.touches.length === 1 ? (s = !0, n.x = y.touches[0].screenX, n.y = y.touches[0].screenY) : y.touches.length === 2 && (l = J(y.touches[0], y.touches[1]));
|
|
2444
2450
|
}
|
|
2445
|
-
function
|
|
2451
|
+
function I() {
|
|
2446
2452
|
s = !1, l = void 0;
|
|
2447
2453
|
}
|
|
2448
|
-
function
|
|
2454
|
+
function j(y) {
|
|
2449
2455
|
if (y.touches.length === 1) {
|
|
2450
2456
|
if (!s) return;
|
|
2451
|
-
const m = y.touches[0], k = m.screenX - n.x,
|
|
2452
|
-
a.value.x += k * 2, a.value.y +=
|
|
2457
|
+
const m = y.touches[0], k = m.screenX - n.x, x = m.screenY - n.y;
|
|
2458
|
+
a.value.x += k * 2, a.value.y += x * 2, n.x = m.screenX, n.y = m.screenY;
|
|
2453
2459
|
} else if (y.touches.length === 2) {
|
|
2454
2460
|
if (!l) return;
|
|
2455
2461
|
const m = J(y.touches[0], y.touches[1]), k = m / l;
|
|
2456
|
-
let
|
|
2457
|
-
|
|
2462
|
+
let x = r.value * k;
|
|
2463
|
+
x = Math.min(Ae, x), x = Math.max(e, x), r.value = x, l = m;
|
|
2458
2464
|
}
|
|
2459
2465
|
Z();
|
|
2460
2466
|
}
|
|
2461
2467
|
function J(y, m) {
|
|
2462
|
-
const k = m.clientX - y.clientX,
|
|
2463
|
-
return Math.sqrt(k * k +
|
|
2468
|
+
const k = m.clientX - y.clientX, x = m.clientY - y.clientY;
|
|
2469
|
+
return Math.sqrt(k * k + x * x);
|
|
2464
2470
|
}
|
|
2465
|
-
function
|
|
2466
|
-
|
|
2471
|
+
function ee() {
|
|
2472
|
+
r.value >= Ae || (r.value = Math.min(Ae, r.value * (1 + 0.1)));
|
|
2467
2473
|
}
|
|
2468
|
-
function
|
|
2469
|
-
|
|
2474
|
+
function se() {
|
|
2475
|
+
r.value <= e || (r.value = Math.max(e, r.value / (1 + 0.1)), Z());
|
|
2470
2476
|
}
|
|
2471
2477
|
function Z() {
|
|
2472
2478
|
requestAnimationFrame(() => {
|
|
2473
2479
|
const y = f.value.getBoundingClientRect(), m = y.left >= t.left, k = y.right <= t.right;
|
|
2474
2480
|
m ? a.value.x -= (y.left - t.left) * 2 : k && (a.value.x += (t.right - y.right) * 2);
|
|
2475
|
-
const
|
|
2476
|
-
|
|
2481
|
+
const x = y.top >= t.top, S = y.bottom <= t.bottom;
|
|
2482
|
+
x ? a.value.y -= (y.top - t.top) * 2 : S && (a.value.y += (t.bottom - y.bottom) * 2);
|
|
2477
2483
|
});
|
|
2478
2484
|
}
|
|
2479
2485
|
async function w(y = "base64") {
|
|
2480
2486
|
if (!u.src) return;
|
|
2481
|
-
const m = f.value.naturalWidth, k = f.value.naturalHeight,
|
|
2482
|
-
let
|
|
2483
|
-
const
|
|
2484
|
-
|
|
2485
|
-
let
|
|
2486
|
-
const
|
|
2487
|
-
return
|
|
2487
|
+
const m = f.value.naturalWidth, k = f.value.naturalHeight, x = m / k, N = m > k && x < u.aspectRatio || m < k && x > u.aspectRatio ? m / k : 1, H = r.value / e / N;
|
|
2488
|
+
let E = document.createElement("canvas");
|
|
2489
|
+
const U = Math.min(m, k);
|
|
2490
|
+
E.width = U, E.height = U / u.aspectRatio;
|
|
2491
|
+
let q = E.getContext("2d");
|
|
2492
|
+
const P = f.value.getBoundingClientRect(), W = (P.left - t.left) / r.value, Q = (P.top - t.top) / r.value;
|
|
2493
|
+
return q == null || q.drawImage(
|
|
2488
2494
|
f.value,
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
m *
|
|
2492
|
-
k *
|
|
2495
|
+
W * H,
|
|
2496
|
+
Q * H,
|
|
2497
|
+
m * H,
|
|
2498
|
+
k * H
|
|
2493
2499
|
), new Promise((ye) => {
|
|
2494
|
-
y === "base64" ? ye(
|
|
2500
|
+
y === "base64" ? ye(E.toDataURL("image/png")) : E == null || E.toBlob((bt) => {
|
|
2495
2501
|
ye(bt ?? void 0);
|
|
2496
2502
|
}, "image/png");
|
|
2497
2503
|
}).finally(() => {
|
|
2498
|
-
|
|
2504
|
+
q = void 0, E = void 0;
|
|
2499
2505
|
});
|
|
2500
2506
|
}
|
|
2501
|
-
return o({ cropImageAsync: w }), (y, m) => (v(),
|
|
2507
|
+
return o({ cropImageAsync: w }), (y, m) => (v(), _("div", {
|
|
2502
2508
|
class: "sq-image-crop",
|
|
2503
2509
|
style: K({ "--image-crop-ratio": u.aspectRatio }),
|
|
2504
2510
|
onWheelPassive: p,
|
|
2505
|
-
onMousedown: me(
|
|
2506
|
-
onTouchstartPassive:
|
|
2507
|
-
onTouchmovePassive:
|
|
2508
|
-
onTouchend:
|
|
2511
|
+
onMousedown: me($, ["prevent"]),
|
|
2512
|
+
onTouchstartPassive: M,
|
|
2513
|
+
onTouchmovePassive: j,
|
|
2514
|
+
onTouchend: I
|
|
2509
2515
|
}, [
|
|
2510
|
-
|
|
2516
|
+
O("div", {
|
|
2511
2517
|
class: "sq-image-crop-cropper",
|
|
2512
2518
|
style: K(`${u.aspectRatio > 1 ? "width" : "height"}: 100%`),
|
|
2513
2519
|
ref_key: "cropperRef",
|
|
2514
|
-
ref:
|
|
2520
|
+
ref: i
|
|
2515
2521
|
}, null, 4),
|
|
2516
|
-
u.src ? (v(),
|
|
2522
|
+
u.src ? (v(), _("img", {
|
|
2517
2523
|
key: 0,
|
|
2518
2524
|
style: K(g.value),
|
|
2519
2525
|
ref_key: "imgRef",
|
|
2520
2526
|
ref: f,
|
|
2521
2527
|
src: u.src,
|
|
2522
2528
|
onLoad: h
|
|
2523
|
-
}, null, 44, zn)) :
|
|
2529
|
+
}, null, 44, zn)) : D("", !0)
|
|
2524
2530
|
], 36));
|
|
2525
2531
|
}
|
|
2526
2532
|
}), Rn = {
|
|
2527
2533
|
key: 0,
|
|
2528
2534
|
class: "sq-input-prefix"
|
|
2529
|
-
}, Ln = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode"], In = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode", "rows", "cols"], Mn = { class: "sq-input-suffix" }, En = "sq-input",
|
|
2535
|
+
}, Ln = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode"], In = ["id", "disabled", "readonly", "placeholder", "type", "maxlength", "minlength", "autocomplete", "name", "autofocus", "form", "inputmode", "rows", "cols"], Mn = { class: "sq-input-suffix" }, En = "sq-input", We = /* @__PURE__ */ L({
|
|
2530
2536
|
name: En,
|
|
2531
2537
|
__name: "input",
|
|
2532
2538
|
props: /* @__PURE__ */ G({
|
|
@@ -2557,58 +2563,58 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2557
2563
|
}),
|
|
2558
2564
|
emits: /* @__PURE__ */ G(["focus", "blur", "input", "change", "clear"], ["update:value"]),
|
|
2559
2565
|
setup(d, { expose: o, emit: n }) {
|
|
2560
|
-
const e = Re(), t = n, s = d, { inputSize: l, inputRound: u, inputDisabled:
|
|
2561
|
-
const
|
|
2562
|
-
return
|
|
2563
|
-
}),
|
|
2564
|
-
() => s.type === "password" && c(
|
|
2565
|
-
), J = b(() => s.clearable && c(
|
|
2566
|
-
() => c(
|
|
2567
|
-
), Z = b(() => s.loading || c(
|
|
2566
|
+
const e = Re(), t = n, s = d, { inputSize: l, inputRound: u, inputDisabled: r, inputReadonly: a, id: i } = bs(s), f = le(d, "value"), g = R(!1), h = R(!1), p = ue(null), $ = b(() => {
|
|
2567
|
+
const E = [], U = c(l), q = c(u), P = c(Z);
|
|
2568
|
+
return U !== "md" && E.push(`sq-input--${U}`), s.status && E.push(`is-${s.status}`), q && E.push("is-round"), P && E.push("is-disabled"), E;
|
|
2569
|
+
}), z = b(() => c(h) ? lt : it), B = b(() => c(h) ? "text" : s.type), M = b(() => e.prefix || s.prefixIcon), I = b(() => c(g) && c(f).length), j = b(
|
|
2570
|
+
() => s.type === "password" && c(I)
|
|
2571
|
+
), J = b(() => s.clearable && c(I)), ee = b(() => s.loading ? Me : s.suffixIcon), se = b(
|
|
2572
|
+
() => c(j) || c(J) || c(ee) || e.suffix
|
|
2573
|
+
), Z = b(() => s.loading || c(r)), w = b(() => {
|
|
2568
2574
|
if (s.type === "textarea")
|
|
2569
2575
|
return c(Z) || c(a) ? "none" : s.resize;
|
|
2570
2576
|
});
|
|
2571
|
-
function y(
|
|
2572
|
-
t("focus",
|
|
2577
|
+
function y(E) {
|
|
2578
|
+
t("focus", E), !c(a) && (g.value = !0);
|
|
2573
2579
|
}
|
|
2574
|
-
function m(
|
|
2575
|
-
t("blur",
|
|
2580
|
+
function m(E) {
|
|
2581
|
+
t("blur", E), !c(a) && (g.value = !1);
|
|
2576
2582
|
}
|
|
2577
2583
|
function k() {
|
|
2578
|
-
setTimeout(
|
|
2584
|
+
setTimeout(N);
|
|
2579
2585
|
}
|
|
2580
|
-
function
|
|
2586
|
+
function x() {
|
|
2581
2587
|
f.value = "", t("clear");
|
|
2582
2588
|
}
|
|
2583
|
-
function
|
|
2589
|
+
function S() {
|
|
2584
2590
|
h.value = !h.value;
|
|
2585
2591
|
}
|
|
2586
|
-
function
|
|
2587
|
-
var
|
|
2588
|
-
(
|
|
2592
|
+
function N() {
|
|
2593
|
+
var E;
|
|
2594
|
+
(E = p.value) == null || E.focus();
|
|
2589
2595
|
}
|
|
2590
|
-
function
|
|
2591
|
-
var
|
|
2592
|
-
g.value = !1, (
|
|
2596
|
+
function H() {
|
|
2597
|
+
var E;
|
|
2598
|
+
g.value = !1, (E = p.value) == null || E.blur();
|
|
2593
2599
|
}
|
|
2594
|
-
return o({ focus:
|
|
2595
|
-
class: V(["sq-input",
|
|
2600
|
+
return o({ focus: N, blur: H }), (E, U) => (v(), _("div", {
|
|
2601
|
+
class: V(["sq-input", $.value]),
|
|
2596
2602
|
onMousedown: k
|
|
2597
2603
|
}, [
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
(v(),
|
|
2604
|
+
M.value ? (v(), _("span", Rn, [
|
|
2605
|
+
F(E.$slots, "prefix", {}, () => [
|
|
2606
|
+
(v(), C(ce(s.prefixIcon)))
|
|
2601
2607
|
])
|
|
2602
|
-
])) :
|
|
2603
|
-
s.type !== "textarea" ? ae((v(),
|
|
2608
|
+
])) : D("", !0),
|
|
2609
|
+
s.type !== "textarea" ? ae((v(), _("input", {
|
|
2604
2610
|
key: 1,
|
|
2605
2611
|
class: "sq-input-inner",
|
|
2606
|
-
"onUpdate:modelValue":
|
|
2607
|
-
id: c(
|
|
2612
|
+
"onUpdate:modelValue": U[0] || (U[0] = (q) => f.value = q),
|
|
2613
|
+
id: c(i),
|
|
2608
2614
|
disabled: Z.value,
|
|
2609
2615
|
readonly: c(a),
|
|
2610
2616
|
placeholder: s.placeholder,
|
|
2611
|
-
type:
|
|
2617
|
+
type: B.value,
|
|
2612
2618
|
maxlength: s.maxlength,
|
|
2613
2619
|
minlength: s.minlength,
|
|
2614
2620
|
autocomplete: s.autocomplete,
|
|
@@ -2620,20 +2626,20 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2620
2626
|
ref: p,
|
|
2621
2627
|
onFocus: y,
|
|
2622
2628
|
onBlur: m,
|
|
2623
|
-
onInput:
|
|
2624
|
-
onChange:
|
|
2629
|
+
onInput: U[1] || (U[1] = (q) => t("input", q)),
|
|
2630
|
+
onChange: U[2] || (U[2] = (q) => t("change", q))
|
|
2625
2631
|
}, null, 40, Ln)), [
|
|
2626
2632
|
[yt, f.value]
|
|
2627
|
-
]) : ae((v(),
|
|
2633
|
+
]) : ae((v(), _("textarea", {
|
|
2628
2634
|
key: 2,
|
|
2629
2635
|
class: "sq-input-inner",
|
|
2630
2636
|
style: K({ resize: w.value }),
|
|
2631
|
-
"onUpdate:modelValue":
|
|
2632
|
-
id: c(
|
|
2637
|
+
"onUpdate:modelValue": U[3] || (U[3] = (q) => f.value = q),
|
|
2638
|
+
id: c(i),
|
|
2633
2639
|
disabled: Z.value,
|
|
2634
2640
|
readonly: c(a),
|
|
2635
2641
|
placeholder: s.placeholder,
|
|
2636
|
-
type:
|
|
2642
|
+
type: B.value,
|
|
2637
2643
|
maxlength: s.maxlength,
|
|
2638
2644
|
minlength: s.minlength,
|
|
2639
2645
|
autocomplete: s.autocomplete,
|
|
@@ -2647,27 +2653,27 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2647
2653
|
ref: p,
|
|
2648
2654
|
onFocus: y,
|
|
2649
2655
|
onBlur: m,
|
|
2650
|
-
onInput:
|
|
2651
|
-
onChange:
|
|
2656
|
+
onInput: U[4] || (U[4] = (q) => t("input", q)),
|
|
2657
|
+
onChange: U[5] || (U[5] = (q) => t("change", q))
|
|
2652
2658
|
}, null, 44, In)), [
|
|
2653
2659
|
[xt, f.value]
|
|
2654
2660
|
]),
|
|
2655
|
-
ae(
|
|
2656
|
-
|
|
2661
|
+
ae(O("span", Mn, [
|
|
2662
|
+
j.value ? (v(), C(ce(z.value), {
|
|
2657
2663
|
key: 0,
|
|
2658
2664
|
class: "sq-input-suffix-pwd",
|
|
2659
|
-
onMousedown:
|
|
2660
|
-
}, null, 32)) :
|
|
2661
|
-
J.value ? (v(),
|
|
2665
|
+
onMousedown: S
|
|
2666
|
+
}, null, 32)) : D("", !0),
|
|
2667
|
+
J.value ? (v(), C(c(Ue), {
|
|
2662
2668
|
key: 1,
|
|
2663
2669
|
class: "sq-input-suffix-clear",
|
|
2664
|
-
onMousedown:
|
|
2665
|
-
})) :
|
|
2666
|
-
|
|
2667
|
-
|
|
2670
|
+
onMousedown: x
|
|
2671
|
+
})) : D("", !0),
|
|
2672
|
+
F(E.$slots, "suffix", {}, () => [
|
|
2673
|
+
ee.value ? (v(), C(ce(ee.value), { key: 0 })) : D("", !0)
|
|
2668
2674
|
])
|
|
2669
2675
|
], 512), [
|
|
2670
|
-
[ve,
|
|
2676
|
+
[ve, se.value]
|
|
2671
2677
|
])
|
|
2672
2678
|
], 34));
|
|
2673
2679
|
}
|
|
@@ -2685,63 +2691,63 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2685
2691
|
emits: /* @__PURE__ */ G(["click", "change"], ["update:active"]),
|
|
2686
2692
|
setup(d, { emit: o }) {
|
|
2687
2693
|
const n = o, e = d, t = le(d, "active"), s = b(() => [`sq-menu--${e.direction}`]);
|
|
2688
|
-
function l(
|
|
2689
|
-
|
|
2694
|
+
function l(r, a) {
|
|
2695
|
+
r.disabled || a();
|
|
2690
2696
|
}
|
|
2691
|
-
function u(
|
|
2692
|
-
n("click",
|
|
2697
|
+
function u(r, a) {
|
|
2698
|
+
n("click", r.value, a), !(r.disabled || r.value === t.value) && (n("change", r.value), t.value = r.value);
|
|
2693
2699
|
}
|
|
2694
|
-
return (
|
|
2700
|
+
return (r, a) => (v(), _("menu", {
|
|
2695
2701
|
class: V(["sq-menu", s.value])
|
|
2696
2702
|
}, [
|
|
2697
|
-
e.router ? (v(!0),
|
|
2703
|
+
e.router ? (v(!0), _(te, { key: 0 }, de(e.items, (i) => (v(), C(c(Ht), {
|
|
2698
2704
|
custom: "",
|
|
2699
|
-
to: { name:
|
|
2700
|
-
key:
|
|
2705
|
+
to: { name: i.value },
|
|
2706
|
+
key: i.value
|
|
2701
2707
|
}, {
|
|
2702
|
-
default:
|
|
2703
|
-
|
|
2704
|
-
class: V(["sq-menu-item", { "is-active": g, "is-disabled":
|
|
2705
|
-
onClick: (h) => l(
|
|
2708
|
+
default: A(({ navigate: f, isActive: g }) => [
|
|
2709
|
+
O("li", {
|
|
2710
|
+
class: V(["sq-menu-item", { "is-active": g, "is-disabled": i.disabled }]),
|
|
2711
|
+
onClick: (h) => l(i, f)
|
|
2706
2712
|
}, [
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
textContent: X(
|
|
2713
|
+
F(r.$slots, "default", fe({ ref_for: !0 }, i), () => [
|
|
2714
|
+
i.icon ? (v(), C(ce(i.icon), { key: 0 })) : D("", !0),
|
|
2715
|
+
O("span", {
|
|
2716
|
+
textContent: X(i.text)
|
|
2711
2717
|
}, null, 8, Dn),
|
|
2712
|
-
e.direction === "vertical" ? ae((v(),
|
|
2718
|
+
e.direction === "vertical" ? ae((v(), C(c(Ze), {
|
|
2713
2719
|
key: 1,
|
|
2714
2720
|
dot: "",
|
|
2715
2721
|
"show-zero": "",
|
|
2716
2722
|
type: "primary"
|
|
2717
2723
|
}, null, 512)), [
|
|
2718
2724
|
[ve, g]
|
|
2719
|
-
]) :
|
|
2725
|
+
]) : D("", !0)
|
|
2720
2726
|
])
|
|
2721
2727
|
], 10, An)
|
|
2722
2728
|
]),
|
|
2723
2729
|
_: 2
|
|
2724
|
-
}, 1032, ["to"]))), 128)) : (v(!0),
|
|
2730
|
+
}, 1032, ["to"]))), 128)) : (v(!0), _(te, { key: 1 }, de(e.items, (i) => (v(), _("li", {
|
|
2725
2731
|
class: V(["sq-menu-item", {
|
|
2726
|
-
"is-active": t.value ===
|
|
2727
|
-
"is-disabled":
|
|
2732
|
+
"is-active": t.value === i.value,
|
|
2733
|
+
"is-disabled": i.disabled
|
|
2728
2734
|
}]),
|
|
2729
|
-
key:
|
|
2730
|
-
onClick: (f) => u(
|
|
2735
|
+
key: i.value,
|
|
2736
|
+
onClick: (f) => u(i, f)
|
|
2731
2737
|
}, [
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
textContent: X(
|
|
2738
|
+
F(r.$slots, "default", fe({ ref_for: !0 }, i), () => [
|
|
2739
|
+
i.icon ? (v(), C(ce(i.icon), { key: 0 })) : D("", !0),
|
|
2740
|
+
O("span", {
|
|
2741
|
+
textContent: X(i.text)
|
|
2736
2742
|
}, null, 8, Pn),
|
|
2737
|
-
e.direction === "vertical" ? ae((v(),
|
|
2743
|
+
e.direction === "vertical" ? ae((v(), C(c(Ze), {
|
|
2738
2744
|
key: 1,
|
|
2739
2745
|
dot: "",
|
|
2740
2746
|
"show-zero": "",
|
|
2741
2747
|
type: "primary"
|
|
2742
2748
|
}, null, 512)), [
|
|
2743
|
-
[ve, t.value ===
|
|
2744
|
-
]) :
|
|
2749
|
+
[ve, t.value === i.value]
|
|
2750
|
+
]) : D("", !0)
|
|
2745
2751
|
])
|
|
2746
2752
|
], 10, On))), 128))
|
|
2747
2753
|
], 2));
|
|
@@ -2766,25 +2772,25 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2766
2772
|
function s() {
|
|
2767
2773
|
e.value = !1;
|
|
2768
2774
|
}
|
|
2769
|
-
return o({ close: s }), (l, u) => (v(),
|
|
2775
|
+
return o({ close: s }), (l, u) => (v(), C(be, {
|
|
2770
2776
|
appear: "",
|
|
2771
2777
|
name: "sq-zoom-top",
|
|
2772
2778
|
onBeforeLeave: n.onClose,
|
|
2773
2779
|
onAfterLeave: n.onDestroy
|
|
2774
2780
|
}, {
|
|
2775
|
-
default:
|
|
2776
|
-
ae(
|
|
2781
|
+
default: A(() => [
|
|
2782
|
+
ae(O("div", {
|
|
2777
2783
|
class: V(["sq-message", `is-${n.type}`]),
|
|
2778
2784
|
id: n.id,
|
|
2779
2785
|
style: K({ top: `${n.offsetTop}px` })
|
|
2780
2786
|
}, [
|
|
2781
2787
|
T(c(ge), { class: "sq-message-inner" }, {
|
|
2782
|
-
default:
|
|
2783
|
-
n.type && t.value ? (v(),
|
|
2788
|
+
default: A(() => [
|
|
2789
|
+
n.type && t.value ? (v(), C(ce(t.value), {
|
|
2784
2790
|
key: 0,
|
|
2785
2791
|
class: "sq-message-icon"
|
|
2786
|
-
})) :
|
|
2787
|
-
|
|
2792
|
+
})) : D("", !0),
|
|
2793
|
+
O("div", {
|
|
2788
2794
|
class: "sq-message-content",
|
|
2789
2795
|
textContent: X(n.message)
|
|
2790
2796
|
}, null, 8, Fn)
|
|
@@ -2798,16 +2804,16 @@ ${j}${D}`, te(k.target), m(s.value, ye, ye);
|
|
|
2798
2804
|
_: 1
|
|
2799
2805
|
}, 8, ["onBeforeLeave", "onAfterLeave"]));
|
|
2800
2806
|
}
|
|
2801
|
-
}), { getCssVar:
|
|
2807
|
+
}), { getCssVar: jn } = Ve(), { nextZIndex: Wn } = He(), $e = [], Xn = ["primary", "success", "info", "warn", "error"], De = parseInt(jn("--sq-padding-md"));
|
|
2802
2808
|
let Yn = 0;
|
|
2803
2809
|
const Pe = (d = {}) => {
|
|
2804
2810
|
const o = `sq-message-${Yn++}`;
|
|
2805
2811
|
let n = document.querySelector(".sq-message-wrap");
|
|
2806
|
-
n || (n = document.createElement("div"), n.classList.add("sq-message-wrap"), document.body.appendChild(n)), n.style.zIndex =
|
|
2812
|
+
n || (n = document.createElement("div"), n.classList.add("sq-message-wrap"), document.body.appendChild(n)), n.style.zIndex = Wn().toString();
|
|
2807
2813
|
let e = De;
|
|
2808
2814
|
$e.forEach((a) => {
|
|
2809
|
-
var
|
|
2810
|
-
e += (((
|
|
2815
|
+
var i;
|
|
2816
|
+
e += (((i = a.vm.el) == null ? void 0 : i.offsetHeight) || 0) + De;
|
|
2811
2817
|
});
|
|
2812
2818
|
const t = {
|
|
2813
2819
|
type: "info",
|
|
@@ -2822,7 +2828,7 @@ const Pe = (d = {}) => {
|
|
|
2822
2828
|
t.onClose = () => {
|
|
2823
2829
|
l == null || l();
|
|
2824
2830
|
const a = $e.findIndex(
|
|
2825
|
-
(h) => h.vm.component.props.id ===
|
|
2831
|
+
(h) => h.vm.component.props.id === r.component.props.id
|
|
2826
2832
|
), f = $e.splice(a, 1)[0].vm.el.offsetHeight;
|
|
2827
2833
|
if (!($e.length < 1))
|
|
2828
2834
|
for (const h of $e) {
|
|
@@ -2834,11 +2840,11 @@ const Pe = (d = {}) => {
|
|
|
2834
2840
|
t.onDestroy = () => {
|
|
2835
2841
|
u == null || u(), Ie(null, s), s.remove(), s = null;
|
|
2836
2842
|
};
|
|
2837
|
-
const
|
|
2838
|
-
return Ie(
|
|
2843
|
+
const r = T(Hn, t);
|
|
2844
|
+
return Ie(r, s), $e.push({ vm: r }), n.appendChild(s.firstElementChild), {
|
|
2839
2845
|
close: () => {
|
|
2840
|
-
var a,
|
|
2841
|
-
(
|
|
2846
|
+
var a, i;
|
|
2847
|
+
(i = (a = r.component) == null ? void 0 : a.exposed) == null || i.close();
|
|
2842
2848
|
}
|
|
2843
2849
|
};
|
|
2844
2850
|
};
|
|
@@ -2870,7 +2876,7 @@ const qa = Pe, Kn = ["textContent"], Gn = "sq-message-box", Zn = /* @__PURE__ */
|
|
|
2870
2876
|
function t() {
|
|
2871
2877
|
e.value = !1;
|
|
2872
2878
|
}
|
|
2873
|
-
return o({ close: t }), (s, l) => (v(),
|
|
2879
|
+
return o({ close: t }), (s, l) => (v(), C(c(Ws), {
|
|
2874
2880
|
visible: e.value,
|
|
2875
2881
|
"onUpdate:visible": l[0] || (l[0] = (u) => e.value = u),
|
|
2876
2882
|
type: n.type,
|
|
@@ -2883,8 +2889,8 @@ const qa = Pe, Kn = ["textContent"], Gn = "sq-message-box", Zn = /* @__PURE__ */
|
|
|
2883
2889
|
onOk: n.onOk,
|
|
2884
2890
|
onClosed: n.onDestroy
|
|
2885
2891
|
}, {
|
|
2886
|
-
default:
|
|
2887
|
-
|
|
2892
|
+
default: A(() => [
|
|
2893
|
+
O("span", {
|
|
2888
2894
|
textContent: X(n.message)
|
|
2889
2895
|
}, null, 8, Kn)
|
|
2890
2896
|
]),
|
|
@@ -2927,7 +2933,7 @@ const qa = Pe, Kn = ["textContent"], Gn = "sq-message-box", Zn = /* @__PURE__ */
|
|
|
2927
2933
|
const o = d, n = le(d, "current"), e = (t) => {
|
|
2928
2934
|
n.value += t;
|
|
2929
2935
|
};
|
|
2930
|
-
return (t, s) => (v(),
|
|
2936
|
+
return (t, s) => (v(), C(c(Y), {
|
|
2931
2937
|
icon: c(rt),
|
|
2932
2938
|
size: o.size,
|
|
2933
2939
|
disabled: n.value === 1 || o.disabled,
|
|
@@ -2950,7 +2956,7 @@ const qa = Pe, Kn = ["textContent"], Gn = "sq-message-box", Zn = /* @__PURE__ */
|
|
|
2950
2956
|
const o = d, n = le(d, "current"), e = (t) => {
|
|
2951
2957
|
n.value += t;
|
|
2952
2958
|
};
|
|
2953
|
-
return (t, s) => (v(),
|
|
2959
|
+
return (t, s) => (v(), C(c(Y), {
|
|
2954
2960
|
icon: c(ut),
|
|
2955
2961
|
size: o.size,
|
|
2956
2962
|
disabled: n.value === o.maxPage || o.disabled,
|
|
@@ -2973,20 +2979,20 @@ const qa = Pe, Kn = ["textContent"], Gn = "sq-message-box", Zn = /* @__PURE__ */
|
|
|
2973
2979
|
const o = d, n = le(d, "current"), e = (t) => {
|
|
2974
2980
|
n.value = t;
|
|
2975
2981
|
};
|
|
2976
|
-
return (t, s) => (v(),
|
|
2977
|
-
(v(!0),
|
|
2978
|
-
l ? (v(),
|
|
2982
|
+
return (t, s) => (v(), _("div", no, [
|
|
2983
|
+
(v(!0), _(te, null, de(o.list, (l) => (v(), _(te, { key: l }, [
|
|
2984
|
+
l ? (v(), C(c(Y), {
|
|
2979
2985
|
key: 0,
|
|
2980
2986
|
type: n.value === l ? "primary" : void 0,
|
|
2981
2987
|
size: o.size,
|
|
2982
2988
|
disabled: o.disabled,
|
|
2983
2989
|
onClick: (u) => e(l)
|
|
2984
2990
|
}, {
|
|
2985
|
-
default:
|
|
2991
|
+
default: A(() => [
|
|
2986
2992
|
Te(X(l), 1)
|
|
2987
2993
|
]),
|
|
2988
2994
|
_: 2
|
|
2989
|
-
}, 1032, ["type", "size", "disabled", "onClick"])) : (v(),
|
|
2995
|
+
}, 1032, ["type", "size", "disabled", "onClick"])) : (v(), C(c(Y), {
|
|
2990
2996
|
key: 1,
|
|
2991
2997
|
icon: c(Nt),
|
|
2992
2998
|
size: o.size,
|
|
@@ -3004,11 +3010,11 @@ const qa = Pe, Kn = ["textContent"], Gn = "sq-message-box", Zn = /* @__PURE__ */
|
|
|
3004
3010
|
},
|
|
3005
3011
|
setup(d) {
|
|
3006
3012
|
const o = d;
|
|
3007
|
-
return (n, e) => (v(),
|
|
3013
|
+
return (n, e) => (v(), C(c(ge), {
|
|
3008
3014
|
size: o.size === "sm" ? "sm" : "md"
|
|
3009
3015
|
}, {
|
|
3010
|
-
default:
|
|
3011
|
-
|
|
3016
|
+
default: A(() => [
|
|
3017
|
+
O("span", null, "共 " + X(o.total) + " 条", 1)
|
|
3012
3018
|
]),
|
|
3013
3019
|
_: 1
|
|
3014
3020
|
}, 8, ["size"]));
|
|
@@ -3031,41 +3037,41 @@ const qa = Pe, Kn = ["textContent"], Gn = "sq-message-box", Zn = /* @__PURE__ */
|
|
|
3031
3037
|
emits: ["update:current", "update:pageSize"],
|
|
3032
3038
|
setup(d) {
|
|
3033
3039
|
const o = d, n = le(d, "current"), e = le(d, "pageSize"), t = b(() => Math.ceil(o.total / e.value) || 1), s = b(() => {
|
|
3034
|
-
const u = [],
|
|
3035
|
-
let a = n.value -
|
|
3036
|
-
a < 2 && (a = 2,
|
|
3040
|
+
const u = [], r = Math.floor(o.pagerCount / 2) - 1;
|
|
3041
|
+
let a = n.value - r, i = n.value + r;
|
|
3042
|
+
a < 2 && (a = 2, i = a + r * 2), i > t.value - 1 && (i = t.value - 1, a = i - r * 2);
|
|
3037
3043
|
for (let f = 1; f <= t.value; f++)
|
|
3038
|
-
f === 1 || f === t.value || f >= a && f <=
|
|
3044
|
+
f === 1 || f === t.value || f >= a && f <= i ? u.push(f) : (f === a - 1 || f === i + 1) && u.push(0);
|
|
3039
3045
|
return u;
|
|
3040
3046
|
}), l = b(() => {
|
|
3041
|
-
const u = o.layout ?? ["prev", "pager", "next"],
|
|
3047
|
+
const u = o.layout ?? ["prev", "pager", "next"], r = [];
|
|
3042
3048
|
for (const a of u)
|
|
3043
3049
|
switch (a) {
|
|
3044
3050
|
case "prev":
|
|
3045
|
-
|
|
3051
|
+
r.push(eo);
|
|
3046
3052
|
break;
|
|
3047
3053
|
case "pager":
|
|
3048
|
-
|
|
3054
|
+
r.push(ao);
|
|
3049
3055
|
break;
|
|
3050
3056
|
case "next":
|
|
3051
|
-
|
|
3057
|
+
r.push(so);
|
|
3052
3058
|
break;
|
|
3053
3059
|
case "total":
|
|
3054
|
-
|
|
3060
|
+
r.push(io);
|
|
3055
3061
|
break;
|
|
3056
3062
|
}
|
|
3057
|
-
return
|
|
3063
|
+
return r;
|
|
3058
3064
|
});
|
|
3059
|
-
return (u,
|
|
3060
|
-
(v(!0),
|
|
3061
|
-
key:
|
|
3065
|
+
return (u, r) => (v(), _("div", ro, [
|
|
3066
|
+
(v(!0), _(te, null, de(l.value, (a, i) => (v(), C(ce(a), {
|
|
3067
|
+
key: i,
|
|
3062
3068
|
size: o.size,
|
|
3063
3069
|
disabled: o.disabled,
|
|
3064
3070
|
list: s.value,
|
|
3065
3071
|
"max-page": t.value,
|
|
3066
3072
|
total: o.total,
|
|
3067
3073
|
current: n.value,
|
|
3068
|
-
"onUpdate:current":
|
|
3074
|
+
"onUpdate:current": r[0] || (r[0] = (f) => n.value = f)
|
|
3069
3075
|
}, null, 40, ["size", "disabled", "list", "max-page", "total", "current"]))), 128))
|
|
3070
3076
|
]));
|
|
3071
3077
|
}
|
|
@@ -3094,7 +3100,7 @@ function vt(d) {
|
|
|
3094
3100
|
case $t:
|
|
3095
3101
|
case "svg":
|
|
3096
3102
|
return Je(o);
|
|
3097
|
-
case
|
|
3103
|
+
case te:
|
|
3098
3104
|
return vt(o.children);
|
|
3099
3105
|
default:
|
|
3100
3106
|
return o;
|
|
@@ -3127,8 +3133,8 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3127
3133
|
emits: /* @__PURE__ */ G(["openChange"], ["update:visible"]),
|
|
3128
3134
|
setup(d, { emit: o }) {
|
|
3129
3135
|
const { getCssVar: n } = Ve(), { nextZIndex: e } = He(), t = Ne(), s = parseInt(n("--sq-padding-sm")), l = parseInt(n("--sq-padding-md"));
|
|
3130
|
-
let u,
|
|
3131
|
-
const
|
|
3136
|
+
let u, r, a = !1;
|
|
3137
|
+
const i = o, f = d, g = le(d, "visible"), h = R(0), p = R({}), $ = R(!1), z = ue(null), B = ue(null), M = b(() => {
|
|
3132
3138
|
const y = [];
|
|
3133
3139
|
return f.shadow && y.push("has-shadow"), [y];
|
|
3134
3140
|
});
|
|
@@ -3137,88 +3143,88 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3137
3143
|
a = y, w();
|
|
3138
3144
|
const m = y ? f.showAfter : f.hideAfter;
|
|
3139
3145
|
u = setTimeout(() => {
|
|
3140
|
-
|
|
3146
|
+
$.value = y;
|
|
3141
3147
|
}, m);
|
|
3142
|
-
}), oe(
|
|
3143
|
-
y ? (h.value = e(), Z(),
|
|
3144
|
-
|
|
3145
|
-
|
|
3148
|
+
}), oe($, (y) => {
|
|
3149
|
+
y ? (h.value = e(), Z(), r = jt(
|
|
3150
|
+
z.value.$el,
|
|
3151
|
+
B.value,
|
|
3146
3152
|
Z
|
|
3147
|
-
)) :
|
|
3153
|
+
)) : r == null || r(), i("openChange", y);
|
|
3148
3154
|
}), ie(() => {
|
|
3149
3155
|
Z();
|
|
3150
3156
|
}), he(() => {
|
|
3151
|
-
w(), document.removeEventListener("click",
|
|
3157
|
+
w(), document.removeEventListener("click", se);
|
|
3152
3158
|
});
|
|
3153
|
-
function
|
|
3154
|
-
f.trigger !== "hover" || f.disabled ||
|
|
3159
|
+
function I() {
|
|
3160
|
+
f.trigger !== "hover" || f.disabled || ee(!1);
|
|
3155
3161
|
}
|
|
3156
|
-
function
|
|
3157
|
-
f.trigger === "hover" &&
|
|
3162
|
+
function j() {
|
|
3163
|
+
f.trigger === "hover" && se();
|
|
3158
3164
|
}
|
|
3159
3165
|
function J(y) {
|
|
3160
|
-
f.trigger === "click" && !f.disabled && !g.value && (y.stopPropagation(),
|
|
3166
|
+
f.trigger === "click" && !f.disabled && !g.value && (y.stopPropagation(), ee());
|
|
3161
3167
|
}
|
|
3162
|
-
function
|
|
3163
|
-
g.value = !0, y && document.addEventListener("click",
|
|
3168
|
+
function ee(y = !0) {
|
|
3169
|
+
g.value = !0, y && document.addEventListener("click", se);
|
|
3164
3170
|
}
|
|
3165
|
-
function
|
|
3166
|
-
g.value = !1, document.removeEventListener("click",
|
|
3171
|
+
function se() {
|
|
3172
|
+
g.value = !1, document.removeEventListener("click", se);
|
|
3167
3173
|
}
|
|
3168
3174
|
async function Z() {
|
|
3169
|
-
var
|
|
3170
|
-
const y = typeof ((
|
|
3175
|
+
var N, H;
|
|
3176
|
+
const y = typeof ((N = z.value) == null ? void 0 : N.$el.getBoundingClientRect), m = typeof ((H = B.value) == null ? void 0 : H.getBoundingClientRect);
|
|
3171
3177
|
if (y !== "function" || m !== "function") return;
|
|
3172
|
-
const k = await
|
|
3178
|
+
const k = await Wt(z.value.$el, B.value, {
|
|
3173
3179
|
placement: f.placement,
|
|
3174
3180
|
middleware: [
|
|
3175
3181
|
Xt(f.offset ?? s),
|
|
3176
3182
|
Yt(),
|
|
3177
3183
|
Kt({ padding: l })
|
|
3178
3184
|
]
|
|
3179
|
-
}), { x
|
|
3185
|
+
}), { x, y: S } = k;
|
|
3180
3186
|
p.value = {
|
|
3181
|
-
left: `${
|
|
3182
|
-
top: `${
|
|
3187
|
+
left: `${x}px`,
|
|
3188
|
+
top: `${S}px`
|
|
3183
3189
|
};
|
|
3184
3190
|
}
|
|
3185
3191
|
function w() {
|
|
3186
3192
|
u && (clearTimeout(u), u = void 0);
|
|
3187
3193
|
}
|
|
3188
|
-
return (y, m) => (v(),
|
|
3194
|
+
return (y, m) => (v(), _(te, null, [
|
|
3189
3195
|
T(c(fo), {
|
|
3190
3196
|
class: V(["sq-popover-trigger", c(t).class]),
|
|
3191
3197
|
style: K(c(t).style),
|
|
3192
3198
|
ref_key: "triggerRef",
|
|
3193
|
-
ref:
|
|
3194
|
-
onMouseenter:
|
|
3195
|
-
onMouseleave:
|
|
3199
|
+
ref: z,
|
|
3200
|
+
onMouseenter: I,
|
|
3201
|
+
onMouseleave: j,
|
|
3196
3202
|
onClick: J
|
|
3197
3203
|
}, {
|
|
3198
|
-
default:
|
|
3199
|
-
|
|
3204
|
+
default: A(() => [
|
|
3205
|
+
F(y.$slots, "reference")
|
|
3200
3206
|
]),
|
|
3201
3207
|
_: 3
|
|
3202
3208
|
}, 8, ["class", "style"]),
|
|
3203
|
-
(v(),
|
|
3209
|
+
(v(), C(et, {
|
|
3204
3210
|
to: "body",
|
|
3205
3211
|
disabled: !f.teleported
|
|
3206
3212
|
}, [
|
|
3207
3213
|
T(be, {
|
|
3208
3214
|
name: f.transition
|
|
3209
3215
|
}, {
|
|
3210
|
-
default:
|
|
3211
|
-
ae(
|
|
3212
|
-
class: V(["sq-popover", [
|
|
3216
|
+
default: A(() => [
|
|
3217
|
+
ae(O("div", {
|
|
3218
|
+
class: V(["sq-popover", [M.value, f.popoverClass]]),
|
|
3213
3219
|
style: K([{ ...p.value, zIndex: h.value }, f.popoverStyle]),
|
|
3214
3220
|
ref_key: "popverRef",
|
|
3215
|
-
ref:
|
|
3221
|
+
ref: B,
|
|
3216
3222
|
onClick: m[0] || (m[0] = me(() => {
|
|
3217
3223
|
}, ["stop"]))
|
|
3218
3224
|
}, [
|
|
3219
|
-
|
|
3225
|
+
F(y.$slots, "default")
|
|
3220
3226
|
], 6), [
|
|
3221
|
-
[ve,
|
|
3227
|
+
[ve, $.value]
|
|
3222
3228
|
])
|
|
3223
3229
|
]),
|
|
3224
3230
|
_: 3
|
|
@@ -3244,24 +3250,24 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3244
3250
|
},
|
|
3245
3251
|
setup(d) {
|
|
3246
3252
|
const o = new ResizeObserver(a), n = d, e = R(100), t = ue(null), s = b(() => {
|
|
3247
|
-
const
|
|
3248
|
-
return n.color ||
|
|
3253
|
+
const i = [];
|
|
3254
|
+
return n.color || i.push(`is-${n.type}`), n.variant && i.push(`is-${n.variant}`), i;
|
|
3249
3255
|
}), l = b(() => {
|
|
3250
|
-
const
|
|
3251
|
-
return (n.value - n.min) * 100 /
|
|
3252
|
-
}), u = b(() => `${Math.round(l.value * 10) / 10} %`),
|
|
3253
|
-
const
|
|
3254
|
-
if (
|
|
3255
|
-
|
|
3256
|
+
const i = n.max - n.min;
|
|
3257
|
+
return (n.value - n.min) * 100 / i;
|
|
3258
|
+
}), u = b(() => `${Math.round(l.value * 10) / 10} %`), r = b(() => {
|
|
3259
|
+
const i = {};
|
|
3260
|
+
if (i["--progress-stroke"] = `${n.stroke}px`, !n.variant)
|
|
3261
|
+
i["--progress-value"] = `${l.value}%`;
|
|
3256
3262
|
else if (t.value) {
|
|
3257
3263
|
const f = 100 / e.value * n.stroke, g = (100 - f) / 2, h = Math.PI * g * 2, p = l.value / 100;
|
|
3258
|
-
|
|
3264
|
+
i["--progress-circle-r"] = `${g}px`, i["--progress-circle-l"] = `${h}px`, i["--progress-circle-stroke"] = `${f}px`, i["--progress-value"] = `${h * p}`, l.value === 0 && (i["--progress-circle-opaciry"] = "0");
|
|
3259
3265
|
}
|
|
3260
3266
|
if (n.color) {
|
|
3261
3267
|
const g = typeof n.color == "string" ? n.color : n.color(l.value);
|
|
3262
|
-
|
|
3268
|
+
i["--progress-color"] = g;
|
|
3263
3269
|
}
|
|
3264
|
-
return
|
|
3270
|
+
return i;
|
|
3265
3271
|
});
|
|
3266
3272
|
ie(() => {
|
|
3267
3273
|
o.observe(t.value);
|
|
@@ -3271,37 +3277,37 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3271
3277
|
function a() {
|
|
3272
3278
|
e.value = t.value.getBoundingClientRect().width;
|
|
3273
3279
|
}
|
|
3274
|
-
return (
|
|
3280
|
+
return (i, f) => (v(), _("div", {
|
|
3275
3281
|
class: V(["sq-progress", s.value]),
|
|
3276
3282
|
ref_key: "progressRef",
|
|
3277
3283
|
ref: t,
|
|
3278
|
-
style: K(
|
|
3284
|
+
style: K(r.value)
|
|
3279
3285
|
}, [
|
|
3280
|
-
n.variant === "circle" ? (v(),
|
|
3281
|
-
f[0] || (f[0] =
|
|
3286
|
+
n.variant === "circle" ? (v(), _(te, { key: 0 }, [
|
|
3287
|
+
f[0] || (f[0] = O("svg", {
|
|
3282
3288
|
viewBox: "0 0 100 100",
|
|
3283
3289
|
version: "1.1",
|
|
3284
3290
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3285
3291
|
}, [
|
|
3286
|
-
|
|
3292
|
+
O("circle", {
|
|
3287
3293
|
class: "sq-progress-track",
|
|
3288
3294
|
cx: "50",
|
|
3289
3295
|
cy: "50"
|
|
3290
3296
|
}),
|
|
3291
|
-
|
|
3297
|
+
O("circle", {
|
|
3292
3298
|
class: "sq-progress-path",
|
|
3293
3299
|
cx: "50",
|
|
3294
3300
|
cy: "50"
|
|
3295
3301
|
})
|
|
3296
3302
|
], -1)),
|
|
3297
|
-
n.label ? (v(),
|
|
3298
|
-
|
|
3299
|
-
|
|
3303
|
+
n.label ? (v(), _("div", vo, [
|
|
3304
|
+
F(i.$slots, "default", { percentage: l.value }, () => [
|
|
3305
|
+
O("span", {
|
|
3300
3306
|
textContent: X(u.value)
|
|
3301
3307
|
}, null, 8, mo)
|
|
3302
3308
|
])
|
|
3303
|
-
])) :
|
|
3304
|
-
], 64)) :
|
|
3309
|
+
])) : D("", !0)
|
|
3310
|
+
], 64)) : D("", !0)
|
|
3305
3311
|
], 6));
|
|
3306
3312
|
}
|
|
3307
3313
|
}), bo = ["autofocus", "name", "form", "value", "disabled"], yo = {
|
|
@@ -3330,44 +3336,44 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3330
3336
|
radioDisabled: s,
|
|
3331
3337
|
radioForm: l,
|
|
3332
3338
|
radioName: u,
|
|
3333
|
-
radioVariant:
|
|
3339
|
+
radioVariant: r,
|
|
3334
3340
|
groupContext: a
|
|
3335
|
-
} = ys(e),
|
|
3336
|
-
const p = [],
|
|
3337
|
-
return
|
|
3341
|
+
} = ys(e), i = R(), f = le(d, "checked"), g = b(() => {
|
|
3342
|
+
const p = [], $ = c(t), z = c(s), B = c(r);
|
|
3343
|
+
return $ !== "md" && p.push(`sq-selection--${$}`), h.value && p.push("is-checked"), z && p.push("is-disabled"), B && p.push(`is-${B}`), p;
|
|
3338
3344
|
}), h = b(() => a ? c(a).checked === e.value : f.value);
|
|
3339
|
-
return oe(
|
|
3345
|
+
return oe(i, (p) => {
|
|
3340
3346
|
f.value = p === e.value;
|
|
3341
3347
|
}), oe(h, (p) => {
|
|
3342
|
-
if (p ?
|
|
3348
|
+
if (p ? i.value = e.value ?? "on" : i.value = void 0, f.value !== p) {
|
|
3343
3349
|
f.value = p;
|
|
3344
3350
|
return;
|
|
3345
3351
|
}
|
|
3346
3352
|
}), oe(f, (p) => {
|
|
3347
3353
|
h.value !== p && a && a.value.toggleItem(e.value);
|
|
3348
3354
|
}), ie(() => {
|
|
3349
|
-
f.value = h.value,
|
|
3350
|
-
}), (p,
|
|
3355
|
+
f.value = h.value, i.value = f.value ? e.value ?? "on" : void 0;
|
|
3356
|
+
}), (p, $) => (v(), _("label", {
|
|
3351
3357
|
class: V(["sq-selection sq-radio", g.value])
|
|
3352
3358
|
}, [
|
|
3353
|
-
ae(
|
|
3359
|
+
ae(O("input", {
|
|
3354
3360
|
type: "radio",
|
|
3355
3361
|
autofocus: e.autofocus,
|
|
3356
3362
|
name: c(u),
|
|
3357
3363
|
form: c(l),
|
|
3358
3364
|
value: e.value,
|
|
3359
3365
|
disabled: c(s),
|
|
3360
|
-
"onUpdate:modelValue":
|
|
3361
|
-
onChange:
|
|
3366
|
+
"onUpdate:modelValue": $[0] || ($[0] = (z) => i.value = z),
|
|
3367
|
+
onChange: $[1] || ($[1] = (z) => n("change", h.value))
|
|
3362
3368
|
}, null, 40, bo), [
|
|
3363
|
-
[tt,
|
|
3369
|
+
[tt, i.value]
|
|
3364
3370
|
]),
|
|
3365
|
-
c(
|
|
3366
|
-
e.label ? (v(),
|
|
3371
|
+
c(r) !== "solid" ? (v(), _("span", yo)) : D("", !0),
|
|
3372
|
+
e.label ? (v(), _("span", {
|
|
3367
3373
|
key: 1,
|
|
3368
3374
|
class: "sq-selection-label",
|
|
3369
3375
|
textContent: X(e.label)
|
|
3370
|
-
}, null, 8, xo)) :
|
|
3376
|
+
}, null, 8, xo)) : D("", !0)
|
|
3371
3377
|
], 2));
|
|
3372
3378
|
}
|
|
3373
3379
|
}), ko = { class: "sq-radio-group sq-selection-group" }, wo = "sq-radio-group", qo = /* @__PURE__ */ L({
|
|
@@ -3398,19 +3404,19 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3398
3404
|
})
|
|
3399
3405
|
), oe(
|
|
3400
3406
|
() => t.value,
|
|
3401
|
-
(
|
|
3402
|
-
|
|
3407
|
+
(r) => {
|
|
3408
|
+
r !== s.value && (s.value = r);
|
|
3403
3409
|
}
|
|
3404
3410
|
);
|
|
3405
|
-
function u(
|
|
3406
|
-
s.value =
|
|
3411
|
+
function u(r) {
|
|
3412
|
+
s.value = r, e("change", s.value), e("update:value", s.value);
|
|
3407
3413
|
}
|
|
3408
|
-
return (
|
|
3409
|
-
|
|
3410
|
-
(v(!0),
|
|
3414
|
+
return (r, a) => (v(), _("div", ko, [
|
|
3415
|
+
F(r.$slots, "default", {}, () => [
|
|
3416
|
+
(v(!0), _(te, null, de(t.items, (i, f) => (v(), C(c($o), {
|
|
3411
3417
|
key: f,
|
|
3412
|
-
label:
|
|
3413
|
-
value:
|
|
3418
|
+
label: i.toString(),
|
|
3419
|
+
value: i
|
|
3414
3420
|
}, null, 8, ["label", "value"]))), 128))
|
|
3415
3421
|
])
|
|
3416
3422
|
]));
|
|
@@ -3428,13 +3434,13 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3428
3434
|
},
|
|
3429
3435
|
emits: ["change", "update:value"],
|
|
3430
3436
|
setup(d, { emit: o }) {
|
|
3431
|
-
const { nextId: n } = Ee(), e = o, t = d, s = R(t.value), l = R(), u = R(),
|
|
3437
|
+
const { nextId: n } = Ee(), e = o, t = d, s = R(t.value), l = R(), u = R(), r = b(() => t.items.length && typeof t.items[0] == "string" ? t.items.map((p) => ({
|
|
3432
3438
|
text: p,
|
|
3433
3439
|
value: p
|
|
3434
3440
|
})) : t.items), a = b(() => {
|
|
3435
3441
|
const p = [];
|
|
3436
3442
|
return t.size !== "md" && p.push(`sq-segmented--${t.size}`), t.round && p.push("is-round"), p;
|
|
3437
|
-
}),
|
|
3443
|
+
}), i = b(() => {
|
|
3438
3444
|
const p = {};
|
|
3439
3445
|
return l.value && (p.width = `${l.value}px`), u.value && (p.left = `${u.value}px`), p;
|
|
3440
3446
|
}), f = b(() => t.name ?? `sq-segmented-${n()}`);
|
|
@@ -3457,7 +3463,7 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3457
3463
|
}
|
|
3458
3464
|
), ie(() => {
|
|
3459
3465
|
var p;
|
|
3460
|
-
s.value || (s.value = (p =
|
|
3466
|
+
s.value || (s.value = (p = r.value[0]) == null ? void 0 : p.value);
|
|
3461
3467
|
});
|
|
3462
3468
|
function g(p) {
|
|
3463
3469
|
s.value = p;
|
|
@@ -3465,17 +3471,17 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3465
3471
|
function h(p) {
|
|
3466
3472
|
u.value = p == null ? void 0 : p.offsetLeft, l.value = p == null ? void 0 : p.clientWidth;
|
|
3467
3473
|
}
|
|
3468
|
-
return (p,
|
|
3474
|
+
return (p, $) => (v(), _("div", {
|
|
3469
3475
|
class: V(["sq-segmented", a.value])
|
|
3470
3476
|
}, [
|
|
3471
|
-
|
|
3477
|
+
O("div", {
|
|
3472
3478
|
class: "sq-segmented-thumb",
|
|
3473
|
-
style: K(
|
|
3479
|
+
style: K(i.value)
|
|
3474
3480
|
}, null, 4),
|
|
3475
|
-
|
|
3476
|
-
(v(!0),
|
|
3477
|
-
key:
|
|
3478
|
-
}, { ref_for: !0 },
|
|
3481
|
+
F(p.$slots, "default", {}, () => [
|
|
3482
|
+
(v(!0), _(te, null, de(r.value, (z) => (v(), C(c(To), fe({
|
|
3483
|
+
key: z.value
|
|
3484
|
+
}, { ref_for: !0 }, z), null, 16))), 128))
|
|
3479
3485
|
])
|
|
3480
3486
|
], 2));
|
|
3481
3487
|
}
|
|
@@ -3490,11 +3496,11 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3490
3496
|
},
|
|
3491
3497
|
setup(d) {
|
|
3492
3498
|
const o = d, { segmentedDisabled: n, parentContext: e } = xs(o), t = R(), s = ue(null), l = b(() => {
|
|
3493
|
-
const
|
|
3494
|
-
return u.value &&
|
|
3495
|
-
}), u = b(() => c(e).active === o.value),
|
|
3496
|
-
oe(u, (
|
|
3497
|
-
if (
|
|
3499
|
+
const i = [], f = c(n);
|
|
3500
|
+
return u.value && i.push("is-active"), f && i.push("is-disabled"), i;
|
|
3501
|
+
}), u = b(() => c(e).active === o.value), r = b(() => c(e).size !== "sm" ? "md" : "sm");
|
|
3502
|
+
oe(u, (i) => {
|
|
3503
|
+
if (i) {
|
|
3498
3504
|
if (t.value = o.value ?? "on", !e) return;
|
|
3499
3505
|
e.value.updateThumb(s.value);
|
|
3500
3506
|
} else t.value = void 0;
|
|
@@ -3504,14 +3510,14 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3504
3510
|
function a() {
|
|
3505
3511
|
e && e.value.toggleItem(o.value);
|
|
3506
3512
|
}
|
|
3507
|
-
return (
|
|
3513
|
+
return (i, f) => {
|
|
3508
3514
|
var g;
|
|
3509
|
-
return v(),
|
|
3515
|
+
return v(), _("label", {
|
|
3510
3516
|
class: V(["sq-segmented-item", l.value]),
|
|
3511
3517
|
ref_key: "itemRef",
|
|
3512
3518
|
ref: s
|
|
3513
3519
|
}, [
|
|
3514
|
-
ae(
|
|
3520
|
+
ae(O("input", {
|
|
3515
3521
|
type: "radio",
|
|
3516
3522
|
name: (g = c(e)) == null ? void 0 : g.name,
|
|
3517
3523
|
value: o.value,
|
|
@@ -3521,10 +3527,10 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3521
3527
|
}, null, 40, Bo), [
|
|
3522
3528
|
[tt, t.value]
|
|
3523
3529
|
]),
|
|
3524
|
-
|
|
3525
|
-
T(c(ge), { size:
|
|
3526
|
-
default:
|
|
3527
|
-
o.icon ? (v(),
|
|
3530
|
+
F(i.$slots, "default", {}, () => [
|
|
3531
|
+
T(c(ge), { size: r.value }, {
|
|
3532
|
+
default: A(() => [
|
|
3533
|
+
o.icon ? (v(), C(ce(o.icon), { key: 0 })) : D("", !0),
|
|
3528
3534
|
Te(" " + X(o.text), 1)
|
|
3529
3535
|
]),
|
|
3530
3536
|
_: 1
|
|
@@ -3557,85 +3563,90 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3557
3563
|
}),
|
|
3558
3564
|
emits: /* @__PURE__ */ G(["focus", "blur", "select", "clear"], ["update:value"]),
|
|
3559
3565
|
setup(d, { emit: o }) {
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3566
|
+
let n = "";
|
|
3567
|
+
const e = o, t = d, s = R(!1), l = R(), u = R(""), r = ue(null), a = le(d, "value"), i = b(() => t.items.length && typeof t.items[0] == "string" ? t.items.map((B) => ({
|
|
3568
|
+
text: B,
|
|
3569
|
+
value: B
|
|
3570
|
+
})) : t.items);
|
|
3571
|
+
oe(a, (B) => {
|
|
3572
|
+
B || (u.value = "");
|
|
3573
|
+
const M = i.value.find((I) => I.value === B);
|
|
3574
|
+
u.value = (M == null ? void 0 : M.text) ?? "";
|
|
3568
3575
|
});
|
|
3569
|
-
function
|
|
3570
|
-
var
|
|
3571
|
-
if (!
|
|
3572
|
-
const
|
|
3573
|
-
|
|
3576
|
+
function f(B) {
|
|
3577
|
+
var I;
|
|
3578
|
+
if (!B || typeof l.value < "u") return;
|
|
3579
|
+
const M = (I = r.value) == null ? void 0 : I.$el;
|
|
3580
|
+
l.value = M.getBoundingClientRect().width;
|
|
3581
|
+
}
|
|
3582
|
+
function g(B) {
|
|
3583
|
+
a.value = B.value, u.value = B.text ?? "", e("select", B.value);
|
|
3574
3584
|
}
|
|
3575
|
-
function
|
|
3576
|
-
|
|
3585
|
+
function h(B) {
|
|
3586
|
+
s.value = !0, n = u.value, e("focus", B);
|
|
3577
3587
|
}
|
|
3578
|
-
function
|
|
3579
|
-
|
|
3588
|
+
function p(B) {
|
|
3589
|
+
s.value = !1, e("blur", B);
|
|
3580
3590
|
}
|
|
3581
|
-
function
|
|
3582
|
-
|
|
3591
|
+
function $() {
|
|
3592
|
+
a.value = "", e("clear");
|
|
3583
3593
|
}
|
|
3584
|
-
function
|
|
3585
|
-
|
|
3594
|
+
function z() {
|
|
3595
|
+
u.value = n;
|
|
3586
3596
|
}
|
|
3587
|
-
return (
|
|
3588
|
-
class: V(["sq-select", { "dropdown-opened":
|
|
3597
|
+
return (B, M) => (v(), C(c(mt), {
|
|
3598
|
+
class: V(["sq-select", { "dropdown-opened": s.value }]),
|
|
3589
3599
|
placement: "bottom-start",
|
|
3590
3600
|
trigger: "manual",
|
|
3591
3601
|
"popover-class": "sq-select-dropdown",
|
|
3592
|
-
disabled:
|
|
3602
|
+
disabled: t.disabled,
|
|
3593
3603
|
"hide-after": 100,
|
|
3594
|
-
"popover-style": { width: `${
|
|
3595
|
-
visible:
|
|
3596
|
-
"onUpdate:visible":
|
|
3597
|
-
onOpenChange:
|
|
3604
|
+
"popover-style": { width: `${l.value}px` },
|
|
3605
|
+
visible: s.value,
|
|
3606
|
+
"onUpdate:visible": M[2] || (M[2] = (I) => s.value = I),
|
|
3607
|
+
onOpenChange: f
|
|
3598
3608
|
}, {
|
|
3599
|
-
reference:
|
|
3600
|
-
T(c(
|
|
3601
|
-
value:
|
|
3602
|
-
"onUpdate:value":
|
|
3603
|
-
disabled:
|
|
3604
|
-
placeholder:
|
|
3605
|
-
"prefix-icon":
|
|
3609
|
+
reference: A(() => [
|
|
3610
|
+
T(c(We), {
|
|
3611
|
+
value: u.value,
|
|
3612
|
+
"onUpdate:value": M[0] || (M[0] = (I) => u.value = I),
|
|
3613
|
+
disabled: t.disabled,
|
|
3614
|
+
placeholder: t.placeholder,
|
|
3615
|
+
"prefix-icon": t.prefixIcon,
|
|
3606
3616
|
"suffix-icon": c(Ut),
|
|
3607
|
-
size:
|
|
3608
|
-
round:
|
|
3609
|
-
status:
|
|
3610
|
-
autofocus:
|
|
3611
|
-
clearable:
|
|
3612
|
-
name:
|
|
3613
|
-
form:
|
|
3617
|
+
size: t.size,
|
|
3618
|
+
round: t.round,
|
|
3619
|
+
status: t.status,
|
|
3620
|
+
autofocus: t.autofocus,
|
|
3621
|
+
clearable: t.clearable,
|
|
3622
|
+
name: t.name,
|
|
3623
|
+
form: t.form,
|
|
3614
3624
|
ref_key: "inputRef",
|
|
3615
|
-
ref:
|
|
3616
|
-
onFocus:
|
|
3617
|
-
onBlur:
|
|
3618
|
-
onClear:
|
|
3625
|
+
ref: r,
|
|
3626
|
+
onFocus: h,
|
|
3627
|
+
onBlur: p,
|
|
3628
|
+
onClear: $,
|
|
3629
|
+
onInput: z
|
|
3619
3630
|
}, null, 8, ["value", "disabled", "placeholder", "prefix-icon", "suffix-icon", "size", "round", "status", "autofocus", "clearable", "name", "form"])
|
|
3620
3631
|
]),
|
|
3621
|
-
default:
|
|
3622
|
-
|
|
3623
|
-
(v(!0),
|
|
3624
|
-
class: { "is-active":
|
|
3625
|
-
key:
|
|
3626
|
-
}, { ref_for: !0 },
|
|
3627
|
-
onClick: (
|
|
3632
|
+
default: A(() => [
|
|
3633
|
+
i.value.length ? (v(), _("menu", Lo, [
|
|
3634
|
+
(v(!0), _(te, null, de(i.value, (I) => (v(), _("li", fe({
|
|
3635
|
+
class: { "is-active": a.value === I.value },
|
|
3636
|
+
key: I.value
|
|
3637
|
+
}, { ref_for: !0 }, I, {
|
|
3638
|
+
onClick: (j) => g(I)
|
|
3628
3639
|
}), [
|
|
3629
|
-
|
|
3630
|
-
textContent: X(
|
|
3640
|
+
O("span", {
|
|
3641
|
+
textContent: X(I.text)
|
|
3631
3642
|
}, null, 8, Mo),
|
|
3632
|
-
|
|
3643
|
+
a.value === I.value ? (v(), C(c(at), { key: 0 })) : D("", !0)
|
|
3633
3644
|
], 16, Io))), 128))
|
|
3634
|
-
])) : (v(),
|
|
3645
|
+
])) : (v(), _("div", {
|
|
3635
3646
|
key: 0,
|
|
3636
3647
|
class: "sq-select-dropdown-empty",
|
|
3637
|
-
textContent: X(
|
|
3638
|
-
onMousedown:
|
|
3648
|
+
textContent: X(t.emptyText),
|
|
3649
|
+
onMousedown: M[1] || (M[1] = me(() => {
|
|
3639
3650
|
}, ["prevent", "stop"]))
|
|
3640
3651
|
}, null, 40, Ro))
|
|
3641
3652
|
]),
|
|
@@ -3659,29 +3670,29 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3659
3670
|
}),
|
|
3660
3671
|
emits: /* @__PURE__ */ G(["change", "click"], ["update:checked"]),
|
|
3661
3672
|
setup(d, { emit: o }) {
|
|
3662
|
-
const n = o, e = d, { switchSize: t, switchDisabled: s, id: l } = _s(e), u = le(d, "checked"),
|
|
3663
|
-
const a = [],
|
|
3664
|
-
return
|
|
3673
|
+
const n = o, e = d, { switchSize: t, switchDisabled: s, id: l } = _s(e), u = le(d, "checked"), r = b(() => {
|
|
3674
|
+
const a = [], i = c(t), f = c(s);
|
|
3675
|
+
return i !== "md" && a.push(`sq-switch--${i}`), u.value && a.push("is-checked"), (f || e.loading) && a.push("is-disabled"), e.variant && a.push(`is-${e.variant}`), a;
|
|
3665
3676
|
});
|
|
3666
|
-
return (a,
|
|
3667
|
-
class: V(["sq-switch",
|
|
3677
|
+
return (a, i) => (v(), _("label", {
|
|
3678
|
+
class: V(["sq-switch", r.value])
|
|
3668
3679
|
}, [
|
|
3669
|
-
ae(
|
|
3680
|
+
ae(O("input", {
|
|
3670
3681
|
type: "checkbox",
|
|
3671
|
-
"onUpdate:modelValue":
|
|
3682
|
+
"onUpdate:modelValue": i[0] || (i[0] = (f) => u.value = f),
|
|
3672
3683
|
id: c(l),
|
|
3673
3684
|
autofocus: e.autofocus,
|
|
3674
3685
|
name: e.name,
|
|
3675
3686
|
form: e.form,
|
|
3676
3687
|
disabled: c(s) || e.loading,
|
|
3677
|
-
onChange:
|
|
3678
|
-
onClick:
|
|
3688
|
+
onChange: i[1] || (i[1] = (f) => n("change", u.value, f)),
|
|
3689
|
+
onClick: i[2] || (i[2] = (f) => n("click", u.value, f))
|
|
3679
3690
|
}, null, 40, Do), [
|
|
3680
3691
|
[Qe, u.value]
|
|
3681
3692
|
]),
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
e.loading ? (v(),
|
|
3693
|
+
O("span", Oo, [
|
|
3694
|
+
O("span", Po, [
|
|
3695
|
+
e.loading ? (v(), C(c(Me), { key: 0 })) : D("", !0)
|
|
3685
3696
|
])
|
|
3686
3697
|
])
|
|
3687
3698
|
], 2));
|
|
@@ -3696,7 +3707,7 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3696
3707
|
render() {
|
|
3697
3708
|
return this.content;
|
|
3698
3709
|
}
|
|
3699
|
-
}), Ho = { class: "sq-table-wrap" },
|
|
3710
|
+
}), Ho = { class: "sq-table-wrap" }, jo = ["textContent"], Wo = ["textContent"], Xo = {
|
|
3700
3711
|
key: 0,
|
|
3701
3712
|
class: "sq-table-empty"
|
|
3702
3713
|
}, Yo = ["textContent"], Ko = "sq-table", Ba = /* @__PURE__ */ L({
|
|
@@ -3717,7 +3728,7 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3717
3728
|
return e.stripe && h.push("is-striped"), e.border && h.push("has-border"), h;
|
|
3718
3729
|
}), u = b(() => ({
|
|
3719
3730
|
gridTemplateColumns: e.cols.map((h) => h.width ? o(h.width) : "1fr").join(" ")
|
|
3720
|
-
})),
|
|
3731
|
+
})), r = b(() => ({
|
|
3721
3732
|
...u.value,
|
|
3722
3733
|
paddingInlineEnd: t.value ? "6px" : "0"
|
|
3723
3734
|
}));
|
|
@@ -3732,12 +3743,12 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3732
3743
|
return;
|
|
3733
3744
|
}
|
|
3734
3745
|
Le(() => {
|
|
3735
|
-
var
|
|
3736
|
-
const h = ((
|
|
3746
|
+
var $, z;
|
|
3747
|
+
const h = (($ = s.value) == null ? void 0 : $.clientHeight) ?? 0, p = ((z = s.value) == null ? void 0 : z.scrollHeight) ?? 0;
|
|
3737
3748
|
t.value = p > h;
|
|
3738
3749
|
});
|
|
3739
3750
|
}
|
|
3740
|
-
function
|
|
3751
|
+
function i(h, p) {
|
|
3741
3752
|
return e.rowKey && h.hasOwnProperty(e.rowKey) ? h[e.rowKey] : p;
|
|
3742
3753
|
}
|
|
3743
3754
|
function f(h) {
|
|
@@ -3755,54 +3766,54 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3755
3766
|
function g(h, p) {
|
|
3756
3767
|
return typeof p.formatter == "function" ? p.formatter(h, h[p.binding]) : typeof h[p.binding] > "u" ? "" : h[p.binding];
|
|
3757
3768
|
}
|
|
3758
|
-
return (h, p) => (v(),
|
|
3769
|
+
return (h, p) => (v(), _("div", {
|
|
3759
3770
|
class: V(["sq-table", l.value])
|
|
3760
3771
|
}, [
|
|
3761
|
-
|
|
3762
|
-
|
|
3772
|
+
O("div", Ho, [
|
|
3773
|
+
O("div", {
|
|
3763
3774
|
class: "sq-table-header",
|
|
3764
|
-
style: K(
|
|
3775
|
+
style: K(r.value)
|
|
3765
3776
|
}, [
|
|
3766
|
-
(v(!0),
|
|
3777
|
+
(v(!0), _(te, null, de(e.cols, ($) => (v(), _("div", {
|
|
3767
3778
|
class: "sq-table-cell",
|
|
3768
|
-
style: K({ "justify-content": f(
|
|
3769
|
-
key:
|
|
3779
|
+
style: K({ "justify-content": f($.align) }),
|
|
3780
|
+
key: $.binding
|
|
3770
3781
|
}, [
|
|
3771
|
-
|
|
3772
|
-
textContent: X(
|
|
3773
|
-
}, null, 8,
|
|
3782
|
+
O("span", {
|
|
3783
|
+
textContent: X($.title)
|
|
3784
|
+
}, null, 8, jo)
|
|
3774
3785
|
], 4))), 128))
|
|
3775
3786
|
], 4),
|
|
3776
|
-
ae(
|
|
3787
|
+
ae(O("div", {
|
|
3777
3788
|
class: "sq-table-body",
|
|
3778
3789
|
ref_key: "bodyRef",
|
|
3779
3790
|
ref: s
|
|
3780
3791
|
}, [
|
|
3781
|
-
(v(!0),
|
|
3792
|
+
(v(!0), _(te, null, de(e.data, ($, z) => (v(), _("div", {
|
|
3782
3793
|
class: "sq-table-row",
|
|
3783
3794
|
style: K(u.value),
|
|
3784
|
-
key:
|
|
3795
|
+
key: i($, z)
|
|
3785
3796
|
}, [
|
|
3786
|
-
(v(!0),
|
|
3787
|
-
class: V(["sq-table-cell",
|
|
3788
|
-
style: K({ "justify-content": f(
|
|
3789
|
-
key: `${
|
|
3797
|
+
(v(!0), _(te, null, de(e.cols, (B, M) => (v(), _("div", {
|
|
3798
|
+
class: V(["sq-table-cell", B.columnClass]),
|
|
3799
|
+
style: K({ "justify-content": f(B.align) }),
|
|
3800
|
+
key: `${B.binding}-${i($, M)}`
|
|
3790
3801
|
}, [
|
|
3791
|
-
typeof
|
|
3802
|
+
typeof B.cellRender == "function" ? (v(), C(c(Vo), {
|
|
3792
3803
|
key: 0,
|
|
3793
|
-
content:
|
|
3794
|
-
}, null, 8, ["content"])) : (v(),
|
|
3804
|
+
content: B.cellRender($, $[B.binding])
|
|
3805
|
+
}, null, 8, ["content"])) : (v(), _("span", {
|
|
3795
3806
|
key: 1,
|
|
3796
|
-
textContent: X(g(
|
|
3797
|
-
}, null, 8,
|
|
3807
|
+
textContent: X(g($, B))
|
|
3808
|
+
}, null, 8, Wo))
|
|
3798
3809
|
], 6))), 128))
|
|
3799
3810
|
], 4))), 128))
|
|
3800
3811
|
], 512), [
|
|
3801
3812
|
[ve, e.data.length]
|
|
3802
3813
|
]),
|
|
3803
|
-
e.data.length ?
|
|
3804
|
-
|
|
3805
|
-
|
|
3814
|
+
e.data.length ? D("", !0) : (v(), _("div", Xo, [
|
|
3815
|
+
F(h.$slots, "empty", {}, () => [
|
|
3816
|
+
O("span", {
|
|
3806
3817
|
textContent: X(e.emptyText)
|
|
3807
3818
|
}, null, 8, Yo)
|
|
3808
3819
|
])
|
|
@@ -3824,12 +3835,12 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3824
3835
|
const t = [];
|
|
3825
3836
|
return o.size !== "md" && t.push(`sq-tag--${o.size}`), o.variant && o.type && t.push(`is-${o.variant}`), o.type && t.push(`is-${o.type}`), o.round && t.push("is-round"), t;
|
|
3826
3837
|
}), e = b(() => o.size === "lg" ? "md" : "sm");
|
|
3827
|
-
return (t, s) => (v(),
|
|
3838
|
+
return (t, s) => (v(), C(c(ge), {
|
|
3828
3839
|
class: V(["sq-tag", n.value]),
|
|
3829
3840
|
size: e.value
|
|
3830
3841
|
}, {
|
|
3831
|
-
default:
|
|
3832
|
-
|
|
3842
|
+
default: A(() => [
|
|
3843
|
+
F(t.$slots, "default")
|
|
3833
3844
|
]),
|
|
3834
3845
|
_: 3
|
|
3835
3846
|
}, 8, ["class", "size"]));
|
|
@@ -3849,13 +3860,13 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3849
3860
|
const l = [];
|
|
3850
3861
|
return e.size !== "md" && l.push(`sq-tag--${e.size}`), e.type && l.push(`is-${e.type}`), e.round && l.push("is-round"), e.checked && l.push("is-checked"), l;
|
|
3851
3862
|
}), s = b(() => e.size === "lg" ? "md" : "sm");
|
|
3852
|
-
return (l, u) => (v(),
|
|
3863
|
+
return (l, u) => (v(), C(c(ge), {
|
|
3853
3864
|
class: V(["sq-check-tag", t.value]),
|
|
3854
3865
|
size: s.value,
|
|
3855
|
-
onClick: u[0] || (u[0] = (
|
|
3866
|
+
onClick: u[0] || (u[0] = (r) => n("change", !e.checked))
|
|
3856
3867
|
}, {
|
|
3857
|
-
default:
|
|
3858
|
-
|
|
3868
|
+
default: A(() => [
|
|
3869
|
+
F(l.$slots, "default")
|
|
3859
3870
|
]),
|
|
3860
3871
|
_: 3
|
|
3861
3872
|
}, 8, ["class", "size"]));
|
|
@@ -3874,11 +3885,11 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3874
3885
|
}), e = b(() => typeof o.ellipsis == "number" ? Number(Math.max(o.ellipsis, 1).toFixed(0)) : 1), t = b(
|
|
3875
3886
|
() => o.ellipsis ? `--row-num: ${e.value}` : ""
|
|
3876
3887
|
);
|
|
3877
|
-
return (s, l) => (v(),
|
|
3888
|
+
return (s, l) => (v(), _("span", {
|
|
3878
3889
|
class: V(["sq-text", n.value]),
|
|
3879
3890
|
style: K(t.value)
|
|
3880
3891
|
}, [
|
|
3881
|
-
|
|
3892
|
+
F(s.$slots, "default")
|
|
3882
3893
|
], 6));
|
|
3883
3894
|
}
|
|
3884
3895
|
}), Qo = "sq-timeline", Ra = /* @__PURE__ */ L({
|
|
@@ -3893,10 +3904,10 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3893
3904
|
const e = [`align-${o.align}`];
|
|
3894
3905
|
return o.variant && e.push(`is-${o.variant}`), e;
|
|
3895
3906
|
});
|
|
3896
|
-
return (e, t) => (v(),
|
|
3907
|
+
return (e, t) => (v(), _("div", {
|
|
3897
3908
|
class: V(["sq-timeline", n.value])
|
|
3898
3909
|
}, [
|
|
3899
|
-
|
|
3910
|
+
F(e.$slots, "default")
|
|
3900
3911
|
], 2));
|
|
3901
3912
|
}
|
|
3902
3913
|
}), ea = { class: "sq-timeline-dot" }, ta = { class: "sq-timeline-content" }, sa = ["textContent"], na = ["textContent"], oa = { class: "content-info" }, aa = "sq-timeline-item", La = /* @__PURE__ */ L({
|
|
@@ -3918,26 +3929,26 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3918
3929
|
const t = {};
|
|
3919
3930
|
return o.color && (t["--timeline-dot-color"] = o.color), t;
|
|
3920
3931
|
});
|
|
3921
|
-
return (t, s) => (v(),
|
|
3932
|
+
return (t, s) => (v(), _("div", {
|
|
3922
3933
|
class: V(["sq-timeline-item", n.value]),
|
|
3923
3934
|
style: K(e.value)
|
|
3924
3935
|
}, [
|
|
3925
|
-
|
|
3926
|
-
o.icon ? (v(),
|
|
3936
|
+
O("span", ea, [
|
|
3937
|
+
o.icon ? (v(), C(ce(o.icon), { key: 0 })) : D("", !0)
|
|
3927
3938
|
]),
|
|
3928
|
-
|
|
3929
|
-
o.title ? (v(),
|
|
3939
|
+
O("div", ta, [
|
|
3940
|
+
o.title ? (v(), _("h2", {
|
|
3930
3941
|
key: 0,
|
|
3931
3942
|
class: "content-title",
|
|
3932
3943
|
textContent: X(o.title)
|
|
3933
|
-
}, null, 8, sa)) :
|
|
3934
|
-
o.timestamp ? (v(),
|
|
3944
|
+
}, null, 8, sa)) : D("", !0),
|
|
3945
|
+
o.timestamp ? (v(), _("span", {
|
|
3935
3946
|
key: 1,
|
|
3936
3947
|
class: "content-time",
|
|
3937
3948
|
textContent: X(o.timestamp)
|
|
3938
|
-
}, null, 8, na)) :
|
|
3939
|
-
|
|
3940
|
-
|
|
3949
|
+
}, null, 8, na)) : D("", !0),
|
|
3950
|
+
O("div", oa, [
|
|
3951
|
+
F(t.$slots, "default")
|
|
3941
3952
|
])
|
|
3942
3953
|
])
|
|
3943
3954
|
], 6));
|
|
@@ -3959,7 +3970,7 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3959
3970
|
const e = ["sq-tooltip"], t = o.popoverClass;
|
|
3960
3971
|
return Array.isArray(t) ? e.push(...t) : typeof t == "string" && e.push(t), e;
|
|
3961
3972
|
});
|
|
3962
|
-
return (e, t) => (v(),
|
|
3973
|
+
return (e, t) => (v(), C(c(mt), {
|
|
3963
3974
|
placement: o.placement,
|
|
3964
3975
|
disabled: o.disabled,
|
|
3965
3976
|
"show-after": 300,
|
|
@@ -3969,11 +3980,11 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3969
3980
|
transition: o.transition,
|
|
3970
3981
|
shadow: o.shadow
|
|
3971
3982
|
}, {
|
|
3972
|
-
reference:
|
|
3973
|
-
|
|
3983
|
+
reference: A(() => [
|
|
3984
|
+
F(e.$slots, "default")
|
|
3974
3985
|
]),
|
|
3975
|
-
default:
|
|
3976
|
-
|
|
3986
|
+
default: A(() => [
|
|
3987
|
+
O("span", {
|
|
3977
3988
|
textContent: X(o.tip)
|
|
3978
3989
|
}, null, 8, la)
|
|
3979
3990
|
]),
|
|
@@ -3997,37 +4008,37 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
3997
4008
|
const e = n, t = d, s = ue(null);
|
|
3998
4009
|
function l() {
|
|
3999
4010
|
var g;
|
|
4000
|
-
|
|
4011
|
+
i(((g = s.value) == null ? void 0 : g.files) ?? void 0);
|
|
4001
4012
|
}
|
|
4002
4013
|
function u(g) {
|
|
4003
4014
|
var h;
|
|
4004
4015
|
g.target === s.value || t.disabled || (h = s.value) == null || h.click();
|
|
4005
4016
|
}
|
|
4006
|
-
function
|
|
4017
|
+
function r(g) {
|
|
4007
4018
|
t.allowDrop && g.preventDefault();
|
|
4008
4019
|
}
|
|
4009
4020
|
function a(g) {
|
|
4010
4021
|
var h;
|
|
4011
|
-
t.disabled || (t.allowDrop && g.preventDefault(),
|
|
4022
|
+
t.disabled || (t.allowDrop && g.preventDefault(), i(((h = g.dataTransfer) == null ? void 0 : h.files) ?? void 0));
|
|
4012
4023
|
}
|
|
4013
|
-
function
|
|
4014
|
-
const h = g ?? new FileList(), p = [],
|
|
4015
|
-
for (let
|
|
4016
|
-
const
|
|
4017
|
-
p.push(
|
|
4024
|
+
function i(g) {
|
|
4025
|
+
const h = g ?? new FileList(), p = [], $ = t.max ? Math.min(h.length, t.max) : h.length;
|
|
4026
|
+
for (let z = 0; z < $; z++) {
|
|
4027
|
+
const B = h[z];
|
|
4028
|
+
p.push(B);
|
|
4018
4029
|
}
|
|
4019
4030
|
e("change", p);
|
|
4020
4031
|
}
|
|
4021
4032
|
function f() {
|
|
4022
4033
|
s.value.value = "", s.value.files = null, e("change", []);
|
|
4023
4034
|
}
|
|
4024
|
-
return o({ clearFiles: f }), (g, h) => (v(),
|
|
4035
|
+
return o({ clearFiles: f }), (g, h) => (v(), _("div", {
|
|
4025
4036
|
class: "sq-upload",
|
|
4026
4037
|
onClick: u,
|
|
4027
|
-
onDragover:
|
|
4038
|
+
onDragover: r,
|
|
4028
4039
|
onDrop: a
|
|
4029
4040
|
}, [
|
|
4030
|
-
|
|
4041
|
+
O("input", {
|
|
4031
4042
|
type: "file",
|
|
4032
4043
|
ref_key: "inputRef",
|
|
4033
4044
|
ref: s,
|
|
@@ -4038,7 +4049,7 @@ const po = "sq-popover", mt = /* @__PURE__ */ L({
|
|
|
4038
4049
|
multiple: t.multiple,
|
|
4039
4050
|
onChange: l
|
|
4040
4051
|
}, null, 40, ra),
|
|
4041
|
-
|
|
4052
|
+
F(g.$slots, "default")
|
|
4042
4053
|
], 32));
|
|
4043
4054
|
}
|
|
4044
4055
|
});
|
|
@@ -4046,7 +4057,7 @@ export {
|
|
|
4046
4057
|
ct as ButtonGroupContextKeys,
|
|
4047
4058
|
ft as CheckboxGroupContextKeys,
|
|
4048
4059
|
Be as FormContextKeys,
|
|
4049
|
-
|
|
4060
|
+
je as FormItemIdKeys,
|
|
4050
4061
|
ht as RadioGroupContextKeys,
|
|
4051
4062
|
gt as SegmentedContextKeys,
|
|
4052
4063
|
ha as SqAlert,
|
|
@@ -4062,14 +4073,14 @@ export {
|
|
|
4062
4073
|
dt as SqCheckbox,
|
|
4063
4074
|
As as SqCheckboxGroup,
|
|
4064
4075
|
Ps as SqCode,
|
|
4065
|
-
|
|
4076
|
+
Ws as SqDialog,
|
|
4066
4077
|
we as SqDivider,
|
|
4067
4078
|
_a as SqEditor,
|
|
4068
4079
|
$a as SqForm,
|
|
4069
4080
|
qn as SqImage,
|
|
4070
4081
|
ka as SqImageCrop,
|
|
4071
4082
|
Bn as SqImageViewer,
|
|
4072
|
-
|
|
4083
|
+
We as SqInput,
|
|
4073
4084
|
wa as SqMenu,
|
|
4074
4085
|
qa as SqMessage,
|
|
4075
4086
|
Ca as SqMessageBox,
|