@aurouscia/au-color-picker 0.4.2 → 0.4.3
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/dist/au-color-picker.es.js +125 -127
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as J, ref as b, onMounted as ge, onUnmounted as ye, openBlock as N, createElementBlock as R, normalizeStyle as U, isRef as me, createElementVNode as i, computed as K, onBeforeMount as ie, watch as re, normalizeClass as he, unref as C, createVNode as ue, withDirectives as Y, vModelSelect as xe, createCommentVNode as G, vModelRadio as ee, Fragment as Pe, renderList as ke, toDisplayString as Ce } from "vue";
|
|
2
2
|
import A from "color-convert";
|
|
3
|
-
function we(p,
|
|
4
|
-
const m = p.x -
|
|
3
|
+
function we(p, r) {
|
|
4
|
+
const m = p.x - r.x, f = p.y - r.y;
|
|
5
5
|
return m ** 2 + f ** 2;
|
|
6
6
|
}
|
|
7
|
-
function Se(p,
|
|
8
|
-
const m = p.x -
|
|
7
|
+
function Se(p, r) {
|
|
8
|
+
const m = p.x - r.x, f = p.y - r.y;
|
|
9
9
|
return Math.atan2(f, m);
|
|
10
10
|
}
|
|
11
11
|
function Ie(p) {
|
|
12
|
-
let
|
|
13
|
-
for (;
|
|
14
|
-
m +=
|
|
12
|
+
let r = p, m = 0, f = 0;
|
|
13
|
+
for (; r !== null; )
|
|
14
|
+
m += r.offsetTop, f += r.offsetLeft, r = r.offsetParent;
|
|
15
15
|
return { y: m, x: f };
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const H = 400, L = 400, F = 200, Be = 200, te = 190, ne = 150, O = 200, oe = 16, se = 3, be = /* @__PURE__ */ J({
|
|
18
18
|
__name: "AuColorPickerRing",
|
|
19
19
|
props: {
|
|
20
20
|
initialHex: {}
|
|
21
21
|
},
|
|
22
22
|
emits: ["changed"],
|
|
23
|
-
setup(p, { expose:
|
|
23
|
+
setup(p, { expose: r, emit: m }) {
|
|
24
24
|
const f = b(), h = b();
|
|
25
25
|
let c, v;
|
|
26
|
-
const x = { x: 199, y: 199 }, E = (
|
|
26
|
+
const x = { x: 199, y: 199 }, E = (te + ne) / 2, T = te ** 2, z = ne ** 2, P = (H - O) / 2, D = P + O, w = b(0), _ = b(100), I = b(100), l = p;
|
|
27
27
|
let e;
|
|
28
28
|
function g() {
|
|
29
29
|
var a, d;
|
|
30
30
|
const o = (a = f.value) == null ? void 0 : a.getContext("2d"), s = (d = h.value) == null ? void 0 : d.getContext("2d");
|
|
31
31
|
if (!o || !s)
|
|
32
32
|
throw Error("canvas context getting error");
|
|
33
|
-
if (
|
|
34
|
-
const k = A.hex.hsv(
|
|
33
|
+
if (l.initialHex) {
|
|
34
|
+
const k = A.hex.hsv(l.initialHex);
|
|
35
35
|
w.value = k[0], _.value = k[1], I.value = k[2];
|
|
36
36
|
}
|
|
37
|
-
c = o, v = s, e = c.getImageData(0, 0,
|
|
37
|
+
c = o, v = s, e = c.getImageData(0, 0, H, L), V(), t(), X(), c.putImageData(e, 0, 0);
|
|
38
38
|
}
|
|
39
39
|
function V() {
|
|
40
|
-
for (let o = 0; o <
|
|
40
|
+
for (let o = 0; o < H; o++)
|
|
41
41
|
for (let s = 0; s < L; s++) {
|
|
42
42
|
const a = { x: o, y: s };
|
|
43
43
|
if (y(a)) {
|
|
44
|
-
const d = a.y *
|
|
44
|
+
const d = a.y * H * 4 + a.x * 4, k = W(a), $ = A.hsv.rgb([k, 100, 100]);
|
|
45
45
|
e.data[d] = $[0], e.data[d + 1] = $[1], e.data[d + 2] = $[2], e.data[d + 3] = 255;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -51,14 +51,14 @@ const N = 400, L = 400, F = 200, Be = 200, ne = 190, oe = 150, O = 200, se = 16,
|
|
|
51
51
|
}
|
|
52
52
|
function y(o) {
|
|
53
53
|
const s = we(x, o);
|
|
54
|
-
return s > z && s <
|
|
54
|
+
return s > z && s < T;
|
|
55
55
|
}
|
|
56
56
|
function t() {
|
|
57
|
-
for (let o = 0; o <
|
|
57
|
+
for (let o = 0; o < H; o++)
|
|
58
58
|
for (let s = 0; s < L; s++) {
|
|
59
59
|
const a = { x: o, y: s };
|
|
60
60
|
if (B(a)) {
|
|
61
|
-
const d = a.y *
|
|
61
|
+
const d = a.y * H * 4 + a.x * 4, { s: k, v: $ } = n(a), q = A.hsv.rgb([w.value, k, $]);
|
|
62
62
|
e.data[d] = q[0], e.data[d + 1] = q[1], e.data[d + 2] = q[2], e.data[d + 3] = 255;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -69,7 +69,7 @@ const N = 400, L = 400, F = 200, Be = 200, ne = 190, oe = 150, O = 200, se = 16,
|
|
|
69
69
|
return d > 1 ? d = 1 : d < 0 && (d = 0), k > 1 ? k = 1 : k < 0 && (k = 0), { s: 100 * d, v: 100 * k };
|
|
70
70
|
}
|
|
71
71
|
function B(o) {
|
|
72
|
-
return !(o.x < P || o.x >
|
|
72
|
+
return !(o.x < P || o.x > D || o.y < P || o.y > D);
|
|
73
73
|
}
|
|
74
74
|
let M = !1, u = "none", S = !1;
|
|
75
75
|
function j(o, s) {
|
|
@@ -95,28 +95,28 @@ const N = 400, L = 400, F = 200, Be = 200, ne = 190, oe = 150, O = 200, se = 16,
|
|
|
95
95
|
s -= d.x, a -= d.y;
|
|
96
96
|
} else
|
|
97
97
|
s = o.offsetX, a = o.offsetY;
|
|
98
|
-
return s = s *
|
|
98
|
+
return s = s * H / F, a = a * H / F, { x: s, y: a };
|
|
99
99
|
}
|
|
100
100
|
function X(o) {
|
|
101
101
|
if (o) {
|
|
102
102
|
const pe = A.hsv.hex([w.value, _.value, I.value]);
|
|
103
103
|
fe("changed", pe);
|
|
104
104
|
}
|
|
105
|
-
const s = (w.value / 360 * 2 + 1) * Math.PI, a = Math.cos(s) * E +
|
|
106
|
-
v.reset(), v.lineWidth = 4, v.strokeStyle = "black", v.beginPath(), v.arc(a, d,
|
|
105
|
+
const s = (w.value / 360 * 2 + 1) * Math.PI, a = Math.cos(s) * E + H / 2, d = Math.sin(s) * E + L / 2, k = _.value / 100 * O + P, $ = (1 - I.value / 100) * O + P;
|
|
106
|
+
v.reset(), v.lineWidth = 4, v.strokeStyle = "black", v.beginPath(), v.arc(a, d, oe - 2, 0, 2 * Math.PI), v.stroke(), v.beginPath(), v.arc(a, d, se, 0, 2 * Math.PI), v.fill();
|
|
107
107
|
const q = I.value > 50 ? "black" : "#ddd";
|
|
108
|
-
v.strokeStyle = q, v.fillStyle = q, v.beginPath(), v.arc(k, $,
|
|
108
|
+
v.strokeStyle = q, v.fillStyle = q, v.beginPath(), v.arc(k, $, oe - 2, 0, 2 * Math.PI), v.stroke(), v.beginPath(), v.arc(k, $, se, 0, 2 * Math.PI), v.fill();
|
|
109
109
|
}
|
|
110
110
|
function de(o) {
|
|
111
111
|
const s = A.hex.hsv(o);
|
|
112
112
|
w.value = s[0], _.value = s[1], I.value = s[2], t(), c.putImageData(e, 0, 0), X();
|
|
113
113
|
}
|
|
114
114
|
const fe = m;
|
|
115
|
-
return
|
|
115
|
+
return r({ enforceTo: de }), ge(() => {
|
|
116
116
|
g(), window.addEventListener("touchend", Z), window.addEventListener("mouseup", Z);
|
|
117
117
|
}), ye(() => {
|
|
118
118
|
window.removeEventListener("touchend", Z), window.removeEventListener("mouseup", Z);
|
|
119
|
-
}), (o, s) => (
|
|
119
|
+
}), (o, s) => (N(), R("div", {
|
|
120
120
|
class: "acpRingBody",
|
|
121
121
|
style: U({ width: F + "px", height: Be + "px" }),
|
|
122
122
|
onTouchstart: j,
|
|
@@ -127,50 +127,50 @@ const N = 400, L = 400, F = 200, Be = 200, ne = 190, oe = 150, O = 200, se = 16,
|
|
|
127
127
|
j(a), me(S) ? S.value = !0 : S = !0;
|
|
128
128
|
})
|
|
129
129
|
}, [
|
|
130
|
-
|
|
131
|
-
width:
|
|
130
|
+
i("canvas", {
|
|
131
|
+
width: H,
|
|
132
132
|
height: L,
|
|
133
133
|
ref_key: "cvs",
|
|
134
134
|
ref: f
|
|
135
135
|
}, null, 512),
|
|
136
|
-
|
|
137
|
-
width:
|
|
136
|
+
i("canvas", {
|
|
137
|
+
width: H,
|
|
138
138
|
height: L,
|
|
139
139
|
ref_key: "cursorCvs",
|
|
140
140
|
ref: h
|
|
141
141
|
}, null, 512)
|
|
142
142
|
], 36));
|
|
143
143
|
}
|
|
144
|
-
}),
|
|
144
|
+
}), Q = (p, r) => {
|
|
145
145
|
const m = p.__vccOpts || p;
|
|
146
|
-
for (const [f, h] of
|
|
146
|
+
for (const [f, h] of r)
|
|
147
147
|
m[f] = h;
|
|
148
148
|
return m;
|
|
149
|
-
}, De = /* @__PURE__ */
|
|
150
|
-
function
|
|
149
|
+
}, De = /* @__PURE__ */ Q(be, [["__scopeId", "data-v-505caf85"]]);
|
|
150
|
+
function ae(p) {
|
|
151
151
|
return /^#([0-9A-F]{3}){1,2}$/i.test(p);
|
|
152
152
|
}
|
|
153
153
|
function ce(p) {
|
|
154
|
-
const
|
|
154
|
+
const r = b(!1), m = b("#ff0000"), f = K(() => {
|
|
155
155
|
let x = {};
|
|
156
|
-
return
|
|
156
|
+
return r.value || (x.boxShadow = "none"), p.entryStyles && Object.assign(x, p.entryStyles), r.value && (x.transition = "0s", Object.assign(x, p.entryActiveStyles)), x.backgroundColor = m.value, p.pos === "right" ? x.right = "0px" : x.left = "0px", x;
|
|
157
157
|
});
|
|
158
158
|
function h() {
|
|
159
|
-
|
|
159
|
+
r.value = !1;
|
|
160
160
|
}
|
|
161
161
|
let c = 0;
|
|
162
162
|
function v() {
|
|
163
|
-
if (p.entryRespondDelay && (window.clearTimeout(c), !
|
|
163
|
+
if (p.entryRespondDelay && (window.clearTimeout(c), !r.value)) {
|
|
164
164
|
c = window.setTimeout(() => {
|
|
165
|
-
|
|
165
|
+
r.value = !0;
|
|
166
166
|
}, p.entryRespondDelay);
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
r.value = !r.value;
|
|
170
170
|
}
|
|
171
|
-
return { hexValue: m, panelShow:
|
|
171
|
+
return { hexValue: m, panelShow: r, closePanel: h, togglePanel: v, entryStylesActual: f };
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function le() {
|
|
174
174
|
window.alert("https://www.npmjs.com/package/@aurouscia/au-color-picker");
|
|
175
175
|
}
|
|
176
176
|
const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams" }, Te = {
|
|
@@ -182,7 +182,7 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
182
182
|
}, Ae = ["value"], $e = ["value"], Ee = ["value"], Ve = {
|
|
183
183
|
key: 2,
|
|
184
184
|
class: "acpTripleInputs"
|
|
185
|
-
}, qe = ["value"], Le = ["value"], Oe = ["value"], Ue = { class: "acpDoneBtn" }, ze = /* @__PURE__ */
|
|
185
|
+
}, qe = ["value"], Le = ["value"], Oe = ["value"], Ue = { class: "acpDoneBtn" }, ze = /* @__PURE__ */ J({
|
|
186
186
|
__name: "AuColorPicker",
|
|
187
187
|
props: {
|
|
188
188
|
initial: {},
|
|
@@ -196,18 +196,18 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
196
196
|
showPackageName: { type: Boolean }
|
|
197
197
|
},
|
|
198
198
|
emits: ["change", "done"],
|
|
199
|
-
setup(p, { expose:
|
|
200
|
-
const f = p, h = b(), { hexValue: c, panelShow: v, closePanel: x, togglePanel: E, entryStylesActual:
|
|
199
|
+
setup(p, { expose: r, emit: m }) {
|
|
200
|
+
const f = p, h = b(), { hexValue: c, panelShow: v, closePanel: x, togglePanel: E, entryStylesActual: T } = ce(f);
|
|
201
201
|
function z(y) {
|
|
202
202
|
c.value = e(y), g();
|
|
203
203
|
}
|
|
204
|
-
const P = b("hex"),
|
|
204
|
+
const P = b("hex"), D = K(() => A.hex.rgb(c.value)), w = K(() => A.hex.hsv(c.value));
|
|
205
205
|
function _(y) {
|
|
206
206
|
var n;
|
|
207
207
|
const t = y.target;
|
|
208
208
|
if ("value" in t) {
|
|
209
209
|
const B = t.value;
|
|
210
|
-
if (B &&
|
|
210
|
+
if (B && ae(B)) {
|
|
211
211
|
c.value = e(B), (n = h.value) == null || n.enforceTo(c.value), g();
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
@@ -225,14 +225,14 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
225
225
|
n.value = "0";
|
|
226
226
|
else {
|
|
227
227
|
u > 255 ? u = 255 : u < 0 && (u = 0);
|
|
228
|
-
const S = [...
|
|
228
|
+
const S = [...D.value];
|
|
229
229
|
t == "r" ? S[0] = u : t == "g" ? S[1] = u : S[2] = u, c.value = e(A.rgb.hex(S)), (B = h.value) == null || B.enforceTo(c.value), n.value = u.toString(), g();
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function l(y, t) {
|
|
236
236
|
var B;
|
|
237
237
|
const n = y.target;
|
|
238
238
|
if ("value" in n) {
|
|
@@ -259,26 +259,26 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
259
259
|
function V() {
|
|
260
260
|
return c.value;
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
f.initial &&
|
|
262
|
+
ie(() => {
|
|
263
|
+
f.initial && ae(f.initial) && (c.value = e(f.initial));
|
|
264
264
|
});
|
|
265
265
|
const W = m;
|
|
266
|
-
return
|
|
266
|
+
return r({ closePanel: x, getCurrentHex: V }), re(v, (y) => {
|
|
267
267
|
y === !1 && W("done", c.value);
|
|
268
|
-
}), (y, t) => (
|
|
269
|
-
|
|
268
|
+
}), (y, t) => (N(), R("div", He, [
|
|
269
|
+
i("div", {
|
|
270
270
|
class: he(y.entryClassName || "acpEntry"),
|
|
271
|
-
style: U(C(
|
|
271
|
+
style: U(C(T)),
|
|
272
272
|
onClick: t[0] || (t[0] = //@ts-ignore
|
|
273
273
|
(...n) => C(E) && C(E)(...n))
|
|
274
274
|
}, null, 6),
|
|
275
|
-
C(v) ? (
|
|
275
|
+
C(v) ? (N(), R("div", {
|
|
276
276
|
key: 0,
|
|
277
277
|
class: "acpPanel",
|
|
278
278
|
style: U({ zIndex: (y.panelBaseZIndex || 0) + 100 }),
|
|
279
279
|
onClick: t[10] || (t[10] = (n) => y.panelClickStopPropagation && n.stopPropagation())
|
|
280
280
|
}, [
|
|
281
|
-
|
|
281
|
+
i("div", Ne, [
|
|
282
282
|
ue(De, {
|
|
283
283
|
ref_key: "ring",
|
|
284
284
|
ref: h,
|
|
@@ -287,67 +287,67 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
287
287
|
"show-package-name": y.showPackageName
|
|
288
288
|
}, null, 8, ["initial-hex", "show-package-name"])
|
|
289
289
|
]),
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
i("div", Re, [
|
|
291
|
+
Y(i("select", {
|
|
292
292
|
"onUpdate:modelValue": t[1] || (t[1] = (n) => P.value = n)
|
|
293
293
|
}, t[11] || (t[11] = [
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
294
|
+
i("option", { value: "hex" }, "HEX", -1),
|
|
295
|
+
i("option", { value: "rgb" }, "RGB", -1),
|
|
296
|
+
i("option", { value: "hsv" }, "HSV", -1)
|
|
297
297
|
]), 512), [
|
|
298
298
|
[xe, P.value]
|
|
299
299
|
]),
|
|
300
|
-
P.value == "hex" ? (
|
|
301
|
-
|
|
300
|
+
P.value == "hex" ? (N(), R("div", Te, [
|
|
301
|
+
i("input", {
|
|
302
302
|
value: C(c),
|
|
303
303
|
onBlur: _,
|
|
304
304
|
spellcheck: "false",
|
|
305
305
|
maxlength: "7"
|
|
306
306
|
}, null, 40, _e)
|
|
307
|
-
])) : P.value == "rgb" ? (
|
|
308
|
-
|
|
309
|
-
value:
|
|
307
|
+
])) : P.value == "rgb" ? (N(), R("div", Me, [
|
|
308
|
+
i("input", {
|
|
309
|
+
value: D.value[0],
|
|
310
310
|
onBlur: t[2] || (t[2] = (n) => I(n, "r"))
|
|
311
311
|
}, null, 40, Ae),
|
|
312
|
-
|
|
313
|
-
value:
|
|
312
|
+
i("input", {
|
|
313
|
+
value: D.value[1],
|
|
314
314
|
onBlur: t[3] || (t[3] = (n) => I(n, "g"))
|
|
315
315
|
}, null, 40, $e),
|
|
316
|
-
|
|
317
|
-
value:
|
|
316
|
+
i("input", {
|
|
317
|
+
value: D.value[2],
|
|
318
318
|
onBlur: t[4] || (t[4] = (n) => I(n, "b"))
|
|
319
319
|
}, null, 40, Ee)
|
|
320
|
-
])) : (
|
|
321
|
-
|
|
320
|
+
])) : (N(), R("div", Ve, [
|
|
321
|
+
i("input", {
|
|
322
322
|
value: w.value[0],
|
|
323
|
-
onBlur: t[5] || (t[5] = (n) =>
|
|
323
|
+
onBlur: t[5] || (t[5] = (n) => l(n, "h"))
|
|
324
324
|
}, null, 40, qe),
|
|
325
|
-
|
|
325
|
+
i("input", {
|
|
326
326
|
value: w.value[1],
|
|
327
|
-
onBlur: t[6] || (t[6] = (n) =>
|
|
327
|
+
onBlur: t[6] || (t[6] = (n) => l(n, "s"))
|
|
328
328
|
}, null, 40, Le),
|
|
329
|
-
|
|
329
|
+
i("input", {
|
|
330
330
|
value: w.value[2],
|
|
331
|
-
onBlur: t[7] || (t[7] = (n) =>
|
|
331
|
+
onBlur: t[7] || (t[7] = (n) => l(n, "v"))
|
|
332
332
|
}, null, 40, Oe)
|
|
333
333
|
]))
|
|
334
334
|
]),
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
i("div", Ue, [
|
|
336
|
+
i("button", {
|
|
337
337
|
onClick: t[8] || (t[8] = //@ts-ignore
|
|
338
338
|
(...n) => C(x) && C(x)(...n))
|
|
339
339
|
}, "OK")
|
|
340
340
|
]),
|
|
341
|
-
y.showPackageName ? (
|
|
341
|
+
y.showPackageName ? (N(), R("div", {
|
|
342
342
|
key: 0,
|
|
343
343
|
class: "acpPackageName",
|
|
344
344
|
onClick: t[9] || (t[9] = //@ts-ignore
|
|
345
|
-
(...n) => C(
|
|
346
|
-
}, " au-color-picker ")) :
|
|
347
|
-
], 4)) :
|
|
345
|
+
(...n) => C(le) && C(le)(...n))
|
|
346
|
+
}, " au-color-picker ")) : G("", !0)
|
|
347
|
+
], 4)) : G("", !0)
|
|
348
348
|
]));
|
|
349
349
|
}
|
|
350
|
-
}), We = /* @__PURE__ */
|
|
350
|
+
}), We = /* @__PURE__ */ Q(ze, [["__scopeId", "data-v-8b7f17ad"]]), Ze = { class: "acp" }, je = { class: "acpNamedPresets" }, Xe = { for: "acpColorPresetCustom" }, Fe = ["for"], Ke = ["id", "value", "onClick"], Ye = { class: "acpPresetName" }, Ge = { class: "acpDoneBtn" }, Je = /* @__PURE__ */ J({
|
|
351
351
|
__name: "AuColorPickerPresetsNested",
|
|
352
352
|
props: {
|
|
353
353
|
initialSelectedPreset: {},
|
|
@@ -363,43 +363,41 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
363
363
|
showPackageName: { type: Boolean }
|
|
364
364
|
},
|
|
365
365
|
emits: ["change", "done", "presetSwitched"],
|
|
366
|
-
setup(p, { expose:
|
|
367
|
-
const f = p, { hexValue: h, panelShow: c, closePanel: v, togglePanel: x, entryStylesActual: E } = ce(f),
|
|
368
|
-
function
|
|
369
|
-
|
|
366
|
+
setup(p, { expose: r, emit: m }) {
|
|
367
|
+
const f = p, { hexValue: h, panelShow: c, closePanel: v, togglePanel: x, entryStylesActual: E } = ce(f), T = b(), z = b(), P = b("#ff0000");
|
|
368
|
+
function D(l, e) {
|
|
369
|
+
l ? (T.value = l.name, h.value = l.colorHex) : (T.value = void 0, h.value = P.value), e || w("presetSwitched", l == null ? void 0 : l.name);
|
|
370
370
|
}
|
|
371
371
|
const w = m;
|
|
372
|
-
function _(
|
|
373
|
-
h.value =
|
|
372
|
+
function _(l) {
|
|
373
|
+
h.value = l, P.value = l, w("change", l);
|
|
374
374
|
}
|
|
375
|
-
function I(
|
|
376
|
-
h.value =
|
|
375
|
+
function I(l) {
|
|
376
|
+
h.value = l, P.value = l, v();
|
|
377
377
|
}
|
|
378
|
-
return
|
|
379
|
-
|
|
380
|
-
}),
|
|
381
|
-
|
|
382
|
-
}), re(() => {
|
|
383
|
-
var r;
|
|
378
|
+
return r({ closePanel: v }), re(c, (l) => {
|
|
379
|
+
l === !1 && w("done", h.value);
|
|
380
|
+
}), ie(() => {
|
|
381
|
+
var l;
|
|
384
382
|
if (f.initial && (h.value = f.initial, P.value = f.initial), f.initialSelectedPreset) {
|
|
385
|
-
const e = (
|
|
386
|
-
e &&
|
|
383
|
+
const e = (l = f.presets) == null ? void 0 : l.find((g) => g.name === f.initialSelectedPreset);
|
|
384
|
+
e && D(e, !0);
|
|
387
385
|
}
|
|
388
|
-
}), (
|
|
389
|
-
|
|
386
|
+
}), (l, e) => (N(), R("div", Ze, [
|
|
387
|
+
i("div", {
|
|
390
388
|
class: "acpEntry",
|
|
391
389
|
style: U(C(E)),
|
|
392
390
|
onClick: e[0] || (e[0] = //@ts-ignore
|
|
393
391
|
(...g) => C(x) && C(x)(...g))
|
|
394
392
|
}, null, 4),
|
|
395
|
-
C(c) ? (
|
|
393
|
+
C(c) ? (N(), R("div", {
|
|
396
394
|
key: 0,
|
|
397
395
|
class: "acpPanel",
|
|
398
|
-
style: U({ zIndex: (
|
|
399
|
-
onClick: e[5] || (e[5] = (g) =>
|
|
396
|
+
style: U({ zIndex: (l.panelBaseZIndex || 0) + 100 }),
|
|
397
|
+
onClick: e[5] || (e[5] = (g) => l.panelClickStopPropagation && g.stopPropagation())
|
|
400
398
|
}, [
|
|
401
|
-
|
|
402
|
-
|
|
399
|
+
i("div", je, [
|
|
400
|
+
i("label", Xe, [
|
|
403
401
|
ue(We, {
|
|
404
402
|
initial: P.value,
|
|
405
403
|
onChange: _,
|
|
@@ -407,52 +405,52 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
407
405
|
"entry-class-name": "acpPresetBody",
|
|
408
406
|
ref_key: "customPicker",
|
|
409
407
|
ref: z,
|
|
410
|
-
"show-package-name":
|
|
408
|
+
"show-package-name": l.showPackageName
|
|
411
409
|
}, null, 8, ["initial", "show-package-name"]),
|
|
412
|
-
|
|
410
|
+
Y(i("input", {
|
|
413
411
|
name: "colorType",
|
|
414
412
|
type: "radio",
|
|
415
413
|
id: "acpColorPresetCustom",
|
|
416
414
|
value: void 0,
|
|
417
|
-
"onUpdate:modelValue": e[1] || (e[1] = (g) =>
|
|
418
|
-
onClick: e[2] || (e[2] = (g) =>
|
|
415
|
+
"onUpdate:modelValue": e[1] || (e[1] = (g) => T.value = g),
|
|
416
|
+
onClick: e[2] || (e[2] = (g) => D())
|
|
419
417
|
}, null, 512), [
|
|
420
|
-
[
|
|
418
|
+
[ee, T.value]
|
|
421
419
|
]),
|
|
422
|
-
e[6] || (e[6] =
|
|
420
|
+
e[6] || (e[6] = i("div", { class: "acpPresetName" }, "自定义", -1))
|
|
423
421
|
]),
|
|
424
|
-
e[7] || (e[7] =
|
|
425
|
-
(
|
|
422
|
+
e[7] || (e[7] = i("div", { class: "acpSep" }, null, -1)),
|
|
423
|
+
(N(!0), R(Pe, null, ke(l.presets, (g) => (N(), R("label", {
|
|
426
424
|
for: `acpColorPreset${g.name}`
|
|
427
425
|
}, [
|
|
428
|
-
|
|
426
|
+
i("div", {
|
|
429
427
|
class: "acpPresetBody",
|
|
430
428
|
style: U({ backgroundColor: g.colorHex })
|
|
431
429
|
}, null, 4),
|
|
432
|
-
|
|
430
|
+
Y(i("input", {
|
|
433
431
|
name: "colorType",
|
|
434
432
|
type: "radio",
|
|
435
433
|
id: `acpColorPreset${g.name}`,
|
|
436
434
|
value: g.name,
|
|
437
|
-
"onUpdate:modelValue": e[3] || (e[3] = (V) =>
|
|
438
|
-
onClick: (V) =>
|
|
435
|
+
"onUpdate:modelValue": e[3] || (e[3] = (V) => T.value = V),
|
|
436
|
+
onClick: (V) => D(g)
|
|
439
437
|
}, null, 8, Ke), [
|
|
440
|
-
[
|
|
438
|
+
[ee, T.value]
|
|
441
439
|
]),
|
|
442
|
-
|
|
440
|
+
i("div", Ye, Ce(g.name), 1)
|
|
443
441
|
], 8, Fe))), 256)),
|
|
444
|
-
e[8] || (e[8] =
|
|
442
|
+
e[8] || (e[8] = i("div", { class: "acpSep" }, null, -1))
|
|
445
443
|
]),
|
|
446
|
-
|
|
447
|
-
|
|
444
|
+
i("div", Ge, [
|
|
445
|
+
i("button", {
|
|
448
446
|
onClick: e[4] || (e[4] = //@ts-ignore
|
|
449
447
|
(...g) => C(v) && C(v)(...g))
|
|
450
448
|
}, "OK")
|
|
451
449
|
])
|
|
452
|
-
], 4)) :
|
|
450
|
+
], 4)) : G("", !0)
|
|
453
451
|
]));
|
|
454
452
|
}
|
|
455
|
-
}), tt = /* @__PURE__ */
|
|
453
|
+
}), tt = /* @__PURE__ */ Q(Je, [["__scopeId", "data-v-051cc834"]]);
|
|
456
454
|
export {
|
|
457
455
|
We as AuColorPicker,
|
|
458
456
|
tt as AuColorPickerPresetsNested,
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.acpRingBody[data-v-505caf85]{position:relative}canvas[data-v-505caf85]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}[data-v-8b7f17ad]{margin:0;padding:0}.acpSep[data-v-8b7f17ad]{height:2px;border-radius:100px;flex-grow:0;flex-shrink:0;background-color:#ddd}.acpPresetBody[data-v-8b7f17ad]{width:25px;height:25px;border-radius:1000px;cursor:pointer}.acpDoneBtn[data-v-8b7f17ad]{display:flex;justify-content:center;align-items:center;margin:8px;-webkit-user-select:none;user-select:none}.acpDoneBtn button[data-v-8b7f17ad]{background:none;border:none;font-weight:700;color:gray;font-size:16px;cursor:pointer}.acpDoneBtn button[data-v-8b7f17ad]:hover{color:#000}.acpEntry[data-v-8b7f17ad]{width:30px;height:30px;cursor:pointer;border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff}.acpPanel[data-v-8b7f17ad]{border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff;margin-top:3px;position:absolute}.acp[data-v-8b7f17ad]{position:relative;width:fit-content}.acp label[data-v-8b7f17ad]{-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer}.acp input[type=radio][data-v-8b7f17ad]{cursor:pointer}.acpPackageName[data-v-8b7f17ad]{position:absolute;left:2px;bottom:3px;font-size:8px;color:#ccc;text-align:right;cursor:pointer;-webkit-user-select:none;user-select:none}.acpParams[data-v-8b7f17ad]{display:flex;justify-content:space-between;align-items:center;padding:5px}.acpParams select[data-v-8b7f17ad],.acpParams input[data-v-8b7f17ad]{margin:0;padding:2px;display:block;font-size:16px;box-sizing:border-box;height:24px;line-height:24px}.acpParams select[data-v-8b7f17ad]{-webkit-user-select:none;user-select:none}.acpParams input[data-v-8b7f17ad]{text-align:center}.acpParams .acpSingleInput input[data-v-8b7f17ad]{width:120px}.acpParams .acpTripleInputs[data-v-8b7f17ad]{display:flex;justify-content:space-around}.acpParams .acpTripleInputs input[data-v-8b7f17ad]{width:40px}[data-v-
|
|
1
|
+
.acpRingBody[data-v-505caf85]{position:relative}canvas[data-v-505caf85]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}[data-v-8b7f17ad]{margin:0;padding:0}.acpSep[data-v-8b7f17ad]{height:2px;border-radius:100px;flex-grow:0;flex-shrink:0;background-color:#ddd}.acpPresetBody[data-v-8b7f17ad]{width:25px;height:25px;border-radius:1000px;cursor:pointer}.acpDoneBtn[data-v-8b7f17ad]{display:flex;justify-content:center;align-items:center;margin:8px;-webkit-user-select:none;user-select:none}.acpDoneBtn button[data-v-8b7f17ad]{background:none;border:none;font-weight:700;color:gray;font-size:16px;cursor:pointer}.acpDoneBtn button[data-v-8b7f17ad]:hover{color:#000}.acpEntry[data-v-8b7f17ad]{width:30px;height:30px;cursor:pointer;border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff}.acpPanel[data-v-8b7f17ad]{border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff;margin-top:3px;position:absolute}.acp[data-v-8b7f17ad]{position:relative;width:fit-content}.acp label[data-v-8b7f17ad]{-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer}.acp input[type=radio][data-v-8b7f17ad]{cursor:pointer}.acpPackageName[data-v-8b7f17ad]{position:absolute;left:2px;bottom:3px;font-size:8px;color:#ccc;text-align:right;cursor:pointer;-webkit-user-select:none;user-select:none}.acpParams[data-v-8b7f17ad]{display:flex;justify-content:space-between;align-items:center;padding:5px}.acpParams select[data-v-8b7f17ad],.acpParams input[data-v-8b7f17ad]{margin:0;padding:2px;display:block;font-size:16px;box-sizing:border-box;height:24px;line-height:24px}.acpParams select[data-v-8b7f17ad]{-webkit-user-select:none;user-select:none}.acpParams input[data-v-8b7f17ad]{text-align:center}.acpParams .acpSingleInput input[data-v-8b7f17ad]{width:120px}.acpParams .acpTripleInputs[data-v-8b7f17ad]{display:flex;justify-content:space-around}.acpParams .acpTripleInputs input[data-v-8b7f17ad]{width:40px}[data-v-051cc834]{margin:0;padding:0}.acpSep[data-v-051cc834]{height:2px;border-radius:100px;flex-grow:0;flex-shrink:0;background-color:#ddd}.acpPresetBody[data-v-051cc834]{width:25px;height:25px;border-radius:1000px;cursor:pointer}.acpDoneBtn[data-v-051cc834]{display:flex;justify-content:center;align-items:center;margin:8px;-webkit-user-select:none;user-select:none}.acpDoneBtn button[data-v-051cc834]{background:none;border:none;font-weight:700;color:gray;font-size:16px;cursor:pointer}.acpDoneBtn button[data-v-051cc834]:hover{color:#000}.acpEntry[data-v-051cc834]{width:30px;height:30px;cursor:pointer;border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff}.acpPanel[data-v-051cc834]{border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff;margin-top:3px;position:absolute}.acp[data-v-051cc834]{position:relative;width:fit-content}.acp label[data-v-051cc834]{-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer}.acp input[type=radio][data-v-051cc834]{cursor:pointer}.acpNamedPresets[data-v-051cc834]{margin:5px;display:flex;flex-direction:column;gap:4px}.acpNamedPresets[data-v-051cc834]>*{display:flex;justify-content:flex-start;align-items:center;gap:5px}.acpNamedPresets>* .acpPresetName[data-v-051cc834]{color:#666}.acpNamedPresets>* .acpPresetName[data-v-051cc834]:hover{color:#000}
|