@progress/kendo-angular-map 0.1.1 → 0.2.0-dev.202206170624

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/bundles/kendo-angular-map.umd.js +1 -1
  2. package/common/collection-item.component.d.ts +1 -0
  3. package/common/collection.service.d.ts +1 -0
  4. package/common/has-parent.d.ts +8 -0
  5. package/esm2015/common/collection-item.component.js +1 -0
  6. package/esm2015/common/collection.component.js +5 -1
  7. package/esm2015/common/has-parent.js +14 -0
  8. package/esm2015/main.js +2 -0
  9. package/esm2015/map.component.js +74 -4
  10. package/esm2015/map.directives.js +12 -4
  11. package/esm2015/map.module.js +18 -10
  12. package/esm2015/package-metadata.js +1 -1
  13. package/esm2015/tooltip/base-tooltip.js +90 -0
  14. package/esm2015/tooltip/body-factory.js +14 -0
  15. package/esm2015/tooltip/bubble-tooltip-template.directive.js +32 -0
  16. package/esm2015/tooltip/bubble-tooltip.component.js +38 -0
  17. package/esm2015/tooltip/marker-tooltip-template.directive.js +31 -0
  18. package/esm2015/tooltip/marker-tooltip.component.js +38 -0
  19. package/esm2015/tooltip/popup-settings.interface.js +5 -0
  20. package/esm2015/tooltip/shape-tooltip-template.directive.js +31 -0
  21. package/esm2015/tooltip/shape-tooltip.component.js +38 -0
  22. package/esm2015/tooltip/tooltip-popup.component.js +114 -0
  23. package/esm2015/tooltip/tooltip-template.service.js +29 -0
  24. package/esm2015/tooltip.js +11 -0
  25. package/fesm2015/kendo-angular-map.js +487 -14
  26. package/main.d.ts +2 -0
  27. package/map.component.d.ts +22 -3
  28. package/map.directives.d.ts +2 -1
  29. package/map.module.d.ts +18 -10
  30. package/package.json +7 -7
  31. package/tooltip/base-tooltip.d.ts +31 -0
  32. package/tooltip/body-factory.d.ts +9 -0
  33. package/tooltip/bubble-tooltip-template.directive.d.ts +23 -0
  34. package/tooltip/bubble-tooltip.component.d.ts +24 -0
  35. package/tooltip/marker-tooltip-template.directive.d.ts +22 -0
  36. package/tooltip/marker-tooltip.component.d.ts +24 -0
  37. package/tooltip/popup-settings.interface.d.ts +18 -0
  38. package/tooltip/shape-tooltip-template.directive.d.ts +22 -0
  39. package/tooltip/shape-tooltip.component.d.ts +24 -0
  40. package/tooltip/tooltip-popup.component.d.ts +37 -0
  41. package/tooltip/tooltip-template.service.d.ts +16 -0
  42. package/tooltip.d.ts +11 -0
@@ -3,10 +3,10 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
- import { Injectable, SimpleChange, Directive, TemplateRef, Component, ChangeDetectionStrategy, ContentChild, SecurityContext, Input, forwardRef, EventEmitter, Output, ViewChild, ContentChildren, NgModule } from '@angular/core';
6
+ import { Injectable, SimpleChange, Directive, TemplateRef, Component, ChangeDetectionStrategy, ContentChild, SecurityContext, Input, forwardRef, ElementRef, EventEmitter, ViewChild, Output, ContentChildren, Optional, NgModule } from '@angular/core';
7
7
  import { BehaviorSubject, Subject } from 'rxjs';
8
8
  import * as i3 from '@angular/platform-browser';
9
- import * as i4 from '@progress/kendo-angular-common';
9
+ import * as i5 from '@progress/kendo-angular-common';
10
10
  import { isDocumentAvailable, hasObservers, ResizeSensorModule } from '@progress/kendo-angular-common';
11
11
  import * as i3$1 from '@progress/kendo-angular-l10n';
12
12
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
@@ -14,7 +14,11 @@ import { InstanceObserver, Map } from '@progress/kendo-charts';
14
14
  export { Extent, Location } from '@progress/kendo-charts';
15
15
  import { validatePackage } from '@progress/kendo-licensing';
16
16
  import { tap } from 'rxjs/operators';
17
+ import * as i1 from '@progress/kendo-angular-popup';
18
+ import { PopupService, POPUP_CONTAINER } from '@progress/kendo-angular-popup';
19
+ import * as i4 from '@angular/common';
17
20
  import { CommonModule } from '@angular/common';
21
+ import { TooltipsModule } from '@progress/kendo-angular-tooltip';
18
22
 
19
23
  /**
20
24
  * @hidden
@@ -134,6 +138,7 @@ class CollectionItemComponent {
134
138
  constructor(configurationService, collectionService) {
135
139
  this.configurationService = configurationService;
136
140
  this.collectionService = collectionService;
141
+ this.index = -1;
137
142
  this.options = {};
138
143
  this.subscription = configurationService.changes.subscribe(store => {
139
144
  this.options = store;
@@ -349,6 +354,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
349
354
  type: Input
350
355
  }] } });
351
356
 
357
+ /**
358
+ * @hidden
359
+ */
360
+ function hasParent(element, parent) {
361
+ let current = element;
362
+ while (current && current !== parent) {
363
+ current = current.parentNode;
364
+ }
365
+ return current ? true : false;
366
+ }
367
+
352
368
  /**
353
369
  * @hidden
354
370
  */
@@ -674,11 +690,228 @@ const packageMetadata = {
674
690
  name: '@progress/kendo-angular-map',
675
691
  productName: 'Kendo UI for Angular',
676
692
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
677
- publishDate: 1651750442,
693
+ publishDate: 1655447052,
678
694
  version: '',
679
695
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
680
696
  };
681
697
 
698
+ const POSITION_MODE = 'absolute';
699
+ const COLLISION = { horizontal: "fit", vertical: "fit" };
700
+ /**
701
+ * @hidden
702
+ */
703
+ class BaseTooltip {
704
+ constructor(popupService, localizationService) {
705
+ this.popupService = popupService;
706
+ this.localizationService = localizationService;
707
+ this.animate = true;
708
+ this.style = {
709
+ position: 'relative'
710
+ };
711
+ this.popupRef = null;
712
+ }
713
+ get active() {
714
+ return this.popupRef !== null;
715
+ }
716
+ show(e) {
717
+ const offset = this.position(e.anchor);
718
+ if (!this.popupRef) {
719
+ this.popupRef = this.popupService.open(Object.assign({
720
+ offset: offset,
721
+ popupAlign: { vertical: 'bottom', horizontal: 'center' },
722
+ animate: this.animate,
723
+ content: this.templateRef,
724
+ collision: COLLISION,
725
+ positionMode: POSITION_MODE
726
+ }, this.popupSettings));
727
+ if (this.localizationService.rtl) {
728
+ this.popupRef.popupElement.setAttribute('dir', 'rtl');
729
+ }
730
+ this.onInit();
731
+ }
732
+ else {
733
+ const popup = this.popupRef.popup.instance;
734
+ popup.offset = offset;
735
+ }
736
+ }
737
+ hide() {
738
+ if (this.popupRef) {
739
+ this.popupRef.close();
740
+ this.popupRef = null;
741
+ }
742
+ }
743
+ onInit() {
744
+ }
745
+ ngOnDestroy() {
746
+ this.hide();
747
+ }
748
+ position(offset) {
749
+ if (!this.popupSettings || !this.popupSettings.appendTo) {
750
+ return offset;
751
+ }
752
+ const appendTo = this.popupSettings.appendTo.element.nativeElement;
753
+ const bbox = appendTo.getBoundingClientRect();
754
+ const { scrollLeft, scrollTop } = this.scrollOffset(appendTo);
755
+ return {
756
+ left: offset.left - bbox.left - scrollLeft,
757
+ top: offset.top - bbox.top - scrollTop
758
+ };
759
+ }
760
+ scrollOffset(element) {
761
+ if (!element) {
762
+ return null;
763
+ }
764
+ let scrollLeft = element.scrollLeft;
765
+ let scrollTop = element.scrollTop;
766
+ let parent = element.parentElement;
767
+ while (parent) {
768
+ scrollLeft += parent.scrollLeft;
769
+ scrollTop += parent.scrollTop;
770
+ parent = parent.parentElement;
771
+ }
772
+ return { scrollLeft, scrollTop };
773
+ }
774
+ }
775
+ BaseTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseTooltip, deps: [{ token: i1.PopupService }, { token: i3$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
776
+ BaseTooltip.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BaseTooltip, ngImport: i0 });
777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseTooltip, decorators: [{
778
+ type: Directive
779
+ }], ctorParameters: function () { return [{ type: i1.PopupService }, { type: i3$1.LocalizationService }]; } });
780
+
781
+ /**
782
+ * @hidden
783
+ */
784
+ function bodyFactory() {
785
+ if (isDocumentAvailable()) {
786
+ return new ElementRef(document.body);
787
+ }
788
+ }
789
+
790
+ /**
791
+ * @hidden
792
+ */
793
+ class TooltipTemplateService {
794
+ constructor() {
795
+ this.templates = [];
796
+ }
797
+ registerTemplate(layerIndex, template) {
798
+ if (layerIndex > -1) {
799
+ this.templates[layerIndex] = template;
800
+ }
801
+ }
802
+ getTemplate(layerIndex) {
803
+ if (layerIndex > -1) {
804
+ return this.templates[layerIndex];
805
+ }
806
+ }
807
+ }
808
+ TooltipTemplateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipTemplateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
809
+ TooltipTemplateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipTemplateService });
810
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipTemplateService, decorators: [{
811
+ type: Injectable
812
+ }] });
813
+
814
+ /**
815
+ * @hidden
816
+ */
817
+ class TooltipPopupComponent extends BaseTooltip {
818
+ constructor(popupService, templateService, localizationService, ngZone) {
819
+ super(popupService, localizationService);
820
+ this.popupService = popupService;
821
+ this.templateService = templateService;
822
+ this.localizationService = localizationService;
823
+ this.ngZone = ngZone;
824
+ this.tooltipContext = {};
825
+ this.animate = true;
826
+ this.wrapperClass = 'k-tooltip-wrapper';
827
+ this.leave = new EventEmitter();
828
+ this.popupClasses = {};
829
+ }
830
+ show(e) {
831
+ this.tooltipTemplateRef = this.templateService.getTemplate(e.layerIndex);
832
+ if (!this.tooltipTemplateRef) {
833
+ return;
834
+ }
835
+ this.popupClasses = Object.assign({
836
+ 'k-tooltip': true,
837
+ 'k-map-tooltip': true,
838
+ [e.className]: Boolean(e.className)
839
+ }, this.classNames);
840
+ this.tooltipContext = e;
841
+ super.show(e);
842
+ }
843
+ containsElement(element) {
844
+ if (this.popupRef) {
845
+ return hasParent(element, this.popupRef.popupElement);
846
+ }
847
+ }
848
+ onInit() {
849
+ this.ngZone.runOutsideAngular(() => {
850
+ this.mouseleaveSubscription = this.popupRef.popupElement.addEventListener('mouseleave', (args) => {
851
+ this.leave.emit(args);
852
+ });
853
+ });
854
+ this.popupRef.popupElement.classList.add(this.wrapperClass);
855
+ }
856
+ hide() {
857
+ if (this.mouseleaveSubscription) {
858
+ this.mouseleaveSubscription();
859
+ this.mouseleaveSubscription = null;
860
+ }
861
+ this.tooltipTemplateRef = null;
862
+ super.hide();
863
+ }
864
+ }
865
+ TooltipPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipPopupComponent, deps: [{ token: i1.PopupService }, { token: TooltipTemplateService }, { token: i3$1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
866
+ 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, {
867
+ provide: POPUP_CONTAINER,
868
+ useFactory: bodyFactory
869
+ }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["content"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
870
+ <ng-template #content>
871
+ <div [ngClass]="popupClasses" [ngStyle]="style">
872
+ <div class="k-tooltip-content">
873
+ <ng-template [ngTemplateOutlet]="tooltipTemplateRef"
874
+ [ngTemplateOutletContext]="tooltipContext">
875
+ </ng-template>
876
+ </div>
877
+ </div>
878
+ </ng-template>
879
+ `, 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"] }] });
880
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TooltipPopupComponent, decorators: [{
881
+ type: Component,
882
+ args: [{
883
+ providers: [PopupService, {
884
+ provide: POPUP_CONTAINER,
885
+ useFactory: bodyFactory
886
+ }],
887
+ selector: 'kendo-map-tooltip-popup',
888
+ template: `
889
+ <ng-template #content>
890
+ <div [ngClass]="popupClasses" [ngStyle]="style">
891
+ <div class="k-tooltip-content">
892
+ <ng-template [ngTemplateOutlet]="tooltipTemplateRef"
893
+ [ngTemplateOutletContext]="tooltipContext">
894
+ </ng-template>
895
+ </div>
896
+ </div>
897
+ </ng-template>
898
+ `
899
+ }]
900
+ }], ctorParameters: function () { return [{ type: i1.PopupService }, { type: TooltipTemplateService }, { type: i3$1.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { templateRef: [{
901
+ type: ViewChild,
902
+ args: ['content', { static: true }]
903
+ }], animate: [{
904
+ type: Input
905
+ }], classNames: [{
906
+ type: Input
907
+ }], popupSettings: [{
908
+ type: Input
909
+ }], wrapperClass: [{
910
+ type: Input
911
+ }], leave: [{
912
+ type: Output
913
+ }] } });
914
+
682
915
  /**
683
916
  * A sample component
684
917
  */
@@ -803,6 +1036,14 @@ class MapComponent {
803
1036
  validatePackage(packageMetadata);
804
1037
  }
805
1038
  ngAfterViewInit() {
1039
+ if (this.canRender) {
1040
+ this.ngZone.runOutsideAngular(() => {
1041
+ const mapMouseleave = this.renderer.listen(this.surfaceElement.nativeElement, 'mouseleave', this.mapMouseleave.bind(this));
1042
+ this.domSubscriptions = () => {
1043
+ mapMouseleave();
1044
+ };
1045
+ });
1046
+ }
806
1047
  this.setDirection();
807
1048
  this.initConfig();
808
1049
  this.subscriptions = this.localizationService.changes.subscribe(() => this.setDirection());
@@ -823,6 +1064,23 @@ class MapComponent {
823
1064
  store.popupSettings = null;
824
1065
  this.configurationService.push(store);
825
1066
  }
1067
+ ngOnDestroy() {
1068
+ this.destroyed = true;
1069
+ if (this.optionsChange) {
1070
+ this.optionsChange.unsubscribe();
1071
+ }
1072
+ if (this.domSubscriptions) {
1073
+ this.domSubscriptions();
1074
+ this.domSubscriptions = null;
1075
+ }
1076
+ if (this.instance) {
1077
+ this.instance.destroy();
1078
+ this.instance = null;
1079
+ }
1080
+ if (this.subscriptions) {
1081
+ this.subscriptions.unsubscribe();
1082
+ }
1083
+ }
826
1084
  /**
827
1085
  * Detects the size of the container and redraws the Map.
828
1086
  * Resizing is automatic unless you set the `resizeRateLimit` option to `0`.
@@ -924,20 +1182,53 @@ class MapComponent {
924
1182
  get isRTL() {
925
1183
  return Boolean(this.localizationService.rtl);
926
1184
  }
1185
+ onShowTooltip(e) {
1186
+ this.run(() => {
1187
+ this.tooltipInstance.show(e);
1188
+ }, true, true);
1189
+ }
1190
+ onHideTooltip() {
1191
+ this.run(() => {
1192
+ this.tooltipInstance.hide();
1193
+ }, true, true);
1194
+ }
1195
+ /**
1196
+ * @hidden
1197
+ */
1198
+ tooltipMouseleave(e) {
1199
+ const relatedTarget = e.relatedTarget;
1200
+ const chartElement = this.element.nativeElement;
1201
+ if (this.instance && (!relatedTarget || !hasParent(relatedTarget, chartElement))) {
1202
+ this.tooltipInstance.hide();
1203
+ }
1204
+ }
1205
+ /**
1206
+ * @hidden
1207
+ */
1208
+ mapMouseleave(e) {
1209
+ const relatedTarget = e.relatedTarget;
1210
+ const chartElement = this.element.nativeElement;
1211
+ if (this.instance && (!relatedTarget || !(this.tooltipInstance.containsElement(relatedTarget) || hasParent(relatedTarget, chartElement)))) {
1212
+ this.tooltipInstance.hide();
1213
+ }
1214
+ }
927
1215
  }
928
1216
  MapComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapComponent, deps: [{ token: ConfigurationService }, { token: InstanceEventService }, { token: i0.ElementRef }, { token: i3$1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
929
- MapComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MapComponent, selector: "kendo-map", inputs: { resizeRateLimit: "resizeRateLimit", center: "center", controls: "controls", minZoom: "minZoom", maxZoom: "maxZoom", minSize: "minSize", pannable: "pannable", wraparound: "wraparound", zoom: "zoom", zoomable: "zoomable" }, outputs: { beforeReset: "beforeReset", mapClick: "mapClick", markerActivate: "markerActivate", markerClick: "markerClick", markerCreated: "markerCreated", panEnd: "panEnd", pan: "pan", reset: "reset", shapeClick: "shapeClick", shapeCreated: "shapeCreated", shapeFeatureCreated: "shapeFeatureCreated", shapeMouseEnter: "shapeMouseEnter", shapeMouseLeave: "shapeMouseLeave", zoomStart: "zoomStart", zoomEnd: "zoomEnd" }, providers: [
1217
+ MapComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MapComponent, selector: "kendo-map", inputs: { resizeRateLimit: "resizeRateLimit", center: "center", controls: "controls", minZoom: "minZoom", maxZoom: "maxZoom", minSize: "minSize", pannable: "pannable", popupSettings: "popupSettings", wraparound: "wraparound", zoom: "zoom", zoomable: "zoomable" }, outputs: { beforeReset: "beforeReset", mapClick: "mapClick", markerActivate: "markerActivate", markerClick: "markerClick", markerCreated: "markerCreated", panEnd: "panEnd", pan: "pan", reset: "reset", shapeClick: "shapeClick", shapeCreated: "shapeCreated", shapeFeatureCreated: "shapeFeatureCreated", shapeMouseEnter: "shapeMouseEnter", shapeMouseLeave: "shapeMouseLeave", zoomStart: "zoomStart", zoomEnd: "zoomEnd" }, providers: [
930
1218
  ConfigurationService,
931
1219
  InstanceEventService,
932
1220
  LocalizationService,
1221
+ TooltipTemplateService,
933
1222
  {
934
1223
  provide: L10N_PREFIX,
935
1224
  useValue: 'kendo.map'
936
1225
  }
937
- ], viewQueries: [{ propertyName: "surfaceElement", first: true, predicate: ["surface"], descendants: true, static: true }], exportAs: ["kendoChart"], usesOnChanges: true, ngImport: i0, template: `
1226
+ ], viewQueries: [{ propertyName: "surfaceElement", first: true, predicate: ["surface"], descendants: true, static: true }, { propertyName: "tooltipInstance", first: true, predicate: TooltipPopupComponent, descendants: true, static: true }], exportAs: ["kendoChart"], usesOnChanges: true, ngImport: i0, template: `
938
1227
  <div #surface></div>
1228
+ <kendo-map-tooltip-popup (leave)="tooltipMouseleave($event)" [popupSettings]="popupSettings">
1229
+ </kendo-map-tooltip-popup>
939
1230
  <kendo-resize-sensor (resize)="onResize()" [rateLimit]="resizeRateLimit"></kendo-resize-sensor>
940
- `, isInline: true, components: [{ type: i4.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1231
+ `, isInline: true, components: [{ type: TooltipPopupComponent, selector: "kendo-map-tooltip-popup", inputs: ["animate", "classNames", "popupSettings", "wrapperClass"], outputs: ["leave"] }, { type: i5.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
941
1232
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapComponent, decorators: [{
942
1233
  type: Component,
943
1234
  args: [{
@@ -948,6 +1239,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
948
1239
  ConfigurationService,
949
1240
  InstanceEventService,
950
1241
  LocalizationService,
1242
+ TooltipTemplateService,
951
1243
  {
952
1244
  provide: L10N_PREFIX,
953
1245
  useValue: 'kendo.map'
@@ -955,6 +1247,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
955
1247
  ],
956
1248
  template: `
957
1249
  <div #surface></div>
1250
+ <kendo-map-tooltip-popup (leave)="tooltipMouseleave($event)" [popupSettings]="popupSettings">
1251
+ </kendo-map-tooltip-popup>
958
1252
  <kendo-resize-sensor (resize)="onResize()" [rateLimit]="resizeRateLimit"></kendo-resize-sensor>
959
1253
  `
960
1254
  }]
@@ -972,6 +1266,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
972
1266
  type: Input
973
1267
  }], pannable: [{
974
1268
  type: Input
1269
+ }], popupSettings: [{
1270
+ type: Input
975
1271
  }], wraparound: [{
976
1272
  type: Input
977
1273
  }], zoom: [{
@@ -1011,6 +1307,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1011
1307
  }], surfaceElement: [{
1012
1308
  type: ViewChild,
1013
1309
  args: ['surface', { static: true }]
1310
+ }], tooltipInstance: [{
1311
+ type: ViewChild,
1312
+ args: [TooltipPopupComponent, { static: true }]
1014
1313
  }] } });
1015
1314
 
1016
1315
  /**
@@ -1040,10 +1339,14 @@ class CollectionComponent {
1040
1339
  return;
1041
1340
  }
1042
1341
  this.items[index] = changes.options;
1342
+ changes.sender.index = index;
1043
1343
  this.change();
1044
1344
  }
1045
1345
  readItems() {
1046
- this.items = this.children.map(s => s.options);
1346
+ this.items = this.children.map((item, index) => {
1347
+ item.index = index;
1348
+ return item.options;
1349
+ });
1047
1350
  this.change();
1048
1351
  }
1049
1352
  change() {
@@ -1204,17 +1507,187 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1204
1507
  type: Input
1205
1508
  }] } });
1206
1509
 
1510
+ /**
1511
+ * A directive that sets a [template]({{ site.data.urls.angular['templatesyntax'] }})
1512
+ * within the `<kendo-map-tooltip>` component for the Map
1513
+ * [Bubble layer tooltip]({% slug bubble_layers_map %}#toc-tooltip).
1514
+ *
1515
+ * The available inputs for the bubble tooltip template are:
1516
+ * * `dataItem: any`&mdash;The original data item used to create the bubble.
1517
+ * * `layerIndex: number`&mdash;The index of the layer for the tooltip.
1518
+ * * `location: Location`&mdash;The location of the bubble.
1519
+ * * `value: number`&mdash;The value of the bubble.
1520
+ */
1521
+ class BubbleTooltipTemplateDirective {
1522
+ constructor(templateRef) {
1523
+ this.templateRef = templateRef;
1524
+ }
1525
+ }
1526
+ BubbleTooltipTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BubbleTooltipTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1527
+ BubbleTooltipTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BubbleTooltipTemplateDirective, selector: "[kendoMapBubbleTooltipTemplate]", ngImport: i0 });
1528
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BubbleTooltipTemplateDirective, decorators: [{
1529
+ type: Directive,
1530
+ args: [{
1531
+ selector: '[kendoMapBubbleTooltipTemplate]'
1532
+ }]
1533
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
1534
+ type: Optional
1535
+ }] }]; } });
1536
+
1537
+ /**
1538
+ * A directive that sets a [template]({{ site.data.urls.angular['templatesyntax'] }})
1539
+ * within the `<kendo-map-tooltip>` component for the Map
1540
+ * [Marker layer tooltip]({% slug marker_layers_map %}#toc-tooltip).
1541
+ *
1542
+ * The available inputs for the marker tooltip template are:
1543
+ * * `title: string`&mdash;The marker title.
1544
+ * * `layerIndex: number`&mdash;The index of the layer for the tooltip.
1545
+ * * `location: Location`&mdash;The marker location.
1546
+ */
1547
+ class MarkerTooltipTemplateDirective {
1548
+ constructor(templateRef) {
1549
+ this.templateRef = templateRef;
1550
+ }
1551
+ }
1552
+ MarkerTooltipTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MarkerTooltipTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1553
+ MarkerTooltipTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: MarkerTooltipTemplateDirective, selector: "[kendoMapMarkerTooltipTemplate]", ngImport: i0 });
1554
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MarkerTooltipTemplateDirective, decorators: [{
1555
+ type: Directive,
1556
+ args: [{
1557
+ selector: '[kendoMapMarkerTooltipTemplate]'
1558
+ }]
1559
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
1560
+ type: Optional
1561
+ }] }]; } });
1562
+
1563
+ /**
1564
+ * A directive that sets a [template]({{ site.data.urls.angular['templatesyntax'] }})
1565
+ * within the `<kendo-map-tooltip>` component for the Map
1566
+ * [Shape layer tooltip]({% slug shape_layers_map %}#toc-tooltip).
1567
+ *
1568
+ * The available inputs for the shape tooltip template are:
1569
+ * * `dataItem: any`&mdash;The original data item used to create the shape.
1570
+ * * `layerIndex: number`&mdash;The index of the layer for the tooltip.
1571
+ * * `location: Location`&mdash;The location of the center of the shape.
1572
+ */
1573
+ class ShapeTooltipTemplateDirective {
1574
+ constructor(templateRef) {
1575
+ this.templateRef = templateRef;
1576
+ }
1577
+ }
1578
+ 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 });
1579
+ ShapeTooltipTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ShapeTooltipTemplateDirective, selector: "[kendoMapShapeTooltipTemplate]", ngImport: i0 });
1580
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShapeTooltipTemplateDirective, decorators: [{
1581
+ type: Directive,
1582
+ args: [{
1583
+ selector: '[kendoMapShapeTooltipTemplate]'
1584
+ }]
1585
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
1586
+ type: Optional
1587
+ }] }]; } });
1588
+
1589
+ /**
1590
+ * The configuration options of the [Bubble Layer Tooltip]({% slug bubble_layers_map %}#toc-tooltip).
1591
+ */
1592
+ class BubbleTooltipComponent extends SettingsComponent {
1593
+ constructor(configurationService, templateService, layer) {
1594
+ super('tooltip', configurationService);
1595
+ this.configurationService = configurationService;
1596
+ this.templateService = templateService;
1597
+ this.layer = layer;
1598
+ }
1599
+ ngAfterContentChecked() {
1600
+ var _a;
1601
+ this.templateService.registerTemplate(this.layer.index, (_a = this.bubbleTooltipTemplate) === null || _a === void 0 ? void 0 : _a.templateRef);
1602
+ }
1603
+ }
1604
+ BubbleTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BubbleTooltipComponent, deps: [{ token: ConfigurationService }, { token: TooltipTemplateService }, { token: LayerComponent }], target: i0.ɵɵFactoryTarget.Component });
1605
+ BubbleTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BubbleTooltipComponent, selector: "kendo-map-bubble-layer-tooltip", queries: [{ propertyName: "bubbleTooltipTemplate", first: true, predicate: BubbleTooltipTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
1606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BubbleTooltipComponent, decorators: [{
1607
+ type: Component,
1608
+ args: [{
1609
+ selector: 'kendo-map-bubble-layer-tooltip',
1610
+ template: ''
1611
+ }]
1612
+ }], ctorParameters: function () { return [{ type: ConfigurationService }, { type: TooltipTemplateService }, { type: LayerComponent }]; }, propDecorators: { bubbleTooltipTemplate: [{
1613
+ type: ContentChild,
1614
+ args: [BubbleTooltipTemplateDirective, { static: false }]
1615
+ }] } });
1616
+
1617
+ /**
1618
+ * The configuration options of the [Marker Layer Tooltip]({% slug marker_layers_map %}#toc-tooltip).
1619
+ */
1620
+ class MarkerTooltipComponent extends SettingsComponent {
1621
+ constructor(configurationService, templateService, layer) {
1622
+ super('tooltip', configurationService);
1623
+ this.configurationService = configurationService;
1624
+ this.templateService = templateService;
1625
+ this.layer = layer;
1626
+ }
1627
+ ngAfterContentChecked() {
1628
+ var _a;
1629
+ this.templateService.registerTemplate(this.layer.index, (_a = this.markerTooltipTemplate) === null || _a === void 0 ? void 0 : _a.templateRef);
1630
+ }
1631
+ }
1632
+ MarkerTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MarkerTooltipComponent, deps: [{ token: ConfigurationService }, { token: TooltipTemplateService }, { token: LayerComponent }], target: i0.ɵɵFactoryTarget.Component });
1633
+ MarkerTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MarkerTooltipComponent, selector: "kendo-map-marker-layer-tooltip", queries: [{ propertyName: "markerTooltipTemplate", first: true, predicate: MarkerTooltipTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
1634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MarkerTooltipComponent, decorators: [{
1635
+ type: Component,
1636
+ args: [{
1637
+ selector: 'kendo-map-marker-layer-tooltip',
1638
+ template: ''
1639
+ }]
1640
+ }], ctorParameters: function () { return [{ type: ConfigurationService }, { type: TooltipTemplateService }, { type: LayerComponent }]; }, propDecorators: { markerTooltipTemplate: [{
1641
+ type: ContentChild,
1642
+ args: [MarkerTooltipTemplateDirective, { static: false }]
1643
+ }] } });
1644
+
1645
+ /**
1646
+ * The configuration options of the [Shape Layer Tooltip]({% slug shape_layers_map %}#toc-tooltip).
1647
+ */
1648
+ class ShapeTooltipComponent extends SettingsComponent {
1649
+ constructor(configurationService, templateService, layer) {
1650
+ super('tooltip', configurationService);
1651
+ this.configurationService = configurationService;
1652
+ this.templateService = templateService;
1653
+ this.layer = layer;
1654
+ }
1655
+ ngAfterContentChecked() {
1656
+ var _a;
1657
+ this.templateService.registerTemplate(this.layer.index, (_a = this.shapeTooltipTemplate) === null || _a === void 0 ? void 0 : _a.templateRef);
1658
+ }
1659
+ }
1660
+ ShapeTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShapeTooltipComponent, deps: [{ token: ConfigurationService }, { token: TooltipTemplateService }, { token: LayerComponent }], target: i0.ɵɵFactoryTarget.Component });
1661
+ ShapeTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ShapeTooltipComponent, selector: "kendo-map-shape-layer-tooltip", queries: [{ propertyName: "shapeTooltipTemplate", first: true, predicate: ShapeTooltipTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
1662
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ShapeTooltipComponent, decorators: [{
1663
+ type: Component,
1664
+ args: [{
1665
+ selector: 'kendo-map-shape-layer-tooltip',
1666
+ template: ''
1667
+ }]
1668
+ }], ctorParameters: function () { return [{ type: ConfigurationService }, { type: TooltipTemplateService }, { type: LayerComponent }]; }, propDecorators: { shapeTooltipTemplate: [{
1669
+ type: ContentChild,
1670
+ args: [ShapeTooltipTemplateDirective, { static: false }]
1671
+ }] } });
1672
+
1207
1673
  /**
1208
1674
  * @hidden
1209
1675
  */
1210
1676
  const MAP_DIRECTIVES = [
1211
- MapComponent,
1212
- LayersComponent,
1213
1677
  BubbleLayerComponent,
1678
+ BubbleTooltipComponent,
1679
+ BubbleTooltipTemplateDirective,
1680
+ LayerTooltipComponent,
1681
+ LayersComponent,
1682
+ MapComponent,
1214
1683
  MarkerLayerComponent,
1684
+ MarkerTooltipComponent,
1685
+ MarkerTooltipTemplateDirective,
1215
1686
  ShapeLayerComponent,
1687
+ ShapeTooltipComponent,
1688
+ ShapeTooltipTemplateDirective,
1216
1689
  TileLayerComponent,
1217
- LayerTooltipComponent
1690
+ TooltipPopupComponent
1218
1691
  ];
1219
1692
 
1220
1693
  /**
@@ -1223,13 +1696,13 @@ const MAP_DIRECTIVES = [
1223
1696
  class MapModule {
1224
1697
  }
1225
1698
  MapModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1226
- MapModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapModule, declarations: [MapComponent, LayersComponent, BubbleLayerComponent, MarkerLayerComponent, ShapeLayerComponent, TileLayerComponent, LayerTooltipComponent], imports: [CommonModule, ResizeSensorModule], exports: [MapComponent, LayersComponent, BubbleLayerComponent, MarkerLayerComponent, ShapeLayerComponent, TileLayerComponent, LayerTooltipComponent] });
1227
- MapModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapModule, imports: [[CommonModule, ResizeSensorModule]] });
1699
+ MapModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapModule, declarations: [BubbleLayerComponent, BubbleTooltipComponent, BubbleTooltipTemplateDirective, LayerTooltipComponent, LayersComponent, MapComponent, MarkerLayerComponent, MarkerTooltipComponent, MarkerTooltipTemplateDirective, ShapeLayerComponent, ShapeTooltipComponent, ShapeTooltipTemplateDirective, TileLayerComponent, TooltipPopupComponent], imports: [CommonModule, TooltipsModule, ResizeSensorModule], exports: [BubbleLayerComponent, BubbleTooltipComponent, BubbleTooltipTemplateDirective, LayerTooltipComponent, LayersComponent, MapComponent, MarkerLayerComponent, MarkerTooltipComponent, MarkerTooltipTemplateDirective, ShapeLayerComponent, ShapeTooltipComponent, ShapeTooltipTemplateDirective, TileLayerComponent, TooltipPopupComponent] });
1700
+ MapModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapModule, imports: [[CommonModule, TooltipsModule, ResizeSensorModule]] });
1228
1701
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MapModule, decorators: [{
1229
1702
  type: NgModule,
1230
1703
  args: [{
1231
1704
  declarations: [MAP_DIRECTIVES],
1232
- imports: [CommonModule, ResizeSensorModule],
1705
+ imports: [CommonModule, TooltipsModule, ResizeSensorModule],
1233
1706
  exports: [MAP_DIRECTIVES]
1234
1707
  }]
1235
1708
  }] });
@@ -1238,5 +1711,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1238
1711
  * Generated bundle index. Do not edit.
1239
1712
  */
1240
1713
 
1241
- export { BeforeResetEvent, BubbleLayerComponent, LayerTooltipComponent, LayersComponent, MapClickEvent, MapComponent, MapModule, MarkerActivateEvent, MarkerClickEvent, MarkerCreatedEvent, MarkerLayerComponent, PanEndEvent, PanEvent, ResetEvent, ShapeClickEvent, ShapeCreatedEvent, ShapeFeatureCreatedEvent, ShapeLayerComponent, ShapeMouseEnterEvent, ShapeMouseLeaveEvent, TileLayerComponent, ZoomEndEvent, ZoomStartEvent };
1714
+ export { BeforeResetEvent, BubbleLayerComponent, BubbleTooltipComponent, BubbleTooltipTemplateDirective, LayerTooltipComponent, LayersComponent, MapClickEvent, MapComponent, MapModule, MarkerActivateEvent, MarkerClickEvent, MarkerCreatedEvent, MarkerLayerComponent, MarkerTooltipComponent, MarkerTooltipTemplateDirective, PanEndEvent, PanEvent, ResetEvent, ShapeClickEvent, ShapeCreatedEvent, ShapeFeatureCreatedEvent, ShapeLayerComponent, ShapeMouseEnterEvent, ShapeMouseLeaveEvent, ShapeTooltipComponent, ShapeTooltipTemplateDirective, TileLayerComponent, TooltipPopupComponent, ZoomEndEvent, ZoomStartEvent, bodyFactory };
1242
1715
 
package/main.d.ts CHANGED
@@ -11,4 +11,6 @@ export { TileLayerComponent } from './map/tile-layer.component';
11
11
  export { LayersComponent } from './map/layers.component';
12
12
  export { LayerTooltipComponent } from './map/layer/tooltip.component';
13
13
  export * from './events';
14
+ export * from './tooltip';
15
+ export { bodyFactory } from './tooltip/body-factory';
14
16
  export { MapLayer, MapLayerOptions, MapMarker, BubbleLayerSymbolArgs, BubbleLayerSymbol, MapControls, MapControlsPosition, TileUrlTemplateArgs, Location, Extent } from '@progress/kendo-charts';