@aurouscia/au-color-picker 0.4.3 → 0.4.4
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/README.md +12 -0
- package/dist/au-color-picker.css +1 -0
- package/dist/au-color-picker.es.js +294 -278
- package/dist/types/components/AuColorPicker.vue.d.ts +30 -1
- package/dist/types/components/AuColorPickerPresetsNested.vue.d.ts +57 -1
- package/dist/types/components/AuColorPickerRing.vue.d.ts +9 -7
- package/package.json +6 -6
- package/dist/style.css +0 -1
package/README.md
CHANGED
|
@@ -48,6 +48,18 @@ const presets:NamedPreset[] = [
|
|
|
48
48
|
></AuColorPickerPresetsNested>
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
### 覆盖当前值
|
|
52
|
+
覆盖值并不会触发回调
|
|
53
|
+
```ts
|
|
54
|
+
const picker = ref<InstanceType<typeof AuColorPicker>>()
|
|
55
|
+
const pickerNested = ref<InstanceType<typeof AuColorPickerPresetsNested>>()
|
|
56
|
+
function enforceToDemo(){
|
|
57
|
+
picker.value?.enforceTo('#ff00ff')
|
|
58
|
+
pickerNested.value?.enforceCustomValueTo('#ff00ff')
|
|
59
|
+
pickerNested.value?.enforcePresetTo('水系')
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
51
63
|
### 组件属性定义
|
|
52
64
|
```ts
|
|
53
65
|
//AuColorPicker的属性
|
|
@@ -0,0 +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-0a96d036]{margin:0;padding:0}.acpSep[data-v-0a96d036]{height:2px;border-radius:100px;flex-grow:0;flex-shrink:0;background-color:#ddd}.acpPresetBody[data-v-0a96d036]{width:25px;height:25px;border-radius:1000px;cursor:pointer}.acpDoneBtn[data-v-0a96d036]{display:flex;justify-content:center;align-items:center;margin:8px;-webkit-user-select:none;user-select:none}.acpDoneBtn button[data-v-0a96d036]{background:none;border:none;font-weight:700;color:gray;font-size:16px;cursor:pointer}.acpDoneBtn button[data-v-0a96d036]:hover{color:#000}.acpEntry[data-v-0a96d036]{width:30px;height:30px;cursor:pointer;border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff}.acpPanel[data-v-0a96d036]{border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff;margin-top:3px;position:absolute}.acp[data-v-0a96d036]{position:relative;width:fit-content}.acp label[data-v-0a96d036]{-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer}.acp input[type=radio][data-v-0a96d036]{cursor:pointer}.acpPackageName[data-v-0a96d036]{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-0a96d036]{display:flex;justify-content:space-between;align-items:center;padding:5px}.acpParams select[data-v-0a96d036],.acpParams input[data-v-0a96d036]{margin:0;padding:2px;display:block;font-size:16px;box-sizing:border-box;height:24px;line-height:24px}.acpParams select[data-v-0a96d036]{-webkit-user-select:none;user-select:none}.acpParams input[data-v-0a96d036]{text-align:center}.acpParams .acpSingleInput input[data-v-0a96d036]{width:120px}.acpParams .acpTripleInputs[data-v-0a96d036]{display:flex;justify-content:space-around}.acpParams .acpTripleInputs input[data-v-0a96d036]{width:40px}[data-v-2772e845]{margin:0;padding:0}.acpSep[data-v-2772e845]{height:2px;border-radius:100px;flex-grow:0;flex-shrink:0;background-color:#ddd}.acpPresetBody[data-v-2772e845]{width:25px;height:25px;border-radius:1000px;cursor:pointer}.acpDoneBtn[data-v-2772e845]{display:flex;justify-content:center;align-items:center;margin:8px;-webkit-user-select:none;user-select:none}.acpDoneBtn button[data-v-2772e845]{background:none;border:none;font-weight:700;color:gray;font-size:16px;cursor:pointer}.acpDoneBtn button[data-v-2772e845]:hover{color:#000}.acpEntry[data-v-2772e845]{width:30px;height:30px;cursor:pointer;border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff}.acpPanel[data-v-2772e845]{border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff;margin-top:3px;position:absolute}.acp[data-v-2772e845]{position:relative;width:fit-content}.acp label[data-v-2772e845]{-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer}.acp input[type=radio][data-v-2772e845]{cursor:pointer}.acpNamedPresets[data-v-2772e845]{margin:5px;display:flex;flex-direction:column;gap:4px}.acpNamedPresets[data-v-2772e845]>*{display:flex;justify-content:flex-start;align-items:center;gap:5px}.acpNamedPresets>* .acpPresetName[data-v-2772e845]{color:#666}.acpNamedPresets>* .acpPresetName[data-v-2772e845]:hover{color:#000}
|
|
@@ -1,188 +1,191 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
return
|
|
1
|
+
import { defineComponent as ee, ref as D, onMounted as ye, onUnmounted as me, openBlock as R, createElementBlock as _, normalizeStyle as Z, isRef as he, createElementVNode as i, computed as Y, onBeforeMount as re, watch as ue, normalizeClass as xe, unref as w, createVNode as ce, withDirectives as G, vModelSelect as Pe, createCommentVNode as J, vModelRadio as ne, Fragment as ke, renderList as Ce, toDisplayString as we } from "vue";
|
|
2
|
+
import E from "color-convert";
|
|
3
|
+
function Se(r, u) {
|
|
4
|
+
const x = r.x - u.x, y = r.y - u.y;
|
|
5
|
+
return x ** 2 + y ** 2;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
return Math.atan2(
|
|
7
|
+
function Ie(r, u) {
|
|
8
|
+
const x = r.x - u.x, y = r.y - u.y;
|
|
9
|
+
return Math.atan2(y, x);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
for (;
|
|
14
|
-
|
|
15
|
-
return { y:
|
|
11
|
+
function Be(r) {
|
|
12
|
+
let u = r, x = 0, y = 0;
|
|
13
|
+
for (; u !== null; )
|
|
14
|
+
x += u.offsetTop, y += u.offsetLeft, u = u.offsetParent;
|
|
15
|
+
return { y: x, x: y };
|
|
16
16
|
}
|
|
17
|
-
const H = 400,
|
|
17
|
+
const H = 400, U = 400, K = 200, Te = 200, oe = 190, se = 150, z = 200, ae = 16, le = 3, be = /* @__PURE__ */ ee({
|
|
18
18
|
__name: "AuColorPickerRing",
|
|
19
19
|
props: {
|
|
20
20
|
initialHex: {}
|
|
21
21
|
},
|
|
22
22
|
emits: ["changed"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
function
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
23
|
+
setup(r, { expose: u, emit: x }) {
|
|
24
|
+
const y = D(), h = D();
|
|
25
|
+
let v, f;
|
|
26
|
+
const P = { x: 199, y: 199 }, V = (oe + se) / 2, N = oe ** 2, L = se ** 2, k = (H - z) / 2, B = k + z, S = D(0), M = D(100), T = D(100), A = r;
|
|
27
|
+
let m;
|
|
28
|
+
function l() {
|
|
29
|
+
var s, p;
|
|
30
|
+
const n = (s = y.value) == null ? void 0 : s.getContext("2d"), o = (p = h.value) == null ? void 0 : p.getContext("2d");
|
|
31
|
+
if (!n || !o)
|
|
32
32
|
throw Error("canvas context getting error");
|
|
33
|
-
if (
|
|
34
|
-
const
|
|
35
|
-
|
|
33
|
+
if (A.initialHex) {
|
|
34
|
+
const C = E.hex.hsv(A.initialHex);
|
|
35
|
+
S.value = C[0], M.value = C[1], T.value = C[2];
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
v = n, f = o, m = v.getImageData(0, 0, H, U), a(), e(), F(), v.putImageData(m, 0, 0);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
for (let
|
|
41
|
-
for (let
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
|
|
39
|
+
function a() {
|
|
40
|
+
for (let n = 0; n < H; n++)
|
|
41
|
+
for (let o = 0; o < U; o++) {
|
|
42
|
+
const s = { x: n, y: o };
|
|
43
|
+
if (g(s)) {
|
|
44
|
+
const p = s.y * H * 4 + s.x * 4, C = d(s), q = E.hsv.rgb([C, 100, 100]);
|
|
45
|
+
m.data[p] = q[0], m.data[p + 1] = q[1], m.data[p + 2] = q[2], m.data[p + 3] = 255;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return 360 * ((
|
|
49
|
+
function d(n) {
|
|
50
|
+
return 360 * ((Ie(n, P) + Math.PI) / (2 * Math.PI));
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
return
|
|
52
|
+
function g(n) {
|
|
53
|
+
const o = Se(P, n);
|
|
54
|
+
return o > L && o < N;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
for (let
|
|
58
|
-
for (let
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
|
|
56
|
+
function e() {
|
|
57
|
+
for (let n = 0; n < H; n++)
|
|
58
|
+
for (let o = 0; o < U; o++) {
|
|
59
|
+
const s = { x: n, y: o };
|
|
60
|
+
if (b(s)) {
|
|
61
|
+
const p = s.y * H * 4 + s.x * 4, { s: C, v: q } = t(s), O = E.hsv.rgb([S.value, C, q]);
|
|
62
|
+
m.data[p] = O[0], m.data[p + 1] = O[1], m.data[p + 2] = O[2], m.data[p + 3] = 255;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
function n
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
return
|
|
66
|
+
function t(n) {
|
|
67
|
+
const o = n.x - k, s = n.y - k;
|
|
68
|
+
let p = o / z, C = 1 - s / z;
|
|
69
|
+
return p > 1 ? p = 1 : p < 0 && (p = 0), C > 1 ? C = 1 : C < 0 && (C = 0), { s: 100 * p, v: 100 * C };
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return !(
|
|
71
|
+
function b(n) {
|
|
72
|
+
return !(n.x < k || n.x > B || n.y < k || n.y > B);
|
|
73
73
|
}
|
|
74
|
-
let
|
|
75
|
-
function
|
|
76
|
-
if (
|
|
74
|
+
let $ = !1, c = "none", I = !1;
|
|
75
|
+
function X(n, o) {
|
|
76
|
+
if ($ || o && !I)
|
|
77
77
|
return;
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
78
|
+
$ = !0;
|
|
79
|
+
const s = fe(n);
|
|
80
|
+
if (c === "none" && (b(s) ? c = "square" : g(s) && (c = "ring")), c === "ring" && (n.preventDefault(), S.value = d(s), e(), v.putImageData(m, 0, 0)), c === "square") {
|
|
81
|
+
n.preventDefault();
|
|
82
|
+
const p = t(s);
|
|
83
|
+
M.value = p.s, T.value = p.v;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
c !== "none" && F(!0), $ = !1;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
87
|
+
function j() {
|
|
88
|
+
c = "none", I = !1;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
let
|
|
92
|
-
if ("touches" in
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
90
|
+
function fe(n) {
|
|
91
|
+
let o, s;
|
|
92
|
+
if ("touches" in n) {
|
|
93
|
+
o = n.touches[0].pageX, s = n.touches[0].pageY;
|
|
94
|
+
const p = Be(y.value);
|
|
95
|
+
o -= p.x, s -= p.y;
|
|
96
96
|
} else
|
|
97
|
-
|
|
98
|
-
return
|
|
97
|
+
o = n.offsetX, s = n.offsetY;
|
|
98
|
+
return o = o * H / K, s = s * H / K, { x: o, y: s };
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
|
|
100
|
+
function F(n) {
|
|
101
|
+
if (n) {
|
|
102
|
+
const ge = E.hsv.hex([S.value, M.value, T.value]);
|
|
103
|
+
pe("changed", ge);
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
105
|
+
const o = (S.value / 360 * 2 + 1) * Math.PI, s = Math.cos(o) * V + H / 2, p = Math.sin(o) * V + U / 2, C = M.value / 100 * z + k, q = (1 - T.value / 100) * z + k;
|
|
106
|
+
f.reset(), f.lineWidth = 4, f.strokeStyle = "black", f.beginPath(), f.arc(s, p, ae - 2, 0, 2 * Math.PI), f.stroke(), f.beginPath(), f.arc(s, p, le, 0, 2 * Math.PI), f.fill();
|
|
107
|
+
const O = T.value > 50 ? "black" : "#ddd";
|
|
108
|
+
f.strokeStyle = O, f.fillStyle = O, f.beginPath(), f.arc(C, q, ae - 2, 0, 2 * Math.PI), f.stroke(), f.beginPath(), f.arc(C, q, le, 0, 2 * Math.PI), f.fill();
|
|
109
109
|
}
|
|
110
|
-
function de(
|
|
111
|
-
const
|
|
112
|
-
|
|
110
|
+
function de(n) {
|
|
111
|
+
const o = E.hex.hsv(n);
|
|
112
|
+
S.value = o[0], M.value = o[1], T.value = o[2], e(), v.putImageData(m, 0, 0), F();
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
return
|
|
116
|
-
|
|
117
|
-
}),
|
|
118
|
-
window.removeEventListener("touchend",
|
|
119
|
-
}), (
|
|
114
|
+
const pe = x;
|
|
115
|
+
return u({ enforceTo: de }), ye(() => {
|
|
116
|
+
l(), window.addEventListener("touchend", j), window.addEventListener("mouseup", j);
|
|
117
|
+
}), me(() => {
|
|
118
|
+
window.removeEventListener("touchend", j), window.removeEventListener("mouseup", j);
|
|
119
|
+
}), (n, o) => (R(), _("div", {
|
|
120
120
|
class: "acpRingBody",
|
|
121
|
-
style:
|
|
122
|
-
onTouchstart:
|
|
123
|
-
onTouchmove:
|
|
124
|
-
onTouchend:
|
|
125
|
-
onMousemove:
|
|
126
|
-
onMousedown:
|
|
127
|
-
|
|
121
|
+
style: Z({ width: K + "px", height: Te + "px" }),
|
|
122
|
+
onTouchstart: X,
|
|
123
|
+
onTouchmove: X,
|
|
124
|
+
onTouchend: j,
|
|
125
|
+
onMousemove: o[0] || (o[0] = (s) => X(s, !0)),
|
|
126
|
+
onMousedown: o[1] || (o[1] = (s) => {
|
|
127
|
+
X(s), he(I) ? I.value = !0 : I = !0;
|
|
128
128
|
})
|
|
129
129
|
}, [
|
|
130
130
|
i("canvas", {
|
|
131
131
|
width: H,
|
|
132
|
-
height:
|
|
132
|
+
height: U,
|
|
133
133
|
ref_key: "cvs",
|
|
134
|
-
ref:
|
|
134
|
+
ref: y
|
|
135
135
|
}, null, 512),
|
|
136
136
|
i("canvas", {
|
|
137
137
|
width: H,
|
|
138
|
-
height:
|
|
138
|
+
height: U,
|
|
139
139
|
ref_key: "cursorCvs",
|
|
140
140
|
ref: h
|
|
141
141
|
}, null, 512)
|
|
142
142
|
], 36));
|
|
143
143
|
}
|
|
144
|
-
}),
|
|
145
|
-
const
|
|
146
|
-
for (const [
|
|
147
|
-
|
|
148
|
-
return
|
|
149
|
-
}, De = /* @__PURE__ */
|
|
150
|
-
function
|
|
151
|
-
return /^#([0-9A-F]{3}){1,2}$/i.test(
|
|
144
|
+
}), te = (r, u) => {
|
|
145
|
+
const x = r.__vccOpts || r;
|
|
146
|
+
for (const [y, h] of u)
|
|
147
|
+
x[y] = h;
|
|
148
|
+
return x;
|
|
149
|
+
}, De = /* @__PURE__ */ te(be, [["__scopeId", "data-v-505caf85"]]);
|
|
150
|
+
function Q(r) {
|
|
151
|
+
return /^#([0-9A-F]{3}){1,2}$/i.test(r);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const
|
|
155
|
-
let
|
|
156
|
-
return
|
|
153
|
+
function ve(r) {
|
|
154
|
+
const u = D(!1), x = D("#ff0000"), y = Y(() => {
|
|
155
|
+
let P = {};
|
|
156
|
+
return u.value || (P.boxShadow = "none"), r.entryStyles && Object.assign(P, r.entryStyles), u.value && (P.transition = "0s", Object.assign(P, r.entryActiveStyles)), P.backgroundColor = x.value, r.pos === "right" ? P.right = "0px" : P.left = "0px", P;
|
|
157
157
|
});
|
|
158
158
|
function h() {
|
|
159
|
-
|
|
159
|
+
u.value = !1;
|
|
160
160
|
}
|
|
161
|
-
let
|
|
162
|
-
function
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
},
|
|
161
|
+
let v = 0;
|
|
162
|
+
function f() {
|
|
163
|
+
if (r.entryRespondDelay && (window.clearTimeout(v), !u.value)) {
|
|
164
|
+
v = window.setTimeout(() => {
|
|
165
|
+
u.value = !0;
|
|
166
|
+
}, r.entryRespondDelay);
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
u.value = !u.value;
|
|
170
170
|
}
|
|
171
|
-
return { hexValue:
|
|
171
|
+
return { hexValue: x, panelShow: u, closePanel: h, togglePanel: f, entryStylesActual: y };
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function ie() {
|
|
174
174
|
window.alert("https://www.npmjs.com/package/@aurouscia/au-color-picker");
|
|
175
175
|
}
|
|
176
|
-
|
|
176
|
+
function W(r) {
|
|
177
|
+
return r.startsWith("#") ? r.toUpperCase() : "#" + r.toUpperCase();
|
|
178
|
+
}
|
|
179
|
+
const Ne = { class: "acp" }, He = { class: "acpRing" }, Re = { class: "acpParams" }, _e = {
|
|
177
180
|
key: 0,
|
|
178
181
|
class: "acpSingleInput"
|
|
179
|
-
},
|
|
182
|
+
}, Me = ["value"], Ae = {
|
|
180
183
|
key: 1,
|
|
181
184
|
class: "acpTripleInputs"
|
|
182
|
-
},
|
|
185
|
+
}, $e = ["value"], Ee = ["value"], qe = ["value"], Ve = {
|
|
183
186
|
key: 2,
|
|
184
187
|
class: "acpTripleInputs"
|
|
185
|
-
},
|
|
188
|
+
}, Le = ["value"], Oe = ["value"], Ue = ["value"], ze = { class: "acpDoneBtn" }, We = /* @__PURE__ */ ee({
|
|
186
189
|
__name: "AuColorPicker",
|
|
187
190
|
props: {
|
|
188
191
|
initial: {},
|
|
@@ -196,158 +199,162 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
196
199
|
showPackageName: { type: Boolean }
|
|
197
200
|
},
|
|
198
201
|
emits: ["change", "done"],
|
|
199
|
-
setup(
|
|
200
|
-
const
|
|
201
|
-
function
|
|
202
|
-
|
|
202
|
+
setup(r, { expose: u, emit: x }) {
|
|
203
|
+
const y = r, h = D(), { hexValue: v, panelShow: f, closePanel: P, togglePanel: V, entryStylesActual: N } = ve(y);
|
|
204
|
+
function L(g) {
|
|
205
|
+
v.value = W(g), m();
|
|
203
206
|
}
|
|
204
|
-
const
|
|
205
|
-
function
|
|
206
|
-
var
|
|
207
|
-
const
|
|
208
|
-
if ("value" in
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
|
|
207
|
+
const k = D("hex"), B = Y(() => E.hex.rgb(v.value)), S = Y(() => E.hex.hsv(v.value));
|
|
208
|
+
function M(g) {
|
|
209
|
+
var t;
|
|
210
|
+
const e = g.target;
|
|
211
|
+
if ("value" in e) {
|
|
212
|
+
const b = e.value;
|
|
213
|
+
if (b && Q(b)) {
|
|
214
|
+
v.value = W(b), (t = h.value) == null || t.enforceTo(v.value), m();
|
|
212
215
|
return;
|
|
213
216
|
}
|
|
214
|
-
|
|
217
|
+
e.value = v.value;
|
|
215
218
|
}
|
|
216
219
|
}
|
|
217
|
-
function
|
|
218
|
-
var
|
|
219
|
-
const
|
|
220
|
-
if ("value" in
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
let
|
|
224
|
-
if (isNaN(
|
|
225
|
-
|
|
220
|
+
function T(g, e) {
|
|
221
|
+
var b;
|
|
222
|
+
const t = g.target;
|
|
223
|
+
if ("value" in t) {
|
|
224
|
+
const $ = t.value;
|
|
225
|
+
if ($) {
|
|
226
|
+
let c = parseInt($);
|
|
227
|
+
if (isNaN(c))
|
|
228
|
+
t.value = "0";
|
|
226
229
|
else {
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
+
c > 255 ? c = 255 : c < 0 && (c = 0);
|
|
231
|
+
const I = [...B.value];
|
|
232
|
+
e == "r" ? I[0] = c : e == "g" ? I[1] = c : I[2] = c, v.value = W(E.rgb.hex(I)), (b = h.value) == null || b.enforceTo(v.value), t.value = c.toString(), m();
|
|
230
233
|
return;
|
|
231
234
|
}
|
|
232
235
|
}
|
|
233
236
|
}
|
|
234
237
|
}
|
|
235
|
-
function
|
|
236
|
-
var
|
|
237
|
-
const
|
|
238
|
-
if ("value" in
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
let
|
|
242
|
-
if (isNaN(
|
|
243
|
-
|
|
238
|
+
function A(g, e) {
|
|
239
|
+
var b;
|
|
240
|
+
const t = g.target;
|
|
241
|
+
if ("value" in t) {
|
|
242
|
+
const $ = t.value;
|
|
243
|
+
if ($) {
|
|
244
|
+
let c = parseInt($);
|
|
245
|
+
if (isNaN(c))
|
|
246
|
+
t.value = "0";
|
|
244
247
|
else {
|
|
245
|
-
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
+
e === "h" ? c > 359 && (c = 359) : c > 100 && (c = 100), c < 0 && (c = 0);
|
|
249
|
+
const I = [...S.value];
|
|
250
|
+
e == "h" ? I[0] = c : e == "s" ? I[1] = c : I[2] = c, v.value = W(E.hsv.hex(I)), t.value = c.toString(), (b = h.value) == null || b.enforceTo(v.value), m();
|
|
248
251
|
return;
|
|
249
252
|
}
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
}
|
|
253
|
-
function
|
|
254
|
-
|
|
256
|
+
function m() {
|
|
257
|
+
d("change", v.value);
|
|
255
258
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
259
|
+
function l() {
|
|
260
|
+
return v.value;
|
|
258
261
|
}
|
|
259
|
-
function
|
|
260
|
-
|
|
262
|
+
function a(g) {
|
|
263
|
+
var e;
|
|
264
|
+
if (Q(g)) {
|
|
265
|
+
const t = W(g);
|
|
266
|
+
v.value = t, (e = h.value) == null || e.enforceTo(t);
|
|
267
|
+
}
|
|
261
268
|
}
|
|
262
|
-
|
|
263
|
-
|
|
269
|
+
re(() => {
|
|
270
|
+
y.initial && a(y.initial);
|
|
264
271
|
});
|
|
265
|
-
const
|
|
266
|
-
return
|
|
267
|
-
|
|
268
|
-
}), (
|
|
272
|
+
const d = x;
|
|
273
|
+
return u({ closePanel: P, getCurrentHex: l, enforceTo: a }), ue(f, (g) => {
|
|
274
|
+
g === !1 && d("done", v.value);
|
|
275
|
+
}), (g, e) => (R(), _("div", Ne, [
|
|
269
276
|
i("div", {
|
|
270
|
-
class:
|
|
271
|
-
style:
|
|
272
|
-
onClick:
|
|
273
|
-
(...
|
|
277
|
+
class: xe(g.entryClassName || "acpEntry"),
|
|
278
|
+
style: Z(w(N)),
|
|
279
|
+
onClick: e[0] || (e[0] = //@ts-ignore
|
|
280
|
+
(...t) => w(V) && w(V)(...t))
|
|
274
281
|
}, null, 6),
|
|
275
|
-
|
|
282
|
+
w(f) ? (R(), _("div", {
|
|
276
283
|
key: 0,
|
|
277
284
|
class: "acpPanel",
|
|
278
|
-
style:
|
|
279
|
-
onClick:
|
|
285
|
+
style: Z({ zIndex: (g.panelBaseZIndex || 0) + 100 }),
|
|
286
|
+
onClick: e[10] || (e[10] = (t) => g.panelClickStopPropagation && t.stopPropagation())
|
|
280
287
|
}, [
|
|
281
|
-
i("div",
|
|
282
|
-
|
|
288
|
+
i("div", He, [
|
|
289
|
+
ce(De, {
|
|
283
290
|
ref_key: "ring",
|
|
284
291
|
ref: h,
|
|
285
|
-
"initial-hex":
|
|
286
|
-
onChanged:
|
|
287
|
-
"show-package-name":
|
|
292
|
+
"initial-hex": w(v),
|
|
293
|
+
onChanged: L,
|
|
294
|
+
"show-package-name": g.showPackageName
|
|
288
295
|
}, null, 8, ["initial-hex", "show-package-name"])
|
|
289
296
|
]),
|
|
290
297
|
i("div", Re, [
|
|
291
|
-
|
|
292
|
-
"onUpdate:modelValue":
|
|
293
|
-
},
|
|
298
|
+
G(i("select", {
|
|
299
|
+
"onUpdate:modelValue": e[1] || (e[1] = (t) => k.value = t)
|
|
300
|
+
}, e[11] || (e[11] = [
|
|
294
301
|
i("option", { value: "hex" }, "HEX", -1),
|
|
295
302
|
i("option", { value: "rgb" }, "RGB", -1),
|
|
296
303
|
i("option", { value: "hsv" }, "HSV", -1)
|
|
297
304
|
]), 512), [
|
|
298
|
-
[
|
|
305
|
+
[Pe, k.value]
|
|
299
306
|
]),
|
|
300
|
-
|
|
307
|
+
k.value == "hex" ? (R(), _("div", _e, [
|
|
301
308
|
i("input", {
|
|
302
|
-
value:
|
|
303
|
-
onBlur:
|
|
309
|
+
value: w(v),
|
|
310
|
+
onBlur: M,
|
|
304
311
|
spellcheck: "false",
|
|
305
312
|
maxlength: "7"
|
|
306
|
-
}, null, 40,
|
|
307
|
-
])) :
|
|
313
|
+
}, null, 40, Me)
|
|
314
|
+
])) : k.value == "rgb" ? (R(), _("div", Ae, [
|
|
308
315
|
i("input", {
|
|
309
|
-
value:
|
|
310
|
-
onBlur:
|
|
311
|
-
}, null, 40, Ae),
|
|
312
|
-
i("input", {
|
|
313
|
-
value: D.value[1],
|
|
314
|
-
onBlur: t[3] || (t[3] = (n) => I(n, "g"))
|
|
316
|
+
value: B.value[0],
|
|
317
|
+
onBlur: e[2] || (e[2] = (t) => T(t, "r"))
|
|
315
318
|
}, null, 40, $e),
|
|
316
319
|
i("input", {
|
|
317
|
-
value:
|
|
318
|
-
onBlur:
|
|
319
|
-
}, null, 40, Ee)
|
|
320
|
-
])) : (N(), R("div", Ve, [
|
|
320
|
+
value: B.value[1],
|
|
321
|
+
onBlur: e[3] || (e[3] = (t) => T(t, "g"))
|
|
322
|
+
}, null, 40, Ee),
|
|
321
323
|
i("input", {
|
|
322
|
-
value:
|
|
323
|
-
onBlur:
|
|
324
|
-
}, null, 40, qe)
|
|
324
|
+
value: B.value[2],
|
|
325
|
+
onBlur: e[4] || (e[4] = (t) => T(t, "b"))
|
|
326
|
+
}, null, 40, qe)
|
|
327
|
+
])) : (R(), _("div", Ve, [
|
|
325
328
|
i("input", {
|
|
326
|
-
value:
|
|
327
|
-
onBlur:
|
|
329
|
+
value: S.value[0],
|
|
330
|
+
onBlur: e[5] || (e[5] = (t) => A(t, "h"))
|
|
328
331
|
}, null, 40, Le),
|
|
329
332
|
i("input", {
|
|
330
|
-
value:
|
|
331
|
-
onBlur:
|
|
332
|
-
}, null, 40, Oe)
|
|
333
|
+
value: S.value[1],
|
|
334
|
+
onBlur: e[6] || (e[6] = (t) => A(t, "s"))
|
|
335
|
+
}, null, 40, Oe),
|
|
336
|
+
i("input", {
|
|
337
|
+
value: S.value[2],
|
|
338
|
+
onBlur: e[7] || (e[7] = (t) => A(t, "v"))
|
|
339
|
+
}, null, 40, Ue)
|
|
333
340
|
]))
|
|
334
341
|
]),
|
|
335
|
-
i("div",
|
|
342
|
+
i("div", ze, [
|
|
336
343
|
i("button", {
|
|
337
|
-
onClick:
|
|
338
|
-
(...
|
|
344
|
+
onClick: e[8] || (e[8] = //@ts-ignore
|
|
345
|
+
(...t) => w(P) && w(P)(...t))
|
|
339
346
|
}, "OK")
|
|
340
347
|
]),
|
|
341
|
-
|
|
348
|
+
g.showPackageName ? (R(), _("div", {
|
|
342
349
|
key: 0,
|
|
343
350
|
class: "acpPackageName",
|
|
344
|
-
onClick:
|
|
345
|
-
(...
|
|
346
|
-
}, " au-color-picker ")) :
|
|
347
|
-
], 4)) :
|
|
351
|
+
onClick: e[9] || (e[9] = //@ts-ignore
|
|
352
|
+
(...t) => w(ie) && w(ie)(...t))
|
|
353
|
+
}, " au-color-picker ")) : J("", !0)
|
|
354
|
+
], 4)) : J("", !0)
|
|
348
355
|
]));
|
|
349
356
|
}
|
|
350
|
-
}),
|
|
357
|
+
}), Ze = /* @__PURE__ */ te(We, [["__scopeId", "data-v-0a96d036"]]), je = { class: "acp" }, Xe = { class: "acpNamedPresets" }, Fe = { for: "acpColorPresetCustom" }, Ke = ["for"], Ye = ["id", "value", "onClick"], Ge = { class: "acpPresetName" }, Je = { class: "acpDoneBtn" }, Qe = /* @__PURE__ */ ee({
|
|
351
358
|
__name: "AuColorPickerPresetsNested",
|
|
352
359
|
props: {
|
|
353
360
|
initialSelectedPreset: {},
|
|
@@ -363,96 +370,105 @@ const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams
|
|
|
363
370
|
showPackageName: { type: Boolean }
|
|
364
371
|
},
|
|
365
372
|
emits: ["change", "done", "presetSwitched"],
|
|
366
|
-
setup(
|
|
367
|
-
const
|
|
368
|
-
function
|
|
369
|
-
l ? (
|
|
373
|
+
setup(r, { expose: u, emit: x }) {
|
|
374
|
+
const y = r, { hexValue: h, panelShow: v, closePanel: f, togglePanel: P, entryStylesActual: V } = ve(y), N = D(), L = D(), k = D("#ff0000");
|
|
375
|
+
function B(l, a) {
|
|
376
|
+
l ? (N.value = l.name, h.value = l.colorHex) : (N.value = void 0, h.value = k.value), a || S("presetSwitched", l == null ? void 0 : l.name);
|
|
370
377
|
}
|
|
371
|
-
const
|
|
372
|
-
function
|
|
373
|
-
h.value = l,
|
|
378
|
+
const S = x;
|
|
379
|
+
function M(l) {
|
|
380
|
+
h.value = l, k.value = l, S("change", l);
|
|
374
381
|
}
|
|
375
|
-
function
|
|
376
|
-
h.value = l,
|
|
382
|
+
function T(l) {
|
|
383
|
+
h.value = l, k.value = l, f();
|
|
377
384
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
const e = (l = f.presets) == null ? void 0 : l.find((g) => g.name === f.initialSelectedPreset);
|
|
384
|
-
e && D(e, !0);
|
|
385
|
+
function A(l) {
|
|
386
|
+
var a;
|
|
387
|
+
if (Q(l)) {
|
|
388
|
+
const d = W(l);
|
|
389
|
+
k.value = d, (a = L.value) == null || a.enforceTo(d), N.value || (h.value = d);
|
|
385
390
|
}
|
|
386
|
-
}
|
|
391
|
+
}
|
|
392
|
+
function m(l) {
|
|
393
|
+
var d;
|
|
394
|
+
l || B(void 0, !0);
|
|
395
|
+
const a = (d = y.presets) == null ? void 0 : d.find((g) => g.name === l);
|
|
396
|
+
a && B(a, !0);
|
|
397
|
+
}
|
|
398
|
+
return u({ closePanel: f, enforceCustomValueTo: A, enforcePresetTo: m }), ue(v, (l) => {
|
|
399
|
+
l === !1 && S("done", h.value);
|
|
400
|
+
}), re(() => {
|
|
401
|
+
y.initial && A(y.initial), y.initialSelectedPreset && m(y.initialSelectedPreset);
|
|
402
|
+
}), (l, a) => (R(), _("div", je, [
|
|
387
403
|
i("div", {
|
|
388
404
|
class: "acpEntry",
|
|
389
|
-
style:
|
|
390
|
-
onClick:
|
|
391
|
-
(...
|
|
405
|
+
style: Z(w(V)),
|
|
406
|
+
onClick: a[0] || (a[0] = //@ts-ignore
|
|
407
|
+
(...d) => w(P) && w(P)(...d))
|
|
392
408
|
}, null, 4),
|
|
393
|
-
|
|
409
|
+
w(v) ? (R(), _("div", {
|
|
394
410
|
key: 0,
|
|
395
411
|
class: "acpPanel",
|
|
396
|
-
style:
|
|
397
|
-
onClick:
|
|
412
|
+
style: Z({ zIndex: (l.panelBaseZIndex || 0) + 100 }),
|
|
413
|
+
onClick: a[5] || (a[5] = (d) => l.panelClickStopPropagation && d.stopPropagation())
|
|
398
414
|
}, [
|
|
399
|
-
i("div",
|
|
400
|
-
i("label",
|
|
401
|
-
|
|
402
|
-
initial:
|
|
403
|
-
onChange:
|
|
404
|
-
onDone:
|
|
415
|
+
i("div", Xe, [
|
|
416
|
+
i("label", Fe, [
|
|
417
|
+
ce(Ze, {
|
|
418
|
+
initial: k.value,
|
|
419
|
+
onChange: M,
|
|
420
|
+
onDone: T,
|
|
405
421
|
"entry-class-name": "acpPresetBody",
|
|
406
422
|
ref_key: "customPicker",
|
|
407
|
-
ref:
|
|
423
|
+
ref: L,
|
|
408
424
|
"show-package-name": l.showPackageName
|
|
409
425
|
}, null, 8, ["initial", "show-package-name"]),
|
|
410
|
-
|
|
426
|
+
G(i("input", {
|
|
411
427
|
name: "colorType",
|
|
412
428
|
type: "radio",
|
|
413
429
|
id: "acpColorPresetCustom",
|
|
414
430
|
value: void 0,
|
|
415
|
-
"onUpdate:modelValue":
|
|
416
|
-
onClick:
|
|
431
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => N.value = d),
|
|
432
|
+
onClick: a[2] || (a[2] = (d) => B())
|
|
417
433
|
}, null, 512), [
|
|
418
|
-
[
|
|
434
|
+
[ne, N.value]
|
|
419
435
|
]),
|
|
420
|
-
|
|
436
|
+
a[6] || (a[6] = i("div", { class: "acpPresetName" }, "自定义", -1))
|
|
421
437
|
]),
|
|
422
|
-
|
|
423
|
-
(
|
|
424
|
-
for: `acpColorPreset${
|
|
438
|
+
a[7] || (a[7] = i("div", { class: "acpSep" }, null, -1)),
|
|
439
|
+
(R(!0), _(ke, null, Ce(l.presets, (d) => (R(), _("label", {
|
|
440
|
+
for: `acpColorPreset${d.name}`
|
|
425
441
|
}, [
|
|
426
442
|
i("div", {
|
|
427
443
|
class: "acpPresetBody",
|
|
428
|
-
style:
|
|
444
|
+
style: Z({ backgroundColor: d.colorHex })
|
|
429
445
|
}, null, 4),
|
|
430
|
-
|
|
446
|
+
G(i("input", {
|
|
431
447
|
name: "colorType",
|
|
432
448
|
type: "radio",
|
|
433
|
-
id: `acpColorPreset${
|
|
434
|
-
value:
|
|
435
|
-
"onUpdate:modelValue":
|
|
436
|
-
onClick: (
|
|
437
|
-
}, null, 8,
|
|
438
|
-
[
|
|
449
|
+
id: `acpColorPreset${d.name}`,
|
|
450
|
+
value: d.name,
|
|
451
|
+
"onUpdate:modelValue": a[3] || (a[3] = (g) => N.value = g),
|
|
452
|
+
onClick: (g) => B(d)
|
|
453
|
+
}, null, 8, Ye), [
|
|
454
|
+
[ne, N.value]
|
|
439
455
|
]),
|
|
440
|
-
i("div",
|
|
441
|
-
], 8,
|
|
442
|
-
|
|
456
|
+
i("div", Ge, we(d.name), 1)
|
|
457
|
+
], 8, Ke))), 256)),
|
|
458
|
+
a[8] || (a[8] = i("div", { class: "acpSep" }, null, -1))
|
|
443
459
|
]),
|
|
444
|
-
i("div",
|
|
460
|
+
i("div", Je, [
|
|
445
461
|
i("button", {
|
|
446
|
-
onClick:
|
|
447
|
-
(...
|
|
462
|
+
onClick: a[4] || (a[4] = //@ts-ignore
|
|
463
|
+
(...d) => w(f) && w(f)(...d))
|
|
448
464
|
}, "OK")
|
|
449
465
|
])
|
|
450
|
-
], 4)) :
|
|
466
|
+
], 4)) : J("", !0)
|
|
451
467
|
]));
|
|
452
468
|
}
|
|
453
|
-
}),
|
|
469
|
+
}), nt = /* @__PURE__ */ te(Qe, [["__scopeId", "data-v-2772e845"]]);
|
|
454
470
|
export {
|
|
455
|
-
|
|
456
|
-
|
|
471
|
+
Ze as AuColorPicker,
|
|
472
|
+
nt as AuColorPickerPresetsNested,
|
|
457
473
|
De as AuColorPickerRing
|
|
458
474
|
};
|
|
@@ -1,13 +1,42 @@
|
|
|
1
|
+
import { HEX } from 'color-convert/conversions';
|
|
1
2
|
import { PickerProps } from './common/pickerProps';
|
|
2
3
|
declare function getCurrentHex(): string;
|
|
4
|
+
declare function enforceTo(newHexValue: string): void;
|
|
3
5
|
declare const _default: import('vue').DefineComponent<PickerProps, {
|
|
4
6
|
closePanel: () => void;
|
|
5
7
|
getCurrentHex: typeof getCurrentHex;
|
|
8
|
+
enforceTo: typeof enforceTo;
|
|
6
9
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
7
10
|
done: (hexStr: string) => any;
|
|
8
11
|
change: (hexStr: string) => any;
|
|
9
12
|
}, string, import('vue').PublicProps, Readonly<PickerProps> & Readonly<{
|
|
10
13
|
onDone?: ((hexStr: string) => any) | undefined;
|
|
11
14
|
onChange?: ((hexStr: string) => any) | undefined;
|
|
12
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
15
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
|
+
ring: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
17
|
+
initialHex?: string;
|
|
18
|
+
}> & Readonly<{
|
|
19
|
+
onChanged?: ((hex: string) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
enforceTo: (hex: HEX) => void;
|
|
22
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
23
|
+
changed: (hex: string) => any;
|
|
24
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
25
|
+
cvs: HTMLCanvasElement;
|
|
26
|
+
cursorCvs: HTMLCanvasElement;
|
|
27
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
28
|
+
P: {};
|
|
29
|
+
B: {};
|
|
30
|
+
D: {};
|
|
31
|
+
C: {};
|
|
32
|
+
M: {};
|
|
33
|
+
Defaults: {};
|
|
34
|
+
}, Readonly<{
|
|
35
|
+
initialHex?: string;
|
|
36
|
+
}> & Readonly<{
|
|
37
|
+
onChanged?: ((hex: string) => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
enforceTo: (hex: HEX) => void;
|
|
40
|
+
}, {}, {}, {}, {}> | null;
|
|
41
|
+
}, HTMLDivElement>;
|
|
13
42
|
export default _default;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { PickerWithPresetsProps } from './common/pickerProps';
|
|
2
|
+
declare function enforceCustomValueTo(newHexValue: string): void;
|
|
3
|
+
declare function enforcePresetTo(name?: string): void;
|
|
2
4
|
declare const _default: import('vue').DefineComponent<PickerWithPresetsProps, {
|
|
3
5
|
closePanel: () => void;
|
|
6
|
+
enforceCustomValueTo: typeof enforceCustomValueTo;
|
|
7
|
+
enforcePresetTo: typeof enforcePresetTo;
|
|
4
8
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
5
9
|
done: (hexStr: string) => any;
|
|
6
10
|
change: (hexStr: string) => any;
|
|
@@ -9,5 +13,57 @@ declare const _default: import('vue').DefineComponent<PickerWithPresetsProps, {
|
|
|
9
13
|
onDone?: ((hexStr: string) => any) | undefined;
|
|
10
14
|
onChange?: ((hexStr: string) => any) | undefined;
|
|
11
15
|
onPresetSwitched?: ((name: string | undefined) => any) | undefined;
|
|
12
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
17
|
+
customPicker: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('..').PickerProps> & Readonly<{
|
|
18
|
+
onDone?: ((hexStr: string) => any) | undefined;
|
|
19
|
+
onChange?: ((hexStr: string) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
closePanel: () => void;
|
|
22
|
+
getCurrentHex: () => string;
|
|
23
|
+
enforceTo: (newHexValue: string) => void;
|
|
24
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
25
|
+
done: (hexStr: string) => any;
|
|
26
|
+
change: (hexStr: string) => any;
|
|
27
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
28
|
+
ring: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
29
|
+
initialHex?: string;
|
|
30
|
+
}> & Readonly<{
|
|
31
|
+
onChanged?: ((hex: string) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
enforceTo: (hex: import('color-convert/conversions').HEX) => void;
|
|
34
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
35
|
+
changed: (hex: string) => any;
|
|
36
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
37
|
+
cvs: HTMLCanvasElement;
|
|
38
|
+
cursorCvs: HTMLCanvasElement;
|
|
39
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
40
|
+
P: {};
|
|
41
|
+
B: {};
|
|
42
|
+
D: {};
|
|
43
|
+
C: {};
|
|
44
|
+
M: {};
|
|
45
|
+
Defaults: {};
|
|
46
|
+
}, Readonly<{
|
|
47
|
+
initialHex?: string;
|
|
48
|
+
}> & Readonly<{
|
|
49
|
+
onChanged?: ((hex: string) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
enforceTo: (hex: import('color-convert/conversions').HEX) => void;
|
|
52
|
+
}, {}, {}, {}, {}> | null;
|
|
53
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
54
|
+
P: {};
|
|
55
|
+
B: {};
|
|
56
|
+
D: {};
|
|
57
|
+
C: {};
|
|
58
|
+
M: {};
|
|
59
|
+
Defaults: {};
|
|
60
|
+
}, Readonly<import('..').PickerProps> & Readonly<{
|
|
61
|
+
onDone?: ((hexStr: string) => any) | undefined;
|
|
62
|
+
onChange?: ((hexStr: string) => any) | undefined;
|
|
63
|
+
}>, {
|
|
64
|
+
closePanel: () => void;
|
|
65
|
+
getCurrentHex: () => string;
|
|
66
|
+
enforceTo: (newHexValue: string) => void;
|
|
67
|
+
}, {}, {}, {}, {}> | null;
|
|
68
|
+
}, HTMLDivElement>;
|
|
13
69
|
export default _default;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { HEX } from 'color-convert/conversions';
|
|
2
|
-
|
|
3
|
-
declare const _default: import('vue').DefineComponent<{
|
|
2
|
+
type __VLS_Props = {
|
|
4
3
|
initialHex?: string;
|
|
5
|
-
}
|
|
4
|
+
};
|
|
5
|
+
declare function enforceTo(hex: HEX): void;
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
6
7
|
enforceTo: typeof enforceTo;
|
|
7
8
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
8
9
|
changed: (hex: string) => any;
|
|
9
|
-
}, string, import('vue').PublicProps, Readonly<{
|
|
10
|
-
initialHex?: string;
|
|
11
|
-
}> & Readonly<{
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
11
|
onChanged?: ((hex: string) => any) | undefined;
|
|
13
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
12
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
13
|
+
cvs: HTMLCanvasElement;
|
|
14
|
+
cursorCvs: HTMLCanvasElement;
|
|
15
|
+
}, HTMLDivElement>;
|
|
14
16
|
export default _default;
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"color",
|
|
15
15
|
"component"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.4.
|
|
17
|
+
"version": "0.4.4",
|
|
18
18
|
"type": "module",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist"
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/color-convert": "^2.0.4",
|
|
44
|
-
"@types/node": "^22.10.
|
|
44
|
+
"@types/node": "^22.10.10",
|
|
45
45
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
46
|
-
"sass": "^1.
|
|
47
|
-
"typescript": "^5.7.
|
|
48
|
-
"vite": "^
|
|
49
|
-
"vite-plugin-dts": "^4.
|
|
46
|
+
"sass": "^1.83.4",
|
|
47
|
+
"typescript": "^5.7.3",
|
|
48
|
+
"vite": "^6.0.11",
|
|
49
|
+
"vite-plugin-dts": "^4.5.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
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}
|