@orchidui/dashboard 1.21.1-21 → 1.21.1-24
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 +82 -77
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var pt = Object.defineProperty;
|
|
2
2
|
var gt = (n, V, r) => V in n ? pt(n, V, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[V] = r;
|
|
3
3
|
var We = (n, V, r) => gt(n, typeof V != "symbol" ? V + "" : V, r);
|
|
4
|
-
import { ref as v, computed as $e, createBlock as P, openBlock as m, unref as w, normalizeClass as Q, withCtx as W, createVNode as L, createElementBlock as
|
|
4
|
+
import { ref as v, computed as $e, createBlock as P, openBlock as m, unref as w, normalizeClass as Q, withCtx as W, createVNode as L, createElementBlock as U, createSlots as vt, renderSlot as je, normalizeStyle as te, createCommentVNode as H, onMounted as Je, watch as fe, createElementVNode as h, Teleport as mt, Fragment as ge, createTextVNode as ve, toDisplayString as Ne, renderList as Ke, withKeys as ot, inject as Re, reactive as _e, provide as Be, nextTick as ft, withDirectives as ht, vShow as yt, defineAsyncComponent as it } from "vue";
|
|
5
5
|
import { Q as Y, a as bt } from "./QuillEditor-DwCbpq2d.js";
|
|
6
6
|
import { BaseInput as st, Dropdown as rt, Input as we, Icon as A, Modal as xt, Select as Ze, Slider as Ae } from "@orchidui/core";
|
|
7
7
|
import { rgbToHsl as et, rgb2Hex as tt, rgbaToHex8 as kt, hsl2Hex as lt, hexToRgb as ze, rgbToHue as Qe, hslToRgb as at, hex8ToRgba as $t, parseRgba as wt, parseRgb as St } from "./Dashboard/ColorPicker/components/converters.js";
|
|
@@ -33,8 +33,8 @@ const It = { key: 1 }, Vt = {
|
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:model-value"],
|
|
35
35
|
setup(n, { emit: V }) {
|
|
36
|
-
const r = n, y = V, u = v(!1), f = v(r.modelValue), C = (
|
|
37
|
-
|
|
36
|
+
const r = n, y = V, u = v(!1), f = v(r.modelValue), C = (E) => {
|
|
37
|
+
E && (f.value = E, y("update:model-value", E));
|
|
38
38
|
}, p = $e(() => r.variant === "gradient" ? {
|
|
39
39
|
class: "w-[20px] h-[20px] hide-svg-icon",
|
|
40
40
|
style: {
|
|
@@ -45,12 +45,12 @@ const It = { key: 1 }, Vt = {
|
|
|
45
45
|
color: f.value
|
|
46
46
|
}
|
|
47
47
|
}), a = v(), O = v([]), Z = () => {
|
|
48
|
-
O.value.length > 8 && (O.value = O.value.filter((
|
|
48
|
+
O.value.length > 8 && (O.value = O.value.filter((E, N) => N < 8)), localStorage.setItem("ck-cp-local-color-list", JSON.stringify(O.value));
|
|
49
49
|
};
|
|
50
50
|
let M = localStorage.getItem("ck-cp-local-color-list");
|
|
51
51
|
M && (O.value = [...new Set(JSON.parse(M))], Z());
|
|
52
|
-
const T = (
|
|
53
|
-
if (!
|
|
52
|
+
const T = (E) => {
|
|
53
|
+
if (!E && f.value)
|
|
54
54
|
if (O.value.find((D) => D === f.value))
|
|
55
55
|
O.value = [
|
|
56
56
|
f.value,
|
|
@@ -61,10 +61,10 @@ const It = { key: 1 }, Vt = {
|
|
|
61
61
|
let D = f.value;
|
|
62
62
|
O.value.unshift(D), Z();
|
|
63
63
|
}
|
|
64
|
-
}, B = v(!1), z = (
|
|
65
|
-
f.value =
|
|
64
|
+
}, B = v(!1), z = (E) => {
|
|
65
|
+
f.value = E, y("update:model-value", E), u.value = !1;
|
|
66
66
|
};
|
|
67
|
-
return (
|
|
67
|
+
return (E, N) => (m(), P(w(st), {
|
|
68
68
|
class: Q(n.hideInputColor ? "w-[40px]" : ""),
|
|
69
69
|
onClick: N[1] || (N[1] = () => {
|
|
70
70
|
var D;
|
|
@@ -100,8 +100,8 @@ const It = { key: 1 }, Vt = {
|
|
|
100
100
|
}, null, 8, ["variant", "show-alpha", "type", "model-value", "last-used-colors", "preset-colors"]))
|
|
101
101
|
]),
|
|
102
102
|
default: W(() => [
|
|
103
|
-
n.hideInputColor ? (m(),
|
|
104
|
-
je(
|
|
103
|
+
n.hideInputColor ? (m(), U("div", It, [
|
|
104
|
+
je(E.$slots, "picker-icon", {}, () => [
|
|
105
105
|
L(w(A), {
|
|
106
106
|
class: "cursor-pointer",
|
|
107
107
|
style: te(`color: ${f.value}`),
|
|
@@ -116,10 +116,10 @@ const It = { key: 1 }, Vt = {
|
|
|
116
116
|
placeholder: "",
|
|
117
117
|
"onUpdate:modelValue": C
|
|
118
118
|
}, vt({ _: 2 }, [
|
|
119
|
-
|
|
119
|
+
E.$slots.leading ? {
|
|
120
120
|
name: "leading",
|
|
121
121
|
fn: W(() => [
|
|
122
|
-
je(
|
|
122
|
+
je(E.$slots, "leading")
|
|
123
123
|
]),
|
|
124
124
|
key: "0"
|
|
125
125
|
} : void 0
|
|
@@ -131,7 +131,7 @@ const It = { key: 1 }, Vt = {
|
|
|
131
131
|
_: 3
|
|
132
132
|
}, 8, ["class"]));
|
|
133
133
|
}
|
|
134
|
-
}, Tt = ["id"], Lt = { class: "flex items-center gap-x-3 px-5" }, Bt = { class: "flex items-center gap-x-5 cursor-pointer" }, Rt = { class: "flex flex-col py-2 overflow-hidden" },
|
|
134
|
+
}, Tt = ["id"], Lt = { class: "flex items-center gap-x-3 px-5" }, Bt = { class: "flex items-center gap-x-5 cursor-pointer" }, Rt = { class: "flex flex-col py-2 overflow-hidden" }, Ut = ["onClick"], Et = { class: "flex gap-x-3 items-center px-5" }, Dt = { class: "flex items-center gap-x-3 px-5" }, Ht = { class: "flex gap-x-3 items-center px-5" }, Ot = { class: "flex gap-x-3 items-center px-5" }, Mt = { class: "flex items-center" }, Qt = { class: "grid cursor-pointer px-5" }, At = {
|
|
135
135
|
key: 5,
|
|
136
136
|
class: "flex gap-x-3 items-center px-5"
|
|
137
137
|
}, Nt = { class: "flex" }, Pt = { class: "mt-1 mx-2 cursor-pointer" }, Rl = {
|
|
@@ -183,9 +183,10 @@ const It = { key: 1 }, Vt = {
|
|
|
183
183
|
placeholder: {
|
|
184
184
|
type: String,
|
|
185
185
|
default: ""
|
|
186
|
-
}
|
|
186
|
+
},
|
|
187
|
+
isCustomImageUpload: Boolean
|
|
187
188
|
},
|
|
188
|
-
emits: ["update:modelValue", "update:image"],
|
|
189
|
+
emits: ["update:modelValue", "update:image", "uploadImage"],
|
|
189
190
|
setup(n, { emit: V }) {
|
|
190
191
|
const r = n, y = V, u = {
|
|
191
192
|
default: [
|
|
@@ -218,8 +219,8 @@ const It = { key: 1 }, Vt = {
|
|
|
218
219
|
We(B, "blotName", "divider"), We(B, "tagName", "hr"), Y.register(B);
|
|
219
220
|
const z = v(
|
|
220
221
|
Math.random().toString(36).replace(/[^a-zA-Z]+/g, "")
|
|
221
|
-
),
|
|
222
|
-
|
|
222
|
+
), E = v(!1), N = v(!1), D = v(!1), le = v(!1), J = v(!1), j = v(!1), R = v(!1), X = v(""), ae = v(""), ee = v(""), b = v(), Se = v(!1), ue = v(r.image), ie = (c) => {
|
|
223
|
+
E.value = b.value.getQuill().history.stack.undo.length > 0, N.value = b.value.getQuill().history.stack.redo.length > 0, D.value = b.value.getQuill().getFormat().bold, le.value = b.value.getQuill().getFormat().italic, J.value = b.value.getQuill().getFormat().underline, R.value = b.value.getQuill().getFormat().blockquote, ae.value = b.value.getQuill().getFormat().list, ee.value = b.value.getQuill().getFormat().align;
|
|
223
224
|
let o = document.createElement("div");
|
|
224
225
|
o.innerHTML = c, Se.value && (o.innerText ? y("update:modelValue", c || "") : y("update:modelValue", ""), o.remove());
|
|
225
226
|
}, Pe = () => {
|
|
@@ -228,9 +229,9 @@ const It = { key: 1 }, Vt = {
|
|
|
228
229
|
b.value.getQuill().insertText(o.index, `
|
|
229
230
|
`, Y.sources.USER), b.value.getQuill().insertEmbed(o.index + 1, "divider", !0, Y.sources.USER), b.value.getQuill().setSelection(o.index + 2, Y.sources.SILENT);
|
|
230
231
|
}
|
|
231
|
-
}, Ee = () => {
|
|
232
|
-
b.value.getQuill().history.undo(), ie(r.modelValue);
|
|
233
232
|
}, Ue = () => {
|
|
233
|
+
b.value.getQuill().history.undo(), ie(r.modelValue);
|
|
234
|
+
}, Ee = () => {
|
|
234
235
|
b.value.getQuill().history.redo(), ie(r.modelValue);
|
|
235
236
|
}, Ce = () => {
|
|
236
237
|
var c;
|
|
@@ -252,7 +253,11 @@ const It = { key: 1 }, Vt = {
|
|
|
252
253
|
const o = b.value.getQuill().getSelection();
|
|
253
254
|
o && (b.value.getQuill().clipboard.dangerouslyPasteHTML(o.index, `<img src="${c}" />`), ue.value = c, y("update:image", ue.value));
|
|
254
255
|
}, He = () => {
|
|
255
|
-
b.value.getQuill().getSelection() || b.value.getQuill().setSelection(b.value.getQuill().getLength() - 1)
|
|
256
|
+
if (b.value.getQuill().getSelection() || b.value.getQuill().setSelection(b.value.getQuill().getLength() - 1), r.isCustomImageUpload) {
|
|
257
|
+
if (!b.value.getQuill().getSelection()) return;
|
|
258
|
+
y("upload-image", b.value);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
256
261
|
const c = document.createElement("input");
|
|
257
262
|
c.type = "file", c.accept = "jpg,.jpeg,.png,.webp,.gif", c.onchange = () => {
|
|
258
263
|
const o = c.files[0], x = new FileReader();
|
|
@@ -395,26 +400,26 @@ const It = { key: 1 }, Vt = {
|
|
|
395
400
|
id: z.value,
|
|
396
401
|
class: "flex min-h-[36px] flex-wrap !py-2 !px-3 gap-y-2 rounded-t"
|
|
397
402
|
}, [
|
|
398
|
-
f.value.includes("changes") ? (m(),
|
|
403
|
+
f.value.includes("changes") ? (m(), U(ge, { key: 0 }, [
|
|
399
404
|
h("div", Lt, [
|
|
400
405
|
L(w(A), {
|
|
401
|
-
class: Q(
|
|
406
|
+
class: Q(E.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
402
407
|
width: "20",
|
|
403
408
|
height: "20",
|
|
404
409
|
name: "text-editor/undo",
|
|
405
|
-
onClick:
|
|
410
|
+
onClick: Ue
|
|
406
411
|
}, null, 8, ["class"]),
|
|
407
412
|
L(w(A), {
|
|
408
413
|
class: Q(N.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
409
414
|
width: "20",
|
|
410
415
|
height: "20",
|
|
411
416
|
name: "text-editor/redo",
|
|
412
|
-
onClick:
|
|
417
|
+
onClick: Ee
|
|
413
418
|
}, null, 8, ["class"])
|
|
414
419
|
]),
|
|
415
420
|
o[16] || (o[16] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
416
421
|
], 64)) : H("", !0),
|
|
417
|
-
f.value.includes("font-size") ? (m(),
|
|
422
|
+
f.value.includes("font-size") ? (m(), U(ge, { key: 1 }, [
|
|
418
423
|
L(w(rt), {
|
|
419
424
|
modelValue: j.value,
|
|
420
425
|
"onUpdate:modelValue": o[3] || (o[3] = (x) => j.value = x),
|
|
@@ -422,11 +427,11 @@ const It = { key: 1 }, Vt = {
|
|
|
422
427
|
}, {
|
|
423
428
|
menu: W(() => [
|
|
424
429
|
h("div", Rt, [
|
|
425
|
-
(m(!0),
|
|
430
|
+
(m(!0), U(ge, null, Ke(n.fontSizes, (x) => (m(), U("div", {
|
|
426
431
|
key: x.value,
|
|
427
432
|
class: Q(["min-w-[120px] cursor-pointer py-2 px-3 hover:bg-oc-gray-50", X.value === x.value ? "font-medium" : ""]),
|
|
428
433
|
onClick: (G) => De(x.value)
|
|
429
|
-
}, Ne(x.label), 11,
|
|
434
|
+
}, Ne(x.label), 11, Ut))), 128))
|
|
430
435
|
])
|
|
431
436
|
]),
|
|
432
437
|
default: W(() => {
|
|
@@ -447,8 +452,8 @@ const It = { key: 1 }, Vt = {
|
|
|
447
452
|
}, 8, ["modelValue"]),
|
|
448
453
|
o[17] || (o[17] = h("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
449
454
|
], 64)) : H("", !0),
|
|
450
|
-
f.value.includes("font-style") ? (m(),
|
|
451
|
-
h("div",
|
|
455
|
+
f.value.includes("font-style") ? (m(), U(ge, { key: 2 }, [
|
|
456
|
+
h("div", Et, [
|
|
452
457
|
L(w(A), {
|
|
453
458
|
class: Q(["cursor-pointer", D.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
454
459
|
width: "20",
|
|
@@ -514,7 +519,7 @@ const It = { key: 1 }, Vt = {
|
|
|
514
519
|
onClick: o[4] || (o[4] = (x) => K.value = !K.value)
|
|
515
520
|
})
|
|
516
521
|
]),
|
|
517
|
-
f.value.includes("list") ? (m(),
|
|
522
|
+
f.value.includes("list") ? (m(), U(ge, { key: 3 }, [
|
|
518
523
|
o[19] || (o[19] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
519
524
|
h("div", Ht, [
|
|
520
525
|
L(w(A), {
|
|
@@ -533,7 +538,7 @@ const It = { key: 1 }, Vt = {
|
|
|
533
538
|
}, null, 8, ["class"])
|
|
534
539
|
])
|
|
535
540
|
], 64)) : H("", !0),
|
|
536
|
-
f.value.includes("alignment") ? (m(),
|
|
541
|
+
f.value.includes("alignment") ? (m(), U(ge, { key: 4 }, [
|
|
537
542
|
o[20] || (o[20] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
538
543
|
h("div", Ot, [
|
|
539
544
|
L(w(A), {
|
|
@@ -591,7 +596,7 @@ const It = { key: 1 }, Vt = {
|
|
|
591
596
|
}, 8, ["modelValue"])
|
|
592
597
|
]),
|
|
593
598
|
o[23] || (o[23] = h("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
594
|
-
ce.value ? (m(),
|
|
599
|
+
ce.value ? (m(), U("div", At, [
|
|
595
600
|
L(w(Ae), {
|
|
596
601
|
label: "Image width",
|
|
597
602
|
class: "w-[120px]",
|
|
@@ -625,7 +630,7 @@ const It = { key: 1 }, Vt = {
|
|
|
625
630
|
])
|
|
626
631
|
])) : H("", !0),
|
|
627
632
|
h("div", Pt, [
|
|
628
|
-
(m(),
|
|
633
|
+
(m(), U("svg", {
|
|
629
634
|
width: "20",
|
|
630
635
|
height: "20",
|
|
631
636
|
viewBox: "0 0 15 15",
|
|
@@ -730,7 +735,7 @@ const It = { key: 1 }, Vt = {
|
|
|
730
735
|
g: 0,
|
|
731
736
|
b: 0
|
|
732
737
|
}), f = v(), C = v(), p = v(), a = (M, T) => {
|
|
733
|
-
var z,
|
|
738
|
+
var z, E, N;
|
|
734
739
|
let B = 255;
|
|
735
740
|
if (r.inputType == "HSL" && (B = 100, M == "r" && (B = 360)), !isNaN(parseInt(T))) {
|
|
736
741
|
if (M == "r") {
|
|
@@ -738,7 +743,7 @@ const It = { key: 1 }, Vt = {
|
|
|
738
743
|
D <= B && (u.value.r = D, r.inputType == "RGB" ? O("r") : Z()), (z = f.value) == null || z.focus();
|
|
739
744
|
} else if (M == "g") {
|
|
740
745
|
let D = parseInt(T);
|
|
741
|
-
D <= B && (u.value.g = D, r.inputType == "RGB" ? O("g") : Z()), (
|
|
746
|
+
D <= B && (u.value.g = D, r.inputType == "RGB" ? O("g") : Z()), (E = C.value) == null || E.focus();
|
|
742
747
|
} else if (M == "b") {
|
|
743
748
|
let D = parseInt(T);
|
|
744
749
|
D <= B && (u.value.b = D, r.inputType == "RGB" ? O("b") : Z()), (N = p.value) == null || N.focus();
|
|
@@ -776,7 +781,7 @@ const It = { key: 1 }, Vt = {
|
|
|
776
781
|
};
|
|
777
782
|
},
|
|
778
783
|
{ immediate: !0, deep: !0 }
|
|
779
|
-
), (M, T) => (m(),
|
|
784
|
+
), (M, T) => (m(), U("div", qt, [
|
|
780
785
|
L(w(we), {
|
|
781
786
|
ref_key: "rInputEl",
|
|
782
787
|
ref: f,
|
|
@@ -877,7 +882,7 @@ const It = { key: 1 }, Vt = {
|
|
|
877
882
|
const r = Re("opacitySlider"), y = V, u = (f) => {
|
|
878
883
|
y("update:modelValue", parseInt(f.target.value)), y("onInput", f);
|
|
879
884
|
};
|
|
880
|
-
return (f, C) => (m(),
|
|
885
|
+
return (f, C) => (m(), U("div", Yt, [
|
|
881
886
|
h("div", Wt, [
|
|
882
887
|
h("input", {
|
|
883
888
|
ref_key: "opacitySlider",
|
|
@@ -912,7 +917,7 @@ const It = { key: 1 }, Vt = {
|
|
|
912
917
|
}, M = (T) => {
|
|
913
918
|
p.value = !1, u("onAddColor", T);
|
|
914
919
|
};
|
|
915
|
-
return (T, B) => (m(),
|
|
920
|
+
return (T, B) => (m(), U("div", {
|
|
916
921
|
ref_key: "gradientSlider",
|
|
917
922
|
ref: y,
|
|
918
923
|
class: "relative h-[40px]",
|
|
@@ -957,7 +962,7 @@ const It = { key: 1 }, Vt = {
|
|
|
957
962
|
const r = V, y = (u) => {
|
|
958
963
|
r("update:modelValue", parseFloat(u.target.value)), r("onInput", u);
|
|
959
964
|
};
|
|
960
|
-
return (u, f) => (m(),
|
|
965
|
+
return (u, f) => (m(), U("div", Zt, [
|
|
961
966
|
h("input", {
|
|
962
967
|
value: n.modelValue,
|
|
963
968
|
class: "picker-hue-range-slider",
|
|
@@ -1005,7 +1010,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1005
1010
|
break;
|
|
1006
1011
|
}
|
|
1007
1012
|
};
|
|
1008
|
-
return (C, p) => (m(),
|
|
1013
|
+
return (C, p) => (m(), U("div", el, [
|
|
1009
1014
|
n.gradientType == "linear" && r.value ? (m(), P(w(Ae), {
|
|
1010
1015
|
key: 0,
|
|
1011
1016
|
label: "Angle",
|
|
@@ -1023,7 +1028,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1023
1028
|
])),
|
|
1024
1029
|
_: 1
|
|
1025
1030
|
}, 8, ["model-value"])) : H("", !0),
|
|
1026
|
-
n.gradientType == "radial" && y.value ? (m(),
|
|
1031
|
+
n.gradientType == "radial" && y.value ? (m(), U("div", tl, [
|
|
1027
1032
|
L(w(Ae), {
|
|
1028
1033
|
label: "Position X",
|
|
1029
1034
|
"model-value": n.percentageX,
|
|
@@ -1064,7 +1069,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1064
1069
|
const V = Re("canvas"), r = Re("pickerWrap"), y = Re("pickerPointer"), u = (f) => {
|
|
1065
1070
|
f.preventDefault();
|
|
1066
1071
|
};
|
|
1067
|
-
return (f, C) => (m(),
|
|
1072
|
+
return (f, C) => (m(), U("div", {
|
|
1068
1073
|
ref_key: "pickerWrap",
|
|
1069
1074
|
ref: r,
|
|
1070
1075
|
class: "cp-picker-wrap",
|
|
@@ -1111,18 +1116,18 @@ const It = { key: 1 }, Vt = {
|
|
|
1111
1116
|
},
|
|
1112
1117
|
emits: ["onChangeMode"],
|
|
1113
1118
|
setup(n) {
|
|
1114
|
-
return (V, r) => (m(),
|
|
1119
|
+
return (V, r) => (m(), U("div", nl, [
|
|
1115
1120
|
h("button", {
|
|
1116
1121
|
type: "button",
|
|
1117
1122
|
class: Q(n.mode == "solid" ? "active" : ""),
|
|
1118
1123
|
style: { padding: "7px" },
|
|
1119
1124
|
onClick: r[0] || (r[0] = (y) => V.$emit("onChangeMode", "solid"))
|
|
1120
1125
|
}, [
|
|
1121
|
-
n.modelValue && n.mode == "solid" ? (m(),
|
|
1126
|
+
n.modelValue && n.mode == "solid" ? (m(), U("div", {
|
|
1122
1127
|
key: 0,
|
|
1123
1128
|
class: "w-[28px] h-[28px] rounded-full border",
|
|
1124
1129
|
style: te(`background:${n.modelValue}`)
|
|
1125
|
-
}, null, 4)) : (m(),
|
|
1130
|
+
}, null, 4)) : (m(), U("svg", ol, r[3] || (r[3] = [
|
|
1126
1131
|
h("g", { opacity: "0.5" }, [
|
|
1127
1132
|
h("path", {
|
|
1128
1133
|
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",
|
|
@@ -1233,7 +1238,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1233
1238
|
angle: 90,
|
|
1234
1239
|
percentageX: 50,
|
|
1235
1240
|
percentageY: 50
|
|
1236
|
-
}), z = v(""),
|
|
1241
|
+
}), z = v(""), E = v(r.inputType), N = v(!1), D = v(), le = v(), J = v(), j = v(), R = v(), X = _e({
|
|
1237
1242
|
h: 0,
|
|
1238
1243
|
s: 0,
|
|
1239
1244
|
l: 0
|
|
@@ -1241,13 +1246,13 @@ const It = { key: 1 }, Vt = {
|
|
|
1241
1246
|
Be("gradientBar", le), Be("canvas", J), Be("pickerWrap", j), Be("pickerPointer", R), Be("opacitySlider", D);
|
|
1242
1247
|
let ae = 0, ee = 0, b = 0, Se = 0, ue = 0, ie = 0;
|
|
1243
1248
|
const Pe = (t) => {
|
|
1244
|
-
!j.value || !R.value || (ue = j.value.offsetHeight - R.value.offsetHeight, ie = j.value.offsetWidth - R.value.offsetWidth, b = t.clientX - t.target.getBoundingClientRect().left, Se = t.clientY - t.target.getBoundingClientRect().top, ae = b - R.value.offsetWidth / 2, ee = Se - R.value.offsetHeight / 2, R.value.style.left = `${ae}px`, R.value.style.top = `${ee}px`, Ce(!1), G(), window.addEventListener("mousemove",
|
|
1245
|
-
},
|
|
1249
|
+
!j.value || !R.value || (ue = j.value.offsetHeight - R.value.offsetHeight, ie = j.value.offsetWidth - R.value.offsetWidth, b = t.clientX - t.target.getBoundingClientRect().left, Se = t.clientY - t.target.getBoundingClientRect().top, ae = b - R.value.offsetWidth / 2, ee = Se - R.value.offsetHeight / 2, R.value.style.left = `${ae}px`, R.value.style.top = `${ee}px`, Ce(!1), G(), window.addEventListener("mousemove", Ue), window.addEventListener("mouseup", Ee));
|
|
1250
|
+
}, Ue = (t) => {
|
|
1246
1251
|
t.preventDefault();
|
|
1247
1252
|
const e = j.value.getBoundingClientRect(), l = t.clientX - e.left - R.value.offsetWidth / 2, i = t.clientY - e.top - R.value.offsetHeight / 2;
|
|
1248
1253
|
l >= 0 && l <= ie ? (ae = l, R.value.style.left = `${l}px`) : 0 > l ? (ae = 0, R.value.style.left = "0px") : l > ie && (ae = ie, R.value.style.left = `${ie}px`), i >= 0 && i <= ue ? (ee = i, R.value.style.top = `${i}px`) : 0 > i ? (ee = 0, R.value.style.top = "0px") : i > ue && (ee = ue, R.value.style.top = `${ue}px`), Ce(!1), G();
|
|
1249
|
-
},
|
|
1250
|
-
window.removeEventListener("mousemove",
|
|
1254
|
+
}, Ee = () => {
|
|
1255
|
+
window.removeEventListener("mousemove", Ue), window.removeEventListener("mouseup", Ee);
|
|
1251
1256
|
}, Ce = (t) => {
|
|
1252
1257
|
if (!t) {
|
|
1253
1258
|
let e = De();
|
|
@@ -1503,12 +1508,12 @@ const It = { key: 1 }, Vt = {
|
|
|
1503
1508
|
const t = ze(z.value);
|
|
1504
1509
|
if (t) {
|
|
1505
1510
|
const e = Qe(t.r, t.g, t.b), l = a.value.find((i) => i.select == !0);
|
|
1506
|
-
l && (l.r = t.r, l.g = t.g, l.b = t.b, l.hue = e, ce(t.r, t.g, t.b, l.hue, !0), F(), K(), pe(
|
|
1511
|
+
l && (l.r = t.r, l.g = t.g, l.b = t.b, l.hue = e, ce(t.r, t.g, t.b, l.hue, !0), F(), K(), pe(E.value));
|
|
1507
1512
|
}
|
|
1508
1513
|
}
|
|
1509
1514
|
}, G = () => {
|
|
1510
1515
|
const t = a.value.find((e) => e.select == !0);
|
|
1511
|
-
t && (z.value = tt(t.r, t.g, t.b).toUpperCase()), pe(
|
|
1516
|
+
t && (z.value = tt(t.r, t.g, t.b).toUpperCase()), pe(E.value);
|
|
1512
1517
|
}, se = (t) => {
|
|
1513
1518
|
f("last-used-pick", t);
|
|
1514
1519
|
};
|
|
@@ -1608,7 +1613,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1608
1613
|
break;
|
|
1609
1614
|
}
|
|
1610
1615
|
}
|
|
1611
|
-
|
|
1616
|
+
E.value = t;
|
|
1612
1617
|
}
|
|
1613
1618
|
}, ke = (t) => {
|
|
1614
1619
|
t && xe(t), Te();
|
|
@@ -1635,16 +1640,16 @@ const It = { key: 1 }, Vt = {
|
|
|
1635
1640
|
};
|
|
1636
1641
|
return Je(() => {
|
|
1637
1642
|
var t;
|
|
1638
|
-
y.value = r.modelValue.includes("linear") || r.modelValue.includes("radial") ? "gradient" : "solid", y.value == "gradient" && (q = (t = u.value) == null ? void 0 : t.querySelector(".gradient-bar")), ke(r.modelValue), pe(
|
|
1643
|
+
y.value = r.modelValue.includes("linear") || r.modelValue.includes("radial") ? "gradient" : "solid", y.value == "gradient" && (q = (t = u.value) == null ? void 0 : t.querySelector(".gradient-bar")), ke(r.modelValue), pe(E.value), ft(() => {
|
|
1639
1644
|
N.value = !0;
|
|
1640
1645
|
});
|
|
1641
|
-
}), (t, e) => (m(),
|
|
1646
|
+
}), (t, e) => (m(), U("div", {
|
|
1642
1647
|
ref_key: "pickerTemplateRef",
|
|
1643
1648
|
ref: u,
|
|
1644
1649
|
class: Q(["ck-cp-container", n.disabled ? "ck-cp-disabled " : ""]),
|
|
1645
1650
|
"cp-theme": n.theme
|
|
1646
1651
|
}, [
|
|
1647
|
-
n.variant == "gradient" ? (m(),
|
|
1652
|
+
n.variant == "gradient" ? (m(), U("div", rl, [
|
|
1648
1653
|
L(il, {
|
|
1649
1654
|
class: "mr-auto",
|
|
1650
1655
|
variant: n.variant,
|
|
@@ -1655,7 +1660,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1655
1660
|
onOnChangeMode: ut
|
|
1656
1661
|
}, null, 8, ["variant", "mode", "model-value", "iconClasses", "gradientType"])
|
|
1657
1662
|
])) : H("", !0),
|
|
1658
|
-
y.value == "gradient" && n.variant == "gradient" ? (m(),
|
|
1663
|
+
y.value == "gradient" && n.variant == "gradient" ? (m(), U("div", ul, [
|
|
1659
1664
|
L(Kt, {
|
|
1660
1665
|
gradientType: T.value,
|
|
1661
1666
|
onOnAddColor: qe,
|
|
@@ -1669,16 +1674,16 @@ const It = { key: 1 }, Vt = {
|
|
|
1669
1674
|
"onUpdate:angle": e[1] || (e[1] = (l) => B.angle = l),
|
|
1670
1675
|
percentageX: B.percentageX,
|
|
1671
1676
|
"onUpdate:percentageX": e[2] || (e[2] = (l) => B.percentageX = l),
|
|
1672
|
-
inputType:
|
|
1677
|
+
inputType: E.value,
|
|
1673
1678
|
mode: y.value,
|
|
1674
1679
|
gradientType: T.value,
|
|
1675
1680
|
onOnInput: F
|
|
1676
1681
|
}, null, 8, ["percentageY", "angle", "percentageX", "inputType", "mode", "gradientType"])
|
|
1677
|
-
])) : (m(),
|
|
1678
|
-
n.presetColors ? (m(),
|
|
1682
|
+
])) : (m(), U("div", dl, [
|
|
1683
|
+
n.presetColors ? (m(), U("div", cl, [
|
|
1679
1684
|
e[10] || (e[10] = h("div", { class: "text-oc-text-400 text-sm my-3 font-medium" }, "Choose color", -1)),
|
|
1680
1685
|
h("div", pl, [
|
|
1681
|
-
(m(!0),
|
|
1686
|
+
(m(!0), U(ge, null, Ke(n.presetColors, (l) => (m(), U("div", {
|
|
1682
1687
|
key: `color-${l}`,
|
|
1683
1688
|
class: "ck-cp-color-item !w-[32px] !h-[32px]",
|
|
1684
1689
|
style: te(`background:${l}`),
|
|
@@ -1696,7 +1701,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1696
1701
|
onOnInput: e[4] || (e[4] = (l) => Ie(!1)),
|
|
1697
1702
|
onOnChange: Xe
|
|
1698
1703
|
}, null, 8, ["class", "modelValue"]),
|
|
1699
|
-
M.value ? (m(),
|
|
1704
|
+
M.value ? (m(), U("button", {
|
|
1700
1705
|
key: 0,
|
|
1701
1706
|
id: "cp-btn-eyedropper",
|
|
1702
1707
|
type: "button",
|
|
@@ -1726,11 +1731,11 @@ const It = { key: 1 }, Vt = {
|
|
|
1726
1731
|
]),
|
|
1727
1732
|
h("div", fl, [
|
|
1728
1733
|
L(Gt, {
|
|
1729
|
-
"model-value":
|
|
1734
|
+
"model-value": E.value,
|
|
1730
1735
|
"onUpdate:modelValue": pe
|
|
1731
1736
|
}, null, 8, ["model-value"]),
|
|
1732
|
-
N.value && n.showInputSet ? (m(),
|
|
1733
|
-
|
|
1737
|
+
N.value && n.showInputSet ? (m(), U("div", hl, [
|
|
1738
|
+
E.value == "HEX" ? (m(), P(Xt, {
|
|
1734
1739
|
key: 0,
|
|
1735
1740
|
modelValue: z.value,
|
|
1736
1741
|
"onUpdate:modelValue": [
|
|
@@ -1738,12 +1743,12 @@ const It = { key: 1 }, Vt = {
|
|
|
1738
1743
|
x
|
|
1739
1744
|
]
|
|
1740
1745
|
}, null, 8, ["modelValue"])) : H("", !0),
|
|
1741
|
-
|
|
1746
|
+
E.value == "RGB" ? (m(), P(nt, {
|
|
1742
1747
|
key: 1,
|
|
1743
1748
|
"rgb-value": a.value.find((l) => l.select == !0),
|
|
1744
1749
|
onUpdateRgbValue: c
|
|
1745
1750
|
}, null, 8, ["rgb-value"])) : H("", !0),
|
|
1746
|
-
|
|
1751
|
+
E.value == "HSL" ? (m(), P(nt, {
|
|
1747
1752
|
key: 2,
|
|
1748
1753
|
"input-type": "HSL",
|
|
1749
1754
|
"hsl-value": X,
|
|
@@ -1760,8 +1765,8 @@ const It = { key: 1 }, Vt = {
|
|
|
1760
1765
|
])) : H("", !0)
|
|
1761
1766
|
]),
|
|
1762
1767
|
e[12] || (e[12] = h("div", { class: "text-oc-text-400 text-sm my-3 font-medium font-inter" }, "Last used", -1)),
|
|
1763
|
-
O.value.length > 0 && n.showColorList ? (m(),
|
|
1764
|
-
(m(!0),
|
|
1768
|
+
O.value.length > 0 && n.showColorList ? (m(), U("div", yl, [
|
|
1769
|
+
(m(!0), U(ge, null, Ke(Z.value, (l) => (m(), U("div", {
|
|
1765
1770
|
key: `color-${l}`,
|
|
1766
1771
|
class: "ck-cp-color-item !w-[32px] !h-[32px]",
|
|
1767
1772
|
style: te(`background:${l}`),
|
|
@@ -1776,7 +1781,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1776
1781
|
}, Sl = {
|
|
1777
1782
|
key: 0,
|
|
1778
1783
|
class: "text-sm text-oc-text-400"
|
|
1779
|
-
},
|
|
1784
|
+
}, Ul = {
|
|
1780
1785
|
__name: "OcOnboardingProgressbar",
|
|
1781
1786
|
props: {
|
|
1782
1787
|
title: {
|
|
@@ -1825,7 +1830,7 @@ const It = { key: 1 }, Vt = {
|
|
|
1825
1830
|
}
|
|
1826
1831
|
]
|
|
1827
1832
|
}));
|
|
1828
|
-
return (y, u) => (m(),
|
|
1833
|
+
return (y, u) => (m(), U("div", kl, [
|
|
1829
1834
|
L(w(Ct), {
|
|
1830
1835
|
class: "w-[140px] bg-white rounded-full h-[140px]",
|
|
1831
1836
|
"additional-options": r.value,
|
|
@@ -1833,14 +1838,14 @@ const It = { key: 1 }, Vt = {
|
|
|
1833
1838
|
"tooltip-value-formatter": () => null
|
|
1834
1839
|
}, null, 8, ["additional-options"]),
|
|
1835
1840
|
h("div", $l, [
|
|
1836
|
-
n.title ? (m(),
|
|
1841
|
+
n.title ? (m(), U("span", wl, Ne(n.title), 1)) : H("", !0),
|
|
1837
1842
|
je(y.$slots, "description", {}, () => [
|
|
1838
|
-
n.description ? (m(),
|
|
1843
|
+
n.description ? (m(), U("span", Sl, Ne(n.description), 1)) : H("", !0)
|
|
1839
1844
|
])
|
|
1840
1845
|
])
|
|
1841
1846
|
]));
|
|
1842
1847
|
}
|
|
1843
|
-
},
|
|
1848
|
+
}, El = it(
|
|
1844
1849
|
() => import("./OcCodeBlock-B_LpoG2V.js")
|
|
1845
1850
|
), Dl = it(
|
|
1846
1851
|
() => import("./OcLottieAnimation-BjY3rCjS.js")
|
|
@@ -1849,12 +1854,12 @@ export {
|
|
|
1849
1854
|
Al as BarChart,
|
|
1850
1855
|
Pl as BarRaceChart,
|
|
1851
1856
|
ql as Card,
|
|
1852
|
-
|
|
1857
|
+
El as CodeBlock,
|
|
1853
1858
|
Vt as ColorPicker,
|
|
1854
1859
|
xl as ColorPickerPopup,
|
|
1855
1860
|
Ml as LineChart,
|
|
1856
1861
|
Dl as LottieAnimation,
|
|
1857
|
-
|
|
1862
|
+
Ul as OnboardingProgressbar,
|
|
1858
1863
|
Ct as PieChart,
|
|
1859
1864
|
Rl as TextEditor
|
|
1860
1865
|
};
|