savor-ui 0.9.0 → 0.10.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,25 @@
2
2
 
3
3
 
4
4
 
5
+ # [0.10.0](https://gitee.com/mach552/savor-ui/compare/v0.9.0...v0.10.0) (2026-07-09)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **form:** 修复某些情况下无法重置的问题 ([c66f3ea](https://gitee.com/mach552/savor-ui/commits/c66f3ea835e89e68ce85875403561ba844215d6c))
11
+ * **segmented:** 修复默认激活条偶发宽度不足问题 ([0b3dab9](https://gitee.com/mach552/savor-ui/commits/0b3dab94b93b3a79a94066367bb8822e1cfa9613))
12
+ * **segmented:** 修复无默认值问题 ([33bd3c6](https://gitee.com/mach552/savor-ui/commits/33bd3c6d8c6f5a7c8e3c66a4660f2b00aa803127))
13
+ * **switch:** 修复大小与其他组件不一致问题 ([a805e12](https://gitee.com/mach552/savor-ui/commits/a805e122f1fb2b20c38af0d50575aba1694c290d))
14
+ * **switch:** 修复默认值是undefined问题 ([81b963c](https://gitee.com/mach552/savor-ui/commits/81b963c5f17224d4fcc99da9d37f30e69b3dc0a4))
15
+ * **table:** 修复列字段无法读取嵌套对象值的问题 ([2a8842c](https://gitee.com/mach552/savor-ui/commits/2a8842c0b2a17aa8c6683368bb094e61d19f642b))
16
+ * **table:** 修复某些场景下表头比弹层层级高的问题 ([81c836a](https://gitee.com/mach552/savor-ui/commits/81c836a97146017e469f4b79f1857a2c9dc67a06))
17
+ * **tag:** 修复文字换行问题 ([a1c0d94](https://gitee.com/mach552/savor-ui/commits/a1c0d94984fe7d92f5e93534b2071f89b25065aa))
18
+
19
+
20
+ ### Features
21
+
22
+ * **button:** 新增圆角按钮 ([75d5c6e](https://gitee.com/mach552/savor-ui/commits/75d5c6e96a0b7bef6b30a30edd8be02b608947cb))
23
+
5
24
  # [0.9.0](https://gitee.com/mach552/savor-ui/compare/v0.8.0...v0.9.0) (2026-07-07)
6
25
 
7
26
 
@@ -21,7 +21,8 @@ var y = g("<div>"), b = g(" "), x = g("<button>", 1), S = /*@__PURE__*/ c({
21
21
  text: { type: Boolean },
22
22
  link: { type: Boolean },
23
23
  secondary: { type: Boolean },
24
- outline: { type: Boolean }
24
+ outline: { type: Boolean },
25
+ round: { type: Boolean }
25
26
  },
26
27
  setup(c, { slots: g }) {
27
28
  let S = c, C = e("button"), w = l(n, void 0), T = r(() => w?.size?.value || S.size), E = x();
@@ -39,7 +40,8 @@ var y = g("<div>"), b = g(" "), x = g("<button>", 1), S = /*@__PURE__*/ c({
39
40
  e.is("disabled", t),
40
41
  e.is("loading", n),
41
42
  e.is("only-icon", !g.default && !c.label),
42
- e.is("outline", c.outline)
43
+ e.is("outline", c.outline),
44
+ e.is("round", c.round)
43
45
  ]), m(E, "disabled", t || n), d(E, "html-type", c.htmlType);
44
46
  }), p(E, null, 0), o(() => (g.icon || c.icon) && !c.loading, () => {
45
47
  let e = y();
@@ -19,6 +19,7 @@ export declare const SButton: ((__VLS_props: NonNullable<Awaited<typeof __VLS_se
19
19
  link?: boolean | undefined;
20
20
  secondary?: boolean | undefined;
21
21
  outline?: boolean | undefined;
22
+ round?: boolean | undefined;
22
23
  } & (typeof globalThis extends {
23
24
  __VLS_PROPS_FALLBACK: infer P;
24
25
  } ? P : {});
@@ -32,6 +32,8 @@ export interface ButtonProps {
32
32
  secondary?: boolean;
33
33
  /** 是否为轮廓按钮 */
34
34
  outline?: boolean;
35
+ /** 是否为圆角按钮 */
36
+ round?: boolean;
35
37
  }
36
38
  export interface ButtonSlots {
37
39
  /** 默认 */
@@ -58,7 +58,7 @@ var k = w("<span>"), A = w(" "), j = w("<div><label>"), M = w("<div> "), N = w("
58
58
  }, q = () => {
59
59
  K();
60
60
  let e = I?.model?.value;
61
- e && P.field && e[P.field] !== void 0 && (e[P.field] = z);
61
+ e && P.field && (e[P.field] = z);
62
62
  }, J = l(() => H.value.state === "error"), Y = {
63
63
  validate: G,
64
64
  field: P.field,
@@ -69,7 +69,7 @@ var k = w("<span>"), A = w(" "), j = w("<div><label>"), M = w("<div> "), N = w("
69
69
  size: I?.size,
70
70
  error: J
71
71
  }), h(() => {
72
- P.field && (I?.addField(Y), z = B.value);
72
+ P.field && (I?.addField(Y), z = I?.model?.value?.[P.field]);
73
73
  }), g(() => {
74
74
  P.field && I?.removeField(Y);
75
75
  }), w({
@@ -45,8 +45,15 @@ var O = /*@__PURE__*/ c({
45
45
  }
46
46
  }), t(F, () => {
47
47
  requestAnimationFrame(L);
48
+ }), w((e) => {
49
+ let t = j.value[M.value];
50
+ if (!t) return;
51
+ let n = new ResizeObserver(() => {
52
+ requestAnimationFrame(L);
53
+ });
54
+ n.observe(t), e(() => n.disconnect());
48
55
  }), d(() => {
49
- requestAnimationFrame(L);
56
+ A.value === void 0 && y.options.length > 0 && (A.value = y.options[0][y.fieldNames.value]), requestAnimationFrame(L);
50
57
  });
51
58
  let z = s(), B = D(), V = n(B);
52
59
  return p(() => {
@@ -52,10 +52,10 @@ var M = /*@__PURE__*/ c({
52
52
  }),
53
53
  emits: /*@__PURE__*/ u(["change"], ["update:modelValue"]),
54
54
  setup(c, { emit: l }) {
55
- let u = c, x = l, { size: M, error: N } = C(u), { mergedSize: P, mergedError: F } = t({
56
- size: M,
57
- error: N
58
- }), I = e("switch"), L = E(c, "modelValue"), R = D("inputRef"), z = m(!1), B = r(() => L.value === u.activeValue), V = async () => {
55
+ let u = c, x = l, M = e("switch"), { size: N, error: P } = C(u), { mergedSize: F, mergedError: I } = t({
56
+ size: N,
57
+ error: P
58
+ }), L = E(c, "modelValue"), R = D("inputRef"), z = m(!1), B = r(() => L.value === u.activeValue), V = async () => {
59
59
  if (u.disabled) return;
60
60
  let e = B.value ? u.inactiveValue : u.activeValue;
61
61
  if (u.beforeChange) try {
@@ -66,20 +66,20 @@ var M = /*@__PURE__*/ c({
66
66
  z.value = !z.value, L.value = e, x("change", e);
67
67
  };
68
68
  p(() => {
69
- R.value.checked = B.value, z.value = B.value;
69
+ L.value === void 0 && (L.value = u.inactiveValue), R.value.checked = B.value, z.value = B.value;
70
70
  }), O(B, (e) => {
71
71
  R.value.checked = e;
72
72
  });
73
73
  let H = s(), U = j(), W = n(U), G = d(W, 1), K = n(G), q = d(K, 1);
74
74
  return f(W, "keypress", k(V, ["enter"])), H(W, R, null, "inputRef"), h(() => {
75
- let e = T(I), t = B.value, n = c.disabled, r = c.activeColor, i = c.inactiveColor;
75
+ let e = T(M), t = B.value, n = c.disabled, r = c.activeColor, i = c.inactiveColor;
76
76
  g(U, [
77
77
  e.b(),
78
- e.m(T(P)),
78
+ e.m(T(F)),
79
79
  e.is("checked", t),
80
80
  e.is("disabled", n),
81
81
  e.is("circle", c.circle),
82
- e.is("error", T(F))
82
+ e.is("error", T(I))
83
83
  ]), g(W, [e.e("inner")]), v(W, "disabled", n), g(G, [e.e("core")]), y(G, {
84
84
  backgroundColor: t ? r : i,
85
85
  borderColor: t ? r : i
@@ -87,7 +87,7 @@ var M = /*@__PURE__*/ c({
87
87
  }), _(K, null, 0), i(() => c.activeText || c.inactiveText, () => {
88
88
  let e = A(), t = w(e);
89
89
  return h(() => b(t, S(B.value ? c.activeText : c.inactiveText))), e;
90
- }), h(() => g(q, [T(I).e("core-action")])), _(q, null, 0), i(() => B.value, () => o("active-icon"), () => o("inactive-icon"), 517), U.$evtclick = a(V), U;
90
+ }), h(() => g(q, [T(M).e("core-action")])), _(q, null, 0), i(() => B.value, () => o("active-icon"), () => o("inactive-icon"), 517), U.$evtclick = a(V), U;
91
91
  }
92
92
  });
93
93
  //#endregion
@@ -1,14 +1,14 @@
1
- import { checkEllipsisVisible as e } from "../../../utils/src/tool.mjs";
1
+ import { checkEllipsisVisible as e, getValueByPath as t } from "../../../utils/src/tool.mjs";
2
2
  import "../../../utils/index.mjs";
3
- import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
3
+ import { useNamespace as n } from "../../../hooks/src/use-namespace.mjs";
4
4
  import "../../../hooks/index.mjs";
5
- import n from "../../../icons/src/right.vue.mjs";
5
+ import r from "../../../icons/src/right.vue.mjs";
6
6
  import "../../../icons/index.mjs";
7
- import { STooltip as r } from "../tooltip/index.mjs";
8
- import { tableContextKey as i } from "./types.mjs";
9
- import { child as a, computed as o, createComponent as s, createComponentWithFallback as c, createFor as l, createIf as u, createInvoker as d, createSlot as f, createTemplateRefSetter as p, defineVaporComponent as m, delegateEvents as h, inject as g, nextTick as _, ref as v, renderEffect as y, resolveComponent as b, setClass as x, setInsertionState as S, setProp as C, setStyle as w, setText as T, template as E, toDisplayString as D, txt as O, unref as k, watch as A } from "vue";
7
+ import { STooltip as i } from "../tooltip/index.mjs";
8
+ import { tableContextKey as a } from "./types.mjs";
9
+ import { child as o, computed as s, createComponent as c, createComponentWithFallback as l, createFor as u, createIf as d, createInvoker as f, createSlot as ee, createTemplateRefSetter as p, defineVaporComponent as m, delegateEvents as h, inject as g, nextTick as _, ref as v, renderEffect as y, resolveComponent as b, setClass as x, setInsertionState as S, setProp as C, setStyle as w, setText as T, template as E, toDisplayString as D, txt as O, unref as k, watch as A } from "vue";
10
10
  //#region ../components/src/table/table-body.vue?vue&type=script&setup=true&vapor=true&lang.ts
11
- var j = E("<td><div>"), M = E("<span>"), N = E("<div><div> </div>"), P = E("<div><div> "), F = E("<td>"), ee = E("<tr>"), I = E("<tbody>", 1);
11
+ var j = E("<td><div>"), M = E("<span>"), N = E("<div><div> </div>"), P = E("<div><div> "), F = E("<td>"), I = E("<tr>"), te = E("<tbody>", 1);
12
12
  h("click");
13
13
  var L = /*@__PURE__*/ m({
14
14
  __name: "table-body",
@@ -19,7 +19,7 @@ var L = /*@__PURE__*/ m({
19
19
  "expandedRow"
20
20
  ],
21
21
  setup(m, { emit: h }) {
22
- let E = m, L = h, R = t("table"), z = g(i, void 0), B = v({}), V = v({}), H = (e, t) => {
22
+ let E = m, L = h, R = n("table"), z = g(a, void 0), B = v({}), V = v({}), H = (e, t) => {
23
23
  e instanceof HTMLElement && (V.value[t] = e);
24
24
  }, U = async () => {
25
25
  await _(), requestAnimationFrame(() => {
@@ -38,13 +38,13 @@ var L = /*@__PURE__*/ m({
38
38
  });
39
39
  let W = (e, t) => {
40
40
  L("expandedRow", e, t);
41
- }, G = o(() => z?.flatColumns.value || []), K = o(() => z?.props.stripe ?? !1), q = o(() => z?.isScrollAtLeft.value ?? !0), J = o(() => z?.isScrollAtRight.value ?? !1), Y = (e) => {
41
+ }, G = (e, n) => t(e, n), K = s(() => z?.flatColumns.value || []), q = s(() => z?.props.stripe ?? !1), J = s(() => z?.isScrollAtLeft.value ?? !0), Y = s(() => z?.isScrollAtRight.value ?? !1), X = (e) => {
42
42
  let t = {};
43
43
  return e.width === "auto" && (t.whiteSpace = "nowrap"), e.fixed && e.fixedOffset !== void 0 && (t.position = "sticky", t[e.fixed] = `${e.fixedOffset}px`, t.zIndex = 1), t;
44
- }, X = o(() => {
44
+ }, Z = s(() => {
45
45
  let e = z?.checked.value ?? [];
46
46
  return new Set(e.map((e) => e._id));
47
- }), Z = (e) => X.value.has(e._id), Q = (e, t, n) => {
47
+ }), Q = (e) => Z.value.has(e._id), ne = (e, t, n) => {
48
48
  let r = z?.checked.value ?? [], i;
49
49
  if (z?.props?.multiple) {
50
50
  let n = r.findIndex((e) => e._id === t._id);
@@ -55,97 +55,95 @@ var L = /*@__PURE__*/ m({
55
55
  else i = n === -1 ? [...r] : r.toSpliced(n, 1);
56
56
  } else i = e ? [E.data.find((e) => e._id === t._id)] : [];
57
57
  L("checkRow", t, n, i);
58
- }, te = (e) => {
58
+ }, re = (e) => {
59
59
  let t = z?.selected.value;
60
60
  return t && t._id === e._id;
61
- }, ne = (e) => {
61
+ }, ie = (e) => {
62
62
  if (!z?.props?.rowSelection) return;
63
63
  let t = z?.selected.value;
64
64
  L("selectRow", t && t._id === e._id ? {} : e, E.data.indexOf(e));
65
- }, re = p(), ie = b("s-checkbox"), $ = I();
66
- return S($, null, 0), l(() => E.data, (e, t) => {
67
- let i = ee();
65
+ }, ae = p(), oe = b("s-checkbox"), $ = te();
66
+ return S($, null, 0), u(() => E.data, (e, t) => {
67
+ let n = I();
68
68
  return y(() => {
69
- let n = k(R), r = e.value;
70
- x(i, [
71
- n.e("body-row"),
72
- n.is("stripe", K.value && t.value % 2 == 1),
73
- n.is("selected", te(r) || Z(r)),
74
- n.is("selection", k(z)?.props?.rowSelection)
69
+ let r = k(R), i = e.value;
70
+ x(n, [
71
+ r.e("body-row"),
72
+ r.is("stripe", q.value && t.value % 2 == 1),
73
+ r.is("selected", re(i) || Q(i)),
74
+ r.is("selection", k(z)?.props?.rowSelection)
75
75
  ]);
76
- }), S(i, null, 0), l(() => G.value, (i, o) => u(() => i.value.type === "select", () => {
77
- let n = j(), r = a(n);
76
+ }), S(n, null, 0), u(() => K.value, (n, a) => d(() => n.value.type === "select", () => {
77
+ let r = j(), i = o(r);
78
78
  y(() => {
79
- let e = k(R), t = i.value, a = t.fixed;
80
- x(n, [
79
+ let e = k(R), t = n.value, a = t.fixed;
80
+ x(r, [
81
81
  e.e("body-cell"),
82
82
  a ? e.m("body-cell", "fixed") : "",
83
83
  a ? e.m("body-cell", "fixed", t.fixed) : "",
84
- e.is("shadow", a === "left" && !q.value),
85
- e.is("shadow", a === "right" && !J.value),
84
+ e.is("shadow", a === "left" && !J.value),
85
+ e.is("shadow", a === "right" && !Y.value),
86
86
  { [e.m("body-cell", "align", t.align)]: t.align }
87
- ]), w(n, Y(t)), x(r, [e.e("body-cell-content")]);
88
- }), S(r, null, 0);
89
- let o = (n) => Q(n, e.value, t.value);
90
- return c(ie, {
91
- "model-value": () => Z(e.value),
92
- onChange: () => o
93
- }), n;
87
+ ]), w(r, X(t)), x(i, [e.e("body-cell-content")]);
88
+ }), S(i, null, 0);
89
+ let a = (n) => ne(n, e.value, t.value);
90
+ return l(oe, {
91
+ "model-value": () => Q(e.value),
92
+ onChange: () => a
93
+ }), r;
94
94
  }, () => {
95
- let c = F();
95
+ let s = F();
96
96
  return y(() => {
97
- let e = k(R), t = i.value, n = t.fixed;
98
- x(c, [
97
+ let e = k(R), t = n.value, r = t.fixed;
98
+ x(s, [
99
99
  e.e("body-cell"),
100
100
  e.is("ellipsis", t.ellipsis || t.ellipsisTooltip),
101
- n ? e.m("body-cell", "fixed") : "",
102
- n ? e.m("body-cell", "fixed", t.fixed) : "",
103
- e.is("shadow", n === "left" && !q.value),
104
- e.is("shadow", n === "right" && !J.value),
101
+ r ? e.m("body-cell", "fixed") : "",
102
+ r ? e.m("body-cell", "fixed", t.fixed) : "",
103
+ e.is("shadow", r === "left" && !J.value),
104
+ e.is("shadow", r === "right" && !Y.value),
105
105
  { [e.m("body-cell", "align", t.align)]: t.align }
106
- ]), w(c, Y(t));
107
- }), S(c, null, 0), u(() => i.value.slot, () => f(() => i.value.slot, {
108
- column: () => i.value,
106
+ ]), w(s, X(t));
107
+ }), S(s, null, 0), d(() => n.value.slot, () => ee(() => n.value.slot, {
108
+ column: () => n.value,
109
109
  index: () => t.value,
110
110
  row: () => e.value
111
- }), () => u(() => i.value.ellipsisTooltip, () => s(k(r), {
112
- content: () => e.value[i.value.field],
111
+ }), () => d(() => n.value.ellipsisTooltip, () => c(k(i), {
112
+ content: () => G(e.value, n.value.field),
113
113
  mini: "",
114
- disabled: () => B.value[t.value + "_" + o.value] !== !0
114
+ disabled: () => B.value[t.value + "_" + a.value] !== !0
115
115
  }, () => {
116
- let r = N(), c = a(r, 1);
116
+ let i = N(), s = o(i, 1);
117
117
  y(() => {
118
- x(r, [k(R).e("body-cell-content")]), w(r, { paddingLeft: i.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
119
- }), S(r, 0, 0), u(() => e.value._hasChildren && i.value.treeNode, () => {
120
- let r = M();
118
+ x(i, [k(R).e("body-cell-content")]), w(i, { paddingLeft: n.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
119
+ }), S(i, 0, 0), d(() => e.value._hasChildren && n.value.treeNode, () => {
120
+ let n = M();
121
121
  return y(() => {
122
122
  let t = k(R);
123
- x(r, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
124
- }), S(r, null, 0), s(k(n)), r.$evtclick = d(() => W(e.value, t.value)), r;
123
+ x(n, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
124
+ }), S(n, null, 0), c(k(r)), n.$evtclick = f(() => W(e.value, t.value)), n;
125
125
  });
126
- let l = O(c);
126
+ let l = O(s);
127
127
  return y(() => {
128
- let n = i.value;
129
- x(c, k(R).e("body-cell-text")), T(l, D(e.value[n.field])), re(c, (e) => H(e, t.value + "_" + o.value), !0);
130
- }), r;
128
+ x(s, k(R).e("body-cell-text")), T(l, D(G(e.value, n.value.field))), ae(s, (e) => H(e, t.value + "_" + a.value), !0);
129
+ }), i;
131
130
  }), () => {
132
- let r = P(), o = a(r, 1);
131
+ let i = P(), a = o(i, 1);
133
132
  y(() => {
134
- x(r, [k(R).e("body-cell-content")]), w(r, { paddingLeft: i.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
135
- }), S(r, 0, 0), u(() => e.value._hasChildren && i.value.treeNode, () => {
136
- let r = M();
133
+ x(i, [k(R).e("body-cell-content")]), w(i, { paddingLeft: n.value.treeNode ? (e.value._level || 0) * 24 + "px" : "0px" });
134
+ }), S(i, 0, 0), d(() => e.value._hasChildren && n.value.treeNode, () => {
135
+ let n = M();
137
136
  return y(() => {
138
137
  let t = k(R);
139
- x(r, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
140
- }), S(r, null, 0), s(k(n)), r.$evtclick = d(() => W(e.value, t.value)), r;
138
+ x(n, [t.e("tree-node-arrow"), t.is("expanded", e.value._expanded)]);
139
+ }), S(n, null, 0), c(k(r)), n.$evtclick = f(() => W(e.value, t.value)), n;
141
140
  });
142
- let c = O(o);
141
+ let s = O(a);
143
142
  return y(() => {
144
- let t = i.value;
145
- x(o, k(R).e("body-cell-text")), T(c, D(e.value[t.field]));
146
- }), r;
147
- }, 1029), 517), c;
148
- }, 266), (e, t) => t, 17), i.$evtclick = d(() => ne(e.value)), i;
143
+ x(a, k(R).e("body-cell-text")), T(s, D(G(e.value, n.value.field)));
144
+ }), i;
145
+ }, 1029), 517), s;
146
+ }, 266), (e, t) => t, 17), n.$evtclick = f(() => ie(e.value)), n;
149
147
  }, (e, t) => t, 9), C($, "tabindex", -1), $;
150
148
  }
151
149
  });
@@ -30,6 +30,9 @@
30
30
  @include when(block) {
31
31
  width: 100% !important;
32
32
  }
33
+ @include when(round) {
34
+ border-radius: getCssVar("radius", "round");
35
+ }
33
36
  @include when(secondary) {
34
37
  color: getCssVar("color", "text-1");
35
38
  background-color: getCssVar("color", "fill-2");
@@ -6,7 +6,6 @@
6
6
  display: inline-flex;
7
7
  align-items: center;
8
8
  font-size: getCssVar("font-size", "medium");
9
- line-height: 1.5715;
10
9
 
11
10
  @include when(disabled) {
12
11
  @include be(switch, core) {
@@ -26,10 +25,10 @@
26
25
  @each $size in $size-list {
27
26
  @include this-bm(switch, #{$size}) {
28
27
  @include be(switch, core-action) {
29
- left: calc(100% - (getCssVar("size", $size) - 12px + 3px));
28
+ left: calc(100% - (getCssVar("size", $size) - 8px + 3px));
30
29
  }
31
30
  @include be(switch, core-label) {
32
- padding: 0 calc(getCssVar("size", $size) - 12px + 8px) 0 8px;
31
+ padding: 0 getCssVar("size", $size) 0 8px;
33
32
  }
34
33
  }
35
34
  }
@@ -92,21 +91,21 @@
92
91
 
93
92
  @each $size in $size-list {
94
93
  @include m(#{$size}) {
95
- height: calc(getCssVar("size", $size) - 4px);
96
- min-width: calc((getCssVar("size", $size) - 4px) * 2);
94
+ height: getCssVar("size", $size);
95
+ min-width: calc(getCssVar("size", $size) * 2);
97
96
  @include be(switch, core-action) {
98
- height: calc(getCssVar("size", $size) - 12px);
99
- width: calc(getCssVar("size", $size) - 12px);
97
+ height: calc(getCssVar("size", $size) - 8px);
98
+ width: calc(getCssVar("size", $size) - 8px);
100
99
  }
101
100
  @include be(switch, core-label) {
102
- padding: 0 8px 0 calc(getCssVar("size", $size) - 12px + 8px);
101
+ padding: 0 8px 0 getCssVar("size", $size);
103
102
  }
104
103
  }
105
104
  }
106
105
 
107
106
  @include when(circle) {
108
107
  @include be(switch, core) {
109
- border-radius: 999px;
108
+ border-radius: getCssVar("radius", "round");
110
109
  }
111
110
 
112
111
  @include be(switch, core-action) {
@@ -3,6 +3,7 @@
3
3
 
4
4
  @include b(table) {
5
5
  position: relative;
6
+ isolation: isolate;
6
7
  font-size: 14px;
7
8
  background-color: getCssVar("color", "bg-2");
8
9
  box-sizing: border-box;
@@ -10,6 +10,7 @@
10
10
  justify-content: center;
11
11
  gap: 4px;
12
12
  color: getCssVar("color", "text-1");
13
+ white-space: nowrap;
13
14
 
14
15
  @include m(default) {
15
16
  background-color: getCssVar("color", "fill-2");
@@ -22,6 +22,7 @@
22
22
  }
23
23
  @include when(selected) {
24
24
  background-color: getCssVar("color", "fill-2");
25
+ color: getCssVar("color", "primary-6");
25
26
  }
26
27
  @include when(disabled) {
27
28
  cursor: not-allowed;
@@ -52,11 +52,11 @@ var t = "s", n = [
52
52
  lineHeightLarge: "24px",
53
53
  lineHeightLarger: "28px",
54
54
  radiusMini: "2px",
55
- radiusSmall: "2px",
56
- radiusMedium: "2px",
57
- radiusLarge: "2px",
58
- radiusLarger: "4px",
59
- radiusRound: "999px",
55
+ radiusSmall: "4px",
56
+ radiusMedium: "6px",
57
+ radiusLarge: "8px",
58
+ radiusLarger: "12px",
59
+ radiusRound: "9999px",
60
60
  radiusCircle: "100%",
61
61
  bezier1: "cubic-bezier(0.4, 0, 0.2, 1)",
62
62
  bezierIn: "cubic-bezier(0.4, 0, 1, 1)",
@@ -27,3 +27,10 @@ export declare const addGroupSeparator: (numStr: string) => string;
27
27
  * 判断元素文字是否溢出并展示省略号
28
28
  */
29
29
  export declare const checkEllipsisVisible: (el: HTMLElement) => boolean;
30
+ /**
31
+ * 根据路径获取对象嵌套属性值,支持点号分隔(如 "dept.title")
32
+ * @param obj 目标对象
33
+ * @param path 属性路径
34
+ * @returns 属性值,路径无效时返回 undefined
35
+ */
36
+ export declare const getValueByPath: (obj: any, path: string) => any;
@@ -22,6 +22,15 @@ var e = (e, t) => {
22
22
  }, r = (e) => e === void 0 || e === "auto" ? 0 : typeof e == "number" ? e : parseFloat(e) || 0, i = (e) => {
23
23
  let t = e.split(".");
24
24
  return t[0] = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), t.join(".");
25
- }, a = (e) => !e.isConnected || e.getBoundingClientRect().width <= 1 ? !1 : e.scrollWidth > e.clientWidth;
25
+ }, a = (e) => !e.isConnected || e.getBoundingClientRect().width <= 1 ? !1 : e.scrollWidth > e.clientWidth, o = (e, t) => {
26
+ if (e == null || !t) return;
27
+ if (!t.includes(".")) return e[t];
28
+ let n = t.split("."), r = e;
29
+ for (let e of n) {
30
+ if (r == null) return;
31
+ r = r[e];
32
+ }
33
+ return r;
34
+ };
26
35
  //#endregion
27
- export { i as addGroupSeparator, a as checkEllipsisVisible, e as debounce, n as getSize, r as getSizeNum, t as randomId };
36
+ export { i as addGroupSeparator, a as checkEllipsisVisible, e as debounce, n as getSize, r as getSizeNum, o as getValueByPath, t as randomId };
@@ -191,6 +191,10 @@
191
191
  "description": "是否为轮廓按钮",
192
192
  "type": "boolean"
193
193
  },
194
+ "s-button/round": {
195
+ "description": "是否为圆角按钮",
196
+ "type": "boolean"
197
+ },
194
198
  "s-button-group/size": {
195
199
  "description": "按钮组大小"
196
200
  },
@@ -80,7 +80,8 @@
80
80
  "text",
81
81
  "link",
82
82
  "secondary",
83
- "outline"
83
+ "outline",
84
+ "round"
84
85
  ]
85
86
  },
86
87
  "s-button-group": {
@@ -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.8.0",
5
+ "version": "0.9.0",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
@@ -495,6 +495,14 @@
495
495
  "type": "boolean",
496
496
  "kind": "expression"
497
497
  }
498
+ },
499
+ {
500
+ "name": "round",
501
+ "description": "是否为圆角按钮",
502
+ "value": {
503
+ "type": "boolean",
504
+ "kind": "expression"
505
+ }
498
506
  }
499
507
  ],
500
508
  "events": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "savor-ui",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "A Vue3 Components Library",
5
5
  "keywords": [
6
6
  "component library",