savor-ui 0.29.0 → 0.31.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,28 @@
2
2
 
3
3
 
4
4
 
5
+ # [0.31.0](https://gitee.com/mach552/savor-ui/compare/v0.30.0...v0.31.0) (2026-09-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * **notification:** 新增按钮属性和事件 ([24a763f](https://gitee.com/mach552/savor-ui/commits/24a763f2bdd1e94a82f62fc2ee2b8a2c37495dbb))
11
+
12
+ # [0.30.0](https://gitee.com/mach552/savor-ui/compare/v0.29.0...v0.30.0) (2026-08-31)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **datetime-picker:** 修复禁用样式无效问题 ([19a295b](https://gitee.com/mach552/savor-ui/commits/19a295b6475dc97eb8456a0803c22791a7f299a8))
18
+ * **input-tag:** 修复错误状态样式无效问题 ([1c219ef](https://gitee.com/mach552/savor-ui/commits/1c219efbc6f4211bc02f3f77fa9d2b076f53f6e0))
19
+ * **textarea:** 修复错误状态样式无效问题 ([595dee9](https://gitee.com/mach552/savor-ui/commits/595dee93be93033a7adf058710012d72c7f982ab))
20
+ * **textarea:** 修复禁用样式无效问题 ([86ae468](https://gitee.com/mach552/savor-ui/commits/86ae4689e9a43ad72fbc0d42093f5d89382c3f6f))
21
+
22
+
23
+ ### Features
24
+
25
+ * **form:** 新增额外内容属性和插槽 ([bd9534d](https://gitee.com/mach552/savor-ui/commits/bd9534d1ba5d70501c3bd1467fe23b8b3bdfe0d2))
26
+
5
27
  # [0.29.0](https://gitee.com/mach552/savor-ui/compare/v0.28.0...v0.29.0) (2026-08-30)
6
28
 
7
29
 
@@ -66,6 +66,7 @@ import "./src/message/index.mjs";
66
66
  import "./src/meter-group/index.mjs";
67
67
  import "./src/modal/method.mjs";
68
68
  import "./src/modal/index.mjs";
69
+ import "./src/space/index.mjs";
69
70
  import "./src/notification/method.mjs";
70
71
  import "./src/notification/index.mjs";
71
72
  import "./src/tag/index.mjs";
@@ -76,7 +77,6 @@ import "./src/panel/index.mjs";
76
77
  import "./src/progress/index.mjs";
77
78
  import "./src/skeleton/index.mjs";
78
79
  import "./src/slider-verify/index.mjs";
79
- import "./src/space/index.mjs";
80
80
  import "./src/split/types.mjs";
81
81
  import "./src/split/index.mjs";
82
82
  import "./src/statistic/index.mjs";
@@ -251,7 +251,7 @@ var k = /*@__PURE__*/ m({
251
251
  t.is("range", W.value),
252
252
  t.is("error", T(j)),
253
253
  t.is("filled", xe.value)
254
- ]), C(r, Me.value), S(r, "clearable", m.clearable), S(r, "placeholder", Pe.value), S(r, "disabled", n), b(r, [t.e("input")]);
254
+ ]), C(r, Me.value), S(r, "clearable", m.clearable), S(r, "placeholder", Pe.value), S(r, "disabled", n), b(r, [t.e("inner")]);
255
255
  }), x(e, null, 1), f(() => M.value && !!A.value && m.clearable, () => {
256
256
  let e = ge();
257
257
  return y(() => b(e, [T(k).e("close")])), x(e, null, 0), d(T(n)), _(e, "click", E(De, ["stop"])), e;
@@ -264,7 +264,7 @@ var k = /*@__PURE__*/ m({
264
264
  r.$evtinput = p(Ue), _(r, "blur", We), _(r, "click", E(U, ["stop"]));
265
265
  let o = se(i);
266
266
  return a.$evtinput = p(Ge), _(a, "blur", Ke), _(a, "click", E(U, ["stop"])), y(() => {
267
- let t = T(k), n = m.disabled, i = Ne.value, s = m.clearable, c = Fe.value, l = [t.e("input")];
267
+ let t = T(k), n = m.disabled, i = Ne.value, s = m.clearable, c = Fe.value, l = [t.e("inner")];
268
268
  b(e, [
269
269
  t.e("wrapper"),
270
270
  t.is("disabled", n),
@@ -1,4 +1,4 @@
1
- import { FormItemExpose, FormItemProps } from './types';
1
+ import { FormItemExpose, FormItemProps, FormItemSlots } from './types';
2
2
  import { PublicProps, ShallowUnwrapRef, VNode } from 'vue';
3
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
4
  props: PublicProps & __VLS_PrettifyLocal<FormItemProps> & (typeof globalThis extends {
@@ -6,19 +6,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
6
6
  } ? P : {});
7
7
  expose: (exposed: ShallowUnwrapRef<FormItemExpose>) => void;
8
8
  attrs: any;
9
- slots: {
10
- label?: (props: {
11
- label: string | undefined;
12
- }) => any;
13
- } & {
14
- label?: (props: {
15
- label: string | undefined;
16
- }) => any;
17
- } & {
18
- default?: (props: {
19
- validate: (trigger?: string) => Promise<true | void>;
20
- }) => any;
21
- };
9
+ slots: FormItemSlots;
22
10
  emit: {};
23
11
  }>) => VNode & {
24
12
  __ctx?: Awaited<typeof __VLS_setup>;
@@ -4,12 +4,12 @@ import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
4
4
  import "../../../hooks/index.mjs";
5
5
  import { AsteriskLine as n } from "../../../icons/src/svg/editor/index.mjs";
6
6
  import { QuestionLine as r } from "../../../icons/src/svg/system/index.mjs";
7
- import { formContextKey as i, formItemContextKey as a, formItemStatusContextKey as o } from "./types.mjs";
8
- import { STooltip as s } from "../tooltip/index.mjs";
9
- import { child as c, computed as l, createComponent as u, createIf as d, createSlot as f, defineVaporComponent as p, inject as m, onMounted as h, onUnmounted as g, provide as _, ref as v, renderEffect as y, setClass as b, setInsertionState as x, setStyle as S, setText as C, template as w, toDisplayString as T, txt as E, unref as D } from "vue";
10
- import O from "async-validator";
7
+ import { formContextKey as i, formItemContextKey as a, formItemStatusContextKey as ee } from "./types.mjs";
8
+ import { STooltip as o } from "../tooltip/index.mjs";
9
+ import { child as s, computed as c, createComponent as l, createIf as u, createSlot as d, defineVaporComponent as f, inject as p, onMounted as m, onUnmounted as h, provide as g, ref as te, renderEffect as _, setClass as v, setInsertionState as y, setStyle as ne, setText as b, template as x, toDisplayString as S, txt as C, unref as w } from "vue";
10
+ import T from "async-validator";
11
11
  //#region ../components/src/form/form-item.vue?vue&type=script&setup=true&vapor=true&lang.ts
12
- var k = w("<span>"), A = w(" "), j = w("<div><label>"), M = w("<div> "), N = w("<div><div><div></div>", 1), P = /*@__PURE__*/ p({
12
+ var E = x("<span>"), D = x(" "), O = x("<div><label>"), k = x("<div>"), A = x("<div> "), j = x("<div><div><div></div>", 1), M = /*@__PURE__*/ f({
13
13
  name: "SFormItem",
14
14
  __name: "form-item",
15
15
  props: {
@@ -24,27 +24,28 @@ var k = w("<span>"), A = w(" "), j = w("<div><label>"), M = w("<div> "), N = w("
24
24
  type: Boolean,
25
25
  default: !0
26
26
  },
27
- requiredAlign: {}
27
+ requiredAlign: {},
28
+ extra: {}
28
29
  },
29
- setup(p, { expose: w }) {
30
- let P = p, F = t("form-item"), I = m(i), L = l(() => P.labelPosition ? P.labelPosition : I?.labelPosition?.value ? I?.labelPosition?.value : "left"), ee = l(() => I?.labelPosition?.value === "top" ? "" : P.labelWidth || I?.labelWidth?.value), R = l(() => P.labelAlign ? P.labelAlign : I?.labelAlign?.value ? I?.labelAlign?.value : I?.labelPosition?.value === "top" ? "left" : "right"), z = null, B = l(() => {
31
- let e = I?.model?.value;
32
- return e && P.field && e[P.field] !== void 0 ? e[P.field] : null;
33
- }), V = l(() => {
34
- let e = I?.rules?.value;
35
- return e && P.field && e[P.field] ? e[P.field] : P.rules && P.rules.length > 0 ? P.rules : [];
36
- }), H = v({
30
+ setup(f, { expose: x, slots: M }) {
31
+ let N = f, P = t("form-item"), F = p(i), I = c(() => N.labelPosition ? N.labelPosition : F?.labelPosition?.value ? F?.labelPosition?.value : "left"), L = c(() => F?.labelPosition?.value === "top" ? "" : N.labelWidth || F?.labelWidth?.value), R = c(() => N.labelAlign ? N.labelAlign : F?.labelAlign?.value ? F?.labelAlign?.value : F?.labelPosition?.value === "top" ? "left" : "right"), z = null, B = c(() => {
32
+ let e = F?.model?.value;
33
+ return e && N.field && e[N.field] !== void 0 ? e[N.field] : null;
34
+ }), V = c(() => {
35
+ let e = F?.rules?.value;
36
+ return e && N.field && e[N.field] ? e[N.field] : N.rules && N.rules.length > 0 ? N.rules : [];
37
+ }), H = te({
37
38
  state: "init",
38
39
  errorMsg: "",
39
40
  loading: !1
40
- }), U = (e) => V.value ? V.value.filter((t) => !t.trigger || !e ? !0 : t.trigger && t.trigger === e) : [], W = l(() => V.value.some((e) => e.required) && (P.showRequired || I?.showRequired?.value)), G = l(() => P.requiredAlign ? P.requiredAlign : I?.requiredAlign?.value ? I?.requiredAlign?.value : "left"), K = async (e) => {
41
- let t = P.field, n = U(e);
41
+ }), U = (e) => V.value ? V.value.filter((t) => !t.trigger || !e ? !0 : t.trigger && t.trigger === e) : [], W = c(() => V.value.some((e) => e.required) && (N.showRequired || F?.showRequired?.value)), G = c(() => N.requiredAlign ? N.requiredAlign : F?.requiredAlign?.value ? F?.requiredAlign?.value : "left"), K = async (e) => {
42
+ let t = N.field, n = U(e);
42
43
  if (n.length === 0) return !0;
43
44
  if (t) {
44
45
  let e = B.value, r = Array.isArray(e) ? "array" : e != null && typeof e != "string" ? typeof e : void 0, i = r ? n.map((e) => e.type ? e : {
45
46
  ...e,
46
47
  type: r
47
- }) : n, a = new O({ [t]: i });
48
+ }) : n, a = new T({ [t]: i });
48
49
  return H.value.loading = !0, a.validate({ [t]: e }).then(() => {
49
50
  H.value.state = "success", H.value.errorMsg = "";
50
51
  }).catch((e) => {
@@ -58,72 +59,78 @@ var k = w("<span>"), A = w(" "), j = w("<div><label>"), M = w("<div> "), N = w("
58
59
  H.value.state = "init", H.value.errorMsg = "", H.value.loading = !1;
59
60
  }, J = () => {
60
61
  q();
61
- let e = I?.model?.value;
62
- e && P.field && (e[P.field] = z);
63
- }, Y = l(() => H.value.state === "error"), X = {
62
+ let e = F?.model?.value;
63
+ e && N.field && (e[N.field] = z);
64
+ }, Y = c(() => H.value.state === "error"), X = {
64
65
  validate: K,
65
- field: P.field,
66
+ field: N.field,
66
67
  resetField: J,
67
68
  clearValidate: q
68
69
  };
69
- _(a, X), _(o, {
70
- size: I?.size,
70
+ g(a, X), g(ee, {
71
+ size: F?.size,
71
72
  error: Y
73
+ }), m(() => {
74
+ N.field && (F?.addField(X), z = F?.model?.value?.[N.field]);
72
75
  }), h(() => {
73
- P.field && (I?.addField(X), z = I?.model?.value?.[P.field]);
74
- }), g(() => {
75
- P.field && I?.removeField(X);
76
- }), w({
76
+ N.field && F?.removeField(X);
77
+ }), x({
77
78
  validate: K,
78
79
  resetField: J,
79
80
  clearValidate: q,
80
81
  validateStatus: H
81
82
  });
82
- let Z = N(), Q = c(Z, 1), $ = c(Q);
83
- return y(() => {
84
- let e = D(F), t = H.value, n = t.state;
85
- b(Z, [
83
+ let Z = j(), Q = s(Z, 1), $ = s(Q);
84
+ return _(() => {
85
+ let e = w(P), t = H.value, n = t.state;
86
+ v(Z, [
86
87
  e.b(),
87
88
  e.is("error", n === "error"),
88
89
  e.is("success", n === "success"),
89
90
  e.is("loading", t.loading),
90
- e.is("top", L.value === "top"),
91
- e.m(D(I)?.size?.value)
91
+ e.is("top", I.value === "top"),
92
+ e.m(w(F)?.size?.value)
92
93
  ]);
93
- }), x(Z, 0, 0), d(() => W.value || p.label || p.tooltip, () => {
94
- let t = j(), i = c(t);
95
- return y(() => {
96
- let n = D(F);
97
- b(t, [n.e("label-wrapper")]), b(i, [n.e("label"), n.m("align-" + R.value)]), S(i, { width: D(e)(ee.value) });
98
- }), x(i, null, 0), d(() => G.value === "left", () => [d(() => W.value, () => {
99
- let e = k();
100
- return y(() => b(e, [D(F).e("required")])), x(e, null, 0), u(D(n)), e;
101
- }), f("label", { label: () => p.label }, () => {
102
- let e = A();
103
- return y(() => C(e, T(p.label))), e;
104
- })], () => d(() => G.value === "right", () => [f("label", { label: () => p.label }, () => {
105
- let e = A();
106
- return y(() => C(e, T(p.label))), e;
107
- }), d(() => W.value, () => {
108
- let e = k();
109
- return y(() => b(e, [D(F).e("required")])), x(e, null, 0), u(D(n)), e;
110
- })], null, 2), 518), x(i, null, 1), d(() => p.tooltip, () => u(D(s), {
111
- content: () => p.tooltip,
94
+ }), y(Z, 0, 0), u(() => W.value || f.label || f.tooltip, () => {
95
+ let t = O(), i = s(t);
96
+ return _(() => {
97
+ let n = w(P);
98
+ v(t, [n.e("label-wrapper")]), v(i, [n.e("label"), n.m("align-" + R.value)]), ne(i, { width: w(e)(L.value) });
99
+ }), y(i, null, 0), u(() => G.value === "left", () => [u(() => W.value, () => {
100
+ let e = E();
101
+ return _(() => v(e, [w(P).e("required")])), y(e, null, 0), l(w(n)), e;
102
+ }), d("label", { label: () => f.label }, () => {
103
+ let e = D();
104
+ return _(() => b(e, S(f.label))), e;
105
+ })], () => u(() => G.value === "right", () => [d("label", { label: () => f.label }, () => {
106
+ let e = D();
107
+ return _(() => b(e, S(f.label))), e;
108
+ }), u(() => W.value, () => {
109
+ let e = E();
110
+ return _(() => v(e, [w(P).e("required")])), y(e, null, 0), l(w(n)), e;
111
+ })], null, 2), 518), y(i, null, 1), u(() => f.tooltip, () => l(w(o), {
112
+ content: () => f.tooltip,
112
113
  mini: ""
113
114
  }, () => {
114
- let e = k();
115
- return y(() => b(e, [D(F).e("tooltip")])), x(e, null, 0), u(D(r)), e;
115
+ let e = E();
116
+ return _(() => v(e, [w(P).e("tooltip")])), y(e, null, 0), l(w(r)), e;
116
117
  })), t;
117
- }), y(() => {
118
- let e = D(F);
119
- b(Q, [e.e("content-wrapper")]), b($, [e.e("content")]);
120
- }), x($, null, 0), f("default", { validate: () => K }), x(Q, null, 1), d(() => H.value.state === "error", () => {
121
- let e = M(), t = E(e);
122
- return y(() => {
123
- b(e, [D(F).e("error-msg")]), C(t, T(H.value.errorMsg));
118
+ }), _(() => {
119
+ let e = w(P);
120
+ v(Q, [e.e("content-wrapper")]), v($, [e.e("content")]);
121
+ }), y($, null, 0), d("default", { validate: () => K }), y(Q, null, 1), u(() => M.extra || f.extra, () => {
122
+ let e = k();
123
+ return _(() => v(e, [w(P).e("extra")])), y(e, null, 0), d("extra", null, () => {
124
+ let e = D();
125
+ return _(() => b(e, S(f.extra))), e;
126
+ }), e;
127
+ }), y(Q, null, 2), u(() => H.value.state === "error", () => {
128
+ let e = A(), t = C(e);
129
+ return _(() => {
130
+ v(e, [w(P).e("error-msg")]), b(t, S(H.value.errorMsg));
124
131
  }), e;
125
132
  }), Z;
126
133
  }
127
134
  });
128
135
  //#endregion
129
- export { P as default };
136
+ export { M as default };
@@ -1,5 +1,5 @@
1
1
  import { PublicProps, ShallowUnwrapRef, VNode, Plugin } from 'vue';
2
- import { FormItemRule, FormExpose, FormItemExpose } from './types';
2
+ import { FormItemRule, FormExpose, FormItemSlots, FormItemExpose } from './types';
3
3
  export declare const SForm: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
4
4
  attrs: any;
5
5
  slots: {
@@ -31,19 +31,7 @@ export declare const SForm: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setu
31
31
  }) & Plugin;
32
32
  export declare const SFormItem: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
33
33
  attrs: any;
34
- slots: {
35
- label?: (props: {
36
- label: string | undefined;
37
- }) => any;
38
- } & {
39
- label?: (props: {
40
- label: string | undefined;
41
- }) => any;
42
- } & {
43
- default?: (props: {
44
- validate: (trigger?: string) => Promise<true | void>;
45
- }) => any;
46
- };
34
+ slots: FormItemSlots;
47
35
  emit: {};
48
36
  }, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
49
37
  props: PublicProps & {
@@ -56,24 +44,13 @@ export declare const SFormItem: ((__VLS_props: NonNullable<Awaited<typeof __VLS_
56
44
  labelAlign?: "left" | "right" | undefined;
57
45
  showRequired?: boolean | undefined;
58
46
  requiredAlign?: "left" | "right" | undefined;
47
+ extra?: string | undefined;
59
48
  } & (typeof globalThis extends {
60
49
  __VLS_PROPS_FALLBACK: infer P;
61
50
  } ? P : {});
62
51
  expose: (exposed: ShallowUnwrapRef<FormItemExpose>) => void;
63
52
  attrs: any;
64
- slots: {
65
- label?: (props: {
66
- label: string | undefined;
67
- }) => any;
68
- } & {
69
- label?: (props: {
70
- label: string | undefined;
71
- }) => any;
72
- } & {
73
- default?: (props: {
74
- validate: (trigger?: string) => Promise<true | void>;
75
- }) => any;
76
- };
53
+ slots: FormItemSlots;
77
54
  emit: {};
78
55
  }>) => VNode & {
79
56
  __ctx?: Awaited<typeof __VLS_setup>;
@@ -53,6 +53,16 @@ export interface FormItemProps {
53
53
  showRequired?: boolean;
54
54
  /** 必填标识对齐方式 */
55
55
  requiredAlign?: "left" | "right";
56
+ /** 表单项额外内容 */
57
+ extra?: string;
58
+ }
59
+ export interface FormItemSlots {
60
+ /** 内容 */
61
+ default: () => any;
62
+ /** 标签 */
63
+ label: () => any;
64
+ /** 额外内容 */
65
+ extra: () => any;
56
66
  }
57
67
  export interface FormContext {
58
68
  /** 表单模型 */
@@ -2,9 +2,10 @@ import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
2
2
  import "../../../hooks/index.mjs";
3
3
  import { CheckCircleLine as t, CloseCircleLine as n, InformationLine as r, WarningLine as i } from "../../../icons/src/svg/system/index.mjs";
4
4
  import { SButton as a } from "../button/index.mjs";
5
- import { child as o, createComponent as s, createIf as c, defineVaporComponent as l, on as u, onMounted as d, onUnmounted as f, ref as p, renderEffect as m, setClass as h, setInsertionState as g, setText as _, template as v, toDisplayString as y, txt as b, unref as x } from "vue";
5
+ import { SSpace as o } from "../space/index.mjs";
6
+ import { child as s, createComponent as c, createIf as l, defineVaporComponent as u, on as d, onMounted as f, onUnmounted as p, ref as m, renderEffect as h, setClass as g, setInsertionState as _, setText as v, template as y, toDisplayString as b, txt as x, unref as S } from "vue";
6
7
  //#region ../components/src/notification/notification.vue?vue&type=script&setup=true&vapor=true&lang.ts
7
- var S = v("<div>"), C = v("<div> "), w = v("<div><div>", 1), T = /*@__PURE__*/ l({
8
+ var C = y("<div>"), w = y("<div> "), T = y("<div><div>", 1), E = /*@__PURE__*/ u({
8
9
  __name: "notification",
9
10
  props: {
10
11
  type: { default: "info" },
@@ -21,52 +22,71 @@ var S = v("<div>"), C = v("<div> "), w = v("<div><div>", 1), T = /*@__PURE__*/ l
21
22
  type: Boolean,
22
23
  default: !0
23
24
  },
24
- id: {}
25
+ id: {},
26
+ confirmProps: {},
27
+ cancelProps: {},
28
+ confirm: {},
29
+ cancel: {}
25
30
  },
26
31
  emits: ["close"],
27
- setup(l, { emit: v }) {
28
- let T = l, E = e("notification"), D = v, O = p(null), k = p(!1), A = () => {
29
- D("close", T.id);
30
- }, j = () => {
31
- O.value &&= (clearTimeout(O.value), null);
32
+ setup(u, { emit: y }) {
33
+ let E = u, D = e("notification"), O = y, k = m(null), A = m(!1), j = () => {
34
+ O("close", E.id);
32
35
  }, M = () => {
33
- j(), T.duration !== 0 && !k.value && (O.value = window.setTimeout(() => {
34
- D("close", T.id);
35
- }, T.duration));
36
+ k.value &&= (clearTimeout(k.value), null);
36
37
  }, N = () => {
37
- T.hover && (k.value = !0, j());
38
+ M(), E.duration !== 0 && !A.value && (k.value = window.setTimeout(() => {
39
+ O("close", E.id);
40
+ }, E.duration));
38
41
  }, P = () => {
39
- T.hover && (k.value = !1, M());
42
+ E.hover && (A.value = !0, M());
43
+ }, F = () => {
44
+ E.hover && (A.value = !1, N());
40
45
  };
41
- d(() => {
46
+ f(() => {
47
+ N();
48
+ }), p(() => {
42
49
  M();
43
- }), f(() => {
44
- j();
45
50
  });
46
- let F = w(), I = o(F, 1);
47
- return m(() => {
48
- let e = x(E);
49
- h(F, [e.b(), e.m(l.type)]);
50
- }), g(F, 0, 0), c(() => l.showIcon, () => {
51
- let e = S();
52
- return m(() => h(e, [x(E).e("icon")])), g(e, null, 0), c(() => l.type === "warning", () => s(x(i)), () => c(() => l.type === "primary", () => s(x(r)), () => c(() => l.type === "info", () => s(x(r)), () => c(() => l.type === "success", () => s(x(t)), () => c(() => l.type === "danger", () => s(x(n))), 1029), 773), 517), 261), e;
53
- }), m(() => h(I, [x(E).e("main")])), g(I, null, 0), c(() => l.title, () => {
54
- let e = C(), t = b(e);
55
- return m(() => {
56
- h(e, [x(E).e("title")]), _(t, y(l.title));
51
+ let I = T(), L = s(I, 1);
52
+ return h(() => {
53
+ let e = S(D);
54
+ g(I, [e.b(), e.m(u.type)]);
55
+ }), _(I, 0, 0), l(() => u.showIcon, () => {
56
+ let e = C();
57
+ return h(() => g(e, [S(D).e("icon")])), _(e, null, 0), l(() => u.type === "warning", () => c(S(i)), () => l(() => u.type === "primary", () => c(S(r)), () => l(() => u.type === "info", () => c(S(r)), () => l(() => u.type === "success", () => c(S(t)), () => l(() => u.type === "danger", () => c(S(n))), 1029), 773), 517), 261), e;
58
+ }), h(() => g(L, [S(D).e("main")])), _(L, null, 0), l(() => u.title, () => {
59
+ let e = w(), t = x(e);
60
+ return h(() => {
61
+ g(e, [S(D).e("title")]), v(t, b(u.title));
57
62
  }), e;
58
- }), g(I, null, 1), c(() => l.content, () => {
59
- let e = C(), t = b(e);
60
- return m(() => {
61
- h(e, [x(E).e("content")]), _(t, y(l.content));
63
+ }), _(L, null, 1), l(() => u.content, () => {
64
+ let e = w(), t = x(e);
65
+ return h(() => {
66
+ g(e, [S(D).e("content")]), v(t, b(u.content));
62
67
  }), e;
63
- }), g(F, null, 2), c(() => l.showClose, () => s(x(a), {
68
+ }), _(L, null, 2), l(() => u.confirm || u.cancel, () => {
69
+ let e = C();
70
+ return h(() => g(e, [S(D).e("footer")])), _(e, null, 0), c(S(o), null, () => [l(() => u.cancel, () => c(S(a), { $: [() => ({
71
+ type: "danger",
72
+ size: "mini",
73
+ link: !0,
74
+ label: "取消",
75
+ ...u.cancelProps
76
+ }), { onClick: () => u.cancel }] }), null, 129), l(() => u.confirm, () => c(S(a), { $: [() => ({
77
+ type: "primary",
78
+ size: "mini",
79
+ link: !0,
80
+ label: "确认",
81
+ ...u.confirmProps
82
+ }), { onClick: () => u.confirm }] }), null, 129)]), e;
83
+ }), _(I, null, 2), l(() => u.showClose, () => c(S(a), {
64
84
  size: "mini",
65
85
  text: "",
66
86
  icon: "CloseLine",
67
- onClick: () => A
68
- })), u(F, "mouseenter", N), u(F, "mouseleave", P), F;
87
+ onClick: () => j
88
+ })), d(I, "mouseenter", P), d(I, "mouseleave", F), I;
69
89
  }
70
90
  });
71
91
  //#endregion
72
- export { T as default };
92
+ export { E as default };
@@ -1,3 +1,4 @@
1
+ import { ButtonProps } from '../button';
1
2
  export interface NotificationProps {
2
3
  /** 类型
3
4
  * @default info
@@ -28,6 +29,14 @@ export interface NotificationProps {
28
29
  showIcon?: boolean;
29
30
  /** 唯一标识 */
30
31
  id?: string;
32
+ /** 确认按钮属性 */
33
+ confirmProps?: ButtonProps;
34
+ /** 取消按钮属性 */
35
+ cancelProps?: ButtonProps;
36
+ /** 确认回调 */
37
+ confirm?: () => void;
38
+ /** 取消回调 */
39
+ cancel?: () => void;
31
40
  }
32
41
  export interface NotificationExpose {
33
42
  /** 实例 ID */
@@ -47,15 +47,15 @@ import { SList as ue } from "../components/src/list/index.mjs";
47
47
  import { SMenu as de, SMenuGroup as fe, SMenuItem as pe, SSubMenu as me } from "../components/src/menu/index.mjs";
48
48
  import { SMeterGroup as he } from "../components/src/meter-group/index.mjs";
49
49
  import { SModal as ge } from "../components/src/modal/index.mjs";
50
- import { STag as _e } from "../components/src/tag/index.mjs";
51
- import { SOverflowList as ve } from "../components/src/overflow-list/index.mjs";
52
- import { SSelect as ye } from "../components/src/select/index.mjs";
53
- import { SPagination as be } from "../components/src/pagination/index.mjs";
54
- import { SPanel as xe } from "../components/src/panel/index.mjs";
55
- import { SProgress as Se } from "../components/src/progress/index.mjs";
56
- import { SSkeleton as Ce } from "../components/src/skeleton/index.mjs";
57
- import { SSliderVerify as we } from "../components/src/slider-verify/index.mjs";
58
- import { SSpace as Te } from "../components/src/space/index.mjs";
50
+ import { SSpace as _e } from "../components/src/space/index.mjs";
51
+ import { STag as ve } from "../components/src/tag/index.mjs";
52
+ import { SOverflowList as ye } from "../components/src/overflow-list/index.mjs";
53
+ import { SSelect as be } from "../components/src/select/index.mjs";
54
+ import { SPagination as xe } from "../components/src/pagination/index.mjs";
55
+ import { SPanel as Se } from "../components/src/panel/index.mjs";
56
+ import { SProgress as Ce } from "../components/src/progress/index.mjs";
57
+ import { SSkeleton as we } from "../components/src/skeleton/index.mjs";
58
+ import { SSliderVerify as Te } from "../components/src/slider-verify/index.mjs";
59
59
  import { SSplit as Ee, SSplitPane as De } from "../components/src/split/index.mjs";
60
60
  import { SStatistic as Oe } from "../components/src/statistic/index.mjs";
61
61
  import { SSteps as ke } from "../components/src/steps/index.mjs";
@@ -130,22 +130,22 @@ var Ue = [
130
130
  fe,
131
131
  pe,
132
132
  he,
133
- ve,
133
+ ye,
134
134
  ge,
135
- be,
136
135
  xe,
137
- i,
138
136
  Se,
137
+ i,
138
+ Ce,
139
139
  w,
140
140
  T,
141
141
  d,
142
142
  M,
143
- ye,
143
+ be,
144
144
  O,
145
145
  D,
146
- Ce,
147
146
  we,
148
147
  Te,
148
+ _e,
149
149
  Ee,
150
150
  De,
151
151
  Oe,
@@ -156,7 +156,7 @@ var Ue = [
156
156
  je,
157
157
  Y,
158
158
  X,
159
- _e,
159
+ ve,
160
160
  v,
161
161
  Me,
162
162
  Fe,
@@ -66,16 +66,16 @@ import { useMessage as Fe } from "../components/src/message/method.mjs";
66
66
  import { SMeterGroup as Ie } from "../components/src/meter-group/index.mjs";
67
67
  import { useModal as Le } from "../components/src/modal/method.mjs";
68
68
  import { SModal as Re } from "../components/src/modal/index.mjs";
69
- import { useNotification as ze } from "../components/src/notification/method.mjs";
70
- import { STag as Be } from "../components/src/tag/index.mjs";
71
- import { SOverflowList as Ve } from "../components/src/overflow-list/index.mjs";
72
- import { SSelect as He } from "../components/src/select/index.mjs";
73
- import { SPagination as Ue } from "../components/src/pagination/index.mjs";
74
- import { SPanel as We } from "../components/src/panel/index.mjs";
75
- import { SProgress as Ge } from "../components/src/progress/index.mjs";
76
- import { SSkeleton as Ke } from "../components/src/skeleton/index.mjs";
77
- import { SSliderVerify as qe } from "../components/src/slider-verify/index.mjs";
78
- import { SSpace as Je } from "../components/src/space/index.mjs";
69
+ import { SSpace as ze } from "../components/src/space/index.mjs";
70
+ import { useNotification as Be } from "../components/src/notification/method.mjs";
71
+ import { STag as Ve } from "../components/src/tag/index.mjs";
72
+ import { SOverflowList as He } from "../components/src/overflow-list/index.mjs";
73
+ import { SSelect as Ue } from "../components/src/select/index.mjs";
74
+ import { SPagination as We } from "../components/src/pagination/index.mjs";
75
+ import { SPanel as Ge } from "../components/src/panel/index.mjs";
76
+ import { SProgress as Ke } from "../components/src/progress/index.mjs";
77
+ import { SSkeleton as qe } from "../components/src/skeleton/index.mjs";
78
+ import { SSliderVerify as Je } from "../components/src/slider-verify/index.mjs";
79
79
  import { splitContextKey as Ye } from "../components/src/split/types.mjs";
80
80
  import { SSplit as Xe, SSplitPane as Ze } from "../components/src/split/index.mjs";
81
81
  import { SStatistic as Qe } from "../components/src/statistic/index.mjs";
@@ -101,4 +101,4 @@ import _t from "dayjs";
101
101
  //#region index.ts
102
102
  var vt = e(gt);
103
103
  //#endregion
104
- export { t as SAlert, r as SAnchor, i as SAnchorLink, y as SAutoComplete, x as SAvatar, S as SAvatarGroup, _ as SBackTop, C as SBadge, w as SButton, T as SButtonGroup, D as SCard, O as SCarousel, I as SCascader, L as SChatList, R as SChatSender, j as SCheckbox, M as SCheckboxGroup, V as SCollapse, H as SCollapseItem, W as SColorPicker, l as SConfigProvider, G as SDatePicker, K as SDatetimePicker, J as SDescriptions, Y as SDescriptionsItem, X as SDivider, $ as SDoption, Z as SDrawer, ee as SDropdown, te as SDsubmenu, k as SEmpty, ne as SExpandCard, f as SForm, p as SFormItem, re as SGalleria, ae as SGrid, oe as SGridItem, se as SHighlight, h as SIcon, fe as SIconSelect, me as SImage, he as SImageGroup, ge as SImagePreview, m as SInput, _e as SInputGroup, ve as SInputNumber, ye as SInputTag, xe as SLayout, Se as SLayoutAside, Ce as SLayoutContent, we as SLayoutFooter, Te as SLayoutHeader, Ee as SLink, De as SList, je as SMenu, Me as SMenuGroup, Ne as SMenuItem, Ie as SMeterGroup, Re as SModal, Ve as SOverflowList, Ue as SPagination, We as SPanel, u as SPopover, Ge as SProgress, P as SRadio, F as SRadioGroup, v as SScrollbar, U as SSegmented, He as SSelect, Ke as SSkeleton, qe as SSliderVerify, Je as SSpace, Xe as SSplit, Ze as SSplitPane, Qe as SStatistic, $e as SSteps, Pe as SSubMenu, et as SSwitch, le as STab, ue as STabPane, nt as STable, de as STabs, Be as STag, E as SText, rt as STextarea, ct as STimeline, lt as STimelineItem, d as STooltip, ot as STransfer, z as STransition, at as STree, ut as STreeSelect, dt as SUpload, ft as SVirtualList, pt as SWaterfall, mt as SWatermark, ht as SWheel, n as anchorContextKey, b as avatarGroupContextKey, g as buttonGroupContextKey, A as checkboxGroupContextKey, B as collapseContextKey, c as configProviderContextKey, _t as dayjs, vt as default, q as descriptionsContextKey, Q as dropdownContextKey, a as formContextKey, o as formItemContextKey, s as formItemStatusContextKey, ie as gridContextKey, pe as imageGroupContextKey, Oe as menuContextKey, ke as menuLevelContextKey, N as radioGroupContextKey, Ye as splitContextKey, Ae as subMenuContextKey, tt as tableContextKey, ce as tabsContextKey, st as timelineContextKey, it as treeContextKey, be as useLayer, Fe as useMessage, Le as useModal, ze as useNotification };
104
+ export { t as SAlert, r as SAnchor, i as SAnchorLink, y as SAutoComplete, x as SAvatar, S as SAvatarGroup, _ as SBackTop, C as SBadge, w as SButton, T as SButtonGroup, D as SCard, O as SCarousel, I as SCascader, L as SChatList, R as SChatSender, j as SCheckbox, M as SCheckboxGroup, V as SCollapse, H as SCollapseItem, W as SColorPicker, l as SConfigProvider, G as SDatePicker, K as SDatetimePicker, J as SDescriptions, Y as SDescriptionsItem, X as SDivider, $ as SDoption, Z as SDrawer, ee as SDropdown, te as SDsubmenu, k as SEmpty, ne as SExpandCard, f as SForm, p as SFormItem, re as SGalleria, ae as SGrid, oe as SGridItem, se as SHighlight, h as SIcon, fe as SIconSelect, me as SImage, he as SImageGroup, ge as SImagePreview, m as SInput, _e as SInputGroup, ve as SInputNumber, ye as SInputTag, xe as SLayout, Se as SLayoutAside, Ce as SLayoutContent, we as SLayoutFooter, Te as SLayoutHeader, Ee as SLink, De as SList, je as SMenu, Me as SMenuGroup, Ne as SMenuItem, Ie as SMeterGroup, Re as SModal, He as SOverflowList, We as SPagination, Ge as SPanel, u as SPopover, Ke as SProgress, P as SRadio, F as SRadioGroup, v as SScrollbar, U as SSegmented, Ue as SSelect, qe as SSkeleton, Je as SSliderVerify, ze as SSpace, Xe as SSplit, Ze as SSplitPane, Qe as SStatistic, $e as SSteps, Pe as SSubMenu, et as SSwitch, le as STab, ue as STabPane, nt as STable, de as STabs, Ve as STag, E as SText, rt as STextarea, ct as STimeline, lt as STimelineItem, d as STooltip, ot as STransfer, z as STransition, at as STree, ut as STreeSelect, dt as SUpload, ft as SVirtualList, pt as SWaterfall, mt as SWatermark, ht as SWheel, n as anchorContextKey, b as avatarGroupContextKey, g as buttonGroupContextKey, A as checkboxGroupContextKey, B as collapseContextKey, c as configProviderContextKey, _t as dayjs, vt as default, q as descriptionsContextKey, Q as dropdownContextKey, a as formContextKey, o as formItemContextKey, s as formItemStatusContextKey, ie as gridContextKey, pe as imageGroupContextKey, Oe as menuContextKey, ke as menuLevelContextKey, N as radioGroupContextKey, Ye as splitContextKey, Ae as subMenuContextKey, tt as tableContextKey, ce as tabsContextKey, st as timelineContextKey, it as treeContextKey, be as useLayer, Fe as useMessage, Le as useModal, Be as useNotification };
@@ -21,7 +21,7 @@
21
21
  }
22
22
  @include when(range) {
23
23
  &:focus-within {
24
- @include be(datetime-picker, input) {
24
+ @include be(datetime-picker, inner) {
25
25
  &:focus {
26
26
  background-color: getCssVar("color", "fill-2");
27
27
  }
@@ -109,13 +109,13 @@
109
109
  padding: 4px 8px 4px 4px;
110
110
  }
111
111
  }
112
- @include be(datetime-picker, input) {
112
+ @include be(datetime-picker, inner) {
113
113
  font-size: getCssVar("font-size", $size);
114
114
  }
115
115
  }
116
116
  }
117
117
 
118
- @include e(input) {
118
+ @include e(inner) {
119
119
  height: 100%;
120
120
  width: 100%;
121
121
  padding: 0 8px 0 8px;
@@ -78,6 +78,12 @@
78
78
  justify-content: flex-start;
79
79
  }
80
80
 
81
+ @include e(extra) {
82
+ margin-top: 4px;
83
+ color: getCssVar("color", "text-3");
84
+ font-size: getCssVar("font-size", "mini");
85
+ }
86
+
81
87
  @include e(error-msg) {
82
88
  height: 20px;
83
89
  font-size: getCssVar("font-size", "small");
@@ -53,14 +53,14 @@
53
53
  border-color: getCssVar("color", "danger-6");
54
54
  }
55
55
  @include when(filled) {
56
- background-color: getCssVar("color", "error-1");
57
- border-color: getCssVar("color", "error-1");
56
+ background-color: getCssVar("color", "danger-1");
57
+ border-color: getCssVar("color", "danger-1");
58
58
  &:hover {
59
- background-color: getCssVar("color", "error-2");
59
+ background-color: getCssVar("color", "danger-2");
60
60
  }
61
61
  &:focus-within {
62
62
  background-color: getCssVar("color", "bg-2");
63
- border-color: getCssVar("color", "error-5");
63
+ border-color: getCssVar("color", "danger-5");
64
64
  }
65
65
  }
66
66
  }
@@ -35,20 +35,30 @@
35
35
  }
36
36
 
37
37
  @include e(title) {
38
- font-size: getCssVar("font-size", "large");
38
+ color: getCssVar("color", "text-1");
39
+ font-size: getCssVar("font-size", "medium");
40
+ line-height: getCssVar("line-height", "medium");
39
41
  font-weight: 600;
40
- height: 24px;
41
42
  display: flex;
42
43
  align-items: center;
43
- color: getCssVar("color", "text-1");
44
44
  }
45
45
 
46
46
  @include e(content) {
47
+ color: getCssVar("color", "text-1");
47
48
  font-size: getCssVar("font-size", "medium");
49
+ line-height: getCssVar("line-height", "medium");
48
50
  display: flex;
49
51
  align-items: center;
50
- min-height: 24px;
52
+ }
53
+
54
+ @include e(footer) {
51
55
  color: getCssVar("color", "text-1");
56
+ font-size: getCssVar("font-size", "medium");
57
+ line-height: getCssVar("line-height", "medium");
58
+ display: flex;
59
+ align-items: center;
60
+ justify-content: flex-end;
61
+ margin-top: 4px;
52
62
  }
53
63
 
54
64
  @include e(wrapper) {
@@ -29,10 +29,10 @@
29
29
  }
30
30
  @include when(disabled) {
31
31
  cursor: not-allowed;
32
- @include be(input, inner) {
32
+ @include be(textarea, inner) {
33
33
  color: getCssVar("color", "text-3");
34
34
  }
35
- @include this-be(input, wrapper) {
35
+ @include this-be(textarea, wrapper) {
36
36
  background-color: getCssVar("color", "bg-2");
37
37
  border: 1px solid getCssVar("color", "fill-3");
38
38
  &:hover {
@@ -58,14 +58,14 @@
58
58
  border-color: getCssVar("color", "danger-6");
59
59
  }
60
60
  @include when(filled) {
61
- background-color: getCssVar("color", "error-1");
62
- border-color: getCssVar("color", "error-1");
61
+ background-color: getCssVar("color", "danger-1");
62
+ border-color: getCssVar("color", "danger-1");
63
63
  &:hover {
64
- background-color: getCssVar("color", "error-2");
64
+ background-color: getCssVar("color", "danger-2");
65
65
  }
66
66
  &:focus-within {
67
67
  background-color: getCssVar("color", "bg-2");
68
- border-color: getCssVar("color", "error-5");
68
+ border-color: getCssVar("color", "danger-5");
69
69
  }
70
70
  }
71
71
  }
@@ -78,7 +78,7 @@
78
78
  }
79
79
  &:focus-within {
80
80
  background-color: getCssVar("color", "bg-2");
81
- border-color: getCssVar("color", "primary-6");
81
+ border-color: getCssVar("color", "primary-5");
82
82
  }
83
83
  }
84
84
  }
@@ -878,6 +878,10 @@
878
878
  "s-form-item/requiredAlign": {
879
879
  "description": "必填标识对齐方式"
880
880
  },
881
+ "s-form-item/extra": {
882
+ "description": "表单项额外内容",
883
+ "type": "string"
884
+ },
881
885
  "s-galleria/modelValue": {
882
886
  "description": "当前选中项索引(v-model)",
883
887
  "type": "number"
@@ -1778,6 +1782,18 @@
1778
1782
  "description": "唯一标识",
1779
1783
  "type": "string"
1780
1784
  },
1785
+ "s-notification/confirmProps": {
1786
+ "description": "确认按钮属性"
1787
+ },
1788
+ "s-notification/cancelProps": {
1789
+ "description": "取消按钮属性"
1790
+ },
1791
+ "s-notification/confirm": {
1792
+ "description": "确认回调"
1793
+ },
1794
+ "s-notification/cancel": {
1795
+ "description": "取消回调"
1796
+ },
1781
1797
  "s-overflow-list/max": {
1782
1798
  "description": "最大显示数量;不传时按容器宽度自动截断",
1783
1799
  "type": "number"
@@ -381,7 +381,8 @@
381
381
  "labelPosition",
382
382
  "labelAlign",
383
383
  "showRequired",
384
- "requiredAlign"
384
+ "requiredAlign",
385
+ "extra"
385
386
  ]
386
387
  },
387
388
  "s-galleria": {
@@ -738,7 +739,11 @@
738
739
  "placement",
739
740
  "hover",
740
741
  "showIcon",
741
- "id"
742
+ "id",
743
+ "confirmProps",
744
+ "cancelProps",
745
+ "confirm",
746
+ "cancel"
742
747
  ]
743
748
  },
744
749
  "s-overflow-list": {
@@ -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.28.0",
5
+ "version": "0.30.0",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
@@ -2340,10 +2340,31 @@
2340
2340
  "type": "left | right",
2341
2341
  "kind": "expression"
2342
2342
  }
2343
+ },
2344
+ {
2345
+ "name": "extra",
2346
+ "description": "表单项额外内容",
2347
+ "value": {
2348
+ "type": "string",
2349
+ "kind": "expression"
2350
+ }
2343
2351
  }
2344
2352
  ],
2345
2353
  "events": [],
2346
- "slots": []
2354
+ "slots": [
2355
+ {
2356
+ "name": "default",
2357
+ "description": "内容"
2358
+ },
2359
+ {
2360
+ "name": "label",
2361
+ "description": "标签"
2362
+ },
2363
+ {
2364
+ "name": "extra",
2365
+ "description": "额外内容"
2366
+ }
2367
+ ]
2347
2368
  },
2348
2369
  {
2349
2370
  "name": "s-galleria",
@@ -4610,6 +4631,38 @@
4610
4631
  "type": "string",
4611
4632
  "kind": "expression"
4612
4633
  }
4634
+ },
4635
+ {
4636
+ "name": "confirmProps",
4637
+ "description": "确认按钮属性",
4638
+ "value": {
4639
+ "type": "ButtonProps",
4640
+ "kind": "expression"
4641
+ }
4642
+ },
4643
+ {
4644
+ "name": "cancelProps",
4645
+ "description": "取消按钮属性",
4646
+ "value": {
4647
+ "type": "ButtonProps",
4648
+ "kind": "expression"
4649
+ }
4650
+ },
4651
+ {
4652
+ "name": "confirm",
4653
+ "description": "确认回调",
4654
+ "value": {
4655
+ "type": "() => void",
4656
+ "kind": "expression"
4657
+ }
4658
+ },
4659
+ {
4660
+ "name": "cancel",
4661
+ "description": "取消回调",
4662
+ "value": {
4663
+ "type": "() => void",
4664
+ "kind": "expression"
4665
+ }
4613
4666
  }
4614
4667
  ],
4615
4668
  "events": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "savor-ui",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "A Vue3 Components Library",
5
5
  "keywords": [
6
6
  "component library",