@orchidui/dashboard 1.8.1-83 → 1.8.1-85
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/Dashboard/Card/OcCard.js +2 -3
- package/dist/Dashboard/TextEditor/QuillEditor.js +1 -1
- package/dist/{OcCard-BFYO-xBE.js → OcCard-BpqC7suH.js} +1 -1
- package/dist/{OcLottieAnimation-cF06yacT.js → OcLottieAnimation-EBkAB8-y.js} +1 -1
- package/dist/{QuillEditor-DbGwG5RB.js → QuillEditor-BHWfmp5D.js} +689 -665
- package/dist/index.js +1848 -28
- package/package.json +1 -1
- package/dist/OcColorPicker-BZ3zytCj.js +0 -128
- package/dist/OcColorPickerPopup-sjvpeV8l.js +0 -1127
- package/dist/OcOnboardingProgressbar-BsqF90Gn.js +0 -77
- package/dist/OcTextEditor-BWOvVmgS.js +0 -522
- package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
package/dist/index.js
CHANGED
|
@@ -1,32 +1,1852 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var pt = Object.defineProperty;
|
|
2
|
+
var gt = (n, V, r) => V in n ? pt(n, V, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[V] = r;
|
|
3
|
+
var We = (n, V, r) => gt(n, typeof V != "symbol" ? V + "" : V, r);
|
|
4
|
+
import { ref as v, computed as $e, openBlock as m, createBlock as X, unref as w, normalizeClass as Q, withCtx as W, createVNode as T, createCommentVNode as D, createSlots as vt, renderSlot as ze, createElementBlock as E, normalizeStyle as te, onMounted as Je, watch as fe, createElementVNode as h, Fragment as ge, renderList as Ke, toDisplayString as Fe, createTextVNode as ve, withKeys as ot, inject as Re, reactive as _e, provide as Be, nextTick as mt, withDirectives as ft, vShow as ht, defineComponent as bt, defineAsyncComponent as it } from "vue";
|
|
5
|
+
import { Q as Y, a as yt } from "./QuillEditor-BHWfmp5D.js";
|
|
6
|
+
import { BaseInput as st, Dropdown as rt, Input as we, Icon as A, Modal as xt, Select as Ze, Slider as Ae } from "@orchidui/core";
|
|
7
|
+
import { hslToRgb as et, hsl2Hex as tt, rgb2Hex as lt, rgbaToHex8 as kt, hexToRgb as je, rgbToHue as Qe, rgbToHsl as at, hex8ToRgba as $t, parseRgba as wt, parseRgb as St } from "./Dashboard/ColorPicker/components/converters.js";
|
|
8
|
+
import { PieChart as Ct } from "./Dashboard/Charts/PieChart/OcPieChart.js";
|
|
9
|
+
import { LineChart as Ol } from "./Dashboard/Charts/LineChart/OcLineChart.js";
|
|
10
|
+
import { BarChart as Al } from "./Dashboard/Charts/BarChart/OcBarChart.js";
|
|
11
|
+
import { BarRaceChart as Nl } from "./Dashboard/Charts/BarRaceChart/OcBarRaceChart.js";
|
|
12
|
+
import { _ as Xl } from "./OcCard-BpqC7suH.js";
|
|
13
|
+
const It = { key: 1 }, Vt = {
|
|
14
|
+
__name: "OcColorPicker",
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
variant: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "solid"
|
|
23
|
+
},
|
|
24
|
+
hideOpacity: Boolean,
|
|
25
|
+
hideInputColor: Boolean,
|
|
26
|
+
presetColors: {
|
|
27
|
+
type: Array
|
|
28
|
+
},
|
|
29
|
+
placement: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "auto"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:model-value"],
|
|
35
|
+
setup(n, { emit: V }) {
|
|
36
|
+
const r = n, b = V, u = v(!1), f = v(r.modelValue), C = (M) => {
|
|
37
|
+
M && (f.value = M, b("update:model-value", M));
|
|
38
|
+
}, p = $e(() => r.variant === "gradient" ? {
|
|
39
|
+
class: "w-[20px] h-[20px] hide-svg-icon",
|
|
40
|
+
style: {
|
|
41
|
+
background: f.value
|
|
42
|
+
}
|
|
43
|
+
} : {
|
|
44
|
+
style: {
|
|
45
|
+
color: f.value
|
|
46
|
+
}
|
|
47
|
+
}), a = v(), H = v([]), Z = () => {
|
|
48
|
+
H.value.length > 8 && (H.value = H.value.filter((M, F) => F < 8)), localStorage.setItem("ck-cp-local-color-list", JSON.stringify(H.value));
|
|
49
|
+
};
|
|
50
|
+
let O = localStorage.getItem("ck-cp-local-color-list");
|
|
51
|
+
O && (H.value = [...new Set(JSON.parse(O))], Z());
|
|
52
|
+
const L = (M) => {
|
|
53
|
+
if (!M && f.value)
|
|
54
|
+
if (H.value.find((U) => U === f.value))
|
|
55
|
+
H.value = [
|
|
56
|
+
f.value,
|
|
57
|
+
...H.value.filter((U) => U !== f.value)
|
|
58
|
+
], Z();
|
|
59
|
+
else {
|
|
60
|
+
H.value.length >= 9 && H.value.pop();
|
|
61
|
+
let U = f.value;
|
|
62
|
+
H.value.unshift(U), Z();
|
|
63
|
+
}
|
|
64
|
+
}, B = v(!1), j = (M) => {
|
|
65
|
+
f.value = M, b("update:model-value", M), u.value = !1;
|
|
66
|
+
};
|
|
67
|
+
return (M, F) => (m(), X(w(st), {
|
|
68
|
+
class: Q(n.hideInputColor ? "w-[40px]" : ""),
|
|
69
|
+
onClick: F[1] || (F[1] = () => {
|
|
70
|
+
var U;
|
|
71
|
+
return (U = a.value) == null ? void 0 : U.toggleDropdown();
|
|
72
|
+
})
|
|
73
|
+
}, {
|
|
74
|
+
default: W(() => [
|
|
75
|
+
T(w(rt), {
|
|
76
|
+
ref_key: "dropdownRef",
|
|
77
|
+
ref: a,
|
|
78
|
+
modelValue: u.value,
|
|
79
|
+
"onUpdate:modelValue": [
|
|
80
|
+
F[0] || (F[0] = (U) => u.value = U),
|
|
81
|
+
L
|
|
82
|
+
],
|
|
83
|
+
"max-menu-height": 800,
|
|
84
|
+
placement: n.placement,
|
|
85
|
+
"popper-options": {
|
|
86
|
+
strategy: "fixed"
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
menu: W(() => [
|
|
90
|
+
B.value ? D("", !0) : (m(), X(w(xl), {
|
|
91
|
+
key: 0,
|
|
92
|
+
variant: n.variant,
|
|
93
|
+
"show-alpha": !n.hideOpacity,
|
|
94
|
+
type: n.hideOpacity ? "HEX" : "HEX8",
|
|
95
|
+
"model-value": n.modelValue,
|
|
96
|
+
"last-used-colors": H.value,
|
|
97
|
+
"preset-colors": n.presetColors,
|
|
98
|
+
"onUpdate:modelValue": C,
|
|
99
|
+
onLastUsedPick: j
|
|
100
|
+
}, null, 8, ["variant", "show-alpha", "type", "model-value", "last-used-colors", "preset-colors"]))
|
|
101
|
+
]),
|
|
102
|
+
default: W(() => [
|
|
103
|
+
n.hideInputColor ? (m(), E("div", It, [
|
|
104
|
+
ze(M.$slots, "picker-icon", {}, () => [
|
|
105
|
+
T(w(A), {
|
|
106
|
+
class: "cursor-pointer",
|
|
107
|
+
style: te(`color: ${f.value}`),
|
|
108
|
+
name: "drop"
|
|
109
|
+
}, null, 8, ["style"])
|
|
110
|
+
])
|
|
111
|
+
])) : (m(), X(w(we), {
|
|
112
|
+
key: 0,
|
|
113
|
+
"model-value": f.value,
|
|
114
|
+
icon: "drop",
|
|
115
|
+
"icon-props": p.value,
|
|
116
|
+
placeholder: "#FFFFFF",
|
|
117
|
+
"onUpdate:modelValue": C
|
|
118
|
+
}, vt({ _: 2 }, [
|
|
119
|
+
M.$slots.leading ? {
|
|
120
|
+
name: "leading",
|
|
121
|
+
fn: W(() => [
|
|
122
|
+
ze(M.$slots, "leading")
|
|
123
|
+
]),
|
|
124
|
+
key: "0"
|
|
125
|
+
} : void 0
|
|
126
|
+
]), 1032, ["model-value", "icon-props"]))
|
|
127
|
+
]),
|
|
128
|
+
_: 3
|
|
129
|
+
}, 8, ["modelValue", "placement"])
|
|
130
|
+
]),
|
|
131
|
+
_: 3
|
|
132
|
+
}, 8, ["class"]));
|
|
133
|
+
}
|
|
134
|
+
}, Lt = ["id"], Tt = { class: "flex items-center gap-x-3 px-5" }, Bt = { class: "flex items-center gap-x-5 cursor-pointer" }, Rt = { class: "flex flex-col py-2 overflow-hidden" }, Et = ["onClick"], Mt = { class: "flex gap-x-3 items-center px-5" }, Ut = { class: "flex items-center gap-x-3 px-5" }, Dt = { class: "flex gap-x-3 items-center px-5" }, Ht = { class: "flex gap-x-3 items-center px-5" }, Ot = { class: "flex items-center" }, Qt = { class: "grid cursor-pointer px-5" }, At = {
|
|
135
|
+
key: 5,
|
|
136
|
+
class: "flex gap-x-3 items-center px-5"
|
|
137
|
+
}, Ft = { class: "flex" }, Nt = { class: "mt-1 mx-2 cursor-pointer" }, Rl = {
|
|
138
|
+
__name: "OcTextEditor",
|
|
139
|
+
props: {
|
|
140
|
+
/**
|
|
141
|
+
* The font sizes of the editor.
|
|
142
|
+
*/
|
|
143
|
+
fontSizes: { type: Array, required: !0 },
|
|
144
|
+
/**
|
|
145
|
+
* The initial font size of the editor. (if empty the first item of `fontSizes` will be used, needs to be a value of `fontSizes`)
|
|
146
|
+
*/
|
|
147
|
+
initialFontSize: { type: String },
|
|
148
|
+
modelValue: String,
|
|
149
|
+
image: String,
|
|
150
|
+
errorMessage: {
|
|
151
|
+
type: String,
|
|
152
|
+
default: ""
|
|
153
|
+
},
|
|
154
|
+
label: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: ""
|
|
157
|
+
},
|
|
158
|
+
hint: {
|
|
159
|
+
type: String,
|
|
160
|
+
default: ""
|
|
161
|
+
},
|
|
162
|
+
isRequired: {
|
|
163
|
+
type: Boolean,
|
|
164
|
+
default: !1
|
|
165
|
+
},
|
|
166
|
+
labelIcon: {
|
|
167
|
+
type: String,
|
|
168
|
+
default: ""
|
|
169
|
+
},
|
|
170
|
+
tooltipText: {
|
|
171
|
+
type: String,
|
|
172
|
+
default: ""
|
|
173
|
+
},
|
|
174
|
+
tooltipOptions: {
|
|
175
|
+
type: Object,
|
|
176
|
+
default: () => ({})
|
|
177
|
+
},
|
|
178
|
+
variant: {
|
|
179
|
+
type: String,
|
|
180
|
+
validator: (n) => ["default", "text-only"].includes(n),
|
|
181
|
+
default: "default"
|
|
182
|
+
},
|
|
183
|
+
placeholder: {
|
|
184
|
+
type: String,
|
|
185
|
+
default: ""
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
emits: ["update:modelValue", "update:image"],
|
|
189
|
+
setup(n, { emit: V }) {
|
|
190
|
+
const r = n, b = V, u = {
|
|
191
|
+
default: [
|
|
192
|
+
"changes",
|
|
193
|
+
"font-size",
|
|
194
|
+
"font-style",
|
|
195
|
+
"link",
|
|
196
|
+
"image",
|
|
197
|
+
"quote",
|
|
198
|
+
"media",
|
|
199
|
+
"list",
|
|
200
|
+
"alignment"
|
|
201
|
+
],
|
|
202
|
+
"text-only": ["changes", "font-size", "font-style", "link", "quote", "list", "alignment"]
|
|
203
|
+
}, f = $e(() => u[r.variant]), C = Y.import("attributors/style/size");
|
|
204
|
+
C.whitelist = r.fontSizes.map((c) => c.value), Y.register(C, !0);
|
|
205
|
+
const p = Y.import("attributors/style/align");
|
|
206
|
+
Y.register(p, !0);
|
|
207
|
+
const a = Y.import("attributors/style/background");
|
|
208
|
+
Y.register(a, !0);
|
|
209
|
+
const H = Y.import("attributors/style/color");
|
|
210
|
+
Y.register(H, !0);
|
|
211
|
+
const Z = Y.import("attributors/style/direction");
|
|
212
|
+
Y.register(Z, !0);
|
|
213
|
+
const O = Y.import("attributors/style/font");
|
|
214
|
+
Y.register(O, !0);
|
|
215
|
+
const L = Y.import("blots/block/embed");
|
|
216
|
+
class B extends L {
|
|
217
|
+
}
|
|
218
|
+
We(B, "blotName", "divider"), We(B, "tagName", "hr"), Y.register(B);
|
|
219
|
+
const j = v(
|
|
220
|
+
Math.random().toString(36).replace(/[^a-zA-Z]+/g, "")
|
|
221
|
+
), M = v(!1), F = v(!1), U = v(!1), le = v(!1), J = v(!1), z = v(!1), R = v(!1), N = v(""), ae = v(""), ee = v(""), y = v(), Se = v(!1), ue = v(r.image), ie = (c) => {
|
|
222
|
+
console.log(c, 123), M.value = y.value.getQuill().history.stack.undo.length > 0, F.value = y.value.getQuill().history.stack.redo.length > 0, U.value = y.value.getQuill().getFormat().bold, le.value = y.value.getQuill().getFormat().italic, J.value = y.value.getQuill().getFormat().underline, R.value = y.value.getQuill().getFormat().blockquote, ae.value = y.value.getQuill().getFormat().list, ee.value = y.value.getQuill().getFormat().align;
|
|
223
|
+
let o = document.createElement("div");
|
|
224
|
+
o.innerHTML = c, Se.value && (o.innerText ? b("update:modelValue", c || "") : b("update:modelValue", ""), o.remove());
|
|
225
|
+
}, Ne = () => {
|
|
226
|
+
if (y.value.getQuill().getSelection(!0)) {
|
|
227
|
+
const o = y.value.getQuill().getSelection(!0);
|
|
228
|
+
y.value.getQuill().insertText(o.index, `
|
|
229
|
+
`, Y.sources.USER), y.value.getQuill().insertEmbed(o.index + 1, "divider", !0, Y.sources.USER), y.value.getQuill().setSelection(o.index + 2, Y.sources.SILENT);
|
|
230
|
+
}
|
|
231
|
+
}, Ee = () => {
|
|
232
|
+
y.value.getQuill().history.undo(), ie(r.modelValue);
|
|
233
|
+
}, Me = () => {
|
|
234
|
+
y.value.getQuill().history.redo(), ie(r.modelValue);
|
|
235
|
+
}, Ce = () => {
|
|
236
|
+
var c;
|
|
237
|
+
y.value.getQuill().format("bold", !U.value), (c = y.value.getQuill().getSelection()) != null && c.length || (U.value = !U.value);
|
|
238
|
+
}, ne = () => {
|
|
239
|
+
var c;
|
|
240
|
+
y.value.getQuill().format("italic", !le.value), (c = y.value.getQuill().getSelection()) != null && c.length || (le.value = !le.value);
|
|
241
|
+
}, Ie = () => {
|
|
242
|
+
var c;
|
|
243
|
+
y.value.getQuill().format("underline", !J.value), (c = y.value.getQuill().getSelection()) != null && c.length || (J.value = !J.value);
|
|
244
|
+
}, Ue = (c) => {
|
|
245
|
+
y.value.getQuill().format("size", c), N.value = c, z.value = !1;
|
|
246
|
+
}, me = () => {
|
|
247
|
+
const c = y.value.getQuill().getSelection();
|
|
248
|
+
c && c.length > 0 && y.value.getQuill().theme.tooltip.edit();
|
|
249
|
+
}, Pe = () => {
|
|
250
|
+
y.value.getQuill().format("blockquote", !R.value);
|
|
251
|
+
}, oe = (c) => {
|
|
252
|
+
const o = y.value.getQuill().getSelection();
|
|
253
|
+
o && (y.value.getQuill().clipboard.dangerouslyPasteHTML(o.index, `<img src="${c}" />`), ue.value = c, b("update:image", ue.value));
|
|
254
|
+
}, De = () => {
|
|
255
|
+
y.value.getQuill().getSelection() || y.value.getQuill().setSelection(y.value.getQuill().getLength() - 1);
|
|
256
|
+
const c = document.createElement("input");
|
|
257
|
+
c.type = "file", c.accept = "jpg,.jpeg,.png,.webp,.gif", c.onchange = () => {
|
|
258
|
+
const o = c.files[0], x = new FileReader();
|
|
259
|
+
x.onload = () => oe(x.result), x.readAsDataURL(o);
|
|
260
|
+
}, c.click();
|
|
261
|
+
}, He = (c) => /^data:image\/(png|jpg|jpeg|gif);base64,/.test(c), P = (c) => {
|
|
262
|
+
setTimeout(() => {
|
|
263
|
+
var x;
|
|
264
|
+
if (c) {
|
|
265
|
+
const G = y.value.getHTML(), se = document.createElement("div");
|
|
266
|
+
se.innerHTML = G;
|
|
267
|
+
let xe = se.getElementsByTagName("img");
|
|
268
|
+
if (xe && xe.length > 0)
|
|
269
|
+
for (let pe = 0; pe < xe.length; pe++) {
|
|
270
|
+
const ke = (x = xe[pe]) == null ? void 0 : x.getAttribute("src");
|
|
271
|
+
He(ke) && b("update:image", ke);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}, 100);
|
|
275
|
+
const { items: o } = c.clipboardData;
|
|
276
|
+
o.length && o[0].getAsString((x) => {
|
|
277
|
+
He(x) && (y.value.getQuill().getSelection() || y.value.getQuill().setSelection(y.value.getQuill().getLength() - 1));
|
|
278
|
+
});
|
|
279
|
+
}, _ = () => {
|
|
280
|
+
y.value.getQuill().theme.tooltip.edit("video");
|
|
281
|
+
}, Ve = (c) => {
|
|
282
|
+
y.value.getQuill().format("list", c), ae.value = c;
|
|
283
|
+
}, he = (c = void 0) => {
|
|
284
|
+
y.value.getQuill().format("align", c), ee.value = c;
|
|
285
|
+
}, de = v(""), Xe = () => {
|
|
286
|
+
y.value.getQuill().format("color", de.value);
|
|
287
|
+
};
|
|
288
|
+
Je(() => {
|
|
289
|
+
Ue(r.initialFontSize || r.fontSizes[0].value), Se.value = !0;
|
|
290
|
+
});
|
|
291
|
+
const be = v(100), ce = v(!1), Le = (c) => {
|
|
292
|
+
var x, G;
|
|
293
|
+
be.value = c;
|
|
294
|
+
const o = (x = window.getSelection()) == null ? void 0 : x.focusNode;
|
|
295
|
+
o && o.nodeName !== "#text" && (y.value.getQuill().format("width", `${be.value}%`), (G = o == null ? void 0 : o.querySelector("img")) == null || G.setAttribute("style", "margin:auto;display:block;"));
|
|
296
|
+
}, ye = (c = "left") => {
|
|
297
|
+
var x, G;
|
|
298
|
+
const o = (x = window.getSelection()) == null ? void 0 : x.focusNode;
|
|
299
|
+
if (o && o.nodeName !== "#text") {
|
|
300
|
+
let se = "float:left";
|
|
301
|
+
c == "center" ? se = "" : c == "right" && (se = "float:right"), (G = o == null ? void 0 : o.querySelector("img")) == null || G.setAttribute("style", `margin:auto;display:block;${se}`);
|
|
302
|
+
}
|
|
303
|
+
}, Oe = () => {
|
|
304
|
+
var o;
|
|
305
|
+
const c = (o = window.getSelection()) == null ? void 0 : o.focusNode;
|
|
306
|
+
ce.value = c.innerHTML && c.innerHTML.includes("<img");
|
|
307
|
+
}, K = v(!1), q = v(3), Te = v(3), qe = $e(() => {
|
|
308
|
+
let c = [];
|
|
309
|
+
for (let o = 1; o < 30; o++)
|
|
310
|
+
c.push({
|
|
311
|
+
label: o.toString(),
|
|
312
|
+
value: o.toString()
|
|
313
|
+
});
|
|
314
|
+
return c;
|
|
315
|
+
}), Ge = $e(() => {
|
|
316
|
+
let c = [];
|
|
317
|
+
for (let o = 1; o < 12; o++)
|
|
318
|
+
c.push({
|
|
319
|
+
label: o.toString(),
|
|
320
|
+
value: o.toString()
|
|
321
|
+
});
|
|
322
|
+
return c;
|
|
323
|
+
}), Ye = () => {
|
|
324
|
+
y.value.getQuill().getModule("better-table").insertTable(parseInt(q.value), parseInt(Te.value)), K.value = !1;
|
|
325
|
+
};
|
|
326
|
+
return fe(() => r.modelValue, (c) => {
|
|
327
|
+
c || y.value.getQuill().setContents([], "silent");
|
|
328
|
+
}), (c, o) => (m(), X(w(st), {
|
|
329
|
+
label: n.label,
|
|
330
|
+
hint: n.hint,
|
|
331
|
+
"error-message": n.errorMessage,
|
|
332
|
+
"is-required": n.isRequired,
|
|
333
|
+
"label-icon": n.labelIcon,
|
|
334
|
+
"tooltip-text": n.tooltipText,
|
|
335
|
+
"tooltip-options": n.tooltipOptions
|
|
336
|
+
}, {
|
|
337
|
+
default: W(() => [
|
|
338
|
+
T(w(xt), {
|
|
339
|
+
title: "Insert table",
|
|
340
|
+
modelValue: K.value,
|
|
341
|
+
"onUpdate:modelValue": o[2] || (o[2] = (x) => K.value = x),
|
|
342
|
+
class: "!w-full !h-full",
|
|
343
|
+
confirmButtonProps: {
|
|
344
|
+
label: "Save",
|
|
345
|
+
onClick: () => Ye()
|
|
346
|
+
}
|
|
347
|
+
}, {
|
|
348
|
+
default: W(() => [
|
|
349
|
+
T(w(Ze), {
|
|
350
|
+
modelValue: Te.value,
|
|
351
|
+
"onUpdate:modelValue": o[0] || (o[0] = (x) => Te.value = x),
|
|
352
|
+
options: Ge.value,
|
|
353
|
+
label: "Table cell",
|
|
354
|
+
class: "mb-3"
|
|
355
|
+
}, null, 8, ["modelValue", "options"]),
|
|
356
|
+
T(w(Ze), {
|
|
357
|
+
modelValue: q.value,
|
|
358
|
+
"onUpdate:modelValue": o[1] || (o[1] = (x) => q.value = x),
|
|
359
|
+
options: qe.value,
|
|
360
|
+
label: "Table rows"
|
|
361
|
+
}, null, 8, ["modelValue", "options"])
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
}, 8, ["modelValue", "confirmButtonProps"]),
|
|
365
|
+
h("div", {
|
|
366
|
+
class: Q(["grid", { "has-error": n.errorMessage }]),
|
|
367
|
+
onClick: Oe
|
|
368
|
+
}, [
|
|
369
|
+
j.value ? (m(), X(w(yt), {
|
|
370
|
+
key: 0,
|
|
371
|
+
id: `#${j.value}`,
|
|
372
|
+
ref_key: "quill",
|
|
373
|
+
ref: y,
|
|
374
|
+
content: n.modelValue,
|
|
375
|
+
options: {
|
|
376
|
+
bounds: `#${j.value}`
|
|
377
|
+
},
|
|
378
|
+
theme: "snow",
|
|
379
|
+
"content-type": "html",
|
|
380
|
+
class: "min-h-[200px]",
|
|
381
|
+
placeholder: n.placeholder,
|
|
382
|
+
"onUpdate:content": ie,
|
|
383
|
+
onPaste: P
|
|
384
|
+
}, {
|
|
385
|
+
toolbar: W(() => [
|
|
386
|
+
h("div", {
|
|
387
|
+
id: j.value,
|
|
388
|
+
class: "flex min-h-[36px] flex-wrap !py-2 !px-3 gap-y-2 rounded-t"
|
|
389
|
+
}, [
|
|
390
|
+
f.value.includes("changes") ? (m(), E(ge, { key: 0 }, [
|
|
391
|
+
h("div", Tt, [
|
|
392
|
+
T(w(A), {
|
|
393
|
+
class: Q(M.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
394
|
+
width: "20",
|
|
395
|
+
height: "20",
|
|
396
|
+
name: "text-editor/undo",
|
|
397
|
+
onClick: Ee
|
|
398
|
+
}, null, 8, ["class"]),
|
|
399
|
+
T(w(A), {
|
|
400
|
+
class: Q(F.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
401
|
+
width: "20",
|
|
402
|
+
height: "20",
|
|
403
|
+
name: "text-editor/redo",
|
|
404
|
+
onClick: Me
|
|
405
|
+
}, null, 8, ["class"])
|
|
406
|
+
]),
|
|
407
|
+
o[16] || (o[16] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
408
|
+
], 64)) : D("", !0),
|
|
409
|
+
f.value.includes("font-size") ? (m(), E(ge, { key: 1 }, [
|
|
410
|
+
T(w(rt), {
|
|
411
|
+
modelValue: z.value,
|
|
412
|
+
"onUpdate:modelValue": o[3] || (o[3] = (x) => z.value = x),
|
|
413
|
+
class: "px-5"
|
|
414
|
+
}, {
|
|
415
|
+
menu: W(() => [
|
|
416
|
+
h("div", Rt, [
|
|
417
|
+
(m(!0), E(ge, null, Ke(n.fontSizes, (x) => (m(), E("div", {
|
|
418
|
+
key: x.value,
|
|
419
|
+
class: Q(["min-w-[120px] cursor-pointer py-2 px-3 hover:bg-oc-gray-50", N.value === x.value ? "font-medium" : ""]),
|
|
420
|
+
onClick: (G) => Ue(x.value)
|
|
421
|
+
}, Fe(x.label), 11, Et))), 128))
|
|
422
|
+
])
|
|
423
|
+
]),
|
|
424
|
+
default: W(() => {
|
|
425
|
+
var x;
|
|
426
|
+
return [
|
|
427
|
+
h("div", Bt, [
|
|
428
|
+
ve(Fe((x = n.fontSizes.find((G) => G.value === N.value)) == null ? void 0 : x.label) + " ", 1),
|
|
429
|
+
T(w(A), {
|
|
430
|
+
width: "20",
|
|
431
|
+
height: "20",
|
|
432
|
+
name: "chevron-down",
|
|
433
|
+
class: Q(["transition-all", z.value ? "rotate-180" : ""])
|
|
434
|
+
}, null, 8, ["class"])
|
|
435
|
+
])
|
|
436
|
+
];
|
|
437
|
+
}),
|
|
438
|
+
_: 1
|
|
439
|
+
}, 8, ["modelValue"]),
|
|
440
|
+
o[17] || (o[17] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
441
|
+
], 64)) : D("", !0),
|
|
442
|
+
f.value.includes("font-style") ? (m(), E(ge, { key: 2 }, [
|
|
443
|
+
h("div", Mt, [
|
|
444
|
+
T(w(A), {
|
|
445
|
+
class: Q(["cursor-pointer", U.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
446
|
+
width: "20",
|
|
447
|
+
height: "20",
|
|
448
|
+
name: "text-editor/bold",
|
|
449
|
+
onClick: Ce
|
|
450
|
+
}, null, 8, ["class"]),
|
|
451
|
+
T(w(A), {
|
|
452
|
+
class: Q(["cursor-pointer", le.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
453
|
+
width: "20",
|
|
454
|
+
height: "20",
|
|
455
|
+
name: "text-editor/italic",
|
|
456
|
+
onClick: ne
|
|
457
|
+
}, null, 8, ["class"]),
|
|
458
|
+
T(w(A), {
|
|
459
|
+
class: Q(["cursor-pointer", J.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
460
|
+
width: "20",
|
|
461
|
+
height: "20",
|
|
462
|
+
name: "text-editor/underline",
|
|
463
|
+
onClick: Ie
|
|
464
|
+
}, null, 8, ["class"])
|
|
465
|
+
]),
|
|
466
|
+
o[18] || (o[18] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
467
|
+
], 64)) : D("", !0),
|
|
468
|
+
h("div", Ut, [
|
|
469
|
+
f.value.includes("link") ? (m(), X(w(A), {
|
|
470
|
+
key: 0,
|
|
471
|
+
class: "cursor-pointer",
|
|
472
|
+
width: "20",
|
|
473
|
+
height: "20",
|
|
474
|
+
name: "text-editor/link",
|
|
475
|
+
onClick: me
|
|
476
|
+
})) : D("", !0),
|
|
477
|
+
f.value.includes("image") ? (m(), X(w(A), {
|
|
478
|
+
key: 1,
|
|
479
|
+
class: "cursor-pointer",
|
|
480
|
+
width: "20",
|
|
481
|
+
height: "20",
|
|
482
|
+
name: "text-editor/image",
|
|
483
|
+
onClick: De
|
|
484
|
+
})) : D("", !0),
|
|
485
|
+
f.value.includes("quote") ? (m(), X(w(A), {
|
|
486
|
+
key: 2,
|
|
487
|
+
class: Q(["cursor-pointer", R.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
488
|
+
width: "20",
|
|
489
|
+
height: "20",
|
|
490
|
+
name: "text-editor/quote",
|
|
491
|
+
onClick: Pe
|
|
492
|
+
}, null, 8, ["class"])) : D("", !0),
|
|
493
|
+
f.value.includes("media") ? (m(), X(w(A), {
|
|
494
|
+
key: 3,
|
|
495
|
+
class: "cursor-pointer",
|
|
496
|
+
width: "20",
|
|
497
|
+
height: "20",
|
|
498
|
+
name: "text-editor/media",
|
|
499
|
+
onClick: _
|
|
500
|
+
})) : D("", !0),
|
|
501
|
+
T(w(A), {
|
|
502
|
+
class: "cursor-pointer",
|
|
503
|
+
width: "20",
|
|
504
|
+
height: "20",
|
|
505
|
+
name: "table",
|
|
506
|
+
onClick: o[4] || (o[4] = (x) => K.value = !K.value)
|
|
507
|
+
})
|
|
508
|
+
]),
|
|
509
|
+
f.value.includes("list") ? (m(), E(ge, { key: 3 }, [
|
|
510
|
+
o[19] || (o[19] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
511
|
+
h("div", Dt, [
|
|
512
|
+
T(w(A), {
|
|
513
|
+
class: Q(["cursor-pointer", ae.value === "bullet" ? "text-oc-text" : "text-oc-text-300"]),
|
|
514
|
+
width: "20",
|
|
515
|
+
height: "20",
|
|
516
|
+
name: "text-editor/bullet",
|
|
517
|
+
onClick: o[5] || (o[5] = (x) => Ve("bullet"))
|
|
518
|
+
}, null, 8, ["class"]),
|
|
519
|
+
T(w(A), {
|
|
520
|
+
class: Q(["cursor-pointer", ae.value === "ordered" ? "text-oc-text" : "text-oc-text-300"]),
|
|
521
|
+
width: "20",
|
|
522
|
+
height: "20",
|
|
523
|
+
name: "text-editor/number",
|
|
524
|
+
onClick: o[6] || (o[6] = (x) => Ve("ordered"))
|
|
525
|
+
}, null, 8, ["class"])
|
|
526
|
+
])
|
|
527
|
+
], 64)) : D("", !0),
|
|
528
|
+
f.value.includes("alignment") ? (m(), E(ge, { key: 4 }, [
|
|
529
|
+
o[20] || (o[20] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
530
|
+
h("div", Ht, [
|
|
531
|
+
T(w(A), {
|
|
532
|
+
class: Q(["cursor-pointer", ee.value ? "text-oc-text-300" : "text-oc-text"]),
|
|
533
|
+
width: "20",
|
|
534
|
+
height: "20",
|
|
535
|
+
name: "text-editor/left",
|
|
536
|
+
onClick: o[7] || (o[7] = (x) => he())
|
|
537
|
+
}, null, 8, ["class"]),
|
|
538
|
+
T(w(A), {
|
|
539
|
+
class: Q(["cursor-pointer", ee.value === "center" ? "text-oc-text" : "text-oc-text-300"]),
|
|
540
|
+
width: "20",
|
|
541
|
+
height: "20",
|
|
542
|
+
name: "text-editor/center",
|
|
543
|
+
onClick: o[8] || (o[8] = (x) => he("center"))
|
|
544
|
+
}, null, 8, ["class"]),
|
|
545
|
+
T(w(A), {
|
|
546
|
+
class: Q(["cursor-pointer", ee.value === "right" ? "text-oc-text" : "text-oc-text-300"]),
|
|
547
|
+
width: "20",
|
|
548
|
+
height: "20",
|
|
549
|
+
name: "text-editor/right",
|
|
550
|
+
onClick: o[9] || (o[9] = (x) => he("right"))
|
|
551
|
+
}, null, 8, ["class"]),
|
|
552
|
+
T(w(A), {
|
|
553
|
+
class: Q(["cursor-pointer", ee.value === "justify" ? "text-oc-text" : "text-oc-text-300"]),
|
|
554
|
+
width: "20",
|
|
555
|
+
height: "20",
|
|
556
|
+
name: "text-editor/justify",
|
|
557
|
+
onClick: o[10] || (o[10] = (x) => he("justify"))
|
|
558
|
+
}, null, 8, ["class"])
|
|
559
|
+
])
|
|
560
|
+
], 64)) : D("", !0),
|
|
561
|
+
o[22] || (o[22] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
562
|
+
h("div", Ot, [
|
|
563
|
+
T(w(Vt), {
|
|
564
|
+
modelValue: de.value,
|
|
565
|
+
"onUpdate:modelValue": [
|
|
566
|
+
o[11] || (o[11] = (x) => de.value = x),
|
|
567
|
+
Xe
|
|
568
|
+
],
|
|
569
|
+
"hide-input-color": ""
|
|
570
|
+
}, {
|
|
571
|
+
"picker-icon": W(() => [
|
|
572
|
+
h("div", Qt, [
|
|
573
|
+
h("div", {
|
|
574
|
+
style: te(`color:${de.value}`)
|
|
575
|
+
}, "A", 4),
|
|
576
|
+
h("div", {
|
|
577
|
+
class: "h-[5px] w-full rounded border",
|
|
578
|
+
style: te(`background:${de.value}`)
|
|
579
|
+
}, null, 4)
|
|
580
|
+
])
|
|
581
|
+
]),
|
|
582
|
+
_: 1
|
|
583
|
+
}, 8, ["modelValue"])
|
|
584
|
+
]),
|
|
585
|
+
o[23] || (o[23] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
586
|
+
ce.value ? (m(), E("div", At, [
|
|
587
|
+
T(w(Ae), {
|
|
588
|
+
label: "Image width",
|
|
589
|
+
class: "w-[120px]",
|
|
590
|
+
"model-value": be.value,
|
|
591
|
+
"min-limit": 0,
|
|
592
|
+
"max-limit": 100,
|
|
593
|
+
"onUpdate:modelValue": Le
|
|
594
|
+
}, null, 8, ["model-value"]),
|
|
595
|
+
h("div", Ft, [
|
|
596
|
+
T(w(A), {
|
|
597
|
+
class: "cursor-pointer",
|
|
598
|
+
width: "20",
|
|
599
|
+
height: "20",
|
|
600
|
+
name: "text-editor/left",
|
|
601
|
+
onClick: o[12] || (o[12] = (x) => ye())
|
|
602
|
+
}),
|
|
603
|
+
T(w(A), {
|
|
604
|
+
class: "cursor-pointer",
|
|
605
|
+
width: "20",
|
|
606
|
+
height: "20",
|
|
607
|
+
name: "text-editor/center",
|
|
608
|
+
onClick: o[13] || (o[13] = (x) => ye("center"))
|
|
609
|
+
}),
|
|
610
|
+
T(w(A), {
|
|
611
|
+
class: "cursor-pointer",
|
|
612
|
+
width: "20",
|
|
613
|
+
height: "20",
|
|
614
|
+
name: "text-editor/right",
|
|
615
|
+
onClick: o[14] || (o[14] = (x) => ye("right"))
|
|
616
|
+
})
|
|
617
|
+
])
|
|
618
|
+
])) : D("", !0),
|
|
619
|
+
h("div", Nt, [
|
|
620
|
+
(m(), E("svg", {
|
|
621
|
+
width: "20",
|
|
622
|
+
height: "20",
|
|
623
|
+
viewBox: "0 0 15 15",
|
|
624
|
+
fill: "none",
|
|
625
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
626
|
+
onClick: o[15] || (o[15] = (x) => Ne())
|
|
627
|
+
}, o[21] || (o[21] = [
|
|
628
|
+
h("path", {
|
|
629
|
+
"fill-rule": "evenodd",
|
|
630
|
+
"clip-rule": "evenodd",
|
|
631
|
+
d: "M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z",
|
|
632
|
+
fill: "#000000"
|
|
633
|
+
}, null, -1)
|
|
634
|
+
])))
|
|
635
|
+
])
|
|
636
|
+
], 8, Lt)
|
|
637
|
+
]),
|
|
638
|
+
_: 1
|
|
639
|
+
}, 8, ["id", "content", "options", "placeholder"])) : D("", !0)
|
|
640
|
+
], 2)
|
|
641
|
+
]),
|
|
642
|
+
_: 1
|
|
643
|
+
}, 8, ["label", "hint", "error-message", "is-required", "label-icon", "tooltip-text", "tooltip-options"]));
|
|
644
|
+
}
|
|
645
|
+
}, Pt = {
|
|
646
|
+
__name: "InputHex",
|
|
647
|
+
props: {
|
|
648
|
+
modelValue: {
|
|
649
|
+
type: String
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
emits: {
|
|
653
|
+
"update:modelValue": []
|
|
654
|
+
},
|
|
655
|
+
setup(n, { emit: V }) {
|
|
656
|
+
const r = n, b = V, u = v(""), f = (p) => {
|
|
657
|
+
u.value = p, u.value = `#${p.replace(/#/g, "")}`;
|
|
658
|
+
}, C = () => {
|
|
659
|
+
let p = u.value;
|
|
660
|
+
if (p === r.modelValue) return;
|
|
661
|
+
if (!/^#[0-9a-fA-F]+$/.test(p)) {
|
|
662
|
+
u.value = r.modelValue;
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
let a = p.replace(/#/g, "");
|
|
666
|
+
switch (a.length) {
|
|
667
|
+
case 0:
|
|
668
|
+
a = r.modelValue.replace("#", "");
|
|
669
|
+
break;
|
|
670
|
+
case 1:
|
|
671
|
+
case 2:
|
|
672
|
+
a = a.repeat(3);
|
|
673
|
+
break;
|
|
674
|
+
case 4:
|
|
675
|
+
case 5:
|
|
676
|
+
a = a.slice(0, 3);
|
|
677
|
+
break;
|
|
678
|
+
case 3:
|
|
679
|
+
case 6:
|
|
680
|
+
break;
|
|
681
|
+
default:
|
|
682
|
+
a = a.slice(0, 6);
|
|
683
|
+
}
|
|
684
|
+
u.value = `#${a.toUpperCase()}`, b("update:modelValue", u.value);
|
|
685
|
+
};
|
|
686
|
+
return fe(
|
|
687
|
+
() => r.modelValue,
|
|
688
|
+
(p, a) => {
|
|
689
|
+
p !== a && (u.value = p);
|
|
690
|
+
},
|
|
691
|
+
{ immediate: !0 }
|
|
692
|
+
), (p, a) => (m(), X(w(we), {
|
|
693
|
+
class: "w-[158px]",
|
|
694
|
+
placeholder: "#FFFFFF",
|
|
695
|
+
"model-value": u.value,
|
|
696
|
+
"onUpdate:modelValue": f,
|
|
697
|
+
onBlur: C,
|
|
698
|
+
onKeyup: ot(C, ["enter"])
|
|
699
|
+
}, null, 8, ["model-value"]));
|
|
700
|
+
}
|
|
701
|
+
}, Xt = { class: "grid grid-cols-3 gap-3" }, nt = {
|
|
702
|
+
__name: "InputRgbHsl",
|
|
703
|
+
props: {
|
|
704
|
+
inputType: {
|
|
705
|
+
default: "RGB",
|
|
706
|
+
type: String
|
|
707
|
+
},
|
|
708
|
+
rgbValue: {
|
|
709
|
+
type: Object
|
|
710
|
+
},
|
|
711
|
+
hslValue: {
|
|
712
|
+
type: Object
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
emits: {
|
|
716
|
+
"update-rgb-value": [],
|
|
717
|
+
"update-hsl-value": []
|
|
718
|
+
},
|
|
719
|
+
setup(n, { emit: V }) {
|
|
720
|
+
const r = n, b = V, u = v({
|
|
721
|
+
r: 0,
|
|
722
|
+
g: 0,
|
|
723
|
+
b: 0
|
|
724
|
+
}), f = v(), C = v(), p = v(), a = (O, L) => {
|
|
725
|
+
var j, M, F;
|
|
726
|
+
let B = 255;
|
|
727
|
+
if (r.inputType == "HSL" && (B = 100, O == "r" && (B = 360)), !isNaN(parseInt(L))) {
|
|
728
|
+
if (O == "r") {
|
|
729
|
+
let U = parseInt(L);
|
|
730
|
+
U <= B && (u.value.r = U, r.inputType == "RGB" ? H("r") : Z()), (j = f.value) == null || j.focus();
|
|
731
|
+
} else if (O == "g") {
|
|
732
|
+
let U = parseInt(L);
|
|
733
|
+
U <= B && (u.value.g = U, r.inputType == "RGB" ? H("g") : Z()), (M = C.value) == null || M.focus();
|
|
734
|
+
} else if (O == "b") {
|
|
735
|
+
let U = parseInt(L);
|
|
736
|
+
U <= B && (u.value.b = U, r.inputType == "RGB" ? H("b") : Z()), (F = p.value) == null || F.focus();
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}, H = (O) => {
|
|
740
|
+
b("update-rgb-value", {
|
|
741
|
+
type: O,
|
|
742
|
+
value: {
|
|
743
|
+
r: parseInt(u.value.r),
|
|
744
|
+
g: parseInt(u.value.g),
|
|
745
|
+
b: parseInt(u.value.b)
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
}, Z = () => {
|
|
749
|
+
b("update-hsl-value", {
|
|
750
|
+
h: parseInt(u.value.r),
|
|
751
|
+
s: parseInt(u.value.g),
|
|
752
|
+
l: parseInt(u.value.b)
|
|
753
|
+
});
|
|
754
|
+
};
|
|
755
|
+
return r.inputType === "RGB" ? fe(
|
|
756
|
+
() => r.rgbValue,
|
|
757
|
+
(O, L) => {
|
|
758
|
+
O !== L && (u.value = O);
|
|
759
|
+
},
|
|
760
|
+
{ immediate: !0, deep: !0 }
|
|
761
|
+
) : fe(
|
|
762
|
+
() => r.hslValue,
|
|
763
|
+
(O) => {
|
|
764
|
+
u.value = {
|
|
765
|
+
r: O.h,
|
|
766
|
+
g: O.s,
|
|
767
|
+
b: O.l
|
|
768
|
+
};
|
|
769
|
+
},
|
|
770
|
+
{ immediate: !0, deep: !0 }
|
|
771
|
+
), (O, L) => (m(), E("div", Xt, [
|
|
772
|
+
T(w(we), {
|
|
773
|
+
ref_key: "rInputEl",
|
|
774
|
+
ref: f,
|
|
775
|
+
"model-value": u.value.r,
|
|
776
|
+
placeholder: "100",
|
|
777
|
+
"onUpdate:modelValue": L[0] || (L[0] = (B) => a("r", B))
|
|
778
|
+
}, null, 8, ["model-value"]),
|
|
779
|
+
T(w(we), {
|
|
780
|
+
ref_key: "gInputEl",
|
|
781
|
+
ref: C,
|
|
782
|
+
"model-value": u.value.g,
|
|
783
|
+
placeholder: "100",
|
|
784
|
+
"onUpdate:modelValue": L[1] || (L[1] = (B) => a("g", B))
|
|
785
|
+
}, null, 8, ["model-value"]),
|
|
786
|
+
T(w(we), {
|
|
787
|
+
ref_key: "bInputEl",
|
|
788
|
+
ref: p,
|
|
789
|
+
"model-value": u.value.b,
|
|
790
|
+
placeholder: "100",
|
|
791
|
+
"onUpdate:modelValue": L[2] || (L[2] = (B) => a("b", B))
|
|
792
|
+
}, null, 8, ["model-value"])
|
|
793
|
+
]));
|
|
794
|
+
}
|
|
795
|
+
}, qt = {
|
|
796
|
+
__name: "InputOpacity",
|
|
797
|
+
props: {
|
|
798
|
+
modelValue: {
|
|
799
|
+
type: Number
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
emits: {
|
|
803
|
+
"update:modelValue": []
|
|
804
|
+
},
|
|
805
|
+
setup(n, { emit: V }) {
|
|
806
|
+
const r = n, b = V, u = v(""), f = (p) => {
|
|
807
|
+
u.value = p;
|
|
808
|
+
}, C = () => {
|
|
809
|
+
let p = parseInt(u.value);
|
|
810
|
+
p && p <= 100 ? b("update:modelValue", p) : u.value = r.modelValue;
|
|
811
|
+
};
|
|
812
|
+
return fe(
|
|
813
|
+
() => r.modelValue,
|
|
814
|
+
(p, a) => {
|
|
815
|
+
p !== a && (u.value = p);
|
|
816
|
+
},
|
|
817
|
+
{ immediate: !0 }
|
|
818
|
+
), (p, a) => (m(), X(w(we), {
|
|
819
|
+
class: "w-[75px]",
|
|
820
|
+
placeholder: "100",
|
|
821
|
+
"model-value": u.value,
|
|
822
|
+
"onUpdate:modelValue": f,
|
|
823
|
+
onBlur: C,
|
|
824
|
+
onKeyup: ot(C, ["enter"])
|
|
825
|
+
}, {
|
|
826
|
+
leading: W(() => a[0] || (a[0] = [
|
|
827
|
+
ve("%")
|
|
828
|
+
])),
|
|
829
|
+
_: 1
|
|
830
|
+
}, 8, ["model-value"]));
|
|
831
|
+
}
|
|
832
|
+
}, Gt = {
|
|
833
|
+
__name: "SelectColorFormat",
|
|
834
|
+
props: {
|
|
835
|
+
modelValue: { default: "RGB", type: String }
|
|
836
|
+
},
|
|
837
|
+
emits: ["update:model-value"],
|
|
838
|
+
setup(n, { emit: V }) {
|
|
839
|
+
const b = v(n.modelValue), u = V, f = (C) => {
|
|
840
|
+
b.value = C, u("update:model-value", C);
|
|
841
|
+
};
|
|
842
|
+
return (C, p) => (m(), X(w(Ze), {
|
|
843
|
+
class: "!w-[80px]",
|
|
844
|
+
"model-value": b.value,
|
|
845
|
+
options: [
|
|
846
|
+
{
|
|
847
|
+
label: "HEX",
|
|
848
|
+
value: "HEX"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
label: "RGB",
|
|
852
|
+
value: "RGB"
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
label: "HSL",
|
|
856
|
+
value: "HSL"
|
|
857
|
+
}
|
|
858
|
+
],
|
|
859
|
+
"onUpdate:modelValue": f
|
|
860
|
+
}, null, 8, ["model-value"]));
|
|
861
|
+
}
|
|
862
|
+
}, Yt = { class: "opacity-bar" }, Wt = { class: "picker-opacity-slider opacity-bar-background" }, jt = ["value"], zt = {
|
|
863
|
+
__name: "SliderOpacity",
|
|
864
|
+
props: {
|
|
865
|
+
modelValue: { default: 0, type: Number }
|
|
866
|
+
},
|
|
867
|
+
emits: ["update:modelValue", "onInput"],
|
|
868
|
+
setup(n, { emit: V }) {
|
|
869
|
+
const r = Re("opacitySlider"), b = V, u = (f) => {
|
|
870
|
+
b("update:modelValue", parseInt(f.target.value)), b("onInput", f);
|
|
871
|
+
};
|
|
872
|
+
return (f, C) => (m(), E("div", Yt, [
|
|
873
|
+
h("div", Wt, [
|
|
874
|
+
h("input", {
|
|
875
|
+
ref_key: "opacitySlider",
|
|
876
|
+
ref: r,
|
|
877
|
+
value: n.modelValue,
|
|
878
|
+
class: "opacity__slider",
|
|
879
|
+
type: "range",
|
|
880
|
+
min: "0",
|
|
881
|
+
max: "100",
|
|
882
|
+
onInput: u
|
|
883
|
+
}, null, 40, jt)
|
|
884
|
+
])
|
|
885
|
+
]));
|
|
886
|
+
}
|
|
887
|
+
}, Kt = {
|
|
888
|
+
__name: "SliderGradient",
|
|
889
|
+
props: {
|
|
890
|
+
gradientType: String
|
|
891
|
+
},
|
|
892
|
+
emits: ["onAddColor", "onMouseDown", "onDeleteColor"],
|
|
893
|
+
setup(n, { emit: V }) {
|
|
894
|
+
const r = Re("gradientBar"), b = v(), u = V, f = (L) => {
|
|
895
|
+
L.preventDefault();
|
|
896
|
+
}, C = v("left:0"), p = v(!1), a = (L) => {
|
|
897
|
+
u("onMouseDown", L);
|
|
898
|
+
}, H = () => {
|
|
899
|
+
let L = b.value.querySelector(".select");
|
|
900
|
+
C.value = L == null ? void 0 : L.getAttribute("style");
|
|
901
|
+
}, Z = () => {
|
|
902
|
+
var B;
|
|
903
|
+
H(), (((B = b.value.querySelectorAll(".gradient-handle")) == null ? void 0 : B.length) ?? 2) > 2 ? p.value = !0 : p.value = !1;
|
|
904
|
+
}, O = (L) => {
|
|
905
|
+
p.value = !1, u("onAddColor", L);
|
|
906
|
+
};
|
|
907
|
+
return (L, B) => (m(), E("div", {
|
|
908
|
+
ref_key: "gradientSlider",
|
|
909
|
+
ref: b,
|
|
910
|
+
class: "relative h-[40px]",
|
|
911
|
+
onClick: Z
|
|
912
|
+
}, [
|
|
913
|
+
h("button", {
|
|
914
|
+
type: "button",
|
|
915
|
+
class: Q(["absolute top-[-18px] text-oc-accent-3 rounded-[4px] border-2 border-oc-gray-200 p-2 bg-oc-bg-light", p.value ? "" : "!hidden"]),
|
|
916
|
+
style: te(C.value),
|
|
917
|
+
onClick: B[0] || (B[0] = (j) => L.$emit("onDeleteColor"))
|
|
918
|
+
}, [
|
|
919
|
+
T(w(A), {
|
|
920
|
+
name: "bin",
|
|
921
|
+
width: "14",
|
|
922
|
+
height: "14"
|
|
923
|
+
})
|
|
924
|
+
], 6),
|
|
925
|
+
h("div", {
|
|
926
|
+
class: Q(["gradient-bar", {
|
|
927
|
+
"mt-[20px]": n.gradientType === "linear",
|
|
928
|
+
"mt-[12px]": n.gradientType === "radial"
|
|
929
|
+
}]),
|
|
930
|
+
onMousedown: a,
|
|
931
|
+
onDragstart: f
|
|
932
|
+
}, [
|
|
933
|
+
h("div", {
|
|
934
|
+
ref_key: "gradientBar",
|
|
935
|
+
ref: r,
|
|
936
|
+
class: "gradient-container",
|
|
937
|
+
onDblclick: O
|
|
938
|
+
}, null, 544)
|
|
939
|
+
], 34)
|
|
940
|
+
], 512));
|
|
941
|
+
}
|
|
942
|
+
}, Zt = { class: "picker-hue" }, Jt = ["value"], _t = {
|
|
943
|
+
__name: "SliderHue",
|
|
944
|
+
props: {
|
|
945
|
+
modelValue: { default: 0, type: Number }
|
|
946
|
+
},
|
|
947
|
+
emits: ["update:modelValue", "onInput", "onChange"],
|
|
948
|
+
setup(n, { emit: V }) {
|
|
949
|
+
const r = V, b = (u) => {
|
|
950
|
+
r("update:modelValue", parseFloat(u.target.value)), r("onInput", u);
|
|
951
|
+
};
|
|
952
|
+
return (u, f) => (m(), E("div", Zt, [
|
|
953
|
+
h("input", {
|
|
954
|
+
value: n.modelValue,
|
|
955
|
+
class: "picker-hue-range-slider",
|
|
956
|
+
type: "range",
|
|
957
|
+
min: "0",
|
|
958
|
+
max: "360",
|
|
959
|
+
step: "0.1",
|
|
960
|
+
onInput: b,
|
|
961
|
+
onChange: f[0] || (f[0] = (C) => u.$emit("onChange", C))
|
|
962
|
+
}, null, 40, Jt)
|
|
963
|
+
]));
|
|
964
|
+
}
|
|
965
|
+
}, el = { class: "px-2 mt-2" }, tl = {
|
|
966
|
+
key: 1,
|
|
967
|
+
class: "grid grid-cols-2 gap-4 px-1"
|
|
968
|
+
}, ll = {
|
|
969
|
+
__name: "GradientSettings",
|
|
970
|
+
props: {
|
|
971
|
+
mode: {
|
|
972
|
+
default: "gradient",
|
|
973
|
+
type: String
|
|
974
|
+
},
|
|
975
|
+
gradientType: { default: "linear", type: String },
|
|
976
|
+
angle: { default: 90, type: Number },
|
|
977
|
+
percentageX: { default: 50, type: Number },
|
|
978
|
+
percentageY: { default: 50, type: Number }
|
|
979
|
+
},
|
|
980
|
+
emits: ["update:angle", "update:percentageX", "update:percentageY", "onInput"],
|
|
981
|
+
setup(n, { emit: V }) {
|
|
982
|
+
const r = v(!1), b = v(!1);
|
|
983
|
+
Je(() => {
|
|
984
|
+
r.value = !0, b.value = !0;
|
|
985
|
+
});
|
|
986
|
+
const u = V, f = (C, p) => {
|
|
987
|
+
let a = parseInt(C);
|
|
988
|
+
switch (p) {
|
|
989
|
+
case "angle":
|
|
990
|
+
C > 360 ? a = 360 : C < 0 && (a = 0), u("update:angle", a), u("onInput");
|
|
991
|
+
break;
|
|
992
|
+
case "percentageX":
|
|
993
|
+
C > 100 ? a = 100 : C < 0 && (a = 0), u("update:percentageX", a), u("onInput");
|
|
994
|
+
break;
|
|
995
|
+
case "percentageY":
|
|
996
|
+
C > 100 ? a = 100 : C < 0 && (a = 0), u("update:percentageY", a), u("onInput");
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
return (C, p) => (m(), E("div", el, [
|
|
1001
|
+
n.gradientType == "linear" && r.value ? (m(), X(w(Ae), {
|
|
1002
|
+
key: 0,
|
|
1003
|
+
label: "Angle",
|
|
1004
|
+
"model-value": n.angle,
|
|
1005
|
+
"min-limit": 0,
|
|
1006
|
+
"max-limit": 360,
|
|
1007
|
+
"onUpdate:modelValue": p[0] || (p[0] = (a) => f(a, "angle"))
|
|
1008
|
+
}, {
|
|
1009
|
+
"min-limit-label": W(() => p[3] || (p[3] = [
|
|
1010
|
+
ve("0 ")
|
|
1011
|
+
])),
|
|
1012
|
+
"max-limit-label": W(() => p[4] || (p[4] = [
|
|
1013
|
+
ve("360"),
|
|
1014
|
+
h("span", null, "°", -1)
|
|
1015
|
+
])),
|
|
1016
|
+
_: 1
|
|
1017
|
+
}, 8, ["model-value"])) : D("", !0),
|
|
1018
|
+
n.gradientType == "radial" && b.value ? (m(), E("div", tl, [
|
|
1019
|
+
T(w(Ae), {
|
|
1020
|
+
label: "Position X",
|
|
1021
|
+
"model-value": n.percentageX,
|
|
1022
|
+
"min-limit": 0,
|
|
1023
|
+
"max-limit": 100,
|
|
1024
|
+
"onUpdate:modelValue": p[1] || (p[1] = (a) => f(a, "percentageX"))
|
|
1025
|
+
}, {
|
|
1026
|
+
"min-limit-label": W(() => p[5] || (p[5] = [
|
|
1027
|
+
ve("0")
|
|
1028
|
+
])),
|
|
1029
|
+
"max-limit-label": W(() => p[6] || (p[6] = [
|
|
1030
|
+
ve("100%")
|
|
1031
|
+
])),
|
|
1032
|
+
_: 1
|
|
1033
|
+
}, 8, ["model-value"]),
|
|
1034
|
+
T(w(Ae), {
|
|
1035
|
+
label: "Position Y",
|
|
1036
|
+
"model-value": n.percentageY,
|
|
1037
|
+
"min-limit": 0,
|
|
1038
|
+
"max-limit": 100,
|
|
1039
|
+
"onUpdate:modelValue": p[2] || (p[2] = (a) => f(a, "percentageY"))
|
|
1040
|
+
}, {
|
|
1041
|
+
"min-limit-label": W(() => p[7] || (p[7] = [
|
|
1042
|
+
ve("0")
|
|
1043
|
+
])),
|
|
1044
|
+
"max-limit-label": W(() => p[8] || (p[8] = [
|
|
1045
|
+
ve("100%")
|
|
1046
|
+
])),
|
|
1047
|
+
_: 1
|
|
1048
|
+
}, 8, ["model-value"])
|
|
1049
|
+
])) : D("", !0)
|
|
1050
|
+
]));
|
|
1051
|
+
}
|
|
1052
|
+
}, al = {
|
|
1053
|
+
__name: "PickerWrap",
|
|
1054
|
+
emits: ["onMouseDown"],
|
|
1055
|
+
setup(n) {
|
|
1056
|
+
const V = Re("canvas"), r = Re("pickerWrap"), b = Re("pickerPointer"), u = (f) => {
|
|
1057
|
+
f.preventDefault();
|
|
1058
|
+
};
|
|
1059
|
+
return (f, C) => (m(), E("div", {
|
|
1060
|
+
ref_key: "pickerWrap",
|
|
1061
|
+
ref: r,
|
|
1062
|
+
class: "cp-picker-wrap",
|
|
1063
|
+
onMousedown: C[0] || (C[0] = (p) => f.$emit("onMouseDown", p)),
|
|
1064
|
+
onDragstart: u
|
|
1065
|
+
}, [
|
|
1066
|
+
h("canvas", {
|
|
1067
|
+
ref_key: "canvas",
|
|
1068
|
+
ref: V,
|
|
1069
|
+
class: "colour-area"
|
|
1070
|
+
}, null, 512),
|
|
1071
|
+
C[1] || (C[1] = h("div", { class: "colour-area-mask" }, null, -1)),
|
|
1072
|
+
h("div", {
|
|
1073
|
+
ref_key: "pickerPointer",
|
|
1074
|
+
ref: b,
|
|
1075
|
+
class: "colour-area-point-circle"
|
|
1076
|
+
}, null, 512)
|
|
1077
|
+
], 544));
|
|
1078
|
+
}
|
|
1079
|
+
}, nl = { class: "w-full flex justify-center" }, ol = {
|
|
1080
|
+
key: 1,
|
|
1081
|
+
width: "28",
|
|
1082
|
+
height: "28",
|
|
1083
|
+
viewBox: "0 0 28 28",
|
|
1084
|
+
fill: "none",
|
|
1085
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1086
|
+
}, il = {
|
|
1087
|
+
__name: "ColorType",
|
|
1088
|
+
props: {
|
|
1089
|
+
variant: String,
|
|
1090
|
+
mode: {
|
|
1091
|
+
default: "gradient",
|
|
1092
|
+
type: String
|
|
1093
|
+
},
|
|
1094
|
+
gradientType: { default: "linear", type: String },
|
|
1095
|
+
iconClasses: {
|
|
1096
|
+
default: () => ({
|
|
1097
|
+
linear: "",
|
|
1098
|
+
radial: ""
|
|
1099
|
+
}),
|
|
1100
|
+
type: Object
|
|
1101
|
+
},
|
|
1102
|
+
modelValue: String
|
|
1103
|
+
},
|
|
1104
|
+
emits: ["onChangeMode"],
|
|
1105
|
+
setup(n) {
|
|
1106
|
+
return (V, r) => (m(), E("div", nl, [
|
|
1107
|
+
h("button", {
|
|
1108
|
+
type: "button",
|
|
1109
|
+
class: Q(n.mode == "solid" ? "active" : ""),
|
|
1110
|
+
style: { padding: "7px" },
|
|
1111
|
+
onClick: r[0] || (r[0] = (b) => V.$emit("onChangeMode", "solid"))
|
|
1112
|
+
}, [
|
|
1113
|
+
n.modelValue && n.mode == "solid" ? (m(), E("div", {
|
|
1114
|
+
key: 0,
|
|
1115
|
+
class: "w-[28px] h-[28px] rounded-full border",
|
|
1116
|
+
style: te(`background:${n.modelValue}`)
|
|
1117
|
+
}, null, 4)) : (m(), E("svg", ol, r[3] || (r[3] = [
|
|
1118
|
+
h("g", { opacity: "0.5" }, [
|
|
1119
|
+
h("path", {
|
|
1120
|
+
d: "M0 14C0 6.26801 6.26801 0 14 0C21.732 0 28 6.26801 28 14C28 21.732 21.732 28 14 28C6.26801 28 0 21.732 0 14Z",
|
|
1121
|
+
fill: "#03102F"
|
|
1122
|
+
})
|
|
1123
|
+
], -1)
|
|
1124
|
+
])))
|
|
1125
|
+
], 2),
|
|
1126
|
+
h("button", {
|
|
1127
|
+
type: "button",
|
|
1128
|
+
class: Q(n.gradientType == "linear" && n.mode != "solid" ? "active" : ""),
|
|
1129
|
+
style: te(`${n.iconClasses.linear ? "" : "padding: 7px;"}`),
|
|
1130
|
+
onClick: r[1] || (r[1] = (b) => V.$emit("onChangeMode", "linear"))
|
|
1131
|
+
}, [
|
|
1132
|
+
h("div", {
|
|
1133
|
+
class: "w-[28px] h-[28px] rounded-full border",
|
|
1134
|
+
style: te(
|
|
1135
|
+
n.modelValue && n.gradientType == "linear" && n.mode != "solid" ? `background:${n.modelValue}` : `
|
|
1136
|
+
background: linear-gradient(
|
|
1137
|
+
180deg,
|
|
1138
|
+
#03102f 0%,
|
|
1139
|
+
rgba(3, 16, 47, 0) 100%
|
|
1140
|
+
);
|
|
1141
|
+
`
|
|
1142
|
+
)
|
|
1143
|
+
}, null, 4)
|
|
1144
|
+
], 6),
|
|
1145
|
+
h("button", {
|
|
1146
|
+
type: "button",
|
|
1147
|
+
class: Q(n.gradientType == "radial" && n.mode != "solid" ? "active" : ""),
|
|
1148
|
+
style: te(`${n.iconClasses.radial ? "" : "padding: 6px;"}`),
|
|
1149
|
+
onClick: r[2] || (r[2] = (b) => V.$emit("onChangeMode", "radial"))
|
|
1150
|
+
}, [
|
|
1151
|
+
h("div", {
|
|
1152
|
+
class: "w-[28px] h-[28px] rounded-full border",
|
|
1153
|
+
style: te(
|
|
1154
|
+
n.modelValue && n.gradientType == "radial" && n.mode != "solid" ? `background:${n.modelValue}` : "background: radial-gradient(circle at 50% 50%, rgb(255, 255, 255) 0%, rgb(3, 16, 47) 100%);"
|
|
1155
|
+
)
|
|
1156
|
+
}, null, 4)
|
|
1157
|
+
], 6)
|
|
1158
|
+
]));
|
|
1159
|
+
}
|
|
1160
|
+
}, sl = ["cp-theme"], rl = {
|
|
1161
|
+
key: 0,
|
|
1162
|
+
class: "flex justify-end border-b h-[46px] relative mt-[-5px] mb-5"
|
|
1163
|
+
}, ul = {
|
|
1164
|
+
key: 1,
|
|
1165
|
+
class: "grid items-center mb-5"
|
|
1166
|
+
}, dl = { key: 2 }, cl = { key: 0 }, pl = { class: "ck-cp-local-color-conatiner" }, gl = ["onClick"], vl = { class: "flex items-center gap-2" }, ml = { id: "ck-cp-target-background" }, fl = { class: "flex gap-3" }, hl = {
|
|
1167
|
+
key: 0,
|
|
1168
|
+
class: "w-full flex gap-3"
|
|
1169
|
+
}, bl = {
|
|
1170
|
+
key: 4,
|
|
1171
|
+
class: "ck-cp-local-color-conatiner"
|
|
1172
|
+
}, yl = ["onClick"], xl = {
|
|
1173
|
+
__name: "OcColorPickerPopup",
|
|
1174
|
+
props: {
|
|
1175
|
+
modelValue: {
|
|
1176
|
+
default: "",
|
|
1177
|
+
type: String
|
|
1178
|
+
},
|
|
1179
|
+
type: { default: "HEX8", type: String },
|
|
1180
|
+
inputType: { default: "HEX", type: String },
|
|
1181
|
+
theme: { default: "light", type: String },
|
|
1182
|
+
showColorList: { default: !0, type: Boolean },
|
|
1183
|
+
showEyeDrop: { default: !0, type: Boolean },
|
|
1184
|
+
showAlpha: { default: !0, type: Boolean },
|
|
1185
|
+
showInputMenu: { default: !0, type: Boolean },
|
|
1186
|
+
showInputSet: { default: !0, type: Boolean },
|
|
1187
|
+
disabled: { default: !1, type: Boolean },
|
|
1188
|
+
iconClasses: {
|
|
1189
|
+
default: () => ({
|
|
1190
|
+
linear: "",
|
|
1191
|
+
radial: "",
|
|
1192
|
+
ruler: "",
|
|
1193
|
+
eyeDroper: "",
|
|
1194
|
+
inputMenu: "",
|
|
1195
|
+
save: "",
|
|
1196
|
+
delete: ""
|
|
1197
|
+
}),
|
|
1198
|
+
type: Object
|
|
1199
|
+
},
|
|
1200
|
+
presetColors: Array,
|
|
1201
|
+
variant: {
|
|
1202
|
+
type: String,
|
|
1203
|
+
default: "solid"
|
|
1204
|
+
},
|
|
1205
|
+
lastUsedColors: Array
|
|
1206
|
+
},
|
|
1207
|
+
emits: ["update:modelValue", "last-used-pick"],
|
|
1208
|
+
setup(n, { emit: V }) {
|
|
1209
|
+
const r = n, b = v(r.variant == "gradient" ? "gradient" : "solid"), u = v(null), f = V, C = v(r.modelValue), p = (t) => {
|
|
1210
|
+
C.value = t, F.value && f("update:modelValue", t);
|
|
1211
|
+
}, a = v([
|
|
1212
|
+
{ id: 1, r: 68, g: 71, b: 119, a: 100, percent: 0, hue: 0, select: !0 },
|
|
1213
|
+
{ id: 2, r: 0, g: 0, b: 255, a: 100, percent: 100, hue: 0, select: !1 }
|
|
1214
|
+
]), H = v(r.lastUsedColors);
|
|
1215
|
+
fe(
|
|
1216
|
+
() => r.lastUsedColors,
|
|
1217
|
+
() => {
|
|
1218
|
+
H.value = r.lastUsedColors;
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
deep: !0
|
|
1222
|
+
}
|
|
1223
|
+
);
|
|
1224
|
+
const Z = $e(() => r.variant !== "gradient" ? H.value.filter((t) => !t.includes("linear") && !t.includes("radial")) : H.value), O = v(!1), L = v("linear"), B = _e({
|
|
1225
|
+
angle: 90,
|
|
1226
|
+
percentageX: 50,
|
|
1227
|
+
percentageY: 50
|
|
1228
|
+
}), j = v(""), M = v(r.inputType), F = v(!1), U = v(), le = v(), J = v(), z = v(), R = v(), N = _e({
|
|
1229
|
+
h: 0,
|
|
1230
|
+
s: 0,
|
|
1231
|
+
l: 0
|
|
1232
|
+
});
|
|
1233
|
+
Be("gradientBar", le), Be("canvas", J), Be("pickerWrap", z), Be("pickerPointer", R), Be("opacitySlider", U);
|
|
1234
|
+
let ae = 0, ee = 0, y = 0, Se = 0, ue = 0, ie = 0;
|
|
1235
|
+
const Ne = (t) => {
|
|
1236
|
+
!z.value || !R.value || (ue = z.value.offsetHeight - R.value.offsetHeight, ie = z.value.offsetWidth - R.value.offsetWidth, y = t.clientX - t.target.getBoundingClientRect().left, Se = t.clientY - t.target.getBoundingClientRect().top, ae = y - R.value.offsetWidth / 2, ee = Se - R.value.offsetHeight / 2, R.value.style.left = `${ae}px`, R.value.style.top = `${ee}px`, Ce(!1), G(), window.addEventListener("mousemove", Ee), window.addEventListener("mouseup", Me));
|
|
1237
|
+
}, Ee = (t) => {
|
|
1238
|
+
t.preventDefault();
|
|
1239
|
+
const e = z.value.getBoundingClientRect(), l = t.clientX - e.left - R.value.offsetWidth / 2, i = t.clientY - e.top - R.value.offsetHeight / 2;
|
|
1240
|
+
l >= 0 && l <= ie ? (ae = l, R.value.style.left = `${l}px`) : 0 > l ? (ae = 0, R.value.style.left = "0px") : l > ie && (ae = ie, R.value.style.left = `${ie}px`), i >= 0 && i <= ue ? (ee = i, R.value.style.top = `${i}px`) : 0 > i ? (ee = 0, R.value.style.top = "0px") : i > ue && (ee = ue, R.value.style.top = `${ue}px`), Ce(!1), G();
|
|
1241
|
+
}, Me = () => {
|
|
1242
|
+
window.removeEventListener("mousemove", Ee), window.removeEventListener("mouseup", Me);
|
|
1243
|
+
}, Ce = (t) => {
|
|
1244
|
+
if (!t) {
|
|
1245
|
+
let e = Ue();
|
|
1246
|
+
const l = et(ne.value, e.s, e.l);
|
|
1247
|
+
if (l) {
|
|
1248
|
+
if (F.value) {
|
|
1249
|
+
let i = a.value.find((s) => s.select == !0);
|
|
1250
|
+
i && (i.r = l.r, i.g = l.g, i.b = l.b);
|
|
1251
|
+
}
|
|
1252
|
+
K(), q();
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
}, ne = v(0), Ie = async (t) => {
|
|
1256
|
+
const { rgb: e } = tt(ne.value, 100, 50);
|
|
1257
|
+
Oe(e), setTimeout(() => {
|
|
1258
|
+
Ce(t), G();
|
|
1259
|
+
}, 0);
|
|
1260
|
+
}, Ue = () => {
|
|
1261
|
+
let t = { s: 0, l: 0 }, e = z.value.offsetWidth - R.value.offsetWidth, l = z.value.offsetHeight - R.value.offsetHeight, i = parseInt(R.value.style.left), d = 1 - parseInt(R.value.style.top) / l, k = i / e;
|
|
1262
|
+
return t.l = d / 2 * (2 - k), t.s = d * k / (1 - Math.abs(2 * t.l - 1)), Number.isNaN(t.s) && (t.s = t.l), t.l = t.l > 1 ? 1 : t.l, t.s = t.s > 1 ? 1 : t.s, t;
|
|
1263
|
+
}, me = () => {
|
|
1264
|
+
const t = a.value.find((e) => e.select == !0);
|
|
1265
|
+
if (t) {
|
|
1266
|
+
const { l: e, s: l } = at(t.r, t.g, t.b);
|
|
1267
|
+
let i = e, s = l;
|
|
1268
|
+
Number.isNaN(s) && (s = i);
|
|
1269
|
+
let d = { x: 0, y: 0 }, k = z.value.offsetWidth - R.value.offsetWidth, I = z.value.offsetHeight - R.value.offsetHeight;
|
|
1270
|
+
const [$, g] = 2 * i - 1 < 0 ? [
|
|
1271
|
+
k * 2 * s / (1 + s),
|
|
1272
|
+
I * (1 - i * (1 + s))
|
|
1273
|
+
] : [
|
|
1274
|
+
-k * 2 * (i - 1) * s / (i + s - i * s),
|
|
1275
|
+
I * (i - 1) * (s - 1)
|
|
1276
|
+
];
|
|
1277
|
+
return d.x = $, d.y = g, d;
|
|
1278
|
+
} else
|
|
1279
|
+
return null;
|
|
1280
|
+
}, Pe = () => {
|
|
1281
|
+
const t = a.value.find((e) => e.select == !0);
|
|
1282
|
+
t && (t.hue = ne.value);
|
|
1283
|
+
}, oe = v(100), De = (t) => {
|
|
1284
|
+
if (r.showAlpha) {
|
|
1285
|
+
const e = a.value.find((l) => l.select == !0);
|
|
1286
|
+
e && (e.a = parseInt(t), q());
|
|
1287
|
+
}
|
|
1288
|
+
}, He = (t) => {
|
|
1289
|
+
var l, i, s, d;
|
|
1290
|
+
const e = (i = (l = u.value) == null ? void 0 : l.querySelector(".gradient-handle-content")) == null ? void 0 : i.getBoundingClientRect();
|
|
1291
|
+
return t === 0 ? "0px" : t === 100 && e ? `${(((s = le.value) == null ? void 0 : s.offsetWidth) || 0) - (e.width || 0)}px` : `${(((d = le.value) == null ? void 0 : d.offsetWidth) || 0) * (t / 100) - ((e == null ? void 0 : e.width) || 0) / 2}px`;
|
|
1292
|
+
};
|
|
1293
|
+
let P = null, _ = null;
|
|
1294
|
+
const Ve = (t) => {
|
|
1295
|
+
var i, s;
|
|
1296
|
+
const l = t.target.offsetParent;
|
|
1297
|
+
if ((i = l == null ? void 0 : l.id) != null && i.includes("clr-gb-")) {
|
|
1298
|
+
const d = l.id.replace("clr-gb-", "");
|
|
1299
|
+
_ = l;
|
|
1300
|
+
const k = a.value.find((I) => I.select == !0);
|
|
1301
|
+
if (k && k.id != d) {
|
|
1302
|
+
const I = (s = u.value) == null ? void 0 : s.querySelector(".gradient-handle.select");
|
|
1303
|
+
I == null || I.classList.remove("select"), l.classList.add("select");
|
|
1304
|
+
const $ = a.value.findIndex((g) => g.select == !0);
|
|
1305
|
+
for (let g = 0; g < a.value.length; g++) {
|
|
1306
|
+
const S = a.value[g];
|
|
1307
|
+
if (S.id == d) {
|
|
1308
|
+
$ != -1 && (a.value[$].select = !1), a.value[g].select = !0, oe.value = S.a, ce(S.r, S.g, S.b, S.hue, !0), K(), G();
|
|
1309
|
+
break;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
window.addEventListener("mousemove", de), window.addEventListener("mouseup", he);
|
|
1314
|
+
}
|
|
1315
|
+
}, he = () => {
|
|
1316
|
+
window.removeEventListener("mousemove", de), window.removeEventListener("mouseup", Ve);
|
|
1317
|
+
}, de = (t) => {
|
|
1318
|
+
var d, k;
|
|
1319
|
+
t.preventDefault();
|
|
1320
|
+
const e = (k = (d = u.value) == null ? void 0 : d.querySelector(".gradient-handle-content")) == null ? void 0 : k.getBoundingClientRect(), l = P == null ? void 0 : P.getBoundingClientRect(), i = l.width - (e == null ? void 0 : e.width);
|
|
1321
|
+
let s = t.clientX - (l.left || 0) - ((e == null ? void 0 : e.width) || 0) / 2;
|
|
1322
|
+
if (s < 0 ? s = 0 : s > i && (s = i), _) {
|
|
1323
|
+
_.style.left = `${s}px`;
|
|
1324
|
+
const I = parseFloat((s / ((l == null ? void 0 : l.width) - (e == null ? void 0 : e.width)) * 100).toFixed(0)), $ = a.value.find(
|
|
1325
|
+
(g) => g.id == (_ == null ? void 0 : _.id.replace("clr-gb-", ""))
|
|
1326
|
+
);
|
|
1327
|
+
$ && ($.percent = I), q();
|
|
1328
|
+
}
|
|
1329
|
+
}, Xe = (t) => {
|
|
1330
|
+
var I, $;
|
|
1331
|
+
const e = P == null ? void 0 : P.getBoundingClientRect(), l = Math.round((t.clientX - ((e == null ? void 0 : e.left) || 0)) / ((e == null ? void 0 : e.width) || 1) * 100), i = a.value.findIndex((g) => g.select == !0), s = a.value[i], d = {
|
|
1332
|
+
id: Date.now(),
|
|
1333
|
+
r: s.r,
|
|
1334
|
+
g: s.g,
|
|
1335
|
+
b: s.b,
|
|
1336
|
+
a: s.a,
|
|
1337
|
+
percent: l,
|
|
1338
|
+
hue: s.hue,
|
|
1339
|
+
select: !0
|
|
1340
|
+
};
|
|
1341
|
+
a.value[i].select = !1;
|
|
1342
|
+
const k = (I = u.value) == null ? void 0 : I.querySelector(".gradient-handle.select");
|
|
1343
|
+
k == null || k.classList.remove("select"), a.value = [...a.value, d], ye(d), _ = ($ = u.value) == null ? void 0 : $.querySelector(`#clr-gb-${d.id}`), q();
|
|
1344
|
+
}, be = (t) => {
|
|
1345
|
+
if (t.r == 0 && t.g == 0 && t.b == 0)
|
|
1346
|
+
return !0;
|
|
1347
|
+
if (t.r == 255 && t.g == 255 && t.b == 255)
|
|
1348
|
+
return !0;
|
|
1349
|
+
{
|
|
1350
|
+
const e = J.value.getContext("2d", { willReadFrequently: !0 }), l = J.value.width, i = J.value.height, s = e.getImageData(0, 0, l, i).data, d = t.r, k = t.g, I = t.b;
|
|
1351
|
+
for (let $ = 0; $ < i; $++)
|
|
1352
|
+
for (let g = 0; g < l; g++) {
|
|
1353
|
+
const S = ($ * l + g) * 4, re = s[S], dt = s[S + 1], ct = s[S + 2];
|
|
1354
|
+
if (re === d && dt === k && ct === I)
|
|
1355
|
+
return !0;
|
|
1356
|
+
}
|
|
1357
|
+
return !1;
|
|
1358
|
+
}
|
|
1359
|
+
}, ce = (t, e, l, i, s) => {
|
|
1360
|
+
setTimeout(() => {
|
|
1361
|
+
if (be({ r: t, g: e, b: l })) {
|
|
1362
|
+
let d = me();
|
|
1363
|
+
d && (R.value.style.left = `${d.x}px`, R.value.style.top = `${d.y}px`);
|
|
1364
|
+
} else {
|
|
1365
|
+
let d = me();
|
|
1366
|
+
d && (R.value.style.left = `${d.x}px`, R.value.style.top = `${d.y}px`), ne.value = i, Ie(s);
|
|
1367
|
+
}
|
|
1368
|
+
}, 0);
|
|
1369
|
+
}, Le = () => {
|
|
1370
|
+
a.value.forEach((l) => ye(l)), Te();
|
|
1371
|
+
const t = a.value[0];
|
|
1372
|
+
ne.value = t.hue, Ie(!0);
|
|
1373
|
+
let e = me();
|
|
1374
|
+
e && (R.value.style.left = `${e.x}px`, R.value.style.top = `${e.y}px`), K(), q();
|
|
1375
|
+
}, ye = (t) => {
|
|
1376
|
+
if (b.value == "gradient") {
|
|
1377
|
+
let e = document.createElement("div");
|
|
1378
|
+
e.id = `clr-gb-${t.id}`, e.classList.add("gradient-handle"), e.style.left = He(t.percent);
|
|
1379
|
+
let l = document.createElement("div");
|
|
1380
|
+
l.classList.add("gradient-handle-content"), t.select == !0 && e.classList.add("select"), e.appendChild(l), P && P.appendChild(e);
|
|
1381
|
+
}
|
|
1382
|
+
}, Oe = (t) => {
|
|
1383
|
+
const e = J.value.getContext("2d", { willReadFrequently: !0 }), l = J.value.width, i = J.value.height;
|
|
1384
|
+
e.fillStyle = `rgb(${t[0]},${t[1]},${t[2]})`, e.fillRect(0, 0, l, i);
|
|
1385
|
+
let s = e.createLinearGradient(0, 0, l - 12, 0);
|
|
1386
|
+
s.addColorStop(0, "rgb(255,255,255)"), s.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = s, e.fillRect(0, 0, l, i);
|
|
1387
|
+
let d = e.createLinearGradient(0, 0, 0, i);
|
|
1388
|
+
d.addColorStop(0, "rgba(0,0,0,0)"), d.addColorStop(1, "rgb(0,0,0)"), e.fillStyle = d, e.fillRect(0, 0, l, i);
|
|
1389
|
+
}, K = () => {
|
|
1390
|
+
if (r.showAlpha) {
|
|
1391
|
+
let t = a.value.find((e) => e.select == !0);
|
|
1392
|
+
t && (U.value.style.background = ` linear-gradient(90deg,rgba(255, 255, 255, 0) 0%, rgba(${t.r}, ${t.g}, ${t.b}, 100) 97%)`);
|
|
1393
|
+
}
|
|
1394
|
+
}, q = () => {
|
|
1395
|
+
var t;
|
|
1396
|
+
if (b.value == "gradient") {
|
|
1397
|
+
a.value.sort((s, d) => s.percent - d.percent);
|
|
1398
|
+
let e = "linear-gradient(90deg, ", l;
|
|
1399
|
+
if (L.value == "linear") {
|
|
1400
|
+
l = `linear-gradient(${B.angle}deg, `;
|
|
1401
|
+
for (let s = 0; s < a.value.length; s++) {
|
|
1402
|
+
const { r: d, g: k, b: I, a: $, percent: g } = a.value[s];
|
|
1403
|
+
a.value.length - 1 == s ? (e = e + `rgba(${d},${k},${I},${$ / 100}) ${g}%)`, l = l + `rgba(${d},${k},${I},${$ / 100}) ${g}%)`) : (e = e + `rgba(${d},${k},${I},${$ / 100}) ${g}%, `, l = l + `rgba(${d},${k},${I},${$ / 100}) ${g}%, `);
|
|
1404
|
+
}
|
|
1405
|
+
} else {
|
|
1406
|
+
l = `radial-gradient(circle at ${B.percentageX}% ${B.percentageY}%, `;
|
|
1407
|
+
for (let s = 0; s < a.value.length; s++) {
|
|
1408
|
+
const { r: d, g: k, b: I, a: $, percent: g } = a.value[s];
|
|
1409
|
+
a.value.length - 1 == s ? (e = e + `rgba(${d},${k},${I},${$ / 100}) ${g}%)`, l = l + `rgba(${d},${k},${I},${$ / 100}) ${g}%)`) : (e = e + `rgba(${d},${k},${I},${$ / 100}) ${g}%, `, l = l + `rgba(${d},${k},${I},${$ / 100}) ${g}%, `);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
le.value.style.backgroundImage = e;
|
|
1413
|
+
let i = (t = u.value) == null ? void 0 : t.querySelector("#ck-cp-target-background");
|
|
1414
|
+
i && (i.style.backgroundImage = l, F.value && p(i.style.backgroundImage));
|
|
1415
|
+
} else {
|
|
1416
|
+
const { r: e, g: l, b: i, a: s } = a.value[0];
|
|
1417
|
+
let d = "";
|
|
1418
|
+
switch (r.type) {
|
|
1419
|
+
case "HEX8":
|
|
1420
|
+
d = kt(e, l, i, s / 100);
|
|
1421
|
+
break;
|
|
1422
|
+
case "RGBA":
|
|
1423
|
+
d = `rgba(${e},${l},${i},${s / 100})`;
|
|
1424
|
+
break;
|
|
1425
|
+
case "RGB":
|
|
1426
|
+
d = `rgb(${e},${l},${i})`;
|
|
1427
|
+
break;
|
|
1428
|
+
case "HEX":
|
|
1429
|
+
d = lt(e, l, i);
|
|
1430
|
+
break;
|
|
1431
|
+
}
|
|
1432
|
+
p(d);
|
|
1433
|
+
}
|
|
1434
|
+
}, Te = () => {
|
|
1435
|
+
a.value.forEach((t) => {
|
|
1436
|
+
t.hue = Qe(t.r, t.g, t.b);
|
|
1437
|
+
});
|
|
1438
|
+
}, qe = (t) => {
|
|
1439
|
+
L.value = t, q();
|
|
1440
|
+
}, Ge = () => {
|
|
1441
|
+
var t, e;
|
|
1442
|
+
if (a.value.length > 2) {
|
|
1443
|
+
const l = a.value.findIndex((i) => i.select == !0);
|
|
1444
|
+
if (l !== -1) {
|
|
1445
|
+
const i = a.value[l].id;
|
|
1446
|
+
a.value.splice(l, 1);
|
|
1447
|
+
const s = (t = u.value) == null ? void 0 : t.querySelector(`#clr-gb-${i}`);
|
|
1448
|
+
s == null || s.remove();
|
|
1449
|
+
const d = a.value[0];
|
|
1450
|
+
d && (d.select = !0, _ = (e = u.value) == null ? void 0 : e.querySelector(`#clr-gb-${d.id}`), _ == null || _.classList.add("select"), ce(d.r, d.g, d.b, d.hue, !1), G(), q());
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
}, Ye = () => {
|
|
1454
|
+
var l;
|
|
1455
|
+
const t = (l = u.value) == null ? void 0 : l.querySelector("#cp-btn-eyedropper");
|
|
1456
|
+
t == null || t.classList.add("active"), new EyeDropper().open().then((i) => {
|
|
1457
|
+
const { sRGBHex: s } = i, d = a.value.find((I) => I.select == !0), k = je(s);
|
|
1458
|
+
if (k) {
|
|
1459
|
+
const I = Qe(k.r, k.g, k.b);
|
|
1460
|
+
if (d && (d.hue = I, d.r = k.r, d.g = k.g, d.b = k.b), be(k)) {
|
|
1461
|
+
const $ = me();
|
|
1462
|
+
$ && (R.value.style.left = `${$.x}px`, R.value.style.top = `${$.y}px`);
|
|
1463
|
+
} else {
|
|
1464
|
+
ne.value = I;
|
|
1465
|
+
const { rgb: $ } = tt(I, 100, 50);
|
|
1466
|
+
Oe($);
|
|
1467
|
+
const g = me();
|
|
1468
|
+
g && (R.value.style.left = `${g.x}px`, R.value.style.top = `${g.y}px`);
|
|
1469
|
+
}
|
|
1470
|
+
G(), K(), q(), t == null || t.classList.remove("active");
|
|
1471
|
+
}
|
|
1472
|
+
}).catch(() => {
|
|
1473
|
+
t == null || t.classList.remove("active");
|
|
1474
|
+
});
|
|
1475
|
+
}, c = (t) => {
|
|
1476
|
+
const { value: e, type: l } = t;
|
|
1477
|
+
if (l != "a") {
|
|
1478
|
+
const i = a.value.find((s) => s.select == !0);
|
|
1479
|
+
if (i) {
|
|
1480
|
+
i.r = parseInt(e.r), i.g = parseInt(e.g), i.b = parseInt(e.b);
|
|
1481
|
+
const s = Qe(i.r, i.g, i.b);
|
|
1482
|
+
i.hue = s, ce(i.r, i.g, i.b, i.hue, !0), q(), K();
|
|
1483
|
+
}
|
|
1484
|
+
} else
|
|
1485
|
+
oe.value = e, q(), K();
|
|
1486
|
+
}, o = (t) => {
|
|
1487
|
+
N.h = t.h, N.s = t.s, N.l = t.l;
|
|
1488
|
+
const e = a.value.find((l) => l.select == !0);
|
|
1489
|
+
if (e && !Number.isNaN(N.h) && !Number.isNaN(N.s) && !Number.isNaN(N.l)) {
|
|
1490
|
+
const { r: l, g: i, b: s } = et(N.h, N.s / 100, N.l / 100);
|
|
1491
|
+
e.hue = N.h, e.r = l, e.g = i, e.b = s, ce(e.r, e.g, e.b, e.hue, !0), q(), K();
|
|
1492
|
+
}
|
|
1493
|
+
}, x = () => {
|
|
1494
|
+
if (j.value) {
|
|
1495
|
+
const t = je(j.value);
|
|
1496
|
+
if (t) {
|
|
1497
|
+
const e = Qe(t.r, t.g, t.b), l = a.value.find((i) => i.select == !0);
|
|
1498
|
+
l && (l.r = t.r, l.g = t.g, l.b = t.b, l.hue = e, ce(t.r, t.g, t.b, l.hue, !0), q(), K(), pe(M.value));
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
}, G = () => {
|
|
1502
|
+
const t = a.value.find((e) => e.select == !0);
|
|
1503
|
+
t && (j.value = lt(t.r, t.g, t.b).toUpperCase()), pe(M.value);
|
|
1504
|
+
}, se = (t) => {
|
|
1505
|
+
f("last-used-pick", t);
|
|
1506
|
+
};
|
|
1507
|
+
window.EyeDropper && (O.value = !0);
|
|
1508
|
+
const xe = (t = "") => {
|
|
1509
|
+
if (b.value == "gradient") {
|
|
1510
|
+
let e = t.includes("linear") ? "linear" : "radial", l = [];
|
|
1511
|
+
if (L.value = e, e == "linear") {
|
|
1512
|
+
let i = /^linear-gradient\((.*)\)$/, s = t.replace(";", "").trim().match(i), d = /,\s*(?![^()]*\))/;
|
|
1513
|
+
if (s) {
|
|
1514
|
+
let k = s[1].split(d);
|
|
1515
|
+
for (let I = 0; I < k.length; I++) {
|
|
1516
|
+
const $ = k[I];
|
|
1517
|
+
let g = {
|
|
1518
|
+
id: I,
|
|
1519
|
+
r: 0,
|
|
1520
|
+
g: 0,
|
|
1521
|
+
b: 0,
|
|
1522
|
+
a: 100,
|
|
1523
|
+
percent: 100,
|
|
1524
|
+
hue: 0,
|
|
1525
|
+
select: !1
|
|
1526
|
+
};
|
|
1527
|
+
if ($.includes("deg"))
|
|
1528
|
+
B.angle = parseInt($.replace("deg", ""));
|
|
1529
|
+
else if ($.includes("rgba")) {
|
|
1530
|
+
let S = $.trim().replace(/rgba|\(|\)|%/g, "").replace(/,/g, " ").split(" ");
|
|
1531
|
+
S = S.filter((re) => re.trim() !== ""), g.r = parseInt(S[0]), g.g = parseInt(S[1]), g.b = parseInt(S[2]), g.a = parseFloat(S[3]) * 100, g.percent = parseInt(S[4]), l.push(g);
|
|
1532
|
+
} else if ($.includes("rgb")) {
|
|
1533
|
+
let S = $.trim().replace(/rgb|\(|\)|%/g, "").replace(/,/g, " ").split(" ");
|
|
1534
|
+
S = S.filter((re) => re.trim() !== ""), g.r = parseInt(S[0]), g.g = parseInt(S[1]), g.b = parseInt(S[2]), g.percent = parseInt(S[3]), l.push(g);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
} else {
|
|
1539
|
+
let i = /^radial-gradient\((.*)\)$/, s = t.replace(";", "").trim().match(i), d = /,\s*(?![^()]*\))/;
|
|
1540
|
+
if (s) {
|
|
1541
|
+
let k = s[1].split(d);
|
|
1542
|
+
for (let I = 0; I < k.length; I++) {
|
|
1543
|
+
const $ = k[I];
|
|
1544
|
+
let g = {
|
|
1545
|
+
id: I,
|
|
1546
|
+
r: 0,
|
|
1547
|
+
g: 0,
|
|
1548
|
+
b: 0,
|
|
1549
|
+
a: 100,
|
|
1550
|
+
percent: 100,
|
|
1551
|
+
hue: 0,
|
|
1552
|
+
select: !1
|
|
1553
|
+
};
|
|
1554
|
+
if ($.includes("circle at")) {
|
|
1555
|
+
let S = $.replace("circle at ", "").replace(" ", "").replace(/%/g, " ").trim().split(" ");
|
|
1556
|
+
B.percentageX = parseInt(S[0]), B.percentageY = parseInt(S[1]);
|
|
1557
|
+
} else if ($.includes("rgba")) {
|
|
1558
|
+
let S = $.replace(/rgba|\(|\)|%/g, "").replace(/,/g, " ").split(" ");
|
|
1559
|
+
S = S.filter((re) => re.trim() !== ""), g.r = parseInt(S[0]), g.g = parseInt(S[1]), g.b = parseInt(S[2]), g.a = parseFloat(S[3]) * 100, g.percent = parseInt(S[4]), l.push(g);
|
|
1560
|
+
} else if ($.includes("rgb")) {
|
|
1561
|
+
let S = $.replace(/rgb|\(|\)|%/g, "").replace(/,/g, " ").split(" ");
|
|
1562
|
+
S = S.filter((re) => re.trim() !== ""), g.r = parseInt(S[0]), g.g = parseInt(S[1]), g.b = parseInt(S[2]), g.percent = parseInt(S[3]), l.push(g);
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
l.length > 1 && (a.value = l, a.value[0].select = !0, oe.value = a.value[0].a);
|
|
1568
|
+
} else if (t) {
|
|
1569
|
+
let e = {
|
|
1570
|
+
r: 0,
|
|
1571
|
+
g: 0,
|
|
1572
|
+
b: 0,
|
|
1573
|
+
a: 0
|
|
1574
|
+
};
|
|
1575
|
+
if (t.includes("#"))
|
|
1576
|
+
if (t.length >= 8)
|
|
1577
|
+
e = $t(t);
|
|
1578
|
+
else {
|
|
1579
|
+
let l = je(t);
|
|
1580
|
+
l ? (e.a = 1, e.r = l.r, e.g = l.g, e.b = l.b) : e = null;
|
|
1581
|
+
}
|
|
1582
|
+
else if (t.includes("rgb"))
|
|
1583
|
+
if (t.includes("rgba"))
|
|
1584
|
+
e = wt(t);
|
|
1585
|
+
else {
|
|
1586
|
+
let l = St(t);
|
|
1587
|
+
l ? (e.a = 1, e.r = l.r, e.g = l.g, e.b = l.b) : e = null;
|
|
1588
|
+
}
|
|
1589
|
+
e && (a.value[0].r = e.r, a.value[0].b = e.b, a.value[0].g = e.g, a.value[0].a = parseInt((e.a * 100).toFixed(0)), oe.value = a.value[0].a, a.value[0].hue = 0);
|
|
1590
|
+
}
|
|
1591
|
+
}, pe = (t) => {
|
|
1592
|
+
const e = a.value.find((l) => l.select == !0);
|
|
1593
|
+
if (e) {
|
|
1594
|
+
switch (t) {
|
|
1595
|
+
case "RGB":
|
|
1596
|
+
break;
|
|
1597
|
+
case "HSL": {
|
|
1598
|
+
const { h: l, s: i, l: s } = at(e.r, e.g, e.b);
|
|
1599
|
+
N.h = Math.round(l), N.s = Math.round(i * 100), N.l = Math.round(s * 100);
|
|
1600
|
+
break;
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
M.value = t;
|
|
1604
|
+
}
|
|
1605
|
+
}, ke = (t) => {
|
|
1606
|
+
t && xe(t), Le();
|
|
1607
|
+
};
|
|
1608
|
+
fe(
|
|
1609
|
+
() => r.modelValue,
|
|
1610
|
+
(t, e) => {
|
|
1611
|
+
t !== e && t !== C.value && (a.value.forEach((l) => {
|
|
1612
|
+
const i = P == null ? void 0 : P.querySelector(`#clr-gb-${l.id}`);
|
|
1613
|
+
i == null || i.remove();
|
|
1614
|
+
}), ke(t));
|
|
1615
|
+
}
|
|
1616
|
+
);
|
|
1617
|
+
const ut = (t) => {
|
|
1618
|
+
a.value.forEach((e) => {
|
|
1619
|
+
const l = P == null ? void 0 : P.querySelector(`#clr-gb-${e.id}`);
|
|
1620
|
+
l == null || l.remove();
|
|
1621
|
+
}), t !== "solid" ? (b.value = "gradient", setTimeout(() => {
|
|
1622
|
+
var e;
|
|
1623
|
+
P = (e = u.value) == null ? void 0 : e.querySelector(".gradient-bar"), qe(t), Le();
|
|
1624
|
+
}, 200)) : t === "solid" && (b.value = "solid", a.value = a.value.map((e) => (e.select = !1, e)), a.value[0].select = !0, setTimeout(() => {
|
|
1625
|
+
ke(r.modelValue);
|
|
1626
|
+
}, 200));
|
|
1627
|
+
};
|
|
1628
|
+
return Je(() => {
|
|
1629
|
+
var t;
|
|
1630
|
+
b.value = r.modelValue.includes("linear") || r.modelValue.includes("radial") ? "gradient" : "solid", b.value == "gradient" && (P = (t = u.value) == null ? void 0 : t.querySelector(".gradient-bar")), ke(r.modelValue), pe(M.value), mt(() => {
|
|
1631
|
+
F.value = !0;
|
|
1632
|
+
});
|
|
1633
|
+
}), (t, e) => (m(), E("div", {
|
|
1634
|
+
ref_key: "pickerTemplateRef",
|
|
1635
|
+
ref: u,
|
|
1636
|
+
class: Q(["ck-cp-container", n.disabled ? "ck-cp-disabled " : ""]),
|
|
1637
|
+
"cp-theme": n.theme
|
|
1638
|
+
}, [
|
|
1639
|
+
n.variant == "gradient" ? (m(), E("div", rl, [
|
|
1640
|
+
T(il, {
|
|
1641
|
+
class: "mr-auto",
|
|
1642
|
+
variant: n.variant,
|
|
1643
|
+
mode: b.value,
|
|
1644
|
+
"model-value": n.modelValue,
|
|
1645
|
+
iconClasses: n.iconClasses,
|
|
1646
|
+
gradientType: L.value,
|
|
1647
|
+
onOnChangeMode: ut
|
|
1648
|
+
}, null, 8, ["variant", "mode", "model-value", "iconClasses", "gradientType"])
|
|
1649
|
+
])) : D("", !0),
|
|
1650
|
+
b.value == "gradient" && n.variant == "gradient" ? (m(), E("div", ul, [
|
|
1651
|
+
T(Kt, {
|
|
1652
|
+
gradientType: L.value,
|
|
1653
|
+
onOnAddColor: Xe,
|
|
1654
|
+
onOnMouseDown: Ve,
|
|
1655
|
+
onOnDeleteColor: Ge
|
|
1656
|
+
}, null, 8, ["gradientType"]),
|
|
1657
|
+
T(ll, {
|
|
1658
|
+
percentageY: B.percentageY,
|
|
1659
|
+
"onUpdate:percentageY": e[0] || (e[0] = (l) => B.percentageY = l),
|
|
1660
|
+
angle: B.angle,
|
|
1661
|
+
"onUpdate:angle": e[1] || (e[1] = (l) => B.angle = l),
|
|
1662
|
+
percentageX: B.percentageX,
|
|
1663
|
+
"onUpdate:percentageX": e[2] || (e[2] = (l) => B.percentageX = l),
|
|
1664
|
+
inputType: M.value,
|
|
1665
|
+
mode: b.value,
|
|
1666
|
+
gradientType: L.value,
|
|
1667
|
+
onOnInput: q
|
|
1668
|
+
}, null, 8, ["percentageY", "angle", "percentageX", "inputType", "mode", "gradientType"])
|
|
1669
|
+
])) : (m(), E("div", dl, [
|
|
1670
|
+
n.presetColors ? (m(), E("div", cl, [
|
|
1671
|
+
e[10] || (e[10] = h("div", { class: "text-oc-text-400 text-sm my-3 font-medium" }, "Choose color", -1)),
|
|
1672
|
+
h("div", pl, [
|
|
1673
|
+
(m(!0), E(ge, null, Ke(n.presetColors, (l) => (m(), E("div", {
|
|
1674
|
+
key: `color-${l}`,
|
|
1675
|
+
class: "ck-cp-color-item !w-[32px] !h-[32px]",
|
|
1676
|
+
style: te(`background:${l}`),
|
|
1677
|
+
onClick: (i) => se(l)
|
|
1678
|
+
}, null, 12, gl))), 128))
|
|
1679
|
+
])
|
|
1680
|
+
])) : D("", !0)
|
|
1681
|
+
])),
|
|
1682
|
+
T(al, { onOnMouseDown: Ne }),
|
|
1683
|
+
h("div", vl, [
|
|
1684
|
+
T(_t, {
|
|
1685
|
+
class: Q(O.value ? "max-w-[90%]" : ""),
|
|
1686
|
+
modelValue: ne.value,
|
|
1687
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => ne.value = l),
|
|
1688
|
+
onOnInput: e[4] || (e[4] = (l) => Ie(!1)),
|
|
1689
|
+
onOnChange: Pe
|
|
1690
|
+
}, null, 8, ["class", "modelValue"]),
|
|
1691
|
+
O.value ? (m(), E("button", {
|
|
1692
|
+
key: 0,
|
|
1693
|
+
id: "cp-btn-eyedropper",
|
|
1694
|
+
type: "button",
|
|
1695
|
+
class: "cp-btn",
|
|
1696
|
+
style: { padding: "7px" },
|
|
1697
|
+
onClick: Ye
|
|
1698
|
+
}, e[11] || (e[11] = [
|
|
1699
|
+
h("svg", {
|
|
1700
|
+
version: "1.1",
|
|
1701
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1702
|
+
width: "32",
|
|
1703
|
+
height: "32",
|
|
1704
|
+
viewBox: "0 0 32 32"
|
|
1705
|
+
}, [
|
|
1706
|
+
h("path", { d: "M21.35 1.825l-6.344 6.35-0.588-0.588c-0.781-0.781-2.050-0.781-2.831 0s-0.781 2.050 0 2.831l10 10c0.781 0.781 2.050 0.781 2.831 0s0.781-2.050 0-2.831l-0.587-0.587 6.344-6.35c2.438-2.438 2.438-6.388 0-8.819s-6.387-2.438-8.819 0zM3.462 20.206c-0.938 0.938-1.462 2.212-1.462 3.538v2.65l-1.663 2.494c-0.531 0.794-0.425 1.85 0.25 2.525s1.731 0.781 2.525 0.25l2.494-1.663h2.65c1.325 0 2.6-0.525 3.537-1.462l7.544-7.544-2.831-2.831-7.544 7.544c-0.188 0.188-0.444 0.294-0.706 0.294h-2.256v-2.256c0-0.262 0.106-0.519 0.294-0.706l7.544-7.544-2.831-2.831-7.544 7.544z" })
|
|
1707
|
+
], -1)
|
|
1708
|
+
]))) : D("", !0)
|
|
1709
|
+
]),
|
|
1710
|
+
n.showAlpha ? (m(), X(zt, {
|
|
1711
|
+
key: 3,
|
|
1712
|
+
modelValue: oe.value,
|
|
1713
|
+
"onUpdate:modelValue": e[5] || (e[5] = (l) => oe.value = l),
|
|
1714
|
+
onOnInput: e[6] || (e[6] = (l) => De(l.target.value))
|
|
1715
|
+
}, null, 8, ["modelValue"])) : D("", !0),
|
|
1716
|
+
ft(h("div", ml, null, 512), [
|
|
1717
|
+
[ht, !1]
|
|
1718
|
+
]),
|
|
1719
|
+
h("div", fl, [
|
|
1720
|
+
T(Gt, {
|
|
1721
|
+
"model-value": M.value,
|
|
1722
|
+
"onUpdate:modelValue": pe
|
|
1723
|
+
}, null, 8, ["model-value"]),
|
|
1724
|
+
F.value && n.showInputSet ? (m(), E("div", hl, [
|
|
1725
|
+
M.value == "HEX" ? (m(), X(Pt, {
|
|
1726
|
+
key: 0,
|
|
1727
|
+
modelValue: j.value,
|
|
1728
|
+
"onUpdate:modelValue": [
|
|
1729
|
+
e[7] || (e[7] = (l) => j.value = l),
|
|
1730
|
+
x
|
|
1731
|
+
]
|
|
1732
|
+
}, null, 8, ["modelValue"])) : D("", !0),
|
|
1733
|
+
M.value == "RGB" ? (m(), X(nt, {
|
|
1734
|
+
key: 1,
|
|
1735
|
+
"rgb-value": a.value.find((l) => l.select == !0),
|
|
1736
|
+
onUpdateRgbValue: c
|
|
1737
|
+
}, null, 8, ["rgb-value"])) : D("", !0),
|
|
1738
|
+
M.value == "HSL" ? (m(), X(nt, {
|
|
1739
|
+
key: 2,
|
|
1740
|
+
"input-type": "HSL",
|
|
1741
|
+
"hsl-value": N,
|
|
1742
|
+
onUpdateHslValue: o
|
|
1743
|
+
}, null, 8, ["hsl-value"])) : D("", !0),
|
|
1744
|
+
n.showAlpha ? (m(), X(qt, {
|
|
1745
|
+
key: 3,
|
|
1746
|
+
modelValue: oe.value,
|
|
1747
|
+
"onUpdate:modelValue": [
|
|
1748
|
+
e[8] || (e[8] = (l) => oe.value = l),
|
|
1749
|
+
e[9] || (e[9] = (l) => De(l))
|
|
1750
|
+
]
|
|
1751
|
+
}, null, 8, ["modelValue"])) : D("", !0)
|
|
1752
|
+
])) : D("", !0)
|
|
1753
|
+
]),
|
|
1754
|
+
e[12] || (e[12] = h("div", { class: "text-oc-text-400 text-sm my-3 font-medium font-inter" }, "Last used", -1)),
|
|
1755
|
+
H.value.length > 0 && n.showColorList ? (m(), E("div", bl, [
|
|
1756
|
+
(m(!0), E(ge, null, Ke(Z.value, (l) => (m(), E("div", {
|
|
1757
|
+
key: `color-${l}`,
|
|
1758
|
+
class: "ck-cp-color-item !w-[32px] !h-[32px]",
|
|
1759
|
+
style: te(`background:${l}`),
|
|
1760
|
+
onClick: (i) => se(l)
|
|
1761
|
+
}, null, 12, yl))), 128))
|
|
1762
|
+
])) : D("", !0)
|
|
1763
|
+
], 10, sl));
|
|
1764
|
+
}
|
|
1765
|
+
}, kl = { class: "flex flex-col pt-10 px-7 gap-y-7 items-center" }, $l = { class: "flex flex-col gap-y-4 text-center items-center" }, wl = {
|
|
1766
|
+
key: 0,
|
|
1767
|
+
class: "text-xl font-medium"
|
|
1768
|
+
}, Sl = {
|
|
1769
|
+
key: 0,
|
|
1770
|
+
class: "text-sm text-oc-text-400"
|
|
1771
|
+
}, El = /* @__PURE__ */ bt({
|
|
1772
|
+
__name: "OcOnboardingProgressbar",
|
|
1773
|
+
props: {
|
|
1774
|
+
title: {
|
|
1775
|
+
type: String,
|
|
1776
|
+
default: ""
|
|
1777
|
+
},
|
|
1778
|
+
description: {
|
|
1779
|
+
type: String,
|
|
1780
|
+
default: ""
|
|
1781
|
+
},
|
|
1782
|
+
value: {
|
|
1783
|
+
type: [String, Number],
|
|
1784
|
+
default: "0"
|
|
1785
|
+
},
|
|
1786
|
+
chartData: {
|
|
1787
|
+
type: Array,
|
|
1788
|
+
default: () => []
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
setup(n) {
|
|
1792
|
+
const V = n, r = $e(() => ({
|
|
1793
|
+
grid: {
|
|
1794
|
+
containLabel: !1
|
|
1795
|
+
},
|
|
1796
|
+
series: [
|
|
1797
|
+
{
|
|
1798
|
+
name: "Onboarding Progressbar",
|
|
1799
|
+
type: "pie",
|
|
1800
|
+
emphasis: {
|
|
1801
|
+
disabled: !0
|
|
1802
|
+
},
|
|
1803
|
+
avoidLabelOverlap: !1,
|
|
1804
|
+
label: {
|
|
1805
|
+
color: "#000",
|
|
1806
|
+
fontWeight: "bold",
|
|
1807
|
+
fontFamily: "Inter",
|
|
1808
|
+
fontSize: "24",
|
|
1809
|
+
position: "center",
|
|
1810
|
+
formatter: () => V.value + "%"
|
|
1811
|
+
},
|
|
1812
|
+
labelLine: {
|
|
1813
|
+
show: !0
|
|
1814
|
+
},
|
|
1815
|
+
radius: ["60%", "100%"],
|
|
1816
|
+
data: V.chartData
|
|
1817
|
+
}
|
|
1818
|
+
]
|
|
1819
|
+
}));
|
|
1820
|
+
return (b, u) => (m(), E("div", kl, [
|
|
1821
|
+
T(w(Ct), {
|
|
1822
|
+
class: "w-[140px] bg-white rounded-full h-[140px]",
|
|
1823
|
+
"additional-options": r.value,
|
|
1824
|
+
"tooltip-formatter": () => null,
|
|
1825
|
+
"tooltip-value-formatter": () => null
|
|
1826
|
+
}, null, 8, ["additional-options"]),
|
|
1827
|
+
h("div", $l, [
|
|
1828
|
+
n.title ? (m(), E("span", wl, Fe(n.title), 1)) : D("", !0),
|
|
1829
|
+
ze(b.$slots, "description", {}, () => [
|
|
1830
|
+
n.description ? (m(), E("span", Sl, Fe(n.description), 1)) : D("", !0)
|
|
1831
|
+
])
|
|
1832
|
+
])
|
|
1833
|
+
]));
|
|
1834
|
+
}
|
|
1835
|
+
}), Ml = it(
|
|
16
1836
|
() => import("./OcCodeBlock-chTpuRDc.js")
|
|
17
|
-
),
|
|
18
|
-
() => import("./OcLottieAnimation-
|
|
1837
|
+
), Ul = it(
|
|
1838
|
+
() => import("./OcLottieAnimation-EBkAB8-y.js")
|
|
19
1839
|
);
|
|
20
1840
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1841
|
+
Al as BarChart,
|
|
1842
|
+
Nl as BarRaceChart,
|
|
1843
|
+
Xl as Card,
|
|
1844
|
+
Ml as CodeBlock,
|
|
1845
|
+
Vt as ColorPicker,
|
|
1846
|
+
xl as ColorPickerPopup,
|
|
1847
|
+
Ol as LineChart,
|
|
1848
|
+
Ul as LottieAnimation,
|
|
1849
|
+
El as OnboardingProgressbar,
|
|
1850
|
+
Ct as PieChart,
|
|
1851
|
+
Rl as TextEditor
|
|
32
1852
|
};
|