@squirrel-cloud/ui-vue 0.4.34 → 0.4.35
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 +156 -157
- package/dist/index.umd.cjs +7 -7
- 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 b, openBlock as v, createBlock as S, unref as r, normalizeClass as X, withCtx as N, resolveDynamicComponent as fe, createCommentVNode as P, createTextVNode as Oe, toDisplayString as Q, h as De, ref as T, watch as ie, createElementBlock as w, normalizeStyle as J, onMounted as le, onBeforeUnmount as ye, Transition as ke, withDirectives as
|
|
1
|
+
import { defineComponent as R, computed as b, openBlock as v, createBlock as S, unref as r, normalizeClass as X, withCtx as N, resolveDynamicComponent as fe, createCommentVNode as P, createTextVNode as Oe, toDisplayString as Q, h as De, ref as T, watch as ie, createElementBlock as w, normalizeStyle as J, onMounted as le, onBeforeUnmount as ye, Transition as ke, withDirectives as re, createElementVNode as E, renderSlot as H, vShow as he, useSlots as Ne, createVNode as z, inject as me, shallowRef as ue, provide as Ce, toRef as oe, useModel as ae, vModelCheckbox as ut, mergeModels as Z, toRaw as ze, Fragment as se, renderList as pe, useAttrs as Ze, Teleport as ct, mergeProps as ve, withModifiers as be, nextTick as $e, vModelDynamic as zt, vModelText as Rt, render as Ve, cloneVNode as Lt, Text as It, Comment as At, vModelRadio as dt } from "vue";
|
|
2
2
|
import { WarningFilled as ft, CloseFilled as pt, InfoFilled as st, CheckFilled as vt, JumpTo as Et, CaretUp as Mt, Loading as Ue, Check as mt, Close as Je, Bold as Pt, Italic as Dt, Underline as Ot, Strikethrough as Nt, Hide as ht, ListUl as Vt, ListOl as Ut, View as gt, ArrowLeft as bt, ArrowRight as yt, ZoomIn as Ft, ZoomOut as Ht, FlipHorizontal as jt, FlipVertical as Wt, Clockwise as Xt, Couterclockwise as Yt, FitSize as Kt, Fullscreen as Gt, Ellipsis as Zt, ArrowDown as Jt } from "@squirrel-cloud/icons-vue";
|
|
3
3
|
import Qt from "markdown-it";
|
|
4
4
|
import { RouterLink as en } from "vue-router";
|
|
@@ -203,7 +203,7 @@ function dn() {
|
|
|
203
203
|
const c = [], d = { children: [] };
|
|
204
204
|
let l = d;
|
|
205
205
|
return t.forEach((i) => {
|
|
206
|
-
var M, I, L,
|
|
206
|
+
var M, I, L, U, W, ne, F, k, C, y, x, g;
|
|
207
207
|
const { type: p, children: m, content: h, attrs: f, tag: _, hidden: $, info: B } = i;
|
|
208
208
|
switch (p) {
|
|
209
209
|
case "heading_open":
|
|
@@ -264,7 +264,7 @@ function dn() {
|
|
|
264
264
|
break;
|
|
265
265
|
}
|
|
266
266
|
case "code_inline": {
|
|
267
|
-
(
|
|
267
|
+
(U = l.children) == null || U.push({
|
|
268
268
|
tag: (a == null ? void 0 : a[_]) ?? _,
|
|
269
269
|
children: [h],
|
|
270
270
|
attrs: f ? Object.fromEntries(f) : {}
|
|
@@ -280,7 +280,7 @@ function dn() {
|
|
|
280
280
|
break;
|
|
281
281
|
}
|
|
282
282
|
case "text": {
|
|
283
|
-
h !== "" && ((
|
|
283
|
+
h !== "" && ((F = l.children) == null || F.push(h));
|
|
284
284
|
break;
|
|
285
285
|
}
|
|
286
286
|
case "image": {
|
|
@@ -328,7 +328,7 @@ function dn() {
|
|
|
328
328
|
}, Y = h.match(/<[^>]+>/);
|
|
329
329
|
if (Y) {
|
|
330
330
|
const A = Y[0], D = {};
|
|
331
|
-
A.replace(/(\w+)=["']?([^"'\s>]+)["']?/g, (G, ce,
|
|
331
|
+
A.replace(/(\w+)=["']?([^"'\s>]+)["']?/g, (G, ce, ge) => (D[ce] = ge, "")), Object.keys(D).length > 0 && (j.attrs = D);
|
|
332
332
|
}
|
|
333
333
|
(g = l.children) == null || g.push(j), c.push(l), l = j;
|
|
334
334
|
}
|
|
@@ -529,7 +529,7 @@ const { md2tokens: vn, tokens2vueh: mn } = dn(), hn = "sq-article", gn = R({
|
|
|
529
529
|
default: N(() => {
|
|
530
530
|
var h, f, _;
|
|
531
531
|
return [
|
|
532
|
-
|
|
532
|
+
re(E("div", _n, [
|
|
533
533
|
E("div", {
|
|
534
534
|
class: "sq-backtop-wrap",
|
|
535
535
|
onClick: i
|
|
@@ -549,7 +549,7 @@ const { md2tokens: vn, tokens2vueh: mn } = dn(), hn = "sq-article", gn = R({
|
|
|
549
549
|
])
|
|
550
550
|
])
|
|
551
551
|
], 512), [
|
|
552
|
-
[
|
|
552
|
+
[he, c.value]
|
|
553
553
|
])
|
|
554
554
|
];
|
|
555
555
|
}),
|
|
@@ -702,7 +702,7 @@ function Bn(u) {
|
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
704
|
function xt() {
|
|
705
|
-
const u = { x: 0, y: 0 }, o = T(!1), s = T(1), e = T(), n = T({ x: 0, y: 0 }), t =
|
|
705
|
+
const u = { x: 0, y: 0 }, o = T(!1), s = T(1), e = T(), n = T({ x: 0, y: 0 }), t = ue(null);
|
|
706
706
|
function a(f) {
|
|
707
707
|
f.pointerType !== "touch" && (o.value = !0, u.x = f.x, u.y = f.y);
|
|
708
708
|
}
|
|
@@ -721,8 +721,8 @@ function xt() {
|
|
|
721
721
|
o.value = !1, e.value = void 0, f == null || f();
|
|
722
722
|
}
|
|
723
723
|
function i(f, _, $, B, M) {
|
|
724
|
-
const I = s.value / M, L = f * I,
|
|
725
|
-
return [W - L, ne -
|
|
724
|
+
const I = s.value / M, L = f * I, U = _ * I, [W, ne] = h($, B);
|
|
725
|
+
return [W - L, ne - U];
|
|
726
726
|
}
|
|
727
727
|
function p(f, _) {
|
|
728
728
|
const $ = f - u.x, B = _ - u.y;
|
|
@@ -1005,7 +1005,7 @@ const An = ["disabled", "form", "type"], En = "sq-button", te = /* @__PURE__ */
|
|
|
1005
1005
|
}), (h, f) => (v(), w("label", {
|
|
1006
1006
|
class: X(["sq-selection sq-checkbox", p.value])
|
|
1007
1007
|
}, [
|
|
1008
|
-
|
|
1008
|
+
re(E("input", {
|
|
1009
1009
|
type: "checkbox",
|
|
1010
1010
|
autofocus: e.autofocus,
|
|
1011
1011
|
name: r(c),
|
|
@@ -1158,14 +1158,14 @@ const An = ["disabled", "form", "type"], En = "sq-button", te = /* @__PURE__ */
|
|
|
1158
1158
|
onAfterLeave: f[3] || (f[3] = (_) => t("closed"))
|
|
1159
1159
|
}, {
|
|
1160
1160
|
default: N(() => [
|
|
1161
|
-
d.value ?
|
|
1161
|
+
d.value ? re((v(), w("div", ve({
|
|
1162
1162
|
key: 0,
|
|
1163
1163
|
class: "sq-mask",
|
|
1164
1164
|
style: { zIndex: c.value }
|
|
1165
1165
|
}, r(e), { onClick: p }), [
|
|
1166
1166
|
H(h.$slots, "default")
|
|
1167
1167
|
], 16)), [
|
|
1168
|
-
[
|
|
1168
|
+
[he, l.value]
|
|
1169
1169
|
]) : P("", !0)
|
|
1170
1170
|
]),
|
|
1171
1171
|
_: 3
|
|
@@ -1668,7 +1668,7 @@ const An = ["disabled", "form", "type"], En = "sq-button", te = /* @__PURE__ */
|
|
|
1668
1668
|
}
|
|
1669
1669
|
];
|
|
1670
1670
|
let s;
|
|
1671
|
-
const e = u, n = T("edit"), t = T([]), a = T(!1), c = T(""), d = T(), l = T({}), i =
|
|
1671
|
+
const e = u, n = T("edit"), t = T([]), a = T(!1), c = T(""), d = T(), l = T({}), i = ue(null), p = ue(null), m = ue(null), h = ue(
|
|
1672
1672
|
null
|
|
1673
1673
|
), f = ae(u, "value"), _ = b(() => {
|
|
1674
1674
|
const x = [];
|
|
@@ -1682,9 +1682,9 @@ const An = ["disabled", "form", "type"], En = "sq-button", te = /* @__PURE__ */
|
|
|
1682
1682
|
() => typeof e.beforePreview == "function" ? e.beforePreview(f.value) : f.value
|
|
1683
1683
|
);
|
|
1684
1684
|
le(() => {
|
|
1685
|
-
document.addEventListener("selectionchange",
|
|
1685
|
+
document.addEventListener("selectionchange", U), document.addEventListener("click", W);
|
|
1686
1686
|
}), ye(() => {
|
|
1687
|
-
document.removeEventListener("selectionchange",
|
|
1687
|
+
document.removeEventListener("selectionchange", U), document.removeEventListener("click", W);
|
|
1688
1688
|
});
|
|
1689
1689
|
function I(x) {
|
|
1690
1690
|
x === "edit" && $e(() => {
|
|
@@ -1736,19 +1736,19 @@ ${A}- `, ne(x.target), y(t.value, G, G);
|
|
|
1736
1736
|
${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
1737
1737
|
return;
|
|
1738
1738
|
}
|
|
1739
|
-
const
|
|
1740
|
-
t.value[d.value] = g.substring(
|
|
1739
|
+
const ge = A.length + ce.length;
|
|
1740
|
+
t.value[d.value] = g.substring(ge), y(t.value, -ge, -ge);
|
|
1741
1741
|
return;
|
|
1742
1742
|
}
|
|
1743
1743
|
}
|
|
1744
1744
|
}
|
|
1745
|
-
function
|
|
1745
|
+
function U(x) {
|
|
1746
1746
|
var q;
|
|
1747
1747
|
const g = window.getSelection();
|
|
1748
1748
|
(g == null ? void 0 : g.focusNode) === ((q = i.value) == null ? void 0 : q.$el) && (s = x.target, !((s == null ? void 0 : s.selectionStart) === void 0 || (s == null ? void 0 : s.selectionEnd) === void 0) && (l.value.start = (s == null ? void 0 : s.selectionStart) ?? 0, l.value.end = (s == null ? void 0 : s.selectionEnd) ?? 0, c.value = f.value.substring(
|
|
1749
1749
|
l.value.start,
|
|
1750
1750
|
l.value.end
|
|
1751
|
-
),
|
|
1751
|
+
), F()));
|
|
1752
1752
|
}
|
|
1753
1753
|
function W() {
|
|
1754
1754
|
c.value = "", d.value = void 0;
|
|
@@ -1760,7 +1760,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
1760
1760
|
x.scrollTo({ top: ce - D });
|
|
1761
1761
|
});
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function F() {
|
|
1764
1764
|
const x = s.selectionStart, g = f.value.substring(0, x ?? 0);
|
|
1765
1765
|
d.value = g.split(`
|
|
1766
1766
|
`).length - 1;
|
|
@@ -1785,10 +1785,10 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
1785
1785
|
}
|
|
1786
1786
|
return (x, g) => (v(), w("div", {
|
|
1787
1787
|
class: X(["sq-editor", _.value]),
|
|
1788
|
-
onClick: g[2] || (g[2] =
|
|
1788
|
+
onClick: g[2] || (g[2] = be(() => {
|
|
1789
1789
|
}, ["stop"]))
|
|
1790
1790
|
}, [
|
|
1791
|
-
|
|
1791
|
+
re(E("div", xs, [
|
|
1792
1792
|
e.md ? (v(), w(se, { key: 0 }, [
|
|
1793
1793
|
E("div", _s, [
|
|
1794
1794
|
z(is, {
|
|
@@ -1874,7 +1874,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
1874
1874
|
onKeydown: L
|
|
1875
1875
|
}, null, 8, ["class", "size", "round", "disabled", "placeholder", "maxlength", "minlength", "value"])
|
|
1876
1876
|
], 512), [
|
|
1877
|
-
[
|
|
1877
|
+
[he, n.value === "edit"]
|
|
1878
1878
|
]),
|
|
1879
1879
|
n.value === "preview" ? (v(), S(r(gn), {
|
|
1880
1880
|
key: 0,
|
|
@@ -1942,11 +1942,11 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
1942
1942
|
onAfterLeave: c
|
|
1943
1943
|
}, {
|
|
1944
1944
|
default: N(() => [
|
|
1945
|
-
|
|
1945
|
+
re(E("span", {
|
|
1946
1946
|
class: "sq-form-item-check",
|
|
1947
1947
|
textContent: Q(n.value)
|
|
1948
1948
|
}, null, 8, Cs), [
|
|
1949
|
-
[
|
|
1949
|
+
[he, s.errorMsg]
|
|
1950
1950
|
])
|
|
1951
1951
|
]),
|
|
1952
1952
|
_: 1
|
|
@@ -2029,21 +2029,21 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2029
2029
|
c.value = c.value.filter((O) => O !== k), delete a.value[k];
|
|
2030
2030
|
return;
|
|
2031
2031
|
}
|
|
2032
|
-
return q === !0 ?
|
|
2032
|
+
return q === !0 ? U(k) : q === !1 ? L(k, "字段验证失败") : q ? L(k, q) : U(k), q === !0 || typeof q == "string" && !q;
|
|
2033
2033
|
}
|
|
2034
2034
|
function B(k, C, y) {
|
|
2035
|
-
return y.required && !C ? (L(k, y.requiredText ?? "字段必填"), !1) : y.pattern && C && !y.pattern.test(C) ? (L(k, y.patternText ?? "字段验证失败"), !1) : (
|
|
2035
|
+
return y.required && !C ? (L(k, y.requiredText ?? "字段必填"), !1) : y.pattern && C && !y.pattern.test(C) ? (L(k, y.patternText ?? "字段验证失败"), !1) : (U(k), !0);
|
|
2036
2036
|
}
|
|
2037
2037
|
function M(k, C, y) {
|
|
2038
|
-
return y.required && C === void 0 ? (L(k, y.requiredText ?? "字段必填"), !1) : (
|
|
2038
|
+
return y.required && C === void 0 ? (L(k, y.requiredText ?? "字段必填"), !1) : (U(k), !0);
|
|
2039
2039
|
}
|
|
2040
2040
|
function I(k, C, y) {
|
|
2041
|
-
return y.required && (!C || !C.length) ? (L(k, y.requiredText ?? "字段必填"), !1) : y.pattern && C && C.map((q) => q.toString()).map((q) => y.pattern.test(q)).includes(!1) ? (L(k, y.patternText ?? "字段验证失败"), !1) : (
|
|
2041
|
+
return y.required && (!C || !C.length) ? (L(k, y.requiredText ?? "字段必填"), !1) : y.pattern && C && C.map((q) => q.toString()).map((q) => y.pattern.test(q)).includes(!1) ? (L(k, y.patternText ?? "字段验证失败"), !1) : (U(k), !0);
|
|
2042
2042
|
}
|
|
2043
2043
|
function L(k, C) {
|
|
2044
2044
|
c.value = c.value.filter((y) => y !== k), a.value[k] = C;
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2046
|
+
function U(k) {
|
|
2047
2047
|
c.value.push(k), delete a.value[k];
|
|
2048
2048
|
}
|
|
2049
2049
|
function W(k) {
|
|
@@ -2053,7 +2053,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2053
2053
|
function ne() {
|
|
2054
2054
|
n("update:formData", structuredClone(e)), a.value = {}, c.value = [], n("validate", "SQFORM", !1, ze(c.value));
|
|
2055
2055
|
}
|
|
2056
|
-
function
|
|
2056
|
+
function F(k = !0) {
|
|
2057
2057
|
const y = (k ? t.items : p.value).filter(
|
|
2058
2058
|
(x) => x.type !== "custom" && x.rule && !c.value.includes(x.binding)
|
|
2059
2059
|
).map((x) => {
|
|
@@ -2062,10 +2062,10 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2062
2062
|
});
|
|
2063
2063
|
return Promise.all(y).then((x) => (n("validate", "SQFORM", !x.includes(!1), ze(c.value)), x));
|
|
2064
2064
|
}
|
|
2065
|
-
return o({ resetFields: ne, validate:
|
|
2065
|
+
return o({ resetFields: ne, validate: F }), (k, C) => (v(), w("form", {
|
|
2066
2066
|
class: X(["sq-form", l.value]),
|
|
2067
2067
|
style: J(i.value),
|
|
2068
|
-
onSubmit: C[0] || (C[0] =
|
|
2068
|
+
onSubmit: C[0] || (C[0] = be(() => {
|
|
2069
2069
|
}, ["prevent"]))
|
|
2070
2070
|
}, [
|
|
2071
2071
|
(v(!0), w(se, null, pe(p.value, (y, x) => (v(), S(Bs, {
|
|
@@ -2155,7 +2155,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2155
2155
|
},
|
|
2156
2156
|
emits: ["load", "error"],
|
|
2157
2157
|
setup(u, { emit: o }) {
|
|
2158
|
-
const s = new IntersectionObserver(_), e = o, n = u, t = T(!1), a = T(n.src), c = T(!1), d = T(!1), l = T(!1), i =
|
|
2158
|
+
const s = new IntersectionObserver(_), e = o, n = u, t = T(!1), a = T(n.src), c = T(!1), d = T(!1), l = T(!1), i = ue(null), p = b(() => t.value && !c.value), m = b(() => ({
|
|
2159
2159
|
height: p.value ? void 0 : "var(--image-placeholder-height)",
|
|
2160
2160
|
aspectRatio: p.value ? void 0 : n.aspectRatio
|
|
2161
2161
|
}));
|
|
@@ -2268,20 +2268,20 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2268
2268
|
getImagePoint: h
|
|
2269
2269
|
} = xt(), f = { x: 0, y: 0 };
|
|
2270
2270
|
let _ = 0;
|
|
2271
|
-
const $ = u, B = T(!1), M = T(!1), I = T(0), L = T(0),
|
|
2272
|
-
const K = B.value ? -1 : 1,
|
|
2271
|
+
const $ = u, B = T(!1), M = T(!1), I = T(0), L = T(0), U = T(!0), W = ae(u, "visible"), ne = b(() => $.srcList[L.value]), F = b(() => {
|
|
2272
|
+
const K = B.value ? -1 : 1, V = M.value ? -1 : 1;
|
|
2273
2273
|
return {
|
|
2274
2274
|
transform: [
|
|
2275
|
-
`scale(${e.value * K}, ${e.value *
|
|
2275
|
+
`scale(${e.value * K}, ${e.value * V})`,
|
|
2276
2276
|
`rotate(${I.value}deg)`
|
|
2277
2277
|
].join(" "),
|
|
2278
2278
|
marginInlineStart: `${n.value.x}px`,
|
|
2279
2279
|
marginBlockStart: `${n.value.y}px`,
|
|
2280
|
-
transition:
|
|
2280
|
+
transition: U.value ? void 0 : "none"
|
|
2281
2281
|
};
|
|
2282
2282
|
});
|
|
2283
2283
|
function k() {
|
|
2284
|
-
|
|
2284
|
+
U.value = !0;
|
|
2285
2285
|
}
|
|
2286
2286
|
function C(K) {
|
|
2287
2287
|
K.deltaY < 0 ? j(K.x, K.y) : Y(K.x, K.y);
|
|
@@ -2292,15 +2292,15 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2292
2292
|
function x(K) {
|
|
2293
2293
|
if (K.touches.length === 1) {
|
|
2294
2294
|
if (!o.value || !$.moveable) return;
|
|
2295
|
-
const
|
|
2296
|
-
p(
|
|
2295
|
+
const V = K.touches[0];
|
|
2296
|
+
p(V.screenX, V.screenY);
|
|
2297
2297
|
} else if (K.touches.length === 2) {
|
|
2298
2298
|
if (!s.value) return;
|
|
2299
|
-
o.value = !1,
|
|
2300
|
-
const
|
|
2299
|
+
o.value = !1, U.value = !1;
|
|
2300
|
+
const V = K.touches.item(0), ee = K.touches.item(1), _e = m(V, ee), Me = _e / s.value;
|
|
2301
2301
|
let qe = e.value * Me;
|
|
2302
2302
|
qe = Math.min($.maxScale, qe), qe = Math.max($.minScale, qe);
|
|
2303
|
-
const We = (
|
|
2303
|
+
const We = (V.clientX + ee.clientX) / 2, Xe = (V.clientY + ee.clientY) / 2;
|
|
2304
2304
|
A(qe, We, Xe), s.value = _e;
|
|
2305
2305
|
}
|
|
2306
2306
|
}
|
|
@@ -2314,27 +2314,27 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2314
2314
|
function O(K) {
|
|
2315
2315
|
L.value += K;
|
|
2316
2316
|
}
|
|
2317
|
-
function j(K,
|
|
2317
|
+
function j(K, V) {
|
|
2318
2318
|
if (e.value >= $.maxScale) return;
|
|
2319
2319
|
const ee = Math.min($.maxScale, e.value * (1 + $.scaleStep));
|
|
2320
|
-
A(ee, K,
|
|
2320
|
+
A(ee, K, V);
|
|
2321
2321
|
}
|
|
2322
|
-
function Y(K,
|
|
2322
|
+
function Y(K, V) {
|
|
2323
2323
|
const ee = Math.min(_, $.minScale);
|
|
2324
2324
|
if (e.value <= ee) return;
|
|
2325
2325
|
const _e = Math.max(ee, e.value / (1 + $.scaleStep));
|
|
2326
|
-
A(_e, K,
|
|
2326
|
+
A(_e, K, V);
|
|
2327
2327
|
}
|
|
2328
|
-
function A(K,
|
|
2329
|
-
if (!
|
|
2328
|
+
function A(K, V, ee) {
|
|
2329
|
+
if (!V || !ee) {
|
|
2330
2330
|
e.value = K;
|
|
2331
2331
|
return;
|
|
2332
2332
|
}
|
|
2333
|
-
|
|
2334
|
-
const _e = e.value, [Me, qe] = h(
|
|
2333
|
+
U.value = !1;
|
|
2334
|
+
const _e = e.value, [Me, qe] = h(V, ee);
|
|
2335
2335
|
e.value = K, $e(() => {
|
|
2336
|
-
const [We, Xe] = i(Me, qe,
|
|
2337
|
-
n.value.x += We * 2, n.value.y += Xe * 2,
|
|
2336
|
+
const [We, Xe] = i(Me, qe, V, ee, _e);
|
|
2337
|
+
n.value.x += We * 2, n.value.y += Xe * 2, U.value = !0;
|
|
2338
2338
|
});
|
|
2339
2339
|
}
|
|
2340
2340
|
function D() {
|
|
@@ -2346,7 +2346,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2346
2346
|
function ce() {
|
|
2347
2347
|
B.value = !B.value;
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function ge() {
|
|
2350
2350
|
M.value = !M.value;
|
|
2351
2351
|
}
|
|
2352
2352
|
function we(K) {
|
|
@@ -2355,41 +2355,41 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2355
2355
|
function je() {
|
|
2356
2356
|
W.value = !1;
|
|
2357
2357
|
}
|
|
2358
|
-
return (K,
|
|
2358
|
+
return (K, V) => (v(), S(r(wt), {
|
|
2359
2359
|
class: "sq-image-viewer-mask",
|
|
2360
2360
|
visible: W.value,
|
|
2361
|
-
"onUpdate:visible":
|
|
2361
|
+
"onUpdate:visible": V[10] || (V[10] = (ee) => W.value = ee),
|
|
2362
2362
|
keyboard: $.keyboard,
|
|
2363
2363
|
"mask-closeable": $.maskCloseable,
|
|
2364
2364
|
onWheelPassive: C,
|
|
2365
2365
|
onPointermove: y,
|
|
2366
2366
|
onPointerup: r(c),
|
|
2367
2367
|
onTouchmovePassive: x,
|
|
2368
|
-
onTouchend:
|
|
2368
|
+
onTouchend: V[11] || (V[11] = () => r(l)(k)),
|
|
2369
2369
|
onClosed: q
|
|
2370
2370
|
}, {
|
|
2371
2371
|
default: N(() => [
|
|
2372
2372
|
E("img", {
|
|
2373
2373
|
ref_key: "imgRef",
|
|
2374
2374
|
ref: t,
|
|
2375
|
-
style: J(
|
|
2375
|
+
style: J(F.value),
|
|
2376
2376
|
src: ne.value,
|
|
2377
|
-
onClick:
|
|
2377
|
+
onClick: V[0] || (V[0] = be(() => {
|
|
2378
2378
|
}, ["stop"])),
|
|
2379
2379
|
onLoad: g,
|
|
2380
|
-
onPointerdown:
|
|
2380
|
+
onPointerdown: V[1] || (V[1] = be(
|
|
2381
2381
|
//@ts-ignore
|
|
2382
2382
|
(...ee) => r(a) && r(a)(...ee),
|
|
2383
2383
|
["prevent"]
|
|
2384
2384
|
)),
|
|
2385
|
-
onTouchstartPassive:
|
|
2385
|
+
onTouchstartPassive: V[2] || (V[2] = //@ts-ignore
|
|
2386
2386
|
(...ee) => r(d) && r(d)(...ee))
|
|
2387
2387
|
}, null, 44, Ms),
|
|
2388
2388
|
z(r(te), {
|
|
2389
2389
|
class: "sq-image-viewer-close",
|
|
2390
2390
|
round: "",
|
|
2391
2391
|
icon: r(Je),
|
|
2392
|
-
onClick:
|
|
2392
|
+
onClick: be(je, ["stop"])
|
|
2393
2393
|
}, null, 8, ["icon"]),
|
|
2394
2394
|
$.srcList.length > 1 ? (v(), w(se, { key: 0 }, [
|
|
2395
2395
|
z(r(te), {
|
|
@@ -2397,20 +2397,20 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2397
2397
|
round: "",
|
|
2398
2398
|
icon: r(bt),
|
|
2399
2399
|
disabled: L.value === 0,
|
|
2400
|
-
onClick:
|
|
2400
|
+
onClick: V[3] || (V[3] = (ee) => O(-1))
|
|
2401
2401
|
}, null, 8, ["icon", "disabled"]),
|
|
2402
2402
|
z(r(te), {
|
|
2403
2403
|
class: "sq-image-viewer-next",
|
|
2404
2404
|
round: "",
|
|
2405
2405
|
icon: r(yt),
|
|
2406
2406
|
disabled: L.value === $.srcList.length - 1,
|
|
2407
|
-
onClick:
|
|
2407
|
+
onClick: V[4] || (V[4] = (ee) => O(1))
|
|
2408
2408
|
}, null, 8, ["icon", "disabled"])
|
|
2409
2409
|
], 64)) : P("", !0),
|
|
2410
2410
|
$.toolbar ? (v(), w("div", {
|
|
2411
2411
|
key: 1,
|
|
2412
2412
|
class: "sq-image-viewer-toolbar",
|
|
2413
|
-
onClick:
|
|
2413
|
+
onClick: V[9] || (V[9] = be(() => {
|
|
2414
2414
|
}, ["stop"]))
|
|
2415
2415
|
}, [
|
|
2416
2416
|
z(r(de), {
|
|
@@ -2422,7 +2422,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2422
2422
|
text: "",
|
|
2423
2423
|
icon: r(Ft),
|
|
2424
2424
|
disabled: r(e) >= $.maxScale,
|
|
2425
|
-
onClick:
|
|
2425
|
+
onClick: V[5] || (V[5] = () => j())
|
|
2426
2426
|
}, null, 8, ["icon", "disabled"])
|
|
2427
2427
|
]),
|
|
2428
2428
|
_: 1
|
|
@@ -2436,7 +2436,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2436
2436
|
text: "",
|
|
2437
2437
|
icon: r(Ht),
|
|
2438
2438
|
disabled: r(e) <= $.minScale,
|
|
2439
|
-
onClick:
|
|
2439
|
+
onClick: V[6] || (V[6] = () => Y())
|
|
2440
2440
|
}, null, 8, ["icon", "disabled"])
|
|
2441
2441
|
]),
|
|
2442
2442
|
_: 1
|
|
@@ -2463,7 +2463,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2463
2463
|
z(r(te), {
|
|
2464
2464
|
text: "",
|
|
2465
2465
|
icon: r(Wt),
|
|
2466
|
-
onClick:
|
|
2466
|
+
onClick: ge
|
|
2467
2467
|
}, null, 8, ["icon"])
|
|
2468
2468
|
]),
|
|
2469
2469
|
_: 1
|
|
@@ -2477,7 +2477,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2477
2477
|
z(r(te), {
|
|
2478
2478
|
text: "",
|
|
2479
2479
|
icon: r(Xt),
|
|
2480
|
-
onClick:
|
|
2480
|
+
onClick: V[7] || (V[7] = (ee) => we(90))
|
|
2481
2481
|
}, null, 8, ["icon"])
|
|
2482
2482
|
]),
|
|
2483
2483
|
_: 1
|
|
@@ -2490,7 +2490,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2490
2490
|
z(r(te), {
|
|
2491
2491
|
text: "",
|
|
2492
2492
|
icon: r(Yt),
|
|
2493
|
-
onClick:
|
|
2493
|
+
onClick: V[8] || (V[8] = (ee) => we(-90))
|
|
2494
2494
|
}, null, 8, ["icon"])
|
|
2495
2495
|
]),
|
|
2496
2496
|
_: 1
|
|
@@ -2552,7 +2552,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2552
2552
|
getImagePoint: f
|
|
2553
2553
|
} = xt();
|
|
2554
2554
|
let _ = 0;
|
|
2555
|
-
const $ = u, B =
|
|
2555
|
+
const $ = u, B = ue(null), M = b(() => ({
|
|
2556
2556
|
transform: `scale(${n.value})`,
|
|
2557
2557
|
marginInlineStart: `${t.value.x}px`,
|
|
2558
2558
|
marginBlockStart: `${t.value.y}px`
|
|
@@ -2563,9 +2563,9 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2563
2563
|
$e(I);
|
|
2564
2564
|
}
|
|
2565
2565
|
), le(() => {
|
|
2566
|
-
document.addEventListener("pointermove",
|
|
2566
|
+
document.addEventListener("pointermove", U), document.addEventListener("pointerup", d);
|
|
2567
2567
|
}), ye(() => {
|
|
2568
|
-
document.removeEventListener("pointermove",
|
|
2568
|
+
document.removeEventListener("pointermove", U), document.removeEventListener("pointerup", d);
|
|
2569
2569
|
});
|
|
2570
2570
|
function I() {
|
|
2571
2571
|
const x = a.value;
|
|
@@ -2575,9 +2575,9 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2575
2575
|
_ = Math.max(j, Y), n.value = _;
|
|
2576
2576
|
}
|
|
2577
2577
|
function L(x) {
|
|
2578
|
-
x.deltaY < 0 ? ne(x.x, x.y) :
|
|
2578
|
+
x.deltaY < 0 ? ne(x.x, x.y) : F(x.x, x.y);
|
|
2579
2579
|
}
|
|
2580
|
-
function
|
|
2580
|
+
function U(x) {
|
|
2581
2581
|
!s.value || x.pointerType === "touch" || (m(x.x, x.y), C());
|
|
2582
2582
|
}
|
|
2583
2583
|
function W(x) {
|
|
@@ -2600,7 +2600,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2600
2600
|
const q = Math.min($.maxScale, n.value * (1 + 0.1));
|
|
2601
2601
|
k(x, g, q);
|
|
2602
2602
|
}
|
|
2603
|
-
function
|
|
2603
|
+
function F(x, g) {
|
|
2604
2604
|
if (n.value <= _) return;
|
|
2605
2605
|
const q = Math.max(_, n.value / (1 + 0.1));
|
|
2606
2606
|
k(x, g, q);
|
|
@@ -2626,7 +2626,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2626
2626
|
let D = document.createElement("canvas");
|
|
2627
2627
|
D.style.display = "none", $.aspectRatio >= O ? (D.width = g, D.height = g / $.aspectRatio) : (D.width = q * $.aspectRatio, D.height = q);
|
|
2628
2628
|
let G = D.getContext("2d");
|
|
2629
|
-
const ce = a.value.getBoundingClientRect(),
|
|
2629
|
+
const ce = a.value.getBoundingClientRect(), ge = B.value.getBoundingClientRect(), we = (ce.left - ge.left) / n.value, je = (ce.top - ge.top) / n.value;
|
|
2630
2630
|
return G == null || G.drawImage(
|
|
2631
2631
|
a.value,
|
|
2632
2632
|
we * A,
|
|
@@ -2634,8 +2634,8 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2634
2634
|
g * A,
|
|
2635
2635
|
q * A
|
|
2636
2636
|
), new Promise((K) => {
|
|
2637
|
-
x === "base64" ? K(D.toDataURL("image/png")) : D == null || D.toBlob((
|
|
2638
|
-
K(
|
|
2637
|
+
x === "base64" ? K(D.toDataURL("image/png")) : D == null || D.toBlob((V) => {
|
|
2638
|
+
K(V ?? void 0);
|
|
2639
2639
|
}, "image/png");
|
|
2640
2640
|
}).finally(() => {
|
|
2641
2641
|
G = void 0, D = void 0;
|
|
@@ -2644,7 +2644,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2644
2644
|
return o({ cropImageAsync: y }), (x, g) => (v(), w("div", {
|
|
2645
2645
|
class: "sq-image-crop",
|
|
2646
2646
|
style: J({ "--image-crop-ratio": $.aspectRatio }),
|
|
2647
|
-
onWheel:
|
|
2647
|
+
onWheel: be(L, ["prevent", "stop"]),
|
|
2648
2648
|
onPointerdown: g[0] || (g[0] = //@ts-ignore
|
|
2649
2649
|
(...q) => r(c) && r(c)(...q)),
|
|
2650
2650
|
onTouchstartPassive: g[1] || (g[1] = //@ts-ignore
|
|
@@ -2702,16 +2702,16 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2702
2702
|
}),
|
|
2703
2703
|
emits: /* @__PURE__ */ Z(["click", "focus", "blur", "input", "change", "clear"], ["update:value"]),
|
|
2704
2704
|
setup(u, { expose: o, emit: s }) {
|
|
2705
|
-
const e = Ne(), n = s, t = u, { inputSize: a, inputRound: c, inputDisabled: d, inputReadonly: l, id: i } = Tn(t), p = ae(u, "value"), m = T(!1), h = T(!1), f =
|
|
2706
|
-
const A = [], D = r(a), G = r(c), ce = r(
|
|
2705
|
+
const e = Ne(), n = s, t = u, { inputSize: a, inputRound: c, inputDisabled: d, inputReadonly: l, id: i } = Tn(t), p = ae(u, "value"), m = T(!1), h = T(!1), f = ue(null), _ = b(() => {
|
|
2706
|
+
const A = [], D = r(a), G = r(c), ce = r(F);
|
|
2707
2707
|
return D !== "md" && A.push(`sq-input--${D}`), t.status && A.push(`is-${t.status}`), G && A.push("is-round"), ce && A.push("is-disabled"), A;
|
|
2708
2708
|
}), $ = b(() => r(h) ? ht : gt), B = b(() => r(h) ? "text" : t.type), M = b(() => e.prefix || t.prefixIcon), I = b(() => r(m) && r(p).length), L = b(
|
|
2709
2709
|
() => t.type === "password" && r(I)
|
|
2710
|
-
),
|
|
2711
|
-
() => r(L) || r(
|
|
2712
|
-
),
|
|
2710
|
+
), U = b(() => t.clearable && r(I)), W = b(() => t.loading ? Ue : t.suffixIcon), ne = b(
|
|
2711
|
+
() => r(L) || r(U) || r(W) || e.suffix
|
|
2712
|
+
), F = b(() => t.loading || r(d)), k = b(() => {
|
|
2713
2713
|
if (t.type === "textarea")
|
|
2714
|
-
return r(
|
|
2714
|
+
return r(F) || r(l) ? "none" : t.resize;
|
|
2715
2715
|
});
|
|
2716
2716
|
function C(A) {
|
|
2717
2717
|
n("focus", A), !r(l) && (m.value = !0);
|
|
@@ -2749,12 +2749,12 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2749
2749
|
(v(), S(fe(t.prefixIcon)))
|
|
2750
2750
|
])
|
|
2751
2751
|
])) : P("", !0),
|
|
2752
|
-
t.type !== "textarea" ?
|
|
2752
|
+
t.type !== "textarea" ? re((v(), w("input", {
|
|
2753
2753
|
key: 1,
|
|
2754
2754
|
class: "sq-input-inner",
|
|
2755
2755
|
"onUpdate:modelValue": D[0] || (D[0] = (G) => p.value = G),
|
|
2756
2756
|
id: r(i),
|
|
2757
|
-
disabled:
|
|
2757
|
+
disabled: F.value,
|
|
2758
2758
|
readonly: r(l),
|
|
2759
2759
|
placeholder: t.placeholder,
|
|
2760
2760
|
type: B.value,
|
|
@@ -2773,13 +2773,13 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2773
2773
|
onChange: D[2] || (D[2] = (G) => n("change", G))
|
|
2774
2774
|
}, null, 40, Us)), [
|
|
2775
2775
|
[zt, p.value]
|
|
2776
|
-
]) :
|
|
2776
|
+
]) : re((v(), w("textarea", {
|
|
2777
2777
|
key: 2,
|
|
2778
2778
|
class: "sq-input-inner",
|
|
2779
2779
|
style: J({ resize: k.value }),
|
|
2780
2780
|
"onUpdate:modelValue": D[3] || (D[3] = (G) => p.value = G),
|
|
2781
2781
|
id: r(i),
|
|
2782
|
-
disabled:
|
|
2782
|
+
disabled: F.value,
|
|
2783
2783
|
readonly: r(l),
|
|
2784
2784
|
placeholder: t.placeholder,
|
|
2785
2785
|
type: B.value,
|
|
@@ -2801,13 +2801,13 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2801
2801
|
}, null, 44, Fs)), [
|
|
2802
2802
|
[Rt, p.value]
|
|
2803
2803
|
]),
|
|
2804
|
-
|
|
2804
|
+
re(E("span", Hs, [
|
|
2805
2805
|
L.value ? (v(), S(fe($.value), {
|
|
2806
2806
|
key: 0,
|
|
2807
2807
|
class: "sq-input-suffix-pwd",
|
|
2808
2808
|
onPointerdown: O
|
|
2809
2809
|
}, null, 32)) : P("", !0),
|
|
2810
|
-
|
|
2810
|
+
U.value ? (v(), S(r(Je), {
|
|
2811
2811
|
key: 1,
|
|
2812
2812
|
class: "sq-input-suffix-clear",
|
|
2813
2813
|
onPointerdown: q
|
|
@@ -2816,7 +2816,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2816
2816
|
W.value ? (v(), S(fe(W.value), { key: 0 })) : P("", !0)
|
|
2817
2817
|
])
|
|
2818
2818
|
], 512), [
|
|
2819
|
-
[
|
|
2819
|
+
[he, ne.value]
|
|
2820
2820
|
])
|
|
2821
2821
|
], 34));
|
|
2822
2822
|
}
|
|
@@ -2858,13 +2858,13 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2858
2858
|
E("span", {
|
|
2859
2859
|
textContent: Q(r(s)(p))
|
|
2860
2860
|
}, null, 8, Xs),
|
|
2861
|
-
n.direction === "vertical" ?
|
|
2861
|
+
n.direction === "vertical" ? re((v(), S(r(it), {
|
|
2862
2862
|
key: 1,
|
|
2863
2863
|
dot: "",
|
|
2864
2864
|
"show-zero": "",
|
|
2865
2865
|
type: "primary"
|
|
2866
2866
|
}, null, 512)), [
|
|
2867
|
-
[
|
|
2867
|
+
[he, h]
|
|
2868
2868
|
]) : P("", !0)
|
|
2869
2869
|
])
|
|
2870
2870
|
], 10, Ws)
|
|
@@ -2883,13 +2883,13 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2883
2883
|
E("span", {
|
|
2884
2884
|
textContent: Q(r(s)(p))
|
|
2885
2885
|
}, null, 8, Ks),
|
|
2886
|
-
n.direction === "vertical" ?
|
|
2886
|
+
n.direction === "vertical" ? re((v(), S(r(it), {
|
|
2887
2887
|
key: 1,
|
|
2888
2888
|
dot: "",
|
|
2889
2889
|
"show-zero": "",
|
|
2890
2890
|
type: "primary"
|
|
2891
2891
|
}, null, 512)), [
|
|
2892
|
-
[
|
|
2892
|
+
[he, t.value === p.value]
|
|
2893
2893
|
]) : P("", !0)
|
|
2894
2894
|
])
|
|
2895
2895
|
], 10, Ys))), 128))
|
|
@@ -2922,7 +2922,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2922
2922
|
onAfterLeave: s.onDestroy
|
|
2923
2923
|
}, {
|
|
2924
2924
|
default: N(() => [
|
|
2925
|
-
|
|
2925
|
+
re(E("div", {
|
|
2926
2926
|
class: X(["sq-message", `is-${s.type}`]),
|
|
2927
2927
|
id: s.id,
|
|
2928
2928
|
style: J({ top: `${s.offsetTop}px` })
|
|
@@ -2941,7 +2941,7 @@ ${ce}${G}`, ne(x.target), y(t.value, we, we);
|
|
|
2941
2941
|
_: 1
|
|
2942
2942
|
})
|
|
2943
2943
|
], 14, Zs), [
|
|
2944
|
-
[
|
|
2944
|
+
[he, e.value]
|
|
2945
2945
|
])
|
|
2946
2946
|
]),
|
|
2947
2947
|
_: 1
|
|
@@ -3277,7 +3277,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3277
3277
|
setup(u, { emit: o }) {
|
|
3278
3278
|
const { getCssVar: s } = He(), { nextZIndex: e } = et(), n = Ze(), t = parseInt(s("--sq-padding-sm")), a = parseInt(s("--sq-padding-md"));
|
|
3279
3279
|
let c, d, l = !1;
|
|
3280
|
-
const i = o, p = u, m = ae(u, "visible"), h = T(0), f = T({}), _ = T(!1), $ =
|
|
3280
|
+
const i = o, p = u, m = ae(u, "visible"), h = T(0), f = T({}), _ = T(!1), $ = ue(null), B = ue(null), M = b(() => {
|
|
3281
3281
|
const C = [];
|
|
3282
3282
|
return p.shadow && C.push("has-shadow"), [C];
|
|
3283
3283
|
});
|
|
@@ -3289,13 +3289,13 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3289
3289
|
_.value = C;
|
|
3290
3290
|
}, y);
|
|
3291
3291
|
}), ie(_, (C) => {
|
|
3292
|
-
C ? (h.value = e(),
|
|
3292
|
+
C ? (h.value = e(), F(), d = tn(
|
|
3293
3293
|
$.value.$el,
|
|
3294
3294
|
B.value,
|
|
3295
|
-
|
|
3295
|
+
F
|
|
3296
3296
|
)) : d == null || d(), i("openChange", C);
|
|
3297
3297
|
}), le(() => {
|
|
3298
|
-
|
|
3298
|
+
F();
|
|
3299
3299
|
}), ye(() => {
|
|
3300
3300
|
k(), document.removeEventListener("click", ne);
|
|
3301
3301
|
});
|
|
@@ -3305,7 +3305,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3305
3305
|
function L() {
|
|
3306
3306
|
p.trigger === "hover" && ne();
|
|
3307
3307
|
}
|
|
3308
|
-
function
|
|
3308
|
+
function U(C) {
|
|
3309
3309
|
p.trigger === "click" && !p.disabled && !m.value && (C.stopPropagation(), W());
|
|
3310
3310
|
}
|
|
3311
3311
|
function W(C = !0) {
|
|
@@ -3314,7 +3314,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3314
3314
|
function ne() {
|
|
3315
3315
|
m.value = !1, document.removeEventListener("click", ne);
|
|
3316
3316
|
}
|
|
3317
|
-
async function
|
|
3317
|
+
async function F() {
|
|
3318
3318
|
var O, j;
|
|
3319
3319
|
const C = typeof ((O = $.value) == null ? void 0 : O.$el.getBoundingClientRect), y = typeof ((j = B.value) == null ? void 0 : j.getBoundingClientRect);
|
|
3320
3320
|
if (C !== "function" || y !== "function") return;
|
|
@@ -3342,7 +3342,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3342
3342
|
ref: $,
|
|
3343
3343
|
onMouseenter: I,
|
|
3344
3344
|
onMouseleave: L,
|
|
3345
|
-
onClick:
|
|
3345
|
+
onClick: U
|
|
3346
3346
|
}, {
|
|
3347
3347
|
default: N(() => [
|
|
3348
3348
|
H(C.$slots, "reference")
|
|
@@ -3357,17 +3357,17 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3357
3357
|
name: p.transition
|
|
3358
3358
|
}, {
|
|
3359
3359
|
default: N(() => [
|
|
3360
|
-
|
|
3360
|
+
re(E("div", {
|
|
3361
3361
|
class: X(["sq-popover", [M.value, p.popoverClass]]),
|
|
3362
3362
|
style: J([{ ...f.value, zIndex: h.value }, p.popoverStyle]),
|
|
3363
3363
|
ref_key: "popverRef",
|
|
3364
3364
|
ref: B,
|
|
3365
|
-
onClick: y[0] || (y[0] =
|
|
3365
|
+
onClick: y[0] || (y[0] = be(() => {
|
|
3366
3366
|
}, ["stop"]))
|
|
3367
3367
|
}, [
|
|
3368
3368
|
H(C.$slots, "default")
|
|
3369
3369
|
], 6), [
|
|
3370
|
-
[
|
|
3370
|
+
[he, _.value]
|
|
3371
3371
|
])
|
|
3372
3372
|
]),
|
|
3373
3373
|
_: 3
|
|
@@ -3392,7 +3392,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3392
3392
|
label: { type: Boolean, default: !0 }
|
|
3393
3393
|
},
|
|
3394
3394
|
setup(u) {
|
|
3395
|
-
const o = new ResizeObserver(l), s = u, e = T(100), n =
|
|
3395
|
+
const o = new ResizeObserver(l), s = u, e = T(100), n = ue(null), t = b(() => {
|
|
3396
3396
|
const i = [];
|
|
3397
3397
|
return s.color || i.push(`is-${s.type}`), s.variant && i.push(`is-${s.variant}`), i;
|
|
3398
3398
|
}), a = b(() => {
|
|
@@ -3499,7 +3499,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3499
3499
|
}), (f, _) => (v(), w("label", {
|
|
3500
3500
|
class: X(["sq-selection sq-radio", m.value])
|
|
3501
3501
|
}, [
|
|
3502
|
-
|
|
3502
|
+
re(E("input", {
|
|
3503
3503
|
type: "radio",
|
|
3504
3504
|
autofocus: e.autofocus,
|
|
3505
3505
|
name: r(c),
|
|
@@ -3640,7 +3640,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3640
3640
|
disabled: { type: Boolean }
|
|
3641
3641
|
},
|
|
3642
3642
|
setup(u) {
|
|
3643
|
-
const o = u, { segmentedDisabled: s, parentContext: e } = Rn(o), { getText: n } = Ae(), t = T(), a =
|
|
3643
|
+
const o = u, { segmentedDisabled: s, parentContext: e } = Rn(o), { getText: n } = Ae(), t = T(), a = ue(null), c = b(() => {
|
|
3644
3644
|
const p = [], m = r(s);
|
|
3645
3645
|
return d.value && p.push("is-active"), m && p.push("is-disabled"), p;
|
|
3646
3646
|
}), d = b(() => r(e).active === o.value), l = b(() => r(e).size !== "sm" ? "md" : "sm");
|
|
@@ -3662,7 +3662,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3662
3662
|
ref_key: "itemRef",
|
|
3663
3663
|
ref: a
|
|
3664
3664
|
}, [
|
|
3665
|
-
|
|
3665
|
+
re(E("input", {
|
|
3666
3666
|
type: "radio",
|
|
3667
3667
|
name: (h = r(e)) == null ? void 0 : h.name,
|
|
3668
3668
|
value: o.value,
|
|
@@ -3735,7 +3735,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3735
3735
|
setup(u, { emit: o }) {
|
|
3736
3736
|
const { getText: s } = Ae();
|
|
3737
3737
|
let e = "";
|
|
3738
|
-
const n = o, t = u, a = T(!1), c = T(), d = T(""), l =
|
|
3738
|
+
const n = o, t = u, a = T(!1), c = T(), d = T(""), l = ue(null), i = ae(u, "value"), p = b(() => t.items.map((L) => typeof L == "string" ? {
|
|
3739
3739
|
text: L,
|
|
3740
3740
|
value: L
|
|
3741
3741
|
} : L));
|
|
@@ -3753,14 +3753,14 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3753
3753
|
function m(L) {
|
|
3754
3754
|
var W;
|
|
3755
3755
|
if (!L || typeof c.value < "u") return;
|
|
3756
|
-
const
|
|
3757
|
-
c.value =
|
|
3756
|
+
const U = (W = l.value) == null ? void 0 : W.$el;
|
|
3757
|
+
c.value = U.getBoundingClientRect().width;
|
|
3758
3758
|
}
|
|
3759
3759
|
function h(L) {
|
|
3760
3760
|
a.value && (i.value = L, a.value = !1, n("select", L));
|
|
3761
3761
|
}
|
|
3762
3762
|
function f() {
|
|
3763
|
-
const L = p.value.find((
|
|
3763
|
+
const L = p.value.find((U) => U.value === i.value);
|
|
3764
3764
|
if (!L) {
|
|
3765
3765
|
d.value = "";
|
|
3766
3766
|
return;
|
|
@@ -3782,7 +3782,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3782
3782
|
function I() {
|
|
3783
3783
|
d.value = e;
|
|
3784
3784
|
}
|
|
3785
|
-
return (L,
|
|
3785
|
+
return (L, U) => (v(), S(r(Ct), {
|
|
3786
3786
|
class: X(["sq-select", { "dropdown-opened": a.value }]),
|
|
3787
3787
|
placement: "bottom-start",
|
|
3788
3788
|
trigger: "manual",
|
|
@@ -3791,13 +3791,13 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3791
3791
|
"hide-after": 100,
|
|
3792
3792
|
"popover-style": { width: `${c.value}px` },
|
|
3793
3793
|
visible: a.value,
|
|
3794
|
-
"onUpdate:visible":
|
|
3794
|
+
"onUpdate:visible": U[3] || (U[3] = (W) => a.value = W),
|
|
3795
3795
|
onOpenChange: m
|
|
3796
3796
|
}, {
|
|
3797
3797
|
reference: N(() => [
|
|
3798
3798
|
z(r(nt), {
|
|
3799
3799
|
value: d.value,
|
|
3800
|
-
"onUpdate:value":
|
|
3800
|
+
"onUpdate:value": U[0] || (U[0] = (W) => d.value = W),
|
|
3801
3801
|
disabled: t.disabled,
|
|
3802
3802
|
placeholder: t.placeholder,
|
|
3803
3803
|
"prefix-icon": t.prefixIcon,
|
|
@@ -3821,7 +3821,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3821
3821
|
default: N(() => [
|
|
3822
3822
|
p.value.length ? (v(), w("menu", {
|
|
3823
3823
|
key: 1,
|
|
3824
|
-
onMousedown:
|
|
3824
|
+
onMousedown: U[2] || (U[2] = be(() => {
|
|
3825
3825
|
}, ["prevent"]))
|
|
3826
3826
|
}, [
|
|
3827
3827
|
(v(!0), w(se, null, pe(p.value, (W) => (v(), S(Uo, ve({
|
|
@@ -3831,7 +3831,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3831
3831
|
key: 0,
|
|
3832
3832
|
class: "sq-select-dropdown-empty",
|
|
3833
3833
|
textContent: Q(t.emptyText),
|
|
3834
|
-
onMousedown:
|
|
3834
|
+
onMousedown: U[1] || (U[1] = be(() => {
|
|
3835
3835
|
}, ["prevent", "stop"]))
|
|
3836
3836
|
}, null, 40, Fo))
|
|
3837
3837
|
]),
|
|
@@ -3861,66 +3861,63 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3861
3861
|
setup(u, { emit: o }) {
|
|
3862
3862
|
const { getCssVar: s } = He(), e = { x: 0, y: 0 }, n = s("--sq-component-size-md"), t = parseInt(n), a = t / 2;
|
|
3863
3863
|
let c = !1, d = 0, l = [0, 0];
|
|
3864
|
-
const i = o, p = u, m = T(0), h =
|
|
3865
|
-
const
|
|
3866
|
-
return
|
|
3867
|
-
}), $ = b(() => {
|
|
3868
|
-
const V = {}, k = p.direction === "horizontal" ? "left" : "top";
|
|
3869
|
-
return V[k] = `${m.value}px`, V;
|
|
3864
|
+
const i = o, p = u, m = T(0), h = ue(null), f = ae(u, "value"), _ = b(() => [`sq-swipe-${p.direction}`]), $ = b(() => {
|
|
3865
|
+
const F = {}, k = p.direction === "horizontal" ? "left" : "top";
|
|
3866
|
+
return F[k] = `${m.value}px`, F;
|
|
3870
3867
|
}), B = b(
|
|
3871
3868
|
() => p.direction === "horizontal" ? "right" : "bottom"
|
|
3872
|
-
), M = b(() => `linear-gradient(${[
|
|
3869
|
+
), M = b(() => p.disabled ? void 0 : `linear-gradient(${[
|
|
3873
3870
|
`to ${B.value}`,
|
|
3874
3871
|
`#000 ${m.value}px`,
|
|
3875
3872
|
`transparent ${m.value + 1}px`
|
|
3876
|
-
].join(",")})`), I = b(() => `linear-gradient(${[
|
|
3873
|
+
].join(",")})`), I = b(() => p.disabled ? void 0 : `linear-gradient(${[
|
|
3877
3874
|
`to ${B.value}`,
|
|
3878
3875
|
`transparent ${m.value}px`,
|
|
3879
3876
|
`#000 ${m.value + 1}px`
|
|
3880
3877
|
].join(",")})`);
|
|
3881
3878
|
le(() => {
|
|
3882
|
-
const
|
|
3879
|
+
const F = h.value.getBoundingClientRect(), k = f.value >= 0 && f.value <= 1 ? f.value : 0.5;
|
|
3883
3880
|
if (p.direction === "horizontal") {
|
|
3884
|
-
l = [a,
|
|
3885
|
-
const C = (
|
|
3881
|
+
l = [a, F.width - a];
|
|
3882
|
+
const C = (F.width - t) * k;
|
|
3886
3883
|
m.value = a + C;
|
|
3887
3884
|
} else {
|
|
3888
|
-
l = [a,
|
|
3889
|
-
const C = (
|
|
3885
|
+
l = [a, F.height - a];
|
|
3886
|
+
const C = (F.height - t) * k;
|
|
3890
3887
|
m.value = a + C;
|
|
3891
3888
|
}
|
|
3892
|
-
d = m.value, document.addEventListener("pointermove", W), document.addEventListener("pointerup",
|
|
3889
|
+
d = m.value, document.addEventListener("pointermove", W), document.addEventListener("pointerup", U);
|
|
3893
3890
|
}), ye(() => {
|
|
3894
|
-
document.removeEventListener("pointermove", W), document.removeEventListener("pointerup",
|
|
3891
|
+
document.removeEventListener("pointermove", W), document.removeEventListener("pointerup", U);
|
|
3895
3892
|
});
|
|
3896
|
-
function L(
|
|
3897
|
-
c = !0, e.x =
|
|
3893
|
+
function L(F) {
|
|
3894
|
+
c = !0, e.x = F.x, e.y = F.y;
|
|
3898
3895
|
}
|
|
3899
|
-
function
|
|
3896
|
+
function U() {
|
|
3900
3897
|
c = !1;
|
|
3901
3898
|
}
|
|
3902
|
-
function W(
|
|
3903
|
-
c && ne(
|
|
3899
|
+
function W(F) {
|
|
3900
|
+
c && ne(F.x, F.y);
|
|
3904
3901
|
}
|
|
3905
|
-
function ne(
|
|
3902
|
+
function ne(F, k) {
|
|
3906
3903
|
let C = 0;
|
|
3907
|
-
p.direction === "horizontal" ? (C = e.x -
|
|
3904
|
+
p.direction === "horizontal" ? (C = e.x - F, e.x = F) : (C = e.y - k, e.y = k);
|
|
3908
3905
|
const [y, x] = l;
|
|
3909
3906
|
d -= C;
|
|
3910
3907
|
const g = m.value;
|
|
3911
3908
|
d < y ? m.value = y : d > x ? m.value = x : m.value = d, g !== m.value && (f.value = (m.value - a) / (x - y), i("change", m.value / (x + a)));
|
|
3912
3909
|
}
|
|
3913
|
-
return (
|
|
3910
|
+
return (F, k) => (v(), w("div", {
|
|
3914
3911
|
class: X(["sq-swipe", _.value]),
|
|
3915
3912
|
ref_key: "swipeRef",
|
|
3916
3913
|
ref: h
|
|
3917
3914
|
}, [
|
|
3918
|
-
H(
|
|
3915
|
+
H(F.$slots, "default", {}, () => [
|
|
3919
3916
|
E("div", {
|
|
3920
3917
|
class: "sq-swipe-top",
|
|
3921
3918
|
style: J({ mask: M.value })
|
|
3922
3919
|
}, [
|
|
3923
|
-
H(
|
|
3920
|
+
H(F.$slots, "top", {}, () => [
|
|
3924
3921
|
p.topSrc ? (v(), S(r(Ke), {
|
|
3925
3922
|
key: 0,
|
|
3926
3923
|
src: p.topSrc,
|
|
@@ -3932,7 +3929,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3932
3929
|
class: "sq-swipe-bottom",
|
|
3933
3930
|
style: J({ mask: I.value })
|
|
3934
3931
|
}, [
|
|
3935
|
-
H(
|
|
3932
|
+
H(F.$slots, "bottom", {}, () => [
|
|
3936
3933
|
p.bottomSrc ? (v(), S(r(Ke), {
|
|
3937
3934
|
key: 0,
|
|
3938
3935
|
src: p.bottomSrc,
|
|
@@ -3941,7 +3938,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3941
3938
|
])
|
|
3942
3939
|
], 4)
|
|
3943
3940
|
]),
|
|
3944
|
-
E("div", {
|
|
3941
|
+
re(E("div", {
|
|
3945
3942
|
class: "sq-swipe-separator",
|
|
3946
3943
|
style: J($.value)
|
|
3947
3944
|
}, [
|
|
@@ -3949,7 +3946,9 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3949
3946
|
class: "sq-swipe-slider",
|
|
3950
3947
|
onPointerdown: L
|
|
3951
3948
|
}, null, 32)
|
|
3952
|
-
], 4)
|
|
3949
|
+
], 4), [
|
|
3950
|
+
[he, !p.disabled]
|
|
3951
|
+
])
|
|
3953
3952
|
], 2));
|
|
3954
3953
|
}
|
|
3955
3954
|
}), Xo = ["id", "autofocus", "name", "form", "disabled"], Yo = { class: "sq-switch-track" }, Ko = { class: "sq-switch-thumb" }, Go = "sq-switch", Zo = /* @__PURE__ */ R({
|
|
@@ -3976,7 +3975,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
3976
3975
|
return (l, i) => (v(), w("label", {
|
|
3977
3976
|
class: X(["sq-switch", d.value])
|
|
3978
3977
|
}, [
|
|
3979
|
-
|
|
3978
|
+
re(E("input", {
|
|
3980
3979
|
type: "checkbox",
|
|
3981
3980
|
"onUpdate:modelValue": i[0] || (i[0] = (p) => c.value = p),
|
|
3982
3981
|
id: r(a),
|
|
@@ -4022,7 +4021,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
4022
4021
|
cols: { default: () => [] }
|
|
4023
4022
|
},
|
|
4024
4023
|
setup(u) {
|
|
4025
|
-
const { getCssUnit: o } = He(), s = new ResizeObserver(l), e = u, n = T(!1), t =
|
|
4024
|
+
const { getCssUnit: o } = He(), s = new ResizeObserver(l), e = u, n = T(!1), t = ue(null), a = b(() => {
|
|
4026
4025
|
const h = [];
|
|
4027
4026
|
return e.stripe && h.push("is-striped"), e.border && h.push("has-border"), h;
|
|
4028
4027
|
}), c = b(() => ({
|
|
@@ -4083,7 +4082,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
4083
4082
|
}, null, 8, ta)
|
|
4084
4083
|
], 4))), 128))
|
|
4085
4084
|
], 4),
|
|
4086
|
-
|
|
4085
|
+
re(E("div", {
|
|
4087
4086
|
class: "sq-table-body",
|
|
4088
4087
|
ref_key: "bodyRef",
|
|
4089
4088
|
ref: t
|
|
@@ -4108,7 +4107,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
4108
4107
|
], 6))), 128))
|
|
4109
4108
|
], 4))), 128))
|
|
4110
4109
|
], 512), [
|
|
4111
|
-
[
|
|
4110
|
+
[he, e.data.length]
|
|
4112
4111
|
]),
|
|
4113
4112
|
e.data.length ? P("", !0) : (v(), w("div", sa, [
|
|
4114
4113
|
H(h.$slots, "empty", {}, () => [
|
|
@@ -4304,7 +4303,7 @@ const ko = "sq-popover", Ct = /* @__PURE__ */ R({
|
|
|
4304
4303
|
},
|
|
4305
4304
|
emits: ["change"],
|
|
4306
4305
|
setup(u, { expose: o, emit: s }) {
|
|
4307
|
-
const e = s, n = u, t =
|
|
4306
|
+
const e = s, n = u, t = ue(null);
|
|
4308
4307
|
function a() {
|
|
4309
4308
|
var m;
|
|
4310
4309
|
i(((m = t.value) == null ? void 0 : m.files) ?? void 0);
|