UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

253 lines • 9.51 kB
import * as i0 from "@angular/core"; import { AfterViewInit, ChangeDetectorRef, DestroyRef, ElementRef, EventEmitter, OnChanges, Renderer2, SimpleChanges, TemplateRef, Type, ViewContainerRef } from "@angular/core"; import { NzPresetColor } from "ng-zorro-antd/core/color"; import { NgClassInterface, NgStyleInterface, NzSafeAny, NzTSType } from "ng-zorro-antd/core/types"; import { CdkConnectedOverlay, ConnectedOverlayPositionChange, ConnectionPositionPair } from "@angular/cdk/overlay"; import { Subject } from "rxjs"; import { NzNoAnimationDirective } from "ng-zorro-antd/core/animation"; import { NzConfigService, PopConfirmConfig, PopoverConfig } from "ng-zorro-antd/core/config"; import { POSITION_TYPE } from "ng-zorro-antd/core/overlay"; export interface PropertyMapping { [key: string]: [string, () => unknown]; } export type NzTooltipTrigger = 'click' | 'focus' | 'hover' | null; export declare abstract class NzTooltipBaseDirective implements AfterViewInit, OnChanges { protected componentType: Type<NzTooltipBaseComponent>; readonly elementRef: ElementRef<any>; protected readonly hostView: ViewContainerRef; protected readonly renderer: Renderer2; protected readonly noAnimation: NzNoAnimationDirective | null; protected readonly nzConfigService: NzConfigService; protected readonly destroyRef: DestroyRef; protected readonly platformId: Object; config?: Required<PopoverConfig | PopConfirmConfig>; abstract arrowPointAtCenter?: boolean; abstract directiveTitle?: NzTSType | null; abstract directiveContent?: NzTSType | null; abstract title?: NzTSType | null; abstract content?: NzTSType | null; abstract trigger?: NzTooltipTrigger; abstract placement?: string | string[]; abstract origin?: ElementRef<HTMLElement>; abstract visible?: boolean; abstract mouseEnterDelay?: number; abstract mouseLeaveDelay?: number; abstract overlayClassName?: string; abstract overlayStyle?: NgStyleInterface; abstract overlayClickable?: boolean; visibleChange: EventEmitter<boolean>; /** * This true title that would be used in other parts on this component. */ protected get _title(): NzTSType | null; protected get _content(): NzTSType | null; protected get _trigger(): NzTooltipTrigger; protected get _placement(): string[]; protected get _visible(): boolean; protected get _mouseEnterDelay(): number; protected get _mouseLeaveDelay(): number; protected get _overlayClassName(): string | null; protected get _overlayStyle(): NgStyleInterface | null; protected get _overlayClickable(): boolean; private internalVisible; protected getProxyPropertyMap(): PropertyMapping; component?: NzTooltipBaseComponent; protected readonly destroy$: Subject<void>; protected readonly triggerDisposables: VoidFunction[]; private delayTimer?; /** * Whether the pending {@link delayTimer} will open (rather than close) the overlay. */ private delayTimerOpens; /** * Timer used to update the value of {@link isTouchTriggered}. */ private touchResetTimer?; /** * Tracks whether the most recent pointer interaction was a touch. */ private isTouchTriggered; constructor(componentType: Type<NzTooltipBaseComponent>); ngAfterViewInit(): void; ngOnChanges(changes: SimpleChanges): void; show(): void; hide(): void; /** * Force the component to update its position. */ updatePosition(): void; /** * Create a dynamic tooltip component. This method can be overridden. */ protected createComponent(): void; protected registerTriggers(): void; private updatePropertiesByChanges; private updatePropertiesByKeys; private initProperties; private updateComponentValue; private delayEnterLeave; private removeTriggerListeners; private clearTogglingTimer; private clearTouchResetTimer; /** * Cancels a scheduled show, but leaves a scheduled hide untouched. */ private cancelPendingOpenTimer; static ɵfac: i0.ɵɵFactoryDeclaration<NzTooltipBaseDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<NzTooltipBaseDirective, never, never, {}, {}, never, never, true, never>; } export declare abstract class NzTooltipBaseComponent { protected readonly noAnimation: NzNoAnimationDirective | null; protected readonly dir: import("@angular/core").WritableSignal<import("@angular/cdk/bidi").Direction>; protected readonly cdr: ChangeDetectorRef; protected readonly elementRef: ElementRef<any>; protected readonly destroyRef: DestroyRef; overlay: CdkConnectedOverlay; nzTitle: NzTSType | null; nzContent: NzTSType | null; nzArrowPointAtCenter: boolean; nzOverlayClassName: string; nzOverlayStyle: NgStyleInterface; nzOverlayClickable: boolean; nzBackdrop: boolean; nzMouseEnterDelay?: number; nzMouseLeaveDelay?: number; nzVisibleChange: Subject<boolean>; set nzVisible(value: boolean); get nzVisible(): boolean; _visible: boolean; set nzTrigger(value: NzTooltipTrigger); get nzTrigger(): NzTooltipTrigger; protected _trigger: NzTooltipTrigger; set nzPlacement(value: POSITION_TYPE[]); preferredPlacement: string; origin: ElementRef<NzSafeAny>; _classMap: NgClassInterface; _prefix: string; _positions: ConnectionPositionPair[]; constructor(); show(): void; hide(): void; updateByDirective(): void; /** * Force the component to update its position. */ updatePosition(): void; onPositionChange(position: ConnectedOverlayPositionChange): void; setOverlayOrigin(origin: ElementRef<HTMLElement>): void; onClickOutside(event: MouseEvent): void; /** * Hide the component while the content is empty. */ private updateVisibilityByTitle; protected updateStyles(): void; protected transformClassListToMap(klass: string): Record<string, boolean>; /** * Empty component cannot be opened. */ protected abstract isEmpty(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<NzTooltipBaseComponent, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<NzTooltipBaseComponent, never, never, {}, {}, never, never, true, never>; } export declare function isTooltipEmpty(value: string | TemplateRef<void> | null): boolean; declare namespace tooltip_d_exports { export { NzTooltipComponent, NzTooltipDirective }; } export declare class NzTooltipDirective extends NzTooltipBaseDirective { title?: NzTSType | null; titleContext?: object | null; directiveTitle?: NzTSType | null; trigger?: NzTooltipTrigger; placement?: string | string[]; origin?: ElementRef<HTMLElement>; visible?: boolean; mouseEnterDelay?: number; mouseLeaveDelay?: number; overlayClassName?: string; overlayStyle?: NgStyleInterface; arrowPointAtCenter?: boolean; nzTooltipColor?: string; directiveContent?: NzTSType | null; content?: NzTSType | null; overlayClickable?: boolean; readonly visibleChange: EventEmitter<boolean>; constructor(); protected getProxyPropertyMap(): PropertyMapping; static ɵfac: i0.ɵɵFactoryDeclaration<NzTooltipDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<NzTooltipDirective, "[nz-tooltip]", ["nzTooltip"], { "title": { "alias": "nzTooltipTitle"; "required": false; }; "titleContext": { "alias": "nzTooltipTitleContext"; "required": false; }; "directiveTitle": { "alias": "nz-tooltip"; "required": false; }; "trigger": { "alias": "nzTooltipTrigger"; "required": false; }; "placement": { "alias": "nzTooltipPlacement"; "required": false; }; "origin": { "alias": "nzTooltipOrigin"; "required": false; }; "visible": { "alias": "nzTooltipVisible"; "required": false; }; "mouseEnterDelay": { "alias": "nzTooltipMouseEnterDelay"; "required": false; }; "mouseLeaveDelay": { "alias": "nzTooltipMouseLeaveDelay"; "required": false; }; "overlayClassName": { "alias": "nzTooltipOverlayClassName"; "required": false; }; "overlayStyle": { "alias": "nzTooltipOverlayStyle"; "required": false; }; "arrowPointAtCenter": { "alias": "nzTooltipArrowPointAtCenter"; "required": false; }; "nzTooltipColor": { "alias": "nzTooltipColor"; "required": false; }; }, { "visibleChange": "nzTooltipVisibleChange"; }, never, never, true, never>; static ngAcceptInputType_arrowPointAtCenter: unknown; } export declare class NzTooltipComponent extends NzTooltipBaseComponent { protected _animationPrefix: string; nzTitle: NzTSType | null; nzTitleContext: object | null; nzColor?: string | NzPresetColor; protected _arrowStyleMap: NgStyleInterface; protected _contentStyleMap: NgStyleInterface; protected readonly zoomAnimationEnter: import("@angular/core").Signal<string>; protected readonly zoomAnimationLeave: import("@angular/core").Signal<string>; protected isEmpty(): boolean; protected updateStyles(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NzTooltipComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NzTooltipComponent, "nz-tooltip", ["nzTooltipComponent"], {}, {}, never, never, true, never>; } export declare class NzTooltipModule { static ɵfac: i0.ɵɵFactoryDeclaration<NzTooltipModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<NzTooltipModule, never, [typeof NzTooltipComponent, typeof NzTooltipDirective], [typeof NzTooltipComponent, typeof NzTooltipDirective]>; static ɵinj: i0.ɵɵInjectorDeclaration<NzTooltipModule>; }