savor-ui 0.26.1 → 0.28.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 (73) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/es/components/index.d.ts +1 -0
  3. package/dist/es/components/index.mjs +6 -5
  4. package/dist/es/components/src/color-picker/color-picker.d.ts +2 -1
  5. package/dist/es/components/src/color-picker/color-picker.vue.mjs +148 -139
  6. package/dist/es/components/src/color-picker/index.d.ts +4 -2
  7. package/dist/es/components/src/color-picker/types.d.ts +4 -0
  8. package/dist/es/components/src/drawer/drawer.d.ts +2 -2
  9. package/dist/es/components/src/drawer/index.d.ts +3 -3
  10. package/dist/es/components/src/pagination/pagination.vue.mjs +6 -6
  11. package/dist/es/components/src/select/select.vue.mjs +127 -125
  12. package/dist/es/components/src/tabs/index.d.ts +3 -3
  13. package/dist/es/components/src/tabs/tab-pane.vue.mjs +1 -1
  14. package/dist/es/components/src/tabs/tab.vue.mjs +1 -1
  15. package/dist/es/components/src/tabs/tabs.vue.mjs +4 -4
  16. package/dist/es/components/src/tabs/types.d.ts +4 -4
  17. package/dist/es/components/src/tag/index.d.ts +1 -1
  18. package/dist/es/components/src/tag/tag.vue.mjs +2 -2
  19. package/dist/es/components/src/tag/types.d.ts +1 -1
  20. package/dist/es/components/src/transfer/index.d.ts +33 -0
  21. package/dist/es/components/src/transfer/index.mjs +7 -0
  22. package/dist/es/components/src/transfer/transfer.d.ts +25 -0
  23. package/dist/es/components/src/transfer/transfer.vue.mjs +228 -0
  24. package/dist/es/components/src/transfer/types.d.ts +61 -0
  25. package/dist/es/components/src/tree/node.d.ts +4 -0
  26. package/dist/es/components/src/tree/node.vue.mjs +13 -14
  27. package/dist/es/components/src/tree/tree.vue.mjs +14 -7
  28. package/dist/es/components/src/tree/types.d.ts +4 -0
  29. package/dist/es/components/src/tree-select/tree-select.vue.mjs +1 -1
  30. package/dist/es/core/components.mjs +63 -61
  31. package/dist/es/core/global.d.ts +1 -0
  32. package/dist/es/core/index.mjs +54 -53
  33. package/dist/es/icons/plugin.d.ts +7 -7
  34. package/dist/es/icons/src/svg/arrow/index.mjs +1 -1
  35. package/dist/es/icons/src/svg/building/index.mjs +1 -1
  36. package/dist/es/icons/src/svg/business/index.mjs +1 -1
  37. package/dist/es/icons/src/svg/contact/index.mjs +1 -1
  38. package/dist/es/icons/src/svg/design/index.mjs +1 -1
  39. package/dist/es/icons/src/svg/development/index.mjs +1 -1
  40. package/dist/es/icons/src/svg/device/index.mjs +1 -1
  41. package/dist/es/icons/src/svg/editor/index.mjs +1 -1
  42. package/dist/es/icons/src/svg/education/index.mjs +1 -1
  43. package/dist/es/icons/src/svg/file/index.mjs +1 -1
  44. package/dist/es/icons/src/svg/logo/index.mjs +1 -1
  45. package/dist/es/icons/src/svg/media/index.mjs +1 -1
  46. package/dist/es/icons/src/svg/system/index.mjs +1 -1
  47. package/dist/es/icons/src/svg/user/index.mjs +1 -1
  48. package/dist/es/icons/src/svg/weather/index.mjs +1 -1
  49. package/dist/es/theme/components/checkbox.scss +3 -0
  50. package/dist/es/theme/components/color-picker.scss +13 -0
  51. package/dist/es/theme/components/index.scss +1 -0
  52. package/dist/es/theme/components/transfer.scss +205 -0
  53. package/dist/es/theme/components/tree.scss +2 -2
  54. package/dist/json/vetur-attributes.json +50 -4
  55. package/dist/json/vetur-tags.json +21 -4
  56. package/dist/json/web-types.json +126 -5
  57. package/package.json +1 -1
  58. package/dist/es/icons/src/svg/arrow/index.d.ts +0 -1124
  59. package/dist/es/icons/src/svg/building/index.d.ts +0 -1005
  60. package/dist/es/icons/src/svg/business/index.d.ts +0 -2212
  61. package/dist/es/icons/src/svg/contact/index.d.ts +0 -580
  62. package/dist/es/icons/src/svg/design/index.d.ts +0 -2076
  63. package/dist/es/icons/src/svg/development/index.d.ts +0 -546
  64. package/dist/es/icons/src/svg/device/index.d.ts +0 -2008
  65. package/dist/es/icons/src/svg/editor/index.d.ts +0 -1532
  66. package/dist/es/icons/src/svg/education/index.d.ts +0 -631
  67. package/dist/es/icons/src/svg/file/index.d.ts +0 -1957
  68. package/dist/es/icons/src/svg/index.d.ts +0 -15
  69. package/dist/es/icons/src/svg/logo/index.d.ts +0 -546
  70. package/dist/es/icons/src/svg/media/index.d.ts +0 -1515
  71. package/dist/es/icons/src/svg/system/index.d.ts +0 -2654
  72. package/dist/es/icons/src/svg/user/index.d.ts +0 -631
  73. package/dist/es/icons/src/svg/weather/index.d.ts +0 -1022
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
 
4
4
 
5
+ # [0.28.0](https://gitee.com/mach552/savor-ui/compare/v0.27.0...v0.28.0) (2026-08-29)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **select:** 修复标签背景和输入框背景同色问题 ([1d79224](https://gitee.com/mach552/savor-ui/commits/1d792247ec47bf0d403791212889bd478bbb68b4))
11
+
12
+
13
+ ### Features
14
+
15
+ * **transfer:** 新增穿梭框组件 ([b0f1371](https://gitee.com/mach552/savor-ui/commits/b0f137168c1ccb0b89c3265cee79020d027d6786))
16
+ * **tree:** 新增节点默认插槽 ([565dd84](https://gitee.com/mach552/savor-ui/commits/565dd847d2e0b0ad8fb17477058f1f50ccfda85f))
17
+
18
+ # [0.27.0](https://gitee.com/mach552/savor-ui/compare/v0.26.1...v0.27.0) (2026-08-29)
19
+
20
+
21
+ ### Features
22
+
23
+ * **color-picker:** 新增清空属性 ([1e302a5](https://gitee.com/mach552/savor-ui/commits/1e302a52c2caad68e2f9299d037cd2ebe4cea092))
24
+
5
25
  ## [0.26.1](https://gitee.com/mach552/savor-ui/compare/v0.26.0...v0.26.1) (2026-08-28)
6
26
 
7
27
 
@@ -63,6 +63,7 @@ export * from './src/tabs';
63
63
  export * from './src/tag';
64
64
  export * from './src/text';
65
65
  export * from './src/textarea';
66
+ export * from './src/transfer';
66
67
  export * from './src/timeline';
67
68
  export * from './src/tooltip';
68
69
  export * from './src/transition';
@@ -31,8 +31,7 @@ import "./src/chat-sender/index.mjs";
31
31
  import "./src/transition/index.mjs";
32
32
  import "./src/collapse/types.mjs";
33
33
  import "./src/collapse/index.mjs";
34
- import "./src/tag/index.mjs";
35
- import "./src/select/index.mjs";
34
+ import "./src/segmented/index.mjs";
36
35
  import "./src/color-picker/index.mjs";
37
36
  import "./src/date-picker/index.mjs";
38
37
  import "./src/datetime-picker/index.mjs";
@@ -69,11 +68,12 @@ import "./src/modal/method.mjs";
69
68
  import "./src/modal/index.mjs";
70
69
  import "./src/notification/method.mjs";
71
70
  import "./src/notification/index.mjs";
71
+ import "./src/tag/index.mjs";
72
72
  import "./src/overflow-list/index.mjs";
73
+ import "./src/select/index.mjs";
73
74
  import "./src/pagination/index.mjs";
74
75
  import "./src/panel/index.mjs";
75
76
  import "./src/progress/index.mjs";
76
- import "./src/segmented/index.mjs";
77
77
  import "./src/skeleton/index.mjs";
78
78
  import "./src/slider-verify/index.mjs";
79
79
  import "./src/space/index.mjs";
@@ -85,10 +85,11 @@ import "./src/switch/index.mjs";
85
85
  import "./src/table/types.mjs";
86
86
  import "./src/table/index.mjs";
87
87
  import "./src/textarea/index.mjs";
88
- import "./src/timeline/types.mjs";
89
- import "./src/timeline/index.mjs";
90
88
  import "./src/tree/types.mjs";
91
89
  import "./src/tree/index.mjs";
90
+ import "./src/transfer/index.mjs";
91
+ import "./src/timeline/types.mjs";
92
+ import "./src/timeline/index.mjs";
92
93
  import "./src/tree-select/index.mjs";
93
94
  import "./src/upload/index.mjs";
94
95
  import "./src/virtual-list/index.mjs";
@@ -4,6 +4,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
4
4
  props: PublicProps & __VLS_PrettifyLocal<(ColorPickerProps & {
5
5
  modelValue?: string;
6
6
  }) & {
7
+ onClear?: (() => any) | undefined;
7
8
  onChange?: ((value: string) => any) | undefined;
8
9
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
9
10
  }> & (typeof globalThis extends {
@@ -12,7 +13,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
12
13
  expose: (exposed: {}) => void;
13
14
  attrs: any;
14
15
  slots: {};
15
- emit: ((evt: "change", value: string) => void) & ((event: "update:modelValue", value: string) => void);
16
+ emit: (((evt: "clear") => void) & ((evt: "change", value: string) => void)) & ((event: "update:modelValue", value: string) => void);
16
17
  }>) => VNode & {
17
18
  __ctx?: Awaited<typeof __VLS_setup>;
18
19
  };
@@ -1,17 +1,18 @@
1
1
  import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
2
2
  import "../../../hooks/index.mjs";
3
- import { useFormItem as t } from "../form/use-form-item.mjs";
4
- import { SPopover as n } from "../popover/index.mjs";
5
- import { SInput as r } from "../input/index.mjs";
6
- import { SSelect as i } from "../select/index.mjs";
7
- import { child as a, computed as o, createComponent as s, createFor as c, createIf as l, createInvoker as u, createTemplateRefSetter as d, defineVaporComponent as f, delegateEvents as p, mergeModels as m, next as h, onMounted as g, onUnmounted 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, toRefs as E, txt as ee, unref as D, useModel as te, useTemplateRef as ne, watch as O, withVaporModifiers as re } from "vue";
3
+ import { CloseLine as t } from "../../../icons/src/svg/system/index.mjs";
4
+ import { useFormItem as n } from "../form/use-form-item.mjs";
5
+ import { SPopover as r } from "../popover/index.mjs";
6
+ import { SInput as i } from "../input/index.mjs";
7
+ import { SSegmented as a } from "../segmented/index.mjs";
8
+ import { child as o, computed as s, createComponent as c, createFor as l, createIf as u, createInvoker as d, createTemplateRefSetter as f, defineVaporComponent as p, delegateEvents as m, mergeModels as h, next as g, onMounted as _, onUnmounted as v, ref as y, renderEffect as b, setClass as x, setInsertionState as S, setStyle as C, setText as w, template as T, toDisplayString as E, toRefs as D, txt as ee, unref as O, useModel as te, useTemplateRef as ne, watch as k } from "vue";
8
9
  //#region ../components/src/color-picker/color-picker.vue?vue&type=script&setup=true&vapor=true&lang.ts
9
- var ie = w("<div> "), ae = w("<div><div></div></div>"), k = w("<div><div><div></div></div><div></div>"), oe = w("<div>"), se = w("<div><div>预设颜色</div><div>"), ce = w("<div><div><div><div></div><div></div></div><div><div><div><div><div></div></div><div></div></div></div><div><div></div></div></div><div></div>"), le = w("<div>", 1);
10
- p("mousedown", "click");
11
- var A = /*@__PURE__*/ f({
10
+ var re = T("<div> "), ie = T("<div><div></div></div>"), ae = T("<div><div><div></div></div><div></div>"), oe = T("<span title=清空>"), se = T("<div>"), ce = T("<div><div>预设颜色</div><div>"), le = T("<div><div><div><div></div><div></div></div><div><div><div><div><div></div></div><div></div></div></div><div><div></div></div></div><div></div>"), ue = T("<div>", 1);
11
+ m("mousedown", "click");
12
+ var A = /*@__PURE__*/ p({
12
13
  name: "SColorPicker",
13
14
  __name: "color-picker",
14
- props: /*@__PURE__*/ m({
15
+ props: /*@__PURE__*/ h({
15
16
  modelValue: {},
16
17
  format: { default: "hex" },
17
18
  popoverProps: {},
@@ -21,28 +22,33 @@ var A = /*@__PURE__*/ f({
21
22
  showPreset: { type: Boolean },
22
23
  presetColors: {},
23
24
  disabledAlpha: { type: Boolean },
25
+ clearable: { type: Boolean },
24
26
  error: { type: Boolean }
25
27
  }, {
26
- modelValue: { default: "#3867D6" },
28
+ modelValue: { default: "" },
27
29
  modelModifiers: {}
28
30
  }),
29
- emits: /*@__PURE__*/ m(["change"], ["update:modelValue"]),
30
- setup(f, { emit: p }) {
31
- let m = f, w = p, A = e("color-picker"), j = te(f, "modelValue"), { size: ue, error: de } = E(m), { mergedSize: fe, mergedError: M } = t({
32
- size: ue,
33
- error: de
34
- }), N = ne("popoverRef"), P = v(!1), F = (e) => {
35
- e ? N.value?.show() : N.value?.hide(), P.value = e;
36
- }, pe = () => {
37
- m.disabled || (P.value ? F(!1) : F(!0));
38
- }, me = () => {
39
- F(!1);
40
- }, I = v(m.format), L = v({
31
+ emits: /*@__PURE__*/ h(["change", "clear"], ["update:modelValue"]),
32
+ setup(p, { emit: m }) {
33
+ let h = p, T = m, A = e("color-picker"), j = te(p, "modelValue"), { size: de, error: fe } = D(h), { mergedSize: pe, mergedError: me } = n({
34
+ size: de,
35
+ error: fe
36
+ }), M = ne("popoverRef"), N = y(!1), P = (e) => {
37
+ e ? M.value?.show() : M.value?.hide(), N.value = e;
38
+ }, he = () => {
39
+ h.disabled || (N.value ? P(!1) : (Ce(), P(!0)));
40
+ }, ge = () => {
41
+ P(!1);
42
+ }, _e = () => {
43
+ j.value = "", q.value = "", T("clear");
44
+ }, ve = (e) => {
45
+ e.target.closest("input, .s-select") || e.preventDefault();
46
+ }, F = y(h.format), I = y({
41
47
  h: 220,
42
48
  s: .77,
43
49
  v: .84,
44
50
  a: 1
45
- }), R = v(), z = v(), B = v(), V = v(!1), H = v(null), he = o(() => m.presetColors && m.presetColors.length > 0 ? m.presetColors : [
51
+ }), L = y(), R = y(), z = y(), B = y(!1), V = y(null), ye = s(() => h.presetColors && h.presetColors.length > 0 ? h.presetColors : [
46
52
  "#3867D6",
47
53
  "#20BF6B",
48
54
  "#FA8231",
@@ -53,7 +59,7 @@ var A = /*@__PURE__*/ f({
53
59
  "#F5319D",
54
60
  "#D91AD9",
55
61
  "#722ED1"
56
- ]), ge = (e, t, n) => {
62
+ ]), be = (e, t, n) => {
57
63
  let r = 0, i = 0, a = 0, o = Math.floor(e / 60), s = e / 60 - o, c = n * (1 - t), l = n * (1 - s * t), u = n * (1 - (1 - s) * t);
58
64
  switch (o % 6) {
59
65
  case 0:
@@ -80,11 +86,11 @@ var A = /*@__PURE__*/ f({
80
86
  g: Math.round(i * 255),
81
87
  b: Math.round(a * 255)
82
88
  };
83
- }, U = (e, t, n) => `#${[
89
+ }, xe = (e, t, n) => `#${[
84
90
  e,
85
91
  t,
86
92
  n
87
- ].map((e) => e.toString(16).padStart(2, "0")).join("").toUpperCase()}`, _e = (e) => (e = e.replace("#", ""), e.length === 3 && (e = e.split("").map((e) => e + e).join("")), e.length === 6 ? {
93
+ ].map((e) => e.toString(16).padStart(2, "0")).join("").toUpperCase()}`, Se = (e) => (e = e.replace("#", ""), e.length === 3 && (e = e.split("").map((e) => e + e).join("")), e.length === 6 ? {
88
94
  r: parseInt(e.slice(0, 2), 16) || 0,
89
95
  g: parseInt(e.slice(2, 4), 16) || 0,
90
96
  b: parseInt(e.slice(4, 6), 16) || 0
@@ -92,7 +98,7 @@ var A = /*@__PURE__*/ f({
92
98
  r: 0,
93
99
  g: 0,
94
100
  b: 0
95
- }), W = (e, t, n) => {
101
+ }), H = (e, t, n) => {
96
102
  e /= 255, t /= 255, n /= 255;
97
103
  let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o = r === 0 ? 0 : (r - i) / r, s = r;
98
104
  if (r !== i) {
@@ -114,129 +120,127 @@ var A = /*@__PURE__*/ f({
114
120
  s: o,
115
121
  v: s
116
122
  };
117
- }, G = o(() => ge(L.value.h, L.value.s, L.value.v)), K = o(() => {
118
- let { r: e, g: t, b: n } = G.value;
119
- return `rgba(${e},${t},${n},${L.value.a})`;
120
- }), ve = o(() => {
121
- let { r: e, g: t, b: n } = G.value;
122
- return I.value === "hex" ? U(e, t, n) : L.value.a === 1 ? `rgb(${e},${t},${n})` : `rgba(${e},${t},${n},${Math.round(L.value.a * 10) / 10})`;
123
- }), q = (e) => {
123
+ }, U = s(() => be(I.value.h, I.value.s, I.value.v)), W = s(() => {
124
+ let { r: e, g: t, b: n } = U.value;
125
+ return `rgba(${e},${t},${n},${I.value.a})`;
126
+ }), G = s(() => {
127
+ let { r: e, g: t, b: n } = U.value;
128
+ return F.value === "hex" ? xe(e, t, n) : I.value.a === 1 ? `rgb(${e},${t},${n})` : `rgba(${e},${t},${n},${Math.round(I.value.a * 10) / 10})`;
129
+ }), K = (e) => {
124
130
  try {
125
131
  if (e.startsWith("#")) {
126
- let t = _e(e), n = {
127
- ...W(t.r, t.g, t.b),
128
- a: L.value.a
132
+ let t = Se(e), n = {
133
+ ...H(t.r, t.g, t.b),
134
+ a: I.value.a
129
135
  };
130
- if (L.value.h === n.h && L.value.s === n.s && L.value.v === n.v && L.value.a === n.a) return;
131
- L.value = n;
136
+ if (I.value.h === n.h && I.value.s === n.s && I.value.v === n.v && I.value.a === n.a) return;
137
+ I.value = n;
132
138
  } else if (e.startsWith("rgb")) {
133
139
  let t = e.match(/[\d.]+/g)?.map(Number) || [
134
140
  0,
135
141
  0,
136
142
  0
137
- ], n = t.length >= 4 ? t[3] : L.value.a, r = {
138
- ...W(t[0], t[1], t[2]),
143
+ ], n = t.length >= 4 ? t[3] : I.value.a, r = {
144
+ ...H(t[0], t[1], t[2]),
139
145
  a: Math.max(0, Math.min(1, n))
140
146
  };
141
- if (L.value.h === r.h && L.value.s === r.s && L.value.v === r.v && L.value.a === r.a) return;
142
- L.value = r;
147
+ if (I.value.h === r.h && I.value.s === r.s && I.value.v === r.v && I.value.a === r.a) return;
148
+ I.value = r;
143
149
  }
144
- } catch {
145
- L.value = {
146
- h: 220,
147
- s: .77,
148
- v: .84,
149
- a: 1
150
- };
151
- }
152
- }, J = (e, t, n) => Math.max(t, Math.min(n, e)), Y = (e) => {
150
+ } catch {}
151
+ }, q = y(""), J = () => {
152
+ let e = q.value.trim();
153
+ e && K(e);
154
+ }, Ce = () => {
155
+ q.value = G.value;
156
+ }, Y = (e, t, n) => Math.max(t, Math.min(n, e)), X = (e) => {
157
+ if (!L.value) return;
158
+ let t = L.value.getBoundingClientRect(), n = Y(e.clientX - t.left, 0, t.width), r = Y(e.clientY - t.top, 0, t.height);
159
+ I.value.s = n / t.width, I.value.v = 1 - r / t.height;
160
+ }, we = (e) => {
161
+ e.preventDefault(), B.value = !0, V.value = "panel", X(e);
162
+ }, Te = (e) => {
163
+ X(e);
164
+ }, Ee = (e) => {
165
+ e.preventDefault(), B.value = !0, V.value = "hue";
166
+ }, De = (e) => {
153
167
  if (!R.value) return;
154
- let t = R.value.getBoundingClientRect(), n = J(e.clientX - t.left, 0, t.width), r = J(e.clientY - t.top, 0, t.height);
155
- L.value.s = n / t.width, L.value.v = 1 - r / t.height;
156
- }, ye = (e) => {
157
- e.preventDefault(), V.value = !0, H.value = "panel", Y(e);
158
- }, be = (e) => {
159
- Y(e);
160
- }, xe = (e) => {
161
- e.preventDefault(), V.value = !0, H.value = "hue";
162
- }, Se = (e) => {
168
+ let t = R.value.getBoundingClientRect(), n = Y(e.clientX - t.left, 0, t.width);
169
+ I.value.h = Y(n / t.width * 360, 0, 360);
170
+ }, Oe = (e) => {
171
+ e.preventDefault(), B.value = !0, V.value = "alpha";
172
+ }, ke = (e) => {
163
173
  if (!z.value) return;
164
- let t = z.value.getBoundingClientRect(), n = J(e.clientX - t.left, 0, t.width);
165
- L.value.h = J(n / t.width * 360, 0, 360);
166
- }, Ce = (e) => {
167
- e.preventDefault(), V.value = !0, H.value = "alpha";
168
- }, we = (e) => {
169
- if (!B.value) return;
170
- let t = B.value.getBoundingClientRect(), n = J(e.clientX - t.left, 0, t.width);
171
- L.value.a = J(n / t.width, 0, 1);
172
- }, X = (e) => {
173
- if (!(!V.value || !H.value)) {
174
- if (H.value === "panel" && Y(e), H.value === "hue" && z.value) {
175
- let t = z.value.getBoundingClientRect(), n = J(e.clientX - t.left, 0, t.width);
176
- L.value.h = J(n / t.width * 360, 0, 360);
174
+ let t = z.value.getBoundingClientRect(), n = Y(e.clientX - t.left, 0, t.width);
175
+ I.value.a = Y(n / t.width, 0, 1);
176
+ }, Ae = (e) => {
177
+ if (!(!B.value || !V.value)) {
178
+ if (V.value === "panel" && X(e), V.value === "hue" && R.value) {
179
+ let t = R.value.getBoundingClientRect(), n = Y(e.clientX - t.left, 0, t.width);
180
+ I.value.h = Y(n / t.width * 360, 0, 360);
177
181
  }
178
- if (H.value === "alpha" && B.value) {
179
- let t = B.value.getBoundingClientRect(), n = J(e.clientX - t.left, 0, t.width);
180
- L.value.a = J(n / t.width, 0, 1);
182
+ if (V.value === "alpha" && z.value) {
183
+ let t = z.value.getBoundingClientRect(), n = Y(e.clientX - t.left, 0, t.width);
184
+ I.value.a = Y(n / t.width, 0, 1);
181
185
  }
182
186
  }
183
187
  }, Z = () => {
184
- V.value = !1, H.value = null;
185
- }, Te = (e) => {
186
- q(e);
188
+ B.value = !1, V.value = null;
189
+ }, je = (e) => {
190
+ K(e);
187
191
  };
188
- O(ve, (e) => {
189
- j.value = e, w("change", e);
190
- }), O(j, (e) => {
191
- q(e);
192
- }, { immediate: !0 }), g(() => {
193
- document.addEventListener("mousemove", X), document.addEventListener("mouseup", Z);
194
- }), _(() => {
195
- document.removeEventListener("mousemove", X), document.removeEventListener("mouseup", Z);
192
+ k(G, (e) => {
193
+ j.value = e, T("change", e), q.value = e;
194
+ }), k(j, (e) => {
195
+ e && K(e);
196
+ }, { immediate: !0 }), _(() => {
197
+ document.addEventListener("mousemove", Ae), document.addEventListener("mouseup", Z);
198
+ }), v(() => {
199
+ document.removeEventListener("mousemove", Ae), document.removeEventListener("mouseup", Z);
196
200
  });
197
- let Q = d(), $ = le();
198
- return y(() => {
199
- let e = D(A);
200
- b($, [
201
+ let Q = f(), $ = ue();
202
+ return b(() => {
203
+ let e = O(A);
204
+ x($, [
201
205
  e.b(),
202
- e.m(D(fe)),
203
- e.is("error", D(M))
206
+ e.m(O(pe)),
207
+ e.is("error", O(me))
204
208
  ]);
205
- }), x($, null, 0), Q(s(D(n), { $: [() => ({
209
+ }), S($, null, 0), Q(c(O(r), { $: [() => ({
206
210
  offset: [0, 4],
207
211
  placement: "bottom-start",
208
212
  width: "sameWidth",
209
213
  manual: !0,
210
- ...f.popoverProps
211
- }), { onClickOutside: () => me }] }, {
214
+ ...p.popoverProps
215
+ }), { onClickOutside: () => ge }] }, {
212
216
  content: () => {
213
- let e = ce(), t = a(e), n = a(t), o = a(n), d = h(o, 1), p = h(n, 1), m = a(p), g = a(m), _ = a(g), v = a(_), C = h(_, 1), w = h(m, 1), T = a(w), E = h(p, 2);
214
- return n.$evtmousedown = u(ye), n.$evtclick = u(be), Q(n, R, null, "panelRef"), _.$evtclick = u(Se), Q(_, z, null, "hueSliderRef"), C.$evtmousedown = u(xe), y(() => {
215
- let r = D(A), i = L.value, a = i.h;
216
- b(e, [r.e("wrapper")]), b(t, [r.e("content")]), b(n, [r.e("panel")]), b(o, [r.e("panel-bg")]), S(o, { background: `linear-gradient(to right, #fff, hsl(${a}deg 100% 50%))` }), b(d, [r.e("panel-thumb")]), S(d, {
217
+ let e = le(), n = o(e), r = o(n), s = o(r), f = g(s, 1), m = g(r, 1), h = o(m), _ = o(h), v = o(_), y = o(v), w = g(v, 1), T = g(h, 1), E = o(T), D = g(m, 2);
218
+ return r.$evtmousedown = d(we), r.$evtclick = d(Te), Q(r, L, null, "panelRef"), v.$evtclick = d(De), Q(v, R, null, "hueSliderRef"), w.$evtmousedown = d(Ee), b(() => {
219
+ let t = O(A), i = I.value, a = i.h;
220
+ x(e, [t.e("wrapper")]), x(n, [t.e("content")]), x(r, [t.e("panel")]), x(s, [t.e("panel-bg")]), C(s, { background: `linear-gradient(to right, #fff, hsl(${a}deg 100% 50%))` }), x(f, [t.e("panel-thumb")]), C(f, {
217
221
  left: `${i.s * 100}%`,
218
222
  top: `${(1 - i.v) * 100}%`
219
- }), b(p, [r.e("control")]), b(m, [r.e("control-item")]), b(g, [r.e("control-wrapper")]), b(_, [r.e("control-track")]), b(v, [r.e("control-hue")]), b(C, [r.e("control-thumb")]), S(C, {
223
+ }), x(m, [t.e("control")]), x(h, [t.e("control-item")]), x(_, [t.e("control-wrapper")]), x(v, [t.e("control-track")]), x(y, [t.e("control-hue")]), x(w, [t.e("control-thumb")]), C(w, {
220
224
  left: `${a / 3.6}%`,
221
225
  color: j.value
222
226
  });
223
- }), x(m, null, 1), l(() => !f.disabledAlpha, () => {
224
- let e = k(), t = a(e), n = a(t), r = h(t, 1);
225
- return t.$evtclick = u(we), Q(t, B, null, "alphaSliderRef"), r.$evtmousedown = u(Ce), y(() => {
226
- let i = D(A);
227
- b(e, [i.e("control-wrapper")]), b(t, [i.e("control-track")]), b(n, [i.e("control-alpha")]), S(n, { color: K.value }), b(r, [i.e("control-thumb")]), S(r, {
228
- left: `${L.value.a * 100}%`,
227
+ }), S(h, null, 1), u(() => !p.disabledAlpha, () => {
228
+ let e = ae(), t = o(e), n = o(t), r = g(t, 1);
229
+ return t.$evtclick = d(ke), Q(t, z, null, "alphaSliderRef"), r.$evtmousedown = d(Oe), b(() => {
230
+ let i = O(A);
231
+ x(e, [i.e("control-wrapper")]), x(t, [i.e("control-track")]), x(n, [i.e("control-alpha")]), C(n, { color: W.value }), x(r, [i.e("control-thumb")]), C(r, {
232
+ left: `${I.value.a * 100}%`,
229
233
  color: j.value
230
234
  });
231
235
  }), e;
232
- }), y(() => {
233
- let e = D(A);
234
- b(w, [e.e("control-preview")]), b(T, [e.e("control-preview-color")]), S(T, { background: K.value }), b(E, [e.e("input")]);
235
- }), x(E, null, 0), s(D(i), {
236
- modelValue: () => I.value,
237
- "onUpdate:modelValue": () => (e) => I.value = e,
238
- style: { width: "100px" },
239
- size: "mini",
236
+ }), b(() => {
237
+ let e = O(A);
238
+ x(T, [e.e("control-preview")]), x(E, [e.e("control-preview-color")]), C(E, { background: W.value }), x(D, [e.e("input")]);
239
+ }), S(D, null, 0), c(O(a), {
240
+ modelValue: () => F.value,
241
+ "onUpdate:modelValue": () => (e) => F.value = e,
242
+ style: { width: "120px" },
243
+ size: "small",
240
244
  options: [{
241
245
  label: "HEX",
242
246
  value: "hex"
@@ -244,37 +248,42 @@ var A = /*@__PURE__*/ f({
244
248
  label: "RGB",
245
249
  value: "rgb"
246
250
  }]
247
- }), x(E, null, 1), s(D(r), {
248
- size: "mini",
251
+ }), S(D, null, 1), c(O(i), {
252
+ size: "small",
249
253
  style: { flex: "1" },
250
- modelValue: () => j.value,
251
- "onUpdate:modelValue": () => (e) => j.value = e
252
- }), x(t, null, 3), l(() => f.showPreset, () => {
253
- let e = se(), t = a(e), n = h(t, 1);
254
- return y(() => {
255
- let r = D(A);
256
- b(e, [r.e("presets")]), b(t, [r.e("presets-title")]), b(n, [r.e("presets-list")]);
257
- }), x(n, null, 0), c(() => he.value, (e) => {
258
- let t = oe();
259
- return t.$evtclick = u(() => Te(e.value)), y(() => {
260
- b(t, [[D(A).e("presets-item")], "item"]), S(t, { background: e.value });
254
+ modelValue: () => q.value,
255
+ "onUpdate:modelValue": () => (e) => q.value = e,
256
+ onChange: () => J,
257
+ onPressEnter: () => J
258
+ }), S(D, null, 2), u(() => p.clearable && j.value && !p.disabled, () => {
259
+ let e = oe();
260
+ return b(() => x(e, [O(A).e("clear")])), S(e, null, 0), c(O(t)), e.$evtclick = d(_e), e;
261
+ }), S(n, null, 3), u(() => p.showPreset, () => {
262
+ let e = ce(), t = o(e), n = g(t, 1);
263
+ return b(() => {
264
+ let r = O(A);
265
+ x(e, [r.e("presets")]), x(t, [r.e("presets-title")]), x(n, [r.e("presets-list")]);
266
+ }), S(n, null, 0), l(() => ye.value, (e) => {
267
+ let t = se();
268
+ return t.$evtclick = d(() => je(e.value)), b(() => {
269
+ x(t, [[O(A).e("presets-item")], "item"]), C(t, { background: e.value });
261
270
  }), t;
262
271
  }, (e) => e, 9), e;
263
- }), e.$evtmousedown = re(() => {}, ["prevent"]), e;
272
+ }), e.$evtmousedown = d(ve), e;
264
273
  },
265
274
  default: () => {
266
- let e = ae(), t = a(e);
267
- return y(() => {
268
- let n = D(A);
269
- b(e, [n.e("trigger"), n.is("disabled", f.disabled)]), b(t, [n.e("preview")]), S(t, { backgroundColor: j.value });
270
- }), x(e, null, 1), l(() => f.showText, () => {
271
- let e = ie(), t = ee(e);
272
- return y(() => {
273
- b(e, [D(A).e("value")]), C(t, T(j.value));
275
+ let e = ie(), t = o(e);
276
+ return b(() => {
277
+ let n = O(A);
278
+ x(e, [n.e("trigger"), n.is("disabled", p.disabled)]), x(t, [n.e("preview")]), C(t, { backgroundColor: j.value || void 0 });
279
+ }), S(e, null, 1), u(() => p.showText && j.value, () => {
280
+ let e = re(), t = ee(e);
281
+ return b(() => {
282
+ x(e, [O(A).e("value")]), w(t, E(j.value));
274
283
  }), e;
275
284
  }), e;
276
285
  }
277
- }), N, null, "popoverRef"), $.$evtclick = u(pe), $;
286
+ }), M, null, "popoverRef"), $.$evtclick = d(he), $;
278
287
  }
279
288
  });
280
289
  //#endregion
@@ -3,7 +3,7 @@ import { PopoverProps } from '../popover';
3
3
  export declare const SColorPicker: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
4
4
  attrs: any;
5
5
  slots: {};
6
- emit: ((evt: "change", value: string) => void) & ((event: "update:modelValue", value: string) => void);
6
+ emit: (((evt: "clear") => void) & ((evt: "change", value: string) => void)) & ((event: "update:modelValue", value: string) => void);
7
7
  }, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
8
8
  props: PublicProps & {
9
9
  modelValue?: string | undefined;
@@ -15,7 +15,9 @@ export declare const SColorPicker: ((__VLS_props: NonNullable<Awaited<typeof __V
15
15
  showPreset?: boolean | undefined;
16
16
  presetColors?: string[] | undefined;
17
17
  disabledAlpha?: boolean | undefined;
18
+ clearable?: boolean | undefined;
18
19
  error?: boolean | undefined;
20
+ onClear?: (() => any) | undefined;
19
21
  onChange?: ((value: string) => any) | undefined;
20
22
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
21
23
  } & (typeof globalThis extends {
@@ -24,7 +26,7 @@ export declare const SColorPicker: ((__VLS_props: NonNullable<Awaited<typeof __V
24
26
  expose: (exposed: {}) => void;
25
27
  attrs: any;
26
28
  slots: {};
27
- emit: ((evt: "change", value: string) => void) & ((event: "update:modelValue", value: string) => void);
29
+ emit: (((evt: "clear") => void) & ((evt: "change", value: string) => void)) & ((event: "update:modelValue", value: string) => void);
28
30
  }>) => VNode & {
29
31
  __ctx?: Awaited<typeof __VLS_setup>;
30
32
  }) & Plugin;
@@ -18,10 +18,14 @@ export interface ColorPickerProps {
18
18
  presetColors?: string[];
19
19
  /** 是否禁用透明度选择 */
20
20
  disabledAlpha?: boolean;
21
+ /** 是否可清空(触发器上显示清空按钮,点击后值为空字符串) */
22
+ clearable?: boolean;
21
23
  /** 是否错误 */
22
24
  error?: boolean;
23
25
  }
24
26
  export interface ColorPickerEmits {
25
27
  /** 值改变时触发 */
26
28
  change: [value: string];
29
+ /** 点击清空按钮时触发 */
30
+ clear: [];
27
31
  }
@@ -6,9 +6,9 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
6
6
  }) & {
7
7
  onClose?: (() => any) | undefined;
8
8
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
9
- onOpen?: (() => any) | undefined;
10
9
  onEsc?: (() => any) | undefined;
11
10
  onMaskClick?: (() => any) | undefined;
11
+ onOpen?: (() => any) | undefined;
12
12
  onOpened?: (() => any) | undefined;
13
13
  onClosed?: (() => any) | undefined;
14
14
  }> & (typeof globalThis extends {
@@ -17,7 +17,7 @@ declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup
17
17
  expose: (exposed: {}) => void;
18
18
  attrs: any;
19
19
  slots: DrawerSlots;
20
- emit: (((evt: "close") => void) & ((evt: "open") => void) & ((evt: "esc") => void) & ((evt: "maskClick") => void) & ((evt: "opened") => void) & ((evt: "closed") => void)) & ((event: "update:modelValue", value: boolean) => void);
20
+ emit: (((evt: "close") => void) & ((evt: "esc") => void) & ((evt: "maskClick") => void) & ((evt: "open") => void) & ((evt: "opened") => void) & ((evt: "closed") => void)) & ((event: "update:modelValue", value: boolean) => void);
21
21
  }>) => VNode & {
22
22
  __ctx?: Awaited<typeof __VLS_setup>;
23
23
  };
@@ -4,7 +4,7 @@ import { ScrollbarProps } from '../scrollbar';
4
4
  export declare const SDrawer: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
5
5
  attrs: any;
6
6
  slots: DrawerSlots;
7
- emit: (((evt: "close") => void) & ((evt: "open") => void) & ((evt: "esc") => void) & ((evt: "maskClick") => void) & ((evt: "opened") => void) & ((evt: "closed") => void)) & ((event: "update:modelValue", value: boolean) => void);
7
+ emit: (((evt: "close") => void) & ((evt: "esc") => void) & ((evt: "maskClick") => void) & ((evt: "open") => void) & ((evt: "opened") => void) & ((evt: "closed") => void)) & ((event: "update:modelValue", value: boolean) => void);
8
8
  }, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
9
9
  props: PublicProps & {
10
10
  modelValue?: boolean | undefined;
@@ -33,9 +33,9 @@ export declare const SDrawer: ((__VLS_props: NonNullable<Awaited<typeof __VLS_se
33
33
  maskStyle?: Record<string, string> | undefined;
34
34
  onClose?: (() => any) | undefined;
35
35
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
36
- onOpen?: (() => any) | undefined;
37
36
  onEsc?: (() => any) | undefined;
38
37
  onMaskClick?: (() => any) | undefined;
38
+ onOpen?: (() => any) | undefined;
39
39
  onOpened?: (() => any) | undefined;
40
40
  onClosed?: (() => any) | undefined;
41
41
  } & (typeof globalThis extends {
@@ -44,7 +44,7 @@ export declare const SDrawer: ((__VLS_props: NonNullable<Awaited<typeof __VLS_se
44
44
  expose: (exposed: {}) => void;
45
45
  attrs: any;
46
46
  slots: DrawerSlots;
47
- emit: (((evt: "close") => void) & ((evt: "open") => void) & ((evt: "esc") => void) & ((evt: "maskClick") => void) & ((evt: "opened") => void) & ((evt: "closed") => void)) & ((event: "update:modelValue", value: boolean) => void);
47
+ emit: (((evt: "close") => void) & ((evt: "esc") => void) & ((evt: "maskClick") => void) & ((evt: "open") => void) & ((evt: "opened") => void) & ((evt: "closed") => void)) & ((event: "update:modelValue", value: boolean) => void);
48
48
  }>) => VNode & {
49
49
  __ctx?: Awaited<typeof __VLS_setup>;
50
50
  }) & Plugin;
@@ -1,8 +1,8 @@
1
1
  import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
2
2
  import "../../../hooks/index.mjs";
3
3
  import { LeftLine as t, RightLine as n } from "../../../icons/src/svg/arrow/index.mjs";
4
- import { SSelect as r } from "../select/index.mjs";
5
- import { SInputNumber as i } from "../input-number/index.mjs";
4
+ import { SInputNumber as r } from "../input-number/index.mjs";
5
+ import { SSelect as i } from "../select/index.mjs";
6
6
  import { child as a, computed as o, createComponent as s, createFor as c, createIf as l, createInvoker as u, createTemplateRefSetter as d, defineVaporComponent as f, delegateEvents as p, mergeModels as m, next as h, ref as g, renderEffect as _, setClass as v, setInsertionState as y, setText as b, template as x, toDisplayString as S, txt as C, unref as w, useModel as T, useTemplateRef as E, watch as D, withKeys as O } from "vue";
7
7
  //#region ../components/src/pagination/pagination.vue?vue&type=script&setup=true&vapor=true&lang.ts
8
8
  var k = x("<div> "), A = x("<div>..."), j = x("<div><div>前往</div><!><div>页</div>"), M = x("<div>"), N = x("<div><div><div></div><!><div></div></div>", 1);
@@ -112,11 +112,11 @@ var P = /*@__PURE__*/ f({
112
112
  e.is("disabled", I.value >= B.value || f.disabled)
113
113
  ]);
114
114
  }), y($, null, 0), s(w(n)), $.$evtclick = u(G), y(Y, null, 2), l(() => f.showJumper, () => {
115
- let e = j(), t = a(e), n = h(t, 1), r = h(n, 2);
115
+ let e = j(), t = a(e), n = h(t, 1), i = h(n, 2);
116
116
  return _(() => {
117
117
  let n = w(P);
118
118
  v(e, [n.e("jumper")]), v(t, [n.e("jumper-text")]);
119
- }), y(e, n, 1), J(s(w(i), {
119
+ }), y(e, n, 1), J(s(w(r), {
120
120
  modelValue: () => z.value,
121
121
  "onUpdate:modelValue": () => (e) => z.value = e,
122
122
  style: "width: 60px",
@@ -124,10 +124,10 @@ var P = /*@__PURE__*/ f({
124
124
  disabled: () => f.disabled,
125
125
  controls: !1,
126
126
  onKeyup: () => O(q, ["enter"])
127
- }), F, null, "jumperInputRef"), _(() => v(r, [w(P).e("jumper-text")])), e;
127
+ }), F, null, "jumperInputRef"), _(() => v(i, [w(P).e("jumper-text")])), e;
128
128
  }), y(Y, null, 3), l(() => f.showPageSize, () => {
129
129
  let e = M();
130
- return _(() => v(e, [w(P).e("options")])), y(e, null, 0), s(w(r), {
130
+ return _(() => v(e, [w(P).e("options")])), y(e, null, 0), s(w(i), {
131
131
  modelValue: () => R.value,
132
132
  "onUpdate:modelValue": () => (e) => R.value = e,
133
133
  options: () => H.value,