"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const field_1 = require("../../../../../client/field");
const processNumberValue_1 = require("../../../../../client/processNumberValue");
class Slider extends field_1.Field {
    constructor($props, $system) {
        const DEFAULT_STYLE = $system.style['textarea'];
        super($props, $system, $system.api.document.createElement('input'), {
            valueKey: 'value',
            defaultValue: '0',
            defaultStyle: DEFAULT_STYLE,
            processValue: processNumberValue_1.processNumberValue,
        });
        const { min = 0, max = 100 } = $props;
        this.$element.type = 'range';
        this.$element.min = `${min}`;
        this.$element.max = `${max}`;
    }
    onPropChanged(prop, current) {
        if (prop === 'min') {
            this.$element.min = `${current}`;
        }
        else if (prop === 'max') {
            this.$element.max = `${current}`;
        }
        else {
            super.onPropChanged(prop, current);
        }
    }
}
exports.default = Slider;
//# sourceMappingURL=Component.js.map