import { __decorate, __metadata } from "tslib";
import { Component, ElementRef, EventEmitter, HostBinding, Input, Output } from '@angular/core';
import { coerceBoolean } from '@eui/base';
import { EclBaseEvent } from '../../model';
import { ECLBaseDirective } from '../ecl-base.directive';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/router";
import * as i3 from "../ecl-link/ecl-link.directive";
import * as i4 from "../ecl-icon/ecl-icon.component";
export class EclBreadcrumbSegmentClickEvent extends EclBaseEvent {
}
export class EclBreadcrumbSegmentComponent extends ECLBaseDirective {
    constructor(el) {
        super();
        this.el = el;
        this.tabIndex = '-1';
        this.routerLink = null;
        this.queryParams = null;
        this.queryParamsHandling = null;
        this.href = '';
        this.isCurrentPage = false;
        this.isHidden = null;
        this.segmentClick = new EventEmitter();
    }
    get cssClasses() {
        return [
            super.getCssClasses('ecl-breadcrumb__segment'),
            this.isCurrentPage ? 'ecl-breadcrumb__current-page' : ''
        ].join(' ').trim();
    }
    onSegmentClick(evt) {
        this.segmentClick.next(new EclBreadcrumbSegmentClickEvent());
        if (!this.href) {
            evt.stopPropagation();
        }
    }
}
/** @nocollapse */ EclBreadcrumbSegmentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: EclBreadcrumbSegmentComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ EclBreadcrumbSegmentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: EclBreadcrumbSegmentComponent, selector: "ecl-breadcrumb-segment", inputs: { routerLink: "routerLink", queryParams: "queryParams", queryParamsHandling: "queryParamsHandling", href: "href", isCurrentPage: "isCurrentPage", isNegative: "isNegative", isHidden: "isHidden" }, outputs: { segmentClick: "segmentClick" }, host: { properties: { "attr.tabindex": "this.tabIndex", "class.ecl-u-d-none": "this.isHidden", "attr.hidden": "this.isHidden", "class": "this.cssClasses" } }, usesInheritance: true, ngImport: i0, template: "<a *ngIf=\"!isCurrentPage && href\"\n   eclLink\n   variant=\"standalone\"\n   [isNoVisited]=\"true\"\n   [isNegative]=\"isNegative\"\n   [href]=\"href\"\n   (click)=\"onSegmentClick($event)\"\n   class=\"ecl-breadcrumb__link\">\n    <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n</a>\n<a *ngIf=\"!isCurrentPage && !href\"\n   eclLink\n   [routerLink]=\"routerLink\"\n   [queryParams]=\"queryParams\"\n   [queryParamsHandling]=\"queryParamsHandling\"\n   variant=\"standalone\"\n   [isNoVisited]=\"true\"\n   [isNegative]=\"isNegative\"\n   [href]=\"href\"\n   tabindex\n   (click)=\"onSegmentClick($event)\"\n   class=\"ecl-breadcrumb__link\">\n    <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n</a>\n<ng-container *ngIf=\"isCurrentPage\">\n    <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n</ng-container>\n<ecl-icon *ngIf=\"!isCurrentPage\"\n          role=\"presentation\"\n          icon=\"corner-arrow\"\n          size=\"2xs\"\n          class=\"ecl-breadcrumb__icon ecl-icon--rotate-90\">\n</ecl-icon>\n\n<ng-template #content>\n    <ng-content></ng-content>\n</ng-template>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.EclLinkDirective, selector: "[eclLink]", inputs: ["variant", "isNegative", "isNoVisited"] }, { kind: "component", type: i4.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "ariaHidden", "focusable"] }] });
__decorate([
    coerceBoolean,
    __metadata("design:type", Object)
], EclBreadcrumbSegmentComponent.prototype, "isCurrentPage", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Object)
], EclBreadcrumbSegmentComponent.prototype, "isNegative", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: EclBreadcrumbSegmentComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ecl-breadcrumb-segment', template: "<a *ngIf=\"!isCurrentPage && href\"\n   eclLink\n   variant=\"standalone\"\n   [isNoVisited]=\"true\"\n   [isNegative]=\"isNegative\"\n   [href]=\"href\"\n   (click)=\"onSegmentClick($event)\"\n   class=\"ecl-breadcrumb__link\">\n    <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n</a>\n<a *ngIf=\"!isCurrentPage && !href\"\n   eclLink\n   [routerLink]=\"routerLink\"\n   [queryParams]=\"queryParams\"\n   [queryParamsHandling]=\"queryParamsHandling\"\n   variant=\"standalone\"\n   [isNoVisited]=\"true\"\n   [isNegative]=\"isNegative\"\n   [href]=\"href\"\n   tabindex\n   (click)=\"onSegmentClick($event)\"\n   class=\"ecl-breadcrumb__link\">\n    <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n</a>\n<ng-container *ngIf=\"isCurrentPage\">\n    <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n</ng-container>\n<ecl-icon *ngIf=\"!isCurrentPage\"\n          role=\"presentation\"\n          icon=\"corner-arrow\"\n          size=\"2xs\"\n          class=\"ecl-breadcrumb__icon ecl-icon--rotate-90\">\n</ecl-icon>\n\n<ng-template #content>\n    <ng-content></ng-content>\n</ng-template>" }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { tabIndex: [{
                type: HostBinding,
                args: ['attr.tabindex']
            }], routerLink: [{
                type: Input
            }], queryParams: [{
                type: Input
            }], queryParamsHandling: [{
                type: Input
            }], href: [{
                type: Input
            }], isCurrentPage: [{
                type: Input
            }], isNegative: [{
                type: Input
            }], isHidden: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['class.ecl-u-d-none']
            }, {
                type: HostBinding,
                args: ['attr.hidden']
            }], segmentClick: [{
                type: Output
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }] } });
//# sourceMappingURL=data:application/json;base64, 