@fluentui/react-menu 9.5.2 → 9.5.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +111 -1
- package/CHANGELOG.md +31 -2
- package/lib/components/Menu/Menu.js +0 -1
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/renderMenu.js +0 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.js +16 -34
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.js +2 -2
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +0 -1
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +2 -2
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js +0 -1
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +10 -12
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.js +0 -1
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +2 -2
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +0 -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.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +0 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -2
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +0 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +10 -12
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js +0 -1
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/renderMenuItem.js +12 -7
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js +0 -5
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.js +0 -6
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.js +108 -117
- package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -6
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +2 -4
- 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 +0 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +10 -6
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +3 -4
- 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 +0 -1
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/renderMenuList.js +2 -2
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.js +10 -27
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +2 -2
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.js +6 -9
- package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js +0 -1
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +4 -5
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js +6 -13
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +32 -35
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js +0 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -2
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +0 -6
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +12 -15
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.js +2 -3
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js +0 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js +4 -24
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.js +0 -1
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.js +0 -2
- package/lib/contexts/menuTriggerContext.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/selectable/useCheckmarkStyles.js +7 -11
- package/lib/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib/utils/useIsSubmenu.js +0 -1
- package/lib/utils/useIsSubmenu.js.map +1 -1
- package/lib/utils/useOnMenuEnter.js +4 -11
- package/lib/utils/useOnMenuEnter.js.map +1 -1
- package/lib-commonjs/Menu.js +0 -2
- package/lib-commonjs/Menu.js.map +1 -1
- package/lib-commonjs/MenuDivider.js +0 -2
- package/lib-commonjs/MenuDivider.js.map +1 -1
- package/lib-commonjs/MenuGroup.js +0 -2
- package/lib-commonjs/MenuGroup.js.map +1 -1
- package/lib-commonjs/MenuGroupHeader.js +0 -2
- package/lib-commonjs/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/MenuItem.js +0 -2
- package/lib-commonjs/MenuItem.js.map +1 -1
- package/lib-commonjs/MenuItemCheckbox.js +0 -2
- package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/MenuItemRadio.js +0 -2
- package/lib-commonjs/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/MenuList.js +0 -2
- package/lib-commonjs/MenuList.js.map +1 -1
- package/lib-commonjs/MenuPopover.js +0 -2
- package/lib-commonjs/MenuPopover.js.map +1 -1
- package/lib-commonjs/MenuSplitGroup.js +0 -2
- package/lib-commonjs/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/MenuTrigger.js +0 -2
- package/lib-commonjs/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.js +0 -6
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
- package/lib-commonjs/components/Menu/index.js +0 -6
- package/lib-commonjs/components/Menu/index.js.map +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js +0 -5
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.js +16 -46
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +2 -4
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +0 -6
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/index.js +0 -6
- package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +2 -6
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js +0 -4
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +10 -16
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +0 -7
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/index.js +0 -7
- package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +2 -7
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js +0 -4
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +0 -3
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +0 -4
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +0 -6
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/index.js +0 -6
- package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -6
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +0 -5
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +10 -16
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js +0 -6
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
- package/lib-commonjs/components/MenuItem/index.js +0 -6
- package/lib-commonjs/components/MenuItem/index.js.map +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +12 -11
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js +0 -8
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.js +0 -18
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +108 -124
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -6
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js +0 -6
- package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -10
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +2 -11
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -11
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +0 -6
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/index.js +0 -6
- package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +10 -10
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +3 -11
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -11
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js +0 -7
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
- package/lib-commonjs/components/MenuList/index.js +0 -7
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js +2 -7
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +10 -35
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +2 -4
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.js +6 -12
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +0 -6
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/index.js +0 -6
- package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +4 -10
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +6 -22
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +32 -39
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +0 -6
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/index.js +0 -6
- package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -6
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +0 -13
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +12 -20
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +2 -7
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/index.js +0 -5
- package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +0 -5
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +4 -34
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/index.js +0 -3
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/contexts/menuContext.js +0 -4
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +0 -5
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.js +0 -4
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +0 -6
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.js +0 -32
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/selectable/index.js +0 -3
- package/lib-commonjs/selectable/index.js.map +1 -1
- package/lib-commonjs/selectable/types.js.map +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -13
- package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js +0 -6
- package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
- package/lib-commonjs/utils/useOnMenuEnter.js +4 -17
- package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
- package/package.json +12 -12
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"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","names":["ChevronRightIcon","react_icons_1","ChevronLeftIcon","useMenuItem_unstable","props","ref","isSubmenuTrigger","menuTriggerContext_1","persistOnClickContext","menuContext_1","context","persistOnItemClick","as","disabled","disabledFocusable","hasSubmenu","persistOnClick","hasIcons","menuListContext_1","hasCheckmarks","setOpen","dir","react_shared_contexts_1","innerRef","React","useRef","dismissedWithKeyboardRef","isDisabled","Boolean","state","components","root","icon","checkmark","submenuIndicator","content","secondaryContent","isNativeButton","react_utilities_1","react_aria_1","required","defaultProps","role","onKeyDown","event","isDefaultPrevented","key","keyboard_keys_1","current","onMouseEnter","focus","onClick","open","keyboard","bubble","type","children","useCharacterSearch_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItem/useMenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback, resolveShorthand, useMergedRefs, getNativeElementProps } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useCharacterSearch } from './useCharacterSearch';\nimport { useMenuTriggerContext_unstable } from '../../contexts/menuTriggerContext';\nimport {\n ChevronRightFilled,\n ChevronRightRegular,\n ChevronLeftFilled,\n ChevronLeftRegular,\n bundleIcon,\n} from '@fluentui/react-icons';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport type { MenuItemProps, MenuItemState } from './MenuItem.types';\nimport type { ARIAButtonElement, ARIAButtonElementIntersection, ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\n\nconst ChevronRightIcon = bundleIcon(ChevronRightFilled, ChevronRightRegular);\nconst ChevronLeftIcon = bundleIcon(ChevronLeftFilled, ChevronLeftRegular);\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useMenuItem_unstable = (props: MenuItemProps, ref: React.Ref<ARIAButtonElement<'div'>>): MenuItemState => {\n const isSubmenuTrigger = useMenuTriggerContext_unstable();\n const persistOnClickContext = useMenuContext_unstable(context => context.persistOnItemClick);\n const {\n as = 'div',\n disabled,\n disabledFocusable,\n hasSubmenu = isSubmenuTrigger,\n persistOnClick = persistOnClickContext,\n } = props;\n const hasIcons = useMenuListContext_unstable(context => context.hasIcons);\n const hasCheckmarks = useMenuListContext_unstable(context => context.hasCheckmarks);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n\n const { dir } = useFluent();\n const innerRef = React.useRef<ARIAButtonElementIntersection<'div'>>(null);\n const dismissedWithKeyboardRef = React.useRef(false);\n\n const isDisabled = Boolean(disabled || disabledFocusable);\n\n const state: MenuItemState = {\n hasSubmenu,\n disabled: isDisabled,\n persistOnClick,\n components: {\n root: 'div',\n icon: 'span',\n checkmark: 'span',\n submenuIndicator: 'span',\n content: 'span',\n secondaryContent: 'span',\n },\n isNativeButton: as === 'button',\n root: getNativeElementProps(\n as,\n useARIAButtonShorthand<ARIAButtonSlotProps<'div'>>(\n { disabled: false, disabledFocusable: isDisabled, as },\n {\n required: true,\n defaultProps: {\n role: 'menuitem',\n ...props,\n ref: useMergedRefs(ref, innerRef) as React.Ref<ARIAButtonElementIntersection<'div'>>,\n onKeyDown: useEventCallback(event => {\n props.onKeyDown?.(event);\n if (!event.isDefaultPrevented() && (event.key === Space || event.key === Enter)) {\n dismissedWithKeyboardRef.current = true;\n }\n }),\n onMouseEnter: useEventCallback(event => {\n innerRef.current?.focus();\n\n props.onMouseEnter?.(event);\n }),\n onClick: useEventCallback(event => {\n if (!hasSubmenu && !persistOnClick) {\n setOpen(event, {\n open: false,\n keyboard: dismissedWithKeyboardRef.current,\n bubble: true,\n type: 'menuItemClick',\n event,\n });\n dismissedWithKeyboardRef.current = false;\n }\n\n props.onClick?.(event);\n }),\n },\n },\n ),\n ),\n icon: resolveShorthand(props.icon, { required: hasIcons }),\n checkmark: resolveShorthand(props.checkmark, { required: hasCheckmarks }),\n submenuIndicator: resolveShorthand(props.submenuIndicator, {\n required: hasSubmenu,\n defaultProps: {\n children: dir === 'ltr' ? <ChevronRightIcon /> : <ChevronLeftIcon />,\n },\n }),\n content: resolveShorthand(props.content, {\n required: !!props.children,\n defaultProps: { children: props.children },\n }),\n secondaryContent: resolveShorthand(props.secondaryContent),\n };\n useCharacterSearch(state, innerRef);\n return state;\n};\n"]}
|
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuItemStyles_unstable = exports.menuItemClassNames = void 0;
|
7
|
-
|
8
7
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
-
|
10
8
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
11
|
-
|
12
9
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
13
|
-
|
14
10
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
15
|
-
|
16
11
|
const index_1 = /*#__PURE__*/require("../../selectable/index");
|
17
|
-
|
18
12
|
exports.menuItemClassNames = {
|
19
13
|
root: 'fui-MenuItem',
|
20
14
|
icon: 'fui-MenuItem__icon',
|
@@ -23,155 +17,145 @@ exports.menuItemClassNames = {
|
|
23
17
|
content: 'fui-MenuItem__content',
|
24
18
|
secondaryContent: 'fui-MenuItem__secondaryContent'
|
25
19
|
};
|
26
|
-
|
27
20
|
const useStyles = /*#__PURE__*/react_1.__styles({
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
21
|
+
focusIndicator: {
|
22
|
+
Brovlpu: "ftqa4ok",
|
23
|
+
B486eqv: "f2hkw1w",
|
24
|
+
B8q5s1w: "f8hki3x",
|
25
|
+
Bci5o5g: ["f1d2448m", "ffh67wi"],
|
26
|
+
n8qw10: "f1bjia2o",
|
27
|
+
Bdrgwmp: ["ffh67wi", "f1d2448m"],
|
28
|
+
Bm4h7ae: "f15bsgw9",
|
29
|
+
B7ys5i9: "f14e48fq",
|
30
|
+
Busjfv9: "f18yb2kv",
|
31
|
+
Bhk32uz: "fd6o370",
|
32
|
+
Bf4ptjt: "fh1cnn4",
|
33
|
+
kclons: ["fy7oxxb", "f184ne2d"],
|
34
|
+
Bhdgwq3: "fpukqih",
|
35
|
+
Blkhhs4: ["f184ne2d", "fy7oxxb"],
|
36
|
+
Bqtpl0w: "frrh606",
|
37
|
+
clg4pj: ["f1v5zibi", "fo2hd23"],
|
38
|
+
hgwjuy: "ful5kiu",
|
39
|
+
Bonggc9: ["fo2hd23", "f1v5zibi"],
|
40
|
+
B1tsrr9: ["f1jqcqds", "ftffrms"],
|
41
|
+
Dah5zi: ["ftffrms", "f1jqcqds"],
|
42
|
+
Bkh64rk: ["f2e7qr6", "fsr1zz6"],
|
43
|
+
qqdqy8: ["fsr1zz6", "f2e7qr6"],
|
44
|
+
B6dhp37: "f1dvezut",
|
45
|
+
i03rao: ["fd0oaoj", "f1cwg4i8"],
|
46
|
+
Boxcth7: "fjvm52t",
|
47
|
+
Bsom6fd: ["f1cwg4i8", "fd0oaoj"],
|
48
|
+
J0r882: "fdiulkx",
|
49
|
+
Bjwuhne: "f1yalx80",
|
50
|
+
Ghsupd: ["fq22d5a", "f1jw7pan"],
|
51
|
+
Bule8hv: ["f1jw7pan", "fq22d5a"]
|
59
52
|
},
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
53
|
+
resetButton: {
|
54
|
+
B7ck84d: "f1e4lqlz",
|
55
|
+
De3pzq: "f1u2r49w",
|
56
|
+
sj55zd: "f1ym3bx4",
|
57
|
+
Bahqtrf: "f1mo0ibp",
|
58
|
+
Be2twd7: "fjoy568",
|
59
|
+
Bg96gwp: "fytdu2e",
|
60
|
+
g2u3we: "f1p3nwhy",
|
61
|
+
h3c5rm: ["f11589ue", "f1pdflbu"],
|
62
|
+
B9xav0g: "f1q5o8ev",
|
63
|
+
zhjwy3: ["f1pdflbu", "f11589ue"],
|
64
|
+
B68tc82: "f1mtd64y",
|
65
|
+
Bmxbyg5: "f1y7q3j9",
|
66
|
+
z8tnut: "f1g0x7ka",
|
67
|
+
z189sj: ["fhxju0i", "f1cnd47f"],
|
68
|
+
Byoj8tv: "f1qch9an",
|
69
|
+
uwmqm3: ["f1cnd47f", "fhxju0i"],
|
70
|
+
Bv0vk6g: "f37px4s",
|
71
|
+
fsow6f: "fgusgyc"
|
79
72
|
},
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
73
|
+
root: {
|
74
|
+
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
75
|
+
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
76
|
+
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
77
|
+
Btl43ni: ["fyu767a", "f1jar5jt"],
|
78
|
+
qhf8xq: "f10pi13n",
|
79
|
+
sj55zd: "fkfq4zb",
|
80
|
+
De3pzq: "fxugw4r",
|
81
|
+
z189sj: ["f81rol6", "frdkuqy"],
|
82
|
+
uwmqm3: ["frdkuqy", "f81rol6"],
|
83
|
+
Bqenvij: "f1d2rq10",
|
84
|
+
mc9l5x: "f22iagw",
|
85
|
+
Bt984gj: "f122n59",
|
86
|
+
Be2twd7: "fkhj508",
|
87
|
+
Bceei9c: "f1k6fduh",
|
88
|
+
i8kkvl: "f1q8lukm",
|
89
|
+
Belr9w4: "f1ma2n7n",
|
90
|
+
Jwef8y: "f1knas48",
|
91
|
+
Bi91k9c: "fnwyq0v",
|
92
|
+
Bk3fhr4: "ft1hn21",
|
93
|
+
Bmfj8id: "fuxngvv",
|
94
|
+
Bg7n49j: "fp258yr",
|
95
|
+
famaaq: "f1xqy1su"
|
103
96
|
},
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
97
|
+
content: {
|
98
|
+
uwmqm3: ["f161knb0", "f12huiiw"],
|
99
|
+
z189sj: ["f12huiiw", "f161knb0"],
|
100
|
+
De3pzq: "f3rmtva",
|
101
|
+
Bh6795r: "fqerorx"
|
109
102
|
},
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
103
|
+
secondaryContent: {
|
104
|
+
uwmqm3: ["f161knb0", "f12huiiw"],
|
105
|
+
z189sj: ["f12huiiw", "f161knb0"],
|
106
|
+
sj55zd: "f11d4kpn",
|
107
|
+
Bi91k9c: "f1jp5ecu",
|
108
|
+
t0hwav: "fc1cou1"
|
116
109
|
},
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
110
|
+
icon: {
|
111
|
+
a9b677: "f64fuq3",
|
112
|
+
Bqenvij: "fjamq6b",
|
113
|
+
Be2twd7: "fe5j1ua",
|
114
|
+
Bg96gwp: "fez10in",
|
115
|
+
Bt984gj: "f122n59",
|
116
|
+
mc9l5x: "ftuwxu6",
|
117
|
+
Brf1p80: "f4d9j23"
|
125
118
|
},
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
119
|
+
submenuIndicator: {
|
120
|
+
a9b677: "f64fuq3",
|
121
|
+
Bqenvij: "fjamq6b",
|
122
|
+
Be2twd7: "fe5j1ua",
|
123
|
+
Bg96gwp: "fez10in",
|
124
|
+
Bt984gj: "f122n59",
|
125
|
+
mc9l5x: "ftuwxu6",
|
126
|
+
Brf1p80: "f4d9j23"
|
134
127
|
},
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
128
|
+
disabled: {
|
129
|
+
sj55zd: "f1s2aq7o",
|
130
|
+
Bi91k9c: "fvgxktp",
|
131
|
+
t0hwav: "ft33916"
|
139
132
|
}
|
140
133
|
}, {
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
134
|
+
f: [".ftqa4ok:focus{outline-style:none;}", ".fc1cou1:focus{color:var(--colorNeutralForeground3Hover);}", ".ft33916:focus{color:var(--colorNeutralForegroundDisabled);}"],
|
135
|
+
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
136
|
+
d: [".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", ".fh1cnn4[data-fui-focus-visible]::after{border-top-style:solid;}", ".fy7oxxb[data-fui-focus-visible]::after{border-right-style:solid;}", ".f184ne2d[data-fui-focus-visible]::after{border-left-style:solid;}", ".fpukqih[data-fui-focus-visible]::after{border-bottom-style:solid;}", ".frrh606[data-fui-focus-visible]::after{border-top-width:2px;}", ".f1v5zibi[data-fui-focus-visible]::after{border-right-width:2px;}", ".fo2hd23[data-fui-focus-visible]::after{border-left-width:2px;}", ".ful5kiu[data-fui-focus-visible]::after{border-bottom-width:2px;}", ".f1jqcqds[data-fui-focus-visible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".ftffrms[data-fui-focus-visible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f2e7qr6[data-fui-focus-visible]::after{border-top-right-radius:var(--borderRadiusMedium);}", ".fsr1zz6[data-fui-focus-visible]::after{border-top-left-radius:var(--borderRadiusMedium);}", ".f1dvezut[data-fui-focus-visible]::after{border-top-color:var(--colorStrokeFocus2);}", ".fd0oaoj[data-fui-focus-visible]::after{border-right-color:var(--colorStrokeFocus2);}", ".f1cwg4i8[data-fui-focus-visible]::after{border-left-color:var(--colorStrokeFocus2);}", ".fjvm52t[data-fui-focus-visible]::after{border-bottom-color:var(--colorStrokeFocus2);}", ".fdiulkx[data-fui-focus-visible]::after{top:-2px;}", ".f1yalx80[data-fui-focus-visible]::after{bottom:-2px;}", ".fq22d5a[data-fui-focus-visible]::after{left:-2px;}", ".f1jw7pan[data-fui-focus-visible]::after{right:-2px;}", ".f1e4lqlz{box-sizing:content-box;}", ".f1u2r49w{background-color:inherit;}", ".f1ym3bx4{color:inherit;}", ".f1mo0ibp{font-family:inherit;}", ".fjoy568{font-size:inherit;}", ".fytdu2e{line-height:normal;}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1mtd64y{overflow-x:visible;}", ".f1y7q3j9{overflow-y:visible;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f37px4s{-webkit-appearance:button;}", ".fgusgyc{text-align:unset;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f81rol6{padding-right:10px;}", ".frdkuqy{padding-left:10px;}", ".f1d2rq10{height:32px;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1k6fduh{cursor:pointer;}", ".f1q8lukm{-webkit-column-gap:4px;column-gap:4px;}", ".f1ma2n7n{row-gap:4px;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".f161knb0{padding-left:2px;}", ".f12huiiw{padding-right:2px;}", ".f3rmtva{background-color:transparent;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".fe5j1ua{font-size:20px;}", ".fez10in{line-height:0;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}"],
|
137
|
+
h: [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}", ".ft1hn21:hover .fui-Icon-filled{display:inline;}", ".fuxngvv:hover .fui-Icon-regular{display:none;}", ".fp258yr:hover .fui-MenuItem__icon{color:var(--colorNeutralForeground2BrandSelected);}", ".f1jp5ecu:hover{color:var(--colorNeutralForeground3Hover);}", ".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}"]
|
145
138
|
});
|
146
139
|
/** Applies style classnames to slots */
|
147
|
-
|
148
|
-
|
149
140
|
const useMenuItemStyles_unstable = state => {
|
150
141
|
const styles = useStyles();
|
151
142
|
state.root.className = react_1.mergeClasses(exports.menuItemClassNames.root, state.isNativeButton && styles.resetButton, styles.root, styles.focusIndicator, state.disabled && styles.disabled, state.root.className);
|
152
|
-
|
153
143
|
if (state.content) {
|
154
144
|
state.content.className = react_1.mergeClasses(exports.menuItemClassNames.content, styles.content, state.content.className);
|
155
145
|
}
|
156
|
-
|
157
146
|
if (state.checkmark) {
|
158
147
|
state.checkmark.className = react_1.mergeClasses(exports.menuItemClassNames.checkmark, state.checkmark.className);
|
159
148
|
}
|
160
|
-
|
161
149
|
if (state.secondaryContent) {
|
162
150
|
state.secondaryContent.className = react_1.mergeClasses(exports.menuItemClassNames.secondaryContent, !state.disabled && styles.secondaryContent, state.secondaryContent.className);
|
163
151
|
}
|
164
|
-
|
165
152
|
if (state.icon) {
|
166
153
|
state.icon.className = react_1.mergeClasses(exports.menuItemClassNames.icon, styles.icon, state.icon.className);
|
167
154
|
}
|
168
|
-
|
169
155
|
if (state.submenuIndicator) {
|
170
156
|
state.submenuIndicator.className = react_1.mergeClasses(exports.menuItemClassNames.submenuIndicator, styles.submenuIndicator, state.submenuIndicator.className);
|
171
157
|
}
|
172
|
-
|
173
158
|
index_1.useCheckmarkStyles_unstable(state);
|
174
159
|
};
|
175
|
-
|
176
160
|
exports.useMenuItemStyles_unstable = useMenuItemStyles_unstable;
|
177
161
|
//# sourceMappingURL=useMenuItemStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"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","names":["exports","root","icon","checkmark","submenuIndicator","content","secondaryContent","useStyles","react_1","useMenuItemStyles_unstable","state","styles","className","isNativeButton","resetButton","focusIndicator","disabled","index_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItem/useMenuItemStyles.ts"],"sourcesContent":["import { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport type { MenuItemCheckboxState } from '../MenuItemCheckbox/index';\nimport type { MenuItemSlots, MenuItemState } from './MenuItem.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const menuItemClassNames: SlotClassNames<MenuItemSlots> = {\n root: 'fui-MenuItem',\n icon: 'fui-MenuItem__icon',\n checkmark: 'fui-MenuItem__checkmark',\n submenuIndicator: 'fui-MenuItem__submenuIndicator',\n content: 'fui-MenuItem__content',\n secondaryContent: 'fui-MenuItem__secondaryContent',\n};\n\nconst useStyles = makeStyles({\n focusIndicator: createFocusOutlineStyle(),\n // TODO: this should be extracted to another package\n resetButton: {\n boxSizing: 'content-box',\n backgroundColor: 'inherit',\n color: 'inherit',\n fontFamily: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'normal',\n ...shorthands.borderColor('transparent'),\n ...shorthands.overflow('visible'),\n ...shorthands.padding(0),\n WebkitAppearance: 'button',\n textAlign: 'unset',\n },\n root: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n position: 'relative',\n color: tokens.colorNeutralForeground2,\n backgroundColor: tokens.colorNeutralBackground1,\n paddingRight: '10px',\n paddingLeft: '10px',\n height: '32px',\n display: 'flex',\n alignItems: 'center',\n fontSize: tokens.fontSizeBase300,\n cursor: 'pointer',\n ...shorthands.gap('4px'),\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n color: tokens.colorNeutralForeground2Hover,\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n [`& .${menuItemClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n },\n\n userSelect: 'none',\n },\n content: {\n paddingLeft: '2px',\n paddingRight: '2px',\n backgroundColor: 'transparent',\n flexGrow: 1,\n },\n secondaryContent: {\n paddingLeft: '2px',\n paddingRight: '2px',\n color: tokens.colorNeutralForeground3,\n ':hover': {\n color: tokens.colorNeutralForeground3Hover,\n },\n ':focus': {\n color: tokens.colorNeutralForeground3Hover,\n },\n },\n icon: {\n width: '20px',\n height: '20px',\n fontSize: '20px',\n lineHeight: 0,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n submenuIndicator: {\n width: '20px',\n height: '20px',\n fontSize: '20px',\n lineHeight: 0,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n ':hover': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':focus': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\n/** Applies style classnames to slots */\nexport const useMenuItemStyles_unstable = (state: MenuItemState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n menuItemClassNames.root,\n state.isNativeButton && styles.resetButton,\n styles.root,\n styles.focusIndicator,\n state.disabled && styles.disabled,\n state.root.className,\n );\n\n if (state.content) {\n state.content.className = mergeClasses(menuItemClassNames.content, styles.content, state.content.className);\n }\n\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemClassNames.checkmark, state.checkmark.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n menuItemClassNames.secondaryContent,\n !state.disabled && styles.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemClassNames.icon, styles.icon, state.icon.className);\n }\n\n if (state.submenuIndicator) {\n state.submenuIndicator.className = mergeClasses(\n menuItemClassNames.submenuIndicator,\n styles.submenuIndicator,\n state.submenuIndicator.className,\n );\n }\n useCheckmarkStyles_unstable(state as MenuItemCheckboxState);\n};\n"]}
|
@@ -4,19 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.MenuItemCheckbox = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const useMenuItemCheckbox_1 = /*#__PURE__*/require("./useMenuItemCheckbox");
|
11
|
-
|
12
9
|
const renderMenuItemCheckbox_1 = /*#__PURE__*/require("./renderMenuItemCheckbox");
|
13
|
-
|
14
10
|
const useMenuItemCheckboxStyles_1 = /*#__PURE__*/require("./useMenuItemCheckboxStyles");
|
15
11
|
/**
|
16
12
|
* Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.
|
17
13
|
*/
|
18
|
-
|
19
|
-
|
20
14
|
exports.MenuItemCheckbox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
15
|
const state = useMenuItemCheckbox_1.useMenuItemCheckbox_unstable(props, ref);
|
22
16
|
useMenuItemCheckboxStyles_1.useMenuItemCheckboxStyles_unstable(state);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;AAGaA,wBAAgB,gBAA+CC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC1G,MAAMC,KAAK,GAAGC,kDAA4B,CAACH,KAAK,EAAEC,GAAG,CAAC;EACtDG,8DAAkC,CAACF,KAAK,CAAC;EAEzC,OAAOG,wDAA+B,CAACH,KAAK,CAAC;AAC/C,CAAC,CAAC;AAEFL,wBAAgB,CAACS,WAAW,GAAG,kBAAkB","names":["exports","React","forwardRef","props","ref","state","useMenuItemCheckbox_1","useMenuItemCheckboxStyles_1","renderMenuItemCheckbox_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemCheckbox/MenuItemCheckbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItemCheckbox_unstable } from './useMenuItemCheckbox';\nimport { renderMenuItemCheckbox_unstable } from './renderMenuItemCheckbox';\nimport { useMenuItemCheckboxStyles_unstable } from './useMenuItemCheckboxStyles';\nimport type { MenuItemCheckboxProps } from './MenuItemCheckbox.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.\n */\nexport const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps> = React.forwardRef((props, ref) => {\n const state = useMenuItemCheckbox_unstable(props, ref);\n useMenuItemCheckboxStyles_unstable(state);\n\n return renderMenuItemCheckbox_unstable(state);\n});\n\nMenuItemCheckbox.displayName = 'MenuItemCheckbox';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
@@ -3,16 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
|
7
6
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
-
|
9
7
|
tslib_1.__exportStar(require("./MenuItemCheckbox.types"), exports);
|
10
|
-
|
11
8
|
tslib_1.__exportStar(require("./MenuItemCheckbox"), exports);
|
12
|
-
|
13
9
|
tslib_1.__exportStar(require("./renderMenuItemCheckbox"), exports);
|
14
|
-
|
15
10
|
tslib_1.__exportStar(require("./useMenuItemCheckbox"), exports);
|
16
|
-
|
17
11
|
tslib_1.__exportStar(require("./useMenuItemCheckboxStyles"), exports);
|
18
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-menu/src/components/MenuItemCheckbox/index.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemCheckbox/index.ts"],"sourcesContent":["export * from './MenuItemCheckbox.types';\nexport * from './MenuItemCheckbox';\nexport * from './renderMenuItemCheckbox';\nexport * from './useMenuItemCheckbox';\nexport * from './useMenuItemCheckboxStyles';\n"]}
|
@@ -4,25 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.renderMenuItemCheckbox_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
9
|
/** Function that renders the final JSX of the component */
|
12
|
-
|
13
|
-
|
14
10
|
const renderMenuItemCheckbox_unstable = state => {
|
15
11
|
const {
|
16
12
|
slots,
|
17
13
|
slotProps
|
18
14
|
} = react_utilities_1.getSlots(state);
|
19
|
-
return React.createElement(slots.root, {
|
20
|
-
|
21
|
-
}
|
22
|
-
|
23
|
-
}), slots.
|
15
|
+
return React.createElement(slots.root, {
|
16
|
+
...slotProps.root
|
17
|
+
}, slots.checkmark && React.createElement(slots.checkmark, {
|
18
|
+
...slotProps.checkmark
|
19
|
+
}), slots.icon && React.createElement(slots.icon, {
|
20
|
+
...slotProps.icon
|
21
|
+
}), slots.content && React.createElement(slots.content, {
|
22
|
+
...slotProps.content
|
23
|
+
}), slots.secondaryContent && React.createElement(slots.secondaryContent, {
|
24
|
+
...slotProps.secondaryContent
|
24
25
|
}));
|
25
26
|
};
|
26
|
-
|
27
27
|
exports.renderMenuItemCheckbox_unstable = renderMenuItemCheckbox_unstable;
|
28
28
|
//# sourceMappingURL=renderMenuItemCheckbox.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAIA;AACO,MAAMA,+BAA+B,GAAIC,KAA4B,IAAI;EAC9E,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAgBH,KAAK,CAAC;EAE3D,OACEI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BJ,KAAK,CAACK,SAAS,IAAIF,oBAACH,KAAK,CAACK,SAAS;IAAA,GAAKJ,SAAS,CAACI;EAAS,EAAI,EAC/DL,KAAK,CAACM,IAAI,IAAIH,oBAACH,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,EAAI,EAChDN,KAAK,CAACO,OAAO,IAAIJ,oBAACH,KAAK,CAACO,OAAO;IAAA,GAAKN,SAAS,CAACM;EAAO,EAAI,EACzDP,KAAK,CAACQ,gBAAgB,IAAIL,oBAACH,KAAK,CAACQ,gBAAgB;IAAA,GAAKP,SAAS,CAACO;EAAgB,EAAI,CAC1E;AAEjB,CAAC;AAXYC,uCAA+B","names":["renderMenuItemCheckbox_unstable","state","slots","slotProps","react_utilities_1","React","root","checkmark","icon","content","secondaryContent","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuItemCheckboxState } from './MenuItemCheckbox.types';\nimport type { MenuItemSlots } from '../MenuItem/MenuItem.types';\n\n/** Function that renders the final JSX of the component */\nexport const renderMenuItemCheckbox_unstable = (state: MenuItemCheckboxState) => {\n const { slots, slotProps } = getSlots<MenuItemSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.checkmark && <slots.checkmark {...slotProps.checkmark} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slots.content && <slots.content {...slotProps.content} />}\n {slots.secondaryContent && <slots.secondaryContent {...slotProps.secondaryContent} />}\n </slots.root>\n );\n};\n"]}
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuItemCheckbox_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
-
|
12
9
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
13
|
-
|
14
10
|
const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
|
15
|
-
|
16
11
|
const useMenuItem_1 = /*#__PURE__*/require("../MenuItem/useMenuItem");
|
17
12
|
/** Returns the props and state required to render the component */
|
18
|
-
|
19
|
-
|
20
13
|
const useMenuItemCheckbox_unstable = (props, ref) => {
|
21
14
|
const toggleCheckbox = menuListContext_1.useMenuListContext_unstable(context => context.toggleCheckbox);
|
22
15
|
const {
|
@@ -25,11 +18,11 @@ const useMenuItemCheckbox_unstable = (props, ref) => {
|
|
25
18
|
} = props;
|
26
19
|
const checked = menuListContext_1.useMenuListContext_unstable(context => {
|
27
20
|
var _a;
|
28
|
-
|
29
21
|
const checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[name]) || [];
|
30
22
|
return checkedItems.indexOf(value) !== -1;
|
31
23
|
});
|
32
|
-
const state = {
|
24
|
+
const state = {
|
25
|
+
...useMenuItem_1.useMenuItem_unstable({
|
33
26
|
role: 'menuitemcheckbox',
|
34
27
|
persistOnClick: true,
|
35
28
|
...props,
|
@@ -42,7 +35,6 @@ const useMenuItemCheckbox_unstable = (props, ref) => {
|
|
42
35
|
}),
|
43
36
|
onClick: e => {
|
44
37
|
var _a;
|
45
|
-
|
46
38
|
toggleCheckbox === null || toggleCheckbox === void 0 ? void 0 : toggleCheckbox(e, name, value, checked);
|
47
39
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
48
40
|
}
|
@@ -53,6 +45,5 @@ const useMenuItemCheckbox_unstable = (props, ref) => {
|
|
53
45
|
};
|
54
46
|
return state;
|
55
47
|
};
|
56
|
-
|
57
48
|
exports.useMenuItemCheckbox_unstable = useMenuItemCheckbox_unstable;
|
58
49
|
//# sourceMappingURL=useMenuItemCheckbox.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA;AACO,MAAMA,4BAA4B,GAAG,CAC1CC,KAA4B,EAC5BC,GAAwC,KACf;EACzB,MAAMC,cAAc,GAAGC,6CAA2B,CAACC,OAAO,IAAIA,OAAO,CAACF,cAAc,CAAC;EACrF,MAAM;IAAEG,IAAI;IAAEC;EAAK,CAAE,GAAGN,KAAK;EAE7B,MAAMO,OAAO,GAAGJ,6CAA2B,CAACC,OAAO,IAAG;;IACpD,MAAMI,YAAY,GAAG,cAAO,CAACC,aAAa,0CAAGJ,IAAI,CAAC,KAAI,EAAE;IACxD,OAAOG,YAAY,CAACE,OAAO,CAACJ,KAAK,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC,CAAC;EAEF,MAAMK,KAAK,GAA0B;IACnC,GAAGC,kCAAoB,CACrB;MACEC,IAAI,EAAE,kBAAkB;MACxBC,cAAc,EAAE,IAAI;MACpB,GAAGd,KAAK;MACR,cAAc,EAAEO,OAAO;MACvBQ,SAAS,EAAEC,kCAAgB,CAAChB,KAAK,CAACe,SAAS,EAAE;QAC3CE,YAAY,EAAE;UAAEC,QAAQ,EAAEC,oBAACC,+BAAiB;QAAG,CAAE;QACjDC,QAAQ,EAAE;OACX,CAAC;MACFC,OAAO,EAAGC,CAAyD,IAAI;;QACrErB,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAGqB,CAAC,EAAElB,IAAI,EAAEC,KAAK,EAAEC,OAAO,CAAC;QACzC,WAAK,CAACe,OAAO,+CAAbtB,KAAK,EAAWuB,CAAC,CAAC;MACpB;KACD,EACDtB,GAAG,CACJ;IACDI,IAAI;IACJC,KAAK;IACLC;GACD;EAED,OAAOI,KAAK;AACd,CAAC;AApCYa,oCAA4B","names":["useMenuItemCheckbox_unstable","props","ref","toggleCheckbox","menuListContext_1","context","name","value","checked","checkedItems","checkedValues","indexOf","state","useMenuItem_1","role","persistOnClick","checkmark","react_utilities_1","defaultProps","children","React","react_icons_1","required","onClick","e","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemCheckbox/useMenuItemCheckbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { Checkmark16Filled } from '@fluentui/react-icons';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useMenuItem_unstable } from '../MenuItem/useMenuItem';\nimport type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox.types';\nimport type { ARIAButtonElement, ARIAButtonElementIntersection } from '@fluentui/react-aria';\n\n/** Returns the props and state required to render the component */\nexport const useMenuItemCheckbox_unstable = (\n props: MenuItemCheckboxProps,\n ref: React.Ref<ARIAButtonElement<'div'>>,\n): MenuItemCheckboxState => {\n const toggleCheckbox = useMenuListContext_unstable(context => context.toggleCheckbox);\n const { name, value } = props;\n\n const checked = useMenuListContext_unstable(context => {\n const checkedItems = context.checkedValues?.[name] || [];\n return checkedItems.indexOf(value) !== -1;\n });\n\n const state: MenuItemCheckboxState = {\n ...useMenuItem_unstable(\n {\n role: 'menuitemcheckbox',\n persistOnClick: true,\n ...props,\n 'aria-checked': checked,\n checkmark: resolveShorthand(props.checkmark, {\n defaultProps: { children: <Checkmark16Filled /> },\n required: true,\n }),\n onClick: (e: React.MouseEvent<ARIAButtonElementIntersection<'div'>>) => {\n toggleCheckbox?.(e, name, value, checked);\n props.onClick?.(e);\n },\n },\n ref,\n ),\n name,\n value,\n checked,\n };\n\n return state;\n};\n"]}
|