"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); /*! * devextreme-angular * Version: 19.1.16 * Build date: Tue Oct 18 2022 * * Copyright (c) 2012 - 2022 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 */ Object.defineProperty(exports, "__esModule", { value: true }); var platform_browser_1 = require("@angular/platform-browser"); var platform_browser_2 = require("@angular/platform-browser"); var core_1 = require("@angular/core"); var sparkline_1 = require("devextreme/viz/sparkline"); var component_1 = require("../core/component"); var template_host_1 = require("../core/template-host"); var integration_1 = require("../core/integration"); var template_1 = require("../core/template"); var nested_option_1 = require("../core/nested-option"); var watcher_helper_1 = require("../core/watcher-helper"); var iterable_differ_helper_1 = require("../core/iterable-differ-helper"); var margin_1 = require("./nested/margin"); var size_1 = require("./nested/size"); var tooltip_1 = require("./nested/tooltip"); var border_1 = require("./nested/border"); var font_1 = require("./nested/font"); var format_1 = require("./nested/format"); var shadow_1 = require("./nested/shadow"); /** * The Sparkline widget is a compact chart that contains only one series. Owing to their size, sparklines occupy very little space and can be easily collected in a table or embedded straight in text. */ var DxSparklineComponent = (function (_super) { __extends(DxSparklineComponent, _super); function DxSparklineComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) { var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this; _this._watcherHelper = _watcherHelper; _this._idh = _idh; _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: 'argumentFieldChange' }, { emit: 'barNegativeColorChange' }, { emit: 'barPositiveColorChange' }, { emit: 'dataSourceChange' }, { emit: 'disabledChange' }, { emit: 'elementAttrChange' }, { emit: 'firstLastColorChange' }, { emit: 'ignoreEmptyPointsChange' }, { emit: 'lineColorChange' }, { emit: 'lineWidthChange' }, { emit: 'lossColorChange' }, { emit: 'marginChange' }, { emit: 'maxColorChange' }, { emit: 'maxValueChange' }, { emit: 'minColorChange' }, { emit: 'minValueChange' }, { emit: 'pathModifiedChange' }, { emit: 'pointColorChange' }, { emit: 'pointSizeChange' }, { emit: 'pointSymbolChange' }, { emit: 'rtlEnabledChange' }, { emit: 'showFirstLastChange' }, { emit: 'showMinMaxChange' }, { emit: 'sizeChange' }, { emit: 'themeChange' }, { emit: 'tooltipChange' }, { emit: 'typeChange' }, { emit: 'valueFieldChange' }, { emit: 'winColorChange' }, { emit: 'winlossThresholdChange' } ]); _this._idh.setHost(_this); optionHost.setHost(_this); return _this; } Object.defineProperty(DxSparklineComponent.prototype, "argumentField", { get: /** * Specifies the data source field that provides arguments for a sparkline. */ function () { return this._getOption('argumentField'); }, set: function (value) { this._setOption('argumentField', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "barNegativeColor", { get: /** * Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ function () { return this._getOption('barNegativeColor'); }, set: function (value) { this._setOption('barNegativeColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "barPositiveColor", { get: /** * Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ function () { return this._getOption('barPositiveColor'); }, set: function (value) { this._setOption('barPositiveColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "dataSource", { get: /** * Binds the widget to data. */ function () { return this._getOption('dataSource'); }, set: function (value) { this._setOption('dataSource', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "disabled", { get: /** * Specifies whether the widget responds to the user interaction. */ function () { return this._getOption('disabled'); }, set: function (value) { this._setOption('disabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "elementAttr", { get: /** * Specifies the attributes to be attached to the widget's root element. */ function () { return this._getOption('elementAttr'); }, set: function (value) { this._setOption('elementAttr', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "firstLastColor", { get: /** * Sets a color for the boundary of both the first and last points on a sparkline. */ function () { return this._getOption('firstLastColor'); }, set: function (value) { this._setOption('firstLastColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "ignoreEmptyPoints", { get: /** * Specifies whether the sparkline should ignore null data points. */ function () { return this._getOption('ignoreEmptyPoints'); }, set: function (value) { this._setOption('ignoreEmptyPoints', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "lineColor", { get: /** * Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ function () { return this._getOption('lineColor'); }, set: function (value) { this._setOption('lineColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "lineWidth", { get: /** * Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ function () { return this._getOption('lineWidth'); }, set: function (value) { this._setOption('lineWidth', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "lossColor", { get: /** * Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ function () { return this._getOption('lossColor'); }, set: function (value) { this._setOption('lossColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "margin", { get: /** * Generates space around the widget. */ function () { return this._getOption('margin'); }, set: function (value) { this._setOption('margin', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "maxColor", { get: /** * Sets a color for the boundary of the maximum point on a sparkline. */ function () { return this._getOption('maxColor'); }, set: function (value) { this._setOption('maxColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "maxValue", { get: /** * Specifies the maximum value of the sparkline's value axis. */ function () { return this._getOption('maxValue'); }, set: function (value) { this._setOption('maxValue', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "minColor", { get: /** * Sets a color for the boundary of the minimum point on a sparkline. */ function () { return this._getOption('minColor'); }, set: function (value) { this._setOption('minColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "minValue", { get: /** * Specifies the minimum value of the sparkline value axis. */ function () { return this._getOption('minValue'); }, set: function (value) { this._setOption('minValue', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "pathModified", { get: /** * Notifies the widget that it is embedded into an HTML page that uses a tag modifying the path. */ function () { return this._getOption('pathModified'); }, set: function (value) { this._setOption('pathModified', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "pointColor", { get: /** * Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ function () { return this._getOption('pointColor'); }, set: function (value) { this._setOption('pointColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "pointSize", { get: /** * Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ function () { return this._getOption('pointSize'); }, set: function (value) { this._setOption('pointSize', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "pointSymbol", { get: /** * Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ function () { return this._getOption('pointSymbol'); }, set: function (value) { this._setOption('pointSymbol', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "rtlEnabled", { get: /** * Switches the widget to a right-to-left representation. */ function () { return this._getOption('rtlEnabled'); }, set: function (value) { this._setOption('rtlEnabled', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "showFirstLast", { get: /** * Specifies whether or not to indicate both the first and last values on a sparkline. */ function () { return this._getOption('showFirstLast'); }, set: function (value) { this._setOption('showFirstLast', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "showMinMax", { get: /** * Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ function () { return this._getOption('showMinMax'); }, set: function (value) { this._setOption('showMinMax', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "size", { get: /** * Specifies the widget's size in pixels. */ function () { return this._getOption('size'); }, set: function (value) { this._setOption('size', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "theme", { get: /** * Sets the name of the theme the widget uses. */ function () { return this._getOption('theme'); }, set: function (value) { this._setOption('theme', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "tooltip", { get: /** * Configures the tooltip. */ function () { return this._getOption('tooltip'); }, set: function (value) { this._setOption('tooltip', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "type", { get: /** * Determines the type of a sparkline. */ function () { return this._getOption('type'); }, set: function (value) { this._setOption('type', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "valueField", { get: /** * Specifies the data source field that provides values for a sparkline. */ function () { return this._getOption('valueField'); }, set: function (value) { this._setOption('valueField', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "winColor", { get: /** * Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ function () { return this._getOption('winColor'); }, set: function (value) { this._setOption('winColor', value); }, enumerable: true, configurable: true }); Object.defineProperty(DxSparklineComponent.prototype, "winlossThreshold", { get: /** * Specifies a value that serves as a threshold for the sparkline of the winloss type. */ function () { return this._getOption('winlossThreshold'); }, set: function (value) { this._setOption('winlossThreshold', value); }, enumerable: true, configurable: true }); DxSparklineComponent.prototype._createInstance = function (element, options) { return new sparkline_1.default(element, options); }; DxSparklineComponent.prototype.ngOnDestroy = function () { this._destroyWidget(); }; DxSparklineComponent.prototype.ngOnChanges = function (changes) { _super.prototype.ngOnChanges.call(this, changes); this.setupChanges('dataSource', changes); }; DxSparklineComponent.prototype.setupChanges = function (prop, changes) { if (!(prop in this._optionsToUpdate)) { this._idh.setup(prop, changes); } }; DxSparklineComponent.prototype.ngDoCheck = function () { this._idh.doCheck('dataSource'); this._watcherHelper.checkWatchers(); _super.prototype.ngDoCheck.call(this); _super.prototype.clearChangedOptions.call(this); }; DxSparklineComponent.prototype._setOption = function (name, value) { var isSetup = this._idh.setupSingle(name, value); var isChanged = this._idh.getChanges(name, value) !== null; if (isSetup || isChanged) { _super.prototype._setOption.call(this, name, value); } }; DxSparklineComponent.decorators = [ { type: core_1.Component, args: [{ selector: 'dx-sparkline', template: '', styles: [' :host { display: block; }'], providers: [ template_host_1.DxTemplateHost, watcher_helper_1.WatcherHelper, nested_option_1.NestedOptionHost, iterable_differ_helper_1.IterableDifferHelper ] },] }, ]; /** @nocollapse */ DxSparklineComponent.ctorParameters = function () { return [ { type: core_1.ElementRef, }, { type: core_1.NgZone, }, { type: template_host_1.DxTemplateHost, }, { type: watcher_helper_1.WatcherHelper, }, { type: iterable_differ_helper_1.IterableDifferHelper, }, { type: nested_option_1.NestedOptionHost, }, { type: platform_browser_2.TransferState, }, { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] }, ]; }; DxSparklineComponent.propDecorators = { "argumentField": [{ type: core_1.Input },], "barNegativeColor": [{ type: core_1.Input },], "barPositiveColor": [{ type: core_1.Input },], "dataSource": [{ type: core_1.Input },], "disabled": [{ type: core_1.Input },], "elementAttr": [{ type: core_1.Input },], "firstLastColor": [{ type: core_1.Input },], "ignoreEmptyPoints": [{ type: core_1.Input },], "lineColor": [{ type: core_1.Input },], "lineWidth": [{ type: core_1.Input },], "lossColor": [{ type: core_1.Input },], "margin": [{ type: core_1.Input },], "maxColor": [{ type: core_1.Input },], "maxValue": [{ type: core_1.Input },], "minColor": [{ type: core_1.Input },], "minValue": [{ type: core_1.Input },], "pathModified": [{ type: core_1.Input },], "pointColor": [{ type: core_1.Input },], "pointSize": [{ type: core_1.Input },], "pointSymbol": [{ type: core_1.Input },], "rtlEnabled": [{ type: core_1.Input },], "showFirstLast": [{ type: core_1.Input },], "showMinMax": [{ type: core_1.Input },], "size": [{ type: core_1.Input },], "theme": [{ type: core_1.Input },], "tooltip": [{ type: core_1.Input },], "type": [{ type: core_1.Input },], "valueField": [{ type: core_1.Input },], "winColor": [{ type: core_1.Input },], "winlossThreshold": [{ type: core_1.Input },], "onDisposing": [{ type: core_1.Output },], "onDrawn": [{ type: core_1.Output },], "onExported": [{ type: core_1.Output },], "onExporting": [{ type: core_1.Output },], "onFileSaving": [{ type: core_1.Output },], "onIncidentOccurred": [{ type: core_1.Output },], "onInitialized": [{ type: core_1.Output },], "onOptionChanged": [{ type: core_1.Output },], "onTooltipHidden": [{ type: core_1.Output },], "onTooltipShown": [{ type: core_1.Output },], "argumentFieldChange": [{ type: core_1.Output },], "barNegativeColorChange": [{ type: core_1.Output },], "barPositiveColorChange": [{ type: core_1.Output },], "dataSourceChange": [{ type: core_1.Output },], "disabledChange": [{ type: core_1.Output },], "elementAttrChange": [{ type: core_1.Output },], "firstLastColorChange": [{ type: core_1.Output },], "ignoreEmptyPointsChange": [{ type: core_1.Output },], "lineColorChange": [{ type: core_1.Output },], "lineWidthChange": [{ type: core_1.Output },], "lossColorChange": [{ type: core_1.Output },], "marginChange": [{ type: core_1.Output },], "maxColorChange": [{ type: core_1.Output },], "maxValueChange": [{ type: core_1.Output },], "minColorChange": [{ type: core_1.Output },], "minValueChange": [{ type: core_1.Output },], "pathModifiedChange": [{ type: core_1.Output },], "pointColorChange": [{ type: core_1.Output },], "pointSizeChange": [{ type: core_1.Output },], "pointSymbolChange": [{ type: core_1.Output },], "rtlEnabledChange": [{ type: core_1.Output },], "showFirstLastChange": [{ type: core_1.Output },], "showMinMaxChange": [{ type: core_1.Output },], "sizeChange": [{ type: core_1.Output },], "themeChange": [{ type: core_1.Output },], "tooltipChange": [{ type: core_1.Output },], "typeChange": [{ type: core_1.Output },], "valueFieldChange": [{ type: core_1.Output },], "winColorChange": [{ type: core_1.Output },], "winlossThresholdChange": [{ type: core_1.Output },], }; return DxSparklineComponent; }(component_1.DxComponent)); exports.DxSparklineComponent = DxSparklineComponent; var DxSparklineModule = (function () { function DxSparklineModule() { } DxSparklineModule.decorators = [ { type: core_1.NgModule, args: [{ imports: [ margin_1.DxoMarginModule, size_1.DxoSizeModule, tooltip_1.DxoTooltipModule, border_1.DxoBorderModule, font_1.DxoFontModule, format_1.DxoFormatModule, shadow_1.DxoShadowModule, integration_1.DxIntegrationModule, template_1.DxTemplateModule, platform_browser_1.BrowserTransferStateModule ], declarations: [ DxSparklineComponent ], exports: [ DxSparklineComponent, margin_1.DxoMarginModule, size_1.DxoSizeModule, tooltip_1.DxoTooltipModule, border_1.DxoBorderModule, font_1.DxoFontModule, format_1.DxoFormatModule, shadow_1.DxoShadowModule, template_1.DxTemplateModule ] },] }, ]; return DxSparklineModule; }()); exports.DxSparklineModule = DxSparklineModule; //# sourceMappingURL=sparkline.js.map