@fluentui/react-menu 0.0.0-nightly050f89bf0020211102.1 → 0.0.0-nightly442708a36520211209.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +238 -26
- package/CHANGELOG.md +66 -20
- package/dist/react-menu.d.ts +34 -7
- package/lib/components/Menu/Menu.js +3 -3
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/renderMenu.js +1 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.js +103 -117
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.js +34 -32
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +2 -2
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +6 -7
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js +6 -7
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -0
- package/lib/components/MenuDivider/useMenuDividerStyles.js +6 -5
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.js +5 -3
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/index.d.ts +1 -0
- package/lib/components/MenuGroup/index.js +1 -0
- package/lib/components/MenuGroup/index.js.map +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +6 -7
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +6 -6
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js +7 -7
- package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.js +7 -0
- package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +2 -2
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +6 -7
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +8 -6
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -0
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +5 -4
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js +2 -4
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/renderMenuItem.js +6 -7
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js +6 -6
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.js +31 -36
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.d.ts +1 -0
- package/lib/components/MenuItem/useMenuItemStyles.js +16 -8
- package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +4 -4
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/index.d.ts +1 -0
- package/lib/components/MenuItemCheckbox/index.js +1 -0
- package/lib/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +6 -7
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +12 -13
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +4 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js +2 -2
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/index.d.ts +1 -0
- package/lib/components/MenuItemRadio/index.js +1 -0
- package/lib/components/MenuItemRadio/index.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +6 -7
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +12 -12
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -0
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +4 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib/components/MenuList/MenuList.js +3 -3
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/MenuList.types.d.ts +8 -6
- package/lib/components/MenuList/renderMenuList.js +6 -7
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.js +66 -86
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +18 -16
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.d.ts +1 -0
- package/lib/components/MenuList/useMenuListStyles.js +9 -7
- package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js +2 -2
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +7 -7
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js +29 -38
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -0
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +12 -8
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.js +2 -2
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +2 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js +3 -4
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/useTriggerElement.js +57 -70
- package/lib/components/MenuTrigger/useTriggerElement.js.map +1 -1
- package/lib/contexts/menuContext.js +5 -11
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.js +3 -5
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.js +7 -17
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.js +3 -5
- package/lib/contexts/menuTriggerContext.js.map +1 -1
- package/lib/selectable/useCheckmarkStyles.js +3 -3
- package/lib/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib/utils/useIsSubmenu.js +2 -4
- package/lib/utils/useIsSubmenu.js.map +1 -1
- package/lib/utils/useOnMenuEnter.js +16 -14
- package/lib/utils/useOnMenuEnter.js.map +1 -1
- package/lib-commonjs/Menu.js +1 -1
- package/lib-commonjs/MenuDivider.js +1 -1
- package/lib-commonjs/MenuGroup.js +1 -1
- package/lib-commonjs/MenuGroupHeader.js +1 -1
- package/lib-commonjs/MenuItem.js +1 -1
- package/lib-commonjs/MenuItemCheckbox.js +1 -1
- package/lib-commonjs/MenuItemRadio.js +1 -1
- package/lib-commonjs/MenuList.js +1 -1
- package/lib-commonjs/MenuPopover.js +1 -1
- package/lib-commonjs/MenuTrigger.js +1 -1
- package/lib-commonjs/components/Menu/Menu.js +6 -6
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/index.js +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js +3 -3
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.js +112 -127
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +34 -32
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +6 -6
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/index.js +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +8 -10
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js +7 -9
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -0
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +8 -6
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +10 -7
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/index.d.ts +1 -0
- package/lib-commonjs/components/MenuGroup/index.js +3 -1
- package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +9 -11
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js +7 -8
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +8 -8
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +3 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +18 -0
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +6 -6
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +8 -10
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +10 -9
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -0
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +8 -6
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js +6 -9
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/index.js +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +9 -11
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js +7 -7
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.js +38 -44
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +1 -0
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +20 -10
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +7 -7
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +1 -0
- package/lib-commonjs/components/MenuItemCheckbox/index.js +3 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +9 -11
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +17 -19
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +10 -5
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +6 -6
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/index.d.ts +1 -0
- package/lib-commonjs/components/MenuItemRadio/index.js +3 -1
- package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +9 -11
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +17 -18
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +1 -0
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +9 -4
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js +8 -8
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.d.ts +8 -6
- package/lib-commonjs/components/MenuList/index.js +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js +9 -11
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +72 -93
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +18 -16
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +1 -0
- package/lib-commonjs/components/MenuList/useMenuListStyles.js +11 -8
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +6 -6
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/index.js +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +10 -11
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +36 -46
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +1 -0
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +14 -9
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +4 -4
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +2 -1
- package/lib-commonjs/components/MenuTrigger/index.js +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +3 -3
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +4 -6
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +64 -78
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +1 -1
- package/lib-commonjs/components/index.js +1 -1
- package/lib-commonjs/contexts/menuContext.js +4 -10
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +3 -5
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.js +6 -16
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +3 -5
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/lib-commonjs/selectable/index.js +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.js +4 -4
- package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib-commonjs/utils/index.js +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js +5 -7
- package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
- package/lib-commonjs/utils/useOnMenuEnter.js +18 -16
- package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
- package/package.json +16 -16
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -12
- package/lib/common/isConformant.js.map +0 -1
- package/lib/common/mockUseMenuContext.d.ts +0 -7
- package/lib/common/mockUseMenuContext.js +0 -36
- package/lib/common/mockUseMenuContext.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -23
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/mockUseMenuContext.d.ts +0 -7
- package/lib-commonjs/common/mockUseMenuContext.js +0 -47
- package/lib-commonjs/common/mockUseMenuContext.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { ArrowRight, ArrowDown, ArrowLeft, Escape } from '@fluentui/keyboard-keys';
|
|
4
3
|
import { applyTriggerPropsToChildren, onlyChild, shouldPreventDefaultOnKeyDown, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
|
|
@@ -7,50 +6,38 @@ import { useMenuContext } from '../../contexts/menuContext';
|
|
|
7
6
|
import { useFluent } from '@fluentui/react-shared-contexts';
|
|
8
7
|
import { useIsSubmenu } from '../../utils/useIsSubmenu';
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
return null;
|
|
12
|
-
};
|
|
9
|
+
const noop = () => null;
|
|
13
10
|
/**
|
|
14
11
|
* Adds the necessary props to the trigger element
|
|
15
12
|
*/
|
|
16
13
|
|
|
17
14
|
|
|
18
|
-
export
|
|
15
|
+
export const useTriggerElement = state => {
|
|
19
16
|
var _a, _b;
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return context.triggerId;
|
|
35
|
-
});
|
|
36
|
-
var openOnHover = useMenuContext(function (context) {
|
|
37
|
-
return context.openOnHover;
|
|
38
|
-
});
|
|
39
|
-
var openOnContext = useMenuContext(function (context) {
|
|
40
|
-
return context.openOnContext;
|
|
41
|
-
});
|
|
42
|
-
var isSubmenu = useIsSubmenu();
|
|
43
|
-
var findFirstFocusable = useFocusFinders().findFirstFocusable;
|
|
44
|
-
var focusFirst = React.useCallback(function () {
|
|
45
|
-
var firstFocusable = findFirstFocusable(menuPopoverRef.current);
|
|
18
|
+
const triggerRef = useMenuContext(context => context.triggerRef);
|
|
19
|
+
const menuPopoverRef = useMenuContext(context => context.menuPopoverRef);
|
|
20
|
+
const setOpen = useMenuContext(context => context.setOpen);
|
|
21
|
+
const open = useMenuContext(context => context.open);
|
|
22
|
+
const triggerId = useMenuContext(context => context.triggerId);
|
|
23
|
+
const openOnHover = useMenuContext(context => context.openOnHover);
|
|
24
|
+
const openOnContext = useMenuContext(context => context.openOnContext);
|
|
25
|
+
const isSubmenu = useIsSubmenu();
|
|
26
|
+
const {
|
|
27
|
+
findFirstFocusable
|
|
28
|
+
} = useFocusFinders();
|
|
29
|
+
const focusFirst = React.useCallback(() => {
|
|
30
|
+
const firstFocusable = findFirstFocusable(menuPopoverRef.current);
|
|
46
31
|
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
|
47
32
|
}, [findFirstFocusable, menuPopoverRef]);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
33
|
+
const openedWithKeyboardRef = React.useRef(false);
|
|
34
|
+
const hasMouseMoved = React.useRef(false);
|
|
35
|
+
const {
|
|
36
|
+
dir
|
|
37
|
+
} = useFluent();
|
|
38
|
+
const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;
|
|
39
|
+
const child = /*#__PURE__*/React.isValidElement(state.children) ? onlyChild(state.children) : undefined;
|
|
40
|
+
const onContextMenu = useEventCallback(e => {
|
|
54
41
|
var _a, _b;
|
|
55
42
|
|
|
56
43
|
if (openOnContext) {
|
|
@@ -63,7 +50,7 @@ export var useTriggerElement = function (state) {
|
|
|
63
50
|
|
|
64
51
|
(_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
65
52
|
});
|
|
66
|
-
|
|
53
|
+
const onClick = useEventCallback(e => {
|
|
67
54
|
var _a, _b;
|
|
68
55
|
|
|
69
56
|
if (!openOnContext) {
|
|
@@ -76,7 +63,7 @@ export var useTriggerElement = function (state) {
|
|
|
76
63
|
|
|
77
64
|
(_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
78
65
|
});
|
|
79
|
-
|
|
66
|
+
const onKeyDown = useEventCallback(e => {
|
|
80
67
|
var _a, _b, _c;
|
|
81
68
|
|
|
82
69
|
if (shouldPreventDefaultOnKeyDown(e)) {
|
|
@@ -85,7 +72,7 @@ export var useTriggerElement = function (state) {
|
|
|
85
72
|
(_a = e.target) === null || _a === void 0 ? void 0 : _a.click();
|
|
86
73
|
}
|
|
87
74
|
|
|
88
|
-
|
|
75
|
+
const key = e.key;
|
|
89
76
|
|
|
90
77
|
if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {
|
|
91
78
|
setOpen(e, {
|
|
@@ -106,13 +93,9 @@ export var useTriggerElement = function (state) {
|
|
|
106
93
|
focusFirst();
|
|
107
94
|
}
|
|
108
95
|
|
|
109
|
-
if (open && key === ArrowDown && !isSubmenu) {
|
|
110
|
-
focusFirst();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
96
|
(_c = (_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
|
|
114
97
|
});
|
|
115
|
-
|
|
98
|
+
const onMouseEnter = useEventCallback(e => {
|
|
116
99
|
var _a, _b;
|
|
117
100
|
|
|
118
101
|
if (openOnHover && hasMouseMoved.current) {
|
|
@@ -127,7 +110,7 @@ export var useTriggerElement = function (state) {
|
|
|
127
110
|
// First time open the mouse using mousemove and then continue with mouseenter
|
|
128
111
|
// Only use once to determine that the user is using the mouse since it is an expensive event to handle
|
|
129
112
|
|
|
130
|
-
|
|
113
|
+
const onMouseMove = useEventCallback(e => {
|
|
131
114
|
if (openOnHover && !hasMouseMoved.current) {
|
|
132
115
|
setOpen(e, {
|
|
133
116
|
open: true,
|
|
@@ -136,7 +119,7 @@ export var useTriggerElement = function (state) {
|
|
|
136
119
|
hasMouseMoved.current = true;
|
|
137
120
|
}
|
|
138
121
|
});
|
|
139
|
-
|
|
122
|
+
const onMouseLeave = useEventCallback(e => {
|
|
140
123
|
var _a, _b;
|
|
141
124
|
|
|
142
125
|
if (openOnHover) {
|
|
@@ -148,32 +131,36 @@ export var useTriggerElement = function (state) {
|
|
|
148
131
|
|
|
149
132
|
(_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
150
133
|
});
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
'aria-haspopup': true,
|
|
134
|
+
const disabled = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.disabled;
|
|
135
|
+
const triggerProps = {
|
|
136
|
+
'aria-haspopup': 'menu',
|
|
155
137
|
'aria-expanded': open,
|
|
156
|
-
id: ((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.id) || triggerId
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
138
|
+
id: ((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.id) || triggerId,
|
|
139
|
+
...(!disabled ? {
|
|
140
|
+
onClick,
|
|
141
|
+
onMouseEnter,
|
|
142
|
+
onMouseLeave,
|
|
143
|
+
onContextMenu,
|
|
144
|
+
onKeyDown,
|
|
145
|
+
onMouseMove
|
|
146
|
+
} : // Spread disabled event handlers to implement contract and avoid specific disabled logic in handlers
|
|
147
|
+
{
|
|
148
|
+
onClick: noop,
|
|
149
|
+
onMouseEnter: noop,
|
|
150
|
+
onMouseLeave: noop,
|
|
151
|
+
onContextMenu: noop,
|
|
152
|
+
onKeyDown: noop,
|
|
153
|
+
onMouseMove: noop
|
|
154
|
+
})
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
if (!open && !isSubmenu) {
|
|
158
|
+
triggerProps['aria-expanded'] = undefined;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
state.children = applyTriggerPropsToChildren(state.children, { ...triggerProps,
|
|
175
162
|
ref: useMergedRefs(typeof state.children !== 'function' && state.children.ref || null, triggerRef)
|
|
176
|
-
})
|
|
163
|
+
});
|
|
177
164
|
return state;
|
|
178
165
|
};
|
|
179
166
|
//# sourceMappingURL=useTriggerElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuTrigger/useTriggerElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuTrigger/useTriggerElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,UAAT,EAAqB,SAArB,EAAgC,SAAhC,EAA2C,MAA3C,QAAyD,yBAAzD;AACA,SACE,2BADF,EAEE,SAFF,EAGE,6BAHF,EAIE,gBAJF,EAKE,aALF,QAMO,2BANP;AAOA,SAAS,eAAT,QAAgC,yBAAhC;AACA,SAAS,cAAT,QAA+B,4BAA/B;AACA,SAAS,SAAT,QAA0B,iCAA1B;AACA,SAAS,YAAT,QAA6B,0BAA7B;;AAGA,MAAM,IAAI,GAAG,MAAM,IAAnB;AAEA;;AAEG;;;AACH,OAAO,MAAM,iBAAiB,GAAI,KAAD,IAA8C;;;AAC7E,QAAM,UAAU,GAAG,cAAc,CAAC,OAAO,IAAI,OAAO,CAAC,UAApB,CAAjC;AACA,QAAM,cAAc,GAAG,cAAc,CAAC,OAAO,IAAI,OAAO,CAAC,cAApB,CAArC;AACA,QAAM,OAAO,GAAG,cAAc,CAAC,OAAO,IAAI,OAAO,CAAC,OAApB,CAA9B;AACA,QAAM,I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AAvE;AAFyC,GAAjB,CAA5C;AAKA,SAAO,KAAP;AACD,CAhIM","sourceRoot":""}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
|
-
export
|
|
2
|
+
export const MenuContext = /*#__PURE__*/createContext({
|
|
3
3
|
open: false,
|
|
4
|
-
setOpen:
|
|
5
|
-
return false;
|
|
6
|
-
},
|
|
4
|
+
setOpen: () => false,
|
|
7
5
|
checkedValues: {},
|
|
8
|
-
onCheckedValueChange:
|
|
9
|
-
return null;
|
|
10
|
-
},
|
|
6
|
+
onCheckedValueChange: () => null,
|
|
11
7
|
defaultCheckedValues: {},
|
|
12
8
|
isSubmenu: false,
|
|
13
9
|
triggerRef: {
|
|
@@ -22,8 +18,6 @@ export var MenuContext = /*#__PURE__*/createContext({
|
|
|
22
18
|
hasIcons: false,
|
|
23
19
|
hasCheckmarks: false
|
|
24
20
|
});
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
return useContextSelector(MenuContext, selector);
|
|
28
|
-
};
|
|
21
|
+
export const MenuProvider = MenuContext.Provider;
|
|
22
|
+
export const useMenuContext = selector => useContextSelector(MenuContext, selector);
|
|
29
23
|
//# sourceMappingURL=menuContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/contexts/menuContext.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAKA,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/menuContext.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAKA,OAAO,MAAM,WAAW,gBAA8B,aAAa,CAAmB;AACpF,EAAA,IAAI,EAAE,KAD8E;AAEpF,EAAA,OAAO,EAAE,MAAM,KAFqE;AAGpF,EAAA,aAAa,EAAE,EAHqE;AAIpF,EAAA,oBAAoB,EAAE,MAAM,IAJwD;AAKpF,EAAA,oBAAoB,EAAE,EAL8D;AAMpF,EAAA,SAAS,EAAE,KANyE;AAOpF,EAAA,UAAU,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GAPuE;AAQpF,EAAA,cAAc,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GARmE;AASpF,EAAA,SAAS,EAAE,EATyE;AAUpF,EAAA,aAAa,EAAE,KAVqE;AAWpF,EAAA,WAAW,EAAE,KAXuE;AAYpF,EAAA,QAAQ,EAAE,KAZ0E;AAapF,EAAA,aAAa,EAAE;AAbqE,CAAnB,CAA5D;AAwCP,OAAO,MAAM,YAAY,GAAG,WAAW,CAAC,QAAjC;AAEP,OAAO,MAAM,cAAc,GAAO,QAAJ,IAC5B,kBAAkB,CAAC,WAAD,EAAc,QAAd,CADb","sourceRoot":""}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
const MenuGroupContext = /*#__PURE__*/React.createContext({
|
|
3
3
|
headerId: ''
|
|
4
4
|
});
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
return React.useContext(MenuGroupContext);
|
|
8
|
-
};
|
|
5
|
+
export const MenuGroupContextProvider = MenuGroupContext.Provider;
|
|
6
|
+
export const useMenuGroupContext = () => React.useContext(MenuGroupContext);
|
|
9
7
|
//# sourceMappingURL=menuGroupContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/contexts/menuGroupContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/menuGroupContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,MAAM,gBAAgB,gBAAG,KAAK,CAAC,aAAN,CAA2C;AAAE,EAAA,QAAQ,EAAE;AAAZ,CAA3C,CAAzB;AAaA,OAAO,MAAM,wBAAwB,GAAG,gBAAgB,CAAC,QAAlD;AACP,OAAO,MAAM,mBAAmB,GAAG,MAAM,KAAK,CAAC,UAAN,CAAiB,gBAAjB,CAAlC","sourceRoot":""}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
|
-
export
|
|
2
|
+
export const MenuListContext = /*#__PURE__*/createContext({
|
|
3
3
|
checkedValues: {},
|
|
4
|
-
onCheckedValueChange:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return null;
|
|
9
|
-
},
|
|
10
|
-
toggleCheckbox: function () {
|
|
11
|
-
return null;
|
|
12
|
-
},
|
|
13
|
-
selectRadio: function () {
|
|
14
|
-
return null;
|
|
15
|
-
},
|
|
4
|
+
onCheckedValueChange: () => null,
|
|
5
|
+
setFocusByFirstCharacter: () => null,
|
|
6
|
+
toggleCheckbox: () => null,
|
|
7
|
+
selectRadio: () => null,
|
|
16
8
|
hasIcons: false,
|
|
17
9
|
hasCheckmarks: false
|
|
18
10
|
});
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
return useContextSelector(MenuListContext, selector);
|
|
22
|
-
};
|
|
11
|
+
export const MenuListProvider = MenuListContext.Provider;
|
|
12
|
+
export const useMenuListContext = selector => useContextSelector(MenuListContext, selector);
|
|
23
13
|
//# sourceMappingURL=menuListContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/contexts/menuListContext.tsx"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAKA,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/menuListContext.tsx"],"names":[],"mappings":"AACA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAKA,OAAO,MAAM,eAAe,gBAAkC,aAAa,CAAuB;AAChG,EAAA,aAAa,EAAE,EADiF;AAEhG,EAAA,oBAAoB,EAAE,MAAM,IAFoE;AAGhG,EAAA,wBAAwB,EAAE,MAAM,IAHgE;AAIhG,EAAA,cAAc,EAAE,MAAM,IAJ0E;AAKhG,EAAA,WAAW,EAAE,MAAM,IAL6E;AAMhG,EAAA,QAAQ,EAAE,KANsF;AAOhG,EAAA,aAAa,EAAE;AAPiF,CAAvB,CAApE;AAsBP,OAAO,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAzC;AAEP,OAAO,MAAM,kBAAkB,GAAQ,QAAL,IAChC,kBAAkB,CAAC,eAAD,EAAkB,QAAlB,CADb","sourceRoot":""}
|
|
@@ -3,9 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
* Context used communicate with child that it is a trigger for a menu
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
return React.useContext(MenuTriggerContext);
|
|
10
|
-
};
|
|
6
|
+
const MenuTriggerContext = /*#__PURE__*/React.createContext(false);
|
|
7
|
+
export const MenuTriggerContextProvider = MenuTriggerContext.Provider;
|
|
8
|
+
export const useMenuTriggerContext = () => React.useContext(MenuTriggerContext);
|
|
11
9
|
//# sourceMappingURL=menuTriggerContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/contexts/menuTriggerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA;;AAEG;;AACH,
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/menuTriggerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA;;AAEG;;AACH,MAAM,kBAAkB,gBAAG,KAAK,CAAC,aAAN,CAA6B,KAA7B,CAA3B;AAEA,OAAO,MAAM,0BAA0B,GAAG,kBAAkB,CAAC,QAAtD;AACP,OAAO,MAAM,qBAAqB,GAAG,MAAM,KAAK,CAAC,UAAN,CAAiB,kBAAjB,CAApC","sourceRoot":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mergeClasses, __styles } from '@fluentui/react-make-styles';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const useStyles = /*#__PURE__*/__styles({
|
|
4
4
|
"root": {
|
|
5
5
|
"a9b677": "fjw5fx7",
|
|
6
6
|
"Bqenvij": "fd461yt",
|
|
@@ -19,8 +19,8 @@ var useStyles = /*#__PURE__*/__styles({
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
export
|
|
23
|
-
|
|
22
|
+
export const useCheckmarkStyles = state => {
|
|
23
|
+
const styles = useStyles();
|
|
24
24
|
|
|
25
25
|
if (state.checkmark) {
|
|
26
26
|
state.checkmark.className = mergeClasses(styles.root, state.checked && styles.rootChecked, state.checkmark.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/selectable/useCheckmarkStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;;AAIA,
|
|
1
|
+
{"version":3,"sources":["../../src/selectable/useCheckmarkStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;;AAIA,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAWA;;;;AAIG;;;AACH,OAAO,MAAM,kBAAkB,GAAI,KAAD,IAAsE;AACtG,QAAM,MAAM,GAAG,SAAS,EAAxB;;AACA,MAAI,KAAK,CAAC,SAAV,EAAqB;AACnB,IAAA,KAAK,CAAC,SAAN,CAAgB,SAAhB,GAA4B,YAAY,CACtC,MAAM,CAAC,IAD+B,EAEtC,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,WAFc,EAGtC,KAAK,CAAC,SAAN,CAAgB,SAHsB,CAAxC;AAKD;AACF,CATM","sourceRoot":""}
|
|
@@ -11,10 +11,8 @@ import { MenuListContext } from '../contexts/menuListContext';
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
export function useIsSubmenu() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
var hasMenuListContext = useHasParentContext(MenuListContext);
|
|
14
|
+
const menuContextValue = useMenuContext(context => context.isSubmenu);
|
|
15
|
+
const hasMenuListContext = useHasParentContext(MenuListContext);
|
|
18
16
|
return menuContextValue || hasMenuListContext;
|
|
19
17
|
}
|
|
20
18
|
//# sourceMappingURL=useIsSubmenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/useIsSubmenu.ts"],"names":[],"mappings":"AAAA,SAAS,mBAAT,QAAoC,kCAApC;AACA,SAAS,cAAT,QAA+B,yBAA/B;AACA,SAAS,eAAT,QAAgC,6BAAhC;AAEA;;;;;;;AAOG;;AACH,OAAM,SAAU,YAAV,GAAsB;AAC1B,
|
|
1
|
+
{"version":3,"sources":["../../src/utils/useIsSubmenu.ts"],"names":[],"mappings":"AAAA,SAAS,mBAAT,QAAoC,kCAApC;AACA,SAAS,cAAT,QAA+B,yBAA/B;AACA,SAAS,eAAT,QAAgC,6BAAhC;AAEA;;;;;;;AAOG;;AACH,OAAM,SAAU,YAAV,GAAsB;AAC1B,QAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,IAAI,OAAO,CAAC,SAApB,CAAvC;AACA,QAAM,kBAAkB,GAAG,mBAAmB,CAAC,eAAD,CAA9C;AAEA,SAAO,gBAAgB,IAAI,kBAA3B;AACD","sourceRoot":""}
|
|
@@ -5,7 +5,7 @@ import { elementContains } from '@fluentui/react-portal';
|
|
|
5
5
|
* Name of the custom event
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export const MENU_ENTER_EVENT = 'fuimenuenter';
|
|
9
9
|
/**
|
|
10
10
|
* This hook works similarly to @see {useOnClickOutside}
|
|
11
11
|
*
|
|
@@ -18,27 +18,29 @@ export var MENU_ENTER_EVENT = 'fuimenuenter';
|
|
|
18
18
|
* Each nested menu can use the listener to check if the event is from a child or parent menu
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
export const useOnMenuMouseEnter = options => {
|
|
22
|
+
const {
|
|
23
|
+
refs,
|
|
24
|
+
callback,
|
|
25
|
+
element,
|
|
26
|
+
disabled
|
|
27
|
+
} = options; // Keep mouse event here because this is essentially a custom 'mouseenter' event
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
const listener = useEventCallback(ev => {
|
|
28
30
|
var _a;
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
const popoverRef = refs[0];
|
|
33
|
+
const someMenuPopover = ev.target; // someMenu is a child -> will always be contained because of vParents
|
|
32
34
|
// someMenu is a parent -> will always not be contained because no vParent
|
|
33
35
|
// someMenu is the current popover -> it will contain itself
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
const isOutsidePopover = !elementContains((_a = popoverRef.current) !== null && _a !== void 0 ? _a : null, someMenuPopover);
|
|
36
38
|
|
|
37
39
|
if (isOutsidePopover && !disabled) {
|
|
38
40
|
callback(ev);
|
|
39
41
|
}
|
|
40
42
|
});
|
|
41
|
-
React.useEffect(
|
|
43
|
+
React.useEffect(() => {
|
|
42
44
|
// eslint-disable-next-line eqeqeq
|
|
43
45
|
if (element == null) {
|
|
44
46
|
return;
|
|
@@ -48,7 +50,7 @@ export var useOnMenuMouseEnter = function (options) {
|
|
|
48
50
|
element.addEventListener(MENU_ENTER_EVENT, listener);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
return
|
|
53
|
+
return () => {
|
|
52
54
|
element.removeEventListener(MENU_ENTER_EVENT, listener);
|
|
53
55
|
};
|
|
54
56
|
}, [listener, element, disabled]);
|
|
@@ -59,11 +61,11 @@ export var useOnMenuMouseEnter = function (options) {
|
|
|
59
61
|
* @param nativeEvent the native mouse event this is mapped to
|
|
60
62
|
*/
|
|
61
63
|
|
|
62
|
-
export
|
|
64
|
+
export const dispatchMenuEnterEvent = (el, nativeEvent) => {
|
|
63
65
|
el.dispatchEvent(new CustomEvent(MENU_ENTER_EVENT, {
|
|
64
66
|
bubbles: true,
|
|
65
67
|
detail: {
|
|
66
|
-
nativeEvent
|
|
68
|
+
nativeEvent
|
|
67
69
|
}
|
|
68
70
|
}));
|
|
69
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/useOnMenuEnter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,eAAT,QAAgC,wBAAhC;AAGA;;AAEG;;AACH,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../src/utils/useOnMenuEnter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,eAAT,QAAgC,wBAAhC;AAGA;;AAEG;;AACH,OAAO,MAAM,gBAAgB,GAAG,cAAzB;AAEP;;;;;;;;;;AAUG;;AACH,OAAO,MAAM,mBAAmB,GAAI,OAAD,IAA8C;AAC/E,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA,QAAR;AAAkB,IAAA,OAAlB;AAA2B,IAAA;AAA3B,MAAwC,OAA9C,CAD+E,CAG/E;;AACA,QAAM,QAAQ,GAAG,gBAAgB,CAAE,EAAD,IAAmB;;;AACnD,UAAM,UAAU,GAAG,IAAI,CAAC,CAAD,CAAvB;AACA,UAAM,eAAe,GAAG,EAAE,CAAC,MAA3B,CAFmD,CAInD;AACA;AACA;;AACA,UAAM,gBAAgB,GAAG,CAAC,eAAe,CAAA,CAAA,EAAA,GAAC,UAAU,CAAC,OAAZ,MAAmB,IAAnB,IAAmB,EAAA,KAAA,KAAA,CAAnB,GAAmB,EAAnB,GAAuB,IAAvB,EAA6B,eAA7B,CAAzC;;AACA,QAAI,gBAAgB,IAAI,CAAC,QAAzB,EAAmC;AACjC,MAAA,QAAQ,CAAC,EAAD,CAAR;AACD;AACF,GAXgC,CAAjC;AAaA,EAAA,KAAK,CAAC,SAAN,CAAgB,MAAK;AACnB;AACA,QAAI,OAAO,IAAI,IAAf,EAAqB;AACnB;AACD;;AAUD,QAAI,CAAC,QAAL,EAAe;AACb,MAAA,OAAO,CAAC,gBAAR,CAAyB,gBAAzB,EAA2C,QAA3C;AACD;;AAED,WAAO,MAAK;AACV,MAAA,OAAO,CAAC,mBAAR,CAA4B,gBAA5B,EAA8C,QAA9C;AACD,KAFD;AAGD,GArBD,EAqBG,CAAC,QAAD,EAAW,OAAX,EAAoB,QAApB,CArBH;AAsBD,CAvCM;AAyCP;;;;AAIG;;AACH,OAAO,MAAM,sBAAsB,GAAG,CAAC,EAAD,EAAkB,WAAlB,KAA6C;AACjF,EAAA,EAAE,CAAC,aAAH,CAAiB,IAAI,WAAJ,CAAgB,gBAAhB,EAAkC;AAAE,IAAA,OAAO,EAAE,IAAX;AAAiB,IAAA,MAAM,EAAE;AAAE,MAAA;AAAF;AAAzB,GAAlC,CAAjB;AACD,CAFM","sourceRoot":""}
|
package/lib-commonjs/Menu.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/Menu/index"), exports);
|
|
10
10
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuDivider/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuDivider.js.map
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuGroup/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuGroup.js.map
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuGroupHeader/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuGroupHeader.js.map
|
package/lib-commonjs/MenuItem.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuItem/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuItemCheckbox/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuItemCheckbox.js.map
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuItemRadio/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuItemRadio.js.map
|
package/lib-commonjs/MenuList.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuList/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuList.js.map
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuPopover/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuPopover.js.map
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
8
|
|
|
9
9
|
tslib_1.__exportStar(require("./components/MenuTrigger/index"), exports);
|
|
10
10
|
//# sourceMappingURL=MenuTrigger.js.map
|
|
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Menu = void 0;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const useMenu_1 = /*#__PURE__*/require("./useMenu");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const useMenuContextValues_1 = /*#__PURE__*/require("./useMenuContextValues");
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const renderMenu_1 = /*#__PURE__*/require("./renderMenu");
|
|
13
13
|
/**
|
|
14
14
|
* Wrapper component that manages state for a popup MenuList and a MenuTrigger
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const Menu = props => {
|
|
19
|
+
const state = useMenu_1.useMenu(props);
|
|
20
|
+
const contextValues = useMenuContextValues_1.useMenuContextValues(state);
|
|
21
21
|
return renderMenu_1.renderMenu(state, contextValues);
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":";;;;;;;AACA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,IAAI,GAAwB,KAAK,IAAG;AAC/C,QAAM,KAAK,GAAG,SAAA,CAAA,OAAA,CAAQ,KAAR,CAAd;AACA,QAAM,aAAa,GAAG,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAtB;AAEA,SAAO,YAAA,CAAA,UAAA,CAAW,KAAX,EAAkB,aAAlB,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,IAAA,GAAI,IAAJ;AAOb,OAAA,CAAA,IAAA,CAAK,WAAL,GAAmB,MAAnB","sourceRoot":""}
|