savor-ui 0.26.0 → 0.27.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 +14 -0
- package/dist/es/components/index.mjs +3 -3
- package/dist/es/components/src/color-picker/color-picker.d.ts +2 -1
- package/dist/es/components/src/color-picker/color-picker.vue.mjs +148 -139
- package/dist/es/components/src/color-picker/index.d.ts +4 -2
- package/dist/es/components/src/color-picker/types.d.ts +4 -0
- package/dist/es/components/src/drawer/drawer.d.ts +2 -2
- package/dist/es/components/src/drawer/index.d.ts +3 -3
- package/dist/es/components/src/pagination/pagination.vue.mjs +6 -6
- package/dist/es/components/src/select/select.vue.mjs +1 -1
- package/dist/es/components/src/table/table.vue.mjs +4 -2
- package/dist/es/components/src/tabs/index.d.ts +3 -3
- package/dist/es/components/src/tabs/tab-pane.vue.mjs +1 -1
- package/dist/es/components/src/tabs/tab.vue.mjs +1 -1
- package/dist/es/components/src/tabs/tabs.vue.mjs +4 -4
- package/dist/es/components/src/tabs/types.d.ts +4 -4
- package/dist/es/components/src/tag/index.d.ts +1 -1
- package/dist/es/components/src/tag/tag.vue.mjs +2 -2
- package/dist/es/components/src/tag/types.d.ts +1 -1
- package/dist/es/components/src/tree-select/tree-select.vue.mjs +1 -1
- package/dist/es/core/components.mjs +46 -46
- package/dist/es/core/index.mjs +40 -40
- package/dist/es/icons/plugin.d.ts +7 -7
- package/dist/es/icons/src/svg/arrow/index.mjs +1 -1
- package/dist/es/icons/src/svg/building/index.mjs +1 -1
- package/dist/es/icons/src/svg/business/index.mjs +1 -1
- package/dist/es/icons/src/svg/contact/index.mjs +1 -1
- package/dist/es/icons/src/svg/design/index.mjs +1 -1
- package/dist/es/icons/src/svg/development/index.mjs +1 -1
- package/dist/es/icons/src/svg/device/index.mjs +1 -1
- package/dist/es/icons/src/svg/editor/index.mjs +1 -1
- package/dist/es/icons/src/svg/education/index.mjs +1 -1
- package/dist/es/icons/src/svg/file/index.mjs +1 -1
- package/dist/es/icons/src/svg/logo/index.mjs +1 -1
- package/dist/es/icons/src/svg/media/index.mjs +1 -1
- package/dist/es/icons/src/svg/system/index.mjs +1 -1
- package/dist/es/icons/src/svg/user/index.mjs +1 -1
- package/dist/es/icons/src/svg/weather/index.mjs +1 -1
- package/dist/es/theme/components/color-picker.scss +13 -0
- package/dist/json/vetur-attributes.json +8 -4
- package/dist/json/vetur-tags.json +5 -4
- package/dist/json/web-types.json +13 -5
- package/package.json +1 -1
- package/dist/es/icons/src/svg/arrow/index.d.ts +0 -1124
- package/dist/es/icons/src/svg/building/index.d.ts +0 -1005
- package/dist/es/icons/src/svg/business/index.d.ts +0 -2212
- package/dist/es/icons/src/svg/contact/index.d.ts +0 -580
- package/dist/es/icons/src/svg/design/index.d.ts +0 -2076
- package/dist/es/icons/src/svg/development/index.d.ts +0 -546
- package/dist/es/icons/src/svg/device/index.d.ts +0 -2008
- package/dist/es/icons/src/svg/editor/index.d.ts +0 -1532
- package/dist/es/icons/src/svg/education/index.d.ts +0 -631
- package/dist/es/icons/src/svg/file/index.d.ts +0 -1957
- package/dist/es/icons/src/svg/index.d.ts +0 -15
- package/dist/es/icons/src/svg/logo/index.d.ts +0 -546
- package/dist/es/icons/src/svg/media/index.d.ts +0 -1515
- package/dist/es/icons/src/svg/system/index.d.ts +0 -2654
- package/dist/es/icons/src/svg/user/index.d.ts +0 -631
- package/dist/es/icons/src/svg/weather/index.d.ts +0 -1022
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
# [0.27.0](https://gitee.com/mach552/savor-ui/compare/v0.26.1...v0.27.0) (2026-08-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **color-picker:** 新增清空属性 ([1e302a5](https://gitee.com/mach552/savor-ui/commits/1e302a52c2caad68e2f9299d037cd2ebe4cea092))
|
|
11
|
+
|
|
12
|
+
## [0.26.1](https://gitee.com/mach552/savor-ui/compare/v0.26.0...v0.26.1) (2026-08-28)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **table:** 修复翻页会丢失已选行的问题 ([e8650ab](https://gitee.com/mach552/savor-ui/commits/e8650abc6387f70177c2ecc45b60e151e3647916))
|
|
18
|
+
|
|
5
19
|
# [0.26.0](https://gitee.com/mach552/savor-ui/compare/v0.25.0...v0.26.0) (2026-08-27)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -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/
|
|
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";
|
|
@@ -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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
|
10
|
-
|
|
11
|
-
var A = /*@__PURE__*/
|
|
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__*/
|
|
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: "
|
|
28
|
+
modelValue: { default: "" },
|
|
27
29
|
modelModifiers: {}
|
|
28
30
|
}),
|
|
29
|
-
emits: /*@__PURE__*/
|
|
30
|
-
setup(
|
|
31
|
-
let
|
|
32
|
-
size:
|
|
33
|
-
error:
|
|
34
|
-
}),
|
|
35
|
-
e ?
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
},
|
|
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
|
-
}),
|
|
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
|
-
]),
|
|
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
|
-
},
|
|
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()}`,
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
118
|
-
let { r: e, g: t, b: n } =
|
|
119
|
-
return `rgba(${e},${t},${n},${
|
|
120
|
-
}),
|
|
121
|
-
let { r: e, g: t, b: n } =
|
|
122
|
-
return
|
|
123
|
-
}),
|
|
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 =
|
|
127
|
-
...
|
|
128
|
-
a:
|
|
132
|
+
let t = Se(e), n = {
|
|
133
|
+
...H(t.r, t.g, t.b),
|
|
134
|
+
a: I.value.a
|
|
129
135
|
};
|
|
130
|
-
if (
|
|
131
|
-
|
|
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] :
|
|
138
|
-
...
|
|
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 (
|
|
142
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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 =
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
e.preventDefault(),
|
|
158
|
-
},
|
|
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 =
|
|
165
|
-
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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 (
|
|
179
|
-
let t =
|
|
180
|
-
|
|
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
|
-
|
|
185
|
-
},
|
|
186
|
-
|
|
188
|
+
B.value = !1, V.value = null;
|
|
189
|
+
}, je = (e) => {
|
|
190
|
+
K(e);
|
|
187
191
|
};
|
|
188
|
-
|
|
189
|
-
j.value = e,
|
|
190
|
-
}),
|
|
191
|
-
|
|
192
|
-
}, { immediate: !0 }),
|
|
193
|
-
document.addEventListener("mousemove",
|
|
194
|
-
}),
|
|
195
|
-
document.removeEventListener("mousemove",
|
|
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 =
|
|
198
|
-
return
|
|
199
|
-
let e =
|
|
200
|
-
|
|
201
|
+
let Q = f(), $ = ue();
|
|
202
|
+
return b(() => {
|
|
203
|
+
let e = O(A);
|
|
204
|
+
x($, [
|
|
201
205
|
e.b(),
|
|
202
|
-
e.m(
|
|
203
|
-
e.is("error",
|
|
206
|
+
e.m(O(pe)),
|
|
207
|
+
e.is("error", O(me))
|
|
204
208
|
]);
|
|
205
|
-
}),
|
|
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
|
-
...
|
|
211
|
-
}), { onClickOutside: () =>
|
|
214
|
+
...p.popoverProps
|
|
215
|
+
}), { onClickOutside: () => ge }] }, {
|
|
212
216
|
content: () => {
|
|
213
|
-
let e =
|
|
214
|
-
return
|
|
215
|
-
let
|
|
216
|
-
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
224
|
-
let e =
|
|
225
|
-
return t.$evtclick =
|
|
226
|
-
let i =
|
|
227
|
-
|
|
228
|
-
left: `${
|
|
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
|
-
}),
|
|
233
|
-
let e =
|
|
234
|
-
|
|
235
|
-
}),
|
|
236
|
-
modelValue: () =>
|
|
237
|
-
"onUpdate:modelValue": () => (e) =>
|
|
238
|
-
style: { width: "
|
|
239
|
-
size: "
|
|
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
|
-
}),
|
|
248
|
-
size: "
|
|
251
|
+
}), S(D, null, 1), c(O(i), {
|
|
252
|
+
size: "small",
|
|
249
253
|
style: { flex: "1" },
|
|
250
|
-
modelValue: () =>
|
|
251
|
-
"onUpdate:modelValue": () => (e) =>
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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 =
|
|
272
|
+
}), e.$evtmousedown = d(ve), e;
|
|
264
273
|
},
|
|
265
274
|
default: () => {
|
|
266
|
-
let e =
|
|
267
|
-
return
|
|
268
|
-
let n =
|
|
269
|
-
|
|
270
|
-
}),
|
|
271
|
-
let e =
|
|
272
|
-
return
|
|
273
|
-
|
|
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
|
-
}),
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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 {
|
|
5
|
-
import {
|
|
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),
|
|
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(
|
|
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(
|
|
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(
|
|
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,
|
|
@@ -52,11 +52,13 @@ var re = w("<table table-layout=fixed></table>"), ie = w("<div>"), ae = w("<div>
|
|
|
52
52
|
]),
|
|
53
53
|
setup(p, { expose: m, emit: w, slots: O }) {
|
|
54
54
|
let k = p, A = w, j = r("table"), M = E(p, "checkedKeys"), N = E(p, "selected"), P = E(p, "expandedKeys"), oe = (e, t, n) => {
|
|
55
|
-
|
|
55
|
+
let r = Y(e);
|
|
56
|
+
n.some((e) => Y(e) === r) ? M.value.includes(r) || (M.value = [...M.value, r]) : M.value = M.value.filter((e) => e !== r), A("checkRow", e, t, n);
|
|
56
57
|
}, se = (e, t) => {
|
|
57
58
|
N.value = e ?? {}, A("selectRow", e, t);
|
|
58
59
|
}, ce = (e) => {
|
|
59
|
-
|
|
60
|
+
let t = (Q.value ?? []).map((e) => Y(e)), n = new Set(t);
|
|
61
|
+
e.length > 0 ? M.value = [...new Set([...M.value, ...t])] : M.value = M.value.filter((e) => !n.has(e)), A("checkAll", e);
|
|
60
62
|
}, le = l(() => {
|
|
61
63
|
let e = [];
|
|
62
64
|
if (!k.border || k.border.length === 0) return e;
|