import { Component, input } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { FieldLabelComponent } from '../../../../components/field-label/field-label.component';
import { SwitchModule } from '@seniorsistemas/angular-components/switch';
import { TooltipModule } from '@seniorsistemas/angular-components/tooltip';
import * as i0 from "@angular/core";
import * as i1 from "@seniorsistemas/angular-components/switch";
import * as i2 from "@angular/forms";
import * as i3 from "@seniorsistemas/angular-components/tooltip";
export class BooleanSwitchFieldComponent {
    field = input.required();
    formControl = input.required();
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BooleanSwitchFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BooleanSwitchFieldComponent, isStandalone: true, selector: "ng-component", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let _field = field();\n<s-field-label [field]=\"_field\"></s-field-label>\n\n<div class=\"ui-grid ui-grid-responsive ui-grid-pad p-fluid\">\n    <div class=\"ui-grid-row\">\n        <div class=\"i-grid-col-1\">\n            <s-switch\n                [id]=\"_field.id || _field.name\"\n                [inputName]=\"_field.name\"\n                [formControl]=\"formControl()\"\n                [sTooltip]=\"_field.tooltip\"\n                tooltipPosition=\"top\"\n                (valueChanged)=\"_field.onChange ? _field.onChange($event) : null\"\n            >\n            </s-switch>\n        </div>\n        @if (_field.optionsLabel) {\n            <div class=\"i-grid-col-1\">\n                @if (formControl().value) {\n                    <span>{{ _field.optionsLabel.true }}</span>\n                } @else {\n                    <span>{{ _field.optionsLabel.false }}</span>\n                }\n            </div>\n        }\n    </div>\n</div>\n\n", dependencies: [{ kind: "component", type: FieldLabelComponent, selector: "s-field-label", inputs: ["field", "fieldContainerRef"] }, { kind: "ngmodule", type: SwitchModule }, { kind: "component", type: i1.SwitchComponent, selector: "s-switch", inputs: ["readonly", "trueLabel", "falseLabel", "inputId", "label", "inputName", "disabled", "value", "showStatusLabel"], outputs: ["valueChanged"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3.TooltipDirective, selector: "[sTooltip]", inputs: ["sTooltip", "tooltipPosition", "showDelay", "displayTime", "tooltipEvent", "escape", "visible", "mobileBehavior", "focusedInputRef", "checkTruncatedText"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BooleanSwitchFieldComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [FieldLabelComponent, SwitchModule, ReactiveFormsModule, TooltipModule], template: "@let _field = field();\n<s-field-label [field]=\"_field\"></s-field-label>\n\n<div class=\"ui-grid ui-grid-responsive ui-grid-pad p-fluid\">\n    <div class=\"ui-grid-row\">\n        <div class=\"i-grid-col-1\">\n            <s-switch\n                [id]=\"_field.id || _field.name\"\n                [inputName]=\"_field.name\"\n                [formControl]=\"formControl()\"\n                [sTooltip]=\"_field.tooltip\"\n                tooltipPosition=\"top\"\n                (valueChanged)=\"_field.onChange ? _field.onChange($event) : null\"\n            >\n            </s-switch>\n        </div>\n        @if (_field.optionsLabel) {\n            <div class=\"i-grid-col-1\">\n                @if (formControl().value) {\n                    <span>{{ _field.optionsLabel.true }}</span>\n                } @else {\n                    <span>{{ _field.optionsLabel.false }}</span>\n                }\n            </div>\n        }\n    </div>\n</div>\n\n" }]
        }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vbGVhbi1zd2l0Y2gtZmllbGQuY29tcG9uZW50LmpzIiwic291cm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gICAgICA8L3Mtc3dpdGNoPlxuICAgICAgICA8L2Rpdj5cbiAgICAgICAgQGlmIChfZmllbGQub3B0aW9uc0xhYmVsKSB7XG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiaS1ncmlkLWNvbC0xXCI+XG4gICAgICAgICAgICAgICAgQGlmIChmb3JtQ29udHJvbCgpLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIDxzcGFuPnt7IF9maWVsZC5vcHRpb25zTGFiZWwudHJ1ZSB9fTwvc3Bhbj5cbiAgICAgICAgICAgICAgICB9IEBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgPHNwYW4+e3sgX2ZpZWxkLm9wdGlvbnNMYWJlbC5mYWxzZSB9fTwvc3Bhbj5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgfVxuICAgIDwvZGl2PlxuPC9kaXY+XG5cbiJdfQ==