import { AfterViewInit, ApplicationRef, ComponentFactoryResolver, ElementRef, EventEmitter, ViewContainerRef } from '@angular/core'; import { MtnaCoachMarkConfig } from './coachmark-config.model'; import * as i0 from "@angular/core"; /** * Directive that attaches an MTNA designed coach mark to the host element. Used mostly to guide * users around the software or show the user a new feature. * * @author Nick Richards */ export declare class MtnaCoachMarkDirective implements AfterViewInit { private elementRef; private reslover; private viewContainerRef; private applicationRef; private appInstance; /** * Color for button, defaults to accent. * * * * @memberOf MtnaCoachMarkDirective */ private _buttonColor; /** * Text for the button */ private _buttonText; /** * Emitter when the component is closed. */ closedCoachMark: EventEmitter; /** * the factory used to create the coach mark component */ private _componentFactory; /** * the coach mark component reference */ private _componentRef?; /** * Setter and getter for config. */ private _config; get config(): MtnaCoachMarkConfig; set config(config: MtnaCoachMarkConfig); /** * Height of the host element in case the window view is showing up * incorrectly. If not set, the height is calculated based off the client rect of the * host element. */ private _height?; /** * Instructiuon text to display wihtin coach mark. */ private _instructions; /** * Color of the overlay. Can be primary, accent or warn. Defaults to primary. */ private _overlayColor; /** * Position of the instructions. Can be left, before, right, after, below or above. * Defaults to after. */ private _position; /** * the radius of the window. Calculated based on user input of mtnaCoachMarkSize. */ private _radius?; /** * Size of the window. Can be small, medium or large. Defaults to medium. */ private _size; /** * Width of the hosted element in case the window view is showing up * incorrectly. If not set, the width is calculated based off the client rect of the * host element. */ private _width?; /** * center(x) position of the window. Based on the user input of the width or width of * host element if mtnaCoachMarkWidth is not set. */ private _windowPositionX?; /** * center(y) position of the window. Based on the user input of the height or height of * host element if mtnaCoachMarkWidth is not set. */ private _windowPositionY?; /** * the client rect of the window element. */ private _windowRect?; /** * Used to offset the instructions 'x' number of pixels in the x direction. * Defaults to 0. */ private _xOffset; /** * Used to offset the instructions 'x' number of pixels in the y direction. * Defaults to 0. */ private _yOffset; /** * array used to set parameters of the component. */ private _coachMarkParams; /** * creates the component Factory. */ constructor(elementRef: ElementRef, reslover: ComponentFactoryResolver, viewContainerRef: ViewContainerRef, applicationRef: ApplicationRef, appInstance: ViewContainerRef); /** * calculates the center position of the window. */ _calculateWindowPosition(): void; /** * calculates the height of the element to determine center point of window. */ _calculateHeight(): void; /** * calculates the value of the radius based of the width and height. * If the width is wider than the height, then it uses the width and vice versa. * It divides the determining value (width or height) by 2 and then adds some pixels to that * based on if it's small, medium or large. Small adds 5px, medium adds 15px, and large * adds 25px. */ _calculateRadius(): void; /** * Calls all the calculate methods and sets the windowRect. */ _calculateValues(): void; /** * calculates the width of the element to determine center point of window. */ _calculateWidth(): void; /** * gets the root view container. Used to display the coach mark over the whole window * view instead of the just the element the directive is on. */ _getRootViewContainerRef(): ViewContainerRef; /** * Called when the coach mark will be displayed. Listens for the coachMarkComponent's * event emitter when component is closed and then emits a closedCoachMark event. */ _loadComponent(): void; closeCoachMark(): void; ngAfterViewInit(): void; /** * Sets the parameters for the component. */ _setComponentParameters(): void; /** * Sets the appInstance. If host element is within the root component, it will set * the appInstance to the viewContainerRef, otherwise it calls _getRootViewContainerRef to * get the root container and sets appInstance to that. */ _setContainerRef(): void; /** * Sets the parameters of the directive equal to the given parameters within the * config object. */ _setParams(): void; /** * Called to show the coach mark. */ showCoachMark(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }