wyfe-ivue 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -0
- package/dist/index.es.js +1116 -0
- package/dist/index.umd.js +5 -0
- package/dist/types/index.d.ts +43 -0
- package/dist/vite.svg +1 -0
- package/dist/wyfe-ivue.css +1 -0
- package/package.json +67 -0
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,1116 @@
|
|
|
1
|
+
import { getCurrentInstance as J, inject as B, ref as I, computed as v, unref as d, warn as Nt, defineComponent as $, createElementBlock as R, openBlock as k, mergeProps as ht, renderSlot as O, createElementVNode as Ct, watch as $t, useSlots as Et, Text as Ht, createBlock as T, resolveDynamicComponent as F, withCtx as j, createCommentVNode as X, Fragment as Tt, normalizeClass as q, provide as Ot, reactive as It, toRef as tt, useAttrs as Rt, onMounted as Pt, createTextVNode as Vt, toDisplayString as jt } from "vue";
|
|
2
|
+
import { ElMessage as et, ElMessageBox as nt } from "element-plus";
|
|
3
|
+
const zt = Symbol(), G = "el", Ft = "is-", E = (t, n, e, r, a) => {
|
|
4
|
+
let o = `${t}-${n}`;
|
|
5
|
+
return e && (o += `-${e}`), r && (o += `__${r}`), a && (o += `--${a}`), o;
|
|
6
|
+
}, Gt = Symbol("namespaceContextKey"), Kt = (t) => {
|
|
7
|
+
const n = J() ? B(Gt, I(G)) : I(G);
|
|
8
|
+
return v(() => d(n) || G);
|
|
9
|
+
}, z = (t, n) => {
|
|
10
|
+
const e = Kt();
|
|
11
|
+
return {
|
|
12
|
+
namespace: e,
|
|
13
|
+
b: (u = "") => E(e.value, t, u, "", ""),
|
|
14
|
+
e: (u) => u ? E(e.value, t, "", u, "") : "",
|
|
15
|
+
m: (u) => u ? E(e.value, t, "", "", u) : "",
|
|
16
|
+
be: (u, f) => u && f ? E(e.value, t, u, f, "") : "",
|
|
17
|
+
em: (u, f) => u && f ? E(e.value, t, "", u, f) : "",
|
|
18
|
+
bm: (u, f) => u && f ? E(e.value, t, u, "", f) : "",
|
|
19
|
+
bem: (u, f, s) => u && f && s ? E(e.value, t, u, f, s) : "",
|
|
20
|
+
is: (u, ...f) => {
|
|
21
|
+
const s = f.length >= 1 ? f[0] : !0;
|
|
22
|
+
return u && s ? `${Ft}${u}` : "";
|
|
23
|
+
},
|
|
24
|
+
cssVar: (u) => {
|
|
25
|
+
const f = {};
|
|
26
|
+
for (const s in u)
|
|
27
|
+
u[s] && (f[`--${e.value}-${s}`] = u[s]);
|
|
28
|
+
return f;
|
|
29
|
+
},
|
|
30
|
+
cssVarName: (u) => `--${e.value}-${u}`,
|
|
31
|
+
cssVarBlock: (u) => {
|
|
32
|
+
const f = {};
|
|
33
|
+
for (const s in u)
|
|
34
|
+
u[s] && (f[`--${e.value}-${t}-${s}`] = u[s]);
|
|
35
|
+
return f;
|
|
36
|
+
},
|
|
37
|
+
cssVarBlockName: (u) => `--${e.value}-${t}-${u}`
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @vue/shared v3.5.21
|
|
42
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
43
|
+
* @license MIT
|
|
44
|
+
**/
|
|
45
|
+
process.env.NODE_ENV !== "production" && Object.freeze({});
|
|
46
|
+
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
47
|
+
const Dt = () => {
|
|
48
|
+
}, Lt = Object.prototype.hasOwnProperty, rt = (t, n) => Lt.call(t, n), gt = (t) => typeof t == "string", vt = (t) => t !== null && typeof t == "object";
|
|
49
|
+
function qt(t) {
|
|
50
|
+
for (var n = -1, e = t == null ? 0 : t.length, r = {}; ++n < e; ) {
|
|
51
|
+
var a = t[n];
|
|
52
|
+
r[a[0]] = a[1];
|
|
53
|
+
}
|
|
54
|
+
return r;
|
|
55
|
+
}
|
|
56
|
+
const Ut = (t) => t === void 0, Wt = (t) => typeof t == "number", Jt = (t) => gt(t) ? !Number.isNaN(Number(t)) : !1, pt = "__epPropKey", Z = (t) => t, Zt = (t) => vt(t) && !!t[pt], bt = (t, n) => {
|
|
57
|
+
if (!vt(t) || Zt(t))
|
|
58
|
+
return t;
|
|
59
|
+
const { values: e, required: r, default: a, type: o, validator: i } = t, l = {
|
|
60
|
+
type: o,
|
|
61
|
+
required: !!r,
|
|
62
|
+
validator: e || i ? (h) => {
|
|
63
|
+
let g = !1, b = [];
|
|
64
|
+
if (e && (b = Array.from(e), rt(t, "default") && b.push(a), g || (g = b.includes(h))), i && (g || (g = i(h))), !g && b.length > 0) {
|
|
65
|
+
const A = [...new Set(b)].map((S) => JSON.stringify(S)).join(", ");
|
|
66
|
+
Nt(`Invalid prop: validation failed${n ? ` for prop "${n}"` : ""}. Expected one of [${A}], got value ${JSON.stringify(h)}.`);
|
|
67
|
+
}
|
|
68
|
+
return g;
|
|
69
|
+
} : void 0,
|
|
70
|
+
[pt]: !0
|
|
71
|
+
};
|
|
72
|
+
return rt(t, "default") && (l.default = a), l;
|
|
73
|
+
}, mt = (t) => qt(Object.entries(t).map(([n, e]) => [
|
|
74
|
+
n,
|
|
75
|
+
bt(e, n)
|
|
76
|
+
])), Yt = ["", "default", "small", "large"], Qt = bt({
|
|
77
|
+
type: String,
|
|
78
|
+
values: Yt,
|
|
79
|
+
required: !1
|
|
80
|
+
}), Xt = Symbol("size"), te = () => {
|
|
81
|
+
const t = B(Xt, {});
|
|
82
|
+
return v(() => d(t.size) || "");
|
|
83
|
+
}, at = I();
|
|
84
|
+
function ee(t, n = void 0) {
|
|
85
|
+
const e = J() ? B(zt, at) : at;
|
|
86
|
+
return v(() => {
|
|
87
|
+
var r, a;
|
|
88
|
+
return (a = (r = e.value) == null ? void 0 : r[t]) != null ? a : n;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
var Y = (t, n) => {
|
|
92
|
+
const e = t.__vccOpts || t;
|
|
93
|
+
for (const [r, a] of n)
|
|
94
|
+
e[r] = a;
|
|
95
|
+
return e;
|
|
96
|
+
};
|
|
97
|
+
function ne(t, n = "px") {
|
|
98
|
+
if (!t)
|
|
99
|
+
return "";
|
|
100
|
+
if (Wt(t) || Jt(t))
|
|
101
|
+
return `${t}${n}`;
|
|
102
|
+
if (gt(t))
|
|
103
|
+
return t;
|
|
104
|
+
}
|
|
105
|
+
const yt = (t, n) => {
|
|
106
|
+
if (t.install = (e) => {
|
|
107
|
+
for (const r of [t, ...Object.values(n ?? {})])
|
|
108
|
+
e.component(r.name, r);
|
|
109
|
+
}, n)
|
|
110
|
+
for (const [e, r] of Object.entries(n))
|
|
111
|
+
t[e] = r;
|
|
112
|
+
return t;
|
|
113
|
+
}, re = (t) => (t.install = Dt, t), ae = mt({
|
|
114
|
+
size: {
|
|
115
|
+
type: Z([Number, String])
|
|
116
|
+
},
|
|
117
|
+
color: {
|
|
118
|
+
type: String
|
|
119
|
+
}
|
|
120
|
+
}), oe = $({
|
|
121
|
+
name: "ElIcon",
|
|
122
|
+
inheritAttrs: !1
|
|
123
|
+
}), ie = /* @__PURE__ */ $({
|
|
124
|
+
...oe,
|
|
125
|
+
props: ae,
|
|
126
|
+
setup(t) {
|
|
127
|
+
const n = t, e = z("icon"), r = v(() => {
|
|
128
|
+
const { size: a, color: o } = n;
|
|
129
|
+
return !a && !o ? {} : {
|
|
130
|
+
fontSize: Ut(a) ? void 0 : ne(a),
|
|
131
|
+
"--color": o
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
return (a, o) => (k(), R("i", ht({
|
|
135
|
+
class: d(e).b(),
|
|
136
|
+
style: d(r)
|
|
137
|
+
}, a.$attrs), [
|
|
138
|
+
O(a.$slots, "default")
|
|
139
|
+
], 16));
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
var se = /* @__PURE__ */ Y(ie, [["__file", "icon.vue"]]);
|
|
143
|
+
const ot = yt(se);
|
|
144
|
+
/*! Element Plus Icons Vue v2.3.2 */
|
|
145
|
+
var ce = /* @__PURE__ */ $({
|
|
146
|
+
name: "Loading",
|
|
147
|
+
__name: "loading",
|
|
148
|
+
setup(t) {
|
|
149
|
+
return (n, e) => (k(), R("svg", {
|
|
150
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
151
|
+
viewBox: "0 0 1024 1024"
|
|
152
|
+
}, [
|
|
153
|
+
Ct("path", {
|
|
154
|
+
fill: "currentColor",
|
|
155
|
+
d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
|
|
156
|
+
})
|
|
157
|
+
]));
|
|
158
|
+
}
|
|
159
|
+
}), le = ce;
|
|
160
|
+
const it = Z([
|
|
161
|
+
String,
|
|
162
|
+
Object,
|
|
163
|
+
Function
|
|
164
|
+
]), Q = Symbol("formContextKey"), xt = Symbol("formItemContextKey"), ue = () => {
|
|
165
|
+
const t = B(Q, void 0), n = B(xt, void 0);
|
|
166
|
+
return {
|
|
167
|
+
form: t,
|
|
168
|
+
formItem: n
|
|
169
|
+
};
|
|
170
|
+
}, St = (t) => {
|
|
171
|
+
const n = J();
|
|
172
|
+
return v(() => {
|
|
173
|
+
var e, r;
|
|
174
|
+
return (r = (e = n?.proxy) == null ? void 0 : e.$props) == null ? void 0 : r[t];
|
|
175
|
+
});
|
|
176
|
+
}, fe = (t, n = {}) => {
|
|
177
|
+
const e = I(void 0), r = n.prop ? e : St("size"), a = n.global ? e : te(), o = n.form ? { size: void 0 } : B(Q, void 0), i = n.formItem ? { size: void 0 } : B(xt, void 0);
|
|
178
|
+
return v(() => r.value || d(t) || i?.size || o?.size || a.value || "");
|
|
179
|
+
}, _t = (t) => {
|
|
180
|
+
const n = St("disabled"), e = B(Q, void 0);
|
|
181
|
+
return v(() => n.value || d(t) || e?.disabled || !1);
|
|
182
|
+
}, kt = Symbol("buttonGroupContextKey"), de = ({ from: t, replacement: n, scope: e, version: r, ref: a, type: o = "API" }, i) => {
|
|
183
|
+
$t(() => d(i), (c) => {
|
|
184
|
+
}, {
|
|
185
|
+
immediate: !0
|
|
186
|
+
});
|
|
187
|
+
}, he = (t, n) => {
|
|
188
|
+
de({
|
|
189
|
+
from: "type.text",
|
|
190
|
+
replacement: "link",
|
|
191
|
+
version: "3.0.0",
|
|
192
|
+
scope: "props",
|
|
193
|
+
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
|
|
194
|
+
}, v(() => t.type === "text"));
|
|
195
|
+
const e = B(kt, void 0), r = ee("button"), { form: a } = ue(), o = fe(v(() => e?.size)), i = _t(), c = I(), l = Et(), h = v(() => {
|
|
196
|
+
var s;
|
|
197
|
+
return t.type || e?.type || ((s = r.value) == null ? void 0 : s.type) || "";
|
|
198
|
+
}), g = v(() => {
|
|
199
|
+
var s, m, y;
|
|
200
|
+
return (y = (m = t.autoInsertSpace) != null ? m : (s = r.value) == null ? void 0 : s.autoInsertSpace) != null ? y : !1;
|
|
201
|
+
}), b = v(() => {
|
|
202
|
+
var s, m, y;
|
|
203
|
+
return (y = (m = t.plain) != null ? m : (s = r.value) == null ? void 0 : s.plain) != null ? y : !1;
|
|
204
|
+
}), A = v(() => {
|
|
205
|
+
var s, m, y;
|
|
206
|
+
return (y = (m = t.round) != null ? m : (s = r.value) == null ? void 0 : s.round) != null ? y : !1;
|
|
207
|
+
}), S = v(() => {
|
|
208
|
+
var s, m, y;
|
|
209
|
+
return (y = (m = t.text) != null ? m : (s = r.value) == null ? void 0 : s.text) != null ? y : !1;
|
|
210
|
+
}), w = v(() => t.tag === "button" ? {
|
|
211
|
+
ariaDisabled: i.value || t.loading,
|
|
212
|
+
disabled: i.value || t.loading,
|
|
213
|
+
autofocus: t.autofocus,
|
|
214
|
+
type: t.nativeType
|
|
215
|
+
} : {}), u = v(() => {
|
|
216
|
+
var s;
|
|
217
|
+
const m = (s = l.default) == null ? void 0 : s.call(l);
|
|
218
|
+
if (g.value && m?.length === 1) {
|
|
219
|
+
const y = m[0];
|
|
220
|
+
if (y?.type === Ht) {
|
|
221
|
+
const At = y.children;
|
|
222
|
+
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(At.trim());
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return !1;
|
|
226
|
+
});
|
|
227
|
+
return {
|
|
228
|
+
_disabled: i,
|
|
229
|
+
_size: o,
|
|
230
|
+
_type: h,
|
|
231
|
+
_ref: c,
|
|
232
|
+
_props: w,
|
|
233
|
+
_plain: b,
|
|
234
|
+
_round: A,
|
|
235
|
+
_text: S,
|
|
236
|
+
shouldAddSpace: u,
|
|
237
|
+
handleClick: (s) => {
|
|
238
|
+
if (i.value || t.loading) {
|
|
239
|
+
s.stopPropagation();
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
t.nativeType === "reset" && a?.resetFields(), n("click", s);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
}, ge = [
|
|
246
|
+
"default",
|
|
247
|
+
"primary",
|
|
248
|
+
"success",
|
|
249
|
+
"warning",
|
|
250
|
+
"info",
|
|
251
|
+
"danger",
|
|
252
|
+
"text",
|
|
253
|
+
""
|
|
254
|
+
], ve = ["button", "submit", "reset"], U = mt({
|
|
255
|
+
size: Qt,
|
|
256
|
+
disabled: Boolean,
|
|
257
|
+
type: {
|
|
258
|
+
type: String,
|
|
259
|
+
values: ge,
|
|
260
|
+
default: ""
|
|
261
|
+
},
|
|
262
|
+
icon: {
|
|
263
|
+
type: it
|
|
264
|
+
},
|
|
265
|
+
nativeType: {
|
|
266
|
+
type: String,
|
|
267
|
+
values: ve,
|
|
268
|
+
default: "button"
|
|
269
|
+
},
|
|
270
|
+
loading: Boolean,
|
|
271
|
+
loadingIcon: {
|
|
272
|
+
type: it,
|
|
273
|
+
default: () => le
|
|
274
|
+
},
|
|
275
|
+
plain: {
|
|
276
|
+
type: Boolean,
|
|
277
|
+
default: void 0
|
|
278
|
+
},
|
|
279
|
+
text: {
|
|
280
|
+
type: Boolean,
|
|
281
|
+
default: void 0
|
|
282
|
+
},
|
|
283
|
+
link: Boolean,
|
|
284
|
+
bg: Boolean,
|
|
285
|
+
autofocus: Boolean,
|
|
286
|
+
round: {
|
|
287
|
+
type: Boolean,
|
|
288
|
+
default: void 0
|
|
289
|
+
},
|
|
290
|
+
circle: Boolean,
|
|
291
|
+
color: String,
|
|
292
|
+
dark: Boolean,
|
|
293
|
+
autoInsertSpace: {
|
|
294
|
+
type: Boolean,
|
|
295
|
+
default: void 0
|
|
296
|
+
},
|
|
297
|
+
tag: {
|
|
298
|
+
type: Z([String, Object]),
|
|
299
|
+
default: "button"
|
|
300
|
+
}
|
|
301
|
+
}), pe = {
|
|
302
|
+
click: (t) => t instanceof MouseEvent
|
|
303
|
+
};
|
|
304
|
+
function p(t, n) {
|
|
305
|
+
be(t) && (t = "100%");
|
|
306
|
+
var e = me(t);
|
|
307
|
+
return t = n === 360 ? t : Math.min(n, Math.max(0, parseFloat(t))), e && (t = parseInt(String(t * n), 10) / 100), Math.abs(t - n) < 1e-6 ? 1 : (n === 360 ? t = (t < 0 ? t % n + n : t % n) / parseFloat(String(n)) : t = t % n / parseFloat(String(n)), t);
|
|
308
|
+
}
|
|
309
|
+
function P(t) {
|
|
310
|
+
return Math.min(1, Math.max(0, t));
|
|
311
|
+
}
|
|
312
|
+
function be(t) {
|
|
313
|
+
return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1;
|
|
314
|
+
}
|
|
315
|
+
function me(t) {
|
|
316
|
+
return typeof t == "string" && t.indexOf("%") !== -1;
|
|
317
|
+
}
|
|
318
|
+
function wt(t) {
|
|
319
|
+
return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
|
|
320
|
+
}
|
|
321
|
+
function V(t) {
|
|
322
|
+
return t <= 1 ? "".concat(Number(t) * 100, "%") : t;
|
|
323
|
+
}
|
|
324
|
+
function H(t) {
|
|
325
|
+
return t.length === 1 ? "0" + t : String(t);
|
|
326
|
+
}
|
|
327
|
+
function ye(t, n, e) {
|
|
328
|
+
return {
|
|
329
|
+
r: p(t, 255) * 255,
|
|
330
|
+
g: p(n, 255) * 255,
|
|
331
|
+
b: p(e, 255) * 255
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
function st(t, n, e) {
|
|
335
|
+
t = p(t, 255), n = p(n, 255), e = p(e, 255);
|
|
336
|
+
var r = Math.max(t, n, e), a = Math.min(t, n, e), o = 0, i = 0, c = (r + a) / 2;
|
|
337
|
+
if (r === a)
|
|
338
|
+
i = 0, o = 0;
|
|
339
|
+
else {
|
|
340
|
+
var l = r - a;
|
|
341
|
+
switch (i = c > 0.5 ? l / (2 - r - a) : l / (r + a), r) {
|
|
342
|
+
case t:
|
|
343
|
+
o = (n - e) / l + (n < e ? 6 : 0);
|
|
344
|
+
break;
|
|
345
|
+
case n:
|
|
346
|
+
o = (e - t) / l + 2;
|
|
347
|
+
break;
|
|
348
|
+
case e:
|
|
349
|
+
o = (t - n) / l + 4;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
o /= 6;
|
|
353
|
+
}
|
|
354
|
+
return { h: o, s: i, l: c };
|
|
355
|
+
}
|
|
356
|
+
function K(t, n, e) {
|
|
357
|
+
return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? t + (n - t) * (6 * e) : e < 1 / 2 ? n : e < 2 / 3 ? t + (n - t) * (2 / 3 - e) * 6 : t;
|
|
358
|
+
}
|
|
359
|
+
function xe(t, n, e) {
|
|
360
|
+
var r, a, o;
|
|
361
|
+
if (t = p(t, 360), n = p(n, 100), e = p(e, 100), n === 0)
|
|
362
|
+
a = e, o = e, r = e;
|
|
363
|
+
else {
|
|
364
|
+
var i = e < 0.5 ? e * (1 + n) : e + n - e * n, c = 2 * e - i;
|
|
365
|
+
r = K(c, i, t + 1 / 3), a = K(c, i, t), o = K(c, i, t - 1 / 3);
|
|
366
|
+
}
|
|
367
|
+
return { r: r * 255, g: a * 255, b: o * 255 };
|
|
368
|
+
}
|
|
369
|
+
function ct(t, n, e) {
|
|
370
|
+
t = p(t, 255), n = p(n, 255), e = p(e, 255);
|
|
371
|
+
var r = Math.max(t, n, e), a = Math.min(t, n, e), o = 0, i = r, c = r - a, l = r === 0 ? 0 : c / r;
|
|
372
|
+
if (r === a)
|
|
373
|
+
o = 0;
|
|
374
|
+
else {
|
|
375
|
+
switch (r) {
|
|
376
|
+
case t:
|
|
377
|
+
o = (n - e) / c + (n < e ? 6 : 0);
|
|
378
|
+
break;
|
|
379
|
+
case n:
|
|
380
|
+
o = (e - t) / c + 2;
|
|
381
|
+
break;
|
|
382
|
+
case e:
|
|
383
|
+
o = (t - n) / c + 4;
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
o /= 6;
|
|
387
|
+
}
|
|
388
|
+
return { h: o, s: l, v: i };
|
|
389
|
+
}
|
|
390
|
+
function Se(t, n, e) {
|
|
391
|
+
t = p(t, 360) * 6, n = p(n, 100), e = p(e, 100);
|
|
392
|
+
var r = Math.floor(t), a = t - r, o = e * (1 - n), i = e * (1 - a * n), c = e * (1 - (1 - a) * n), l = r % 6, h = [e, i, o, o, c, e][l], g = [c, e, e, i, o, o][l], b = [o, o, c, e, e, i][l];
|
|
393
|
+
return { r: h * 255, g: g * 255, b: b * 255 };
|
|
394
|
+
}
|
|
395
|
+
function lt(t, n, e, r) {
|
|
396
|
+
var a = [
|
|
397
|
+
H(Math.round(t).toString(16)),
|
|
398
|
+
H(Math.round(n).toString(16)),
|
|
399
|
+
H(Math.round(e).toString(16))
|
|
400
|
+
];
|
|
401
|
+
return r && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join("");
|
|
402
|
+
}
|
|
403
|
+
function _e(t, n, e, r, a) {
|
|
404
|
+
var o = [
|
|
405
|
+
H(Math.round(t).toString(16)),
|
|
406
|
+
H(Math.round(n).toString(16)),
|
|
407
|
+
H(Math.round(e).toString(16)),
|
|
408
|
+
H(ke(r))
|
|
409
|
+
];
|
|
410
|
+
return a && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) && o[3].startsWith(o[3].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join("");
|
|
411
|
+
}
|
|
412
|
+
function ke(t) {
|
|
413
|
+
return Math.round(parseFloat(t) * 255).toString(16);
|
|
414
|
+
}
|
|
415
|
+
function ut(t) {
|
|
416
|
+
return x(t) / 255;
|
|
417
|
+
}
|
|
418
|
+
function x(t) {
|
|
419
|
+
return parseInt(t, 16);
|
|
420
|
+
}
|
|
421
|
+
function we(t) {
|
|
422
|
+
return {
|
|
423
|
+
r: t >> 16,
|
|
424
|
+
g: (t & 65280) >> 8,
|
|
425
|
+
b: t & 255
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
var W = {
|
|
429
|
+
aliceblue: "#f0f8ff",
|
|
430
|
+
antiquewhite: "#faebd7",
|
|
431
|
+
aqua: "#00ffff",
|
|
432
|
+
aquamarine: "#7fffd4",
|
|
433
|
+
azure: "#f0ffff",
|
|
434
|
+
beige: "#f5f5dc",
|
|
435
|
+
bisque: "#ffe4c4",
|
|
436
|
+
black: "#000000",
|
|
437
|
+
blanchedalmond: "#ffebcd",
|
|
438
|
+
blue: "#0000ff",
|
|
439
|
+
blueviolet: "#8a2be2",
|
|
440
|
+
brown: "#a52a2a",
|
|
441
|
+
burlywood: "#deb887",
|
|
442
|
+
cadetblue: "#5f9ea0",
|
|
443
|
+
chartreuse: "#7fff00",
|
|
444
|
+
chocolate: "#d2691e",
|
|
445
|
+
coral: "#ff7f50",
|
|
446
|
+
cornflowerblue: "#6495ed",
|
|
447
|
+
cornsilk: "#fff8dc",
|
|
448
|
+
crimson: "#dc143c",
|
|
449
|
+
cyan: "#00ffff",
|
|
450
|
+
darkblue: "#00008b",
|
|
451
|
+
darkcyan: "#008b8b",
|
|
452
|
+
darkgoldenrod: "#b8860b",
|
|
453
|
+
darkgray: "#a9a9a9",
|
|
454
|
+
darkgreen: "#006400",
|
|
455
|
+
darkgrey: "#a9a9a9",
|
|
456
|
+
darkkhaki: "#bdb76b",
|
|
457
|
+
darkmagenta: "#8b008b",
|
|
458
|
+
darkolivegreen: "#556b2f",
|
|
459
|
+
darkorange: "#ff8c00",
|
|
460
|
+
darkorchid: "#9932cc",
|
|
461
|
+
darkred: "#8b0000",
|
|
462
|
+
darksalmon: "#e9967a",
|
|
463
|
+
darkseagreen: "#8fbc8f",
|
|
464
|
+
darkslateblue: "#483d8b",
|
|
465
|
+
darkslategray: "#2f4f4f",
|
|
466
|
+
darkslategrey: "#2f4f4f",
|
|
467
|
+
darkturquoise: "#00ced1",
|
|
468
|
+
darkviolet: "#9400d3",
|
|
469
|
+
deeppink: "#ff1493",
|
|
470
|
+
deepskyblue: "#00bfff",
|
|
471
|
+
dimgray: "#696969",
|
|
472
|
+
dimgrey: "#696969",
|
|
473
|
+
dodgerblue: "#1e90ff",
|
|
474
|
+
firebrick: "#b22222",
|
|
475
|
+
floralwhite: "#fffaf0",
|
|
476
|
+
forestgreen: "#228b22",
|
|
477
|
+
fuchsia: "#ff00ff",
|
|
478
|
+
gainsboro: "#dcdcdc",
|
|
479
|
+
ghostwhite: "#f8f8ff",
|
|
480
|
+
goldenrod: "#daa520",
|
|
481
|
+
gold: "#ffd700",
|
|
482
|
+
gray: "#808080",
|
|
483
|
+
green: "#008000",
|
|
484
|
+
greenyellow: "#adff2f",
|
|
485
|
+
grey: "#808080",
|
|
486
|
+
honeydew: "#f0fff0",
|
|
487
|
+
hotpink: "#ff69b4",
|
|
488
|
+
indianred: "#cd5c5c",
|
|
489
|
+
indigo: "#4b0082",
|
|
490
|
+
ivory: "#fffff0",
|
|
491
|
+
khaki: "#f0e68c",
|
|
492
|
+
lavenderblush: "#fff0f5",
|
|
493
|
+
lavender: "#e6e6fa",
|
|
494
|
+
lawngreen: "#7cfc00",
|
|
495
|
+
lemonchiffon: "#fffacd",
|
|
496
|
+
lightblue: "#add8e6",
|
|
497
|
+
lightcoral: "#f08080",
|
|
498
|
+
lightcyan: "#e0ffff",
|
|
499
|
+
lightgoldenrodyellow: "#fafad2",
|
|
500
|
+
lightgray: "#d3d3d3",
|
|
501
|
+
lightgreen: "#90ee90",
|
|
502
|
+
lightgrey: "#d3d3d3",
|
|
503
|
+
lightpink: "#ffb6c1",
|
|
504
|
+
lightsalmon: "#ffa07a",
|
|
505
|
+
lightseagreen: "#20b2aa",
|
|
506
|
+
lightskyblue: "#87cefa",
|
|
507
|
+
lightslategray: "#778899",
|
|
508
|
+
lightslategrey: "#778899",
|
|
509
|
+
lightsteelblue: "#b0c4de",
|
|
510
|
+
lightyellow: "#ffffe0",
|
|
511
|
+
lime: "#00ff00",
|
|
512
|
+
limegreen: "#32cd32",
|
|
513
|
+
linen: "#faf0e6",
|
|
514
|
+
magenta: "#ff00ff",
|
|
515
|
+
maroon: "#800000",
|
|
516
|
+
mediumaquamarine: "#66cdaa",
|
|
517
|
+
mediumblue: "#0000cd",
|
|
518
|
+
mediumorchid: "#ba55d3",
|
|
519
|
+
mediumpurple: "#9370db",
|
|
520
|
+
mediumseagreen: "#3cb371",
|
|
521
|
+
mediumslateblue: "#7b68ee",
|
|
522
|
+
mediumspringgreen: "#00fa9a",
|
|
523
|
+
mediumturquoise: "#48d1cc",
|
|
524
|
+
mediumvioletred: "#c71585",
|
|
525
|
+
midnightblue: "#191970",
|
|
526
|
+
mintcream: "#f5fffa",
|
|
527
|
+
mistyrose: "#ffe4e1",
|
|
528
|
+
moccasin: "#ffe4b5",
|
|
529
|
+
navajowhite: "#ffdead",
|
|
530
|
+
navy: "#000080",
|
|
531
|
+
oldlace: "#fdf5e6",
|
|
532
|
+
olive: "#808000",
|
|
533
|
+
olivedrab: "#6b8e23",
|
|
534
|
+
orange: "#ffa500",
|
|
535
|
+
orangered: "#ff4500",
|
|
536
|
+
orchid: "#da70d6",
|
|
537
|
+
palegoldenrod: "#eee8aa",
|
|
538
|
+
palegreen: "#98fb98",
|
|
539
|
+
paleturquoise: "#afeeee",
|
|
540
|
+
palevioletred: "#db7093",
|
|
541
|
+
papayawhip: "#ffefd5",
|
|
542
|
+
peachpuff: "#ffdab9",
|
|
543
|
+
peru: "#cd853f",
|
|
544
|
+
pink: "#ffc0cb",
|
|
545
|
+
plum: "#dda0dd",
|
|
546
|
+
powderblue: "#b0e0e6",
|
|
547
|
+
purple: "#800080",
|
|
548
|
+
rebeccapurple: "#663399",
|
|
549
|
+
red: "#ff0000",
|
|
550
|
+
rosybrown: "#bc8f8f",
|
|
551
|
+
royalblue: "#4169e1",
|
|
552
|
+
saddlebrown: "#8b4513",
|
|
553
|
+
salmon: "#fa8072",
|
|
554
|
+
sandybrown: "#f4a460",
|
|
555
|
+
seagreen: "#2e8b57",
|
|
556
|
+
seashell: "#fff5ee",
|
|
557
|
+
sienna: "#a0522d",
|
|
558
|
+
silver: "#c0c0c0",
|
|
559
|
+
skyblue: "#87ceeb",
|
|
560
|
+
slateblue: "#6a5acd",
|
|
561
|
+
slategray: "#708090",
|
|
562
|
+
slategrey: "#708090",
|
|
563
|
+
snow: "#fffafa",
|
|
564
|
+
springgreen: "#00ff7f",
|
|
565
|
+
steelblue: "#4682b4",
|
|
566
|
+
tan: "#d2b48c",
|
|
567
|
+
teal: "#008080",
|
|
568
|
+
thistle: "#d8bfd8",
|
|
569
|
+
tomato: "#ff6347",
|
|
570
|
+
turquoise: "#40e0d0",
|
|
571
|
+
violet: "#ee82ee",
|
|
572
|
+
wheat: "#f5deb3",
|
|
573
|
+
white: "#ffffff",
|
|
574
|
+
whitesmoke: "#f5f5f5",
|
|
575
|
+
yellow: "#ffff00",
|
|
576
|
+
yellowgreen: "#9acd32"
|
|
577
|
+
};
|
|
578
|
+
function Me(t) {
|
|
579
|
+
var n = { r: 0, g: 0, b: 0 }, e = 1, r = null, a = null, o = null, i = !1, c = !1;
|
|
580
|
+
return typeof t == "string" && (t = Ne(t)), typeof t == "object" && (M(t.r) && M(t.g) && M(t.b) ? (n = ye(t.r, t.g, t.b), i = !0, c = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : M(t.h) && M(t.s) && M(t.v) ? (r = V(t.s), a = V(t.v), n = Se(t.h, r, a), i = !0, c = "hsv") : M(t.h) && M(t.s) && M(t.l) && (r = V(t.s), o = V(t.l), n = xe(t.h, r, o), i = !0, c = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (e = t.a)), e = wt(e), {
|
|
581
|
+
ok: i,
|
|
582
|
+
format: t.format || c,
|
|
583
|
+
r: Math.min(255, Math.max(n.r, 0)),
|
|
584
|
+
g: Math.min(255, Math.max(n.g, 0)),
|
|
585
|
+
b: Math.min(255, Math.max(n.b, 0)),
|
|
586
|
+
a: e
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
var Be = "[-\\+]?\\d+%?", Ae = "[-\\+]?\\d*\\.\\d+%?", C = "(?:".concat(Ae, ")|(?:").concat(Be, ")"), D = "[\\s|\\(]+(".concat(C, ")[,|\\s]+(").concat(C, ")[,|\\s]+(").concat(C, ")\\s*\\)?"), L = "[\\s|\\(]+(".concat(C, ")[,|\\s]+(").concat(C, ")[,|\\s]+(").concat(C, ")[,|\\s]+(").concat(C, ")\\s*\\)?"), _ = {
|
|
590
|
+
CSS_UNIT: new RegExp(C),
|
|
591
|
+
rgb: new RegExp("rgb" + D),
|
|
592
|
+
rgba: new RegExp("rgba" + L),
|
|
593
|
+
hsl: new RegExp("hsl" + D),
|
|
594
|
+
hsla: new RegExp("hsla" + L),
|
|
595
|
+
hsv: new RegExp("hsv" + D),
|
|
596
|
+
hsva: new RegExp("hsva" + L),
|
|
597
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
598
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
599
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
600
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
601
|
+
};
|
|
602
|
+
function Ne(t) {
|
|
603
|
+
if (t = t.trim().toLowerCase(), t.length === 0)
|
|
604
|
+
return !1;
|
|
605
|
+
var n = !1;
|
|
606
|
+
if (W[t])
|
|
607
|
+
t = W[t], n = !0;
|
|
608
|
+
else if (t === "transparent")
|
|
609
|
+
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
610
|
+
var e = _.rgb.exec(t);
|
|
611
|
+
return e ? { r: e[1], g: e[2], b: e[3] } : (e = _.rgba.exec(t), e ? { r: e[1], g: e[2], b: e[3], a: e[4] } : (e = _.hsl.exec(t), e ? { h: e[1], s: e[2], l: e[3] } : (e = _.hsla.exec(t), e ? { h: e[1], s: e[2], l: e[3], a: e[4] } : (e = _.hsv.exec(t), e ? { h: e[1], s: e[2], v: e[3] } : (e = _.hsva.exec(t), e ? { h: e[1], s: e[2], v: e[3], a: e[4] } : (e = _.hex8.exec(t), e ? {
|
|
612
|
+
r: x(e[1]),
|
|
613
|
+
g: x(e[2]),
|
|
614
|
+
b: x(e[3]),
|
|
615
|
+
a: ut(e[4]),
|
|
616
|
+
format: n ? "name" : "hex8"
|
|
617
|
+
} : (e = _.hex6.exec(t), e ? {
|
|
618
|
+
r: x(e[1]),
|
|
619
|
+
g: x(e[2]),
|
|
620
|
+
b: x(e[3]),
|
|
621
|
+
format: n ? "name" : "hex"
|
|
622
|
+
} : (e = _.hex4.exec(t), e ? {
|
|
623
|
+
r: x(e[1] + e[1]),
|
|
624
|
+
g: x(e[2] + e[2]),
|
|
625
|
+
b: x(e[3] + e[3]),
|
|
626
|
+
a: ut(e[4] + e[4]),
|
|
627
|
+
format: n ? "name" : "hex8"
|
|
628
|
+
} : (e = _.hex3.exec(t), e ? {
|
|
629
|
+
r: x(e[1] + e[1]),
|
|
630
|
+
g: x(e[2] + e[2]),
|
|
631
|
+
b: x(e[3] + e[3]),
|
|
632
|
+
format: n ? "name" : "hex"
|
|
633
|
+
} : !1)))))))));
|
|
634
|
+
}
|
|
635
|
+
function M(t) {
|
|
636
|
+
return !!_.CSS_UNIT.exec(String(t));
|
|
637
|
+
}
|
|
638
|
+
var Ce = (
|
|
639
|
+
/** @class */
|
|
640
|
+
(function() {
|
|
641
|
+
function t(n, e) {
|
|
642
|
+
n === void 0 && (n = ""), e === void 0 && (e = {});
|
|
643
|
+
var r;
|
|
644
|
+
if (n instanceof t)
|
|
645
|
+
return n;
|
|
646
|
+
typeof n == "number" && (n = we(n)), this.originalInput = n;
|
|
647
|
+
var a = Me(n);
|
|
648
|
+
this.originalInput = n, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (r = e.format) !== null && r !== void 0 ? r : a.format, this.gradientType = e.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok;
|
|
649
|
+
}
|
|
650
|
+
return t.prototype.isDark = function() {
|
|
651
|
+
return this.getBrightness() < 128;
|
|
652
|
+
}, t.prototype.isLight = function() {
|
|
653
|
+
return !this.isDark();
|
|
654
|
+
}, t.prototype.getBrightness = function() {
|
|
655
|
+
var n = this.toRgb();
|
|
656
|
+
return (n.r * 299 + n.g * 587 + n.b * 114) / 1e3;
|
|
657
|
+
}, t.prototype.getLuminance = function() {
|
|
658
|
+
var n = this.toRgb(), e, r, a, o = n.r / 255, i = n.g / 255, c = n.b / 255;
|
|
659
|
+
return o <= 0.03928 ? e = o / 12.92 : e = Math.pow((o + 0.055) / 1.055, 2.4), i <= 0.03928 ? r = i / 12.92 : r = Math.pow((i + 0.055) / 1.055, 2.4), c <= 0.03928 ? a = c / 12.92 : a = Math.pow((c + 0.055) / 1.055, 2.4), 0.2126 * e + 0.7152 * r + 0.0722 * a;
|
|
660
|
+
}, t.prototype.getAlpha = function() {
|
|
661
|
+
return this.a;
|
|
662
|
+
}, t.prototype.setAlpha = function(n) {
|
|
663
|
+
return this.a = wt(n), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
664
|
+
}, t.prototype.isMonochrome = function() {
|
|
665
|
+
var n = this.toHsl().s;
|
|
666
|
+
return n === 0;
|
|
667
|
+
}, t.prototype.toHsv = function() {
|
|
668
|
+
var n = ct(this.r, this.g, this.b);
|
|
669
|
+
return { h: n.h * 360, s: n.s, v: n.v, a: this.a };
|
|
670
|
+
}, t.prototype.toHsvString = function() {
|
|
671
|
+
var n = ct(this.r, this.g, this.b), e = Math.round(n.h * 360), r = Math.round(n.s * 100), a = Math.round(n.v * 100);
|
|
672
|
+
return this.a === 1 ? "hsv(".concat(e, ", ").concat(r, "%, ").concat(a, "%)") : "hsva(".concat(e, ", ").concat(r, "%, ").concat(a, "%, ").concat(this.roundA, ")");
|
|
673
|
+
}, t.prototype.toHsl = function() {
|
|
674
|
+
var n = st(this.r, this.g, this.b);
|
|
675
|
+
return { h: n.h * 360, s: n.s, l: n.l, a: this.a };
|
|
676
|
+
}, t.prototype.toHslString = function() {
|
|
677
|
+
var n = st(this.r, this.g, this.b), e = Math.round(n.h * 360), r = Math.round(n.s * 100), a = Math.round(n.l * 100);
|
|
678
|
+
return this.a === 1 ? "hsl(".concat(e, ", ").concat(r, "%, ").concat(a, "%)") : "hsla(".concat(e, ", ").concat(r, "%, ").concat(a, "%, ").concat(this.roundA, ")");
|
|
679
|
+
}, t.prototype.toHex = function(n) {
|
|
680
|
+
return n === void 0 && (n = !1), lt(this.r, this.g, this.b, n);
|
|
681
|
+
}, t.prototype.toHexString = function(n) {
|
|
682
|
+
return n === void 0 && (n = !1), "#" + this.toHex(n);
|
|
683
|
+
}, t.prototype.toHex8 = function(n) {
|
|
684
|
+
return n === void 0 && (n = !1), _e(this.r, this.g, this.b, this.a, n);
|
|
685
|
+
}, t.prototype.toHex8String = function(n) {
|
|
686
|
+
return n === void 0 && (n = !1), "#" + this.toHex8(n);
|
|
687
|
+
}, t.prototype.toHexShortString = function(n) {
|
|
688
|
+
return n === void 0 && (n = !1), this.a === 1 ? this.toHexString(n) : this.toHex8String(n);
|
|
689
|
+
}, t.prototype.toRgb = function() {
|
|
690
|
+
return {
|
|
691
|
+
r: Math.round(this.r),
|
|
692
|
+
g: Math.round(this.g),
|
|
693
|
+
b: Math.round(this.b),
|
|
694
|
+
a: this.a
|
|
695
|
+
};
|
|
696
|
+
}, t.prototype.toRgbString = function() {
|
|
697
|
+
var n = Math.round(this.r), e = Math.round(this.g), r = Math.round(this.b);
|
|
698
|
+
return this.a === 1 ? "rgb(".concat(n, ", ").concat(e, ", ").concat(r, ")") : "rgba(".concat(n, ", ").concat(e, ", ").concat(r, ", ").concat(this.roundA, ")");
|
|
699
|
+
}, t.prototype.toPercentageRgb = function() {
|
|
700
|
+
var n = function(e) {
|
|
701
|
+
return "".concat(Math.round(p(e, 255) * 100), "%");
|
|
702
|
+
};
|
|
703
|
+
return {
|
|
704
|
+
r: n(this.r),
|
|
705
|
+
g: n(this.g),
|
|
706
|
+
b: n(this.b),
|
|
707
|
+
a: this.a
|
|
708
|
+
};
|
|
709
|
+
}, t.prototype.toPercentageRgbString = function() {
|
|
710
|
+
var n = function(e) {
|
|
711
|
+
return Math.round(p(e, 255) * 100);
|
|
712
|
+
};
|
|
713
|
+
return this.a === 1 ? "rgb(".concat(n(this.r), "%, ").concat(n(this.g), "%, ").concat(n(this.b), "%)") : "rgba(".concat(n(this.r), "%, ").concat(n(this.g), "%, ").concat(n(this.b), "%, ").concat(this.roundA, ")");
|
|
714
|
+
}, t.prototype.toName = function() {
|
|
715
|
+
if (this.a === 0)
|
|
716
|
+
return "transparent";
|
|
717
|
+
if (this.a < 1)
|
|
718
|
+
return !1;
|
|
719
|
+
for (var n = "#" + lt(this.r, this.g, this.b, !1), e = 0, r = Object.entries(W); e < r.length; e++) {
|
|
720
|
+
var a = r[e], o = a[0], i = a[1];
|
|
721
|
+
if (n === i)
|
|
722
|
+
return o;
|
|
723
|
+
}
|
|
724
|
+
return !1;
|
|
725
|
+
}, t.prototype.toString = function(n) {
|
|
726
|
+
var e = !!n;
|
|
727
|
+
n = n ?? this.format;
|
|
728
|
+
var r = !1, a = this.a < 1 && this.a >= 0, o = !e && a && (n.startsWith("hex") || n === "name");
|
|
729
|
+
return o ? n === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (n === "rgb" && (r = this.toRgbString()), n === "prgb" && (r = this.toPercentageRgbString()), (n === "hex" || n === "hex6") && (r = this.toHexString()), n === "hex3" && (r = this.toHexString(!0)), n === "hex4" && (r = this.toHex8String(!0)), n === "hex8" && (r = this.toHex8String()), n === "name" && (r = this.toName()), n === "hsl" && (r = this.toHslString()), n === "hsv" && (r = this.toHsvString()), r || this.toHexString());
|
|
730
|
+
}, t.prototype.toNumber = function() {
|
|
731
|
+
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
|
|
732
|
+
}, t.prototype.clone = function() {
|
|
733
|
+
return new t(this.toString());
|
|
734
|
+
}, t.prototype.lighten = function(n) {
|
|
735
|
+
n === void 0 && (n = 10);
|
|
736
|
+
var e = this.toHsl();
|
|
737
|
+
return e.l += n / 100, e.l = P(e.l), new t(e);
|
|
738
|
+
}, t.prototype.brighten = function(n) {
|
|
739
|
+
n === void 0 && (n = 10);
|
|
740
|
+
var e = this.toRgb();
|
|
741
|
+
return e.r = Math.max(0, Math.min(255, e.r - Math.round(255 * -(n / 100)))), e.g = Math.max(0, Math.min(255, e.g - Math.round(255 * -(n / 100)))), e.b = Math.max(0, Math.min(255, e.b - Math.round(255 * -(n / 100)))), new t(e);
|
|
742
|
+
}, t.prototype.darken = function(n) {
|
|
743
|
+
n === void 0 && (n = 10);
|
|
744
|
+
var e = this.toHsl();
|
|
745
|
+
return e.l -= n / 100, e.l = P(e.l), new t(e);
|
|
746
|
+
}, t.prototype.tint = function(n) {
|
|
747
|
+
return n === void 0 && (n = 10), this.mix("white", n);
|
|
748
|
+
}, t.prototype.shade = function(n) {
|
|
749
|
+
return n === void 0 && (n = 10), this.mix("black", n);
|
|
750
|
+
}, t.prototype.desaturate = function(n) {
|
|
751
|
+
n === void 0 && (n = 10);
|
|
752
|
+
var e = this.toHsl();
|
|
753
|
+
return e.s -= n / 100, e.s = P(e.s), new t(e);
|
|
754
|
+
}, t.prototype.saturate = function(n) {
|
|
755
|
+
n === void 0 && (n = 10);
|
|
756
|
+
var e = this.toHsl();
|
|
757
|
+
return e.s += n / 100, e.s = P(e.s), new t(e);
|
|
758
|
+
}, t.prototype.greyscale = function() {
|
|
759
|
+
return this.desaturate(100);
|
|
760
|
+
}, t.prototype.spin = function(n) {
|
|
761
|
+
var e = this.toHsl(), r = (e.h + n) % 360;
|
|
762
|
+
return e.h = r < 0 ? 360 + r : r, new t(e);
|
|
763
|
+
}, t.prototype.mix = function(n, e) {
|
|
764
|
+
e === void 0 && (e = 50);
|
|
765
|
+
var r = this.toRgb(), a = new t(n).toRgb(), o = e / 100, i = {
|
|
766
|
+
r: (a.r - r.r) * o + r.r,
|
|
767
|
+
g: (a.g - r.g) * o + r.g,
|
|
768
|
+
b: (a.b - r.b) * o + r.b,
|
|
769
|
+
a: (a.a - r.a) * o + r.a
|
|
770
|
+
};
|
|
771
|
+
return new t(i);
|
|
772
|
+
}, t.prototype.analogous = function(n, e) {
|
|
773
|
+
n === void 0 && (n = 6), e === void 0 && (e = 30);
|
|
774
|
+
var r = this.toHsl(), a = 360 / e, o = [this];
|
|
775
|
+
for (r.h = (r.h - (a * n >> 1) + 720) % 360; --n; )
|
|
776
|
+
r.h = (r.h + a) % 360, o.push(new t(r));
|
|
777
|
+
return o;
|
|
778
|
+
}, t.prototype.complement = function() {
|
|
779
|
+
var n = this.toHsl();
|
|
780
|
+
return n.h = (n.h + 180) % 360, new t(n);
|
|
781
|
+
}, t.prototype.monochromatic = function(n) {
|
|
782
|
+
n === void 0 && (n = 6);
|
|
783
|
+
for (var e = this.toHsv(), r = e.h, a = e.s, o = e.v, i = [], c = 1 / n; n--; )
|
|
784
|
+
i.push(new t({ h: r, s: a, v: o })), o = (o + c) % 1;
|
|
785
|
+
return i;
|
|
786
|
+
}, t.prototype.splitcomplement = function() {
|
|
787
|
+
var n = this.toHsl(), e = n.h;
|
|
788
|
+
return [
|
|
789
|
+
this,
|
|
790
|
+
new t({ h: (e + 72) % 360, s: n.s, l: n.l }),
|
|
791
|
+
new t({ h: (e + 216) % 360, s: n.s, l: n.l })
|
|
792
|
+
];
|
|
793
|
+
}, t.prototype.onBackground = function(n) {
|
|
794
|
+
var e = this.toRgb(), r = new t(n).toRgb(), a = e.a + r.a * (1 - e.a);
|
|
795
|
+
return new t({
|
|
796
|
+
r: (e.r * e.a + r.r * r.a * (1 - e.a)) / a,
|
|
797
|
+
g: (e.g * e.a + r.g * r.a * (1 - e.a)) / a,
|
|
798
|
+
b: (e.b * e.a + r.b * r.a * (1 - e.a)) / a,
|
|
799
|
+
a
|
|
800
|
+
});
|
|
801
|
+
}, t.prototype.triad = function() {
|
|
802
|
+
return this.polyad(3);
|
|
803
|
+
}, t.prototype.tetrad = function() {
|
|
804
|
+
return this.polyad(4);
|
|
805
|
+
}, t.prototype.polyad = function(n) {
|
|
806
|
+
for (var e = this.toHsl(), r = e.h, a = [this], o = 360 / n, i = 1; i < n; i++)
|
|
807
|
+
a.push(new t({ h: (r + i * o) % 360, s: e.s, l: e.l }));
|
|
808
|
+
return a;
|
|
809
|
+
}, t.prototype.equals = function(n) {
|
|
810
|
+
return this.toRgbString() === new t(n).toRgbString();
|
|
811
|
+
}, t;
|
|
812
|
+
})()
|
|
813
|
+
);
|
|
814
|
+
function N(t, n = 20) {
|
|
815
|
+
return t.mix("#141414", n).toString();
|
|
816
|
+
}
|
|
817
|
+
function $e(t) {
|
|
818
|
+
const n = _t(), e = z("button");
|
|
819
|
+
return v(() => {
|
|
820
|
+
let r = {}, a = t.color;
|
|
821
|
+
if (a) {
|
|
822
|
+
const o = a.match(/var\((.*?)\)/);
|
|
823
|
+
o && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1]));
|
|
824
|
+
const i = new Ce(a), c = t.dark ? i.tint(20).toString() : N(i, 20);
|
|
825
|
+
if (t.plain)
|
|
826
|
+
r = e.cssVarBlock({
|
|
827
|
+
"bg-color": t.dark ? N(i, 90) : i.tint(90).toString(),
|
|
828
|
+
"text-color": a,
|
|
829
|
+
"border-color": t.dark ? N(i, 50) : i.tint(50).toString(),
|
|
830
|
+
"hover-text-color": `var(${e.cssVarName("color-white")})`,
|
|
831
|
+
"hover-bg-color": a,
|
|
832
|
+
"hover-border-color": a,
|
|
833
|
+
"active-bg-color": c,
|
|
834
|
+
"active-text-color": `var(${e.cssVarName("color-white")})`,
|
|
835
|
+
"active-border-color": c
|
|
836
|
+
}), n.value && (r[e.cssVarBlockName("disabled-bg-color")] = t.dark ? N(i, 90) : i.tint(90).toString(), r[e.cssVarBlockName("disabled-text-color")] = t.dark ? N(i, 50) : i.tint(50).toString(), r[e.cssVarBlockName("disabled-border-color")] = t.dark ? N(i, 80) : i.tint(80).toString());
|
|
837
|
+
else {
|
|
838
|
+
const l = t.dark ? N(i, 30) : i.tint(30).toString(), h = i.isDark() ? `var(${e.cssVarName("color-white")})` : `var(${e.cssVarName("color-black")})`;
|
|
839
|
+
if (r = e.cssVarBlock({
|
|
840
|
+
"bg-color": a,
|
|
841
|
+
"text-color": h,
|
|
842
|
+
"border-color": a,
|
|
843
|
+
"hover-bg-color": l,
|
|
844
|
+
"hover-text-color": h,
|
|
845
|
+
"hover-border-color": l,
|
|
846
|
+
"active-bg-color": c,
|
|
847
|
+
"active-border-color": c
|
|
848
|
+
}), n.value) {
|
|
849
|
+
const g = t.dark ? N(i, 50) : i.tint(50).toString();
|
|
850
|
+
r[e.cssVarBlockName("disabled-bg-color")] = g, r[e.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${e.cssVarName("color-white")})`, r[e.cssVarBlockName("disabled-border-color")] = g;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
return r;
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
const Ee = $({
|
|
858
|
+
name: "ElButton"
|
|
859
|
+
}), He = /* @__PURE__ */ $({
|
|
860
|
+
...Ee,
|
|
861
|
+
props: U,
|
|
862
|
+
emits: pe,
|
|
863
|
+
setup(t, { expose: n, emit: e }) {
|
|
864
|
+
const r = t, a = $e(r), o = z("button"), {
|
|
865
|
+
_ref: i,
|
|
866
|
+
_size: c,
|
|
867
|
+
_type: l,
|
|
868
|
+
_disabled: h,
|
|
869
|
+
_props: g,
|
|
870
|
+
_plain: b,
|
|
871
|
+
_round: A,
|
|
872
|
+
_text: S,
|
|
873
|
+
shouldAddSpace: w,
|
|
874
|
+
handleClick: u
|
|
875
|
+
} = he(r, e), f = v(() => [
|
|
876
|
+
o.b(),
|
|
877
|
+
o.m(l.value),
|
|
878
|
+
o.m(c.value),
|
|
879
|
+
o.is("disabled", h.value),
|
|
880
|
+
o.is("loading", r.loading),
|
|
881
|
+
o.is("plain", b.value),
|
|
882
|
+
o.is("round", A.value),
|
|
883
|
+
o.is("circle", r.circle),
|
|
884
|
+
o.is("text", S.value),
|
|
885
|
+
o.is("link", r.link),
|
|
886
|
+
o.is("has-bg", r.bg)
|
|
887
|
+
]);
|
|
888
|
+
return n({
|
|
889
|
+
ref: i,
|
|
890
|
+
size: c,
|
|
891
|
+
type: l,
|
|
892
|
+
disabled: h,
|
|
893
|
+
shouldAddSpace: w
|
|
894
|
+
}), (s, m) => (k(), T(F(s.tag), ht({
|
|
895
|
+
ref_key: "_ref",
|
|
896
|
+
ref: i
|
|
897
|
+
}, d(g), {
|
|
898
|
+
class: d(f),
|
|
899
|
+
style: d(a),
|
|
900
|
+
onClick: d(u)
|
|
901
|
+
}), {
|
|
902
|
+
default: j(() => [
|
|
903
|
+
s.loading ? (k(), R(Tt, { key: 0 }, [
|
|
904
|
+
s.$slots.loading ? O(s.$slots, "loading", { key: 0 }) : (k(), T(d(ot), {
|
|
905
|
+
key: 1,
|
|
906
|
+
class: q(d(o).is("loading"))
|
|
907
|
+
}, {
|
|
908
|
+
default: j(() => [
|
|
909
|
+
(k(), T(F(s.loadingIcon)))
|
|
910
|
+
]),
|
|
911
|
+
_: 1
|
|
912
|
+
}, 8, ["class"]))
|
|
913
|
+
], 64)) : s.icon || s.$slots.icon ? (k(), T(d(ot), { key: 1 }, {
|
|
914
|
+
default: j(() => [
|
|
915
|
+
s.icon ? (k(), T(F(s.icon), { key: 0 })) : O(s.$slots, "icon", { key: 1 })
|
|
916
|
+
]),
|
|
917
|
+
_: 3
|
|
918
|
+
})) : X("v-if", !0),
|
|
919
|
+
s.$slots.default ? (k(), R("span", {
|
|
920
|
+
key: 2,
|
|
921
|
+
class: q({ [d(o).em("text", "expand")]: d(w) })
|
|
922
|
+
}, [
|
|
923
|
+
O(s.$slots, "default")
|
|
924
|
+
], 2)) : X("v-if", !0)
|
|
925
|
+
]),
|
|
926
|
+
_: 3
|
|
927
|
+
}, 16, ["class", "style", "onClick"]));
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
var Te = /* @__PURE__ */ Y(He, [["__file", "button.vue"]]);
|
|
931
|
+
const Oe = {
|
|
932
|
+
size: U.size,
|
|
933
|
+
type: U.type
|
|
934
|
+
}, Ie = $({
|
|
935
|
+
name: "ElButtonGroup"
|
|
936
|
+
}), Re = /* @__PURE__ */ $({
|
|
937
|
+
...Ie,
|
|
938
|
+
props: Oe,
|
|
939
|
+
setup(t) {
|
|
940
|
+
const n = t;
|
|
941
|
+
Ot(kt, It({
|
|
942
|
+
size: tt(n, "size"),
|
|
943
|
+
type: tt(n, "type")
|
|
944
|
+
}));
|
|
945
|
+
const e = z("button");
|
|
946
|
+
return (r, a) => (k(), R("div", {
|
|
947
|
+
class: q(d(e).b("group"))
|
|
948
|
+
}, [
|
|
949
|
+
O(r.$slots, "default")
|
|
950
|
+
], 2));
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
var Mt = /* @__PURE__ */ Y(Re, [["__file", "button-group.vue"]]);
|
|
954
|
+
const Pe = yt(Te, {
|
|
955
|
+
ButtonGroup: Mt
|
|
956
|
+
});
|
|
957
|
+
re(Mt);
|
|
958
|
+
const Bt = (t, n) => {
|
|
959
|
+
if (typeof t != "object" || typeof n != "object")
|
|
960
|
+
return n ?? t;
|
|
961
|
+
const e = { ...t };
|
|
962
|
+
return Object.keys(n).forEach((r) => {
|
|
963
|
+
n[r] && typeof n[r] == "object" && !Array.isArray(n[r]) ? e[r] = Bt(t[r] || {}, n[r]) : e[r] = n[r] !== void 0 ? n[r] : t[r];
|
|
964
|
+
}), e;
|
|
965
|
+
}, Ve = (t) => Object.prototype.toString.call(t) === "[object Object]", ft = (t) => Array.isArray(t), dt = (t, n = 300, e = !1) => {
|
|
966
|
+
let r = null;
|
|
967
|
+
const a = function(...o) {
|
|
968
|
+
r && clearTimeout(r);
|
|
969
|
+
let i;
|
|
970
|
+
return e && !r && (i = t.apply(this, o)), r = setTimeout(() => {
|
|
971
|
+
e || t.apply(this, o), r = null;
|
|
972
|
+
}, n), i;
|
|
973
|
+
};
|
|
974
|
+
return a.cancel = () => {
|
|
975
|
+
r && (clearTimeout(r), r = null);
|
|
976
|
+
}, a;
|
|
977
|
+
}, je = {
|
|
978
|
+
/**
|
|
979
|
+
* 按钮文本
|
|
980
|
+
*/
|
|
981
|
+
btnText: {
|
|
982
|
+
type: String,
|
|
983
|
+
default: "欢迎使用wyfe-ivue按钮组件"
|
|
984
|
+
},
|
|
985
|
+
/**
|
|
986
|
+
* 按钮类型 同ElButton类型
|
|
987
|
+
*/
|
|
988
|
+
type: {
|
|
989
|
+
type: String,
|
|
990
|
+
default: "primary"
|
|
991
|
+
},
|
|
992
|
+
/**
|
|
993
|
+
* 扩展配置 如【防抖/二次确认】等
|
|
994
|
+
*/
|
|
995
|
+
extConfig: {
|
|
996
|
+
type: Object,
|
|
997
|
+
default: () => ({})
|
|
998
|
+
}
|
|
999
|
+
}, ze = {
|
|
1000
|
+
/**
|
|
1001
|
+
* 防抖配置项
|
|
1002
|
+
* enable:是否启用防抖 默认启用
|
|
1003
|
+
* delay:防抖时间 默认500ms
|
|
1004
|
+
* immediate:是否立即开启防抖 默认否
|
|
1005
|
+
*/
|
|
1006
|
+
debounce: { enable: !0, delay: 500, immediate: !1 },
|
|
1007
|
+
/**
|
|
1008
|
+
* 二次确认配置项
|
|
1009
|
+
* type:二次确认类型 默认danger,同ElButton类型
|
|
1010
|
+
* data:二次确认数据 显式设置则开启二次确认,可为String、Number、Object、Array
|
|
1011
|
+
* dataKey:二次确认数据主键key 默认id,对象或对象数组需要
|
|
1012
|
+
* isJoin:是否将ids数组转换为以逗号分隔的字符串 如:[1,2] => '1,2'
|
|
1013
|
+
* title:二次确认弹框标题
|
|
1014
|
+
* content:二次确认弹框内容
|
|
1015
|
+
*/
|
|
1016
|
+
confirm: {
|
|
1017
|
+
type: "danger",
|
|
1018
|
+
dataKey: "id",
|
|
1019
|
+
isJoin: !1,
|
|
1020
|
+
title: "删除提示",
|
|
1021
|
+
content: "确定将选择数据删除?"
|
|
1022
|
+
}
|
|
1023
|
+
}, Fe = ({ props: t, emits: n, attrs: e }) => {
|
|
1024
|
+
const r = v(
|
|
1025
|
+
() => Bt(ze, t.extConfig)
|
|
1026
|
+
), o = dt(
|
|
1027
|
+
async (l) => {
|
|
1028
|
+
if (!["object", "number", "string"].includes(typeof l)) {
|
|
1029
|
+
et.warning(
|
|
1030
|
+
"clickConfig.data类型必须为Array、Object、String或Number"
|
|
1031
|
+
);
|
|
1032
|
+
return;
|
|
1033
|
+
}
|
|
1034
|
+
const { title: h, content: g, dataKey: b, isJoin: A } = r.value.confirm;
|
|
1035
|
+
if (["number", "string"].includes(typeof l)) {
|
|
1036
|
+
try {
|
|
1037
|
+
await nt.confirm(g, h, {
|
|
1038
|
+
confirmButtonText: "确定",
|
|
1039
|
+
cancelButtonText: "取消",
|
|
1040
|
+
type: "warning"
|
|
1041
|
+
}), n("onClick", l);
|
|
1042
|
+
} catch {
|
|
1043
|
+
}
|
|
1044
|
+
return;
|
|
1045
|
+
}
|
|
1046
|
+
if (Ve(l) && !Object.keys(l).length || ft(l) && !l.length) {
|
|
1047
|
+
et.warning("请至少选择一条数据");
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
try {
|
|
1051
|
+
await nt.confirm(g, h, {
|
|
1052
|
+
confirmButtonText: "确定",
|
|
1053
|
+
cancelButtonText: "取消",
|
|
1054
|
+
type: "warning"
|
|
1055
|
+
});
|
|
1056
|
+
const S = ft(l) ? l.map((w) => typeof w == "object" ? w[b] : w) : [l[b]];
|
|
1057
|
+
n("onClick", {
|
|
1058
|
+
[`${b}s`]: A ? S.join() : S,
|
|
1059
|
+
rawData: l
|
|
1060
|
+
});
|
|
1061
|
+
} catch {
|
|
1062
|
+
}
|
|
1063
|
+
},
|
|
1064
|
+
r.value.debounce.delay,
|
|
1065
|
+
r.value.debounce.immediate
|
|
1066
|
+
), i = dt(
|
|
1067
|
+
() => n("onClick"),
|
|
1068
|
+
r.value.debounce.delay,
|
|
1069
|
+
r.value.debounce.immediate
|
|
1070
|
+
);
|
|
1071
|
+
return { mergedExtConfig: r, handleElButton: () => {
|
|
1072
|
+
e.onClick || (r.value.confirm.hasOwnProperty("data") ? o(r.value.confirm.data) : i());
|
|
1073
|
+
} };
|
|
1074
|
+
}, Ge = /* @__PURE__ */ $({
|
|
1075
|
+
__name: "index",
|
|
1076
|
+
props: je,
|
|
1077
|
+
emits: ["onClick"],
|
|
1078
|
+
setup(t, { emit: n }) {
|
|
1079
|
+
const e = t, r = n, a = Rt(), { mergedExtConfig: o, handleElButton: i } = Fe({
|
|
1080
|
+
props: e,
|
|
1081
|
+
emits: r,
|
|
1082
|
+
attrs: a
|
|
1083
|
+
});
|
|
1084
|
+
return Pt(() => {
|
|
1085
|
+
document.querySelectorAll(".el-button").forEach((c) => {
|
|
1086
|
+
c.addEventListener(
|
|
1087
|
+
"blur",
|
|
1088
|
+
(l) => {
|
|
1089
|
+
l.target.classList.add("blur");
|
|
1090
|
+
},
|
|
1091
|
+
!0
|
|
1092
|
+
);
|
|
1093
|
+
});
|
|
1094
|
+
}), (c, l) => {
|
|
1095
|
+
const h = Pe;
|
|
1096
|
+
return k(), T(h, {
|
|
1097
|
+
class: "wyfe-ivue_useElButton",
|
|
1098
|
+
type: d(o).confirm.hasOwnProperty("data") ? d(o).confirm.type : c.type,
|
|
1099
|
+
onClick: d(i)
|
|
1100
|
+
}, {
|
|
1101
|
+
default: j(() => [
|
|
1102
|
+
Vt(jt(c.btnText), 1)
|
|
1103
|
+
]),
|
|
1104
|
+
_: 1
|
|
1105
|
+
}, 8, ["type", "onClick"]);
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
}), Ke = (t, n) => {
|
|
1109
|
+
const e = t.__vccOpts || t;
|
|
1110
|
+
for (const [r, a] of n)
|
|
1111
|
+
e[r] = a;
|
|
1112
|
+
return e;
|
|
1113
|
+
}, qe = /* @__PURE__ */ Ke(Ge, [["__scopeId", "data-v-43b2597a"]]);
|
|
1114
|
+
export {
|
|
1115
|
+
qe as UseElButton
|
|
1116
|
+
};
|