import node from "../../support/node";
import { Specification } from "../../support/Specification";
var BaseInput = /** @class */ (function () {
    function BaseInput(spec) {
        this.spec = spec;
    }
    BaseInput.prototype.initInput = function (type, className, isNested) {
        var input = node("input");
        new 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;
}());
export { BaseInput };
//# sourceMappingURL=BaseInput.js.map