wyfe-ivue 1.1.0 → 1.2.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/dist/index.es.js +555 -465
- package/dist/{index.umd.js → index.umd.cjs} +2 -2
- package/dist/types/index.d.ts +53 -0
- package/dist/wyfe-ivue.css +1 -1
- package/package.json +9 -1
package/dist/index.es.js
CHANGED
|
@@ -1,250 +1,250 @@
|
|
|
1
|
-
import { getCurrentInstance as Z, inject as M, ref as
|
|
2
|
-
import { ElMessage as
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
return
|
|
6
|
-
},
|
|
7
|
-
const e = Z() ? M(
|
|
8
|
-
return
|
|
9
|
-
},
|
|
10
|
-
const
|
|
1
|
+
import { getCurrentInstance as Z, inject as M, ref as V, computed as h, unref as p, warn as Nt, defineComponent as A, createElementBlock as I, openBlock as x, mergeProps as gt, renderSlot as T, createElementVNode as pt, watch as Ot, useSlots as Ht, Text as It, createBlock as H, resolveDynamicComponent as D, withCtx as R, createCommentVNode as tt, Fragment as Tt, normalizeClass as j, provide as Vt, reactive as zt, toRef as et, useAttrs as Pt, onMounted as Rt, createTextVNode as jt, toDisplayString as Ft, useCssVars as Gt, normalizeStyle as Dt } from "vue";
|
|
2
|
+
import { ElMessage as rt, ElMessageBox as nt } from "element-plus";
|
|
3
|
+
const Kt = /* @__PURE__ */ Symbol(), K = "el", Lt = "is-", N = (t, e, r, n, o) => {
|
|
4
|
+
let a = `${t}-${e}`;
|
|
5
|
+
return r && (a += `-${r}`), n && (a += `__${n}`), o && (a += `--${o}`), a;
|
|
6
|
+
}, Ut = /* @__PURE__ */ Symbol("namespaceContextKey"), qt = (t) => {
|
|
7
|
+
const e = Z() ? M(Ut, V(K)) : V(K);
|
|
8
|
+
return h(() => p(e) || K);
|
|
9
|
+
}, F = (t, e) => {
|
|
10
|
+
const r = qt();
|
|
11
11
|
return {
|
|
12
|
-
namespace:
|
|
13
|
-
b: (l = "") =>
|
|
14
|
-
e: (l) => l ?
|
|
15
|
-
m: (l) => l ?
|
|
16
|
-
be: (l,
|
|
17
|
-
em: (l,
|
|
18
|
-
bm: (l,
|
|
19
|
-
bem: (l,
|
|
20
|
-
is: (l, ...
|
|
21
|
-
const c =
|
|
22
|
-
return l && c ? `${
|
|
12
|
+
namespace: r,
|
|
13
|
+
b: (l = "") => N(r.value, t, l, "", ""),
|
|
14
|
+
e: (l) => l ? N(r.value, t, "", l, "") : "",
|
|
15
|
+
m: (l) => l ? N(r.value, t, "", "", l) : "",
|
|
16
|
+
be: (l, d) => l && d ? N(r.value, t, l, d, "") : "",
|
|
17
|
+
em: (l, d) => l && d ? N(r.value, t, "", l, d) : "",
|
|
18
|
+
bm: (l, d) => l && d ? N(r.value, t, l, "", d) : "",
|
|
19
|
+
bem: (l, d, c) => l && d && c ? N(r.value, t, l, d, c) : "",
|
|
20
|
+
is: (l, ...d) => {
|
|
21
|
+
const c = d.length >= 1 ? d[0] : !0;
|
|
22
|
+
return l && c ? `${Lt}${l}` : "";
|
|
23
23
|
},
|
|
24
24
|
cssVar: (l) => {
|
|
25
|
-
const
|
|
25
|
+
const d = {};
|
|
26
26
|
for (const c in l)
|
|
27
|
-
l[c] && (
|
|
28
|
-
return
|
|
27
|
+
l[c] && (d[`--${r.value}-${c}`] = l[c]);
|
|
28
|
+
return d;
|
|
29
29
|
},
|
|
30
|
-
cssVarName: (l) => `--${
|
|
30
|
+
cssVarName: (l) => `--${r.value}-${l}`,
|
|
31
31
|
cssVarBlock: (l) => {
|
|
32
|
-
const
|
|
32
|
+
const d = {};
|
|
33
33
|
for (const c in l)
|
|
34
|
-
l[c] && (
|
|
35
|
-
return
|
|
34
|
+
l[c] && (d[`--${r.value}-${t}-${c}`] = l[c]);
|
|
35
|
+
return d;
|
|
36
36
|
},
|
|
37
|
-
cssVarBlockName: (l) => `--${
|
|
37
|
+
cssVarBlockName: (l) => `--${r.value}-${t}-${l}`
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
process.env.NODE_ENV !== "production" && Object.freeze({});
|
|
41
41
|
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
42
|
-
const
|
|
43
|
-
},
|
|
44
|
-
function
|
|
45
|
-
for (var e = -1,
|
|
46
|
-
var
|
|
47
|
-
|
|
42
|
+
const Wt = () => {
|
|
43
|
+
}, Jt = Object.prototype.hasOwnProperty, ot = (t, e) => Jt.call(t, e), Y = (t) => typeof t == "string", vt = (t) => t !== null && typeof t == "object";
|
|
44
|
+
function Zt(t) {
|
|
45
|
+
for (var e = -1, r = t == null ? 0 : t.length, n = {}; ++e < r; ) {
|
|
46
|
+
var o = t[e];
|
|
47
|
+
n[o[0]] = o[1];
|
|
48
48
|
}
|
|
49
|
-
return
|
|
49
|
+
return n;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
class
|
|
51
|
+
const Yt = (t) => typeof t == "number", Qt = (t) => Y(t) ? !Number.isNaN(Number(t)) : !1;
|
|
52
|
+
class Xt extends Error {
|
|
53
53
|
constructor(e) {
|
|
54
54
|
super(e), this.name = "ElementPlusError";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
function bt(t, e) {
|
|
58
58
|
if (typeof process < "u" && process.env.NODE_ENV !== "production") {
|
|
59
|
-
const
|
|
59
|
+
const r = Y(t) ? new Xt(`[${t}] ${e}`) : t;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
62
|
+
const mt = "__epPropKey", G = (t) => t, te = (t) => vt(t) && !!t[mt], yt = (t, e) => {
|
|
63
|
+
if (!vt(t) || te(t))
|
|
64
64
|
return t;
|
|
65
|
-
const { values:
|
|
66
|
-
type:
|
|
67
|
-
required: !!
|
|
68
|
-
validator:
|
|
69
|
-
let g = !1,
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
72
|
-
Nt(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${
|
|
65
|
+
const { values: r, required: n, default: o, type: a, validator: i } = t, u = {
|
|
66
|
+
type: a,
|
|
67
|
+
required: !!n,
|
|
68
|
+
validator: r || i ? (f) => {
|
|
69
|
+
let g = !1, m = [];
|
|
70
|
+
if (r && (m = Array.from(r), ot(t, "default") && m.push(o), g || (g = m.includes(f))), i && (g || (g = i(f))), !g && m.length > 0) {
|
|
71
|
+
const S = [...new Set(m)].map(($) => JSON.stringify($)).join(", ");
|
|
72
|
+
Nt(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${S}], got value ${JSON.stringify(f)}.`);
|
|
73
73
|
}
|
|
74
74
|
return g;
|
|
75
75
|
} : void 0,
|
|
76
|
-
[
|
|
76
|
+
[mt]: !0
|
|
77
77
|
};
|
|
78
|
-
return
|
|
79
|
-
},
|
|
78
|
+
return ot(t, "default") && (u.default = o), u;
|
|
79
|
+
}, _t = (t) => Zt(Object.entries(t).map(([e, r]) => [
|
|
80
80
|
e,
|
|
81
|
-
|
|
82
|
-
])),
|
|
81
|
+
yt(r, e)
|
|
82
|
+
])), ee = ["", "default", "small", "large"], re = yt({
|
|
83
83
|
type: String,
|
|
84
|
-
values:
|
|
84
|
+
values: ee,
|
|
85
85
|
required: !1
|
|
86
|
-
}),
|
|
87
|
-
const t = M(
|
|
88
|
-
return
|
|
89
|
-
},
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
return
|
|
93
|
-
var
|
|
94
|
-
return (
|
|
86
|
+
}), ne = /* @__PURE__ */ Symbol("size"), oe = () => {
|
|
87
|
+
const t = M(ne, {});
|
|
88
|
+
return h(() => p(t.size) || "");
|
|
89
|
+
}, at = V();
|
|
90
|
+
function ae(t, e = void 0) {
|
|
91
|
+
const r = Z() ? M(Kt, at) : at;
|
|
92
|
+
return h(() => {
|
|
93
|
+
var n, o;
|
|
94
|
+
return (o = (n = r.value) == null ? void 0 : n[t]) != null ? o : e;
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
var Q = (t, e) => {
|
|
98
|
-
const
|
|
99
|
-
for (const [
|
|
100
|
-
n
|
|
101
|
-
return
|
|
98
|
+
const r = t.__vccOpts || t;
|
|
99
|
+
for (const [n, o] of e)
|
|
100
|
+
r[n] = o;
|
|
101
|
+
return r;
|
|
102
102
|
};
|
|
103
|
-
const
|
|
104
|
-
function
|
|
103
|
+
const ie = "utils/dom/style";
|
|
104
|
+
function se(t, e = "px") {
|
|
105
105
|
if (!t && t !== 0)
|
|
106
106
|
return "";
|
|
107
|
-
if (
|
|
107
|
+
if (Yt(t) || Qt(t))
|
|
108
108
|
return `${t}${e}`;
|
|
109
109
|
if (Y(t))
|
|
110
110
|
return t;
|
|
111
|
-
bt(
|
|
111
|
+
bt(ie, "binding value must be a string or number");
|
|
112
112
|
}
|
|
113
113
|
const xt = (t, e) => {
|
|
114
|
-
if (t.install = (
|
|
115
|
-
for (const
|
|
116
|
-
|
|
114
|
+
if (t.install = (r) => {
|
|
115
|
+
for (const n of [t, ...Object.values(e ?? {})])
|
|
116
|
+
r.component(n.name, n);
|
|
117
117
|
}, e)
|
|
118
|
-
for (const [
|
|
119
|
-
t[
|
|
118
|
+
for (const [r, n] of Object.entries(e))
|
|
119
|
+
t[r] = n;
|
|
120
120
|
return t;
|
|
121
|
-
},
|
|
121
|
+
}, ce = (t) => (t.install = Wt, t), le = _t({
|
|
122
122
|
size: {
|
|
123
|
-
type:
|
|
123
|
+
type: G([Number, String])
|
|
124
124
|
},
|
|
125
125
|
color: {
|
|
126
126
|
type: String
|
|
127
127
|
}
|
|
128
|
-
}),
|
|
128
|
+
}), ue = A({
|
|
129
129
|
name: "ElIcon",
|
|
130
130
|
inheritAttrs: !1
|
|
131
|
-
}),
|
|
132
|
-
...
|
|
133
|
-
props:
|
|
131
|
+
}), fe = /* @__PURE__ */ A({
|
|
132
|
+
...ue,
|
|
133
|
+
props: le,
|
|
134
134
|
setup(t) {
|
|
135
|
-
const e = t,
|
|
136
|
-
const { size:
|
|
137
|
-
return !i && !
|
|
135
|
+
const e = t, r = F("icon"), n = h(() => {
|
|
136
|
+
const { size: o, color: a } = e, i = se(o);
|
|
137
|
+
return !i && !a ? {} : {
|
|
138
138
|
fontSize: i,
|
|
139
|
-
"--color":
|
|
139
|
+
"--color": a
|
|
140
140
|
};
|
|
141
141
|
});
|
|
142
|
-
return (
|
|
143
|
-
class:
|
|
144
|
-
style:
|
|
145
|
-
},
|
|
146
|
-
T(
|
|
142
|
+
return (o, a) => (x(), I("i", gt({
|
|
143
|
+
class: p(r).b(),
|
|
144
|
+
style: p(n)
|
|
145
|
+
}, o.$attrs), [
|
|
146
|
+
T(o.$slots, "default")
|
|
147
147
|
], 16));
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
|
-
var
|
|
151
|
-
const it = xt(
|
|
152
|
-
var
|
|
150
|
+
var de = /* @__PURE__ */ Q(fe, [["__file", "icon.vue"]]);
|
|
151
|
+
const it = xt(de);
|
|
152
|
+
var he = /* @__PURE__ */ A({
|
|
153
153
|
name: "Loading",
|
|
154
154
|
__name: "loading",
|
|
155
155
|
setup(t) {
|
|
156
|
-
return (e,
|
|
156
|
+
return (e, r) => (x(), I("svg", {
|
|
157
157
|
xmlns: "http://www.w3.org/2000/svg",
|
|
158
158
|
viewBox: "0 0 1024 1024"
|
|
159
159
|
}, [
|
|
160
|
-
|
|
160
|
+
pt("path", {
|
|
161
161
|
fill: "currentColor",
|
|
162
162
|
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"
|
|
163
163
|
})
|
|
164
164
|
]));
|
|
165
165
|
}
|
|
166
|
-
}),
|
|
167
|
-
const st =
|
|
166
|
+
}), ge = he;
|
|
167
|
+
const st = G([
|
|
168
168
|
String,
|
|
169
169
|
Object,
|
|
170
170
|
Function
|
|
171
|
-
]), X = /* @__PURE__ */ Symbol("formContextKey"), St = /* @__PURE__ */ Symbol("formItemContextKey"),
|
|
171
|
+
]), X = /* @__PURE__ */ Symbol("formContextKey"), St = /* @__PURE__ */ Symbol("formItemContextKey"), pe = () => {
|
|
172
172
|
const t = M(X, void 0), e = M(St, void 0);
|
|
173
173
|
return {
|
|
174
174
|
form: t,
|
|
175
175
|
formItem: e
|
|
176
176
|
};
|
|
177
|
-
},
|
|
177
|
+
}, wt = (t) => {
|
|
178
178
|
const e = Z();
|
|
179
|
-
return
|
|
180
|
-
var
|
|
181
|
-
return (
|
|
179
|
+
return h(() => {
|
|
180
|
+
var r, n;
|
|
181
|
+
return (n = (r = e?.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[t];
|
|
182
182
|
});
|
|
183
|
-
},
|
|
184
|
-
const
|
|
185
|
-
return
|
|
183
|
+
}, ve = (t, e = {}) => {
|
|
184
|
+
const r = V(void 0), n = e.prop ? r : wt("size"), o = e.global ? r : oe(), a = e.form ? { size: void 0 } : M(X, void 0), i = e.formItem ? { size: void 0 } : M(St, void 0);
|
|
185
|
+
return h(() => n.value || p(t) || i?.size || a?.size || o.value || "");
|
|
186
186
|
}, kt = (t) => {
|
|
187
|
-
const e =
|
|
188
|
-
return
|
|
189
|
-
var
|
|
190
|
-
return (
|
|
187
|
+
const e = wt("disabled"), r = M(X, void 0);
|
|
188
|
+
return h(() => {
|
|
189
|
+
var n, o, a;
|
|
190
|
+
return (a = (o = (n = e.value) != null ? n : p(t)) != null ? o : r?.disabled) != null ? a : !1;
|
|
191
191
|
});
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
s && bt(
|
|
195
|
-
For more detail, please visit: ${
|
|
192
|
+
}, Mt = /* @__PURE__ */ Symbol("buttonGroupContextKey"), be = ({ from: t, replacement: e, scope: r, version: n, ref: o, type: a = "API" }, i) => {
|
|
193
|
+
Ot(() => p(i), (s) => {
|
|
194
|
+
s && bt(r, `[${a}] ${t} is about to be deprecated in version ${n}, please use ${e} instead.
|
|
195
|
+
For more detail, please visit: ${o}
|
|
196
196
|
`);
|
|
197
197
|
}, {
|
|
198
198
|
immediate: !0
|
|
199
199
|
});
|
|
200
|
-
},
|
|
201
|
-
|
|
200
|
+
}, me = (t, e) => {
|
|
201
|
+
be({
|
|
202
202
|
from: "type.text",
|
|
203
203
|
replacement: "link",
|
|
204
204
|
version: "3.0.0",
|
|
205
205
|
scope: "props",
|
|
206
206
|
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
|
|
207
|
-
},
|
|
208
|
-
const
|
|
207
|
+
}, h(() => t.type === "text"));
|
|
208
|
+
const r = M(Mt, void 0), n = ae("button"), { form: o } = pe(), a = ve(h(() => r?.size)), i = kt(), s = V(), u = Ht(), f = h(() => {
|
|
209
209
|
var c;
|
|
210
|
-
return t.type ||
|
|
211
|
-
}), g =
|
|
212
|
-
var c,
|
|
213
|
-
return (y = (
|
|
214
|
-
}),
|
|
215
|
-
var c,
|
|
216
|
-
return (y = (
|
|
217
|
-
}),
|
|
218
|
-
var c,
|
|
219
|
-
return (y = (
|
|
220
|
-
}), $ =
|
|
221
|
-
var c,
|
|
222
|
-
return (y = (
|
|
223
|
-
}),
|
|
210
|
+
return t.type || r?.type || ((c = n.value) == null ? void 0 : c.type) || "";
|
|
211
|
+
}), g = h(() => {
|
|
212
|
+
var c, b, y;
|
|
213
|
+
return (y = (b = t.autoInsertSpace) != null ? b : (c = n.value) == null ? void 0 : c.autoInsertSpace) != null ? y : !1;
|
|
214
|
+
}), m = h(() => {
|
|
215
|
+
var c, b, y;
|
|
216
|
+
return (y = (b = t.plain) != null ? b : (c = n.value) == null ? void 0 : c.plain) != null ? y : !1;
|
|
217
|
+
}), S = h(() => {
|
|
218
|
+
var c, b, y;
|
|
219
|
+
return (y = (b = t.round) != null ? b : (c = n.value) == null ? void 0 : c.round) != null ? y : !1;
|
|
220
|
+
}), $ = h(() => {
|
|
221
|
+
var c, b, y;
|
|
222
|
+
return (y = (b = t.text) != null ? b : (c = n.value) == null ? void 0 : c.text) != null ? y : !1;
|
|
223
|
+
}), E = h(() => t.tag === "button" ? {
|
|
224
224
|
ariaDisabled: i.value || t.loading,
|
|
225
225
|
disabled: i.value || t.loading,
|
|
226
226
|
autofocus: t.autofocus,
|
|
227
227
|
type: t.nativeType
|
|
228
|
-
} : {}), l =
|
|
228
|
+
} : {}), l = h(() => {
|
|
229
229
|
var c;
|
|
230
|
-
const
|
|
231
|
-
if (g.value &&
|
|
232
|
-
const y =
|
|
233
|
-
if (y?.type ===
|
|
234
|
-
const
|
|
235
|
-
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(
|
|
230
|
+
const b = (c = u.default) == null ? void 0 : c.call(u);
|
|
231
|
+
if (g.value && b?.length === 1) {
|
|
232
|
+
const y = b[0];
|
|
233
|
+
if (y?.type === It) {
|
|
234
|
+
const Et = y.children;
|
|
235
|
+
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(Et.trim());
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
return !1;
|
|
239
239
|
});
|
|
240
240
|
return {
|
|
241
241
|
_disabled: i,
|
|
242
|
-
_size:
|
|
243
|
-
_type:
|
|
242
|
+
_size: a,
|
|
243
|
+
_type: f,
|
|
244
244
|
_ref: s,
|
|
245
|
-
_props:
|
|
246
|
-
_plain:
|
|
247
|
-
_round:
|
|
245
|
+
_props: E,
|
|
246
|
+
_plain: m,
|
|
247
|
+
_round: S,
|
|
248
248
|
_text: $,
|
|
249
249
|
shouldAddSpace: l,
|
|
250
250
|
handleClick: (c) => {
|
|
@@ -252,10 +252,10 @@ For more detail, please visit: ${a}
|
|
|
252
252
|
c.stopPropagation();
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
|
-
t.nativeType === "reset" &&
|
|
255
|
+
t.nativeType === "reset" && o?.resetFields(), e("click", c);
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
},
|
|
258
|
+
}, ye = [
|
|
259
259
|
"default",
|
|
260
260
|
"primary",
|
|
261
261
|
"success",
|
|
@@ -264,15 +264,15 @@ For more detail, please visit: ${a}
|
|
|
264
264
|
"danger",
|
|
265
265
|
"text",
|
|
266
266
|
""
|
|
267
|
-
],
|
|
268
|
-
size:
|
|
267
|
+
], _e = ["button", "submit", "reset"], W = _t({
|
|
268
|
+
size: re,
|
|
269
269
|
disabled: {
|
|
270
270
|
type: Boolean,
|
|
271
271
|
default: void 0
|
|
272
272
|
},
|
|
273
273
|
type: {
|
|
274
274
|
type: String,
|
|
275
|
-
values:
|
|
275
|
+
values: ye,
|
|
276
276
|
default: ""
|
|
277
277
|
},
|
|
278
278
|
icon: {
|
|
@@ -280,13 +280,13 @@ For more detail, please visit: ${a}
|
|
|
280
280
|
},
|
|
281
281
|
nativeType: {
|
|
282
282
|
type: String,
|
|
283
|
-
values:
|
|
283
|
+
values: _e,
|
|
284
284
|
default: "button"
|
|
285
285
|
},
|
|
286
286
|
loading: Boolean,
|
|
287
287
|
loadingIcon: {
|
|
288
288
|
type: st,
|
|
289
|
-
default: () =>
|
|
289
|
+
default: () => ge
|
|
290
290
|
},
|
|
291
291
|
plain: {
|
|
292
292
|
type: Boolean,
|
|
@@ -311,130 +311,130 @@ For more detail, please visit: ${a}
|
|
|
311
311
|
default: void 0
|
|
312
312
|
},
|
|
313
313
|
tag: {
|
|
314
|
-
type:
|
|
314
|
+
type: G([String, Object]),
|
|
315
315
|
default: "button"
|
|
316
316
|
}
|
|
317
|
-
}),
|
|
317
|
+
}), xe = {
|
|
318
318
|
click: (t) => t instanceof MouseEvent
|
|
319
319
|
};
|
|
320
320
|
function v(t, e) {
|
|
321
|
-
|
|
322
|
-
var
|
|
323
|
-
return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))),
|
|
321
|
+
Se(t) && (t = "100%");
|
|
322
|
+
var r = we(t);
|
|
323
|
+
return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))), r && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (e === 360 ? t = (t < 0 ? t % e + e : t % e) / parseFloat(String(e)) : t = t % e / parseFloat(String(e)), t);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function z(t) {
|
|
326
326
|
return Math.min(1, Math.max(0, t));
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Se(t) {
|
|
329
329
|
return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function we(t) {
|
|
332
332
|
return typeof t == "string" && t.indexOf("%") !== -1;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function At(t) {
|
|
335
335
|
return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function P(t) {
|
|
338
338
|
return t <= 1 ? "".concat(Number(t) * 100, "%") : t;
|
|
339
339
|
}
|
|
340
340
|
function O(t) {
|
|
341
341
|
return t.length === 1 ? "0" + t : String(t);
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function ke(t, e, r) {
|
|
344
344
|
return {
|
|
345
345
|
r: v(t, 255) * 255,
|
|
346
346
|
g: v(e, 255) * 255,
|
|
347
|
-
b: v(
|
|
347
|
+
b: v(r, 255) * 255
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
|
-
function ct(t, e,
|
|
351
|
-
t = v(t, 255), e = v(e, 255),
|
|
352
|
-
var
|
|
353
|
-
if (
|
|
354
|
-
i = 0,
|
|
350
|
+
function ct(t, e, r) {
|
|
351
|
+
t = v(t, 255), e = v(e, 255), r = v(r, 255);
|
|
352
|
+
var n = Math.max(t, e, r), o = Math.min(t, e, r), a = 0, i = 0, s = (n + o) / 2;
|
|
353
|
+
if (n === o)
|
|
354
|
+
i = 0, a = 0;
|
|
355
355
|
else {
|
|
356
|
-
var u =
|
|
357
|
-
switch (i = s > 0.5 ? u / (2 -
|
|
356
|
+
var u = n - o;
|
|
357
|
+
switch (i = s > 0.5 ? u / (2 - n - o) : u / (n + o), n) {
|
|
358
358
|
case t:
|
|
359
|
-
|
|
359
|
+
a = (e - r) / u + (e < r ? 6 : 0);
|
|
360
360
|
break;
|
|
361
361
|
case e:
|
|
362
|
-
|
|
362
|
+
a = (r - t) / u + 2;
|
|
363
363
|
break;
|
|
364
|
-
case
|
|
365
|
-
|
|
364
|
+
case r:
|
|
365
|
+
a = (t - e) / u + 4;
|
|
366
366
|
break;
|
|
367
367
|
}
|
|
368
|
-
|
|
368
|
+
a /= 6;
|
|
369
369
|
}
|
|
370
|
-
return { h:
|
|
370
|
+
return { h: a, s: i, l: s };
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
return
|
|
372
|
+
function L(t, e, r) {
|
|
373
|
+
return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
var
|
|
377
|
-
if (t = v(t, 360), e = v(e, 100),
|
|
378
|
-
|
|
375
|
+
function Me(t, e, r) {
|
|
376
|
+
var n, o, a;
|
|
377
|
+
if (t = v(t, 360), e = v(e, 100), r = v(r, 100), e === 0)
|
|
378
|
+
o = r, a = r, n = r;
|
|
379
379
|
else {
|
|
380
|
-
var i =
|
|
381
|
-
|
|
380
|
+
var i = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - i;
|
|
381
|
+
n = L(s, i, t + 1 / 3), o = L(s, i, t), a = L(s, i, t - 1 / 3);
|
|
382
382
|
}
|
|
383
|
-
return { r:
|
|
383
|
+
return { r: n * 255, g: o * 255, b: a * 255 };
|
|
384
384
|
}
|
|
385
|
-
function lt(t, e,
|
|
386
|
-
t = v(t, 255), e = v(e, 255),
|
|
387
|
-
var
|
|
388
|
-
if (
|
|
389
|
-
|
|
385
|
+
function lt(t, e, r) {
|
|
386
|
+
t = v(t, 255), e = v(e, 255), r = v(r, 255);
|
|
387
|
+
var n = Math.max(t, e, r), o = Math.min(t, e, r), a = 0, i = n, s = n - o, u = n === 0 ? 0 : s / n;
|
|
388
|
+
if (n === o)
|
|
389
|
+
a = 0;
|
|
390
390
|
else {
|
|
391
|
-
switch (
|
|
391
|
+
switch (n) {
|
|
392
392
|
case t:
|
|
393
|
-
|
|
393
|
+
a = (e - r) / s + (e < r ? 6 : 0);
|
|
394
394
|
break;
|
|
395
395
|
case e:
|
|
396
|
-
|
|
396
|
+
a = (r - t) / s + 2;
|
|
397
397
|
break;
|
|
398
|
-
case
|
|
399
|
-
|
|
398
|
+
case r:
|
|
399
|
+
a = (t - e) / s + 4;
|
|
400
400
|
break;
|
|
401
401
|
}
|
|
402
|
-
|
|
402
|
+
a /= 6;
|
|
403
403
|
}
|
|
404
|
-
return { h:
|
|
404
|
+
return { h: a, s: u, v: i };
|
|
405
405
|
}
|
|
406
|
-
function
|
|
407
|
-
t = v(t, 360) * 6, e = v(e, 100),
|
|
408
|
-
var
|
|
409
|
-
return { r:
|
|
406
|
+
function Ae(t, e, r) {
|
|
407
|
+
t = v(t, 360) * 6, e = v(e, 100), r = v(r, 100);
|
|
408
|
+
var n = Math.floor(t), o = t - n, a = r * (1 - e), i = r * (1 - o * e), s = r * (1 - (1 - o) * e), u = n % 6, f = [r, i, a, a, s, r][u], g = [s, r, r, i, a, a][u], m = [a, a, s, r, r, i][u];
|
|
409
|
+
return { r: f * 255, g: g * 255, b: m * 255 };
|
|
410
410
|
}
|
|
411
|
-
function ut(t, e,
|
|
412
|
-
var
|
|
411
|
+
function ut(t, e, r, n) {
|
|
412
|
+
var o = [
|
|
413
413
|
O(Math.round(t).toString(16)),
|
|
414
414
|
O(Math.round(e).toString(16)),
|
|
415
|
-
O(Math.round(
|
|
415
|
+
O(Math.round(r).toString(16))
|
|
416
416
|
];
|
|
417
|
-
return
|
|
417
|
+
return n && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) : o.join("");
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
var
|
|
419
|
+
function $e(t, e, r, n, o) {
|
|
420
|
+
var a = [
|
|
421
421
|
O(Math.round(t).toString(16)),
|
|
422
422
|
O(Math.round(e).toString(16)),
|
|
423
|
-
O(Math.round(
|
|
424
|
-
O(
|
|
423
|
+
O(Math.round(r).toString(16)),
|
|
424
|
+
O(Be(n))
|
|
425
425
|
];
|
|
426
|
-
return
|
|
426
|
+
return o && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Be(t) {
|
|
429
429
|
return Math.round(parseFloat(t) * 255).toString(16);
|
|
430
430
|
}
|
|
431
431
|
function ft(t) {
|
|
432
|
-
return
|
|
432
|
+
return _(t) / 255;
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function _(t) {
|
|
435
435
|
return parseInt(t, 16);
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function Ce(t) {
|
|
438
438
|
return {
|
|
439
439
|
r: t >> 16,
|
|
440
440
|
g: (t & 65280) >> 8,
|
|
@@ -591,31 +591,31 @@ var J = {
|
|
|
591
591
|
yellow: "#ffff00",
|
|
592
592
|
yellowgreen: "#9acd32"
|
|
593
593
|
};
|
|
594
|
-
function
|
|
595
|
-
var e = { r: 0, g: 0, b: 0 },
|
|
596
|
-
return typeof t == "string" && (t =
|
|
594
|
+
function Ee(t) {
|
|
595
|
+
var e = { r: 0, g: 0, b: 0 }, r = 1, n = null, o = null, a = null, i = !1, s = !1;
|
|
596
|
+
return typeof t == "string" && (t = He(t)), typeof t == "object" && (k(t.r) && k(t.g) && k(t.b) ? (e = ke(t.r, t.g, t.b), i = !0, s = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : k(t.h) && k(t.s) && k(t.v) ? (n = P(t.s), o = P(t.v), e = Ae(t.h, n, o), i = !0, s = "hsv") : k(t.h) && k(t.s) && k(t.l) && (n = P(t.s), a = P(t.l), e = Me(t.h, n, a), i = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (r = t.a)), r = At(r), {
|
|
597
597
|
ok: i,
|
|
598
598
|
format: t.format || s,
|
|
599
599
|
r: Math.min(255, Math.max(e.r, 0)),
|
|
600
600
|
g: Math.min(255, Math.max(e.g, 0)),
|
|
601
601
|
b: Math.min(255, Math.max(e.b, 0)),
|
|
602
|
-
a:
|
|
602
|
+
a: r
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
|
-
var
|
|
606
|
-
CSS_UNIT: new RegExp(
|
|
607
|
-
rgb: new RegExp("rgb" +
|
|
605
|
+
var Ne = "[-\\+]?\\d+%?", Oe = "[-\\+]?\\d*\\.\\d+%?", C = "(?:".concat(Oe, ")|(?:").concat(Ne, ")"), U = "[\\s|\\(]+(".concat(C, ")[,|\\s]+(").concat(C, ")[,|\\s]+(").concat(C, ")\\s*\\)?"), q = "[\\s|\\(]+(".concat(C, ")[,|\\s]+(").concat(C, ")[,|\\s]+(").concat(C, ")[,|\\s]+(").concat(C, ")\\s*\\)?"), w = {
|
|
606
|
+
CSS_UNIT: new RegExp(C),
|
|
607
|
+
rgb: new RegExp("rgb" + U),
|
|
608
608
|
rgba: new RegExp("rgba" + q),
|
|
609
|
-
hsl: new RegExp("hsl" +
|
|
609
|
+
hsl: new RegExp("hsl" + U),
|
|
610
610
|
hsla: new RegExp("hsla" + q),
|
|
611
|
-
hsv: new RegExp("hsv" +
|
|
611
|
+
hsv: new RegExp("hsv" + U),
|
|
612
612
|
hsva: new RegExp("hsva" + q),
|
|
613
613
|
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
614
614
|
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
615
615
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
616
616
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
617
617
|
};
|
|
618
|
-
function
|
|
618
|
+
function He(t) {
|
|
619
619
|
if (t = t.trim().toLowerCase(), t.length === 0)
|
|
620
620
|
return !1;
|
|
621
621
|
var e = !1;
|
|
@@ -623,45 +623,45 @@ function Ce(t) {
|
|
|
623
623
|
t = J[t], e = !0;
|
|
624
624
|
else if (t === "transparent")
|
|
625
625
|
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
626
|
-
var
|
|
627
|
-
return
|
|
628
|
-
r:
|
|
629
|
-
g:
|
|
630
|
-
b:
|
|
631
|
-
a: ft(
|
|
626
|
+
var r = w.rgb.exec(t);
|
|
627
|
+
return r ? { r: r[1], g: r[2], b: r[3] } : (r = w.rgba.exec(t), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = w.hsl.exec(t), r ? { h: r[1], s: r[2], l: r[3] } : (r = w.hsla.exec(t), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = w.hsv.exec(t), r ? { h: r[1], s: r[2], v: r[3] } : (r = w.hsva.exec(t), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = w.hex8.exec(t), r ? {
|
|
628
|
+
r: _(r[1]),
|
|
629
|
+
g: _(r[2]),
|
|
630
|
+
b: _(r[3]),
|
|
631
|
+
a: ft(r[4]),
|
|
632
632
|
format: e ? "name" : "hex8"
|
|
633
|
-
} : (
|
|
634
|
-
r:
|
|
635
|
-
g:
|
|
636
|
-
b:
|
|
633
|
+
} : (r = w.hex6.exec(t), r ? {
|
|
634
|
+
r: _(r[1]),
|
|
635
|
+
g: _(r[2]),
|
|
636
|
+
b: _(r[3]),
|
|
637
637
|
format: e ? "name" : "hex"
|
|
638
|
-
} : (
|
|
639
|
-
r:
|
|
640
|
-
g:
|
|
641
|
-
b:
|
|
642
|
-
a: ft(
|
|
638
|
+
} : (r = w.hex4.exec(t), r ? {
|
|
639
|
+
r: _(r[1] + r[1]),
|
|
640
|
+
g: _(r[2] + r[2]),
|
|
641
|
+
b: _(r[3] + r[3]),
|
|
642
|
+
a: ft(r[4] + r[4]),
|
|
643
643
|
format: e ? "name" : "hex8"
|
|
644
|
-
} : (
|
|
645
|
-
r:
|
|
646
|
-
g:
|
|
647
|
-
b:
|
|
644
|
+
} : (r = w.hex3.exec(t), r ? {
|
|
645
|
+
r: _(r[1] + r[1]),
|
|
646
|
+
g: _(r[2] + r[2]),
|
|
647
|
+
b: _(r[3] + r[3]),
|
|
648
648
|
format: e ? "name" : "hex"
|
|
649
649
|
} : !1)))))))));
|
|
650
650
|
}
|
|
651
|
-
function
|
|
652
|
-
return !!
|
|
651
|
+
function k(t) {
|
|
652
|
+
return !!w.CSS_UNIT.exec(String(t));
|
|
653
653
|
}
|
|
654
|
-
var
|
|
654
|
+
var Ie = (
|
|
655
655
|
/** @class */
|
|
656
656
|
(function() {
|
|
657
|
-
function t(e,
|
|
658
|
-
e === void 0 && (e = ""),
|
|
659
|
-
var
|
|
657
|
+
function t(e, r) {
|
|
658
|
+
e === void 0 && (e = ""), r === void 0 && (r = {});
|
|
659
|
+
var n;
|
|
660
660
|
if (e instanceof t)
|
|
661
661
|
return e;
|
|
662
|
-
typeof e == "number" && (e =
|
|
663
|
-
var
|
|
664
|
-
this.originalInput = e, this.r =
|
|
662
|
+
typeof e == "number" && (e = Ce(e)), this.originalInput = e;
|
|
663
|
+
var o = Ee(e);
|
|
664
|
+
this.originalInput = e, this.r = o.r, this.g = o.g, this.b = o.b, this.a = o.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (n = r.format) !== null && n !== void 0 ? n : o.format, this.gradientType = r.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 = o.ok;
|
|
665
665
|
}
|
|
666
666
|
return t.prototype.isDark = function() {
|
|
667
667
|
return this.getBrightness() < 128;
|
|
@@ -671,12 +671,12 @@ var Ee = (
|
|
|
671
671
|
var e = this.toRgb();
|
|
672
672
|
return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
|
|
673
673
|
}, t.prototype.getLuminance = function() {
|
|
674
|
-
var e = this.toRgb(), n,
|
|
675
|
-
return
|
|
674
|
+
var e = this.toRgb(), r, n, o, a = e.r / 255, i = e.g / 255, s = e.b / 255;
|
|
675
|
+
return a <= 0.03928 ? r = a / 12.92 : r = Math.pow((a + 0.055) / 1.055, 2.4), i <= 0.03928 ? n = i / 12.92 : n = Math.pow((i + 0.055) / 1.055, 2.4), s <= 0.03928 ? o = s / 12.92 : o = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * n + 0.0722 * o;
|
|
676
676
|
}, t.prototype.getAlpha = function() {
|
|
677
677
|
return this.a;
|
|
678
678
|
}, t.prototype.setAlpha = function(e) {
|
|
679
|
-
return this.a =
|
|
679
|
+
return this.a = At(e), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
680
680
|
}, t.prototype.isMonochrome = function() {
|
|
681
681
|
var e = this.toHsl().s;
|
|
682
682
|
return e === 0;
|
|
@@ -684,20 +684,20 @@ var Ee = (
|
|
|
684
684
|
var e = lt(this.r, this.g, this.b);
|
|
685
685
|
return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
|
|
686
686
|
}, t.prototype.toHsvString = function() {
|
|
687
|
-
var e = lt(this.r, this.g, this.b),
|
|
688
|
-
return this.a === 1 ? "hsv(".concat(
|
|
687
|
+
var e = lt(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), o = Math.round(e.v * 100);
|
|
688
|
+
return this.a === 1 ? "hsv(".concat(r, ", ").concat(n, "%, ").concat(o, "%)") : "hsva(".concat(r, ", ").concat(n, "%, ").concat(o, "%, ").concat(this.roundA, ")");
|
|
689
689
|
}, t.prototype.toHsl = function() {
|
|
690
690
|
var e = ct(this.r, this.g, this.b);
|
|
691
691
|
return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
|
|
692
692
|
}, t.prototype.toHslString = function() {
|
|
693
|
-
var e = ct(this.r, this.g, this.b),
|
|
694
|
-
return this.a === 1 ? "hsl(".concat(
|
|
693
|
+
var e = ct(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), o = Math.round(e.l * 100);
|
|
694
|
+
return this.a === 1 ? "hsl(".concat(r, ", ").concat(n, "%, ").concat(o, "%)") : "hsla(".concat(r, ", ").concat(n, "%, ").concat(o, "%, ").concat(this.roundA, ")");
|
|
695
695
|
}, t.prototype.toHex = function(e) {
|
|
696
696
|
return e === void 0 && (e = !1), ut(this.r, this.g, this.b, e);
|
|
697
697
|
}, t.prototype.toHexString = function(e) {
|
|
698
698
|
return e === void 0 && (e = !1), "#" + this.toHex(e);
|
|
699
699
|
}, t.prototype.toHex8 = function(e) {
|
|
700
|
-
return e === void 0 && (e = !1),
|
|
700
|
+
return e === void 0 && (e = !1), $e(this.r, this.g, this.b, this.a, e);
|
|
701
701
|
}, t.prototype.toHex8String = function(e) {
|
|
702
702
|
return e === void 0 && (e = !1), "#" + this.toHex8(e);
|
|
703
703
|
}, t.prototype.toHexShortString = function(e) {
|
|
@@ -710,11 +710,11 @@ var Ee = (
|
|
|
710
710
|
a: this.a
|
|
711
711
|
};
|
|
712
712
|
}, t.prototype.toRgbString = function() {
|
|
713
|
-
var e = Math.round(this.r),
|
|
714
|
-
return this.a === 1 ? "rgb(".concat(e, ", ").concat(
|
|
713
|
+
var e = Math.round(this.r), r = Math.round(this.g), n = Math.round(this.b);
|
|
714
|
+
return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(n, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(n, ", ").concat(this.roundA, ")");
|
|
715
715
|
}, t.prototype.toPercentageRgb = function() {
|
|
716
|
-
var e = function(
|
|
717
|
-
return "".concat(Math.round(v(
|
|
716
|
+
var e = function(r) {
|
|
717
|
+
return "".concat(Math.round(v(r, 255) * 100), "%");
|
|
718
718
|
};
|
|
719
719
|
return {
|
|
720
720
|
r: e(this.r),
|
|
@@ -723,8 +723,8 @@ var Ee = (
|
|
|
723
723
|
a: this.a
|
|
724
724
|
};
|
|
725
725
|
}, t.prototype.toPercentageRgbString = function() {
|
|
726
|
-
var e = function(
|
|
727
|
-
return Math.round(v(
|
|
726
|
+
var e = function(r) {
|
|
727
|
+
return Math.round(v(r, 255) * 100);
|
|
728
728
|
};
|
|
729
729
|
return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")");
|
|
730
730
|
}, t.prototype.toName = function() {
|
|
@@ -732,209 +732,209 @@ var Ee = (
|
|
|
732
732
|
return "transparent";
|
|
733
733
|
if (this.a < 1)
|
|
734
734
|
return !1;
|
|
735
|
-
for (var e = "#" + ut(this.r, this.g, this.b, !1),
|
|
736
|
-
var
|
|
735
|
+
for (var e = "#" + ut(this.r, this.g, this.b, !1), r = 0, n = Object.entries(J); r < n.length; r++) {
|
|
736
|
+
var o = n[r], a = o[0], i = o[1];
|
|
737
737
|
if (e === i)
|
|
738
|
-
return
|
|
738
|
+
return a;
|
|
739
739
|
}
|
|
740
740
|
return !1;
|
|
741
741
|
}, t.prototype.toString = function(e) {
|
|
742
|
-
var
|
|
742
|
+
var r = !!e;
|
|
743
743
|
e = e ?? this.format;
|
|
744
|
-
var
|
|
745
|
-
return
|
|
744
|
+
var n = !1, o = this.a < 1 && this.a >= 0, a = !r && o && (e.startsWith("hex") || e === "name");
|
|
745
|
+
return a ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString());
|
|
746
746
|
}, t.prototype.toNumber = function() {
|
|
747
747
|
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
|
|
748
748
|
}, t.prototype.clone = function() {
|
|
749
749
|
return new t(this.toString());
|
|
750
750
|
}, t.prototype.lighten = function(e) {
|
|
751
751
|
e === void 0 && (e = 10);
|
|
752
|
-
var
|
|
753
|
-
return
|
|
752
|
+
var r = this.toHsl();
|
|
753
|
+
return r.l += e / 100, r.l = z(r.l), new t(r);
|
|
754
754
|
}, t.prototype.brighten = function(e) {
|
|
755
755
|
e === void 0 && (e = 10);
|
|
756
|
-
var
|
|
757
|
-
return
|
|
756
|
+
var r = this.toRgb();
|
|
757
|
+
return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(e / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(e / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(e / 100)))), new t(r);
|
|
758
758
|
}, t.prototype.darken = function(e) {
|
|
759
759
|
e === void 0 && (e = 10);
|
|
760
|
-
var
|
|
761
|
-
return
|
|
760
|
+
var r = this.toHsl();
|
|
761
|
+
return r.l -= e / 100, r.l = z(r.l), new t(r);
|
|
762
762
|
}, t.prototype.tint = function(e) {
|
|
763
763
|
return e === void 0 && (e = 10), this.mix("white", e);
|
|
764
764
|
}, t.prototype.shade = function(e) {
|
|
765
765
|
return e === void 0 && (e = 10), this.mix("black", e);
|
|
766
766
|
}, t.prototype.desaturate = function(e) {
|
|
767
767
|
e === void 0 && (e = 10);
|
|
768
|
-
var
|
|
769
|
-
return
|
|
768
|
+
var r = this.toHsl();
|
|
769
|
+
return r.s -= e / 100, r.s = z(r.s), new t(r);
|
|
770
770
|
}, t.prototype.saturate = function(e) {
|
|
771
771
|
e === void 0 && (e = 10);
|
|
772
|
-
var
|
|
773
|
-
return
|
|
772
|
+
var r = this.toHsl();
|
|
773
|
+
return r.s += e / 100, r.s = z(r.s), new t(r);
|
|
774
774
|
}, t.prototype.greyscale = function() {
|
|
775
775
|
return this.desaturate(100);
|
|
776
776
|
}, t.prototype.spin = function(e) {
|
|
777
|
-
var
|
|
778
|
-
return
|
|
779
|
-
}, t.prototype.mix = function(e,
|
|
780
|
-
|
|
781
|
-
var
|
|
782
|
-
r: (
|
|
783
|
-
g: (
|
|
784
|
-
b: (
|
|
785
|
-
a: (
|
|
777
|
+
var r = this.toHsl(), n = (r.h + e) % 360;
|
|
778
|
+
return r.h = n < 0 ? 360 + n : n, new t(r);
|
|
779
|
+
}, t.prototype.mix = function(e, r) {
|
|
780
|
+
r === void 0 && (r = 50);
|
|
781
|
+
var n = this.toRgb(), o = new t(e).toRgb(), a = r / 100, i = {
|
|
782
|
+
r: (o.r - n.r) * a + n.r,
|
|
783
|
+
g: (o.g - n.g) * a + n.g,
|
|
784
|
+
b: (o.b - n.b) * a + n.b,
|
|
785
|
+
a: (o.a - n.a) * a + n.a
|
|
786
786
|
};
|
|
787
787
|
return new t(i);
|
|
788
|
-
}, t.prototype.analogous = function(e,
|
|
789
|
-
e === void 0 && (e = 6),
|
|
790
|
-
var
|
|
791
|
-
for (
|
|
792
|
-
|
|
793
|
-
return
|
|
788
|
+
}, t.prototype.analogous = function(e, r) {
|
|
789
|
+
e === void 0 && (e = 6), r === void 0 && (r = 30);
|
|
790
|
+
var n = this.toHsl(), o = 360 / r, a = [this];
|
|
791
|
+
for (n.h = (n.h - (o * e >> 1) + 720) % 360; --e; )
|
|
792
|
+
n.h = (n.h + o) % 360, a.push(new t(n));
|
|
793
|
+
return a;
|
|
794
794
|
}, t.prototype.complement = function() {
|
|
795
795
|
var e = this.toHsl();
|
|
796
796
|
return e.h = (e.h + 180) % 360, new t(e);
|
|
797
797
|
}, t.prototype.monochromatic = function(e) {
|
|
798
798
|
e === void 0 && (e = 6);
|
|
799
|
-
for (var
|
|
800
|
-
i.push(new t({ h:
|
|
799
|
+
for (var r = this.toHsv(), n = r.h, o = r.s, a = r.v, i = [], s = 1 / e; e--; )
|
|
800
|
+
i.push(new t({ h: n, s: o, v: a })), a = (a + s) % 1;
|
|
801
801
|
return i;
|
|
802
802
|
}, t.prototype.splitcomplement = function() {
|
|
803
|
-
var e = this.toHsl(),
|
|
803
|
+
var e = this.toHsl(), r = e.h;
|
|
804
804
|
return [
|
|
805
805
|
this,
|
|
806
|
-
new t({ h: (
|
|
807
|
-
new t({ h: (
|
|
806
|
+
new t({ h: (r + 72) % 360, s: e.s, l: e.l }),
|
|
807
|
+
new t({ h: (r + 216) % 360, s: e.s, l: e.l })
|
|
808
808
|
];
|
|
809
809
|
}, t.prototype.onBackground = function(e) {
|
|
810
|
-
var
|
|
810
|
+
var r = this.toRgb(), n = new t(e).toRgb(), o = r.a + n.a * (1 - r.a);
|
|
811
811
|
return new t({
|
|
812
|
-
r: (
|
|
813
|
-
g: (
|
|
814
|
-
b: (
|
|
815
|
-
a
|
|
812
|
+
r: (r.r * r.a + n.r * n.a * (1 - r.a)) / o,
|
|
813
|
+
g: (r.g * r.a + n.g * n.a * (1 - r.a)) / o,
|
|
814
|
+
b: (r.b * r.a + n.b * n.a * (1 - r.a)) / o,
|
|
815
|
+
a: o
|
|
816
816
|
});
|
|
817
817
|
}, t.prototype.triad = function() {
|
|
818
818
|
return this.polyad(3);
|
|
819
819
|
}, t.prototype.tetrad = function() {
|
|
820
820
|
return this.polyad(4);
|
|
821
821
|
}, t.prototype.polyad = function(e) {
|
|
822
|
-
for (var
|
|
823
|
-
|
|
824
|
-
return
|
|
822
|
+
for (var r = this.toHsl(), n = r.h, o = [this], a = 360 / e, i = 1; i < e; i++)
|
|
823
|
+
o.push(new t({ h: (n + i * a) % 360, s: r.s, l: r.l }));
|
|
824
|
+
return o;
|
|
825
825
|
}, t.prototype.equals = function(e) {
|
|
826
826
|
return this.toRgbString() === new t(e).toRgbString();
|
|
827
827
|
}, t;
|
|
828
828
|
})()
|
|
829
829
|
);
|
|
830
|
-
function
|
|
830
|
+
function B(t, e = 20) {
|
|
831
831
|
return t.mix("#141414", e).toString();
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
const e = kt(),
|
|
835
|
-
return
|
|
836
|
-
let
|
|
837
|
-
if (
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
const i = new
|
|
833
|
+
function Te(t) {
|
|
834
|
+
const e = kt(), r = F("button");
|
|
835
|
+
return h(() => {
|
|
836
|
+
let n = {}, o = t.color;
|
|
837
|
+
if (o) {
|
|
838
|
+
const a = o.match(/var\((.*?)\)/);
|
|
839
|
+
a && (o = window.getComputedStyle(window.document.documentElement).getPropertyValue(a[1]));
|
|
840
|
+
const i = new Ie(o), s = t.dark ? i.tint(20).toString() : B(i, 20);
|
|
841
841
|
if (t.plain)
|
|
842
|
-
|
|
843
|
-
"bg-color": t.dark ?
|
|
844
|
-
"text-color":
|
|
845
|
-
"border-color": t.dark ?
|
|
846
|
-
"hover-text-color": `var(${
|
|
847
|
-
"hover-bg-color":
|
|
848
|
-
"hover-border-color":
|
|
842
|
+
n = r.cssVarBlock({
|
|
843
|
+
"bg-color": t.dark ? B(i, 90) : i.tint(90).toString(),
|
|
844
|
+
"text-color": o,
|
|
845
|
+
"border-color": t.dark ? B(i, 50) : i.tint(50).toString(),
|
|
846
|
+
"hover-text-color": `var(${r.cssVarName("color-white")})`,
|
|
847
|
+
"hover-bg-color": o,
|
|
848
|
+
"hover-border-color": o,
|
|
849
849
|
"active-bg-color": s,
|
|
850
|
-
"active-text-color": `var(${
|
|
850
|
+
"active-text-color": `var(${r.cssVarName("color-white")})`,
|
|
851
851
|
"active-border-color": s
|
|
852
|
-
}), e.value && (r
|
|
852
|
+
}), e.value && (n[r.cssVarBlockName("disabled-bg-color")] = t.dark ? B(i, 90) : i.tint(90).toString(), n[r.cssVarBlockName("disabled-text-color")] = t.dark ? B(i, 50) : i.tint(50).toString(), n[r.cssVarBlockName("disabled-border-color")] = t.dark ? B(i, 80) : i.tint(80).toString());
|
|
853
853
|
else {
|
|
854
|
-
const u = t.dark ?
|
|
855
|
-
if (
|
|
856
|
-
"bg-color":
|
|
857
|
-
"text-color":
|
|
858
|
-
"border-color":
|
|
854
|
+
const u = t.dark ? B(i, 30) : i.tint(30).toString(), f = i.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`;
|
|
855
|
+
if (n = r.cssVarBlock({
|
|
856
|
+
"bg-color": o,
|
|
857
|
+
"text-color": f,
|
|
858
|
+
"border-color": o,
|
|
859
859
|
"hover-bg-color": u,
|
|
860
|
-
"hover-text-color":
|
|
860
|
+
"hover-text-color": f,
|
|
861
861
|
"hover-border-color": u,
|
|
862
862
|
"active-bg-color": s,
|
|
863
863
|
"active-border-color": s
|
|
864
864
|
}), e.value) {
|
|
865
|
-
const g = t.dark ?
|
|
866
|
-
r
|
|
865
|
+
const g = t.dark ? B(i, 50) : i.tint(50).toString();
|
|
866
|
+
n[r.cssVarBlockName("disabled-bg-color")] = g, n[r.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, n[r.cssVarBlockName("disabled-border-color")] = g;
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
}
|
|
870
|
-
return
|
|
870
|
+
return n;
|
|
871
871
|
});
|
|
872
872
|
}
|
|
873
|
-
const
|
|
873
|
+
const Ve = A({
|
|
874
874
|
name: "ElButton"
|
|
875
|
-
}),
|
|
876
|
-
...
|
|
875
|
+
}), ze = /* @__PURE__ */ A({
|
|
876
|
+
...Ve,
|
|
877
877
|
props: W,
|
|
878
|
-
emits:
|
|
879
|
-
setup(t, { expose: e, emit:
|
|
880
|
-
const
|
|
878
|
+
emits: xe,
|
|
879
|
+
setup(t, { expose: e, emit: r }) {
|
|
880
|
+
const n = t, o = Te(n), a = F("button"), {
|
|
881
881
|
_ref: i,
|
|
882
882
|
_size: s,
|
|
883
883
|
_type: u,
|
|
884
|
-
_disabled:
|
|
884
|
+
_disabled: f,
|
|
885
885
|
_props: g,
|
|
886
|
-
_plain:
|
|
887
|
-
_round:
|
|
886
|
+
_plain: m,
|
|
887
|
+
_round: S,
|
|
888
888
|
_text: $,
|
|
889
|
-
shouldAddSpace:
|
|
889
|
+
shouldAddSpace: E,
|
|
890
890
|
handleClick: l
|
|
891
|
-
} =
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
891
|
+
} = me(n, r), d = h(() => [
|
|
892
|
+
a.b(),
|
|
893
|
+
a.m(u.value),
|
|
894
|
+
a.m(s.value),
|
|
895
|
+
a.is("disabled", f.value),
|
|
896
|
+
a.is("loading", n.loading),
|
|
897
|
+
a.is("plain", m.value),
|
|
898
|
+
a.is("round", S.value),
|
|
899
|
+
a.is("circle", n.circle),
|
|
900
|
+
a.is("text", $.value),
|
|
901
|
+
a.is("link", n.link),
|
|
902
|
+
a.is("has-bg", n.bg)
|
|
903
903
|
]);
|
|
904
904
|
return e({
|
|
905
905
|
ref: i,
|
|
906
906
|
size: s,
|
|
907
907
|
type: u,
|
|
908
|
-
disabled:
|
|
909
|
-
shouldAddSpace:
|
|
910
|
-
}), (c,
|
|
908
|
+
disabled: f,
|
|
909
|
+
shouldAddSpace: E
|
|
910
|
+
}), (c, b) => (x(), H(D(c.tag), gt({
|
|
911
911
|
ref_key: "_ref",
|
|
912
912
|
ref: i
|
|
913
|
-
},
|
|
914
|
-
class: d
|
|
915
|
-
style:
|
|
916
|
-
onClick:
|
|
913
|
+
}, p(g), {
|
|
914
|
+
class: p(d),
|
|
915
|
+
style: p(o),
|
|
916
|
+
onClick: p(l)
|
|
917
917
|
}), {
|
|
918
|
-
default:
|
|
919
|
-
c.loading ? (
|
|
920
|
-
c.$slots.loading ? T(c.$slots, "loading", { key: 0 }) : (
|
|
918
|
+
default: R(() => [
|
|
919
|
+
c.loading ? (x(), I(Tt, { key: 0 }, [
|
|
920
|
+
c.$slots.loading ? T(c.$slots, "loading", { key: 0 }) : (x(), H(p(it), {
|
|
921
921
|
key: 1,
|
|
922
|
-
class:
|
|
922
|
+
class: j(p(a).is("loading"))
|
|
923
923
|
}, {
|
|
924
|
-
default:
|
|
925
|
-
(
|
|
924
|
+
default: R(() => [
|
|
925
|
+
(x(), H(D(c.loadingIcon)))
|
|
926
926
|
]),
|
|
927
927
|
_: 1
|
|
928
928
|
}, 8, ["class"]))
|
|
929
|
-
], 64)) : c.icon || c.$slots.icon ? (
|
|
930
|
-
default:
|
|
931
|
-
c.icon ? (
|
|
929
|
+
], 64)) : c.icon || c.$slots.icon ? (x(), H(p(it), { key: 1 }, {
|
|
930
|
+
default: R(() => [
|
|
931
|
+
c.icon ? (x(), H(D(c.icon), { key: 0 })) : T(c.$slots, "icon", { key: 1 })
|
|
932
932
|
]),
|
|
933
933
|
_: 3
|
|
934
934
|
})) : tt("v-if", !0),
|
|
935
|
-
c.$slots.default ? (
|
|
935
|
+
c.$slots.default ? (x(), I("span", {
|
|
936
936
|
key: 2,
|
|
937
|
-
class:
|
|
937
|
+
class: j({ [p(a).em("text", "expand")]: p(E) })
|
|
938
938
|
}, [
|
|
939
939
|
T(c.$slots, "default")
|
|
940
940
|
], 2)) : tt("v-if", !0)
|
|
@@ -943,40 +943,40 @@ const He = C({
|
|
|
943
943
|
}, 16, ["class", "style", "onClick"]));
|
|
944
944
|
}
|
|
945
945
|
});
|
|
946
|
-
var
|
|
947
|
-
const
|
|
946
|
+
var Pe = /* @__PURE__ */ Q(ze, [["__file", "button.vue"]]);
|
|
947
|
+
const Re = {
|
|
948
948
|
size: W.size,
|
|
949
949
|
type: W.type,
|
|
950
950
|
direction: {
|
|
951
|
-
type:
|
|
951
|
+
type: G(String),
|
|
952
952
|
values: ["horizontal", "vertical"],
|
|
953
953
|
default: "horizontal"
|
|
954
954
|
}
|
|
955
|
-
},
|
|
955
|
+
}, je = A({
|
|
956
956
|
name: "ElButtonGroup"
|
|
957
|
-
}),
|
|
958
|
-
...
|
|
959
|
-
props:
|
|
957
|
+
}), Fe = /* @__PURE__ */ A({
|
|
958
|
+
...je,
|
|
959
|
+
props: Re,
|
|
960
960
|
setup(t) {
|
|
961
961
|
const e = t;
|
|
962
|
-
|
|
962
|
+
Vt(Mt, zt({
|
|
963
963
|
size: et(e, "size"),
|
|
964
964
|
type: et(e, "type")
|
|
965
965
|
}));
|
|
966
|
-
const
|
|
967
|
-
return (
|
|
968
|
-
class:
|
|
966
|
+
const r = F("button");
|
|
967
|
+
return (n, o) => (x(), I("div", {
|
|
968
|
+
class: j([p(r).b("group"), p(r).bm("group", e.direction)])
|
|
969
969
|
}, [
|
|
970
|
-
T(
|
|
970
|
+
T(n.$slots, "default")
|
|
971
971
|
], 2));
|
|
972
972
|
}
|
|
973
973
|
});
|
|
974
|
-
var
|
|
975
|
-
const
|
|
976
|
-
ButtonGroup:
|
|
974
|
+
var $t = /* @__PURE__ */ Q(Fe, [["__file", "button-group.vue"]]);
|
|
975
|
+
const Ge = xt(Pe, {
|
|
976
|
+
ButtonGroup: $t
|
|
977
977
|
});
|
|
978
|
-
|
|
979
|
-
const
|
|
978
|
+
ce($t);
|
|
979
|
+
const De = {
|
|
980
980
|
/**
|
|
981
981
|
* 按钮文本
|
|
982
982
|
*/
|
|
@@ -1007,37 +1007,35 @@ const ze = {
|
|
|
1007
1007
|
type: Object,
|
|
1008
1008
|
default: () => ({})
|
|
1009
1009
|
}
|
|
1010
|
-
},
|
|
1010
|
+
}, Bt = (t, e) => {
|
|
1011
1011
|
if (typeof t != "object" || typeof e != "object")
|
|
1012
1012
|
return e ?? t;
|
|
1013
|
-
const
|
|
1014
|
-
return Object.keys(e).forEach((
|
|
1015
|
-
e[
|
|
1016
|
-
}),
|
|
1017
|
-
},
|
|
1018
|
-
let
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1013
|
+
const r = { ...t };
|
|
1014
|
+
return Object.keys(e).forEach((n) => {
|
|
1015
|
+
e[n] && typeof e[n] == "object" && !Array.isArray(e[n]) ? r[n] = Bt(t[n] || {}, e[n]) : r[n] = e[n] !== void 0 ? e[n] : t[n];
|
|
1016
|
+
}), r;
|
|
1017
|
+
}, Ke = (t) => Object.prototype.toString.call(t) === "[object Object]", dt = (t) => Array.isArray(t), ht = (t, e = 300, r = !1) => {
|
|
1018
|
+
let n = null;
|
|
1019
|
+
const o = function(...a) {
|
|
1020
|
+
n && clearTimeout(n);
|
|
1021
1021
|
let i;
|
|
1022
|
-
return
|
|
1023
|
-
|
|
1022
|
+
return r && !n && (i = t.apply(this, a)), n = setTimeout(() => {
|
|
1023
|
+
r || t.apply(this, a), n = null;
|
|
1024
1024
|
}, e), i;
|
|
1025
1025
|
};
|
|
1026
|
-
return
|
|
1027
|
-
|
|
1028
|
-
},
|
|
1029
|
-
},
|
|
1026
|
+
return o.cancel = () => {
|
|
1027
|
+
n && (clearTimeout(n), n = null);
|
|
1028
|
+
}, o;
|
|
1029
|
+
}, Le = {
|
|
1030
1030
|
/**
|
|
1031
|
-
* 防抖配置项
|
|
1032
|
-
* enable:是否启用防抖 默认启用
|
|
1031
|
+
* 防抖配置项 仅作用于@onClick事件,无需防抖则设置delay为0或使用@click事件即可。
|
|
1033
1032
|
* delay:防抖时间 默认500ms
|
|
1034
1033
|
* immediate:是否立即开启防抖 默认否
|
|
1035
1034
|
*/
|
|
1036
|
-
debounce: {
|
|
1035
|
+
debounce: { delay: 500, immediate: !1 },
|
|
1037
1036
|
/**
|
|
1038
1037
|
* 二次确认配置项
|
|
1039
|
-
*
|
|
1040
|
-
* data:二次确认数据 默认为null,可为String、Number、Object、Array,为null则需通过enable启用二次确认
|
|
1038
|
+
* data:二次确认数据 显式设置则开启二次确认,可为String、Number、Object、Array,无需传递数据则设置为null即可
|
|
1041
1039
|
* type:二次确认类型 默认danger,同ElButton类型
|
|
1042
1040
|
* dataKey:二次确认数据主键key 默认id,对象或对象数组需要
|
|
1043
1041
|
* toArray:是否将以逗号分隔的字符串转换为数组 如:'1,2' => [1,2]
|
|
@@ -1046,8 +1044,6 @@ const ze = {
|
|
|
1046
1044
|
* content:二次确认弹框内容
|
|
1047
1045
|
*/
|
|
1048
1046
|
confirm: {
|
|
1049
|
-
enable: !1,
|
|
1050
|
-
data: null,
|
|
1051
1047
|
type: "danger",
|
|
1052
1048
|
dataKey: "id",
|
|
1053
1049
|
toArray: !1,
|
|
@@ -1055,100 +1051,194 @@ const ze = {
|
|
|
1055
1051
|
title: "删除提示",
|
|
1056
1052
|
content: "确定将选择数据删除?"
|
|
1057
1053
|
}
|
|
1058
|
-
},
|
|
1059
|
-
const
|
|
1060
|
-
() =>
|
|
1061
|
-
),
|
|
1054
|
+
}, Ue = ({ props: t, emits: e, attrs: r }) => {
|
|
1055
|
+
const n = h(
|
|
1056
|
+
() => Bt(Le, t.extConfig)
|
|
1057
|
+
), a = ht(
|
|
1062
1058
|
async () => {
|
|
1063
|
-
const { data:
|
|
1064
|
-
if (!["object", "number", "string"].includes(typeof
|
|
1065
|
-
|
|
1059
|
+
const { data: f, title: g, content: m, dataKey: S, toArray: $, appendS: E } = n.value.confirm;
|
|
1060
|
+
if (!["object", "number", "string"].includes(typeof f)) {
|
|
1061
|
+
rt.warning(
|
|
1066
1062
|
"clickConfig.data类型必须为Array、Object、String或Number"
|
|
1067
1063
|
);
|
|
1068
1064
|
return;
|
|
1069
1065
|
}
|
|
1070
|
-
if (["number", "string"].includes(typeof
|
|
1066
|
+
if (["number", "string"].includes(typeof f)) {
|
|
1071
1067
|
try {
|
|
1072
|
-
await
|
|
1068
|
+
await nt.confirm(m, g, {
|
|
1073
1069
|
confirmButtonText: "确定",
|
|
1074
1070
|
cancelButtonText: "取消",
|
|
1075
1071
|
type: "warning"
|
|
1076
|
-
}), e("onClick",
|
|
1072
|
+
}), e("onClick", f);
|
|
1077
1073
|
} catch {
|
|
1078
1074
|
}
|
|
1079
1075
|
return;
|
|
1080
1076
|
}
|
|
1081
|
-
if (
|
|
1082
|
-
|
|
1077
|
+
if (Ke(f) && !Object.keys(f).length || dt(f) && !f.length) {
|
|
1078
|
+
rt.warning("请至少选择一条数据");
|
|
1083
1079
|
return;
|
|
1084
1080
|
}
|
|
1085
1081
|
try {
|
|
1086
|
-
if (await
|
|
1082
|
+
if (await nt.confirm(m, g, {
|
|
1087
1083
|
confirmButtonText: "确定",
|
|
1088
1084
|
cancelButtonText: "取消",
|
|
1089
1085
|
type: "warning"
|
|
1090
|
-
}),
|
|
1086
|
+
}), f === null) {
|
|
1091
1087
|
e("onClick");
|
|
1092
1088
|
return;
|
|
1093
1089
|
}
|
|
1094
|
-
const
|
|
1090
|
+
const l = dt(f) ? f.map((d) => typeof d == "object" ? d[S] : d) : [f[S]];
|
|
1095
1091
|
e("onClick", {
|
|
1096
|
-
[
|
|
1097
|
-
data:
|
|
1092
|
+
[E ? `${S}s` : S]: $ ? l : l.join(),
|
|
1093
|
+
data: f
|
|
1098
1094
|
});
|
|
1099
1095
|
} catch {
|
|
1100
1096
|
}
|
|
1101
1097
|
},
|
|
1102
|
-
|
|
1103
|
-
|
|
1098
|
+
n.value.debounce.delay,
|
|
1099
|
+
n.value.debounce.immediate
|
|
1104
1100
|
), i = ht(
|
|
1105
1101
|
() => e("onClick"),
|
|
1106
|
-
|
|
1107
|
-
|
|
1102
|
+
n.value.debounce.delay,
|
|
1103
|
+
n.value.debounce.immediate
|
|
1104
|
+
), s = h(
|
|
1105
|
+
() => Object.hasOwn(n.value.confirm, "data")
|
|
1108
1106
|
);
|
|
1109
|
-
return { mergedExtConfig:
|
|
1110
|
-
|
|
1107
|
+
return { mergedExtConfig: n, isConfirm: s, handleElButton: () => {
|
|
1108
|
+
r.onClick || (s.value ? a() : i());
|
|
1111
1109
|
} };
|
|
1112
|
-
},
|
|
1110
|
+
}, qe = /* @__PURE__ */ A({
|
|
1113
1111
|
__name: "index",
|
|
1114
|
-
props:
|
|
1112
|
+
props: De,
|
|
1115
1113
|
emits: ["onClick"],
|
|
1116
1114
|
setup(t, { emit: e }) {
|
|
1117
|
-
const
|
|
1118
|
-
props:
|
|
1119
|
-
emits:
|
|
1120
|
-
attrs:
|
|
1115
|
+
const r = t, n = e, o = Pt(), { isConfirm: a, mergedExtConfig: i, handleElButton: s } = Ue({
|
|
1116
|
+
props: r,
|
|
1117
|
+
emits: n,
|
|
1118
|
+
attrs: o
|
|
1121
1119
|
});
|
|
1122
|
-
return
|
|
1123
|
-
document.querySelectorAll(".el-button").forEach((
|
|
1124
|
-
|
|
1120
|
+
return Rt(() => {
|
|
1121
|
+
document.querySelectorAll(".el-button").forEach((u) => {
|
|
1122
|
+
u.addEventListener(
|
|
1125
1123
|
"blur",
|
|
1126
|
-
(
|
|
1127
|
-
|
|
1124
|
+
(f) => {
|
|
1125
|
+
f.target.classList.add("blur");
|
|
1128
1126
|
},
|
|
1129
1127
|
!0
|
|
1130
1128
|
);
|
|
1131
1129
|
});
|
|
1132
|
-
}), (
|
|
1133
|
-
const
|
|
1134
|
-
return
|
|
1130
|
+
}), (u, f) => {
|
|
1131
|
+
const g = Ge;
|
|
1132
|
+
return x(), H(g, {
|
|
1135
1133
|
class: "wyfe-ivue__use-el-button",
|
|
1136
|
-
type:
|
|
1137
|
-
onClick:
|
|
1134
|
+
type: p(a) ? p(i).confirm.type : u.type,
|
|
1135
|
+
onClick: p(s)
|
|
1138
1136
|
}, {
|
|
1139
|
-
default:
|
|
1140
|
-
jt(
|
|
1137
|
+
default: R(() => [
|
|
1138
|
+
jt(Ft(u.btnText), 1)
|
|
1141
1139
|
]),
|
|
1142
1140
|
_: 1
|
|
1143
1141
|
}, 8, ["type", "onClick"]);
|
|
1144
1142
|
};
|
|
1145
1143
|
}
|
|
1146
|
-
}),
|
|
1147
|
-
const
|
|
1148
|
-
for (const [
|
|
1149
|
-
n
|
|
1150
|
-
return
|
|
1151
|
-
},
|
|
1144
|
+
}), Ct = (t, e) => {
|
|
1145
|
+
const r = t.__vccOpts || t;
|
|
1146
|
+
for (const [n, o] of e)
|
|
1147
|
+
r[n] = o;
|
|
1148
|
+
return r;
|
|
1149
|
+
}, er = /* @__PURE__ */ Ct(qe, [["__scopeId", "data-v-287a5fd7"]]), We = (t) => {
|
|
1150
|
+
const e = /^(-?\d*\.?\d+)(\D+)?$/, r = t.match(e);
|
|
1151
|
+
if (!r) throw new Error("size不合法");
|
|
1152
|
+
const n = parseFloat(r[1]), o = r[2]?.trim() || "px";
|
|
1153
|
+
return [n, o];
|
|
1154
|
+
}, Je = ([, t]) => {
|
|
1155
|
+
const e = ["px", "rem", "vw", "vh", "em"], r = e.includes(t);
|
|
1156
|
+
if (!r) throw new Error(`size单位不合法,合法单位:${e.join("、")}`);
|
|
1157
|
+
return r;
|
|
1158
|
+
}, Ze = {
|
|
1159
|
+
/**
|
|
1160
|
+
* 图标名称 必传
|
|
1161
|
+
*/
|
|
1162
|
+
name: {
|
|
1163
|
+
type: String,
|
|
1164
|
+
required: !0
|
|
1165
|
+
},
|
|
1166
|
+
/**
|
|
1167
|
+
* 图标大小 默认类型为数字(单位为px);可传带单位的字符串,如:20px、0.2rem
|
|
1168
|
+
*/
|
|
1169
|
+
size: {
|
|
1170
|
+
type: [Number, String],
|
|
1171
|
+
default: 28,
|
|
1172
|
+
validator(t) {
|
|
1173
|
+
return (typeof t == "number" || Je(We(t))) && t;
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
/**
|
|
1177
|
+
* 图标颜色 可传String或Array
|
|
1178
|
+
* 若传Array,只能传两项 第一项为默认图标颜色 第二项为暗黑模式下图标颜色
|
|
1179
|
+
*/
|
|
1180
|
+
color: {
|
|
1181
|
+
type: [String, Array],
|
|
1182
|
+
validator(t) {
|
|
1183
|
+
if (!Array.isArray(t)) return t;
|
|
1184
|
+
if (!t.length) throw new Error("color类型为Array时length不能为0");
|
|
1185
|
+
if (t.length > 2) throw new Error("color类型为Array时length最大为2");
|
|
1186
|
+
return t;
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
/**
|
|
1190
|
+
* 图标的margin外边距 同css的margin规则
|
|
1191
|
+
*/
|
|
1192
|
+
margin: {
|
|
1193
|
+
type: String
|
|
1194
|
+
},
|
|
1195
|
+
/**
|
|
1196
|
+
* 是否可点击
|
|
1197
|
+
*/
|
|
1198
|
+
clickable: {
|
|
1199
|
+
type: Boolean,
|
|
1200
|
+
default: !1
|
|
1201
|
+
},
|
|
1202
|
+
/**
|
|
1203
|
+
* hover类名
|
|
1204
|
+
*/
|
|
1205
|
+
hoverClass: {
|
|
1206
|
+
type: String
|
|
1207
|
+
}
|
|
1208
|
+
}, Ye = ["href", "fill"], Qe = /* @__PURE__ */ A({
|
|
1209
|
+
__name: "index",
|
|
1210
|
+
props: Ze,
|
|
1211
|
+
setup(t) {
|
|
1212
|
+
Gt((i) => ({
|
|
1213
|
+
v13957fec: o.value,
|
|
1214
|
+
v41d047fc: a.value
|
|
1215
|
+
}));
|
|
1216
|
+
const e = t, r = h(
|
|
1217
|
+
() => typeof e.size == "number" ? `${e.size}px` : e.size
|
|
1218
|
+
), n = h(() => `#icon-${e.name}`), o = h(
|
|
1219
|
+
() => Array.isArray(e.color) && e.color.length > 0 ? e.color[0] : e.color
|
|
1220
|
+
), a = h(
|
|
1221
|
+
() => Array.isArray(e.color) && e.color.length > 1 ? e.color[1] : ""
|
|
1222
|
+
);
|
|
1223
|
+
return (i, s) => (x(), I("svg", {
|
|
1224
|
+
class: "wyfe-ivue__use-svg-icon",
|
|
1225
|
+
"aria-hidden": "true",
|
|
1226
|
+
style: Dt({
|
|
1227
|
+
width: r.value,
|
|
1228
|
+
height: r.value,
|
|
1229
|
+
cursor: i.clickable ? "pointer" : "auto",
|
|
1230
|
+
margin: i.margin
|
|
1231
|
+
})
|
|
1232
|
+
}, [
|
|
1233
|
+
pt("use", {
|
|
1234
|
+
class: j([a.value ? "fillClass" : "", i.hoverClass]),
|
|
1235
|
+
href: n.value,
|
|
1236
|
+
fill: o.value
|
|
1237
|
+
}, null, 10, Ye)
|
|
1238
|
+
], 4));
|
|
1239
|
+
}
|
|
1240
|
+
}), rr = /* @__PURE__ */ Ct(Qe, [["__scopeId", "data-v-743009c3"]]);
|
|
1152
1241
|
export {
|
|
1153
|
-
|
|
1242
|
+
er as UseElButton,
|
|
1243
|
+
rr as UseSvgIcon
|
|
1154
1244
|
};
|