import { __decorate, __metadata } from "tslib";
import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
import { EclBaseEvent } from '../../model/ecl-base.event';
import { coerceBoolean } from '@eui/base';
import { ECLBaseDirective } from '../ecl-base.directive';
import * as i0 from "@angular/core";
import * as i1 from "../ecl-icon/ecl-icon.component";
import * as i2 from "@angular/common";
import * as i3 from "@angular/router";
import * as i4 from "../ecl-link/ecl-link.directive";
import * as i5 from "../ecl-link/ecl-link-label.directive";
import * as i6 from "@ngx-translate/core";
export class EclPaginationItemClickEvent extends EclBaseEvent {
}
export class EclPaginationItemComponent extends ECLBaseDirective {
    constructor() {
        super(...arguments);
        this.routerLink = null;
        this.queryParams = null;
        this.href = '';
        this.pageClick = new EventEmitter();
    }
    get cssClasses() {
        return [
            super.getCssClasses('ecl-pagination__item'),
            this.isCurrent ? 'ecl-pagination__item--current' : '',
            this.isNext ? 'ecl-pagination__item--next' : '',
            this.isPrevious ? 'ecl-pagination__item--previous' : '',
        ].join(' ').trim();
    }
    onPageClick(evt) {
        this.pageClick.next(new EclPaginationItemClickEvent());
        if (!this.href) {
            evt.preventDefault();
        }
    }
    geti18nPageAriaLabelKey() {
        let key = '';
        if (this.isNext) {
            key = 'ecl.pagination.GO-TO-NEXT-PAGE';
        }
        else if (this.isPrevious) {
            key = 'ecl.pagination.GO-TO-PREV-PAGE';
        }
        else {
            key = 'ecl.pagination.GO-TO-PAGE';
        }
        return key;
    }
    geti18nPageLabelKey() {
        let key = '';
        if (this.isNext) {
            key = 'ecl.pagination.NEXT';
        }
        else if (this.isPrevious) {
            key = 'ecl.pagination.PREVIOUS';
        }
        return key;
    }
}
/** @nocollapse */ EclPaginationItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EclPaginationItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ EclPaginationItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: EclPaginationItemComponent, selector: "ecl-pagination-item", inputs: { label: "label", ariaLabel: "ariaLabel", isCurrent: "isCurrent", isNext: "isNext", isPrevious: "isPrevious", routerLink: "routerLink", queryParams: "queryParams", href: "href" }, outputs: { pageClick: "pageClick" }, host: { properties: { "class": "this.cssClasses" } }, usesInheritance: true, ngImport: i0, template: "<a *ngIf=\"!isCurrent\"\n    eclLink\n    (click)=\"onPageClick($event)\"\n    variant=\"standalone\"\n    attr.aria-label=\"{{ ariaLabel || geti18nPageAriaLabelKey() | translate:{ pageNumber: label} }}\"\n    [routerLink]=\"routerLink\"\n    [queryParams]=\"queryParams\"\n    [href]=\"href\"\n    class=\"ecl-pagination__link\">\n    <ng-container *ngIf=\"isPrevious\">\n        <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-270\"></ecl-icon>\n    </ng-container>\n    <span eclLinkLabel>{{ label || geti18nPageLabelKey() | translate }}</span>\n    <ng-container *ngIf=\"isNext\">\n        <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-90\"></ecl-icon>\n    </ng-container>\n</a>\n\n<ng-container *ngIf=\"isCurrent\">\n    <span class=\"ecl-pagination__text ecl-pagination__text--summary\"\n        attr.aria-label=\"{{ ariaLabel || 'ecl.pagination.PAGE' | translate:{ pageNumber: label} }}\"\n        aria-current=\"true\">\n        {{ label }}\n    </span>\n    <span class=\"ecl-pagination__text ecl-pagination__text--full\"\n        aria-current=\"true\">\n        {{ 'ecl.pagination.PAGE' | translate:{ pageNumber: label} }}\n    </span>\n</ng-container>\n", components: [{ type: i1.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "ariaHidden", "focusable"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i4.EclLinkDirective, selector: "[eclLink]", inputs: ["variant", "isNegative", "isNoVisited"] }, { type: i5.EclLinkLabelDirective, selector: "[eclLinkLabel]" }], pipes: { "translate": i6.TranslatePipe } });
__decorate([
    coerceBoolean,
    __metadata("design:type", Boolean)
], EclPaginationItemComponent.prototype, "isCurrent", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Boolean)
], EclPaginationItemComponent.prototype, "isNext", void 0);
__decorate([
    coerceBoolean,
    __metadata("design:type", Boolean)
], EclPaginationItemComponent.prototype, "isPrevious", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EclPaginationItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ecl-pagination-item', template: "<a *ngIf=\"!isCurrent\"\n    eclLink\n    (click)=\"onPageClick($event)\"\n    variant=\"standalone\"\n    attr.aria-label=\"{{ ariaLabel || geti18nPageAriaLabelKey() | translate:{ pageNumber: label} }}\"\n    [routerLink]=\"routerLink\"\n    [queryParams]=\"queryParams\"\n    [href]=\"href\"\n    class=\"ecl-pagination__link\">\n    <ng-container *ngIf=\"isPrevious\">\n        <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-270\"></ecl-icon>\n    </ng-container>\n    <span eclLinkLabel>{{ label || geti18nPageLabelKey() | translate }}</span>\n    <ng-container *ngIf=\"isNext\">\n        <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-90\"></ecl-icon>\n    </ng-container>\n</a>\n\n<ng-container *ngIf=\"isCurrent\">\n    <span class=\"ecl-pagination__text ecl-pagination__text--summary\"\n        attr.aria-label=\"{{ ariaLabel || 'ecl.pagination.PAGE' | translate:{ pageNumber: label} }}\"\n        aria-current=\"true\">\n        {{ label }}\n    </span>\n    <span class=\"ecl-pagination__text ecl-pagination__text--full\"\n        aria-current=\"true\">\n        {{ 'ecl.pagination.PAGE' | translate:{ pageNumber: label} }}\n    </span>\n</ng-container>\n" }]
        }], propDecorators: { cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], label: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }], isCurrent: [{
                type: Input
            }], isNext: [{
                type: Input
            }], isPrevious: [{
                type: Input
            }], routerLink: [{
                type: Input
            }], queryParams: [{
                type: Input
            }], href: [{
                type: Input
            }], pageClick: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 