@q1travel/design-system 0.30.15 → 0.30.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-pkg/design-system.js +510 -507
- package/dist-pkg/style.css +16 -11
- package/package.json +2 -2
|
@@ -1116,8 +1116,8 @@ function Fe(e) {
|
|
|
1116
1116
|
loading: f,
|
|
1117
1117
|
busy: p,
|
|
1118
1118
|
className: C
|
|
1119
|
-
}), t === "pointer" ? "button--busy-motion-pointer" : ""), Y = D ?? T,
|
|
1120
|
-
if (
|
|
1119
|
+
}), t === "pointer" ? "button--busy-motion-pointer" : ""), Y = D ?? T, ne = s ?? l, z = k ?? S, te = f && !u && !p;
|
|
1120
|
+
if (ne && !Y?.trim()) {
|
|
1121
1121
|
const R = Z["data-icon-button"] === "" ? "IconButton" : "Button";
|
|
1122
1122
|
console.warn(`${R}: 缺少 aria-label,纯图标按钮必须提供可访问名称。`);
|
|
1123
1123
|
}
|
|
@@ -1147,7 +1147,7 @@ function Fe(e) {
|
|
|
1147
1147
|
"aria-pressed": d === void 0 ? x : d,
|
|
1148
1148
|
tabIndex: te ? 0 : M,
|
|
1149
1149
|
"aria-label": Y,
|
|
1150
|
-
"aria-keyshortcuts":
|
|
1150
|
+
"aria-keyshortcuts": z,
|
|
1151
1151
|
"aria-describedby": P,
|
|
1152
1152
|
onClick: q,
|
|
1153
1153
|
onFocus: K,
|
|
@@ -1197,7 +1197,7 @@ function qa(e) {
|
|
|
1197
1197
|
onTransitionCancel: Z,
|
|
1198
1198
|
ref: X,
|
|
1199
1199
|
...Y
|
|
1200
|
-
} = e,
|
|
1200
|
+
} = e, ne = f ?? g, z = !!(c || ne), te = !!(ne && (l || a) || c && l), q = be(
|
|
1201
1201
|
Wn({
|
|
1202
1202
|
variant: m,
|
|
1203
1203
|
size: d,
|
|
@@ -1212,18 +1212,18 @@ function qa(e) {
|
|
|
1212
1212
|
}),
|
|
1213
1213
|
"button-link",
|
|
1214
1214
|
t === "pointer" ? "button-link--busy-motion-pointer" : ""
|
|
1215
|
-
), $ = y || a || l, R = T ?? S,
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
}, [t, te,
|
|
1215
|
+
), $ = y || a || l, R = T ?? S, V = P ?? k;
|
|
1216
|
+
ne && !R?.trim() && console.warn("ButtonLink: 缺少 aria-label,纯图标按钮必须提供可访问名称。"), se(() => {
|
|
1217
|
+
z ? te && t === "pointer" ? o.current = !0 : !o.current && t === "pointer" && r(void 0) : (o.current = !1, t === "pointer" && r(void 0));
|
|
1218
|
+
}, [t, te, z]);
|
|
1219
1219
|
const J = (W) => {
|
|
1220
1220
|
if ($) {
|
|
1221
1221
|
W.preventDefault();
|
|
1222
1222
|
return;
|
|
1223
1223
|
}
|
|
1224
|
-
r(W.detail > 0 &&
|
|
1224
|
+
r(W.detail > 0 && z ? "pointer" : void 0), D?.(W);
|
|
1225
1225
|
}, F = (W) => {
|
|
1226
|
-
W.type === "transitioncancel" ? Z?.(W) : B?.(W), !te && o.current && W.propertyName === "opacity" && W.target.classList.contains(
|
|
1226
|
+
W.type === "transitioncancel" ? Z?.(W) : B?.(W), !te && o.current && W.propertyName === "opacity" && W.target.classList.contains(ne ? "button__icon-content" : "button__busy-prefix") && (o.current = !1, r(void 0));
|
|
1227
1227
|
};
|
|
1228
1228
|
return /* @__PURE__ */ b(ke, { children: [
|
|
1229
1229
|
/* @__PURE__ */ n(
|
|
@@ -1237,7 +1237,7 @@ function qa(e) {
|
|
|
1237
1237
|
"aria-busy": l ? !0 : M,
|
|
1238
1238
|
tabIndex: y || l ? -1 : a ? 0 : K,
|
|
1239
1239
|
"aria-label": R,
|
|
1240
|
-
"aria-keyshortcuts":
|
|
1240
|
+
"aria-keyshortcuts": V,
|
|
1241
1241
|
"aria-describedby": E,
|
|
1242
1242
|
onClick: J,
|
|
1243
1243
|
onFocus: O,
|
|
@@ -1594,7 +1594,7 @@ function uo({
|
|
|
1594
1594
|
He === "top" || He === "bottom" ? (ee = s === "start" ? fe.left : s === "end" ? fe.right - pe : Ye - pe / 2, de = He === "top" ? fe.top - ge - Re : fe.bottom + ge) : (de = s === "start" ? fe.top : s === "end" ? fe.bottom - Re : Rt - Re / 2, ee = He === "left" ? fe.left - ge - pe : fe.right + ge), ee = Math.max(ae, Math.min(ee, Se - ae - pe)), de = Math.max(ae, Math.min(de, Oe - ae - Re));
|
|
1595
1595
|
const Pe = He === "top" || He === "bottom" ? Math.max(12, Math.min(pe - 12, Ye - ee)) : Math.max(12, Math.min(Re - 12, Rt - de));
|
|
1596
1596
|
h({ p: He, left: ee, top: de, caret: Pe });
|
|
1597
|
-
}, [t, s]),
|
|
1597
|
+
}, [t, s]), ne = ve((ue) => {
|
|
1598
1598
|
L.current = ue, ue && P.current && Y();
|
|
1599
1599
|
}, [Y]);
|
|
1600
1600
|
qt(O, L, !!M), _e(() => {
|
|
@@ -1607,7 +1607,7 @@ function uo({
|
|
|
1607
1607
|
Q?.disconnect(), ue.removeEventListener("scroll", Y, !0), ue.removeEventListener("resize", Y);
|
|
1608
1608
|
};
|
|
1609
1609
|
}, [f, M, Y]);
|
|
1610
|
-
function
|
|
1610
|
+
function z() {
|
|
1611
1611
|
u.current && clearTimeout(u.current), u.current = null, y.current?.(), y.current = null;
|
|
1612
1612
|
}
|
|
1613
1613
|
function te() {
|
|
@@ -1621,7 +1621,7 @@ function uo({
|
|
|
1621
1621
|
}
|
|
1622
1622
|
se(
|
|
1623
1623
|
() => () => {
|
|
1624
|
-
|
|
1624
|
+
z(), $(), q(), te();
|
|
1625
1625
|
},
|
|
1626
1626
|
[]
|
|
1627
1627
|
), se(() => {
|
|
@@ -1631,11 +1631,11 @@ function uo({
|
|
|
1631
1631
|
function R() {
|
|
1632
1632
|
return v.current || I.current || N.current || D.current;
|
|
1633
1633
|
}
|
|
1634
|
-
function
|
|
1635
|
-
|
|
1634
|
+
function V(ue, Q) {
|
|
1635
|
+
z(), !T.current && (k.current = Q, P.current = !0, x(ue), g(!0));
|
|
1636
1636
|
}
|
|
1637
1637
|
function J({ clearWarm: ue = !1 } = {}) {
|
|
1638
|
-
|
|
1638
|
+
z(), $();
|
|
1639
1639
|
const Q = O.current?.ownerDocument;
|
|
1640
1640
|
if (Q) {
|
|
1641
1641
|
const ae = tn(Q);
|
|
@@ -1655,27 +1655,27 @@ function uo({
|
|
|
1655
1655
|
function ie() {
|
|
1656
1656
|
if (d) return;
|
|
1657
1657
|
const ue = O.current?.ownerDocument, Q = ue?.defaultView;
|
|
1658
|
-
if (!ue || !Q?.matchMedia("(hover: hover) and (pointer: fine)").matches || (
|
|
1658
|
+
if (!ue || !Q?.matchMedia("(hover: hover) and (pointer: fine)").matches || (z(), T.current || P.current)) return;
|
|
1659
1659
|
if (tn(ue).warmUntil > Date.now()) {
|
|
1660
|
-
|
|
1660
|
+
V(!0, !0);
|
|
1661
1661
|
return;
|
|
1662
1662
|
}
|
|
1663
1663
|
y.current = Xa(ue, B.current), u.current = setTimeout(() => {
|
|
1664
|
-
|
|
1664
|
+
z(), v.current && !T.current && V(!1, !0);
|
|
1665
1665
|
}, r);
|
|
1666
1666
|
}
|
|
1667
1667
|
function H(ue) {
|
|
1668
1668
|
const Q = ue.target;
|
|
1669
1669
|
!Q || typeof Q.nodeType != "number" || !O.current?.contains(Q) || (R() || (T.current = !1), v.current = !0, te(), ie());
|
|
1670
1670
|
}
|
|
1671
|
-
function
|
|
1671
|
+
function re(ue, Q, ae) {
|
|
1672
1672
|
return Q >= ue.left && Q <= ue.right && ae >= ue.top && ae <= ue.bottom;
|
|
1673
1673
|
}
|
|
1674
1674
|
function U(ue, Q) {
|
|
1675
1675
|
const ae = O.current, ge = L.current;
|
|
1676
1676
|
if (!ae || !ge) return !1;
|
|
1677
1677
|
const fe = ae.getBoundingClientRect(), pe = ge.getBoundingClientRect();
|
|
1678
|
-
return
|
|
1678
|
+
return re(fe, ue, Q) || re(pe, ue, Q) ? !0 : pe.bottom <= fe.top ? ue >= Math.min(fe.left, pe.left) && ue <= Math.max(fe.right, pe.right) && Q >= pe.bottom && Q <= fe.top : pe.top >= fe.bottom ? ue >= Math.min(fe.left, pe.left) && ue <= Math.max(fe.right, pe.right) && Q >= fe.bottom && Q <= pe.top : pe.right <= fe.left ? Q >= Math.min(fe.top, pe.top) && Q <= Math.max(fe.bottom, pe.bottom) && ue >= pe.right && ue <= fe.left : pe.left >= fe.right ? Q >= Math.min(fe.top, pe.top) && Q <= Math.max(fe.bottom, pe.bottom) && ue >= fe.right && ue <= pe.left : !1;
|
|
1679
1679
|
}
|
|
1680
1680
|
function le(ue, Q) {
|
|
1681
1681
|
const ae = O.current?.ownerDocument;
|
|
@@ -1687,7 +1687,7 @@ function uo({
|
|
|
1687
1687
|
return;
|
|
1688
1688
|
}
|
|
1689
1689
|
const pe = L.current;
|
|
1690
|
-
if (pe &&
|
|
1690
|
+
if (pe && re(pe.getBoundingClientRect(), fe.clientX, fe.clientY)) {
|
|
1691
1691
|
N.current = !0, te();
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
@@ -1700,7 +1700,7 @@ function uo({
|
|
|
1700
1700
|
!Q || typeof Q.nodeType != "number" || !O.current?.contains(Q) || (v.current = !1, le(ue.clientX, ue.clientY) || W());
|
|
1701
1701
|
}
|
|
1702
1702
|
function he() {
|
|
1703
|
-
d || (R() || (T.current = !1), I.current = !0, S.current ||
|
|
1703
|
+
d || (R() || (T.current = !1), I.current = !0, S.current || V(!0, !1));
|
|
1704
1704
|
}
|
|
1705
1705
|
function Ce() {
|
|
1706
1706
|
I.current = !1, W();
|
|
@@ -1731,14 +1731,14 @@ function uo({
|
|
|
1731
1731
|
}
|
|
1732
1732
|
const ue = O.current?.ownerDocument;
|
|
1733
1733
|
if (!ue || d) return;
|
|
1734
|
-
T.current = !1,
|
|
1734
|
+
T.current = !1, V(!0, !1);
|
|
1735
1735
|
const Q = (ae) => {
|
|
1736
1736
|
const ge = ae.target;
|
|
1737
1737
|
ge && (O.current?.contains(ge) || L.current?.contains(ge)) || J({ clearWarm: !0 });
|
|
1738
1738
|
};
|
|
1739
1739
|
ue.addEventListener("pointerdown", Q, !0), w.current = () => ue.removeEventListener("pointerdown", Q, !0);
|
|
1740
1740
|
}
|
|
1741
|
-
B.current.dismiss = () => P.current ? (T.current = !0, te(), J({ clearWarm: !0 }), !0) : !1, B.current.cancelPending =
|
|
1741
|
+
B.current.dismiss = () => P.current ? (T.current = !0, te(), J({ clearWarm: !0 }), !0) : !1, B.current.cancelPending = z, B.current.getContainer = () => L.current, B.current.getPortalRoot = () => M;
|
|
1742
1742
|
const Ne = {
|
|
1743
1743
|
left: p.left,
|
|
1744
1744
|
top: p.top,
|
|
@@ -1794,7 +1794,7 @@ function uo({
|
|
|
1794
1794
|
/* @__PURE__ */ n(
|
|
1795
1795
|
"span",
|
|
1796
1796
|
{
|
|
1797
|
-
ref:
|
|
1797
|
+
ref: ne,
|
|
1798
1798
|
role: "tooltip",
|
|
1799
1799
|
id: G,
|
|
1800
1800
|
className: qe,
|
|
@@ -1956,9 +1956,9 @@ function wt({
|
|
|
1956
1956
|
disabled: N,
|
|
1957
1957
|
...D
|
|
1958
1958
|
}) {
|
|
1959
|
-
const T = we(), S = e ?? T, k = t === void 0, P = A(null), E = A(null), x = Te(() => lt(P, c), [c]), [M, K] = j(!1), [O, L] = j(null), [G, B] = j(!1), Z = C ?? M, X = (
|
|
1959
|
+
const T = we(), S = e ?? T, k = t === void 0, P = A(null), E = A(null), x = Te(() => lt(P, c), [c]), [M, K] = j(!1), [O, L] = j(null), [G, B] = j(!1), Z = C ?? M, X = (V) => {
|
|
1960
1960
|
const J = !Z;
|
|
1961
|
-
L(
|
|
1961
|
+
L(V ? J : null), C === void 0 && K(J), w?.(J);
|
|
1962
1962
|
}, Y = O === Z;
|
|
1963
1963
|
se(() => {
|
|
1964
1964
|
if (O === null) return;
|
|
@@ -1966,7 +1966,7 @@ function wt({
|
|
|
1966
1966
|
L(null);
|
|
1967
1967
|
return;
|
|
1968
1968
|
}
|
|
1969
|
-
let
|
|
1969
|
+
let V = !1;
|
|
1970
1970
|
const J = window.requestAnimationFrame(() => {
|
|
1971
1971
|
const F = Array.from(
|
|
1972
1972
|
E.current?.querySelectorAll(".input-control__reveal-icon") ?? []
|
|
@@ -1976,14 +1976,14 @@ function wt({
|
|
|
1976
1976
|
return;
|
|
1977
1977
|
}
|
|
1978
1978
|
Promise.allSettled(F.map((W) => W.finished)).then(() => {
|
|
1979
|
-
|
|
1979
|
+
V || L((W) => W === O ? null : W);
|
|
1980
1980
|
});
|
|
1981
1981
|
});
|
|
1982
1982
|
return () => {
|
|
1983
|
-
|
|
1983
|
+
V = !0, window.cancelAnimationFrame(J);
|
|
1984
1984
|
};
|
|
1985
1985
|
}, [Z, O]);
|
|
1986
|
-
const
|
|
1986
|
+
const ne = _ ? /* @__PURE__ */ n(
|
|
1987
1987
|
Ba,
|
|
1988
1988
|
{
|
|
1989
1989
|
type: "button",
|
|
@@ -1991,24 +1991,24 @@ function wt({
|
|
|
1991
1991
|
size: u === "xs" ? "sm" : u,
|
|
1992
1992
|
"aria-label": Z ? I : v,
|
|
1993
1993
|
disabled: N,
|
|
1994
|
-
onPointerDown: (
|
|
1995
|
-
|
|
1994
|
+
onPointerDown: (V) => {
|
|
1995
|
+
V.button === 0 && B(!0);
|
|
1996
1996
|
},
|
|
1997
1997
|
onPointerUp: () => B(!1),
|
|
1998
1998
|
onPointerLeave: () => B(!1),
|
|
1999
1999
|
onPointerCancel: () => B(!1),
|
|
2000
2000
|
onBlur: () => B(!1),
|
|
2001
|
-
onKeyDown: (
|
|
2002
|
-
|
|
2001
|
+
onKeyDown: (V) => {
|
|
2002
|
+
V.key !== "Enter" && V.key !== " " || (B(!1), V.currentTarget.getAnimations().forEach((J) => J.cancel()));
|
|
2003
2003
|
},
|
|
2004
|
-
onClick: (
|
|
2004
|
+
onClick: (V) => X(V.detail > 0),
|
|
2005
2005
|
children: /* @__PURE__ */ b(
|
|
2006
2006
|
"span",
|
|
2007
2007
|
{
|
|
2008
2008
|
className: "input-control__reveal-icons",
|
|
2009
2009
|
"aria-hidden": "true",
|
|
2010
|
-
onTransitionEnd: (
|
|
2011
|
-
|
|
2010
|
+
onTransitionEnd: (V) => {
|
|
2011
|
+
V.propertyName === "opacity" && L(null);
|
|
2012
2012
|
},
|
|
2013
2013
|
children: [
|
|
2014
2014
|
/* @__PURE__ */ n(
|
|
@@ -2031,7 +2031,7 @@ function wt({
|
|
|
2031
2031
|
}
|
|
2032
2032
|
) : null;
|
|
2033
2033
|
$t("Input", k, P);
|
|
2034
|
-
const
|
|
2034
|
+
const z = a || !k && i ? nt(S, !!a) : void 0, te = be(
|
|
2035
2035
|
"form-control",
|
|
2036
2036
|
"form-control--input",
|
|
2037
2037
|
u !== "md" ? `form-control--${u}` : "",
|
|
@@ -2042,18 +2042,18 @@ function wt({
|
|
|
2042
2042
|
ref: x,
|
|
2043
2043
|
id: S,
|
|
2044
2044
|
className: te,
|
|
2045
|
-
"aria-describedby": fn(l,
|
|
2045
|
+
"aria-describedby": fn(l, z),
|
|
2046
2046
|
"aria-invalid": s || a ? !0 : void 0,
|
|
2047
2047
|
...D,
|
|
2048
2048
|
disabled: N,
|
|
2049
2049
|
..._ ? { type: Z ? "text" : "password" } : null
|
|
2050
2050
|
}
|
|
2051
|
-
), R = m || d ||
|
|
2051
|
+
), R = m || d || ne || p ? /* @__PURE__ */ b(
|
|
2052
2052
|
"span",
|
|
2053
2053
|
{
|
|
2054
2054
|
className: q,
|
|
2055
|
-
onPointerDown: (
|
|
2056
|
-
(
|
|
2055
|
+
onPointerDown: (V) => {
|
|
2056
|
+
(V.target instanceof Element ? V.target : null)?.closest(".form-control, .input-control__action") || P.current?.matches(":disabled") || (V.preventDefault(), P.current?.focus());
|
|
2057
2057
|
},
|
|
2058
2058
|
children: [
|
|
2059
2059
|
m ? /* @__PURE__ */ n(
|
|
@@ -2073,14 +2073,14 @@ function wt({
|
|
|
2073
2073
|
children: d
|
|
2074
2074
|
}
|
|
2075
2075
|
) : null,
|
|
2076
|
-
|
|
2076
|
+
ne ? /* @__PURE__ */ n(
|
|
2077
2077
|
"span",
|
|
2078
2078
|
{
|
|
2079
2079
|
ref: E,
|
|
2080
2080
|
className: "input-control__action",
|
|
2081
2081
|
"data-pointer-pressed": G ? "true" : void 0,
|
|
2082
2082
|
"data-reveal-motion": Y ? "pointer" : "instant",
|
|
2083
|
-
children:
|
|
2083
|
+
children: ne
|
|
2084
2084
|
}
|
|
2085
2085
|
) : null
|
|
2086
2086
|
]
|
|
@@ -2115,39 +2115,39 @@ function su({
|
|
|
2115
2115
|
}) {
|
|
2116
2116
|
if (typeof r != "string" || !/^[0-9]{0,6}$/.test(r))
|
|
2117
2117
|
throw new Error("InputOTP value must be a string of up to six ASCII digits.");
|
|
2118
|
-
const v = we(), I = e ?? v, N = A(null), D = Te(() => lt(N, f), [f]), [T, S] = j({ start: 0, end: 0, backward: !1 }), [k, P] = j(null), [E, x] = j(""), M = A(""), K = A(null), O = A(!1), L = A(null), G = A(null), B = k ?? r, Z = `${I}-format`, X = E || y, Y = y || g !== void 0 && (u || X) ? nt(I, !!X) : void 0,
|
|
2118
|
+
const v = we(), I = e ?? v, N = A(null), D = Te(() => lt(N, f), [f]), [T, S] = j({ start: 0, end: 0, backward: !1 }), [k, P] = j(null), [E, x] = j(""), M = A(""), K = A(null), O = A(!1), L = A(null), G = A(null), B = k ?? r, Z = `${I}-format`, X = E || y, Y = y || g !== void 0 && (u || X) ? nt(I, !!X) : void 0, ne = ($) => {
|
|
2119
2119
|
S({ start: $.selectionStart ?? 0, end: $.selectionEnd ?? 0, backward: $.selectionDirection === "backward" });
|
|
2120
2120
|
};
|
|
2121
2121
|
_e(() => {
|
|
2122
2122
|
x("");
|
|
2123
2123
|
const $ = G.current;
|
|
2124
|
-
G.current = null, $?.value === r && N.current && (N.current.setSelectionRange($.cursor, $.cursor),
|
|
2124
|
+
G.current = null, $?.value === r && N.current && (N.current.setSelectionRange($.cursor, $.cursor), ne(N.current));
|
|
2125
2125
|
}, [r]);
|
|
2126
|
-
const
|
|
2126
|
+
const z = ($, R) => {
|
|
2127
2127
|
if (!/^[0-9]{0,6}$/.test($)) {
|
|
2128
2128
|
x("请输入 6 位数字验证码。"), N.current && (N.current.value = r);
|
|
2129
2129
|
return;
|
|
2130
2130
|
}
|
|
2131
2131
|
x(""), G.current = { value: $, cursor: R }, $ !== r ? o($) : N.current && N.current.setSelectionRange(R, R), S({ start: R, end: R, backward: !1 });
|
|
2132
2132
|
}, te = ($, R) => {
|
|
2133
|
-
const
|
|
2133
|
+
const V = $.parentElement?.querySelectorAll("[data-code-slot]"), J = Array.from(V ?? []).findIndex((F) => R <= F.getBoundingClientRect().right);
|
|
2134
2134
|
return Math.min(J < 0 ? 6 : J, r.length);
|
|
2135
2135
|
}, q = /* @__PURE__ */ b(ke, { children: [
|
|
2136
2136
|
/* @__PURE__ */ b("div", { className: `q1-verification-code q1-verification-code--${m}`, "data-separator": d || void 0, children: [
|
|
2137
2137
|
/* @__PURE__ */ n("div", { className: "q1-verification-code__slots", "aria-hidden": "true", children: Array.from({ length: d ? 7 : 6 }, ($, R) => {
|
|
2138
2138
|
if (d && R === 3) return /* @__PURE__ */ n("span", { className: "q1-verification-code__separator", children: "−" }, "separator");
|
|
2139
|
-
const
|
|
2139
|
+
const V = d && R > 3 ? R - 1 : R;
|
|
2140
2140
|
return /* @__PURE__ */ n(
|
|
2141
2141
|
"span",
|
|
2142
2142
|
{
|
|
2143
2143
|
className: "form-control q1-verification-code__slot",
|
|
2144
|
-
"data-code-slot":
|
|
2145
|
-
"data-active":
|
|
2146
|
-
"data-selected":
|
|
2147
|
-
"data-empty": !B[
|
|
2148
|
-
children: B[
|
|
2144
|
+
"data-code-slot": V,
|
|
2145
|
+
"data-active": V === Math.min(T.backward ? T.start : T.end, B.length, 5) || void 0,
|
|
2146
|
+
"data-selected": V >= T.start && V < T.end || void 0,
|
|
2147
|
+
"data-empty": !B[V] || void 0,
|
|
2148
|
+
children: B[V] ?? ""
|
|
2149
2149
|
},
|
|
2150
|
-
|
|
2150
|
+
V
|
|
2151
2151
|
);
|
|
2152
2152
|
}) }),
|
|
2153
2153
|
/* @__PURE__ */ n(
|
|
@@ -2170,30 +2170,30 @@ function su({
|
|
|
2170
2170
|
errorId: fn(c, w, Y, g === void 0 && E ? Z : void 0),
|
|
2171
2171
|
"aria-label": _,
|
|
2172
2172
|
"aria-labelledby": C,
|
|
2173
|
-
onFocus: ($) =>
|
|
2174
|
-
onSelect: ($) =>
|
|
2173
|
+
onFocus: ($) => ne($.currentTarget),
|
|
2174
|
+
onSelect: ($) => ne($.currentTarget),
|
|
2175
2175
|
onPointerDown: ($) => {
|
|
2176
2176
|
if (M.current = $.pointerType, $.pointerType !== "mouse" || $.button !== 0 || $.shiftKey || O.current) return;
|
|
2177
2177
|
$.preventDefault();
|
|
2178
2178
|
const R = $.currentTarget;
|
|
2179
2179
|
R.focus();
|
|
2180
|
-
const
|
|
2181
|
-
K.current =
|
|
2180
|
+
const V = te(R, $.clientX);
|
|
2181
|
+
K.current = V, R.setPointerCapture($.pointerId), R.setSelectionRange(V, Math.min(V + 1, r.length)), ne(R);
|
|
2182
2182
|
},
|
|
2183
2183
|
onPointerMove: ($) => {
|
|
2184
2184
|
const R = K.current;
|
|
2185
2185
|
if (R === null) return;
|
|
2186
|
-
const
|
|
2187
|
-
$.currentTarget.setSelectionRange(Math.min(R,
|
|
2186
|
+
const V = te($.currentTarget, $.clientX);
|
|
2187
|
+
$.currentTarget.setSelectionRange(Math.min(R, V), Math.min(Math.max(R, V) + 1, r.length), V < R ? "backward" : "forward"), ne($.currentTarget);
|
|
2188
2188
|
},
|
|
2189
2189
|
onClick: ($) => {
|
|
2190
2190
|
const R = $.currentTarget;
|
|
2191
2191
|
if (M.current === "mouse" || !$.detail || O.current || R.selectionStart !== R.selectionEnd) return;
|
|
2192
|
-
const
|
|
2193
|
-
R.setSelectionRange(
|
|
2192
|
+
const V = te(R, $.clientX);
|
|
2193
|
+
R.setSelectionRange(V, Math.min(V + 1, r.length)), ne(R);
|
|
2194
2194
|
},
|
|
2195
2195
|
onDoubleClick: ($) => {
|
|
2196
|
-
O.current || ($.currentTarget.select(),
|
|
2196
|
+
O.current || ($.currentTarget.select(), ne($.currentTarget));
|
|
2197
2197
|
},
|
|
2198
2198
|
onPointerUp: () => {
|
|
2199
2199
|
K.current = null;
|
|
@@ -2205,7 +2205,7 @@ function su({
|
|
|
2205
2205
|
O.current = !0, P($.currentTarget.value);
|
|
2206
2206
|
},
|
|
2207
2207
|
onCompositionEnd: ($) => {
|
|
2208
|
-
O.current = !1, L.current = $.currentTarget.value, P(null),
|
|
2208
|
+
O.current = !1, L.current = $.currentTarget.value, P(null), z($.currentTarget.value, $.currentTarget.selectionStart ?? r.length);
|
|
2209
2209
|
},
|
|
2210
2210
|
onChange: ($) => {
|
|
2211
2211
|
const R = $.currentTarget.value;
|
|
@@ -2217,19 +2217,19 @@ function su({
|
|
|
2217
2217
|
L.current = null;
|
|
2218
2218
|
return;
|
|
2219
2219
|
}
|
|
2220
|
-
L.current = null,
|
|
2220
|
+
L.current = null, z(R, $.currentTarget.selectionStart ?? R.length);
|
|
2221
2221
|
},
|
|
2222
2222
|
onPaste: ($) => {
|
|
2223
2223
|
if ($.preventDefault(), i || a || O.current) return;
|
|
2224
2224
|
const R = $.clipboardData.getData("text").trim();
|
|
2225
2225
|
if (!R) return;
|
|
2226
|
-
const
|
|
2227
|
-
if (!/^[0-9]{1,6}$/.test(
|
|
2226
|
+
const V = R.replace(/^([0-9]{3})[\s-]+([0-9]{3})$/, "$1$2");
|
|
2227
|
+
if (!/^[0-9]{1,6}$/.test(V)) {
|
|
2228
2228
|
x("请粘贴 6 位数字验证码。");
|
|
2229
2229
|
return;
|
|
2230
2230
|
}
|
|
2231
|
-
const J = $.currentTarget.selectionStart ?? r.length, F = $.currentTarget.selectionEnd ?? J, W =
|
|
2232
|
-
|
|
2231
|
+
const J = $.currentTarget.selectionStart ?? r.length, F = $.currentTarget.selectionEnd ?? J, W = V.length === 6 ? V : r.slice(0, J) + V + r.slice(F);
|
|
2232
|
+
z(W, V.length === 6 ? 6 : J + V.length);
|
|
2233
2233
|
}
|
|
2234
2234
|
}
|
|
2235
2235
|
)
|
|
@@ -2964,24 +2964,24 @@ function Ze({
|
|
|
2964
2964
|
const [N, D] = j(null), T = A(_), S = A(C), k = A(w), P = A(v), E = A(!1), x = A(null), M = A(null), K = A(null);
|
|
2965
2965
|
T.current = _, S.current = C, k.current = w, P.current = v, Lt(() => {
|
|
2966
2966
|
if (!t || typeof document > "u") return;
|
|
2967
|
-
const Y = document,
|
|
2968
|
-
return D(
|
|
2967
|
+
const Y = document, ne = un(Y);
|
|
2968
|
+
return D(ne), () => {
|
|
2969
2969
|
dn(Y), D(null);
|
|
2970
2970
|
};
|
|
2971
2971
|
}, [t]), qt(d, m, t);
|
|
2972
|
-
const O = ve((Y,
|
|
2972
|
+
const O = ve((Y, ne, z) => {
|
|
2973
2973
|
const te = S.current;
|
|
2974
|
-
if (te && (
|
|
2975
|
-
|
|
2974
|
+
if (te && (z.isComposing || z.keyCode === 229) || (te?.(z), te && z.defaultPrevented)) return !1;
|
|
2975
|
+
z.preventDefault();
|
|
2976
2976
|
const q = k.current;
|
|
2977
2977
|
return q ? q.busy || E.current ? !1 : (E.current = !0, queueMicrotask(() => {
|
|
2978
2978
|
E.current = !1;
|
|
2979
|
-
}), q.runAction(), !0) : (At(Y,
|
|
2979
|
+
}), q.runAction(), !0) : (At(Y, ne, "escape"), !0);
|
|
2980
2980
|
}, []), L = ve(() => {
|
|
2981
2981
|
if (!e || typeof document > "u") return;
|
|
2982
|
-
const Y = document,
|
|
2983
|
-
x.current =
|
|
2984
|
-
const
|
|
2982
|
+
const Y = document, ne = Y.activeElement;
|
|
2983
|
+
x.current = ne instanceof HTMLElement && ne !== Y.body ? ne : null;
|
|
2984
|
+
const z = {
|
|
2985
2985
|
id: I.current,
|
|
2986
2986
|
blocking: r,
|
|
2987
2987
|
escape: o,
|
|
@@ -2989,52 +2989,52 @@ function Ze({
|
|
|
2989
2989
|
getContainer: () => m.current,
|
|
2990
2990
|
onClose: (F) => T.current?.(F)
|
|
2991
2991
|
};
|
|
2992
|
-
M.current =
|
|
2993
|
-
const te = St(Y,
|
|
2992
|
+
M.current = z;
|
|
2993
|
+
const te = St(Y, z);
|
|
2994
2994
|
function q(F, W) {
|
|
2995
2995
|
return !(F instanceof Node && (W?.contains(F) || l?.current?.contains(F) || c?.(F)));
|
|
2996
2996
|
}
|
|
2997
2997
|
function $(F) {
|
|
2998
|
-
if (s && (F.defaultPrevented || !We(Y,
|
|
2999
|
-
if (F.key === "Tab" && !
|
|
3000
|
-
ar(F, Y,
|
|
2998
|
+
if (s && (F.defaultPrevented || !We(Y, z.id))) return;
|
|
2999
|
+
if (F.key === "Tab" && !z.getContainer()?.contains(Y.activeElement)) {
|
|
3000
|
+
ar(F, Y, z);
|
|
3001
3001
|
return;
|
|
3002
3002
|
}
|
|
3003
|
-
if (F.key !== "Escape" || !We(Y,
|
|
3003
|
+
if (F.key !== "Escape" || !We(Y, z.id) || z.getContainer()?.contains(Y.activeElement)) return;
|
|
3004
3004
|
const ie = k.current;
|
|
3005
|
-
if (!(ie ? ie.busy || E.current : !
|
|
3005
|
+
if (!(ie ? ie.busy || E.current : !z.escape)) {
|
|
3006
3006
|
if (s) {
|
|
3007
3007
|
queueMicrotask(() => {
|
|
3008
|
-
!F.defaultPrevented && We(Y,
|
|
3008
|
+
!F.defaultPrevented && We(Y, z.id) && O(Y, z, F);
|
|
3009
3009
|
});
|
|
3010
3010
|
return;
|
|
3011
3011
|
}
|
|
3012
|
-
O(Y,
|
|
3012
|
+
O(Y, z, F);
|
|
3013
3013
|
}
|
|
3014
3014
|
}
|
|
3015
3015
|
function R(F) {
|
|
3016
3016
|
if (a === "down") {
|
|
3017
|
-
We(Y,
|
|
3017
|
+
We(Y, z.id) && z.outsidePointer && q(F.target, z.getContainer()) && At(Y, z, "outside-pointer");
|
|
3018
3018
|
return;
|
|
3019
3019
|
}
|
|
3020
3020
|
K.current || (K.current = { pointerId: F.pointerId, target: F.target });
|
|
3021
3021
|
}
|
|
3022
|
-
function
|
|
3022
|
+
function V(F) {
|
|
3023
3023
|
const W = K.current;
|
|
3024
|
-
if (!W || W.pointerId !== F.pointerId || (K.current = null, !We(Y,
|
|
3025
|
-
const ie =
|
|
3026
|
-
H &&
|
|
3024
|
+
if (!W || W.pointerId !== F.pointerId || (K.current = null, !We(Y, z.id) || !z.outsidePointer)) return;
|
|
3025
|
+
const ie = z.getContainer(), H = q(W.target, ie), re = q(F.target, ie);
|
|
3026
|
+
H && re && At(Y, z, "outside-pointer");
|
|
3027
3027
|
}
|
|
3028
3028
|
function J(F) {
|
|
3029
3029
|
K.current?.pointerId === F.pointerId && (K.current = null);
|
|
3030
3030
|
}
|
|
3031
|
-
return Y.addEventListener("keydown", $), Y.addEventListener("pointerdown", R, !0), Y.addEventListener("pointerup",
|
|
3032
|
-
const F = P.current && We(Y,
|
|
3033
|
-
Y.removeEventListener("keydown", $), Y.removeEventListener("pointerdown", R, !0), Y.removeEventListener("pointerup",
|
|
3031
|
+
return Y.addEventListener("keydown", $), Y.addEventListener("pointerdown", R, !0), Y.addEventListener("pointerup", V, !0), Y.addEventListener("pointercancel", J, !0), () => {
|
|
3032
|
+
const F = P.current && We(Y, z.id);
|
|
3033
|
+
Y.removeEventListener("keydown", $), Y.removeEventListener("pointerdown", R, !0), Y.removeEventListener("pointerup", V, !0), Y.removeEventListener("pointercancel", J, !0), K.current = null, te(), M.current = null;
|
|
3034
3034
|
const W = x.current, ie = yn.get(Y) ?? [];
|
|
3035
3035
|
if (P.current && W && (ie.push(W), yn.set(Y, ie), queueMicrotask(() => yn.delete(Y))), F) {
|
|
3036
|
-
const
|
|
3037
|
-
|
|
3036
|
+
const re = [Y.activeElement instanceof HTMLElement && Y.activeElement !== Y.body && !m.current?.contains(Y.activeElement) ? Y.activeElement : null, W, ...ie, ...y?.() ?? []].find(hn);
|
|
3037
|
+
re && re.focus(), (!re || Y.activeElement !== re) && !ka(Y) && ss(Y);
|
|
3038
3038
|
}
|
|
3039
3039
|
x.current = null;
|
|
3040
3040
|
};
|
|
@@ -3055,21 +3055,24 @@ function Ze({
|
|
|
3055
3055
|
!e || !h || g !== "layout" || vn(m.current, f);
|
|
3056
3056
|
}, [m, h, f, g, e, N]), se(() => {
|
|
3057
3057
|
if (!e || !h || g !== "deferred") return;
|
|
3058
|
-
const Y = window.setTimeout(() =>
|
|
3058
|
+
const Y = window.setTimeout(() => {
|
|
3059
|
+
const ne = m.current, z = document.activeElement;
|
|
3060
|
+
z !== ne && z !== document.body && ne?.contains(z) || vn(ne, f);
|
|
3061
|
+
}, 0);
|
|
3059
3062
|
return () => window.clearTimeout(Y);
|
|
3060
3063
|
}, [m, h, f, g, e, N]);
|
|
3061
3064
|
const G = ve((Y) => {
|
|
3062
3065
|
if (s && Y.defaultPrevented) return;
|
|
3063
|
-
const
|
|
3064
|
-
if (!(!
|
|
3066
|
+
const ne = M.current;
|
|
3067
|
+
if (!(!ne || typeof document > "u")) {
|
|
3065
3068
|
if (Y.key === "Escape") {
|
|
3066
|
-
if (!We(document,
|
|
3067
|
-
const
|
|
3068
|
-
if (
|
|
3069
|
-
Y.stopPropagation(), O(document,
|
|
3069
|
+
if (!We(document, ne.id)) return;
|
|
3070
|
+
const z = k.current;
|
|
3071
|
+
if (z ? z.busy || E.current : !ne.escape) return;
|
|
3072
|
+
Y.stopPropagation(), O(document, ne, Y.nativeEvent), Y.preventDefault();
|
|
3070
3073
|
return;
|
|
3071
3074
|
}
|
|
3072
|
-
ar(Y, document,
|
|
3075
|
+
ar(Y, document, ne);
|
|
3073
3076
|
}
|
|
3074
3077
|
}, [O, s]), B = ve(() => {
|
|
3075
3078
|
if (typeof document > "u") return !1;
|
|
@@ -3079,8 +3082,8 @@ function Ze({
|
|
|
3079
3082
|
if (typeof document > "u") return !1;
|
|
3080
3083
|
const Y = M.current;
|
|
3081
3084
|
if (!Y || !We(document, Y.id)) return !1;
|
|
3082
|
-
const
|
|
3083
|
-
return
|
|
3085
|
+
const ne = Y.getContainer();
|
|
3086
|
+
return ne?.isConnected ? (vn(ne, f), ne.contains(document.activeElement)) : !1;
|
|
3084
3087
|
}, [f]), X = ve(
|
|
3085
3088
|
(Y) => N ? Tt(Y, N) : u ? null : Y,
|
|
3086
3089
|
[u, N]
|
|
@@ -3153,7 +3156,7 @@ function ct(e, t, r, o, i = {}) {
|
|
|
3153
3156
|
f((H) => H.align === ie.align && H.side === ie.side ? H : ie);
|
|
3154
3157
|
return;
|
|
3155
3158
|
}
|
|
3156
|
-
const Z = w.getBoundingClientRect().width, X = s === "center" ? L.left + (L.width - Z) / 2 : s === "end" ? L.right - Z : L.left, Y = s === "center" ? X : s === "end" ? L.left : L.right - Z,
|
|
3159
|
+
const Z = w.getBoundingClientRect().width, X = s === "center" ? L.left + (L.width - Z) / 2 : s === "end" ? L.right - Z : L.left, Y = s === "center" ? X : s === "end" ? L.left : L.right - Z, ne = X >= G && X + Z <= v.innerWidth - G, z = (ie) => Math.max(0, G - ie) + Math.max(0, ie + Z + G - v.innerWidth), te = !I && a === "content" && !ne && z(Y) < z(X) ? s === "end" ? "start" : "end" : s, q = te === "center" ? X : te === "end" ? L.right - Z : L.left, $ = I ? B : a === "content" ? G : 0, R = v.innerHeight - L.bottom - G - $, V = L.top - G - $, J = Math.min(w.scrollHeight, Number.isFinite(N) ? N : 1 / 0), F = I?.fixedSide ? i.side === "top" : vo(J, R, V, i.side === "top").above, W = Math.max(0, F ? V : R);
|
|
3157
3160
|
w.style.position = "fixed", w.style.left = `${Math.max(B, Math.min(q, v.innerWidth - Z - B))}px`, w.style.right = "auto", w.style.top = F ? "auto" : `${L.bottom + G}px`, w.style.bottom = F ? `${v.innerHeight - L.top + G}px` : "auto", w.style.maxHeight = `${Math.min(J, W)}px`, a === "content" && (w.style.overflowY = "auto"), w.style.visibility = "visible", f((ie) => ie.align === te && ie.side === (F ? "top" : "bottom") ? ie : { align: te, side: F ? "top" : "bottom" });
|
|
3158
3161
|
}
|
|
3159
3162
|
let S = 0, k = 0;
|
|
@@ -3218,7 +3221,7 @@ function hu({
|
|
|
3218
3221
|
ref: S,
|
|
3219
3222
|
...k
|
|
3220
3223
|
}) {
|
|
3221
|
-
const [P, E] = j(""), [x, M] = j(!1), [K, O] = j(0), L = A(null), G = A(null), B = t === "panel", Z = A(null), X = A(null), Y = A(!1),
|
|
3224
|
+
const [P, E] = j(""), [x, M] = j(!1), [K, O] = j(0), L = A(null), G = A(null), B = t === "panel", Z = A(null), X = A(null), Y = A(!1), ne = A(!1), z = A(!1), te = A(!1), [q, $] = j(), R = we(), V = `${R}-list`, J = `${R}-popup`, F = D ? void 0 : T ?? q, W = `${R}-err`, ie = `${R}-required`, H = i ?? "", re = H === "" ? void 0 : e.find((ee) => ee.value === H), U = !f && !g, le = x && U, { pressedIndex: ye, beginPress: he, cancelPress: Ce } = yo({
|
|
3222
3225
|
interactive: U,
|
|
3223
3226
|
isExpanded: le,
|
|
3224
3227
|
isLoading: l
|
|
@@ -3241,12 +3244,12 @@ function hu({
|
|
|
3241
3244
|
B ? G.current?.focus() : Z.current?.focus();
|
|
3242
3245
|
}
|
|
3243
3246
|
_e(() => {
|
|
3244
|
-
const ee =
|
|
3245
|
-
if (
|
|
3247
|
+
const ee = z.current && !le;
|
|
3248
|
+
if (z.current = le, !ee || !te.current) return;
|
|
3246
3249
|
const de = requestAnimationFrame(() => {
|
|
3247
3250
|
te.current = !1;
|
|
3248
3251
|
const Pe = document.activeElement;
|
|
3249
|
-
Pe !== document.body && Pe?.isConnected || (
|
|
3252
|
+
Pe !== document.body && Pe?.isConnected || (ne.current = !0, B ? G.current?.focus() : Z.current?.focus(), ne.current = !1);
|
|
3250
3253
|
});
|
|
3251
3254
|
return () => cancelAnimationFrame(de);
|
|
3252
3255
|
}, [le, B]), _e(() => {
|
|
@@ -3410,7 +3413,7 @@ function hu({
|
|
|
3410
3413
|
U && ["ArrowDown", "ArrowUp"].includes(ee.key) && (ee.preventDefault(), Ee());
|
|
3411
3414
|
},
|
|
3412
3415
|
children: [
|
|
3413
|
-
/* @__PURE__ */ n("span", { children:
|
|
3416
|
+
/* @__PURE__ */ n("span", { children: re?.label ?? c }),
|
|
3414
3417
|
/* @__PURE__ */ n(je, { size: 16, strokeWidth: oe, "aria-hidden": "true" })
|
|
3415
3418
|
]
|
|
3416
3419
|
}
|
|
@@ -3425,7 +3428,7 @@ function hu({
|
|
|
3425
3428
|
role: "combobox",
|
|
3426
3429
|
className: "combobox__input",
|
|
3427
3430
|
placeholder: c,
|
|
3428
|
-
value: le ? P :
|
|
3431
|
+
value: le ? P : re?.label ?? "",
|
|
3429
3432
|
disabled: f,
|
|
3430
3433
|
readOnly: g,
|
|
3431
3434
|
name: v,
|
|
@@ -3434,7 +3437,7 @@ function hu({
|
|
|
3434
3437
|
"aria-label": D,
|
|
3435
3438
|
"aria-labelledby": T,
|
|
3436
3439
|
"aria-expanded": le,
|
|
3437
|
-
"aria-controls":
|
|
3440
|
+
"aria-controls": V,
|
|
3438
3441
|
"aria-autocomplete": "list",
|
|
3439
3442
|
"aria-activedescendant": qe,
|
|
3440
3443
|
"aria-required": d || void 0,
|
|
@@ -3445,7 +3448,7 @@ function hu({
|
|
|
3445
3448
|
const de = ee.target.value, Pe = s || de === "" ? e : e.filter((Ie) => Ie.label.toLowerCase().includes(de.toLowerCase()));
|
|
3446
3449
|
s?.(de), E(de), O(fe(Pe)), M(!0);
|
|
3447
3450
|
},
|
|
3448
|
-
onFocus: () => U && !x && !
|
|
3451
|
+
onFocus: () => U && !x && !ne.current && Ee(),
|
|
3449
3452
|
onMouseDown: () => U && !x && Ee(),
|
|
3450
3453
|
onKeyDown: Ye
|
|
3451
3454
|
}
|
|
@@ -3490,7 +3493,7 @@ function hu({
|
|
|
3490
3493
|
"aria-label": D,
|
|
3491
3494
|
"aria-labelledby": F,
|
|
3492
3495
|
"aria-expanded": "true",
|
|
3493
|
-
"aria-controls":
|
|
3496
|
+
"aria-controls": V,
|
|
3494
3497
|
"aria-autocomplete": "list",
|
|
3495
3498
|
"aria-activedescendant": qe,
|
|
3496
3499
|
"aria-required": d || void 0,
|
|
@@ -3511,7 +3514,7 @@ function hu({
|
|
|
3511
3514
|
"ul",
|
|
3512
3515
|
{
|
|
3513
3516
|
className: "combobox__listbox",
|
|
3514
|
-
id:
|
|
3517
|
+
id: V,
|
|
3515
3518
|
role: "listbox",
|
|
3516
3519
|
"aria-label": c,
|
|
3517
3520
|
"aria-busy": l || void 0,
|
|
@@ -4176,17 +4179,17 @@ function xu({ sections: e, triggerLabel: t = "打开命令面板", hotkey: r })
|
|
|
4176
4179
|
"data-command-menu-active": Y ? "true" : void 0,
|
|
4177
4180
|
"data-command-menu-pointer-pressed": h === X ? "true" : void 0,
|
|
4178
4181
|
className: `command-palette__entry${Y ? " command-palette__entry--active" : ""}`,
|
|
4179
|
-
onPointerMove: (
|
|
4180
|
-
|
|
4182
|
+
onPointerMove: (ne) => {
|
|
4183
|
+
ne.pointerType !== "touch" && (p(!0), f(X));
|
|
4181
4184
|
},
|
|
4182
|
-
onPointerDown: (
|
|
4183
|
-
|
|
4185
|
+
onPointerDown: (ne) => {
|
|
4186
|
+
ne.isPrimary && ne.button === 0 && (p(!0), f(X), u(X));
|
|
4184
4187
|
},
|
|
4185
4188
|
onPointerUp: () => u(void 0),
|
|
4186
4189
|
onPointerCancel: () => u(void 0),
|
|
4187
4190
|
onPointerLeave: () => u(void 0),
|
|
4188
4191
|
onBlur: () => u(void 0),
|
|
4189
|
-
onMouseDown: (
|
|
4192
|
+
onMouseDown: (ne) => ne.preventDefault(),
|
|
4190
4193
|
onClick: () => K(B),
|
|
4191
4194
|
children: [
|
|
4192
4195
|
/* @__PURE__ */ n("span", { className: "command-palette__entry-label", children: B.label }),
|
|
@@ -4239,7 +4242,7 @@ function Cu({
|
|
|
4239
4242
|
const h = we(), u = `${h}-dialog`, y = `${h}-listbox`, _ = A(null), C = A(null), w = A(null), v = A(null), I = A(r), N = Te(
|
|
4240
4243
|
() => i.flatMap(
|
|
4241
4244
|
($, R) => $.items.flatMap(
|
|
4242
|
-
(
|
|
4245
|
+
(V, J) => V.disabled ? [] : [{ key: lr($.id, V.id), optionId: cr(h, R, J), sectionId: $.id, item: V }]
|
|
4243
4246
|
)
|
|
4244
4247
|
),
|
|
4245
4248
|
[h, i]
|
|
@@ -4250,7 +4253,7 @@ function Cu({
|
|
|
4250
4253
|
const $ = I.current !== r;
|
|
4251
4254
|
I.current = r, T((R) => {
|
|
4252
4255
|
if (e)
|
|
4253
|
-
return $ ? r.trim() ? N[0]?.key : void 0 : N.some((
|
|
4256
|
+
return $ ? r.trim() ? N[0]?.key : void 0 : N.some((V) => V.key === R) ? R : r.trim() ? N[0]?.key : void 0;
|
|
4254
4257
|
});
|
|
4255
4258
|
}, [N, e, r]), se(() => {
|
|
4256
4259
|
if (!e || !K) return;
|
|
@@ -4267,7 +4270,7 @@ function Cu({
|
|
|
4267
4270
|
function Z() {
|
|
4268
4271
|
k(!1), E(void 0), t(!1);
|
|
4269
4272
|
}
|
|
4270
|
-
const X = ve(() => [_.current], []), { onKeyDown: Y, portal:
|
|
4273
|
+
const X = ve(() => [_.current], []), { onKeyDown: Y, portal: ne } = Ze({
|
|
4271
4274
|
open: e,
|
|
4272
4275
|
blocking: !0,
|
|
4273
4276
|
containerRef: C,
|
|
@@ -4277,7 +4280,7 @@ function Cu({
|
|
|
4277
4280
|
onClose: Z,
|
|
4278
4281
|
onEscapeKeyDown: g
|
|
4279
4282
|
});
|
|
4280
|
-
function
|
|
4283
|
+
function z($) {
|
|
4281
4284
|
if (N.length === 0) return;
|
|
4282
4285
|
k(!1), E(void 0);
|
|
4283
4286
|
const R = M === -1 ? $ === 1 ? 0 : N.length - 1 : (M + $ + N.length) % N.length;
|
|
@@ -4290,13 +4293,13 @@ function Cu({
|
|
|
4290
4293
|
else if ($.key === "Tab") {
|
|
4291
4294
|
const R = [...C.current?.querySelectorAll(
|
|
4292
4295
|
"input, button, a[href], select, textarea, [tabindex]"
|
|
4293
|
-
) ?? []].filter((J) => J.tabIndex >= 0 && !J.matches(":disabled, [hidden]") && J.getClientRects().length > 0),
|
|
4294
|
-
if (
|
|
4296
|
+
) ?? []].filter((J) => J.tabIndex >= 0 && !J.matches(":disabled, [hidden]") && J.getClientRects().length > 0), V = R.findIndex((J) => J === document.activeElement);
|
|
4297
|
+
if (V !== -1) {
|
|
4295
4298
|
$.preventDefault();
|
|
4296
|
-
const J = $.shiftKey ? -1 : 1, F = (
|
|
4299
|
+
const J = $.shiftKey ? -1 : 1, F = (V + J + R.length) % R.length;
|
|
4297
4300
|
R[F]?.focus();
|
|
4298
4301
|
}
|
|
4299
|
-
} else $.target === v.current && ($.key === "ArrowDown" ? ($.preventDefault(),
|
|
4302
|
+
} else $.target === v.current && ($.key === "ArrowDown" ? ($.preventDefault(), z(1)) : $.key === "ArrowUp" ? ($.preventDefault(), z(-1)) : $.key === "Home" && N.length > 0 ? ($.preventDefault(), k(!1), E(void 0), T(N[0].key)) : $.key === "End" && N.length > 0 ? ($.preventDefault(), k(!1), E(void 0), T(N[N.length - 1].key)) : $.key === "Enter" && K && ($.preventDefault(), a(K.item)));
|
|
4300
4303
|
}
|
|
4301
4304
|
const q = s({
|
|
4302
4305
|
ref: B,
|
|
@@ -4308,7 +4311,7 @@ function Cu({
|
|
|
4308
4311
|
});
|
|
4309
4312
|
return /* @__PURE__ */ b(ke, { children: [
|
|
4310
4313
|
/* @__PURE__ */ n("span", { className: "search-dialog__trigger", children: q }),
|
|
4311
|
-
e ?
|
|
4314
|
+
e ? ne(
|
|
4312
4315
|
/* @__PURE__ */ b("div", { className: "search-dialog", children: [
|
|
4313
4316
|
/* @__PURE__ */ n(
|
|
4314
4317
|
"button",
|
|
@@ -4381,23 +4384,23 @@ function Cu({
|
|
|
4381
4384
|
L ? /* @__PURE__ */ n("div", { id: y, role: "listbox", "aria-label": l, "aria-owns": G.join(" ") || void 0 }) : null,
|
|
4382
4385
|
O > 0 || L ? i.map(($, R) => {
|
|
4383
4386
|
if ($.items.length === 0 && !ot($.status)) return null;
|
|
4384
|
-
const
|
|
4387
|
+
const V = `${h}-section-${R}`;
|
|
4385
4388
|
return /* @__PURE__ */ Zt(L ? "div" : Ve, { ...L ? { className: "search-dialog__section" } : {}, key: $.id }, /* @__PURE__ */ b(
|
|
4386
4389
|
"div",
|
|
4387
4390
|
{
|
|
4388
4391
|
className: "search-dialog__group",
|
|
4389
4392
|
id: L ? `${h}-group-${R}` : void 0,
|
|
4390
4393
|
role: $.items.length > 0 ? "group" : void 0,
|
|
4391
|
-
"aria-labelledby": $.items.length > 0 && $.heading ?
|
|
4394
|
+
"aria-labelledby": $.items.length > 0 && $.heading ? V : void 0,
|
|
4392
4395
|
children: [
|
|
4393
|
-
$.heading ? /* @__PURE__ */ n("div", { className: "search-dialog__heading", id:
|
|
4396
|
+
$.heading ? /* @__PURE__ */ n("div", { className: "search-dialog__heading", id: V, children: $.heading }) : null,
|
|
4394
4397
|
$.items.map((F, W) => {
|
|
4395
|
-
const ie = lr($.id, F.id), H = K?.key === ie,
|
|
4398
|
+
const ie = lr($.id, F.id), H = K?.key === ie, re = ot(F.icon) || ot(F.suffix) || !!F.keybind, U = re ? "span" : Ve;
|
|
4396
4399
|
return /* @__PURE__ */ b(
|
|
4397
4400
|
"button",
|
|
4398
4401
|
{
|
|
4399
4402
|
type: "button",
|
|
4400
|
-
className: `search-dialog__option${H ? " search-dialog__option--active" : ""}${F.disabled ? " search-dialog__option--disabled" : ""}${
|
|
4403
|
+
className: `search-dialog__option${H ? " search-dialog__option--active" : ""}${F.disabled ? " search-dialog__option--disabled" : ""}${re ? " search-dialog__option--slots" : ""}`,
|
|
4401
4404
|
id: cr(h, R, W),
|
|
4402
4405
|
role: "option",
|
|
4403
4406
|
"aria-selected": H,
|
|
@@ -4423,7 +4426,7 @@ function Cu({
|
|
|
4423
4426
|
onClick: () => !F.disabled && a(F),
|
|
4424
4427
|
children: [
|
|
4425
4428
|
ot(F.icon) ? /* @__PURE__ */ n("span", { className: "search-dialog__option-icon", "aria-hidden": "true", children: F.icon }) : null,
|
|
4426
|
-
/* @__PURE__ */ b(U, { ...
|
|
4429
|
+
/* @__PURE__ */ b(U, { ...re ? { className: "search-dialog__option-copy" } : {}, children: [
|
|
4427
4430
|
/* @__PURE__ */ n("span", { className: "search-dialog__option-label", children: F.label }),
|
|
4428
4431
|
F.description ? /* @__PURE__ */ n("span", { className: "search-dialog__option-description", children: F.description }) : null
|
|
4429
4432
|
] }),
|
|
@@ -5124,8 +5127,8 @@ function Su({
|
|
|
5124
5127
|
if (r || !s) return;
|
|
5125
5128
|
function $(R) {
|
|
5126
5129
|
if (R.key !== "Escape") return;
|
|
5127
|
-
const
|
|
5128
|
-
|
|
5130
|
+
const V = document.activeElement;
|
|
5131
|
+
V !== y.current && !_.current?.contains(V) || (R.preventDefault(), O("keyboard"));
|
|
5129
5132
|
}
|
|
5130
5133
|
return document.addEventListener("keydown", $), () => document.removeEventListener("keydown", $);
|
|
5131
5134
|
}, [r, s]), se(() => {
|
|
@@ -5144,10 +5147,10 @@ function Su({
|
|
|
5144
5147
|
M || G({ rating: $ });
|
|
5145
5148
|
}
|
|
5146
5149
|
function Z($, R) {
|
|
5147
|
-
const
|
|
5148
|
-
if (!
|
|
5150
|
+
const V = $.key === "ArrowRight" || $.key === "ArrowDown", J = $.key === "ArrowLeft" || $.key === "ArrowUp";
|
|
5151
|
+
if (!V && !J) return;
|
|
5149
5152
|
$.preventDefault();
|
|
5150
|
-
const F = (R + (
|
|
5153
|
+
const F = (R + (V ? 1 : pt.length - 1)) % pt.length;
|
|
5151
5154
|
B(pt[F].value), w.current[F]?.focus();
|
|
5152
5155
|
}
|
|
5153
5156
|
async function X($) {
|
|
@@ -5157,19 +5160,19 @@ function Su({
|
|
|
5157
5160
|
u({ type: "validation-error" }), w.current[0]?.focus();
|
|
5158
5161
|
return;
|
|
5159
5162
|
}
|
|
5160
|
-
const
|
|
5161
|
-
I.current =
|
|
5163
|
+
const V = I.current + 1;
|
|
5164
|
+
I.current = V, N.current = !0;
|
|
5162
5165
|
const J = T.current;
|
|
5163
|
-
T.current = "keyboard", C.current?.focus(), u({ type: "submit-start", submissionId:
|
|
5166
|
+
T.current = "keyboard", C.current?.focus(), u({ type: "submit-start", submissionId: V });
|
|
5164
5167
|
try {
|
|
5165
|
-
if (await i(R), !D.current || I.current !==
|
|
5166
|
-
N.current = !1, u({ type: "submit-success", submissionId:
|
|
5168
|
+
if (await i(R), !D.current || I.current !== V) return;
|
|
5169
|
+
N.current = !1, u({ type: "submit-success", submissionId: V }), r || O(J, !1);
|
|
5167
5170
|
} catch {
|
|
5168
|
-
if (!D.current || I.current !==
|
|
5169
|
-
N.current = !1, u({ type: "submit-error", submissionId:
|
|
5171
|
+
if (!D.current || I.current !== V) return;
|
|
5172
|
+
N.current = !1, u({ type: "submit-error", submissionId: V });
|
|
5170
5173
|
}
|
|
5171
5174
|
}
|
|
5172
|
-
const Y = pt.findIndex(($) => $.value === h.draft.rating),
|
|
5175
|
+
const Y = pt.findIndex(($) => $.value === h.draft.rating), ne = Y === -1 ? 0 : Y, z = i ? h.error === "validation" ? "请选择评分或填写反馈" : h.error === "submission" ? "无法发送反馈,请重试。" : h.status === "success" ? "已收到反馈" : "" : "暂时无法发送反馈。", te = /* @__PURE__ */ b(
|
|
5173
5176
|
"form",
|
|
5174
5177
|
{
|
|
5175
5178
|
ref: _,
|
|
@@ -5178,7 +5181,7 @@ function Su({
|
|
|
5178
5181
|
"data-state": s ? "open" : "closed",
|
|
5179
5182
|
"data-motion": d,
|
|
5180
5183
|
"aria-busy": x || void 0,
|
|
5181
|
-
"aria-describedby":
|
|
5184
|
+
"aria-describedby": z && h.status !== "success" ? P : void 0,
|
|
5182
5185
|
inert: !r && !s,
|
|
5183
5186
|
onSubmit: X,
|
|
5184
5187
|
onTransitionEnd: ($) => {
|
|
@@ -5190,7 +5193,7 @@ function Su({
|
|
|
5190
5193
|
children: [
|
|
5191
5194
|
/* @__PURE__ */ b("div", { className: "feedback__head", children: [
|
|
5192
5195
|
/* @__PURE__ */ n("span", { className: "q1-sr-only", id: k, children: t }),
|
|
5193
|
-
/* @__PURE__ */ n("div", { className: "feedback__emotions", role: "radiogroup", "aria-labelledby": k, children: pt.map(({ value: $, label: R, Icon:
|
|
5196
|
+
/* @__PURE__ */ n("div", { className: "feedback__emotions", role: "radiogroup", "aria-labelledby": k, children: pt.map(({ value: $, label: R, Icon: V }, J) => /* @__PURE__ */ n(
|
|
5194
5197
|
"button",
|
|
5195
5198
|
{
|
|
5196
5199
|
ref: (F) => {
|
|
@@ -5202,7 +5205,7 @@ function Su({
|
|
|
5202
5205
|
"aria-label": R,
|
|
5203
5206
|
"aria-checked": h.draft.rating === $,
|
|
5204
5207
|
"data-pointer-pressed": g === $ || void 0,
|
|
5205
|
-
tabIndex: J ===
|
|
5208
|
+
tabIndex: J === ne ? 0 : -1,
|
|
5206
5209
|
disabled: M,
|
|
5207
5210
|
onPointerDown: () => {
|
|
5208
5211
|
M || p($);
|
|
@@ -5212,7 +5215,7 @@ function Su({
|
|
|
5212
5215
|
onPointerLeave: () => p(null),
|
|
5213
5216
|
onClick: () => B($),
|
|
5214
5217
|
onKeyDown: (F) => Z(F, J),
|
|
5215
|
-
children: /* @__PURE__ */ n(
|
|
5218
|
+
children: /* @__PURE__ */ n(V, { size: 16, strokeWidth: oe, "aria-hidden": "true" })
|
|
5216
5219
|
},
|
|
5217
5220
|
$
|
|
5218
5221
|
)) })
|
|
@@ -5260,7 +5263,7 @@ function Su({
|
|
|
5260
5263
|
role: h.status === "error" ? "alert" : void 0,
|
|
5261
5264
|
"aria-live": h.status === "error" ? "assertive" : void 0,
|
|
5262
5265
|
"aria-hidden": h.status === "success" || void 0,
|
|
5263
|
-
children:
|
|
5266
|
+
children: z
|
|
5264
5267
|
}
|
|
5265
5268
|
),
|
|
5266
5269
|
/* @__PURE__ */ b(
|
|
@@ -6580,7 +6583,7 @@ function Gs({
|
|
|
6580
6583
|
), B = Te(
|
|
6581
6584
|
() => G.filter((U) => !U.disabled && U.id !== i),
|
|
6582
6585
|
[G, i]
|
|
6583
|
-
), Z = O.selectedId, X = B.some((U) => U.id === w.activeId) ? w.activeId : B.find((U) => U.id === Z)?.id ?? B[0]?.id ?? null, Y = (L ? O.search?.noResults : O.emptyState ?? O.search?.noResults) ?? { title: "没有可用选项" },
|
|
6586
|
+
), Z = O.selectedId, X = B.some((U) => U.id === w.activeId) ? w.activeId : B.find((U) => U.id === Z)?.id ?? B[0]?.id ?? null, Y = (L ? O.search?.noResults : O.emptyState ?? O.search?.noResults) ?? { title: "没有可用选项" }, ne = `${G.length} 个结果`, z = o.items.filter(
|
|
6584
6587
|
(U) => !U.disabled && U.id !== i
|
|
6585
6588
|
).length > 1;
|
|
6586
6589
|
se(() => () => window.clearTimeout(x.current.timer), []), se(() => {
|
|
@@ -6599,8 +6602,8 @@ function Gs({
|
|
|
6599
6602
|
if (!f || P.current) return;
|
|
6600
6603
|
P.current = !0;
|
|
6601
6604
|
const U = B.find((le) => le.id === Z) ?? B[0];
|
|
6602
|
-
U ? N.current[U.id]?.focus() :
|
|
6603
|
-
}, [
|
|
6605
|
+
U ? N.current[U.id]?.focus() : z ? D.current?.focus() : S.current?.focus();
|
|
6606
|
+
}, [z, B, f, Z]), Nn(() => {
|
|
6604
6607
|
E.current !== w.view && (E.current = w.view, w.view === "scope" ? T.current?.focus() : D.current?.focus());
|
|
6605
6608
|
}, [w.view]);
|
|
6606
6609
|
function te(U) {
|
|
@@ -6642,7 +6645,7 @@ function Gs({
|
|
|
6642
6645
|
te(le?.id ?? null);
|
|
6643
6646
|
}
|
|
6644
6647
|
}
|
|
6645
|
-
function
|
|
6648
|
+
function V(U) {
|
|
6646
6649
|
if (U.nativeEvent.isComposing || U.keyCode === 229) return;
|
|
6647
6650
|
const ye = U.target.matches('input, textarea, select, [contenteditable="true"]'), he = U.key === "/" || U.key.toLowerCase() === "k" && (U.metaKey || U.ctrlKey);
|
|
6648
6651
|
if (O.search && !ye && he && !U.nativeEvent.isComposing && U.keyCode !== 229) {
|
|
@@ -6655,7 +6658,7 @@ function Gs({
|
|
|
6655
6658
|
}
|
|
6656
6659
|
if (U.key !== "Tab") return;
|
|
6657
6660
|
const Me = [
|
|
6658
|
-
w.view === "primary" &&
|
|
6661
|
+
w.view === "primary" && z ? D.current : T.current,
|
|
6659
6662
|
I.current,
|
|
6660
6663
|
X ? N.current[X] : null,
|
|
6661
6664
|
...w.view === "primary" ? (s ?? []).map((Ne) => Us(g.current, Ne.id)) : []
|
|
@@ -6679,7 +6682,7 @@ function Gs({
|
|
|
6679
6682
|
l(U, r);
|
|
6680
6683
|
}
|
|
6681
6684
|
}
|
|
6682
|
-
const F = o.items.find((U) => U.id === o.selectedId), W = F?.label ?? e, ie = F?.textValue ?? t, H = d ?? t,
|
|
6685
|
+
const F = o.items.find((U) => U.id === o.selectedId), W = F?.label ?? e, ie = F?.textValue ?? t, H = d ?? t, re = /* @__PURE__ */ b(ke, { children: [
|
|
6683
6686
|
F?.avatar ? /* @__PURE__ */ n("span", { className: "q1-context-switcher__avatar", "aria-hidden": "true", children: F.avatar }) : null,
|
|
6684
6687
|
/* @__PURE__ */ b("span", { className: "q1-context-switcher__item-content", children: [
|
|
6685
6688
|
/* @__PURE__ */ n("span", { className: "q1-context-switcher__item-label", children: W }),
|
|
@@ -6700,11 +6703,11 @@ function Gs({
|
|
|
6700
6703
|
"data-side": y.side,
|
|
6701
6704
|
"data-open-modality": _,
|
|
6702
6705
|
style: { left: y.left, top: y.top },
|
|
6703
|
-
onKeyDown:
|
|
6706
|
+
onKeyDown: V,
|
|
6704
6707
|
children: [
|
|
6705
6708
|
/* @__PURE__ */ n("h2", { ref: S, id: M, className: "q1-sr-only", tabIndex: -1, children: H }),
|
|
6706
6709
|
/* @__PURE__ */ b("div", { className: "q1-context-switcher__groups", children: [
|
|
6707
|
-
w.view === "primary" &&
|
|
6710
|
+
w.view === "primary" && z ? /* @__PURE__ */ b(
|
|
6708
6711
|
"button",
|
|
6709
6712
|
{
|
|
6710
6713
|
ref: D,
|
|
@@ -6715,11 +6718,11 @@ function Gs({
|
|
|
6715
6718
|
...tt(!1),
|
|
6716
6719
|
onClick: () => v({ type: "openScope" }),
|
|
6717
6720
|
children: [
|
|
6718
|
-
|
|
6721
|
+
re,
|
|
6719
6722
|
/* @__PURE__ */ n(Ke, { className: "q1-context-switcher__chevron", size: 16, strokeWidth: oe, "aria-hidden": "true" })
|
|
6720
6723
|
]
|
|
6721
6724
|
}
|
|
6722
|
-
) : w.view === "primary" ? /* @__PURE__ */ n("div", { className: "q1-context-switcher__scope-summary", "data-context-scope-summary": !0, children:
|
|
6725
|
+
) : w.view === "primary" ? /* @__PURE__ */ n("div", { className: "q1-context-switcher__scope-summary", "data-context-scope-summary": !0, children: re }) : /* @__PURE__ */ b(
|
|
6723
6726
|
"button",
|
|
6724
6727
|
{
|
|
6725
6728
|
ref: T,
|
|
@@ -6794,7 +6797,7 @@ function Gs({
|
|
|
6794
6797
|
Y.description ? /* @__PURE__ */ n("div", { className: "q1-context-switcher__empty-description", children: Y.description }) : null
|
|
6795
6798
|
] }),
|
|
6796
6799
|
/* @__PURE__ */ n("span", { className: "q1-sr-only", "aria-live": "polite", children: i ? "正在处理所选上下文" : "" }),
|
|
6797
|
-
/* @__PURE__ */ n("span", { className: "q1-sr-only", "aria-live": "polite", "data-context-result-status": !0, children:
|
|
6800
|
+
/* @__PURE__ */ n("span", { className: "q1-sr-only", "aria-live": "polite", "data-context-result-status": !0, children: ne }),
|
|
6798
6801
|
a ? /* @__PURE__ */ n("div", { ref: h, className: "q1-context-switcher__error", role: "alert", children: a }) : null
|
|
6799
6802
|
] }),
|
|
6800
6803
|
w.view === "primary" && s?.length ? /* @__PURE__ */ n("div", { className: "q1-context-switcher__footer", children: s.map((U) => /* @__PURE__ */ b(
|
|
@@ -7245,7 +7248,7 @@ function ol({
|
|
|
7245
7248
|
const v = `${p}-title`, I = (q) => `${p}-${encodeURIComponent(q)}-label`, [N, D] = j({}), T = A([]), S = ve(() => {
|
|
7246
7249
|
T.current.forEach((q) => q.cancel()), T.current = [];
|
|
7247
7250
|
}, []), k = Te(() => o.map((q) => {
|
|
7248
|
-
const $ = So(N[q.id] ?? ""), R = $ ? q.items.filter((
|
|
7251
|
+
const $ = So(N[q.id] ?? ""), R = $ ? q.items.filter((V) => rl(V, $)) : q.items;
|
|
7249
7252
|
return {
|
|
7250
7253
|
group: q,
|
|
7251
7254
|
query: $,
|
|
@@ -7295,10 +7298,10 @@ function ol({
|
|
|
7295
7298
|
}, [G, x, c, d, f, K]), _r(() => {
|
|
7296
7299
|
const q = f.current, $ = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
7297
7300
|
if (!c || !d || !q || m !== "pointer" || $.matches) return;
|
|
7298
|
-
const R = getComputedStyle(q),
|
|
7301
|
+
const R = getComputedStyle(q), V = (ie) => {
|
|
7299
7302
|
const H = R.getPropertyValue(ie).trim();
|
|
7300
7303
|
return parseFloat(H) * (H.endsWith("ms") ? 1 : 1e3);
|
|
7301
|
-
}, J =
|
|
7304
|
+
}, J = V("--q1-duration-fast"), F = Math.min(V("--q1-duration-press"), J);
|
|
7302
7305
|
if (!Number.isFinite(F) || !Number.isFinite(J) || F <= 0) return;
|
|
7303
7306
|
const W = (J - F) / 2;
|
|
7304
7307
|
return T.current = [...q.querySelectorAll(".q1-context-switcher__item")].map(
|
|
@@ -7315,10 +7318,10 @@ function ol({
|
|
|
7315
7318
|
$.removeEventListener("change", S), S();
|
|
7316
7319
|
};
|
|
7317
7320
|
}, [S, c, m, f, d]);
|
|
7318
|
-
function
|
|
7321
|
+
function ne(q) {
|
|
7319
7322
|
if (S(), Y.openKey && q.key !== "Escape" && Y.close(!1), w(q), !(q.defaultPrevented || q.key === "Escape")) {
|
|
7320
7323
|
if (q.key === "Tab") {
|
|
7321
|
-
const $ = js(f.current), R = $.indexOf(q.target),
|
|
7324
|
+
const $ = js(f.current), R = $.indexOf(q.target), V = R + (q.shiftKey ? -1 : 1), J = R >= 0 ? $[V] : null;
|
|
7322
7325
|
if (q.preventDefault(), J) {
|
|
7323
7326
|
q.stopPropagation(), J.focus();
|
|
7324
7327
|
return;
|
|
@@ -7335,16 +7338,16 @@ function ol({
|
|
|
7335
7338
|
}
|
|
7336
7339
|
}
|
|
7337
7340
|
}
|
|
7338
|
-
function
|
|
7341
|
+
function z(q, $) {
|
|
7339
7342
|
if (q.nativeEvent.isComposing || q.keyCode === 229 || q.key !== "ArrowDown" && q.key !== "ArrowUp") return;
|
|
7340
7343
|
q.preventDefault(), q.stopPropagation();
|
|
7341
7344
|
const R = E.flatMap(
|
|
7342
7345
|
(J, F) => J.kind === "item" && J.group.id === $.id && x.includes(F) ? [F] : []
|
|
7343
|
-
),
|
|
7344
|
-
|
|
7346
|
+
), V = q.key === "ArrowDown" ? R[0] : R.at(-1);
|
|
7347
|
+
V !== void 0 && G(V);
|
|
7345
7348
|
}
|
|
7346
7349
|
function te(q, $) {
|
|
7347
|
-
const R = E.findIndex((W) => W.kind === $ && "action" in W && W.action.id === q.id),
|
|
7350
|
+
const R = E.findIndex((W) => W.kind === $ && "action" in W && W.action.id === q.id), V = `${$}:${q.id}`, J = tt(!!q.disabled), F = q.children ? rn(J, Y.getTriggerProps(V, !!q.disabled), (W) => {
|
|
7348
7351
|
L.current[R] = W;
|
|
7349
7352
|
}) : {
|
|
7350
7353
|
...J,
|
|
@@ -7375,7 +7378,7 @@ function ol({
|
|
|
7375
7378
|
]
|
|
7376
7379
|
}
|
|
7377
7380
|
),
|
|
7378
|
-
q.children ? Y.renderSubmenu(
|
|
7381
|
+
q.children ? Y.renderSubmenu(V, q.children, q.textValue) : null
|
|
7379
7382
|
] }, q.id);
|
|
7380
7383
|
}
|
|
7381
7384
|
return /* @__PURE__ */ b(
|
|
@@ -7394,7 +7397,7 @@ function ol({
|
|
|
7394
7397
|
"data-side": h.side,
|
|
7395
7398
|
style: { left: h.left, top: h.top },
|
|
7396
7399
|
onPointerDown: S,
|
|
7397
|
-
onKeyDown:
|
|
7400
|
+
onKeyDown: ne,
|
|
7398
7401
|
children: [
|
|
7399
7402
|
/* @__PURE__ */ b("div", { className: `q1-context-switcher__stacked-header${e.avatarAction ? " q1-context-switcher__stacked-header--centered" : ""}`, children: [
|
|
7400
7403
|
e.avatarAction ? /* @__PURE__ */ n("div", { className: "q1-context-switcher__avatar-action-menu", role: "menu", "aria-labelledby": v, children: /* @__PURE__ */ n(
|
|
@@ -7421,7 +7424,7 @@ function ol({
|
|
|
7421
7424
|
] })
|
|
7422
7425
|
] }),
|
|
7423
7426
|
r?.length ? /* @__PURE__ */ n("div", { className: "q1-context-switcher__header-actions", role: "menu", "aria-labelledby": v, children: r.map((q) => te(q, "header-action")) }) : null,
|
|
7424
|
-
/* @__PURE__ */ n("div", { className: "q1-context-switcher__groups", children: k.map(({ group: q, items: $, query: R, parents:
|
|
7427
|
+
/* @__PURE__ */ n("div", { className: "q1-context-switcher__groups", children: k.map(({ group: q, items: $, query: R, parents: V }) => {
|
|
7425
7428
|
const J = `${p}-${q.id}-results`, F = (R ? q.search?.noResults : q.emptyState ?? q.search?.noResults) ?? { title: "没有可用选项" };
|
|
7426
7429
|
return /* @__PURE__ */ b(Ve, { children: [
|
|
7427
7430
|
q.divider ? /* @__PURE__ */ n("div", { className: "q1-context-switcher__separator", role: "separator" }) : null,
|
|
@@ -7444,7 +7447,7 @@ function ol({
|
|
|
7444
7447
|
const ie = W.currentTarget.value;
|
|
7445
7448
|
D((H) => ({ ...H, [q.id]: ie }));
|
|
7446
7449
|
},
|
|
7447
|
-
onKeyDown: (W) =>
|
|
7450
|
+
onKeyDown: (W) => z(W, q)
|
|
7448
7451
|
}
|
|
7449
7452
|
)
|
|
7450
7453
|
] }) : null,
|
|
@@ -7455,9 +7458,9 @@ function ol({
|
|
|
7455
7458
|
role: $.length ? "menu" : void 0,
|
|
7456
7459
|
"aria-label": $.length ? q.textValue : void 0,
|
|
7457
7460
|
children: $.map((W) => {
|
|
7458
|
-
const ie =
|
|
7461
|
+
const ie = V.get(W.id), H = E.findIndex(
|
|
7459
7462
|
(ce) => ce.kind === "item" && ce.group.id === q.id && ce.item.id === W.id
|
|
7460
|
-
),
|
|
7463
|
+
), re = W.id === i, U = !!(W.disabled || re), le = (W.kind ?? "context") === "context", ye = le && q.selectedId === W.id, he = W.metaLabel ? `${I(W.id)}-meta` : void 0, Ce = [ie ? I(ie) : void 0, he].filter(Boolean).join(" ") || void 0, Me = `item:${W.id}`, $e = tt(U), me = W.children ? rn($e, Y.getTriggerProps(Me, U), (ce) => {
|
|
7461
7464
|
L.current[H] = ce;
|
|
7462
7465
|
}) : {
|
|
7463
7466
|
...$e,
|
|
@@ -7481,7 +7484,7 @@ function ol({
|
|
|
7481
7484
|
"aria-describedby": Ce,
|
|
7482
7485
|
"aria-checked": le ? ye : void 0,
|
|
7483
7486
|
"aria-disabled": U || void 0,
|
|
7484
|
-
"aria-busy":
|
|
7487
|
+
"aria-busy": re || void 0,
|
|
7485
7488
|
"data-context-id": W.id,
|
|
7486
7489
|
"data-context-roving-tab-stop": X === H ? "" : void 0,
|
|
7487
7490
|
...me,
|
|
@@ -7491,7 +7494,7 @@ function ol({
|
|
|
7491
7494
|
/* @__PURE__ */ n("span", { id: I(W.id), className: "q1-context-switcher__item-label", children: W.label }),
|
|
7492
7495
|
W.description ? /* @__PURE__ */ n("span", { className: "q1-context-switcher__description", children: W.description }) : null
|
|
7493
7496
|
] }),
|
|
7494
|
-
|
|
7497
|
+
re ? /* @__PURE__ */ n(ze, { className: "q1-context-switcher__pending", size: 16, strokeWidth: oe, "aria-hidden": "true" }) : ye ? /* @__PURE__ */ n(Be, { className: "q1-context-switcher__check", size: 16, strokeWidth: oe, "aria-hidden": "true" }) : W.children ? /* @__PURE__ */ n(Ke, { className: "q1-context-switcher__submenu-chevron", size: 16, strokeWidth: oe, "aria-hidden": "true" }) : W.meta !== void 0 && W.meta !== null ? /* @__PURE__ */ n("span", { className: "q1-context-switcher__meta", "aria-hidden": "true", children: W.meta }) : null
|
|
7495
7498
|
]
|
|
7496
7499
|
}
|
|
7497
7500
|
),
|
|
@@ -7576,7 +7579,7 @@ function sl({
|
|
|
7576
7579
|
(Z < Je || Z + x.width > M - Je) && (L = "end", Z = B), Z = Math.max(Je, Math.min(Z, M - x.width - Je));
|
|
7577
7580
|
let X = "bottom", Y = (E?.bottom ?? P.bottom) + yr;
|
|
7578
7581
|
Y + x.height > K - Je && (X = "top", Y = P.top - x.height - yr), Y = Math.max(Je, Math.min(Y, K - x.height - Je)), h(
|
|
7579
|
-
(
|
|
7582
|
+
(ne) => ne.align === L && ne.side === X && ne.direction === O && ne.left === Z && ne.top === Y ? ne : { align: L, side: X, direction: O, left: Z, top: Y }
|
|
7580
7583
|
);
|
|
7581
7584
|
}
|
|
7582
7585
|
let I = 0;
|
|
@@ -7720,7 +7723,7 @@ function Xu({
|
|
|
7720
7723
|
function Y() {
|
|
7721
7724
|
R(!1);
|
|
7722
7725
|
}
|
|
7723
|
-
function
|
|
7726
|
+
function ne(U) {
|
|
7724
7727
|
if (U === "escape") {
|
|
7725
7728
|
R(!0);
|
|
7726
7729
|
return;
|
|
@@ -7728,7 +7731,7 @@ function Xu({
|
|
|
7728
7731
|
const le = U === "outside-pointer" && (te.popupRef.current?.contains(document.activeElement) || document.activeElement === document.body || document.activeElement === no(document));
|
|
7729
7732
|
R(!1), le && te.triggerRef.current?.focus();
|
|
7730
7733
|
}
|
|
7731
|
-
const
|
|
7734
|
+
const z = Ze({
|
|
7732
7735
|
open: _ && !x,
|
|
7733
7736
|
blocking: !1,
|
|
7734
7737
|
dismissable: !0,
|
|
@@ -7738,13 +7741,13 @@ function Xu({
|
|
|
7738
7741
|
registrationTiming: "layout",
|
|
7739
7742
|
focusOnOpen: !1,
|
|
7740
7743
|
deferPortalUntilReady: !0,
|
|
7741
|
-
onClose:
|
|
7744
|
+
onClose: ne,
|
|
7742
7745
|
restoreFocus: !1
|
|
7743
7746
|
}), te = sl({
|
|
7744
7747
|
controlled: y,
|
|
7745
7748
|
isOpen: _,
|
|
7746
7749
|
managePortal: x,
|
|
7747
|
-
positioningReady: x || !!
|
|
7750
|
+
positioningReady: x || !!z.portalRoot,
|
|
7748
7751
|
outsidePointer: x,
|
|
7749
7752
|
triggerRef: w,
|
|
7750
7753
|
popupRef: v,
|
|
@@ -7763,11 +7766,11 @@ function Xu({
|
|
|
7763
7766
|
function R(U) {
|
|
7764
7767
|
te.closeWithFocus(U ? "trigger" : "preserve"), X(!1), q(), U && te.triggerRef.current?.focus();
|
|
7765
7768
|
}
|
|
7766
|
-
function
|
|
7769
|
+
function V(U, le) {
|
|
7767
7770
|
I.current = U, N.current = le, te.closeWithFocus("trigger"), T.current = !1, X(!0);
|
|
7768
7771
|
}
|
|
7769
7772
|
function J(U) {
|
|
7770
|
-
U.key === "ArrowDown" || U.key === "Enter" || U.key === " " ? (U.preventDefault(), _ ||
|
|
7773
|
+
U.key === "ArrowDown" || U.key === "Enter" || U.key === " " ? (U.preventDefault(), _ || V("selected", "keyboard")) : U.key === "ArrowUp" ? (U.preventDefault(), _ || V(x ? "selected" : "last", "keyboard")) : U.key === "Escape" && _ && (U.preventDefault(), R(!0));
|
|
7771
7774
|
}
|
|
7772
7775
|
function F(U, le) {
|
|
7773
7776
|
x && le.id === L?.primary?.id && (D.current?.disconnect(), D.current = B ? dl(te.triggerRef.current, B, U.id) : null), te.closeWithFocus("trigger"), a(U, le), y || R(!0);
|
|
@@ -7814,7 +7817,7 @@ function Xu({
|
|
|
7814
7817
|
onSelect: F,
|
|
7815
7818
|
onFooterAction: W,
|
|
7816
7819
|
isOpen: _,
|
|
7817
|
-
portalRoot:
|
|
7820
|
+
portalRoot: z.portalRoot,
|
|
7818
7821
|
popupRef: te.popupRef,
|
|
7819
7822
|
triggerRef: te.triggerRef,
|
|
7820
7823
|
menuId: P,
|
|
@@ -7823,7 +7826,7 @@ function Xu({
|
|
|
7823
7826
|
didFocusOnOpen: T,
|
|
7824
7827
|
resetRef: S,
|
|
7825
7828
|
onClose: R,
|
|
7826
|
-
onOverlayKeyDown:
|
|
7829
|
+
onOverlayKeyDown: z.onKeyDown
|
|
7827
7830
|
}
|
|
7828
7831
|
) : /* @__PURE__ */ n(
|
|
7829
7832
|
el,
|
|
@@ -7836,7 +7839,7 @@ function Xu({
|
|
|
7836
7839
|
onFooterAction: W,
|
|
7837
7840
|
label: g,
|
|
7838
7841
|
isOpen: _,
|
|
7839
|
-
portalRoot:
|
|
7842
|
+
portalRoot: z.portalRoot,
|
|
7840
7843
|
popupRef: te.popupRef,
|
|
7841
7844
|
triggerRef: te.triggerRef,
|
|
7842
7845
|
menuId: P,
|
|
@@ -7845,9 +7848,9 @@ function Xu({
|
|
|
7845
7848
|
didFocusOnOpen: T,
|
|
7846
7849
|
resetRef: S,
|
|
7847
7850
|
onClose: R,
|
|
7848
|
-
onOverlayKeyDown:
|
|
7851
|
+
onOverlayKeyDown: z.onKeyDown
|
|
7849
7852
|
}
|
|
7850
|
-
),
|
|
7853
|
+
), re = _ ? x ? te.portalRoot ? Tt(H, te.portalRoot) : null : z.portal(H) : null;
|
|
7851
7854
|
return /* @__PURE__ */ b(
|
|
7852
7855
|
"div",
|
|
7853
7856
|
{
|
|
@@ -7865,7 +7868,7 @@ function Xu({
|
|
|
7865
7868
|
"aria-expanded": _,
|
|
7866
7869
|
"aria-controls": P,
|
|
7867
7870
|
"aria-label": O,
|
|
7868
|
-
onClick: (U) => _ ? R(!0) :
|
|
7871
|
+
onClick: (U) => _ ? R(!0) : V("selected", U.detail === 0 ? "keyboard" : "pointer"),
|
|
7869
7872
|
onKeyDown: J,
|
|
7870
7873
|
children: [
|
|
7871
7874
|
Z.avatar ? /* @__PURE__ */ n("span", { className: `q1-context-switcher__avatar${M ? " q1-context-switcher__avatar--stacked" : ""}`, "aria-hidden": "true", children: Z.avatar }) : null,
|
|
@@ -7879,7 +7882,7 @@ function Xu({
|
|
|
7879
7882
|
),
|
|
7880
7883
|
!x && l ? /* @__PURE__ */ n("div", { ref: C, className: "q1-context-switcher__error", role: "alert", children: l }) : null,
|
|
7881
7884
|
x ? null : /* @__PURE__ */ n("span", { className: "q1-sr-only", "aria-live": "polite", children: s ? "正在处理所选上下文" : "" }),
|
|
7882
|
-
|
|
7885
|
+
re
|
|
7883
7886
|
]
|
|
7884
7887
|
}
|
|
7885
7888
|
);
|
|
@@ -8035,7 +8038,7 @@ function vl({
|
|
|
8035
8038
|
if (!F || !W) return;
|
|
8036
8039
|
const ie = F.ownerDocument.defaultView;
|
|
8037
8040
|
if (!ie) return;
|
|
8038
|
-
const H = Number.parseFloat(ie.getComputedStyle(F).getPropertyValue("--q1-space-2")) || 8,
|
|
8041
|
+
const H = Number.parseFloat(ie.getComputedStyle(F).getPropertyValue("--q1-space-2")) || 8, re = gl({
|
|
8039
8042
|
trigger: F.getBoundingClientRect(),
|
|
8040
8043
|
card: { width: W.offsetWidth, height: W.offsetHeight },
|
|
8041
8044
|
viewportWidth: F.ownerDocument.documentElement.clientWidth,
|
|
@@ -8045,7 +8048,7 @@ function vl({
|
|
|
8045
8048
|
gap: H,
|
|
8046
8049
|
margin: H
|
|
8047
8050
|
});
|
|
8048
|
-
d(
|
|
8051
|
+
d(re.placement), g({ left: re.left, top: re.top, originX: re.originX, originY: re.originY }), c(!0);
|
|
8049
8052
|
}, [r, t]);
|
|
8050
8053
|
se(() => {
|
|
8051
8054
|
const F = u.current;
|
|
@@ -8060,11 +8063,11 @@ function vl({
|
|
|
8060
8063
|
ye[Ce] === le && (T.current = !1, S.current = !1);
|
|
8061
8064
|
}, H = () => {
|
|
8062
8065
|
k.current = !1;
|
|
8063
|
-
},
|
|
8066
|
+
}, re = () => {
|
|
8064
8067
|
k.current = !1;
|
|
8065
8068
|
};
|
|
8066
|
-
return W.addEventListener("keydown", ie), W.addEventListener("pointercancel", H, !0), W.addEventListener("click",
|
|
8067
|
-
W.removeEventListener("keydown", ie), W.removeEventListener("pointercancel", H, !0), W.removeEventListener("click",
|
|
8069
|
+
return W.addEventListener("keydown", ie), W.addEventListener("pointercancel", H, !0), W.addEventListener("click", re, !0), () => {
|
|
8070
|
+
W.removeEventListener("keydown", ie), W.removeEventListener("pointercancel", H, !0), W.removeEventListener("click", re, !0), dn(W);
|
|
8068
8071
|
};
|
|
8069
8072
|
}, []), _e(() => {
|
|
8070
8073
|
if (!p) return;
|
|
@@ -8099,14 +8102,14 @@ function vl({
|
|
|
8099
8102
|
onClose: () => Y(!0)
|
|
8100
8103
|
}), H = (he) => {
|
|
8101
8104
|
he.key !== "Escape" || he.defaultPrevented || !We(W, e) || (he.preventDefault(), he.stopPropagation(), Y(!0));
|
|
8102
|
-
},
|
|
8105
|
+
}, re = (he) => {
|
|
8103
8106
|
const Ce = he instanceof Node ? he : null;
|
|
8104
8107
|
return !Ce || !u.current?.contains(Ce) && !y.current?.contains(Ce);
|
|
8105
8108
|
}, U = (he) => {
|
|
8106
8109
|
P.current = { pointerId: he.pointerId, target: he.target };
|
|
8107
8110
|
}, le = (he) => {
|
|
8108
8111
|
const Ce = P.current;
|
|
8109
|
-
!Ce || Ce.pointerId !== he.pointerId || (P.current = null, We(W, e) &&
|
|
8112
|
+
!Ce || Ce.pointerId !== he.pointerId || (P.current = null, We(W, e) && re(Ce.target) && re(he.target) && Y(!1));
|
|
8110
8113
|
}, ye = (he) => {
|
|
8111
8114
|
P.current?.pointerId === he.pointerId && (P.current = null);
|
|
8112
8115
|
};
|
|
@@ -8116,20 +8119,20 @@ function vl({
|
|
|
8116
8119
|
}, [Y, e, o]), se(() => () => {
|
|
8117
8120
|
E(), x();
|
|
8118
8121
|
}, [E, x]);
|
|
8119
|
-
function
|
|
8122
|
+
function ne(F, W, ie, H) {
|
|
8120
8123
|
return W.right <= F.left || W.left >= F.right ? H >= Math.min(F.top, W.top) && H <= Math.max(F.bottom, W.bottom) && ie >= Math.min(F.right, W.right) && ie <= Math.max(F.left, W.left) : ie >= Math.min(F.left, W.left) && ie <= Math.max(F.right, W.right) && H >= Math.min(F.bottom, W.bottom) && H <= Math.max(F.top, W.top);
|
|
8121
8124
|
}
|
|
8122
|
-
function
|
|
8123
|
-
const ie = u.current, H = y.current,
|
|
8124
|
-
if (!ie || !H || !
|
|
8125
|
+
function z(F, W) {
|
|
8126
|
+
const ie = u.current, H = y.current, re = ie?.ownerDocument;
|
|
8127
|
+
if (!ie || !H || !re || !_.current) return !1;
|
|
8125
8128
|
const U = ie.getBoundingClientRect(), le = H.getBoundingClientRect();
|
|
8126
|
-
if (!
|
|
8129
|
+
if (!ne(U, le, F, W) && !Kt(U, F, W) && !Kt(le, F, W)) return !1;
|
|
8127
8130
|
x();
|
|
8128
8131
|
const ye = (he) => {
|
|
8129
8132
|
const Ce = ie.getBoundingClientRect(), Me = H.getBoundingClientRect();
|
|
8130
|
-
!Kt(Ce, he.clientX, he.clientY) && !Kt(Me, he.clientX, he.clientY) && !
|
|
8133
|
+
!Kt(Ce, he.clientX, he.clientY) && !Kt(Me, he.clientX, he.clientY) && !ne(Ce, Me, he.clientX, he.clientY) && (x(), G());
|
|
8131
8134
|
};
|
|
8132
|
-
return
|
|
8135
|
+
return re.addEventListener("pointermove", ye, { passive: !0 }), w.current = () => re.removeEventListener("pointermove", ye), !0;
|
|
8133
8136
|
}
|
|
8134
8137
|
function te(F) {
|
|
8135
8138
|
F.pointerType !== "mouse" || M() || !F.currentTarget.ownerDocument.defaultView?.matchMedia("(hover: hover) and (pointer: fine)").matches || (v.current = !0, T.current = !1, S.current = !1, x(), !_.current && (E(), C.current = F.currentTarget.ownerDocument.defaultView.setTimeout(() => {
|
|
@@ -8137,7 +8140,7 @@ function vl({
|
|
|
8137
8140
|
}, yl)));
|
|
8138
8141
|
}
|
|
8139
8142
|
function q(F) {
|
|
8140
|
-
F.pointerType === "mouse" && (v.current = !1, E(),
|
|
8143
|
+
F.pointerType === "mouse" && (v.current = !1, E(), z(F.clientX, F.clientY) || G());
|
|
8141
8144
|
}
|
|
8142
8145
|
function $(F) {
|
|
8143
8146
|
k.current = !0;
|
|
@@ -8145,7 +8148,7 @@ function vl({
|
|
|
8145
8148
|
function R() {
|
|
8146
8149
|
M() || (N.current = !0, !T.current && (k.current || O(!1)));
|
|
8147
8150
|
}
|
|
8148
|
-
function
|
|
8151
|
+
function V(F) {
|
|
8149
8152
|
const W = F.relatedTarget;
|
|
8150
8153
|
k.current = !1, N.current = !1, !(W && y.current?.contains(W)) && G(!0);
|
|
8151
8154
|
}
|
|
@@ -8166,7 +8169,7 @@ function vl({
|
|
|
8166
8169
|
onPointerLeave: q,
|
|
8167
8170
|
onPointerDown: $,
|
|
8168
8171
|
onTriggerFocus: R,
|
|
8169
|
-
onTriggerBlur:
|
|
8172
|
+
onTriggerBlur: V,
|
|
8170
8173
|
onTriggerClick: J,
|
|
8171
8174
|
onTriggerKeyDown(F) {
|
|
8172
8175
|
if ((F.key === "Enter" || F.key === " ") && (T.current = !1, S.current = !1), F.key !== "Tab" || F.shiftKey || !_.current) return;
|
|
@@ -8177,7 +8180,7 @@ function vl({
|
|
|
8177
8180
|
I.current = !0, x();
|
|
8178
8181
|
},
|
|
8179
8182
|
onCardMouseLeave(F) {
|
|
8180
|
-
I.current = !1,
|
|
8183
|
+
I.current = !1, z(F.clientX, F.clientY) || G();
|
|
8181
8184
|
},
|
|
8182
8185
|
onCardFocus() {
|
|
8183
8186
|
D.current = !0;
|
|
@@ -9333,11 +9336,11 @@ function md({
|
|
|
9333
9336
|
function Y(q) {
|
|
9334
9337
|
p && p(q.key, X(q));
|
|
9335
9338
|
}
|
|
9336
|
-
function
|
|
9339
|
+
function ne(q) {
|
|
9337
9340
|
if (q.sortable)
|
|
9338
9341
|
return f !== q.key ? "none" : g === "asc" ? "ascending" : g === "desc" ? "descending" : "none";
|
|
9339
9342
|
}
|
|
9340
|
-
const
|
|
9343
|
+
const z = /* @__PURE__ */ b("table", { ...I, className: E, style: x, children: [
|
|
9341
9344
|
o != null ? /* @__PURE__ */ n("caption", { children: o }) : null,
|
|
9342
9345
|
c,
|
|
9343
9346
|
/* @__PURE__ */ n("thead", { className: d ? void 0 : "table__head--hidden", children: /* @__PURE__ */ b("tr", { children: [
|
|
@@ -9356,12 +9359,12 @@ function md({
|
|
|
9356
9359
|
}
|
|
9357
9360
|
) }) }) : null,
|
|
9358
9361
|
t.map((q) => {
|
|
9359
|
-
const $ =
|
|
9362
|
+
const $ = ne(q), R = q.sortable && f === q.key && g ? g === "asc" ? "升序" : "降序" : null, V = X(q) === "asc" ? "升序" : "降序", J = R ? /* @__PURE__ */ n("span", { className: "table__sort-state", children: R }) : null, F = q.sortLabel ?? (typeof q.header == "string" ? q.header : q.key), W = q.sortable ? /* @__PURE__ */ b(
|
|
9360
9363
|
"button",
|
|
9361
9364
|
{
|
|
9362
9365
|
type: "button",
|
|
9363
9366
|
className: "table__sort",
|
|
9364
|
-
"aria-label": `按${F}${
|
|
9367
|
+
"aria-label": `按${F}${V}排序`,
|
|
9365
9368
|
disabled: !p,
|
|
9366
9369
|
onClick: p ? () => Y(q) : void 0,
|
|
9367
9370
|
children: [
|
|
@@ -9382,8 +9385,8 @@ function md({
|
|
|
9382
9385
|
className: C ? "table__row--interactive" : void 0,
|
|
9383
9386
|
tabIndex: C ? 0 : void 0,
|
|
9384
9387
|
"aria-label": C ? C.getRowLabel(q.row, q.rowIndex) : void 0,
|
|
9385
|
-
onClick: C ? (
|
|
9386
|
-
onKeyDown: C ? (
|
|
9388
|
+
onClick: C ? (V) => B(q, V) : void 0,
|
|
9389
|
+
onKeyDown: C ? (V) => Z(q, V) : void 0
|
|
9387
9390
|
}, R = /* @__PURE__ */ b(ke, { children: [
|
|
9388
9391
|
h ? /* @__PURE__ */ n("td", { className: "table__cell--select", children: /* @__PURE__ */ n("label", { className: "table__checkbox-control", children: /* @__PURE__ */ n(
|
|
9389
9392
|
"input",
|
|
@@ -9393,10 +9396,10 @@ function md({
|
|
|
9393
9396
|
"aria-checked": D.has(q.key) ? "true" : "false",
|
|
9394
9397
|
checked: D.has(q.key),
|
|
9395
9398
|
disabled: q.disabled,
|
|
9396
|
-
onChange: (
|
|
9399
|
+
onChange: (V) => G(q, V)
|
|
9397
9400
|
}
|
|
9398
9401
|
) }) }) : null,
|
|
9399
|
-
t.map((
|
|
9402
|
+
t.map((V) => /* @__PURE__ */ n("td", { className: Er(V.align), children: V.render(q.row, q.rowIndex) }, V.key)),
|
|
9400
9403
|
u ? /* @__PURE__ */ n("td", { className: "table__cell--actions", children: u.render(q.row, q.rowIndex) }) : null
|
|
9401
9404
|
] });
|
|
9402
9405
|
return m ? /* @__PURE__ */ n(Ve, { children: m(q.row, {
|
|
@@ -9407,7 +9410,7 @@ function md({
|
|
|
9407
9410
|
cells: R
|
|
9408
9411
|
}) }, Ir(q.key)) : /* @__PURE__ */ n("tr", { ...$, children: R }, Ir(q.key));
|
|
9409
9412
|
}) })
|
|
9410
|
-
] }), te = O ? /* @__PURE__ */ n("div", { className: M, style: K, tabIndex: 0, children:
|
|
9413
|
+
] }), te = O ? /* @__PURE__ */ n("div", { className: M, style: K, tabIndex: 0, children: z }) : z;
|
|
9411
9414
|
return /* @__PURE__ */ b(ke, { children: [
|
|
9412
9415
|
y && h && h.selectedKeys.length > 0 ? /* @__PURE__ */ n("div", { className: "table__bulk-actions", role: "toolbar", "aria-label": _, children: y }) : null,
|
|
9413
9416
|
te
|
|
@@ -9569,7 +9572,7 @@ function bd({
|
|
|
9569
9572
|
}, [K]), G = ve(() => {
|
|
9570
9573
|
const q = u.current, $ = y.current;
|
|
9571
9574
|
if (!q || !$) return;
|
|
9572
|
-
const R = 8,
|
|
9575
|
+
const R = 8, V = 8, J = q.getBoundingClientRect(), F = $.offsetWidth, W = $.offsetHeight, ie = q.ownerDocument, H = ie.documentElement.clientWidth, re = ie.documentElement.clientHeight, U = J.top - V - W >= R, le = J.bottom + V + W <= re - R, ye = U || !le && J.top >= re - J.bottom ? "top" : "bottom", he = J.left + J.width / 2 - F / 2, Ce = Math.max(R, Math.min(he, H - R - F)), Me = ye === "top" ? J.top - V - W : J.bottom + V, $e = Math.max(R, Math.min(Me, re - R - W));
|
|
9573
9576
|
g({ side: ye, left: Ce, top: $e }), h(!0);
|
|
9574
9577
|
}, []);
|
|
9575
9578
|
se(() => {
|
|
@@ -9581,9 +9584,9 @@ function bd({
|
|
|
9581
9584
|
const q = u.current, $ = y.current, R = q?.ownerDocument.defaultView;
|
|
9582
9585
|
if (!q || !$ || !R) return;
|
|
9583
9586
|
G();
|
|
9584
|
-
const
|
|
9585
|
-
return
|
|
9586
|
-
|
|
9587
|
+
const V = typeof R.ResizeObserver == "function" ? new R.ResizeObserver(G) : null;
|
|
9588
|
+
return V?.observe(q), V?.observe($), R.addEventListener("scroll", G, !0), R.addEventListener("resize", G), () => {
|
|
9589
|
+
V?.disconnect(), R.removeEventListener("scroll", G, !0), R.removeEventListener("resize", G);
|
|
9587
9590
|
};
|
|
9588
9591
|
}, [m, G]), se(() => {
|
|
9589
9592
|
if (!a) return;
|
|
@@ -9596,14 +9599,14 @@ function bd({
|
|
|
9596
9599
|
outsidePointer: !1,
|
|
9597
9600
|
getContainer: () => y.current,
|
|
9598
9601
|
onClose: O
|
|
9599
|
-
}),
|
|
9602
|
+
}), V = (F) => {
|
|
9600
9603
|
const W = F.target;
|
|
9601
9604
|
W && typeof W.nodeType == "number" && !u.current?.contains(W) && !y.current?.contains(W) && K();
|
|
9602
9605
|
}, J = (F) => {
|
|
9603
9606
|
F.key !== "Escape" || F.defaultPrevented || !We($, S) || (F.preventDefault(), F.stopPropagation(), c(!0), O());
|
|
9604
9607
|
};
|
|
9605
|
-
return $.addEventListener("pointerdown",
|
|
9606
|
-
$.removeEventListener("pointerdown",
|
|
9608
|
+
return $.addEventListener("pointerdown", V, !0), $.addEventListener("focusin", V), $.addEventListener("keydown", J, !0), () => {
|
|
9609
|
+
$.removeEventListener("pointerdown", V, !0), $.removeEventListener("focusin", V), $.removeEventListener("keydown", J, !0), R();
|
|
9607
9610
|
};
|
|
9608
9611
|
}, [S, O, K, a]), se(() => {
|
|
9609
9612
|
const q = u.current?.ownerDocument.defaultView;
|
|
@@ -9611,13 +9614,13 @@ function bd({
|
|
|
9611
9614
|
_.current !== null && q?.clearTimeout(_.current), v.current !== null && q?.clearTimeout(v.current), x();
|
|
9612
9615
|
};
|
|
9613
9616
|
}, [x]);
|
|
9614
|
-
function B(q, $, R,
|
|
9615
|
-
return R >= Math.min(q.left, $.left) && R <= Math.max(q.right, $.right) && ($.bottom <= q.top &&
|
|
9617
|
+
function B(q, $, R, V) {
|
|
9618
|
+
return R >= Math.min(q.left, $.left) && R <= Math.max(q.right, $.right) && ($.bottom <= q.top && V >= $.bottom && V <= q.top || $.top >= q.bottom && V >= q.bottom && V <= $.top);
|
|
9616
9619
|
}
|
|
9617
9620
|
function Z(q, $) {
|
|
9618
|
-
const R = u.current,
|
|
9619
|
-
if (!R || !
|
|
9620
|
-
const F = R.getBoundingClientRect(), W =
|
|
9621
|
+
const R = u.current, V = y.current, J = R?.ownerDocument;
|
|
9622
|
+
if (!R || !V || !J || !T.current) return !1;
|
|
9623
|
+
const F = R.getBoundingClientRect(), W = V.getBoundingClientRect();
|
|
9621
9624
|
if (!B(F, W, q, $) && !zt(F, q, $) && !zt(W, q, $)) return !1;
|
|
9622
9625
|
x();
|
|
9623
9626
|
const ie = (H) => {
|
|
@@ -9625,8 +9628,8 @@ function bd({
|
|
|
9625
9628
|
x(), L();
|
|
9626
9629
|
return;
|
|
9627
9630
|
}
|
|
9628
|
-
const
|
|
9629
|
-
!zt(
|
|
9631
|
+
const re = R.getBoundingClientRect(), U = V.getBoundingClientRect();
|
|
9632
|
+
!zt(re, H.clientX, H.clientY) && !zt(U, H.clientX, H.clientY) && !B(re, U, H.clientX, H.clientY) && (x(), L());
|
|
9630
9633
|
};
|
|
9631
9634
|
return J.addEventListener("pointermove", ie, { passive: !0 }), C.current = () => J.removeEventListener("pointermove", ie), !0;
|
|
9632
9635
|
}
|
|
@@ -9639,14 +9642,14 @@ function bd({
|
|
|
9639
9642
|
function Y(q) {
|
|
9640
9643
|
q.pointerType === "mouse" && (I.current = !1, E(), Z(q.clientX, q.clientY) || L());
|
|
9641
9644
|
}
|
|
9642
|
-
function
|
|
9645
|
+
function ne(q) {
|
|
9643
9646
|
w.current = !0, E();
|
|
9644
9647
|
const $ = q.currentTarget.ownerDocument.defaultView;
|
|
9645
9648
|
v.current !== null && $?.clearTimeout(v.current), $ && (v.current = $.setTimeout(() => {
|
|
9646
9649
|
w.current = !1, v.current = null;
|
|
9647
9650
|
}, 0));
|
|
9648
9651
|
}
|
|
9649
|
-
function
|
|
9652
|
+
function z(q) {
|
|
9650
9653
|
D.current = !1, T.current ? K() : M(q.detail === 0);
|
|
9651
9654
|
}
|
|
9652
9655
|
const te = /* @__PURE__ */ b(
|
|
@@ -9698,12 +9701,12 @@ function bd({
|
|
|
9698
9701
|
"aria-expanded": a,
|
|
9699
9702
|
"aria-controls": S,
|
|
9700
9703
|
"aria-describedby": a ? S : void 0,
|
|
9701
|
-
onPointerDown:
|
|
9704
|
+
onPointerDown: ne,
|
|
9702
9705
|
onFocus: () => {
|
|
9703
9706
|
w.current || (D.current = !1, M(!0));
|
|
9704
9707
|
},
|
|
9705
9708
|
onBlur: () => L(),
|
|
9706
|
-
onClick:
|
|
9709
|
+
onClick: z,
|
|
9707
9710
|
children: /* @__PURE__ */ n("time", { dateTime: r, children: e })
|
|
9708
9711
|
}
|
|
9709
9712
|
),
|
|
@@ -10354,11 +10357,11 @@ const Nd = It(function({
|
|
|
10354
10357
|
}, [w]), se(() => {
|
|
10355
10358
|
O.current || Z(String(v));
|
|
10356
10359
|
}, [v]);
|
|
10357
|
-
const
|
|
10360
|
+
const ne = (F) => {
|
|
10358
10361
|
F[0] === w && F[1] === v || (y || C(F), m?.(F));
|
|
10359
|
-
},
|
|
10360
|
-
const H = dt(W, u),
|
|
10361
|
-
return re
|
|
10362
|
+
}, z = (F, W, ie = !0) => {
|
|
10363
|
+
const H = dt(W, u), re = F === "low" ? [Math.min(H, v), v] : [w, Math.max(H, w)];
|
|
10364
|
+
return ne(re), ie && (F === "low" ? G(String(y ? w : re[0])) : Z(String(y ? v : re[1]))), re;
|
|
10362
10365
|
}, te = (F) => {
|
|
10363
10366
|
const W = x.current?.getBoundingClientRect();
|
|
10364
10367
|
if (!W || W.width === 0) return w;
|
|
@@ -10380,41 +10383,41 @@ const Nd = It(function({
|
|
|
10380
10383
|
pointerValue: W,
|
|
10381
10384
|
activated: !H,
|
|
10382
10385
|
verticalPan: !1
|
|
10383
|
-
}, F.currentTarget.setPointerCapture(F.pointerId), !H && ie && (Y(ie), (ie === "low" ? P.current : E.current)?.focus(),
|
|
10386
|
+
}, F.currentTarget.setPointerCapture(F.pointerId), !H && ie && (Y(ie), (ie === "low" ? P.current : E.current)?.focus(), z(ie, W));
|
|
10384
10387
|
}, $ = (F) => {
|
|
10385
10388
|
const W = M.current;
|
|
10386
10389
|
if (!W || W.pointerId !== F.pointerId) return;
|
|
10387
10390
|
const ie = te(F.clientX);
|
|
10388
10391
|
if (W.pointerValue = ie, W.pointerType === "touch" && !W.activated) {
|
|
10389
|
-
const H = Math.abs(F.clientX - W.startX),
|
|
10390
|
-
if (W.verticalPan ||
|
|
10392
|
+
const H = Math.abs(F.clientX - W.startX), re = Math.abs(F.clientY - W.startY);
|
|
10393
|
+
if (W.verticalPan || re >= 4 && re > H) {
|
|
10391
10394
|
W.verticalPan = !0;
|
|
10392
10395
|
return;
|
|
10393
10396
|
}
|
|
10394
|
-
if (H < 4 || H <=
|
|
10397
|
+
if (H < 4 || H <= re) return;
|
|
10395
10398
|
W.activated = !0;
|
|
10396
10399
|
}
|
|
10397
10400
|
if (!W.thumb) {
|
|
10398
10401
|
if (ie === W.overlapValue) return;
|
|
10399
10402
|
W.thumb = ie < W.overlapValue ? "low" : "high", Y(W.thumb), (W.thumb === "low" ? P.current : E.current)?.focus();
|
|
10400
10403
|
}
|
|
10401
|
-
|
|
10404
|
+
z(W.thumb, ie);
|
|
10402
10405
|
}, R = (F, W = !1) => {
|
|
10403
10406
|
const ie = M.current;
|
|
10404
10407
|
if (!(!ie || ie.pointerId !== F.pointerId)) {
|
|
10405
10408
|
if (W && ie.pointerType === "touch" && !ie.activated && !ie.verticalPan) {
|
|
10406
10409
|
const H = ie.thumb ?? "low";
|
|
10407
|
-
(H === "low" ? P.current : E.current)?.focus(),
|
|
10410
|
+
(H === "low" ? P.current : E.current)?.focus(), z(H, ie.pointerValue);
|
|
10408
10411
|
}
|
|
10409
10412
|
M.current = null, Y(null), F.currentTarget.hasPointerCapture(F.pointerId) && F.currentTarget.releasePointerCapture(F.pointerId);
|
|
10410
10413
|
}
|
|
10411
|
-
},
|
|
10414
|
+
}, V = (F) => {
|
|
10412
10415
|
const W = F === "low" ? L : B, ie = Number(W);
|
|
10413
10416
|
if (!W.trim() || !Number.isFinite(ie)) {
|
|
10414
10417
|
F === "low" ? G(String(w)) : Z(String(v));
|
|
10415
10418
|
return;
|
|
10416
10419
|
}
|
|
10417
|
-
|
|
10420
|
+
z(F, ie);
|
|
10418
10421
|
}, J = (F) => {
|
|
10419
10422
|
F.key === "Enter" && F.currentTarget.blur();
|
|
10420
10423
|
};
|
|
@@ -10450,7 +10453,7 @@ const Nd = It(function({
|
|
|
10450
10453
|
},
|
|
10451
10454
|
onChange: (F) => G(F.currentTarget.value),
|
|
10452
10455
|
onBlur: () => {
|
|
10453
|
-
K.current = !1,
|
|
10456
|
+
K.current = !1, V("low");
|
|
10454
10457
|
},
|
|
10455
10458
|
onKeyDown: J
|
|
10456
10459
|
}
|
|
@@ -10486,7 +10489,7 @@ const Nd = It(function({
|
|
|
10486
10489
|
value: w,
|
|
10487
10490
|
disabled: g,
|
|
10488
10491
|
"data-pressed": X === "low" || void 0,
|
|
10489
|
-
onChange: (F) =>
|
|
10492
|
+
onChange: (F) => z("low", Number(F.currentTarget.value))
|
|
10490
10493
|
}
|
|
10491
10494
|
),
|
|
10492
10495
|
/* @__PURE__ */ n(
|
|
@@ -10504,7 +10507,7 @@ const Nd = It(function({
|
|
|
10504
10507
|
value: v,
|
|
10505
10508
|
disabled: g,
|
|
10506
10509
|
"data-pressed": X === "high" || void 0,
|
|
10507
|
-
onChange: (F) =>
|
|
10510
|
+
onChange: (F) => z("high", Number(F.currentTarget.value))
|
|
10508
10511
|
}
|
|
10509
10512
|
),
|
|
10510
10513
|
/* @__PURE__ */ n("span", { className: "slider-thumb-emphasis range-slider__emphasis range-slider__emphasis--low", "aria-hidden": "true" }),
|
|
@@ -10534,7 +10537,7 @@ const Nd = It(function({
|
|
|
10534
10537
|
},
|
|
10535
10538
|
onChange: (F) => Z(F.currentTarget.value),
|
|
10536
10539
|
onBlur: () => {
|
|
10537
|
-
O.current = !1,
|
|
10540
|
+
O.current = !1, V("high");
|
|
10538
10541
|
},
|
|
10539
10542
|
onKeyDown: J
|
|
10540
10543
|
}
|
|
@@ -10752,8 +10755,8 @@ function Cd({
|
|
|
10752
10755
|
h,
|
|
10753
10756
|
y,
|
|
10754
10757
|
(X) => {
|
|
10755
|
-
const Y = y.current?.ownerDocument,
|
|
10756
|
-
P(X !== "outside-pointer" && (X !== "anchor-hidden" || !
|
|
10758
|
+
const Y = y.current?.ownerDocument, ne = Y?.activeElement;
|
|
10759
|
+
P(X !== "outside-pointer" && (X !== "anchor-hidden" || !ne || ne === Y?.body || !!y.current?.contains(ne)));
|
|
10757
10760
|
},
|
|
10758
10761
|
{ width: "content", align: i, gapToken: "--q1-space-2", outsidePointer: !0 }
|
|
10759
10762
|
), D = t.flatMap((X, Y) => X.disabled ? [] : [Y]), T = D.length > 0, S = t[0], k = l || !S || !!S.disabled;
|
|
@@ -10768,8 +10771,8 @@ function Cd({
|
|
|
10768
10771
|
function O(X, Y) {
|
|
10769
10772
|
if (l || c || !T) return;
|
|
10770
10773
|
p(Y), f(!0);
|
|
10771
|
-
const
|
|
10772
|
-
window.requestAnimationFrame(() => x(
|
|
10774
|
+
const ne = X === "first" ? D[0] : D[D.length - 1];
|
|
10775
|
+
window.requestAnimationFrame(() => x(ne));
|
|
10773
10776
|
}
|
|
10774
10777
|
_e(() => {
|
|
10775
10778
|
if (!d) return;
|
|
@@ -10781,9 +10784,9 @@ function Cd({
|
|
|
10781
10784
|
P(!1);
|
|
10782
10785
|
return;
|
|
10783
10786
|
}
|
|
10784
|
-
const X = document.activeElement, Y = E.current.indexOf(X),
|
|
10785
|
-
if ((Y >= 0 ||
|
|
10786
|
-
const te = D.find((q) => q >
|
|
10787
|
+
const X = document.activeElement, Y = E.current.indexOf(X), ne = Y >= 0 ? Y : C.current, z = X === document.body;
|
|
10788
|
+
if ((Y >= 0 || z) && ne >= 0 && t[ne]?.disabled) {
|
|
10789
|
+
const te = D.find((q) => q > ne) ?? D[0];
|
|
10787
10790
|
x(te);
|
|
10788
10791
|
}
|
|
10789
10792
|
}, [d, l, c, T, t]);
|
|
@@ -10875,8 +10878,8 @@ function Cd({
|
|
|
10875
10878
|
children: t.map((X, Y) => /* @__PURE__ */ b(
|
|
10876
10879
|
"button",
|
|
10877
10880
|
{
|
|
10878
|
-
ref: (
|
|
10879
|
-
E.current[Y] =
|
|
10881
|
+
ref: (ne) => {
|
|
10882
|
+
E.current[Y] = ne;
|
|
10880
10883
|
},
|
|
10881
10884
|
type: "button",
|
|
10882
10885
|
role: "menuitem",
|
|
@@ -10907,8 +10910,8 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
10907
10910
|
u,
|
|
10908
10911
|
y,
|
|
10909
10912
|
(R) => {
|
|
10910
|
-
const
|
|
10911
|
-
O(R !== "outside-pointer" && (R !== "anchor-hidden" || !J || J ===
|
|
10913
|
+
const V = y.current?.ownerDocument, J = V?.activeElement;
|
|
10914
|
+
O(R !== "outside-pointer" && (R !== "anchor-hidden" || !J || J === V?.body || !!y.current?.contains(J)));
|
|
10912
10915
|
},
|
|
10913
10916
|
{ width: "content", align: o, gapToken: "--q1-space-2", outsidePointer: !0, present: m }
|
|
10914
10917
|
);
|
|
@@ -10917,29 +10920,29 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
10917
10920
|
}
|
|
10918
10921
|
_e(() => {
|
|
10919
10922
|
if (l || !m || !y.current) return;
|
|
10920
|
-
getComputedStyle(y.current).transitionDuration.split(",").some((
|
|
10923
|
+
getComputedStyle(y.current).transitionDuration.split(",").some((V) => Number.parseFloat(V) > 0) || N();
|
|
10921
10924
|
}, [l, m]);
|
|
10922
|
-
const D = t.flatMap((R,
|
|
10925
|
+
const D = t.flatMap((R, V) => _c(R) ? [V] : []), T = /* @__PURE__ */ new Set();
|
|
10923
10926
|
let S = 0;
|
|
10924
|
-
t.forEach((R,
|
|
10925
|
-
const J = R.type === "separator" || R.type === "section", F =
|
|
10927
|
+
t.forEach((R, V) => {
|
|
10928
|
+
const J = R.type === "separator" || R.type === "section", F = V === t.length - 1;
|
|
10926
10929
|
if (!J && !F) return;
|
|
10927
|
-
const W = J ?
|
|
10930
|
+
const W = J ? V : V + 1;
|
|
10928
10931
|
if (t.slice(S, W).some((H) => (H.type === "item" || H.type === "link") && !!(H.icon || H.locked)))
|
|
10929
10932
|
for (let H = S; H < W; H += 1) T.add(H);
|
|
10930
|
-
S =
|
|
10933
|
+
S = V + 1;
|
|
10931
10934
|
});
|
|
10932
10935
|
const k = D.length > 0, { itemRefs: P, focusItem: E, reset: x, onMenuKeyDown: M } = Nt({
|
|
10933
10936
|
focusableIndices: D,
|
|
10934
10937
|
getText: (R) => {
|
|
10935
|
-
const
|
|
10936
|
-
return
|
|
10938
|
+
const V = t[R];
|
|
10939
|
+
return V.type === "item" || V.type === "link" ? V.label : "";
|
|
10937
10940
|
},
|
|
10938
10941
|
onClose: () => O()
|
|
10939
10942
|
});
|
|
10940
|
-
function K(R,
|
|
10943
|
+
function K(R, V) {
|
|
10941
10944
|
if (!k) return;
|
|
10942
|
-
g(
|
|
10945
|
+
g(V), d(!0), c(!0);
|
|
10943
10946
|
const J = R === "first" ? D[0] : D[D.length - 1];
|
|
10944
10947
|
window.requestAnimationFrame(() => E(J));
|
|
10945
10948
|
}
|
|
@@ -10948,15 +10951,15 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
10948
10951
|
}
|
|
10949
10952
|
function L(R) {
|
|
10950
10953
|
window.requestAnimationFrame(() => {
|
|
10951
|
-
const
|
|
10952
|
-
|
|
10954
|
+
const V = u.current, J = document.activeElement;
|
|
10955
|
+
V?.isConnected && (J === document.body || J === null || R?.contains(J)) && V.focus();
|
|
10953
10956
|
});
|
|
10954
10957
|
}
|
|
10955
10958
|
function G(R) {
|
|
10956
10959
|
R.disabled || R.locked || (O(), R.onSelect());
|
|
10957
10960
|
}
|
|
10958
|
-
function B(R,
|
|
10959
|
-
if (
|
|
10961
|
+
function B(R, V) {
|
|
10962
|
+
if (V.disabled || V.locked) {
|
|
10960
10963
|
R.preventDefault();
|
|
10961
10964
|
return;
|
|
10962
10965
|
}
|
|
@@ -10967,28 +10970,28 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
10967
10970
|
l || R.target !== R.currentTarget || !["opacity", "transform"].includes(R.propertyName) || N();
|
|
10968
10971
|
}
|
|
10969
10972
|
function X(R) {
|
|
10970
|
-
|
|
10973
|
+
ne(), R.key === "ArrowDown" || R.key === "Enter" || R.key === " " ? (R.preventDefault(), K("first", "keyboard")) : R.key === "ArrowUp" && (R.preventDefault(), K("last", "keyboard"));
|
|
10971
10974
|
}
|
|
10972
10975
|
function Y(R) {
|
|
10973
10976
|
!R.isPrimary || R.button !== 0 || (_.current = !0, h(!0));
|
|
10974
10977
|
}
|
|
10975
|
-
function
|
|
10978
|
+
function ne() {
|
|
10976
10979
|
_.current = !1, h(!1);
|
|
10977
10980
|
}
|
|
10978
|
-
function
|
|
10981
|
+
function z(R) {
|
|
10979
10982
|
R.isPrimary && h(!1);
|
|
10980
10983
|
}
|
|
10981
10984
|
function te(R) {
|
|
10982
|
-
R.isPrimary &&
|
|
10985
|
+
R.isPrimary && ne();
|
|
10983
10986
|
}
|
|
10984
10987
|
function q(R) {
|
|
10985
10988
|
if (l)
|
|
10986
10989
|
O();
|
|
10987
10990
|
else {
|
|
10988
|
-
const
|
|
10989
|
-
K("first",
|
|
10991
|
+
const V = _.current && R.detail > 0 ? "pointer" : "keyboard";
|
|
10992
|
+
K("first", V);
|
|
10990
10993
|
}
|
|
10991
|
-
|
|
10994
|
+
ne();
|
|
10992
10995
|
}
|
|
10993
10996
|
function $(R) {
|
|
10994
10997
|
(R.key === "Escape" || R.key === "Tab" || R.key === "Enter" || R.key === " ") && g("keyboard"), R.key === "Tab" ? (R.preventDefault(), Vn(u.current, R.shiftKey), O(!1)) : R.key === "Escape" ? I(R) : M(R);
|
|
@@ -11007,10 +11010,10 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
11007
11010
|
disabled: !k || void 0,
|
|
11008
11011
|
"data-pressed": p || void 0,
|
|
11009
11012
|
onPointerDown: Y,
|
|
11010
|
-
onPointerUp:
|
|
11013
|
+
onPointerUp: z,
|
|
11011
11014
|
onPointerCancel: te,
|
|
11012
11015
|
onPointerLeave: te,
|
|
11013
|
-
onBlur:
|
|
11016
|
+
onBlur: ne,
|
|
11014
11017
|
onClick: q,
|
|
11015
11018
|
onKeyDown: X,
|
|
11016
11019
|
children: [
|
|
@@ -11043,18 +11046,18 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
11043
11046
|
inert: l ? void 0 : !0,
|
|
11044
11047
|
onKeyDown: $,
|
|
11045
11048
|
onTransitionEnd: Z,
|
|
11046
|
-
children: t.map((R,
|
|
11049
|
+
children: t.map((R, V) => {
|
|
11047
11050
|
if (R.type === "separator")
|
|
11048
|
-
return /* @__PURE__ */ n("div", { className: "menu__separator", role: "separator" }, `sep-${
|
|
11051
|
+
return /* @__PURE__ */ n("div", { className: "menu__separator", role: "separator" }, `sep-${V}`);
|
|
11049
11052
|
if (R.type === "section")
|
|
11050
|
-
return /* @__PURE__ */ n("div", { className: "menu__section", role: "presentation", children: R.label }, `sec-${
|
|
11053
|
+
return /* @__PURE__ */ n("div", { className: "menu__section", role: "presentation", children: R.label }, `sec-${V}`);
|
|
11051
11054
|
if (R.type === "link") {
|
|
11052
11055
|
const W = !R.disabled && !R.locked, ie = R.icon ?? (R.locked ? /* @__PURE__ */ n(Gn, { size: 16, strokeWidth: oe, "aria-hidden": "true" }) : null);
|
|
11053
11056
|
return /* @__PURE__ */ b(
|
|
11054
11057
|
"a",
|
|
11055
11058
|
{
|
|
11056
11059
|
ref: (H) => {
|
|
11057
|
-
P.current[
|
|
11060
|
+
P.current[V] = H;
|
|
11058
11061
|
},
|
|
11059
11062
|
role: "menuitem",
|
|
11060
11063
|
tabIndex: -1,
|
|
@@ -11067,7 +11070,7 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
11067
11070
|
},
|
|
11068
11071
|
onClick: (H) => B(H, R),
|
|
11069
11072
|
children: [
|
|
11070
|
-
ie ? /* @__PURE__ */ n("span", { className: "menu__item-icon", children: ie }) : T.has(
|
|
11073
|
+
ie ? /* @__PURE__ */ n("span", { className: "menu__item-icon", children: ie }) : T.has(V) ? /* @__PURE__ */ n("span", { className: "menu__item-icon-placeholder", "aria-hidden": "true" }) : null,
|
|
11071
11074
|
R.locked ? /* @__PURE__ */ b("span", { className: "menu__item-content", children: [
|
|
11072
11075
|
/* @__PURE__ */ n("span", { className: "menu__item-label", children: R.label }),
|
|
11073
11076
|
/* @__PURE__ */ n("span", { className: "menu__item-reason", "aria-hidden": "true", children: R.lockedReason })
|
|
@@ -11083,7 +11086,7 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
11083
11086
|
"button",
|
|
11084
11087
|
{
|
|
11085
11088
|
ref: (W) => {
|
|
11086
|
-
P.current[
|
|
11089
|
+
P.current[V] = W;
|
|
11087
11090
|
},
|
|
11088
11091
|
type: "button",
|
|
11089
11092
|
role: "menuitem",
|
|
@@ -11093,7 +11096,7 @@ function Pd({ label: e, entries: t, withChevron: r, align: o = "start", triggerC
|
|
|
11093
11096
|
className: `menu__item${R.danger ? " menu__item--danger" : ""}${R.locked ? " menu__item--locked" : ""}`,
|
|
11094
11097
|
onClick: () => G(R),
|
|
11095
11098
|
children: [
|
|
11096
|
-
F ? /* @__PURE__ */ n("span", { className: "menu__item-icon", children: F }) : T.has(
|
|
11099
|
+
F ? /* @__PURE__ */ n("span", { className: "menu__item-icon", children: F }) : T.has(V) ? /* @__PURE__ */ n("span", { className: "menu__item-icon-placeholder", "aria-hidden": "true" }) : null,
|
|
11097
11100
|
R.locked ? /* @__PURE__ */ b("span", { className: "menu__item-content", children: [
|
|
11098
11101
|
/* @__PURE__ */ n("span", { className: "menu__item-label", children: R.label }),
|
|
11099
11102
|
/* @__PURE__ */ n("span", { className: "menu__item-reason", "aria-hidden": "true", children: R.lockedReason })
|
|
@@ -11119,32 +11122,32 @@ function Dd({ options: e, defaultSelected: t = [], placeholder: r, onChange: o,
|
|
|
11119
11122
|
}
|
|
11120
11123
|
const X = (H) => D.includes(H);
|
|
11121
11124
|
function Y(H) {
|
|
11122
|
-
Z(X(H) ? D.filter((
|
|
11125
|
+
Z(X(H) ? D.filter((re) => re !== H) : [...D, H]);
|
|
11123
11126
|
}
|
|
11124
|
-
function
|
|
11125
|
-
const H = u.map((
|
|
11126
|
-
Z(i ? [...D, ...H.filter((
|
|
11127
|
+
function ne() {
|
|
11128
|
+
const H = u.map((re) => re.value);
|
|
11129
|
+
Z(i ? [...D, ...H.filter((re) => !D.includes(re))] : H);
|
|
11127
11130
|
}
|
|
11128
|
-
const
|
|
11131
|
+
const z = (H) => u.find((re) => re.value === H)?.label ?? H;
|
|
11129
11132
|
function te() {
|
|
11130
11133
|
E(void 0);
|
|
11131
11134
|
}
|
|
11132
11135
|
function q(H) {
|
|
11133
|
-
E((
|
|
11136
|
+
E((re) => re === H ? void 0 : re);
|
|
11134
11137
|
}
|
|
11135
11138
|
function $(H) {
|
|
11136
11139
|
if (u.length === 0) return;
|
|
11137
|
-
const
|
|
11138
|
-
k(
|
|
11140
|
+
const re = Math.min(Math.max(H, 0), u.length - 1);
|
|
11141
|
+
k(re), te(), window.requestAnimationFrame(() => L.current[re]?.focus());
|
|
11139
11142
|
}
|
|
11140
11143
|
function R() {
|
|
11141
11144
|
if (!T) return;
|
|
11142
|
-
const H = u.findIndex((U) => X(U.value)),
|
|
11143
|
-
k(
|
|
11144
|
-
|
|
11145
|
+
const H = u.findIndex((U) => X(U.value)), re = H === -1 && u.length > 0 ? 0 : H;
|
|
11146
|
+
k(re), te(), v(!0), window.requestAnimationFrame(() => {
|
|
11147
|
+
re === -1 ? M.current?.focus() : L.current[re]?.focus();
|
|
11145
11148
|
});
|
|
11146
11149
|
}
|
|
11147
|
-
function
|
|
11150
|
+
function V(H = !0) {
|
|
11148
11151
|
G.current !== void 0 && window.cancelAnimationFrame(G.current), G.current = void 0, B.current = !1, te(), v(!1), H && M.current?.focus();
|
|
11149
11152
|
}
|
|
11150
11153
|
_e(() => {
|
|
@@ -11165,15 +11168,15 @@ function Dd({ options: e, defaultSelected: t = [], placeholder: r, onChange: o,
|
|
|
11165
11168
|
}
|
|
11166
11169
|
if (!B.current) return;
|
|
11167
11170
|
if (H !== document.body) {
|
|
11168
|
-
|
|
11171
|
+
V(!1);
|
|
11169
11172
|
return;
|
|
11170
11173
|
}
|
|
11171
|
-
const
|
|
11174
|
+
const re = u.findIndex((le) => X(le.value)), U = re === -1 && u.length > 0 ? 0 : re;
|
|
11172
11175
|
k(U), U === -1 ? M.current?.focus() : L.current[U]?.focus();
|
|
11173
11176
|
}, [w, e]), se(() => {
|
|
11174
11177
|
if (!w) return;
|
|
11175
|
-
function H(
|
|
11176
|
-
x.current && !x.current.contains(
|
|
11178
|
+
function H(re) {
|
|
11179
|
+
x.current && !x.current.contains(re.target) && !K.current?.contains(re.target) && V(!1);
|
|
11177
11180
|
}
|
|
11178
11181
|
return document.addEventListener("mousedown", H), () => document.removeEventListener("mousedown", H);
|
|
11179
11182
|
}, [w]), se(() => {
|
|
@@ -11183,9 +11186,9 @@ function Dd({ options: e, defaultSelected: t = [], placeholder: r, onChange: o,
|
|
|
11183
11186
|
G.current !== void 0 && window.cancelAnimationFrame(G.current);
|
|
11184
11187
|
}, []);
|
|
11185
11188
|
function J(H) {
|
|
11186
|
-
const
|
|
11187
|
-
if (!(
|
|
11188
|
-
if (
|
|
11189
|
+
const re = H.relatedTarget;
|
|
11190
|
+
if (!(re instanceof Node && H.currentTarget.contains(re))) {
|
|
11191
|
+
if (re === null) {
|
|
11189
11192
|
const U = H.currentTarget;
|
|
11190
11193
|
G.current = window.requestAnimationFrame(() => {
|
|
11191
11194
|
if (G.current = void 0, !document.hasFocus() || !U.isConnected || U.contains(document.activeElement)) return;
|
|
@@ -11194,12 +11197,12 @@ function Dd({ options: e, defaultSelected: t = [], placeholder: r, onChange: o,
|
|
|
11194
11197
|
});
|
|
11195
11198
|
return;
|
|
11196
11199
|
}
|
|
11197
|
-
B.current = !1,
|
|
11200
|
+
B.current = !1, V(!1);
|
|
11198
11201
|
}
|
|
11199
11202
|
}
|
|
11200
11203
|
function F(H) {
|
|
11201
11204
|
if (H.key === "Escape") {
|
|
11202
|
-
H.preventDefault(), H.stopPropagation(),
|
|
11205
|
+
H.preventDefault(), H.stopPropagation(), V();
|
|
11203
11206
|
return;
|
|
11204
11207
|
}
|
|
11205
11208
|
if (H.key === "Tab") {
|
|
@@ -11208,23 +11211,23 @@ function Dd({ options: e, defaultSelected: t = [], placeholder: r, onChange: o,
|
|
|
11208
11211
|
if (H.shiftKey && le && ye)
|
|
11209
11212
|
ye.focus();
|
|
11210
11213
|
else if (H.shiftKey)
|
|
11211
|
-
|
|
11214
|
+
V(!1), M.current?.focus();
|
|
11212
11215
|
else if (H.target === ye)
|
|
11213
11216
|
S >= 0 ? L.current[S]?.focus() : M.current?.focus();
|
|
11214
11217
|
else {
|
|
11215
11218
|
const he = M.current, Ce = Array.from(he?.ownerDocument.querySelectorAll(
|
|
11216
11219
|
'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
11217
11220
|
) ?? []).filter(($e) => !K.current?.contains($e) && !$e.closest("[inert], [hidden]") && $e.tabIndex >= 0 && $e.getClientRects().length > 0), Me = Ce[Ce.indexOf(he) + 1];
|
|
11218
|
-
|
|
11221
|
+
V(!1), Me?.focus();
|
|
11219
11222
|
}
|
|
11220
11223
|
return;
|
|
11221
11224
|
}
|
|
11222
|
-
const
|
|
11223
|
-
if (!
|
|
11224
|
-
const U = Number(
|
|
11225
|
+
const re = H.target.closest(".multi-select__option");
|
|
11226
|
+
if (!re) return;
|
|
11227
|
+
const U = Number(re.dataset.optionIndex);
|
|
11225
11228
|
H.key === "ArrowDown" ? (H.preventDefault(), $(U + 1)) : H.key === "ArrowUp" ? (H.preventDefault(), $(U - 1)) : H.key === "Home" ? (H.preventDefault(), $(0)) : H.key === "End" && (H.preventDefault(), $(u.length - 1));
|
|
11226
11229
|
}
|
|
11227
|
-
const W = D.length === 0 ? r : D.length === 1 ?
|
|
11230
|
+
const W = D.length === 0 ? r : D.length === 1 ? z(D[0]) : `已选 ${D.length} 项`, ie = D.length === 0 ? "未选择任何项" : `已选 ${D.length} 项:${D.map(z).join("、")}`;
|
|
11228
11231
|
return /* @__PURE__ */ b("div", { className: "multi-select", ref: x, children: [
|
|
11229
11232
|
/* @__PURE__ */ b(
|
|
11230
11233
|
"button",
|
|
@@ -11249,12 +11252,12 @@ function Dd({ options: e, defaultSelected: t = [], placeholder: r, onChange: o,
|
|
|
11249
11252
|
w && H.preventDefault();
|
|
11250
11253
|
},
|
|
11251
11254
|
onBlur: () => {
|
|
11252
|
-
w && u.length === 0 &&
|
|
11255
|
+
w && u.length === 0 && V(!1);
|
|
11253
11256
|
},
|
|
11254
11257
|
onKeyDown: (H) => {
|
|
11255
|
-
!w || u.length > 0 || (H.key === "Escape" ? (H.preventDefault(), H.stopPropagation(),
|
|
11258
|
+
!w || u.length > 0 || (H.key === "Escape" ? (H.preventDefault(), H.stopPropagation(), V()) : H.key === "Tab" && V(!1));
|
|
11256
11259
|
},
|
|
11257
|
-
onClick: () => w ?
|
|
11260
|
+
onClick: () => w ? V() : R(),
|
|
11258
11261
|
children: [
|
|
11259
11262
|
/* @__PURE__ */ n("span", { className: D.length === 0 ? "multi-select__placeholder" : void 0, children: W }),
|
|
11260
11263
|
/* @__PURE__ */ n(je, { size: 16, strokeWidth: oe, "aria-hidden": "true" })
|
|
@@ -11282,7 +11285,7 @@ function Dd({ options: e, defaultSelected: t = [], placeholder: r, onChange: o,
|
|
|
11282
11285
|
{
|
|
11283
11286
|
type: "button",
|
|
11284
11287
|
className: "multi-select__bulk-button",
|
|
11285
|
-
onClick: () => D.length === u.length ? Z([]) :
|
|
11288
|
+
onClick: () => D.length === u.length ? Z([]) : ne(),
|
|
11286
11289
|
children: D.length === u.length ? "全部清除" : "全选"
|
|
11287
11290
|
}
|
|
11288
11291
|
),
|
|
@@ -11292,33 +11295,33 @@ function Dd({ options: e, defaultSelected: t = [], placeholder: r, onChange: o,
|
|
|
11292
11295
|
u.length
|
|
11293
11296
|
] })
|
|
11294
11297
|
] }) : null,
|
|
11295
|
-
/* @__PURE__ */ n("div", { id: _, role: "listbox", "aria-multiselectable": "true", "aria-label": r, children: u.map((H,
|
|
11298
|
+
/* @__PURE__ */ n("div", { id: _, role: "listbox", "aria-multiselectable": "true", "aria-label": r, children: u.map((H, re) => {
|
|
11296
11299
|
const U = X(H.value);
|
|
11297
11300
|
return /* @__PURE__ */ b(
|
|
11298
11301
|
"button",
|
|
11299
11302
|
{
|
|
11300
11303
|
ref: (le) => {
|
|
11301
|
-
L.current[
|
|
11304
|
+
L.current[re] = le;
|
|
11302
11305
|
},
|
|
11303
11306
|
type: "button",
|
|
11304
11307
|
role: "option",
|
|
11305
11308
|
"aria-selected": U,
|
|
11306
11309
|
"aria-label": `选择 ${H.label}`,
|
|
11307
|
-
"data-option-index":
|
|
11308
|
-
"data-multi-select-pointer-pressed": P ===
|
|
11309
|
-
tabIndex: S ===
|
|
11310
|
+
"data-option-index": re,
|
|
11311
|
+
"data-multi-select-pointer-pressed": P === re ? "true" : void 0,
|
|
11312
|
+
tabIndex: S === re ? 0 : -1,
|
|
11310
11313
|
className: "multi-select__option",
|
|
11311
11314
|
onFocus: () => {
|
|
11312
|
-
k(
|
|
11315
|
+
k(re);
|
|
11313
11316
|
},
|
|
11314
11317
|
onPointerDown: (le) => {
|
|
11315
|
-
le.isPrimary && le.button === 0 && E(
|
|
11318
|
+
le.isPrimary && le.button === 0 && E(re);
|
|
11316
11319
|
},
|
|
11317
|
-
onPointerUp: () => q(
|
|
11318
|
-
onPointerCancel: () => q(
|
|
11319
|
-
onPointerLeave: () => q(
|
|
11320
|
-
onLostPointerCapture: () => q(
|
|
11321
|
-
onBlur: () => q(
|
|
11320
|
+
onPointerUp: () => q(re),
|
|
11321
|
+
onPointerCancel: () => q(re),
|
|
11322
|
+
onPointerLeave: () => q(re),
|
|
11323
|
+
onLostPointerCapture: () => q(re),
|
|
11324
|
+
onBlur: () => q(re),
|
|
11322
11325
|
onClick: () => Y(H.value),
|
|
11323
11326
|
children: [
|
|
11324
11327
|
/* @__PURE__ */ n("span", { className: `multi-select__check${U ? " multi-select__check--on" : ""}`, "aria-hidden": "true", children: U ? /* @__PURE__ */ n(Be, { size: 12, strokeWidth: 3 }) : null }),
|
|
@@ -12026,7 +12029,7 @@ function Mc(e) {
|
|
|
12026
12029
|
children: [
|
|
12027
12030
|
/* @__PURE__ */ n("div", { className: "calendar__weekdays", role: "row", children: Tc.map((M, K) => /* @__PURE__ */ n("span", { className: "calendar__weekday", role: "columnheader", "aria-label": `星期${M}`, children: M }, `${M}-${K}`)) }),
|
|
12028
12031
|
x.map((M, K) => /* @__PURE__ */ n("div", { className: "calendar__row", role: "row", children: M.map(({ date: O, inMonth: L }) => {
|
|
12029
|
-
const G = !L || Qt(O, r, o), B = ut(O, I.start), Z = ut(O, I.end), X = !!I.start && !!I.end && !ut(I.start, I.end), Y = X && De(O) > De(I.start) && De(O) < De(I.end),
|
|
12032
|
+
const G = !L || Qt(O, r, o), B = ut(O, I.start), Z = ut(O, I.end), X = !!I.start && !!I.end && !ut(I.start, I.end), Y = X && De(O) > De(I.start) && De(O) < De(I.end), ne = !!(l.start && (l.end ? De(O) >= De(l.start) && De(O) <= De(l.end) : ut(O, l.start))), z = be(
|
|
12030
12033
|
"calendar__cell",
|
|
12031
12034
|
Y ? "calendar__cell--in-range" : "",
|
|
12032
12035
|
X && B ? "calendar__cell--range-start" : "",
|
|
@@ -12041,9 +12044,9 @@ function Mc(e) {
|
|
|
12041
12044
|
return /* @__PURE__ */ n(
|
|
12042
12045
|
"div",
|
|
12043
12046
|
{
|
|
12044
|
-
className:
|
|
12047
|
+
className: z,
|
|
12045
12048
|
role: "gridcell",
|
|
12046
|
-
"aria-selected":
|
|
12049
|
+
"aria-selected": ne,
|
|
12047
12050
|
"aria-disabled": G || void 0,
|
|
12048
12051
|
children: /* @__PURE__ */ n(
|
|
12049
12052
|
"button",
|
|
@@ -12079,10 +12082,10 @@ function Sd(e) {
|
|
|
12079
12082
|
}
|
|
12080
12083
|
function Sc(e) {
|
|
12081
12084
|
const { layout: t = "vertical", trigger: r = "default", size: o = "large", fieldSize: i = "md", minValue: a, maxValue: s, pinnedTimezone: l, today: c, withTime: m = !1, disabled: d = !1 } = e, f = e.mode === "single", g = e.mode === "single" ? { start: e.value, end: null } : e.value;
|
|
12082
|
-
function p(
|
|
12083
|
-
e.mode === "single" ? e.onChange(
|
|
12085
|
+
function p(z) {
|
|
12086
|
+
e.mode === "single" ? e.onChange(z.start) : e.onChange(z);
|
|
12084
12087
|
}
|
|
12085
|
-
const [h, u] = j(!1), [y, _] = j(!1), C = ve((
|
|
12088
|
+
const [h, u] = j(!1), [y, _] = j(!1), C = ve((z) => _(z), []), [w, v] = j(g), [I, N] = j("keyboard"), D = A(null), T = A(null), S = A(null), k = A(!1), P = A(null), E = A(!1), x = we();
|
|
12086
12089
|
se(() => {
|
|
12087
12090
|
h || (v(g), k.current && (k.current = !1, S.current?.focus()));
|
|
12088
12091
|
}, [h, e.value]), se(() => {
|
|
@@ -12101,8 +12104,8 @@ function Sc(e) {
|
|
|
12101
12104
|
restoreFocus: !y,
|
|
12102
12105
|
deferPortalUntilReady: !0,
|
|
12103
12106
|
registrationTiming: "layout",
|
|
12104
|
-
onClose: (
|
|
12105
|
-
u(!1),
|
|
12107
|
+
onClose: (z) => {
|
|
12108
|
+
u(!1), z !== "outside-pointer" && S.current?.focus();
|
|
12106
12109
|
}
|
|
12107
12110
|
});
|
|
12108
12111
|
xc({
|
|
@@ -12113,21 +12116,21 @@ function Sc(e) {
|
|
|
12113
12116
|
triggerRef: S.current ? S : T
|
|
12114
12117
|
}), se(() => {
|
|
12115
12118
|
if (!h || y || !O) return;
|
|
12116
|
-
const
|
|
12117
|
-
(
|
|
12119
|
+
const z = P.current;
|
|
12120
|
+
(z?.querySelector('.calendar__day[tabindex="0"]') ?? z?.querySelector("button:not([disabled]), input:not([disabled])"))?.focus({ preventScroll: !0 });
|
|
12118
12121
|
}, [h, O, y]);
|
|
12119
12122
|
const L = !!g.start && (f || !!g.end), G = f ? "选择日期" : "选择日期区间", B = L ? f ? Pn(g.start, m) : `${Pn(g.start, m)} ~ ${Pn(g.end, m)}` : G;
|
|
12120
|
-
function Z(
|
|
12123
|
+
function Z(z) {
|
|
12121
12124
|
if (d) return;
|
|
12122
|
-
const te =
|
|
12125
|
+
const te = z.currentTarget, q = E.current && z.detail !== 0;
|
|
12123
12126
|
if (E.current = !1, h) {
|
|
12124
12127
|
u(!1);
|
|
12125
12128
|
return;
|
|
12126
12129
|
}
|
|
12127
12130
|
S.current = te, v(g), _(!1), N(q ? "pointer" : "keyboard"), u(!0);
|
|
12128
12131
|
}
|
|
12129
|
-
const X = f ? { mode: "single", value: w.start, onChange: (
|
|
12130
|
-
!
|
|
12132
|
+
const X = f ? { mode: "single", value: w.start, onChange: (z) => v({ start: z, end: null }) } : { value: w, onChange: v }, Y = /* @__PURE__ */ n(Mc, { ...X, withTime: m, size: o, minValue: a, maxValue: s, today: c }), ne = /* @__PURE__ */ n(jo, { ...X, minValue: a, maxValue: s, withTime: m, pinnedTimezone: l, onApply: (z) => {
|
|
12133
|
+
!z.start || !f && !z.end || (p(z), k.current = !0, u(!1));
|
|
12131
12134
|
} });
|
|
12132
12135
|
return /* @__PURE__ */ b("div", { className: "cal-field", ref: D, children: [
|
|
12133
12136
|
/* @__PURE__ */ b(
|
|
@@ -12200,8 +12203,8 @@ function Sc(e) {
|
|
|
12200
12203
|
className: "cal-field__clear",
|
|
12201
12204
|
"aria-label": f ? "清除已选日期" : "清除已选区间",
|
|
12202
12205
|
onClick: () => {
|
|
12203
|
-
const
|
|
12204
|
-
v(
|
|
12206
|
+
const z = { start: null, end: null };
|
|
12207
|
+
v(z), u(!1), p(z), T.current?.focus();
|
|
12205
12208
|
},
|
|
12206
12209
|
children: /* @__PURE__ */ n(Ue, { size: 14, strokeWidth: oe, "aria-hidden": "true" })
|
|
12207
12210
|
}
|
|
@@ -12212,7 +12215,7 @@ function Sc(e) {
|
|
|
12212
12215
|
h && y ? /* @__PURE__ */ b(Pc, { id: x, title: G, triggerRef: T, onClose: () => {
|
|
12213
12216
|
u(!1), S.current?.focus();
|
|
12214
12217
|
}, children: [
|
|
12215
|
-
|
|
12218
|
+
ne,
|
|
12216
12219
|
Y
|
|
12217
12220
|
] }) : null,
|
|
12218
12221
|
h && !y ? K(
|
|
@@ -12229,9 +12232,9 @@ function Sc(e) {
|
|
|
12229
12232
|
onKeyDown: M,
|
|
12230
12233
|
children: t === "horizontal" ? /* @__PURE__ */ b(ke, { children: [
|
|
12231
12234
|
Y,
|
|
12232
|
-
|
|
12235
|
+
ne
|
|
12233
12236
|
] }) : /* @__PURE__ */ b(ke, { children: [
|
|
12234
|
-
|
|
12237
|
+
ne,
|
|
12235
12238
|
Y
|
|
12236
12239
|
] })
|
|
12237
12240
|
}
|
|
@@ -12514,74 +12517,74 @@ function Od({
|
|
|
12514
12517
|
onCommand: m,
|
|
12515
12518
|
disabled: d = !1
|
|
12516
12519
|
}) {
|
|
12517
|
-
const f = we(), g = A(null), [p, h] = j(""), [u, y] = j(0), [_, C] = j(0), [w, v] = j(!1), I = A(0), [N, D] = j(!1), [T, S] = j([]), k = Ac(s, o, i), P = Lc(p, u, k), E = p.slice(0, u).match(/(?:^|\n)\/([^\s/]*)$/), x = !!E, M = k.some((
|
|
12520
|
+
const f = we(), g = A(null), [p, h] = j(""), [u, y] = j(0), [_, C] = j(0), [w, v] = j(!1), I = A(0), [N, D] = j(!1), [T, S] = j([]), k = Ac(s, o, i), P = Lc(p, u, k), E = p.slice(0, u).match(/(?:^|\n)\/([^\s/]*)$/), x = !!E, M = k.some((z) => z.char === "@"), K = P?.trigger, O = Oc(!d && !N && !x ? P?.query : void 0, K?.onQuery), L = E ? c.filter((z) => [z.label, ...z.keywords ?? []].some((te) => te.includes(E[1]))) : P ? K?.onQuery ? O.matches : (K?.options ?? []).filter((z) => z.label.includes(P.query)) : [], G = !d && !N && (L.length > 0 || !!(!x && P && K?.onQuery)), B = Math.min(_, Math.max(0, L.length - 1));
|
|
12518
12521
|
_e(() => {
|
|
12519
|
-
const
|
|
12520
|
-
if (!
|
|
12521
|
-
|
|
12522
|
-
const te = Number.parseFloat(getComputedStyle(
|
|
12523
|
-
|
|
12522
|
+
const z = g.current;
|
|
12523
|
+
if (!z) return;
|
|
12524
|
+
z.style.height = "auto";
|
|
12525
|
+
const te = Number.parseFloat(getComputedStyle(z).maxHeight);
|
|
12526
|
+
z.style.height = `${Math.min(z.scrollHeight, te)}px`;
|
|
12524
12527
|
}, [p]);
|
|
12525
|
-
function Z(
|
|
12528
|
+
function Z(z, te) {
|
|
12526
12529
|
let q = 0;
|
|
12527
|
-
const $ = Math.max(0, te - Math.max(0,
|
|
12528
|
-
for (; q < $ && q < p.length && q <
|
|
12529
|
-
let R = p.length,
|
|
12530
|
-
for (; R > q &&
|
|
12531
|
-
R--,
|
|
12532
|
-
const J =
|
|
12533
|
-
S((F) => F.flatMap((W) => R <= W.start ? [{ ...W, start: W.start + J, end: W.end + J }] : q >= W.end ? [W] : [])), h(
|
|
12534
|
-
}
|
|
12535
|
-
function X(
|
|
12536
|
-
!d && t &&
|
|
12537
|
-
}
|
|
12538
|
-
function Y(
|
|
12530
|
+
const $ = Math.max(0, te - Math.max(0, z.length - p.length));
|
|
12531
|
+
for (; q < $ && q < p.length && q < z.length && p[q] === z[q]; ) q++;
|
|
12532
|
+
let R = p.length, V = z.length;
|
|
12533
|
+
for (; R > q && V > q && p[R - 1] === z[V - 1]; )
|
|
12534
|
+
R--, V--;
|
|
12535
|
+
const J = V - R;
|
|
12536
|
+
S((F) => F.flatMap((W) => R <= W.start ? [{ ...W, start: W.start + J, end: W.end + J }] : q >= W.end ? [W] : [])), h(z), y(te), D(!1), C(0);
|
|
12537
|
+
}
|
|
12538
|
+
function X(z) {
|
|
12539
|
+
!d && t && z.length && t(z);
|
|
12540
|
+
}
|
|
12541
|
+
function Y(z) {
|
|
12539
12542
|
if (x) {
|
|
12540
|
-
const
|
|
12543
|
+
const V = u - (E?.[1].length ?? 0) - 1, J = p.slice(0, V) + `/${z.label} `;
|
|
12541
12544
|
en(() => {
|
|
12542
12545
|
Z(J + p.slice(u), J.length), D(!0);
|
|
12543
12546
|
}), g.current?.focus(), g.current?.setSelectionRange(J.length, J.length);
|
|
12544
12547
|
return;
|
|
12545
12548
|
}
|
|
12546
12549
|
if (!P) return;
|
|
12547
|
-
const te = P.start, q = P.trigger.toToken?.(
|
|
12550
|
+
const te = P.start, q = P.trigger.toToken?.(z) ?? `${P.trigger.char}${z.label}`, $ = p.slice(0, te) + q + " ";
|
|
12548
12551
|
en(() => {
|
|
12549
12552
|
h($ + p.slice(u)), y($.length), D(!0);
|
|
12550
12553
|
});
|
|
12551
12554
|
const R = $.length - u;
|
|
12552
|
-
S((
|
|
12553
|
-
...
|
|
12554
|
-
{ person:
|
|
12555
|
+
S((V) => [
|
|
12556
|
+
...V.flatMap((J) => J.end <= te ? [J] : J.start >= u ? [{ ...J, start: J.start + R, end: J.end + R }] : []),
|
|
12557
|
+
{ person: z, char: P.trigger.char, token: q, start: te, end: $.length - 1 }
|
|
12555
12558
|
]), g.current?.focus(), g.current?.setSelectionRange($.length, $.length);
|
|
12556
12559
|
}
|
|
12557
|
-
function
|
|
12560
|
+
function ne() {
|
|
12558
12561
|
if (d || !p.trim()) return;
|
|
12559
|
-
const
|
|
12560
|
-
|
|
12562
|
+
const z = p.trim(), te = T.filter((J) => p.slice(J.start, J.end) === J.token), q = [...new Set(te.filter((J) => J.char === "@").map((J) => J.person.id))], $ = te.map(({ char: J, person: F }) => ({ char: J, id: F.id, label: F.label })), R = z.match(/^\/(\S+)(?:\s+([\s\S]*))?$/), V = c.find((J) => J.label === R?.[1]);
|
|
12563
|
+
V && m ? m(V.id, R?.[2]?.trim() ?? "") : e({ text: z, mentionIds: q, references: $ }), h(""), S([]), D(!0), y(0);
|
|
12561
12564
|
}
|
|
12562
12565
|
return /* @__PURE__ */ b(
|
|
12563
12566
|
"form",
|
|
12564
12567
|
{
|
|
12565
12568
|
className: "composer",
|
|
12566
|
-
onSubmit: (
|
|
12567
|
-
|
|
12569
|
+
onSubmit: (z) => {
|
|
12570
|
+
z.preventDefault(), ne();
|
|
12568
12571
|
},
|
|
12569
12572
|
children: [
|
|
12570
12573
|
G ? /* @__PURE__ */ b("div", { className: "composer__mentions", children: [
|
|
12571
|
-
/* @__PURE__ */ n("ul", { className: "composer__options", id: `${f}-mentions`, role: "listbox", "aria-label": x ? "快捷命令" : K?.label, children: L.map((
|
|
12574
|
+
/* @__PURE__ */ n("ul", { className: "composer__options", id: `${f}-mentions`, role: "listbox", "aria-label": x ? "快捷命令" : K?.label, children: L.map((z, te) => /* @__PURE__ */ b(
|
|
12572
12575
|
"li",
|
|
12573
12576
|
{
|
|
12574
12577
|
id: `${f}-option-${te}`,
|
|
12575
12578
|
role: "option",
|
|
12576
12579
|
"aria-selected": te === B,
|
|
12577
12580
|
onPointerDown: (q) => q.preventDefault(),
|
|
12578
|
-
onClick: () => Y(
|
|
12581
|
+
onClick: () => Y(z),
|
|
12579
12582
|
children: [
|
|
12580
|
-
|
|
12581
|
-
|
|
12583
|
+
z.label,
|
|
12584
|
+
z.description ? /* @__PURE__ */ n("span", { children: z.description }) : null
|
|
12582
12585
|
]
|
|
12583
12586
|
},
|
|
12584
|
-
|
|
12587
|
+
z.id
|
|
12585
12588
|
)) }),
|
|
12586
12589
|
!x && K?.onQuery && !L.length ? /* @__PURE__ */ b("div", { className: "composer__mention-status", children: [
|
|
12587
12590
|
/* @__PURE__ */ n("span", { role: "status", children: O.state === "loading" ? K.char === "@" ? "正在加载成员…" : `正在加载${K.label}…` : O.state === "error" ? K.errorText ?? (K.char === "@" ? "无法加载成员,请重试。" : `无法加载${K.label},请重试。`) : K.emptyText ?? (K.char === "@" ? "没有匹配的成员" : `没有匹配的${K.label}`) }),
|
|
@@ -12594,17 +12597,17 @@ function Od({
|
|
|
12594
12597
|
"div",
|
|
12595
12598
|
{
|
|
12596
12599
|
className: `composer__box${w ? " composer__box--dragging" : ""}`,
|
|
12597
|
-
onDragEnter: (
|
|
12598
|
-
d || !t || !
|
|
12600
|
+
onDragEnter: (z) => {
|
|
12601
|
+
d || !t || !z.dataTransfer.types.includes("Files") || (z.preventDefault(), I.current++, v(!0));
|
|
12599
12602
|
},
|
|
12600
|
-
onDragOver: (
|
|
12601
|
-
d || !t || !
|
|
12603
|
+
onDragOver: (z) => {
|
|
12604
|
+
d || !t || !z.dataTransfer.types.includes("Files") || (z.preventDefault(), z.dataTransfer.dropEffect = "copy", v(!0));
|
|
12602
12605
|
},
|
|
12603
12606
|
onDragLeave: () => {
|
|
12604
12607
|
I.current = Math.max(0, I.current - 1), I.current || v(!1);
|
|
12605
12608
|
},
|
|
12606
|
-
onDrop: (
|
|
12607
|
-
I.current = 0, v(!1), !(d || !t || !
|
|
12609
|
+
onDrop: (z) => {
|
|
12610
|
+
I.current = 0, v(!1), !(d || !t || !z.dataTransfer.files.length) && (z.preventDefault(), X(Array.from(z.dataTransfer.files)));
|
|
12608
12611
|
},
|
|
12609
12612
|
children: [
|
|
12610
12613
|
w ? /* @__PURE__ */ n("p", { className: "composer__drop", role: "status", children: "松开即添加为附件" }) : null,
|
|
@@ -12625,30 +12628,30 @@ function Od({
|
|
|
12625
12628
|
"aria-controls": G ? `${f}-mentions` : void 0,
|
|
12626
12629
|
"aria-activedescendant": G && L.length ? `${f}-option-${B}` : void 0,
|
|
12627
12630
|
"aria-describedby": `${f}-hint`,
|
|
12628
|
-
onPaste: (
|
|
12629
|
-
const te = Array.from(
|
|
12630
|
-
!d && t && te.length && (
|
|
12631
|
+
onPaste: (z) => {
|
|
12632
|
+
const te = Array.from(z.clipboardData.files);
|
|
12633
|
+
!d && t && te.length && (z.preventDefault(), X(te));
|
|
12631
12634
|
},
|
|
12632
|
-
onChange: (
|
|
12633
|
-
onSelect: (
|
|
12634
|
-
onBlur: (
|
|
12635
|
-
|
|
12635
|
+
onChange: (z) => Z(z.target.value, z.target.selectionStart),
|
|
12636
|
+
onSelect: (z) => y(z.currentTarget.selectionStart),
|
|
12637
|
+
onBlur: (z) => {
|
|
12638
|
+
z.currentTarget.form?.contains(z.relatedTarget) || D(!0);
|
|
12636
12639
|
},
|
|
12637
|
-
onKeyDown: (
|
|
12638
|
-
if (!(
|
|
12639
|
-
if (G && L.length && (
|
|
12640
|
-
|
|
12640
|
+
onKeyDown: (z) => {
|
|
12641
|
+
if (!(z.nativeEvent.isComposing || z.nativeEvent.keyCode === 229)) {
|
|
12642
|
+
if (G && L.length && (z.key === "ArrowDown" || z.key === "ArrowUp")) {
|
|
12643
|
+
z.preventDefault(), C((B + (z.key === "ArrowDown" ? 1 : -1) + L.length) % L.length);
|
|
12641
12644
|
return;
|
|
12642
12645
|
}
|
|
12643
|
-
if (G &&
|
|
12644
|
-
|
|
12646
|
+
if (G && z.key === "Escape") {
|
|
12647
|
+
z.preventDefault(), D(!0);
|
|
12645
12648
|
return;
|
|
12646
12649
|
}
|
|
12647
|
-
if (G &&
|
|
12648
|
-
|
|
12650
|
+
if (G && z.key === "Enter" && !z.shiftKey) {
|
|
12651
|
+
z.preventDefault(), L.length ? Y(L[B]) : K?.onQuery && O.state === "error" && O.retry();
|
|
12649
12652
|
return;
|
|
12650
12653
|
}
|
|
12651
|
-
|
|
12654
|
+
z.key === "Enter" && !z.shiftKey && (z.preventDefault(), ne());
|
|
12652
12655
|
}
|
|
12653
12656
|
}
|
|
12654
12657
|
}
|
|
@@ -12677,9 +12680,9 @@ function Od({
|
|
|
12677
12680
|
"aria-label": "提及成员",
|
|
12678
12681
|
disabled: d,
|
|
12679
12682
|
onClick: () => {
|
|
12680
|
-
const
|
|
12681
|
-
Z(p.slice(0,
|
|
12682
|
-
g.current?.focus(), g.current?.setSelectionRange(
|
|
12683
|
+
const z = g.current?.selectionStart ?? p.length;
|
|
12684
|
+
Z(p.slice(0, z) + "@" + p.slice(z), z + 1), requestAnimationFrame(() => {
|
|
12685
|
+
g.current?.focus(), g.current?.setSelectionRange(z + 1, z + 1);
|
|
12683
12686
|
});
|
|
12684
12687
|
},
|
|
12685
12688
|
children: [
|
|
@@ -12699,13 +12702,13 @@ function Od({
|
|
|
12699
12702
|
/* @__PURE__ */ n(Ge, { children: "/" }),
|
|
12700
12703
|
" 选择快捷命令,"
|
|
12701
12704
|
] }) : null,
|
|
12702
|
-
k.map((
|
|
12705
|
+
k.map((z) => /* @__PURE__ */ b("span", { children: [
|
|
12703
12706
|
"用 ",
|
|
12704
|
-
/* @__PURE__ */ n(Ge, { children:
|
|
12707
|
+
/* @__PURE__ */ n(Ge, { children: z.char }),
|
|
12705
12708
|
" ",
|
|
12706
|
-
|
|
12709
|
+
z.label,
|
|
12707
12710
|
","
|
|
12708
|
-
] },
|
|
12711
|
+
] }, z.char)),
|
|
12709
12712
|
/* @__PURE__ */ n(Ge, { children: "Enter" }),
|
|
12710
12713
|
" 发送,",
|
|
12711
12714
|
/* @__PURE__ */ n(Ge, { children: "Shift" }),
|
|
@@ -12922,22 +12925,22 @@ function Go({
|
|
|
12922
12925
|
k && (Z.current = s);
|
|
12923
12926
|
const X = A(N);
|
|
12924
12927
|
X.current = N;
|
|
12925
|
-
const Y = A(/* @__PURE__ */ new Set()),
|
|
12928
|
+
const Y = A(/* @__PURE__ */ new Set()), ne = S?.register, z = ve((me) => {
|
|
12926
12929
|
Y.current.add(me);
|
|
12927
|
-
const ce =
|
|
12930
|
+
const ce = ne?.(me);
|
|
12928
12931
|
return () => {
|
|
12929
12932
|
Y.current.delete(me), ce?.();
|
|
12930
12933
|
};
|
|
12931
|
-
}, [
|
|
12934
|
+
}, [ne]), te = Te(() => ({ register: z, open: k }), [k, z]), q = ve((me) => x.current?.contains(me) || M.current?.contains(me) || [...Y.current].some((ce) => ce.contains(me)) || !!X.current?.some((ce) => ce.current?.contains(me)), [x]), $ = A(!1), R = A(!1), V = ve((me) => {
|
|
12932
12935
|
e === void 0 && T(me), r?.(me);
|
|
12933
12936
|
}, [e, r]), J = ve(() => {
|
|
12934
|
-
R.current || (R.current = !0,
|
|
12935
|
-
}, [
|
|
12937
|
+
R.current || (R.current = !0, V(!1), o?.());
|
|
12938
|
+
}, [V, o]), F = Te(() => ({
|
|
12936
12939
|
offset: Number.isFinite(y) ? Math.max(0, y) : 8,
|
|
12937
12940
|
fixedSide: !!(m && !m.startsWith("auto")),
|
|
12938
12941
|
matchWidth: _,
|
|
12939
12942
|
closeWhenAnchorHidden: !!a
|
|
12940
|
-
}), [a, _, y, m]), W = m ? m.startsWith("top") ? "top" : "bottom" : l, ie = m ? m.endsWith("end") ? "end" : "start" : c, { portalPopup: H, placement:
|
|
12943
|
+
}), [a, _, y, m]), W = m ? m.startsWith("top") ? "top" : "bottom" : l, ie = m ? m.endsWith("end") ? "end" : "start" : c, { portalPopup: H, placement: re, onOverlayKeyDown: U, focusInitialIfTopMost: le, portalRoot: ye, requestClose: he } = ct(k, x, M, (me) => {
|
|
12941
12944
|
if (R.current) return;
|
|
12942
12945
|
J();
|
|
12943
12946
|
const ce = M.current?.ownerDocument, Ne = ce?.activeElement;
|
|
@@ -12960,9 +12963,9 @@ function Go({
|
|
|
12960
12963
|
se(() => {
|
|
12961
12964
|
R.current = !1;
|
|
12962
12965
|
}, [k]), _e(() => {
|
|
12963
|
-
if (!(!k || !ye || !M.current || !
|
|
12964
|
-
return
|
|
12965
|
-
}, [k,
|
|
12966
|
+
if (!(!k || !ye || !M.current || !ne))
|
|
12967
|
+
return ne(M.current);
|
|
12968
|
+
}, [k, ne, ye]), _e(() => {
|
|
12966
12969
|
if (!k || !ye) return;
|
|
12967
12970
|
const me = M.current;
|
|
12968
12971
|
if (!me || me.contains(me.ownerDocument.activeElement) || G === "dialog" && !(L || !a && P.current && w !== "none") || G !== "dialog" && w === "none") return;
|
|
@@ -13008,7 +13011,7 @@ function Go({
|
|
|
13008
13011
|
a ? null : /* @__PURE__ */ n("span", { className: "popover-trigger", ref: (me) => {
|
|
13009
13012
|
E.current = me?.querySelector("button[aria-haspopup]") ?? null;
|
|
13010
13013
|
}, onClick: (me) => {
|
|
13011
|
-
me.defaultPrevented || !x.current?.contains(me.target) || (P.current = me.detail === 0,
|
|
13014
|
+
me.defaultPrevented || !x.current?.contains(me.target) || (P.current = me.detail === 0, V(!k));
|
|
13012
13015
|
}, onKeyDown: (me) => {
|
|
13013
13016
|
k && me.key === "Tab" && !me.shiftKey && x.current === me.target && (me.preventDefault(), le());
|
|
13014
13017
|
}, children: Me }),
|
|
@@ -13024,9 +13027,9 @@ function Go({
|
|
|
13024
13027
|
"aria-labelledby": h,
|
|
13025
13028
|
"aria-describedby": u,
|
|
13026
13029
|
tabIndex: -1,
|
|
13027
|
-
"data-side":
|
|
13028
|
-
"data-align":
|
|
13029
|
-
"data-placement": `${
|
|
13030
|
+
"data-side": re.side,
|
|
13031
|
+
"data-align": re.align,
|
|
13032
|
+
"data-placement": `${re.side}-${re.align}`,
|
|
13030
13033
|
"data-state": k ? "open" : "closed",
|
|
13031
13034
|
"data-anim-state": k ? "entering" : "exiting",
|
|
13032
13035
|
"aria-hidden": !k || void 0,
|
|
@@ -13367,10 +13370,10 @@ function Vc({
|
|
|
13367
13370
|
X && B && Z?.getAttribute("data-state") === "open" && (Z.scrollTop = 0, B.focus({ preventScroll: !0 }), X = B.ownerDocument.activeElement !== B);
|
|
13368
13371
|
};
|
|
13369
13372
|
Y();
|
|
13370
|
-
const
|
|
13371
|
-
|
|
13373
|
+
const ne = new MutationObserver((z) => {
|
|
13374
|
+
z.some((te) => te.attributeName === "data-state") && Z?.getAttribute("data-state") === "open" && (X = !0), Y();
|
|
13372
13375
|
});
|
|
13373
|
-
return Z &&
|
|
13376
|
+
return Z && ne.observe(Z, { attributes: !0, attributeFilter: ["style", "data-state"] }), () => ne.disconnect();
|
|
13374
13377
|
}, []), se(() => {
|
|
13375
13378
|
E && p.current?.ownerDocument.getElementById(E)?.scrollIntoView({ block: "nearest" });
|
|
13376
13379
|
}, [E]);
|
|
@@ -13387,7 +13390,7 @@ function Vc({
|
|
|
13387
13390
|
} else if (B.key === "Enter")
|
|
13388
13391
|
B.preventDefault(), k >= 0 && O(T[k]);
|
|
13389
13392
|
else if (B.key === "Tab" && !B.shiftKey) {
|
|
13390
|
-
const Y = Array.from(p.current?.closest(".multi-combobox__panel")?.querySelectorAll('button:not([disabled]), .multi-combobox__footer a[href], .multi-combobox__footer input:not([disabled]), .multi-combobox__footer select:not([disabled]), .multi-combobox__footer textarea:not([disabled]), .multi-combobox__footer [tabindex]:not([tabindex="-1"])') ?? []).find((
|
|
13393
|
+
const Y = Array.from(p.current?.closest(".multi-combobox__panel")?.querySelectorAll('button:not([disabled]), .multi-combobox__footer a[href], .multi-combobox__footer input:not([disabled]), .multi-combobox__footer select:not([disabled]), .multi-combobox__footer textarea:not([disabled]), .multi-combobox__footer [tabindex]:not([tabindex="-1"])') ?? []).find((ne) => ne !== p.current);
|
|
13391
13394
|
Y && (B.preventDefault(), Y.focus());
|
|
13392
13395
|
}
|
|
13393
13396
|
}
|
|
@@ -13422,13 +13425,13 @@ function Vc({
|
|
|
13422
13425
|
),
|
|
13423
13426
|
/* @__PURE__ */ b("ul", { ref: P.listRef, onScroll: P.onScroll, id: w, className: "multi-combobox__list", role: "listbox", "aria-label": o, "aria-multiselectable": "true", "aria-busy": c || void 0, children: [
|
|
13424
13427
|
P.indices.map((B, Z) => {
|
|
13425
|
-
const X = T[B], Y = Z > 0 ? P.indices[Z - 1] + 1 : 0,
|
|
13428
|
+
const X = T[B], Y = Z > 0 ? P.indices[Z - 1] + 1 : 0, ne = P.offsets[B] - P.offsets[Y];
|
|
13426
13429
|
return /* @__PURE__ */ b(Ve, { children: [
|
|
13427
|
-
P.virtual &&
|
|
13430
|
+
P.virtual && ne > 0 ? /* @__PURE__ */ n("li", { role: "presentation", "aria-hidden": "true", style: { height: ne } }) : null,
|
|
13428
13431
|
/* @__PURE__ */ b(
|
|
13429
13432
|
"li",
|
|
13430
13433
|
{
|
|
13431
|
-
ref: (
|
|
13434
|
+
ref: (z) => P.measure(B, z),
|
|
13432
13435
|
"data-window-key": S(X),
|
|
13433
13436
|
id: `${C}-option-${B}`,
|
|
13434
13437
|
role: "option",
|
|
@@ -13442,15 +13445,15 @@ function Vc({
|
|
|
13442
13445
|
"data-active": B === k || void 0,
|
|
13443
13446
|
"data-pressed": x === B || void 0,
|
|
13444
13447
|
className: "multi-combobox__option combobox__option",
|
|
13445
|
-
onMouseDown: (
|
|
13446
|
-
onPointerDown: (
|
|
13448
|
+
onMouseDown: (z) => z.preventDefault(),
|
|
13449
|
+
onPointerDown: (z) => M(z, B, X.disabled),
|
|
13447
13450
|
onPointerUp: () => K(B),
|
|
13448
13451
|
onPointerCancel: () => K(B),
|
|
13449
13452
|
onPointerLeave: () => K(B),
|
|
13450
13453
|
onLostPointerCapture: () => K(B),
|
|
13451
13454
|
onMouseEnter: () => !X.disabled && !N.current && I(S(X)),
|
|
13452
|
-
onMouseMove: (
|
|
13453
|
-
!
|
|
13455
|
+
onMouseMove: (z) => {
|
|
13456
|
+
!z.movementX && !z.movementY || (N.current = !1, X.disabled || I(S(X)));
|
|
13454
13457
|
},
|
|
13455
13458
|
onClick: () => O(X),
|
|
13456
13459
|
children: [
|
|
@@ -13508,36 +13511,36 @@ function jd({
|
|
|
13508
13511
|
"aria-labelledby": k,
|
|
13509
13512
|
"aria-describedby": P
|
|
13510
13513
|
}) {
|
|
13511
|
-
const E = we(), x = I ?? `${E}-trigger`, M = `${E}-summary`, K = `${E}-required`, O = `${E}-error`, L = `${E}-popup`, [G, B] = j(!1), [Z, X] = j(""), Y = A(null),
|
|
13512
|
-
function
|
|
13514
|
+
const E = we(), x = I ?? `${E}-trigger`, M = `${E}-summary`, K = `${E}-required`, O = `${E}-error`, L = `${E}-popup`, [G, B] = j(!1), [Z, X] = j(""), Y = A(null), ne = A(null), z = A(null), te = !u && !y, q = G && te, $ = !!(_ || w), R = (H) => i.find((re) => re.value === H)?.label ?? e.find((re) => re.value === H)?.label ?? H;
|
|
13515
|
+
function V(H) {
|
|
13513
13516
|
H !== G && (B(H), o?.(H));
|
|
13514
13517
|
}
|
|
13515
13518
|
se(() => {
|
|
13516
|
-
!te && G &&
|
|
13519
|
+
!te && G && V(!1);
|
|
13517
13520
|
}, [te, G]);
|
|
13518
13521
|
function J(H) {
|
|
13519
|
-
|
|
13520
|
-
const
|
|
13522
|
+
V(!1);
|
|
13523
|
+
const re = Y.current;
|
|
13521
13524
|
if (H) {
|
|
13522
|
-
|
|
13525
|
+
re?.focus();
|
|
13523
13526
|
return;
|
|
13524
13527
|
}
|
|
13525
|
-
const U = Array.from(
|
|
13528
|
+
const U = Array.from(re?.ownerDocument.querySelectorAll(
|
|
13526
13529
|
'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
13527
13530
|
) ?? []).filter((le) => !le.closest(".multi-combobox__popup, [hidden], [inert]") && !le.matches(".multi-combobox__remove") && le.tabIndex >= 0 && le.getClientRects().length > 0);
|
|
13528
|
-
U[U.indexOf(
|
|
13531
|
+
U[U.indexOf(re) + 1]?.focus();
|
|
13529
13532
|
}
|
|
13530
|
-
function F(H,
|
|
13531
|
-
te && r(H,
|
|
13533
|
+
function F(H, re) {
|
|
13534
|
+
te && r(H, re);
|
|
13532
13535
|
}
|
|
13533
13536
|
function W(H) {
|
|
13534
13537
|
c === void 0 && X(H), l?.(H);
|
|
13535
13538
|
}
|
|
13536
13539
|
function ie(H) {
|
|
13537
|
-
F(t.filter((
|
|
13540
|
+
F(t.filter((re) => re !== H), { action: "remove", option: { value: H, label: R(H) } }), q ? z.current?.focus({ preventScroll: !0 }) : Y.current?.focus();
|
|
13538
13541
|
}
|
|
13539
13542
|
return /* @__PURE__ */ b("div", { className: `multi-combobox${D ? ` ${D}` : ""}`, children: [
|
|
13540
|
-
/* @__PURE__ */ b("div", { ref:
|
|
13543
|
+
/* @__PURE__ */ b("div", { ref: ne, className: "multi-combobox__control", "data-disabled": u || void 0, "data-invalid": $ || void 0, children: [
|
|
13541
13544
|
/* @__PURE__ */ n(
|
|
13542
13545
|
"button",
|
|
13543
13546
|
{
|
|
@@ -13557,9 +13560,9 @@ function jd({
|
|
|
13557
13560
|
"aria-haspopup": "dialog",
|
|
13558
13561
|
"aria-expanded": q,
|
|
13559
13562
|
"aria-controls": L,
|
|
13560
|
-
onClick: () => te &&
|
|
13563
|
+
onClick: () => te && V(!q),
|
|
13561
13564
|
onKeyDown: (H) => {
|
|
13562
|
-
te && ["ArrowDown", "ArrowUp"].includes(H.key) && (H.preventDefault(),
|
|
13565
|
+
te && ["ArrowDown", "ArrowUp"].includes(H.key) && (H.preventDefault(), V(!0));
|
|
13563
13566
|
}
|
|
13564
13567
|
}
|
|
13565
13568
|
),
|
|
@@ -13586,12 +13589,12 @@ function jd({
|
|
|
13586
13589
|
Go,
|
|
13587
13590
|
{
|
|
13588
13591
|
open: q,
|
|
13589
|
-
onOpenChange:
|
|
13592
|
+
onOpenChange: V,
|
|
13590
13593
|
anchorRef: Y,
|
|
13591
13594
|
id: L,
|
|
13592
13595
|
role: "dialog",
|
|
13593
13596
|
ariaLabel: S ?? a,
|
|
13594
|
-
dismissExcludeRefs: [
|
|
13597
|
+
dismissExcludeRefs: [ne],
|
|
13595
13598
|
matchWidth: !0,
|
|
13596
13599
|
initialFocus: "none",
|
|
13597
13600
|
className: "multi-combobox__popup",
|
|
@@ -13614,8 +13617,8 @@ function jd({
|
|
|
13614
13617
|
required: h,
|
|
13615
13618
|
clearable: v,
|
|
13616
13619
|
onTabExit: J,
|
|
13617
|
-
onFooterActivate: () =>
|
|
13618
|
-
inputRef:
|
|
13620
|
+
onFooterActivate: () => V(!1),
|
|
13621
|
+
inputRef: z
|
|
13619
13622
|
}
|
|
13620
13623
|
) : null
|
|
13621
13624
|
}
|
|
@@ -13902,7 +13905,7 @@ function Qc({
|
|
|
13902
13905
|
label: w,
|
|
13903
13906
|
initialLast: v
|
|
13904
13907
|
}) {
|
|
13905
|
-
const I = we(), N = Te(() => Zo(e), [e]), [D, T] = j(() => Xc(t, N)), S = Yc(D, N), k = S.join("\0"), [P, E] = j(S.length), x = Math.min(P, S.length), [M, K] = j({}), [O, L] = j(), G = A(/* @__PURE__ */ new Map()), B = A(null), [Z, X] = j(!0), Y = A(null),
|
|
13908
|
+
const I = we(), N = Te(() => Zo(e), [e]), [D, T] = j(() => Xc(t, N)), S = Yc(D, N), k = S.join("\0"), [P, E] = j(S.length), x = Math.min(P, S.length), [M, K] = j({}), [O, L] = j(), G = A(/* @__PURE__ */ new Map()), B = A(null), [Z, X] = j(!0), Y = A(null), ne = A(null), z = A(!1), te = A(null), [q, $] = j(null), R = A({ text: "", at: 0 }), V = o.trim(), J = (a ?? jc(N, o)).map((Q) => ({ ...Q, label: Q.path.at(-1)?.label ?? Q.value })), F = !s || s.status === "idle", W = F ? J.find((Q) => Q.value === O) ?? J.find((Q) => t.includes(Q.value)) ?? J[0] : void 0, ie = `${I}-results`, H = [e, ...S.map((Q) => N.get(Q)?.node.children ?? [])], re = (Q) => Q ? S[Q - 1] : "", U = (Q) => l?.[re(Q)];
|
|
13906
13909
|
function le(Q) {
|
|
13907
13910
|
return H[Q].flatMap((ae) => {
|
|
13908
13911
|
const ge = N.get(ae.value);
|
|
@@ -13910,7 +13913,7 @@ function Qc({
|
|
|
13910
13913
|
});
|
|
13911
13914
|
}
|
|
13912
13915
|
function ye(Q) {
|
|
13913
|
-
const ae = le(Q), ge =
|
|
13916
|
+
const ae = le(Q), ge = re(Q), fe = ae.findIndex((pe) => pe.value === M[ge]);
|
|
13914
13917
|
return fe >= 0 ? (G.current.set(ge, fe), ae[fe]) : M[ge] ? ae[Math.min(G.current.get(ge) ?? 0, ae.length - 1)] : ae.find((pe) => t.includes(pe.value)) ?? ae[0];
|
|
13915
13918
|
}
|
|
13916
13919
|
function he(Q) {
|
|
@@ -13919,10 +13922,10 @@ function Qc({
|
|
|
13919
13922
|
function Ce(Q, ae = !1) {
|
|
13920
13923
|
E(Q);
|
|
13921
13924
|
const ge = le(Q), fe = ae ? ge.at(-1) : ye(Q);
|
|
13922
|
-
fe && K((pe) => ({ ...pe, [
|
|
13925
|
+
fe && K((pe) => ({ ...pe, [re(Q)]: fe.value })), he(Q)?.focus({ preventScroll: !0 });
|
|
13923
13926
|
}
|
|
13924
13927
|
_e(() => {
|
|
13925
|
-
const Q = B.current, ae = Y.current, ge =
|
|
13928
|
+
const Q = B.current, ae = Y.current, ge = ne.current;
|
|
13926
13929
|
B.current = null, Q != null ? he(Q)?.focus({ preventScroll: !0 }) : ae && ge && !ge.isConnected && ae.ownerDocument.activeElement === ae.ownerDocument.body && he(x)?.focus({ preventScroll: !0 });
|
|
13927
13930
|
}, [x, k]), _e(() => {
|
|
13928
13931
|
const Q = Y.current;
|
|
@@ -13930,7 +13933,7 @@ function Qc({
|
|
|
13930
13933
|
const ae = Q.closest(".popover-panel");
|
|
13931
13934
|
let ge = !0;
|
|
13932
13935
|
const fe = () => {
|
|
13933
|
-
!ge || ae?.getAttribute("data-state") !== "open" || getComputedStyle(ae).visibility === "hidden" || (v && !
|
|
13936
|
+
!ge || ae?.getAttribute("data-state") !== "open" || getComputedStyle(ae).visibility === "hidden" || (v && !V ? Ce(S.length, !0) : _.current?.focus({ preventScroll: !0 }), ge = Q.ownerDocument.activeElement !== (v && !V ? he(S.length) : _.current));
|
|
13934
13937
|
};
|
|
13935
13938
|
fe();
|
|
13936
13939
|
const pe = new MutationObserver((Oe) => {
|
|
@@ -13978,22 +13981,22 @@ function Qc({
|
|
|
13978
13981
|
function $e() {
|
|
13979
13982
|
if (!x) return;
|
|
13980
13983
|
const Q = S[x - 1];
|
|
13981
|
-
K((ae) => ({ ...ae, [
|
|
13984
|
+
K((ae) => ({ ...ae, [re(x - 1)]: Q })), B.current = x - 1, T(S.slice(0, x - 1)), E(x - 1);
|
|
13982
13985
|
}
|
|
13983
13986
|
function me(Q, ae) {
|
|
13984
13987
|
if (!Q.disabled) {
|
|
13985
|
-
if (Q.selectable === !1 || !r && g === "confirm" && !
|
|
13986
|
-
|
|
13988
|
+
if (Q.selectable === !1 || !r && g === "confirm" && !V && Q.children) {
|
|
13989
|
+
V || Me(Q, ae);
|
|
13987
13990
|
return;
|
|
13988
13991
|
}
|
|
13989
13992
|
p(Q.value, Q.path);
|
|
13990
13993
|
}
|
|
13991
13994
|
}
|
|
13992
13995
|
function ce(Q, ae, ge) {
|
|
13993
|
-
Q.disabled || (!
|
|
13996
|
+
Q.disabled || (!V && Q.children ? r && ge && Q.selectable !== !1 ? p(Q.value, Q.path) : (!r && g === "immediate" && Q.selectable !== !1 && p(Q.value, Q.path, !0), Me(Q, ae)) : me(Q, ae));
|
|
13994
13997
|
}
|
|
13995
13998
|
function Ne(Q) {
|
|
13996
|
-
return
|
|
13999
|
+
return z.current || Q.nativeEvent.isComposing || Q.keyCode === 229;
|
|
13997
14000
|
}
|
|
13998
14001
|
function qe(Q, ae) {
|
|
13999
14002
|
if (Ne(Q)) return;
|
|
@@ -14003,7 +14006,7 @@ function Qc({
|
|
|
14003
14006
|
if (["ArrowDown", "ArrowUp", "Home", "End"].includes(Q.key)) {
|
|
14004
14007
|
Q.preventDefault();
|
|
14005
14008
|
const Ee = Q.key === "Home" ? 0 : Q.key === "End" ? ge.length - 1 : Math.max(0, Math.min(ge.length - 1, Re + (Q.key === "ArrowDown" ? 1 : -1)));
|
|
14006
|
-
ge[Ee] && K((Se) => ({ ...Se, [
|
|
14009
|
+
ge[Ee] && K((Se) => ({ ...Se, [re(ae)]: ge[Ee].value }));
|
|
14007
14010
|
} else if (Q.key === "ArrowRight")
|
|
14008
14011
|
Q.preventDefault(), pe && Me(pe, ae);
|
|
14009
14012
|
else if (Q.key === "Enter" || Q.key === " ")
|
|
@@ -14012,20 +14015,20 @@ function Qc({
|
|
|
14012
14015
|
const Ee = Date.now();
|
|
14013
14016
|
R.current.text = Ee - R.current.at > 700 ? Q.key : R.current.text + Q.key, R.current.at = Ee;
|
|
14014
14017
|
const Se = ge.find((Oe) => Oe.label.toLocaleLowerCase().startsWith(R.current.text.toLocaleLowerCase()));
|
|
14015
|
-
Se && K((Oe) => ({ ...Oe, [
|
|
14018
|
+
Se && K((Oe) => ({ ...Oe, [re(ae)]: Se.value }));
|
|
14016
14019
|
}
|
|
14017
14020
|
}
|
|
14018
14021
|
function Le(Q) {
|
|
14019
14022
|
if (!Ne(Q))
|
|
14020
14023
|
if (Q.key === "ArrowDown" || Q.key === "ArrowUp") {
|
|
14021
|
-
if (Q.preventDefault(), !
|
|
14024
|
+
if (Q.preventDefault(), !V) {
|
|
14022
14025
|
Ce(x, Q.key === "ArrowUp");
|
|
14023
14026
|
return;
|
|
14024
14027
|
}
|
|
14025
14028
|
if (!F || !J.length) return;
|
|
14026
14029
|
const ae = J.findIndex((fe) => fe.value === W?.value), ge = ae < 0 ? Q.key === "ArrowUp" ? J.length - 1 : 0 : Math.max(0, Math.min(J.length - 1, ae + (Q.key === "ArrowDown" ? 1 : -1)));
|
|
14027
14030
|
L(J[ge].value);
|
|
14028
|
-
} else Q.key === "Enter" && (Q.preventDefault(),
|
|
14031
|
+
} else Q.key === "Enter" && (Q.preventDefault(), V && W && me(W, x));
|
|
14029
14032
|
}
|
|
14030
14033
|
const ue = zn(y);
|
|
14031
14034
|
return /* @__PURE__ */ b(
|
|
@@ -14035,10 +14038,10 @@ function Qc({
|
|
|
14035
14038
|
className: "q1-cascader__panel",
|
|
14036
14039
|
"data-narrow": Z,
|
|
14037
14040
|
onFocusCapture: (Q) => {
|
|
14038
|
-
|
|
14041
|
+
ne.current = Q.target;
|
|
14039
14042
|
},
|
|
14040
14043
|
onBlurCapture: (Q) => {
|
|
14041
|
-
(!Q.relatedTarget || !Q.currentTarget.contains(Q.relatedTarget)) && (
|
|
14044
|
+
(!Q.relatedTarget || !Q.currentTarget.contains(Q.relatedTarget)) && (ne.current = null);
|
|
14042
14045
|
},
|
|
14043
14046
|
onKeyDownCapture: (Q) => {
|
|
14044
14047
|
if (Ne(Q) && ["Escape", "Enter", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"].includes(Q.key)) {
|
|
@@ -14064,25 +14067,25 @@ function Qc({
|
|
|
14064
14067
|
type: "search",
|
|
14065
14068
|
"aria-label": `${w},搜索选项`,
|
|
14066
14069
|
value: q ?? o,
|
|
14067
|
-
role:
|
|
14068
|
-
"aria-autocomplete":
|
|
14069
|
-
"aria-expanded":
|
|
14070
|
-
"aria-controls":
|
|
14071
|
-
"aria-activedescendant":
|
|
14070
|
+
role: V ? "combobox" : void 0,
|
|
14071
|
+
"aria-autocomplete": V ? "list" : void 0,
|
|
14072
|
+
"aria-expanded": V ? !0 : void 0,
|
|
14073
|
+
"aria-controls": V ? ie : void 0,
|
|
14074
|
+
"aria-activedescendant": V && W ? bt(ie, W.value) : void 0,
|
|
14072
14075
|
autoComplete: "off",
|
|
14073
14076
|
placeholder: C,
|
|
14074
14077
|
onKeyDown: Le,
|
|
14075
14078
|
onCompositionStart: () => {
|
|
14076
|
-
|
|
14079
|
+
z.current = !0, $(o);
|
|
14077
14080
|
},
|
|
14078
14081
|
onCompositionEnd: (Q) => {
|
|
14079
|
-
|
|
14082
|
+
z.current = !1;
|
|
14080
14083
|
const ae = Q.currentTarget.value;
|
|
14081
14084
|
te.current = ae, $(null), i(ae);
|
|
14082
14085
|
},
|
|
14083
14086
|
onChange: (Q) => {
|
|
14084
14087
|
const ae = Q.target.value;
|
|
14085
|
-
if (
|
|
14088
|
+
if (z.current) {
|
|
14086
14089
|
$(ae);
|
|
14087
14090
|
return;
|
|
14088
14091
|
}
|
|
@@ -14094,7 +14097,7 @@ function Qc({
|
|
|
14094
14097
|
}
|
|
14095
14098
|
}
|
|
14096
14099
|
),
|
|
14097
|
-
|
|
14100
|
+
V ? /* @__PURE__ */ n(ke, { children: /* @__PURE__ */ n(
|
|
14098
14101
|
Fr,
|
|
14099
14102
|
{
|
|
14100
14103
|
id: ie,
|
|
@@ -14129,7 +14132,7 @@ function Qc({
|
|
|
14129
14132
|
rows: fe,
|
|
14130
14133
|
values: t,
|
|
14131
14134
|
active: Re,
|
|
14132
|
-
onActive: (Ee) => K((Se) => ({ ...Se, [
|
|
14135
|
+
onActive: (Ee) => K((Se) => ({ ...Se, [re(ae)]: Ee })),
|
|
14133
14136
|
header: !r && g === "confirm" && pe && pe.node.selectable !== !1 ? /* @__PURE__ */ b(
|
|
14134
14137
|
Fe,
|
|
14135
14138
|
{
|
|
@@ -14178,11 +14181,11 @@ function Qc({
|
|
|
14178
14181
|
onKeyDown: (Ee) => qe(Ee, ae),
|
|
14179
14182
|
onSelect: (Ee, Se) => ce(Ee, ae, Se)
|
|
14180
14183
|
},
|
|
14181
|
-
|
|
14184
|
+
re(ae)
|
|
14182
14185
|
);
|
|
14183
14186
|
}) })
|
|
14184
14187
|
] }),
|
|
14185
|
-
/* @__PURE__ */ n("span", { className: "q1-sr-only", "aria-live": "polite", "aria-atomic": "true", children:
|
|
14188
|
+
/* @__PURE__ */ n("span", { className: "q1-sr-only", "aria-live": "polite", "aria-atomic": "true", children: V ? `${F ? J.length : 0} 个匹配项` : `第 ${x + 1} 级` }),
|
|
14186
14189
|
m != null && m !== !1 ? /* @__PURE__ */ n("div", { className: "q1-cascader__footer", ...ue, children: m }) : null
|
|
14187
14190
|
]
|
|
14188
14191
|
}
|
|
@@ -14218,13 +14221,13 @@ function Gd(e) {
|
|
|
14218
14221
|
"aria-label": k,
|
|
14219
14222
|
"aria-labelledby": P,
|
|
14220
14223
|
"aria-describedby": E
|
|
14221
|
-
} = e, x = we(), M = N ?? `${x}-trigger`, K = `${x}-summary`, O = `${x}-popup`, L = `${x}-label`, G = `${x}-error`, B = `${x}-required`, Z = A(null), X = A(null), Y = A(null),
|
|
14224
|
+
} = e, x = we(), M = N ?? `${x}-trigger`, K = `${x}-summary`, O = `${x}-popup`, L = `${x}-label`, G = `${x}-error`, B = `${x}-required`, Z = A(null), X = A(null), Y = A(null), ne = A(!1), [z, te] = j(!1), [q, $] = j(""), R = A(/* @__PURE__ */ new Map()), V = Te(() => Zo(t), [t]), J = e.mode === "single" ? e.value === null ? [] : [e.value] : e.value, F = !h && !u, W = z && F, ie = !!(_ || w), H = (ce) => r?.find((Ne) => Ne.at(-1)?.value === ce) ?? V.get(ce)?.path ?? R.current.get(ce), re = (ce) => H(ce)?.at(-1)?.label ?? ce, U = (ce) => p ? H(ce)?.map((Ne) => Ne.label).join(" / ") ?? re(ce) : re(ce), le = k ?? c ?? "选择";
|
|
14222
14225
|
function ye(ce) {
|
|
14223
|
-
ce !==
|
|
14226
|
+
ce !== z && (te(ce), l?.(ce));
|
|
14224
14227
|
}
|
|
14225
14228
|
se(() => {
|
|
14226
|
-
!F &&
|
|
14227
|
-
}, [F,
|
|
14229
|
+
!F && z && ye(!1);
|
|
14230
|
+
}, [F, z]);
|
|
14228
14231
|
function he(ce) {
|
|
14229
14232
|
e.query === void 0 && $(ce), e.onQueryChange?.(ce);
|
|
14230
14233
|
}
|
|
@@ -14274,10 +14277,10 @@ function Gd(e) {
|
|
|
14274
14277
|
"aria-expanded": W,
|
|
14275
14278
|
"aria-controls": W ? O : void 0,
|
|
14276
14279
|
onClick: () => {
|
|
14277
|
-
F && (
|
|
14280
|
+
F && (ne.current = !1, ye(!W));
|
|
14278
14281
|
},
|
|
14279
14282
|
onKeyDown: (ce) => {
|
|
14280
|
-
!F || ce.nativeEvent.isComposing || ce.keyCode === 229 || ["ArrowDown", "ArrowUp"].includes(ce.key) && (ce.preventDefault(),
|
|
14283
|
+
!F || ce.nativeEvent.isComposing || ce.keyCode === 229 || ["ArrowDown", "ArrowUp"].includes(ce.key) && (ce.preventDefault(), ne.current = ce.key === "ArrowUp", ye(!0));
|
|
14281
14284
|
},
|
|
14282
14285
|
children: [
|
|
14283
14286
|
e.mode !== "multiple" || !J.length ? /* @__PURE__ */ n("span", { className: J.length ? void 0 : "q1-cascader__placeholder", children: J.length ? U(J[0]) : m }) : null,
|
|
@@ -14287,7 +14290,7 @@ function Gd(e) {
|
|
|
14287
14290
|
),
|
|
14288
14291
|
e.mode === "multiple" && J.length ? /* @__PURE__ */ n("div", { className: "q1-cascader__tags", role: "list", "aria-label": "已选项", children: J.map((ce) => /* @__PURE__ */ b("span", { className: "q1-cascader__tag", role: "listitem", children: [
|
|
14289
14292
|
/* @__PURE__ */ n("span", { children: U(ce) }),
|
|
14290
|
-
v ? /* @__PURE__ */ n("button", { type: "button", className: "q1-cascader__remove", disabled: !F, "aria-label": `移除 ${
|
|
14293
|
+
v ? /* @__PURE__ */ n("button", { type: "button", className: "q1-cascader__remove", disabled: !F, "aria-label": `移除 ${re(ce)}`, onClick: () => Me(ce), children: /* @__PURE__ */ n(Ue, { size: 12, strokeWidth: oe, "aria-hidden": "true" }) }) : null
|
|
14291
14294
|
] }, ce)) }) : null,
|
|
14292
14295
|
v && J.length ? /* @__PURE__ */ n("button", { type: "button", className: "q1-cascader__remove", disabled: !F, "aria-label": "全部清除", onClick: () => Me(), children: /* @__PURE__ */ n(Ue, { size: 16, strokeWidth: oe, "aria-hidden": "true" }) }) : null
|
|
14293
14296
|
] }),
|
|
@@ -14334,7 +14337,7 @@ function Gd(e) {
|
|
|
14334
14337
|
inputRef: Y,
|
|
14335
14338
|
label: le,
|
|
14336
14339
|
searchPlaceholder: d,
|
|
14337
|
-
initialLast:
|
|
14340
|
+
initialLast: ne.current
|
|
14338
14341
|
}
|
|
14339
14342
|
) : null
|
|
14340
14343
|
}
|