import { ApplicationRef, ComponentFactoryResolver, ElementRef, Injector, NgZone, RendererFactory2 } from "@angular/core"; import { OverlayBaseService } from "./overlay-base.service"; import { CreateOption, Overlay, OverlayPosition } from "./overlay.interface"; import { StringGlobalOverlayPosition } from "./overlay.type"; export declare class OverlayService extends OverlayBaseService { private componentFactoryResolver; private appRef; private injector; private ngZone; private rendererFactory; overlayContainer: HTMLElement; private _overlayPosition; private _originElement; private _positionObj; private _overlayBase; private _backdropElement; private _renderer2; constructor(componentFactoryResolver: ComponentFactoryResolver, appRef: ApplicationRef, injector: Injector, ngZone: NgZone, rendererFactory: RendererFactory2); private set _overlayContainerStyleLeft(value); private set _overlayContainerStyleTop(value); /** * Creates overlay. * * @author Federico Gambardella */ private _create; /** * Gets native element of elemntRef given in input * * @author Federico Gambardella * @param {ElementRef} originElement * @return {HTMLElement} */ private _getNativeElement; /** * Create overlay container * * @author Federico Gambardella */ private _createOverlayContainer; /** * Create backdrop element . * * @author Federico Gambardella */ private _buildBackDropElement; /** * Attach component to overlay. * * @author Federico Gambardella * @param componentToAttach */ attach(componentToAttach: any, options?: CreateOption): Overlay; /** * Calculate overlay position respect origin element. * * @author Federico Gambardella * @param {ElementRef, overlay: Overlay, positionObject: OverlayPosition): void; /** * Calculate position by scroll strategy. * * @author Federico Gambardella * @param {OverlayPosition} posObj * @param {Overlay} overlay */ private _calculatePositionByScrollStrategy; /** * Initialize position object with default values if user does not provide them. * * @author Federico Gambardella * @param {OverlayPosition} positionObject * @return {OverlayPosition} */ private _initializePositionObject; /** * Selects position object * * @author Federico Gambardella * @param {OverlayPosition} positionObject * @param {DOMRect} positionDOM * @param {HTMLElement} originElement */ private _selectPositionByObject; /** * Set overlay container top position. * * @author Federico Gambardella * @param {number} posTop * @param {number} offsetY * @return {void} */ private _setOverlayContainerTop; /** * Calculates position bottom. * * @author Federico Gambardella * @param {DOMRect} position * @param {HTMLElement} originElement * @param {OverlayPosition} positionObject */ private _positionBottom; /** * Sets top coordinate when is setted bottom position * * @author Federico Gambardella * @param {number} posTop * @param {DOMRect} position * @param {HTMLElement} originElement * @param {OverlayPosition} posObj */ private _setCoordinateTopForBottom; /** * Sets left coordinate when is setted bottom or top position * * @author Federico Gambardella * @param {number} posLeft * @param {number} posTop * @param {number} position * @param {OverlayPosition} posObj */ private _setCoordinateLeftForBottomTop; /** * Calculates position top. * * @author Federico Gambardella * @param {DOMRect} position * @param {HTMLElemen} originElement * @param {OverlayPosition} positionObject */ private _positionTop; /** * Sets left coordinate by position object. * * @author Federico Gambardella * @param {OverlayPosition} positionObj * @param {number} positionLeft * @return {number} */ private _setPosLeftByPosObj; /** * Sets left coordinate when overlay go out of viewport on the right. * * @author Federico Gambardella * @param {OverlayPosition} positionObj * @param {number} positionLeft * @return {string} */ private _setPosLeftTopOutViewPortRight; /** * Sets corrdinate top for top position. * * @author Federico Gambardella * @param {number} posTop * @param {number} posLeft * @param {DOMRect} position * @param {HTMLElement} originElement * @param {OverlayPosition} posObj */ private _setCoordinateTopForTop; /** * Calculates position Left. * * @author Federico Gambardella * @param {DOMRect} position * @param {HTMLElement} originElement * @param {OverlayPosition} positionObject */ private _positionLeft; /** * Sets corrdinate top for left position. * * @author Federico Gambardella * @param {number} posTop * @param {number} posLeft * @param {DOMRect} position * @param {HTMLElement} originElement * @param {OverlayPosition} positionObject * @return {void} */ private _checkPositionForLeft; /** * Calculates position right. * * @author Federico Gambardella * @param {DOMRect} position * @param {HTMLElement} originElement * @param {OverlayPosition} positionObject */ private _positionRight; /** * Sets corrdinate top for right position. * * @author Federico Gambardella * @param {number} posTop * @param {number} posLeft * @param {DOMRect} position * @param {HTMLElement} originElement * @param {OverlayPosition} positionObject * @return {void} */ private _checkPositionForRight; /** * Set coordinate top for left right. * * @author Federico Gambardella * @param {number} posTop * @param {DOMRect} position * @param {OverlayPosition} positionObject * @return {void} */ private _setCoordinateTopForLeftRight; /** * Sets left coordinate by position object. * * @author Federico Gambardella * @param {OverlayPosition} positionObj * @param {number} positionLeft * @return {number} */ private _setPosToptByPosObj; /** * Calculates width of element overlay. * * @author Federico Gambardella * @param {HTMLElement} element * @return */ private _calculateElementOverlayPosition; /** * Set croll offset by scrollStartegy. * * @author Federico Gambardella * @param {OverlayPosition} posObj */ private _setScrollByScrollStartegy; /** * Calculates psotion on resize. * * @author Federico Gambardella * @param {Overlay} overlay */ private _calculatePositionOnResize; /** * Calculates psoition on scroll. * * @author Federico Gambardella * @param {Overlay} overlay */ private _calculatePositionOnScroll; /** * Close overlay on backDrop click. * * @author Federico Gambardella * @param overlay * @param options */ private _closeOnBackDrop; /** * Detach component to overlay * * @author Federico Gambardella * @param {Overlay} overlay */ detach(overlay: Overlay | undefined): void; /** * Manage backdrop. * * @author Federico Gambardella * @returns {void} */ private _manageBackdrop; /** * Notify position status. * * @author Federico Gambardella * @param {OverlayPositionEnum} position * @param {number} posLeft * @param {number} posTop * @return {void} */ private _notifyPositionStatus; /** * Notify position status. * * @author Federico Gambardella * @param {string} position * @return {void} */ private _notifyOutViewPort; /** * Calculate global position. * * @author Federico Gambardella * @param {StringGlobalOverlayPosition} position * @param {Overlay} overlay * @return {void} */ calculateGlobalPosition(position?: StringGlobalOverlayPosition, overlay?: Overlay): void; /** * Caluclate global position. * * @author Federico Gambardella * @param {StringGlobalOverlayPosition} position * @param {Overlay} overlay * @return {void} */ private _calculateGloabPosition; /** * Add overlay global style. * * @author Federico Gambardella * @return {void} */ private _addOverlayGlobalStyle; /** * Select global position by position input. * * @author Federico Gambardella * @param {StringGlobalOverlayPosition} position * @param {Overlay} overlay * @return {void} */ private _selectGlobalPosition; /** * Makes appear the overlay on right-bottom. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _bottomRightPosition; /** * Makes appears the overlay on right-center. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _centerRightPosition; /** * Makes appears the overlay on right-top. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _topRightPosition; /** * Center overlay on the screen. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _centerGlobalPosition; /** * Makes appear the overlay on center-bottom. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _centerBottomGlobalPosition; /** * Makes appear the overlay on center-top. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _centerTopGlobalPosition; /** * Makes appear the overlay on left-bottom. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _bottomLeftPosition; /** * Makes appear the overlay on left-center. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _centerLeftPosition; /** * Makes appear the overlay on top-left. * * @author Federico Gambardella * @param {Overlay} overlay * @return {void} */ private _topLeftPosition; }