@progress/kendo-angular-tooltip 4.1.1 → 11.0.0-develop.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +4 -4
  3. package/README.md +4 -4
  4. package/constants.d.ts +1 -1
  5. package/{esm2015/constants.js → esm2020/constants.mjs} +1 -1
  6. package/{esm2015/main.js → esm2020/index.mjs} +1 -1
  7. package/{esm2015/localization/localized-messages.directive.js → esm2020/localization/localized-messages.directive.mjs} +5 -5
  8. package/{esm2015/models/animation.model.js → esm2020/models/animation.model.mjs} +1 -1
  9. package/{esm2015/models/events.js → esm2020/models/events.mjs} +1 -1
  10. package/{esm2015/models/popover-show-option.type.js → esm2020/models/functions.model.mjs} +1 -1
  11. package/{esm2015/models/position.type.js → esm2020/models/popover-show-option.type.mjs} +1 -1
  12. package/{esm2015/models/functions.model.js → esm2020/models/position.type.mjs} +1 -1
  13. package/esm2020/models/show.option.type.mjs +5 -0
  14. package/{esm2015/package-metadata.js → esm2020/package-metadata.mjs} +3 -3
  15. package/{esm2015/popover/anchor.directive.js → esm2020/popover/anchor.directive.mjs} +7 -6
  16. package/{esm2015/popover/container.directive.js → esm2020/popover/container.directive.mjs} +7 -6
  17. package/{esm2015/popover/directives-base.js → esm2020/popover/directives-base.mjs} +7 -5
  18. package/{esm2015/popover/popover.component.js → esm2020/popover/popover.component.mjs} +4 -4
  19. package/{esm2015/popover/popover.service.js → esm2020/popover/popover.service.mjs} +5 -5
  20. package/{esm2015/popover/template-directives/actions-template.directive.js → esm2020/popover/template-directives/actions-template.directive.mjs} +5 -5
  21. package/{esm2015/popover/template-directives/body-template.directive.js → esm2020/popover/template-directives/body-template.directive.mjs} +5 -5
  22. package/{esm2015/popover/template-directives/title-template.directive.js → esm2020/popover/template-directives/title-template.directive.mjs} +5 -5
  23. package/{esm2015/popover.module.js → esm2020/popover.module.mjs} +5 -5
  24. package/{esm2015/kendo-angular-tooltip.js → esm2020/progress-kendo-angular-tooltip.mjs} +2 -2
  25. package/{esm2015/tooltip/tooltip.content.component.js → esm2020/tooltip/tooltip.content.component.mjs} +26 -10
  26. package/{esm2015/tooltip/tooltip.directive.js → esm2020/tooltip/tooltip.directive.mjs} +9 -8
  27. package/{esm2015/tooltip/tooltip.settings.js → esm2020/tooltip/tooltip.settings.mjs} +5 -4
  28. package/{esm2015/tooltip.module.js → esm2020/tooltip.module.mjs} +7 -6
  29. package/{esm2015/tooltips.module.js → esm2020/tooltips.module.mjs} +5 -5
  30. package/{esm2015/utils.js → esm2020/utils.mjs} +1 -1
  31. package/fesm2015/progress-kendo-angular-tooltip.mjs +2145 -0
  32. package/{fesm2015/kendo-angular-tooltip.js → fesm2020/progress-kendo-angular-tooltip.mjs} +82 -63
  33. package/{main.d.ts → index.d.ts} +1 -1
  34. package/localization/localized-messages.directive.d.ts +1 -1
  35. package/models/animation.model.d.ts +1 -1
  36. package/models/events.d.ts +1 -1
  37. package/models/functions.model.d.ts +1 -1
  38. package/models/popover-show-option.type.d.ts +1 -1
  39. package/models/position.type.d.ts +1 -1
  40. package/models/show.option.type.d.ts +1 -1
  41. package/package-metadata.d.ts +1 -1
  42. package/package.json +29 -54
  43. package/popover/anchor.directive.d.ts +1 -1
  44. package/popover/container.directive.d.ts +1 -1
  45. package/popover/directives-base.d.ts +1 -1
  46. package/popover/popover.component.d.ts +1 -1
  47. package/popover/popover.service.d.ts +1 -1
  48. package/popover/template-directives/actions-template.directive.d.ts +1 -1
  49. package/popover/template-directives/body-template.directive.d.ts +1 -1
  50. package/popover/template-directives/title-template.directive.d.ts +1 -1
  51. package/popover.module.d.ts +1 -1
  52. package/{kendo-angular-tooltip.d.ts → progress-kendo-angular-tooltip.d.ts} +2 -2
  53. package/schematics/ngAdd/index.js +5 -6
  54. package/tooltip/tooltip.content.component.d.ts +6 -1
  55. package/tooltip/tooltip.directive.d.ts +1 -1
  56. package/tooltip/tooltip.settings.d.ts +1 -1
  57. package/tooltip.module.d.ts +3 -2
  58. package/tooltips.module.d.ts +1 -1
  59. package/utils.d.ts +1 -1
  60. package/bundles/kendo-angular-tooltip.umd.js +0 -5
  61. package/esm2015/models/show.option.type.js +0 -5
  62. package/schematics/ngAdd/index.js.map +0 -1
@@ -0,0 +1,2145 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as i0 from '@angular/core';
6
+ import { InjectionToken, Injectable, forwardRef, Directive, Input, EventEmitter, Component, HostBinding, Output, isDevMode, Optional, Inject, ContentChild, ElementRef, NgModule } from '@angular/core';
7
+ import { filter, take, auditTime } from 'rxjs/operators';
8
+ import { Subscription, fromEvent, BehaviorSubject, Subject, combineLatest } from 'rxjs';
9
+ import { validatePackage } from '@progress/kendo-licensing';
10
+ import * as i1 from '@progress/kendo-angular-l10n';
11
+ import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
12
+ import { xIcon } from '@progress/kendo-svg-icons';
13
+ import * as i2 from '@progress/kendo-angular-icons';
14
+ import { IconsModule } from '@progress/kendo-angular-icons';
15
+ import * as i2$1 from '@angular/common';
16
+ import { CommonModule } from '@angular/common';
17
+ import { isDocumentAvailable, Keys, PreventableEvent, closest, hasObservers } from '@progress/kendo-angular-common';
18
+ import * as i1$1 from '@progress/kendo-angular-popup';
19
+ import { PopupModule } from '@progress/kendo-angular-popup';
20
+
21
+ /**
22
+ * @hidden
23
+ */
24
+ const packageMetadata = {
25
+ name: '@progress/kendo-angular-tooltip',
26
+ productName: 'Kendo UI for Angular',
27
+ productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
28
+ publishDate: 1673510450,
29
+ version: '',
30
+ licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
31
+ };
32
+
33
+ /**
34
+ * Obsolete. Provide the TooltipSettings class instead.
35
+ *
36
+ * @hidden
37
+ */
38
+ const TOOLTIP_SETTINGS = new InjectionToken('kendo-ui-tooltip-settings');
39
+ /**
40
+ * Provides a global configuration for the Kendo UI Tooltip. Once injected through
41
+ * the `AppComponent` constructor, the configuration properties can be overridden.
42
+ *
43
+ * @example
44
+ * ```ts-no-run
45
+ * import { TooltipSettings } from '@progress/kendo-angular-tooltip';
46
+ *
47
+ * _@Component({
48
+ * selector: 'my-app',
49
+ * template: `
50
+ * <div kendoTooltip>
51
+ * <button title="Saves the current document">Save</button>
52
+ * </div>`,
53
+ * providers: [{
54
+ * provide: TooltipSettings,
55
+ * useFactory: (): TooltipSettings => ({
56
+ * // Override default values of tooltips if wanted
57
+ * position: 'right'
58
+ * })
59
+ * }]
60
+ * })
61
+ * export class AppComponent { }
62
+ * ```
63
+ */
64
+ class TooltipSettings {
65
+ /**
66
+ * @hidden
67
+ */
68
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
69
+ constructor() { }
70
+ }
71
+ TooltipSettings.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipSettings, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
72
+ TooltipSettings.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipSettings });
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipSettings, decorators: [{
74
+ type: Injectable
75
+ }], ctorParameters: function () { return []; } });
76
+
77
+ /**
78
+ * @hidden
79
+ */
80
+ let idx = 0;
81
+ /**
82
+ * @hidden
83
+ */
84
+ const getId = (prefix) => {
85
+ return `${prefix}-${++idx}`;
86
+ };
87
+ /**
88
+ * @hidden
89
+ */
90
+ function align(position, offset) {
91
+ let anchorAlign = {};
92
+ let popupAlign = {};
93
+ let popupMargin = {};
94
+ switch (position) {
95
+ case 'top':
96
+ anchorAlign = { horizontal: 'center', vertical: 'top' };
97
+ popupAlign = { horizontal: 'center', vertical: 'bottom' };
98
+ popupMargin = { horizontal: 0, vertical: offset };
99
+ break;
100
+ case 'bottom':
101
+ anchorAlign = { horizontal: 'center', vertical: 'bottom' };
102
+ popupAlign = { horizontal: 'center', vertical: 'top' };
103
+ popupMargin = { horizontal: 0, vertical: offset };
104
+ break;
105
+ case 'right':
106
+ anchorAlign = { horizontal: 'right', vertical: 'center' };
107
+ popupAlign = { horizontal: 'left', vertical: 'center' };
108
+ popupMargin = { horizontal: offset, vertical: 0 };
109
+ break;
110
+ case 'left':
111
+ anchorAlign = { horizontal: 'left', vertical: 'center' };
112
+ popupAlign = { horizontal: 'right', vertical: 'center' };
113
+ popupMargin = { horizontal: offset, vertical: 0 };
114
+ break;
115
+ default: break;
116
+ }
117
+ return {
118
+ anchorAlign,
119
+ popupAlign,
120
+ popupMargin
121
+ };
122
+ }
123
+ /**
124
+ * @hidden
125
+ */
126
+ function collision(inputcollision, position) {
127
+ if (inputcollision) {
128
+ return inputcollision;
129
+ }
130
+ if (position === 'top' || position === 'bottom') {
131
+ return { horizontal: 'fit', vertical: 'flip' };
132
+ }
133
+ return { horizontal: 'flip', vertical: 'fit' };
134
+ }
135
+ function isDocumentNode(container) {
136
+ return container.nodeType === 9;
137
+ }
138
+ /**
139
+ * @hidden
140
+ */
141
+ function closestBySelector(element, selector) {
142
+ if (element.closest) {
143
+ return element.closest(selector);
144
+ }
145
+ const matches = Element.prototype.matches ?
146
+ (el, sel) => el.matches(sel)
147
+ : (el, sel) => el.msMatchesSelector(sel);
148
+ let node = element;
149
+ while (node && !isDocumentNode(node)) {
150
+ if (matches(node, selector)) {
151
+ return node;
152
+ }
153
+ node = node.parentNode;
154
+ }
155
+ }
156
+ /**
157
+ * @hidden
158
+ */
159
+ function contains(container, child) {
160
+ if (!container) {
161
+ return false;
162
+ }
163
+ if (isDocumentNode(container)) {
164
+ return false;
165
+ }
166
+ if (container.contains) {
167
+ return container.contains(child);
168
+ }
169
+ if (container.compareDocumentPosition) {
170
+ return !!(container.compareDocumentPosition(child) & Node.DOCUMENT_POSITION_CONTAINED_BY);
171
+ }
172
+ }
173
+ /**
174
+ * @hidden
175
+ */
176
+ const hasParent = (node, parent) => {
177
+ while (node && node !== parent) {
178
+ node = node.parentNode;
179
+ }
180
+ return node;
181
+ };
182
+ /**
183
+ * @hidden
184
+ */
185
+ function getCenterOffset(item, dir, size) {
186
+ const rect = item.getBoundingClientRect();
187
+ return rect[dir] + (rect[size] / 2);
188
+ }
189
+ /**
190
+ * @hidden
191
+ */
192
+ function containsItem(collection, item) {
193
+ return collection.indexOf(item) !== -1;
194
+ }
195
+
196
+ /**
197
+ * @hidden
198
+ */
199
+ class LocalizedMessagesDirective extends ComponentMessages {
200
+ constructor(service) {
201
+ super();
202
+ this.service = service;
203
+ }
204
+ }
205
+ LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
206
+ LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: LocalizedMessagesDirective, selector: "[kendoTooltipLocalizedMessages]", inputs: { closeTitle: "closeTitle" }, providers: [
207
+ {
208
+ provide: ComponentMessages,
209
+ useExisting: forwardRef(() => LocalizedMessagesDirective)
210
+ }
211
+ ], usesInheritance: true, ngImport: i0 });
212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
213
+ type: Directive,
214
+ args: [{
215
+ providers: [
216
+ {
217
+ provide: ComponentMessages,
218
+ useExisting: forwardRef(() => LocalizedMessagesDirective)
219
+ }
220
+ ],
221
+ selector: `[kendoTooltipLocalizedMessages]`
222
+ }]
223
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { closeTitle: [{
224
+ type: Input
225
+ }] } });
226
+
227
+ /**
228
+ * @hidden
229
+ */
230
+ class TooltipContentComponent {
231
+ constructor(content, localizationService) {
232
+ this.content = content;
233
+ this.localizationService = localizationService;
234
+ /**
235
+ * @hidden
236
+ */
237
+ this.xIcon = xIcon;
238
+ this.close = new EventEmitter();
239
+ this.hostRole = 'tooltip';
240
+ this.tooltipWidth = null;
241
+ this.tooltipHeight = null;
242
+ this.callout = true;
243
+ this.calloutStyles = (position, calloutSize, isFlip) => {
244
+ const styles = {};
245
+ const isVertical = position === 'top' || position === 'bottom';
246
+ const flipDeg = '180deg';
247
+ const zeroDeg = '0deg';
248
+ if (!isFlip) {
249
+ styles.transform = isVertical ? `rotateX(${zeroDeg})` : `rotateY(${zeroDeg})`;
250
+ return styles;
251
+ }
252
+ if (position === 'top') {
253
+ styles.bottom = 'unset';
254
+ }
255
+ else if (position === 'bottom') {
256
+ styles.top = 'unset';
257
+ }
258
+ else if (position === 'left') {
259
+ styles.right = 'unset';
260
+ }
261
+ else if (position === 'right') {
262
+ styles.left = 'unset';
263
+ }
264
+ styles[position] = `${-calloutSize}px`;
265
+ styles.transform = isVertical ? `rotateX(${flipDeg})` : `rotateY(${flipDeg})`;
266
+ return styles;
267
+ };
268
+ this.direction = localizationService.rtl ? 'rtl' : 'ltr';
269
+ }
270
+ get cssClasses() {
271
+ return 'k-tooltip';
272
+ }
273
+ get hostId() {
274
+ return this.tooltipId;
275
+ }
276
+ get className() {
277
+ return this.closable;
278
+ }
279
+ get cssPosition() {
280
+ return 'relative';
281
+ }
282
+ ngOnInit() {
283
+ this.tooltipId = getId('tooltip');
284
+ this.dynamicRTLSubscription = this.localizationService.changes
285
+ .subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr');
286
+ }
287
+ ngOnDestroy() {
288
+ if (this.dynamicRTLSubscription) {
289
+ this.dynamicRTLSubscription.unsubscribe();
290
+ }
291
+ }
292
+ get closeButtonTitle() {
293
+ return this.closeTitle || this.localizationService.get('closeTitle');
294
+ }
295
+ calloutPositionClass() {
296
+ return {
297
+ 'top': 'k-callout-s',
298
+ 'left': 'k-callout-e',
299
+ 'bottom': 'k-callout-n',
300
+ 'right': 'k-callout-w'
301
+ }[this.position];
302
+ }
303
+ onCloseClick(event) {
304
+ event.preventDefault();
305
+ this.close.emit();
306
+ }
307
+ updateCalloutPosition(position, isFlip) {
308
+ if (!this.callout) {
309
+ return;
310
+ }
311
+ const callout = this.content.nativeElement.querySelector('.k-callout');
312
+ const isVertical = position === 'top' || position === 'bottom';
313
+ const size = isVertical ? 'width' : 'height';
314
+ const dir = isVertical ? 'left' : 'top';
315
+ const offsetProperty = isVertical ? 'marginLeft' : 'marginTop';
316
+ const calloutSize = callout.getBoundingClientRect()[size];
317
+ const anchorCenter = getCenterOffset(this.anchor.nativeElement, dir, size);
318
+ const contentCenter = getCenterOffset(this.content.nativeElement, dir, size);
319
+ const diff = Math.abs(contentCenter - anchorCenter);
320
+ if (diff > 1 || diff === 0 || Math.round(diff) === 0) {
321
+ const newMargin = contentCenter - anchorCenter + (calloutSize / 2);
322
+ callout.style[offsetProperty] = `${-newMargin}px`;
323
+ }
324
+ const calloutStyles = this.calloutStyles(position, calloutSize, isFlip);
325
+ Object.keys(calloutStyles).forEach((style) => {
326
+ callout.style[style] = calloutStyles[style];
327
+ });
328
+ }
329
+ }
330
+ TooltipContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipContentComponent, deps: [{ token: i0.ElementRef }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
331
+ TooltipContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TooltipContentComponent, selector: "kendo-tooltip", inputs: { tooltipWidth: "tooltipWidth", tooltipHeight: "tooltipHeight", titleTemplate: "titleTemplate", anchor: "anchor", closable: "closable", templateRef: "templateRef", templateString: "templateString" }, outputs: { close: "close" }, host: { properties: { "attr.dir": "this.direction", "class": "this.cssClasses", "attr.role": "this.hostRole", "attr.id": "this.hostId", "class.k-tooltip-closable": "this.className", "style.position": "this.cssPosition", "style.width.px": "this.tooltipWidth", "style.height.px": "this.tooltipHeight" } }, providers: [
332
+ LocalizationService,
333
+ {
334
+ provide: L10N_PREFIX,
335
+ useValue: 'kendo.tooltip'
336
+ }
337
+ ], ngImport: i0, template: `
338
+ <ng-container kendoTooltipLocalizedMessages
339
+ i18n-closeTitle="kendo.tooltip.closeTitle|The title of the close button"
340
+ closeTitle="Close"
341
+ >
342
+ </ng-container>
343
+
344
+ <div class="k-tooltip-content">
345
+ <div class="k-tooltip-title" *ngIf="titleTemplate">
346
+ <ng-template
347
+ [ngIf]="titleTemplate"
348
+ [ngTemplateOutlet]="titleTemplate"
349
+ [ngTemplateOutletContext]="{ $implicit: anchor, anchor: anchor }">
350
+ </ng-template>
351
+ </div>
352
+
353
+ <ng-template
354
+ [ngIf]="templateRef"
355
+ [ngTemplateOutlet]="templateRef"
356
+ [ngTemplateOutletContext]="{ $implicit: anchor, anchor: anchor }">
357
+ </ng-template>
358
+ <ng-template
359
+ [ngIf]="templateString">
360
+ {{ templateString }}
361
+ </ng-template>
362
+ </div>
363
+
364
+ <div *ngIf="closable" [attr.aria-hidden]="true" class="k-tooltip-button" (click)="onCloseClick($event)">
365
+ <a href="#" [attr.title]="closeButtonTitle" class="k-icon">
366
+ <kendo-icon-wrapper
367
+ name="x"
368
+ [svgIcon]="xIcon">
369
+ </kendo-icon-wrapper>
370
+ </a>
371
+ </div>
372
+
373
+ <div class="k-callout" *ngIf="callout" [ngClass]="calloutPositionClass()"></div>
374
+ `, isInline: true, components: [{ type: i2.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoTooltipLocalizedMessages]", inputs: ["closeTitle"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipContentComponent, decorators: [{
376
+ type: Component,
377
+ args: [{
378
+ selector: 'kendo-tooltip',
379
+ template: `
380
+ <ng-container kendoTooltipLocalizedMessages
381
+ i18n-closeTitle="kendo.tooltip.closeTitle|The title of the close button"
382
+ closeTitle="Close"
383
+ >
384
+ </ng-container>
385
+
386
+ <div class="k-tooltip-content">
387
+ <div class="k-tooltip-title" *ngIf="titleTemplate">
388
+ <ng-template
389
+ [ngIf]="titleTemplate"
390
+ [ngTemplateOutlet]="titleTemplate"
391
+ [ngTemplateOutletContext]="{ $implicit: anchor, anchor: anchor }">
392
+ </ng-template>
393
+ </div>
394
+
395
+ <ng-template
396
+ [ngIf]="templateRef"
397
+ [ngTemplateOutlet]="templateRef"
398
+ [ngTemplateOutletContext]="{ $implicit: anchor, anchor: anchor }">
399
+ </ng-template>
400
+ <ng-template
401
+ [ngIf]="templateString">
402
+ {{ templateString }}
403
+ </ng-template>
404
+ </div>
405
+
406
+ <div *ngIf="closable" [attr.aria-hidden]="true" class="k-tooltip-button" (click)="onCloseClick($event)">
407
+ <a href="#" [attr.title]="closeButtonTitle" class="k-icon">
408
+ <kendo-icon-wrapper
409
+ name="x"
410
+ [svgIcon]="xIcon">
411
+ </kendo-icon-wrapper>
412
+ </a>
413
+ </div>
414
+
415
+ <div class="k-callout" *ngIf="callout" [ngClass]="calloutPositionClass()"></div>
416
+ `,
417
+ providers: [
418
+ LocalizationService,
419
+ {
420
+ provide: L10N_PREFIX,
421
+ useValue: 'kendo.tooltip'
422
+ }
423
+ ]
424
+ }]
425
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.LocalizationService }]; }, propDecorators: { direction: [{
426
+ type: HostBinding,
427
+ args: ['attr.dir']
428
+ }], close: [{
429
+ type: Output
430
+ }], cssClasses: [{
431
+ type: HostBinding,
432
+ args: ['class']
433
+ }], hostRole: [{
434
+ type: HostBinding,
435
+ args: ['attr.role']
436
+ }], hostId: [{
437
+ type: HostBinding,
438
+ args: ['attr.id']
439
+ }], className: [{
440
+ type: HostBinding,
441
+ args: ['class.k-tooltip-closable']
442
+ }], cssPosition: [{
443
+ type: HostBinding,
444
+ args: ['style.position']
445
+ }], tooltipWidth: [{
446
+ type: HostBinding,
447
+ args: ['style.width.px']
448
+ }, {
449
+ type: Input
450
+ }], tooltipHeight: [{
451
+ type: HostBinding,
452
+ args: ['style.height.px']
453
+ }, {
454
+ type: Input
455
+ }], titleTemplate: [{
456
+ type: Input
457
+ }], anchor: [{
458
+ type: Input
459
+ }], closable: [{
460
+ type: Input
461
+ }], templateRef: [{
462
+ type: Input
463
+ }], templateString: [{
464
+ type: Input
465
+ }] } });
466
+
467
+ /**
468
+ * Represents the [Kendo UI Tooltip directive for Angular]({% slug overview_tooltip %}).
469
+ * Used to display additional information that is related to an element.
470
+ *
471
+ * @example
472
+ * ```ts-no-run
473
+ * <div kendoTooltip>
474
+ * <a title="Tooltip title" href="foo">foo</a>
475
+ * </div>
476
+ * ```
477
+ */
478
+ class TooltipDirective {
479
+ constructor(tooltipWrapper, ngZone, renderer, popupService, settings, legacySettings) {
480
+ this.tooltipWrapper = tooltipWrapper;
481
+ this.ngZone = ngZone;
482
+ this.renderer = renderer;
483
+ this.popupService = popupService;
484
+ /**
485
+ * Specifies a selector for elements within a container which will display a tooltip
486
+ * ([see example]({% slug anchorelements_tooltip %})). The possible values include any
487
+ * DOM `selector`. The default value is `[title]`.
488
+ */
489
+ this.filter = '[title]';
490
+ /**
491
+ * Specifies the position of the Tooltip that is relative to the
492
+ * anchor element ([see example]({% slug positioning_tooltip %})).
493
+ *
494
+ * The possible values are:
495
+ * * `top` (default)
496
+ * * `bottom`
497
+ * * `left`
498
+ * * `right`
499
+ */
500
+ this.position = 'top';
501
+ /**
502
+ * Specifies the delay in milliseconds before the Tooltip is shown.
503
+ * * `100` (default) milliseconds.
504
+ */
505
+ this.showAfter = 100;
506
+ /**
507
+ * Specifies if the Тooltip will display a callout arrow.
508
+ *
509
+ * The possible values are:
510
+ * * `true` (default)
511
+ * * `false`
512
+ */
513
+ this.callout = true;
514
+ /**
515
+ * Specifies if the Тooltip will display a **Close** button
516
+ * ([see example]({% slug closable_tooltip %})).
517
+ *
518
+ * The possible values are:
519
+ * * `true`
520
+ * * `false`
521
+ */
522
+ this.closable = false;
523
+ /**
524
+ * Specifies the offset in pixels between the Tooltip and the anchor. Defaults to `6` pixels.
525
+ * If the `callout` property is set to `true`, the offset is rendered from the callout arrow.
526
+ * If the `callout` property is set to `false`, the offset is rendered from the content of the Tooltip.
527
+ */
528
+ this.offset = 6;
529
+ this.anchor = null;
530
+ this.keyboardNavigationSubscription = new Subscription();
531
+ this.validPositions = ['top', 'bottom', 'right', 'left'];
532
+ this.validShowOptions = ['hover', 'click', 'none'];
533
+ validatePackage(packageMetadata);
534
+ Object.assign(this, settings, legacySettings);
535
+ this.ngZone.runOutsideAngular(() => {
536
+ const wrapper = this.tooltipWrapper.nativeElement;
537
+ this.anchorTitleSubscription = fromEvent(wrapper, 'mouseover')
538
+ .pipe(filter(() => this.filter !== ''))
539
+ .subscribe((e) => {
540
+ const filterElement = closestBySelector(e.target, this.filter);
541
+ if (filterElement) {
542
+ this.hideElementTitle({ nativeElement: filterElement });
543
+ }
544
+ });
545
+ this.mouseOverSubscription = fromEvent(wrapper, 'mouseover')
546
+ .pipe(filter(() => this.filter !== ''))
547
+ .subscribe(e => this.onMouseOver(e));
548
+ this.mouseOutSubscription = fromEvent(wrapper, 'mouseout')
549
+ .subscribe(e => this.onMouseOut(e));
550
+ });
551
+ }
552
+ /**
553
+ * Sets the content of the Tooltip as a template reference
554
+ * ([see example]({% slug templates_tooltip %})).
555
+ */
556
+ set tooltipTemplate(value) {
557
+ this.template = value;
558
+ }
559
+ get tooltipTemplate() {
560
+ return this.template;
561
+ }
562
+ /**
563
+ * Shows the Tooltip.
564
+ * @param anchor&mdash; ElementRef|Element.
565
+ * Specifies the element that will be used as an anchor. The Tooltip opens relative to that element.
566
+ */
567
+ show(anchor) {
568
+ if (this.popupRef) {
569
+ return;
570
+ }
571
+ if (anchor instanceof Element) {
572
+ anchor = { nativeElement: anchor };
573
+ }
574
+ this.anchor = anchor;
575
+ if (this.showOn === 'hover') {
576
+ if (this.popupRef) {
577
+ return;
578
+ }
579
+ clearTimeout(this.showTimeout);
580
+ this.showTimeout = setTimeout(() => this.showContent(this.anchor), this.showAfter);
581
+ }
582
+ else {
583
+ this.hideElementTitle(this.anchor);
584
+ this.showContent(this.anchor);
585
+ }
586
+ }
587
+ /**
588
+ * Hides the Tooltip.
589
+ */
590
+ hide() {
591
+ clearTimeout(this.showTimeout);
592
+ const anchor = this.anchor && this.anchor.nativeElement;
593
+ if (anchor && anchor.getAttribute('data-title')) {
594
+ if (!anchor.getAttribute('title') && anchor.hasAttribute('title')) {
595
+ anchor.setAttribute('title', anchor.getAttribute('data-title'));
596
+ }
597
+ anchor.setAttribute('data-title', '');
598
+ }
599
+ if (this.popupMouseOutSubscription) {
600
+ this.popupMouseOutSubscription.unsubscribe();
601
+ }
602
+ if (this.closeClickSubscription) {
603
+ this.closeClickSubscription.unsubscribe();
604
+ }
605
+ this.closePopup();
606
+ }
607
+ /**
608
+ * Toggle visibility of the Tooltip.
609
+ *
610
+ * @param anchor&mdash; ElementRef|Element. Specifies the element that will be used as an anchor.
611
+ * @param show&mdash; Optional. Boolean. Specifies if the Tooltip will be rendered.
612
+ */
613
+ toggle(anchor, show) {
614
+ const previousAnchor = this.anchor && this.anchor.nativeElement;
615
+ if (anchor instanceof Element) {
616
+ anchor = { nativeElement: anchor };
617
+ }
618
+ if (previousAnchor !== anchor.nativeElement) {
619
+ this.hide();
620
+ }
621
+ if (previousAnchor === anchor.nativeElement && this.showOn === 'click') {
622
+ this.hide();
623
+ }
624
+ if (typeof show === 'undefined') {
625
+ show = !this.popupRef;
626
+ }
627
+ if (show) {
628
+ this.show(anchor);
629
+ }
630
+ else {
631
+ this.hide();
632
+ }
633
+ }
634
+ ngOnInit() {
635
+ if (this.showOn === undefined) {
636
+ this.showOn = 'hover';
637
+ }
638
+ this.keyboardNavigationSubscription.add(this.renderer.listen(this.tooltipWrapper.nativeElement, 'keydown', event => this.onKeyDown(event)));
639
+ this.verifyProperties();
640
+ }
641
+ ngOnChanges(changes) {
642
+ if (changes.showOn && isDocumentAvailable()) {
643
+ this.subscribeClick();
644
+ }
645
+ }
646
+ ngAfterViewChecked() {
647
+ if (!this.popupRef) {
648
+ return;
649
+ }
650
+ if (this.anchor &&
651
+ !hasParent(this.anchor.nativeElement || this.anchor, this.tooltipWrapper.nativeElement)) {
652
+ this.anchor = null;
653
+ this.hide();
654
+ }
655
+ }
656
+ ngOnDestroy() {
657
+ this.hide();
658
+ this.template = null;
659
+ this.anchorTitleSubscription.unsubscribe();
660
+ this.mouseOverSubscription.unsubscribe();
661
+ this.mouseOutSubscription.unsubscribe();
662
+ this.keyboardNavigationSubscription.unsubscribe();
663
+ if (this.mouseClickSubscription) {
664
+ this.mouseClickSubscription.unsubscribe();
665
+ }
666
+ if (this.popupPositionChangeSubscription) {
667
+ this.popupPositionChangeSubscription.unsubscribe();
668
+ }
669
+ if (this.popupMouseOutSubscription) {
670
+ this.popupMouseOutSubscription.unsubscribe();
671
+ }
672
+ }
673
+ showContent(anchorRef) {
674
+ if (!anchorRef.nativeElement.getAttribute('data-title') && !this.template) {
675
+ return;
676
+ }
677
+ this.ngZone.run(() => {
678
+ this.openPopup(anchorRef);
679
+ this.bindContent(this.popupRef.content, anchorRef);
680
+ });
681
+ this.popupRef.popupAnchorViewportLeave
682
+ .pipe(take(1))
683
+ .subscribe(() => this.hide());
684
+ }
685
+ bindContent(contentComponent, anchorRef) {
686
+ const content = contentComponent.instance;
687
+ this.closeClickSubscription = content.close
688
+ .subscribe(() => {
689
+ this.hide();
690
+ });
691
+ if (!this.template) {
692
+ content.templateString = this.anchor.nativeElement.getAttribute('data-title');
693
+ }
694
+ else {
695
+ content.templateRef = this.template;
696
+ }
697
+ if (this.titleTemplate) {
698
+ content.titleTemplate = this.titleTemplate;
699
+ }
700
+ content.closeTitle = this.closeTitle;
701
+ content.anchor = anchorRef;
702
+ content.callout = this.callout;
703
+ content.closable = this.closable;
704
+ content.position = this.position;
705
+ content.tooltipWidth = this.tooltipWidth;
706
+ content.tooltipHeight = this.tooltipHeight;
707
+ this.popupRef.content.changeDetectorRef.detectChanges();
708
+ }
709
+ hideElementTitle(elementRef) {
710
+ const element = elementRef.nativeElement;
711
+ if (element.getAttribute('title')) {
712
+ element.setAttribute('data-title', element.getAttribute('title'));
713
+ element.setAttribute('title', '');
714
+ }
715
+ }
716
+ openPopup(anchorRef) {
717
+ const alignSettings = align(this.position, this.offset);
718
+ const anchorAlign = alignSettings.anchorAlign;
719
+ const popupAlign = alignSettings.popupAlign;
720
+ const popupMargin = alignSettings.popupMargin;
721
+ this.popupRef = this.popupService.open({
722
+ anchor: anchorRef,
723
+ anchorAlign,
724
+ animate: false,
725
+ content: TooltipContentComponent,
726
+ collision: collision(this.collision, this.position),
727
+ margin: popupMargin,
728
+ popupAlign,
729
+ popupClass: 'k-popup-transparent'
730
+ });
731
+ this.renderer.addClass(this.popupRef.popupElement, 'k-tooltip-wrapper');
732
+ if (this.tooltipClass) {
733
+ this.renderer.addClass(this.popupRef.popupElement, this.tooltipClass);
734
+ }
735
+ const popupInstance = this.popupRef.content.instance;
736
+ if (anchorRef) {
737
+ this.renderer.setAttribute(anchorRef.nativeElement, 'aria-labelledby', popupInstance.tooltipId);
738
+ }
739
+ if (popupInstance.callout) {
740
+ this.popupPositionChangeSubscription = this.popupRef.popupPositionChange
741
+ .subscribe(({ flip }) => {
742
+ const isFlip = flip.horizontal === true || flip.vertical === true;
743
+ popupInstance.updateCalloutPosition(this.position, isFlip);
744
+ });
745
+ }
746
+ if (this.showOn === 'hover') {
747
+ this.ngZone.runOutsideAngular(() => {
748
+ const popup = this.popupRef.popupElement;
749
+ this.popupMouseOutSubscription = fromEvent(popup, 'mouseout')
750
+ .subscribe((e) => this.onMouseOut(e));
751
+ });
752
+ }
753
+ }
754
+ closePopup() {
755
+ if (this.popupRef) {
756
+ if (this.anchor) {
757
+ this.renderer.removeAttribute(this.anchor.nativeElement, 'aria-labelledby');
758
+ }
759
+ this.popupRef.close();
760
+ this.popupRef = null;
761
+ }
762
+ if (this.popupPositionChangeSubscription) {
763
+ this.popupPositionChangeSubscription.unsubscribe();
764
+ }
765
+ }
766
+ subscribeClick() {
767
+ if (this.mouseClickSubscription) {
768
+ this.mouseClickSubscription.unsubscribe();
769
+ }
770
+ if (this.showOn === 'click') {
771
+ this.mouseClickSubscription = fromEvent(document, 'click')
772
+ .pipe(filter(() => this.filter !== ''))
773
+ .subscribe(e => this.onMouseClick(e, this.tooltipWrapper.nativeElement));
774
+ }
775
+ }
776
+ onMouseClick(e, wrapper) {
777
+ const target = e.target;
778
+ const filterElement = closestBySelector(target, this.filter);
779
+ const popup = this.popupRef && this.popupRef.popupElement;
780
+ if (popup) {
781
+ if (popup.contains(target)) {
782
+ return;
783
+ }
784
+ if (this.closable) {
785
+ return;
786
+ }
787
+ }
788
+ if (wrapper.contains(target) && filterElement) {
789
+ this.toggle(filterElement, true);
790
+ }
791
+ else if (popup) {
792
+ this.hide();
793
+ }
794
+ }
795
+ onKeyDown(event) {
796
+ const keyCode = event.keyCode;
797
+ const target = event.target;
798
+ if (this.popupRef) {
799
+ const tooltipId = this.popupRef.content.location.nativeElement.getAttribute('id');
800
+ const anchorLabelledBy = target.getAttribute('aria-labelledby');
801
+ if (keyCode === Keys.Escape && this.canCloseTooltip(target, tooltipId, anchorLabelledBy)) {
802
+ this.closePopup();
803
+ }
804
+ }
805
+ }
806
+ canCloseTooltip(target, tooltipId, anchorLabelledBy) {
807
+ const isIdEqualsLabel = tooltipId === anchorLabelledBy;
808
+ const filterElement = closestBySelector(target, this.filter);
809
+ const isTargetFocused = target === document.activeElement;
810
+ const isTargetInsideWrapper = this.tooltipWrapper.nativeElement.contains(target);
811
+ return isTargetInsideWrapper && filterElement && isTargetFocused && isIdEqualsLabel;
812
+ }
813
+ onMouseOver(e) {
814
+ const filterElement = closestBySelector(e.target, this.filter);
815
+ if (this.showOn !== 'hover') {
816
+ return;
817
+ }
818
+ if (filterElement) {
819
+ this.toggle(filterElement, true);
820
+ }
821
+ }
822
+ onMouseOut(e) {
823
+ if (this.showOn !== 'hover') {
824
+ return;
825
+ }
826
+ if (this.closable) {
827
+ return;
828
+ }
829
+ const popup = this.popupRef && this.popupRef.popupElement;
830
+ const relatedTarget = e.relatedTarget;
831
+ if (relatedTarget && this.anchor && contains(this.anchor.nativeElement, relatedTarget)) {
832
+ return;
833
+ }
834
+ if (relatedTarget && contains(popup, relatedTarget)) {
835
+ return;
836
+ }
837
+ this.hide();
838
+ }
839
+ verifyProperties() {
840
+ if (!isDevMode()) {
841
+ return;
842
+ }
843
+ if (!containsItem(this.validPositions, this.position)) {
844
+ throw new Error(`Invalid value provided for position property.The available options are 'top', 'bottom', 'left', or 'right'.`);
845
+ }
846
+ if (!containsItem(this.validShowOptions, this.showOn)) {
847
+ throw new Error(`Invalid value provided for showOn property.The available options are 'hover' or 'none'.`);
848
+ }
849
+ }
850
+ }
851
+ TooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1$1.PopupService }, { token: TooltipSettings, optional: true }, { token: TOOLTIP_SETTINGS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
852
+ TooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: TooltipDirective, selector: "[kendoTooltip]", inputs: { filter: "filter", position: "position", titleTemplate: "titleTemplate", showOn: "showOn", showAfter: "showAfter", callout: "callout", closable: "closable", offset: "offset", tooltipWidth: "tooltipWidth", tooltipHeight: "tooltipHeight", tooltipClass: "tooltipClass", collision: "collision", closeTitle: "closeTitle", tooltipTemplate: "tooltipTemplate" }, exportAs: ["kendoTooltip"], usesOnChanges: true, ngImport: i0 });
853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipDirective, decorators: [{
854
+ type: Directive,
855
+ args: [{
856
+ selector: '[kendoTooltip]',
857
+ exportAs: 'kendoTooltip'
858
+ }]
859
+ }], ctorParameters: function () {
860
+ return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1$1.PopupService }, { type: TooltipSettings, decorators: [{
861
+ type: Optional
862
+ }] }, { type: TooltipSettings, decorators: [{
863
+ type: Optional
864
+ }, {
865
+ type: Inject,
866
+ args: [TOOLTIP_SETTINGS]
867
+ }] }];
868
+ }, propDecorators: { filter: [{
869
+ type: Input
870
+ }], position: [{
871
+ type: Input
872
+ }], titleTemplate: [{
873
+ type: Input
874
+ }], showOn: [{
875
+ type: Input
876
+ }], showAfter: [{
877
+ type: Input
878
+ }], callout: [{
879
+ type: Input
880
+ }], closable: [{
881
+ type: Input
882
+ }], offset: [{
883
+ type: Input
884
+ }], tooltipWidth: [{
885
+ type: Input
886
+ }], tooltipHeight: [{
887
+ type: Input
888
+ }], tooltipClass: [{
889
+ type: Input
890
+ }], collision: [{
891
+ type: Input
892
+ }], closeTitle: [{
893
+ type: Input
894
+ }], tooltipTemplate: [{
895
+ type: Input
896
+ }] } });
897
+
898
+ /**
899
+ * @hidden
900
+ */
901
+ const ERRORS = {
902
+ popover: `Invalid value provided for the 'popover' property. The accepted data types are 'PopoverComponent' or 'PopoverFn'.`,
903
+ templateData: `templateData must be a function, but received`,
904
+ showOn: `Invalid value provided for the 'showOn' property. The available options are 'click', 'hover', 'focus' or 'none'.`
905
+ };
906
+
907
+ /**
908
+ * Represents a template that defines the content of the Popover title.
909
+ *
910
+ * To define the template, nest an `<ng-template>` tag
911
+ * with the `kendoPopoverTitleTemplate` directive inside the `<kendo-popover>` tag.
912
+ */
913
+ class PopoverTitleTemplateDirective {
914
+ constructor(templateRef) {
915
+ this.templateRef = templateRef;
916
+ }
917
+ }
918
+ PopoverTitleTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverTitleTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
919
+ PopoverTitleTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: PopoverTitleTemplateDirective, selector: "[kendoPopoverTitleTemplate]", ngImport: i0 });
920
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverTitleTemplateDirective, decorators: [{
921
+ type: Directive,
922
+ args: [{
923
+ selector: '[kendoPopoverTitleTemplate]'
924
+ }]
925
+ }], ctorParameters: function () {
926
+ return [{ type: i0.TemplateRef, decorators: [{
927
+ type: Optional
928
+ }] }];
929
+ } });
930
+
931
+ /**
932
+ * Represents a template that defines the content of the Popover body.
933
+ *
934
+ * To define the template, nest an `<ng-template>` tag
935
+ * with the `kendoPopoverBodyTemplate` directive inside the `<kendo-popover>` tag.
936
+ */
937
+ class PopoverBodyTemplateDirective {
938
+ constructor(templateRef) {
939
+ this.templateRef = templateRef;
940
+ }
941
+ }
942
+ PopoverBodyTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverBodyTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
943
+ PopoverBodyTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: PopoverBodyTemplateDirective, selector: "[kendoPopoverBodyTemplate]", ngImport: i0 });
944
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverBodyTemplateDirective, decorators: [{
945
+ type: Directive,
946
+ args: [{
947
+ selector: '[kendoPopoverBodyTemplate]'
948
+ }]
949
+ }], ctorParameters: function () {
950
+ return [{ type: i0.TemplateRef, decorators: [{
951
+ type: Optional
952
+ }] }];
953
+ } });
954
+
955
+ /**
956
+ * Represents a template that defines the content of the Popover actions.
957
+ *
958
+ * To define the template, nest an `<ng-template>` tag
959
+ * with the `kendoPopoverActionsTemplate` directive inside the `<kendo-popover>` tag.
960
+ */
961
+ class PopoverActionsTemplateDirective {
962
+ constructor(templateRef) {
963
+ this.templateRef = templateRef;
964
+ }
965
+ }
966
+ PopoverActionsTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverActionsTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
967
+ PopoverActionsTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: PopoverActionsTemplateDirective, selector: "[kendoPopoverActionsTemplate]", ngImport: i0 });
968
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverActionsTemplateDirective, decorators: [{
969
+ type: Directive,
970
+ args: [{
971
+ selector: '[kendoPopoverActionsTemplate]'
972
+ }]
973
+ }], ctorParameters: function () {
974
+ return [{ type: i0.TemplateRef, decorators: [{
975
+ type: Optional
976
+ }] }];
977
+ } });
978
+
979
+ /**
980
+ * Represents the [Kendo UI Popover component for Angular]({% slug overview_popover %}).
981
+ * Used to display additional information that is related to a target element.
982
+ *
983
+ * @example
984
+ * ```ts-no-run
985
+ * <kendo-popover>
986
+ * <ng-template kendoPopoverTitleTemplate>Foo Title</ng-template>
987
+ * <ng-template kendoPopoverBodyTemplate>Foo Body</ng-template>
988
+ * <ng-template kendoPopoverActionsTemplate>Foo Actions</ng-template>
989
+ * </kendo-popover>
990
+ * ```
991
+ */
992
+ class PopoverComponent {
993
+ constructor(localization) {
994
+ this.localization = localization;
995
+ /**
996
+ * Specifies the position of the Popover in relation to its anchor element. [See example]({% slug positioning_popover %})
997
+ *
998
+ * The possible options are:
999
+ * `top`
1000
+ * `bottom`
1001
+ * `right` (Default)
1002
+ * `left`
1003
+ */
1004
+ this.position = 'right';
1005
+ /**
1006
+ * Determines whether a callout will be rendered along the Popover. [See example]({% slug callout_popover %})
1007
+ *
1008
+ * @default true
1009
+ */
1010
+ this.callout = true;
1011
+ /**
1012
+ * Enables and configures the Popover animation. [See example]({% slug animations_popover %})
1013
+ *
1014
+ * The possible options are:
1015
+ *
1016
+ * * `boolean`&mdash;Enables the default animation
1017
+ * * `PopoverAnimation`&mdash;A configuration object which allows setting the `direction`, `duration` and `type` of the animation.
1018
+ *
1019
+ * @default false
1020
+ */
1021
+ this.animation = false;
1022
+ /**
1023
+ * @hidden
1024
+ * Determines the visibility of the Popover.
1025
+ */
1026
+ this.visible = false;
1027
+ /**
1028
+ * Fires before the Popover is about to be shown ([see example]({% slug events_popover %})).
1029
+ * The event is preventable. If canceled, the Popover will not be displayed. [See example]({% slug events_popover %})
1030
+ */
1031
+ this.show = new EventEmitter();
1032
+ /**
1033
+ * Fires after the Popover has been shown and the animation has ended. [See example]({% slug events_popover %})
1034
+ */
1035
+ this.shown = new EventEmitter();
1036
+ /**
1037
+ * Fires when the Popover is about to be hidden ([see example]({% slug events_popover %})).
1038
+ * The event is preventable. If canceled, the Popover will remain visible.
1039
+ */
1040
+ this.hide = new EventEmitter();
1041
+ /**
1042
+ * Fires after the Popover has been hidden and the animation has ended. [See example]({% slug events_popover %})
1043
+ */
1044
+ this.hidden = new EventEmitter();
1045
+ /**
1046
+ * @hidden
1047
+ */
1048
+ this._width = 'auto';
1049
+ /**
1050
+ * @hidden
1051
+ */
1052
+ this._height = 'auto';
1053
+ this._offset = 6;
1054
+ this.subs = new Subscription();
1055
+ /**
1056
+ * @hidden
1057
+ */
1058
+ this._templateData = () => null;
1059
+ validatePackage(packageMetadata);
1060
+ }
1061
+ /**
1062
+ * Specifies the distance from the Popover to its anchor element in pixels.
1063
+ *
1064
+ * @default `6`
1065
+ */
1066
+ set offset(value) {
1067
+ this._offset = value;
1068
+ }
1069
+ get offset() {
1070
+ const calloutBuffer = 14;
1071
+ return this.callout
1072
+ ? calloutBuffer + this._offset
1073
+ : this._offset;
1074
+ }
1075
+ /**
1076
+ * Determines the width of the popover. Numeric values are treated as pixels.
1077
+ * @default 'auto'
1078
+ */
1079
+ set width(value) {
1080
+ this._width = typeof value === 'number' ? `${value}px` : value;
1081
+ }
1082
+ get width() {
1083
+ return this._width;
1084
+ }
1085
+ /**
1086
+ * Determines the height of the popover. Numeric values are treated as pixels.
1087
+ * @default 'auto'
1088
+ */
1089
+ set height(value) {
1090
+ this._height = typeof value === 'number' ? `${value}px` : value;
1091
+ }
1092
+ get height() {
1093
+ return this._height;
1094
+ }
1095
+ /**
1096
+ * Defines a callback function which returns custom data passed to the Popover templates.
1097
+ * It exposes the current anchor element as an argument. [See example]({% slug templates_popover %}#toc-popoverdatacallback)
1098
+ */
1099
+ set templateData(fn) {
1100
+ if (isDevMode && typeof fn !== 'function') {
1101
+ throw new Error(`${ERRORS.templateData} ${JSON.stringify(fn)}.`);
1102
+ }
1103
+ this._templateData = fn;
1104
+ }
1105
+ get templateData() {
1106
+ return this._templateData;
1107
+ }
1108
+ /**
1109
+ * @hidden
1110
+ */
1111
+ get isHidden() {
1112
+ return !this.visible;
1113
+ }
1114
+ /**
1115
+ * @hidden
1116
+ */
1117
+ get hasAttributeHidden() {
1118
+ return !this.visible;
1119
+ }
1120
+ ngOnInit() {
1121
+ this.subs.add(this.localization.changes.subscribe(({ rtl }) => {
1122
+ this.direction = rtl ? 'rtl' : 'ltr';
1123
+ }));
1124
+ }
1125
+ ngOnDestroy() {
1126
+ this.subs.unsubscribe();
1127
+ }
1128
+ /**
1129
+ * @hidden
1130
+ */
1131
+ getCalloutPosition() {
1132
+ switch (this.position) {
1133
+ case 'top': return { 'k-callout-s': true };
1134
+ case 'bottom': return { 'k-callout-n': true };
1135
+ case 'left': return { 'k-callout-e': true };
1136
+ case 'right': return { 'k-callout-w': true };
1137
+ default: return { 'k-callout-s': true };
1138
+ }
1139
+ }
1140
+ }
1141
+ PopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
1142
+ PopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PopoverComponent, selector: "kendo-popover", inputs: { position: "position", offset: "offset", width: "width", height: "height", title: "title", subtitle: "subtitle", body: "body", callout: "callout", animation: "animation", templateData: "templateData" }, outputs: { show: "show", shown: "shown", hide: "hide", hidden: "hidden" }, host: { properties: { "attr.dir": "this.direction", "class.k-hidden": "this.isHidden", "attr.aria-hidden": "this.hasAttributeHidden", "style.width": "this._width", "style.height": "this._height" } }, providers: [
1143
+ LocalizationService,
1144
+ {
1145
+ provide: L10N_PREFIX,
1146
+ useValue: 'kendo.popover'
1147
+ }
1148
+ ], queries: [{ propertyName: "titleTemplate", first: true, predicate: PopoverTitleTemplateDirective, descendants: true }, { propertyName: "bodyTemplate", first: true, predicate: PopoverBodyTemplateDirective, descendants: true }, { propertyName: "actionsTemplate", first: true, predicate: PopoverActionsTemplateDirective, descendants: true }], ngImport: i0, template: `
1149
+ <div *ngIf="visible" role="tooltip" class="k-popover" [ngStyle]="{'width': width, 'height': height}">
1150
+ <div class="k-popover-callout" [ngClass]="getCalloutPosition()" *ngIf="callout"></div>
1151
+
1152
+ <div class="k-popover-inner" *ngIf="callout; else noCallout">
1153
+ <ng-container *ngTemplateOutlet="noCallout"></ng-container>
1154
+ </div>
1155
+
1156
+ <ng-template #noCallout>
1157
+ <div *ngIf="titleTemplate || title" class="k-popover-header">
1158
+ <ng-template *ngIf="titleTemplate"
1159
+ [ngTemplateOutlet]="titleTemplate?.templateRef"
1160
+ [ngTemplateOutletContext]="{ $implicit: anchor, data: contextData }">
1161
+ </ng-template>
1162
+ <ng-container *ngIf="title && !titleTemplate">
1163
+ {{ title }}
1164
+ </ng-container>
1165
+ </div>
1166
+
1167
+ <div *ngIf="bodyTemplate || body" class="k-popover-body">
1168
+ <ng-template *ngIf="bodyTemplate"
1169
+ [ngTemplateOutlet]="bodyTemplate?.templateRef"
1170
+ [ngTemplateOutletContext]="{ $implicit: anchor, data: contextData }">
1171
+ </ng-template>
1172
+ <ng-container *ngIf="body && !bodyTemplate">
1173
+ {{ body }}
1174
+ </ng-container>
1175
+ </div>
1176
+
1177
+ <div *ngIf="actionsTemplate" class="k-popover-actions k-actions k-hstack k-justify-content-between">
1178
+ <ng-template *ngIf="actionsTemplate"
1179
+ [ngTemplateOutlet]="actionsTemplate?.templateRef"
1180
+ [ngTemplateOutletContext]="{ $implicit: anchor, data: contextData }">
1181
+ </ng-template>
1182
+ </div>
1183
+ </ng-template>
1184
+ </div>
1185
+ `, isInline: true, directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
1186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverComponent, decorators: [{
1187
+ type: Component,
1188
+ args: [{
1189
+ selector: 'kendo-popover',
1190
+ providers: [
1191
+ LocalizationService,
1192
+ {
1193
+ provide: L10N_PREFIX,
1194
+ useValue: 'kendo.popover'
1195
+ }
1196
+ ],
1197
+ template: `
1198
+ <div *ngIf="visible" role="tooltip" class="k-popover" [ngStyle]="{'width': width, 'height': height}">
1199
+ <div class="k-popover-callout" [ngClass]="getCalloutPosition()" *ngIf="callout"></div>
1200
+
1201
+ <div class="k-popover-inner" *ngIf="callout; else noCallout">
1202
+ <ng-container *ngTemplateOutlet="noCallout"></ng-container>
1203
+ </div>
1204
+
1205
+ <ng-template #noCallout>
1206
+ <div *ngIf="titleTemplate || title" class="k-popover-header">
1207
+ <ng-template *ngIf="titleTemplate"
1208
+ [ngTemplateOutlet]="titleTemplate?.templateRef"
1209
+ [ngTemplateOutletContext]="{ $implicit: anchor, data: contextData }">
1210
+ </ng-template>
1211
+ <ng-container *ngIf="title && !titleTemplate">
1212
+ {{ title }}
1213
+ </ng-container>
1214
+ </div>
1215
+
1216
+ <div *ngIf="bodyTemplate || body" class="k-popover-body">
1217
+ <ng-template *ngIf="bodyTemplate"
1218
+ [ngTemplateOutlet]="bodyTemplate?.templateRef"
1219
+ [ngTemplateOutletContext]="{ $implicit: anchor, data: contextData }">
1220
+ </ng-template>
1221
+ <ng-container *ngIf="body && !bodyTemplate">
1222
+ {{ body }}
1223
+ </ng-container>
1224
+ </div>
1225
+
1226
+ <div *ngIf="actionsTemplate" class="k-popover-actions k-actions k-hstack k-justify-content-between">
1227
+ <ng-template *ngIf="actionsTemplate"
1228
+ [ngTemplateOutlet]="actionsTemplate?.templateRef"
1229
+ [ngTemplateOutletContext]="{ $implicit: anchor, data: contextData }">
1230
+ </ng-template>
1231
+ </div>
1232
+ </ng-template>
1233
+ </div>
1234
+ `
1235
+ }]
1236
+ }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { position: [{
1237
+ type: Input
1238
+ }], offset: [{
1239
+ type: Input
1240
+ }], width: [{
1241
+ type: Input
1242
+ }], height: [{
1243
+ type: Input
1244
+ }], direction: [{
1245
+ type: HostBinding,
1246
+ args: ['attr.dir']
1247
+ }], title: [{
1248
+ type: Input
1249
+ }], subtitle: [{
1250
+ type: Input
1251
+ }], body: [{
1252
+ type: Input
1253
+ }], callout: [{
1254
+ type: Input
1255
+ }], animation: [{
1256
+ type: Input
1257
+ }], templateData: [{
1258
+ type: Input
1259
+ }], isHidden: [{
1260
+ type: HostBinding,
1261
+ args: ['class.k-hidden']
1262
+ }], hasAttributeHidden: [{
1263
+ type: HostBinding,
1264
+ args: ['attr.aria-hidden']
1265
+ }], show: [{
1266
+ type: Output
1267
+ }], shown: [{
1268
+ type: Output
1269
+ }], hide: [{
1270
+ type: Output
1271
+ }], hidden: [{
1272
+ type: Output
1273
+ }], titleTemplate: [{
1274
+ type: ContentChild,
1275
+ args: [PopoverTitleTemplateDirective, { static: false }]
1276
+ }], bodyTemplate: [{
1277
+ type: ContentChild,
1278
+ args: [PopoverBodyTemplateDirective, { static: false }]
1279
+ }], actionsTemplate: [{
1280
+ type: ContentChild,
1281
+ args: [PopoverActionsTemplateDirective, { static: false }]
1282
+ }], _width: [{
1283
+ type: HostBinding,
1284
+ args: ['style.width']
1285
+ }], _height: [{
1286
+ type: HostBinding,
1287
+ args: ['style.height']
1288
+ }] } });
1289
+
1290
+ /**
1291
+ * Arguments for the `show` event. The `show` event fires when a popover is about
1292
+ * to be opened. If you cancel the event, the opening is prevented.
1293
+ */
1294
+ class PopoverShowEvent extends PreventableEvent {
1295
+ /**
1296
+ * @hidden
1297
+ * Constructs the event arguments for the `show` event.
1298
+ * @param anchor - The host element related to the popover.
1299
+ */
1300
+ constructor(anchor) {
1301
+ super();
1302
+ this.anchor = anchor;
1303
+ }
1304
+ }
1305
+ /**
1306
+ * Arguments for the `hide` event. The `hide` event fires when a popover is about
1307
+ * to be closed. If you cancel the event, the popover stays open.
1308
+ */
1309
+ class PopoverHideEvent extends PreventableEvent {
1310
+ /**
1311
+ * @hidden
1312
+ * Constructs the event arguments for the `hide` event.
1313
+ * @param anchor - The host element related to the popover.
1314
+ * @param popover - The popover element.
1315
+ */
1316
+ constructor(anchor, popover) {
1317
+ super();
1318
+ this.anchor = anchor;
1319
+ this.popover = popover;
1320
+ }
1321
+ }
1322
+ /**
1323
+ * Arguments for the `shown` event. The `shown` event fires after the popover has opened and its opening animation has finished.
1324
+ */
1325
+ class PopoverShownEvent {
1326
+ /**
1327
+ * @hidden
1328
+ * Constructs the event arguments for the `shown` event.
1329
+ * @param anchor - The host element related to the popover.
1330
+ * @param popover - The popover element.
1331
+ */
1332
+ constructor(anchor, popover) {
1333
+ this.anchor = anchor;
1334
+ this.popover = popover;
1335
+ }
1336
+ }
1337
+ /**
1338
+ * Arguments for the `hidden` event. The `hidden` event fires after the popover has closed and its closing animation has finished.
1339
+ */
1340
+ class PopoverHiddenEvent {
1341
+ /**
1342
+ * @hidden
1343
+ * Constructs the event arguments for the `hidden` event.
1344
+ * @param anchor - The host element related to the popover.
1345
+ */
1346
+ constructor(anchor) {
1347
+ this.anchor = anchor;
1348
+ }
1349
+ }
1350
+
1351
+ const validShowOptions = ['hover', 'click', 'none', 'focus'];
1352
+ /**
1353
+ * @hidden
1354
+ */
1355
+ class PopoverDirectivesBase {
1356
+ constructor(ngZone, popupService, renderer) {
1357
+ this.ngZone = ngZone;
1358
+ this.popupService = popupService;
1359
+ this.renderer = renderer;
1360
+ this.subs = new Subscription();
1361
+ this._showOn = 'click';
1362
+ }
1363
+ /**
1364
+ * Specifies the popover instance that will be rendered.
1365
+ * Accepts a [`PopoverComponent`]({% slug api_tooltip_popovercomponent %}) instance or
1366
+ * a [`PopoverFn`]({% slug api_tooltip_popoverfn %}) callback which returns a [`PopoverComponent`]({% slug api_tooltip_popovercomponent %}) instance
1367
+ * depending on the current anchor element.
1368
+ *
1369
+ * [See example]({% slug templates_popover %}#toc-popovercallback)
1370
+ */
1371
+ set popover(value) {
1372
+ if (value instanceof PopoverComponent || typeof value === `function`) {
1373
+ this._popover = value;
1374
+ }
1375
+ else {
1376
+ if (isDevMode) {
1377
+ throw new Error(ERRORS.popover);
1378
+ }
1379
+ }
1380
+ }
1381
+ get popover() {
1382
+ return this._popover;
1383
+ }
1384
+ /**
1385
+ * The event on which the Popover will be shown
1386
+ *
1387
+ * The supported values are:
1388
+ * - `click` (default) &mdash;The Popover will be shown when its `anchor` element is clicked.
1389
+ * - `hover`&mdash;The Popover will be shown when its `anchor` element is hovered.
1390
+ * - `focus`&mdash;The Popover will be shown when its `anchor` element is focused.
1391
+ * - `none`&mdash;The Popover will not be shown on user interaction. It could be rendered via the Popover API methods.
1392
+ */
1393
+ set showOn(value) {
1394
+ if (isDevMode && !containsItem(validShowOptions, value)) {
1395
+ throw new Error(ERRORS.showOn);
1396
+ }
1397
+ this._showOn = value;
1398
+ }
1399
+ get showOn() {
1400
+ return this._showOn;
1401
+ }
1402
+ ngAfterViewInit() {
1403
+ if (!isDocumentAvailable()) {
1404
+ return;
1405
+ }
1406
+ this.ngZone.runOutsideAngular(() => {
1407
+ switch (this.showOn) {
1408
+ case 'hover':
1409
+ this.subscribeToEvents([{
1410
+ name: 'mouseenter', handler: this.mouseenterHandler
1411
+ }, {
1412
+ name: 'mouseleave', handler: this.mouseleaveHandler
1413
+ }]);
1414
+ break;
1415
+ case 'focus':
1416
+ this.subscribeToEvents([{
1417
+ name: 'focus', handler: this.focusHandler
1418
+ }, {
1419
+ name: 'blur', handler: this.blurHandler
1420
+ }]);
1421
+ break;
1422
+ case 'click':
1423
+ this.subscribeClick();
1424
+ break;
1425
+ default:
1426
+ break;
1427
+ }
1428
+ });
1429
+ }
1430
+ ngOnDestroy() {
1431
+ this.closePopup();
1432
+ if (this.disposeHoverOverListener) {
1433
+ this.disposeHoverOverListener();
1434
+ }
1435
+ if (this.disposeHoverOutListener) {
1436
+ this.disposeHoverOutListener();
1437
+ }
1438
+ if (this.disposeClickListener) {
1439
+ this.disposeClickListener();
1440
+ }
1441
+ if (this._focusInsideSub) {
1442
+ this._focusInsideSub.unsubscribe();
1443
+ }
1444
+ if (this._hideSub) {
1445
+ this._hideSub.unsubscribe();
1446
+ }
1447
+ if (this.subs) {
1448
+ this.subs.unsubscribe();
1449
+ }
1450
+ if (this._popupOpenSub) {
1451
+ this._popupOpenSub.unsubscribe();
1452
+ }
1453
+ if (this._popupCloseSub) {
1454
+ this._popupCloseSub.unsubscribe();
1455
+ }
1456
+ }
1457
+ /**
1458
+ * Hides the Popover ([See example]({% slug programmaticcontrol_popover %})).
1459
+ */
1460
+ hide() {
1461
+ this.closePopup();
1462
+ }
1463
+ /**
1464
+ * @hidden
1465
+ */
1466
+ closePopup() {
1467
+ if (this.popupRef) {
1468
+ this.popupRef.close();
1469
+ this.popupRef = null;
1470
+ if (this.disposePopupHoverOutListener) {
1471
+ this.disposePopupHoverOutListener();
1472
+ }
1473
+ if (this.disposePopupHoverInListener) {
1474
+ this.disposePopupHoverInListener();
1475
+ }
1476
+ if (this.disposePopupFocusOutListener) {
1477
+ this.disposePopupFocusOutListener();
1478
+ }
1479
+ }
1480
+ }
1481
+ /**
1482
+ * @hidden
1483
+ */
1484
+ openPopup(anchor) {
1485
+ const _anchor = anchor instanceof ElementRef ? anchor.nativeElement : anchor;
1486
+ const popoverComp = this.popover instanceof PopoverComponent ? this.popover : this.popover(_anchor);
1487
+ const alignSettings = align(popoverComp.position, popoverComp.offset);
1488
+ const anchorAlign = alignSettings.anchorAlign;
1489
+ const popupAlign = alignSettings.popupAlign;
1490
+ const popupMargin = alignSettings.popupMargin;
1491
+ const _animation = popoverComp.animation;
1492
+ this.popupRef = this.popupService.open({
1493
+ anchor: { nativeElement: _anchor },
1494
+ animate: _animation,
1495
+ content: PopoverComponent,
1496
+ popupAlign,
1497
+ anchorAlign,
1498
+ margin: popupMargin,
1499
+ popupClass: 'k-popup-transparent',
1500
+ collision: { horizontal: 'fit', vertical: 'fit' }
1501
+ });
1502
+ this.applySettings(this.popupRef.content, popoverComp, anchor);
1503
+ this.monitorPopup();
1504
+ this.initializeCompletionEvents(popoverComp, _anchor);
1505
+ }
1506
+ /**
1507
+ * @hidden
1508
+ */
1509
+ isPrevented(anchorElement, show) {
1510
+ const popoverComp = this.popover instanceof PopoverComponent ? this.popover : this.popover(anchorElement);
1511
+ let eventArgs;
1512
+ // eslint-disable-next-line prefer-const
1513
+ eventArgs = this.initializeEvents(popoverComp, eventArgs, show, anchorElement);
1514
+ return eventArgs.isDefaultPrevented();
1515
+ }
1516
+ /**
1517
+ * @hidden
1518
+ */
1519
+ monitorPopup() {
1520
+ if (this.showOn === 'hover') {
1521
+ this.ngZone.runOutsideAngular(() => {
1522
+ const popup = this.popupRef.popupElement;
1523
+ this.disposePopupHoverInListener = this.renderer.listen(popup, 'mouseenter', _ => {
1524
+ this.ngZone.run(_ => this._popoverService.emitPopoverState(true));
1525
+ });
1526
+ this.disposePopupHoverOutListener = this.renderer.listen(popup, 'mouseleave', _ => {
1527
+ this.ngZone.run(_ => this._popoverService.emitPopoverState(false));
1528
+ });
1529
+ });
1530
+ }
1531
+ if (this.showOn === 'focus') {
1532
+ this.ngZone.runOutsideAngular(() => {
1533
+ const popup = this.popupRef.popupElement;
1534
+ this.disposePopupFocusOutListener = this.renderer.listen(popup, 'focusout', (e) => {
1535
+ const isInsidePopover = closest(e.relatedTarget, (node) => node.classList && node.classList.contains('k-popover'));
1536
+ if (!isInsidePopover) {
1537
+ this.ngZone.run(_ => this._popoverService.emitFocusInsidePopover(false));
1538
+ }
1539
+ });
1540
+ });
1541
+ }
1542
+ }
1543
+ applySettings(contentComponent, popover, anchor) {
1544
+ const content = contentComponent.instance;
1545
+ const _anchor = anchor instanceof ElementRef ? anchor.nativeElement : anchor;
1546
+ content.visible = true;
1547
+ content.anchor = _anchor;
1548
+ content.position = popover.position;
1549
+ content.offset = popover.offset;
1550
+ content.width = popover.width;
1551
+ content.height = popover.height;
1552
+ content.title = popover.title;
1553
+ content.body = popover.body;
1554
+ content.callout = popover.callout;
1555
+ content.animation = popover.animation;
1556
+ content.contextData = popover.templateData(_anchor);
1557
+ content.titleTemplate = popover.titleTemplate;
1558
+ content.bodyTemplate = popover.bodyTemplate;
1559
+ content.actionsTemplate = popover.actionsTemplate;
1560
+ this.popupRef.content.changeDetectorRef.detectChanges();
1561
+ }
1562
+ /**
1563
+ * @hidden
1564
+ */
1565
+ initializeEvents(popoverComp, eventArgs, show, anchorElement) {
1566
+ if (show) {
1567
+ eventArgs = new PopoverShowEvent(anchorElement);
1568
+ if (this.shouldEmitEvent(!!this.popupRef, 'show', popoverComp)) {
1569
+ this.ngZone.run(() => popoverComp.show.emit(eventArgs));
1570
+ }
1571
+ }
1572
+ else {
1573
+ eventArgs = new PopoverHideEvent(anchorElement, this.popupRef);
1574
+ if (this.shouldEmitEvent(!!this.popupRef, 'hide', popoverComp)) {
1575
+ this.ngZone.run(() => popoverComp.hide.emit(eventArgs));
1576
+ }
1577
+ }
1578
+ return eventArgs;
1579
+ }
1580
+ initializeCompletionEvents(popoverComp, _anchor) {
1581
+ if (this.shouldEmitCompletionEvents('shown', popoverComp)) {
1582
+ this.popupRef.popupOpen.subscribe(() => {
1583
+ const eventArgs = new PopoverShownEvent(_anchor, this.popupRef);
1584
+ popoverComp.shown.emit(eventArgs);
1585
+ });
1586
+ }
1587
+ if (this.shouldEmitCompletionEvents('hidden', popoverComp)) {
1588
+ this.popupRef.popupClose.subscribe(() => {
1589
+ this.ngZone.run(_ => {
1590
+ const eventArgs = new PopoverHiddenEvent(_anchor);
1591
+ popoverComp.hidden.emit(eventArgs);
1592
+ });
1593
+ });
1594
+ }
1595
+ }
1596
+ shouldEmitEvent(hasPopup, event, popoverComp) {
1597
+ if ((event === 'show' && !hasPopup && hasObservers(popoverComp[event]))
1598
+ || (event === 'hide' && hasPopup && hasObservers(popoverComp[event]))) {
1599
+ return true;
1600
+ }
1601
+ return false;
1602
+ }
1603
+ shouldEmitCompletionEvents(event, popoverComp) {
1604
+ if ((hasObservers(popoverComp[event]) && !this._popupOpenSub)
1605
+ || (hasObservers(popoverComp[event]) && !this._popupCloseSub)) {
1606
+ return true;
1607
+ }
1608
+ return false;
1609
+ }
1610
+ }
1611
+ PopoverDirectivesBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverDirectivesBase, deps: [{ token: i0.NgZone }, { token: i1$1.PopupService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
1612
+ PopoverDirectivesBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: PopoverDirectivesBase, inputs: { popover: "popover", showOn: "showOn" }, ngImport: i0 });
1613
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverDirectivesBase, decorators: [{
1614
+ type: Directive,
1615
+ args: [{}]
1616
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1$1.PopupService }, { type: i0.Renderer2 }]; }, propDecorators: { popover: [{
1617
+ type: Input
1618
+ }], showOn: [{
1619
+ type: Input
1620
+ }] } });
1621
+
1622
+ /**
1623
+ * @hidden
1624
+ */
1625
+ class PopoverService {
1626
+ constructor(ngZone) {
1627
+ this.ngZone = ngZone;
1628
+ this._pointerOverPopup = new BehaviorSubject(null);
1629
+ this._pointerOverAnchor = new BehaviorSubject(null);
1630
+ this._focusInsidePopover = new BehaviorSubject(null);
1631
+ this._hidePopover = new Subject();
1632
+ this.subs = new Subscription();
1633
+ this.monitor();
1634
+ }
1635
+ ngOnDestroy() {
1636
+ this.subs.unsubscribe();
1637
+ }
1638
+ get isPopoverHovered() {
1639
+ return this._pointerOverPopup.asObservable();
1640
+ }
1641
+ emitPopoverState(isHovered) {
1642
+ this.ngZone.run(_ => this._pointerOverPopup.next(isHovered));
1643
+ }
1644
+ get isAnchorHovered() {
1645
+ return this._pointerOverAnchor.asObservable();
1646
+ }
1647
+ emitAnchorState(isHovered, anchor) {
1648
+ this._isOrigin = this.originAnchor === anchor;
1649
+ this.currentAnchor = anchor;
1650
+ if (isHovered) {
1651
+ this.originAnchor = anchor;
1652
+ }
1653
+ this.ngZone.run(_ => this._pointerOverAnchor.next(isHovered));
1654
+ }
1655
+ get isFocusInsidePopover() {
1656
+ return this._focusInsidePopover.asObservable();
1657
+ }
1658
+ emitFocusInsidePopover(isFocused) {
1659
+ this.ngZone.run(_ => this._focusInsidePopover.next(isFocused));
1660
+ this._focusInsidePopover.next(null);
1661
+ }
1662
+ get hidePopover() {
1663
+ return this._hidePopover.asObservable();
1664
+ }
1665
+ monitor() {
1666
+ this.subs.add(combineLatest(this.isPopoverHovered, this.isAnchorHovered).pipe(
1667
+ // `auditTime` is used because the `mouseleave` event is emitted before `mouseenter`
1668
+ // i.e. there is a millisecond in which the pointer leaves the first target (e.g. anchor) and hasn't reached the second one (e.g. popup)
1669
+ // resulting in both observables emitting `false`
1670
+ auditTime(20)).subscribe(val => {
1671
+ const [isPopoverHovered, isAnchorHovered] = val;
1672
+ this._hidePopover.next([isPopoverHovered, isAnchorHovered, this._isOrigin, this.currentAnchor]);
1673
+ }));
1674
+ }
1675
+ }
1676
+ PopoverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
1677
+ PopoverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverService });
1678
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverService, decorators: [{
1679
+ type: Injectable
1680
+ }], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
1681
+
1682
+ /**
1683
+ * Represents the [`kendoPopoverContainer`]({% slug configuration_popover %}#toc-containerdirective) directive.
1684
+ * It is used to filter and target multiple elements, which should display a popover on interaction.
1685
+ *
1686
+ * @example
1687
+ * ```ts-no-run
1688
+ * <div kendoPopoverContainer [popover]="myPopover" filter=".has-popover">
1689
+ * <button class="has-popover">Show Popover</button>
1690
+ * <button>Button Without Popover</button>
1691
+ * <button class="has-popover">Show Popover</button>
1692
+ * </div>
1693
+ * ```
1694
+ */
1695
+ class PopoverContainerDirective extends PopoverDirectivesBase {
1696
+ constructor(wrapperEl, ngZone, popupService, renderer, popoverService) {
1697
+ super(ngZone, popupService, renderer);
1698
+ this.wrapperEl = wrapperEl;
1699
+ this.ngZone = ngZone;
1700
+ this.popupService = popupService;
1701
+ this.renderer = renderer;
1702
+ this.popoverService = popoverService;
1703
+ this.mouseenterHandler = (anchor) => {
1704
+ this.controlVisibility(anchor, true);
1705
+ };
1706
+ this.mouseleaveHandler = (args) => {
1707
+ const anchor = args.anchor;
1708
+ if (this.isPrevented(anchor, false)) {
1709
+ return;
1710
+ }
1711
+ if (!this._hideSub) {
1712
+ this._hideSub = this.popoverService.hidePopover.subscribe((val) => {
1713
+ const [isPopoverHovered, , isOriginAnchor, currentAnchor] = val;
1714
+ if (!isPopoverHovered && !isOriginAnchor) {
1715
+ this.hide();
1716
+ if (!isOriginAnchor && currentAnchor) {
1717
+ this.show(currentAnchor);
1718
+ }
1719
+ }
1720
+ });
1721
+ }
1722
+ };
1723
+ this.focusHandler = (anchor) => {
1724
+ this.controlVisibility(anchor, true);
1725
+ };
1726
+ this.blurHandler = (args) => {
1727
+ const anchor = args.anchor;
1728
+ const event = args.domEvent;
1729
+ if (this.isPrevented(anchor, false)) {
1730
+ return;
1731
+ }
1732
+ // from anchor to popup focus check
1733
+ const isFocusInside = !!closest(event.relatedTarget, (node) => node.classList && node.classList.contains('k-popover'));
1734
+ if (!isFocusInside) {
1735
+ this.hide();
1736
+ }
1737
+ if (!this._focusInsideSub) {
1738
+ // inside popup focus check
1739
+ this._focusInsideSub = this.popoverService.isFocusInsidePopover.pipe(filter(v => v !== null)).subscribe((val) => {
1740
+ if (!val && !isFocusInside) {
1741
+ this.hide();
1742
+ }
1743
+ });
1744
+ }
1745
+ };
1746
+ this._popoverService = this.popoverService;
1747
+ }
1748
+ /**
1749
+ * Shows the Popover.
1750
+ *
1751
+ * @param anchor&mdash;Specifies the element that will be used as an anchor. The Popover opens relative to that element. [See example]({% slug programmaticcontrol_popover %})
1752
+ */
1753
+ show(anchor) {
1754
+ if (this.popupRef) {
1755
+ return;
1756
+ }
1757
+ this.ngZone.run(() => {
1758
+ this.openPopup(anchor);
1759
+ });
1760
+ this.popupRef.popupAnchorViewportLeave
1761
+ .pipe(take(1))
1762
+ .subscribe(() => this.hide());
1763
+ }
1764
+ /**
1765
+ * Toggles the visibility of the Popover. [See example]({% slug programmaticcontrol_popover %})
1766
+ *
1767
+ * @param anchor&mdash;Specifies the element that will be used as an anchor. The Popover opens relative to that element.
1768
+ */
1769
+ toggle(anchor) {
1770
+ const previousAnchor = this.popupRef && this.popupRef.content.instance.anchor;
1771
+ if (this.popupRef) {
1772
+ this.hide();
1773
+ if (previousAnchor !== anchor) {
1774
+ this.show(anchor);
1775
+ }
1776
+ }
1777
+ else {
1778
+ this.show(anchor);
1779
+ }
1780
+ }
1781
+ subscribeClick() {
1782
+ if (this.disposeClickListener) {
1783
+ this.disposeClickListener();
1784
+ }
1785
+ this.disposeClickListener = this.renderer.listen(document, 'click', (e) => {
1786
+ const filterElement = closestBySelector(e.target, this.filter);
1787
+ this.clickHandler(filterElement, e);
1788
+ });
1789
+ }
1790
+ subscribeToEvents(arr) {
1791
+ const filteredElements = Array.from(document.querySelectorAll(this.filter));
1792
+ filteredElements.forEach((el) => {
1793
+ this.subs.add(this.renderer.listen(el, arr[0].name, () => {
1794
+ this.popoverService.emitAnchorState(true, el);
1795
+ arr[0].handler(el);
1796
+ }));
1797
+ this.subs.add(this.renderer.listen(el, arr[1].name, (e) => {
1798
+ this.popoverService.emitAnchorState(false, null);
1799
+ arr[1].handler({ anchor: el, domEvent: e });
1800
+ }));
1801
+ });
1802
+ }
1803
+ clickHandler(anchor, event) {
1804
+ const isInsidePopup = !!closest(event.target, (node) => node.classList && node.classList.contains('k-popup'));
1805
+ const popupRefAnchor = this.popupRef && this.popupRef.content.instance.anchor;
1806
+ const isOriginAnchor = !!closest(event.target, (node) => node === (popupRefAnchor ? popupRefAnchor : anchor));
1807
+ if (this.showOn !== 'click' || isInsidePopup || (this.popupRef && isOriginAnchor)) {
1808
+ return;
1809
+ }
1810
+ if (!anchor && this.popupRef) {
1811
+ this.controlVisibility(anchor, false);
1812
+ return;
1813
+ }
1814
+ if (isOriginAnchor) {
1815
+ this.controlVisibility(anchor, true);
1816
+ }
1817
+ else if (this.popupRef) {
1818
+ this.controlVisibility(anchor, false);
1819
+ this.controlVisibility(anchor, true);
1820
+ }
1821
+ }
1822
+ controlVisibility(anchor, show) {
1823
+ if (this.isPrevented(anchor, show)) {
1824
+ return;
1825
+ }
1826
+ if (show) {
1827
+ this.show(anchor);
1828
+ }
1829
+ else {
1830
+ this.hide();
1831
+ }
1832
+ }
1833
+ }
1834
+ PopoverContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverContainerDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1$1.PopupService }, { token: i0.Renderer2 }, { token: PopoverService }], target: i0.ɵɵFactoryTarget.Directive });
1835
+ PopoverContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: PopoverContainerDirective, selector: "[kendoPopoverContainer]", inputs: { filter: "filter" }, providers: [PopoverService], exportAs: ["kendoPopoverContainer"], usesInheritance: true, ngImport: i0 });
1836
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverContainerDirective, decorators: [{
1837
+ type: Directive,
1838
+ args: [{
1839
+ selector: '[kendoPopoverContainer]',
1840
+ exportAs: 'kendoPopoverContainer',
1841
+ providers: [PopoverService]
1842
+ }]
1843
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1$1.PopupService }, { type: i0.Renderer2 }, { type: PopoverService }]; }, propDecorators: { filter: [{
1844
+ type: Input
1845
+ }] } });
1846
+
1847
+ /**
1848
+ * Represents the [`kendoPopoverAnchor`]({% slug configuration_popover %}#toc-anchordirective) directive.
1849
+ * It is used to target an element, which should display a popover on interaction.
1850
+ *
1851
+ * @example
1852
+ * ```ts-no-run
1853
+ * <button kendoPopoverAnchor [popover]="myPopover">Show Popover</button>
1854
+ * ```
1855
+ */
1856
+ class PopoverAnchorDirective extends PopoverDirectivesBase {
1857
+ constructor(hostEl, ngZone, popupService, renderer, popoverService) {
1858
+ super(ngZone, popupService, renderer);
1859
+ this.hostEl = hostEl;
1860
+ this.ngZone = ngZone;
1861
+ this.popupService = popupService;
1862
+ this.renderer = renderer;
1863
+ this.popoverService = popoverService;
1864
+ this.mouseenterHandler = () => {
1865
+ this.controlVisibility(this.hostEl.nativeElement, true);
1866
+ };
1867
+ this.mouseleaveHandler = () => {
1868
+ if (this.isPrevented(this.hostEl.nativeElement, false)) {
1869
+ return;
1870
+ }
1871
+ if (!this._hideSub) {
1872
+ this._hideSub = this.popoverService.hidePopover.subscribe((val) => {
1873
+ const [isPopoverHovered, isAnchorHovered] = val;
1874
+ if (!isPopoverHovered && !isAnchorHovered) {
1875
+ this.hide();
1876
+ }
1877
+ });
1878
+ }
1879
+ };
1880
+ this.focusHandler = () => {
1881
+ this.controlVisibility(this.hostEl.nativeElement, true);
1882
+ };
1883
+ this.blurHandler = (args) => {
1884
+ const event = args.domEvent;
1885
+ if (this.isPrevented(this.hostEl.nativeElement, false)) {
1886
+ return;
1887
+ }
1888
+ // from anchor to popup focus check
1889
+ const isFocusInside = !!closest(event.relatedTarget, (node) => node.classList && node.classList.contains('k-popover'));
1890
+ if (!isFocusInside) {
1891
+ this.hide();
1892
+ }
1893
+ if (!this._focusInsideSub) {
1894
+ // inside popup focus check
1895
+ this._focusInsideSub = this.popoverService.isFocusInsidePopover.pipe(filter(v => v !== null)).subscribe((val) => {
1896
+ if (!val) {
1897
+ this.hide();
1898
+ }
1899
+ });
1900
+ }
1901
+ };
1902
+ this._popoverService = this.popoverService;
1903
+ }
1904
+ /**
1905
+ * Shows the Popover. [See example]({% slug programmaticcontrol_popover %})
1906
+ */
1907
+ show() {
1908
+ if (this.popupRef) {
1909
+ return;
1910
+ }
1911
+ this.ngZone.run(() => {
1912
+ this.openPopup(this.hostEl);
1913
+ });
1914
+ this.popupRef.popupAnchorViewportLeave
1915
+ .pipe(take(1))
1916
+ .subscribe(() => this.hide());
1917
+ }
1918
+ /**
1919
+ * Toggles the visibility of the Popover. [See example]({% slug programmaticcontrol_popover %})
1920
+ */
1921
+ toggle() {
1922
+ if (this.popupRef) {
1923
+ this.hide();
1924
+ }
1925
+ else {
1926
+ this.show();
1927
+ }
1928
+ }
1929
+ subscribeToEvents(arr) {
1930
+ this.subs.add(this.renderer.listen(this.hostEl.nativeElement, arr[0].name, () => {
1931
+ this.popoverService.emitAnchorState(true, this.hostEl.nativeElement);
1932
+ arr[0].handler();
1933
+ }));
1934
+ this.subs.add(this.renderer.listen(this.hostEl.nativeElement, arr[1].name, (e) => {
1935
+ this.popoverService.emitAnchorState(false, null);
1936
+ arr[1].handler({ domEvent: e });
1937
+ }));
1938
+ }
1939
+ subscribeClick() {
1940
+ if (this.disposeClickListener) {
1941
+ this.disposeClickListener();
1942
+ }
1943
+ this.disposeClickListener = this.renderer.listen(document, 'click', (e) => {
1944
+ this.onClick(e);
1945
+ });
1946
+ }
1947
+ /**
1948
+ * @hidden
1949
+ */
1950
+ onClick(event) {
1951
+ const isInsidePopup = !!closest(event.target, (node) => node.classList && node.classList.contains('k-popup'));
1952
+ const isAnchor = !!closest(event.target, (node) => node === this.hostEl.nativeElement);
1953
+ if (isInsidePopup || (this.popupRef && isAnchor)) {
1954
+ return;
1955
+ }
1956
+ if (isAnchor) {
1957
+ // on opening
1958
+ this.controlVisibility(this.hostEl.nativeElement, true);
1959
+ }
1960
+ else {
1961
+ // on closing
1962
+ this.controlVisibility(this.hostEl.nativeElement, false);
1963
+ }
1964
+ }
1965
+ controlVisibility(anchor, show) {
1966
+ if (this.isPrevented(anchor, show)) {
1967
+ return;
1968
+ }
1969
+ if (show) {
1970
+ this.show();
1971
+ }
1972
+ else {
1973
+ this.hide();
1974
+ }
1975
+ }
1976
+ }
1977
+ PopoverAnchorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverAnchorDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1$1.PopupService }, { token: i0.Renderer2 }, { token: PopoverService }], target: i0.ɵɵFactoryTarget.Directive });
1978
+ PopoverAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: PopoverAnchorDirective, selector: "[kendoPopoverAnchor]", providers: [PopoverService], exportAs: ["kendoPopoverAnchor"], usesInheritance: true, ngImport: i0 });
1979
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverAnchorDirective, decorators: [{
1980
+ type: Directive,
1981
+ args: [{
1982
+ selector: '[kendoPopoverAnchor]',
1983
+ exportAs: 'kendoPopoverAnchor',
1984
+ providers: [PopoverService]
1985
+ }]
1986
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1$1.PopupService }, { type: i0.Renderer2 }, { type: PopoverService }]; } });
1987
+
1988
+ const COMPONENT_DIRECTIVES = [TooltipDirective, TooltipContentComponent, LocalizedMessagesDirective];
1989
+ const COMPONENT_MODULES = [PopupModule, IconsModule];
1990
+ /**
1991
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
1992
+ * definition for the Tooltip component.
1993
+ *
1994
+ * The package exports:
1995
+ * - `KendoTooltipDirective`&mdash;The Tooltip directive class.
1996
+ *
1997
+ * @example
1998
+ *
1999
+ * ```ts-no-run
2000
+ * // Import the Tooltip module
2001
+ * import { TooltipModule } from '@progress/kendo-angular-tooltip';
2002
+ *
2003
+ * // The browser platform with a compiler
2004
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2005
+ *
2006
+ * import { NgModule } from '@angular/core';
2007
+ *
2008
+ * // Import the app component
2009
+ * _@NgModule{{
2010
+ * declarations: [AppComponent], // declare app component
2011
+ * imports: [BrowserModule, TooltipModule], // import TooltipModule module
2012
+ * bootstrap: [AppComponent]
2013
+ * }}
2014
+ * export class AppModule {}
2015
+ *
2016
+ * // Compile and launch the module
2017
+ * platformBrowserDynamic().bootstrapModule(AppModule);
2018
+ * ```
2019
+ */
2020
+ class TooltipModule {
2021
+ }
2022
+ TooltipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2023
+ TooltipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipModule, declarations: [TooltipDirective, TooltipContentComponent, LocalizedMessagesDirective], imports: [CommonModule, PopupModule, IconsModule], exports: [TooltipDirective, TooltipContentComponent, LocalizedMessagesDirective] });
2024
+ TooltipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipModule, imports: [[CommonModule, ...COMPONENT_MODULES]] });
2025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipModule, decorators: [{
2026
+ type: NgModule,
2027
+ args: [{
2028
+ declarations: [COMPONENT_DIRECTIVES],
2029
+ entryComponents: [TooltipContentComponent],
2030
+ imports: [CommonModule, ...COMPONENT_MODULES],
2031
+ exports: [COMPONENT_DIRECTIVES]
2032
+ }]
2033
+ }] });
2034
+
2035
+ const DIRECTIVES = [
2036
+ PopoverActionsTemplateDirective,
2037
+ PopoverBodyTemplateDirective,
2038
+ PopoverTitleTemplateDirective,
2039
+ PopoverAnchorDirective,
2040
+ PopoverContainerDirective
2041
+ ];
2042
+ /**
2043
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
2044
+ * definition for the Popover component.
2045
+ *
2046
+ * @example
2047
+ *
2048
+ * ```ts-no-run
2049
+ * import { PopoverModule } from '@progress/kendo-angular-tooltip';
2050
+ *
2051
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2052
+ * import { NgModule } from '@angular/core';
2053
+ *
2054
+ * import { AppComponent } from './app.component';
2055
+ *
2056
+ * _@NgModule({
2057
+ * declarations: [AppComponent],
2058
+ * imports: [BrowserModule, PopoverModule],
2059
+ * bootstrap: [AppComponent]
2060
+ * })
2061
+ * export class AppModule {}
2062
+ *
2063
+ * platformBrowserDynamic().bootstrapModule(AppModule);
2064
+ *
2065
+ * ```
2066
+ */
2067
+ class PopoverModule {
2068
+ }
2069
+ PopoverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2070
+ PopoverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverModule, declarations: [PopoverActionsTemplateDirective,
2071
+ PopoverBodyTemplateDirective,
2072
+ PopoverTitleTemplateDirective,
2073
+ PopoverAnchorDirective,
2074
+ PopoverContainerDirective, PopoverComponent], imports: [CommonModule,
2075
+ PopupModule], exports: [PopoverActionsTemplateDirective,
2076
+ PopoverBodyTemplateDirective,
2077
+ PopoverTitleTemplateDirective,
2078
+ PopoverAnchorDirective,
2079
+ PopoverContainerDirective, PopoverComponent] });
2080
+ PopoverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverModule, imports: [[
2081
+ CommonModule,
2082
+ PopupModule
2083
+ ]] });
2084
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PopoverModule, decorators: [{
2085
+ type: NgModule,
2086
+ args: [{
2087
+ declarations: [
2088
+ ...DIRECTIVES,
2089
+ PopoverComponent
2090
+ ],
2091
+ entryComponents: [PopoverComponent],
2092
+ exports: [...DIRECTIVES, PopoverComponent],
2093
+ imports: [
2094
+ CommonModule,
2095
+ PopupModule
2096
+ ]
2097
+ }]
2098
+ }] });
2099
+
2100
+ /**
2101
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
2102
+ * definition for the Tooltips components.
2103
+ *
2104
+ * @example
2105
+ *
2106
+ * ```ts-no-run
2107
+ * import { TooltipsModule } from '@progress/kendo-angular-tooltip';
2108
+ *
2109
+ * // The browser platform with a compiler
2110
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2111
+ *
2112
+ * import { NgModule } from '@angular/core';
2113
+ *
2114
+ * // Import the app component
2115
+ * _@NgModule{{
2116
+ * declarations: [AppComponent], // declare app component
2117
+ * imports: [BrowserModule, TooltipsModule], // import TooltipsModule module
2118
+ * bootstrap: [AppComponent]
2119
+ * }}
2120
+ * export class AppModule {}
2121
+ *
2122
+ * // Compile and launch the module
2123
+ * platformBrowserDynamic().bootstrapModule(AppModule);
2124
+ * ```
2125
+ */
2126
+ class TooltipsModule {
2127
+ }
2128
+ TooltipsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2129
+ TooltipsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipsModule, exports: [TooltipModule, PopoverModule] });
2130
+ TooltipsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipsModule, imports: [TooltipModule, PopoverModule] });
2131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TooltipsModule, decorators: [{
2132
+ type: NgModule,
2133
+ args: [{
2134
+ exports: [TooltipModule, PopoverModule]
2135
+ }]
2136
+ }] });
2137
+
2138
+ // Tooltip
2139
+
2140
+ /**
2141
+ * Generated bundle index. Do not edit.
2142
+ */
2143
+
2144
+ export { LocalizedMessagesDirective, PopoverActionsTemplateDirective, PopoverAnchorDirective, PopoverBodyTemplateDirective, PopoverComponent, PopoverContainerDirective, PopoverHiddenEvent, PopoverHideEvent, PopoverModule, PopoverShowEvent, PopoverShownEvent, PopoverTitleTemplateDirective, TOOLTIP_SETTINGS, TooltipContentComponent, TooltipDirective, TooltipModule, TooltipSettings, TooltipsModule };
2145
+