@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
147 lines (146 loc) • 4.66 kB
TypeScript
import { ElementRef, Injector, NgZone, OnDestroy, OnInit } from '@angular/core';
import { CoreBaseComponent } from '../common/base.component';
import { TooltipHost } from './models/tooltip-host';
import { TooltipOptions } from './models/tooltip-options';
import * as i0 from "@angular/core";
export interface TooltipMousePosition {
x: number;
y: number;
}
/**
* Tooltip host component provides a host for tooltips.
*/
export declare class TooltipHostComponent extends CoreBaseComponent implements OnInit, OnDestroy, TooltipHost {
private zone;
/**
* The source name to use for logging
*/
protected get logSourceName(): string;
private static readonly SCREEN_EDGE_MARGIN;
/**
* The element that contains and positions the tooltip
*/
tooltipContainer: ElementRef;
/**
* The element that is used to point to the target of the tooltip
*/
tooltipPointer: ElementRef;
/**
* The current tooltip options
*/
options: TooltipOptions;
/**
* Internal placeholder for the current focused state
*/
private focused;
/**
* Internal placeholder for the current hovered state
*/
private hovered;
/**
* container for host specific data being passed to the tooltip template context
*/
hostData: any;
/**
* The current mouse position relative to this hosting element
*/
mousePosition: TooltipMousePosition;
/**
* Mouse move listener event
*/
private onMouseMoveListener;
/**
* indicates that the tooltip has focus
*/
get isFocused(): boolean;
/**
* indicates that the tooltip is hovered
*/
get isHovered(): boolean;
/**
* Gets the role that this tooltip is playing. If the tooltip is text only,
* then it is treated as a dialog.
* otherwise it is treated as a tooltip
*/
get ariaRole(): "alertdialog" | "tooltip";
/**
* Gets the aria modal attribute value
*/
get ariaModal(): boolean;
/**
* Indicates if the tooltip content outside the aria-live region will be shown
*/
get showNonAriaLiveContent(): boolean;
/**
* Indicates if the tooltip content inside the aria-live region will be shown
*/
get showAriaLiveContent(): boolean;
/**
* Initializes a new instance of the @see TooltipHostComponent class.
* @param injector The angular injection service. required by @SmeInjectableBase() decorator in the base @see BaseComponent class
*/
constructor(injector: Injector, zone: NgZone);
ngOnInit(): void;
ngOnDestroy(): void;
/**
* Occurs when the tooltip container is focused or unfocused
* @param event the focusin or focusout event
*/
onFocusChanged(event: Event): void;
/**
* Occurs when the tooltip container is hovered or un-hovered
* @param event the mouseenter or mouseleave event
*/
onHoverChanged(event: Event): void;
/**
* Window resize listener
*/
onWindowResized(event: Event): void;
/**
* Escape key listener
*/
onEscape(event: Event): void;
/**
* Mouse movement listener
* We do not use HostListener here to avoid invoking change detection for all mousemove events.
*/
private onMouseMove;
/**
* Escape key listener
*/
onClick(event: PointerEvent): void;
/**
* Show a tooltip with the given options
*/
show(options: TooltipOptions): void;
/**
* Updates the active tooltip with new options
* @param id the tooltip id
*/
update(options: TooltipOptions): void;
/**
* Hides the tooltip with the given id
* @param id the tooltip id
*/
isShown(id: string): boolean;
/**
* Hides the tooltip with the given id
* @param id the tooltip id
*/
hide(id: string): void;
/**
* Repositions the tooltip
*/
private reposition;
/**
* Creates the idBag used by this component to store unique element ids.
* id values will be assigned be the @see BaseComponent super class.
*/
protected createIdBag(): MsftSme.StringMap<string>;
/**
* Gets the initial host classes to be applied to this element
*/
protected getInitialHostClasses(): string[];
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipHostComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<TooltipHostComponent, "sme-tooltip-host", never, {}, {}, never, never, false, never>;
}