import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "./tab.service";
import * as i2 from "@angular/common";
export class TabComponent {
    constructor(tabsrvc) {
        this.tabsrvc = tabsrvc;
        this.evnt = new EventEmitter();
    }
    ngOnInit() {
    }
    ngAfterContentInit() {
        this.links.forEach((item) => {
            if (item.actv) {
                this.tabsrvc.actv(item);
            }
        });
    }
    chng(id) {
        this.links.forEach((value) => {
            if (id == value.id) {
                value.actv = true;
                this.tabsrvc.actv(value);
                this.evnt.emit(value);
            }
            else {
                value.actv = false;
            }
        });
    }
}
TabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0, type: TabComponent, deps: [{ token: i1.TabService }], target: i0.ɵɵFactoryTarget.Component });
TabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.4", type: TabComponent, selector: "ngb-tab", inputs: { links: ["lnks", "links"], clss: "clss" }, outputs: { evnt: "evnt" }, ngImport: i0, template: "<ul [ngClass]=\"clss!=undefined ? ['nav'].concat(clss) : ['nav']\">\n  <li class=\"nav-item\" *ngFor=\"let link of links; index as indx\">\n    <button [ngClass]=\"{'nav-link':true, 'active': link.actv, 'disabled': link.dsbl}\" \n    (click)=\"chng(link.id)\" *ngIf=\"clss.indexOf('nav-tabs') > -1 || clss.indexOf('nav-pills') > -1; else elseBlock\">{{ link.nmbr }}</button>\n    <ng-template #elseBlock>\n      <a href=\"{{ link.href }}\" [ngClass]=\"{'nav-link':true, 'active': link.actv, 'disabled': link.dsbl}\" (click)=\"chng(link.id)\">{{ link.nmbr }}</a>\n    </ng-template>\n  </li>\n  \n</ul>\n<div class=\"tab-content\">\n  <ng-content></ng-content>\n</div>\n", styles: [".flex-column .nav-item .nav-link{width:100%}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem;color:#0d6efd;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out}@media (prefers-reduced-motion:reduce){.nav-link{transition:none}}.nav-link:focus,.nav-link:hover{color:#0a58ca}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-link{margin-bottom:-1px;background:0 0;border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6;isolation:isolate}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{background:0 0;border:0;border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#0d6efd}.nav-fill .nav-item,.nav-fill>.nav-link{flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{flex-basis:0;flex-grow:1;text-align:center}.nav-fill .nav-item .nav-link,.nav-justified .nav-item .nav-link{width:100%}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}\n"], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.4", ngImport: i0, type: TabComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'ngb-tab',
                    templateUrl: './tab.component.html',
                    styleUrls: ['./tab.component.css']
                }]
        }], ctorParameters: function () { return [{ type: i1.TabService }]; }, propDecorators: { links: [{
                type: Input,
                args: ['lnks']
            }], clss: [{
                type: Input,
                args: ['clss']
            }], evnt: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFiLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FuZ2wtYnN0cC11aS9zcmMvbGliL3RhYi90YWIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYW5nbC1ic3RwLXVpL3NyYy9saWIvdGFiL3RhYi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQVUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7O0FBVS9FLE1BQU0sT0FBTyxZQUFZO0lBS3ZCLFlBQW9CLE9BQW1CO1FBQW5CLFlBQU8sR0FBUCxPQUFPLENBQVk7UUFEN0IsU0FBSSxHQUFFLElBQUksWUFBWSxFQUFFLENBQUM7SUFHbEMsQ0FBQztJQUVGLFFBQVE7SUFFUixDQUFDO0lBRUQsa0JBQWtCO1FBQ2hCLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUMsSUFBWSxFQUFDLEVBQUU7WUFDakMsSUFBRyxJQUFJLENBQUMsSUFBSSxFQUFDO2dCQUNYLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ3pCO1FBQ0gsQ0FBQyxDQUFDLENBQUE7SUFDSixDQUFDO0lBRUQsSUFBSSxDQUFDLEVBQVM7UUFDWixJQUFJLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDLEtBQWEsRUFBRSxFQUFFO1lBQ25DLElBQUcsRUFBRSxJQUFJLEtBQUssQ0FBQyxFQUFFLEVBQUM7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