UNPKG

@perfectmemory/ngx-contextmenu

Version:

A context menu component for Angular

46 lines (45 loc) 1.73 kB
import { ElementRef } from '@angular/core'; import type { ContextMenuComponent } from '../../components/context-menu/context-menu.component'; import { ContextMenuOverlaysService } from '../../services/context-menu-overlays/context-menu-overlays.service'; import * as i0 from "@angular/core"; export declare class ContextMenuDirective<T> { private elementRef; private contextMenuOverlaysService; /** * The value related to the context menu */ contextMenuValue: T; /** * The component holding the menu item directive templates */ contextMenu?: ContextMenuComponent<T>; /** * The directive must have a tabindex for being accessible */ tabindex: string | number; /** * Return true if the context menu is opened, false otherwise */ get isOpen(): boolean; constructor(elementRef: ElementRef<HTMLElement>, contextMenuOverlaysService: ContextMenuOverlaysService); /** * @internal */ onContextMenu(event: MouseEvent): void; /** * @internal */ onKeyArrowEscape(): void; /** * Programmatically open the context menu */ open(event?: MouseEvent): void; /** * Programmatically close the context menu */ close(): void; private closeAll; private canOpen; static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuDirective<any>, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ContextMenuDirective<any>, "[contextMenu]", ["ngxContextMenu"], { "contextMenuValue": { "alias": "contextMenuValue"; "required": false; }; "contextMenu": { "alias": "contextMenu"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; }, {}, never, never, false, never>; }