UNPKG

devextreme-angular

Version:

Angular UI and visualization components based on DevExtreme widgets

736 lines (704 loc) 27.1 kB
import * as i2 from '@angular/platform-browser'; import { BrowserTransferStateModule } from '@angular/platform-browser'; import * as i0 from '@angular/core'; import { PLATFORM_ID, Component, Inject, Input, Output, ContentChildren, NgModule } from '@angular/core'; import DxVectorMap from 'devextreme/viz/vector_map'; import * as i1 from 'devextreme-angular/core'; import { DxComponent, DxTemplateHost, WatcherHelper, NestedOptionHost, IterableDifferHelper, DxIntegrationModule, DxTemplateModule } from 'devextreme-angular/core'; import { DxiAnnotationComponent, DxiLayerComponent, DxiLegendComponent, DxiAnnotationModule, DxoBorderModule, DxoFontModule, DxoImageModule, DxoShadowModule, DxoBackgroundModule, DxoCommonAnnotationSettingsModule, DxoControlBarModule, DxoExportModule, DxiLayerModule, DxoLabelModule, DxiLegendModule, DxoMarginModule, DxoSourceModule, DxoTitleModule, DxoSubtitleModule, DxoLoadingIndicatorModule, DxoProjectionModule, DxoSizeModule, DxoTooltipModule } from 'devextreme-angular/ui/nested'; /*! * devextreme-angular * Version: 22.1.14 * Build date: Mon Apr 29 2024 * * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file in the root of the project for details. * * https://github.com/DevExpress/devextreme-angular */ /** * The VectorMap is a UI component that visualizes geographical locations. This UI component represents a geographical map that contains areas and markers. Areas embody continents and countries. Markers flag specific points on the map, for example, towns, cities or capitals. */ class DxVectorMapComponent extends DxComponent { constructor(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) { super(elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId); this._watcherHelper = _watcherHelper; this._idh = _idh; this._createEventEmitters([ { subscribe: 'centerChanged', emit: 'onCenterChanged' }, { subscribe: 'click', emit: 'onClick' }, { subscribe: 'disposing', emit: 'onDisposing' }, { subscribe: 'drawn', emit: 'onDrawn' }, { subscribe: 'exported', emit: 'onExported' }, { subscribe: 'exporting', emit: 'onExporting' }, { subscribe: 'fileSaving', emit: 'onFileSaving' }, { subscribe: 'incidentOccurred', emit: 'onIncidentOccurred' }, { subscribe: 'initialized', emit: 'onInitialized' }, { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, { subscribe: 'tooltipHidden', emit: 'onTooltipHidden' }, { subscribe: 'tooltipShown', emit: 'onTooltipShown' }, { subscribe: 'zoomFactorChanged', emit: 'onZoomFactorChanged' }, { emit: 'annotationsChange' }, { emit: 'backgroundChange' }, { emit: 'boundsChange' }, { emit: 'centerChange' }, { emit: 'commonAnnotationSettingsChange' }, { emit: 'controlBarChange' }, { emit: 'customizeAnnotationChange' }, { emit: 'disabledChange' }, { emit: 'elementAttrChange' }, { emit: 'exportChange' }, { emit: 'layersChange' }, { emit: 'legendsChange' }, { emit: 'loadingIndicatorChange' }, { emit: 'maxZoomFactorChange' }, { emit: 'panningEnabledChange' }, { emit: 'pathModifiedChange' }, { emit: 'projectionChange' }, { emit: 'redrawOnResizeChange' }, { emit: 'rtlEnabledChange' }, { emit: 'sizeChange' }, { emit: 'themeChange' }, { emit: 'titleChange' }, { emit: 'tooltipChange' }, { emit: 'touchEnabledChange' }, { emit: 'wheelEnabledChange' }, { emit: 'zoomFactorChange' }, { emit: 'zoomingEnabledChange' } ]); this._idh.setHost(this); optionHost.setHost(this); } /** * Specifies the annotation collection. */ get annotations() { return this._getOption('annotations'); } set annotations(value) { this._setOption('annotations', value); } /** * Specifies the properties for the map background. */ get background() { return this._getOption('background'); } set background(value) { this._setOption('background', value); } /** * Specifies the positioning of a map in geographical coordinates. */ get bounds() { return this._getOption('bounds'); } set bounds(value) { this._setOption('bounds', value); } /** * Specifies the geographical coordinates of the center for a map. */ get center() { return this._getOption('center'); } set center(value) { this._setOption('center', value); } /** * Specifies settings common for all annotations in the VectorMap. */ get commonAnnotationSettings() { return this._getOption('commonAnnotationSettings'); } set commonAnnotationSettings(value) { this._setOption('commonAnnotationSettings', value); } /** * Configures the control bar. */ get controlBar() { return this._getOption('controlBar'); } set controlBar(value) { this._setOption('controlBar', value); } /** * Customizes an individual annotation. */ get customizeAnnotation() { return this._getOption('customizeAnnotation'); } set customizeAnnotation(value) { this._setOption('customizeAnnotation', value); } /** * Specifies whether the UI component responds to user interaction. */ get disabled() { return this._getOption('disabled'); } set disabled(value) { this._setOption('disabled', value); } /** * Specifies the global attributes to be attached to the UI component's container element. */ get elementAttr() { return this._getOption('elementAttr'); } set elementAttr(value) { this._setOption('elementAttr', value); } /** * Configures the exporting and printing features. */ get export() { return this._getOption('export'); } set export(value) { this._setOption('export', value); } /** * Specifies properties for VectorMap UI component layers. */ get layers() { return this._getOption('layers'); } set layers(value) { this._setOption('layers', value); } /** * Configures map legends. */ get legends() { return this._getOption('legends'); } set legends(value) { this._setOption('legends', value); } /** * Configures the loading indicator. */ get loadingIndicator() { return this._getOption('loadingIndicator'); } set loadingIndicator(value) { this._setOption('loadingIndicator', value); } /** * Specifies a map's maximum zoom factor. */ get maxZoomFactor() { return this._getOption('maxZoomFactor'); } set maxZoomFactor(value) { this._setOption('maxZoomFactor', value); } /** * Disables the panning capability. */ get panningEnabled() { return this._getOption('panningEnabled'); } set panningEnabled(value) { this._setOption('panningEnabled', value); } /** * Notifies the UI component that it is embedded into an HTML page that uses a tag modifying the path. */ get pathModified() { return this._getOption('pathModified'); } set pathModified(value) { this._setOption('pathModified', value); } /** * Specifies the map projection. */ get projection() { return this._getOption('projection'); } set projection(value) { this._setOption('projection', value); } /** * Specifies whether to redraw the UI component when the size of the parent browser window changes or a mobile device rotates. */ get redrawOnResize() { return this._getOption('redrawOnResize'); } set redrawOnResize(value) { this._setOption('redrawOnResize', value); } /** * Switches the UI component to a right-to-left representation. */ get rtlEnabled() { return this._getOption('rtlEnabled'); } set rtlEnabled(value) { this._setOption('rtlEnabled', value); } /** * Specifies the UI component's size in pixels. */ get size() { return this._getOption('size'); } set size(value) { this._setOption('size', value); } /** * Sets the name of the theme the UI component uses. */ get theme() { return this._getOption('theme'); } set theme(value) { this._setOption('theme', value); } /** * Configures the UI component's title. */ get title() { return this._getOption('title'); } set title(value) { this._setOption('title', value); } /** * Configures tooltips. */ get tooltip() { return this._getOption('tooltip'); } set tooltip(value) { this._setOption('tooltip', value); } /** * Specifies whether the map should respond to touch gestures. */ get touchEnabled() { return this._getOption('touchEnabled'); } set touchEnabled(value) { this._setOption('touchEnabled', value); } /** * Specifies whether or not the map should respond when a user rolls the mouse wheel. */ get wheelEnabled() { return this._getOption('wheelEnabled'); } set wheelEnabled(value) { this._setOption('wheelEnabled', value); } /** * Specifies a number that is used to zoom a map initially. */ get zoomFactor() { return this._getOption('zoomFactor'); } set zoomFactor(value) { this._setOption('zoomFactor', value); } /** * Disables the zooming capability. */ get zoomingEnabled() { return this._getOption('zoomingEnabled'); } set zoomingEnabled(value) { this._setOption('zoomingEnabled', value); } get annotationsChildren() { return this._getOption('annotations'); } set annotationsChildren(value) { this.setChildren('annotations', value); } get layersChildren() { return this._getOption('layers'); } set layersChildren(value) { this.setChildren('layers', value); } get legendsChildren() { return this._getOption('legends'); } set legendsChildren(value) { this.setChildren('legends', value); } _createInstance(element, options) { return new DxVectorMap(element, options); } ngOnDestroy() { this._destroyWidget(); } ngOnChanges(changes) { super.ngOnChanges(changes); this.setupChanges('annotations', changes); this.setupChanges('bounds', changes); this.setupChanges('center', changes); this.setupChanges('layers', changes); this.setupChanges('legends', changes); } setupChanges(prop, changes) { if (!(prop in this._optionsToUpdate)) { this._idh.setup(prop, changes); } } ngDoCheck() { this._idh.doCheck('annotations'); this._idh.doCheck('bounds'); this._idh.doCheck('center'); this._idh.doCheck('layers'); this._idh.doCheck('legends'); this._watcherHelper.checkWatchers(); super.ngDoCheck(); super.clearChangedOptions(); } _setOption(name, value) { let isSetup = this._idh.setupSingle(name, value); let isChanged = this._idh.getChanges(name, value) !== null; if (isSetup || isChanged) { super._setOption(name, value); } } } /** @nocollapse */ DxVectorMapComponent.ɵfac = function DxVectorMapComponent_Factory(t) { return new (t || DxVectorMapComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1.DxTemplateHost), i0.ɵɵdirectiveInject(i1.WatcherHelper), i0.ɵɵdirectiveInject(i1.IterableDifferHelper), i0.ɵɵdirectiveInject(i1.NestedOptionHost), i0.ɵɵdirectiveInject(i2.TransferState), i0.ɵɵdirectiveInject(PLATFORM_ID)); }; /** @nocollapse */ DxVectorMapComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DxVectorMapComponent, selectors: [["dx-vector-map"]], contentQueries: function DxVectorMapComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) { i0.ɵɵcontentQuery(dirIndex, DxiAnnotationComponent, 4); i0.ɵɵcontentQuery(dirIndex, DxiLayerComponent, 4); i0.ɵɵcontentQuery(dirIndex, DxiLegendComponent, 4); } if (rf & 2) { let _t; i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.annotationsChildren = _t); i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.layersChildren = _t); i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.legendsChildren = _t); } }, inputs: { annotations: "annotations", background: "background", bounds: "bounds", center: "center", commonAnnotationSettings: "commonAnnotationSettings", controlBar: "controlBar", customizeAnnotation: "customizeAnnotation", disabled: "disabled", elementAttr: "elementAttr", export: "export", layers: "layers", legends: "legends", loadingIndicator: "loadingIndicator", maxZoomFactor: "maxZoomFactor", panningEnabled: "panningEnabled", pathModified: "pathModified", projection: "projection", redrawOnResize: "redrawOnResize", rtlEnabled: "rtlEnabled", size: "size", theme: "theme", title: "title", tooltip: "tooltip", touchEnabled: "touchEnabled", wheelEnabled: "wheelEnabled", zoomFactor: "zoomFactor", zoomingEnabled: "zoomingEnabled" }, outputs: { onCenterChanged: "onCenterChanged", onClick: "onClick", onDisposing: "onDisposing", onDrawn: "onDrawn", onExported: "onExported", onExporting: "onExporting", onFileSaving: "onFileSaving", onIncidentOccurred: "onIncidentOccurred", onInitialized: "onInitialized", onOptionChanged: "onOptionChanged", onSelectionChanged: "onSelectionChanged", onTooltipHidden: "onTooltipHidden", onTooltipShown: "onTooltipShown", onZoomFactorChanged: "onZoomFactorChanged", annotationsChange: "annotationsChange", backgroundChange: "backgroundChange", boundsChange: "boundsChange", centerChange: "centerChange", commonAnnotationSettingsChange: "commonAnnotationSettingsChange", controlBarChange: "controlBarChange", customizeAnnotationChange: "customizeAnnotationChange", disabledChange: "disabledChange", elementAttrChange: "elementAttrChange", exportChange: "exportChange", layersChange: "layersChange", legendsChange: "legendsChange", loadingIndicatorChange: "loadingIndicatorChange", maxZoomFactorChange: "maxZoomFactorChange", panningEnabledChange: "panningEnabledChange", pathModifiedChange: "pathModifiedChange", projectionChange: "projectionChange", redrawOnResizeChange: "redrawOnResizeChange", rtlEnabledChange: "rtlEnabledChange", sizeChange: "sizeChange", themeChange: "themeChange", titleChange: "titleChange", tooltipChange: "tooltipChange", touchEnabledChange: "touchEnabledChange", wheelEnabledChange: "wheelEnabledChange", zoomFactorChange: "zoomFactorChange", zoomingEnabledChange: "zoomingEnabledChange" }, features: [i0.ɵɵProvidersFeature([ DxTemplateHost, WatcherHelper, NestedOptionHost, IterableDifferHelper ]), i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 0, vars: 0, template: function DxVectorMapComponent_Template(rf, ctx) { }, styles: ["[_nghost-%COMP%] { display: block; }"] }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DxVectorMapComponent, [{ type: Component, args: [{ selector: 'dx-vector-map', template: '', styles: [' :host { display: block; }'], providers: [ DxTemplateHost, WatcherHelper, NestedOptionHost, IterableDifferHelper ] }] }], function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.DxTemplateHost }, { type: i1.WatcherHelper }, { type: i1.IterableDifferHelper }, { type: i1.NestedOptionHost }, { type: i2.TransferState }, { type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID] }] }]; }, { annotations: [{ type: Input }], background: [{ type: Input }], bounds: [{ type: Input }], center: [{ type: Input }], commonAnnotationSettings: [{ type: Input }], controlBar: [{ type: Input }], customizeAnnotation: [{ type: Input }], disabled: [{ type: Input }], elementAttr: [{ type: Input }], export: [{ type: Input }], layers: [{ type: Input }], legends: [{ type: Input }], loadingIndicator: [{ type: Input }], maxZoomFactor: [{ type: Input }], panningEnabled: [{ type: Input }], pathModified: [{ type: Input }], projection: [{ type: Input }], redrawOnResize: [{ type: Input }], rtlEnabled: [{ type: Input }], size: [{ type: Input }], theme: [{ type: Input }], title: [{ type: Input }], tooltip: [{ type: Input }], touchEnabled: [{ type: Input }], wheelEnabled: [{ type: Input }], zoomFactor: [{ type: Input }], zoomingEnabled: [{ type: Input }], onCenterChanged: [{ type: Output }], onClick: [{ type: Output }], onDisposing: [{ type: Output }], onDrawn: [{ type: Output }], onExported: [{ type: Output }], onExporting: [{ type: Output }], onFileSaving: [{ type: Output }], onIncidentOccurred: [{ type: Output }], onInitialized: [{ type: Output }], onOptionChanged: [{ type: Output }], onSelectionChanged: [{ type: Output }], onTooltipHidden: [{ type: Output }], onTooltipShown: [{ type: Output }], onZoomFactorChanged: [{ type: Output }], annotationsChange: [{ type: Output }], backgroundChange: [{ type: Output }], boundsChange: [{ type: Output }], centerChange: [{ type: Output }], commonAnnotationSettingsChange: [{ type: Output }], controlBarChange: [{ type: Output }], customizeAnnotationChange: [{ type: Output }], disabledChange: [{ type: Output }], elementAttrChange: [{ type: Output }], exportChange: [{ type: Output }], layersChange: [{ type: Output }], legendsChange: [{ type: Output }], loadingIndicatorChange: [{ type: Output }], maxZoomFactorChange: [{ type: Output }], panningEnabledChange: [{ type: Output }], pathModifiedChange: [{ type: Output }], projectionChange: [{ type: Output }], redrawOnResizeChange: [{ type: Output }], rtlEnabledChange: [{ type: Output }], sizeChange: [{ type: Output }], themeChange: [{ type: Output }], titleChange: [{ type: Output }], tooltipChange: [{ type: Output }], touchEnabledChange: [{ type: Output }], wheelEnabledChange: [{ type: Output }], zoomFactorChange: [{ type: Output }], zoomingEnabledChange: [{ type: Output }], annotationsChildren: [{ type: ContentChildren, args: [DxiAnnotationComponent] }], layersChildren: [{ type: ContentChildren, args: [DxiLayerComponent] }], legendsChildren: [{ type: ContentChildren, args: [DxiLegendComponent] }] }); })(); class DxVectorMapModule { } /** @nocollapse */ DxVectorMapModule.ɵfac = function DxVectorMapModule_Factory(t) { return new (t || DxVectorMapModule)(); }; /** @nocollapse */ DxVectorMapModule.ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: DxVectorMapModule }); /** @nocollapse */ DxVectorMapModule.ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ imports: [[ DxiAnnotationModule, DxoBorderModule, DxoFontModule, DxoImageModule, DxoShadowModule, DxoBackgroundModule, DxoCommonAnnotationSettingsModule, DxoControlBarModule, DxoExportModule, DxiLayerModule, DxoLabelModule, DxiLegendModule, DxoMarginModule, DxoSourceModule, DxoTitleModule, DxoSubtitleModule, DxoLoadingIndicatorModule, DxoProjectionModule, DxoSizeModule, DxoTooltipModule, DxIntegrationModule, DxTemplateModule, BrowserTransferStateModule ], DxiAnnotationModule, DxoBorderModule, DxoFontModule, DxoImageModule, DxoShadowModule, DxoBackgroundModule, DxoCommonAnnotationSettingsModule, DxoControlBarModule, DxoExportModule, DxiLayerModule, DxoLabelModule, DxiLegendModule, DxoMarginModule, DxoSourceModule, DxoTitleModule, DxoSubtitleModule, DxoLoadingIndicatorModule, DxoProjectionModule, DxoSizeModule, DxoTooltipModule, DxTemplateModule] }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DxVectorMapModule, [{ type: NgModule, args: [{ imports: [ DxiAnnotationModule, DxoBorderModule, DxoFontModule, DxoImageModule, DxoShadowModule, DxoBackgroundModule, DxoCommonAnnotationSettingsModule, DxoControlBarModule, DxoExportModule, DxiLayerModule, DxoLabelModule, DxiLegendModule, DxoMarginModule, DxoSourceModule, DxoTitleModule, DxoSubtitleModule, DxoLoadingIndicatorModule, DxoProjectionModule, DxoSizeModule, DxoTooltipModule, DxIntegrationModule, DxTemplateModule, BrowserTransferStateModule ], declarations: [ DxVectorMapComponent ], exports: [ DxVectorMapComponent, DxiAnnotationModule, DxoBorderModule, DxoFontModule, DxoImageModule, DxoShadowModule, DxoBackgroundModule, DxoCommonAnnotationSettingsModule, DxoControlBarModule, DxoExportModule, DxiLayerModule, DxoLabelModule, DxiLegendModule, DxoMarginModule, DxoSourceModule, DxoTitleModule, DxoSubtitleModule, DxoLoadingIndicatorModule, DxoProjectionModule, DxoSizeModule, DxoTooltipModule, DxTemplateModule ] }] }], null, null); })(); (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(DxVectorMapModule, { declarations: [DxVectorMapComponent], imports: [DxiAnnotationModule, DxoBorderModule, DxoFontModule, DxoImageModule, DxoShadowModule, DxoBackgroundModule, DxoCommonAnnotationSettingsModule, DxoControlBarModule, DxoExportModule, DxiLayerModule, DxoLabelModule, DxiLegendModule, DxoMarginModule, DxoSourceModule, DxoTitleModule, DxoSubtitleModule, DxoLoadingIndicatorModule, DxoProjectionModule, DxoSizeModule, DxoTooltipModule, DxIntegrationModule, DxTemplateModule, BrowserTransferStateModule], exports: [DxVectorMapComponent, DxiAnnotationModule, DxoBorderModule, DxoFontModule, DxoImageModule, DxoShadowModule, DxoBackgroundModule, DxoCommonAnnotationSettingsModule, DxoControlBarModule, DxoExportModule, DxiLayerModule, DxoLabelModule, DxiLegendModule, DxoMarginModule, DxoSourceModule, DxoTitleModule, DxoSubtitleModule, DxoLoadingIndicatorModule, DxoProjectionModule, DxoSizeModule, DxoTooltipModule, DxTemplateModule] }); })(); /** * Generated bundle index. Do not edit. */ export { DxVectorMapComponent, DxVectorMapModule }; //# sourceMappingURL=devextreme-angular-ui-vector-map.js.map