@ux-aspects/ux-aspects
Version:
Open source user interface framework for building modern, responsive, mobile big data applications
48 lines (47 loc) • 2.73 kB
TypeScript
import { ChangeDetectorRef, OnDestroy, TemplateRef } from '@angular/core';
import { Subject } from 'rxjs';
import { AnchorAlignment, AnchorPlacement } from '../../common/overlay/index';
import * as i0 from "@angular/core";
export declare class TooltipComponent<T = any> implements OnDestroy {
protected readonly _changeDetectorRef: ChangeDetectorRef;
/** Define a unique id for each tooltip */
id: string;
/** Define the tooltip role */
role: string;
/** The content of the tooltip, either a string or a TemplateRef for further customization */
content: string | TemplateRef<T>;
/** Allow the user to supply a context for the tooltip TemplateRef */
context: T;
/** The position the tooltip should display relative to the associated element */
placement: AnchorPlacement;
/** The position the callout should display relative to the popover element */
alignment: AnchorAlignment;
/** Allow a custom class to be added to the tooltip to allow custom styling */
customClass: string;
/** Emit when the tooltip need to update it's position */
reposition$: Subject<void>;
/** Indicates whether or not the content is a string or a TemplateRef */
get isTemplateRef(): boolean;
/** The name of the css class to use for the tooltip direction */
_positionClass: string;
get positionClass(): string;
set positionClass(positionClass: string);
/** Cleanup after the component is destroyed */
ngOnDestroy(): void;
/** Inform the parent directive that it needs to recalulate the position */
reposition(): void;
/** This will update the content of the tooltip and trigger change detection */
setContent(content: string | TemplateRef<any>): void;
/** This will update the tooltip placement and trigger change detection */
setPlacement(placement: AnchorPlacement): void;
/** This will update the tooltip alignment and trigger change detection */
setAlignment(alignment: AnchorAlignment): void;
/** This will set a custom class on the tooltip and trigger change detection */
setClass(customClass: string): void;
/** Updates the context used by the TemplateRef */
setContext(context: T): void;
/** Specify the tooltip role attribute */
setRole(role: string): void;
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent<any>, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent<any>, "ux-tooltip", never, { "content": { "alias": "content"; "required": false; }; "context": { "alias": "context"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "alignment": { "alias": "alignment"; "required": false; }; }, {}, never, never, false, never>;
}