@squirrel-cloud/ui-vue 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +164 -157
- package/dist/types/components/code/code.d.ts +1 -1
- package/package.json +1 -5
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
|
|
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 M, createTextVNode as De, toDisplayString as Q, h as Pe, ref as T, watch as oe, onMounted as se, 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 ie, provide as Se, toRef as le, useModel as re, 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 = {
|
|
@@ -25,7 +25,7 @@ const Qe = {
|
|
|
25
25
|
class: W(["sq-alert", s.value])
|
|
26
26
|
}, {
|
|
27
27
|
default: N(() => [
|
|
28
|
-
e.value ? (m(), S(fe(e.value), { key: 0 })) :
|
|
28
|
+
e.value ? (m(), S(fe(e.value), { key: 0 })) : M("", !0),
|
|
29
29
|
De(" " + Q(o.text), 1)
|
|
30
30
|
]),
|
|
31
31
|
_: 1
|
|
@@ -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
|
|
183
|
+
var P, I, L, V, j, te, ne, k, 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":
|
|
@@ -207,7 +207,7 @@ function rn() {
|
|
|
207
207
|
};
|
|
208
208
|
if (p === "link_open") {
|
|
209
209
|
const O = r.attrGet("href") ?? "", H = document.location.origin;
|
|
210
|
-
O != null && O.startsWith("http") && !O.includes(H) && (q.attrs.target = "_blank", q.attrs.rel = "noopener noreferrer", q.attrs.dataOuter = "", (
|
|
210
|
+
O != null && O.startsWith("http") && !O.includes(H) && (q.attrs.target = "_blank", q.attrs.rel = "noopener noreferrer", q.attrs.dataOuter = "", (P = q.children) == null || P.push({ tag: At }));
|
|
211
211
|
}
|
|
212
212
|
if (p === "table_open") {
|
|
213
213
|
const O = {
|
|
@@ -410,7 +410,11 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
410
410
|
"input-checkbox": _t,
|
|
411
411
|
...c.customNodeMap
|
|
412
412
|
}));
|
|
413
|
-
|
|
413
|
+
oe(
|
|
414
|
+
() => [c.md, c.text, c.customNodeMap, c.plugins],
|
|
415
|
+
e
|
|
416
|
+
), se(e);
|
|
417
|
+
async function e() {
|
|
414
418
|
if (!c.md) {
|
|
415
419
|
o.value = Pe("article", { class: "sq-article" }, [
|
|
416
420
|
Pe("div", {
|
|
@@ -420,15 +424,16 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
420
424
|
]);
|
|
421
425
|
return;
|
|
422
426
|
}
|
|
423
|
-
const
|
|
424
|
-
if (!
|
|
427
|
+
const n = await dn(c.text, c.plugins);
|
|
428
|
+
if (!n) {
|
|
425
429
|
console.warn(
|
|
426
430
|
"[squirrel-cloud/ui-vue] SqArticle 组件 MD 解析依赖 markdown-it"
|
|
427
431
|
);
|
|
428
432
|
return;
|
|
429
433
|
}
|
|
430
|
-
o.value = fn(
|
|
431
|
-
}
|
|
434
|
+
o.value = fn(n, s.value);
|
|
435
|
+
}
|
|
436
|
+
return () => o.value;
|
|
432
437
|
}
|
|
433
438
|
}), mn = ["src", "alt"], hn = ["textContent"], gn = "sq-avatar", _a = /* @__PURE__ */ R({
|
|
434
439
|
name: gn,
|
|
@@ -451,7 +456,7 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
451
456
|
"--avatar-bg-color": d()
|
|
452
457
|
};
|
|
453
458
|
}), t = y(() => o.alt.charAt(0).toUpperCase());
|
|
454
|
-
|
|
459
|
+
oe(
|
|
455
460
|
() => o.src,
|
|
456
461
|
() => {
|
|
457
462
|
s.value = !0;
|
|
@@ -527,7 +532,7 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
527
532
|
type: (v = n.progressProps) == null ? void 0 : v.type,
|
|
528
533
|
stroke: (f = n.progressProps) == null ? void 0 : f.stroke,
|
|
529
534
|
color: (x = n.progressProps) == null ? void 0 : x.color
|
|
530
|
-
}, null, 8, ["value", "max", "type", "stroke", "color"])) :
|
|
535
|
+
}, null, 8, ["value", "max", "type", "stroke", "color"])) : M("", !0),
|
|
531
536
|
F(p.$slots, "default", {}, () => [
|
|
532
537
|
(m(), S(fe(n.icon)))
|
|
533
538
|
])
|
|
@@ -575,14 +580,14 @@ const { md2tokensAsync: dn, tokens2vueh: fn } = rn(), pn = "sq-article", vn = R(
|
|
|
575
580
|
key: 0,
|
|
576
581
|
class: "sq-badge-label-inner",
|
|
577
582
|
textContent: Q(a.value)
|
|
578
|
-
}, null, 8, xn)) :
|
|
583
|
+
}, null, 8, xn)) : M("", !0)
|
|
579
584
|
]),
|
|
580
585
|
_: 1
|
|
581
586
|
}, 8, ["name"])
|
|
582
587
|
]),
|
|
583
588
|
_: 1
|
|
584
589
|
}))
|
|
585
|
-
], 6)) :
|
|
590
|
+
], 6)) : M("", !0)
|
|
586
591
|
]),
|
|
587
592
|
_: 3
|
|
588
593
|
}));
|
|
@@ -704,23 +709,23 @@ function yt() {
|
|
|
704
709
|
function l(f) {
|
|
705
710
|
o.value = !1, e.value = void 0, f == null || f();
|
|
706
711
|
}
|
|
707
|
-
function r(f, x, $, B,
|
|
708
|
-
const I = s.value /
|
|
712
|
+
function r(f, x, $, B, P) {
|
|
713
|
+
const I = s.value / P, L = f * I, V = x * I, [j, te] = v($, B);
|
|
709
714
|
return [j - L, te - V];
|
|
710
715
|
}
|
|
711
716
|
function p(f, x) {
|
|
712
717
|
const $ = f - c.x, B = x - c.y;
|
|
713
718
|
c.x = f, c.y = x;
|
|
714
|
-
const
|
|
715
|
-
n.value.x =
|
|
719
|
+
const P = n.value.x + $ * 2, I = n.value.y + B * 2;
|
|
720
|
+
n.value.x = P, n.value.y = I;
|
|
716
721
|
}
|
|
717
722
|
function h(f, x) {
|
|
718
723
|
const $ = x.clientX - f.clientX, B = x.clientY - f.clientY;
|
|
719
724
|
return Math.sqrt($ * $ + B * B);
|
|
720
725
|
}
|
|
721
726
|
function v(f, x) {
|
|
722
|
-
const { left: $, top: B } = t.value.getBoundingClientRect(),
|
|
723
|
-
return [
|
|
727
|
+
const { left: $, top: B } = t.value.getBoundingClientRect(), P = f - $, I = x - B;
|
|
728
|
+
return [P, I];
|
|
724
729
|
}
|
|
725
730
|
return {
|
|
726
731
|
activePoint: c,
|
|
@@ -888,7 +893,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
888
893
|
size: i(t) === "lg" ? "md" : i(t)
|
|
889
894
|
}, {
|
|
890
895
|
default: N(() => [
|
|
891
|
-
r.value ? (m(), S(fe(r.value), { key: 0 })) :
|
|
896
|
+
r.value ? (m(), S(fe(r.value), { key: 0 })) : M("", !0),
|
|
892
897
|
F(h.$slots, "default")
|
|
893
898
|
]),
|
|
894
899
|
_: 3
|
|
@@ -909,10 +914,10 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
909
914
|
return Se(
|
|
910
915
|
xt,
|
|
911
916
|
T({
|
|
912
|
-
size:
|
|
913
|
-
type:
|
|
914
|
-
round:
|
|
915
|
-
disabled:
|
|
917
|
+
size: le(o, "size"),
|
|
918
|
+
type: le(o, "type"),
|
|
919
|
+
round: le(o, "round"),
|
|
920
|
+
disabled: le(o, "disabled")
|
|
916
921
|
})
|
|
917
922
|
), (s, e) => (m(), w("div", In, [
|
|
918
923
|
F(s.$slots, "default")
|
|
@@ -940,11 +945,11 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
940
945
|
textContent: Q(s.title)
|
|
941
946
|
}, null, 10, Pn),
|
|
942
947
|
F(e.$slots, "title")
|
|
943
|
-
])) :
|
|
948
|
+
])) : M("", !0),
|
|
944
949
|
F(e.$slots, "default"),
|
|
945
950
|
i(o).footer ? (m(), w("div", Dn, [
|
|
946
951
|
F(e.$slots, "footer")
|
|
947
|
-
])) :
|
|
952
|
+
])) : M("", !0)
|
|
948
953
|
]));
|
|
949
954
|
}
|
|
950
955
|
}), Nn = ["autofocus", "name", "form", "value", "disabled"], Un = ["textContent"], Vn = "sq-checkbox", _t = /* @__PURE__ */ R({
|
|
@@ -977,12 +982,12 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
977
982
|
const v = [], f = i(n), x = i(t), $ = i(u);
|
|
978
983
|
return f !== "md" && v.push(`sq-selection--${f}`), h.value && v.push("is-checked"), x && v.push("is-disabled"), $ && v.push(`is-${$}`), v;
|
|
979
984
|
}), h = y(() => l ? i(l).list.includes(e.value) : r.value);
|
|
980
|
-
return
|
|
985
|
+
return oe(h, (v) => {
|
|
981
986
|
if (r.value !== v) {
|
|
982
987
|
r.value = v;
|
|
983
988
|
return;
|
|
984
989
|
}
|
|
985
|
-
}),
|
|
990
|
+
}), oe(r, (v) => {
|
|
986
991
|
h.value !== v && l && l.value.toggleItem(e.value);
|
|
987
992
|
}), se(() => {
|
|
988
993
|
r.value = h.value;
|
|
@@ -1008,13 +1013,13 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1008
1013
|
h.value ? (m(), S(i(vt), {
|
|
1009
1014
|
key: 0,
|
|
1010
1015
|
class: "sq-checkbox-inner"
|
|
1011
|
-
})) :
|
|
1012
|
-
], 2)) :
|
|
1016
|
+
})) : M("", !0)
|
|
1017
|
+
], 2)) : M("", !0),
|
|
1013
1018
|
e.label ? (m(), w("span", {
|
|
1014
1019
|
key: 1,
|
|
1015
1020
|
class: "sq-selection-label",
|
|
1016
1021
|
textContent: Q(e.label)
|
|
1017
|
-
}, null, 8, Un)) :
|
|
1022
|
+
}, null, 8, Un)) : M("", !0)
|
|
1018
1023
|
], 2));
|
|
1019
1024
|
}
|
|
1020
1025
|
}), Fn = { class: "sq-checkbox-group sq-selection-group" }, Hn = "sq-checkbox-group", jn = /* @__PURE__ */ R({
|
|
@@ -1041,15 +1046,15 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1041
1046
|
Se(
|
|
1042
1047
|
$t,
|
|
1043
1048
|
T({
|
|
1044
|
-
form:
|
|
1049
|
+
form: le(t, "form"),
|
|
1045
1050
|
name: d,
|
|
1046
|
-
disabled:
|
|
1047
|
-
size:
|
|
1048
|
-
variant:
|
|
1051
|
+
disabled: le(t, "disabled"),
|
|
1052
|
+
size: le(t, "size"),
|
|
1053
|
+
variant: le(t, "variant"),
|
|
1049
1054
|
list: a,
|
|
1050
1055
|
toggleItem: l
|
|
1051
1056
|
})
|
|
1052
|
-
),
|
|
1057
|
+
), oe(
|
|
1053
1058
|
() => t.value,
|
|
1054
1059
|
(r) => {
|
|
1055
1060
|
const p = r || [], h = [.../* @__PURE__ */ new Set([...p, a.value])];
|
|
@@ -1061,7 +1066,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1061
1066
|
}
|
|
1062
1067
|
return (r, p) => (m(), w("div", Fn, [
|
|
1063
1068
|
F(r.$slots, "default", {}, () => [
|
|
1064
|
-
(m(!0), w(
|
|
1069
|
+
(m(!0), w(ae, null, pe(u.value, (h, v) => (m(), S(i(_t), {
|
|
1065
1070
|
key: v,
|
|
1066
1071
|
disabled: h.disabled === !0,
|
|
1067
1072
|
label: i(e)(h),
|
|
@@ -1079,23 +1084,25 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1079
1084
|
lang: {}
|
|
1080
1085
|
},
|
|
1081
1086
|
setup(c) {
|
|
1082
|
-
const { getHighlighterAsync: o, releaseHighlighter: s } = cn()
|
|
1087
|
+
const { getHighlighterAsync: o, releaseHighlighter: s } = cn();
|
|
1088
|
+
let e;
|
|
1089
|
+
const n = c, t = T(!1), a = y(() => e ? e.codeToHtml(n.code, {
|
|
1090
|
+
theme: n.theme,
|
|
1091
|
+
lang: n.lang
|
|
1092
|
+
}) : "");
|
|
1083
1093
|
return se(async () => {
|
|
1084
|
-
|
|
1085
|
-
if (!t) {
|
|
1094
|
+
if (e = await o(), !e) {
|
|
1086
1095
|
console.warn("[squirrel-cloud/ui-vue] SqCode 组件代码高亮依赖 shiki");
|
|
1087
1096
|
return;
|
|
1088
1097
|
}
|
|
1089
|
-
|
|
1090
|
-
theme: e.theme,
|
|
1091
|
-
lang: e.lang
|
|
1092
|
-
});
|
|
1098
|
+
t.value = !0;
|
|
1093
1099
|
}), ye(() => {
|
|
1094
1100
|
s();
|
|
1095
|
-
}), (
|
|
1101
|
+
}), (d, u) => t.value ? (m(), w("div", {
|
|
1102
|
+
key: 0,
|
|
1096
1103
|
class: "sq-code",
|
|
1097
|
-
innerHTML:
|
|
1098
|
-
}, null, 8, Wn));
|
|
1104
|
+
innerHTML: a.value
|
|
1105
|
+
}, null, 8, Wn)) : M("", !0);
|
|
1099
1106
|
}
|
|
1100
1107
|
}), Kn = "sq-mask", kt = /* @__PURE__ */ R({
|
|
1101
1108
|
name: Kn,
|
|
@@ -1114,7 +1121,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1114
1121
|
const { nextZIndex: s } = Je(), e = Ze();
|
|
1115
1122
|
let n;
|
|
1116
1123
|
const t = o, a = c, d = T(0), u = T(!1), l = re(c, "visible");
|
|
1117
|
-
u.value = l.value,
|
|
1124
|
+
u.value = l.value, oe(l, (v) => {
|
|
1118
1125
|
const f = document.scrollingElement;
|
|
1119
1126
|
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));
|
|
1120
1127
|
}), ye(() => {
|
|
@@ -1154,7 +1161,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1154
1161
|
F(v.$slots, "default")
|
|
1155
1162
|
], 16)), [
|
|
1156
1163
|
[he, l.value]
|
|
1157
|
-
]) :
|
|
1164
|
+
]) : M("", !0)
|
|
1158
1165
|
]),
|
|
1159
1166
|
_: 3
|
|
1160
1167
|
})
|
|
@@ -1190,8 +1197,8 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1190
1197
|
emits: /* @__PURE__ */ Z(["open", "opened", "close", "closed"], ["update:visible"]),
|
|
1191
1198
|
setup(c, { emit: o }) {
|
|
1192
1199
|
const s = Oe(), e = Ze(), n = o, t = c, a = T(!1), d = T(!1), u = re(c, "visible"), l = y(() => !!t.title || !!s.header), r = y(() => {
|
|
1193
|
-
const
|
|
1194
|
-
return t.type &&
|
|
1200
|
+
const P = [];
|
|
1201
|
+
return t.type && P.push(`is-${t.type}`), l.value && P.push("has-header"), [P];
|
|
1195
1202
|
}), p = y(() => t.type ? Qe[t.type] : void 0), h = y(() => ({
|
|
1196
1203
|
type: t.type ?? "primary",
|
|
1197
1204
|
loading: a.value && d.value,
|
|
@@ -1206,10 +1213,10 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1206
1213
|
})), f = y(
|
|
1207
1214
|
() => h.value.loading || v.value.loading || !u.value
|
|
1208
1215
|
);
|
|
1209
|
-
function x(
|
|
1216
|
+
function x(P) {
|
|
1210
1217
|
if (f.value) return !1;
|
|
1211
|
-
if (typeof
|
|
1212
|
-
const I =
|
|
1218
|
+
if (typeof P != "function") return !0;
|
|
1219
|
+
const I = P();
|
|
1213
1220
|
return I instanceof Promise ? (a.value = !0, I.finally(() => {
|
|
1214
1221
|
a.value = !1;
|
|
1215
1222
|
})) : I;
|
|
@@ -1221,7 +1228,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1221
1228
|
async function B() {
|
|
1222
1229
|
d.value = !0, await x(t.onOk) && (u.value = !1);
|
|
1223
1230
|
}
|
|
1224
|
-
return (
|
|
1231
|
+
return (P, I) => (m(), S(i(kt), {
|
|
1225
1232
|
visible: u.value,
|
|
1226
1233
|
"onUpdate:visible": I[0] || (I[0] = (L) => u.value = L),
|
|
1227
1234
|
"mask-closeable": t.maskCloseable,
|
|
@@ -1241,8 +1248,8 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1241
1248
|
p.value ? (m(), S(fe(p.value), {
|
|
1242
1249
|
key: 0,
|
|
1243
1250
|
class: "sq-dialog-header-icon"
|
|
1244
|
-
})) :
|
|
1245
|
-
F(
|
|
1251
|
+
})) : M("", !0),
|
|
1252
|
+
F(P.$slots, "header", {}, () => [
|
|
1246
1253
|
E("span", {
|
|
1247
1254
|
class: "sq-dialog-header-title",
|
|
1248
1255
|
textContent: Q(t.title)
|
|
@@ -1252,12 +1259,12 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1252
1259
|
class: "sq-dialog-close",
|
|
1253
1260
|
onClick: $
|
|
1254
1261
|
})
|
|
1255
|
-
])) :
|
|
1262
|
+
])) : M("", !0),
|
|
1256
1263
|
E("div", Qn, [
|
|
1257
|
-
F(
|
|
1264
|
+
F(P.$slots, "default")
|
|
1258
1265
|
]),
|
|
1259
1266
|
t.footer ? (m(), w("div", Jn, [
|
|
1260
|
-
F(
|
|
1267
|
+
F(P.$slots, "footer", {}, () => [
|
|
1261
1268
|
z(i(ee), ve(v.value, { onClick: $ }), {
|
|
1262
1269
|
default: N(() => [
|
|
1263
1270
|
De(Q(t.cancelText), 1)
|
|
@@ -1271,7 +1278,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1271
1278
|
_: 1
|
|
1272
1279
|
}, 16)
|
|
1273
1280
|
])
|
|
1274
|
-
])) :
|
|
1281
|
+
])) : M("", !0)
|
|
1275
1282
|
], 6)
|
|
1276
1283
|
]),
|
|
1277
1284
|
_: 3
|
|
@@ -1305,7 +1312,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1305
1312
|
F(n.$slots, "default")
|
|
1306
1313
|
]),
|
|
1307
1314
|
_: 3
|
|
1308
|
-
}, 8, ["ellipsis", "size"])) :
|
|
1315
|
+
}, 8, ["ellipsis", "size"])) : M("", !0)
|
|
1309
1316
|
], 6));
|
|
1310
1317
|
}
|
|
1311
1318
|
}), ss = "sq-editor-bold", os = /* @__PURE__ */ R({
|
|
@@ -1666,7 +1673,7 @@ const Rn = ["disabled", "form", "type"], Ln = "sq-button", ee = /* @__PURE__ */
|
|
|
1666
1673
|
`) && d.value !== " " && !e.disabled
|
|
1667
1674
|
), B = y(
|
|
1668
1675
|
() => u.value !== void 0 && !d.value.length && !e.disabled
|
|
1669
|
-
),
|
|
1676
|
+
), P = y(
|
|
1670
1677
|
() => typeof e.beforePreview == "function" ? e.beforePreview(f.value) : f.value
|
|
1671
1678
|
);
|
|
1672
1679
|
se(() => {
|
|
@@ -1777,7 +1784,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1777
1784
|
}, ["stop"]))
|
|
1778
1785
|
}, [
|
|
1779
1786
|
ue(E("div", gs, [
|
|
1780
|
-
e.md ? (m(), w(
|
|
1787
|
+
e.md ? (m(), w(ae, { key: 0 }, [
|
|
1781
1788
|
E("div", bs, [
|
|
1782
1789
|
z(os, {
|
|
1783
1790
|
ref_key: "boldRef",
|
|
@@ -1844,7 +1851,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1844
1851
|
}, null, 8, ["disabled", "rows", "selected-val", "selected-row", "select-info"])
|
|
1845
1852
|
]),
|
|
1846
1853
|
z(i(Re))
|
|
1847
|
-
], 64)) :
|
|
1854
|
+
], 64)) : M("", !0),
|
|
1848
1855
|
z(i(tt), {
|
|
1849
1856
|
class: W({ "has-shadow": !e.md }),
|
|
1850
1857
|
ref_key: "inputRef",
|
|
@@ -1866,9 +1873,9 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1866
1873
|
]),
|
|
1867
1874
|
n.value === "preview" ? (m(), S(i(vn), {
|
|
1868
1875
|
key: 0,
|
|
1869
|
-
text:
|
|
1876
|
+
text: P.value,
|
|
1870
1877
|
md: e.md
|
|
1871
|
-
}, null, 8, ["text", "md"])) :
|
|
1878
|
+
}, null, 8, ["text", "md"])) : M("", !0),
|
|
1872
1879
|
E("div", ys, [
|
|
1873
1880
|
z(i(Ao), {
|
|
1874
1881
|
size: e.size,
|
|
@@ -1901,7 +1908,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1901
1908
|
const u = [];
|
|
1902
1909
|
return s.isRequired && u.push("is-required"), u;
|
|
1903
1910
|
}), a = y(() => ["input", "switch", "select"].includes(s.type));
|
|
1904
|
-
|
|
1911
|
+
oe(
|
|
1905
1912
|
() => s.errorMsg,
|
|
1906
1913
|
(u) => {
|
|
1907
1914
|
u && (n.value = u);
|
|
@@ -1921,7 +1928,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1921
1928
|
class: W(["sq-form-item-label", t.value]),
|
|
1922
1929
|
textContent: Q(s.label),
|
|
1923
1930
|
for: s.type !== "custom" ? e.value : void 0
|
|
1924
|
-
}, null, 10, _s)) :
|
|
1931
|
+
}, null, 10, _s)) : M("", !0),
|
|
1925
1932
|
E("div", $s, [
|
|
1926
1933
|
F(u.$slots, "default"),
|
|
1927
1934
|
z(we, {
|
|
@@ -1967,10 +1974,10 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
1967
1974
|
Se(
|
|
1968
1975
|
Ae,
|
|
1969
1976
|
T({
|
|
1970
|
-
size:
|
|
1971
|
-
round:
|
|
1972
|
-
disabled:
|
|
1973
|
-
readonly:
|
|
1977
|
+
size: le(t, "size"),
|
|
1978
|
+
round: le(t, "round"),
|
|
1979
|
+
disabled: le(t, "disabled"),
|
|
1980
|
+
readonly: le(t, "readonly")
|
|
1974
1981
|
})
|
|
1975
1982
|
);
|
|
1976
1983
|
const a = T({}), d = T([]), u = T({}), l = y(() => {
|
|
@@ -2006,7 +2013,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2006
2013
|
const O = t.formData[k];
|
|
2007
2014
|
let H = !1;
|
|
2008
2015
|
const X = b.validateType ?? "string";
|
|
2009
|
-
return b.validateFunc ? H = await $(k, O, b, C) : X === "string" ? H = B(k, O, b) : X === "boolean" ? H =
|
|
2016
|
+
return b.validateFunc ? H = await $(k, O, b, C) : X === "string" ? H = B(k, O, b) : X === "boolean" ? H = P(k, O, b) : X === "list" && (H = I(k, O, b)), _ && n("validate", k, H, ze(d.value)), u.value[k].signal.aborted || j(k), H;
|
|
2010
2017
|
}
|
|
2011
2018
|
function x(k) {
|
|
2012
2019
|
if (a.value[k]) return t.invalidStatus;
|
|
@@ -2022,7 +2029,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2022
2029
|
function B(k, C, b) {
|
|
2023
2030
|
return b.required && !C ? (L(k, b.requiredText ?? "字段必填"), !1) : b.pattern && C && !b.pattern.test(C) ? (L(k, b.patternText ?? "字段验证失败"), !1) : (V(k), !0);
|
|
2024
2031
|
}
|
|
2025
|
-
function
|
|
2032
|
+
function P(k, C, b) {
|
|
2026
2033
|
return b.required && C === void 0 ? (L(k, b.requiredText ?? "字段必填"), !1) : (V(k), !0);
|
|
2027
2034
|
}
|
|
2028
2035
|
function I(k, C, b) {
|
|
@@ -2056,7 +2063,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2056
2063
|
onSubmit: C[0] || (C[0] = be(() => {
|
|
2057
2064
|
}, ["prevent"]))
|
|
2058
2065
|
}, [
|
|
2059
|
-
(m(!0), w(
|
|
2066
|
+
(m(!0), w(ae, null, pe(p.value, (b, _) => (m(), S(qs, {
|
|
2060
2067
|
class: W(b.itemClass),
|
|
2061
2068
|
type: b.type,
|
|
2062
2069
|
key: _,
|
|
@@ -2147,7 +2154,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2147
2154
|
height: p.value ? void 0 : "var(--image-placeholder-height)",
|
|
2148
2155
|
aspectRatio: p.value ? void 0 : n.aspectRatio
|
|
2149
2156
|
}));
|
|
2150
|
-
|
|
2157
|
+
oe(
|
|
2151
2158
|
() => n.src,
|
|
2152
2159
|
() => {
|
|
2153
2160
|
d.value = !1, t.value = !1, a.value = n.src;
|
|
@@ -2173,7 +2180,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2173
2180
|
function $() {
|
|
2174
2181
|
l.value = !0;
|
|
2175
2182
|
}
|
|
2176
|
-
return (B,
|
|
2183
|
+
return (B, P) => (m(), w("div", {
|
|
2177
2184
|
class: "sq-image",
|
|
2178
2185
|
style: G(h.value),
|
|
2179
2186
|
ref_key: "imgRef",
|
|
@@ -2181,12 +2188,12 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2181
2188
|
}, [
|
|
2182
2189
|
z(we, { name: "sq-fade" }, {
|
|
2183
2190
|
default: N(() => [
|
|
2184
|
-
t.value ?
|
|
2191
|
+
t.value ? M("", !0) : (m(), w("div", Ss))
|
|
2185
2192
|
]),
|
|
2186
2193
|
_: 1
|
|
2187
2194
|
}),
|
|
2188
2195
|
!d.value && u.value ? (m(), w("picture", Bs, [
|
|
2189
|
-
(m(!0), w(
|
|
2196
|
+
(m(!0), w(ae, null, pe(n.source, (I, L) => (m(), w("source", {
|
|
2190
2197
|
key: L,
|
|
2191
2198
|
srcset: I.src,
|
|
2192
2199
|
media: I.media,
|
|
@@ -2200,25 +2207,25 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2200
2207
|
onLoad: v,
|
|
2201
2208
|
onError: f
|
|
2202
2209
|
}, null, 44, zs)
|
|
2203
|
-
])) :
|
|
2210
|
+
])) : M("", !0),
|
|
2204
2211
|
!d.value && u.value && n.preview ? (m(), w("div", {
|
|
2205
2212
|
key: 1,
|
|
2206
2213
|
class: "sq-image-control",
|
|
2207
2214
|
onClick: $
|
|
2208
2215
|
}, [
|
|
2209
2216
|
z(i(ht))
|
|
2210
|
-
])) :
|
|
2217
|
+
])) : M("", !0),
|
|
2211
2218
|
d.value ? (m(), w("div", Rs, [
|
|
2212
2219
|
F(B.$slots, "error", {}, () => [
|
|
2213
|
-
|
|
2220
|
+
P[1] || (P[1] = E("span", null, "图片加载失败", -1))
|
|
2214
2221
|
])
|
|
2215
|
-
])) :
|
|
2222
|
+
])) : M("", !0),
|
|
2216
2223
|
n.preview ? (m(), S(i(Es), {
|
|
2217
2224
|
key: 3,
|
|
2218
2225
|
"src-list": [a.value],
|
|
2219
2226
|
visible: l.value,
|
|
2220
|
-
"onUpdate:visible":
|
|
2221
|
-
}, null, 8, ["src-list", "visible"])) :
|
|
2227
|
+
"onUpdate:visible": P[0] || (P[0] = (I) => l.value = I)
|
|
2228
|
+
}, null, 8, ["src-list", "visible"])) : M("", !0)
|
|
2222
2229
|
], 4));
|
|
2223
2230
|
}
|
|
2224
2231
|
}), Is = ["src"], As = "sq-image-viewer", Es = /* @__PURE__ */ R({
|
|
@@ -2256,8 +2263,8 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2256
2263
|
getImagePoint: v
|
|
2257
2264
|
} = yt(), f = { x: 0, y: 0 };
|
|
2258
2265
|
let x = 0;
|
|
2259
|
-
const $ = c, B = T(!1),
|
|
2260
|
-
const Y = B.value ? -1 : 1, U =
|
|
2266
|
+
const $ = c, B = T(!1), P = T(!1), I = T(0), L = T(0), V = T(!0), j = re(c, "visible"), te = y(() => $.srcList[L.value]), ne = y(() => {
|
|
2267
|
+
const Y = B.value ? -1 : 1, U = P.value ? -1 : 1;
|
|
2261
2268
|
return {
|
|
2262
2269
|
transform: [
|
|
2263
2270
|
`scale(${e.value * Y}, ${e.value * U})`,
|
|
@@ -2297,7 +2304,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2297
2304
|
f.x = _e / J.width, f.y = Ee / J.height, x = Math.min(f.x, f.y), e.value = Math.min(x, 1);
|
|
2298
2305
|
}
|
|
2299
2306
|
function q() {
|
|
2300
|
-
e.value = Math.min(f.x, f.y, 1), B.value = !1,
|
|
2307
|
+
e.value = Math.min(f.x, f.y, 1), B.value = !1, P.value = !1, I.value = 0, n.value = { x: 0, y: 0 };
|
|
2301
2308
|
}
|
|
2302
2309
|
function O(Y) {
|
|
2303
2310
|
L.value += Y;
|
|
@@ -2335,7 +2342,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2335
2342
|
B.value = !B.value;
|
|
2336
2343
|
}
|
|
2337
2344
|
function ge() {
|
|
2338
|
-
|
|
2345
|
+
P.value = !P.value;
|
|
2339
2346
|
}
|
|
2340
2347
|
function qe(Y) {
|
|
2341
2348
|
I.value += Y;
|
|
@@ -2379,7 +2386,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2379
2386
|
icon: i(Ge),
|
|
2380
2387
|
onClick: be(He, ["stop"])
|
|
2381
2388
|
}, null, 8, ["icon"]),
|
|
2382
|
-
$.srcList.length > 1 ? (m(), w(
|
|
2389
|
+
$.srcList.length > 1 ? (m(), w(ae, { key: 0 }, [
|
|
2383
2390
|
z(i(ee), {
|
|
2384
2391
|
class: "sq-image-viewer-prev",
|
|
2385
2392
|
round: "",
|
|
@@ -2394,7 +2401,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2394
2401
|
disabled: L.value === $.srcList.length - 1,
|
|
2395
2402
|
onClick: U[4] || (U[4] = (J) => O(1))
|
|
2396
2403
|
}, null, 8, ["icon", "disabled"])
|
|
2397
|
-
], 64)) :
|
|
2404
|
+
], 64)) : M("", !0),
|
|
2398
2405
|
$.toolbar ? (m(), w("div", {
|
|
2399
2406
|
key: 1,
|
|
2400
2407
|
class: "sq-image-viewer-toolbar",
|
|
@@ -2510,7 +2517,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2510
2517
|
]),
|
|
2511
2518
|
_: 1
|
|
2512
2519
|
})
|
|
2513
|
-
])) :
|
|
2520
|
+
])) : M("", !0)
|
|
2514
2521
|
]),
|
|
2515
2522
|
_: 1
|
|
2516
2523
|
}, 8, ["visible", "keyboard", "mask-closeable", "onPointerup"]));
|
|
@@ -2540,12 +2547,12 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2540
2547
|
getImagePoint: f
|
|
2541
2548
|
} = yt();
|
|
2542
2549
|
let x = 0;
|
|
2543
|
-
const $ = c, B = ie(null),
|
|
2550
|
+
const $ = c, B = ie(null), P = y(() => ({
|
|
2544
2551
|
transform: `scale(${n.value})`,
|
|
2545
2552
|
marginInlineStart: `${t.value.x}px`,
|
|
2546
2553
|
marginBlockStart: `${t.value.y}px`
|
|
2547
2554
|
}));
|
|
2548
|
-
|
|
2555
|
+
oe(
|
|
2549
2556
|
() => $.aspectRatio,
|
|
2550
2557
|
() => {
|
|
2551
2558
|
ke(I);
|
|
@@ -2650,10 +2657,10 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2650
2657
|
key: 0,
|
|
2651
2658
|
ref_key: "imgRef",
|
|
2652
2659
|
ref: a,
|
|
2653
|
-
style: G(
|
|
2660
|
+
style: G(P.value),
|
|
2654
2661
|
src: $.src,
|
|
2655
2662
|
onLoad: I
|
|
2656
|
-
}, null, 44, Ms)) :
|
|
2663
|
+
}, null, 44, Ms)) : M("", !0)
|
|
2657
2664
|
], 36));
|
|
2658
2665
|
}
|
|
2659
2666
|
}), Ds = {
|
|
@@ -2693,7 +2700,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2693
2700
|
const e = Oe(), n = s, t = c, { inputSize: a, inputRound: d, inputDisabled: u, inputReadonly: l, id: r } = Cn(t), p = re(c, "value"), h = T(!1), v = T(!1), f = ie(null), x = y(() => {
|
|
2694
2701
|
const A = [], D = i(a), K = i(d), ce = i(ne);
|
|
2695
2702
|
return D !== "md" && A.push(`sq-input--${D}`), t.status && A.push(`is-${t.status}`), K && A.push("is-round"), ce && A.push("is-disabled"), A;
|
|
2696
|
-
}), $ = y(() => i(v) ? mt : ht), B = y(() => i(v) ? "text" : t.type),
|
|
2703
|
+
}), $ = y(() => i(v) ? mt : ht), B = y(() => i(v) ? "text" : t.type), P = y(() => e.prefix || t.prefixIcon), I = y(() => i(h) && i(p).length), L = y(
|
|
2697
2704
|
() => t.type === "password" && i(I)
|
|
2698
2705
|
), V = y(() => t.clearable && i(I)), j = y(() => t.loading ? Ue : t.suffixIcon), te = y(
|
|
2699
2706
|
() => i(L) || i(V) || i(j) || e.suffix
|
|
@@ -2732,11 +2739,11 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2732
2739
|
onClick: g,
|
|
2733
2740
|
onPointerdown: _
|
|
2734
2741
|
}, [
|
|
2735
|
-
|
|
2742
|
+
P.value ? (m(), w("span", Ds, [
|
|
2736
2743
|
F(A.$slots, "prefix", {}, () => [
|
|
2737
2744
|
(m(), S(fe(t.prefixIcon)))
|
|
2738
2745
|
])
|
|
2739
|
-
])) :
|
|
2746
|
+
])) : M("", !0),
|
|
2740
2747
|
t.type !== "textarea" ? ue((m(), w("input", {
|
|
2741
2748
|
key: 1,
|
|
2742
2749
|
class: "sq-input-inner",
|
|
@@ -2794,14 +2801,14 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2794
2801
|
key: 0,
|
|
2795
2802
|
class: "sq-input-suffix-pwd",
|
|
2796
2803
|
onPointerdown: O
|
|
2797
|
-
}, null, 32)) :
|
|
2804
|
+
}, null, 32)) : M("", !0),
|
|
2798
2805
|
V.value ? (m(), S(i(Ge), {
|
|
2799
2806
|
key: 1,
|
|
2800
2807
|
class: "sq-input-suffix-clear",
|
|
2801
2808
|
onPointerdown: q
|
|
2802
|
-
})) :
|
|
2809
|
+
})) : M("", !0),
|
|
2803
2810
|
F(A.$slots, "suffix", {}, () => [
|
|
2804
|
-
j.value ? (m(), S(fe(j.value), { key: 0 })) :
|
|
2811
|
+
j.value ? (m(), S(fe(j.value), { key: 0 })) : M("", !0)
|
|
2805
2812
|
])
|
|
2806
2813
|
], 512), [
|
|
2807
2814
|
[he, te.value]
|
|
@@ -2839,7 +2846,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2839
2846
|
return (p, h) => (m(), w("menu", {
|
|
2840
2847
|
class: W(["sq-menu", u.value])
|
|
2841
2848
|
}, [
|
|
2842
|
-
n.router && t.value ? (m(!0), w(
|
|
2849
|
+
n.router && t.value ? (m(!0), w(ae, { key: 0 }, pe(n.items, (v) => (m(), S(fe(a.value), {
|
|
2843
2850
|
custom: "",
|
|
2844
2851
|
to: { name: v.value },
|
|
2845
2852
|
key: v.value
|
|
@@ -2850,7 +2857,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2850
2857
|
onClick: ($) => l(v, f)
|
|
2851
2858
|
}, [
|
|
2852
2859
|
F(p.$slots, "default", ve({ ref_for: !0 }, v), () => [
|
|
2853
|
-
v.icon ? (m(), S(fe(v.icon), { key: 0 })) :
|
|
2860
|
+
v.icon ? (m(), S(fe(v.icon), { key: 0 })) : M("", !0),
|
|
2854
2861
|
E("span", {
|
|
2855
2862
|
textContent: Q(i(s)(v))
|
|
2856
2863
|
}, null, 8, Hs),
|
|
@@ -2861,12 +2868,12 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2861
2868
|
type: "primary"
|
|
2862
2869
|
}, null, 512)), [
|
|
2863
2870
|
[he, x]
|
|
2864
|
-
]) :
|
|
2871
|
+
]) : M("", !0)
|
|
2865
2872
|
])
|
|
2866
2873
|
], 10, Fs)
|
|
2867
2874
|
]),
|
|
2868
2875
|
_: 2
|
|
2869
|
-
}, 1032, ["to"]))), 128)) : (m(!0), w(
|
|
2876
|
+
}, 1032, ["to"]))), 128)) : (m(!0), w(ae, { key: 1 }, pe(n.items, (v) => (m(), w("li", {
|
|
2870
2877
|
class: W(["sq-menu-item", {
|
|
2871
2878
|
"is-active": d.value === v.value,
|
|
2872
2879
|
"is-disabled": v.disabled
|
|
@@ -2875,7 +2882,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2875
2882
|
onClick: (f) => r(v, f)
|
|
2876
2883
|
}, [
|
|
2877
2884
|
F(p.$slots, "default", ve({ ref_for: !0 }, v), () => [
|
|
2878
|
-
v.icon ? (m(), S(fe(v.icon), { key: 0 })) :
|
|
2885
|
+
v.icon ? (m(), S(fe(v.icon), { key: 0 })) : M("", !0),
|
|
2879
2886
|
E("span", {
|
|
2880
2887
|
textContent: Q(i(s)(v))
|
|
2881
2888
|
}, null, 8, Ws),
|
|
@@ -2886,7 +2893,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2886
2893
|
type: "primary"
|
|
2887
2894
|
}, null, 512)), [
|
|
2888
2895
|
[he, d.value === v.value]
|
|
2889
|
-
]) :
|
|
2896
|
+
]) : M("", !0)
|
|
2890
2897
|
])
|
|
2891
2898
|
], 10, js))), 128))
|
|
2892
2899
|
], 2));
|
|
@@ -2928,7 +2935,7 @@ ${ce}${K}`, te(_.target), b(t.value, qe, qe);
|
|
|
2928
2935
|
s.type && n.value ? (m(), S(fe(n.value), {
|
|
2929
2936
|
key: 0,
|
|
2930
2937
|
class: "sq-message-icon"
|
|
2931
|
-
})) :
|
|
2938
|
+
})) : M("", !0),
|
|
2932
2939
|
E("div", {
|
|
2933
2940
|
class: "sq-message-content",
|
|
2934
2941
|
textContent: Q(s.message)
|
|
@@ -3119,7 +3126,7 @@ const Ta = Ke, no = ["textContent"], so = "sq-message-box", oo = /* @__PURE__ */
|
|
|
3119
3126
|
s.value = n;
|
|
3120
3127
|
};
|
|
3121
3128
|
return (n, t) => (m(), w("div", co, [
|
|
3122
|
-
(m(!0), w(
|
|
3129
|
+
(m(!0), w(ae, null, pe(o.list, (a) => (m(), w(ae, { key: a }, [
|
|
3123
3130
|
a ? (m(), S(i(ee), {
|
|
3124
3131
|
key: 0,
|
|
3125
3132
|
type: s.value === a ? "primary" : void 0,
|
|
@@ -3202,7 +3209,7 @@ const Ta = Ke, no = ["textContent"], so = "sq-message-box", oo = /* @__PURE__ */
|
|
|
3202
3209
|
return u;
|
|
3203
3210
|
});
|
|
3204
3211
|
return (d, u) => (m(), w("div", ho, [
|
|
3205
|
-
(m(!0), w(
|
|
3212
|
+
(m(!0), w(ae, null, pe(a.value, (l, r) => (m(), S(fe(l), {
|
|
3206
3213
|
key: r,
|
|
3207
3214
|
size: o.size,
|
|
3208
3215
|
disabled: o.disabled,
|
|
@@ -3239,7 +3246,7 @@ function wt(c) {
|
|
|
3239
3246
|
case Lt:
|
|
3240
3247
|
case "svg":
|
|
3241
3248
|
return rt(o);
|
|
3242
|
-
case
|
|
3249
|
+
case ae:
|
|
3243
3250
|
return wt(o.children);
|
|
3244
3251
|
default:
|
|
3245
3252
|
return o;
|
|
@@ -3273,18 +3280,18 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3273
3280
|
setup(c, { emit: o }) {
|
|
3274
3281
|
const { getCssVar: s } = Fe(), { nextZIndex: e } = Je(), n = Ze(), t = parseInt(s("--sq-padding-sm")), a = parseInt(s("--sq-padding-md"));
|
|
3275
3282
|
let d, u, l = !1;
|
|
3276
|
-
const r = o, p = c, h = re(c, "visible"), v = T(0), f = T({}), x = T(!1), $ = ie(null), B = ie(null),
|
|
3283
|
+
const r = o, p = c, h = re(c, "visible"), v = T(0), f = T({}), x = T(!1), $ = ie(null), B = ie(null), P = y(() => {
|
|
3277
3284
|
const C = [];
|
|
3278
3285
|
return p.shadow && C.push("has-shadow"), [C];
|
|
3279
3286
|
});
|
|
3280
|
-
|
|
3287
|
+
oe(h, (C) => {
|
|
3281
3288
|
if (C === l) return;
|
|
3282
3289
|
l = C, k();
|
|
3283
3290
|
const b = C ? p.showAfter : p.hideAfter;
|
|
3284
3291
|
d = setTimeout(() => {
|
|
3285
3292
|
x.value = C;
|
|
3286
3293
|
}, b);
|
|
3287
|
-
}),
|
|
3294
|
+
}), oe(x, (C) => {
|
|
3288
3295
|
C ? (v.value = e(), ne(), u = Qt(
|
|
3289
3296
|
$.value.$el,
|
|
3290
3297
|
B.value,
|
|
@@ -3330,7 +3337,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3330
3337
|
function k() {
|
|
3331
3338
|
d && (clearTimeout(d), d = void 0);
|
|
3332
3339
|
}
|
|
3333
|
-
return (C, b) => (m(), w(
|
|
3340
|
+
return (C, b) => (m(), w(ae, null, [
|
|
3334
3341
|
z(i(yo), {
|
|
3335
3342
|
class: W(["sq-popover-trigger", i(n).class]),
|
|
3336
3343
|
style: G(i(n).style),
|
|
@@ -3354,7 +3361,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3354
3361
|
}, {
|
|
3355
3362
|
default: N(() => [
|
|
3356
3363
|
ue(E("div", {
|
|
3357
|
-
class: W(["sq-popover", [
|
|
3364
|
+
class: W(["sq-popover", [P.value, p.popoverClass]]),
|
|
3358
3365
|
style: G([{ ...f.value, zIndex: v.value }, p.popoverStyle]),
|
|
3359
3366
|
ref_key: "popverRef",
|
|
3360
3367
|
ref: B,
|
|
@@ -3422,7 +3429,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3422
3429
|
ref: n,
|
|
3423
3430
|
style: G(u.value)
|
|
3424
3431
|
}, [
|
|
3425
|
-
s.variant === "circle" ? (m(), w(
|
|
3432
|
+
s.variant === "circle" ? (m(), w(ae, { key: 0 }, [
|
|
3426
3433
|
p[0] || (p[0] = E("svg", {
|
|
3427
3434
|
viewBox: "0 0 100 100",
|
|
3428
3435
|
version: "1.1",
|
|
@@ -3445,8 +3452,8 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3445
3452
|
textContent: Q(d.value)
|
|
3446
3453
|
}, null, 8, $o)
|
|
3447
3454
|
])
|
|
3448
|
-
])) :
|
|
3449
|
-
], 64)) :
|
|
3455
|
+
])) : M("", !0)
|
|
3456
|
+
], 64)) : M("", !0)
|
|
3450
3457
|
], 6));
|
|
3451
3458
|
}
|
|
3452
3459
|
}), qo = ["autofocus", "name", "form", "value", "disabled"], Co = {
|
|
@@ -3481,14 +3488,14 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3481
3488
|
const f = [], x = i(n), $ = i(t), B = i(u);
|
|
3482
3489
|
return x !== "md" && f.push(`sq-selection--${x}`), v.value && f.push("is-checked"), $ && f.push("is-disabled"), B && f.push(`is-${B}`), f;
|
|
3483
3490
|
}), v = y(() => l ? i(l).checked === e.value : p.value);
|
|
3484
|
-
return
|
|
3491
|
+
return oe(r, (f) => {
|
|
3485
3492
|
p.value = f === e.value;
|
|
3486
|
-
}),
|
|
3493
|
+
}), oe(v, (f) => {
|
|
3487
3494
|
if (f ? r.value = e.value ?? "on" : r.value = void 0, p.value !== f) {
|
|
3488
3495
|
p.value = f;
|
|
3489
3496
|
return;
|
|
3490
3497
|
}
|
|
3491
|
-
}),
|
|
3498
|
+
}), oe(p, (f) => {
|
|
3492
3499
|
v.value !== f && l && l.value.toggleItem(e.value);
|
|
3493
3500
|
}), se(() => {
|
|
3494
3501
|
p.value = v.value, r.value = p.value ? e.value ?? "on" : void 0;
|
|
@@ -3507,12 +3514,12 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3507
3514
|
}, null, 40, qo), [
|
|
3508
3515
|
[ct, r.value]
|
|
3509
3516
|
]),
|
|
3510
|
-
i(u) !== "solid" ? (m(), w("span", Co)) :
|
|
3517
|
+
i(u) !== "solid" ? (m(), w("span", Co)) : M("", !0),
|
|
3511
3518
|
e.label ? (m(), w("span", {
|
|
3512
3519
|
key: 1,
|
|
3513
3520
|
class: "sq-selection-label",
|
|
3514
3521
|
textContent: Q(e.label)
|
|
3515
|
-
}, null, 8, So)) :
|
|
3522
|
+
}, null, 8, So)) : M("", !0)
|
|
3516
3523
|
], 2));
|
|
3517
3524
|
}
|
|
3518
3525
|
}), zo = { class: "sq-radio-group sq-selection-group" }, Ro = "sq-radio-group", Lo = /* @__PURE__ */ R({
|
|
@@ -3539,15 +3546,15 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3539
3546
|
Se(
|
|
3540
3547
|
Ct,
|
|
3541
3548
|
T({
|
|
3542
|
-
form:
|
|
3549
|
+
form: le(t, "form"),
|
|
3543
3550
|
name: d,
|
|
3544
|
-
disabled:
|
|
3545
|
-
size:
|
|
3546
|
-
variant:
|
|
3551
|
+
disabled: le(t, "disabled"),
|
|
3552
|
+
size: le(t, "size"),
|
|
3553
|
+
variant: le(t, "variant"),
|
|
3547
3554
|
checked: a,
|
|
3548
3555
|
toggleItem: l
|
|
3549
3556
|
})
|
|
3550
|
-
),
|
|
3557
|
+
), oe(
|
|
3551
3558
|
() => t.value,
|
|
3552
3559
|
(r) => {
|
|
3553
3560
|
r !== a.value && (a.value = r);
|
|
@@ -3558,7 +3565,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3558
3565
|
}
|
|
3559
3566
|
return (r, p) => (m(), w("div", zo, [
|
|
3560
3567
|
F(r.$slots, "default", {}, () => [
|
|
3561
|
-
(m(!0), w(
|
|
3568
|
+
(m(!0), w(ae, null, pe(u.value, (h, v) => (m(), S(i(To), {
|
|
3562
3569
|
key: v,
|
|
3563
3570
|
disabled: h.disabled === !0,
|
|
3564
3571
|
label: i(e)(h),
|
|
@@ -3596,8 +3603,8 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3596
3603
|
St,
|
|
3597
3604
|
T({
|
|
3598
3605
|
name: p,
|
|
3599
|
-
disabled:
|
|
3600
|
-
size:
|
|
3606
|
+
disabled: le(n, "disabled"),
|
|
3607
|
+
size: le(n, "size"),
|
|
3601
3608
|
active: d,
|
|
3602
3609
|
toggleItem: h,
|
|
3603
3610
|
updateThumb: v
|
|
@@ -3620,7 +3627,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3620
3627
|
style: G(r.value)
|
|
3621
3628
|
}, null, 4),
|
|
3622
3629
|
F(f.$slots, "default", {}, () => [
|
|
3623
|
-
(m(!0), w(
|
|
3630
|
+
(m(!0), w(ae, null, pe(u.value, ($) => (m(), S(i(Po), ve({
|
|
3624
3631
|
key: $.value
|
|
3625
3632
|
}, { ref_for: !0 }, $), null, 16))), 128))
|
|
3626
3633
|
])
|
|
@@ -3640,7 +3647,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3640
3647
|
const p = [], h = i(s);
|
|
3641
3648
|
return u.value && p.push("is-active"), h && p.push("is-disabled"), p;
|
|
3642
3649
|
}), u = y(() => i(e).active === o.value), l = y(() => i(e).size !== "sm" ? "md" : "sm");
|
|
3643
|
-
|
|
3650
|
+
oe(u, (p) => {
|
|
3644
3651
|
if (p) {
|
|
3645
3652
|
if (t.value = o.value ?? "on", !e) return;
|
|
3646
3653
|
e.value.updateThumb(a.value);
|
|
@@ -3671,7 +3678,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3671
3678
|
F(p.$slots, "default", {}, () => [
|
|
3672
3679
|
z(i(xe), { size: l.value }, {
|
|
3673
3680
|
default: N(() => [
|
|
3674
|
-
o.icon ? (m(), S(fe(o.icon), { key: 0 })) :
|
|
3681
|
+
o.icon ? (m(), S(fe(o.icon), { key: 0 })) : M("", !0),
|
|
3675
3682
|
De(" " + Q(i(n)(o)), 1)
|
|
3676
3683
|
]),
|
|
3677
3684
|
_: 1
|
|
@@ -3704,7 +3711,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3704
3711
|
E("span", {
|
|
3705
3712
|
textContent: Q(i(e)(s))
|
|
3706
3713
|
}, null, 8, Do),
|
|
3707
|
-
t.value ? (m(), S(i(vt), { key: 0 })) :
|
|
3714
|
+
t.value ? (m(), S(i(vt), { key: 0 })) : M("", !0)
|
|
3708
3715
|
], 2));
|
|
3709
3716
|
}
|
|
3710
3717
|
}), No = ["textContent"], Uo = "sq-select", Vo = /* @__PURE__ */ R({
|
|
@@ -3741,9 +3748,9 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3741
3748
|
active: r,
|
|
3742
3749
|
toggleItem: v
|
|
3743
3750
|
})
|
|
3744
|
-
),
|
|
3751
|
+
), oe(a, () => {
|
|
3745
3752
|
e = u.value;
|
|
3746
|
-
}),
|
|
3753
|
+
}), oe(r, f), se(() => {
|
|
3747
3754
|
f();
|
|
3748
3755
|
});
|
|
3749
3756
|
function h(L) {
|
|
@@ -3772,7 +3779,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3772
3779
|
function B(L) {
|
|
3773
3780
|
a.value = !1, n("blur", L);
|
|
3774
3781
|
}
|
|
3775
|
-
function
|
|
3782
|
+
function P() {
|
|
3776
3783
|
r.value = "", n("clear");
|
|
3777
3784
|
}
|
|
3778
3785
|
function I() {
|
|
@@ -3810,7 +3817,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3810
3817
|
onClick: x,
|
|
3811
3818
|
onFocus: $,
|
|
3812
3819
|
onBlur: B,
|
|
3813
|
-
onClear:
|
|
3820
|
+
onClear: P,
|
|
3814
3821
|
onInput: I
|
|
3815
3822
|
}, null, 8, ["value", "disabled", "placeholder", "prefix-icon", "suffix-icon", "size", "round", "status", "autofocus", "clearable", "name", "form"])
|
|
3816
3823
|
]),
|
|
@@ -3820,7 +3827,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3820
3827
|
onMousedown: V[2] || (V[2] = be(() => {
|
|
3821
3828
|
}, ["prevent"]))
|
|
3822
3829
|
}, [
|
|
3823
|
-
(m(!0), w(
|
|
3830
|
+
(m(!0), w(ae, null, pe(p.value, (j) => (m(), S(Oo, ve({
|
|
3824
3831
|
key: j.value
|
|
3825
3832
|
}, { ref_for: !0 }, j), null, 16))), 128))
|
|
3826
3833
|
], 32)) : (m(), w("div", {
|
|
@@ -3862,7 +3869,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3862
3869
|
return k[C] = `${h.value}px`, k;
|
|
3863
3870
|
}), B = y(
|
|
3864
3871
|
() => p.direction === "horizontal" ? "right" : "bottom"
|
|
3865
|
-
),
|
|
3872
|
+
), P = y(() => p.disabled ? void 0 : `linear-gradient(${[
|
|
3866
3873
|
`to ${B.value}`,
|
|
3867
3874
|
`#000 ${h.value}px`,
|
|
3868
3875
|
`transparent ${h.value + 1}px`
|
|
@@ -3871,7 +3878,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3871
3878
|
`transparent ${h.value}px`,
|
|
3872
3879
|
`#000 ${h.value + 1}px`
|
|
3873
3880
|
].join(",")})`);
|
|
3874
|
-
|
|
3881
|
+
oe(f, () => {
|
|
3875
3882
|
d || L();
|
|
3876
3883
|
}), se(() => {
|
|
3877
3884
|
L(), document.addEventListener("pointermove", te), document.addEventListener("pointerup", j);
|
|
@@ -3916,14 +3923,14 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3916
3923
|
F(k.$slots, "default", {}, () => [
|
|
3917
3924
|
E("div", {
|
|
3918
3925
|
class: "sq-swipe-top",
|
|
3919
|
-
style: G({ mask:
|
|
3926
|
+
style: G({ mask: P.value })
|
|
3920
3927
|
}, [
|
|
3921
3928
|
F(k.$slots, "top", {}, () => [
|
|
3922
3929
|
p.topSrc ? (m(), S(i(Ye), {
|
|
3923
3930
|
key: 0,
|
|
3924
3931
|
src: p.topSrc,
|
|
3925
3932
|
alt: p.topAlt
|
|
3926
|
-
}, null, 8, ["src", "alt"])) :
|
|
3933
|
+
}, null, 8, ["src", "alt"])) : M("", !0)
|
|
3927
3934
|
])
|
|
3928
3935
|
], 4),
|
|
3929
3936
|
E("div", {
|
|
@@ -3935,7 +3942,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3935
3942
|
key: 0,
|
|
3936
3943
|
src: p.bottomSrc,
|
|
3937
3944
|
alt: p.bottomAlt
|
|
3938
|
-
}, null, 8, ["src", "alt"])) :
|
|
3945
|
+
}, null, 8, ["src", "alt"])) : M("", !0)
|
|
3939
3946
|
])
|
|
3940
3947
|
], 4)
|
|
3941
3948
|
]),
|
|
@@ -3991,7 +3998,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
3991
3998
|
]),
|
|
3992
3999
|
E("span", jo, [
|
|
3993
4000
|
E("span", Wo, [
|
|
3994
|
-
e.loading ? (m(), S(i(Ue), { key: 0 })) :
|
|
4001
|
+
e.loading ? (m(), S(i(Ue), { key: 0 })) : M("", !0)
|
|
3995
4002
|
])
|
|
3996
4003
|
])
|
|
3997
4004
|
], 2));
|
|
@@ -4073,7 +4080,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4073
4080
|
class: "sq-table-header",
|
|
4074
4081
|
style: G(u.value)
|
|
4075
4082
|
}, [
|
|
4076
|
-
(m(!0), w(
|
|
4083
|
+
(m(!0), w(ae, null, pe(e.cols, (x) => (m(), w("div", {
|
|
4077
4084
|
class: "sq-table-cell",
|
|
4078
4085
|
style: G({ "justify-content": p(x.align) }),
|
|
4079
4086
|
key: x.binding
|
|
@@ -4088,15 +4095,15 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4088
4095
|
ref_key: "bodyRef",
|
|
4089
4096
|
ref: t
|
|
4090
4097
|
}, [
|
|
4091
|
-
(m(!0), w(
|
|
4098
|
+
(m(!0), w(ae, null, pe(e.data, (x, $) => (m(), w("div", {
|
|
4092
4099
|
class: "sq-table-row",
|
|
4093
4100
|
style: G(d.value),
|
|
4094
4101
|
key: r(x, $)
|
|
4095
4102
|
}, [
|
|
4096
|
-
(m(!0), w(
|
|
4103
|
+
(m(!0), w(ae, null, pe(e.cols, (B, P) => (m(), w("div", {
|
|
4097
4104
|
class: W(["sq-table-cell", B.columnClass]),
|
|
4098
4105
|
style: G({ "justify-content": p(B.align) }),
|
|
4099
|
-
key: `${B.binding}-${r(x,
|
|
4106
|
+
key: `${B.binding}-${r(x, P)}`
|
|
4100
4107
|
}, [
|
|
4101
4108
|
typeof B.cellRender == "function" ? (m(), S(i(Zo), {
|
|
4102
4109
|
key: 0,
|
|
@@ -4110,7 +4117,7 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4110
4117
|
], 512), [
|
|
4111
4118
|
[he, e.data.length]
|
|
4112
4119
|
]),
|
|
4113
|
-
e.data.length ?
|
|
4120
|
+
e.data.length ? M("", !0) : (m(), w("div", ea, [
|
|
4114
4121
|
F(v.$slots, "empty", {}, () => [
|
|
4115
4122
|
E("span", {
|
|
4116
4123
|
textContent: Q(e.emptyText)
|
|
@@ -4233,19 +4240,19 @@ const xo = "sq-popover", qt = /* @__PURE__ */ R({
|
|
|
4233
4240
|
style: G(e.value)
|
|
4234
4241
|
}, [
|
|
4235
4242
|
E("span", ra, [
|
|
4236
|
-
o.icon ? (m(), S(fe(o.icon), { key: 0 })) :
|
|
4243
|
+
o.icon ? (m(), S(fe(o.icon), { key: 0 })) : M("", !0)
|
|
4237
4244
|
]),
|
|
4238
4245
|
E("div", ia, [
|
|
4239
4246
|
o.title ? (m(), w("h2", {
|
|
4240
4247
|
key: 0,
|
|
4241
4248
|
class: "content-title",
|
|
4242
4249
|
textContent: Q(o.title)
|
|
4243
|
-
}, null, 8, ua)) :
|
|
4250
|
+
}, null, 8, ua)) : M("", !0),
|
|
4244
4251
|
o.timestamp ? (m(), w("span", {
|
|
4245
4252
|
key: 1,
|
|
4246
4253
|
class: "content-time",
|
|
4247
4254
|
textContent: Q(o.timestamp)
|
|
4248
|
-
}, null, 8, ca)) :
|
|
4255
|
+
}, null, 8, ca)) : M("", !0),
|
|
4249
4256
|
E("div", da, [
|
|
4250
4257
|
F(n.$slots, "default")
|
|
4251
4258
|
])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CodeProps } from '../../props';
|
|
2
2
|
declare const _default: import('vue').DefineComponent<CodeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<CodeProps> & Readonly<{}>, {
|
|
3
3
|
theme: string;
|
|
4
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
4
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
5
|
export default _default;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@squirrel-cloud/ui-vue",
|
|
3
3
|
"description": "松鼠的坚果屋前端VUE框架",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.1",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
@@ -36,10 +36,6 @@
|
|
|
36
36
|
"format": "prettier --write src/",
|
|
37
37
|
"prepublishOnly": "npm run build"
|
|
38
38
|
},
|
|
39
|
-
"overrides": {
|
|
40
|
-
"typescript-eslint": "8.44.1",
|
|
41
|
-
"@typescript-eslint/utils": "8.44.1"
|
|
42
|
-
},
|
|
43
39
|
"peerDependencies": {
|
|
44
40
|
"markdown-it": "^14.1.0",
|
|
45
41
|
"shiki": "^3.19.0",
|