@react-pdf-kit/viewer 2.7.0 → 2.7.1-rc.1
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/{AnnotationLayer-D6BfL976.js → AnnotationLayer-CAIvKf_O.js} +1 -1
- package/dist/{Button-jStpvb3T.js → Button-DBu3SaMk.js} +3 -3
- package/dist/{Checkbox-Brta-YKG.js → Checkbox-Cl-BpoFJ.js} +4 -4
- package/dist/{Combination-DqNkTtir.js → Combination-11kyhTGt.js} +15 -15
- package/dist/Container-BuamPhw4.js +18 -0
- package/dist/{DocumentDialog-DHAWcYIz.js → DocumentDialog-cRr9sSSH.js} +10 -10
- package/dist/{DropDown-DikL-krI.js → DropDown-D6c4mnJL.js} +2 -2
- package/dist/{Input-DGJSVFE8.js → Input-Dpo1Xfxe.js} +5 -5
- package/dist/{LoaderIcon-D9YjinGf.js → LoaderIcon-B3ddfd0D.js} +1 -1
- package/dist/{LoadingIndicator-DiWoWs4Y.js → LoadingIndicator-Bzzf28Xv.js} +1 -1
- package/dist/{MenuItem-BJDWfzAw.js → MenuItem-BP_RjUuW.js} +2 -2
- package/dist/{MenuSeparator-D1H5l8Ej.js → MenuSeparator-Df2Dzzea.js} +1 -1
- package/dist/Paginate.module-DhE7N8AA.js +9 -0
- package/dist/{PaginationContext--n91mIJ4.js → PaginationContext-Cwf8sCpK.js} +77 -67
- package/dist/{PasswordModal-CA6x2l7v.js → PasswordModal-BtHVvrMg.js} +13 -12
- package/dist/{RPDropFileZone-D1C3ouep.js → RPDropFileZone-Bq1bzWmO.js} +1 -1
- package/dist/{RPPage-BuSGUFzw.js → RPPage-C_r8aeTc.js} +1 -1
- package/dist/{RPPages-CQsmCbyj.js → RPPages-DeA52_rv.js} +12 -12
- package/dist/RPTooltip-B4KrW-_f.js +568 -0
- package/dist/{SkipLink-Bvbn3miT.js → SkipLink-CdcjClGB.js} +1 -1
- package/dist/{Thumbnail-Dwo2-4Ki.js → Thumbnail-DyRfHsAh.js} +3 -3
- package/dist/{Thumbnails-ComClyJJ.js → Thumbnails-Cbr54TOa.js} +2 -2
- package/dist/assets/Button.css +1 -1
- package/dist/assets/DocumentDialog.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Paginate.css +1 -1
- package/dist/assets/PasswordModal.css +1 -1
- package/dist/assets/SkipLink.css +1 -1
- package/dist/assets/style.js +1 -1
- package/dist/{clsx-B7LyVm5O.js → clsx-DSGuh5YW.js} +1 -1
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPDropFileZone.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/icons/LoaderIcon.js +1 -1
- package/dist/components/layout/Container.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +56 -55
- package/dist/components/layout/RPLayout.js +39 -38
- package/dist/components/layout/SkipLink.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +3 -3
- 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 +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
- package/dist/components/layout/toolbar/FileDownloadTool.js +3 -3
- package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
- package/dist/components/layout/toolbar/FullScreenTool.js +5 -4
- 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 +5 -5
- package/dist/components/layout/toolbar/OtherTool.js +6 -6
- package/dist/components/layout/toolbar/Paginate.js +20 -5
- package/dist/components/layout/toolbar/PrintTool.js +3 -3
- package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
- package/dist/components/layout/toolbar/RPMoreOptions.js +6 -6
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +4 -4
- package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
- package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
- package/dist/components/layout/toolbar/SearchResultNavigator.js +2 -2
- package/dist/components/layout/toolbar/SearchTool.js +7 -6
- package/dist/components/layout/toolbar/SelectionModeTool.js +4 -4
- package/dist/components/layout/toolbar/ThumbnailTool.js +2 -2
- package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
- package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
- package/dist/components/layout/toolbar/ViewModeTool.js +4 -4
- package/dist/components/layout/toolbar/ZoomTool.js +7 -7
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -3
- package/dist/components/layout/toolbar/tools/DualPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/InputPageTool.js +37 -25
- package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +3 -3
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +3 -3
- package/dist/components/layout/toolbar/tools/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +2 -2
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +6 -6
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +5 -5
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +4 -4
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +4 -4
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/DualPage.js +2 -2
- package/dist/components/page/DualPageWithCover.js +2 -2
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +2 -2
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/Checkbox.js +1 -1
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/Input.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/PasswordModal.js +1 -1
- package/dist/components/ui/RPTooltip.js +1 -1
- package/dist/contexts/ElementThumbnailContext.js +1 -1
- package/dist/contexts/LoaderContext.js +1 -1
- package/dist/contexts/LocalizationContext.js +12 -6
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/{de_DE--0LF-SJR.js → de_DE-DwUvXUWH.js} +24 -6
- package/dist/{dist-BRVqFn7R.js → dist-BfuBBQ14.js} +6 -6
- package/dist/{dist-C3WNMuW2.js → dist-CHiIt8ey.js} +2 -2
- package/dist/{dist-bK-AHWLF.js → dist-CgoP608h.js} +7 -7
- package/dist/dist-Ch2NetCM.js +1134 -0
- package/dist/floating-ui.react-dom-DWNOhDoc.js +1096 -0
- package/dist/icons.js +1 -1
- package/dist/{lib-BiapEtK1.js → lib-CSInlR9T.js} +142 -237
- package/dist/{main-CHO5p1qM.js → main-BVY8P7qz.js} +3 -3
- package/dist/main.js +5 -5
- package/dist/style-C8T5x1fE.js +5 -0
- package/dist/types/locales/de_DE.json.d.ts +6 -2
- package/dist/types/locales/en_US.json.d.ts +6 -2
- package/dist/types/locales/it_IT.json.d.ts +6 -2
- package/dist/types/locales/pt_PT.json.d.ts +6 -2
- package/dist/types/locales/th_TH.json.d.ts +6 -2
- package/dist/types/locales/zh_CN.json.d.ts +6 -2
- package/dist/types/utils/types.d.ts +4 -0
- package/dist/utils/hooks/useLicense.js +2 -2
- package/dist/utils/hooks/useLocalization.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/types.js +1 -1
- package/package.json +1 -1
- package/dist/Container-DTWaZzc7.js +0 -16
- package/dist/Paginate.module-B0GMw-MB.js +0 -8
- package/dist/RPTooltip-ZZoFqP7C.js +0 -381
- package/dist/dist-7FA4Do6I.js +0 -1286
- package/dist/dist-CKteKPPA.js +0 -947
- package/dist/style-DKH7g1Kh.js +0 -5
package/dist/dist-CKteKPPA.js
DELETED
|
@@ -1,947 +0,0 @@
|
|
|
1
|
-
import { a as e, d as t, f as n, i as r, l as i, n as a, o, t as s, u as c } from "./dist-bK-AHWLF.js";
|
|
2
|
-
import { i as l, n as u, r as d, t as f } from "./dist-BRVqFn7R.js";
|
|
3
|
-
import { a as p, i as m, n as h, r as g, t as _ } from "./dist-7FA4Do6I.js";
|
|
4
|
-
import { i as v, n as y, r as b, t as x } from "./Combination-DqNkTtir.js";
|
|
5
|
-
import * as S from "react";
|
|
6
|
-
import C from "react";
|
|
7
|
-
import { jsx as w } from "react/jsx-runtime";
|
|
8
|
-
//#region node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@18.3.7_@types+react@18.3.27__@types+r_2a160d6c4f7d367deed369796ce196e5/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
9
|
-
function T(e) {
|
|
10
|
-
let n = e + "CollectionProvider", [r, a] = i(n), [s, c] = r(n, {
|
|
11
|
-
collectionRef: { current: null },
|
|
12
|
-
itemMap: /* @__PURE__ */ new Map()
|
|
13
|
-
}), l = (e) => {
|
|
14
|
-
let { scope: t, children: n } = e, r = C.useRef(null), i = C.useRef(/* @__PURE__ */ new Map()).current;
|
|
15
|
-
return /* @__PURE__ */ w(s, {
|
|
16
|
-
scope: t,
|
|
17
|
-
itemMap: i,
|
|
18
|
-
collectionRef: r,
|
|
19
|
-
children: n
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
l.displayName = n;
|
|
23
|
-
let u = e + "CollectionSlot", d = o(u), f = C.forwardRef((e, n) => {
|
|
24
|
-
let { scope: r, children: i } = e;
|
|
25
|
-
return /* @__PURE__ */ w(d, {
|
|
26
|
-
ref: t(n, c(u, r).collectionRef),
|
|
27
|
-
children: i
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
f.displayName = u;
|
|
31
|
-
let p = e + "CollectionItemSlot", m = "data-radix-collection-item", h = o(p), g = C.forwardRef((e, n) => {
|
|
32
|
-
let { scope: r, children: i, ...a } = e, o = C.useRef(null), s = t(n, o), l = c(p, r);
|
|
33
|
-
return C.useEffect(() => (l.itemMap.set(o, {
|
|
34
|
-
ref: o,
|
|
35
|
-
...a
|
|
36
|
-
}), () => void l.itemMap.delete(o))), /* @__PURE__ */ w(h, {
|
|
37
|
-
[m]: "",
|
|
38
|
-
ref: s,
|
|
39
|
-
children: i
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
g.displayName = p;
|
|
43
|
-
function _(t) {
|
|
44
|
-
let n = c(e + "CollectionConsumer", t);
|
|
45
|
-
return C.useCallback(() => {
|
|
46
|
-
let e = n.collectionRef.current;
|
|
47
|
-
if (!e) return [];
|
|
48
|
-
let t = Array.from(e.querySelectorAll(`[${m}]`));
|
|
49
|
-
return Array.from(n.itemMap.values()).sort((e, n) => t.indexOf(e.ref.current) - t.indexOf(n.ref.current));
|
|
50
|
-
}, [n.collectionRef, n.itemMap]);
|
|
51
|
-
}
|
|
52
|
-
return [
|
|
53
|
-
{
|
|
54
|
-
Provider: l,
|
|
55
|
-
Slot: f,
|
|
56
|
-
ItemSlot: g
|
|
57
|
-
},
|
|
58
|
-
_,
|
|
59
|
-
a
|
|
60
|
-
];
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
64
|
-
var E = S.createContext(void 0);
|
|
65
|
-
function D(e) {
|
|
66
|
-
let t = S.useContext(E);
|
|
67
|
-
return e || t || "ltr";
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.11_@types+react-dom@18.3.7_@types+react@18.3.27__@type_7c6f9bc85f65519fbef65d6b537f1710/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
71
|
-
var O = "rovingFocusGroup.onEntryFocus", ee = {
|
|
72
|
-
bubbles: !1,
|
|
73
|
-
cancelable: !0
|
|
74
|
-
}, k = "RovingFocusGroup", [A, j, M] = T(k), [N, P] = i(k, [M]), [te, F] = N(k), I = S.forwardRef((e, t) => /* @__PURE__ */ w(A.Provider, {
|
|
75
|
-
scope: e.__scopeRovingFocusGroup,
|
|
76
|
-
children: /* @__PURE__ */ w(A.Slot, {
|
|
77
|
-
scope: e.__scopeRovingFocusGroup,
|
|
78
|
-
children: /* @__PURE__ */ w(L, {
|
|
79
|
-
...e,
|
|
80
|
-
ref: t
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
}));
|
|
84
|
-
I.displayName = k;
|
|
85
|
-
var L = S.forwardRef((e, i) => {
|
|
86
|
-
let { __scopeRovingFocusGroup: a, orientation: o, loop: c = !1, dir: u, currentTabStopId: d, defaultCurrentTabStopId: f, onCurrentTabStopIdChange: p, onEntryFocus: m, preventScrollOnEntryFocus: h = !1, ...g } = e, _ = S.useRef(null), v = t(i, _), y = D(u), [b, x] = s({
|
|
87
|
-
prop: d,
|
|
88
|
-
defaultProp: f ?? null,
|
|
89
|
-
onChange: p,
|
|
90
|
-
caller: k
|
|
91
|
-
}), [C, T] = S.useState(!1), E = l(m), A = j(a), M = S.useRef(!1), [N, P] = S.useState(0);
|
|
92
|
-
return S.useEffect(() => {
|
|
93
|
-
let e = _.current;
|
|
94
|
-
if (e) return e.addEventListener(O, E), () => e.removeEventListener(O, E);
|
|
95
|
-
}, [E]), /* @__PURE__ */ w(te, {
|
|
96
|
-
scope: a,
|
|
97
|
-
orientation: o,
|
|
98
|
-
dir: y,
|
|
99
|
-
loop: c,
|
|
100
|
-
currentTabStopId: b,
|
|
101
|
-
onItemFocus: S.useCallback((e) => x(e), [x]),
|
|
102
|
-
onItemShiftTab: S.useCallback(() => T(!0), []),
|
|
103
|
-
onFocusableItemAdd: S.useCallback(() => P((e) => e + 1), []),
|
|
104
|
-
onFocusableItemRemove: S.useCallback(() => P((e) => e - 1), []),
|
|
105
|
-
children: /* @__PURE__ */ w(r.div, {
|
|
106
|
-
tabIndex: C || N === 0 ? -1 : 0,
|
|
107
|
-
"data-orientation": o,
|
|
108
|
-
...g,
|
|
109
|
-
ref: v,
|
|
110
|
-
style: {
|
|
111
|
-
outline: "none",
|
|
112
|
-
...e.style
|
|
113
|
-
},
|
|
114
|
-
onMouseDown: n(e.onMouseDown, () => {
|
|
115
|
-
M.current = !0;
|
|
116
|
-
}),
|
|
117
|
-
onFocus: n(e.onFocus, (e) => {
|
|
118
|
-
let t = !M.current;
|
|
119
|
-
if (e.target === e.currentTarget && t && !C) {
|
|
120
|
-
let t = new CustomEvent(O, ee);
|
|
121
|
-
if (e.currentTarget.dispatchEvent(t), !t.defaultPrevented) {
|
|
122
|
-
let e = A().filter((e) => e.focusable);
|
|
123
|
-
oe([
|
|
124
|
-
e.find((e) => e.active),
|
|
125
|
-
e.find((e) => e.id === b),
|
|
126
|
-
...e
|
|
127
|
-
].filter(Boolean).map((e) => e.ref.current), h);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
M.current = !1;
|
|
131
|
-
}),
|
|
132
|
-
onBlur: n(e.onBlur, () => T(!1))
|
|
133
|
-
})
|
|
134
|
-
});
|
|
135
|
-
}), ne = "RovingFocusGroupItem", re = S.forwardRef((e, t) => {
|
|
136
|
-
let { __scopeRovingFocusGroup: i, focusable: a = !0, active: o = !1, tabStopId: s, children: c, ...l } = e, d = u(), f = s || d, p = F(ne, i), m = p.currentTabStopId === f, h = j(i), { onFocusableItemAdd: g, onFocusableItemRemove: _, currentTabStopId: v } = p;
|
|
137
|
-
return S.useEffect(() => {
|
|
138
|
-
if (a) return g(), () => _();
|
|
139
|
-
}, [
|
|
140
|
-
a,
|
|
141
|
-
g,
|
|
142
|
-
_
|
|
143
|
-
]), /* @__PURE__ */ w(A.ItemSlot, {
|
|
144
|
-
scope: i,
|
|
145
|
-
id: f,
|
|
146
|
-
focusable: a,
|
|
147
|
-
active: o,
|
|
148
|
-
children: /* @__PURE__ */ w(r.span, {
|
|
149
|
-
tabIndex: m ? 0 : -1,
|
|
150
|
-
"data-orientation": p.orientation,
|
|
151
|
-
...l,
|
|
152
|
-
ref: t,
|
|
153
|
-
onMouseDown: n(e.onMouseDown, (e) => {
|
|
154
|
-
a ? p.onItemFocus(f) : e.preventDefault();
|
|
155
|
-
}),
|
|
156
|
-
onFocus: n(e.onFocus, () => p.onItemFocus(f)),
|
|
157
|
-
onKeyDown: n(e.onKeyDown, (e) => {
|
|
158
|
-
if (e.key === "Tab" && e.shiftKey) {
|
|
159
|
-
p.onItemShiftTab();
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (e.target !== e.currentTarget) return;
|
|
163
|
-
let t = ae(e, p.orientation, p.dir);
|
|
164
|
-
if (t !== void 0) {
|
|
165
|
-
if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;
|
|
166
|
-
e.preventDefault();
|
|
167
|
-
let n = h().filter((e) => e.focusable).map((e) => e.ref.current);
|
|
168
|
-
if (t === "last") n.reverse();
|
|
169
|
-
else if (t === "prev" || t === "next") {
|
|
170
|
-
t === "prev" && n.reverse();
|
|
171
|
-
let r = n.indexOf(e.currentTarget);
|
|
172
|
-
n = p.loop ? se(n, r + 1) : n.slice(r + 1);
|
|
173
|
-
}
|
|
174
|
-
setTimeout(() => oe(n));
|
|
175
|
-
}
|
|
176
|
-
}),
|
|
177
|
-
children: typeof c == "function" ? c({
|
|
178
|
-
isCurrentTabStop: m,
|
|
179
|
-
hasTabStop: v != null
|
|
180
|
-
}) : c
|
|
181
|
-
})
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
re.displayName = ne;
|
|
185
|
-
var ie = {
|
|
186
|
-
ArrowLeft: "prev",
|
|
187
|
-
ArrowUp: "prev",
|
|
188
|
-
ArrowRight: "next",
|
|
189
|
-
ArrowDown: "next",
|
|
190
|
-
PageUp: "first",
|
|
191
|
-
Home: "first",
|
|
192
|
-
PageDown: "last",
|
|
193
|
-
End: "last"
|
|
194
|
-
};
|
|
195
|
-
function R(e, t) {
|
|
196
|
-
return t === "rtl" ? e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e : e;
|
|
197
|
-
}
|
|
198
|
-
function ae(e, t, n) {
|
|
199
|
-
let r = R(e.key, n);
|
|
200
|
-
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r))) return ie[r];
|
|
201
|
-
}
|
|
202
|
-
function oe(e, t = !1) {
|
|
203
|
-
let n = document.activeElement;
|
|
204
|
-
for (let r of e) if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
205
|
-
}
|
|
206
|
-
function se(e, t) {
|
|
207
|
-
return e.map((n, r) => e[(t + r) % e.length]);
|
|
208
|
-
}
|
|
209
|
-
var ce = I, le = re, z = ["Enter", " "], ue = [
|
|
210
|
-
"ArrowDown",
|
|
211
|
-
"PageUp",
|
|
212
|
-
"Home"
|
|
213
|
-
], de = [
|
|
214
|
-
"ArrowUp",
|
|
215
|
-
"PageDown",
|
|
216
|
-
"End"
|
|
217
|
-
], fe = [...ue, ...de], pe = {
|
|
218
|
-
ltr: [...z, "ArrowRight"],
|
|
219
|
-
rtl: [...z, "ArrowLeft"]
|
|
220
|
-
}, me = {
|
|
221
|
-
ltr: ["ArrowLeft"],
|
|
222
|
-
rtl: ["ArrowRight"]
|
|
223
|
-
}, B = "Menu", [V, he, ge] = T(B), [H, _e] = i(B, [
|
|
224
|
-
ge,
|
|
225
|
-
p,
|
|
226
|
-
P
|
|
227
|
-
]), U = p(), ve = P(), [ye, W] = H(B), [be, G] = H(B), xe = (e) => {
|
|
228
|
-
let { __scopeMenu: t, open: n = !1, children: r, dir: i, onOpenChange: a, modal: o = !0 } = e, s = U(t), [c, u] = S.useState(null), d = S.useRef(!1), f = l(a), p = D(i);
|
|
229
|
-
return S.useEffect(() => {
|
|
230
|
-
let e = () => {
|
|
231
|
-
d.current = !0, document.addEventListener("pointerdown", t, {
|
|
232
|
-
capture: !0,
|
|
233
|
-
once: !0
|
|
234
|
-
}), document.addEventListener("pointermove", t, {
|
|
235
|
-
capture: !0,
|
|
236
|
-
once: !0
|
|
237
|
-
});
|
|
238
|
-
}, t = () => d.current = !1;
|
|
239
|
-
return document.addEventListener("keydown", e, { capture: !0 }), () => {
|
|
240
|
-
document.removeEventListener("keydown", e, { capture: !0 }), document.removeEventListener("pointerdown", t, { capture: !0 }), document.removeEventListener("pointermove", t, { capture: !0 });
|
|
241
|
-
};
|
|
242
|
-
}, []), /* @__PURE__ */ w(m, {
|
|
243
|
-
...s,
|
|
244
|
-
children: /* @__PURE__ */ w(ye, {
|
|
245
|
-
scope: t,
|
|
246
|
-
open: n,
|
|
247
|
-
onOpenChange: f,
|
|
248
|
-
content: c,
|
|
249
|
-
onContentChange: u,
|
|
250
|
-
children: /* @__PURE__ */ w(be, {
|
|
251
|
-
scope: t,
|
|
252
|
-
onClose: S.useCallback(() => f(!1), [f]),
|
|
253
|
-
isUsingKeyboardRef: d,
|
|
254
|
-
dir: p,
|
|
255
|
-
modal: o,
|
|
256
|
-
children: r
|
|
257
|
-
})
|
|
258
|
-
})
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
xe.displayName = B;
|
|
262
|
-
var Se = "MenuAnchor", Ce = S.forwardRef((e, t) => {
|
|
263
|
-
let { __scopeMenu: n, ...r } = e;
|
|
264
|
-
return /* @__PURE__ */ w(_, {
|
|
265
|
-
...U(n),
|
|
266
|
-
...r,
|
|
267
|
-
ref: t
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
Ce.displayName = Se;
|
|
271
|
-
var we = "MenuPortal", [Te, Ee] = H(we, { forceMount: void 0 }), De = (e) => {
|
|
272
|
-
let { __scopeMenu: t, forceMount: n, children: r, container: i } = e, o = W(we, t);
|
|
273
|
-
return /* @__PURE__ */ w(Te, {
|
|
274
|
-
scope: t,
|
|
275
|
-
forceMount: n,
|
|
276
|
-
children: /* @__PURE__ */ w(a, {
|
|
277
|
-
present: n || o.open,
|
|
278
|
-
children: /* @__PURE__ */ w(f, {
|
|
279
|
-
asChild: !0,
|
|
280
|
-
container: i,
|
|
281
|
-
children: r
|
|
282
|
-
})
|
|
283
|
-
})
|
|
284
|
-
});
|
|
285
|
-
};
|
|
286
|
-
De.displayName = we;
|
|
287
|
-
var K = "MenuContent", [Oe, ke] = H(K), Ae = S.forwardRef((e, t) => {
|
|
288
|
-
let n = Ee(K, e.__scopeMenu), { forceMount: r = n.forceMount, ...i } = e, o = W(K, e.__scopeMenu), s = G(K, e.__scopeMenu);
|
|
289
|
-
return /* @__PURE__ */ w(V.Provider, {
|
|
290
|
-
scope: e.__scopeMenu,
|
|
291
|
-
children: /* @__PURE__ */ w(a, {
|
|
292
|
-
present: r || o.open,
|
|
293
|
-
children: /* @__PURE__ */ w(V.Slot, {
|
|
294
|
-
scope: e.__scopeMenu,
|
|
295
|
-
children: s.modal ? /* @__PURE__ */ w(je, {
|
|
296
|
-
...i,
|
|
297
|
-
ref: t
|
|
298
|
-
}) : /* @__PURE__ */ w(Me, {
|
|
299
|
-
...i,
|
|
300
|
-
ref: t
|
|
301
|
-
})
|
|
302
|
-
})
|
|
303
|
-
})
|
|
304
|
-
});
|
|
305
|
-
}), je = S.forwardRef((e, r) => {
|
|
306
|
-
let i = W(K, e.__scopeMenu), a = S.useRef(null), o = t(r, a);
|
|
307
|
-
return S.useEffect(() => {
|
|
308
|
-
let e = a.current;
|
|
309
|
-
if (e) return y(e);
|
|
310
|
-
}, []), /* @__PURE__ */ w(Pe, {
|
|
311
|
-
...e,
|
|
312
|
-
ref: o,
|
|
313
|
-
trapFocus: i.open,
|
|
314
|
-
disableOutsidePointerEvents: i.open,
|
|
315
|
-
disableOutsideScroll: !0,
|
|
316
|
-
onFocusOutside: n(e.onFocusOutside, (e) => e.preventDefault(), { checkForDefaultPrevented: !1 }),
|
|
317
|
-
onDismiss: () => i.onOpenChange(!1)
|
|
318
|
-
});
|
|
319
|
-
}), Me = S.forwardRef((e, t) => {
|
|
320
|
-
let n = W(K, e.__scopeMenu);
|
|
321
|
-
return /* @__PURE__ */ w(Pe, {
|
|
322
|
-
...e,
|
|
323
|
-
ref: t,
|
|
324
|
-
trapFocus: !1,
|
|
325
|
-
disableOutsidePointerEvents: !1,
|
|
326
|
-
disableOutsideScroll: !1,
|
|
327
|
-
onDismiss: () => n.onOpenChange(!1)
|
|
328
|
-
});
|
|
329
|
-
}), Ne = o("MenuContent.ScrollLock"), Pe = S.forwardRef((e, r) => {
|
|
330
|
-
let { __scopeMenu: i, loop: a = !1, trapFocus: o, onOpenAutoFocus: s, onCloseAutoFocus: c, disableOutsidePointerEvents: l, onEntryFocus: u, onEscapeKeyDown: f, onPointerDownOutside: p, onFocusOutside: m, onInteractOutside: h, onDismiss: _, disableOutsideScroll: y, ...C } = e, T = W(K, i), E = G(K, i), D = U(i), O = ve(i), ee = he(i), [k, A] = S.useState(null), j = S.useRef(null), M = t(r, j, T.onContentChange), N = S.useRef(0), P = S.useRef(""), te = S.useRef(0), F = S.useRef(null), I = S.useRef("right"), L = S.useRef(0), ne = y ? x : S.Fragment, re = y ? {
|
|
331
|
-
as: Ne,
|
|
332
|
-
allowPinchZoom: !0
|
|
333
|
-
} : void 0, ie = (e) => {
|
|
334
|
-
let t = P.current + e, n = ee().filter((e) => !e.disabled), r = document.activeElement, i = n.find((e) => e.ref.current === r)?.textValue, a = mt(n.map((e) => e.textValue), t, i), o = n.find((e) => e.textValue === a)?.ref.current;
|
|
335
|
-
(function e(t) {
|
|
336
|
-
P.current = t, window.clearTimeout(N.current), t !== "" && (N.current = window.setTimeout(() => e(""), 1e3));
|
|
337
|
-
})(t), o && setTimeout(() => o.focus());
|
|
338
|
-
};
|
|
339
|
-
S.useEffect(() => () => window.clearTimeout(N.current), []), v();
|
|
340
|
-
let R = S.useCallback((e) => I.current === F.current?.side && gt(e, F.current?.area), []);
|
|
341
|
-
return /* @__PURE__ */ w(Oe, {
|
|
342
|
-
scope: i,
|
|
343
|
-
searchRef: P,
|
|
344
|
-
onItemEnter: S.useCallback((e) => {
|
|
345
|
-
R(e) && e.preventDefault();
|
|
346
|
-
}, [R]),
|
|
347
|
-
onItemLeave: S.useCallback((e) => {
|
|
348
|
-
R(e) || (j.current?.focus(), A(null));
|
|
349
|
-
}, [R]),
|
|
350
|
-
onTriggerLeave: S.useCallback((e) => {
|
|
351
|
-
R(e) && e.preventDefault();
|
|
352
|
-
}, [R]),
|
|
353
|
-
pointerGraceTimerRef: te,
|
|
354
|
-
onPointerGraceIntentChange: S.useCallback((e) => {
|
|
355
|
-
F.current = e;
|
|
356
|
-
}, []),
|
|
357
|
-
children: /* @__PURE__ */ w(ne, {
|
|
358
|
-
...re,
|
|
359
|
-
children: /* @__PURE__ */ w(b, {
|
|
360
|
-
asChild: !0,
|
|
361
|
-
trapped: o,
|
|
362
|
-
onMountAutoFocus: n(s, (e) => {
|
|
363
|
-
e.preventDefault(), j.current?.focus({ preventScroll: !0 });
|
|
364
|
-
}),
|
|
365
|
-
onUnmountAutoFocus: c,
|
|
366
|
-
children: /* @__PURE__ */ w(d, {
|
|
367
|
-
asChild: !0,
|
|
368
|
-
disableOutsidePointerEvents: l,
|
|
369
|
-
onEscapeKeyDown: f,
|
|
370
|
-
onPointerDownOutside: p,
|
|
371
|
-
onFocusOutside: m,
|
|
372
|
-
onInteractOutside: h,
|
|
373
|
-
onDismiss: _,
|
|
374
|
-
children: /* @__PURE__ */ w(ce, {
|
|
375
|
-
asChild: !0,
|
|
376
|
-
...O,
|
|
377
|
-
dir: E.dir,
|
|
378
|
-
orientation: "vertical",
|
|
379
|
-
loop: a,
|
|
380
|
-
currentTabStopId: k,
|
|
381
|
-
onCurrentTabStopIdChange: A,
|
|
382
|
-
onEntryFocus: n(u, (e) => {
|
|
383
|
-
E.isUsingKeyboardRef.current || e.preventDefault();
|
|
384
|
-
}),
|
|
385
|
-
preventScrollOnEntryFocus: !0,
|
|
386
|
-
children: /* @__PURE__ */ w(g, {
|
|
387
|
-
role: "menu",
|
|
388
|
-
"aria-orientation": "vertical",
|
|
389
|
-
"data-state": ut(T.open),
|
|
390
|
-
"data-radix-menu-content": "",
|
|
391
|
-
dir: E.dir,
|
|
392
|
-
...D,
|
|
393
|
-
...C,
|
|
394
|
-
ref: M,
|
|
395
|
-
style: {
|
|
396
|
-
outline: "none",
|
|
397
|
-
...C.style
|
|
398
|
-
},
|
|
399
|
-
onKeyDown: n(C.onKeyDown, (e) => {
|
|
400
|
-
let t = e.target.closest("[data-radix-menu-content]") === e.currentTarget, n = e.ctrlKey || e.altKey || e.metaKey, r = e.key.length === 1;
|
|
401
|
-
t && (e.key === "Tab" && e.preventDefault(), !n && r && ie(e.key));
|
|
402
|
-
let i = j.current;
|
|
403
|
-
if (e.target !== i || !fe.includes(e.key)) return;
|
|
404
|
-
e.preventDefault();
|
|
405
|
-
let a = ee().filter((e) => !e.disabled).map((e) => e.ref.current);
|
|
406
|
-
de.includes(e.key) && a.reverse(), ft(a);
|
|
407
|
-
}),
|
|
408
|
-
onBlur: n(e.onBlur, (e) => {
|
|
409
|
-
e.currentTarget.contains(e.target) || (window.clearTimeout(N.current), P.current = "");
|
|
410
|
-
}),
|
|
411
|
-
onPointerMove: n(e.onPointerMove, Z((e) => {
|
|
412
|
-
let t = e.target, n = L.current !== e.clientX;
|
|
413
|
-
e.currentTarget.contains(t) && n && (I.current = e.clientX > L.current ? "right" : "left", L.current = e.clientX);
|
|
414
|
-
}))
|
|
415
|
-
})
|
|
416
|
-
})
|
|
417
|
-
})
|
|
418
|
-
})
|
|
419
|
-
})
|
|
420
|
-
});
|
|
421
|
-
});
|
|
422
|
-
Ae.displayName = K;
|
|
423
|
-
var Fe = "MenuGroup", Ie = S.forwardRef((e, t) => {
|
|
424
|
-
let { __scopeMenu: n, ...i } = e;
|
|
425
|
-
return /* @__PURE__ */ w(r.div, {
|
|
426
|
-
role: "group",
|
|
427
|
-
...i,
|
|
428
|
-
ref: t
|
|
429
|
-
});
|
|
430
|
-
});
|
|
431
|
-
Ie.displayName = Fe;
|
|
432
|
-
var Le = "MenuLabel", Re = S.forwardRef((e, t) => {
|
|
433
|
-
let { __scopeMenu: n, ...i } = e;
|
|
434
|
-
return /* @__PURE__ */ w(r.div, {
|
|
435
|
-
...i,
|
|
436
|
-
ref: t
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
Re.displayName = Le;
|
|
440
|
-
var q = "MenuItem", ze = "menu.itemSelect", J = S.forwardRef((r, i) => {
|
|
441
|
-
let { disabled: a = !1, onSelect: o, ...s } = r, c = S.useRef(null), l = G(q, r.__scopeMenu), u = ke(q, r.__scopeMenu), d = t(i, c), f = S.useRef(!1), p = () => {
|
|
442
|
-
let t = c.current;
|
|
443
|
-
if (!a && t) {
|
|
444
|
-
let n = new CustomEvent(ze, {
|
|
445
|
-
bubbles: !0,
|
|
446
|
-
cancelable: !0
|
|
447
|
-
});
|
|
448
|
-
t.addEventListener(ze, (e) => o?.(e), { once: !0 }), e(t, n), n.defaultPrevented ? f.current = !1 : l.onClose();
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
return /* @__PURE__ */ w(Be, {
|
|
452
|
-
...s,
|
|
453
|
-
ref: d,
|
|
454
|
-
disabled: a,
|
|
455
|
-
onClick: n(r.onClick, p),
|
|
456
|
-
onPointerDown: (e) => {
|
|
457
|
-
r.onPointerDown?.(e), f.current = !0;
|
|
458
|
-
},
|
|
459
|
-
onPointerUp: n(r.onPointerUp, (e) => {
|
|
460
|
-
f.current || e.currentTarget?.click();
|
|
461
|
-
}),
|
|
462
|
-
onKeyDown: n(r.onKeyDown, (e) => {
|
|
463
|
-
let t = u.searchRef.current !== "";
|
|
464
|
-
a || t && e.key === " " || z.includes(e.key) && (e.currentTarget.click(), e.preventDefault());
|
|
465
|
-
})
|
|
466
|
-
});
|
|
467
|
-
});
|
|
468
|
-
J.displayName = q;
|
|
469
|
-
var Be = S.forwardRef((e, i) => {
|
|
470
|
-
let { __scopeMenu: a, disabled: o = !1, textValue: s, ...c } = e, l = ke(q, a), u = ve(a), d = S.useRef(null), f = t(i, d), [p, m] = S.useState(!1), [h, g] = S.useState("");
|
|
471
|
-
return S.useEffect(() => {
|
|
472
|
-
let e = d.current;
|
|
473
|
-
e && g((e.textContent ?? "").trim());
|
|
474
|
-
}, [c.children]), /* @__PURE__ */ w(V.ItemSlot, {
|
|
475
|
-
scope: a,
|
|
476
|
-
disabled: o,
|
|
477
|
-
textValue: s ?? h,
|
|
478
|
-
children: /* @__PURE__ */ w(le, {
|
|
479
|
-
asChild: !0,
|
|
480
|
-
...u,
|
|
481
|
-
focusable: !o,
|
|
482
|
-
children: /* @__PURE__ */ w(r.div, {
|
|
483
|
-
role: "menuitem",
|
|
484
|
-
"data-highlighted": p ? "" : void 0,
|
|
485
|
-
"aria-disabled": o || void 0,
|
|
486
|
-
"data-disabled": o ? "" : void 0,
|
|
487
|
-
...c,
|
|
488
|
-
ref: f,
|
|
489
|
-
onPointerMove: n(e.onPointerMove, Z((e) => {
|
|
490
|
-
o ? l.onItemLeave(e) : (l.onItemEnter(e), e.defaultPrevented || e.currentTarget.focus({ preventScroll: !0 }));
|
|
491
|
-
})),
|
|
492
|
-
onPointerLeave: n(e.onPointerLeave, Z((e) => l.onItemLeave(e))),
|
|
493
|
-
onFocus: n(e.onFocus, () => m(!0)),
|
|
494
|
-
onBlur: n(e.onBlur, () => m(!1))
|
|
495
|
-
})
|
|
496
|
-
})
|
|
497
|
-
});
|
|
498
|
-
}), Ve = "MenuCheckboxItem", He = S.forwardRef((e, t) => {
|
|
499
|
-
let { checked: r = !1, onCheckedChange: i, ...a } = e;
|
|
500
|
-
return /* @__PURE__ */ w(Xe, {
|
|
501
|
-
scope: e.__scopeMenu,
|
|
502
|
-
checked: r,
|
|
503
|
-
children: /* @__PURE__ */ w(J, {
|
|
504
|
-
role: "menuitemcheckbox",
|
|
505
|
-
"aria-checked": X(r) ? "mixed" : r,
|
|
506
|
-
...a,
|
|
507
|
-
ref: t,
|
|
508
|
-
"data-state": dt(r),
|
|
509
|
-
onSelect: n(a.onSelect, () => i?.(X(r) ? !0 : !r), { checkForDefaultPrevented: !1 })
|
|
510
|
-
})
|
|
511
|
-
});
|
|
512
|
-
});
|
|
513
|
-
He.displayName = Ve;
|
|
514
|
-
var Ue = "MenuRadioGroup", [We, Ge] = H(Ue, {
|
|
515
|
-
value: void 0,
|
|
516
|
-
onValueChange: () => {}
|
|
517
|
-
}), Ke = S.forwardRef((e, t) => {
|
|
518
|
-
let { value: n, onValueChange: r, ...i } = e, a = l(r);
|
|
519
|
-
return /* @__PURE__ */ w(We, {
|
|
520
|
-
scope: e.__scopeMenu,
|
|
521
|
-
value: n,
|
|
522
|
-
onValueChange: a,
|
|
523
|
-
children: /* @__PURE__ */ w(Ie, {
|
|
524
|
-
...i,
|
|
525
|
-
ref: t
|
|
526
|
-
})
|
|
527
|
-
});
|
|
528
|
-
});
|
|
529
|
-
Ke.displayName = Ue;
|
|
530
|
-
var qe = "MenuRadioItem", Je = S.forwardRef((e, t) => {
|
|
531
|
-
let { value: r, ...i } = e, a = Ge(qe, e.__scopeMenu), o = r === a.value;
|
|
532
|
-
return /* @__PURE__ */ w(Xe, {
|
|
533
|
-
scope: e.__scopeMenu,
|
|
534
|
-
checked: o,
|
|
535
|
-
children: /* @__PURE__ */ w(J, {
|
|
536
|
-
role: "menuitemradio",
|
|
537
|
-
"aria-checked": o,
|
|
538
|
-
...i,
|
|
539
|
-
ref: t,
|
|
540
|
-
"data-state": dt(o),
|
|
541
|
-
onSelect: n(i.onSelect, () => a.onValueChange?.(r), { checkForDefaultPrevented: !1 })
|
|
542
|
-
})
|
|
543
|
-
});
|
|
544
|
-
});
|
|
545
|
-
Je.displayName = qe;
|
|
546
|
-
var Ye = "MenuItemIndicator", [Xe, Ze] = H(Ye, { checked: !1 }), Qe = S.forwardRef((e, t) => {
|
|
547
|
-
let { __scopeMenu: n, forceMount: i, ...o } = e, s = Ze(Ye, n);
|
|
548
|
-
return /* @__PURE__ */ w(a, {
|
|
549
|
-
present: i || X(s.checked) || s.checked === !0,
|
|
550
|
-
children: /* @__PURE__ */ w(r.span, {
|
|
551
|
-
...o,
|
|
552
|
-
ref: t,
|
|
553
|
-
"data-state": dt(s.checked)
|
|
554
|
-
})
|
|
555
|
-
});
|
|
556
|
-
});
|
|
557
|
-
Qe.displayName = Ye;
|
|
558
|
-
var $e = "MenuSeparator", et = S.forwardRef((e, t) => {
|
|
559
|
-
let { __scopeMenu: n, ...i } = e;
|
|
560
|
-
return /* @__PURE__ */ w(r.div, {
|
|
561
|
-
role: "separator",
|
|
562
|
-
"aria-orientation": "horizontal",
|
|
563
|
-
...i,
|
|
564
|
-
ref: t
|
|
565
|
-
});
|
|
566
|
-
});
|
|
567
|
-
et.displayName = $e;
|
|
568
|
-
var tt = "MenuArrow", nt = S.forwardRef((e, t) => {
|
|
569
|
-
let { __scopeMenu: n, ...r } = e;
|
|
570
|
-
return /* @__PURE__ */ w(h, {
|
|
571
|
-
...U(n),
|
|
572
|
-
...r,
|
|
573
|
-
ref: t
|
|
574
|
-
});
|
|
575
|
-
});
|
|
576
|
-
nt.displayName = tt;
|
|
577
|
-
var rt = "MenuSub", [it, at] = H(rt), ot = (e) => {
|
|
578
|
-
let { __scopeMenu: t, children: n, open: r = !1, onOpenChange: i } = e, a = W(rt, t), o = U(t), [s, c] = S.useState(null), [d, f] = S.useState(null), p = l(i);
|
|
579
|
-
return S.useEffect(() => (a.open === !1 && p(!1), () => p(!1)), [a.open, p]), /* @__PURE__ */ w(m, {
|
|
580
|
-
...o,
|
|
581
|
-
children: /* @__PURE__ */ w(ye, {
|
|
582
|
-
scope: t,
|
|
583
|
-
open: r,
|
|
584
|
-
onOpenChange: p,
|
|
585
|
-
content: d,
|
|
586
|
-
onContentChange: f,
|
|
587
|
-
children: /* @__PURE__ */ w(it, {
|
|
588
|
-
scope: t,
|
|
589
|
-
contentId: u(),
|
|
590
|
-
triggerId: u(),
|
|
591
|
-
trigger: s,
|
|
592
|
-
onTriggerChange: c,
|
|
593
|
-
children: n
|
|
594
|
-
})
|
|
595
|
-
})
|
|
596
|
-
});
|
|
597
|
-
};
|
|
598
|
-
ot.displayName = rt;
|
|
599
|
-
var Y = "MenuSubTrigger", st = S.forwardRef((e, t) => {
|
|
600
|
-
let r = W(Y, e.__scopeMenu), i = G(Y, e.__scopeMenu), a = at(Y, e.__scopeMenu), o = ke(Y, e.__scopeMenu), s = S.useRef(null), { pointerGraceTimerRef: l, onPointerGraceIntentChange: u } = o, d = { __scopeMenu: e.__scopeMenu }, f = S.useCallback(() => {
|
|
601
|
-
s.current && window.clearTimeout(s.current), s.current = null;
|
|
602
|
-
}, []);
|
|
603
|
-
return S.useEffect(() => f, [f]), S.useEffect(() => {
|
|
604
|
-
let e = l.current;
|
|
605
|
-
return () => {
|
|
606
|
-
window.clearTimeout(e), u(null);
|
|
607
|
-
};
|
|
608
|
-
}, [l, u]), /* @__PURE__ */ w(Ce, {
|
|
609
|
-
asChild: !0,
|
|
610
|
-
...d,
|
|
611
|
-
children: /* @__PURE__ */ w(Be, {
|
|
612
|
-
id: a.triggerId,
|
|
613
|
-
"aria-haspopup": "menu",
|
|
614
|
-
"aria-expanded": r.open,
|
|
615
|
-
"aria-controls": a.contentId,
|
|
616
|
-
"data-state": ut(r.open),
|
|
617
|
-
...e,
|
|
618
|
-
ref: c(t, a.onTriggerChange),
|
|
619
|
-
onClick: (t) => {
|
|
620
|
-
e.onClick?.(t), !(e.disabled || t.defaultPrevented) && (t.currentTarget.focus(), r.open || r.onOpenChange(!0));
|
|
621
|
-
},
|
|
622
|
-
onPointerMove: n(e.onPointerMove, Z((t) => {
|
|
623
|
-
o.onItemEnter(t), !t.defaultPrevented && !e.disabled && !r.open && !s.current && (o.onPointerGraceIntentChange(null), s.current = window.setTimeout(() => {
|
|
624
|
-
r.onOpenChange(!0), f();
|
|
625
|
-
}, 100));
|
|
626
|
-
})),
|
|
627
|
-
onPointerLeave: n(e.onPointerLeave, Z((e) => {
|
|
628
|
-
f();
|
|
629
|
-
let t = r.content?.getBoundingClientRect();
|
|
630
|
-
if (t) {
|
|
631
|
-
let n = r.content?.dataset.side, i = n === "right", a = i ? -5 : 5, s = t[i ? "left" : "right"], c = t[i ? "right" : "left"];
|
|
632
|
-
o.onPointerGraceIntentChange({
|
|
633
|
-
area: [
|
|
634
|
-
{
|
|
635
|
-
x: e.clientX + a,
|
|
636
|
-
y: e.clientY
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
x: s,
|
|
640
|
-
y: t.top
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
x: c,
|
|
644
|
-
y: t.top
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
x: c,
|
|
648
|
-
y: t.bottom
|
|
649
|
-
},
|
|
650
|
-
{
|
|
651
|
-
x: s,
|
|
652
|
-
y: t.bottom
|
|
653
|
-
}
|
|
654
|
-
],
|
|
655
|
-
side: n
|
|
656
|
-
}), window.clearTimeout(l.current), l.current = window.setTimeout(() => o.onPointerGraceIntentChange(null), 300);
|
|
657
|
-
} else {
|
|
658
|
-
if (o.onTriggerLeave(e), e.defaultPrevented) return;
|
|
659
|
-
o.onPointerGraceIntentChange(null);
|
|
660
|
-
}
|
|
661
|
-
})),
|
|
662
|
-
onKeyDown: n(e.onKeyDown, (t) => {
|
|
663
|
-
let n = o.searchRef.current !== "";
|
|
664
|
-
e.disabled || n && t.key === " " || pe[i.dir].includes(t.key) && (r.onOpenChange(!0), r.content?.focus(), t.preventDefault());
|
|
665
|
-
})
|
|
666
|
-
})
|
|
667
|
-
});
|
|
668
|
-
});
|
|
669
|
-
st.displayName = Y;
|
|
670
|
-
var ct = "MenuSubContent", lt = S.forwardRef((e, r) => {
|
|
671
|
-
let i = Ee(K, e.__scopeMenu), { forceMount: o = i.forceMount, ...s } = e, c = W(K, e.__scopeMenu), l = G(K, e.__scopeMenu), u = at(ct, e.__scopeMenu), d = S.useRef(null), f = t(r, d);
|
|
672
|
-
return /* @__PURE__ */ w(V.Provider, {
|
|
673
|
-
scope: e.__scopeMenu,
|
|
674
|
-
children: /* @__PURE__ */ w(a, {
|
|
675
|
-
present: o || c.open,
|
|
676
|
-
children: /* @__PURE__ */ w(V.Slot, {
|
|
677
|
-
scope: e.__scopeMenu,
|
|
678
|
-
children: /* @__PURE__ */ w(Pe, {
|
|
679
|
-
id: u.contentId,
|
|
680
|
-
"aria-labelledby": u.triggerId,
|
|
681
|
-
...s,
|
|
682
|
-
ref: f,
|
|
683
|
-
align: "start",
|
|
684
|
-
side: l.dir === "rtl" ? "left" : "right",
|
|
685
|
-
disableOutsidePointerEvents: !1,
|
|
686
|
-
disableOutsideScroll: !1,
|
|
687
|
-
trapFocus: !1,
|
|
688
|
-
onOpenAutoFocus: (e) => {
|
|
689
|
-
l.isUsingKeyboardRef.current && d.current?.focus(), e.preventDefault();
|
|
690
|
-
},
|
|
691
|
-
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
692
|
-
onFocusOutside: n(e.onFocusOutside, (e) => {
|
|
693
|
-
e.target !== u.trigger && c.onOpenChange(!1);
|
|
694
|
-
}),
|
|
695
|
-
onEscapeKeyDown: n(e.onEscapeKeyDown, (e) => {
|
|
696
|
-
l.onClose(), e.preventDefault();
|
|
697
|
-
}),
|
|
698
|
-
onKeyDown: n(e.onKeyDown, (e) => {
|
|
699
|
-
let t = e.currentTarget.contains(e.target), n = me[l.dir].includes(e.key);
|
|
700
|
-
t && n && (c.onOpenChange(!1), u.trigger?.focus(), e.preventDefault());
|
|
701
|
-
})
|
|
702
|
-
})
|
|
703
|
-
})
|
|
704
|
-
})
|
|
705
|
-
});
|
|
706
|
-
});
|
|
707
|
-
lt.displayName = ct;
|
|
708
|
-
function ut(e) {
|
|
709
|
-
return e ? "open" : "closed";
|
|
710
|
-
}
|
|
711
|
-
function X(e) {
|
|
712
|
-
return e === "indeterminate";
|
|
713
|
-
}
|
|
714
|
-
function dt(e) {
|
|
715
|
-
return X(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
716
|
-
}
|
|
717
|
-
function ft(e) {
|
|
718
|
-
let t = document.activeElement;
|
|
719
|
-
for (let n of e) if (n === t || (n.focus(), document.activeElement !== t)) return;
|
|
720
|
-
}
|
|
721
|
-
function pt(e, t) {
|
|
722
|
-
return e.map((n, r) => e[(t + r) % e.length]);
|
|
723
|
-
}
|
|
724
|
-
function mt(e, t, n) {
|
|
725
|
-
let r = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1, a = pt(e, Math.max(i, 0));
|
|
726
|
-
r.length === 1 && (a = a.filter((e) => e !== n));
|
|
727
|
-
let o = a.find((e) => e.toLowerCase().startsWith(r.toLowerCase()));
|
|
728
|
-
return o === n ? void 0 : o;
|
|
729
|
-
}
|
|
730
|
-
function ht(e, t) {
|
|
731
|
-
let { x: n, y: r } = e, i = !1;
|
|
732
|
-
for (let e = 0, a = t.length - 1; e < t.length; a = e++) {
|
|
733
|
-
let o = t[e], s = t[a], c = o.x, l = o.y, u = s.x, d = s.y;
|
|
734
|
-
l > r != d > r && n < (u - c) * (r - l) / (d - l) + c && (i = !i);
|
|
735
|
-
}
|
|
736
|
-
return i;
|
|
737
|
-
}
|
|
738
|
-
function gt(e, t) {
|
|
739
|
-
return t ? ht({
|
|
740
|
-
x: e.clientX,
|
|
741
|
-
y: e.clientY
|
|
742
|
-
}, t) : !1;
|
|
743
|
-
}
|
|
744
|
-
function Z(e) {
|
|
745
|
-
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
746
|
-
}
|
|
747
|
-
var _t = xe, vt = Ce, yt = De, bt = Ae, xt = Ie, St = Re, Ct = J, wt = He, Tt = Ke, Et = Je, Dt = Qe, Ot = et, kt = nt, At = st, jt = lt, Q = "DropdownMenu", [Mt, Nt] = i(Q, [_e]), $ = _e(), [Pt, Ft] = Mt(Q), It = (e) => {
|
|
748
|
-
let { __scopeDropdownMenu: t, children: n, dir: r, open: i, defaultOpen: a, onOpenChange: o, modal: c = !0 } = e, l = $(t), d = S.useRef(null), [f, p] = s({
|
|
749
|
-
prop: i,
|
|
750
|
-
defaultProp: a ?? !1,
|
|
751
|
-
onChange: o,
|
|
752
|
-
caller: Q
|
|
753
|
-
});
|
|
754
|
-
return /* @__PURE__ */ w(Pt, {
|
|
755
|
-
scope: t,
|
|
756
|
-
triggerId: u(),
|
|
757
|
-
triggerRef: d,
|
|
758
|
-
contentId: u(),
|
|
759
|
-
open: f,
|
|
760
|
-
onOpenChange: p,
|
|
761
|
-
onOpenToggle: S.useCallback(() => p((e) => !e), [p]),
|
|
762
|
-
modal: c,
|
|
763
|
-
children: /* @__PURE__ */ w(_t, {
|
|
764
|
-
...l,
|
|
765
|
-
open: f,
|
|
766
|
-
onOpenChange: p,
|
|
767
|
-
dir: r,
|
|
768
|
-
modal: c,
|
|
769
|
-
children: n
|
|
770
|
-
})
|
|
771
|
-
});
|
|
772
|
-
};
|
|
773
|
-
It.displayName = Q;
|
|
774
|
-
var Lt = "DropdownMenuTrigger", Rt = S.forwardRef((e, t) => {
|
|
775
|
-
let { __scopeDropdownMenu: i, disabled: a = !1, ...o } = e, s = Ft(Lt, i);
|
|
776
|
-
return /* @__PURE__ */ w(vt, {
|
|
777
|
-
asChild: !0,
|
|
778
|
-
...$(i),
|
|
779
|
-
children: /* @__PURE__ */ w(r.button, {
|
|
780
|
-
type: "button",
|
|
781
|
-
id: s.triggerId,
|
|
782
|
-
"aria-haspopup": "menu",
|
|
783
|
-
"aria-expanded": s.open,
|
|
784
|
-
"aria-controls": s.open ? s.contentId : void 0,
|
|
785
|
-
"data-state": s.open ? "open" : "closed",
|
|
786
|
-
"data-disabled": a ? "" : void 0,
|
|
787
|
-
disabled: a,
|
|
788
|
-
...o,
|
|
789
|
-
ref: c(t, s.triggerRef),
|
|
790
|
-
onPointerDown: n(e.onPointerDown, (e) => {
|
|
791
|
-
!a && e.button === 0 && e.ctrlKey === !1 && (s.onOpenToggle(), s.open || e.preventDefault());
|
|
792
|
-
}),
|
|
793
|
-
onKeyDown: n(e.onKeyDown, (e) => {
|
|
794
|
-
a || (["Enter", " "].includes(e.key) && s.onOpenToggle(), e.key === "ArrowDown" && s.onOpenChange(!0), [
|
|
795
|
-
"Enter",
|
|
796
|
-
" ",
|
|
797
|
-
"ArrowDown"
|
|
798
|
-
].includes(e.key) && e.preventDefault());
|
|
799
|
-
})
|
|
800
|
-
})
|
|
801
|
-
});
|
|
802
|
-
});
|
|
803
|
-
Rt.displayName = Lt;
|
|
804
|
-
var zt = "DropdownMenuPortal", Bt = (e) => {
|
|
805
|
-
let { __scopeDropdownMenu: t, ...n } = e;
|
|
806
|
-
return /* @__PURE__ */ w(yt, {
|
|
807
|
-
...$(t),
|
|
808
|
-
...n
|
|
809
|
-
});
|
|
810
|
-
};
|
|
811
|
-
Bt.displayName = zt;
|
|
812
|
-
var Vt = "DropdownMenuContent", Ht = S.forwardRef((e, t) => {
|
|
813
|
-
let { __scopeDropdownMenu: r, ...i } = e, a = Ft(Vt, r), o = $(r), s = S.useRef(!1);
|
|
814
|
-
return /* @__PURE__ */ w(bt, {
|
|
815
|
-
id: a.contentId,
|
|
816
|
-
"aria-labelledby": a.triggerId,
|
|
817
|
-
...o,
|
|
818
|
-
...i,
|
|
819
|
-
ref: t,
|
|
820
|
-
onCloseAutoFocus: n(e.onCloseAutoFocus, (e) => {
|
|
821
|
-
s.current || a.triggerRef.current?.focus(), s.current = !1, e.preventDefault();
|
|
822
|
-
}),
|
|
823
|
-
onInteractOutside: n(e.onInteractOutside, (e) => {
|
|
824
|
-
let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0, r = t.button === 2 || n;
|
|
825
|
-
(!a.modal || r) && (s.current = !0);
|
|
826
|
-
}),
|
|
827
|
-
style: {
|
|
828
|
-
...e.style,
|
|
829
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
830
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
831
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
832
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
833
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
834
|
-
}
|
|
835
|
-
});
|
|
836
|
-
});
|
|
837
|
-
Ht.displayName = Vt;
|
|
838
|
-
var Ut = "DropdownMenuGroup", Wt = S.forwardRef((e, t) => {
|
|
839
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
840
|
-
return /* @__PURE__ */ w(xt, {
|
|
841
|
-
...$(n),
|
|
842
|
-
...r,
|
|
843
|
-
ref: t
|
|
844
|
-
});
|
|
845
|
-
});
|
|
846
|
-
Wt.displayName = Ut;
|
|
847
|
-
var Gt = "DropdownMenuLabel", Kt = S.forwardRef((e, t) => {
|
|
848
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
849
|
-
return /* @__PURE__ */ w(St, {
|
|
850
|
-
...$(n),
|
|
851
|
-
...r,
|
|
852
|
-
ref: t
|
|
853
|
-
});
|
|
854
|
-
});
|
|
855
|
-
Kt.displayName = Gt;
|
|
856
|
-
var qt = "DropdownMenuItem", Jt = S.forwardRef((e, t) => {
|
|
857
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
858
|
-
return /* @__PURE__ */ w(Ct, {
|
|
859
|
-
...$(n),
|
|
860
|
-
...r,
|
|
861
|
-
ref: t
|
|
862
|
-
});
|
|
863
|
-
});
|
|
864
|
-
Jt.displayName = qt;
|
|
865
|
-
var Yt = "DropdownMenuCheckboxItem", Xt = S.forwardRef((e, t) => {
|
|
866
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
867
|
-
return /* @__PURE__ */ w(wt, {
|
|
868
|
-
...$(n),
|
|
869
|
-
...r,
|
|
870
|
-
ref: t
|
|
871
|
-
});
|
|
872
|
-
});
|
|
873
|
-
Xt.displayName = Yt;
|
|
874
|
-
var Zt = "DropdownMenuRadioGroup", Qt = S.forwardRef((e, t) => {
|
|
875
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
876
|
-
return /* @__PURE__ */ w(Tt, {
|
|
877
|
-
...$(n),
|
|
878
|
-
...r,
|
|
879
|
-
ref: t
|
|
880
|
-
});
|
|
881
|
-
});
|
|
882
|
-
Qt.displayName = Zt;
|
|
883
|
-
var $t = "DropdownMenuRadioItem", en = S.forwardRef((e, t) => {
|
|
884
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
885
|
-
return /* @__PURE__ */ w(Et, {
|
|
886
|
-
...$(n),
|
|
887
|
-
...r,
|
|
888
|
-
ref: t
|
|
889
|
-
});
|
|
890
|
-
});
|
|
891
|
-
en.displayName = $t;
|
|
892
|
-
var tn = "DropdownMenuItemIndicator", nn = S.forwardRef((e, t) => {
|
|
893
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
894
|
-
return /* @__PURE__ */ w(Dt, {
|
|
895
|
-
...$(n),
|
|
896
|
-
...r,
|
|
897
|
-
ref: t
|
|
898
|
-
});
|
|
899
|
-
});
|
|
900
|
-
nn.displayName = tn;
|
|
901
|
-
var rn = "DropdownMenuSeparator", an = S.forwardRef((e, t) => {
|
|
902
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
903
|
-
return /* @__PURE__ */ w(Ot, {
|
|
904
|
-
...$(n),
|
|
905
|
-
...r,
|
|
906
|
-
ref: t
|
|
907
|
-
});
|
|
908
|
-
});
|
|
909
|
-
an.displayName = rn;
|
|
910
|
-
var on = "DropdownMenuArrow", sn = S.forwardRef((e, t) => {
|
|
911
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
912
|
-
return /* @__PURE__ */ w(kt, {
|
|
913
|
-
...$(n),
|
|
914
|
-
...r,
|
|
915
|
-
ref: t
|
|
916
|
-
});
|
|
917
|
-
});
|
|
918
|
-
sn.displayName = on;
|
|
919
|
-
var cn = "DropdownMenuSubTrigger", ln = S.forwardRef((e, t) => {
|
|
920
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
921
|
-
return /* @__PURE__ */ w(At, {
|
|
922
|
-
...$(n),
|
|
923
|
-
...r,
|
|
924
|
-
ref: t
|
|
925
|
-
});
|
|
926
|
-
});
|
|
927
|
-
ln.displayName = cn;
|
|
928
|
-
var un = "DropdownMenuSubContent", dn = S.forwardRef((e, t) => {
|
|
929
|
-
let { __scopeDropdownMenu: n, ...r } = e;
|
|
930
|
-
return /* @__PURE__ */ w(jt, {
|
|
931
|
-
...$(n),
|
|
932
|
-
...r,
|
|
933
|
-
ref: t,
|
|
934
|
-
style: {
|
|
935
|
-
...e.style,
|
|
936
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
937
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
938
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
939
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
940
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
941
|
-
}
|
|
942
|
-
});
|
|
943
|
-
});
|
|
944
|
-
dn.displayName = un;
|
|
945
|
-
var fn = It, pn = Rt, mn = Bt, hn = Ht, gn = Wt, _n = Jt, vn = an;
|
|
946
|
-
//#endregion
|
|
947
|
-
export { fn as a, mn as i, gn as n, vn as o, _n as r, pn as s, hn as t };
|