import { Component, ContentChild, EventEmitter, HostListener, Input, Output } from '@angular/core';
import { ThumbnailComponent } from '@seniorsistemas/angular-components/thumbnail';
import { Breakpoints } from '@seniorsistemas/angular-components/utils';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@seniorsistemas/angular-components/tooltip";
import * as i3 from "@seniorsistemas/angular-components/thumbnail";
import * as i4 from "@seniorsistemas/angular-components/button";
export class ObjectCardMainComponent {
    static nextIdSeed = 0;
    static _nextId = ObjectCardMainComponent.nextIdSeed;
    static getNextId() {
        return this._nextId++;
    }
    id = `s-object-card-main-${ObjectCardMainComponent.getNextId()}`;
    imageSource;
    imageFallback;
    imageAlt;
    iconClass = 'fa fa-picture-o';
    hasThumbnail = true;
    hasDescription = true;
    isBrand = false;
    label;
    description;
    buttonLabel;
    buttonModel = [];
    buttonClick = new EventEmitter();
    thumbnailComponent = null;
    _thumbnailSize = 'medium';
    get thumbnailSize() {
        return this._thumbnailSize;
    }
    set thumbnailSize(value) {
        this._thumbnailSize = value;
        if (this.thumbnailComponent) {
            this.thumbnailComponent.size = value;
        }
    }
    onResize() {
        this.update();
    }
    ngAfterContentInit() {
        this.update();
    }
    update() {
        this.thumbnailSize = window.innerWidth <= Breakpoints.SM_MAX ? 'small' : 'medium';
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ObjectCardMainComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ObjectCardMainComponent, selector: "s-object-card-main", inputs: { id: "id", imageSource: "imageSource", imageFallback: "imageFallback", imageAlt: "imageAlt", iconClass: "iconClass", hasThumbnail: "hasThumbnail", hasDescription: "hasDescription", isBrand: "isBrand", label: "label", description: "description", buttonLabel: "buttonLabel", buttonModel: "buttonModel" }, outputs: { buttonClick: "buttonClick" }, host: { listeners: { "window:resize": "onResize()" } }, queries: [{ propertyName: "thumbnailComponent", first: true, predicate: ThumbnailComponent, descendants: true, static: true }], ngImport: i0, template: "<ng-container *ngIf=\"hasThumbnail\">\n    <ng-content select=\"s-thumbnail\"></ng-content>\n    <s-thumbnail\n        [id]=\"id + '-thumbnail'\"\n        [imageSource]=\"imageSource\"\n        [imageFallback]=\"imageFallback\"\n        [imageAlt]=\"imageAlt || label\"\n        [iconClass]=\"iconClass\"\n        [size]=\"thumbnailSize\"\n        *ngIf=\"!thumbnailComponent\"\n        [isBrand]=\"isBrand\"\n    ></s-thumbnail>\n</ng-container>\n\n<ng-container *ngIf=\"hasDescription\">\n    <div class=\"info-container\">\n            <div #labelTemplate><ng-content select=\"[labelTemplate]\"></ng-content></div>\n            <span\n                [id]=\"id + '-label'\"\n                *ngIf=\"!labelTemplate.children.length\"\n                class=\"label\"\n                [sTooltip]=\"label\"\n                tooltipPosition=\"top\"\n                [showDelay]=\"500\"\n                >{{ label }}</span\n            >\n\n            <div #descriptionTemplate><ng-content select=\"[descriptionTemplate]\"></ng-content></div>\n            <span\n                [id]=\"id + '-description'\"\n                *ngIf=\"!descriptionTemplate.children.length\"\n                class=\"description\"\n                [sTooltip]=\"description\"\n                tooltipPosition=\"top\"\n                [showDelay]=\"500\"\n                >{{ description }}</span\n            >\n            <s-button\n                [id]=\"id + '-button'\"\n                *ngIf=\"buttonLabel\"\n                styleClass=\"object-card-button\"\n                priority=\"link\"\n                [label]=\"buttonLabel\"\n                [menuOptions]=\"buttonModel\"\n                size=\"small\"\n                (clicked)=\"buttonClick.emit($event)\"\n            ></s-button>\n        </div>\n</ng-container>\n", styles: [":host{align-items:center;display:flex;min-height:70px}.info-container{margin-left:10px;flex:1}.info-container,.info-container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.info-container .label{display:block;font-weight:700}.info-container .description{color:#999;display:block}@media (max-width: 767px){.info-container,.info-container span{white-space:normal}}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.TooltipDirective, selector: "[sTooltip]", inputs: ["sTooltip", "tooltipPosition", "showDelay", "displayTime", "tooltipEvent", "escape", "visible", "mobileBehavior", "focusedInputRef", "checkTruncatedText"] }, { kind: "component", type: i3.ThumbnailComponent, selector: "s-thumbnail", inputs: ["id", "size", "imageSource", "imageFallback", "imageAlt", "iconClass", "hasAction", "actionIconClass", "isTile", "isBrand"] }, { kind: "component", type: i4.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor", "menuAriaLabel"], outputs: ["clicked"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ObjectCardMainComponent, decorators: [{
            type: Component,
            args: [{ selector: 's-object-card-main', template: "<ng-container *ngIf=\"hasThumbnail\">\n    <ng-content select=\"s-thumbnail\"></ng-content>\n    <s-thumbnail\n        [id]=\"id + '-thumbnail'\"\n        [imageSource]=\"imageSource\"\n        [imageFallback]=\"imageFallback\"\n        [imageAlt]=\"imageAlt || label\"\n        [iconClass]=\"iconClass\"\n        [size]=\"thumbnailSize\"\n        *ngIf=\"!thumbnailComponent\"\n        [isBrand]=\"isBrand\"\n    ></s-thumbnail>\n</ng-container>\n\n<ng-container *ngIf=\"hasDescription\">\n    <div class=\"info-container\">\n            <div #labelTemplate><ng-content select=\"[labelTemplate]\"></ng-content></div>\n            <span\n                [id]=\"id + '-label'\"\n                *ngIf=\"!labelTemplate.children.length\"\n                class=\"label\"\n                [sTooltip]=\"label\"\n                tooltipPosition=\"top\"\n                [showDelay]=\"500\"\n                >{{ label }}</span\n            >\n\n            <div #descriptionTemplate><ng-content select=\"[descriptionTemplate]\"></ng-content></div>\n            <span\n                [id]=\"id + '-description'\"\n                *ngIf=\"!descriptionTemplate.children.length\"\n                class=\"description\"\n                [sTooltip]=\"description\"\n                tooltipPosition=\"top\"\n                [showDelay]=\"500\"\n                >{{ description }}</span\n            >\n            <s-button\n                [id]=\"id + '-button'\"\n                *ngIf=\"buttonLabel\"\n                styleClass=\"object-card-button\"\n                priority=\"link\"\n                [label]=\"buttonLabel\"\n                [menuOptions]=\"buttonModel\"\n                size=\"small\"\n                (clicked)=\"buttonClick.emit($event)\"\n            ></s-button>\n        </div>\n</ng-container>\n", styles: [":host{align-items:center;display:flex;min-height:70px}.info-container{margin-left:10px;flex:1}.info-container,.info-container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.info-container .label{display:block;font-weight:700}.info-container .description{color:#999;display:block}@media (max-width: 767px){.info-container,.info-container span{white-space:normal}}\n"] }]
        }], propDecorators: { id: [{
                type: Input
            }], imageSource: [{
                type: Input
            }], imageFallback: [{
                type: Input
            }], imageAlt: [{
                type: Input
            }], iconClass: [{
                type: Input
            }], hasThumbnail: [{
                type: Input
            }], hasDescription: [{
                type: Input
            }], isBrand: [{
                type: Input
            }], label: [{
                type: Input
            }], description: [{
                type: Input
            }], buttonLabel: [{
                type: Input
            }], buttonModel: [{
                type: Input
            }], buttonClick: [{
                type: Output
            }], thumbnailComponent: [{
                type: ContentChild,
                args: [ThumbnailComponent, { static: true }]
            }], onResize: [{
                type: HostListener,
                args: ['window:resize']
            }] } });
//# sourceMappingURL=data:application/json;base64, 