import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps, ContextMenuContentEmits } from 'reka-ui'; import type { VNode } from 'vue'; import type { AppConfig } from '@nuxt/schema'; import theme from '#build/b24ui/context-menu'; import type { AvatarProps, IconComponent, KbdProps, LinkProps } from '../types'; import type { ArrayOrNested, DynamicSlots, GetItemKeys, MergeTypes, NestedItem, EmitsToProps } from '../types/utils'; import type { ComponentConfig } from '../types/tv'; type ContextMenu = ComponentConfig; export interface ContextMenuItem extends Omit { label?: string; description?: string; /** * @IconComponent */ icon?: IconComponent; color?: ContextMenu['variants']['color']; avatar?: AvatarProps; content?: Omit & { class?: any; } & Partial>; kbds?: KbdProps['value'][] | KbdProps[]; /** * The item type. * @defaultValue 'link' */ type?: 'label' | 'separator' | 'link' | 'checkbox'; slot?: string; loading?: boolean; disabled?: boolean; checked?: boolean; open?: boolean; defaultOpen?: boolean; children?: ArrayOrNested; onSelect?: (e: Event) => void; onUpdateChecked?: (checked: boolean) => void; class?: any; b24ui?: Pick; [key: string]: any; } export interface ContextMenuProps = ArrayOrNested> extends Omit { items?: T; /** * The icon displayed when an item is checked. * @defaultValue icons.check * @IconComponent */ checkedIcon?: IconComponent; /** * The icon displayed when an item is loading. * @defaultValue icons.loading * @IconComponent */ loadingIcon?: IconComponent; /** * The icon displayed when the item is an external link. * Set to `false` to hide the external icon. * @defaultValue icons.external * @IconComponent */ externalIcon?: boolean | IconComponent; /** The content of the menu. */ content?: Omit & Partial>; /** * Render the menu in a portal. * @defaultValue true */ portal?: boolean | string | HTMLElement; /** * The key used to get the label from the item. * @defaultValue 'label' */ labelKey?: GetItemKeys; /** * The key used to get the description from the item. * @defaultValue 'description' */ descriptionKey?: GetItemKeys; disabled?: boolean; class?: any; b24ui?: ContextMenu['slots']; } export interface ContextMenuEmits extends ContextMenuRootEmits { } type SlotProps = (props: { item: T; active: boolean; index: number; b24ui: ContextMenu['b24ui']; }) => VNode[]; export type ContextMenuSlots = ArrayOrNested, T extends NestedItem = NestedItem> = { 'default'?(props?: {}): VNode[]; 'item'?: SlotProps; 'item-leading'?: SlotProps; 'item-label'?: (props: { item: T; active: boolean; index: number; }) => VNode[]; 'item-description'?: (props: { item: T; active: boolean; index: number; }) => VNode[]; 'item-trailing'?: SlotProps; 'content-top'?: (props: { sub: boolean; }) => VNode[]; 'content-bottom'?: (props: { sub: boolean; }) => VNode[]; } & DynamicSlots, 'label' | 'description', { active: boolean; index: number; }> & DynamicSlots, 'leading' | 'trailing', { active: boolean; index: number; b24ui: ContextMenu['b24ui']; }>; declare const _default: typeof __VLS_export; export default _default; declare const __VLS_export: >(__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: import("vue").PublicProps & __VLS_PrettifyLocal & { "onUpdate:open"?: ((payload: boolean) => any) | undefined; }> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: {}) => void; attrs: any; slots: ContextMenuSlots>; emit: (evt: "update:open", payload: boolean) => void; }>) => import("vue").VNode & { __ctx?: Awaited; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};