@progress/kendo-angular-tooltip 3.0.2 → 3.1.0-dev.202201191059
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-tooltip.js +3 -3
- package/dist/cdn/main.js +2 -2
- package/dist/es/constants.d.ts +12 -0
- package/dist/es/constants.js +12 -0
- package/dist/es/index.d.ts +5 -3
- package/dist/es/index.js +3 -1
- package/dist/es/index.metadata.json +1 -1
- package/dist/es/localization/localized-messages.directive.d.ts +1 -1
- package/dist/es/localization/localized-messages.directive.js +1 -1
- package/dist/es/main.d.ts +17 -3
- package/dist/es/main.js +13 -2
- package/dist/es/models/animation.model.d.ts +9 -0
- package/dist/es/models/animation.model.js +4 -0
- package/dist/es/models/events.d.ts +78 -0
- package/dist/es/models/events.js +78 -0
- package/dist/es/models/functions.model.d.ts +17 -0
- package/dist/es/models/functions.model.js +4 -0
- package/dist/es/models/popover-show-option.type.d.ts +8 -0
- package/dist/es/models/popover-show-option.type.js +4 -0
- package/dist/es/models/position.type.d.ts +2 -2
- package/dist/es/models/position.type.js +1 -1
- package/dist/es/models/show.option.type.d.ts +1 -1
- package/dist/es/models/show.option.type.js +1 -1
- package/dist/es/package-metadata.d.ts +1 -1
- package/dist/es/package-metadata.js +2 -2
- package/dist/es/popover/anchor.directive.d.ts +44 -0
- package/dist/es/popover/anchor.directive.js +150 -0
- package/dist/es/popover/container.directive.d.ts +56 -0
- package/dist/es/popover/container.directive.js +176 -0
- package/dist/es/popover/directives-base.d.ts +87 -0
- package/dist/es/popover/directives-base.js +274 -0
- package/dist/es/popover/popover.component.d.ts +166 -0
- package/dist/es/popover/popover.component.js +300 -0
- package/dist/es/popover/popover.service.d.ts +30 -0
- package/dist/es/popover/popover.service.js +88 -0
- package/dist/es/popover/template-directives/actions-template.directive.d.ts +15 -0
- package/dist/es/popover/template-directives/actions-template.directive.js +26 -0
- package/dist/es/popover/template-directives/body-template.directive.d.ts +15 -0
- package/dist/es/popover/template-directives/body-template.directive.js +26 -0
- package/dist/es/popover/template-directives/title-template.directive.d.ts +15 -0
- package/dist/es/popover/template-directives/title-template.directive.js +26 -0
- package/dist/es/popover.module.d.ts +31 -0
- package/dist/es/popover.module.js +65 -0
- package/dist/es/tooltip/tooltip.content.component.d.ts +1 -1
- package/dist/es/tooltip/tooltip.content.component.js +1 -1
- package/dist/es/tooltip/tooltip.directive.d.ts +1 -1
- package/dist/es/tooltip/tooltip.directive.js +5 -5
- package/dist/es/tooltip/tooltip.settings.d.ts +1 -1
- package/dist/es/tooltip/tooltip.settings.js +1 -1
- package/dist/es/tooltip.module.d.ts +1 -1
- package/dist/es/tooltip.module.js +1 -1
- package/dist/es/tooltips.module.d.ts +32 -0
- package/dist/es/tooltips.module.js +45 -0
- package/dist/es/utils.d.ts +2 -2
- package/dist/es/utils.js +2 -2
- package/dist/es2015/constants.d.ts +12 -0
- package/dist/es2015/constants.js +12 -0
- package/dist/es2015/index.d.ts +3 -1
- package/dist/es2015/index.js +3 -1
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/localization/localized-messages.directive.d.ts +1 -1
- package/dist/es2015/localization/localized-messages.directive.js +1 -1
- package/dist/es2015/main.d.ts +17 -3
- package/dist/es2015/main.js +13 -2
- package/dist/es2015/models/animation.model.d.ts +9 -0
- package/dist/es2015/models/animation.model.js +4 -0
- package/dist/es2015/models/events.d.ts +78 -0
- package/dist/es2015/models/events.js +65 -0
- package/dist/es2015/models/functions.model.d.ts +17 -0
- package/dist/es2015/models/functions.model.js +4 -0
- package/dist/es2015/models/popover-show-option.type.d.ts +8 -0
- package/dist/es2015/models/popover-show-option.type.js +4 -0
- package/dist/es2015/models/position.type.d.ts +2 -2
- package/dist/es2015/models/position.type.js +1 -1
- package/dist/es2015/models/show.option.type.d.ts +1 -1
- package/dist/es2015/models/show.option.type.js +1 -1
- package/dist/es2015/package-metadata.d.ts +1 -1
- package/dist/es2015/package-metadata.js +2 -2
- package/dist/es2015/popover/anchor.directive.d.ts +44 -0
- package/dist/es2015/popover/anchor.directive.js +144 -0
- package/dist/es2015/popover/container.directive.d.ts +56 -0
- package/dist/es2015/popover/container.directive.js +171 -0
- package/dist/es2015/popover/directives-base.d.ts +87 -0
- package/dist/es2015/popover/directives-base.js +259 -0
- package/dist/es2015/popover/popover.component.d.ts +166 -0
- package/dist/es2015/popover/popover.component.js +304 -0
- package/dist/es2015/popover/popover.service.d.ts +30 -0
- package/dist/es2015/popover/popover.service.js +67 -0
- package/dist/es2015/popover/template-directives/actions-template.directive.d.ts +15 -0
- package/dist/es2015/popover/template-directives/actions-template.directive.js +25 -0
- package/dist/es2015/popover/template-directives/body-template.directive.d.ts +15 -0
- package/dist/es2015/popover/template-directives/body-template.directive.js +25 -0
- package/dist/es2015/popover/template-directives/title-template.directive.d.ts +15 -0
- package/dist/es2015/popover/template-directives/title-template.directive.js +25 -0
- package/dist/es2015/popover.module.d.ts +31 -0
- package/dist/es2015/popover.module.js +63 -0
- package/dist/es2015/tooltip/tooltip.content.component.d.ts +1 -1
- package/dist/es2015/tooltip/tooltip.content.component.js +1 -1
- package/dist/es2015/tooltip/tooltip.directive.d.ts +1 -1
- package/dist/es2015/tooltip/tooltip.directive.js +5 -5
- package/dist/es2015/tooltip/tooltip.settings.d.ts +1 -1
- package/dist/es2015/tooltip/tooltip.settings.js +1 -1
- package/dist/es2015/tooltip.module.d.ts +1 -1
- package/dist/es2015/tooltip.module.js +1 -1
- package/dist/es2015/tooltips.module.d.ts +32 -0
- package/dist/es2015/tooltips.module.js +42 -0
- package/dist/es2015/utils.d.ts +2 -2
- package/dist/es2015/utils.js +2 -2
- package/dist/fesm2015/index.js +1111 -10
- package/dist/fesm5/index.js +1169 -10
- package/dist/npm/constants.js +14 -0
- package/dist/npm/index.js +5 -1
- package/dist/npm/localization/localized-messages.directive.js +1 -1
- package/dist/npm/main.js +26 -3
- package/dist/npm/models/animation.model.js +6 -0
- package/dist/npm/models/events.js +80 -0
- package/dist/npm/models/functions.model.js +6 -0
- package/dist/npm/models/popover-show-option.type.js +6 -0
- package/dist/npm/models/position.type.js +1 -1
- package/dist/npm/models/show.option.type.js +1 -1
- package/dist/npm/package-metadata.js +2 -2
- package/dist/npm/popover/anchor.directive.js +152 -0
- package/dist/npm/popover/container.directive.js +178 -0
- package/dist/npm/popover/directives-base.js +276 -0
- package/dist/npm/popover/popover.component.js +302 -0
- package/dist/npm/popover/popover.service.js +90 -0
- package/dist/npm/popover/template-directives/actions-template.directive.js +28 -0
- package/dist/npm/popover/template-directives/body-template.directive.js +28 -0
- package/dist/npm/popover/template-directives/title-template.directive.js +28 -0
- package/dist/npm/popover.module.js +67 -0
- package/dist/npm/tooltip/tooltip.content.component.js +1 -1
- package/dist/npm/tooltip/tooltip.directive.js +4 -4
- package/dist/npm/tooltip/tooltip.settings.js +1 -1
- package/dist/npm/tooltip.module.js +1 -1
- package/dist/npm/tooltips.module.js +47 -0
- package/dist/npm/utils.js +3 -3
- package/dist/systemjs/kendo-angular-tooltip.js +2 -2
- package/package.json +24 -20
|
@@ -0,0 +1,259 @@
|
|
|
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 { ElementRef, Input, isDevMode } from "@angular/core";
|
|
7
|
+
import { take } from "rxjs/operators";
|
|
8
|
+
import { closest } from "@progress/kendo-angular-common";
|
|
9
|
+
import { ERRORS } from '../constants';
|
|
10
|
+
import { PopoverHideEvent, PopoverShowEvent, PopoverShownEvent, PopoverHiddenEvent } from "../models/events";
|
|
11
|
+
import { align, containsItem } from "../utils";
|
|
12
|
+
import { PopoverComponent } from "./popover.component";
|
|
13
|
+
import { Subscription } from "rxjs";
|
|
14
|
+
const validShowOptions = ['hover', 'click', 'none', 'focus'];
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export class PopoverDirectivesBase {
|
|
19
|
+
constructor(ngZone, popupService, renderer) {
|
|
20
|
+
this.ngZone = ngZone;
|
|
21
|
+
this.popupService = popupService;
|
|
22
|
+
this.renderer = renderer;
|
|
23
|
+
this.subs = new Subscription();
|
|
24
|
+
this._showOn = 'click';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Specifies the popover instance that will be rendered.
|
|
28
|
+
* Accepts a [`PopoverComponent`]({% slug api_tooltip_popovercomponent %}) instance or
|
|
29
|
+
* a [`PopoverFn`]({% slug api_tooltip_popoverfn %}) callback which returns a [`PopoverComponent`]({% slug api_tooltip_popovercomponent %}) instance
|
|
30
|
+
* depending on the current anchor element.
|
|
31
|
+
*
|
|
32
|
+
* [See example]({% slug templates_popover %}#toc-popovercallback)
|
|
33
|
+
*/
|
|
34
|
+
set popover(value) {
|
|
35
|
+
if (value instanceof PopoverComponent || typeof value === `function`) {
|
|
36
|
+
this._popover = value;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (isDevMode) {
|
|
40
|
+
throw new Error(ERRORS.popover);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
get popover() {
|
|
45
|
+
return this._popover;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The event on which the Popover will be shown
|
|
49
|
+
*
|
|
50
|
+
* The supported values are:
|
|
51
|
+
* - `click` (default) —The Popover will be shown when its `anchor` element is clicked.
|
|
52
|
+
* - `hover`—The Popover will be shown when its `anchor` element is hovered.
|
|
53
|
+
* - `focus`—The Popover will be shown when its `anchor` element is focused.
|
|
54
|
+
* - `none`—The Popover will not be shown on user interaction. It could be rendered via the Popover API methods.
|
|
55
|
+
*/
|
|
56
|
+
set showOn(value) {
|
|
57
|
+
if (isDevMode && !containsItem(validShowOptions, value)) {
|
|
58
|
+
throw new Error(ERRORS.showOn);
|
|
59
|
+
}
|
|
60
|
+
this._showOn = value;
|
|
61
|
+
}
|
|
62
|
+
get showOn() {
|
|
63
|
+
return this._showOn;
|
|
64
|
+
}
|
|
65
|
+
ngAfterViewInit() {
|
|
66
|
+
this.ngZone.runOutsideAngular(() => {
|
|
67
|
+
switch (this.showOn) {
|
|
68
|
+
case 'hover':
|
|
69
|
+
this.subscribeToEvents([{
|
|
70
|
+
name: 'mouseenter', handler: this.mouseenterHandler
|
|
71
|
+
}, {
|
|
72
|
+
name: 'mouseleave', handler: this.mouseleaveHandler
|
|
73
|
+
}]);
|
|
74
|
+
break;
|
|
75
|
+
case 'focus':
|
|
76
|
+
this.subscribeToEvents([{
|
|
77
|
+
name: 'focus', handler: this.focusHandler
|
|
78
|
+
}, {
|
|
79
|
+
name: 'blur', handler: this.blurHandler
|
|
80
|
+
}]);
|
|
81
|
+
break;
|
|
82
|
+
case 'click':
|
|
83
|
+
this.subscribeClick();
|
|
84
|
+
break;
|
|
85
|
+
default: /**/
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
ngOnDestroy() {
|
|
90
|
+
this.closePopup();
|
|
91
|
+
if (this.disposeHoverOverListener) {
|
|
92
|
+
this.disposeHoverOverListener();
|
|
93
|
+
}
|
|
94
|
+
if (this.disposeHoverOutListener) {
|
|
95
|
+
this.disposeHoverOutListener();
|
|
96
|
+
}
|
|
97
|
+
if (this.disposeClickListener) {
|
|
98
|
+
this.disposeClickListener();
|
|
99
|
+
}
|
|
100
|
+
if (this._focusInsideSub) {
|
|
101
|
+
this._focusInsideSub.unsubscribe();
|
|
102
|
+
}
|
|
103
|
+
if (this._hideSub) {
|
|
104
|
+
this._hideSub.unsubscribe();
|
|
105
|
+
}
|
|
106
|
+
if (this.subs) {
|
|
107
|
+
this.subs.unsubscribe();
|
|
108
|
+
}
|
|
109
|
+
if (this._popupOpenSub) {
|
|
110
|
+
this._popupOpenSub.unsubscribe();
|
|
111
|
+
}
|
|
112
|
+
if (this._popupCloseSub) {
|
|
113
|
+
this._popupCloseSub.unsubscribe();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Hides the Popover ([See example]({% slug programmaticcontrol_popover %})).
|
|
118
|
+
*/
|
|
119
|
+
hide() {
|
|
120
|
+
this.closePopup();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @hidden
|
|
124
|
+
*/
|
|
125
|
+
closePopup() {
|
|
126
|
+
if (this.popupRef) {
|
|
127
|
+
this.popupRef.close();
|
|
128
|
+
this.popupRef = null;
|
|
129
|
+
if (this.disposePopupHoverOutListener) {
|
|
130
|
+
this.disposePopupHoverOutListener();
|
|
131
|
+
}
|
|
132
|
+
if (this.disposePopupHoverInListener) {
|
|
133
|
+
this.disposePopupHoverInListener();
|
|
134
|
+
}
|
|
135
|
+
if (this.disposePopupFocusOutListener) {
|
|
136
|
+
this.disposePopupFocusOutListener();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @hidden
|
|
142
|
+
*/
|
|
143
|
+
openPopup(anchor) {
|
|
144
|
+
const _anchor = anchor instanceof ElementRef ? anchor.nativeElement : anchor;
|
|
145
|
+
const popoverComp = this.popover instanceof PopoverComponent ? this.popover : this.popover(_anchor);
|
|
146
|
+
const alignSettings = align(popoverComp.position, popoverComp.offset);
|
|
147
|
+
const anchorAlign = alignSettings.anchorAlign;
|
|
148
|
+
const popupAlign = alignSettings.popupAlign;
|
|
149
|
+
const popupMargin = alignSettings.popupMargin;
|
|
150
|
+
const _animation = popoverComp.animation;
|
|
151
|
+
this.ngZone.run(() => {
|
|
152
|
+
this.popupRef = this.popupService.open({
|
|
153
|
+
anchor: { nativeElement: _anchor },
|
|
154
|
+
animate: _animation,
|
|
155
|
+
content: PopoverComponent,
|
|
156
|
+
popupAlign,
|
|
157
|
+
anchorAlign,
|
|
158
|
+
margin: popupMargin,
|
|
159
|
+
popupClass: 'k-popup-transparent',
|
|
160
|
+
collision: { horizontal: 'fit', vertical: 'fit' }
|
|
161
|
+
});
|
|
162
|
+
const popoverInstance = this.popupRef.content.instance;
|
|
163
|
+
Object.assign(popoverInstance, popoverComp);
|
|
164
|
+
popoverInstance.anchor = anchor;
|
|
165
|
+
popoverInstance.contextData = popoverInstance.templateData(anchor);
|
|
166
|
+
popoverInstance.visible = true;
|
|
167
|
+
this.popupRef.content.changeDetectorRef.detectChanges();
|
|
168
|
+
this.monitorPopup();
|
|
169
|
+
this.initializeFinishingEvents(popoverComp, _anchor);
|
|
170
|
+
});
|
|
171
|
+
this.popupRef.popupAnchorViewportLeave
|
|
172
|
+
.pipe(take(1))
|
|
173
|
+
.subscribe(() => this.hide());
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* @hidden
|
|
177
|
+
*/
|
|
178
|
+
isPrevented(anchorElement, show) {
|
|
179
|
+
const popoverComp = this.popover instanceof PopoverComponent ? this.popover : this.popover(anchorElement);
|
|
180
|
+
let eventArgs;
|
|
181
|
+
eventArgs = this.initializeEvents(popoverComp, eventArgs, show, anchorElement);
|
|
182
|
+
return eventArgs.isDefaultPrevented();
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* @hidden
|
|
186
|
+
*/
|
|
187
|
+
monitorPopup() {
|
|
188
|
+
if (this.showOn === 'hover') {
|
|
189
|
+
this.ngZone.runOutsideAngular(() => {
|
|
190
|
+
const popup = this.popupRef.popupElement;
|
|
191
|
+
this.disposePopupHoverInListener = this.renderer.listen(popup, 'mouseenter', _ => {
|
|
192
|
+
this.ngZone.run(_ => this._popoverService.emitPopoverState(true));
|
|
193
|
+
});
|
|
194
|
+
this.disposePopupHoverOutListener = this.renderer.listen(popup, 'mouseleave', _ => {
|
|
195
|
+
this.ngZone.run(_ => this._popoverService.emitPopoverState(false));
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
if (this.showOn === 'focus') {
|
|
200
|
+
this.ngZone.runOutsideAngular(() => {
|
|
201
|
+
const popup = this.popupRef.popupElement;
|
|
202
|
+
this.disposePopupFocusOutListener = this.renderer.listen(popup, 'focusout', (e) => {
|
|
203
|
+
const isInsidePopover = closest(e.relatedTarget, (node) => node.classList && node.classList.contains('k-popover'));
|
|
204
|
+
if (!isInsidePopover) {
|
|
205
|
+
this.ngZone.run(_ => this._popoverService.emitFocusInsidePopover(false));
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* @hidden
|
|
213
|
+
*/
|
|
214
|
+
initializeEvents(popoverComp, eventArgs, show, anchorElement) {
|
|
215
|
+
if (show) {
|
|
216
|
+
this.ngZone.run(_ => {
|
|
217
|
+
eventArgs = new PopoverShowEvent(anchorElement);
|
|
218
|
+
if (!this.popupRef) {
|
|
219
|
+
popoverComp.show.emit(eventArgs);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
this.ngZone.run(_ => {
|
|
225
|
+
eventArgs = new PopoverHideEvent(anchorElement, this.popupRef);
|
|
226
|
+
if (this.popupRef) {
|
|
227
|
+
popoverComp.hide.emit(eventArgs);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return eventArgs;
|
|
232
|
+
}
|
|
233
|
+
initializeFinishingEvents(popoverComp, _anchor) {
|
|
234
|
+
if (!this._popupOpenSub) {
|
|
235
|
+
this.popupRef.popupOpen.subscribe(() => {
|
|
236
|
+
const eventArgs = new PopoverShownEvent(_anchor, this.popupRef);
|
|
237
|
+
popoverComp.shown.emit(eventArgs);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
if (!this._popupCloseSub) {
|
|
241
|
+
this.popupRef.popupClose.subscribe(() => {
|
|
242
|
+
this.ngZone.run(_ => {
|
|
243
|
+
const eventArgs = new PopoverHiddenEvent(_anchor);
|
|
244
|
+
popoverComp.hidden.emit(eventArgs);
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
tslib_1.__decorate([
|
|
251
|
+
Input(),
|
|
252
|
+
tslib_1.__metadata("design:type", Object),
|
|
253
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
254
|
+
], PopoverDirectivesBase.prototype, "popover", null);
|
|
255
|
+
tslib_1.__decorate([
|
|
256
|
+
Input(),
|
|
257
|
+
tslib_1.__metadata("design:type", String),
|
|
258
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
259
|
+
], PopoverDirectivesBase.prototype, "showOn", null);
|
|
@@ -0,0 +1,166 @@
|
|
|
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 { EventEmitter } from '@angular/core';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { Position } from '../models/position.type';
|
|
8
|
+
import { PopoverDataFn } from '../models/functions.model';
|
|
9
|
+
import { PopoverTitleTemplateDirective } from './template-directives/title-template.directive';
|
|
10
|
+
import { PopoverBodyTemplateDirective } from './template-directives/body-template.directive';
|
|
11
|
+
import { PopoverActionsTemplateDirective } from './template-directives/actions-template.directive';
|
|
12
|
+
import { PopoverHideEvent, PopoverShowEvent, PopoverShownEvent } from '../models/events';
|
|
13
|
+
import { PopoverAnimation } from '../models/animation.model';
|
|
14
|
+
/**
|
|
15
|
+
* Represents the [Kendo UI Popover component for Angular]({% slug overview_popover %}).
|
|
16
|
+
* Used to display additional information that is related to a target element.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts-no-run
|
|
20
|
+
* <kendo-popover>
|
|
21
|
+
* <ng-template kendoPopoverTitleTemplate>Foo Title</ng-template>
|
|
22
|
+
* <ng-template kendoPopoverBodyTemplate>Foo Body</ng-template>
|
|
23
|
+
* <ng-template kendoPopoverActionsTemplate>Foo Actions</ng-template>
|
|
24
|
+
* </kendo-popover>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class PopoverComponent {
|
|
28
|
+
private localization;
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
anchor: Element;
|
|
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
|
+
position: Position;
|
|
43
|
+
/**
|
|
44
|
+
* Specifies the distance from the Popover to its anchor element in pixels.
|
|
45
|
+
*
|
|
46
|
+
* @default `6`
|
|
47
|
+
*/
|
|
48
|
+
offset: number;
|
|
49
|
+
/**
|
|
50
|
+
* Determines the width of the popover. Numeric values are treated as pixels.
|
|
51
|
+
* @default 'auto'
|
|
52
|
+
*/
|
|
53
|
+
width: number | string;
|
|
54
|
+
/**
|
|
55
|
+
* Determines the height of the popover. Numeric values are treated as pixels.
|
|
56
|
+
* @default 'auto'
|
|
57
|
+
*/
|
|
58
|
+
height: number | string;
|
|
59
|
+
/**
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
direction: 'ltr' | 'rtl';
|
|
63
|
+
/**
|
|
64
|
+
* Specifies the main header text of the Popover.
|
|
65
|
+
*
|
|
66
|
+
* If a `titleTemplate` is provided it would take precedence over the title.
|
|
67
|
+
*/
|
|
68
|
+
title: string;
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
* Specifies the secondary header text of the Popover.
|
|
72
|
+
*
|
|
73
|
+
* If a `titleTemplate` is provided it would take precedence over the subtitle.
|
|
74
|
+
*/
|
|
75
|
+
subtitle: string;
|
|
76
|
+
/**
|
|
77
|
+
* Represents the text that will be rendered in the Popover body section.
|
|
78
|
+
*
|
|
79
|
+
* If a `bodyTemplate` is provided it would take precedence over this text.
|
|
80
|
+
*/
|
|
81
|
+
body: string;
|
|
82
|
+
/**
|
|
83
|
+
* Determines whether a callout will be rendered along the Popover. [See example]({% slug callout_popover %})
|
|
84
|
+
*
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
callout: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Enables and configures the Popover animation. [See example]({% slug animations_popover %})
|
|
90
|
+
*
|
|
91
|
+
* The possible options are:
|
|
92
|
+
*
|
|
93
|
+
* * `boolean`—Enables the default animation
|
|
94
|
+
* * `PopoverAnimation`—A configuration object which allows setting the `direction`, `duration` and `type` of the animation.
|
|
95
|
+
*
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
animation: PopoverAnimation;
|
|
99
|
+
/**
|
|
100
|
+
* Defines a callback function which returns custom data passed to the Popover templates.
|
|
101
|
+
* It exposes the current anchor element as an argument. [See example]({% slug templates_popover %}#toc-popoverdatacallback)
|
|
102
|
+
*/
|
|
103
|
+
templateData: PopoverDataFn;
|
|
104
|
+
/**
|
|
105
|
+
* @hidden
|
|
106
|
+
* Determines the visibility of the Popover.
|
|
107
|
+
*/
|
|
108
|
+
visible: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* @hidden
|
|
111
|
+
*/
|
|
112
|
+
readonly isHidden: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* @hidden
|
|
115
|
+
*/
|
|
116
|
+
readonly hasAttributeHidden: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Fires before the Popover is about to be shown ([see example]({% slug events_popover %})).
|
|
119
|
+
* The event is preventable. If canceled, the Popover will not be displayed. [See example]({% slug events_popover %})
|
|
120
|
+
*/
|
|
121
|
+
show: EventEmitter<PopoverShowEvent>;
|
|
122
|
+
/**
|
|
123
|
+
* Fires after the Popover has been shown and the animation has ended. [See example]({% slug events_popover %})
|
|
124
|
+
*/
|
|
125
|
+
shown: EventEmitter<PopoverShownEvent>;
|
|
126
|
+
/**
|
|
127
|
+
* Fires when the Popover is about to be hidden ([see example]({% slug events_popover %})).
|
|
128
|
+
* The event is preventable. If canceled, the Popover will remain visible.
|
|
129
|
+
*/
|
|
130
|
+
hide: EventEmitter<PopoverHideEvent>;
|
|
131
|
+
/**
|
|
132
|
+
* Fires after the Popover has been hidden and the animation has ended. [See example]({% slug events_popover %})
|
|
133
|
+
*/
|
|
134
|
+
hidden: EventEmitter<any>;
|
|
135
|
+
/**
|
|
136
|
+
* @hidden
|
|
137
|
+
*/
|
|
138
|
+
titleTemplate: PopoverTitleTemplateDirective;
|
|
139
|
+
/**
|
|
140
|
+
* @hidden
|
|
141
|
+
*/
|
|
142
|
+
bodyTemplate: PopoverBodyTemplateDirective;
|
|
143
|
+
/**
|
|
144
|
+
* @hidden
|
|
145
|
+
*/
|
|
146
|
+
actionsTemplate: PopoverActionsTemplateDirective;
|
|
147
|
+
/**
|
|
148
|
+
* @hidden
|
|
149
|
+
*/
|
|
150
|
+
contextData: any;
|
|
151
|
+
private _offset;
|
|
152
|
+
private _width;
|
|
153
|
+
private _height;
|
|
154
|
+
private subs;
|
|
155
|
+
constructor(localization: LocalizationService);
|
|
156
|
+
ngOnInit(): void;
|
|
157
|
+
ngOnDestroy(): void;
|
|
158
|
+
/**
|
|
159
|
+
* @hidden
|
|
160
|
+
*/
|
|
161
|
+
getCalloutPosition(): any;
|
|
162
|
+
/**
|
|
163
|
+
* @hidden
|
|
164
|
+
*/
|
|
165
|
+
private _templateData;
|
|
166
|
+
}
|