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();\r\n<s-field-label [field]=\"_field\"></s-field-label>\r\n\r\n<div class=\"p-fluid\">\r\n    <div class=\"flex items-center gap-2\">\r\n        <s-switch\r\n            [id]=\"_field.id || _field.name\"\r\n            [inputName]=\"_field.name\"\r\n            [formControl]=\"formControl()\"\r\n            [sTooltip]=\"_field.tooltip\"\r\n            tooltipPosition=\"top\"\r\n            (valueChanged)=\"_field.onChange ? _field.onChange($event) : null\"\r\n        >\r\n        </s-switch>\r\n        @if (_field.optionsLabel) {\r\n            <span>\r\n                @if (formControl().value) {\r\n                    {{ _field.optionsLabel.true }}\r\n                } @else {\r\n                    {{ _field.optionsLabel.false }}\r\n                }\r\n            </span>\r\n        }\r\n    </div>\r\n</div>\r\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();\r\n<s-field-label [field]=\"_field\"></s-field-label>\r\n\r\n<div class=\"p-fluid\">\r\n    <div class=\"flex items-center gap-2\">\r\n        <s-switch\r\n            [id]=\"_field.id || _field.name\"\r\n            [inputName]=\"_field.name\"\r\n            [formControl]=\"formControl()\"\r\n            [sTooltip]=\"_field.tooltip\"\r\n            tooltipPosition=\"top\"\r\n            (valueChanged)=\"_field.onChange ? _field.onChange($event) : null\"\r\n        >\r\n        </s-switch>\r\n        @if (_field.optionsLabel) {\r\n            <span>\r\n                @if (formControl().value) {\r\n                    {{ _field.optionsLabel.true }}\r\n                } @else {\r\n                    {{ _field.optionsLabel.false }}\r\n                }\r\n            </span>\r\n        }\r\n    </div>\r\n</div>\r\n" }]
        }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vbGVhbi1zd2l0Y2gtZmllbGQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4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