11<!-- eslint-disable vue/block-tag-newline -->
22<script lang="ts">
33import type { VariantProps } from ' tailwind-variants'
4- import type { ContextMenuRootProps , ContextMenuRootEmits , ContextMenuContentProps } from ' reka-ui'
4+ import type { ContextMenuRootProps , ContextMenuRootEmits , ContextMenuContentProps , ContextMenuContentEmits } from ' reka-ui'
55import type { AppConfig } from ' @nuxt/schema'
66import _appConfig from ' #build/app.config'
77import theme from ' #build/ui/context-menu'
88import { tv } from ' ../utils/tv'
99import type { AvatarProps , KbdProps , LinkProps } from ' ../types'
10- import type { DynamicSlots , PartialString } from ' ../types/utils'
10+ import type { DynamicSlots , PartialString , EmitsToProps } from ' ../types/utils'
1111
1212const appConfigContextMenu = _appConfig as AppConfig & { ui: { contextMenu: Partial <typeof theme > } }
1313
@@ -23,7 +23,7 @@ export interface ContextMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custo
2323 icon? : string
2424 color? : ContextMenuVariants [' color' ]
2525 avatar? : AvatarProps
26- content? : Omit <ContextMenuContentProps , ' as' | ' asChild' | ' forceMount' >
26+ content? : Omit <ContextMenuContentProps , ' as' | ' asChild' | ' forceMount' > & Partial < EmitsToProps < ContextMenuContentEmits >>
2727 kbds? : KbdProps [' value' ][] | KbdProps []
2828 /**
2929 * The item type.
@@ -67,7 +67,7 @@ export interface ContextMenuProps<T> extends Omit<ContextMenuRootProps, 'dir'> {
6767 */
6868 externalIcon? : boolean | string
6969 /** The content of the menu. */
70- content? : Omit <ContextMenuContentProps , ' as' | ' asChild' | ' forceMount' >
70+ content? : Omit <ContextMenuContentProps , ' as' | ' asChild' | ' forceMount' > & Partial < EmitsToProps < ContextMenuContentEmits >>
7171 /**
7272 * Render the menu in a portal.
7373 * @defaultValue true
@@ -114,7 +114,7 @@ const emits = defineEmits<ContextMenuEmits>()
114114const slots = defineSlots <ContextMenuSlots <T >>()
115115
116116const rootProps = useForwardPropsEmits (reactivePick (props , ' modal' ), emits )
117- const contentProps = toRef (() => props .content as ContextMenuContentProps )
117+ const contentProps = toRef (() => props .content )
118118const proxySlots = omit (slots , [' default' ]) as Record <string , ContextMenuSlots <T >[string ]>
119119
120120const ui = computed (() => contextMenu ({
0 commit comments