import { Component, ContentChild, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core';
import { ThumbnailComponent } from '@seniorsistemas/angular-components/thumbnail';
import { ButtonComponent } from '@seniorsistemas/angular-components/button';
import { Tooltip } from 'primeng/tooltip';
import { NgClass, NgTemplateOutlet } from '@angular/common';
import * as i0 from "@angular/core";
export class GlobalSearchDropdownItemComponent {
    static nextId = 0;
    id = `s-global-search-dropdown-item-${GlobalSearchDropdownItemComponent.nextId++}`;
    primaryLabel;
    secondaryEmptyLabel;
    tertiaryEmptyLabel;
    imageSource;
    imageAlt;
    iconClass;
    secondaryLabel;
    tertiaryLabel;
    size = 'standart';
    template = null;
    buttonClick = new EventEmitter();
    thumbnailComponent = null;
    content = null;
    isMediumSize() {
        return this.size === 'medium';
    }
    isSmallSize() {
        return this.size === 'small';
    }
    getImageSize() {
        return this._isStandardSize() ? 'medium' : 'small';
    }
    _isStandardSize() {
        return this.size === 'standart';
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchDropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: GlobalSearchDropdownItemComponent, isStandalone: true, selector: "s-global-search-dropdown-item", inputs: { id: "id", primaryLabel: "primaryLabel", secondaryEmptyLabel: "secondaryEmptyLabel", tertiaryEmptyLabel: "tertiaryEmptyLabel", imageSource: "imageSource", imageAlt: "imageAlt", iconClass: "iconClass", secondaryLabel: "secondaryLabel", tertiaryLabel: "tertiaryLabel", size: "size", template: "template" }, outputs: { buttonClick: "buttonClick" }, queries: [{ propertyName: "thumbnailComponent", first: true, predicate: ThumbnailComponent, descendants: true, static: true }], viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, static: true }], ngImport: i0, template: "<ng-template>\r\n    <div\r\n        class=\"global-search-dropdown-item\"\r\n        [ngClass]=\"{ 'grid grid-cols-2 gap-2': isSmallSize() }\"\r\n    >\r\n        <ng-content select=\"s-thumbnail\"></ng-content>\r\n\r\n        @if (!thumbnailComponent && (imageSource || iconClass) && !isSmallSize()) {\r\n            <s-thumbnail\r\n                [id]=\"id + '-thumbnail'\"\r\n                [imageSource]=\"imageSource\"\r\n                [imageAlt]=\"imageAlt || primaryLabel\"\r\n                [iconClass]=\"iconClass ?? ''\"\r\n                [size]=\"getImageSize()\"\r\n            ></s-thumbnail>\r\n        }\r\n\r\n        <div\r\n            class=\"global-search-item__container ml-[10px] only:ml-0 w-full whitespace-nowrap max-md:whitespace-normal overflow-hidden text-ellipsis {{ !isSmallSize() ? 'w-[60%]' : '' }}\"\r\n        >\r\n            <div #titleTemplate>\r\n                <ng-content select=\"[titleTemplate]\"></ng-content>\r\n            </div>\r\n            @if (!titleTemplate.children.length) {\r\n                <s-button\r\n                    styleClass=\"no-padding\"\r\n                    [id]=\"id + '-title'\"\r\n                    priority=\"link\"\r\n                    [pTooltip]=\"primaryLabel\"\r\n                    [label]=\"primaryLabel\"\r\n                    size=\"small\"\r\n                    (clicked)=\"buttonClick.emit()\"\r\n                >\r\n                </s-button>\r\n            }\r\n\r\n            <div #labelTemplate>\r\n                <ng-content select=\"[labelTemplate]\"></ng-content>\r\n            </div>\r\n\r\n            @if (!labelTemplate.children.length) {\r\n                <span\r\n                    [id]=\"id + '-label'\"\r\n                    [ngClass]=\"{\r\n                        'text-right pt-[2px] pl-[15px]': isSmallSize(),\r\n                        'italic': !secondaryLabel,\r\n                    }\"\r\n                    class=\"text-grayscale-90 block whitespace-nowrap max-md:whitespace-normal overflow-hidden text-ellipsis\"\r\n                    [pTooltip]=\"secondaryLabel\"\r\n                    tooltipPosition=\"top\"\r\n                    showDelay=\"500\"\r\n                    >{{ secondaryLabel ? secondaryLabel : secondaryEmptyLabel }}</span\r\n                >\r\n            }\r\n\r\n            <div #descriptionTemplate>\r\n                <ng-content select=\"[descriptionTemplate]\"></ng-content>\r\n            </div>\r\n\r\n            @if (!descriptionTemplate.children.length && !isMediumSize() && !isSmallSize()) {\r\n                <span\r\n                    [id]=\"id + '-description'\"\r\n                    class=\"text-grayscale-50 block whitespace-nowrap max-md:whitespace-normal overflow-hidden text-ellipsis\"\r\n                    [ngClass]=\"{ 'italic': !secondaryLabel }\"\r\n                    [pTooltip]=\"tertiaryLabel\"\r\n                    tooltipPosition=\"top\"\r\n                    showDelay=\"500\"\r\n                >\r\n                    {{ tertiaryLabel ? tertiaryLabel : tertiaryEmptyLabel }}\r\n                </span>\r\n            }\r\n        </div>\r\n        @if (!isSmallSize()) {\r\n            <div class=\"w-[40%] flex flex-col text-right\">\r\n                <ng-container *ngTemplateOutlet=\"template\"></ng-container>\r\n            </div>\r\n        }\r\n    </div>\r\n</ng-template>\r\n", styles: ["::ng-deep .no-padding{padding:0!important;min-width:0px!important}::ng-deep .s-button-with-text{min-width:0px!important}\n"], dependencies: [{ kind: "component", type: ThumbnailComponent, selector: "s-thumbnail", inputs: ["id", "size", "imageSource", "imageFallback", "imageAlt", "iconClass", "hasAction", "actionIconClass", "isTile", "isBrand"] }, { kind: "component", type: 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", "ariaLabel"], outputs: ["clicked"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GlobalSearchDropdownItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 's-global-search-dropdown-item', standalone: true, imports: [ThumbnailComponent, ButtonComponent, Tooltip, NgClass, NgTemplateOutlet], template: "<ng-template>\r\n    <div\r\n        class=\"global-search-dropdown-item\"\r\n        [ngClass]=\"{ 'grid grid-cols-2 gap-2': isSmallSize() }\"\r\n    >\r\n        <ng-content select=\"s-thumbnail\"></ng-content>\r\n\r\n        @if (!thumbnailComponent && (imageSource || iconClass) && !isSmallSize()) {\r\n            <s-thumbnail\r\n                [id]=\"id + '-thumbnail'\"\r\n                [imageSource]=\"imageSource\"\r\n                [imageAlt]=\"imageAlt || primaryLabel\"\r\n                [iconClass]=\"iconClass ?? ''\"\r\n                [size]=\"getImageSize()\"\r\n            ></s-thumbnail>\r\n        }\r\n\r\n        <div\r\n            class=\"global-search-item__container ml-[10px] only:ml-0 w-full whitespace-nowrap max-md:whitespace-normal overflow-hidden text-ellipsis {{ !isSmallSize() ? 'w-[60%]' : '' }}\"\r\n        >\r\n            <div #titleTemplate>\r\n                <ng-content select=\"[titleTemplate]\"></ng-content>\r\n            </div>\r\n            @if (!titleTemplate.children.length) {\r\n                <s-button\r\n                    styleClass=\"no-padding\"\r\n                    [id]=\"id + '-title'\"\r\n                    priority=\"link\"\r\n                    [pTooltip]=\"primaryLabel\"\r\n                    [label]=\"primaryLabel\"\r\n                    size=\"small\"\r\n                    (clicked)=\"buttonClick.emit()\"\r\n                >\r\n                </s-button>\r\n            }\r\n\r\n            <div #labelTemplate>\r\n                <ng-content select=\"[labelTemplate]\"></ng-content>\r\n            </div>\r\n\r\n            @if (!labelTemplate.children.length) {\r\n                <span\r\n                    [id]=\"id + '-label'\"\r\n                    [ngClass]=\"{\r\n                        'text-right pt-[2px] pl-[15px]': isSmallSize(),\r\n                        'italic': !secondaryLabel,\r\n                    }\"\r\n                    class=\"text-grayscale-90 block whitespace-nowrap max-md:whitespace-normal overflow-hidden text-ellipsis\"\r\n                    [pTooltip]=\"secondaryLabel\"\r\n                    tooltipPosition=\"top\"\r\n                    showDelay=\"500\"\r\n                    >{{ secondaryLabel ? secondaryLabel : secondaryEmptyLabel }}</span\r\n                >\r\n            }\r\n\r\n            <div #descriptionTemplate>\r\n                <ng-content select=\"[descriptionTemplate]\"></ng-content>\r\n            </div>\r\n\r\n            @if (!descriptionTemplate.children.length && !isMediumSize() && !isSmallSize()) {\r\n                <span\r\n                    [id]=\"id + '-description'\"\r\n                    class=\"text-grayscale-50 block whitespace-nowrap max-md:whitespace-normal overflow-hidden text-ellipsis\"\r\n                    [ngClass]=\"{ 'italic': !secondaryLabel }\"\r\n                    [pTooltip]=\"tertiaryLabel\"\r\n                    tooltipPosition=\"top\"\r\n                    showDelay=\"500\"\r\n                >\r\n                    {{ tertiaryLabel ? tertiaryLabel : tertiaryEmptyLabel }}\r\n                </span>\r\n            }\r\n        </div>\r\n        @if (!isSmallSize()) {\r\n            <div class=\"w-[40%] flex flex-col text-right\">\r\n                <ng-container *ngTemplateOutlet=\"template\"></ng-container>\r\n            </div>\r\n        }\r\n    </div>\r\n</ng-template>\r\n", styles: ["::ng-deep .no-padding{padding:0!important;min-width:0px!important}::ng-deep .s-button-with-text{min-width:0px!important}\n"] }]
        }], propDecorators: { id: [{
                type: Input
            }], primaryLabel: [{
                type: Input
            }], secondaryEmptyLabel: [{
                type: Input
            }], tertiaryEmptyLabel: [{
                type: Input
            }], imageSource: [{
                type: Input
            }], imageAlt: [{
                type: Input
            }], iconClass: [{
                type: Input
            }], secondaryLabel: [{
                type: Input
            }], tertiaryLabel: [{
                type: Input
            }], size: [{
                type: Input
            }], template: [{
                type: Input
            }], buttonClick: [{
                type: Output
            }], thumbnailComponent: [{
                type: ContentChild,
                args: [ThumbnailComponent, { static: true }]
            }], content: [{
                type: ViewChild,
                args: [TemplateRef, { static: true }]
            }] } });
//# sourceMappingURL=data:application/json;base64, 