savor-ui 0.8.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/es/components/src/button/button.vue_vue_type_script_setup_true_vapor_true_lang.mjs +4 -2
  3. package/dist/es/components/src/button/index.d.ts +1 -0
  4. package/dist/es/components/src/button/types.d.ts +2 -0
  5. package/dist/es/components/src/form/form-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +2 -2
  6. package/dist/es/components/src/grid/grid-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +2 -2
  7. package/dist/es/components/src/list/index.d.ts +13 -11
  8. package/dist/es/components/src/list/list.d.ts +9 -8
  9. package/dist/es/components/src/list/list.vue_vue_type_script_setup_true_vapor_true_lang.mjs +33 -28
  10. package/dist/es/components/src/list/types.d.ts +13 -13
  11. package/dist/es/components/src/modal/index.d.ts +2 -2
  12. package/dist/es/components/src/modal/modal.vue_vue_type_script_setup_true_vapor_true_lang.mjs +14 -14
  13. package/dist/es/components/src/modal/types.d.ts +4 -4
  14. package/dist/es/components/src/segmented/segmented.vue_vue_type_script_setup_true_vapor_true_lang.mjs +8 -1
  15. package/dist/es/components/src/switch/switch.vue_vue_type_script_setup_true_vapor_true_lang.mjs +9 -9
  16. package/dist/es/components/src/table/table-body.vue_vue_type_script_setup_true_vapor_true_lang.mjs +68 -70
  17. package/dist/es/theme/components/button.scss +3 -0
  18. package/dist/es/theme/components/grid.scss +3 -0
  19. package/dist/es/theme/components/list.scss +10 -16
  20. package/dist/es/theme/components/menu.scss +1 -0
  21. package/dist/es/theme/components/modal.scss +1 -1
  22. package/dist/es/theme/components/switch.scss +8 -9
  23. package/dist/es/theme/components/table.scss +1 -0
  24. package/dist/es/theme/components/tag.scss +1 -0
  25. package/dist/es/theme/components/tree.scss +1 -0
  26. package/dist/es/utils/src/theme/themeMap.mjs +5 -5
  27. package/dist/es/utils/src/tool.d.ts +7 -0
  28. package/dist/es/utils/src/tool.mjs +11 -2
  29. package/dist/json/vetur-attributes.json +11 -35
  30. package/dist/json/vetur-tags.json +4 -15
  31. package/dist/json/web-types.json +25 -86
  32. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
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
+
24
+ # [0.9.0](https://gitee.com/mach552/savor-ui/compare/v0.8.0...v0.9.0) (2026-07-07)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **grid:** 修复item内部高度虚高的问题 ([47221fc](https://gitee.com/mach552/savor-ui/commits/47221fcc9db115831e011ea43f386704e57c08ef))
30
+
31
+
32
+ ### Features
33
+
34
+ * **list:** 新增选择事件 ([2d132d3](https://gitee.com/mach552/savor-ui/commits/2d132d3e37ddc4b201272fa6a708dd7ac778436e))
35
+
5
36
  # [0.8.0](https://gitee.com/mach552/savor-ui/compare/v0.7.0...v0.8.0) (2026-07-03)
6
37
 
7
38
 
@@ -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({
@@ -11,7 +11,7 @@ var v = p("<div>", 1), y = /*@__PURE__*/ i({
11
11
  offset: { default: 0 }
12
12
  },
13
13
  setup(i) {
14
- let p = i, y = g("gridItemRef"), b = e("grid-item"), x = "grid-item-" + h(), S = a(t, {}), C = n(() => {
14
+ let p = i, y = g("gridItemRef"), b = e("grid"), x = "grid-item-" + h(), S = a(t, {}), C = n(() => {
15
15
  if (!S?.positionList) return {};
16
16
  let e = S?.positionList.value[x];
17
17
  return e ? { gridColumn: `${e.start} / ${e.end}` } : {};
@@ -40,7 +40,7 @@ var v = p("<div>", 1), y = /*@__PURE__*/ i({
40
40
  });
41
41
  let T = v();
42
42
  return c(() => {
43
- l(T, [m(b).b()]), f(T, C.value);
43
+ l(T, [m(b).e("item")]), f(T, C.value);
44
44
  }), u(T, null, 0), r(), d(T, y, null, "gridItemRef"), T;
45
45
  }
46
46
  });
@@ -1,27 +1,29 @@
1
1
  import { ListSlots } from './types';
2
2
  import { PublicProps, VNode, Plugin } from 'vue';
3
- export declare const SList: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
3
+ export declare const SList: (<T extends {
4
+ id: number;
5
+ }>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
4
6
  attrs: any;
5
- slots: ListSlots;
6
- emit: (((evt: "dragStart", data: any) => void) & ((evt: "dragEnd", data: any) => void)) & ((event: "update:modelValue", value: any) => void);
7
+ slots: ListSlots<T>;
8
+ emit: ((evt: "select", item: T, index: number) => void) & ((event: "update:modelValue", value: T) => void);
7
9
  }, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
8
10
  props: PublicProps & {
9
- modelValue?: any;
10
- data?: any[] | undefined;
11
+ modelValue?: T | undefined;
12
+ data?: T[] | undefined;
11
13
  hover?: boolean | undefined;
12
14
  selectable?: boolean | undefined;
13
- selectKey?: string | undefined;
14
15
  border?: boolean | undefined;
15
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
16
- onDragStart?: ((data: any) => any) | undefined;
17
- onDragEnd?: ((data: any) => any) | undefined;
16
+ gap?: number | undefined;
17
+ size?: "mini" | "small" | "medium" | "large" | undefined;
18
+ onSelect?: ((item: T, index: number) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
18
20
  } & (typeof globalThis extends {
19
21
  __VLS_PROPS_FALLBACK: infer P;
20
22
  } ? P : {});
21
23
  expose: (exposed: {}) => void;
22
24
  attrs: any;
23
- slots: ListSlots;
24
- emit: (((evt: "dragStart", data: any) => void) & ((evt: "dragEnd", data: any) => void)) & ((event: "update:modelValue", value: any) => void);
25
+ slots: ListSlots<T>;
26
+ emit: ((evt: "select", item: T, index: number) => void) & ((event: "update:modelValue", value: T) => void);
25
27
  }>) => VNode & {
26
28
  __ctx?: Awaited<typeof __VLS_setup>;
27
29
  }) & Plugin;
@@ -1,19 +1,20 @@
1
1
  import { ListProps, ListSlots } from './types';
2
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<(ListProps & {
5
- modelValue?: any;
3
+ declare const __VLS_export: <T extends {
4
+ id: number;
5
+ }>(__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<{
6
+ props: PublicProps & __VLS_PrettifyLocal<(ListProps<T> & {
7
+ modelValue?: T;
6
8
  }) & {
7
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
8
- onDragStart?: ((data: any) => any) | undefined;
9
- onDragEnd?: ((data: any) => any) | undefined;
9
+ onSelect?: ((item: T, index: number) => any) | undefined;
10
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
10
11
  }> & (typeof globalThis extends {
11
12
  __VLS_PROPS_FALLBACK: infer P;
12
13
  } ? P : {});
13
14
  expose: (exposed: {}) => void;
14
15
  attrs: any;
15
- slots: ListSlots;
16
- emit: (((evt: "dragStart", data: any) => void) & ((evt: "dragEnd", data: any) => void)) & ((event: "update:modelValue", value: any) => void);
16
+ slots: ListSlots<T>;
17
+ emit: ((evt: "select", item: T, index: number) => void) & ((event: "update:modelValue", value: T) => void);
17
18
  }>) => VNode & {
18
19
  __ctx?: Awaited<typeof __VLS_setup>;
19
20
  };
@@ -1,50 +1,55 @@
1
1
  import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
2
2
  import "../../../hooks/index.mjs";
3
- import { child as t, createFor as n, createInvoker as r, createSlot as i, defineVaporComponent as a, delegateEvents as o, mergeModels as s, renderEffect as c, setClass as l, setInsertionState as u, setStaticTemplateRef as d, setText as f, template as p, toDisplayString as m, unref as h, useModel as g } from "vue";
3
+ import { createFor as t, createInvoker as n, createSlot as r, defineVaporComponent as i, delegateEvents as a, mergeModels as o, renderEffect as s, setClass as c, setInsertionState as l, setStyle as u, setText as d, template as f, toDisplayString as p, unref as m, useModel as h } from "vue";
4
4
  //#region ../components/src/list/list.vue?vue&type=script&setup=true&vapor=true&lang.ts
5
- var _ = p(" "), v = p("<li>"), y = p("<div><ul>", 1);
6
- o("click");
7
- var b = /*@__PURE__*/ a({
5
+ var g = f(" "), _ = f("<li>"), v = f("<div>", 1);
6
+ a("click");
7
+ var y = /*@__PURE__*/ i({
8
8
  name: "SList",
9
9
  __name: "list",
10
- props: /*@__PURE__*/ s({
10
+ props: /*@__PURE__*/ o({
11
11
  modelValue: {},
12
12
  data: {},
13
13
  hover: { type: Boolean },
14
14
  selectable: { type: Boolean },
15
- selectKey: { default: "id" },
16
- border: { type: Boolean }
15
+ border: { type: Boolean },
16
+ gap: {},
17
+ size: { default: "medium" }
17
18
  }, {
18
19
  modelValue: { default: () => {} },
19
20
  modelModifiers: {}
20
21
  }),
21
- emits: /*@__PURE__*/ s(["dragStart", "dragEnd"], ["update:modelValue"]),
22
- setup(a, { emit: o }) {
23
- let s = a, p = e("list"), b = g(a, "modelValue"), x = (e) => {
24
- !s.selectable || !s.selectKey || (b.value = e[s.selectKey]);
25
- }, S = (e) => s.selectKey ? b.value === e[s.selectKey] && s.selectable : !1, C = y(), w = t(C);
26
- return c(() => {
27
- let e = h(p);
28
- l(C, [e.b(), { [e.m("border")]: a.border }]), l(w, [e.e("wrapper")]);
29
- }), u(w, null, 0), n(() => a.data, (e, t) => {
30
- let n = v();
31
- return c(() => {
32
- let t = h(p);
33
- l(n, [
22
+ emits: /*@__PURE__*/ o(["select"], ["update:modelValue"]),
23
+ setup(i, { emit: a }) {
24
+ let o = i, f = a, y = e("list"), b = h(i, "modelValue"), x = (e, t) => {
25
+ o.selectable && (b.value?.id !== void 0 && b.value.id === e.id ? b.value = {} : b.value = e, f("select", e, t));
26
+ }, S = (e) => b.value?.id === e.id && o.selectable, C = v();
27
+ return s(() => {
28
+ let e = m(y);
29
+ c(C, [
30
+ e.b(),
31
+ e.m(i.size),
32
+ { [e.m("border")]: i.border }
33
+ ]), u(C, { gap: `${i.gap}px` });
34
+ }), l(C, null, 0), t(() => i.data, (e, t) => {
35
+ let a = _();
36
+ return s(() => {
37
+ let t = m(y);
38
+ c(a, [
34
39
  t.e("item"),
35
40
  t.is("selected", S(e.value)),
36
- t.is("selectable", a.selectable),
37
- { [t.m("hover")]: a.hover }
41
+ t.is("selectable", i.selectable),
42
+ { [t.m("hover")]: i.hover }
38
43
  ]);
39
- }), u(n, null, 0), i("default", {
44
+ }), l(a, null, 0), r("default", {
40
45
  index: () => t.value,
41
46
  item: () => e.value
42
47
  }, () => {
43
- let t = _();
44
- return c(() => f(t, m(e.value))), t;
45
- }), n.$evtclick = r(() => x(e.value)), n;
46
- }, (e, t) => t, 9), d(w, "wrapperRef"), C;
48
+ let t = g();
49
+ return s(() => d(t, p(e.value))), t;
50
+ }), a.$evtclick = n(() => x(e.value, t.value)), a;
51
+ }, (e, t) => t, 9), C;
47
52
  }
48
53
  });
49
54
  //#endregion
50
- export { b as default };
55
+ export { y as default };
@@ -1,27 +1,27 @@
1
- export interface ListProps {
1
+ export interface ListProps<T> {
2
2
  /** 选中项(v-model) */
3
- modelValue?: any;
3
+ modelValue?: T;
4
4
  /** 列表项数据 */
5
- data?: any[];
5
+ data?: T[];
6
6
  /** 是否显示悬停状态 */
7
7
  hover?: boolean;
8
8
  /** 是否可选择 */
9
9
  selectable?: boolean;
10
- /** 选中项键名
11
- * @default id
12
- */
13
- selectKey?: string;
14
10
  /** 是否显示边框 */
15
11
  border?: boolean;
12
+ /** 列表项间距 */
13
+ gap?: number;
14
+ /** 列表项大小 */
15
+ size?: "mini" | "small" | "medium" | "large";
16
16
  }
17
- export interface ListSlots {
18
- /** 自定义列表项内容 */
17
+ export interface ListSlots<T> {
18
+ /** 列表项内容 */
19
19
  default: (props: {
20
- item: any;
20
+ item: T;
21
21
  index: number;
22
22
  }) => any;
23
23
  }
24
- export interface ListEmits {
25
- dragStart: [data: any];
26
- dragEnd: [data: any];
24
+ export interface ListEmits<T> {
25
+ /** 选择事件 */
26
+ select: [item: T, index: number];
27
27
  }
@@ -19,17 +19,17 @@ export declare const SModal: ((__VLS_props: NonNullable<Awaited<typeof __VLS_set
19
19
  destroyOnClose?: boolean | undefined;
20
20
  closeOnEsc?: boolean | undefined;
21
21
  content?: (string | VNode) | undefined;
22
- contentStyle?: Record<string, string> | undefined;
23
22
  renderToBody?: boolean | undefined;
24
- className?: string | undefined;
25
23
  btnReverse?: boolean | undefined;
26
24
  header?: boolean | undefined;
27
25
  footer?: boolean | undefined;
28
26
  mask?: boolean | undefined;
29
27
  to?: (string | HTMLElement) | undefined;
30
28
  draggable?: boolean | undefined;
29
+ className?: string | undefined;
31
30
  modalStyle?: Record<string, string> | undefined;
32
31
  maskStyle?: Record<string, string> | undefined;
32
+ bodyStyle?: Record<string, string> | undefined;
33
33
  center?: boolean | undefined;
34
34
  offset?: number | undefined;
35
35
  scrollContent?: boolean | undefined;
@@ -22,14 +22,11 @@ var M = /*@__PURE__*/ m({
22
22
  __name: "modal",
23
23
  props: /*@__PURE__*/ g({
24
24
  modalValue: { type: Boolean },
25
- width: { default: "320px" },
25
+ width: { default: "0px" },
26
26
  height: {},
27
27
  title: {},
28
28
  fullscreen: { type: Boolean },
29
- fullable: {
30
- type: Boolean,
31
- default: !0
32
- },
29
+ fullable: { type: Boolean },
33
30
  closable: {
34
31
  type: Boolean,
35
32
  default: !0
@@ -47,9 +44,7 @@ var M = /*@__PURE__*/ m({
47
44
  default: !0
48
45
  },
49
46
  content: {},
50
- contentStyle: {},
51
47
  renderToBody: { type: Boolean },
52
- className: {},
53
48
  btnReverse: { type: Boolean },
54
49
  header: {
55
50
  type: Boolean,
@@ -65,8 +60,10 @@ var M = /*@__PURE__*/ m({
65
60
  },
66
61
  to: { default: "body" },
67
62
  draggable: { type: Boolean },
63
+ className: {},
68
64
  modalStyle: {},
69
65
  maskStyle: {},
66
+ bodyStyle: {},
70
67
  center: {
71
68
  type: Boolean,
72
69
  default: !0
@@ -105,7 +102,6 @@ var M = /*@__PURE__*/ m({
105
102
  height: e(w.height),
106
103
  top: `${U.value}px`,
107
104
  left: `${W.value}px`,
108
- maxHeight: K.value ? `${K.value - 40}px` : void 0,
109
105
  ...w.modalStyle
110
106
  }), _e = () => {
111
107
  M("opened");
@@ -169,7 +165,8 @@ var M = /*@__PURE__*/ m({
169
165
  b(e, [
170
166
  t.b(),
171
167
  t.is("drag", m.draggable),
172
- t.is("fullscreen", V.value)
168
+ t.is("fullscreen", V.value),
169
+ m.className
173
170
  ]), S(e, ge.value);
174
171
  }), x(e, null, 0), f(() => m.header, () => {
175
172
  let e = de(), t = l(e), n = se(t, 1);
@@ -180,20 +177,21 @@ var M = /*@__PURE__*/ m({
180
177
  let e = A();
181
178
  return y(() => C(e, T(m.title))), e;
182
179
  }), y(() => b(n, [E(N).e("header-icon")])), x(n, null, 0), f(() => m.fullable, () => d(E(a), {
183
- circle: "",
184
180
  text: "",
185
- size: "small",
181
+ size: "mini",
186
182
  onClick: () => xe
187
183
  }, { icon: () => f(() => V.value, () => d(E(ne)), () => d(E(re)), 645) })), x(n, null, 1), f(() => m.closable, () => d(E(a), {
188
- circle: "",
189
184
  text: "",
190
- size: "small",
185
+ size: "mini",
191
186
  onClick: () => X
192
187
  }, { icon: () => d(E(te)) })), $(e, L, null, "headerRef"), e;
193
188
  }), x(e, null, 1), f(() => !m.scrollContent, () => {
194
189
  let e = k();
195
190
  return y(() => {
196
- b(e, [E(N).e("body")]), S(e, m.contentStyle);
191
+ b(e, [E(N).e("body")]), S(e, {
192
+ padding: "16px",
193
+ ...m.bodyStyle
194
+ });
197
195
  }), x(e, null, 0), p("default", null, () => {
198
196
  let e = A();
199
197
  return y(() => C(e, T(m.content))), e;
@@ -220,11 +218,13 @@ var M = /*@__PURE__*/ m({
220
218
  onClick: () => X
221
219
  })], () => [d(E(a), {
222
220
  label: "取消",
221
+ size: "small",
223
222
  secondary: "",
224
223
  onClick: () => X
225
224
  }), d(E(a), {
226
225
  label: "确定",
227
226
  loading: () => H.value,
227
+ size: "small",
228
228
  type: "primary",
229
229
  onClick: () => Y
230
230
  })], 1930)), e;
@@ -23,12 +23,8 @@ export interface ModalProps {
23
23
  closeOnEsc?: boolean;
24
24
  /** 弹窗内容 */
25
25
  content?: string | VNode;
26
- /** 弹窗内容自定义样式 */
27
- contentStyle?: Record<string, string>;
28
26
  /** 是否渲染到 body 元素 */
29
27
  renderToBody?: boolean;
30
- /** 弹窗自定义类名 */
31
- className?: string;
32
28
  /** 是否反转按钮顺序 */
33
29
  btnReverse?: boolean;
34
30
  /** 是否显示弹窗头 */
@@ -41,10 +37,14 @@ export interface ModalProps {
41
37
  to?: string | HTMLElement;
42
38
  /** 是否开启拖动弹窗 */
43
39
  draggable?: boolean;
40
+ /** 弹窗自定义类名 */
41
+ className?: string;
44
42
  /** 弹窗自定义样式 */
45
43
  modalStyle?: Record<string, string>;
46
44
  /** 弹窗遮罩自定义样式 */
47
45
  maskStyle?: Record<string, string>;
46
+ /** 弹窗内容自定义样式 */
47
+ bodyStyle?: Record<string, string>;
48
48
  /** 是否居中显示弹窗
49
49
  * @default true
50
50
  */
@@ -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,4 +6,7 @@
6
6
  width: 100%;
7
7
  display: grid;
8
8
  grid-template-rows: auto;
9
+ @include e(item) {
10
+ display: flex;
11
+ }
9
12
  }
@@ -1,9 +1,12 @@
1
1
  @use "../mixins/function.scss" as *;
2
2
  @use "../mixins/mixins.scss" as *;
3
+ @use "../common/var.scss" as *;
3
4
 
4
5
  @include b(list) {
5
6
  width: 100%;
6
7
  overflow: hidden;
8
+ display: flex;
9
+ flex-direction: column;
7
10
  @include m(border) {
8
11
  border-radius: getCssVar("radius", "medium");
9
12
  border: 1px solid getCssVar("color", "fill-3");
@@ -14,17 +17,7 @@
14
17
  }
15
18
  }
16
19
  }
17
- @include e(wrapper) {
18
- position: relative;
19
- padding: 0;
20
- margin: 0;
21
- list-style-type: none;
22
- }
23
- @include m(wrapper-move) {
24
- transition: transform 0.3s ease;
25
- }
26
20
  @include e(item) {
27
- padding: 8px 16px;
28
21
  display: flex;
29
22
  align-items: center;
30
23
  color: getCssVar("color", "text-1");
@@ -44,16 +37,17 @@
44
37
  }
45
38
  }
46
39
  }
47
- @include m(drag) {
48
- cursor: move;
49
- }
50
- @include m(ghost) {
51
- opacity: 1;
52
- }
53
40
  @include m(hover) {
54
41
  border-radius: getCssVar("radius", "medium");
55
42
  &:hover {
56
43
  background-color: getCssVar("color", "fill-2");
57
44
  }
58
45
  }
46
+ @each $size in $size-list {
47
+ @include m($size) {
48
+ @include be(list, item) {
49
+ height: getCssVar("size", $size);
50
+ }
51
+ }
52
+ }
59
53
  }
@@ -28,6 +28,7 @@
28
28
  justify-content: center;
29
29
  padding: 0;
30
30
  @include when(active) {
31
+ border-radius: getCssVar("radius", "medium");
31
32
  background-color: getCssVar("color", "primary-3");
32
33
  color: getCssVar("color", "primary-6");
33
34
  }
@@ -3,6 +3,7 @@
3
3
 
4
4
  @include b(modal) {
5
5
  position: absolute;
6
+ min-width: 280px;
6
7
  color: getCssVar("color", "text-1");
7
8
  box-shadow: getCssVar("shadow", "1");
8
9
  display: flex;
@@ -67,7 +68,6 @@
67
68
  }
68
69
  @include e(body) {
69
70
  flex: 1;
70
- padding: 16px;
71
71
  overflow: hidden;
72
72
  }
73
73
  @include e(footer) {
@@ -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
  },
@@ -1308,34 +1312,6 @@
1308
1312
  "description": "链接是否禁用状态",
1309
1313
  "type": "boolean"
1310
1314
  },
1311
- "s-list/dragStart": {
1312
- "description": "—"
1313
- },
1314
- "s-list/dragEnd": {
1315
- "description": "—"
1316
- },
1317
- "s-list/modelValue": {
1318
- "description": "选中项(v-model)"
1319
- },
1320
- "s-list/data": {
1321
- "description": "列表项数据"
1322
- },
1323
- "s-list/hover": {
1324
- "description": "是否显示悬停状态",
1325
- "type": "boolean"
1326
- },
1327
- "s-list/selectable": {
1328
- "description": "是否可选择",
1329
- "type": "boolean"
1330
- },
1331
- "s-list/selectKey": {
1332
- "description": "选中项键名",
1333
- "type": "string"
1334
- },
1335
- "s-list/border": {
1336
- "description": "是否显示边框",
1337
- "type": "boolean"
1338
- },
1339
1315
  "s-menu/itemClick": {
1340
1316
  "description": "点击菜单项时触发"
1341
1317
  },
@@ -1516,17 +1492,10 @@
1516
1492
  "s-modal/content": {
1517
1493
  "description": "弹窗内容"
1518
1494
  },
1519
- "s-modal/contentStyle": {
1520
- "description": "弹窗内容自定义样式"
1521
- },
1522
1495
  "s-modal/renderToBody": {
1523
1496
  "description": "是否渲染到 body 元素",
1524
1497
  "type": "boolean"
1525
1498
  },
1526
- "s-modal/className": {
1527
- "description": "弹窗自定义类名",
1528
- "type": "string"
1529
- },
1530
1499
  "s-modal/btnReverse": {
1531
1500
  "description": "是否反转按钮顺序",
1532
1501
  "type": "boolean"
@@ -1550,12 +1519,19 @@
1550
1519
  "description": "是否开启拖动弹窗",
1551
1520
  "type": "boolean"
1552
1521
  },
1522
+ "s-modal/className": {
1523
+ "description": "弹窗自定义类名",
1524
+ "type": "string"
1525
+ },
1553
1526
  "s-modal/modalStyle": {
1554
1527
  "description": "弹窗自定义样式"
1555
1528
  },
1556
1529
  "s-modal/maskStyle": {
1557
1530
  "description": "弹窗遮罩自定义样式"
1558
1531
  },
1532
+ "s-modal/bodyStyle": {
1533
+ "description": "弹窗内容自定义样式"
1534
+ },
1559
1535
  "s-modal/center": {
1560
1536
  "description": "是否居中显示弹窗",
1561
1537
  "type": "boolean"
@@ -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": {
@@ -568,18 +569,6 @@
568
569
  "disabled"
569
570
  ]
570
571
  },
571
- "s-list": {
572
- "attributes": [
573
- "dragStart",
574
- "dragEnd",
575
- "modelValue",
576
- "data",
577
- "hover",
578
- "selectable",
579
- "selectKey",
580
- "border"
581
- ]
582
- },
583
572
  "s-menu": {
584
573
  "attributes": [
585
574
  "itemClick",
@@ -654,17 +643,17 @@
654
643
  "destroyOnClose",
655
644
  "closeOnEsc",
656
645
  "content",
657
- "contentStyle",
658
646
  "renderToBody",
659
- "className",
660
647
  "btnReverse",
661
648
  "header",
662
649
  "footer",
663
650
  "mask",
664
651
  "to",
665
652
  "draggable",
653
+ "className",
666
654
  "modalStyle",
667
655
  "maskStyle",
656
+ "bodyStyle",
668
657
  "center",
669
658
  "offset",
670
659
  "scrollContent",
@@ -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.7.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": [],
@@ -3450,75 +3458,6 @@
3450
3458
  }
3451
3459
  ]
3452
3460
  },
3453
- {
3454
- "name": "s-list",
3455
- "attributes": [
3456
- {
3457
- "name": "modelValue",
3458
- "description": "选中项(v-model)",
3459
- "value": {
3460
- "type": "any",
3461
- "kind": "expression"
3462
- }
3463
- },
3464
- {
3465
- "name": "data",
3466
- "description": "列表项数据",
3467
- "value": {
3468
- "type": "any[]",
3469
- "kind": "expression"
3470
- }
3471
- },
3472
- {
3473
- "name": "hover",
3474
- "description": "是否显示悬停状态",
3475
- "value": {
3476
- "type": "boolean",
3477
- "kind": "expression"
3478
- }
3479
- },
3480
- {
3481
- "name": "selectable",
3482
- "description": "是否可选择",
3483
- "value": {
3484
- "type": "boolean",
3485
- "kind": "expression"
3486
- }
3487
- },
3488
- {
3489
- "name": "selectKey",
3490
- "description": "选中项键名",
3491
- "value": {
3492
- "type": "string",
3493
- "kind": "expression"
3494
- }
3495
- },
3496
- {
3497
- "name": "border",
3498
- "description": "是否显示边框",
3499
- "value": {
3500
- "type": "boolean",
3501
- "kind": "expression"
3502
- }
3503
- }
3504
- ],
3505
- "events": [
3506
- {
3507
- "name": "dragStart",
3508
- "description": "—"
3509
- },
3510
- {
3511
- "name": "dragEnd",
3512
- "description": "—"
3513
- }
3514
- ],
3515
- "slots": [
3516
- {
3517
- "name": "default",
3518
- "description": "自定义列表项内容"
3519
- }
3520
- ]
3521
- },
3522
3461
  {
3523
3462
  "name": "s-menu",
3524
3463
  "attributes": [
@@ -3969,14 +3908,6 @@
3969
3908
  "kind": "expression"
3970
3909
  }
3971
3910
  },
3972
- {
3973
- "name": "contentStyle",
3974
- "description": "弹窗内容自定义样式",
3975
- "value": {
3976
- "type": "Record<string, string>",
3977
- "kind": "expression"
3978
- }
3979
- },
3980
3911
  {
3981
3912
  "name": "renderToBody",
3982
3913
  "description": "是否渲染到 body 元素",
@@ -3985,14 +3916,6 @@
3985
3916
  "kind": "expression"
3986
3917
  }
3987
3918
  },
3988
- {
3989
- "name": "className",
3990
- "description": "弹窗自定义类名",
3991
- "value": {
3992
- "type": "string",
3993
- "kind": "expression"
3994
- }
3995
- },
3996
3919
  {
3997
3920
  "name": "btnReverse",
3998
3921
  "description": "是否反转按钮顺序",
@@ -4041,6 +3964,14 @@
4041
3964
  "kind": "expression"
4042
3965
  }
4043
3966
  },
3967
+ {
3968
+ "name": "className",
3969
+ "description": "弹窗自定义类名",
3970
+ "value": {
3971
+ "type": "string",
3972
+ "kind": "expression"
3973
+ }
3974
+ },
4044
3975
  {
4045
3976
  "name": "modalStyle",
4046
3977
  "description": "弹窗自定义样式",
@@ -4057,6 +3988,14 @@
4057
3988
  "kind": "expression"
4058
3989
  }
4059
3990
  },
3991
+ {
3992
+ "name": "bodyStyle",
3993
+ "description": "弹窗内容自定义样式",
3994
+ "value": {
3995
+ "type": "Record<string, string>",
3996
+ "kind": "expression"
3997
+ }
3998
+ },
4060
3999
  {
4061
4000
  "name": "center",
4062
4001
  "description": "是否居中显示弹窗",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "savor-ui",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "A Vue3 Components Library",
5
5
  "keywords": [
6
6
  "component library",