savor-ui 0.1.0 → 0.2.0
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/CHANGELOG.md +14 -0
- package/dist/es/components/src/image/image-group.d.ts +1 -3
- package/dist/es/components/src/image/image-group.vue_vue_type_script_setup_true_vapor_true_lang.mjs +64 -70
- package/dist/es/components/src/image/index.d.ts +2 -6
- package/dist/es/components/src/link/index.d.ts +1 -1
- package/dist/es/components/src/link/types.d.ts +1 -1
- package/dist/es/components/src/message/message-container.d.ts +1 -1
- package/dist/es/components/src/message/message-container.vue_vue_type_script_setup_true_vapor_true_lang.mjs +24 -22
- package/dist/es/components/src/message/message.vue_vue_type_script_setup_true_vapor_true_lang.mjs +1 -2
- package/dist/es/components/src/message/method.mjs +33 -28
- package/dist/es/components/src/message/types.d.ts +0 -4
- package/dist/es/components/src/radio/index.d.ts +4 -2
- package/dist/es/components/src/radio/radio-group.d.ts +2 -1
- package/dist/es/components/src/radio/radio-group.vue_vue_type_script_setup_true_vapor_true_lang.mjs +23 -15
- package/dist/es/components/src/radio/radio.vue_vue_type_script_setup_true_vapor_true_lang.mjs +14 -9
- package/dist/es/components/src/radio/types.d.ts +6 -1
- package/dist/es/components/src/text/index.d.ts +7 -2
- package/dist/es/components/src/text/text.d.ts +6 -2
- package/dist/es/components/src/text/text.vue_vue_type_script_setup_true_vapor_true_lang.mjs +137 -29
- package/dist/es/components/src/text/types.d.ts +6 -0
- package/dist/es/icons/src/copy.vue.mjs +9 -3
- package/dist/es/theme/components/image.scss +9 -33
- package/dist/es/theme/components/radio.scss +44 -1
- package/dist/es/theme/components/text.scss +37 -0
- package/dist/json/vetur-attributes.json +18 -6
- package/dist/json/vetur-tags.json +7 -4
- package/dist/json/web-types.json +36 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
# [0.2.0](https://gitee.com/mach552/savor-ui/compare/v0.1.0...v0.2.0) (2026-05-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **image:** 修复图片组预览图片不展示的问题 ([d485580](https://gitee.com/mach552/savor-ui/commits/d485580c89acd0483cd71cb885175a294b3db1d3))
|
|
11
|
+
* **message:** 修复容器不销毁的问题 ([6c34e24](https://gitee.com/mach552/savor-ui/commits/6c34e24fcc1b0aadab4c49c385470cb79f88d1b5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **radio:** 新增按钮类型的单选框组 ([4b7e12a](https://gitee.com/mach552/savor-ui/commits/4b7e12aef25fc0504e3bdb8d52a85d899acefd00))
|
|
17
|
+
* **text:** 新增复制和编辑模式,新增气泡提示 ([39125c3](https://gitee.com/mach552/savor-ui/commits/39125c3877a14d9bcd9deda7736f7b2583e479b1))
|
|
18
|
+
|
|
5
19
|
# 0.1.0 (2026-05-16)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -10,9 +10,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
|
|
|
10
10
|
} ? P : {});
|
|
11
11
|
expose: (exposed: {}) => void;
|
|
12
12
|
attrs: any;
|
|
13
|
-
slots: {
|
|
14
|
-
default?: (props: {}) => any;
|
|
15
|
-
};
|
|
13
|
+
slots: {};
|
|
16
14
|
emit: (event: "update:modelValue", value: boolean) => void;
|
|
17
15
|
}>) => VNode & {
|
|
18
16
|
__ctx?: Awaited<typeof __VLS_setup>;
|
package/dist/es/components/src/image/image-group.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -3,23 +3,23 @@ import { useScrollHidden as t } from "../../../hooks/src/use-scroll-hidden.mjs";
|
|
|
3
3
|
import { useZIndex as n } from "../../../hooks/src/use-zIndex.mjs";
|
|
4
4
|
import "../../../hooks/index.mjs";
|
|
5
5
|
import r from "../../../icons/src/close.vue.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
6
|
+
import ee from "../../../icons/src/left.vue.mjs";
|
|
7
|
+
import i from "../../../icons/src/refresh-left.vue.mjs";
|
|
8
|
+
import a from "../../../icons/src/refresh-right.vue.mjs";
|
|
9
|
+
import te from "../../../icons/src/refresh.vue.mjs";
|
|
10
|
+
import ne from "../../../icons/src/right.vue.mjs";
|
|
11
|
+
import re from "../../../icons/src/zoom-in.vue.mjs";
|
|
12
|
+
import ie from "../../../icons/src/zoom-out.vue.mjs";
|
|
13
13
|
import "../../../icons/index.mjs";
|
|
14
|
-
import { imageGroupContextKey as
|
|
15
|
-
import { VaporTeleport as
|
|
14
|
+
import { imageGroupContextKey as o } from "./types.mjs";
|
|
15
|
+
import { VaporTeleport as s, child as c, computed as l, createComponent as u, createIf as d, createInvoker as f, defineVaporComponent as p, delegateEvents as m, mergeModels as h, next as g, on as _, onMounted as v, onUnmounted as y, provide as b, ref as x, renderEffect as S, setClass as C, setInsertionState as w, setProp as ae, setStyle as T, template as E, unref as D, useModel as O, watch as k, withModifiers as A, withVaporCtx as j } from "vue";
|
|
16
16
|
//#region ../components/src/image/image-group.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
17
|
+
var M = E("<div><img alt>"), N = E("<div><div></div><div><div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div>");
|
|
18
|
+
m("click", "mousedown", "mouseup", "mousemove");
|
|
19
|
+
var P = /* @__PURE__ */ p({
|
|
20
20
|
name: "SImageGroup",
|
|
21
21
|
__name: "image-group",
|
|
22
|
-
props: /* @__PURE__ */
|
|
22
|
+
props: /* @__PURE__ */ h({
|
|
23
23
|
modelValue: { type: Boolean },
|
|
24
24
|
srcList: {}
|
|
25
25
|
}, {
|
|
@@ -27,79 +27,73 @@ var L = /* @__PURE__ */ _({
|
|
|
27
27
|
modelModifiers: {}
|
|
28
28
|
}),
|
|
29
29
|
emits: ["update:modelValue"],
|
|
30
|
-
__multiRoot: !
|
|
31
|
-
setup(
|
|
32
|
-
let
|
|
33
|
-
|
|
30
|
+
__multiRoot: !1,
|
|
31
|
+
setup(p) {
|
|
32
|
+
let m = p, h = e("image"), { nextZIndex: E } = n(), { lockScroll: P, unlockScroll: F } = t(), I = x(0), L = O(p, "modelValue"), R = x([]), z = x(0), B = l(() => R.value[z.value]), V = () => {
|
|
33
|
+
L.value = !1, F();
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
e ? (
|
|
35
|
+
k(L, (e) => {
|
|
36
|
+
e ? (I.value = E(), P()) : F();
|
|
37
37
|
});
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
38
|
+
let H = x(0), U = x(1), W = x(0), G = x(0), K = () => {
|
|
39
|
+
H.value += 90;
|
|
40
|
+
}, q = () => {
|
|
41
|
+
H.value -= 90;
|
|
42
|
+
}, J = () => {
|
|
43
|
+
U.value += .2, U.value > 2 && (U.value = 2);
|
|
42
44
|
}, Y = () => {
|
|
43
|
-
|
|
45
|
+
U.value -= .2, U.value < .5 && (U.value = .5);
|
|
44
46
|
}, X = () => {
|
|
45
|
-
|
|
46
|
-
}, Z = () => {
|
|
47
|
-
G.value = 0, K.value = 1, q.value = 0, J.value = 0;
|
|
47
|
+
H.value = 0, U.value = 1, W.value = 0, G.value = 0;
|
|
48
48
|
}, oe = () => {
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
e.preventDefault(),
|
|
49
|
+
V();
|
|
50
|
+
}, Z = (e) => {
|
|
51
|
+
L.value && (e.preventDefault(), e.deltaY > 0 ? Y() : J());
|
|
52
|
+
}, Q = x(!1), se = (e) => {
|
|
53
|
+
e.preventDefault(), Q.value = !0;
|
|
54
54
|
}, ce = (e) => {
|
|
55
|
-
e.preventDefault(),
|
|
55
|
+
e.preventDefault(), Q.value = !1;
|
|
56
56
|
}, le = (e) => {
|
|
57
|
-
e.preventDefault(),
|
|
57
|
+
e.preventDefault(), Q.value && (W.value += e.movementX, G.value += e.movementY);
|
|
58
|
+
}, $ = () => {
|
|
59
|
+
z.value--, X(), z.value < 0 && (z.value = R.value.length - 1);
|
|
58
60
|
}, ue = () => {
|
|
59
|
-
|
|
60
|
-
}, de = () => {
|
|
61
|
-
H.value++, Z(), H.value > V.value.length - 1 && (H.value = 0);
|
|
61
|
+
z.value++, X(), z.value > R.value.length - 1 && (z.value = 0);
|
|
62
62
|
};
|
|
63
|
-
return
|
|
64
|
-
document.addEventListener("wheel",
|
|
65
|
-
}),
|
|
66
|
-
document.removeEventListener("wheel",
|
|
67
|
-
}),
|
|
68
|
-
e && (
|
|
69
|
-
}),
|
|
63
|
+
return v(() => {
|
|
64
|
+
document.addEventListener("wheel", Z, { passive: !1 });
|
|
65
|
+
}), y(() => {
|
|
66
|
+
document.removeEventListener("wheel", Z);
|
|
67
|
+
}), k(() => m.srcList, (e) => {
|
|
68
|
+
e && (R.value = e);
|
|
69
|
+
}, { immediate: !0 }), b(o, {
|
|
70
70
|
addImage: (e) => {
|
|
71
|
-
|
|
71
|
+
R.value.push(e);
|
|
72
72
|
},
|
|
73
73
|
removeImage: (e) => {
|
|
74
|
-
|
|
74
|
+
R.value = R.value.filter((t) => t !== e);
|
|
75
75
|
},
|
|
76
76
|
showPreview: (e) => {
|
|
77
|
-
let t =
|
|
78
|
-
t !== -1 && (
|
|
77
|
+
let t = R.value.indexOf(e);
|
|
78
|
+
t !== -1 && (z.value = t, X(), L.value = !0);
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
81
|
-
let e =
|
|
82
|
-
return t.$evtclick =
|
|
83
|
-
let r =
|
|
84
|
-
|
|
85
|
-
}),
|
|
86
|
-
let e =
|
|
87
|
-
return e.$evtmousedown =
|
|
88
|
-
let n =
|
|
89
|
-
|
|
80
|
+
}), u(s, { to: () => "body" }, { default: j(() => d(() => L.value, () => {
|
|
81
|
+
let e = N(), t = c(e), n = g(t, 1), o = c(n, 1), s = c(o), l = g(s, 1), p = g(l, 2), m = g(p, 3), v = g(m, 4), y = g(v, 5), b = g(y, 6), x = g(b, 7);
|
|
82
|
+
return t.$evtclick = f(V), S(() => {
|
|
83
|
+
let r = D(h);
|
|
84
|
+
C(e, [r.e("preview")]), T(e, { zIndex: I.value }), C(t, [r.e("mask")]), C(n, [r.e("wrapper")]);
|
|
85
|
+
}), w(n, 0, 0), d(() => B.value, () => {
|
|
86
|
+
let e = M(), t = c(e);
|
|
87
|
+
return e.$evtmousedown = f(se), e.$evtmouseup = f(ce), e.$evtmousemove = f(le), S(() => {
|
|
88
|
+
let n = D(h);
|
|
89
|
+
C(e, [n.e("content")]), T(e, { transform: `translate(${W.value}px, ${G.value}px) rotate(${H.value}deg) scale(${U.value})` }), ae(t, "src", B.value), C(t, [n.e("content-img")]);
|
|
90
90
|
}), e;
|
|
91
|
-
}, null, 1),
|
|
92
|
-
let e =
|
|
93
|
-
|
|
94
|
-
}),
|
|
95
|
-
|
|
96
|
-
D(u, [e.e("arrow"), e.e("arrow-right")]);
|
|
97
|
-
}), O(u, null, 0), p(j(ee)), x(u, "click", h(N(de, ["stop"]))), E(() => {
|
|
98
|
-
let e = j(y);
|
|
99
|
-
D(f, [e.e("toolbar")]), D(g, [e.e("toolbar-item")]);
|
|
100
|
-
}), O(g, null, 0), p(j(a)), x(g, "click", h(N(ie, ["stop"]))), E(() => D(_, [j(y).e("toolbar-item")])), O(_, null, 0), p(j(o)), x(_, "click", h(N(ae, ["stop"]))), E(() => D(v, [j(y).e("toolbar-item")])), O(v, null, 0), p(j(te)), x(v, "click", h(N(Y, ["stop"]))), E(() => D(S, [j(y).e("toolbar-item")])), O(S, null, 0), p(j(c)), x(S, "click", h(N(X, ["stop"]))), E(() => D(C, [j(y).e("toolbar-item")])), O(C, null, 0), p(j(s)), x(C, "click", h(N(Z, ["stop"]))), E(() => D(w, [j(y).e("toolbar-item")])), O(w, null, 0), p(j(r)), x(w, "click", h(N(oe, ["stop"]))), e;
|
|
101
|
-
}, null, 1)) })];
|
|
91
|
+
}, null, 1), S(() => {
|
|
92
|
+
let e = D(h);
|
|
93
|
+
C(o, [e.e("toolbar")]), C(s, [e.e("toolbar-item")]);
|
|
94
|
+
}), w(s, null, 0), u(D(i)), _(s, "click", f(A(K, ["stop"]))), S(() => C(l, [D(h).e("toolbar-item")])), w(l, null, 0), u(D(a)), _(l, "click", f(A(q, ["stop"]))), S(() => C(p, [D(h).e("toolbar-item")])), w(p, null, 0), u(D(re)), _(p, "click", f(A(J, ["stop"]))), S(() => C(m, [D(h).e("toolbar-item")])), w(m, null, 0), u(D(ie)), _(m, "click", f(A(Y, ["stop"]))), S(() => C(v, [D(h).e("toolbar-item")])), w(v, null, 0), u(D(te)), _(v, "click", f(A(X, ["stop"]))), S(() => C(y, [D(h).e("toolbar-item")])), w(y, null, 0), u(D(ee)), _(y, "click", f(A($, ["stop"]))), S(() => C(b, [D(h).e("toolbar-item")])), w(b, null, 0), u(D(ne)), _(b, "click", f(A(ue, ["stop"]))), S(() => C(x, [D(h).e("toolbar-item")])), w(x, null, 0), u(D(r)), _(x, "click", f(A(oe, ["stop"]))), e;
|
|
95
|
+
}, null, 1)) }, !0);
|
|
102
96
|
}
|
|
103
97
|
});
|
|
104
98
|
//#endregion
|
|
105
|
-
export {
|
|
99
|
+
export { P as default };
|
|
@@ -40,9 +40,7 @@ export declare const SImagePreview: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
40
40
|
}) & Plugin;
|
|
41
41
|
export declare const SImageGroup: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
42
42
|
attrs: any;
|
|
43
|
-
slots: {
|
|
44
|
-
default?: (props: {}) => any;
|
|
45
|
-
};
|
|
43
|
+
slots: {};
|
|
46
44
|
emit: (event: "update:modelValue", value: boolean) => void;
|
|
47
45
|
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
48
46
|
props: PublicProps & {
|
|
@@ -54,9 +52,7 @@ export declare const SImageGroup: ((__VLS_props: NonNullable<Awaited<typeof __VL
|
|
|
54
52
|
} ? P : {});
|
|
55
53
|
expose: (exposed: {}) => void;
|
|
56
54
|
attrs: any;
|
|
57
|
-
slots: {
|
|
58
|
-
default?: (props: {}) => any;
|
|
59
|
-
};
|
|
55
|
+
slots: {};
|
|
60
56
|
emit: (event: "update:modelValue", value: boolean) => void;
|
|
61
57
|
}>) => VNode & {
|
|
62
58
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -8,7 +8,7 @@ export declare const SLink: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setu
|
|
|
8
8
|
props: PublicProps & {
|
|
9
9
|
href?: string | undefined;
|
|
10
10
|
label?: string | undefined;
|
|
11
|
-
type?: "default" | "primary" | "success" | "warning" | "danger" | "
|
|
11
|
+
type?: "default" | "primary" | "success" | "warning" | "danger" | "info" | undefined;
|
|
12
12
|
underline?: "always" | "hover" | "never" | undefined;
|
|
13
13
|
disabled?: boolean | undefined;
|
|
14
14
|
} & (typeof globalThis extends {
|
|
@@ -4,7 +4,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
|
|
|
4
4
|
props: PublicProps & __VLS_PrettifyLocal<{
|
|
5
5
|
placement: "top" | "bottom" | "center";
|
|
6
6
|
offset?: number;
|
|
7
|
-
|
|
7
|
+
onEmpty?: () => void;
|
|
8
8
|
}> & (typeof globalThis extends {
|
|
9
9
|
__VLS_PROPS_FALLBACK: infer P;
|
|
10
10
|
} ? P : {});
|
|
@@ -2,36 +2,38 @@ import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
|
2
2
|
import { useZIndex as t } from "../../../hooks/src/use-zIndex.mjs";
|
|
3
3
|
import "../../../hooks/index.mjs";
|
|
4
4
|
import n from "./message.vue.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { VaporTransitionGroup as r, computed as i, createComponent as a, createFor as o, defineVaporComponent as s, ref as c, renderEffect as l, setClass as u, setInsertionState as d, template as f, unref as p, withVaporCtx as m } from "vue";
|
|
6
6
|
//#region ../components/src/message/message-container.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var h = f("<div>"), g = /* @__PURE__ */ s({
|
|
8
8
|
__name: "message-container",
|
|
9
9
|
props: {
|
|
10
10
|
placement: {},
|
|
11
11
|
offset: {},
|
|
12
|
-
|
|
12
|
+
onEmpty: {}
|
|
13
13
|
},
|
|
14
14
|
__multiRoot: !1,
|
|
15
|
-
setup(
|
|
16
|
-
let
|
|
17
|
-
let e = { zIndex:
|
|
18
|
-
return
|
|
19
|
-
}), S =
|
|
20
|
-
|
|
15
|
+
setup(s, { expose: f }) {
|
|
16
|
+
let g = e("message"), _ = s, { nextZIndex: v } = t(), y = c(0), b = 0, x = i(() => {
|
|
17
|
+
let e = { zIndex: y.value };
|
|
18
|
+
return _.placement === "top" ? e.top = `${_.offset}px` : _.placement === "bottom" && (e.bottom = `${_.offset}px`), e;
|
|
19
|
+
}), S = c([]), C = (e) => {
|
|
20
|
+
y.value = v(), S.value.push(e);
|
|
21
21
|
}, w = (e) => {
|
|
22
22
|
let t = S.value.findIndex((t) => t.id === e);
|
|
23
23
|
t > -1 && S.value.splice(t, 1);
|
|
24
24
|
}, T = (e) => {
|
|
25
25
|
S.value.find((t) => t.id === e)?.destroy();
|
|
26
26
|
}, E = (e) => {
|
|
27
|
+
b++;
|
|
27
28
|
let t = e;
|
|
28
29
|
t.style.maxHeight = `${t.offsetHeight}px`, t.offsetWidth;
|
|
29
30
|
}, D = (e) => {
|
|
30
31
|
let t = e;
|
|
31
32
|
t.style.maxHeight = "0", t.offsetWidth;
|
|
32
33
|
}, O = (e) => {
|
|
34
|
+
b--;
|
|
33
35
|
let t = e;
|
|
34
|
-
t.style.maxHeight = "", t.style.overflow = "";
|
|
36
|
+
t.style.maxHeight = "", t.style.overflow = "", S.value.length === 0 && b === 0 && _.onEmpty?.();
|
|
35
37
|
}, k = (e) => {
|
|
36
38
|
let t = e;
|
|
37
39
|
t.style.transition = "none";
|
|
@@ -41,13 +43,13 @@ var g = p("<div>"), _ = /* @__PURE__ */ c({
|
|
|
41
43
|
let t = e;
|
|
42
44
|
t.style.maxHeight = "";
|
|
43
45
|
};
|
|
44
|
-
return
|
|
46
|
+
return f({
|
|
45
47
|
addMessage: C,
|
|
46
48
|
removeMessage: w,
|
|
47
49
|
getMessages: () => S.value
|
|
48
|
-
}),
|
|
49
|
-
class: () => [
|
|
50
|
-
name: () =>
|
|
50
|
+
}), a(r, {
|
|
51
|
+
class: () => [p(g).e("container"), p(g).m(`container-${s.placement}`)],
|
|
52
|
+
name: () => "message-fade",
|
|
51
53
|
style: () => x.value,
|
|
52
54
|
tag: () => "div",
|
|
53
55
|
onEnter: () => k,
|
|
@@ -55,14 +57,14 @@ var g = p("<div>"), _ = /* @__PURE__ */ c({
|
|
|
55
57
|
onBeforeLeave: () => E,
|
|
56
58
|
onAfterLeave: () => O,
|
|
57
59
|
onAfterEnter: () => A
|
|
58
|
-
}, { default:
|
|
59
|
-
let t =
|
|
60
|
-
return
|
|
61
|
-
let e =
|
|
62
|
-
|
|
63
|
-
}),
|
|
64
|
-
}, (e) => e.id)) }
|
|
60
|
+
}, { default: m(() => o(() => S.value, (e) => {
|
|
61
|
+
let t = h();
|
|
62
|
+
return l(() => {
|
|
63
|
+
let e = p(g);
|
|
64
|
+
u(t, [e.e("wrapper"), e.m(`wrapper-${s.placement}`)]);
|
|
65
|
+
}), d(t, null, 0), a(n, { $: [() => e.value, { onClose: () => () => T(e.value.id) }] }), t;
|
|
66
|
+
}, (e) => e.id)) }, !0);
|
|
65
67
|
}
|
|
66
68
|
});
|
|
67
69
|
//#endregion
|
|
68
|
-
export {
|
|
70
|
+
export { g as default };
|
|
@@ -1,62 +1,67 @@
|
|
|
1
1
|
import e from "./message-container.vue.mjs";
|
|
2
|
-
import { createComponent as t, nextTick as n,
|
|
2
|
+
import { createComponent as t, nextTick as n, reactive as r, remove as i, setInsertionState as a } from "vue";
|
|
3
3
|
//#region ../components/src/message/method.ts
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var o = null, s = null, c = 0, l = null, u = r({
|
|
5
|
+
placement: "top",
|
|
6
|
+
offset: 8
|
|
7
|
+
}), d = () => `message-${++c}`, f = () => s?.exposed ?? null, p = () => {
|
|
8
|
+
l &&= (clearTimeout(l), null), s &&= (i(s), null), o &&= (o.remove(), null);
|
|
7
9
|
}, m = () => {
|
|
8
10
|
l && clearTimeout(l), l = setTimeout(() => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
let e = f()?.getMessages();
|
|
12
|
+
e && e.length > 0 || p();
|
|
13
|
+
}, 1e3);
|
|
14
|
+
}, h = (e) => {
|
|
15
|
+
let t = f();
|
|
16
|
+
t && t.getMessages()?.some((t) => t.id === e) && (t.removeMessage(e), m());
|
|
17
|
+
}, g = (n) => {
|
|
18
|
+
s ||= (l &&= (clearTimeout(l), null), o = document.createElement("div"), document.body.appendChild(o), a(o, null), t(e, { $: [() => ({
|
|
19
|
+
...u,
|
|
20
|
+
onEmpty: p
|
|
21
|
+
})] }, null, !1, !1, n));
|
|
22
|
+
}, _ = (e) => ({
|
|
18
23
|
open: (t) => {
|
|
19
|
-
let { placement: r = "top", offset: i = 8, id: a = d(), grouping:
|
|
20
|
-
if (
|
|
21
|
-
let e = f()?.getMessages()?.find((e) => e.message ===
|
|
24
|
+
let { placement: r = "top", offset: i = 8, id: a = d(), grouping: o, message: c } = t;
|
|
25
|
+
if (o && c) {
|
|
26
|
+
let e = f()?.getMessages()?.find((e) => e.message === c);
|
|
22
27
|
if (e) return e.count = (e.count || 0) + 1, {
|
|
23
28
|
id: e.id,
|
|
24
29
|
close: () => {
|
|
25
|
-
|
|
30
|
+
h(e.id);
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
33
|
}
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
let
|
|
34
|
+
let l = !s;
|
|
35
|
+
u.placement = r, u.offset = i, g(e);
|
|
36
|
+
let p = {
|
|
32
37
|
...t,
|
|
33
38
|
id: a,
|
|
34
39
|
destroy: () => {
|
|
35
|
-
|
|
40
|
+
h(a);
|
|
36
41
|
},
|
|
37
42
|
placement: r,
|
|
38
43
|
offset: i,
|
|
39
44
|
count: 0
|
|
40
|
-
},
|
|
45
|
+
}, m = () => {
|
|
41
46
|
try {
|
|
42
|
-
f()?.addMessage(
|
|
47
|
+
f()?.addMessage(p);
|
|
43
48
|
} catch (e) {
|
|
44
49
|
console.warn("添加消息失败:", e);
|
|
45
50
|
}
|
|
46
51
|
};
|
|
47
|
-
return
|
|
52
|
+
return l ? n(m) : m(), {
|
|
48
53
|
id: a,
|
|
49
54
|
close: () => {
|
|
50
|
-
|
|
55
|
+
h(a);
|
|
51
56
|
}
|
|
52
57
|
};
|
|
53
58
|
},
|
|
54
59
|
close: (e) => {
|
|
55
|
-
|
|
60
|
+
h(e);
|
|
56
61
|
},
|
|
57
62
|
closeAll: () => {
|
|
58
|
-
|
|
63
|
+
p();
|
|
59
64
|
}
|
|
60
65
|
});
|
|
61
66
|
//#endregion
|
|
62
|
-
export {
|
|
67
|
+
export { _ as useMessage };
|
|
@@ -28,11 +28,13 @@ export declare const SRadioGroup: ((__VLS_props: NonNullable<Awaited<typeof __VL
|
|
|
28
28
|
slots: {
|
|
29
29
|
default?: (props: {}) => any;
|
|
30
30
|
};
|
|
31
|
-
emit: (event: "update:modelValue", value: string | number | boolean) => void;
|
|
31
|
+
emit: ((evt: "change", value: string | number | boolean) => void) & ((event: "update:modelValue", value: string | number | boolean) => void);
|
|
32
32
|
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
33
33
|
props: PublicProps & {
|
|
34
34
|
vertical?: boolean | undefined;
|
|
35
|
+
button?: boolean | undefined;
|
|
35
36
|
modelValue?: string | number | boolean | undefined;
|
|
37
|
+
onChange?: ((value: string | number | boolean) => any) | undefined;
|
|
36
38
|
"onUpdate:modelValue"?: ((value: string | number | boolean) => any) | undefined;
|
|
37
39
|
} & (typeof globalThis extends {
|
|
38
40
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -42,7 +44,7 @@ export declare const SRadioGroup: ((__VLS_props: NonNullable<Awaited<typeof __VL
|
|
|
42
44
|
slots: {
|
|
43
45
|
default?: (props: {}) => any;
|
|
44
46
|
};
|
|
45
|
-
emit: (event: "update:modelValue", value: string | number | boolean) => void;
|
|
47
|
+
emit: ((evt: "change", value: string | number | boolean) => void) & ((event: "update:modelValue", value: string | number | boolean) => void);
|
|
46
48
|
}>) => VNode & {
|
|
47
49
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
48
50
|
}) & Plugin;
|
|
@@ -4,6 +4,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
|
|
|
4
4
|
props: PublicProps & __VLS_PrettifyLocal<(RadioGroupProps & {
|
|
5
5
|
modelValue?: string | number | boolean;
|
|
6
6
|
}) & {
|
|
7
|
+
onChange?: ((value: string | number | boolean) => any) | undefined;
|
|
7
8
|
"onUpdate:modelValue"?: ((value: string | number | boolean) => any) | undefined;
|
|
8
9
|
}> & (typeof globalThis extends {
|
|
9
10
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -13,7 +14,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
|
|
|
13
14
|
slots: {
|
|
14
15
|
default?: (props: {}) => any;
|
|
15
16
|
};
|
|
16
|
-
emit: (event: "update:modelValue", value: string | number | boolean) => void;
|
|
17
|
+
emit: ((evt: "change", value: string | number | boolean) => void) & ((event: "update:modelValue", value: string | number | boolean) => void);
|
|
17
18
|
}>) => VNode & {
|
|
18
19
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
19
20
|
};
|
package/dist/es/components/src/radio/radio-group.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
2
2
|
import "../../../hooks/index.mjs";
|
|
3
3
|
import { radioGroupContextKey as t } from "./types.mjs";
|
|
4
|
-
import { createSlot as n, defineVaporComponent as r, mergeModels as i, provide as a, renderEffect as o, setClass as s, setInsertionState as c, template as l,
|
|
4
|
+
import { createSlot as n, defineVaporComponent as r, mergeModels as i, provide as a, renderEffect as o, setClass as s, setInsertionState as c, template as l, toRefs as u, unref as d, useModel as f } from "vue";
|
|
5
5
|
//#region ../components/src/radio/radio-group.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var p = l("<div>", !0), m = /* @__PURE__ */ r({
|
|
7
7
|
name: "SRadioGroup",
|
|
8
8
|
__name: "radio-group",
|
|
9
|
-
props: /* @__PURE__ */ i({
|
|
9
|
+
props: /* @__PURE__ */ i({
|
|
10
|
+
vertical: { type: Boolean },
|
|
11
|
+
button: { type: Boolean }
|
|
12
|
+
}, {
|
|
10
13
|
modelValue: {
|
|
11
14
|
type: [
|
|
12
15
|
String,
|
|
@@ -17,22 +20,27 @@ var f = l("<div>", !0), p = /* @__PURE__ */ r({
|
|
|
17
20
|
},
|
|
18
21
|
modelModifiers: {}
|
|
19
22
|
}),
|
|
20
|
-
emits: ["update:modelValue"],
|
|
23
|
+
emits: /* @__PURE__ */ i(["change"], ["update:modelValue"]),
|
|
21
24
|
__multiRoot: !1,
|
|
22
|
-
setup(r) {
|
|
23
|
-
let i = e("radio-group"),
|
|
25
|
+
setup(r, { emit: i }) {
|
|
26
|
+
let l = r, m = i, h = e("radio-group"), g = f(r, "modelValue"), _ = (e) => {
|
|
27
|
+
g.value = e, m("change", g.value);
|
|
28
|
+
}, { button: v } = u(l);
|
|
24
29
|
a(t, {
|
|
25
|
-
checked:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
checkedValue: l
|
|
30
|
+
checked: _,
|
|
31
|
+
checkedValue: g,
|
|
32
|
+
button: v
|
|
29
33
|
});
|
|
30
|
-
let
|
|
34
|
+
let y = p();
|
|
31
35
|
return o(() => {
|
|
32
|
-
let e =
|
|
33
|
-
s(
|
|
34
|
-
|
|
36
|
+
let e = d(h);
|
|
37
|
+
s(y, [
|
|
38
|
+
e.b(),
|
|
39
|
+
e.is("vertical", r.vertical),
|
|
40
|
+
e.is("button", d(v))
|
|
41
|
+
]);
|
|
42
|
+
}), c(y, null, 0), n("default", null), y;
|
|
35
43
|
}
|
|
36
44
|
});
|
|
37
45
|
//#endregion
|
|
38
|
-
export {
|
|
46
|
+
export { m as default };
|
package/dist/es/components/src/radio/radio.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -29,22 +29,27 @@ var x = _("<span></span>"), S = _(" "), C = _("<span>"), w = _("<label><input ty
|
|
|
29
29
|
emits: /* @__PURE__ */ l(["change"], ["update:modelValue"]),
|
|
30
30
|
__multiRoot: !1,
|
|
31
31
|
setup(s, { emit: l, slots: _ }) {
|
|
32
|
-
let T = s, E = l, D = e("radio"), O = c(t, void 0), k = b(s, "modelValue"),
|
|
33
|
-
e.target.checked && (
|
|
34
|
-
},
|
|
35
|
-
return u(
|
|
36
|
-
let e = y(D);
|
|
37
|
-
f(
|
|
38
|
-
|
|
32
|
+
let T = s, E = l, D = e("radio"), O = c(t, void 0), k = r(() => O?.button.value), A = b(s, "modelValue"), j = r(() => O?.checkedValue.value === T.value), M = (e) => {
|
|
33
|
+
e.target.checked && (A.value = T.value), O?.checked(A.value), E("change", A.value, e);
|
|
34
|
+
}, N = w(), P = n(N);
|
|
35
|
+
return u(P, "change", a(M)), d(() => {
|
|
36
|
+
let e = y(D), t = j.value;
|
|
37
|
+
f(N, [
|
|
38
|
+
e.b(),
|
|
39
|
+
e.m(s.size),
|
|
40
|
+
e.is("checked", t),
|
|
41
|
+
e.is("button", k.value)
|
|
42
|
+
]), f(P, [e.e("input")]), g(P, s.value), m(P, "checked", t);
|
|
43
|
+
}), p(N, null, 1), i(() => !_.check, () => {
|
|
39
44
|
let e = x(), t = C();
|
|
40
45
|
return d(() => {
|
|
41
46
|
let n = y(D);
|
|
42
|
-
f(e, [n.e("inner")
|
|
47
|
+
f(e, [n.e("inner")]), f(t, [n.e("label")]);
|
|
43
48
|
}), p(t, null, 0), o("default", null, () => {
|
|
44
49
|
let e = S();
|
|
45
50
|
return d(() => h(e, v(s.label))), e;
|
|
46
51
|
}), [e, t];
|
|
47
|
-
}, null, 2), p(
|
|
52
|
+
}, null, 2), p(N, null, 2), o("check", { checked: () => j.value }), N;
|
|
48
53
|
}
|
|
49
54
|
});
|
|
50
55
|
//#endregion
|