import { Component, Input, Output, EventEmitter, HostBinding } from '@angular/core';
import { EclFileDownloadEvent } from './ecl-file-item/ecl-file-download.event';
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 "../ecl-label/ecl-label.directive";
import * as i4 from "../ecl-link/ecl-link.directive";
import * as i5 from "@ngx-translate/core";
export class EclFileComponent extends ECLBaseDirective {
    constructor() {
        super(...arguments);
        this.href = '';
        this.ariaLabel = '';
        this.itemDownload = new EventEmitter();
    }
    get cssClasses() {
        return [
            super.getCssClasses('ecl-file'),
            this.isThumbnail ? 'ecl-file--thumbnail' : '',
        ].join(' ').trim();
    }
    get isThumbnail() {
        return !!this.thumbnailUrl;
    }
    onItemClick(evt) {
        const event = new EclFileDownloadEvent(this.href);
        this.itemDownload.next(event);
        if (!this.href || event.defaultPrevented) {
            evt.preventDefault();
        }
    }
}
/** @nocollapse */ /** @nocollapse */ EclFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: EclFileComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ /** @nocollapse */ EclFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.0", type: EclFileComponent, selector: "ecl-file", inputs: { eclTitle: "eclTitle", description: "description", label: "label", labelInfo: "labelInfo", language: "language", detailMeta: "detailMeta", meta: "meta", thumbnailUrl: "thumbnailUrl", href: "href", ariaLabel: ["aria-label", "ariaLabel"] }, outputs: { itemDownload: "itemDownload" }, host: { properties: { "class": "this.cssClasses" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"ecl-file__container\">\n    <ecl-icon *ngIf=\"!isThumbnail\" icon=\"file\" class=\"ecl-file__icon\" size=\"2xl\"></ecl-icon>\n    <div *ngIf=\"isThumbnail\" class=\"ecl-file__detail\">\n        <div class=\"ecl-file__detail-info\">\n            <div class=\"ecl-file__label\" *ngIf=\"labelInfo\"><span eclLabel variant=\"highlight\">{{ labelInfo }}</span></div>\n            <div class=\"ecl-file__detail-meta\">\n                <span class=\"ecl-file__detail-meta-item\" *ngFor=\"let el of detailMeta\">{{ el }}</span></div>\n            <div class=\"ecl-file__title\">{{ eclTitle }}</div>\n            <div class=\"ecl-file__description\">{{ description }}</div>\n        </div>\n        <img class=\"ecl-file__image\" [src]=\"thumbnailUrl\" alt=\"thumbnail\" />\n    </div>\n    <ng-content select=\"ecl-file-taxonomy\"></ng-content>\n    <div class=\"ecl-file__info\">\n        <div *ngIf=\"!isThumbnail\" class=\"ecl-file__title\">{{ eclTitle }}</div>\n        <div class=\"ecl-file__language\">{{ language }}</div>\n        <div class=\"ecl-file__meta\">{{ meta }}</div>\n    </div>\n    <a eclLink\n        variant=\"standalone\"\n        [href]=\"href\"\n        [download]=\"href\"\n        class=\"ecl-file__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</div>\n<ng-content></ng-content>\n", styles: [":host{display:block}\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.EclLabelDirective, selector: "[eclLabel]", inputs: ["variant"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.EclLinkDirective, selector: "[eclLink]", inputs: ["variant", "isNegative", "isNoVisited"] }], pipes: { "translate": i5.TranslatePipe } });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: EclFileComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ecl-file', styles: [`
        :host {
            display: block;
        }
    `], template: "<div class=\"ecl-file__container\">\n    <ecl-icon *ngIf=\"!isThumbnail\" icon=\"file\" class=\"ecl-file__icon\" size=\"2xl\"></ecl-icon>\n    <div *ngIf=\"isThumbnail\" class=\"ecl-file__detail\">\n        <div class=\"ecl-file__detail-info\">\n            <div class=\"ecl-file__label\" *ngIf=\"labelInfo\"><span eclLabel variant=\"highlight\">{{ labelInfo }}</span></div>\n            <div class=\"ecl-file__detail-meta\">\n                <span class=\"ecl-file__detail-meta-item\" *ngFor=\"let el of detailMeta\">{{ el }}</span></div>\n            <div class=\"ecl-file__title\">{{ eclTitle }}</div>\n            <div class=\"ecl-file__description\">{{ description }}</div>\n        </div>\n        <img class=\"ecl-file__image\" [src]=\"thumbnailUrl\" alt=\"thumbnail\" />\n    </div>\n    <ng-content select=\"ecl-file-taxonomy\"></ng-content>\n    <div class=\"ecl-file__info\">\n        <div *ngIf=\"!isThumbnail\" class=\"ecl-file__title\">{{ eclTitle }}</div>\n        <div class=\"ecl-file__language\">{{ language }}</div>\n        <div class=\"ecl-file__meta\">{{ meta }}</div>\n    </div>\n    <a eclLink\n        variant=\"standalone\"\n        [href]=\"href\"\n        [download]=\"href\"\n        class=\"ecl-file__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</div>\n<ng-content></ng-content>\n" }]
        }], propDecorators: { eclTitle: [{
                type: Input
            }], description: [{
                type: Input
            }], label: [{
                type: Input
            }], labelInfo: [{
                type: Input
            }], language: [{
                type: Input
            }], detailMeta: [{
                type: Input
            }], meta: [{
                type: Input
            }], thumbnailUrl: [{
                type: Input
            }], href: [{
                type: Input
            }], ariaLabel: [{
                type: Input,
                args: ['aria-label']
            }], itemDownload: [{
                type: Output
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }] } });
//# sourceMappingURL=data:application/json;base64, 