@orchidui/dashboard 1.8.1-8 → 1.8.1-81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,1843 +1,32 @@
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-BHWfmp5D.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
- import { LineChart as Ol } from "./Dashboard/Charts/LineChart/OcLineChart.js";
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
- __name: "OcColorPicker",
15
- props: {
16
- modelValue: {
17
- type: String,
18
- default: ""
19
- },
20
- variant: {
21
- type: String,
22
- default: "solid"
23
- },
24
- hideOpacity: Boolean,
25
- hideInputColor: Boolean,
26
- presetColors: {
27
- type: Array
28
- }
29
- },
30
- emits: ["update:model-value"],
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
- class: "w-[20px] h-[20px] hide-svg-icon",
36
- style: {
37
- background: f.value
38
- }
39
- } : {
40
- style: {
41
- color: f.value
42
- }
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
- };
46
- let O = localStorage.getItem("ck-cp-local-color-list");
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
- f.value,
53
- ...H.value.filter((U) => U !== f.value)
54
- ], Z();
55
- else {
56
- H.value.length >= 9 && H.value.pop();
57
- let U = f.value;
58
- H.value.unshift(U), Z();
59
- }
60
- }, B = v(!1), j = (M) => {
61
- f.value = M, b("update:model-value", M), u.value = !1;
62
- };
63
- return (M, F) => (m(), X(w(st), {
64
- class: A(n.hideInputColor ? "w-[40px]" : ""),
65
- onClick: F[1] || (F[1] = () => {
66
- var U;
67
- return (U = a.value) == null ? void 0 : U.toggleDropdown();
68
- })
69
- }, {
70
- default: W(() => [
71
- T(w(rt), {
72
- ref_key: "dropdownRef",
73
- ref: a,
74
- modelValue: u.value,
75
- "onUpdate:modelValue": [
76
- F[0] || (F[0] = (U) => u.value = U),
77
- L
78
- ],
79
- "max-menu-height": 800,
80
- placement: "auto"
81
- }, {
82
- menu: W(() => [
83
- B.value ? D("", !0) : (m(), X(w(xl), {
84
- key: 0,
85
- variant: n.variant,
86
- "show-alpha": !n.hideOpacity,
87
- type: n.hideOpacity ? "HEX" : "HEX8",
88
- "model-value": n.modelValue,
89
- "last-used-colors": H.value,
90
- "preset-colors": n.presetColors,
91
- "onUpdate:modelValue": C,
92
- onLastUsedPick: j
93
- }, null, 8, ["variant", "show-alpha", "type", "model-value", "last-used-colors", "preset-colors"]))
94
- ]),
95
- default: W(() => [
96
- n.hideInputColor ? (m(), E("div", It, [
97
- ze(M.$slots, "picker-icon", {}, () => [
98
- T(w(Q), {
99
- class: "cursor-pointer",
100
- style: te(`color: ${f.value}`),
101
- name: "drop"
102
- }, null, 8, ["style"])
103
- ])
104
- ])) : (m(), X(w($e), {
105
- key: 0,
106
- "model-value": f.value,
107
- icon: "drop",
108
- "icon-props": c.value,
109
- placeholder: "#FFFFFF",
110
- "onUpdate:modelValue": C
111
- }, vt({ _: 2 }, [
112
- M.$slots.leading ? {
113
- name: "leading",
114
- fn: W(() => [
115
- ze(M.$slots, "leading")
116
- ]),
117
- key: "0"
118
- } : void 0
119
- ]), 1032, ["model-value", "icon-props"]))
120
- ]),
121
- _: 3
122
- }, 8, ["modelValue"])
123
- ]),
124
- _: 3
125
- }, 8, ["class"]));
126
- }
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
- key: 5,
129
- class: "flex gap-x-3 items-center px-5"
130
- }, Ft = { class: "flex" }, Nt = { class: "mt-1 mx-2 cursor-pointer" }, Rl = {
131
- __name: "OcTextEditor",
132
- props: {
133
- /**
134
- * The font sizes of the editor.
135
- */
136
- fontSizes: { type: Array, required: !0 },
137
- /**
138
- * The initial font size of the editor. (if empty the first item of `fontSizes` will be used, needs to be a value of `fontSizes`)
139
- */
140
- initialFontSize: { type: String },
141
- modelValue: String,
142
- image: String,
143
- errorMessage: {
144
- type: String,
145
- default: ""
146
- },
147
- label: {
148
- type: String,
149
- default: ""
150
- },
151
- hint: {
152
- type: String,
153
- default: ""
154
- },
155
- isRequired: {
156
- type: Boolean,
157
- default: !1
158
- },
159
- labelIcon: {
160
- type: String,
161
- default: ""
162
- },
163
- tooltipText: {
164
- type: String,
165
- default: ""
166
- },
167
- tooltipOptions: {
168
- type: Object,
169
- default: () => ({})
170
- },
171
- variant: {
172
- type: String,
173
- validator: (n) => ["default", "text-only"].includes(n),
174
- default: "default"
175
- },
176
- placeholder: {
177
- type: String,
178
- default: ""
179
- }
180
- },
181
- emits: ["update:modelValue", "update:image"],
182
- setup(n, { emit: V }) {
183
- const r = n, b = V, u = {
184
- default: [
185
- "changes",
186
- "font-size",
187
- "font-style",
188
- "link",
189
- "image",
190
- "quote",
191
- "media",
192
- "list",
193
- "alignment"
194
- ],
195
- "text-only": ["changes", "font-size", "font-style", "link", "quote", "list", "alignment"]
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
- class B extends L {
210
- }
211
- We(B, "blotName", "divider"), We(B, "tagName", "hr"), Y.register(B);
212
- const j = v(
213
- Math.random().toString(36).replace(/[^a-zA-Z]+/g, "")
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
- var p;
230
- x.value.getQuill().format("bold", !U.value), (p = x.value.getQuill().getSelection()) != null && p.length || (U.value = !U.value);
231
- }, ne = () => {
232
- var p;
233
- x.value.getQuill().format("italic", !le.value), (p = x.value.getQuill().getSelection()) != null && p.length || (le.value = !le.value);
234
- }, Ie = () => {
235
- var p;
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
- const p = document.createElement("input");
250
- p.type = "file", p.accept = "jpg,.jpeg,.png,.webp,.gif", p.onchange = () => {
251
- const o = p.files[0], y = new FileReader();
252
- y.onload = () => oe(y.result), y.readAsDataURL(o);
253
- }, p.click();
254
- }, He = (p) => /^data:image\/(png|jpg|jpeg|gif);base64,/.test(p), P = (p) => {
255
- setTimeout(() => {
256
- var y;
257
- if (p) {
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
- }
266
- }
267
- }, 100);
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
- });
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
- };
281
- Je(() => {
282
- Ue(r.initialFontSize || r.fontSizes[0].value), Se.value = !0;
283
- });
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
- }
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(parseInt(q.value), parseInt(Te.value)), K.value = !1;
318
- };
319
- return (p, o) => (m(), X(w(st), {
320
- label: n.label,
321
- hint: n.hint,
322
- "error-message": n.errorMessage,
323
- "is-required": n.isRequired,
324
- "label-icon": n.labelIcon,
325
- "tooltip-text": n.tooltipText,
326
- "tooltip-options": n.tooltipOptions
327
- }, {
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: Te.value,
342
- "onUpdate:modelValue": o[0] || (o[0] = (y) => Te.value = y),
343
- options: Ge.value,
344
- label: "Table cell",
345
- class: "mb-3"
346
- }, null, 8, ["modelValue", "options"]),
347
- T(w(Ze), {
348
- modelValue: q.value,
349
- "onUpdate:modelValue": o[1] || (o[1] = (y) => q.value = y),
350
- options: qe.value,
351
- label: "Table rows"
352
- }, null, 8, ["modelValue", "options"])
353
- ]),
354
- _: 1
355
- }, 8, ["modelValue", "confirmButtonProps"]),
356
- h("div", {
357
- class: A(["grid", { "has-error": n.errorMessage }]),
358
- onClick: Oe
359
- }, [
360
- j.value ? (m(), X(w(yt), {
361
- key: 0,
362
- id: `#${j.value}`,
363
- ref_key: "quill",
364
- ref: x,
365
- content: n.modelValue,
366
- options: {
367
- bounds: `#${j.value}`
368
- },
369
- theme: "snow",
370
- "content-type": "html",
371
- class: "min-h-[200px]",
372
- placeholder: n.placeholder,
373
- "onUpdate:content": ie,
374
- onPaste: P
375
- }, {
376
- toolbar: W(() => [
377
- h("div", {
378
- id: j.value,
379
- class: "flex min-h-[36px] flex-wrap !py-2 !px-3 gap-y-2 rounded-t"
380
- }, [
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"),
385
- width: "20",
386
- height: "20",
387
- name: "text-editor/undo",
388
- onClick: Ee
389
- }, null, 8, ["class"]),
390
- T(w(Q), {
391
- class: A(F.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
392
- width: "20",
393
- height: "20",
394
- name: "text-editor/redo",
395
- onClick: Me
396
- }, null, 8, ["class"])
397
- ]),
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),
404
- class: "px-5"
405
- }, {
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))
413
- ])
414
- ]),
415
- default: W(() => {
416
- var y;
417
- return [
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), {
421
- width: "20",
422
- height: "20",
423
- name: "chevron-down",
424
- class: A(["transition-all", z.value ? "rotate-180" : ""])
425
- }, null, 8, ["class"])
426
- ])
427
- ];
428
- }),
429
- _: 1
430
- }, 8, ["modelValue"]),
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"]),
437
- width: "20",
438
- height: "20",
439
- name: "text-editor/bold",
440
- onClick: Ce
441
- }, null, 8, ["class"]),
442
- T(w(Q), {
443
- class: A(["cursor-pointer", le.value ? "text-oc-text" : "text-oc-text-300"]),
444
- width: "20",
445
- height: "20",
446
- name: "text-editor/italic",
447
- onClick: ne
448
- }, null, 8, ["class"]),
449
- T(w(Q), {
450
- class: A(["cursor-pointer", J.value ? "text-oc-text" : "text-oc-text-300"]),
451
- width: "20",
452
- height: "20",
453
- name: "text-editor/underline",
454
- onClick: Ie
455
- }, null, 8, ["class"])
456
- ]),
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), {
461
- key: 0,
462
- class: "cursor-pointer",
463
- width: "20",
464
- height: "20",
465
- name: "text-editor/link",
466
- onClick: me
467
- })) : D("", !0),
468
- f.value.includes("image") ? (m(), X(w(Q), {
469
- key: 1,
470
- class: "cursor-pointer",
471
- width: "20",
472
- height: "20",
473
- name: "text-editor/image",
474
- onClick: De
475
- })) : D("", !0),
476
- f.value.includes("quote") ? (m(), X(w(Q), {
477
- key: 2,
478
- class: A(["cursor-pointer", R.value ? "text-oc-text" : "text-oc-text-300"]),
479
- width: "20",
480
- height: "20",
481
- name: "text-editor/quote",
482
- onClick: Pe
483
- }, null, 8, ["class"])) : D("", !0),
484
- f.value.includes("media") ? (m(), X(w(Q), {
485
- key: 3,
486
- class: "cursor-pointer",
487
- width: "20",
488
- height: "20",
489
- name: "text-editor/media",
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
- })
499
- ]),
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"]),
505
- width: "20",
506
- height: "20",
507
- name: "text-editor/bullet",
508
- onClick: o[5] || (o[5] = (y) => Ve("bullet"))
509
- }, null, 8, ["class"]),
510
- T(w(Q), {
511
- class: A(["cursor-pointer", ae.value === "ordered" ? "text-oc-text" : "text-oc-text-300"]),
512
- width: "20",
513
- height: "20",
514
- name: "text-editor/number",
515
- onClick: o[6] || (o[6] = (y) => Ve("ordered"))
516
- }, null, 8, ["class"])
517
- ])
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"]),
524
- width: "20",
525
- height: "20",
526
- name: "text-editor/left",
527
- onClick: o[7] || (o[7] = (y) => fe())
528
- }, null, 8, ["class"]),
529
- T(w(Q), {
530
- class: A(["cursor-pointer", ee.value === "center" ? "text-oc-text" : "text-oc-text-300"]),
531
- width: "20",
532
- height: "20",
533
- name: "text-editor/center",
534
- onClick: o[8] || (o[8] = (y) => fe("center"))
535
- }, null, 8, ["class"]),
536
- T(w(Q), {
537
- class: A(["cursor-pointer", ee.value === "right" ? "text-oc-text" : "text-oc-text-300"]),
538
- width: "20",
539
- height: "20",
540
- name: "text-editor/right",
541
- onClick: o[9] || (o[9] = (y) => fe("right"))
542
- }, null, 8, ["class"]),
543
- T(w(Q), {
544
- class: A(["cursor-pointer", ee.value === "justify" ? "text-oc-text" : "text-oc-text-300"]),
545
- width: "20",
546
- height: "20",
547
- name: "text-editor/justify",
548
- onClick: o[10] || (o[10] = (y) => fe("justify"))
549
- }, null, 8, ["class"])
550
- ])
551
- ], 64)) : D("", !0),
552
- o[22] || (o[22] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
553
- h("div", Ot, [
554
- T(w(Vt), {
555
- modelValue: de.value,
556
- "onUpdate:modelValue": [
557
- o[11] || (o[11] = (y) => de.value = y),
558
- Xe
559
- ],
560
- "hide-input-color": ""
561
- }, {
562
- "picker-icon": W(() => [
563
- h("div", At, [
564
- h("div", {
565
- style: te(`color:${de.value}`)
566
- }, "A", 4),
567
- h("div", {
568
- class: "h-[5px] w-full rounded border",
569
- style: te(`background:${de.value}`)
570
- }, null, 4)
571
- ])
572
- ]),
573
- _: 1
574
- }, 8, ["modelValue"])
575
- ]),
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), {
579
- label: "Image width",
580
- class: "w-[120px]",
581
- "model-value": he.value,
582
- "min-limit": 0,
583
- "max-limit": 100,
584
- "onUpdate:modelValue": Le
585
- }, null, 8, ["model-value"]),
586
- h("div", Ft, [
587
- T(w(Q), {
588
- class: "cursor-pointer",
589
- width: "20",
590
- height: "20",
591
- name: "text-editor/left",
592
- onClick: o[12] || (o[12] = (y) => be())
593
- }),
594
- T(w(Q), {
595
- class: "cursor-pointer",
596
- width: "20",
597
- height: "20",
598
- name: "text-editor/center",
599
- onClick: o[13] || (o[13] = (y) => be("center"))
600
- }),
601
- T(w(Q), {
602
- class: "cursor-pointer",
603
- width: "20",
604
- height: "20",
605
- name: "text-editor/right",
606
- onClick: o[14] || (o[14] = (y) => be("right"))
607
- })
608
- ])
609
- ])) : D("", !0),
610
- h("div", Nt, [
611
- (m(), E("svg", {
612
- width: "20",
613
- height: "20",
614
- viewBox: "0 0 15 15",
615
- fill: "none",
616
- xmlns: "http://www.w3.org/2000/svg",
617
- onClick: o[15] || (o[15] = (y) => Ne())
618
- }, o[21] || (o[21] = [
619
- h("path", {
620
- "fill-rule": "evenodd",
621
- "clip-rule": "evenodd",
622
- d: "M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z",
623
- fill: "#000000"
624
- }, null, -1)
625
- ])))
626
- ])
627
- ], 8, Lt)
628
- ]),
629
- _: 1
630
- }, 8, ["id", "content", "options", "placeholder"])) : D("", !0)
631
- ], 2)
632
- ]),
633
- _: 1
634
- }, 8, ["label", "hint", "error-message", "is-required", "label-icon", "tooltip-text", "tooltip-options"]));
635
- }
636
- }, Pt = {
637
- __name: "InputHex",
638
- props: {
639
- modelValue: {
640
- type: String
641
- }
642
- },
643
- emits: {
644
- "update:modelValue": []
645
- },
646
- setup(n, { emit: V }) {
647
- const r = n, b = V, u = v(""), f = (c) => {
648
- u.value = c, u.value = `#${c.replace(/#/g, "")}`;
649
- }, C = () => {
650
- let c = u.value;
651
- if (c === r.modelValue) return;
652
- if (!/^#[0-9a-fA-F]+$/.test(c)) {
653
- u.value = r.modelValue;
654
- return;
655
- }
656
- let a = c.replace(/#/g, "");
657
- switch (a.length) {
658
- case 0:
659
- a = r.modelValue.replace("#", "");
660
- break;
661
- case 1:
662
- case 2:
663
- a = a.repeat(3);
664
- break;
665
- case 4:
666
- case 5:
667
- a = a.slice(0, 3);
668
- break;
669
- case 3:
670
- case 6:
671
- break;
672
- default:
673
- a = a.slice(0, 6);
674
- }
675
- u.value = `#${a.toUpperCase()}`, b("update:modelValue", u.value);
676
- };
677
- return we(
678
- () => r.modelValue,
679
- (c, a) => {
680
- c !== a && (u.value = c);
681
- },
682
- { immediate: !0 }
683
- ), (c, a) => (m(), X(w($e), {
684
- class: "w-[158px]",
685
- placeholder: "#FFFFFF",
686
- "model-value": u.value,
687
- "onUpdate:modelValue": f,
688
- onBlur: C,
689
- onKeyup: ot(C, ["enter"])
690
- }, null, 8, ["model-value"]));
691
- }
692
- }, Xt = { class: "grid grid-cols-3 gap-3" }, nt = {
693
- __name: "InputRgbHsl",
694
- props: {
695
- inputType: {
696
- default: "RGB",
697
- type: String
698
- },
699
- rgbValue: {
700
- type: Object
701
- },
702
- hslValue: {
703
- type: Object
704
- }
705
- },
706
- emits: {
707
- "update-rgb-value": [],
708
- "update-hsl-value": []
709
- },
710
- setup(n, { emit: V }) {
711
- const r = n, b = V, u = v({
712
- r: 0,
713
- g: 0,
714
- b: 0
715
- }), f = v(), C = v(), c = v(), a = (O, L) => {
716
- var j, M, F;
717
- let B = 255;
718
- if (r.inputType == "HSL" && (B = 100, O == "r" && (B = 360)), !isNaN(parseInt(L))) {
719
- if (O == "r") {
720
- let U = parseInt(L);
721
- U <= B && (u.value.r = U, r.inputType == "RGB" ? H("r") : Z()), (j = f.value) == null || j.focus();
722
- } else if (O == "g") {
723
- let U = parseInt(L);
724
- U <= B && (u.value.g = U, r.inputType == "RGB" ? H("g") : Z()), (M = C.value) == null || M.focus();
725
- } else if (O == "b") {
726
- let U = parseInt(L);
727
- U <= B && (u.value.b = U, r.inputType == "RGB" ? H("b") : Z()), (F = c.value) == null || F.focus();
728
- }
729
- }
730
- }, H = (O) => {
731
- b("update-rgb-value", {
732
- type: O,
733
- value: {
734
- r: parseInt(u.value.r),
735
- g: parseInt(u.value.g),
736
- b: parseInt(u.value.b)
737
- }
738
- });
739
- }, Z = () => {
740
- b("update-hsl-value", {
741
- h: parseInt(u.value.r),
742
- s: parseInt(u.value.g),
743
- l: parseInt(u.value.b)
744
- });
745
- };
746
- return r.inputType === "RGB" ? we(
747
- () => r.rgbValue,
748
- (O, L) => {
749
- O !== L && (u.value = O);
750
- },
751
- { immediate: !0, deep: !0 }
752
- ) : we(
753
- () => r.hslValue,
754
- (O) => {
755
- u.value = {
756
- r: O.h,
757
- g: O.s,
758
- b: O.l
759
- };
760
- },
761
- { immediate: !0, deep: !0 }
762
- ), (O, L) => (m(), E("div", Xt, [
763
- T(w($e), {
764
- ref_key: "rInputEl",
765
- ref: f,
766
- "model-value": u.value.r,
767
- placeholder: "100",
768
- "onUpdate:modelValue": L[0] || (L[0] = (B) => a("r", B))
769
- }, null, 8, ["model-value"]),
770
- T(w($e), {
771
- ref_key: "gInputEl",
772
- ref: C,
773
- "model-value": u.value.g,
774
- placeholder: "100",
775
- "onUpdate:modelValue": L[1] || (L[1] = (B) => a("g", B))
776
- }, null, 8, ["model-value"]),
777
- T(w($e), {
778
- ref_key: "bInputEl",
779
- ref: c,
780
- "model-value": u.value.b,
781
- placeholder: "100",
782
- "onUpdate:modelValue": L[2] || (L[2] = (B) => a("b", B))
783
- }, null, 8, ["model-value"])
784
- ]));
785
- }
786
- }, qt = {
787
- __name: "InputOpacity",
788
- props: {
789
- modelValue: {
790
- type: Number
791
- }
792
- },
793
- emits: {
794
- "update:modelValue": []
795
- },
796
- setup(n, { emit: V }) {
797
- const r = n, b = V, u = v(""), f = (c) => {
798
- u.value = c;
799
- }, C = () => {
800
- let c = parseInt(u.value);
801
- c && c <= 100 ? b("update:modelValue", c) : u.value = r.modelValue;
802
- };
803
- return we(
804
- () => r.modelValue,
805
- (c, a) => {
806
- c !== a && (u.value = c);
807
- },
808
- { immediate: !0 }
809
- ), (c, a) => (m(), X(w($e), {
810
- class: "w-[75px]",
811
- placeholder: "100",
812
- "model-value": u.value,
813
- "onUpdate:modelValue": f,
814
- onBlur: C,
815
- onKeyup: ot(C, ["enter"])
816
- }, {
817
- leading: W(() => a[0] || (a[0] = [
818
- ve("%")
819
- ])),
820
- _: 1
821
- }, 8, ["model-value"]));
822
- }
823
- }, Gt = {
824
- __name: "SelectColorFormat",
825
- props: {
826
- modelValue: { default: "RGB", type: String }
827
- },
828
- emits: ["update:model-value"],
829
- setup(n, { emit: V }) {
830
- const b = v(n.modelValue), u = V, f = (C) => {
831
- b.value = C, u("update:model-value", C);
832
- };
833
- return (C, c) => (m(), X(w(Ze), {
834
- class: "!w-[80px]",
835
- "model-value": b.value,
836
- options: [
837
- {
838
- label: "HEX",
839
- value: "HEX"
840
- },
841
- {
842
- label: "RGB",
843
- value: "RGB"
844
- },
845
- {
846
- label: "HSL",
847
- value: "HSL"
848
- }
849
- ],
850
- "onUpdate:modelValue": f
851
- }, null, 8, ["model-value"]));
852
- }
853
- }, Yt = { class: "opacity-bar" }, Wt = { class: "picker-opacity-slider opacity-bar-background" }, jt = ["value"], zt = {
854
- __name: "SliderOpacity",
855
- props: {
856
- modelValue: { default: 0, type: Number }
857
- },
858
- emits: ["update:modelValue", "onInput"],
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);
862
- };
863
- return (f, C) => (m(), E("div", Yt, [
864
- h("div", Wt, [
865
- h("input", {
866
- ref_key: "opacitySlider",
867
- ref: r,
868
- value: n.modelValue,
869
- class: "opacity__slider",
870
- type: "range",
871
- min: "0",
872
- max: "100",
873
- onInput: u
874
- }, null, 40, jt)
875
- ])
876
- ]));
877
- }
878
- }, Kt = {
879
- __name: "SliderGradient",
880
- props: {
881
- gradientType: String
882
- },
883
- emits: ["onAddColor", "onMouseDown", "onDeleteColor"],
884
- setup(n, { emit: V }) {
885
- const r = Re("gradientBar"), b = v(), u = V, f = (L) => {
886
- L.preventDefault();
887
- }, C = v("left:0"), c = v(!1), a = (L) => {
888
- u("onMouseDown", L);
889
- }, H = () => {
890
- let L = b.value.querySelector(".select");
891
- C.value = L == null ? void 0 : L.getAttribute("style");
892
- }, Z = () => {
893
- var B;
894
- H(), (((B = b.value.querySelectorAll(".gradient-handle")) == null ? void 0 : B.length) ?? 2) > 2 ? c.value = !0 : c.value = !1;
895
- }, O = (L) => {
896
- c.value = !1, u("onAddColor", L);
897
- };
898
- return (L, B) => (m(), E("div", {
899
- ref_key: "gradientSlider",
900
- ref: b,
901
- class: "relative h-[40px]",
902
- onClick: Z
903
- }, [
904
- h("button", {
905
- type: "button",
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"]),
907
- style: te(C.value),
908
- onClick: B[0] || (B[0] = (j) => L.$emit("onDeleteColor"))
909
- }, [
910
- T(w(Q), {
911
- name: "bin",
912
- width: "14",
913
- height: "14"
914
- })
915
- ], 6),
916
- h("div", {
917
- class: A(["gradient-bar", {
918
- "mt-[20px]": n.gradientType === "linear",
919
- "mt-[12px]": n.gradientType === "radial"
920
- }]),
921
- onMousedown: a,
922
- onDragstart: f
923
- }, [
924
- h("div", {
925
- ref_key: "gradientBar",
926
- ref: r,
927
- class: "gradient-container",
928
- onDblclick: O
929
- }, null, 544)
930
- ], 34)
931
- ], 512));
932
- }
933
- }, Zt = { class: "picker-hue" }, Jt = ["value"], _t = {
934
- __name: "SliderHue",
935
- props: {
936
- modelValue: { default: 0, type: Number }
937
- },
938
- emits: ["update:modelValue", "onInput", "onChange"],
939
- setup(n, { emit: V }) {
940
- const r = V, b = (u) => {
941
- r("update:modelValue", parseFloat(u.target.value)), r("onInput", u);
942
- };
943
- return (u, f) => (m(), E("div", Zt, [
944
- h("input", {
945
- value: n.modelValue,
946
- class: "picker-hue-range-slider",
947
- type: "range",
948
- min: "0",
949
- max: "360",
950
- step: "0.1",
951
- onInput: b,
952
- onChange: f[0] || (f[0] = (C) => u.$emit("onChange", C))
953
- }, null, 40, Jt)
954
- ]));
955
- }
956
- }, el = { class: "px-2 mt-2" }, tl = {
957
- key: 1,
958
- class: "grid grid-cols-2 gap-4 px-1"
959
- }, ll = {
960
- __name: "GradientSettings",
961
- props: {
962
- mode: {
963
- default: "gradient",
964
- type: String
965
- },
966
- gradientType: { default: "linear", type: String },
967
- angle: { default: 90, type: Number },
968
- percentageX: { default: 50, type: Number },
969
- percentageY: { default: 50, type: Number }
970
- },
971
- emits: ["update:angle", "update:percentageX", "update:percentageY", "onInput"],
972
- setup(n, { emit: V }) {
973
- const r = v(!1), b = v(!1);
974
- Je(() => {
975
- r.value = !0, b.value = !0;
976
- });
977
- const u = V, f = (C, c) => {
978
- let a = parseInt(C);
979
- switch (c) {
980
- case "angle":
981
- C > 360 ? a = 360 : C < 0 && (a = 0), u("update:angle", a), u("onInput");
982
- break;
983
- case "percentageX":
984
- C > 100 ? a = 100 : C < 0 && (a = 0), u("update:percentageX", a), u("onInput");
985
- break;
986
- case "percentageY":
987
- C > 100 ? a = 100 : C < 0 && (a = 0), u("update:percentageY", a), u("onInput");
988
- break;
989
- }
990
- };
991
- return (C, c) => (m(), E("div", el, [
992
- n.gradientType == "linear" && r.value ? (m(), X(w(Qe), {
993
- key: 0,
994
- label: "Angle",
995
- "model-value": n.angle,
996
- "min-limit": 0,
997
- "max-limit": 360,
998
- "onUpdate:modelValue": c[0] || (c[0] = (a) => f(a, "angle"))
999
- }, {
1000
- "min-limit-label": W(() => c[3] || (c[3] = [
1001
- ve("0 ")
1002
- ])),
1003
- "max-limit-label": W(() => c[4] || (c[4] = [
1004
- ve("360"),
1005
- h("span", null, "°", -1)
1006
- ])),
1007
- _: 1
1008
- }, 8, ["model-value"])) : D("", !0),
1009
- n.gradientType == "radial" && b.value ? (m(), E("div", tl, [
1010
- T(w(Qe), {
1011
- label: "Position X",
1012
- "model-value": n.percentageX,
1013
- "min-limit": 0,
1014
- "max-limit": 100,
1015
- "onUpdate:modelValue": c[1] || (c[1] = (a) => f(a, "percentageX"))
1016
- }, {
1017
- "min-limit-label": W(() => c[5] || (c[5] = [
1018
- ve("0")
1019
- ])),
1020
- "max-limit-label": W(() => c[6] || (c[6] = [
1021
- ve("100%")
1022
- ])),
1023
- _: 1
1024
- }, 8, ["model-value"]),
1025
- T(w(Qe), {
1026
- label: "Position Y",
1027
- "model-value": n.percentageY,
1028
- "min-limit": 0,
1029
- "max-limit": 100,
1030
- "onUpdate:modelValue": c[2] || (c[2] = (a) => f(a, "percentageY"))
1031
- }, {
1032
- "min-limit-label": W(() => c[7] || (c[7] = [
1033
- ve("0")
1034
- ])),
1035
- "max-limit-label": W(() => c[8] || (c[8] = [
1036
- ve("100%")
1037
- ])),
1038
- _: 1
1039
- }, 8, ["model-value"])
1040
- ])) : D("", !0)
1041
- ]));
1042
- }
1043
- }, al = {
1044
- __name: "PickerWrap",
1045
- emits: ["onMouseDown"],
1046
- setup(n) {
1047
- const V = Re("canvas"), r = Re("pickerWrap"), b = Re("pickerPointer"), u = (f) => {
1048
- f.preventDefault();
1049
- };
1050
- return (f, C) => (m(), E("div", {
1051
- ref_key: "pickerWrap",
1052
- ref: r,
1053
- class: "cp-picker-wrap",
1054
- onMousedown: C[0] || (C[0] = (c) => f.$emit("onMouseDown", c)),
1055
- onDragstart: u
1056
- }, [
1057
- h("canvas", {
1058
- ref_key: "canvas",
1059
- ref: V,
1060
- class: "colour-area"
1061
- }, null, 512),
1062
- C[1] || (C[1] = h("div", { class: "colour-area-mask" }, null, -1)),
1063
- h("div", {
1064
- ref_key: "pickerPointer",
1065
- ref: b,
1066
- class: "colour-area-point-circle"
1067
- }, null, 512)
1068
- ], 544));
1069
- }
1070
- }, nl = { class: "w-full flex justify-center" }, ol = {
1071
- key: 1,
1072
- width: "28",
1073
- height: "28",
1074
- viewBox: "0 0 28 28",
1075
- fill: "none",
1076
- xmlns: "http://www.w3.org/2000/svg"
1077
- }, il = {
1078
- __name: "ColorType",
1079
- props: {
1080
- variant: String,
1081
- mode: {
1082
- default: "gradient",
1083
- type: String
1084
- },
1085
- gradientType: { default: "linear", type: String },
1086
- iconClasses: {
1087
- default: () => ({
1088
- linear: "",
1089
- radial: ""
1090
- }),
1091
- type: Object
1092
- },
1093
- modelValue: String
1094
- },
1095
- emits: ["onChangeMode"],
1096
- setup(n) {
1097
- return (V, r) => (m(), E("div", nl, [
1098
- h("button", {
1099
- type: "button",
1100
- class: A(n.mode == "solid" ? "active" : ""),
1101
- style: { padding: "7px" },
1102
- onClick: r[0] || (r[0] = (b) => V.$emit("onChangeMode", "solid"))
1103
- }, [
1104
- n.modelValue && n.mode == "solid" ? (m(), E("div", {
1105
- key: 0,
1106
- class: "w-[28px] h-[28px] rounded-full border",
1107
- style: te(`background:${n.modelValue}`)
1108
- }, null, 4)) : (m(), E("svg", ol, r[3] || (r[3] = [
1109
- h("g", { opacity: "0.5" }, [
1110
- h("path", {
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",
1112
- fill: "#03102F"
1113
- })
1114
- ], -1)
1115
- ])))
1116
- ], 2),
1117
- h("button", {
1118
- type: "button",
1119
- class: A(n.gradientType == "linear" && n.mode != "solid" ? "active" : ""),
1120
- style: te(`${n.iconClasses.linear ? "" : "padding: 7px;"}`),
1121
- onClick: r[1] || (r[1] = (b) => V.$emit("onChangeMode", "linear"))
1122
- }, [
1123
- h("div", {
1124
- class: "w-[28px] h-[28px] rounded-full border",
1125
- style: te(
1126
- n.modelValue && n.gradientType == "linear" && n.mode != "solid" ? `background:${n.modelValue}` : `
1127
- background: linear-gradient(
1128
- 180deg,
1129
- #03102f 0%,
1130
- rgba(3, 16, 47, 0) 100%
1131
- );
1132
- `
1133
- )
1134
- }, null, 4)
1135
- ], 6),
1136
- h("button", {
1137
- type: "button",
1138
- class: A(n.gradientType == "radial" && n.mode != "solid" ? "active" : ""),
1139
- style: te(`${n.iconClasses.radial ? "" : "padding: 6px;"}`),
1140
- onClick: r[2] || (r[2] = (b) => V.$emit("onChangeMode", "radial"))
1141
- }, [
1142
- h("div", {
1143
- class: "w-[28px] h-[28px] rounded-full border",
1144
- style: te(
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%);"
1146
- )
1147
- }, null, 4)
1148
- ], 6)
1149
- ]));
1150
- }
1151
- }, sl = ["cp-theme"], rl = {
1152
- key: 0,
1153
- class: "flex justify-end border-b h-[46px] relative mt-[-5px] mb-5"
1154
- }, ul = {
1155
- key: 1,
1156
- class: "grid items-center mb-5"
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 = {
1158
- key: 0,
1159
- class: "w-full flex gap-3"
1160
- }, bl = {
1161
- key: 4,
1162
- class: "ck-cp-local-color-conatiner"
1163
- }, yl = ["onClick"], xl = {
1164
- __name: "OcColorPickerPopup",
1165
- props: {
1166
- modelValue: {
1167
- default: "",
1168
- type: String
1169
- },
1170
- type: { default: "HEX8", type: String },
1171
- inputType: { default: "HEX", type: String },
1172
- theme: { default: "light", type: String },
1173
- showColorList: { default: !0, type: Boolean },
1174
- showEyeDrop: { default: !0, type: Boolean },
1175
- showAlpha: { default: !0, type: Boolean },
1176
- showInputMenu: { default: !0, type: Boolean },
1177
- showInputSet: { default: !0, type: Boolean },
1178
- disabled: { default: !1, type: Boolean },
1179
- iconClasses: {
1180
- default: () => ({
1181
- linear: "",
1182
- radial: "",
1183
- ruler: "",
1184
- eyeDroper: "",
1185
- inputMenu: "",
1186
- save: "",
1187
- delete: ""
1188
- }),
1189
- type: Object
1190
- },
1191
- presetColors: Array,
1192
- variant: {
1193
- type: String,
1194
- default: "solid"
1195
- },
1196
- lastUsedColors: Array
1197
- },
1198
- emits: ["update:modelValue", "last-used-pick"],
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([
1203
- { id: 1, r: 68, g: 71, b: 119, a: 100, percent: 0, hue: 0, select: !0 },
1204
- { id: 2, r: 0, g: 0, b: 255, a: 100, percent: 100, hue: 0, select: !1 }
1205
- ]), H = v(r.lastUsedColors);
1206
- we(
1207
- () => r.lastUsedColors,
1208
- () => {
1209
- H.value = r.lastUsedColors;
1210
- },
1211
- {
1212
- deep: !0
1213
- }
1214
- );
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({
1216
- angle: 90,
1217
- percentageX: 50,
1218
- percentageY: 50
1219
- }), j = v(""), M = v(r.inputType), F = v(!1), U = v(), le = v(), J = v(), z = v(), R = v(), N = _e({
1220
- h: 0,
1221
- s: 0,
1222
- l: 0
1223
- });
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) => {
1229
- t.preventDefault();
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) => {
1235
- if (!t) {
1236
- let e = Ue();
1237
- const l = et(ne.value, e.s, e.l);
1238
- if (l) {
1239
- if (F.value) {
1240
- let i = a.value.find((s) => s.select == !0);
1241
- i && (i.r = l.r, i.g = l.g, i.b = l.b);
1242
- }
1243
- K(), q();
1244
- }
1245
- }
1246
- }, ne = v(0), Ie = async (t) => {
1247
- const { rgb: e } = tt(ne.value, 100, 50);
1248
- Oe(e), setTimeout(() => {
1249
- Ce(t), G();
1250
- }, 0);
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 = () => {
1255
- const t = a.value.find((e) => e.select == !0);
1256
- if (t) {
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))
1264
- ] : [
1265
- -k * 2 * (i - 1) * s / (i + s - i * s),
1266
- I * (i - 1) * (s - 1)
1267
- ];
1268
- return d.x = $, d.y = g, d;
1269
- } else
1270
- return null;
1271
- }, Pe = () => {
1272
- const t = a.value.find((e) => e.select == !0);
1273
- t && (t.hue = ne.value);
1274
- }, oe = v(100), De = (t) => {
1275
- if (r.showAlpha) {
1276
- const e = a.value.find((l) => l.select == !0);
1277
- e && (e.a = parseInt(t), q());
1278
- }
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`;
1283
- };
1284
- let P = null, _ = null;
1285
- const Ve = (t) => {
1286
- var i, s;
1287
- const l = t.target.offsetParent;
1288
- if ((i = l == null ? void 0 : l.id) != null && i.includes("clr-gb-")) {
1289
- const d = l.id.replace("clr-gb-", "");
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);
1296
- for (let g = 0; g < a.value.length; g++) {
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();
1300
- break;
1301
- }
1302
- }
1303
- }
1304
- window.addEventListener("mousemove", de), window.addEventListener("mouseup", fe);
1305
- }
1306
- }, fe = () => {
1307
- window.removeEventListener("mousemove", de), window.removeEventListener("mouseup", Ve);
1308
- }, de = (t) => {
1309
- var d, k;
1310
- t.preventDefault();
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);
1312
- let s = t.clientX - (l.left || 0) - ((e == null ? void 0 : e.width) || 0) / 2;
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-", ""))
1317
- );
1318
- $ && ($.percent = I), q();
1319
- }
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 = {
1323
- id: Date.now(),
1324
- r: s.r,
1325
- g: s.g,
1326
- b: s.b,
1327
- a: s.a,
1328
- percent: l,
1329
- hue: s.hue,
1330
- select: !0
1331
- };
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) => {
1336
- if (t.r == 0 && t.g == 0 && t.b == 0)
1337
- return !0;
1338
- if (t.r == 255 && t.g == 255 && t.b == 255)
1339
- return !0;
1340
- {
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; $++)
1343
- for (let g = 0; g < l; g++) {
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)
1346
- return !0;
1347
- }
1348
- return !1;
1349
- }
1350
- }, ce = (t, e, l, i, s) => {
1351
- setTimeout(() => {
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`);
1355
- } else {
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);
1358
- }
1359
- }, 0);
1360
- }, Le = () => {
1361
- a.value.forEach((l) => be(l)), Te();
1362
- const t = a.value[0];
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") {
1368
- let e = document.createElement("div");
1369
- e.id = `clr-gb-${t.id}`, e.classList.add("gradient-handle"), e.style.left = He(t.percent);
1370
- let l = document.createElement("div");
1371
- l.classList.add("gradient-handle-content"), t.select == !0 && e.classList.add("select"), e.appendChild(l), P && P.appendChild(e);
1372
- }
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);
1376
- let s = e.createLinearGradient(0, 0, l - 12, 0);
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 = () => {
1381
- if (r.showAlpha) {
1382
- let t = a.value.find((e) => e.select == !0);
1383
- t && (U.value.style.background = ` linear-gradient(90deg,rgba(255, 255, 255, 0) 0%, rgba(${t.r}, ${t.g}, ${t.b}, 100) 97%)`);
1384
- }
1385
- }, q = () => {
1386
- var t;
1387
- if (b.value == "gradient") {
1388
- a.value.sort((s, d) => s.percent - d.percent);
1389
- let e = "linear-gradient(90deg, ", l;
1390
- if (L.value == "linear") {
1391
- l = `linear-gradient(${B.angle}deg, `;
1392
- for (let s = 0; s < a.value.length; s++) {
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}%, `);
1395
- }
1396
- } else {
1397
- l = `radial-gradient(circle at ${B.percentageX}% ${B.percentageY}%, `;
1398
- for (let s = 0; s < a.value.length; s++) {
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}%, `);
1401
- }
1402
- }
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));
1406
- } else {
1407
- const { r: e, g: l, b: i, a: s } = a.value[0];
1408
- let d = "";
1409
- switch (r.type) {
1410
- case "HEX8":
1411
- d = kt(e, l, i, s / 100);
1412
- break;
1413
- case "RGBA":
1414
- d = `rgba(${e},${l},${i},${s / 100})`;
1415
- break;
1416
- case "RGB":
1417
- d = `rgb(${e},${l},${i})`;
1418
- break;
1419
- case "HEX":
1420
- d = lt(e, l, i);
1421
- break;
1422
- }
1423
- c(d);
1424
- }
1425
- }, Te = () => {
1426
- a.value.forEach((t) => {
1427
- t.hue = Ae(t.r, t.g, t.b);
1428
- });
1429
- }, qe = (t) => {
1430
- L.value = t, q();
1431
- }, Ge = () => {
1432
- var t, e;
1433
- if (a.value.length > 2) {
1434
- const l = a.value.findIndex((i) => i.select == !0);
1435
- if (l !== -1) {
1436
- const i = a.value[l].id;
1437
- a.value.splice(l, 1);
1438
- const s = (t = u.value) == null ? void 0 : t.querySelector(`#clr-gb-${i}`);
1439
- s == null || s.remove();
1440
- const d = a.value[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());
1442
- }
1443
- }
1444
- }, Ye = () => {
1445
- var l;
1446
- const t = (l = u.value) == null ? void 0 : l.querySelector("#cp-btn-eyedropper");
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`);
1454
- } else {
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`);
1460
- }
1461
- G(), K(), q(), t == null || t.classList.remove("active");
1462
- }
1463
- }).catch(() => {
1464
- t == null || t.classList.remove("active");
1465
- });
1466
- }, p = (t) => {
1467
- const { value: e, type: l } = t;
1468
- if (l != "a") {
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();
1474
- }
1475
- } else
1476
- oe.value = e, q(), K();
1477
- }, o = (t) => {
1478
- N.h = t.h, N.s = t.s, N.l = t.l;
1479
- const e = a.value.find((l) => l.select == !0);
1480
- if (e && !Number.isNaN(N.h) && !Number.isNaN(N.s) && !Number.isNaN(N.l)) {
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();
1483
- }
1484
- }, y = () => {
1485
- if (j.value) {
1486
- const t = je(j.value);
1487
- if (t) {
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));
1490
- }
1491
- }
1492
- }, G = () => {
1493
- const t = a.value.find((e) => e.select == !0);
1494
- t && (j.value = lt(t.r, t.g, t.b).toUpperCase()), pe(M.value);
1495
- }, se = (t) => {
1496
- f("last-used-pick", t);
1497
- };
1498
- window.EyeDropper && (O.value = !0);
1499
- const ye = (t = "") => {
1500
- if (b.value == "gradient") {
1501
- let e = t.includes("linear") ? "linear" : "radial", l = [];
1502
- if (L.value = e, e == "linear") {
1503
- let i = /^linear-gradient\((.*)\)$/, s = t.replace(";", "").trim().match(i), d = /,\s*(?![^()]*\))/;
1504
- if (s) {
1505
- let k = s[1].split(d);
1506
- for (let I = 0; I < k.length; I++) {
1507
- const $ = k[I];
1508
- let g = {
1509
- id: I,
1510
- r: 0,
1511
- g: 0,
1512
- b: 0,
1513
- a: 100,
1514
- percent: 100,
1515
- hue: 0,
1516
- select: !1
1517
- };
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);
1526
- }
1527
- }
1528
- }
1529
- } else {
1530
- let i = /^radial-gradient\((.*)\)$/, s = t.replace(";", "").trim().match(i), d = /,\s*(?![^()]*\))/;
1531
- if (s) {
1532
- let k = s[1].split(d);
1533
- for (let I = 0; I < k.length; I++) {
1534
- const $ = k[I];
1535
- let g = {
1536
- id: I,
1537
- r: 0,
1538
- g: 0,
1539
- b: 0,
1540
- a: 100,
1541
- percent: 100,
1542
- hue: 0,
1543
- select: !1
1544
- };
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);
1554
- }
1555
- }
1556
- }
1557
- }
1558
- l.length > 1 && (a.value = l, a.value[0].select = !0, oe.value = a.value[0].a);
1559
- } else if (t) {
1560
- let e = {
1561
- r: 0,
1562
- g: 0,
1563
- b: 0,
1564
- a: 0
1565
- };
1566
- if (t.includes("#"))
1567
- if (t.length >= 8)
1568
- e = $t(t);
1569
- else {
1570
- let l = je(t);
1571
- l ? (e.a = 1, e.r = l.r, e.g = l.g, e.b = l.b) : e = null;
1572
- }
1573
- else if (t.includes("rgb"))
1574
- if (t.includes("rgba"))
1575
- e = wt(t);
1576
- else {
1577
- let l = St(t);
1578
- l ? (e.a = 1, e.r = l.r, e.g = l.g, e.b = l.b) : e = null;
1579
- }
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);
1581
- }
1582
- }, pe = (t) => {
1583
- const e = a.value.find((l) => l.select == !0);
1584
- if (e) {
1585
- switch (t) {
1586
- case "RGB":
1587
- break;
1588
- case "HSL": {
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);
1591
- break;
1592
- }
1593
- }
1594
- M.value = t;
1595
- }
1596
- }, xe = (t) => {
1597
- t && ye(t), Le();
1598
- };
1599
- we(
1600
- () => r.modelValue,
1601
- (t, e) => {
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));
1606
- }
1607
- );
1608
- const ut = (t) => {
1609
- a.value.forEach((e) => {
1610
- const l = P == null ? void 0 : P.querySelector(`#clr-gb-${e.id}`);
1611
- l == null || l.remove();
1612
- }), t !== "solid" ? (b.value = "gradient", setTimeout(() => {
1613
- var e;
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);
1617
- }, 200));
1618
- };
1619
- return Je(() => {
1620
- var t;
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(() => {
1622
- F.value = !0;
1623
- });
1624
- }), (t, e) => (m(), E("div", {
1625
- ref_key: "pickerTemplateRef",
1626
- ref: u,
1627
- class: A(["ck-cp-container", n.disabled ? "ck-cp-disabled " : ""]),
1628
- "cp-theme": n.theme
1629
- }, [
1630
- n.variant == "gradient" ? (m(), E("div", rl, [
1631
- T(il, {
1632
- class: "mr-auto",
1633
- variant: n.variant,
1634
- mode: b.value,
1635
- "model-value": n.modelValue,
1636
- iconClasses: n.iconClasses,
1637
- gradientType: L.value,
1638
- onOnChangeMode: ut
1639
- }, null, 8, ["variant", "mode", "model-value", "iconClasses", "gradientType"])
1640
- ])) : D("", !0),
1641
- b.value == "gradient" && n.variant == "gradient" ? (m(), E("div", ul, [
1642
- T(Kt, {
1643
- gradientType: L.value,
1644
- onOnAddColor: Xe,
1645
- onOnMouseDown: Ve,
1646
- onOnDeleteColor: Ge
1647
- }, null, 8, ["gradientType"]),
1648
- T(ll, {
1649
- percentageY: B.percentageY,
1650
- "onUpdate:percentageY": e[0] || (e[0] = (l) => B.percentageY = l),
1651
- angle: B.angle,
1652
- "onUpdate:angle": e[1] || (e[1] = (l) => B.angle = l),
1653
- percentageX: B.percentageX,
1654
- "onUpdate:percentageX": e[2] || (e[2] = (l) => B.percentageX = l),
1655
- inputType: M.value,
1656
- mode: b.value,
1657
- gradientType: L.value,
1658
- onOnInput: q
1659
- }, null, 8, ["percentageY", "angle", "percentageX", "inputType", "mode", "gradientType"])
1660
- ])) : (m(), E("div", dl, [
1661
- n.presetColors ? (m(), E("div", cl, [
1662
- e[10] || (e[10] = h("div", { class: "text-oc-text-400 text-sm my-3 font-medium" }, "Choose color", -1)),
1663
- h("div", pl, [
1664
- (m(!0), E(ge, null, Ke(n.presetColors, (l) => (m(), E("div", {
1665
- key: `color-${l}`,
1666
- class: "ck-cp-color-item !w-[32px] !h-[32px]",
1667
- style: te(`background:${l}`),
1668
- onClick: (i) => se(l)
1669
- }, null, 12, gl))), 128))
1670
- ])
1671
- ])) : D("", !0)
1672
- ])),
1673
- T(al, { onOnMouseDown: Ne }),
1674
- h("div", vl, [
1675
- T(_t, {
1676
- class: A(O.value ? "max-w-[90%]" : ""),
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
1681
- }, null, 8, ["class", "modelValue"]),
1682
- O.value ? (m(), E("button", {
1683
- key: 0,
1684
- id: "cp-btn-eyedropper",
1685
- type: "button",
1686
- class: "cp-btn",
1687
- style: { padding: "7px" },
1688
- onClick: Ye
1689
- }, e[11] || (e[11] = [
1690
- h("svg", {
1691
- version: "1.1",
1692
- xmlns: "http://www.w3.org/2000/svg",
1693
- width: "32",
1694
- height: "32",
1695
- viewBox: "0 0 32 32"
1696
- }, [
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" })
1698
- ], -1)
1699
- ]))) : D("", !0)
1700
- ]),
1701
- n.showAlpha ? (m(), X(zt, {
1702
- key: 3,
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]
1709
- ]),
1710
- h("div", fl, [
1711
- T(Gt, {
1712
- "model-value": M.value,
1713
- "onUpdate:modelValue": pe
1714
- }, null, 8, ["model-value"]),
1715
- F.value && n.showInputSet ? (m(), E("div", hl, [
1716
- M.value == "HEX" ? (m(), X(Pt, {
1717
- key: 0,
1718
- modelValue: j.value,
1719
- "onUpdate:modelValue": [
1720
- e[7] || (e[7] = (l) => j.value = l),
1721
- y
1722
- ]
1723
- }, null, 8, ["modelValue"])) : D("", !0),
1724
- M.value == "RGB" ? (m(), X(nt, {
1725
- key: 1,
1726
- "rgb-value": a.value.find((l) => l.select == !0),
1727
- onUpdateRgbValue: p
1728
- }, null, 8, ["rgb-value"])) : D("", !0),
1729
- M.value == "HSL" ? (m(), X(nt, {
1730
- key: 2,
1731
- "input-type": "HSL",
1732
- "hsl-value": N,
1733
- onUpdateHslValue: o
1734
- }, null, 8, ["hsl-value"])) : D("", !0),
1735
- n.showAlpha ? (m(), X(qt, {
1736
- key: 3,
1737
- modelValue: oe.value,
1738
- "onUpdate:modelValue": [
1739
- e[8] || (e[8] = (l) => oe.value = l),
1740
- e[9] || (e[9] = (l) => De(l))
1741
- ]
1742
- }, null, 8, ["modelValue"])) : D("", !0)
1743
- ])) : D("", !0)
1744
- ]),
1745
- e[12] || (e[12] = h("div", { class: "text-oc-text-400 text-sm my-3 font-medium font-inter" }, "Last used", -1)),
1746
- H.value.length > 0 && n.showColorList ? (m(), E("div", bl, [
1747
- (m(!0), E(ge, null, Ke(Z.value, (l) => (m(), E("div", {
1748
- key: `color-${l}`,
1749
- class: "ck-cp-color-item !w-[32px] !h-[32px]",
1750
- style: te(`background:${l}`),
1751
- onClick: (i) => se(l)
1752
- }, null, 12, yl))), 128))
1753
- ])) : D("", !0)
1754
- ], 10, sl));
1755
- }
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 = {
1757
- key: 0,
1758
- class: "text-xl font-medium"
1759
- }, Sl = {
1760
- key: 0,
1761
- class: "text-sm text-oc-text-400"
1762
- }, El = /* @__PURE__ */ bt({
1763
- __name: "OcOnboardingProgressbar",
1764
- props: {
1765
- title: {
1766
- type: String,
1767
- default: ""
1768
- },
1769
- description: {
1770
- type: String,
1771
- default: ""
1772
- },
1773
- value: {
1774
- type: [String, Number],
1775
- default: "0"
1776
- },
1777
- chartData: {
1778
- type: Array,
1779
- default: () => []
1780
- }
1781
- },
1782
- setup(n) {
1783
- const V = n, r = ke(() => ({
1784
- grid: {
1785
- containLabel: !1
1786
- },
1787
- series: [
1788
- {
1789
- name: "Onboarding Progressbar",
1790
- type: "pie",
1791
- emphasis: {
1792
- disabled: !0
1793
- },
1794
- avoidLabelOverlap: !1,
1795
- label: {
1796
- color: "#000",
1797
- fontWeight: "bold",
1798
- fontFamily: "Inter",
1799
- fontSize: "24",
1800
- position: "center",
1801
- formatter: () => V.value + "%"
1802
- },
1803
- labelLine: {
1804
- show: !0
1805
- },
1806
- radius: ["60%", "100%"],
1807
- data: V.chartData
1808
- }
1809
- ]
1810
- }));
1811
- return (b, u) => (m(), E("div", kl, [
1812
- T(w(Ct), {
1813
- class: "w-[140px] bg-white rounded-full h-[140px]",
1814
- "additional-options": r.value,
1815
- "tooltip-formatter": () => null,
1816
- "tooltip-value-formatter": () => null
1817
- }, null, 8, ["additional-options"]),
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)
1822
- ])
1823
- ])
1824
- ]));
1825
- }
1826
- }), Ml = it(
1
+ import { defineAsyncComponent as o } from "vue";
2
+ import { LineChart as s } from "./Dashboard/Charts/LineChart/OcLineChart.js";
3
+ import { PieChart as f } from "./Dashboard/Charts/PieChart/OcPieChart.js";
4
+ import { BarChart as d } from "./Dashboard/Charts/BarChart/OcBarChart.js";
5
+ import { BarRaceChart as h } from "./Dashboard/Charts/BarRaceChart/OcBarRaceChart.js";
6
+ import { Card as l } from "./Dashboard/Card/OcCard.js";
7
+ const t = o(
8
+ () => import("./OcColorPicker-BZ3zytCj.js")
9
+ ), e = o(
10
+ () => import("./OcTextEditor-BWOvVmgS.js")
11
+ ), i = o(
12
+ () => import("./OcColorPickerPopup-sjvpeV8l.js")
13
+ ), p = o(
14
+ () => import("./OcOnboardingProgressbar-BsqF90Gn.js")
15
+ ), m = o(
1827
16
  () => import("./OcCodeBlock-chTpuRDc.js")
1828
- ), Ul = it(
1829
- () => import("./OcLottieAnimation-EBkAB8-y.js")
17
+ ), n = o(
18
+ () => import("./OcLottieAnimation-cF06yacT.js")
1830
19
  );
1831
20
  export {
1832
- Ql as BarChart,
1833
- Nl as BarRaceChart,
1834
- Xl as Card,
1835
- Ml as CodeBlock,
1836
- Vt as ColorPicker,
1837
- xl as ColorPickerPopup,
1838
- Ol as LineChart,
1839
- Ul as LottieAnimation,
1840
- El as OnboardingProgressbar,
1841
- Ct as PieChart,
1842
- Rl as TextEditor
21
+ d as BarChart,
22
+ h as BarRaceChart,
23
+ l as Card,
24
+ m as CodeBlock,
25
+ t as ColorPicker,
26
+ i as ColorPickerPopup,
27
+ s as LineChart,
28
+ n as LottieAnimation,
29
+ p as OnboardingProgressbar,
30
+ f as PieChart,
31
+ e as TextEditor
1843
32
  };