import { Component, EventEmitter, HostBinding, HostListener, Input, Output } from '@angular/core';
import { ENTER, hasModifierKey, SPACE } from '@angular/cdk/keycodes';
import * as i0 from "@angular/core";
export class TabsTabComponent {
    constructor(elementRef) {
        this.elementRef = elementRef;
        this.selected = new EventEmitter();
        this.role = 'tab';
    }
    get tabindex() {
        if (this.disabled) {
            return null;
        }
        return this.active ? 0 : -1;
    }
    get disabled() {
        return this.tab.disabled;
    }
    ngOnInit() {
    }
    getLabel() {
        return this.tab.label;
    }
    focus(origin) {
        this.elementRef.nativeElement.focus();
    }
    select() {
        if (!this.disabled) {
            this.selected.emit(this.tab);
        }
    }
    handleClick() {
        this.select();
    }
    handleKeydown(event) {
        if ((event.keyCode === ENTER || event.keyCode === SPACE) && !hasModifierKey(event)) {
            this.select();
            event.preventDefault();
        }
    }
}
TabsTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: TabsTabComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
TabsTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: TabsTabComponent, selector: "ui-tabs-tab", inputs: { tab: "tab", active: "active" }, outputs: { selected: "selected" }, host: { listeners: { "click": "handleClick()", "keydown": "handleKeydown($event)" }, properties: { "attr.aria-selected": "this.active", "class.active": "this.active", "attr.role": "this.role", "attr.tabindex": "this.tabindex", "class.disabled": "this.disabled", "attr.aria-hidden": "this.disabled" } }, ngImport: i0, template: "{{tab.label}}\n", styles: [".transition{transition:all .5s ease-in}.transition-fast{transition:all .2s ease-in}:host{position:relative;padding:0 0 12px;white-space:nowrap;color:var(--color-contrast-40);transition:color .2s ease-in-out;cursor:pointer}:host:not(:last-child){margin-right:32px}:host.disabled{color:var(--color-contrast-20);cursor:not-allowed}:host.disabled:hover{color:var(--color-contrast-20)}:host.active{font-weight:var(--font-weight-medium);color:var(--color-contrast-100)}:host.active:before{content:\" \";position:absolute;width:100%;height:2px;left:0;bottom:0;background:var(--color-contrast-100);border-radius:1px}:host:focus{outline:1px dotted var(--color-accent);outline-offset:-1px}:host:focus:not(:focus-visible){outline:none}:host:focus-visible{outline-offset:-1px}@media not all and (pointer: coarse){:host:hover{color:var(--color-contrast-100)}}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: TabsTabComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ui-tabs-tab', template: "{{tab.label}}\n", styles: [".transition{transition:all .5s ease-in}.transition-fast{transition:all .2s ease-in}:host{position:relative;padding:0 0 12px;white-space:nowrap;color:var(--color-contrast-40);transition:color .2s ease-in-out;cursor:pointer}:host:not(:last-child){margin-right:32px}:host.disabled{color:var(--color-contrast-20);cursor:not-allowed}:host.disabled:hover{color:var(--color-contrast-20)}:host.active{font-weight:var(--font-weight-medium);color:var(--color-contrast-100)}:host.active:before{content:\" \";position:absolute;width:100%;height:2px;left:0;bottom:0;background:var(--color-contrast-100);border-radius:1px}:host:focus{outline:1px dotted var(--color-accent);outline-offset:-1px}:host:focus:not(:focus-visible){outline:none}:host:focus-visible{outline-offset:-1px}@media not all and (pointer: coarse){:host:hover{color:var(--color-contrast-100)}}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { tab: [{
                type: Input
            }], selected: [{
                type: Output
            }], active: [{
                type: HostBinding,
                args: ['attr.aria-selected']
            }, {
                type: HostBinding,
                args: ['class.active']
            }, {
                type: Input
            }], role: [{
                type: HostBinding,
                args: ['attr.role']
            }], tabindex: [{
                type: HostBinding,
                args: ['attr.tabindex']
            }], disabled: [{
                type: HostBinding,
                args: ['class.disabled']
            }, {
                type: HostBinding,
                args: ['attr.aria-hidden']
            }], handleClick: [{
                type: HostListener,
                args: ['click']
            }], handleKeydown: [{
                type: HostListener,
                args: ['keydown', ['$event']]
            }] } });
//# sourceMappingURL=data:application/json;base64, 