@q1travel/design-system 0.15.2 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contracts/context-contrast-migration.md +16 -0
- package/contracts/token-naming.md +12 -0
- package/dist-pkg/design-system.js +610 -611
- package/dist-pkg/style.css +24 -55
- package/dist-pkg/tokens.css +24 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as l, jsx as t, Fragment as
|
|
1
|
+
import { jsxs as l, jsx as t, Fragment as ae } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as Ot, createElement as ct, useState as B, useRef as A, useEffect as G, useCallback as ce, useLayoutEffect as fe, useMemo as oe, useContext as mt, createContext as pt, useId as te, useReducer as Nn, Fragment as He, isValidElement as Nt, cloneElement as vn, useImperativeHandle as kn } from "react";
|
|
3
3
|
import { createPortal as bt } from "react-dom";
|
|
4
4
|
const xn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Bt = (...e) => e.filter((n, r, a) => !!n && n.trim() !== "" && a.indexOf(n) === r).join(" ").trim();
|
|
@@ -20,8 +20,8 @@ const qn = Ot(
|
|
|
20
20
|
strokeWidth: r = 2,
|
|
21
21
|
absoluteStrokeWidth: a,
|
|
22
22
|
className: i = "",
|
|
23
|
-
children:
|
|
24
|
-
iconNode:
|
|
23
|
+
children: o,
|
|
24
|
+
iconNode: s,
|
|
25
25
|
...c
|
|
26
26
|
}, d) => ct(
|
|
27
27
|
"svg",
|
|
@@ -36,15 +36,15 @@ const qn = Ot(
|
|
|
36
36
|
...c
|
|
37
37
|
},
|
|
38
38
|
[
|
|
39
|
-
...
|
|
40
|
-
...Array.isArray(
|
|
39
|
+
...s.map(([b, u]) => ct(b, u)),
|
|
40
|
+
...Array.isArray(o) ? o : [o]
|
|
41
41
|
]
|
|
42
42
|
)
|
|
43
43
|
);
|
|
44
44
|
const ee = (e, n) => {
|
|
45
45
|
const r = Ot(
|
|
46
|
-
({ className: a, ...i },
|
|
47
|
-
ref:
|
|
46
|
+
({ className: a, ...i }, o) => ct(qn, {
|
|
47
|
+
ref: o,
|
|
48
48
|
iconNode: n,
|
|
49
49
|
className: Bt(`lucide-${xn(e)}`, a),
|
|
50
50
|
...i
|
|
@@ -66,14 +66,14 @@ const In = ee("Calendar", [
|
|
|
66
66
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
67
67
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
68
68
|
]);
|
|
69
|
-
const
|
|
70
|
-
const
|
|
69
|
+
const pe = ee("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
70
|
+
const ye = ee("ChevronDown", [
|
|
71
71
|
["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
|
|
72
72
|
]);
|
|
73
73
|
const Te = ee("ChevronLeft", [
|
|
74
74
|
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
|
|
75
75
|
]);
|
|
76
|
-
const
|
|
76
|
+
const ge = ee("ChevronRight", [
|
|
77
77
|
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
78
78
|
]);
|
|
79
79
|
const Vt = ee("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
@@ -344,7 +344,7 @@ function Jn(e) {
|
|
|
344
344
|
function yt(e, n) {
|
|
345
345
|
const r = Gt(n);
|
|
346
346
|
for (const a of Array.from(e.body?.children ?? [])) {
|
|
347
|
-
let i = n.inertSnapshot.find((
|
|
347
|
+
let i = n.inertSnapshot.find((o) => o.element === a);
|
|
348
348
|
i || (i = { element: a, inert: a.inert }, n.inertSnapshot.push(i)), a.inert = r.includes(a) ? i.inert : !0;
|
|
349
349
|
}
|
|
350
350
|
n.backgroundInert = !0, !n.observer && e.defaultView?.MutationObserver && (n.observer = new e.defaultView.MutationObserver(() => yt(e, n)), n.observer.observe(e.body, { childList: !0 }));
|
|
@@ -378,7 +378,7 @@ function Qe(e, n, r = "programmatic") {
|
|
|
378
378
|
}, 0);
|
|
379
379
|
}
|
|
380
380
|
function er(e, n, r) {
|
|
381
|
-
const a = me(e), i = a.entries.find((
|
|
381
|
+
const a = me(e), i = a.entries.find((o) => o.id === n);
|
|
382
382
|
i && (Object.assign(i, r), dt(e, a));
|
|
383
383
|
}
|
|
384
384
|
function Ee(e, n) {
|
|
@@ -460,7 +460,7 @@ function cr(e) {
|
|
|
460
460
|
return Math.round(a + r);
|
|
461
461
|
}
|
|
462
462
|
function Wa({ children: e }) {
|
|
463
|
-
const [n, r] = B([]), [a, i] = B(() => Je()),
|
|
463
|
+
const [n, r] = B([]), [a, i] = B(() => Je()), o = A(0), s = A(/* @__PURE__ */ new Map()), c = A(/* @__PURE__ */ new Set()), d = A(null), [b, u] = B(!1);
|
|
464
464
|
G(() => {
|
|
465
465
|
const h = Jt(() => {
|
|
466
466
|
i(Je());
|
|
@@ -468,16 +468,16 @@ function Wa({ children: e }) {
|
|
|
468
468
|
return i(Je()), h;
|
|
469
469
|
}, []);
|
|
470
470
|
const f = ce((h) => {
|
|
471
|
-
const w =
|
|
472
|
-
w && (window.clearTimeout(w.handle),
|
|
471
|
+
const w = s.current.get(h);
|
|
472
|
+
w && (window.clearTimeout(w.handle), s.current.delete(h)), r((I) => I.map((g) => g.id === h ? { ...g, removed: !0 } : g)), window.setTimeout(() => {
|
|
473
473
|
r((I) => I.filter((g) => g.id !== h));
|
|
474
474
|
}, lr());
|
|
475
475
|
}, []), _ = ce(
|
|
476
476
|
({ tone: h = "default", title: w, description: I, action: g, preserve: R, duration: y = 4e3 }) => {
|
|
477
|
-
const S =
|
|
477
|
+
const S = o.current += 1;
|
|
478
478
|
if (r((v) => [...v, { id: S, tone: h, title: w, description: I, action: g, preserve: R, removed: !1 }]), !R) {
|
|
479
479
|
const v = c.current.size > 0 ? 0 : window.setTimeout(() => f(S), y);
|
|
480
|
-
|
|
480
|
+
s.current.set(S, { remaining: y, start: Date.now(), handle: v });
|
|
481
481
|
}
|
|
482
482
|
return S;
|
|
483
483
|
},
|
|
@@ -487,14 +487,14 @@ function Wa({ children: e }) {
|
|
|
487
487
|
const w = c.current.size > 0;
|
|
488
488
|
if (c.current.add(h), w) return;
|
|
489
489
|
const I = Date.now();
|
|
490
|
-
|
|
490
|
+
s.current.forEach((g) => {
|
|
491
491
|
window.clearTimeout(g.handle), g.remaining = Math.max(0, g.remaining - (I - g.start));
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
494
|
function N(h) {
|
|
495
495
|
if (c.current.delete(h), c.current.size > 0) return;
|
|
496
496
|
const w = Date.now();
|
|
497
|
-
|
|
497
|
+
s.current.forEach((I, g) => {
|
|
498
498
|
I.start = w, I.handle = window.setTimeout(() => f(g), I.remaining);
|
|
499
499
|
});
|
|
500
500
|
}
|
|
@@ -505,7 +505,7 @@ function Wa({ children: e }) {
|
|
|
505
505
|
return document.addEventListener("visibilitychange", h), () => document.removeEventListener("visibilitychange", h);
|
|
506
506
|
}, []), G(
|
|
507
507
|
() => () => {
|
|
508
|
-
|
|
508
|
+
s.current.forEach((h) => window.clearTimeout(h.handle));
|
|
509
509
|
},
|
|
510
510
|
[]
|
|
511
511
|
), fe(() => {
|
|
@@ -555,9 +555,9 @@ function Wa({ children: e }) {
|
|
|
555
555
|
] });
|
|
556
556
|
}
|
|
557
557
|
function dr({ toast: e, inert: n, onDismiss: r }) {
|
|
558
|
-
const a = A(null), [i,
|
|
558
|
+
const a = A(null), [i, o] = B(!1), [s, c] = B(!1), [d, b] = B(null), u = A(null), f = A({ x: 0, y: 0 });
|
|
559
559
|
G(() => {
|
|
560
|
-
|
|
560
|
+
o(!0);
|
|
561
561
|
}, []);
|
|
562
562
|
const _ = e.tone === "default" ? null : rr[e.tone];
|
|
563
563
|
function m(h) {
|
|
@@ -572,7 +572,7 @@ function dr({ toast: e, inert: n, onDismiss: r }) {
|
|
|
572
572
|
function N(h) {
|
|
573
573
|
if (!u.current) return;
|
|
574
574
|
const w = h.clientX - u.current.x, I = h.clientY - u.current.y, g = (y) => Math.sign(y) * Math.log1p(Math.abs(y)) * 2;
|
|
575
|
-
f.current = { x: w > 0 ? w : g(w), y: I > 0 ? I : g(I) }, !
|
|
575
|
+
f.current = { x: w > 0 ? w : g(w), y: I > 0 ? I : g(I) }, !s && (Math.abs(w) > 2 || Math.abs(I) > 2) && c(!0);
|
|
576
576
|
const R = a.current;
|
|
577
577
|
R && (R.style.setProperty("--swipe-x", `${f.current.x}px`), R.style.setProperty("--swipe-y", `${f.current.y}px`));
|
|
578
578
|
}
|
|
@@ -594,7 +594,7 @@ function dr({ toast: e, inert: n, onDismiss: r }) {
|
|
|
594
594
|
"aria-atomic": "true",
|
|
595
595
|
"data-mounted": i,
|
|
596
596
|
"data-removed": e.removed,
|
|
597
|
-
"data-swiping":
|
|
597
|
+
"data-swiping": s,
|
|
598
598
|
"data-swipe-out": d ?? void 0,
|
|
599
599
|
onPointerDown: m,
|
|
600
600
|
onPointerMove: N,
|
|
@@ -653,18 +653,18 @@ async function tn(e) {
|
|
|
653
653
|
}
|
|
654
654
|
function Ue() {
|
|
655
655
|
const [e, n] = B(!1), r = A(void 0), { push: a } = sr(), i = ce(
|
|
656
|
-
async (
|
|
656
|
+
async (s, c = "已复制到剪贴板") => {
|
|
657
657
|
try {
|
|
658
|
-
await tn(
|
|
658
|
+
await tn(s), n(!0), r.current && clearTimeout(r.current), r.current = setTimeout(() => n(!1), 1500), a({ title: c });
|
|
659
659
|
} catch {
|
|
660
660
|
a({ tone: "error", title: "无法复制到剪贴板。请重试。" });
|
|
661
661
|
}
|
|
662
662
|
},
|
|
663
663
|
[a]
|
|
664
|
-
),
|
|
664
|
+
), o = ce(() => {
|
|
665
665
|
r.current && clearTimeout(r.current), n(!1);
|
|
666
666
|
}, []);
|
|
667
|
-
return { copied: e, copy: i, reset:
|
|
667
|
+
return { copied: e, copy: i, reset: o };
|
|
668
668
|
}
|
|
669
669
|
function Ka({
|
|
670
670
|
value: e,
|
|
@@ -673,15 +673,15 @@ function Ka({
|
|
|
673
673
|
size: a = 16,
|
|
674
674
|
className: i
|
|
675
675
|
}) {
|
|
676
|
-
const { copied:
|
|
676
|
+
const { copied: o, copy: s } = Ue();
|
|
677
677
|
return /* @__PURE__ */ t(
|
|
678
678
|
"button",
|
|
679
679
|
{
|
|
680
680
|
type: "button",
|
|
681
681
|
className: i ? `copy-button ${i}` : "copy-button",
|
|
682
682
|
"aria-label": n,
|
|
683
|
-
onClick: () =>
|
|
684
|
-
children:
|
|
683
|
+
onClick: () => s(e, r),
|
|
684
|
+
children: o ? /* @__PURE__ */ t(pe, { size: a, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(Re, { size: a, strokeWidth: 2, "aria-hidden": "true" })
|
|
685
685
|
}
|
|
686
686
|
);
|
|
687
687
|
}
|
|
@@ -701,8 +701,8 @@ function nn({
|
|
|
701
701
|
svgOnly: r,
|
|
702
702
|
iconOnly: a,
|
|
703
703
|
circle: i,
|
|
704
|
-
rounded:
|
|
705
|
-
selected:
|
|
704
|
+
rounded: o,
|
|
705
|
+
selected: s,
|
|
706
706
|
loading: c,
|
|
707
707
|
busy: d,
|
|
708
708
|
className: b
|
|
@@ -715,8 +715,8 @@ function nn({
|
|
|
715
715
|
u ? "button--icon" : "",
|
|
716
716
|
i ? "button--circle" : "",
|
|
717
717
|
// circle 与 rounded 互斥:circle 是圆形 icon-only、rounded 是药丸文字 CTA;同传时 circle 优先。
|
|
718
|
-
|
|
719
|
-
|
|
718
|
+
o && !i ? "button--rounded" : "",
|
|
719
|
+
s ? "button--selected" : "",
|
|
720
720
|
c ? "button--loading" : "",
|
|
721
721
|
d ? "button--busy" : "",
|
|
722
722
|
b
|
|
@@ -737,17 +737,17 @@ function rn({
|
|
|
737
737
|
busy: r,
|
|
738
738
|
busyLabel: a,
|
|
739
739
|
prefix: i,
|
|
740
|
-
children:
|
|
741
|
-
suffix:
|
|
740
|
+
children: o,
|
|
741
|
+
suffix: s,
|
|
742
742
|
shortcut: c
|
|
743
743
|
}) {
|
|
744
|
-
return /* @__PURE__ */ l(
|
|
744
|
+
return /* @__PURE__ */ l(ae, { children: [
|
|
745
745
|
r || e ? r ? /* @__PURE__ */ t("span", { className: "button__spinner-slot", "aria-hidden": "true", children: /* @__PURE__ */ t(Ce, { className: "button__spinner", size: 14, strokeWidth: 1.8, "aria-hidden": "true" }) }) : /* @__PURE__ */ l("span", { role: "status", children: [
|
|
746
746
|
/* @__PURE__ */ t(Ce, { className: "button__spinner", size: 14, strokeWidth: 1.8, "aria-hidden": "true" }),
|
|
747
747
|
/* @__PURE__ */ t("span", { className: "q1-sr-only", children: n || "加载中…" })
|
|
748
748
|
] }) : qt(i),
|
|
749
|
-
fr({ busy: r, busyLabel: a, children:
|
|
750
|
-
qt(
|
|
749
|
+
fr({ busy: r, busyLabel: a, children: o }),
|
|
750
|
+
qt(s),
|
|
751
751
|
c ? /* @__PURE__ */ t("kbd", { className: "button__shortcut", "aria-hidden": "true", children: c }) : null
|
|
752
752
|
] });
|
|
753
753
|
}
|
|
@@ -760,8 +760,8 @@ function on(e) {
|
|
|
760
760
|
size: r,
|
|
761
761
|
svgOnly: a,
|
|
762
762
|
iconOnly: i,
|
|
763
|
-
circle:
|
|
764
|
-
rounded:
|
|
763
|
+
circle: o,
|
|
764
|
+
rounded: s,
|
|
765
765
|
selected: c,
|
|
766
766
|
loading: d,
|
|
767
767
|
loadingLabel: b,
|
|
@@ -792,14 +792,14 @@ function on(e) {
|
|
|
792
792
|
size: r,
|
|
793
793
|
svgOnly: a,
|
|
794
794
|
iconOnly: i,
|
|
795
|
-
circle:
|
|
796
|
-
rounded:
|
|
795
|
+
circle: o,
|
|
796
|
+
rounded: s,
|
|
797
797
|
selected: c,
|
|
798
798
|
loading: d,
|
|
799
799
|
busy: u,
|
|
800
800
|
className: x
|
|
801
801
|
}), O = R ?? y, Z = v ?? S, j = d && !_ && !u;
|
|
802
|
-
return /* @__PURE__ */ l(
|
|
802
|
+
return /* @__PURE__ */ l(ae, { children: [
|
|
803
803
|
/* @__PURE__ */ t(
|
|
804
804
|
"button",
|
|
805
805
|
{
|
|
@@ -831,8 +831,8 @@ function Oa(e) {
|
|
|
831
831
|
loading: r,
|
|
832
832
|
loadingLabel: a,
|
|
833
833
|
busy: i,
|
|
834
|
-
busyLabel:
|
|
835
|
-
disabled:
|
|
834
|
+
busyLabel: o,
|
|
835
|
+
disabled: s,
|
|
836
836
|
type: c,
|
|
837
837
|
shortcut: d,
|
|
838
838
|
children: b,
|
|
@@ -848,8 +848,8 @@ function Oa(e) {
|
|
|
848
848
|
onBlur: g,
|
|
849
849
|
onKeyDown: R,
|
|
850
850
|
ref: y
|
|
851
|
-
} = e, S = nn(e), v =
|
|
852
|
-
return /* @__PURE__ */ l(
|
|
851
|
+
} = e, S = nn(e), v = s || r || i;
|
|
852
|
+
return /* @__PURE__ */ l(ae, { children: [
|
|
853
853
|
/* @__PURE__ */ t(
|
|
854
854
|
"a",
|
|
855
855
|
{
|
|
@@ -858,7 +858,7 @@ function Oa(e) {
|
|
|
858
858
|
href: v ? void 0 : n,
|
|
859
859
|
"aria-disabled": v || void 0,
|
|
860
860
|
"aria-busy": i || void 0,
|
|
861
|
-
tabIndex:
|
|
861
|
+
tabIndex: s || i ? -1 : r ? 0 : void 0,
|
|
862
862
|
"aria-label": m ?? N,
|
|
863
863
|
"aria-keyshortcuts": h ?? x,
|
|
864
864
|
"aria-describedby": w,
|
|
@@ -866,22 +866,22 @@ function Oa(e) {
|
|
|
866
866
|
onFocus: I,
|
|
867
867
|
onBlur: g,
|
|
868
868
|
onKeyDown: R,
|
|
869
|
-
children: rn({ busy: i, busyLabel:
|
|
869
|
+
children: rn({ busy: i, busyLabel: o, loading: r, loadingLabel: a, prefix: u, children: b, suffix: f, shortcut: d })
|
|
870
870
|
}
|
|
871
871
|
),
|
|
872
|
-
an({ busy: i, busyLabel:
|
|
872
|
+
an({ busy: i, busyLabel: o, loadingLabel: a })
|
|
873
873
|
] });
|
|
874
874
|
}
|
|
875
|
-
function Ba({ href: e, tone: n = "default", external: r, className: a, children: i, ref:
|
|
875
|
+
function Ba({ href: e, tone: n = "default", external: r, className: a, children: i, ref: o, ...s }) {
|
|
876
876
|
const c = Y("q1-link", n !== "default" ? `q1-link--${n}` : "", a ?? "");
|
|
877
877
|
return e ? /* @__PURE__ */ l(
|
|
878
878
|
"a",
|
|
879
879
|
{
|
|
880
|
-
...
|
|
881
|
-
ref:
|
|
880
|
+
...s,
|
|
881
|
+
ref: o,
|
|
882
882
|
href: e,
|
|
883
883
|
className: c,
|
|
884
|
-
rel: r ? Y("noopener noreferrer",
|
|
884
|
+
rel: r ? Y("noopener noreferrer", s.rel ?? "") : s.rel,
|
|
885
885
|
children: [
|
|
886
886
|
i,
|
|
887
887
|
r ? /* @__PURE__ */ t(Dn, { className: "q1-link__external", "aria-hidden": "true", size: 14, strokeWidth: 1.8 }) : null
|
|
@@ -896,22 +896,22 @@ function Ha({
|
|
|
896
896
|
children: r,
|
|
897
897
|
className: a
|
|
898
898
|
}) {
|
|
899
|
-
const i = A(null),
|
|
899
|
+
const i = A(null), o = ce(
|
|
900
900
|
() => Array.from(i.current?.querySelectorAll(mr) ?? []),
|
|
901
901
|
[]
|
|
902
902
|
);
|
|
903
903
|
G(() => {
|
|
904
|
-
const c =
|
|
904
|
+
const c = o();
|
|
905
905
|
if (c.length === 0) return;
|
|
906
906
|
const d = c.findIndex((u) => u.tabIndex === 0), b = d === -1 ? 0 : d;
|
|
907
907
|
c.forEach((u, f) => {
|
|
908
908
|
u.tabIndex = f === b ? 0 : -1;
|
|
909
909
|
});
|
|
910
|
-
}, [r,
|
|
911
|
-
function
|
|
910
|
+
}, [r, o]);
|
|
911
|
+
function s(c) {
|
|
912
912
|
const d = n === "horizontal" ? "ArrowRight" : "ArrowDown", b = n === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
913
913
|
if (!["Home", "End", d, b].includes(c.key)) return;
|
|
914
|
-
const u =
|
|
914
|
+
const u = o();
|
|
915
915
|
if (u.length === 0) return;
|
|
916
916
|
const f = u.indexOf(document.activeElement);
|
|
917
917
|
if (f === -1) return;
|
|
@@ -926,7 +926,7 @@ function Ha({
|
|
|
926
926
|
role: "toolbar",
|
|
927
927
|
"aria-label": e,
|
|
928
928
|
"aria-orientation": n === "vertical" ? "vertical" : void 0,
|
|
929
|
-
onKeyDown:
|
|
929
|
+
onKeyDown: s,
|
|
930
930
|
children: r
|
|
931
931
|
}
|
|
932
932
|
);
|
|
@@ -945,13 +945,13 @@ function Ye({
|
|
|
945
945
|
description: r,
|
|
946
946
|
error: a,
|
|
947
947
|
wide: i,
|
|
948
|
-
children:
|
|
948
|
+
children: o
|
|
949
949
|
}) {
|
|
950
|
-
const
|
|
950
|
+
const s = mt(sn), c = Y("form-field", i ? "form-field--wide" : "", a ? "form-field--error" : ""), d = xe(e, !!a);
|
|
951
951
|
return /* @__PURE__ */ l("div", { className: c, children: [
|
|
952
952
|
/* @__PURE__ */ t("label", { className: "form-field__label", htmlFor: e, children: n }),
|
|
953
|
-
|
|
954
|
-
|
|
953
|
+
o,
|
|
954
|
+
s ? /* @__PURE__ */ l(ae, { children: [
|
|
955
955
|
/* @__PURE__ */ t("span", { className: a ? "form-field__message" : "q1-sr-only", id: xe(e, !0), role: "status", "aria-atomic": "true", children: a || "" }),
|
|
956
956
|
!a && r && /* @__PURE__ */ t("span", { className: "form-field__description", id: xe(e, !1), children: r })
|
|
957
957
|
] }) : a ? /* @__PURE__ */ t("span", { className: "form-field__message", id: d, children: a }) : r ? /* @__PURE__ */ t("span", { className: "form-field__description", id: d, children: r }) : null
|
|
@@ -971,8 +971,8 @@ function Ge(...e) {
|
|
|
971
971
|
return () => {
|
|
972
972
|
e.forEach((a, i) => {
|
|
973
973
|
if (!a) return;
|
|
974
|
-
const
|
|
975
|
-
typeof
|
|
974
|
+
const o = r[i];
|
|
975
|
+
typeof o == "function" ? o() : typeof a == "function" ? a(null) : a.current = null;
|
|
976
976
|
});
|
|
977
977
|
};
|
|
978
978
|
};
|
|
@@ -987,8 +987,8 @@ function br({
|
|
|
987
987
|
description: r,
|
|
988
988
|
error: a,
|
|
989
989
|
invalid: i,
|
|
990
|
-
errorId:
|
|
991
|
-
ref:
|
|
990
|
+
errorId: o,
|
|
991
|
+
ref: s,
|
|
992
992
|
prefix: c,
|
|
993
993
|
suffix: d,
|
|
994
994
|
prefixStyling: b = !0,
|
|
@@ -1004,7 +1004,7 @@ function br({
|
|
|
1004
1004
|
hideLabel: g = "隐藏内容",
|
|
1005
1005
|
...R
|
|
1006
1006
|
}) {
|
|
1007
|
-
const y = te(), S = e ?? y, v = n === void 0, p = A(null), k = oe(() => Ge(p,
|
|
1007
|
+
const y = te(), S = e ?? y, v = n === void 0, p = A(null), k = oe(() => Ge(p, s), [s]), [T, E] = B(!1), M = h ?? T, D = x ? /* @__PURE__ */ t(
|
|
1008
1008
|
pr,
|
|
1009
1009
|
{
|
|
1010
1010
|
type: "button",
|
|
@@ -1025,7 +1025,7 @@ function br({
|
|
|
1025
1025
|
ref: k,
|
|
1026
1026
|
id: S,
|
|
1027
1027
|
className: W,
|
|
1028
|
-
"aria-describedby": gt(
|
|
1028
|
+
"aria-describedby": gt(o, F),
|
|
1029
1029
|
"aria-invalid": i || a ? !0 : void 0,
|
|
1030
1030
|
...R,
|
|
1031
1031
|
...x ? { type: M ? "text" : "password" } : null
|
|
@@ -1058,8 +1058,8 @@ function Va({
|
|
|
1058
1058
|
value: r,
|
|
1059
1059
|
onValueChange: a,
|
|
1060
1060
|
disabled: i,
|
|
1061
|
-
readOnly:
|
|
1062
|
-
required:
|
|
1061
|
+
readOnly: o,
|
|
1062
|
+
required: s,
|
|
1063
1063
|
invalid: c,
|
|
1064
1064
|
errorId: d,
|
|
1065
1065
|
size: b = "md",
|
|
@@ -1090,7 +1090,7 @@ function Va({
|
|
|
1090
1090
|
}, $ = (L, C) => {
|
|
1091
1091
|
const K = L.parentElement?.querySelectorAll("[data-code-slot]"), X = Array.from(K ?? []).findIndex((U) => C <= U.getBoundingClientRect().right);
|
|
1092
1092
|
return Math.min(X < 0 ? 6 : X, r.length);
|
|
1093
|
-
}, H = /* @__PURE__ */ l(
|
|
1093
|
+
}, H = /* @__PURE__ */ l(ae, { children: [
|
|
1094
1094
|
/* @__PURE__ */ l("div", { className: `q1-verification-code q1-verification-code--${b}`, children: [
|
|
1095
1095
|
/* @__PURE__ */ t("div", { className: "q1-verification-code__slots", "aria-hidden": "true", children: Array.from({ length: 7 }, (L, C) => {
|
|
1096
1096
|
if (C === 3) return /* @__PURE__ */ t("span", { className: "q1-verification-code__separator", children: "−" }, "separator");
|
|
@@ -1122,8 +1122,8 @@ function Va({
|
|
|
1122
1122
|
maxLength: 6,
|
|
1123
1123
|
value: W,
|
|
1124
1124
|
disabled: i,
|
|
1125
|
-
readOnly:
|
|
1126
|
-
required:
|
|
1125
|
+
readOnly: o,
|
|
1126
|
+
required: s,
|
|
1127
1127
|
invalid: c || !!m || !!k,
|
|
1128
1128
|
errorId: gt(d, h, j, f === void 0 && k ? O : void 0),
|
|
1129
1129
|
"aria-label": N,
|
|
@@ -1178,7 +1178,7 @@ function Va({
|
|
|
1178
1178
|
D.current = null, J(C, L.currentTarget.selectionStart ?? C.length);
|
|
1179
1179
|
},
|
|
1180
1180
|
onPaste: (L) => {
|
|
1181
|
-
if (L.preventDefault(), i ||
|
|
1181
|
+
if (L.preventDefault(), i || o || P.current) return;
|
|
1182
1182
|
const C = L.clipboardData.getData("text").trim();
|
|
1183
1183
|
if (!C) return;
|
|
1184
1184
|
const K = C.replace(/^([0-9]{3})[\s-]+([0-9]{3})$/, "$1$2");
|
|
@@ -1186,8 +1186,8 @@ function Va({
|
|
|
1186
1186
|
T("请粘贴 6 位数字验证码。");
|
|
1187
1187
|
return;
|
|
1188
1188
|
}
|
|
1189
|
-
const X = L.currentTarget.selectionStart ?? r.length, U = L.currentTarget.selectionEnd ?? X,
|
|
1190
|
-
J(
|
|
1189
|
+
const X = L.currentTarget.selectionStart ?? r.length, U = L.currentTarget.selectionEnd ?? X, ie = K.length === 6 ? K : r.slice(0, X) + K + r.slice(U);
|
|
1190
|
+
J(ie, K.length === 6 ? 6 : X + K.length);
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
1193
|
)
|
|
@@ -1197,11 +1197,11 @@ function Va({
|
|
|
1197
1197
|
return f === void 0 ? H : /* @__PURE__ */ t(sn, { value: !0, children: /* @__PURE__ */ t(Ye, { controlId: I, label: f, description: _, error: Z, children: H }) });
|
|
1198
1198
|
}
|
|
1199
1199
|
function ln(e = "", n) {
|
|
1200
|
-
const [r, a] = B(e), i = A(null),
|
|
1200
|
+
const [r, a] = B(e), i = A(null), o = () => {
|
|
1201
1201
|
a(""), i.current?.focus(), n?.();
|
|
1202
1202
|
};
|
|
1203
|
-
return { value: r, setValue: a, inputRef: i, clear:
|
|
1204
|
-
c.nativeEvent.isComposing || c.key === "Escape" && r && (c.preventDefault(),
|
|
1203
|
+
return { value: r, setValue: a, inputRef: i, clear: o, onKeyDown: (c) => {
|
|
1204
|
+
c.nativeEvent.isComposing || c.key === "Escape" && r && (c.preventDefault(), o());
|
|
1205
1205
|
} };
|
|
1206
1206
|
}
|
|
1207
1207
|
function ja({
|
|
@@ -1210,10 +1210,10 @@ function ja({
|
|
|
1210
1210
|
defaultValue: r = "",
|
|
1211
1211
|
disabled: a,
|
|
1212
1212
|
kbdHint: i,
|
|
1213
|
-
onClear:
|
|
1214
|
-
ariaLabel:
|
|
1213
|
+
onClear: o,
|
|
1214
|
+
ariaLabel: s
|
|
1215
1215
|
}) {
|
|
1216
|
-
const { value: c, setValue: d, inputRef: b, clear: u, onKeyDown: f } = ln(r,
|
|
1216
|
+
const { value: c, setValue: d, inputRef: b, clear: u, onKeyDown: f } = ln(r, o);
|
|
1217
1217
|
return /* @__PURE__ */ l("div", { className: "clearable", children: [
|
|
1218
1218
|
/* @__PURE__ */ t(
|
|
1219
1219
|
"input",
|
|
@@ -1223,7 +1223,7 @@ function ja({
|
|
|
1223
1223
|
className: "form-control clearable__input",
|
|
1224
1224
|
type: "text",
|
|
1225
1225
|
placeholder: n,
|
|
1226
|
-
"aria-label":
|
|
1226
|
+
"aria-label": s,
|
|
1227
1227
|
value: c,
|
|
1228
1228
|
disabled: a,
|
|
1229
1229
|
onChange: (_) => d(_.target.value),
|
|
@@ -1242,13 +1242,13 @@ function Ua({
|
|
|
1242
1242
|
placeholder: r,
|
|
1243
1243
|
defaultValue: a = "",
|
|
1244
1244
|
disabled: i,
|
|
1245
|
-
loading:
|
|
1246
|
-
kbdHint:
|
|
1245
|
+
loading: o,
|
|
1246
|
+
kbdHint: s,
|
|
1247
1247
|
icon: c
|
|
1248
1248
|
}) {
|
|
1249
1249
|
const { value: d, setValue: b, inputRef: u, clear: f, onKeyDown: _ } = ln(a);
|
|
1250
|
-
return /* @__PURE__ */ l("div", { className: "search-input", "aria-busy":
|
|
1251
|
-
/* @__PURE__ */ t("span", { className: "search-input__icon", "aria-hidden": "true", children:
|
|
1250
|
+
return /* @__PURE__ */ l("div", { className: "search-input", "aria-busy": o || void 0, children: [
|
|
1251
|
+
/* @__PURE__ */ t("span", { className: "search-input__icon", "aria-hidden": "true", children: o ? /* @__PURE__ */ t(Ce, { className: "search-input__spinner", size: 16, strokeWidth: 2 }) : c ?? /* @__PURE__ */ t(Ie, { size: 16, strokeWidth: 2 }) }),
|
|
1252
1252
|
/* @__PURE__ */ t(
|
|
1253
1253
|
"input",
|
|
1254
1254
|
{
|
|
@@ -1266,8 +1266,8 @@ function Ua({
|
|
|
1266
1266
|
onKeyDown: _
|
|
1267
1267
|
}
|
|
1268
1268
|
),
|
|
1269
|
-
|
|
1270
|
-
d && !i ? /* @__PURE__ */ t("button", { type: "button", className: "search-input__esc", "aria-label": "清除搜索", onClick: f, children: /* @__PURE__ */ t("kbd", { className: "q1-kbd q1-kbd--small", "aria-hidden": "true", children: "Esc" }) }) :
|
|
1269
|
+
o ? /* @__PURE__ */ t("span", { className: "q1-sr-only", children: "加载中…" }) : null,
|
|
1270
|
+
d && !i ? /* @__PURE__ */ t("button", { type: "button", className: "search-input__esc", "aria-label": "清除搜索", onClick: f, children: /* @__PURE__ */ t("kbd", { className: "q1-kbd q1-kbd--small", "aria-hidden": "true", children: "Esc" }) }) : s && !i ? /* @__PURE__ */ l("span", { className: "search-input__hint", "aria-hidden": "true", children: [
|
|
1271
1271
|
/* @__PURE__ */ t("kbd", { className: "q1-kbd q1-kbd--small", children: "⌘" }),
|
|
1272
1272
|
/* @__PURE__ */ t("kbd", { className: "q1-kbd q1-kbd--small", children: "K" })
|
|
1273
1273
|
] }) : null
|
|
@@ -1279,8 +1279,8 @@ function Ya({
|
|
|
1279
1279
|
description: r,
|
|
1280
1280
|
error: a,
|
|
1281
1281
|
invalid: i,
|
|
1282
|
-
errorId:
|
|
1283
|
-
ref:
|
|
1282
|
+
errorId: o,
|
|
1283
|
+
ref: s,
|
|
1284
1284
|
wide: c,
|
|
1285
1285
|
size: d = "md",
|
|
1286
1286
|
className: b,
|
|
@@ -1288,7 +1288,7 @@ function Ya({
|
|
|
1288
1288
|
onInput: f,
|
|
1289
1289
|
..._
|
|
1290
1290
|
}) {
|
|
1291
|
-
const m = te(), N = e ?? m, x = n === void 0, h = A(null), w = oe(() => Ge(h,
|
|
1291
|
+
const m = te(), N = e ?? m, x = n === void 0, h = A(null), w = oe(() => Ge(h, s), [s]);
|
|
1292
1292
|
wt("Textarea", x, h);
|
|
1293
1293
|
const [I, g] = B(
|
|
1294
1294
|
() => typeof _.defaultValue == "string" ? _.defaultValue.length : 0
|
|
@@ -1304,7 +1304,7 @@ function Ya({
|
|
|
1304
1304
|
ref: w,
|
|
1305
1305
|
className: v,
|
|
1306
1306
|
maxLength: u,
|
|
1307
|
-
"aria-describedby": gt(
|
|
1307
|
+
"aria-describedby": gt(o, S),
|
|
1308
1308
|
"aria-invalid": i || a ? !0 : void 0,
|
|
1309
1309
|
onInput: y ? (T) => {
|
|
1310
1310
|
g(T.currentTarget.value.length), f?.(T);
|
|
@@ -1327,8 +1327,8 @@ function Ga({
|
|
|
1327
1327
|
description: r,
|
|
1328
1328
|
error: a,
|
|
1329
1329
|
wide: i,
|
|
1330
|
-
size:
|
|
1331
|
-
prefix:
|
|
1330
|
+
size: o = "md",
|
|
1331
|
+
prefix: s,
|
|
1332
1332
|
suffix: c,
|
|
1333
1333
|
className: d,
|
|
1334
1334
|
children: b,
|
|
@@ -1337,15 +1337,15 @@ function Ga({
|
|
|
1337
1337
|
const f = Y(
|
|
1338
1338
|
"form-control",
|
|
1339
1339
|
"form-control--select",
|
|
1340
|
-
|
|
1340
|
+
o !== "md" ? `form-control--${o}` : "",
|
|
1341
1341
|
d ?? ""
|
|
1342
1342
|
), _ = Y(
|
|
1343
1343
|
"select-control",
|
|
1344
|
-
|
|
1344
|
+
s ? "select-control--prefixed" : "",
|
|
1345
1345
|
c ? "select-control--suffixed" : ""
|
|
1346
1346
|
);
|
|
1347
1347
|
return /* @__PURE__ */ t(Ye, { controlId: e, label: n, description: r, error: a, wide: i, children: /* @__PURE__ */ l("span", { className: _, children: [
|
|
1348
|
-
|
|
1348
|
+
s ? /* @__PURE__ */ t("span", { className: "select-control__prefix", "aria-hidden": "true", children: s }) : null,
|
|
1349
1349
|
/* @__PURE__ */ t(
|
|
1350
1350
|
"select",
|
|
1351
1351
|
{
|
|
@@ -1358,7 +1358,7 @@ function Ga({
|
|
|
1358
1358
|
}
|
|
1359
1359
|
),
|
|
1360
1360
|
c ? /* @__PURE__ */ t("span", { className: "select-control__suffix", "aria-hidden": "true", children: c }) : null,
|
|
1361
|
-
/* @__PURE__ */ t("span", { className: "select-control__chevron", "aria-hidden": "true", children: /* @__PURE__ */ t(
|
|
1361
|
+
/* @__PURE__ */ t("span", { className: "select-control__chevron", "aria-hidden": "true", children: /* @__PURE__ */ t(ye, { size: o === "xs" ? 12 : 16, strokeWidth: 1.8 }) })
|
|
1362
1362
|
] }) });
|
|
1363
1363
|
}
|
|
1364
1364
|
function cn({
|
|
@@ -1367,11 +1367,11 @@ function cn({
|
|
|
1367
1367
|
description: r,
|
|
1368
1368
|
error: a,
|
|
1369
1369
|
indeterminate: i,
|
|
1370
|
-
ref:
|
|
1371
|
-
type:
|
|
1370
|
+
ref: o,
|
|
1371
|
+
type: s,
|
|
1372
1372
|
...c
|
|
1373
1373
|
}) {
|
|
1374
|
-
const d = te(), b = e ?? d, u = n === void 0, f =
|
|
1374
|
+
const d = te(), b = e ?? d, u = n === void 0, f = s === "radio", _ = !f && (r || a) ? xe(b, !!a) : void 0, m = f ? "control-option__visual control-option__visual--radio" : "control-option__visual", N = A(null), x = oe(() => Ge(N, o), [o]);
|
|
1375
1375
|
wt(f ? "Radio" : "Checkbox", u, N), G(() => {
|
|
1376
1376
|
N.current && (N.current.indeterminate = !f && !!i);
|
|
1377
1377
|
}, [i, f]);
|
|
@@ -1380,7 +1380,7 @@ function cn({
|
|
|
1380
1380
|
{
|
|
1381
1381
|
ref: x,
|
|
1382
1382
|
id: b,
|
|
1383
|
-
type:
|
|
1383
|
+
type: s,
|
|
1384
1384
|
"aria-describedby": _,
|
|
1385
1385
|
"aria-invalid": a ? !0 : void 0,
|
|
1386
1386
|
...c
|
|
@@ -1413,15 +1413,15 @@ function Qa({ id: e, ...n }) {
|
|
|
1413
1413
|
component: /* @__PURE__ */ t("input", { id: e, type: "radio", ...n })
|
|
1414
1414
|
};
|
|
1415
1415
|
}
|
|
1416
|
-
function Ja({ type: e, label: n, description: r, extra: a, className: i, ...
|
|
1416
|
+
function Ja({ type: e, label: n, description: r, extra: a, className: i, ...o }) {
|
|
1417
1417
|
return /* @__PURE__ */ l("label", { className: Y("choicebox", `choicebox--${e}`, i), children: [
|
|
1418
|
-
/* @__PURE__ */ t("input", { type: e, className: "choicebox__input", ...
|
|
1418
|
+
/* @__PURE__ */ t("input", { type: e, className: "choicebox__input", ...o }),
|
|
1419
1419
|
/* @__PURE__ */ l("span", { className: "choicebox__body", children: [
|
|
1420
1420
|
/* @__PURE__ */ t("span", { className: "choicebox__title", children: n }),
|
|
1421
1421
|
r ? /* @__PURE__ */ t("span", { className: "choicebox__description", children: r }) : null,
|
|
1422
1422
|
a ? /* @__PURE__ */ t("span", { className: "choicebox__extra", children: a }) : null
|
|
1423
1423
|
] }),
|
|
1424
|
-
/* @__PURE__ */ t("span", { className: "choicebox__indicator", "aria-hidden": "true", children: e === "checkbox" ? /* @__PURE__ */ t(
|
|
1424
|
+
/* @__PURE__ */ t("span", { className: "choicebox__indicator", "aria-hidden": "true", children: e === "checkbox" ? /* @__PURE__ */ t(pe, { className: "choicebox__check", size: 12, strokeWidth: 3 }) : null })
|
|
1425
1425
|
] });
|
|
1426
1426
|
}
|
|
1427
1427
|
function ei({
|
|
@@ -1430,8 +1430,8 @@ function ei({
|
|
|
1430
1430
|
onChange: r,
|
|
1431
1431
|
onSearch: a,
|
|
1432
1432
|
isLoading: i,
|
|
1433
|
-
placeholder:
|
|
1434
|
-
size:
|
|
1433
|
+
placeholder: o = "请选择",
|
|
1434
|
+
size: s = "md",
|
|
1435
1435
|
disabled: c,
|
|
1436
1436
|
readOnly: d,
|
|
1437
1437
|
invalid: b,
|
|
@@ -1472,7 +1472,7 @@ function ei({
|
|
|
1472
1472
|
}, [k]), G(() => {
|
|
1473
1473
|
V || T(!1);
|
|
1474
1474
|
}, [V]);
|
|
1475
|
-
function
|
|
1475
|
+
function ie(z, Q = 0) {
|
|
1476
1476
|
const re = z.findIndex((de) => !de.disabled);
|
|
1477
1477
|
return re === -1 ? Q : re;
|
|
1478
1478
|
}
|
|
@@ -1490,18 +1490,18 @@ function ei({
|
|
|
1490
1490
|
}
|
|
1491
1491
|
function ue() {
|
|
1492
1492
|
const z = Z === "" ? -1 : e.findIndex((Q) => Q.value === Z);
|
|
1493
|
-
p(""), M(z === -1 ?
|
|
1493
|
+
p(""), M(z === -1 ? ie(e) : z), T(!0);
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1495
|
+
function be(z) {
|
|
1496
1496
|
!V || z.disabled || i || (r?.(z.value, z), T(!1), D.current?.focus());
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1498
|
+
function _e() {
|
|
1499
1499
|
r?.("", void 0), p(""), T(!1), D.current?.focus();
|
|
1500
1500
|
}
|
|
1501
1501
|
function he(z) {
|
|
1502
1502
|
if (!z.nativeEvent.isComposing && V) {
|
|
1503
1503
|
if (!k) {
|
|
1504
|
-
z.key === "ArrowDown" || z.key === "Enter" ? (z.preventDefault(), ue()) : z.key === "Escape" && m && Z !== "" &&
|
|
1504
|
+
z.key === "ArrowDown" || z.key === "Enter" ? (z.preventDefault(), ue()) : z.key === "Escape" && m && Z !== "" && _e();
|
|
1505
1505
|
return;
|
|
1506
1506
|
}
|
|
1507
1507
|
if (i && (z.key === "ArrowDown" || z.key === "ArrowUp" || z.key === "Home" || z.key === "End" || z.key === "Enter")) {
|
|
@@ -1513,11 +1513,11 @@ function ei({
|
|
|
1513
1513
|
else if (z.key === "ArrowUp")
|
|
1514
1514
|
z.preventDefault(), M((Q) => le(Q, -1));
|
|
1515
1515
|
else if (z.key === "Home")
|
|
1516
|
-
z.preventDefault(), M((Q) =>
|
|
1516
|
+
z.preventDefault(), M((Q) => ie($, Q));
|
|
1517
1517
|
else if (z.key === "End")
|
|
1518
1518
|
z.preventDefault(), M((Q) => se($, Q));
|
|
1519
1519
|
else if (z.key === "Enter")
|
|
1520
|
-
z.preventDefault(), $[E] &&
|
|
1520
|
+
z.preventDefault(), $[E] && be($[E]);
|
|
1521
1521
|
else if (z.key === "Escape")
|
|
1522
1522
|
z.preventDefault(), T(!1);
|
|
1523
1523
|
else if (z.key === "Tab") {
|
|
@@ -1530,7 +1530,7 @@ function ei({
|
|
|
1530
1530
|
}
|
|
1531
1531
|
const q = Y(
|
|
1532
1532
|
"combobox",
|
|
1533
|
-
|
|
1533
|
+
s !== "md" ? `combobox--${s}` : "",
|
|
1534
1534
|
C ? "combobox--error" : "",
|
|
1535
1535
|
c ? "combobox--disabled" : "",
|
|
1536
1536
|
d ? "combobox--readonly" : "",
|
|
@@ -1559,7 +1559,7 @@ function ei({
|
|
|
1559
1559
|
type: "text",
|
|
1560
1560
|
role: "combobox",
|
|
1561
1561
|
className: "combobox__input",
|
|
1562
|
-
placeholder:
|
|
1562
|
+
placeholder: o,
|
|
1563
1563
|
value: J ? v : j?.label ?? "",
|
|
1564
1564
|
disabled: c,
|
|
1565
1565
|
readOnly: d,
|
|
@@ -1577,14 +1577,14 @@ function ei({
|
|
|
1577
1577
|
onChange: (z) => {
|
|
1578
1578
|
if (!V) return;
|
|
1579
1579
|
const Q = z.target.value, re = a || Q === "" ? e : e.filter((de) => de.label.toLowerCase().includes(Q.toLowerCase()));
|
|
1580
|
-
a?.(Q), p(Q), M(
|
|
1580
|
+
a?.(Q), p(Q), M(ie(re)), T(!0);
|
|
1581
1581
|
},
|
|
1582
1582
|
onFocus: () => V && !k && ue(),
|
|
1583
1583
|
onMouseDown: () => V && !k && ue(),
|
|
1584
1584
|
onKeyDown: he
|
|
1585
1585
|
}
|
|
1586
1586
|
),
|
|
1587
|
-
m && Z !== "" && V ? /* @__PURE__ */ t("button", { type: "button", className: "combobox__clear", "aria-label": "清除选择", onClick:
|
|
1587
|
+
m && Z !== "" && V ? /* @__PURE__ */ t("button", { type: "button", className: "combobox__clear", "aria-label": "清除选择", onClick: _e, children: /* @__PURE__ */ t(Ne, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) }) : null
|
|
1588
1588
|
] }),
|
|
1589
1589
|
J ? /* @__PURE__ */ l("div", { className: "combobox__popup", children: [
|
|
1590
1590
|
/* @__PURE__ */ t(
|
|
@@ -1593,7 +1593,7 @@ function ei({
|
|
|
1593
1593
|
className: "combobox__listbox",
|
|
1594
1594
|
id: W,
|
|
1595
1595
|
role: "listbox",
|
|
1596
|
-
"aria-label":
|
|
1596
|
+
"aria-label": o,
|
|
1597
1597
|
"aria-busy": i || void 0,
|
|
1598
1598
|
children: i ? /* @__PURE__ */ t("li", { className: "combobox__loading", role: "status", "aria-live": "polite", children: "加载中…" }) : $.map((z, Q) => {
|
|
1599
1599
|
const re = Z !== "" && z.value === Z;
|
|
@@ -1611,13 +1611,13 @@ function ei({
|
|
|
1611
1611
|
),
|
|
1612
1612
|
onMouseEnter: () => !z.disabled && M(Q),
|
|
1613
1613
|
onMouseDown: (de) => {
|
|
1614
|
-
de.preventDefault(),
|
|
1614
|
+
de.preventDefault(), be(z);
|
|
1615
1615
|
},
|
|
1616
1616
|
children: [
|
|
1617
1617
|
z.prefix ? /* @__PURE__ */ t("span", { className: "combobox__option-prefix", "aria-hidden": "true", children: z.prefix }) : null,
|
|
1618
1618
|
/* @__PURE__ */ t("span", { className: "combobox__option-label", children: z.label }),
|
|
1619
1619
|
z.suffix ? /* @__PURE__ */ t("span", { className: "combobox__option-suffix", "aria-hidden": "true", children: z.suffix }) : null,
|
|
1620
|
-
re ? /* @__PURE__ */ t(
|
|
1620
|
+
re ? /* @__PURE__ */ t(pe, { className: "combobox__option-check", size: 14, strokeWidth: 2, "aria-hidden": "true" }) : null
|
|
1621
1621
|
]
|
|
1622
1622
|
},
|
|
1623
1623
|
z.value
|
|
@@ -1642,8 +1642,8 @@ function ti({
|
|
|
1642
1642
|
name: r,
|
|
1643
1643
|
defaultValue: a,
|
|
1644
1644
|
value: i,
|
|
1645
|
-
onChange:
|
|
1646
|
-
size:
|
|
1645
|
+
onChange: o,
|
|
1646
|
+
size: s = "md",
|
|
1647
1647
|
fullWidth: c = !1,
|
|
1648
1648
|
iconOnly: d = !1
|
|
1649
1649
|
}) {
|
|
@@ -1654,7 +1654,7 @@ function ti({
|
|
|
1654
1654
|
const R = r ?? b;
|
|
1655
1655
|
function y(k) {
|
|
1656
1656
|
const T = e.find((E) => E.value === k);
|
|
1657
|
-
!T || T.disabled || (f || m(k),
|
|
1657
|
+
!T || T.disabled || (f || m(k), o?.(k));
|
|
1658
1658
|
}
|
|
1659
1659
|
function S(k, T) {
|
|
1660
1660
|
if (x.length === 0) return -1;
|
|
@@ -1669,7 +1669,7 @@ function ti({
|
|
|
1669
1669
|
const E = S(T, k.key), M = e[E];
|
|
1670
1670
|
!M || M.disabled || (g(E), y(M.value), u.current[E]?.focus());
|
|
1671
1671
|
}
|
|
1672
|
-
const p = Y("switch-control", `switch-control--${
|
|
1672
|
+
const p = Y("switch-control", `switch-control--${s}`, c ? "switch-control--full" : "");
|
|
1673
1673
|
return /* @__PURE__ */ t("div", { className: p, role: "radiogroup", "aria-label": n, children: e.map((k, T) => {
|
|
1674
1674
|
const E = k.value === N;
|
|
1675
1675
|
return /* @__PURE__ */ l(
|
|
@@ -1708,24 +1708,24 @@ function ni({
|
|
|
1708
1708
|
onChange: r,
|
|
1709
1709
|
disabled: a,
|
|
1710
1710
|
size: i = "md",
|
|
1711
|
-
onColor:
|
|
1712
|
-
label:
|
|
1711
|
+
onColor: o,
|
|
1712
|
+
label: s,
|
|
1713
1713
|
description: c,
|
|
1714
1714
|
labelSide: d = "right",
|
|
1715
1715
|
"aria-label": b,
|
|
1716
1716
|
"aria-labelledby": u,
|
|
1717
1717
|
ariaLabel: f
|
|
1718
1718
|
}) {
|
|
1719
|
-
const [_, m] = B(n), N = e !== void 0, x = N ? e : _, h = te(), w = te(), I =
|
|
1719
|
+
const [_, m] = B(n), N = e !== void 0, x = N ? e : _, h = te(), w = te(), I = o ? { "--toggle-on": o } : void 0;
|
|
1720
1720
|
return /* @__PURE__ */ l(
|
|
1721
1721
|
"button",
|
|
1722
1722
|
{
|
|
1723
1723
|
type: "button",
|
|
1724
1724
|
role: "switch",
|
|
1725
1725
|
"aria-checked": x,
|
|
1726
|
-
"aria-label":
|
|
1727
|
-
"aria-labelledby":
|
|
1728
|
-
"aria-describedby":
|
|
1726
|
+
"aria-label": s ? void 0 : b !== void 0 ? b : f,
|
|
1727
|
+
"aria-labelledby": s ? h : u,
|
|
1728
|
+
"aria-describedby": s && c ? w : void 0,
|
|
1729
1729
|
disabled: a,
|
|
1730
1730
|
className: `toggle-field toggle-field--${d}`,
|
|
1731
1731
|
onClick: () => {
|
|
@@ -1733,8 +1733,8 @@ function ni({
|
|
|
1733
1733
|
N || m(R), r?.(R);
|
|
1734
1734
|
},
|
|
1735
1735
|
children: [
|
|
1736
|
-
|
|
1737
|
-
/* @__PURE__ */ t("span", { className: "toggle-field__label", id: h, children:
|
|
1736
|
+
s ? /* @__PURE__ */ l("span", { className: "toggle-field__text", children: [
|
|
1737
|
+
/* @__PURE__ */ t("span", { className: "toggle-field__label", id: h, children: s }),
|
|
1738
1738
|
c ? /* @__PURE__ */ t("span", { className: "toggle-field__description", id: w, children: c }) : null
|
|
1739
1739
|
] }) : null,
|
|
1740
1740
|
/* @__PURE__ */ t("span", { className: `toggle toggle--${i}`, style: I, "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: "toggle__thumb" }) })
|
|
@@ -1743,7 +1743,7 @@ function ni({
|
|
|
1743
1743
|
);
|
|
1744
1744
|
}
|
|
1745
1745
|
function dn({ tokens: e }) {
|
|
1746
|
-
return /* @__PURE__ */ t(
|
|
1746
|
+
return /* @__PURE__ */ t(ae, { children: e.map(
|
|
1747
1747
|
(n, r) => n.type ? /* @__PURE__ */ t("span", { className: `tok-${n.type}`, children: n.text }, r) : /* @__PURE__ */ t("span", { children: n.text }, r)
|
|
1748
1748
|
) });
|
|
1749
1749
|
}
|
|
@@ -1754,7 +1754,7 @@ function ai({ children: e }) {
|
|
|
1754
1754
|
return /* @__PURE__ */ t("code", { className: "code-inline", children: e });
|
|
1755
1755
|
}
|
|
1756
1756
|
function ii(e) {
|
|
1757
|
-
const { lineNumbers: n = !0 } = e, { copied: r, copy: a, reset: i } = Ue(), [
|
|
1757
|
+
const { lineNumbers: n = !0 } = e, { copied: r, copy: a, reset: i } = Ue(), [o, s] = B(0), c = e.tabs ? e.tabs[o] ?? e.tabs[0] : void 0, d = c ? c.lines : e.lines ?? [], b = c ? c.filename : e.filename, u = d.map((_) => _.tokens.map((m) => m.text).join("")).join(`
|
|
1758
1758
|
`);
|
|
1759
1759
|
let f = 0;
|
|
1760
1760
|
return /* @__PURE__ */ l("div", { className: "codeblock", children: [
|
|
@@ -1763,11 +1763,11 @@ function ii(e) {
|
|
|
1763
1763
|
"button",
|
|
1764
1764
|
{
|
|
1765
1765
|
type: "button",
|
|
1766
|
-
className: `codeblock__tab${m ===
|
|
1767
|
-
"aria-pressed": m ===
|
|
1766
|
+
className: `codeblock__tab${m === o ? " codeblock__tab--active" : ""}`,
|
|
1767
|
+
"aria-pressed": m === o,
|
|
1768
1768
|
"aria-label": `切换到 ${_.label} 示例`,
|
|
1769
1769
|
onClick: () => {
|
|
1770
|
-
|
|
1770
|
+
s(m), i();
|
|
1771
1771
|
},
|
|
1772
1772
|
children: _.label
|
|
1773
1773
|
},
|
|
@@ -1783,7 +1783,7 @@ function ii(e) {
|
|
|
1783
1783
|
className: "codeblock__copy",
|
|
1784
1784
|
"aria-label": "复制代码",
|
|
1785
1785
|
onClick: () => a(u, "已复制代码"),
|
|
1786
|
-
children: r ? /* @__PURE__ */ t(
|
|
1786
|
+
children: r ? /* @__PURE__ */ t(pe, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(Re, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
1787
1787
|
}
|
|
1788
1788
|
)
|
|
1789
1789
|
] }),
|
|
@@ -1813,11 +1813,11 @@ function oi({
|
|
|
1813
1813
|
ariaLabel: n,
|
|
1814
1814
|
variant: r = "default"
|
|
1815
1815
|
}) {
|
|
1816
|
-
const a = te(), i = e.find((u) => !u.disabled), [
|
|
1816
|
+
const a = te(), i = e.find((u) => !u.disabled), [o, s] = B(i?.id ?? ""), c = e.find((u) => u.id === o), d = A(/* @__PURE__ */ new Map());
|
|
1817
1817
|
function b(u) {
|
|
1818
1818
|
const f = e.filter((N) => !N.disabled);
|
|
1819
1819
|
if (f.length === 0) return;
|
|
1820
|
-
const _ = f.findIndex((N) => N.id ===
|
|
1820
|
+
const _ = f.findIndex((N) => N.id === o);
|
|
1821
1821
|
let m;
|
|
1822
1822
|
switch (u.key) {
|
|
1823
1823
|
case "ArrowRight":
|
|
@@ -1837,7 +1837,7 @@ function oi({
|
|
|
1837
1837
|
default:
|
|
1838
1838
|
return;
|
|
1839
1839
|
}
|
|
1840
|
-
u.preventDefault(), m && (
|
|
1840
|
+
u.preventDefault(), m && (s(m.id), d.current.get(m.id)?.focus());
|
|
1841
1841
|
}
|
|
1842
1842
|
return e.length === 0 ? null : /* @__PURE__ */ l("div", { className: "tabs-root", children: [
|
|
1843
1843
|
/* @__PURE__ */ t(
|
|
@@ -1854,16 +1854,16 @@ function oi({
|
|
|
1854
1854
|
{
|
|
1855
1855
|
"aria-controls": `${a}-panel-${u.id}`,
|
|
1856
1856
|
"aria-describedby": f,
|
|
1857
|
-
"aria-selected": u.id ===
|
|
1857
|
+
"aria-selected": u.id === o,
|
|
1858
1858
|
className: "tabs-control__tab",
|
|
1859
1859
|
disabled: u.disabled,
|
|
1860
1860
|
id: `${a}-tab-${u.id}`,
|
|
1861
|
-
onClick: () =>
|
|
1861
|
+
onClick: () => s(u.id),
|
|
1862
1862
|
ref: (m) => {
|
|
1863
1863
|
m ? d.current.set(u.id, m) : d.current.delete(u.id);
|
|
1864
1864
|
},
|
|
1865
1865
|
role: "tab",
|
|
1866
|
-
tabIndex: u.id ===
|
|
1866
|
+
tabIndex: u.id === o && !u.disabled ? 0 : -1,
|
|
1867
1867
|
type: "button",
|
|
1868
1868
|
children: [
|
|
1869
1869
|
u.icon ? /* @__PURE__ */ t("span", { className: "tabs-control__tab-icon", "aria-hidden": "true", children: u.icon }) : null,
|
|
@@ -1902,11 +1902,11 @@ function li({
|
|
|
1902
1902
|
small: r,
|
|
1903
1903
|
children: a
|
|
1904
1904
|
}) {
|
|
1905
|
-
const i = mt(un),
|
|
1905
|
+
const i = mt(un), o = te(), [s, c] = B(n ?? !1);
|
|
1906
1906
|
fe(() => {
|
|
1907
|
-
i && n && i.setOpenId(
|
|
1907
|
+
i && n && i.setOpenId(o);
|
|
1908
1908
|
}, []);
|
|
1909
|
-
const d = i ? i.openId ===
|
|
1909
|
+
const d = i ? i.openId === o : s, b = typeof e == "function" ? e(d) : e;
|
|
1910
1910
|
return /* @__PURE__ */ l("div", { className: `collapse${r ? " collapse--small" : ""}`, children: [
|
|
1911
1911
|
/* @__PURE__ */ l(
|
|
1912
1912
|
"button",
|
|
@@ -1914,31 +1914,31 @@ function li({
|
|
|
1914
1914
|
type: "button",
|
|
1915
1915
|
className: "collapse__trigger",
|
|
1916
1916
|
"aria-expanded": d,
|
|
1917
|
-
"aria-controls":
|
|
1917
|
+
"aria-controls": o,
|
|
1918
1918
|
onClick: () => {
|
|
1919
|
-
i ? i.setOpenId(d ? null :
|
|
1919
|
+
i ? i.setOpenId(d ? null : o) : c((f) => !f);
|
|
1920
1920
|
},
|
|
1921
1921
|
children: [
|
|
1922
1922
|
/* @__PURE__ */ t("span", { className: "collapse__title", children: b }),
|
|
1923
|
-
/* @__PURE__ */ t(
|
|
1923
|
+
/* @__PURE__ */ t(ge, { className: "collapse__chevron", size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
1924
1924
|
]
|
|
1925
1925
|
}
|
|
1926
1926
|
),
|
|
1927
|
-
/* @__PURE__ */ t("div", { className: `collapse__panel${d ? " collapse__panel--open" : ""}`, id:
|
|
1927
|
+
/* @__PURE__ */ t("div", { className: `collapse__panel${d ? " collapse__panel--open" : ""}`, id: o, children: /* @__PURE__ */ t("div", { className: "collapse__content", children: a }) })
|
|
1928
1928
|
] });
|
|
1929
1929
|
}
|
|
1930
1930
|
function ci({ sections: e, triggerLabel: n = "打开命令面板", hotkey: r }) {
|
|
1931
|
-
const [a, i] = B(!1), [
|
|
1932
|
-
const h =
|
|
1931
|
+
const [a, i] = B(!1), [o, s] = B(""), [c, d] = B(0), b = A(null), u = A(null), f = A(null), _ = A(null), m = oe(() => {
|
|
1932
|
+
const h = o.trim().toLowerCase();
|
|
1933
1933
|
let w = 0;
|
|
1934
1934
|
return e.map((I) => ({
|
|
1935
1935
|
heading: I.heading,
|
|
1936
1936
|
items: I.items.filter((g) => h.length === 0 || g.label.toLowerCase().includes(h)).map((g) => ({ item: g, flatIndex: w++ }))
|
|
1937
1937
|
})).filter((I) => I.items.length > 0);
|
|
1938
|
-
}, [e,
|
|
1938
|
+
}, [e, o]), N = m.reduce((h, w) => h + w.items.length, 0);
|
|
1939
1939
|
G(() => {
|
|
1940
1940
|
if (!a) return;
|
|
1941
|
-
|
|
1941
|
+
s(""), d(0);
|
|
1942
1942
|
const h = document.activeElement;
|
|
1943
1943
|
_.current = h && h !== document.body ? h : b.current;
|
|
1944
1944
|
const w = window.setTimeout(() => f.current?.focus(), 0);
|
|
@@ -1996,12 +1996,12 @@ function ci({ sections: e, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
1996
1996
|
"input",
|
|
1997
1997
|
{
|
|
1998
1998
|
ref: f,
|
|
1999
|
-
value:
|
|
1999
|
+
value: o,
|
|
2000
2000
|
"aria-label": "输入命令或搜索",
|
|
2001
2001
|
"aria-controls": "command-palette-list",
|
|
2002
2002
|
placeholder: "输入命令或搜索…",
|
|
2003
2003
|
onChange: (h) => {
|
|
2004
|
-
|
|
2004
|
+
s(h.target.value), d(0);
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
2007
|
),
|
|
@@ -2035,7 +2035,7 @@ function ci({ sections: e, triggerLabel: n = "打开命令面板", hotkey: r })
|
|
|
2035
2035
|
I.label
|
|
2036
2036
|
))
|
|
2037
2037
|
] }, h.heading ?? `divider-${w}`)
|
|
2038
|
-
)) : /* @__PURE__ */ t("p", { className: "command-palette__empty", children: `没有匹配「${
|
|
2038
|
+
)) : /* @__PURE__ */ t("p", { className: "command-palette__empty", children: `没有匹配「${o}」的命令` }) })
|
|
2039
2039
|
] })
|
|
2040
2040
|
] }) : null
|
|
2041
2041
|
] });
|
|
@@ -2052,8 +2052,8 @@ function di({
|
|
|
2052
2052
|
query: r,
|
|
2053
2053
|
onQueryChange: a,
|
|
2054
2054
|
sections: i,
|
|
2055
|
-
onSelect:
|
|
2056
|
-
renderTrigger:
|
|
2055
|
+
onSelect: o,
|
|
2056
|
+
renderTrigger: s,
|
|
2057
2057
|
label: c,
|
|
2058
2058
|
placeholder: d = "搜索…",
|
|
2059
2059
|
emptyTitle: b = "没有找到结果",
|
|
@@ -2112,9 +2112,9 @@ function di({
|
|
|
2112
2112
|
const O = D.shiftKey ? -1 : 1, Z = (W + O + F.length) % F.length;
|
|
2113
2113
|
F[Z]?.focus();
|
|
2114
2114
|
}
|
|
2115
|
-
} else D.target === w.current && (D.key === "ArrowDown" ? (D.preventDefault(), E(1)) : D.key === "ArrowUp" ? (D.preventDefault(), E(-1)) : D.key === "Home" && g.length > 0 ? (D.preventDefault(), y(g[0].key)) : D.key === "End" && g.length > 0 ? (D.preventDefault(), y(g[g.length - 1].key)) : D.key === "Enter" && v && (D.preventDefault(),
|
|
2115
|
+
} else D.target === w.current && (D.key === "ArrowDown" ? (D.preventDefault(), E(1)) : D.key === "ArrowUp" ? (D.preventDefault(), E(-1)) : D.key === "Home" && g.length > 0 ? (D.preventDefault(), y(g[0].key)) : D.key === "End" && g.length > 0 ? (D.preventDefault(), y(g[g.length - 1].key)) : D.key === "Enter" && v && (D.preventDefault(), o(v.item)));
|
|
2116
2116
|
}
|
|
2117
|
-
const P =
|
|
2117
|
+
const P = s({
|
|
2118
2118
|
ref: k,
|
|
2119
2119
|
type: "button",
|
|
2120
2120
|
onClick: () => n(!0),
|
|
@@ -2122,7 +2122,7 @@ function di({
|
|
|
2122
2122
|
"aria-expanded": e,
|
|
2123
2123
|
"aria-controls": _
|
|
2124
2124
|
});
|
|
2125
|
-
return /* @__PURE__ */ l(
|
|
2125
|
+
return /* @__PURE__ */ l(ae, { children: [
|
|
2126
2126
|
/* @__PURE__ */ t("span", { className: "search-dialog__trigger", children: P }),
|
|
2127
2127
|
e ? /* @__PURE__ */ l("div", { className: "search-dialog", children: [
|
|
2128
2128
|
/* @__PURE__ */ t(
|
|
@@ -2212,7 +2212,7 @@ function di({
|
|
|
2212
2212
|
disabled: O.disabled,
|
|
2213
2213
|
onMouseEnter: () => !O.disabled && y(j),
|
|
2214
2214
|
onMouseDown: (J) => J.preventDefault(),
|
|
2215
|
-
onClick: () => !O.disabled &&
|
|
2215
|
+
onClick: () => !O.disabled && o(O),
|
|
2216
2216
|
children: [
|
|
2217
2217
|
/* @__PURE__ */ t("span", { className: "search-dialog__option-label", children: O.label }),
|
|
2218
2218
|
O.description ? /* @__PURE__ */ t("span", { className: "search-dialog__option-description", children: O.description }) : null
|
|
@@ -2289,8 +2289,8 @@ function St(e, n, r) {
|
|
|
2289
2289
|
e.preventDefault(), a?.focus();
|
|
2290
2290
|
return;
|
|
2291
2291
|
}
|
|
2292
|
-
const
|
|
2293
|
-
!a?.contains(n.activeElement) || n.activeElement === a ? (e.preventDefault(), (e.shiftKey ?
|
|
2292
|
+
const o = i[0], s = i.at(-1);
|
|
2293
|
+
!a?.contains(n.activeElement) || n.activeElement === a ? (e.preventDefault(), (e.shiftKey ? s : o).focus()) : e.shiftKey && n.activeElement === o ? (e.preventDefault(), s.focus()) : !e.shiftKey && n.activeElement === s && (e.preventDefault(), o.focus());
|
|
2294
2294
|
}
|
|
2295
2295
|
function nt(e, n) {
|
|
2296
2296
|
if (!e) return;
|
|
@@ -2303,8 +2303,8 @@ function De({
|
|
|
2303
2303
|
dismissable: r = !0,
|
|
2304
2304
|
outsidePointer: a = !1,
|
|
2305
2305
|
outsidePointerIgnoreRef: i,
|
|
2306
|
-
containerRef:
|
|
2307
|
-
initialFocusRef:
|
|
2306
|
+
containerRef: o,
|
|
2307
|
+
initialFocusRef: s,
|
|
2308
2308
|
initialFocusTiming: c = "deferred",
|
|
2309
2309
|
registrationTiming: d = "deferred",
|
|
2310
2310
|
focusOnOpen: b = !0,
|
|
@@ -2333,7 +2333,7 @@ function De({
|
|
|
2333
2333
|
blocking: n,
|
|
2334
2334
|
escape: r,
|
|
2335
2335
|
outsidePointer: a,
|
|
2336
|
-
getContainer: () =>
|
|
2336
|
+
getContainer: () => o.current,
|
|
2337
2337
|
onClose: (H) => w.current?.(H)
|
|
2338
2338
|
};
|
|
2339
2339
|
S.current = O;
|
|
@@ -2363,12 +2363,12 @@ function De({
|
|
|
2363
2363
|
D.removeEventListener("keydown", V), D.removeEventListener("pointerdown", J, !0), D.removeEventListener("pointerup", $, !0), v.current = null, Z(), S.current = null, Xn(D);
|
|
2364
2364
|
const L = y.current, C = et.get(D) ?? [];
|
|
2365
2365
|
if (g.current && L && (C.push(L), et.set(D, C), queueMicrotask(() => et.delete(D))), H) {
|
|
2366
|
-
const X = [D.activeElement instanceof HTMLElement && D.activeElement !== D.body && !
|
|
2366
|
+
const X = [D.activeElement instanceof HTMLElement && D.activeElement !== D.body && !o.current?.contains(D.activeElement) ? D.activeElement : null, L, ...C].find(Xe);
|
|
2367
2367
|
X && X.focus(), (!X || D.activeElement !== X) && !nr(D) && wr(D);
|
|
2368
2368
|
}
|
|
2369
2369
|
y.current = null, h(null);
|
|
2370
2370
|
};
|
|
2371
|
-
}, [
|
|
2371
|
+
}, [o, e, i, p]);
|
|
2372
2372
|
tt(() => {
|
|
2373
2373
|
if (d === "layout")
|
|
2374
2374
|
return k();
|
|
@@ -2382,12 +2382,12 @@ function De({
|
|
|
2382
2382
|
outsidePointer: a
|
|
2383
2383
|
});
|
|
2384
2384
|
}, [n, r, _, e, a]), tt(() => {
|
|
2385
|
-
!e || !b || c !== "layout" || nt(
|
|
2386
|
-
}, [
|
|
2385
|
+
!e || !b || c !== "layout" || nt(o.current, s);
|
|
2386
|
+
}, [o, b, s, c, e, x]), G(() => {
|
|
2387
2387
|
if (!e || !b || c !== "deferred") return;
|
|
2388
|
-
const D = window.setTimeout(() => nt(
|
|
2388
|
+
const D = window.setTimeout(() => nt(o.current, s), 0);
|
|
2389
2389
|
return () => window.clearTimeout(D);
|
|
2390
|
-
}, [
|
|
2390
|
+
}, [o, b, s, c, e, x]);
|
|
2391
2391
|
const T = ce((D) => {
|
|
2392
2392
|
const F = S.current;
|
|
2393
2393
|
if (!(!F || typeof document > "u")) {
|
|
@@ -2409,8 +2409,8 @@ function De({
|
|
|
2409
2409
|
const D = S.current;
|
|
2410
2410
|
if (!D || !Ee(document, D.id)) return !1;
|
|
2411
2411
|
const F = D.getContainer();
|
|
2412
|
-
return F?.isConnected ? (nt(F,
|
|
2413
|
-
}, [
|
|
2412
|
+
return F?.isConnected ? (nt(F, s), F.contains(document.activeElement)) : !1;
|
|
2413
|
+
}, [s]), P = ce(
|
|
2414
2414
|
(D) => x ? bt(D, x) : u ? null : D,
|
|
2415
2415
|
[u, x]
|
|
2416
2416
|
);
|
|
@@ -2422,13 +2422,13 @@ function ui({
|
|
|
2422
2422
|
title: r,
|
|
2423
2423
|
description: a,
|
|
2424
2424
|
confirmLabel: i,
|
|
2425
|
-
verificationLabel:
|
|
2426
|
-
verificationPhrase:
|
|
2425
|
+
verificationLabel: o,
|
|
2426
|
+
verificationPhrase: s,
|
|
2427
2427
|
irreversibleDescription: c,
|
|
2428
2428
|
loading: d,
|
|
2429
2429
|
onConfirm: b
|
|
2430
2430
|
}) {
|
|
2431
|
-
const [u, f] = B(""), [_, m] = B(null), N = A(null), x = A(null), h = te(), w = te(), I = u ===
|
|
2431
|
+
const [u, f] = B(""), [_, m] = B(null), N = A(null), x = A(null), h = te(), w = te(), I = u === s && !d, { onKeyDown: g, portal: R } = De({
|
|
2432
2432
|
open: e,
|
|
2433
2433
|
blocking: !0,
|
|
2434
2434
|
dismissable: !d,
|
|
@@ -2475,9 +2475,9 @@ function ui({
|
|
|
2475
2475
|
/* @__PURE__ */ t("p", { children: a }),
|
|
2476
2476
|
/* @__PURE__ */ l("label", { className: "destructive-modal__prompt", id: w, htmlFor: `${w}-input`, children: [
|
|
2477
2477
|
"若要确认,请输入",
|
|
2478
|
-
s,
|
|
2479
|
-
"「",
|
|
2480
2478
|
o,
|
|
2479
|
+
"「",
|
|
2480
|
+
s,
|
|
2481
2481
|
"」"
|
|
2482
2482
|
] }),
|
|
2483
2483
|
/* @__PURE__ */ t(
|
|
@@ -2533,9 +2533,9 @@ function hi({
|
|
|
2533
2533
|
title: r,
|
|
2534
2534
|
children: a,
|
|
2535
2535
|
footer: i,
|
|
2536
|
-
height:
|
|
2536
|
+
height: o
|
|
2537
2537
|
}) {
|
|
2538
|
-
const
|
|
2538
|
+
const s = A(null), c = te(), [d, b] = B(0), u = A(null), f = A(!1);
|
|
2539
2539
|
G(() => {
|
|
2540
2540
|
e || b(0);
|
|
2541
2541
|
}, [e]);
|
|
@@ -2544,7 +2544,7 @@ function hi({
|
|
|
2544
2544
|
blocking: !0,
|
|
2545
2545
|
dismissable: !0,
|
|
2546
2546
|
outsidePointer: !0,
|
|
2547
|
-
containerRef:
|
|
2547
|
+
containerRef: s,
|
|
2548
2548
|
onClose: n
|
|
2549
2549
|
});
|
|
2550
2550
|
if (!e) return null;
|
|
@@ -2572,14 +2572,14 @@ function hi({
|
|
|
2572
2572
|
/* @__PURE__ */ l(
|
|
2573
2573
|
"div",
|
|
2574
2574
|
{
|
|
2575
|
-
ref:
|
|
2575
|
+
ref: s,
|
|
2576
2576
|
role: "dialog",
|
|
2577
2577
|
"aria-modal": "true",
|
|
2578
2578
|
"aria-labelledby": c,
|
|
2579
2579
|
className: "drawer__panel",
|
|
2580
2580
|
tabIndex: -1,
|
|
2581
2581
|
style: {
|
|
2582
|
-
...
|
|
2582
|
+
...o ? { maxHeight: `${o}px` } : null,
|
|
2583
2583
|
...d ? { transform: `translateY(${d}px)` } : null
|
|
2584
2584
|
},
|
|
2585
2585
|
children: [
|
|
@@ -2615,10 +2615,10 @@ function fi({
|
|
|
2615
2615
|
actions: a,
|
|
2616
2616
|
headingLevel: i
|
|
2617
2617
|
}) {
|
|
2618
|
-
const
|
|
2618
|
+
const o = i ? `h${i}` : "p";
|
|
2619
2619
|
return /* @__PURE__ */ l("div", { className: "empty-state", role: "status", "aria-label": n, children: [
|
|
2620
2620
|
e ? /* @__PURE__ */ t("span", { className: "empty-state__icon", "aria-hidden": "true", children: e }) : null,
|
|
2621
|
-
/* @__PURE__ */ t(
|
|
2621
|
+
/* @__PURE__ */ t(o, { className: "empty-state__title", children: n }),
|
|
2622
2622
|
r ? /* @__PURE__ */ t("p", { className: "empty-state__desc", children: r }) : null,
|
|
2623
2623
|
a ? /* @__PURE__ */ t("div", { className: "empty-state__actions", children: a }) : null
|
|
2624
2624
|
] });
|
|
@@ -2680,12 +2680,12 @@ function _i({
|
|
|
2680
2680
|
inline: a,
|
|
2681
2681
|
topics: i
|
|
2682
2682
|
}) {
|
|
2683
|
-
const [
|
|
2683
|
+
const [o, s] = B(!!a), [c, d] = B(null), [b, u] = B(!1), f = A(null), _ = A([]), m = te(), N = te();
|
|
2684
2684
|
function x() {
|
|
2685
|
-
|
|
2685
|
+
s(!1), f.current?.focus();
|
|
2686
2686
|
}
|
|
2687
2687
|
function h(v) {
|
|
2688
|
-
v.preventDefault(), u(!0), a || (
|
|
2688
|
+
v.preventDefault(), u(!0), a || (s(!1), f.current?.focus());
|
|
2689
2689
|
}
|
|
2690
2690
|
const w = $e.findIndex((v) => v.value === c), I = w === -1 ? 0 : w;
|
|
2691
2691
|
function g(v) {
|
|
@@ -2757,15 +2757,15 @@ function _i({
|
|
|
2757
2757
|
ref: f,
|
|
2758
2758
|
type: "button",
|
|
2759
2759
|
className: "feedback__trigger",
|
|
2760
|
-
"aria-expanded":
|
|
2760
|
+
"aria-expanded": o,
|
|
2761
2761
|
"aria-controls": m,
|
|
2762
2762
|
onClick: () => {
|
|
2763
|
-
|
|
2763
|
+
o || u(!1), s(!o);
|
|
2764
2764
|
},
|
|
2765
2765
|
children: e
|
|
2766
2766
|
}
|
|
2767
2767
|
),
|
|
2768
|
-
|
|
2768
|
+
o ? y : null,
|
|
2769
2769
|
S
|
|
2770
2770
|
] });
|
|
2771
2771
|
}
|
|
@@ -2775,14 +2775,14 @@ function yi({
|
|
|
2775
2775
|
tone: r,
|
|
2776
2776
|
footerStatus: a,
|
|
2777
2777
|
footerAction: i,
|
|
2778
|
-
disabled:
|
|
2779
|
-
children:
|
|
2778
|
+
disabled: o,
|
|
2779
|
+
children: s
|
|
2780
2780
|
}) {
|
|
2781
2781
|
const c = Y("fieldset", r ? `fieldset--${r}` : "");
|
|
2782
|
-
return /* @__PURE__ */ l("fieldset", { className: c, disabled:
|
|
2782
|
+
return /* @__PURE__ */ l("fieldset", { className: c, disabled: o, children: [
|
|
2783
2783
|
e ? /* @__PURE__ */ t("legend", { className: "fieldset__title", children: e }) : null,
|
|
2784
2784
|
/* @__PURE__ */ t("p", { className: "fieldset__subtitle", children: n }),
|
|
2785
|
-
|
|
2785
|
+
s ? /* @__PURE__ */ t("div", { className: "fieldset__body", children: s }) : null,
|
|
2786
2786
|
a || i ? /* @__PURE__ */ l("div", { className: "fieldset__footer", children: [
|
|
2787
2787
|
/* @__PURE__ */ t("span", { className: "fieldset__status", children: a }),
|
|
2788
2788
|
i ? /* @__PURE__ */ t("span", { className: "fieldset__actions", children: i }) : null
|
|
@@ -2790,10 +2790,10 @@ function yi({
|
|
|
2790
2790
|
] });
|
|
2791
2791
|
}
|
|
2792
2792
|
function fn(e, n, r, a, i) {
|
|
2793
|
-
const
|
|
2794
|
-
e.forEach((
|
|
2795
|
-
const d = `${r}/${
|
|
2796
|
-
i.push({ path: d, name:
|
|
2793
|
+
const o = e.length;
|
|
2794
|
+
e.forEach((s, c) => {
|
|
2795
|
+
const d = `${r}/${s.name}`, b = s.type === "folder" && (s.children?.length ?? 0) > 0;
|
|
2796
|
+
i.push({ path: d, name: s.name, type: s.type, level: n, parentPath: r, hasChildren: b, setsize: o, posinset: c + 1 }), s.type === "folder" && a.has(d) && s.children && fn(s.children, n + 1, d, a, i);
|
|
2797
2797
|
});
|
|
2798
2798
|
}
|
|
2799
2799
|
function gi({
|
|
@@ -2801,12 +2801,12 @@ function gi({
|
|
|
2801
2801
|
label: n = "项目目录",
|
|
2802
2802
|
defaultExpanded: r = []
|
|
2803
2803
|
}) {
|
|
2804
|
-
const [a, i] = B(() => new Set(r)), [
|
|
2804
|
+
const [a, i] = B(() => new Set(r)), [o, s] = B(() => e.length ? `/${e[0].name}` : ""), c = A(/* @__PURE__ */ new Map()), d = oe(() => {
|
|
2805
2805
|
const m = [];
|
|
2806
2806
|
return fn(e, 1, "", a, m), m;
|
|
2807
|
-
}, [e, a]), b = d.some((m) => m.path ===
|
|
2807
|
+
}, [e, a]), b = d.some((m) => m.path === o) ? o : d[0]?.path ?? "";
|
|
2808
2808
|
function u(m) {
|
|
2809
|
-
|
|
2809
|
+
s(m), window.requestAnimationFrame(() => c.current.get(m)?.focus());
|
|
2810
2810
|
}
|
|
2811
2811
|
function f(m, N) {
|
|
2812
2812
|
i((x) => {
|
|
@@ -2838,10 +2838,10 @@ function gi({
|
|
|
2838
2838
|
className: "file-tree__item",
|
|
2839
2839
|
style: { paddingLeft: `calc(${m.level} * var(--q1-space-4))` },
|
|
2840
2840
|
onClick: (h) => {
|
|
2841
|
-
h.stopPropagation(),
|
|
2841
|
+
h.stopPropagation(), s(m.path), m.hasChildren && f(m.path);
|
|
2842
2842
|
},
|
|
2843
2843
|
children: /* @__PURE__ */ l("span", { className: "file-tree__row", children: [
|
|
2844
|
-
m.hasChildren ? /* @__PURE__ */ t(
|
|
2844
|
+
m.hasChildren ? /* @__PURE__ */ t(ge, { className: `file-tree__chevron${N ? " file-tree__chevron--open" : ""}`, size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t("span", { className: "file-tree__chevron-spacer", "aria-hidden": "true" }),
|
|
2845
2845
|
m.type === "folder" ? /* @__PURE__ */ t(x, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(Tn, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }),
|
|
2846
2846
|
/* @__PURE__ */ t("span", { className: "file-tree__name", children: m.name })
|
|
2847
2847
|
] })
|
|
@@ -2865,7 +2865,7 @@ function Ni({
|
|
|
2865
2865
|
}) {
|
|
2866
2866
|
return /* @__PURE__ */ l("label", { className: "label", htmlFor: e, children: [
|
|
2867
2867
|
r,
|
|
2868
|
-
n ? /* @__PURE__ */ l(
|
|
2868
|
+
n ? /* @__PURE__ */ l(ae, { children: [
|
|
2869
2869
|
/* @__PURE__ */ t("span", { className: "label__required", "aria-hidden": "true", children: "*" }),
|
|
2870
2870
|
/* @__PURE__ */ t("span", { className: "q1-sr-only", children: "(必填)" })
|
|
2871
2871
|
] }) : null
|
|
@@ -2877,16 +2877,16 @@ function Ae({
|
|
|
2877
2877
|
onClose: r,
|
|
2878
2878
|
onTabExit: a
|
|
2879
2879
|
}) {
|
|
2880
|
-
const [i,
|
|
2880
|
+
const [i, o] = B(-1), s = A([]), c = A({ buffer: "", timer: 0 });
|
|
2881
2881
|
G(() => () => window.clearTimeout(c.current.timer), []);
|
|
2882
2882
|
function d(f) {
|
|
2883
|
-
|
|
2883
|
+
o(f), s.current[f]?.focus();
|
|
2884
2884
|
}
|
|
2885
2885
|
function b() {
|
|
2886
|
-
|
|
2886
|
+
o(-1);
|
|
2887
2887
|
}
|
|
2888
2888
|
function u(f) {
|
|
2889
|
-
const _ =
|
|
2889
|
+
const _ = s.current.indexOf(f.target), m = e.indexOf(_ >= 0 ? _ : i);
|
|
2890
2890
|
if (f.key === "ArrowDown")
|
|
2891
2891
|
f.preventDefault(), d(e[(m + 1) % e.length]);
|
|
2892
2892
|
else if (f.key === "ArrowUp")
|
|
@@ -2907,7 +2907,7 @@ function Ae({
|
|
|
2907
2907
|
N !== void 0 && d(N);
|
|
2908
2908
|
}
|
|
2909
2909
|
}
|
|
2910
|
-
return { itemRefs:
|
|
2910
|
+
return { itemRefs: s, focusItem: d, reset: b, onMenuKeyDown: u };
|
|
2911
2911
|
}
|
|
2912
2912
|
const Nr = (e) => e.type === "item" && !e.disabled || e.type === "link";
|
|
2913
2913
|
function vi({
|
|
@@ -2915,7 +2915,7 @@ function vi({
|
|
|
2915
2915
|
entries: n,
|
|
2916
2916
|
children: r
|
|
2917
2917
|
}) {
|
|
2918
|
-
const [a, i] = B(null),
|
|
2918
|
+
const [a, i] = B(null), o = A(null), s = A(null), c = A(0), d = te(), b = a !== null, u = n.flatMap((y, S) => Nr(y) ? [S] : []), { itemRefs: f, focusItem: _, reset: m, onMenuKeyDown: N } = Ae({
|
|
2919
2919
|
focusableIndices: u,
|
|
2920
2920
|
getText: (y) => {
|
|
2921
2921
|
const S = n[y];
|
|
@@ -2927,17 +2927,17 @@ function vi({
|
|
|
2927
2927
|
i({ x: y, y: S }), window.requestAnimationFrame(() => _(u[0]));
|
|
2928
2928
|
}
|
|
2929
2929
|
function h(y = !0) {
|
|
2930
|
-
i(null), m(), y &&
|
|
2930
|
+
i(null), m(), y && o.current?.focus();
|
|
2931
2931
|
}
|
|
2932
2932
|
fe(() => {
|
|
2933
|
-
if (!a || !
|
|
2934
|
-
const y =
|
|
2933
|
+
if (!a || !s.current) return;
|
|
2934
|
+
const y = s.current.getBoundingClientRect();
|
|
2935
2935
|
let { x: S, y: v } = a;
|
|
2936
2936
|
S + y.width > window.innerWidth - 8 && (S = Math.max(8, S - y.width)), v + y.height > window.innerHeight - 8 && (v = Math.max(8, v - y.height)), (S !== a.x || v !== a.y) && i({ x: S, y: v });
|
|
2937
2937
|
}, [a]), G(() => {
|
|
2938
2938
|
if (!b) return;
|
|
2939
2939
|
function y(S) {
|
|
2940
|
-
|
|
2940
|
+
s.current && !s.current.contains(S.target) && h(!1);
|
|
2941
2941
|
}
|
|
2942
2942
|
return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
2943
2943
|
}, [b]);
|
|
@@ -2947,7 +2947,7 @@ function vi({
|
|
|
2947
2947
|
function I(y) {
|
|
2948
2948
|
if (y.shiftKey && y.key === "F10" || y.key === "ContextMenu") {
|
|
2949
2949
|
y.preventDefault();
|
|
2950
|
-
const S =
|
|
2950
|
+
const S = o.current.getBoundingClientRect();
|
|
2951
2951
|
x(S.left + 16, S.top + 16);
|
|
2952
2952
|
}
|
|
2953
2953
|
}
|
|
@@ -2960,11 +2960,11 @@ function vi({
|
|
|
2960
2960
|
function R() {
|
|
2961
2961
|
window.clearTimeout(c.current);
|
|
2962
2962
|
}
|
|
2963
|
-
return /* @__PURE__ */ l(
|
|
2963
|
+
return /* @__PURE__ */ l(ae, { children: [
|
|
2964
2964
|
/* @__PURE__ */ t(
|
|
2965
2965
|
"div",
|
|
2966
2966
|
{
|
|
2967
|
-
ref:
|
|
2967
|
+
ref: o,
|
|
2968
2968
|
className: "context-menu__area",
|
|
2969
2969
|
tabIndex: 0,
|
|
2970
2970
|
role: "button",
|
|
@@ -2980,7 +2980,7 @@ function vi({
|
|
|
2980
2980
|
b ? /* @__PURE__ */ t(
|
|
2981
2981
|
"div",
|
|
2982
2982
|
{
|
|
2983
|
-
ref:
|
|
2983
|
+
ref: s,
|
|
2984
2984
|
id: d,
|
|
2985
2985
|
role: "menu",
|
|
2986
2986
|
"aria-label": e,
|
|
@@ -3038,23 +3038,23 @@ function ki({
|
|
|
3038
3038
|
disabled: r,
|
|
3039
3039
|
align: a = "end"
|
|
3040
3040
|
}) {
|
|
3041
|
-
const [i,
|
|
3041
|
+
const [i, o] = B(!1), s = A(null), c = te(), d = e.flatMap((h, w) => h.disabled ? [] : [w]), { itemRefs: b, focusItem: u, reset: f, onMenuKeyDown: _ } = Ae({
|
|
3042
3042
|
focusableIndices: d,
|
|
3043
3043
|
getText: (h) => e[h].label,
|
|
3044
3044
|
onClose: () => N()
|
|
3045
3045
|
});
|
|
3046
3046
|
function m(h) {
|
|
3047
|
-
|
|
3047
|
+
o(!0);
|
|
3048
3048
|
const w = h === "first" ? d[0] : d[d.length - 1];
|
|
3049
3049
|
window.requestAnimationFrame(() => u(w));
|
|
3050
3050
|
}
|
|
3051
3051
|
function N(h = !0) {
|
|
3052
|
-
|
|
3052
|
+
o(!1), f(), h && s.current?.focus();
|
|
3053
3053
|
}
|
|
3054
3054
|
G(() => {
|
|
3055
3055
|
if (!i) return;
|
|
3056
3056
|
function h(w) {
|
|
3057
|
-
const I =
|
|
3057
|
+
const I = s.current?.closest(".dots-menu");
|
|
3058
3058
|
I && !I.contains(w.target) && N(!1);
|
|
3059
3059
|
}
|
|
3060
3060
|
return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
|
|
@@ -3066,7 +3066,7 @@ function ki({
|
|
|
3066
3066
|
/* @__PURE__ */ t(
|
|
3067
3067
|
"button",
|
|
3068
3068
|
{
|
|
3069
|
-
ref:
|
|
3069
|
+
ref: s,
|
|
3070
3070
|
type: "button",
|
|
3071
3071
|
className: `dots-menu__trigger dots-menu__trigger--${n}`,
|
|
3072
3072
|
"aria-label": "更多操作",
|
|
@@ -3115,14 +3115,14 @@ function xi({
|
|
|
3115
3115
|
showLabel: a = !1,
|
|
3116
3116
|
titlePrefix: i
|
|
3117
3117
|
}) {
|
|
3118
|
-
const
|
|
3118
|
+
const o = Y("status-dot", `status-dot--${e}`, r ? "status-dot--animated" : "");
|
|
3119
3119
|
if (a)
|
|
3120
3120
|
return /* @__PURE__ */ l("span", { className: "status-dot-item", children: [
|
|
3121
|
-
/* @__PURE__ */ t("span", { className:
|
|
3121
|
+
/* @__PURE__ */ t("span", { className: o, "aria-hidden": "true" }),
|
|
3122
3122
|
/* @__PURE__ */ t("span", { className: "status-dot-item__label", children: n })
|
|
3123
3123
|
] });
|
|
3124
|
-
const
|
|
3125
|
-
return /* @__PURE__ */ t("span", { className:
|
|
3124
|
+
const s = i ? `${i}:${n}` : n;
|
|
3125
|
+
return /* @__PURE__ */ t("span", { className: o, role: "img", "aria-label": s, title: s });
|
|
3126
3126
|
}
|
|
3127
3127
|
function Ci({
|
|
3128
3128
|
tone: e = "neutral",
|
|
@@ -3130,8 +3130,8 @@ function Ci({
|
|
|
3130
3130
|
quiet: r = !1,
|
|
3131
3131
|
inverted: a = !1,
|
|
3132
3132
|
size: i = "md",
|
|
3133
|
-
icon:
|
|
3134
|
-
count:
|
|
3133
|
+
icon: o,
|
|
3134
|
+
count: s = !1,
|
|
3135
3135
|
title: c,
|
|
3136
3136
|
className: d,
|
|
3137
3137
|
children: b,
|
|
@@ -3141,42 +3141,42 @@ function Ci({
|
|
|
3141
3141
|
"badge",
|
|
3142
3142
|
a ? "badge--inverted" : r ? "badge--quiet" : `badge--${e}${n ? "-subtle" : ""}`,
|
|
3143
3143
|
i === "md" ? "" : `badge--${i}`,
|
|
3144
|
-
|
|
3144
|
+
s ? "badge--count" : "",
|
|
3145
3145
|
d
|
|
3146
|
-
), _ =
|
|
3146
|
+
), _ = o != null && (b == null || b === "");
|
|
3147
3147
|
return /* @__PURE__ */ l("span", { className: f, title: c, ..._ ? { role: "img", "aria-label": c } : {}, ...u, children: [
|
|
3148
|
-
|
|
3148
|
+
o ? /* @__PURE__ */ t("span", { className: "badge__icon", "aria-hidden": "true", children: o }) : null,
|
|
3149
3149
|
_ || b === void 0 || b === null || b === "" ? null : (
|
|
3150
3150
|
// 文字包裹层:光学补偿开关 --q1-badge-optical-shift 的作用点(0.15.2 起的 DOM 结构)。
|
|
3151
3151
|
/* @__PURE__ */ t("span", { className: "badge__label", children: b })
|
|
3152
3152
|
)
|
|
3153
3153
|
] });
|
|
3154
3154
|
}
|
|
3155
|
-
function qi({ href: e, size: n = "md", icon: r, title: a, className: i, children:
|
|
3156
|
-
const c = Y("badge", "badge--pill", n === "md" ? "" : `badge--${n}`, i), b = r != null && (
|
|
3157
|
-
return /* @__PURE__ */ l("a", { className: c, href: e, title: a, ...b, ...
|
|
3155
|
+
function qi({ href: e, size: n = "md", icon: r, title: a, className: i, children: o, ...s }) {
|
|
3156
|
+
const c = Y("badge", "badge--pill", n === "md" ? "" : `badge--${n}`, i), b = r != null && (o == null || o === "") ? { "aria-label": a } : {};
|
|
3157
|
+
return /* @__PURE__ */ l("a", { className: c, href: e, title: a, ...b, ...s, children: [
|
|
3158
3158
|
r ? /* @__PURE__ */ t("span", { className: "badge__icon", "aria-hidden": "true", children: r }) : null,
|
|
3159
|
-
|
|
3159
|
+
o
|
|
3160
3160
|
] });
|
|
3161
3161
|
}
|
|
3162
|
-
function Ei({ title: e, children: n, tone: r, icon: a, action: i, onDismiss:
|
|
3163
|
-
const b = r === void 0 && !
|
|
3162
|
+
function Ei({ title: e, children: n, tone: r, icon: a, action: i, onDismiss: o, progress: s, className: c, ...d }) {
|
|
3163
|
+
const b = r === void 0 && !s, u = Y(
|
|
3164
3164
|
"banner",
|
|
3165
3165
|
b ? "banner--announcement" : r === "neutral" ? "" : `banner--${r}`,
|
|
3166
|
-
|
|
3166
|
+
s ? "banner--progress" : "",
|
|
3167
3167
|
c
|
|
3168
3168
|
), f = /* @__PURE__ */ l("p", { className: "banner__content", children: [
|
|
3169
3169
|
/* @__PURE__ */ t("span", { className: "banner__title", children: e }),
|
|
3170
|
-
n != null ? /* @__PURE__ */ l(
|
|
3170
|
+
n != null ? /* @__PURE__ */ l(ae, { children: [
|
|
3171
3171
|
" — ",
|
|
3172
3172
|
n
|
|
3173
3173
|
] }) : null
|
|
3174
3174
|
] }), _ = i ? b ? /* @__PURE__ */ t("a", { className: "banner__cta", href: i.href, children: i.label }) : /* @__PURE__ */ l("a", { className: "banner__action", href: i.href, children: [
|
|
3175
3175
|
i.label,
|
|
3176
|
-
/* @__PURE__ */ t(
|
|
3177
|
-
] }) : null, m = !b &&
|
|
3178
|
-
if (
|
|
3179
|
-
const N = Number.isFinite(
|
|
3176
|
+
/* @__PURE__ */ t(ge, { "aria-hidden": "true", size: 16, strokeWidth: 2 })
|
|
3177
|
+
] }) : null, m = !b && o ? /* @__PURE__ */ t("button", { className: "banner__close", type: "button", "aria-label": "关闭横幅", onClick: o, children: /* @__PURE__ */ t(Ne, { "aria-hidden": "true", size: 16, strokeWidth: 2 }) }) : null;
|
|
3178
|
+
if (s) {
|
|
3179
|
+
const N = Number.isFinite(s.value) ? Math.min(100, Math.max(0, s.value)) : 0;
|
|
3180
3180
|
return /* @__PURE__ */ l("div", { className: u, ...d, children: [
|
|
3181
3181
|
/* @__PURE__ */ l("div", { className: "banner__progress-head", children: [
|
|
3182
3182
|
f,
|
|
@@ -3194,7 +3194,7 @@ function Ei({ title: e, children: n, tone: r, icon: a, action: i, onDismiss: s,
|
|
|
3194
3194
|
"aria-valuenow": N,
|
|
3195
3195
|
"aria-valuemin": 0,
|
|
3196
3196
|
"aria-valuemax": 100,
|
|
3197
|
-
"aria-label":
|
|
3197
|
+
"aria-label": s.label,
|
|
3198
3198
|
children: /* @__PURE__ */ t("div", { className: "banner__progress-bar", style: { width: `${N}%` } })
|
|
3199
3199
|
}
|
|
3200
3200
|
)
|
|
@@ -3209,7 +3209,7 @@ function Ei({ title: e, children: n, tone: r, icon: a, action: i, onDismiss: s,
|
|
|
3209
3209
|
] }) : _ ?? m
|
|
3210
3210
|
] });
|
|
3211
3211
|
}
|
|
3212
|
-
function vr({ hover: e, secondary: n, divided: r, direction: a, shadow: i, bordered:
|
|
3212
|
+
function vr({ hover: e, secondary: n, divided: r, direction: a, shadow: i, bordered: o, className: s }) {
|
|
3213
3213
|
return Y(
|
|
3214
3214
|
"q1-card",
|
|
3215
3215
|
e ? "q1-card--hover" : "",
|
|
@@ -3219,8 +3219,8 @@ function vr({ hover: e, secondary: n, divided: r, direction: a, shadow: i, borde
|
|
|
3219
3219
|
a === "row" ? "q1-card--row" : "",
|
|
3220
3220
|
i ? "q1-card--shadow" : "",
|
|
3221
3221
|
// bordered 默认 true;显式 false 才降级为无框(用 === false 而非 !bordered,让 undefined 保持有框)。
|
|
3222
|
-
|
|
3223
|
-
|
|
3222
|
+
o === !1 ? "q1-card--borderless" : "",
|
|
3223
|
+
s
|
|
3224
3224
|
);
|
|
3225
3225
|
}
|
|
3226
3226
|
function kr(e) {
|
|
@@ -3243,8 +3243,8 @@ function kr(e) {
|
|
|
3243
3243
|
href: r,
|
|
3244
3244
|
hover: a,
|
|
3245
3245
|
secondary: i,
|
|
3246
|
-
divided:
|
|
3247
|
-
direction:
|
|
3246
|
+
divided: o,
|
|
3247
|
+
direction: s,
|
|
3248
3248
|
shadow: c,
|
|
3249
3249
|
bordered: d,
|
|
3250
3250
|
className: b,
|
|
@@ -3296,8 +3296,8 @@ function Si({
|
|
|
3296
3296
|
onOpenChange: r,
|
|
3297
3297
|
trigger: a,
|
|
3298
3298
|
header: i,
|
|
3299
|
-
footer:
|
|
3300
|
-
children:
|
|
3299
|
+
footer: o,
|
|
3300
|
+
children: s,
|
|
3301
3301
|
collapseBelow: c = Ir,
|
|
3302
3302
|
drawerWidth: d = "default",
|
|
3303
3303
|
variant: b = "panel",
|
|
@@ -3341,15 +3341,15 @@ function Si({
|
|
|
3341
3341
|
"data-sidebar-drawer-persistent": !0,
|
|
3342
3342
|
children: [
|
|
3343
3343
|
i ? /* @__PURE__ */ t(Pe.Header, { children: i }) : null,
|
|
3344
|
-
/* @__PURE__ */ t(Pe.Content, { children:
|
|
3345
|
-
|
|
3344
|
+
/* @__PURE__ */ t(Pe.Content, { children: s }),
|
|
3345
|
+
o ? /* @__PURE__ */ t(Pe.Footer, { children: o }) : null
|
|
3346
3346
|
]
|
|
3347
3347
|
}
|
|
3348
3348
|
);
|
|
3349
3349
|
const y = {
|
|
3350
3350
|
"--q1-sidebar-drawer-width": Sr[d]
|
|
3351
3351
|
};
|
|
3352
|
-
return /* @__PURE__ */ l(
|
|
3352
|
+
return /* @__PURE__ */ l(ae, { children: [
|
|
3353
3353
|
a({
|
|
3354
3354
|
ref: x,
|
|
3355
3355
|
type: "button",
|
|
@@ -3359,7 +3359,7 @@ function Si({
|
|
|
3359
3359
|
"aria-haspopup": "dialog"
|
|
3360
3360
|
}),
|
|
3361
3361
|
w ? R(
|
|
3362
|
-
/* @__PURE__ */ l(
|
|
3362
|
+
/* @__PURE__ */ l(ae, { children: [
|
|
3363
3363
|
/* @__PURE__ */ t("div", { className: "sheet__backdrop q1-sidebar-drawer__backdrop", "aria-hidden": "true", onMouseDown: (v) => v.preventDefault() }),
|
|
3364
3364
|
/* @__PURE__ */ l(
|
|
3365
3365
|
"div",
|
|
@@ -3388,10 +3388,10 @@ function Si({
|
|
|
3388
3388
|
".q1-navigation :is(a[href], button:not([disabled]))"
|
|
3389
3389
|
) ?? null;
|
|
3390
3390
|
},
|
|
3391
|
-
children:
|
|
3391
|
+
children: s
|
|
3392
3392
|
}
|
|
3393
3393
|
),
|
|
3394
|
-
|
|
3394
|
+
o ? /* @__PURE__ */ t("div", { className: "q1-sidebar-drawer__footer", children: o }) : null
|
|
3395
3395
|
]
|
|
3396
3396
|
}
|
|
3397
3397
|
)
|
|
@@ -3413,16 +3413,16 @@ function Di({ className: e, orientation: n = "vertical", ...r }) {
|
|
|
3413
3413
|
);
|
|
3414
3414
|
}
|
|
3415
3415
|
function $i({ label: e, action: n, children: r, className: a, ...i }) {
|
|
3416
|
-
const
|
|
3416
|
+
const o = te(), s = e !== void 0;
|
|
3417
3417
|
return /* @__PURE__ */ l(
|
|
3418
3418
|
"section",
|
|
3419
3419
|
{
|
|
3420
3420
|
className: Y("q1-navigation__section", a),
|
|
3421
3421
|
...i,
|
|
3422
|
-
"aria-labelledby":
|
|
3422
|
+
"aria-labelledby": s ? o : i["aria-labelledby"],
|
|
3423
3423
|
children: [
|
|
3424
|
-
|
|
3425
|
-
/* @__PURE__ */ t("h2", { className: "q1-navigation__section-heading", id:
|
|
3424
|
+
s ? /* @__PURE__ */ l("div", { className: "q1-navigation__section-header", children: [
|
|
3425
|
+
/* @__PURE__ */ t("h2", { className: "q1-navigation__section-heading", id: o, children: e }),
|
|
3426
3426
|
n ? /* @__PURE__ */ t("span", { className: "q1-navigation__section-action", children: n }) : null
|
|
3427
3427
|
] }) : null,
|
|
3428
3428
|
/* @__PURE__ */ t("div", { className: "q1-navigation__section-content", children: r })
|
|
@@ -3431,16 +3431,16 @@ function $i({ label: e, action: n, children: r, className: a, ...i }) {
|
|
|
3431
3431
|
);
|
|
3432
3432
|
}
|
|
3433
3433
|
function Mi(e) {
|
|
3434
|
-
const { active: n, disabled: r, icon: a, badge: i, description:
|
|
3434
|
+
const { active: n, disabled: r, icon: a, badge: i, description: o, action: s, children: c, className: d, href: b, ...u } = e, f = Y(
|
|
3435
3435
|
"q1-navigation__item",
|
|
3436
3436
|
n && "q1-navigation__item--active",
|
|
3437
3437
|
r && "q1-navigation__item--disabled",
|
|
3438
3438
|
d
|
|
3439
|
-
), _ = /* @__PURE__ */ l(
|
|
3439
|
+
), _ = /* @__PURE__ */ l(ae, { children: [
|
|
3440
3440
|
a ? /* @__PURE__ */ t("span", { className: "q1-navigation__item-icon", "aria-hidden": "true", children: a }) : null,
|
|
3441
3441
|
/* @__PURE__ */ l("span", { className: "q1-navigation__item-content", children: [
|
|
3442
3442
|
/* @__PURE__ */ t("span", { className: "q1-navigation__item-label", children: c }),
|
|
3443
|
-
|
|
3443
|
+
o ? /* @__PURE__ */ t("span", { className: "q1-navigation__item-description", children: o }) : null
|
|
3444
3444
|
] }),
|
|
3445
3445
|
i ? /* @__PURE__ */ t("span", { className: "q1-navigation__item-badge", children: i }) : null
|
|
3446
3446
|
] }), m = u;
|
|
@@ -3457,7 +3457,7 @@ function Mi(e) {
|
|
|
3457
3457
|
children: _
|
|
3458
3458
|
}
|
|
3459
3459
|
) : /* @__PURE__ */ t("button", { type: "button", className: f, disabled: r, ...u, children: _ }),
|
|
3460
|
-
|
|
3460
|
+
s ? /* @__PURE__ */ t("span", { className: "q1-navigation__item-action", children: s }) : null
|
|
3461
3461
|
] });
|
|
3462
3462
|
}
|
|
3463
3463
|
function Ti({
|
|
@@ -3466,9 +3466,9 @@ function Ti({
|
|
|
3466
3466
|
expanded: r,
|
|
3467
3467
|
defaultExpanded: a = !1,
|
|
3468
3468
|
onExpandedChange: i,
|
|
3469
|
-
children:
|
|
3469
|
+
children: o
|
|
3470
3470
|
}) {
|
|
3471
|
-
const
|
|
3471
|
+
const s = te(), [c, d] = B(a), b = r !== void 0, u = b ? r : c;
|
|
3472
3472
|
return /* @__PURE__ */ l("div", { className: "q1-navigation__group", children: [
|
|
3473
3473
|
/* @__PURE__ */ l(
|
|
3474
3474
|
"button",
|
|
@@ -3476,7 +3476,7 @@ function Ti({
|
|
|
3476
3476
|
type: "button",
|
|
3477
3477
|
className: "q1-navigation__group-trigger",
|
|
3478
3478
|
"aria-expanded": u,
|
|
3479
|
-
"aria-controls":
|
|
3479
|
+
"aria-controls": s,
|
|
3480
3480
|
onClick: () => {
|
|
3481
3481
|
const _ = !u;
|
|
3482
3482
|
b || d(_), i?.(_);
|
|
@@ -3484,11 +3484,11 @@ function Ti({
|
|
|
3484
3484
|
children: [
|
|
3485
3485
|
n ? /* @__PURE__ */ t("span", { className: "q1-navigation__group-icon", "aria-hidden": "true", children: n }) : null,
|
|
3486
3486
|
/* @__PURE__ */ t("span", { className: "q1-navigation__group-label", children: e }),
|
|
3487
|
-
/* @__PURE__ */ t(
|
|
3487
|
+
/* @__PURE__ */ t(ge, { className: "q1-navigation__group-chevron", size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
3488
3488
|
]
|
|
3489
3489
|
}
|
|
3490
3490
|
),
|
|
3491
|
-
/* @__PURE__ */ t("div", { className: "q1-navigation__group-content", id:
|
|
3491
|
+
/* @__PURE__ */ t("div", { className: "q1-navigation__group-content", id: s, role: "group", hidden: !u, children: o })
|
|
3492
3492
|
] });
|
|
3493
3493
|
}
|
|
3494
3494
|
const mn = {
|
|
@@ -3552,11 +3552,11 @@ function Ar(e, n, r) {
|
|
|
3552
3552
|
if (!e) return null;
|
|
3553
3553
|
const i = Array.from(document.querySelectorAll(
|
|
3554
3554
|
'a[href], area[href], button, input, select, textarea, summary, iframe, [contenteditable="true"], [tabindex]'
|
|
3555
|
-
)).filter((
|
|
3556
|
-
const d =
|
|
3557
|
-
return d - b ||
|
|
3558
|
-
}).map(({ element:
|
|
3559
|
-
return
|
|
3555
|
+
)).filter((s) => Rr(s, n)).map((s, c) => ({ element: s, order: c })).sort((s, c) => {
|
|
3556
|
+
const d = s.element.tabIndex > 0 ? s.element.tabIndex : Number.MAX_SAFE_INTEGER, b = c.element.tabIndex > 0 ? c.element.tabIndex : Number.MAX_SAFE_INTEGER;
|
|
3557
|
+
return d - b || s.order - c.order;
|
|
3558
|
+
}).map(({ element: s }) => s), o = i.indexOf(e);
|
|
3559
|
+
return o < 0 ? null : i[o + r] ?? null;
|
|
3560
3560
|
}
|
|
3561
3561
|
function Lr(e, n) {
|
|
3562
3562
|
return e ? Array.from(
|
|
@@ -3569,8 +3569,8 @@ function zr({
|
|
|
3569
3569
|
primaryGroup: r,
|
|
3570
3570
|
scopeGroup: a,
|
|
3571
3571
|
pendingId: i,
|
|
3572
|
-
errorMessage:
|
|
3573
|
-
footerActions:
|
|
3572
|
+
errorMessage: o,
|
|
3573
|
+
footerActions: s,
|
|
3574
3574
|
onPrimarySelect: c,
|
|
3575
3575
|
onScopeSelect: d,
|
|
3576
3576
|
onFooterAction: b,
|
|
@@ -3599,9 +3599,9 @@ function zr({
|
|
|
3599
3599
|
previousPendingId: T.current,
|
|
3600
3600
|
pendingId: i,
|
|
3601
3601
|
selectedId: a.selectedId,
|
|
3602
|
-
hasError: !!
|
|
3602
|
+
hasError: !!o
|
|
3603
3603
|
}), T.current = i;
|
|
3604
|
-
}, [
|
|
3604
|
+
}, [o, i, a.selectedId, g.attemptedScopeId]), at(() => {
|
|
3605
3605
|
if (!g.restoreFocusId) return;
|
|
3606
3606
|
const q = S.current[g.restoreFocusId];
|
|
3607
3607
|
q ? q.focus() : g.view === "scope" && p.current ? p.current.focus() : k.current?.focus(), R({ type: "restoreFocusHandled" });
|
|
@@ -3652,7 +3652,7 @@ function zr({
|
|
|
3652
3652
|
C(z?.id ?? null);
|
|
3653
3653
|
}
|
|
3654
3654
|
}
|
|
3655
|
-
function
|
|
3655
|
+
function ie(q) {
|
|
3656
3656
|
if (q.nativeEvent.isComposing || q.keyCode === 229) return;
|
|
3657
3657
|
const Q = q.target.matches('input, textarea, select, [contenteditable="true"]'), re = q.key === "/" || q.key.toLowerCase() === "k" && (q.metaKey || q.ctrlKey);
|
|
3658
3658
|
if (W.search && !Q && re && !q.nativeEvent.isComposing && q.keyCode !== 229) {
|
|
@@ -3668,7 +3668,7 @@ function zr({
|
|
|
3668
3668
|
g.view === "primary" && L ? v.current : p.current,
|
|
3669
3669
|
y.current,
|
|
3670
3670
|
J ? S.current[J] : null,
|
|
3671
|
-
...g.view === "primary" ? (
|
|
3671
|
+
...g.view === "primary" ? (s ?? []).map((ze) => Lr(_.current, ze.id)) : []
|
|
3672
3672
|
].filter(
|
|
3673
3673
|
(ze) => ze !== null && !ze.disabled
|
|
3674
3674
|
), Ze = Le.indexOf(q.target);
|
|
@@ -3689,7 +3689,7 @@ function zr({
|
|
|
3689
3689
|
c(q, r);
|
|
3690
3690
|
}
|
|
3691
3691
|
}
|
|
3692
|
-
const le = a.items.find((q) => q.id === a.selectedId), ue = le?.label ?? e,
|
|
3692
|
+
const le = a.items.find((q) => q.id === a.selectedId), ue = le?.label ?? e, be = le?.textValue ?? n, _e = u ?? n, he = /* @__PURE__ */ l(ae, { children: [
|
|
3693
3693
|
le?.avatar ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__avatar", "aria-hidden": "true", children: le.avatar }) : null,
|
|
3694
3694
|
/* @__PURE__ */ l("span", { className: "q1-context-switcher__item-content", children: [
|
|
3695
3695
|
/* @__PURE__ */ t("span", { className: "q1-context-switcher__item-label", children: ue }),
|
|
@@ -3710,9 +3710,9 @@ function zr({
|
|
|
3710
3710
|
"data-side": h.side,
|
|
3711
3711
|
"data-open-modality": w,
|
|
3712
3712
|
style: { left: h.left, top: h.top },
|
|
3713
|
-
onKeyDown:
|
|
3713
|
+
onKeyDown: ie,
|
|
3714
3714
|
children: [
|
|
3715
|
-
/* @__PURE__ */ t("h2", { ref: k, id: D, className: "q1-sr-only", tabIndex: -1, children:
|
|
3715
|
+
/* @__PURE__ */ t("h2", { ref: k, id: D, className: "q1-sr-only", tabIndex: -1, children: _e }),
|
|
3716
3716
|
/* @__PURE__ */ l("div", { className: "q1-context-switcher__groups", children: [
|
|
3717
3717
|
g.view === "primary" && L ? /* @__PURE__ */ l(
|
|
3718
3718
|
"button",
|
|
@@ -3720,12 +3720,12 @@ function zr({
|
|
|
3720
3720
|
ref: v,
|
|
3721
3721
|
type: "button",
|
|
3722
3722
|
className: "q1-context-switcher__item",
|
|
3723
|
-
"aria-label": `${a.textValue} ${
|
|
3723
|
+
"aria-label": `${a.textValue} ${be}`.trim(),
|
|
3724
3724
|
"data-context-scope": !0,
|
|
3725
3725
|
onClick: () => R({ type: "openScope" }),
|
|
3726
3726
|
children: [
|
|
3727
3727
|
he,
|
|
3728
|
-
/* @__PURE__ */ t(
|
|
3728
|
+
/* @__PURE__ */ t(ge, { className: "q1-context-switcher__chevron", size: 16, strokeWidth: 1.8, "aria-hidden": "true" })
|
|
3729
3729
|
]
|
|
3730
3730
|
}
|
|
3731
3731
|
) : g.view === "primary" ? /* @__PURE__ */ t("div", { className: "q1-context-switcher__scope-summary", "data-context-scope-summary": !0, children: he }) : /* @__PURE__ */ l(
|
|
@@ -3790,7 +3790,7 @@ function zr({
|
|
|
3790
3790
|
g.view === "scope" && q.description ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__description", children: q.description }) : null
|
|
3791
3791
|
] }),
|
|
3792
3792
|
z ? /* @__PURE__ */ t(Ce, { className: "q1-context-switcher__pending", size: 16, strokeWidth: 1.8, "aria-hidden": "true" }) : null,
|
|
3793
|
-
!z && W.selectedId === q.id ? /* @__PURE__ */ t(
|
|
3793
|
+
!z && W.selectedId === q.id ? /* @__PURE__ */ t(pe, { className: "q1-context-switcher__check", size: 16, strokeWidth: 1.8, "aria-hidden": "true" }) : null
|
|
3794
3794
|
]
|
|
3795
3795
|
},
|
|
3796
3796
|
q.id
|
|
@@ -3802,9 +3802,9 @@ function zr({
|
|
|
3802
3802
|
] }),
|
|
3803
3803
|
/* @__PURE__ */ t("span", { className: "q1-sr-only", "aria-live": "polite", children: i ? "正在处理所选上下文" : "" }),
|
|
3804
3804
|
/* @__PURE__ */ t("span", { className: "q1-sr-only", "aria-live": "polite", "data-context-result-status": !0, children: H }),
|
|
3805
|
-
|
|
3805
|
+
o ? /* @__PURE__ */ t("div", { ref: N, className: "q1-context-switcher__error", role: "alert", children: o }) : null
|
|
3806
3806
|
] }),
|
|
3807
|
-
g.view === "primary" &&
|
|
3807
|
+
g.view === "primary" && s?.length ? /* @__PURE__ */ t("div", { className: "q1-context-switcher__footer", children: s.map((q) => /* @__PURE__ */ l(
|
|
3808
3808
|
"button",
|
|
3809
3809
|
{
|
|
3810
3810
|
type: "button",
|
|
@@ -3832,8 +3832,8 @@ function Fr({
|
|
|
3832
3832
|
pendingId: r,
|
|
3833
3833
|
footerActions: a,
|
|
3834
3834
|
onSelect: i,
|
|
3835
|
-
onFooterAction:
|
|
3836
|
-
label:
|
|
3835
|
+
onFooterAction: o,
|
|
3836
|
+
label: s,
|
|
3837
3837
|
isOpen: c,
|
|
3838
3838
|
portalRoot: d,
|
|
3839
3839
|
popupRef: b,
|
|
@@ -3894,7 +3894,7 @@ function Fr({
|
|
|
3894
3894
|
role: "menu",
|
|
3895
3895
|
tabIndex: -1,
|
|
3896
3896
|
className: "q1-context-switcher__popup",
|
|
3897
|
-
"aria-label":
|
|
3897
|
+
"aria-label": s ?? e,
|
|
3898
3898
|
dir: _.direction,
|
|
3899
3899
|
"data-align": _.align,
|
|
3900
3900
|
"data-side": _.side,
|
|
@@ -3937,7 +3937,7 @@ function Fr({
|
|
|
3937
3937
|
/* @__PURE__ */ t("span", { className: "q1-context-switcher__item-label", children: M.label }),
|
|
3938
3938
|
M.description ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__description", children: M.description }) : null
|
|
3939
3939
|
] }),
|
|
3940
|
-
D ? /* @__PURE__ */ t(Ce, { className: "q1-context-switcher__pending", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : E.selectedId === M.id ? /* @__PURE__ */ t(
|
|
3940
|
+
D ? /* @__PURE__ */ t(Ce, { className: "q1-context-switcher__pending", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : E.selectedId === M.id ? /* @__PURE__ */ t(pe, { className: "q1-context-switcher__check", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null
|
|
3941
3941
|
]
|
|
3942
3942
|
},
|
|
3943
3943
|
M.id
|
|
@@ -3963,7 +3963,7 @@ function Fr({
|
|
|
3963
3963
|
"aria-disabled": E.disabled || void 0,
|
|
3964
3964
|
disabled: E.disabled,
|
|
3965
3965
|
"data-context-action-id": E.id,
|
|
3966
|
-
onClick: () =>
|
|
3966
|
+
onClick: () => o?.(E),
|
|
3967
3967
|
children: [
|
|
3968
3968
|
E.icon ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__action-icon", "aria-hidden": "true", children: E.icon }) : null,
|
|
3969
3969
|
/* @__PURE__ */ t("span", { className: "q1-context-switcher__item-label", children: E.label })
|
|
@@ -3978,13 +3978,13 @@ function Fr({
|
|
|
3978
3978
|
}
|
|
3979
3979
|
function Wr(e, n) {
|
|
3980
3980
|
const r = new Set(n.map((o) => o.id)), a = /* @__PURE__ */ new Map();
|
|
3981
|
-
let i
|
|
3981
|
+
let i;
|
|
3982
3982
|
for (const o of e) {
|
|
3983
3983
|
if (o.depth !== 1 || o.kind === "action") {
|
|
3984
|
-
i = o.depth !== 1 && o.kind !== "action" ? o.id : void 0
|
|
3984
|
+
i = o.depth !== 1 && o.kind !== "action" ? o.id : void 0;
|
|
3985
3985
|
continue;
|
|
3986
3986
|
}
|
|
3987
|
-
!i || !r.has(i) || !r.has(o.id) ||
|
|
3987
|
+
!i || !r.has(i) || !r.has(o.id) || a.set(o.id, i);
|
|
3988
3988
|
}
|
|
3989
3989
|
return a;
|
|
3990
3990
|
}
|
|
@@ -4001,8 +4001,8 @@ function Or({
|
|
|
4001
4001
|
groups: r,
|
|
4002
4002
|
pendingId: a,
|
|
4003
4003
|
footerActions: i,
|
|
4004
|
-
onSelect:
|
|
4005
|
-
onFooterAction:
|
|
4004
|
+
onSelect: o,
|
|
4005
|
+
onFooterAction: s,
|
|
4006
4006
|
isOpen: c,
|
|
4007
4007
|
openingModality: d,
|
|
4008
4008
|
portalRoot: b,
|
|
@@ -4024,7 +4024,7 @@ function Or({
|
|
|
4024
4024
|
group: $,
|
|
4025
4025
|
query: H,
|
|
4026
4026
|
items: L,
|
|
4027
|
-
|
|
4027
|
+
parents: Wr($.items, L)
|
|
4028
4028
|
};
|
|
4029
4029
|
}), [r, y]), T = oe(() => new Set(k.flatMap(
|
|
4030
4030
|
({ items: $ }) => $.map((H) => H.id)
|
|
@@ -4061,14 +4061,14 @@ function Or({
|
|
|
4061
4061
|
}, [W, M, c, b, u, D]), Dt(() => {
|
|
4062
4062
|
const $ = u.current, H = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
4063
4063
|
if (!c || !b || !$ || d !== "pointer" || H.matches) return;
|
|
4064
|
-
const L = getComputedStyle($), C = (
|
|
4065
|
-
const se = L.getPropertyValue(
|
|
4064
|
+
const L = getComputedStyle($), C = (ie) => {
|
|
4065
|
+
const se = L.getPropertyValue(ie).trim();
|
|
4066
4066
|
return parseFloat(se) * (se.endsWith("ms") ? 1 : 1e3);
|
|
4067
4067
|
}, K = C("--q1-duration-fast"), X = Math.min(C("--q1-duration-press"), K);
|
|
4068
4068
|
if (!Number.isFinite(X) || !Number.isFinite(K) || X <= 0) return;
|
|
4069
4069
|
const U = (K - X) / 2;
|
|
4070
4070
|
return v.current = [...$.querySelectorAll(".q1-context-switcher__item")].map(
|
|
4071
|
-
(
|
|
4071
|
+
(ie, se) => ie.animate([
|
|
4072
4072
|
{ opacity: 0, transform: "translateY(-2px)" },
|
|
4073
4073
|
{ opacity: 1, transform: "translateY(0)" }
|
|
4074
4074
|
], {
|
|
@@ -4121,7 +4121,7 @@ function Or({
|
|
|
4121
4121
|
disabled: $.disabled,
|
|
4122
4122
|
"data-context-header-action-id": H === "header-action" ? $.id : void 0,
|
|
4123
4123
|
"data-context-action-id": H === "footer-action" ? $.id : void 0,
|
|
4124
|
-
onClick: () =>
|
|
4124
|
+
onClick: () => s?.($),
|
|
4125
4125
|
children: [
|
|
4126
4126
|
$.icon ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__action-icon", "aria-hidden": "true", children: $.icon }) : null,
|
|
4127
4127
|
/* @__PURE__ */ t("span", { className: "q1-context-switcher__item-label", children: $.label })
|
|
@@ -4155,7 +4155,7 @@ function Or({
|
|
|
4155
4155
|
] })
|
|
4156
4156
|
] }),
|
|
4157
4157
|
n?.length ? /* @__PURE__ */ t("div", { className: "q1-context-switcher__header-actions", role: "menu", "aria-labelledby": g, children: n.map(($) => J($, "header-action")) }) : null,
|
|
4158
|
-
/* @__PURE__ */ t("div", { className: "q1-context-switcher__groups", children: k.map(({ group: $, items: H, query: L,
|
|
4158
|
+
/* @__PURE__ */ t("div", { className: "q1-context-switcher__groups", children: k.map(({ group: $, items: H, query: L, parents: C }) => {
|
|
4159
4159
|
const K = `${_}-${$.id}-results`, X = (L ? $.search?.noResults : $.emptyState ?? $.search?.noResults) ?? { title: "暂无可用选项" };
|
|
4160
4160
|
return /* @__PURE__ */ l(He, { children: [
|
|
4161
4161
|
$.divider ? /* @__PURE__ */ t("div", { className: "q1-context-switcher__separator", role: "separator" }) : null,
|
|
@@ -4175,8 +4175,8 @@ function Or({
|
|
|
4175
4175
|
value: y[$.id] ?? "",
|
|
4176
4176
|
onChange: (U) => {
|
|
4177
4177
|
p();
|
|
4178
|
-
const
|
|
4179
|
-
S((se) => ({ ...se, [$.id]:
|
|
4178
|
+
const ie = U.currentTarget.value;
|
|
4179
|
+
S((se) => ({ ...se, [$.id]: ie }));
|
|
4180
4180
|
},
|
|
4181
4181
|
onKeyDown: (U) => V(U, $)
|
|
4182
4182
|
}
|
|
@@ -4189,9 +4189,9 @@ function Or({
|
|
|
4189
4189
|
role: H.length ? "menu" : void 0,
|
|
4190
4190
|
"aria-label": H.length ? $.textValue : void 0,
|
|
4191
4191
|
children: H.map((U) => {
|
|
4192
|
-
const
|
|
4192
|
+
const ie = C.get(U.id), se = E.findIndex(
|
|
4193
4193
|
(he) => he.kind === "item" && he.group.id === $.id && he.item.id === U.id
|
|
4194
|
-
), le = U.id === a, ue = !!(U.disabled || le),
|
|
4194
|
+
), le = U.id === a, ue = !!(U.disabled || le), be = (U.kind ?? "context") === "context", _e = be && $.selectedId === U.id;
|
|
4195
4195
|
return /* @__PURE__ */ l(
|
|
4196
4196
|
"button",
|
|
4197
4197
|
{
|
|
@@ -4199,26 +4199,25 @@ function Or({
|
|
|
4199
4199
|
F.current[se] = he;
|
|
4200
4200
|
},
|
|
4201
4201
|
type: "button",
|
|
4202
|
-
role:
|
|
4202
|
+
role: be ? "menuitemradio" : "menuitem",
|
|
4203
4203
|
tabIndex: -1,
|
|
4204
4204
|
className: `q1-context-switcher__item${U.depth === 1 ? " q1-context-switcher__item--nested" : ""}`,
|
|
4205
4205
|
"aria-label": U.textValue,
|
|
4206
|
-
"aria-describedby":
|
|
4207
|
-
"aria-checked":
|
|
4206
|
+
"aria-describedby": ie ? R(ie) : void 0,
|
|
4207
|
+
"aria-checked": be ? _e : void 0,
|
|
4208
4208
|
"aria-disabled": ue || void 0,
|
|
4209
4209
|
"aria-busy": le || void 0,
|
|
4210
4210
|
"data-context-id": U.id,
|
|
4211
4211
|
onClick: () => {
|
|
4212
|
-
ue ||
|
|
4212
|
+
ue || o(U, $);
|
|
4213
4213
|
},
|
|
4214
4214
|
children: [
|
|
4215
|
-
ae ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__branch", "data-position": ae.position, "aria-hidden": "true" }) : null,
|
|
4216
4215
|
U.avatar ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__avatar", "aria-hidden": "true", children: U.avatar }) : null,
|
|
4217
4216
|
/* @__PURE__ */ l("span", { className: "q1-context-switcher__item-content", children: [
|
|
4218
4217
|
/* @__PURE__ */ t("span", { id: R(U.id), className: "q1-context-switcher__item-label", children: U.label }),
|
|
4219
4218
|
U.description ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__description", children: U.description }) : null
|
|
4220
4219
|
] }),
|
|
4221
|
-
le ? /* @__PURE__ */ t(Ce, { className: "q1-context-switcher__pending", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null
|
|
4220
|
+
le ? /* @__PURE__ */ t(Ce, { className: "q1-context-switcher__pending", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : _e ? /* @__PURE__ */ t(pe, { className: "q1-context-switcher__check", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null
|
|
4222
4221
|
]
|
|
4223
4222
|
},
|
|
4224
4223
|
U.id
|
|
@@ -4257,8 +4256,8 @@ function Vr({
|
|
|
4257
4256
|
managePortal: r = !0,
|
|
4258
4257
|
positioningReady: a = !0,
|
|
4259
4258
|
outsidePointer: i = !0,
|
|
4260
|
-
triggerRef:
|
|
4261
|
-
popupRef:
|
|
4259
|
+
triggerRef: o,
|
|
4260
|
+
popupRef: s,
|
|
4262
4261
|
errorRef: c,
|
|
4263
4262
|
positioningKey: d,
|
|
4264
4263
|
onRequestClose: b,
|
|
@@ -4288,11 +4287,11 @@ function Vr({
|
|
|
4288
4287
|
x.current = "trigger";
|
|
4289
4288
|
return;
|
|
4290
4289
|
}
|
|
4291
|
-
!R || n || (e && I.current(), x.current === "trigger" &&
|
|
4290
|
+
!R || n || (e && I.current(), x.current === "trigger" && o.current?.focus());
|
|
4292
4291
|
}, [e, n]), Mt(() => {
|
|
4293
4292
|
if (!n || !a || r && !f) return;
|
|
4294
4293
|
function R() {
|
|
4295
|
-
const k =
|
|
4294
|
+
const k = o.current, T = s.current;
|
|
4296
4295
|
if (!k || !T) return;
|
|
4297
4296
|
const E = k.getBoundingClientRect(), M = c.current?.getBoundingClientRect(), P = T.getBoundingClientRect(), D = window.innerWidth, F = window.innerHeight, W = getComputedStyle(k).direction === "rtl" ? "rtl" : "ltr";
|
|
4298
4297
|
let O = "start";
|
|
@@ -4311,31 +4310,31 @@ function Vr({
|
|
|
4311
4310
|
}));
|
|
4312
4311
|
}
|
|
4313
4312
|
function v(k) {
|
|
4314
|
-
const T = k.target, E =
|
|
4313
|
+
const T = k.target, E = o.current;
|
|
4315
4314
|
T instanceof Element && E && T.contains(E) && S();
|
|
4316
4315
|
}
|
|
4317
4316
|
R();
|
|
4318
4317
|
const p = typeof ResizeObserver > "u" ? null : new ResizeObserver(S);
|
|
4319
|
-
return
|
|
4318
|
+
return s.current && p?.observe(s.current), c.current && p?.observe(c.current), window.addEventListener("resize", S), window.addEventListener("scroll", S, !0), document.addEventListener("animationend", v, !0), () => {
|
|
4320
4319
|
window.removeEventListener("resize", S), window.removeEventListener("scroll", S, !0), document.removeEventListener("animationend", v, !0), p?.disconnect(), y && window.cancelAnimationFrame(y);
|
|
4321
4320
|
};
|
|
4322
4321
|
}, [n, r, f, d, a]), G(() => {
|
|
4323
4322
|
if (!n || !i) return;
|
|
4324
4323
|
function R(y) {
|
|
4325
4324
|
const S = y.target;
|
|
4326
|
-
!
|
|
4325
|
+
!o.current?.contains(S) && !s.current?.contains(S) && (g("preserve"), w.current());
|
|
4327
4326
|
}
|
|
4328
4327
|
return document.addEventListener("pointerdown", R), () => document.removeEventListener("pointerdown", R);
|
|
4329
|
-
}, [n, i]), { triggerRef:
|
|
4328
|
+
}, [n, i]), { triggerRef: o, popupRef: s, portalRoot: f, placement: m, closeWithFocus: g };
|
|
4330
4329
|
}
|
|
4331
4330
|
function jr(e, n, r) {
|
|
4332
4331
|
const a = /* @__PURE__ */ new Set();
|
|
4333
4332
|
for (const i of e)
|
|
4334
|
-
for (const
|
|
4335
|
-
if (a.has(
|
|
4336
|
-
if (
|
|
4337
|
-
throw new Error(`ContextSwitcher item depth must be 0 or 1: ${
|
|
4338
|
-
a.add(
|
|
4333
|
+
for (const o of i.items) {
|
|
4334
|
+
if (a.has(o.id)) throw new Error(`ContextSwitcher duplicate item id: ${o.id}`);
|
|
4335
|
+
if (o.depth !== void 0 && o.depth !== 0 && o.depth !== 1)
|
|
4336
|
+
throw new Error(`ContextSwitcher item depth must be 0 or 1: ${o.id}`);
|
|
4337
|
+
a.add(o.id);
|
|
4339
4338
|
}
|
|
4340
4339
|
if (n?.type === "stacked" && !r)
|
|
4341
4340
|
throw new Error("ContextSwitcher stacked requires header");
|
|
@@ -4343,7 +4342,7 @@ function jr(e, n, r) {
|
|
|
4343
4342
|
if (n.primaryGroupId === n.scopeGroupId)
|
|
4344
4343
|
throw new Error("ContextSwitcher drilldown requires different group ids");
|
|
4345
4344
|
for (const i of [n.primaryGroupId, n.scopeGroupId])
|
|
4346
|
-
if (!e.some((
|
|
4345
|
+
if (!e.some((o) => o.id === i))
|
|
4347
4346
|
throw new Error(`ContextSwitcher drilldown group not found: ${i}`);
|
|
4348
4347
|
}
|
|
4349
4348
|
}
|
|
@@ -4353,9 +4352,9 @@ function Tt(e, n) {
|
|
|
4353
4352
|
for (; a && a !== e; ) {
|
|
4354
4353
|
const i = a.parentElement;
|
|
4355
4354
|
if (!i) return null;
|
|
4356
|
-
const
|
|
4357
|
-
if (
|
|
4358
|
-
r.unshift(
|
|
4355
|
+
const o = Array.from(i.children).indexOf(a);
|
|
4356
|
+
if (o < 0) return null;
|
|
4357
|
+
r.unshift(o), a = i;
|
|
4359
4358
|
}
|
|
4360
4359
|
return a === e ? r : null;
|
|
4361
4360
|
}
|
|
@@ -4365,9 +4364,9 @@ function Ur(e, n) {
|
|
|
4365
4364
|
const Yr = 1e3;
|
|
4366
4365
|
function Gr(e, n, r) {
|
|
4367
4366
|
if (!e || typeof MutationObserver > "u") return null;
|
|
4368
|
-
const a = e.closest(".q1-context-switcher"), i = document.body,
|
|
4369
|
-
if (!a || !
|
|
4370
|
-
const
|
|
4367
|
+
const a = e.closest(".q1-context-switcher"), i = document.body, o = a ? Tt(i, a) : null;
|
|
4368
|
+
if (!a || !o) return null;
|
|
4369
|
+
const s = /* @__PURE__ */ new Set();
|
|
4371
4370
|
let c = null, d = !1;
|
|
4372
4371
|
const b = () => {
|
|
4373
4372
|
d || (d = !0, f.disconnect(), document.removeEventListener("focusin", u, !0), c !== null && window.clearTimeout(c));
|
|
@@ -4378,17 +4377,17 @@ function Gr(e, n, r) {
|
|
|
4378
4377
|
if (!(N instanceof HTMLElement)) return [];
|
|
4379
4378
|
(N.matches(".q1-context-switcher") ? [N] : Array.from(N.querySelectorAll(".q1-context-switcher"))).forEach((h) => {
|
|
4380
4379
|
const w = h.querySelector(".q1-context-switcher__trigger");
|
|
4381
|
-
w &&
|
|
4380
|
+
w && s.add(w);
|
|
4382
4381
|
});
|
|
4383
4382
|
}), e.isConnected) return;
|
|
4384
4383
|
if (document.activeElement !== i) {
|
|
4385
4384
|
b();
|
|
4386
4385
|
return;
|
|
4387
4386
|
}
|
|
4388
|
-
const m = Array.from(
|
|
4387
|
+
const m = Array.from(s).find((N) => {
|
|
4389
4388
|
if (!N.isConnected) return !1;
|
|
4390
4389
|
const x = N.closest(".q1-context-switcher"), h = x ? Tt(i, x) : null;
|
|
4391
|
-
return h !== null && Ur(h,
|
|
4390
|
+
return h !== null && Ur(h, o) && x?.dataset.q1ContextSwitcherFocusHandoffKey === n && x.dataset.q1ContextSwitcherPrimarySelectedId === r;
|
|
4392
4391
|
});
|
|
4393
4392
|
if (m) {
|
|
4394
4393
|
b(), m.focus();
|
|
@@ -4404,8 +4403,8 @@ function Ri({
|
|
|
4404
4403
|
open: r,
|
|
4405
4404
|
defaultOpen: a = !1,
|
|
4406
4405
|
onOpenChange: i,
|
|
4407
|
-
onSelect:
|
|
4408
|
-
pendingId:
|
|
4406
|
+
onSelect: o,
|
|
4407
|
+
pendingId: s,
|
|
4409
4408
|
errorMessage: c,
|
|
4410
4409
|
footerActions: d,
|
|
4411
4410
|
header: b,
|
|
@@ -4476,33 +4475,33 @@ function Ri({
|
|
|
4476
4475
|
function U(q) {
|
|
4477
4476
|
C.closeWithFocus(q ? "trigger" : "preserve"), J(!1), K(), q && C.triggerRef.current?.focus();
|
|
4478
4477
|
}
|
|
4479
|
-
function
|
|
4478
|
+
function ie(q, z) {
|
|
4480
4479
|
y.current = q, S.current = z, C.closeWithFocus("trigger"), p.current = !1, J(!0);
|
|
4481
4480
|
}
|
|
4482
4481
|
function se(q) {
|
|
4483
|
-
q.key === "ArrowDown" || q.key === "Enter" || q.key === " " ? (q.preventDefault(), w ||
|
|
4482
|
+
q.key === "ArrowDown" || q.key === "Enter" || q.key === " " ? (q.preventDefault(), w || ie("selected", "keyboard")) : q.key === "ArrowUp" ? (q.preventDefault(), w || ie(P ? "selected" : "last", "keyboard")) : q.key === "Escape" && w && (q.preventDefault(), U(!0));
|
|
4484
4483
|
}
|
|
4485
4484
|
function le(q, z) {
|
|
4486
|
-
P && z.id === O?.primary?.id && (v.current?.disconnect(), v.current = j ? Gr(C.triggerRef.current, j, q.id) : null), C.closeWithFocus("trigger"),
|
|
4485
|
+
P && z.id === O?.primary?.id && (v.current?.disconnect(), v.current = j ? Gr(C.triggerRef.current, j, q.id) : null), C.closeWithFocus("trigger"), o(q, z), h || U(!0);
|
|
4487
4486
|
}
|
|
4488
4487
|
function ue(q) {
|
|
4489
4488
|
C.closeWithFocus("trigger"), f?.(q), h || U(!0);
|
|
4490
4489
|
}
|
|
4491
|
-
function
|
|
4492
|
-
|
|
4490
|
+
function be(q, z) {
|
|
4491
|
+
o(q, z);
|
|
4493
4492
|
}
|
|
4494
|
-
const
|
|
4493
|
+
const _e = P && O ? /* @__PURE__ */ t(
|
|
4495
4494
|
zr,
|
|
4496
4495
|
{
|
|
4497
4496
|
currentContextLabel: e.label,
|
|
4498
4497
|
currentContextTextValue: e.textValue,
|
|
4499
4498
|
primaryGroup: O.primary,
|
|
4500
4499
|
scopeGroup: O.scope,
|
|
4501
|
-
pendingId:
|
|
4500
|
+
pendingId: s,
|
|
4502
4501
|
errorMessage: c,
|
|
4503
4502
|
footerActions: d,
|
|
4504
4503
|
onPrimarySelect: le,
|
|
4505
|
-
onScopeSelect:
|
|
4504
|
+
onScopeSelect: be,
|
|
4506
4505
|
onFooterAction: ue,
|
|
4507
4506
|
label: _,
|
|
4508
4507
|
isOpen: w,
|
|
@@ -4521,7 +4520,7 @@ function Ri({
|
|
|
4521
4520
|
header: b,
|
|
4522
4521
|
headerActions: u,
|
|
4523
4522
|
groups: n,
|
|
4524
|
-
pendingId:
|
|
4523
|
+
pendingId: s,
|
|
4525
4524
|
footerActions: d,
|
|
4526
4525
|
onSelect: le,
|
|
4527
4526
|
onFooterAction: ue,
|
|
@@ -4542,7 +4541,7 @@ function Ri({
|
|
|
4542
4541
|
{
|
|
4543
4542
|
currentContextTextValue: e.textValue,
|
|
4544
4543
|
groups: n,
|
|
4545
|
-
pendingId:
|
|
4544
|
+
pendingId: s,
|
|
4546
4545
|
footerActions: d,
|
|
4547
4546
|
onSelect: le,
|
|
4548
4547
|
onFooterAction: ue,
|
|
@@ -4559,7 +4558,7 @@ function Ri({
|
|
|
4559
4558
|
onClose: U,
|
|
4560
4559
|
onOverlayKeyDown: L.onKeyDown
|
|
4561
4560
|
}
|
|
4562
|
-
), he = w ? P ? C.portalRoot ? bt(
|
|
4561
|
+
), he = w ? P ? C.portalRoot ? bt(_e, C.portalRoot) : null : L.portal(_e) : null;
|
|
4563
4562
|
return /* @__PURE__ */ l(
|
|
4564
4563
|
"div",
|
|
4565
4564
|
{
|
|
@@ -4577,7 +4576,7 @@ function Ri({
|
|
|
4577
4576
|
"aria-expanded": w,
|
|
4578
4577
|
"aria-controls": E,
|
|
4579
4578
|
"aria-label": W,
|
|
4580
|
-
onClick: (q) => w ? U(!0) :
|
|
4579
|
+
onClick: (q) => w ? U(!0) : ie("selected", q.detail === 0 ? "keyboard" : "pointer"),
|
|
4581
4580
|
onKeyDown: se,
|
|
4582
4581
|
children: [
|
|
4583
4582
|
V.avatar ? /* @__PURE__ */ t("span", { className: `q1-context-switcher__avatar${D ? " q1-context-switcher__avatar--stacked" : ""}`, "aria-hidden": "true", children: V.avatar }) : null,
|
|
@@ -4585,12 +4584,12 @@ function Ri({
|
|
|
4585
4584
|
/* @__PURE__ */ t("span", { className: "q1-context-switcher__current-label", children: V.label }),
|
|
4586
4585
|
!P && V.description ? /* @__PURE__ */ t("span", { className: "q1-context-switcher__description", children: V.description }) : null
|
|
4587
4586
|
] }),
|
|
4588
|
-
/* @__PURE__ */ t(
|
|
4587
|
+
/* @__PURE__ */ t(ye, { className: "q1-context-switcher__chevron", size: 16, strokeWidth: 1.8, "aria-hidden": "true" })
|
|
4589
4588
|
]
|
|
4590
4589
|
}
|
|
4591
4590
|
),
|
|
4592
4591
|
!P && c ? /* @__PURE__ */ t("div", { ref: I, className: "q1-context-switcher__error", role: "alert", children: c }) : null,
|
|
4593
|
-
P ? null : /* @__PURE__ */ t("span", { className: "q1-sr-only", "aria-live": "polite", children:
|
|
4592
|
+
P ? null : /* @__PURE__ */ t("span", { className: "q1-sr-only", "aria-live": "polite", children: s ? "正在处理所选上下文" : "" }),
|
|
4594
4593
|
he
|
|
4595
4594
|
]
|
|
4596
4595
|
}
|
|
@@ -4602,8 +4601,8 @@ function Xr({
|
|
|
4602
4601
|
delay: r = 150,
|
|
4603
4602
|
triggerLabel: a,
|
|
4604
4603
|
children: i,
|
|
4605
|
-
align:
|
|
4606
|
-
tip:
|
|
4604
|
+
align: o = "center",
|
|
4605
|
+
tip: s = !0,
|
|
4607
4606
|
center: c = !1
|
|
4608
4607
|
}) {
|
|
4609
4608
|
const [d, b] = B(!1), [u, f] = B({
|
|
@@ -4618,10 +4617,10 @@ function Xr({
|
|
|
4618
4617
|
let j = n;
|
|
4619
4618
|
n === "top" && M.top - E - D < T && M.bottom + E + D <= W - T ? j = "bottom" : n === "bottom" && M.bottom + E + D > W - T && M.top - E - D >= T ? j = "top" : n === "left" && M.left - E - P < T && M.right + E + P <= F - T ? j = "right" : n === "right" && M.right + E + P > F - T && M.left - E - P >= T && (j = "left");
|
|
4620
4619
|
let V, J;
|
|
4621
|
-
j === "top" || j === "bottom" ? (V =
|
|
4620
|
+
j === "top" || j === "bottom" ? (V = o === "start" ? M.left : o === "end" ? M.right - P : O - P / 2, J = j === "top" ? M.top - E - D : M.bottom + E) : (J = o === "start" ? M.top : o === "end" ? M.bottom - D : Z - D / 2, V = j === "left" ? M.left - E - P : M.right + E), V = Math.max(T, Math.min(V, F - T - P)), J = Math.max(T, Math.min(J, W - T - D));
|
|
4622
4621
|
const $ = j === "top" || j === "bottom" ? Math.max(12, Math.min(P - 12, O - V)) : Math.max(12, Math.min(D - 12, Z - J));
|
|
4623
4622
|
f({ p: j, left: V, top: J, caret: $ });
|
|
4624
|
-
}, [n,
|
|
4623
|
+
}, [n, o]);
|
|
4625
4624
|
fe(() => {
|
|
4626
4625
|
if (d)
|
|
4627
4626
|
return w(), window.addEventListener("scroll", w, !0), window.addEventListener("resize", w), () => {
|
|
@@ -4647,7 +4646,7 @@ function Xr({
|
|
|
4647
4646
|
"q1-tooltip__bubble",
|
|
4648
4647
|
`q1-tooltip__bubble--${u.p}`,
|
|
4649
4648
|
d ? "q1-tooltip__bubble--open" : "",
|
|
4650
|
-
|
|
4649
|
+
s ? "" : "q1-tooltip__bubble--no-tip",
|
|
4651
4650
|
c ? "q1-tooltip__bubble--center" : ""
|
|
4652
4651
|
);
|
|
4653
4652
|
function S(p) {
|
|
@@ -4694,8 +4693,8 @@ function Ai({
|
|
|
4694
4693
|
ellipsis: a,
|
|
4695
4694
|
children: i
|
|
4696
4695
|
}) {
|
|
4697
|
-
const
|
|
4698
|
-
return /* @__PURE__ */ l("dl", { className:
|
|
4696
|
+
const o = Y("description", r === "right" ? "description--right" : "");
|
|
4697
|
+
return /* @__PURE__ */ l("dl", { className: o, children: [
|
|
4699
4698
|
/* @__PURE__ */ l("dt", { className: "description__title", children: [
|
|
4700
4699
|
e,
|
|
4701
4700
|
n ? /* @__PURE__ */ t(Xr, { content: n, placement: "top", children: /* @__PURE__ */ t("button", { type: "button", className: "description__hint", "aria-label": `${e}说明`, children: /* @__PURE__ */ t(Ve, { size: 13, strokeWidth: 2, "aria-hidden": "true" }) }) }) : null
|
|
@@ -4709,13 +4708,13 @@ function Li({
|
|
|
4709
4708
|
rows: r,
|
|
4710
4709
|
action: a,
|
|
4711
4710
|
placement: i = "bottom",
|
|
4712
|
-
align:
|
|
4713
|
-
children:
|
|
4711
|
+
align: o = "start",
|
|
4712
|
+
children: s
|
|
4714
4713
|
}) {
|
|
4715
4714
|
const [c, d] = B(!1), b = Y(
|
|
4716
4715
|
"context-card-wrap",
|
|
4717
4716
|
`context-card-wrap--${i}`,
|
|
4718
|
-
|
|
4717
|
+
o !== "start" ? `context-card-wrap--align-${o}` : "",
|
|
4719
4718
|
c ? "context-card-wrap--dismissed" : ""
|
|
4720
4719
|
);
|
|
4721
4720
|
return /* @__PURE__ */ l(
|
|
@@ -4738,7 +4737,7 @@ function Li({
|
|
|
4738
4737
|
!u.currentTarget.contains(u.relatedTarget) && !u.currentTarget.matches(":hover") && d(!1);
|
|
4739
4738
|
},
|
|
4740
4739
|
children: [
|
|
4741
|
-
|
|
4740
|
+
s,
|
|
4742
4741
|
/* @__PURE__ */ l("span", { className: "context-card", role: "group", "aria-label": `${e} 详情`, children: [
|
|
4743
4742
|
/* @__PURE__ */ t("span", { className: "context-card__name", children: e }),
|
|
4744
4743
|
/* @__PURE__ */ t("span", { className: "context-card__identity", children: n }),
|
|
@@ -4758,8 +4757,8 @@ function zi({
|
|
|
4758
4757
|
color: r,
|
|
4759
4758
|
bandColor: a,
|
|
4760
4759
|
textColor: i,
|
|
4761
|
-
icon:
|
|
4762
|
-
illustration:
|
|
4760
|
+
icon: o,
|
|
4761
|
+
illustration: s,
|
|
4763
4762
|
textured: c,
|
|
4764
4763
|
width: d,
|
|
4765
4764
|
className: b,
|
|
@@ -4772,13 +4771,13 @@ function zi({
|
|
|
4772
4771
|
...a ? { "--book-band": a } : null,
|
|
4773
4772
|
...i ? { "--book-text": i } : null,
|
|
4774
4773
|
...m ? { "--book-width": m } : null
|
|
4775
|
-
}, x =
|
|
4774
|
+
}, x = o ? /* @__PURE__ */ t("span", { className: "book__icon", "aria-hidden": "true", children: o }) : null;
|
|
4776
4775
|
return /* @__PURE__ */ t("div", { className: _, style: N, ...f, children: /* @__PURE__ */ l("div", { className: "book__inner", children: [
|
|
4777
4776
|
/* @__PURE__ */ l("div", { className: "book__cover", children: [
|
|
4778
|
-
|
|
4779
|
-
n === "stripe" && !
|
|
4777
|
+
s ? /* @__PURE__ */ t("span", { className: "book__illustration", "aria-hidden": "true", children: s }) : null,
|
|
4778
|
+
n === "stripe" && !s ? /* @__PURE__ */ t("span", { className: "book__band", "aria-hidden": "true", children: x }) : null,
|
|
4780
4779
|
/* @__PURE__ */ l("span", { className: "book__label", children: [
|
|
4781
|
-
n === "simple" ||
|
|
4780
|
+
n === "simple" || s ? x : null,
|
|
4782
4781
|
/* @__PURE__ */ t("span", { className: "book__title", children: e })
|
|
4783
4782
|
] }),
|
|
4784
4783
|
/* @__PURE__ */ t("span", { className: "book__gutter", "aria-hidden": "true" })
|
|
@@ -4802,11 +4801,11 @@ function Qr({ className: e } = {}) {
|
|
|
4802
4801
|
] });
|
|
4803
4802
|
}
|
|
4804
4803
|
function Jr({ address: e, className: n }) {
|
|
4805
|
-
const r = e.lastIndexOf("/"), a = r > 0 ? e.slice(0, r) : e, i = r > 0 ? e.slice(r) : "", [
|
|
4804
|
+
const r = e.lastIndexOf("/"), a = r > 0 ? e.slice(0, r) : e, i = r > 0 ? e.slice(r) : "", [o, s] = B(!1), c = A(void 0);
|
|
4806
4805
|
G(() => () => clearTimeout(c.current), []);
|
|
4807
4806
|
const d = async () => {
|
|
4808
4807
|
try {
|
|
4809
|
-
await tn(e),
|
|
4808
|
+
await tn(e), s(!0), clearTimeout(c.current), c.current = setTimeout(() => s(!1), 1500);
|
|
4810
4809
|
} catch {
|
|
4811
4810
|
}
|
|
4812
4811
|
};
|
|
@@ -4815,8 +4814,8 @@ function Jr({ address: e, className: n }) {
|
|
|
4815
4814
|
/* @__PURE__ */ t("span", { className: "browser__url-head", children: a }),
|
|
4816
4815
|
i ? /* @__PURE__ */ t("span", { className: "browser__url-tail", children: i }) : null
|
|
4817
4816
|
] }),
|
|
4818
|
-
/* @__PURE__ */ t("button", { type: "button", className: "browser__address-copy", onClick: d, "aria-label": "复制网址", children:
|
|
4819
|
-
/* @__PURE__ */ t("span", { className: "q1-sr-only", role: "status", "aria-live": "polite", children:
|
|
4817
|
+
/* @__PURE__ */ t("button", { type: "button", className: "browser__address-copy", onClick: d, "aria-label": "复制网址", children: o ? /* @__PURE__ */ t(pe, { className: "browser__address-icon", size: 12, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(Re, { className: "browser__address-icon", size: 12, strokeWidth: 2, "aria-hidden": "true" }) }),
|
|
4818
|
+
/* @__PURE__ */ t("span", { className: "q1-sr-only", role: "status", "aria-live": "polite", children: o ? "已复制网址" : "" })
|
|
4820
4819
|
] });
|
|
4821
4820
|
}
|
|
4822
4821
|
function ea({ tabs: e, className: n }) {
|
|
@@ -4825,8 +4824,8 @@ function ea({ tabs: e, className: n }) {
|
|
|
4825
4824
|
/* @__PURE__ */ t("span", { className: `browser__tab${r.isActive ? " browser__tab--active" : ""}`, children: r.label }, `${r.label}-${a}`)
|
|
4826
4825
|
)) });
|
|
4827
4826
|
}
|
|
4828
|
-
function Pi({ address: e, variant: n = "dark", tabs: r, children: a, className: i, ...
|
|
4829
|
-
return /* @__PURE__ */ l("div", { className: Y("browser", `browser--${n}`, i), ...
|
|
4827
|
+
function Pi({ address: e, variant: n = "dark", tabs: r, children: a, className: i, ...o }) {
|
|
4828
|
+
return /* @__PURE__ */ l("div", { className: Y("browser", `browser--${n}`, i), ...o, children: [
|
|
4830
4829
|
/* @__PURE__ */ l("div", { className: "browser__chrome", children: [
|
|
4831
4830
|
r ? /* @__PURE__ */ t(ea, { tabs: r }) : null,
|
|
4832
4831
|
/* @__PURE__ */ l("div", { className: "browser__bar", children: [
|
|
@@ -4851,7 +4850,7 @@ const bn = (e) => e !== void 0 && Number.isFinite(e) && e > 0 ? e : void 0, _n =
|
|
|
4851
4850
|
const n = e.trim();
|
|
4852
4851
|
return n ? new RegExp("\\p{Script=Han}", "u").test(n[0]) ? n[0] : n.split(/\s+/).slice(0, 2).map((r) => r[0]).join("").toUpperCase() : "";
|
|
4853
4852
|
};
|
|
4854
|
-
function na({ title: e, src: n, letter: r, glyph: a, placeholder: i = !1, icon:
|
|
4853
|
+
function na({ title: e, src: n, letter: r, glyph: a, placeholder: i = !1, icon: o, iconColor: s, size: c, className: d }) {
|
|
4855
4854
|
const [b, u] = B(null), f = bn(c), _ = !!n && b !== n, m = e.trim() || "头像", N = r ? { variant: "avatar--letter", node: r } : a ? { variant: "avatar--glyph", node: a } : { variant: "avatar--letter", node: ta(e) }, x = i ? "avatar--placeholder" : _ ? "avatar--image" : N.variant, h = i ? { "aria-hidden": !0 } : _ ? {} : { role: "img", "aria-label": m };
|
|
4856
4855
|
return /* @__PURE__ */ l("span", { className: Y("avatar", x, d), style: _n(f), ...h, children: [
|
|
4857
4856
|
_ ? /* @__PURE__ */ t(
|
|
@@ -4865,13 +4864,13 @@ function na({ title: e, src: n, letter: r, glyph: a, placeholder: i = !1, icon:
|
|
|
4865
4864
|
onError: () => u(n ?? null)
|
|
4866
4865
|
}
|
|
4867
4866
|
) : i ? null : /* @__PURE__ */ t("span", { className: "avatar__glyph", "aria-hidden": "true", children: N.node }),
|
|
4868
|
-
|
|
4867
|
+
o ? /* @__PURE__ */ t(
|
|
4869
4868
|
"span",
|
|
4870
4869
|
{
|
|
4871
4870
|
className: "avatar__badge",
|
|
4872
4871
|
"aria-hidden": "true",
|
|
4873
|
-
style:
|
|
4874
|
-
children:
|
|
4872
|
+
style: s ? { "--q1-avatar-badge-bg": s } : void 0,
|
|
4873
|
+
children: o
|
|
4875
4874
|
}
|
|
4876
4875
|
) : null
|
|
4877
4876
|
] });
|
|
@@ -4882,11 +4881,11 @@ function Wi({
|
|
|
4882
4881
|
size: r,
|
|
4883
4882
|
limit: a,
|
|
4884
4883
|
overlap: i = "auto",
|
|
4885
|
-
reverse:
|
|
4886
|
-
className:
|
|
4884
|
+
reverse: o = !1,
|
|
4885
|
+
className: s
|
|
4887
4886
|
}) {
|
|
4888
|
-
const c = bn(r), d = c ?? 32, b = a !== void 0 && Number.isFinite(a) && a >= 0 ? Math.floor(a) : void 0, u = b !== void 0 && e.length > b ? e.slice(0, b) : e, f = e.length - u.length, _ = u.length + (f > 0 ? 1 : 0), m = i !== "auto" && Number.isFinite(i) ? Math.max(0, i) : Math.round(d * 0.3), N = { ..._n(c), "--q1-avatar-overlap": `${m}px` }, x = (w) =>
|
|
4889
|
-
return /* @__PURE__ */ l("span", { className: Y("avatar-group",
|
|
4887
|
+
const c = bn(r), d = c ?? 32, b = a !== void 0 && Number.isFinite(a) && a >= 0 ? Math.floor(a) : void 0, u = b !== void 0 && e.length > b ? e.slice(0, b) : e, f = e.length - u.length, _ = u.length + (f > 0 ? 1 : 0), m = i !== "auto" && Number.isFinite(i) ? Math.max(0, i) : Math.round(d * 0.3), N = { ..._n(c), "--q1-avatar-overlap": `${m}px` }, x = (w) => o ? void 0 : _ - 1 - w, h = n ? { role: "group", "aria-label": n } : {};
|
|
4888
|
+
return /* @__PURE__ */ l("span", { className: Y("avatar-group", s), style: N, ...h, children: [
|
|
4890
4889
|
u.map((w, I) => (
|
|
4891
4890
|
// 成员不再 aria-hidden——每个 Avatar 自带 aria-label(名字),读屏逐个念。
|
|
4892
4891
|
/* @__PURE__ */ t("span", { className: "avatar-group__item", style: { zIndex: x(I) }, children: /* @__PURE__ */ t(na, { ...w, size: c }) }, `${w.title}-${I}`)
|
|
@@ -4916,15 +4915,15 @@ function Ki({
|
|
|
4916
4915
|
className: a,
|
|
4917
4916
|
children: i
|
|
4918
4917
|
}) {
|
|
4919
|
-
if (i && r) return /* @__PURE__ */ t(
|
|
4920
|
-
const
|
|
4918
|
+
if (i && r) return /* @__PURE__ */ t(ae, { children: i });
|
|
4919
|
+
const o = Y(
|
|
4921
4920
|
"skeleton",
|
|
4922
4921
|
`skeleton--${e}`,
|
|
4923
4922
|
n ? "" : "skeleton--static",
|
|
4924
4923
|
i ? "skeleton--wrap" : "",
|
|
4925
4924
|
a ?? ""
|
|
4926
4925
|
);
|
|
4927
|
-
return i ? /* @__PURE__ */ t("span", { className:
|
|
4926
|
+
return i ? /* @__PURE__ */ t("span", { className: o, "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: "skeleton__content", children: i }) }) : /* @__PURE__ */ t("span", { className: o, "aria-hidden": "true" });
|
|
4928
4927
|
}
|
|
4929
4928
|
const ra = { sm: 2, md: 3, lg: 4 };
|
|
4930
4929
|
function Oi({ label: e, size: n = "md" }) {
|
|
@@ -4939,12 +4938,12 @@ function Oi({ label: e, size: n = "md" }) {
|
|
|
4939
4938
|
] });
|
|
4940
4939
|
}
|
|
4941
4940
|
function Bi({ text: e, tailLength: n = 8, mono: r = !1 }) {
|
|
4942
|
-
const a = Math.max(0, e.length - n), i = e.slice(0, a),
|
|
4941
|
+
const a = Math.max(0, e.length - n), i = e.slice(0, a), o = e.slice(a);
|
|
4943
4942
|
return /* @__PURE__ */ l("span", { className: `middle-truncate${r ? " middle-truncate--mono" : ""}`, title: e, "aria-label": e, children: [
|
|
4944
4943
|
/* @__PURE__ */ t("span", { className: "q1-sr-only", children: e }),
|
|
4945
4944
|
/* @__PURE__ */ l("span", { className: "middle-truncate__visual", "aria-hidden": "true", children: [
|
|
4946
4945
|
/* @__PURE__ */ t("span", { className: "middle-truncate__head", children: i }),
|
|
4947
|
-
/* @__PURE__ */ t("span", { className: "middle-truncate__tail", children:
|
|
4946
|
+
/* @__PURE__ */ t("span", { className: "middle-truncate__tail", children: o })
|
|
4948
4947
|
] })
|
|
4949
4948
|
] });
|
|
4950
4949
|
}
|
|
@@ -5005,7 +5004,7 @@ function ji({
|
|
|
5005
5004
|
successMessage: r,
|
|
5006
5005
|
size: a = "default"
|
|
5007
5006
|
}) {
|
|
5008
|
-
const { copied: i, copy:
|
|
5007
|
+
const { copied: i, copy: o } = Ue(), s = n ?? e;
|
|
5009
5008
|
return /* @__PURE__ */ l("span", { className: `twc twc--${a}`, children: [
|
|
5010
5009
|
/* @__PURE__ */ t("span", { className: "twc__text", children: e }),
|
|
5011
5010
|
/* @__PURE__ */ t(
|
|
@@ -5014,8 +5013,8 @@ function ji({
|
|
|
5014
5013
|
type: "button",
|
|
5015
5014
|
className: "twc__copy",
|
|
5016
5015
|
"aria-label": `复制${e}`,
|
|
5017
|
-
onClick: () => s
|
|
5018
|
-
children: i ? /* @__PURE__ */ t(
|
|
5016
|
+
onClick: () => o(s, r),
|
|
5017
|
+
children: i ? /* @__PURE__ */ t(pe, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(Re, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
5019
5018
|
}
|
|
5020
5019
|
)
|
|
5021
5020
|
] });
|
|
@@ -5026,9 +5025,9 @@ function Ui({
|
|
|
5026
5025
|
inverted: r = !1,
|
|
5027
5026
|
tone: a,
|
|
5028
5027
|
copyText: i,
|
|
5029
|
-
onCopy:
|
|
5028
|
+
onCopy: o
|
|
5030
5029
|
}) {
|
|
5031
|
-
const { copied:
|
|
5030
|
+
const { copied: s, copy: c } = Ue(), d = Array.isArray(e) ? e : [e], b = Y("snippet", r ? "snippet--inverted" : "", a ? `snippet--${a}` : "");
|
|
5032
5031
|
return /* @__PURE__ */ l("div", { className: b, children: [
|
|
5033
5032
|
/* @__PURE__ */ t("code", { className: "snippet__code", children: d.map((u, f) => /* @__PURE__ */ l("span", { className: "snippet__line", children: [
|
|
5034
5033
|
n ? /* @__PURE__ */ l("span", { className: "snippet__prompt", "aria-hidden": "true", children: [
|
|
@@ -5045,9 +5044,9 @@ function Ui({
|
|
|
5045
5044
|
"aria-label": "复制命令",
|
|
5046
5045
|
onClick: () => {
|
|
5047
5046
|
c(i ?? d.join(`
|
|
5048
|
-
`), "已复制命令"),
|
|
5047
|
+
`), "已复制命令"), o?.();
|
|
5049
5048
|
},
|
|
5050
|
-
children:
|
|
5049
|
+
children: s ? /* @__PURE__ */ t(pe, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(Re, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
5051
5050
|
}
|
|
5052
5051
|
)
|
|
5053
5052
|
] });
|
|
@@ -5065,8 +5064,8 @@ function la(e, n, r) {
|
|
|
5065
5064
|
const a = Math.min(sa, e, 100 - e);
|
|
5066
5065
|
if (a <= 0) return 0;
|
|
5067
5066
|
if (!(100 - e - a <= 0)) return a;
|
|
5068
|
-
const
|
|
5069
|
-
return a <
|
|
5067
|
+
const o = n / r * 100;
|
|
5068
|
+
return a < o ? 0 : a;
|
|
5070
5069
|
}
|
|
5071
5070
|
function ca(e, n, r) {
|
|
5072
5071
|
return r || (n === "health" ? e >= Rt.success ? "success" : e >= Rt.warning ? "warning" : "danger" : ia(e));
|
|
@@ -5077,19 +5076,19 @@ function Yi({
|
|
|
5077
5076
|
showValue: r = !1,
|
|
5078
5077
|
tone: a,
|
|
5079
5078
|
toneDirection: i = "quota",
|
|
5080
|
-
label:
|
|
5081
|
-
indeterminate:
|
|
5079
|
+
label: o,
|
|
5080
|
+
indeterminate: s = !1
|
|
5082
5081
|
}) {
|
|
5083
|
-
const { boxPx: c, radius: d, strokeWidth: b, valueFontSize: u } = oa[n], f = 2 * Math.PI * d, _ = Math.min(100, Math.max(0, e ?? 0)), m = 50, N =
|
|
5082
|
+
const { boxPx: c, radius: d, strokeWidth: b, valueFontSize: u } = oa[n], f = 2 * Math.PI * d, _ = Math.min(100, Math.max(0, e ?? 0)), m = 50, N = s ? 25 : _, x = s ? 0 : la(_, b, f), h = s ? 0 : Math.max(0, 100 - _ - x), w = -90 + (N + x / 2) / 100 * 360, I = s ? "primary" : ca(_, i, a);
|
|
5084
5083
|
return /* @__PURE__ */ l(
|
|
5085
5084
|
"span",
|
|
5086
5085
|
{
|
|
5087
|
-
className: `gauge gauge--${n}${
|
|
5086
|
+
className: `gauge gauge--${n}${s ? " gauge--indeterminate" : ""}`,
|
|
5088
5087
|
role: "progressbar",
|
|
5089
|
-
"aria-label":
|
|
5090
|
-
"aria-valuemin":
|
|
5091
|
-
"aria-valuemax":
|
|
5092
|
-
"aria-valuenow":
|
|
5088
|
+
"aria-label": o,
|
|
5089
|
+
"aria-valuemin": s ? void 0 : 0,
|
|
5090
|
+
"aria-valuemax": s ? void 0 : 100,
|
|
5091
|
+
"aria-valuenow": s ? void 0 : _,
|
|
5093
5092
|
children: [
|
|
5094
5093
|
/* @__PURE__ */ l("svg", { className: "gauge__svg", width: c, height: c, viewBox: "0 0 100 100", "aria-hidden": "true", children: [
|
|
5095
5094
|
/* @__PURE__ */ t(
|
|
@@ -5132,18 +5131,18 @@ function Gi({
|
|
|
5132
5131
|
tone: r = "neutral",
|
|
5133
5132
|
slim: a = !1,
|
|
5134
5133
|
stops: i,
|
|
5135
|
-
label:
|
|
5134
|
+
label: o
|
|
5136
5135
|
}) {
|
|
5137
|
-
const
|
|
5136
|
+
const s = n > 0 && Number.isFinite(e) ? Math.min(n, Math.max(0, e)) : 0, c = n > 0 ? s / n * 100 : 0;
|
|
5138
5137
|
return /* @__PURE__ */ l(
|
|
5139
5138
|
"div",
|
|
5140
5139
|
{
|
|
5141
5140
|
className: `progress${a ? " progress--slim" : ""}`,
|
|
5142
5141
|
role: "progressbar",
|
|
5143
|
-
"aria-label":
|
|
5142
|
+
"aria-label": o,
|
|
5144
5143
|
"aria-valuemin": 0,
|
|
5145
5144
|
"aria-valuemax": n,
|
|
5146
|
-
"aria-valuenow":
|
|
5145
|
+
"aria-valuenow": s,
|
|
5147
5146
|
children: [
|
|
5148
5147
|
/* @__PURE__ */ t("div", { className: "progress__track", children: /* @__PURE__ */ t("div", { className: `progress__fill progress__fill--${r}`, style: { width: `${c}%` } }) }),
|
|
5149
5148
|
i?.map((d) => {
|
|
@@ -5174,8 +5173,8 @@ function Xi({
|
|
|
5174
5173
|
filled: r = !1,
|
|
5175
5174
|
disabled: a = !1,
|
|
5176
5175
|
label: i,
|
|
5177
|
-
action:
|
|
5178
|
-
children:
|
|
5176
|
+
action: o,
|
|
5177
|
+
children: s
|
|
5179
5178
|
}) {
|
|
5180
5179
|
const c = da[e], d = Y(
|
|
5181
5180
|
"note",
|
|
@@ -5188,9 +5187,9 @@ function Xi({
|
|
|
5188
5187
|
/* @__PURE__ */ t(c, { className: "note__icon", size: 16, strokeWidth: 2, "aria-hidden": "true" }),
|
|
5189
5188
|
/* @__PURE__ */ l("p", { className: "note__body", children: [
|
|
5190
5189
|
i ? /* @__PURE__ */ t("span", { className: "note__label", children: i }) : null,
|
|
5191
|
-
/* @__PURE__ */ t("span", { className: "note__text", children:
|
|
5190
|
+
/* @__PURE__ */ t("span", { className: "note__text", children: s })
|
|
5192
5191
|
] }),
|
|
5193
|
-
|
|
5192
|
+
o ? /* @__PURE__ */ t("button", { type: "button", className: "note__action", disabled: a, children: o }) : null
|
|
5194
5193
|
] });
|
|
5195
5194
|
}
|
|
5196
5195
|
function Zi({ previous: e, next: n }) {
|
|
@@ -5220,7 +5219,7 @@ function Zi({ previous: e, next: n }) {
|
|
|
5220
5219
|
/* @__PURE__ */ t("span", { className: "docs-pagination__label", children: "下一页" }),
|
|
5221
5220
|
/* @__PURE__ */ l("span", { className: "docs-pagination__title-frame", children: [
|
|
5222
5221
|
/* @__PURE__ */ t("span", { className: "docs-pagination__title", children: n.title }),
|
|
5223
|
-
/* @__PURE__ */ t("span", { className: "docs-pagination__chevron-slot", "aria-hidden": "true", children: /* @__PURE__ */ t(
|
|
5222
|
+
/* @__PURE__ */ t("span", { className: "docs-pagination__chevron-slot", "aria-hidden": "true", children: /* @__PURE__ */ t(ge, { className: "docs-pagination__chevron", size: 20, strokeWidth: 2 }) })
|
|
5224
5223
|
] })
|
|
5225
5224
|
]
|
|
5226
5225
|
}
|
|
@@ -5235,17 +5234,17 @@ function ha({
|
|
|
5235
5234
|
}) {
|
|
5236
5235
|
const a = Y("spinner", `spinner--${e}`, n !== "default" ? `spinner--${n}` : ""), i = ua[e];
|
|
5237
5236
|
return /* @__PURE__ */ l("span", { className: a, role: "status", children: [
|
|
5238
|
-
Array.from({ length: i }, (
|
|
5237
|
+
Array.from({ length: i }, (o, s) => /* @__PURE__ */ t(
|
|
5239
5238
|
"span",
|
|
5240
5239
|
{
|
|
5241
5240
|
className: "spinner__bar",
|
|
5242
5241
|
"aria-hidden": "true",
|
|
5243
5242
|
style: {
|
|
5244
|
-
transform: `rotate(${360 / i *
|
|
5245
|
-
animationDelay: `${(-(i - 1 -
|
|
5243
|
+
transform: `rotate(${360 / i * s}deg)`,
|
|
5244
|
+
animationDelay: `${(-(i - 1 - s) * 1.2 / i).toFixed(3)}s`
|
|
5246
5245
|
}
|
|
5247
5246
|
},
|
|
5248
|
-
|
|
5247
|
+
s
|
|
5249
5248
|
)),
|
|
5250
5249
|
/* @__PURE__ */ t("span", { className: "q1-sr-only", children: r })
|
|
5251
5250
|
] });
|
|
@@ -5272,11 +5271,11 @@ function pa(e, n, r) {
|
|
|
5272
5271
|
const a = Math.min(Math.max(1, e), n), i = r ? 0 : 1;
|
|
5273
5272
|
if (n <= (r ? 5 : 7))
|
|
5274
5273
|
return Array.from({ length: n }, (c, d) => d + 1);
|
|
5275
|
-
const
|
|
5276
|
-
a - i > 2 &&
|
|
5274
|
+
const s = [1];
|
|
5275
|
+
a - i > 2 && s.push("…");
|
|
5277
5276
|
for (let c = Math.max(2, a - i); c <= Math.min(n - 1, a + i); c += 1)
|
|
5278
|
-
|
|
5279
|
-
return a + i < n - 1 &&
|
|
5277
|
+
s.push(c);
|
|
5278
|
+
return a + i < n - 1 && s.push("…"), s.push(n), s;
|
|
5280
5279
|
}
|
|
5281
5280
|
function ba(e, n, r) {
|
|
5282
5281
|
if (!Number.isFinite(r) || r <= 0) return { start: 0, end: 0 };
|
|
@@ -5289,8 +5288,8 @@ function Qi({
|
|
|
5289
5288
|
total: r,
|
|
5290
5289
|
totalPages: a,
|
|
5291
5290
|
hasNextPage: i,
|
|
5292
|
-
onChange:
|
|
5293
|
-
loading:
|
|
5291
|
+
onChange: o,
|
|
5292
|
+
loading: s = !1,
|
|
5294
5293
|
showPageNumbers: c = !0,
|
|
5295
5294
|
summary: d,
|
|
5296
5295
|
pageSizeSlot: b,
|
|
@@ -5299,14 +5298,14 @@ function Qi({
|
|
|
5299
5298
|
compact: _ = !1,
|
|
5300
5299
|
className: m = ""
|
|
5301
5300
|
}) {
|
|
5302
|
-
const [N, x] = B(""), h = A(
|
|
5301
|
+
const [N, x] = B(""), h = A(s), w = fa(n), I = Number.isFinite(r) && Number(r) >= 0, g = ma({
|
|
5303
5302
|
totalPages: a,
|
|
5304
5303
|
total: r,
|
|
5305
5304
|
pageSize: w
|
|
5306
5305
|
}), R = g ? Math.min(At(e), g) : At(e), y = I && Number(r) <= 0, S = I ? ba(R, w, Number(r)) : null, v = !I && a === void 0, p = !y && R > 1, k = !y && (v ? i === !0 : g !== void 0 && R < g), T = c && !v && g ? pa(R, g, _) : [], E = ["pagination", _ ? "pagination--compact" : "", m].filter(Boolean).join(" ");
|
|
5307
5306
|
return G(() => {
|
|
5308
|
-
h.current && !
|
|
5309
|
-
}, [
|
|
5307
|
+
h.current && !s ? x("分页已更新") : s && x(""), h.current = s;
|
|
5308
|
+
}, [s]), /* @__PURE__ */ l("nav", { className: E, "aria-label": "分页导航", "aria-busy": s ? "true" : void 0, children: [
|
|
5310
5309
|
/* @__PURE__ */ t("span", { className: "pagination__summary", "aria-live": "polite", "aria-atomic": "true", children: typeof d == "function" ? d({
|
|
5311
5310
|
page: R,
|
|
5312
5311
|
totalPages: g,
|
|
@@ -5317,7 +5316,7 @@ function Qi({
|
|
|
5317
5316
|
}) : d ?? (y ? "暂无数据" : I && S ? `${S.start}–${S.end} / 共 ${Number(r)} 条` : g !== void 0 ? `第 ${R} 页 / 共 ${g} 页` : `第 ${R} 页`) }),
|
|
5318
5317
|
/* @__PURE__ */ t("span", { className: "pagination__completion q1-sr-only", "aria-live": "polite", "aria-atomic": "true", children: N }),
|
|
5319
5318
|
/* @__PURE__ */ l("div", { className: "pagination__controls", children: [
|
|
5320
|
-
|
|
5319
|
+
s ? /* @__PURE__ */ t(ha, { size: "sm" }) : null,
|
|
5321
5320
|
b ? /* @__PURE__ */ t("div", { className: "pagination__page-size", children: b }) : null,
|
|
5322
5321
|
/* @__PURE__ */ t(
|
|
5323
5322
|
"button",
|
|
@@ -5325,9 +5324,9 @@ function Qi({
|
|
|
5325
5324
|
type: "button",
|
|
5326
5325
|
className: "pagination__button pagination__button--nav",
|
|
5327
5326
|
disabled: !p,
|
|
5328
|
-
"aria-disabled":
|
|
5327
|
+
"aria-disabled": s && p ? "true" : void 0,
|
|
5329
5328
|
"aria-label": u,
|
|
5330
|
-
onClick: () => p && !
|
|
5329
|
+
onClick: () => p && !s && o(R - 1),
|
|
5331
5330
|
children: /* @__PURE__ */ t(Te, { "aria-hidden": "true", focusable: "false", size: 16, strokeWidth: 2 })
|
|
5332
5331
|
}
|
|
5333
5332
|
),
|
|
@@ -5341,9 +5340,9 @@ function Qi({
|
|
|
5341
5340
|
P === R ? "pagination__button--current" : ""
|
|
5342
5341
|
].filter(Boolean).join(" "),
|
|
5343
5342
|
"aria-current": P === R ? "page" : void 0,
|
|
5344
|
-
"aria-disabled":
|
|
5343
|
+
"aria-disabled": s ? "true" : void 0,
|
|
5345
5344
|
disabled: y,
|
|
5346
|
-
onClick: () => P !== R && !
|
|
5345
|
+
onClick: () => P !== R && !s && o(P),
|
|
5347
5346
|
children: P
|
|
5348
5347
|
},
|
|
5349
5348
|
P
|
|
@@ -5355,10 +5354,10 @@ function Qi({
|
|
|
5355
5354
|
type: "button",
|
|
5356
5355
|
className: "pagination__button pagination__button--nav",
|
|
5357
5356
|
disabled: !k,
|
|
5358
|
-
"aria-disabled":
|
|
5357
|
+
"aria-disabled": s && k ? "true" : void 0,
|
|
5359
5358
|
"aria-label": f,
|
|
5360
|
-
onClick: () => k && !
|
|
5361
|
-
children: /* @__PURE__ */ t(
|
|
5359
|
+
onClick: () => k && !s && o(R + 1),
|
|
5360
|
+
children: /* @__PURE__ */ t(ge, { "aria-hidden": "true", focusable: "false", size: 16, strokeWidth: 2 })
|
|
5362
5361
|
}
|
|
5363
5362
|
)
|
|
5364
5363
|
] })
|
|
@@ -5401,8 +5400,8 @@ function Ji({
|
|
|
5401
5400
|
rowKey: r,
|
|
5402
5401
|
caption: a,
|
|
5403
5402
|
density: i = "comfortable",
|
|
5404
|
-
stickyHeader:
|
|
5405
|
-
maxBodyHeight:
|
|
5403
|
+
stickyHeader: o = !1,
|
|
5404
|
+
maxBodyHeight: s,
|
|
5406
5405
|
minWidth: c,
|
|
5407
5406
|
colGroup: d,
|
|
5408
5407
|
renderRow: b,
|
|
@@ -5427,12 +5426,12 @@ function Ji({
|
|
|
5427
5426
|
})), v = new Set(N?.selectedKeys ?? []), p = N ? S.filter((C) => !C.disabled) : [], k = p.filter((C) => v.has(C.key)), T = p.length > 0 && k.length === p.length, E = k.length > 0 && !T, M = Y(
|
|
5428
5427
|
"table",
|
|
5429
5428
|
i === "compact" && "table--compact",
|
|
5430
|
-
|
|
5429
|
+
o && "table--sticky-header",
|
|
5431
5430
|
g
|
|
5432
5431
|
), P = c === void 0 ? R : { ...R, minWidth: c }, D = Y(
|
|
5433
5432
|
"table__scroll",
|
|
5434
|
-
(
|
|
5435
|
-
), F =
|
|
5433
|
+
(o || s !== void 0) && "table__scroll--vertical"
|
|
5434
|
+
), F = s === void 0 ? void 0 : { maxHeight: s }, W = o || s !== void 0 || c !== void 0;
|
|
5436
5435
|
function O(C) {
|
|
5437
5436
|
if (!N) return;
|
|
5438
5437
|
const K = new Set(N.selectedKeys);
|
|
@@ -5476,12 +5475,12 @@ function Ji({
|
|
|
5476
5475
|
}
|
|
5477
5476
|
) }) }) : null,
|
|
5478
5477
|
n.map((C) => {
|
|
5479
|
-
const K = $(C), X = C.sortable && f === C.key && _ ? _ === "asc" ? "升序" : "降序" : null, U = X ? /* @__PURE__ */ t("span", { className: "table__sort-state", children: X }) : null,
|
|
5478
|
+
const K = $(C), X = C.sortable && f === C.key && _ ? _ === "asc" ? "升序" : "降序" : null, U = X ? /* @__PURE__ */ t("span", { className: "table__sort-state", children: X }) : null, ie = C.sortLabel ?? (typeof C.header == "string" ? C.header : C.key), se = C.sortable ? /* @__PURE__ */ l(
|
|
5480
5479
|
"button",
|
|
5481
5480
|
{
|
|
5482
5481
|
type: "button",
|
|
5483
5482
|
className: "table__sort",
|
|
5484
|
-
"aria-label": `按${
|
|
5483
|
+
"aria-label": `按${ie}排序${X ? `,当前${X}` : ""}`,
|
|
5485
5484
|
disabled: !m,
|
|
5486
5485
|
onClick: m ? () => J(C.key) : void 0,
|
|
5487
5486
|
children: [
|
|
@@ -5489,7 +5488,7 @@ function Ji({
|
|
|
5489
5488
|
U
|
|
5490
5489
|
]
|
|
5491
5490
|
}
|
|
5492
|
-
) : /* @__PURE__ */ l(
|
|
5491
|
+
) : /* @__PURE__ */ l(ae, { children: [
|
|
5493
5492
|
C.header,
|
|
5494
5493
|
U
|
|
5495
5494
|
] });
|
|
@@ -5503,7 +5502,7 @@ function Ji({
|
|
|
5503
5502
|
"aria-label": I ? I.getRowLabel(C.row, C.rowIndex) : void 0,
|
|
5504
5503
|
onClick: I ? (U) => j(C, U) : void 0,
|
|
5505
5504
|
onKeyDown: I ? (U) => V(C, U) : void 0
|
|
5506
|
-
}, X = /* @__PURE__ */ l(
|
|
5505
|
+
}, X = /* @__PURE__ */ l(ae, { children: [
|
|
5507
5506
|
N ? /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("label", { className: "table__checkbox-control", children: /* @__PURE__ */ t(
|
|
5508
5507
|
"input",
|
|
5509
5508
|
{
|
|
@@ -5527,7 +5526,7 @@ function Ji({
|
|
|
5527
5526
|
}) }, zt(C.key)) : /* @__PURE__ */ t("tr", { ...K, children: X }, zt(C.key));
|
|
5528
5527
|
}) })
|
|
5529
5528
|
] }), L = W ? /* @__PURE__ */ t("div", { className: D, style: F, tabIndex: 0, children: H }) : H;
|
|
5530
|
-
return /* @__PURE__ */ l(
|
|
5529
|
+
return /* @__PURE__ */ l(ae, { children: [
|
|
5531
5530
|
h && N && N.selectedKeys.length > 0 ? /* @__PURE__ */ t("div", { className: "table__bulk-actions", role: "toolbar", "aria-label": w, children: h }) : null,
|
|
5532
5531
|
L
|
|
5533
5532
|
] });
|
|
@@ -5538,20 +5537,20 @@ function eo({
|
|
|
5538
5537
|
noBorder: r,
|
|
5539
5538
|
initialExpanded: a = !1
|
|
5540
5539
|
}) {
|
|
5541
|
-
const [i,
|
|
5540
|
+
const [i, o] = B(a), s = te(), c = i ? e : e.slice(0, n), d = e.length - n;
|
|
5542
5541
|
return /* @__PURE__ */ l("div", { className: "show-more", children: [
|
|
5543
|
-
/* @__PURE__ */ t("ul", { className: "show-more__list", id:
|
|
5542
|
+
/* @__PURE__ */ t("ul", { className: "show-more__list", id: s, children: c.map((b) => /* @__PURE__ */ t("li", { className: "show-more__row", children: b }, b)) }),
|
|
5544
5543
|
d > 0 ? /* @__PURE__ */ t("div", { className: `show-more__trigger-row${r ? " show-more__trigger-row--no-border" : ""}`, children: /* @__PURE__ */ l(
|
|
5545
5544
|
"button",
|
|
5546
5545
|
{
|
|
5547
5546
|
type: "button",
|
|
5548
5547
|
className: "show-more__trigger",
|
|
5549
5548
|
"aria-expanded": i,
|
|
5550
|
-
"aria-controls":
|
|
5551
|
-
onClick: () =>
|
|
5549
|
+
"aria-controls": s,
|
|
5550
|
+
onClick: () => o((b) => !b),
|
|
5552
5551
|
children: [
|
|
5553
5552
|
i ? "收起" : `显示更多 ${d} 项`,
|
|
5554
|
-
i ? /* @__PURE__ */ t(Vt, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(
|
|
5553
|
+
i ? /* @__PURE__ */ t(Vt, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(ye, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
|
|
5555
5554
|
]
|
|
5556
5555
|
}
|
|
5557
5556
|
) }) : null
|
|
@@ -5596,17 +5595,17 @@ function no({
|
|
|
5596
5595
|
local: a,
|
|
5597
5596
|
utc: i
|
|
5598
5597
|
}) {
|
|
5599
|
-
const
|
|
5598
|
+
const o = ya(r);
|
|
5600
5599
|
return /* @__PURE__ */ l("span", { className: "rtc-wrap", children: [
|
|
5601
5600
|
/* @__PURE__ */ t("time", { className: "rtc-trigger", dateTime: r, tabIndex: 0, children: e }),
|
|
5602
|
-
/* @__PURE__ */ l("span", { className: "rtc-card", role: "group", "aria-label": `${n},UTC ${i},${
|
|
5601
|
+
/* @__PURE__ */ l("span", { className: "rtc-card", role: "group", "aria-label": `${n},UTC ${i},${o} ${a}`, children: [
|
|
5603
5602
|
/* @__PURE__ */ t("span", { className: "rtc-card__relative", children: n }),
|
|
5604
5603
|
/* @__PURE__ */ l("span", { className: "rtc-card__row", children: [
|
|
5605
5604
|
/* @__PURE__ */ t("span", { className: "rtc-card__zone", children: "UTC" }),
|
|
5606
5605
|
/* @__PURE__ */ t("span", { className: "rtc-card__value", children: i })
|
|
5607
5606
|
] }),
|
|
5608
5607
|
/* @__PURE__ */ l("span", { className: "rtc-card__row", children: [
|
|
5609
|
-
/* @__PURE__ */ t("span", { className: "rtc-card__zone", children:
|
|
5608
|
+
/* @__PURE__ */ t("span", { className: "rtc-card__zone", children: o }),
|
|
5610
5609
|
/* @__PURE__ */ t("span", { className: "rtc-card__value", children: a })
|
|
5611
5610
|
] })
|
|
5612
5611
|
] })
|
|
@@ -5623,17 +5622,17 @@ function wa({ value: e }) {
|
|
|
5623
5622
|
function Na(e, n) {
|
|
5624
5623
|
return e ? `${e}.${n}` : n;
|
|
5625
5624
|
}
|
|
5626
|
-
function yn({ value: e, depth: n, path: r, collapsedDepth: a, highlight: i, seen:
|
|
5627
|
-
const
|
|
5628
|
-
if (!
|
|
5629
|
-
if (
|
|
5630
|
-
const d = new Set(
|
|
5625
|
+
function yn({ value: e, depth: n, path: r, collapsedDepth: a, highlight: i, seen: o }) {
|
|
5626
|
+
const s = Array.isArray(e), c = ga(e);
|
|
5627
|
+
if (!s && !c) return /* @__PURE__ */ t(wa, { value: e });
|
|
5628
|
+
if (o.has(e)) return /* @__PURE__ */ t("span", { className: "tok-comment", children: "<循环引用>" });
|
|
5629
|
+
const d = new Set(o).add(e), b = s ? e.map((N, x) => [String(x), N]) : Object.entries(e), u = a === void 0 || n < a, [f, _] = s ? ["[", "]"] : ["{", "}"];
|
|
5631
5630
|
if (b.length === 0)
|
|
5632
5631
|
return /* @__PURE__ */ l("span", { className: "q1-json-view__punct", children: [
|
|
5633
5632
|
f,
|
|
5634
5633
|
_
|
|
5635
5634
|
] });
|
|
5636
|
-
const m =
|
|
5635
|
+
const m = s ? `${b.length} 项` : `${b.length} 个键`;
|
|
5637
5636
|
return /* @__PURE__ */ l("details", { className: "q1-json-view__node", open: u, children: [
|
|
5638
5637
|
/* @__PURE__ */ l("summary", { className: "q1-json-view__summary", children: [
|
|
5639
5638
|
/* @__PURE__ */ t("span", { className: "q1-json-view__punct", children: f }),
|
|
@@ -5649,7 +5648,7 @@ function yn({ value: e, depth: n, path: r, collapsedDepth: a, highlight: i, seen
|
|
|
5649
5648
|
{
|
|
5650
5649
|
className: Y("q1-json-view__row", w && "q1-json-view__row--highlight"),
|
|
5651
5650
|
children: [
|
|
5652
|
-
|
|
5651
|
+
s ? null : /* @__PURE__ */ l(ae, { children: [
|
|
5653
5652
|
/* @__PURE__ */ l("span", { className: "q1-json-view__key", children: [
|
|
5654
5653
|
'"',
|
|
5655
5654
|
N,
|
|
@@ -5681,7 +5680,7 @@ function ht(e, n) {
|
|
|
5681
5680
|
if (e === null || typeof e != "object") return String(e);
|
|
5682
5681
|
if (n.has(e)) return "<循环引用>";
|
|
5683
5682
|
const r = new Set(n).add(e);
|
|
5684
|
-
return Array.isArray(e) ? `[${e.map((i) => ht(i, r)).join(", ")}]` : `{${Object.entries(e).map(([i,
|
|
5683
|
+
return Array.isArray(e) ? `[${e.map((i) => ht(i, r)).join(", ")}]` : `{${Object.entries(e).map(([i, o]) => `"${i}": ${ht(o, r)}`).join(", ")}}`;
|
|
5685
5684
|
}
|
|
5686
5685
|
function ro({
|
|
5687
5686
|
value: e,
|
|
@@ -5689,18 +5688,18 @@ function ro({
|
|
|
5689
5688
|
wrap: r = !1,
|
|
5690
5689
|
collapsedDepth: a,
|
|
5691
5690
|
highlight: i,
|
|
5692
|
-
embedded:
|
|
5693
|
-
label:
|
|
5691
|
+
embedded: o = !1,
|
|
5692
|
+
label: s = "JSON 数据",
|
|
5694
5693
|
className: c
|
|
5695
5694
|
}) {
|
|
5696
5695
|
const d = new Set(i ?? []), b = Y(
|
|
5697
5696
|
"q1-json-view",
|
|
5698
|
-
|
|
5697
|
+
o && "q1-json-view--embedded",
|
|
5699
5698
|
r && "q1-json-view--wrap",
|
|
5700
5699
|
n && "q1-json-view--single-line",
|
|
5701
5700
|
c
|
|
5702
5701
|
);
|
|
5703
|
-
return /* @__PURE__ */ t("div", { className: b, role: "group", "aria-label":
|
|
5702
|
+
return /* @__PURE__ */ t("div", { className: b, role: "group", "aria-label": s, children: n ? /* @__PURE__ */ t("span", { className: "q1-json-view__single", children: ht(e, /* @__PURE__ */ new Set()) }) : /* @__PURE__ */ t(
|
|
5704
5703
|
yn,
|
|
5705
5704
|
{
|
|
5706
5705
|
value: e,
|
|
@@ -5722,11 +5721,11 @@ function ao({
|
|
|
5722
5721
|
tracks: r,
|
|
5723
5722
|
label: a = "产品演示视频",
|
|
5724
5723
|
controls: i = !0,
|
|
5725
|
-
loop:
|
|
5724
|
+
loop: o = !0
|
|
5726
5725
|
}) {
|
|
5727
|
-
const
|
|
5726
|
+
const s = !i, c = !!r?.length;
|
|
5728
5727
|
return G(() => {
|
|
5729
|
-
}, [
|
|
5728
|
+
}, [s, c]), /* @__PURE__ */ l(
|
|
5730
5729
|
"video",
|
|
5731
5730
|
{
|
|
5732
5731
|
className: "ds-video",
|
|
@@ -5735,12 +5734,12 @@ function ao({
|
|
|
5735
5734
|
width: 1280,
|
|
5736
5735
|
height: 720,
|
|
5737
5736
|
controls: i,
|
|
5738
|
-
loop:
|
|
5737
|
+
loop: o,
|
|
5739
5738
|
muted: !0,
|
|
5740
5739
|
playsInline: !0,
|
|
5741
|
-
preload:
|
|
5742
|
-
autoPlay:
|
|
5743
|
-
...
|
|
5740
|
+
preload: s ? "auto" : "none",
|
|
5741
|
+
autoPlay: s && !va,
|
|
5742
|
+
...s ? { "aria-hidden": !0 } : { "aria-label": a },
|
|
5744
5743
|
children: [
|
|
5745
5744
|
r?.map((d) => /* @__PURE__ */ t(
|
|
5746
5745
|
"track",
|
|
@@ -5767,15 +5766,15 @@ function io({
|
|
|
5767
5766
|
alt: r,
|
|
5768
5767
|
ctrl: a,
|
|
5769
5768
|
small: i,
|
|
5770
|
-
children:
|
|
5769
|
+
children: o
|
|
5771
5770
|
}) {
|
|
5772
5771
|
return /* @__PURE__ */ l("kbd", { className: `q1-kbd${i ? " q1-kbd--small" : ""}`, children: [
|
|
5773
5772
|
e ? Ft ? "⌘" : /* @__PURE__ */ t("span", { "aria-label": "Control", children: "Ctrl" }) : null,
|
|
5774
|
-
e && !Ft && !!(n || r || a ||
|
|
5773
|
+
e && !Ft && !!(n || r || a || o) ? /* @__PURE__ */ t("span", { "aria-hidden": "true", children: "+" }) : null,
|
|
5775
5774
|
n ? "⇧" : null,
|
|
5776
5775
|
r ? "⌥" : null,
|
|
5777
5776
|
a ? "⌃" : null,
|
|
5778
|
-
|
|
5777
|
+
o
|
|
5779
5778
|
] });
|
|
5780
5779
|
}
|
|
5781
5780
|
const wn = "q1travel-design-system-theme", it = "q1travel-theme-change";
|
|
@@ -5793,9 +5792,9 @@ function ka() {
|
|
|
5793
5792
|
const [e, n] = B(Wt);
|
|
5794
5793
|
return G(() => {
|
|
5795
5794
|
ot(e);
|
|
5796
|
-
const a = window.matchMedia("(prefers-color-scheme: dark)"), i = () => e === "system" && ot("system"),
|
|
5797
|
-
return a.addEventListener("change", i), window.addEventListener(it,
|
|
5798
|
-
a.removeEventListener("change", i), window.removeEventListener(it,
|
|
5795
|
+
const a = window.matchMedia("(prefers-color-scheme: dark)"), i = () => e === "system" && ot("system"), o = () => n(Wt());
|
|
5796
|
+
return a.addEventListener("change", i), window.addEventListener(it, o), window.addEventListener("storage", o), () => {
|
|
5797
|
+
a.removeEventListener("change", i), window.removeEventListener(it, o), window.removeEventListener("storage", o);
|
|
5799
5798
|
};
|
|
5800
5799
|
}, [e]), [e, (a) => {
|
|
5801
5800
|
window.localStorage.setItem(wn, a), ot(a), n(a), window.dispatchEvent(new Event(it));
|
|
@@ -5815,21 +5814,21 @@ function oo({ small: e, disabled: n }) {
|
|
|
5815
5814
|
disabled: n,
|
|
5816
5815
|
children: [
|
|
5817
5816
|
/* @__PURE__ */ t("legend", { className: "q1-sr-only", children: "选择显示主题" }),
|
|
5818
|
-
xa.map(({ mode:
|
|
5817
|
+
xa.map(({ mode: o, label: s, Icon: c }) => /* @__PURE__ */ l("label", { className: "theme-switcher__option", children: [
|
|
5819
5818
|
/* @__PURE__ */ t(
|
|
5820
5819
|
"input",
|
|
5821
5820
|
{
|
|
5822
5821
|
type: "radio",
|
|
5823
5822
|
name: r,
|
|
5824
|
-
value:
|
|
5825
|
-
checked: a ===
|
|
5826
|
-
onChange: () => i(
|
|
5823
|
+
value: o,
|
|
5824
|
+
checked: a === o,
|
|
5825
|
+
onChange: () => i(o),
|
|
5827
5826
|
className: "q1-sr-only"
|
|
5828
5827
|
}
|
|
5829
5828
|
),
|
|
5830
5829
|
/* @__PURE__ */ t(c, { size: e ? 14 : 16, strokeWidth: 2, "aria-hidden": "true" }),
|
|
5831
|
-
/* @__PURE__ */ t("span", { className: "q1-sr-only", children:
|
|
5832
|
-
] },
|
|
5830
|
+
/* @__PURE__ */ t("span", { className: "q1-sr-only", children: s })
|
|
5831
|
+
] }, o))
|
|
5833
5832
|
]
|
|
5834
5833
|
}
|
|
5835
5834
|
);
|
|
@@ -5847,29 +5846,29 @@ function lo({
|
|
|
5847
5846
|
label: r,
|
|
5848
5847
|
children: a
|
|
5849
5848
|
}) {
|
|
5850
|
-
const i = A(null),
|
|
5851
|
-
function
|
|
5849
|
+
const i = A(null), o = e === "horizontal";
|
|
5850
|
+
function s(c) {
|
|
5852
5851
|
const d = i.current;
|
|
5853
5852
|
if (!d) return;
|
|
5854
|
-
const b = Array.from(d.children), u =
|
|
5853
|
+
const b = Array.from(d.children), u = o ? d.scrollLeft : d.scrollTop, f = o ? d.clientWidth : d.clientHeight, _ = u + (c === 1 ? f : 0), m = (g) => o ? g.offsetLeft : g.offsetTop, N = (g) => o ? g.offsetLeft + g.offsetWidth : g.offsetTop + g.offsetHeight, x = c === 1 ? b.find((g) => N(g) > _ + 1) : [...b].reverse().find((g) => m(g) < u - 1);
|
|
5855
5854
|
if (!x) return;
|
|
5856
5855
|
const h = gn() ? "auto" : "smooth";
|
|
5857
|
-
if (
|
|
5856
|
+
if (o) {
|
|
5858
5857
|
x.scrollIntoView({ behavior: h, inline: "start", block: "nearest" });
|
|
5859
5858
|
return;
|
|
5860
5859
|
}
|
|
5861
5860
|
const w = parseFloat(getComputedStyle(d).paddingTop) || 0, I = x.getBoundingClientRect().top - d.getBoundingClientRect().top - w;
|
|
5862
5861
|
d.scrollTo({ top: d.scrollTop + I, behavior: h });
|
|
5863
5862
|
}
|
|
5864
|
-
return /* @__PURE__ */ l("div", { className:
|
|
5863
|
+
return /* @__PURE__ */ l("div", { className: o ? "scroller-buttons" : "scroller-buttons scroller-buttons--vertical", children: [
|
|
5865
5864
|
/* @__PURE__ */ t(
|
|
5866
5865
|
"button",
|
|
5867
5866
|
{
|
|
5868
5867
|
type: "button",
|
|
5869
5868
|
className: "scroller-buttons__control",
|
|
5870
|
-
"aria-label": `${
|
|
5871
|
-
onClick: () =>
|
|
5872
|
-
children:
|
|
5869
|
+
"aria-label": `${o ? "向左滚动" : "向上滚动"}${n}`,
|
|
5870
|
+
onClick: () => s(-1),
|
|
5871
|
+
children: o ? /* @__PURE__ */ t(Te, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(Vt, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
5873
5872
|
}
|
|
5874
5873
|
),
|
|
5875
5874
|
/* @__PURE__ */ t("div", { className: `scroller scroller--${e} scroller--flush`, children: /* @__PURE__ */ t("div", { className: "scroller__viewport", ref: i, tabIndex: 0, role: "group", "aria-label": r, children: a }) }),
|
|
@@ -5878,20 +5877,20 @@ function lo({
|
|
|
5878
5877
|
{
|
|
5879
5878
|
type: "button",
|
|
5880
5879
|
className: "scroller-buttons__control",
|
|
5881
|
-
"aria-label": `${
|
|
5882
|
-
onClick: () =>
|
|
5883
|
-
children:
|
|
5880
|
+
"aria-label": `${o ? "向右滚动" : "向下滚动"}${n}`,
|
|
5881
|
+
onClick: () => s(1),
|
|
5882
|
+
children: o ? /* @__PURE__ */ t(ge, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ t(ye, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
5884
5883
|
}
|
|
5885
5884
|
)
|
|
5886
5885
|
] });
|
|
5887
5886
|
}
|
|
5888
|
-
function co({ label: e, unit: n, min: r = 0, max: a = 100, step: i = 1, defaultValue:
|
|
5889
|
-
const [
|
|
5887
|
+
function co({ label: e, unit: n, min: r = 0, max: a = 100, step: i = 1, defaultValue: o }) {
|
|
5888
|
+
const [s, c] = B(o), d = te(), b = (s - r) / (a - r) * 100;
|
|
5890
5889
|
return /* @__PURE__ */ l("div", { className: "slider-field", children: [
|
|
5891
5890
|
/* @__PURE__ */ l("div", { className: "slider-field__head", children: [
|
|
5892
5891
|
/* @__PURE__ */ t("label", { className: "slider-field__label", htmlFor: d, children: e }),
|
|
5893
5892
|
/* @__PURE__ */ l("output", { className: "slider-field__value", htmlFor: d, children: [
|
|
5894
|
-
|
|
5893
|
+
s,
|
|
5895
5894
|
n
|
|
5896
5895
|
] })
|
|
5897
5896
|
] }),
|
|
@@ -5904,16 +5903,16 @@ function co({ label: e, unit: n, min: r = 0, max: a = 100, step: i = 1, defaultV
|
|
|
5904
5903
|
min: r,
|
|
5905
5904
|
max: a,
|
|
5906
5905
|
step: i,
|
|
5907
|
-
value:
|
|
5906
|
+
value: s,
|
|
5908
5907
|
style: { "--slider-pct": `${b}%` },
|
|
5909
5908
|
onChange: (u) => c(Number(u.target.value))
|
|
5910
5909
|
}
|
|
5911
5910
|
)
|
|
5912
5911
|
] });
|
|
5913
5912
|
}
|
|
5914
|
-
function uo({ min: e = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh: i, disabled:
|
|
5915
|
-
const [
|
|
5916
|
-
return /* @__PURE__ */ l("div", { className: `range-slider${
|
|
5913
|
+
function uo({ min: e = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh: i, disabled: o }) {
|
|
5914
|
+
const [s, c] = B(a), [d, b] = B(i), u = te(), f = te(), _ = (s - e) / (n - e) * 100, m = (d - e) / (n - e) * 100, N = (h) => c(Math.min(h, d)), x = (h) => b(Math.max(h, s));
|
|
5915
|
+
return /* @__PURE__ */ l("div", { className: `range-slider${o ? " range-slider--disabled" : ""}`, children: [
|
|
5917
5916
|
/* @__PURE__ */ t("label", { className: "q1-sr-only", htmlFor: u, children: "区间下限" }),
|
|
5918
5917
|
/* @__PURE__ */ t(
|
|
5919
5918
|
"input",
|
|
@@ -5924,8 +5923,8 @@ function uo({ min: e = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh:
|
|
|
5924
5923
|
min: e,
|
|
5925
5924
|
max: n,
|
|
5926
5925
|
step: r,
|
|
5927
|
-
value:
|
|
5928
|
-
disabled:
|
|
5926
|
+
value: s,
|
|
5927
|
+
disabled: o,
|
|
5929
5928
|
onChange: (h) => N(Number(h.target.value))
|
|
5930
5929
|
}
|
|
5931
5930
|
),
|
|
@@ -5941,8 +5940,8 @@ function uo({ min: e = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh:
|
|
|
5941
5940
|
min: e,
|
|
5942
5941
|
max: n,
|
|
5943
5942
|
step: r,
|
|
5944
|
-
value:
|
|
5945
|
-
disabled:
|
|
5943
|
+
value: s,
|
|
5944
|
+
disabled: o,
|
|
5946
5945
|
onChange: (h) => N(Number(h.target.value))
|
|
5947
5946
|
}
|
|
5948
5947
|
),
|
|
@@ -5956,7 +5955,7 @@ function uo({ min: e = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh:
|
|
|
5956
5955
|
max: n,
|
|
5957
5956
|
step: r,
|
|
5958
5957
|
value: d,
|
|
5959
|
-
disabled:
|
|
5958
|
+
disabled: o,
|
|
5960
5959
|
onChange: (h) => x(Number(h.target.value))
|
|
5961
5960
|
}
|
|
5962
5961
|
)
|
|
@@ -5972,21 +5971,21 @@ function uo({ min: e = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh:
|
|
|
5972
5971
|
max: n,
|
|
5973
5972
|
step: r,
|
|
5974
5973
|
value: d,
|
|
5975
|
-
disabled:
|
|
5974
|
+
disabled: o,
|
|
5976
5975
|
onChange: (h) => x(Number(h.target.value))
|
|
5977
5976
|
}
|
|
5978
5977
|
)
|
|
5979
5978
|
] });
|
|
5980
5979
|
}
|
|
5981
5980
|
function Oe({ crumb: e }) {
|
|
5982
|
-
const n = /* @__PURE__ */ l(
|
|
5981
|
+
const n = /* @__PURE__ */ l(ae, { children: [
|
|
5983
5982
|
e.icon ? /* @__PURE__ */ t("span", { className: "breadcrumb__icon", "aria-hidden": "true", children: e.icon }) : null,
|
|
5984
5983
|
e.label
|
|
5985
5984
|
] });
|
|
5986
5985
|
return e.isCurrent ? /* @__PURE__ */ t("span", { className: "breadcrumb__link breadcrumb__link--current", "aria-current": "page", children: n }) : e.isDisabled ? /* @__PURE__ */ t("span", { className: "breadcrumb__link breadcrumb__link--disabled", "aria-disabled": "true", children: n }) : /* @__PURE__ */ t("a", { className: "breadcrumb__link", href: e.href ?? "#breadcrumb", children: n });
|
|
5987
5986
|
}
|
|
5988
5987
|
function Be() {
|
|
5989
|
-
return /* @__PURE__ */ t(
|
|
5988
|
+
return /* @__PURE__ */ t(ge, { className: "breadcrumb__separator", "aria-hidden": "true", size: 16, strokeWidth: 2 });
|
|
5990
5989
|
}
|
|
5991
5990
|
function ho({
|
|
5992
5991
|
items: e,
|
|
@@ -5994,13 +5993,13 @@ function ho({
|
|
|
5994
5993
|
type: r = "text"
|
|
5995
5994
|
}) {
|
|
5996
5995
|
const a = r === "menu";
|
|
5997
|
-
return /* @__PURE__ */ t("nav", { className: Y("breadcrumb", a ? "breadcrumb--menu" : ""), "aria-label": n, children: /* @__PURE__ */ t("ol", { className: "breadcrumb__list", children: e.map((i,
|
|
5996
|
+
return /* @__PURE__ */ t("nav", { className: Y("breadcrumb", a ? "breadcrumb--menu" : ""), "aria-label": n, children: /* @__PURE__ */ t("ol", { className: "breadcrumb__list", children: e.map((i, o) => /* @__PURE__ */ l("li", { className: "breadcrumb__item", children: [
|
|
5998
5997
|
/* @__PURE__ */ t(Oe, { crumb: i }),
|
|
5999
|
-
!a &&
|
|
5998
|
+
!a && o < e.length - 1 ? /* @__PURE__ */ t(Be, {}) : null
|
|
6000
5999
|
] }, i.label)) }) });
|
|
6001
6000
|
}
|
|
6002
6001
|
function fo({ items: e, label: n }) {
|
|
6003
|
-
const [r, a] = B(!1), i = e[0],
|
|
6002
|
+
const [r, a] = B(!1), i = e[0], o = e[e.length - 1], s = e.slice(1, -1);
|
|
6004
6003
|
return /* @__PURE__ */ t("nav", { className: "breadcrumb", "aria-label": n, "data-expanded": r ? "true" : "false", children: /* @__PURE__ */ l("ol", { className: "breadcrumb__list", children: [
|
|
6005
6004
|
/* @__PURE__ */ l("li", { className: "breadcrumb__item", children: [
|
|
6006
6005
|
/* @__PURE__ */ t(Oe, { crumb: i }),
|
|
@@ -6020,24 +6019,24 @@ function fo({ items: e, label: n }) {
|
|
|
6020
6019
|
),
|
|
6021
6020
|
/* @__PURE__ */ t(Be, {})
|
|
6022
6021
|
] }),
|
|
6023
|
-
|
|
6022
|
+
s.map((c) => /* @__PURE__ */ l("li", { className: "breadcrumb__item breadcrumb__item--middle", children: [
|
|
6024
6023
|
/* @__PURE__ */ t(Oe, { crumb: c }),
|
|
6025
6024
|
/* @__PURE__ */ t(Be, {})
|
|
6026
6025
|
] }, c.label)),
|
|
6027
|
-
/* @__PURE__ */ t("li", { className: "breadcrumb__item", children: /* @__PURE__ */ t(Oe, { crumb:
|
|
6026
|
+
/* @__PURE__ */ t("li", { className: "breadcrumb__item", children: /* @__PURE__ */ t(Oe, { crumb: o }) })
|
|
6028
6027
|
] }) });
|
|
6029
6028
|
}
|
|
6030
|
-
function mo({ open: e, onClose: n, title: r, side: a = "right", size: i, dismissable:
|
|
6029
|
+
function mo({ open: e, onClose: n, title: r, side: a = "right", size: i, dismissable: o = !0, children: s, footer: c }) {
|
|
6031
6030
|
const d = A(null), b = te(), { onKeyDown: u, portal: f } = De({
|
|
6032
6031
|
open: e,
|
|
6033
6032
|
blocking: !0,
|
|
6034
|
-
dismissable:
|
|
6033
|
+
dismissable: o,
|
|
6035
6034
|
outsidePointer: !1,
|
|
6036
6035
|
containerRef: d,
|
|
6037
6036
|
onClose: n
|
|
6038
6037
|
});
|
|
6039
6038
|
return e ? f(
|
|
6040
|
-
/* @__PURE__ */ l(
|
|
6039
|
+
/* @__PURE__ */ l(ae, { children: [
|
|
6041
6040
|
/* @__PURE__ */ t("div", { className: "sheet__backdrop", "aria-hidden": "true", onMouseDown: (_) => _.preventDefault() }),
|
|
6042
6041
|
/* @__PURE__ */ l(
|
|
6043
6042
|
"div",
|
|
@@ -6052,9 +6051,9 @@ function mo({ open: e, onClose: n, title: r, side: a = "right", size: i, dismiss
|
|
|
6052
6051
|
children: [
|
|
6053
6052
|
/* @__PURE__ */ l("header", { className: "sheet__header", children: [
|
|
6054
6053
|
/* @__PURE__ */ t("h2", { className: "sheet__title", id: b, children: r }),
|
|
6055
|
-
|
|
6054
|
+
o ? /* @__PURE__ */ t("button", { type: "button", className: "sheet__close", "aria-label": "关闭", onClick: n, children: /* @__PURE__ */ t(Ne, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) }) : null
|
|
6056
6055
|
] }),
|
|
6057
|
-
/* @__PURE__ */ t("div", { className: "sheet__body", children:
|
|
6056
|
+
/* @__PURE__ */ t("div", { className: "sheet__body", children: s }),
|
|
6058
6057
|
c ? /* @__PURE__ */ t("footer", { className: "sheet__footer", children: c }) : null
|
|
6059
6058
|
]
|
|
6060
6059
|
}
|
|
@@ -6062,7 +6061,7 @@ function mo({ open: e, onClose: n, title: r, side: a = "right", size: i, dismiss
|
|
|
6062
6061
|
] })
|
|
6063
6062
|
) : null;
|
|
6064
6063
|
}
|
|
6065
|
-
function po({ label: e, entries: n, variant: r = "default", size: a = "md", align: i = "start", menuButtonLabel:
|
|
6064
|
+
function po({ label: e, entries: n, variant: r = "default", size: a = "md", align: i = "start", menuButtonLabel: o, icon: s }) {
|
|
6066
6065
|
const [c, d] = B(!1), [b, u] = B(-1), f = A(null), _ = A([]), m = A({ buffer: "", timer: 0 }), N = te(), x = n.map((y, S) => S);
|
|
6067
6066
|
function h(y) {
|
|
6068
6067
|
u(y), _.current[y]?.focus();
|
|
@@ -6106,7 +6105,7 @@ function po({ label: e, entries: n, variant: r = "default", size: a = "md", alig
|
|
|
6106
6105
|
}
|
|
6107
6106
|
return /* @__PURE__ */ l("div", { className: `split-button split-button--${r} split-button--${a}`, children: [
|
|
6108
6107
|
/* @__PURE__ */ l("button", { type: "button", className: "split-button__primary", children: [
|
|
6109
|
-
|
|
6108
|
+
s ? /* @__PURE__ */ t("span", { className: "split-button__icon", children: s }) : null,
|
|
6110
6109
|
e
|
|
6111
6110
|
] }),
|
|
6112
6111
|
/* @__PURE__ */ t(
|
|
@@ -6115,13 +6114,13 @@ function po({ label: e, entries: n, variant: r = "default", size: a = "md", alig
|
|
|
6115
6114
|
ref: f,
|
|
6116
6115
|
type: "button",
|
|
6117
6116
|
className: "split-button__toggle",
|
|
6118
|
-
"aria-label":
|
|
6117
|
+
"aria-label": o,
|
|
6119
6118
|
"aria-haspopup": "menu",
|
|
6120
6119
|
"aria-expanded": c,
|
|
6121
6120
|
"aria-controls": c ? N : void 0,
|
|
6122
6121
|
onClick: () => c ? I() : w("first"),
|
|
6123
6122
|
onKeyDown: g,
|
|
6124
|
-
children: /* @__PURE__ */ t(
|
|
6123
|
+
children: /* @__PURE__ */ t(ye, { size: a === "sm" ? 14 : 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
6125
6124
|
}
|
|
6126
6125
|
),
|
|
6127
6126
|
c ? /* @__PURE__ */ t(
|
|
@@ -6129,7 +6128,7 @@ function po({ label: e, entries: n, variant: r = "default", size: a = "md", alig
|
|
|
6129
6128
|
{
|
|
6130
6129
|
id: N,
|
|
6131
6130
|
role: "menu",
|
|
6132
|
-
"aria-label":
|
|
6131
|
+
"aria-label": o,
|
|
6133
6132
|
className: `menu__popup menu__popup--${i}`,
|
|
6134
6133
|
onKeyDown: R,
|
|
6135
6134
|
children: n.map((y, S) => /* @__PURE__ */ l(
|
|
@@ -6156,7 +6155,7 @@ function po({ label: e, entries: n, variant: r = "default", size: a = "md", alig
|
|
|
6156
6155
|
}
|
|
6157
6156
|
const Ca = (e) => e.type === "item" && !e.disabled && !e.locked || e.type === "link";
|
|
6158
6157
|
function bo({ label: e, entries: n, withChevron: r, align: a = "start", triggerContent: i }) {
|
|
6159
|
-
const [
|
|
6158
|
+
const [o, s] = B(!1), [c, d] = B(!1), [b, u] = B({
|
|
6160
6159
|
align: a,
|
|
6161
6160
|
side: "bottom"
|
|
6162
6161
|
}), f = A(null), _ = A(null), m = te();
|
|
@@ -6164,7 +6163,7 @@ function bo({ label: e, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
6164
6163
|
d(!1), u({ align: a, side: "bottom" });
|
|
6165
6164
|
}
|
|
6166
6165
|
fe(() => {
|
|
6167
|
-
if (!
|
|
6166
|
+
if (!o) return;
|
|
6168
6167
|
function p() {
|
|
6169
6168
|
const E = f.current, M = _.current;
|
|
6170
6169
|
if (!E || !M) return;
|
|
@@ -6183,10 +6182,10 @@ function bo({ label: e, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
6183
6182
|
return p(), window.addEventListener("resize", T), () => {
|
|
6184
6183
|
window.removeEventListener("resize", T), k && window.cancelAnimationFrame(k);
|
|
6185
6184
|
};
|
|
6186
|
-
}, [
|
|
6187
|
-
if (
|
|
6185
|
+
}, [o, a]), fe(() => {
|
|
6186
|
+
if (o || !c || !_.current) return;
|
|
6188
6187
|
getComputedStyle(_.current).transitionDuration.split(",").some((k) => Number.parseFloat(k) > 0) || N();
|
|
6189
|
-
}, [
|
|
6188
|
+
}, [o, c]);
|
|
6190
6189
|
const x = n.flatMap((p, k) => Ca(p) ? [k] : []), { itemRefs: h, focusItem: w, reset: I, onMenuKeyDown: g } = Ae({
|
|
6191
6190
|
focusableIndices: x,
|
|
6192
6191
|
getText: (p) => {
|
|
@@ -6197,24 +6196,24 @@ function bo({ label: e, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
6197
6196
|
onTabExit: () => window.setTimeout(() => y(!1), 0)
|
|
6198
6197
|
});
|
|
6199
6198
|
function R(p) {
|
|
6200
|
-
d(!0),
|
|
6199
|
+
d(!0), s(!0);
|
|
6201
6200
|
const k = p === "first" ? x[0] : x[x.length - 1];
|
|
6202
6201
|
window.requestAnimationFrame(() => w(k));
|
|
6203
6202
|
}
|
|
6204
6203
|
function y(p = !0) {
|
|
6205
|
-
|
|
6204
|
+
s(!1), I(), p && f.current?.focus();
|
|
6206
6205
|
}
|
|
6207
6206
|
function S(p) {
|
|
6208
|
-
|
|
6207
|
+
o || p.target !== p.currentTarget || !["opacity", "transform"].includes(p.propertyName) || N();
|
|
6209
6208
|
}
|
|
6210
6209
|
G(() => {
|
|
6211
|
-
if (!
|
|
6210
|
+
if (!o) return;
|
|
6212
6211
|
function p(k) {
|
|
6213
6212
|
const T = h.current[0]?.closest(".menu");
|
|
6214
6213
|
T && !T.contains(k.target) && y(!1);
|
|
6215
6214
|
}
|
|
6216
6215
|
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
6217
|
-
}, [
|
|
6216
|
+
}, [o]);
|
|
6218
6217
|
function v(p) {
|
|
6219
6218
|
p.key === "ArrowDown" || p.key === "Enter" || p.key === " " ? (p.preventDefault(), R("first")) : p.key === "ArrowUp" && (p.preventDefault(), R("last"));
|
|
6220
6219
|
}
|
|
@@ -6226,14 +6225,14 @@ function bo({ label: e, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
6226
6225
|
type: "button",
|
|
6227
6226
|
className: i ? "menu__trigger menu__trigger--icon" : "menu__trigger",
|
|
6228
6227
|
"aria-haspopup": "menu",
|
|
6229
|
-
"aria-expanded":
|
|
6230
|
-
"aria-controls":
|
|
6228
|
+
"aria-expanded": o,
|
|
6229
|
+
"aria-controls": o ? m : void 0,
|
|
6231
6230
|
"aria-label": i ? e : void 0,
|
|
6232
|
-
onClick: () =>
|
|
6231
|
+
onClick: () => o ? y() : R("first"),
|
|
6233
6232
|
onKeyDown: v,
|
|
6234
6233
|
children: [
|
|
6235
6234
|
i ?? e,
|
|
6236
|
-
r ? /* @__PURE__ */ t(
|
|
6235
|
+
r ? /* @__PURE__ */ t(ye, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null
|
|
6237
6236
|
]
|
|
6238
6237
|
}
|
|
6239
6238
|
),
|
|
@@ -6245,9 +6244,9 @@ function bo({ label: e, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
6245
6244
|
role: "menu",
|
|
6246
6245
|
className: `menu__popup menu__popup--${b.align} menu__popup--${b.side}`,
|
|
6247
6246
|
"aria-label": e,
|
|
6248
|
-
"aria-hidden":
|
|
6249
|
-
"data-state":
|
|
6250
|
-
inert:
|
|
6247
|
+
"aria-hidden": o ? void 0 : !0,
|
|
6248
|
+
"data-state": o ? "open" : "closed",
|
|
6249
|
+
inert: o ? void 0 : !0,
|
|
6251
6250
|
onKeyDown: g,
|
|
6252
6251
|
onTransitionEnd: S,
|
|
6253
6252
|
children: n.map((p, k) => {
|
|
@@ -6306,13 +6305,13 @@ function bo({ label: e, entries: n, withChevron: r, align: a = "start", triggerC
|
|
|
6306
6305
|
] });
|
|
6307
6306
|
}
|
|
6308
6307
|
function _o({ options: e, defaultSelected: n = [], placeholder: r, onChange: a }) {
|
|
6309
|
-
const [i,
|
|
6308
|
+
const [i, o] = B(!1), [s, c] = B(n), [d, b] = B({ row: 0, col: 0 }), u = A(null), f = A(null), _ = A([]);
|
|
6310
6309
|
function m(p) {
|
|
6311
6310
|
c(p), a?.(p);
|
|
6312
6311
|
}
|
|
6313
|
-
const N = (p) =>
|
|
6312
|
+
const N = (p) => s.includes(p);
|
|
6314
6313
|
function x(p) {
|
|
6315
|
-
m(N(p) ?
|
|
6314
|
+
m(N(p) ? s.filter((k) => k !== p) : [...s, p]);
|
|
6316
6315
|
}
|
|
6317
6316
|
function h(p) {
|
|
6318
6317
|
m([p]);
|
|
@@ -6321,16 +6320,16 @@ function _o({ options: e, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
6321
6320
|
m([...e]);
|
|
6322
6321
|
}
|
|
6323
6322
|
function I(p) {
|
|
6324
|
-
return N(p) ?
|
|
6323
|
+
return N(p) ? s.length === e.length ? { label: "仅选此项", run: () => h(p) } : { label: "全选", run: () => w() } : s.length === 0 ? { label: "勾选", run: () => x(p) } : { label: "仅选此项", run: () => h(p) };
|
|
6325
6324
|
}
|
|
6326
6325
|
function g(p, k) {
|
|
6327
6326
|
b({ row: p, col: k }), window.requestAnimationFrame(() => _.current[p]?.[k]?.focus());
|
|
6328
6327
|
}
|
|
6329
6328
|
function R() {
|
|
6330
|
-
|
|
6329
|
+
o(!0), window.requestAnimationFrame(() => g(0, 0));
|
|
6331
6330
|
}
|
|
6332
6331
|
function y(p = !0) {
|
|
6333
|
-
|
|
6332
|
+
o(!1), p && f.current?.focus();
|
|
6334
6333
|
}
|
|
6335
6334
|
G(() => {
|
|
6336
6335
|
if (!i) return;
|
|
@@ -6343,7 +6342,7 @@ function _o({ options: e, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
6343
6342
|
const { row: k, col: T } = d;
|
|
6344
6343
|
p.key === "ArrowDown" ? (p.preventDefault(), g(Math.min(k + 1, e.length - 1), T)) : p.key === "ArrowUp" ? (p.preventDefault(), g(Math.max(k - 1, 0), T)) : p.key === "ArrowRight" ? (p.preventDefault(), g(k, 1)) : p.key === "ArrowLeft" ? (p.preventDefault(), g(k, 0)) : p.key === "Home" ? (p.preventDefault(), g(0, T)) : p.key === "End" ? (p.preventDefault(), g(e.length - 1, T)) : p.key === "Escape" && (p.preventDefault(), y());
|
|
6345
6344
|
}
|
|
6346
|
-
const v =
|
|
6345
|
+
const v = s.length === 0 ? r : s.length === 1 ? s[0] : `已选 ${s.length} 项`;
|
|
6347
6346
|
return /* @__PURE__ */ l("div", { className: "multi-select", ref: u, children: [
|
|
6348
6347
|
/* @__PURE__ */ l(
|
|
6349
6348
|
"button",
|
|
@@ -6355,8 +6354,8 @@ function _o({ options: e, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
6355
6354
|
"aria-expanded": i,
|
|
6356
6355
|
onClick: () => i ? y() : R(),
|
|
6357
6356
|
children: [
|
|
6358
|
-
/* @__PURE__ */ t("span", { className:
|
|
6359
|
-
/* @__PURE__ */ t(
|
|
6357
|
+
/* @__PURE__ */ t("span", { className: s.length === 0 ? "multi-select__placeholder" : void 0, children: v }),
|
|
6358
|
+
/* @__PURE__ */ t(ye, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
|
|
6360
6359
|
]
|
|
6361
6360
|
}
|
|
6362
6361
|
),
|
|
@@ -6367,12 +6366,12 @@ function _o({ options: e, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
6367
6366
|
{
|
|
6368
6367
|
type: "button",
|
|
6369
6368
|
className: "multi-select__bulk-button",
|
|
6370
|
-
onClick: () =>
|
|
6371
|
-
children:
|
|
6369
|
+
onClick: () => s.length === e.length ? m([]) : w(),
|
|
6370
|
+
children: s.length === e.length ? "全部清除" : "全选"
|
|
6372
6371
|
}
|
|
6373
6372
|
),
|
|
6374
6373
|
/* @__PURE__ */ l("span", { className: "multi-select__count", children: [
|
|
6375
|
-
|
|
6374
|
+
s.length,
|
|
6376
6375
|
" / ",
|
|
6377
6376
|
e.length
|
|
6378
6377
|
] })
|
|
@@ -6396,7 +6395,7 @@ function _o({ options: e, defaultSelected: n = [], placeholder: r, onChange: a }
|
|
|
6396
6395
|
onFocus: () => b({ row: k, col: 0 }),
|
|
6397
6396
|
onClick: () => x(p),
|
|
6398
6397
|
children: [
|
|
6399
|
-
/* @__PURE__ */ t("span", { className: `multi-select__check${T ? " multi-select__check--on" : ""}`, "aria-hidden": "true", children: T ? /* @__PURE__ */ t(
|
|
6398
|
+
/* @__PURE__ */ t("span", { className: `multi-select__check${T ? " multi-select__check--on" : ""}`, "aria-hidden": "true", children: T ? /* @__PURE__ */ t(pe, { size: 12, strokeWidth: 3 }) : null }),
|
|
6400
6399
|
/* @__PURE__ */ t("span", { className: "multi-select__option-label", children: p })
|
|
6401
6400
|
]
|
|
6402
6401
|
}
|
|
@@ -6434,13 +6433,13 @@ function qa(e) {
|
|
|
6434
6433
|
}
|
|
6435
6434
|
function yo(e) {
|
|
6436
6435
|
qa(e);
|
|
6437
|
-
const { open: n, title: r, children: a, footer: i, initialFocusRef:
|
|
6436
|
+
const { open: n, title: r, children: a, footer: i, initialFocusRef: o, sticky: s = !1 } = e, c = e.dismissal, d = c === void 0 ? e.dismissable ?? !0 : !1, b = A(null), u = te(), { focusInitialIfTopMost: f, onKeyDown: _, portal: m } = De({
|
|
6438
6437
|
open: n,
|
|
6439
6438
|
blocking: !0,
|
|
6440
6439
|
dismissable: d,
|
|
6441
6440
|
outsidePointer: d,
|
|
6442
6441
|
containerRef: b,
|
|
6443
|
-
initialFocusRef:
|
|
6442
|
+
initialFocusRef: o,
|
|
6444
6443
|
onClose: c === void 0 ? e.onClose : void 0,
|
|
6445
6444
|
escapeAction: c,
|
|
6446
6445
|
restoreFocus: c === void 0
|
|
@@ -6463,7 +6462,7 @@ function yo(e) {
|
|
|
6463
6462
|
/* @__PURE__ */ l(
|
|
6464
6463
|
"div",
|
|
6465
6464
|
{
|
|
6466
|
-
className:
|
|
6465
|
+
className: s ? "modal__dialog modal__dialog--sticky" : "modal__dialog",
|
|
6467
6466
|
role: "dialog",
|
|
6468
6467
|
"aria-modal": "true",
|
|
6469
6468
|
"aria-labelledby": u,
|
|
@@ -6485,10 +6484,10 @@ function go({ children: e }) {
|
|
|
6485
6484
|
}
|
|
6486
6485
|
const Fe = 100, Me = 32;
|
|
6487
6486
|
function wo({ data: e, summary: n, axisLabels: r = "ends-and-middle", height: a = 64, className: i }) {
|
|
6488
|
-
const
|
|
6489
|
-
const x =
|
|
6487
|
+
const o = e.map((m) => Math.max(0, Number(m?.value ?? 0))), s = o.length, c = Math.max(1, ...o), d = o.map((m, N) => {
|
|
6488
|
+
const x = s === 1 ? Fe / 2 : N / (s - 1) * Fe, h = Me - m / c * Me;
|
|
6490
6489
|
return `${x.toFixed(2)},${h.toFixed(2)}`;
|
|
6491
|
-
}).join(" "), b = e[0]?.label ?? "", u =
|
|
6490
|
+
}).join(" "), b = e[0]?.label ?? "", u = s >= 3 ? e[Math.floor(s / 2)]?.label ?? "" : "", f = s > 1 ? e[s - 1]?.label ?? "" : "", _ = r === "ends-and-middle" && !!u;
|
|
6492
6491
|
return /* @__PURE__ */ l(
|
|
6493
6492
|
"div",
|
|
6494
6493
|
{
|
|
@@ -6505,11 +6504,11 @@ function wo({ data: e, summary: n, axisLabels: r = "ends-and-middle", height: a
|
|
|
6505
6504
|
"aria-label": n,
|
|
6506
6505
|
children: [
|
|
6507
6506
|
/* @__PURE__ */ t("line", { className: "q1-chart__baseline", x1: "0", y1: Me, x2: Fe, y2: Me }),
|
|
6508
|
-
|
|
6507
|
+
s > 0 ? /* @__PURE__ */ t("polyline", { className: "q1-chart__line", points: d }) : null
|
|
6509
6508
|
]
|
|
6510
6509
|
}
|
|
6511
6510
|
),
|
|
6512
|
-
r &&
|
|
6511
|
+
r && s > 0 ? (
|
|
6513
6512
|
// 轴标签对读屏隐藏:摘要已经交代了范围与总量,再念一遍日期是重复噪音。
|
|
6514
6513
|
/* @__PURE__ */ l("div", { className: "q1-chart__axis", "aria-hidden": "true", children: [
|
|
6515
6514
|
/* @__PURE__ */ t("span", { children: b }),
|
|
@@ -6544,8 +6543,8 @@ function Ia(e, n) {
|
|
|
6544
6543
|
function Sa(e) {
|
|
6545
6544
|
const n = ft(e), r = ke(n, -n.getDay());
|
|
6546
6545
|
return Array.from({ length: 42 }, (a, i) => {
|
|
6547
|
-
const
|
|
6548
|
-
return { date:
|
|
6546
|
+
const o = ke(r, i);
|
|
6547
|
+
return { date: o, inMonth: o.getMonth() === n.getMonth() };
|
|
6549
6548
|
});
|
|
6550
6549
|
}
|
|
6551
6550
|
function lt(e, n, r) {
|
|
@@ -6560,11 +6559,11 @@ function Da({
|
|
|
6560
6559
|
size: r = "large",
|
|
6561
6560
|
minValue: a,
|
|
6562
6561
|
maxValue: i,
|
|
6563
|
-
today:
|
|
6562
|
+
today: o = /* @__PURE__ */ new Date()
|
|
6564
6563
|
}) {
|
|
6565
|
-
const [
|
|
6566
|
-
() => ft(Kt(e.start ??
|
|
6567
|
-
), [d, b] = B(null), [u, f] = B(() => Kt(e.start ??
|
|
6564
|
+
const [s, c] = B(
|
|
6565
|
+
() => ft(Kt(e.start ?? o, a, i))
|
|
6566
|
+
), [d, b] = B(null), [u, f] = B(() => Kt(e.start ?? o, a, i)), [_, m] = B(""), N = A(/* @__PURE__ */ new Map()), x = A(null), h = Sa(s);
|
|
6568
6567
|
G(() => {
|
|
6569
6568
|
if (!x.current) return;
|
|
6570
6569
|
const v = N.current.get(x.current);
|
|
@@ -6580,7 +6579,7 @@ function Da({
|
|
|
6580
6579
|
n({ start: p, end: k }), m(`已选择 ${ne(p)} 至 ${ne(k)},共 ${Ia(p, k)} 天`);
|
|
6581
6580
|
}
|
|
6582
6581
|
function g(v) {
|
|
6583
|
-
lt(v, a, i) || ((v.getMonth() !==
|
|
6582
|
+
lt(v, a, i) || ((v.getMonth() !== s.getMonth() || v.getFullYear() !== s.getFullYear()) && c(ft(v)), f(v), x.current = ne(v));
|
|
6584
6583
|
}
|
|
6585
6584
|
function R(v) {
|
|
6586
6585
|
let p = null;
|
|
@@ -6619,10 +6618,10 @@ function Da({
|
|
|
6619
6618
|
v.preventDefault(), p && g(p);
|
|
6620
6619
|
}
|
|
6621
6620
|
function y(v) {
|
|
6622
|
-
const p = st(
|
|
6621
|
+
const p = st(s, v);
|
|
6623
6622
|
c(p), f(p);
|
|
6624
6623
|
}
|
|
6625
|
-
const S = `${
|
|
6624
|
+
const S = `${s.getFullYear()} 年 ${s.getMonth() + 1} 月`;
|
|
6626
6625
|
return /* @__PURE__ */ l("div", { className: `calendar calendar--${r}`, children: [
|
|
6627
6626
|
/* @__PURE__ */ l("div", { className: "calendar__header", children: [
|
|
6628
6627
|
/* @__PURE__ */ t("span", { className: "calendar__month", children: S }),
|
|
@@ -6644,7 +6643,7 @@ function Da({
|
|
|
6644
6643
|
className: "calendar__nav-btn",
|
|
6645
6644
|
"aria-label": "下一月",
|
|
6646
6645
|
onClick: () => y(1),
|
|
6647
|
-
children: /* @__PURE__ */ t(
|
|
6646
|
+
children: /* @__PURE__ */ t(ge, { size: 16, strokeWidth: 2 })
|
|
6648
6647
|
}
|
|
6649
6648
|
)
|
|
6650
6649
|
] })
|
|
@@ -6661,7 +6660,7 @@ function Da({
|
|
|
6661
6660
|
p ? "" : "calendar__day--outside",
|
|
6662
6661
|
T && w.start ? "calendar__day--start" : "",
|
|
6663
6662
|
E && M ? "calendar__day--end" : "",
|
|
6664
|
-
p && !k && Se(v,
|
|
6663
|
+
p && !k && Se(v, o) ? "calendar__day--today" : ""
|
|
6665
6664
|
);
|
|
6666
6665
|
return /* @__PURE__ */ t("div", { className: D, role: "gridcell", children: /* @__PURE__ */ t(
|
|
6667
6666
|
"button",
|
|
@@ -6675,7 +6674,7 @@ function Da({
|
|
|
6675
6674
|
disabled: k,
|
|
6676
6675
|
"aria-disabled": k || void 0,
|
|
6677
6676
|
"aria-selected": (T || E) && w.start ? !0 : void 0,
|
|
6678
|
-
"aria-current": p && Se(v,
|
|
6677
|
+
"aria-current": p && Se(v, o) ? "date" : void 0,
|
|
6679
6678
|
onClick: () => !k && I(v),
|
|
6680
6679
|
onMouseEnter: () => b(v),
|
|
6681
6680
|
onMouseLeave: () => b(null),
|
|
@@ -6714,7 +6713,7 @@ function $a({
|
|
|
6714
6713
|
] }),
|
|
6715
6714
|
a ? /* @__PURE__ */ t("span", { className: "cal-inputs__tz cal-inputs__tz--pinned", children: a }) : /* @__PURE__ */ l("button", { type: "button", className: "cal-inputs__tz", children: [
|
|
6716
6715
|
"本地 (Asia/Shanghai)",
|
|
6717
|
-
/* @__PURE__ */ t(
|
|
6716
|
+
/* @__PURE__ */ t(ye, { size: 13, strokeWidth: 2 })
|
|
6718
6717
|
] })
|
|
6719
6718
|
] });
|
|
6720
6719
|
}
|
|
@@ -6724,8 +6723,8 @@ function No({
|
|
|
6724
6723
|
size: r = "large",
|
|
6725
6724
|
minValue: a,
|
|
6726
6725
|
maxValue: i,
|
|
6727
|
-
pinnedTimezone:
|
|
6728
|
-
today:
|
|
6726
|
+
pinnedTimezone: o,
|
|
6727
|
+
today: s,
|
|
6729
6728
|
value: c,
|
|
6730
6729
|
onChange: d
|
|
6731
6730
|
}) {
|
|
@@ -6757,7 +6756,7 @@ function No({
|
|
|
6757
6756
|
document.removeEventListener("mousedown", R), document.removeEventListener("keydown", y);
|
|
6758
6757
|
};
|
|
6759
6758
|
}, [b]);
|
|
6760
|
-
const m = !!c.start && !!c.end, N = m ? `${ne(c.start)} ~ ${ne(c.end)}` : "选择日期区间", x = /* @__PURE__ */ t(Da, { value: c, onChange: d, size: r, minValue: a, maxValue: i, today:
|
|
6759
|
+
const m = !!c.start && !!c.end, N = m ? `${ne(c.start)} ~ ${ne(c.end)}` : "选择日期区间", x = /* @__PURE__ */ t(Da, { value: c, onChange: d, size: r, minValue: a, maxValue: i, today: s }), h = /* @__PURE__ */ t(
|
|
6761
6760
|
$a,
|
|
6762
6761
|
{
|
|
6763
6762
|
value: c,
|
|
@@ -6765,7 +6764,7 @@ function No({
|
|
|
6765
6764
|
onApply: () => {
|
|
6766
6765
|
u(!1), _.current?.focus();
|
|
6767
6766
|
},
|
|
6768
|
-
pinnedTimezone:
|
|
6767
|
+
pinnedTimezone: o
|
|
6769
6768
|
}
|
|
6770
6769
|
);
|
|
6771
6770
|
return /* @__PURE__ */ l("div", { className: "cal-field", ref: f, children: [
|
|
@@ -6800,7 +6799,7 @@ function No({
|
|
|
6800
6799
|
className: "cal-field__caret",
|
|
6801
6800
|
"aria-label": "展开日历",
|
|
6802
6801
|
onClick: () => u((w) => !w),
|
|
6803
|
-
children: /* @__PURE__ */ t(
|
|
6802
|
+
children: /* @__PURE__ */ t(ye, { size: 15, strokeWidth: 2 })
|
|
6804
6803
|
}
|
|
6805
6804
|
) : m ? /* @__PURE__ */ t(
|
|
6806
6805
|
"button",
|
|
@@ -6822,10 +6821,10 @@ function No({
|
|
|
6822
6821
|
role: "dialog",
|
|
6823
6822
|
"aria-modal": "true",
|
|
6824
6823
|
"aria-label": "选择日期区间",
|
|
6825
|
-
children: e === "horizontal" ? /* @__PURE__ */ l(
|
|
6824
|
+
children: e === "horizontal" ? /* @__PURE__ */ l(ae, { children: [
|
|
6826
6825
|
x,
|
|
6827
6826
|
h
|
|
6828
|
-
] }) : /* @__PURE__ */ l(
|
|
6827
|
+
] }) : /* @__PURE__ */ l(ae, { children: [
|
|
6829
6828
|
h,
|
|
6830
6829
|
x
|
|
6831
6830
|
] })
|
|
@@ -6839,14 +6838,14 @@ function vo({
|
|
|
6839
6838
|
activeLabel: n,
|
|
6840
6839
|
onPick: r
|
|
6841
6840
|
}) {
|
|
6842
|
-
const [a, i] = B(!1),
|
|
6841
|
+
const [a, i] = B(!1), o = A(null);
|
|
6843
6842
|
return G(() => {
|
|
6844
6843
|
if (!a) return;
|
|
6845
|
-
function
|
|
6846
|
-
|
|
6844
|
+
function s(c) {
|
|
6845
|
+
o.current && !o.current.contains(c.target) && i(!1);
|
|
6847
6846
|
}
|
|
6848
|
-
return document.addEventListener("mousedown",
|
|
6849
|
-
}, [a]), /* @__PURE__ */ l("div", { className: "cal-period", ref:
|
|
6847
|
+
return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
|
|
6848
|
+
}, [a]), /* @__PURE__ */ l("div", { className: "cal-period", ref: o, children: [
|
|
6850
6849
|
/* @__PURE__ */ l(
|
|
6851
6850
|
"button",
|
|
6852
6851
|
{
|
|
@@ -6854,31 +6853,31 @@ function vo({
|
|
|
6854
6853
|
className: "cal-period__trigger",
|
|
6855
6854
|
"aria-haspopup": "listbox",
|
|
6856
6855
|
"aria-expanded": a,
|
|
6857
|
-
onClick: () => i((
|
|
6856
|
+
onClick: () => i((s) => !s),
|
|
6858
6857
|
children: [
|
|
6859
6858
|
/* @__PURE__ */ t(Sn, { size: 15, strokeWidth: 2, "aria-hidden": "true" }),
|
|
6860
6859
|
/* @__PURE__ */ t("span", { className: "cal-period__label", children: n ?? "选择周期" }),
|
|
6861
|
-
/* @__PURE__ */ t(
|
|
6860
|
+
/* @__PURE__ */ t(ye, { size: 15, strokeWidth: 2, "aria-hidden": "true" })
|
|
6862
6861
|
]
|
|
6863
6862
|
}
|
|
6864
6863
|
),
|
|
6865
6864
|
a ? /* @__PURE__ */ l("div", { className: "cal-period__menu", children: [
|
|
6866
|
-
/* @__PURE__ */ t("ul", { className: "cal-period__list", role: "listbox", "aria-label": "快捷周期", children: e.map((
|
|
6865
|
+
/* @__PURE__ */ t("ul", { className: "cal-period__list", role: "listbox", "aria-label": "快捷周期", children: e.map((s) => /* @__PURE__ */ t("li", { role: "option", "aria-selected": s.label === n, children: /* @__PURE__ */ t(
|
|
6867
6866
|
"button",
|
|
6868
6867
|
{
|
|
6869
6868
|
type: "button",
|
|
6870
|
-
className: `cal-period__option${
|
|
6869
|
+
className: `cal-period__option${s.label === n ? " cal-period__option--active" : ""}`,
|
|
6871
6870
|
onClick: () => {
|
|
6872
|
-
r(
|
|
6871
|
+
r(s), i(!1);
|
|
6873
6872
|
},
|
|
6874
|
-
children:
|
|
6873
|
+
children: s.label
|
|
6875
6874
|
}
|
|
6876
|
-
) },
|
|
6875
|
+
) }, s.label)) }),
|
|
6877
6876
|
/* @__PURE__ */ l("div", { className: "cal-period__hints", "aria-hidden": "true", children: [
|
|
6878
6877
|
/* @__PURE__ */ t("p", { className: "cal-period__hint-title", children: "输入相对时间" }),
|
|
6879
|
-
/* @__PURE__ */ t("div", { className: "cal-period__chips", children: Ma.map((
|
|
6878
|
+
/* @__PURE__ */ t("div", { className: "cal-period__chips", children: Ma.map((s) => /* @__PURE__ */ t("span", { className: "cal-period__chip", children: s }, s)) }),
|
|
6880
6879
|
/* @__PURE__ */ t("p", { className: "cal-period__hint-title", children: "输入固定时间" }),
|
|
6881
|
-
/* @__PURE__ */ t("div", { className: "cal-period__chips", children: Ta.map((
|
|
6880
|
+
/* @__PURE__ */ t("div", { className: "cal-period__chips", children: Ta.map((s) => /* @__PURE__ */ t("span", { className: "cal-period__chip", children: s }, s)) })
|
|
6882
6881
|
] })
|
|
6883
6882
|
] }) : null
|
|
6884
6883
|
] });
|