@gyyxds/zy-ui 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/CONTRIBUTING.md +13 -6
- package/LICENSE +21 -0
- package/README.md +131 -105
- package/dist/zy-ui/index.d.ts +16 -0
- package/dist/zy-ui/mega-menu/ZyMegaMenu.vue.d.ts +8 -0
- package/dist/zy-ui/mega-menu/index.d.ts +16 -0
- package/dist/zy-ui/themes/basic.css +7 -2
- package/dist/zy-ui/themes/material.css +4 -0
- package/dist/zy-ui/themes/solid.css +665 -664
- package/dist/zy-ui/zy-ui.css +1 -1
- package/dist/zy-ui/zy-ui.js +239 -212
- package/package.json +6 -7
package/dist/zy-ui/zy-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createStaticVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, h as f, inject as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, useAttrs as A, useId as
|
|
2
|
-
import { ElAlert as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createStaticVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, h as f, inject as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, useAttrs as A, useId as j, useModel as M, useSlots as N, vModelCheckbox as P, watch as F, withCtx as I, withDirectives as L, withKeys as ee, withModifiers as R } from "vue";
|
|
2
|
+
import { ElAlert as te, ElBadge as ne, ElButton as z, ElCheckbox as B, ElCheckboxGroup as V, ElDatePicker as H, ElDialog as re, ElDivider as ie, ElInput as U, ElPagination as W, ElProgress as ae, ElRadio as oe, ElRadioButton as G, ElRadioGroup as K, ElSelect as q, ElSpace as J, ElTable as se, ElTag as Y, ElTimePicker as X, ElTree as ce } from "element-plus";
|
|
3
3
|
//#region src/zy/utils/withInstall.ts
|
|
4
4
|
function Z(e, t) {
|
|
5
5
|
let n = e;
|
|
@@ -25,8 +25,8 @@ var le = /*@__PURE__*/ u({
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
setup(e) {
|
|
28
|
-
let t = Object.keys(
|
|
29
|
-
return (r, i) => (S(), n(k(
|
|
28
|
+
let t = Object.keys(N()).filter((e) => e !== "default");
|
|
29
|
+
return (r, i) => (S(), n(k(te), {
|
|
30
30
|
class: "zy-alert",
|
|
31
31
|
title: e.title,
|
|
32
32
|
type: e.type,
|
|
@@ -35,7 +35,7 @@ var le = /*@__PURE__*/ u({
|
|
|
35
35
|
"show-icon": e.showIcon
|
|
36
36
|
}, o({ _: 2 }, [T(k(t), (e) => ({
|
|
37
37
|
name: e,
|
|
38
|
-
fn:
|
|
38
|
+
fn: I((t) => [E(r.$slots, e, v(d(t)), void 0, !0)])
|
|
39
39
|
}))]), 1032, [
|
|
40
40
|
"title",
|
|
41
41
|
"type",
|
|
@@ -70,7 +70,7 @@ var le = /*@__PURE__*/ u({
|
|
|
70
70
|
effect: { default: "" }
|
|
71
71
|
},
|
|
72
72
|
setup(e) {
|
|
73
|
-
return (t, r) => (S(), n(k(
|
|
73
|
+
return (t, r) => (S(), n(k(ne), h(t.$attrs, {
|
|
74
74
|
class: ["zy-badge", { "is-ping": e.effect === "ping" }],
|
|
75
75
|
value: e.value,
|
|
76
76
|
max: e.max,
|
|
@@ -79,7 +79,7 @@ var le = /*@__PURE__*/ u({
|
|
|
79
79
|
type: e.type,
|
|
80
80
|
"show-zero": e.showZero
|
|
81
81
|
}), {
|
|
82
|
-
default:
|
|
82
|
+
default: I(() => [E(t.$slots, "default", {}, void 0, !0)]),
|
|
83
83
|
_: 3
|
|
84
84
|
}, 16, [
|
|
85
85
|
"class",
|
|
@@ -228,7 +228,7 @@ var le = /*@__PURE__*/ u({
|
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
230
|
setup(e) {
|
|
231
|
-
let s =
|
|
231
|
+
let s = N(), c = e, l = t(() => Object.keys(s).filter((e) => e !== "default" && (c.effect !== "sweep" || e !== "icon"))), u = w(typeof document > "u" ? "basic" : document.documentElement.dataset.zyTheme || "basic"), f = () => {
|
|
232
232
|
u.value = document.documentElement.dataset.zyTheme || "basic";
|
|
233
233
|
}, p;
|
|
234
234
|
x(() => {
|
|
@@ -247,7 +247,7 @@ var le = /*@__PURE__*/ u({
|
|
|
247
247
|
loading: e.loading,
|
|
248
248
|
icon: h.value ? void 0 : e.icon
|
|
249
249
|
}, o({
|
|
250
|
-
default:
|
|
250
|
+
default: I(() => [h.value ? (S(), i("span", Mt, [
|
|
251
251
|
s[0] ||= a("span", {
|
|
252
252
|
class: "zy-btn-sweep-clip",
|
|
253
253
|
"aria-hidden": "true"
|
|
@@ -296,7 +296,7 @@ var le = /*@__PURE__*/ u({
|
|
|
296
296
|
_: 2
|
|
297
297
|
}, [T(l.value, (e) => ({
|
|
298
298
|
name: e,
|
|
299
|
-
fn:
|
|
299
|
+
fn: I((n) => [E(t.$slots, e, v(d(n)), void 0, !0)])
|
|
300
300
|
}))]), 1032, [
|
|
301
301
|
"class",
|
|
302
302
|
"type",
|
|
@@ -359,8 +359,8 @@ var le = /*@__PURE__*/ u({
|
|
|
359
359
|
}),
|
|
360
360
|
emits: ["update:modelValue"],
|
|
361
361
|
setup(e) {
|
|
362
|
-
let t = Object.keys(
|
|
363
|
-
return (i, a) => (S(), n(k(
|
|
362
|
+
let t = Object.keys(N()).filter((e) => e !== "default"), r = M(e, "modelValue");
|
|
363
|
+
return (i, a) => (S(), n(k(B), h(i.$attrs, {
|
|
364
364
|
modelValue: r.value,
|
|
365
365
|
"onUpdate:modelValue": a[0] ||= (e) => r.value = e,
|
|
366
366
|
class: ["zy-check", `is-${e.effect}`],
|
|
@@ -368,11 +368,11 @@ var le = /*@__PURE__*/ u({
|
|
|
368
368
|
value: e.value,
|
|
369
369
|
disabled: e.disabled
|
|
370
370
|
}), o({
|
|
371
|
-
default:
|
|
371
|
+
default: I(() => [E(i.$slots, "default", {}, void 0, !0)]),
|
|
372
372
|
_: 2
|
|
373
373
|
}, [T(k(t), (e) => ({
|
|
374
374
|
name: e,
|
|
375
|
-
fn:
|
|
375
|
+
fn: I((t) => [E(i.$slots, e, v(d(t)), void 0, !0)])
|
|
376
376
|
}))]), 1040, [
|
|
377
377
|
"modelValue",
|
|
378
378
|
"class",
|
|
@@ -396,19 +396,19 @@ var le = /*@__PURE__*/ u({
|
|
|
396
396
|
}),
|
|
397
397
|
emits: ["update:modelValue"],
|
|
398
398
|
setup(e) {
|
|
399
|
-
let t = Object.keys(
|
|
400
|
-
return (i, a) => (S(), n(k(
|
|
399
|
+
let t = Object.keys(N()).filter((e) => e !== "default"), r = M(e, "modelValue");
|
|
400
|
+
return (i, a) => (S(), n(k(V), h(i.$attrs, {
|
|
401
401
|
modelValue: r.value,
|
|
402
402
|
"onUpdate:modelValue": a[0] ||= (e) => r.value = e,
|
|
403
403
|
class: "zy-checkbox-group",
|
|
404
404
|
size: e.size,
|
|
405
405
|
disabled: e.disabled
|
|
406
406
|
}), o({
|
|
407
|
-
default:
|
|
407
|
+
default: I(() => [E(i.$slots, "default", {}, void 0, !0)]),
|
|
408
408
|
_: 2
|
|
409
409
|
}, [T(k(t), (e) => ({
|
|
410
410
|
name: e,
|
|
411
|
-
fn:
|
|
411
|
+
fn: I((t) => [E(i.$slots, e, v(d(t)), void 0, !0)])
|
|
412
412
|
}))]), 1040, [
|
|
413
413
|
"modelValue",
|
|
414
414
|
"size",
|
|
@@ -440,14 +440,14 @@ var le = /*@__PURE__*/ u({
|
|
|
440
440
|
}),
|
|
441
441
|
emits: /*@__PURE__*/ m(["complete"], ["update:modelValue"]),
|
|
442
442
|
setup(n, { expose: o, emit: s }) {
|
|
443
|
-
let c = n, u =
|
|
444
|
-
|
|
445
|
-
},
|
|
446
|
-
function
|
|
447
|
-
let e =
|
|
443
|
+
let c = n, u = M(n, "modelValue"), d = s, f = A(), p = `zy-code-${j()}`, m = w(null), h = w(null), g = w(!1), v = w(0), x = w(c.status === "success"), C = w([]), E = !1, D = !1, N = [], P = (e, t) => {
|
|
444
|
+
N.push(window.setTimeout(e, t));
|
|
445
|
+
}, I = (e) => String(e ?? "").replace(/\D/g, ""), L = t(() => I(u.value).slice(0, c.length)), ee = t(() => L.value.length >= c.length), R = (e) => e.length >= c.length ? c.length - 1 : e.length, te = t(() => f["aria-label"] ?? "验证码"), ne = t(() => Math.round(c.size === "large" ? 31 : c.size === "small" ? 22 : 26)), z = t(() => [...L.value].filter(Boolean).length), B = t(() => c.status === "success" ? "验证码已通过" : `已输入 ${z.value} / ${c.length} 位`), V = t(() => c.disabled || E || c.status === "success"), H = t(() => c.caret && g.value && !V.value && !x.value && (L.value.length < c.length || !C.value[v.value]?.filled)), re = () => m.value?.input ?? null;
|
|
446
|
+
function ie() {
|
|
447
|
+
let e = re();
|
|
448
448
|
e && e.value !== "" && (e.value = "");
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function W(e) {
|
|
451
451
|
return Array.from({ length: c.length }, (t, n) => {
|
|
452
452
|
let r = e[n] ?? "";
|
|
453
453
|
return {
|
|
@@ -458,7 +458,7 @@ var le = /*@__PURE__*/ u({
|
|
|
458
458
|
};
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function ae(e, t, n = 0) {
|
|
462
462
|
let r = C.value[e];
|
|
463
463
|
if (!r) return;
|
|
464
464
|
let i = r.filled;
|
|
@@ -467,21 +467,21 @@ var le = /*@__PURE__*/ u({
|
|
|
467
467
|
r && r.char === t && (r.delay = n, r.filled = !0);
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function oe(e, t = 0) {
|
|
471
471
|
let n = C.value[e];
|
|
472
|
-
n && n.filled && (n.delay = t, n.filled = !1,
|
|
472
|
+
n && n.filled && (n.delay = t, n.filled = !1, P(() => {
|
|
473
473
|
let t = C.value[e];
|
|
474
474
|
t && !t.filled && (t.char = "");
|
|
475
475
|
}, t + Yt));
|
|
476
476
|
}
|
|
477
477
|
function G(e, t) {
|
|
478
|
-
let n =
|
|
478
|
+
let n = I(e).slice(0, c.length);
|
|
479
479
|
D = !0, u.value = n, v.value = Math.max(0, Math.min(t, c.length - 1));
|
|
480
480
|
}
|
|
481
|
-
|
|
481
|
+
F(L, (e, t) => {
|
|
482
482
|
if (E) return;
|
|
483
483
|
if (t === void 0) {
|
|
484
|
-
C.value =
|
|
484
|
+
C.value = W(e), v.value = R(e);
|
|
485
485
|
return;
|
|
486
486
|
}
|
|
487
487
|
let n = [], r = [];
|
|
@@ -490,19 +490,19 @@ var le = /*@__PURE__*/ u({
|
|
|
490
490
|
a !== o && (o ? n : r).push(i);
|
|
491
491
|
}
|
|
492
492
|
let i = K() ? 0 : Xt;
|
|
493
|
-
n.forEach((t, n) =>
|
|
493
|
+
n.forEach((t, n) => ae(t, e[t], n * i)), r.forEach((e, t) => oe(e, t * i)), D ? D = !1 : v.value = R(e), t.length < c.length && e.length >= c.length && d("complete", e.slice(0, c.length));
|
|
494
494
|
}, {
|
|
495
495
|
immediate: !0,
|
|
496
496
|
flush: "post"
|
|
497
|
-
}),
|
|
498
|
-
C.value =
|
|
499
|
-
}),
|
|
497
|
+
}), F(() => c.length, (e) => {
|
|
498
|
+
C.value = W(L.value.slice(0, e)), v.value = R(L.value);
|
|
499
|
+
}), F(() => c.status, (e, t) => {
|
|
500
500
|
if (e === "error") {
|
|
501
|
-
let e = [...
|
|
501
|
+
let e = [...L.value].map((e, t) => e ? t : -1).filter((e) => e >= 0).reverse();
|
|
502
502
|
if (!e.length) return;
|
|
503
503
|
E = !0;
|
|
504
504
|
let t = K() ? 0 : Xt;
|
|
505
|
-
e.forEach((e, n) =>
|
|
505
|
+
e.forEach((e, n) => oe(e, n * t)), P(() => {
|
|
506
506
|
E = !1, G("", 0);
|
|
507
507
|
}, e.length * t + Yt + 60);
|
|
508
508
|
return;
|
|
@@ -523,9 +523,9 @@ var le = /*@__PURE__*/ u({
|
|
|
523
523
|
return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
524
524
|
}
|
|
525
525
|
function q(e) {
|
|
526
|
-
let t =
|
|
527
|
-
if (!t ||
|
|
528
|
-
let n =
|
|
526
|
+
let t = I(e);
|
|
527
|
+
if (!t || V.value) return;
|
|
528
|
+
let n = L.value, r = ee.value ? Math.min(v.value, c.length - 1) : Math.min(v.value, n.length), i = n;
|
|
529
529
|
for (let [e, n] of [...t].entries()) {
|
|
530
530
|
let t = r + e;
|
|
531
531
|
if (t >= c.length) break;
|
|
@@ -534,7 +534,7 @@ var le = /*@__PURE__*/ u({
|
|
|
534
534
|
G(i, Math.min(r + t.length, c.length - 1));
|
|
535
535
|
}
|
|
536
536
|
function J() {
|
|
537
|
-
let e =
|
|
537
|
+
let e = L.value;
|
|
538
538
|
if (e) {
|
|
539
539
|
if (v.value >= e.length) {
|
|
540
540
|
G(e.slice(0, -1), Math.max(e.length - 2, 0));
|
|
@@ -543,16 +543,16 @@ var le = /*@__PURE__*/ u({
|
|
|
543
543
|
G(e.slice(0, v.value) + e.slice(v.value + 1), v.value);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
let t =
|
|
546
|
+
function se(e) {
|
|
547
|
+
let t = L.value;
|
|
548
548
|
e >= t.length || G(t.slice(0, e) + t.slice(e + 1), e);
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Y(e) {
|
|
551
551
|
v.value = Math.max(0, Math.min(e, c.length - 1));
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function X(e) {
|
|
554
554
|
let t = e;
|
|
555
|
-
if (
|
|
555
|
+
if (V.value || t.metaKey || t.ctrlKey || t.altKey) return;
|
|
556
556
|
let n = t.key;
|
|
557
557
|
if (/^[0-9]$/.test(n)) {
|
|
558
558
|
t.preventDefault(), q(n);
|
|
@@ -560,19 +560,19 @@ var le = /*@__PURE__*/ u({
|
|
|
560
560
|
}
|
|
561
561
|
let r = {
|
|
562
562
|
Backspace: J,
|
|
563
|
-
Delete: () =>
|
|
564
|
-
ArrowLeft: () =>
|
|
565
|
-
ArrowRight: () =>
|
|
566
|
-
Home: () =>
|
|
567
|
-
End: () =>
|
|
563
|
+
Delete: () => se(v.value),
|
|
564
|
+
ArrowLeft: () => Y(v.value - 1),
|
|
565
|
+
ArrowRight: () => Y(v.value + 1),
|
|
566
|
+
Home: () => Y(0),
|
|
567
|
+
End: () => Y(c.length - 1)
|
|
568
568
|
}[n];
|
|
569
569
|
r && (t.preventDefault(), r());
|
|
570
570
|
}
|
|
571
571
|
function ce(e) {
|
|
572
|
-
|
|
572
|
+
V.value || (e.preventDefault(), q(e.clipboardData?.getData("text") ?? ""));
|
|
573
573
|
}
|
|
574
574
|
function Z(e) {
|
|
575
|
-
|
|
575
|
+
I(e) && q(e), ie();
|
|
576
576
|
}
|
|
577
577
|
function le(e) {
|
|
578
578
|
if (c.disabled) return;
|
|
@@ -582,13 +582,13 @@ var le = /*@__PURE__*/ u({
|
|
|
582
582
|
let n = t.querySelector(".zy-code__slot"), r = Number.parseFloat(getComputedStyle(t).columnGap || "0") || 0, i = (n?.offsetWidth ?? 0) + r;
|
|
583
583
|
if (i > 0) {
|
|
584
584
|
let n = t.getBoundingClientRect(), r = Math.floor((e.clientX - n.left) / i);
|
|
585
|
-
v.value = Math.max(0, Math.min(r, L
|
|
585
|
+
v.value = Math.max(0, Math.min(r, R(L.value)));
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
588
|
m.value?.focus();
|
|
589
589
|
}
|
|
590
590
|
return b(() => {
|
|
591
|
-
|
|
591
|
+
N.forEach((e) => window.clearTimeout(e));
|
|
592
592
|
}), o({
|
|
593
593
|
focus: () => m.value?.focus(),
|
|
594
594
|
blur: () => m.value?.blur()
|
|
@@ -601,7 +601,7 @@ var le = /*@__PURE__*/ u({
|
|
|
601
601
|
style: y({ "--zy-code-active": v.value }),
|
|
602
602
|
onMousedown: le
|
|
603
603
|
}, [
|
|
604
|
-
l(k(
|
|
604
|
+
l(k(U), {
|
|
605
605
|
ref_key: "inputRef",
|
|
606
606
|
ref: m,
|
|
607
607
|
class: "zy-code__input",
|
|
@@ -612,10 +612,10 @@ var le = /*@__PURE__*/ u({
|
|
|
612
612
|
inputmode: "numeric",
|
|
613
613
|
autocomplete: "one-time-code",
|
|
614
614
|
pattern: "[0-9]*",
|
|
615
|
-
"aria-label":
|
|
615
|
+
"aria-label": te.value,
|
|
616
616
|
"aria-invalid": n.status === "error",
|
|
617
617
|
"aria-describedby": p,
|
|
618
|
-
onKeydown:
|
|
618
|
+
onKeydown: X,
|
|
619
619
|
onPaste: ce,
|
|
620
620
|
onInput: Z,
|
|
621
621
|
onFocus: o[0] ||= (e) => g.value = !0,
|
|
@@ -645,17 +645,17 @@ var le = /*@__PURE__*/ u({
|
|
|
645
645
|
"aria-hidden": "true"
|
|
646
646
|
}, [a("span", Jt, [l(k($), {
|
|
647
647
|
name: "btn-approve",
|
|
648
|
-
size:
|
|
648
|
+
size: ne.value
|
|
649
649
|
}, null, 8, ["size"])])], 2),
|
|
650
650
|
a("span", {
|
|
651
|
-
class: _(["zy-code__caret", { "is-hidden": !
|
|
651
|
+
class: _(["zy-code__caret", { "is-hidden": !H.value }]),
|
|
652
652
|
"aria-hidden": "true"
|
|
653
653
|
}, [...o[2] ||= [a("span", { class: "zy-code__caret-line" }, null, -1)]], 2)
|
|
654
654
|
], 44, qt), a("span", {
|
|
655
655
|
id: p,
|
|
656
656
|
class: "zy-code__sr",
|
|
657
657
|
"aria-live": "polite"
|
|
658
|
-
}, O(
|
|
658
|
+
}, O(B.value), 1)], 2));
|
|
659
659
|
}
|
|
660
660
|
}), [["__scopeId", "data-v-7dfd2a74"]]), "ZyCodeInput"), Qt = Z(/* @__PURE__ */ u({
|
|
661
661
|
inheritAttrs: !1,
|
|
@@ -666,7 +666,7 @@ var le = /*@__PURE__*/ u({
|
|
|
666
666
|
`u-${i}`,
|
|
667
667
|
String(r.popperClass ?? "")
|
|
668
668
|
].filter(Boolean).join(" "));
|
|
669
|
-
return (e, t) => (S(), n(k(
|
|
669
|
+
return (e, t) => (S(), n(k(H), h(e.$attrs, {
|
|
670
670
|
class: "zy-date-picker",
|
|
671
671
|
"popper-class": a.value
|
|
672
672
|
}), null, 16, ["popper-class"]));
|
|
@@ -705,8 +705,8 @@ var le = /*@__PURE__*/ u({
|
|
|
705
705
|
}),
|
|
706
706
|
emits: ["update:modelValue"],
|
|
707
707
|
setup(e) {
|
|
708
|
-
let t = Object.keys(
|
|
709
|
-
return (c, u) => (S(), n(k(
|
|
708
|
+
let t = Object.keys(N()).filter((e) => e !== "default" && e !== "footer" && e !== "header"), s = M(e, "modelValue");
|
|
709
|
+
return (c, u) => (S(), n(k(re), {
|
|
710
710
|
modelValue: s.value,
|
|
711
711
|
"onUpdate:modelValue": u[0] ||= (e) => s.value = e,
|
|
712
712
|
class: "zy-dialog",
|
|
@@ -718,18 +718,18 @@ var le = /*@__PURE__*/ u({
|
|
|
718
718
|
"destroy-on-close": e.destroyOnClose,
|
|
719
719
|
"align-center": ""
|
|
720
720
|
}, o({
|
|
721
|
-
header:
|
|
721
|
+
header: I(() => [E(c.$slots, "header", {}, () => [a("div", $t, [e.icon ? (S(), i("span", en, [l(jt, {
|
|
722
722
|
name: e.icon,
|
|
723
723
|
size: 16
|
|
724
724
|
}, null, 8, ["name"])])) : r("", !0), a("h4", tn, O(e.title), 1)])], !0)]),
|
|
725
|
-
default:
|
|
725
|
+
default: I(() => [E(c.$slots, "default", {}, void 0, !0)]),
|
|
726
726
|
_: 2
|
|
727
727
|
}, [T(k(t), (e) => ({
|
|
728
728
|
name: e,
|
|
729
|
-
fn:
|
|
729
|
+
fn: I((t) => [E(c.$slots, e, v(d(t)), void 0, !0)])
|
|
730
730
|
})), c.$slots.footer ? {
|
|
731
731
|
name: "footer",
|
|
732
|
-
fn:
|
|
732
|
+
fn: I(() => [E(c.$slots, "footer", {}, void 0, !0)]),
|
|
733
733
|
key: "0"
|
|
734
734
|
} : void 0]), 1032, [
|
|
735
735
|
"modelValue",
|
|
@@ -745,16 +745,16 @@ var le = /*@__PURE__*/ u({
|
|
|
745
745
|
__name: "ZyDivider",
|
|
746
746
|
props: { contentPosition: { default: "center" } },
|
|
747
747
|
setup(e) {
|
|
748
|
-
let t = Object.keys(
|
|
749
|
-
return (r, i) => (S(), n(k(
|
|
748
|
+
let t = Object.keys(N()).filter((e) => e !== "default");
|
|
749
|
+
return (r, i) => (S(), n(k(ie), {
|
|
750
750
|
class: "zy-divider",
|
|
751
751
|
"content-position": e.contentPosition
|
|
752
752
|
}, o({
|
|
753
|
-
default:
|
|
753
|
+
default: I(() => [E(r.$slots, "default", {}, void 0, !0)]),
|
|
754
754
|
_: 2
|
|
755
755
|
}, [T(k(t), (e) => ({
|
|
756
756
|
name: e,
|
|
757
|
-
fn:
|
|
757
|
+
fn: I((t) => [E(r.$slots, e, v(d(t)), void 0, !0)])
|
|
758
758
|
}))]), 1032, ["content-position"]));
|
|
759
759
|
}
|
|
760
760
|
}), [["__scopeId", "data-v-7d0fb238"]]), "ZyDivider"), an = {
|
|
@@ -787,8 +787,8 @@ var le = /*@__PURE__*/ u({
|
|
|
787
787
|
}),
|
|
788
788
|
emits: ["update:modelValue"],
|
|
789
789
|
setup(r) {
|
|
790
|
-
let s =
|
|
791
|
-
return (t, c) => (S(), n(k(
|
|
790
|
+
let s = M(r, "modelValue"), c = r, l = N(), u = t(() => c.effect === "underline" && c.label !== ""), f = t(() => Object.keys(l).filter((e) => e !== "default" && !(e === "prefix" && u.value))), p = t(() => [...c.label]), m = t(() => s.value !== "" && s.value !== null && s.value !== void 0);
|
|
791
|
+
return (t, c) => (S(), n(k(U), h(t.$attrs, {
|
|
792
792
|
modelValue: s.value,
|
|
793
793
|
"onUpdate:modelValue": c[0] ||= (e) => s.value = e,
|
|
794
794
|
class: ["zy-input", [`is-${r.effect}`, {
|
|
@@ -803,7 +803,7 @@ var le = /*@__PURE__*/ u({
|
|
|
803
803
|
disabled: r.disabled
|
|
804
804
|
}), o({ _: 2 }, [u.value ? {
|
|
805
805
|
name: "prefix",
|
|
806
|
-
fn:
|
|
806
|
+
fn: I(() => [a("span", an, [(S(!0), i(e, null, T(p.value, (e, t) => (S(), i("span", {
|
|
807
807
|
key: t,
|
|
808
808
|
class: "zy-input-label-char",
|
|
809
809
|
style: y({ transitionDelay: `${t * 50}ms` })
|
|
@@ -811,7 +811,7 @@ var le = /*@__PURE__*/ u({
|
|
|
811
811
|
key: "0"
|
|
812
812
|
} : void 0, T(f.value, (e) => ({
|
|
813
813
|
name: e,
|
|
814
|
-
fn:
|
|
814
|
+
fn: I((n) => [E(t.$slots, e, v(d(n)), void 0, !0)])
|
|
815
815
|
}))]), 1040, [
|
|
816
816
|
"modelValue",
|
|
817
817
|
"class",
|
|
@@ -840,7 +840,7 @@ var le = /*@__PURE__*/ u({
|
|
|
840
840
|
label: { default: "" }
|
|
841
841
|
},
|
|
842
842
|
setup(n) {
|
|
843
|
-
let o =
|
|
843
|
+
let o = N(), s = n, c = (e) => typeof e == "number" ? `${e}px` : e, l = t(() => (o.default?.() ?? []).map((e) => typeof e.children == "string" ? e.children : "").join("").trim() || "Loading..."), u = t(() => s.label || (s.type === "text" ? l.value : "")), d = t(() => {
|
|
844
844
|
let e = {
|
|
845
845
|
color: s.color,
|
|
846
846
|
"--zy-loading-speed": s.speed
|
|
@@ -878,10 +878,15 @@ var le = /*@__PURE__*/ u({
|
|
|
878
878
|
class: "zy-mega-menu__sub"
|
|
879
879
|
}, vn = ["aria-label"], yn = { class: "zy-mega-menu__items" }, bn = ["data-item", "onMouseenter"], xn = [
|
|
880
880
|
"aria-expanded",
|
|
881
|
+
"aria-current",
|
|
881
882
|
"aria-controls",
|
|
882
883
|
"onClick",
|
|
883
884
|
"onKeydown"
|
|
884
|
-
], Sn = [
|
|
885
|
+
], Sn = [
|
|
886
|
+
"href",
|
|
887
|
+
"aria-current",
|
|
888
|
+
"onClick"
|
|
889
|
+
], Cn = [
|
|
885
890
|
"id",
|
|
886
891
|
"data-panel",
|
|
887
892
|
"aria-label",
|
|
@@ -939,131 +944,142 @@ var le = /*@__PURE__*/ u({
|
|
|
939
944
|
props: {
|
|
940
945
|
items: { default: () => [] },
|
|
941
946
|
open: {},
|
|
947
|
+
active: {},
|
|
948
|
+
activeLink: {},
|
|
942
949
|
label: { default: "主导航" },
|
|
943
950
|
brand: { default: null }
|
|
944
951
|
},
|
|
945
|
-
emits: [
|
|
952
|
+
emits: [
|
|
953
|
+
"update:open",
|
|
954
|
+
"update:active",
|
|
955
|
+
"update:activeLink",
|
|
956
|
+
"navigate"
|
|
957
|
+
],
|
|
946
958
|
setup(o, { emit: s }) {
|
|
947
959
|
let l = o, u = s, d = w(null), f = t(() => l.open === void 0 ? d.value : l.open);
|
|
948
960
|
function p(e) {
|
|
949
961
|
l.open === void 0 && (d.value = e), u("update:open", e);
|
|
950
962
|
}
|
|
951
|
-
let m = (e) => f.value === e, h = w(null), v = w(
|
|
952
|
-
function
|
|
953
|
-
|
|
963
|
+
let m = (e) => f.value === e, h = w(null), v = w(null), C = t(() => l.active === void 0 ? h.value : l.active), A = t(() => l.activeLink === void 0 ? v.value : l.activeLink), j = (e) => C.value === e, M = (e, t) => j(e) && A.value === t.title;
|
|
964
|
+
function N(e, t) {
|
|
965
|
+
l.active === void 0 && (h.value = e), l.activeLink === void 0 && (v.value = t), u("update:active", e), u("update:activeLink", t);
|
|
966
|
+
}
|
|
967
|
+
let P = w(null), I = w({}), L = w({});
|
|
968
|
+
function R(e, t) {
|
|
969
|
+
I.value[e] = t ?? null;
|
|
954
970
|
}
|
|
955
|
-
function
|
|
956
|
-
|
|
971
|
+
function te(e, t) {
|
|
972
|
+
L.value[e] = t ?? null;
|
|
957
973
|
}
|
|
958
|
-
let
|
|
974
|
+
let ne = {
|
|
959
975
|
grid: 620,
|
|
960
976
|
list: 380,
|
|
961
977
|
groups: 600
|
|
962
978
|
};
|
|
963
|
-
function
|
|
979
|
+
function z(e) {
|
|
964
980
|
return e.layout ?? "grid";
|
|
965
981
|
}
|
|
966
|
-
function
|
|
967
|
-
return e.width ??
|
|
982
|
+
function B(e) {
|
|
983
|
+
return e.width ?? ne[z(e)];
|
|
968
984
|
}
|
|
969
|
-
function
|
|
970
|
-
return e.offset ?? (
|
|
985
|
+
function V(e) {
|
|
986
|
+
return e.offset ?? (z(e) === "groups" ? -150 : 0);
|
|
971
987
|
}
|
|
972
|
-
let
|
|
973
|
-
function
|
|
974
|
-
let t = l.items.find((t) => t.key === e)?.panel, n =
|
|
975
|
-
if (!t || !n || !
|
|
976
|
-
let r = n.getBoundingClientRect(), i =
|
|
988
|
+
let H = w({});
|
|
989
|
+
function re(e) {
|
|
990
|
+
let t = l.items.find((t) => t.key === e)?.panel, n = P.value?.querySelector(`[data-item="${e}"]`);
|
|
991
|
+
if (!t || !n || !P.value) return;
|
|
992
|
+
let r = n.getBoundingClientRect(), i = P.value.getBoundingClientRect(), a = B(t), o = V(t), s = r.left + o + a - (i.right - tr);
|
|
977
993
|
s > 0 && (o -= s);
|
|
978
994
|
let c = i.left + tr - (r.left + o);
|
|
979
|
-
c > 0 && (o += c),
|
|
980
|
-
...
|
|
995
|
+
c > 0 && (o += c), H.value = {
|
|
996
|
+
...H.value,
|
|
981
997
|
[e]: o
|
|
982
998
|
};
|
|
983
999
|
}
|
|
984
|
-
function
|
|
1000
|
+
function ie(e) {
|
|
985
1001
|
if (e.panel) return {
|
|
986
|
-
width: `${
|
|
987
|
-
left: `${
|
|
1002
|
+
width: `${B(e.panel)}px`,
|
|
1003
|
+
left: `${H.value[e.key] ?? V(e.panel)}px`
|
|
988
1004
|
};
|
|
989
1005
|
}
|
|
990
|
-
let
|
|
991
|
-
function
|
|
992
|
-
|
|
1006
|
+
let U;
|
|
1007
|
+
function W() {
|
|
1008
|
+
U !== void 0 && (window.clearTimeout(U), U = void 0);
|
|
993
1009
|
}
|
|
994
|
-
function
|
|
995
|
-
|
|
996
|
-
p(null),
|
|
1010
|
+
function ae() {
|
|
1011
|
+
W(), U = window.setTimeout(() => {
|
|
1012
|
+
p(null), U = void 0;
|
|
997
1013
|
}, 160);
|
|
998
1014
|
}
|
|
999
|
-
function
|
|
1015
|
+
function oe() {
|
|
1000
1016
|
return window.matchMedia("(hover: hover) and (pointer: fine)").matches;
|
|
1001
1017
|
}
|
|
1002
|
-
function
|
|
1003
|
-
e.panel &&
|
|
1018
|
+
function G(e) {
|
|
1019
|
+
e.panel && oe() && (W(), m(e.key) || p(e.key));
|
|
1004
1020
|
}
|
|
1005
|
-
function
|
|
1006
|
-
|
|
1021
|
+
function K(e) {
|
|
1022
|
+
W(), p(m(e) ? null : e);
|
|
1007
1023
|
}
|
|
1008
|
-
function
|
|
1024
|
+
function q(e = !1) {
|
|
1009
1025
|
let t = f.value;
|
|
1010
|
-
|
|
1026
|
+
W(), p(null), e && t && I.value[t]?.focus();
|
|
1011
1027
|
}
|
|
1012
|
-
function
|
|
1013
|
-
return
|
|
1028
|
+
function J(e) {
|
|
1029
|
+
return P.value?.querySelector(`[data-panel="${e}"]`) ?? null;
|
|
1014
1030
|
}
|
|
1015
|
-
function
|
|
1016
|
-
e.preventDefault(), p(t), window.setTimeout(() =>
|
|
1031
|
+
function se(e, t) {
|
|
1032
|
+
e.preventDefault(), p(t), window.setTimeout(() => J(t)?.querySelector("a, button")?.focus(), 0);
|
|
1017
1033
|
}
|
|
1018
|
-
let
|
|
1019
|
-
function
|
|
1020
|
-
let n =
|
|
1034
|
+
let Y = {}, X = 0;
|
|
1035
|
+
function ce(e, t) {
|
|
1036
|
+
let n = L.value[e], r = J(e);
|
|
1021
1037
|
if (!n || !r) return;
|
|
1022
1038
|
let i = t.getBoundingClientRect(), a = r.getBoundingClientRect();
|
|
1023
|
-
|
|
1024
|
-
let t =
|
|
1039
|
+
Y[e] || (n.style.transition = "none"), n.style.width = `${i.width}px`, n.style.height = `${i.height}px`, n.style.transform = `translate(${i.left - a.left}px, ${i.top - a.top}px)`, n.style.opacity = "1", Y[e] || (Y[e] = !0, cancelAnimationFrame(X), X = requestAnimationFrame(() => {
|
|
1040
|
+
let t = L.value[e];
|
|
1025
1041
|
t && (t.style.transition = "");
|
|
1026
1042
|
}));
|
|
1027
1043
|
}
|
|
1028
|
-
function
|
|
1044
|
+
function Z(e, t) {
|
|
1029
1045
|
let n = e.target?.closest(nr);
|
|
1030
|
-
n &&
|
|
1046
|
+
n && ce(t, n);
|
|
1031
1047
|
}
|
|
1032
|
-
function
|
|
1033
|
-
|
|
1034
|
-
let t =
|
|
1048
|
+
function le(e) {
|
|
1049
|
+
Y[e] = !1;
|
|
1050
|
+
let t = L.value[e];
|
|
1035
1051
|
t && (t.style.opacity = "0");
|
|
1036
1052
|
}
|
|
1037
|
-
function
|
|
1038
|
-
t.href || n.preventDefault(), u("navigate", {
|
|
1053
|
+
function Q(e, t, n) {
|
|
1054
|
+
t.href || n.preventDefault(), N(e.key, t.title), u("navigate", {
|
|
1039
1055
|
item: e,
|
|
1040
1056
|
title: t.title,
|
|
1041
1057
|
href: t.href,
|
|
1042
1058
|
event: n
|
|
1043
1059
|
});
|
|
1044
1060
|
}
|
|
1045
|
-
function
|
|
1046
|
-
|
|
1061
|
+
function ue(e) {
|
|
1062
|
+
P.value?.contains(e.target) || q();
|
|
1047
1063
|
}
|
|
1048
|
-
function
|
|
1049
|
-
e.key === "Escape" &&
|
|
1064
|
+
function de(e) {
|
|
1065
|
+
e.key === "Escape" && q(!0);
|
|
1050
1066
|
}
|
|
1051
|
-
function
|
|
1052
|
-
f.value &&
|
|
1067
|
+
function fe() {
|
|
1068
|
+
f.value && re(f.value);
|
|
1053
1069
|
}
|
|
1054
|
-
return
|
|
1055
|
-
for (let e of l.items)
|
|
1056
|
-
e && (await g(),
|
|
1070
|
+
return F(f, async (e) => {
|
|
1071
|
+
for (let e of l.items) le(e.key);
|
|
1072
|
+
e && (await g(), re(e));
|
|
1057
1073
|
}), x(() => {
|
|
1058
|
-
document.addEventListener("pointerdown",
|
|
1074
|
+
document.addEventListener("pointerdown", ue), document.addEventListener("keydown", de), window.addEventListener("resize", fe);
|
|
1059
1075
|
}), b(() => {
|
|
1060
|
-
|
|
1076
|
+
W(), cancelAnimationFrame(X), document.removeEventListener("pointerdown", ue), document.removeEventListener("keydown", de), window.removeEventListener("resize", fe);
|
|
1061
1077
|
}), (t, s) => (S(), i("div", {
|
|
1062
1078
|
ref_key: "root",
|
|
1063
|
-
ref:
|
|
1079
|
+
ref: P,
|
|
1064
1080
|
class: "zy-mega-menu",
|
|
1065
|
-
onMouseenter:
|
|
1066
|
-
onMouseleave:
|
|
1081
|
+
onMouseenter: W,
|
|
1082
|
+
onMouseleave: ae
|
|
1067
1083
|
}, [a("div", pn, [
|
|
1068
1084
|
E(t.$slots, "brand", {}, () => [o.brand ? (S(), i("a", {
|
|
1069
1085
|
key: 0,
|
|
@@ -1081,17 +1097,21 @@ var le = /*@__PURE__*/ u({
|
|
|
1081
1097
|
key: o.key,
|
|
1082
1098
|
"data-item": o.key,
|
|
1083
1099
|
class: "zy-mega-menu__item",
|
|
1084
|
-
onMouseenter: (e) =>
|
|
1100
|
+
onMouseenter: (e) => G(o)
|
|
1085
1101
|
}, [o.panel ? (S(), i("button", {
|
|
1086
1102
|
key: 0,
|
|
1087
1103
|
ref_for: !0,
|
|
1088
|
-
ref: (e) =>
|
|
1104
|
+
ref: (e) => R(o.key, e),
|
|
1089
1105
|
type: "button",
|
|
1090
|
-
class: _(["zy-mega-menu__trigger", {
|
|
1106
|
+
class: _(["zy-mega-menu__trigger", {
|
|
1107
|
+
"is-open": m(o.key),
|
|
1108
|
+
"is-current": j(o.key)
|
|
1109
|
+
}]),
|
|
1091
1110
|
"aria-expanded": m(o.key),
|
|
1111
|
+
"aria-current": j(o.key) ? "page" : void 0,
|
|
1092
1112
|
"aria-controls": `zy-mm-panel-${o.key}`,
|
|
1093
|
-
onClick: (e) =>
|
|
1094
|
-
onKeydown:
|
|
1113
|
+
onClick: (e) => K(o.key),
|
|
1114
|
+
onKeydown: ee((e) => se(e, o.key), ["down"])
|
|
1095
1115
|
}, [c(O(o.label) + " ", 1), s[0] ||= a("svg", {
|
|
1096
1116
|
class: "zy-mega-menu__chevron",
|
|
1097
1117
|
viewBox: "0 0 12 12",
|
|
@@ -1105,35 +1125,39 @@ var le = /*@__PURE__*/ u({
|
|
|
1105
1125
|
"stroke-linejoin": "round"
|
|
1106
1126
|
})], -1)], 42, xn)) : (S(), i("a", {
|
|
1107
1127
|
key: 1,
|
|
1108
|
-
class: "zy-mega-menu__plain",
|
|
1128
|
+
class: _(["zy-mega-menu__plain", { "is-current": j(o.key) }]),
|
|
1109
1129
|
href: o.href ?? "#",
|
|
1110
|
-
|
|
1130
|
+
"aria-current": j(o.key) ? "page" : void 0,
|
|
1131
|
+
onClick: (e) => Q(o, {
|
|
1111
1132
|
title: o.label,
|
|
1112
1133
|
href: o.href
|
|
1113
1134
|
}, e)
|
|
1114
|
-
}, O(o.label),
|
|
1135
|
+
}, O(o.label), 11, Sn)), o.panel ? (S(), i("div", {
|
|
1115
1136
|
key: 2,
|
|
1116
1137
|
id: `zy-mm-panel-${o.key}`,
|
|
1117
1138
|
"data-panel": o.key,
|
|
1118
|
-
class: _(["zy-mega-menu__panel", [`is-${
|
|
1119
|
-
style: y(
|
|
1139
|
+
class: _(["zy-mega-menu__panel", [`is-${z(o.panel)}`, { "is-open": m(o.key) }]]),
|
|
1140
|
+
style: y(ie(o)),
|
|
1120
1141
|
role: "group",
|
|
1121
1142
|
"aria-label": `${o.label}菜单`,
|
|
1122
1143
|
"aria-hidden": !m(o.key),
|
|
1123
1144
|
inert: !m(o.key) || void 0,
|
|
1124
|
-
onMouseenter:
|
|
1125
|
-
onMouseover: (e) =>
|
|
1126
|
-
onMouseleave: (e) =>
|
|
1145
|
+
onMouseenter: W,
|
|
1146
|
+
onMouseover: (e) => Z(e, o.key),
|
|
1147
|
+
onMouseleave: (e) => le(o.key)
|
|
1127
1148
|
}, [a("span", {
|
|
1128
1149
|
ref_for: !0,
|
|
1129
|
-
ref: (e) =>
|
|
1150
|
+
ref: (e) => te(o.key, e),
|
|
1130
1151
|
class: "zy-mega-menu__glide",
|
|
1131
1152
|
"aria-hidden": "true"
|
|
1132
|
-
}, null, 512), E(t.$slots, `panel-${o.key}`, { item: o }, () => [
|
|
1153
|
+
}, null, 512), E(t.$slots, `panel-${o.key}`, { item: o }, () => [z(o.panel) === "grid" ? (S(), i(e, { key: 0 }, [a("div", wn, [(S(!0), i(e, null, T(o.panel.links, (e) => (S(), i("a", {
|
|
1133
1154
|
key: e.title,
|
|
1134
|
-
class: _(["zy-mega-menu__link", {
|
|
1155
|
+
class: _(["zy-mega-menu__link", {
|
|
1156
|
+
"is-compact": !e.desc,
|
|
1157
|
+
"is-current": M(o.key, e)
|
|
1158
|
+
}]),
|
|
1135
1159
|
href: e.href ?? "#",
|
|
1136
|
-
onClick: (t) =>
|
|
1160
|
+
onClick: (t) => Q(o, e, t)
|
|
1137
1161
|
}, [e.icon ? (S(), i("span", En, [typeof e.icon == "string" ? (S(), n(k($), {
|
|
1138
1162
|
key: 0,
|
|
1139
1163
|
name: e.icon,
|
|
@@ -1142,12 +1166,15 @@ var le = /*@__PURE__*/ u({
|
|
|
1142
1166
|
key: 0,
|
|
1143
1167
|
class: "zy-mega-menu__more",
|
|
1144
1168
|
href: o.panel.footer.link.href ?? "#",
|
|
1145
|
-
onClick: (e) =>
|
|
1146
|
-
}, [c(O(o.panel.footer.link.title) + " ", 1), s[1] ||= a("span", { "aria-hidden": "true" }, "→", -1)], 8, Nn)) : r("", !0)])) : r("", !0)], 64)) :
|
|
1169
|
+
onClick: (e) => Q(o, o.panel.footer.link, e)
|
|
1170
|
+
}, [c(O(o.panel.footer.link.title) + " ", 1), s[1] ||= a("span", { "aria-hidden": "true" }, "→", -1)], 8, Nn)) : r("", !0)])) : r("", !0)], 64)) : z(o.panel) === "list" ? (S(), i(e, { key: 1 }, [a("div", Pn, [(S(!0), i(e, null, T(o.panel.links, (e) => (S(), i("a", {
|
|
1147
1171
|
key: e.title,
|
|
1148
|
-
class: _(["zy-mega-menu__link", {
|
|
1172
|
+
class: _(["zy-mega-menu__link", {
|
|
1173
|
+
"is-compact": !e.desc,
|
|
1174
|
+
"is-current": M(o.key, e)
|
|
1175
|
+
}]),
|
|
1149
1176
|
href: e.href ?? "#",
|
|
1150
|
-
onClick: (t) =>
|
|
1177
|
+
onClick: (t) => Q(o, e, t)
|
|
1151
1178
|
}, [e.icon ? (S(), i("span", In, [typeof e.icon == "string" ? (S(), n(k($), {
|
|
1152
1179
|
key: 0,
|
|
1153
1180
|
name: e.icon,
|
|
@@ -1159,7 +1186,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1159
1186
|
key: 1,
|
|
1160
1187
|
class: "zy-mega-menu__more",
|
|
1161
1188
|
href: o.panel.card.link.href ?? "#",
|
|
1162
|
-
onClick: (e) =>
|
|
1189
|
+
onClick: (e) => Q(o, o.panel.card.link, e)
|
|
1163
1190
|
}, [c(O(o.panel.card.link.title) + " ", 1), s[2] ||= a("span", { "aria-hidden": "true" }, "→", -1)], 8, Wn)) : r("", !0)
|
|
1164
1191
|
])) : r("", !0)], 64)) : (S(), i(e, { key: 2 }, [o.panel.card ? (S(), i("div", Gn, [
|
|
1165
1192
|
o.panel.card.kicker ? (S(), i("span", Kn, O(o.panel.card.kicker), 1)) : r("", !0),
|
|
@@ -1169,29 +1196,29 @@ var le = /*@__PURE__*/ u({
|
|
|
1169
1196
|
key: 2,
|
|
1170
1197
|
class: "zy-mega-menu__more",
|
|
1171
1198
|
href: o.panel.card.link.href ?? "#",
|
|
1172
|
-
onClick: (e) =>
|
|
1199
|
+
onClick: (e) => Q(o, o.panel.card.link, e)
|
|
1173
1200
|
}, [c(O(o.panel.card.link.title) + " ", 1), s[3] ||= a("span", { "aria-hidden": "true" }, "→", -1)], 8, Yn)) : r("", !0)
|
|
1174
1201
|
])) : r("", !0), a("div", Xn, [(S(!0), i(e, null, T(o.panel.groups, (t) => (S(), i("div", {
|
|
1175
1202
|
key: t.title,
|
|
1176
1203
|
class: "zy-mega-menu__group"
|
|
1177
1204
|
}, [a("p", Zn, O(t.title), 1), (S(!0), i(e, null, T(t.links, (e) => (S(), i("a", {
|
|
1178
1205
|
key: e.title,
|
|
1179
|
-
class: "zy-mega-menu__group-link",
|
|
1206
|
+
class: _(["zy-mega-menu__group-link", { "is-current": M(o.key, e) }]),
|
|
1180
1207
|
href: e.href ?? "#",
|
|
1181
|
-
onClick: (t) =>
|
|
1208
|
+
onClick: (t) => Q(o, e, t)
|
|
1182
1209
|
}, [e.icon ? (S(), i("span", $n, [typeof e.icon == "string" ? (S(), n(k($), {
|
|
1183
1210
|
key: 0,
|
|
1184
1211
|
name: e.icon,
|
|
1185
1212
|
size: 13
|
|
1186
|
-
}, null, 8, ["name"])) : (S(), n(D(e.icon), { key: 1 }))])) : r("", !0), c(" " + O(e.title), 1)],
|
|
1213
|
+
}, null, 8, ["name"])) : (S(), n(D(e.icon), { key: 1 }))])) : r("", !0), c(" " + O(e.title), 1)], 10, Qn))), 128))]))), 128))])], 64))], !0)], 46, Cn)) : r("", !0)], 40, bn))), 128))])], 8, vn),
|
|
1187
1214
|
t.$slots.actions ? (S(), i("div", er, [E(t.$slots, "actions", {}, void 0, !0)])) : r("", !0)
|
|
1188
1215
|
])], 544));
|
|
1189
1216
|
}
|
|
1190
|
-
}), [["__scopeId", "data-v-
|
|
1217
|
+
}), [["__scopeId", "data-v-7dbab3b4"]]), "ZyMegaMenu"), ir = Z(/* @__PURE__ */ u({
|
|
1191
1218
|
inheritAttrs: !1,
|
|
1192
1219
|
__name: "ZyPagination",
|
|
1193
1220
|
setup(e) {
|
|
1194
|
-
return (e, t) => (S(), n(k(
|
|
1221
|
+
return (e, t) => (S(), n(k(W), h({ class: "zy-pagination" }, e.$attrs), null, 16));
|
|
1195
1222
|
}
|
|
1196
1223
|
}), "ZyPagination"), ar = { class: "zy-panel" }, or = {
|
|
1197
1224
|
key: 0,
|
|
@@ -1200,7 +1227,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1200
1227
|
__name: "ZyPanel",
|
|
1201
1228
|
props: { title: { default: "" } },
|
|
1202
1229
|
setup(e) {
|
|
1203
|
-
let n = e, o =
|
|
1230
|
+
let n = e, o = N(), s = t(() => !!n.title || !!o.header);
|
|
1204
1231
|
return (t, n) => (S(), i("section", ar, [s.value ? (S(), i("header", or, [E(t.$slots, "header", {}, () => [c(O(e.title), 1)], !0)])) : r("", !0), a("div", sr, [E(t.$slots, "default", {}, void 0, !0)])]));
|
|
1205
1232
|
}
|
|
1206
1233
|
}), [["__scopeId", "data-v-f87a71da"]]), "ZyPanel"), lr = Z(/* @__PURE__ */ Q(/* @__PURE__ */ u({
|
|
@@ -1215,8 +1242,8 @@ var le = /*@__PURE__*/ u({
|
|
|
1215
1242
|
}
|
|
1216
1243
|
},
|
|
1217
1244
|
setup(e) {
|
|
1218
|
-
let t = Object.keys(
|
|
1219
|
-
return (r, i) => (S(), n(k(
|
|
1245
|
+
let t = Object.keys(N()).filter((e) => e !== "default");
|
|
1246
|
+
return (r, i) => (S(), n(k(ae), {
|
|
1220
1247
|
class: "zy-progress",
|
|
1221
1248
|
percentage: e.percentage,
|
|
1222
1249
|
type: e.type,
|
|
@@ -1224,7 +1251,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1224
1251
|
"show-text": e.showText
|
|
1225
1252
|
}, o({ _: 2 }, [T(k(t), (e) => ({
|
|
1226
1253
|
name: e,
|
|
1227
|
-
fn:
|
|
1254
|
+
fn: I((t) => [E(r.$slots, e, v(d(t)), void 0, !0)])
|
|
1228
1255
|
}))]), 1032, [
|
|
1229
1256
|
"percentage",
|
|
1230
1257
|
"type",
|
|
@@ -1262,8 +1289,8 @@ var le = /*@__PURE__*/ u({
|
|
|
1262
1289
|
}),
|
|
1263
1290
|
emits: ["update:modelValue"],
|
|
1264
1291
|
setup(e) {
|
|
1265
|
-
let r = Object.keys(
|
|
1266
|
-
return (t, a) => (S(), n(k(
|
|
1292
|
+
let r = Object.keys(N()).filter((e) => e !== "default"), i = M(e, "modelValue"), a = e, s = p(ur, void 0), c = t(() => a.effect ?? s?.value ?? "");
|
|
1293
|
+
return (t, a) => (S(), n(k(oe), h(t.$attrs, {
|
|
1267
1294
|
modelValue: i.value,
|
|
1268
1295
|
"onUpdate:modelValue": a[0] ||= (e) => i.value = e,
|
|
1269
1296
|
class: ["zy-radio", `is-${c.value}`],
|
|
@@ -1272,11 +1299,11 @@ var le = /*@__PURE__*/ u({
|
|
|
1272
1299
|
value: e.value,
|
|
1273
1300
|
label: e.label
|
|
1274
1301
|
}), o({
|
|
1275
|
-
default:
|
|
1302
|
+
default: I(() => [E(t.$slots, "default", {}, void 0, !0)]),
|
|
1276
1303
|
_: 2
|
|
1277
1304
|
}, [T(k(r), (e) => ({
|
|
1278
1305
|
name: e,
|
|
1279
|
-
fn:
|
|
1306
|
+
fn: I((n) => [E(t.$slots, e, v(d(n)), void 0, !0)])
|
|
1280
1307
|
}))]), 1040, [
|
|
1281
1308
|
"modelValue",
|
|
1282
1309
|
"class",
|
|
@@ -1315,7 +1342,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1315
1342
|
}),
|
|
1316
1343
|
emits: ["update:modelValue"],
|
|
1317
1344
|
setup(e) {
|
|
1318
|
-
let t = Object.keys(
|
|
1345
|
+
let t = Object.keys(N()).filter((e) => e !== "default"), r = M(e, "modelValue");
|
|
1319
1346
|
return (i, a) => (S(), n(k(G), h(i.$attrs, {
|
|
1320
1347
|
modelValue: r.value,
|
|
1321
1348
|
"onUpdate:modelValue": a[0] ||= (e) => r.value = e,
|
|
@@ -1325,11 +1352,11 @@ var le = /*@__PURE__*/ u({
|
|
|
1325
1352
|
value: e.value,
|
|
1326
1353
|
label: e.label
|
|
1327
1354
|
}), o({
|
|
1328
|
-
default:
|
|
1355
|
+
default: I(() => [E(i.$slots, "default", {}, void 0, !0)]),
|
|
1329
1356
|
_: 2
|
|
1330
1357
|
}, [T(k(t), (e) => ({
|
|
1331
1358
|
name: e,
|
|
1332
|
-
fn:
|
|
1359
|
+
fn: I((t) => [E(i.$slots, e, v(d(t)), void 0, !0)])
|
|
1333
1360
|
}))]), 1040, [
|
|
1334
1361
|
"modelValue",
|
|
1335
1362
|
"size",
|
|
@@ -1354,7 +1381,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1354
1381
|
}),
|
|
1355
1382
|
emits: ["update:modelValue"],
|
|
1356
1383
|
setup(e) {
|
|
1357
|
-
let a = Object.keys(
|
|
1384
|
+
let a = Object.keys(N()).filter((e) => e !== "default"), s = M(e, "modelValue"), c = e;
|
|
1358
1385
|
C(ur, t(() => c.effect ?? ""));
|
|
1359
1386
|
let l = w(null), u = w(void 0), f = w(!1), p, m, D;
|
|
1360
1387
|
function O() {
|
|
@@ -1378,7 +1405,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1378
1405
|
}));
|
|
1379
1406
|
}), b(() => {
|
|
1380
1407
|
p?.disconnect(), m?.disconnect(), clearTimeout(D);
|
|
1381
|
-
}),
|
|
1408
|
+
}), F([() => s.value, () => c.size], () => g(O), { immediate: !0 }), F(() => s.value, () => {
|
|
1382
1409
|
u.value && (f.value = !0, clearTimeout(D), D = setTimeout(() => f.value = !1, 320));
|
|
1383
1410
|
}), (t, c) => (S(), n(k(K), h(t.$attrs, {
|
|
1384
1411
|
modelValue: s.value,
|
|
@@ -1389,7 +1416,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1389
1416
|
size: e.size,
|
|
1390
1417
|
disabled: e.disabled
|
|
1391
1418
|
}), o({
|
|
1392
|
-
default:
|
|
1419
|
+
default: I(() => [u.value ? (S(), i("span", {
|
|
1393
1420
|
key: 0,
|
|
1394
1421
|
class: _(["zy-radio-button-slider", { "is-pulse": f.value }]),
|
|
1395
1422
|
style: y(u.value),
|
|
@@ -1398,7 +1425,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1398
1425
|
_: 2
|
|
1399
1426
|
}, [T(k(a), (e) => ({
|
|
1400
1427
|
name: e,
|
|
1401
|
-
fn:
|
|
1428
|
+
fn: I((n) => [E(t.$slots, e, v(d(n)), void 0, !0)])
|
|
1402
1429
|
}))]), 1040, [
|
|
1403
1430
|
"modelValue",
|
|
1404
1431
|
"size",
|
|
@@ -1430,7 +1457,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1430
1457
|
}),
|
|
1431
1458
|
emits: ["update:modelValue"],
|
|
1432
1459
|
setup(e) {
|
|
1433
|
-
let r = A(), i = Object.keys(
|
|
1460
|
+
let r = A(), i = Object.keys(N()).filter((e) => e !== "default"), a = M(e, "modelValue"), s = `g${Math.random().toString(36).slice(2, 8)}`, c = t(() => [
|
|
1434
1461
|
"zy-select-popper",
|
|
1435
1462
|
`u-${s}`,
|
|
1436
1463
|
String(r.popperClass ?? "")
|
|
@@ -1471,11 +1498,11 @@ var le = /*@__PURE__*/ u({
|
|
|
1471
1498
|
"popper-class": c.value,
|
|
1472
1499
|
onVisibleChange: y
|
|
1473
1500
|
}), o({
|
|
1474
|
-
default:
|
|
1501
|
+
default: I(() => [E(t.$slots, "default", {}, void 0, !0)]),
|
|
1475
1502
|
_: 2
|
|
1476
1503
|
}, [T(k(i), (e) => ({
|
|
1477
1504
|
name: e,
|
|
1478
|
-
fn:
|
|
1505
|
+
fn: I((n) => [E(t.$slots, e, v(d(n)), void 0, !0)])
|
|
1479
1506
|
}))]), 1040, [
|
|
1480
1507
|
"modelValue",
|
|
1481
1508
|
"class",
|
|
@@ -1622,7 +1649,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1622
1649
|
class: "zy-verify__refresh",
|
|
1623
1650
|
"aria-label": e.refreshLabel,
|
|
1624
1651
|
disabled: e.disabled,
|
|
1625
|
-
onPointerdown: n[0] ||=
|
|
1652
|
+
onPointerdown: n[0] ||= R(() => {}, ["stop"]),
|
|
1626
1653
|
onClick: A
|
|
1627
1654
|
}, [l(k($), {
|
|
1628
1655
|
name: "btn-reset",
|
|
@@ -1652,18 +1679,18 @@ var le = /*@__PURE__*/ u({
|
|
|
1652
1679
|
}
|
|
1653
1680
|
},
|
|
1654
1681
|
setup(e) {
|
|
1655
|
-
let t = Object.keys(
|
|
1682
|
+
let t = Object.keys(N()).filter((e) => e !== "default");
|
|
1656
1683
|
return (r, i) => (S(), n(k(J), {
|
|
1657
1684
|
class: "zy-space",
|
|
1658
1685
|
size: e.size,
|
|
1659
1686
|
direction: e.direction,
|
|
1660
1687
|
wrap: e.wrap
|
|
1661
1688
|
}, o({
|
|
1662
|
-
default:
|
|
1689
|
+
default: I(() => [E(r.$slots, "default")]),
|
|
1663
1690
|
_: 2
|
|
1664
1691
|
}, [T(k(t), (e) => ({
|
|
1665
1692
|
name: e,
|
|
1666
|
-
fn:
|
|
1693
|
+
fn: I((t) => [E(r.$slots, e, v(d(t)))])
|
|
1667
1694
|
}))]), 1032, [
|
|
1668
1695
|
"size",
|
|
1669
1696
|
"direction",
|
|
@@ -1705,11 +1732,11 @@ var le = /*@__PURE__*/ u({
|
|
|
1705
1732
|
}),
|
|
1706
1733
|
emits: ["update:modelValue"],
|
|
1707
1734
|
setup(t) {
|
|
1708
|
-
let n =
|
|
1735
|
+
let n = M(t, "modelValue"), r = j();
|
|
1709
1736
|
return (o, s) => (S(), i("div", { class: _(["zy-switch", {
|
|
1710
1737
|
"is-checked": n.value,
|
|
1711
1738
|
"is-disabled": t.disabled
|
|
1712
|
-
}]) }, [a("div", Or, [
|
|
1739
|
+
}]) }, [a("div", Or, [L(a("input", {
|
|
1713
1740
|
id: k(r),
|
|
1714
1741
|
"onUpdate:modelValue": s[0] ||= (e) => n.value = e,
|
|
1715
1742
|
class: "zy-switch-input",
|
|
@@ -1717,7 +1744,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1717
1744
|
role: "switch",
|
|
1718
1745
|
disabled: t.disabled,
|
|
1719
1746
|
"aria-label": t.label || void 0
|
|
1720
|
-
}, null, 8, kr), [[
|
|
1747
|
+
}, null, 8, kr), [[P, n.value]]), a("label", {
|
|
1721
1748
|
class: "zy-switch-track",
|
|
1722
1749
|
for: k(r)
|
|
1723
1750
|
}, [
|
|
@@ -1763,16 +1790,16 @@ var le = /*@__PURE__*/ u({
|
|
|
1763
1790
|
__name: "ZyTable",
|
|
1764
1791
|
props: { lines: { default: "all" } },
|
|
1765
1792
|
setup(e) {
|
|
1766
|
-
let t = Object.keys(
|
|
1767
|
-
return (n, r) => (S(), i("div", { class: _(["zy-table-tray", `is-lines-${e.lines}`]) }, [l(k(
|
|
1768
|
-
default:
|
|
1793
|
+
let t = Object.keys(N()).filter((e) => e !== "default");
|
|
1794
|
+
return (n, r) => (S(), i("div", { class: _(["zy-table-tray", `is-lines-${e.lines}`]) }, [l(k(se), h({ class: ["zy-table", `is-lines-${e.lines}`] }, n.$attrs), o({
|
|
1795
|
+
default: I(() => [E(n.$slots, "default", {}, void 0, !0)]),
|
|
1769
1796
|
_: 2
|
|
1770
1797
|
}, [T(k(t), (e) => ({
|
|
1771
1798
|
name: e,
|
|
1772
|
-
fn:
|
|
1799
|
+
fn: I((t) => [E(n.$slots, e, v(d(t)), void 0, !0)])
|
|
1773
1800
|
}))]), 1040, ["class"])], 2));
|
|
1774
1801
|
}
|
|
1775
|
-
}), [["__scopeId", "data-v-
|
|
1802
|
+
}), [["__scopeId", "data-v-893fbb80"]]), "ZyTable"), Br = { class: "zy-tag-fill-label" }, Vr = Z(/* @__PURE__ */ Q(/* @__PURE__ */ u({
|
|
1776
1803
|
__name: "ZyTag",
|
|
1777
1804
|
props: {
|
|
1778
1805
|
type: { default: "primary" },
|
|
@@ -1783,7 +1810,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1783
1810
|
}
|
|
1784
1811
|
},
|
|
1785
1812
|
setup(r) {
|
|
1786
|
-
let s = Object.keys(
|
|
1813
|
+
let s = Object.keys(N()).filter((e) => e !== "default"), c = r, l = w(typeof document > "u" ? "basic" : document.documentElement.dataset.zyTheme || "basic"), u = () => {
|
|
1787
1814
|
l.value = document.documentElement.dataset.zyTheme || "basic";
|
|
1788
1815
|
}, f;
|
|
1789
1816
|
x(() => {
|
|
@@ -1796,13 +1823,13 @@ var le = /*@__PURE__*/ u({
|
|
|
1796
1823
|
let e = c.effect;
|
|
1797
1824
|
return e === "fill" ? p.value ? void 0 : "light" : e;
|
|
1798
1825
|
});
|
|
1799
|
-
return (t, c) => (S(), n(k(
|
|
1826
|
+
return (t, c) => (S(), n(k(Y), {
|
|
1800
1827
|
class: _(["zy-tag", { "is-fill": p.value }]),
|
|
1801
1828
|
type: r.type,
|
|
1802
1829
|
effect: m.value,
|
|
1803
1830
|
round: r.round
|
|
1804
1831
|
}, o({
|
|
1805
|
-
default:
|
|
1832
|
+
default: I(() => [p.value ? (S(), i(e, { key: 0 }, [
|
|
1806
1833
|
c[0] ||= a("span", {
|
|
1807
1834
|
class: "zy-tag-fill-wave zy-tag-fill-wave-l",
|
|
1808
1835
|
"aria-hidden": "true"
|
|
@@ -1836,7 +1863,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1836
1863
|
_: 2
|
|
1837
1864
|
}, [T(k(s), (e) => ({
|
|
1838
1865
|
name: e,
|
|
1839
|
-
fn:
|
|
1866
|
+
fn: I((n) => [E(t.$slots, e, v(d(n)), void 0, !0)])
|
|
1840
1867
|
}))]), 1032, [
|
|
1841
1868
|
"class",
|
|
1842
1869
|
"type",
|
|
@@ -1853,7 +1880,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1853
1880
|
`u-${i}`,
|
|
1854
1881
|
String(r.popperClass ?? "")
|
|
1855
1882
|
].filter(Boolean).join(" "));
|
|
1856
|
-
return (e, t) => (S(), n(k(
|
|
1883
|
+
return (e, t) => (S(), n(k(X), h(e.$attrs, {
|
|
1857
1884
|
class: "zy-time-picker",
|
|
1858
1885
|
"popper-class": a.value
|
|
1859
1886
|
}), null, 16, ["popper-class"]));
|
|
@@ -1867,7 +1894,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1867
1894
|
fileIcon: { default: "file" }
|
|
1868
1895
|
},
|
|
1869
1896
|
setup(e) {
|
|
1870
|
-
let n = e, r =
|
|
1897
|
+
let n = e, r = N(), s = t(() => Object.keys(r).filter((e) => e !== "default")), c = t(() => !!r.default), p = (e) => (e.isLeaf || !e.expanded ? e.data?.icon : e.data?.iconOpen ?? e.data?.icon) ?? (e.isLeaf ? n.fileIcon : e.expanded ? n.folderOpenIcon : n.folderIcon), m = u({
|
|
1871
1898
|
props: { icon: {
|
|
1872
1899
|
type: [
|
|
1873
1900
|
String,
|
|
@@ -1891,21 +1918,21 @@ var le = /*@__PURE__*/ u({
|
|
|
1891
1918
|
x.value && (x.value.style.transition = "");
|
|
1892
1919
|
}));
|
|
1893
1920
|
}
|
|
1894
|
-
function
|
|
1921
|
+
function j(e) {
|
|
1895
1922
|
let t = e.target?.closest(".el-tree-node__content");
|
|
1896
1923
|
t && A(t);
|
|
1897
1924
|
}
|
|
1898
|
-
function
|
|
1925
|
+
function M() {
|
|
1899
1926
|
x.value && (x.value.style.opacity = "0");
|
|
1900
1927
|
}
|
|
1901
1928
|
return b(() => cancelAnimationFrame(D)), (e, t) => (S(), i("div", {
|
|
1902
1929
|
ref_key: "shellRef",
|
|
1903
1930
|
ref: y,
|
|
1904
1931
|
class: "zy-tree-shell",
|
|
1905
|
-
onMouseover:
|
|
1906
|
-
onMouseleave:
|
|
1932
|
+
onMouseover: j,
|
|
1933
|
+
onMouseleave: M
|
|
1907
1934
|
}, [l(k(ce), h({ class: "zy-tree" }, e.$attrs, { indent: 0 }), o({
|
|
1908
|
-
default:
|
|
1935
|
+
default: I((t) => [c.value ? E(e.$slots, "default", v(d(t)), void 0, !0, 0) : (S(), i("span", {
|
|
1909
1936
|
key: 1,
|
|
1910
1937
|
class: _(["zy-tree-row", { "is-disabled": t.node.disabled }]),
|
|
1911
1938
|
onClick: (e) => g(t.node, e)
|
|
@@ -1916,7 +1943,7 @@ var le = /*@__PURE__*/ u({
|
|
|
1916
1943
|
_: 2
|
|
1917
1944
|
}, [T(s.value, (t) => ({
|
|
1918
1945
|
name: t,
|
|
1919
|
-
fn:
|
|
1946
|
+
fn: I((n) => [E(e.$slots, t, v(d(n)), void 0, !0)])
|
|
1920
1947
|
}))]), 1040), a("span", {
|
|
1921
1948
|
ref_key: "glideRef",
|
|
1922
1949
|
ref: x,
|