@progress/kendo-angular-tooltip 17.0.0-develop.3 → 17.0.0-develop.31
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/README.md +32 -32
- package/{esm2020 → esm2022}/localization/localized-messages.directive.mjs +13 -8
- package/{esm2020 → esm2022}/models/events.mjs +24 -0
- package/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/{esm2020 → esm2022}/popover/anchor.directive.mjs +46 -41
- package/{esm2020 → esm2022}/popover/container.directive.mjs +58 -46
- package/{esm2020 → esm2022}/popover/directives-base.mjs +31 -14
- package/{esm2020 → esm2022}/popover/popover.component.mjs +145 -86
- package/{esm2020 → esm2022}/popover/popover.service.mjs +12 -8
- package/{esm2020 → esm2022}/popover/template-directives/actions-template.directive.mjs +4 -3
- package/{esm2020 → esm2022}/popover/template-directives/body-template.directive.mjs +4 -3
- package/{esm2020 → esm2022}/popover/template-directives/title-template.directive.mjs +4 -3
- package/{esm2020 → esm2022}/popover.module.mjs +4 -4
- package/{esm2020 → esm2022}/tooltip/tooltip.content.component.mjs +66 -48
- package/{esm2020 → esm2022}/tooltip/tooltip.directive.mjs +116 -62
- package/{esm2020 → esm2022}/tooltip/tooltip.settings.mjs +40 -3
- package/{esm2020 → esm2022}/tooltip.module.mjs +4 -4
- package/{esm2020 → esm2022}/tooltips.module.mjs +4 -4
- package/{fesm2020 → fesm2022}/progress-kendo-angular-tooltip.mjs +579 -341
- package/localization/localized-messages.directive.d.ts +1 -1
- package/models/animation.model.d.ts +1 -1
- package/models/functions.model.d.ts +2 -2
- package/models/popover-show-option.type.d.ts +1 -1
- package/models/position.type.d.ts +1 -1
- package/models/show.option.type.d.ts +1 -1
- package/package.json +14 -20
- package/popover/container.directive.d.ts +1 -1
- package/popover/directives-base.d.ts +1 -1
- package/popover/popover.component.d.ts +1 -1
- package/tooltip/tooltip.content.component.d.ts +1 -1
- package/tooltip/tooltip.directive.d.ts +1 -1
- package/fesm2015/progress-kendo-angular-tooltip.mjs +0 -2312
- /package/{esm2020 → esm2022}/constants.mjs +0 -0
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/models/animation.model.mjs +0 -0
- /package/{esm2020 → esm2022}/models/functions.model.mjs +0 -0
- /package/{esm2020 → esm2022}/models/popover-show-option.type.mjs +0 -0
- /package/{esm2020 → esm2022}/models/position.type.mjs +0 -0
- /package/{esm2020 → esm2022}/models/show.option.type.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-tooltip.mjs +0 -0
- /package/{esm2020 → esm2022}/utils.mjs +0 -0
package/README.md
CHANGED
|
@@ -2,55 +2,55 @@
|
|
|
2
2
|
<img width="631" src="https://www.telerik.com/kendo-angular-ui/npm-banner.svg">
|
|
3
3
|
</a>
|
|
4
4
|
|
|
5
|
-
## Kendo UI for Angular Tooltips
|
|
5
|
+
## Kendo UI for Angular Tooltips Package (Tooltip and Popover Components)
|
|
6
6
|
|
|
7
|
-
>
|
|
8
|
-
> *
|
|
9
|
-
> * You will need to install a license key when adding the package to your project. For more information, please refer to the [Kendo UI for Angular My License page](https://www.telerik.com/kendo-angular-ui/my-license?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip).
|
|
10
|
-
> * To receive a license key, you need to either [purchase a license](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-angular-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip). Doing so indicates that you [accept the Kendo UI for Angular License Agreement](https://www.telerik.com/purchase/license-agreement/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip).
|
|
7
|
+
> * This package is part of [Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui)—a commercial library designed and built for developing business applications with Angular. Every UI component in the Kendo UI for Angular suite has been built from the ground-up specifically for Angular.
|
|
8
|
+
> * You must [install a license key](https://www.telerik.com/kendo-angular-ui/my-license) when adding the package to your project. To receive a license key, either [purchase a license](https://www.telerik.com/purchase/kendo-ui) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-angular-ui).
|
|
11
9
|
> * The 30-day free trial gives you access to all the Kendo UI for Angular components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Angular dev team!
|
|
12
10
|
>
|
|
13
|
-
> [Start using Kendo UI for Angular](https://www.telerik.com/download-login-v2-kendo-angular-ui
|
|
11
|
+
> [Start using Kendo UI for Angular](https://www.telerik.com/download-login-v2-kendo-angular-ui) and speed up your development process!
|
|
14
12
|
|
|
15
|
-
The [Kendo UI for Angular Tooltips
|
|
13
|
+
The [Kendo UI for Angular Tooltips](https://www.telerik.com/kendo-angular-ui/components/tooltips/) package contains two components, the Angular Tooltip and the Angular Popover. They both render popups with information related to UI elements and can be displayed when the element is focused or hovered over (or clicked in the Popover case). With tons of configuration options, they allow building custom tooltips in Angular.
|
|
16
14
|
|
|
17
|
-
## Angular
|
|
15
|
+
## What's Included in the Angular Tooltips Package
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
* [Angular Tooltip Component](https://www.telerik.com/kendo-angular-ui/components/tooltips/tooltip/)—Renders a customizable tooltip that can be used stand alone of with other Kendo UI for Angular components.
|
|
20
18
|
|
|
21
19
|
<img src="https://d585tldpucybw.cloudfront.net/sfimages/default-source/component-pages/angular/angular-tooltip-overview.jpg" alt="Component for creating custom tooltips in Angular">
|
|
22
20
|
|
|
23
|
-
* [
|
|
24
|
-
* [Programtic Opening](https://www.telerik.com/kendo-angular-ui/components/tooltips/tooltip/opening/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip)—The Tooltip provides options for consuming its API programmatically.
|
|
25
|
-
* [Closable](https://www.telerik.com/kendo-angular-ui/components/tooltips/tooltip/closable-tooltip/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip)—Optionally add a close button.
|
|
26
|
-
* [Positioning](https://www.telerik.com/kendo-angular-ui/components/tooltips/tooltip/positioning/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip)—Choose the position on the screen that the Tooltip appears.
|
|
27
|
-
* [Templates](https://www.telerik.com/kendo-angular-ui/components/tooltips/tooltip/templates/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip)—Provide your own layout and style templates for the Tooltop content.
|
|
21
|
+
* [Angular Popover Component](https://www.telerik.com/kendo-angular-ui/components/tooltips/popover/)—It is nearly identical to the Angular Tooltip component, except it is designed to display richer content and it can be opened via click. For example, it is possible to host a calendar or a grid in the Popover while the Tooltop is designed mostly for text.
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
<img src="https://d585tldpucybw.cloudfront.net/sfimages/default-source/component-pages/common/popover/popover_component_overview.jpg" alt="Angular Popover Example">
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
## Key Features
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
Among the many features which the Kendo UI for Angular Tooltips deliver are:
|
|
34
28
|
|
|
35
|
-
* [
|
|
36
|
-
* [
|
|
37
|
-
* [
|
|
38
|
-
* [
|
|
39
|
-
* [
|
|
29
|
+
* [Anchor Elements](https://www.telerik.com/kendo-angular-ui/components/tooltips/tooltip/anchor-elements/)—Specify which elements (anchors) will render the popup element.
|
|
30
|
+
* [Programmatic Control](https://www.telerik.com/kendo-angular-ui/components/tooltips/tooltip/opening/)—The Tooltips provide options for consuming the components' API programmatically.
|
|
31
|
+
* [Closable](https://www.telerik.com/kendo-angular-ui/components/tooltips/tooltip/closable-tooltip/)—Optionally add a close button.
|
|
32
|
+
* [Positioning](https://www.telerik.com/kendo-angular-ui/components/tooltips/popover/positioning/)—Choose the position on the screen that the Tooltips appear.
|
|
33
|
+
* [Templates](https://www.telerik.com/kendo-angular-ui/components/tooltips/popover/templates/)—Provide your own layout and style templates for the Tooltips content.
|
|
34
|
+
* [Accessibility](https://www.telerik.com/kendo-angular-ui/components/tooltips/popover/accessibility/)—The Tooltips are accessible for screen readers and supports WAI-ARIA attributes.
|
|
35
|
+
* [Keyboard Navigation](https://www.telerik.com/kendo-angular-ui/components/tooltips/popover/keyboard-navigation/)—The Tooltips support a number of keyboard shortcuts which allows users to accomplish various commands.
|
|
40
36
|
|
|
41
|
-
##
|
|
37
|
+
## Support Options
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
* [Demos, documentation, and component reference](https://www.telerik.com/kendo-angular-ui/components?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip)
|
|
45
|
-
* [Blogs](http://www.telerik.com/blogs/kendo-ui)
|
|
46
|
-
* [Kendo UI for Angular pricing and licensing](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-tooltip)
|
|
39
|
+
For any issues you might encounter while working with the Kendo UI for Angular Tooltips, you have the following support channels available:
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
* Industry-leading technical support—Kendo UI for Angular paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use the [dedicated Kendo UI for Angular support system](https://www.telerik.com/account/support-tickets).
|
|
42
|
+
* Product forums—The [Kendo UI for Angular forums](https://www.telerik.com/forums/kendo-angular-ui) are part of the free support you can get from the community and from the Kendo UI for Angular team.
|
|
43
|
+
* Feedback portal—The [Kendo UI for Angular feedback portal](https://feedback.telerik.com/kendo-angular-ui) is where you can request and vote for new features to be added.
|
|
44
|
+
|
|
45
|
+
## Resources
|
|
49
46
|
|
|
50
|
-
* [
|
|
51
|
-
* [
|
|
52
|
-
* [
|
|
53
|
-
* [
|
|
47
|
+
* [Getting Started with Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/getting-started)
|
|
48
|
+
* [Getting Started with the Kendo UI for Angular Tooltips](https://www.telerik.com/kendo-angular-ui/components/tooltips/installation/getting-started)
|
|
49
|
+
* [Tooltips Overview page](https://www.telerik.com/kendo-angular-ui/components/tooltips) and [Tooltips API reference](https://www.telerik.com/kendo-angular-ui/components/tooltips/api)
|
|
50
|
+
* [Kendo UI for Angular roadmap](https://www.telerik.com/kendo-angular-ui/roadmap)
|
|
51
|
+
* [Kendo UI for Angular Blog](https://www.telerik.com/blogs/tag/kendo-ui-for-angular)
|
|
52
|
+
* [Demos, documentation, and component reference](https://www.telerik.com/kendo-angular-ui/components)
|
|
53
|
+
* [Kendo UI for Angular pricing and licensing](https://www.telerik.com/purchase/kendo-ui)
|
|
54
54
|
|
|
55
55
|
*Copyright © 2024 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.*
|
|
56
56
|
|
|
@@ -10,19 +10,24 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
12
|
export class LocalizedMessagesDirective extends ComponentMessages {
|
|
13
|
+
service;
|
|
14
|
+
/**
|
|
15
|
+
* The title of the close button.
|
|
16
|
+
*/
|
|
17
|
+
closeTitle;
|
|
13
18
|
constructor(service) {
|
|
14
19
|
super();
|
|
15
20
|
this.service = service;
|
|
16
21
|
}
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
23
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LocalizedMessagesDirective, isStandalone: true, selector: "[kendoTooltipLocalizedMessages]", inputs: { closeTitle: "closeTitle" }, providers: [
|
|
24
|
+
{
|
|
25
|
+
provide: ComponentMessages,
|
|
26
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
27
|
+
}
|
|
28
|
+
], usesInheritance: true, ngImport: i0 });
|
|
17
29
|
}
|
|
18
|
-
|
|
19
|
-
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LocalizedMessagesDirective, isStandalone: true, selector: "[kendoTooltipLocalizedMessages]", inputs: { closeTitle: "closeTitle" }, providers: [
|
|
20
|
-
{
|
|
21
|
-
provide: ComponentMessages,
|
|
22
|
-
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
23
|
-
}
|
|
24
|
-
], usesInheritance: true, ngImport: i0 });
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
26
31
|
type: Directive,
|
|
27
32
|
args: [{
|
|
28
33
|
providers: [
|
|
@@ -8,6 +8,10 @@ import { PreventableEvent } from "@progress/kendo-angular-common";
|
|
|
8
8
|
* to be opened. If you cancel the event, the opening is prevented.
|
|
9
9
|
*/
|
|
10
10
|
export class PopoverShowEvent extends PreventableEvent {
|
|
11
|
+
/**
|
|
12
|
+
* The host element related to the popover.
|
|
13
|
+
*/
|
|
14
|
+
anchor;
|
|
11
15
|
/**
|
|
12
16
|
* @hidden
|
|
13
17
|
* Constructs the event arguments for the `show` event.
|
|
@@ -23,6 +27,14 @@ export class PopoverShowEvent extends PreventableEvent {
|
|
|
23
27
|
* to be closed. If you cancel the event, the popover stays open.
|
|
24
28
|
*/
|
|
25
29
|
export class PopoverHideEvent extends PreventableEvent {
|
|
30
|
+
/**
|
|
31
|
+
* The host element related to the popover.
|
|
32
|
+
*/
|
|
33
|
+
anchor;
|
|
34
|
+
/**
|
|
35
|
+
* The popover element.
|
|
36
|
+
*/
|
|
37
|
+
popover;
|
|
26
38
|
/**
|
|
27
39
|
* @hidden
|
|
28
40
|
* Constructs the event arguments for the `hide` event.
|
|
@@ -39,6 +51,14 @@ export class PopoverHideEvent extends PreventableEvent {
|
|
|
39
51
|
* Arguments for the `shown` event. The `shown` event fires after the popover has opened and its opening animation has finished.
|
|
40
52
|
*/
|
|
41
53
|
export class PopoverShownEvent {
|
|
54
|
+
/**
|
|
55
|
+
* The host element related to the popover.
|
|
56
|
+
*/
|
|
57
|
+
anchor;
|
|
58
|
+
/**
|
|
59
|
+
* The popover element.
|
|
60
|
+
*/
|
|
61
|
+
popover;
|
|
42
62
|
/**
|
|
43
63
|
* @hidden
|
|
44
64
|
* Constructs the event arguments for the `shown` event.
|
|
@@ -54,6 +74,10 @@ export class PopoverShownEvent {
|
|
|
54
74
|
* Arguments for the `hidden` event. The `hidden` event fires after the popover has closed and its closing animation has finished.
|
|
55
75
|
*/
|
|
56
76
|
export class PopoverHiddenEvent {
|
|
77
|
+
/**
|
|
78
|
+
* The host element related to the popover.
|
|
79
|
+
*/
|
|
80
|
+
anchor;
|
|
57
81
|
/**
|
|
58
82
|
* @hidden
|
|
59
83
|
* Constructs the event arguments for the `hidden` event.
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-tooltip',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
13
|
-
version: '17.0.0-develop.
|
|
12
|
+
publishDate: 1730478748,
|
|
13
|
+
version: '17.0.0-develop.31',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|
|
@@ -23,6 +23,11 @@ import * as i2 from "./popover.service";
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export class PopoverAnchorDirective extends PopoverDirectivesBase {
|
|
26
|
+
hostEl;
|
|
27
|
+
ngZone;
|
|
28
|
+
popupService;
|
|
29
|
+
renderer;
|
|
30
|
+
popoverService;
|
|
26
31
|
constructor(hostEl, ngZone, popupService, renderer, popoverService) {
|
|
27
32
|
super(ngZone, popupService, renderer);
|
|
28
33
|
this.hostEl = hostEl;
|
|
@@ -30,44 +35,6 @@ export class PopoverAnchorDirective extends PopoverDirectivesBase {
|
|
|
30
35
|
this.popupService = popupService;
|
|
31
36
|
this.renderer = renderer;
|
|
32
37
|
this.popoverService = popoverService;
|
|
33
|
-
this.mouseenterHandler = () => {
|
|
34
|
-
this.controlVisibility(this.hostEl.nativeElement, true);
|
|
35
|
-
};
|
|
36
|
-
this.mouseleaveHandler = () => {
|
|
37
|
-
if (this.isPrevented(this.hostEl.nativeElement, false)) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (!this._hideSub) {
|
|
41
|
-
this._hideSub = this.popoverService.hidePopover.subscribe((val) => {
|
|
42
|
-
const [isPopoverHovered, isAnchorHovered] = val;
|
|
43
|
-
if (!isPopoverHovered && !isAnchorHovered) {
|
|
44
|
-
this.hide();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
this.focusHandler = () => {
|
|
50
|
-
this.controlVisibility(this.hostEl.nativeElement, true);
|
|
51
|
-
};
|
|
52
|
-
this.blurHandler = (args) => {
|
|
53
|
-
const event = args.domEvent;
|
|
54
|
-
if (this.isPrevented(this.hostEl.nativeElement, false)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
// from anchor to popup focus check
|
|
58
|
-
const isFocusInside = !!closest(event.relatedTarget, (node) => node.classList && node.classList.contains('k-popover'));
|
|
59
|
-
if (!isFocusInside) {
|
|
60
|
-
this.hide();
|
|
61
|
-
}
|
|
62
|
-
if (!this._focusInsideSub) {
|
|
63
|
-
// inside popup focus check
|
|
64
|
-
this._focusInsideSub = this.popoverService.isFocusInsidePopover.pipe(filter(v => v !== null)).subscribe((val) => {
|
|
65
|
-
if (!val) {
|
|
66
|
-
this.hide();
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
38
|
this._popoverService = this.popoverService;
|
|
72
39
|
}
|
|
73
40
|
ngOnChanges(changes) {
|
|
@@ -124,6 +91,44 @@ export class PopoverAnchorDirective extends PopoverDirectivesBase {
|
|
|
124
91
|
this.onClick(e);
|
|
125
92
|
});
|
|
126
93
|
}
|
|
94
|
+
mouseenterHandler = () => {
|
|
95
|
+
this.controlVisibility(this.hostEl.nativeElement, true);
|
|
96
|
+
};
|
|
97
|
+
mouseleaveHandler = () => {
|
|
98
|
+
if (this.isPrevented(this.hostEl.nativeElement, false)) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!this._hideSub) {
|
|
102
|
+
this._hideSub = this.popoverService.hidePopover.subscribe((val) => {
|
|
103
|
+
const [isPopoverHovered, isAnchorHovered] = val;
|
|
104
|
+
if (!isPopoverHovered && !isAnchorHovered) {
|
|
105
|
+
this.hide();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
focusHandler = () => {
|
|
111
|
+
this.controlVisibility(this.hostEl.nativeElement, true);
|
|
112
|
+
};
|
|
113
|
+
blurHandler = (args) => {
|
|
114
|
+
const event = args.domEvent;
|
|
115
|
+
if (this.isPrevented(this.hostEl.nativeElement, false)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// from anchor to popup focus check
|
|
119
|
+
const isFocusInside = !!closest(event.relatedTarget, (node) => node.classList && node.classList.contains('k-popover'));
|
|
120
|
+
if (!isFocusInside) {
|
|
121
|
+
this.hide();
|
|
122
|
+
}
|
|
123
|
+
if (!this._focusInsideSub) {
|
|
124
|
+
// inside popup focus check
|
|
125
|
+
this._focusInsideSub = this.popoverService.isFocusInsidePopover.pipe(filter(v => v !== null)).subscribe((val) => {
|
|
126
|
+
if (!val) {
|
|
127
|
+
this.hide();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
127
132
|
/**
|
|
128
133
|
* @hidden
|
|
129
134
|
*/
|
|
@@ -153,10 +158,10 @@ export class PopoverAnchorDirective extends PopoverDirectivesBase {
|
|
|
153
158
|
this.hide();
|
|
154
159
|
}
|
|
155
160
|
}
|
|
161
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopoverAnchorDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.PopupService }, { token: i0.Renderer2 }, { token: i2.PopoverService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
162
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PopoverAnchorDirective, isStandalone: true, selector: "[kendoPopoverAnchor]", providers: [PopoverService], exportAs: ["kendoPopoverAnchor"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
156
163
|
}
|
|
157
|
-
|
|
158
|
-
PopoverAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: PopoverAnchorDirective, isStandalone: true, selector: "[kendoPopoverAnchor]", providers: [PopoverService], exportAs: ["kendoPopoverAnchor"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
|
|
159
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PopoverAnchorDirective, decorators: [{
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopoverAnchorDirective, decorators: [{
|
|
160
165
|
type: Directive,
|
|
161
166
|
args: [{
|
|
162
167
|
selector: '[kendoPopoverAnchor]',
|
|
@@ -27,6 +27,18 @@ import * as i2 from "./popover.service";
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export class PopoverContainerDirective extends PopoverDirectivesBase {
|
|
30
|
+
wrapperEl;
|
|
31
|
+
ngZone;
|
|
32
|
+
popupService;
|
|
33
|
+
renderer;
|
|
34
|
+
popoverService;
|
|
35
|
+
/**
|
|
36
|
+
* Specifies a selector for the elements that should display a popover.
|
|
37
|
+
*
|
|
38
|
+
* The possible values include any valid query selector.
|
|
39
|
+
* [See example](slug:configuration_popover#toc-popover-container)
|
|
40
|
+
*/
|
|
41
|
+
filter;
|
|
30
42
|
constructor(wrapperEl, ngZone, popupService, renderer, popoverService) {
|
|
31
43
|
super(ngZone, popupService, renderer);
|
|
32
44
|
this.wrapperEl = wrapperEl;
|
|
@@ -34,49 +46,6 @@ export class PopoverContainerDirective extends PopoverDirectivesBase {
|
|
|
34
46
|
this.popupService = popupService;
|
|
35
47
|
this.renderer = renderer;
|
|
36
48
|
this.popoverService = popoverService;
|
|
37
|
-
this.mouseenterHandler = (anchor) => {
|
|
38
|
-
this.controlVisibility(anchor, true);
|
|
39
|
-
};
|
|
40
|
-
this.mouseleaveHandler = (args) => {
|
|
41
|
-
const anchor = args.anchor;
|
|
42
|
-
if (this.isPrevented(anchor, false)) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (!this._hideSub) {
|
|
46
|
-
this._hideSub = this.popoverService.hidePopover.subscribe((val) => {
|
|
47
|
-
const [isPopoverHovered, , isOriginAnchor, currentAnchor] = val;
|
|
48
|
-
if (!isPopoverHovered && !isOriginAnchor) {
|
|
49
|
-
this.hide();
|
|
50
|
-
if (!isOriginAnchor && currentAnchor) {
|
|
51
|
-
this.show(currentAnchor);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
this.focusHandler = (anchor) => {
|
|
58
|
-
this.controlVisibility(anchor, true);
|
|
59
|
-
};
|
|
60
|
-
this.blurHandler = (args) => {
|
|
61
|
-
const anchor = args.anchor;
|
|
62
|
-
const event = args.domEvent;
|
|
63
|
-
if (this.isPrevented(anchor, false)) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
// from anchor to popup focus check
|
|
67
|
-
const isFocusInside = !!closest(event.relatedTarget, (node) => node.classList && node.classList.contains('k-popover'));
|
|
68
|
-
if (!isFocusInside) {
|
|
69
|
-
this.hide();
|
|
70
|
-
}
|
|
71
|
-
if (!this._focusInsideSub) {
|
|
72
|
-
// inside popup focus check
|
|
73
|
-
this._focusInsideSub = this.popoverService.isFocusInsidePopover.pipe(filter(v => v !== null)).subscribe((val) => {
|
|
74
|
-
if (!val && !isFocusInside) {
|
|
75
|
-
this.hide();
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
49
|
this._popoverService = this.popoverService;
|
|
81
50
|
}
|
|
82
51
|
/**
|
|
@@ -121,6 +90,49 @@ export class PopoverContainerDirective extends PopoverDirectivesBase {
|
|
|
121
90
|
this.clickHandler(filterElement, e);
|
|
122
91
|
});
|
|
123
92
|
}
|
|
93
|
+
mouseenterHandler = (anchor) => {
|
|
94
|
+
this.controlVisibility(anchor, true);
|
|
95
|
+
};
|
|
96
|
+
mouseleaveHandler = (args) => {
|
|
97
|
+
const anchor = args.anchor;
|
|
98
|
+
if (this.isPrevented(anchor, false)) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!this._hideSub) {
|
|
102
|
+
this._hideSub = this.popoverService.hidePopover.subscribe((val) => {
|
|
103
|
+
const [isPopoverHovered, , isOriginAnchor, currentAnchor] = val;
|
|
104
|
+
if (!isPopoverHovered && !isOriginAnchor) {
|
|
105
|
+
this.hide();
|
|
106
|
+
if (!isOriginAnchor && currentAnchor) {
|
|
107
|
+
this.show(currentAnchor);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
focusHandler = (anchor) => {
|
|
114
|
+
this.controlVisibility(anchor, true);
|
|
115
|
+
};
|
|
116
|
+
blurHandler = (args) => {
|
|
117
|
+
const anchor = args.anchor;
|
|
118
|
+
const event = args.domEvent;
|
|
119
|
+
if (this.isPrevented(anchor, false)) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
// from anchor to popup focus check
|
|
123
|
+
const isFocusInside = !!closest(event.relatedTarget, (node) => node.classList && node.classList.contains('k-popover'));
|
|
124
|
+
if (!isFocusInside) {
|
|
125
|
+
this.hide();
|
|
126
|
+
}
|
|
127
|
+
if (!this._focusInsideSub) {
|
|
128
|
+
// inside popup focus check
|
|
129
|
+
this._focusInsideSub = this.popoverService.isFocusInsidePopover.pipe(filter(v => v !== null)).subscribe((val) => {
|
|
130
|
+
if (!val && !isFocusInside) {
|
|
131
|
+
this.hide();
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
};
|
|
124
136
|
subscribeToShowEvents(arr) {
|
|
125
137
|
const filteredElements = Array.from(document.querySelectorAll(this.filter));
|
|
126
138
|
filteredElements.forEach((el) => {
|
|
@@ -164,10 +176,10 @@ export class PopoverContainerDirective extends PopoverDirectivesBase {
|
|
|
164
176
|
this.hide();
|
|
165
177
|
}
|
|
166
178
|
}
|
|
179
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopoverContainerDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.PopupService }, { token: i0.Renderer2 }, { token: i2.PopoverService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
180
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PopoverContainerDirective, isStandalone: true, selector: "[kendoPopoverContainer]", inputs: { filter: "filter" }, providers: [PopoverService], exportAs: ["kendoPopoverContainer"], usesInheritance: true, ngImport: i0 });
|
|
167
181
|
}
|
|
168
|
-
|
|
169
|
-
PopoverContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: PopoverContainerDirective, isStandalone: true, selector: "[kendoPopoverContainer]", inputs: { filter: "filter" }, providers: [PopoverService], exportAs: ["kendoPopoverContainer"], usesInheritance: true, ngImport: i0 });
|
|
170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PopoverContainerDirective, decorators: [{
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopoverContainerDirective, decorators: [{
|
|
171
183
|
type: Directive,
|
|
172
184
|
args: [{
|
|
173
185
|
selector: '[kendoPopoverContainer]',
|
|
@@ -19,17 +19,9 @@ const validShowOptions = ['hover', 'click', 'none', 'focus'];
|
|
|
19
19
|
* @hidden
|
|
20
20
|
*/
|
|
21
21
|
export class PopoverDirectivesBase {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.renderer = renderer;
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
this.anchor = null;
|
|
30
|
-
this.subs = new Subscription();
|
|
31
|
-
this._showOn = 'click';
|
|
32
|
-
}
|
|
22
|
+
ngZone;
|
|
23
|
+
popupService;
|
|
24
|
+
renderer;
|
|
33
25
|
/**
|
|
34
26
|
* Specifies the popover instance that will be rendered.
|
|
35
27
|
* Accepts a [`PopoverComponent`]({% slug api_tooltip_popovercomponent %}) instance or
|
|
@@ -69,6 +61,31 @@ export class PopoverDirectivesBase {
|
|
|
69
61
|
get showOn() {
|
|
70
62
|
return this._showOn;
|
|
71
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
anchor = null;
|
|
68
|
+
popupRef;
|
|
69
|
+
disposeHoverOverListener;
|
|
70
|
+
disposeHoverOutListener;
|
|
71
|
+
disposeClickListener;
|
|
72
|
+
disposePopupHoverOutListener;
|
|
73
|
+
disposePopupHoverInListener;
|
|
74
|
+
disposePopupFocusOutListener;
|
|
75
|
+
subs = new Subscription();
|
|
76
|
+
_popoverService;
|
|
77
|
+
_hideSub;
|
|
78
|
+
_focusInsideSub;
|
|
79
|
+
_popover;
|
|
80
|
+
_showOn = 'click';
|
|
81
|
+
_popupOpenSub;
|
|
82
|
+
_popupCloseSub;
|
|
83
|
+
_popupSubs;
|
|
84
|
+
constructor(ngZone, popupService, renderer) {
|
|
85
|
+
this.ngZone = ngZone;
|
|
86
|
+
this.popupService = popupService;
|
|
87
|
+
this.renderer = renderer;
|
|
88
|
+
}
|
|
72
89
|
ngAfterViewInit() {
|
|
73
90
|
if (!isDocumentAvailable()) {
|
|
74
91
|
return;
|
|
@@ -298,10 +315,10 @@ export class PopoverDirectivesBase {
|
|
|
298
315
|
}
|
|
299
316
|
return false;
|
|
300
317
|
}
|
|
318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopoverDirectivesBase, deps: [{ token: i0.NgZone }, { token: i1.PopupService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
319
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PopoverDirectivesBase, inputs: { popover: "popover", showOn: "showOn" }, ngImport: i0 });
|
|
301
320
|
}
|
|
302
|
-
|
|
303
|
-
PopoverDirectivesBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: PopoverDirectivesBase, inputs: { popover: "popover", showOn: "showOn" }, ngImport: i0 });
|
|
304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PopoverDirectivesBase, decorators: [{
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PopoverDirectivesBase, decorators: [{
|
|
305
322
|
type: Directive,
|
|
306
323
|
args: [{}]
|
|
307
324
|
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1.PopupService }, { type: i0.Renderer2 }]; }, propDecorators: { popover: [{
|