vue-amazing-ui 2.2.11 → 2.2.13
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.iife.js +144 -69
- package/dist/index.js +4925 -4804
- package/dist/index.umd.cjs +139 -64
- package/dist/style.css +1 -1
- package/es/backtop/BackTop.css +1 -1
- package/es/backtop/BackTop.vue.js +1 -1
- package/es/backtop/BackTop.vue2.js +7 -7
- package/es/button/Button.css +1 -1
- package/es/button/Button.vue.js +2 -2
- package/es/button/Button.vue2.js +34 -34
- package/es/calendar/Calendar.css +1 -1
- package/es/calendar/Calendar.d.ts +6 -0
- package/es/calendar/Calendar.vue.js +2 -2
- package/es/calendar/Calendar.vue2.js +130 -126
- package/es/calendar/index.d.ts +9 -0
- package/es/collapse/Collapse.css +1 -1
- package/es/collapse/Collapse.vue.js +2 -2
- package/es/colorpicker/ColorPicker.css +1 -1
- package/es/colorpicker/ColorPicker.d.ts +4 -0
- package/es/colorpicker/ColorPicker.vue.js +2 -2
- package/es/colorpicker/ColorPicker.vue2.js +244 -234
- package/es/colorpicker/index.d.ts +6 -0
- package/es/floatbutton/FloatButton.css +1 -1
- package/es/floatbutton/FloatButton.vue.js +2 -2
- package/es/floatbutton/FloatButton.vue2.js +5 -3
- package/es/image/Image.css +1 -1
- package/es/image/Image.vue.js +1 -1
- package/es/image/Image.vue2.js +25 -21
- package/es/input/Input.css +1 -1
- package/es/input/Input.vue.js +2 -2
- package/es/input/Input.vue2.js +35 -29
- package/es/inputnumber/InputNumber.css +1 -1
- package/es/inputnumber/InputNumber.vue.js +2 -2
- package/es/inputnumber/InputNumber.vue2.js +41 -35
- package/es/inputsearch/InputSearch.css +1 -1
- package/es/inputsearch/InputSearch.vue.js +1 -1
- package/es/inputsearch/InputSearch.vue2.js +31 -25
- package/es/message/Message.css +1 -1
- package/es/message/Message.vue.js +2 -2
- package/es/message/Message.vue2.js +38 -32
- package/es/modal/Modal.css +1 -1
- package/es/modal/Modal.vue.js +1 -1
- package/es/modal/Modal.vue2.js +39 -29
- package/es/notification/Notification.css +1 -1
- package/es/notification/Notification.vue.js +1 -1
- package/es/notification/Notification.vue2.js +36 -27
- package/es/pagination/Pagination.css +1 -1
- package/es/pagination/Pagination.d.ts +5 -0
- package/es/pagination/Pagination.vue.js +1 -1
- package/es/pagination/Pagination.vue2.js +123 -103
- package/es/pagination/index.d.ts +7 -0
- package/es/popconfirm/Popconfirm.css +1 -1
- package/es/popconfirm/Popconfirm.vue.js +1 -1
- package/es/popconfirm/Popconfirm.vue2.js +20 -14
- package/es/progress/Progress.css +1 -1
- package/es/progress/Progress.vue.js +2 -2
- package/es/progress/Progress.vue2.js +13 -12
- package/es/qrcode/QRCode.css +1 -1
- package/es/qrcode/QRCode.vue.js +2 -2
- package/es/rate/Rate.css +1 -1
- package/es/rate/Rate.vue.js +2 -2
- package/es/rate/Rate.vue2.js +1 -1
- package/es/scrollbar/Scrollbar.css +1 -1
- package/es/scrollbar/Scrollbar.d.ts +1 -7
- package/es/scrollbar/Scrollbar.vue.js +2 -2
- package/es/scrollbar/index.d.ts +3 -21
- package/es/select/Select.css +1 -1
- package/es/select/Select.d.ts +2 -14
- package/es/select/Select.vue.js +2 -2
- package/es/select/Select.vue2.js +91 -82
- package/es/select/index.d.ts +2 -14
- package/es/slider/Slider.css +1 -1
- package/es/slider/Slider.vue.js +2 -2
- package/es/slider/Slider.vue2.js +18 -18
- package/es/spin/Spin.css +1 -1
- package/es/spin/Spin.vue.js +2 -2
- package/es/spin/Spin.vue2.js +32 -32
- package/es/steps/Steps.css +1 -1
- package/es/steps/Steps.vue.js +2 -2
- package/es/steps/Steps.vue2.js +22 -16
- package/es/style/global.css +1 -1
- package/es/switch/Switch.css +1 -1
- package/es/switch/Switch.vue.js +2 -2
- package/es/switch/Switch.vue2.js +19 -15
- package/es/table/Table.d.ts +4 -28
- package/es/table/index.d.ts +2 -14
- package/es/tabs/Tabs.css +1 -1
- package/es/tabs/Tabs.vue.js +2 -2
- package/es/tabs/Tabs.vue2.js +14 -13
- package/es/textarea/Textarea.css +1 -1
- package/es/textarea/Textarea.vue.js +4 -4
- package/es/textarea/Textarea.vue2.js +41 -35
- package/es/textscroll/TextScroll.css +1 -1
- package/es/textscroll/TextScroll.vue.js +1 -1
- package/es/textscroll/TextScroll.vue2.js +71 -71
- package/es/upload/Upload.css +1 -1
- package/es/upload/Upload.vue.js +1 -1
- package/es/upload/Upload.vue2.js +35 -30
- package/lib/backtop/BackTop.css +1 -1
- package/lib/backtop/BackTop.vue.cjs +1 -1
- package/lib/backtop/BackTop.vue2.cjs +1 -1
- package/lib/button/Button.css +1 -1
- package/lib/button/Button.vue.cjs +1 -1
- package/lib/button/Button.vue2.cjs +11 -11
- package/lib/calendar/Calendar.css +1 -1
- package/lib/calendar/Calendar.d.ts +6 -0
- package/lib/calendar/Calendar.vue.cjs +1 -1
- package/lib/calendar/Calendar.vue2.cjs +5 -1
- package/lib/calendar/index.d.ts +9 -0
- package/lib/collapse/Collapse.css +1 -1
- package/lib/collapse/Collapse.vue.cjs +1 -1
- package/lib/colorpicker/ColorPicker.css +1 -1
- package/lib/colorpicker/ColorPicker.d.ts +4 -0
- package/lib/colorpicker/ColorPicker.vue.cjs +1 -1
- package/lib/colorpicker/ColorPicker.vue2.cjs +10 -3
- package/lib/colorpicker/index.d.ts +6 -0
- package/lib/floatbutton/FloatButton.css +1 -1
- package/lib/floatbutton/FloatButton.vue.cjs +1 -1
- package/lib/floatbutton/FloatButton.vue2.cjs +4 -2
- package/lib/image/Image.css +1 -1
- package/lib/image/Image.vue.cjs +1 -1
- package/lib/image/Image.vue2.cjs +1 -1
- package/lib/input/Input.css +1 -1
- package/lib/input/Input.vue.cjs +1 -1
- package/lib/input/Input.vue2.cjs +6 -1
- package/lib/inputnumber/InputNumber.css +1 -1
- package/lib/inputnumber/InputNumber.vue.cjs +1 -1
- package/lib/inputnumber/InputNumber.vue2.cjs +7 -1
- package/lib/inputsearch/InputSearch.css +1 -1
- package/lib/inputsearch/InputSearch.vue.cjs +1 -1
- package/lib/inputsearch/InputSearch.vue2.cjs +6 -1
- package/lib/message/Message.css +1 -1
- package/lib/message/Message.vue.cjs +1 -1
- package/lib/message/Message.vue2.cjs +7 -1
- package/lib/modal/Modal.css +1 -1
- package/lib/modal/Modal.vue.cjs +1 -1
- package/lib/modal/Modal.vue2.cjs +8 -1
- package/lib/notification/Notification.css +1 -1
- package/lib/notification/Notification.vue.cjs +1 -1
- package/lib/notification/Notification.vue2.cjs +6 -1
- package/lib/pagination/Pagination.css +1 -1
- package/lib/pagination/Pagination.d.ts +5 -0
- package/lib/pagination/Pagination.vue.cjs +1 -1
- package/lib/pagination/Pagination.vue2.cjs +1 -1
- package/lib/pagination/index.d.ts +7 -0
- package/lib/popconfirm/Popconfirm.css +1 -1
- package/lib/popconfirm/Popconfirm.vue.cjs +1 -1
- package/lib/popconfirm/Popconfirm.vue2.cjs +6 -1
- package/lib/progress/Progress.css +1 -1
- package/lib/progress/Progress.vue.cjs +1 -1
- package/lib/progress/Progress.vue2.cjs +5 -4
- package/lib/qrcode/QRCode.css +1 -1
- package/lib/qrcode/QRCode.vue.cjs +1 -1
- package/lib/rate/Rate.css +1 -1
- package/lib/rate/Rate.vue.cjs +1 -1
- package/lib/rate/Rate.vue2.cjs +1 -1
- package/lib/scrollbar/Scrollbar.css +1 -1
- package/lib/scrollbar/Scrollbar.d.ts +1 -7
- package/lib/scrollbar/Scrollbar.vue.cjs +1 -1
- package/lib/scrollbar/index.d.ts +3 -21
- package/lib/select/Select.css +1 -1
- package/lib/select/Select.d.ts +2 -14
- package/lib/select/Select.vue.cjs +1 -1
- package/lib/select/Select.vue2.cjs +8 -1
- package/lib/select/index.d.ts +2 -14
- package/lib/slider/Slider.css +1 -1
- package/lib/slider/Slider.vue.cjs +1 -1
- package/lib/slider/Slider.vue2.cjs +20 -20
- package/lib/spin/Spin.css +1 -1
- package/lib/spin/Spin.vue.cjs +1 -1
- package/lib/spin/Spin.vue2.cjs +2 -2
- package/lib/steps/Steps.css +1 -1
- package/lib/steps/Steps.vue.cjs +1 -1
- package/lib/steps/Steps.vue2.cjs +7 -1
- package/lib/style/global.css +1 -1
- package/lib/switch/Switch.css +1 -1
- package/lib/switch/Switch.vue.cjs +1 -1
- package/lib/switch/Switch.vue2.cjs +5 -1
- package/lib/table/Table.d.ts +4 -28
- package/lib/table/index.d.ts +2 -14
- package/lib/tabs/Tabs.css +1 -1
- package/lib/tabs/Tabs.vue.cjs +1 -1
- package/lib/tabs/Tabs.vue2.cjs +1 -1
- package/lib/textarea/Textarea.css +1 -1
- package/lib/textarea/Textarea.vue.cjs +1 -1
- package/lib/textarea/Textarea.vue2.cjs +6 -1
- package/lib/textscroll/TextScroll.css +1 -1
- package/lib/textscroll/TextScroll.vue.cjs +1 -1
- package/lib/textscroll/TextScroll.vue2.cjs +18 -18
- package/lib/upload/Upload.css +1 -1
- package/lib/upload/Upload.vue.cjs +1 -1
- package/lib/upload/Upload.vue2.cjs +1 -1
- package/package.json +3 -2
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { toRgbaString as z, toHexString as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useSlotsExist as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as Sl, ref as A, computed as d, watch as Ie, watchEffect as Al, createBlock as J, openBlock as b, unref as T, normalizeStyle as p, withCtx as se, createElementVNode as n, mergeProps as me, createElementBlock as R, createCommentVNode as H, renderSlot as Le, createTextVNode as ne, toDisplayString as ge, Fragment as be, normalizeClass as Ml, withModifiers as Cl, renderList as Ne } from "vue";
|
|
2
|
+
import { toRgbaString as z, toHexString as K, rgba as U, rgb2hsv as ke, hsla as G, hsl2hsv as Be, hsva as F, hsl2rgb as ye, hsv2rgb as N, rgb2hsl as we, hsv2hsl as ue, toHexaString as B, toHslaString as _, toRgbString as $e, toHslString as Se, toHsvaString as X, toHsvString as Ae } from "seemly";
|
|
3
|
+
import Rl from "../tooltip/index.js";
|
|
4
|
+
import _e from "../input/index.js";
|
|
5
|
+
import Pe from "../button/index.js";
|
|
6
|
+
import { useSlotsExist as Hl } from "../utils/index.js";
|
|
7
|
+
const El = { class: "color-picker-preview" }, zl = { class: "color-picker-preview-sliders" }, Ul = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "color-picker-preview-circle"
|
|
10
|
-
},
|
|
10
|
+
}, xl = ["value"], Vl = { class: "color-picker-input" }, Il = { class: "color-picker-input-group" }, Ll = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "color-picker-swatches"
|
|
13
|
-
},
|
|
13
|
+
}, Nl = ["onClick"], Bl = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "color-picker-actions"
|
|
16
|
-
},
|
|
16
|
+
}, _l = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "color-picker-footer"
|
|
19
|
-
},
|
|
19
|
+
}, Pl = { class: "color-picker-wrap" }, Dl = { class: "color-picker-fill" }, k = "12px", De = 12, f = "6px", Fl = 6, Yl = /* @__PURE__ */ Sl({
|
|
20
20
|
__name: "ColorPicker",
|
|
21
21
|
props: {
|
|
22
|
+
width: { default: "100%" },
|
|
22
23
|
label: { type: Function, default: void 0 },
|
|
23
24
|
tooltipStyle: { default: () => ({}) },
|
|
25
|
+
inputProps: { default: () => ({}) },
|
|
24
26
|
showAlpha: { type: Boolean, default: !0 },
|
|
25
27
|
showPreview: { type: Boolean, default: !1 },
|
|
26
28
|
size: { default: "middle" },
|
|
@@ -32,233 +34,233 @@ const Hl = { class: "color-picker-preview" }, El = { class: "color-picker-previe
|
|
|
32
34
|
footer: { default: void 0 }
|
|
33
35
|
},
|
|
34
36
|
emits: ["update:value", "complete", "confirm", "clear"],
|
|
35
|
-
setup(Fe, { emit:
|
|
36
|
-
const
|
|
37
|
+
setup(Fe, { emit: Xe }) {
|
|
38
|
+
const s = Fe, ie = A(), Q = A(null), ee = A(null), le = A(null), E = A(0), ce = A(1), te = A([0, 0]), W = A(), i = A(s.value), m = A(oe(i.value) || s.modes[0] || "rgb"), re = A(), x = A([]), P = Xe, Oe = Hl("footer"), Ze = d(() => Oe.value || s.footer), Te = d(() => ({
|
|
37
39
|
width: k,
|
|
38
40
|
height: k,
|
|
39
41
|
borderRadius: f,
|
|
40
42
|
left: `calc(${te.value[0]}% - ${f})`,
|
|
41
43
|
bottom: `calc(${te.value[1]}% - ${f})`
|
|
42
|
-
})),
|
|
43
|
-
backgroundColor:
|
|
44
|
+
})), Ge = d(() => h.value ? `rgb(${h.value[0]}, ${h.value[1]}, ${h.value[2]})` : ""), We = d(() => ({
|
|
45
|
+
backgroundColor: Ge.value,
|
|
44
46
|
borderRadius: f,
|
|
45
47
|
width: k,
|
|
46
48
|
height: k
|
|
47
|
-
})),
|
|
49
|
+
})), Me = d(() => ({
|
|
48
50
|
height: k,
|
|
49
51
|
borderRadius: f
|
|
50
|
-
})), Ye =
|
|
52
|
+
})), Ye = d(() => ({
|
|
51
53
|
position: "relative",
|
|
52
54
|
boxShadow: "inset 0 0 2px 0 rgba(0, 0, 0, 0.24)",
|
|
53
55
|
backgroundImage: "linear-gradient(90deg, red, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, red)",
|
|
54
56
|
height: k,
|
|
55
57
|
borderRadius: f
|
|
56
|
-
})), je =
|
|
58
|
+
})), je = d(() => ({
|
|
57
59
|
left: `calc((${E.value}%) / 359 * 100 - ${f})`,
|
|
58
60
|
borderRadius: f,
|
|
59
61
|
width: k,
|
|
60
62
|
height: k
|
|
61
|
-
})), qe =
|
|
63
|
+
})), qe = d(() => ({
|
|
62
64
|
backgroundColor: `hsl(${E.value}, 100%, 50%)`,
|
|
63
65
|
borderRadius: f,
|
|
64
66
|
width: k,
|
|
65
67
|
height: k
|
|
66
|
-
})), Je =
|
|
68
|
+
})), Je = d(() => h.value ? `linear-gradient(to right, rgba(${h.value[0]}, ${h.value[1]}, ${h.value[2]}, 0) 0%, rgba(${h.value[0]}, ${h.value[1]}, ${h.value[2]}, 1) 100%)` : ""), Ke = d(() => ({
|
|
67
69
|
left: `calc(${ce.value * 100}% - ${f})`,
|
|
68
70
|
borderRadius: f,
|
|
69
71
|
width: k,
|
|
70
72
|
height: k
|
|
71
|
-
})), Qe =
|
|
72
|
-
backgroundColor:
|
|
73
|
+
})), Qe = d(() => ({
|
|
74
|
+
backgroundColor: h.value ? z(h.value) : void 0,
|
|
73
75
|
borderRadius: f,
|
|
74
76
|
width: k,
|
|
75
77
|
height: k
|
|
76
|
-
})),
|
|
78
|
+
})), Ce = d(() => h.value && K(h.value)), Re = d(() => typeof s.width == "number" ? `${s.width}px` : s.width), de = d(() => `${{
|
|
77
79
|
small: 24,
|
|
78
80
|
middle: 32,
|
|
79
81
|
large: 40
|
|
80
|
-
}[
|
|
82
|
+
}[s.size]}px`), el = d(() => {
|
|
81
83
|
const e = {
|
|
82
84
|
small: 6,
|
|
83
85
|
middle: 8,
|
|
84
86
|
large: 10
|
|
85
87
|
};
|
|
86
|
-
return `calc((${de.value} - ${e[
|
|
87
|
-
}), ve =
|
|
88
|
+
return `calc((${de.value} - ${e[s.size]}px) / 3)`;
|
|
89
|
+
}), ve = d(() => oe(i.value)), Y = d(() => m.value.toUpperCase() + (s.showAlpha ? "A" : "")), ll = d(() => Y.value.split(""));
|
|
88
90
|
let y, w, O, Z, V, I, L, $;
|
|
89
|
-
const M =
|
|
91
|
+
const M = d(() => {
|
|
90
92
|
if (!i.value) return null;
|
|
91
93
|
switch (ve.value) {
|
|
92
94
|
case "hsv":
|
|
93
|
-
return
|
|
95
|
+
return F(i.value);
|
|
94
96
|
case "hsl":
|
|
95
|
-
return [y, w, O, $] = G(i.value), [...
|
|
97
|
+
return [y, w, O, $] = G(i.value), [...Be(y, w, O), $];
|
|
96
98
|
case "rgb":
|
|
97
99
|
case "hex":
|
|
98
|
-
return [V, I, L, $] = U(i.value), [...
|
|
100
|
+
return [V, I, L, $] = U(i.value), [...ke(V, I, L), $];
|
|
99
101
|
}
|
|
100
|
-
}),
|
|
102
|
+
}), h = d(() => {
|
|
101
103
|
if (!i.value) return null;
|
|
102
104
|
switch (ve.value) {
|
|
103
105
|
case "rgb":
|
|
104
106
|
case "hex":
|
|
105
107
|
return U(i.value);
|
|
106
108
|
case "hsv":
|
|
107
|
-
return [y, w, Z, $] =
|
|
109
|
+
return [y, w, Z, $] = F(i.value), [...N(y, w, Z), $];
|
|
108
110
|
case "hsl":
|
|
109
|
-
return [y, w, O, $] = G(i.value), [...
|
|
111
|
+
return [y, w, O, $] = G(i.value), [...ye(y, w, O), $];
|
|
110
112
|
}
|
|
111
|
-
}),
|
|
113
|
+
}), D = d(() => {
|
|
112
114
|
if (!i.value) return null;
|
|
113
115
|
switch (ve.value) {
|
|
114
116
|
case "hsl":
|
|
115
117
|
return G(i.value);
|
|
116
118
|
case "hsv":
|
|
117
|
-
return [y, w, Z, $] =
|
|
119
|
+
return [y, w, Z, $] = F(i.value), [...ue(y, w, Z), $];
|
|
118
120
|
case "rgb":
|
|
119
121
|
case "hex":
|
|
120
|
-
return [V, I, L, $] = U(i.value), [...
|
|
122
|
+
return [V, I, L, $] = U(i.value), [...we(V, I, L), $];
|
|
121
123
|
}
|
|
122
|
-
}), C =
|
|
124
|
+
}), C = d(() => {
|
|
123
125
|
switch (m.value) {
|
|
124
126
|
case "rgb":
|
|
125
127
|
case "hex":
|
|
126
|
-
return
|
|
128
|
+
return h.value;
|
|
127
129
|
case "hsv":
|
|
128
130
|
return M.value;
|
|
129
131
|
case "hsl":
|
|
130
|
-
return
|
|
132
|
+
return D.value;
|
|
131
133
|
}
|
|
132
|
-
}),
|
|
133
|
-
() =>
|
|
134
|
+
}), He = d(
|
|
135
|
+
() => s.swatches.map((e) => {
|
|
134
136
|
const l = oe(e);
|
|
135
137
|
return {
|
|
136
138
|
value: e,
|
|
137
139
|
mode: l,
|
|
138
|
-
legalValue:
|
|
140
|
+
legalValue: gl(e, l)
|
|
139
141
|
};
|
|
140
142
|
})
|
|
141
143
|
);
|
|
142
|
-
|
|
143
|
-
() =>
|
|
144
|
+
Ie(
|
|
145
|
+
() => s.value,
|
|
144
146
|
(e) => {
|
|
145
147
|
i.value = e;
|
|
146
148
|
}
|
|
147
|
-
),
|
|
149
|
+
), Ie(
|
|
148
150
|
() => [m.value, C.value],
|
|
149
151
|
() => {
|
|
150
|
-
m.value === "hex" ? re.value = C.value === null ? void 0 : (
|
|
152
|
+
m.value === "hex" ? re.value = C.value === null ? void 0 : (s.showAlpha ? B : K)(C.value) : C.value === null ? x.value = new Array(s.showAlpha ? 4 : 3).fill(void 0) : x.value = C.value.map((e, l) => s.showAlpha && l === 3 ? `${Math.floor(e * 100)}%` : `${Math.floor(e)}`);
|
|
151
153
|
},
|
|
152
154
|
{
|
|
153
155
|
immediate: !0,
|
|
154
156
|
deep: !0
|
|
155
157
|
}
|
|
156
|
-
),
|
|
157
|
-
(
|
|
158
|
+
), Al(() => {
|
|
159
|
+
(W.value === void 0 || W.value !== i.value) && M.value && (E.value = M.value[0], ce.value = M.value[3], te.value = [M.value[1], M.value[2]]), W.value = void 0;
|
|
158
160
|
});
|
|
159
161
|
function g(e, l) {
|
|
160
|
-
l === "cursor" ?
|
|
162
|
+
l === "cursor" ? W.value = e : W.value = void 0, i.value = e, P("update:value", e), l === "input" && P("complete", e);
|
|
161
163
|
}
|
|
162
|
-
function
|
|
164
|
+
function tl(e, l) {
|
|
163
165
|
const t = M.value ? M.value[3] : 1;
|
|
164
166
|
switch (te.value = [e, l], m.value) {
|
|
165
167
|
case "hsv":
|
|
166
|
-
g((
|
|
168
|
+
g((s.showAlpha ? X : Ae)([E.value, e, l, t]), "cursor");
|
|
167
169
|
break;
|
|
168
170
|
case "hsl":
|
|
169
171
|
g(
|
|
170
|
-
(
|
|
172
|
+
(s.showAlpha ? _ : Se)([...ue(E.value, e, l), t]),
|
|
171
173
|
"cursor"
|
|
172
174
|
);
|
|
173
175
|
break;
|
|
174
176
|
case "rgb":
|
|
175
177
|
g(
|
|
176
|
-
(
|
|
178
|
+
(s.showAlpha ? z : $e)([...N(E.value, e, l), t]),
|
|
177
179
|
"cursor"
|
|
178
180
|
);
|
|
179
181
|
break;
|
|
180
182
|
case "hex":
|
|
181
183
|
g(
|
|
182
|
-
(
|
|
184
|
+
(s.showAlpha ? B : K)([...N(E.value, e, l), t]),
|
|
183
185
|
"cursor"
|
|
184
186
|
);
|
|
185
187
|
break;
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
190
|
+
function rl(e) {
|
|
191
|
+
Q.value && (document.addEventListener("mousemove", he), document.addEventListener("mouseup", Ee), he(e));
|
|
190
192
|
}
|
|
191
193
|
function he(e) {
|
|
192
|
-
if (!
|
|
193
|
-
const { width: l, height: t, left: o, bottom: S } =
|
|
194
|
-
|
|
194
|
+
if (!Q.value) return;
|
|
195
|
+
const { width: l, height: t, left: o, bottom: S } = Q.value.getBoundingClientRect(), r = (S - e.clientY) / t, a = (e.clientX - o) / l, u = 100 * (a > 1 ? 1 : a < 0 ? 0 : a), c = 100 * (r > 1 ? 1 : r < 0 ? 0 : r);
|
|
196
|
+
tl(u, c);
|
|
195
197
|
}
|
|
196
|
-
function
|
|
197
|
-
document.removeEventListener("mousemove", he), document.removeEventListener("mouseup",
|
|
198
|
+
function Ee() {
|
|
199
|
+
document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", Ee), P("complete", i.value);
|
|
198
200
|
}
|
|
199
|
-
function
|
|
201
|
+
function ol(e) {
|
|
200
202
|
if (E.value = e, !M.value)
|
|
201
203
|
return;
|
|
202
204
|
const [, l, t, o] = M.value;
|
|
203
205
|
switch (m.value) {
|
|
204
206
|
case "hsv":
|
|
205
|
-
g((
|
|
207
|
+
g((s.showAlpha ? X : Ae)([e, l, t, o]), "cursor");
|
|
206
208
|
break;
|
|
207
209
|
case "rgb":
|
|
208
|
-
g((
|
|
210
|
+
g((s.showAlpha ? z : $e)([...N(e, l, t), o]), "cursor");
|
|
209
211
|
break;
|
|
210
212
|
case "hex":
|
|
211
|
-
g((
|
|
213
|
+
g((s.showAlpha ? B : K)([...N(e, l, t), o]), "cursor");
|
|
212
214
|
break;
|
|
213
215
|
case "hsl":
|
|
214
|
-
g((
|
|
216
|
+
g((s.showAlpha ? _ : Se)([...ue(e, l, t), o]), "cursor");
|
|
215
217
|
break;
|
|
216
218
|
}
|
|
217
219
|
}
|
|
218
|
-
function ol(e) {
|
|
219
|
-
ee.value && (document.addEventListener("mousemove", pe), document.addEventListener("mouseup", He), pe(e));
|
|
220
|
-
}
|
|
221
220
|
function al(e) {
|
|
221
|
+
ee.value && (document.addEventListener("mousemove", pe), document.addEventListener("mouseup", ze), pe(e));
|
|
222
|
+
}
|
|
223
|
+
function sl(e) {
|
|
222
224
|
return e = Math.round(e), e >= 360 ? 359 : e < 0 ? 0 : e;
|
|
223
225
|
}
|
|
224
226
|
function pe(e) {
|
|
225
227
|
if (!ee.value) return;
|
|
226
|
-
const { width: l, left: t } = ee.value.getBoundingClientRect(), o =
|
|
227
|
-
|
|
228
|
+
const { width: l, left: t } = ee.value.getBoundingClientRect(), o = sl((e.clientX - t - Fl) / (l - De) * 360);
|
|
229
|
+
ol(o);
|
|
228
230
|
}
|
|
229
|
-
function
|
|
230
|
-
document.removeEventListener("mousemove", pe), document.removeEventListener("mouseup",
|
|
231
|
+
function ze() {
|
|
232
|
+
document.removeEventListener("mousemove", pe), document.removeEventListener("mouseup", ze), P("complete", i.value);
|
|
231
233
|
}
|
|
232
|
-
function
|
|
234
|
+
function nl(e) {
|
|
233
235
|
switch (m.value) {
|
|
234
236
|
case "hsv":
|
|
235
237
|
[y, w, Z] = M.value, g(X([y, w, Z, e]), "cursor");
|
|
236
238
|
break;
|
|
237
239
|
case "rgb":
|
|
238
|
-
[V, I, L] =
|
|
240
|
+
[V, I, L] = h.value, g(z([V, I, L, e]), "cursor");
|
|
239
241
|
break;
|
|
240
242
|
case "hex":
|
|
241
|
-
[V, I, L] =
|
|
243
|
+
[V, I, L] = h.value, g(B([V, I, L, e]), "cursor");
|
|
242
244
|
break;
|
|
243
245
|
case "hsl":
|
|
244
|
-
[y, w, O] =
|
|
246
|
+
[y, w, O] = D.value, g(_([y, w, O, e]), "cursor");
|
|
245
247
|
break;
|
|
246
248
|
}
|
|
247
249
|
ce.value = e;
|
|
248
250
|
}
|
|
249
|
-
function nl(e) {
|
|
250
|
-
!le.value || !p.value || (document.addEventListener("mousemove", fe), document.addEventListener("mouseup", Ee), fe(e));
|
|
251
|
-
}
|
|
252
251
|
function ul(e) {
|
|
252
|
+
!le.value || !h.value || (document.addEventListener("mousemove", fe), document.addEventListener("mouseup", Ue), fe(e));
|
|
253
|
+
}
|
|
254
|
+
function il(e) {
|
|
253
255
|
return e = Math.round(e * 100) / 100, e > 1 ? 1 : e < 0 ? 0 : e;
|
|
254
256
|
}
|
|
255
257
|
function fe(e) {
|
|
256
258
|
if (!le.value) return;
|
|
257
|
-
const { width: l, left: t } = le.value.getBoundingClientRect(), o =
|
|
258
|
-
|
|
259
|
+
const { width: l, left: t } = le.value.getBoundingClientRect(), o = il((e.clientX - t) / (l - De));
|
|
260
|
+
nl(o);
|
|
259
261
|
}
|
|
260
|
-
function
|
|
261
|
-
document.removeEventListener("mousemove", fe), document.removeEventListener("mouseup",
|
|
262
|
+
function Ue() {
|
|
263
|
+
document.removeEventListener("mousemove", fe), document.removeEventListener("mouseup", Ue), P("complete", i.value);
|
|
262
264
|
}
|
|
263
265
|
function oe(e) {
|
|
264
266
|
if (e !== void 0) {
|
|
@@ -268,108 +270,108 @@ const Hl = { class: "color-picker-preview" }, El = { class: "color-picker-previe
|
|
|
268
270
|
if (e.includes("hsv")) return "hsv";
|
|
269
271
|
}
|
|
270
272
|
}
|
|
271
|
-
function
|
|
272
|
-
const e =
|
|
273
|
-
e !== -1 ? m.value =
|
|
273
|
+
function cl() {
|
|
274
|
+
const e = s.modes.findIndex((l) => l === m.value);
|
|
275
|
+
e !== -1 ? m.value = s.modes[(e + 1) % s.modes.length] : m.value = "rgb";
|
|
274
276
|
}
|
|
275
|
-
function
|
|
276
|
-
const l = e.target, t =
|
|
277
|
+
function dl(e) {
|
|
278
|
+
const l = e.target, t = Ve(l.value.toUpperCase(), m.value, "hex");
|
|
277
279
|
g(t, "input");
|
|
278
280
|
}
|
|
279
|
-
function
|
|
281
|
+
function vl(e) {
|
|
280
282
|
const l = e.trim();
|
|
281
283
|
return /^#[0-9a-fA-F]+$/.test(l) ? [4, 5, 7, 9].includes(l.length) : !1;
|
|
282
284
|
}
|
|
283
|
-
function
|
|
285
|
+
function hl(e) {
|
|
284
286
|
return /^\d{1,3}\.?\d*$/.test(e.trim()) ? Math.max(0, Math.min(Number.parseInt(e), 360)) : !1;
|
|
285
287
|
}
|
|
286
|
-
function
|
|
288
|
+
function pl(e) {
|
|
287
289
|
return /^\d{1,3}\.?\d*$/.test(e.trim()) ? Math.max(0, Math.min(Number.parseInt(e), 100)) : !1;
|
|
288
290
|
}
|
|
289
|
-
function
|
|
291
|
+
function fl(e) {
|
|
290
292
|
return /^\d{1,3}\.?\d*%$/.test(e.trim()) ? Math.max(0, Math.min(Number.parseInt(e) / 100, 100)) : !1;
|
|
291
293
|
}
|
|
292
|
-
function
|
|
294
|
+
function ml(e) {
|
|
293
295
|
return /^\d{1,3}\.?\d*$/.test(e.trim()) ? Math.max(0, Math.min(Number.parseInt(e), 255)) : !1;
|
|
294
296
|
}
|
|
295
|
-
function
|
|
297
|
+
function j(e, l) {
|
|
296
298
|
return e === void 0 ? "" : l === "HEX" || l === "HEXA" ? e : l === "A" ? `${Math.floor(Number(e) * 100)}%` : String(Math.floor(Number(e)));
|
|
297
299
|
}
|
|
298
300
|
function ae(e) {
|
|
299
301
|
g(e, "input");
|
|
300
302
|
}
|
|
301
|
-
function
|
|
303
|
+
function q(e, l) {
|
|
302
304
|
if (m.value === "hex") {
|
|
303
|
-
ae((
|
|
305
|
+
ae((s.showAlpha ? B : K)(l));
|
|
304
306
|
return;
|
|
305
307
|
}
|
|
306
308
|
let t;
|
|
307
309
|
switch (C.value === null ? t = [0, 0, 0, 0] : t = [...C.value], m.value) {
|
|
308
310
|
case "hsv":
|
|
309
|
-
t[e] = l, ae((
|
|
311
|
+
t[e] = l, ae((s.showAlpha ? X : Ae)(t));
|
|
310
312
|
break;
|
|
311
313
|
case "rgb":
|
|
312
|
-
t[e] = l, ae((
|
|
314
|
+
t[e] = l, ae((s.showAlpha ? z : $e)(t));
|
|
313
315
|
break;
|
|
314
316
|
case "hsl":
|
|
315
|
-
t[e] = l, ae((
|
|
317
|
+
t[e] = l, ae((s.showAlpha ? _ : Se)(t));
|
|
316
318
|
break;
|
|
317
319
|
}
|
|
318
320
|
}
|
|
319
|
-
function
|
|
320
|
-
var c,
|
|
321
|
+
function xe(e, l) {
|
|
322
|
+
var c, v;
|
|
321
323
|
const t = e.target;
|
|
322
324
|
let o, S, r;
|
|
323
325
|
const a = t.value;
|
|
324
|
-
l === void 0 ? r = C.value === null ? void 0 : C.value : r = ((c = C.value) == null ? void 0 : c[l]) === void 0 || (
|
|
325
|
-
const
|
|
326
|
-
switch (
|
|
326
|
+
l === void 0 ? r = C.value === null ? void 0 : C.value : r = ((c = C.value) == null ? void 0 : c[l]) === void 0 || (v = C.value) == null ? void 0 : v[l].toString();
|
|
327
|
+
const u = l === void 0 ? Y.value : Y.value[l];
|
|
328
|
+
switch (u) {
|
|
327
329
|
case "HEX":
|
|
328
330
|
case "HEXA":
|
|
329
|
-
S =
|
|
331
|
+
S = vl(a), S && q(0, a), re.value = j(a, u);
|
|
330
332
|
break;
|
|
331
333
|
case "H":
|
|
332
|
-
o =
|
|
334
|
+
o = hl(a), o === !1 ? x.value[l] = j(r, u) : q(l, o);
|
|
333
335
|
break;
|
|
334
336
|
case "S":
|
|
335
337
|
case "L":
|
|
336
338
|
case "V":
|
|
337
|
-
o =
|
|
339
|
+
o = pl(a), o === !1 ? x.value[l] = j(r, u) : q(l, o);
|
|
338
340
|
break;
|
|
339
341
|
case "A":
|
|
340
|
-
o =
|
|
342
|
+
o = fl(a), o === !1 ? x.value[l] = j(r, u) : q(l, o);
|
|
341
343
|
break;
|
|
342
344
|
case "R":
|
|
343
345
|
case "G":
|
|
344
346
|
case "B":
|
|
345
|
-
o =
|
|
347
|
+
o = ml(a), o === !1 ? x.value[l] = j(r, u) : q(l, o);
|
|
346
348
|
break;
|
|
347
349
|
}
|
|
348
350
|
}
|
|
349
|
-
function
|
|
351
|
+
function gl(e, l) {
|
|
350
352
|
if (l === "hsv") {
|
|
351
|
-
const [t, o, S, r] =
|
|
353
|
+
const [t, o, S, r] = F(e);
|
|
352
354
|
return z([...N(t, o, S), r]);
|
|
353
355
|
}
|
|
354
356
|
return e;
|
|
355
357
|
}
|
|
356
|
-
function
|
|
358
|
+
function bl(e) {
|
|
357
359
|
const l = document.createElement("canvas").getContext("2d");
|
|
358
360
|
return l ? (l.fillStyle = e, l.fillStyle) : "#000000";
|
|
359
361
|
}
|
|
360
|
-
function
|
|
362
|
+
function Ve(e, l, t) {
|
|
361
363
|
return t = t || oe(e), t ? t === l ? e : {
|
|
362
364
|
rgb: {
|
|
363
365
|
hex(r) {
|
|
364
366
|
return B(U(r));
|
|
365
367
|
},
|
|
366
368
|
hsl(r) {
|
|
367
|
-
const [a,
|
|
368
|
-
return _([...
|
|
369
|
+
const [a, u, c, v] = U(r);
|
|
370
|
+
return _([...we(a, u, c), v]);
|
|
369
371
|
},
|
|
370
372
|
hsv(r) {
|
|
371
|
-
const [a,
|
|
372
|
-
return X([...
|
|
373
|
+
const [a, u, c, v] = U(r);
|
|
374
|
+
return X([...ke(a, u, c), v]);
|
|
373
375
|
}
|
|
374
376
|
},
|
|
375
377
|
hex: {
|
|
@@ -377,61 +379,61 @@ const Hl = { class: "color-picker-preview" }, El = { class: "color-picker-previe
|
|
|
377
379
|
return z(U(r));
|
|
378
380
|
},
|
|
379
381
|
hsl(r) {
|
|
380
|
-
const [a,
|
|
381
|
-
return _([...
|
|
382
|
+
const [a, u, c, v] = U(r);
|
|
383
|
+
return _([...we(a, u, c), v]);
|
|
382
384
|
},
|
|
383
385
|
hsv(r) {
|
|
384
|
-
const [a,
|
|
385
|
-
return X([...
|
|
386
|
+
const [a, u, c, v] = U(r);
|
|
387
|
+
return X([...ke(a, u, c), v]);
|
|
386
388
|
}
|
|
387
389
|
},
|
|
388
390
|
hsl: {
|
|
389
391
|
hex(r) {
|
|
390
|
-
const [a,
|
|
391
|
-
return B([...
|
|
392
|
+
const [a, u, c, v] = G(r);
|
|
393
|
+
return B([...ye(a, u, c), v]);
|
|
392
394
|
},
|
|
393
395
|
rgb(r) {
|
|
394
|
-
const [a,
|
|
395
|
-
return z([...
|
|
396
|
+
const [a, u, c, v] = G(r);
|
|
397
|
+
return z([...ye(a, u, c), v]);
|
|
396
398
|
},
|
|
397
399
|
hsv(r) {
|
|
398
|
-
const [a,
|
|
399
|
-
return X([...
|
|
400
|
+
const [a, u, c, v] = G(r);
|
|
401
|
+
return X([...Be(a, u, c), v]);
|
|
400
402
|
}
|
|
401
403
|
},
|
|
402
404
|
hsv: {
|
|
403
405
|
hex(r) {
|
|
404
|
-
const [a,
|
|
405
|
-
return B([...N(a,
|
|
406
|
+
const [a, u, c, v] = F(r);
|
|
407
|
+
return B([...N(a, u, c), v]);
|
|
406
408
|
},
|
|
407
409
|
rgb(r) {
|
|
408
|
-
const [a,
|
|
409
|
-
return z([...N(a,
|
|
410
|
+
const [a, u, c, v] = F(r);
|
|
411
|
+
return z([...N(a, u, c), v]);
|
|
410
412
|
},
|
|
411
413
|
hsl(r) {
|
|
412
|
-
const [a,
|
|
413
|
-
return _([...ue(a,
|
|
414
|
+
const [a, u, c, v] = F(r);
|
|
415
|
+
return _([...ue(a, u, c), v]);
|
|
414
416
|
}
|
|
415
417
|
}
|
|
416
418
|
}[t][l](e) : void 0;
|
|
417
419
|
}
|
|
418
|
-
function bl(e) {
|
|
419
|
-
let { value: l, mode: t } = e;
|
|
420
|
-
return t || (t = "hex", /^[a-zA-Z]+$/.test(l) ? l = gl(l) : (console.warn("color-picker", `color ${l} in swatches is invalid.`), l = "#000000")), t === m.value ? l : Ue(l, m.value, t);
|
|
421
|
-
}
|
|
422
420
|
function kl(e) {
|
|
423
|
-
|
|
421
|
+
let { value: l, mode: t } = e;
|
|
422
|
+
return t || (t = "hex", /^[a-zA-Z]+$/.test(l) ? l = bl(l) : (console.warn("color-picker", `color ${l} in swatches is invalid.`), l = "#000000")), t === m.value ? l : Ve(l, m.value, t);
|
|
424
423
|
}
|
|
425
|
-
function yl() {
|
|
426
|
-
|
|
424
|
+
function yl(e) {
|
|
425
|
+
g(kl(e), "input");
|
|
427
426
|
}
|
|
428
427
|
function wl() {
|
|
429
|
-
|
|
428
|
+
P("confirm", i.value), ie.value.hide();
|
|
429
|
+
}
|
|
430
|
+
function $l() {
|
|
431
|
+
g(void 0, "input"), P("clear"), ie.value.hide();
|
|
430
432
|
}
|
|
431
|
-
return (e, l) => (b(),
|
|
433
|
+
return (e, l) => (b(), J(T(Rl), {
|
|
432
434
|
ref_key: "tooltipRef",
|
|
433
435
|
ref: ie,
|
|
434
|
-
style: `width:
|
|
436
|
+
style: p(`width: ${Re.value}; height: ${de.value};`),
|
|
435
437
|
"max-width": "none",
|
|
436
438
|
arrow: !1,
|
|
437
439
|
placement: "bottom",
|
|
@@ -446,58 +448,58 @@ const Hl = { class: "color-picker-preview" }, El = { class: "color-picker-previe
|
|
|
446
448
|
"content-style": { width: "100%", height: "100%" },
|
|
447
449
|
trigger: "click",
|
|
448
450
|
"transition-duration": 200
|
|
449
|
-
},
|
|
451
|
+
}, {
|
|
450
452
|
tooltip: se(() => [
|
|
451
|
-
e.disabled ? H("", !0) : (b(), R(
|
|
452
|
-
|
|
453
|
-
class:
|
|
453
|
+
e.disabled ? H("", !0) : (b(), R(be, { key: 0 }, [
|
|
454
|
+
n("div", {
|
|
455
|
+
class: Ml(["color-picker-panel", { "panel-with-actions": e.actions.length }])
|
|
454
456
|
}, [
|
|
455
|
-
|
|
457
|
+
n("div", {
|
|
456
458
|
ref_key: "palleteRef",
|
|
457
|
-
ref:
|
|
459
|
+
ref: Q,
|
|
458
460
|
class: "color-picker-pallete",
|
|
459
|
-
onMousedown:
|
|
461
|
+
onMousedown: rl
|
|
460
462
|
}, [
|
|
461
|
-
|
|
463
|
+
n("div", {
|
|
462
464
|
class: "color-picker-pallete-layer",
|
|
463
|
-
style:
|
|
465
|
+
style: p({ backgroundImage: `linear-gradient(90deg, white, hsl(${E.value}, 100%, 50%))` })
|
|
464
466
|
}, null, 4),
|
|
465
|
-
l[1] || (l[1] =
|
|
467
|
+
l[1] || (l[1] = n("div", {
|
|
466
468
|
class: "color-picker-pallete-layer pallete-layer-shadowed",
|
|
467
469
|
style: { "background-image": "linear-gradient(180deg, rgba(0, 0, 0, 0%), rgba(0, 0, 0, 100%))" }
|
|
468
470
|
}, null, -1)),
|
|
469
|
-
|
|
471
|
+
n("div", {
|
|
470
472
|
class: "color-picker-handle",
|
|
471
|
-
style:
|
|
473
|
+
style: p(Te.value)
|
|
472
474
|
}, [
|
|
473
|
-
|
|
475
|
+
n("div", {
|
|
474
476
|
class: "color-picker-handle-fill",
|
|
475
|
-
style:
|
|
477
|
+
style: p(We.value)
|
|
476
478
|
}, null, 4)
|
|
477
479
|
], 4)
|
|
478
480
|
], 544),
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
481
|
+
n("div", El, [
|
|
482
|
+
n("div", zl, [
|
|
483
|
+
n("div", {
|
|
482
484
|
class: "color-picker-slider",
|
|
483
|
-
style:
|
|
485
|
+
style: p(Me.value)
|
|
484
486
|
}, [
|
|
485
|
-
|
|
487
|
+
n("div", {
|
|
486
488
|
ref_key: "hueRailRef",
|
|
487
489
|
ref: ee,
|
|
488
|
-
style:
|
|
489
|
-
onMousedown:
|
|
490
|
+
style: p(Ye.value),
|
|
491
|
+
onMousedown: al
|
|
490
492
|
}, [
|
|
491
|
-
|
|
492
|
-
style:
|
|
493
|
+
n("div", {
|
|
494
|
+
style: p(`position: absolute; top: 0px; bottom: 0; left: ${f}; right: ${f}`)
|
|
493
495
|
}, [
|
|
494
|
-
|
|
496
|
+
n("div", {
|
|
495
497
|
class: "color-picker-handle",
|
|
496
|
-
style:
|
|
498
|
+
style: p(je.value)
|
|
497
499
|
}, [
|
|
498
|
-
|
|
500
|
+
n("div", {
|
|
499
501
|
class: "color-picker-handle-fill",
|
|
500
|
-
style:
|
|
502
|
+
style: p(qe.value)
|
|
501
503
|
}, null, 4)
|
|
502
504
|
], 4)
|
|
503
505
|
], 4)
|
|
@@ -508,11 +510,11 @@ const Hl = { class: "color-picker-preview" }, El = { class: "color-picker-previe
|
|
|
508
510
|
ref_key: "alphaRailRef",
|
|
509
511
|
ref: le,
|
|
510
512
|
class: "color-picker-slider",
|
|
511
|
-
style:
|
|
512
|
-
onMousedown:
|
|
513
|
+
style: p(Me.value),
|
|
514
|
+
onMousedown: ul
|
|
513
515
|
}, [
|
|
514
|
-
|
|
515
|
-
style:
|
|
516
|
+
n("div", {
|
|
517
|
+
style: p(`
|
|
516
518
|
border-radius: ${f};
|
|
517
519
|
position: absolute;
|
|
518
520
|
top: 0px;
|
|
@@ -522,98 +524,99 @@ const Hl = { class: "color-picker-preview" }, El = { class: "color-picker-previe
|
|
|
522
524
|
overflow: hidden;
|
|
523
525
|
`)
|
|
524
526
|
}, [
|
|
525
|
-
l[2] || (l[2] =
|
|
526
|
-
|
|
527
|
+
l[2] || (l[2] = n("div", { class: "color-picker-checkboard" }, null, -1)),
|
|
528
|
+
n("div", {
|
|
527
529
|
class: "color-picker-slider-image",
|
|
528
|
-
style:
|
|
530
|
+
style: p(`background-image: ${Je.value}`)
|
|
529
531
|
}, null, 4)
|
|
530
532
|
], 4),
|
|
531
|
-
|
|
533
|
+
h.value ? (b(), R("div", {
|
|
532
534
|
key: 0,
|
|
533
|
-
style:
|
|
535
|
+
style: p(`position: absolute; top: 0px; bottom: 0; left: ${f}; right: ${f}`)
|
|
534
536
|
}, [
|
|
535
|
-
|
|
537
|
+
n("div", {
|
|
536
538
|
class: "color-picker-handle",
|
|
537
|
-
style:
|
|
539
|
+
style: p(Ke.value)
|
|
538
540
|
}, [
|
|
539
|
-
|
|
541
|
+
n("div", {
|
|
540
542
|
class: "color-picker-handle-fill",
|
|
541
|
-
style:
|
|
543
|
+
style: p(Qe.value)
|
|
542
544
|
}, null, 4)
|
|
543
545
|
], 4)
|
|
544
546
|
], 4)) : H("", !0)
|
|
545
547
|
], 36)) : H("", !0)
|
|
546
548
|
]),
|
|
547
|
-
e.showPreview ? (b(), R("div",
|
|
548
|
-
|
|
549
|
+
e.showPreview ? (b(), R("div", Ul, [
|
|
550
|
+
n("span", {
|
|
549
551
|
class: "color-picker-circle-fill",
|
|
550
|
-
style:
|
|
552
|
+
style: p(`background: ${Ce.value || "#000000"};`)
|
|
551
553
|
}, null, 4),
|
|
552
|
-
|
|
554
|
+
n("input", {
|
|
553
555
|
class: "color-picker-circle-input",
|
|
554
556
|
type: "color",
|
|
555
|
-
value:
|
|
556
|
-
onChange:
|
|
557
|
-
}, null, 40,
|
|
557
|
+
value: Ce.value,
|
|
558
|
+
onChange: Cl(dl, ["stop"])
|
|
559
|
+
}, null, 40, xl)
|
|
558
560
|
])) : H("", !0)
|
|
559
561
|
]),
|
|
560
|
-
|
|
561
|
-
|
|
562
|
+
n("div", Vl, [
|
|
563
|
+
n("div", {
|
|
562
564
|
class: "color-picker-input-mode",
|
|
563
|
-
style:
|
|
564
|
-
onClick:
|
|
565
|
-
},
|
|
566
|
-
|
|
567
|
-
m.value === "hex" ? (b(),
|
|
565
|
+
style: p({ cursor: e.modes.length === 1 ? "" : "pointer" }),
|
|
566
|
+
onClick: cl
|
|
567
|
+
}, ge(Y.value), 5),
|
|
568
|
+
n("div", Il, [
|
|
569
|
+
m.value === "hex" ? (b(), J(T(_e), me({
|
|
568
570
|
key: 0,
|
|
569
571
|
size: "small",
|
|
570
|
-
placeholder:
|
|
572
|
+
placeholder: Y.value,
|
|
571
573
|
value: re.value,
|
|
572
574
|
"onUpdate:value": l[0] || (l[0] = (t) => re.value = t),
|
|
573
575
|
valueModifiers: { lazy: !0 },
|
|
574
|
-
onChange:
|
|
575
|
-
}, null,
|
|
576
|
+
onChange: xe
|
|
577
|
+
}, e.inputProps), null, 16, ["placeholder", "value"])) : (b(!0), R(be, { key: 1 }, Ne(ll.value, (t, o) => (b(), J(T(_e), me({
|
|
576
578
|
size: "small",
|
|
577
|
-
style:
|
|
579
|
+
style: `${t === "A" ? "flex-grow: 1.25" : ""}`,
|
|
580
|
+
key: o,
|
|
578
581
|
placeholder: t,
|
|
579
582
|
value: x.value[o],
|
|
580
583
|
"onUpdate:value": (S) => x.value[o] = S,
|
|
581
584
|
valueModifiers: { lazy: !0 },
|
|
582
|
-
onChange: (S) =>
|
|
583
|
-
|
|
584
|
-
}, null,
|
|
585
|
+
onChange: (S) => xe(S, o),
|
|
586
|
+
ref_for: !0
|
|
587
|
+
}, e.inputProps), null, 16, ["style", "placeholder", "value", "onUpdate:value", "onChange"]))), 128))
|
|
585
588
|
])
|
|
586
589
|
]),
|
|
587
|
-
|
|
588
|
-
(b(!0), R(
|
|
590
|
+
He.value.length ? (b(), R("div", Ll, [
|
|
591
|
+
(b(!0), R(be, null, Ne(He.value, (t, o) => (b(), R("div", {
|
|
589
592
|
tabindex: "0",
|
|
590
593
|
class: "color-picker-swatch",
|
|
591
594
|
key: o,
|
|
592
|
-
onClick: (S) =>
|
|
595
|
+
onClick: (S) => yl(t)
|
|
593
596
|
}, [
|
|
594
|
-
|
|
597
|
+
n("div", {
|
|
595
598
|
class: "color-picker-swatch-fill",
|
|
596
|
-
style:
|
|
599
|
+
style: p(`background: ${t.legalValue};`)
|
|
597
600
|
}, null, 4)
|
|
598
|
-
], 8,
|
|
601
|
+
], 8, Nl))), 128))
|
|
599
602
|
])) : H("", !0)
|
|
600
603
|
], 2),
|
|
601
|
-
e.actions.length ? (b(), R("div",
|
|
602
|
-
e.actions.includes("confirm") ? (b(),
|
|
604
|
+
e.actions.length ? (b(), R("div", Bl, [
|
|
605
|
+
e.actions.includes("confirm") ? (b(), J(T(Pe), {
|
|
603
606
|
key: 0,
|
|
604
607
|
type: "primary",
|
|
605
608
|
size: "small",
|
|
606
|
-
onClick:
|
|
609
|
+
onClick: wl
|
|
607
610
|
}, {
|
|
608
611
|
default: se(() => l[3] || (l[3] = [
|
|
609
612
|
ne("确认")
|
|
610
613
|
])),
|
|
611
614
|
_: 1
|
|
612
615
|
})) : H("", !0),
|
|
613
|
-
e.actions.includes("clear") ? (b(),
|
|
616
|
+
e.actions.includes("clear") ? (b(), J(T(Pe), {
|
|
614
617
|
key: 1,
|
|
615
618
|
size: "small",
|
|
616
|
-
onClick:
|
|
619
|
+
onClick: $l
|
|
617
620
|
}, {
|
|
618
621
|
default: se(() => l[4] || (l[4] = [
|
|
619
622
|
ne("清除")
|
|
@@ -621,40 +624,47 @@ const Hl = { class: "color-picker-preview" }, El = { class: "color-picker-previe
|
|
|
621
624
|
_: 1
|
|
622
625
|
})) : H("", !0)
|
|
623
626
|
])) : H("", !0),
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
ne(
|
|
627
|
+
Ze.value ? (b(), R("div", _l, [
|
|
628
|
+
Le(e.$slots, "footer", {}, () => [
|
|
629
|
+
ne(ge(e.footer), 1)
|
|
627
630
|
], !0)
|
|
628
631
|
])) : H("", !0)
|
|
629
632
|
], 64))
|
|
630
633
|
]),
|
|
631
634
|
default: se(() => [
|
|
632
|
-
|
|
635
|
+
n("div", me({
|
|
633
636
|
tabindex: "1",
|
|
634
|
-
class:
|
|
635
|
-
style:
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
637
|
+
class: ["color-picker-display", [`color-picker-${e.size}`, { "color-picker-disabled": e.disabled }]],
|
|
638
|
+
style: `
|
|
639
|
+
--color-picker-width: ${Re.value};
|
|
640
|
+
--color-picker-height: ${de.value};
|
|
641
|
+
--color-picker-block-size: ${el.value};
|
|
642
|
+
--color-picker-primary-color-hover: #4096ff;
|
|
643
|
+
--color-picker-primary-color-focus: #4096ff;
|
|
644
|
+
--color-picker-primary-shadow-color: rgba(5, 145, 255, 0.1);
|
|
645
|
+
`
|
|
646
|
+
}, e.$attrs), [
|
|
647
|
+
n("div", Pl, [
|
|
648
|
+
n("div", Dl, [
|
|
649
|
+
l[5] || (l[5] = n("div", { class: "color-picker-checkboard" }, null, -1)),
|
|
650
|
+
n("div", {
|
|
651
|
+
style: p(`position: absolute; left: 0; right: 0; top: 0; bottom: 0; background-color: ${D.value ? T(_)(D.value) : ""};`)
|
|
642
652
|
}, null, 4),
|
|
643
|
-
i.value &&
|
|
653
|
+
i.value && D.value ? (b(), R("div", {
|
|
644
654
|
key: 0,
|
|
645
655
|
class: "color-picker-value",
|
|
646
|
-
style:
|
|
656
|
+
style: p({ color: D.value[2] > 50 || D.value[3] < 0.5 ? "black" : "white" })
|
|
647
657
|
}, [
|
|
648
|
-
|
|
649
|
-
ne(
|
|
658
|
+
Le(e.$slots, "label", { color: i.value }, () => [
|
|
659
|
+
ne(ge(e.label ? e.label(i.value) : i.value), 1)
|
|
650
660
|
], !0)
|
|
651
661
|
], 4)) : H("", !0)
|
|
652
662
|
])
|
|
653
663
|
])
|
|
654
|
-
],
|
|
664
|
+
], 16)
|
|
655
665
|
]),
|
|
656
666
|
_: 3
|
|
657
|
-
},
|
|
667
|
+
}, 8, ["style", "tooltip-style"]));
|
|
658
668
|
}
|
|
659
669
|
});
|
|
660
670
|
export {
|