import { Component, inject, input } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { FormFieldUtilsService } from '../../../services/form-field-utils.service';
import { FieldLabelComponent } from '../../../components/field-label/field-label.component';
import { SelectComponent } from '@seniorsistemas/angular-components/select';
import { TooltipDirective } from '@seniorsistemas/angular-components/tooltip';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
export class SelectFieldComponent {
    field = input.required();
    formControl = input.required();
    fieldUtils = inject(FormFieldUtilsService);
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: SelectFieldComponent, 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<s-select\n    [multiple]=\"_field.multiple ?? false\"\n    [filter]=\"_field.filter ?? false\"\n    [id]=\"_field.id || _field.name\"\n    [options]=\"fieldUtils.getFieldProperty(_field.options)\"\n    [placeholder]=\"_field.placeholder || ' '\"\n    [formControl]=\"formControl()\"\n    [sTooltip]=\"_field.tooltip\"\n    tooltipPosition=\"top\"\n    [showDelay]=\"500\"\n    [group]=\"_field.group ?? false\"\n    [showClear]=\"_field.showClear ?? false\"\n    [optionLabel]=\"_field.optionLabel ?? 'label'\"\n    [optionValue]=\"_field.optionValue ?? 'value'\"\n    (clicked)=\"_field.onClick ? _field.onClick($event) : null\"\n    (onChange)=\"_field.onChange ? _field.onChange($event) : null\"\n    [emptyMessage]=\"_field.emptyMessage ?? null\"\n>\n</s-select>\n\n", dependencies: [{ kind: "component", type: FieldLabelComponent, selector: "s-field-label", inputs: ["field", "fieldContainerRef"] }, { kind: "component", type: SelectComponent, selector: "s-select", inputs: ["placeholder", "multiple", "options", "optionLabel", "optionValue", "showClear", "filter", "checkmark", "filterBy", "group", "virtualScroll", "virtualScrollItemSize", "emptyMessage", "disabled", "showOptions", "ariaLabel", "ariaLabelledBy"], outputs: ["disabledChange", "showOptionsChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: 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: SelectFieldComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [FieldLabelComponent, SelectComponent, ReactiveFormsModule, TooltipDirective], template: "@let _field = field();\n<s-field-label [field]=\"_field\"></s-field-label>\n\n<s-select\n    [multiple]=\"_field.multiple ?? false\"\n    [filter]=\"_field.filter ?? false\"\n    [id]=\"_field.id || _field.name\"\n    [options]=\"fieldUtils.getFieldProperty(_field.options)\"\n    [placeholder]=\"_field.placeholder || ' '\"\n    [formControl]=\"formControl()\"\n    [sTooltip]=\"_field.tooltip\"\n    tooltipPosition=\"top\"\n    [showDelay]=\"500\"\n    [group]=\"_field.group ?? false\"\n    [showClear]=\"_field.showClear ?? false\"\n    [optionLabel]=\"_field.optionLabel ?? 'label'\"\n    [optionValue]=\"_field.optionValue ?? 'value'\"\n    (clicked)=\"_field.onClick ? _field.onClick($event) : null\"\n    (onChange)=\"_field.onChange ? _field.onChange($event) : null\"\n    [emptyMessage]=\"_field.emptyMessage ?? null\"\n>\n</s-select>\n\n" }]
        }] });
//# sourceMappingURL=data:application/json;base64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