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