UNPKG

@hxui/angular

Version:

* * *

51 lines (50 loc) 2.07 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 _scrollDispatcher; private _componentFactoryResolver; private _config; private _dir; _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; maxWidth: number; show(): void; hide(): void; constructor(_elementRef: ElementRef, _viewContainerRef: ViewContainerRef, overlay: Overlay, _ngZone: NgZone, _scrollDispatcher: ScrollDispatcher, _componentFactoryResolver: ComponentFactoryResolver, _config: TooltipConfig, _dir: Directionality); /** * Dispose the tooltip when destroyed. */ ngOnDestroy(): void; private _show; private _hide; 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; private _detach; /** Updates the tooltip content and repositions the overlay according to the new content length */ private _updateTooltipContent; }