"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UITab = void 0;
var aurelia_framework_1 = require("aurelia-framework");
var tabSeed = 0;
var UITab = exports.UITab = (function () {
    function UITab(element) {
        this.element = element;
        this.id = "";
        this.label = "";
        this.tooltip = "";
        this.icon = "";
        this.active = false;
        this.disabled = false;
        this.closeable = false;
        this.styleObject = null;
        this.id = "tab__".concat(tabSeed++);
    }
    UITab.prototype.bind = function () {
        this.closeable = !isFalse(this.closeable);
        this.resetColors();
    };
    UITab.prototype.resetColors = function () {
        this.styleObject = {};
        if (this.backgroundColor != null) {
            this.styleObject['background-color'] = this.backgroundColor;
        }
        if (this.textColor != null) {
            this.styleObject['color'] = this.textColor;
        }
    };
    UITab.prototype.textColorChanged = function () {
        this.resetColors();
    };
    UITab.prototype.backgroundColorChanged = function () {
        this.resetColors();
    };
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", String)
    ], UITab.prototype, "id", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", String)
    ], UITab.prototype, "label", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", String)
    ], UITab.prototype, "tooltip", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", String)
    ], UITab.prototype, "icon", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", Boolean)
    ], UITab.prototype, "active", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", Boolean)
    ], UITab.prototype, "disabled", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", Object)
    ], UITab.prototype, "view", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", Object)
    ], UITab.prototype, "model", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", Object)
    ], UITab.prototype, "viewModel", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", String)
    ], UITab.prototype, "backgroundColor", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", String)
    ], UITab.prototype, "textColor", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", String)
    ], UITab.prototype, "classes", void 0);
    __decorate([
        (0, aurelia_framework_1.bindable)(),
        __metadata("design:type", Boolean)
    ], UITab.prototype, "closeable", void 0);
    UITab = __decorate([
        (0, aurelia_framework_1.customElement)("ui-tab"),
        (0, aurelia_framework_1.inlineView)("<template class=\"ui-tab\" data-active.bind=\"active\" data-hide.bind=\"!!view || !!viewModel\">\n    <slot></slot>\n  </template>"),
        __metadata("design:paramtypes", [Element])
    ], UITab);
    return UITab;
}());

//# sourceMappingURL=ui-tab.js.map
