@fluentui/react-menu 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +464 -27
- package/CHANGELOG.md +102 -20
- package/Spec.md +21 -16
- package/dist/react-menu.d.ts +142 -72
- package/lib/MenuSplitGroup.d.ts +1 -0
- package/lib/MenuSplitGroup.js +2 -0
- package/lib/MenuSplitGroup.js.map +1 -0
- package/lib/components/Menu/Menu.js +7 -7
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +3 -2
- package/lib/components/Menu/renderMenu.d.ts +1 -1
- package/lib/components/Menu/renderMenu.js +1 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.d.ts +2 -2
- package/lib/components/Menu/useMenu.js +119 -128
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.d.ts +1 -1
- package/lib/components/Menu/useMenuContextValues.js +35 -33
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +8 -8
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -2
- package/lib/components/MenuDivider/renderMenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +7 -7
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.d.ts +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js +9 -7
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +2 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +7 -5
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.d.ts +1 -1
- package/lib/components/MenuGroup/MenuGroup.js +10 -8
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.types.d.ts +3 -3
- 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.d.ts +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +7 -7
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.d.ts +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +10 -7
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js +8 -8
- 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.d.ts +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +8 -8
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +7 -7
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +13 -8
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +2 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +7 -5
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.d.ts +1 -1
- package/lib/components/MenuItem/MenuItem.js +8 -10
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.types.d.ts +7 -7
- package/lib/components/MenuItem/renderMenuItem.d.ts +1 -1
- package/lib/components/MenuItem/renderMenuItem.js +12 -8
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js +7 -7
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.d.ts +2 -6
- package/lib/components/MenuItem/useMenuItem.js +35 -45
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.d.ts +2 -1
- package/lib/components/MenuItem/useMenuItemStyles.js +31 -27
- package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +8 -8
- 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.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +11 -8
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +14 -15
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.d.ts +2 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +8 -5
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js +8 -8
- 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.d.ts +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +11 -8
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +14 -14
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +2 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +8 -5
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib/components/MenuList/MenuList.d.ts +1 -1
- package/lib/components/MenuList/MenuList.js +10 -10
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/MenuList.types.d.ts +12 -10
- package/lib/components/MenuList/index.d.ts +1 -1
- package/lib/components/MenuList/index.js +0 -1
- package/lib/components/MenuList/index.js.map +1 -1
- package/lib/components/MenuList/renderMenuList.d.ts +1 -1
- package/lib/components/MenuList/renderMenuList.js +7 -7
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.d.ts +1 -1
- package/lib/components/MenuList/useMenuList.js +70 -87
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.d.ts +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +19 -17
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.d.ts +2 -1
- package/lib/components/MenuList/useMenuListStyles.js +9 -7
- package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js +7 -7
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.types.d.ts +2 -2
- package/lib/components/MenuPopover/renderMenuPopover.d.ts +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +9 -7
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.d.ts +3 -3
- package/lib/components/MenuPopover/useMenuPopover.js +35 -41
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +2 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +13 -8
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js +2 -0
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
- package/lib/components/MenuSplitGroup/index.d.ts +5 -0
- package/lib/components/MenuSplitGroup/index.js +6 -0
- package/lib/components/MenuSplitGroup/index.js.map +1 -0
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +15 -0
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +67 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +35 -0
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
- package/lib/components/MenuTrigger/MenuTrigger.d.ts +2 -1
- package/lib/components/MenuTrigger/MenuTrigger.js +6 -5
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +6 -3
- package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
- package/lib/components/MenuTrigger/useMenuTrigger.js +166 -5
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/contexts/menuContext.d.ts +1 -1
- package/lib/contexts/menuContext.js +5 -11
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.d.ts +1 -1
- package/lib/contexts/menuGroupContext.js +3 -5
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.d.ts +1 -1
- package/lib/contexts/menuListContext.js +7 -17
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.d.ts +1 -1
- package/lib/contexts/menuTriggerContext.js +3 -5
- package/lib/contexts/menuTriggerContext.js.map +1 -1
- package/lib/index.d.ts +11 -10
- package/lib/index.js +11 -10
- package/lib/index.js.map +1 -1
- package/lib/selectable/useCheckmarkStyles.d.ts +2 -2
- package/lib/selectable/useCheckmarkStyles.js +4 -4
- package/lib/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib/utils/useIsSubmenu.js +3 -5
- 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/MenuSplitGroup.d.ts +1 -0
- package/lib-commonjs/MenuSplitGroup.js +10 -0
- package/lib-commonjs/MenuSplitGroup.js.map +1 -0
- package/lib-commonjs/MenuTrigger.js +1 -1
- package/lib-commonjs/components/Menu/Menu.js +7 -7
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.types.d.ts +3 -2
- package/lib-commonjs/components/Menu/index.js +1 -1
- package/lib-commonjs/components/Menu/renderMenu.d.ts +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js +5 -5
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.d.ts +2 -2
- package/lib-commonjs/components/Menu/useMenu.js +130 -141
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.d.ts +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +37 -35
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +9 -9
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +2 -2
- package/lib-commonjs/components/MenuDivider/index.js +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.d.ts +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +11 -12
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.d.ts +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js +12 -11
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +11 -7
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +12 -9
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +3 -3
- 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.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +12 -13
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js +13 -11
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.d.ts +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +11 -11
- 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.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +9 -9
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
- package/lib-commonjs/components/MenuGroupHeader/index.js +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +11 -12
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.d.ts +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +16 -12
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +11 -7
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.d.ts +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js +9 -12
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +7 -7
- package/lib-commonjs/components/MenuItem/index.js +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.d.ts +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +16 -14
- 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.d.ts +2 -6
- package/lib-commonjs/components/MenuItem/useMenuItem.js +42 -53
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +40 -33
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +9 -9
- 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.d.ts +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +15 -14
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.d.ts +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +19 -21
- 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 +12 -7
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +9 -9
- 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.d.ts +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +15 -14
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.d.ts +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +19 -20
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +12 -7
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.d.ts +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js +11 -11
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.d.ts +12 -10
- package/lib-commonjs/components/MenuList/index.d.ts +1 -1
- package/lib-commonjs/components/MenuList/index.js +1 -3
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.d.ts +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js +12 -13
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.d.ts +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +77 -95
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.d.ts +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +21 -19
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.js +12 -9
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +8 -8
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +2 -2
- package/lib-commonjs/components/MenuPopover/index.js +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.d.ts +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +14 -13
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.d.ts +3 -3
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +43 -50
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +2 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +17 -10
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.d.ts +6 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +26 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +14 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js +6 -0
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/index.d.ts +5 -0
- package/lib-commonjs/components/MenuSplitGroup/index.js +18 -0
- package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.d.ts +5 -0
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +26 -0
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.d.ts +12 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +81 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.d.ts +6 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +47 -0
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +2 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +6 -5
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +6 -3
- package/lib-commonjs/components/MenuTrigger/index.js +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +5 -5
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +2 -2
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +174 -7
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/index.js +1 -1
- package/lib-commonjs/contexts/menuContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuContext.js +6 -12
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +5 -7
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuListContext.js +8 -18
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.d.ts +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +5 -7
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.d.ts +11 -10
- package/lib-commonjs/index.js +17 -15
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/selectable/index.js +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +2 -2
- package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -7
- 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 +15 -17
- 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/components/MenuTrigger/useTriggerElement.d.ts +0 -5
- package/lib/components/MenuTrigger/useTriggerElement.js +0 -179
- package/lib/components/MenuTrigger/useTriggerElement.js.map +0 -1
- package/lib/utils/DefaultIcons.d.ts +0 -7
- package/lib/utils/DefaultIcons.js +0 -88
- package/lib/utils/DefaultIcons.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
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.d.ts +0 -5
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +0 -195
- package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +0 -1
- package/lib-commonjs/utils/DefaultIcons.d.ts +0 -7
- package/lib-commonjs/utils/DefaultIcons.js +0 -100
- package/lib-commonjs/utils/DefaultIcons.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItemRadio/renderMenuItemRadio.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemRadio/renderMenuItemRadio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAIA;;;AAGG;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA8B;AACxE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,SAAN,iBAAmB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAhB,CADtB,EAEG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFjB,EAGG,KAAK,CAAC,OAAN,iBAAiB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;AAAf,GAAd,CAHpB,EAIG,KAAK,CAAC,gBAAN,iBAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAJ7B,CADF;AAQD,CAXM","sourceRoot":""}
|
@@ -3,4 +3,4 @@ import type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio.typ
|
|
3
3
|
/**
|
4
4
|
* Given user props, returns state and render function for a MenuItemRadio.
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const useMenuItemRadio_unstable: (props: MenuItemRadioProps, ref: React.Ref<HTMLElement>) => MenuItemRadioState;
|
@@ -1,39 +1,39 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { resolveShorthand } from '@fluentui/react-utilities';
|
4
3
|
import { Checkmark16Filled } from '@fluentui/react-icons';
|
5
|
-
import {
|
6
|
-
import {
|
4
|
+
import { useMenuListContext_unstable } from '../../contexts/menuListContext';
|
5
|
+
import { useMenuItem_unstable } from '../MenuItem/useMenuItem';
|
7
6
|
/**
|
8
7
|
* Given user props, returns state and render function for a MenuItemRadio.
|
9
8
|
*/
|
10
9
|
|
11
|
-
export
|
12
|
-
|
10
|
+
export const useMenuItemRadio_unstable = (props, ref) => {
|
11
|
+
const radioProps = {
|
13
12
|
role: 'menuitemradio'
|
14
13
|
};
|
15
|
-
|
14
|
+
const state = useMenuItem_unstable({ ...radioProps,
|
15
|
+
...props,
|
16
16
|
checkmark: resolveShorthand(props.checkmark, {
|
17
17
|
defaultProps: {
|
18
18
|
children: /*#__PURE__*/React.createElement(Checkmark16Filled, null)
|
19
19
|
},
|
20
20
|
required: true
|
21
21
|
})
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
}, ref);
|
23
|
+
const selectRadio = useMenuListContext_unstable(context => context.selectRadio);
|
24
|
+
const {
|
25
|
+
onClick: onClickOriginal
|
26
|
+
} = state.root;
|
27
|
+
const checked = useMenuListContext_unstable(context => {
|
28
28
|
var _a;
|
29
29
|
|
30
|
-
|
30
|
+
const checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[state.name]) || [];
|
31
31
|
return checkedItems.indexOf(state.value) !== -1;
|
32
32
|
});
|
33
33
|
state.checked = checked;
|
34
34
|
state.root['aria-checked'] = state.checked; // MenuItem state already transforms keyDown to click events
|
35
35
|
|
36
|
-
state.root.onClick =
|
36
|
+
state.root.onClick = e => {
|
37
37
|
if (state.disabled) {
|
38
38
|
e.preventDefault();
|
39
39
|
e.stopPropagation();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadio.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadio.ts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OAAnC,CAzBsB,CA2BtB;;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,OAAX,GAAqB,CAAC,IAAG;AACvB,QAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,MAAA,CAAC,CAAC,cAAF;AACA,MAAA,CAAC,CAAC,eAAF;AACA;AACD;;AAED,IAAA,WAAW,KAAA,IAAX,IAAA,WAAW,KAAA,KAAA,CAAX,GAAW,KAAA,CAAX,GAAA,WAAW,CAAG,CAAH,EAAM,KAAK,CAAC,IAAZ,EAAkB,KAAK,CAAC,KAAxB,EAA+B,KAAK,CAAC,OAArC,CAAX;AACA,IAAA,eAAe,KAAA,IAAf,IAAA,eAAe,KAAA,KAAA,CAAf,GAAe,KAAA,CAAf,GAAA,eAAe,CAAG,CAAH,CAAf;AACD,GATD;;AAWA,SAAO,KAAP;AACD,CA3CM","sourceRoot":""}
|
@@ -1,2 +1,3 @@
|
|
1
1
|
import type { MenuItemRadioState } from './MenuItemRadio.types';
|
2
|
-
export declare const
|
2
|
+
export declare const menuItemRadioClassName = "fui-MenuItemRadio";
|
3
|
+
export declare const useMenuItemRadioStyles_unstable: (state: MenuItemRadioState) => void;
|
@@ -1,7 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
import { mergeClasses } from '@griffel/react';
|
2
|
+
import { useCheckmarkStyles_unstable } from '../../selectable/index';
|
3
|
+
import { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles';
|
4
|
+
export const menuItemRadioClassName = 'fui-MenuItemRadio';
|
5
|
+
export const useMenuItemRadioStyles_unstable = state => {
|
6
|
+
state.root.className = mergeClasses(menuItemRadioClassName, state.root.className);
|
7
|
+
useMenuItemStyles_unstable(state);
|
8
|
+
useCheckmarkStyles_unstable(state);
|
6
9
|
};
|
7
10
|
//# sourceMappingURL=useMenuItemRadioStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadioStyles.ts"],"names":[],"mappings":"AAAA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemRadio/useMenuItemRadioStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,QAA6B,gBAA7B;AACA,SAAS,2BAAT,QAA4C,wBAA5C;AACA,SAAS,0BAAT,QAA2C,+BAA3C;AAGA,OAAO,MAAM,sBAAsB,GAAG,mBAA/B;AAEP,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAA8B;AAC3E,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,sBAAD,EAAyB,KAAK,CAAC,IAAN,CAAW,SAApC,CAAnC;AAEA,EAAA,0BAA0B,CAAC,KAAD,CAA1B;AACA,EAAA,2BAA2B,CAAC,KAAD,CAA3B;AACD,CALM","sourceRoot":""}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { MenuListProps } from './MenuList.types';
|
2
2
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
|
-
* Define a styled MenuList, using the `
|
4
|
+
* Define a styled MenuList, using the `useMenuList_unstable` hook.
|
5
5
|
*/
|
6
6
|
export declare const MenuList: ForwardRefComponent<MenuListProps>;
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
2
|
+
import { useMenuList_unstable } from './useMenuList';
|
3
|
+
import { renderMenuList_unstable } from './renderMenuList';
|
4
|
+
import { useMenuListContextValues_unstable } from './useMenuListContextValues';
|
5
|
+
import { useMenuListStyles_unstable } from './useMenuListStyles';
|
6
6
|
/**
|
7
|
-
* Define a styled MenuList, using the `
|
7
|
+
* Define a styled MenuList, using the `useMenuList_unstable` hook.
|
8
8
|
*/
|
9
9
|
|
10
|
-
export
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return
|
10
|
+
export const MenuList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
11
|
+
const state = useMenuList_unstable(props, ref);
|
12
|
+
const contextValues = useMenuListContextValues_unstable(state);
|
13
|
+
useMenuListStyles_unstable(state);
|
14
|
+
return renderMenuList_unstable(state, contextValues);
|
15
15
|
});
|
16
16
|
MenuList.displayName = 'MenuList';
|
17
17
|
//# sourceMappingURL=MenuList.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuList/MenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuList/MenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,QAAqC,eAArC;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,iCAAT,QAAkD,4BAAlD;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AAIA;;AAEG;;AACH,OAAO,MAAM,QAAQ,gBAAuC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC1F,QAAM,KAAK,GAAG,oBAAoB,CAAC,KAAD,EAAQ,GAAR,CAAlC;AACA,QAAM,aAAa,GAAG,iCAAiC,CAAC,KAAD,CAAvD;AACA,EAAA,0BAA0B,CAAC,KAAD,CAA1B;AAEA,SAAO,uBAAuB,CAAC,KAAD,EAAQ,aAAR,CAA9B;AACD,CAN2D,CAArD;AAQP,QAAQ,CAAC,WAAT,GAAuB,UAAvB","sourceRoot":""}
|
@@ -1,7 +1,14 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { ComponentProps, ComponentState,
|
3
|
-
import { MenuListContextValue } from '../../contexts/menuListContext';
|
4
|
-
import { SelectableHandler } from '../../selectable/index';
|
2
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
3
|
+
import type { MenuListContextValue } from '../../contexts/menuListContext';
|
4
|
+
import type { SelectableHandler } from '../../selectable/index';
|
5
|
+
export declare type MenuCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;
|
6
|
+
export declare type MenuCheckedValueChangeData = {
|
7
|
+
/** The name of the value */
|
8
|
+
name: string;
|
9
|
+
/** The items for this value that are checked */
|
10
|
+
checkedItems: string[];
|
11
|
+
};
|
5
12
|
export declare type MenuListCommons = {
|
6
13
|
/**
|
7
14
|
* Callback when checked items change for value with a name
|
@@ -9,12 +16,7 @@ export declare type MenuListCommons = {
|
|
9
16
|
* @param event - React's original SyntheticEvent
|
10
17
|
* @param data - A data object with relevant information
|
11
18
|
*/
|
12
|
-
onCheckedValueChange?: (e:
|
13
|
-
/** The name of the value */
|
14
|
-
name: string;
|
15
|
-
/** The items for this value that are checked */
|
16
|
-
checkedItems: string[];
|
17
|
-
}) => void;
|
19
|
+
onCheckedValueChange?: (e: MenuCheckedValueChangeEvent, data: MenuCheckedValueChangeData) => void;
|
18
20
|
/**
|
19
21
|
* Map of all checked values
|
20
22
|
*/
|
@@ -33,7 +35,7 @@ export declare type MenuListCommons = {
|
|
33
35
|
hasCheckmarks?: boolean;
|
34
36
|
};
|
35
37
|
export declare type MenuListSlots = {
|
36
|
-
root:
|
38
|
+
root: Slot<'div'>;
|
37
39
|
};
|
38
40
|
export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<MenuListCommons>;
|
39
41
|
export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export * from './MenuList';
|
2
|
-
export
|
2
|
+
export type { MenuCheckedValueChangeData, MenuCheckedValueChangeEvent, MenuListContextValues, MenuListProps, MenuListSlots, MenuListState, UninitializedMenuListState, } from './MenuList.types';
|
3
3
|
export * from './renderMenuList';
|
4
4
|
export * from './useMenuList';
|
5
5
|
export * from './useMenuListStyles';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuList/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuList/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAW3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
|
@@ -2,4 +2,4 @@ import { MenuListContextValues, MenuListState } from './MenuList.types';
|
|
2
2
|
/**
|
3
3
|
* Function that renders the final JSX of the component
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderMenuList_unstable: (state: MenuListState, contextValues: MenuListContextValues) => JSX.Element;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { getSlots } from '@fluentui/react-utilities';
|
4
3
|
import { MenuListProvider } from '../../contexts/menuListContext';
|
@@ -6,13 +5,14 @@ import { MenuListProvider } from '../../contexts/menuListContext';
|
|
6
5
|
* Function that renders the final JSX of the component
|
7
6
|
*/
|
8
7
|
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
export const renderMenuList_unstable = (state, contextValues) => {
|
9
|
+
const {
|
10
|
+
slots,
|
11
|
+
slotProps
|
12
|
+
} = getSlots(state);
|
14
13
|
return /*#__PURE__*/React.createElement(MenuListProvider, {
|
15
14
|
value: contextValues.menuList
|
16
|
-
}, /*#__PURE__*/React.createElement(slots.root,
|
15
|
+
}, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
16
|
+
}));
|
17
17
|
};
|
18
18
|
//# sourceMappingURL=renderMenuList.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuList/renderMenuList.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuList/renderMenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,gBAAT,QAAiC,gCAAjC;AAEA;;AAEG;;AACH,OAAO,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAAuB,aAAvB,KAA+D;AACpG,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,gBAAD,EAAiB;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAAjB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CARM","sourceRoot":""}
|
@@ -3,4 +3,4 @@ import type { MenuListProps, MenuListState } from './MenuList.types';
|
|
3
3
|
/**
|
4
4
|
* Returns the props and state required to render the component
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const useMenuList_unstable: (props: MenuListProps, ref: React.Ref<HTMLElement>) => MenuListState;
|
@@ -1,21 +1,22 @@
|
|
1
|
-
import { __assign, __spreadArrays } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { useMergedRefs, useEventCallback, useControllableState, getNativeElementProps } from '@fluentui/react-utilities';
|
4
3
|
import { useArrowNavigationGroup, useFocusFinders } from '@fluentui/react-tabster';
|
5
4
|
import { useHasParentContext } from '@fluentui/react-context-selector';
|
6
|
-
import {
|
5
|
+
import { useMenuContext_unstable } from '../../contexts/menuContext';
|
7
6
|
import { MenuContext } from '../../contexts/menuContext';
|
8
7
|
/**
|
9
8
|
* Returns the props and state required to render the component
|
10
9
|
*/
|
11
10
|
|
12
|
-
export
|
13
|
-
|
11
|
+
export const useMenuList_unstable = (props, ref) => {
|
12
|
+
const focusAttributes = useArrowNavigationGroup({
|
14
13
|
circular: true
|
15
14
|
});
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
const {
|
16
|
+
findAllFocusable
|
17
|
+
} = useFocusFinders();
|
18
|
+
const menuContext = useMenuContextSelectors();
|
19
|
+
const hasMenuContext = useHasParentContext(MenuContext);
|
19
20
|
|
20
21
|
if (usingPropsAndMenuContext(props, menuContext, hasMenuContext)) {
|
21
22
|
// TODO throw warnings in development safely
|
@@ -23,44 +24,47 @@ export var useMenuList = function (props, ref) {
|
|
23
24
|
console.warn('You are using both MenuList and Menu props, we recommend you to use Menu props when available');
|
24
25
|
}
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
const innerRef = React.useRef(null);
|
28
|
+
const initialState = {
|
29
|
+
components: {
|
30
|
+
root: 'div'
|
31
|
+
},
|
32
|
+
root: getNativeElementProps('div', {
|
30
33
|
ref: useMergedRefs(ref, innerRef),
|
31
34
|
role: 'menu',
|
32
|
-
'aria-labelledby': menuContext.triggerId
|
33
|
-
|
35
|
+
'aria-labelledby': menuContext.triggerId,
|
36
|
+
...focusAttributes,
|
37
|
+
...props
|
38
|
+
}),
|
34
39
|
hasIcons: menuContext.hasIcons,
|
35
|
-
hasCheckmarks: menuContext.hasCheckmarks
|
36
|
-
|
37
|
-
|
38
|
-
|
40
|
+
hasCheckmarks: menuContext.hasCheckmarks,
|
41
|
+
...(hasMenuContext && menuContext),
|
42
|
+
...props
|
43
|
+
};
|
44
|
+
const setFocusByFirstCharacter = React.useCallback((e, itemEl) => {
|
39
45
|
// TODO use some kind of children registration to reduce dependency on DOM roles
|
40
|
-
|
46
|
+
const acceptedRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];
|
41
47
|
|
42
48
|
if (!innerRef.current) {
|
43
49
|
return;
|
44
50
|
}
|
45
51
|
|
46
|
-
|
47
|
-
|
48
|
-
});
|
49
|
-
var startIndex = menuItems.indexOf(itemEl) + 1;
|
52
|
+
const menuItems = findAllFocusable(innerRef.current, el => el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')) !== -1);
|
53
|
+
let startIndex = menuItems.indexOf(itemEl) + 1;
|
50
54
|
|
51
55
|
if (startIndex === menuItems.length) {
|
52
56
|
startIndex = 0;
|
53
57
|
}
|
54
58
|
|
55
|
-
|
59
|
+
const firstChars = menuItems.map(menuItem => {
|
56
60
|
var _a;
|
57
61
|
|
58
62
|
return (_a = menuItem.textContent) === null || _a === void 0 ? void 0 : _a.charAt(0).toLowerCase();
|
59
63
|
});
|
60
|
-
|
64
|
+
const char = e.key.toLowerCase();
|
61
65
|
|
62
|
-
|
63
|
-
for (
|
66
|
+
const getIndexFirstChars = (start, firstChar) => {
|
67
|
+
for (let i = start; i < firstChars.length; i++) {
|
64
68
|
if (char === firstChars[i]) {
|
65
69
|
return i;
|
66
70
|
}
|
@@ -70,7 +74,7 @@ export var useMenuList = function (props, ref) {
|
|
70
74
|
}; // Check remaining slots in the menu
|
71
75
|
|
72
76
|
|
73
|
-
|
77
|
+
let index = getIndexFirstChars(startIndex, char); // If not found in remaining slots, check from beginning
|
74
78
|
|
75
79
|
if (index === -1) {
|
76
80
|
index = getIndexFirstChars(0, char);
|
@@ -81,20 +85,17 @@ export var useMenuList = function (props, ref) {
|
|
81
85
|
menuItems[index].focus();
|
82
86
|
}
|
83
87
|
}, [findAllFocusable]);
|
84
|
-
|
85
|
-
var _a = useControllableState({
|
88
|
+
const [checkedValues, setCheckedValues] = useControllableState({
|
86
89
|
state: initialState.checkedValues,
|
87
90
|
defaultState: initialState.defaultCheckedValues,
|
88
91
|
initialState: {}
|
89
|
-
})
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
var newCheckedItems = __spreadArrays(checkedItems);
|
92
|
+
});
|
93
|
+
const {
|
94
|
+
onCheckedValueChange
|
95
|
+
} = initialState;
|
96
|
+
const toggleCheckbox = useEventCallback((e, name, value, checked) => {
|
97
|
+
const checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];
|
98
|
+
const newCheckedItems = [...checkedItems];
|
98
99
|
|
99
100
|
if (checked) {
|
100
101
|
newCheckedItems.splice(newCheckedItems.indexOf(value), 1);
|
@@ -103,67 +104,49 @@ export var useMenuList = function (props, ref) {
|
|
103
104
|
}
|
104
105
|
|
105
106
|
onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {
|
106
|
-
name
|
107
|
+
name,
|
107
108
|
checkedItems: newCheckedItems
|
108
109
|
});
|
109
|
-
setCheckedValues(
|
110
|
-
|
111
|
-
|
112
|
-
return __assign(__assign({}, s), (_a = {}, _a[name] = newCheckedItems, _a));
|
113
|
-
});
|
110
|
+
setCheckedValues(s => ({ ...s,
|
111
|
+
[name]: newCheckedItems
|
112
|
+
}));
|
114
113
|
});
|
115
|
-
|
116
|
-
|
117
|
-
setCheckedValues(
|
118
|
-
|
119
|
-
|
120
|
-
return __assign(__assign({}, s), (_a = {}, _a[name] = newCheckedItems, _a));
|
121
|
-
});
|
114
|
+
const selectRadio = useEventCallback((e, name, value) => {
|
115
|
+
const newCheckedItems = [value];
|
116
|
+
setCheckedValues(s => ({ ...s,
|
117
|
+
[name]: newCheckedItems
|
118
|
+
}));
|
122
119
|
onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {
|
123
|
-
name
|
120
|
+
name,
|
124
121
|
checkedItems: newCheckedItems
|
125
122
|
});
|
126
123
|
});
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
toggleCheckbox: toggleCheckbox,
|
124
|
+
const state = { ...initialState,
|
125
|
+
setFocusByFirstCharacter,
|
126
|
+
selectRadio,
|
127
|
+
toggleCheckbox,
|
132
128
|
checkedValues: checkedValues !== null && checkedValues !== void 0 ? checkedValues : {}
|
133
|
-
}
|
134
|
-
|
129
|
+
};
|
135
130
|
return state;
|
136
131
|
};
|
137
132
|
/**
|
138
133
|
* Adds some sugar to fetching multiple context selector values
|
139
134
|
*/
|
140
135
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
var defaultCheckedValues = useMenuContext(function (context) {
|
149
|
-
return context.defaultCheckedValues;
|
150
|
-
});
|
151
|
-
var triggerId = useMenuContext(function (context) {
|
152
|
-
return context.triggerId;
|
153
|
-
});
|
154
|
-
var hasIcons = useMenuContext(function (context) {
|
155
|
-
return context.hasIcons;
|
156
|
-
});
|
157
|
-
var hasCheckmarks = useMenuContext(function (context) {
|
158
|
-
return context.hasCheckmarks;
|
159
|
-
});
|
136
|
+
const useMenuContextSelectors = () => {
|
137
|
+
const checkedValues = useMenuContext_unstable(context => context.checkedValues);
|
138
|
+
const onCheckedValueChange = useMenuContext_unstable(context => context.onCheckedValueChange);
|
139
|
+
const defaultCheckedValues = useMenuContext_unstable(context => context.defaultCheckedValues);
|
140
|
+
const triggerId = useMenuContext_unstable(context => context.triggerId);
|
141
|
+
const hasIcons = useMenuContext_unstable(context => context.hasIcons);
|
142
|
+
const hasCheckmarks = useMenuContext_unstable(context => context.hasCheckmarks);
|
160
143
|
return {
|
161
|
-
checkedValues
|
162
|
-
onCheckedValueChange
|
163
|
-
defaultCheckedValues
|
164
|
-
triggerId
|
165
|
-
hasIcons
|
166
|
-
hasCheckmarks
|
144
|
+
checkedValues,
|
145
|
+
onCheckedValueChange,
|
146
|
+
defaultCheckedValues,
|
147
|
+
triggerId,
|
148
|
+
hasIcons,
|
149
|
+
hasCheckmarks
|
167
150
|
};
|
168
151
|
};
|
169
152
|
/**
|
@@ -171,10 +154,10 @@ var useMenuContextSelectors = function () {
|
|
171
154
|
*/
|
172
155
|
|
173
156
|
|
174
|
-
|
175
|
-
|
157
|
+
const usingPropsAndMenuContext = (props, contextValue, hasMenuContext) => {
|
158
|
+
let isUsingPropsAndContext = false;
|
176
159
|
|
177
|
-
for (
|
160
|
+
for (const val in contextValue) {
|
178
161
|
if (props[val]) {
|
179
162
|
isUsingPropsAndContext = true;
|
180
163
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Men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AC,SAApB,CAAzC;AACA,QAAM,QAAQ,GAAG,uBAAuB,CAAC,OAAO,IAAI,OAAO,CAAC,QAApB,CAAxC;AACA,QAAM,aAAa,GAAG,uBAAuB,CAAC,OAAO,IAAI,OAAO,CAAC,aAApB,CAA7C;AAEA,SAAO;AACL,IAAA,aADK;AAEL,IAAA,oBAFK;AAGL,IAAA,oBAHK;AAIL,IAAA,SAJK;AAKL,IAAA,QALK;AAML,IAAA;AANK,GAAP;AAQD,CAhBD;AAkBA;;AAEG;;;AACH,MAAM,wBAAwB,GAAG,CAC/B,KAD+B,EAE/B,YAF+B,EAG/B,cAH+B,KAI7B;AACF,MAAI,sBAAsB,GAAG,KAA7B;;AACA,OAAK,MAAM,GAAX,IAAkB,YAAlB,EAAgC;AAC9B,QAAI,KAAK,CAAC,GAAD,CAAT,EAA4G;AAC1G,MAAA,sBAAsB,GAAG,IAAzB;AACD;AACF;;AAED,SAAO,cAAc,IAAI,sBAAzB;AACD,CAbD","sourceRoot":""}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import type { MenuListContextValues, MenuListState } from './MenuList.types';
|
2
|
-
export declare function
|
2
|
+
export declare function useMenuListContextValues_unstable(state: MenuListState): MenuListContextValues;
|
@@ -1,23 +1,25 @@
|
|
1
|
-
export function
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
export function useMenuListContextValues_unstable(state) {
|
2
|
+
const {
|
3
|
+
onCheckedValueChange,
|
4
|
+
checkedValues,
|
5
|
+
toggleCheckbox,
|
6
|
+
selectRadio,
|
7
|
+
setFocusByFirstCharacter,
|
8
|
+
hasIcons,
|
9
|
+
hasCheckmarks
|
10
|
+
} = state; // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
|
9
11
|
|
10
|
-
|
11
|
-
onCheckedValueChange
|
12
|
-
checkedValues
|
13
|
-
toggleCheckbox
|
14
|
-
selectRadio
|
15
|
-
setFocusByFirstCharacter
|
16
|
-
hasIcons
|
17
|
-
hasCheckmarks
|
12
|
+
const menuList = {
|
13
|
+
onCheckedValueChange,
|
14
|
+
checkedValues,
|
15
|
+
toggleCheckbox,
|
16
|
+
selectRadio,
|
17
|
+
setFocusByFirstCharacter,
|
18
|
+
hasIcons,
|
19
|
+
hasCheckmarks
|
18
20
|
};
|
19
21
|
return {
|
20
|
-
menuList
|
22
|
+
menuList
|
21
23
|
};
|
22
24
|
}
|
23
25
|
//# sourceMappingURL=useMenuListContextValues.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuList/useMenuListContextValues.ts"],"names":[],"mappings":"AAEA,OAAM,SAAU,
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuList/useMenuListContextValues.ts"],"names":[],"mappings":"AAEA,OAAM,SAAU,iCAAV,CAA4C,KAA5C,EAAgE;AACpE,QAAM;AACJ,IAAA,oBADI;AAEJ,IAAA,aAFI;AAGJ,IAAA,cAHI;AAIJ,IAAA,WAJI;AAKJ,IAAA,wBALI;AAMJ,IAAA,QANI;AAOJ,IAAA;AAPI,MAQF,KARJ,CADoE,CAWpE;;AACA,QAAM,QAAQ,GAAG;AACf,IAAA,oBADe;AAEf,IAAA,aAFe;AAGf,IAAA,cAHe;AAIf,IAAA,WAJe;AAKf,IAAA,wBALe;AAMf,IAAA,QANe;AAOf,IAAA;AAPe,GAAjB;AAUA,SAAO;AAAE,IAAA;AAAF,GAAP;AACD","sourceRoot":""}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { MenuListState } from './MenuList.types';
|
2
|
+
export declare const menuListClassName = "fui-MenuList";
|
2
3
|
/**
|
3
4
|
* Apply styling to the Menu slots based on the state
|
4
5
|
*/
|
5
|
-
export declare const
|
6
|
+
export declare const useMenuListStyles_unstable: (state: MenuListState) => MenuListState;
|