@fluentui/react-menu 9.0.0-beta.1 → 9.0.0-beta.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. package/CHANGELOG.json +307 -1
  2. package/CHANGELOG.md +74 -2
  3. package/dist/react-menu.d.ts +34 -7
  4. package/lib/components/Menu/Menu.js +3 -3
  5. package/lib/components/Menu/Menu.js.map +1 -1
  6. package/lib/components/Menu/Menu.types.d.ts +2 -1
  7. package/lib/components/Menu/renderMenu.js +1 -1
  8. package/lib/components/Menu/renderMenu.js.map +1 -1
  9. package/lib/components/Menu/useMenu.js +95 -112
  10. package/lib/components/Menu/useMenu.js.map +1 -1
  11. package/lib/components/Menu/useMenuContextValues.js +34 -32
  12. package/lib/components/Menu/useMenuContextValues.js.map +1 -1
  13. package/lib/components/MenuDivider/MenuDivider.js +2 -2
  14. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  15. package/lib/components/MenuDivider/renderMenuDivider.js +6 -7
  16. package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
  17. package/lib/components/MenuDivider/useMenuDivider.js +6 -7
  18. package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
  19. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -0
  20. package/lib/components/MenuDivider/useMenuDividerStyles.js +5 -4
  21. package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  22. package/lib/components/MenuGroup/MenuGroup.js +5 -3
  23. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  24. package/lib/components/MenuGroup/index.d.ts +1 -0
  25. package/lib/components/MenuGroup/index.js +1 -0
  26. package/lib/components/MenuGroup/index.js.map +1 -1
  27. package/lib/components/MenuGroup/renderMenuGroup.js +6 -7
  28. package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
  29. package/lib/components/MenuGroup/useMenuGroup.js +6 -6
  30. package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
  31. package/lib/components/MenuGroup/useMenuGroupContextValues.js +7 -7
  32. package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  33. package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
  34. package/lib/components/MenuGroup/useMenuGroupStyles.js +7 -0
  35. package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  36. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +2 -2
  37. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  38. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +6 -7
  39. package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  40. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +8 -6
  41. package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  42. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -0
  43. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +5 -4
  44. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  45. package/lib/components/MenuItem/MenuItem.js +2 -2
  46. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  47. package/lib/components/MenuItem/renderMenuItem.js +6 -7
  48. package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
  49. package/lib/components/MenuItem/useCharacterSearch.js +6 -6
  50. package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
  51. package/lib/components/MenuItem/useMenuItem.js +31 -36
  52. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  53. package/lib/components/MenuItem/useMenuItemStyles.d.ts +1 -0
  54. package/lib/components/MenuItem/useMenuItemStyles.js +5 -4
  55. package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
  56. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +4 -4
  57. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  58. package/lib/components/MenuItemCheckbox/index.d.ts +1 -0
  59. package/lib/components/MenuItemCheckbox/index.js +1 -0
  60. package/lib/components/MenuItemCheckbox/index.js.map +1 -1
  61. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +6 -7
  62. package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  63. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +12 -13
  64. package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  65. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
  66. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +4 -1
  67. package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  68. package/lib/components/MenuItemRadio/MenuItemRadio.js +2 -2
  69. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  70. package/lib/components/MenuItemRadio/index.d.ts +1 -0
  71. package/lib/components/MenuItemRadio/index.js +1 -0
  72. package/lib/components/MenuItemRadio/index.js.map +1 -1
  73. package/lib/components/MenuItemRadio/renderMenuItemRadio.js +6 -7
  74. package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  75. package/lib/components/MenuItemRadio/useMenuItemRadio.js +12 -12
  76. package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  77. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -0
  78. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +4 -1
  79. package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  80. package/lib/components/MenuList/MenuList.js +3 -3
  81. package/lib/components/MenuList/MenuList.js.map +1 -1
  82. package/lib/components/MenuList/MenuList.types.d.ts +8 -6
  83. package/lib/components/MenuList/renderMenuList.js +6 -7
  84. package/lib/components/MenuList/renderMenuList.js.map +1 -1
  85. package/lib/components/MenuList/useMenuList.js +66 -86
  86. package/lib/components/MenuList/useMenuList.js.map +1 -1
  87. package/lib/components/MenuList/useMenuListContextValues.js +18 -16
  88. package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
  89. package/lib/components/MenuList/useMenuListStyles.d.ts +1 -0
  90. package/lib/components/MenuList/useMenuListStyles.js +5 -4
  91. package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
  92. package/lib/components/MenuPopover/MenuPopover.js +2 -2
  93. package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
  94. package/lib/components/MenuPopover/renderMenuPopover.js +7 -7
  95. package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
  96. package/lib/components/MenuPopover/useMenuPopover.js +29 -38
  97. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  98. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -0
  99. package/lib/components/MenuPopover/useMenuPopoverStyles.js +7 -6
  100. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  101. package/lib/components/MenuTrigger/MenuTrigger.js +2 -2
  102. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  103. package/lib/components/MenuTrigger/renderMenuTrigger.js +1 -1
  104. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  105. package/lib/components/MenuTrigger/useMenuTrigger.js +3 -4
  106. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  107. package/lib/components/MenuTrigger/useTriggerElement.js +51 -65
  108. package/lib/components/MenuTrigger/useTriggerElement.js.map +1 -1
  109. package/lib/contexts/menuContext.js +5 -11
  110. package/lib/contexts/menuContext.js.map +1 -1
  111. package/lib/contexts/menuGroupContext.js +3 -5
  112. package/lib/contexts/menuGroupContext.js.map +1 -1
  113. package/lib/contexts/menuListContext.js +7 -17
  114. package/lib/contexts/menuListContext.js.map +1 -1
  115. package/lib/contexts/menuTriggerContext.js +3 -5
  116. package/lib/contexts/menuTriggerContext.js.map +1 -1
  117. package/lib/selectable/useCheckmarkStyles.js +3 -3
  118. package/lib/selectable/useCheckmarkStyles.js.map +1 -1
  119. package/lib/utils/useIsSubmenu.js +2 -4
  120. package/lib/utils/useIsSubmenu.js.map +1 -1
  121. package/lib/utils/useOnMenuEnter.js +16 -14
  122. package/lib/utils/useOnMenuEnter.js.map +1 -1
  123. package/lib-commonjs/Menu.js +1 -1
  124. package/lib-commonjs/MenuDivider.js +1 -1
  125. package/lib-commonjs/MenuGroup.js +1 -1
  126. package/lib-commonjs/MenuGroupHeader.js +1 -1
  127. package/lib-commonjs/MenuItem.js +1 -1
  128. package/lib-commonjs/MenuItemCheckbox.js +1 -1
  129. package/lib-commonjs/MenuItemRadio.js +1 -1
  130. package/lib-commonjs/MenuList.js +1 -1
  131. package/lib-commonjs/MenuPopover.js +1 -1
  132. package/lib-commonjs/MenuTrigger.js +1 -1
  133. package/lib-commonjs/components/Menu/Menu.js +6 -6
  134. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  135. package/lib-commonjs/components/Menu/Menu.types.d.ts +2 -1
  136. package/lib-commonjs/components/Menu/index.js +1 -1
  137. package/lib-commonjs/components/Menu/renderMenu.js +3 -3
  138. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  139. package/lib-commonjs/components/Menu/useMenu.js +104 -122
  140. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  141. package/lib-commonjs/components/Menu/useMenuContextValues.js +34 -32
  142. package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
  143. package/lib-commonjs/components/MenuDivider/MenuDivider.js +6 -6
  144. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  145. package/lib-commonjs/components/MenuDivider/index.js +1 -1
  146. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +8 -10
  147. package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
  148. package/lib-commonjs/components/MenuDivider/useMenuDivider.js +7 -9
  149. package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
  150. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -0
  151. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +8 -6
  152. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
  153. package/lib-commonjs/components/MenuGroup/MenuGroup.js +10 -7
  154. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  155. package/lib-commonjs/components/MenuGroup/index.d.ts +1 -0
  156. package/lib-commonjs/components/MenuGroup/index.js +3 -1
  157. package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
  158. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +9 -11
  159. package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
  160. package/lib-commonjs/components/MenuGroup/useMenuGroup.js +7 -8
  161. package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
  162. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +8 -8
  163. package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
  164. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
  165. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +18 -0
  166. package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  167. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +6 -6
  168. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  169. package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
  170. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +8 -10
  171. package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
  172. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +10 -9
  173. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
  174. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -0
  175. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +8 -6
  176. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
  177. package/lib-commonjs/components/MenuItem/MenuItem.js +7 -7
  178. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  179. package/lib-commonjs/components/MenuItem/index.js +1 -1
  180. package/lib-commonjs/components/MenuItem/renderMenuItem.js +9 -11
  181. package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
  182. package/lib-commonjs/components/MenuItem/useCharacterSearch.js +7 -7
  183. package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
  184. package/lib-commonjs/components/MenuItem/useMenuItem.js +38 -44
  185. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  186. package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +1 -0
  187. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +9 -7
  188. package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
  189. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +7 -7
  190. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  191. package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +1 -0
  192. package/lib-commonjs/components/MenuItemCheckbox/index.js +3 -1
  193. package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
  194. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +9 -11
  195. package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
  196. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +17 -19
  197. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
  198. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
  199. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +10 -5
  200. package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
  201. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +6 -6
  202. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  203. package/lib-commonjs/components/MenuItemRadio/index.d.ts +1 -0
  204. package/lib-commonjs/components/MenuItemRadio/index.js +3 -1
  205. package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
  206. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +9 -11
  207. package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
  208. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +17 -18
  209. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
  210. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -0
  211. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +9 -4
  212. package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
  213. package/lib-commonjs/components/MenuList/MenuList.js +8 -8
  214. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  215. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +8 -6
  216. package/lib-commonjs/components/MenuList/index.js +1 -1
  217. package/lib-commonjs/components/MenuList/renderMenuList.js +9 -11
  218. package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
  219. package/lib-commonjs/components/MenuList/useMenuList.js +72 -93
  220. package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
  221. package/lib-commonjs/components/MenuList/useMenuListContextValues.js +18 -16
  222. package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
  223. package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +1 -0
  224. package/lib-commonjs/components/MenuList/useMenuListStyles.js +8 -6
  225. package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
  226. package/lib-commonjs/components/MenuPopover/MenuPopover.js +6 -6
  227. package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
  228. package/lib-commonjs/components/MenuPopover/index.js +1 -1
  229. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +10 -11
  230. package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
  231. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +36 -46
  232. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  233. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -0
  234. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +10 -8
  235. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  236. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +4 -4
  237. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  238. package/lib-commonjs/components/MenuTrigger/index.js +1 -1
  239. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +3 -3
  240. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  241. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +4 -6
  242. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  243. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +58 -73
  244. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +1 -1
  245. package/lib-commonjs/components/index.js +1 -1
  246. package/lib-commonjs/contexts/menuContext.js +4 -10
  247. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  248. package/lib-commonjs/contexts/menuGroupContext.js +3 -5
  249. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  250. package/lib-commonjs/contexts/menuListContext.js +6 -16
  251. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  252. package/lib-commonjs/contexts/menuTriggerContext.js +3 -5
  253. package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
  254. package/lib-commonjs/index.js +1 -1
  255. package/lib-commonjs/selectable/index.js +1 -1
  256. package/lib-commonjs/selectable/useCheckmarkStyles.js +4 -4
  257. package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
  258. package/lib-commonjs/utils/index.js +1 -1
  259. package/lib-commonjs/utils/useIsSubmenu.js +5 -7
  260. package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
  261. package/lib-commonjs/utils/useOnMenuEnter.js +18 -16
  262. package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
  263. package/package.json +15 -15
  264. package/lib/common/isConformant.d.ts +0 -4
  265. package/lib/common/isConformant.js +0 -12
  266. package/lib/common/isConformant.js.map +0 -1
  267. package/lib/common/mockUseMenuContext.d.ts +0 -7
  268. package/lib/common/mockUseMenuContext.js +0 -36
  269. package/lib/common/mockUseMenuContext.js.map +0 -1
  270. package/lib/utils/DefaultIcons.d.ts +0 -7
  271. package/lib/utils/DefaultIcons.js +0 -88
  272. package/lib/utils/DefaultIcons.js.map +0 -1
  273. package/lib-commonjs/common/isConformant.d.ts +0 -4
  274. package/lib-commonjs/common/isConformant.js +0 -23
  275. package/lib-commonjs/common/isConformant.js.map +0 -1
  276. package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
  277. package/lib-commonjs/common/mockUseMenuContext.js +0 -47
  278. package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
  279. package/lib-commonjs/utils/DefaultIcons.d.ts +0 -7
  280. package/lib-commonjs/utils/DefaultIcons.js +0 -100
  281. package/lib-commonjs/utils/DefaultIcons.js.map +0 -1
@@ -5,48 +5,47 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useMenuItemRadio = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
 
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
12
+ const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
13
13
 
14
- var react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
14
+ const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
15
15
 
16
- var menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
17
-
18
- var useMenuItem_1 = /*#__PURE__*/require("../MenuItem/useMenuItem");
16
+ const useMenuItem_1 = /*#__PURE__*/require("../MenuItem/useMenuItem");
19
17
  /**
20
18
  * Given user props, returns state and render function for a MenuItemRadio.
21
19
  */
22
20
 
23
21
 
24
- var useMenuItemRadio = function (props, ref) {
25
- var radioProps = {
22
+ const useMenuItemRadio = (props, ref) => {
23
+ const radioProps = {
26
24
  role: 'menuitemradio'
27
25
  };
28
- var state = useMenuItem_1.useMenuItem(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, radioProps), props), {
26
+ const state = useMenuItem_1.useMenuItem({ ...radioProps,
27
+ ...props,
29
28
  checkmark: react_utilities_1.resolveShorthand(props.checkmark, {
30
29
  defaultProps: {
31
30
  children: React.createElement(react_icons_1.Checkmark16Filled, null)
32
31
  },
33
32
  required: true
34
33
  })
35
- }), ref);
36
- var selectRadio = menuListContext_1.useMenuListContext(function (context) {
37
- return context.selectRadio;
38
- });
39
- var onClickOriginal = state.root.onClick;
40
- var checked = menuListContext_1.useMenuListContext(function (context) {
34
+ }, ref);
35
+ const selectRadio = menuListContext_1.useMenuListContext(context => context.selectRadio);
36
+ const {
37
+ onClick: onClickOriginal
38
+ } = state.root;
39
+ const checked = menuListContext_1.useMenuListContext(context => {
41
40
  var _a;
42
41
 
43
- var checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[state.name]) || [];
42
+ const checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[state.name]) || [];
44
43
  return checkedItems.indexOf(state.value) !== -1;
45
44
  });
46
45
  state.checked = checked;
47
46
  state.root['aria-checked'] = state.checked; // MenuItem state already transforms keyDown to click events
48
47
 
49
- state.root.onClick = function (e) {
48
+ state.root.onClick = e => {
50
49
  if (state.disabled) {
51
50
  e.preventDefault();
52
51
  e.stopPropagation();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuIt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ACA;AACD;;AAED,IAAA,WAAW,KAAA,IAAX,IAAA,WAAW,KAAA,KAAA,CAAX,GAAW,KAAA,CAAX,GAAA,WAAW,CAAG,CAAH,EAAM,KAAK,CAAC,IAAZ,EAAkB,KAAK,CAAC,KAAxB,EAA+B,KAAK,CAAC,OAArC,CAAX;AACA,IAAA,eAAe,KAAA,IAAf,IAAA,eAAe,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAA,eAAe,CAAG,CAAH,CAAf;AACD,GATD;;AAWA,SAAO,KAAP;AACD,CAxCM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","sourceRoot":""}
@@ -1,2 +1,3 @@
1
1
  import type { MenuItemRadioState } from './MenuItemRadio.types';
2
+ export declare const menuItemRadioClassName = "fui-MenuItemRadio";
2
3
  export declare const useMenuItemRadioStyles: (state: MenuItemRadioState) => void;
@@ -3,13 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuItemRadioStyles = void 0;
6
+ exports.useMenuItemRadioStyles = exports.menuItemRadioClassName = void 0;
7
7
 
8
- var index_1 = /*#__PURE__*/require("../../selectable/index");
8
+ const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
9
9
 
10
- var useMenuItemStyles_1 = /*#__PURE__*/require("../MenuItem/useMenuItemStyles");
10
+ const index_1 = /*#__PURE__*/require("../../selectable/index");
11
11
 
12
- var useMenuItemRadioStyles = function (state) {
12
+ const useMenuItemStyles_1 = /*#__PURE__*/require("../MenuItem/useMenuItemStyles");
13
+
14
+ exports.menuItemRadioClassName = 'fui-MenuItemRadio';
15
+
16
+ const useMenuItemRadioStyles = state => {
17
+ state.root.className = react_make_styles_1.mergeClasses(exports.menuItemRadioClassName, state.root.className);
13
18
  useMenuItemStyles_1.useMenuItemStyles(state);
14
19
  index_1.useCheckmarkStyles(state);
15
20
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadioStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,+BAAA,CAAA;;AAGO,IAAM,sBAAsB,GAAG,UAAC,KAAD,EAA0B;AAC9D,EAAA,mBAAA,CAAA,iBAAA,CAAkB,KAAlB;AACA,EAAA,OAAA,CAAA,kBAAA,CAAmB,KAAnB;AACD,CAHM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadioStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,+BAAA,CAAA;;AAGa,OAAA,CAAA,sBAAA,GAAyB,mBAAzB;;AAEN,MAAM,sBAAsB,GAAI,KAAD,IAA8B;AAClE,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,OAAA,CAAA,sBAAb,EAAqC,KAAK,CAAC,IAAN,CAAW,SAAhD,CAAvB;AAEA,EAAA,mBAAA,CAAA,iBAAA,CAAkB,KAAlB;AACA,EAAA,OAAA,CAAA,kBAAA,CAAmB,KAAnB;AACD,CALM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourceRoot":""}
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.MenuList = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var useMenuList_1 = /*#__PURE__*/require("./useMenuList");
10
+ const useMenuList_1 = /*#__PURE__*/require("./useMenuList");
11
11
 
12
- var renderMenuList_1 = /*#__PURE__*/require("./renderMenuList");
12
+ const renderMenuList_1 = /*#__PURE__*/require("./renderMenuList");
13
13
 
14
- var useMenuListContextValues_1 = /*#__PURE__*/require("./useMenuListContextValues");
14
+ const useMenuListContextValues_1 = /*#__PURE__*/require("./useMenuListContextValues");
15
15
 
16
- var useMenuListStyles_1 = /*#__PURE__*/require("./useMenuListStyles");
16
+ const useMenuListStyles_1 = /*#__PURE__*/require("./useMenuListStyles");
17
17
  /**
18
18
  * Define a styled MenuList, using the `useMenuList` hook.
19
19
  */
20
20
 
21
21
 
22
- exports.MenuList = /*#__PURE__*/React.forwardRef(function (props, ref) {
23
- var state = useMenuList_1.useMenuList(props, ref);
24
- var contextValues = useMenuListContextValues_1.useMenuListContextValues(state);
22
+ exports.MenuList = /*#__PURE__*/React.forwardRef((props, ref) => {
23
+ const state = useMenuList_1.useMenuList(props, ref);
24
+ const contextValues = useMenuListContextValues_1.useMenuListContextValues(state);
25
25
  useMenuListStyles_1.useMenuListStyles(state);
26
26
  return renderMenuList_1.renderMenuList(state, contextValues);
27
27
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/MenuList.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,IAAA,0BAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,QAAA,gBAA+C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AACtF,MAAM,KAAK,GAAG,aAAA,CAAA,WAAA,CAAY,KAAZ,EAAmB,GAAnB,CAAd;AACA,MAAM,aAAa,GAAG,0BAAA,CAAA,wBAAA,CAAyB,KAAzB,CAAtB;AACA,EAAA,mBAAA,CAAA,iBAAA,CAAkB,KAAlB;AAEA,SAAO,gBAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,aAAtB,CAAP;AACD,CAN2D,CAA/C;AAQb,OAAA,CAAA,QAAA,CAAS,WAAT,GAAuB,UAAvB","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuList/MenuList.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,0BAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,QAAA,gBAA+C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC1F,QAAM,KAAK,GAAG,aAAA,CAAA,WAAA,CAAY,KAAZ,EAAmB,GAAnB,CAAd;AACA,QAAM,aAAa,GAAG,0BAAA,CAAA,wBAAA,CAAyB,KAAzB,CAAtB;AACA,EAAA,mBAAA,CAAA,iBAAA,CAAkB,KAAlB;AAEA,SAAO,gBAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,aAAtB,CAAP;AACD,CAN2D,CAA/C;AAQb,OAAA,CAAA,QAAA,CAAS,WAAT,GAAuB,UAAvB","sourceRoot":""}
@@ -2,6 +2,13 @@ import * as React from 'react';
2
2
  import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
3
3
  import { MenuListContextValue } from '../../contexts/menuListContext';
4
4
  import { SelectableHandler } from '../../selectable/index';
5
+ export declare type MenuCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;
6
+ export declare type MenuCheckedValueChangeData = {
7
+ /** The name of the value */
8
+ name: string;
9
+ /** The items for this value that are checked */
10
+ checkedItems: string[];
11
+ };
5
12
  export declare type MenuListCommons = {
6
13
  /**
7
14
  * Callback when checked items change for value with a name
@@ -9,12 +16,7 @@ export declare type MenuListCommons = {
9
16
  * @param event - React's original SyntheticEvent
10
17
  * @param data - A data object with relevant information
11
18
  */
12
- onCheckedValueChange?: (e: React.MouseEvent | React.KeyboardEvent, data: {
13
- /** The name of the value */
14
- name: string;
15
- /** The items for this value that are checked */
16
- checkedItems: string[];
17
- }) => void;
19
+ onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;
18
20
  /**
19
21
  * Map of all checked values
20
22
  */
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./MenuList"), exports);
10
10
 
@@ -5,26 +5,24 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.renderMenuList = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
 
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
-
14
- var menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
12
+ const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
15
13
  /**
16
14
  * Function that renders the final JSX of the component
17
15
  */
18
16
 
19
17
 
20
- var renderMenuList = function (state, contextValues) {
21
- var _a = react_utilities_1.getSlots(state),
22
- slots = _a.slots,
23
- slotProps = _a.slotProps;
24
-
18
+ const renderMenuList = (state, contextValues) => {
19
+ const {
20
+ slots,
21
+ slotProps
22
+ } = react_utilities_1.getSlots(state);
25
23
  return React.createElement(menuListContext_1.MenuListProvider, {
26
24
  value: contextValues.menuList
27
- }, React.createElement(slots.root, tslib_1.__assign({}, slotProps.root)));
25
+ }, React.createElement(slots.root, Object.assign({}, slotProps.root)));
28
26
  };
29
27
 
30
28
  exports.renderMenuList = renderMenuList;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/renderMenuList.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,IAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;AAEA;;AAEG;;;AACI,IAAM,cAAc,GAAG,UAAC,KAAD,EAAuB,aAAvB,EAA2D;AACjF,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,SACE,KAAA,CAAA,aAAA,CAAC,iBAAA,CAAA,gBAAD,EAAiB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAjB,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuList/renderMenuList.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,iBAAA,gBAAA,OAAA,CAAA,gCAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,cAAc,GAAG,CAAC,KAAD,EAAuB,aAAvB,KAA+D;AAC3F,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,iBAAA,CAAA,gBAAD,EAAiB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAjB,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","sourceRoot":""}
@@ -5,31 +5,31 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useMenuList = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
 
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
12
+ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
13
13
 
14
- var react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
14
+ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
15
15
 
16
- var react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
16
+ const menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
17
17
 
18
- var menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
19
-
20
- var menuContext_2 = /*#__PURE__*/require("../../contexts/menuContext");
18
+ const menuContext_2 = /*#__PURE__*/require("../../contexts/menuContext");
21
19
  /**
22
20
  * Returns the props and state required to render the component
23
21
  */
24
22
 
25
23
 
26
- var useMenuList = function (props, ref) {
27
- var focusAttributes = react_tabster_1.useArrowNavigationGroup({
24
+ const useMenuList = (props, ref) => {
25
+ const focusAttributes = react_tabster_1.useArrowNavigationGroup({
28
26
  circular: true
29
27
  });
30
- var findAllFocusable = react_tabster_1.useFocusFinders().findAllFocusable;
31
- var menuContext = useMenuContextSelectors();
32
- var hasMenuContext = react_context_selector_1.useHasParentContext(menuContext_2.MenuContext);
28
+ const {
29
+ findAllFocusable
30
+ } = react_tabster_1.useFocusFinders();
31
+ const menuContext = useMenuContextSelectors();
32
+ const hasMenuContext = react_context_selector_1.useHasParentContext(menuContext_2.MenuContext);
33
33
 
34
34
  if (usingPropsAndMenuContext(props, menuContext, hasMenuContext)) {
35
35
  // TODO throw warnings in development safely
@@ -37,44 +37,44 @@ var useMenuList = function (props, ref) {
37
37
  console.warn('You are using both MenuList and Menu props, we recommend you to use Menu props when available');
38
38
  }
39
39
 
40
- var innerRef = React.useRef(null);
41
-
42
- var initialState = tslib_1.__assign(tslib_1.__assign({
43
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign({
40
+ const innerRef = React.useRef(null);
41
+ const initialState = {
42
+ root: react_utilities_1.getNativeElementProps('div', {
44
43
  ref: react_utilities_1.useMergedRefs(ref, innerRef),
45
44
  role: 'menu',
46
- 'aria-labelledby': menuContext.triggerId
47
- }, focusAttributes), props)),
45
+ 'aria-labelledby': menuContext.triggerId,
46
+ ...focusAttributes,
47
+ ...props
48
+ }),
48
49
  hasIcons: menuContext.hasIcons,
49
- hasCheckmarks: menuContext.hasCheckmarks
50
- }, hasMenuContext && menuContext), props);
51
-
52
- var setFocusByFirstCharacter = React.useCallback(function (e, itemEl) {
50
+ hasCheckmarks: menuContext.hasCheckmarks,
51
+ ...(hasMenuContext && menuContext),
52
+ ...props
53
+ };
54
+ const setFocusByFirstCharacter = React.useCallback((e, itemEl) => {
53
55
  // TODO use some kind of children registration to reduce dependency on DOM roles
54
- var acceptedRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];
56
+ const acceptedRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];
55
57
 
56
58
  if (!innerRef.current) {
57
59
  return;
58
60
  }
59
61
 
60
- var menuItems = findAllFocusable(innerRef.current, function (el) {
61
- return el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')) !== -1;
62
- });
63
- var startIndex = menuItems.indexOf(itemEl) + 1;
62
+ const menuItems = findAllFocusable(innerRef.current, el => el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')) !== -1);
63
+ let startIndex = menuItems.indexOf(itemEl) + 1;
64
64
 
65
65
  if (startIndex === menuItems.length) {
66
66
  startIndex = 0;
67
67
  }
68
68
 
69
- var firstChars = menuItems.map(function (menuItem) {
69
+ const firstChars = menuItems.map(menuItem => {
70
70
  var _a;
71
71
 
72
72
  return (_a = menuItem.textContent) === null || _a === void 0 ? void 0 : _a.charAt(0).toLowerCase();
73
73
  });
74
- var char = e.key.toLowerCase();
74
+ const char = e.key.toLowerCase();
75
75
 
76
- var getIndexFirstChars = function (start, firstChar) {
77
- for (var i = start; i < firstChars.length; i++) {
76
+ const getIndexFirstChars = (start, firstChar) => {
77
+ for (let i = start; i < firstChars.length; i++) {
78
78
  if (char === firstChars[i]) {
79
79
  return i;
80
80
  }
@@ -84,7 +84,7 @@ var useMenuList = function (props, ref) {
84
84
  }; // Check remaining slots in the menu
85
85
 
86
86
 
87
- var index = getIndexFirstChars(startIndex, char); // If not found in remaining slots, check from beginning
87
+ let index = getIndexFirstChars(startIndex, char); // If not found in remaining slots, check from beginning
88
88
 
89
89
  if (index === -1) {
90
90
  index = getIndexFirstChars(0, char);
@@ -95,20 +95,17 @@ var useMenuList = function (props, ref) {
95
95
  menuItems[index].focus();
96
96
  }
97
97
  }, [findAllFocusable]);
98
-
99
- var _a = react_utilities_1.useControllableState({
98
+ const [checkedValues, setCheckedValues] = react_utilities_1.useControllableState({
100
99
  state: initialState.checkedValues,
101
100
  defaultState: initialState.defaultCheckedValues,
102
101
  initialState: {}
103
- }),
104
- checkedValues = _a[0],
105
- setCheckedValues = _a[1];
106
-
107
- var onCheckedValueChange = initialState.onCheckedValueChange;
108
- var toggleCheckbox = react_utilities_1.useEventCallback(function (e, name, value, checked) {
109
- var checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];
110
-
111
- var newCheckedItems = tslib_1.__spreadArrays(checkedItems);
102
+ });
103
+ const {
104
+ onCheckedValueChange
105
+ } = initialState;
106
+ const toggleCheckbox = react_utilities_1.useEventCallback((e, name, value, checked) => {
107
+ const checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];
108
+ const newCheckedItems = [...checkedItems];
112
109
 
113
110
  if (checked) {
114
111
  newCheckedItems.splice(newCheckedItems.indexOf(value), 1);
@@ -117,35 +114,29 @@ var useMenuList = function (props, ref) {
117
114
  }
118
115
 
119
116
  onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {
120
- name: name,
117
+ name,
121
118
  checkedItems: newCheckedItems
122
119
  });
123
- setCheckedValues(function (s) {
124
- var _a;
125
-
126
- return tslib_1.__assign(tslib_1.__assign({}, s), (_a = {}, _a[name] = newCheckedItems, _a));
127
- });
120
+ setCheckedValues(s => ({ ...s,
121
+ [name]: newCheckedItems
122
+ }));
128
123
  });
129
- var selectRadio = react_utilities_1.useEventCallback(function (e, name, value) {
130
- var newCheckedItems = [value];
131
- setCheckedValues(function (s) {
132
- var _a;
133
-
134
- return tslib_1.__assign(tslib_1.__assign({}, s), (_a = {}, _a[name] = newCheckedItems, _a));
135
- });
124
+ const selectRadio = react_utilities_1.useEventCallback((e, name, value) => {
125
+ const newCheckedItems = [value];
126
+ setCheckedValues(s => ({ ...s,
127
+ [name]: newCheckedItems
128
+ }));
136
129
  onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {
137
- name: name,
130
+ name,
138
131
  checkedItems: newCheckedItems
139
132
  });
140
133
  });
141
-
142
- var state = tslib_1.__assign(tslib_1.__assign({}, initialState), {
143
- setFocusByFirstCharacter: setFocusByFirstCharacter,
144
- selectRadio: selectRadio,
145
- toggleCheckbox: toggleCheckbox,
134
+ const state = { ...initialState,
135
+ setFocusByFirstCharacter,
136
+ selectRadio,
137
+ toggleCheckbox,
146
138
  checkedValues: checkedValues !== null && checkedValues !== void 0 ? checkedValues : {}
147
- });
148
-
139
+ };
149
140
  return state;
150
141
  };
151
142
 
@@ -154,32 +145,20 @@ exports.useMenuList = useMenuList;
154
145
  * Adds some sugar to fetching multiple context selector values
155
146
  */
156
147
 
157
- var useMenuContextSelectors = function () {
158
- var checkedValues = menuContext_1.useMenuContext(function (context) {
159
- return context.checkedValues;
160
- });
161
- var onCheckedValueChange = menuContext_1.useMenuContext(function (context) {
162
- return context.onCheckedValueChange;
163
- });
164
- var defaultCheckedValues = menuContext_1.useMenuContext(function (context) {
165
- return context.defaultCheckedValues;
166
- });
167
- var triggerId = menuContext_1.useMenuContext(function (context) {
168
- return context.triggerId;
169
- });
170
- var hasIcons = menuContext_1.useMenuContext(function (context) {
171
- return context.hasIcons;
172
- });
173
- var hasCheckmarks = menuContext_1.useMenuContext(function (context) {
174
- return context.hasCheckmarks;
175
- });
148
+ const useMenuContextSelectors = () => {
149
+ const checkedValues = menuContext_1.useMenuContext(context => context.checkedValues);
150
+ const onCheckedValueChange = menuContext_1.useMenuContext(context => context.onCheckedValueChange);
151
+ const defaultCheckedValues = menuContext_1.useMenuContext(context => context.defaultCheckedValues);
152
+ const triggerId = menuContext_1.useMenuContext(context => context.triggerId);
153
+ const hasIcons = menuContext_1.useMenuContext(context => context.hasIcons);
154
+ const hasCheckmarks = menuContext_1.useMenuContext(context => context.hasCheckmarks);
176
155
  return {
177
- checkedValues: checkedValues,
178
- onCheckedValueChange: onCheckedValueChange,
179
- defaultCheckedValues: defaultCheckedValues,
180
- triggerId: triggerId,
181
- hasIcons: hasIcons,
182
- hasCheckmarks: hasCheckmarks
156
+ checkedValues,
157
+ onCheckedValueChange,
158
+ defaultCheckedValues,
159
+ triggerId,
160
+ hasIcons,
161
+ hasCheckmarks
183
162
  };
184
163
  };
185
164
  /**
@@ -187,10 +166,10 @@ var useMenuContextSelectors = function () {
187
166
  */
188
167
 
189
168
 
190
- var usingPropsAndMenuContext = function (props, contextValue, hasMenuContext) {
191
- var isUsingPropsAndContext = false;
169
+ const usingPropsAndMenuContext = (props, contextValue, hasMenuContext) => {
170
+ let isUsingPropsAndContext = false;
192
171
 
193
- for (var val in contextValue) {
172
+ for (const val in contextValue) {
194
173
  if (props[val]) {
195
174
  isUsingPropsAndContext = true;
196
175
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/useMenuList.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAMA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,WAAW,GAAG,UAAC,KAAD,EAAuB,GAAvB,EAAkD;AAC3E,MAAM,eAAe,GAAG,eAAA,CAAA,uBAAA,CAAwB;AAAE,IAAA,QAAQ,EAAE;AAAZ,GAAxB,CAAxB;AACQ,MAAA,gBAAgB,GAAK,eAAA,CAAA,eAAA,GAAL,gBAAhB;AACR,MAAM,WAAW,GAAG,uBAAuB,EAA3C;AACA,MAAM,cAAc,GAAG,wBAAA,CAAA,mBAAA,CAAoB,aAAA,CAAA,WAApB,CAAvB;;AAEA,MAAI,wBAAwB,CAAC,KAAD,EAAQ,WAAR,EAAqB,cAArB,CAA5B,EAAkE;AAChE;AACA;AACA,IAAA,OAAO,CAAC,IAAR,CAAa,+FAAb;AACD;;AAED,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAN,CAA0B,IAA1B,CAAjB;;AACA,MAAM,YAAY,GAAA,OAAA,CAAA,QAAA,CAAA,OAAA,CAAA,Q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,EAE/B,YAF+B,EAG/B,cAH+B,KAI7B;AACF,MAAI,sBAAsB,GAAG,KAA7B;;AACA,OAAK,MAAM,GAAX,IAAkB,YAAlB,EAAgC;AAC9B,QAAI,KAAK,CAAC,GAAD,CAAT,EAA4G;AAC1G,MAAA,sBAAsB,GAAG,IAAzB;AACD;AACF;;AAED,SAAO,cAAc,IAAI,sBAAzB;AACD,CAbD","sourceRoot":""}
@@ -6,25 +6,27 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useMenuListContextValues = void 0;
7
7
 
8
8
  function useMenuListContextValues(state) {
9
- var onCheckedValueChange = state.onCheckedValueChange,
10
- checkedValues = state.checkedValues,
11
- toggleCheckbox = state.toggleCheckbox,
12
- selectRadio = state.selectRadio,
13
- setFocusByFirstCharacter = state.setFocusByFirstCharacter,
14
- hasIcons = state.hasIcons,
15
- hasCheckmarks = state.hasCheckmarks; // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
9
+ const {
10
+ onCheckedValueChange,
11
+ checkedValues,
12
+ toggleCheckbox,
13
+ selectRadio,
14
+ setFocusByFirstCharacter,
15
+ hasIcons,
16
+ hasCheckmarks
17
+ } = state; // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
16
18
 
17
- var menuList = {
18
- onCheckedValueChange: onCheckedValueChange,
19
- checkedValues: checkedValues,
20
- toggleCheckbox: toggleCheckbox,
21
- selectRadio: selectRadio,
22
- setFocusByFirstCharacter: setFocusByFirstCharacter,
23
- hasIcons: hasIcons,
24
- hasCheckmarks: hasCheckmarks
19
+ const menuList = {
20
+ onCheckedValueChange,
21
+ checkedValues,
22
+ toggleCheckbox,
23
+ selectRadio,
24
+ setFocusByFirstCharacter,
25
+ hasIcons,
26
+ hasCheckmarks
25
27
  };
26
28
  return {
27
- menuList: menuList
29
+ menuList
28
30
  };
29
31
  }
30
32
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/useMenuListContextValues.ts"],"names":[],"mappings":";;;;;;;AAEA,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ceRoot":""}
@@ -1,4 +1,5 @@
1
1
  import type { MenuListState } from './MenuList.types';
2
+ export declare const menuListClassName = "fui-MenuList";
2
3
  /**
3
4
  * Apply styling to the Menu slots based on the state
4
5
  */
@@ -3,11 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useMenuListStyles = void 0;
6
+ exports.useMenuListStyles = exports.menuListClassName = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
9
9
 
10
- var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
10
+ exports.menuListClassName = 'fui-MenuList';
11
+
12
+ const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
11
13
  "root": {
12
14
  "mc9l5x": "f22iagw",
13
15
  "Beiy3e4": "f1vx9l62",
@@ -21,9 +23,9 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
21
23
  */
22
24
 
23
25
 
24
- var useMenuListStyles = function (state) {
25
- var styles = useStyles();
26
- state.root.className = react_make_styles_1.mergeClasses(styles.root, state.root.className);
26
+ const useMenuListStyles = state => {
27
+ const styles = useStyles();
28
+ state.root.className = react_make_styles_1.mergeClasses(exports.menuListClassName, styles.root, state.root.className);
27
29
  return state;
28
30
  };
29
31
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuList/useMenuListStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGA,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAQA;;AAEG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAqB;AACpD,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,MAAM,CAAC,IAApB,EAA0B,KAAK,CAAC,IAAN,CAAW,SAArC,CAAvB;AACA,SAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/MenuList/useMenuListStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGa,OAAA,CAAA,iBAAA,GAAoB,cAApB;;AAEb,MAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAQA;;AAEG;;;AACI,MAAM,iBAAiB,GAAI,KAAD,IAAwC;AACvE,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,OAAA,CAAA,iBAAb,EAAgC,MAAM,CAAC,IAAvC,EAA6C,KAAK,CAAC,IAAN,CAAW,SAAxD,CAAvB;AACA,SAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}