@squirrel-cloud/ui-vue 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +223 -221
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as R, computed as y, openBlock as m, createBlock as S, unref as i, normalizeClass as W, withCtx as N, resolveDynamicComponent as fe, createCommentVNode as P, createTextVNode as De, toDisplayString as Q, h as Pe, ref as T, watch as
|
|
1
|
+
import { defineComponent as R, computed as y, openBlock as m, createBlock as S, unref as i, normalizeClass as W, withCtx as N, resolveDynamicComponent as fe, createCommentVNode as P, createTextVNode as De, toDisplayString as Q, h as Pe, ref as T, watch as se, onMounted as oe, createElementBlock as k, normalizeStyle as G, onBeforeUnmount as ye, Transition as ke, withDirectives as ue, createElementVNode as E, renderSlot as F, vShow as he, useSlots as Oe, createVNode as z, inject as me, shallowRef as le, provide as Se, toRef as re, useModel as ie, vModelCheckbox as it, mergeModels as Z, toRaw as ze, Fragment as ae, renderList as pe, useAttrs as Ze, Teleport as ut, mergeProps as ve, withModifiers as be, nextTick as we, vModelDynamic as Tt, vModelText as zt, render as Ne, cloneVNode as Rt, Text as Lt, Comment as It, vModelRadio as ct } from "vue";
|
|
2
2
|
import { WarningFilled as dt, CloseFilled as ft, InfoFilled as nt, CheckFilled as pt, JumpTo as At, CaretUp as Et, Loading as Ue, Check as vt, Close as Ge, Bold as Mt, Italic as Pt, Underline as Dt, Strikethrough as Ot, Hide as mt, ListUl as Nt, ListOl as Ut, View as ht, ArrowLeft as gt, ArrowRight as bt, ZoomIn as Vt, ZoomOut as Ft, FlipHorizontal as Ht, FlipVertical as jt, Clockwise as Wt, Couterclockwise as Xt, FitSize as Yt, Fullscreen as Kt, Ellipsis as Zt, ArrowDown as Gt } from "@squirrel-cloud/icons-vue";
|
|
3
3
|
import { autoUpdate as Qt, computePosition as Jt, offset as en, flip as tn, shift as nn } from "@floating-ui/dom";
|
|
4
4
|
const Qe = {
|
|
@@ -180,7 +180,7 @@ function rn() {
|
|
|
180
180
|
const d = [], u = { children: [] };
|
|
181
181
|
let l = u;
|
|
182
182
|
return t.forEach((r) => {
|
|
183
|
-
var M, I, L, V, j, te, ne,
|
|
183
|
+
var M, I, L, V, j, te, ne, w, C, b, _, g;
|
|
184
184
|
const { type: p, children: h, content: v, attrs: f, tag: x, hidden: $, info: B } = r;
|
|
185
185
|
switch (p) {
|
|
186
186
|
case "heading_open":
|
|
@@ -261,7 +261,7 @@ function rn() {
|
|
|
261
261
|
break;
|
|
262
262
|
}
|
|
263
263
|
case "image": {
|
|
264
|
-
(
|
|
264
|
+
(w = l.children) == null || w.push({
|
|
265
265
|
tag: (a == null ? void 0 : a[x]) ?? x,
|
|
266
266
|
children: [],
|
|
267
267
|
attrs: f ? Object.fromEntries(f) : {}
|
|
@@ -404,16 +404,16 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
404
404
|
setup(c) {
|
|
405
405
|
const o = T(null), s = y(() => ({
|
|
406
406
|
hr: Re,
|
|
407
|
-
blur:
|
|
407
|
+
blur: wn,
|
|
408
408
|
img: Ye,
|
|
409
409
|
fence: Yn,
|
|
410
410
|
"input-checkbox": _t,
|
|
411
411
|
...c.customNodeMap
|
|
412
412
|
}));
|
|
413
|
-
|
|
413
|
+
se(
|
|
414
414
|
() => [c.md, c.text, c.customNodeMap, c.plugins],
|
|
415
415
|
e
|
|
416
|
-
),
|
|
416
|
+
), oe(e);
|
|
417
417
|
async function e() {
|
|
418
418
|
if (!c.md) {
|
|
419
419
|
o.value = Pe("article", { class: "sq-article" }, [
|
|
@@ -456,7 +456,7 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
456
456
|
"--avatar-bg-color": d()
|
|
457
457
|
};
|
|
458
458
|
}), t = y(() => o.alt.charAt(0).toUpperCase());
|
|
459
|
-
|
|
459
|
+
se(
|
|
460
460
|
() => o.src,
|
|
461
461
|
() => {
|
|
462
462
|
s.value = !0;
|
|
@@ -465,16 +465,16 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
465
465
|
function a() {
|
|
466
466
|
s.value = !1;
|
|
467
467
|
}
|
|
468
|
-
return (d, u) => (m(),
|
|
468
|
+
return (d, u) => (m(), k("div", {
|
|
469
469
|
class: W(["sq-avatar", e.value]),
|
|
470
470
|
style: G(n.value)
|
|
471
471
|
}, [
|
|
472
|
-
o.src && s.value ? (m(),
|
|
472
|
+
o.src && s.value ? (m(), k("img", {
|
|
473
473
|
key: 0,
|
|
474
474
|
src: o.src,
|
|
475
475
|
alt: o.alt,
|
|
476
476
|
onError: a
|
|
477
|
-
}, null, 40, mn)) : (m(),
|
|
477
|
+
}, null, 40, mn)) : (m(), k("span", {
|
|
478
478
|
key: 1,
|
|
479
479
|
textContent: Q(t.value)
|
|
480
480
|
}, null, 8, hn))
|
|
@@ -493,7 +493,7 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
493
493
|
},
|
|
494
494
|
setup(c) {
|
|
495
495
|
const { throttle: o } = un(), s = o(u), e = new ResizeObserver(l), n = c, t = T(100), a = T(0), d = y(() => a.value > n.visibilityHeight);
|
|
496
|
-
|
|
496
|
+
oe(() => {
|
|
497
497
|
var h;
|
|
498
498
|
l(), s(), window.addEventListener("scroll", s);
|
|
499
499
|
const p = document.querySelector(n.target) ?? document.body;
|
|
@@ -512,7 +512,7 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
512
512
|
function r() {
|
|
513
513
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
514
514
|
}
|
|
515
|
-
return (p, h) => (m(), S(
|
|
515
|
+
return (p, h) => (m(), S(ke, {
|
|
516
516
|
name: n.transition
|
|
517
517
|
}, {
|
|
518
518
|
default: N(() => {
|
|
@@ -523,7 +523,7 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
523
523
|
class: "sq-backtop-wrap",
|
|
524
524
|
onClick: r
|
|
525
525
|
}, [
|
|
526
|
-
n.progress ? (m(), S(i(
|
|
526
|
+
n.progress ? (m(), S(i(ko), {
|
|
527
527
|
key: 0,
|
|
528
528
|
variant: "circle",
|
|
529
529
|
label: !1,
|
|
@@ -562,9 +562,9 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
562
562
|
const d = [`is-${s.type}`];
|
|
563
563
|
return s.dot && d.push("is-dot"), d;
|
|
564
564
|
}), n = y(() => o.default ? "sup" : "div"), t = y(() => !s.dot && s.text || s.showZero ? !0 : s.count > 0), a = y(() => s.dot ? "" : s.text ? s.text : s.max && s.count > s.max ? `${s.max}+` : `${s.count}`);
|
|
565
|
-
return (d, u) => (m(), S(
|
|
565
|
+
return (d, u) => (m(), S(ke, { name: "sq-zoom" }, {
|
|
566
566
|
default: N(() => [
|
|
567
|
-
i(o).default || t.value ? (m(),
|
|
567
|
+
i(o).default || t.value ? (m(), k("span", {
|
|
568
568
|
key: 0,
|
|
569
569
|
class: W(["sq-badge", e.value]),
|
|
570
570
|
style: G({ "--badge-color": s.color })
|
|
@@ -572,11 +572,11 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
572
572
|
F(d.$slots, "default"),
|
|
573
573
|
(m(), S(fe(n.value), { class: "sq-badge-label" }, {
|
|
574
574
|
default: N(() => [
|
|
575
|
-
z(
|
|
575
|
+
z(ke, {
|
|
576
576
|
name: i(o).default ? "sq-zoom" : ""
|
|
577
577
|
}, {
|
|
578
578
|
default: N(() => [
|
|
579
|
-
t.value ? (m(),
|
|
579
|
+
t.value ? (m(), k("span", {
|
|
580
580
|
key: 0,
|
|
581
581
|
class: "sq-badge-label-inner",
|
|
582
582
|
textContent: Q(a.value)
|
|
@@ -592,7 +592,7 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
592
592
|
_: 3
|
|
593
593
|
}));
|
|
594
594
|
}
|
|
595
|
-
}), $n = "sq-blur",
|
|
595
|
+
}), $n = "sq-blur", wn = /* @__PURE__ */ R({
|
|
596
596
|
name: $n,
|
|
597
597
|
__name: "blur",
|
|
598
598
|
setup(c) {
|
|
@@ -604,7 +604,7 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
604
604
|
}));
|
|
605
605
|
}
|
|
606
606
|
});
|
|
607
|
-
function
|
|
607
|
+
function kn(c) {
|
|
608
608
|
const { getOption: o } = Le(), s = me(Ae, void 0), e = me(xt, void 0), n = y(
|
|
609
609
|
() => i(e) ? void 0 : c.text
|
|
610
610
|
), t = y(
|
|
@@ -878,11 +878,11 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
878
878
|
},
|
|
879
879
|
emits: ["click"],
|
|
880
880
|
setup(c, { emit: o }) {
|
|
881
|
-
const s = o, e = c, { btnTextType: n, btnSize: t, btnType: a, btnRound: d, btnDisabled: u } =
|
|
881
|
+
const s = o, e = c, { btnTextType: n, btnSize: t, btnType: a, btnRound: d, btnDisabled: u } = kn(e), l = y(() => {
|
|
882
882
|
const h = [], v = i(t), f = i(a), x = i(d), $ = i(n);
|
|
883
883
|
return v !== "md" && h.push(`sq-button--${v}`), f && h.push(`is-${f}`), x && h.push("is-round"), $ && h.push("is-text"), $ && e.bg && h.push("has-bg"), h;
|
|
884
884
|
}), r = y(() => e.loading ? Ue : e.icon), p = y(() => e.loading || i(u));
|
|
885
|
-
return (h, v) => (m(),
|
|
885
|
+
return (h, v) => (m(), k("button", {
|
|
886
886
|
class: W(["sq-button", l.value]),
|
|
887
887
|
disabled: p.value,
|
|
888
888
|
form: e.form,
|
|
@@ -900,7 +900,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
900
900
|
}, 8, ["size"])
|
|
901
901
|
], 10, Rn));
|
|
902
902
|
}
|
|
903
|
-
}), In = { class: "sq-button-group" }, An = "sq-button-group",
|
|
903
|
+
}), In = { class: "sq-button-group" }, An = "sq-button-group", wa = /* @__PURE__ */ R({
|
|
904
904
|
name: An,
|
|
905
905
|
__name: "button-group",
|
|
906
906
|
props: {
|
|
@@ -919,7 +919,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
919
919
|
round: re(o, "round"),
|
|
920
920
|
disabled: re(o, "disabled")
|
|
921
921
|
})
|
|
922
|
-
), (s, e) => (m(),
|
|
922
|
+
), (s, e) => (m(), k("div", In, [
|
|
923
923
|
F(s.$slots, "default")
|
|
924
924
|
]));
|
|
925
925
|
}
|
|
@@ -929,7 +929,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
929
929
|
}, Pn = ["textContent"], Dn = {
|
|
930
930
|
key: 1,
|
|
931
931
|
class: "sq-card-footer"
|
|
932
|
-
}, On = "sq-card",
|
|
932
|
+
}, On = "sq-card", ka = /* @__PURE__ */ R({
|
|
933
933
|
name: On,
|
|
934
934
|
__name: "card",
|
|
935
935
|
props: {
|
|
@@ -938,8 +938,8 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
938
938
|
},
|
|
939
939
|
setup(c) {
|
|
940
940
|
const o = Oe(), s = c;
|
|
941
|
-
return (e, n) => (m(),
|
|
942
|
-
s.title || i(o).title ? (m(),
|
|
941
|
+
return (e, n) => (m(), k("section", En, [
|
|
942
|
+
s.title || i(o).title ? (m(), k("div", Mn, [
|
|
943
943
|
E("h2", {
|
|
944
944
|
class: W({ "has-decorative": s.decorative }),
|
|
945
945
|
textContent: Q(s.title)
|
|
@@ -947,7 +947,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
947
947
|
F(e.$slots, "title")
|
|
948
948
|
])) : P("", !0),
|
|
949
949
|
F(e.$slots, "default"),
|
|
950
|
-
i(o).footer ? (m(),
|
|
950
|
+
i(o).footer ? (m(), k("div", Dn, [
|
|
951
951
|
F(e.$slots, "footer")
|
|
952
952
|
])) : P("", !0)
|
|
953
953
|
]));
|
|
@@ -982,16 +982,16 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
982
982
|
const v = [], f = i(n), x = i(t), $ = i(u);
|
|
983
983
|
return f !== "md" && v.push(`sq-selection--${f}`), h.value && v.push("is-checked"), x && v.push("is-disabled"), $ && v.push(`is-${$}`), v;
|
|
984
984
|
}), h = y(() => l ? i(l).list.includes(e.value) : r.value);
|
|
985
|
-
return
|
|
985
|
+
return se(h, (v) => {
|
|
986
986
|
if (r.value !== v) {
|
|
987
987
|
r.value = v;
|
|
988
988
|
return;
|
|
989
989
|
}
|
|
990
|
-
}),
|
|
990
|
+
}), se(r, (v) => {
|
|
991
991
|
h.value !== v && l && l.value.toggleItem(e.value);
|
|
992
|
-
}),
|
|
992
|
+
}), oe(() => {
|
|
993
993
|
r.value = h.value;
|
|
994
|
-
}), (v, f) => (m(),
|
|
994
|
+
}), (v, f) => (m(), k("label", {
|
|
995
995
|
class: W(["sq-selection sq-checkbox", p.value])
|
|
996
996
|
}, [
|
|
997
997
|
ue(E("input", {
|
|
@@ -1006,7 +1006,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1006
1006
|
}, null, 40, Nn), [
|
|
1007
1007
|
[it, r.value]
|
|
1008
1008
|
]),
|
|
1009
|
-
i(u) !== "solid" ? (m(),
|
|
1009
|
+
i(u) !== "solid" ? (m(), k("span", {
|
|
1010
1010
|
key: 0,
|
|
1011
1011
|
class: W(["sq-checkbox-box", { "is-indeterminate": e.indeterminate && !h.value }])
|
|
1012
1012
|
}, [
|
|
@@ -1015,7 +1015,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1015
1015
|
class: "sq-checkbox-inner"
|
|
1016
1016
|
})) : P("", !0)
|
|
1017
1017
|
], 2)) : P("", !0),
|
|
1018
|
-
e.label ? (m(),
|
|
1018
|
+
e.label ? (m(), k("span", {
|
|
1019
1019
|
key: 1,
|
|
1020
1020
|
class: "sq-selection-label",
|
|
1021
1021
|
textContent: Q(e.label)
|
|
@@ -1054,7 +1054,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1054
1054
|
list: a,
|
|
1055
1055
|
toggleItem: l
|
|
1056
1056
|
})
|
|
1057
|
-
),
|
|
1057
|
+
), se(
|
|
1058
1058
|
() => t.value,
|
|
1059
1059
|
(r) => {
|
|
1060
1060
|
const p = r || [], h = [.../* @__PURE__ */ new Set([...p, a.value])];
|
|
@@ -1064,9 +1064,9 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1064
1064
|
function l(r) {
|
|
1065
1065
|
a.value.includes(r) ? a.value = a.value.filter((p) => p !== r) : a.value.push(r), n("change", ze(a.value)), n("update:value", ze(a.value));
|
|
1066
1066
|
}
|
|
1067
|
-
return (r, p) => (m(),
|
|
1067
|
+
return (r, p) => (m(), k("div", Fn, [
|
|
1068
1068
|
F(r.$slots, "default", {}, () => [
|
|
1069
|
-
(m(!0),
|
|
1069
|
+
(m(!0), k(ae, null, pe(u.value, (h, v) => (m(), S(i(_t), {
|
|
1070
1070
|
key: v,
|
|
1071
1071
|
disabled: h.disabled === !0,
|
|
1072
1072
|
label: i(e)(h),
|
|
@@ -1088,19 +1088,19 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1088
1088
|
theme: e.theme,
|
|
1089
1089
|
lang: e.lang
|
|
1090
1090
|
}) : `<pre>${e.code}</pre>`);
|
|
1091
|
-
return
|
|
1091
|
+
return oe(async () => {
|
|
1092
1092
|
if (n.value = await o(), !n.value) {
|
|
1093
1093
|
console.warn("[squirrel-cloud/ui-vue] SqCode 组件代码高亮依赖 shiki");
|
|
1094
1094
|
return;
|
|
1095
1095
|
}
|
|
1096
1096
|
}), ye(() => {
|
|
1097
1097
|
s();
|
|
1098
|
-
}), (a, d) => (m(),
|
|
1098
|
+
}), (a, d) => (m(), k("div", {
|
|
1099
1099
|
class: "sq-code",
|
|
1100
1100
|
innerHTML: t.value
|
|
1101
1101
|
}, null, 8, Wn));
|
|
1102
1102
|
}
|
|
1103
|
-
}), Kn = "sq-mask",
|
|
1103
|
+
}), Kn = "sq-mask", wt = /* @__PURE__ */ R({
|
|
1104
1104
|
name: Kn,
|
|
1105
1105
|
inheritAttrs: !1,
|
|
1106
1106
|
__name: "mask",
|
|
@@ -1117,7 +1117,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1117
1117
|
const { nextZIndex: s } = Je(), e = Ze();
|
|
1118
1118
|
let n;
|
|
1119
1119
|
const t = o, a = c, d = T(0), u = T(!1), l = ie(c, "visible");
|
|
1120
|
-
u.value = l.value,
|
|
1120
|
+
u.value = l.value, se(l, (v) => {
|
|
1121
1121
|
const f = document.scrollingElement;
|
|
1122
1122
|
v ? (n = f.style.overflow, f.style.overflow = "hidden", d.value = s(), u.value = !0, document.addEventListener("keydown", r)) : (f.style.overflow = n, document.removeEventListener("keydown", r));
|
|
1123
1123
|
}), ye(() => {
|
|
@@ -1141,7 +1141,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1141
1141
|
}) : v && (l.value = !1);
|
|
1142
1142
|
}
|
|
1143
1143
|
return (v, f) => (m(), S(ut, { to: "body" }, [
|
|
1144
|
-
z(
|
|
1144
|
+
z(ke, {
|
|
1145
1145
|
name: "sq-fade",
|
|
1146
1146
|
onBeforeEnter: f[0] || (f[0] = (x) => t("open")),
|
|
1147
1147
|
onAfterEnter: f[1] || (f[1] = (x) => t("opened")),
|
|
@@ -1149,7 +1149,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1149
1149
|
onAfterLeave: f[3] || (f[3] = (x) => t("closed"))
|
|
1150
1150
|
}, {
|
|
1151
1151
|
default: N(() => [
|
|
1152
|
-
u.value ? ue((m(),
|
|
1152
|
+
u.value ? ue((m(), k("div", ve({
|
|
1153
1153
|
key: 0,
|
|
1154
1154
|
class: "sq-mask",
|
|
1155
1155
|
style: { zIndex: d.value }
|
|
@@ -1224,7 +1224,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1224
1224
|
async function B() {
|
|
1225
1225
|
d.value = !0, await x(t.onOk) && (u.value = !1);
|
|
1226
1226
|
}
|
|
1227
|
-
return (M, I) => (m(), S(i(
|
|
1227
|
+
return (M, I) => (m(), S(i(wt), {
|
|
1228
1228
|
visible: u.value,
|
|
1229
1229
|
"onUpdate:visible": I[0] || (I[0] = (L) => u.value = L),
|
|
1230
1230
|
"mask-closeable": t.maskCloseable,
|
|
@@ -1240,7 +1240,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1240
1240
|
class: W(["sq-dialog", [r.value, i(e).class]]),
|
|
1241
1241
|
style: G(i(e).style)
|
|
1242
1242
|
}, [
|
|
1243
|
-
l.value ? (m(),
|
|
1243
|
+
l.value ? (m(), k("div", Zn, [
|
|
1244
1244
|
p.value ? (m(), S(fe(p.value), {
|
|
1245
1245
|
key: 0,
|
|
1246
1246
|
class: "sq-dialog-header-icon"
|
|
@@ -1259,7 +1259,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1259
1259
|
E("div", Qn, [
|
|
1260
1260
|
F(M.$slots, "default")
|
|
1261
1261
|
]),
|
|
1262
|
-
t.footer ? (m(),
|
|
1262
|
+
t.footer ? (m(), k("div", Jn, [
|
|
1263
1263
|
F(M.$slots, "footer", {}, () => [
|
|
1264
1264
|
z(i(ee), ve(v.value, { onClick: $ }), {
|
|
1265
1265
|
default: N(() => [
|
|
@@ -1295,7 +1295,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1295
1295
|
const n = [`sq-divider--${s.direction}`];
|
|
1296
1296
|
return ["none", "solid", "dotted", "dashed"].includes(s.variant) && n.push("is-thin"), o.default && s.direction !== "vertical" && n.push(`text-${s.orientation}`), n;
|
|
1297
1297
|
});
|
|
1298
|
-
return (n, t) => (m(),
|
|
1298
|
+
return (n, t) => (m(), k("div", {
|
|
1299
1299
|
class: W(["sq-divider", e.value]),
|
|
1300
1300
|
style: G({ "--divider-line-type": s.variant })
|
|
1301
1301
|
}, [
|
|
@@ -1672,13 +1672,13 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1672
1672
|
), M = y(
|
|
1673
1673
|
() => typeof e.beforePreview == "function" ? e.beforePreview(f.value) : f.value
|
|
1674
1674
|
);
|
|
1675
|
-
|
|
1675
|
+
oe(() => {
|
|
1676
1676
|
document.addEventListener("selectionchange", V), document.addEventListener("click", j);
|
|
1677
1677
|
}), ye(() => {
|
|
1678
1678
|
document.removeEventListener("selectionchange", V), document.removeEventListener("click", j);
|
|
1679
1679
|
});
|
|
1680
1680
|
function I(_) {
|
|
1681
|
-
_ === "edit" &&
|
|
1681
|
+
_ === "edit" && we(() => {
|
|
1682
1682
|
var g;
|
|
1683
1683
|
(g = r.value) == null || g.focus();
|
|
1684
1684
|
});
|
|
@@ -1705,7 +1705,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1705
1705
|
return;
|
|
1706
1706
|
}
|
|
1707
1707
|
if (_.key === "Enter") {
|
|
1708
|
-
if (
|
|
1708
|
+
if (w(g)) {
|
|
1709
1709
|
_.preventDefault();
|
|
1710
1710
|
const A = g.substring(0, g.indexOf("- "));
|
|
1711
1711
|
if (q !== "- ") {
|
|
@@ -1760,7 +1760,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1760
1760
|
l.value.startOfRow = l.value.start - q, l.value.endOfRow = l.value.startOfRow + d.value.length, t.value = f.value.split(`
|
|
1761
1761
|
`);
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function w(_) {
|
|
1764
1764
|
return _.replace(" ", "").startsWith("- ");
|
|
1765
1765
|
}
|
|
1766
1766
|
function C(_) {
|
|
@@ -1768,19 +1768,19 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1768
1768
|
}
|
|
1769
1769
|
function b(_, g = 0, q = 0) {
|
|
1770
1770
|
a.value || (t.value = [..._], f.value = t.value.join(`
|
|
1771
|
-
`), l.value.start += g, l.value.end += q, l.value.startOfRow += g, l.value.endOfRow += q, s == null || s.focus(), a.value = !0,
|
|
1771
|
+
`), l.value.start += g, l.value.end += q, l.value.startOfRow += g, l.value.endOfRow += q, s == null || s.focus(), a.value = !0, we(() => {
|
|
1772
1772
|
s == null || s.setSelectionRange(l.value.start, l.value.end), setTimeout(() => {
|
|
1773
1773
|
a.value = !1;
|
|
1774
1774
|
}, 100);
|
|
1775
1775
|
}));
|
|
1776
1776
|
}
|
|
1777
|
-
return (_, g) => (m(),
|
|
1777
|
+
return (_, g) => (m(), k("div", {
|
|
1778
1778
|
class: W(["sq-editor", x.value]),
|
|
1779
1779
|
onClick: g[2] || (g[2] = be(() => {
|
|
1780
1780
|
}, ["stop"]))
|
|
1781
1781
|
}, [
|
|
1782
1782
|
ue(E("div", gs, [
|
|
1783
|
-
e.md ? (m(),
|
|
1783
|
+
e.md ? (m(), k(ae, { key: 0 }, [
|
|
1784
1784
|
E("div", bs, [
|
|
1785
1785
|
z(os, {
|
|
1786
1786
|
ref_key: "boldRef",
|
|
@@ -1886,8 +1886,8 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1886
1886
|
])
|
|
1887
1887
|
], 2));
|
|
1888
1888
|
}
|
|
1889
|
-
}), _s = ["textContent", "for"], $s = { class: "sq-form-item-content" },
|
|
1890
|
-
name:
|
|
1889
|
+
}), _s = ["textContent", "for"], $s = { class: "sq-form-item-content" }, ws = ["textContent"], ks = "sq-form-item", qs = /* @__PURE__ */ R({
|
|
1890
|
+
name: ks,
|
|
1891
1891
|
__name: "form-item",
|
|
1892
1892
|
props: {
|
|
1893
1893
|
label: {},
|
|
@@ -1904,22 +1904,22 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1904
1904
|
const u = [];
|
|
1905
1905
|
return s.isRequired && u.push("is-required"), u;
|
|
1906
1906
|
}), a = y(() => ["input", "switch", "select"].includes(s.type));
|
|
1907
|
-
|
|
1907
|
+
se(
|
|
1908
1908
|
() => s.errorMsg,
|
|
1909
1909
|
(u) => {
|
|
1910
1910
|
u && (n.value = u);
|
|
1911
1911
|
}
|
|
1912
|
-
),
|
|
1912
|
+
), oe(() => {
|
|
1913
1913
|
a.value && (e.value = `sq-form-item-${o()}`);
|
|
1914
1914
|
});
|
|
1915
1915
|
function d() {
|
|
1916
1916
|
n.value = "";
|
|
1917
1917
|
}
|
|
1918
|
-
return (u, l) => (m(),
|
|
1918
|
+
return (u, l) => (m(), k("div", {
|
|
1919
1919
|
class: "sq-form-item",
|
|
1920
1920
|
style: G({ "--form-label-width": s.labelWidth })
|
|
1921
1921
|
}, [
|
|
1922
|
-
s.label || s.showLabel ? (m(),
|
|
1922
|
+
s.label || s.showLabel ? (m(), k("label", {
|
|
1923
1923
|
key: 0,
|
|
1924
1924
|
class: W(["sq-form-item-label", t.value]),
|
|
1925
1925
|
textContent: Q(s.label),
|
|
@@ -1927,7 +1927,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1927
1927
|
}, null, 10, _s)) : P("", !0),
|
|
1928
1928
|
E("div", $s, [
|
|
1929
1929
|
F(u.$slots, "default"),
|
|
1930
|
-
z(
|
|
1930
|
+
z(ke, {
|
|
1931
1931
|
appear: "",
|
|
1932
1932
|
name: "sq-zoom-top",
|
|
1933
1933
|
onAfterLeave: d
|
|
@@ -1936,7 +1936,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1936
1936
|
ue(E("span", {
|
|
1937
1937
|
class: "sq-form-item-check",
|
|
1938
1938
|
textContent: Q(n.value)
|
|
1939
|
-
}, null, 8,
|
|
1939
|
+
}, null, 8, ws), [
|
|
1940
1940
|
[he, s.errorMsg]
|
|
1941
1941
|
])
|
|
1942
1942
|
]),
|
|
@@ -1977,75 +1977,75 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1977
1977
|
})
|
|
1978
1978
|
);
|
|
1979
1979
|
const a = T({}), d = T([]), u = T({}), l = y(() => {
|
|
1980
|
-
const
|
|
1981
|
-
return t.size !== "md" &&
|
|
1980
|
+
const w = [`is-${t.layout}`];
|
|
1981
|
+
return t.size !== "md" && w.push(`sq-form--${t.size}`), t.requiredMark !== "hidden" && w.push(`required-${t.requiredMark}`), w;
|
|
1982
1982
|
}), r = y(() => ({
|
|
1983
1983
|
"--form-label-width": t.labelWidth
|
|
1984
1984
|
})), p = y(() => {
|
|
1985
|
-
const
|
|
1986
|
-
return
|
|
1985
|
+
const w = t.step;
|
|
1986
|
+
return w === void 0 ? t.items : t.items.filter((C) => C.step === void 0 ? C : Array.isArray(C.step) ? C.step.includes(w) : C.step === w);
|
|
1987
1987
|
});
|
|
1988
|
-
|
|
1988
|
+
oe(() => {
|
|
1989
1989
|
e = structuredClone(ze(t.formData));
|
|
1990
1990
|
});
|
|
1991
|
-
function h(
|
|
1991
|
+
function h(w) {
|
|
1992
1992
|
var C;
|
|
1993
|
-
return (C =
|
|
1993
|
+
return (C = w.rule) == null ? void 0 : C.required;
|
|
1994
1994
|
}
|
|
1995
|
-
function v(
|
|
1996
|
-
if (u.value[
|
|
1997
|
-
if (d.value.includes(
|
|
1998
|
-
if (a.value[
|
|
1995
|
+
function v(w) {
|
|
1996
|
+
if (u.value[w]) return Ue;
|
|
1997
|
+
if (d.value.includes(w)) return pt;
|
|
1998
|
+
if (a.value[w])
|
|
1999
1999
|
return t.invalidStatus === "error" ? ft : dt;
|
|
2000
2000
|
}
|
|
2001
|
-
async function f(
|
|
2001
|
+
async function f(w, C, b, _ = !0) {
|
|
2002
2002
|
if (!b) return;
|
|
2003
2003
|
const g = b.trigger ?? "change", q = Array.isArray(g) ? "array" : "string";
|
|
2004
2004
|
if (C) {
|
|
2005
2005
|
if (q === "array" && !g.includes(C)) return;
|
|
2006
2006
|
if (q === "string" && g !== C) return;
|
|
2007
2007
|
}
|
|
2008
|
-
d.value = d.value.filter((A) => A !==
|
|
2009
|
-
const O = t.formData[
|
|
2008
|
+
d.value = d.value.filter((A) => A !== w), j(w), u.value[w] = new AbortController(), await we();
|
|
2009
|
+
const O = t.formData[w];
|
|
2010
2010
|
let H = !1;
|
|
2011
2011
|
const X = b.validateType ?? "string";
|
|
2012
|
-
return b.validateFunc ? H = await $(
|
|
2012
|
+
return b.validateFunc ? H = await $(w, O, b, C) : X === "string" ? H = B(w, O, b) : X === "boolean" ? H = M(w, O, b) : X === "list" && (H = I(w, O, b)), _ && n("validate", w, H, ze(d.value)), u.value[w].signal.aborted || j(w), H;
|
|
2013
2013
|
}
|
|
2014
|
-
function x(
|
|
2015
|
-
if (a.value[
|
|
2014
|
+
function x(w) {
|
|
2015
|
+
if (a.value[w]) return t.invalidStatus;
|
|
2016
2016
|
}
|
|
2017
|
-
async function $(
|
|
2018
|
-
const g = u.value[
|
|
2017
|
+
async function $(w, C, b, _) {
|
|
2018
|
+
const g = u.value[w].signal, q = await b.validateFunc(C, g, _);
|
|
2019
2019
|
if (q === void 0) {
|
|
2020
|
-
d.value = d.value.filter((O) => O !==
|
|
2020
|
+
d.value = d.value.filter((O) => O !== w), delete a.value[w];
|
|
2021
2021
|
return;
|
|
2022
2022
|
}
|
|
2023
|
-
return q === !0 ? V(
|
|
2023
|
+
return q === !0 ? V(w) : q === !1 ? L(w, "字段验证失败") : q ? L(w, q) : V(w), q === !0 || typeof q == "string" && !q;
|
|
2024
2024
|
}
|
|
2025
|
-
function B(
|
|
2026
|
-
return b.required && !C ? (L(
|
|
2025
|
+
function B(w, C, b) {
|
|
2026
|
+
return b.required && !C ? (L(w, b.requiredText ?? "字段必填"), !1) : b.pattern && C && !b.pattern.test(C) ? (L(w, b.patternText ?? "字段验证失败"), !1) : (V(w), !0);
|
|
2027
2027
|
}
|
|
2028
|
-
function M(
|
|
2029
|
-
return b.required && C === void 0 ? (L(
|
|
2028
|
+
function M(w, C, b) {
|
|
2029
|
+
return b.required && C === void 0 ? (L(w, b.requiredText ?? "字段必填"), !1) : (V(w), !0);
|
|
2030
2030
|
}
|
|
2031
|
-
function I(
|
|
2032
|
-
return b.required && (!C || !C.length) ? (L(
|
|
2031
|
+
function I(w, C, b) {
|
|
2032
|
+
return b.required && (!C || !C.length) ? (L(w, b.requiredText ?? "字段必填"), !1) : b.pattern && C && C.map((q) => q.toString()).map((q) => b.pattern.test(q)).includes(!1) ? (L(w, b.patternText ?? "字段验证失败"), !1) : (V(w), !0);
|
|
2033
2033
|
}
|
|
2034
|
-
function L(
|
|
2035
|
-
d.value = d.value.filter((b) => b !==
|
|
2034
|
+
function L(w, C) {
|
|
2035
|
+
d.value = d.value.filter((b) => b !== w), a.value[w] = C;
|
|
2036
2036
|
}
|
|
2037
|
-
function V(
|
|
2038
|
-
d.value.push(
|
|
2037
|
+
function V(w) {
|
|
2038
|
+
d.value.push(w), delete a.value[w];
|
|
2039
2039
|
}
|
|
2040
|
-
function j(
|
|
2040
|
+
function j(w) {
|
|
2041
2041
|
var C;
|
|
2042
|
-
(C = u.value[
|
|
2042
|
+
(C = u.value[w]) == null || C.abort(), delete u.value[w];
|
|
2043
2043
|
}
|
|
2044
2044
|
function te() {
|
|
2045
2045
|
n("update:formData", structuredClone(e)), a.value = {}, d.value = [], n("validate", "SQFORM", !1, ze(d.value));
|
|
2046
2046
|
}
|
|
2047
|
-
function ne(
|
|
2048
|
-
const b = (
|
|
2047
|
+
function ne(w = !0) {
|
|
2048
|
+
const b = (w ? t.items : p.value).filter(
|
|
2049
2049
|
(_) => _.type !== "custom" && _.rule && !d.value.includes(_.binding)
|
|
2050
2050
|
).map((_) => {
|
|
2051
2051
|
const g = _;
|
|
@@ -2053,13 +2053,13 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2053
2053
|
});
|
|
2054
2054
|
return Promise.all(b).then((_) => (n("validate", "SQFORM", !_.includes(!1), ze(d.value)), _));
|
|
2055
2055
|
}
|
|
2056
|
-
return o({ resetFields: te, validate: ne }), (
|
|
2056
|
+
return o({ resetFields: te, validate: ne }), (w, C) => (m(), k("form", {
|
|
2057
2057
|
class: W(["sq-form", l.value]),
|
|
2058
2058
|
style: G(r.value),
|
|
2059
2059
|
onSubmit: C[0] || (C[0] = be(() => {
|
|
2060
2060
|
}, ["prevent"]))
|
|
2061
2061
|
}, [
|
|
2062
|
-
(m(!0),
|
|
2062
|
+
(m(!0), k(ae, null, pe(p.value, (b, _) => (m(), S(qs, {
|
|
2063
2063
|
class: W(b.itemClass),
|
|
2064
2064
|
type: b.type,
|
|
2065
2065
|
key: _,
|
|
@@ -2115,7 +2115,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2115
2115
|
value: t.formData[b.binding],
|
|
2116
2116
|
"onUpdate:value": (g) => t.formData[b.binding] = g,
|
|
2117
2117
|
onChange: (g) => f(b.binding, "change", b.rule)
|
|
2118
|
-
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : F(
|
|
2118
|
+
}), null, 16, ["name", "value", "onUpdate:value", "onChange"])) : F(w.$slots, b.slot, { key: 5 })
|
|
2119
2119
|
]),
|
|
2120
2120
|
_: 2
|
|
2121
2121
|
}, 1032, ["class", "type", "label-width", "label", "show-label", "is-required", "error-msg"]))), 128))
|
|
@@ -2150,12 +2150,12 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2150
2150
|
height: p.value ? void 0 : "var(--image-placeholder-height)",
|
|
2151
2151
|
aspectRatio: p.value ? void 0 : n.aspectRatio
|
|
2152
2152
|
}));
|
|
2153
|
-
|
|
2153
|
+
se(
|
|
2154
2154
|
() => n.src,
|
|
2155
2155
|
() => {
|
|
2156
2156
|
d.value = !1, t.value = !1, a.value = n.src;
|
|
2157
2157
|
}
|
|
2158
|
-
),
|
|
2158
|
+
), oe(() => {
|
|
2159
2159
|
s.observe(r.value);
|
|
2160
2160
|
}), ye(() => {
|
|
2161
2161
|
s.disconnect();
|
|
@@ -2176,20 +2176,20 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2176
2176
|
function $() {
|
|
2177
2177
|
l.value = !0;
|
|
2178
2178
|
}
|
|
2179
|
-
return (B, M) => (m(),
|
|
2179
|
+
return (B, M) => (m(), k("div", {
|
|
2180
2180
|
class: "sq-image",
|
|
2181
2181
|
style: G(h.value),
|
|
2182
2182
|
ref_key: "imgRef",
|
|
2183
2183
|
ref: r
|
|
2184
2184
|
}, [
|
|
2185
|
-
z(
|
|
2185
|
+
z(ke, { name: "sq-fade" }, {
|
|
2186
2186
|
default: N(() => [
|
|
2187
|
-
t.value ? P("", !0) : (m(),
|
|
2187
|
+
t.value ? P("", !0) : (m(), k("div", Ss))
|
|
2188
2188
|
]),
|
|
2189
2189
|
_: 1
|
|
2190
2190
|
}),
|
|
2191
|
-
!d.value && u.value ? (m(),
|
|
2192
|
-
(m(!0),
|
|
2191
|
+
!d.value && u.value ? (m(), k("picture", Bs, [
|
|
2192
|
+
(m(!0), k(ae, null, pe(n.source, (I, L) => (m(), k("source", {
|
|
2193
2193
|
key: L,
|
|
2194
2194
|
srcset: I.src,
|
|
2195
2195
|
media: I.media,
|
|
@@ -2204,14 +2204,14 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2204
2204
|
onError: f
|
|
2205
2205
|
}, null, 44, zs)
|
|
2206
2206
|
])) : P("", !0),
|
|
2207
|
-
!d.value && u.value && n.preview ? (m(),
|
|
2207
|
+
!d.value && u.value && n.preview ? (m(), k("div", {
|
|
2208
2208
|
key: 1,
|
|
2209
2209
|
class: "sq-image-control",
|
|
2210
2210
|
onClick: $
|
|
2211
2211
|
}, [
|
|
2212
2212
|
z(i(ht))
|
|
2213
2213
|
])) : P("", !0),
|
|
2214
|
-
d.value ? (m(),
|
|
2214
|
+
d.value ? (m(), k("div", Rs, [
|
|
2215
2215
|
F(B.$slots, "error", {}, () => [
|
|
2216
2216
|
M[1] || (M[1] = E("span", null, "图片加载失败", -1))
|
|
2217
2217
|
])
|
|
@@ -2271,7 +2271,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2271
2271
|
transition: V.value ? void 0 : "none"
|
|
2272
2272
|
};
|
|
2273
2273
|
});
|
|
2274
|
-
function
|
|
2274
|
+
function w() {
|
|
2275
2275
|
V.value = !0;
|
|
2276
2276
|
}
|
|
2277
2277
|
function C(Y) {
|
|
@@ -2323,7 +2323,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2323
2323
|
}
|
|
2324
2324
|
V.value = !1;
|
|
2325
2325
|
const _e = e.value, [Ee, Ce] = v(U, J);
|
|
2326
|
-
e.value = Y,
|
|
2326
|
+
e.value = Y, we(() => {
|
|
2327
2327
|
const [je, We] = r(Ee, Ce, U, J, _e);
|
|
2328
2328
|
n.value.x += je * 2, n.value.y += We * 2, V.value = !0;
|
|
2329
2329
|
});
|
|
@@ -2346,7 +2346,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2346
2346
|
function He() {
|
|
2347
2347
|
j.value = !1;
|
|
2348
2348
|
}
|
|
2349
|
-
return (Y, U) => (m(), S(i(
|
|
2349
|
+
return (Y, U) => (m(), S(i(wt), {
|
|
2350
2350
|
class: "sq-image-viewer-mask",
|
|
2351
2351
|
visible: j.value,
|
|
2352
2352
|
"onUpdate:visible": U[10] || (U[10] = (J) => j.value = J),
|
|
@@ -2356,7 +2356,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2356
2356
|
onPointermove: b,
|
|
2357
2357
|
onPointerup: i(d),
|
|
2358
2358
|
onTouchmovePassive: _,
|
|
2359
|
-
onTouchend: U[11] || (U[11] = () => i(l)(
|
|
2359
|
+
onTouchend: U[11] || (U[11] = () => i(l)(w)),
|
|
2360
2360
|
onClosed: q
|
|
2361
2361
|
}, {
|
|
2362
2362
|
default: N(() => [
|
|
@@ -2382,7 +2382,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2382
2382
|
icon: i(Ge),
|
|
2383
2383
|
onClick: be(He, ["stop"])
|
|
2384
2384
|
}, null, 8, ["icon"]),
|
|
2385
|
-
$.srcList.length > 1 ? (m(),
|
|
2385
|
+
$.srcList.length > 1 ? (m(), k(ae, { key: 0 }, [
|
|
2386
2386
|
z(i(ee), {
|
|
2387
2387
|
class: "sq-image-viewer-prev",
|
|
2388
2388
|
round: "",
|
|
@@ -2398,7 +2398,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2398
2398
|
onClick: U[4] || (U[4] = (J) => O(1))
|
|
2399
2399
|
}, null, 8, ["icon", "disabled"])
|
|
2400
2400
|
], 64)) : P("", !0),
|
|
2401
|
-
$.toolbar ? (m(),
|
|
2401
|
+
$.toolbar ? (m(), k("div", {
|
|
2402
2402
|
key: 1,
|
|
2403
2403
|
class: "sq-image-viewer-toolbar",
|
|
2404
2404
|
onClick: U[9] || (U[9] = be(() => {
|
|
@@ -2548,12 +2548,12 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2548
2548
|
marginInlineStart: `${t.value.x}px`,
|
|
2549
2549
|
marginBlockStart: `${t.value.y}px`
|
|
2550
2550
|
}));
|
|
2551
|
-
|
|
2551
|
+
se(
|
|
2552
2552
|
() => $.aspectRatio,
|
|
2553
2553
|
() => {
|
|
2554
|
-
|
|
2554
|
+
we(I);
|
|
2555
2555
|
}
|
|
2556
|
-
),
|
|
2556
|
+
), oe(() => {
|
|
2557
2557
|
document.addEventListener("pointermove", V), document.addEventListener("pointerup", u);
|
|
2558
2558
|
}), ye(() => {
|
|
2559
2559
|
document.removeEventListener("pointermove", V), document.removeEventListener("pointerup", u);
|
|
@@ -2583,28 +2583,28 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2583
2583
|
let X = n.value * H;
|
|
2584
2584
|
X = Math.min($.maxScale, X), X = Math.max(x, X);
|
|
2585
2585
|
const A = (g.clientX + q.clientX) / 2, D = (g.clientY + q.clientY) / 2;
|
|
2586
|
-
|
|
2586
|
+
w(A, D, X), e.value = O;
|
|
2587
2587
|
}
|
|
2588
2588
|
}
|
|
2589
2589
|
function te(_, g) {
|
|
2590
2590
|
if (n.value >= $.maxScale) return;
|
|
2591
2591
|
const q = Math.min($.maxScale, n.value * (1 + 0.1));
|
|
2592
|
-
|
|
2592
|
+
w(_, g, q);
|
|
2593
2593
|
}
|
|
2594
2594
|
function ne(_, g) {
|
|
2595
2595
|
if (n.value <= x) return;
|
|
2596
2596
|
const q = Math.max(x, n.value / (1 + 0.1));
|
|
2597
|
-
|
|
2597
|
+
w(_, g, q);
|
|
2598
2598
|
}
|
|
2599
|
-
function
|
|
2599
|
+
function w(_, g, q) {
|
|
2600
2600
|
const O = n.value, [H, X] = f(_, g);
|
|
2601
|
-
n.value = q,
|
|
2601
|
+
n.value = q, we(() => {
|
|
2602
2602
|
const [A, D] = p(H, X, _, g, O);
|
|
2603
2603
|
t.value.x += A * 2, t.value.y += D * 2, C();
|
|
2604
2604
|
});
|
|
2605
2605
|
}
|
|
2606
2606
|
function C() {
|
|
2607
|
-
|
|
2607
|
+
we(() => {
|
|
2608
2608
|
const _ = a.value.getBoundingClientRect(), g = B.value.getBoundingClientRect(), q = _.left >= g.left, O = _.right <= g.right;
|
|
2609
2609
|
q ? t.value.x -= (_.left - g.left) * 2 : O && (t.value.x += (g.right - _.right) * 2);
|
|
2610
2610
|
const H = _.top >= g.top, X = _.bottom <= g.bottom;
|
|
@@ -2632,7 +2632,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2632
2632
|
K = void 0, D = void 0;
|
|
2633
2633
|
});
|
|
2634
2634
|
}
|
|
2635
|
-
return o({ cropImageAsync: b }), (_, g) => (m(),
|
|
2635
|
+
return o({ cropImageAsync: b }), (_, g) => (m(), k("div", {
|
|
2636
2636
|
class: "sq-image-crop",
|
|
2637
2637
|
style: G({ "--image-crop-ratio": $.aspectRatio }),
|
|
2638
2638
|
onWheel: be(L, ["prevent", "stop"]),
|
|
@@ -2649,7 +2649,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2649
2649
|
ref_key: "cropperRef",
|
|
2650
2650
|
ref: B
|
|
2651
2651
|
}, null, 4),
|
|
2652
|
-
$.src ? (m(),
|
|
2652
|
+
$.src ? (m(), k("img", {
|
|
2653
2653
|
key: 0,
|
|
2654
2654
|
ref_key: "imgRef",
|
|
2655
2655
|
ref: a,
|
|
@@ -2700,7 +2700,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2700
2700
|
() => t.type === "password" && i(I)
|
|
2701
2701
|
), V = y(() => t.clearable && i(I)), j = y(() => t.loading ? Ue : t.suffixIcon), te = y(
|
|
2702
2702
|
() => i(L) || i(V) || i(j) || e.suffix
|
|
2703
|
-
), ne = y(() => t.loading || i(u)),
|
|
2703
|
+
), ne = y(() => t.loading || i(u)), w = y(() => {
|
|
2704
2704
|
if (t.type === "textarea")
|
|
2705
2705
|
return i(ne) || i(l) ? "none" : t.resize;
|
|
2706
2706
|
});
|
|
@@ -2730,17 +2730,17 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2730
2730
|
var A;
|
|
2731
2731
|
h.value = !1, (A = f.value) == null || A.blur();
|
|
2732
2732
|
}
|
|
2733
|
-
return o({ focus: H, blur: X }), (A, D) => (m(),
|
|
2733
|
+
return o({ focus: H, blur: X }), (A, D) => (m(), k("div", {
|
|
2734
2734
|
class: W(["sq-input", x.value]),
|
|
2735
2735
|
onClick: g,
|
|
2736
2736
|
onPointerdown: _
|
|
2737
2737
|
}, [
|
|
2738
|
-
M.value ? (m(),
|
|
2738
|
+
M.value ? (m(), k("span", Ds, [
|
|
2739
2739
|
F(A.$slots, "prefix", {}, () => [
|
|
2740
2740
|
(m(), S(fe(t.prefixIcon)))
|
|
2741
2741
|
])
|
|
2742
2742
|
])) : P("", !0),
|
|
2743
|
-
t.type !== "textarea" ? ue((m(),
|
|
2743
|
+
t.type !== "textarea" ? ue((m(), k("input", {
|
|
2744
2744
|
key: 1,
|
|
2745
2745
|
class: "sq-input-inner",
|
|
2746
2746
|
"onUpdate:modelValue": D[0] || (D[0] = (K) => p.value = K),
|
|
@@ -2764,10 +2764,10 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2764
2764
|
onChange: D[2] || (D[2] = (K) => n("change", K))
|
|
2765
2765
|
}, null, 40, Os)), [
|
|
2766
2766
|
[Tt, p.value]
|
|
2767
|
-
]) : ue((m(),
|
|
2767
|
+
]) : ue((m(), k("textarea", {
|
|
2768
2768
|
key: 2,
|
|
2769
2769
|
class: "sq-input-inner",
|
|
2770
|
-
style: G({ resize:
|
|
2770
|
+
style: G({ resize: w.value }),
|
|
2771
2771
|
"onUpdate:modelValue": D[3] || (D[3] = (K) => p.value = K),
|
|
2772
2772
|
id: i(r),
|
|
2773
2773
|
disabled: ne.value,
|
|
@@ -2825,7 +2825,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2825
2825
|
emits: /* @__PURE__ */ Z(["click", "change"], ["update:active"]),
|
|
2826
2826
|
setup(c, { emit: o }) {
|
|
2827
2827
|
const { getText: s } = Ie(), e = o, n = c, t = T(!1), a = le(null), d = ie(c, "active"), u = y(() => [`sq-menu--${n.direction}`]);
|
|
2828
|
-
|
|
2828
|
+
oe(async () => {
|
|
2829
2829
|
try {
|
|
2830
2830
|
const { RouterLink: p } = await import("vue-router");
|
|
2831
2831
|
a.value = p, t.value = !0;
|
|
@@ -2839,10 +2839,10 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2839
2839
|
function r(p, h) {
|
|
2840
2840
|
e("click", p.value, h), !(p.disabled || p.value === d.value) && (e("change", p.value), d.value = p.value);
|
|
2841
2841
|
}
|
|
2842
|
-
return (p, h) => (m(),
|
|
2842
|
+
return (p, h) => (m(), k("menu", {
|
|
2843
2843
|
class: W(["sq-menu", u.value])
|
|
2844
2844
|
}, [
|
|
2845
|
-
n.router && t.value ? (m(!0),
|
|
2845
|
+
n.router && t.value ? (m(!0), k(ae, { key: 0 }, pe(n.items, (v) => (m(), S(fe(a.value), {
|
|
2846
2846
|
custom: "",
|
|
2847
2847
|
to: { name: v.value },
|
|
2848
2848
|
key: v.value
|
|
@@ -2869,7 +2869,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2869
2869
|
], 10, Fs)
|
|
2870
2870
|
]),
|
|
2871
2871
|
_: 2
|
|
2872
|
-
}, 1032, ["to"]))), 128)) : (m(!0),
|
|
2872
|
+
}, 1032, ["to"]))), 128)) : (m(!0), k(ae, { key: 1 }, pe(n.items, (v) => (m(), k("li", {
|
|
2873
2873
|
class: W(["sq-menu-item", {
|
|
2874
2874
|
"is-active": d.value === v.value,
|
|
2875
2875
|
"is-disabled": v.disabled
|
|
@@ -2908,13 +2908,13 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2908
2908
|
},
|
|
2909
2909
|
setup(c, { expose: o }) {
|
|
2910
2910
|
const s = c, e = T(!0), n = y(() => s.type ? Qe[s.type] : void 0);
|
|
2911
|
-
|
|
2911
|
+
oe(() => {
|
|
2912
2912
|
setTimeout(t, s.closeAfter);
|
|
2913
2913
|
});
|
|
2914
2914
|
function t() {
|
|
2915
2915
|
e.value = !1;
|
|
2916
2916
|
}
|
|
2917
|
-
return o({ close: t }), (a, d) => (m(), S(
|
|
2917
|
+
return o({ close: t }), (a, d) => (m(), S(ke, {
|
|
2918
2918
|
appear: "",
|
|
2919
2919
|
name: "sq-zoom-top",
|
|
2920
2920
|
onBeforeLeave: s.onClose,
|
|
@@ -3012,7 +3012,7 @@ const Ta = Ke, no = ["textContent"], so = "sq-message-box", oo = /* @__PURE__ */
|
|
|
3012
3012
|
},
|
|
3013
3013
|
setup(c, { expose: o }) {
|
|
3014
3014
|
const s = c, e = T(!1);
|
|
3015
|
-
|
|
3015
|
+
oe(() => {
|
|
3016
3016
|
e.value = !0;
|
|
3017
3017
|
});
|
|
3018
3018
|
function n() {
|
|
@@ -3121,8 +3121,8 @@ const Ta = Ke, no = ["textContent"], so = "sq-message-box", oo = /* @__PURE__ */
|
|
|
3121
3121
|
const o = c, s = ie(c, "current"), e = (n) => {
|
|
3122
3122
|
s.value = n;
|
|
3123
3123
|
};
|
|
3124
|
-
return (n, t) => (m(),
|
|
3125
|
-
(m(!0),
|
|
3124
|
+
return (n, t) => (m(), k("div", co, [
|
|
3125
|
+
(m(!0), k(ae, null, pe(o.list, (a) => (m(), k(ae, { key: a }, [
|
|
3126
3126
|
a ? (m(), S(i(ee), {
|
|
3127
3127
|
key: 0,
|
|
3128
3128
|
type: s.value === a ? "primary" : void 0,
|
|
@@ -3204,8 +3204,8 @@ const Ta = Ke, no = ["textContent"], so = "sq-message-box", oo = /* @__PURE__ */
|
|
|
3204
3204
|
}
|
|
3205
3205
|
return u;
|
|
3206
3206
|
});
|
|
3207
|
-
return (d, u) => (m(),
|
|
3208
|
-
(m(!0),
|
|
3207
|
+
return (d, u) => (m(), k("div", ho, [
|
|
3208
|
+
(m(!0), k(ae, null, pe(a.value, (l, r) => (m(), S(fe(l), {
|
|
3209
3209
|
key: r,
|
|
3210
3210
|
size: o.size,
|
|
3211
3211
|
disabled: o.disabled,
|
|
@@ -3227,12 +3227,12 @@ const Ta = Ke, no = ["textContent"], so = "sq-message-box", oo = /* @__PURE__ */
|
|
|
3227
3227
|
var t;
|
|
3228
3228
|
const e = (t = o.default) == null ? void 0 : t.call(o, s);
|
|
3229
3229
|
if (!e) return null;
|
|
3230
|
-
const n =
|
|
3230
|
+
const n = kt(e);
|
|
3231
3231
|
return n ? Rt(n, s) : null;
|
|
3232
3232
|
};
|
|
3233
3233
|
}
|
|
3234
3234
|
});
|
|
3235
|
-
function
|
|
3235
|
+
function kt(c) {
|
|
3236
3236
|
if (!c) return null;
|
|
3237
3237
|
for (const o of c) {
|
|
3238
3238
|
if (o !== null && typeof o == "object")
|
|
@@ -3243,7 +3243,7 @@ function wt(c) {
|
|
|
3243
3243
|
case "svg":
|
|
3244
3244
|
return rt(o);
|
|
3245
3245
|
case ae:
|
|
3246
|
-
return
|
|
3246
|
+
return kt(o.children);
|
|
3247
3247
|
default:
|
|
3248
3248
|
return o;
|
|
3249
3249
|
}
|
|
@@ -3280,23 +3280,23 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3280
3280
|
const C = [];
|
|
3281
3281
|
return p.shadow && C.push("has-shadow"), [C];
|
|
3282
3282
|
});
|
|
3283
|
-
|
|
3283
|
+
se(h, (C) => {
|
|
3284
3284
|
if (C === l) return;
|
|
3285
|
-
l = C,
|
|
3285
|
+
l = C, w();
|
|
3286
3286
|
const b = C ? p.showAfter : p.hideAfter;
|
|
3287
3287
|
d = setTimeout(() => {
|
|
3288
3288
|
x.value = C;
|
|
3289
3289
|
}, b);
|
|
3290
|
-
}),
|
|
3290
|
+
}), se(x, (C) => {
|
|
3291
3291
|
C ? (v.value = e(), ne(), u = Qt(
|
|
3292
3292
|
$.value.$el,
|
|
3293
3293
|
B.value,
|
|
3294
3294
|
ne
|
|
3295
3295
|
)) : u == null || u(), r("openChange", C);
|
|
3296
|
-
}),
|
|
3296
|
+
}), oe(() => {
|
|
3297
3297
|
ne();
|
|
3298
3298
|
}), ye(() => {
|
|
3299
|
-
|
|
3299
|
+
w(), document.removeEventListener("click", te);
|
|
3300
3300
|
});
|
|
3301
3301
|
function I() {
|
|
3302
3302
|
p.trigger !== "hover" || p.disabled || j(!1);
|
|
@@ -3330,10 +3330,10 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3330
3330
|
top: `${q}px`
|
|
3331
3331
|
};
|
|
3332
3332
|
}
|
|
3333
|
-
function
|
|
3333
|
+
function w() {
|
|
3334
3334
|
d && (clearTimeout(d), d = void 0);
|
|
3335
3335
|
}
|
|
3336
|
-
return (C, b) => (m(),
|
|
3336
|
+
return (C, b) => (m(), k(ae, null, [
|
|
3337
3337
|
z(i(yo), {
|
|
3338
3338
|
class: W(["sq-popover-trigger", i(n).class]),
|
|
3339
3339
|
style: G(i(n).style),
|
|
@@ -3352,7 +3352,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3352
3352
|
to: "body",
|
|
3353
3353
|
disabled: !p.teleported
|
|
3354
3354
|
}, [
|
|
3355
|
-
z(
|
|
3355
|
+
z(ke, {
|
|
3356
3356
|
name: p.transition
|
|
3357
3357
|
}, {
|
|
3358
3358
|
default: N(() => [
|
|
@@ -3377,8 +3377,8 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3377
3377
|
}), _o = {
|
|
3378
3378
|
key: 0,
|
|
3379
3379
|
class: "sq-progress-label"
|
|
3380
|
-
}, $o = ["textContent"],
|
|
3381
|
-
name:
|
|
3380
|
+
}, $o = ["textContent"], wo = "sq-progress", ko = /* @__PURE__ */ R({
|
|
3381
|
+
name: wo,
|
|
3382
3382
|
__name: "progress",
|
|
3383
3383
|
props: {
|
|
3384
3384
|
value: {},
|
|
@@ -3411,7 +3411,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3411
3411
|
}
|
|
3412
3412
|
return r;
|
|
3413
3413
|
});
|
|
3414
|
-
|
|
3414
|
+
oe(() => {
|
|
3415
3415
|
o.observe(n.value);
|
|
3416
3416
|
}), ye(() => {
|
|
3417
3417
|
o.disconnect();
|
|
@@ -3419,13 +3419,13 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3419
3419
|
function l() {
|
|
3420
3420
|
e.value = n.value.getBoundingClientRect().width;
|
|
3421
3421
|
}
|
|
3422
|
-
return (r, p) => (m(),
|
|
3422
|
+
return (r, p) => (m(), k("div", {
|
|
3423
3423
|
class: W(["sq-progress", t.value]),
|
|
3424
3424
|
ref_key: "progressRef",
|
|
3425
3425
|
ref: n,
|
|
3426
3426
|
style: G(u.value)
|
|
3427
3427
|
}, [
|
|
3428
|
-
s.variant === "circle" ? (m(),
|
|
3428
|
+
s.variant === "circle" ? (m(), k(ae, { key: 0 }, [
|
|
3429
3429
|
p[0] || (p[0] = E("svg", {
|
|
3430
3430
|
viewBox: "0 0 100 100",
|
|
3431
3431
|
version: "1.1",
|
|
@@ -3442,7 +3442,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3442
3442
|
cy: "50"
|
|
3443
3443
|
})
|
|
3444
3444
|
], -1)),
|
|
3445
|
-
s.label ? (m(),
|
|
3445
|
+
s.label ? (m(), k("div", _o, [
|
|
3446
3446
|
F(r.$slots, "default", { percentage: a.value }, () => [
|
|
3447
3447
|
E("span", {
|
|
3448
3448
|
textContent: Q(d.value)
|
|
@@ -3484,18 +3484,18 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3484
3484
|
const f = [], x = i(n), $ = i(t), B = i(u);
|
|
3485
3485
|
return x !== "md" && f.push(`sq-selection--${x}`), v.value && f.push("is-checked"), $ && f.push("is-disabled"), B && f.push(`is-${B}`), f;
|
|
3486
3486
|
}), v = y(() => l ? i(l).checked === e.value : p.value);
|
|
3487
|
-
return
|
|
3487
|
+
return se(r, (f) => {
|
|
3488
3488
|
p.value = f === e.value;
|
|
3489
|
-
}),
|
|
3489
|
+
}), se(v, (f) => {
|
|
3490
3490
|
if (f ? r.value = e.value ?? "on" : r.value = void 0, p.value !== f) {
|
|
3491
3491
|
p.value = f;
|
|
3492
3492
|
return;
|
|
3493
3493
|
}
|
|
3494
|
-
}),
|
|
3494
|
+
}), se(p, (f) => {
|
|
3495
3495
|
v.value !== f && l && l.value.toggleItem(e.value);
|
|
3496
|
-
}),
|
|
3496
|
+
}), oe(() => {
|
|
3497
3497
|
p.value = v.value, r.value = p.value ? e.value ?? "on" : void 0;
|
|
3498
|
-
}), (f, x) => (m(),
|
|
3498
|
+
}), (f, x) => (m(), k("label", {
|
|
3499
3499
|
class: W(["sq-selection sq-radio", h.value])
|
|
3500
3500
|
}, [
|
|
3501
3501
|
ue(E("input", {
|
|
@@ -3510,8 +3510,8 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3510
3510
|
}, null, 40, qo), [
|
|
3511
3511
|
[ct, r.value]
|
|
3512
3512
|
]),
|
|
3513
|
-
i(u) !== "solid" ? (m(),
|
|
3514
|
-
e.label ? (m(),
|
|
3513
|
+
i(u) !== "solid" ? (m(), k("span", Co)) : P("", !0),
|
|
3514
|
+
e.label ? (m(), k("span", {
|
|
3515
3515
|
key: 1,
|
|
3516
3516
|
class: "sq-selection-label",
|
|
3517
3517
|
textContent: Q(e.label)
|
|
@@ -3550,7 +3550,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3550
3550
|
checked: a,
|
|
3551
3551
|
toggleItem: l
|
|
3552
3552
|
})
|
|
3553
|
-
),
|
|
3553
|
+
), se(
|
|
3554
3554
|
() => t.value,
|
|
3555
3555
|
(r) => {
|
|
3556
3556
|
r !== a.value && (a.value = r);
|
|
@@ -3559,9 +3559,9 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3559
3559
|
function l(r) {
|
|
3560
3560
|
a.value = r, n("change", a.value), n("update:value", a.value);
|
|
3561
3561
|
}
|
|
3562
|
-
return (r, p) => (m(),
|
|
3562
|
+
return (r, p) => (m(), k("div", zo, [
|
|
3563
3563
|
F(r.$slots, "default", {}, () => [
|
|
3564
|
-
(m(!0),
|
|
3564
|
+
(m(!0), k(ae, null, pe(u.value, (h, v) => (m(), S(i(To), {
|
|
3565
3565
|
key: v,
|
|
3566
3566
|
disabled: h.disabled === !0,
|
|
3567
3567
|
label: i(e)(h),
|
|
@@ -3605,7 +3605,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3605
3605
|
toggleItem: h,
|
|
3606
3606
|
updateThumb: v
|
|
3607
3607
|
})
|
|
3608
|
-
),
|
|
3608
|
+
), oe(() => {
|
|
3609
3609
|
var f;
|
|
3610
3610
|
d.value || (d.value = (f = u.value[0]) == null ? void 0 : f.value);
|
|
3611
3611
|
});
|
|
@@ -3615,7 +3615,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3615
3615
|
function v(f) {
|
|
3616
3616
|
a.value = f == null ? void 0 : f.offsetLeft, t.value = f == null ? void 0 : f.clientWidth;
|
|
3617
3617
|
}
|
|
3618
|
-
return (f, x) => (m(),
|
|
3618
|
+
return (f, x) => (m(), k("div", {
|
|
3619
3619
|
class: W(["sq-segmented", l.value])
|
|
3620
3620
|
}, [
|
|
3621
3621
|
E("div", {
|
|
@@ -3623,7 +3623,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3623
3623
|
style: G(r.value)
|
|
3624
3624
|
}, null, 4),
|
|
3625
3625
|
F(f.$slots, "default", {}, () => [
|
|
3626
|
-
(m(!0),
|
|
3626
|
+
(m(!0), k(ae, null, pe(u.value, ($) => (m(), S(i(Po), ve({
|
|
3627
3627
|
key: $.value
|
|
3628
3628
|
}, { ref_for: !0 }, $), null, 16))), 128))
|
|
3629
3629
|
])
|
|
@@ -3643,12 +3643,12 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3643
3643
|
const p = [], h = i(s);
|
|
3644
3644
|
return u.value && p.push("is-active"), h && p.push("is-disabled"), p;
|
|
3645
3645
|
}), u = y(() => i(e).active === o.value), l = y(() => i(e).size !== "sm" ? "md" : "sm");
|
|
3646
|
-
|
|
3646
|
+
se(u, (p) => {
|
|
3647
3647
|
if (p) {
|
|
3648
3648
|
if (t.value = o.value ?? "on", !e) return;
|
|
3649
3649
|
e.value.updateThumb(a.value);
|
|
3650
3650
|
} else t.value = void 0;
|
|
3651
|
-
}),
|
|
3651
|
+
}), oe(() => {
|
|
3652
3652
|
t.value = u.value ? o.value ?? "on" : void 0, !(!u.value || !e) && e.value.updateThumb(a.value);
|
|
3653
3653
|
});
|
|
3654
3654
|
function r() {
|
|
@@ -3656,7 +3656,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3656
3656
|
}
|
|
3657
3657
|
return (p, h) => {
|
|
3658
3658
|
var v;
|
|
3659
|
-
return m(),
|
|
3659
|
+
return m(), k("label", {
|
|
3660
3660
|
class: W(["sq-segmented-item", d.value]),
|
|
3661
3661
|
ref_key: "itemRef",
|
|
3662
3662
|
ref: a
|
|
@@ -3700,7 +3700,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3700
3700
|
function a(d) {
|
|
3701
3701
|
!o || d.disabled || t.value || o.value.toggleItem(s.value);
|
|
3702
3702
|
}
|
|
3703
|
-
return (d, u) => (m(),
|
|
3703
|
+
return (d, u) => (m(), k("li", {
|
|
3704
3704
|
class: W(n.value),
|
|
3705
3705
|
onClick: u[0] || (u[0] = (l) => a(s))
|
|
3706
3706
|
}, [
|
|
@@ -3744,9 +3744,9 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3744
3744
|
active: r,
|
|
3745
3745
|
toggleItem: v
|
|
3746
3746
|
})
|
|
3747
|
-
),
|
|
3747
|
+
), se(a, () => {
|
|
3748
3748
|
e = u.value;
|
|
3749
|
-
}),
|
|
3749
|
+
}), se(r, f), se(() => t.items, f), oe(() => {
|
|
3750
3750
|
f();
|
|
3751
3751
|
});
|
|
3752
3752
|
function h(L) {
|
|
@@ -3818,15 +3818,15 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3818
3818
|
}, null, 8, ["value", "disabled", "placeholder", "prefix-icon", "suffix-icon", "size", "round", "status", "autofocus", "clearable", "name", "form"])
|
|
3819
3819
|
]),
|
|
3820
3820
|
default: N(() => [
|
|
3821
|
-
p.value.length ? (m(),
|
|
3821
|
+
p.value.length ? (m(), k("menu", {
|
|
3822
3822
|
key: 1,
|
|
3823
3823
|
onMousedown: V[2] || (V[2] = be(() => {
|
|
3824
3824
|
}, ["prevent"]))
|
|
3825
3825
|
}, [
|
|
3826
|
-
(m(!0),
|
|
3826
|
+
(m(!0), k(ae, null, pe(p.value, (j) => (m(), S(Oo, ve({
|
|
3827
3827
|
key: j.value
|
|
3828
3828
|
}, { ref_for: !0 }, j), null, 16))), 128))
|
|
3829
|
-
], 32)) : (m(),
|
|
3829
|
+
], 32)) : (m(), k("div", {
|
|
3830
3830
|
key: 0,
|
|
3831
3831
|
class: "sq-select-dropdown-empty",
|
|
3832
3832
|
textContent: Q(t.emptyText),
|
|
@@ -3861,8 +3861,8 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3861
3861
|
const { getCssVar: s } = Fe(), e = { x: 0, y: 0 }, n = s("--sq-component-size-md"), t = parseInt(n), a = t / 2;
|
|
3862
3862
|
let d = !1, u = 0, l = [0, 0];
|
|
3863
3863
|
const r = o, p = c, h = T(0), v = le(null), f = ie(c, "value"), x = y(() => [`sq-swipe-${p.direction}`]), $ = y(() => {
|
|
3864
|
-
const
|
|
3865
|
-
return
|
|
3864
|
+
const w = {}, C = p.direction === "horizontal" ? "left" : "top";
|
|
3865
|
+
return w[C] = `${h.value}px`, w;
|
|
3866
3866
|
}), B = y(
|
|
3867
3867
|
() => p.direction === "horizontal" ? "right" : "bottom"
|
|
3868
3868
|
), M = y(() => p.disabled ? void 0 : `linear-gradient(${[
|
|
@@ -3874,58 +3874,59 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3874
3874
|
`transparent ${h.value}px`,
|
|
3875
3875
|
`#000 ${h.value + 1}px`
|
|
3876
3876
|
].join(",")})`);
|
|
3877
|
-
|
|
3877
|
+
se(f, () => {
|
|
3878
3878
|
d || L();
|
|
3879
|
-
}),
|
|
3879
|
+
}), oe(() => {
|
|
3880
3880
|
L(), document.addEventListener("pointermove", te), document.addEventListener("pointerup", j);
|
|
3881
3881
|
}), ye(() => {
|
|
3882
3882
|
document.removeEventListener("pointermove", te), document.removeEventListener("pointerup", j);
|
|
3883
3883
|
});
|
|
3884
3884
|
function L() {
|
|
3885
|
-
const
|
|
3885
|
+
const w = v.value.getBoundingClientRect(), C = f.value >= 0 && f.value <= 1 ? f.value : 0.5;
|
|
3886
3886
|
if (p.direction === "horizontal") {
|
|
3887
|
-
l = [a,
|
|
3888
|
-
const b = (
|
|
3887
|
+
l = [a, w.width - a];
|
|
3888
|
+
const b = (w.width - t) * C;
|
|
3889
3889
|
h.value = a + b;
|
|
3890
3890
|
} else {
|
|
3891
|
-
l = [a,
|
|
3892
|
-
const b = (
|
|
3891
|
+
l = [a, w.height - a];
|
|
3892
|
+
const b = (w.height - t) * C;
|
|
3893
3893
|
h.value = a + b;
|
|
3894
3894
|
}
|
|
3895
3895
|
u = h.value;
|
|
3896
3896
|
}
|
|
3897
|
-
function V(
|
|
3898
|
-
d = !0, e.x =
|
|
3897
|
+
function V(w) {
|
|
3898
|
+
d = !0, e.x = w.x, e.y = w.y;
|
|
3899
3899
|
}
|
|
3900
3900
|
function j() {
|
|
3901
3901
|
d = !1;
|
|
3902
3902
|
}
|
|
3903
|
-
function te(
|
|
3904
|
-
d && ne(
|
|
3903
|
+
function te(w) {
|
|
3904
|
+
d && ne(w.x, w.y);
|
|
3905
3905
|
}
|
|
3906
|
-
function ne(
|
|
3906
|
+
function ne(w, C) {
|
|
3907
3907
|
let b = 0;
|
|
3908
|
-
p.direction === "horizontal" ? (b = e.x -
|
|
3908
|
+
p.direction === "horizontal" ? (b = e.x - w, e.x = w) : (b = e.y - C, e.y = C);
|
|
3909
3909
|
const [_, g] = l;
|
|
3910
3910
|
u -= b;
|
|
3911
3911
|
const q = h.value;
|
|
3912
3912
|
u < _ ? h.value = _ : u > g ? h.value = g : h.value = u, q !== h.value && (f.value = (h.value - a) / (g - _), r("change", h.value / (g + a)));
|
|
3913
3913
|
}
|
|
3914
|
-
return (
|
|
3914
|
+
return (w, C) => (m(), k("div", {
|
|
3915
3915
|
class: W(["sq-swipe", x.value]),
|
|
3916
3916
|
ref_key: "swipeRef",
|
|
3917
3917
|
ref: v
|
|
3918
3918
|
}, [
|
|
3919
|
-
F(
|
|
3919
|
+
F(w.$slots, "default", {}, () => [
|
|
3920
3920
|
E("div", {
|
|
3921
3921
|
class: "sq-swipe-top",
|
|
3922
3922
|
style: G({ mask: M.value })
|
|
3923
3923
|
}, [
|
|
3924
|
-
F(
|
|
3924
|
+
F(w.$slots, "top", {}, () => [
|
|
3925
3925
|
p.topSrc ? (m(), S(i(Ye), {
|
|
3926
3926
|
key: 0,
|
|
3927
3927
|
src: p.topSrc,
|
|
3928
|
-
alt: p.topAlt
|
|
3928
|
+
alt: p.topAlt,
|
|
3929
|
+
preview: !1
|
|
3929
3930
|
}, null, 8, ["src", "alt"])) : P("", !0)
|
|
3930
3931
|
])
|
|
3931
3932
|
], 4),
|
|
@@ -3933,11 +3934,12 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3933
3934
|
class: "sq-swipe-bottom",
|
|
3934
3935
|
style: G({ mask: I.value })
|
|
3935
3936
|
}, [
|
|
3936
|
-
F(
|
|
3937
|
+
F(w.$slots, "bottom", {}, () => [
|
|
3937
3938
|
p.bottomSrc ? (m(), S(i(Ye), {
|
|
3938
3939
|
key: 0,
|
|
3939
3940
|
src: p.bottomSrc,
|
|
3940
|
-
alt: p.bottomAlt
|
|
3941
|
+
alt: p.bottomAlt,
|
|
3942
|
+
preview: !1
|
|
3941
3943
|
}, null, 8, ["src", "alt"])) : P("", !0)
|
|
3942
3944
|
])
|
|
3943
3945
|
], 4)
|
|
@@ -3976,7 +3978,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3976
3978
|
const l = [], r = i(n), p = i(t);
|
|
3977
3979
|
return r !== "md" && l.push(`sq-switch--${r}`), d.value && l.push("is-checked"), (p || e.loading) && l.push("is-disabled"), e.variant && l.push(`is-${e.variant}`), l;
|
|
3978
3980
|
});
|
|
3979
|
-
return (l, r) => (m(),
|
|
3981
|
+
return (l, r) => (m(), k("label", {
|
|
3980
3982
|
class: W(["sq-switch", u.value])
|
|
3981
3983
|
}, [
|
|
3982
3984
|
ue(E("input", {
|
|
@@ -4034,7 +4036,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4034
4036
|
...d.value,
|
|
4035
4037
|
paddingInlineEnd: n.value ? "6px" : "0"
|
|
4036
4038
|
}));
|
|
4037
|
-
|
|
4039
|
+
oe(() => {
|
|
4038
4040
|
s.observe(t.value);
|
|
4039
4041
|
}), ye(() => {
|
|
4040
4042
|
s.disconnect();
|
|
@@ -4044,7 +4046,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4044
4046
|
n.value = !1;
|
|
4045
4047
|
return;
|
|
4046
4048
|
}
|
|
4047
|
-
|
|
4049
|
+
we(() => {
|
|
4048
4050
|
var x, $;
|
|
4049
4051
|
const v = ((x = t.value) == null ? void 0 : x.clientHeight) ?? 0, f = (($ = t.value) == null ? void 0 : $.scrollHeight) ?? 0;
|
|
4050
4052
|
n.value = f > v;
|
|
@@ -4068,7 +4070,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4068
4070
|
function h(v, f) {
|
|
4069
4071
|
return typeof f.formatter == "function" ? f.formatter(v, v[f.binding]) : typeof v[f.binding] > "u" ? "" : v[f.binding];
|
|
4070
4072
|
}
|
|
4071
|
-
return (v, f) => (m(),
|
|
4073
|
+
return (v, f) => (m(), k("div", {
|
|
4072
4074
|
class: W(["sq-table", a.value])
|
|
4073
4075
|
}, [
|
|
4074
4076
|
E("div", Go, [
|
|
@@ -4076,7 +4078,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4076
4078
|
class: "sq-table-header",
|
|
4077
4079
|
style: G(u.value)
|
|
4078
4080
|
}, [
|
|
4079
|
-
(m(!0),
|
|
4081
|
+
(m(!0), k(ae, null, pe(e.cols, (x) => (m(), k("div", {
|
|
4080
4082
|
class: "sq-table-cell",
|
|
4081
4083
|
style: G({ "justify-content": p(x.align) }),
|
|
4082
4084
|
key: x.binding
|
|
@@ -4091,12 +4093,12 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4091
4093
|
ref_key: "bodyRef",
|
|
4092
4094
|
ref: t
|
|
4093
4095
|
}, [
|
|
4094
|
-
(m(!0),
|
|
4096
|
+
(m(!0), k(ae, null, pe(e.data, (x, $) => (m(), k("div", {
|
|
4095
4097
|
class: "sq-table-row",
|
|
4096
4098
|
style: G(d.value),
|
|
4097
4099
|
key: r(x, $)
|
|
4098
4100
|
}, [
|
|
4099
|
-
(m(!0),
|
|
4101
|
+
(m(!0), k(ae, null, pe(e.cols, (B, M) => (m(), k("div", {
|
|
4100
4102
|
class: W(["sq-table-cell", B.columnClass]),
|
|
4101
4103
|
style: G({ "justify-content": p(B.align) }),
|
|
4102
4104
|
key: `${B.binding}-${r(x, M)}`
|
|
@@ -4104,7 +4106,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4104
4106
|
typeof B.cellRender == "function" ? (m(), S(i(Zo), {
|
|
4105
4107
|
key: 0,
|
|
4106
4108
|
content: B.cellRender(x, x[B.binding])
|
|
4107
|
-
}, null, 8, ["content"])) : (m(),
|
|
4109
|
+
}, null, 8, ["content"])) : (m(), k("span", {
|
|
4108
4110
|
key: 1,
|
|
4109
4111
|
textContent: Q(h(x, B))
|
|
4110
4112
|
}, null, 8, Jo))
|
|
@@ -4113,7 +4115,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4113
4115
|
], 512), [
|
|
4114
4116
|
[he, e.data.length]
|
|
4115
4117
|
]),
|
|
4116
|
-
e.data.length ? P("", !0) : (m(),
|
|
4118
|
+
e.data.length ? P("", !0) : (m(), k("div", ea, [
|
|
4117
4119
|
F(v.$slots, "empty", {}, () => [
|
|
4118
4120
|
E("span", {
|
|
4119
4121
|
textContent: Q(e.emptyText)
|
|
@@ -4187,7 +4189,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4187
4189
|
}), e = y(() => typeof o.ellipsis == "number" ? Number(Math.max(o.ellipsis, 1).toFixed(0)) : 1), n = y(
|
|
4188
4190
|
() => o.ellipsis ? `--row-num: ${e.value}` : ""
|
|
4189
4191
|
);
|
|
4190
|
-
return (t, a) => (m(),
|
|
4192
|
+
return (t, a) => (m(), k("span", {
|
|
4191
4193
|
class: W(["sq-text", s.value]),
|
|
4192
4194
|
style: G(n.value)
|
|
4193
4195
|
}, [
|
|
@@ -4206,7 +4208,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4206
4208
|
const e = [`align-${o.align}`];
|
|
4207
4209
|
return o.variant && e.push(`is-${o.variant}`), e;
|
|
4208
4210
|
});
|
|
4209
|
-
return (e, n) => (m(),
|
|
4211
|
+
return (e, n) => (m(), k("div", {
|
|
4210
4212
|
class: W(["sq-timeline", s.value])
|
|
4211
4213
|
}, [
|
|
4212
4214
|
F(e.$slots, "default")
|
|
@@ -4231,7 +4233,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4231
4233
|
const n = {};
|
|
4232
4234
|
return o.color && (n["--timeline-dot-color"] = o.color), n;
|
|
4233
4235
|
});
|
|
4234
|
-
return (n, t) => (m(),
|
|
4236
|
+
return (n, t) => (m(), k("div", {
|
|
4235
4237
|
class: W(["sq-timeline-item", s.value]),
|
|
4236
4238
|
style: G(e.value)
|
|
4237
4239
|
}, [
|
|
@@ -4239,12 +4241,12 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4239
4241
|
o.icon ? (m(), S(fe(o.icon), { key: 0 })) : P("", !0)
|
|
4240
4242
|
]),
|
|
4241
4243
|
E("div", ia, [
|
|
4242
|
-
o.title ? (m(),
|
|
4244
|
+
o.title ? (m(), k("h2", {
|
|
4243
4245
|
key: 0,
|
|
4244
4246
|
class: "content-title",
|
|
4245
4247
|
textContent: Q(o.title)
|
|
4246
4248
|
}, null, 8, ua)) : P("", !0),
|
|
4247
|
-
o.timestamp ? (m(),
|
|
4249
|
+
o.timestamp ? (m(), k("span", {
|
|
4248
4250
|
key: 1,
|
|
4249
4251
|
class: "content-time",
|
|
4250
4252
|
textContent: Q(o.timestamp)
|
|
@@ -4334,7 +4336,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4334
4336
|
function p() {
|
|
4335
4337
|
t.value.value = "", t.value.files = null, e("change", []);
|
|
4336
4338
|
}
|
|
4337
|
-
return o({ clearFiles: p }), (h, v) => (m(),
|
|
4339
|
+
return o({ clearFiles: p }), (h, v) => (m(), k("div", {
|
|
4338
4340
|
class: "sq-upload",
|
|
4339
4341
|
onClick: d,
|
|
4340
4342
|
onDragover: u,
|
|
@@ -4368,10 +4370,10 @@ export {
|
|
|
4368
4370
|
_a as SqAvatar,
|
|
4369
4371
|
$a as SqBacktop,
|
|
4370
4372
|
lt as SqBadge,
|
|
4371
|
-
|
|
4373
|
+
wn as SqBlur,
|
|
4372
4374
|
ee as SqButton,
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
+
wa as SqButtonGroup,
|
|
4376
|
+
ka as SqCard,
|
|
4375
4377
|
Ea as SqCheckTag,
|
|
4376
4378
|
_t as SqCheckbox,
|
|
4377
4379
|
jn as SqCheckboxGroup,
|
|
@@ -4389,7 +4391,7 @@ export {
|
|
|
4389
4391
|
za as SqMessageBox,
|
|
4390
4392
|
Ra as SqPagination,
|
|
4391
4393
|
qt as SqPopover,
|
|
4392
|
-
|
|
4394
|
+
ko as SqProgress,
|
|
4393
4395
|
To as SqRadio,
|
|
4394
4396
|
Lo as SqRadioGroup,
|
|
4395
4397
|
Ao as SqSegmented,
|