@orchidui/dashboard 1.8.1-22 → 1.8.1-23
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/index.js +232 -230
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var pt = Object.defineProperty;
|
|
2
2
|
var gt = (n, V, r) => V in n ? pt(n, V, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[V] = r;
|
|
3
3
|
var We = (n, V, r) => gt(n, typeof V != "symbol" ? V + "" : V, r);
|
|
4
|
-
import { ref as v, computed as
|
|
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
5
|
import { Q as Y, a as yt } from "./QuillEditor-BHWfmp5D.js";
|
|
6
|
-
import { BaseInput as st, Dropdown as rt, Input as
|
|
7
|
-
import { hslToRgb as et, hsl2Hex as tt, rgb2Hex as lt, rgbaToHex8 as kt, hexToRgb as je, rgbToHue as
|
|
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
8
|
import { PieChart as Ct } from "./Dashboard/Charts/PieChart/OcPieChart.js";
|
|
9
9
|
import { LineChart as Ol } from "./Dashboard/Charts/LineChart/OcLineChart.js";
|
|
10
|
-
import { BarChart as
|
|
10
|
+
import { BarChart as Al } from "./Dashboard/Charts/BarChart/OcBarChart.js";
|
|
11
11
|
import { BarRaceChart as Nl } from "./Dashboard/Charts/BarRaceChart/OcBarRaceChart.js";
|
|
12
12
|
import { _ as Xl } from "./OcCard-w0EuBfr4.js";
|
|
13
13
|
const It = { key: 1 }, Vt = {
|
|
@@ -35,7 +35,7 @@ const It = { key: 1 }, Vt = {
|
|
|
35
35
|
setup(n, { emit: V }) {
|
|
36
36
|
const r = n, b = V, u = v(!1), f = v(r.modelValue), C = (M) => {
|
|
37
37
|
M && (f.value = M, b("update:model-value", M));
|
|
38
|
-
},
|
|
38
|
+
}, p = $e(() => r.variant === "gradient" ? {
|
|
39
39
|
class: "w-[20px] h-[20px] hide-svg-icon",
|
|
40
40
|
style: {
|
|
41
41
|
background: f.value
|
|
@@ -65,7 +65,7 @@ const It = { key: 1 }, Vt = {
|
|
|
65
65
|
f.value = M, b("update:model-value", M), u.value = !1;
|
|
66
66
|
};
|
|
67
67
|
return (M, F) => (m(), X(w(st), {
|
|
68
|
-
class:
|
|
68
|
+
class: Q(n.hideInputColor ? "w-[40px]" : ""),
|
|
69
69
|
onClick: F[1] || (F[1] = () => {
|
|
70
70
|
var U;
|
|
71
71
|
return (U = a.value) == null ? void 0 : U.toggleDropdown();
|
|
@@ -99,17 +99,17 @@ const It = { key: 1 }, Vt = {
|
|
|
99
99
|
default: W(() => [
|
|
100
100
|
n.hideInputColor ? (m(), E("div", It, [
|
|
101
101
|
ze(M.$slots, "picker-icon", {}, () => [
|
|
102
|
-
T(w(
|
|
102
|
+
T(w(A), {
|
|
103
103
|
class: "cursor-pointer",
|
|
104
104
|
style: te(`color: ${f.value}`),
|
|
105
105
|
name: "drop"
|
|
106
106
|
}, null, 8, ["style"])
|
|
107
107
|
])
|
|
108
|
-
])) : (m(), X(w(
|
|
108
|
+
])) : (m(), X(w(we), {
|
|
109
109
|
key: 0,
|
|
110
110
|
"model-value": f.value,
|
|
111
111
|
icon: "drop",
|
|
112
|
-
"icon-props":
|
|
112
|
+
"icon-props": p.value,
|
|
113
113
|
placeholder: "#FFFFFF",
|
|
114
114
|
"onUpdate:modelValue": C
|
|
115
115
|
}, vt({ _: 2 }, [
|
|
@@ -128,7 +128,7 @@ const It = { key: 1 }, Vt = {
|
|
|
128
128
|
_: 3
|
|
129
129
|
}, 8, ["class"]));
|
|
130
130
|
}
|
|
131
|
-
}, 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" },
|
|
131
|
+
}, 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 = {
|
|
132
132
|
key: 5,
|
|
133
133
|
class: "flex gap-x-3 items-center px-5"
|
|
134
134
|
}, Ft = { class: "flex" }, Nt = { class: "mt-1 mx-2 cursor-pointer" }, Rl = {
|
|
@@ -197,10 +197,10 @@ const It = { key: 1 }, Vt = {
|
|
|
197
197
|
"alignment"
|
|
198
198
|
],
|
|
199
199
|
"text-only": ["changes", "font-size", "font-style", "link", "quote", "list", "alignment"]
|
|
200
|
-
}, f =
|
|
201
|
-
C.whitelist = r.fontSizes.map((
|
|
202
|
-
const
|
|
203
|
-
Y.register(
|
|
200
|
+
}, f = $e(() => u[r.variant]), C = Y.import("attributors/style/size");
|
|
201
|
+
C.whitelist = r.fontSizes.map((c) => c.value), Y.register(C, !0);
|
|
202
|
+
const p = Y.import("attributors/style/align");
|
|
203
|
+
Y.register(p, !0);
|
|
204
204
|
const a = Y.import("attributors/style/background");
|
|
205
205
|
Y.register(a, !0);
|
|
206
206
|
const H = Y.import("attributors/style/color");
|
|
@@ -215,112 +215,114 @@ const It = { key: 1 }, Vt = {
|
|
|
215
215
|
We(B, "blotName", "divider"), We(B, "tagName", "hr"), Y.register(B);
|
|
216
216
|
const j = v(
|
|
217
217
|
Math.random().toString(36).replace(/[^a-zA-Z]+/g, "")
|
|
218
|
-
), 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(""),
|
|
219
|
-
M.value =
|
|
218
|
+
), 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) => {
|
|
219
|
+
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;
|
|
220
220
|
let o = document.createElement("div");
|
|
221
|
-
o.innerHTML =
|
|
221
|
+
o.innerHTML = c, Se.value && (o.innerText ? b("update:modelValue", c || "") : b("update:modelValue", ""), o.remove());
|
|
222
222
|
}, Ne = () => {
|
|
223
|
-
if (
|
|
224
|
-
const o =
|
|
225
|
-
|
|
226
|
-
`, Y.sources.USER),
|
|
223
|
+
if (y.value.getQuill().getSelection(!0)) {
|
|
224
|
+
const o = y.value.getQuill().getSelection(!0);
|
|
225
|
+
y.value.getQuill().insertText(o.index, `
|
|
226
|
+
`, 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);
|
|
227
227
|
}
|
|
228
228
|
}, Ee = () => {
|
|
229
|
-
|
|
229
|
+
y.value.getQuill().history.undo(), ie(r.modelValue);
|
|
230
230
|
}, Me = () => {
|
|
231
|
-
|
|
231
|
+
y.value.getQuill().history.redo(), ie(r.modelValue);
|
|
232
232
|
}, Ce = () => {
|
|
233
|
-
var
|
|
234
|
-
|
|
233
|
+
var c;
|
|
234
|
+
y.value.getQuill().format("bold", !U.value), (c = y.value.getQuill().getSelection()) != null && c.length || (U.value = !U.value);
|
|
235
235
|
}, ne = () => {
|
|
236
|
-
var
|
|
237
|
-
|
|
236
|
+
var c;
|
|
237
|
+
y.value.getQuill().format("italic", !le.value), (c = y.value.getQuill().getSelection()) != null && c.length || (le.value = !le.value);
|
|
238
238
|
}, Ie = () => {
|
|
239
|
-
var
|
|
240
|
-
|
|
241
|
-
}, Ue = (
|
|
242
|
-
|
|
239
|
+
var c;
|
|
240
|
+
y.value.getQuill().format("underline", !J.value), (c = y.value.getQuill().getSelection()) != null && c.length || (J.value = !J.value);
|
|
241
|
+
}, Ue = (c) => {
|
|
242
|
+
y.value.getQuill().format("size", c), N.value = c, z.value = !1;
|
|
243
243
|
}, me = () => {
|
|
244
|
-
const
|
|
245
|
-
|
|
244
|
+
const c = y.value.getQuill().getSelection();
|
|
245
|
+
c && c.length > 0 && y.value.getQuill().theme.tooltip.edit();
|
|
246
246
|
}, Pe = () => {
|
|
247
|
-
|
|
248
|
-
}, oe = (
|
|
249
|
-
const o =
|
|
250
|
-
o && (
|
|
247
|
+
y.value.getQuill().format("blockquote", !R.value);
|
|
248
|
+
}, oe = (c) => {
|
|
249
|
+
const o = y.value.getQuill().getSelection();
|
|
250
|
+
o && (y.value.getQuill().clipboard.dangerouslyPasteHTML(o.index, `<img src="${c}" />`), ue.value = c, b("update:image", ue.value));
|
|
251
251
|
}, De = () => {
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
const o =
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
}, He = (
|
|
252
|
+
y.value.getQuill().getSelection() || y.value.getQuill().setSelection(y.value.getQuill().getLength() - 1);
|
|
253
|
+
const c = document.createElement("input");
|
|
254
|
+
c.type = "file", c.accept = "jpg,.jpeg,.png,.webp,.gif", c.onchange = () => {
|
|
255
|
+
const o = c.files[0], x = new FileReader();
|
|
256
|
+
x.onload = () => oe(x.result), x.readAsDataURL(o);
|
|
257
|
+
}, c.click();
|
|
258
|
+
}, He = (c) => /^data:image\/(png|jpg|jpeg|gif);base64,/.test(c), P = (c) => {
|
|
259
259
|
setTimeout(() => {
|
|
260
|
-
var
|
|
261
|
-
if (
|
|
262
|
-
const G =
|
|
260
|
+
var x;
|
|
261
|
+
if (c) {
|
|
262
|
+
const G = y.value.getHTML(), se = document.createElement("div");
|
|
263
263
|
se.innerHTML = G;
|
|
264
|
-
let
|
|
265
|
-
if (
|
|
266
|
-
for (let pe = 0; pe <
|
|
267
|
-
const
|
|
268
|
-
He(
|
|
264
|
+
let xe = se.getElementsByTagName("img");
|
|
265
|
+
if (xe && xe.length > 0)
|
|
266
|
+
for (let pe = 0; pe < xe.length; pe++) {
|
|
267
|
+
const ke = (x = xe[pe]) == null ? void 0 : x.getAttribute("src");
|
|
268
|
+
He(ke) && b("update:image", ke);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
}, 100);
|
|
272
|
-
const { items: o } =
|
|
273
|
-
o.length && o[0].getAsString((
|
|
274
|
-
He(
|
|
272
|
+
const { items: o } = c.clipboardData;
|
|
273
|
+
o.length && o[0].getAsString((x) => {
|
|
274
|
+
He(x) && (y.value.getQuill().getSelection() || y.value.getQuill().setSelection(y.value.getQuill().getLength() - 1));
|
|
275
275
|
});
|
|
276
276
|
}, _ = () => {
|
|
277
|
-
|
|
278
|
-
}, Ve = (
|
|
279
|
-
|
|
280
|
-
},
|
|
281
|
-
|
|
277
|
+
y.value.getQuill().theme.tooltip.edit("video");
|
|
278
|
+
}, Ve = (c) => {
|
|
279
|
+
y.value.getQuill().format("list", c), ae.value = c;
|
|
280
|
+
}, he = (c = void 0) => {
|
|
281
|
+
y.value.getQuill().format("align", c), ee.value = c;
|
|
282
282
|
}, de = v(""), Xe = () => {
|
|
283
|
-
|
|
283
|
+
y.value.getQuill().format("color", de.value);
|
|
284
284
|
};
|
|
285
285
|
Je(() => {
|
|
286
286
|
Ue(r.initialFontSize || r.fontSizes[0].value), Se.value = !0;
|
|
287
287
|
});
|
|
288
|
-
const
|
|
289
|
-
var
|
|
290
|
-
|
|
291
|
-
const o = (
|
|
292
|
-
o && o.nodeName !== "#text" && (
|
|
293
|
-
},
|
|
294
|
-
var
|
|
295
|
-
const o = (
|
|
288
|
+
const be = v(100), ce = v(!1), Le = (c) => {
|
|
289
|
+
var x, G;
|
|
290
|
+
be.value = c;
|
|
291
|
+
const o = (x = window.getSelection()) == null ? void 0 : x.focusNode;
|
|
292
|
+
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;"));
|
|
293
|
+
}, ye = (c = "left") => {
|
|
294
|
+
var x, G;
|
|
295
|
+
const o = (x = window.getSelection()) == null ? void 0 : x.focusNode;
|
|
296
296
|
if (o && o.nodeName !== "#text") {
|
|
297
297
|
let se = "float:left";
|
|
298
|
-
|
|
298
|
+
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}`);
|
|
299
299
|
}
|
|
300
300
|
}, Oe = () => {
|
|
301
301
|
var o;
|
|
302
|
-
const
|
|
303
|
-
ce.value =
|
|
304
|
-
}, K = v(!1), q = v(3), Te = v(3), qe =
|
|
305
|
-
let
|
|
302
|
+
const c = (o = window.getSelection()) == null ? void 0 : o.focusNode;
|
|
303
|
+
ce.value = c.innerHTML && c.innerHTML.includes("<img");
|
|
304
|
+
}, K = v(!1), q = v(3), Te = v(3), qe = $e(() => {
|
|
305
|
+
let c = [];
|
|
306
306
|
for (let o = 1; o < 30; o++)
|
|
307
|
-
|
|
307
|
+
c.push({
|
|
308
308
|
label: o.toString(),
|
|
309
309
|
value: o.toString()
|
|
310
310
|
});
|
|
311
|
-
return
|
|
312
|
-
}), Ge =
|
|
313
|
-
let
|
|
311
|
+
return c;
|
|
312
|
+
}), Ge = $e(() => {
|
|
313
|
+
let c = [];
|
|
314
314
|
for (let o = 1; o < 12; o++)
|
|
315
|
-
|
|
315
|
+
c.push({
|
|
316
316
|
label: o.toString(),
|
|
317
317
|
value: o.toString()
|
|
318
318
|
});
|
|
319
|
-
return
|
|
319
|
+
return c;
|
|
320
320
|
}), Ye = () => {
|
|
321
|
-
|
|
321
|
+
y.value.getQuill().getModule("better-table").insertTable(parseInt(q.value), parseInt(Te.value)), K.value = !1;
|
|
322
322
|
};
|
|
323
|
-
return (
|
|
323
|
+
return fe(() => r.modelValue, (c) => {
|
|
324
|
+
c || y.value.getQuill().setContents([]);
|
|
325
|
+
}), (c, o) => (m(), X(w(st), {
|
|
324
326
|
label: n.label,
|
|
325
327
|
hint: n.hint,
|
|
326
328
|
"error-message": n.errorMessage,
|
|
@@ -333,7 +335,7 @@ const It = { key: 1 }, Vt = {
|
|
|
333
335
|
T(w(xt), {
|
|
334
336
|
title: "Insert table",
|
|
335
337
|
modelValue: K.value,
|
|
336
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
338
|
+
"onUpdate:modelValue": o[2] || (o[2] = (x) => K.value = x),
|
|
337
339
|
class: "!w-full !h-full",
|
|
338
340
|
confirmButtonProps: {
|
|
339
341
|
label: "Save",
|
|
@@ -343,14 +345,14 @@ const It = { key: 1 }, Vt = {
|
|
|
343
345
|
default: W(() => [
|
|
344
346
|
T(w(Ze), {
|
|
345
347
|
modelValue: Te.value,
|
|
346
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
348
|
+
"onUpdate:modelValue": o[0] || (o[0] = (x) => Te.value = x),
|
|
347
349
|
options: Ge.value,
|
|
348
350
|
label: "Table cell",
|
|
349
351
|
class: "mb-3"
|
|
350
352
|
}, null, 8, ["modelValue", "options"]),
|
|
351
353
|
T(w(Ze), {
|
|
352
354
|
modelValue: q.value,
|
|
353
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
355
|
+
"onUpdate:modelValue": o[1] || (o[1] = (x) => q.value = x),
|
|
354
356
|
options: qe.value,
|
|
355
357
|
label: "Table rows"
|
|
356
358
|
}, null, 8, ["modelValue", "options"])
|
|
@@ -358,14 +360,14 @@ const It = { key: 1 }, Vt = {
|
|
|
358
360
|
_: 1
|
|
359
361
|
}, 8, ["modelValue", "confirmButtonProps"]),
|
|
360
362
|
h("div", {
|
|
361
|
-
class:
|
|
363
|
+
class: Q(["grid", { "has-error": n.errorMessage }]),
|
|
362
364
|
onClick: Oe
|
|
363
365
|
}, [
|
|
364
366
|
j.value ? (m(), X(w(yt), {
|
|
365
367
|
key: 0,
|
|
366
368
|
id: `#${j.value}`,
|
|
367
369
|
ref_key: "quill",
|
|
368
|
-
ref:
|
|
370
|
+
ref: y,
|
|
369
371
|
content: n.modelValue,
|
|
370
372
|
options: {
|
|
371
373
|
bounds: `#${j.value}`
|
|
@@ -384,15 +386,15 @@ const It = { key: 1 }, Vt = {
|
|
|
384
386
|
}, [
|
|
385
387
|
f.value.includes("changes") ? (m(), E(ge, { key: 0 }, [
|
|
386
388
|
h("div", Tt, [
|
|
387
|
-
T(w(
|
|
388
|
-
class:
|
|
389
|
+
T(w(A), {
|
|
390
|
+
class: Q(M.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
389
391
|
width: "20",
|
|
390
392
|
height: "20",
|
|
391
393
|
name: "text-editor/undo",
|
|
392
394
|
onClick: Ee
|
|
393
395
|
}, null, 8, ["class"]),
|
|
394
|
-
T(w(
|
|
395
|
-
class:
|
|
396
|
+
T(w(A), {
|
|
397
|
+
class: Q(F.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
396
398
|
width: "20",
|
|
397
399
|
height: "20",
|
|
398
400
|
name: "text-editor/redo",
|
|
@@ -404,28 +406,28 @@ const It = { key: 1 }, Vt = {
|
|
|
404
406
|
f.value.includes("font-size") ? (m(), E(ge, { key: 1 }, [
|
|
405
407
|
T(w(rt), {
|
|
406
408
|
modelValue: z.value,
|
|
407
|
-
"onUpdate:modelValue": o[3] || (o[3] = (
|
|
409
|
+
"onUpdate:modelValue": o[3] || (o[3] = (x) => z.value = x),
|
|
408
410
|
class: "px-5"
|
|
409
411
|
}, {
|
|
410
412
|
menu: W(() => [
|
|
411
413
|
h("div", Rt, [
|
|
412
|
-
(m(!0), E(ge, null, Ke(n.fontSizes, (
|
|
413
|
-
key:
|
|
414
|
-
class:
|
|
415
|
-
onClick: (G) => Ue(
|
|
416
|
-
}, Fe(
|
|
414
|
+
(m(!0), E(ge, null, Ke(n.fontSizes, (x) => (m(), E("div", {
|
|
415
|
+
key: x.value,
|
|
416
|
+
class: Q(["min-w-[120px] cursor-pointer py-2 px-3 hover:bg-oc-gray-50", N.value === x.value ? "font-medium" : ""]),
|
|
417
|
+
onClick: (G) => Ue(x.value)
|
|
418
|
+
}, Fe(x.label), 11, Et))), 128))
|
|
417
419
|
])
|
|
418
420
|
]),
|
|
419
421
|
default: W(() => {
|
|
420
|
-
var
|
|
422
|
+
var x;
|
|
421
423
|
return [
|
|
422
424
|
h("div", Bt, [
|
|
423
|
-
ve(Fe((
|
|
424
|
-
T(w(
|
|
425
|
+
ve(Fe((x = n.fontSizes.find((G) => G.value === N.value)) == null ? void 0 : x.label) + " ", 1),
|
|
426
|
+
T(w(A), {
|
|
425
427
|
width: "20",
|
|
426
428
|
height: "20",
|
|
427
429
|
name: "chevron-down",
|
|
428
|
-
class:
|
|
430
|
+
class: Q(["transition-all", z.value ? "rotate-180" : ""])
|
|
429
431
|
}, null, 8, ["class"])
|
|
430
432
|
])
|
|
431
433
|
];
|
|
@@ -436,22 +438,22 @@ const It = { key: 1 }, Vt = {
|
|
|
436
438
|
], 64)) : D("", !0),
|
|
437
439
|
f.value.includes("font-style") ? (m(), E(ge, { key: 2 }, [
|
|
438
440
|
h("div", Mt, [
|
|
439
|
-
T(w(
|
|
440
|
-
class:
|
|
441
|
+
T(w(A), {
|
|
442
|
+
class: Q(["cursor-pointer", U.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
441
443
|
width: "20",
|
|
442
444
|
height: "20",
|
|
443
445
|
name: "text-editor/bold",
|
|
444
446
|
onClick: Ce
|
|
445
447
|
}, null, 8, ["class"]),
|
|
446
|
-
T(w(
|
|
447
|
-
class:
|
|
448
|
+
T(w(A), {
|
|
449
|
+
class: Q(["cursor-pointer", le.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
448
450
|
width: "20",
|
|
449
451
|
height: "20",
|
|
450
452
|
name: "text-editor/italic",
|
|
451
453
|
onClick: ne
|
|
452
454
|
}, null, 8, ["class"]),
|
|
453
|
-
T(w(
|
|
454
|
-
class:
|
|
455
|
+
T(w(A), {
|
|
456
|
+
class: Q(["cursor-pointer", J.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
455
457
|
width: "20",
|
|
456
458
|
height: "20",
|
|
457
459
|
name: "text-editor/underline",
|
|
@@ -461,7 +463,7 @@ const It = { key: 1 }, Vt = {
|
|
|
461
463
|
o[18] || (o[18] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
462
464
|
], 64)) : D("", !0),
|
|
463
465
|
h("div", Ut, [
|
|
464
|
-
f.value.includes("link") ? (m(), X(w(
|
|
466
|
+
f.value.includes("link") ? (m(), X(w(A), {
|
|
465
467
|
key: 0,
|
|
466
468
|
class: "cursor-pointer",
|
|
467
469
|
width: "20",
|
|
@@ -469,7 +471,7 @@ const It = { key: 1 }, Vt = {
|
|
|
469
471
|
name: "text-editor/link",
|
|
470
472
|
onClick: me
|
|
471
473
|
})) : D("", !0),
|
|
472
|
-
f.value.includes("image") ? (m(), X(w(
|
|
474
|
+
f.value.includes("image") ? (m(), X(w(A), {
|
|
473
475
|
key: 1,
|
|
474
476
|
class: "cursor-pointer",
|
|
475
477
|
width: "20",
|
|
@@ -477,15 +479,15 @@ const It = { key: 1 }, Vt = {
|
|
|
477
479
|
name: "text-editor/image",
|
|
478
480
|
onClick: De
|
|
479
481
|
})) : D("", !0),
|
|
480
|
-
f.value.includes("quote") ? (m(), X(w(
|
|
482
|
+
f.value.includes("quote") ? (m(), X(w(A), {
|
|
481
483
|
key: 2,
|
|
482
|
-
class:
|
|
484
|
+
class: Q(["cursor-pointer", R.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
483
485
|
width: "20",
|
|
484
486
|
height: "20",
|
|
485
487
|
name: "text-editor/quote",
|
|
486
488
|
onClick: Pe
|
|
487
489
|
}, null, 8, ["class"])) : D("", !0),
|
|
488
|
-
f.value.includes("media") ? (m(), X(w(
|
|
490
|
+
f.value.includes("media") ? (m(), X(w(A), {
|
|
489
491
|
key: 3,
|
|
490
492
|
class: "cursor-pointer",
|
|
491
493
|
width: "20",
|
|
@@ -493,63 +495,63 @@ const It = { key: 1 }, Vt = {
|
|
|
493
495
|
name: "text-editor/media",
|
|
494
496
|
onClick: _
|
|
495
497
|
})) : D("", !0),
|
|
496
|
-
T(w(
|
|
498
|
+
T(w(A), {
|
|
497
499
|
class: "cursor-pointer",
|
|
498
500
|
width: "20",
|
|
499
501
|
height: "20",
|
|
500
502
|
name: "table",
|
|
501
|
-
onClick: o[4] || (o[4] = (
|
|
503
|
+
onClick: o[4] || (o[4] = (x) => K.value = !K.value)
|
|
502
504
|
})
|
|
503
505
|
]),
|
|
504
506
|
f.value.includes("list") ? (m(), E(ge, { key: 3 }, [
|
|
505
507
|
o[19] || (o[19] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
506
508
|
h("div", Dt, [
|
|
507
|
-
T(w(
|
|
508
|
-
class:
|
|
509
|
+
T(w(A), {
|
|
510
|
+
class: Q(["cursor-pointer", ae.value === "bullet" ? "text-oc-text" : "text-oc-text-300"]),
|
|
509
511
|
width: "20",
|
|
510
512
|
height: "20",
|
|
511
513
|
name: "text-editor/bullet",
|
|
512
|
-
onClick: o[5] || (o[5] = (
|
|
514
|
+
onClick: o[5] || (o[5] = (x) => Ve("bullet"))
|
|
513
515
|
}, null, 8, ["class"]),
|
|
514
|
-
T(w(
|
|
515
|
-
class:
|
|
516
|
+
T(w(A), {
|
|
517
|
+
class: Q(["cursor-pointer", ae.value === "ordered" ? "text-oc-text" : "text-oc-text-300"]),
|
|
516
518
|
width: "20",
|
|
517
519
|
height: "20",
|
|
518
520
|
name: "text-editor/number",
|
|
519
|
-
onClick: o[6] || (o[6] = (
|
|
521
|
+
onClick: o[6] || (o[6] = (x) => Ve("ordered"))
|
|
520
522
|
}, null, 8, ["class"])
|
|
521
523
|
])
|
|
522
524
|
], 64)) : D("", !0),
|
|
523
525
|
f.value.includes("alignment") ? (m(), E(ge, { key: 4 }, [
|
|
524
526
|
o[20] || (o[20] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
525
527
|
h("div", Ht, [
|
|
526
|
-
T(w(
|
|
527
|
-
class:
|
|
528
|
+
T(w(A), {
|
|
529
|
+
class: Q(["cursor-pointer", ee.value ? "text-oc-text-300" : "text-oc-text"]),
|
|
528
530
|
width: "20",
|
|
529
531
|
height: "20",
|
|
530
532
|
name: "text-editor/left",
|
|
531
|
-
onClick: o[7] || (o[7] = (
|
|
533
|
+
onClick: o[7] || (o[7] = (x) => he())
|
|
532
534
|
}, null, 8, ["class"]),
|
|
533
|
-
T(w(
|
|
534
|
-
class:
|
|
535
|
+
T(w(A), {
|
|
536
|
+
class: Q(["cursor-pointer", ee.value === "center" ? "text-oc-text" : "text-oc-text-300"]),
|
|
535
537
|
width: "20",
|
|
536
538
|
height: "20",
|
|
537
539
|
name: "text-editor/center",
|
|
538
|
-
onClick: o[8] || (o[8] = (
|
|
540
|
+
onClick: o[8] || (o[8] = (x) => he("center"))
|
|
539
541
|
}, null, 8, ["class"]),
|
|
540
|
-
T(w(
|
|
541
|
-
class:
|
|
542
|
+
T(w(A), {
|
|
543
|
+
class: Q(["cursor-pointer", ee.value === "right" ? "text-oc-text" : "text-oc-text-300"]),
|
|
542
544
|
width: "20",
|
|
543
545
|
height: "20",
|
|
544
546
|
name: "text-editor/right",
|
|
545
|
-
onClick: o[9] || (o[9] = (
|
|
547
|
+
onClick: o[9] || (o[9] = (x) => he("right"))
|
|
546
548
|
}, null, 8, ["class"]),
|
|
547
|
-
T(w(
|
|
548
|
-
class:
|
|
549
|
+
T(w(A), {
|
|
550
|
+
class: Q(["cursor-pointer", ee.value === "justify" ? "text-oc-text" : "text-oc-text-300"]),
|
|
549
551
|
width: "20",
|
|
550
552
|
height: "20",
|
|
551
553
|
name: "text-editor/justify",
|
|
552
|
-
onClick: o[10] || (o[10] = (
|
|
554
|
+
onClick: o[10] || (o[10] = (x) => he("justify"))
|
|
553
555
|
}, null, 8, ["class"])
|
|
554
556
|
])
|
|
555
557
|
], 64)) : D("", !0),
|
|
@@ -558,13 +560,13 @@ const It = { key: 1 }, Vt = {
|
|
|
558
560
|
T(w(Vt), {
|
|
559
561
|
modelValue: de.value,
|
|
560
562
|
"onUpdate:modelValue": [
|
|
561
|
-
o[11] || (o[11] = (
|
|
563
|
+
o[11] || (o[11] = (x) => de.value = x),
|
|
562
564
|
Xe
|
|
563
565
|
],
|
|
564
566
|
"hide-input-color": ""
|
|
565
567
|
}, {
|
|
566
568
|
"picker-icon": W(() => [
|
|
567
|
-
h("div",
|
|
569
|
+
h("div", Qt, [
|
|
568
570
|
h("div", {
|
|
569
571
|
style: te(`color:${de.value}`)
|
|
570
572
|
}, "A", 4),
|
|
@@ -578,36 +580,36 @@ const It = { key: 1 }, Vt = {
|
|
|
578
580
|
}, 8, ["modelValue"])
|
|
579
581
|
]),
|
|
580
582
|
o[23] || (o[23] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
581
|
-
ce.value ? (m(), E("div",
|
|
582
|
-
T(w(
|
|
583
|
+
ce.value ? (m(), E("div", At, [
|
|
584
|
+
T(w(Ae), {
|
|
583
585
|
label: "Image width",
|
|
584
586
|
class: "w-[120px]",
|
|
585
|
-
"model-value":
|
|
587
|
+
"model-value": be.value,
|
|
586
588
|
"min-limit": 0,
|
|
587
589
|
"max-limit": 100,
|
|
588
590
|
"onUpdate:modelValue": Le
|
|
589
591
|
}, null, 8, ["model-value"]),
|
|
590
592
|
h("div", Ft, [
|
|
591
|
-
T(w(
|
|
593
|
+
T(w(A), {
|
|
592
594
|
class: "cursor-pointer",
|
|
593
595
|
width: "20",
|
|
594
596
|
height: "20",
|
|
595
597
|
name: "text-editor/left",
|
|
596
|
-
onClick: o[12] || (o[12] = (
|
|
598
|
+
onClick: o[12] || (o[12] = (x) => ye())
|
|
597
599
|
}),
|
|
598
|
-
T(w(
|
|
600
|
+
T(w(A), {
|
|
599
601
|
class: "cursor-pointer",
|
|
600
602
|
width: "20",
|
|
601
603
|
height: "20",
|
|
602
604
|
name: "text-editor/center",
|
|
603
|
-
onClick: o[13] || (o[13] = (
|
|
605
|
+
onClick: o[13] || (o[13] = (x) => ye("center"))
|
|
604
606
|
}),
|
|
605
|
-
T(w(
|
|
607
|
+
T(w(A), {
|
|
606
608
|
class: "cursor-pointer",
|
|
607
609
|
width: "20",
|
|
608
610
|
height: "20",
|
|
609
611
|
name: "text-editor/right",
|
|
610
|
-
onClick: o[14] || (o[14] = (
|
|
612
|
+
onClick: o[14] || (o[14] = (x) => ye("right"))
|
|
611
613
|
})
|
|
612
614
|
])
|
|
613
615
|
])) : D("", !0),
|
|
@@ -618,7 +620,7 @@ const It = { key: 1 }, Vt = {
|
|
|
618
620
|
viewBox: "0 0 15 15",
|
|
619
621
|
fill: "none",
|
|
620
622
|
xmlns: "http://www.w3.org/2000/svg",
|
|
621
|
-
onClick: o[15] || (o[15] = (
|
|
623
|
+
onClick: o[15] || (o[15] = (x) => Ne())
|
|
622
624
|
}, o[21] || (o[21] = [
|
|
623
625
|
h("path", {
|
|
624
626
|
"fill-rule": "evenodd",
|
|
@@ -648,16 +650,16 @@ const It = { key: 1 }, Vt = {
|
|
|
648
650
|
"update:modelValue": []
|
|
649
651
|
},
|
|
650
652
|
setup(n, { emit: V }) {
|
|
651
|
-
const r = n, b = V, u = v(""), f = (
|
|
652
|
-
u.value =
|
|
653
|
+
const r = n, b = V, u = v(""), f = (p) => {
|
|
654
|
+
u.value = p, u.value = `#${p.replace(/#/g, "")}`;
|
|
653
655
|
}, C = () => {
|
|
654
|
-
let
|
|
655
|
-
if (
|
|
656
|
-
if (!/^#[0-9a-fA-F]+$/.test(
|
|
656
|
+
let p = u.value;
|
|
657
|
+
if (p === r.modelValue) return;
|
|
658
|
+
if (!/^#[0-9a-fA-F]+$/.test(p)) {
|
|
657
659
|
u.value = r.modelValue;
|
|
658
660
|
return;
|
|
659
661
|
}
|
|
660
|
-
let a =
|
|
662
|
+
let a = p.replace(/#/g, "");
|
|
661
663
|
switch (a.length) {
|
|
662
664
|
case 0:
|
|
663
665
|
a = r.modelValue.replace("#", "");
|
|
@@ -678,13 +680,13 @@ const It = { key: 1 }, Vt = {
|
|
|
678
680
|
}
|
|
679
681
|
u.value = `#${a.toUpperCase()}`, b("update:modelValue", u.value);
|
|
680
682
|
};
|
|
681
|
-
return
|
|
683
|
+
return fe(
|
|
682
684
|
() => r.modelValue,
|
|
683
|
-
(
|
|
684
|
-
|
|
685
|
+
(p, a) => {
|
|
686
|
+
p !== a && (u.value = p);
|
|
685
687
|
},
|
|
686
688
|
{ immediate: !0 }
|
|
687
|
-
), (
|
|
689
|
+
), (p, a) => (m(), X(w(we), {
|
|
688
690
|
class: "w-[158px]",
|
|
689
691
|
placeholder: "#FFFFFF",
|
|
690
692
|
"model-value": u.value,
|
|
@@ -716,7 +718,7 @@ const It = { key: 1 }, Vt = {
|
|
|
716
718
|
r: 0,
|
|
717
719
|
g: 0,
|
|
718
720
|
b: 0
|
|
719
|
-
}), f = v(), C = v(),
|
|
721
|
+
}), f = v(), C = v(), p = v(), a = (O, L) => {
|
|
720
722
|
var j, M, F;
|
|
721
723
|
let B = 255;
|
|
722
724
|
if (r.inputType == "HSL" && (B = 100, O == "r" && (B = 360)), !isNaN(parseInt(L))) {
|
|
@@ -728,7 +730,7 @@ const It = { key: 1 }, Vt = {
|
|
|
728
730
|
U <= B && (u.value.g = U, r.inputType == "RGB" ? H("g") : Z()), (M = C.value) == null || M.focus();
|
|
729
731
|
} else if (O == "b") {
|
|
730
732
|
let U = parseInt(L);
|
|
731
|
-
U <= B && (u.value.b = U, r.inputType == "RGB" ? H("b") : Z()), (F =
|
|
733
|
+
U <= B && (u.value.b = U, r.inputType == "RGB" ? H("b") : Z()), (F = p.value) == null || F.focus();
|
|
732
734
|
}
|
|
733
735
|
}
|
|
734
736
|
}, H = (O) => {
|
|
@@ -747,13 +749,13 @@ const It = { key: 1 }, Vt = {
|
|
|
747
749
|
l: parseInt(u.value.b)
|
|
748
750
|
});
|
|
749
751
|
};
|
|
750
|
-
return r.inputType === "RGB" ?
|
|
752
|
+
return r.inputType === "RGB" ? fe(
|
|
751
753
|
() => r.rgbValue,
|
|
752
754
|
(O, L) => {
|
|
753
755
|
O !== L && (u.value = O);
|
|
754
756
|
},
|
|
755
757
|
{ immediate: !0, deep: !0 }
|
|
756
|
-
) :
|
|
758
|
+
) : fe(
|
|
757
759
|
() => r.hslValue,
|
|
758
760
|
(O) => {
|
|
759
761
|
u.value = {
|
|
@@ -764,23 +766,23 @@ const It = { key: 1 }, Vt = {
|
|
|
764
766
|
},
|
|
765
767
|
{ immediate: !0, deep: !0 }
|
|
766
768
|
), (O, L) => (m(), E("div", Xt, [
|
|
767
|
-
T(w(
|
|
769
|
+
T(w(we), {
|
|
768
770
|
ref_key: "rInputEl",
|
|
769
771
|
ref: f,
|
|
770
772
|
"model-value": u.value.r,
|
|
771
773
|
placeholder: "100",
|
|
772
774
|
"onUpdate:modelValue": L[0] || (L[0] = (B) => a("r", B))
|
|
773
775
|
}, null, 8, ["model-value"]),
|
|
774
|
-
T(w(
|
|
776
|
+
T(w(we), {
|
|
775
777
|
ref_key: "gInputEl",
|
|
776
778
|
ref: C,
|
|
777
779
|
"model-value": u.value.g,
|
|
778
780
|
placeholder: "100",
|
|
779
781
|
"onUpdate:modelValue": L[1] || (L[1] = (B) => a("g", B))
|
|
780
782
|
}, null, 8, ["model-value"]),
|
|
781
|
-
T(w(
|
|
783
|
+
T(w(we), {
|
|
782
784
|
ref_key: "bInputEl",
|
|
783
|
-
ref:
|
|
785
|
+
ref: p,
|
|
784
786
|
"model-value": u.value.b,
|
|
785
787
|
placeholder: "100",
|
|
786
788
|
"onUpdate:modelValue": L[2] || (L[2] = (B) => a("b", B))
|
|
@@ -798,19 +800,19 @@ const It = { key: 1 }, Vt = {
|
|
|
798
800
|
"update:modelValue": []
|
|
799
801
|
},
|
|
800
802
|
setup(n, { emit: V }) {
|
|
801
|
-
const r = n, b = V, u = v(""), f = (
|
|
802
|
-
u.value =
|
|
803
|
+
const r = n, b = V, u = v(""), f = (p) => {
|
|
804
|
+
u.value = p;
|
|
803
805
|
}, C = () => {
|
|
804
|
-
let
|
|
805
|
-
|
|
806
|
+
let p = parseInt(u.value);
|
|
807
|
+
p && p <= 100 ? b("update:modelValue", p) : u.value = r.modelValue;
|
|
806
808
|
};
|
|
807
|
-
return
|
|
809
|
+
return fe(
|
|
808
810
|
() => r.modelValue,
|
|
809
|
-
(
|
|
810
|
-
|
|
811
|
+
(p, a) => {
|
|
812
|
+
p !== a && (u.value = p);
|
|
811
813
|
},
|
|
812
814
|
{ immediate: !0 }
|
|
813
|
-
), (
|
|
815
|
+
), (p, a) => (m(), X(w(we), {
|
|
814
816
|
class: "w-[75px]",
|
|
815
817
|
placeholder: "100",
|
|
816
818
|
"model-value": u.value,
|
|
@@ -834,7 +836,7 @@ const It = { key: 1 }, Vt = {
|
|
|
834
836
|
const b = v(n.modelValue), u = V, f = (C) => {
|
|
835
837
|
b.value = C, u("update:model-value", C);
|
|
836
838
|
};
|
|
837
|
-
return (C,
|
|
839
|
+
return (C, p) => (m(), X(w(Ze), {
|
|
838
840
|
class: "!w-[80px]",
|
|
839
841
|
"model-value": b.value,
|
|
840
842
|
options: [
|
|
@@ -888,16 +890,16 @@ const It = { key: 1 }, Vt = {
|
|
|
888
890
|
setup(n, { emit: V }) {
|
|
889
891
|
const r = Re("gradientBar"), b = v(), u = V, f = (L) => {
|
|
890
892
|
L.preventDefault();
|
|
891
|
-
}, C = v("left:0"),
|
|
893
|
+
}, C = v("left:0"), p = v(!1), a = (L) => {
|
|
892
894
|
u("onMouseDown", L);
|
|
893
895
|
}, H = () => {
|
|
894
896
|
let L = b.value.querySelector(".select");
|
|
895
897
|
C.value = L == null ? void 0 : L.getAttribute("style");
|
|
896
898
|
}, Z = () => {
|
|
897
899
|
var B;
|
|
898
|
-
H(), (((B = b.value.querySelectorAll(".gradient-handle")) == null ? void 0 : B.length) ?? 2) > 2 ?
|
|
900
|
+
H(), (((B = b.value.querySelectorAll(".gradient-handle")) == null ? void 0 : B.length) ?? 2) > 2 ? p.value = !0 : p.value = !1;
|
|
899
901
|
}, O = (L) => {
|
|
900
|
-
|
|
902
|
+
p.value = !1, u("onAddColor", L);
|
|
901
903
|
};
|
|
902
904
|
return (L, B) => (m(), E("div", {
|
|
903
905
|
ref_key: "gradientSlider",
|
|
@@ -907,18 +909,18 @@ const It = { key: 1 }, Vt = {
|
|
|
907
909
|
}, [
|
|
908
910
|
h("button", {
|
|
909
911
|
type: "button",
|
|
910
|
-
class:
|
|
912
|
+
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"]),
|
|
911
913
|
style: te(C.value),
|
|
912
914
|
onClick: B[0] || (B[0] = (j) => L.$emit("onDeleteColor"))
|
|
913
915
|
}, [
|
|
914
|
-
T(w(
|
|
916
|
+
T(w(A), {
|
|
915
917
|
name: "bin",
|
|
916
918
|
width: "14",
|
|
917
919
|
height: "14"
|
|
918
920
|
})
|
|
919
921
|
], 6),
|
|
920
922
|
h("div", {
|
|
921
|
-
class:
|
|
923
|
+
class: Q(["gradient-bar", {
|
|
922
924
|
"mt-[20px]": n.gradientType === "linear",
|
|
923
925
|
"mt-[12px]": n.gradientType === "radial"
|
|
924
926
|
}]),
|
|
@@ -978,9 +980,9 @@ const It = { key: 1 }, Vt = {
|
|
|
978
980
|
Je(() => {
|
|
979
981
|
r.value = !0, b.value = !0;
|
|
980
982
|
});
|
|
981
|
-
const u = V, f = (C,
|
|
983
|
+
const u = V, f = (C, p) => {
|
|
982
984
|
let a = parseInt(C);
|
|
983
|
-
switch (
|
|
985
|
+
switch (p) {
|
|
984
986
|
case "angle":
|
|
985
987
|
C > 360 ? a = 360 : C < 0 && (a = 0), u("update:angle", a), u("onInput");
|
|
986
988
|
break;
|
|
@@ -992,51 +994,51 @@ const It = { key: 1 }, Vt = {
|
|
|
992
994
|
break;
|
|
993
995
|
}
|
|
994
996
|
};
|
|
995
|
-
return (C,
|
|
996
|
-
n.gradientType == "linear" && r.value ? (m(), X(w(
|
|
997
|
+
return (C, p) => (m(), E("div", el, [
|
|
998
|
+
n.gradientType == "linear" && r.value ? (m(), X(w(Ae), {
|
|
997
999
|
key: 0,
|
|
998
1000
|
label: "Angle",
|
|
999
1001
|
"model-value": n.angle,
|
|
1000
1002
|
"min-limit": 0,
|
|
1001
1003
|
"max-limit": 360,
|
|
1002
|
-
"onUpdate:modelValue":
|
|
1004
|
+
"onUpdate:modelValue": p[0] || (p[0] = (a) => f(a, "angle"))
|
|
1003
1005
|
}, {
|
|
1004
|
-
"min-limit-label": W(() =>
|
|
1006
|
+
"min-limit-label": W(() => p[3] || (p[3] = [
|
|
1005
1007
|
ve("0 ")
|
|
1006
1008
|
])),
|
|
1007
|
-
"max-limit-label": W(() =>
|
|
1009
|
+
"max-limit-label": W(() => p[4] || (p[4] = [
|
|
1008
1010
|
ve("360"),
|
|
1009
1011
|
h("span", null, "°", -1)
|
|
1010
1012
|
])),
|
|
1011
1013
|
_: 1
|
|
1012
1014
|
}, 8, ["model-value"])) : D("", !0),
|
|
1013
1015
|
n.gradientType == "radial" && b.value ? (m(), E("div", tl, [
|
|
1014
|
-
T(w(
|
|
1016
|
+
T(w(Ae), {
|
|
1015
1017
|
label: "Position X",
|
|
1016
1018
|
"model-value": n.percentageX,
|
|
1017
1019
|
"min-limit": 0,
|
|
1018
1020
|
"max-limit": 100,
|
|
1019
|
-
"onUpdate:modelValue":
|
|
1021
|
+
"onUpdate:modelValue": p[1] || (p[1] = (a) => f(a, "percentageX"))
|
|
1020
1022
|
}, {
|
|
1021
|
-
"min-limit-label": W(() =>
|
|
1023
|
+
"min-limit-label": W(() => p[5] || (p[5] = [
|
|
1022
1024
|
ve("0")
|
|
1023
1025
|
])),
|
|
1024
|
-
"max-limit-label": W(() =>
|
|
1026
|
+
"max-limit-label": W(() => p[6] || (p[6] = [
|
|
1025
1027
|
ve("100%")
|
|
1026
1028
|
])),
|
|
1027
1029
|
_: 1
|
|
1028
1030
|
}, 8, ["model-value"]),
|
|
1029
|
-
T(w(
|
|
1031
|
+
T(w(Ae), {
|
|
1030
1032
|
label: "Position Y",
|
|
1031
1033
|
"model-value": n.percentageY,
|
|
1032
1034
|
"min-limit": 0,
|
|
1033
1035
|
"max-limit": 100,
|
|
1034
|
-
"onUpdate:modelValue":
|
|
1036
|
+
"onUpdate:modelValue": p[2] || (p[2] = (a) => f(a, "percentageY"))
|
|
1035
1037
|
}, {
|
|
1036
|
-
"min-limit-label": W(() =>
|
|
1038
|
+
"min-limit-label": W(() => p[7] || (p[7] = [
|
|
1037
1039
|
ve("0")
|
|
1038
1040
|
])),
|
|
1039
|
-
"max-limit-label": W(() =>
|
|
1041
|
+
"max-limit-label": W(() => p[8] || (p[8] = [
|
|
1040
1042
|
ve("100%")
|
|
1041
1043
|
])),
|
|
1042
1044
|
_: 1
|
|
@@ -1055,7 +1057,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1055
1057
|
ref_key: "pickerWrap",
|
|
1056
1058
|
ref: r,
|
|
1057
1059
|
class: "cp-picker-wrap",
|
|
1058
|
-
onMousedown: C[0] || (C[0] = (
|
|
1060
|
+
onMousedown: C[0] || (C[0] = (p) => f.$emit("onMouseDown", p)),
|
|
1059
1061
|
onDragstart: u
|
|
1060
1062
|
}, [
|
|
1061
1063
|
h("canvas", {
|
|
@@ -1101,7 +1103,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1101
1103
|
return (V, r) => (m(), E("div", nl, [
|
|
1102
1104
|
h("button", {
|
|
1103
1105
|
type: "button",
|
|
1104
|
-
class:
|
|
1106
|
+
class: Q(n.mode == "solid" ? "active" : ""),
|
|
1105
1107
|
style: { padding: "7px" },
|
|
1106
1108
|
onClick: r[0] || (r[0] = (b) => V.$emit("onChangeMode", "solid"))
|
|
1107
1109
|
}, [
|
|
@@ -1120,7 +1122,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1120
1122
|
], 2),
|
|
1121
1123
|
h("button", {
|
|
1122
1124
|
type: "button",
|
|
1123
|
-
class:
|
|
1125
|
+
class: Q(n.gradientType == "linear" && n.mode != "solid" ? "active" : ""),
|
|
1124
1126
|
style: te(`${n.iconClasses.linear ? "" : "padding: 7px;"}`),
|
|
1125
1127
|
onClick: r[1] || (r[1] = (b) => V.$emit("onChangeMode", "linear"))
|
|
1126
1128
|
}, [
|
|
@@ -1139,7 +1141,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1139
1141
|
], 6),
|
|
1140
1142
|
h("button", {
|
|
1141
1143
|
type: "button",
|
|
1142
|
-
class:
|
|
1144
|
+
class: Q(n.gradientType == "radial" && n.mode != "solid" ? "active" : ""),
|
|
1143
1145
|
style: te(`${n.iconClasses.radial ? "" : "padding: 6px;"}`),
|
|
1144
1146
|
onClick: r[2] || (r[2] = (b) => V.$emit("onChangeMode", "radial"))
|
|
1145
1147
|
}, [
|
|
@@ -1201,13 +1203,13 @@ const It = { key: 1 }, Vt = {
|
|
|
1201
1203
|
},
|
|
1202
1204
|
emits: ["update:modelValue", "last-used-pick"],
|
|
1203
1205
|
setup(n, { emit: V }) {
|
|
1204
|
-
const r = n, b = v(r.variant == "gradient" ? "gradient" : "solid"), u = v(null), f = V, C = v(r.modelValue),
|
|
1206
|
+
const r = n, b = v(r.variant == "gradient" ? "gradient" : "solid"), u = v(null), f = V, C = v(r.modelValue), p = (t) => {
|
|
1205
1207
|
C.value = t, F.value && f("update:modelValue", t);
|
|
1206
1208
|
}, a = v([
|
|
1207
1209
|
{ id: 1, r: 68, g: 71, b: 119, a: 100, percent: 0, hue: 0, select: !0 },
|
|
1208
1210
|
{ id: 2, r: 0, g: 0, b: 255, a: 100, percent: 100, hue: 0, select: !1 }
|
|
1209
1211
|
]), H = v(r.lastUsedColors);
|
|
1210
|
-
|
|
1212
|
+
fe(
|
|
1211
1213
|
() => r.lastUsedColors,
|
|
1212
1214
|
() => {
|
|
1213
1215
|
H.value = r.lastUsedColors;
|
|
@@ -1216,7 +1218,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1216
1218
|
deep: !0
|
|
1217
1219
|
}
|
|
1218
1220
|
);
|
|
1219
|
-
const Z =
|
|
1221
|
+
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({
|
|
1220
1222
|
angle: 90,
|
|
1221
1223
|
percentageX: 50,
|
|
1222
1224
|
percentageY: 50
|
|
@@ -1226,9 +1228,9 @@ const It = { key: 1 }, Vt = {
|
|
|
1226
1228
|
l: 0
|
|
1227
1229
|
});
|
|
1228
1230
|
Be("gradientBar", le), Be("canvas", J), Be("pickerWrap", z), Be("pickerPointer", R), Be("opacitySlider", U);
|
|
1229
|
-
let ae = 0, ee = 0,
|
|
1231
|
+
let ae = 0, ee = 0, y = 0, Se = 0, ue = 0, ie = 0;
|
|
1230
1232
|
const Ne = (t) => {
|
|
1231
|
-
!z.value || !R.value || (ue = z.value.offsetHeight - R.value.offsetHeight, ie = z.value.offsetWidth - R.value.offsetWidth,
|
|
1233
|
+
!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));
|
|
1232
1234
|
}, Ee = (t) => {
|
|
1233
1235
|
t.preventDefault();
|
|
1234
1236
|
const e = z.value.getBoundingClientRect(), l = t.clientX - e.left - R.value.offsetWidth / 2, i = t.clientY - e.top - R.value.offsetHeight / 2;
|
|
@@ -1305,9 +1307,9 @@ const It = { key: 1 }, Vt = {
|
|
|
1305
1307
|
}
|
|
1306
1308
|
}
|
|
1307
1309
|
}
|
|
1308
|
-
window.addEventListener("mousemove", de), window.addEventListener("mouseup",
|
|
1310
|
+
window.addEventListener("mousemove", de), window.addEventListener("mouseup", he);
|
|
1309
1311
|
}
|
|
1310
|
-
},
|
|
1312
|
+
}, he = () => {
|
|
1311
1313
|
window.removeEventListener("mousemove", de), window.removeEventListener("mouseup", Ve);
|
|
1312
1314
|
}, de = (t) => {
|
|
1313
1315
|
var d, k;
|
|
@@ -1335,8 +1337,8 @@ const It = { key: 1 }, Vt = {
|
|
|
1335
1337
|
};
|
|
1336
1338
|
a.value[i].select = !1;
|
|
1337
1339
|
const k = (I = u.value) == null ? void 0 : I.querySelector(".gradient-handle.select");
|
|
1338
|
-
k == null || k.classList.remove("select"), a.value = [...a.value, d],
|
|
1339
|
-
},
|
|
1340
|
+
k == null || k.classList.remove("select"), a.value = [...a.value, d], ye(d), _ = ($ = u.value) == null ? void 0 : $.querySelector(`#clr-gb-${d.id}`), q();
|
|
1341
|
+
}, be = (t) => {
|
|
1340
1342
|
if (t.r == 0 && t.g == 0 && t.b == 0)
|
|
1341
1343
|
return !0;
|
|
1342
1344
|
if (t.r == 255 && t.g == 255 && t.b == 255)
|
|
@@ -1353,7 +1355,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1353
1355
|
}
|
|
1354
1356
|
}, ce = (t, e, l, i, s) => {
|
|
1355
1357
|
setTimeout(() => {
|
|
1356
|
-
if (
|
|
1358
|
+
if (be({ r: t, g: e, b: l })) {
|
|
1357
1359
|
let d = me();
|
|
1358
1360
|
d && (R.value.style.left = `${d.x}px`, R.value.style.top = `${d.y}px`);
|
|
1359
1361
|
} else {
|
|
@@ -1362,12 +1364,12 @@ const It = { key: 1 }, Vt = {
|
|
|
1362
1364
|
}
|
|
1363
1365
|
}, 0);
|
|
1364
1366
|
}, Le = () => {
|
|
1365
|
-
a.value.forEach((l) =>
|
|
1367
|
+
a.value.forEach((l) => ye(l)), Te();
|
|
1366
1368
|
const t = a.value[0];
|
|
1367
1369
|
ne.value = t.hue, Ie(!0);
|
|
1368
1370
|
let e = me();
|
|
1369
1371
|
e && (R.value.style.left = `${e.x}px`, R.value.style.top = `${e.y}px`), K(), q();
|
|
1370
|
-
},
|
|
1372
|
+
}, ye = (t) => {
|
|
1371
1373
|
if (b.value == "gradient") {
|
|
1372
1374
|
let e = document.createElement("div");
|
|
1373
1375
|
e.id = `clr-gb-${t.id}`, e.classList.add("gradient-handle"), e.style.left = He(t.percent);
|
|
@@ -1406,7 +1408,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1406
1408
|
}
|
|
1407
1409
|
le.value.style.backgroundImage = e;
|
|
1408
1410
|
let i = (t = u.value) == null ? void 0 : t.querySelector("#ck-cp-target-background");
|
|
1409
|
-
i && (i.style.backgroundImage = l, F.value &&
|
|
1411
|
+
i && (i.style.backgroundImage = l, F.value && p(i.style.backgroundImage));
|
|
1410
1412
|
} else {
|
|
1411
1413
|
const { r: e, g: l, b: i, a: s } = a.value[0];
|
|
1412
1414
|
let d = "";
|
|
@@ -1424,11 +1426,11 @@ const It = { key: 1 }, Vt = {
|
|
|
1424
1426
|
d = lt(e, l, i);
|
|
1425
1427
|
break;
|
|
1426
1428
|
}
|
|
1427
|
-
|
|
1429
|
+
p(d);
|
|
1428
1430
|
}
|
|
1429
1431
|
}, Te = () => {
|
|
1430
1432
|
a.value.forEach((t) => {
|
|
1431
|
-
t.hue =
|
|
1433
|
+
t.hue = Qe(t.r, t.g, t.b);
|
|
1432
1434
|
});
|
|
1433
1435
|
}, qe = (t) => {
|
|
1434
1436
|
L.value = t, q();
|
|
@@ -1451,8 +1453,8 @@ const It = { key: 1 }, Vt = {
|
|
|
1451
1453
|
t == null || t.classList.add("active"), new EyeDropper().open().then((i) => {
|
|
1452
1454
|
const { sRGBHex: s } = i, d = a.value.find((I) => I.select == !0), k = je(s);
|
|
1453
1455
|
if (k) {
|
|
1454
|
-
const I =
|
|
1455
|
-
if (d && (d.hue = I, d.r = k.r, d.g = k.g, d.b = k.b),
|
|
1456
|
+
const I = Qe(k.r, k.g, k.b);
|
|
1457
|
+
if (d && (d.hue = I, d.r = k.r, d.g = k.g, d.b = k.b), be(k)) {
|
|
1456
1458
|
const $ = me();
|
|
1457
1459
|
$ && (R.value.style.left = `${$.x}px`, R.value.style.top = `${$.y}px`);
|
|
1458
1460
|
} else {
|
|
@@ -1467,13 +1469,13 @@ const It = { key: 1 }, Vt = {
|
|
|
1467
1469
|
}).catch(() => {
|
|
1468
1470
|
t == null || t.classList.remove("active");
|
|
1469
1471
|
});
|
|
1470
|
-
},
|
|
1472
|
+
}, c = (t) => {
|
|
1471
1473
|
const { value: e, type: l } = t;
|
|
1472
1474
|
if (l != "a") {
|
|
1473
1475
|
const i = a.value.find((s) => s.select == !0);
|
|
1474
1476
|
if (i) {
|
|
1475
1477
|
i.r = parseInt(e.r), i.g = parseInt(e.g), i.b = parseInt(e.b);
|
|
1476
|
-
const s =
|
|
1478
|
+
const s = Qe(i.r, i.g, i.b);
|
|
1477
1479
|
i.hue = s, ce(i.r, i.g, i.b, i.hue, !0), q(), K();
|
|
1478
1480
|
}
|
|
1479
1481
|
} else
|
|
@@ -1485,11 +1487,11 @@ const It = { key: 1 }, Vt = {
|
|
|
1485
1487
|
const { r: l, g: i, b: s } = et(N.h, N.s / 100, N.l / 100);
|
|
1486
1488
|
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();
|
|
1487
1489
|
}
|
|
1488
|
-
},
|
|
1490
|
+
}, x = () => {
|
|
1489
1491
|
if (j.value) {
|
|
1490
1492
|
const t = je(j.value);
|
|
1491
1493
|
if (t) {
|
|
1492
|
-
const e =
|
|
1494
|
+
const e = Qe(t.r, t.g, t.b), l = a.value.find((i) => i.select == !0);
|
|
1493
1495
|
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));
|
|
1494
1496
|
}
|
|
1495
1497
|
}
|
|
@@ -1500,7 +1502,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1500
1502
|
f("last-used-pick", t);
|
|
1501
1503
|
};
|
|
1502
1504
|
window.EyeDropper && (O.value = !0);
|
|
1503
|
-
const
|
|
1505
|
+
const xe = (t = "") => {
|
|
1504
1506
|
if (b.value == "gradient") {
|
|
1505
1507
|
let e = t.includes("linear") ? "linear" : "radial", l = [];
|
|
1506
1508
|
if (L.value = e, e == "linear") {
|
|
@@ -1597,16 +1599,16 @@ const It = { key: 1 }, Vt = {
|
|
|
1597
1599
|
}
|
|
1598
1600
|
M.value = t;
|
|
1599
1601
|
}
|
|
1600
|
-
},
|
|
1601
|
-
t &&
|
|
1602
|
+
}, ke = (t) => {
|
|
1603
|
+
t && xe(t), Le();
|
|
1602
1604
|
};
|
|
1603
|
-
|
|
1605
|
+
fe(
|
|
1604
1606
|
() => r.modelValue,
|
|
1605
1607
|
(t, e) => {
|
|
1606
1608
|
t !== e && t !== C.value && (a.value.forEach((l) => {
|
|
1607
1609
|
const i = P == null ? void 0 : P.querySelector(`#clr-gb-${l.id}`);
|
|
1608
1610
|
i == null || i.remove();
|
|
1609
|
-
}),
|
|
1611
|
+
}), ke(t));
|
|
1610
1612
|
}
|
|
1611
1613
|
);
|
|
1612
1614
|
const ut = (t) => {
|
|
@@ -1617,18 +1619,18 @@ const It = { key: 1 }, Vt = {
|
|
|
1617
1619
|
var e;
|
|
1618
1620
|
P = (e = u.value) == null ? void 0 : e.querySelector(".gradient-bar"), qe(t), Le();
|
|
1619
1621
|
}, 200)) : t === "solid" && (b.value = "solid", a.value = a.value.map((e) => (e.select = !1, e)), a.value[0].select = !0, setTimeout(() => {
|
|
1620
|
-
|
|
1622
|
+
ke(r.modelValue);
|
|
1621
1623
|
}, 200));
|
|
1622
1624
|
};
|
|
1623
1625
|
return Je(() => {
|
|
1624
1626
|
var t;
|
|
1625
|
-
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")),
|
|
1627
|
+
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(() => {
|
|
1626
1628
|
F.value = !0;
|
|
1627
1629
|
});
|
|
1628
1630
|
}), (t, e) => (m(), E("div", {
|
|
1629
1631
|
ref_key: "pickerTemplateRef",
|
|
1630
1632
|
ref: u,
|
|
1631
|
-
class:
|
|
1633
|
+
class: Q(["ck-cp-container", n.disabled ? "ck-cp-disabled " : ""]),
|
|
1632
1634
|
"cp-theme": n.theme
|
|
1633
1635
|
}, [
|
|
1634
1636
|
n.variant == "gradient" ? (m(), E("div", rl, [
|
|
@@ -1677,7 +1679,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1677
1679
|
T(al, { onOnMouseDown: Ne }),
|
|
1678
1680
|
h("div", vl, [
|
|
1679
1681
|
T(_t, {
|
|
1680
|
-
class:
|
|
1682
|
+
class: Q(O.value ? "max-w-[90%]" : ""),
|
|
1681
1683
|
modelValue: ne.value,
|
|
1682
1684
|
"onUpdate:modelValue": e[3] || (e[3] = (l) => ne.value = l),
|
|
1683
1685
|
onOnInput: e[4] || (e[4] = (l) => Ie(!1)),
|
|
@@ -1722,13 +1724,13 @@ const It = { key: 1 }, Vt = {
|
|
|
1722
1724
|
modelValue: j.value,
|
|
1723
1725
|
"onUpdate:modelValue": [
|
|
1724
1726
|
e[7] || (e[7] = (l) => j.value = l),
|
|
1725
|
-
|
|
1727
|
+
x
|
|
1726
1728
|
]
|
|
1727
1729
|
}, null, 8, ["modelValue"])) : D("", !0),
|
|
1728
1730
|
M.value == "RGB" ? (m(), X(nt, {
|
|
1729
1731
|
key: 1,
|
|
1730
1732
|
"rgb-value": a.value.find((l) => l.select == !0),
|
|
1731
|
-
onUpdateRgbValue:
|
|
1733
|
+
onUpdateRgbValue: c
|
|
1732
1734
|
}, null, 8, ["rgb-value"])) : D("", !0),
|
|
1733
1735
|
M.value == "HSL" ? (m(), X(nt, {
|
|
1734
1736
|
key: 2,
|
|
@@ -1784,7 +1786,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1784
1786
|
}
|
|
1785
1787
|
},
|
|
1786
1788
|
setup(n) {
|
|
1787
|
-
const V = n, r =
|
|
1789
|
+
const V = n, r = $e(() => ({
|
|
1788
1790
|
grid: {
|
|
1789
1791
|
containLabel: !1
|
|
1790
1792
|
},
|
|
@@ -1833,7 +1835,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1833
1835
|
() => import("./OcLottieAnimation-EBkAB8-y.js")
|
|
1834
1836
|
);
|
|
1835
1837
|
export {
|
|
1836
|
-
|
|
1838
|
+
Al as BarChart,
|
|
1837
1839
|
Nl as BarRaceChart,
|
|
1838
1840
|
Xl as Card,
|
|
1839
1841
|
Ml as CodeBlock,
|