UNPKG

ngx-modal-ease

Version:

ngx-modal-ease is a versatile Angular library providing a lightweight, simple, and performant modal. This library supports data communication between components, opening of multiple modals, custom animations, and a range of customisable options.

45 lines (44 loc) 1.86 kB
import { ElementRef, AfterViewInit, OnInit } from '@angular/core'; import { ModalService } from './modal.service'; import { Options } from './modal-options'; import { PromiseModal } from './internal-interfaces'; import * as i0 from "@angular/core"; export declare class ModalComponent implements OnInit, AfterViewInit { private modalService; private element; modal: ElementRef<HTMLDivElement>; overlay: ElementRef<HTMLDivElement>; options: Options | undefined; modalLeaveAnimation: string; overlayLeaveAnimation: string; overlayClosed: boolean; modalClosed: boolean; layerLevel: number; constructor(modalService: ModalService, element: ElementRef<HTMLElement>); ngOnInit(): void; ngAfterViewInit(): void; /** * Multiple modals might register multiple event listener, hence the 'layerLevel' variable and two times the condition check for the escape option. * Arrow function to respect the this instance. */ handleEscape: (event: KeyboardEvent) => void; onClose(): void; /** * Add options and animations * Apply user style and animations, listen to animation ends. Apply z-indexes on overlay and modal, with 1000 as incremental value. */ addOptionsAndAnimations(): void; removeElementIfNotAnimated(element: HTMLDivElement, animation: string): void; /** * Clean the DOM * Apply the leaving animations and clean the DOM. Three different use cases. * Last In First Out */ close(contentCp: PromiseModal): void; /** * Remove modal when both animations come to an end. */ removeModalComponent(contentCp: PromiseModal): void; static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "app-modal", never, {}, {}, never, ["*"], true, never>; }