import * as tslib_1 from "tslib";
import * as React from 'react';
import { IgrLegendBase } from './igr-legend-base';
import { Legend } from "./Legend";
import { ReactRenderer } from "igniteui-react-core/ES5/react-renderer";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
/**
 * Represents a legend that displays information about each series, most often used in financial charting.
*/
var IgrFinancialLegend = /** @class */ (function (_super) {
    tslib_1.__extends(IgrFinancialLegend, _super);
    function IgrFinancialLegend(props) {
        var _this = _super.call(this, props) || this;
        var container;
        if (document) {
            container = document.createElement("div");
            container.style.display = "block";
            container.style.width = "100%";
            container.style.height = "100%";
        }
        var root;
        root = container;
        var ren = new ReactRenderer(root, document, true, DataChartStylingDefaults);
        _this.container = ren.getWrapper(container);
        _this._wrapper = ren;
        _this.i.provideContainer(ren);
        return _this;
    }
    IgrFinancialLegend.prototype.render = function () {
        var div = React.createElement("div", {
            ref: this._getMainRef
        });
        return div;
    };
    IgrFinancialLegend.prototype._getMainRef = function (div) {
        this._elRef = div;
    };
    IgrFinancialLegend.prototype.componentDidMount = function () {
        _super.prototype.componentDidMount.call(this);
        this.initializeContent();
    };
    IgrFinancialLegend.prototype.initializeContent = function () {
        this._elRef.appendChild(this.container.getNativeElement());
    };
    IgrFinancialLegend.prototype.destroy = function () {
        this._wrapper.destroy();
    };
    IgrFinancialLegend.prototype.createImplementation = function () {
        return new Legend();
    };
    Object.defineProperty(IgrFinancialLegend.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrFinancialLegend.prototype, "isFinancial", {
        /**
     * Gets if the legend is a financial legend.
    */
        get: function () {
            return this.i.isFinancial;
        },
        enumerable: true,
        configurable: true
    });
    return IgrFinancialLegend;
}(IgrLegendBase));
export { IgrFinancialLegend };
