Skip to content

Commit 2c6e999

Browse files
committed
chore(deps-dev): update vite to v5
1 parent f240563 commit 2c6e999

File tree

4 files changed

+309
-142
lines changed

4 files changed

+309
-142
lines changed

dist/ColorPicker.js

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineComponent as vt, ref as F, reactive as pt, computed as U, watch as dt, onMounted as mt, onBeforeUnmount as gt, openBlock as w, createElementBlock as y, createElementVNode as h, renderSlot as I, createTextVNode as q, createCommentVNode as X, Fragment as bt, renderList as wt, toDisplayString as yt } from "vue";
2-
function M(t, e, s) {
2+
function $(t, e, s) {
33
return Math.max(e, Math.min(t, s));
44
}
55
function xt(t, e) {
@@ -64,7 +64,7 @@ function tt(t) {
6464
a: t.a
6565
};
6666
}
67-
function T(t) {
67+
function _(t) {
6868
return A(Z(t));
6969
}
7070
function x(t) {
@@ -93,54 +93,54 @@ function H(t) {
9393
function V(t) {
9494
return "#" + Object.values(t).map((e, s) => Math.round(s === 3 ? e * 255 : e).toString(16).padStart(2, "0")).join("");
9595
}
96-
function k(t) {
96+
function M(t) {
9797
return tt(Q(H(t)));
9898
}
9999
const Ct = {
100100
hex: {
101101
hex: (t) => t,
102102
hsl: (t) => H(N(t)),
103-
hsv: (t) => x(k(N(t))),
104-
hwb: (t) => k(N(t)),
103+
hsv: (t) => x(M(N(t))),
104+
hwb: (t) => M(N(t)),
105105
rgb: N
106106
},
107107
hsl: {
108108
hex: (t) => V(A(t)),
109109
hsl: (t) => t,
110110
hsv: Q,
111-
hwb: (t) => k(A(t)),
111+
hwb: (t) => M(A(t)),
112112
rgb: A
113113
},
114114
hsv: {
115-
hex: (t) => V(T(t)),
115+
hex: (t) => V(_(t)),
116116
hsl: Z,
117117
hsv: (t) => t,
118118
hwb: tt,
119-
rgb: T
119+
rgb: _
120120
},
121121
hwb: {
122-
hex: (t) => V(T(x(t))),
123-
hsl: (t) => H(T(x(t))),
122+
hex: (t) => V(_(x(t))),
123+
hsl: (t) => H(_(x(t))),
124124
hsv: x,
125125
hwb: (t) => t,
126-
rgb: (t) => T(x(t))
126+
rgb: (t) => _(x(t))
127127
},
128128
rgb: {
129129
hex: V,
130130
hsl: H,
131-
hsv: (t) => x(k(t)),
132-
hwb: k,
131+
hsv: (t) => x(M(t)),
132+
hwb: M,
133133
rgb: (t) => t
134134
}
135135
};
136-
function _t(t, e, s) {
136+
function Tt(t, e, s) {
137137
return Ct[t][e](s);
138138
}
139-
function Tt(t, e) {
139+
function _t(t, e) {
140140
const s = t.toFixed(e);
141141
return s.includes(".") ? s.replace(/\.?0+$/, "") : s;
142142
}
143-
const kt = {
143+
const Mt = {
144144
deg: 1,
145145
grad: 0.9,
146146
rad: 180 / Math.PI,
@@ -158,17 +158,17 @@ const kt = {
158158
if (e === null)
159159
return g.from(t);
160160
const s = e[0];
161-
return g.from(t.slice(0, -s.length)) * kt[s];
161+
return g.from(t.slice(0, -s.length)) * Mt[s];
162162
},
163163
to(t) {
164164
return g.to(t);
165165
}
166166
}, g = {
167167
from(t, { min: e = Number.NEGATIVE_INFINITY, max: s = Number.POSITIVE_INFINITY } = {}) {
168-
return t.endsWith(".") ? NaN : M(Number(t), e, s);
168+
return t.endsWith(".") ? NaN : $(Number(t), e, s);
169169
},
170170
to(t) {
171-
return Tt(t, 2);
171+
return _t(t, 2);
172172
}
173173
}, C = {
174174
from(t, { referenceValue: e = 100, min: s = 0, max: o = 100 } = {}) {
@@ -184,7 +184,7 @@ const kt = {
184184
to(t) {
185185
return g.to(t);
186186
}
187-
}, Mt = {
187+
}, $t = {
188188
hsl: {
189189
h: G,
190190
s: C,
@@ -205,7 +205,7 @@ const kt = {
205205
}
206206
};
207207
function E(t, e) {
208-
return Mt[t][e];
208+
return $t[t][e];
209209
}
210210
function W({ format: t, color: e }, s) {
211211
if (t === "hex")
@@ -219,7 +219,7 @@ function W({ format: t, color: e }, s) {
219219
function et(t) {
220220
return /^#(?:(?:[A-F0-9]{2}){3,4}|[A-F0-9]{3,4})$/i.test(t);
221221
}
222-
function $t(t) {
222+
function kt(t) {
223223
return "r" in t ? "rgb" : "w" in t ? "hwb" : "v" in t ? "hsv" : "s" in t ? "hsl" : null;
224224
}
225225
const J = {
@@ -229,7 +229,7 @@ const J = {
229229
};
230230
function Ft(t) {
231231
if (typeof t != "string") {
232-
const p = $t(t);
232+
const p = kt(t);
233233
return p === null ? null : { format: p, color: t };
234234
}
235235
if (t.startsWith("#"))
@@ -257,8 +257,8 @@ function Ft(t) {
257257
function It(t, e, s) {
258258
const o = t.getBoundingClientRect(), u = e - o.left, f = s - o.top;
259259
return {
260-
x: o.width === 0 ? 0 : M(u / o.width * 100, 0, 100),
261-
y: o.height === 0 ? 0 : M((1 - f / o.height) * 100, 0, 100)
260+
x: o.width === 0 ? 0 : $(u / o.width * 100, 0, 100),
261+
y: o.height === 0 ? 0 : $((1 - f / o.height) * 100, 0, 100)
262262
};
263263
}
264264
const Nt = { class: "vacp-range-input-group" }, Vt = ["for"], At = { class: "vacp-range-input-label-text vacp-range-input-label-text--hue" }, Ht = ["id", "value"], Et = ["for"], Lt = { class: "vacp-range-input-label-text vacp-range-input-label-text--alpha" }, Pt = ["id", "value"], Ot = /* @__PURE__ */ h("span", { class: "vacp-visually-hidden" }, "Copy color", -1), St = /* @__PURE__ */ h("svg", {
@@ -310,9 +310,9 @@ const Nt = { class: "vacp-range-input-group" }, Vt = ["for"], At = { class: "vac
310310
return o.alphaChannel === "hide" && [5, 9].includes(l.hex.length) ? l.hex.substring(0, l.hex.length - (l.hex.length - 1) / 4) : l.hex;
311311
});
312312
dt(() => o.color, z), mt(function() {
313-
document.addEventListener("mousemove", L, { passive: !1 }), document.addEventListener("touchmove", P, { passive: !1 }), document.addEventListener("mouseup", $), document.addEventListener("touchend", $), z(o.color);
313+
document.addEventListener("mousemove", L, { passive: !1 }), document.addEventListener("touchmove", P, { passive: !1 }), document.addEventListener("mouseup", k), document.addEventListener("touchend", k), z(o.color);
314314
}), gt(function() {
315-
document.removeEventListener("mousemove", L), document.removeEventListener("touchmove", P), document.removeEventListener("mouseup", $), document.removeEventListener("touchend", $);
315+
document.removeEventListener("mousemove", L), document.removeEventListener("touchmove", P), document.removeEventListener("mouseup", k), document.removeEventListener("touchend", k);
316316
});
317317
function st() {
318318
const r = (o.visibleFormats.findIndex((a) => a === c.value) + 1) % o.visibleFormats.length;
@@ -324,7 +324,7 @@ const Nt = { class: "vacp-range-input-group" }, Vt = ["for"], At = { class: "vac
324324
function at(n) {
325325
d = !0, P(n);
326326
}
327-
function $() {
327+
function k() {
328328
d = !1;
329329
}
330330
function L(n) {
@@ -345,8 +345,8 @@ const Nt = { class: "vacp-range-input-group" }, Vt = ["for"], At = { class: "vac
345345
if (!["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"].includes(n.key))
346346
return;
347347
n.preventDefault();
348-
const r = ["ArrowLeft", "ArrowDown"].includes(n.key) ? -1 : 1, a = ["ArrowLeft", "ArrowRight"].includes(n.key) ? "s" : "v", i = n.shiftKey ? 10 : 1, m = l.hsv[a] + r * i, _ = Object.assign({}, l.hsv);
349-
_[a] = M(m, 0, 100), b("hsv", _);
348+
const r = ["ArrowLeft", "ArrowDown"].includes(n.key) ? -1 : 1, a = ["ArrowLeft", "ArrowRight"].includes(n.key) ? "s" : "v", i = n.shiftKey ? 10 : 1, m = l.hsv[a] + r * i, T = Object.assign({}, l.hsv);
349+
T[a] = $(m, 0, 100), b("hsv", T);
350350
}
351351
function z(n) {
352352
const r = Ft(n);
@@ -377,7 +377,7 @@ const Nt = { class: "vacp-range-input-group" }, Vt = ["for"], At = { class: "vac
377377
if (!xt(l[n], a)) {
378378
l[n] = a;
379379
for (const i of s)
380-
i !== n && (l[i] = _t(n, i, a));
380+
i !== n && (l[i] = Tt(n, i, a));
381381
u("color-change", ft());
382382
}
383383
f.value instanceof HTMLElement && v.value instanceof HTMLElement && p.value instanceof HTMLElement && ht(f.value, v.value, p.value);
@@ -404,8 +404,8 @@ const Nt = { class: "vacp-range-input-group" }, Vt = ["for"], At = { class: "vac
404404
function B(n) {
405405
if (!["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"].includes(n.key) || !n.shiftKey)
406406
return;
407-
const r = n.currentTarget, a = Number(r.step), i = ["ArrowLeft", "ArrowDown"].includes(n.key) ? -1 : 1, m = Number(r.value) + i * a * 10, _ = M(m, Number(r.min), Number(r.max));
408-
r.value = String(_ - i * a);
407+
const r = n.currentTarget, a = Number(r.step), i = ["ArrowLeft", "ArrowDown"].includes(n.key) ? -1 : 1, m = Number(r.value) + i * a * 10, T = $(m, Number(r.min), Number(r.max));
408+
r.value = String(T - i * a);
409409
}
410410
return (n, r) => (w(), y("div", {
411411
ref_key: "colorPicker",
@@ -529,8 +529,7 @@ const Nt = { class: "vacp-range-input-group" }, Vt = ["for"], At = { class: "vac
529529
])
530530
], 512));
531531
}
532-
});
533-
const Jt = {
532+
}), Jt = {
534533
install(t) {
535534
t.component("ColorPicker", Xt);
536535
}

0 commit comments

Comments
 (0)