import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { InputTextModule } from 'primeng/inputtext';
import { PostalCodeMaskDirective } from '../../../directives/postal-code-mask.directive';
import { PhoneMaskDirective } from '../../../directives/phone-mask.directive';
import { DocumentMaskDirective } from '../../../directives/document-mask.directive';
import { DynamicFieldWrapperComponent } from './dynamic-field-wrapper.component';
import { DynamicFieldBaseComponent } from './dynamic-field-base.component';
import * as i0 from "@angular/core";
import * as i1 from "../../../services/translation.service";
import * as i2 from "@angular/common";
import * as i3 from "@angular/forms";
import * as i4 from "primeng/inputtext";
export class DynamicFieldTextComponent extends DynamicFieldBaseComponent {
    constructor(translationService) {
        super(translationService);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DynamicFieldTextComponent, deps: [{ token: i1.TranslationService }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: DynamicFieldTextComponent, isStandalone: true, selector: "sia-dynamic-field-text", usesInheritance: true, ngImport: i0, template: `
    <sia-dynamic-field-wrapper [field]="field" [form]="form" [mode]="mode">
      <div [formGroup]="form">
        <input
          *ngIf="!field.mask"
          pInputText
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />
        
        <!-- Input com máscara Código Postal -->
        <input
          *ngIf="field.mask === 'cep' || field.mask === 'postalCode'"
          pInputText
          siaPostalCodeMask
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />
        
        <!-- Input com máscara Telefone -->
        <input
          *ngIf="field.mask === 'phone'"
          pInputText
          siaPhoneMask
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />
        
        <!-- Input com máscara Documento (dinâmica baseada em typePerson) -->
        <input
          *ngIf="field.mask === 'document'"
          pInputText
          siaDocumentMask
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [parentForm]="form"
          [typePersonField]="field.maskDependsOn || 'typePerson'"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />

        <!-- Input com máscara CPF fixa -->
        <input
          *ngIf="field.mask === 'cpf'"
          pInputText
          siaDocumentMask
          [typePerson]="'NATURAL_PERSON'"
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />

        <!-- Input com máscara CNPJ fixa (alfanumérico) -->
        <input
          *ngIf="field.mask === 'cnpj'"
          pInputText
          siaDocumentMask
          [typePerson]="'JURIDICAL_PERSON'"
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />
      </div>
    </sia-dynamic-field-wrapper>
  `, isInline: true, styles: ["input{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "directive", type: PostalCodeMaskDirective, selector: "[siaPostalCodeMask]", inputs: ["postalCodeLocale"] }, { kind: "directive", type: PhoneMaskDirective, selector: "[siaPhoneMask]", inputs: ["phoneMaskLocale"] }, { kind: "directive", type: DocumentMaskDirective, selector: "[siaDocumentMask]", inputs: ["documentType", "typePerson", "typePersonField", "parentForm"] }, { kind: "component", type: DynamicFieldWrapperComponent, selector: "sia-dynamic-field-wrapper", inputs: ["field", "form", "mode"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DynamicFieldTextComponent, decorators: [{
            type: Component,
            args: [{ selector: 'sia-dynamic-field-text', standalone: true, imports: [
                        CommonModule,
                        ReactiveFormsModule,
                        InputTextModule,
                        PostalCodeMaskDirective,
                        PhoneMaskDirective,
                        DocumentMaskDirective,
                        DynamicFieldWrapperComponent
                    ], template: `
    <sia-dynamic-field-wrapper [field]="field" [form]="form" [mode]="mode">
      <div [formGroup]="form">
        <input
          *ngIf="!field.mask"
          pInputText
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />
        
        <!-- Input com máscara Código Postal -->
        <input
          *ngIf="field.mask === 'cep' || field.mask === 'postalCode'"
          pInputText
          siaPostalCodeMask
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />
        
        <!-- Input com máscara Telefone -->
        <input
          *ngIf="field.mask === 'phone'"
          pInputText
          siaPhoneMask
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />
        
        <!-- Input com máscara Documento (dinâmica baseada em typePerson) -->
        <input
          *ngIf="field.mask === 'document'"
          pInputText
          siaDocumentMask
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [parentForm]="form"
          [typePersonField]="field.maskDependsOn || 'typePerson'"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />

        <!-- Input com máscara CPF fixa -->
        <input
          *ngIf="field.mask === 'cpf'"
          pInputText
          siaDocumentMask
          [typePerson]="'NATURAL_PERSON'"
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />

        <!-- Input com máscara CNPJ fixa (alfanumérico) -->
        <input
          *ngIf="field.mask === 'cnpj'"
          pInputText
          siaDocumentMask
          [typePerson]="'JURIDICAL_PERSON'"
          [id]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [maxlength]="field.maxLength || 524288"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()" />
      </div>
    </sia-dynamic-field-wrapper>
  `, styles: ["input{width:100%}\n"] }]
        }], ctorParameters: () => [{ type: i1.TranslationService }] });
//# sourceMappingURL=data:application/json;base64, 