import * as tslib_1 from "tslib";
import * as React from 'react';
import { isValidProp, getModifiedProps } from "igniteui-react-core/ES5/componentUtil";
export var LegendBaseStyles = ["\n:host {\n    display: block;\n}\n.ui-chart-legend {\n  border: none;\n}\n.ui-chart-legend-item-text {\n  font-size: 12px;\n  font-family: \"Segoe UI\", Arial, sans-serif;\n}\n.ui-chart-legend-items-list\n{\n    padding: 0;\n    margin: 5px;\n}\n.ui-chart-legend-item-text\n{\n    vertical-align: middle;\n}\n.ui-chart-legend\n{\n    overflow: auto;\n}\n.ui-chart-legend-item-badge, .ui-chart-legend-item-badge canvas\n{\n    vertical-align: middle;\n}\n"];
/**
 * Represents the base class for a legend in IgxDataChartComponent.
*/
var IgrLegendBase = /** @class */ (function (_super) {
    tslib_1.__extends(IgrLegendBase, _super);
    function IgrLegendBase(props) {
        var _this = _super.call(this, props) || this;
        _this._zoneRunner = null;
        _this._hasUserValues = new Set();
        _this._implementation = _this.createImplementation();
        _this._implementation.externalObject = _this;
        _this.onImplementationCreated();
        if (document) {
            //introduce styles globally for now.
        }
        return _this;
    }
    Object.defineProperty(IgrLegendBase.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgrLegendBase.prototype.onImplementationCreated = function () {
    };
    IgrLegendBase.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; }
        }
    };
    IgrLegendBase.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;
    };
    IgrLegendBase.prototype.render = function () {
        return null;
    };
    Object.defineProperty(IgrLegendBase.prototype, "isItemwise", {
        /**
     * Gets if the legend is item-wise.
    */
        get: function () {
            return this.i.isItemwise;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrLegendBase.prototype, "isFinancial", {
        /**
         * Gets if the legend is a financial legend.
        */
        get: function () {
            return this.i.isFinancial;
        },
        enumerable: true,
        configurable: true
    });
    return IgrLegendBase;
}(React.Component));
export { IgrLegendBase };
