/*! * devextreme-angular-test * Version: 17.2.8 * Build date: Mon Feb 05 2018 * * Copyright (c) 2012 - 2018 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 */ import { Component, NgModule, ElementRef, NgZone, Input, Output, OnDestroy, Injector, EventEmitter } from '@angular/core'; import DxBullet from 'devextreme/viz/bullet'; import { DxComponent } from '../core/component'; import { DxTemplateHost } from '../core/template-host'; import { DxTemplateModule } from '../core/template'; import { EventsRegistrator } from '../core/events-strategy'; import { NestedOptionHost } from '../core/nested-option'; import { WatcherHelper } from '../core/watcher-helper'; import { DxoMarginModule } from './nested/margin'; import { DxoSizeModule } from './nested/size'; import { DxoTooltipModule } from './nested/tooltip'; import { DxoBorderModule } from './nested/border'; import { DxoFontModule } from './nested/font'; import { DxoFormatModule } from './nested/format'; import { DxoShadowModule } from './nested/shadow'; /** * The Bullet widget is useful when you need to compare a single measure to a target value. The widget comprises a horizontal bar indicating the measure and a vertical line indicating the target value. */ @Component({ selector: 'dx-bullet', template: '', styles: [ ' :host { display: block; }'], providers: [ DxTemplateHost, WatcherHelper, NestedOptionHost ] }) export class DxBulletComponent extends DxComponent implements OnDestroy { instance: DxBullet; /** * Specifies a color for the bullet bar. */ @Input() get color(): string { return this._getOption('color'); } set color(value: string) { this._setOption('color', value); } /** * Specifies the attributes to be attached to the widget's root element. */ @Input() get elementAttr(): any { return this._getOption('elementAttr'); } set elementAttr(value: any) { this._setOption('elementAttr', value); } /** * Specifies an end value for the invisible scale. */ @Input() get endScaleValue(): number { return this._getOption('endScaleValue'); } set endScaleValue(value: number) { this._setOption('endScaleValue', value); } /** * Generates space around the widget. */ @Input() get margin(): any { return this._getOption('margin'); } set margin(value: any) { this._setOption('margin', value); } /** * Notifies the widget that it is embedded into an HTML page that uses a tag modifying the path. */ @Input() get pathModified(): boolean { return this._getOption('pathModified'); } set pathModified(value: boolean) { this._setOption('pathModified', value); } /** * Switches the widget to a right-to-left representation. */ @Input() get rtlEnabled(): boolean { return this._getOption('rtlEnabled'); } set rtlEnabled(value: boolean) { this._setOption('rtlEnabled', value); } /** * Specifies whether or not to show the target line. */ @Input() get showTarget(): boolean { return this._getOption('showTarget'); } set showTarget(value: boolean) { this._setOption('showTarget', value); } /** * Specifies whether or not to show the line indicating zero on the invisible scale. */ @Input() get showZeroLevel(): boolean { return this._getOption('showZeroLevel'); } set showZeroLevel(value: boolean) { this._setOption('showZeroLevel', value); } /** * Specifies the widget's size in pixels. */ @Input() get size(): any { return this._getOption('size'); } set size(value: any) { this._setOption('size', value); } /** * Specifies a start value for the invisible scale. */ @Input() get startScaleValue(): number { return this._getOption('startScaleValue'); } set startScaleValue(value: number) { this._setOption('startScaleValue', value); } /** * Specifies the value indicated by the target line. */ @Input() get target(): number { return this._getOption('target'); } set target(value: number) { this._setOption('target', value); } /** * Specifies a color for both the target and zero level lines. */ @Input() get targetColor(): string { return this._getOption('targetColor'); } set targetColor(value: string) { this._setOption('targetColor', value); } /** * Specifies the width of the target line. */ @Input() get targetWidth(): number { return this._getOption('targetWidth'); } set targetWidth(value: number) { this._setOption('targetWidth', value); } /** * Sets the name of the theme the widget uses. */ @Input() get theme(): string { return this._getOption('theme'); } set theme(value: string) { this._setOption('theme', value); } /** * Configures the tooltip. */ @Input() get tooltip(): any { return this._getOption('tooltip'); } set tooltip(value: any) { this._setOption('tooltip', value); } /** * Specifies the primary value indicated by the bullet bar. */ @Input() get value(): number { return this._getOption('value'); } set value(value: number) { this._setOption('value', value); } /** * A handler for the disposing event. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only. */ @Output() onDisposing: EventEmitter; /** * A handler for the drawn event. Executed when the widget has finished drawing itself. */ @Output() onDrawn: EventEmitter; /** * A handler for the exported event. Executed after data from the widget is exported. */ @Output() onExported: EventEmitter; /** * A handler for the exporting event. Executed before data from the widget is exported. */ @Output() onExporting: EventEmitter; /** * A handler for the fileSaving event. Executed before a file with exported data is saved on the user's local storage. */ @Output() onFileSaving: EventEmitter; /** * A handler for the incidentOccurred event. Executed when an error or warning appears in the widget. */ @Output() onIncidentOccurred: EventEmitter; /** * A handler for the initialized event. Executed only once, after the widget is initialized. */ @Output() onInitialized: EventEmitter; /** * A handler for the optionChanged event. Executed after an option of the widget is changed. */ @Output() onOptionChanged: EventEmitter; /** * A handler for the tooltipHidden event. */ @Output() onTooltipHidden: EventEmitter; /** * A handler for the tooltipShown event. */ @Output() onTooltipShown: EventEmitter; /** * A handler for the colorChange event. */ @Output() colorChange: EventEmitter; /** * A handler for the elementAttrChange event. */ @Output() elementAttrChange: EventEmitter; /** * A handler for the endScaleValueChange event. */ @Output() endScaleValueChange: EventEmitter; /** * A handler for the marginChange event. */ @Output() marginChange: EventEmitter; /** * A handler for the pathModifiedChange event. */ @Output() pathModifiedChange: EventEmitter; /** * A handler for the rtlEnabledChange event. */ @Output() rtlEnabledChange: EventEmitter; /** * A handler for the showTargetChange event. */ @Output() showTargetChange: EventEmitter; /** * A handler for the showZeroLevelChange event. */ @Output() showZeroLevelChange: EventEmitter; /** * A handler for the sizeChange event. */ @Output() sizeChange: EventEmitter; /** * A handler for the startScaleValueChange event. */ @Output() startScaleValueChange: EventEmitter; /** * A handler for the targetChange event. */ @Output() targetChange: EventEmitter; /** * A handler for the targetColorChange event. */ @Output() targetColorChange: EventEmitter; /** * A handler for the targetWidthChange event. */ @Output() targetWidthChange: EventEmitter; /** * A handler for the themeChange event. */ @Output() themeChange: EventEmitter; /** * A handler for the tooltipChange event. */ @Output() tooltipChange: EventEmitter; /** * A handler for the valueChange event. */ @Output() valueChange: EventEmitter; constructor(elementRef: ElementRef, ngZone: NgZone, templateHost: DxTemplateHost, injector: Injector, _watcherHelper: WatcherHelper, optionHost: NestedOptionHost) { super(elementRef, ngZone, templateHost, _watcherHelper); injector.get(EventsRegistrator); this._createEventEmitters([ { 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: 'tooltipHidden', emit: 'onTooltipHidden' }, { subscribe: 'tooltipShown', emit: 'onTooltipShown' }, { emit: 'colorChange' }, { emit: 'elementAttrChange' }, { emit: 'endScaleValueChange' }, { emit: 'marginChange' }, { emit: 'pathModifiedChange' }, { emit: 'rtlEnabledChange' }, { emit: 'showTargetChange' }, { emit: 'showZeroLevelChange' }, { emit: 'sizeChange' }, { emit: 'startScaleValueChange' }, { emit: 'targetChange' }, { emit: 'targetColorChange' }, { emit: 'targetWidthChange' }, { emit: 'themeChange' }, { emit: 'tooltipChange' }, { emit: 'valueChange' } ]); optionHost.setHost(this); } protected _createInstance(element, options) { return new DxBullet(element, options); } ngOnDestroy() { this._destroyWidget(); } } @NgModule({ imports: [ DxoMarginModule, DxoSizeModule, DxoTooltipModule, DxoBorderModule, DxoFontModule, DxoFormatModule, DxoShadowModule, DxTemplateModule ], declarations: [ DxBulletComponent ], exports: [ DxBulletComponent, DxoMarginModule, DxoSizeModule, DxoTooltipModule, DxoBorderModule, DxoFontModule, DxoFormatModule, DxoShadowModule, DxTemplateModule ], providers: [EventsRegistrator] }) export class DxBulletModule { }