@fluentui/react-menu 9.5.3 → 9.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (285) hide show
  1. package/CHANGELOG.json +139 -1
  2. package/CHANGELOG.md +37 -2
  3. package/dist/index.d.ts +9 -19
  4. package/lib/components/Menu/Menu.js +0 -1
  5. package/lib/components/Menu/Menu.js.map +1 -1
  6. package/lib/components/Menu/renderMenu.js +0 -1
  7. package/lib/components/Menu/renderMenu.js.map +1 -1
  8. package/lib/components/Menu/useMenu.js +16 -34
  9. package/lib/components/Menu/useMenu.js.map +1 -1
  10. package/lib/components/Menu/useMenuContextValues.js +2 -2
  11. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  12. package/lib/components/MenuDivider/MenuDivider.js +0 -1
  13. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  14. package/lib/components/MenuDivider/renderMenuDivider.js +2 -2
  15. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  16. package/lib/components/MenuDivider/useMenuDivider.js +0 -1
  17. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  18. package/lib/components/MenuDivider/useMenuDividerStyles.js +10 -12
  19. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  20. package/lib/components/MenuGroup/MenuGroup.js +0 -1
  21. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  22. package/lib/components/MenuGroup/renderMenuGroup.js +2 -2
  23. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  24. package/lib/components/MenuGroup/useMenuGroup.js +0 -1
  25. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  26. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  27. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  28. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +0 -1
  29. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  30. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -2
  31. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  32. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +0 -1
  33. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  34. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +10 -12
  35. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  36. package/lib/components/MenuItem/MenuItem.js +0 -1
  37. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  38. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  39. package/lib/components/MenuItem/renderMenuItem.js +12 -7
  40. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  41. package/lib/components/MenuItem/useCharacterSearch.js +0 -5
  42. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  43. package/lib/components/MenuItem/useMenuItem.js +34 -47
  44. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  45. package/lib/components/MenuItem/useMenuItemStyles.js +108 -117
  46. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  47. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -1
  48. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  49. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -6
  50. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  51. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +2 -4
  52. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  53. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -5
  54. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  55. package/lib/components/MenuItemRadio/MenuItemRadio.js +0 -1
  56. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  57. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +10 -6
  58. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  59. package/lib/components/MenuItemRadio/useMenuItemRadio.js +3 -4
  60. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  61. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -5
  62. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  63. package/lib/components/MenuList/MenuList.js +0 -1
  64. package/lib/components/MenuList/MenuList.js.map +1 -1
  65. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  66. package/lib/components/MenuList/renderMenuList.js +2 -2
  67. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  68. package/lib/components/MenuList/useMenuList.js +13 -29
  69. package/lib/components/MenuList/useMenuList.js.map +1 -1
  70. package/lib/components/MenuList/useMenuListContextValues.js +2 -2
  71. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  72. package/lib/components/MenuList/useMenuListStyles.js +6 -9
  73. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  74. package/lib/components/MenuPopover/MenuPopover.js +0 -1
  75. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  76. package/lib/components/MenuPopover/renderMenuPopover.js +4 -5
  77. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  78. package/lib/components/MenuPopover/useMenuPopover.js +6 -13
  79. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  80. package/lib/components/MenuPopover/useMenuPopoverStyles.js +32 -35
  81. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  82. package/lib/components/MenuSplitGroup/MenuSplitGroup.js +0 -1
  83. package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  84. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -2
  85. package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  86. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +0 -6
  87. package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  88. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +12 -15
  89. package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
  90. package/lib/components/MenuTrigger/MenuTrigger.js +2 -3
  91. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  92. package/lib/components/MenuTrigger/renderMenuTrigger.js +0 -1
  93. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  94. package/lib/components/MenuTrigger/useMenuTrigger.js +4 -24
  95. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  96. package/lib/contexts/menuContext.js.map +1 -1
  97. package/lib/contexts/menuGroupContext.js +0 -1
  98. package/lib/contexts/menuGroupContext.js.map +1 -1
  99. package/lib/contexts/menuListContext.js.map +1 -1
  100. package/lib/contexts/menuTriggerContext.js +0 -2
  101. package/lib/contexts/menuTriggerContext.js.map +1 -1
  102. package/lib/index.js.map +1 -1
  103. package/lib/selectable/useCheckmarkStyles.js +7 -11
  104. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  105. package/lib/utils/useIsSubmenu.js +0 -1
  106. package/lib/utils/useIsSubmenu.js.map +1 -1
  107. package/lib/utils/useOnMenuEnter.js +4 -11
  108. package/lib/utils/useOnMenuEnter.js.map +1 -1
  109. package/lib-amd/components/MenuItem/MenuItem.types.js.map +1 -1
  110. package/lib-amd/components/MenuItem/useMenuItem.js +26 -30
  111. package/lib-amd/components/MenuItem/useMenuItem.js.map +1 -1
  112. package/lib-amd/components/MenuList/MenuList.types.js.map +1 -1
  113. package/lib-amd/components/MenuList/useMenuList.js +5 -4
  114. package/lib-amd/components/MenuList/useMenuList.js.map +1 -1
  115. package/lib-commonjs/Menu.js +0 -2
  116. package/lib-commonjs/Menu.js.map +1 -1
  117. package/lib-commonjs/MenuDivider.js +0 -2
  118. package/lib-commonjs/MenuDivider.js.map +1 -1
  119. package/lib-commonjs/MenuGroup.js +0 -2
  120. package/lib-commonjs/MenuGroup.js.map +1 -1
  121. package/lib-commonjs/MenuGroupHeader.js +0 -2
  122. package/lib-commonjs/MenuGroupHeader.js.map +1 -1
  123. package/lib-commonjs/MenuItem.js +0 -2
  124. package/lib-commonjs/MenuItem.js.map +1 -1
  125. package/lib-commonjs/MenuItemCheckbox.js +0 -2
  126. package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
  127. package/lib-commonjs/MenuItemRadio.js +0 -2
  128. package/lib-commonjs/MenuItemRadio.js.map +1 -1
  129. package/lib-commonjs/MenuList.js +0 -2
  130. package/lib-commonjs/MenuList.js.map +1 -1
  131. package/lib-commonjs/MenuPopover.js +0 -2
  132. package/lib-commonjs/MenuPopover.js.map +1 -1
  133. package/lib-commonjs/MenuSplitGroup.js +0 -2
  134. package/lib-commonjs/MenuSplitGroup.js.map +1 -1
  135. package/lib-commonjs/MenuTrigger.js +0 -2
  136. package/lib-commonjs/MenuTrigger.js.map +1 -1
  137. package/lib-commonjs/components/Menu/Menu.js +0 -6
  138. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  139. package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
  140. package/lib-commonjs/components/Menu/index.js +0 -6
  141. package/lib-commonjs/components/Menu/index.js.map +1 -1
  142. package/lib-commonjs/components/Menu/renderMenu.js +0 -5
  143. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  144. package/lib-commonjs/components/Menu/useMenu.js +16 -46
  145. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  146. package/lib-commonjs/components/Menu/useMenuContextValues.js +2 -4
  147. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  148. package/lib-commonjs/components/MenuDivider/MenuDivider.js +0 -6
  149. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  150. package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
  151. package/lib-commonjs/components/MenuDivider/index.js +0 -6
  152. package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
  153. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +2 -6
  154. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  155. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +0 -4
  156. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  157. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +10 -16
  158. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  159. package/lib-commonjs/components/MenuGroup/MenuGroup.js +0 -7
  160. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  161. package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
  162. package/lib-commonjs/components/MenuGroup/index.js +0 -7
  163. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  164. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +2 -7
  165. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  166. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +0 -4
  167. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  168. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +0 -3
  169. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  170. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +0 -4
  171. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
  172. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +0 -6
  173. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  174. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  175. package/lib-commonjs/components/MenuGroupHeader/index.js +0 -6
  176. package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
  177. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -6
  178. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  179. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +0 -5
  180. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  181. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +10 -16
  182. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  183. package/lib-commonjs/components/MenuItem/MenuItem.js +0 -6
  184. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  185. package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
  186. package/lib-commonjs/components/MenuItem/index.js +0 -6
  187. package/lib-commonjs/components/MenuItem/index.js.map +1 -1
  188. package/lib-commonjs/components/MenuItem/renderMenuItem.js +12 -11
  189. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  190. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +0 -8
  191. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  192. package/lib-commonjs/components/MenuItem/useMenuItem.js +33 -58
  193. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  194. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +108 -124
  195. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  196. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -6
  197. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  198. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  199. package/lib-commonjs/components/MenuItemCheckbox/index.js +0 -6
  200. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  201. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -10
  202. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  203. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +2 -11
  204. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  205. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -11
  206. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  207. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +0 -6
  208. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  209. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  210. package/lib-commonjs/components/MenuItemRadio/index.js +0 -6
  211. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  212. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +10 -10
  213. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  214. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +3 -11
  215. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  216. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -11
  217. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  218. package/lib-commonjs/components/MenuList/MenuList.js +0 -7
  219. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  220. package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
  221. package/lib-commonjs/components/MenuList/index.js +0 -7
  222. package/lib-commonjs/components/MenuList/index.js.map +1 -1
  223. package/lib-commonjs/components/MenuList/renderMenuList.js +2 -7
  224. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  225. package/lib-commonjs/components/MenuList/useMenuList.js +13 -37
  226. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  227. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +2 -4
  228. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  229. package/lib-commonjs/components/MenuList/useMenuListStyles.js +6 -12
  230. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  231. package/lib-commonjs/components/MenuPopover/MenuPopover.js +0 -6
  232. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  233. package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
  234. package/lib-commonjs/components/MenuPopover/index.js +0 -6
  235. package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
  236. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +4 -10
  237. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  238. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +6 -22
  239. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  240. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +32 -39
  241. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  242. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +0 -6
  243. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
  244. package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
  245. package/lib-commonjs/components/MenuSplitGroup/index.js +0 -6
  246. package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
  247. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -6
  248. package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
  249. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +0 -13
  250. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
  251. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +12 -20
  252. package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
  253. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +2 -7
  254. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  255. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  256. package/lib-commonjs/components/MenuTrigger/index.js +0 -5
  257. package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
  258. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +0 -5
  259. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  260. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +4 -34
  261. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  262. package/lib-commonjs/components/index.js +0 -3
  263. package/lib-commonjs/components/index.js.map +1 -1
  264. package/lib-commonjs/contexts/menuContext.js +0 -4
  265. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  266. package/lib-commonjs/contexts/menuGroupContext.js +0 -5
  267. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  268. package/lib-commonjs/contexts/menuListContext.js +0 -4
  269. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  270. package/lib-commonjs/contexts/menuTriggerContext.js +0 -6
  271. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  272. package/lib-commonjs/index.js +0 -32
  273. package/lib-commonjs/index.js.map +1 -1
  274. package/lib-commonjs/selectable/index.js +0 -3
  275. package/lib-commonjs/selectable/index.js.map +1 -1
  276. package/lib-commonjs/selectable/types.js.map +1 -1
  277. package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -13
  278. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  279. package/lib-commonjs/utils/index.js +0 -2
  280. package/lib-commonjs/utils/index.js.map +1 -1
  281. package/lib-commonjs/utils/useIsSubmenu.js +0 -6
  282. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  283. package/lib-commonjs/utils/useOnMenuEnter.js +4 -17
  284. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  285. package/package.json +10 -10
@@ -4,17 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.dispatchMenuEnterEvent = exports.useOnMenuMouseEnter = exports.MENU_ENTER_EVENT = void 0;
7
-
8
7
  const React = /*#__PURE__*/require("react");
9
-
10
8
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
-
12
9
  const react_portal_1 = /*#__PURE__*/require("@fluentui/react-portal");
13
10
  /**
14
11
  * Name of the custom event
15
12
  */
16
-
17
-
18
13
  exports.MENU_ENTER_EVENT = 'fuimenuenter';
19
14
  /**
20
15
  * This hook works similarly to @see {useOnClickOutside}
@@ -27,25 +22,22 @@ exports.MENU_ENTER_EVENT = 'fuimenuenter';
27
22
  * Instead, dispatch custom DOM event from the menu so that it can bubble
28
23
  * Each nested menu can use the listener to check if the event is from a child or parent menu
29
24
  */
30
-
31
25
  const useOnMenuMouseEnter = options => {
32
26
  const {
33
27
  refs,
34
28
  callback,
35
29
  element,
36
30
  disabled
37
- } = options; // Keep mouse event here because this is essentially a custom 'mouseenter' event
38
-
31
+ } = options;
32
+ // Keep mouse event here because this is essentially a custom 'mouseenter' event
39
33
  const listener = react_utilities_1.useEventCallback(ev => {
40
34
  var _a;
41
-
42
35
  const popoverRef = refs[0];
43
- const someMenuPopover = ev.target; // someMenu is a child -> will always be contained because of vParents
36
+ const someMenuPopover = ev.target;
37
+ // someMenu is a child -> will always be contained because of vParents
44
38
  // someMenu is a parent -> will always not be contained because no vParent
45
39
  // someMenu is the current popover -> it will contain itself
46
-
47
40
  const isOutsidePopover = !react_portal_1.elementContains((_a = popoverRef.current) !== null && _a !== void 0 ? _a : null, someMenuPopover);
48
-
49
41
  if (isOutsidePopover && !disabled) {
50
42
  callback(ev);
51
43
  }
@@ -55,24 +47,20 @@ const useOnMenuMouseEnter = options => {
55
47
  if (element == null) {
56
48
  return;
57
49
  }
58
-
59
50
  if (!disabled) {
60
51
  element.addEventListener(exports.MENU_ENTER_EVENT, listener);
61
52
  }
62
-
63
53
  return () => {
64
54
  element.removeEventListener(exports.MENU_ENTER_EVENT, listener);
65
55
  };
66
56
  }, [listener, element, disabled]);
67
57
  };
68
-
69
58
  exports.useOnMenuMouseEnter = useOnMenuMouseEnter;
70
59
  /**
71
60
  * Dispatches the custom MouseEvent enter event. Similar to calling `el.click()`
72
61
  * @param el element for the event target
73
62
  * @param nativeEvent the native mouse event this is mapped to
74
63
  */
75
-
76
64
  const dispatchMenuEnterEvent = (el, nativeEvent) => {
77
65
  el.dispatchEvent(new CustomEvent(exports.MENU_ENTER_EVENT, {
78
66
  bubbles: true,
@@ -81,6 +69,5 @@ const dispatchMenuEnterEvent = (el, nativeEvent) => {
81
69
  }
82
70
  }));
83
71
  };
84
-
85
72
  exports.dispatchMenuEnterEvent = dispatchMenuEnterEvent;
86
73
  //# sourceMappingURL=useOnMenuEnter.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-menu/src/utils/useOnMenuEnter.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAGA;;AAEG;;;AACU,OAAA,CAAA,gBAAA,GAAmB,cAAnB;AAEb;;;;;;;;;;AAUG;;AACI,MAAM,mBAAmB,GAAI,OAAD,IAA8C;EAC/E,MAAM;IAAE,IAAF;IAAQ,QAAR;IAAkB,OAAlB;IAA2B;EAA3B,IAAwC,OAA9C,CAD+E,CAG/E;;EACA,MAAM,QAAQ,GAAG,iBAAA,CAAA,gBAAA,CAAkB,EAAD,IAAmB;;;IACnD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAD,CAAvB;IACA,MAAM,eAAe,GAAG,EAAE,CAAC,MAA3B,CAFmD,CAInD;IACA;IACA;;IACA,MAAM,gBAAgB,GAAG,CAAC,cAAA,CAAA,eAAA,CAAgB,CAAA,EAAA,GAAA,UAAU,CAAC,OAAX,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,EAAlB,GAAsB,IAAtC,EAA4C,eAA5C,CAA1B;;IACA,IAAI,gBAAgB,IAAI,CAAC,QAAzB,EAAmC;MACjC,QAAQ,CAAC,EAAD,CAAR;IACD;EACF,CAXgB,CAAjB;EAaA,KAAK,CAAC,SAAN,CAAgB,MAAK;IACnB;IACA,IAAI,OAAO,IAAI,IAAf,EAAqB;MACnB;IACD;;IAUD,IAAI,CAAC,QAAL,EAAe;MACb,OAAO,CAAC,gBAAR,CAAyB,OAAA,CAAA,gBAAzB,EAA2C,QAA3C;IACD;;IAED,OAAO,MAAK;MACV,OAAO,CAAC,mBAAR,CAA4B,OAAA,CAAA,gBAA5B,EAA8C,QAA9C;IACD,CAFD;EAGD,CArBD,EAqBG,CAAC,QAAD,EAAW,OAAX,EAAoB,QAApB,CArBH;AAsBD,CAvCM;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB;AAyCb;;;;AAIG;;AACI,MAAM,sBAAsB,GAAG,CAAC,EAAD,EAAkB,WAAlB,KAA6C;EACjF,EAAE,CAAC,aAAH,CAAiB,IAAI,WAAJ,CAAgB,OAAA,CAAA,gBAAhB,EAAkC;IAAE,OAAO,EAAE,IAAX;IAAiB,MAAM,EAAE;MAAE;IAAF;EAAzB,CAAlC,CAAjB;AACD,CAFM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { elementContains } from '@fluentui/react-portal';\nimport type { UseOnClickOrScrollOutsideOptions } from '@fluentui/react-utilities';\n\n/**\n * Name of the custom event\n */\nexport const MENU_ENTER_EVENT = 'fuimenuenter';\n\n/**\n * This hook works similarly to @see {useOnClickOutside}\n *\n * Problem: Trying to behave the same as system menus:\n * When the mouse leaves a stack of nested menus the stack should not dismiss.\n * However if the mouse leaves a stack of menus and enters a parent menu all its children menu should dismiss.\n *\n * We don't use the native mouseenter event because it would trigger too many times in the document\n * Instead, dispatch custom DOM event from the menu so that it can bubble\n * Each nested menu can use the listener to check if the event is from a child or parent menu\n */\nexport const useOnMenuMouseEnter = (options: UseOnClickOrScrollOutsideOptions) => {\n const { refs, callback, element, disabled } = options;\n\n // Keep mouse event here because this is essentially a custom 'mouseenter' event\n const listener = useEventCallback((ev: MouseEvent) => {\n const popoverRef = refs[0];\n const someMenuPopover = ev.target as HTMLElement;\n\n // someMenu is a child -> will always be contained because of vParents\n // someMenu is a parent -> will always not be contained because no vParent\n // someMenu is the current popover -> it will contain itself\n const isOutsidePopover = !elementContains(popoverRef.current ?? null, someMenuPopover);\n if (isOutsidePopover && !disabled) {\n callback(ev);\n }\n });\n\n React.useEffect(() => {\n // eslint-disable-next-line eqeqeq\n if (element == null) {\n return;\n }\n\n /**\n * Because `addEventListener` type override falls back to 2nd definition (evt name is unknown string literal)\n * evt is being typed as a base class of MouseEvent -> `Event`.\n * This type is used to override `listener` calls to make TS happy\n */\n\n type ListenerOverride = (evt: Event) => void;\n\n if (!disabled) {\n element.addEventListener(MENU_ENTER_EVENT, listener as ListenerOverride);\n }\n\n return () => {\n element.removeEventListener(MENU_ENTER_EVENT, listener as ListenerOverride);\n };\n }, [listener, element, disabled]);\n};\n\n/**\n * Dispatches the custom MouseEvent enter event. Similar to calling `el.click()`\n * @param el element for the event target\n * @param nativeEvent the native mouse event this is mapped to\n */\nexport const dispatchMenuEnterEvent = (el: HTMLElement, nativeEvent: MouseEvent) => {\n el.dispatchEvent(new CustomEvent(MENU_ENTER_EVENT, { bubbles: true, detail: { nativeEvent } }));\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AAGA;;;AAGaA,wBAAgB,GAAG,cAAc;AAE9C;;;;;;;;;;;AAWO,MAAMC,mBAAmB,GAAIC,OAAyC,IAAI;EAC/E,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAQ,CAAE,GAAGJ,OAAO;EAErD;EACA,MAAMK,QAAQ,GAAGC,kCAAgB,CAAEC,EAAc,IAAI;;IACnD,MAAMC,UAAU,GAAGP,IAAI,CAAC,CAAC,CAAC;IAC1B,MAAMQ,eAAe,GAAGF,EAAE,CAACG,MAAqB;IAEhD;IACA;IACA;IACA,MAAMC,gBAAgB,GAAG,CAACC,8BAAe,CAAC,gBAAU,CAACC,OAAO,mCAAI,IAAI,EAAEJ,eAAe,CAAC;IACtF,IAAIE,gBAAgB,IAAI,CAACP,QAAQ,EAAE;MACjCF,QAAQ,CAACK,EAAE,CAAC;;EAEhB,CAAC,CAAC;EAEFO,KAAK,CAACC,SAAS,CAAC,MAAK;IACnB;IACA,IAAIZ,OAAO,IAAI,IAAI,EAAE;MACnB;;IAWF,IAAI,CAACC,QAAQ,EAAE;MACbD,OAAO,CAACa,gBAAgB,CAAClB,wBAAgB,EAAEO,QAA4B,CAAC;;IAG1E,OAAO,MAAK;MACVF,OAAO,CAACc,mBAAmB,CAACnB,wBAAgB,EAAEO,QAA4B,CAAC;IAC7E,CAAC;EACH,CAAC,EAAE,CAACA,QAAQ,EAAEF,OAAO,EAAEC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAvCYN,2BAAmB;AAyChC;;;;;AAKO,MAAMoB,sBAAsB,GAAG,CAACC,EAAe,EAAEC,WAAuB,KAAI;EACjFD,EAAE,CAACE,aAAa,CAAC,IAAIC,WAAW,CAACxB,wBAAgB,EAAE;IAAEyB,OAAO,EAAE,IAAI;IAAEC,MAAM,EAAE;MAAEJ;IAAW;EAAE,CAAE,CAAC,CAAC;AACjG,CAAC;AAFYtB,8BAAsB","names":["exports","useOnMenuMouseEnter","options","refs","callback","element","disabled","listener","react_utilities_1","ev","popoverRef","someMenuPopover","target","isOutsidePopover","react_portal_1","current","React","useEffect","addEventListener","removeEventListener","dispatchMenuEnterEvent","el","nativeEvent","dispatchEvent","CustomEvent","bubbles","detail"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/utils/useOnMenuEnter.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { elementContains } from '@fluentui/react-portal';\nimport type { UseOnClickOrScrollOutsideOptions } from '@fluentui/react-utilities';\n\n/**\n * Name of the custom event\n */\nexport const MENU_ENTER_EVENT = 'fuimenuenter';\n\n/**\n * This hook works similarly to @see {useOnClickOutside}\n *\n * Problem: Trying to behave the same as system menus:\n * When the mouse leaves a stack of nested menus the stack should not dismiss.\n * However if the mouse leaves a stack of menus and enters a parent menu all its children menu should dismiss.\n *\n * We don't use the native mouseenter event because it would trigger too many times in the document\n * Instead, dispatch custom DOM event from the menu so that it can bubble\n * Each nested menu can use the listener to check if the event is from a child or parent menu\n */\nexport const useOnMenuMouseEnter = (options: UseOnClickOrScrollOutsideOptions) => {\n const { refs, callback, element, disabled } = options;\n\n // Keep mouse event here because this is essentially a custom 'mouseenter' event\n const listener = useEventCallback((ev: MouseEvent) => {\n const popoverRef = refs[0];\n const someMenuPopover = ev.target as HTMLElement;\n\n // someMenu is a child -> will always be contained because of vParents\n // someMenu is a parent -> will always not be contained because no vParent\n // someMenu is the current popover -> it will contain itself\n const isOutsidePopover = !elementContains(popoverRef.current ?? null, someMenuPopover);\n if (isOutsidePopover && !disabled) {\n callback(ev);\n }\n });\n\n React.useEffect(() => {\n // eslint-disable-next-line eqeqeq\n if (element == null) {\n return;\n }\n\n /**\n * Because `addEventListener` type override falls back to 2nd definition (evt name is unknown string literal)\n * evt is being typed as a base class of MouseEvent -> `Event`.\n * This type is used to override `listener` calls to make TS happy\n */\n\n type ListenerOverride = (evt: Event) => void;\n\n if (!disabled) {\n element.addEventListener(MENU_ENTER_EVENT, listener as ListenerOverride);\n }\n\n return () => {\n element.removeEventListener(MENU_ENTER_EVENT, listener as ListenerOverride);\n };\n }, [listener, element, disabled]);\n};\n\n/**\n * Dispatches the custom MouseEvent enter event. Similar to calling `el.click()`\n * @param el element for the event target\n * @param nativeEvent the native mouse event this is mapped to\n */\nexport const dispatchMenuEnterEvent = (el: HTMLElement, nativeEvent: MouseEvent) => {\n el.dispatchEvent(new CustomEvent(MENU_ENTER_EVENT, { bubbles: true, detail: { nativeEvent } }));\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-menu",
3
- "version": "9.5.3",
3
+ "version": "9.6.0",
4
4
  "description": "Fluent UI menu component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -29,21 +29,21 @@
29
29
  "devDependencies": {
30
30
  "@fluentui/eslint-plugin": "*",
31
31
  "@fluentui/react-conformance": "*",
32
- "@fluentui/react-conformance-griffel": "9.0.0-beta.18",
33
- "@fluentui/scripts": "^1.0.0"
32
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.19",
33
+ "@fluentui/scripts": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-aria": "^9.3.3",
36
+ "@fluentui/react-aria": "^9.3.5",
37
37
  "@fluentui/keyboard-keys": "^9.0.1",
38
- "@fluentui/react-context-selector": "^9.1.3",
38
+ "@fluentui/react-context-selector": "^9.1.5",
39
39
  "@fluentui/react-icons": "^2.0.175",
40
- "@fluentui/react-portal": "^9.0.14",
41
- "@fluentui/react-positioning": "^9.3.5",
40
+ "@fluentui/react-portal": "^9.1.0",
41
+ "@fluentui/react-positioning": "^9.3.7",
42
42
  "@fluentui/react-shared-contexts": "^9.1.4",
43
- "@fluentui/react-tabster": "^9.3.4",
43
+ "@fluentui/react-tabster": "^9.3.6",
44
44
  "@fluentui/react-theme": "^9.1.5",
45
- "@fluentui/react-utilities": "^9.3.0",
46
- "@griffel/react": "^1.4.2",
45
+ "@fluentui/react-utilities": "^9.4.0",
46
+ "@griffel/react": "^1.5.2",
47
47
  "tslib": "^2.1.0"
48
48
  },
49
49
  "peerDependencies": {