@progress/kendo-angular-map 0.1.1 → 0.2.0-dev.202206021322
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-map.umd.js +1 -1
- package/common/has-parent.d.ts +8 -0
- package/esm2015/common/has-parent.js +14 -0
- package/esm2015/main.js +2 -0
- package/esm2015/map.component.js +74 -4
- package/esm2015/map.directives.js +14 -4
- package/esm2015/map.module.js +16 -10
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/tooltip/base-tooltip.js +92 -0
- package/esm2015/tooltip/body-factory.js +14 -0
- package/esm2015/tooltip/bubble-tooltip-template.directive.js +31 -0
- package/esm2015/tooltip/marker-tooltip-template.directive.js +30 -0
- package/esm2015/tooltip/popup-settings.interface.js +5 -0
- package/esm2015/tooltip/shape-tooltip-template.directive.js +30 -0
- package/esm2015/tooltip/tooltip-popup.component.js +114 -0
- package/esm2015/tooltip/tooltip-template.service.js +16 -0
- package/esm2015/tooltip/tooltip.component.js +49 -0
- package/esm2015/tooltip.js +9 -0
- package/fesm2015/kendo-angular-map.js +419 -13
- package/main.d.ts +2 -0
- package/map.component.d.ts +22 -3
- package/map.directives.d.ts +6 -1
- package/map.module.d.ts +16 -10
- package/package.json +2 -2
- package/tooltip/base-tooltip.d.ts +31 -0
- package/tooltip/body-factory.d.ts +9 -0
- package/tooltip/bubble-tooltip-template.directive.d.ts +22 -0
- package/tooltip/marker-tooltip-template.directive.d.ts +21 -0
- package/tooltip/popup-settings.interface.d.ts +18 -0
- package/tooltip/shape-tooltip-template.directive.d.ts +21 -0
- package/tooltip/tooltip-popup.component.d.ts +37 -0
- package/tooltip/tooltip-template.service.d.ts +16 -0
- package/tooltip/tooltip.component.d.ts +31 -0
- package/tooltip.d.ts +9 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, Optional } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* A directive that sets a [template]({{ site.data.urls.angular['templatesyntax'] }})
|
|
9
|
+
* within the `<kendo-map-tooltip>` component for the Map
|
|
10
|
+
* [Shape layer tooltip]({% slug shape_layers_map %}#toc-tooltip).
|
|
11
|
+
*
|
|
12
|
+
* The available inputs for the shape tooltip template are:
|
|
13
|
+
* * `dataItem: any`—The original data item used to create the shape.
|
|
14
|
+
* * `location: Location`—The location of the center of the shape.
|
|
15
|
+
*/
|
|
16
|
+
export class ShapeTooltipTemplateDirective {
|
|
17
|
+
constructor(templateRef) {
|
|
18
|
+
this.templateRef = templateRef;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
ShapeTooltipTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShapeTooltipTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
22
|
+
ShapeTooltipTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ShapeTooltipTemplateDirective, selector: "[kendoMapShapeTooltipTemplate]", ngImport: i0 });
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShapeTooltipTemplateDirective, decorators: [{
|
|
24
|
+
type: Directive,
|
|
25
|
+
args: [{
|
|
26
|
+
selector: '[kendoMapShapeTooltipTemplate]'
|
|
27
|
+
}]
|
|
28
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
29
|
+
type: Optional
|
|
30
|
+
}] }]; } });
|
|
@@ -0,0 +1,114 @@
|
|
|
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 { Component, ViewChild, Input, Output, EventEmitter } from '@angular/core';
|
|
6
|
+
import { BaseTooltip } from './base-tooltip';
|
|
7
|
+
import { hasParent } from '../common/has-parent';
|
|
8
|
+
import { PopupService, POPUP_CONTAINER } from '@progress/kendo-angular-popup';
|
|
9
|
+
import { bodyFactory } from './body-factory';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@progress/kendo-angular-popup";
|
|
12
|
+
import * as i2 from "./tooltip-template.service";
|
|
13
|
+
import * as i3 from "@progress/kendo-angular-l10n";
|
|
14
|
+
import * as i4 from "@angular/common";
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export class TooltipPopupComponent extends BaseTooltip {
|
|
19
|
+
constructor(popupService, templateService, localizationService, ngZone) {
|
|
20
|
+
super(popupService, localizationService);
|
|
21
|
+
this.popupService = popupService;
|
|
22
|
+
this.templateService = templateService;
|
|
23
|
+
this.localizationService = localizationService;
|
|
24
|
+
this.ngZone = ngZone;
|
|
25
|
+
this.tooltipContext = {};
|
|
26
|
+
this.animate = true;
|
|
27
|
+
this.wrapperClass = 'k-tooltip-wrapper';
|
|
28
|
+
this.leave = new EventEmitter();
|
|
29
|
+
this.popupClasses = {};
|
|
30
|
+
}
|
|
31
|
+
show(e) {
|
|
32
|
+
this.tooltipTemplateRef = this.templateService[e.type + 'Template'];
|
|
33
|
+
if (!this.tooltipTemplateRef) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.popupClasses = Object.assign({
|
|
37
|
+
'k-tooltip': true,
|
|
38
|
+
'k-map-tooltip': true,
|
|
39
|
+
[e.className]: Boolean(e.className)
|
|
40
|
+
}, this.classNames);
|
|
41
|
+
this.tooltipContext = e;
|
|
42
|
+
super.show(e);
|
|
43
|
+
}
|
|
44
|
+
containsElement(element) {
|
|
45
|
+
if (this.popupRef) {
|
|
46
|
+
return hasParent(element, this.popupRef.popupElement);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
onInit() {
|
|
50
|
+
this.ngZone.runOutsideAngular(() => {
|
|
51
|
+
this.mouseleaveSubscription = this.popupRef.popupElement.addEventListener('mouseleave', (args) => {
|
|
52
|
+
this.leave.emit(args);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
this.popupRef.popupElement.classList.add(this.wrapperClass);
|
|
56
|
+
}
|
|
57
|
+
hide() {
|
|
58
|
+
if (this.mouseleaveSubscription) {
|
|
59
|
+
this.mouseleaveSubscription();
|
|
60
|
+
this.mouseleaveSubscription = null;
|
|
61
|
+
}
|
|
62
|
+
this.tooltipTemplateRef = null;
|
|
63
|
+
super.hide();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
TooltipPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipPopupComponent, deps: [{ token: i1.PopupService }, { token: i2.TooltipTemplateService }, { token: i3.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
+
TooltipPopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TooltipPopupComponent, selector: "kendo-map-tooltip-popup", inputs: { animate: "animate", classNames: "classNames", popupSettings: "popupSettings", wrapperClass: "wrapperClass" }, outputs: { leave: "leave" }, providers: [PopupService, {
|
|
68
|
+
provide: POPUP_CONTAINER,
|
|
69
|
+
useFactory: bodyFactory
|
|
70
|
+
}], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["content"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
71
|
+
<ng-template #content>
|
|
72
|
+
<div [ngClass]="popupClasses" [ngStyle]="style">
|
|
73
|
+
<div class="k-tooltip-content">
|
|
74
|
+
<ng-template [ngTemplateOutlet]="tooltipTemplateRef"
|
|
75
|
+
[ngTemplateOutletContext]="tooltipContext">
|
|
76
|
+
</ng-template>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</ng-template>
|
|
80
|
+
`, isInline: true, directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipPopupComponent, decorators: [{
|
|
82
|
+
type: Component,
|
|
83
|
+
args: [{
|
|
84
|
+
providers: [PopupService, {
|
|
85
|
+
provide: POPUP_CONTAINER,
|
|
86
|
+
useFactory: bodyFactory
|
|
87
|
+
}],
|
|
88
|
+
selector: 'kendo-map-tooltip-popup',
|
|
89
|
+
template: `
|
|
90
|
+
<ng-template #content>
|
|
91
|
+
<div [ngClass]="popupClasses" [ngStyle]="style">
|
|
92
|
+
<div class="k-tooltip-content">
|
|
93
|
+
<ng-template [ngTemplateOutlet]="tooltipTemplateRef"
|
|
94
|
+
[ngTemplateOutletContext]="tooltipContext">
|
|
95
|
+
</ng-template>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</ng-template>
|
|
99
|
+
`
|
|
100
|
+
}]
|
|
101
|
+
}], ctorParameters: function () { return [{ type: i1.PopupService }, { type: i2.TooltipTemplateService }, { type: i3.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { templateRef: [{
|
|
102
|
+
type: ViewChild,
|
|
103
|
+
args: ['content', { static: true }]
|
|
104
|
+
}], animate: [{
|
|
105
|
+
type: Input
|
|
106
|
+
}], classNames: [{
|
|
107
|
+
type: Input
|
|
108
|
+
}], popupSettings: [{
|
|
109
|
+
type: Input
|
|
110
|
+
}], wrapperClass: [{
|
|
111
|
+
type: Input
|
|
112
|
+
}], leave: [{
|
|
113
|
+
type: Output
|
|
114
|
+
}] } });
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { Injectable } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export class TooltipTemplateService {
|
|
11
|
+
}
|
|
12
|
+
TooltipTemplateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipTemplateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13
|
+
TooltipTemplateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipTemplateService });
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipTemplateService, decorators: [{
|
|
15
|
+
type: Injectable
|
|
16
|
+
}] });
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { Component, ContentChild, Input } from '@angular/core';
|
|
6
|
+
import { SettingsComponent } from '../common/settings.component';
|
|
7
|
+
import { BubbleTooltipTemplateDirective } from './bubble-tooltip-template.directive';
|
|
8
|
+
import { MarkerTooltipTemplateDirective } from './marker-tooltip-template.directive';
|
|
9
|
+
import { ShapeTooltipTemplateDirective } from './shape-tooltip-template.directive';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "../common/configuration.service";
|
|
12
|
+
import * as i2 from "./tooltip-template.service";
|
|
13
|
+
/**
|
|
14
|
+
* The configuration options of the Marker Layer tooltip.
|
|
15
|
+
*/
|
|
16
|
+
export class TooltipComponent extends SettingsComponent {
|
|
17
|
+
constructor(configurationService, templateService) {
|
|
18
|
+
super('tooltip', configurationService);
|
|
19
|
+
this.configurationService = configurationService;
|
|
20
|
+
this.templateService = templateService;
|
|
21
|
+
this.markAsVisible();
|
|
22
|
+
}
|
|
23
|
+
ngAfterContentChecked() {
|
|
24
|
+
var _a, _b, _c;
|
|
25
|
+
this.templateService.markerTemplate = (_a = this.markerTooltipTemplate) === null || _a === void 0 ? void 0 : _a.templateRef;
|
|
26
|
+
this.templateService.shapeTemplate = (_b = this.shapeTooltipTemplate) === null || _b === void 0 ? void 0 : _b.templateRef;
|
|
27
|
+
this.templateService.bubbleTemplate = (_c = this.bubbleTooltipTemplate) === null || _c === void 0 ? void 0 : _c.templateRef;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipComponent, deps: [{ token: i1.ConfigurationService }, { token: i2.TooltipTemplateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
+
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TooltipComponent, selector: "kendo-map-tooltip", inputs: { visible: "visible" }, queries: [{ propertyName: "markerTooltipTemplate", first: true, predicate: MarkerTooltipTemplateDirective, descendants: true }, { propertyName: "shapeTooltipTemplate", first: true, predicate: ShapeTooltipTemplateDirective, descendants: true }, { propertyName: "bubbleTooltipTemplate", first: true, predicate: BubbleTooltipTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{
|
|
35
|
+
selector: 'kendo-map-tooltip',
|
|
36
|
+
template: ''
|
|
37
|
+
}]
|
|
38
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigurationService }, { type: i2.TooltipTemplateService }]; }, propDecorators: { visible: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}], markerTooltipTemplate: [{
|
|
41
|
+
type: ContentChild,
|
|
42
|
+
args: [MarkerTooltipTemplateDirective, { static: false }]
|
|
43
|
+
}], shapeTooltipTemplate: [{
|
|
44
|
+
type: ContentChild,
|
|
45
|
+
args: [ShapeTooltipTemplateDirective, { static: false }]
|
|
46
|
+
}], bubbleTooltipTemplate: [{
|
|
47
|
+
type: ContentChild,
|
|
48
|
+
args: [BubbleTooltipTemplateDirective, { static: false }]
|
|
49
|
+
}] } });
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
export { BubbleTooltipTemplateDirective } from './tooltip/bubble-tooltip-template.directive';
|
|
6
|
+
export { MarkerTooltipTemplateDirective } from './tooltip/marker-tooltip-template.directive';
|
|
7
|
+
export { ShapeTooltipTemplateDirective } from './tooltip/shape-tooltip-template.directive';
|
|
8
|
+
export { TooltipComponent } from './tooltip/tooltip.component';
|
|
9
|
+
export { TooltipPopupComponent } from './tooltip/tooltip-popup.component';
|