jmash-core 0.0.84 → 0.0.86

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.
Files changed (44) hide show
  1. package/dist/{401-BOgGx9Jd.mjs → 401-DwHfhZm2.mjs} +43 -44
  2. package/dist/{404-BYxlSqoT.mjs → 404-CeKwDY4M.mjs} +1 -1
  3. package/dist/{BarChart-C22Beea1.mjs → BarChart-BOhw_pWJ.mjs} +30 -31
  4. package/dist/{FunnelChart-CcCVox9E.mjs → FunnelChart-DPisFRDu.mjs} +1 -1
  5. package/dist/{PieChart-Dksdgtfs.mjs → PieChart-Ceza7eIr.mjs} +1 -1
  6. package/dist/{PieChart.vue_vue_type_script_setup_true_lang-BAW7aMk4.mjs → PieChart.vue_vue_type_script_setup_true_lang-CjKWzA-2.mjs} +12 -14
  7. package/dist/{RadarChart-DquLnQ6V.mjs → RadarChart-Dvq6tgrV.mjs} +1 -1
  8. package/dist/{RadarChart.vue_vue_type_script_setup_true_lang-B9md22Se.mjs → RadarChart.vue_vue_type_script_setup_true_lang-DxP18bev.mjs} +13 -15
  9. package/dist/index-B2hxZbIl.mjs +367 -0
  10. package/dist/{index-BjqMDjBg.mjs → index-D5Fo3f2g.mjs} +7651 -7892
  11. package/dist/index-D6FGEmgO.mjs +20014 -0
  12. package/dist/index-DJbI5eJZ.mjs +1639 -0
  13. package/dist/index-DahMKAi2.mjs +267 -0
  14. package/dist/index.mjs +49 -48
  15. package/dist/picture-CBRsHLZl.mjs +22 -0
  16. package/dist/profile-DxHeZsWs.mjs +263 -0
  17. package/dist/{runAs-aDp4HoyI.mjs → runAs-DZDdNkz3.mjs} +1 -1
  18. package/dist/runAs.vue_vue_type_script_setup_true_lang-D6N1cGUB.mjs +2496 -0
  19. package/dist/style.css +1 -1
  20. package/dist/{types-kVtKPxE9.mjs → types-qe4hLo3U.mjs} +79 -80
  21. package/dist/{updatePwd-D54MmOmU.mjs → updatePwd-6rHSVF-g.mjs} +1 -1
  22. package/dist/{updatePwd.vue_vue_type_script_setup_true_lang-DA30m6c3.mjs → updatePwd.vue_vue_type_script_setup_true_lang-BnWzu-me.mjs} +38 -45
  23. package/dts/src/components/DictSelect/index.vue.d.ts +1 -1
  24. package/dts/src/components/JmashPagination/index.vue.d.ts +1 -1
  25. package/dts/src/components/Pagination/index.vue.d.ts +5 -5
  26. package/dts/src/components/SvgIcon/index.vue.d.ts +1 -1
  27. package/dts/src/index.d.ts +1 -0
  28. package/dts/src/views/dashboard/components/BarChart.vue.d.ts +1 -1
  29. package/dts/src/views/dashboard/components/FunnelChart.vue.d.ts +1 -1
  30. package/dts/src/views/dashboard/components/PieChart.vue.d.ts +1 -1
  31. package/dts/src/views/dashboard/components/RadarChart.vue.d.ts +1 -1
  32. package/package.json +2 -3
  33. package/dist/el-card-BW_8jVxk.mjs +0 -61
  34. package/dist/el-col-Dd32wlSH.mjs +0 -135
  35. package/dist/el-form-item-3aV6p-oZ.mjs +0 -1117
  36. package/dist/index-B07mUqAa.mjs +0 -269
  37. package/dist/index-B8sKaF6F.mjs +0 -55
  38. package/dist/index-CgRfmdyq.mjs +0 -33076
  39. package/dist/index-CmaHwUB-.mjs +0 -449
  40. package/dist/index-RUqoTfAx.mjs +0 -3462
  41. package/dist/picture-DVndT_xi.mjs +0 -587
  42. package/dist/position-RPjzcrqL.mjs +0 -23
  43. package/dist/profile-CNIhXiv-.mjs +0 -4924
  44. package/dist/runAs.vue_vue_type_script_setup_true_lang-CZdXga19.mjs +0 -645
@@ -1,3462 +0,0 @@
1
- import { b as Ce, i as Ee, u as ne, _ as ce, d as Ve, E as we, w as ot, a as at, c as dn, e as vt, f as fn, U as _t, g as ve, h as Fe, C as mn, j as Et, k as zt, l as pn, m as hn, n as vn, o as _n, p as gn, q as bn, r as Ke, s as yn, t as Tt, v as Ht, x as Wt, y as qt, z as It, A as ie, B as kn, D as Cn, F as Mn, G as $n, H as wn, I as Sn, J as Ze, K as ut, L as xn, T as En, M as tt, N as Tn, O as At, P as In, Q as An, R as Pn, S as Vn, V as Ln, W as _e, X as Nn, Y as Ne, Z as Ut, $ as Kt, a0 as jt, a1 as bt, a2 as On, a3 as Se, a4 as Je, a5 as Rn, a6 as Bn, a7 as ze, a8 as Fn, a9 as ue, aa as Pt, ab as Vt, ac as je, ad as ct, ae as Dn, af as zn, ag as Hn, ah as Wn, ai as qn, aj as yt, ak as He, al as Un } from "./index-CgRfmdyq.mjs";
2
- import { defineComponent as D, ref as T, provide as We, onMounted as pe, openBlock as m, createElementBlock as C, normalizeClass as $, unref as r, renderSlot as se, getCurrentInstance as ge, inject as Le, createElementVNode as k, createBlock as N, withCtx as M, resolveDynamicComponent as lt, toDisplayString as U, shallowRef as Lt, watch as ee, computed as E, normalizeStyle as ke, watchEffect as kt, Fragment as le, renderList as xe, reactive as st, nextTick as $e, withDirectives as ye, withKeys as Nt, createVNode as _, createCommentVNode as H, createTextVNode as Q, vShow as qe, useSlots as Kn, Teleport as jn, Transition as rt, mergeProps as Xt, withModifiers as Te, onBeforeUnmount as Gt, h as te, toRef as Xn, resolveComponent as Oe, resolveDirective as Gn, isRef as nt, onBeforeMount as Yn, TransitionGroup as Zn, pushScopeId as Jn, popScopeId as Qn, KeepAlive as eo, normalizeProps as to, guardReactiveProps as no } from "vue";
3
- import { useRoute as Xe, useRouter as Ct } from "vue-router";
4
- import { _ as oo } from "./updatePwd.vue_vue_type_script_setup_true_lang-DA30m6c3.mjs";
5
- import { t as Qe, _ as ao, E as lo } from "./runAs.vue_vue_type_script_setup_true_lang-CZdXga19.mjs";
6
- import { g as Mt } from "./position-RPjzcrqL.mjs";
7
- import { storeToRefs as so } from "pinia";
8
- import { _ as ro } from "./index-B8sKaF6F.mjs";
9
- const Yt = Symbol("breadcrumbKey"), io = Ce({
10
- separator: {
11
- type: String,
12
- default: "/"
13
- },
14
- separatorIcon: {
15
- type: Ee
16
- }
17
- }), uo = D({
18
- name: "ElBreadcrumb"
19
- }), co = /* @__PURE__ */ D({
20
- ...uo,
21
- props: io,
22
- setup(e) {
23
- const n = e, t = ne("breadcrumb"), o = T();
24
- return We(Yt, n), pe(() => {
25
- const s = o.value.querySelectorAll(`.${t.e("item")}`);
26
- s.length && s[s.length - 1].setAttribute("aria-current", "page");
27
- }), (s, a) => (m(), C("div", {
28
- ref_key: "breadcrumb",
29
- ref: o,
30
- class: $(r(t).b()),
31
- "aria-label": "Breadcrumb",
32
- role: "navigation"
33
- }, [
34
- se(s.$slots, "default")
35
- ], 2));
36
- }
37
- });
38
- var fo = /* @__PURE__ */ ce(co, [["__file", "breadcrumb.vue"]]);
39
- const mo = Ce({
40
- to: {
41
- type: Ve([String, Object]),
42
- default: ""
43
- },
44
- replace: {
45
- type: Boolean,
46
- default: !1
47
- }
48
- }), po = D({
49
- name: "ElBreadcrumbItem"
50
- }), ho = /* @__PURE__ */ D({
51
- ...po,
52
- props: mo,
53
- setup(e) {
54
- const n = e, t = ge(), o = Le(Yt, void 0), s = ne("breadcrumb"), a = t.appContext.config.globalProperties.$router, l = T(), u = () => {
55
- !n.to || !a || (n.replace ? a.replace(n.to) : a.push(n.to));
56
- };
57
- return (i, c) => {
58
- var f, d;
59
- return m(), C("span", {
60
- class: $(r(s).e("item"))
61
- }, [
62
- k("span", {
63
- ref_key: "link",
64
- ref: l,
65
- class: $([r(s).e("inner"), r(s).is("link", !!i.to)]),
66
- role: "link",
67
- onClick: u
68
- }, [
69
- se(i.$slots, "default")
70
- ], 2),
71
- (f = r(o)) != null && f.separatorIcon ? (m(), N(r(we), {
72
- key: 0,
73
- class: $(r(s).e("separator"))
74
- }, {
75
- default: M(() => [
76
- (m(), N(lt(r(o).separatorIcon)))
77
- ]),
78
- _: 1
79
- }, 8, ["class"])) : (m(), C("span", {
80
- key: 1,
81
- class: $(r(s).e("separator")),
82
- role: "presentation"
83
- }, U((d = r(o)) == null ? void 0 : d.separator), 3))
84
- ], 2);
85
- };
86
- }
87
- });
88
- var Zt = /* @__PURE__ */ ce(ho, [["__file", "breadcrumb-item.vue"]]);
89
- const vo = ot(fo, {
90
- BreadcrumbItem: Zt
91
- }), _o = at(Zt), go = Ce({
92
- color: {
93
- type: Ve(Object),
94
- required: !0
95
- },
96
- vertical: {
97
- type: Boolean,
98
- default: !1
99
- }
100
- });
101
- let dt = !1;
102
- function Ue(e, n) {
103
- if (!dn)
104
- return;
105
- const t = function(a) {
106
- var l;
107
- (l = n.drag) == null || l.call(n, a);
108
- }, o = function(a) {
109
- var l;
110
- document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", o), document.removeEventListener("touchmove", t), document.removeEventListener("touchend", o), document.onselectstart = null, document.ondragstart = null, dt = !1, (l = n.end) == null || l.call(n, a);
111
- }, s = function(a) {
112
- var l;
113
- dt || (a.preventDefault(), document.onselectstart = () => !1, document.ondragstart = () => !1, document.addEventListener("mousemove", t), document.addEventListener("mouseup", o), document.addEventListener("touchmove", t), document.addEventListener("touchend", o), dt = !0, (l = n.start) == null || l.call(n, a));
114
- };
115
- e.addEventListener("mousedown", s), e.addEventListener("touchstart", s);
116
- }
117
- const bo = (e) => {
118
- const n = ge(), t = Lt(), o = Lt();
119
- function s(l) {
120
- l.target !== t.value && a(l);
121
- }
122
- function a(l) {
123
- if (!o.value || !t.value)
124
- return;
125
- const i = n.vnode.el.getBoundingClientRect(), { clientX: c, clientY: f } = Mt(l);
126
- if (e.vertical) {
127
- let d = f - i.top;
128
- d = Math.max(t.value.offsetHeight / 2, d), d = Math.min(d, i.height - t.value.offsetHeight / 2), e.color.set("alpha", Math.round((d - t.value.offsetHeight / 2) / (i.height - t.value.offsetHeight) * 100));
129
- } else {
130
- let d = c - i.left;
131
- d = Math.max(t.value.offsetWidth / 2, d), d = Math.min(d, i.width - t.value.offsetWidth / 2), e.color.set("alpha", Math.round((d - t.value.offsetWidth / 2) / (i.width - t.value.offsetWidth) * 100));
132
- }
133
- }
134
- return {
135
- thumb: t,
136
- bar: o,
137
- handleDrag: a,
138
- handleClick: s
139
- };
140
- }, yo = (e, {
141
- bar: n,
142
- thumb: t,
143
- handleDrag: o
144
- }) => {
145
- const s = ge(), a = ne("color-alpha-slider"), l = T(0), u = T(0), i = T();
146
- function c() {
147
- if (!t.value || e.vertical)
148
- return 0;
149
- const O = s.vnode.el, b = e.color.get("alpha");
150
- return O ? Math.round(b * (O.offsetWidth - t.value.offsetWidth / 2) / 100) : 0;
151
- }
152
- function f() {
153
- if (!t.value)
154
- return 0;
155
- const O = s.vnode.el;
156
- if (!e.vertical)
157
- return 0;
158
- const b = e.color.get("alpha");
159
- return O ? Math.round(b * (O.offsetHeight - t.value.offsetHeight / 2) / 100) : 0;
160
- }
161
- function d() {
162
- if (e.color && e.color.value) {
163
- const { r: O, g: b, b: Y } = e.color.toRgb();
164
- return `linear-gradient(to right, rgba(${O}, ${b}, ${Y}, 0) 0%, rgba(${O}, ${b}, ${Y}, 1) 100%)`;
165
- }
166
- return "";
167
- }
168
- function p() {
169
- l.value = c(), u.value = f(), i.value = d();
170
- }
171
- pe(() => {
172
- if (!n.value || !t.value)
173
- return;
174
- const O = {
175
- drag: (b) => {
176
- o(b);
177
- },
178
- end: (b) => {
179
- o(b);
180
- }
181
- };
182
- Ue(n.value, O), Ue(t.value, O), p();
183
- }), ee(() => e.color.get("alpha"), () => p()), ee(() => e.color.value, () => p());
184
- const v = E(() => [a.b(), a.is("vertical", e.vertical)]), g = E(() => a.e("bar")), w = E(() => a.e("thumb")), S = E(() => ({ background: i.value })), P = E(() => ({
185
- left: vt(l.value),
186
- top: vt(u.value)
187
- }));
188
- return { rootKls: v, barKls: g, barStyle: S, thumbKls: w, thumbStyle: P, update: p };
189
- }, ko = "ElColorAlphaSlider", Co = D({
190
- name: ko
191
- }), Mo = /* @__PURE__ */ D({
192
- ...Co,
193
- props: go,
194
- setup(e, { expose: n }) {
195
- const t = e, { bar: o, thumb: s, handleDrag: a, handleClick: l } = bo(t), { rootKls: u, barKls: i, barStyle: c, thumbKls: f, thumbStyle: d, update: p } = yo(t, {
196
- bar: o,
197
- thumb: s,
198
- handleDrag: a
199
- });
200
- return n({
201
- update: p,
202
- bar: o,
203
- thumb: s
204
- }), (v, g) => (m(), C("div", {
205
- class: $(r(u))
206
- }, [
207
- k("div", {
208
- ref_key: "bar",
209
- ref: o,
210
- class: $(r(i)),
211
- style: ke(r(c)),
212
- onClick: g[0] || (g[0] = (...w) => r(l) && r(l)(...w))
213
- }, null, 6),
214
- k("div", {
215
- ref_key: "thumb",
216
- ref: s,
217
- class: $(r(f)),
218
- style: ke(r(d))
219
- }, null, 6)
220
- ], 2));
221
- }
222
- });
223
- var $o = /* @__PURE__ */ ce(Mo, [["__file", "alpha-slider.vue"]]);
224
- const wo = D({
225
- name: "ElColorHueSlider",
226
- props: {
227
- color: {
228
- type: Object,
229
- required: !0
230
- },
231
- vertical: Boolean
232
- },
233
- setup(e) {
234
- const n = ne("color-hue-slider"), t = ge(), o = T(), s = T(), a = T(0), l = T(0), u = E(() => e.color.get("hue"));
235
- ee(() => u.value, () => {
236
- p();
237
- });
238
- function i(v) {
239
- v.target !== o.value && c(v);
240
- }
241
- function c(v) {
242
- if (!s.value || !o.value)
243
- return;
244
- const w = t.vnode.el.getBoundingClientRect(), { clientX: S, clientY: P } = Mt(v);
245
- let O;
246
- if (e.vertical) {
247
- let b = P - w.top;
248
- b = Math.min(b, w.height - o.value.offsetHeight / 2), b = Math.max(o.value.offsetHeight / 2, b), O = Math.round((b - o.value.offsetHeight / 2) / (w.height - o.value.offsetHeight) * 360);
249
- } else {
250
- let b = S - w.left;
251
- b = Math.min(b, w.width - o.value.offsetWidth / 2), b = Math.max(o.value.offsetWidth / 2, b), O = Math.round((b - o.value.offsetWidth / 2) / (w.width - o.value.offsetWidth) * 360);
252
- }
253
- e.color.set("hue", O);
254
- }
255
- function f() {
256
- if (!o.value)
257
- return 0;
258
- const v = t.vnode.el;
259
- if (e.vertical)
260
- return 0;
261
- const g = e.color.get("hue");
262
- return v ? Math.round(g * (v.offsetWidth - o.value.offsetWidth / 2) / 360) : 0;
263
- }
264
- function d() {
265
- if (!o.value)
266
- return 0;
267
- const v = t.vnode.el;
268
- if (!e.vertical)
269
- return 0;
270
- const g = e.color.get("hue");
271
- return v ? Math.round(g * (v.offsetHeight - o.value.offsetHeight / 2) / 360) : 0;
272
- }
273
- function p() {
274
- a.value = f(), l.value = d();
275
- }
276
- return pe(() => {
277
- if (!s.value || !o.value)
278
- return;
279
- const v = {
280
- drag: (g) => {
281
- c(g);
282
- },
283
- end: (g) => {
284
- c(g);
285
- }
286
- };
287
- Ue(s.value, v), Ue(o.value, v), p();
288
- }), {
289
- bar: s,
290
- thumb: o,
291
- thumbLeft: a,
292
- thumbTop: l,
293
- hueValue: u,
294
- handleClick: i,
295
- update: p,
296
- ns: n
297
- };
298
- }
299
- });
300
- function So(e, n, t, o, s, a) {
301
- return m(), C("div", {
302
- class: $([e.ns.b(), e.ns.is("vertical", e.vertical)])
303
- }, [
304
- k("div", {
305
- ref: "bar",
306
- class: $(e.ns.e("bar")),
307
- onClick: n[0] || (n[0] = (...l) => e.handleClick && e.handleClick(...l))
308
- }, null, 2),
309
- k("div", {
310
- ref: "thumb",
311
- class: $(e.ns.e("thumb")),
312
- style: ke({
313
- left: e.thumbLeft + "px",
314
- top: e.thumbTop + "px"
315
- })
316
- }, null, 6)
317
- ], 2);
318
- }
319
- var xo = /* @__PURE__ */ ce(wo, [["render", So], ["__file", "hue-slider.vue"]]);
320
- const Eo = Ce({
321
- modelValue: String,
322
- id: String,
323
- showAlpha: Boolean,
324
- colorFormat: String,
325
- disabled: Boolean,
326
- size: fn,
327
- popperClass: {
328
- type: String,
329
- default: ""
330
- },
331
- label: {
332
- type: String,
333
- default: void 0
334
- },
335
- tabindex: {
336
- type: [String, Number],
337
- default: 0
338
- },
339
- predefine: {
340
- type: Ve(Array)
341
- },
342
- validateEvent: {
343
- type: Boolean,
344
- default: !0
345
- }
346
- }), To = {
347
- [_t]: (e) => ve(e) || Fe(e),
348
- [mn]: (e) => ve(e) || Fe(e),
349
- activeChange: (e) => ve(e) || Fe(e),
350
- focus: (e) => e instanceof FocusEvent,
351
- blur: (e) => e instanceof FocusEvent
352
- }, Jt = Symbol("colorPickerContextKey"), Ot = function(e, n, t) {
353
- return [
354
- e,
355
- n * t / ((e = (2 - n) * t) < 1 ? e : 2 - e) || 0,
356
- e / 2
357
- ];
358
- }, Io = function(e) {
359
- return typeof e == "string" && e.includes(".") && Number.parseFloat(e) === 1;
360
- }, Ao = function(e) {
361
- return typeof e == "string" && e.includes("%");
362
- }, Ie = function(e, n) {
363
- Io(e) && (e = "100%");
364
- const t = Ao(e);
365
- return e = Math.min(n, Math.max(0, Number.parseFloat(`${e}`))), t && (e = Number.parseInt(`${e * n}`, 10) / 100), Math.abs(e - n) < 1e-6 ? 1 : e % n / Number.parseFloat(n);
366
- }, Rt = {
367
- 10: "A",
368
- 11: "B",
369
- 12: "C",
370
- 13: "D",
371
- 14: "E",
372
- 15: "F"
373
- }, et = (e) => {
374
- e = Math.min(Math.round(e), 255);
375
- const n = Math.floor(e / 16), t = e % 16;
376
- return `${Rt[n] || n}${Rt[t] || t}`;
377
- }, Bt = function({ r: e, g: n, b: t }) {
378
- return Number.isNaN(+e) || Number.isNaN(+n) || Number.isNaN(+t) ? "" : `#${et(e)}${et(n)}${et(t)}`;
379
- }, ft = {
380
- A: 10,
381
- B: 11,
382
- C: 12,
383
- D: 13,
384
- E: 14,
385
- F: 15
386
- }, Me = function(e) {
387
- return e.length === 2 ? (ft[e[0].toUpperCase()] || +e[0]) * 16 + (ft[e[1].toUpperCase()] || +e[1]) : ft[e[1].toUpperCase()] || +e[1];
388
- }, Po = function(e, n, t) {
389
- n = n / 100, t = t / 100;
390
- let o = n;
391
- const s = Math.max(t, 0.01);
392
- t *= 2, n *= t <= 1 ? t : 2 - t, o *= s <= 1 ? s : 2 - s;
393
- const a = (t + n) / 2, l = t === 0 ? 2 * o / (s + o) : 2 * n / (t + n);
394
- return {
395
- h: e,
396
- s: l * 100,
397
- v: a * 100
398
- };
399
- }, Ft = (e, n, t) => {
400
- e = Ie(e, 255), n = Ie(n, 255), t = Ie(t, 255);
401
- const o = Math.max(e, n, t), s = Math.min(e, n, t);
402
- let a;
403
- const l = o, u = o - s, i = o === 0 ? 0 : u / o;
404
- if (o === s)
405
- a = 0;
406
- else {
407
- switch (o) {
408
- case e: {
409
- a = (n - t) / u + (n < t ? 6 : 0);
410
- break;
411
- }
412
- case n: {
413
- a = (t - e) / u + 2;
414
- break;
415
- }
416
- case t: {
417
- a = (e - n) / u + 4;
418
- break;
419
- }
420
- }
421
- a /= 6;
422
- }
423
- return { h: a * 360, s: i * 100, v: l * 100 };
424
- }, Be = function(e, n, t) {
425
- e = Ie(e, 360) * 6, n = Ie(n, 100), t = Ie(t, 100);
426
- const o = Math.floor(e), s = e - o, a = t * (1 - n), l = t * (1 - s * n), u = t * (1 - (1 - s) * n), i = o % 6, c = [t, l, a, a, u, t][i], f = [u, t, t, l, a, a][i], d = [a, a, u, t, t, l][i];
427
- return {
428
- r: Math.round(c * 255),
429
- g: Math.round(f * 255),
430
- b: Math.round(d * 255)
431
- };
432
- };
433
- class De {
434
- constructor(n = {}) {
435
- this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = !1, this.format = "hex", this.value = "";
436
- for (const t in n)
437
- Et(n, t) && (this[t] = n[t]);
438
- n.value ? this.fromString(n.value) : this.doOnChange();
439
- }
440
- set(n, t) {
441
- if (arguments.length === 1 && typeof n == "object") {
442
- for (const o in n)
443
- Et(n, o) && this.set(o, n[o]);
444
- return;
445
- }
446
- this[`_${n}`] = t, this.doOnChange();
447
- }
448
- get(n) {
449
- return n === "alpha" ? Math.floor(this[`_${n}`]) : this[`_${n}`];
450
- }
451
- toRgb() {
452
- return Be(this._hue, this._saturation, this._value);
453
- }
454
- fromString(n) {
455
- if (!n) {
456
- this._hue = 0, this._saturation = 100, this._value = 100, this.doOnChange();
457
- return;
458
- }
459
- const t = (o, s, a) => {
460
- this._hue = Math.max(0, Math.min(360, o)), this._saturation = Math.max(0, Math.min(100, s)), this._value = Math.max(0, Math.min(100, a)), this.doOnChange();
461
- };
462
- if (n.includes("hsl")) {
463
- const o = n.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((s) => s !== "").map((s, a) => a > 2 ? Number.parseFloat(s) : Number.parseInt(s, 10));
464
- if (o.length === 4 ? this._alpha = Number.parseFloat(o[3]) * 100 : o.length === 3 && (this._alpha = 100), o.length >= 3) {
465
- const { h: s, s: a, v: l } = Po(o[0], o[1], o[2]);
466
- t(s, a, l);
467
- }
468
- } else if (n.includes("hsv")) {
469
- const o = n.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((s) => s !== "").map((s, a) => a > 2 ? Number.parseFloat(s) : Number.parseInt(s, 10));
470
- o.length === 4 ? this._alpha = Number.parseFloat(o[3]) * 100 : o.length === 3 && (this._alpha = 100), o.length >= 3 && t(o[0], o[1], o[2]);
471
- } else if (n.includes("rgb")) {
472
- const o = n.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((s) => s !== "").map((s, a) => a > 2 ? Number.parseFloat(s) : Number.parseInt(s, 10));
473
- if (o.length === 4 ? this._alpha = Number.parseFloat(o[3]) * 100 : o.length === 3 && (this._alpha = 100), o.length >= 3) {
474
- const { h: s, s: a, v: l } = Ft(o[0], o[1], o[2]);
475
- t(s, a, l);
476
- }
477
- } else if (n.includes("#")) {
478
- const o = n.replace("#", "").trim();
479
- if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(o))
480
- return;
481
- let s, a, l;
482
- o.length === 3 ? (s = Me(o[0] + o[0]), a = Me(o[1] + o[1]), l = Me(o[2] + o[2])) : (o.length === 6 || o.length === 8) && (s = Me(o.slice(0, 2)), a = Me(o.slice(2, 4)), l = Me(o.slice(4, 6))), o.length === 8 ? this._alpha = Me(o.slice(6)) / 255 * 100 : (o.length === 3 || o.length === 6) && (this._alpha = 100);
483
- const { h: u, s: i, v: c } = Ft(s, a, l);
484
- t(u, i, c);
485
- }
486
- }
487
- compare(n) {
488
- return Math.abs(n._hue - this._hue) < 2 && Math.abs(n._saturation - this._saturation) < 1 && Math.abs(n._value - this._value) < 1 && Math.abs(n._alpha - this._alpha) < 1;
489
- }
490
- doOnChange() {
491
- const { _hue: n, _saturation: t, _value: o, _alpha: s, format: a } = this;
492
- if (this.enableAlpha)
493
- switch (a) {
494
- case "hsl": {
495
- const l = Ot(n, t / 100, o / 100);
496
- this.value = `hsla(${n}, ${Math.round(l[1] * 100)}%, ${Math.round(l[2] * 100)}%, ${this.get("alpha") / 100})`;
497
- break;
498
- }
499
- case "hsv": {
500
- this.value = `hsva(${n}, ${Math.round(t)}%, ${Math.round(o)}%, ${this.get("alpha") / 100})`;
501
- break;
502
- }
503
- case "hex": {
504
- this.value = `${Bt(Be(n, t, o))}${et(s * 255 / 100)}`;
505
- break;
506
- }
507
- default: {
508
- const { r: l, g: u, b: i } = Be(n, t, o);
509
- this.value = `rgba(${l}, ${u}, ${i}, ${this.get("alpha") / 100})`;
510
- }
511
- }
512
- else
513
- switch (a) {
514
- case "hsl": {
515
- const l = Ot(n, t / 100, o / 100);
516
- this.value = `hsl(${n}, ${Math.round(l[1] * 100)}%, ${Math.round(l[2] * 100)}%)`;
517
- break;
518
- }
519
- case "hsv": {
520
- this.value = `hsv(${n}, ${Math.round(t)}%, ${Math.round(o)}%)`;
521
- break;
522
- }
523
- case "rgb": {
524
- const { r: l, g: u, b: i } = Be(n, t, o);
525
- this.value = `rgb(${l}, ${u}, ${i})`;
526
- break;
527
- }
528
- default:
529
- this.value = Bt(Be(n, t, o));
530
- }
531
- }
532
- }
533
- const Vo = D({
534
- props: {
535
- colors: {
536
- type: Array,
537
- required: !0
538
- },
539
- color: {
540
- type: Object,
541
- required: !0
542
- }
543
- },
544
- setup(e) {
545
- const n = ne("color-predefine"), { currentColor: t } = Le(Jt), o = T(a(e.colors, e.color));
546
- ee(() => t.value, (l) => {
547
- const u = new De();
548
- u.fromString(l), o.value.forEach((i) => {
549
- i.selected = u.compare(i);
550
- });
551
- }), kt(() => {
552
- o.value = a(e.colors, e.color);
553
- });
554
- function s(l) {
555
- e.color.fromString(e.colors[l]);
556
- }
557
- function a(l, u) {
558
- return l.map((i) => {
559
- const c = new De();
560
- return c.enableAlpha = !0, c.format = "rgba", c.fromString(i), c.selected = c.value === u.value, c;
561
- });
562
- }
563
- return {
564
- rgbaColors: o,
565
- handleSelect: s,
566
- ns: n
567
- };
568
- }
569
- }), Lo = ["onClick"];
570
- function No(e, n, t, o, s, a) {
571
- return m(), C("div", {
572
- class: $(e.ns.b())
573
- }, [
574
- k("div", {
575
- class: $(e.ns.e("colors"))
576
- }, [
577
- (m(!0), C(le, null, xe(e.rgbaColors, (l, u) => (m(), C("div", {
578
- key: e.colors[u],
579
- class: $([
580
- e.ns.e("color-selector"),
581
- e.ns.is("alpha", l._alpha < 100),
582
- { selected: l.selected }
583
- ]),
584
- onClick: (i) => e.handleSelect(u)
585
- }, [
586
- k("div", {
587
- style: ke({ backgroundColor: l.value })
588
- }, null, 4)
589
- ], 10, Lo))), 128))
590
- ], 2)
591
- ], 2);
592
- }
593
- var Oo = /* @__PURE__ */ ce(Vo, [["render", No], ["__file", "predefine.vue"]]);
594
- const Ro = D({
595
- name: "ElSlPanel",
596
- props: {
597
- color: {
598
- type: Object,
599
- required: !0
600
- }
601
- },
602
- setup(e) {
603
- const n = ne("color-svpanel"), t = ge(), o = T(0), s = T(0), a = T("hsl(0, 100%, 50%)"), l = E(() => {
604
- const c = e.color.get("hue"), f = e.color.get("value");
605
- return { hue: c, value: f };
606
- });
607
- function u() {
608
- const c = e.color.get("saturation"), f = e.color.get("value"), d = t.vnode.el, { clientWidth: p, clientHeight: v } = d;
609
- s.value = c * p / 100, o.value = (100 - f) * v / 100, a.value = `hsl(${e.color.get("hue")}, 100%, 50%)`;
610
- }
611
- function i(c) {
612
- const d = t.vnode.el.getBoundingClientRect(), { clientX: p, clientY: v } = Mt(c);
613
- let g = p - d.left, w = v - d.top;
614
- g = Math.max(0, g), g = Math.min(g, d.width), w = Math.max(0, w), w = Math.min(w, d.height), s.value = g, o.value = w, e.color.set({
615
- saturation: g / d.width * 100,
616
- value: 100 - w / d.height * 100
617
- });
618
- }
619
- return ee(() => l.value, () => {
620
- u();
621
- }), pe(() => {
622
- Ue(t.vnode.el, {
623
- drag: (c) => {
624
- i(c);
625
- },
626
- end: (c) => {
627
- i(c);
628
- }
629
- }), u();
630
- }), {
631
- cursorTop: o,
632
- cursorLeft: s,
633
- background: a,
634
- colorValue: l,
635
- handleDrag: i,
636
- update: u,
637
- ns: n
638
- };
639
- }
640
- }), Bo = /* @__PURE__ */ k("div", null, null, -1), Fo = [
641
- Bo
642
- ];
643
- function Do(e, n, t, o, s, a) {
644
- return m(), C("div", {
645
- class: $(e.ns.b()),
646
- style: ke({
647
- backgroundColor: e.background
648
- })
649
- }, [
650
- k("div", {
651
- class: $(e.ns.e("white"))
652
- }, null, 2),
653
- k("div", {
654
- class: $(e.ns.e("black"))
655
- }, null, 2),
656
- k("div", {
657
- class: $(e.ns.e("cursor")),
658
- style: ke({
659
- top: e.cursorTop + "px",
660
- left: e.cursorLeft + "px"
661
- })
662
- }, Fo, 6)
663
- ], 6);
664
- }
665
- var zo = /* @__PURE__ */ ce(Ro, [["render", Do], ["__file", "sv-panel.vue"]]);
666
- const Ho = ["onKeydown"], Wo = ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex"], qo = D({
667
- name: "ElColorPicker"
668
- }), Uo = /* @__PURE__ */ D({
669
- ...qo,
670
- props: Eo,
671
- emits: To,
672
- setup(e, { expose: n, emit: t }) {
673
- const o = e, { t: s } = zt(), a = ne("color"), { formItem: l } = pn(), u = hn(), i = vn(), { inputId: c, isLabeledByFormItem: f } = _n(o, {
674
- formItemContext: l
675
- }), d = T(), p = T(), v = T(), g = T(), w = T(), S = T(), {
676
- isFocused: P,
677
- handleFocus: O,
678
- handleBlur: b
679
- } = gn(w, {
680
- beforeBlur(L) {
681
- var J;
682
- return (J = g.value) == null ? void 0 : J.isFocusInsideContent(L);
683
- },
684
- afterBlur() {
685
- B(!1), h();
686
- }
687
- }), Y = (L) => {
688
- if (i.value)
689
- return wt();
690
- O(L);
691
- };
692
- let Z = !0;
693
- const R = st(new De({
694
- enableAlpha: o.showAlpha,
695
- format: o.colorFormat || "",
696
- value: o.modelValue
697
- })), W = T(!1), V = T(!1), j = T(""), ae = E(() => !o.modelValue && !V.value ? "transparent" : I(R, o.showAlpha)), oe = E(() => !o.modelValue && !V.value ? "" : R.value), de = E(() => f.value ? void 0 : o.label || s("el.colorpicker.defaultLabel")), be = E(() => f.value ? l == null ? void 0 : l.labelId : void 0), x = E(() => [
698
- a.b("picker"),
699
- a.is("disabled", i.value),
700
- a.bm("picker", u.value),
701
- a.is("focused", P.value)
702
- ]);
703
- function I(L, J) {
704
- if (!(L instanceof De))
705
- throw new TypeError("color should be instance of _color Class");
706
- const { r: fe, g: St, b: xt } = L.toRgb();
707
- return J ? `rgba(${fe}, ${St}, ${xt}, ${L.get("alpha") / 100})` : `rgb(${fe}, ${St}, ${xt})`;
708
- }
709
- function B(L) {
710
- W.value = L;
711
- }
712
- const X = bn(B, 100, { leading: !0 });
713
- function K() {
714
- i.value || B(!0);
715
- }
716
- function y() {
717
- X(!1), h();
718
- }
719
- function h() {
720
- $e(() => {
721
- o.modelValue ? R.fromString(o.modelValue) : (R.value = "", $e(() => {
722
- V.value = !1;
723
- }));
724
- });
725
- }
726
- function A() {
727
- i.value || X(!W.value);
728
- }
729
- function F() {
730
- R.fromString(j.value);
731
- }
732
- function q() {
733
- const L = R.value;
734
- t(_t, L), t("change", L), o.validateEvent && (l == null || l.validate("change").catch((J) => It(J))), X(!1), $e(() => {
735
- const J = new De({
736
- enableAlpha: o.showAlpha,
737
- format: o.colorFormat || "",
738
- value: o.modelValue
739
- });
740
- R.compare(J) || h();
741
- });
742
- }
743
- function z() {
744
- X(!1), t(_t, null), t("change", null), o.modelValue !== null && o.validateEvent && (l == null || l.validate("change").catch((L) => It(L))), h();
745
- }
746
- function G(L) {
747
- if (W.value && (y(), P.value)) {
748
- const J = new FocusEvent("focus", L);
749
- b(J);
750
- }
751
- }
752
- function re(L) {
753
- L.preventDefault(), L.stopPropagation(), B(!1), h();
754
- }
755
- function Ge(L) {
756
- switch (L.code) {
757
- case ie.enter:
758
- case ie.space:
759
- L.preventDefault(), L.stopPropagation(), K(), S.value.focus();
760
- break;
761
- case ie.esc:
762
- re(L);
763
- break;
764
- }
765
- }
766
- function Ye() {
767
- w.value.focus();
768
- }
769
- function wt() {
770
- w.value.blur();
771
- }
772
- return pe(() => {
773
- o.modelValue && (j.value = oe.value);
774
- }), ee(() => o.modelValue, (L) => {
775
- L ? L && L !== R.value && (Z = !1, R.fromString(L)) : V.value = !1;
776
- }), ee(() => oe.value, (L) => {
777
- j.value = L, Z && t("activeChange", L), Z = !0;
778
- }), ee(() => R.value, () => {
779
- !o.modelValue && !V.value && (V.value = !0);
780
- }), ee(() => W.value, () => {
781
- $e(() => {
782
- var L, J, fe;
783
- (L = d.value) == null || L.update(), (J = p.value) == null || J.update(), (fe = v.value) == null || fe.update();
784
- });
785
- }), We(Jt, {
786
- currentColor: oe
787
- }), n({
788
- color: R,
789
- show: K,
790
- hide: y,
791
- focus: Ye,
792
- blur: wt
793
- }), (L, J) => (m(), N(r(Ke), {
794
- ref_key: "popper",
795
- ref: g,
796
- visible: W.value,
797
- "show-arrow": !1,
798
- "fallback-placements": ["bottom", "top", "right", "left"],
799
- offset: 0,
800
- "gpu-acceleration": !1,
801
- "popper-class": [r(a).be("picker", "panel"), r(a).b("dropdown"), L.popperClass],
802
- "stop-popper-mouse-event": !1,
803
- effect: "light",
804
- trigger: "click",
805
- transition: `${r(a).namespace.value}-zoom-in-top`,
806
- persistent: "",
807
- onHide: J[2] || (J[2] = (fe) => B(!1))
808
- }, {
809
- content: M(() => [
810
- ye((m(), C("div", {
811
- onKeydown: Nt(re, ["esc"])
812
- }, [
813
- k("div", {
814
- class: $(r(a).be("dropdown", "main-wrapper"))
815
- }, [
816
- _(xo, {
817
- ref_key: "hue",
818
- ref: d,
819
- class: "hue-slider",
820
- color: r(R),
821
- vertical: ""
822
- }, null, 8, ["color"]),
823
- _(zo, {
824
- ref_key: "sv",
825
- ref: p,
826
- color: r(R)
827
- }, null, 8, ["color"])
828
- ], 2),
829
- L.showAlpha ? (m(), N($o, {
830
- key: 0,
831
- ref_key: "alpha",
832
- ref: v,
833
- color: r(R)
834
- }, null, 8, ["color"])) : H("v-if", !0),
835
- L.predefine ? (m(), N(Oo, {
836
- key: 1,
837
- ref: "predefine",
838
- color: r(R),
839
- colors: L.predefine
840
- }, null, 8, ["color", "colors"])) : H("v-if", !0),
841
- k("div", {
842
- class: $(r(a).be("dropdown", "btns"))
843
- }, [
844
- k("span", {
845
- class: $(r(a).be("dropdown", "value"))
846
- }, [
847
- _(r(yn), {
848
- ref_key: "inputRef",
849
- ref: S,
850
- modelValue: j.value,
851
- "onUpdate:modelValue": J[0] || (J[0] = (fe) => j.value = fe),
852
- "validate-event": !1,
853
- size: "small",
854
- onKeyup: Nt(F, ["enter"]),
855
- onBlur: F
856
- }, null, 8, ["modelValue", "onKeyup"])
857
- ], 2),
858
- _(r(Tt), {
859
- class: $(r(a).be("dropdown", "link-btn")),
860
- text: "",
861
- size: "small",
862
- onClick: z
863
- }, {
864
- default: M(() => [
865
- Q(U(r(s)("el.colorpicker.clear")), 1)
866
- ]),
867
- _: 1
868
- }, 8, ["class"]),
869
- _(r(Tt), {
870
- plain: "",
871
- size: "small",
872
- class: $(r(a).be("dropdown", "btn")),
873
- onClick: q
874
- }, {
875
- default: M(() => [
876
- Q(U(r(s)("el.colorpicker.confirm")), 1)
877
- ]),
878
- _: 1
879
- }, 8, ["class"])
880
- ], 2)
881
- ], 40, Ho)), [
882
- [r(Ht), G]
883
- ])
884
- ]),
885
- default: M(() => [
886
- k("div", {
887
- id: r(c),
888
- ref_key: "triggerRef",
889
- ref: w,
890
- class: $(r(x)),
891
- role: "button",
892
- "aria-label": r(de),
893
- "aria-labelledby": r(be),
894
- "aria-description": r(s)("el.colorpicker.description", { color: L.modelValue || "" }),
895
- "aria-disabled": r(i),
896
- tabindex: r(i) ? -1 : L.tabindex,
897
- onKeydown: Ge,
898
- onFocus: Y,
899
- onBlur: J[1] || (J[1] = (...fe) => r(b) && r(b)(...fe))
900
- }, [
901
- r(i) ? (m(), C("div", {
902
- key: 0,
903
- class: $(r(a).be("picker", "mask"))
904
- }, null, 2)) : H("v-if", !0),
905
- k("div", {
906
- class: $(r(a).be("picker", "trigger")),
907
- onClick: A
908
- }, [
909
- k("span", {
910
- class: $([r(a).be("picker", "color"), r(a).is("alpha", L.showAlpha)])
911
- }, [
912
- k("span", {
913
- class: $(r(a).be("picker", "color-inner")),
914
- style: ke({
915
- backgroundColor: r(ae)
916
- })
917
- }, [
918
- ye(_(r(we), {
919
- class: $([r(a).be("picker", "icon"), r(a).is("icon-arrow-down")])
920
- }, {
921
- default: M(() => [
922
- _(r(Wt))
923
- ]),
924
- _: 1
925
- }, 8, ["class"]), [
926
- [qe, L.modelValue || V.value]
927
- ]),
928
- ye(_(r(we), {
929
- class: $([r(a).be("picker", "empty"), r(a).is("icon-close")])
930
- }, {
931
- default: M(() => [
932
- _(r(qt))
933
- ]),
934
- _: 1
935
- }, 8, ["class"]), [
936
- [qe, !L.modelValue && !V.value]
937
- ])
938
- ], 6)
939
- ], 2)
940
- ], 2)
941
- ], 42, Wo)
942
- ]),
943
- _: 1
944
- }, 8, ["visible", "popper-class", "transition"]));
945
- }
946
- });
947
- var Ko = /* @__PURE__ */ ce(Uo, [["__file", "color-picker.vue"]]);
948
- const jo = ot(Ko), Xo = Ce({
949
- ...kn,
950
- direction: {
951
- type: String,
952
- default: "rtl",
953
- values: ["ltr", "rtl", "ttb", "btt"]
954
- },
955
- size: {
956
- type: [String, Number],
957
- default: "30%"
958
- },
959
- withHeader: {
960
- type: Boolean,
961
- default: !0
962
- },
963
- modalFade: {
964
- type: Boolean,
965
- default: !0
966
- },
967
- headerAriaLevel: {
968
- type: String,
969
- default: "2"
970
- }
971
- }), Go = Cn, Yo = ["aria-label", "aria-labelledby", "aria-describedby"], Zo = ["id", "aria-level"], Jo = ["aria-label"], Qo = ["id"], ea = D({
972
- name: "ElDrawer",
973
- inheritAttrs: !1
974
- }), ta = /* @__PURE__ */ D({
975
- ...ea,
976
- props: Xo,
977
- emits: Go,
978
- setup(e, { expose: n }) {
979
- const t = e, o = Kn();
980
- Mn({
981
- scope: "el-drawer",
982
- from: "the title slot",
983
- replacement: "the header slot",
984
- version: "3.0.0",
985
- ref: "https://element-plus.org/en-US/component/drawer.html#slots"
986
- }, E(() => !!o.title));
987
- const s = T(), a = T(), l = ne("drawer"), { t: u } = zt(), {
988
- afterEnter: i,
989
- afterLeave: c,
990
- beforeLeave: f,
991
- visible: d,
992
- rendered: p,
993
- titleId: v,
994
- bodyId: g,
995
- zIndex: w,
996
- onModalClick: S,
997
- onOpenAutoFocus: P,
998
- onCloseAutoFocus: O,
999
- onFocusoutPrevented: b,
1000
- onCloseRequested: Y,
1001
- handleClose: Z
1002
- } = $n(t, s), R = E(() => t.direction === "rtl" || t.direction === "ltr"), W = E(() => vt(t.size));
1003
- return n({
1004
- handleClose: Z,
1005
- afterEnter: i,
1006
- afterLeave: c
1007
- }), (V, j) => (m(), N(jn, {
1008
- to: "body",
1009
- disabled: !V.appendToBody
1010
- }, [
1011
- _(rt, {
1012
- name: r(l).b("fade"),
1013
- onAfterEnter: r(i),
1014
- onAfterLeave: r(c),
1015
- onBeforeLeave: r(f),
1016
- persisted: ""
1017
- }, {
1018
- default: M(() => [
1019
- ye(_(r(wn), {
1020
- mask: V.modal,
1021
- "overlay-class": V.modalClass,
1022
- "z-index": r(w),
1023
- onClick: r(S)
1024
- }, {
1025
- default: M(() => [
1026
- _(r(Sn), {
1027
- loop: "",
1028
- trapped: r(d),
1029
- "focus-trap-el": s.value,
1030
- "focus-start-el": a.value,
1031
- onFocusAfterTrapped: r(P),
1032
- onFocusAfterReleased: r(O),
1033
- onFocusoutPrevented: r(b),
1034
- onReleaseRequested: r(Y)
1035
- }, {
1036
- default: M(() => [
1037
- k("div", Xt({
1038
- ref_key: "drawerRef",
1039
- ref: s,
1040
- "aria-modal": "true",
1041
- "aria-label": V.title || void 0,
1042
- "aria-labelledby": V.title ? void 0 : r(v),
1043
- "aria-describedby": r(g)
1044
- }, V.$attrs, {
1045
- class: [r(l).b(), V.direction, r(d) && "open"],
1046
- style: r(R) ? "width: " + r(W) : "height: " + r(W),
1047
- role: "dialog",
1048
- onClick: j[1] || (j[1] = Te(() => {
1049
- }, ["stop"]))
1050
- }), [
1051
- k("span", {
1052
- ref_key: "focusStartRef",
1053
- ref: a,
1054
- class: $(r(l).e("sr-focus")),
1055
- tabindex: "-1"
1056
- }, null, 2),
1057
- V.withHeader ? (m(), C("header", {
1058
- key: 0,
1059
- class: $(r(l).e("header"))
1060
- }, [
1061
- V.$slots.title ? se(V.$slots, "title", { key: 1 }, () => [
1062
- H(" DEPRECATED SLOT ")
1063
- ]) : se(V.$slots, "header", {
1064
- key: 0,
1065
- close: r(Z),
1066
- titleId: r(v),
1067
- titleClass: r(l).e("title")
1068
- }, () => [
1069
- V.$slots.title ? H("v-if", !0) : (m(), C("span", {
1070
- key: 0,
1071
- id: r(v),
1072
- role: "heading",
1073
- "aria-level": V.headerAriaLevel,
1074
- class: $(r(l).e("title"))
1075
- }, U(V.title), 11, Zo))
1076
- ]),
1077
- V.showClose ? (m(), C("button", {
1078
- key: 2,
1079
- "aria-label": r(u)("el.drawer.close"),
1080
- class: $(r(l).e("close-btn")),
1081
- type: "button",
1082
- onClick: j[0] || (j[0] = (...ae) => r(Z) && r(Z)(...ae))
1083
- }, [
1084
- _(r(we), {
1085
- class: $(r(l).e("close"))
1086
- }, {
1087
- default: M(() => [
1088
- _(r(qt))
1089
- ]),
1090
- _: 1
1091
- }, 8, ["class"])
1092
- ], 10, Jo)) : H("v-if", !0)
1093
- ], 2)) : H("v-if", !0),
1094
- r(p) ? (m(), C("div", {
1095
- key: 1,
1096
- id: r(g),
1097
- class: $(r(l).e("body"))
1098
- }, [
1099
- se(V.$slots, "default")
1100
- ], 10, Qo)) : H("v-if", !0),
1101
- V.$slots.footer ? (m(), C("div", {
1102
- key: 2,
1103
- class: $(r(l).e("footer"))
1104
- }, [
1105
- se(V.$slots, "footer")
1106
- ], 2)) : H("v-if", !0)
1107
- ], 16, Yo)
1108
- ]),
1109
- _: 3
1110
- }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
1111
- ]),
1112
- _: 3
1113
- }, 8, ["mask", "overlay-class", "z-index", "onClick"]), [
1114
- [qe, r(d)]
1115
- ])
1116
- ]),
1117
- _: 3
1118
- }, 8, ["name", "onAfterEnter", "onAfterLeave", "onBeforeLeave"])
1119
- ], 8, ["disabled"]));
1120
- }
1121
- });
1122
- var na = /* @__PURE__ */ ce(ta, [["__file", "drawer.vue"]]);
1123
- const oa = ot(na);
1124
- let aa = class {
1125
- constructor(n, t) {
1126
- this.parent = n, this.domNode = t, this.subIndex = 0, this.subIndex = 0, this.init();
1127
- }
1128
- init() {
1129
- this.subMenuItems = this.domNode.querySelectorAll("li"), this.addListeners();
1130
- }
1131
- gotoSubIndex(n) {
1132
- n === this.subMenuItems.length ? n = 0 : n < 0 && (n = this.subMenuItems.length - 1), this.subMenuItems[n].focus(), this.subIndex = n;
1133
- }
1134
- addListeners() {
1135
- const n = this.parent.domNode;
1136
- Array.prototype.forEach.call(this.subMenuItems, (t) => {
1137
- t.addEventListener("keydown", (o) => {
1138
- let s = !1;
1139
- switch (o.code) {
1140
- case ie.down: {
1141
- this.gotoSubIndex(this.subIndex + 1), s = !0;
1142
- break;
1143
- }
1144
- case ie.up: {
1145
- this.gotoSubIndex(this.subIndex - 1), s = !0;
1146
- break;
1147
- }
1148
- case ie.tab: {
1149
- Qe(n, "mouseleave");
1150
- break;
1151
- }
1152
- case ie.enter:
1153
- case ie.space: {
1154
- s = !0, o.currentTarget.click();
1155
- break;
1156
- }
1157
- }
1158
- return s && (o.preventDefault(), o.stopPropagation()), !1;
1159
- });
1160
- });
1161
- }
1162
- }, la = class {
1163
- constructor(n, t) {
1164
- this.domNode = n, this.submenu = null, this.submenu = null, this.init(t);
1165
- }
1166
- init(n) {
1167
- this.domNode.setAttribute("tabindex", "0");
1168
- const t = this.domNode.querySelector(`.${n}-menu`);
1169
- t && (this.submenu = new aa(this, t)), this.addListeners();
1170
- }
1171
- addListeners() {
1172
- this.domNode.addEventListener("keydown", (n) => {
1173
- let t = !1;
1174
- switch (n.code) {
1175
- case ie.down: {
1176
- Qe(n.currentTarget, "mouseenter"), this.submenu && this.submenu.gotoSubIndex(0), t = !0;
1177
- break;
1178
- }
1179
- case ie.up: {
1180
- Qe(n.currentTarget, "mouseenter"), this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1), t = !0;
1181
- break;
1182
- }
1183
- case ie.tab: {
1184
- Qe(n.currentTarget, "mouseleave");
1185
- break;
1186
- }
1187
- case ie.enter:
1188
- case ie.space: {
1189
- t = !0, n.currentTarget.click();
1190
- break;
1191
- }
1192
- }
1193
- t && n.preventDefault();
1194
- });
1195
- }
1196
- }, sa = class {
1197
- constructor(n, t) {
1198
- this.domNode = n, this.init(t);
1199
- }
1200
- init(n) {
1201
- const t = this.domNode.childNodes;
1202
- Array.from(t).forEach((o) => {
1203
- o.nodeType === 1 && new la(o, n);
1204
- });
1205
- }
1206
- };
1207
- const ra = D({
1208
- name: "ElMenuCollapseTransition",
1209
- setup() {
1210
- const e = ne("menu");
1211
- return {
1212
- listeners: {
1213
- onBeforeEnter: (t) => t.style.opacity = "0.2",
1214
- onEnter(t, o) {
1215
- Ze(t, `${e.namespace.value}-opacity-transition`), t.style.opacity = "1", o();
1216
- },
1217
- onAfterEnter(t) {
1218
- ut(t, `${e.namespace.value}-opacity-transition`), t.style.opacity = "";
1219
- },
1220
- onBeforeLeave(t) {
1221
- t.dataset || (t.dataset = {}), xn(t, e.m("collapse")) ? (ut(t, e.m("collapse")), t.dataset.oldOverflow = t.style.overflow, t.dataset.scrollWidth = t.clientWidth.toString(), Ze(t, e.m("collapse"))) : (Ze(t, e.m("collapse")), t.dataset.oldOverflow = t.style.overflow, t.dataset.scrollWidth = t.clientWidth.toString(), ut(t, e.m("collapse"))), t.style.width = `${t.scrollWidth}px`, t.style.overflow = "hidden";
1222
- },
1223
- onLeave(t) {
1224
- Ze(t, "horizontal-collapse-transition"), t.style.width = `${t.dataset.scrollWidth}px`;
1225
- }
1226
- }
1227
- };
1228
- }
1229
- });
1230
- function ia(e, n, t, o, s, a) {
1231
- return m(), N(rt, Xt({ mode: "out-in" }, e.listeners), {
1232
- default: M(() => [
1233
- se(e.$slots, "default")
1234
- ]),
1235
- _: 3
1236
- }, 16);
1237
- }
1238
- var ua = /* @__PURE__ */ ce(ra, [["render", ia], ["__file", "menu-collapse-transition.vue"]]);
1239
- function Qt(e, n) {
1240
- const t = E(() => {
1241
- let s = e.parent;
1242
- const a = [n.value];
1243
- for (; s.type.name !== "ElMenu"; )
1244
- s.props.index && a.unshift(s.props.index), s = s.parent;
1245
- return a;
1246
- });
1247
- return {
1248
- parentMenu: E(() => {
1249
- let s = e.parent;
1250
- for (; s && !["ElMenu", "ElSubMenu"].includes(s.type.name); )
1251
- s = s.parent;
1252
- return s;
1253
- }),
1254
- indexPath: t
1255
- };
1256
- }
1257
- function ca(e) {
1258
- return E(() => {
1259
- const t = e.backgroundColor;
1260
- return t ? new En(t).shade(20).toString() : "";
1261
- });
1262
- }
1263
- const en = (e, n) => {
1264
- const t = ne("menu");
1265
- return E(() => t.cssVarBlock({
1266
- "text-color": e.textColor || "",
1267
- "hover-text-color": e.textColor || "",
1268
- "bg-color": e.backgroundColor || "",
1269
- "hover-bg-color": ca(e).value || "",
1270
- "active-color": e.activeTextColor || "",
1271
- level: `${n}`
1272
- }));
1273
- }, da = Ce({
1274
- index: {
1275
- type: String,
1276
- required: !0
1277
- },
1278
- showTimeout: Number,
1279
- hideTimeout: Number,
1280
- popperClass: String,
1281
- disabled: Boolean,
1282
- teleported: {
1283
- type: Boolean,
1284
- default: void 0
1285
- },
1286
- popperOffset: Number,
1287
- expandCloseIcon: {
1288
- type: Ee
1289
- },
1290
- expandOpenIcon: {
1291
- type: Ee
1292
- },
1293
- collapseCloseIcon: {
1294
- type: Ee
1295
- },
1296
- collapseOpenIcon: {
1297
- type: Ee
1298
- }
1299
- }), mt = "ElSubMenu";
1300
- var $t = D({
1301
- name: mt,
1302
- props: da,
1303
- setup(e, { slots: n, expose: t }) {
1304
- const o = ge(), { indexPath: s, parentMenu: a } = Qt(o, E(() => e.index)), l = ne("menu"), u = ne("sub-menu"), i = Le("rootMenu");
1305
- i || tt(mt, "can not inject root menu");
1306
- const c = Le(`subMenu:${a.value.uid}`);
1307
- c || tt(mt, "can not inject sub menu");
1308
- const f = T({}), d = T({});
1309
- let p;
1310
- const v = T(!1), g = T(), w = T(null), S = E(() => V.value === "horizontal" && O.value ? "bottom-start" : "right-start"), P = E(() => V.value === "horizontal" && O.value || V.value === "vertical" && !i.props.collapse ? e.expandCloseIcon && e.expandOpenIcon ? R.value ? e.expandOpenIcon : e.expandCloseIcon : Wt : e.collapseCloseIcon && e.collapseOpenIcon ? R.value ? e.collapseOpenIcon : e.collapseCloseIcon : Tn), O = E(() => c.level === 0), b = E(() => {
1311
- const h = e.teleported;
1312
- return h === void 0 ? O.value : h;
1313
- }), Y = E(() => i.props.collapse ? `${l.namespace.value}-zoom-in-left` : `${l.namespace.value}-zoom-in-top`), Z = E(() => V.value === "horizontal" && O.value ? [
1314
- "bottom-start",
1315
- "bottom-end",
1316
- "top-start",
1317
- "top-end",
1318
- "right-start",
1319
- "left-start"
1320
- ] : [
1321
- "right-start",
1322
- "right",
1323
- "right-end",
1324
- "left-start",
1325
- "bottom-start",
1326
- "bottom-end",
1327
- "top-start",
1328
- "top-end"
1329
- ]), R = E(() => i.openedMenus.includes(e.index)), W = E(() => {
1330
- let h = !1;
1331
- return Object.values(f.value).forEach((A) => {
1332
- A.active && (h = !0);
1333
- }), Object.values(d.value).forEach((A) => {
1334
- A.active && (h = !0);
1335
- }), h;
1336
- }), V = E(() => i.props.mode), j = st({
1337
- index: e.index,
1338
- indexPath: s,
1339
- active: W
1340
- }), ae = en(i.props, c.level + 1), oe = E(() => {
1341
- var h;
1342
- return (h = e.popperOffset) != null ? h : i.props.popperOffset;
1343
- }), de = E(() => {
1344
- var h;
1345
- return (h = e.popperClass) != null ? h : i.props.popperClass;
1346
- }), be = E(() => {
1347
- var h;
1348
- return (h = e.showTimeout) != null ? h : i.props.showTimeout;
1349
- }), x = E(() => {
1350
- var h;
1351
- return (h = e.hideTimeout) != null ? h : i.props.hideTimeout;
1352
- }), I = () => {
1353
- var h, A, F;
1354
- return (F = (A = (h = w.value) == null ? void 0 : h.popperRef) == null ? void 0 : A.popperInstanceRef) == null ? void 0 : F.destroy();
1355
- }, B = (h) => {
1356
- h || I();
1357
- }, X = () => {
1358
- i.props.menuTrigger === "hover" && i.props.mode === "horizontal" || i.props.collapse && i.props.mode === "vertical" || e.disabled || i.handleSubMenuClick({
1359
- index: e.index,
1360
- indexPath: s.value,
1361
- active: W.value
1362
- });
1363
- }, K = (h, A = be.value) => {
1364
- var F;
1365
- if (h.type !== "focus") {
1366
- if (i.props.menuTrigger === "click" && i.props.mode === "horizontal" || !i.props.collapse && i.props.mode === "vertical" || e.disabled) {
1367
- c.mouseInChild.value = !0;
1368
- return;
1369
- }
1370
- c.mouseInChild.value = !0, p == null || p(), { stop: p } = At(() => {
1371
- i.openMenu(e.index, s.value);
1372
- }, A), b.value && ((F = a.value.vnode.el) == null || F.dispatchEvent(new MouseEvent("mouseenter")));
1373
- }
1374
- }, y = (h = !1) => {
1375
- var A;
1376
- if (i.props.menuTrigger === "click" && i.props.mode === "horizontal" || !i.props.collapse && i.props.mode === "vertical") {
1377
- c.mouseInChild.value = !1;
1378
- return;
1379
- }
1380
- p == null || p(), c.mouseInChild.value = !1, { stop: p } = At(() => !v.value && i.closeMenu(e.index, s.value), x.value), b.value && h && ((A = c.handleMouseleave) == null || A.call(c, !0));
1381
- };
1382
- ee(() => i.props.collapse, (h) => B(!!h));
1383
- {
1384
- const h = (F) => {
1385
- d.value[F.index] = F;
1386
- }, A = (F) => {
1387
- delete d.value[F.index];
1388
- };
1389
- We(`subMenu:${o.uid}`, {
1390
- addSubMenu: h,
1391
- removeSubMenu: A,
1392
- handleMouseleave: y,
1393
- mouseInChild: v,
1394
- level: c.level + 1
1395
- });
1396
- }
1397
- return t({
1398
- opened: R
1399
- }), pe(() => {
1400
- i.addSubMenu(j), c.addSubMenu(j);
1401
- }), Gt(() => {
1402
- c.removeSubMenu(j), i.removeSubMenu(j);
1403
- }), () => {
1404
- var h;
1405
- const A = [
1406
- (h = n.title) == null ? void 0 : h.call(n),
1407
- te(we, {
1408
- class: u.e("icon-arrow"),
1409
- style: {
1410
- transform: R.value ? e.expandCloseIcon && e.expandOpenIcon || e.collapseCloseIcon && e.collapseOpenIcon && i.props.collapse ? "none" : "rotateZ(180deg)" : "none"
1411
- }
1412
- }, {
1413
- default: () => ve(P.value) ? te(o.appContext.components[P.value]) : te(P.value)
1414
- })
1415
- ], F = i.isMenuPopup ? te(Ke, {
1416
- ref: w,
1417
- visible: R.value,
1418
- effect: "light",
1419
- pure: !0,
1420
- offset: oe.value,
1421
- showArrow: !1,
1422
- persistent: !0,
1423
- popperClass: de.value,
1424
- placement: S.value,
1425
- teleported: b.value,
1426
- fallbackPlacements: Z.value,
1427
- transition: Y.value,
1428
- gpuAcceleration: !1
1429
- }, {
1430
- content: () => {
1431
- var q;
1432
- return te("div", {
1433
- class: [
1434
- l.m(V.value),
1435
- l.m("popup-container"),
1436
- de.value
1437
- ],
1438
- onMouseenter: (z) => K(z, 100),
1439
- onMouseleave: () => y(!0),
1440
- onFocus: (z) => K(z, 100)
1441
- }, [
1442
- te("ul", {
1443
- class: [
1444
- l.b(),
1445
- l.m("popup"),
1446
- l.m(`popup-${S.value}`)
1447
- ],
1448
- style: ae.value
1449
- }, [(q = n.default) == null ? void 0 : q.call(n)])
1450
- ]);
1451
- },
1452
- default: () => te("div", {
1453
- class: u.e("title"),
1454
- onClick: X
1455
- }, A)
1456
- }) : te(le, {}, [
1457
- te("div", {
1458
- class: u.e("title"),
1459
- ref: g,
1460
- onClick: X
1461
- }, A),
1462
- te(ro, {}, {
1463
- default: () => {
1464
- var q;
1465
- return ye(te("ul", {
1466
- role: "menu",
1467
- class: [l.b(), l.m("inline")],
1468
- style: ae.value
1469
- }, [(q = n.default) == null ? void 0 : q.call(n)]), [[qe, R.value]]);
1470
- }
1471
- })
1472
- ]);
1473
- return te("li", {
1474
- class: [
1475
- u.b(),
1476
- u.is("active", W.value),
1477
- u.is("opened", R.value),
1478
- u.is("disabled", e.disabled)
1479
- ],
1480
- role: "menuitem",
1481
- ariaHaspopup: !0,
1482
- ariaExpanded: R.value,
1483
- onMouseenter: K,
1484
- onMouseleave: () => y(),
1485
- onFocus: K
1486
- }, [F]);
1487
- };
1488
- }
1489
- });
1490
- const fa = Ce({
1491
- mode: {
1492
- type: String,
1493
- values: ["horizontal", "vertical"],
1494
- default: "vertical"
1495
- },
1496
- defaultActive: {
1497
- type: String,
1498
- default: ""
1499
- },
1500
- defaultOpeneds: {
1501
- type: Ve(Array),
1502
- default: () => Pn([])
1503
- },
1504
- uniqueOpened: Boolean,
1505
- router: Boolean,
1506
- menuTrigger: {
1507
- type: String,
1508
- values: ["hover", "click"],
1509
- default: "hover"
1510
- },
1511
- collapse: Boolean,
1512
- backgroundColor: String,
1513
- textColor: String,
1514
- activeTextColor: String,
1515
- closeOnClickOutside: Boolean,
1516
- collapseTransition: {
1517
- type: Boolean,
1518
- default: !0
1519
- },
1520
- ellipsis: {
1521
- type: Boolean,
1522
- default: !0
1523
- },
1524
- popperOffset: {
1525
- type: Number,
1526
- default: 6
1527
- },
1528
- ellipsisIcon: {
1529
- type: Ee,
1530
- default: () => Vn
1531
- },
1532
- popperEffect: {
1533
- type: String,
1534
- values: ["dark", "light"],
1535
- default: "dark"
1536
- },
1537
- popperClass: String,
1538
- showTimeout: {
1539
- type: Number,
1540
- default: 300
1541
- },
1542
- hideTimeout: {
1543
- type: Number,
1544
- default: 300
1545
- }
1546
- }), pt = (e) => Array.isArray(e) && e.every((n) => ve(n)), ma = {
1547
- close: (e, n) => ve(e) && pt(n),
1548
- open: (e, n) => ve(e) && pt(n),
1549
- select: (e, n, t, o) => ve(e) && pt(n) && Ln(t) && (o === void 0 || o instanceof Promise)
1550
- };
1551
- var pa = D({
1552
- name: "ElMenu",
1553
- props: fa,
1554
- emits: ma,
1555
- setup(e, { emit: n, slots: t, expose: o }) {
1556
- const s = ge(), a = s.appContext.config.globalProperties.$router, l = T(), u = ne("menu"), i = ne("sub-menu"), c = T(-1), f = T(e.defaultOpeneds && !e.collapse ? e.defaultOpeneds.slice(0) : []), d = T(e.defaultActive), p = T({}), v = T({}), g = E(() => e.mode === "horizontal" || e.mode === "vertical" && e.collapse), w = () => {
1557
- const x = d.value && p.value[d.value];
1558
- if (!x || e.mode === "horizontal" || e.collapse)
1559
- return;
1560
- x.indexPath.forEach((B) => {
1561
- const X = v.value[B];
1562
- X && S(B, X.indexPath);
1563
- });
1564
- }, S = (x, I) => {
1565
- f.value.includes(x) || (e.uniqueOpened && (f.value = f.value.filter((B) => I.includes(B))), f.value.push(x), n("open", x, I));
1566
- }, P = (x) => {
1567
- const I = f.value.indexOf(x);
1568
- I !== -1 && f.value.splice(I, 1);
1569
- }, O = (x, I) => {
1570
- P(x), n("close", x, I);
1571
- }, b = ({
1572
- index: x,
1573
- indexPath: I
1574
- }) => {
1575
- f.value.includes(x) ? O(x, I) : S(x, I);
1576
- }, Y = (x) => {
1577
- (e.mode === "horizontal" || e.collapse) && (f.value = []);
1578
- const { index: I, indexPath: B } = x;
1579
- if (!(Fe(I) || Fe(B)))
1580
- if (e.router && a) {
1581
- const X = x.route || I, K = a.push(X).then((y) => (y || (d.value = I), y));
1582
- n("select", I, B, { index: I, indexPath: B, route: X }, K);
1583
- } else
1584
- d.value = I, n("select", I, B, { index: I, indexPath: B });
1585
- }, Z = (x) => {
1586
- const I = p.value, B = I[x] || d.value && I[d.value] || I[e.defaultActive];
1587
- B ? d.value = B.index : d.value = x;
1588
- }, R = (x) => {
1589
- const I = getComputedStyle(x), B = Number.parseInt(I.marginLeft, 10), X = Number.parseInt(I.marginRight, 10);
1590
- return x.offsetWidth + B + X || 0;
1591
- }, W = () => {
1592
- var x, I;
1593
- if (!l.value)
1594
- return -1;
1595
- const B = Array.from((I = (x = l.value) == null ? void 0 : x.childNodes) != null ? I : []).filter((z) => z.nodeName !== "#comment" && (z.nodeName !== "#text" || z.nodeValue)), X = 64, K = getComputedStyle(l.value), y = Number.parseInt(K.paddingLeft, 10), h = Number.parseInt(K.paddingRight, 10), A = l.value.clientWidth - y - h;
1596
- let F = 0, q = 0;
1597
- return B.forEach((z, G) => {
1598
- F += R(z), F <= A - X && (q = G + 1);
1599
- }), q === B.length ? -1 : q;
1600
- }, V = (x) => v.value[x].indexPath, j = (x, I = 33.34) => {
1601
- let B;
1602
- return () => {
1603
- B && clearTimeout(B), B = setTimeout(() => {
1604
- x();
1605
- }, I);
1606
- };
1607
- };
1608
- let ae = !0;
1609
- const oe = () => {
1610
- if (c.value === W())
1611
- return;
1612
- const x = () => {
1613
- c.value = -1, $e(() => {
1614
- c.value = W();
1615
- });
1616
- };
1617
- ae ? x() : j(x)(), ae = !1;
1618
- };
1619
- ee(() => e.defaultActive, (x) => {
1620
- p.value[x] || (d.value = ""), Z(x);
1621
- }), ee(() => e.collapse, (x) => {
1622
- x && (f.value = []);
1623
- }), ee(p.value, w);
1624
- let de;
1625
- kt(() => {
1626
- e.mode === "horizontal" && e.ellipsis ? de = In(l, oe).stop : de == null || de();
1627
- });
1628
- const be = T(!1);
1629
- {
1630
- const x = (K) => {
1631
- v.value[K.index] = K;
1632
- }, I = (K) => {
1633
- delete v.value[K.index];
1634
- };
1635
- We("rootMenu", st({
1636
- props: e,
1637
- openedMenus: f,
1638
- items: p,
1639
- subMenus: v,
1640
- activeIndex: d,
1641
- isMenuPopup: g,
1642
- addMenuItem: (K) => {
1643
- p.value[K.index] = K;
1644
- },
1645
- removeMenuItem: (K) => {
1646
- delete p.value[K.index];
1647
- },
1648
- addSubMenu: x,
1649
- removeSubMenu: I,
1650
- openMenu: S,
1651
- closeMenu: O,
1652
- handleMenuItemClick: Y,
1653
- handleSubMenuClick: b
1654
- })), We(`subMenu:${s.uid}`, {
1655
- addSubMenu: x,
1656
- removeSubMenu: I,
1657
- mouseInChild: be,
1658
- level: 0
1659
- });
1660
- }
1661
- return pe(() => {
1662
- e.mode === "horizontal" && new sa(s.vnode.el, u.namespace.value);
1663
- }), o({
1664
- open: (I) => {
1665
- const { indexPath: B } = v.value[I];
1666
- B.forEach((X) => S(X, B));
1667
- },
1668
- close: P,
1669
- handleResize: oe
1670
- }), () => {
1671
- var x, I;
1672
- let B = (I = (x = t.default) == null ? void 0 : x.call(t)) != null ? I : [];
1673
- const X = [];
1674
- if (e.mode === "horizontal" && l.value) {
1675
- const A = An(B), F = c.value === -1 ? A : A.slice(0, c.value), q = c.value === -1 ? [] : A.slice(c.value);
1676
- q != null && q.length && e.ellipsis && (B = F, X.push(te($t, {
1677
- index: "sub-menu-more",
1678
- class: i.e("hide-arrow"),
1679
- popperOffset: e.popperOffset
1680
- }, {
1681
- title: () => te(we, {
1682
- class: i.e("icon-more")
1683
- }, {
1684
- default: () => te(e.ellipsisIcon)
1685
- }),
1686
- default: () => q
1687
- })));
1688
- }
1689
- const K = en(e, 0), y = e.closeOnClickOutside ? [
1690
- [
1691
- Ht,
1692
- () => {
1693
- f.value.length && (be.value || (f.value.forEach((A) => n("close", A, V(A))), f.value = []));
1694
- }
1695
- ]
1696
- ] : [], h = ye(te("ul", {
1697
- key: String(e.collapse),
1698
- role: "menubar",
1699
- ref: l,
1700
- style: K.value,
1701
- class: {
1702
- [u.b()]: !0,
1703
- [u.m(e.mode)]: !0,
1704
- [u.m("collapse")]: e.collapse
1705
- }
1706
- }, [...B, ...X]), y);
1707
- return e.collapseTransition && e.mode === "vertical" ? te(ua, () => h) : h;
1708
- };
1709
- }
1710
- });
1711
- const ha = Ce({
1712
- index: {
1713
- type: Ve([String, null]),
1714
- default: null
1715
- },
1716
- route: {
1717
- type: Ve([String, Object])
1718
- },
1719
- disabled: Boolean
1720
- }), va = {
1721
- click: (e) => ve(e.index) && Array.isArray(e.indexPath)
1722
- }, ht = "ElMenuItem", _a = D({
1723
- name: ht,
1724
- components: {
1725
- ElTooltip: Ke
1726
- },
1727
- props: ha,
1728
- emits: va,
1729
- setup(e, { emit: n }) {
1730
- const t = ge(), o = Le("rootMenu"), s = ne("menu"), a = ne("menu-item");
1731
- o || tt(ht, "can not inject root menu");
1732
- const { parentMenu: l, indexPath: u } = Qt(t, Xn(e, "index")), i = Le(`subMenu:${l.value.uid}`);
1733
- i || tt(ht, "can not inject sub menu");
1734
- const c = E(() => e.index === o.activeIndex), f = st({
1735
- index: e.index,
1736
- indexPath: u,
1737
- active: c
1738
- }), d = () => {
1739
- e.disabled || (o.handleMenuItemClick({
1740
- index: e.index,
1741
- indexPath: u.value,
1742
- route: e.route
1743
- }), n("click", f));
1744
- };
1745
- return pe(() => {
1746
- i.addSubMenu(f), o.addMenuItem(f);
1747
- }), Gt(() => {
1748
- i.removeSubMenu(f), o.removeMenuItem(f);
1749
- }), {
1750
- parentMenu: l,
1751
- rootMenu: o,
1752
- active: c,
1753
- nsMenu: s,
1754
- nsMenuItem: a,
1755
- handleClick: d
1756
- };
1757
- }
1758
- });
1759
- function ga(e, n, t, o, s, a) {
1760
- const l = Oe("el-tooltip");
1761
- return m(), C("li", {
1762
- class: $([
1763
- e.nsMenuItem.b(),
1764
- e.nsMenuItem.is("active", e.active),
1765
- e.nsMenuItem.is("disabled", e.disabled)
1766
- ]),
1767
- role: "menuitem",
1768
- tabindex: "-1",
1769
- onClick: n[0] || (n[0] = (...u) => e.handleClick && e.handleClick(...u))
1770
- }, [
1771
- e.parentMenu.type.name === "ElMenu" && e.rootMenu.props.collapse && e.$slots.title ? (m(), N(l, {
1772
- key: 0,
1773
- effect: e.rootMenu.props.popperEffect,
1774
- placement: "right",
1775
- "fallback-placements": ["left"],
1776
- persistent: ""
1777
- }, {
1778
- content: M(() => [
1779
- se(e.$slots, "title")
1780
- ]),
1781
- default: M(() => [
1782
- k("div", {
1783
- class: $(e.nsMenu.be("tooltip", "trigger"))
1784
- }, [
1785
- se(e.$slots, "default")
1786
- ], 2)
1787
- ]),
1788
- _: 3
1789
- }, 8, ["effect"])) : (m(), C(le, { key: 1 }, [
1790
- se(e.$slots, "default"),
1791
- se(e.$slots, "title")
1792
- ], 64))
1793
- ], 2);
1794
- }
1795
- var tn = /* @__PURE__ */ ce(_a, [["render", ga], ["__file", "menu-item.vue"]]);
1796
- const ba = {
1797
- title: String
1798
- }, ya = "ElMenuItemGroup", ka = D({
1799
- name: ya,
1800
- props: ba,
1801
- setup() {
1802
- return {
1803
- ns: ne("menu-item-group")
1804
- };
1805
- }
1806
- });
1807
- function Ca(e, n, t, o, s, a) {
1808
- return m(), C("li", {
1809
- class: $(e.ns.b())
1810
- }, [
1811
- k("div", {
1812
- class: $(e.ns.e("title"))
1813
- }, [
1814
- e.$slots.title ? se(e.$slots, "title", { key: 1 }) : (m(), C(le, { key: 0 }, [
1815
- Q(U(e.title), 1)
1816
- ], 64))
1817
- ], 2),
1818
- k("ul", null, [
1819
- se(e.$slots, "default")
1820
- ])
1821
- ], 2);
1822
- }
1823
- var nn = /* @__PURE__ */ ce(ka, [["render", Ca], ["__file", "menu-item-group.vue"]]);
1824
- const on = ot(pa, {
1825
- MenuItem: tn,
1826
- MenuItemGroup: nn,
1827
- SubMenu: $t
1828
- }), an = at(tn);
1829
- at(nn);
1830
- const Ma = at($t), $a = /* @__PURE__ */ D({
1831
- __name: "index",
1832
- setup(e) {
1833
- const n = _e(), t = T([
1834
- { label: "默认", value: "default" },
1835
- { label: "大型", value: "large" },
1836
- { label: "小型", value: "small" }
1837
- ]);
1838
- function o(s) {
1839
- n.changeSize(s), Nn.success("切换布局大小成功");
1840
- }
1841
- return (s, a) => {
1842
- const l = Ne, u = Ut, i = Kt, c = jt;
1843
- return m(), N(c, {
1844
- trigger: "click",
1845
- onCommand: o
1846
- }, {
1847
- dropdown: M(() => [
1848
- _(i, null, {
1849
- default: M(() => [
1850
- (m(!0), C(le, null, xe(r(t), (f) => (m(), N(u, {
1851
- key: f.value,
1852
- disabled: r(n).size == f.value,
1853
- command: f.value
1854
- }, {
1855
- default: M(() => [
1856
- Q(U(f.label), 1)
1857
- ]),
1858
- _: 2
1859
- }, 1032, ["disabled", "command"]))), 128))
1860
- ]),
1861
- _: 1
1862
- })
1863
- ]),
1864
- default: M(() => [
1865
- k("div", null, [
1866
- _(l, { "icon-class": "size" })
1867
- ])
1868
- ]),
1869
- _: 1
1870
- });
1871
- };
1872
- }
1873
- }), wa = { class: "flex" }, Sa = { class: "flex-center h100% p10px" }, xa = ["src"], Ea = /* @__PURE__ */ D({
1874
- __name: "NavbarRight",
1875
- setup(e) {
1876
- const n = _e(), t = bt(), o = On(), s = Se(), a = Xe(), l = Ct(), u = E(() => n.device === Je.MOBILE), i = T(!1), c = T(!1), { isFullscreen: f, toggle: d } = Rn(), p = E(() => Bn.imageUrl(o.user.avatar, 48, 48));
1877
- function v() {
1878
- c.value = !0;
1879
- }
1880
- function g() {
1881
- lo.confirm("确定注销并退出系统吗?", "提示", {
1882
- confirmButtonText: "确定",
1883
- cancelButtonText: "取消",
1884
- type: "warning",
1885
- lockScroll: !1
1886
- }).then(() => {
1887
- o.logout().then(() => {
1888
- t.delAllViews();
1889
- }).then(() => {
1890
- l.push(`/login?redirect=${a.fullPath}`);
1891
- });
1892
- });
1893
- }
1894
- function w(S) {
1895
- i.value = S;
1896
- }
1897
- return (S, P) => {
1898
- const O = Ne, b = $a, Y = Ke, Z = Fn, R = Oe("router-link"), W = Ut, V = Kt, j = jt, ae = Gn("hasRole");
1899
- return m(), C("div", wa, [
1900
- r(u) ? H("", !0) : (m(), C(le, { key: 0 }, [
1901
- k("div", {
1902
- class: "setting-item",
1903
- onClick: P[0] || (P[0] = //@ts-ignore
1904
- (...oe) => r(d) && r(d)(...oe))
1905
- }, [
1906
- _(O, {
1907
- "icon-class": r(f) ? "fullscreen-exit" : "fullscreen"
1908
- }, null, 8, ["icon-class"])
1909
- ]),
1910
- _(Y, {
1911
- content: S.$t("sizeSelect.tooltip"),
1912
- effect: "dark",
1913
- placement: "bottom"
1914
- }, {
1915
- default: M(() => [
1916
- _(b, { class: "setting-item" })
1917
- ]),
1918
- _: 1
1919
- }, 8, ["content"]),
1920
- _(Z, { class: "setting-item" })
1921
- ], 64)),
1922
- _(j, {
1923
- class: "setting-item",
1924
- trigger: "click"
1925
- }, {
1926
- dropdown: M(() => [
1927
- _(V, null, {
1928
- default: M(() => [
1929
- _(W, null, {
1930
- default: M(() => [
1931
- _(R, { to: "/" }, {
1932
- default: M(() => [
1933
- Q(U(S.$t("navbar.Dashboard")), 1)
1934
- ]),
1935
- _: 1
1936
- })
1937
- ]),
1938
- _: 1
1939
- }),
1940
- _(W, null, {
1941
- default: M(() => [
1942
- _(R, { to: "/my/profile" }, {
1943
- default: M(() => [
1944
- Q(U(S.$t("navbar.profile")), 1)
1945
- ]),
1946
- _: 1
1947
- })
1948
- ]),
1949
- _: 1
1950
- }),
1951
- _(W, {
1952
- onClick: P[1] || (P[1] = (oe) => i.value = !0)
1953
- }, {
1954
- default: M(() => [
1955
- Q(U(S.$t("navbar.changePwd")), 1)
1956
- ]),
1957
- _: 1
1958
- }),
1959
- ye((m(), C("div", null, [
1960
- _(W, { onClick: v }, {
1961
- default: M(() => [
1962
- Q(U(S.$t("navbar.runAs")), 1)
1963
- ]),
1964
- _: 1
1965
- })
1966
- ])), [
1967
- [ae, ["tester"]]
1968
- ]),
1969
- _(W, {
1970
- divided: "",
1971
- onClick: g
1972
- }, {
1973
- default: M(() => [
1974
- Q(U(S.$t("navbar.logout")), 1)
1975
- ]),
1976
- _: 1
1977
- })
1978
- ]),
1979
- _: 1
1980
- })
1981
- ]),
1982
- default: M(() => [
1983
- k("div", Sa, [
1984
- k("img", {
1985
- src: r(p),
1986
- class: "rounded-full mr-10px w24px w24px"
1987
- }, null, 8, xa),
1988
- k("span", null, U(r(o).user.nickName), 1)
1989
- ])
1990
- ]),
1991
- _: 1
1992
- }),
1993
- r(ze).showSettings ? (m(), C("div", {
1994
- key: 1,
1995
- class: "setting-item",
1996
- onClick: P[2] || (P[2] = (oe) => r(s).settingsVisible = !0)
1997
- }, [
1998
- _(O, { "icon-class": "setting" })
1999
- ])) : H("", !0),
2000
- r(i) ? (m(), N(oo, {
2001
- key: 2,
2002
- "pwd-visible": r(i),
2003
- onDialogActionChange: w
2004
- }, null, 8, ["pwd-visible"])) : H("", !0),
2005
- r(c) ? (m(), N(ao, {
2006
- key: 3,
2007
- modelValue: r(c),
2008
- "onUpdate:modelValue": P[3] || (P[3] = (oe) => nt(c) ? c.value = oe : null)
2009
- }, null, 8, ["modelValue"])) : H("", !0)
2010
- ]);
2011
- };
2012
- }
2013
- }), ln = /* @__PURE__ */ ue(Ea, [["__scopeId", "data-v-52075715"]]);
2014
- function Ta(e) {
2015
- for (var n = [], t = 0; t < e.length; ) {
2016
- var o = e[t];
2017
- if (o === "*" || o === "+" || o === "?") {
2018
- n.push({ type: "MODIFIER", index: t, value: e[t++] });
2019
- continue;
2020
- }
2021
- if (o === "\\") {
2022
- n.push({ type: "ESCAPED_CHAR", index: t++, value: e[t++] });
2023
- continue;
2024
- }
2025
- if (o === "{") {
2026
- n.push({ type: "OPEN", index: t, value: e[t++] });
2027
- continue;
2028
- }
2029
- if (o === "}") {
2030
- n.push({ type: "CLOSE", index: t, value: e[t++] });
2031
- continue;
2032
- }
2033
- if (o === ":") {
2034
- for (var s = "", a = t + 1; a < e.length; ) {
2035
- var l = e.charCodeAt(a);
2036
- if (
2037
- // `0-9`
2038
- l >= 48 && l <= 57 || // `A-Z`
2039
- l >= 65 && l <= 90 || // `a-z`
2040
- l >= 97 && l <= 122 || // `_`
2041
- l === 95
2042
- ) {
2043
- s += e[a++];
2044
- continue;
2045
- }
2046
- break;
2047
- }
2048
- if (!s)
2049
- throw new TypeError("Missing parameter name at ".concat(t));
2050
- n.push({ type: "NAME", index: t, value: s }), t = a;
2051
- continue;
2052
- }
2053
- if (o === "(") {
2054
- var u = 1, i = "", a = t + 1;
2055
- if (e[a] === "?")
2056
- throw new TypeError('Pattern cannot start with "?" at '.concat(a));
2057
- for (; a < e.length; ) {
2058
- if (e[a] === "\\") {
2059
- i += e[a++] + e[a++];
2060
- continue;
2061
- }
2062
- if (e[a] === ")") {
2063
- if (u--, u === 0) {
2064
- a++;
2065
- break;
2066
- }
2067
- } else if (e[a] === "(" && (u++, e[a + 1] !== "?"))
2068
- throw new TypeError("Capturing groups are not allowed at ".concat(a));
2069
- i += e[a++];
2070
- }
2071
- if (u)
2072
- throw new TypeError("Unbalanced pattern at ".concat(t));
2073
- if (!i)
2074
- throw new TypeError("Missing pattern at ".concat(t));
2075
- n.push({ type: "PATTERN", index: t, value: i }), t = a;
2076
- continue;
2077
- }
2078
- n.push({ type: "CHAR", index: t, value: e[t++] });
2079
- }
2080
- return n.push({ type: "END", index: t, value: "" }), n;
2081
- }
2082
- function Ia(e, n) {
2083
- n === void 0 && (n = {});
2084
- for (var t = Ta(e), o = n.prefixes, s = o === void 0 ? "./" : o, a = "[^".concat(Va(n.delimiter || "/#?"), "]+?"), l = [], u = 0, i = 0, c = "", f = function(R) {
2085
- if (i < t.length && t[i].type === R)
2086
- return t[i++].value;
2087
- }, d = function(R) {
2088
- var W = f(R);
2089
- if (W !== void 0)
2090
- return W;
2091
- var V = t[i], j = V.type, ae = V.index;
2092
- throw new TypeError("Unexpected ".concat(j, " at ").concat(ae, ", expected ").concat(R));
2093
- }, p = function() {
2094
- for (var R = "", W; W = f("CHAR") || f("ESCAPED_CHAR"); )
2095
- R += W;
2096
- return R;
2097
- }; i < t.length; ) {
2098
- var v = f("CHAR"), g = f("NAME"), w = f("PATTERN");
2099
- if (g || w) {
2100
- var S = v || "";
2101
- s.indexOf(S) === -1 && (c += S, S = ""), c && (l.push(c), c = ""), l.push({
2102
- name: g || u++,
2103
- prefix: S,
2104
- suffix: "",
2105
- pattern: w || a,
2106
- modifier: f("MODIFIER") || ""
2107
- });
2108
- continue;
2109
- }
2110
- var P = v || f("ESCAPED_CHAR");
2111
- if (P) {
2112
- c += P;
2113
- continue;
2114
- }
2115
- c && (l.push(c), c = "");
2116
- var O = f("OPEN");
2117
- if (O) {
2118
- var S = p(), b = f("NAME") || "", Y = f("PATTERN") || "", Z = p();
2119
- d("CLOSE"), l.push({
2120
- name: b || (Y ? u++ : ""),
2121
- pattern: b && !Y ? a : Y,
2122
- prefix: S,
2123
- suffix: Z,
2124
- modifier: f("MODIFIER") || ""
2125
- });
2126
- continue;
2127
- }
2128
- d("END");
2129
- }
2130
- return l;
2131
- }
2132
- function Aa(e, n) {
2133
- return Pa(Ia(e, n), n);
2134
- }
2135
- function Pa(e, n) {
2136
- n === void 0 && (n = {});
2137
- var t = La(n), o = n.encode, s = o === void 0 ? function(i) {
2138
- return i;
2139
- } : o, a = n.validate, l = a === void 0 ? !0 : a, u = e.map(function(i) {
2140
- if (typeof i == "object")
2141
- return new RegExp("^(?:".concat(i.pattern, ")$"), t);
2142
- });
2143
- return function(i) {
2144
- for (var c = "", f = 0; f < e.length; f++) {
2145
- var d = e[f];
2146
- if (typeof d == "string") {
2147
- c += d;
2148
- continue;
2149
- }
2150
- var p = i ? i[d.name] : void 0, v = d.modifier === "?" || d.modifier === "*", g = d.modifier === "*" || d.modifier === "+";
2151
- if (Array.isArray(p)) {
2152
- if (!g)
2153
- throw new TypeError('Expected "'.concat(d.name, '" to not repeat, but got an array'));
2154
- if (p.length === 0) {
2155
- if (v)
2156
- continue;
2157
- throw new TypeError('Expected "'.concat(d.name, '" to not be empty'));
2158
- }
2159
- for (var w = 0; w < p.length; w++) {
2160
- var S = s(p[w], d);
2161
- if (l && !u[f].test(S))
2162
- throw new TypeError('Expected all "'.concat(d.name, '" to match "').concat(d.pattern, '", but got "').concat(S, '"'));
2163
- c += d.prefix + S + d.suffix;
2164
- }
2165
- continue;
2166
- }
2167
- if (typeof p == "string" || typeof p == "number") {
2168
- var S = s(String(p), d);
2169
- if (l && !u[f].test(S))
2170
- throw new TypeError('Expected "'.concat(d.name, '" to match "').concat(d.pattern, '", but got "').concat(S, '"'));
2171
- c += d.prefix + S + d.suffix;
2172
- continue;
2173
- }
2174
- if (!v) {
2175
- var P = g ? "an array" : "a string";
2176
- throw new TypeError('Expected "'.concat(d.name, '" to be ').concat(P));
2177
- }
2178
- }
2179
- return c;
2180
- };
2181
- }
2182
- function Va(e) {
2183
- return e.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
2184
- }
2185
- function La(e) {
2186
- return e && e.sensitive ? "" : "i";
2187
- }
2188
- function gt(e) {
2189
- var n, t;
2190
- return it((n = e.name) == null ? void 0 : n.toString(), (t = e.meta) == null ? void 0 : t.title);
2191
- }
2192
- function Na(e) {
2193
- return it(e.name, e.title);
2194
- }
2195
- function it(e, n) {
2196
- let t = e && e != "" ? e : n;
2197
- return Pt.global.te("route." + t) ? Pt.global.t("route." + t) : n || e;
2198
- }
2199
- const Oa = {
2200
- key: 0,
2201
- class: "color-gray-400"
2202
- }, Ra = ["onClick"], Ba = /* @__PURE__ */ D({
2203
- __name: "index",
2204
- setup(e) {
2205
- const n = Xe(), t = (u) => {
2206
- const { params: i } = n;
2207
- return Aa(u)(i);
2208
- }, o = T([]);
2209
- function s() {
2210
- let u = n.matched.filter(
2211
- (c) => c.meta && c.meta.title
2212
- );
2213
- const i = u[0];
2214
- a(i) || (u = [
2215
- { path: "/dashboard", meta: { title: "Dashboard" } }
2216
- ].concat(u)), o.value = u.filter((c) => c.meta && c.meta.title && c.meta.breadcrumb !== !1);
2217
- }
2218
- function a(u) {
2219
- const i = u && u.name;
2220
- return i ? i.toString().trim().toLocaleLowerCase() === "Dashboard".toLocaleLowerCase() : !1;
2221
- }
2222
- function l(u) {
2223
- const { redirect: i, path: c } = u;
2224
- if (i) {
2225
- Vt.value.push(i).catch((f) => {
2226
- console.warn(f);
2227
- });
2228
- return;
2229
- }
2230
- Vt.value.push(t(c)).catch((f) => {
2231
- console.warn(f);
2232
- });
2233
- }
2234
- return ee(
2235
- () => n.path,
2236
- (u) => {
2237
- u.startsWith("/redirect/") || s();
2238
- }
2239
- ), Yn(() => {
2240
- s();
2241
- }), (u, i) => {
2242
- const c = _o, f = vo;
2243
- return m(), N(f, { class: "flex-y-center" }, {
2244
- default: M(() => [
2245
- _(Zn, { "enter-active-class": "animate__animated animate__fadeInRight" }, {
2246
- default: M(() => [
2247
- (m(!0), C(le, null, xe(r(o), (d, p) => (m(), N(c, {
2248
- key: d.path
2249
- }, {
2250
- default: M(() => [
2251
- d.redirect === "noredirect" || p === r(o).length - 1 ? (m(), C("span", Oa, U(r(gt)(d)), 1)) : (m(), C("a", {
2252
- key: 1,
2253
- onClick: Te((v) => l(d), ["prevent"])
2254
- }, U(r(gt)(d)), 9, Ra))
2255
- ]),
2256
- _: 2
2257
- }, 1024))), 128))
2258
- ]),
2259
- _: 1
2260
- })
2261
- ]),
2262
- _: 1
2263
- });
2264
- };
2265
- }
2266
- }), Fa = /* @__PURE__ */ ue(Ba, [["__scopeId", "data-v-6109c28e"]]), Da = /* @__PURE__ */ D({
2267
- __name: "index",
2268
- props: {
2269
- isActive: {
2270
- required: !0,
2271
- type: Boolean,
2272
- default: !1
2273
- }
2274
- },
2275
- emits: ["toggleClick"],
2276
- setup(e, { emit: n }) {
2277
- const t = n;
2278
- function o() {
2279
- t("toggleClick");
2280
- }
2281
- return (s, a) => {
2282
- const l = Ne;
2283
- return m(), C("div", {
2284
- class: "px-[15px] flex items-center justify-center color-[var(--el-text-color-regular)]",
2285
- onClick: o
2286
- }, [
2287
- _(l, {
2288
- class: $(["hamburger", { "is-active": e.isActive }]),
2289
- "icon-class": "indent-decrease"
2290
- }, null, 8, ["class"])
2291
- ]);
2292
- };
2293
- }
2294
- }), sn = /* @__PURE__ */ ue(Da, [["__scopeId", "data-v-42e37629"]]), za = { class: "flex" }, Ha = /* @__PURE__ */ D({
2295
- __name: "NavbarLeft",
2296
- setup(e) {
2297
- const n = _e();
2298
- function t() {
2299
- n.toggleSidebar();
2300
- }
2301
- return (o, s) => {
2302
- const a = sn, l = Fa;
2303
- return m(), C("div", za, [
2304
- _(a, {
2305
- "is-active": r(n).sidebar.opened,
2306
- onToggleClick: t
2307
- }, null, 8, ["is-active"]),
2308
- _(l)
2309
- ]);
2310
- };
2311
- }
2312
- }), Wa = {}, qa = { class: "navbar-container" };
2313
- function Ua(e, n) {
2314
- const t = Ha, o = ln;
2315
- return m(), C("div", qa, [
2316
- _(t),
2317
- _(o)
2318
- ]);
2319
- }
2320
- const Ka = /* @__PURE__ */ ue(Wa, [["render", Ua], ["__scopeId", "data-v-b1624593"]]);
2321
- var he = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.TOP = "top", e.MIX = "mix", e))(he || {});
2322
- const Re = (e) => (Jn("data-v-2bdf1403"), e = e(), Qn(), e), ja = { class: "flex flex-wrap justify-around w-full h-12" }, Xa = /* @__PURE__ */ Re(() => /* @__PURE__ */ k("div", null, null, -1)), Ga = /* @__PURE__ */ Re(() => /* @__PURE__ */ k("div", null, null, -1)), Ya = [
2323
- Xa,
2324
- Ga
2325
- ], Za = /* @__PURE__ */ Re(() => /* @__PURE__ */ k("div", null, null, -1)), Ja = /* @__PURE__ */ Re(() => /* @__PURE__ */ k("div", null, null, -1)), Qa = [
2326
- Za,
2327
- Ja
2328
- ], el = /* @__PURE__ */ Re(() => /* @__PURE__ */ k("div", null, null, -1)), tl = /* @__PURE__ */ Re(() => /* @__PURE__ */ k("div", null, null, -1)), nl = [
2329
- el,
2330
- tl
2331
- ], ol = /* @__PURE__ */ D({
2332
- __name: "LayoutSelect",
2333
- props: {
2334
- modelValue: String
2335
- },
2336
- emits: ["update:modelValue"],
2337
- setup(e, { emit: n }) {
2338
- const t = n;
2339
- function o(s) {
2340
- t("update:modelValue", s);
2341
- }
2342
- return (s, a) => {
2343
- const l = Ke;
2344
- return m(), C("div", ja, [
2345
- _(l, {
2346
- content: "左侧模式",
2347
- placement: "bottom"
2348
- }, {
2349
- default: M(() => [
2350
- k("div", {
2351
- class: $(["layout-item left", { "is-active": e.modelValue === r(he).LEFT }]),
2352
- onClick: a[0] || (a[0] = (u) => o(r(he).LEFT))
2353
- }, Ya, 2)
2354
- ]),
2355
- _: 1
2356
- }),
2357
- _(l, {
2358
- content: "顶部模式",
2359
- placement: "bottom"
2360
- }, {
2361
- default: M(() => [
2362
- k("div", {
2363
- class: $(["layout-item top", { "is-active": e.modelValue === r(he).TOP }]),
2364
- onClick: a[1] || (a[1] = (u) => o(r(he).TOP))
2365
- }, Qa, 2)
2366
- ]),
2367
- _: 1
2368
- }),
2369
- _(l, {
2370
- content: "混合模式",
2371
- placement: "bottom"
2372
- }, {
2373
- default: M(() => [
2374
- k("div", {
2375
- class: $(["layout-item mix", { "is-active": e.modelValue === r(he).MIX }]),
2376
- onClick: a[2] || (a[2] = (u) => o(r(he).MIX))
2377
- }, nl, 2)
2378
- ]),
2379
- _: 1
2380
- })
2381
- ]);
2382
- };
2383
- }
2384
- }), al = /* @__PURE__ */ ue(ol, [["__scopeId", "data-v-2bdf1403"]]), ll = /* @__PURE__ */ D({
2385
- __name: "ThemeColorPicker",
2386
- props: {
2387
- modelValue: String
2388
- },
2389
- emits: ["update:modelValue"],
2390
- setup(e, { emit: n }) {
2391
- const t = e, o = n, s = [
2392
- "#409EFF",
2393
- "#ff4500",
2394
- "#ff8c00",
2395
- "#90ee90",
2396
- "#00ced1",
2397
- "#1e90ff",
2398
- "#c71585",
2399
- "rgba(255, 69, 0, 0.68)",
2400
- "rgb(255, 120, 0)",
2401
- "hsva(120, 40, 94)"
2402
- ], a = T(t.modelValue);
2403
- return ee(a, (l) => {
2404
- o("update:modelValue", l);
2405
- }), (l, u) => {
2406
- const i = jo;
2407
- return m(), N(i, {
2408
- modelValue: r(a),
2409
- "onUpdate:modelValue": u[0] || (u[0] = (c) => nt(a) ? a.value = c : null),
2410
- predefine: s,
2411
- "popper-class": "theme-picker-dropdown"
2412
- }, null, 8, ["modelValue"]);
2413
- };
2414
- }
2415
- }), sl = /* @__PURE__ */ ue(ll, [["__scopeId", "data-v-92c1fd79"]]), rl = { class: "flex-center" }, il = { class: "settings-option" }, ul = { class: "text-xs" }, cl = { class: "settings-option" }, dl = { class: "text-xs" }, fl = { class: "settings-option" }, ml = { class: "text-xs" }, pl = { class: "settings-option" }, hl = { class: "text-xs" }, vl = { class: "settings-option" }, _l = { class: "text-xs" }, gl = /* @__PURE__ */ D({
2416
- __name: "index",
2417
- setup(e) {
2418
- const n = Xe(), t = _e(), o = Se(), s = je(), a = E({
2419
- get() {
2420
- return o.settingsVisible;
2421
- },
2422
- set() {
2423
- o.settingsVisible = !1;
2424
- }
2425
- });
2426
- function l(p) {
2427
- o.changeThemeColor(p);
2428
- }
2429
- const u = T(o.theme === ct.DARK), i = (p) => {
2430
- u.value = p, o.changeTheme(u.value ? ct.DARK : ct.LIGHT);
2431
- };
2432
- function c(p) {
2433
- o.changeLayout(p), p === he.MIX ? n.name && f(n.name) : p === he.TOP && t.openSideBar();
2434
- }
2435
- function f(p) {
2436
- const v = d(s.routes, p);
2437
- t.activeTopMenu !== v.path && t.activeTopMenu(v.path);
2438
- }
2439
- function d(p, v) {
2440
- let g = {};
2441
- function w(P, O) {
2442
- if (g[P.name] = O, P.children)
2443
- for (let b = 0; b < P.children.length; b++)
2444
- w(P.children[b], P);
2445
- }
2446
- for (let P = 0; P < p.length; P++)
2447
- w(p[P], null);
2448
- let S = g[v];
2449
- for (; S; ) {
2450
- if (!g[S.name])
2451
- return S;
2452
- S = g[S.name];
2453
- }
2454
- return null;
2455
- }
2456
- return (p, v) => {
2457
- const g = Hn, w = Wn, S = sl, P = al, O = oa;
2458
- return m(), N(O, {
2459
- modelValue: r(a),
2460
- "onUpdate:modelValue": v[7] || (v[7] = (b) => nt(a) ? a.value = b : null),
2461
- size: "300",
2462
- title: p.$t("settings.project")
2463
- }, {
2464
- default: M(() => [
2465
- _(g, null, {
2466
- default: M(() => [
2467
- Q(U(p.$t("settings.theme")), 1)
2468
- ]),
2469
- _: 1
2470
- }),
2471
- k("div", rl, [
2472
- _(w, {
2473
- modelValue: r(u),
2474
- "onUpdate:modelValue": v[0] || (v[0] = (b) => nt(u) ? u.value = b : null),
2475
- "active-icon": r(Dn),
2476
- "inactive-icon": r(zn),
2477
- onChange: i
2478
- }, null, 8, ["modelValue", "active-icon", "inactive-icon"])
2479
- ]),
2480
- _(g, null, {
2481
- default: M(() => [
2482
- Q(U(p.$t("settings.interface")), 1)
2483
- ]),
2484
- _: 1
2485
- }),
2486
- k("div", il, [
2487
- k("span", ul, U(p.$t("settings.themeColor")), 1),
2488
- _(S, {
2489
- modelValue: r(o).themeColor,
2490
- "onUpdate:modelValue": [
2491
- v[1] || (v[1] = (b) => r(o).themeColor = b),
2492
- l
2493
- ]
2494
- }, null, 8, ["modelValue"])
2495
- ]),
2496
- k("div", cl, [
2497
- k("span", dl, U(p.$t("settings.tagsView")), 1),
2498
- _(w, {
2499
- modelValue: r(o).tagsView,
2500
- "onUpdate:modelValue": v[2] || (v[2] = (b) => r(o).tagsView = b)
2501
- }, null, 8, ["modelValue"])
2502
- ]),
2503
- k("div", fl, [
2504
- k("span", ml, U(p.$t("settings.fixedHeader")), 1),
2505
- _(w, {
2506
- modelValue: r(o).fixedHeader,
2507
- "onUpdate:modelValue": v[3] || (v[3] = (b) => r(o).fixedHeader = b)
2508
- }, null, 8, ["modelValue"])
2509
- ]),
2510
- k("div", pl, [
2511
- k("span", hl, U(p.$t("settings.sidebarLogo")), 1),
2512
- _(w, {
2513
- modelValue: r(o).sidebarLogo,
2514
- "onUpdate:modelValue": v[4] || (v[4] = (b) => r(o).sidebarLogo = b)
2515
- }, null, 8, ["modelValue"])
2516
- ]),
2517
- k("div", vl, [
2518
- k("span", _l, U(p.$t("settings.watermark")), 1),
2519
- _(w, {
2520
- modelValue: r(o).watermarkEnabled,
2521
- "onUpdate:modelValue": v[5] || (v[5] = (b) => r(o).watermarkEnabled = b)
2522
- }, null, 8, ["modelValue"])
2523
- ]),
2524
- _(g, null, {
2525
- default: M(() => [
2526
- Q(U(p.$t("settings.navigation")), 1)
2527
- ]),
2528
- _: 1
2529
- }),
2530
- _(P, {
2531
- modelValue: r(o).layout,
2532
- "onUpdate:modelValue": [
2533
- v[6] || (v[6] = (b) => r(o).layout = b),
2534
- c
2535
- ]
2536
- }, null, 8, ["modelValue"])
2537
- ]),
2538
- _: 1
2539
- }, 8, ["modelValue", "title"]);
2540
- };
2541
- }
2542
- }), bl = /* @__PURE__ */ ue(gl, [["__scopeId", "data-v-70f5bf10"]]), yl = { class: "app-main" }, kl = /* @__PURE__ */ D({
2543
- __name: "index",
2544
- setup(e) {
2545
- const n = E(() => bt().cachedViews);
2546
- return (t, o) => {
2547
- const s = Oe("router-view");
2548
- return m(), C("section", yl, [
2549
- _(s, null, {
2550
- default: M(({ Component: a, route: l }) => [
2551
- _(rt, {
2552
- "enter-active-class": "animate__animated animate__fadeIn",
2553
- mode: "out-in"
2554
- }, {
2555
- default: M(() => [
2556
- (m(), N(eo, { include: r(n) }, [
2557
- (m(), N(lt(a), {
2558
- key: l.path
2559
- }))
2560
- ], 1032, ["include"]))
2561
- ]),
2562
- _: 2
2563
- }, 1024)
2564
- ]),
2565
- _: 1
2566
- })
2567
- ]);
2568
- };
2569
- }
2570
- }), Cl = /* @__PURE__ */ ue(kl, [["__scopeId", "data-v-37d096bd"]]), Ml = {
2571
- viewBox: "0 0 1024 1024",
2572
- width: "1.2em",
2573
- height: "1.2em"
2574
- }, $l = /* @__PURE__ */ k("path", {
2575
- fill: "currentColor",
2576
- d: "M764.288 214.592L512 466.88L259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512L214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
2577
- }, null, -1), wl = [
2578
- $l
2579
- ];
2580
- function Sl(e, n) {
2581
- return m(), C("svg", Ml, [...wl]);
2582
- }
2583
- const xl = { name: "ep-close", render: Sl };
2584
- function me(e) {
2585
- if (typeof e != "string")
2586
- throw new TypeError("Path must be a string. Received " + JSON.stringify(e));
2587
- }
2588
- function Dt(e, n) {
2589
- for (var t = "", o = 0, s = -1, a = 0, l, u = 0; u <= e.length; ++u) {
2590
- if (u < e.length)
2591
- l = e.charCodeAt(u);
2592
- else {
2593
- if (l === 47)
2594
- break;
2595
- l = 47;
2596
- }
2597
- if (l === 47) {
2598
- if (!(s === u - 1 || a === 1))
2599
- if (s !== u - 1 && a === 2) {
2600
- if (t.length < 2 || o !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
2601
- if (t.length > 2) {
2602
- var i = t.lastIndexOf("/");
2603
- if (i !== t.length - 1) {
2604
- i === -1 ? (t = "", o = 0) : (t = t.slice(0, i), o = t.length - 1 - t.lastIndexOf("/")), s = u, a = 0;
2605
- continue;
2606
- }
2607
- } else if (t.length === 2 || t.length === 1) {
2608
- t = "", o = 0, s = u, a = 0;
2609
- continue;
2610
- }
2611
- }
2612
- n && (t.length > 0 ? t += "/.." : t = "..", o = 2);
2613
- } else
2614
- t.length > 0 ? t += "/" + e.slice(s + 1, u) : t = e.slice(s + 1, u), o = u - s - 1;
2615
- s = u, a = 0;
2616
- } else
2617
- l === 46 && a !== -1 ? ++a : a = -1;
2618
- }
2619
- return t;
2620
- }
2621
- function El(e, n) {
2622
- var t = n.dir || n.root, o = n.base || (n.name || "") + (n.ext || "");
2623
- return t ? t === n.root ? t + o : t + e + o : o;
2624
- }
2625
- var Ae = {
2626
- // path.resolve([from ...], to)
2627
- resolve: function() {
2628
- for (var n = "", t = !1, o, s = arguments.length - 1; s >= -1 && !t; s--) {
2629
- var a;
2630
- s >= 0 ? a = arguments[s] : (o === void 0 && (o = process.cwd()), a = o), me(a), a.length !== 0 && (n = a + "/" + n, t = a.charCodeAt(0) === 47);
2631
- }
2632
- return n = Dt(n, !t), t ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
2633
- },
2634
- normalize: function(n) {
2635
- if (me(n), n.length === 0)
2636
- return ".";
2637
- var t = n.charCodeAt(0) === 47, o = n.charCodeAt(n.length - 1) === 47;
2638
- return n = Dt(n, !t), n.length === 0 && !t && (n = "."), n.length > 0 && o && (n += "/"), t ? "/" + n : n;
2639
- },
2640
- isAbsolute: function(n) {
2641
- return me(n), n.length > 0 && n.charCodeAt(0) === 47;
2642
- },
2643
- join: function() {
2644
- if (arguments.length === 0)
2645
- return ".";
2646
- for (var n, t = 0; t < arguments.length; ++t) {
2647
- var o = arguments[t];
2648
- me(o), o.length > 0 && (n === void 0 ? n = o : n += "/" + o);
2649
- }
2650
- return n === void 0 ? "." : Ae.normalize(n);
2651
- },
2652
- relative: function(n, t) {
2653
- if (me(n), me(t), n === t || (n = Ae.resolve(n), t = Ae.resolve(t), n === t))
2654
- return "";
2655
- for (var o = 1; o < n.length && n.charCodeAt(o) === 47; ++o)
2656
- ;
2657
- for (var s = n.length, a = s - o, l = 1; l < t.length && t.charCodeAt(l) === 47; ++l)
2658
- ;
2659
- for (var u = t.length, i = u - l, c = a < i ? a : i, f = -1, d = 0; d <= c; ++d) {
2660
- if (d === c) {
2661
- if (i > c) {
2662
- if (t.charCodeAt(l + d) === 47)
2663
- return t.slice(l + d + 1);
2664
- if (d === 0)
2665
- return t.slice(l + d);
2666
- } else
2667
- a > c && (n.charCodeAt(o + d) === 47 ? f = d : d === 0 && (f = 0));
2668
- break;
2669
- }
2670
- var p = n.charCodeAt(o + d), v = t.charCodeAt(l + d);
2671
- if (p !== v)
2672
- break;
2673
- p === 47 && (f = d);
2674
- }
2675
- var g = "";
2676
- for (d = o + f + 1; d <= s; ++d)
2677
- (d === s || n.charCodeAt(d) === 47) && (g.length === 0 ? g += ".." : g += "/..");
2678
- return g.length > 0 ? g + t.slice(l + f) : (l += f, t.charCodeAt(l) === 47 && ++l, t.slice(l));
2679
- },
2680
- _makeLong: function(n) {
2681
- return n;
2682
- },
2683
- dirname: function(n) {
2684
- if (me(n), n.length === 0)
2685
- return ".";
2686
- for (var t = n.charCodeAt(0), o = t === 47, s = -1, a = !0, l = n.length - 1; l >= 1; --l)
2687
- if (t = n.charCodeAt(l), t === 47) {
2688
- if (!a) {
2689
- s = l;
2690
- break;
2691
- }
2692
- } else
2693
- a = !1;
2694
- return s === -1 ? o ? "/" : "." : o && s === 1 ? "//" : n.slice(0, s);
2695
- },
2696
- basename: function(n, t) {
2697
- if (t !== void 0 && typeof t != "string")
2698
- throw new TypeError('"ext" argument must be a string');
2699
- me(n);
2700
- var o = 0, s = -1, a = !0, l;
2701
- if (t !== void 0 && t.length > 0 && t.length <= n.length) {
2702
- if (t.length === n.length && t === n)
2703
- return "";
2704
- var u = t.length - 1, i = -1;
2705
- for (l = n.length - 1; l >= 0; --l) {
2706
- var c = n.charCodeAt(l);
2707
- if (c === 47) {
2708
- if (!a) {
2709
- o = l + 1;
2710
- break;
2711
- }
2712
- } else
2713
- i === -1 && (a = !1, i = l + 1), u >= 0 && (c === t.charCodeAt(u) ? --u === -1 && (s = l) : (u = -1, s = i));
2714
- }
2715
- return o === s ? s = i : s === -1 && (s = n.length), n.slice(o, s);
2716
- } else {
2717
- for (l = n.length - 1; l >= 0; --l)
2718
- if (n.charCodeAt(l) === 47) {
2719
- if (!a) {
2720
- o = l + 1;
2721
- break;
2722
- }
2723
- } else
2724
- s === -1 && (a = !1, s = l + 1);
2725
- return s === -1 ? "" : n.slice(o, s);
2726
- }
2727
- },
2728
- extname: function(n) {
2729
- me(n);
2730
- for (var t = -1, o = 0, s = -1, a = !0, l = 0, u = n.length - 1; u >= 0; --u) {
2731
- var i = n.charCodeAt(u);
2732
- if (i === 47) {
2733
- if (!a) {
2734
- o = u + 1;
2735
- break;
2736
- }
2737
- continue;
2738
- }
2739
- s === -1 && (a = !1, s = u + 1), i === 46 ? t === -1 ? t = u : l !== 1 && (l = 1) : t !== -1 && (l = -1);
2740
- }
2741
- return t === -1 || s === -1 || // We saw a non-dot character immediately before the dot
2742
- l === 0 || // The (right-most) trimmed path component is exactly '..'
2743
- l === 1 && t === s - 1 && t === o + 1 ? "" : n.slice(t, s);
2744
- },
2745
- format: function(n) {
2746
- if (n === null || typeof n != "object")
2747
- throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof n);
2748
- return El("/", n);
2749
- },
2750
- parse: function(n) {
2751
- me(n);
2752
- var t = { root: "", dir: "", base: "", ext: "", name: "" };
2753
- if (n.length === 0)
2754
- return t;
2755
- var o = n.charCodeAt(0), s = o === 47, a;
2756
- s ? (t.root = "/", a = 1) : a = 0;
2757
- for (var l = -1, u = 0, i = -1, c = !0, f = n.length - 1, d = 0; f >= a; --f) {
2758
- if (o = n.charCodeAt(f), o === 47) {
2759
- if (!c) {
2760
- u = f + 1;
2761
- break;
2762
- }
2763
- continue;
2764
- }
2765
- i === -1 && (c = !1, i = f + 1), o === 46 ? l === -1 ? l = f : d !== 1 && (d = 1) : l !== -1 && (d = -1);
2766
- }
2767
- return l === -1 || i === -1 || // We saw a non-dot character immediately before the dot
2768
- d === 0 || // The (right-most) trimmed path component is exactly '..'
2769
- d === 1 && l === i - 1 && l === u + 1 ? i !== -1 && (u === 0 && s ? t.base = t.name = n.slice(1, i) : t.base = t.name = n.slice(u, i)) : (u === 0 && s ? (t.name = n.slice(1, l), t.base = n.slice(1, i)) : (t.name = n.slice(u, l), t.base = n.slice(u, i)), t.ext = n.slice(l, i)), u > 0 ? t.dir = n.slice(0, u - 1) : s && (t.dir = "/"), t;
2770
- },
2771
- sep: "/",
2772
- delimiter: ":",
2773
- win32: null,
2774
- posix: null
2775
- };
2776
- Ae.posix = Ae;
2777
- var rn = Ae;
2778
- const un = /* @__PURE__ */ qn(rn), Tl = { class: "tags-container" }, Il = /* @__PURE__ */ D({
2779
- __name: "index",
2780
- setup(e) {
2781
- const { proxy: n } = ge(), t = Ct(), o = Xe(), s = je(), a = bt(), l = _e(), { visitedViews: u } = so(a), i = Se(), c = E(() => i.layout), f = T({
2782
- path: "",
2783
- fullPath: "",
2784
- name: "",
2785
- title: "",
2786
- affix: !1,
2787
- keepAlive: !1
2788
- }), d = T([]), p = T(0), v = T(0);
2789
- ee(
2790
- o,
2791
- () => {
2792
- P(), O();
2793
- },
2794
- {
2795
- immediate: !0
2796
- //初始化立即执行
2797
- }
2798
- );
2799
- const g = T(!1);
2800
- ee(g, (y) => {
2801
- y ? document.body.addEventListener("click", I) : document.body.removeEventListener("click", I);
2802
- });
2803
- function w(y, h = "/") {
2804
- let A = [];
2805
- return y.forEach((F) => {
2806
- var z, G, re, Ge;
2807
- const q = rn.resolve(h, F.path);
2808
- if ((z = F.meta) != null && z.affix && A.push({
2809
- path: q,
2810
- fullPath: q,
2811
- name: String(F.name),
2812
- title: ((G = F.meta) == null ? void 0 : G.title) || "no-name",
2813
- affix: (re = F.meta) == null ? void 0 : re.affix,
2814
- keepAlive: (Ge = F.meta) == null ? void 0 : Ge.keepAlive
2815
- }), F.children) {
2816
- const Ye = w(F.children, h + F.path);
2817
- Ye.length >= 1 && (A = [...A, ...Ye]);
2818
- }
2819
- }), A;
2820
- }
2821
- function S() {
2822
- const y = w(s.routes);
2823
- d.value = y;
2824
- for (const h of y)
2825
- h.name && a.addVisitedView(h);
2826
- }
2827
- function P() {
2828
- var y, h;
2829
- o.meta.title && a.addView({
2830
- name: o.name,
2831
- title: o.meta.title,
2832
- path: o.path,
2833
- fullPath: o.fullPath,
2834
- affix: (y = o.meta) == null ? void 0 : y.affix,
2835
- keepAlive: (h = o.meta) == null ? void 0 : h.keepAlive
2836
- });
2837
- }
2838
- function O() {
2839
- $e(() => {
2840
- var y, h;
2841
- for (const A of u.value)
2842
- A.path === o.path && A.fullPath !== o.fullPath && a.updateVisitedView({
2843
- name: o.name,
2844
- title: o.meta.title || "",
2845
- path: o.path,
2846
- fullPath: o.fullPath,
2847
- affix: (y = o.meta) == null ? void 0 : y.affix,
2848
- keepAlive: (h = o.meta) == null ? void 0 : h.keepAlive
2849
- });
2850
- });
2851
- }
2852
- function b(y) {
2853
- return y.path === o.path;
2854
- }
2855
- function Y(y) {
2856
- return y == null ? void 0 : y.affix;
2857
- }
2858
- function Z() {
2859
- try {
2860
- return f.value.path === "/dashboard" || f.value.fullPath === a.visitedViews[1].fullPath;
2861
- } catch {
2862
- return !1;
2863
- }
2864
- }
2865
- function R() {
2866
- try {
2867
- return f.value.fullPath === a.visitedViews[a.visitedViews.length - 1].fullPath;
2868
- } catch {
2869
- return !1;
2870
- }
2871
- }
2872
- function W(y) {
2873
- a.delCachedView(y);
2874
- const { fullPath: h } = y;
2875
- $e(() => {
2876
- t.replace({ path: "/redirect" + h });
2877
- });
2878
- }
2879
- function V(y, h) {
2880
- const A = y.slice(-1)[0];
2881
- A && A.fullPath ? t.push(A.fullPath) : (h == null ? void 0 : h.name) === "Dashboard" ? t.replace({ path: "/redirect" + h.fullPath }) : t.push("/");
2882
- }
2883
- function j(y) {
2884
- a.delView(y).then((h) => {
2885
- b(y) && V(h.visitedViews, y);
2886
- });
2887
- }
2888
- function ae() {
2889
- a.delLeftViews(f.value).then((y) => {
2890
- y.visitedViews.find((h) => h.path === o.path) || V(y.visitedViews);
2891
- });
2892
- }
2893
- function oe() {
2894
- a.delRightViews(f.value).then((y) => {
2895
- y.visitedViews.find((h) => h.path === o.path) || V(y.visitedViews);
2896
- });
2897
- }
2898
- function de() {
2899
- t.push(f.value), a.delOtherViews(f.value).then(() => {
2900
- O();
2901
- });
2902
- }
2903
- function be(y) {
2904
- a.delAllViews().then((h) => {
2905
- V(h.visitedViews, y);
2906
- });
2907
- }
2908
- function x(y, h) {
2909
- const F = n == null ? void 0 : n.$el.getBoundingClientRect().left, z = (n == null ? void 0 : n.$el.offsetWidth) - 105, G = h.clientX - F + 15;
2910
- G > z ? p.value = z : p.value = G, c.value === "mix" ? v.value = h.clientY - 50 : v.value = h.clientY, g.value = !0, f.value = y;
2911
- }
2912
- function I() {
2913
- g.value = !1;
2914
- }
2915
- function B() {
2916
- I();
2917
- }
2918
- function X(y, h) {
2919
- let A = {};
2920
- function F(z, G) {
2921
- if (A[z.name] = G, z.children)
2922
- for (let re = 0; re < z.children.length; re++)
2923
- F(z.children[re], z);
2924
- }
2925
- for (let z = 0; z < y.length; z++)
2926
- F(y[z], null);
2927
- let q = A[h];
2928
- for (; q; ) {
2929
- if (!A[q.name])
2930
- return q;
2931
- q = A[q.name];
2932
- }
2933
- return null;
2934
- }
2935
- const K = (y) => {
2936
- if (c.value !== "mix")
2937
- return;
2938
- const h = X(s.routes, y);
2939
- l.activeTopMenu !== h.path && l.activeTopMenu(h.path);
2940
- };
2941
- return ee(
2942
- () => o.name,
2943
- (y) => {
2944
- y && K(y);
2945
- },
2946
- {
2947
- deep: !0
2948
- }
2949
- ), pe(() => {
2950
- S();
2951
- }), (y, h) => {
2952
- const A = xl, F = Oe("router-link"), q = yt, z = Ne;
2953
- return m(), C("div", Tl, [
2954
- _(q, {
2955
- class: "scroll-container",
2956
- vertical: !1,
2957
- onWheel: Te(B, ["prevent"])
2958
- }, {
2959
- default: M(() => [
2960
- (m(!0), C(le, null, xe(r(u), (G) => (m(), N(F, {
2961
- ref_for: !0,
2962
- ref: "tagRef",
2963
- key: G.fullPath,
2964
- class: $("tags-item " + (b(G) ? "active" : "")),
2965
- to: { path: G.path, query: G.query },
2966
- onMouseup: Te((re) => Y(G) ? "" : j(G), ["middle"]),
2967
- onContextmenu: Te((re) => x(G, re), ["prevent"])
2968
- }, {
2969
- default: M(() => [
2970
- Q(U(r(Na)(G)) + " ", 1),
2971
- Y(G) ? H("", !0) : (m(), N(A, {
2972
- key: 0,
2973
- class: "close-icon",
2974
- size: "12px",
2975
- onClick: Te((re) => j(G), ["prevent", "stop"])
2976
- }, null, 8, ["onClick"]))
2977
- ]),
2978
- _: 2
2979
- }, 1032, ["class", "to", "onMouseup", "onContextmenu"]))), 128))
2980
- ]),
2981
- _: 1
2982
- }),
2983
- ye(k("ul", {
2984
- class: "contextmenu",
2985
- style: ke({ left: r(p) + "px", top: r(v) + "px" })
2986
- }, [
2987
- k("li", {
2988
- onClick: h[0] || (h[0] = (G) => W(r(f)))
2989
- }, [
2990
- _(z, { "icon-class": "refresh" }),
2991
- Q(" 刷新 ")
2992
- ]),
2993
- Y(r(f)) ? H("", !0) : (m(), C("li", {
2994
- key: 0,
2995
- onClick: h[1] || (h[1] = (G) => j(r(f)))
2996
- }, [
2997
- _(z, { "icon-class": "close" }),
2998
- Q(" 关闭 ")
2999
- ])),
3000
- k("li", { onClick: de }, [
3001
- _(z, { "icon-class": "close_other" }),
3002
- Q(" 关闭其它 ")
3003
- ]),
3004
- Z() ? H("", !0) : (m(), C("li", {
3005
- key: 1,
3006
- onClick: ae
3007
- }, [
3008
- _(z, { "icon-class": "close_left" }),
3009
- Q(" 关闭左侧 ")
3010
- ])),
3011
- R() ? H("", !0) : (m(), C("li", {
3012
- key: 2,
3013
- onClick: oe
3014
- }, [
3015
- _(z, { "icon-class": "close_right" }),
3016
- Q(" 关闭右侧 ")
3017
- ])),
3018
- k("li", {
3019
- onClick: h[2] || (h[2] = (G) => be(r(f)))
3020
- }, [
3021
- _(z, { "icon-class": "close_all" }),
3022
- Q(" 关闭所有 ")
3023
- ])
3024
- ], 4), [
3025
- [qe, r(g)]
3026
- ])
3027
- ]);
3028
- };
3029
- }
3030
- }), Al = /* @__PURE__ */ ue(Il, [["__scopeId", "data-v-fe2fff79"]]), Pl = /* @__PURE__ */ D({
3031
- name: "AppLink",
3032
- inheritAttrs: !1,
3033
- __name: "index",
3034
- props: {
3035
- to: {
3036
- type: String,
3037
- required: !0
3038
- }
3039
- },
3040
- setup(e) {
3041
- const n = e, t = E(() => He(n.to)), o = E(() => t.value ? "a" : "router-link"), s = (a) => t.value ? { href: a, target: "_blank", rel: "noopener noreferrer" } : { to: a };
3042
- return (a, l) => (m(), N(lt(r(o)), to(no(s(e.to))), {
3043
- default: M(() => [
3044
- se(a.$slots, "default")
3045
- ]),
3046
- _: 3
3047
- }, 16));
3048
- }
3049
- }), Vl = {
3050
- key: 3,
3051
- class: "ml-1"
3052
- }, Ll = /* @__PURE__ */ D({
3053
- __name: "SidebarMenuItemTitle",
3054
- props: {
3055
- icon: {
3056
- type: String,
3057
- default: ""
3058
- },
3059
- name: {
3060
- type: String,
3061
- default: ""
3062
- },
3063
- title: {
3064
- type: String,
3065
- default: ""
3066
- }
3067
- },
3068
- setup(e) {
3069
- return (n, t) => {
3070
- const o = we, s = Ne;
3071
- return m(), C(le, null, [
3072
- e.icon && e.icon.startsWith("el-icon") ? (m(), N(o, {
3073
- key: 0,
3074
- class: "sub-el-icon"
3075
- }, {
3076
- default: M(() => [
3077
- (m(), N(lt(e.icon.replace("el-icon-", ""))))
3078
- ]),
3079
- _: 1
3080
- })) : e.icon ? (m(), N(s, {
3081
- key: 1,
3082
- "icon-class": e.icon
3083
- }, null, 8, ["icon-class"])) : (m(), N(s, {
3084
- key: 2,
3085
- "icon-class": "menu"
3086
- })),
3087
- e.title ? (m(), C("span", Vl, U(r(it)(e.name, e.title)), 1)) : H("", !0)
3088
- ], 64);
3089
- };
3090
- }
3091
- }), Nl = /* @__PURE__ */ ue(Ll, [["__scopeId", "data-v-992a058f"]]), Ol = { key: 0 }, Rl = /* @__PURE__ */ D({
3092
- name: "SidebarMenuItem",
3093
- inheritAttrs: !1,
3094
- __name: "SidebarMenuItem",
3095
- props: {
3096
- /**
3097
- * 路由(eg:user)
3098
- */
3099
- item: {
3100
- type: Object,
3101
- required: !0
3102
- },
3103
- /**
3104
- * 父层级完整路由路径(eg:/system)
3105
- */
3106
- basePath: {
3107
- type: String,
3108
- required: !0
3109
- },
3110
- isNest: {
3111
- type: Boolean,
3112
- default: !1
3113
- }
3114
- },
3115
- setup(e) {
3116
- const n = e, t = T();
3117
- function o(a = [], l) {
3118
- const u = a.filter((i) => {
3119
- var c;
3120
- return (c = i.meta) != null && c.hidden ? !1 : (i.meta.hidden = !1, t.value = i, !0);
3121
- });
3122
- return u.length === 1 ? !0 : u.length === 0 ? (t.value = { ...l, path: "", noShowingChildren: !0 }, !0) : !1;
3123
- }
3124
- function s(a) {
3125
- return He(a) ? a : He(n.basePath) ? n.basePath : un.resolve(n.basePath, a);
3126
- }
3127
- return (a, l) => {
3128
- var p;
3129
- const u = Nl, i = an, c = Pl, f = Oe("SidebarMenuItem", !0), d = Ma;
3130
- return !e.item.meta || !e.item.meta.hidden ? (m(), C("div", Ol, [
3131
- o(e.item.children, e.item) && (!r(t).children || r(t).noShowingChildren) && !((p = e.item.meta) != null && p.alwaysShow) ? (m(), C(le, { key: 0 }, [
3132
- r(t).meta ? (m(), N(c, {
3133
- key: 0,
3134
- to: s(r(t).path)
3135
- }, {
3136
- default: M(() => [
3137
- _(i, {
3138
- index: s(r(t).path),
3139
- class: $({ "submenu-title-noDropdown": !e.isNest })
3140
- }, {
3141
- default: M(() => [
3142
- _(u, {
3143
- icon: r(t).meta.icon || e.item.meta && e.item.meta.icon,
3144
- title: r(t).meta.title,
3145
- name: r(t).name
3146
- }, null, 8, ["icon", "title", "name"])
3147
- ]),
3148
- _: 1
3149
- }, 8, ["index", "class"])
3150
- ]),
3151
- _: 1
3152
- }, 8, ["to"])) : H("", !0)
3153
- ], 64)) : (m(), N(d, {
3154
- key: 1,
3155
- index: s(e.item.path),
3156
- teleported: ""
3157
- }, {
3158
- title: M(() => [
3159
- e.item.meta ? (m(), N(u, {
3160
- key: 0,
3161
- icon: e.item.meta && e.item.meta.icon,
3162
- title: e.item.meta.title,
3163
- name: e.item.name
3164
- }, null, 8, ["icon", "title", "name"])) : H("", !0)
3165
- ]),
3166
- default: M(() => [
3167
- (m(!0), C(le, null, xe(e.item.children, (v) => (m(), N(f, {
3168
- key: v.path,
3169
- "is-nest": !0,
3170
- item: v,
3171
- "base-path": s(v.path)
3172
- }, null, 8, ["item", "base-path"]))), 128))
3173
- ]),
3174
- _: 1
3175
- }, 8, ["index"]))
3176
- ])) : H("", !0);
3177
- };
3178
- }
3179
- }), Bl = "_dark_168i3_12", Pe = {
3180
- "sidebar-width": "210px",
3181
- "navbar-height": "50px",
3182
- "menu-background": "var(--menu-background)",
3183
- "menu-text": "var(--menu-text)",
3184
- "menu-active-text": "var(--menu-active-text)",
3185
- "menu-hover": "var(--menu-hover)",
3186
- dark: Bl
3187
- }, cn = /* @__PURE__ */ D({
3188
- __name: "SidebarMenu",
3189
- props: {
3190
- menuList: {
3191
- required: !0,
3192
- default: () => [],
3193
- type: Array
3194
- },
3195
- basePath: {
3196
- type: String,
3197
- required: !0
3198
- }
3199
- },
3200
- setup(e) {
3201
- const n = Se(), t = _e(), o = Xe(), s = E(() => n.layout), a = e;
3202
- function l(u) {
3203
- return He(u) ? u : He(a.basePath) ? a.basePath : un.resolve(a.basePath, u);
3204
- }
3205
- return (u, i) => {
3206
- const c = Rl, f = on;
3207
- return m(), N(f, {
3208
- "default-active": r(o).path,
3209
- collapse: !r(t).sidebar.opened,
3210
- "background-color": r(Pe)["menu-background"],
3211
- "text-color": r(Pe)["menu-text"],
3212
- "active-text-color": r(Pe)["menu-active-text"],
3213
- "unique-opened": !1,
3214
- "collapse-transition": !1,
3215
- mode: r(s) === "top" ? "horizontal" : "vertical"
3216
- }, {
3217
- default: M(() => [
3218
- (m(!0), C(le, null, xe(e.menuList, (d) => (m(), N(c, {
3219
- key: d.path,
3220
- item: d,
3221
- "base-path": l(d.path),
3222
- "is-collapse": !r(t).sidebar.opened
3223
- }, null, 8, ["item", "base-path", "is-collapse"]))), 128))
3224
- ]),
3225
- _: 1
3226
- }, 8, ["default-active", "collapse", "background-color", "text-color", "active-text-color", "mode"]);
3227
- };
3228
- }
3229
- }), Fl = { key: 1 }, Dl = {
3230
- key: 0,
3231
- class: "ml-1"
3232
- }, zl = /* @__PURE__ */ D({
3233
- __name: "SidebarMixTopMenu",
3234
- setup(e) {
3235
- const n = _e(), t = je(), o = Ct(), s = E(() => n.activeTopMenuPath), a = T([]), l = (i) => {
3236
- n.activeTopMenu(i), t.setMixLeftMenus(i);
3237
- const c = t.mixLeftMenus;
3238
- u(c);
3239
- }, u = (i) => {
3240
- if (i.length === 0)
3241
- return;
3242
- const [c] = i;
3243
- c.children && c.children.length > 0 ? u(c.children) : c.name && o.push({
3244
- name: c.name
3245
- });
3246
- };
3247
- return pe(() => {
3248
- a.value = t.routes.filter(
3249
- (i) => !i.meta || !i.meta.hidden
3250
- );
3251
- }), (i, c) => {
3252
- const f = Ne, d = an, p = on, v = yt;
3253
- return m(), N(v, null, {
3254
- default: M(() => [
3255
- _(p, {
3256
- mode: "horizontal",
3257
- "default-active": r(s),
3258
- "background-color": r(Pe)["menu-background"],
3259
- "text-color": r(Pe)["menu-text"],
3260
- "active-text-color": r(Pe)["menu-active-text"],
3261
- onSelect: l
3262
- }, {
3263
- default: M(() => [
3264
- (m(!0), C(le, null, xe(r(a), (g) => (m(), N(d, {
3265
- key: g.path,
3266
- index: g.path
3267
- }, {
3268
- title: M(() => [
3269
- g.meta && g.meta.icon ? (m(), N(f, {
3270
- key: 0,
3271
- "icon-class": g.meta.icon
3272
- }, null, 8, ["icon-class"])) : H("", !0),
3273
- g.path === "/" ? (m(), C("span", Fl, U(r(it)("Dashboard", "首页")), 1)) : (m(), C(le, { key: 2 }, [
3274
- g.meta && g.meta.title ? (m(), C("span", Dl, U(r(gt)(g)), 1)) : H("", !0)
3275
- ], 64))
3276
- ]),
3277
- _: 2
3278
- }, 1032, ["index"]))), 128))
3279
- ]),
3280
- _: 1
3281
- }, 8, ["default-active", "background-color", "text-color", "active-text-color"])
3282
- ]),
3283
- _: 1
3284
- });
3285
- };
3286
- }
3287
- }), Hl = { class: "logo-container" }, Wl = ["src"], ql = ["src"], Ul = { class: "logo-title" }, Kl = /* @__PURE__ */ D({
3288
- __name: "SidebarLogo",
3289
- props: {
3290
- collapse: {
3291
- type: Boolean,
3292
- required: !0
3293
- }
3294
- },
3295
- setup(e) {
3296
- const n = Se(), t = ze.logo;
3297
- return (o, s) => {
3298
- const a = Oe("router-link");
3299
- return m(), C("div", Hl, [
3300
- _(rt, { "enter-active-class": "animate__animated animate__fadeInLeft" }, {
3301
- default: M(() => [
3302
- e.collapse ? (m(), N(a, {
3303
- key: 0,
3304
- class: "wh-full flex-center",
3305
- to: "/"
3306
- }, {
3307
- default: M(() => [
3308
- r(n).sidebarLogo ? (m(), C("img", {
3309
- key: 0,
3310
- src: r(t),
3311
- class: "logo-image"
3312
- }, null, 8, Wl)) : H("", !0)
3313
- ]),
3314
- _: 1
3315
- })) : (m(), N(a, {
3316
- key: 1,
3317
- class: "wh-full flex-center",
3318
- to: "/"
3319
- }, {
3320
- default: M(() => [
3321
- r(n).sidebarLogo ? (m(), C("img", {
3322
- key: 0,
3323
- src: r(t),
3324
- class: "logo-image"
3325
- }, null, 8, ql)) : H("", !0),
3326
- k("span", Ul, U(r(ze).title), 1)
3327
- ]),
3328
- _: 1
3329
- }))
3330
- ]),
3331
- _: 1
3332
- })
3333
- ]);
3334
- };
3335
- }
3336
- }), jl = /* @__PURE__ */ ue(Kl, [["__scopeId", "data-v-210c85a9"]]), Xl = {
3337
- key: 0,
3338
- class: "flex w-full"
3339
- }, Gl = /* @__PURE__ */ D({
3340
- __name: "index",
3341
- setup(e) {
3342
- const n = _e(), t = Se(), o = je(), s = E(() => t.sidebarLogo), a = E(() => t.layout);
3343
- return (l, u) => {
3344
- const i = jl, c = zl, f = ln, d = cn, p = yt;
3345
- return m(), C("div", {
3346
- class: $({ "has-logo": r(s) })
3347
- }, [
3348
- r(a) == "mix" ? (m(), C("div", Xl, [
3349
- r(s) ? (m(), N(i, {
3350
- key: 0,
3351
- collapse: !r(n).sidebar.opened
3352
- }, null, 8, ["collapse"])) : H("", !0),
3353
- _(c, { class: "flex-1" }),
3354
- _(f)
3355
- ])) : (m(), C(le, { key: 1 }, [
3356
- r(s) ? (m(), N(i, {
3357
- key: 0,
3358
- collapse: !r(n).sidebar.opened
3359
- }, null, 8, ["collapse"])) : H("", !0),
3360
- _(p, null, {
3361
- default: M(() => [
3362
- _(d, {
3363
- "menu-list": r(o).routes,
3364
- "base-path": ""
3365
- }, null, 8, ["menu-list"])
3366
- ]),
3367
- _: 1
3368
- }),
3369
- r(a) === "top" ? (m(), N(f, { key: 1 })) : H("", !0)
3370
- ], 64))
3371
- ], 2);
3372
- };
3373
- }
3374
- }), Yl = /* @__PURE__ */ ue(Gl, [["__scopeId", "data-v-a6d3f8e9"]]), Zl = {
3375
- key: 1,
3376
- class: "mix-container"
3377
- }, Jl = { class: "mix-container__left" }, Ql = { class: "sidebar-toggle" }, es = 992, ts = /* @__PURE__ */ D({
3378
- __name: "index",
3379
- setup(e) {
3380
- const n = _e(), t = Se(), o = je(), s = E(() => t.fixedHeader), a = E(() => t.tagsView), l = E(() => t.layout), u = E(() => n.activeTopMenuPath), i = E(() => o.mixLeftMenus);
3381
- ee(
3382
- () => u.value,
3383
- (v) => {
3384
- o.setMixLeftMenus(v);
3385
- },
3386
- {
3387
- deep: !0,
3388
- immediate: !0
3389
- }
3390
- );
3391
- const c = E(() => ({
3392
- hideSidebar: !n.sidebar.opened,
3393
- openSidebar: n.sidebar.opened,
3394
- mobile: n.device === Je.MOBILE,
3395
- "layout-left": l.value === "left",
3396
- "layout-top": l.value === "top",
3397
- "layout-mix": l.value === "mix"
3398
- })), f = Un().width;
3399
- kt(() => {
3400
- f.value < es ? (n.toggleDevice(Je.MOBILE), n.closeSideBar()) : (n.toggleDevice(Je.DESKTOP), f.value >= 1200 ? n.openSideBar() : n.closeSideBar());
3401
- });
3402
- function d() {
3403
- n.closeSideBar();
3404
- }
3405
- function p() {
3406
- n.toggleSidebar();
3407
- }
3408
- return (v, g) => {
3409
- const w = Yl, S = cn, P = sn, O = Al, b = Cl, Y = bl, Z = Ka;
3410
- return m(), C("div", {
3411
- class: $(["wh-full", r(c)])
3412
- }, [
3413
- r(c).mobile && r(c).openSidebar ? (m(), C("div", {
3414
- key: 0,
3415
- class: "wh-full fixed-lt z-999 bg-black bg-opacity-30",
3416
- onClick: d
3417
- })) : H("", !0),
3418
- _(w, { class: "sidebar-container" }),
3419
- r(l) === "mix" ? (m(), C("div", Zl, [
3420
- k("div", Jl, [
3421
- _(S, {
3422
- "menu-list": r(i),
3423
- "base-path": r(u)
3424
- }, null, 8, ["menu-list", "base-path"]),
3425
- k("div", Ql, [
3426
- _(P, {
3427
- "is-active": r(n).sidebar.opened,
3428
- onToggleClick: p
3429
- }, null, 8, ["is-active"])
3430
- ])
3431
- ]),
3432
- k("div", {
3433
- class: $([{ hasTagsView: r(a) }, "main-container"])
3434
- }, [
3435
- k("div", {
3436
- class: $({ "fixed-header": r(s) })
3437
- }, [
3438
- r(a) ? (m(), N(O, { key: 0 })) : H("", !0)
3439
- ], 2),
3440
- _(b),
3441
- r(ze).showSettings ? (m(), N(Y, { key: 0 })) : H("", !0)
3442
- ], 2)
3443
- ])) : (m(), C("div", {
3444
- key: 2,
3445
- class: $([{ hasTagsView: r(a) }, "main-container"])
3446
- }, [
3447
- k("div", {
3448
- class: $({ "fixed-header": r(s) })
3449
- }, [
3450
- r(l) === "left" ? (m(), N(Z, { key: 0 })) : H("", !0),
3451
- r(a) ? (m(), N(O, { key: 1 })) : H("", !0)
3452
- ], 2),
3453
- _(b),
3454
- r(ze).showSettings ? (m(), N(Y, { key: 0 })) : H("", !0)
3455
- ], 2))
3456
- ], 2);
3457
- };
3458
- }
3459
- }), ms = /* @__PURE__ */ ue(ts, [["__scopeId", "data-v-71891bc2"]]);
3460
- export {
3461
- ms as default
3462
- };