@progress/kendo-angular-tooltip 3.0.2-dev.202105121258 → 3.1.0-dev.202201182021

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 (141) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +119 -79
  3. package/README.md +1 -1
  4. package/dist/cdn/js/kendo-angular-tooltip.js +3 -3
  5. package/dist/cdn/main.js +2 -2
  6. package/dist/es/constants.d.ts +12 -0
  7. package/dist/es/constants.js +12 -0
  8. package/dist/es/index.d.ts +5 -3
  9. package/dist/es/index.js +3 -1
  10. package/dist/es/index.metadata.json +1 -1
  11. package/dist/es/localization/localized-messages.directive.d.ts +1 -1
  12. package/dist/es/localization/localized-messages.directive.js +1 -1
  13. package/dist/es/main.d.ts +17 -3
  14. package/dist/es/main.js +13 -2
  15. package/dist/es/models/animation.model.d.ts +9 -0
  16. package/dist/es/models/animation.model.js +4 -0
  17. package/dist/es/models/events.d.ts +78 -0
  18. package/dist/es/models/events.js +78 -0
  19. package/dist/es/models/functions.model.d.ts +17 -0
  20. package/dist/es/models/functions.model.js +4 -0
  21. package/dist/es/models/popover-show-option.type.d.ts +8 -0
  22. package/dist/es/models/popover-show-option.type.js +4 -0
  23. package/dist/es/models/position.type.d.ts +2 -2
  24. package/dist/es/models/position.type.js +1 -1
  25. package/dist/es/models/show.option.type.d.ts +1 -1
  26. package/dist/es/models/show.option.type.js +1 -1
  27. package/dist/es/package-metadata.d.ts +1 -1
  28. package/dist/es/package-metadata.js +2 -2
  29. package/dist/es/popover/anchor.directive.d.ts +44 -0
  30. package/dist/es/popover/anchor.directive.js +150 -0
  31. package/dist/es/popover/container.directive.d.ts +56 -0
  32. package/dist/es/popover/container.directive.js +176 -0
  33. package/dist/es/popover/directives-base.d.ts +87 -0
  34. package/dist/es/popover/directives-base.js +274 -0
  35. package/dist/es/popover/popover.component.d.ts +166 -0
  36. package/dist/es/popover/popover.component.js +300 -0
  37. package/dist/es/popover/popover.service.d.ts +30 -0
  38. package/dist/es/popover/popover.service.js +88 -0
  39. package/dist/es/popover/template-directives/actions-template.directive.d.ts +15 -0
  40. package/dist/es/popover/template-directives/actions-template.directive.js +26 -0
  41. package/dist/es/popover/template-directives/body-template.directive.d.ts +15 -0
  42. package/dist/es/popover/template-directives/body-template.directive.js +26 -0
  43. package/dist/es/popover/template-directives/title-template.directive.d.ts +15 -0
  44. package/dist/es/popover/template-directives/title-template.directive.js +26 -0
  45. package/dist/es/popover.module.d.ts +31 -0
  46. package/dist/es/popover.module.js +65 -0
  47. package/dist/es/tooltip/tooltip.content.component.d.ts +1 -1
  48. package/dist/es/tooltip/tooltip.content.component.js +1 -1
  49. package/dist/es/tooltip/tooltip.directive.d.ts +1 -1
  50. package/dist/es/tooltip/tooltip.directive.js +5 -5
  51. package/dist/es/tooltip/tooltip.settings.d.ts +1 -1
  52. package/dist/es/tooltip/tooltip.settings.js +1 -1
  53. package/dist/es/tooltip.module.d.ts +1 -1
  54. package/dist/es/tooltip.module.js +1 -1
  55. package/dist/es/tooltips.module.d.ts +32 -0
  56. package/dist/es/tooltips.module.js +45 -0
  57. package/dist/es/utils.d.ts +2 -2
  58. package/dist/es/utils.js +2 -2
  59. package/dist/es2015/constants.d.ts +12 -0
  60. package/dist/es2015/constants.js +12 -0
  61. package/dist/es2015/index.d.ts +3 -1
  62. package/dist/es2015/index.js +3 -1
  63. package/dist/es2015/index.metadata.json +1 -1
  64. package/dist/es2015/localization/localized-messages.directive.d.ts +1 -1
  65. package/dist/es2015/localization/localized-messages.directive.js +1 -1
  66. package/dist/es2015/main.d.ts +17 -3
  67. package/dist/es2015/main.js +13 -2
  68. package/dist/es2015/models/animation.model.d.ts +9 -0
  69. package/dist/es2015/models/animation.model.js +4 -0
  70. package/dist/es2015/models/events.d.ts +78 -0
  71. package/dist/es2015/models/events.js +65 -0
  72. package/dist/es2015/models/functions.model.d.ts +17 -0
  73. package/dist/es2015/models/functions.model.js +4 -0
  74. package/dist/es2015/models/popover-show-option.type.d.ts +8 -0
  75. package/dist/es2015/models/popover-show-option.type.js +4 -0
  76. package/dist/es2015/models/position.type.d.ts +2 -2
  77. package/dist/es2015/models/position.type.js +1 -1
  78. package/dist/es2015/models/show.option.type.d.ts +1 -1
  79. package/dist/es2015/models/show.option.type.js +1 -1
  80. package/dist/es2015/package-metadata.d.ts +1 -1
  81. package/dist/es2015/package-metadata.js +2 -2
  82. package/dist/es2015/popover/anchor.directive.d.ts +44 -0
  83. package/dist/es2015/popover/anchor.directive.js +144 -0
  84. package/dist/es2015/popover/container.directive.d.ts +56 -0
  85. package/dist/es2015/popover/container.directive.js +171 -0
  86. package/dist/es2015/popover/directives-base.d.ts +87 -0
  87. package/dist/es2015/popover/directives-base.js +259 -0
  88. package/dist/es2015/popover/popover.component.d.ts +166 -0
  89. package/dist/es2015/popover/popover.component.js +304 -0
  90. package/dist/es2015/popover/popover.service.d.ts +30 -0
  91. package/dist/es2015/popover/popover.service.js +67 -0
  92. package/dist/es2015/popover/template-directives/actions-template.directive.d.ts +15 -0
  93. package/dist/es2015/popover/template-directives/actions-template.directive.js +25 -0
  94. package/dist/es2015/popover/template-directives/body-template.directive.d.ts +15 -0
  95. package/dist/es2015/popover/template-directives/body-template.directive.js +25 -0
  96. package/dist/es2015/popover/template-directives/title-template.directive.d.ts +15 -0
  97. package/dist/es2015/popover/template-directives/title-template.directive.js +25 -0
  98. package/dist/es2015/popover.module.d.ts +31 -0
  99. package/dist/es2015/popover.module.js +63 -0
  100. package/dist/es2015/tooltip/tooltip.content.component.d.ts +1 -1
  101. package/dist/es2015/tooltip/tooltip.content.component.js +1 -1
  102. package/dist/es2015/tooltip/tooltip.directive.d.ts +1 -1
  103. package/dist/es2015/tooltip/tooltip.directive.js +5 -5
  104. package/dist/es2015/tooltip/tooltip.settings.d.ts +1 -1
  105. package/dist/es2015/tooltip/tooltip.settings.js +1 -1
  106. package/dist/es2015/tooltip.module.d.ts +1 -1
  107. package/dist/es2015/tooltip.module.js +1 -1
  108. package/dist/es2015/tooltips.module.d.ts +32 -0
  109. package/dist/es2015/tooltips.module.js +42 -0
  110. package/dist/es2015/utils.d.ts +2 -2
  111. package/dist/es2015/utils.js +2 -2
  112. package/dist/fesm2015/index.js +1111 -10
  113. package/dist/fesm5/index.js +1169 -10
  114. package/dist/npm/constants.js +14 -0
  115. package/dist/npm/index.js +5 -1
  116. package/dist/npm/localization/localized-messages.directive.js +1 -1
  117. package/dist/npm/main.js +26 -3
  118. package/dist/npm/models/animation.model.js +6 -0
  119. package/dist/npm/models/events.js +80 -0
  120. package/dist/npm/models/functions.model.js +6 -0
  121. package/dist/npm/models/popover-show-option.type.js +6 -0
  122. package/dist/npm/models/position.type.js +1 -1
  123. package/dist/npm/models/show.option.type.js +1 -1
  124. package/dist/npm/package-metadata.js +2 -2
  125. package/dist/npm/popover/anchor.directive.js +152 -0
  126. package/dist/npm/popover/container.directive.js +178 -0
  127. package/dist/npm/popover/directives-base.js +276 -0
  128. package/dist/npm/popover/popover.component.js +302 -0
  129. package/dist/npm/popover/popover.service.js +90 -0
  130. package/dist/npm/popover/template-directives/actions-template.directive.js +28 -0
  131. package/dist/npm/popover/template-directives/body-template.directive.js +28 -0
  132. package/dist/npm/popover/template-directives/title-template.directive.js +28 -0
  133. package/dist/npm/popover.module.js +67 -0
  134. package/dist/npm/tooltip/tooltip.content.component.js +1 -1
  135. package/dist/npm/tooltip/tooltip.directive.js +4 -4
  136. package/dist/npm/tooltip/tooltip.settings.js +1 -1
  137. package/dist/npm/tooltip.module.js +1 -1
  138. package/dist/npm/tooltips.module.js +47 -0
  139. package/dist/npm/utils.js +3 -3
  140. package/dist/systemjs/kendo-angular-tooltip.js +2 -2
  141. package/package.json +23 -19
@@ -0,0 +1,300 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 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 tslib_1 from "tslib";
6
+ import { Component, ContentChild, EventEmitter, HostBinding, Input, isDevMode, Output } from '@angular/core';
7
+ import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
8
+ import { Subscription } from 'rxjs';
9
+ import { validatePackage } from '@progress/kendo-licensing';
10
+ import { packageMetadata } from '../package-metadata';
11
+ import { ERRORS } from '../constants';
12
+ import { PopoverTitleTemplateDirective } from './template-directives/title-template.directive';
13
+ import { PopoverBodyTemplateDirective } from './template-directives/body-template.directive';
14
+ import { PopoverActionsTemplateDirective } from './template-directives/actions-template.directive';
15
+ /**
16
+ * Represents the [Kendo UI Popover component for Angular]({% slug overview_popover %}).
17
+ * Used to display additional information that is related to a target element.
18
+ *
19
+ * @example
20
+ * ```ts-no-run
21
+ * <kendo-popover>
22
+ * <ng-template kendoPopoverTitleTemplate>Foo Title</ng-template>
23
+ * <ng-template kendoPopoverBodyTemplate>Foo Body</ng-template>
24
+ * <ng-template kendoPopoverActionsTemplate>Foo Actions</ng-template>
25
+ * </kendo-popover>
26
+ * ```
27
+ */
28
+ var PopoverComponent = /** @class */ (function () {
29
+ function PopoverComponent(localization) {
30
+ this.localization = localization;
31
+ /**
32
+ * Specifies the position of the Popover in relation to its anchor element. [See example]({% slug positioning_popover %})
33
+ *
34
+ * The possible options are:
35
+ * `top`
36
+ * `bottom`
37
+ * `right` (Default)
38
+ * `left`
39
+ */
40
+ this.position = 'right';
41
+ /**
42
+ * Determines whether a callout will be rendered along the Popover. [See example]({% slug callout_popover %})
43
+ *
44
+ * @default true
45
+ */
46
+ this.callout = true;
47
+ /**
48
+ * Enables and configures the Popover animation. [See example]({% slug animations_popover %})
49
+ *
50
+ * The possible options are:
51
+ *
52
+ * * `boolean`&mdash;Enables the default animation
53
+ * * `PopoverAnimation`&mdash;A configuration object which allows setting the `direction`, `duration` and `type` of the animation.
54
+ *
55
+ * @default false
56
+ */
57
+ this.animation = false;
58
+ /**
59
+ * @hidden
60
+ * Determines the visibility of the Popover.
61
+ */
62
+ this.visible = false;
63
+ /**
64
+ * Fires before the Popover is about to be shown ([see example]({% slug events_popover %})).
65
+ * The event is preventable. If canceled, the Popover will not be displayed. [See example]({% slug events_popover %})
66
+ */
67
+ this.show = new EventEmitter();
68
+ /**
69
+ * Fires after the Popover has been shown and the animation has ended. [See example]({% slug events_popover %})
70
+ */
71
+ this.shown = new EventEmitter();
72
+ /**
73
+ * Fires when the Popover is about to be hidden ([see example]({% slug events_popover %})).
74
+ * The event is preventable. If canceled, the Popover will remain visible.
75
+ */
76
+ this.hide = new EventEmitter();
77
+ /**
78
+ * Fires after the Popover has been hidden and the animation has ended. [See example]({% slug events_popover %})
79
+ */
80
+ this.hidden = new EventEmitter();
81
+ this._offset = 6;
82
+ this._width = 'auto';
83
+ this._height = 'auto';
84
+ this.subs = new Subscription();
85
+ /**
86
+ * @hidden
87
+ */
88
+ this._templateData = function () { return null; };
89
+ validatePackage(packageMetadata);
90
+ }
91
+ Object.defineProperty(PopoverComponent.prototype, "offset", {
92
+ get: function () {
93
+ var calloutBuffer = 14;
94
+ return this.callout
95
+ ? calloutBuffer + this._offset
96
+ : this._offset;
97
+ },
98
+ /**
99
+ * Specifies the distance from the Popover to its anchor element in pixels.
100
+ *
101
+ * @default `6`
102
+ */
103
+ set: function (value) {
104
+ this._offset = value;
105
+ },
106
+ enumerable: true,
107
+ configurable: true
108
+ });
109
+ Object.defineProperty(PopoverComponent.prototype, "width", {
110
+ get: function () {
111
+ return this._width;
112
+ },
113
+ /**
114
+ * Determines the width of the popover. Numeric values are treated as pixels.
115
+ * @default 'auto'
116
+ */
117
+ set: function (value) {
118
+ this._width = typeof value === 'number' ? value + "px" : value;
119
+ },
120
+ enumerable: true,
121
+ configurable: true
122
+ });
123
+ Object.defineProperty(PopoverComponent.prototype, "height", {
124
+ get: function () {
125
+ return this._height;
126
+ },
127
+ /**
128
+ * Determines the height of the popover. Numeric values are treated as pixels.
129
+ * @default 'auto'
130
+ */
131
+ set: function (value) {
132
+ this._height = typeof value === 'number' ? value + "px" : value;
133
+ },
134
+ enumerable: true,
135
+ configurable: true
136
+ });
137
+ Object.defineProperty(PopoverComponent.prototype, "templateData", {
138
+ get: function () {
139
+ return this._templateData;
140
+ },
141
+ /**
142
+ * Defines a callback function which returns custom data passed to the Popover templates.
143
+ * It exposes the current anchor element as an argument. [See example]({% slug templates_popover %}#toc-popoverdatacallback)
144
+ */
145
+ set: function (fn) {
146
+ if (isDevMode && typeof fn !== 'function') {
147
+ throw new Error(ERRORS.templateData + " " + JSON.stringify(fn) + ".");
148
+ }
149
+ this._templateData = fn;
150
+ },
151
+ enumerable: true,
152
+ configurable: true
153
+ });
154
+ Object.defineProperty(PopoverComponent.prototype, "isHidden", {
155
+ /**
156
+ * @hidden
157
+ */
158
+ get: function () {
159
+ return !this.visible;
160
+ },
161
+ enumerable: true,
162
+ configurable: true
163
+ });
164
+ Object.defineProperty(PopoverComponent.prototype, "hasAttributeHidden", {
165
+ /**
166
+ * @hidden
167
+ */
168
+ get: function () {
169
+ return !this.visible;
170
+ },
171
+ enumerable: true,
172
+ configurable: true
173
+ });
174
+ PopoverComponent.prototype.ngOnInit = function () {
175
+ var _this = this;
176
+ this.subs.add(this.localization.changes.subscribe(function (_a) {
177
+ var rtl = _a.rtl;
178
+ _this.direction = rtl ? 'rtl' : 'ltr';
179
+ }));
180
+ };
181
+ PopoverComponent.prototype.ngOnDestroy = function () {
182
+ this.subs.unsubscribe();
183
+ };
184
+ /**
185
+ * @hidden
186
+ */
187
+ PopoverComponent.prototype.getCalloutPosition = function () {
188
+ switch (this.position) {
189
+ case 'top': return { 'k-callout-s': true };
190
+ case 'bottom': return { 'k-callout-n': true };
191
+ case 'left': return { 'k-callout-e': true };
192
+ case 'right': return { 'k-callout-w': true };
193
+ default: return { 'k-callout-s': true };
194
+ }
195
+ };
196
+ tslib_1.__decorate([
197
+ Input(),
198
+ tslib_1.__metadata("design:type", String)
199
+ ], PopoverComponent.prototype, "position", void 0);
200
+ tslib_1.__decorate([
201
+ Input(),
202
+ tslib_1.__metadata("design:type", Number),
203
+ tslib_1.__metadata("design:paramtypes", [Number])
204
+ ], PopoverComponent.prototype, "offset", null);
205
+ tslib_1.__decorate([
206
+ HostBinding('style.width'),
207
+ Input(),
208
+ tslib_1.__metadata("design:type", Object),
209
+ tslib_1.__metadata("design:paramtypes", [Object])
210
+ ], PopoverComponent.prototype, "width", null);
211
+ tslib_1.__decorate([
212
+ HostBinding('style.height'),
213
+ Input(),
214
+ tslib_1.__metadata("design:type", Object),
215
+ tslib_1.__metadata("design:paramtypes", [Object])
216
+ ], PopoverComponent.prototype, "height", null);
217
+ tslib_1.__decorate([
218
+ HostBinding('attr.dir'),
219
+ tslib_1.__metadata("design:type", String)
220
+ ], PopoverComponent.prototype, "direction", void 0);
221
+ tslib_1.__decorate([
222
+ Input(),
223
+ tslib_1.__metadata("design:type", String)
224
+ ], PopoverComponent.prototype, "title", void 0);
225
+ tslib_1.__decorate([
226
+ Input(),
227
+ tslib_1.__metadata("design:type", String)
228
+ ], PopoverComponent.prototype, "subtitle", void 0);
229
+ tslib_1.__decorate([
230
+ Input(),
231
+ tslib_1.__metadata("design:type", String)
232
+ ], PopoverComponent.prototype, "body", void 0);
233
+ tslib_1.__decorate([
234
+ Input(),
235
+ tslib_1.__metadata("design:type", Boolean)
236
+ ], PopoverComponent.prototype, "callout", void 0);
237
+ tslib_1.__decorate([
238
+ Input(),
239
+ tslib_1.__metadata("design:type", Object)
240
+ ], PopoverComponent.prototype, "animation", void 0);
241
+ tslib_1.__decorate([
242
+ Input(),
243
+ tslib_1.__metadata("design:type", Function),
244
+ tslib_1.__metadata("design:paramtypes", [Function])
245
+ ], PopoverComponent.prototype, "templateData", null);
246
+ tslib_1.__decorate([
247
+ HostBinding('class.k-hidden'),
248
+ tslib_1.__metadata("design:type", Boolean),
249
+ tslib_1.__metadata("design:paramtypes", [])
250
+ ], PopoverComponent.prototype, "isHidden", null);
251
+ tslib_1.__decorate([
252
+ HostBinding('attr.aria-hidden'),
253
+ tslib_1.__metadata("design:type", Boolean),
254
+ tslib_1.__metadata("design:paramtypes", [])
255
+ ], PopoverComponent.prototype, "hasAttributeHidden", null);
256
+ tslib_1.__decorate([
257
+ Output(),
258
+ tslib_1.__metadata("design:type", EventEmitter)
259
+ ], PopoverComponent.prototype, "show", void 0);
260
+ tslib_1.__decorate([
261
+ Output(),
262
+ tslib_1.__metadata("design:type", EventEmitter)
263
+ ], PopoverComponent.prototype, "shown", void 0);
264
+ tslib_1.__decorate([
265
+ Output(),
266
+ tslib_1.__metadata("design:type", EventEmitter)
267
+ ], PopoverComponent.prototype, "hide", void 0);
268
+ tslib_1.__decorate([
269
+ Output(),
270
+ tslib_1.__metadata("design:type", EventEmitter)
271
+ ], PopoverComponent.prototype, "hidden", void 0);
272
+ tslib_1.__decorate([
273
+ ContentChild(PopoverTitleTemplateDirective, { static: false }),
274
+ tslib_1.__metadata("design:type", PopoverTitleTemplateDirective)
275
+ ], PopoverComponent.prototype, "titleTemplate", void 0);
276
+ tslib_1.__decorate([
277
+ ContentChild(PopoverBodyTemplateDirective, { static: false }),
278
+ tslib_1.__metadata("design:type", PopoverBodyTemplateDirective)
279
+ ], PopoverComponent.prototype, "bodyTemplate", void 0);
280
+ tslib_1.__decorate([
281
+ ContentChild(PopoverActionsTemplateDirective, { static: false }),
282
+ tslib_1.__metadata("design:type", PopoverActionsTemplateDirective)
283
+ ], PopoverComponent.prototype, "actionsTemplate", void 0);
284
+ PopoverComponent = tslib_1.__decorate([
285
+ Component({
286
+ selector: 'kendo-popover',
287
+ providers: [
288
+ LocalizationService,
289
+ {
290
+ provide: L10N_PREFIX,
291
+ useValue: 'kendo.popover'
292
+ }
293
+ ],
294
+ template: "\n <div *ngIf=\"visible\" role=\"tooltip\" class=\"k-popover\" [ngStyle]=\"{'width.px': width, 'height.px': height}\">\n <div class=\"k-popover-callout\" [ngClass]=\"getCalloutPosition()\" *ngIf=\"callout\"></div>\n\n <div *ngIf=\"titleTemplate || title\" class=\"k-popover-header\">\n <ng-template *ngIf=\"titleTemplate\"\n [ngTemplateOutlet]=\"titleTemplate?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: anchor, data: contextData }\">\n </ng-template>\n <ng-container *ngIf=\"title && !titleTemplate\">\n {{ title }}\n </ng-container>\n </div>\n\n <div *ngIf=\"bodyTemplate || body\" class=\"k-popover-body\">\n <ng-template *ngIf=\"bodyTemplate\"\n [ngTemplateOutlet]=\"bodyTemplate?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: anchor, data: contextData }\">\n </ng-template>\n <ng-container *ngIf=\"body && !bodyTemplate\">\n {{ body }}\n </ng-container>\n </div>\n\n <div *ngIf=\"actionsTemplate\" class=\"k-popover-actions k-actions k-hstack k-justify-content-between\">\n <ng-template *ngIf=\"actionsTemplate\"\n [ngTemplateOutlet]=\"actionsTemplate?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: anchor, data: contextData }\">\n </ng-template>\n </div>\n </div>\n "
295
+ }),
296
+ tslib_1.__metadata("design:paramtypes", [LocalizationService])
297
+ ], PopoverComponent);
298
+ return PopoverComponent;
299
+ }());
300
+ export { PopoverComponent };
@@ -0,0 +1,30 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { NgZone, OnDestroy } from '@angular/core';
6
+ import { Observable } from 'rxjs';
7
+ /**
8
+ * @hidden
9
+ */
10
+ export declare class PopoverService implements OnDestroy {
11
+ private ngZone;
12
+ private _pointerOverPopup;
13
+ private _pointerOverAnchor;
14
+ private _focusInsidePopover;
15
+ private _hidePopover;
16
+ private _isOrigin;
17
+ private originAnchor;
18
+ private currentAnchor;
19
+ private subs;
20
+ constructor(ngZone: NgZone);
21
+ ngOnDestroy(): void;
22
+ readonly isPopoverHovered: Observable<any>;
23
+ emitPopoverState(isHovered: boolean): void;
24
+ readonly isAnchorHovered: Observable<any>;
25
+ emitAnchorState(isHovered: boolean, anchor: any): void;
26
+ readonly isFocusInsidePopover: Observable<any>;
27
+ emitFocusInsidePopover(isFocused: boolean): void;
28
+ readonly hidePopover: Observable<any>;
29
+ monitor(): void;
30
+ }
@@ -0,0 +1,88 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 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 tslib_1 from "tslib";
6
+ import { Injectable, NgZone } from '@angular/core';
7
+ import { BehaviorSubject, combineLatest, Subject, Subscription } from 'rxjs';
8
+ import { auditTime } from 'rxjs/operators';
9
+ /**
10
+ * @hidden
11
+ */
12
+ var PopoverService = /** @class */ (function () {
13
+ function PopoverService(ngZone) {
14
+ this.ngZone = ngZone;
15
+ this._pointerOverPopup = new BehaviorSubject(null);
16
+ this._pointerOverAnchor = new BehaviorSubject(null);
17
+ this._focusInsidePopover = new BehaviorSubject(null);
18
+ this._hidePopover = new Subject();
19
+ this.subs = new Subscription();
20
+ this.monitor();
21
+ }
22
+ PopoverService.prototype.ngOnDestroy = function () {
23
+ this.subs.unsubscribe();
24
+ };
25
+ Object.defineProperty(PopoverService.prototype, "isPopoverHovered", {
26
+ get: function () {
27
+ return this._pointerOverPopup.asObservable();
28
+ },
29
+ enumerable: true,
30
+ configurable: true
31
+ });
32
+ PopoverService.prototype.emitPopoverState = function (isHovered) {
33
+ var _this = this;
34
+ this.ngZone.run(function (_) { return _this._pointerOverPopup.next(isHovered); });
35
+ };
36
+ Object.defineProperty(PopoverService.prototype, "isAnchorHovered", {
37
+ get: function () {
38
+ return this._pointerOverAnchor.asObservable();
39
+ },
40
+ enumerable: true,
41
+ configurable: true
42
+ });
43
+ PopoverService.prototype.emitAnchorState = function (isHovered, anchor) {
44
+ var _this = this;
45
+ this._isOrigin = this.originAnchor === anchor;
46
+ this.currentAnchor = anchor;
47
+ if (isHovered) {
48
+ this.originAnchor = anchor;
49
+ }
50
+ this.ngZone.run(function (_) { return _this._pointerOverAnchor.next(isHovered); });
51
+ };
52
+ Object.defineProperty(PopoverService.prototype, "isFocusInsidePopover", {
53
+ get: function () {
54
+ return this._focusInsidePopover.asObservable();
55
+ },
56
+ enumerable: true,
57
+ configurable: true
58
+ });
59
+ PopoverService.prototype.emitFocusInsidePopover = function (isFocused) {
60
+ var _this = this;
61
+ this.ngZone.run(function (_) { return _this._focusInsidePopover.next(isFocused); });
62
+ this._focusInsidePopover.next(null);
63
+ };
64
+ Object.defineProperty(PopoverService.prototype, "hidePopover", {
65
+ get: function () {
66
+ return this._hidePopover.asObservable();
67
+ },
68
+ enumerable: true,
69
+ configurable: true
70
+ });
71
+ PopoverService.prototype.monitor = function () {
72
+ var _this = this;
73
+ this.subs.add(combineLatest(this.isPopoverHovered, this.isAnchorHovered).pipe(
74
+ // `auditTime` is used because the `mouseleave` event is emitted before `mouseenter`
75
+ // 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)
76
+ // resulting in both observables emitting `false`
77
+ auditTime(20)).subscribe(function (val) {
78
+ var isPopoverHovered = val[0], isAnchorHovered = val[1];
79
+ _this._hidePopover.next([isPopoverHovered, isAnchorHovered, _this._isOrigin, _this.currentAnchor]);
80
+ }));
81
+ };
82
+ PopoverService = tslib_1.__decorate([
83
+ Injectable(),
84
+ tslib_1.__metadata("design:paramtypes", [NgZone])
85
+ ], PopoverService);
86
+ return PopoverService;
87
+ }());
88
+ export { PopoverService };
@@ -0,0 +1,15 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { TemplateRef } from '@angular/core';
6
+ /**
7
+ * Represents a template that defines the content of the Popover actions.
8
+ *
9
+ * To define the template, nest an `<ng-template>` tag
10
+ * with the `kendoPopoverActionsTemplate` directive inside the `<kendo-popover>` tag.
11
+ */
12
+ export declare class PopoverActionsTemplateDirective {
13
+ templateRef: TemplateRef<any>;
14
+ constructor(templateRef: TemplateRef<any>);
15
+ }
@@ -0,0 +1,26 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 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 tslib_1 from "tslib";
6
+ import { Directive, Optional, TemplateRef } from '@angular/core';
7
+ /**
8
+ * Represents a template that defines the content of the Popover actions.
9
+ *
10
+ * To define the template, nest an `<ng-template>` tag
11
+ * with the `kendoPopoverActionsTemplate` directive inside the `<kendo-popover>` tag.
12
+ */
13
+ var PopoverActionsTemplateDirective = /** @class */ (function () {
14
+ function PopoverActionsTemplateDirective(templateRef) {
15
+ this.templateRef = templateRef;
16
+ }
17
+ PopoverActionsTemplateDirective = tslib_1.__decorate([
18
+ Directive({
19
+ selector: '[kendoPopoverActionsTemplate]'
20
+ }),
21
+ tslib_1.__param(0, Optional()),
22
+ tslib_1.__metadata("design:paramtypes", [TemplateRef])
23
+ ], PopoverActionsTemplateDirective);
24
+ return PopoverActionsTemplateDirective;
25
+ }());
26
+ export { PopoverActionsTemplateDirective };
@@ -0,0 +1,15 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { TemplateRef } from '@angular/core';
6
+ /**
7
+ * Represents a template that defines the content of the Popover body.
8
+ *
9
+ * To define the template, nest an `<ng-template>` tag
10
+ * with the `kendoPopoverBodyTemplate` directive inside the `<kendo-popover>` tag.
11
+ */
12
+ export declare class PopoverBodyTemplateDirective {
13
+ templateRef: TemplateRef<any>;
14
+ constructor(templateRef: TemplateRef<any>);
15
+ }
@@ -0,0 +1,26 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 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 tslib_1 from "tslib";
6
+ import { Directive, Optional, TemplateRef } from '@angular/core';
7
+ /**
8
+ * Represents a template that defines the content of the Popover body.
9
+ *
10
+ * To define the template, nest an `<ng-template>` tag
11
+ * with the `kendoPopoverBodyTemplate` directive inside the `<kendo-popover>` tag.
12
+ */
13
+ var PopoverBodyTemplateDirective = /** @class */ (function () {
14
+ function PopoverBodyTemplateDirective(templateRef) {
15
+ this.templateRef = templateRef;
16
+ }
17
+ PopoverBodyTemplateDirective = tslib_1.__decorate([
18
+ Directive({
19
+ selector: '[kendoPopoverBodyTemplate]'
20
+ }),
21
+ tslib_1.__param(0, Optional()),
22
+ tslib_1.__metadata("design:paramtypes", [TemplateRef])
23
+ ], PopoverBodyTemplateDirective);
24
+ return PopoverBodyTemplateDirective;
25
+ }());
26
+ export { PopoverBodyTemplateDirective };
@@ -0,0 +1,15 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { TemplateRef } from '@angular/core';
6
+ /**
7
+ * Represents a template that defines the content of the Popover title.
8
+ *
9
+ * To define the template, nest an `<ng-template>` tag
10
+ * with the `kendoPopoverTitleTemplate` directive inside the `<kendo-popover>` tag.
11
+ */
12
+ export declare class PopoverTitleTemplateDirective {
13
+ templateRef: TemplateRef<any>;
14
+ constructor(templateRef: TemplateRef<any>);
15
+ }
@@ -0,0 +1,26 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 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 tslib_1 from "tslib";
6
+ import { Directive, Optional, TemplateRef } from '@angular/core';
7
+ /**
8
+ * Represents a template that defines the content of the Popover title.
9
+ *
10
+ * To define the template, nest an `<ng-template>` tag
11
+ * with the `kendoPopoverTitleTemplate` directive inside the `<kendo-popover>` tag.
12
+ */
13
+ var PopoverTitleTemplateDirective = /** @class */ (function () {
14
+ function PopoverTitleTemplateDirective(templateRef) {
15
+ this.templateRef = templateRef;
16
+ }
17
+ PopoverTitleTemplateDirective = tslib_1.__decorate([
18
+ Directive({
19
+ selector: '[kendoPopoverTitleTemplate]'
20
+ }),
21
+ tslib_1.__param(0, Optional()),
22
+ tslib_1.__metadata("design:paramtypes", [TemplateRef])
23
+ ], PopoverTitleTemplateDirective);
24
+ return PopoverTitleTemplateDirective;
25
+ }());
26
+ export { PopoverTitleTemplateDirective };
@@ -0,0 +1,31 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
7
+ * definition for the Popover component.
8
+ *
9
+ * @example
10
+ *
11
+ * ```ts-no-run
12
+ * import { PopoverModule } from '@progress/kendo-angular-tooltip';
13
+ *
14
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
15
+ * import { NgModule } from '@angular/core';
16
+ *
17
+ * import { AppComponent } from './app.component';
18
+ *
19
+ * _@NgModule({
20
+ * declarations: [AppComponent],
21
+ * imports: [BrowserModule, PopoverModule],
22
+ * bootstrap: [AppComponent]
23
+ * })
24
+ * export class AppModule {}
25
+ *
26
+ * platformBrowserDynamic().bootstrapModule(AppModule);
27
+ *
28
+ * ```
29
+ */
30
+ export declare class PopoverModule {
31
+ }
@@ -0,0 +1,65 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 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 tslib_1 from "tslib";
6
+ import { CommonModule } from "@angular/common";
7
+ import { NgModule } from "@angular/core";
8
+ import { PopupModule } from "@progress/kendo-angular-popup";
9
+ import { PopoverAnchorDirective } from "./popover/anchor.directive";
10
+ import { PopoverContainerDirective } from "./popover/container.directive";
11
+ import { PopoverComponent } from "./popover/popover.component";
12
+ import { PopoverTitleTemplateDirective } from './popover/template-directives/title-template.directive';
13
+ import { PopoverBodyTemplateDirective } from './popover/template-directives/body-template.directive';
14
+ import { PopoverActionsTemplateDirective } from './popover/template-directives/actions-template.directive';
15
+ var DIRECTIVES = [
16
+ PopoverActionsTemplateDirective,
17
+ PopoverBodyTemplateDirective,
18
+ PopoverTitleTemplateDirective,
19
+ PopoverAnchorDirective,
20
+ PopoverContainerDirective
21
+ ];
22
+ /**
23
+ * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
24
+ * definition for the Popover component.
25
+ *
26
+ * @example
27
+ *
28
+ * ```ts-no-run
29
+ * import { PopoverModule } from '@progress/kendo-angular-tooltip';
30
+ *
31
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32
+ * import { NgModule } from '@angular/core';
33
+ *
34
+ * import { AppComponent } from './app.component';
35
+ *
36
+ * _@NgModule({
37
+ * declarations: [AppComponent],
38
+ * imports: [BrowserModule, PopoverModule],
39
+ * bootstrap: [AppComponent]
40
+ * })
41
+ * export class AppModule {}
42
+ *
43
+ * platformBrowserDynamic().bootstrapModule(AppModule);
44
+ *
45
+ * ```
46
+ */
47
+ var PopoverModule = /** @class */ (function () {
48
+ function PopoverModule() {
49
+ }
50
+ PopoverModule = tslib_1.__decorate([
51
+ NgModule({
52
+ declarations: DIRECTIVES.concat([
53
+ PopoverComponent
54
+ ]),
55
+ entryComponents: [PopoverComponent],
56
+ exports: DIRECTIVES.concat([PopoverComponent]),
57
+ imports: [
58
+ CommonModule,
59
+ PopupModule
60
+ ]
61
+ })
62
+ ], PopoverModule);
63
+ return PopoverModule;
64
+ }());
65
+ export { PopoverModule };
@@ -1,5 +1,5 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2020 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ElementRef, TemplateRef, EventEmitter } from '@angular/core';
@@ -1,5 +1,5 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2020 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
@@ -1,5 +1,5 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2020 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { TemplateRef, OnDestroy, ElementRef, NgZone, OnChanges, Renderer2, AfterViewChecked } from '@angular/core';