@orchidui/dashboard 1.8.1-77 → 1.8.1-79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Dashboard/Card/OcCard.js +3 -2
- package/dist/Dashboard/TextEditor/QuillEditor.js +1 -1
- package/dist/{OcCard-BpqC7suH.js → OcCard-BFYO-xBE.js} +1 -1
- package/dist/OcColorPicker-BZ3zytCj.js +128 -0
- package/dist/OcColorPickerPopup-sjvpeV8l.js +1127 -0
- package/dist/{OcLottieAnimation-EBkAB8-y.js → OcLottieAnimation-cF06yacT.js} +1 -1
- package/dist/OcOnboardingProgressbar-BsqF90Gn.js +77 -0
- package/dist/OcTextEditor-BWOvVmgS.js +522 -0
- package/dist/{QuillEditor-BHWfmp5D.js → QuillEditor-DbGwG5RB.js} +665 -689
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/index.js +28 -1848
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ref as r, computed as x, openBlock as u, createBlock as p, unref as s, normalizeClass as O, withCtx as i, createVNode as h, createCommentVNode as B, createSlots as F, renderSlot as k, createElementBlock as U, normalizeStyle as E } from "vue";
|
|
2
|
+
import { ColorPickerPopup as L } from "./index.js";
|
|
3
|
+
import { BaseInput as P, Dropdown as N, Input as $, Icon as D } from "@orchidui/core";
|
|
4
|
+
const z = { key: 1 }, X = {
|
|
5
|
+
__name: "OcColorPicker",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
variant: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "solid"
|
|
14
|
+
},
|
|
15
|
+
hideOpacity: Boolean,
|
|
16
|
+
hideInputColor: Boolean,
|
|
17
|
+
presetColors: {
|
|
18
|
+
type: Array
|
|
19
|
+
},
|
|
20
|
+
placement: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "auto"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:model-value"],
|
|
26
|
+
setup(a, { emit: C }) {
|
|
27
|
+
const m = a, v = C, d = r(!1), o = r(m.modelValue), f = (e) => {
|
|
28
|
+
e && (o.value = e, v("update:model-value", e));
|
|
29
|
+
}, S = x(() => m.variant === "gradient" ? {
|
|
30
|
+
class: "w-[20px] h-[20px] hide-svg-icon",
|
|
31
|
+
style: {
|
|
32
|
+
background: o.value
|
|
33
|
+
}
|
|
34
|
+
} : {
|
|
35
|
+
style: {
|
|
36
|
+
color: o.value
|
|
37
|
+
}
|
|
38
|
+
}), y = r(), l = r([]), c = () => {
|
|
39
|
+
l.value.length > 8 && (l.value = l.value.filter((e, n) => n < 8)), localStorage.setItem("ck-cp-local-color-list", JSON.stringify(l.value));
|
|
40
|
+
};
|
|
41
|
+
let g = localStorage.getItem("ck-cp-local-color-list");
|
|
42
|
+
g && (l.value = [...new Set(JSON.parse(g))], c());
|
|
43
|
+
const w = (e) => {
|
|
44
|
+
if (!e && o.value)
|
|
45
|
+
if (l.value.find((t) => t === o.value))
|
|
46
|
+
l.value = [
|
|
47
|
+
o.value,
|
|
48
|
+
...l.value.filter((t) => t !== o.value)
|
|
49
|
+
], c();
|
|
50
|
+
else {
|
|
51
|
+
l.value.length >= 9 && l.value.pop();
|
|
52
|
+
let t = o.value;
|
|
53
|
+
l.value.unshift(t), c();
|
|
54
|
+
}
|
|
55
|
+
}, V = r(!1), I = (e) => {
|
|
56
|
+
o.value = e, v("update:model-value", e), d.value = !1;
|
|
57
|
+
};
|
|
58
|
+
return (e, n) => (u(), p(s(P), {
|
|
59
|
+
class: O(a.hideInputColor ? "w-[40px]" : ""),
|
|
60
|
+
onClick: n[1] || (n[1] = () => {
|
|
61
|
+
var t;
|
|
62
|
+
return (t = y.value) == null ? void 0 : t.toggleDropdown();
|
|
63
|
+
})
|
|
64
|
+
}, {
|
|
65
|
+
default: i(() => [
|
|
66
|
+
h(s(N), {
|
|
67
|
+
ref_key: "dropdownRef",
|
|
68
|
+
ref: y,
|
|
69
|
+
modelValue: d.value,
|
|
70
|
+
"onUpdate:modelValue": [
|
|
71
|
+
n[0] || (n[0] = (t) => d.value = t),
|
|
72
|
+
w
|
|
73
|
+
],
|
|
74
|
+
"max-menu-height": 800,
|
|
75
|
+
placement: a.placement,
|
|
76
|
+
"popper-options": {
|
|
77
|
+
strategy: "fixed"
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
menu: i(() => [
|
|
81
|
+
V.value ? B("", !0) : (u(), p(s(L), {
|
|
82
|
+
key: 0,
|
|
83
|
+
variant: a.variant,
|
|
84
|
+
"show-alpha": !a.hideOpacity,
|
|
85
|
+
type: a.hideOpacity ? "HEX" : "HEX8",
|
|
86
|
+
"model-value": a.modelValue,
|
|
87
|
+
"last-used-colors": l.value,
|
|
88
|
+
"preset-colors": a.presetColors,
|
|
89
|
+
"onUpdate:modelValue": f,
|
|
90
|
+
onLastUsedPick: I
|
|
91
|
+
}, null, 8, ["variant", "show-alpha", "type", "model-value", "last-used-colors", "preset-colors"]))
|
|
92
|
+
]),
|
|
93
|
+
default: i(() => [
|
|
94
|
+
a.hideInputColor ? (u(), U("div", z, [
|
|
95
|
+
k(e.$slots, "picker-icon", {}, () => [
|
|
96
|
+
h(s(D), {
|
|
97
|
+
class: "cursor-pointer",
|
|
98
|
+
style: E(`color: ${o.value}`),
|
|
99
|
+
name: "drop"
|
|
100
|
+
}, null, 8, ["style"])
|
|
101
|
+
])
|
|
102
|
+
])) : (u(), p(s($), {
|
|
103
|
+
key: 0,
|
|
104
|
+
"model-value": o.value,
|
|
105
|
+
icon: "drop",
|
|
106
|
+
"icon-props": S.value,
|
|
107
|
+
placeholder: "#FFFFFF",
|
|
108
|
+
"onUpdate:modelValue": f
|
|
109
|
+
}, F({ _: 2 }, [
|
|
110
|
+
e.$slots.leading ? {
|
|
111
|
+
name: "leading",
|
|
112
|
+
fn: i(() => [
|
|
113
|
+
k(e.$slots, "leading")
|
|
114
|
+
]),
|
|
115
|
+
key: "0"
|
|
116
|
+
} : void 0
|
|
117
|
+
]), 1032, ["model-value", "icon-props"]))
|
|
118
|
+
]),
|
|
119
|
+
_: 3
|
|
120
|
+
}, 8, ["modelValue", "placement"])
|
|
121
|
+
]),
|
|
122
|
+
_: 3
|
|
123
|
+
}, 8, ["class"]));
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
X as default
|
|
128
|
+
};
|