UNPKG

@dotglitch/ngx-common

Version:

Angular components and utilities that are commonly used.

38 lines (37 loc) 1.67 kB
import { ViewContainerRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MenuItem, MenuOptions } from '../types/menu'; import * as i0 from "@angular/core"; export declare class MenuDirective { private dialog; private viewContainer; /** * The data representing the item the menu was opened for. */ data: any; /** * The items that will be bound to the context menu. */ ctxMenuItems: MenuItem[]; /** * The items that will be bound to the menu that pops * up when the user clicks the element. */ menuItems: MenuItem[]; /** * Configuration for opening the app menu */ config: MenuOptions; private triggers; constructor(dialog: MatDialog, viewContainer: ViewContainerRef); ngOnInit(): void; ngOnChanges(): void; ngAfterViewInit(): void; openMenu(evt: PointerEvent, items?: MenuItem[], keepOpen?: boolean): Promise<[value: any]>; onCtxMenu(e: any): void; onClick(e: any): void; onDblClick(e: any): void; static ɵfac: i0.ɵɵFactoryDeclaration<MenuDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<MenuDirective, "[ngx-contextmenu],[ngx-menu]", never, { "data": { "alias": "ngx-menu-context"; "required": false; }; "ctxMenuItems": { "alias": "ngx-contextmenu"; "required": false; }; "menuItems": { "alias": "ngx-menu"; "required": false; }; "config": { "alias": "ngx-menu-config"; "required": false; }; }, {}, never, never, true, never>; } export declare const openMenu: (dialog: MatDialog, menuItems: MenuItem[], data: any, evt: PointerEvent, config?: MenuOptions, el?: HTMLElement) => Promise<any>;