@react-aria/menu 3.11.3-nightly.4321 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-AE.main.js +6 -0
- package/dist/ar-AE.main.js.map +1 -0
- package/dist/ar-AE.mjs +8 -0
- package/dist/ar-AE.module.js +8 -0
- package/dist/ar-AE.module.js.map +1 -0
- package/dist/bg-BG.main.js +6 -0
- package/dist/bg-BG.main.js.map +1 -0
- package/dist/bg-BG.mjs +8 -0
- package/dist/bg-BG.module.js +8 -0
- package/dist/bg-BG.module.js.map +1 -0
- package/dist/cs-CZ.main.js +6 -0
- package/dist/cs-CZ.main.js.map +1 -0
- package/dist/cs-CZ.mjs +8 -0
- package/dist/cs-CZ.module.js +8 -0
- package/dist/cs-CZ.module.js.map +1 -0
- package/dist/da-DK.main.js +6 -0
- package/dist/da-DK.main.js.map +1 -0
- package/dist/da-DK.mjs +8 -0
- package/dist/da-DK.module.js +8 -0
- package/dist/da-DK.module.js.map +1 -0
- package/dist/de-DE.main.js +6 -0
- package/dist/de-DE.main.js.map +1 -0
- package/dist/de-DE.mjs +8 -0
- package/dist/de-DE.module.js +8 -0
- package/dist/de-DE.module.js.map +1 -0
- package/dist/el-GR.main.js +6 -0
- package/dist/el-GR.main.js.map +1 -0
- package/dist/el-GR.mjs +8 -0
- package/dist/el-GR.module.js +8 -0
- package/dist/el-GR.module.js.map +1 -0
- package/dist/en-US.main.js +6 -0
- package/dist/en-US.main.js.map +1 -0
- package/dist/en-US.mjs +8 -0
- package/dist/en-US.module.js +8 -0
- package/dist/en-US.module.js.map +1 -0
- package/dist/es-ES.main.js +6 -0
- package/dist/es-ES.main.js.map +1 -0
- package/dist/es-ES.mjs +8 -0
- package/dist/es-ES.module.js +8 -0
- package/dist/es-ES.module.js.map +1 -0
- package/dist/et-EE.main.js +6 -0
- package/dist/et-EE.main.js.map +1 -0
- package/dist/et-EE.mjs +8 -0
- package/dist/et-EE.module.js +8 -0
- package/dist/et-EE.module.js.map +1 -0
- package/dist/fi-FI.main.js +6 -0
- package/dist/fi-FI.main.js.map +1 -0
- package/dist/fi-FI.mjs +8 -0
- package/dist/fi-FI.module.js +8 -0
- package/dist/fi-FI.module.js.map +1 -0
- package/dist/fr-FR.main.js +6 -0
- package/dist/fr-FR.main.js.map +1 -0
- package/dist/fr-FR.mjs +8 -0
- package/dist/fr-FR.module.js +8 -0
- package/dist/fr-FR.module.js.map +1 -0
- package/dist/he-IL.main.js +6 -0
- package/dist/he-IL.main.js.map +1 -0
- package/dist/he-IL.mjs +8 -0
- package/dist/he-IL.module.js +8 -0
- package/dist/he-IL.module.js.map +1 -0
- package/dist/hr-HR.main.js +6 -0
- package/dist/hr-HR.main.js.map +1 -0
- package/dist/hr-HR.mjs +8 -0
- package/dist/hr-HR.module.js +8 -0
- package/dist/hr-HR.module.js.map +1 -0
- package/dist/hu-HU.main.js +6 -0
- package/dist/hu-HU.main.js.map +1 -0
- package/dist/hu-HU.mjs +8 -0
- package/dist/hu-HU.module.js +8 -0
- package/dist/hu-HU.module.js.map +1 -0
- package/dist/import.mjs +356 -243
- package/dist/it-IT.main.js +6 -0
- package/dist/it-IT.main.js.map +1 -0
- package/dist/it-IT.mjs +8 -0
- package/dist/it-IT.module.js +8 -0
- package/dist/it-IT.module.js.map +1 -0
- package/dist/ja-JP.main.js +6 -0
- package/dist/ja-JP.main.js.map +1 -0
- package/dist/ja-JP.mjs +8 -0
- package/dist/ja-JP.module.js +8 -0
- package/dist/ja-JP.module.js.map +1 -0
- package/dist/ko-KR.main.js +6 -0
- package/dist/ko-KR.main.js.map +1 -0
- package/dist/ko-KR.mjs +8 -0
- package/dist/ko-KR.module.js +8 -0
- package/dist/ko-KR.module.js.map +1 -0
- package/dist/lt-LT.main.js +6 -0
- package/dist/lt-LT.main.js.map +1 -0
- package/dist/lt-LT.mjs +8 -0
- package/dist/lt-LT.module.js +8 -0
- package/dist/lt-LT.module.js.map +1 -0
- package/dist/lv-LV.main.js +6 -0
- package/dist/lv-LV.main.js.map +1 -0
- package/dist/lv-LV.mjs +8 -0
- package/dist/lv-LV.module.js +8 -0
- package/dist/lv-LV.module.js.map +1 -0
- package/dist/main.js +353 -239
- package/dist/main.js.map +1 -1
- package/dist/module.js +356 -243
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.main.js +6 -0
- package/dist/nb-NO.main.js.map +1 -0
- package/dist/nb-NO.mjs +8 -0
- package/dist/nb-NO.module.js +8 -0
- package/dist/nb-NO.module.js.map +1 -0
- package/dist/nl-NL.main.js +6 -0
- package/dist/nl-NL.main.js.map +1 -0
- package/dist/nl-NL.mjs +8 -0
- package/dist/nl-NL.module.js +8 -0
- package/dist/nl-NL.module.js.map +1 -0
- package/dist/pl-PL.main.js +6 -0
- package/dist/pl-PL.main.js.map +1 -0
- package/dist/pl-PL.mjs +8 -0
- package/dist/pl-PL.module.js +8 -0
- package/dist/pl-PL.module.js.map +1 -0
- package/dist/pt-BR.main.js +6 -0
- package/dist/pt-BR.main.js.map +1 -0
- package/dist/pt-BR.mjs +8 -0
- package/dist/pt-BR.module.js +8 -0
- package/dist/pt-BR.module.js.map +1 -0
- package/dist/pt-PT.main.js +6 -0
- package/dist/pt-PT.main.js.map +1 -0
- package/dist/pt-PT.mjs +8 -0
- package/dist/pt-PT.module.js +8 -0
- package/dist/pt-PT.module.js.map +1 -0
- package/dist/ro-RO.main.js +6 -0
- package/dist/ro-RO.main.js.map +1 -0
- package/dist/ro-RO.mjs +8 -0
- package/dist/ro-RO.module.js +8 -0
- package/dist/ro-RO.module.js.map +1 -0
- package/dist/ru-RU.main.js +6 -0
- package/dist/ru-RU.main.js.map +1 -0
- package/dist/ru-RU.mjs +8 -0
- package/dist/ru-RU.module.js +8 -0
- package/dist/ru-RU.module.js.map +1 -0
- package/dist/sk-SK.main.js +6 -0
- package/dist/sk-SK.main.js.map +1 -0
- package/dist/sk-SK.mjs +8 -0
- package/dist/sk-SK.module.js +8 -0
- package/dist/sk-SK.module.js.map +1 -0
- package/dist/sl-SI.main.js +6 -0
- package/dist/sl-SI.main.js.map +1 -0
- package/dist/sl-SI.mjs +8 -0
- package/dist/sl-SI.module.js +8 -0
- package/dist/sl-SI.module.js.map +1 -0
- package/dist/sr-SP.main.js +6 -0
- package/dist/sr-SP.main.js.map +1 -0
- package/dist/sr-SP.mjs +8 -0
- package/dist/sr-SP.module.js +8 -0
- package/dist/sr-SP.module.js.map +1 -0
- package/dist/sv-SE.main.js +6 -0
- package/dist/sv-SE.main.js.map +1 -0
- package/dist/sv-SE.mjs +8 -0
- package/dist/sv-SE.module.js +8 -0
- package/dist/sv-SE.module.js.map +1 -0
- package/dist/tr-TR.main.js +6 -0
- package/dist/tr-TR.main.js.map +1 -0
- package/dist/tr-TR.mjs +8 -0
- package/dist/tr-TR.module.js +8 -0
- package/dist/tr-TR.module.js.map +1 -0
- package/dist/types.d.ts +45 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.main.js +6 -0
- package/dist/uk-UA.main.js.map +1 -0
- package/dist/uk-UA.mjs +8 -0
- package/dist/uk-UA.module.js +8 -0
- package/dist/uk-UA.module.js.map +1 -0
- package/dist/zh-CN.main.js +6 -0
- package/dist/zh-CN.main.js.map +1 -0
- package/dist/zh-CN.mjs +8 -0
- package/dist/zh-CN.module.js +8 -0
- package/dist/zh-CN.module.js.map +1 -0
- package/dist/zh-TW.main.js +6 -0
- package/dist/zh-TW.main.js.map +1 -0
- package/dist/zh-TW.mjs +8 -0
- package/dist/zh-TW.module.js +8 -0
- package/dist/zh-TW.module.js.map +1 -0
- package/package.json +14 -14
- package/src/index.ts +2 -0
- package/src/useMenu.ts +5 -5
- package/src/useMenuItem.ts +61 -82
- package/src/useMenuTrigger.ts +2 -1
- package/src/useSafelyMouseToSubmenu.ts +158 -0
- package/src/useSubmenuTrigger.ts +235 -0
package/dist/import.mjs
CHANGED
|
@@ -1,11 +1,44 @@
|
|
|
1
|
-
import
|
|
1
|
+
import $c0398ad35c3639b7$exports from "./ar-AE.mjs";
|
|
2
|
+
import $7af657c4165927c3$exports from "./bg-BG.mjs";
|
|
3
|
+
import $d95d4da6d531ab81$exports from "./cs-CZ.mjs";
|
|
4
|
+
import $24ebda9c775dca17$exports from "./da-DK.mjs";
|
|
5
|
+
import $743e0dfca6cab1e9$exports from "./de-DE.mjs";
|
|
6
|
+
import $a2f41026e05f1c84$exports from "./el-GR.mjs";
|
|
7
|
+
import $43b800e97c901737$exports from "./en-US.mjs";
|
|
8
|
+
import $442f5f6ac211e29f$exports from "./es-ES.mjs";
|
|
9
|
+
import $dff280acfeb2d8ac$exports from "./et-EE.mjs";
|
|
10
|
+
import $51608325613944d7$exports from "./fi-FI.mjs";
|
|
11
|
+
import $c4a1b1eabeaa87be$exports from "./fr-FR.mjs";
|
|
12
|
+
import $8c74815cdee18d1b$exports from "./he-IL.mjs";
|
|
13
|
+
import $fd0e9ef6a7fe0ec9$exports from "./hr-HR.mjs";
|
|
14
|
+
import $a89a74a39eba465a$exports from "./hu-HU.mjs";
|
|
15
|
+
import $edc7c66594a0ae8a$exports from "./it-IT.mjs";
|
|
16
|
+
import $f1ab51510712db52$exports from "./ja-JP.mjs";
|
|
17
|
+
import $f9b672d9b82fa3d6$exports from "./ko-KR.mjs";
|
|
18
|
+
import $a385f3910feda499$exports from "./lt-LT.mjs";
|
|
19
|
+
import $4f1bde932c441789$exports from "./lv-LV.mjs";
|
|
20
|
+
import $914a51a8a594d5be$exports from "./nb-NO.mjs";
|
|
21
|
+
import $89aaf803103bb500$exports from "./nl-NL.mjs";
|
|
22
|
+
import $c685891476dbaaca$exports from "./pl-PL.mjs";
|
|
23
|
+
import $885879b9b10c2959$exports from "./pt-BR.mjs";
|
|
24
|
+
import $6b39616688a51692$exports from "./pt-PT.mjs";
|
|
25
|
+
import $f26362aed63f47e2$exports from "./ro-RO.mjs";
|
|
26
|
+
import $06cbade644558bf0$exports from "./ru-RU.mjs";
|
|
27
|
+
import $0a391ff68f9d59b1$exports from "./sk-SK.mjs";
|
|
28
|
+
import $8193cf0e649c7928$exports from "./sl-SI.mjs";
|
|
29
|
+
import $f398debcce5a5c55$exports from "./sr-SP.mjs";
|
|
30
|
+
import $9e9fef000aa4c013$exports from "./sv-SE.mjs";
|
|
31
|
+
import $c016c8183bbe3d68$exports from "./tr-TR.mjs";
|
|
32
|
+
import $ca4f6c8462244e62$exports from "./uk-UA.mjs";
|
|
33
|
+
import $2d9960c02ccac927$exports from "./zh-CN.mjs";
|
|
34
|
+
import $f1b682a4c8c5631c$exports from "./zh-TW.mjs";
|
|
35
|
+
import {useId as $1Hnir$useId, filterDOMProps as $1Hnir$filterDOMProps, mergeProps as $1Hnir$mergeProps, useRouter as $1Hnir$useRouter, useSlotId as $1Hnir$useSlotId, useEffectEvent as $1Hnir$useEffectEvent, useLayoutEffect as $1Hnir$useLayoutEffect, useResizeObserver as $1Hnir$useResizeObserver} from "@react-aria/utils";
|
|
2
36
|
import {useLocalizedStringFormatter as $1Hnir$useLocalizedStringFormatter, useLocale as $1Hnir$useLocale} from "@react-aria/i18n";
|
|
3
|
-
import {useLongPress as $1Hnir$useLongPress, usePress as $1Hnir$usePress, useHover as $1Hnir$useHover, isFocusVisible as $1Hnir$isFocusVisible, useKeyboard as $1Hnir$useKeyboard} from "@react-aria/interactions";
|
|
37
|
+
import {useLongPress as $1Hnir$useLongPress, usePress as $1Hnir$usePress, useHover as $1Hnir$useHover, isFocusVisible as $1Hnir$isFocusVisible, useKeyboard as $1Hnir$useKeyboard, useFocus as $1Hnir$useFocus, useInteractionModality as $1Hnir$useInteractionModality} from "@react-aria/interactions";
|
|
4
38
|
import {useOverlayTrigger as $1Hnir$useOverlayTrigger} from "@react-aria/overlays";
|
|
5
39
|
import {useSelectableList as $1Hnir$useSelectableList, useSelectableItem as $1Hnir$useSelectableItem} from "@react-aria/selection";
|
|
6
|
-
import {focusSafely as $1Hnir$focusSafely} from "@react-aria/focus";
|
|
7
40
|
import {getItemCount as $1Hnir$getItemCount} from "@react-stately/collections";
|
|
8
|
-
import {useRef as $1Hnir$useRef, useCallback as $1Hnir$useCallback} from "react";
|
|
41
|
+
import {useRef as $1Hnir$useRef, useCallback as $1Hnir$useCallback, useState as $1Hnir$useState, useEffect as $1Hnir$useEffect} from "react";
|
|
9
42
|
|
|
10
43
|
|
|
11
44
|
function $parcel$interopDefault(a) {
|
|
@@ -32,208 +65,38 @@ function $parcel$interopDefault(a) {
|
|
|
32
65
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
33
66
|
* governing permissions and limitations under the License.
|
|
34
67
|
*/ var $2cbb7ca666678a14$exports = {};
|
|
35
|
-
var $c0398ad35c3639b7$exports = {};
|
|
36
|
-
$c0398ad35c3639b7$exports = {
|
|
37
|
-
"longPressMessage": `\u{627}\u{636}\u{63A}\u{637} \u{645}\u{637}\u{648}\u{644}\u{627}\u{64B} \u{623}\u{648} \u{627}\u{636}\u{63A}\u{637} \u{639}\u{644}\u{649} Alt + \u{627}\u{644}\u{633}\u{647}\u{645} \u{644}\u{623}\u{633}\u{641}\u{644} \u{644}\u{641}\u{62A}\u{62D} \u{627}\u{644}\u{642}\u{627}\u{626}\u{645}\u{629}`
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var $7af657c4165927c3$exports = {};
|
|
42
|
-
$7af657c4165927c3$exports = {
|
|
43
|
-
"longPressMessage": `\u{41D}\u{430}\u{442}\u{438}\u{441}\u{43D}\u{435}\u{442}\u{435} \u{43F}\u{440}\u{43E}\u{434}\u{44A}\u{43B}\u{436}\u{438}\u{442}\u{435}\u{43B}\u{43D}\u{43E} \u{438}\u{43B}\u{438} \u{43D}\u{430}\u{442}\u{438}\u{441}\u{43D}\u{435}\u{442}\u{435} Alt+ \u{441}\u{442}\u{440}\u{435}\u{43B}\u{43A}\u{430} \u{43D}\u{430}\u{434}\u{43E}\u{43B}\u{443}, \u{437}\u{430} \u{434}\u{430} \u{43E}\u{442}\u{432}\u{43E}\u{440}\u{438}\u{442}\u{435} \u{43C}\u{435}\u{43D}\u{44E}\u{442}\u{43E}`
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var $d95d4da6d531ab81$exports = {};
|
|
48
|
-
$d95d4da6d531ab81$exports = {
|
|
49
|
-
"longPressMessage": `Dlouh\xfdm stiskem nebo stisknut\xedm kl\xe1ves Alt + \u{161}ipka dol\u{16F} otev\u{159}ete nab\xeddku`
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var $24ebda9c775dca17$exports = {};
|
|
54
|
-
$24ebda9c775dca17$exports = {
|
|
55
|
-
"longPressMessage": `Langt tryk eller tryk p\xe5 Alt + pil ned for at \xe5bne menuen`
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var $743e0dfca6cab1e9$exports = {};
|
|
60
|
-
$743e0dfca6cab1e9$exports = {
|
|
61
|
-
"longPressMessage": `Dr\xfccken Sie lange oder dr\xfccken Sie Alt + Nach-unten, um das Men\xfc zu \xf6ffnen`
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var $a2f41026e05f1c84$exports = {};
|
|
66
|
-
$a2f41026e05f1c84$exports = {
|
|
67
|
-
"longPressMessage": `\u{3A0}\u{3B9}\u{3AD}\u{3C3}\u{3C4}\u{3B5} \u{3C0}\u{3B1}\u{3C1}\u{3B1}\u{3C4}\u{3B5}\u{3C4}\u{3B1}\u{3BC}\u{3AD}\u{3BD}\u{3B1} \u{3AE} \u{3C0}\u{3B1}\u{3C4}\u{3AE}\u{3C3}\u{3C4}\u{3B5} Alt + \u{3BA}\u{3AC}\u{3C4}\u{3C9} \u{3B2}\u{3AD}\u{3BB}\u{3BF}\u{3C2} \u{3B3}\u{3B9}\u{3B1} \u{3BD}\u{3B1} \u{3B1}\u{3BD}\u{3BF}\u{3AF}\u{3BE}\u{3B5}\u{3C4}\u{3B5} \u{3C4}\u{3BF} \u{3BC}\u{3B5}\u{3BD}\u{3BF}\u{3CD}`
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var $43b800e97c901737$exports = {};
|
|
72
|
-
$43b800e97c901737$exports = {
|
|
73
|
-
"longPressMessage": `Long press or press Alt + ArrowDown to open menu`
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var $442f5f6ac211e29f$exports = {};
|
|
78
|
-
$442f5f6ac211e29f$exports = {
|
|
79
|
-
"longPressMessage": `Mantenga pulsado o pulse Alt + flecha abajo para abrir el men\xfa`
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var $dff280acfeb2d8ac$exports = {};
|
|
84
|
-
$dff280acfeb2d8ac$exports = {
|
|
85
|
-
"longPressMessage": `Men\xfc\xfc avamiseks vajutage pikalt v\xf5i vajutage klahve Alt + allanool`
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var $51608325613944d7$exports = {};
|
|
90
|
-
$51608325613944d7$exports = {
|
|
91
|
-
"longPressMessage": `Avaa valikko painamalla pohjassa tai n\xe4pp\xe4inyhdistelm\xe4ll\xe4 Alt + Alanuoli`
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var $c4a1b1eabeaa87be$exports = {};
|
|
96
|
-
$c4a1b1eabeaa87be$exports = {
|
|
97
|
-
"longPressMessage": `Appuyez de mani\xe8re prolong\xe9e ou appuyez sur Alt\xa0+\xa0Fl\xe8che vers le bas pour ouvrir le menu.`
|
|
98
|
-
};
|
|
99
68
|
|
|
100
69
|
|
|
101
|
-
var $8c74815cdee18d1b$exports = {};
|
|
102
|
-
$8c74815cdee18d1b$exports = {
|
|
103
|
-
"longPressMessage": `\u{5DC}\u{5D7}\u{5E5} \u{5DC}\u{5D7}\u{5D9}\u{5E6}\u{5D4} \u{5D0}\u{5E8}\u{5D5}\u{5DB}\u{5D4} \u{5D0}\u{5D5} \u{5D4}\u{5E7}\u{5E9} Alt + ArrowDown \u{5DB}\u{5D3}\u{5D9} \u{5DC}\u{5E4}\u{5EA}\u{5D5}\u{5D7} \u{5D0}\u{5EA} \u{5D4}\u{5EA}\u{5E4}\u{5E8}\u{5D9}\u{5D8}`
|
|
104
|
-
};
|
|
105
70
|
|
|
106
71
|
|
|
107
|
-
var $fd0e9ef6a7fe0ec9$exports = {};
|
|
108
|
-
$fd0e9ef6a7fe0ec9$exports = {
|
|
109
|
-
"longPressMessage": `Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika`
|
|
110
|
-
};
|
|
111
72
|
|
|
112
73
|
|
|
113
|
-
var $a89a74a39eba465a$exports = {};
|
|
114
|
-
$a89a74a39eba465a$exports = {
|
|
115
|
-
"longPressMessage": `Nyomja meg hosszan, vagy nyomja meg az Alt + lefele ny\xedl gombot a men\xfc megnyit\xe1s\xe1hoz`
|
|
116
|
-
};
|
|
117
74
|
|
|
118
75
|
|
|
119
|
-
var $edc7c66594a0ae8a$exports = {};
|
|
120
|
-
$edc7c66594a0ae8a$exports = {
|
|
121
|
-
"longPressMessage": `Premere a lungo o premere Alt + Freccia gi\xf9 per aprire il menu`
|
|
122
|
-
};
|
|
123
76
|
|
|
124
77
|
|
|
125
|
-
var $f1ab51510712db52$exports = {};
|
|
126
|
-
$f1ab51510712db52$exports = {
|
|
127
|
-
"longPressMessage": `\u{9577}\u{62BC}\u{3057}\u{307E}\u{305F}\u{306F} Alt+\u{4E0B}\u{77E2}\u{5370}\u{30AD}\u{30FC}\u{3067}\u{30E1}\u{30CB}\u{30E5}\u{30FC}\u{3092}\u{958B}\u{304F}`
|
|
128
|
-
};
|
|
129
78
|
|
|
130
79
|
|
|
131
|
-
var $f9b672d9b82fa3d6$exports = {};
|
|
132
|
-
$f9b672d9b82fa3d6$exports = {
|
|
133
|
-
"longPressMessage": `\u{AE38}\u{AC8C} \u{B204}\u{B974}\u{AC70}\u{B098} Alt + \u{C544}\u{B798}\u{CABD} \u{D654}\u{C0B4}\u{D45C}\u{B97C} \u{B20C}\u{B7EC} \u{BA54}\u{B274} \u{C5F4}\u{AE30}`
|
|
134
|
-
};
|
|
135
80
|
|
|
136
81
|
|
|
137
|
-
var $a385f3910feda499$exports = {};
|
|
138
|
-
$a385f3910feda499$exports = {
|
|
139
|
-
"longPressMessage": `Nor\u{117}dami atidaryti meniu, nuspaud\u{119} palaikykite arba paspauskite \u{201E}Alt + ArrowDown\u{201C}.`
|
|
140
|
-
};
|
|
141
82
|
|
|
142
83
|
|
|
143
|
-
var $4f1bde932c441789$exports = {};
|
|
144
|
-
$4f1bde932c441789$exports = {
|
|
145
|
-
"longPressMessage": `Lai atv\u{113}rtu izv\u{113}lni, turiet nospiestu vai nospiediet tausti\u{146}u kombin\u{101}ciju Alt + lejupv\u{113}rst\u{101} bulti\u{146}a`
|
|
146
|
-
};
|
|
147
84
|
|
|
148
85
|
|
|
149
|
-
var $914a51a8a594d5be$exports = {};
|
|
150
|
-
$914a51a8a594d5be$exports = {
|
|
151
|
-
"longPressMessage": `Langt trykk eller trykk Alt + PilNed for \xe5 \xe5pne menyen`
|
|
152
|
-
};
|
|
153
86
|
|
|
154
87
|
|
|
155
|
-
var $89aaf803103bb500$exports = {};
|
|
156
|
-
$89aaf803103bb500$exports = {
|
|
157
|
-
"longPressMessage": `Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen`
|
|
158
|
-
};
|
|
159
88
|
|
|
160
89
|
|
|
161
|
-
var $c685891476dbaaca$exports = {};
|
|
162
|
-
$c685891476dbaaca$exports = {
|
|
163
|
-
"longPressMessage": `Naci\u{15B}nij i przytrzymaj lub naci\u{15B}nij klawisze Alt + Strza\u{142}ka w d\xf3\u{142}, aby otworzy\u{107} menu`
|
|
164
|
-
};
|
|
165
90
|
|
|
166
91
|
|
|
167
|
-
var $885879b9b10c2959$exports = {};
|
|
168
|
-
$885879b9b10c2959$exports = {
|
|
169
|
-
"longPressMessage": `Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu`
|
|
170
|
-
};
|
|
171
92
|
|
|
172
93
|
|
|
173
|
-
var $6b39616688a51692$exports = {};
|
|
174
|
-
$6b39616688a51692$exports = {
|
|
175
|
-
"longPressMessage": `Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu`
|
|
176
|
-
};
|
|
177
94
|
|
|
178
95
|
|
|
179
|
-
var $f26362aed63f47e2$exports = {};
|
|
180
|
-
$f26362aed63f47e2$exports = {
|
|
181
|
-
"longPressMessage": `Ap\u{103}sa\u{21B}i lung sau ap\u{103}sa\u{21B}i pe Alt + s\u{103}geat\u{103} \xeen jos pentru a deschide meniul`
|
|
182
|
-
};
|
|
183
96
|
|
|
184
97
|
|
|
185
|
-
var $06cbade644558bf0$exports = {};
|
|
186
|
-
$06cbade644558bf0$exports = {
|
|
187
|
-
"longPressMessage": `\u{41D}\u{430}\u{436}\u{43C}\u{438}\u{442}\u{435} \u{438} \u{443}\u{434}\u{435}\u{440}\u{436}\u{438}\u{432}\u{430}\u{439}\u{442}\u{435} \u{438}\u{43B}\u{438} \u{43D}\u{430}\u{436}\u{43C}\u{438}\u{442}\u{435} Alt + \u{421}\u{442}\u{440}\u{435}\u{43B}\u{43A}\u{430} \u{432}\u{43D}\u{438}\u{437}, \u{447}\u{442}\u{43E}\u{431}\u{44B} \u{43E}\u{442}\u{43A}\u{440}\u{44B}\u{442}\u{44C} \u{43C}\u{435}\u{43D}\u{44E}`
|
|
188
|
-
};
|
|
189
98
|
|
|
190
99
|
|
|
191
|
-
var $0a391ff68f9d59b1$exports = {};
|
|
192
|
-
$0a391ff68f9d59b1$exports = {
|
|
193
|
-
"longPressMessage": `Ponuku otvor\xedte dlh\xfdm stla\u{10D}en\xedm alebo stla\u{10D}en\xedm kl\xe1vesu Alt + kl\xe1vesu so \u{161}\xedpkou nadol`
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
var $8193cf0e649c7928$exports = {};
|
|
198
|
-
$8193cf0e649c7928$exports = {
|
|
199
|
-
"longPressMessage": `Za odprtje menija pritisnite in dr\u{17E}ite gumb ali pritisnite Alt+pu\u{161}\u{10D}ica navzdol`
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
var $f398debcce5a5c55$exports = {};
|
|
204
|
-
$f398debcce5a5c55$exports = {
|
|
205
|
-
"longPressMessage": `Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni`
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
var $9e9fef000aa4c013$exports = {};
|
|
210
|
-
$9e9fef000aa4c013$exports = {
|
|
211
|
-
"longPressMessage": `H\xe5ll nedtryckt eller tryck p\xe5 Alt + pil ned\xe5t f\xf6r att \xf6ppna menyn`
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
var $c016c8183bbe3d68$exports = {};
|
|
216
|
-
$c016c8183bbe3d68$exports = {
|
|
217
|
-
"longPressMessage": `Men\xfcy\xfc a\xe7mak i\xe7in uzun bas\u{131}n veya Alt + A\u{15F}a\u{11F}\u{131} Ok tu\u{15F}una bas\u{131}n`
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
var $ca4f6c8462244e62$exports = {};
|
|
222
|
-
$ca4f6c8462244e62$exports = {
|
|
223
|
-
"longPressMessage": `\u{414}\u{43E}\u{432}\u{433}\u{43E} \u{430}\u{431}\u{43E} \u{437}\u{432}\u{438}\u{447}\u{430}\u{439}\u{43D}\u{43E} \u{43D}\u{430}\u{442}\u{438}\u{441}\u{43D}\u{456}\u{442}\u{44C} \u{43A}\u{43E}\u{43C}\u{431}\u{456}\u{43D}\u{430}\u{446}\u{456}\u{44E} \u{43A}\u{43B}\u{430}\u{432}\u{456}\u{448} Alt \u{456} \u{441}\u{442}\u{440}\u{456}\u{43B}\u{43A}\u{430} \u{432}\u{43D}\u{438}\u{437}, \u{449}\u{43E}\u{431} \u{432}\u{456}\u{434}\u{43A}\u{440}\u{438}\u{442}\u{438} \u{43C}\u{435}\u{43D}\u{44E}`
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var $2d9960c02ccac927$exports = {};
|
|
228
|
-
$2d9960c02ccac927$exports = {
|
|
229
|
-
"longPressMessage": `\u{957F}\u{6309}\u{6216}\u{6309} Alt + \u{5411}\u{4E0B}\u{65B9}\u{5411}\u{952E}\u{4EE5}\u{6253}\u{5F00}\u{83DC}\u{5355}`
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
var $f1b682a4c8c5631c$exports = {};
|
|
234
|
-
$f1b682a4c8c5631c$exports = {
|
|
235
|
-
"longPressMessage": `\u{9577}\u{6309}\u{6216}\u{6309} Alt+\u{5411}\u{4E0B}\u{9375}\u{4EE5}\u{958B}\u{555F}\u{529F}\u{80FD}\u{8868}`
|
|
236
|
-
};
|
|
237
100
|
|
|
238
101
|
|
|
239
102
|
$2cbb7ca666678a14$exports = {
|
|
@@ -308,7 +171,7 @@ function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
|
308
171
|
if ("continuePropagation" in e) e.continuePropagation();
|
|
309
172
|
}
|
|
310
173
|
};
|
|
311
|
-
let stringFormatter = (0, $1Hnir$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($2cbb7ca666678a14$exports))));
|
|
174
|
+
let stringFormatter = (0, $1Hnir$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($2cbb7ca666678a14$exports))), "@react-aria/menu");
|
|
312
175
|
let { longPressProps: longPressProps } = (0, $1Hnir$useLongPress)({
|
|
313
176
|
isDisabled: isDisabled || trigger !== "longPress",
|
|
314
177
|
accessibilityDescription: stringFormatter.format("longPressMessage"),
|
|
@@ -363,7 +226,7 @@ function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
|
|
|
363
226
|
|
|
364
227
|
const $d5336fe17ce95402$export$6f49b4016bfc8d56 = new WeakMap();
|
|
365
228
|
function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
|
|
366
|
-
let { shouldFocusWrap: shouldFocusWrap = true, ...otherProps } = props;
|
|
229
|
+
let { shouldFocusWrap: shouldFocusWrap = true, onKeyDown: onKeyDown, onKeyUp: onKeyUp, ...otherProps } = props;
|
|
367
230
|
if (!props["aria-label"] && !props["aria-labelledby"]) console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
|
|
368
231
|
let domProps = (0, $1Hnir$filterDOMProps)(props, {
|
|
369
232
|
labelable: true
|
|
@@ -383,9 +246,10 @@ function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
|
|
|
383
246
|
});
|
|
384
247
|
return {
|
|
385
248
|
menuProps: (0, $1Hnir$mergeProps)(domProps, {
|
|
249
|
+
onKeyDown: onKeyDown,
|
|
250
|
+
onKeyUp: onKeyUp
|
|
251
|
+
}, {
|
|
386
252
|
role: "menu",
|
|
387
|
-
// this forces AT to move their cursors into any open sub dialogs, the sub dialogs contain hidden close buttons in order to come back to this level of the menu
|
|
388
|
-
"aria-hidden": state.expandedKeys.size > 0 ? true : undefined,
|
|
389
253
|
...listProps,
|
|
390
254
|
onKeyDown: (e)=>{
|
|
391
255
|
// don't clear the menu selected keys if the user is presses escape since escape closes the menu
|
|
@@ -411,55 +275,27 @@ function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
|
|
|
411
275
|
|
|
412
276
|
|
|
413
277
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
278
|
function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
418
279
|
var _item_props;
|
|
419
|
-
let { key: key, closeOnSelect: closeOnSelect, isVirtualized: isVirtualized, "aria-haspopup": hasPopup } = props;
|
|
420
|
-
let { direction: direction } = (0, $1Hnir$useLocale)();
|
|
280
|
+
let { key: key, closeOnSelect: closeOnSelect, isVirtualized: isVirtualized, "aria-haspopup": hasPopup, onPressStart: pressStartProp, onPressUp: pressUpProp, onPress: onPress, onPressChange: onPressChange, onPressEnd: onPressEnd, onHoverStart: hoverStartProp, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onFocus: onFocus, onFocusChange: onFocusChange, onBlur: onBlur } = props;
|
|
421
281
|
let isTrigger = !!hasPopup;
|
|
422
|
-
let isOpen = state.expandedKeys.has(key);
|
|
423
282
|
var _props_isDisabled;
|
|
424
283
|
let isDisabled = (_props_isDisabled = props.isDisabled) !== null && _props_isDisabled !== void 0 ? _props_isDisabled : state.disabledKeys.has(key);
|
|
425
284
|
var _props_isSelected;
|
|
426
285
|
let isSelected = (_props_isSelected = props.isSelected) !== null && _props_isSelected !== void 0 ? _props_isSelected : state.selectionManager.isSelected(key);
|
|
427
|
-
let openTimeout = (0, $1Hnir$useRef)();
|
|
428
|
-
let cancelOpenTimeout = (0, $1Hnir$useCallback)(()=>{
|
|
429
|
-
if (openTimeout.current) {
|
|
430
|
-
clearTimeout(openTimeout.current);
|
|
431
|
-
openTimeout.current = undefined;
|
|
432
|
-
}
|
|
433
|
-
}, [
|
|
434
|
-
openTimeout
|
|
435
|
-
]);
|
|
436
|
-
let onSubmenuOpen = (0, $1Hnir$useEffectEvent)(()=>{
|
|
437
|
-
cancelOpenTimeout();
|
|
438
|
-
state.setExpandedKeys(new Set([
|
|
439
|
-
key
|
|
440
|
-
]));
|
|
441
|
-
});
|
|
442
|
-
(0, $1Hnir$useLayoutEffect)(()=>{
|
|
443
|
-
return ()=>cancelOpenTimeout();
|
|
444
|
-
}, [
|
|
445
|
-
cancelOpenTimeout
|
|
446
|
-
]);
|
|
447
286
|
let data = (0, $d5336fe17ce95402$export$6f49b4016bfc8d56).get(state);
|
|
448
287
|
let onClose = props.onClose || data.onClose;
|
|
449
|
-
let
|
|
450
|
-
onSubmenuOpen();
|
|
451
|
-
// will need to disable this lint rule when using useEffectEvent https://react.dev/learn/separating-events-from-effects#logic-inside-effects-is-reactive
|
|
452
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
453
|
-
}, []);
|
|
454
|
-
let onAction = isTrigger ? onActionMenuDialogTrigger : props.onAction || data.onAction;
|
|
288
|
+
let onAction = isTrigger ? ()=>{} : props.onAction || data.onAction;
|
|
455
289
|
let router = (0, $1Hnir$useRouter)();
|
|
456
290
|
let performAction = (e)=>{
|
|
457
291
|
if (onAction) onAction(key);
|
|
458
292
|
if (e.target instanceof HTMLAnchorElement) router.open(e.target, e);
|
|
459
293
|
};
|
|
460
294
|
let role = "menuitem";
|
|
461
|
-
if (
|
|
462
|
-
|
|
295
|
+
if (!isTrigger) {
|
|
296
|
+
if (state.selectionManager.selectionMode === "single") role = "menuitemradio";
|
|
297
|
+
else if (state.selectionManager.selectionMode === "multiple") role = "menuitemcheckbox";
|
|
298
|
+
}
|
|
463
299
|
let labelId = (0, $1Hnir$useSlotId)();
|
|
464
300
|
let descriptionId = (0, $1Hnir$useSlotId)();
|
|
465
301
|
let keyboardId = (0, $1Hnir$useSlotId)();
|
|
@@ -471,20 +307,20 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
471
307
|
"aria-describedby": [
|
|
472
308
|
descriptionId,
|
|
473
309
|
keyboardId
|
|
474
|
-
].filter(Boolean).join(" ") || undefined
|
|
310
|
+
].filter(Boolean).join(" ") || undefined,
|
|
311
|
+
"aria-controls": props["aria-controls"],
|
|
312
|
+
"aria-haspopup": hasPopup,
|
|
313
|
+
"aria-expanded": props["aria-expanded"]
|
|
475
314
|
};
|
|
476
|
-
if (state.selectionManager.selectionMode !== "none") ariaProps["aria-checked"] = isSelected;
|
|
315
|
+
if (state.selectionManager.selectionMode !== "none" && !isTrigger) ariaProps["aria-checked"] = isSelected;
|
|
477
316
|
let item = state.collection.getItem(key);
|
|
478
317
|
if (isVirtualized) {
|
|
479
318
|
ariaProps["aria-posinset"] = item === null || item === void 0 ? void 0 : item.index;
|
|
480
319
|
ariaProps["aria-setsize"] = (0, $1Hnir$getItemCount)(state.collection);
|
|
481
320
|
}
|
|
482
|
-
if (hasPopup != null) {
|
|
483
|
-
ariaProps["aria-haspopup"] = hasPopup;
|
|
484
|
-
ariaProps["aria-expanded"] = isOpen ? "true" : "false";
|
|
485
|
-
}
|
|
486
321
|
let onPressStart = (e)=>{
|
|
487
322
|
if (e.pointerType === "keyboard") performAction(e);
|
|
323
|
+
pressStartProp === null || pressStartProp === void 0 ? void 0 : pressStartProp(e);
|
|
488
324
|
};
|
|
489
325
|
let onPressUp = (e)=>{
|
|
490
326
|
if (e.pointerType !== "keyboard") {
|
|
@@ -493,6 +329,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
493
329
|
// selection mode, except if overridden by the closeOnSelect prop.
|
|
494
330
|
if (!isTrigger && onClose && (closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : state.selectionManager.selectionMode !== "multiple" || state.selectionManager.isLink(key))) onClose();
|
|
495
331
|
}
|
|
332
|
+
pressUpProp === null || pressUpProp === void 0 ? void 0 : pressUpProp(e);
|
|
496
333
|
};
|
|
497
334
|
let { itemProps: itemProps, isFocused: isFocused } = (0, $1Hnir$useSelectableItem)({
|
|
498
335
|
selectionManager: state.selectionManager,
|
|
@@ -508,27 +345,23 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
508
345
|
});
|
|
509
346
|
let { pressProps: pressProps, isPressed: isPressed } = (0, $1Hnir$usePress)({
|
|
510
347
|
onPressStart: onPressStart,
|
|
348
|
+
onPress: onPress,
|
|
511
349
|
onPressUp: onPressUp,
|
|
512
|
-
|
|
350
|
+
onPressChange: onPressChange,
|
|
351
|
+
onPressEnd: onPressEnd,
|
|
352
|
+
isDisabled: isDisabled
|
|
513
353
|
});
|
|
514
354
|
let { hoverProps: hoverProps } = (0, $1Hnir$useHover)({
|
|
515
355
|
isDisabled: isDisabled,
|
|
516
|
-
onHoverStart () {
|
|
517
|
-
if (!(0, $1Hnir$isFocusVisible)()
|
|
356
|
+
onHoverStart (e) {
|
|
357
|
+
if (!(0, $1Hnir$isFocusVisible)()) {
|
|
518
358
|
state.selectionManager.setFocused(true);
|
|
519
359
|
state.selectionManager.setFocusedKey(key);
|
|
520
|
-
// focus immediately so that a focus scope opened on hover has the correct restore node
|
|
521
|
-
let isFocused = key === state.selectionManager.focusedKey;
|
|
522
|
-
if (isFocused && state.selectionManager.isFocused && document.activeElement !== ref.current) (0, $1Hnir$focusSafely)(ref.current);
|
|
523
360
|
}
|
|
361
|
+
hoverStartProp === null || hoverStartProp === void 0 ? void 0 : hoverStartProp(e);
|
|
524
362
|
},
|
|
525
|
-
onHoverChange:
|
|
526
|
-
|
|
527
|
-
if (!openTimeout.current) openTimeout.current = setTimeout(()=>{
|
|
528
|
-
onSubmenuOpen();
|
|
529
|
-
}, 200);
|
|
530
|
-
} else if (!isHovered) cancelOpenTimeout();
|
|
531
|
-
}
|
|
363
|
+
onHoverChange: onHoverChange,
|
|
364
|
+
onHoverEnd: onHoverEnd
|
|
532
365
|
});
|
|
533
366
|
let { keyboardProps: keyboardProps } = (0, $1Hnir$useKeyboard)({
|
|
534
367
|
onKeyDown: (e)=>{
|
|
@@ -546,19 +379,18 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
546
379
|
// The Enter key should always close on select, except if overridden.
|
|
547
380
|
if (!isDisabled && closeOnSelect !== false && !isTrigger && onClose) onClose();
|
|
548
381
|
break;
|
|
549
|
-
case "ArrowRight":
|
|
550
|
-
if (isTrigger && direction === "ltr") onSubmenuOpen();
|
|
551
|
-
else e.continuePropagation();
|
|
552
|
-
break;
|
|
553
|
-
case "ArrowLeft":
|
|
554
|
-
if (isTrigger && direction === "rtl") onSubmenuOpen();
|
|
555
|
-
else e.continuePropagation();
|
|
556
|
-
break;
|
|
557
382
|
default:
|
|
558
|
-
e.continuePropagation();
|
|
383
|
+
if (!isTrigger) e.continuePropagation();
|
|
384
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
559
385
|
break;
|
|
560
386
|
}
|
|
561
|
-
}
|
|
387
|
+
},
|
|
388
|
+
onKeyUp: onKeyUp
|
|
389
|
+
});
|
|
390
|
+
let { focusProps: focusProps } = (0, $1Hnir$useFocus)({
|
|
391
|
+
onBlur: onBlur,
|
|
392
|
+
onFocus: onFocus,
|
|
393
|
+
onFocusChange: onFocusChange
|
|
562
394
|
});
|
|
563
395
|
let domProps = (0, $1Hnir$filterDOMProps)(item.props, {
|
|
564
396
|
isLink: !!(item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.href)
|
|
@@ -567,7 +399,10 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
|
|
|
567
399
|
return {
|
|
568
400
|
menuItemProps: {
|
|
569
401
|
...ariaProps,
|
|
570
|
-
...(0, $1Hnir$mergeProps)(domProps,
|
|
402
|
+
...(0, $1Hnir$mergeProps)(domProps, isTrigger ? {
|
|
403
|
+
onFocus: itemProps.onFocus
|
|
404
|
+
} : itemProps, pressProps, hoverProps, keyboardProps, focusProps),
|
|
405
|
+
tabIndex: itemProps.tabIndex != null ? -1 : undefined
|
|
571
406
|
},
|
|
572
407
|
labelProps: {
|
|
573
408
|
id: labelId
|
|
@@ -620,7 +455,285 @@ function $3e5eb2498db5b506$export$73f7a44322579622(props) {
|
|
|
620
455
|
}
|
|
621
456
|
|
|
622
457
|
|
|
458
|
+
/*
|
|
459
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
460
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
461
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
462
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
463
|
+
*
|
|
464
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
465
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
466
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
467
|
+
* governing permissions and limitations under the License.
|
|
468
|
+
*/
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
const $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS = 2;
|
|
475
|
+
const $d275435c250248f8$var$THROTTLE_TIME = 50;
|
|
476
|
+
const $d275435c250248f8$var$TIMEOUT_TIME = 1000;
|
|
477
|
+
const $d275435c250248f8$var$ANGLE_PADDING = Math.PI / 12; // 15°
|
|
478
|
+
function $d275435c250248f8$export$85ec83e04c95f50a(options) {
|
|
479
|
+
let { menuRef: menuRef, submenuRef: submenuRef, isOpen: isOpen, isDisabled: isDisabled } = options;
|
|
480
|
+
let prevPointerPos = (0, $1Hnir$useRef)();
|
|
481
|
+
let submenuRect = (0, $1Hnir$useRef)();
|
|
482
|
+
let lastProcessedTime = (0, $1Hnir$useRef)(0);
|
|
483
|
+
let timeout = (0, $1Hnir$useRef)();
|
|
484
|
+
let autoCloseTimeout = (0, $1Hnir$useRef)();
|
|
485
|
+
let submenuSide = (0, $1Hnir$useRef)();
|
|
486
|
+
let movementsTowardsSubmenuCount = (0, $1Hnir$useRef)(2);
|
|
487
|
+
let [preventPointerEvents, setPreventPointerEvents] = (0, $1Hnir$useState)(false);
|
|
488
|
+
let updateSubmenuRect = ()=>{
|
|
489
|
+
if (submenuRef.current) {
|
|
490
|
+
submenuRect.current = submenuRef.current.getBoundingClientRect();
|
|
491
|
+
submenuSide.current = undefined;
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
(0, $1Hnir$useResizeObserver)({
|
|
495
|
+
ref: submenuRef,
|
|
496
|
+
onResize: updateSubmenuRect
|
|
497
|
+
});
|
|
498
|
+
let reset = ()=>{
|
|
499
|
+
setPreventPointerEvents(false);
|
|
500
|
+
movementsTowardsSubmenuCount.current = $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS;
|
|
501
|
+
};
|
|
502
|
+
let modality = (0, $1Hnir$useInteractionModality)();
|
|
503
|
+
(0, $1Hnir$useEffect)(()=>{
|
|
504
|
+
if (preventPointerEvents && menuRef.current) menuRef.current.style.pointerEvents = "none";
|
|
505
|
+
else menuRef.current.style.pointerEvents = "";
|
|
506
|
+
}, [
|
|
507
|
+
menuRef,
|
|
508
|
+
preventPointerEvents
|
|
509
|
+
]);
|
|
510
|
+
(0, $1Hnir$useEffect)(()=>{
|
|
511
|
+
let submenu = submenuRef.current;
|
|
512
|
+
let menu = menuRef.current;
|
|
513
|
+
if (isDisabled || !submenu || !isOpen || modality !== "pointer") {
|
|
514
|
+
reset();
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
submenuRect.current = submenu.getBoundingClientRect();
|
|
518
|
+
let onPointerMove = (e)=>{
|
|
519
|
+
if (e.pointerType === "touch" || e.pointerType === "pen") return;
|
|
520
|
+
let currentTime = Date.now();
|
|
521
|
+
// Throttle
|
|
522
|
+
if (currentTime - lastProcessedTime.current < $d275435c250248f8$var$THROTTLE_TIME) return;
|
|
523
|
+
clearTimeout(timeout.current);
|
|
524
|
+
clearTimeout(autoCloseTimeout.current);
|
|
525
|
+
let { clientX: mouseX, clientY: mouseY } = e;
|
|
526
|
+
if (!prevPointerPos.current) {
|
|
527
|
+
prevPointerPos.current = {
|
|
528
|
+
x: mouseX,
|
|
529
|
+
y: mouseY
|
|
530
|
+
};
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (!submenuRect.current) return;
|
|
534
|
+
if (!submenuSide.current) submenuSide.current = mouseX > submenuRect.current.right ? "left" : "right";
|
|
535
|
+
// Pointer is outside of parent menu
|
|
536
|
+
if (mouseX < menu.getBoundingClientRect().left || mouseX > menu.getBoundingClientRect().right || mouseY < menu.getBoundingClientRect().top || mouseY > menu.getBoundingClientRect().bottom) {
|
|
537
|
+
reset();
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
/* Check if pointer is moving towards submenu.
|
|
541
|
+
Uses the 2-argument arctangent (https://en.wikipedia.org/wiki/Atan2) to calculate:
|
|
542
|
+
- angle between previous pointer and top of submenu
|
|
543
|
+
- angle between previous pointer and bottom of submenu
|
|
544
|
+
- angle between previous pointer and current pointer (delta)
|
|
545
|
+
If the pointer delta angle value is between the top and bottom angle values, we know the pointer is moving towards the submenu.
|
|
546
|
+
*/ let prevMouseX = prevPointerPos.current.x;
|
|
547
|
+
let prevMouseY = prevPointerPos.current.y;
|
|
548
|
+
let toSubmenuX = submenuSide.current === "right" ? submenuRect.current.left - prevMouseX : prevMouseX - submenuRect.current.right;
|
|
549
|
+
let angleTop = Math.atan2(prevMouseY - submenuRect.current.top, toSubmenuX) + $d275435c250248f8$var$ANGLE_PADDING;
|
|
550
|
+
let angleBottom = Math.atan2(prevMouseY - submenuRect.current.bottom, toSubmenuX) - $d275435c250248f8$var$ANGLE_PADDING;
|
|
551
|
+
let anglePointer = Math.atan2(prevMouseY - mouseY, submenuSide.current === "left" ? -(mouseX - prevMouseX) : mouseX - prevMouseX);
|
|
552
|
+
let isMovingTowardsSubmenu = anglePointer < angleTop && anglePointer > angleBottom;
|
|
553
|
+
movementsTowardsSubmenuCount.current = isMovingTowardsSubmenu ? Math.min(movementsTowardsSubmenuCount.current + 1, $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS) : Math.max(movementsTowardsSubmenuCount.current - 1, 0);
|
|
554
|
+
if (movementsTowardsSubmenuCount.current >= $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS) setPreventPointerEvents(true);
|
|
555
|
+
else setPreventPointerEvents(false);
|
|
556
|
+
lastProcessedTime.current = currentTime;
|
|
557
|
+
prevPointerPos.current = {
|
|
558
|
+
x: mouseX,
|
|
559
|
+
y: mouseY
|
|
560
|
+
};
|
|
561
|
+
// If the pointer is moving towards the submenu, start a timeout to close if no other movements are made after 500ms.
|
|
562
|
+
if (isMovingTowardsSubmenu) timeout.current = setTimeout(()=>{
|
|
563
|
+
reset();
|
|
564
|
+
autoCloseTimeout.current = setTimeout(()=>{
|
|
565
|
+
// Fire a pointerover event to trigger the menu to close.
|
|
566
|
+
// Wait until pointer-events:none is no longer applied
|
|
567
|
+
let target = document.elementFromPoint(mouseX, mouseY);
|
|
568
|
+
if (target && menu.contains(target)) target.dispatchEvent(new PointerEvent("pointerover", {
|
|
569
|
+
bubbles: true,
|
|
570
|
+
cancelable: true
|
|
571
|
+
}));
|
|
572
|
+
}, 100);
|
|
573
|
+
}, $d275435c250248f8$var$TIMEOUT_TIME);
|
|
574
|
+
};
|
|
575
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
576
|
+
return ()=>{
|
|
577
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
578
|
+
clearTimeout(timeout.current);
|
|
579
|
+
clearTimeout(autoCloseTimeout.current);
|
|
580
|
+
movementsTowardsSubmenuCount.current = $d275435c250248f8$var$ALLOWED_INVALID_MOVEMENTS;
|
|
581
|
+
};
|
|
582
|
+
}, [
|
|
583
|
+
isDisabled,
|
|
584
|
+
isOpen,
|
|
585
|
+
menuRef,
|
|
586
|
+
modality,
|
|
587
|
+
setPreventPointerEvents,
|
|
588
|
+
submenuRef
|
|
589
|
+
]);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
function $0065b146e7192841$export$3819f8ee9f4ce664(props, state, ref) {
|
|
594
|
+
let { parentMenuRef: parentMenuRef, submenuRef: submenuRef, type: type = "menu", isDisabled: isDisabled, node: node } = props;
|
|
595
|
+
let submenuTriggerId = (0, $1Hnir$useId)();
|
|
596
|
+
let overlayId = (0, $1Hnir$useId)();
|
|
597
|
+
let { direction: direction } = (0, $1Hnir$useLocale)();
|
|
598
|
+
let openTimeout = (0, $1Hnir$useRef)();
|
|
599
|
+
let cancelOpenTimeout = (0, $1Hnir$useCallback)(()=>{
|
|
600
|
+
if (openTimeout.current) {
|
|
601
|
+
clearTimeout(openTimeout.current);
|
|
602
|
+
openTimeout.current = undefined;
|
|
603
|
+
}
|
|
604
|
+
}, [
|
|
605
|
+
openTimeout
|
|
606
|
+
]);
|
|
607
|
+
let onSubmenuOpen = (0, $1Hnir$useEffectEvent)((focusStrategy)=>{
|
|
608
|
+
cancelOpenTimeout();
|
|
609
|
+
state.open(focusStrategy);
|
|
610
|
+
});
|
|
611
|
+
let onSubmenuClose = (0, $1Hnir$useEffectEvent)(()=>{
|
|
612
|
+
cancelOpenTimeout();
|
|
613
|
+
state.close();
|
|
614
|
+
});
|
|
615
|
+
(0, $1Hnir$useLayoutEffect)(()=>{
|
|
616
|
+
return ()=>{
|
|
617
|
+
cancelOpenTimeout();
|
|
618
|
+
};
|
|
619
|
+
}, [
|
|
620
|
+
cancelOpenTimeout
|
|
621
|
+
]);
|
|
622
|
+
let submenuKeyDown = (e)=>{
|
|
623
|
+
switch(e.key){
|
|
624
|
+
case "ArrowLeft":
|
|
625
|
+
if (direction === "ltr" && e.currentTarget.contains(e.target)) {
|
|
626
|
+
e.stopPropagation();
|
|
627
|
+
onSubmenuClose();
|
|
628
|
+
ref.current.focus();
|
|
629
|
+
}
|
|
630
|
+
break;
|
|
631
|
+
case "ArrowRight":
|
|
632
|
+
if (direction === "rtl" && e.currentTarget.contains(e.target)) {
|
|
633
|
+
e.stopPropagation();
|
|
634
|
+
onSubmenuClose();
|
|
635
|
+
ref.current.focus();
|
|
636
|
+
}
|
|
637
|
+
break;
|
|
638
|
+
case "Escape":
|
|
639
|
+
e.stopPropagation();
|
|
640
|
+
state.closeAll();
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
let submenuProps = {
|
|
645
|
+
id: overlayId,
|
|
646
|
+
"aria-label": node.textValue,
|
|
647
|
+
submenuLevel: state.submenuLevel,
|
|
648
|
+
...type === "menu" && {
|
|
649
|
+
onClose: state.closeAll,
|
|
650
|
+
autoFocus: state.focusStrategy,
|
|
651
|
+
onKeyDown: submenuKeyDown
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
let submenuTriggerKeyDown = (e)=>{
|
|
655
|
+
switch(e.key){
|
|
656
|
+
case "ArrowRight":
|
|
657
|
+
if (!isDisabled) {
|
|
658
|
+
if (direction === "ltr") {
|
|
659
|
+
if (!state.isOpen) onSubmenuOpen("first");
|
|
660
|
+
if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) submenuRef.current.focus();
|
|
661
|
+
} else if (state.isOpen) onSubmenuClose();
|
|
662
|
+
else e.continuePropagation();
|
|
663
|
+
}
|
|
664
|
+
break;
|
|
665
|
+
case "ArrowLeft":
|
|
666
|
+
if (!isDisabled) {
|
|
667
|
+
if (direction === "rtl") {
|
|
668
|
+
if (!state.isOpen) onSubmenuOpen("first");
|
|
669
|
+
if (type === "menu" && !!(submenuRef === null || submenuRef === void 0 ? void 0 : submenuRef.current) && document.activeElement === (ref === null || ref === void 0 ? void 0 : ref.current)) submenuRef.current.focus();
|
|
670
|
+
} else if (state.isOpen) onSubmenuClose();
|
|
671
|
+
else e.continuePropagation();
|
|
672
|
+
}
|
|
673
|
+
break;
|
|
674
|
+
case "Escape":
|
|
675
|
+
state.closeAll();
|
|
676
|
+
break;
|
|
677
|
+
default:
|
|
678
|
+
e.continuePropagation();
|
|
679
|
+
break;
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
let onPressStart = (e)=>{
|
|
683
|
+
if (!isDisabled && (e.pointerType === "virtual" || e.pointerType === "keyboard")) // If opened with a screen reader or keyboard, auto focus the first submenu item.
|
|
684
|
+
onSubmenuOpen("first");
|
|
685
|
+
};
|
|
686
|
+
let onPress = (e)=>{
|
|
687
|
+
if (!isDisabled && (e.pointerType === "touch" || e.pointerType === "mouse")) // For touch or on a desktop device with a small screen open on press up to possible problems with
|
|
688
|
+
// press up happening on the newly opened tray items
|
|
689
|
+
onSubmenuOpen();
|
|
690
|
+
};
|
|
691
|
+
let onHoverChange = (isHovered)=>{
|
|
692
|
+
if (!isDisabled) {
|
|
693
|
+
if (isHovered && !state.isOpen) {
|
|
694
|
+
if (!openTimeout.current) openTimeout.current = setTimeout(()=>{
|
|
695
|
+
onSubmenuOpen();
|
|
696
|
+
}, 200);
|
|
697
|
+
} else if (!isHovered) cancelOpenTimeout();
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
let onBlur = (e)=>{
|
|
701
|
+
if (state.isOpen && parentMenuRef.current.contains(e.relatedTarget)) onSubmenuClose();
|
|
702
|
+
};
|
|
703
|
+
let shouldCloseOnInteractOutside = (target)=>{
|
|
704
|
+
if (target !== ref.current) return true;
|
|
705
|
+
return false;
|
|
706
|
+
};
|
|
707
|
+
(0, $d275435c250248f8$export$85ec83e04c95f50a)({
|
|
708
|
+
menuRef: parentMenuRef,
|
|
709
|
+
submenuRef: submenuRef,
|
|
710
|
+
isOpen: state.isOpen,
|
|
711
|
+
isDisabled: isDisabled
|
|
712
|
+
});
|
|
713
|
+
return {
|
|
714
|
+
submenuTriggerProps: {
|
|
715
|
+
id: submenuTriggerId,
|
|
716
|
+
"aria-controls": state.isOpen ? overlayId : undefined,
|
|
717
|
+
"aria-haspopup": !isDisabled ? type : undefined,
|
|
718
|
+
"aria-expanded": state.isOpen ? "true" : "false",
|
|
719
|
+
onPressStart: onPressStart,
|
|
720
|
+
onPress: onPress,
|
|
721
|
+
onHoverChange: onHoverChange,
|
|
722
|
+
onKeyDown: submenuTriggerKeyDown,
|
|
723
|
+
onBlur: onBlur,
|
|
724
|
+
isOpen: state.isOpen
|
|
725
|
+
},
|
|
726
|
+
submenuProps: submenuProps,
|
|
727
|
+
popoverProps: {
|
|
728
|
+
isNonModal: true,
|
|
729
|
+
disableFocusManagement: true,
|
|
730
|
+
shouldCloseOnInteractOutside: shouldCloseOnInteractOutside
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
|
|
623
736
|
|
|
624
737
|
|
|
625
|
-
export {$168583247155ddda$export$dc9c12ed27dd1b49 as useMenuTrigger, $d5336fe17ce95402$export$38eaa17faae8f579 as useMenu, $a2e5df62f93c7633$export$9d32628fc2aea7da as useMenuItem, $3e5eb2498db5b506$export$73f7a44322579622 as useMenuSection};
|
|
738
|
+
export {$168583247155ddda$export$dc9c12ed27dd1b49 as useMenuTrigger, $d5336fe17ce95402$export$38eaa17faae8f579 as useMenu, $a2e5df62f93c7633$export$9d32628fc2aea7da as useMenuItem, $3e5eb2498db5b506$export$73f7a44322579622 as useMenuSection, $0065b146e7192841$export$3819f8ee9f4ce664 as UNSTABLE_useSubmenuTrigger};
|
|
626
739
|
//# sourceMappingURL=module.js.map
|