UNPKG

@hxui/angular

Version:

This README includes the steps that are necessary to import the HxUi-angular into a project or to contribute with development.

50 lines (49 loc) 2.08 kB
import { ViewContainerRef, ElementRef, OnDestroy, NgZone, ComponentFactoryResolver } from '@angular/core'; import { TooltipContentComponent } from './tooltip-content.component'; import { TooltipConfig } from './tooltip.config'; import { Context } from '../enums'; import { Overlay, OverlayRef, ScrollDispatcher } from '@angular/cdk/overlay'; import { Directionality } from '@angular/cdk/bidi'; export declare class TooltipDirective implements OnDestroy { private _elementRef; private _viewContainerRef; overlay: Overlay; private _ngZone; private _dir; private _scrollDispatcher; private _componentFactoryResolver; private _config; _overlayRef: OverlayRef | null; _tooltipInstance: TooltipContentComponent | null; private _portal; private readonly _destroyed; position: string; content: string; disabled: boolean; placement: 'top' | 'bottom' | 'left' | 'right'; showDelay: number; hideDelay: number; context: Context; show(): void; hide(): void; constructor(_elementRef: ElementRef, _viewContainerRef: ViewContainerRef, overlay: Overlay, _ngZone: NgZone, _dir: Directionality, _scrollDispatcher: ScrollDispatcher, _componentFactoryResolver: ComponentFactoryResolver, _config: TooltipConfig); /** * Dispose the tooltip when destroyed. */ ngOnDestroy(): void; private _show(delay?); private _hide(delay?); private _createOverlay(); private _updatePosition(); /** * Returns the origin position and a fallback position based on the user's position preference. * The fallback position is the inverse of the origin (e.g. `'bottom' -> 'top'`). */ private _getOrigin(); /** Returns the overlay position and a fallback position based on the user's preference */ private _getOverlayPosition(); private _invertPosition(x, y); private _detach(); /** Updates the tooltip content and repositions the overlay according to the new content length */ private _updateTooltipContent(); }