import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { InputNumberModule } from 'primeng/inputnumber';
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/forms";
import * as i3 from "primeng/inputnumber";
export class DynamicFieldNumberComponent extends DynamicFieldBaseComponent {
    constructor(translationService) {
        super(translationService);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DynamicFieldNumberComponent, deps: [{ token: i1.TranslationService }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: DynamicFieldNumberComponent, isStandalone: true, selector: "sia-dynamic-field-number", usesInheritance: true, ngImport: i0, template: `
    <sia-dynamic-field-wrapper [field]="field" [form]="form" [mode]="mode">
      <div [formGroup]="form">
        <p-inputNumber
          [inputId]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [min]="field.min"
          [max]="field.max"
          [minFractionDigits]="field.minFractionDigits || 0"
          [maxFractionDigits]="field.maxFractionDigits || 2"
          [mode]="field.type === 'currency' ? 'currency' : 'decimal'"
          [currency]="field.currency || 'BRL'"
          [locale]="field.locale || 'pt-BR'"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()"
          styleClass="w-full">
        </p-inputNumber>
      </div>
    </sia-dynamic-field-wrapper>
  `, isInline: true, styles: ["::ng-deep p-inputNumber{width:100%;.p-inputnumber,input{width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i3.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled", "fluid"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { 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: DynamicFieldNumberComponent, decorators: [{
            type: Component,
            args: [{ selector: 'sia-dynamic-field-number', standalone: true, imports: [
                        CommonModule,
                        ReactiveFormsModule,
                        InputNumberModule,
                        DynamicFieldWrapperComponent
                    ], template: `
    <sia-dynamic-field-wrapper [field]="field" [form]="form" [mode]="mode">
      <div [formGroup]="form">
        <p-inputNumber
          [inputId]="field.field"
          [formControlName]="field.field"
          [placeholder]="getPlaceholder()"
          [min]="field.min"
          [max]="field.max"
          [minFractionDigits]="field.minFractionDigits || 0"
          [maxFractionDigits]="field.maxFractionDigits || 2"
          [mode]="field.type === 'currency' ? 'currency' : 'decimal'"
          [currency]="field.currency || 'BRL'"
          [locale]="field.locale || 'pt-BR'"
          [class.ng-invalid]="isFieldInvalid()"
          [class.ng-dirty]="isFieldDirty()"
          styleClass="w-full">
        </p-inputNumber>
      </div>
    </sia-dynamic-field-wrapper>
  `, styles: ["::ng-deep p-inputNumber{width:100%;.p-inputnumber,input{width:100%}}\n"] }]
        }], ctorParameters: () => [{ type: i1.TranslationService }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHluYW1pYy1maWVsZC1udW1iZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29tcG9uZW50cy1haS9zcmMvbGliL2NvbXBvbmVudHMvZHluYW1pYy1mb3JtL2ZpZWxkcy9keW5hbWljLWZpZWxkLW51bWJlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMxQyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDckQsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFFeEQsT0FBTyxFQUFFLDRCQUE0QixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDakYsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sZ0NBQWdDLENBQUM7Ozs7O0FBOEMzRSxNQUFNLE9BQU8sMkJBQTRCLFNBQVEseUJBQXlCO0lBQ3hFLFlBQVksa0JBQXNDO1FBQ2hELEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0lBQzVCLENBQUM7d0dBSFUsMkJBQTJCOzRGQUEzQiwyQkFBMkIsMkdBbkM1Qjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R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