"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var node_1 = require("../../support/node");
var Specification_1 = require("../../support/Specification");
var BaseInput = /** @class */ (function () {
    function BaseInput(spec) {
        this.spec = spec;
    }
    BaseInput.prototype.initInput = function (type, className, isNested) {
        var input = node_1.default("input");
        new Specification_1.Specification(this.spec).initNode(input, className);
        input.addAttributes({
            type: type,
            placeholder: this.spec.placeholder || "",
            value: this.spec.value || "",
        });
        if (isNested) {
            input.addClasses("lto-nested");
        }
        var element = input.unwrap();
        element.addEventListener("change", function () {
            return element.setAttribute('value', element.value);
        });
        return element;
    };
    return BaseInput;
}());
exports.BaseInput = BaseInput;
//# sourceMappingURL=BaseInput.js.map