import * as i0 from '@angular/core';
import { Component, Input, NgModule } from '@angular/core';
import { BadgeComponent } from '@seniorsistemas/angular-components/badge';
import { AsyncPipe } from '@angular/common';
import { TranslatePipe } from '@ngx-translate/core';
import { LocalizedDatePipe, LocalizedNumberPipe } from '@seniorsistemas/angular-components/locale';
import { NumericPipe } from '@seniorsistemas/angular-components/numeric';

/**
 * @description Componente de exibição de par label/valor que suporta diferentes
 * tipos de conteúdo configurados via `LabelValueConfiguration`: texto, número,
 * moeda, data e badge.
 *
 * @example
 * ```html
 * <s-label-value [configuration]="{ type: 'Text', label: 'Nome', value: 'João' }" />
 * ```
 *
 * @category Summary
 */
class LabelValueComponent {
    /** @description Configuração do par label/valor, incluindo tipo e dados para renderização. Campo obrigatório. */
    configuration;
    isBadgeConfiguration(config) {
        return config.type === 'Badge';
    }
    isTextConfiguration(config) {
        return config.type === 'Text';
    }
    isCurrencyConfiguration(config) {
        return config.type === 'Currency';
    }
    isNumberConfiguration(config) {
        return config.type === 'Number';
    }
    isDateConfiguration(config) {
        return config.type === 'Date';
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: LabelValueComponent, isStandalone: true, selector: "s-label-value", inputs: { configuration: "configuration" }, ngImport: i0, template: "<div class=\"flex flex-col\">\n    <p class=\"font-bold\">\n        {{ configuration.title }}\n    </p>\n\n    @if (configuration.value) {\n        @if (isTextConfiguration(configuration)) {\n            <span class=\"sds-readonly\">\n                {{ configuration.value }}\n            </span>\n        }\n\n        @if (isBadgeConfiguration(configuration)) {\n            @for (badge of configuration.value; track $index) {\n                <s-badge\n                    [type]=\"badge.type ?? 'pill'\"\n                    [color]=\"badge.color ?? 'blue'\"\n                    [text]=\"badge.text\"\n                    [iconClass]=\"badge.iconClass\"\n                    [iconPosition]=\"badge.iconPosition\"\n                ></s-badge>\n            }\n        }\n\n        @if (isCurrencyConfiguration(configuration)) {\n            <span class=\"sds-readonly\">\n                {{ configuration.value | numeric: { numberFormatOptions: { style: 'currency', currency: configuration.currency } } | async }}\n            </span>\n        }\n\n        @if (isNumberConfiguration(configuration)) {\n            <span class=\"sds-readonly\">\n                {{ configuration.value | localizedNumber | async }}\n            </span>\n        }\n\n        @if (isDateConfiguration(configuration)) {\n            <span class=\"sds-readonly\">\n                {{ configuration.value | localizedDate: configuration.format || 'L' | async }}\n            </span>\n        }\n    } @else {\n        <span class=\"sds-empty-value\">\n            {{ 'platform.angular_components.not_informed' | translate }}\n        </span>\n    }\n</div>\n", styles: [".flex{display:flex}.flex-col{flex-direction:column}.font-bold{font-weight:700}\n"], dependencies: [{ kind: "component", type: BadgeComponent, selector: "s-badge", inputs: ["type", "color", "title", "text", "selectable", "iconClass", "iconPosition", "infoSign", "enableTruncateText"], outputs: ["selected"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: LocalizedDatePipe, name: "localizedDate" }, { kind: "pipe", type: LocalizedNumberPipe, name: "localizedNumber" }, { kind: "pipe", type: NumericPipe, name: "numeric" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelValueComponent, decorators: [{
            type: Component,
            args: [{ selector: 's-label-value', standalone: true, imports: [BadgeComponent, AsyncPipe, TranslatePipe, LocalizedDatePipe, LocalizedNumberPipe, NumericPipe], template: "<div class=\"flex flex-col\">\n    <p class=\"font-bold\">\n        {{ configuration.title }}\n    </p>\n\n    @if (configuration.value) {\n        @if (isTextConfiguration(configuration)) {\n            <span class=\"sds-readonly\">\n                {{ configuration.value }}\n            </span>\n        }\n\n        @if (isBadgeConfiguration(configuration)) {\n            @for (badge of configuration.value; track $index) {\n                <s-badge\n                    [type]=\"badge.type ?? 'pill'\"\n                    [color]=\"badge.color ?? 'blue'\"\n                    [text]=\"badge.text\"\n                    [iconClass]=\"badge.iconClass\"\n                    [iconPosition]=\"badge.iconPosition\"\n                ></s-badge>\n            }\n        }\n\n        @if (isCurrencyConfiguration(configuration)) {\n            <span class=\"sds-readonly\">\n                {{ configuration.value | numeric: { numberFormatOptions: { style: 'currency', currency: configuration.currency } } | async }}\n            </span>\n        }\n\n        @if (isNumberConfiguration(configuration)) {\n            <span class=\"sds-readonly\">\n                {{ configuration.value | localizedNumber | async }}\n            </span>\n        }\n\n        @if (isDateConfiguration(configuration)) {\n            <span class=\"sds-readonly\">\n                {{ configuration.value | localizedDate: configuration.format || 'L' | async }}\n            </span>\n        }\n    } @else {\n        <span class=\"sds-empty-value\">\n            {{ 'platform.angular_components.not_informed' | translate }}\n        </span>\n    }\n</div>\n", styles: [".flex{display:flex}.flex-col{flex-direction:column}.font-bold{font-weight:700}\n"] }]
        }], propDecorators: { configuration: [{
                type: Input,
                args: [{ required: true }]
            }] } });

class LabelValueModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelValueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: LabelValueModule, imports: [LabelValueComponent], exports: [LabelValueComponent] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelValueModule, imports: [LabelValueComponent] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LabelValueModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [LabelValueComponent],
                    exports: [LabelValueComponent],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { LabelValueComponent, LabelValueModule };
//# sourceMappingURL=seniorsistemas-angular-components-label-value.mjs.map
