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 CHANGED
@@ -1,250 +1,250 @@
1
- import { getCurrentInstance as Z, inject as M, ref as I, computed as p, unref as d, warn as Nt, defineComponent as C, createElementBlock as P, openBlock as _, mergeProps as gt, renderSlot as T, createElementVNode as Ct, watch as Et, useSlots as Ot, Text as Ht, createBlock as H, resolveDynamicComponent as G, withCtx as j, createCommentVNode as tt, Fragment as Tt, normalizeClass as U, provide as It, reactive as Pt, toRef as et, useAttrs as Rt, onMounted as Vt, createTextVNode as jt, toDisplayString as zt } from "vue";
2
- import { ElMessage as nt, ElMessageBox as rt } from "element-plus";
3
- const Ft = /* @__PURE__ */ Symbol(), K = "el", Gt = "is-", E = (t, e, n, r, a) => {
4
- let o = `${t}-${e}`;
5
- return n && (o += `-${n}`), r && (o += `__${r}`), a && (o += `--${a}`), o;
6
- }, Kt = /* @__PURE__ */ Symbol("namespaceContextKey"), Dt = (t) => {
7
- const e = Z() ? M(Kt, I(K)) : I(K);
8
- return p(() => d(e) || K);
9
- }, z = (t, e) => {
10
- const n = Dt();
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: n,
13
- b: (l = "") => E(n.value, t, l, "", ""),
14
- e: (l) => l ? E(n.value, t, "", l, "") : "",
15
- m: (l) => l ? E(n.value, t, "", "", l) : "",
16
- be: (l, f) => l && f ? E(n.value, t, l, f, "") : "",
17
- em: (l, f) => l && f ? E(n.value, t, "", l, f) : "",
18
- bm: (l, f) => l && f ? E(n.value, t, l, "", f) : "",
19
- bem: (l, f, c) => l && f && c ? E(n.value, t, l, f, c) : "",
20
- is: (l, ...f) => {
21
- const c = f.length >= 1 ? f[0] : !0;
22
- return l && c ? `${Gt}${l}` : "";
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 f = {};
25
+ const d = {};
26
26
  for (const c in l)
27
- l[c] && (f[`--${n.value}-${c}`] = l[c]);
28
- return f;
27
+ l[c] && (d[`--${r.value}-${c}`] = l[c]);
28
+ return d;
29
29
  },
30
- cssVarName: (l) => `--${n.value}-${l}`,
30
+ cssVarName: (l) => `--${r.value}-${l}`,
31
31
  cssVarBlock: (l) => {
32
- const f = {};
32
+ const d = {};
33
33
  for (const c in l)
34
- l[c] && (f[`--${n.value}-${t}-${c}`] = l[c]);
35
- return f;
34
+ l[c] && (d[`--${r.value}-${t}-${c}`] = l[c]);
35
+ return d;
36
36
  },
37
- cssVarBlockName: (l) => `--${n.value}-${t}-${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 Lt = () => {
43
- }, qt = Object.prototype.hasOwnProperty, at = (t, e) => qt.call(t, e), Y = (t) => typeof t == "string", pt = (t) => t !== null && typeof t == "object";
44
- function Ut(t) {
45
- for (var e = -1, n = t == null ? 0 : t.length, r = {}; ++e < n; ) {
46
- var a = t[e];
47
- r[a[0]] = a[1];
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 r;
49
+ return n;
50
50
  }
51
- const Wt = (t) => typeof t == "number", Jt = (t) => Y(t) ? !Number.isNaN(Number(t)) : !1;
52
- class Zt extends Error {
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 n = Y(t) ? new Zt(`[${t}] ${e}`) : t;
59
+ const r = Y(t) ? new Xt(`[${t}] ${e}`) : t;
60
60
  }
61
61
  }
62
- const vt = "__epPropKey", F = (t) => t, Yt = (t) => pt(t) && !!t[vt], mt = (t, e) => {
63
- if (!pt(t) || Yt(t))
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: n, required: r, default: a, type: o, validator: i } = t, u = {
66
- type: o,
67
- required: !!r,
68
- validator: n || i ? (h) => {
69
- let g = !1, b = [];
70
- if (n && (b = Array.from(n), at(t, "default") && b.push(a), g || (g = b.includes(h))), i && (g || (g = i(h))), !g && b.length > 0) {
71
- const B = [...new Set(b)].map(($) => JSON.stringify($)).join(", ");
72
- Nt(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${B}], got value ${JSON.stringify(h)}.`);
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
- [vt]: !0
76
+ [mt]: !0
77
77
  };
78
- return at(t, "default") && (u.default = a), u;
79
- }, yt = (t) => Ut(Object.entries(t).map(([e, n]) => [
78
+ return ot(t, "default") && (u.default = o), u;
79
+ }, _t = (t) => Zt(Object.entries(t).map(([e, r]) => [
80
80
  e,
81
- mt(n, e)
82
- ])), Qt = ["", "default", "small", "large"], Xt = mt({
81
+ yt(r, e)
82
+ ])), ee = ["", "default", "small", "large"], re = yt({
83
83
  type: String,
84
- values: Qt,
84
+ values: ee,
85
85
  required: !1
86
- }), te = /* @__PURE__ */ Symbol("size"), ee = () => {
87
- const t = M(te, {});
88
- return p(() => d(t.size) || "");
89
- }, ot = I();
90
- function ne(t, e = void 0) {
91
- const n = Z() ? M(Ft, ot) : ot;
92
- return p(() => {
93
- var r, a;
94
- return (a = (r = n.value) == null ? void 0 : r[t]) != null ? a : e;
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 n = t.__vccOpts || t;
99
- for (const [r, a] of e)
100
- n[r] = a;
101
- return n;
98
+ const r = t.__vccOpts || t;
99
+ for (const [n, o] of e)
100
+ r[n] = o;
101
+ return r;
102
102
  };
103
- const re = "utils/dom/style";
104
- function ae(t, e = "px") {
103
+ const ie = "utils/dom/style";
104
+ function se(t, e = "px") {
105
105
  if (!t && t !== 0)
106
106
  return "";
107
- if (Wt(t) || Jt(t))
107
+ if (Yt(t) || Qt(t))
108
108
  return `${t}${e}`;
109
109
  if (Y(t))
110
110
  return t;
111
- bt(re, "binding value must be a string or number");
111
+ bt(ie, "binding value must be a string or number");
112
112
  }
113
113
  const xt = (t, e) => {
114
- if (t.install = (n) => {
115
- for (const r of [t, ...Object.values(e ?? {})])
116
- n.component(r.name, r);
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 [n, r] of Object.entries(e))
119
- t[n] = r;
118
+ for (const [r, n] of Object.entries(e))
119
+ t[r] = n;
120
120
  return t;
121
- }, oe = (t) => (t.install = Lt, t), ie = yt({
121
+ }, ce = (t) => (t.install = Wt, t), le = _t({
122
122
  size: {
123
- type: F([Number, String])
123
+ type: G([Number, String])
124
124
  },
125
125
  color: {
126
126
  type: String
127
127
  }
128
- }), se = C({
128
+ }), ue = A({
129
129
  name: "ElIcon",
130
130
  inheritAttrs: !1
131
- }), ce = /* @__PURE__ */ C({
132
- ...se,
133
- props: ie,
131
+ }), fe = /* @__PURE__ */ A({
132
+ ...ue,
133
+ props: le,
134
134
  setup(t) {
135
- const e = t, n = z("icon"), r = p(() => {
136
- const { size: a, color: o } = e, i = ae(a);
137
- return !i && !o ? {} : {
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": o
139
+ "--color": a
140
140
  };
141
141
  });
142
- return (a, o) => (_(), P("i", gt({
143
- class: d(n).b(),
144
- style: d(r)
145
- }, a.$attrs), [
146
- T(a.$slots, "default")
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 le = /* @__PURE__ */ Q(ce, [["__file", "icon.vue"]]);
151
- const it = xt(le);
152
- var ue = /* @__PURE__ */ C({
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, n) => (_(), P("svg", {
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
- Ct("path", {
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
- }), fe = ue;
167
- const st = F([
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"), de = () => {
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
- }, _t = (t) => {
177
+ }, wt = (t) => {
178
178
  const e = Z();
179
- return p(() => {
180
- var n, r;
181
- return (r = (n = e?.proxy) == null ? void 0 : n.$props) == null ? void 0 : r[t];
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
- }, he = (t, e = {}) => {
184
- const n = I(void 0), r = e.prop ? n : _t("size"), a = e.global ? n : ee(), o = e.form ? { size: void 0 } : M(X, void 0), i = e.formItem ? { size: void 0 } : M(St, void 0);
185
- return p(() => r.value || d(t) || i?.size || o?.size || a.value || "");
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 = _t("disabled"), n = M(X, void 0);
188
- return p(() => {
189
- var r, a, o;
190
- return (o = (a = (r = e.value) != null ? r : d(t)) != null ? a : n?.disabled) != null ? o : !1;
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
- }, wt = /* @__PURE__ */ Symbol("buttonGroupContextKey"), ge = ({ from: t, replacement: e, scope: n, version: r, ref: a, type: o = "API" }, i) => {
193
- Et(() => d(i), (s) => {
194
- s && bt(n, `[${o}] ${t} is about to be deprecated in version ${r}, please use ${e} instead.
195
- For more detail, please visit: ${a}
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
- }, pe = (t, e) => {
201
- ge({
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
- }, p(() => t.type === "text"));
208
- const n = M(wt, void 0), r = ne("button"), { form: a } = de(), o = he(p(() => n?.size)), i = kt(), s = I(), u = Ot(), h = p(() => {
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 || n?.type || ((c = r.value) == null ? void 0 : c.type) || "";
211
- }), g = p(() => {
212
- var c, m, y;
213
- return (y = (m = t.autoInsertSpace) != null ? m : (c = r.value) == null ? void 0 : c.autoInsertSpace) != null ? y : !1;
214
- }), b = p(() => {
215
- var c, m, y;
216
- return (y = (m = t.plain) != null ? m : (c = r.value) == null ? void 0 : c.plain) != null ? y : !1;
217
- }), B = p(() => {
218
- var c, m, y;
219
- return (y = (m = t.round) != null ? m : (c = r.value) == null ? void 0 : c.round) != null ? y : !1;
220
- }), $ = p(() => {
221
- var c, m, y;
222
- return (y = (m = t.text) != null ? m : (c = r.value) == null ? void 0 : c.text) != null ? y : !1;
223
- }), k = p(() => t.tag === "button" ? {
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 = p(() => {
228
+ } : {}), l = h(() => {
229
229
  var c;
230
- const m = (c = u.default) == null ? void 0 : c.call(u);
231
- if (g.value && m?.length === 1) {
232
- const y = m[0];
233
- if (y?.type === Ht) {
234
- const At = y.children;
235
- return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(At.trim());
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: o,
243
- _type: h,
242
+ _size: a,
243
+ _type: f,
244
244
  _ref: s,
245
- _props: k,
246
- _plain: b,
247
- _round: B,
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" && a?.resetFields(), e("click", c);
255
+ t.nativeType === "reset" && o?.resetFields(), e("click", c);
256
256
  }
257
257
  };
258
- }, be = [
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
- ], ve = ["button", "submit", "reset"], W = yt({
268
- size: Xt,
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: be,
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: ve,
283
+ values: _e,
284
284
  default: "button"
285
285
  },
286
286
  loading: Boolean,
287
287
  loadingIcon: {
288
288
  type: st,
289
- default: () => fe
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: F([String, Object]),
314
+ type: G([String, Object]),
315
315
  default: "button"
316
316
  }
317
- }), me = {
317
+ }), xe = {
318
318
  click: (t) => t instanceof MouseEvent
319
319
  };
320
320
  function v(t, e) {
321
- ye(t) && (t = "100%");
322
- var n = xe(t);
323
- return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))), n && (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);
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 R(t) {
325
+ function z(t) {
326
326
  return Math.min(1, Math.max(0, t));
327
327
  }
328
- function ye(t) {
328
+ function Se(t) {
329
329
  return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1;
330
330
  }
331
- function xe(t) {
331
+ function we(t) {
332
332
  return typeof t == "string" && t.indexOf("%") !== -1;
333
333
  }
334
- function Mt(t) {
334
+ function At(t) {
335
335
  return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
336
336
  }
337
- function V(t) {
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 Se(t, e, n) {
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(n, 255) * 255
347
+ b: v(r, 255) * 255
348
348
  };
349
349
  }
350
- function ct(t, e, n) {
351
- t = v(t, 255), e = v(e, 255), n = v(n, 255);
352
- var r = Math.max(t, e, n), a = Math.min(t, e, n), o = 0, i = 0, s = (r + a) / 2;
353
- if (r === a)
354
- i = 0, o = 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 = r - a;
357
- switch (i = s > 0.5 ? u / (2 - r - a) : u / (r + a), r) {
356
+ var u = n - o;
357
+ switch (i = s > 0.5 ? u / (2 - n - o) : u / (n + o), n) {
358
358
  case t:
359
- o = (e - n) / u + (e < n ? 6 : 0);
359
+ a = (e - r) / u + (e < r ? 6 : 0);
360
360
  break;
361
361
  case e:
362
- o = (n - t) / u + 2;
362
+ a = (r - t) / u + 2;
363
363
  break;
364
- case n:
365
- o = (t - e) / u + 4;
364
+ case r:
365
+ a = (t - e) / u + 4;
366
366
  break;
367
367
  }
368
- o /= 6;
368
+ a /= 6;
369
369
  }
370
- return { h: o, s: i, l: s };
370
+ return { h: a, s: i, l: s };
371
371
  }
372
- function D(t, e, n) {
373
- return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * (6 * n) : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
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 _e(t, e, n) {
376
- var r, a, o;
377
- if (t = v(t, 360), e = v(e, 100), n = v(n, 100), e === 0)
378
- a = n, o = n, r = n;
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 = n < 0.5 ? n * (1 + e) : n + e - n * e, s = 2 * n - i;
381
- r = D(s, i, t + 1 / 3), a = D(s, i, t), o = D(s, i, t - 1 / 3);
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: r * 255, g: a * 255, b: o * 255 };
383
+ return { r: n * 255, g: o * 255, b: a * 255 };
384
384
  }
385
- function lt(t, e, n) {
386
- t = v(t, 255), e = v(e, 255), n = v(n, 255);
387
- var r = Math.max(t, e, n), a = Math.min(t, e, n), o = 0, i = r, s = r - a, u = r === 0 ? 0 : s / r;
388
- if (r === a)
389
- o = 0;
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 (r) {
391
+ switch (n) {
392
392
  case t:
393
- o = (e - n) / s + (e < n ? 6 : 0);
393
+ a = (e - r) / s + (e < r ? 6 : 0);
394
394
  break;
395
395
  case e:
396
- o = (n - t) / s + 2;
396
+ a = (r - t) / s + 2;
397
397
  break;
398
- case n:
399
- o = (t - e) / s + 4;
398
+ case r:
399
+ a = (t - e) / s + 4;
400
400
  break;
401
401
  }
402
- o /= 6;
402
+ a /= 6;
403
403
  }
404
- return { h: o, s: u, v: i };
404
+ return { h: a, s: u, v: i };
405
405
  }
406
- function ke(t, e, n) {
407
- t = v(t, 360) * 6, e = v(e, 100), n = v(n, 100);
408
- var r = Math.floor(t), a = t - r, o = n * (1 - e), i = n * (1 - a * e), s = n * (1 - (1 - a) * e), u = r % 6, h = [n, i, o, o, s, n][u], g = [s, n, n, i, o, o][u], b = [o, o, s, n, n, i][u];
409
- return { r: h * 255, g: g * 255, b: b * 255 };
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, n, r) {
412
- var a = [
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(n).toString(16))
415
+ O(Math.round(r).toString(16))
416
416
  ];
417
- 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("");
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 we(t, e, n, r, a) {
420
- var o = [
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(n).toString(16)),
424
- O(Me(r))
423
+ O(Math.round(r).toString(16)),
424
+ O(Be(n))
425
425
  ];
426
- 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("");
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 Me(t) {
428
+ function Be(t) {
429
429
  return Math.round(parseFloat(t) * 255).toString(16);
430
430
  }
431
431
  function ft(t) {
432
- return x(t) / 255;
432
+ return _(t) / 255;
433
433
  }
434
- function x(t) {
434
+ function _(t) {
435
435
  return parseInt(t, 16);
436
436
  }
437
- function Be(t) {
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 $e(t) {
595
- var e = { r: 0, g: 0, b: 0 }, n = 1, r = null, a = null, o = null, i = !1, s = !1;
596
- return typeof t == "string" && (t = Ce(t)), typeof t == "object" && (w(t.r) && w(t.g) && w(t.b) ? (e = Se(t.r, t.g, t.b), i = !0, s = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : w(t.h) && w(t.s) && w(t.v) ? (r = V(t.s), a = V(t.v), e = ke(t.h, r, a), i = !0, s = "hsv") : w(t.h) && w(t.s) && w(t.l) && (r = V(t.s), o = V(t.l), e = _e(t.h, r, o), i = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (n = t.a)), n = Mt(n), {
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: n
602
+ a: r
603
603
  };
604
604
  }
605
- var Ae = "[-\\+]?\\d+%?", Ne = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(Ne, ")|(?:").concat(Ae, ")"), L = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), q = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), S = {
606
- CSS_UNIT: new RegExp(N),
607
- rgb: new RegExp("rgb" + L),
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" + L),
609
+ hsl: new RegExp("hsl" + U),
610
610
  hsla: new RegExp("hsla" + q),
611
- hsv: new RegExp("hsv" + L),
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 Ce(t) {
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 n = S.rgb.exec(t);
627
- return n ? { r: n[1], g: n[2], b: n[3] } : (n = S.rgba.exec(t), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = S.hsl.exec(t), n ? { h: n[1], s: n[2], l: n[3] } : (n = S.hsla.exec(t), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = S.hsv.exec(t), n ? { h: n[1], s: n[2], v: n[3] } : (n = S.hsva.exec(t), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = S.hex8.exec(t), n ? {
628
- r: x(n[1]),
629
- g: x(n[2]),
630
- b: x(n[3]),
631
- a: ft(n[4]),
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
- } : (n = S.hex6.exec(t), n ? {
634
- r: x(n[1]),
635
- g: x(n[2]),
636
- b: x(n[3]),
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
- } : (n = S.hex4.exec(t), n ? {
639
- r: x(n[1] + n[1]),
640
- g: x(n[2] + n[2]),
641
- b: x(n[3] + n[3]),
642
- a: ft(n[4] + n[4]),
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
- } : (n = S.hex3.exec(t), n ? {
645
- r: x(n[1] + n[1]),
646
- g: x(n[2] + n[2]),
647
- b: x(n[3] + n[3]),
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 w(t) {
652
- return !!S.CSS_UNIT.exec(String(t));
651
+ function k(t) {
652
+ return !!w.CSS_UNIT.exec(String(t));
653
653
  }
654
- var Ee = (
654
+ var Ie = (
655
655
  /** @class */
656
656
  (function() {
657
- function t(e, n) {
658
- e === void 0 && (e = ""), n === void 0 && (n = {});
659
- var r;
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 = Be(e)), this.originalInput = e;
663
- var a = $e(e);
664
- this.originalInput = e, 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 = n.format) !== null && r !== void 0 ? r : a.format, this.gradientType = n.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;
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, r, a, o = e.r / 255, i = e.g / 255, s = e.b / 255;
675
- return o <= 0.03928 ? n = o / 12.92 : n = 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), s <= 0.03928 ? a = s / 12.92 : a = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * r + 0.0722 * a;
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 = Mt(e), this.roundA = Math.round(100 * this.a) / 100, this;
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), n = Math.round(e.h * 360), r = Math.round(e.s * 100), a = Math.round(e.v * 100);
688
- return this.a === 1 ? "hsv(".concat(n, ", ").concat(r, "%, ").concat(a, "%)") : "hsva(".concat(n, ", ").concat(r, "%, ").concat(a, "%, ").concat(this.roundA, ")");
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), n = Math.round(e.h * 360), r = Math.round(e.s * 100), a = Math.round(e.l * 100);
694
- return this.a === 1 ? "hsl(".concat(n, ", ").concat(r, "%, ").concat(a, "%)") : "hsla(".concat(n, ", ").concat(r, "%, ").concat(a, "%, ").concat(this.roundA, ")");
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), we(this.r, this.g, this.b, this.a, e);
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), n = Math.round(this.g), r = Math.round(this.b);
714
- return this.a === 1 ? "rgb(".concat(e, ", ").concat(n, ", ").concat(r, ")") : "rgba(".concat(e, ", ").concat(n, ", ").concat(r, ", ").concat(this.roundA, ")");
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(n) {
717
- return "".concat(Math.round(v(n, 255) * 100), "%");
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(n) {
727
- return Math.round(v(n, 255) * 100);
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), n = 0, r = Object.entries(J); n < r.length; n++) {
736
- var a = r[n], o = a[0], i = a[1];
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 o;
738
+ return a;
739
739
  }
740
740
  return !1;
741
741
  }, t.prototype.toString = function(e) {
742
- var n = !!e;
742
+ var r = !!e;
743
743
  e = e ?? this.format;
744
- var r = !1, a = this.a < 1 && this.a >= 0, o = !n && a && (e.startsWith("hex") || e === "name");
745
- return o ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (r = this.toRgbString()), e === "prgb" && (r = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (r = this.toHexString()), e === "hex3" && (r = this.toHexString(!0)), e === "hex4" && (r = this.toHex8String(!0)), e === "hex8" && (r = this.toHex8String()), e === "name" && (r = this.toName()), e === "hsl" && (r = this.toHslString()), e === "hsv" && (r = this.toHsvString()), r || this.toHexString());
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 n = this.toHsl();
753
- return n.l += e / 100, n.l = R(n.l), new t(n);
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 n = this.toRgb();
757
- return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(e / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(e / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(e / 100)))), new t(n);
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 n = this.toHsl();
761
- return n.l -= e / 100, n.l = R(n.l), new t(n);
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 n = this.toHsl();
769
- return n.s -= e / 100, n.s = R(n.s), new t(n);
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 n = this.toHsl();
773
- return n.s += e / 100, n.s = R(n.s), new t(n);
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 n = this.toHsl(), r = (n.h + e) % 360;
778
- return n.h = r < 0 ? 360 + r : r, new t(n);
779
- }, t.prototype.mix = function(e, n) {
780
- n === void 0 && (n = 50);
781
- var r = this.toRgb(), a = new t(e).toRgb(), o = n / 100, i = {
782
- r: (a.r - r.r) * o + r.r,
783
- g: (a.g - r.g) * o + r.g,
784
- b: (a.b - r.b) * o + r.b,
785
- a: (a.a - r.a) * o + r.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, n) {
789
- e === void 0 && (e = 6), n === void 0 && (n = 30);
790
- var r = this.toHsl(), a = 360 / n, o = [this];
791
- for (r.h = (r.h - (a * e >> 1) + 720) % 360; --e; )
792
- r.h = (r.h + a) % 360, o.push(new t(r));
793
- return o;
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 n = this.toHsv(), r = n.h, a = n.s, o = n.v, i = [], s = 1 / e; e--; )
800
- i.push(new t({ h: r, s: a, v: o })), o = (o + s) % 1;
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(), n = e.h;
803
+ var e = this.toHsl(), r = e.h;
804
804
  return [
805
805
  this,
806
- new t({ h: (n + 72) % 360, s: e.s, l: e.l }),
807
- new t({ h: (n + 216) % 360, s: e.s, l: e.l })
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 n = this.toRgb(), r = new t(e).toRgb(), a = n.a + r.a * (1 - n.a);
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: (n.r * n.a + r.r * r.a * (1 - n.a)) / a,
813
- g: (n.g * n.a + r.g * r.a * (1 - n.a)) / a,
814
- b: (n.b * n.a + r.b * r.a * (1 - n.a)) / a,
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 n = this.toHsl(), r = n.h, a = [this], o = 360 / e, i = 1; i < e; i++)
823
- a.push(new t({ h: (r + i * o) % 360, s: n.s, l: n.l }));
824
- return a;
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 A(t, e = 20) {
830
+ function B(t, e = 20) {
831
831
  return t.mix("#141414", e).toString();
832
832
  }
833
- function Oe(t) {
834
- const e = kt(), n = z("button");
835
- return p(() => {
836
- let r = {}, a = t.color;
837
- if (a) {
838
- const o = a.match(/var\((.*?)\)/);
839
- o && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1]));
840
- const i = new Ee(a), s = t.dark ? i.tint(20).toString() : A(i, 20);
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
- r = n.cssVarBlock({
843
- "bg-color": t.dark ? A(i, 90) : i.tint(90).toString(),
844
- "text-color": a,
845
- "border-color": t.dark ? A(i, 50) : i.tint(50).toString(),
846
- "hover-text-color": `var(${n.cssVarName("color-white")})`,
847
- "hover-bg-color": a,
848
- "hover-border-color": a,
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(${n.cssVarName("color-white")})`,
850
+ "active-text-color": `var(${r.cssVarName("color-white")})`,
851
851
  "active-border-color": s
852
- }), e.value && (r[n.cssVarBlockName("disabled-bg-color")] = t.dark ? A(i, 90) : i.tint(90).toString(), r[n.cssVarBlockName("disabled-text-color")] = t.dark ? A(i, 50) : i.tint(50).toString(), r[n.cssVarBlockName("disabled-border-color")] = t.dark ? A(i, 80) : i.tint(80).toString());
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 ? A(i, 30) : i.tint(30).toString(), h = i.isDark() ? `var(${n.cssVarName("color-white")})` : `var(${n.cssVarName("color-black")})`;
855
- if (r = n.cssVarBlock({
856
- "bg-color": a,
857
- "text-color": h,
858
- "border-color": a,
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": h,
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 ? A(i, 50) : i.tint(50).toString();
866
- r[n.cssVarBlockName("disabled-bg-color")] = g, r[n.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${n.cssVarName("color-white")})`, r[n.cssVarBlockName("disabled-border-color")] = g;
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 r;
870
+ return n;
871
871
  });
872
872
  }
873
- const He = C({
873
+ const Ve = A({
874
874
  name: "ElButton"
875
- }), Te = /* @__PURE__ */ C({
876
- ...He,
875
+ }), ze = /* @__PURE__ */ A({
876
+ ...Ve,
877
877
  props: W,
878
- emits: me,
879
- setup(t, { expose: e, emit: n }) {
880
- const r = t, a = Oe(r), o = z("button"), {
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: h,
884
+ _disabled: f,
885
885
  _props: g,
886
- _plain: b,
887
- _round: B,
886
+ _plain: m,
887
+ _round: S,
888
888
  _text: $,
889
- shouldAddSpace: k,
889
+ shouldAddSpace: E,
890
890
  handleClick: l
891
- } = pe(r, n), f = p(() => [
892
- o.b(),
893
- o.m(u.value),
894
- o.m(s.value),
895
- o.is("disabled", h.value),
896
- o.is("loading", r.loading),
897
- o.is("plain", b.value),
898
- o.is("round", B.value),
899
- o.is("circle", r.circle),
900
- o.is("text", $.value),
901
- o.is("link", r.link),
902
- o.is("has-bg", r.bg)
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: h,
909
- shouldAddSpace: k
910
- }), (c, m) => (_(), H(G(c.tag), gt({
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
- }, d(g), {
914
- class: d(f),
915
- style: d(a),
916
- onClick: d(l)
913
+ }, p(g), {
914
+ class: p(d),
915
+ style: p(o),
916
+ onClick: p(l)
917
917
  }), {
918
- default: j(() => [
919
- c.loading ? (_(), P(Tt, { key: 0 }, [
920
- c.$slots.loading ? T(c.$slots, "loading", { key: 0 }) : (_(), H(d(it), {
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: U(d(o).is("loading"))
922
+ class: j(p(a).is("loading"))
923
923
  }, {
924
- default: j(() => [
925
- (_(), H(G(c.loadingIcon)))
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 ? (_(), H(d(it), { key: 1 }, {
930
- default: j(() => [
931
- c.icon ? (_(), H(G(c.icon), { key: 0 })) : T(c.$slots, "icon", { key: 1 })
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 ? (_(), P("span", {
935
+ c.$slots.default ? (x(), I("span", {
936
936
  key: 2,
937
- class: U({ [d(o).em("text", "expand")]: d(k) })
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 Ie = /* @__PURE__ */ Q(Te, [["__file", "button.vue"]]);
947
- const Pe = {
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: F(String),
951
+ type: G(String),
952
952
  values: ["horizontal", "vertical"],
953
953
  default: "horizontal"
954
954
  }
955
- }, Re = C({
955
+ }, je = A({
956
956
  name: "ElButtonGroup"
957
- }), Ve = /* @__PURE__ */ C({
958
- ...Re,
959
- props: Pe,
957
+ }), Fe = /* @__PURE__ */ A({
958
+ ...je,
959
+ props: Re,
960
960
  setup(t) {
961
961
  const e = t;
962
- It(wt, Pt({
962
+ Vt(Mt, zt({
963
963
  size: et(e, "size"),
964
964
  type: et(e, "type")
965
965
  }));
966
- const n = z("button");
967
- return (r, a) => (_(), P("div", {
968
- class: U([d(n).b("group"), d(n).bm("group", e.direction)])
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(r.$slots, "default")
970
+ T(n.$slots, "default")
971
971
  ], 2));
972
972
  }
973
973
  });
974
- var Bt = /* @__PURE__ */ Q(Ve, [["__file", "button-group.vue"]]);
975
- const je = xt(Ie, {
976
- ButtonGroup: Bt
974
+ var $t = /* @__PURE__ */ Q(Fe, [["__file", "button-group.vue"]]);
975
+ const Ge = xt(Pe, {
976
+ ButtonGroup: $t
977
977
  });
978
- oe(Bt);
979
- const ze = {
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
- }, $t = (t, e) => {
1010
+ }, Bt = (t, e) => {
1011
1011
  if (typeof t != "object" || typeof e != "object")
1012
1012
  return e ?? t;
1013
- const n = { ...t };
1014
- return Object.keys(e).forEach((r) => {
1015
- e[r] && typeof e[r] == "object" && !Array.isArray(e[r]) ? n[r] = $t(t[r] || {}, e[r]) : n[r] = e[r] !== void 0 ? e[r] : t[r];
1016
- }), n;
1017
- }, Fe = (t) => Object.prototype.toString.call(t) === "[object Object]", dt = (t) => Array.isArray(t), ht = (t, e = 300, n = !1) => {
1018
- let r = null;
1019
- const a = function(...o) {
1020
- r && clearTimeout(r);
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 n && !r && (i = t.apply(this, o)), r = setTimeout(() => {
1023
- n || t.apply(this, o), r = null;
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 a.cancel = () => {
1027
- r && (clearTimeout(r), r = null);
1028
- }, a;
1029
- }, Ge = {
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: { enable: !0, delay: 500, immediate: !1 },
1035
+ debounce: { delay: 500, immediate: !1 },
1037
1036
  /**
1038
1037
  * 二次确认配置项
1039
- * enable:是否启用二次确认 默认禁用,亦可通过data开启二次确认
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
- }, Ke = ({ props: t, emits: e, attrs: n }) => {
1059
- const r = p(
1060
- () => $t(Ge, t.extConfig)
1061
- ), o = ht(
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: u, title: h, content: g, dataKey: b, toArray: B, appendS: $ } = r.value.confirm;
1064
- if (!["object", "number", "string"].includes(typeof u)) {
1065
- nt.warning(
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 u)) {
1066
+ if (["number", "string"].includes(typeof f)) {
1071
1067
  try {
1072
- await rt.confirm(g, h, {
1068
+ await nt.confirm(m, g, {
1073
1069
  confirmButtonText: "确定",
1074
1070
  cancelButtonText: "取消",
1075
1071
  type: "warning"
1076
- }), e("onClick", u);
1072
+ }), e("onClick", f);
1077
1073
  } catch {
1078
1074
  }
1079
1075
  return;
1080
1076
  }
1081
- if (Fe(u) && !Object.keys(u).length || dt(u) && !u.length) {
1082
- nt.warning("请至少选择一条数据");
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 rt.confirm(g, h, {
1082
+ if (await nt.confirm(m, g, {
1087
1083
  confirmButtonText: "确定",
1088
1084
  cancelButtonText: "取消",
1089
1085
  type: "warning"
1090
- }), u === null) {
1086
+ }), f === null) {
1091
1087
  e("onClick");
1092
1088
  return;
1093
1089
  }
1094
- const k = dt(u) ? u.map((l) => typeof l == "object" ? l[b] : l) : [u[b]];
1090
+ const l = dt(f) ? f.map((d) => typeof d == "object" ? d[S] : d) : [f[S]];
1095
1091
  e("onClick", {
1096
- [$ ? `${b}s` : b]: B ? k : k.join(),
1097
- data: u
1092
+ [E ? `${S}s` : S]: $ ? l : l.join(),
1093
+ data: f
1098
1094
  });
1099
1095
  } catch {
1100
1096
  }
1101
1097
  },
1102
- r.value.debounce.delay,
1103
- r.value.debounce.immediate
1098
+ n.value.debounce.delay,
1099
+ n.value.debounce.immediate
1104
1100
  ), i = ht(
1105
1101
  () => e("onClick"),
1106
- r.value.debounce.delay,
1107
- r.value.debounce.immediate
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: r, handleElButton: () => {
1110
- n.onClick || (r.value.confirm.enable || r.value.confirm.hasOwnProperty("data") ? o() : i());
1107
+ return { mergedExtConfig: n, isConfirm: s, handleElButton: () => {
1108
+ r.onClick || (s.value ? a() : i());
1111
1109
  } };
1112
- }, De = /* @__PURE__ */ C({
1110
+ }, qe = /* @__PURE__ */ A({
1113
1111
  __name: "index",
1114
- props: ze,
1112
+ props: De,
1115
1113
  emits: ["onClick"],
1116
1114
  setup(t, { emit: e }) {
1117
- const n = t, r = e, a = Rt(), { mergedExtConfig: o, handleElButton: i } = Ke({
1118
- props: n,
1119
- emits: r,
1120
- attrs: a
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 Vt(() => {
1123
- document.querySelectorAll(".el-button").forEach((s) => {
1124
- s.addEventListener(
1120
+ return Rt(() => {
1121
+ document.querySelectorAll(".el-button").forEach((u) => {
1122
+ u.addEventListener(
1125
1123
  "blur",
1126
- (u) => {
1127
- u.target.classList.add("blur");
1124
+ (f) => {
1125
+ f.target.classList.add("blur");
1128
1126
  },
1129
1127
  !0
1130
1128
  );
1131
1129
  });
1132
- }), (s, u) => {
1133
- const h = je;
1134
- return _(), H(h, {
1130
+ }), (u, f) => {
1131
+ const g = Ge;
1132
+ return x(), H(g, {
1135
1133
  class: "wyfe-ivue__use-el-button",
1136
- type: d(o).confirm.hasOwnProperty("data") ? d(o).confirm.type : s.type,
1137
- onClick: d(i)
1134
+ type: p(a) ? p(i).confirm.type : u.type,
1135
+ onClick: p(s)
1138
1136
  }, {
1139
- default: j(() => [
1140
- jt(zt(s.btnText), 1)
1137
+ default: R(() => [
1138
+ jt(Ft(u.btnText), 1)
1141
1139
  ]),
1142
1140
  _: 1
1143
1141
  }, 8, ["type", "onClick"]);
1144
1142
  };
1145
1143
  }
1146
- }), Le = (t, e) => {
1147
- const n = t.__vccOpts || t;
1148
- for (const [r, a] of e)
1149
- n[r] = a;
1150
- return n;
1151
- }, We = /* @__PURE__ */ Le(De, [["__scopeId", "data-v-5f2928f2"]]);
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
- We as UseElButton
1242
+ er as UseElButton,
1243
+ rr as UseSvgIcon
1154
1244
  };