var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import BaseRenderer from "./base-renderer";
var EnumerationRenderer = (function (_super) {
    __extends(EnumerationRenderer, _super);
    function EnumerationRenderer() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    EnumerationRenderer.prototype.init = function (params) {
        _super.prototype.init.call(this, params);
        _super.prototype.setupGui.call(this);
    };
    EnumerationRenderer.prototype.setupContentGui = function () {
        var cellValue = this.getValueToDisplay();
        if (cellValue == null) {
            return '';
        }
        else {
            var enumerationType = this.getEnumerationType();
            return "<ui-tag label=\"".concat(cellValue, "\" text-color=\"").concat(enumerationType === null || enumerationType === void 0 ? void 0 : enumerationType.textColor, "\" background-color=\"").concat(enumerationType === null || enumerationType === void 0 ? void 0 : enumerationType.backgroundColor, "\" size=\"md\" type=\"solid\"></ui-tag>");
        }
    };
    EnumerationRenderer.prototype.getEnumerationType = function () {
        if (this.params.colDef.field) {
            var path = this.params.colDef.field.split(".denomination")[0].split(".");
            var enumerationType_1 = this.params.data;
            if (path != null && Array.isArray(path)) {
                path.forEach(function (variable) {
                    enumerationType_1 = enumerationType_1[variable];
                });
            }
            return enumerationType_1;
        }
    };
    return EnumerationRenderer;
}(BaseRenderer));
export default EnumerationRenderer;

//# sourceMappingURL=enumeration-renderer.js.map
