import { __decorate, __metadata } from "tslib";
import { Component, Input } from '@angular/core';
import { MonitoringAppGenComponent, AppGenField, } from '../../metadata/decorators';
import { MonitoringVariableValueComponent } from '../monitoring-variable-value/monitoring-variable-value.component';
import * as i0 from "@angular/core";
import * as i1 from "@iotize/ionic";
import * as i2 from "@angular/common";
function TapVariableNumberComponent_tap_inline_editor_2_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tap-inline-editor", 3);
    i0.ɵɵlistener("editModeChange", function TapVariableNumberComponent_tap_inline_editor_2_Template_tap_inline_editor_editModeChange_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return ctx_r2.onEditModeChange($event); })("valueChange", function TapVariableNumberComponent_tap_inline_editor_2_Template_tap_inline_editor_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r4 = i0.ɵɵnextContext(); return ctx_r4.onValueChange($event); })("onSubmit", function TapVariableNumberComponent_tap_inline_editor_2_Template_tap_inline_editor_onSubmit_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.onSubmit($event); });
    i0.ɵɵpipe(1, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    const _r0 = i0.ɵɵreference(1);
    i0.ɵɵproperty("forceValue", ctx_r1.forceValue)("value", _r0.pendingSubmitValue === undefined ? ctx_r1.value : _r0.pendingSubmitValue)("editMode", i0.ɵɵpipeBind1(1, 8, _r0.editModeChange))("editable", ctx_r1.editable && _r0.pendingSubmitValue === undefined)("fieldError", ctx_r1.fieldError)("inputOptions", ctx_r1.inputOptions)("unitValue", ctx_r1.unitValue)("valueStyle", ctx_r1.valueStyle);
} }
let TapVariableNumberComponent = class TapVariableNumberComponent extends MonitoringVariableValueComponent {
    constructor() {
        super(...arguments);
        this.inputOptions = {
            type: 'number',
        };
    }
    set min(value) {
        this.inputOptions.min = value;
    }
    set max(value) {
        this.inputOptions.max = value;
    }
};
/** @nocollapse */ TapVariableNumberComponent.ɵfac = function TapVariableNumberComponent_Factory(t) { return ɵTapVariableNumberComponent_BaseFactory(t || TapVariableNumberComponent); };
/** @nocollapse */ TapVariableNumberComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TapVariableNumberComponent, selectors: [["tap-variable-number"]], inputs: { min: "min", max: "max" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 6, consts: [[3, "variable", "showRefreshButton", "showEditButton", "showSubmitButton", "lines"], ["ctx", ""], [3, "forceValue", "value", "editMode", "editable", "fieldError", "inputOptions", "unitValue", "valueStyle", "editModeChange", "valueChange", "onSubmit", 4, "ngIf"], [3, "forceValue", "value", "editMode", "editable", "fieldError", "inputOptions", "unitValue", "valueStyle", "editModeChange", "valueChange", "onSubmit"]], template: function TapVariableNumberComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "tap-value-editor-container", 0, 1);
        i0.ɵɵtemplate(2, TapVariableNumberComponent_tap_inline_editor_2_Template, 2, 10, "tap-inline-editor", 2);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵproperty("variable", ctx._variable)("showRefreshButton", ctx.refreshable)("showEditButton", ctx.editable)("showSubmitButton", true)("lines", ctx.lines);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx._variable);
    } }, directives: [i1.TapValueEditorContainerComponent, i2.NgIf, i1.InlineEditorComponent], pipes: [i2.AsyncPipe], styles: [""] });
__decorate([
    AppGenField({
        schema: {
            type: 'integer',
            description: 'Minimum value',
        },
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], TapVariableNumberComponent.prototype, "min", null);
__decorate([
    AppGenField({
        schema: {
            type: 'integer',
            description: 'Maximum',
        },
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], TapVariableNumberComponent.prototype, "max", null);
TapVariableNumberComponent = __decorate([
    MonitoringAppGenComponent({
        constraints: {
            isArray: 'NO',
            isNumber: 'YES',
        },
    })
], TapVariableNumberComponent);
export { TapVariableNumberComponent };
const ɵTapVariableNumberComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(TapVariableNumberComponent);
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TapVariableNumberComponent, [{
        type: Component,
        args: [{
                selector: 'tap-variable-number',
                templateUrl: '../monitoring-variable-value/monitoring-variable-value.component.html',
                styleUrls: [
                    '../monitoring-variable-value/monitoring-variable-value.component.scss',
                ],
            }]
    }], null, { min: [{
            type: Input
        }], max: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 