import { Component, Input, HostBinding, Output, EventEmitter } from '@angular/core';
import { EclFileComponent } from '../ecl-file.component';
import { EclFileDownloadEvent } from './ecl-file-download.event';
import { ECLBaseDirective } from '../../ecl-base.directive';
import * as i0 from "@angular/core";
import * as i1 from "../ecl-file.component";
import * as i2 from "../../ecl-icon/ecl-icon.component";
import * as i3 from "@angular/common";
import * as i4 from "../../ecl-link/ecl-link.directive";
import * as i5 from "@ngx-translate/core";
export class EclFileItemComponent extends ECLBaseDirective {
    constructor(eclFileComponent) {
        super();
        this.eclFileComponent = eclFileComponent;
        this.isDescription = false;
        this.href = '';
        this.ariaLabel = '';
        this.itemDownload = new EventEmitter();
    }
    get cssClasses() {
        return [
            super.getCssClasses('ecl-file__translation-item'),
            this.isDescription ? 'ecl-file__translation-description' : ''
        ].join(' ').trim();
    }
    get isThumbnail() {
        return this.eclFileComponent && this.eclFileComponent.isThumbnail;
    }
    onItemClick(evt) {
        const event = new EclFileDownloadEvent(this.href);
        this.itemDownload.next(event);
        if (!this.href || event.defaultPrevented) {
            evt.preventDefault();
        }
    }
}
/** @nocollapse */ /** @nocollapse */ EclFileItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EclFileItemComponent, deps: [{ token: i1.EclFileComponent }], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ /** @nocollapse */ EclFileItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: EclFileItemComponent, selector: "ecl-file-item", inputs: { isDescription: "isDescription", eclTitle: "eclTitle", language: "language", description: "description", meta: "meta", label: "label", langDetail: "langDetail", href: "href", ariaLabel: ["aria-label", "ariaLabel"] }, outputs: { itemDownload: "itemDownload" }, host: { properties: { "class": "this.cssClasses" } }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"!isDescription\">\n    <div *ngIf=\"isThumbnail\" class=\"ecl-file__translation-detail\">\n        <div class=\"ecl-file__translation-title\" [attr.lang]=\"langDetail\">{{ eclTitle }}</div>\n        <div class=\"ecl-file__translation-description\" [attr.lang]=\"langDetail\">{{ description }}</div>\n    </div>\n    <div class=\"ecl-file__translation-info\">\n        <div *ngIf=\"isThumbnail\" class=\"ecl-file__translation-language\">{{ language }}</div>\n        <div *ngIf=\"!isThumbnail\" class=\"ecl-file__translation-title\" [attr.lang]=\"langDetail\">{{ eclTitle }}</div>\n        <div class=\"ecl-file__translation-meta\">{{ meta }}</div>\n    </div>\n    <a eclLink\n        variant=\"standalone\"\n        [href]=\"href\"\n        [download]=\"href\"\n        class=\"ecl-file__translation-download\"\n        (click)=\"onItemClick($event)\" [attr.aria-label]=\"ariaLabel\">\n        <span class=\"ecl-link__label\">{{ label || 'ecl.common.DOWNLOAD' | translate }}</span>&nbsp;\n        <ecl-icon icon=\"download\" size=\"fluid\"></ecl-icon>\n    </a>\n</ng-template>\n<ng-template [ngIf]=\"isDescription\">\n    <ng-content></ng-content>\n</ng-template>\n\n\n\n\n", components: [{ type: i2.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "ariaHidden", "focusable"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.EclLinkDirective, selector: "[eclLink]", inputs: ["variant", "isNegative", "isNoVisited"] }], pipes: { "translate": i5.TranslatePipe } });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EclFileItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ecl-file-item', template: "<ng-template [ngIf]=\"!isDescription\">\n    <div *ngIf=\"isThumbnail\" class=\"ecl-file__translation-detail\">\n        <div class=\"ecl-file__translation-title\" [attr.lang]=\"langDetail\">{{ eclTitle }}</div>\n        <div class=\"ecl-file__translation-description\" [attr.lang]=\"langDetail\">{{ description }}</div>\n    </div>\n    <div class=\"ecl-file__translation-info\">\n        <div *ngIf=\"isThumbnail\" class=\"ecl-file__translation-language\">{{ language }}</div>\n        <div *ngIf=\"!isThumbnail\" class=\"ecl-file__translation-title\" [attr.lang]=\"langDetail\">{{ eclTitle }}</div>\n        <div class=\"ecl-file__translation-meta\">{{ meta }}</div>\n    </div>\n    <a eclLink\n        variant=\"standalone\"\n        [href]=\"href\"\n        [download]=\"href\"\n        class=\"ecl-file__translation-download\"\n        (click)=\"onItemClick($event)\" [attr.aria-label]=\"ariaLabel\">\n        <span class=\"ecl-link__label\">{{ label || 'ecl.common.DOWNLOAD' | translate }}</span>&nbsp;\n        <ecl-icon icon=\"download\" size=\"fluid\"></ecl-icon>\n    </a>\n</ng-template>\n<ng-template [ngIf]=\"isDescription\">\n    <ng-content></ng-content>\n</ng-template>\n\n\n\n\n" }]
        }], ctorParameters: function () { return [{ type: i1.EclFileComponent }]; }, propDecorators: { isDescription: [{
                type: Input
            }], eclTitle: [{
                type: Input
            }], language: [{
                type: Input
            }], description: [{
                type: Input
            }], meta: [{
                type: Input
            }], label: [{
                type: Input
            }], langDetail: [{
                type: Input
            }], href: [{
                type: Input
            }], ariaLabel: [{
                type: Input,
                args: ['aria-label']
            }], itemDownload: [{
                type: Output
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }] } });
//# sourceMappingURL=data:application/json;base64, 