UNPKG

primeng

Version:

PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,

251 lines (247 loc) 10.6 kB
import * as _angular_core from '@angular/core'; import { TemplateRef } from '@angular/core'; import { TooltipOptions } from 'primeng/api'; import { BaseComponent } from 'primeng/basecomponent'; import { ConnectedOverlayScrollHandler } from 'primeng/dom'; import { AppendTo } from 'primeng/types/shared'; import { Nullable } from 'primeng/ts-helpers'; import { BaseStyle } from 'primeng/base'; import { TooltipPassThroughOptions, TooltipPosition, TooltipEvent, TooltipPassThrough } from 'primeng/types/tooltip'; import * as i1 from 'primeng/bind'; /** * * Tooltip directive provides advisory information for a component. * * [Live Demo](https://www.primeng.org/tooltip) * * @module tooltipstyle * */ declare enum TooltipClasses { /** * Class name of the root element */ root = "p-tooltip", /** * Class name of the arrow element */ arrow = "p-tooltip-arrow", /** * Class name of the text element */ text = "p-tooltip-text" } declare class TooltipStyle extends BaseStyle { name: string; style: string; classes: { root: string; arrow: string; text: string; }; static ɵfac: _angular_core.ɵɵFactoryDeclaration<TooltipStyle, never>; static ɵprov: _angular_core.ɵɵInjectableDeclaration<TooltipStyle>; } interface TooltipStyle extends BaseStyle { } /** * Tooltip directive provides advisory information for a component. * @group Components */ declare class Tooltip extends BaseComponent<TooltipPassThroughOptions> { componentName: string; $pcTooltip: Tooltip | undefined; /** * Position of the tooltip. * @group Props */ tooltipPosition: _angular_core.InputSignal<TooltipPosition | undefined>; /** * Event to show the tooltip. * @group Props */ tooltipEvent: _angular_core.InputSignal<TooltipEvent>; /** * Type of CSS position. * @group Props */ positionStyle: _angular_core.InputSignal<string | undefined>; /** * Style class of the tooltip. * @group Props */ tooltipStyleClass: _angular_core.InputSignal<string | undefined>; /** * Whether the z-index should be managed automatically to always go on top or have a fixed value. * @group Props */ tooltipZIndex: _angular_core.InputSignal<string | undefined>; /** * By default the tooltip contents are rendered as text. Set to false to support html tags in the content. * @group Props */ escape: _angular_core.InputSignalWithTransform<boolean, unknown>; /** * Delay to show the tooltip in milliseconds. * @group Props */ showDelay: _angular_core.InputSignalWithTransform<number | undefined, unknown>; /** * Delay to hide the tooltip in milliseconds. * @group Props */ hideDelay: _angular_core.InputSignalWithTransform<number | undefined, unknown>; /** * Time to wait in milliseconds to hide the tooltip even it is active. * @group Props */ life: _angular_core.InputSignalWithTransform<number | undefined, unknown>; /** * Specifies the additional vertical offset of the tooltip from its default position. * @group Props */ positionTop: _angular_core.InputSignalWithTransform<number | undefined, unknown>; /** * Specifies the additional horizontal offset of the tooltip from its default position. * @group Props */ positionLeft: _angular_core.InputSignalWithTransform<number | undefined, unknown>; /** * Whether to hide tooltip when hovering over tooltip content. * @group Props */ autoHide: _angular_core.InputSignalWithTransform<boolean, unknown>; /** * Automatically adjusts the element position when there is not enough space on the selected position. * @group Props */ fitContent: _angular_core.InputSignalWithTransform<boolean, unknown>; /** * Whether to hide tooltip on escape key press. * @group Props */ hideOnEscape: _angular_core.InputSignalWithTransform<boolean, unknown>; /** * Whether to show the tooltip only when the target text overflows (e.g., ellipsis is active). * @group Props */ showOnEllipsis: _angular_core.InputSignalWithTransform<boolean, unknown>; /** * Content of the tooltip. * @group Props */ content: _angular_core.InputSignal<string | TemplateRef<HTMLElement> | undefined>; /** * When present, it specifies that the component should be disabled. * @defaultValue false * @group Props */ tooltipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>; /** * Specifies the tooltip configuration options for the component. * @group Props */ tooltipOptions: _angular_core.InputSignal<TooltipOptions | undefined>; /** * Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). * @defaultValue 'self' * @group Props */ appendTo: _angular_core.InputSignal<AppendTo>; $appendTo: _angular_core.Signal<AppendTo>; private readonly tooltipId; /** * Computed tooltip options that merges individual props with tooltipOptions. * Priority: tooltipOptions > individual props (with inline defaults) */ _tooltipOptions: _angular_core.Signal<TooltipOptions>; container: HTMLDivElement | null; styleClass: string | undefined; tooltipText: HTMLDivElement | null; rootPTClasses: string; showTimeout: ReturnType<typeof setTimeout> | null; hideTimeout: ReturnType<typeof setTimeout> | null; active: boolean | undefined; mouseEnterListener: Nullable<Function>; mouseLeaveListener: Nullable<Function>; containerMouseleaveListener: Nullable<Function>; clickListener: Nullable<Function>; focusListener: Nullable<Function>; blurListener: Nullable<Function>; touchStartListener: Nullable<Function>; touchEndListener: Nullable<Function>; documentTouchListener: Nullable<Function>; documentEscapeListener: Nullable<Function>; scrollHandler: ConnectedOverlayScrollHandler | null; resizeListener: ((event: Event) => void) | null; _componentStyle: TooltipStyle; /** * Used to pass attributes to DOM elements inside the Tooltip component. * @defaultValue undefined * @group Props */ pTooltipPT: _angular_core.InputSignal<TooltipPassThrough>; /** * Indicates whether the component should be rendered without styles. * @defaultValue undefined * @group Props */ pTooltipUnstyled: _angular_core.InputSignal<boolean | undefined>; private viewContainer; constructor(); onAfterViewInit(): void; isAutoHide(): boolean; onMouseEnter(e: Event): void; onMouseLeave(e: MouseEvent): void; onTouchStart(e: TouchEvent): void; onTouchEnd(e: TouchEvent): void; bindDocumentTouchListener(): void; unbindDocumentTouchListener(): void; onFocus(e: Event): void; onBlur(e: Event): void; onInputClick(e: Event): void; hasEllipsis(): boolean; activate(): void; deactivate(): void; create(): void; bindContainerMouseleaveListener(): void; unbindContainerMouseleaveListener(): void; show(): void; hide(): void; updateText(): void; align(): void; getHostOffset(): { left: any; top: any; }; private get activeElement(); alignRight(): void; alignLeft(): void; alignTop(): void; getArrowElement(): HTMLElement | null; alignBottom(): void; alignTooltip(offsetLeft: number, offsetTop: number): void; getOption(option: string): any; getTarget(el: Element): Element | null; preAlign(position: string): void; isOutOfBounds(): boolean; onWindowResize(e: Event): void; bindDocumentResizeListener(): void; unbindDocumentResizeListener(): void; bindScrollListener(): void; unbindScrollListener(): void; unbindEvents(): void; remove(): void; clearShowTimeout(): void; clearHideTimeout(): void; clearTimeouts(): void; onDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration<Tooltip, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Tooltip, "[pTooltip]", never, { "tooltipPosition": { "alias": "tooltipPosition"; "required": false; "isSignal": true; }; "tooltipEvent": { "alias": "tooltipEvent"; "required": false; "isSignal": true; }; "positionStyle": { "alias": "positionStyle"; "required": false; "isSignal": true; }; "tooltipStyleClass": { "alias": "tooltipStyleClass"; "required": false; "isSignal": true; }; "tooltipZIndex": { "alias": "tooltipZIndex"; "required": false; "isSignal": true; }; "escape": { "alias": "escape"; "required": false; "isSignal": true; }; "showDelay": { "alias": "showDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "hideDelay"; "required": false; "isSignal": true; }; "life": { "alias": "life"; "required": false; "isSignal": true; }; "positionTop": { "alias": "positionTop"; "required": false; "isSignal": true; }; "positionLeft": { "alias": "positionLeft"; "required": false; "isSignal": true; }; "autoHide": { "alias": "autoHide"; "required": false; "isSignal": true; }; "fitContent": { "alias": "fitContent"; "required": false; "isSignal": true; }; "hideOnEscape": { "alias": "hideOnEscape"; "required": false; "isSignal": true; }; "showOnEllipsis": { "alias": "showOnEllipsis"; "required": false; "isSignal": true; }; "content": { "alias": "pTooltip"; "required": false; "isSignal": true; }; "tooltipDisabled": { "alias": "tooltipDisabled"; "required": false; "isSignal": true; }; "tooltipOptions": { "alias": "tooltipOptions"; "required": false; "isSignal": true; }; "appendTo": { "alias": "appendTo"; "required": false; "isSignal": true; }; "pTooltipPT": { "alias": "pTooltipPT"; "required": false; "isSignal": true; }; "pTooltipUnstyled": { "alias": "pTooltipUnstyled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class TooltipModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration<TooltipModule, never>; static ɵmod: _angular_core.ɵɵNgModuleDeclaration<TooltipModule, never, [typeof Tooltip, typeof i1.BindModule], [typeof Tooltip, typeof i1.BindModule]>; static ɵinj: _angular_core.ɵɵInjectorDeclaration<TooltipModule>; } export { Tooltip, TooltipClasses, TooltipModule, TooltipStyle };