UNPKG

@hxui/angular

Version:

An Angular library based on the [HXUI design system](https://hxui.io).

58 lines (57 loc) 2.75 kB
import { Directionality } from '@angular/cdk/bidi'; import { Overlay, OverlayRef, ScrollDispatcher } from '@angular/cdk/overlay'; import { ComponentFactoryResolver, ElementRef, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'; import { Context } from '../enums'; import { TooltipContentComponent } from './tooltip-content.component'; import { TooltipDynamicContentDirective } from './tooltip-dynamic-content.directive'; import { TooltipConfig } from './tooltip.config'; import * as i0 from "@angular/core"; export declare class TooltipDirective implements OnDestroy { private _elementRef; private _viewContainerRef; overlay: Overlay; private _ngZone; private _scrollDispatcher; private _componentFactoryResolver; private _config; private _dir; dynamicContent: TooltipDynamicContentDirective; _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; autoClose: boolean; show(): void; close(): 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; hide(): 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; static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, [null, null, null, null, null, null, null, { optional: true; }]>; static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[hxTooltip], [hxaTooltip]", never, { "content": "hxTooltip"; "disabled": "disabled"; "placement": "placement"; "showDelay": "showDelay"; "hideDelay": "hideDelay"; "context": "context"; "maxWidth": "maxWidth"; "autoClose": "autoClose"; }, {}, ["dynamicContent"]>; }