@squirrel-cloud/ui-vue 0.5.3 → 0.5.4
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 +39 -39
- 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 w, normalizeStyle as G, onBeforeUnmount as ye, Transition as we, 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 ke, 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 = {
|
|
@@ -410,10 +410,10 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
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;
|
|
@@ -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;
|
|
@@ -982,14 +982,14 @@ 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
994
|
}), (v, f) => (m(), w("label", {
|
|
995
995
|
class: W(["sq-selection sq-checkbox", p.value])
|
|
@@ -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])];
|
|
@@ -1088,7 +1088,7 @@ 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;
|
|
@@ -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(() => {
|
|
@@ -1672,7 +1672,7 @@ 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);
|
|
@@ -1904,12 +1904,12 @@ ${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() {
|
|
@@ -1985,7 +1985,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1985
1985
|
const k = t.step;
|
|
1986
1986
|
return k === void 0 ? t.items : t.items.filter((C) => C.step === void 0 ? C : Array.isArray(C.step) ? C.step.includes(k) : C.step === k);
|
|
1987
1987
|
});
|
|
1988
|
-
|
|
1988
|
+
oe(() => {
|
|
1989
1989
|
e = structuredClone(ze(t.formData));
|
|
1990
1990
|
});
|
|
1991
1991
|
function h(k) {
|
|
@@ -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();
|
|
@@ -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
|
ke(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);
|
|
@@ -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;
|
|
@@ -2908,7 +2908,7 @@ ${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() {
|
|
@@ -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() {
|
|
@@ -3280,20 +3280,20 @@ 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
3285
|
l = C, k();
|
|
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
|
k(), document.removeEventListener("click", te);
|
|
@@ -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();
|
|
@@ -3484,16 +3484,16 @@ 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
3498
|
}), (f, x) => (m(), w("label", {
|
|
3499
3499
|
class: W(["sq-selection sq-radio", h.value])
|
|
@@ -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);
|
|
@@ -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
|
});
|
|
@@ -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() {
|
|
@@ -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) {
|
|
@@ -3874,9 +3874,9 @@ 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);
|
|
@@ -4034,7 +4034,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4034
4034
|
...d.value,
|
|
4035
4035
|
paddingInlineEnd: n.value ? "6px" : "0"
|
|
4036
4036
|
}));
|
|
4037
|
-
|
|
4037
|
+
oe(() => {
|
|
4038
4038
|
s.observe(t.value);
|
|
4039
4039
|
}), ye(() => {
|
|
4040
4040
|
s.disconnect();
|