@pdf-viewer/react 1.9.0-beta.1 → 1.9.0-beta.2
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/{Popover-48c8394c.js → Popover-1faa77f6.js} +2 -2
- package/dist/RPLayout-81cd4970.js +3393 -0
- package/dist/{component-2aa6e53b.js → component-1da194e8.js} +1 -1
- package/dist/components/RPConfig.js +673 -691
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPDropFileZone.js +27 -26
- package/dist/components/RPPages.js +9 -3
- package/dist/components/layout/LayoutContainer.js +9 -3
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +9 -4
- package/dist/components/layout/WrapperLayout.js +8 -7
- package/dist/components/layout/sidebar/RPSidebar.js +3 -2
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DarkModeTool.js +20 -18
- package/dist/components/layout/toolbar/DocumentDialog.js +7 -4
- package/dist/components/layout/toolbar/DocumentProperties.js +19 -17
- package/dist/components/layout/toolbar/FileDownloadTool.js +4 -2
- package/dist/components/layout/toolbar/FileUploadTool.js +21 -19
- package/dist/components/layout/toolbar/FullScreenTool.js +45 -36
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +10 -4
- package/dist/components/layout/toolbar/OtherTool.js +4 -3
- package/dist/components/layout/toolbar/Paginate.js +4 -2
- package/dist/components/layout/toolbar/PrintTool.js +4 -2
- package/dist/components/layout/toolbar/RPToolbar.js +3 -2
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +27 -25
- package/dist/components/layout/toolbar/ScrollModeTool.js +43 -41
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +10 -4
- package/dist/components/layout/toolbar/SelectionModeTool.js +32 -30
- package/dist/components/layout/toolbar/ThumbnailTool.js +17 -0
- package/dist/components/layout/toolbar/ToolbarCustom.js +9 -3
- package/dist/components/layout/toolbar/ViewModeTool.js +33 -24
- package/dist/components/layout/toolbar/ZoomTool.js +5 -3
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +9 -13
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +10 -14
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +13 -17
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +10 -4
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +8 -12
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +55 -56
- package/dist/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.js +16 -0
- package/dist/components/layout/toolbar/tools/defaults/TopbarDefaultTools.js +59 -0
- package/dist/components/page/AnnotationLayer.js +9 -3
- package/dist/components/page/CanvasLayer.js +9 -3
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +9 -3
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +9 -3
- package/dist/components/page/TextLayer.js +9 -3
- package/dist/components/ui/Checkbox.js +116 -228
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/Popover.js +1 -1
- package/dist/components/ui/RPTooltip.js +207 -207
- package/dist/contexts/DropFileZoneContext.js +28 -29
- package/dist/contexts/IconToolContext.js +13 -0
- package/dist/contexts/PaginationContext.js +3 -3
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ToolComponentContext.js +52 -0
- package/dist/contexts/ToolbarComponentContext.js +6 -3
- package/dist/{floating-ui.react-dom-4b1e2e46.js → floating-ui.react-dom-15b9b819.js} +380 -394
- package/dist/index-1cb41342.js +307 -0
- package/dist/{index-951f0f1f.js → index-7279fb4e.js} +456 -464
- package/dist/index-aa2d3884.js +140 -0
- package/dist/main.js +23 -19
- package/dist/types/components/layout/toolbar/ThumbnailTool.d.ts +2 -0
- package/dist/types/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/TopbarDefaultTools.d.ts +3 -0
- package/dist/types/contexts/IconToolContext.d.ts +9 -0
- package/dist/types/contexts/ToolComponentContext.d.ts +12 -0
- package/dist/types/main.d.ts +3 -1
- package/dist/types/utils/types.d.ts +60 -42
- package/dist/utils/hooks/useFileDownload.js +9 -3
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +9 -3
- package/dist/utils/hooks/usePresentPage.js +9 -3
- package/dist/utils/hooks/usePrint.js +9 -3
- package/dist/utils/hooks/useScrollToPage.js +9 -3
- package/dist/utils/hooks/useSearch.js +9 -3
- package/dist/utils/hooks/useThumbnail.js +9 -3
- package/dist/utils/hooks/useVirtualReactWindow.js +9 -3
- package/package.json +1 -1
- package/dist/RPLayout-3042ec91.js +0 -3349
- package/dist/index-6e0e48fa.js +0 -332
- package/dist/index-e3a67935.js +0 -150
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
import * as o from "react";
|
|
2
2
|
import V from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { b as xe, P as D, e as de, a as K, i as Te, u as ne, h as gn, f as ot, c as S, g as Me, j as at, d as wn } from "./index-1cb41342.js";
|
|
4
4
|
import { jsx as l } from "react/jsx-runtime";
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as Mn, a as En, o as Rn, s as bn, l as Sn, f as yn, b as _n, c as Pn, h as In } from "./floating-ui.react-dom-
|
|
5
|
+
import { u as Ne, D as Cn } from "./index-aa2d3884.js";
|
|
6
|
+
import { u as Mn, a as En, o as Rn, s as bn, l as Sn, f as yn, b as _n, c as Pn, h as In } from "./floating-ui.react-dom-15b9b819.js";
|
|
7
7
|
import An from "react-dom";
|
|
8
|
-
import { c as xn, _ as Tn, u as Nn, a as te, f as Dn, z as On, s as Fn, b as kn, R as Ln, e as
|
|
9
|
-
var
|
|
8
|
+
import { c as xn, _ as Tn, u as Nn, a as te, f as Dn, z as On, s as Fn, b as kn, R as Ln, e as Kn, h as Gn } from "./component-1da194e8.js";
|
|
9
|
+
var $n = "Portal", ct = o.forwardRef((e, t) => {
|
|
10
10
|
var s;
|
|
11
11
|
const { container: n, ...r } = e, [a, c] = o.useState(!1);
|
|
12
|
-
|
|
12
|
+
xe(() => c(!0), []);
|
|
13
13
|
const u = n || a && ((s = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : s.body);
|
|
14
14
|
return u ? An.createPortal(/* @__PURE__ */ l(D.div, { ...r, ref: t }), u) : null;
|
|
15
15
|
});
|
|
16
|
-
ct.displayName =
|
|
16
|
+
ct.displayName = $n;
|
|
17
17
|
function st(e) {
|
|
18
18
|
const t = e + "CollectionProvider", [n, r] = de(t), [a, c] = n(
|
|
19
19
|
t,
|
|
20
20
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
21
|
-
), u = (
|
|
22
|
-
const { scope:
|
|
23
|
-
return /* @__PURE__ */ l(a, { scope:
|
|
21
|
+
), u = (C) => {
|
|
22
|
+
const { scope: f, children: i } = C, w = V.useRef(null), h = V.useRef(/* @__PURE__ */ new Map()).current;
|
|
23
|
+
return /* @__PURE__ */ l(a, { scope: f, itemMap: h, collectionRef: w, children: i });
|
|
24
24
|
};
|
|
25
25
|
u.displayName = t;
|
|
26
|
-
const s = e + "CollectionSlot",
|
|
27
|
-
(
|
|
28
|
-
const { scope:
|
|
29
|
-
return /* @__PURE__ */ l(
|
|
26
|
+
const s = e + "CollectionSlot", m = V.forwardRef(
|
|
27
|
+
(C, f) => {
|
|
28
|
+
const { scope: i, children: w } = C, h = c(s, i), M = K(f, h.collectionRef);
|
|
29
|
+
return /* @__PURE__ */ l(Te, { ref: M, children: w });
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
m.displayName = s;
|
|
33
|
-
const
|
|
34
|
-
(
|
|
35
|
-
const { scope:
|
|
36
|
-
return V.useEffect(() => (
|
|
33
|
+
const p = e + "CollectionItemSlot", v = "data-radix-collection-item", d = V.forwardRef(
|
|
34
|
+
(C, f) => {
|
|
35
|
+
const { scope: i, children: w, ...h } = C, M = V.useRef(null), R = K(f, M), b = c(p, i);
|
|
36
|
+
return V.useEffect(() => (b.itemMap.set(M, { ref: M, ...h }), () => void b.itemMap.delete(M))), /* @__PURE__ */ l(Te, { [v]: "", ref: R, children: w });
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
const
|
|
39
|
+
d.displayName = p;
|
|
40
|
+
function g(C) {
|
|
41
|
+
const f = c(e + "CollectionConsumer", C);
|
|
42
42
|
return V.useCallback(() => {
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
43
|
+
const w = f.collectionRef.current;
|
|
44
|
+
if (!w)
|
|
45
45
|
return [];
|
|
46
|
-
const
|
|
47
|
-
return Array.from(
|
|
48
|
-
(
|
|
46
|
+
const h = Array.from(w.querySelectorAll(`[${v}]`));
|
|
47
|
+
return Array.from(f.itemMap.values()).sort(
|
|
48
|
+
(b, y) => h.indexOf(b.ref.current) - h.indexOf(y.ref.current)
|
|
49
49
|
);
|
|
50
|
-
}, [
|
|
50
|
+
}, [f.collectionRef, f.itemMap]);
|
|
51
51
|
}
|
|
52
52
|
return [
|
|
53
|
-
{ Provider: u, Slot: m, ItemSlot:
|
|
54
|
-
|
|
53
|
+
{ Provider: u, Slot: m, ItemSlot: d },
|
|
54
|
+
g,
|
|
55
55
|
r
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
|
-
var
|
|
58
|
+
var Un = o.createContext(void 0);
|
|
59
59
|
function it(e) {
|
|
60
|
-
const t = o.useContext(
|
|
60
|
+
const t = o.useContext(Un);
|
|
61
61
|
return e || t || "ltr";
|
|
62
62
|
}
|
|
63
|
-
var
|
|
63
|
+
var ye = 0;
|
|
64
64
|
function Bn() {
|
|
65
65
|
o.useEffect(() => {
|
|
66
66
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
67
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ?? ze()), document.body.insertAdjacentElement("beforeend", e[1] ?? ze()),
|
|
68
|
-
|
|
67
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? ze()), document.body.insertAdjacentElement("beforeend", e[1] ?? ze()), ye++, () => {
|
|
68
|
+
ye === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), ye--;
|
|
69
69
|
};
|
|
70
70
|
}, []);
|
|
71
71
|
}
|
|
@@ -73,14 +73,14 @@ function ze() {
|
|
|
73
73
|
const e = document.createElement("span");
|
|
74
74
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
75
75
|
}
|
|
76
|
-
var
|
|
76
|
+
var _e = "focusScope.autoFocusOnMount", Pe = "focusScope.autoFocusOnUnmount", Ze = { bubbles: !1, cancelable: !0 }, Yn = "FocusScope", ut = o.forwardRef((e, t) => {
|
|
77
77
|
const {
|
|
78
78
|
loop: n = !1,
|
|
79
79
|
trapped: r = !1,
|
|
80
80
|
onMountAutoFocus: a,
|
|
81
81
|
onUnmountAutoFocus: c,
|
|
82
82
|
...u
|
|
83
|
-
} = e, [s,
|
|
83
|
+
} = e, [s, m] = o.useState(null), p = ne(a), v = ne(c), d = o.useRef(null), g = K(t, (i) => m(i)), C = o.useRef({
|
|
84
84
|
paused: !1,
|
|
85
85
|
pause() {
|
|
86
86
|
this.paused = !0;
|
|
@@ -91,25 +91,25 @@ var Pe = "focusScope.autoFocusOnMount", Ie = "focusScope.autoFocusOnUnmount", Ze
|
|
|
91
91
|
}).current;
|
|
92
92
|
o.useEffect(() => {
|
|
93
93
|
if (r) {
|
|
94
|
-
let i = function(
|
|
94
|
+
let i = function(R) {
|
|
95
95
|
if (C.paused || !s)
|
|
96
96
|
return;
|
|
97
|
-
const
|
|
98
|
-
s.contains(
|
|
99
|
-
},
|
|
97
|
+
const b = R.target;
|
|
98
|
+
s.contains(b) ? d.current = b : H(d.current, { select: !0 });
|
|
99
|
+
}, w = function(R) {
|
|
100
100
|
if (C.paused || !s)
|
|
101
101
|
return;
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
},
|
|
102
|
+
const b = R.relatedTarget;
|
|
103
|
+
b !== null && (s.contains(b) || H(d.current, { select: !0 }));
|
|
104
|
+
}, h = function(R) {
|
|
105
105
|
if (document.activeElement === document.body)
|
|
106
|
-
for (const y of
|
|
106
|
+
for (const y of R)
|
|
107
107
|
y.removedNodes.length > 0 && H(s);
|
|
108
108
|
};
|
|
109
|
-
document.addEventListener("focusin", i), document.addEventListener("focusout",
|
|
110
|
-
const
|
|
111
|
-
return s &&
|
|
112
|
-
document.removeEventListener("focusin", i), document.removeEventListener("focusout",
|
|
109
|
+
document.addEventListener("focusin", i), document.addEventListener("focusout", w);
|
|
110
|
+
const M = new MutationObserver(h);
|
|
111
|
+
return s && M.observe(s, { childList: !0, subtree: !0 }), () => {
|
|
112
|
+
document.removeEventListener("focusin", i), document.removeEventListener("focusout", w), M.disconnect();
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
}, [r, s, C.paused]), o.useEffect(() => {
|
|
@@ -117,30 +117,30 @@ var Pe = "focusScope.autoFocusOnMount", Ie = "focusScope.autoFocusOnUnmount", Ze
|
|
|
117
117
|
Qe.add(C);
|
|
118
118
|
const i = document.activeElement;
|
|
119
119
|
if (!s.contains(i)) {
|
|
120
|
-
const
|
|
121
|
-
s.addEventListener(
|
|
120
|
+
const h = new CustomEvent(_e, Ze);
|
|
121
|
+
s.addEventListener(_e, p), s.dispatchEvent(h), h.defaultPrevented || (Hn(zn(lt(s)), { select: !0 }), document.activeElement === i && H(s));
|
|
122
122
|
}
|
|
123
123
|
return () => {
|
|
124
|
-
s.removeEventListener(
|
|
125
|
-
const
|
|
126
|
-
s.addEventListener(
|
|
124
|
+
s.removeEventListener(_e, p), setTimeout(() => {
|
|
125
|
+
const h = new CustomEvent(Pe, Ze);
|
|
126
|
+
s.addEventListener(Pe, v), s.dispatchEvent(h), h.defaultPrevented || H(i ?? document.body, { select: !0 }), s.removeEventListener(Pe, v), Qe.remove(C);
|
|
127
127
|
}, 0);
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
-
}, [s,
|
|
131
|
-
const
|
|
130
|
+
}, [s, p, v, C]);
|
|
131
|
+
const f = o.useCallback(
|
|
132
132
|
(i) => {
|
|
133
133
|
if (!n && !r || C.paused)
|
|
134
134
|
return;
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
138
|
-
|
|
135
|
+
const w = i.key === "Tab" && !i.altKey && !i.ctrlKey && !i.metaKey, h = document.activeElement;
|
|
136
|
+
if (w && h) {
|
|
137
|
+
const M = i.currentTarget, [R, b] = Wn(M);
|
|
138
|
+
R && b ? !i.shiftKey && h === b ? (i.preventDefault(), n && H(R, { select: !0 })) : i.shiftKey && h === R && (i.preventDefault(), n && H(b, { select: !0 })) : h === M && i.preventDefault();
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
[n, r, C.paused]
|
|
142
142
|
);
|
|
143
|
-
return /* @__PURE__ */ l(D.div, { tabIndex: -1, ...u, ref:
|
|
143
|
+
return /* @__PURE__ */ l(D.div, { tabIndex: -1, ...u, ref: g, onKeyDown: f });
|
|
144
144
|
});
|
|
145
145
|
ut.displayName = Yn;
|
|
146
146
|
function Hn(e, { select: t = !1 } = {}) {
|
|
@@ -227,21 +227,21 @@ var Zn = "Arrow", dt = o.forwardRef((e, t) => {
|
|
|
227
227
|
);
|
|
228
228
|
});
|
|
229
229
|
dt.displayName = Zn;
|
|
230
|
-
var qn = dt,
|
|
230
|
+
var qn = dt, ke = "Popper", [ft, pt] = de(ke), [Qn, mt] = ft(ke), vt = (e) => {
|
|
231
231
|
const { __scopePopper: t, children: n } = e, [r, a] = o.useState(null);
|
|
232
232
|
return /* @__PURE__ */ l(Qn, { scope: t, anchor: r, onAnchorChange: a, children: n });
|
|
233
233
|
};
|
|
234
|
-
vt.displayName =
|
|
234
|
+
vt.displayName = ke;
|
|
235
235
|
var ht = "PopperAnchor", gt = o.forwardRef(
|
|
236
236
|
(e, t) => {
|
|
237
|
-
const { __scopePopper: n, virtualRef: r, ...a } = e, c = mt(ht, n), u = o.useRef(null), s =
|
|
237
|
+
const { __scopePopper: n, virtualRef: r, ...a } = e, c = mt(ht, n), u = o.useRef(null), s = K(t, u);
|
|
238
238
|
return o.useEffect(() => {
|
|
239
239
|
c.onAnchorChange((r == null ? void 0 : r.current) || u.current);
|
|
240
240
|
}), r ? null : /* @__PURE__ */ l(D.div, { ...a, ref: s });
|
|
241
241
|
}
|
|
242
242
|
);
|
|
243
243
|
gt.displayName = ht;
|
|
244
|
-
var
|
|
244
|
+
var Le = "PopperContent", [Jn, er] = ft(Le), wt = o.forwardRef(
|
|
245
245
|
(e, t) => {
|
|
246
246
|
var B, ae, O, ce, Xe, Ve;
|
|
247
247
|
const {
|
|
@@ -251,16 +251,16 @@ var Ge = "PopperContent", [Jn, er] = ft(Ge), wt = o.forwardRef(
|
|
|
251
251
|
align: c = "center",
|
|
252
252
|
alignOffset: u = 0,
|
|
253
253
|
arrowPadding: s = 0,
|
|
254
|
-
avoidCollisions:
|
|
255
|
-
collisionBoundary:
|
|
256
|
-
collisionPadding:
|
|
254
|
+
avoidCollisions: m = !0,
|
|
255
|
+
collisionBoundary: p = [],
|
|
256
|
+
collisionPadding: v = 0,
|
|
257
257
|
sticky: d = "partial",
|
|
258
|
-
hideWhenDetached:
|
|
258
|
+
hideWhenDetached: g = !1,
|
|
259
259
|
updatePositionStrategy: C = "optimized",
|
|
260
|
-
onPlaced:
|
|
260
|
+
onPlaced: f,
|
|
261
261
|
...i
|
|
262
|
-
} = e,
|
|
263
|
-
padding:
|
|
262
|
+
} = e, w = mt(Le, n), [h, M] = o.useState(null), R = K(t, (se) => M(se)), [b, y] = o.useState(null), P = gn(b), I = (P == null ? void 0 : P.width) ?? 0, _ = (P == null ? void 0 : P.height) ?? 0, k = r + (c !== "center" ? "-" + c : ""), $ = typeof v == "number" ? v : { top: 0, right: 0, bottom: 0, left: 0, ...v }, Y = Array.isArray(p) ? p : [p], W = Y.length > 0, U = {
|
|
263
|
+
padding: $,
|
|
264
264
|
boundary: Y.filter(nr),
|
|
265
265
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
266
266
|
altBoundary: W
|
|
@@ -272,36 +272,36 @@ var Ge = "PopperContent", [Jn, er] = ft(Ge), wt = o.forwardRef(
|
|
|
272
272
|
animationFrame: C === "always"
|
|
273
273
|
}),
|
|
274
274
|
elements: {
|
|
275
|
-
reference:
|
|
275
|
+
reference: w.anchor
|
|
276
276
|
},
|
|
277
277
|
middleware: [
|
|
278
|
-
Rn({ mainAxis: a +
|
|
279
|
-
|
|
278
|
+
Rn({ mainAxis: a + _, alignmentAxis: u }),
|
|
279
|
+
m && bn({
|
|
280
280
|
mainAxis: !0,
|
|
281
281
|
crossAxis: !1,
|
|
282
282
|
limiter: d === "partial" ? Sn() : void 0,
|
|
283
|
-
|
|
283
|
+
...U
|
|
284
284
|
}),
|
|
285
|
-
|
|
285
|
+
m && yn({ ...U }),
|
|
286
286
|
_n({
|
|
287
|
-
|
|
287
|
+
...U,
|
|
288
288
|
apply: ({ elements: se, rects: je, availableWidth: pn, availableHeight: mn }) => {
|
|
289
|
-
const { width: vn, height: hn } = je.reference,
|
|
290
|
-
|
|
289
|
+
const { width: vn, height: hn } = je.reference, ve = se.floating.style;
|
|
290
|
+
ve.setProperty("--radix-popper-available-width", `${pn}px`), ve.setProperty("--radix-popper-available-height", `${mn}px`), ve.setProperty("--radix-popper-anchor-width", `${vn}px`), ve.setProperty("--radix-popper-anchor-height", `${hn}px`);
|
|
291
291
|
}
|
|
292
292
|
}),
|
|
293
|
-
|
|
294
|
-
rr({ arrowWidth: I, arrowHeight:
|
|
295
|
-
|
|
293
|
+
b && Pn({ element: b, padding: s }),
|
|
294
|
+
rr({ arrowWidth: I, arrowHeight: _ }),
|
|
295
|
+
g && In({ strategy: "referenceHidden", ...U })
|
|
296
296
|
]
|
|
297
|
-
}), [
|
|
298
|
-
|
|
297
|
+
}), [E, T] = Et(L), A = ne(f);
|
|
298
|
+
xe(() => {
|
|
299
299
|
Q && (A == null || A());
|
|
300
300
|
}, [Q, A]);
|
|
301
|
-
const
|
|
302
|
-
return
|
|
303
|
-
|
|
304
|
-
}, [
|
|
301
|
+
const G = (B = N.arrow) == null ? void 0 : B.x, re = (ae = N.arrow) == null ? void 0 : ae.y, oe = ((O = N.arrow) == null ? void 0 : O.centerOffset) !== 0, [me, X] = o.useState();
|
|
302
|
+
return xe(() => {
|
|
303
|
+
h && X(window.getComputedStyle(h).zIndex);
|
|
304
|
+
}, [h]), /* @__PURE__ */ l(
|
|
305
305
|
"div",
|
|
306
306
|
{
|
|
307
307
|
ref: Z.setFloating,
|
|
@@ -311,7 +311,7 @@ var Ge = "PopperContent", [Jn, er] = ft(Ge), wt = o.forwardRef(
|
|
|
311
311
|
transform: Q ? q.transform : "translate(0, -200%)",
|
|
312
312
|
// keep off the page when measuring
|
|
313
313
|
minWidth: "max-content",
|
|
314
|
-
zIndex:
|
|
314
|
+
zIndex: me,
|
|
315
315
|
"--radix-popper-transform-origin": [
|
|
316
316
|
(ce = N.transformOrigin) == null ? void 0 : ce.x,
|
|
317
317
|
(Xe = N.transformOrigin) == null ? void 0 : Xe.y
|
|
@@ -329,18 +329,18 @@ var Ge = "PopperContent", [Jn, er] = ft(Ge), wt = o.forwardRef(
|
|
|
329
329
|
Jn,
|
|
330
330
|
{
|
|
331
331
|
scope: n,
|
|
332
|
-
placedSide:
|
|
332
|
+
placedSide: E,
|
|
333
333
|
onArrowChange: y,
|
|
334
|
-
arrowX:
|
|
334
|
+
arrowX: G,
|
|
335
335
|
arrowY: re,
|
|
336
336
|
shouldHideArrow: oe,
|
|
337
337
|
children: /* @__PURE__ */ l(
|
|
338
338
|
D.div,
|
|
339
339
|
{
|
|
340
|
-
"data-side":
|
|
340
|
+
"data-side": E,
|
|
341
341
|
"data-align": T,
|
|
342
342
|
...i,
|
|
343
|
-
ref:
|
|
343
|
+
ref: R,
|
|
344
344
|
style: {
|
|
345
345
|
...i.style,
|
|
346
346
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
@@ -355,7 +355,7 @@ var Ge = "PopperContent", [Jn, er] = ft(Ge), wt = o.forwardRef(
|
|
|
355
355
|
);
|
|
356
356
|
}
|
|
357
357
|
);
|
|
358
|
-
wt.displayName =
|
|
358
|
+
wt.displayName = Le;
|
|
359
359
|
var Ct = "PopperArrow", tr = {
|
|
360
360
|
top: "bottom",
|
|
361
361
|
right: "left",
|
|
@@ -414,23 +414,23 @@ var rr = (e) => ({
|
|
|
414
414
|
name: "transformOrigin",
|
|
415
415
|
options: e,
|
|
416
416
|
fn(t) {
|
|
417
|
-
var
|
|
418
|
-
const { placement: n, rects: r, middlewareData: a } = t, u = ((
|
|
419
|
-
let
|
|
420
|
-
return
|
|
417
|
+
var w, h, M;
|
|
418
|
+
const { placement: n, rects: r, middlewareData: a } = t, u = ((w = a.arrow) == null ? void 0 : w.centerOffset) !== 0, s = u ? 0 : e.arrowWidth, m = u ? 0 : e.arrowHeight, [p, v] = Et(n), d = { start: "0%", center: "50%", end: "100%" }[v], g = (((h = a.arrow) == null ? void 0 : h.x) ?? 0) + s / 2, C = (((M = a.arrow) == null ? void 0 : M.y) ?? 0) + m / 2;
|
|
419
|
+
let f = "", i = "";
|
|
420
|
+
return p === "bottom" ? (f = u ? d : `${g}px`, i = `${-m}px`) : p === "top" ? (f = u ? d : `${g}px`, i = `${r.floating.height + m}px`) : p === "right" ? (f = `${-m}px`, i = u ? d : `${C}px`) : p === "left" && (f = `${r.floating.width + m}px`, i = u ? d : `${C}px`), { data: { x: f, y: i } };
|
|
421
421
|
}
|
|
422
422
|
});
|
|
423
423
|
function Et(e) {
|
|
424
424
|
const [t, n = "center"] = e.split("-");
|
|
425
425
|
return [t, n];
|
|
426
426
|
}
|
|
427
|
-
var or = vt, ar = gt, cr = wt, sr = Mt,
|
|
428
|
-
|
|
427
|
+
var or = vt, ar = gt, cr = wt, sr = Mt, Ie = "rovingFocusGroup.onEntryFocus", ir = { bubbles: !1, cancelable: !0 }, Ee = "RovingFocusGroup", [De, Rt, ur] = st(Ee), [lr, bt] = de(
|
|
428
|
+
Ee,
|
|
429
429
|
[ur]
|
|
430
|
-
), [dr, fr] = lr(
|
|
431
|
-
(e, t) => /* @__PURE__ */ l(
|
|
430
|
+
), [dr, fr] = lr(Ee), St = o.forwardRef(
|
|
431
|
+
(e, t) => /* @__PURE__ */ l(De.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ l(De.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ l(pr, { ...e, ref: t }) }) })
|
|
432
432
|
);
|
|
433
|
-
St.displayName =
|
|
433
|
+
St.displayName = Ee;
|
|
434
434
|
var pr = o.forwardRef((e, t) => {
|
|
435
435
|
const {
|
|
436
436
|
__scopeRovingFocusGroup: n,
|
|
@@ -439,45 +439,44 @@ var pr = o.forwardRef((e, t) => {
|
|
|
439
439
|
dir: c,
|
|
440
440
|
currentTabStopId: u,
|
|
441
441
|
defaultCurrentTabStopId: s,
|
|
442
|
-
onCurrentTabStopIdChange:
|
|
443
|
-
onEntryFocus:
|
|
444
|
-
preventScrollOnEntryFocus:
|
|
442
|
+
onCurrentTabStopIdChange: m,
|
|
443
|
+
onEntryFocus: p,
|
|
444
|
+
preventScrollOnEntryFocus: v = !1,
|
|
445
445
|
...d
|
|
446
|
-
} = e,
|
|
446
|
+
} = e, g = o.useRef(null), C = K(t, g), f = it(c), [i = null, w] = ot({
|
|
447
447
|
prop: u,
|
|
448
|
-
defaultProp: s
|
|
449
|
-
onChange:
|
|
450
|
-
|
|
451
|
-
}), [g, E] = o.useState(!1), w = ne(m), R = Rt(n), y = o.useRef(!1), [_, I] = o.useState(0);
|
|
448
|
+
defaultProp: s,
|
|
449
|
+
onChange: m
|
|
450
|
+
}), [h, M] = o.useState(!1), R = ne(p), b = Rt(n), y = o.useRef(!1), [P, I] = o.useState(0);
|
|
452
451
|
return o.useEffect(() => {
|
|
453
|
-
const
|
|
454
|
-
if (
|
|
455
|
-
return
|
|
456
|
-
}, [
|
|
452
|
+
const _ = g.current;
|
|
453
|
+
if (_)
|
|
454
|
+
return _.addEventListener(Ie, R), () => _.removeEventListener(Ie, R);
|
|
455
|
+
}, [R]), /* @__PURE__ */ l(
|
|
457
456
|
dr,
|
|
458
457
|
{
|
|
459
458
|
scope: n,
|
|
460
459
|
orientation: r,
|
|
461
|
-
dir:
|
|
460
|
+
dir: f,
|
|
462
461
|
loop: a,
|
|
463
462
|
currentTabStopId: i,
|
|
464
463
|
onItemFocus: o.useCallback(
|
|
465
|
-
(
|
|
466
|
-
[
|
|
464
|
+
(_) => w(_),
|
|
465
|
+
[w]
|
|
467
466
|
),
|
|
468
|
-
onItemShiftTab: o.useCallback(() =>
|
|
467
|
+
onItemShiftTab: o.useCallback(() => M(!0), []),
|
|
469
468
|
onFocusableItemAdd: o.useCallback(
|
|
470
|
-
() => I((
|
|
469
|
+
() => I((_) => _ + 1),
|
|
471
470
|
[]
|
|
472
471
|
),
|
|
473
472
|
onFocusableItemRemove: o.useCallback(
|
|
474
|
-
() => I((
|
|
473
|
+
() => I((_) => _ - 1),
|
|
475
474
|
[]
|
|
476
475
|
),
|
|
477
476
|
children: /* @__PURE__ */ l(
|
|
478
477
|
D.div,
|
|
479
478
|
{
|
|
480
|
-
tabIndex:
|
|
479
|
+
tabIndex: h || P === 0 ? -1 : 0,
|
|
481
480
|
"data-orientation": r,
|
|
482
481
|
...d,
|
|
483
482
|
ref: C,
|
|
@@ -485,20 +484,20 @@ var pr = o.forwardRef((e, t) => {
|
|
|
485
484
|
onMouseDown: S(e.onMouseDown, () => {
|
|
486
485
|
y.current = !0;
|
|
487
486
|
}),
|
|
488
|
-
onFocus: S(e.onFocus, (
|
|
487
|
+
onFocus: S(e.onFocus, (_) => {
|
|
489
488
|
const k = !y.current;
|
|
490
|
-
if (
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
493
|
-
const Y =
|
|
489
|
+
if (_.target === _.currentTarget && k && !h) {
|
|
490
|
+
const $ = new CustomEvent(Ie, ir);
|
|
491
|
+
if (_.currentTarget.dispatchEvent($), !$.defaultPrevented) {
|
|
492
|
+
const Y = b().filter((L) => L.focusable), W = Y.find((L) => L.active), U = Y.find((L) => L.id === i), q = [W, U, ...Y].filter(
|
|
494
493
|
Boolean
|
|
495
494
|
).map((L) => L.ref.current);
|
|
496
|
-
Pt(q,
|
|
495
|
+
Pt(q, v);
|
|
497
496
|
}
|
|
498
497
|
}
|
|
499
498
|
y.current = !1;
|
|
500
499
|
}),
|
|
501
|
-
onBlur: S(e.onBlur, () =>
|
|
500
|
+
onBlur: S(e.onBlur, () => M(!1))
|
|
502
501
|
}
|
|
503
502
|
)
|
|
504
503
|
}
|
|
@@ -510,14 +509,13 @@ var pr = o.forwardRef((e, t) => {
|
|
|
510
509
|
focusable: r = !0,
|
|
511
510
|
active: a = !1,
|
|
512
511
|
tabStopId: c,
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
} = e, h = De(), m = c || h, f = fr(yt, n), d = f.currentTabStopId === m, v = Rt(n), { onFocusableItemAdd: C, onFocusableItemRemove: M, currentTabStopId: i } = f;
|
|
512
|
+
...u
|
|
513
|
+
} = e, s = Ne(), m = c || s, p = fr(yt, n), v = p.currentTabStopId === m, d = Rt(n), { onFocusableItemAdd: g, onFocusableItemRemove: C } = p;
|
|
516
514
|
return o.useEffect(() => {
|
|
517
515
|
if (r)
|
|
518
|
-
return
|
|
519
|
-
}, [r,
|
|
520
|
-
|
|
516
|
+
return g(), () => C();
|
|
517
|
+
}, [r, g, C]), /* @__PURE__ */ l(
|
|
518
|
+
De.ItemSlot,
|
|
521
519
|
{
|
|
522
520
|
scope: n,
|
|
523
521
|
id: m,
|
|
@@ -526,38 +524,37 @@ var pr = o.forwardRef((e, t) => {
|
|
|
526
524
|
children: /* @__PURE__ */ l(
|
|
527
525
|
D.span,
|
|
528
526
|
{
|
|
529
|
-
tabIndex:
|
|
530
|
-
"data-orientation":
|
|
531
|
-
...
|
|
527
|
+
tabIndex: v ? 0 : -1,
|
|
528
|
+
"data-orientation": p.orientation,
|
|
529
|
+
...u,
|
|
532
530
|
ref: t,
|
|
533
|
-
onMouseDown: S(e.onMouseDown, (
|
|
534
|
-
r ?
|
|
531
|
+
onMouseDown: S(e.onMouseDown, (f) => {
|
|
532
|
+
r ? p.onItemFocus(m) : f.preventDefault();
|
|
535
533
|
}),
|
|
536
|
-
onFocus: S(e.onFocus, () =>
|
|
537
|
-
onKeyDown: S(e.onKeyDown, (
|
|
538
|
-
if (
|
|
539
|
-
|
|
534
|
+
onFocus: S(e.onFocus, () => p.onItemFocus(m)),
|
|
535
|
+
onKeyDown: S(e.onKeyDown, (f) => {
|
|
536
|
+
if (f.key === "Tab" && f.shiftKey) {
|
|
537
|
+
p.onItemShiftTab();
|
|
540
538
|
return;
|
|
541
539
|
}
|
|
542
|
-
if (
|
|
540
|
+
if (f.target !== f.currentTarget)
|
|
543
541
|
return;
|
|
544
|
-
const
|
|
545
|
-
if (
|
|
546
|
-
if (
|
|
542
|
+
const i = hr(f, p.orientation, p.dir);
|
|
543
|
+
if (i !== void 0) {
|
|
544
|
+
if (f.metaKey || f.ctrlKey || f.altKey || f.shiftKey)
|
|
547
545
|
return;
|
|
548
|
-
|
|
549
|
-
let
|
|
550
|
-
if (
|
|
551
|
-
|
|
552
|
-
else if (
|
|
553
|
-
|
|
554
|
-
const
|
|
555
|
-
|
|
546
|
+
f.preventDefault();
|
|
547
|
+
let h = d().filter((M) => M.focusable).map((M) => M.ref.current);
|
|
548
|
+
if (i === "last")
|
|
549
|
+
h.reverse();
|
|
550
|
+
else if (i === "prev" || i === "next") {
|
|
551
|
+
i === "prev" && h.reverse();
|
|
552
|
+
const M = h.indexOf(f.currentTarget);
|
|
553
|
+
h = p.loop ? gr(h, M + 1) : h.slice(M + 1);
|
|
556
554
|
}
|
|
557
|
-
setTimeout(() => Pt(
|
|
555
|
+
setTimeout(() => Pt(h));
|
|
558
556
|
}
|
|
559
|
-
})
|
|
560
|
-
children: typeof u == "function" ? u({ isCurrentTabStop: d, hasTabStop: i != null }) : u
|
|
557
|
+
})
|
|
561
558
|
}
|
|
562
559
|
)
|
|
563
560
|
}
|
|
@@ -592,18 +589,18 @@ function Pt(e, t = !1) {
|
|
|
592
589
|
function gr(e, t) {
|
|
593
590
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
594
591
|
}
|
|
595
|
-
var wr = St, Cr = _t, It = xn(),
|
|
592
|
+
var wr = St, Cr = _t, It = xn(), Ae = function() {
|
|
596
593
|
}, Re = o.forwardRef(function(e, t) {
|
|
597
594
|
var n = o.useRef(null), r = o.useState({
|
|
598
|
-
onScrollCapture:
|
|
599
|
-
onWheelCapture:
|
|
600
|
-
onTouchMoveCapture:
|
|
601
|
-
}), a = r[0], c = r[1], u = e.forwardProps, s = e.children,
|
|
595
|
+
onScrollCapture: Ae,
|
|
596
|
+
onWheelCapture: Ae,
|
|
597
|
+
onTouchMoveCapture: Ae
|
|
598
|
+
}), a = r[0], c = r[1], u = e.forwardProps, s = e.children, m = e.className, p = e.removeScrollBar, v = e.enabled, d = e.shards, g = e.sideCar, C = e.noIsolation, f = e.inert, i = e.allowPinchZoom, w = e.as, h = w === void 0 ? "div" : w, M = e.gapMode, R = Tn(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), b = g, y = Nn([n, t]), P = te(te({}, R), a);
|
|
602
599
|
return o.createElement(
|
|
603
600
|
o.Fragment,
|
|
604
601
|
null,
|
|
605
|
-
|
|
606
|
-
u ? o.cloneElement(o.Children.only(s), te(te({},
|
|
602
|
+
v && o.createElement(b, { sideCar: It, removeScrollBar: p, shards: d, noIsolation: C, inert: f, setCallbacks: c, allowPinchZoom: !!i, lockRef: n, gapMode: M }),
|
|
603
|
+
u ? o.cloneElement(o.Children.only(s), te(te({}, P), { ref: y })) : o.createElement(h, te({}, P, { className: m, ref: y }), s)
|
|
607
604
|
);
|
|
608
605
|
});
|
|
609
606
|
Re.defaultProps = {
|
|
@@ -615,19 +612,19 @@ Re.classNames = {
|
|
|
615
612
|
fullWidth: Dn,
|
|
616
613
|
zeroRight: On
|
|
617
614
|
};
|
|
618
|
-
var
|
|
615
|
+
var Oe = !1;
|
|
619
616
|
if (typeof window < "u")
|
|
620
617
|
try {
|
|
621
|
-
var
|
|
618
|
+
var he = Object.defineProperty({}, "passive", {
|
|
622
619
|
get: function() {
|
|
623
|
-
return
|
|
620
|
+
return Oe = !0, !0;
|
|
624
621
|
}
|
|
625
622
|
});
|
|
626
|
-
window.addEventListener("test",
|
|
623
|
+
window.addEventListener("test", he, he), window.removeEventListener("test", he, he);
|
|
627
624
|
} catch {
|
|
628
|
-
|
|
625
|
+
Oe = !1;
|
|
629
626
|
}
|
|
630
|
-
var J =
|
|
627
|
+
var J = Oe ? { passive: !1 } : !1, Mr = function(e) {
|
|
631
628
|
return e.tagName === "TEXTAREA";
|
|
632
629
|
}, At = function(e, t) {
|
|
633
630
|
if (!(e instanceof Element))
|
|
@@ -676,21 +673,17 @@ var J = Fe ? { passive: !1 } : !1, Mr = function(e) {
|
|
|
676
673
|
}, yr = function(e, t) {
|
|
677
674
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
678
675
|
}, _r = function(e, t, n, r, a) {
|
|
679
|
-
var c = yr(e, window.getComputedStyle(t).direction), u = c * r, s = n.target,
|
|
676
|
+
var c = yr(e, window.getComputedStyle(t).direction), u = c * r, s = n.target, m = t.contains(s), p = !1, v = u > 0, d = 0, g = 0;
|
|
680
677
|
do {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
var C = Tt(e, s), M = C[0], i = C[1], p = C[2], g = i - p - c * M;
|
|
684
|
-
(M || g) && xt(e, s) && (d += g, v += M);
|
|
685
|
-
var E = s.parentNode;
|
|
686
|
-
s = E && E.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? E.host : E;
|
|
678
|
+
var C = Tt(e, s), f = C[0], i = C[1], w = C[2], h = i - w - c * f;
|
|
679
|
+
(f || h) && xt(e, s) && (d += h, g += f), s instanceof ShadowRoot ? s = s.host : s = s.parentNode;
|
|
687
680
|
} while (
|
|
688
681
|
// portaled content
|
|
689
|
-
!
|
|
690
|
-
|
|
682
|
+
!m && s !== document.body || // self content
|
|
683
|
+
m && (t.contains(s) || t === s)
|
|
691
684
|
);
|
|
692
|
-
return (
|
|
693
|
-
},
|
|
685
|
+
return (v && (a && Math.abs(d) < 1 || !a && u > d) || !v && (a && Math.abs(g) < 1 || !a && -u > g)) && (p = !0), p;
|
|
686
|
+
}, ge = function(e) {
|
|
694
687
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
695
688
|
}, tt = function(e) {
|
|
696
689
|
return [e.deltaX, e.deltaY];
|
|
@@ -712,78 +705,78 @@ function xr(e) {
|
|
|
712
705
|
if (e.inert) {
|
|
713
706
|
document.body.classList.add("block-interactivity-".concat(a));
|
|
714
707
|
var i = kn([e.lockRef.current], (e.shards || []).map(nt), !0).filter(Boolean);
|
|
715
|
-
return i.forEach(function(
|
|
716
|
-
return
|
|
708
|
+
return i.forEach(function(w) {
|
|
709
|
+
return w.classList.add("allow-interactivity-".concat(a));
|
|
717
710
|
}), function() {
|
|
718
|
-
document.body.classList.remove("block-interactivity-".concat(a)), i.forEach(function(
|
|
719
|
-
return
|
|
711
|
+
document.body.classList.remove("block-interactivity-".concat(a)), i.forEach(function(w) {
|
|
712
|
+
return w.classList.remove("allow-interactivity-".concat(a));
|
|
720
713
|
});
|
|
721
714
|
};
|
|
722
715
|
}
|
|
723
716
|
}, [e.inert, e.lockRef.current, e.shards]);
|
|
724
|
-
var s = o.useCallback(function(i,
|
|
717
|
+
var s = o.useCallback(function(i, w) {
|
|
725
718
|
if ("touches" in i && i.touches.length === 2 || i.type === "wheel" && i.ctrlKey)
|
|
726
719
|
return !u.current.allowPinchZoom;
|
|
727
|
-
var
|
|
728
|
-
if ("touches" in i && I === "h" &&
|
|
720
|
+
var h = ge(i), M = n.current, R = "deltaX" in i ? i.deltaX : M[0] - h[0], b = "deltaY" in i ? i.deltaY : M[1] - h[1], y, P = i.target, I = Math.abs(R) > Math.abs(b) ? "h" : "v";
|
|
721
|
+
if ("touches" in i && I === "h" && P.type === "range")
|
|
729
722
|
return !1;
|
|
730
|
-
var
|
|
731
|
-
if (!
|
|
723
|
+
var _ = et(I, P);
|
|
724
|
+
if (!_)
|
|
732
725
|
return !0;
|
|
733
|
-
if (
|
|
726
|
+
if (_ ? y = I : (y = I === "v" ? "h" : "v", _ = et(I, P)), !_)
|
|
734
727
|
return !1;
|
|
735
|
-
if (!r.current && "changedTouches" in i && (
|
|
728
|
+
if (!r.current && "changedTouches" in i && (R || b) && (r.current = y), !y)
|
|
736
729
|
return !0;
|
|
737
730
|
var k = r.current || y;
|
|
738
|
-
return _r(k,
|
|
739
|
-
}, []),
|
|
740
|
-
var
|
|
731
|
+
return _r(k, w, i, k === "h" ? R : b, !0);
|
|
732
|
+
}, []), m = o.useCallback(function(i) {
|
|
733
|
+
var w = i;
|
|
741
734
|
if (!(!ee.length || ee[ee.length - 1] !== c)) {
|
|
742
|
-
var
|
|
743
|
-
return y.name ===
|
|
735
|
+
var h = "deltaY" in w ? tt(w) : ge(w), M = t.current.filter(function(y) {
|
|
736
|
+
return y.name === w.type && (y.target === w.target || w.target === y.shadowParent) && Pr(y.delta, h);
|
|
744
737
|
})[0];
|
|
745
|
-
if (
|
|
746
|
-
|
|
738
|
+
if (M && M.should) {
|
|
739
|
+
w.cancelable && w.preventDefault();
|
|
747
740
|
return;
|
|
748
741
|
}
|
|
749
|
-
if (!
|
|
750
|
-
var
|
|
751
|
-
return y.contains(
|
|
752
|
-
}),
|
|
753
|
-
|
|
742
|
+
if (!M) {
|
|
743
|
+
var R = (u.current.shards || []).map(nt).filter(Boolean).filter(function(y) {
|
|
744
|
+
return y.contains(w.target);
|
|
745
|
+
}), b = R.length > 0 ? s(w, R[0]) : !u.current.noIsolation;
|
|
746
|
+
b && w.cancelable && w.preventDefault();
|
|
754
747
|
}
|
|
755
748
|
}
|
|
756
|
-
}, []),
|
|
757
|
-
var
|
|
758
|
-
t.current.push(
|
|
759
|
-
t.current = t.current.filter(function(
|
|
760
|
-
return
|
|
749
|
+
}, []), p = o.useCallback(function(i, w, h, M) {
|
|
750
|
+
var R = { name: i, delta: w, target: h, should: M, shadowParent: Tr(h) };
|
|
751
|
+
t.current.push(R), setTimeout(function() {
|
|
752
|
+
t.current = t.current.filter(function(b) {
|
|
753
|
+
return b !== R;
|
|
761
754
|
});
|
|
762
755
|
}, 1);
|
|
763
|
-
}, []), f = o.useCallback(function(i) {
|
|
764
|
-
n.current = we(i), r.current = void 0;
|
|
765
|
-
}, []), d = o.useCallback(function(i) {
|
|
766
|
-
m(i.type, tt(i), i.target, s(i, e.lockRef.current));
|
|
767
756
|
}, []), v = o.useCallback(function(i) {
|
|
768
|
-
|
|
757
|
+
n.current = ge(i), r.current = void 0;
|
|
758
|
+
}, []), d = o.useCallback(function(i) {
|
|
759
|
+
p(i.type, tt(i), i.target, s(i, e.lockRef.current));
|
|
760
|
+
}, []), g = o.useCallback(function(i) {
|
|
761
|
+
p(i.type, ge(i), i.target, s(i, e.lockRef.current));
|
|
769
762
|
}, []);
|
|
770
763
|
o.useEffect(function() {
|
|
771
764
|
return ee.push(c), e.setCallbacks({
|
|
772
765
|
onScrollCapture: d,
|
|
773
766
|
onWheelCapture: d,
|
|
774
|
-
onTouchMoveCapture:
|
|
775
|
-
}), document.addEventListener("wheel",
|
|
767
|
+
onTouchMoveCapture: g
|
|
768
|
+
}), document.addEventListener("wheel", m, J), document.addEventListener("touchmove", m, J), document.addEventListener("touchstart", v, J), function() {
|
|
776
769
|
ee = ee.filter(function(i) {
|
|
777
770
|
return i !== c;
|
|
778
|
-
}), document.removeEventListener("wheel",
|
|
771
|
+
}), document.removeEventListener("wheel", m, J), document.removeEventListener("touchmove", m, J), document.removeEventListener("touchstart", v, J);
|
|
779
772
|
};
|
|
780
773
|
}, []);
|
|
781
|
-
var C = e.removeScrollBar,
|
|
774
|
+
var C = e.removeScrollBar, f = e.inert;
|
|
782
775
|
return o.createElement(
|
|
783
776
|
o.Fragment,
|
|
784
777
|
null,
|
|
785
|
-
|
|
786
|
-
C ? o.createElement(Ln, {
|
|
778
|
+
f ? o.createElement(c, { styles: Ir(a) }) : null,
|
|
779
|
+
C ? o.createElement(Ln, { gapMode: e.gapMode }) : null
|
|
787
780
|
);
|
|
788
781
|
}
|
|
789
782
|
function Tr(e) {
|
|
@@ -791,46 +784,46 @@ function Tr(e) {
|
|
|
791
784
|
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
792
785
|
return t;
|
|
793
786
|
}
|
|
794
|
-
const Nr =
|
|
787
|
+
const Nr = Kn(It, xr);
|
|
795
788
|
var Nt = o.forwardRef(function(e, t) {
|
|
796
789
|
return o.createElement(Re, te({}, e, { ref: t, sideCar: Nr }));
|
|
797
790
|
});
|
|
798
791
|
Nt.classNames = Re.classNames;
|
|
799
792
|
const Dr = Nt;
|
|
800
|
-
var
|
|
801
|
-
ltr: [...
|
|
802
|
-
rtl: [...
|
|
793
|
+
var Fe = ["Enter", " "], Or = ["ArrowDown", "PageUp", "Home"], Dt = ["ArrowUp", "PageDown", "End"], Fr = [...Or, ...Dt], kr = {
|
|
794
|
+
ltr: [...Fe, "ArrowRight"],
|
|
795
|
+
rtl: [...Fe, "ArrowLeft"]
|
|
803
796
|
}, Lr = {
|
|
804
797
|
ltr: ["ArrowLeft"],
|
|
805
798
|
rtl: ["ArrowRight"]
|
|
806
|
-
},
|
|
807
|
-
|
|
799
|
+
}, fe = "Menu", [ue, Kr, Gr] = st(fe), [j, Ot] = de(fe, [
|
|
800
|
+
Gr,
|
|
808
801
|
pt,
|
|
809
802
|
bt
|
|
810
|
-
]), be = pt(), Ft = bt(), [
|
|
811
|
-
const { __scopeMenu: t, open: n = !1, children: r, dir: a, onOpenChange: c, modal: u = !0 } = e, s = be(t), [
|
|
803
|
+
]), be = pt(), Ft = bt(), [$r, z] = j(fe), [Ur, pe] = j(fe), kt = (e) => {
|
|
804
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: a, onOpenChange: c, modal: u = !0 } = e, s = be(t), [m, p] = o.useState(null), v = o.useRef(!1), d = ne(c), g = it(a);
|
|
812
805
|
return o.useEffect(() => {
|
|
813
806
|
const C = () => {
|
|
814
|
-
|
|
815
|
-
},
|
|
807
|
+
v.current = !0, document.addEventListener("pointerdown", f, { capture: !0, once: !0 }), document.addEventListener("pointermove", f, { capture: !0, once: !0 });
|
|
808
|
+
}, f = () => v.current = !1;
|
|
816
809
|
return document.addEventListener("keydown", C, { capture: !0 }), () => {
|
|
817
|
-
document.removeEventListener("keydown", C, { capture: !0 }), document.removeEventListener("pointerdown",
|
|
810
|
+
document.removeEventListener("keydown", C, { capture: !0 }), document.removeEventListener("pointerdown", f, { capture: !0 }), document.removeEventListener("pointermove", f, { capture: !0 });
|
|
818
811
|
};
|
|
819
812
|
}, []), /* @__PURE__ */ l(or, { ...s, children: /* @__PURE__ */ l(
|
|
820
|
-
|
|
813
|
+
$r,
|
|
821
814
|
{
|
|
822
815
|
scope: t,
|
|
823
816
|
open: n,
|
|
824
817
|
onOpenChange: d,
|
|
825
|
-
content:
|
|
826
|
-
onContentChange:
|
|
818
|
+
content: m,
|
|
819
|
+
onContentChange: p,
|
|
827
820
|
children: /* @__PURE__ */ l(
|
|
828
|
-
|
|
821
|
+
Ur,
|
|
829
822
|
{
|
|
830
823
|
scope: t,
|
|
831
824
|
onClose: o.useCallback(() => d(!1), [d]),
|
|
832
|
-
isUsingKeyboardRef:
|
|
833
|
-
dir:
|
|
825
|
+
isUsingKeyboardRef: v,
|
|
826
|
+
dir: g,
|
|
834
827
|
modal: u,
|
|
835
828
|
children: r
|
|
836
829
|
}
|
|
@@ -838,7 +831,7 @@ var ke = ["Enter", " "], Or = ["ArrowDown", "PageUp", "Home"], Dt = ["ArrowUp",
|
|
|
838
831
|
}
|
|
839
832
|
) });
|
|
840
833
|
};
|
|
841
|
-
kt.displayName =
|
|
834
|
+
kt.displayName = fe;
|
|
842
835
|
var Br = "MenuAnchor", Ke = o.forwardRef(
|
|
843
836
|
(e, t) => {
|
|
844
837
|
const { __scopeMenu: n, ...r } = e, a = be(n);
|
|
@@ -846,27 +839,27 @@ var Br = "MenuAnchor", Ke = o.forwardRef(
|
|
|
846
839
|
}
|
|
847
840
|
);
|
|
848
841
|
Ke.displayName = Br;
|
|
849
|
-
var
|
|
842
|
+
var Ge = "MenuPortal", [Yr, Lt] = j(Ge, {
|
|
850
843
|
forceMount: void 0
|
|
851
|
-
}),
|
|
852
|
-
const { __scopeMenu: t, forceMount: n, children: r, container: a } = e, c = z(
|
|
853
|
-
return /* @__PURE__ */ l(Yr, { scope: t, forceMount: n, children: /* @__PURE__ */ l(
|
|
844
|
+
}), Kt = (e) => {
|
|
845
|
+
const { __scopeMenu: t, forceMount: n, children: r, container: a } = e, c = z(Ge, t);
|
|
846
|
+
return /* @__PURE__ */ l(Yr, { scope: t, forceMount: n, children: /* @__PURE__ */ l(Me, { present: n || c.open, children: /* @__PURE__ */ l(ct, { asChild: !0, container: a, children: r }) }) });
|
|
854
847
|
};
|
|
855
|
-
|
|
856
|
-
var F = "MenuContent", [Hr, $e] = j(F),
|
|
848
|
+
Kt.displayName = Ge;
|
|
849
|
+
var F = "MenuContent", [Hr, $e] = j(F), Gt = o.forwardRef(
|
|
857
850
|
(e, t) => {
|
|
858
|
-
const n = Lt(F, e.__scopeMenu), { forceMount: r = n.forceMount, ...a } = e, c = z(F, e.__scopeMenu), u =
|
|
859
|
-
return /* @__PURE__ */ l(ue.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ l(
|
|
851
|
+
const n = Lt(F, e.__scopeMenu), { forceMount: r = n.forceMount, ...a } = e, c = z(F, e.__scopeMenu), u = pe(F, e.__scopeMenu);
|
|
852
|
+
return /* @__PURE__ */ l(ue.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ l(Me, { present: r || c.open, children: /* @__PURE__ */ l(ue.Slot, { scope: e.__scopeMenu, children: u.modal ? /* @__PURE__ */ l(Wr, { ...a, ref: t }) : /* @__PURE__ */ l(Xr, { ...a, ref: t }) }) }) });
|
|
860
853
|
}
|
|
861
854
|
), Wr = o.forwardRef(
|
|
862
855
|
(e, t) => {
|
|
863
|
-
const n = z(F, e.__scopeMenu), r = o.useRef(null), a =
|
|
856
|
+
const n = z(F, e.__scopeMenu), r = o.useRef(null), a = K(t, r);
|
|
864
857
|
return o.useEffect(() => {
|
|
865
858
|
const c = r.current;
|
|
866
859
|
if (c)
|
|
867
|
-
return
|
|
860
|
+
return Gn(c);
|
|
868
861
|
}, []), /* @__PURE__ */ l(
|
|
869
|
-
|
|
862
|
+
Ue,
|
|
870
863
|
{
|
|
871
864
|
...e,
|
|
872
865
|
ref: a,
|
|
@@ -885,7 +878,7 @@ var F = "MenuContent", [Hr, $e] = j(F), Kt = o.forwardRef(
|
|
|
885
878
|
), Xr = o.forwardRef((e, t) => {
|
|
886
879
|
const n = z(F, e.__scopeMenu);
|
|
887
880
|
return /* @__PURE__ */ l(
|
|
888
|
-
|
|
881
|
+
Ue,
|
|
889
882
|
{
|
|
890
883
|
...e,
|
|
891
884
|
ref: t,
|
|
@@ -895,7 +888,7 @@ var F = "MenuContent", [Hr, $e] = j(F), Kt = o.forwardRef(
|
|
|
895
888
|
onDismiss: () => n.onOpenChange(!1)
|
|
896
889
|
}
|
|
897
890
|
);
|
|
898
|
-
}),
|
|
891
|
+
}), Ue = o.forwardRef(
|
|
899
892
|
(e, t) => {
|
|
900
893
|
const {
|
|
901
894
|
__scopeMenu: n,
|
|
@@ -904,62 +897,62 @@ var F = "MenuContent", [Hr, $e] = j(F), Kt = o.forwardRef(
|
|
|
904
897
|
onOpenAutoFocus: c,
|
|
905
898
|
onCloseAutoFocus: u,
|
|
906
899
|
disableOutsidePointerEvents: s,
|
|
907
|
-
onEntryFocus:
|
|
908
|
-
onEscapeKeyDown:
|
|
909
|
-
onPointerDownOutside:
|
|
900
|
+
onEntryFocus: m,
|
|
901
|
+
onEscapeKeyDown: p,
|
|
902
|
+
onPointerDownOutside: v,
|
|
910
903
|
onFocusOutside: d,
|
|
911
|
-
onInteractOutside:
|
|
904
|
+
onInteractOutside: g,
|
|
912
905
|
onDismiss: C,
|
|
913
|
-
disableOutsideScroll:
|
|
906
|
+
disableOutsideScroll: f,
|
|
914
907
|
...i
|
|
915
|
-
} = e,
|
|
908
|
+
} = e, w = z(F, n), h = pe(F, n), M = be(n), R = Ft(n), b = Kr(n), [y, P] = o.useState(null), I = o.useRef(null), _ = K(t, I, w.onContentChange), k = o.useRef(0), $ = o.useRef(""), Y = o.useRef(0), W = o.useRef(null), U = o.useRef("right"), Z = o.useRef(0), q = f ? Dr : o.Fragment, L = f ? { as: Te, allowPinchZoom: !0 } : void 0, Q = (E) => {
|
|
916
909
|
var B, ae;
|
|
917
|
-
const T =
|
|
910
|
+
const T = $.current + E, A = b().filter((O) => !O.disabled), G = document.activeElement, re = (B = A.find((O) => O.ref.current === G)) == null ? void 0 : B.textValue, oe = A.map((O) => O.textValue), me = oo(oe, T, re), X = (ae = A.find((O) => O.textValue === me)) == null ? void 0 : ae.ref.current;
|
|
918
911
|
(function O(ce) {
|
|
919
|
-
|
|
912
|
+
$.current = ce, window.clearTimeout(k.current), ce !== "" && (k.current = window.setTimeout(() => O(""), 1e3));
|
|
920
913
|
})(T), X && setTimeout(() => X.focus());
|
|
921
914
|
};
|
|
922
915
|
o.useEffect(() => () => window.clearTimeout(k.current), []), Bn();
|
|
923
|
-
const N = o.useCallback((
|
|
924
|
-
var A,
|
|
925
|
-
return
|
|
916
|
+
const N = o.useCallback((E) => {
|
|
917
|
+
var A, G;
|
|
918
|
+
return U.current === ((A = W.current) == null ? void 0 : A.side) && co(E, (G = W.current) == null ? void 0 : G.area);
|
|
926
919
|
}, []);
|
|
927
920
|
return /* @__PURE__ */ l(
|
|
928
921
|
Hr,
|
|
929
922
|
{
|
|
930
923
|
scope: n,
|
|
931
|
-
searchRef:
|
|
924
|
+
searchRef: $,
|
|
932
925
|
onItemEnter: o.useCallback(
|
|
933
|
-
(
|
|
934
|
-
N(
|
|
926
|
+
(E) => {
|
|
927
|
+
N(E) && E.preventDefault();
|
|
935
928
|
},
|
|
936
929
|
[N]
|
|
937
930
|
),
|
|
938
931
|
onItemLeave: o.useCallback(
|
|
939
|
-
(
|
|
932
|
+
(E) => {
|
|
940
933
|
var T;
|
|
941
|
-
N(
|
|
934
|
+
N(E) || ((T = I.current) == null || T.focus(), P(null));
|
|
942
935
|
},
|
|
943
936
|
[N]
|
|
944
937
|
),
|
|
945
938
|
onTriggerLeave: o.useCallback(
|
|
946
|
-
(
|
|
947
|
-
N(
|
|
939
|
+
(E) => {
|
|
940
|
+
N(E) && E.preventDefault();
|
|
948
941
|
},
|
|
949
942
|
[N]
|
|
950
943
|
),
|
|
951
944
|
pointerGraceTimerRef: Y,
|
|
952
|
-
onPointerGraceIntentChange: o.useCallback((
|
|
953
|
-
W.current =
|
|
945
|
+
onPointerGraceIntentChange: o.useCallback((E) => {
|
|
946
|
+
W.current = E;
|
|
954
947
|
}, []),
|
|
955
948
|
children: /* @__PURE__ */ l(q, { ...L, children: /* @__PURE__ */ l(
|
|
956
949
|
ut,
|
|
957
950
|
{
|
|
958
951
|
asChild: !0,
|
|
959
952
|
trapped: a,
|
|
960
|
-
onMountAutoFocus: S(c, (
|
|
953
|
+
onMountAutoFocus: S(c, (E) => {
|
|
961
954
|
var T;
|
|
962
|
-
|
|
955
|
+
E.preventDefault(), (T = I.current) == null || T.focus({ preventScroll: !0 });
|
|
963
956
|
}),
|
|
964
957
|
onUnmountAutoFocus: u,
|
|
965
958
|
children: /* @__PURE__ */ l(
|
|
@@ -967,23 +960,23 @@ var F = "MenuContent", [Hr, $e] = j(F), Kt = o.forwardRef(
|
|
|
967
960
|
{
|
|
968
961
|
asChild: !0,
|
|
969
962
|
disableOutsidePointerEvents: s,
|
|
970
|
-
onEscapeKeyDown:
|
|
971
|
-
onPointerDownOutside:
|
|
963
|
+
onEscapeKeyDown: p,
|
|
964
|
+
onPointerDownOutside: v,
|
|
972
965
|
onFocusOutside: d,
|
|
973
|
-
onInteractOutside:
|
|
966
|
+
onInteractOutside: g,
|
|
974
967
|
onDismiss: C,
|
|
975
968
|
children: /* @__PURE__ */ l(
|
|
976
969
|
wr,
|
|
977
970
|
{
|
|
978
971
|
asChild: !0,
|
|
979
|
-
...
|
|
980
|
-
dir:
|
|
972
|
+
...R,
|
|
973
|
+
dir: h.dir,
|
|
981
974
|
orientation: "vertical",
|
|
982
975
|
loop: r,
|
|
983
976
|
currentTabStopId: y,
|
|
984
|
-
onCurrentTabStopIdChange:
|
|
985
|
-
onEntryFocus: S(
|
|
986
|
-
|
|
977
|
+
onCurrentTabStopIdChange: P,
|
|
978
|
+
onEntryFocus: S(m, (E) => {
|
|
979
|
+
h.isUsingKeyboardRef.current || E.preventDefault();
|
|
987
980
|
}),
|
|
988
981
|
preventScrollOnEntryFocus: !0,
|
|
989
982
|
children: /* @__PURE__ */ l(
|
|
@@ -991,33 +984,33 @@ var F = "MenuContent", [Hr, $e] = j(F), Kt = o.forwardRef(
|
|
|
991
984
|
{
|
|
992
985
|
role: "menu",
|
|
993
986
|
"aria-orientation": "vertical",
|
|
994
|
-
"data-state": tn(
|
|
987
|
+
"data-state": tn(w.open),
|
|
995
988
|
"data-radix-menu-content": "",
|
|
996
|
-
dir:
|
|
997
|
-
...
|
|
989
|
+
dir: h.dir,
|
|
990
|
+
...M,
|
|
998
991
|
...i,
|
|
999
|
-
ref:
|
|
992
|
+
ref: _,
|
|
1000
993
|
style: { outline: "none", ...i.style },
|
|
1001
|
-
onKeyDown: S(i.onKeyDown, (
|
|
1002
|
-
const A =
|
|
1003
|
-
A && (
|
|
994
|
+
onKeyDown: S(i.onKeyDown, (E) => {
|
|
995
|
+
const A = E.target.closest("[data-radix-menu-content]") === E.currentTarget, G = E.ctrlKey || E.altKey || E.metaKey, re = E.key.length === 1;
|
|
996
|
+
A && (E.key === "Tab" && E.preventDefault(), !G && re && Q(E.key));
|
|
1004
997
|
const oe = I.current;
|
|
1005
|
-
if (
|
|
998
|
+
if (E.target !== oe || !Fr.includes(E.key))
|
|
1006
999
|
return;
|
|
1007
|
-
|
|
1008
|
-
const X =
|
|
1009
|
-
Dt.includes(
|
|
1000
|
+
E.preventDefault();
|
|
1001
|
+
const X = b().filter((B) => !B.disabled).map((B) => B.ref.current);
|
|
1002
|
+
Dt.includes(E.key) && X.reverse(), no(X);
|
|
1010
1003
|
}),
|
|
1011
|
-
onBlur: S(e.onBlur, (
|
|
1012
|
-
|
|
1004
|
+
onBlur: S(e.onBlur, (E) => {
|
|
1005
|
+
E.currentTarget.contains(E.target) || (window.clearTimeout(k.current), $.current = "");
|
|
1013
1006
|
}),
|
|
1014
1007
|
onPointerMove: S(
|
|
1015
1008
|
e.onPointerMove,
|
|
1016
|
-
le((
|
|
1017
|
-
const T =
|
|
1018
|
-
if (
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1009
|
+
le((E) => {
|
|
1010
|
+
const T = E.target, A = Z.current !== E.clientX;
|
|
1011
|
+
if (E.currentTarget.contains(T) && A) {
|
|
1012
|
+
const G = E.clientX > Z.current ? "right" : "left";
|
|
1013
|
+
U.current = G, Z.current = E.clientX;
|
|
1021
1014
|
}
|
|
1022
1015
|
})
|
|
1023
1016
|
)
|
|
@@ -1033,84 +1026,84 @@ var F = "MenuContent", [Hr, $e] = j(F), Kt = o.forwardRef(
|
|
|
1033
1026
|
);
|
|
1034
1027
|
}
|
|
1035
1028
|
);
|
|
1036
|
-
|
|
1037
|
-
var
|
|
1029
|
+
Gt.displayName = F;
|
|
1030
|
+
var Vr = "MenuGroup", Be = o.forwardRef(
|
|
1038
1031
|
(e, t) => {
|
|
1039
1032
|
const { __scopeMenu: n, ...r } = e;
|
|
1040
1033
|
return /* @__PURE__ */ l(D.div, { role: "group", ...r, ref: t });
|
|
1041
1034
|
}
|
|
1042
1035
|
);
|
|
1043
|
-
|
|
1044
|
-
var
|
|
1036
|
+
Be.displayName = Vr;
|
|
1037
|
+
var jr = "MenuLabel", $t = o.forwardRef(
|
|
1045
1038
|
(e, t) => {
|
|
1046
1039
|
const { __scopeMenu: n, ...r } = e;
|
|
1047
1040
|
return /* @__PURE__ */ l(D.div, { ...r, ref: t });
|
|
1048
1041
|
}
|
|
1049
1042
|
);
|
|
1050
|
-
|
|
1051
|
-
var
|
|
1043
|
+
$t.displayName = jr;
|
|
1044
|
+
var we = "MenuItem", rt = "menu.itemSelect", Se = o.forwardRef(
|
|
1052
1045
|
(e, t) => {
|
|
1053
|
-
const { disabled: n = !1, onSelect: r, ...a } = e, c = o.useRef(null), u =
|
|
1046
|
+
const { disabled: n = !1, onSelect: r, ...a } = e, c = o.useRef(null), u = pe(we, e.__scopeMenu), s = $e(we, e.__scopeMenu), m = K(t, c), p = o.useRef(!1), v = () => {
|
|
1054
1047
|
const d = c.current;
|
|
1055
1048
|
if (!n && d) {
|
|
1056
|
-
const
|
|
1057
|
-
d.addEventListener(rt, (C) => r == null ? void 0 : r(C), { once: !0 }), wn(d,
|
|
1049
|
+
const g = new CustomEvent(rt, { bubbles: !0, cancelable: !0 });
|
|
1050
|
+
d.addEventListener(rt, (C) => r == null ? void 0 : r(C), { once: !0 }), wn(d, g), g.defaultPrevented ? p.current = !1 : u.onClose();
|
|
1058
1051
|
}
|
|
1059
1052
|
};
|
|
1060
1053
|
return /* @__PURE__ */ l(
|
|
1061
|
-
|
|
1054
|
+
Ut,
|
|
1062
1055
|
{
|
|
1063
1056
|
...a,
|
|
1064
|
-
ref:
|
|
1057
|
+
ref: m,
|
|
1065
1058
|
disabled: n,
|
|
1066
|
-
onClick: S(e.onClick,
|
|
1059
|
+
onClick: S(e.onClick, v),
|
|
1067
1060
|
onPointerDown: (d) => {
|
|
1068
|
-
var
|
|
1069
|
-
(
|
|
1061
|
+
var g;
|
|
1062
|
+
(g = e.onPointerDown) == null || g.call(e, d), p.current = !0;
|
|
1070
1063
|
},
|
|
1071
1064
|
onPointerUp: S(e.onPointerUp, (d) => {
|
|
1072
|
-
var
|
|
1073
|
-
|
|
1065
|
+
var g;
|
|
1066
|
+
p.current || (g = d.currentTarget) == null || g.click();
|
|
1074
1067
|
}),
|
|
1075
1068
|
onKeyDown: S(e.onKeyDown, (d) => {
|
|
1076
|
-
const
|
|
1077
|
-
n ||
|
|
1069
|
+
const g = s.searchRef.current !== "";
|
|
1070
|
+
n || g && d.key === " " || Fe.includes(d.key) && (d.currentTarget.click(), d.preventDefault());
|
|
1078
1071
|
})
|
|
1079
1072
|
}
|
|
1080
1073
|
);
|
|
1081
1074
|
}
|
|
1082
1075
|
);
|
|
1083
|
-
Se.displayName =
|
|
1084
|
-
var
|
|
1076
|
+
Se.displayName = we;
|
|
1077
|
+
var Ut = o.forwardRef(
|
|
1085
1078
|
(e, t) => {
|
|
1086
|
-
const { __scopeMenu: n, disabled: r = !1, textValue: a, ...c } = e, u = $e(
|
|
1079
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: a, ...c } = e, u = $e(we, n), s = Ft(n), m = o.useRef(null), p = K(t, m), [v, d] = o.useState(!1), [g, C] = o.useState("");
|
|
1087
1080
|
return o.useEffect(() => {
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1081
|
+
const f = m.current;
|
|
1082
|
+
f && C((f.textContent ?? "").trim());
|
|
1090
1083
|
}, [c.children]), /* @__PURE__ */ l(
|
|
1091
1084
|
ue.ItemSlot,
|
|
1092
1085
|
{
|
|
1093
1086
|
scope: n,
|
|
1094
1087
|
disabled: r,
|
|
1095
|
-
textValue: a ??
|
|
1088
|
+
textValue: a ?? g,
|
|
1096
1089
|
children: /* @__PURE__ */ l(Cr, { asChild: !0, ...s, focusable: !r, children: /* @__PURE__ */ l(
|
|
1097
1090
|
D.div,
|
|
1098
1091
|
{
|
|
1099
1092
|
role: "menuitem",
|
|
1100
|
-
"data-highlighted":
|
|
1093
|
+
"data-highlighted": v ? "" : void 0,
|
|
1101
1094
|
"aria-disabled": r || void 0,
|
|
1102
1095
|
"data-disabled": r ? "" : void 0,
|
|
1103
1096
|
...c,
|
|
1104
|
-
ref:
|
|
1097
|
+
ref: p,
|
|
1105
1098
|
onPointerMove: S(
|
|
1106
1099
|
e.onPointerMove,
|
|
1107
|
-
le((
|
|
1108
|
-
r ? u.onItemLeave(
|
|
1100
|
+
le((f) => {
|
|
1101
|
+
r ? u.onItemLeave(f) : (u.onItemEnter(f), f.defaultPrevented || f.currentTarget.focus({ preventScroll: !0 }));
|
|
1109
1102
|
})
|
|
1110
1103
|
),
|
|
1111
1104
|
onPointerLeave: S(
|
|
1112
1105
|
e.onPointerLeave,
|
|
1113
|
-
le((
|
|
1106
|
+
le((f) => u.onItemLeave(f))
|
|
1114
1107
|
),
|
|
1115
1108
|
onFocus: S(e.onFocus, () => d(!0)),
|
|
1116
1109
|
onBlur: S(e.onBlur, () => d(!1))
|
|
@@ -1119,41 +1112,41 @@ var $t = o.forwardRef(
|
|
|
1119
1112
|
}
|
|
1120
1113
|
);
|
|
1121
1114
|
}
|
|
1122
|
-
),
|
|
1115
|
+
), zr = "MenuCheckboxItem", Bt = o.forwardRef(
|
|
1123
1116
|
(e, t) => {
|
|
1124
1117
|
const { checked: n = !1, onCheckedChange: r, ...a } = e;
|
|
1125
1118
|
return /* @__PURE__ */ l(Vt, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ l(
|
|
1126
1119
|
Se,
|
|
1127
1120
|
{
|
|
1128
1121
|
role: "menuitemcheckbox",
|
|
1129
|
-
"aria-checked":
|
|
1122
|
+
"aria-checked": Ce(n) ? "mixed" : n,
|
|
1130
1123
|
...a,
|
|
1131
1124
|
ref: t,
|
|
1132
|
-
"data-state":
|
|
1125
|
+
"data-state": He(n),
|
|
1133
1126
|
onSelect: S(
|
|
1134
1127
|
a.onSelect,
|
|
1135
|
-
() => r == null ? void 0 : r(
|
|
1128
|
+
() => r == null ? void 0 : r(Ce(n) ? !0 : !n),
|
|
1136
1129
|
{ checkForDefaultPrevented: !1 }
|
|
1137
1130
|
)
|
|
1138
1131
|
}
|
|
1139
1132
|
) });
|
|
1140
1133
|
}
|
|
1141
1134
|
);
|
|
1142
|
-
Bt.displayName =
|
|
1143
|
-
var Yt = "MenuRadioGroup", [
|
|
1135
|
+
Bt.displayName = zr;
|
|
1136
|
+
var Yt = "MenuRadioGroup", [Zr, qr] = j(
|
|
1144
1137
|
Yt,
|
|
1145
1138
|
{ value: void 0, onValueChange: () => {
|
|
1146
1139
|
} }
|
|
1147
1140
|
), Ht = o.forwardRef(
|
|
1148
1141
|
(e, t) => {
|
|
1149
1142
|
const { value: n, onValueChange: r, ...a } = e, c = ne(r);
|
|
1150
|
-
return /* @__PURE__ */ l(
|
|
1143
|
+
return /* @__PURE__ */ l(Zr, { scope: e.__scopeMenu, value: n, onValueChange: c, children: /* @__PURE__ */ l(Be, { ...a, ref: t }) });
|
|
1151
1144
|
}
|
|
1152
1145
|
);
|
|
1153
1146
|
Ht.displayName = Yt;
|
|
1154
1147
|
var Wt = "MenuRadioItem", Xt = o.forwardRef(
|
|
1155
1148
|
(e, t) => {
|
|
1156
|
-
const { value: n, ...r } = e, a =
|
|
1149
|
+
const { value: n, ...r } = e, a = qr(Wt, e.__scopeMenu), c = n === a.value;
|
|
1157
1150
|
return /* @__PURE__ */ l(Vt, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ l(
|
|
1158
1151
|
Se,
|
|
1159
1152
|
{
|
|
@@ -1161,7 +1154,7 @@ var Wt = "MenuRadioItem", Xt = o.forwardRef(
|
|
|
1161
1154
|
"aria-checked": c,
|
|
1162
1155
|
...r,
|
|
1163
1156
|
ref: t,
|
|
1164
|
-
"data-state":
|
|
1157
|
+
"data-state": He(c),
|
|
1165
1158
|
onSelect: S(
|
|
1166
1159
|
r.onSelect,
|
|
1167
1160
|
() => {
|
|
@@ -1175,30 +1168,30 @@ var Wt = "MenuRadioItem", Xt = o.forwardRef(
|
|
|
1175
1168
|
}
|
|
1176
1169
|
);
|
|
1177
1170
|
Xt.displayName = Wt;
|
|
1178
|
-
var
|
|
1179
|
-
|
|
1171
|
+
var Ye = "MenuItemIndicator", [Vt, Qr] = j(
|
|
1172
|
+
Ye,
|
|
1180
1173
|
{ checked: !1 }
|
|
1181
1174
|
), jt = o.forwardRef(
|
|
1182
1175
|
(e, t) => {
|
|
1183
|
-
const { __scopeMenu: n, forceMount: r, ...a } = e, c =
|
|
1176
|
+
const { __scopeMenu: n, forceMount: r, ...a } = e, c = Qr(Ye, n);
|
|
1184
1177
|
return /* @__PURE__ */ l(
|
|
1185
|
-
|
|
1178
|
+
Me,
|
|
1186
1179
|
{
|
|
1187
|
-
present: r ||
|
|
1180
|
+
present: r || Ce(c.checked) || c.checked === !0,
|
|
1188
1181
|
children: /* @__PURE__ */ l(
|
|
1189
1182
|
D.span,
|
|
1190
1183
|
{
|
|
1191
1184
|
...a,
|
|
1192
1185
|
ref: t,
|
|
1193
|
-
"data-state":
|
|
1186
|
+
"data-state": He(c.checked)
|
|
1194
1187
|
}
|
|
1195
1188
|
)
|
|
1196
1189
|
}
|
|
1197
1190
|
);
|
|
1198
1191
|
}
|
|
1199
1192
|
);
|
|
1200
|
-
jt.displayName =
|
|
1201
|
-
var
|
|
1193
|
+
jt.displayName = Ye;
|
|
1194
|
+
var Jr = "MenuSeparator", zt = o.forwardRef(
|
|
1202
1195
|
(e, t) => {
|
|
1203
1196
|
const { __scopeMenu: n, ...r } = e;
|
|
1204
1197
|
return /* @__PURE__ */ l(
|
|
@@ -1212,26 +1205,26 @@ var eo = "MenuSeparator", zt = o.forwardRef(
|
|
|
1212
1205
|
);
|
|
1213
1206
|
}
|
|
1214
1207
|
);
|
|
1215
|
-
zt.displayName =
|
|
1216
|
-
var
|
|
1208
|
+
zt.displayName = Jr;
|
|
1209
|
+
var eo = "MenuArrow", Zt = o.forwardRef(
|
|
1217
1210
|
(e, t) => {
|
|
1218
1211
|
const { __scopeMenu: n, ...r } = e, a = be(n);
|
|
1219
1212
|
return /* @__PURE__ */ l(sr, { ...a, ...r, ref: t });
|
|
1220
1213
|
}
|
|
1221
1214
|
);
|
|
1222
|
-
Zt.displayName =
|
|
1223
|
-
var
|
|
1215
|
+
Zt.displayName = eo;
|
|
1216
|
+
var to = "MenuSub", [Qo, qt] = j(to), ie = "MenuSubTrigger", Qt = o.forwardRef(
|
|
1224
1217
|
(e, t) => {
|
|
1225
|
-
const n = z(ie, e.__scopeMenu), r =
|
|
1218
|
+
const n = z(ie, e.__scopeMenu), r = pe(ie, e.__scopeMenu), a = qt(ie, e.__scopeMenu), c = $e(ie, e.__scopeMenu), u = o.useRef(null), { pointerGraceTimerRef: s, onPointerGraceIntentChange: m } = c, p = { __scopeMenu: e.__scopeMenu }, v = o.useCallback(() => {
|
|
1226
1219
|
u.current && window.clearTimeout(u.current), u.current = null;
|
|
1227
1220
|
}, []);
|
|
1228
|
-
return o.useEffect(() =>
|
|
1221
|
+
return o.useEffect(() => v, [v]), o.useEffect(() => {
|
|
1229
1222
|
const d = s.current;
|
|
1230
1223
|
return () => {
|
|
1231
|
-
window.clearTimeout(d),
|
|
1224
|
+
window.clearTimeout(d), m(null);
|
|
1232
1225
|
};
|
|
1233
|
-
}, [s,
|
|
1234
|
-
|
|
1226
|
+
}, [s, m]), /* @__PURE__ */ l(Ke, { asChild: !0, ...p, children: /* @__PURE__ */ l(
|
|
1227
|
+
Ut,
|
|
1235
1228
|
{
|
|
1236
1229
|
id: a.triggerId,
|
|
1237
1230
|
"aria-haspopup": "menu",
|
|
@@ -1241,34 +1234,34 @@ var no = "MenuSub", [Jo, qt] = j(no), ie = "MenuSubTrigger", Qt = o.forwardRef(
|
|
|
1241
1234
|
...e,
|
|
1242
1235
|
ref: at(t, a.onTriggerChange),
|
|
1243
1236
|
onClick: (d) => {
|
|
1244
|
-
var
|
|
1245
|
-
(
|
|
1237
|
+
var g;
|
|
1238
|
+
(g = e.onClick) == null || g.call(e, d), !(e.disabled || d.defaultPrevented) && (d.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
1246
1239
|
},
|
|
1247
1240
|
onPointerMove: S(
|
|
1248
1241
|
e.onPointerMove,
|
|
1249
1242
|
le((d) => {
|
|
1250
1243
|
c.onItemEnter(d), !d.defaultPrevented && !e.disabled && !n.open && !u.current && (c.onPointerGraceIntentChange(null), u.current = window.setTimeout(() => {
|
|
1251
|
-
n.onOpenChange(!0),
|
|
1244
|
+
n.onOpenChange(!0), v();
|
|
1252
1245
|
}, 100));
|
|
1253
1246
|
})
|
|
1254
1247
|
),
|
|
1255
1248
|
onPointerLeave: S(
|
|
1256
1249
|
e.onPointerLeave,
|
|
1257
1250
|
le((d) => {
|
|
1258
|
-
var C,
|
|
1259
|
-
|
|
1260
|
-
const
|
|
1261
|
-
if (
|
|
1262
|
-
const i = (
|
|
1251
|
+
var C, f;
|
|
1252
|
+
v();
|
|
1253
|
+
const g = (C = n.content) == null ? void 0 : C.getBoundingClientRect();
|
|
1254
|
+
if (g) {
|
|
1255
|
+
const i = (f = n.content) == null ? void 0 : f.dataset.side, w = i === "right", h = w ? -5 : 5, M = g[w ? "left" : "right"], R = g[w ? "right" : "left"];
|
|
1263
1256
|
c.onPointerGraceIntentChange({
|
|
1264
1257
|
area: [
|
|
1265
1258
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
1266
1259
|
// consistently within polygon bounds
|
|
1267
|
-
{ x: d.clientX +
|
|
1268
|
-
{ x:
|
|
1269
|
-
{ x:
|
|
1270
|
-
{ x:
|
|
1271
|
-
{ x:
|
|
1260
|
+
{ x: d.clientX + h, y: d.clientY },
|
|
1261
|
+
{ x: M, y: g.top },
|
|
1262
|
+
{ x: R, y: g.top },
|
|
1263
|
+
{ x: R, y: g.bottom },
|
|
1264
|
+
{ x: M, y: g.bottom }
|
|
1272
1265
|
],
|
|
1273
1266
|
side: i
|
|
1274
1267
|
}), window.clearTimeout(s.current), s.current = window.setTimeout(
|
|
@@ -1284,8 +1277,8 @@ var no = "MenuSub", [Jo, qt] = j(no), ie = "MenuSubTrigger", Qt = o.forwardRef(
|
|
|
1284
1277
|
),
|
|
1285
1278
|
onKeyDown: S(e.onKeyDown, (d) => {
|
|
1286
1279
|
var C;
|
|
1287
|
-
const
|
|
1288
|
-
e.disabled ||
|
|
1280
|
+
const g = c.searchRef.current !== "";
|
|
1281
|
+
e.disabled || g && d.key === " " || kr[r.dir].includes(d.key) && (n.onOpenChange(!0), (C = n.content) == null || C.focus(), d.preventDefault());
|
|
1289
1282
|
})
|
|
1290
1283
|
}
|
|
1291
1284
|
) });
|
|
@@ -1294,34 +1287,34 @@ var no = "MenuSub", [Jo, qt] = j(no), ie = "MenuSubTrigger", Qt = o.forwardRef(
|
|
|
1294
1287
|
Qt.displayName = ie;
|
|
1295
1288
|
var Jt = "MenuSubContent", en = o.forwardRef(
|
|
1296
1289
|
(e, t) => {
|
|
1297
|
-
const n = Lt(F, e.__scopeMenu), { forceMount: r = n.forceMount, ...a } = e, c = z(F, e.__scopeMenu), u =
|
|
1298
|
-
return /* @__PURE__ */ l(ue.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ l(
|
|
1299
|
-
|
|
1290
|
+
const n = Lt(F, e.__scopeMenu), { forceMount: r = n.forceMount, ...a } = e, c = z(F, e.__scopeMenu), u = pe(F, e.__scopeMenu), s = qt(Jt, e.__scopeMenu), m = o.useRef(null), p = K(t, m);
|
|
1291
|
+
return /* @__PURE__ */ l(ue.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ l(Me, { present: r || c.open, children: /* @__PURE__ */ l(ue.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ l(
|
|
1292
|
+
Ue,
|
|
1300
1293
|
{
|
|
1301
1294
|
id: s.contentId,
|
|
1302
1295
|
"aria-labelledby": s.triggerId,
|
|
1303
1296
|
...a,
|
|
1304
|
-
ref:
|
|
1297
|
+
ref: p,
|
|
1305
1298
|
align: "start",
|
|
1306
1299
|
side: u.dir === "rtl" ? "left" : "right",
|
|
1307
1300
|
disableOutsidePointerEvents: !1,
|
|
1308
1301
|
disableOutsideScroll: !1,
|
|
1309
1302
|
trapFocus: !1,
|
|
1310
|
-
onOpenAutoFocus: (
|
|
1303
|
+
onOpenAutoFocus: (v) => {
|
|
1311
1304
|
var d;
|
|
1312
|
-
u.isUsingKeyboardRef.current && ((d =
|
|
1305
|
+
u.isUsingKeyboardRef.current && ((d = m.current) == null || d.focus()), v.preventDefault();
|
|
1313
1306
|
},
|
|
1314
|
-
onCloseAutoFocus: (
|
|
1315
|
-
onFocusOutside: S(e.onFocusOutside, (
|
|
1316
|
-
|
|
1307
|
+
onCloseAutoFocus: (v) => v.preventDefault(),
|
|
1308
|
+
onFocusOutside: S(e.onFocusOutside, (v) => {
|
|
1309
|
+
v.target !== s.trigger && c.onOpenChange(!1);
|
|
1317
1310
|
}),
|
|
1318
|
-
onEscapeKeyDown: S(e.onEscapeKeyDown, (
|
|
1319
|
-
u.onClose(),
|
|
1311
|
+
onEscapeKeyDown: S(e.onEscapeKeyDown, (v) => {
|
|
1312
|
+
u.onClose(), v.preventDefault();
|
|
1320
1313
|
}),
|
|
1321
|
-
onKeyDown: S(e.onKeyDown, (
|
|
1314
|
+
onKeyDown: S(e.onKeyDown, (v) => {
|
|
1322
1315
|
var C;
|
|
1323
|
-
const d =
|
|
1324
|
-
d &&
|
|
1316
|
+
const d = v.currentTarget.contains(v.target), g = Lr[u.dir].includes(v.key);
|
|
1317
|
+
d && g && (c.onOpenChange(!1), (C = s.trigger) == null || C.focus(), v.preventDefault());
|
|
1325
1318
|
})
|
|
1326
1319
|
}
|
|
1327
1320
|
) }) }) });
|
|
@@ -1331,52 +1324,52 @@ en.displayName = Jt;
|
|
|
1331
1324
|
function tn(e) {
|
|
1332
1325
|
return e ? "open" : "closed";
|
|
1333
1326
|
}
|
|
1334
|
-
function
|
|
1327
|
+
function Ce(e) {
|
|
1335
1328
|
return e === "indeterminate";
|
|
1336
1329
|
}
|
|
1337
|
-
function
|
|
1338
|
-
return
|
|
1330
|
+
function He(e) {
|
|
1331
|
+
return Ce(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
1339
1332
|
}
|
|
1340
|
-
function
|
|
1333
|
+
function no(e) {
|
|
1341
1334
|
const t = document.activeElement;
|
|
1342
1335
|
for (const n of e)
|
|
1343
1336
|
if (n === t || (n.focus(), document.activeElement !== t))
|
|
1344
1337
|
return;
|
|
1345
1338
|
}
|
|
1346
|
-
function
|
|
1339
|
+
function ro(e, t) {
|
|
1347
1340
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
1348
1341
|
}
|
|
1349
|
-
function
|
|
1350
|
-
const a = t.length > 1 && Array.from(t).every((
|
|
1351
|
-
let u =
|
|
1352
|
-
a.length === 1 && (u = u.filter((
|
|
1353
|
-
const
|
|
1354
|
-
(
|
|
1342
|
+
function oo(e, t, n) {
|
|
1343
|
+
const a = t.length > 1 && Array.from(t).every((p) => p === t[0]) ? t[0] : t, c = n ? e.indexOf(n) : -1;
|
|
1344
|
+
let u = ro(e, Math.max(c, 0));
|
|
1345
|
+
a.length === 1 && (u = u.filter((p) => p !== n));
|
|
1346
|
+
const m = u.find(
|
|
1347
|
+
(p) => p.toLowerCase().startsWith(a.toLowerCase())
|
|
1355
1348
|
);
|
|
1356
|
-
return
|
|
1349
|
+
return m !== n ? m : void 0;
|
|
1357
1350
|
}
|
|
1358
|
-
function
|
|
1351
|
+
function ao(e, t) {
|
|
1359
1352
|
const { x: n, y: r } = e;
|
|
1360
1353
|
let a = !1;
|
|
1361
1354
|
for (let c = 0, u = t.length - 1; c < t.length; u = c++) {
|
|
1362
|
-
const s = t[c],
|
|
1363
|
-
|
|
1355
|
+
const s = t[c].x, m = t[c].y, p = t[u].x, v = t[u].y;
|
|
1356
|
+
m > r != v > r && n < (p - s) * (r - m) / (v - m) + s && (a = !a);
|
|
1364
1357
|
}
|
|
1365
1358
|
return a;
|
|
1366
1359
|
}
|
|
1367
|
-
function
|
|
1360
|
+
function co(e, t) {
|
|
1368
1361
|
if (!t)
|
|
1369
1362
|
return !1;
|
|
1370
1363
|
const n = { x: e.clientX, y: e.clientY };
|
|
1371
|
-
return
|
|
1364
|
+
return ao(n, t);
|
|
1372
1365
|
}
|
|
1373
1366
|
function le(e) {
|
|
1374
1367
|
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
1375
1368
|
}
|
|
1376
|
-
var
|
|
1377
|
-
|
|
1369
|
+
var so = kt, io = Ke, uo = Kt, lo = Gt, fo = Be, po = $t, mo = Se, vo = Bt, ho = Ht, go = Xt, wo = jt, Co = zt, Mo = Zt, Eo = Qt, Ro = en, We = "DropdownMenu", [bo, Jo] = de(
|
|
1370
|
+
We,
|
|
1378
1371
|
[Ot]
|
|
1379
|
-
), x = Ot(), [
|
|
1372
|
+
), x = Ot(), [So, nn] = bo(We), rn = (e) => {
|
|
1380
1373
|
const {
|
|
1381
1374
|
__scopeDropdownMenu: t,
|
|
1382
1375
|
children: n,
|
|
@@ -1385,32 +1378,31 @@ var io = kt, uo = Ke, lo = Gt, fo = Kt, po = Ye, mo = Ut, vo = Se, ho = Bt, go =
|
|
|
1385
1378
|
defaultOpen: c,
|
|
1386
1379
|
onOpenChange: u,
|
|
1387
1380
|
modal: s = !0
|
|
1388
|
-
} = e,
|
|
1381
|
+
} = e, m = x(t), p = o.useRef(null), [v = !1, d] = ot({
|
|
1389
1382
|
prop: a,
|
|
1390
|
-
defaultProp: c
|
|
1391
|
-
onChange: u
|
|
1392
|
-
caller: ye
|
|
1383
|
+
defaultProp: c,
|
|
1384
|
+
onChange: u
|
|
1393
1385
|
});
|
|
1394
1386
|
return /* @__PURE__ */ l(
|
|
1395
|
-
|
|
1387
|
+
So,
|
|
1396
1388
|
{
|
|
1397
1389
|
scope: t,
|
|
1398
|
-
triggerId:
|
|
1399
|
-
triggerRef:
|
|
1400
|
-
contentId:
|
|
1401
|
-
open:
|
|
1390
|
+
triggerId: Ne(),
|
|
1391
|
+
triggerRef: p,
|
|
1392
|
+
contentId: Ne(),
|
|
1393
|
+
open: v,
|
|
1402
1394
|
onOpenChange: d,
|
|
1403
|
-
onOpenToggle: o.useCallback(() => d((
|
|
1395
|
+
onOpenToggle: o.useCallback(() => d((g) => !g), [d]),
|
|
1404
1396
|
modal: s,
|
|
1405
|
-
children: /* @__PURE__ */ l(
|
|
1397
|
+
children: /* @__PURE__ */ l(so, { ...m, open: v, onOpenChange: d, dir: r, modal: s, children: n })
|
|
1406
1398
|
}
|
|
1407
1399
|
);
|
|
1408
1400
|
};
|
|
1409
|
-
rn.displayName =
|
|
1401
|
+
rn.displayName = We;
|
|
1410
1402
|
var on = "DropdownMenuTrigger", an = o.forwardRef(
|
|
1411
1403
|
(e, t) => {
|
|
1412
1404
|
const { __scopeDropdownMenu: n, disabled: r = !1, ...a } = e, c = nn(on, n), u = x(n);
|
|
1413
|
-
return /* @__PURE__ */ l(
|
|
1405
|
+
return /* @__PURE__ */ l(io, { asChild: !0, ...u, children: /* @__PURE__ */ l(
|
|
1414
1406
|
D.button,
|
|
1415
1407
|
{
|
|
1416
1408
|
type: "button",
|
|
@@ -1434,16 +1426,16 @@ var on = "DropdownMenuTrigger", an = o.forwardRef(
|
|
|
1434
1426
|
}
|
|
1435
1427
|
);
|
|
1436
1428
|
an.displayName = on;
|
|
1437
|
-
var
|
|
1429
|
+
var yo = "DropdownMenuPortal", cn = (e) => {
|
|
1438
1430
|
const { __scopeDropdownMenu: t, ...n } = e, r = x(t);
|
|
1439
|
-
return /* @__PURE__ */ l(
|
|
1431
|
+
return /* @__PURE__ */ l(uo, { ...r, ...n });
|
|
1440
1432
|
};
|
|
1441
|
-
cn.displayName =
|
|
1433
|
+
cn.displayName = yo;
|
|
1442
1434
|
var sn = "DropdownMenuContent", un = o.forwardRef(
|
|
1443
1435
|
(e, t) => {
|
|
1444
1436
|
const { __scopeDropdownMenu: n, ...r } = e, a = nn(sn, n), c = x(n), u = o.useRef(!1);
|
|
1445
1437
|
return /* @__PURE__ */ l(
|
|
1446
|
-
|
|
1438
|
+
lo,
|
|
1447
1439
|
{
|
|
1448
1440
|
id: a.contentId,
|
|
1449
1441
|
"aria-labelledby": a.triggerId,
|
|
@@ -1451,12 +1443,12 @@ var sn = "DropdownMenuContent", un = o.forwardRef(
|
|
|
1451
1443
|
...r,
|
|
1452
1444
|
ref: t,
|
|
1453
1445
|
onCloseAutoFocus: S(e.onCloseAutoFocus, (s) => {
|
|
1454
|
-
var
|
|
1455
|
-
u.current || (
|
|
1446
|
+
var m;
|
|
1447
|
+
u.current || (m = a.triggerRef.current) == null || m.focus(), u.current = !1, s.preventDefault();
|
|
1456
1448
|
}),
|
|
1457
1449
|
onInteractOutside: S(e.onInteractOutside, (s) => {
|
|
1458
|
-
const
|
|
1459
|
-
(!a.modal ||
|
|
1450
|
+
const m = s.detail.originalEvent, p = m.button === 0 && m.ctrlKey === !0, v = m.button === 2 || p;
|
|
1451
|
+
(!a.modal || v) && (u.current = !0);
|
|
1460
1452
|
}),
|
|
1461
1453
|
style: {
|
|
1462
1454
|
...e.style,
|
|
@@ -1471,68 +1463,68 @@ var sn = "DropdownMenuContent", un = o.forwardRef(
|
|
|
1471
1463
|
}
|
|
1472
1464
|
);
|
|
1473
1465
|
un.displayName = sn;
|
|
1474
|
-
var
|
|
1466
|
+
var _o = "DropdownMenuGroup", ln = o.forwardRef(
|
|
1475
1467
|
(e, t) => {
|
|
1476
1468
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1477
|
-
return /* @__PURE__ */ l(
|
|
1469
|
+
return /* @__PURE__ */ l(fo, { ...a, ...r, ref: t });
|
|
1478
1470
|
}
|
|
1479
1471
|
);
|
|
1480
|
-
ln.displayName =
|
|
1481
|
-
var
|
|
1472
|
+
ln.displayName = _o;
|
|
1473
|
+
var Po = "DropdownMenuLabel", Io = o.forwardRef(
|
|
1482
1474
|
(e, t) => {
|
|
1483
1475
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1484
|
-
return /* @__PURE__ */ l(
|
|
1476
|
+
return /* @__PURE__ */ l(po, { ...a, ...r, ref: t });
|
|
1485
1477
|
}
|
|
1486
1478
|
);
|
|
1487
|
-
|
|
1488
|
-
var
|
|
1479
|
+
Io.displayName = Po;
|
|
1480
|
+
var Ao = "DropdownMenuItem", dn = o.forwardRef(
|
|
1489
1481
|
(e, t) => {
|
|
1490
1482
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1491
|
-
return /* @__PURE__ */ l(
|
|
1483
|
+
return /* @__PURE__ */ l(mo, { ...a, ...r, ref: t });
|
|
1492
1484
|
}
|
|
1493
1485
|
);
|
|
1494
|
-
dn.displayName =
|
|
1495
|
-
var
|
|
1486
|
+
dn.displayName = Ao;
|
|
1487
|
+
var xo = "DropdownMenuCheckboxItem", To = o.forwardRef((e, t) => {
|
|
1488
|
+
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1489
|
+
return /* @__PURE__ */ l(vo, { ...a, ...r, ref: t });
|
|
1490
|
+
});
|
|
1491
|
+
To.displayName = xo;
|
|
1492
|
+
var No = "DropdownMenuRadioGroup", Do = o.forwardRef((e, t) => {
|
|
1496
1493
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1497
1494
|
return /* @__PURE__ */ l(ho, { ...a, ...r, ref: t });
|
|
1498
1495
|
});
|
|
1499
|
-
|
|
1500
|
-
var
|
|
1496
|
+
Do.displayName = No;
|
|
1497
|
+
var Oo = "DropdownMenuRadioItem", Fo = o.forwardRef((e, t) => {
|
|
1501
1498
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1502
1499
|
return /* @__PURE__ */ l(go, { ...a, ...r, ref: t });
|
|
1503
1500
|
});
|
|
1504
|
-
|
|
1505
|
-
var
|
|
1501
|
+
Fo.displayName = Oo;
|
|
1502
|
+
var ko = "DropdownMenuItemIndicator", Lo = o.forwardRef((e, t) => {
|
|
1506
1503
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1507
1504
|
return /* @__PURE__ */ l(wo, { ...a, ...r, ref: t });
|
|
1508
1505
|
});
|
|
1509
|
-
|
|
1510
|
-
var Lo = "DropdownMenuItemIndicator", Go = o.forwardRef((e, t) => {
|
|
1511
|
-
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1512
|
-
return /* @__PURE__ */ l(Co, { ...a, ...r, ref: t });
|
|
1513
|
-
});
|
|
1514
|
-
Go.displayName = Lo;
|
|
1506
|
+
Lo.displayName = ko;
|
|
1515
1507
|
var Ko = "DropdownMenuSeparator", fn = o.forwardRef((e, t) => {
|
|
1516
1508
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1517
|
-
return /* @__PURE__ */ l(
|
|
1509
|
+
return /* @__PURE__ */ l(Co, { ...a, ...r, ref: t });
|
|
1518
1510
|
});
|
|
1519
1511
|
fn.displayName = Ko;
|
|
1520
|
-
var
|
|
1512
|
+
var Go = "DropdownMenuArrow", $o = o.forwardRef(
|
|
1521
1513
|
(e, t) => {
|
|
1522
1514
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1523
|
-
return /* @__PURE__ */ l(
|
|
1515
|
+
return /* @__PURE__ */ l(Mo, { ...a, ...r, ref: t });
|
|
1524
1516
|
}
|
|
1525
1517
|
);
|
|
1526
|
-
$o.displayName =
|
|
1527
|
-
var
|
|
1518
|
+
$o.displayName = Go;
|
|
1519
|
+
var Uo = "DropdownMenuSubTrigger", Bo = o.forwardRef((e, t) => {
|
|
1528
1520
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1529
|
-
return /* @__PURE__ */ l(
|
|
1521
|
+
return /* @__PURE__ */ l(Eo, { ...a, ...r, ref: t });
|
|
1530
1522
|
});
|
|
1531
|
-
|
|
1532
|
-
var
|
|
1523
|
+
Bo.displayName = Uo;
|
|
1524
|
+
var Yo = "DropdownMenuSubContent", Ho = o.forwardRef((e, t) => {
|
|
1533
1525
|
const { __scopeDropdownMenu: n, ...r } = e, a = x(n);
|
|
1534
1526
|
return /* @__PURE__ */ l(
|
|
1535
|
-
|
|
1527
|
+
Ro,
|
|
1536
1528
|
{
|
|
1537
1529
|
...a,
|
|
1538
1530
|
...r,
|
|
@@ -1548,17 +1540,17 @@ var Ho = "DropdownMenuSubContent", Wo = o.forwardRef((e, t) => {
|
|
|
1548
1540
|
}
|
|
1549
1541
|
);
|
|
1550
1542
|
});
|
|
1551
|
-
|
|
1552
|
-
var
|
|
1543
|
+
Ho.displayName = Yo;
|
|
1544
|
+
var ea = rn, ta = an, na = cn, ra = un, oa = ln, aa = dn, ca = fn;
|
|
1553
1545
|
export {
|
|
1554
|
-
|
|
1546
|
+
ra as C,
|
|
1555
1547
|
ut as F,
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1548
|
+
oa as G,
|
|
1549
|
+
aa as I,
|
|
1550
|
+
na as P,
|
|
1551
|
+
ea as R,
|
|
1552
|
+
ca as S,
|
|
1553
|
+
ta as T,
|
|
1562
1554
|
Dr as a,
|
|
1563
1555
|
ct as b,
|
|
1564
1556
|
Bn as u
|