@fluentui/react-menu 9.0.0-rc.7 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +559 -1
- package/CHANGELOG.md +276 -132
- package/dist/{react-menu.d.ts → index.d.ts} +125 -155
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.js +21 -7
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.js +20 -20
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +4 -8
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.js +0 -5
- package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +0 -5
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.js +4 -2
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.js +33 -35
- package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -5
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -5
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/MenuList.types.js.map +1 -1
- package/lib/components/MenuList/index.js +1 -0
- package/lib/components/MenuList/index.js.map +1 -1
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.js +2 -2
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +8 -8
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.js +0 -5
- package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +0 -5
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +5 -10
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.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 +1 -1
- 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/index.js +16 -16
- package/lib/index.js.map +1 -1
- package/lib/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib/utils/useIsSubmenu.js.map +1 -1
- package/lib/utils/useOnMenuEnter.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.js +19 -5
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +20 -20
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +5 -9
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +1 -6
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +1 -6
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.js +5 -3
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +35 -36
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +1 -6
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +1 -6
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/index.js +2 -0
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +2 -2
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +8 -8
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.js +1 -6
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +1 -6
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +6 -11
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/index.js +411 -17
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
- package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
- package/package.json +20 -20
- package/lib/Menu.d.ts +0 -1
- package/lib/MenuDivider.d.ts +0 -1
- package/lib/MenuGroup.d.ts +0 -1
- package/lib/MenuGroupHeader.d.ts +0 -1
- package/lib/MenuItem.d.ts +0 -1
- package/lib/MenuItemCheckbox.d.ts +0 -1
- package/lib/MenuItemRadio.d.ts +0 -1
- package/lib/MenuList.d.ts +0 -1
- package/lib/MenuPopover.d.ts +0 -1
- package/lib/MenuSplitGroup.d.ts +0 -1
- package/lib/MenuTrigger.d.ts +0 -1
- package/lib/components/Menu/Menu.d.ts +0 -6
- package/lib/components/Menu/Menu.types.d.ts +0 -113
- package/lib/components/Menu/index.d.ts +0 -5
- package/lib/components/Menu/renderMenu.d.ts +0 -5
- package/lib/components/Menu/useMenu.d.ts +0 -10
- package/lib/components/Menu/useMenuContextValues.d.ts +0 -2
- package/lib/components/MenuDivider/MenuDivider.d.ts +0 -6
- package/lib/components/MenuDivider/MenuDivider.types.d.ts +0 -6
- package/lib/components/MenuDivider/index.d.ts +0 -5
- package/lib/components/MenuDivider/renderMenuDivider.d.ts +0 -6
- package/lib/components/MenuDivider/useMenuDivider.d.ts +0 -6
- package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +0 -8
- package/lib/components/MenuGroup/MenuGroup.d.ts +0 -6
- package/lib/components/MenuGroup/MenuGroup.types.d.ts +0 -15
- package/lib/components/MenuGroup/index.d.ts +0 -6
- package/lib/components/MenuGroup/renderMenuGroup.d.ts +0 -6
- package/lib/components/MenuGroup/useMenuGroup.d.ts +0 -6
- package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
- package/lib/components/MenuGroup/useMenuGroupStyles.d.ts +0 -8
- package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
- package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
- package/lib/components/MenuGroupHeader/index.d.ts +0 -5
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -8
- package/lib/components/MenuItem/MenuItem.d.ts +0 -6
- package/lib/components/MenuItem/MenuItem.types.d.ts +0 -43
- package/lib/components/MenuItem/index.d.ts +0 -5
- package/lib/components/MenuItem/renderMenuItem.d.ts +0 -5
- package/lib/components/MenuItem/useCharacterSearch.d.ts +0 -3
- package/lib/components/MenuItem/useMenuItem.d.ts +0 -6
- package/lib/components/MenuItem/useMenuItemStyles.d.ts +0 -9
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
- package/lib/components/MenuItemCheckbox/index.d.ts +0 -5
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -9
- package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
- package/lib/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
- package/lib/components/MenuItemRadio/index.d.ts +0 -5
- package/lib/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
- package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -9
- package/lib/components/MenuList/MenuList.d.ts +0 -6
- package/lib/components/MenuList/MenuList.types.d.ts +0 -55
- package/lib/components/MenuList/index.d.ts +0 -6
- package/lib/components/MenuList/renderMenuList.d.ts +0 -5
- package/lib/components/MenuList/useMenuList.d.ts +0 -6
- package/lib/components/MenuList/useMenuListContextValues.d.ts +0 -2
- package/lib/components/MenuList/useMenuListStyles.d.ts +0 -11
- package/lib/components/MenuPopover/MenuPopover.d.ts +0 -6
- package/lib/components/MenuPopover/MenuPopover.types.d.ts +0 -18
- package/lib/components/MenuPopover/index.d.ts +0 -5
- package/lib/components/MenuPopover/renderMenuPopover.d.ts +0 -5
- package/lib/components/MenuPopover/useMenuPopover.d.ts +0 -12
- package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -11
- package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +0 -6
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +0 -14
- package/lib/components/MenuSplitGroup/index.d.ts +0 -5
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +0 -5
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +0 -12
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +0 -11
- package/lib/components/MenuTrigger/MenuTrigger.d.ts +0 -8
- package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +0 -20
- package/lib/components/MenuTrigger/index.d.ts +0 -4
- package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
- package/lib/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
- package/lib/components/index.d.ts +0 -2
- package/lib/contexts/menuContext.d.ts +0 -16
- package/lib/contexts/menuGroupContext.d.ts +0 -13
- package/lib/contexts/menuListContext.d.ts +0 -15
- package/lib/contexts/menuTriggerContext.d.ts +0 -3
- package/lib/index.d.ts +0 -16
- package/lib/selectable/index.d.ts +0 -2
- package/lib/selectable/types.d.ts +0 -34
- package/lib/selectable/useCheckmarkStyles.d.ts +0 -8
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/useIsSubmenu.d.ts +0 -9
- package/lib/utils/useOnMenuEnter.d.ts +0 -23
- package/lib-commonjs/Menu.d.ts +0 -1
- package/lib-commonjs/MenuDivider.d.ts +0 -1
- package/lib-commonjs/MenuGroup.d.ts +0 -1
- package/lib-commonjs/MenuGroupHeader.d.ts +0 -1
- package/lib-commonjs/MenuItem.d.ts +0 -1
- package/lib-commonjs/MenuItemCheckbox.d.ts +0 -1
- package/lib-commonjs/MenuItemRadio.d.ts +0 -1
- package/lib-commonjs/MenuList.d.ts +0 -1
- package/lib-commonjs/MenuPopover.d.ts +0 -1
- package/lib-commonjs/MenuSplitGroup.d.ts +0 -1
- package/lib-commonjs/MenuTrigger.d.ts +0 -1
- package/lib-commonjs/components/Menu/Menu.d.ts +0 -6
- package/lib-commonjs/components/Menu/Menu.types.d.ts +0 -113
- package/lib-commonjs/components/Menu/index.d.ts +0 -5
- package/lib-commonjs/components/Menu/renderMenu.d.ts +0 -5
- package/lib-commonjs/components/Menu/useMenu.d.ts +0 -10
- package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +0 -2
- package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +0 -6
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +0 -6
- package/lib-commonjs/components/MenuDivider/index.d.ts +0 -5
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +0 -6
- package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +0 -6
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +0 -8
- package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +0 -6
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +0 -15
- package/lib-commonjs/components/MenuGroup/index.d.ts +0 -6
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.d.ts +0 -6
- package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +0 -6
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +0 -2
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.d.ts +0 -8
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +0 -6
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +0 -6
- package/lib-commonjs/components/MenuGroupHeader/index.d.ts +0 -5
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +0 -6
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +0 -6
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +0 -8
- package/lib-commonjs/components/MenuItem/MenuItem.d.ts +0 -6
- package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +0 -43
- package/lib-commonjs/components/MenuItem/index.d.ts +0 -5
- package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +0 -5
- package/lib-commonjs/components/MenuItem/useCharacterSearch.d.ts +0 -3
- package/lib-commonjs/components/MenuItem/useMenuItem.d.ts +0 -6
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +0 -9
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -6
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +0 -4
- package/lib-commonjs/components/MenuItemCheckbox/index.d.ts +0 -5
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.d.ts +0 -3
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +0 -4
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +0 -9
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +0 -6
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.d.ts +0 -4
- package/lib-commonjs/components/MenuItemRadio/index.d.ts +0 -5
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.d.ts +0 -6
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +0 -6
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +0 -9
- package/lib-commonjs/components/MenuList/MenuList.d.ts +0 -6
- package/lib-commonjs/components/MenuList/MenuList.types.d.ts +0 -55
- package/lib-commonjs/components/MenuList/index.d.ts +0 -6
- package/lib-commonjs/components/MenuList/renderMenuList.d.ts +0 -5
- package/lib-commonjs/components/MenuList/useMenuList.d.ts +0 -6
- package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +0 -2
- package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +0 -11
- package/lib-commonjs/components/MenuPopover/MenuPopover.d.ts +0 -6
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +0 -18
- package/lib-commonjs/components/MenuPopover/index.d.ts +0 -5
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +0 -5
- package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +0 -12
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -11
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +0 -6
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +0 -14
- package/lib-commonjs/components/MenuSplitGroup/index.d.ts +0 -5
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +0 -5
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +0 -12
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +0 -11
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +0 -8
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +0 -20
- package/lib-commonjs/components/MenuTrigger/index.d.ts +0 -4
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +0 -7
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +0 -8
- package/lib-commonjs/components/index.d.ts +0 -2
- package/lib-commonjs/contexts/menuContext.d.ts +0 -16
- package/lib-commonjs/contexts/menuGroupContext.d.ts +0 -13
- package/lib-commonjs/contexts/menuListContext.d.ts +0 -15
- package/lib-commonjs/contexts/menuTriggerContext.d.ts +0 -3
- package/lib-commonjs/index.d.ts +0 -16
- package/lib-commonjs/selectable/index.d.ts +0 -2
- package/lib-commonjs/selectable/types.d.ts +0 -34
- package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +0 -8
- package/lib-commonjs/utils/index.d.ts +0 -1
- package/lib-commonjs/utils/useIsSubmenu.d.ts +0 -9
- package/lib-commonjs/utils/useOnMenuEnter.d.ts +0 -23
@@ -1,14 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import type {
|
1
|
+
/// <reference types="react" />
|
2
|
+
|
3
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
4
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
4
5
|
import type { ContextSelector } from '@fluentui/react-context-selector';
|
5
6
|
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
6
7
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
7
|
-
import { PositioningShorthand } from '@fluentui/react-positioning';
|
8
|
+
import type { PositioningShorthand } from '@fluentui/react-positioning';
|
8
9
|
import * as React_2 from 'react';
|
9
10
|
import type { Slot } from '@fluentui/react-utilities';
|
10
11
|
import type { SlotClassNames } from '@fluentui/react-utilities';
|
11
|
-
import {
|
12
|
+
import { usePositioningMouseTarget } from '@fluentui/react-positioning';
|
12
13
|
|
13
14
|
/**
|
14
15
|
* Wrapper component that manages state for a popup MenuList and a MenuTrigger
|
@@ -16,50 +17,14 @@ import { usePopperMouseTarget } from '@fluentui/react-positioning';
|
|
16
17
|
export declare const Menu: React_2.FC<MenuProps>;
|
17
18
|
|
18
19
|
export declare type MenuCheckedValueChangeData = {
|
19
|
-
/** The name of the value */
|
20
|
-
name: string;
|
21
20
|
/** The items for this value that are checked */
|
22
21
|
checkedItems: string[];
|
22
|
+
/** The name of the value */
|
23
|
+
name: string;
|
23
24
|
};
|
24
25
|
|
25
26
|
export declare type MenuCheckedValueChangeEvent = React_2.MouseEvent | React_2.KeyboardEvent;
|
26
27
|
|
27
|
-
declare type MenuCommons = MenuListCommons & {
|
28
|
-
/**
|
29
|
-
* Whether the popup is open
|
30
|
-
*/
|
31
|
-
open: boolean;
|
32
|
-
/**
|
33
|
-
* Call back when the component requests to change value
|
34
|
-
* The `open` value is used as a hint when directly controlling the component
|
35
|
-
*/
|
36
|
-
onOpenChange?: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
|
37
|
-
/**
|
38
|
-
* Whether the popup is open by default
|
39
|
-
*/
|
40
|
-
defaultOpen?: boolean;
|
41
|
-
openOnHover: boolean;
|
42
|
-
/**
|
43
|
-
* Opens the menu on right click (context menu), removes all other menu open interactions
|
44
|
-
*/
|
45
|
-
openOnContext?: boolean;
|
46
|
-
/**
|
47
|
-
* Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order
|
48
|
-
* This option is disregarded for submenus
|
49
|
-
*/
|
50
|
-
inline?: boolean;
|
51
|
-
/**
|
52
|
-
* Do not dismiss the menu when a menu item is clicked
|
53
|
-
*/
|
54
|
-
persistOnItemClick?: boolean;
|
55
|
-
/**
|
56
|
-
* Sets the delay for mouse open/close for the popover one mouse enter/leave
|
57
|
-
*/
|
58
|
-
hoverDelay?: number;
|
59
|
-
};
|
60
|
-
|
61
|
-
export declare const MenuContext: Context<MenuContextValue>;
|
62
|
-
|
63
28
|
/**
|
64
29
|
* Context shared between Menu and its children components
|
65
30
|
*
|
@@ -79,11 +44,6 @@ export declare type MenuContextValues = {
|
|
79
44
|
*/
|
80
45
|
export declare const MenuDivider: ForwardRefComponent<MenuDividerProps>;
|
81
46
|
|
82
|
-
/**
|
83
|
-
* @deprecated Use `menuDividerClassNames.root` instead.
|
84
|
-
*/
|
85
|
-
export declare const menuDividerClassName = "fui-MenuDivider";
|
86
|
-
|
87
47
|
export declare const menuDividerClassNames: SlotClassNames<MenuDividerSlots>;
|
88
48
|
|
89
49
|
export declare type MenuDividerProps = ComponentProps<MenuDividerSlots>;
|
@@ -99,11 +59,6 @@ export declare type MenuDividerState = ComponentState<MenuDividerSlots>;
|
|
99
59
|
*/
|
100
60
|
export declare const MenuGroup: ForwardRefComponent<MenuGroupProps>;
|
101
61
|
|
102
|
-
/**
|
103
|
-
* @deprecated Use `menuGroupClassNames.root` instead.
|
104
|
-
*/
|
105
|
-
export declare const menuGroupClassName = "fui-MenuGroup";
|
106
|
-
|
107
62
|
export declare const menuGroupClassNames: SlotClassNames<MenuGroupSlots>;
|
108
63
|
|
109
64
|
export declare const MenuGroupContextProvider: React_2.Provider<MenuGroupContextValue>;
|
@@ -128,11 +83,6 @@ export declare type MenuGroupContextValues = {
|
|
128
83
|
*/
|
129
84
|
export declare const MenuGroupHeader: ForwardRefComponent<MenuGroupHeaderProps>;
|
130
85
|
|
131
|
-
/**
|
132
|
-
* @deprecated Use `menuGroupHeaderClassNames.root` instead.
|
133
|
-
*/
|
134
|
-
export declare const menuGroupHeaderClassName = "fui-MenuGroupHeader";
|
135
|
-
|
136
86
|
export declare const menuGroupHeaderClassNames: SlotClassNames<MenuGroupHeaderSlots>;
|
137
87
|
|
138
88
|
export declare type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;
|
@@ -166,51 +116,40 @@ export declare const MenuItem: ForwardRefComponent<MenuItemProps>;
|
|
166
116
|
*/
|
167
117
|
export declare const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps>;
|
168
118
|
|
169
|
-
/**
|
170
|
-
* @deprecated Use `menuItemCheckboxClassNames.root` instead.
|
171
|
-
*/
|
172
|
-
export declare const menuItemCheckboxClassName = "fui-MenuItemCheckbox";
|
173
|
-
|
174
119
|
export declare const menuItemCheckboxClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>>;
|
175
120
|
|
176
121
|
export declare type MenuItemCheckboxProps = MenuItemProps & MenuItemSelectableProps;
|
177
122
|
|
178
123
|
export declare type MenuItemCheckboxState = MenuItemState & MenuItemSelectableState;
|
179
124
|
|
180
|
-
/**
|
181
|
-
* @deprecated Use `menuItemClassNames.root` instead.
|
182
|
-
*/
|
183
|
-
export declare const menuItemClassName = "fui-MenuItem";
|
184
|
-
|
185
125
|
export declare const menuItemClassNames: SlotClassNames<MenuItemSlots>;
|
186
126
|
|
187
|
-
declare type
|
188
|
-
/**
|
189
|
-
* If the menu item is a trigger for a submenu
|
190
|
-
*/
|
191
|
-
hasSubmenu?: boolean;
|
127
|
+
export declare type MenuItemProps = ComponentProps<Partial<MenuItemSlots>> & {
|
192
128
|
/**
|
193
129
|
* Applies disabled styles to menu item but remains focusable
|
130
|
+
*
|
131
|
+
* @default false
|
194
132
|
*/
|
195
133
|
disabled?: boolean;
|
134
|
+
/**
|
135
|
+
* If the menu item is a trigger for a submenu
|
136
|
+
*
|
137
|
+
* @default false
|
138
|
+
*/
|
139
|
+
hasSubmenu?: boolean;
|
196
140
|
/**
|
197
141
|
* Clicking on the menu item will not dismiss an open menu
|
142
|
+
*
|
143
|
+
* @default false
|
198
144
|
*/
|
199
145
|
persistOnClick?: boolean;
|
200
146
|
};
|
201
147
|
|
202
|
-
export declare type MenuItemProps = ComponentProps<Partial<MenuItemSlots>> & MenuItemCommons;
|
203
|
-
|
204
148
|
/**
|
205
149
|
* Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.
|
206
150
|
*/
|
207
151
|
export declare const MenuItemRadio: ForwardRefComponent<MenuItemRadioProps>;
|
208
152
|
|
209
|
-
/**
|
210
|
-
* @deprecated Use `menuItemRadioClassNames.root` instead.
|
211
|
-
*/
|
212
|
-
export declare const menuItemRadioClassName = "fui-MenuItemRadio";
|
213
|
-
|
214
153
|
export declare const menuItemRadioClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>>;
|
215
154
|
|
216
155
|
export declare type MenuItemRadioProps = MenuItemProps & MenuItemSelectableProps;
|
@@ -277,111 +216,97 @@ export declare type MenuItemSlots = {
|
|
277
216
|
secondaryContent?: Slot<'span'>;
|
278
217
|
};
|
279
218
|
|
280
|
-
export declare type MenuItemState = ComponentState<MenuItemSlots> &
|
219
|
+
export declare type MenuItemState = ComponentState<MenuItemSlots> & Pick<MenuItemProps, 'disabled' | 'hasSubmenu' | 'persistOnClick'>;
|
281
220
|
|
282
221
|
/**
|
283
222
|
* Define a styled MenuList, using the `useMenuList_unstable` hook.
|
284
223
|
*/
|
285
224
|
export declare const MenuList: ForwardRefComponent<MenuListProps>;
|
286
225
|
|
226
|
+
export declare const menuListClassNames: SlotClassNames<MenuListSlots>;
|
227
|
+
|
287
228
|
/**
|
288
|
-
*
|
229
|
+
* Context shared between MenuList and its children components
|
289
230
|
*/
|
290
|
-
export declare
|
231
|
+
export declare type MenuListContextValue = Pick<MenuListProps, 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'> & {
|
232
|
+
setFocusByFirstCharacter?: (e: React_2.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;
|
233
|
+
toggleCheckbox?: SelectableHandler;
|
234
|
+
selectRadio?: SelectableHandler;
|
235
|
+
};
|
291
236
|
|
292
|
-
export declare
|
237
|
+
export declare type MenuListContextValues = {
|
238
|
+
menuList: MenuListContextValue;
|
239
|
+
};
|
293
240
|
|
294
|
-
declare type
|
295
|
-
/**
|
296
|
-
* Callback when checked items change for value with a name
|
297
|
-
*
|
298
|
-
* @param event - React's original SyntheticEvent
|
299
|
-
* @param data - A data object with relevant information
|
300
|
-
*/
|
301
|
-
onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;
|
241
|
+
export declare type MenuListProps = ComponentProps<MenuListSlots> & {
|
302
242
|
/**
|
303
243
|
* Map of all checked values
|
304
244
|
*/
|
305
|
-
checkedValues
|
245
|
+
checkedValues?: Record<string, string[]>;
|
306
246
|
/**
|
307
247
|
* Default values to be checked on mount
|
308
248
|
*/
|
309
249
|
defaultCheckedValues?: Record<string, string[]>;
|
250
|
+
/**
|
251
|
+
* States that menu items can contain selectable items and reserve slots for item alignment
|
252
|
+
*/
|
253
|
+
hasCheckmarks?: boolean;
|
310
254
|
/**
|
311
255
|
* States that menu items can contain icons and reserve slots for item alignment
|
312
256
|
*/
|
313
257
|
hasIcons?: boolean;
|
314
258
|
/**
|
315
|
-
*
|
259
|
+
* Callback when checked items change for value with a name
|
260
|
+
*
|
261
|
+
* @param event - React's original SyntheticEvent
|
262
|
+
* @param data - A data object with relevant information
|
316
263
|
*/
|
317
|
-
|
318
|
-
};
|
319
|
-
|
320
|
-
export declare const MenuListContext: Context<MenuListContextValue>;
|
321
|
-
|
322
|
-
/**
|
323
|
-
* Context shared between MenuList and its children components
|
324
|
-
*/
|
325
|
-
export declare type MenuListContextValue = Pick<MenuListProps, 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'> & {
|
326
|
-
setFocusByFirstCharacter?: (e: React_2.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;
|
327
|
-
toggleCheckbox?: SelectableHandler;
|
328
|
-
selectRadio?: SelectableHandler;
|
329
|
-
};
|
330
|
-
|
331
|
-
export declare type MenuListContextValues = {
|
332
|
-
menuList: MenuListContextValue;
|
264
|
+
onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;
|
333
265
|
};
|
334
266
|
|
335
|
-
export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<MenuListCommons>;
|
336
|
-
|
337
267
|
export declare const MenuListProvider: React_2.Provider<MenuListContextValue> & React_2.FC<React_2.ProviderProps<MenuListContextValue>>;
|
338
268
|
|
339
269
|
export declare type MenuListSlots = {
|
340
270
|
root: Slot<'div'>;
|
341
271
|
};
|
342
272
|
|
343
|
-
export declare type MenuListState = ComponentState<MenuListSlots> &
|
273
|
+
export declare type MenuListState = ComponentState<MenuListSlots> & Pick<MenuListProps, 'defaultCheckedValues' | 'onCheckedValueChange'> & Required<Pick<MenuListProps, 'checkedValues' | 'hasCheckmarks' | 'hasIcons'>> & {
|
274
|
+
/**
|
275
|
+
* Selects a radio item, will de-select the currently selected ratio item
|
276
|
+
*/
|
277
|
+
selectRadio: SelectableHandler;
|
344
278
|
/**
|
345
279
|
* Callback to set focus on the next menu item by first character
|
346
280
|
*/
|
347
281
|
setFocusByFirstCharacter: NonNullable<MenuListContextValue['setFocusByFirstCharacter']>;
|
348
282
|
toggleCheckbox: SelectableHandler;
|
349
|
-
/**
|
350
|
-
* Selects a radio item, will de-select the currently selected ratio item
|
351
|
-
*/
|
352
|
-
selectRadio: SelectableHandler;
|
353
283
|
};
|
354
284
|
|
355
285
|
/**
|
356
286
|
* Data attached to open/close events
|
357
287
|
*/
|
358
288
|
export declare type MenuOpenChangeData = {
|
359
|
-
open: boolean;
|
360
|
-
/**
|
361
|
-
* Indicates whether the change of state was a keyboard interaction
|
362
|
-
*/
|
363
|
-
keyboard?: boolean;
|
364
289
|
/**
|
365
290
|
* indicates whether the request for the open state was bubbled from a nested menu
|
366
291
|
*/
|
367
292
|
bubble?: boolean;
|
293
|
+
/**
|
294
|
+
* Indicates whether the change of state was a keyboard interaction
|
295
|
+
*/
|
296
|
+
keyboard?: boolean;
|
297
|
+
open: boolean;
|
368
298
|
};
|
369
299
|
|
370
300
|
/**
|
371
301
|
* The supported events that will trigger open/close of the menu
|
372
302
|
*/
|
373
|
-
export declare type MenuOpenEvents = MouseEvent | TouchEvent | React_2.
|
303
|
+
export declare type MenuOpenEvents = MouseEvent | TouchEvent | React_2.FocusEvent<HTMLElement> | React_2.KeyboardEvent<HTMLElement> | React_2.MouseEvent<HTMLElement>;
|
374
304
|
|
375
305
|
/**
|
376
306
|
* Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus
|
377
307
|
*/
|
378
308
|
export declare const MenuPopover: ForwardRefComponent<MenuPopoverProps>;
|
379
309
|
|
380
|
-
/**
|
381
|
-
* @deprecated Use `menuPopoverClassNames.root` instead.
|
382
|
-
*/
|
383
|
-
export declare const menuPopoverClassName = "fui-MenuPopover";
|
384
|
-
|
385
310
|
export declare const menuPopoverClassNames: SlotClassNames<MenuPopoverSlots>;
|
386
311
|
|
387
312
|
/**
|
@@ -407,16 +332,68 @@ export declare type MenuPopoverState = ComponentState<MenuPopoverSlots> & {
|
|
407
332
|
/**
|
408
333
|
* Extends and drills down Menulist props to simplify API
|
409
334
|
*/
|
410
|
-
export declare type MenuProps =
|
335
|
+
export declare type MenuProps = ComponentProps<MenuSlots> & Pick<MenuListProps, 'checkedValues' | 'defaultCheckedValues' | 'hasCheckmarks' | 'hasIcons' | 'onCheckedValueChange'> & {
|
411
336
|
/**
|
412
337
|
* Can contain two children including {@link MenuTrigger} and {@link MenuPopover}.
|
413
338
|
* Alternatively can only contain {@link MenuPopover} if using a custom `target`.
|
414
339
|
*/
|
415
340
|
children: [JSX.Element, JSX.Element] | JSX.Element;
|
341
|
+
/**
|
342
|
+
* Whether the popup is open by default
|
343
|
+
*
|
344
|
+
* @default false
|
345
|
+
*/
|
346
|
+
defaultOpen?: boolean;
|
347
|
+
/**
|
348
|
+
* Sets the delay for mouse open/close for the popover one mouse enter/leave
|
349
|
+
*/
|
350
|
+
hoverDelay?: number;
|
351
|
+
/**
|
352
|
+
* Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order
|
353
|
+
* This option is disregarded for submenus
|
354
|
+
*
|
355
|
+
* @default false
|
356
|
+
*/
|
357
|
+
inline?: boolean;
|
358
|
+
/**
|
359
|
+
* Call back when the component requests to change value
|
360
|
+
* The `open` value is used as a hint when directly controlling the component
|
361
|
+
*/
|
362
|
+
onOpenChange?: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
|
363
|
+
/**
|
364
|
+
* Whether the popup is open
|
365
|
+
*
|
366
|
+
* @default false
|
367
|
+
*/
|
368
|
+
open?: boolean;
|
369
|
+
/**
|
370
|
+
* Opens the menu on right click (context menu), removes all other menu open interactions
|
371
|
+
*
|
372
|
+
* @default false
|
373
|
+
*/
|
374
|
+
openOnContext?: boolean;
|
375
|
+
/**
|
376
|
+
* Opens the menu on hover
|
377
|
+
*
|
378
|
+
* @default false
|
379
|
+
*/
|
380
|
+
openOnHover?: boolean;
|
381
|
+
/**
|
382
|
+
* Do not dismiss the menu when a menu item is clicked
|
383
|
+
*
|
384
|
+
* @default false
|
385
|
+
*/
|
386
|
+
persistOnItemClick?: boolean;
|
416
387
|
/**
|
417
388
|
* Configures the positioned menu
|
418
389
|
*/
|
419
390
|
positioning?: PositioningShorthand;
|
391
|
+
/**
|
392
|
+
* Close when scroll outside of it
|
393
|
+
*
|
394
|
+
* @default false
|
395
|
+
*/
|
396
|
+
closeOnScroll?: boolean;
|
420
397
|
};
|
421
398
|
|
422
399
|
export declare const MenuProvider: React_2.Provider<MenuContextValue> & React_2.FC<React_2.ProviderProps<MenuContextValue>>;
|
@@ -428,19 +405,12 @@ export declare type MenuSlots = {};
|
|
428
405
|
*/
|
429
406
|
export declare const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps>;
|
430
407
|
|
431
|
-
/**
|
432
|
-
* @deprecated Use `menuSplitGroupClassNames.root` instead.
|
433
|
-
*/
|
434
|
-
export declare const menuSplitGroupClassName = "fui-MenuSplitGroup";
|
435
|
-
|
436
408
|
export declare const menuSplitGroupClassNames: SlotClassNames<MenuSplitGroupSlots>;
|
437
409
|
|
438
|
-
declare type MenuSplitGroupCommons = {};
|
439
|
-
|
440
410
|
/**
|
441
411
|
* MenuSplitGroup Props
|
442
412
|
*/
|
443
|
-
export declare type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots
|
413
|
+
export declare type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots>;
|
444
414
|
|
445
415
|
export declare type MenuSplitGroupSlots = {
|
446
416
|
root: Slot<'div'>;
|
@@ -449,45 +419,45 @@ export declare type MenuSplitGroupSlots = {
|
|
449
419
|
/**
|
450
420
|
* State used in rendering MenuSplitGroup
|
451
421
|
*/
|
452
|
-
export declare type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots
|
422
|
+
export declare type MenuSplitGroupState = ComponentState<MenuSplitGroupSlots>;
|
453
423
|
|
454
|
-
export declare type MenuState =
|
424
|
+
export declare type MenuState = ComponentState<MenuSlots> & Pick<MenuProps, 'defaultCheckedValues' | 'hasCheckmarks' | 'hasIcons' | 'inline' | 'onOpenChange' | 'openOnContext' | 'persistOnItemClick'> & Required<Pick<MenuProps, 'checkedValues' | 'onCheckedValueChange' | 'open' | 'openOnHover' | 'closeOnScroll'>> & {
|
455
425
|
/**
|
456
|
-
*
|
426
|
+
* Anchors the popper to the mouse click for context events
|
457
427
|
*/
|
458
|
-
|
428
|
+
contextTarget: ReturnType<typeof usePositioningMouseTarget>[0];
|
459
429
|
/**
|
460
|
-
*
|
430
|
+
* Whether this menu is a submenu
|
461
431
|
*/
|
462
|
-
|
432
|
+
isSubmenu: boolean;
|
463
433
|
/**
|
464
434
|
* Internal react node that just simplifies handling children
|
465
435
|
*/
|
466
|
-
|
436
|
+
menuPopover: React_2.ReactNode;
|
467
437
|
/**
|
468
438
|
* The ref for the popup
|
469
439
|
*/
|
470
440
|
menuPopoverRef: React_2.MutableRefObject<HTMLElement>;
|
471
441
|
/**
|
472
|
-
*
|
442
|
+
* Internal react node that just simplifies handling children
|
473
443
|
*/
|
474
|
-
|
444
|
+
menuTrigger: React_2.ReactNode;
|
475
445
|
/**
|
476
|
-
*
|
446
|
+
* A callback to set the target of the popper to the mouse click for context events
|
477
447
|
*/
|
478
|
-
|
448
|
+
setContextTarget: ReturnType<typeof usePositioningMouseTarget>[1];
|
479
449
|
/**
|
480
|
-
*
|
450
|
+
* Callback to open/close the popup
|
481
451
|
*/
|
482
|
-
|
452
|
+
setOpen: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;
|
483
453
|
/**
|
484
|
-
*
|
454
|
+
* Id for the MenuTrigger element for aria relationship
|
485
455
|
*/
|
486
|
-
|
456
|
+
triggerId: string;
|
487
457
|
/**
|
488
|
-
*
|
458
|
+
* The ref for the MenuTrigger, used for popup positioning
|
489
459
|
*/
|
490
|
-
|
460
|
+
triggerRef: React_2.MutableRefObject<HTMLElement>;
|
491
461
|
};
|
492
462
|
|
493
463
|
/**
|
@@ -581,7 +551,7 @@ export declare const renderMenuTrigger_unstable: (state: MenuTriggerState) => JS
|
|
581
551
|
|
582
552
|
export declare type SelectableHandler = (e: React_2.MouseEvent | React_2.KeyboardEvent, name: string, value: string, checked: boolean) => void;
|
583
553
|
|
584
|
-
export declare type UninitializedMenuListState = Omit<MenuListState, '
|
554
|
+
export declare type UninitializedMenuListState = Omit<MenuListState, 'checkedValues' | 'selectRadio' | 'setFocusByFirstCharacter' | 'toggleCheckbox'> & Partial<Pick<MenuListState, 'checkedValues'>>;
|
585
555
|
|
586
556
|
/**
|
587
557
|
* Applies styles to a checkmark slot for selectable menu items
|
File without changes
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,SAAS,gBAAT,QAAiC,WAAjC;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AACA,SAAS,mBAAT,QAAoC,cAApC;AAGA;;AAEG;;AACH,OAAO,MAAM,IAAI,GAAwB,KAAK,IAAG;
|
1
|
+
{"version":3,"sources":["components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,SAAS,gBAAT,QAAiC,WAAjC;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AACA,SAAS,mBAAT,QAAoC,cAApC;AAGA;;AAEG;;AACH,OAAO,MAAM,IAAI,GAAwB,KAAK,IAAG;EAC/C,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,CAA9B;EACA,MAAM,aAAa,GAAG,6BAA6B,CAAC,KAAD,CAAnD;EAEA,OAAO,mBAAmB,CAAC,KAAD,EAAQ,aAAR,CAA1B;AACD,CALM;AAOP,IAAI,CAAC,WAAL,GAAmB,MAAnB","sourcesContent":["import * as React from 'react';\nimport { useMenu_unstable } from './useMenu';\nimport { useMenuContextValues_unstable } from './useMenuContextValues';\nimport { renderMenu_unstable } from './renderMenu';\nimport type { MenuProps } from './Menu.types';\n\n/**\n * Wrapper component that manages state for a popup MenuList and a MenuTrigger\n */\nexport const Menu: React.FC<MenuProps> = props => {\n const state = useMenu_unstable(props);\n const contextValues = useMenuContextValues_unstable(state);\n\n return renderMenu_unstable(state, contextValues);\n};\n\nMenu.displayName = 'Menu';\n"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Menu.types.js","sourceRoot":"../src/","sources":["components/Menu/Menu.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport {
|
1
|
+
{"version":3,"file":"Menu.types.js","sourceRoot":"../src/","sources":["components/Menu/Menu.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { usePositioningMouseTarget } from '@fluentui/react-positioning';\nimport type { PositioningShorthand } from '@fluentui/react-positioning';\nimport type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { MenuContextValue } from '../../contexts/menuContext';\nimport type { MenuListProps } from '../MenuList/MenuList.types';\n\nexport type MenuSlots = {};\n\n/**\n * Extends and drills down Menulist props to simplify API\n */\nexport type MenuProps = ComponentProps<MenuSlots> &\n Pick<\n MenuListProps,\n 'checkedValues' | 'defaultCheckedValues' | 'hasCheckmarks' | 'hasIcons' | 'onCheckedValueChange'\n > & {\n /**\n * Can contain two children including {@link MenuTrigger} and {@link MenuPopover}.\n * Alternatively can only contain {@link MenuPopover} if using a custom `target`.\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n\n /**\n * Whether the popup is open by default\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Sets the delay for mouse open/close for the popover one mouse enter/leave\n */\n hoverDelay?: number;\n\n /**\n * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order\n * This option is disregarded for submenus\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Call back when the component requests to change value\n * The `open` value is used as a hint when directly controlling the component\n */\n onOpenChange?: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;\n\n /**\n * Whether the popup is open\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Opens the menu on right click (context menu), removes all other menu open interactions\n *\n * @default false\n */\n openOnContext?: boolean;\n\n /**\n * Opens the menu on hover\n *\n * @default false\n */\n openOnHover?: boolean;\n\n /**\n * Do not dismiss the menu when a menu item is clicked\n *\n * @default false\n */\n persistOnItemClick?: boolean;\n\n /**\n * Configures the positioned menu\n */\n positioning?: PositioningShorthand;\n\n /**\n * Close when scroll outside of it\n *\n * @default false\n */\n closeOnScroll?: boolean;\n };\n\nexport type MenuState = ComponentState<MenuSlots> &\n Pick<\n MenuProps,\n | 'defaultCheckedValues'\n | 'hasCheckmarks'\n | 'hasIcons'\n | 'inline'\n | 'onOpenChange'\n | 'openOnContext'\n | 'persistOnItemClick'\n > &\n Required<Pick<MenuProps, 'checkedValues' | 'onCheckedValueChange' | 'open' | 'openOnHover' | 'closeOnScroll'>> & {\n /**\n * Anchors the popper to the mouse click for context events\n */\n contextTarget: ReturnType<typeof usePositioningMouseTarget>[0];\n\n /**\n * Whether this menu is a submenu\n */\n isSubmenu: boolean;\n\n /**\n * Internal react node that just simplifies handling children\n */\n menuPopover: React.ReactNode;\n\n /**\n * The ref for the popup\n */\n menuPopoverRef: React.MutableRefObject<HTMLElement>;\n\n /**\n * Internal react node that just simplifies handling children\n */\n menuTrigger: React.ReactNode;\n\n /**\n * A callback to set the target of the popper to the mouse click for context events\n */\n setContextTarget: ReturnType<typeof usePositioningMouseTarget>[1];\n\n /**\n * Callback to open/close the popup\n */\n setOpen: (e: MenuOpenEvents, data: MenuOpenChangeData) => void;\n\n /**\n * Id for the MenuTrigger element for aria relationship\n */\n triggerId: string;\n\n /**\n * The ref for the MenuTrigger, used for popup positioning\n */\n triggerRef: React.MutableRefObject<HTMLElement>;\n };\n\n/**\n * Data attached to open/close events\n */\nexport type MenuOpenChangeData = {\n /**\n * indicates whether the request for the open state was bubbled from a nested menu\n */\n bubble?: boolean;\n /**\n * Indicates whether the change of state was a keyboard interaction\n */\n keyboard?: boolean;\n open: boolean;\n};\n\nexport type MenuContextValues = {\n menu: MenuContextValue;\n};\n\n/**\n * The supported events that will trigger open/close of the menu\n */\nexport type MenuOpenEvents =\n | MouseEvent\n | TouchEvent\n | React.FocusEvent<HTMLElement>\n | React.KeyboardEvent<HTMLElement>\n | React.MouseEvent<HTMLElement>;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Menu/renderMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,4BAA7B;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAmB,aAAnB,KAAuD;
|
1
|
+
{"version":3,"sources":["components/Menu/renderMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,4BAA7B;AAGA;;AAEG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAmB,aAAnB,KAAuD;EACxF,oBACE,KAAA,CAAA,aAAA,CAAC,YAAD,EAAa;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAAb,EACG,KAAK,CAAC,WADT,EAEG,KAAK,CAAC,IAAN,IAAc,KAAK,CAAC,WAFvB,CADF;AAMD,CAPM","sourcesContent":["import * as React from 'react';\nimport { MenuProvider } from '../../contexts/menuContext';\nimport type { MenuContextValues, MenuState } from './Menu.types';\n\n/**\n * Render the final JSX of Menu\n */\nexport const renderMenu_unstable = (state: MenuState, contextValues: MenuContextValues) => {\n return (\n <MenuProvider value={contextValues.menu}>\n {state.menuTrigger}\n {state.open && state.menuPopover}\n </MenuProvider>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import { useControllableState, useId, useOnClickOutside, useEventCallback } from '@fluentui/react-utilities';
|
4
|
-
import { useFluent } from '@fluentui/react-shared-contexts';
|
2
|
+
import { usePositioningMouseTarget, usePositioning, resolvePositioningShorthand } from '@fluentui/react-positioning';
|
3
|
+
import { useControllableState, useId, useOnClickOutside, useEventCallback, useOnScrollOutside } from '@fluentui/react-utilities';
|
4
|
+
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
5
5
|
import { elementContains } from '@fluentui/react-portal';
|
6
6
|
import { useFocusFinders } from '@fluentui/react-tabster';
|
7
7
|
import { useMenuContext_unstable } from '../../contexts/menuContext';
|
@@ -17,10 +17,12 @@ import { useIsSubmenu } from '../../utils/useIsSubmenu';
|
|
17
17
|
*/
|
18
18
|
|
19
19
|
export const useMenu_unstable = props => {
|
20
|
+
var _a;
|
21
|
+
|
20
22
|
const triggerId = useId('menu');
|
21
23
|
const isSubmenu = useIsSubmenu();
|
22
|
-
const [contextTarget, setContextTarget] =
|
23
|
-
const
|
24
|
+
const [contextTarget, setContextTarget] = usePositioningMouseTarget();
|
25
|
+
const positioningState = {
|
24
26
|
position: isSubmenu ? 'after' : 'below',
|
25
27
|
align: isSubmenu ? 'top' : 'start',
|
26
28
|
target: props.openOnContext ? contextTarget : undefined,
|
@@ -53,7 +55,7 @@ export const useMenu_unstable = props => {
|
|
53
55
|
const {
|
54
56
|
targetRef: triggerRef,
|
55
57
|
containerRef: menuPopoverRef
|
56
|
-
} =
|
58
|
+
} = usePositioning(positioningState);
|
57
59
|
const initialState = {
|
58
60
|
hoverDelay: 500,
|
59
61
|
triggerId,
|
@@ -62,6 +64,7 @@ export const useMenu_unstable = props => {
|
|
62
64
|
contextTarget,
|
63
65
|
setContextTarget,
|
64
66
|
...props,
|
67
|
+
closeOnScroll: (_a = props.closeOnScroll) !== null && _a !== void 0 ? _a : false,
|
65
68
|
menuTrigger,
|
66
69
|
menuPopover,
|
67
70
|
triggerRef,
|
@@ -187,10 +190,21 @@ const useMenuOpenState = state => {
|
|
187
190
|
contains: elementContains,
|
188
191
|
disabled: !open,
|
189
192
|
element: targetDocument,
|
190
|
-
refs: [state.menuPopoverRef, state.triggerRef],
|
193
|
+
refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),
|
191
194
|
callback: e => setOpen(e, {
|
192
195
|
open: false
|
193
196
|
})
|
197
|
+
}); // only close on scroll for context, or when closeOnScroll is specified
|
198
|
+
|
199
|
+
const closeOnScroll = state.openOnContext || state.closeOnScroll;
|
200
|
+
useOnScrollOutside({
|
201
|
+
contains: elementContains,
|
202
|
+
element: targetDocument,
|
203
|
+
callback: ev => setOpen(ev, {
|
204
|
+
open: false
|
205
|
+
}),
|
206
|
+
refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),
|
207
|
+
disabled: !open || !closeOnScroll
|
194
208
|
});
|
195
209
|
useOnMenuMouseEnter({
|
196
210
|
element: targetDocument,
|