savor-ui 0.21.0 → 0.22.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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
 
4
4
 
5
+ # [0.22.0](https://gitee.com/mach552/savor-ui/compare/v0.21.0...v0.22.0) (2026-08-17)
6
+
7
+
8
+ ### Features
9
+
10
+ * **dropdown:** 新增子组件的`icon`属性 ([6539eb7](https://gitee.com/mach552/savor-ui/commits/6539eb71cd639cdb269922a69d6ca6c43a8c0401))
11
+
5
12
  # [0.21.0](https://gitee.com/mach552/savor-ui/compare/v0.20.1...v0.21.0) (2026-08-17)
6
13
 
7
14
 
@@ -2,9 +2,9 @@ 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
4
  import { buttonGroupContextKey as n } from "./types.mjs";
5
- import { computed as r, createComponent as i, createDynamicComponent as a, createIf as o, createSlot as s, defineVaporComponent as c, inject as l, renderEffect as u, setAttr as d, setClass as f, setInsertionState as p, setProp as m, setText as h, template as g, toDisplayString as _, unref as v } from "vue";
5
+ import { computed as r, createComponent as i, createIf as a, createSlot as o, defineVaporComponent as s, inject as c, renderEffect as l, setAttr as u, setClass as d, setInsertionState as f, setProp as p, setText as m, template as h, toDisplayString as g, unref as _ } from "vue";
6
6
  //#region ../components/src/button/button.vue?vue&type=script&setup=true&vapor=true&lang.ts
7
- var y = g("<div>"), b = g(" "), x = g("<button>", 1), S = /*@__PURE__*/ c({
7
+ var v = h("<div>"), y = h(" "), b = h("<button>", 1), x = /*@__PURE__*/ s({
8
8
  name: "SButton",
9
9
  __name: "button",
10
10
  props: {
@@ -23,39 +23,39 @@ var y = g("<div>"), b = g(" "), x = g("<button>", 1), S = /*@__PURE__*/ c({
23
23
  outline: { type: Boolean },
24
24
  round: { type: Boolean }
25
25
  },
26
- setup(c, { slots: g }) {
27
- let S = c, C = e("button"), w = l(n, void 0), T = r(() => w?.size?.value || S.size), E = x();
28
- return u(() => {
29
- let e = v(C), t = c.disabled, n = c.loading;
30
- f(E, [
26
+ setup(s, { slots: h }) {
27
+ let x = s, S = e("button"), C = c(n, void 0), w = r(() => C?.size?.value || x.size), T = b();
28
+ return l(() => {
29
+ let e = _(S), t = s.disabled, n = s.loading;
30
+ d(T, [
31
31
  e.b(),
32
- e.m(c.type),
33
- e.m(T.value),
34
- e.is("circle", c.circle),
35
- e.is("block", c.block),
36
- e.is("text", c.text),
37
- e.is("secondary", c.secondary),
38
- e.is("link", c.link),
32
+ e.m(s.type),
33
+ e.m(w.value),
34
+ e.is("circle", s.circle),
35
+ e.is("block", s.block),
36
+ e.is("text", s.text),
37
+ e.is("secondary", s.secondary),
38
+ e.is("link", s.link),
39
39
  e.is("disabled", t),
40
40
  e.is("loading", n),
41
- e.is("only-icon", !g.default && !c.label),
42
- e.is("outline", c.outline),
43
- e.is("round", c.round)
44
- ]), m(E, "disabled", t || n), d(E, "html-type", c.htmlType);
45
- }), p(E, null, 0), o(() => (g.icon || c.icon) && !c.loading, () => {
41
+ e.is("only-icon", !h.default && !s.label),
42
+ e.is("outline", s.outline),
43
+ e.is("round", s.round)
44
+ ]), p(T, "disabled", t || n), u(T, "html-type", s.htmlType);
45
+ }), f(T, null, 0), a(() => (h.icon || s.icon) && !s.loading, () => {
46
+ let e = v();
47
+ return l(() => d(e, [_(S).e("icon")])), f(e, null, 0), o("icon", null, () => i(_(t), { name: () => s.icon })), e;
48
+ }, () => a(() => s.loading, () => {
49
+ let e = v();
50
+ return l(() => d(e, [_(S).e("icon")])), f(e, null, 0), i(_(t), { loading: "" }), e;
51
+ }), 261), f(T, null, 1), o("default", null, () => {
46
52
  let e = y();
47
- return u(() => f(e, [v(C).e("icon")])), p(e, null, 0), s("icon", null, () => a(() => c.icon, null, null, 4)), e;
48
- }, () => o(() => c.loading, () => {
49
- let e = y();
50
- return u(() => f(e, [v(C).e("icon")])), p(e, null, 0), i(v(t), { loading: "" }), e;
51
- }), 261), p(E, null, 1), s("default", null, () => {
52
- let e = b();
53
- return u(() => h(e, _(c.label))), e;
54
- }), p(E, null, 2), o(() => g["icon-right"] && !c.loading, () => {
55
- let e = y();
56
- return u(() => f(e, [v(C).e("icon")])), p(e, null, 0), s("icon-right"), e;
57
- }), E;
53
+ return l(() => m(e, g(s.label))), e;
54
+ }), f(T, null, 2), a(() => h["icon-right"] && !s.loading, () => {
55
+ let e = v();
56
+ return l(() => d(e, [_(S).e("icon")])), f(e, null, 0), o("icon-right"), e;
57
+ }), T;
58
58
  }
59
59
  });
60
60
  //#endregion
61
- export { S as default };
61
+ export { x as default };
@@ -1,5 +1,5 @@
1
1
  import { ButtonSlots, ButtonGroupSlots } from './types';
2
- import { PublicProps, Component, VNode, Plugin } from 'vue';
2
+ import { PublicProps, VNode, Plugin } from 'vue';
3
3
  export declare const SButton: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
4
4
  attrs: any;
5
5
  slots: ButtonSlots;
@@ -12,7 +12,7 @@ export declare const SButton: ((__VLS_props: NonNullable<Awaited<typeof __VLS_se
12
12
  label?: string | undefined;
13
13
  disabled?: boolean | undefined;
14
14
  loading?: boolean | undefined;
15
- icon?: Component | undefined;
15
+ icon?: string | undefined;
16
16
  circle?: boolean | undefined;
17
17
  block?: boolean | undefined;
18
18
  text?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import { Component, InjectionKey, Ref } from 'vue';
1
+ import { InjectionKey, Ref } from 'vue';
2
2
  export interface ButtonProps {
3
3
  /** 按钮类型
4
4
  * @default default
@@ -19,7 +19,7 @@ export interface ButtonProps {
19
19
  /** 是否加载中 */
20
20
  loading?: boolean;
21
21
  /** 按钮图标 */
22
- icon?: Component;
22
+ icon?: string;
23
23
  /** 是否为圆形按钮 */
24
24
  circle?: boolean;
25
25
  /** 是否为块级按钮 */
@@ -1,33 +1,35 @@
1
1
  import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
2
2
  import "../../../hooks/index.mjs";
3
- import { dropdownContextKey as t } from "./types.mjs";
4
- import { child as n, createIf as r, createInvoker as i, createSlot as a, defineVaporComponent as o, delegateEvents as s, inject as c, renderEffect as l, setClass as u, setInsertionState as d, setText as f, template as p, toDisplayString as m, unref as h } from "vue";
3
+ import { SIcon as t } from "../icon/index.mjs";
4
+ import { dropdownContextKey as n } from "./types.mjs";
5
+ import { child as r, createComponent as i, createIf as a, createInvoker as o, createSlot as s, defineVaporComponent as c, delegateEvents as l, inject as u, renderEffect as d, setClass as f, setInsertionState as p, setText as m, template as h, toDisplayString as g, unref as _ } from "vue";
5
6
  //#region ../components/src/dropdown/doption.vue?vue&type=script&setup=true&vapor=true&lang.ts
6
- var g = p("<div>"), _ = p(" "), v = p("<div><div></div>", 1);
7
- s("click");
8
- var y = /*@__PURE__*/ o({
7
+ var v = h("<div>"), y = h(" "), b = h("<div><div></div>", 1);
8
+ l("click");
9
+ var x = /*@__PURE__*/ c({
9
10
  name: "SDoption",
10
11
  __name: "doption",
11
12
  props: {
12
13
  title: {},
13
- delayClose: { type: Boolean }
14
+ delayClose: { type: Boolean },
15
+ icon: {}
14
16
  },
15
17
  emits: ["click"],
16
- setup(o, { emit: s, slots: p }) {
17
- let y = o, b = s, x = e("droption"), S = c(t, void 0), C = async () => {
18
- y.delayClose ? (await S?.itemClick?.(), b("click")) : (S?.itemClick?.(), b("click"));
19
- }, w = v(), T = n(w, 1);
20
- return l(() => u(w, [h(x).b()])), d(w, 0, 0), r(() => p.icon, () => {
21
- let e = g();
22
- return l(() => u(e, [h(x).e("icon")])), d(e, null, 0), a("icon"), e;
23
- }), l(() => u(T, [h(x).e("title")])), d(T, null, 0), a("default", null, () => {
24
- let e = _();
25
- return l(() => f(e, m(o.title))), e;
26
- }), d(w, null, 2), r(() => p.extra, () => {
27
- let e = g();
28
- return l(() => u(e, [h(x).e("extra")])), d(e, null, 0), a("extra"), e;
29
- }), w.$evtclick = i(C), w;
18
+ setup(c, { emit: l, slots: h }) {
19
+ let x = c, S = l, C = e("droption"), w = u(n, void 0), T = async () => {
20
+ x.delayClose ? (await w?.itemClick?.(), S("click")) : (w?.itemClick?.(), S("click"));
21
+ }, E = b(), D = r(E, 1);
22
+ return d(() => f(E, [_(C).b()])), p(E, 0, 0), a(() => h.icon || c.icon, () => {
23
+ let e = v();
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, () => {
26
+ let e = y();
27
+ return d(() => m(e, g(c.title))), e;
28
+ }), p(E, null, 2), a(() => h.extra, () => {
29
+ let e = v();
30
+ return d(() => f(e, [_(C).e("extra")])), p(e, null, 0), s("extra"), e;
31
+ }), E.$evtclick = o(T), E;
30
32
  }
31
33
  });
32
34
  //#endregion
33
- export { y as default };
35
+ export { x as default };
@@ -2,45 +2,47 @@ import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
2
2
  import "../../../hooks/index.mjs";
3
3
  import { RightLine as t } from "../../../icons/src/line/arrow/index.mjs";
4
4
  import { SPopover as n } from "../popover/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, next as f, renderEffect as p, setClass as m, setInsertionState as h, setText as g, template as _, toDisplayString as v, unref as y } from "vue";
5
+ import { SIcon as r } from "../icon/index.mjs";
6
+ import { dropdownContextKey as i } from "./types.mjs";
7
+ import { child as a, createComponent as o, createIf as s, createInvoker as c, createSlot as l, defineVaporComponent as u, delegateEvents as d, inject as f, next as p, renderEffect as m, setClass as h, setInsertionState as g, setText as _, template as v, toDisplayString as y, unref as b } from "vue";
7
8
  //#region ../components/src/dropdown/dsubmenu.vue?vue&type=script&setup=true&vapor=true&lang.ts
8
- var b = _("<div>"), x = _(" "), S = _("<div><div></div><div></div></div>"), C = _("<div>", 1);
9
- u("click");
10
- var w = /*@__PURE__*/ l({
9
+ var x = v("<div>"), S = v(" "), C = v("<div><div></div><div></div></div>"), w = v("<div>", 1);
10
+ d("click");
11
+ var T = /*@__PURE__*/ u({
11
12
  name: "SDsubmenu",
12
13
  __name: "dsubmenu",
13
14
  props: {
14
15
  title: {},
15
- popoverProps: {}
16
+ popoverProps: {},
17
+ icon: {}
16
18
  },
17
19
  emits: ["click"],
18
- setup(l, { emit: u, slots: _ }) {
19
- let w = u, T = e("dsubmenu"), E = d(r, void 0), D = () => {
20
- E?.itemClick?.(), w("click");
21
- }, O = C();
22
- return p(() => m(O, [y(T).b()])), h(O, null, 0), a(y(n), { $: [() => ({
20
+ setup(u, { emit: d, slots: v }) {
21
+ let T = d, E = e("dsubmenu"), D = f(i, void 0), O = () => {
22
+ D?.itemClick?.(), T("click");
23
+ }, k = w();
24
+ return m(() => h(k, [b(E).b()])), g(k, null, 0), o(b(n), { $: [() => ({
23
25
  teleportBody: !1,
24
26
  trigger: "hover",
25
27
  placement: "right-start",
26
- ...l.popoverProps
28
+ ...u.popoverProps
27
29
  })] }, {
28
30
  content: () => {
29
- let e = b();
30
- return p(() => m(e, y(T).e("list"))), h(e, null, 0), c("content"), e;
31
+ let e = x();
32
+ return m(() => h(e, b(E).e("list"))), g(e, null, 0), l("content"), e;
31
33
  },
32
34
  default: () => {
33
- let e = S(), n = i(e, 1), r = f(n, 2);
34
- return p(() => m(e, y(T).e("item"))), h(e, 0, 0), o(() => _.icon, () => {
35
- let e = b();
36
- return p(() => m(e, [y(T).e("icon")])), h(e, null, 0), c("icon"), e;
37
- }), p(() => m(n, [y(T).e("title")])), h(n, null, 0), c("title", null, () => {
35
+ let e = C(), n = a(e, 1), i = p(n, 2);
36
+ return m(() => h(e, b(E).e("item"))), g(e, 0, 0), s(() => v.icon || u.icon, () => {
38
37
  let e = x();
39
- return p(() => g(e, v(l.title))), e;
40
- }), p(() => m(r, [y(T).e("arrow")])), h(r, null, 0), a(y(t)), e.$evtclick = s(D), e;
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, () => {
40
+ let e = S();
41
+ return m(() => _(e, y(u.title))), e;
42
+ }), m(() => h(i, [b(E).e("arrow")])), g(i, null, 0), o(b(t)), e.$evtclick = c(O), e;
41
43
  }
42
- }), O;
44
+ }), k;
43
45
  }
44
46
  });
45
47
  //#endregion
46
- export { w as default };
48
+ export { T as default };
@@ -26,6 +26,7 @@ export declare const SDoption: ((__VLS_props: NonNullable<Awaited<typeof __VLS_s
26
26
  props: PublicProps & {
27
27
  title?: string | undefined;
28
28
  delayClose?: boolean | undefined;
29
+ icon?: string | undefined;
29
30
  onClick?: (() => any) | undefined;
30
31
  } & (typeof globalThis extends {
31
32
  __VLS_PROPS_FALLBACK: infer P;
@@ -45,6 +46,7 @@ export declare const SDsubmenu: ((__VLS_props: NonNullable<Awaited<typeof __VLS_
45
46
  props: PublicProps & {
46
47
  title?: string | undefined;
47
48
  popoverProps?: PopoverProps | undefined;
49
+ icon?: string | undefined;
48
50
  onClick?: (() => any) | undefined;
49
51
  } & (typeof globalThis extends {
50
52
  __VLS_PROPS_FALLBACK: infer P;
@@ -15,6 +15,8 @@ export interface DroptionProps {
15
15
  title?: string;
16
16
  /** 延迟关闭(用于卸载组件时延迟关闭) */
17
17
  delayClose?: boolean;
18
+ /** 图标 */
19
+ icon?: string;
18
20
  }
19
21
  export interface DroptionSlots {
20
22
  /** 默认 */
@@ -33,6 +35,8 @@ export interface DsubmenuProps {
33
35
  title?: string;
34
36
  /** 弹出层属性 [PopoverProps](/components/other/popover#popover-props)*/
35
37
  popoverProps?: PopoverProps;
38
+ /** 图标 */
39
+ icon?: string;
36
40
  }
37
41
  export interface DsubmenuSlots {
38
42
  /** 默认 */
@@ -169,7 +169,8 @@
169
169
  "type": "boolean"
170
170
  },
171
171
  "s-button/icon": {
172
- "description": "按钮图标"
172
+ "description": "按钮图标",
173
+ "type": "string"
173
174
  },
174
175
  "s-button/circle": {
175
176
  "description": "是否为圆形按钮",
@@ -748,6 +749,10 @@
748
749
  "description": "延迟关闭(用于卸载组件时延迟关闭)",
749
750
  "type": "boolean"
750
751
  },
752
+ "s-droption/icon": {
753
+ "description": "图标",
754
+ "type": "string"
755
+ },
751
756
  "s-dsubmenu/title": {
752
757
  "description": "标题",
753
758
  "type": "string"
@@ -755,6 +760,10 @@
755
760
  "s-dsubmenu/popoverProps": {
756
761
  "description": "弹出层属性 [PopoverProps](/components/other/popover#popover-props)"
757
762
  },
763
+ "s-dsubmenu/icon": {
764
+ "description": "图标",
765
+ "type": "string"
766
+ },
758
767
  "s-empty/description": {
759
768
  "description": "自定义描述",
760
769
  "type": "string"
@@ -321,13 +321,15 @@
321
321
  "s-droption": {
322
322
  "attributes": [
323
323
  "title",
324
- "delayClose"
324
+ "delayClose",
325
+ "icon"
325
326
  ]
326
327
  },
327
328
  "s-dsubmenu": {
328
329
  "attributes": [
329
330
  "title",
330
- "popoverProps"
331
+ "popoverProps",
332
+ "icon"
331
333
  ]
332
334
  },
333
335
  "s-empty": {
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "savor-ui",
5
- "version": "0.20.1",
5
+ "version": "0.21.0",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
@@ -452,7 +452,7 @@
452
452
  "name": "icon",
453
453
  "description": "按钮图标",
454
454
  "value": {
455
- "type": "Component",
455
+ "type": "string",
456
456
  "kind": "expression"
457
457
  }
458
458
  },
@@ -1965,6 +1965,14 @@
1965
1965
  "type": "boolean",
1966
1966
  "kind": "expression"
1967
1967
  }
1968
+ },
1969
+ {
1970
+ "name": "icon",
1971
+ "description": "图标",
1972
+ "value": {
1973
+ "type": "string",
1974
+ "kind": "expression"
1975
+ }
1968
1976
  }
1969
1977
  ],
1970
1978
  "events": [],
@@ -2001,6 +2009,14 @@
2001
2009
  "type": "PopoverProps",
2002
2010
  "kind": "expression"
2003
2011
  }
2012
+ },
2013
+ {
2014
+ "name": "icon",
2015
+ "description": "图标",
2016
+ "value": {
2017
+ "type": "string",
2018
+ "kind": "expression"
2019
+ }
2004
2020
  }
2005
2021
  ],
2006
2022
  "events": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "savor-ui",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "A Vue3 Components Library",
5
5
  "keywords": [
6
6
  "component library",