import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@seniorsistemas/angular-components/button";
import * as i2 from "@angular/common";
import * as i3 from "@angular/forms";
import * as i4 from "@seniorsistemas/angular-components/radio-button";
import * as i5 from "../../../../components/field-label/field-label.component";
export class BooleanFieldComponent {
    field;
    formControl;
    onClear() {
        this.formControl.reset();
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BooleanFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BooleanFieldComponent, selector: "ng-component", inputs: { field: "field", formControl: "formControl" }, ngImport: i0, template: "<ng-template\n    #radioButtonRender\n    let-value=\"value\"\n    let-label=\"label\"\n    let-inputIdAppend=\"inputIdAppend\"\n>\n    @let inputId = (field.id || field.name) + inputIdAppend;\n    <s-radiobutton\n        [name]=\"field.name\"\n        [value]=\"value\"\n        [formControl]=\"formControl\"\n        [inputId]=\"inputId\"\n        [label]=\"label\"\n        (focusedInput)=\"field.onFocus ? field.onFocus($event) : null\"\n        (inputFocusLost)=\"field.onBlur ? field.onBlur($event) : null\"\n    />\n</ng-template>\n\n<s-field-label [field]=\"field\"></s-field-label>\n\n@if (field.verticalAlignment) {\n    <div class=\"ui-g\">\n        <div class=\"ui-g-12\">\n            <ng-template\n                *ngTemplateOutlet=\"\n                    radioButtonRender;\n                    context: { value: true, label: field.optionsLabel.true, inputIdAppend: '-1' }\n                \"\n            />\n        </div>\n        <div class=\"ui-g-12\">\n            <ng-template\n                *ngTemplateOutlet=\"\n                    radioButtonRender;\n                    context: { value: false, label: field.optionsLabel.false, inputIdAppend: '-2' }\n                \"\n            />\n        </div>\n        @if (!field.showClear && !!field.required && !field.required()) {\n            <div class=\"ui-g-12\">\n                <ng-template\n                    *ngTemplateOutlet=\"\n                        radioButtonRender;\n                        context: { value: null, label: field.optionsLabel.empty, inputIdAppend: '-3' }\n                    \"\n                />\n            </div>\n        }\n        <div>\n            @if (field.showClear && !field.required?.() && !formControl.disabled) {\n                <s-button\n                    [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n                    (clicked)=\"onClear()\"\n                    priority=\"link\"\n                >\n                </s-button>\n            }\n        </div>\n    </div>\n} @else {\n    <div class=\"ui-g horizontal-radio-buttons-container\">\n        <ng-template\n            *ngTemplateOutlet=\"\n                radioButtonRender;\n                context: { value: true, label: field.optionsLabel.true, inputIdAppend: '-1' }\n            \"\n        />\n\n        <ng-template\n            *ngTemplateOutlet=\"\n                radioButtonRender;\n                context: { value: false, label: field.optionsLabel.false, inputIdAppend: '-2' }\n            \"\n        />\n\n        <ng-template\n            *ngTemplateOutlet=\"\n                radioButtonRender;\n                context: { value: null, label: field.optionsLabel.empty, inputIdAppend: '-3' }\n            \"\n        />\n\n        @if (field.showClear && !field.required?.() && !formControl.disabled) {\n            <s-button\n                style=\"margin-left: 40px\"\n                [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n                (clicked)=\"onClear()\"\n                priority=\"link\"\n            >\n            </s-button>\n        }\n    </div>\n}\n", styles: [".horizontal-radio-buttons-container{gap:20px 40px;.radio-button-item{margin:0}}\n"], dependencies: [{ kind: "component", type: i1.ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor"], outputs: ["clicked"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4.RadioButtonComponent, selector: "s-radiobutton", inputs: ["buttonDisabled", "label", "name", "value", "inputId"], outputs: ["buttonDisabledChange", "valueChange", "focusedInput", "inputFocusLost"] }, { kind: "component", type: i5.FieldLabelComponent, selector: "s-field-label", inputs: ["field", "fieldContainerRef"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BooleanFieldComponent, decorators: [{
            type: Component,
            args: [{ template: "<ng-template\n    #radioButtonRender\n    let-value=\"value\"\n    let-label=\"label\"\n    let-inputIdAppend=\"inputIdAppend\"\n>\n    @let inputId = (field.id || field.name) + inputIdAppend;\n    <s-radiobutton\n        [name]=\"field.name\"\n        [value]=\"value\"\n        [formControl]=\"formControl\"\n        [inputId]=\"inputId\"\n        [label]=\"label\"\n        (focusedInput)=\"field.onFocus ? field.onFocus($event) : null\"\n        (inputFocusLost)=\"field.onBlur ? field.onBlur($event) : null\"\n    />\n</ng-template>\n\n<s-field-label [field]=\"field\"></s-field-label>\n\n@if (field.verticalAlignment) {\n    <div class=\"ui-g\">\n        <div class=\"ui-g-12\">\n            <ng-template\n                *ngTemplateOutlet=\"\n                    radioButtonRender;\n                    context: { value: true, label: field.optionsLabel.true, inputIdAppend: '-1' }\n                \"\n            />\n        </div>\n        <div class=\"ui-g-12\">\n            <ng-template\n                *ngTemplateOutlet=\"\n                    radioButtonRender;\n                    context: { value: false, label: field.optionsLabel.false, inputIdAppend: '-2' }\n                \"\n            />\n        </div>\n        @if (!field.showClear && !!field.required && !field.required()) {\n            <div class=\"ui-g-12\">\n                <ng-template\n                    *ngTemplateOutlet=\"\n                        radioButtonRender;\n                        context: { value: null, label: field.optionsLabel.empty, inputIdAppend: '-3' }\n                    \"\n                />\n            </div>\n        }\n        <div>\n            @if (field.showClear && !field.required?.() && !formControl.disabled) {\n                <s-button\n                    [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n                    (clicked)=\"onClear()\"\n                    priority=\"link\"\n                >\n                </s-button>\n            }\n        </div>\n    </div>\n} @else {\n    <div class=\"ui-g horizontal-radio-buttons-container\">\n        <ng-template\n            *ngTemplateOutlet=\"\n                radioButtonRender;\n                context: { value: true, label: field.optionsLabel.true, inputIdAppend: '-1' }\n            \"\n        />\n\n        <ng-template\n            *ngTemplateOutlet=\"\n                radioButtonRender;\n                context: { value: false, label: field.optionsLabel.false, inputIdAppend: '-2' }\n            \"\n        />\n\n        <ng-template\n            *ngTemplateOutlet=\"\n                radioButtonRender;\n                context: { value: null, label: field.optionsLabel.empty, inputIdAppend: '-3' }\n            \"\n        />\n\n        @if (field.showClear && !field.required?.() && !formControl.disabled) {\n            <s-button\n                style=\"margin-left: 40px\"\n                [label]=\"field.optionsLabel.clear || 'Clear selection'\"\n                (clicked)=\"onClear()\"\n                priority=\"link\"\n            >\n            </s-button>\n        }\n    </div>\n}\n", styles: [".horizontal-radio-buttons-container{gap:20px 40px;.radio-button-item{margin:0}}\n"] }]
        }], propDecorators: { field: [{
                type: Input,
                args: [{ required: true }]
            }], formControl: [{
                type: Input,
                args: [{ required: true }]
            }] } });
//# sourceMappingURL=data:application/json;base64, 