@aurouscia/au-color-picker 0.5.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/dist/au-color-picker.css +1 -1
- package/dist/au-color-picker.es.js +311 -303
- package/dist/types/components/AuColorPicker.vue.d.ts +4 -4
- package/dist/types/components/AuColorPickerPresetsNested.vue.d.ts +12 -12
- package/dist/types/components/common/pickerProps.d.ts +2 -0
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -19,17 +19,19 @@ import { AuColorPickerPresetsNested } from '@aurouscia/au-color-picker';
|
|
|
19
19
|
### 仅自定义
|
|
20
20
|
```vue
|
|
21
21
|
<AuColorPicker
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@done="面板关闭回调"
|
|
22
|
+
v-model="'绑定颜色值'"
|
|
23
|
+
:initial="'初始值(优先级低于v-model)'"
|
|
24
|
+
@done="'面板关闭回调'"
|
|
25
25
|
></AuColorPicker>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
### 预设+自定义
|
|
29
|
+
⚠️注意:“选中的预设”是与“自定义颜色”独立的两个状态
|
|
30
|
+
这使得模型的颜色可以依赖于系统全局配置(预设的颜色)
|
|
29
31
|
```ts
|
|
30
32
|
const presets:NamedPreset[] = [
|
|
31
33
|
{
|
|
32
|
-
name: '水系',
|
|
34
|
+
name: '水系', //名称不可重复
|
|
33
35
|
colorHex: '#c3e5eb'
|
|
34
36
|
},
|
|
35
37
|
{
|
|
@@ -40,16 +42,16 @@ const presets:NamedPreset[] = [
|
|
|
40
42
|
```
|
|
41
43
|
```vue
|
|
42
44
|
<AuColorPickerPresetsNested
|
|
43
|
-
:
|
|
44
|
-
|
|
45
|
-
:initial
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
:presets="'预设列表'"
|
|
46
|
+
v-model="'绑定颜色值'"
|
|
47
|
+
:initial="'初始值(优先级低于v-model)'"
|
|
48
|
+
v-model:model-value-selected-preset="'绑定预设name'"
|
|
49
|
+
:initial-selected-preset="'初始选择预设(优先级低于v-model)'"
|
|
50
|
+
@done="'面板关闭回调'"
|
|
48
51
|
></AuColorPickerPresetsNested>
|
|
49
52
|
```
|
|
50
53
|
|
|
51
|
-
###
|
|
52
|
-
覆盖值并不会触发回调
|
|
54
|
+
### 覆盖当前值(旧版,新版直接赋值v-model)
|
|
53
55
|
```ts
|
|
54
56
|
const picker = ref<InstanceType<typeof AuColorPicker>>()
|
|
55
57
|
const pickerNested = ref<InstanceType<typeof AuColorPickerPresetsNested>>()
|
|
@@ -75,7 +77,7 @@ export interface PickerProps{
|
|
|
75
77
|
panelBaseZIndex?:number //面板的zIndex基础值
|
|
76
78
|
entryRespondDelay?:number //入口按钮点击后,面板展开的延迟(ms)
|
|
77
79
|
panelClickStopPropagation?:boolean //面板点击是否阻止冒泡
|
|
78
|
-
showPackageName?:boolean
|
|
80
|
+
showPackageName?:boolean //是否显示包名
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
//AuColorPickerPresetsNested的属性
|
package/dist/au-color-picker.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.acpRingBody[data-v-
|
|
1
|
+
.acpRingBody[data-v-183d2118]{position:relative}canvas[data-v-183d2118]{position:absolute;inset:0;width:100%;height:100%}[data-v-dc351014]{margin:0;padding:0}.acpSep[data-v-dc351014]{height:2px;border-radius:100px;flex-grow:0;flex-shrink:0;background-color:#ddd}.acpPresetBody[data-v-dc351014]{width:25px;height:25px;border-radius:1000px;cursor:pointer}.acpDoneBtn[data-v-dc351014]{display:flex;justify-content:center;align-items:center;margin:8px;-webkit-user-select:none;user-select:none}.acpDoneBtn button[data-v-dc351014]{background:none;border:none;font-weight:700;color:gray;font-size:16px;cursor:pointer}.acpDoneBtn button[data-v-dc351014]:hover{color:#000}.acpEntry[data-v-dc351014]{width:30px;height:30px;cursor:pointer;border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff}.acpPanel[data-v-dc351014]{border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff;margin-top:3px;position:absolute}.acp[data-v-dc351014]{position:relative;width:fit-content}.acp label[data-v-dc351014]{-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer}.acp input[type=radio][data-v-dc351014]{cursor:pointer}.acpPackageName[data-v-dc351014]{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-dc351014]{display:flex;justify-content:space-between;align-items:center;padding:5px}.acpParams select[data-v-dc351014],.acpParams input[data-v-dc351014]{margin:0;padding:2px;display:block;font-size:16px;box-sizing:border-box;height:24px;line-height:24px}.acpParams select[data-v-dc351014]{-webkit-user-select:none;user-select:none}.acpParams input[data-v-dc351014]{text-align:center}.acpParams .acpSingleInput input[data-v-dc351014]{width:120px}.acpParams .acpTripleInputs[data-v-dc351014]{display:flex;justify-content:space-around}.acpParams .acpTripleInputs input[data-v-dc351014]{width:40px}[data-v-6d20c9c4]{margin:0;padding:0}.acpSep[data-v-6d20c9c4]{height:2px;border-radius:100px;flex-grow:0;flex-shrink:0;background-color:#ddd}.acpPresetBody[data-v-6d20c9c4]{width:25px;height:25px;border-radius:1000px;cursor:pointer}.acpDoneBtn[data-v-6d20c9c4]{display:flex;justify-content:center;align-items:center;margin:8px;-webkit-user-select:none;user-select:none}.acpDoneBtn button[data-v-6d20c9c4]{background:none;border:none;font-weight:700;color:gray;font-size:16px;cursor:pointer}.acpDoneBtn button[data-v-6d20c9c4]:hover{color:#000}.acpEntry[data-v-6d20c9c4]{width:30px;height:30px;cursor:pointer;border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff}.acpPanel[data-v-6d20c9c4]{border-radius:5px;box-shadow:0 0 5px #000;background-color:#fff;margin-top:3px;position:absolute}.acp[data-v-6d20c9c4]{position:relative;width:fit-content}.acp label[data-v-6d20c9c4]{-webkit-user-select:none;user-select:none;white-space:nowrap;cursor:pointer}.acp input[type=radio][data-v-6d20c9c4]{cursor:pointer}.acpNamedPresets[data-v-6d20c9c4]{margin:5px;display:flex;flex-direction:column;gap:4px}.acpNamedPresets[data-v-6d20c9c4]>*{display:flex;justify-content:flex-start;align-items:center;gap:5px}.acpNamedPresets>* .acpPresetName[data-v-6d20c9c4]{color:#666}.acpNamedPresets>* .acpPresetName[data-v-6d20c9c4]:hover{color:#000}
|
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
function Ie(
|
|
4
|
-
const
|
|
5
|
-
return
|
|
1
|
+
import { defineComponent as te, ref as I, onMounted as ye, onUnmounted as xe, createElementBlock as T, openBlock as N, normalizeStyle as X, isRef as Pe, createElementVNode as v, computed as F, onBeforeMount as ue, watch as j, createCommentVNode as J, unref as k, normalizeClass as he, createVNode as ce, withDirectives as Q, vModelSelect as ke, vModelRadio as oe, Fragment as Ce, renderList as Se, toDisplayString as we } from "vue";
|
|
2
|
+
import A from "color-convert";
|
|
3
|
+
function Ie(o, P) {
|
|
4
|
+
const m = o.x - P.x, t = o.y - P.y;
|
|
5
|
+
return m ** 2 + t ** 2;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
return Math.atan2(
|
|
7
|
+
function Ve(o, P) {
|
|
8
|
+
const m = o.x - P.x, t = o.y - P.y;
|
|
9
|
+
return Math.atan2(t, m);
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const D = 400, z = 400, G = 200, Be = 200, le = 190, se = 150, O = 200, ae = 16, ie = 3, be = /* @__PURE__ */ te({
|
|
12
12
|
__name: "AuColorPickerRing",
|
|
13
13
|
props: {
|
|
14
14
|
initialHex: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["changed"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
let
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (!n || !o)
|
|
17
|
+
setup(o, { expose: P, emit: m }) {
|
|
18
|
+
const t = I(), g = I();
|
|
19
|
+
let i, u;
|
|
20
|
+
const C = { x: 199, y: 199 }, E = (le + se) / 2, $ = le ** 2, L = se ** 2, B = (D - O) / 2, H = B + O, h = I(0), w = I(100), R = I(100), b = o;
|
|
21
|
+
let y;
|
|
22
|
+
function c() {
|
|
23
|
+
const l = t.value?.getContext("2d"), s = g.value?.getContext("2d");
|
|
24
|
+
if (!l || !s)
|
|
26
25
|
throw Error("canvas context getting error");
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
|
|
26
|
+
if (b.initialHex) {
|
|
27
|
+
const a = A.hex.hsv(b.initialHex);
|
|
28
|
+
h.value = a[0], w.value = a[1], R.value = a[2];
|
|
30
29
|
}
|
|
31
|
-
|
|
30
|
+
i = l, u = s, y = i.getImageData(0, 0, D, z), r(), x(), Y(), i.putImageData(y, 0, 0);
|
|
32
31
|
}
|
|
33
|
-
function
|
|
34
|
-
for (let
|
|
35
|
-
for (let
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
const
|
|
39
|
-
|
|
32
|
+
function r() {
|
|
33
|
+
for (let l = 0; l < D; l++)
|
|
34
|
+
for (let s = 0; s < z; s++) {
|
|
35
|
+
const a = { x: l, y: s };
|
|
36
|
+
if (q(a)) {
|
|
37
|
+
const p = a.y * D * 4 + a.x * 4, V = d(a), U = A.hsv.rgb([V, 100, 100]);
|
|
38
|
+
y.data[p] = U[0], y.data[p + 1] = U[1], y.data[p + 2] = U[2], y.data[p + 3] = 255;
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
function l
|
|
44
|
-
return 360 * ((
|
|
42
|
+
function d(l) {
|
|
43
|
+
return 360 * ((Ve(l, C) + Math.PI) / (2 * Math.PI));
|
|
45
44
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
return
|
|
45
|
+
function q(l) {
|
|
46
|
+
const s = Ie(C, l);
|
|
47
|
+
return s > L && s < $;
|
|
49
48
|
}
|
|
50
|
-
function
|
|
51
|
-
for (let
|
|
52
|
-
for (let
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
|
|
49
|
+
function x() {
|
|
50
|
+
for (let l = 0; l < D; l++)
|
|
51
|
+
for (let s = 0; s < z; s++) {
|
|
52
|
+
const a = { x: l, y: s };
|
|
53
|
+
if (n(a)) {
|
|
54
|
+
const p = a.y * D * 4 + a.x * 4, { s: V, v: U } = e(a), _ = A.hsv.rgb([h.value, V, U]);
|
|
55
|
+
y.data[p] = _[0], y.data[p + 1] = _[1], y.data[p + 2] = _[2], y.data[p + 3] = 255;
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
|
-
function e(
|
|
61
|
-
const
|
|
62
|
-
let
|
|
63
|
-
return
|
|
59
|
+
function e(l) {
|
|
60
|
+
const s = l.x - B, a = l.y - B;
|
|
61
|
+
let p = s / O, V = 1 - a / O;
|
|
62
|
+
return p > 1 ? p = 1 : p < 0 && (p = 0), V > 1 ? V = 1 : V < 0 && (V = 0), { s: 100 * p, v: 100 * V };
|
|
64
63
|
}
|
|
65
|
-
function
|
|
66
|
-
return !(
|
|
64
|
+
function n(l) {
|
|
65
|
+
return !(l.x < B || l.x > H || l.y < B || l.y > H);
|
|
67
66
|
}
|
|
68
|
-
let
|
|
69
|
-
function
|
|
70
|
-
if (
|
|
67
|
+
let M = !1, f = "none", S = I(!1);
|
|
68
|
+
function K(l, s) {
|
|
69
|
+
if (M || s && !S.value)
|
|
71
70
|
return;
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
w.value =
|
|
71
|
+
M = !0;
|
|
72
|
+
const a = fe(l);
|
|
73
|
+
if (f === "none" && (n(a) ? f = "square" : q(a) && (f = "ring")), f === "ring" && (l.preventDefault(), h.value = d(a), x(), i.putImageData(y, 0, 0)), f === "square") {
|
|
74
|
+
l.preventDefault();
|
|
75
|
+
const p = e(a);
|
|
76
|
+
w.value = p.s, R.value = p.v;
|
|
78
77
|
}
|
|
79
|
-
|
|
78
|
+
f !== "none" && Y(!0), M = !1;
|
|
80
79
|
}
|
|
81
80
|
function Z() {
|
|
82
|
-
|
|
81
|
+
f = "none", S.value = !1;
|
|
83
82
|
}
|
|
84
|
-
function fe(
|
|
85
|
-
let
|
|
86
|
-
if (!
|
|
83
|
+
function fe(l) {
|
|
84
|
+
let s, a;
|
|
85
|
+
if (!t.value)
|
|
87
86
|
return { x: -1, y: -1 };
|
|
88
|
-
if ("touches" in
|
|
89
|
-
const
|
|
90
|
-
|
|
87
|
+
if ("touches" in l) {
|
|
88
|
+
const p = t.value.getBoundingClientRect();
|
|
89
|
+
s = l.touches[0].clientX - p.left, a = l.touches[0].clientY - p.top;
|
|
91
90
|
} else
|
|
92
|
-
|
|
93
|
-
return
|
|
91
|
+
s = l.offsetX, a = l.offsetY;
|
|
92
|
+
return s = s * D / G, a = a * D / G, { x: s, y: a };
|
|
94
93
|
}
|
|
95
|
-
function
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
|
|
94
|
+
function Y(l) {
|
|
95
|
+
if (l) {
|
|
96
|
+
const ge = A.hsv.hex([h.value, w.value, R.value]);
|
|
97
|
+
me("changed", ge);
|
|
99
98
|
}
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
99
|
+
const s = (h.value / 360 * 2 + 1) * Math.PI, a = Math.cos(s) * E + D / 2, p = Math.sin(s) * E + z / 2, V = w.value / 100 * O + B, U = (1 - R.value / 100) * O + B;
|
|
100
|
+
u.reset(), u.lineWidth = 4, u.strokeStyle = "black", u.beginPath(), u.arc(a, p, ae - 2, 0, 2 * Math.PI), u.stroke(), u.beginPath(), u.arc(a, p, ie, 0, 2 * Math.PI), u.fill();
|
|
101
|
+
const _ = R.value > 50 ? "black" : "#ddd";
|
|
102
|
+
u.strokeStyle = _, u.fillStyle = _, u.beginPath(), u.arc(V, U, ae - 2, 0, 2 * Math.PI), u.stroke(), u.beginPath(), u.arc(V, U, ie, 0, 2 * Math.PI), u.fill();
|
|
104
103
|
}
|
|
105
|
-
function pe(
|
|
106
|
-
const
|
|
107
|
-
|
|
104
|
+
function pe(l) {
|
|
105
|
+
const s = A.hex.hsv(l);
|
|
106
|
+
h.value = s[0], w.value = s[1], R.value = s[2], x(), i.putImageData(y, 0, 0), Y();
|
|
108
107
|
}
|
|
109
|
-
const
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
}),
|
|
108
|
+
const me = m;
|
|
109
|
+
return P({ enforceTo: pe }), ye(() => {
|
|
110
|
+
c(), window.addEventListener("touchend", Z), window.addEventListener("mouseup", Z);
|
|
111
|
+
}), xe(() => {
|
|
113
112
|
window.removeEventListener("touchend", Z), window.removeEventListener("mouseup", Z);
|
|
114
|
-
}), (
|
|
113
|
+
}), (l, s) => (N(), T("div", {
|
|
115
114
|
class: "acpRingBody",
|
|
116
|
-
style:
|
|
117
|
-
onTouchstart:
|
|
118
|
-
onTouchmove:
|
|
115
|
+
style: X({ width: G + "px", height: Be + "px" }),
|
|
116
|
+
onTouchstart: K,
|
|
117
|
+
onTouchmove: K,
|
|
119
118
|
onTouchend: Z,
|
|
120
|
-
onMousemove:
|
|
121
|
-
onMousedown:
|
|
122
|
-
|
|
119
|
+
onMousemove: s[0] || (s[0] = (a) => K(a, !0)),
|
|
120
|
+
onMousedown: s[1] || (s[1] = (a) => {
|
|
121
|
+
K(a), Pe(S) ? S.value = !0 : S = !0;
|
|
123
122
|
})
|
|
124
123
|
}, [
|
|
125
|
-
|
|
126
|
-
width:
|
|
124
|
+
v("canvas", {
|
|
125
|
+
width: D,
|
|
127
126
|
height: z,
|
|
128
127
|
ref_key: "cvs",
|
|
129
|
-
ref:
|
|
128
|
+
ref: t
|
|
130
129
|
}, null, 512),
|
|
131
|
-
|
|
132
|
-
width:
|
|
130
|
+
v("canvas", {
|
|
131
|
+
width: D,
|
|
133
132
|
height: z,
|
|
134
133
|
ref_key: "cursorCvs",
|
|
135
|
-
ref:
|
|
134
|
+
ref: g
|
|
136
135
|
}, null, 512)
|
|
137
136
|
], 36));
|
|
138
137
|
}
|
|
139
|
-
}),
|
|
140
|
-
const
|
|
141
|
-
for (const [
|
|
142
|
-
|
|
143
|
-
return
|
|
144
|
-
},
|
|
145
|
-
function
|
|
146
|
-
return /^#([0-9A-F]{3}){1,2}$/i.test(
|
|
138
|
+
}), ne = (o, P) => {
|
|
139
|
+
const m = o.__vccOpts || o;
|
|
140
|
+
for (const [t, g] of P)
|
|
141
|
+
m[t] = g;
|
|
142
|
+
return m;
|
|
143
|
+
}, De = /* @__PURE__ */ ne(be, [["__scopeId", "data-v-183d2118"]]);
|
|
144
|
+
function ee(o) {
|
|
145
|
+
return /^#([0-9A-F]{3}){1,2}$/i.test(o);
|
|
147
146
|
}
|
|
148
|
-
function
|
|
149
|
-
const
|
|
150
|
-
let
|
|
151
|
-
return
|
|
147
|
+
function de(o, P) {
|
|
148
|
+
const m = I(!1), t = F(() => {
|
|
149
|
+
let C = {};
|
|
150
|
+
return m.value || (C.boxShadow = "none"), o.entryStyles && Object.assign(C, o.entryStyles), m.value && (C.transition = "0s", Object.assign(C, o.entryActiveStyles)), C.backgroundColor = P.value, C;
|
|
152
151
|
});
|
|
153
|
-
function
|
|
154
|
-
|
|
152
|
+
function g() {
|
|
153
|
+
m.value = !1;
|
|
155
154
|
}
|
|
156
|
-
let
|
|
157
|
-
function
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
},
|
|
155
|
+
let i = 0;
|
|
156
|
+
function u() {
|
|
157
|
+
if (o.entryRespondDelay && (window.clearTimeout(i), !m.value)) {
|
|
158
|
+
i = window.setTimeout(() => {
|
|
159
|
+
m.value = !0;
|
|
160
|
+
}, o.entryRespondDelay);
|
|
162
161
|
return;
|
|
163
162
|
}
|
|
164
|
-
|
|
163
|
+
m.value = !m.value;
|
|
165
164
|
}
|
|
166
|
-
return {
|
|
165
|
+
return { panelShow: m, closePanel: g, togglePanel: u, entryStylesActual: t };
|
|
167
166
|
}
|
|
168
|
-
function
|
|
167
|
+
function re() {
|
|
169
168
|
window.alert("https://www.npmjs.com/package/@aurouscia/au-color-picker");
|
|
170
169
|
}
|
|
171
|
-
function W(
|
|
172
|
-
return
|
|
170
|
+
function W(o) {
|
|
171
|
+
return o.startsWith("#") ? o.toUpperCase() : "#" + o.toUpperCase();
|
|
173
172
|
}
|
|
174
|
-
function
|
|
173
|
+
function ve(o) {
|
|
175
174
|
return {
|
|
176
175
|
panelStyles: F(() => {
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
const
|
|
180
|
-
return typeof
|
|
181
|
-
zIndex: (
|
|
182
|
-
left:
|
|
183
|
-
right:
|
|
176
|
+
const m = o.panelBaseZIndex;
|
|
177
|
+
let t, g;
|
|
178
|
+
const i = o.pos;
|
|
179
|
+
return typeof i == "number" ? t = i + "px" : i == "left" ? g = "0px" : t = "0px", {
|
|
180
|
+
zIndex: (m || 0) + 100,
|
|
181
|
+
left: t,
|
|
182
|
+
right: g
|
|
184
183
|
};
|
|
185
184
|
})
|
|
186
185
|
};
|
|
187
186
|
}
|
|
188
|
-
const
|
|
187
|
+
const Te = { class: "acp" }, Ne = { class: "acpRing" }, Re = { class: "acpParams" }, He = {
|
|
189
188
|
key: 0,
|
|
190
189
|
class: "acpSingleInput"
|
|
191
190
|
}, Me = ["value"], Ae = {
|
|
192
191
|
key: 1,
|
|
193
192
|
class: "acpTripleInputs"
|
|
194
|
-
},
|
|
193
|
+
}, Ee = ["value"], $e = ["value"], qe = ["value"], Ue = {
|
|
195
194
|
key: 2,
|
|
196
195
|
class: "acpTripleInputs"
|
|
197
|
-
}, Le = ["value"],
|
|
196
|
+
}, Le = ["value"], _e = ["value"], ze = ["value"], Oe = { class: "acpDoneBtn" }, We = /* @__PURE__ */ te({
|
|
198
197
|
__name: "AuColorPicker",
|
|
199
198
|
props: {
|
|
199
|
+
modelValue: {},
|
|
200
200
|
initial: {},
|
|
201
201
|
entryStyles: {},
|
|
202
202
|
entryActiveStyles: {},
|
|
@@ -207,168 +207,168 @@ const Ne = { class: "acp" }, Re = { class: "acpRing" }, He = { class: "acpParams
|
|
|
207
207
|
panelClickStopPropagation: { type: Boolean },
|
|
208
208
|
showPackageName: { type: Boolean }
|
|
209
209
|
},
|
|
210
|
-
emits: ["
|
|
211
|
-
setup(
|
|
212
|
-
const
|
|
213
|
-
function
|
|
214
|
-
|
|
210
|
+
emits: ["done", "update:modelValue"],
|
|
211
|
+
setup(o, { expose: P, emit: m }) {
|
|
212
|
+
const t = o, g = I(), i = I("#ff0000"), { panelShow: u, closePanel: C, togglePanel: E, entryStylesActual: $ } = de(t, i), { panelStyles: L } = ve(t);
|
|
213
|
+
function B(x) {
|
|
214
|
+
i.value = W(x), c();
|
|
215
215
|
}
|
|
216
|
-
const
|
|
217
|
-
function
|
|
218
|
-
|
|
219
|
-
const e = g.target;
|
|
216
|
+
const H = I("hex"), h = F(() => A.hex.rgb(i.value)), w = F(() => A.hex.hsv(i.value));
|
|
217
|
+
function R(x) {
|
|
218
|
+
const e = x.target;
|
|
220
219
|
if ("value" in e) {
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
|
|
220
|
+
const n = e.value;
|
|
221
|
+
if (n && ee(n)) {
|
|
222
|
+
i.value = W(n), g.value?.enforceTo(i.value), c();
|
|
224
223
|
return;
|
|
225
224
|
}
|
|
226
|
-
e.value =
|
|
225
|
+
e.value = i.value;
|
|
227
226
|
}
|
|
228
227
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
t.value = "0";
|
|
228
|
+
function b(x, e) {
|
|
229
|
+
const n = x.target;
|
|
230
|
+
if ("value" in n) {
|
|
231
|
+
const M = n.value;
|
|
232
|
+
if (M) {
|
|
233
|
+
let f = parseInt(M);
|
|
234
|
+
if (isNaN(f))
|
|
235
|
+
n.value = "0";
|
|
238
236
|
else {
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
e == "r" ?
|
|
237
|
+
f > 255 ? f = 255 : f < 0 && (f = 0);
|
|
238
|
+
const S = [...h.value];
|
|
239
|
+
e == "r" ? S[0] = f : e == "g" ? S[1] = f : S[2] = f, i.value = W(A.rgb.hex(S)), g.value?.enforceTo(i.value), n.value = f.toString(), c();
|
|
242
240
|
return;
|
|
243
241
|
}
|
|
244
242
|
}
|
|
245
243
|
}
|
|
246
244
|
}
|
|
247
|
-
function
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
t.value = "0";
|
|
245
|
+
function y(x, e) {
|
|
246
|
+
const n = x.target;
|
|
247
|
+
if ("value" in n) {
|
|
248
|
+
const M = n.value;
|
|
249
|
+
if (M) {
|
|
250
|
+
let f = parseInt(M);
|
|
251
|
+
if (isNaN(f))
|
|
252
|
+
n.value = "0";
|
|
256
253
|
else {
|
|
257
|
-
e === "h" ?
|
|
258
|
-
const
|
|
259
|
-
e == "h" ?
|
|
254
|
+
e === "h" ? f > 359 && (f = 359) : f > 100 && (f = 100), f < 0 && (f = 0);
|
|
255
|
+
const S = [...w.value];
|
|
256
|
+
e == "h" ? S[0] = f : e == "s" ? S[1] = f : S[2] = f, i.value = W(A.hsv.hex(S)), n.value = f.toString(), g.value?.enforceTo(i.value), c();
|
|
260
257
|
return;
|
|
261
258
|
}
|
|
262
259
|
}
|
|
263
260
|
}
|
|
264
261
|
}
|
|
265
|
-
function
|
|
266
|
-
|
|
262
|
+
function c() {
|
|
263
|
+
q("update:modelValue", i.value);
|
|
267
264
|
}
|
|
268
|
-
function
|
|
269
|
-
return
|
|
265
|
+
function r() {
|
|
266
|
+
return i.value;
|
|
270
267
|
}
|
|
271
|
-
function
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
a.value = t, (e = m.value) == null || e.enforceTo(t);
|
|
268
|
+
function d(x) {
|
|
269
|
+
if (ee(x)) {
|
|
270
|
+
const e = W(x);
|
|
271
|
+
i.value = e, g.value?.enforceTo(e);
|
|
276
272
|
}
|
|
277
273
|
}
|
|
278
|
-
|
|
279
|
-
|
|
274
|
+
ue(() => {
|
|
275
|
+
t.modelValue ? d(t.modelValue) : t.initial && d(t.initial);
|
|
280
276
|
});
|
|
281
|
-
const
|
|
282
|
-
return
|
|
283
|
-
|
|
284
|
-
}), (
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
277
|
+
const q = m;
|
|
278
|
+
return P({ closePanel: C, getCurrentHex: r, enforceTo: d }), j(() => t.modelValue, (x) => {
|
|
279
|
+
x && x !== i.value && d(x);
|
|
280
|
+
}), j(u, (x) => {
|
|
281
|
+
x === !1 && q("done");
|
|
282
|
+
}), (x, e) => (N(), T("div", Te, [
|
|
283
|
+
v("div", {
|
|
284
|
+
class: he(o.entryClassName || "acpEntry"),
|
|
285
|
+
style: X(k($)),
|
|
288
286
|
onClick: e[0] || (e[0] = //@ts-ignore
|
|
289
|
-
(...
|
|
287
|
+
(...n) => k(E) && k(E)(...n))
|
|
290
288
|
}, null, 6),
|
|
291
|
-
|
|
289
|
+
k(u) ? (N(), T("div", {
|
|
292
290
|
key: 0,
|
|
293
291
|
class: "acpPanel",
|
|
294
|
-
style:
|
|
295
|
-
onClick: e[10] || (e[10] = (
|
|
292
|
+
style: X(k(L)),
|
|
293
|
+
onClick: e[10] || (e[10] = (n) => o.panelClickStopPropagation && n.stopPropagation())
|
|
296
294
|
}, [
|
|
297
|
-
|
|
298
|
-
ce(
|
|
295
|
+
v("div", Ne, [
|
|
296
|
+
ce(De, {
|
|
299
297
|
ref_key: "ring",
|
|
300
|
-
ref:
|
|
301
|
-
"initial-hex":
|
|
302
|
-
onChanged:
|
|
303
|
-
"show-package-name":
|
|
298
|
+
ref: g,
|
|
299
|
+
"initial-hex": i.value,
|
|
300
|
+
onChanged: B,
|
|
301
|
+
"show-package-name": o.showPackageName
|
|
304
302
|
}, null, 8, ["initial-hex", "show-package-name"])
|
|
305
303
|
]),
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
309
|
-
}, e[11] || (e[11] = [
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
]), 512), [
|
|
314
|
-
[ke,
|
|
304
|
+
v("div", Re, [
|
|
305
|
+
Q(v("select", {
|
|
306
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => H.value = n)
|
|
307
|
+
}, [...e[11] || (e[11] = [
|
|
308
|
+
v("option", { value: "hex" }, "HEX", -1),
|
|
309
|
+
v("option", { value: "rgb" }, "RGB", -1),
|
|
310
|
+
v("option", { value: "hsv" }, "HSV", -1)
|
|
311
|
+
])], 512), [
|
|
312
|
+
[ke, H.value]
|
|
315
313
|
]),
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
value:
|
|
319
|
-
onBlur:
|
|
314
|
+
H.value == "hex" ? (N(), T("div", He, [
|
|
315
|
+
v("input", {
|
|
316
|
+
value: i.value,
|
|
317
|
+
onBlur: R,
|
|
320
318
|
spellcheck: "false",
|
|
321
319
|
maxlength: "7"
|
|
322
320
|
}, null, 40, Me)
|
|
323
|
-
])) :
|
|
324
|
-
|
|
325
|
-
value:
|
|
326
|
-
onBlur: e[2] || (e[2] = (
|
|
327
|
-
}, null, 40, $e),
|
|
328
|
-
r("input", {
|
|
329
|
-
value: C.value[1],
|
|
330
|
-
onBlur: e[3] || (e[3] = (t) => q(t, "g"))
|
|
321
|
+
])) : H.value == "rgb" ? (N(), T("div", Ae, [
|
|
322
|
+
v("input", {
|
|
323
|
+
value: h.value[0],
|
|
324
|
+
onBlur: e[2] || (e[2] = (n) => b(n, "r"))
|
|
331
325
|
}, null, 40, Ee),
|
|
332
|
-
|
|
333
|
-
value:
|
|
334
|
-
onBlur: e[
|
|
326
|
+
v("input", {
|
|
327
|
+
value: h.value[1],
|
|
328
|
+
onBlur: e[3] || (e[3] = (n) => b(n, "g"))
|
|
329
|
+
}, null, 40, $e),
|
|
330
|
+
v("input", {
|
|
331
|
+
value: h.value[2],
|
|
332
|
+
onBlur: e[4] || (e[4] = (n) => b(n, "b"))
|
|
335
333
|
}, null, 40, qe)
|
|
336
|
-
])) : (
|
|
337
|
-
|
|
334
|
+
])) : (N(), T("div", Ue, [
|
|
335
|
+
v("input", {
|
|
338
336
|
value: w.value[0],
|
|
339
|
-
onBlur: e[5] || (e[5] = (
|
|
337
|
+
onBlur: e[5] || (e[5] = (n) => y(n, "h"))
|
|
340
338
|
}, null, 40, Le),
|
|
341
|
-
|
|
339
|
+
v("input", {
|
|
342
340
|
value: w.value[1],
|
|
343
|
-
onBlur: e[6] || (e[6] = (
|
|
344
|
-
}, null, 40,
|
|
345
|
-
|
|
341
|
+
onBlur: e[6] || (e[6] = (n) => y(n, "s"))
|
|
342
|
+
}, null, 40, _e),
|
|
343
|
+
v("input", {
|
|
346
344
|
value: w.value[2],
|
|
347
|
-
onBlur: e[7] || (e[7] = (
|
|
345
|
+
onBlur: e[7] || (e[7] = (n) => y(n, "v"))
|
|
348
346
|
}, null, 40, ze)
|
|
349
347
|
]))
|
|
350
348
|
]),
|
|
351
|
-
|
|
352
|
-
|
|
349
|
+
v("div", Oe, [
|
|
350
|
+
v("button", {
|
|
353
351
|
onClick: e[8] || (e[8] = //@ts-ignore
|
|
354
|
-
(...
|
|
352
|
+
(...n) => k(C) && k(C)(...n))
|
|
355
353
|
}, "OK")
|
|
356
354
|
]),
|
|
357
|
-
|
|
355
|
+
o.showPackageName ? (N(), T("div", {
|
|
358
356
|
key: 0,
|
|
359
357
|
class: "acpPackageName",
|
|
360
358
|
onClick: e[9] || (e[9] = //@ts-ignore
|
|
361
|
-
(...
|
|
362
|
-
}, " au-color-picker ")) :
|
|
363
|
-
], 4)) :
|
|
359
|
+
(...n) => k(re) && k(re)(...n))
|
|
360
|
+
}, " au-color-picker ")) : J("", !0)
|
|
361
|
+
], 4)) : J("", !0)
|
|
364
362
|
]));
|
|
365
363
|
}
|
|
366
|
-
}), je = /* @__PURE__ */
|
|
364
|
+
}), je = /* @__PURE__ */ ne(We, [["__scopeId", "data-v-dc351014"]]), Xe = { class: "acp" }, Ze = { class: "acpNamedPresets" }, Fe = ["for", "onClick"], Ke = ["id", "value"], Ye = { class: "acpPresetName" }, Ge = { class: "acpDoneBtn" }, Je = /* @__PURE__ */ te({
|
|
367
365
|
__name: "AuColorPickerPresetsNested",
|
|
368
366
|
props: {
|
|
367
|
+
modelValueSelectedPreset: {},
|
|
369
368
|
initialSelectedPreset: {},
|
|
370
369
|
presets: {},
|
|
371
370
|
posInternal: {},
|
|
371
|
+
modelValue: {},
|
|
372
372
|
initial: {},
|
|
373
373
|
entryStyles: {},
|
|
374
374
|
entryActiveStyles: {},
|
|
@@ -379,107 +379,115 @@ const Ne = { class: "acp" }, Re = { class: "acpRing" }, He = { class: "acpParams
|
|
|
379
379
|
panelClickStopPropagation: { type: Boolean },
|
|
380
380
|
showPackageName: { type: Boolean }
|
|
381
381
|
},
|
|
382
|
-
emits: ["
|
|
383
|
-
setup(
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
m.value = i, b.value = i, w("change", i);
|
|
382
|
+
emits: ["done", "update:modelValue", "update:modelValueSelectedPreset"],
|
|
383
|
+
setup(o, { expose: P, emit: m }) {
|
|
384
|
+
const t = o, g = I(), i = I(), u = I("#ff0000"), C = F(() => {
|
|
385
|
+
let c = null;
|
|
386
|
+
return g.value && (c = t.presets?.find((d) => d.name == g.value)?.colorHex), c || u.value;
|
|
387
|
+
}), { panelShow: E, closePanel: $, togglePanel: L, entryStylesActual: B } = de(t, C), { panelStyles: H } = ve(t);
|
|
388
|
+
function h(c) {
|
|
389
|
+
g.value = c?.name, w("update:modelValueSelectedPreset", c?.name);
|
|
391
390
|
}
|
|
392
|
-
|
|
393
|
-
|
|
391
|
+
const w = m;
|
|
392
|
+
j(u, (c) => {
|
|
393
|
+
w("update:modelValue", c);
|
|
394
|
+
});
|
|
395
|
+
function R(c) {
|
|
396
|
+
u.value = c, $();
|
|
394
397
|
}
|
|
395
|
-
function
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
b.value = d, (l = T.value) == null || l.enforceTo(d), R.value || (m.value = d);
|
|
398
|
+
function b(c) {
|
|
399
|
+
if (ee(c)) {
|
|
400
|
+
const r = W(c);
|
|
401
|
+
u.value = r, i.value?.enforceTo(r);
|
|
400
402
|
}
|
|
401
403
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
l && C(l, !0);
|
|
404
|
+
function y(c) {
|
|
405
|
+
c || h(void 0);
|
|
406
|
+
const r = t.presets?.find((d) => d.name === c);
|
|
407
|
+
r && h(r);
|
|
407
408
|
}
|
|
408
|
-
return
|
|
409
|
-
|
|
410
|
-
}),
|
|
411
|
-
c
|
|
412
|
-
}), (
|
|
413
|
-
|
|
409
|
+
return P({ closePanel: $, enforceCustomValueTo: b, enforcePresetTo: y }), j(E, (c) => {
|
|
410
|
+
c === !1 && w("done");
|
|
411
|
+
}), j(() => t.modelValue, (c) => {
|
|
412
|
+
c && b(c);
|
|
413
|
+
}), j(() => t.modelValueSelectedPreset, (c) => {
|
|
414
|
+
y(c);
|
|
415
|
+
}), ue(() => {
|
|
416
|
+
t.modelValue ? b(t.modelValue) : t.initial && b(t.initial), t.modelValueSelectedPreset ? y(t.modelValueSelectedPreset) : t.initialSelectedPreset && y(t.initialSelectedPreset);
|
|
417
|
+
}), (c, r) => (N(), T("div", Xe, [
|
|
418
|
+
v("div", {
|
|
414
419
|
class: "acpEntry",
|
|
415
|
-
style:
|
|
416
|
-
onClick:
|
|
417
|
-
(...d) =>
|
|
420
|
+
style: X(k(B)),
|
|
421
|
+
onClick: r[0] || (r[0] = //@ts-ignore
|
|
422
|
+
(...d) => k(L) && k(L)(...d))
|
|
418
423
|
}, null, 4),
|
|
419
|
-
|
|
424
|
+
k(E) ? (N(), T("div", {
|
|
420
425
|
key: 0,
|
|
421
426
|
class: "acpPanel",
|
|
422
|
-
style:
|
|
423
|
-
onClick:
|
|
427
|
+
style: X(k(H)),
|
|
428
|
+
onClick: r[6] || (r[6] = (d) => o.panelClickStopPropagation && d.stopPropagation())
|
|
424
429
|
}, [
|
|
425
|
-
|
|
426
|
-
|
|
430
|
+
v("div", Ze, [
|
|
431
|
+
v("label", {
|
|
432
|
+
for: "acpColorPresetCustom",
|
|
433
|
+
onClick: r[3] || (r[3] = (d) => h(void 0))
|
|
434
|
+
}, [
|
|
427
435
|
ce(je, {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
onDone:
|
|
436
|
+
modelValue: u.value,
|
|
437
|
+
"onUpdate:modelValue": r[1] || (r[1] = (d) => u.value = d),
|
|
438
|
+
onDone: R,
|
|
431
439
|
"entry-class-name": "acpPresetBody",
|
|
432
440
|
ref_key: "customPicker",
|
|
433
|
-
ref:
|
|
434
|
-
"show-package-name":
|
|
435
|
-
pos:
|
|
436
|
-
}, null, 8, ["
|
|
437
|
-
|
|
441
|
+
ref: i,
|
|
442
|
+
"show-package-name": o.showPackageName,
|
|
443
|
+
pos: o.posInternal
|
|
444
|
+
}, null, 8, ["modelValue", "show-package-name", "pos"]),
|
|
445
|
+
Q(v("input", {
|
|
438
446
|
name: "colorType",
|
|
439
447
|
type: "radio",
|
|
440
448
|
id: "acpColorPresetCustom",
|
|
441
449
|
value: void 0,
|
|
442
|
-
"onUpdate:modelValue":
|
|
443
|
-
onClick: l[2] || (l[2] = (d) => C())
|
|
450
|
+
"onUpdate:modelValue": r[2] || (r[2] = (d) => g.value = d)
|
|
444
451
|
}, null, 512), [
|
|
445
|
-
[
|
|
452
|
+
[oe, g.value]
|
|
446
453
|
]),
|
|
447
|
-
|
|
454
|
+
r[7] || (r[7] = v("div", { class: "acpPresetName" }, "自定义", -1))
|
|
448
455
|
]),
|
|
449
|
-
|
|
450
|
-
(
|
|
451
|
-
for: `acpColorPreset${d.name}
|
|
456
|
+
r[8] || (r[8] = v("div", { class: "acpSep" }, null, -1)),
|
|
457
|
+
(N(!0), T(Ce, null, Se(o.presets, (d) => (N(), T("label", {
|
|
458
|
+
for: `acpColorPreset${d.name}`,
|
|
459
|
+
onClick: (q) => h(d),
|
|
460
|
+
key: d.name
|
|
452
461
|
}, [
|
|
453
|
-
|
|
462
|
+
v("div", {
|
|
454
463
|
class: "acpPresetBody",
|
|
455
|
-
style:
|
|
464
|
+
style: X({ backgroundColor: d.colorHex })
|
|
456
465
|
}, null, 4),
|
|
457
|
-
|
|
466
|
+
Q(v("input", {
|
|
458
467
|
name: "colorType",
|
|
459
468
|
type: "radio",
|
|
460
469
|
id: `acpColorPreset${d.name}`,
|
|
461
470
|
value: d.name,
|
|
462
|
-
"onUpdate:modelValue":
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
[ne, R.value]
|
|
471
|
+
"onUpdate:modelValue": r[4] || (r[4] = (q) => g.value = q)
|
|
472
|
+
}, null, 8, Ke), [
|
|
473
|
+
[oe, g.value]
|
|
466
474
|
]),
|
|
467
|
-
|
|
468
|
-
], 8,
|
|
469
|
-
|
|
475
|
+
v("div", Ye, we(d.name), 1)
|
|
476
|
+
], 8, Fe))), 128)),
|
|
477
|
+
r[9] || (r[9] = v("div", { class: "acpSep" }, null, -1))
|
|
470
478
|
]),
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
onClick:
|
|
474
|
-
(...d) =>
|
|
479
|
+
v("div", Ge, [
|
|
480
|
+
v("button", {
|
|
481
|
+
onClick: r[5] || (r[5] = //@ts-ignore
|
|
482
|
+
(...d) => k($) && k($)(...d))
|
|
475
483
|
}, "OK")
|
|
476
484
|
])
|
|
477
|
-
], 4)) :
|
|
485
|
+
], 4)) : J("", !0)
|
|
478
486
|
]));
|
|
479
487
|
}
|
|
480
|
-
}),
|
|
488
|
+
}), tt = /* @__PURE__ */ ne(Je, [["__scopeId", "data-v-6d20c9c4"]]);
|
|
481
489
|
export {
|
|
482
490
|
je as AuColorPicker,
|
|
483
|
-
|
|
484
|
-
|
|
491
|
+
tt as AuColorPickerPresetsNested,
|
|
492
|
+
De as AuColorPickerRing
|
|
485
493
|
};
|
|
@@ -7,11 +7,11 @@ declare const _default: import('vue').DefineComponent<PickerProps, {
|
|
|
7
7
|
getCurrentHex: typeof getCurrentHex;
|
|
8
8
|
enforceTo: typeof enforceTo;
|
|
9
9
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
|
-
done: (
|
|
11
|
-
|
|
10
|
+
done: () => any;
|
|
11
|
+
"update:modelValue": (hexStr: string) => any;
|
|
12
12
|
}, string, import('vue').PublicProps, Readonly<PickerProps> & Readonly<{
|
|
13
|
-
onDone?: ((
|
|
14
|
-
|
|
13
|
+
onDone?: (() => any) | undefined;
|
|
14
|
+
"onUpdate:modelValue"?: ((hexStr: string) => any) | undefined;
|
|
15
15
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
16
|
ring: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
17
17
|
initialHex?: string;
|
|
@@ -6,24 +6,24 @@ declare const _default: import('vue').DefineComponent<PickerWithPresetsProps, {
|
|
|
6
6
|
enforceCustomValueTo: typeof enforceCustomValueTo;
|
|
7
7
|
enforcePresetTo: typeof enforcePresetTo;
|
|
8
8
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
9
|
-
done: (
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
done: () => any;
|
|
10
|
+
"update:modelValue": (hexStr: string) => any;
|
|
11
|
+
"update:modelValueSelectedPreset": (name: string | undefined) => any;
|
|
12
12
|
}, string, import('vue').PublicProps, Readonly<PickerWithPresetsProps> & Readonly<{
|
|
13
|
-
onDone?: ((
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
onDone?: (() => any) | undefined;
|
|
14
|
+
"onUpdate:modelValue"?: ((hexStr: string) => any) | undefined;
|
|
15
|
+
"onUpdate:modelValueSelectedPreset"?: ((name: string | undefined) => any) | undefined;
|
|
16
16
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
17
17
|
customPicker: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('..').PickerProps> & Readonly<{
|
|
18
|
-
onDone?: ((
|
|
19
|
-
|
|
18
|
+
onDone?: (() => any) | undefined;
|
|
19
|
+
"onUpdate:modelValue"?: ((hexStr: string) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
21
|
closePanel: () => void;
|
|
22
22
|
getCurrentHex: () => string;
|
|
23
23
|
enforceTo: (newHexValue: string) => void;
|
|
24
24
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
25
|
-
done: (
|
|
26
|
-
|
|
25
|
+
done: () => any;
|
|
26
|
+
"update:modelValue": (hexStr: string) => any;
|
|
27
27
|
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
28
28
|
ring: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
29
29
|
initialHex?: string;
|
|
@@ -58,8 +58,8 @@ declare const _default: import('vue').DefineComponent<PickerWithPresetsProps, {
|
|
|
58
58
|
M: {};
|
|
59
59
|
Defaults: {};
|
|
60
60
|
}, Readonly<import('..').PickerProps> & Readonly<{
|
|
61
|
-
onDone?: ((
|
|
62
|
-
|
|
61
|
+
onDone?: (() => any) | undefined;
|
|
62
|
+
"onUpdate:modelValue"?: ((hexStr: string) => any) | undefined;
|
|
63
63
|
}>, {
|
|
64
64
|
closePanel: () => void;
|
|
65
65
|
getCurrentHex: () => string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from 'vue';
|
|
2
2
|
type Pos = 'left' | 'right' | number;
|
|
3
3
|
export interface PickerProps {
|
|
4
|
+
modelValue?: string;
|
|
4
5
|
initial?: string;
|
|
5
6
|
entryStyles?: CSSProperties;
|
|
6
7
|
entryActiveStyles?: CSSProperties;
|
|
@@ -12,6 +13,7 @@ export interface PickerProps {
|
|
|
12
13
|
showPackageName?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface PickerWithPresetsProps extends PickerProps {
|
|
16
|
+
modelValueSelectedPreset?: string;
|
|
15
17
|
initialSelectedPreset?: string;
|
|
16
18
|
presets?: NamedPreset[];
|
|
17
19
|
posInternal?: Pos;
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurouscia/au-color-picker",
|
|
3
|
+
"version": "1.0.0",
|
|
3
4
|
"author": {
|
|
4
5
|
"name": "Au"
|
|
5
6
|
},
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
|
-
"url": "https://gitee.com/au114514/au-
|
|
10
|
+
"url": "https://gitee.com/au114514/au-npm-pkgs",
|
|
11
|
+
"directory": "packages/au-color-picker"
|
|
10
12
|
},
|
|
11
13
|
"description": "vue3颜色选择器组件",
|
|
12
14
|
"keywords": [
|
|
@@ -14,7 +16,6 @@
|
|
|
14
16
|
"color",
|
|
15
17
|
"component"
|
|
16
18
|
],
|
|
17
|
-
"version": "0.5.1",
|
|
18
19
|
"type": "module",
|
|
19
20
|
"files": [
|
|
20
21
|
"dist"
|
|
@@ -36,16 +37,16 @@
|
|
|
36
37
|
"prepack": "npm run build"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"color-convert": "^
|
|
40
|
-
"vue": "^3.5.
|
|
40
|
+
"color-convert": "^3.1.2",
|
|
41
|
+
"vue": "^3.5.22"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/color-convert": "^2.0.4",
|
|
44
|
-
"@types/node": "^
|
|
45
|
-
"@vitejs/plugin-vue": "^
|
|
46
|
-
"sass": "^1.
|
|
47
|
-
"typescript": "^5.
|
|
48
|
-
"vite": "^
|
|
45
|
+
"@types/node": "^24.9.2",
|
|
46
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
47
|
+
"sass": "^1.93.3",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vite": "^7.1.12",
|
|
49
50
|
"vite-plugin-dts": "^4.5.4"
|
|
50
51
|
}
|
|
51
52
|
}
|