@fluentui/react-menu 9.12.11 → 9.12.12
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +82 -1
- package/CHANGELOG.md +22 -2
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.js +13 -11
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.js +1 -1
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +2 -2
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +5 -4
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -2
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/renderMenuItem.js +10 -2
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js +5 -4
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.js +8 -8
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +9 -2
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +4 -4
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemLink/MenuItemLink.js.map +1 -1
- package/lib/components/MenuItemLink/renderMenuItemLink.js +9 -2
- package/lib/components/MenuItemLink/renderMenuItemLink.js.map +1 -1
- package/lib/components/MenuItemLink/useMenuItemLink.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +9 -2
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +4 -4
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/renderMenuList.js +5 -4
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.js +6 -4
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +6 -5
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js +6 -4
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -2
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +8 -6
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js +15 -13
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.js.map +1 -1
- package/lib/utils/useIsSubmenu.js.map +1 -1
- package/lib/utils/useOnMenuEnter.js +1 -1
- package/lib/utils/useOnMenuEnter.js.map +1 -1
- package/lib-commonjs/Menu.js +2 -2
- package/lib-commonjs/Menu.js.map +1 -1
- package/lib-commonjs/MenuDivider.js +2 -2
- package/lib-commonjs/MenuDivider.js.map +1 -1
- package/lib-commonjs/MenuGroup.js +2 -2
- package/lib-commonjs/MenuGroup.js.map +1 -1
- package/lib-commonjs/MenuGroupHeader.js +2 -2
- package/lib-commonjs/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/MenuItem.js +2 -2
- package/lib-commonjs/MenuItem.js.map +1 -1
- package/lib-commonjs/MenuItemCheckbox.js +2 -2
- package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/MenuItemLink.js +2 -2
- package/lib-commonjs/MenuItemLink.js.map +1 -1
- package/lib-commonjs/MenuItemRadio.js +2 -2
- package/lib-commonjs/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/MenuList.js +2 -2
- package/lib-commonjs/MenuList.js.map +1 -1
- package/lib-commonjs/MenuPopover.js +2 -2
- package/lib-commonjs/MenuPopover.js.map +1 -1
- package/lib-commonjs/MenuSplitGroup.js +2 -2
- package/lib-commonjs/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/MenuTrigger.js +2 -2
- package/lib-commonjs/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.js +5 -3
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.types.js +2 -2
- package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
- package/lib-commonjs/components/Menu/index.js +6 -6
- package/lib-commonjs/components/Menu/index.js.map +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js +5 -3
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.js +35 -31
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +4 -2
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +9 -7
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/index.js +6 -6
- package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +8 -6
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js +7 -5
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js +7 -3
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +9 -7
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/index.js +7 -7
- package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +11 -8
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js +8 -6
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +6 -4
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js +6 -2
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +9 -7
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/index.js +6 -6
- package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +8 -6
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +8 -6
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js +7 -3
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js +9 -7
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/index.js +6 -6
- package/lib-commonjs/components/MenuItem/index.js.map +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +16 -6
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js +10 -7
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.js +31 -29
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js +7 -3
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +9 -7
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js +6 -6
- package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +15 -6
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +13 -11
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js +8 -4
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuItemLink/MenuItemLink.js +7 -5
- package/lib-commonjs/components/MenuItemLink/MenuItemLink.js.map +1 -1
- package/lib-commonjs/components/MenuItemLink/index.js +6 -6
- package/lib-commonjs/components/MenuItemLink/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemLink/renderMenuItemLink.js +15 -6
- package/lib-commonjs/components/MenuItemLink/renderMenuItemLink.js.map +1 -1
- package/lib-commonjs/components/MenuItemLink/useMenuItemLink.js +7 -5
- package/lib-commonjs/components/MenuItemLink/useMenuItemLink.js.map +1 -1
- package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.js +9 -5
- package/lib-commonjs/components/MenuItemLink/useMenuItemLinkStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +9 -7
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/index.js +6 -6
- package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +15 -6
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +13 -11
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js +8 -4
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js +9 -7
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.js +2 -2
- package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
- package/lib-commonjs/components/MenuList/index.js +7 -7
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js +11 -8
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +21 -17
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +4 -2
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js +7 -3
- package/lib-commonjs/components/MenuList/useMenuListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +9 -7
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/index.js +6 -6
- package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +13 -10
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +23 -19
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js +7 -3
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +9 -7
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/index.js +6 -6
- package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +8 -6
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +21 -17
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js +7 -3
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +5 -3
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js +2 -2
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/index.js +5 -5
- package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +5 -3
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +33 -29
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/index.js +3 -3
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/contexts/menuContext.js +14 -8
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +8 -4
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.js +14 -8
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +8 -4
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.js +225 -83
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/selectable/index.js +3 -3
- package/lib-commonjs/selectable/index.js.map +1 -1
- package/lib-commonjs/selectable/types.js +2 -2
- package/lib-commonjs/selectable/types.js.map +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.styles.js +4 -2
- package/lib-commonjs/selectable/useCheckmarkStyles.styles.js.map +1 -1
- package/lib-commonjs/utils/index.js +2 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js +5 -3
- package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
- package/lib-commonjs/utils/useOnMenuEnter.js +16 -10
- package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
- package/package.json +16 -16
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
});
|
5
5
|
Object.defineProperty(exports, "renderMenuTrigger_unstable", {
|
6
6
|
enumerable: true,
|
7
|
-
get: ()
|
7
|
+
get: function() {
|
8
|
+
return renderMenuTrigger_unstable;
|
9
|
+
}
|
8
10
|
});
|
9
|
-
const
|
10
|
-
const _react = /*#__PURE__*/
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
11
13
|
const _menuTriggerContext = require("../../contexts/menuTriggerContext");
|
12
14
|
const renderMenuTrigger_unstable = (state)=>{
|
13
15
|
return /*#__PURE__*/ _react.createElement(_menuTriggerContext.MenuTriggerContextProvider, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["renderMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */ export const renderMenuTrigger_unstable = (state)=>{\n return /*#__PURE__*/ React.createElement(MenuTriggerContextProvider, {\n value: state.isSubmenu\n }, state.children);\n};\n"],"names":["renderMenuTrigger_unstable","state","React","createElement","MenuTriggerContextProvider","value","isSubmenu","children"],"mappings":";;;;+BAMiBA
|
1
|
+
{"version":3,"sources":["renderMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */ export const renderMenuTrigger_unstable = (state)=>{\n return /*#__PURE__*/ React.createElement(MenuTriggerContextProvider, {\n value: state.isSubmenu\n }, state.children);\n};\n"],"names":["renderMenuTrigger_unstable","state","React","createElement","MenuTriggerContextProvider","value","isSubmenu","children"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;iEANM;oCACoB;AAKhC,MAAMA,6BAA6B,CAACC;IAC3C,OAAO,WAAW,GAAGC,OAAMC,aAAa,CAACC,8CAA0B,EAAE;QACjEC,OAAOJ,MAAMK,SAAS;IAC1B,GAAGL,MAAMM,QAAQ;AACrB"}
|
@@ -4,19 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
});
|
5
5
|
Object.defineProperty(exports, "useMenuTrigger_unstable", {
|
6
6
|
enumerable: true,
|
7
|
-
get: ()
|
7
|
+
get: function() {
|
8
|
+
return useMenuTrigger_unstable;
|
9
|
+
}
|
8
10
|
});
|
9
|
-
const
|
10
|
-
const _react = /*#__PURE__*/
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
11
13
|
const _menuContext = require("../../contexts/menuContext");
|
12
14
|
const _useIsSubmenu = require("../../utils/useIsSubmenu");
|
13
|
-
const
|
14
|
-
const
|
15
|
-
const
|
16
|
-
const
|
17
|
-
const
|
15
|
+
const _reacttabster = require("@fluentui/react-tabster");
|
16
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
17
|
+
const _keyboardkeys = require("@fluentui/keyboard-keys");
|
18
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
19
|
+
const _reactaria = require("@fluentui/react-aria");
|
18
20
|
const useMenuTrigger_unstable = (props)=>{
|
19
|
-
|
21
|
+
var _child, _child1, _child2, _child3, _child4, _child5, _child6, _child7, _child8, _child9;
|
22
|
+
const { children, disableButtonEnhancement = false } = props;
|
20
23
|
const triggerRef = (0, _menuContext.useMenuContext_unstable)((context)=>context.triggerRef);
|
21
24
|
const menuPopoverRef = (0, _menuContext.useMenuContext_unstable)((context)=>context.menuPopoverRef);
|
22
25
|
const setOpen = (0, _menuContext.useMenuContext_unstable)((context)=>context.setOpen);
|
@@ -24,21 +27,22 @@ const useMenuTrigger_unstable = (props)=>{
|
|
24
27
|
const triggerId = (0, _menuContext.useMenuContext_unstable)((context)=>context.triggerId);
|
25
28
|
const openOnHover = (0, _menuContext.useMenuContext_unstable)((context)=>context.openOnHover);
|
26
29
|
const openOnContext = (0, _menuContext.useMenuContext_unstable)((context)=>context.openOnContext);
|
27
|
-
const restoreFocusTargetAttribute = (0,
|
30
|
+
const restoreFocusTargetAttribute = (0, _reacttabster.useRestoreFocusTarget)();
|
28
31
|
const isSubmenu = (0, _useIsSubmenu.useIsSubmenu)();
|
29
|
-
const { findFirstFocusable
|
32
|
+
const { findFirstFocusable } = (0, _reacttabster.useFocusFinders)();
|
30
33
|
const focusFirst = _react.useCallback(()=>{
|
34
|
+
var _firstFocusable;
|
31
35
|
const firstFocusable = findFirstFocusable(menuPopoverRef.current);
|
32
|
-
firstFocusable === null ||
|
36
|
+
(_firstFocusable = firstFocusable) === null || _firstFocusable === void 0 ? void 0 : _firstFocusable.focus();
|
33
37
|
}, [
|
34
38
|
findFirstFocusable,
|
35
39
|
menuPopoverRef
|
36
40
|
]);
|
37
41
|
const openedWithKeyboardRef = _react.useRef(false);
|
38
42
|
const hasMouseMoved = _react.useRef(false);
|
39
|
-
const { dir
|
40
|
-
const OpenArrowKey = dir === 'ltr' ?
|
41
|
-
const child = (0,
|
43
|
+
const { dir } = (0, _reactsharedcontexts.useFluent_unstable)();
|
44
|
+
const OpenArrowKey = dir === 'ltr' ? _keyboardkeys.ArrowRight : _keyboardkeys.ArrowLeft;
|
45
|
+
const child = (0, _reactutilities.getTriggerChild)(children);
|
42
46
|
const onContextMenu = (event)=>{
|
43
47
|
if (isTargetDisabled(event) || event.isDefaultPrevented()) {
|
44
48
|
return;
|
@@ -72,7 +76,7 @@ const useMenuTrigger_unstable = (props)=>{
|
|
72
76
|
return;
|
73
77
|
}
|
74
78
|
const key = event.key;
|
75
|
-
if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key ===
|
79
|
+
if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === _keyboardkeys.ArrowDown)) {
|
76
80
|
setOpen(event, {
|
77
81
|
open: true,
|
78
82
|
keyboard: true,
|
@@ -80,7 +84,7 @@ const useMenuTrigger_unstable = (props)=>{
|
|
80
84
|
event
|
81
85
|
});
|
82
86
|
}
|
83
|
-
if (key ===
|
87
|
+
if (key === _keyboardkeys.Escape && !isSubmenu) {
|
84
88
|
setOpen(event, {
|
85
89
|
open: false,
|
86
90
|
keyboard: true,
|
@@ -138,31 +142,31 @@ const useMenuTrigger_unstable = (props)=>{
|
|
138
142
|
};
|
139
143
|
const contextMenuProps = {
|
140
144
|
id: triggerId,
|
141
|
-
...child === null ||
|
142
|
-
ref: (0,
|
143
|
-
onMouseEnter: (0,
|
144
|
-
onMouseLeave: (0,
|
145
|
-
onContextMenu: (0,
|
146
|
-
onMouseMove: (0,
|
145
|
+
...(_child = child) === null || _child === void 0 ? void 0 : _child.props,
|
146
|
+
ref: (0, _reactutilities.useMergedRefs)(triggerRef, (_child1 = child) === null || _child1 === void 0 ? void 0 : _child1.ref),
|
147
|
+
onMouseEnter: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((_child2 = child) === null || _child2 === void 0 ? void 0 : _child2.props.onMouseEnter, onMouseEnter)),
|
148
|
+
onMouseLeave: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((_child3 = child) === null || _child3 === void 0 ? void 0 : _child3.props.onMouseLeave, onMouseLeave)),
|
149
|
+
onContextMenu: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((_child4 = child) === null || _child4 === void 0 ? void 0 : _child4.props.onContextMenu, onContextMenu)),
|
150
|
+
onMouseMove: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((_child5 = child) === null || _child5 === void 0 ? void 0 : _child5.props.onMouseMove, onMouseMove))
|
147
151
|
};
|
148
152
|
const triggerChildProps = {
|
149
153
|
'aria-haspopup': 'menu',
|
150
154
|
'aria-expanded': !open && !isSubmenu ? undefined : open,
|
151
155
|
...restoreFocusTargetAttribute,
|
152
156
|
...contextMenuProps,
|
153
|
-
onClick: (0,
|
154
|
-
onKeyDown: (0,
|
157
|
+
onClick: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((_child6 = child) === null || _child6 === void 0 ? void 0 : _child6.props.onClick, onClick)),
|
158
|
+
onKeyDown: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)((_child7 = child) === null || _child7 === void 0 ? void 0 : _child7.props.onKeyDown, onKeyDown))
|
155
159
|
};
|
156
|
-
const ariaButtonTriggerChildProps = (0,
|
160
|
+
const ariaButtonTriggerChildProps = (0, _reactaria.useARIAButtonProps)(((_child8 = child) === null || _child8 === void 0 ? void 0 : _child8.type) === 'button' || ((_child9 = child) === null || _child9 === void 0 ? void 0 : _child9.type) === 'a' ? child.type : 'div', triggerChildProps);
|
157
161
|
return {
|
158
162
|
isSubmenu,
|
159
|
-
children: (0,
|
163
|
+
children: (0, _reactutilities.applyTriggerPropsToChildren)(children, openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)
|
160
164
|
};
|
161
165
|
};
|
162
166
|
const isTargetDisabled = (event)=>{
|
163
167
|
const isDisabled = (el)=>el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';
|
164
|
-
if ((0,
|
168
|
+
if ((0, _reactutilities.isHTMLElement)(event.target) && isDisabled(event.target)) {
|
165
169
|
return true;
|
166
170
|
}
|
167
|
-
return (0,
|
171
|
+
return (0, _reactutilities.isHTMLElement)(event.currentTarget) && isDisabled(event.currentTarget);
|
168
172
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders, useRestoreFocusTarget } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport { applyTriggerPropsToChildren, getTriggerChild, isHTMLElement, mergeCallbacks, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */ export const useMenuTrigger_unstable = (props)=>{\n const { children , disableButtonEnhancement =false } = props;\n const triggerRef = useMenuContext_unstable((context)=>context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable((context)=>context.menuPopoverRef);\n const setOpen = useMenuContext_unstable((context)=>context.setOpen);\n const open = useMenuContext_unstable((context)=>context.open);\n const triggerId = useMenuContext_unstable((context)=>context.triggerId);\n const openOnHover = useMenuContext_unstable((context)=>context.openOnHover);\n const openOnContext = useMenuContext_unstable((context)=>context.openOnContext);\n const restoreFocusTargetAttribute = useRestoreFocusTarget();\n const isSubmenu = useIsSubmenu();\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(()=>{\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [\n findFirstFocusable,\n menuPopoverRef\n ]);\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n const child = getTriggerChild(children);\n const onContextMenu = (event)=>{\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerContextMenu',\n event\n });\n }\n };\n const onClick = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (!openOnContext) {\n setOpen(event, {\n open: !open,\n keyboard: openedWithKeyboardRef.current,\n type: 'menuTriggerClick',\n event\n });\n openedWithKeyboardRef.current = false;\n }\n };\n const onKeyDown = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n const key = event.key;\n if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {\n setOpen(event, {\n open: true,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n if (key === Escape && !isSubmenu) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n };\n const onMouseEnter = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseEnter',\n event\n });\n }\n };\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseMove',\n event\n });\n hasMouseMoved.current = true;\n }\n };\n const onMouseLeave = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, {\n open: false,\n keyboard: false,\n type: 'menuTriggerMouseLeave',\n event\n });\n }\n };\n const contextMenuProps = {\n id: triggerId,\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseMove, onMouseMove))\n };\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...restoreFocusTargetAttribute,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', triggerChildProps);\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(children, openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\nconst isTargetDisabled = (event)=>{\n const isDisabled = (el)=>el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["useMenuTrigger_unstable","props","children","disableButtonEnhancement","triggerRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","restoreFocusTargetAttribute","useRestoreFocusTarget","isSubmenu","useIsSubmenu","findFirstFocusable","useFocusFinders","focusFirst","React","useCallback","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","useFluent","OpenArrowKey","ArrowRight","ArrowLeft","child","getTriggerChild","onContextMenu","event","isTargetDisabled","isDefaultPrevented","preventDefault","keyboard","type","onClick","onKeyDown","key","ArrowDown","Escape","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","useMergedRefs","useEventCallback","mergeCallbacks","triggerChildProps","undefined","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren","isDisabled","el","hasAttribute","getAttribute","isHTMLElement","target","currentTarget"],"mappings":";;;;+BAaiBA;;aAAAA;;;6DAbM;6BACiB;8BACX;8BAC0B;qCACP;8BACS;gCACoE;2BAC1F;AAMxB,MAAMA,0BAA0B,CAACC,QAAQ;IAChD,MAAM,EAAEC,SAAQ,EAAGC,0BAA0B,KAAK,CAAA,EAAG,GAAGF;IACxD,MAAMG,aAAaC,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQF,UAAU;IACxE,MAAMG,iBAAiBF,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQC,cAAc;IAChF,MAAMC,UAAUH,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQE,OAAO;IAClE,MAAMC,OAAOJ,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQG,IAAI;IAC5D,MAAMC,YAAYL,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQI,SAAS;IACtE,MAAMC,cAAcN,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQK,WAAW;IAC1E,MAAMC,gBAAgBP,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQM,aAAa;IAC9E,MAAMC,8BAA8BC,IAAAA,mCAAqB;IACzD,MAAMC,YAAYC,IAAAA,0BAAY;IAC9B,MAAM,EAAEC,mBAAkB,EAAG,GAAGC,IAAAA,6BAAe;IAC/C,MAAMC,aAAaC,OAAMC,WAAW,CAAC,IAA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D,MAAO,MAAMR,MAAMQ,IAAI,GAAG,KAAK,EAAEe;IAC3N,OAAO;QACHzC;QACAb,UAAU0D,IAAAA,2CAA2B,EAAC1D,UAAUU,gBAAgBsC,mBAAmB/C,2BAA2BqD,oBAAoBE,2BAA2B;IACjK;AACJ;AACA,MAAMrB,mBAAmB,CAACD,QAAQ;IAC9B,MAAMyB,aAAa,CAACC,KAAKA,GAAGC,YAAY,CAAC,eAAeD,GAAGC,YAAY,CAAC,oBAAoBD,GAAGE,YAAY,CAAC,qBAAqB;IACjI,IAAIC,IAAAA,6BAAa,EAAC7B,MAAM8B,MAAM,KAAKL,WAAWzB,MAAM8B,MAAM,GAAG;QACzD,OAAO,IAAI;IACf,CAAC;IACD,OAAOD,IAAAA,6BAAa,EAAC7B,MAAM+B,aAAa,KAAKN,WAAWzB,MAAM+B,aAAa;AAC/E"}
|
1
|
+
{"version":3,"sources":["useMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders, useRestoreFocusTarget } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport { applyTriggerPropsToChildren, getTriggerChild, isHTMLElement, mergeCallbacks, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */ export const useMenuTrigger_unstable = (props)=>{\n var _child, _child1, _child2, _child3, _child4, _child5, _child6, _child7, _child8, _child9;\n const { children, disableButtonEnhancement = false } = props;\n const triggerRef = useMenuContext_unstable((context)=>context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable((context)=>context.menuPopoverRef);\n const setOpen = useMenuContext_unstable((context)=>context.setOpen);\n const open = useMenuContext_unstable((context)=>context.open);\n const triggerId = useMenuContext_unstable((context)=>context.triggerId);\n const openOnHover = useMenuContext_unstable((context)=>context.openOnHover);\n const openOnContext = useMenuContext_unstable((context)=>context.openOnContext);\n const restoreFocusTargetAttribute = useRestoreFocusTarget();\n const isSubmenu = useIsSubmenu();\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(()=>{\n var _firstFocusable;\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n (_firstFocusable = firstFocusable) === null || _firstFocusable === void 0 ? void 0 : _firstFocusable.focus();\n }, [\n findFirstFocusable,\n menuPopoverRef\n ]);\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n const child = getTriggerChild(children);\n const onContextMenu = (event)=>{\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerContextMenu',\n event\n });\n }\n };\n const onClick = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (!openOnContext) {\n setOpen(event, {\n open: !open,\n keyboard: openedWithKeyboardRef.current,\n type: 'menuTriggerClick',\n event\n });\n openedWithKeyboardRef.current = false;\n }\n };\n const onKeyDown = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n const key = event.key;\n if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {\n setOpen(event, {\n open: true,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n if (key === Escape && !isSubmenu) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n };\n const onMouseEnter = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseEnter',\n event\n });\n }\n };\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseMove',\n event\n });\n hasMouseMoved.current = true;\n }\n };\n const onMouseLeave = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, {\n open: false,\n keyboard: false,\n type: 'menuTriggerMouseLeave',\n event\n });\n }\n };\n const contextMenuProps = {\n id: triggerId,\n ...(_child = child) === null || _child === void 0 ? void 0 : _child.props,\n ref: useMergedRefs(triggerRef, (_child1 = child) === null || _child1 === void 0 ? void 0 : _child1.ref),\n onMouseEnter: useEventCallback(mergeCallbacks((_child2 = child) === null || _child2 === void 0 ? void 0 : _child2.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks((_child3 = child) === null || _child3 === void 0 ? void 0 : _child3.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks((_child4 = child) === null || _child4 === void 0 ? void 0 : _child4.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks((_child5 = child) === null || _child5 === void 0 ? void 0 : _child5.props.onMouseMove, onMouseMove))\n };\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...restoreFocusTargetAttribute,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks((_child6 = child) === null || _child6 === void 0 ? void 0 : _child6.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks((_child7 = child) === null || _child7 === void 0 ? void 0 : _child7.props.onKeyDown, onKeyDown))\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps(((_child8 = child) === null || _child8 === void 0 ? void 0 : _child8.type) === 'button' || ((_child9 = child) === null || _child9 === void 0 ? void 0 : _child9.type) === 'a' ? child.type : 'div', triggerChildProps);\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(children, openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\nconst isTargetDisabled = (event)=>{\n const isDisabled = (el)=>el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["useMenuTrigger_unstable","props","_child","_child1","_child2","_child3","_child4","_child5","_child6","_child7","_child8","_child9","children","disableButtonEnhancement","triggerRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","restoreFocusTargetAttribute","useRestoreFocusTarget","isSubmenu","useIsSubmenu","findFirstFocusable","useFocusFinders","focusFirst","React","useCallback","_firstFocusable","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","useFluent","OpenArrowKey","ArrowRight","ArrowLeft","child","getTriggerChild","onContextMenu","event","isTargetDisabled","isDefaultPrevented","preventDefault","keyboard","type","onClick","onKeyDown","key","ArrowDown","Escape","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","useMergedRefs","useEventCallback","mergeCallbacks","triggerChildProps","undefined","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren","isDisabled","el","hasAttribute","getAttribute","isHTMLElement","target","currentTarget"],"mappings":";;;;+BAaiBA;;;eAAAA;;;;iEAbM;6BACiB;8BACX;8BAC0B;qCACP;8BACS;gCACoE;2BAC1F;AAMxB,MAAMA,0BAA0B,CAACC;IACxC,IAAIC,QAAQC,SAASC,SAASC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AM+B,aAAa,KAAKN,WAAWzB,MAAM+B,aAAa;AAC/E"}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
|
-
const
|
6
|
-
|
7
|
-
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
+
_export_star._(require("./MenuItem/index"), exports);
|
7
|
+
_export_star._(require("./MenuList/index"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuItem/index';\nexport * from './MenuList/index';\n"],"names":[],"mappings":";;;;;
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './MenuItem/index';\nexport * from './MenuList/index';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA"}
|
@@ -9,14 +9,20 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
MenuContext: ()
|
13
|
-
|
14
|
-
|
12
|
+
MenuContext: function() {
|
13
|
+
return MenuContext;
|
14
|
+
},
|
15
|
+
MenuProvider: function() {
|
16
|
+
return MenuProvider;
|
17
|
+
},
|
18
|
+
useMenuContext_unstable: function() {
|
19
|
+
return useMenuContext_unstable;
|
20
|
+
}
|
15
21
|
});
|
16
|
-
const
|
17
|
-
const _react = /*#__PURE__*/
|
18
|
-
const
|
19
|
-
const MenuContext = (0,
|
22
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
23
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
24
|
+
const _reactcontextselector = require("@fluentui/react-context-selector");
|
25
|
+
const MenuContext = (0, _reactcontextselector.createContext)(undefined);
|
20
26
|
const menuContextDefaultValue = {
|
21
27
|
open: false,
|
22
28
|
setOpen: ()=>false,
|
@@ -39,4 +45,4 @@ const menuContextDefaultValue = {
|
|
39
45
|
persistOnItemClick: false
|
40
46
|
};
|
41
47
|
const MenuProvider = MenuContext.Provider;
|
42
|
-
const useMenuContext_unstable = (selector)=>(0,
|
48
|
+
const useMenuContext_unstable = (selector)=>(0, _reactcontextselector.useContextSelector)(MenuContext, (ctx = menuContextDefaultValue)=>selector(ctx));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["menuContext.js"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nexport const MenuContext = createContext(undefined);\nconst menuContextDefaultValue = {\n open: false,\n setOpen: ()=>false,\n checkedValues: {},\n onCheckedValueChange: ()=>null,\n isSubmenu: false,\n triggerRef: {\n current: null\n },\n menuPopoverRef: {\n current: null\n },\n mountNode: null,\n triggerId: '',\n openOnContext: false,\n openOnHover: false,\n hasIcons: false,\n hasCheckmarks: false,\n inline: false,\n persistOnItemClick: false\n};\nexport const MenuProvider = MenuContext.Provider;\nexport const useMenuContext_unstable = (selector)=>useContextSelector(MenuContext, (ctx = menuContextDefaultValue)=>selector(ctx));\n"],"names":["MenuContext","MenuProvider","useMenuContext_unstable","createContext","undefined","menuContextDefaultValue","open","setOpen","checkedValues","onCheckedValueChange","isSubmenu","triggerRef","current","menuPopoverRef","mountNode","triggerId","openOnContext","openOnHover","hasIcons","hasCheckmarks","inline","persistOnItemClick","Provider","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IAEaA,WAAW
|
1
|
+
{"version":3,"sources":["menuContext.js"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nexport const MenuContext = createContext(undefined);\nconst menuContextDefaultValue = {\n open: false,\n setOpen: ()=>false,\n checkedValues: {},\n onCheckedValueChange: ()=>null,\n isSubmenu: false,\n triggerRef: {\n current: null\n },\n menuPopoverRef: {\n current: null\n },\n mountNode: null,\n triggerId: '',\n openOnContext: false,\n openOnHover: false,\n hasIcons: false,\n hasCheckmarks: false,\n inline: false,\n persistOnItemClick: false\n};\nexport const MenuProvider = MenuContext.Provider;\nexport const useMenuContext_unstable = (selector)=>useContextSelector(MenuContext, (ctx = menuContextDefaultValue)=>selector(ctx));\n"],"names":["MenuContext","MenuProvider","useMenuContext_unstable","createContext","undefined","menuContextDefaultValue","open","setOpen","checkedValues","onCheckedValueChange","isSubmenu","triggerRef","current","menuPopoverRef","mountNode","triggerId","openOnContext","openOnHover","hasIcons","hasCheckmarks","inline","persistOnItemClick","Provider","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IAEaA,WAAW;eAAXA;;IAsBAC,YAAY;eAAZA;;IACAC,uBAAuB;eAAvBA;;;;iEAzBU;sCAC2B;AAC3C,MAAMF,cAAcG,IAAAA,mCAAa,EAACC;AACzC,MAAMC,0BAA0B;IAC5BC,MAAM;IACNC,SAAS,IAAI;IACbC,eAAe,CAAC;IAChBC,sBAAsB,IAAI;IAC1BC,WAAW;IACXC,YAAY;QACRC,SAAS;IACb;IACAC,gBAAgB;QACZD,SAAS;IACb;IACAE,WAAW;IACXC,WAAW;IACXC,eAAe;IACfC,aAAa;IACbC,UAAU;IACVC,eAAe;IACfC,QAAQ;IACRC,oBAAoB;AACxB;AACO,MAAMpB,eAAeD,YAAYsB,QAAQ;AACzC,MAAMpB,0BAA0B,CAACqB,WAAWC,IAAAA,wCAAkB,EAACxB,aAAa,CAACyB,MAAMpB,uBAAuB,GAAGkB,SAASE"}
|
@@ -9,11 +9,15 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
MenuGroupContextProvider: ()
|
13
|
-
|
12
|
+
MenuGroupContextProvider: function() {
|
13
|
+
return MenuGroupContextProvider;
|
14
|
+
},
|
15
|
+
useMenuGroupContext_unstable: function() {
|
16
|
+
return useMenuGroupContext_unstable;
|
17
|
+
}
|
14
18
|
});
|
15
|
-
const
|
16
|
-
const _react = /*#__PURE__*/
|
19
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
20
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
17
21
|
const MenuGroupContext = /*#__PURE__*/ _react.createContext(undefined);
|
18
22
|
const menuGroupContextDefaultValue = {
|
19
23
|
headerId: ''
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["menuGroupContext.js"],"sourcesContent":["import * as React from 'react';\nconst MenuGroupContext = React.createContext(undefined);\nconst menuGroupContextDefaultValue = {\n headerId: ''\n};\nexport const MenuGroupContextProvider = MenuGroupContext.Provider;\nvar _React_useContext;\nexport const useMenuGroupContext_unstable = ()=>(_React_useContext = React.useContext(MenuGroupContext)) !== null && _React_useContext !== void 0 ? _React_useContext : menuGroupContextDefaultValue;\n"],"names":["MenuGroupContextProvider","useMenuGroupContext_unstable","MenuGroupContext","React","createContext","undefined","menuGroupContextDefaultValue","headerId","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAKaA,wBAAwB
|
1
|
+
{"version":3,"sources":["menuGroupContext.js"],"sourcesContent":["import * as React from 'react';\nconst MenuGroupContext = React.createContext(undefined);\nconst menuGroupContextDefaultValue = {\n headerId: ''\n};\nexport const MenuGroupContextProvider = MenuGroupContext.Provider;\nvar _React_useContext;\nexport const useMenuGroupContext_unstable = ()=>(_React_useContext = React.useContext(MenuGroupContext)) !== null && _React_useContext !== void 0 ? _React_useContext : menuGroupContextDefaultValue;\n"],"names":["MenuGroupContextProvider","useMenuGroupContext_unstable","MenuGroupContext","React","createContext","undefined","menuGroupContextDefaultValue","headerId","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAKaA,wBAAwB;eAAxBA;;IAEAC,4BAA4B;eAA5BA;;;;iEAPU;AACvB,MAAMC,iCAAmBC,OAAMC,aAAa,CAACC;AAC7C,MAAMC,+BAA+B;IACjCC,UAAU;AACd;AACO,MAAMP,2BAA2BE,iBAAiBM,QAAQ;AACjE,IAAIC;AACG,MAAMR,+BAA+B,IAAI,AAACQ,CAAAA,oBAAoBN,OAAMO,UAAU,CAACR,iBAAgB,MAAO,QAAQO,sBAAsB,KAAK,IAAIA,oBAAoBH"}
|
@@ -9,14 +9,20 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
MenuListContext: ()
|
13
|
-
|
14
|
-
|
12
|
+
MenuListContext: function() {
|
13
|
+
return MenuListContext;
|
14
|
+
},
|
15
|
+
MenuListProvider: function() {
|
16
|
+
return MenuListProvider;
|
17
|
+
},
|
18
|
+
useMenuListContext_unstable: function() {
|
19
|
+
return useMenuListContext_unstable;
|
20
|
+
}
|
15
21
|
});
|
16
|
-
const
|
17
|
-
const _react = /*#__PURE__*/
|
18
|
-
const
|
19
|
-
const MenuListContext = (0,
|
22
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
23
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
24
|
+
const _reactcontextselector = require("@fluentui/react-context-selector");
|
25
|
+
const MenuListContext = (0, _reactcontextselector.createContext)(undefined);
|
20
26
|
const menuListContextDefaultValue = {
|
21
27
|
checkedValues: {},
|
22
28
|
setFocusByFirstCharacter: ()=>null,
|
@@ -26,4 +32,4 @@ const menuListContextDefaultValue = {
|
|
26
32
|
hasCheckmarks: false
|
27
33
|
};
|
28
34
|
const MenuListProvider = MenuListContext.Provider;
|
29
|
-
const useMenuListContext_unstable = (selector)=>(0,
|
35
|
+
const useMenuListContext_unstable = (selector)=>(0, _reactcontextselector.useContextSelector)(MenuListContext, (ctx = menuListContextDefaultValue)=>selector(ctx));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["menuListContext.js"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nexport const MenuListContext = createContext(undefined);\nconst menuListContextDefaultValue = {\n checkedValues: {},\n setFocusByFirstCharacter: ()=>null,\n toggleCheckbox: ()=>null,\n selectRadio: ()=>null,\n hasIcons: false,\n hasCheckmarks: false\n};\nexport const MenuListProvider = MenuListContext.Provider;\nexport const useMenuListContext_unstable = (selector)=>useContextSelector(MenuListContext, (ctx = menuListContextDefaultValue)=>selector(ctx));\n"],"names":["MenuListContext","MenuListProvider","useMenuListContext_unstable","createContext","undefined","menuListContextDefaultValue","checkedValues","setFocusByFirstCharacter","toggleCheckbox","selectRadio","hasIcons","hasCheckmarks","Provider","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IAEaA,eAAe
|
1
|
+
{"version":3,"sources":["menuListContext.js"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nexport const MenuListContext = createContext(undefined);\nconst menuListContextDefaultValue = {\n checkedValues: {},\n setFocusByFirstCharacter: ()=>null,\n toggleCheckbox: ()=>null,\n selectRadio: ()=>null,\n hasIcons: false,\n hasCheckmarks: false\n};\nexport const MenuListProvider = MenuListContext.Provider;\nexport const useMenuListContext_unstable = (selector)=>useContextSelector(MenuListContext, (ctx = menuListContextDefaultValue)=>selector(ctx));\n"],"names":["MenuListContext","MenuListProvider","useMenuListContext_unstable","createContext","undefined","menuListContextDefaultValue","checkedValues","setFocusByFirstCharacter","toggleCheckbox","selectRadio","hasIcons","hasCheckmarks","Provider","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IAEaA,eAAe;eAAfA;;IASAC,gBAAgB;eAAhBA;;IACAC,2BAA2B;eAA3BA;;;;iEAZU;sCAC2B;AAC3C,MAAMF,kBAAkBG,IAAAA,mCAAa,EAACC;AAC7C,MAAMC,8BAA8B;IAChCC,eAAe,CAAC;IAChBC,0BAA0B,IAAI;IAC9BC,gBAAgB,IAAI;IACpBC,aAAa,IAAI;IACjBC,UAAU;IACVC,eAAe;AACnB;AACO,MAAMV,mBAAmBD,gBAAgBY,QAAQ;AACjD,MAAMV,8BAA8B,CAACW,WAAWC,IAAAA,wCAAkB,EAACd,iBAAiB,CAACe,MAAMV,2BAA2B,GAAGQ,SAASE"}
|
@@ -9,11 +9,15 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
MenuTriggerContextProvider: ()
|
13
|
-
|
12
|
+
MenuTriggerContextProvider: function() {
|
13
|
+
return MenuTriggerContextProvider;
|
14
|
+
},
|
15
|
+
useMenuTriggerContext_unstable: function() {
|
16
|
+
return useMenuTriggerContext_unstable;
|
17
|
+
}
|
14
18
|
});
|
15
|
-
const
|
16
|
-
const _react = /*#__PURE__*/
|
19
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
20
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
17
21
|
/**
|
18
22
|
* Context used communicate with a child menu item that it is a trigger for a submenu
|
19
23
|
*/ const MenuTriggerContext = /*#__PURE__*/ _react.createContext(undefined);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["menuTriggerContext.js"],"sourcesContent":["import * as React from 'react';\n/**\n * Context used communicate with a child menu item that it is a trigger for a submenu\n */ const MenuTriggerContext = React.createContext(undefined);\nconst menuTriggerContextDefaultValue = false;\nexport const MenuTriggerContextProvider = MenuTriggerContext.Provider;\nvar _React_useContext;\nexport const useMenuTriggerContext_unstable = ()=>(_React_useContext = React.useContext(MenuTriggerContext)) !== null && _React_useContext !== void 0 ? _React_useContext : menuTriggerContextDefaultValue;\n"],"names":["MenuTriggerContextProvider","useMenuTriggerContext_unstable","MenuTriggerContext","React","createContext","undefined","menuTriggerContextDefaultValue","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAKaA,0BAA0B
|
1
|
+
{"version":3,"sources":["menuTriggerContext.js"],"sourcesContent":["import * as React from 'react';\n/**\n * Context used communicate with a child menu item that it is a trigger for a submenu\n */ const MenuTriggerContext = React.createContext(undefined);\nconst menuTriggerContextDefaultValue = false;\nexport const MenuTriggerContextProvider = MenuTriggerContext.Provider;\nvar _React_useContext;\nexport const useMenuTriggerContext_unstable = ()=>(_React_useContext = React.useContext(MenuTriggerContext)) !== null && _React_useContext !== void 0 ? _React_useContext : menuTriggerContextDefaultValue;\n"],"names":["MenuTriggerContextProvider","useMenuTriggerContext_unstable","MenuTriggerContext","React","createContext","undefined","menuTriggerContextDefaultValue","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAKaA,0BAA0B;eAA1BA;;IAEAC,8BAA8B;eAA9BA;;;;iEAPU;AACvB;;CAEC,GAAG,MAAMC,mCAAqBC,OAAMC,aAAa,CAACC;AACnD,MAAMC,iCAAiC;AAChC,MAAMN,6BAA6BE,mBAAmBK,QAAQ;AACrE,IAAIC;AACG,MAAMP,iCAAiC,IAAI,AAACO,CAAAA,oBAAoBL,OAAMM,UAAU,CAACP,mBAAkB,MAAO,QAAQM,sBAAsB,KAAK,IAAIA,oBAAoBF"}
|