UNPKG

6.38 kBTypeScriptView Raw
1import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
2import * as i0 from "@angular/core";
3export declare class NgbTooltipWindow {
4 animation: boolean;
5 id: string;
6 tooltipClass: string;
7 static ɵfac: i0.ɵɵFactoryDeclaration<NgbTooltipWindow, never>;
8 static ɵcmp: i0.ɵɵComponentDeclaration<NgbTooltipWindow, "ngb-tooltip-window", never, { "animation": { "alias": "animation"; "required": false; }; "id": { "alias": "id"; "required": false; }; "tooltipClass": { "alias": "tooltipClass"; "required": false; }; }, {}, never, ["*"], true, never>;
9}
10/**
11 * A lightweight and extensible directive for fancy tooltip creation.
12 */
13export declare class NgbTooltip implements OnInit, OnDestroy, OnChanges {
14 static ngAcceptInputType_autoClose: boolean | string;
15 private _config;
16 /**
17 * If `true`, tooltip opening and closing will be animated.
18 *
19 * @since 8.0.0
20 */
21 animation: boolean;
22 /**
23 * Indicates whether the tooltip should be closed on `Escape` key and inside/outside clicks:
24 *
25 * * `true` - closes on both outside and inside clicks as well as `Escape` presses
26 * * `false` - disables the autoClose feature (NB: triggers still apply)
27 * * `"inside"` - closes on inside clicks as well as Escape presses
28 * * `"outside"` - closes on outside clicks (sometimes also achievable through triggers)
29 * as well as `Escape` presses
30 *
31 * @since 3.0.0
32 */
33 autoClose: boolean | "inside" | "outside";
34 /**
35 * The preferred placement of the tooltip, among the [possible values](#/guides/positioning#api).
36 *
37 * The default order of preference is `"auto"`.
38 *
39 * Please see the [positioning overview](#/positioning) for more details.
40 */
41 placement: import("../util/positioning").PlacementArray;
42 /**
43 * Allows to change default Popper options when positioning the tooltip.
44 * Receives current popper options and returns modified ones.
45 *
46 * @since 13.1.0
47 */
48 popperOptions: (options: Partial<import("@popperjs/core").Options>) => Partial<import("@popperjs/core").Options>;
49 /**
50 * Specifies events that should trigger the tooltip.
51 *
52 * Supports a space separated list of event names.
53 * For more details see the [triggers demo](#/components/tooltip/examples#triggers).
54 */
55 triggers: string;
56 /**
57 * A css selector or html element specifying the element the tooltip should be positioned against.
58 * By default, the element `ngbTooltip` directive is applied to will be set as a target.
59 *
60 * @since 13.1.0
61 */
62 positionTarget?: string | HTMLElement;
63 /**
64 * A selector specifying the element the tooltip should be appended to.
65 *
66 * Currently only supports `"body"`.
67 */
68 container: string;
69 /**
70 * If `true`, tooltip is disabled and won't be displayed.
71 *
72 * @since 1.1.0
73 */
74 disableTooltip: boolean;
75 /**
76 * An optional class applied to the tooltip window element.
77 *
78 * @since 3.2.0
79 */
80 tooltipClass: string;
81 /**
82 * Default template context for `TemplateRef`, can be overridden with `open` method.
83 *
84 * @since 15.1.0
85 */
86 tooltipContext: any;
87 /**
88 * The opening delay in ms. Works only for "non-manual" opening triggers defined by the `triggers` input.
89 *
90 * @since 4.1.0
91 */
92 openDelay: number;
93 /**
94 * The closing delay in ms. Works only for "non-manual" opening triggers defined by the `triggers` input.
95 *
96 * @since 4.1.0
97 */
98 closeDelay: number;
99 /**
100 * An event emitted when the tooltip opening animation has finished. Contains no payload.
101 */
102 shown: EventEmitter<any>;
103 /**
104 * An event emitted when the tooltip closing animation has finished. Contains no payload.
105 */
106 hidden: EventEmitter<any>;
107 private _nativeElement;
108 private _ngZone;
109 private _document;
110 private _changeDetector;
111 private _injector;
112 private _ngbTooltip;
113 private _ngbTooltipWindowId;
114 private _popupService;
115 private _windowRef;
116 private _unregisterListenersFn;
117 private _positioning;
118 private _afterRenderRef;
119 /**
120 * The string content or a `TemplateRef` for the content to be displayed in the tooltip.
121 *
122 * If the content if falsy, the tooltip won't open.
123 */
124 set ngbTooltip(value: string | TemplateRef<any> | null | undefined);
125 get ngbTooltip(): string | TemplateRef<any> | null | undefined;
126 /**
127 * Opens the tooltip.
128 *
129 * This is considered to be a "manual" triggering.
130 * The `context` is an optional value to be injected into the tooltip template when it is created.
131 */
132 open(context?: any): void;
133 /**
134 * Closes the tooltip.
135 *
136 * This is considered to be a "manual" triggering of the tooltip.
137 */
138 close(animation?: boolean): void;
139 /**
140 * Toggles the tooltip.
141 *
142 * This is considered to be a "manual" triggering of the tooltip.
143 */
144 toggle(): void;
145 /**
146 * Returns `true`, if the popover is currently shown.
147 */
148 isOpen(): boolean;
149 ngOnInit(): void;
150 ngOnChanges({ tooltipClass }: SimpleChanges): void;
151 ngOnDestroy(): void;
152 private _getPositionTargetElement;
153 static ɵfac: i0.ɵɵFactoryDeclaration<NgbTooltip, never>;
154 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbTooltip, "[ngbTooltip]", ["ngbTooltip"], { "animation": { "alias": "animation"; "required": false; }; "autoClose": { "alias": "autoClose"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "popperOptions": { "alias": "popperOptions"; "required": false; }; "triggers": { "alias": "triggers"; "required": false; }; "positionTarget": { "alias": "positionTarget"; "required": false; }; "container": { "alias": "container"; "required": false; }; "disableTooltip": { "alias": "disableTooltip"; "required": false; }; "tooltipClass": { "alias": "tooltipClass"; "required": false; }; "tooltipContext": { "alias": "tooltipContext"; "required": false; }; "openDelay": { "alias": "openDelay"; "required": false; }; "closeDelay": { "alias": "closeDelay"; "required": false; }; "ngbTooltip": { "alias": "ngbTooltip"; "required": false; }; }, { "shown": "shown"; "hidden": "hidden"; }, never, never, true, never>;
155}