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