/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { ReactRenderer, ReactWrapper } from "igniteui-react-core/ES5/react-renderer";
import { Visibility_$type } from "igniteui-react-core/ES5/Visibility";
import { TypeRegistrar } from "igniteui-react-core/ES5/type";
import { XamSparkline } from './XamSparkline';
import { brushToString, stringToBrush, ensureBool, ensureEnum, initializePropertiesFromCss, isValidProp, getModifiedProps } from "igniteui-react-core/ES5/componentUtil";
import { DataContext } from "igniteui-react-core/ES5/igr-data-context";
import { SparklineStylingDefaults } from './SparklineStylingDefaults';
import { TrendLineType_$type } from "igniteui-react-core/ES5/TrendLineType";
import { SparklineDisplayType_$type } from './SparklineDisplayType';
import { UnknownValuePlotting_$type } from "igniteui-react-core/ES5/UnknownValuePlotting";
var IgrSparkline = /** @class */ (function (_super) {
    tslib_1.__extends(IgrSparkline, _super);
    function IgrSparkline(props) {
        var _this = _super.call(this, props) || this;
        _this._dataSource = null;
        _this._initialized = false;
        _this._hasUserValues = new Set();
        _this._tooltipTemplate = null;
        _this._tooltipContent = null;
        _this._defaultTooltips = null;
        _this._uniqueTooltipId = 0;
        _this._getMainRef = _this._getMainRef.bind(_this);
        _this._tooltipRef = _this._tooltipRef.bind(_this);
        _this._activeTooltipElements = new Map();
        _this._activeTooltips = new Map();
        _this._currentTooltips = [];
        var container = null;
        if (document) {
            container = document.createElement("div");
            container.style.display = "block";
            container.style.width = "100%";
            container.style.height = "100%";
        }
        var root;
        root = container;
        _this._renderer = new ReactRenderer(root, document, true, SparklineStylingDefaults);
        _this._implementation = _this.createImplementation();
        _this._container = _this._renderer.getWrapper(container);
        //this._renderer.rootWrapper.append(this._container);
        //this._container.setStyleProperty("display", "block");
        //this._container.setStyleProperty("width", "100%");
        //this._container.setStyleProperty("height", "100%");
        _this._wrapper = _this._renderer;
        //var root: any;
        //root = this._container;
        //if (this._container.nativeElement != null) {
        //    root = this._container.nativeElement;
        //}
        var sparkline = _this.i;
        _this._sparkline = sparkline;
        sparkline.provideContainer(_this._renderer);
        _this._renderer.addSizeWatcher(function () {
            _this._sparkline.notifyResized();
        });
        _this._initialized = true;
        return _this;
    }
    Object.defineProperty(IgrSparkline.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (value) {
            this._height = value;
            if (this._elRef) {
                this._elRef.style.height = value;
                this.notifyResized();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "width", {
        get: function () {
            return this._width;
        },
        set: function (value) {
            this._width = value;
            if (this._elRef) {
                this._elRef.style.width = value;
                this.notifyResized();
            }
        },
        enumerable: true,
        configurable: true
    });
    IgrSparkline.prototype.render = function () {
        // if (!this._childrenDiffer(this.props.children)) {
        // 	let div = React.createElement("div", {
        // 		ref: (ref) => {
        // 			this._elRef = ref;
        // 		},
        // 		children: this.props.children
        // 	});
        // 	return div;
        // } else {
        var children = [];
        React.Children.forEach(this.props.children, function (ch) {
            children.push(ch);
        });
        if (this._currentTooltips && this._currentTooltips.length > 0) {
            for (var i = 0; i < this._currentTooltips.length; i++) {
                var t = this._currentTooltips[i];
                if (this._activeTooltipElements.has(t)) {
                    children.push(this._activeTooltipElements.get(t));
                }
                else {
                    if (!TypeRegistrar.isRegistered("IgrTooltipContainer")) {
                        continue;
                    }
                    var Tooltip = TypeRegistrar.get("IgrTooltipContainer");
                    var tEle = React.createElement(Tooltip, {
                        ref: this._tooltipRef,
                        key: this._currentTooltips[i].key,
                        owner: this._currentTooltips[i]
                    });
                    var portal = ReactDOM.createPortal(tEle, t, this._currentTooltips[i].key);
                    this._activeTooltipElements.set(t, portal);
                    children.push(portal);
                }
            }
        }
        var div = React.createElement("div", {
            ref: this._getMainRef,
            children: children
        });
        return div;
        //}
    };
    IgrSparkline.prototype._tooltipRef = function (t) {
        //console.log(t);
        if (t === null) {
            return;
        }
        if (t.currentOwner &&
            t.currentOwner.tooltipTemplate) {
            t.template = t.currentOwner.tooltipTemplate;
        }
        this._activeTooltips.set(t.currentOwner, t);
    };
    IgrSparkline.prototype.componentDidMount = function () {
        var e_1, _a;
        try {
            for (var _b = tslib_1.__values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    {
                        this._hasUserValues.add(p);
                        this[p] = this.props[p];
                    }
                }
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
        this._elRef.style.width = this._width ? this._width : "";
        this._elRef.style.height = this._height ? this._height : "";
        this._elRef.appendChild(this._container.getNativeElement());
        this.notifyResized();
        this.initializeContent();
    };
    IgrSparkline.prototype.shouldComponentUpdate = function (nextProps, nextState) {
        var e_2, _a;
        var mod = getModifiedProps(this.props, nextProps);
        try {
            for (var _b = tslib_1.__values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this._hasUserValues.add(p);
                    this[p] = mod[p];
                }
            }
        }
        catch (e_2_1) { e_2 = { error: e_2_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_2) throw e_2.error; }
        }
        return true;
    };
    Object.defineProperty(IgrSparkline.prototype, "dataSource", {
        get: function () {
            if (this._dataSource != null) {
                return this._dataSource;
            }
            return this.i.itemsSource;
        },
        set: function (value) {
            this._dataSource = value;
            this.i.itemsSource = this._dataSource;
            //console.log("setting axis data source: " + value)
        },
        enumerable: true,
        configurable: true
    });
    IgrSparkline.prototype._getMainRef = function (div) {
        this._elRef = div;
    };
    IgrSparkline.prototype.destroy = function () {
        this._sparkline.destroy();
        this._wrapper.destroy();
    };
    IgrSparkline.prototype.createImplementation = function () {
        return new XamSparkline();
    };
    Object.defineProperty(IgrSparkline.prototype, "hasUserValues", {
        get: function () {
            return this._hasUserValues;
        },
        enumerable: true,
        configurable: true
    });
    IgrSparkline.prototype.initializeContent = function () {
        initializePropertiesFromCss(this._container.getNativeElement(), this, "sparkline-", this.hasUserValues);
        this.i.notifyResized();
    };
    IgrSparkline.prototype.componentWillUnmount = function () {
        //this._grid.destroy();
        this.destroy();
    };
    IgrSparkline.prototype.initializeProperties = function () {
        var e_3, _a;
        try {
            for (var _b = tslib_1.__values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this[p] = this.props[p];
                }
            }
        }
        catch (e_3_1) { e_3 = { error: e_3_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_3) throw e_3.error; }
        }
    };
    Object.defineProperty(IgrSparkline.prototype, "tooltipTemplate", {
        get: function () {
            return this._tooltipTemplate;
        },
        set: function (value) {
            this._tooltipTemplate = value;
            if (value == null) {
                if (this._tooltipContent !== null) {
                    this._tooltipContent.destroy();
                    this._tooltipContent = null;
                }
            }
            if (this._tooltipContent != null) {
                this._tooltipContent.instance.template = this._tooltipTemplate;
            }
            else {
                this._ensureTooltipCreated();
            }
        },
        enumerable: true,
        configurable: true
    });
    IgrSparkline.prototype.createWrapper = function (ele) {
        var wrapper = new ReactWrapper(ele, this._renderer);
        wrapper.updateToolTip = ele.updateToolTip;
        wrapper.hideToolTip = ele.hideToolTip;
        return wrapper;
    };
    IgrSparkline.prototype._ensureDefaultTooltip = function () {
        if (this._defaultTooltips == null) {
            return;
        }
        this._defaultTooltips["ensureDefaultTooltip"](this);
    };
    IgrSparkline.prototype._onDefaultTooltipsReady = function (cr) {
        this._ensureDefaultTooltip();
    };
    IgrSparkline.prototype._updateTooltipState = function () {
        if (this._initialized) {
            this.setState({ tooltips: this._currentTooltips });
        }
    };
    IgrSparkline.prototype.createTooltip = function () {
        // if (!TypeRegistrar.isRegistered("IgrTooltipContainer")) {
        // 	return null;
        // }
        // let Tooltip = TypeRegistrar.get("IgrTooltipContainer");
        var wrapper = this._wrapper.createElement("div");
        var ele = wrapper.getNativeElement();
        ele.key = "__tooltip_" + this._uniqueTooltipId;
        this._uniqueTooltipId++;
        this._currentTooltips = this._currentTooltips.slice(0);
        this._currentTooltips.push(ele);
        //let element = React.createElement(Tooltip,  );
        //let portal = ReactDOM.createPortal(element, ele);
        var self = this;
        ele.updateToolTip = function (c, isSubContent) {
            if (c.externalObject) {
                c = c.externalObject;
            }
            else {
                var ext = new DataContext();
                ext._implementation = c;
                c = ext;
            }
            if (!isSubContent) {
                if (ele.parentElement != self._container.getNativeElement()) {
                    if (ele.parentElement != null) {
                        ele.parentElement.removeChild(ele);
                    }
                    self._container.getNativeElement().appendChild(ele);
                }
            }
            else {
                c.isSubContent = true;
            }
            if (self._activeTooltips.has(ele)) {
                var t = self._activeTooltips.get(ele);
                if (t.template === null &&
                    self.tooltipTemplate !== null) {
                    t.template = self.tooltipTemplate;
                }
                t.dataContext = c;
            }
            ele.style.display = "block";
            return true;
        };
        ele.hideToolTip = function () {
            ele.style.display = "none";
        };
        ele.style.display = "none";
        this._updateTooltipState();
        return ele;
    };
    IgrSparkline.prototype._ensureTooltipCreated = function () {
        if (this.i.toolTip == null) {
            var tooltip = this.createTooltip();
            var ele = tooltip;
            if (tooltip == null) {
                return;
            }
            this._tooltipContent = tooltip;
            //(<any>tooltip.instance).template = this._tooltipTemplate;
            this.i.toolTip = this.createWrapper(tooltip);
            if (this._activeTooltips.has(ele)) {
                var tCont = this._activeTooltips.get(ele);
                tCont.template = ele.tooltipTemplate;
            }
        }
    };
    Object.defineProperty(IgrSparkline.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "brush", {
        /**
     * Gets or sets the sparkline brush.
    */
        get: function () {
            return brushToString(this.i.er);
        },
        set: function (v) {
            this.i.er = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "negativeBrush", {
        /**
         * Gets or sets the negative brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.ey);
        },
        set: function (v) {
            this.i.ey = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "markerBrush", {
        /**
         * Gets or sets the marker brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.ex);
        },
        set: function (v) {
            this.i.ex = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "negativeMarkerBrush", {
        /**
         * Gets or sets the negative marker brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.ez);
        },
        set: function (v) {
            this.i.ez = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "firstMarkerBrush", {
        /**
         * Gets or sets the first marker brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.es);
        },
        set: function (v) {
            this.i.es = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "lastMarkerBrush", {
        /**
         * Gets or sets the last marker brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.ev);
        },
        set: function (v) {
            this.i.ev = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "highMarkerBrush", {
        /**
         * Gets or sets the high marker brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.et);
        },
        set: function (v) {
            this.i.et = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "lowMarkerBrush", {
        /**
         * Gets or sets the low marker brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.ew);
        },
        set: function (v) {
            this.i.ew = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "trendLineBrush", {
        /**
         * Gets or sets the trendline brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.e1);
        },
        set: function (v) {
            this.i.e1 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "horizontalAxisBrush", {
        /**
         * Gets or sets the horizontal axis line brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.eu);
        },
        set: function (v) {
            this.i.eu = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "verticalAxisBrush", {
        /**
         * Gets or sets the vertical axis line brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.e2);
        },
        set: function (v) {
            this.i.e2 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "normalRangeFill", {
        /**
         * Gets or sets the normal range brush of the sparkline.
        */
        get: function () {
            return brushToString(this.i.e0);
        },
        set: function (v) {
            this.i.e0 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "horizontalAxisVisibility", {
        /**
         * Gets or sets the display state of the horizontal axis.
        */
        get: function () {
            return this.i.e5;
        },
        set: function (v) {
            this.i.e5 = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "verticalAxisVisibility", {
        /**
         * Gets or sets the display state of the vertical axis.
        */
        get: function () {
            return this.i.fc;
        },
        set: function (v) {
            this.i.fc = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "markerVisibility", {
        /**
         * Gets or sets the marker visibility of the sparkline.
        */
        get: function () {
            return this.i.e8;
        },
        set: function (v) {
            this.i.e8 = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "negativeMarkerVisibility", {
        /**
         * Gets or sets the negative marker visibility of the sparkline.
        */
        get: function () {
            return this.i.e9;
        },
        set: function (v) {
            this.i.e9 = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "firstMarkerVisibility", {
        /**
         * Gets or sets the first marker visibility of the sparkline.
        */
        get: function () {
            return this.i.e3;
        },
        set: function (v) {
            this.i.e3 = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "lastMarkerVisibility", {
        /**
         * Gets or sets the last marker visibility of the sparkline.
        */
        get: function () {
            return this.i.e6;
        },
        set: function (v) {
            this.i.e6 = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "lowMarkerVisibility", {
        /**
         * Gets or sets the low marker visibility of the sparkline.
        */
        get: function () {
            return this.i.e7;
        },
        set: function (v) {
            this.i.e7 = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "highMarkerVisibility", {
        /**
         * Gets or sets the high marker visibility of the sparkline.
        */
        get: function () {
            return this.i.e4;
        },
        set: function (v) {
            this.i.e4 = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "normalRangeVisibility", {
        /**
         * Gets or sets the normal range visibility of the sparkline.
        */
        get: function () {
            return this.i.fa;
        },
        set: function (v) {
            this.i.fa = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "displayNormalRangeInFront", {
        /**
         * Gets or sets the position of the normal range on the sparkline.
        */
        get: function () {
            return this.i.as;
        },
        set: function (v) {
            this.i.as = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "markerSize", {
        /**
         * Gets or sets the marker size of the sparkline.
        */
        get: function () {
            return this.i.a9;
        },
        set: function (v) {
            this.i.a9 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "firstMarkerSize", {
        /**
         * Gets or sets the first marker size of the sparkline.
        */
        get: function () {
            return this.i.a2;
        },
        set: function (v) {
            this.i.a2 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "lastMarkerSize", {
        /**
         * Gets or sets the last marker size of the sparkline.
        */
        get: function () {
            return this.i.a4;
        },
        set: function (v) {
            this.i.a4 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "highMarkerSize", {
        /**
         * Gets or sets the high marker size of the sparkline.
        */
        get: function () {
            return this.i.a3;
        },
        set: function (v) {
            this.i.a3 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "lowMarkerSize", {
        /**
         * Gets or sets the low marker size of the sparkline.
        */
        get: function () {
            return this.i.a8;
        },
        set: function (v) {
            this.i.a8 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "negativeMarkerSize", {
        /**
         * Gets or sets the negative marker size of the sparkline.
        */
        get: function () {
            return this.i.be;
        },
        set: function (v) {
            this.i.be = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "lineThickness", {
        /**
         * Gets or sets the line thickness of the sparkline.
        */
        get: function () {
            return this.i.a5;
        },
        set: function (v) {
            this.i.a5 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "minimum", {
        /**
         * Gets or sets the minimum value of the y axis.
        */
        get: function () {
            return this.i.bd;
        },
        set: function (v) {
            this.i.bd = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "maximum", {
        /**
         * Gets or sets the maximum value of the y axis.
        */
        get: function () {
            return this.i.bc;
        },
        set: function (v) {
            this.i.bc = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "valueMemberPath", {
        /**
         * Gets or sets the string path to the value column.
        */
        get: function () {
            return this.i.c1;
        },
        set: function (v) {
            this.i.c1 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "labelMemberPath", {
        /**
         * String identifier of a column or property name to get labels from on each item in the data source.  These labels will be retrieved from the first and last item, and displayed by the horizontal axis.
        */
        get: function () {
            return this.i.b6;
        },
        set: function (v) {
            this.i.b6 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "trendLineType", {
        /**
         * Gets or sets the type of trendline used by the sparkline.
        */
        get: function () {
            return this.i.an;
        },
        set: function (v) {
            this.i.an = ensureEnum(TrendLineType_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "trendLinePeriod", {
        /**
         * Gets or sets the trendline period used by the sparkline.
        */
        get: function () {
            return this.i.bm;
        },
        set: function (v) {
            this.i.bm = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "trendLineThickness", {
        /**
         * Gets or sets the thickness of the sparkline's trendline.
        */
        get: function () {
            return this.i.bi;
        },
        set: function (v) {
            this.i.bi = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "normalRangeMinimum", {
        /**
         * Gets or sets the minimum value of the normal range.
        */
        get: function () {
            return this.i.bg;
        },
        set: function (v) {
            this.i.bg = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "normalRangeMaximum", {
        /**
         * Gets or sets the maximum value of the normal range.
        */
        get: function () {
            return this.i.bf;
        },
        set: function (v) {
            this.i.bf = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "displayType", {
        /**
         * Gets or sets the display type of the sparkline.
        */
        get: function () {
            return this.i.am;
        },
        set: function (v) {
            this.i.am = ensureEnum(SparklineDisplayType_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "unknownValuePlotting", {
        /**
         * Gets or sets the way null values are interpreted.
        */
        get: function () {
            return this.i.ao;
        },
        set: function (v) {
            this.i.ao = ensureEnum(UnknownValuePlotting_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "verticalAxisLabel", {
        /**
         * The value or content to display on the vertical axis.
         * This can be set to a formatted string, such as "{0:n}", or it can be set to a DataTemplate.
        */
        get: function () {
            return this.i.bp;
        },
        set: function (v) {
            this.i.bp = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "horizontalAxisLabel", {
        /**
         * The value or content to display on the horizontal axis.
         * This can be set to a formatted string, such as "{0}", or it can be set to a DataTemplate.
        */
        get: function () {
            return this.i.bn;
        },
        set: function (v) {
            this.i.bn = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "formatLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart.
        */
        get: function () {
            return this.i.bl;
        },
        set: function (v) {
            this.i.bl = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "pixelScalingRatio", {
        /**
         * Gets or sets the scaling value used to affect the pixel density of the control.
         * A higher scaling ratio will produce crisper visuals at the expense of memory.  Lower values will cause the control
         * to appear blurry.
        */
        get: function () {
            return this.i.bh;
        },
        set: function (v) {
            this.i.bh = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrSparkline.prototype, "actualPixelScalingRatio", {
        /**
         * Gets the actual scaling value used by the component to affect the pixel density of the control.
         * A higher scaling ratio will produce crisper visuals at the expense of memory.  Lower values will cause the control
         * to appear blurry.
        */
        get: function () {
            return this.i.a1;
        },
        set: function (v) {
            this.i.a1 = +v;
        },
        enumerable: true,
        configurable: true
    });
    /**
 * Provides a container to the sparkline control.

* @param container  * The container.
*/
    IgrSparkline.prototype.provideContainer = function (container) {
        this.i.provideContainer(container);
    };
    /**
     * Notify that the control has resized.
    
    */
    IgrSparkline.prototype.notifyResized = function () {
        this.i.notifyResized();
    };
    IgrSparkline.prototype.notifySetItem = function (source_, index, oldItem, newItem) {
        this.i.dc(source_, index, oldItem, newItem);
    };
    /**
     * Used to manually notify the IgxSparklineComponent that the data source has reset or cleared its items.  Invoking this method is only necessary if that datasource is not observable.
    
    * @param source_  * The data source which was cleared or reset.
    */
    IgrSparkline.prototype.notifyClearItems = function (source_) {
        this.i.c8(source_);
    };
    IgrSparkline.prototype.notifyInsertItem = function (source_, index, newItem) {
        this.i.c9(source_, index, newItem);
    };
    IgrSparkline.prototype.notifyRemoveItem = function (source_, index, oldItem) {
        this.i.da(source_, index, oldItem);
    };
    /**
     * Returns the sparkline visuals expressed as a SparklineVisualData object.
    
    */
    IgrSparkline.prototype.exportVisualData = function () {
        var iv = this.i.aq();
        return (iv);
    };
    return IgrSparkline;
}(React.Component));
export { IgrSparkline };
