savor-ui 0.23.1 → 0.24.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 +20 -0
- package/dist/es/components/index.d.ts +2 -0
- package/dist/es/components/index.mjs +4 -0
- package/dist/es/components/src/avatar/avatar-group.d.ts +22 -0
- package/dist/es/components/src/avatar/avatar-group.vue.mjs +44 -0
- package/dist/es/components/src/avatar/avatar.vue.mjs +27 -26
- package/dist/es/components/src/avatar/index.d.ts +23 -0
- package/dist/es/components/src/avatar/index.mjs +4 -2
- package/dist/es/components/src/avatar/types.d.ts +14 -0
- package/dist/es/components/src/avatar/types.mjs +4 -0
- package/dist/es/components/src/card/card.vue.mjs +3 -1
- package/dist/es/components/src/card/index.d.ts +1 -0
- package/dist/es/components/src/card/types.d.ts +2 -0
- package/dist/es/components/src/dropdown/doption.vue.mjs +23 -20
- package/dist/es/components/src/dropdown/dsubmenu.vue.mjs +24 -21
- package/dist/es/components/src/dropdown/index.d.ts +2 -0
- package/dist/es/components/src/dropdown/types.d.ts +4 -0
- package/dist/es/components/src/menu/index.d.ts +3 -0
- package/dist/es/components/src/menu/menu-item.vue.mjs +12 -5
- package/dist/es/components/src/menu/menu.vue.mjs +24 -18
- package/dist/es/components/src/menu/sub-menu.vue.mjs +80 -81
- package/dist/es/components/src/menu/types.d.ts +10 -1
- package/dist/es/components/src/modal/index.d.ts +1 -1
- package/dist/es/components/src/modal/modal.vue.mjs +95 -90
- package/dist/es/components/src/modal/types.d.ts +11 -7
- package/dist/es/components/src/notification/index.d.ts +3 -0
- package/dist/es/components/src/notification/index.mjs +1 -0
- package/dist/es/components/src/notification/method.d.ts +3 -0
- package/dist/es/components/src/notification/method.mjs +67 -0
- package/dist/es/components/src/notification/notification-container.d.ts +23 -0
- package/dist/es/components/src/notification/notification-container.vue.mjs +70 -0
- package/dist/es/components/src/notification/notification.d.ts +22 -0
- package/dist/es/components/src/notification/notification.vue.mjs +72 -0
- package/dist/es/components/src/notification/types.d.ts +51 -0
- package/dist/es/components/src/overflow-list/index.d.ts +21 -0
- package/dist/es/components/src/overflow-list/index.mjs +7 -0
- package/dist/es/components/src/overflow-list/overflow-list.d.ts +20 -0
- package/dist/es/components/src/overflow-list/overflow-list.vue.mjs +70 -0
- package/dist/es/components/src/overflow-list/types.d.ts +17 -0
- package/dist/es/components/src/space/space.vue.mjs +1 -1
- package/dist/es/components/src/tree/index.d.ts +1 -0
- package/dist/es/components/src/tree/node.d.ts +1 -0
- package/dist/es/components/src/tree/node.vue.mjs +3 -1
- package/dist/es/components/src/tree/tree.vue.mjs +14 -20
- package/dist/es/components/src/tree/types.d.ts +2 -0
- package/dist/es/components/src/tree-select/tree-select.vue.mjs +5 -5
- package/dist/es/core/components.mjs +95 -92
- package/dist/es/core/global.d.ts +2 -0
- package/dist/es/core/index.mjs +83 -80
- package/dist/es/theme/components/avatar.scss +13 -2
- package/dist/es/theme/components/card.scss +6 -0
- package/dist/es/theme/components/dropdown.scss +4 -16
- package/dist/es/theme/components/index.scss +2 -0
- package/dist/es/theme/components/menu.scss +41 -26
- package/dist/es/theme/components/modal.scss +27 -5
- package/dist/es/theme/components/notification.scss +164 -0
- package/dist/es/theme/components/overflow-list.scss +13 -0
- package/dist/es/theme/components/scrollbar.scss +4 -4
- package/dist/es/theme/components/tree.scss +19 -2
- package/dist/es/utils/src/theme/themeMap.mjs +6 -6
- package/dist/json/vetur-attributes.json +83 -4
- package/dist/json/vetur-tags.json +39 -6
- package/dist/json/web-types.json +218 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
# [0.24.0](https://gitee.com/mach552/savor-ui/compare/v0.23.1...v0.24.0) (2026-08-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **menu:** 修复样式变量没有给弹层传递的问题 ([a78d58b](https://gitee.com/mach552/savor-ui/commits/a78d58bb4f9461d7065f10829b1fb0b1d3fd5783))
|
|
11
|
+
* **tree:** 修复样式错误问题 ([0efa579](https://gitee.com/mach552/savor-ui/commits/0efa579bacb9c62e96856cab9a437778b10a5a17))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **avatar:** 新增`avatar-group`头像组组件 ([66e0a5b](https://gitee.com/mach552/savor-ui/commits/66e0a5be721e79525c1ea26fdfc455c70a083743))
|
|
17
|
+
* **card:** 新增`size`属性 ([b8847bb](https://gitee.com/mach552/savor-ui/commits/b8847bbd836b602467c34b6029c540c0a13bc8b6))
|
|
18
|
+
* **dropdown:** 新增`divider`属性 ([7e00c1d](https://gitee.com/mach552/savor-ui/commits/7e00c1d60c0db186b9f1fb3201cd7ed28b59c294))
|
|
19
|
+
* **menu:** 新增菜单项高度属性 ([57f2f15](https://gitee.com/mach552/savor-ui/commits/57f2f1517f8aa473ae7174605303b9c41fb71eee))
|
|
20
|
+
* **modal:** 新增分割线属性和额外内容插槽 ([7d67281](https://gitee.com/mach552/savor-ui/commits/7d67281fc1e162eb61936500a9775e1c9c2734a3))
|
|
21
|
+
* **notification:** 新增`notification`通知组件 ([dc8a727](https://gitee.com/mach552/savor-ui/commits/dc8a7272f25db93bb3ca2f0605842879499bec02))
|
|
22
|
+
* **overflow-list:** 新增折叠列表组件 ([8fc0209](https://gitee.com/mach552/savor-ui/commits/8fc020930c1a6a073b8ac7788c724906b5bdfe41))
|
|
23
|
+
* **tree:** 新增激活条属性 ([32681a6](https://gitee.com/mach552/savor-ui/commits/32681a612db83b6530a9cd6b838f8371a1ab00da))
|
|
24
|
+
|
|
5
25
|
## [0.23.1](https://gitee.com/mach552/savor-ui/compare/v0.23.0...v0.23.1) (2026-08-19)
|
|
6
26
|
|
|
7
27
|
|
|
@@ -41,6 +41,8 @@ export * from './src/menu';
|
|
|
41
41
|
export * from './src/message';
|
|
42
42
|
export * from './src/meter-group';
|
|
43
43
|
export * from './src/modal';
|
|
44
|
+
export * from './src/notification';
|
|
45
|
+
export * from './src/overflow-list';
|
|
44
46
|
export * from './src/pagination';
|
|
45
47
|
export * from './src/panel';
|
|
46
48
|
export * from './src/popover';
|
|
@@ -13,6 +13,7 @@ import "./src/button/types.mjs";
|
|
|
13
13
|
import "./src/back-top/index.mjs";
|
|
14
14
|
import "./src/scrollbar/index.mjs";
|
|
15
15
|
import "./src/auto-complete/index.mjs";
|
|
16
|
+
import "./src/avatar/types.mjs";
|
|
16
17
|
import "./src/avatar/index.mjs";
|
|
17
18
|
import "./src/badge/index.mjs";
|
|
18
19
|
import "./src/button/index.mjs";
|
|
@@ -66,6 +67,9 @@ import "./src/message/index.mjs";
|
|
|
66
67
|
import "./src/meter-group/index.mjs";
|
|
67
68
|
import "./src/modal/method.mjs";
|
|
68
69
|
import "./src/modal/index.mjs";
|
|
70
|
+
import "./src/notification/method.mjs";
|
|
71
|
+
import "./src/notification/index.mjs";
|
|
72
|
+
import "./src/overflow-list/index.mjs";
|
|
69
73
|
import "./src/pagination/index.mjs";
|
|
70
74
|
import "./src/panel/index.mjs";
|
|
71
75
|
import "./src/progress/index.mjs";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AvatarGroupProps } from './types';
|
|
2
|
+
import { PublicProps, VNode } from 'vue';
|
|
3
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: PublicProps & __VLS_PrettifyLocal<AvatarGroupProps> & (typeof globalThis extends {
|
|
5
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
6
|
+
} ? P : {});
|
|
7
|
+
expose: (exposed: {}) => void;
|
|
8
|
+
attrs: any;
|
|
9
|
+
slots: {
|
|
10
|
+
default?: (props: {}) => any;
|
|
11
|
+
};
|
|
12
|
+
emit: {};
|
|
13
|
+
}>) => VNode & {
|
|
14
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
19
|
+
[K in keyof T]: T[K];
|
|
20
|
+
} : {
|
|
21
|
+
[K in keyof T as K]: T[K];
|
|
22
|
+
}) & {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getSizeNum as e } from "../../../utils/src/tool.mjs";
|
|
2
|
+
import "../../../utils/index.mjs";
|
|
3
|
+
import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
|
|
4
|
+
import "../../../hooks/index.mjs";
|
|
5
|
+
import { avatarGroupContextKey as n } from "./types.mjs";
|
|
6
|
+
import r from "./avatar.vue.mjs";
|
|
7
|
+
import { createComponent as i, createIf as a, createSlot as o, defineVaporComponent as s, onMounted as c, onUnmounted as l, provide as u, ref as d, renderEffect as f, setClass as p, setInsertionState as m, setStaticTemplateRef as h, setStyle as g, setText as _, template as v, toDisplayString as y, toRefs as b, unref as x, useTemplateRef as S, watch as C } from "vue";
|
|
8
|
+
//#region ../components/src/avatar/avatar-group.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
9
|
+
var w = v(" "), T = v("<div>", 1), E = /*@__PURE__*/ s({
|
|
10
|
+
name: "SAvatarGroup",
|
|
11
|
+
__name: "avatar-group",
|
|
12
|
+
props: {
|
|
13
|
+
size: { default: 40 },
|
|
14
|
+
circle: { type: Boolean },
|
|
15
|
+
max: {}
|
|
16
|
+
},
|
|
17
|
+
setup(s) {
|
|
18
|
+
let v = s, { size: E, circle: D } = b(v), O = t("avatar"), k = S("groupRef"), A = d(0), j = () => {
|
|
19
|
+
let e = k.value;
|
|
20
|
+
if (!e) return;
|
|
21
|
+
let t = v.max, n = O.e("excess"), r = Array.from(e.children).filter((e) => !e.classList.contains(n)), i = 0;
|
|
22
|
+
r.forEach((e, n) => {
|
|
23
|
+
t != null && n >= t ? (i++, e.style.display = "none") : e.style.display = "";
|
|
24
|
+
}), A.value = i;
|
|
25
|
+
}, M = null;
|
|
26
|
+
c(() => {
|
|
27
|
+
j(), M = new MutationObserver(j), M.observe(k.value, { childList: !0 });
|
|
28
|
+
}), l(() => {
|
|
29
|
+
M?.disconnect(), M = null;
|
|
30
|
+
}), C(() => v.max, j), u(n, {
|
|
31
|
+
size: E,
|
|
32
|
+
circle: D
|
|
33
|
+
});
|
|
34
|
+
let N = T();
|
|
35
|
+
return f(() => {
|
|
36
|
+
p(N, [x(O).e("group")]), g(N, { "--s-avatar-group-gap": `-${x(e)(x(E)) / 3}px` });
|
|
37
|
+
}), m(N, null, 0), o(), m(N, null, 1), a(() => A.value > 0, () => i(r, { class: () => x(O).e("excess") }, () => {
|
|
38
|
+
let e = w();
|
|
39
|
+
return f(() => _(e, " +" + y(A.value))), e;
|
|
40
|
+
})), h(N, k, null, "groupRef"), N;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
export { E as default };
|
|
@@ -3,11 +3,12 @@ import "../../../utils/index.mjs";
|
|
|
3
3
|
import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
|
|
4
4
|
import "../../../hooks/index.mjs";
|
|
5
5
|
import { EditLine as n } from "../../../icons/src/svg/editor/index.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { avatarGroupContextKey as r } from "./types.mjs";
|
|
7
|
+
import { child as i, computed as a, createComponent as o, createIf as s, createInvoker as c, createSlot as l, defineVaporComponent as u, delegateEvents as d, inject as f, renderEffect as p, setClass as m, setInsertionState as h, setStyle as g, template as _, unref as v } from "vue";
|
|
7
8
|
//#region ../components/src/avatar/avatar.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
9
|
+
var y = _("<div>"), b = _("<div><div></div>", 1);
|
|
10
|
+
d("click");
|
|
11
|
+
var x = /*@__PURE__*/ u({
|
|
11
12
|
name: "SAvatar",
|
|
12
13
|
__name: "avatar",
|
|
13
14
|
props: {
|
|
@@ -17,30 +18,30 @@ var y = /*@__PURE__*/ l({
|
|
|
17
18
|
edit: { type: Boolean }
|
|
18
19
|
},
|
|
19
20
|
emits: ["click"],
|
|
20
|
-
setup(
|
|
21
|
-
let
|
|
22
|
-
width: e(
|
|
23
|
-
height: e(
|
|
24
|
-
backgroundColor:
|
|
25
|
-
})),
|
|
26
|
-
let t = e(
|
|
21
|
+
setup(u, { emit: d }) {
|
|
22
|
+
let _ = u, x = t("avatar"), S = d, C = f(r, void 0), w = a(() => ({
|
|
23
|
+
width: e(C?.size.value || _.size),
|
|
24
|
+
height: e(C?.size.value || _.size),
|
|
25
|
+
backgroundColor: _.bgColor || "var(--s-color-fill-2) "
|
|
26
|
+
})), T = a(() => {
|
|
27
|
+
let t = e(C?.size.value || _.size);
|
|
27
28
|
return { fontSize: Number(t.replace("px", "")) * .4 + "px" };
|
|
28
|
-
}),
|
|
29
|
-
let t = e(
|
|
29
|
+
}), E = a(() => {
|
|
30
|
+
let t = e(_.size || C?.size.value);
|
|
30
31
|
return { fontSize: Number(t.replace("px", "")) * .4 + "px" };
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
return
|
|
35
|
-
let e =
|
|
36
|
-
|
|
37
|
-
}),
|
|
38
|
-
let e =
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
}),
|
|
32
|
+
}), D = (e) => {
|
|
33
|
+
S("click", e);
|
|
34
|
+
}, O = b(), k = i(O);
|
|
35
|
+
return p(() => {
|
|
36
|
+
let e = v(x);
|
|
37
|
+
m(O, [e.b(), { [e.m("circle")]: u.circle || v(C)?.circle.value }]), g(O, w.value), m(k, [e.e("content")]), g(k, T.value);
|
|
38
|
+
}), h(k, null, 0), l(), h(O, null, 1), s(() => u.edit, () => {
|
|
39
|
+
let e = y();
|
|
40
|
+
return p(() => {
|
|
41
|
+
m(e, [v(x).e("edit")]), g(e, E.value);
|
|
42
|
+
}), h(e, null, 0), o(v(n)), e.$evtclick = c(D), e;
|
|
43
|
+
}), O;
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
//#endregion
|
|
46
|
-
export {
|
|
47
|
+
export { x as default };
|
|
@@ -21,4 +21,27 @@ export declare const SAvatar: ((__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
21
21
|
}>) => VNode & {
|
|
22
22
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
23
23
|
}) & Plugin;
|
|
24
|
+
export declare const SAvatarGroup: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
25
|
+
attrs: any;
|
|
26
|
+
slots: {
|
|
27
|
+
default?: (props: {}) => any;
|
|
28
|
+
};
|
|
29
|
+
emit: {};
|
|
30
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
31
|
+
props: PublicProps & {
|
|
32
|
+
size?: number | string | undefined;
|
|
33
|
+
circle?: boolean | undefined;
|
|
34
|
+
max?: number | undefined;
|
|
35
|
+
} & (typeof globalThis extends {
|
|
36
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
37
|
+
} ? P : {});
|
|
38
|
+
expose: (exposed: {}) => void;
|
|
39
|
+
attrs: any;
|
|
40
|
+
slots: {
|
|
41
|
+
default?: (props: {}) => any;
|
|
42
|
+
};
|
|
43
|
+
emit: {};
|
|
44
|
+
}>) => VNode & {
|
|
45
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
46
|
+
}) & Plugin;
|
|
24
47
|
export * from './types';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { withInstall as e } from "../../../utils/src/install.mjs";
|
|
2
2
|
import "../../../utils/index.mjs";
|
|
3
|
+
import "./types.mjs";
|
|
3
4
|
import t from "./avatar.vue.mjs";
|
|
5
|
+
import n from "./avatar-group.vue.mjs";
|
|
4
6
|
//#region ../components/src/avatar/index.ts
|
|
5
|
-
var
|
|
7
|
+
var r = e(t), i = e(n);
|
|
6
8
|
//#endregion
|
|
7
|
-
export {
|
|
9
|
+
export { r as SAvatar, i as SAvatarGroup };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
1
2
|
export interface AvatarProps {
|
|
2
3
|
/** 头像大小
|
|
3
4
|
* @default 40px
|
|
@@ -19,3 +20,16 @@ export interface AvatarSlots {
|
|
|
19
20
|
/** 默认插槽 */
|
|
20
21
|
default?: () => any;
|
|
21
22
|
}
|
|
23
|
+
export interface AvatarGroupProps {
|
|
24
|
+
/** 头像组大小 */
|
|
25
|
+
size?: number | string;
|
|
26
|
+
/** 是否圆形 */
|
|
27
|
+
circle?: boolean;
|
|
28
|
+
/** 最大显示数量 */
|
|
29
|
+
max?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface AvatarGroupContext {
|
|
32
|
+
size: Ref<number | string>;
|
|
33
|
+
circle: Ref<boolean>;
|
|
34
|
+
}
|
|
35
|
+
export declare const avatarGroupContextKey: InjectionKey<AvatarGroupContext>;
|
|
@@ -13,7 +13,8 @@ var p = d("<div>"), m = d("<div><div></div>"), h = d("<div><div>", 1), g = /*@__
|
|
|
13
13
|
shadow: { default: "never" },
|
|
14
14
|
bordered: { type: Boolean },
|
|
15
15
|
bodyStyle: {},
|
|
16
|
-
titleProps: {}
|
|
16
|
+
titleProps: {},
|
|
17
|
+
size: { default: "large" }
|
|
17
18
|
},
|
|
18
19
|
setup(o, { slots: d }) {
|
|
19
20
|
let g = e("card"), _ = h(), v = n(_, 1);
|
|
@@ -21,6 +22,7 @@ var p = d("<div>"), m = d("<div><div></div>"), h = d("<div><div>", 1), g = /*@__
|
|
|
21
22
|
let e = f(g);
|
|
22
23
|
c(_, [
|
|
23
24
|
e.b(),
|
|
25
|
+
e.m(o.size),
|
|
24
26
|
e.m(o.shadow),
|
|
25
27
|
{ [e.m("bordered")]: o.bordered }
|
|
26
28
|
]);
|
|
@@ -14,6 +14,7 @@ export declare const SCard: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setu
|
|
|
14
14
|
bordered?: boolean | undefined;
|
|
15
15
|
bodyStyle?: Record<string, string> | undefined;
|
|
16
16
|
titleProps?: TextProps | undefined;
|
|
17
|
+
size?: "mini" | "small" | "medium" | "large" | "larger" | undefined;
|
|
17
18
|
} & (typeof globalThis extends {
|
|
18
19
|
__VLS_PROPS_FALLBACK: infer P;
|
|
19
20
|
} ? P : {});
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
2
2
|
import "../../../hooks/index.mjs";
|
|
3
3
|
import { SIcon as t } from "../icon/index.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { SDivider as n } from "../divider/index.mjs";
|
|
5
|
+
import { dropdownContextKey as r } from "./types.mjs";
|
|
6
|
+
import { child as i, createComponent as a, createIf as o, createInvoker as s, createSlot as c, defineVaporComponent as l, delegateEvents as u, inject as d, renderEffect as f, setClass as p, setInsertionState as m, setText as h, template as g, toDisplayString as _, unref as v } from "vue";
|
|
6
7
|
//#region ../components/src/dropdown/doption.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
8
|
+
var y = g("<div>"), b = g(" "), x = g("<div><div></div>");
|
|
9
|
+
u("click");
|
|
10
|
+
var S = /*@__PURE__*/ l({
|
|
10
11
|
name: "SDoption",
|
|
11
12
|
__name: "doption",
|
|
12
13
|
props: {
|
|
13
14
|
title: {},
|
|
14
15
|
delayClose: { type: Boolean },
|
|
15
|
-
icon: {}
|
|
16
|
+
icon: {},
|
|
17
|
+
divider: { type: Boolean }
|
|
16
18
|
},
|
|
17
19
|
emits: ["click"],
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return d(() => f(e, [_(C).e("icon")])), p(e, null, 0), s("icon", null, () => i(_(t), { name: () => c.icon })), e;
|
|
25
|
-
}), d(() => f(D, [_(C).e("title")])), p(D, null, 0), s("default", null, () => {
|
|
20
|
+
__multiRoot: !0,
|
|
21
|
+
setup(l, { emit: u, slots: g }) {
|
|
22
|
+
let S = l, C = u, w = e("droption"), T = d(r, void 0), E = async () => {
|
|
23
|
+
S.delayClose ? (await T?.itemClick?.(), C("click")) : (T?.itemClick?.(), C("click"));
|
|
24
|
+
}, D = o(() => l.divider, () => a(v(n), { margin: 4 })), O = x(), k = i(O, 1);
|
|
25
|
+
return f(() => p(O, [v(w).b()])), m(O, 0, 0), o(() => g.icon || l.icon, () => {
|
|
26
26
|
let e = y();
|
|
27
|
-
return
|
|
28
|
-
}), p(
|
|
29
|
-
let e =
|
|
30
|
-
return
|
|
31
|
-
}),
|
|
27
|
+
return f(() => p(e, [v(w).e("icon")])), m(e, null, 0), c("icon", null, () => a(v(t), { name: () => l.icon })), e;
|
|
28
|
+
}), f(() => p(k, [v(w).e("title")])), m(k, null, 0), c("default", null, () => {
|
|
29
|
+
let e = b();
|
|
30
|
+
return f(() => h(e, _(l.title))), e;
|
|
31
|
+
}), m(O, null, 2), o(() => g.extra, () => {
|
|
32
|
+
let e = y();
|
|
33
|
+
return f(() => p(e, [v(w).e("extra")])), m(e, null, 0), c("extra"), e;
|
|
34
|
+
}), O.$evtclick = s(E), [D, O];
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
//#endregion
|
|
35
|
-
export {
|
|
38
|
+
export { S as default };
|
|
@@ -3,45 +3,48 @@ import "../../../hooks/index.mjs";
|
|
|
3
3
|
import { RightLine as t } from "../../../icons/src/svg/arrow/index.mjs";
|
|
4
4
|
import { SPopover as n } from "../popover/index.mjs";
|
|
5
5
|
import { SIcon as r } from "../icon/index.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { SDivider as i } from "../divider/index.mjs";
|
|
7
|
+
import { dropdownContextKey as a } from "./types.mjs";
|
|
8
|
+
import { child as o, createComponent as s, createIf as c, createInvoker as l, createSlot as u, defineVaporComponent as d, delegateEvents as f, inject as p, next as m, renderEffect as h, setClass as g, setInsertionState as _, setText as v, template as y, toDisplayString as b, unref as x } from "vue";
|
|
8
9
|
//#region ../components/src/dropdown/dsubmenu.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var T = /*@__PURE__*/
|
|
10
|
+
var S = y("<div>"), C = y(" "), w = y("<div><div></div><div></div></div>");
|
|
11
|
+
f("click");
|
|
12
|
+
var T = /*@__PURE__*/ d({
|
|
12
13
|
name: "SDsubmenu",
|
|
13
14
|
__name: "dsubmenu",
|
|
14
15
|
props: {
|
|
15
16
|
title: {},
|
|
16
17
|
popoverProps: {},
|
|
17
|
-
icon: {}
|
|
18
|
+
icon: {},
|
|
19
|
+
divider: { type: Boolean }
|
|
18
20
|
},
|
|
19
21
|
emits: ["click"],
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
__multiRoot: !0,
|
|
23
|
+
setup(d, { emit: f, slots: y }) {
|
|
24
|
+
let T = f, E = e("dsubmenu"), D = p(a, void 0), O = () => {
|
|
22
25
|
D?.itemClick?.(), T("click");
|
|
23
|
-
}, k =
|
|
24
|
-
return
|
|
26
|
+
}, k = c(() => d.divider, () => s(x(i), { margin: 4 })), A = S();
|
|
27
|
+
return h(() => g(A, [x(E).b()])), _(A, null, 0), s(x(n), { $: [() => ({
|
|
25
28
|
teleportBody: !1,
|
|
26
29
|
trigger: "hover",
|
|
27
30
|
placement: "right-start",
|
|
28
|
-
...
|
|
31
|
+
...d.popoverProps
|
|
29
32
|
})] }, {
|
|
30
33
|
content: () => {
|
|
31
|
-
let e =
|
|
32
|
-
return
|
|
34
|
+
let e = S();
|
|
35
|
+
return h(() => g(e, x(E).e("list"))), _(e, null, 0), u("content"), e;
|
|
33
36
|
},
|
|
34
37
|
default: () => {
|
|
35
|
-
let e =
|
|
36
|
-
return
|
|
37
|
-
let e = x();
|
|
38
|
-
return m(() => h(e, [b(E).e("icon")])), g(e, null, 0), l("icon", null, () => o(b(r), { name: () => u.icon })), e;
|
|
39
|
-
}), m(() => h(n, [b(E).e("title")])), g(n, null, 0), l("title", null, () => {
|
|
38
|
+
let e = w(), n = o(e, 1), i = m(n, 2);
|
|
39
|
+
return h(() => g(e, x(E).e("item"))), _(e, 0, 0), c(() => y.icon || d.icon, () => {
|
|
40
40
|
let e = S();
|
|
41
|
-
return
|
|
42
|
-
}),
|
|
41
|
+
return h(() => g(e, [x(E).e("icon")])), _(e, null, 0), u("icon", null, () => s(x(r), { name: () => d.icon })), e;
|
|
42
|
+
}), h(() => g(n, [x(E).e("title")])), _(n, null, 0), u("title", null, () => {
|
|
43
|
+
let e = C();
|
|
44
|
+
return h(() => v(e, b(d.title))), e;
|
|
45
|
+
}), h(() => g(i, [x(E).e("arrow")])), _(i, null, 0), s(x(t)), e.$evtclick = l(O), e;
|
|
43
46
|
}
|
|
44
|
-
}), k;
|
|
47
|
+
}), [k, A];
|
|
45
48
|
}
|
|
46
49
|
});
|
|
47
50
|
//#endregion
|
|
@@ -27,6 +27,7 @@ export declare const SDoption: ((__VLS_props: NonNullable<Awaited<typeof __VLS_s
|
|
|
27
27
|
title?: string | undefined;
|
|
28
28
|
delayClose?: boolean | undefined;
|
|
29
29
|
icon?: string | undefined;
|
|
30
|
+
divider?: boolean | undefined;
|
|
30
31
|
onClick?: (() => any) | undefined;
|
|
31
32
|
} & (typeof globalThis extends {
|
|
32
33
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -47,6 +48,7 @@ export declare const SDsubmenu: ((__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
|
47
48
|
title?: string | undefined;
|
|
48
49
|
popoverProps?: PopoverProps | undefined;
|
|
49
50
|
icon?: string | undefined;
|
|
51
|
+
divider?: boolean | undefined;
|
|
50
52
|
onClick?: (() => any) | undefined;
|
|
51
53
|
} & (typeof globalThis extends {
|
|
52
54
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -17,6 +17,8 @@ export interface DroptionProps {
|
|
|
17
17
|
delayClose?: boolean;
|
|
18
18
|
/** 图标 */
|
|
19
19
|
icon?: string;
|
|
20
|
+
/** 分隔线 */
|
|
21
|
+
divider?: boolean;
|
|
20
22
|
}
|
|
21
23
|
export interface DroptionSlots {
|
|
22
24
|
/** 默认 */
|
|
@@ -37,6 +39,8 @@ export interface DsubmenuProps {
|
|
|
37
39
|
popoverProps?: PopoverProps;
|
|
38
40
|
/** 图标 */
|
|
39
41
|
icon?: string;
|
|
42
|
+
/** 分隔线 */
|
|
43
|
+
divider?: boolean;
|
|
40
44
|
}
|
|
41
45
|
export interface DsubmenuSlots {
|
|
42
46
|
/** 默认 */
|
|
@@ -34,6 +34,7 @@ export declare const SMenuItem: ((__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
|
34
34
|
item?: any;
|
|
35
35
|
ignoreLevel?: boolean | undefined;
|
|
36
36
|
icon?: string | undefined;
|
|
37
|
+
activePosition?: "left" | "right" | "center" | undefined;
|
|
37
38
|
} & (typeof globalThis extends {
|
|
38
39
|
__VLS_PROPS_FALLBACK: infer P;
|
|
39
40
|
} ? P : {});
|
|
@@ -52,6 +53,7 @@ export declare const SMenu: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setu
|
|
|
52
53
|
props: PublicProps & {
|
|
53
54
|
collapsed?: boolean | undefined;
|
|
54
55
|
width?: string | number | undefined;
|
|
56
|
+
itemHeight?: string | number | undefined;
|
|
55
57
|
collapsedWidth?: number | undefined;
|
|
56
58
|
openKeys?: (string[] & (string | number)[]) | undefined;
|
|
57
59
|
selectedKey?: string | undefined;
|
|
@@ -62,6 +64,7 @@ export declare const SMenu: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setu
|
|
|
62
64
|
activeTextColor?: string | undefined;
|
|
63
65
|
activeBgColor?: string | undefined;
|
|
64
66
|
hoverBgColor?: string | undefined;
|
|
67
|
+
activePosition?: "left" | "right" | "center" | undefined;
|
|
65
68
|
activeKey?: string | number | undefined;
|
|
66
69
|
onItemClick?: ((name: string | number, item: any) => any) | undefined;
|
|
67
70
|
onOpenChange?: ((keys: string[]) => any) | undefined;
|
|
@@ -16,7 +16,8 @@ var k = /*@__PURE__*/ d({
|
|
|
16
16
|
disabled: { type: Boolean },
|
|
17
17
|
item: {},
|
|
18
18
|
ignoreLevel: { type: Boolean },
|
|
19
|
-
icon: {}
|
|
19
|
+
icon: {},
|
|
20
|
+
activePosition: {}
|
|
20
21
|
},
|
|
21
22
|
setup(d, { slots: f }) {
|
|
22
23
|
let b = d, k = e("menu"), A = C("itemRef"), j = p(r, void 0), M = p(a, void 0), N = p(i, void 0), P = () => {
|
|
@@ -40,11 +41,14 @@ var k = /*@__PURE__*/ d({
|
|
|
40
41
|
default: () => {
|
|
41
42
|
let e = E(), t = o(e, 1);
|
|
42
43
|
return h(() => {
|
|
43
|
-
let t = S(k);
|
|
44
|
+
let t = S(k), n = S(j), r = d.activePosition, i = n.activePosition;
|
|
44
45
|
g(e, [
|
|
45
46
|
t.e("item-title"),
|
|
46
47
|
t.is("disabled", d.disabled),
|
|
47
|
-
t.is("active",
|
|
48
|
+
t.is("active", n?.activeKey.value === d.name),
|
|
49
|
+
t.is("active-center", r === "center" || i.value === "center"),
|
|
50
|
+
t.is("active-left", r === "left" || i.value === "left"),
|
|
51
|
+
t.is("active-right", r === "right" || i.value === "right")
|
|
48
52
|
]);
|
|
49
53
|
}), _(e, 0, 0), c(() => f.icon || d.icon, () => {
|
|
50
54
|
let e = w();
|
|
@@ -57,11 +61,14 @@ var k = /*@__PURE__*/ d({
|
|
|
57
61
|
}), () => {
|
|
58
62
|
let e = D(), t = o(e, 1);
|
|
59
63
|
return h(() => {
|
|
60
|
-
let t = S(k);
|
|
64
|
+
let t = S(k), n = d.activePosition;
|
|
61
65
|
g(e, [
|
|
62
66
|
t.e("item-title"),
|
|
63
67
|
t.is("disabled", d.disabled),
|
|
64
|
-
t.is("active", S(j)?.activeKey.value === d.name)
|
|
68
|
+
t.is("active", S(j)?.activeKey.value === d.name),
|
|
69
|
+
t.is("active-center", n === "center"),
|
|
70
|
+
t.is("active-left", n === "left"),
|
|
71
|
+
t.is("active-right", n === "right")
|
|
65
72
|
]);
|
|
66
73
|
}), _(e, 0, 0), c(() => f.icon || d.icon, () => {
|
|
67
74
|
let e = w();
|
|
@@ -13,6 +13,7 @@ var S = _("<div>"), C = _("<div>", 1), w = /*@__PURE__*/ c({
|
|
|
13
13
|
props: /*@__PURE__*/ l({
|
|
14
14
|
collapsed: { type: Boolean },
|
|
15
15
|
width: { default: 220 },
|
|
16
|
+
itemHeight: { default: 40 },
|
|
16
17
|
collapsedWidth: { default: 48 },
|
|
17
18
|
openKeys: {},
|
|
18
19
|
selectedKey: {},
|
|
@@ -22,7 +23,8 @@ var S = _("<div>"), C = _("<div>", 1), w = /*@__PURE__*/ c({
|
|
|
22
23
|
textColor: { default: "var(--s-color-text-1)" },
|
|
23
24
|
activeTextColor: { default: "var(--s-color-primary-6)" },
|
|
24
25
|
activeBgColor: { default: "var(--s-color-primary-1)" },
|
|
25
|
-
hoverBgColor: { default: "var(--s-color-fill-2)" }
|
|
26
|
+
hoverBgColor: { default: "var(--s-color-fill-2)" },
|
|
27
|
+
activePosition: {}
|
|
26
28
|
}, {
|
|
27
29
|
activeKey: {},
|
|
28
30
|
activeKeyModifiers: {},
|
|
@@ -36,7 +38,8 @@ var S = _("<div>"), C = _("<div>", 1), w = /*@__PURE__*/ c({
|
|
|
36
38
|
"--s-menu-text-color": _.textColor,
|
|
37
39
|
"--s-menu-active-text-color": _.activeTextColor,
|
|
38
40
|
"--s-menu-active-bg-color": _.activeBgColor,
|
|
39
|
-
"--s-menu-hover-bg-color": _.hoverBgColor
|
|
41
|
+
"--s-menu-hover-bg-color": _.hoverBgColor,
|
|
42
|
+
"--s-menu-item-height": e(_.itemHeight)
|
|
40
43
|
})), D = a(() => ({
|
|
41
44
|
...E.value,
|
|
42
45
|
width: _.collapsed ? e(_.collapsedWidth) : e(_.width)
|
|
@@ -50,11 +53,14 @@ var S = _("<div>"), C = _("<div>", 1), w = /*@__PURE__*/ c({
|
|
|
50
53
|
k.value = [...k.value, e];
|
|
51
54
|
}, M = (e) => {
|
|
52
55
|
k.value = k.value.toSpliced(k.value.indexOf(e), 1);
|
|
53
|
-
}, { collapsed: N, collapsedWidth: P } = v(_),
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
}, { collapsed: N, collapsedWidth: P, activePosition: F } = v(_), I = d(!1), L = d(void 0), R = (e) => {
|
|
57
|
+
L.value = e;
|
|
58
|
+
}, z = d(/* @__PURE__ */ new Map()), B = (e, t) => {
|
|
59
|
+
let n = z.value.get(e);
|
|
60
|
+
n || (n = /* @__PURE__ */ new Set(), z.value.set(e, n)), n.add(t);
|
|
61
|
+
}, V = x("menuRef");
|
|
62
|
+
n(V, (e) => {
|
|
63
|
+
e[0].contentRect.width === P.value ? I.value = !0 : I.value = !1;
|
|
58
64
|
}), u(i, {
|
|
59
65
|
collapsed: N,
|
|
60
66
|
collapsedWidth: P,
|
|
@@ -63,21 +69,21 @@ var S = _("<div>"), C = _("<div>", 1), w = /*@__PURE__*/ c({
|
|
|
63
69
|
openKeys: k,
|
|
64
70
|
setOpenKey: j,
|
|
65
71
|
removeOpenKey: M,
|
|
66
|
-
isCollapsed:
|
|
67
|
-
activePopoverKey:
|
|
68
|
-
setActivePopoverKey:
|
|
69
|
-
|
|
72
|
+
isCollapsed: I,
|
|
73
|
+
activePopoverKey: L,
|
|
74
|
+
setActivePopoverKey: R,
|
|
75
|
+
menuStyleVar: E,
|
|
76
|
+
activePosition: F,
|
|
77
|
+
subMenuDescendants: z,
|
|
78
|
+
registerSubMenuDescendant: B
|
|
70
79
|
});
|
|
71
|
-
let
|
|
80
|
+
let H = C();
|
|
72
81
|
return f(() => {
|
|
73
|
-
p(
|
|
74
|
-
}), m(
|
|
75
|
-
padding: "4px",
|
|
76
|
-
...c.scrollbarProps
|
|
77
|
-
})] }, () => {
|
|
82
|
+
p(H, [y(T).b()]), g(H, D.value);
|
|
83
|
+
}), m(H, null, 0), o(y(r), { $: [() => ({ ...c.scrollbarProps })] }, () => {
|
|
78
84
|
let e = S();
|
|
79
85
|
return f(() => p(e, [y(T).e("content")])), m(e, null, 0), s(), e;
|
|
80
|
-
}), h(
|
|
86
|
+
}), h(H, V, null, "menuRef"), H;
|
|
81
87
|
}
|
|
82
88
|
});
|
|
83
89
|
//#endregion
|