@nova-ui/bits
Version:
SolarWinds Nova Framework
69 lines (68 loc) • 3.18 kB
TypeScript
import { AriaDescriber, FocusMonitor } from "@angular/cdk/a11y";
import { ElementRef, NgZone, OnDestroy, ViewContainerRef } from "@angular/core";
import { TooltipPosition } from "./public-api";
import { TooltipComponent } from "./tooltip.component";
import { OverlayPositionService } from "../overlay/overlay-position.service";
import * as i0 from "@angular/core";
/**
* <example-url>./../examples/index.html#/tooltip</example-url>
*
* @dynamic
*/
export declare class TooltipDirective implements OnDestroy {
private _elementRef;
private _viewContainerRef;
private _ngZone;
private _ariaDescriber;
private _focusMonitor;
private overlayPositionService;
_tooltipInstance?: TooltipComponent;
private _position;
private _disabled;
private _ellipsis;
/** Allows the user to define the position of the tooltip relative to the parent element */
get position(): TooltipPosition;
set position(value: TooltipPosition);
/** Disables the display of the tooltip. */
get disabled(): boolean;
set disabled(value: boolean);
/** Determines whether the tooltip should be displayed when the content is overflowing. By default is `false`. */
get ellipsis(): boolean;
set ellipsis(value: boolean);
private _message;
/** The message to be displayed in the tooltip */
get message(): string;
set message(value: string);
private _manualListeners;
/** Emits when the component is destroyed. */
private readonly _destroyed;
constructor(_elementRef: ElementRef<HTMLElement>, _viewContainerRef: ViewContainerRef, _ngZone: NgZone, _ariaDescriber: AriaDescriber, _focusMonitor: FocusMonitor, overlayPositionService: OverlayPositionService);
/**
* Dispose the tooltip when destroyed.
*/
ngOnDestroy(): void;
/** Shows the tooltip if not disabled or empty */
show(): void;
/**
* Checks if the content is overflowing.
* The content is considered overflowing if its scroll width is greater than its client width plus 1.
*/
isOverflowing(): boolean;
/** Hides the tooltip */
hide(): void;
/** Shows/hides the tooltip */
toggle(): void;
/** Returns true if the tooltip is currently visible to the user */
_isTooltipVisible(): boolean;
/** Handles the keydown events on the host element. */
_handleKeydown(e: KeyboardEvent): void;
/** Handles the touchend events on the host element. */
_handleTouchend(): void;
private createTooltipComponent;
private updateOverlayPositions;
/** Updates the tooltip message and repositions the overlay according to the new message length */
private _updateTooltipMessage;
private canShowTooltip;
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[nuiTooltip]", ["nuiTooltip"], { "position": { "alias": "tooltipPlacement"; "required": false; }; "disabled": { "alias": "nuiTooltipDisabled"; "required": false; }; "ellipsis": { "alias": "nuiTooltipEllipsis"; "required": false; }; "message": { "alias": "nuiTooltip"; "required": false; }; }, {}, never, never, false, never>;
}