import { __decorate } from "tslib";
import { Component, ContentChildren } from '@angular/core';
import { TabDirective } from './tab.directive';
var TabsComponent = /** @class */ (function () {
    function TabsComponent() {
    }
    Object.defineProperty(TabsComponent.prototype, "activeTab", {
        get: function () {
            return this.tabs.find(function (tab) { return tab.active; });
        },
        enumerable: true,
        configurable: true
    });
    TabsComponent.prototype.ngOnInit = function () {
    };
    TabsComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        setTimeout(function () { return _this.select(_this.tabs.first); });
    };
    TabsComponent.prototype.select = function (tab) {
        this.tabs.forEach(function (t) {
            t.deactivate();
        });
        tab.activate();
    };
    __decorate([
        ContentChildren(TabDirective)
    ], TabsComponent.prototype, "tabs", void 0);
    TabsComponent = __decorate([
        Component({
            selector: 'ui-tabs',
            template: "<div class=\"tabs\">\n  <button class=\"tabs__tab\" *ngFor=\"let tab of tabs\"\n          [class.tabs__tab--active]=\"tab.active\"\n          (click)=\"select(tab)\">\n    {{tab.label}}\n  </button>\n</div>\n<ng-container *ngIf=\"activeTab\">\n  <ng-container *ngTemplateOutlet=\"activeTab.template\"></ng-container>\n</ng-container>\n",
            styles: [".transition{transition:.5s ease-in}.transition-fast{transition:.2s ease-in}.tabs{position:relative;display:flex;height:40px;overflow:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;box-shadow:inset 0 -1px 0 var(--color-contrast-5)}.tabs__tab{position:relative;padding:0 0 12px;white-space:nowrap;color:var(--color-contrast-40);transition:color .2s ease-in-out}.tabs__tab:not(:last-child){margin-right:32px}.tabs__tab--active{color:var(--color-contrast-100)}.tabs__tab--active:before{content:\" \";position:absolute;width:100%;height:3px;left:0;bottom:0;background:var(--color-contrast-100)}@media not all and (pointer:coarse){.tabs__tab:hover{color:var(--color-contrast-100)}}"]
        })
    ], TabsComponent);
    return TabsComponent;
}());
export { TabsComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFicy5jb21wb25lbnQuanM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