@progress/kendo-angular-tooltip 3.1.6 → 4.0.0-dev.202204131841

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 (146) hide show
  1. package/bundles/kendo-angular-tooltip.umd.js +5 -0
  2. package/{dist/es/constants.d.ts → constants.d.ts} +0 -0
  3. package/{dist/es2015 → esm2015}/constants.js +0 -0
  4. package/{dist/es/models/functions.model.js → esm2015/kendo-angular-tooltip.js} +4 -0
  5. package/esm2015/localization/localized-messages.directive.js +38 -0
  6. package/{dist/es → esm2015}/main.js +2 -0
  7. package/{dist/es2015 → esm2015}/models/animation.model.js +1 -0
  8. package/{dist/es2015 → esm2015}/models/events.js +0 -0
  9. package/{dist/es2015 → esm2015}/models/functions.model.js +1 -0
  10. package/{dist/es → esm2015}/models/popover-show-option.type.js +1 -0
  11. package/{dist/es2015 → esm2015}/models/position.type.js +1 -0
  12. package/{dist/es → esm2015}/models/show.option.type.js +1 -0
  13. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  14. package/{dist/es2015 → esm2015}/popover/anchor.directive.js +22 -19
  15. package/{dist/es2015 → esm2015}/popover/container.directive.js +24 -23
  16. package/{dist/es2015 → esm2015}/popover/directives-base.js +13 -12
  17. package/{dist/es2015 → esm2015}/popover/popover.component.js +118 -108
  18. package/{dist/es2015 → esm2015}/popover/popover.service.js +9 -9
  19. package/esm2015/popover/template-directives/actions-template.directive.js +27 -0
  20. package/esm2015/popover/template-directives/body-template.directive.js +27 -0
  21. package/esm2015/popover/template-directives/title-template.directive.js +27 -0
  22. package/{dist/es2015 → esm2015}/popover.module.js +31 -16
  23. package/{dist/es2015 → esm2015}/tooltip/tooltip.content.component.js +95 -73
  24. package/{dist/es2015 → esm2015}/tooltip/tooltip.directive.js +57 -80
  25. package/{dist/es2015 → esm2015}/tooltip/tooltip.settings.js +12 -7
  26. package/{dist/es2015 → esm2015}/tooltip.module.js +15 -12
  27. package/{dist/es2015 → esm2015}/tooltips.module.js +12 -9
  28. package/{dist/es2015 → esm2015}/utils.js +0 -1
  29. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-tooltip.js} +456 -399
  30. package/{dist/es2015/constants.d.ts → kendo-angular-tooltip.d.ts} +3 -6
  31. package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
  32. package/{dist/es/main.d.ts → main.d.ts} +3 -0
  33. package/{dist/es/models → models}/animation.model.d.ts +0 -0
  34. package/{dist/es/models → models}/events.d.ts +0 -0
  35. package/{dist/es/models → models}/functions.model.d.ts +0 -0
  36. package/{dist/es/models → models}/popover-show-option.type.d.ts +0 -0
  37. package/{dist/es/models → models}/position.type.d.ts +0 -0
  38. package/{dist/es/models → models}/show.option.type.d.ts +0 -0
  39. package/{dist/es/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  40. package/package.json +34 -113
  41. package/{dist/es2015/popover → popover}/anchor.directive.d.ts +3 -0
  42. package/{dist/es/popover → popover}/container.directive.d.ts +3 -0
  43. package/{dist/es2015/popover → popover}/directives-base.d.ts +9 -4
  44. package/{dist/es2015/popover → popover}/popover.component.d.ts +21 -8
  45. package/{dist/es/popover → popover}/popover.service.d.ts +7 -4
  46. package/{dist/es2015/popover → popover}/template-directives/actions-template.directive.d.ts +3 -0
  47. package/{dist/es2015/popover → popover}/template-directives/body-template.directive.d.ts +3 -0
  48. package/{dist/es2015/popover → popover}/template-directives/title-template.directive.d.ts +3 -0
  49. package/popover.module.d.ts +43 -0
  50. package/schematics/ngAdd/index.js +5 -2
  51. package/schematics/ngAdd/index.js.map +1 -1
  52. package/{dist/es/tooltip → tooltip}/tooltip.content.component.d.ts +7 -4
  53. package/{dist/es/tooltip → tooltip}/tooltip.directive.d.ts +5 -1
  54. package/{dist/es/tooltip → tooltip}/tooltip.settings.d.ts +7 -0
  55. package/{dist/es2015/tooltip.module.d.ts → tooltip.module.d.ts} +9 -0
  56. package/{dist/es2015/tooltips.module.d.ts → tooltips.module.d.ts} +6 -0
  57. package/{dist/es/utils.d.ts → utils.d.ts} +0 -0
  58. package/dist/cdn/js/kendo-angular-tooltip.js +0 -20
  59. package/dist/cdn/main.js +0 -5
  60. package/dist/es/constants.js +0 -12
  61. package/dist/es/index.d.ts +0 -12
  62. package/dist/es/index.js +0 -12
  63. package/dist/es/index.metadata.json +0 -1
  64. package/dist/es/localization/localized-messages.directive.d.ts +0 -16
  65. package/dist/es/localization/localized-messages.directive.js +0 -38
  66. package/dist/es/models/animation.model.js +0 -4
  67. package/dist/es/models/events.js +0 -78
  68. package/dist/es/models/position.type.js +0 -4
  69. package/dist/es/package-metadata.js +0 -15
  70. package/dist/es/popover/anchor.directive.d.ts +0 -44
  71. package/dist/es/popover/anchor.directive.js +0 -156
  72. package/dist/es/popover/container.directive.js +0 -182
  73. package/dist/es/popover/directives-base.d.ts +0 -90
  74. package/dist/es/popover/directives-base.js +0 -294
  75. package/dist/es/popover/popover.component.d.ts +0 -166
  76. package/dist/es/popover/popover.component.js +0 -300
  77. package/dist/es/popover/popover.service.js +0 -88
  78. package/dist/es/popover/template-directives/actions-template.directive.d.ts +0 -15
  79. package/dist/es/popover/template-directives/actions-template.directive.js +0 -26
  80. package/dist/es/popover/template-directives/body-template.directive.d.ts +0 -15
  81. package/dist/es/popover/template-directives/body-template.directive.js +0 -26
  82. package/dist/es/popover/template-directives/title-template.directive.d.ts +0 -15
  83. package/dist/es/popover/template-directives/title-template.directive.js +0 -26
  84. package/dist/es/popover.module.d.ts +0 -31
  85. package/dist/es/popover.module.js +0 -65
  86. package/dist/es/tooltip/tooltip.content.component.js +0 -192
  87. package/dist/es/tooltip/tooltip.directive.js +0 -452
  88. package/dist/es/tooltip/tooltip.settings.js +0 -46
  89. package/dist/es/tooltip.module.d.ts +0 -36
  90. package/dist/es/tooltip.module.js +0 -57
  91. package/dist/es/tooltips.module.d.ts +0 -32
  92. package/dist/es/tooltips.module.js +0 -45
  93. package/dist/es/utils.js +0 -113
  94. package/dist/es2015/index.d.ts +0 -12
  95. package/dist/es2015/index.js +0 -12
  96. package/dist/es2015/index.metadata.json +0 -1
  97. package/dist/es2015/localization/localized-messages.directive.js +0 -34
  98. package/dist/es2015/main.d.ts +0 -22
  99. package/dist/es2015/main.js +0 -18
  100. package/dist/es2015/models/animation.model.d.ts +0 -9
  101. package/dist/es2015/models/events.d.ts +0 -78
  102. package/dist/es2015/models/functions.model.d.ts +0 -17
  103. package/dist/es2015/models/popover-show-option.type.d.ts +0 -8
  104. package/dist/es2015/models/popover-show-option.type.js +0 -4
  105. package/dist/es2015/models/position.type.d.ts +0 -14
  106. package/dist/es2015/models/show.option.type.d.ts +0 -13
  107. package/dist/es2015/models/show.option.type.js +0 -4
  108. package/dist/es2015/package-metadata.d.ts +0 -9
  109. package/dist/es2015/popover/container.directive.d.ts +0 -56
  110. package/dist/es2015/popover/popover.service.d.ts +0 -30
  111. package/dist/es2015/popover/template-directives/actions-template.directive.js +0 -25
  112. package/dist/es2015/popover/template-directives/body-template.directive.js +0 -25
  113. package/dist/es2015/popover/template-directives/title-template.directive.js +0 -25
  114. package/dist/es2015/popover.module.d.ts +0 -31
  115. package/dist/es2015/tooltip/tooltip.content.component.d.ts +0 -41
  116. package/dist/es2015/tooltip/tooltip.directive.d.ts +0 -156
  117. package/dist/es2015/tooltip/tooltip.settings.d.ts +0 -72
  118. package/dist/es2015/utils.d.ts +0 -34
  119. package/dist/fesm5/index.js +0 -2071
  120. package/dist/npm/constants.js +0 -14
  121. package/dist/npm/index.js +0 -19
  122. package/dist/npm/localization/localized-messages.directive.js +0 -40
  123. package/dist/npm/main.js +0 -36
  124. package/dist/npm/models/animation.model.js +0 -6
  125. package/dist/npm/models/events.js +0 -80
  126. package/dist/npm/models/functions.model.js +0 -6
  127. package/dist/npm/models/popover-show-option.type.js +0 -6
  128. package/dist/npm/models/position.type.js +0 -6
  129. package/dist/npm/models/show.option.type.js +0 -6
  130. package/dist/npm/package-metadata.js +0 -17
  131. package/dist/npm/popover/anchor.directive.js +0 -158
  132. package/dist/npm/popover/container.directive.js +0 -184
  133. package/dist/npm/popover/directives-base.js +0 -296
  134. package/dist/npm/popover/popover.component.js +0 -302
  135. package/dist/npm/popover/popover.service.js +0 -90
  136. package/dist/npm/popover/template-directives/actions-template.directive.js +0 -28
  137. package/dist/npm/popover/template-directives/body-template.directive.js +0 -28
  138. package/dist/npm/popover/template-directives/title-template.directive.js +0 -28
  139. package/dist/npm/popover.module.js +0 -67
  140. package/dist/npm/tooltip/tooltip.content.component.js +0 -194
  141. package/dist/npm/tooltip/tooltip.directive.js +0 -454
  142. package/dist/npm/tooltip/tooltip.settings.js +0 -48
  143. package/dist/npm/tooltip.module.js +0 -59
  144. package/dist/npm/tooltips.module.js +0 -47
  145. package/dist/npm/utils.js +0 -121
  146. package/dist/systemjs/kendo-angular-tooltip.js +0 -5
@@ -1,454 +0,0 @@
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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var operators_1 = require("rxjs/operators");
10
- var rxjs_1 = require("rxjs");
11
- var kendo_angular_popup_1 = require("@progress/kendo-angular-popup");
12
- var kendo_licensing_1 = require("@progress/kendo-licensing");
13
- var package_metadata_1 = require("../package-metadata");
14
- var tooltip_settings_1 = require("./tooltip.settings");
15
- var tooltip_content_component_1 = require("../tooltip/tooltip.content.component");
16
- var utils_1 = require("../utils");
17
- /**
18
- * Represents the [Kendo UI Tooltip directive for Angular]({% slug overview_tooltip %}).
19
- * Used to display additional information that is related to an element.
20
- *
21
- * @example
22
- * ```ts-no-run
23
- * <div kendoTooltip>
24
- * <a title="Tooltip title" href="foo">foo</a>
25
- * </div>
26
- * ```
27
- */
28
- var TooltipDirective = /** @class */ (function () {
29
- function TooltipDirective(tooltipWrapper, ngZone, renderer, popupService, settings, legacySettings) {
30
- var _this = this;
31
- this.tooltipWrapper = tooltipWrapper;
32
- this.ngZone = ngZone;
33
- this.renderer = renderer;
34
- this.popupService = popupService;
35
- /**
36
- * Specifies a selector for elements within a container which will display a tooltip
37
- * ([see example]({% slug anchorelements_tooltip %})). The possible values include any
38
- * DOM `selector`. The default value is `[title]`.
39
- */
40
- this.filter = '[title]';
41
- /**
42
- * Specifies the position of the Tooltip that is relative to the
43
- * anchor element ([see example]({% slug positioning_tooltip %})).
44
- *
45
- * The possible values are:
46
- * * `top` (default)
47
- * * `bottom`
48
- * * `left`
49
- * * `right`
50
- */
51
- this.position = 'top';
52
- /**
53
- * Specifies the delay in milliseconds before the Tooltip is shown.
54
- * * `100` (default) milliseconds.
55
- */
56
- this.showAfter = 100;
57
- /**
58
- * Specifies if the Тooltip will display a callout arrow.
59
- *
60
- * The possible values are:
61
- * * `true` (default)
62
- * * `false`
63
- */
64
- this.callout = true;
65
- /**
66
- * Specifies if the Тooltip will display a **Close** button
67
- * ([see example]({% slug closable_tooltip %})).
68
- *
69
- * The possible values are:
70
- * * `true`
71
- * * `false`
72
- */
73
- this.closable = false;
74
- /**
75
- * Specifies the offset in pixels between the Tooltip and the anchor. Defaults to `6` pixels.
76
- * If the `callout` property is set to `true`, the offset is rendered from the callout arrow.
77
- * If the `callout` property is set to `false`, the offset is rendered from the content of the Tooltip.
78
- */
79
- this.offset = 6;
80
- this.anchor = null;
81
- this.validPositions = ['top', 'bottom', 'right', 'left'];
82
- this.validShowOptions = ['hover', 'click', 'none'];
83
- kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
84
- Object.assign(this, settings, legacySettings);
85
- this.ngZone.runOutsideAngular(function () {
86
- var wrapper = _this.tooltipWrapper.nativeElement;
87
- _this.anchorTitleSubscription = rxjs_1.fromEvent(wrapper, 'mouseover')
88
- .pipe(operators_1.filter(function () { return _this.filter !== ''; }))
89
- .subscribe(function (e) {
90
- var filterElement = utils_1.closestBySelector(e.target, _this.filter);
91
- if (filterElement) {
92
- _this.hideElementTitle({ nativeElement: filterElement });
93
- }
94
- });
95
- _this.mouseOverSubscription = rxjs_1.fromEvent(wrapper, 'mouseover')
96
- .pipe(operators_1.debounceTime(100), operators_1.filter(function () { return _this.filter !== ''; }))
97
- .subscribe(function (e) { return _this.onMouseOver(e); });
98
- _this.mouseOutSubscription = rxjs_1.fromEvent(wrapper, 'mouseout')
99
- .pipe(operators_1.debounceTime(100))
100
- .subscribe(function (e) { return _this.onMouseOut(e); });
101
- });
102
- }
103
- Object.defineProperty(TooltipDirective.prototype, "tooltipTemplate", {
104
- get: function () { return this.template; },
105
- /**
106
- * Sets the content of the Tooltip as a template reference
107
- * ([see example]({% slug templates_tooltip %})).
108
- */
109
- set: function (value) {
110
- this.template = value;
111
- },
112
- enumerable: true,
113
- configurable: true
114
- });
115
- /**
116
- * Shows the Tooltip.
117
- * @param anchor&mdash; ElementRef|Element.
118
- * Specifies the element that will be used as an anchor. The Tooltip opens relative to that element.
119
- */
120
- TooltipDirective.prototype.show = function (anchor) {
121
- var _this = this;
122
- if (this.popupRef) {
123
- return;
124
- }
125
- if (anchor instanceof Element) {
126
- anchor = { nativeElement: anchor };
127
- }
128
- this.anchor = anchor;
129
- if (this.showOn === 'hover') {
130
- if (this.popupRef) {
131
- return;
132
- }
133
- clearTimeout(this.showTimeout);
134
- this.showTimeout = window.setTimeout(function () { return _this.showContent(_this.anchor); }, this.showAfter);
135
- }
136
- else {
137
- this.hideElementTitle(this.anchor);
138
- this.showContent(this.anchor);
139
- }
140
- };
141
- /**
142
- * Hides the Tooltip.
143
- */
144
- TooltipDirective.prototype.hide = function () {
145
- clearTimeout(this.showTimeout);
146
- var anchor = this.anchor && this.anchor.nativeElement;
147
- if (anchor && anchor.getAttribute('data-title')) {
148
- if (!anchor.getAttribute('title') && anchor.hasAttribute('title')) {
149
- anchor.setAttribute('title', anchor.getAttribute('data-title'));
150
- }
151
- anchor.setAttribute('data-title', '');
152
- }
153
- if (this.popupMouseOutSubscription) {
154
- this.popupMouseOutSubscription.unsubscribe();
155
- }
156
- if (this.closeClickSubscription) {
157
- this.closeClickSubscription.unsubscribe();
158
- }
159
- this.closePopup();
160
- };
161
- /**
162
- * Toggle visibility of the Tooltip.
163
- *
164
- * @param anchor&mdash; ElementRef|Element. Specifies the element that will be used as an anchor.
165
- * @param show&mdash; Optional. Boolean. Specifies if the Tooltip will be rendered.
166
- */
167
- TooltipDirective.prototype.toggle = function (anchor, show) {
168
- var previousAnchor = this.anchor && this.anchor.nativeElement;
169
- if (anchor instanceof Element) {
170
- anchor = { nativeElement: anchor };
171
- }
172
- if (previousAnchor !== anchor.nativeElement) {
173
- this.hide();
174
- }
175
- if (previousAnchor === anchor.nativeElement && this.showOn === 'click') {
176
- this.hide();
177
- }
178
- if (typeof show === 'undefined') {
179
- show = !this.popupRef;
180
- }
181
- if (show) {
182
- this.show(anchor);
183
- }
184
- else {
185
- this.hide();
186
- }
187
- };
188
- TooltipDirective.prototype.ngOnInit = function () {
189
- if (this.showOn === undefined) {
190
- this.showOn = 'hover';
191
- }
192
- this.verifyProperties();
193
- };
194
- TooltipDirective.prototype.ngOnChanges = function (changes) {
195
- if (changes.showOn) {
196
- this.subscribeClick();
197
- }
198
- };
199
- TooltipDirective.prototype.ngAfterViewChecked = function () {
200
- if (!this.popupRef) {
201
- return;
202
- }
203
- if (this.anchor &&
204
- !utils_1.hasParent(this.anchor.nativeElement || this.anchor, this.tooltipWrapper.nativeElement)) {
205
- this.anchor = null;
206
- this.hide();
207
- }
208
- };
209
- TooltipDirective.prototype.ngOnDestroy = function () {
210
- this.hide();
211
- this.template = null;
212
- this.anchorTitleSubscription.unsubscribe();
213
- this.mouseOverSubscription.unsubscribe();
214
- this.mouseOutSubscription.unsubscribe();
215
- if (this.mouseClickSubscription) {
216
- this.mouseClickSubscription.unsubscribe();
217
- }
218
- if (this.popupPositionChangeSubscription) {
219
- this.popupPositionChangeSubscription.unsubscribe();
220
- }
221
- if (this.popupMouseOutSubscription) {
222
- this.popupMouseOutSubscription.unsubscribe();
223
- }
224
- };
225
- TooltipDirective.prototype.showContent = function (anchorRef) {
226
- var _this = this;
227
- if (!anchorRef.nativeElement.getAttribute('data-title') && !this.template) {
228
- return;
229
- }
230
- this.ngZone.run(function () {
231
- _this.openPopup(anchorRef);
232
- _this.bindContent(_this.popupRef.content, anchorRef);
233
- });
234
- this.popupRef.popupAnchorViewportLeave
235
- .pipe(operators_1.take(1))
236
- .subscribe(function () { return _this.hide(); });
237
- };
238
- TooltipDirective.prototype.bindContent = function (contentComponent, anchorRef) {
239
- var _this = this;
240
- var content = contentComponent.instance;
241
- this.closeClickSubscription = content.close
242
- .subscribe(function () { _this.hide(); });
243
- if (!this.template) {
244
- content.templateString = this.anchor.nativeElement.getAttribute('data-title');
245
- }
246
- else {
247
- content.templateRef = this.template;
248
- }
249
- if (this.titleTemplate) {
250
- content.titleTemplate = this.titleTemplate;
251
- }
252
- content.closeTitle = this.closeTitle;
253
- content.anchor = anchorRef;
254
- content.callout = this.callout;
255
- content.closable = this.closable;
256
- content.position = this.position;
257
- content.tooltipWidth = this.tooltipWidth;
258
- content.tooltipHeight = this.tooltipHeight;
259
- this.popupRef.content.changeDetectorRef.detectChanges();
260
- };
261
- TooltipDirective.prototype.hideElementTitle = function (elementRef) {
262
- var element = elementRef.nativeElement;
263
- if (element.getAttribute('title')) {
264
- element.setAttribute('data-title', element.getAttribute('title'));
265
- element.setAttribute('title', '');
266
- }
267
- };
268
- TooltipDirective.prototype.openPopup = function (anchorRef) {
269
- var _this = this;
270
- var alignSettings = utils_1.align(this.position, this.offset);
271
- var anchorAlign = alignSettings.anchorAlign;
272
- var popupAlign = alignSettings.popupAlign;
273
- var popupMargin = alignSettings.popupMargin;
274
- this.popupRef = this.popupService.open({
275
- anchor: anchorRef,
276
- anchorAlign: anchorAlign,
277
- animate: false,
278
- content: tooltip_content_component_1.TooltipContentComponent,
279
- collision: utils_1.collision(this.collision, this.position),
280
- margin: popupMargin,
281
- popupAlign: popupAlign,
282
- popupClass: 'k-popup-transparent'
283
- });
284
- this.renderer.addClass(this.popupRef.popupElement, 'k-tooltip-wrapper');
285
- if (this.tooltipClass) {
286
- this.renderer.addClass(this.popupRef.popupElement, this.tooltipClass);
287
- }
288
- var popupInstance = this.popupRef.content.instance;
289
- if (popupInstance.callout) {
290
- this.popupPositionChangeSubscription = this.popupRef.popupPositionChange
291
- .subscribe(function (_a) {
292
- var flip = _a.flip;
293
- var isFlip = flip.horizontal === true || flip.vertical === true;
294
- popupInstance.updateCalloutPosition(_this.position, isFlip);
295
- });
296
- }
297
- if (this.showOn === 'hover') {
298
- this.ngZone.runOutsideAngular(function () {
299
- var popup = _this.popupRef.popupElement;
300
- _this.popupMouseOutSubscription = rxjs_1.fromEvent(popup, 'mouseout')
301
- .subscribe(function (e) { return _this.onMouseOut(e); });
302
- });
303
- }
304
- };
305
- TooltipDirective.prototype.closePopup = function () {
306
- if (this.popupRef) {
307
- this.popupRef.close();
308
- this.popupRef = null;
309
- }
310
- if (this.popupPositionChangeSubscription) {
311
- this.popupPositionChangeSubscription.unsubscribe();
312
- }
313
- };
314
- TooltipDirective.prototype.subscribeClick = function () {
315
- var _this = this;
316
- if (this.mouseClickSubscription) {
317
- this.mouseClickSubscription.unsubscribe();
318
- }
319
- if (this.showOn === 'click') {
320
- this.mouseClickSubscription = rxjs_1.fromEvent(document, 'click')
321
- .pipe(operators_1.filter(function () { return _this.filter !== ''; }))
322
- .subscribe(function (e) { return _this.onMouseClick(e, _this.tooltipWrapper.nativeElement); });
323
- }
324
- };
325
- TooltipDirective.prototype.onMouseClick = function (e, wrapper) {
326
- var target = e.target;
327
- var filterElement = utils_1.closestBySelector(target, this.filter);
328
- var popup = this.popupRef && this.popupRef.popupElement;
329
- if (popup) {
330
- if (popup.contains(target)) {
331
- return;
332
- }
333
- if (this.closable) {
334
- return;
335
- }
336
- }
337
- if (wrapper.contains(target) && filterElement) {
338
- this.toggle(filterElement, true);
339
- }
340
- else if (popup) {
341
- this.hide();
342
- }
343
- };
344
- TooltipDirective.prototype.onMouseOver = function (e) {
345
- var filterElement = utils_1.closestBySelector(e.target, this.filter);
346
- if (this.showOn !== 'hover') {
347
- return;
348
- }
349
- if (filterElement) {
350
- this.toggle(filterElement, true);
351
- }
352
- };
353
- TooltipDirective.prototype.onMouseOut = function (e) {
354
- if (this.showOn !== 'hover') {
355
- return;
356
- }
357
- if (this.closable) {
358
- return;
359
- }
360
- var popup = this.popupRef && this.popupRef.popupElement;
361
- var relatedTarget = e.relatedTarget;
362
- if (relatedTarget && this.anchor && utils_1.contains(this.anchor.nativeElement, relatedTarget)) {
363
- return;
364
- }
365
- if (relatedTarget && utils_1.contains(popup, relatedTarget)) {
366
- return;
367
- }
368
- this.hide();
369
- };
370
- TooltipDirective.prototype.verifyProperties = function () {
371
- if (!core_1.isDevMode()) {
372
- return;
373
- }
374
- if (!utils_1.containsItem(this.validPositions, this.position)) {
375
- throw new Error("Invalid value provided for position property.The available options are 'top', 'bottom', 'left', or 'right'.");
376
- }
377
- if (!utils_1.containsItem(this.validShowOptions, this.showOn)) {
378
- throw new Error("Invalid value provided for showOn property.The available options are 'hover' or 'none'.");
379
- }
380
- };
381
- tslib_1.__decorate([
382
- core_1.Input(),
383
- tslib_1.__metadata("design:type", String)
384
- ], TooltipDirective.prototype, "filter", void 0);
385
- tslib_1.__decorate([
386
- core_1.Input(),
387
- tslib_1.__metadata("design:type", String)
388
- ], TooltipDirective.prototype, "position", void 0);
389
- tslib_1.__decorate([
390
- core_1.Input(),
391
- tslib_1.__metadata("design:type", core_1.TemplateRef)
392
- ], TooltipDirective.prototype, "titleTemplate", void 0);
393
- tslib_1.__decorate([
394
- core_1.Input(),
395
- tslib_1.__metadata("design:type", String)
396
- ], TooltipDirective.prototype, "showOn", void 0);
397
- tslib_1.__decorate([
398
- core_1.Input(),
399
- tslib_1.__metadata("design:type", Number)
400
- ], TooltipDirective.prototype, "showAfter", void 0);
401
- tslib_1.__decorate([
402
- core_1.Input(),
403
- tslib_1.__metadata("design:type", Boolean)
404
- ], TooltipDirective.prototype, "callout", void 0);
405
- tslib_1.__decorate([
406
- core_1.Input(),
407
- tslib_1.__metadata("design:type", Boolean)
408
- ], TooltipDirective.prototype, "closable", void 0);
409
- tslib_1.__decorate([
410
- core_1.Input(),
411
- tslib_1.__metadata("design:type", Number)
412
- ], TooltipDirective.prototype, "offset", void 0);
413
- tslib_1.__decorate([
414
- core_1.Input(),
415
- tslib_1.__metadata("design:type", Number)
416
- ], TooltipDirective.prototype, "tooltipWidth", void 0);
417
- tslib_1.__decorate([
418
- core_1.Input(),
419
- tslib_1.__metadata("design:type", Number)
420
- ], TooltipDirective.prototype, "tooltipHeight", void 0);
421
- tslib_1.__decorate([
422
- core_1.Input(),
423
- tslib_1.__metadata("design:type", String)
424
- ], TooltipDirective.prototype, "tooltipClass", void 0);
425
- tslib_1.__decorate([
426
- core_1.Input(),
427
- tslib_1.__metadata("design:type", Object)
428
- ], TooltipDirective.prototype, "collision", void 0);
429
- tslib_1.__decorate([
430
- core_1.Input(),
431
- tslib_1.__metadata("design:type", String)
432
- ], TooltipDirective.prototype, "closeTitle", void 0);
433
- tslib_1.__decorate([
434
- core_1.Input(),
435
- tslib_1.__metadata("design:type", core_1.TemplateRef),
436
- tslib_1.__metadata("design:paramtypes", [core_1.TemplateRef])
437
- ], TooltipDirective.prototype, "tooltipTemplate", null);
438
- TooltipDirective = tslib_1.__decorate([
439
- core_1.Directive({
440
- selector: '[kendoTooltip]',
441
- exportAs: 'kendoTooltip'
442
- }),
443
- tslib_1.__param(4, core_1.Optional()),
444
- tslib_1.__param(5, core_1.Optional()), tslib_1.__param(5, core_1.Inject(tooltip_settings_1.TOOLTIP_SETTINGS)),
445
- tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
446
- core_1.NgZone,
447
- core_1.Renderer2,
448
- kendo_angular_popup_1.PopupService,
449
- tooltip_settings_1.TooltipSettings,
450
- tooltip_settings_1.TooltipSettings])
451
- ], TooltipDirective);
452
- return TooltipDirective;
453
- }());
454
- exports.TooltipDirective = TooltipDirective;
@@ -1,48 +0,0 @@
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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- /**
10
- * Obsolete. Provide the TooltipSettings class instead.
11
- *
12
- * @hidden
13
- */
14
- exports.TOOLTIP_SETTINGS = new core_1.InjectionToken('kendo-ui-tooltip-settings');
15
- /**
16
- * Provides a global configuration for the Kendo UI Tooltip. Once injected through
17
- * the `AppComponent` constructor, the configuration properties can be overridden.
18
- *
19
- * @example
20
- * ```ts-no-run
21
- * import { TooltipSettings } from '@progress/kendo-angular-tooltip';
22
- *
23
- * _@Component({
24
- * selector: 'my-app',
25
- * template: `
26
- * <div kendoTooltip>
27
- * <button title="Saves the current document">Save</button>
28
- * </div>`,
29
- * providers: [{
30
- * provide: TooltipSettings,
31
- * useFactory: (): TooltipSettings => ({
32
- * // Override default values of tooltips if wanted
33
- * position: 'right'
34
- * })
35
- * }]
36
- * })
37
- * export class AppComponent { }
38
- * ```
39
- */
40
- var TooltipSettings = /** @class */ (function () {
41
- function TooltipSettings() {
42
- }
43
- TooltipSettings = tslib_1.__decorate([
44
- core_1.Injectable()
45
- ], TooltipSettings);
46
- return TooltipSettings;
47
- }());
48
- exports.TooltipSettings = TooltipSettings;
@@ -1,59 +0,0 @@
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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var common_1 = require("@angular/common");
10
- var tooltip_directive_1 = require("./tooltip/tooltip.directive");
11
- var kendo_angular_popup_1 = require("@progress/kendo-angular-popup");
12
- var tooltip_content_component_1 = require("./tooltip/tooltip.content.component");
13
- var localized_messages_directive_1 = require("./localization/localized-messages.directive");
14
- var COMPONENT_DIRECTIVES = [tooltip_directive_1.TooltipDirective, tooltip_content_component_1.TooltipContentComponent, localized_messages_directive_1.LocalizedMessagesDirective];
15
- var COMPONENT_MODULES = [kendo_angular_popup_1.PopupModule];
16
- /**
17
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
18
- * definition for the Tooltip component.
19
- *
20
- * The package exports:
21
- * - `KendoTooltipDirective`&mdash;The Tooltip directive class.
22
- *
23
- * @example
24
- *
25
- * ```ts-no-run
26
- * // Import the Tooltip module
27
- * import { TooltipModule } from '@progress/kendo-angular-tooltip';
28
- *
29
- * // The browser platform with a compiler
30
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
31
- *
32
- * import { NgModule } from '@angular/core';
33
- *
34
- * // Import the app component
35
- * _@NgModule{{
36
- * declarations: [AppComponent], // declare app component
37
- * imports: [BrowserModule, TooltipModule], // import TooltipModule module
38
- * bootstrap: [AppComponent]
39
- * }}
40
- * export class AppModule {}
41
- *
42
- * // Compile and launch the module
43
- * platformBrowserDynamic().bootstrapModule(AppModule);
44
- * ```
45
- */
46
- var TooltipModule = /** @class */ (function () {
47
- function TooltipModule() {
48
- }
49
- TooltipModule = tslib_1.__decorate([
50
- core_1.NgModule({
51
- declarations: [COMPONENT_DIRECTIVES],
52
- entryComponents: [tooltip_content_component_1.TooltipContentComponent],
53
- imports: [common_1.CommonModule].concat(COMPONENT_MODULES),
54
- exports: [COMPONENT_DIRECTIVES]
55
- })
56
- ], TooltipModule);
57
- return TooltipModule;
58
- }());
59
- exports.TooltipModule = TooltipModule;
@@ -1,47 +0,0 @@
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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var tooltip_module_1 = require("./tooltip.module");
10
- var popover_module_1 = require("./popover.module");
11
- /**
12
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
13
- * definition for the Tooltips components.
14
- *
15
- * @example
16
- *
17
- * ```ts-no-run
18
- * import { TooltipsModule } from '@progress/kendo-angular-tooltip';
19
- *
20
- * // The browser platform with a compiler
21
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
22
- *
23
- * import { NgModule } from '@angular/core';
24
- *
25
- * // Import the app component
26
- * _@NgModule{{
27
- * declarations: [AppComponent], // declare app component
28
- * imports: [BrowserModule, TooltipsModule], // import TooltipsModule module
29
- * bootstrap: [AppComponent]
30
- * }}
31
- * export class AppModule {}
32
- *
33
- * // Compile and launch the module
34
- * platformBrowserDynamic().bootstrapModule(AppModule);
35
- * ```
36
- */
37
- var TooltipsModule = /** @class */ (function () {
38
- function TooltipsModule() {
39
- }
40
- TooltipsModule = tslib_1.__decorate([
41
- core_1.NgModule({
42
- exports: [tooltip_module_1.TooltipModule, popover_module_1.PopoverModule]
43
- })
44
- ], TooltipsModule);
45
- return TooltipsModule;
46
- }());
47
- exports.TooltipsModule = TooltipsModule;