@ipa-community/element-plus 0.0.2 → 0.0.3

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.
@@ -0,0 +1,872 @@
1
+ import { aH as ft, a$ as ct, aa as ht, a8 as dt, a9 as rt, V as gt, W as at, aV as vt, a0 as Z, a2 as bt, a7 as O, ag as K, _ as nt, X as pt, aE as mt } from "./base-8KXu3iRZ.js";
2
+ import { computed as b, inject as yt, ref as ot, useSlots as kt, Text as xt, defineComponent as U, createBlock as H, openBlock as x, resolveDynamicComponent as C, mergeProps as St, unref as p, withCtx as T, createElementBlock as F, createCommentVNode as X, Fragment as wt, renderSlot as N, normalizeClass as W, provide as Mt, reactive as _t, toRef as Y, createVNode as Ht, createElementVNode as g, createTextVNode as $, toDisplayString as P } from "vue";
3
+ import { t as Bt } from "./index-FUqkHp7t.js";
4
+ import { _ as At } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ const it = Symbol(
6
+ "buttonGroupContextKey"
7
+ ), Rt = (e, r) => {
8
+ ft(
9
+ {
10
+ from: "type.text",
11
+ replacement: "link",
12
+ version: "3.0.0",
13
+ scope: "props",
14
+ ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
15
+ },
16
+ b(() => e.type === "text")
17
+ );
18
+ const t = yt(it, void 0), a = ct("button"), { form: n } = ht(), o = dt(b(() => t?.size)), i = rt(), s = ot(), f = kt(), m = b(
19
+ () => {
20
+ var u;
21
+ return e.type || t?.type || ((u = a.value) == null ? void 0 : u.type) || "";
22
+ }
23
+ ), y = b(
24
+ () => {
25
+ var u, l, h;
26
+ return (h = (l = e.autoInsertSpace) != null ? l : (u = a.value) == null ? void 0 : u.autoInsertSpace) != null ? h : !1;
27
+ }
28
+ ), _ = b(
29
+ () => {
30
+ var u, l, h;
31
+ return (h = (l = e.plain) != null ? l : (u = a.value) == null ? void 0 : u.plain) != null ? h : !1;
32
+ }
33
+ ), I = b(
34
+ () => {
35
+ var u, l, h;
36
+ return (h = (l = e.round) != null ? l : (u = a.value) == null ? void 0 : u.round) != null ? h : !1;
37
+ }
38
+ ), E = b(() => {
39
+ var u, l, h;
40
+ return (h = (l = e.text) != null ? l : (u = a.value) == null ? void 0 : u.text) != null ? h : !1;
41
+ }), V = b(() => e.tag === "button" ? {
42
+ ariaDisabled: i.value || e.loading,
43
+ disabled: i.value || e.loading,
44
+ autofocus: e.autofocus,
45
+ type: e.nativeType
46
+ } : {}), B = b(() => {
47
+ var u;
48
+ const l = (u = f.default) == null ? void 0 : u.call(f);
49
+ if (y.value && l?.length === 1) {
50
+ const h = l[0];
51
+ if (h?.type === xt) {
52
+ const ut = h.children;
53
+ return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(ut.trim());
54
+ }
55
+ }
56
+ return !1;
57
+ });
58
+ return {
59
+ _disabled: i,
60
+ _size: o,
61
+ _type: m,
62
+ _ref: s,
63
+ _props: V,
64
+ _plain: _,
65
+ _round: I,
66
+ _text: E,
67
+ shouldAddSpace: B,
68
+ handleClick: (u) => {
69
+ if (i.value || e.loading) {
70
+ u.stopPropagation();
71
+ return;
72
+ }
73
+ e.nativeType === "reset" && n?.resetFields(), r("click", u);
74
+ }
75
+ };
76
+ }, Tt = [
77
+ "default",
78
+ "primary",
79
+ "success",
80
+ "warning",
81
+ "info",
82
+ "danger",
83
+ "text",
84
+ ""
85
+ ], Nt = ["button", "submit", "reset"], j = gt({
86
+ size: bt,
87
+ disabled: {
88
+ type: Boolean,
89
+ default: void 0
90
+ },
91
+ type: {
92
+ type: String,
93
+ values: Tt,
94
+ default: ""
95
+ },
96
+ icon: {
97
+ type: Z
98
+ },
99
+ nativeType: {
100
+ type: String,
101
+ values: Nt,
102
+ default: "button"
103
+ },
104
+ loading: Boolean,
105
+ loadingIcon: {
106
+ type: Z,
107
+ default: () => vt
108
+ },
109
+ plain: {
110
+ type: Boolean,
111
+ default: void 0
112
+ },
113
+ text: {
114
+ type: Boolean,
115
+ default: void 0
116
+ },
117
+ link: Boolean,
118
+ bg: Boolean,
119
+ autofocus: Boolean,
120
+ round: {
121
+ type: Boolean,
122
+ default: void 0
123
+ },
124
+ circle: Boolean,
125
+ color: String,
126
+ dark: Boolean,
127
+ autoInsertSpace: {
128
+ type: Boolean,
129
+ default: void 0
130
+ },
131
+ tag: {
132
+ type: at([String, Object]),
133
+ default: "button"
134
+ }
135
+ }), Ft = {
136
+ click: (e) => e instanceof MouseEvent
137
+ };
138
+ function c(e, r) {
139
+ It(e) && (e = "100%");
140
+ var t = Et(e);
141
+ return e = r === 360 ? e : Math.min(r, Math.max(0, parseFloat(e))), t && (e = parseInt(String(e * r), 10) / 100), Math.abs(e - r) < 1e-6 ? 1 : (r === 360 ? e = (e < 0 ? e % r + r : e % r) / parseFloat(String(r)) : e = e % r / parseFloat(String(r)), e);
142
+ }
143
+ function A(e) {
144
+ return Math.min(1, Math.max(0, e));
145
+ }
146
+ function It(e) {
147
+ return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
148
+ }
149
+ function Et(e) {
150
+ return typeof e == "string" && e.indexOf("%") !== -1;
151
+ }
152
+ function st(e) {
153
+ return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
154
+ }
155
+ function R(e) {
156
+ return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
157
+ }
158
+ function M(e) {
159
+ return e.length === 1 ? "0" + e : String(e);
160
+ }
161
+ function Vt(e, r, t) {
162
+ return {
163
+ r: c(e, 255) * 255,
164
+ g: c(r, 255) * 255,
165
+ b: c(t, 255) * 255
166
+ };
167
+ }
168
+ function J(e, r, t) {
169
+ e = c(e, 255), r = c(r, 255), t = c(t, 255);
170
+ var a = Math.max(e, r, t), n = Math.min(e, r, t), o = 0, i = 0, s = (a + n) / 2;
171
+ if (a === n)
172
+ i = 0, o = 0;
173
+ else {
174
+ var f = a - n;
175
+ switch (i = s > 0.5 ? f / (2 - a - n) : f / (a + n), a) {
176
+ case e:
177
+ o = (r - t) / f + (r < t ? 6 : 0);
178
+ break;
179
+ case r:
180
+ o = (t - e) / f + 2;
181
+ break;
182
+ case t:
183
+ o = (e - r) / f + 4;
184
+ break;
185
+ }
186
+ o /= 6;
187
+ }
188
+ return { h: o, s: i, l: s };
189
+ }
190
+ function z(e, r, t) {
191
+ return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? e + (r - e) * (6 * t) : t < 1 / 2 ? r : t < 2 / 3 ? e + (r - e) * (2 / 3 - t) * 6 : e;
192
+ }
193
+ function Ct(e, r, t) {
194
+ var a, n, o;
195
+ if (e = c(e, 360), r = c(r, 100), t = c(t, 100), r === 0)
196
+ n = t, o = t, a = t;
197
+ else {
198
+ var i = t < 0.5 ? t * (1 + r) : t + r - t * r, s = 2 * t - i;
199
+ a = z(s, i, e + 1 / 3), n = z(s, i, e), o = z(s, i, e - 1 / 3);
200
+ }
201
+ return { r: a * 255, g: n * 255, b: o * 255 };
202
+ }
203
+ function Q(e, r, t) {
204
+ e = c(e, 255), r = c(r, 255), t = c(t, 255);
205
+ var a = Math.max(e, r, t), n = Math.min(e, r, t), o = 0, i = a, s = a - n, f = a === 0 ? 0 : s / a;
206
+ if (a === n)
207
+ o = 0;
208
+ else {
209
+ switch (a) {
210
+ case e:
211
+ o = (r - t) / s + (r < t ? 6 : 0);
212
+ break;
213
+ case r:
214
+ o = (t - e) / s + 2;
215
+ break;
216
+ case t:
217
+ o = (e - r) / s + 4;
218
+ break;
219
+ }
220
+ o /= 6;
221
+ }
222
+ return { h: o, s: f, v: i };
223
+ }
224
+ function $t(e, r, t) {
225
+ e = c(e, 360) * 6, r = c(r, 100), t = c(t, 100);
226
+ var a = Math.floor(e), n = e - a, o = t * (1 - r), i = t * (1 - n * r), s = t * (1 - (1 - n) * r), f = a % 6, m = [t, i, o, o, s, t][f], y = [s, t, t, i, o, o][f], _ = [o, o, s, t, t, i][f];
227
+ return { r: m * 255, g: y * 255, b: _ * 255 };
228
+ }
229
+ function tt(e, r, t, a) {
230
+ var n = [
231
+ M(Math.round(e).toString(16)),
232
+ M(Math.round(r).toString(16)),
233
+ M(Math.round(t).toString(16))
234
+ ];
235
+ return a && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
236
+ }
237
+ function Pt(e, r, t, a, n) {
238
+ var o = [
239
+ M(Math.round(e).toString(16)),
240
+ M(Math.round(r).toString(16)),
241
+ M(Math.round(t).toString(16)),
242
+ M(zt(a))
243
+ ];
244
+ return n && 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("");
245
+ }
246
+ function zt(e) {
247
+ return Math.round(parseFloat(e) * 255).toString(16);
248
+ }
249
+ function et(e) {
250
+ return d(e) / 255;
251
+ }
252
+ function d(e) {
253
+ return parseInt(e, 16);
254
+ }
255
+ function Gt(e) {
256
+ return {
257
+ r: e >> 16,
258
+ g: (e & 65280) >> 8,
259
+ b: e & 255
260
+ };
261
+ }
262
+ var D = {
263
+ aliceblue: "#f0f8ff",
264
+ antiquewhite: "#faebd7",
265
+ aqua: "#00ffff",
266
+ aquamarine: "#7fffd4",
267
+ azure: "#f0ffff",
268
+ beige: "#f5f5dc",
269
+ bisque: "#ffe4c4",
270
+ black: "#000000",
271
+ blanchedalmond: "#ffebcd",
272
+ blue: "#0000ff",
273
+ blueviolet: "#8a2be2",
274
+ brown: "#a52a2a",
275
+ burlywood: "#deb887",
276
+ cadetblue: "#5f9ea0",
277
+ chartreuse: "#7fff00",
278
+ chocolate: "#d2691e",
279
+ coral: "#ff7f50",
280
+ cornflowerblue: "#6495ed",
281
+ cornsilk: "#fff8dc",
282
+ crimson: "#dc143c",
283
+ cyan: "#00ffff",
284
+ darkblue: "#00008b",
285
+ darkcyan: "#008b8b",
286
+ darkgoldenrod: "#b8860b",
287
+ darkgray: "#a9a9a9",
288
+ darkgreen: "#006400",
289
+ darkgrey: "#a9a9a9",
290
+ darkkhaki: "#bdb76b",
291
+ darkmagenta: "#8b008b",
292
+ darkolivegreen: "#556b2f",
293
+ darkorange: "#ff8c00",
294
+ darkorchid: "#9932cc",
295
+ darkred: "#8b0000",
296
+ darksalmon: "#e9967a",
297
+ darkseagreen: "#8fbc8f",
298
+ darkslateblue: "#483d8b",
299
+ darkslategray: "#2f4f4f",
300
+ darkslategrey: "#2f4f4f",
301
+ darkturquoise: "#00ced1",
302
+ darkviolet: "#9400d3",
303
+ deeppink: "#ff1493",
304
+ deepskyblue: "#00bfff",
305
+ dimgray: "#696969",
306
+ dimgrey: "#696969",
307
+ dodgerblue: "#1e90ff",
308
+ firebrick: "#b22222",
309
+ floralwhite: "#fffaf0",
310
+ forestgreen: "#228b22",
311
+ fuchsia: "#ff00ff",
312
+ gainsboro: "#dcdcdc",
313
+ ghostwhite: "#f8f8ff",
314
+ goldenrod: "#daa520",
315
+ gold: "#ffd700",
316
+ gray: "#808080",
317
+ green: "#008000",
318
+ greenyellow: "#adff2f",
319
+ grey: "#808080",
320
+ honeydew: "#f0fff0",
321
+ hotpink: "#ff69b4",
322
+ indianred: "#cd5c5c",
323
+ indigo: "#4b0082",
324
+ ivory: "#fffff0",
325
+ khaki: "#f0e68c",
326
+ lavenderblush: "#fff0f5",
327
+ lavender: "#e6e6fa",
328
+ lawngreen: "#7cfc00",
329
+ lemonchiffon: "#fffacd",
330
+ lightblue: "#add8e6",
331
+ lightcoral: "#f08080",
332
+ lightcyan: "#e0ffff",
333
+ lightgoldenrodyellow: "#fafad2",
334
+ lightgray: "#d3d3d3",
335
+ lightgreen: "#90ee90",
336
+ lightgrey: "#d3d3d3",
337
+ lightpink: "#ffb6c1",
338
+ lightsalmon: "#ffa07a",
339
+ lightseagreen: "#20b2aa",
340
+ lightskyblue: "#87cefa",
341
+ lightslategray: "#778899",
342
+ lightslategrey: "#778899",
343
+ lightsteelblue: "#b0c4de",
344
+ lightyellow: "#ffffe0",
345
+ lime: "#00ff00",
346
+ limegreen: "#32cd32",
347
+ linen: "#faf0e6",
348
+ magenta: "#ff00ff",
349
+ maroon: "#800000",
350
+ mediumaquamarine: "#66cdaa",
351
+ mediumblue: "#0000cd",
352
+ mediumorchid: "#ba55d3",
353
+ mediumpurple: "#9370db",
354
+ mediumseagreen: "#3cb371",
355
+ mediumslateblue: "#7b68ee",
356
+ mediumspringgreen: "#00fa9a",
357
+ mediumturquoise: "#48d1cc",
358
+ mediumvioletred: "#c71585",
359
+ midnightblue: "#191970",
360
+ mintcream: "#f5fffa",
361
+ mistyrose: "#ffe4e1",
362
+ moccasin: "#ffe4b5",
363
+ navajowhite: "#ffdead",
364
+ navy: "#000080",
365
+ oldlace: "#fdf5e6",
366
+ olive: "#808000",
367
+ olivedrab: "#6b8e23",
368
+ orange: "#ffa500",
369
+ orangered: "#ff4500",
370
+ orchid: "#da70d6",
371
+ palegoldenrod: "#eee8aa",
372
+ palegreen: "#98fb98",
373
+ paleturquoise: "#afeeee",
374
+ palevioletred: "#db7093",
375
+ papayawhip: "#ffefd5",
376
+ peachpuff: "#ffdab9",
377
+ peru: "#cd853f",
378
+ pink: "#ffc0cb",
379
+ plum: "#dda0dd",
380
+ powderblue: "#b0e0e6",
381
+ purple: "#800080",
382
+ rebeccapurple: "#663399",
383
+ red: "#ff0000",
384
+ rosybrown: "#bc8f8f",
385
+ royalblue: "#4169e1",
386
+ saddlebrown: "#8b4513",
387
+ salmon: "#fa8072",
388
+ sandybrown: "#f4a460",
389
+ seagreen: "#2e8b57",
390
+ seashell: "#fff5ee",
391
+ sienna: "#a0522d",
392
+ silver: "#c0c0c0",
393
+ skyblue: "#87ceeb",
394
+ slateblue: "#6a5acd",
395
+ slategray: "#708090",
396
+ slategrey: "#708090",
397
+ snow: "#fffafa",
398
+ springgreen: "#00ff7f",
399
+ steelblue: "#4682b4",
400
+ tan: "#d2b48c",
401
+ teal: "#008080",
402
+ thistle: "#d8bfd8",
403
+ tomato: "#ff6347",
404
+ turquoise: "#40e0d0",
405
+ violet: "#ee82ee",
406
+ wheat: "#f5deb3",
407
+ white: "#ffffff",
408
+ whitesmoke: "#f5f5f5",
409
+ yellow: "#ffff00",
410
+ yellowgreen: "#9acd32"
411
+ };
412
+ function Lt(e) {
413
+ var r = { r: 0, g: 0, b: 0 }, t = 1, a = null, n = null, o = null, i = !1, s = !1;
414
+ return typeof e == "string" && (e = Dt(e)), typeof e == "object" && (k(e.r) && k(e.g) && k(e.b) ? (r = Vt(e.r, e.g, e.b), i = !0, s = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : k(e.h) && k(e.s) && k(e.v) ? (a = R(e.s), n = R(e.v), r = $t(e.h, a, n), i = !0, s = "hsv") : k(e.h) && k(e.s) && k(e.l) && (a = R(e.s), o = R(e.l), r = Ct(e.h, a, o), i = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (t = e.a)), t = st(t), {
415
+ ok: i,
416
+ format: e.format || s,
417
+ r: Math.min(255, Math.max(r.r, 0)),
418
+ g: Math.min(255, Math.max(r.g, 0)),
419
+ b: Math.min(255, Math.max(r.b, 0)),
420
+ a: t
421
+ };
422
+ }
423
+ var Wt = "[-\\+]?\\d+%?", jt = "[-\\+]?\\d*\\.\\d+%?", w = "(?:".concat(jt, ")|(?:").concat(Wt, ")"), G = "[\\s|\\(]+(".concat(w, ")[,|\\s]+(").concat(w, ")[,|\\s]+(").concat(w, ")\\s*\\)?"), L = "[\\s|\\(]+(".concat(w, ")[,|\\s]+(").concat(w, ")[,|\\s]+(").concat(w, ")[,|\\s]+(").concat(w, ")\\s*\\)?"), v = {
424
+ CSS_UNIT: new RegExp(w),
425
+ rgb: new RegExp("rgb" + G),
426
+ rgba: new RegExp("rgba" + L),
427
+ hsl: new RegExp("hsl" + G),
428
+ hsla: new RegExp("hsla" + L),
429
+ hsv: new RegExp("hsv" + G),
430
+ hsva: new RegExp("hsva" + L),
431
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
432
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
433
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
434
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
435
+ };
436
+ function Dt(e) {
437
+ if (e = e.trim().toLowerCase(), e.length === 0)
438
+ return !1;
439
+ var r = !1;
440
+ if (D[e])
441
+ e = D[e], r = !0;
442
+ else if (e === "transparent")
443
+ return { r: 0, g: 0, b: 0, a: 0, format: "name" };
444
+ var t = v.rgb.exec(e);
445
+ return t ? { r: t[1], g: t[2], b: t[3] } : (t = v.rgba.exec(e), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = v.hsl.exec(e), t ? { h: t[1], s: t[2], l: t[3] } : (t = v.hsla.exec(e), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = v.hsv.exec(e), t ? { h: t[1], s: t[2], v: t[3] } : (t = v.hsva.exec(e), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = v.hex8.exec(e), t ? {
446
+ r: d(t[1]),
447
+ g: d(t[2]),
448
+ b: d(t[3]),
449
+ a: et(t[4]),
450
+ format: r ? "name" : "hex8"
451
+ } : (t = v.hex6.exec(e), t ? {
452
+ r: d(t[1]),
453
+ g: d(t[2]),
454
+ b: d(t[3]),
455
+ format: r ? "name" : "hex"
456
+ } : (t = v.hex4.exec(e), t ? {
457
+ r: d(t[1] + t[1]),
458
+ g: d(t[2] + t[2]),
459
+ b: d(t[3] + t[3]),
460
+ a: et(t[4] + t[4]),
461
+ format: r ? "name" : "hex8"
462
+ } : (t = v.hex3.exec(e), t ? {
463
+ r: d(t[1] + t[1]),
464
+ g: d(t[2] + t[2]),
465
+ b: d(t[3] + t[3]),
466
+ format: r ? "name" : "hex"
467
+ } : !1)))))))));
468
+ }
469
+ function k(e) {
470
+ return !!v.CSS_UNIT.exec(String(e));
471
+ }
472
+ var Ot = (
473
+ /** @class */
474
+ (function() {
475
+ function e(r, t) {
476
+ r === void 0 && (r = ""), t === void 0 && (t = {});
477
+ var a;
478
+ if (r instanceof e)
479
+ return r;
480
+ typeof r == "number" && (r = Gt(r)), this.originalInput = r;
481
+ var n = Lt(r);
482
+ this.originalInput = r, this.r = n.r, this.g = n.g, this.b = n.b, this.a = n.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (a = t.format) !== null && a !== void 0 ? a : n.format, this.gradientType = t.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 = n.ok;
483
+ }
484
+ return e.prototype.isDark = function() {
485
+ return this.getBrightness() < 128;
486
+ }, e.prototype.isLight = function() {
487
+ return !this.isDark();
488
+ }, e.prototype.getBrightness = function() {
489
+ var r = this.toRgb();
490
+ return (r.r * 299 + r.g * 587 + r.b * 114) / 1e3;
491
+ }, e.prototype.getLuminance = function() {
492
+ var r = this.toRgb(), t, a, n, o = r.r / 255, i = r.g / 255, s = r.b / 255;
493
+ return o <= 0.03928 ? t = o / 12.92 : t = Math.pow((o + 0.055) / 1.055, 2.4), i <= 0.03928 ? a = i / 12.92 : a = Math.pow((i + 0.055) / 1.055, 2.4), s <= 0.03928 ? n = s / 12.92 : n = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * t + 0.7152 * a + 0.0722 * n;
494
+ }, e.prototype.getAlpha = function() {
495
+ return this.a;
496
+ }, e.prototype.setAlpha = function(r) {
497
+ return this.a = st(r), this.roundA = Math.round(100 * this.a) / 100, this;
498
+ }, e.prototype.isMonochrome = function() {
499
+ var r = this.toHsl().s;
500
+ return r === 0;
501
+ }, e.prototype.toHsv = function() {
502
+ var r = Q(this.r, this.g, this.b);
503
+ return { h: r.h * 360, s: r.s, v: r.v, a: this.a };
504
+ }, e.prototype.toHsvString = function() {
505
+ var r = Q(this.r, this.g, this.b), t = Math.round(r.h * 360), a = Math.round(r.s * 100), n = Math.round(r.v * 100);
506
+ return this.a === 1 ? "hsv(".concat(t, ", ").concat(a, "%, ").concat(n, "%)") : "hsva(".concat(t, ", ").concat(a, "%, ").concat(n, "%, ").concat(this.roundA, ")");
507
+ }, e.prototype.toHsl = function() {
508
+ var r = J(this.r, this.g, this.b);
509
+ return { h: r.h * 360, s: r.s, l: r.l, a: this.a };
510
+ }, e.prototype.toHslString = function() {
511
+ var r = J(this.r, this.g, this.b), t = Math.round(r.h * 360), a = Math.round(r.s * 100), n = Math.round(r.l * 100);
512
+ return this.a === 1 ? "hsl(".concat(t, ", ").concat(a, "%, ").concat(n, "%)") : "hsla(".concat(t, ", ").concat(a, "%, ").concat(n, "%, ").concat(this.roundA, ")");
513
+ }, e.prototype.toHex = function(r) {
514
+ return r === void 0 && (r = !1), tt(this.r, this.g, this.b, r);
515
+ }, e.prototype.toHexString = function(r) {
516
+ return r === void 0 && (r = !1), "#" + this.toHex(r);
517
+ }, e.prototype.toHex8 = function(r) {
518
+ return r === void 0 && (r = !1), Pt(this.r, this.g, this.b, this.a, r);
519
+ }, e.prototype.toHex8String = function(r) {
520
+ return r === void 0 && (r = !1), "#" + this.toHex8(r);
521
+ }, e.prototype.toHexShortString = function(r) {
522
+ return r === void 0 && (r = !1), this.a === 1 ? this.toHexString(r) : this.toHex8String(r);
523
+ }, e.prototype.toRgb = function() {
524
+ return {
525
+ r: Math.round(this.r),
526
+ g: Math.round(this.g),
527
+ b: Math.round(this.b),
528
+ a: this.a
529
+ };
530
+ }, e.prototype.toRgbString = function() {
531
+ var r = Math.round(this.r), t = Math.round(this.g), a = Math.round(this.b);
532
+ return this.a === 1 ? "rgb(".concat(r, ", ").concat(t, ", ").concat(a, ")") : "rgba(".concat(r, ", ").concat(t, ", ").concat(a, ", ").concat(this.roundA, ")");
533
+ }, e.prototype.toPercentageRgb = function() {
534
+ var r = function(t) {
535
+ return "".concat(Math.round(c(t, 255) * 100), "%");
536
+ };
537
+ return {
538
+ r: r(this.r),
539
+ g: r(this.g),
540
+ b: r(this.b),
541
+ a: this.a
542
+ };
543
+ }, e.prototype.toPercentageRgbString = function() {
544
+ var r = function(t) {
545
+ return Math.round(c(t, 255) * 100);
546
+ };
547
+ return this.a === 1 ? "rgb(".concat(r(this.r), "%, ").concat(r(this.g), "%, ").concat(r(this.b), "%)") : "rgba(".concat(r(this.r), "%, ").concat(r(this.g), "%, ").concat(r(this.b), "%, ").concat(this.roundA, ")");
548
+ }, e.prototype.toName = function() {
549
+ if (this.a === 0)
550
+ return "transparent";
551
+ if (this.a < 1)
552
+ return !1;
553
+ for (var r = "#" + tt(this.r, this.g, this.b, !1), t = 0, a = Object.entries(D); t < a.length; t++) {
554
+ var n = a[t], o = n[0], i = n[1];
555
+ if (r === i)
556
+ return o;
557
+ }
558
+ return !1;
559
+ }, e.prototype.toString = function(r) {
560
+ var t = !!r;
561
+ r = r ?? this.format;
562
+ var a = !1, n = this.a < 1 && this.a >= 0, o = !t && n && (r.startsWith("hex") || r === "name");
563
+ return o ? r === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (r === "rgb" && (a = this.toRgbString()), r === "prgb" && (a = this.toPercentageRgbString()), (r === "hex" || r === "hex6") && (a = this.toHexString()), r === "hex3" && (a = this.toHexString(!0)), r === "hex4" && (a = this.toHex8String(!0)), r === "hex8" && (a = this.toHex8String()), r === "name" && (a = this.toName()), r === "hsl" && (a = this.toHslString()), r === "hsv" && (a = this.toHsvString()), a || this.toHexString());
564
+ }, e.prototype.toNumber = function() {
565
+ return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
566
+ }, e.prototype.clone = function() {
567
+ return new e(this.toString());
568
+ }, e.prototype.lighten = function(r) {
569
+ r === void 0 && (r = 10);
570
+ var t = this.toHsl();
571
+ return t.l += r / 100, t.l = A(t.l), new e(t);
572
+ }, e.prototype.brighten = function(r) {
573
+ r === void 0 && (r = 10);
574
+ var t = this.toRgb();
575
+ return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(r / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(r / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(r / 100)))), new e(t);
576
+ }, e.prototype.darken = function(r) {
577
+ r === void 0 && (r = 10);
578
+ var t = this.toHsl();
579
+ return t.l -= r / 100, t.l = A(t.l), new e(t);
580
+ }, e.prototype.tint = function(r) {
581
+ return r === void 0 && (r = 10), this.mix("white", r);
582
+ }, e.prototype.shade = function(r) {
583
+ return r === void 0 && (r = 10), this.mix("black", r);
584
+ }, e.prototype.desaturate = function(r) {
585
+ r === void 0 && (r = 10);
586
+ var t = this.toHsl();
587
+ return t.s -= r / 100, t.s = A(t.s), new e(t);
588
+ }, e.prototype.saturate = function(r) {
589
+ r === void 0 && (r = 10);
590
+ var t = this.toHsl();
591
+ return t.s += r / 100, t.s = A(t.s), new e(t);
592
+ }, e.prototype.greyscale = function() {
593
+ return this.desaturate(100);
594
+ }, e.prototype.spin = function(r) {
595
+ var t = this.toHsl(), a = (t.h + r) % 360;
596
+ return t.h = a < 0 ? 360 + a : a, new e(t);
597
+ }, e.prototype.mix = function(r, t) {
598
+ t === void 0 && (t = 50);
599
+ var a = this.toRgb(), n = new e(r).toRgb(), o = t / 100, i = {
600
+ r: (n.r - a.r) * o + a.r,
601
+ g: (n.g - a.g) * o + a.g,
602
+ b: (n.b - a.b) * o + a.b,
603
+ a: (n.a - a.a) * o + a.a
604
+ };
605
+ return new e(i);
606
+ }, e.prototype.analogous = function(r, t) {
607
+ r === void 0 && (r = 6), t === void 0 && (t = 30);
608
+ var a = this.toHsl(), n = 360 / t, o = [this];
609
+ for (a.h = (a.h - (n * r >> 1) + 720) % 360; --r; )
610
+ a.h = (a.h + n) % 360, o.push(new e(a));
611
+ return o;
612
+ }, e.prototype.complement = function() {
613
+ var r = this.toHsl();
614
+ return r.h = (r.h + 180) % 360, new e(r);
615
+ }, e.prototype.monochromatic = function(r) {
616
+ r === void 0 && (r = 6);
617
+ for (var t = this.toHsv(), a = t.h, n = t.s, o = t.v, i = [], s = 1 / r; r--; )
618
+ i.push(new e({ h: a, s: n, v: o })), o = (o + s) % 1;
619
+ return i;
620
+ }, e.prototype.splitcomplement = function() {
621
+ var r = this.toHsl(), t = r.h;
622
+ return [
623
+ this,
624
+ new e({ h: (t + 72) % 360, s: r.s, l: r.l }),
625
+ new e({ h: (t + 216) % 360, s: r.s, l: r.l })
626
+ ];
627
+ }, e.prototype.onBackground = function(r) {
628
+ var t = this.toRgb(), a = new e(r).toRgb(), n = t.a + a.a * (1 - t.a);
629
+ return new e({
630
+ r: (t.r * t.a + a.r * a.a * (1 - t.a)) / n,
631
+ g: (t.g * t.a + a.g * a.a * (1 - t.a)) / n,
632
+ b: (t.b * t.a + a.b * a.a * (1 - t.a)) / n,
633
+ a: n
634
+ });
635
+ }, e.prototype.triad = function() {
636
+ return this.polyad(3);
637
+ }, e.prototype.tetrad = function() {
638
+ return this.polyad(4);
639
+ }, e.prototype.polyad = function(r) {
640
+ for (var t = this.toHsl(), a = t.h, n = [this], o = 360 / r, i = 1; i < r; i++)
641
+ n.push(new e({ h: (a + i * o) % 360, s: t.s, l: t.l }));
642
+ return n;
643
+ }, e.prototype.equals = function(r) {
644
+ return this.toRgbString() === new e(r).toRgbString();
645
+ }, e;
646
+ })()
647
+ );
648
+ function S(e, r = 20) {
649
+ return e.mix("#141414", r).toString();
650
+ }
651
+ function Ut(e) {
652
+ const r = rt(), t = O("button");
653
+ return b(() => {
654
+ let a = {}, n = e.color;
655
+ if (n) {
656
+ const o = n.match(/var\((.*?)\)/);
657
+ o && (n = window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1]));
658
+ const i = new Ot(n), s = e.dark ? i.tint(20).toString() : S(i, 20);
659
+ if (e.plain)
660
+ a = t.cssVarBlock({
661
+ "bg-color": e.dark ? S(i, 90) : i.tint(90).toString(),
662
+ "text-color": n,
663
+ "border-color": e.dark ? S(i, 50) : i.tint(50).toString(),
664
+ "hover-text-color": `var(${t.cssVarName("color-white")})`,
665
+ "hover-bg-color": n,
666
+ "hover-border-color": n,
667
+ "active-bg-color": s,
668
+ "active-text-color": `var(${t.cssVarName("color-white")})`,
669
+ "active-border-color": s
670
+ }), r.value && (a[t.cssVarBlockName("disabled-bg-color")] = e.dark ? S(i, 90) : i.tint(90).toString(), a[t.cssVarBlockName("disabled-text-color")] = e.dark ? S(i, 50) : i.tint(50).toString(), a[t.cssVarBlockName("disabled-border-color")] = e.dark ? S(i, 80) : i.tint(80).toString());
671
+ else {
672
+ const f = e.dark ? S(i, 30) : i.tint(30).toString(), m = i.isDark() ? `var(${t.cssVarName("color-white")})` : `var(${t.cssVarName("color-black")})`;
673
+ if (a = t.cssVarBlock({
674
+ "bg-color": n,
675
+ "text-color": m,
676
+ "border-color": n,
677
+ "hover-bg-color": f,
678
+ "hover-text-color": m,
679
+ "hover-border-color": f,
680
+ "active-bg-color": s,
681
+ "active-border-color": s
682
+ }), r.value) {
683
+ const y = e.dark ? S(i, 50) : i.tint(50).toString();
684
+ a[t.cssVarBlockName("disabled-bg-color")] = y, a[t.cssVarBlockName("disabled-text-color")] = e.dark ? "rgba(255, 255, 255, 0.5)" : `var(${t.cssVarName("color-white")})`, a[t.cssVarBlockName("disabled-border-color")] = y;
685
+ }
686
+ }
687
+ }
688
+ return a;
689
+ });
690
+ }
691
+ const qt = U({
692
+ name: "ElButton",
693
+ __name: "button",
694
+ props: j,
695
+ emits: Ft,
696
+ setup(e, { expose: r, emit: t }) {
697
+ const a = e, n = t, o = Ut(a), i = O("button"), {
698
+ _ref: s,
699
+ _size: f,
700
+ _type: m,
701
+ _disabled: y,
702
+ _props: _,
703
+ _plain: I,
704
+ _round: E,
705
+ _text: V,
706
+ shouldAddSpace: B,
707
+ handleClick: q
708
+ } = Rt(a, n), u = b(() => [
709
+ i.b(),
710
+ i.m(m.value),
711
+ i.m(f.value),
712
+ i.is("disabled", y.value),
713
+ i.is("loading", a.loading),
714
+ i.is("plain", I.value),
715
+ i.is("round", E.value),
716
+ i.is("circle", a.circle),
717
+ i.is("text", V.value),
718
+ i.is("link", a.link),
719
+ i.is("has-bg", a.bg)
720
+ ]);
721
+ return r({
722
+ ref: s,
723
+ size: f,
724
+ type: m,
725
+ disabled: y,
726
+ shouldAddSpace: B
727
+ }), (l, h) => (x(), H(C(l.tag), St({
728
+ ref_key: "_ref",
729
+ ref: s
730
+ }, p(_), {
731
+ class: u.value,
732
+ style: p(o),
733
+ onClick: p(q)
734
+ }), {
735
+ default: T(() => [
736
+ l.loading ? (x(), F(
737
+ wt,
738
+ { key: 0 },
739
+ [
740
+ l.$slots.loading ? N(l.$slots, "loading", { key: 0 }) : (x(), H(p(K), {
741
+ key: 1,
742
+ class: W(p(i).is("loading"))
743
+ }, {
744
+ default: T(() => [
745
+ (x(), H(C(l.loadingIcon)))
746
+ ]),
747
+ _: 1
748
+ }, 8, ["class"]))
749
+ ],
750
+ 64
751
+ )) : l.icon || l.$slots.icon ? (x(), H(p(K), { key: 1 }, {
752
+ default: T(() => [
753
+ l.icon ? (x(), H(C(l.icon), { key: 0 })) : N(l.$slots, "icon", { key: 1 })
754
+ ]),
755
+ _: 3
756
+ })) : X("v-if", !0),
757
+ l.$slots.default ? (x(), F(
758
+ "span",
759
+ {
760
+ key: 2,
761
+ class: W({ [p(i).em("text", "expand")]: p(B) })
762
+ },
763
+ [
764
+ N(l.$slots, "default")
765
+ ],
766
+ 2
767
+ )) : X("v-if", !0)
768
+ ]),
769
+ _: 3
770
+ }, 16, ["class", "style", "onClick"]));
771
+ }
772
+ });
773
+ var Zt = /* @__PURE__ */ nt(qt, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button.vue"]]);
774
+ const Kt = {
775
+ size: j.size,
776
+ type: j.type,
777
+ direction: {
778
+ type: at(String),
779
+ values: ["horizontal", "vertical"],
780
+ default: "horizontal"
781
+ }
782
+ }, Xt = U({
783
+ name: "ElButtonGroup",
784
+ __name: "button-group",
785
+ props: Kt,
786
+ setup(e) {
787
+ const r = e;
788
+ Mt(
789
+ it,
790
+ _t({
791
+ size: Y(r, "size"),
792
+ type: Y(r, "type")
793
+ })
794
+ );
795
+ const t = O("button");
796
+ return (a, n) => (x(), F(
797
+ "div",
798
+ {
799
+ class: W([p(t).b("group"), p(t).bm("group", r.direction)])
800
+ },
801
+ [
802
+ N(a.$slots, "default")
803
+ ],
804
+ 2
805
+ ));
806
+ }
807
+ });
808
+ var lt = /* @__PURE__ */ nt(Xt, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button-group.vue"]]);
809
+ const Yt = pt(Zt, {
810
+ ButtonGroup: lt
811
+ });
812
+ mt(lt);
813
+ const Jt = "/vite.svg", Qt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20role='img'%20class='iconify%20iconify--logos'%20width='37.07'%20height='36'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%20256%20198'%3e%3cpath%20fill='%2341B883'%20d='M204.8%200H256L128%20220.8L0%200h97.92L128%2051.2L157.44%200h47.36Z'%3e%3c/path%3e%3cpath%20fill='%2341B883'%20d='m0%200l128%20220.8L256%200h-51.2L128%20132.48L50.56%200H0Z'%3e%3c/path%3e%3cpath%20fill='%2335495E'%20d='M50.56%200L128%20133.12L204.8%200h-47.36L128%2051.2L97.92%200H50.56Z'%3e%3c/path%3e%3c/svg%3e", te = { class: "text-center" }, ee = { class: "card" }, re = /* @__PURE__ */ U({
814
+ __name: "HelloWorld",
815
+ props: {
816
+ msg: {}
817
+ },
818
+ setup(e) {
819
+ const r = ot(0);
820
+ return (t, a) => {
821
+ const n = Yt;
822
+ return x(), F("div", te, [
823
+ Ht(n, {
824
+ onClick: a[0] || (a[0] = (o) => p(Bt)())
825
+ }, {
826
+ default: T(() => [...a[2] || (a[2] = [
827
+ $("切换主题", -1)
828
+ ])]),
829
+ _: 1
830
+ }),
831
+ a[4] || (a[4] = g("div", null, [
832
+ g("a", {
833
+ href: "https://vite.dev",
834
+ target: "_blank"
835
+ }, [
836
+ g("img", {
837
+ src: Jt,
838
+ class: "logo",
839
+ alt: "Vite logo"
840
+ })
841
+ ]),
842
+ g("a", {
843
+ href: "https://vuejs.org/",
844
+ target: "_blank"
845
+ }, [
846
+ g("img", {
847
+ src: Qt,
848
+ class: "logo vue",
849
+ alt: "Vue logo"
850
+ })
851
+ ])
852
+ ], -1)),
853
+ g("h1", null, P(t.$t("hello")), 1),
854
+ g("h1", null, P(e.msg), 1),
855
+ g("div", ee, [
856
+ g("button", {
857
+ type: "button",
858
+ onClick: a[1] || (a[1] = (o) => r.value++)
859
+ }, "count is " + P(r.value), 1),
860
+ a[3] || (a[3] = g("p", null, [
861
+ $(" Edit "),
862
+ g("code", null, "components/HelloWorld.vue"),
863
+ $(" to test HMR ")
864
+ ], -1))
865
+ ])
866
+ ]);
867
+ };
868
+ }
869
+ }), se = /* @__PURE__ */ At(re, [["__scopeId", "data-v-b67d1597"]]);
870
+ export {
871
+ se as default
872
+ };