@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.
- package/bundles/kendo-angular-tooltip.umd.js +5 -0
- package/{dist/es/constants.d.ts → constants.d.ts} +0 -0
- package/{dist/es2015 → esm2015}/constants.js +0 -0
- package/{dist/es/models/functions.model.js → esm2015/kendo-angular-tooltip.js} +4 -0
- package/esm2015/localization/localized-messages.directive.js +38 -0
- package/{dist/es → esm2015}/main.js +2 -0
- package/{dist/es2015 → esm2015}/models/animation.model.js +1 -0
- package/{dist/es2015 → esm2015}/models/events.js +0 -0
- package/{dist/es2015 → esm2015}/models/functions.model.js +1 -0
- package/{dist/es → esm2015}/models/popover-show-option.type.js +1 -0
- package/{dist/es2015 → esm2015}/models/position.type.js +1 -0
- package/{dist/es → esm2015}/models/show.option.type.js +1 -0
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/es2015 → esm2015}/popover/anchor.directive.js +22 -19
- package/{dist/es2015 → esm2015}/popover/container.directive.js +24 -23
- package/{dist/es2015 → esm2015}/popover/directives-base.js +13 -12
- package/{dist/es2015 → esm2015}/popover/popover.component.js +118 -108
- package/{dist/es2015 → esm2015}/popover/popover.service.js +9 -9
- package/esm2015/popover/template-directives/actions-template.directive.js +27 -0
- package/esm2015/popover/template-directives/body-template.directive.js +27 -0
- package/esm2015/popover/template-directives/title-template.directive.js +27 -0
- package/{dist/es2015 → esm2015}/popover.module.js +31 -16
- package/{dist/es2015 → esm2015}/tooltip/tooltip.content.component.js +95 -73
- package/{dist/es2015 → esm2015}/tooltip/tooltip.directive.js +57 -80
- package/{dist/es2015 → esm2015}/tooltip/tooltip.settings.js +12 -7
- package/{dist/es2015 → esm2015}/tooltip.module.js +15 -12
- package/{dist/es2015 → esm2015}/tooltips.module.js +12 -9
- package/{dist/es2015 → esm2015}/utils.js +0 -1
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-tooltip.js} +456 -399
- package/{dist/es2015/constants.d.ts → kendo-angular-tooltip.d.ts} +3 -6
- package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
- package/{dist/es/main.d.ts → main.d.ts} +3 -0
- package/{dist/es/models → models}/animation.model.d.ts +0 -0
- package/{dist/es/models → models}/events.d.ts +0 -0
- package/{dist/es/models → models}/functions.model.d.ts +0 -0
- package/{dist/es/models → models}/popover-show-option.type.d.ts +0 -0
- package/{dist/es/models → models}/position.type.d.ts +0 -0
- package/{dist/es/models → models}/show.option.type.d.ts +0 -0
- package/{dist/es/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +34 -113
- package/{dist/es2015/popover → popover}/anchor.directive.d.ts +3 -0
- package/{dist/es/popover → popover}/container.directive.d.ts +3 -0
- package/{dist/es2015/popover → popover}/directives-base.d.ts +9 -4
- package/{dist/es2015/popover → popover}/popover.component.d.ts +21 -8
- package/{dist/es/popover → popover}/popover.service.d.ts +7 -4
- package/{dist/es2015/popover → popover}/template-directives/actions-template.directive.d.ts +3 -0
- package/{dist/es2015/popover → popover}/template-directives/body-template.directive.d.ts +3 -0
- package/{dist/es2015/popover → popover}/template-directives/title-template.directive.d.ts +3 -0
- package/popover.module.d.ts +43 -0
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/{dist/es/tooltip → tooltip}/tooltip.content.component.d.ts +7 -4
- package/{dist/es/tooltip → tooltip}/tooltip.directive.d.ts +5 -1
- package/{dist/es/tooltip → tooltip}/tooltip.settings.d.ts +7 -0
- package/{dist/es2015/tooltip.module.d.ts → tooltip.module.d.ts} +9 -0
- package/{dist/es2015/tooltips.module.d.ts → tooltips.module.d.ts} +6 -0
- package/{dist/es/utils.d.ts → utils.d.ts} +0 -0
- package/dist/cdn/js/kendo-angular-tooltip.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/constants.js +0 -12
- package/dist/es/index.d.ts +0 -12
- package/dist/es/index.js +0 -12
- package/dist/es/index.metadata.json +0 -1
- package/dist/es/localization/localized-messages.directive.d.ts +0 -16
- package/dist/es/localization/localized-messages.directive.js +0 -38
- package/dist/es/models/animation.model.js +0 -4
- package/dist/es/models/events.js +0 -78
- package/dist/es/models/position.type.js +0 -4
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/popover/anchor.directive.d.ts +0 -44
- package/dist/es/popover/anchor.directive.js +0 -156
- package/dist/es/popover/container.directive.js +0 -182
- package/dist/es/popover/directives-base.d.ts +0 -90
- package/dist/es/popover/directives-base.js +0 -294
- package/dist/es/popover/popover.component.d.ts +0 -166
- package/dist/es/popover/popover.component.js +0 -300
- package/dist/es/popover/popover.service.js +0 -88
- package/dist/es/popover/template-directives/actions-template.directive.d.ts +0 -15
- package/dist/es/popover/template-directives/actions-template.directive.js +0 -26
- package/dist/es/popover/template-directives/body-template.directive.d.ts +0 -15
- package/dist/es/popover/template-directives/body-template.directive.js +0 -26
- package/dist/es/popover/template-directives/title-template.directive.d.ts +0 -15
- package/dist/es/popover/template-directives/title-template.directive.js +0 -26
- package/dist/es/popover.module.d.ts +0 -31
- package/dist/es/popover.module.js +0 -65
- package/dist/es/tooltip/tooltip.content.component.js +0 -192
- package/dist/es/tooltip/tooltip.directive.js +0 -452
- package/dist/es/tooltip/tooltip.settings.js +0 -46
- package/dist/es/tooltip.module.d.ts +0 -36
- package/dist/es/tooltip.module.js +0 -57
- package/dist/es/tooltips.module.d.ts +0 -32
- package/dist/es/tooltips.module.js +0 -45
- package/dist/es/utils.js +0 -113
- package/dist/es2015/index.d.ts +0 -12
- package/dist/es2015/index.js +0 -12
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/localization/localized-messages.directive.js +0 -34
- package/dist/es2015/main.d.ts +0 -22
- package/dist/es2015/main.js +0 -18
- package/dist/es2015/models/animation.model.d.ts +0 -9
- package/dist/es2015/models/events.d.ts +0 -78
- package/dist/es2015/models/functions.model.d.ts +0 -17
- package/dist/es2015/models/popover-show-option.type.d.ts +0 -8
- package/dist/es2015/models/popover-show-option.type.js +0 -4
- package/dist/es2015/models/position.type.d.ts +0 -14
- package/dist/es2015/models/show.option.type.d.ts +0 -13
- package/dist/es2015/models/show.option.type.js +0 -4
- package/dist/es2015/package-metadata.d.ts +0 -9
- package/dist/es2015/popover/container.directive.d.ts +0 -56
- package/dist/es2015/popover/popover.service.d.ts +0 -30
- package/dist/es2015/popover/template-directives/actions-template.directive.js +0 -25
- package/dist/es2015/popover/template-directives/body-template.directive.js +0 -25
- package/dist/es2015/popover/template-directives/title-template.directive.js +0 -25
- package/dist/es2015/popover.module.d.ts +0 -31
- package/dist/es2015/tooltip/tooltip.content.component.d.ts +0 -41
- package/dist/es2015/tooltip/tooltip.directive.d.ts +0 -156
- package/dist/es2015/tooltip/tooltip.settings.d.ts +0 -72
- package/dist/es2015/utils.d.ts +0 -34
- package/dist/fesm5/index.js +0 -2071
- package/dist/npm/constants.js +0 -14
- package/dist/npm/index.js +0 -19
- package/dist/npm/localization/localized-messages.directive.js +0 -40
- package/dist/npm/main.js +0 -36
- package/dist/npm/models/animation.model.js +0 -6
- package/dist/npm/models/events.js +0 -80
- package/dist/npm/models/functions.model.js +0 -6
- package/dist/npm/models/popover-show-option.type.js +0 -6
- package/dist/npm/models/position.type.js +0 -6
- package/dist/npm/models/show.option.type.js +0 -6
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/popover/anchor.directive.js +0 -158
- package/dist/npm/popover/container.directive.js +0 -184
- package/dist/npm/popover/directives-base.js +0 -296
- package/dist/npm/popover/popover.component.js +0 -302
- package/dist/npm/popover/popover.service.js +0 -90
- package/dist/npm/popover/template-directives/actions-template.directive.js +0 -28
- package/dist/npm/popover/template-directives/body-template.directive.js +0 -28
- package/dist/npm/popover/template-directives/title-template.directive.js +0 -28
- package/dist/npm/popover.module.js +0 -67
- package/dist/npm/tooltip/tooltip.content.component.js +0 -194
- package/dist/npm/tooltip/tooltip.directive.js +0 -454
- package/dist/npm/tooltip/tooltip.settings.js +0 -48
- package/dist/npm/tooltip.module.js +0 -59
- package/dist/npm/tooltips.module.js +0 -47
- package/dist/npm/utils.js +0 -121
- package/dist/systemjs/kendo-angular-tooltip.js +0 -5
|
@@ -1,296 +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 kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
10
|
-
var constants_1 = require("../constants");
|
|
11
|
-
var events_1 = require("../models/events");
|
|
12
|
-
var utils_1 = require("../utils");
|
|
13
|
-
var popover_component_1 = require("./popover.component");
|
|
14
|
-
var rxjs_1 = require("rxjs");
|
|
15
|
-
var validShowOptions = ['hover', 'click', 'none', 'focus'];
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
var PopoverDirectivesBase = /** @class */ (function () {
|
|
20
|
-
function PopoverDirectivesBase(ngZone, popupService, renderer) {
|
|
21
|
-
this.ngZone = ngZone;
|
|
22
|
-
this.popupService = popupService;
|
|
23
|
-
this.renderer = renderer;
|
|
24
|
-
this.subs = new rxjs_1.Subscription();
|
|
25
|
-
this._showOn = 'click';
|
|
26
|
-
}
|
|
27
|
-
Object.defineProperty(PopoverDirectivesBase.prototype, "popover", {
|
|
28
|
-
get: function () {
|
|
29
|
-
return this._popover;
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* Specifies the popover instance that will be rendered.
|
|
33
|
-
* Accepts a [`PopoverComponent`]({% slug api_tooltip_popovercomponent %}) instance or
|
|
34
|
-
* a [`PopoverFn`]({% slug api_tooltip_popoverfn %}) callback which returns a [`PopoverComponent`]({% slug api_tooltip_popovercomponent %}) instance
|
|
35
|
-
* depending on the current anchor element.
|
|
36
|
-
*
|
|
37
|
-
* [See example]({% slug templates_popover %}#toc-popovercallback)
|
|
38
|
-
*/
|
|
39
|
-
set: function (value) {
|
|
40
|
-
if (value instanceof popover_component_1.PopoverComponent || typeof value === "function") {
|
|
41
|
-
this._popover = value;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
if (core_1.isDevMode) {
|
|
45
|
-
throw new Error(constants_1.ERRORS.popover);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
enumerable: true,
|
|
50
|
-
configurable: true
|
|
51
|
-
});
|
|
52
|
-
Object.defineProperty(PopoverDirectivesBase.prototype, "showOn", {
|
|
53
|
-
get: function () {
|
|
54
|
-
return this._showOn;
|
|
55
|
-
},
|
|
56
|
-
/**
|
|
57
|
-
* The event on which the Popover will be shown
|
|
58
|
-
*
|
|
59
|
-
* The supported values are:
|
|
60
|
-
* - `click` (default) —The Popover will be shown when its `anchor` element is clicked.
|
|
61
|
-
* - `hover`—The Popover will be shown when its `anchor` element is hovered.
|
|
62
|
-
* - `focus`—The Popover will be shown when its `anchor` element is focused.
|
|
63
|
-
* - `none`—The Popover will not be shown on user interaction. It could be rendered via the Popover API methods.
|
|
64
|
-
*/
|
|
65
|
-
set: function (value) {
|
|
66
|
-
if (core_1.isDevMode && !utils_1.containsItem(validShowOptions, value)) {
|
|
67
|
-
throw new Error(constants_1.ERRORS.showOn);
|
|
68
|
-
}
|
|
69
|
-
this._showOn = value;
|
|
70
|
-
},
|
|
71
|
-
enumerable: true,
|
|
72
|
-
configurable: true
|
|
73
|
-
});
|
|
74
|
-
PopoverDirectivesBase.prototype.ngAfterViewInit = function () {
|
|
75
|
-
var _this = this;
|
|
76
|
-
if (!kendo_angular_common_1.isDocumentAvailable()) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
this.ngZone.runOutsideAngular(function () {
|
|
80
|
-
switch (_this.showOn) {
|
|
81
|
-
case 'hover':
|
|
82
|
-
_this.subscribeToEvents([{
|
|
83
|
-
name: 'mouseenter', handler: _this.mouseenterHandler
|
|
84
|
-
}, {
|
|
85
|
-
name: 'mouseleave', handler: _this.mouseleaveHandler
|
|
86
|
-
}]);
|
|
87
|
-
break;
|
|
88
|
-
case 'focus':
|
|
89
|
-
_this.subscribeToEvents([{
|
|
90
|
-
name: 'focus', handler: _this.focusHandler
|
|
91
|
-
}, {
|
|
92
|
-
name: 'blur', handler: _this.blurHandler
|
|
93
|
-
}]);
|
|
94
|
-
break;
|
|
95
|
-
case 'click':
|
|
96
|
-
_this.subscribeClick();
|
|
97
|
-
break;
|
|
98
|
-
default:
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
PopoverDirectivesBase.prototype.ngOnDestroy = function () {
|
|
104
|
-
this.closePopup();
|
|
105
|
-
if (this.disposeHoverOverListener) {
|
|
106
|
-
this.disposeHoverOverListener();
|
|
107
|
-
}
|
|
108
|
-
if (this.disposeHoverOutListener) {
|
|
109
|
-
this.disposeHoverOutListener();
|
|
110
|
-
}
|
|
111
|
-
if (this.disposeClickListener) {
|
|
112
|
-
this.disposeClickListener();
|
|
113
|
-
}
|
|
114
|
-
if (this._focusInsideSub) {
|
|
115
|
-
this._focusInsideSub.unsubscribe();
|
|
116
|
-
}
|
|
117
|
-
if (this._hideSub) {
|
|
118
|
-
this._hideSub.unsubscribe();
|
|
119
|
-
}
|
|
120
|
-
if (this.subs) {
|
|
121
|
-
this.subs.unsubscribe();
|
|
122
|
-
}
|
|
123
|
-
if (this._popupOpenSub) {
|
|
124
|
-
this._popupOpenSub.unsubscribe();
|
|
125
|
-
}
|
|
126
|
-
if (this._popupCloseSub) {
|
|
127
|
-
this._popupCloseSub.unsubscribe();
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Hides the Popover ([See example]({% slug programmaticcontrol_popover %})).
|
|
132
|
-
*/
|
|
133
|
-
PopoverDirectivesBase.prototype.hide = function () {
|
|
134
|
-
this.closePopup();
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* @hidden
|
|
138
|
-
*/
|
|
139
|
-
PopoverDirectivesBase.prototype.closePopup = function () {
|
|
140
|
-
if (this.popupRef) {
|
|
141
|
-
this.popupRef.close();
|
|
142
|
-
this.popupRef = null;
|
|
143
|
-
if (this.disposePopupHoverOutListener) {
|
|
144
|
-
this.disposePopupHoverOutListener();
|
|
145
|
-
}
|
|
146
|
-
if (this.disposePopupHoverInListener) {
|
|
147
|
-
this.disposePopupHoverInListener();
|
|
148
|
-
}
|
|
149
|
-
if (this.disposePopupFocusOutListener) {
|
|
150
|
-
this.disposePopupFocusOutListener();
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* @hidden
|
|
156
|
-
*/
|
|
157
|
-
PopoverDirectivesBase.prototype.openPopup = function (anchor) {
|
|
158
|
-
var _anchor = anchor instanceof core_1.ElementRef ? anchor.nativeElement : anchor;
|
|
159
|
-
var popoverComp = this.popover instanceof popover_component_1.PopoverComponent ? this.popover : this.popover(_anchor);
|
|
160
|
-
var alignSettings = utils_1.align(popoverComp.position, popoverComp.offset);
|
|
161
|
-
var anchorAlign = alignSettings.anchorAlign;
|
|
162
|
-
var popupAlign = alignSettings.popupAlign;
|
|
163
|
-
var popupMargin = alignSettings.popupMargin;
|
|
164
|
-
var _animation = popoverComp.animation;
|
|
165
|
-
this.popupRef = this.popupService.open({
|
|
166
|
-
anchor: { nativeElement: _anchor },
|
|
167
|
-
animate: _animation,
|
|
168
|
-
content: popover_component_1.PopoverComponent,
|
|
169
|
-
popupAlign: popupAlign,
|
|
170
|
-
anchorAlign: anchorAlign,
|
|
171
|
-
margin: popupMargin,
|
|
172
|
-
popupClass: 'k-popup-transparent',
|
|
173
|
-
collision: { horizontal: 'fit', vertical: 'fit' }
|
|
174
|
-
});
|
|
175
|
-
this.applySettings(this.popupRef.content, popoverComp, anchor);
|
|
176
|
-
this.monitorPopup();
|
|
177
|
-
this.initializeCompletionEvents(popoverComp, _anchor);
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* @hidden
|
|
181
|
-
*/
|
|
182
|
-
PopoverDirectivesBase.prototype.isPrevented = function (anchorElement, show) {
|
|
183
|
-
var popoverComp = this.popover instanceof popover_component_1.PopoverComponent ? this.popover : this.popover(anchorElement);
|
|
184
|
-
var eventArgs;
|
|
185
|
-
eventArgs = this.initializeEvents(popoverComp, eventArgs, show, anchorElement);
|
|
186
|
-
return eventArgs.isDefaultPrevented();
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* @hidden
|
|
190
|
-
*/
|
|
191
|
-
PopoverDirectivesBase.prototype.monitorPopup = function () {
|
|
192
|
-
var _this = this;
|
|
193
|
-
if (this.showOn === 'hover') {
|
|
194
|
-
this.ngZone.runOutsideAngular(function () {
|
|
195
|
-
var popup = _this.popupRef.popupElement;
|
|
196
|
-
_this.disposePopupHoverInListener = _this.renderer.listen(popup, 'mouseenter', function (_) {
|
|
197
|
-
_this.ngZone.run(function (_) { return _this._popoverService.emitPopoverState(true); });
|
|
198
|
-
});
|
|
199
|
-
_this.disposePopupHoverOutListener = _this.renderer.listen(popup, 'mouseleave', function (_) {
|
|
200
|
-
_this.ngZone.run(function (_) { return _this._popoverService.emitPopoverState(false); });
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
if (this.showOn === 'focus') {
|
|
205
|
-
this.ngZone.runOutsideAngular(function () {
|
|
206
|
-
var popup = _this.popupRef.popupElement;
|
|
207
|
-
_this.disposePopupFocusOutListener = _this.renderer.listen(popup, 'focusout', function (e) {
|
|
208
|
-
var isInsidePopover = kendo_angular_common_1.closest(e.relatedTarget, function (node) { return node.classList && node.classList.contains('k-popover'); });
|
|
209
|
-
if (!isInsidePopover) {
|
|
210
|
-
_this.ngZone.run(function (_) { return _this._popoverService.emitFocusInsidePopover(false); });
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
PopoverDirectivesBase.prototype.applySettings = function (contentComponent, popover, anchor) {
|
|
217
|
-
var content = contentComponent.instance;
|
|
218
|
-
var _anchor = anchor instanceof core_1.ElementRef ? anchor.nativeElement : anchor;
|
|
219
|
-
content.visible = true;
|
|
220
|
-
content.anchor = _anchor;
|
|
221
|
-
content.position = popover.position;
|
|
222
|
-
content.offset = popover.offset;
|
|
223
|
-
content.width = popover.width;
|
|
224
|
-
content.height = popover.height;
|
|
225
|
-
content.title = popover.title;
|
|
226
|
-
content.body = popover.body;
|
|
227
|
-
content.callout = popover.callout;
|
|
228
|
-
content.animation = popover.animation;
|
|
229
|
-
content.contextData = popover.templateData(_anchor);
|
|
230
|
-
content.titleTemplate = popover.titleTemplate;
|
|
231
|
-
content.bodyTemplate = popover.bodyTemplate;
|
|
232
|
-
content.actionsTemplate = popover.actionsTemplate;
|
|
233
|
-
this.popupRef.content.changeDetectorRef.detectChanges();
|
|
234
|
-
};
|
|
235
|
-
/**
|
|
236
|
-
* @hidden
|
|
237
|
-
*/
|
|
238
|
-
PopoverDirectivesBase.prototype.initializeEvents = function (popoverComp, eventArgs, show, anchorElement) {
|
|
239
|
-
if (show) {
|
|
240
|
-
eventArgs = new events_1.PopoverShowEvent(anchorElement);
|
|
241
|
-
if (this.shouldEmitEvent(!!this.popupRef, 'show', popoverComp)) {
|
|
242
|
-
this.ngZone.run(function () { return popoverComp.show.emit(eventArgs); });
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
eventArgs = new events_1.PopoverHideEvent(anchorElement, this.popupRef);
|
|
247
|
-
if (this.shouldEmitEvent(!!this.popupRef, 'hide', popoverComp)) {
|
|
248
|
-
this.ngZone.run(function () { return popoverComp.hide.emit(eventArgs); });
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return eventArgs;
|
|
252
|
-
};
|
|
253
|
-
PopoverDirectivesBase.prototype.initializeCompletionEvents = function (popoverComp, _anchor) {
|
|
254
|
-
var _this = this;
|
|
255
|
-
if (this.shouldEmitCompletionEvents('shown', popoverComp)) {
|
|
256
|
-
this.popupRef.popupOpen.subscribe(function () {
|
|
257
|
-
var eventArgs = new events_1.PopoverShownEvent(_anchor, _this.popupRef);
|
|
258
|
-
popoverComp.shown.emit(eventArgs);
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
if (this.shouldEmitCompletionEvents('hidden', popoverComp)) {
|
|
262
|
-
this.popupRef.popupClose.subscribe(function () {
|
|
263
|
-
_this.ngZone.run(function (_) {
|
|
264
|
-
var eventArgs = new events_1.PopoverHiddenEvent(_anchor);
|
|
265
|
-
popoverComp.hidden.emit(eventArgs);
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
PopoverDirectivesBase.prototype.shouldEmitEvent = function (hasPopup, event, popoverComp) {
|
|
271
|
-
if ((event === 'show' && !hasPopup && kendo_angular_common_1.hasObservers(popoverComp[event]))
|
|
272
|
-
|| (event === 'hide' && hasPopup && kendo_angular_common_1.hasObservers(popoverComp[event]))) {
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
return false;
|
|
276
|
-
};
|
|
277
|
-
PopoverDirectivesBase.prototype.shouldEmitCompletionEvents = function (event, popoverComp) {
|
|
278
|
-
if ((kendo_angular_common_1.hasObservers(popoverComp[event]) && !this._popupOpenSub)
|
|
279
|
-
|| (kendo_angular_common_1.hasObservers(popoverComp[event]) && !this._popupCloseSub)) {
|
|
280
|
-
return true;
|
|
281
|
-
}
|
|
282
|
-
return false;
|
|
283
|
-
};
|
|
284
|
-
tslib_1.__decorate([
|
|
285
|
-
core_1.Input(),
|
|
286
|
-
tslib_1.__metadata("design:type", Object),
|
|
287
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
288
|
-
], PopoverDirectivesBase.prototype, "popover", null);
|
|
289
|
-
tslib_1.__decorate([
|
|
290
|
-
core_1.Input(),
|
|
291
|
-
tslib_1.__metadata("design:type", String),
|
|
292
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
293
|
-
], PopoverDirectivesBase.prototype, "showOn", null);
|
|
294
|
-
return PopoverDirectivesBase;
|
|
295
|
-
}());
|
|
296
|
-
exports.PopoverDirectivesBase = PopoverDirectivesBase;
|
|
@@ -1,302 +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 kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
10
|
-
var rxjs_1 = require("rxjs");
|
|
11
|
-
var kendo_licensing_1 = require("@progress/kendo-licensing");
|
|
12
|
-
var package_metadata_1 = require("../package-metadata");
|
|
13
|
-
var constants_1 = require("../constants");
|
|
14
|
-
var title_template_directive_1 = require("./template-directives/title-template.directive");
|
|
15
|
-
var body_template_directive_1 = require("./template-directives/body-template.directive");
|
|
16
|
-
var actions_template_directive_1 = require("./template-directives/actions-template.directive");
|
|
17
|
-
/**
|
|
18
|
-
* Represents the [Kendo UI Popover component for Angular]({% slug overview_popover %}).
|
|
19
|
-
* Used to display additional information that is related to a target element.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```ts-no-run
|
|
23
|
-
* <kendo-popover>
|
|
24
|
-
* <ng-template kendoPopoverTitleTemplate>Foo Title</ng-template>
|
|
25
|
-
* <ng-template kendoPopoverBodyTemplate>Foo Body</ng-template>
|
|
26
|
-
* <ng-template kendoPopoverActionsTemplate>Foo Actions</ng-template>
|
|
27
|
-
* </kendo-popover>
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
var PopoverComponent = /** @class */ (function () {
|
|
31
|
-
function PopoverComponent(localization) {
|
|
32
|
-
this.localization = localization;
|
|
33
|
-
/**
|
|
34
|
-
* Specifies the position of the Popover in relation to its anchor element. [See example]({% slug positioning_popover %})
|
|
35
|
-
*
|
|
36
|
-
* The possible options are:
|
|
37
|
-
* `top`
|
|
38
|
-
* `bottom`
|
|
39
|
-
* `right` (Default)
|
|
40
|
-
* `left`
|
|
41
|
-
*/
|
|
42
|
-
this.position = 'right';
|
|
43
|
-
/**
|
|
44
|
-
* Determines whether a callout will be rendered along the Popover. [See example]({% slug callout_popover %})
|
|
45
|
-
*
|
|
46
|
-
* @default true
|
|
47
|
-
*/
|
|
48
|
-
this.callout = true;
|
|
49
|
-
/**
|
|
50
|
-
* Enables and configures the Popover animation. [See example]({% slug animations_popover %})
|
|
51
|
-
*
|
|
52
|
-
* The possible options are:
|
|
53
|
-
*
|
|
54
|
-
* * `boolean`—Enables the default animation
|
|
55
|
-
* * `PopoverAnimation`—A configuration object which allows setting the `direction`, `duration` and `type` of the animation.
|
|
56
|
-
*
|
|
57
|
-
* @default false
|
|
58
|
-
*/
|
|
59
|
-
this.animation = false;
|
|
60
|
-
/**
|
|
61
|
-
* @hidden
|
|
62
|
-
* Determines the visibility of the Popover.
|
|
63
|
-
*/
|
|
64
|
-
this.visible = false;
|
|
65
|
-
/**
|
|
66
|
-
* Fires before the Popover is about to be shown ([see example]({% slug events_popover %})).
|
|
67
|
-
* The event is preventable. If canceled, the Popover will not be displayed. [See example]({% slug events_popover %})
|
|
68
|
-
*/
|
|
69
|
-
this.show = new core_1.EventEmitter();
|
|
70
|
-
/**
|
|
71
|
-
* Fires after the Popover has been shown and the animation has ended. [See example]({% slug events_popover %})
|
|
72
|
-
*/
|
|
73
|
-
this.shown = new core_1.EventEmitter();
|
|
74
|
-
/**
|
|
75
|
-
* Fires when the Popover is about to be hidden ([see example]({% slug events_popover %})).
|
|
76
|
-
* The event is preventable. If canceled, the Popover will remain visible.
|
|
77
|
-
*/
|
|
78
|
-
this.hide = new core_1.EventEmitter();
|
|
79
|
-
/**
|
|
80
|
-
* Fires after the Popover has been hidden and the animation has ended. [See example]({% slug events_popover %})
|
|
81
|
-
*/
|
|
82
|
-
this.hidden = new core_1.EventEmitter();
|
|
83
|
-
this._offset = 6;
|
|
84
|
-
this._width = 'auto';
|
|
85
|
-
this._height = 'auto';
|
|
86
|
-
this.subs = new rxjs_1.Subscription();
|
|
87
|
-
/**
|
|
88
|
-
* @hidden
|
|
89
|
-
*/
|
|
90
|
-
this._templateData = function () { return null; };
|
|
91
|
-
kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
|
|
92
|
-
}
|
|
93
|
-
Object.defineProperty(PopoverComponent.prototype, "offset", {
|
|
94
|
-
get: function () {
|
|
95
|
-
var calloutBuffer = 14;
|
|
96
|
-
return this.callout
|
|
97
|
-
? calloutBuffer + this._offset
|
|
98
|
-
: this._offset;
|
|
99
|
-
},
|
|
100
|
-
/**
|
|
101
|
-
* Specifies the distance from the Popover to its anchor element in pixels.
|
|
102
|
-
*
|
|
103
|
-
* @default `6`
|
|
104
|
-
*/
|
|
105
|
-
set: function (value) {
|
|
106
|
-
this._offset = value;
|
|
107
|
-
},
|
|
108
|
-
enumerable: true,
|
|
109
|
-
configurable: true
|
|
110
|
-
});
|
|
111
|
-
Object.defineProperty(PopoverComponent.prototype, "width", {
|
|
112
|
-
get: function () {
|
|
113
|
-
return this._width;
|
|
114
|
-
},
|
|
115
|
-
/**
|
|
116
|
-
* Determines the width of the popover. Numeric values are treated as pixels.
|
|
117
|
-
* @default 'auto'
|
|
118
|
-
*/
|
|
119
|
-
set: function (value) {
|
|
120
|
-
this._width = typeof value === 'number' ? value + "px" : value;
|
|
121
|
-
},
|
|
122
|
-
enumerable: true,
|
|
123
|
-
configurable: true
|
|
124
|
-
});
|
|
125
|
-
Object.defineProperty(PopoverComponent.prototype, "height", {
|
|
126
|
-
get: function () {
|
|
127
|
-
return this._height;
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* Determines the height of the popover. Numeric values are treated as pixels.
|
|
131
|
-
* @default 'auto'
|
|
132
|
-
*/
|
|
133
|
-
set: function (value) {
|
|
134
|
-
this._height = typeof value === 'number' ? value + "px" : value;
|
|
135
|
-
},
|
|
136
|
-
enumerable: true,
|
|
137
|
-
configurable: true
|
|
138
|
-
});
|
|
139
|
-
Object.defineProperty(PopoverComponent.prototype, "templateData", {
|
|
140
|
-
get: function () {
|
|
141
|
-
return this._templateData;
|
|
142
|
-
},
|
|
143
|
-
/**
|
|
144
|
-
* Defines a callback function which returns custom data passed to the Popover templates.
|
|
145
|
-
* It exposes the current anchor element as an argument. [See example]({% slug templates_popover %}#toc-popoverdatacallback)
|
|
146
|
-
*/
|
|
147
|
-
set: function (fn) {
|
|
148
|
-
if (core_1.isDevMode && typeof fn !== 'function') {
|
|
149
|
-
throw new Error(constants_1.ERRORS.templateData + " " + JSON.stringify(fn) + ".");
|
|
150
|
-
}
|
|
151
|
-
this._templateData = fn;
|
|
152
|
-
},
|
|
153
|
-
enumerable: true,
|
|
154
|
-
configurable: true
|
|
155
|
-
});
|
|
156
|
-
Object.defineProperty(PopoverComponent.prototype, "isHidden", {
|
|
157
|
-
/**
|
|
158
|
-
* @hidden
|
|
159
|
-
*/
|
|
160
|
-
get: function () {
|
|
161
|
-
return !this.visible;
|
|
162
|
-
},
|
|
163
|
-
enumerable: true,
|
|
164
|
-
configurable: true
|
|
165
|
-
});
|
|
166
|
-
Object.defineProperty(PopoverComponent.prototype, "hasAttributeHidden", {
|
|
167
|
-
/**
|
|
168
|
-
* @hidden
|
|
169
|
-
*/
|
|
170
|
-
get: function () {
|
|
171
|
-
return !this.visible;
|
|
172
|
-
},
|
|
173
|
-
enumerable: true,
|
|
174
|
-
configurable: true
|
|
175
|
-
});
|
|
176
|
-
PopoverComponent.prototype.ngOnInit = function () {
|
|
177
|
-
var _this = this;
|
|
178
|
-
this.subs.add(this.localization.changes.subscribe(function (_a) {
|
|
179
|
-
var rtl = _a.rtl;
|
|
180
|
-
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
181
|
-
}));
|
|
182
|
-
};
|
|
183
|
-
PopoverComponent.prototype.ngOnDestroy = function () {
|
|
184
|
-
this.subs.unsubscribe();
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* @hidden
|
|
188
|
-
*/
|
|
189
|
-
PopoverComponent.prototype.getCalloutPosition = function () {
|
|
190
|
-
switch (this.position) {
|
|
191
|
-
case 'top': return { 'k-callout-s': true };
|
|
192
|
-
case 'bottom': return { 'k-callout-n': true };
|
|
193
|
-
case 'left': return { 'k-callout-e': true };
|
|
194
|
-
case 'right': return { 'k-callout-w': true };
|
|
195
|
-
default: return { 'k-callout-s': true };
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
tslib_1.__decorate([
|
|
199
|
-
core_1.Input(),
|
|
200
|
-
tslib_1.__metadata("design:type", String)
|
|
201
|
-
], PopoverComponent.prototype, "position", void 0);
|
|
202
|
-
tslib_1.__decorate([
|
|
203
|
-
core_1.Input(),
|
|
204
|
-
tslib_1.__metadata("design:type", Number),
|
|
205
|
-
tslib_1.__metadata("design:paramtypes", [Number])
|
|
206
|
-
], PopoverComponent.prototype, "offset", null);
|
|
207
|
-
tslib_1.__decorate([
|
|
208
|
-
core_1.HostBinding('style.width'),
|
|
209
|
-
core_1.Input(),
|
|
210
|
-
tslib_1.__metadata("design:type", Object),
|
|
211
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
212
|
-
], PopoverComponent.prototype, "width", null);
|
|
213
|
-
tslib_1.__decorate([
|
|
214
|
-
core_1.HostBinding('style.height'),
|
|
215
|
-
core_1.Input(),
|
|
216
|
-
tslib_1.__metadata("design:type", Object),
|
|
217
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
218
|
-
], PopoverComponent.prototype, "height", null);
|
|
219
|
-
tslib_1.__decorate([
|
|
220
|
-
core_1.HostBinding('attr.dir'),
|
|
221
|
-
tslib_1.__metadata("design:type", String)
|
|
222
|
-
], PopoverComponent.prototype, "direction", void 0);
|
|
223
|
-
tslib_1.__decorate([
|
|
224
|
-
core_1.Input(),
|
|
225
|
-
tslib_1.__metadata("design:type", String)
|
|
226
|
-
], PopoverComponent.prototype, "title", void 0);
|
|
227
|
-
tslib_1.__decorate([
|
|
228
|
-
core_1.Input(),
|
|
229
|
-
tslib_1.__metadata("design:type", String)
|
|
230
|
-
], PopoverComponent.prototype, "subtitle", void 0);
|
|
231
|
-
tslib_1.__decorate([
|
|
232
|
-
core_1.Input(),
|
|
233
|
-
tslib_1.__metadata("design:type", String)
|
|
234
|
-
], PopoverComponent.prototype, "body", void 0);
|
|
235
|
-
tslib_1.__decorate([
|
|
236
|
-
core_1.Input(),
|
|
237
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
238
|
-
], PopoverComponent.prototype, "callout", void 0);
|
|
239
|
-
tslib_1.__decorate([
|
|
240
|
-
core_1.Input(),
|
|
241
|
-
tslib_1.__metadata("design:type", Object)
|
|
242
|
-
], PopoverComponent.prototype, "animation", void 0);
|
|
243
|
-
tslib_1.__decorate([
|
|
244
|
-
core_1.Input(),
|
|
245
|
-
tslib_1.__metadata("design:type", Function),
|
|
246
|
-
tslib_1.__metadata("design:paramtypes", [Function])
|
|
247
|
-
], PopoverComponent.prototype, "templateData", null);
|
|
248
|
-
tslib_1.__decorate([
|
|
249
|
-
core_1.HostBinding('class.k-hidden'),
|
|
250
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
251
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
252
|
-
], PopoverComponent.prototype, "isHidden", null);
|
|
253
|
-
tslib_1.__decorate([
|
|
254
|
-
core_1.HostBinding('attr.aria-hidden'),
|
|
255
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
256
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
257
|
-
], PopoverComponent.prototype, "hasAttributeHidden", null);
|
|
258
|
-
tslib_1.__decorate([
|
|
259
|
-
core_1.Output(),
|
|
260
|
-
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
261
|
-
], PopoverComponent.prototype, "show", void 0);
|
|
262
|
-
tslib_1.__decorate([
|
|
263
|
-
core_1.Output(),
|
|
264
|
-
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
265
|
-
], PopoverComponent.prototype, "shown", void 0);
|
|
266
|
-
tslib_1.__decorate([
|
|
267
|
-
core_1.Output(),
|
|
268
|
-
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
269
|
-
], PopoverComponent.prototype, "hide", void 0);
|
|
270
|
-
tslib_1.__decorate([
|
|
271
|
-
core_1.Output(),
|
|
272
|
-
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
273
|
-
], PopoverComponent.prototype, "hidden", void 0);
|
|
274
|
-
tslib_1.__decorate([
|
|
275
|
-
core_1.ContentChild(title_template_directive_1.PopoverTitleTemplateDirective, { static: false }),
|
|
276
|
-
tslib_1.__metadata("design:type", title_template_directive_1.PopoverTitleTemplateDirective)
|
|
277
|
-
], PopoverComponent.prototype, "titleTemplate", void 0);
|
|
278
|
-
tslib_1.__decorate([
|
|
279
|
-
core_1.ContentChild(body_template_directive_1.PopoverBodyTemplateDirective, { static: false }),
|
|
280
|
-
tslib_1.__metadata("design:type", body_template_directive_1.PopoverBodyTemplateDirective)
|
|
281
|
-
], PopoverComponent.prototype, "bodyTemplate", void 0);
|
|
282
|
-
tslib_1.__decorate([
|
|
283
|
-
core_1.ContentChild(actions_template_directive_1.PopoverActionsTemplateDirective, { static: false }),
|
|
284
|
-
tslib_1.__metadata("design:type", actions_template_directive_1.PopoverActionsTemplateDirective)
|
|
285
|
-
], PopoverComponent.prototype, "actionsTemplate", void 0);
|
|
286
|
-
PopoverComponent = tslib_1.__decorate([
|
|
287
|
-
core_1.Component({
|
|
288
|
-
selector: 'kendo-popover',
|
|
289
|
-
providers: [
|
|
290
|
-
kendo_angular_l10n_1.LocalizationService,
|
|
291
|
-
{
|
|
292
|
-
provide: kendo_angular_l10n_1.L10N_PREFIX,
|
|
293
|
-
useValue: 'kendo.popover'
|
|
294
|
-
}
|
|
295
|
-
],
|
|
296
|
-
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 "
|
|
297
|
-
}),
|
|
298
|
-
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
|
|
299
|
-
], PopoverComponent);
|
|
300
|
-
return PopoverComponent;
|
|
301
|
-
}());
|
|
302
|
-
exports.PopoverComponent = PopoverComponent;
|
|
@@ -1,90 +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 rxjs_1 = require("rxjs");
|
|
10
|
-
var operators_1 = require("rxjs/operators");
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
var PopoverService = /** @class */ (function () {
|
|
15
|
-
function PopoverService(ngZone) {
|
|
16
|
-
this.ngZone = ngZone;
|
|
17
|
-
this._pointerOverPopup = new rxjs_1.BehaviorSubject(null);
|
|
18
|
-
this._pointerOverAnchor = new rxjs_1.BehaviorSubject(null);
|
|
19
|
-
this._focusInsidePopover = new rxjs_1.BehaviorSubject(null);
|
|
20
|
-
this._hidePopover = new rxjs_1.Subject();
|
|
21
|
-
this.subs = new rxjs_1.Subscription();
|
|
22
|
-
this.monitor();
|
|
23
|
-
}
|
|
24
|
-
PopoverService.prototype.ngOnDestroy = function () {
|
|
25
|
-
this.subs.unsubscribe();
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(PopoverService.prototype, "isPopoverHovered", {
|
|
28
|
-
get: function () {
|
|
29
|
-
return this._pointerOverPopup.asObservable();
|
|
30
|
-
},
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true
|
|
33
|
-
});
|
|
34
|
-
PopoverService.prototype.emitPopoverState = function (isHovered) {
|
|
35
|
-
var _this = this;
|
|
36
|
-
this.ngZone.run(function (_) { return _this._pointerOverPopup.next(isHovered); });
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(PopoverService.prototype, "isAnchorHovered", {
|
|
39
|
-
get: function () {
|
|
40
|
-
return this._pointerOverAnchor.asObservable();
|
|
41
|
-
},
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true
|
|
44
|
-
});
|
|
45
|
-
PopoverService.prototype.emitAnchorState = function (isHovered, anchor) {
|
|
46
|
-
var _this = this;
|
|
47
|
-
this._isOrigin = this.originAnchor === anchor;
|
|
48
|
-
this.currentAnchor = anchor;
|
|
49
|
-
if (isHovered) {
|
|
50
|
-
this.originAnchor = anchor;
|
|
51
|
-
}
|
|
52
|
-
this.ngZone.run(function (_) { return _this._pointerOverAnchor.next(isHovered); });
|
|
53
|
-
};
|
|
54
|
-
Object.defineProperty(PopoverService.prototype, "isFocusInsidePopover", {
|
|
55
|
-
get: function () {
|
|
56
|
-
return this._focusInsidePopover.asObservable();
|
|
57
|
-
},
|
|
58
|
-
enumerable: true,
|
|
59
|
-
configurable: true
|
|
60
|
-
});
|
|
61
|
-
PopoverService.prototype.emitFocusInsidePopover = function (isFocused) {
|
|
62
|
-
var _this = this;
|
|
63
|
-
this.ngZone.run(function (_) { return _this._focusInsidePopover.next(isFocused); });
|
|
64
|
-
this._focusInsidePopover.next(null);
|
|
65
|
-
};
|
|
66
|
-
Object.defineProperty(PopoverService.prototype, "hidePopover", {
|
|
67
|
-
get: function () {
|
|
68
|
-
return this._hidePopover.asObservable();
|
|
69
|
-
},
|
|
70
|
-
enumerable: true,
|
|
71
|
-
configurable: true
|
|
72
|
-
});
|
|
73
|
-
PopoverService.prototype.monitor = function () {
|
|
74
|
-
var _this = this;
|
|
75
|
-
this.subs.add(rxjs_1.combineLatest(this.isPopoverHovered, this.isAnchorHovered).pipe(
|
|
76
|
-
// `auditTime` is used because the `mouseleave` event is emitted before `mouseenter`
|
|
77
|
-
// 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)
|
|
78
|
-
// resulting in both observables emitting `false`
|
|
79
|
-
operators_1.auditTime(20)).subscribe(function (val) {
|
|
80
|
-
var isPopoverHovered = val[0], isAnchorHovered = val[1];
|
|
81
|
-
_this._hidePopover.next([isPopoverHovered, isAnchorHovered, _this._isOrigin, _this.currentAnchor]);
|
|
82
|
-
}));
|
|
83
|
-
};
|
|
84
|
-
PopoverService = tslib_1.__decorate([
|
|
85
|
-
core_1.Injectable(),
|
|
86
|
-
tslib_1.__metadata("design:paramtypes", [core_1.NgZone])
|
|
87
|
-
], PopoverService);
|
|
88
|
-
return PopoverService;
|
|
89
|
-
}());
|
|
90
|
-
exports.PopoverService = PopoverService;
|