import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/flex-layout/flex";
import * as i3 from "@angular/forms";
import * as i4 from "primeng/inputmask";
import * as i5 from "primeng/inputnumber";
import * as i6 from "primeng/autofocus";
import * as i7 from "../validation-messages/validation-messages.component";
export class InputNumberComponent {
    constructor() { }
    onInput(event) {
        // console.log('onInput', event);
        if (this.form.updateOn !== 'blur') {
            this.control.setValue(event.value);
            this.control.updateValueAndValidity();
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: InputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: InputNumberComponent, selector: "smz-input-number", inputs: { input: "input", control: "control", behaviors: "behaviors", form: "form" }, ngImport: i0, template: "<label  *ngIf=\"input.hideLabel != true\" class=\"smz__input_name\" [innerHTML]=\"input.name\"></label>\r\n<div class=\"input_inner__wrapper\">\r\n    <p-inputMask\r\n        *ngIf=\"!input.useFraction\"\r\n        class=\"smz__input_value\"\r\n        fxFlex=\"grow\"\r\n        slotChar=\"\"\r\n        [autoClear]=\"false\"\r\n        mask=\"9?9999999999999999999999999999999\"\r\n        characterPattern=\"([0-9])\"\r\n        [id]=\"input.propertyName\"\r\n        pAutoFocus [autofocus]=\"input.autoFocus\"\r\n        [formControl]=\"control\">\r\n    </p-inputMask>\r\n    <p-inputNumber\r\n        *ngIf=\"input.useFraction\"\r\n        class=\"smz__input_value\"\r\n        fxFlex=\"grow\"\r\n        [formControl]=\"control\"\r\n        [locale]=\"input.locale\"\r\n        [minFractionDigits]=\"input.minFractionDigits\"\r\n        [maxFractionDigits]=\"input.maxFractionDigits\"\r\n        [useGrouping]=\"input.useGrouping\"\r\n        [id]=\"input.propertyName\"\r\n        pAutoFocus [autofocus]=\"input.autoFocus\"\r\n        (onInput)=\"onInput($event)\">\r\n    </p-inputNumber>\r\n    <smz-validation-messages [input]=\"input\" [control]=\"control\" [behaviors]=\"behaviors\"></smz-validation-messages>\r\n</div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: "  [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md],  [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md],  [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm],  [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "component", type: i4.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "showClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaLabelledBy", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autofocus", "autoFocus", "autocomplete", "keepBuffer", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown", "onClear"] }, { kind: "component", type: i5.InputNumber, selector: "p-inputNumber", 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", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.AutoFocus, selector: "[pAutoFocus]", inputs: ["autofocus"] }, { kind: "component", type: i7.ValidationMessagesComponent, selector: "smz-validation-messages", inputs: ["input", "control", "behaviors", "extraMessages"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: InputNumberComponent, decorators: [{
            type: Component,
            args: [{ selector: 'smz-input-number', template: "<label  *ngIf=\"input.hideLabel != true\" class=\"smz__input_name\" [innerHTML]=\"input.name\"></label>\r\n<div class=\"input_inner__wrapper\">\r\n    <p-inputMask\r\n        *ngIf=\"!input.useFraction\"\r\n        class=\"smz__input_value\"\r\n        fxFlex=\"grow\"\r\n        slotChar=\"\"\r\n        [autoClear]=\"false\"\r\n        mask=\"9?9999999999999999999999999999999\"\r\n        characterPattern=\"([0-9])\"\r\n        [id]=\"input.propertyName\"\r\n        pAutoFocus [autofocus]=\"input.autoFocus\"\r\n        [formControl]=\"control\">\r\n    </p-inputMask>\r\n    <p-inputNumber\r\n        *ngIf=\"input.useFraction\"\r\n        class=\"smz__input_value\"\r\n        fxFlex=\"grow\"\r\n        [formControl]=\"control\"\r\n        [locale]=\"input.locale\"\r\n        [minFractionDigits]=\"input.minFractionDigits\"\r\n        [maxFractionDigits]=\"input.maxFractionDigits\"\r\n        [useGrouping]=\"input.useGrouping\"\r\n        [id]=\"input.propertyName\"\r\n        pAutoFocus [autofocus]=\"input.autoFocus\"\r\n        (onInput)=\"onInput($event)\">\r\n    </p-inputNumber>\r\n    <smz-validation-messages [input]=\"input\" [control]=\"control\" [behaviors]=\"behaviors\"></smz-validation-messages>\r\n</div>" }]
        }], ctorParameters: () => [], propDecorators: { input: [{
                type: Input
            }], control: [{
                type: Input
            }], behaviors: [{
                type: Input
            }], form: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQtbnVtYmVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1zbXotdWkvc3JjL2xpYi9tb2R1bGVzL3Ntei1mb3Jtcy9jb21wb25lbnRzL2lucHV0LW51bWJlci9pbnB1dC1udW1iZXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXNtei11aS9zcmMvbGliL21vZHVsZXMvc216LWZvcm1zL2NvbXBvbmVudHMvaW5wdXQtbnVtYmVyL2lucHV0LW51bWJlci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQzs7Ozs7Ozs7O0FBU2pELE1BQU0sT0FBTyxvQkFBb0I7SUFNN0IsZ0JBQWdCLENBQUM7SUFFVixPQUFPLENBQUMsS0FBVTtRQUNyQixpQ0FBaUM7UUFFakMsSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsS0FBSyxNQUFNLEVBQUU7WUFDL0IsSUFBSSxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFDO1lBQ25DLElBQUksQ0FBQyxPQUFPLENBQUMsc0JBQXNCLEVBQUUsQ0FBQztTQUN6QztJQUNMLENBQUM7OEdBZlEsb0JBQW9CO2tHQUFwQixvQkFBb0IsOElDVGpDLGt0Q0E0Qk07OzJGRG5CTyxvQkFBb0I7a0JBSmhDLFNBQVM7K0JBQ0ksa0JBQWtCO3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