@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 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 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
- import A from "color-convert";
3
- function we(p, r) {
4
- const m = p.x - r.x, f = p.y - r.y;
5
- return m ** 2 + f ** 2;
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 Se(p, r) {
8
- const m = p.x - r.x, f = p.y - r.y;
9
- return Math.atan2(f, m);
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 Ie(p) {
12
- let r = p, m = 0, f = 0;
13
- for (; r !== null; )
14
- m += r.offsetTop, f += r.offsetLeft, r = r.offsetParent;
15
- return { y: m, x: f };
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, L = 400, F = 200, Be = 200, te = 190, ne = 150, O = 200, oe = 16, se = 3, be = /* @__PURE__ */ J({
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(p, { expose: r, emit: m }) {
24
- const f = b(), h = b();
25
- let c, v;
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
- let e;
28
- function g() {
29
- var a, d;
30
- const o = (a = f.value) == null ? void 0 : a.getContext("2d"), s = (d = h.value) == null ? void 0 : d.getContext("2d");
31
- if (!o || !s)
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 (l.initialHex) {
34
- const k = A.hex.hsv(l.initialHex);
35
- w.value = k[0], _.value = k[1], I.value = k[2];
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
- c = o, v = s, e = c.getImageData(0, 0, H, L), V(), t(), X(), c.putImageData(e, 0, 0);
37
+ v = n, f = o, m = v.getImageData(0, 0, H, U), a(), e(), F(), v.putImageData(m, 0, 0);
38
38
  }
39
- function V() {
40
- for (let o = 0; o < H; o++)
41
- for (let s = 0; s < L; s++) {
42
- const a = { x: o, y: s };
43
- if (y(a)) {
44
- const d = a.y * H * 4 + a.x * 4, k = W(a), $ = A.hsv.rgb([k, 100, 100]);
45
- e.data[d] = $[0], e.data[d + 1] = $[1], e.data[d + 2] = $[2], e.data[d + 3] = 255;
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 W(o) {
50
- return 360 * ((Se(o, x) + Math.PI) / (2 * Math.PI));
49
+ function d(n) {
50
+ return 360 * ((Ie(n, P) + Math.PI) / (2 * Math.PI));
51
51
  }
52
- function y(o) {
53
- const s = we(x, o);
54
- return s > z && s < T;
52
+ function g(n) {
53
+ const o = Se(P, n);
54
+ return o > L && o < N;
55
55
  }
56
- function t() {
57
- for (let o = 0; o < H; o++)
58
- for (let s = 0; s < L; s++) {
59
- const a = { x: o, y: s };
60
- if (B(a)) {
61
- const d = a.y * H * 4 + a.x * 4, { s: k, v: $ } = n(a), q = A.hsv.rgb([w.value, k, $]);
62
- e.data[d] = q[0], e.data[d + 1] = q[1], e.data[d + 2] = q[2], e.data[d + 3] = 255;
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(o) {
67
- const s = o.x - P, a = o.y - P;
68
- let d = s / O, k = 1 - a / O;
69
- return d > 1 ? d = 1 : d < 0 && (d = 0), k > 1 ? k = 1 : k < 0 && (k = 0), { s: 100 * d, v: 100 * k };
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 B(o) {
72
- return !(o.x < P || o.x > D || o.y < P || o.y > D);
71
+ function b(n) {
72
+ return !(n.x < k || n.x > B || n.y < k || n.y > B);
73
73
  }
74
- let M = !1, u = "none", S = !1;
75
- function j(o, s) {
76
- if (M || s && !S)
74
+ let $ = !1, c = "none", I = !1;
75
+ function X(n, o) {
76
+ if ($ || o && !I)
77
77
  return;
78
- M = !0;
79
- const a = ve(o);
80
- if (u === "none" && (B(a) ? u = "square" : y(a) && (u = "ring")), u === "ring" && (o.preventDefault(), w.value = W(a), t(), c.putImageData(e, 0, 0)), u === "square") {
81
- o.preventDefault();
82
- const d = n(a);
83
- _.value = d.s, I.value = d.v;
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
- u !== "none" && X(!0), M = !1;
85
+ c !== "none" && F(!0), $ = !1;
86
86
  }
87
- function Z() {
88
- u = "none", S = !1;
87
+ function j() {
88
+ c = "none", I = !1;
89
89
  }
90
- function ve(o) {
91
- let s, a;
92
- if ("touches" in o) {
93
- s = o.touches[0].pageX, a = o.touches[0].pageY;
94
- const d = Ie(f.value);
95
- s -= d.x, a -= d.y;
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
- s = o.offsetX, a = o.offsetY;
98
- return s = s * H / F, a = a * H / F, { x: s, y: a };
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 X(o) {
101
- if (o) {
102
- const pe = A.hsv.hex([w.value, _.value, I.value]);
103
- fe("changed", pe);
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 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
- const q = I.value > 50 ? "black" : "#ddd";
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();
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(o) {
111
- const s = A.hex.hsv(o);
112
- w.value = s[0], _.value = s[1], I.value = s[2], t(), c.putImageData(e, 0, 0), X();
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 fe = m;
115
- return r({ enforceTo: de }), ge(() => {
116
- g(), window.addEventListener("touchend", Z), window.addEventListener("mouseup", Z);
117
- }), ye(() => {
118
- window.removeEventListener("touchend", Z), window.removeEventListener("mouseup", Z);
119
- }), (o, s) => (N(), R("div", {
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: U({ width: F + "px", height: Be + "px" }),
122
- onTouchstart: j,
123
- onTouchmove: j,
124
- onTouchend: Z,
125
- onMousemove: s[0] || (s[0] = (a) => j(a, !0)),
126
- onMousedown: s[1] || (s[1] = (a) => {
127
- j(a), me(S) ? S.value = !0 : S = !0;
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: L,
132
+ height: U,
133
133
  ref_key: "cvs",
134
- ref: f
134
+ ref: y
135
135
  }, null, 512),
136
136
  i("canvas", {
137
137
  width: H,
138
- height: L,
138
+ height: U,
139
139
  ref_key: "cursorCvs",
140
140
  ref: h
141
141
  }, null, 512)
142
142
  ], 36));
143
143
  }
144
- }), Q = (p, r) => {
145
- const m = p.__vccOpts || p;
146
- for (const [f, h] of r)
147
- m[f] = h;
148
- return m;
149
- }, De = /* @__PURE__ */ Q(be, [["__scopeId", "data-v-505caf85"]]);
150
- function ae(p) {
151
- return /^#([0-9A-F]{3}){1,2}$/i.test(p);
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 ce(p) {
154
- const r = b(!1), m = b("#ff0000"), f = K(() => {
155
- let x = {};
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;
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
- r.value = !1;
159
+ u.value = !1;
160
160
  }
161
- let c = 0;
162
- function v() {
163
- if (p.entryRespondDelay && (window.clearTimeout(c), !r.value)) {
164
- c = window.setTimeout(() => {
165
- r.value = !0;
166
- }, p.entryRespondDelay);
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
- r.value = !r.value;
169
+ u.value = !u.value;
170
170
  }
171
- return { hexValue: m, panelShow: r, closePanel: h, togglePanel: v, entryStylesActual: f };
171
+ return { hexValue: x, panelShow: u, closePanel: h, togglePanel: f, entryStylesActual: y };
172
172
  }
173
- function le() {
173
+ function ie() {
174
174
  window.alert("https://www.npmjs.com/package/@aurouscia/au-color-picker");
175
175
  }
176
- const He = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams" }, Te = {
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
- }, _e = ["value"], Me = {
182
+ }, Me = ["value"], Ae = {
180
183
  key: 1,
181
184
  class: "acpTripleInputs"
182
- }, Ae = ["value"], $e = ["value"], Ee = ["value"], Ve = {
185
+ }, $e = ["value"], Ee = ["value"], qe = ["value"], Ve = {
183
186
  key: 2,
184
187
  class: "acpTripleInputs"
185
- }, qe = ["value"], Le = ["value"], Oe = ["value"], Ue = { class: "acpDoneBtn" }, ze = /* @__PURE__ */ J({
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(p, { expose: r, emit: m }) {
200
- const f = p, h = b(), { hexValue: c, panelShow: v, closePanel: x, togglePanel: E, entryStylesActual: T } = ce(f);
201
- function z(y) {
202
- c.value = e(y), g();
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 P = b("hex"), D = K(() => A.hex.rgb(c.value)), w = K(() => A.hex.hsv(c.value));
205
- function _(y) {
206
- var n;
207
- const t = y.target;
208
- if ("value" in t) {
209
- const B = t.value;
210
- if (B && ae(B)) {
211
- c.value = e(B), (n = h.value) == null || n.enforceTo(c.value), g();
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
- t.value = c.value;
217
+ e.value = v.value;
215
218
  }
216
219
  }
217
- function I(y, t) {
218
- var B;
219
- const n = y.target;
220
- if ("value" in n) {
221
- const M = n.value;
222
- if (M) {
223
- let u = parseInt(M);
224
- if (isNaN(u))
225
- n.value = "0";
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
- u > 255 ? u = 255 : u < 0 && (u = 0);
228
- const S = [...D.value];
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
+ 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 l(y, t) {
236
- var B;
237
- const n = y.target;
238
- if ("value" in n) {
239
- const M = n.value;
240
- if (M) {
241
- let u = parseInt(M);
242
- if (isNaN(u))
243
- n.value = "0";
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
- t === "h" ? u > 359 && (u = 359) : u > 100 && (u = 100), u < 0 && (u = 0);
246
- const S = [...w.value];
247
- t == "h" ? S[0] = u : t == "s" ? S[1] = u : S[2] = u, c.value = e(A.hsv.hex(S)), n.value = u.toString(), (B = h.value) == null || B.enforceTo(c.value), g();
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 e(y) {
254
- return y.startsWith("#") ? y.toUpperCase() : "#" + y.toUpperCase();
256
+ function m() {
257
+ d("change", v.value);
255
258
  }
256
- function g() {
257
- W("change", c.value);
259
+ function l() {
260
+ return v.value;
258
261
  }
259
- function V() {
260
- return c.value;
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
- ie(() => {
263
- f.initial && ae(f.initial) && (c.value = e(f.initial));
269
+ re(() => {
270
+ y.initial && a(y.initial);
264
271
  });
265
- const W = m;
266
- return r({ closePanel: x, getCurrentHex: V }), re(v, (y) => {
267
- y === !1 && W("done", c.value);
268
- }), (y, t) => (N(), R("div", He, [
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: he(y.entryClassName || "acpEntry"),
271
- style: U(C(T)),
272
- onClick: t[0] || (t[0] = //@ts-ignore
273
- (...n) => C(E) && C(E)(...n))
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
- C(v) ? (N(), R("div", {
282
+ w(f) ? (R(), _("div", {
276
283
  key: 0,
277
284
  class: "acpPanel",
278
- style: U({ zIndex: (y.panelBaseZIndex || 0) + 100 }),
279
- onClick: t[10] || (t[10] = (n) => y.panelClickStopPropagation && n.stopPropagation())
285
+ style: Z({ zIndex: (g.panelBaseZIndex || 0) + 100 }),
286
+ onClick: e[10] || (e[10] = (t) => g.panelClickStopPropagation && t.stopPropagation())
280
287
  }, [
281
- i("div", Ne, [
282
- ue(De, {
288
+ i("div", He, [
289
+ ce(De, {
283
290
  ref_key: "ring",
284
291
  ref: h,
285
- "initial-hex": C(c),
286
- onChanged: z,
287
- "show-package-name": y.showPackageName
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
- Y(i("select", {
292
- "onUpdate:modelValue": t[1] || (t[1] = (n) => P.value = n)
293
- }, t[11] || (t[11] = [
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
- [xe, P.value]
305
+ [Pe, k.value]
299
306
  ]),
300
- P.value == "hex" ? (N(), R("div", Te, [
307
+ k.value == "hex" ? (R(), _("div", _e, [
301
308
  i("input", {
302
- value: C(c),
303
- onBlur: _,
309
+ value: w(v),
310
+ onBlur: M,
304
311
  spellcheck: "false",
305
312
  maxlength: "7"
306
- }, null, 40, _e)
307
- ])) : P.value == "rgb" ? (N(), R("div", Me, [
313
+ }, null, 40, Me)
314
+ ])) : k.value == "rgb" ? (R(), _("div", Ae, [
308
315
  i("input", {
309
- value: D.value[0],
310
- onBlur: t[2] || (t[2] = (n) => I(n, "r"))
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: D.value[2],
318
- onBlur: t[4] || (t[4] = (n) => I(n, "b"))
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: w.value[0],
323
- onBlur: t[5] || (t[5] = (n) => l(n, "h"))
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: w.value[1],
327
- onBlur: t[6] || (t[6] = (n) => l(n, "s"))
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: w.value[2],
331
- onBlur: t[7] || (t[7] = (n) => l(n, "v"))
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", Ue, [
342
+ i("div", ze, [
336
343
  i("button", {
337
- onClick: t[8] || (t[8] = //@ts-ignore
338
- (...n) => C(x) && C(x)(...n))
344
+ onClick: e[8] || (e[8] = //@ts-ignore
345
+ (...t) => w(P) && w(P)(...t))
339
346
  }, "OK")
340
347
  ]),
341
- y.showPackageName ? (N(), R("div", {
348
+ g.showPackageName ? (R(), _("div", {
342
349
  key: 0,
343
350
  class: "acpPackageName",
344
- onClick: t[9] || (t[9] = //@ts-ignore
345
- (...n) => C(le) && C(le)(...n))
346
- }, " au-color-picker ")) : G("", !0)
347
- ], 4)) : G("", !0)
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
- }), 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({
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(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);
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 w = m;
372
- function _(l) {
373
- h.value = l, P.value = l, w("change", l);
378
+ const S = x;
379
+ function M(l) {
380
+ h.value = l, k.value = l, S("change", l);
374
381
  }
375
- function I(l) {
376
- h.value = l, P.value = l, v();
382
+ function T(l) {
383
+ h.value = l, k.value = l, f();
377
384
  }
378
- return r({ closePanel: v }), re(c, (l) => {
379
- l === !1 && w("done", h.value);
380
- }), ie(() => {
381
- var l;
382
- if (f.initial && (h.value = f.initial, P.value = f.initial), f.initialSelectedPreset) {
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
- }), (l, e) => (N(), R("div", Ze, [
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: U(C(E)),
390
- onClick: e[0] || (e[0] = //@ts-ignore
391
- (...g) => C(x) && C(x)(...g))
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
- C(c) ? (N(), R("div", {
409
+ w(v) ? (R(), _("div", {
394
410
  key: 0,
395
411
  class: "acpPanel",
396
- style: U({ zIndex: (l.panelBaseZIndex || 0) + 100 }),
397
- onClick: e[5] || (e[5] = (g) => l.panelClickStopPropagation && g.stopPropagation())
412
+ style: Z({ zIndex: (l.panelBaseZIndex || 0) + 100 }),
413
+ onClick: a[5] || (a[5] = (d) => l.panelClickStopPropagation && d.stopPropagation())
398
414
  }, [
399
- i("div", je, [
400
- i("label", Xe, [
401
- ue(We, {
402
- initial: P.value,
403
- onChange: _,
404
- onDone: I,
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: z,
423
+ ref: L,
408
424
  "show-package-name": l.showPackageName
409
425
  }, null, 8, ["initial", "show-package-name"]),
410
- Y(i("input", {
426
+ G(i("input", {
411
427
  name: "colorType",
412
428
  type: "radio",
413
429
  id: "acpColorPresetCustom",
414
430
  value: void 0,
415
- "onUpdate:modelValue": e[1] || (e[1] = (g) => T.value = g),
416
- onClick: e[2] || (e[2] = (g) => D())
431
+ "onUpdate:modelValue": a[1] || (a[1] = (d) => N.value = d),
432
+ onClick: a[2] || (a[2] = (d) => B())
417
433
  }, null, 512), [
418
- [ee, T.value]
434
+ [ne, N.value]
419
435
  ]),
420
- e[6] || (e[6] = i("div", { class: "acpPresetName" }, "自定义", -1))
436
+ a[6] || (a[6] = i("div", { class: "acpPresetName" }, "自定义", -1))
421
437
  ]),
422
- e[7] || (e[7] = i("div", { class: "acpSep" }, null, -1)),
423
- (N(!0), R(Pe, null, ke(l.presets, (g) => (N(), R("label", {
424
- for: `acpColorPreset${g.name}`
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: U({ backgroundColor: g.colorHex })
444
+ style: Z({ backgroundColor: d.colorHex })
429
445
  }, null, 4),
430
- Y(i("input", {
446
+ G(i("input", {
431
447
  name: "colorType",
432
448
  type: "radio",
433
- id: `acpColorPreset${g.name}`,
434
- value: g.name,
435
- "onUpdate:modelValue": e[3] || (e[3] = (V) => T.value = V),
436
- onClick: (V) => D(g)
437
- }, null, 8, Ke), [
438
- [ee, T.value]
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", Ye, Ce(g.name), 1)
441
- ], 8, Fe))), 256)),
442
- e[8] || (e[8] = i("div", { class: "acpSep" }, null, -1))
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", Ge, [
460
+ i("div", Je, [
445
461
  i("button", {
446
- onClick: e[4] || (e[4] = //@ts-ignore
447
- (...g) => C(v) && C(v)(...g))
462
+ onClick: a[4] || (a[4] = //@ts-ignore
463
+ (...d) => w(f) && w(f)(...d))
448
464
  }, "OK")
449
465
  ])
450
- ], 4)) : G("", !0)
466
+ ], 4)) : J("", !0)
451
467
  ]));
452
468
  }
453
- }), tt = /* @__PURE__ */ Q(Je, [["__scopeId", "data-v-051cc834"]]);
469
+ }), nt = /* @__PURE__ */ te(Qe, [["__scopeId", "data-v-2772e845"]]);
454
470
  export {
455
- We as AuColorPicker,
456
- tt as AuColorPickerPresetsNested,
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, {}, any>;
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, {}, any>;
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
- declare function enforceTo(hex: HEX): void;
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, {}, any>;
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.3",
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.1",
44
+ "@types/node": "^22.10.10",
45
45
  "@vitejs/plugin-vue": "^5.2.1",
46
- "sass": "^1.81.0",
47
- "typescript": "^5.7.2",
48
- "vite": "^5.4.11",
49
- "vite-plugin-dts": "^4.3.0"
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}