@pantograph/vue 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionButton/index.js.js +1 -1
- package/dist/ActionButton/index.umd.cjs.js +1 -1
- package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-Db3ryil1.js → ActionButton.vue_vue_type_script_setup_true_lang-BVtP6mpl.js} +1 -1
- package/dist/{ActionButton.vue_vue_type_script_setup_true_lang-ClxZJxTh.js → ActionButton.vue_vue_type_script_setup_true_lang-KL8JuFlI.js} +2 -2
- package/dist/Avatar/index.js.js +1 -1
- package/dist/Avatar/index.umd.cjs.js +1 -1
- package/dist/{Avatar.vue_vue_type_style_index_0_lang-B538jct0.js → Avatar.vue_vue_type_style_index_0_lang-BHYcXGuX.js} +2 -2
- package/dist/{Avatar.vue_vue_type_style_index_0_lang-BSi0qbuq.js → Avatar.vue_vue_type_style_index_0_lang-DKGY3npY.js} +1 -1
- package/dist/AvatarGroup/index.js.js +1 -1
- package/dist/AvatarGroup/index.umd.cjs.js +1 -1
- package/dist/Badge/index.js.js +1 -1
- package/dist/Badge/index.umd.cjs.js +1 -1
- package/dist/{Badge.vue_vue_type_script_setup_true_lang-CKxCSXXL.js → Badge.vue_vue_type_script_setup_true_lang-BcdNUohN.js} +1 -1
- package/dist/{Badge.vue_vue_type_script_setup_true_lang-CfA3dSJr.js → Badge.vue_vue_type_script_setup_true_lang-nmw9qfJ_.js} +1 -1
- package/dist/{BaseButton.vue_vue_type_style_index_0_lang-s4G57j5o.js → BaseButton.vue_vue_type_style_index_0_lang-BrQJfrgg.js} +1 -1
- package/dist/{BaseButton.vue_vue_type_style_index_0_lang-gzePKYHN.js → BaseButton.vue_vue_type_style_index_0_lang-CTK5nNR6.js} +1 -1
- package/dist/Button/index.js.js +1 -1
- package/dist/Button/index.umd.cjs.js +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-BVCP3jP3.js → Button.vue_vue_type_script_setup_true_lang-7V57ztN4.js} +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-B8DWC8Du.js → Button.vue_vue_type_script_setup_true_lang-DIj3gT2D.js} +2 -2
- package/dist/Checkbox/index.js.js +1 -1
- package/dist/Checkbox/index.umd.cjs.js +1 -1
- package/dist/{Checkbox.vue_vue_type_style_index_0_lang-Bm6sm_wm.js → Checkbox.vue_vue_type_style_index_0_lang-C6Mdufam.js} +1 -1
- package/dist/{Checkbox.vue_vue_type_style_index_0_lang-maH6mbC5.js → Checkbox.vue_vue_type_style_index_0_lang-DNlvOQmv.js} +2 -2
- package/dist/CheckboxGroup/index.js.js +1 -1
- package/dist/CheckboxGroup/index.umd.cjs.js +1 -1
- package/dist/ColorPicker/index.js.js +1 -1
- package/dist/ColorPicker/index.umd.cjs.js +1 -1
- package/dist/ColorPicker.vue_vue_type_style_index_0_lang-C36JPo4m.js +1 -0
- package/dist/ColorPicker.vue_vue_type_style_index_0_lang-Dq-kFXox.js +541 -0
- package/dist/ColorSwatch/index.js.js +1 -1
- package/dist/ColorSwatch/index.umd.cjs.js +1 -1
- package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-Dki5150Z.js → ColorSwatch.vue_vue_type_style_index_0_lang-Bo-zDAyc.js} +1 -1
- package/dist/{ColorSwatch.vue_vue_type_style_index_0_lang-Bf0glWPU.js → ColorSwatch.vue_vue_type_style_index_0_lang-DmLhCPh4.js} +3 -3
- package/dist/ColorSwatchGroup/index.js.js +3 -163
- package/dist/ColorSwatchGroup/index.umd.cjs.js +1 -1
- package/dist/ColorSwatchGroup.vue_vue_type_style_index_0_lang-CIkTvqD_.js +165 -0
- package/dist/ColorSwatchGroup.vue_vue_type_style_index_0_lang-T_L-D2SS.js +1 -0
- package/dist/ColorTrigger/index.js.js +4 -90
- package/dist/ColorTrigger/index.umd.cjs.js +1 -1
- package/dist/ColorTrigger.vue_vue_type_style_index_0_lang-DSZ8fAZ9.js +91 -0
- package/dist/ColorTrigger.vue_vue_type_style_index_0_lang-DwyinKNj.js +1 -0
- package/dist/FloatButton/index.js.js +1 -1
- package/dist/FloatButton/index.umd.cjs.js +1 -1
- package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-iElZdgSE.js → FloatButton.vue_vue_type_script_setup_true_lang-Bapsnc_p.js} +2 -2
- package/dist/{FloatButton.vue_vue_type_script_setup_true_lang-DARsq4US.js → FloatButton.vue_vue_type_script_setup_true_lang-C56u1xaL.js} +1 -1
- package/dist/GraphicalObject/index.js.js +1 -1
- package/dist/GraphicalObject/index.umd.cjs.js +1 -1
- package/dist/{GraphicalObject.vue_vue_type_script_setup_true_lang-Cc4PxUnd.js → GraphicalObject.vue_vue_type_script_setup_true_lang-B3FouRlw.js} +1 -1
- package/dist/{GraphicalObject.vue_vue_type_script_setup_true_lang-Bouixpu2.js → GraphicalObject.vue_vue_type_script_setup_true_lang-DlMeNk_1.js} +1 -1
- package/dist/IconButton/index.js.js +1 -1
- package/dist/IconButton/index.umd.cjs.js +1 -1
- package/dist/{IconButton.vue_vue_type_script_setup_true_lang-CufKPHFD.js → IconButton.vue_vue_type_script_setup_true_lang-7QB-mmyg.js} +1 -1
- package/dist/{IconButton.vue_vue_type_script_setup_true_lang-D1nK8pEU.js → IconButton.vue_vue_type_script_setup_true_lang-dI6-RNyi.js} +2 -2
- package/dist/IndentLevel/index.js.js +1 -1
- package/dist/IndentLevel/index.umd.cjs.js +1 -1
- package/dist/{IndentLevel.vue_vue_type_style_index_0_lang-C9mNx1Zx.js → IndentLevel.vue_vue_type_style_index_0_lang-CM6s5E6c.js} +1 -1
- package/dist/{IndentLevel.vue_vue_type_style_index_0_lang-CKJpRLV6.js → IndentLevel.vue_vue_type_style_index_0_lang-nGsyFkwr.js} +1 -1
- package/dist/Indicator/index.js.js +1 -1
- package/dist/Indicator/index.umd.cjs.js +1 -1
- package/dist/{Indicator.vue_vue_type_script_setup_true_lang-DpPAMjWw.js → Indicator.vue_vue_type_script_setup_true_lang-C4Ecg4iy.js} +1 -1
- package/dist/{Indicator.vue_vue_type_script_setup_true_lang-DURlzRTQ.js → Indicator.vue_vue_type_script_setup_true_lang-ICqvLVbq.js} +1 -1
- package/dist/Input/index.d.ts +2 -0
- package/dist/Input/index.js.js +7 -0
- package/dist/Input/index.umd.cjs.js +1 -0
- package/dist/Input.vue_vue_type_style_index_0_lang-D0zx-hd_.js +1 -0
- package/dist/Input.vue_vue_type_style_index_0_lang-cjYJlwXf.js +413 -0
- package/dist/Menu/index.js.js +1 -1
- package/dist/Menu/index.umd.cjs.js +1 -1
- package/dist/{Menu.vue_vue_type_style_index_0_lang-Danl_w4K.js → Menu.vue_vue_type_style_index_0_lang-DHGED80D.js} +17 -16
- package/dist/Menu.vue_vue_type_style_index_0_lang-DU0Rexv8.js +1 -0
- package/dist/MenuItem/MenuItem.d.ts +1 -1
- package/dist/MenuItem/index.js.js +1 -1
- package/dist/MenuItem/index.umd.cjs.js +1 -1
- package/dist/Popover/index.js.js +1 -1
- package/dist/Popover/index.umd.cjs.js +1 -1
- package/dist/{Popover.vue_vue_type_style_index_0_lang-DkM_Ynrg.js → Popover.vue_vue_type_style_index_0_lang-C0IwnsU5.js} +2 -2
- package/dist/{Popover.vue_vue_type_style_index_0_lang-pSXmj4z1.js → Popover.vue_vue_type_style_index_0_lang-CM8qMFEi.js} +1 -1
- package/dist/RadioGroup/index.js.js +1 -1
- package/dist/RadioGroup/index.umd.cjs.js +1 -1
- package/dist/{RadioGroup.vue_vue_type_script_setup_true_lang-NNLg5ogX.js → RadioGroup.vue_vue_type_script_setup_true_lang-DWfKIuDH.js} +1 -1
- package/dist/{RadioGroup.vue_vue_type_script_setup_true_lang-8BgnVYlc.js → RadioGroup.vue_vue_type_script_setup_true_lang-s-m7W1By.js} +1 -1
- package/dist/Switch/index.js.js +1 -1
- package/dist/Switch/index.umd.cjs.js +1 -1
- package/dist/{Switch.vue_vue_type_style_index_0_lang-_FIrRkI7.js → Switch.vue_vue_type_style_index_0_lang-BzC8-ylY.js} +1 -1
- package/dist/{Switch.vue_vue_type_style_index_0_lang-B9_IPFyg.js → Switch.vue_vue_type_style_index_0_lang-DnNHGn1c.js} +1 -1
- package/dist/Tree/index.js.js +1 -1
- package/dist/Tree/index.umd.cjs.js +1 -1
- package/dist/{Tree.vue_vue_type_style_index_0_lang-D9GBs86I.js → Tree.vue_vue_type_style_index_0_lang-B-BPV_p7.js} +19 -19
- package/dist/Tree.vue_vue_type_style_index_0_lang-BIpFWo5L.js +1 -0
- package/dist/_flatRest-CHX8vV1P.js +556 -0
- package/dist/_flatRest-R59G2N4m.js +1 -0
- package/dist/{cloneDeep-7ho7cOLj.js → cloneDeep-BMA7VTX1.js} +1 -1
- package/dist/cloneDeep-BcKVMzWC.js +1 -0
- package/dist/get-B4UJlXpC.js +1 -0
- package/dist/{get-CdoyK4GU.js → get-Q8GXlj-L.js} +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js.js +117 -100
- package/dist/index.umd.cjs.js +1 -1
- package/dist/omit-BEkBWXra.js +212 -0
- package/dist/omit-BKPbELUG.js +1 -0
- package/dist/pick-C-ap2Lj0.js +1 -0
- package/dist/{pick-BHVX8oMF.js → pick-DLskPTKb.js} +1 -1
- package/dist/style/index.css +1 -1
- package/package.json +6 -1
- package/dist/ColorPicker.vue_vue_type_style_index_0_lang-CROQzfNe.js +0 -944
- package/dist/ColorPicker.vue_vue_type_style_index_0_lang-IZSWne-0.js +0 -1
- package/dist/Menu.vue_vue_type_style_index_0_lang-eKNVzfnz.js +0 -1
- package/dist/Tree.vue_vue_type_style_index_0_lang-B3ZzwkLN.js +0 -1
- package/dist/cloneDeep-C6tiVz1k.js +0 -1
- package/dist/get-BULsy4gy.js +0 -1
- package/dist/omit-BHZMfUBv.js +0 -757
- package/dist/omit-DlH5U9Jc.js +0 -1
- package/dist/pick-DpwC5mlg.js +0 -1
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
import { onUnmounted as we, defineComponent as ue, onMounted as ae, onBeforeUnmount as ye, createElementBlock as D, openBlock as C, normalizeClass as T, unref as v, createElementVNode as E, ref as j, computed as R, watch as xe, reactive as Ce, createVNode as Q, createCommentVNode as Z, createBlock as Y, Fragment as Te, renderList as Ve } from "vue";
|
|
2
|
+
import { _ as ke } from "./ActionButton.vue_vue_type_script_setup_true_lang-KL8JuFlI.js";
|
|
3
|
+
import { _ as ee } from "./Input.vue_vue_type_style_index_0_lang-cjYJlwXf.js";
|
|
4
|
+
import { _ as Ee } from "./Icon.vue_vue_type_style_index_0_lang-BfPcw6PU.js";
|
|
5
|
+
import { useVModel as te } from "@vueuse/core";
|
|
6
|
+
import { b as P, g as Me, c as ne } from "./class-DziTeW9B.js";
|
|
7
|
+
import { createContext as _e } from "radix-vue";
|
|
8
|
+
function S(e, t, o) {
|
|
9
|
+
return Math.max(t, Math.min(e, o));
|
|
10
|
+
}
|
|
11
|
+
function Ae(e, t) {
|
|
12
|
+
if (typeof e == "string" || typeof t == "string")
|
|
13
|
+
return e === t;
|
|
14
|
+
if (e) {
|
|
15
|
+
if (!t) return !1;
|
|
16
|
+
for (const o in e)
|
|
17
|
+
if (e[o] !== t[o])
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
return !0;
|
|
21
|
+
}
|
|
22
|
+
function F(e) {
|
|
23
|
+
const t = [], o = e.length > 5 ? 2 : 1;
|
|
24
|
+
for (let n = 1; n < e.length; n += o) {
|
|
25
|
+
const u = e.substring(n, n + o).repeat(o % 2 + 1), a = parseInt(u, 16);
|
|
26
|
+
t.push(n === 3 * o + 1 ? a / 255 : a);
|
|
27
|
+
}
|
|
28
|
+
return t.length === 3 && t.push(1), {
|
|
29
|
+
r: t[0],
|
|
30
|
+
g: t[1],
|
|
31
|
+
b: t[2],
|
|
32
|
+
a: t[3]
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function ie(e) {
|
|
36
|
+
const t = e.l / 100, o = t + e.s / 100 * Math.min(t, 1 - t), n = o === 0 ? 0 : 200 * (1 - t / o);
|
|
37
|
+
return {
|
|
38
|
+
h: e.h,
|
|
39
|
+
s: n,
|
|
40
|
+
v: o * 100,
|
|
41
|
+
a: e.a
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function O(e) {
|
|
45
|
+
let t = e.h % 360;
|
|
46
|
+
t < 0 && (t += 360);
|
|
47
|
+
const o = e.s / 100, n = e.l / 100;
|
|
48
|
+
return {
|
|
49
|
+
r: K(0, t, o, n) * 255,
|
|
50
|
+
g: K(8, t, o, n) * 255,
|
|
51
|
+
b: K(4, t, o, n) * 255,
|
|
52
|
+
a: e.a
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function K(e, t, o, n) {
|
|
56
|
+
const u = (e + t / 30) % 12, a = o * Math.min(n, 1 - n);
|
|
57
|
+
return n - a * Math.max(-1, Math.min(u - 3, 9 - u, 1));
|
|
58
|
+
}
|
|
59
|
+
function ce(e) {
|
|
60
|
+
const t = e.s / 100, o = e.v / 100, n = o * (1 - t / 2);
|
|
61
|
+
return {
|
|
62
|
+
h: e.h,
|
|
63
|
+
s: n === 0 || n === 1 ? 0 : (o - n) / Math.min(n, 1 - n) * 100,
|
|
64
|
+
l: n * 100,
|
|
65
|
+
a: e.a
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function fe(e) {
|
|
69
|
+
return {
|
|
70
|
+
h: e.h,
|
|
71
|
+
w: e.v * (100 - e.s) / 100,
|
|
72
|
+
b: 100 - e.v,
|
|
73
|
+
a: e.a
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function N(e) {
|
|
77
|
+
return O(ce(e));
|
|
78
|
+
}
|
|
79
|
+
function k(e) {
|
|
80
|
+
const t = e.w / 100, o = e.b / 100;
|
|
81
|
+
let n, u;
|
|
82
|
+
const a = t + o;
|
|
83
|
+
return a >= 1 ? (n = 0, u = t / a) : (u = 1 - o, n = (1 - t / u) * 100), {
|
|
84
|
+
h: e.h,
|
|
85
|
+
s: n,
|
|
86
|
+
v: u * 100,
|
|
87
|
+
a: e.a
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function W(e) {
|
|
91
|
+
const { r: t, g: o, b: n, a: u } = e, a = Math.min(t, o, n), m = Math.max(t, o, n), f = m - a, h = (m + a) / 2;
|
|
92
|
+
let p = 0;
|
|
93
|
+
f !== 0 && (m === t ? p = (o - n) / f + (o < n ? 6 : 0) : m === o ? p = (n - t) / f + 2 : m === n && (p = (t - o) / f + 4), p *= 60);
|
|
94
|
+
let b = 0;
|
|
95
|
+
return h !== 0 && h !== 255 && (b = (m - h) / Math.min(h, 255 - h)), {
|
|
96
|
+
h: p,
|
|
97
|
+
s: b * 100,
|
|
98
|
+
l: h / 255 * 100,
|
|
99
|
+
a: u
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function $(e) {
|
|
103
|
+
return "#" + Object.values(e).map(
|
|
104
|
+
(t, o) => Math.round(o === 3 ? t * 255 : t).toString(16).padStart(2, "0")
|
|
105
|
+
).join("");
|
|
106
|
+
}
|
|
107
|
+
function H(e) {
|
|
108
|
+
return fe(ie(W(e)));
|
|
109
|
+
}
|
|
110
|
+
const Ne = {
|
|
111
|
+
hex: {
|
|
112
|
+
hex: (e) => e,
|
|
113
|
+
hsl: (e) => W(F(e)),
|
|
114
|
+
hsv: (e) => k(H(F(e))),
|
|
115
|
+
hwb: (e) => H(F(e)),
|
|
116
|
+
rgb: F
|
|
117
|
+
},
|
|
118
|
+
hsl: {
|
|
119
|
+
hex: (e) => $(O(e)),
|
|
120
|
+
hsl: (e) => e,
|
|
121
|
+
hsv: ie,
|
|
122
|
+
hwb: (e) => H(O(e)),
|
|
123
|
+
rgb: O
|
|
124
|
+
},
|
|
125
|
+
hsv: {
|
|
126
|
+
hex: (e) => $(N(e)),
|
|
127
|
+
hsl: ce,
|
|
128
|
+
hsv: (e) => e,
|
|
129
|
+
hwb: fe,
|
|
130
|
+
rgb: N
|
|
131
|
+
},
|
|
132
|
+
hwb: {
|
|
133
|
+
hex: (e) => $(N(k(e))),
|
|
134
|
+
hsl: (e) => W(N(k(e))),
|
|
135
|
+
hsv: k,
|
|
136
|
+
hwb: (e) => e,
|
|
137
|
+
rgb: (e) => N(k(e))
|
|
138
|
+
},
|
|
139
|
+
rgb: {
|
|
140
|
+
hex: $,
|
|
141
|
+
hsl: W,
|
|
142
|
+
hsv: (e) => k(H(e)),
|
|
143
|
+
hwb: H,
|
|
144
|
+
rgb: (e) => e
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
function oe(e, t, o) {
|
|
148
|
+
return Ne[e][t](o);
|
|
149
|
+
}
|
|
150
|
+
function He(e, t) {
|
|
151
|
+
const o = e.toFixed(t);
|
|
152
|
+
return o.includes(".") ? o.replace(/\.?0+$/, "") : o;
|
|
153
|
+
}
|
|
154
|
+
const Pe = {
|
|
155
|
+
deg: 1,
|
|
156
|
+
grad: 0.9,
|
|
157
|
+
rad: 180 / Math.PI,
|
|
158
|
+
turn: 360
|
|
159
|
+
}, B = {
|
|
160
|
+
from(e) {
|
|
161
|
+
return e.endsWith("%") ? M.from(e, { referenceValue: 1 }) : y.from(e, { min: 0, max: 1 });
|
|
162
|
+
},
|
|
163
|
+
to(e) {
|
|
164
|
+
return y.to(e);
|
|
165
|
+
}
|
|
166
|
+
}, re = {
|
|
167
|
+
from(e) {
|
|
168
|
+
const t = e.match(/deg|g?rad|turn$/);
|
|
169
|
+
if (t === null)
|
|
170
|
+
return y.from(e);
|
|
171
|
+
const o = t[0];
|
|
172
|
+
return y.from(e.slice(0, -o.length)) * Pe[o];
|
|
173
|
+
},
|
|
174
|
+
to(e) {
|
|
175
|
+
return y.to(e);
|
|
176
|
+
}
|
|
177
|
+
}, y = {
|
|
178
|
+
from(e, { min: t = Number.NEGATIVE_INFINITY, max: o = Number.POSITIVE_INFINITY } = {}) {
|
|
179
|
+
return e.endsWith(".") ? NaN : S(Number(e), t, o);
|
|
180
|
+
},
|
|
181
|
+
to(e) {
|
|
182
|
+
return He(e, 2);
|
|
183
|
+
}
|
|
184
|
+
}, M = {
|
|
185
|
+
from(e, { referenceValue: t = 100, min: o = 0, max: n = 100 } = {}) {
|
|
186
|
+
return e.endsWith("%") ? y.from(e.slice(0, -1), { min: o, max: n }) * t / 100 : NaN;
|
|
187
|
+
},
|
|
188
|
+
to(e) {
|
|
189
|
+
return y.to(e) + "%";
|
|
190
|
+
}
|
|
191
|
+
}, q = {
|
|
192
|
+
from(e) {
|
|
193
|
+
return e.endsWith("%") ? M.from(e, { referenceValue: 255 }) : y.from(e, { min: 0, max: 255 });
|
|
194
|
+
},
|
|
195
|
+
to(e) {
|
|
196
|
+
return y.to(e);
|
|
197
|
+
}
|
|
198
|
+
}, Se = {
|
|
199
|
+
hsl: {
|
|
200
|
+
h: re,
|
|
201
|
+
s: M,
|
|
202
|
+
l: M
|
|
203
|
+
},
|
|
204
|
+
hwb: {
|
|
205
|
+
h: re,
|
|
206
|
+
w: M,
|
|
207
|
+
b: M
|
|
208
|
+
},
|
|
209
|
+
rgb: {
|
|
210
|
+
r: q,
|
|
211
|
+
g: q,
|
|
212
|
+
b: q
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
function U(e, t) {
|
|
216
|
+
return Se[e][t];
|
|
217
|
+
}
|
|
218
|
+
function G({ format: e, color: t }, o) {
|
|
219
|
+
if (e === "hex")
|
|
220
|
+
return o && [5, 9].includes(t.length) ? t.substring(0, t.length - (t.length - 1) / 4) : t;
|
|
221
|
+
const n = Object.entries(t).slice(0, o ? 3 : 4).map(([u, a]) => {
|
|
222
|
+
const m = u === "a" ? B : U(e, u);
|
|
223
|
+
return (u === "a" ? "/ " : "") + m.to(a);
|
|
224
|
+
});
|
|
225
|
+
return `${e}(${n.join(" ")})`;
|
|
226
|
+
}
|
|
227
|
+
function me(e) {
|
|
228
|
+
return /^#(?:(?:[A-F0-9]{2}){3,4}|[A-F0-9]{3,4})$/i.test(e);
|
|
229
|
+
}
|
|
230
|
+
function Le(e) {
|
|
231
|
+
return "r" in e ? "rgb" : "w" in e ? "hwb" : "v" in e ? "hsv" : "s" in e ? "hsl" : null;
|
|
232
|
+
}
|
|
233
|
+
const se = {
|
|
234
|
+
hsl: ["h", "s", "l", "a"],
|
|
235
|
+
hwb: ["h", "w", "b", "a"],
|
|
236
|
+
rgb: ["r", "g", "b", "a"]
|
|
237
|
+
};
|
|
238
|
+
function le(e) {
|
|
239
|
+
if (!e) return null;
|
|
240
|
+
if (typeof e != "string") {
|
|
241
|
+
const f = Le(e);
|
|
242
|
+
return f === null ? null : { format: f, color: e };
|
|
243
|
+
}
|
|
244
|
+
if (e.startsWith("#"))
|
|
245
|
+
return me(e) ? { format: "hex", color: e } : null;
|
|
246
|
+
if (!e.includes("(")) {
|
|
247
|
+
const f = document.createElement("canvas").getContext("2d");
|
|
248
|
+
f.fillStyle = e;
|
|
249
|
+
const h = f.fillStyle;
|
|
250
|
+
return h === "#000000" && e !== "black" ? null : { format: "hex", color: h };
|
|
251
|
+
}
|
|
252
|
+
const [t, o] = e.split("("), n = t.substring(0, 3);
|
|
253
|
+
if (!(n in se))
|
|
254
|
+
return null;
|
|
255
|
+
const u = o.replace(/[,/)]/g, " ").replace(/\s+/g, " ").trim().split(" ");
|
|
256
|
+
u.length === 3 && u.push("1");
|
|
257
|
+
const a = se[n], m = Object.fromEntries(
|
|
258
|
+
a.map((f, h) => {
|
|
259
|
+
const p = f === "a" ? B : U(n, f);
|
|
260
|
+
return [f, p.from(u[h])];
|
|
261
|
+
})
|
|
262
|
+
);
|
|
263
|
+
return { format: n, color: m };
|
|
264
|
+
}
|
|
265
|
+
const Ie = typeof window < "u", he = Ie && "EyeDropper" in window, Re = (e) => {
|
|
266
|
+
const t = new AbortController();
|
|
267
|
+
we(() => t.abort());
|
|
268
|
+
async function o() {
|
|
269
|
+
if (!he) return;
|
|
270
|
+
const n = new window.EyeDropper();
|
|
271
|
+
try {
|
|
272
|
+
let a = (await n.open({ signal: t.signal })).sRGBHex;
|
|
273
|
+
if (a.startsWith("rgba")) {
|
|
274
|
+
const m = a.match(/rgba?\((?<r>\d+), (?<g>\d+), (?<b>\d+), (?<a>[\d.]+)\)/);
|
|
275
|
+
if (m) {
|
|
276
|
+
const [f, h, p, b, i] = m;
|
|
277
|
+
a = `rgba(${h}, ${p}, ${b}, ${parseFloat(i) === 0 ? "1" : i})`;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
e(a);
|
|
281
|
+
} catch (u) {
|
|
282
|
+
console.log("e ===>", u);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
openEyeDropper: o,
|
|
287
|
+
abortController: t
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
function Fe(e, t, o) {
|
|
291
|
+
const n = e.getBoundingClientRect(), u = t - n.left, a = o - n.top;
|
|
292
|
+
return {
|
|
293
|
+
x: n.width === 0 ? 0 : S(u / n.width * 100, 0, 100),
|
|
294
|
+
y: n.height === 0 ? 0 : S((1 - a / n.height) * 100, 0, 100)
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
const $e = /* @__PURE__ */ ue({
|
|
298
|
+
__name: "ColorPickerSpace",
|
|
299
|
+
setup(e) {
|
|
300
|
+
const t = We();
|
|
301
|
+
let o = !1, n;
|
|
302
|
+
function u(i) {
|
|
303
|
+
n = document.body.style.userSelect, document.body.style.userSelect = "none", o = !0, f(i);
|
|
304
|
+
}
|
|
305
|
+
function a(i) {
|
|
306
|
+
o = !0, h(i);
|
|
307
|
+
}
|
|
308
|
+
function m() {
|
|
309
|
+
document.body.style.userSelect = n, o = !1;
|
|
310
|
+
}
|
|
311
|
+
function f(i) {
|
|
312
|
+
i.buttons !== 1 || !o || !(t.colorSpace.value instanceof HTMLElement) || p(t.colorSpace.value, i.clientX, i.clientY);
|
|
313
|
+
}
|
|
314
|
+
function h(i) {
|
|
315
|
+
if (!o || !(t.colorSpace.value instanceof HTMLElement))
|
|
316
|
+
return;
|
|
317
|
+
i.preventDefault();
|
|
318
|
+
const g = i.touches[0];
|
|
319
|
+
p(t.colorSpace.value, g.clientX, g.clientY);
|
|
320
|
+
}
|
|
321
|
+
function p(i, g, V) {
|
|
322
|
+
const x = Fe(i, g, V), c = { ...t.colors.hsv };
|
|
323
|
+
c.s = x.x, c.v = x.y, t.setColor("hsv", c);
|
|
324
|
+
}
|
|
325
|
+
function b(i) {
|
|
326
|
+
if (!["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"].includes(i.key))
|
|
327
|
+
return;
|
|
328
|
+
i.preventDefault();
|
|
329
|
+
const g = ["ArrowLeft", "ArrowDown"].includes(i.key) ? -1 : 1, V = ["ArrowLeft", "ArrowRight"].includes(i.key) ? "s" : "v", x = i.shiftKey ? 10 : 1, c = t.colors.hsv[V] + g * x, w = { ...t.colors.hsv };
|
|
330
|
+
w[V] = S(c, 0, 100), t.setColor("hsv", w);
|
|
331
|
+
}
|
|
332
|
+
return ae(() => {
|
|
333
|
+
document.addEventListener("mousemove", f, { passive: !1 }), document.addEventListener("touchmove", h, { passive: !1 }), document.addEventListener("mouseup", m), document.addEventListener("touchend", m);
|
|
334
|
+
}), ye(() => {
|
|
335
|
+
document.removeEventListener("mousemove", f), document.removeEventListener("touchmove", h), document.removeEventListener("mouseup", m), document.removeEventListener("touchend", m);
|
|
336
|
+
}), (i, g) => (C(), D("div", {
|
|
337
|
+
ref: v(t).colorSpace,
|
|
338
|
+
class: T([v(P)(v(_), "space")]),
|
|
339
|
+
onMousedown: u,
|
|
340
|
+
onTouchstart: a
|
|
341
|
+
}, [
|
|
342
|
+
E("button", {
|
|
343
|
+
ref: v(t).thumb,
|
|
344
|
+
class: T([v(P)(v(_), "thumb")]),
|
|
345
|
+
tabindex: "0",
|
|
346
|
+
"aria-label": "Color space thumb",
|
|
347
|
+
onKeydown: b
|
|
348
|
+
}, null, 34)
|
|
349
|
+
], 34));
|
|
350
|
+
}
|
|
351
|
+
}), De = ["value"], Oe = ["value"], [We, Be] = _e("ColorPicker"), _ = Me("color_picker"), Xe = /* @__PURE__ */ ue({
|
|
352
|
+
__name: "ColorPicker",
|
|
353
|
+
props: {
|
|
354
|
+
class: {},
|
|
355
|
+
color: {},
|
|
356
|
+
defaultColor: { default: "#ffffffff" },
|
|
357
|
+
format: {},
|
|
358
|
+
defaultFormat: { default: "hex" },
|
|
359
|
+
hideAlpha: { type: Boolean }
|
|
360
|
+
},
|
|
361
|
+
emits: ["update:color", "update:format", "change"],
|
|
362
|
+
setup(e, { emit: t }) {
|
|
363
|
+
const o = ["hex", "hsl", "hsv", "hwb", "rgb"], n = e, u = t, a = j(null), m = j(null), f = j(null), h = te(n, "format", u, {
|
|
364
|
+
defaultValue: n.defaultFormat,
|
|
365
|
+
passive: n.format === void 0
|
|
366
|
+
}), p = R(
|
|
367
|
+
() => h.value && o.includes(h.value) ? h.value : "hex"
|
|
368
|
+
), b = te(n, "color", u, {
|
|
369
|
+
defaultValue: n.defaultColor,
|
|
370
|
+
passive: n.color === void 0
|
|
371
|
+
}), i = "#ffffffff", g = R(() => b.value ?? n.defaultColor ?? i);
|
|
372
|
+
xe(g, z);
|
|
373
|
+
const V = R(() => {
|
|
374
|
+
const l = p.value, r = c[l];
|
|
375
|
+
return l.split("").map((s) => {
|
|
376
|
+
const d = r[s];
|
|
377
|
+
return {
|
|
378
|
+
value: U(l, s).to(d),
|
|
379
|
+
channel: s,
|
|
380
|
+
label: s.toUpperCase()
|
|
381
|
+
};
|
|
382
|
+
}).concat(
|
|
383
|
+
n.hideAlpha ? [] : [
|
|
384
|
+
{
|
|
385
|
+
value: B.to(r.a),
|
|
386
|
+
channel: "a",
|
|
387
|
+
label: "Alpha"
|
|
388
|
+
}
|
|
389
|
+
]
|
|
390
|
+
);
|
|
391
|
+
}), x = R({
|
|
392
|
+
get() {
|
|
393
|
+
return n.hideAlpha && [5, 9].includes(c.hex.length) ? c.hex.substring(0, c.hex.length - (c.hex.length - 1) / 4) : c.hex;
|
|
394
|
+
},
|
|
395
|
+
set(l) {
|
|
396
|
+
me(l) && w("hex", l);
|
|
397
|
+
}
|
|
398
|
+
}), c = Ce({
|
|
399
|
+
hex: i,
|
|
400
|
+
hsl: { h: 0, s: 0, l: 100, a: 1 },
|
|
401
|
+
hsv: { h: 0, s: 0, v: 100, a: 1 },
|
|
402
|
+
hwb: { h: 0, w: 100, b: 0, a: 1 },
|
|
403
|
+
rgb: { r: 255, g: 255, b: 255, a: 1 }
|
|
404
|
+
});
|
|
405
|
+
function w(l, r) {
|
|
406
|
+
let s = r;
|
|
407
|
+
if (n.hideAlpha)
|
|
408
|
+
if (typeof r != "string")
|
|
409
|
+
r.a = 1, s = r;
|
|
410
|
+
else if ([5, 9].includes(r.length)) {
|
|
411
|
+
const d = (r.length - 1) / 4;
|
|
412
|
+
s = r.substring(0, r.length - d) + "f".repeat(d);
|
|
413
|
+
} else [4, 7].includes(r.length) && (s = r + "f".repeat((r.length - 1) / 3));
|
|
414
|
+
if (!Ae(c[l], s)) {
|
|
415
|
+
c[l] = s;
|
|
416
|
+
for (const d of o)
|
|
417
|
+
d !== l && (c[d] = oe(l, d, s));
|
|
418
|
+
b.value = G(
|
|
419
|
+
{ color: oe(l, p.value, s), format: p.value },
|
|
420
|
+
n.hideAlpha
|
|
421
|
+
), u("change", ge());
|
|
422
|
+
}
|
|
423
|
+
a.value instanceof HTMLElement && m.value instanceof HTMLElement && f.value instanceof HTMLElement && ve(a.value, m.value, f.value);
|
|
424
|
+
}
|
|
425
|
+
function z(l) {
|
|
426
|
+
const r = le(l);
|
|
427
|
+
if (r !== null)
|
|
428
|
+
w(r.format, r.color);
|
|
429
|
+
else {
|
|
430
|
+
const s = le(i);
|
|
431
|
+
s !== null && w(s.format, s.color);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function de(l) {
|
|
435
|
+
h.value = l;
|
|
436
|
+
}
|
|
437
|
+
function X(l, r) {
|
|
438
|
+
const s = l.currentTarget, d = { ...c.hsv };
|
|
439
|
+
d[r] = Number(s.value), w("hsv", d);
|
|
440
|
+
}
|
|
441
|
+
function pe(l, r) {
|
|
442
|
+
const s = p.value, d = { ...c[s] }, I = (r === "a" ? B : U(s, r)).from(l);
|
|
443
|
+
Number.isNaN(l) || l === void 0 || (d[r] = I, w(s, d));
|
|
444
|
+
}
|
|
445
|
+
function ve(l, r, s) {
|
|
446
|
+
const d = G({ format: "hsl", color: c.hsl }, !0);
|
|
447
|
+
l.style.setProperty("--vacp-color", d), r.style.position = "relative", r.style.backgroundColor = `hsl(${c.hsl.h} 100% 50%)`, r.style.backgroundImage = "linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)", s.style.boxSizing = "border-box", s.style.position = "absolute", s.style.left = `${c.hsv.s}%`, s.style.bottom = `${c.hsv.v}%`;
|
|
448
|
+
}
|
|
449
|
+
function ge() {
|
|
450
|
+
const l = G(
|
|
451
|
+
{ color: c[p.value], format: p.value },
|
|
452
|
+
n.hideAlpha
|
|
453
|
+
);
|
|
454
|
+
return {
|
|
455
|
+
colors: c,
|
|
456
|
+
cssColor: l
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function J(l) {
|
|
460
|
+
if (!["ArrowUp", "ArrowRight", "ArrowDown", "ArrowLeft"].includes(l.key) || !l.shiftKey)
|
|
461
|
+
return;
|
|
462
|
+
const r = l.currentTarget, s = Number(r.step), d = ["ArrowLeft", "ArrowDown"].includes(l.key) ? -1 : 1, A = Number(r.value) + d * s * 10, I = S(A, Number(r.min), Number(r.max));
|
|
463
|
+
r.value = String(I - d * s);
|
|
464
|
+
}
|
|
465
|
+
const { openEyeDropper: be } = Re(z);
|
|
466
|
+
ae(() => z(g.value)), Be({ colorSpace: m, thumb: f, colors: c, setColor: w });
|
|
467
|
+
const L = P(_, "slider");
|
|
468
|
+
return (l, r) => (C(), D("div", {
|
|
469
|
+
ref_key: "colorPicker",
|
|
470
|
+
ref: a,
|
|
471
|
+
class: T([v(_), n.class])
|
|
472
|
+
}, [
|
|
473
|
+
Q($e),
|
|
474
|
+
E("div", {
|
|
475
|
+
class: T(v(P)(v(_), "sliders"))
|
|
476
|
+
}, [
|
|
477
|
+
E("input", {
|
|
478
|
+
class: T([v(L), v(ne)(v(L), "hue")]),
|
|
479
|
+
value: c.hsv.h,
|
|
480
|
+
type: "range",
|
|
481
|
+
min: "0",
|
|
482
|
+
max: "360",
|
|
483
|
+
step: "1",
|
|
484
|
+
onKeydownPassive: J,
|
|
485
|
+
onInput: r[0] || (r[0] = (s) => X(s, "h"))
|
|
486
|
+
}, null, 42, De),
|
|
487
|
+
l.hideAlpha ? Z("", !0) : (C(), D("input", {
|
|
488
|
+
key: 0,
|
|
489
|
+
class: T([v(L), v(ne)(v(L), "alpha")]),
|
|
490
|
+
value: c.hsv.a,
|
|
491
|
+
type: "range",
|
|
492
|
+
min: "0",
|
|
493
|
+
max: "1",
|
|
494
|
+
step: "0.01",
|
|
495
|
+
onKeydownPassive: J,
|
|
496
|
+
onInput: r[1] || (r[1] = (s) => X(s, "a"))
|
|
497
|
+
}, null, 42, Oe))
|
|
498
|
+
], 2),
|
|
499
|
+
E("div", {
|
|
500
|
+
class: T(v(P)(v(_), "inputs"))
|
|
501
|
+
}, [
|
|
502
|
+
E("button", {
|
|
503
|
+
disabled: !0,
|
|
504
|
+
class: "fake-select",
|
|
505
|
+
onClick: r[2] || (r[2] = (s) => de("rgb"))
|
|
506
|
+
}, [
|
|
507
|
+
r[4] || (r[4] = E("div", null, "Hex", -1)),
|
|
508
|
+
Q(Ee, {
|
|
509
|
+
icon: "tabler:chevron-down",
|
|
510
|
+
size: "2xsm",
|
|
511
|
+
class: "fake-select-icon"
|
|
512
|
+
})
|
|
513
|
+
]),
|
|
514
|
+
p.value === "hex" ? (C(), Y(ee, {
|
|
515
|
+
key: 0,
|
|
516
|
+
class: "flex-1",
|
|
517
|
+
size: "sm",
|
|
518
|
+
modelValue: x.value,
|
|
519
|
+
"onUpdate:modelValue": r[3] || (r[3] = (s) => x.value = s)
|
|
520
|
+
}, null, 8, ["modelValue"])) : (C(!0), D(Te, { key: 1 }, Ve(V.value, ({ value: s, channel: d }) => (C(), Y(ee, {
|
|
521
|
+
modelValue: s,
|
|
522
|
+
"onUpdate:modelValue": (A) => pe(A, d),
|
|
523
|
+
size: "sm"
|
|
524
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]))), 256)),
|
|
525
|
+
v(he) ? (C(), Y(ke, {
|
|
526
|
+
key: 2,
|
|
527
|
+
onClick: v(be),
|
|
528
|
+
icon: "tabler:color-picker",
|
|
529
|
+
size: "sm",
|
|
530
|
+
type: "outline",
|
|
531
|
+
variant: "icon"
|
|
532
|
+
}, null, 8, ["onClick"])) : Z("", !0)
|
|
533
|
+
], 2)
|
|
534
|
+
], 2));
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
export {
|
|
538
|
+
Xe as _,
|
|
539
|
+
We as i,
|
|
540
|
+
Be as p
|
|
541
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as s, C as r, a as t, _ as e } from "../ColorSwatch.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { _ as s, C as r, a as t, _ as e } from "../ColorSwatch.vue_vue_type_style_index_0_lang-DmLhCPh4.js";
|
|
2
2
|
export {
|
|
3
3
|
s as ColorSwatch,
|
|
4
4
|
r as ColorSwatchSizes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ColorSwatch.vue_vue_type_style_index_0_lang-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../ColorSwatch.vue_vue_type_style_index_0_lang-Bo-zDAyc.js");exports.ColorSwatch=e._sfc_main;exports.ColorSwatchSizes=e.ColorSwatchSizes;exports.ColorSwatchTypes=e.ColorSwatchTypes;exports.default=e._sfc_main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),g=require("./GraphicalObject.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";const e=require("vue"),g=require("./GraphicalObject.vue_vue_type_script_setup_true_lang-DlMeNk_1.js"),k=require("./options-B4iSAKol.js"),_=require("./omit-BKPbELUG.js"),s=require("./class-CjZYGZDW.js"),C=require("class-variance-authority"),f=require("./Primitive-BT1RjuGS.js"),h=require("./IconButton.vue_vue_type_script_setup_true_lang-7QB-mmyg.js"),c=["sm","md"],l=["color","remover","custom-picker"],z={key:1,height:"100%",width:"100%",viewBox:"0 0 19 18",fill:"none"},P=e.defineComponent({...k.getComponentOptions("ColorTrigger"),__name:"ColorSwatch",props:{class:{},icon:{},fg:{},bg:{},br:{},size:{default:"md"},selected:{type:Boolean},type:{default:"color"},customPickerIcon:{default:"tabler:palette"}},setup(u){const o=u,r=s.getBemBlock("color_swatch"),p=C.cva(r,{variants:{selected:s.generateVariantClassList("selected",r),size:s.generateVariantClassList(c,r),type:s.generateVariantClassList(l,r)}}),n=e.computed(()=>o.size&&c.includes(o.size)?o.size:"md"),m=e.computed(()=>({size:n.value,..._.omit(o,"size","class","type","selected")})),d=e.useSlots(),v=e.computed(()=>{switch(o.type){case"color":return"div";case"custom-picker":return h._sfc_main;case"remover":return"div"}}),y=e.computed(()=>{const t={};return o.type==="custom-picker"&&(t.size=n.value,t.icon=o.customPickerIcon,t.color="gray",t.type="outline"),t});return(t,i)=>(e.openBlock(),e.createBlock(e.unref(f.Primitive),e.mergeProps({as:v.value,class:[e.unref(p)({selected:t.type!=="custom-picker"&&o.selected,size:t.size,type:t.type}),o.class]},y.value),{icon:e.withCtx(()=>[e.renderSlot(t.$slots,"icon",e.normalizeProps(e.guardReactiveProps(o)))]),default:e.withCtx(()=>[t.type==="color"?(e.openBlock(),e.createBlock(g._sfc_main,e.normalizeProps(e.mergeProps({key:0},m.value)),e.createSlots({_:2},[e.renderList(Object.keys(d),a=>({name:a,fn:e.withCtx(()=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(o)))])}))]),1040)):t.type==="remover"?(e.openBlock(),e.createElementBlock("svg",z,i[0]||(i[0]=[e.createElementVNode("path",{id:"Empty Indicator",d:"M17.5 1L1.5 17",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)]))):e.createCommentVNode("",!0),t.type==="custom-picker"?e.renderSlot(t.$slots,"default",e.normalizeProps(e.mergeProps({key:2},o))):e.createCommentVNode("",!0)]),_:3},16,["as","class"]))}});exports.ColorSwatchSizes=c;exports.ColorSwatchTypes=l;exports._sfc_main=P;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as P, computed as s, useSlots as S, createBlock as d, openBlock as c, unref as f, mergeProps as i, withCtx as n, createElementBlock as _, createCommentVNode as y, renderSlot as a, normalizeProps as r, createSlots as b, renderList as $, guardReactiveProps as g, createElementVNode as E } from "vue";
|
|
2
|
-
import { _ as I } from "./GraphicalObject.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as I } from "./GraphicalObject.vue_vue_type_script_setup_true_lang-B3FouRlw.js";
|
|
3
3
|
import { g as L } from "./options-JBqnVZUl.js";
|
|
4
|
-
import { o as V } from "./omit-
|
|
4
|
+
import { o as V } from "./omit-BEkBWXra.js";
|
|
5
5
|
import { g as N, a as l } from "./class-DziTeW9B.js";
|
|
6
6
|
import { cva as O } from "class-variance-authority";
|
|
7
7
|
import { P as T } from "./Primitive-nOVjbfuc.js";
|
|
8
|
-
import { _ as j } from "./IconButton.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import { _ as j } from "./IconButton.vue_vue_type_script_setup_true_lang-dI6-RNyi.js";
|
|
9
9
|
const k = ["sm", "md"], M = ["color", "remover", "custom-picker"], R = {
|
|
10
10
|
key: 1,
|
|
11
11
|
height: "100%",
|