@try-at-software/input-elements
Version:
A package providing different input elements that are extensible and easily configurable for your custom needs.
19 lines (18 loc) • 828 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.prepareInputElement = void 0;
const SingleValueInputElements_1 = require("../SingleValueInputElements");
class InputElementBuilder {
constructor(config, updateCallback, validationRules) {
this._config = config;
this._updateCallback = updateCallback;
this._validationRules = validationRules;
}
materialize(component, props) {
return new SingleValueInputElements_1.SingleValueInputElement(this._config, component, props, this._updateCallback, ...this._validationRules);
}
}
function prepareInputElement(config, updateCallback, ...validationRules) {
return new InputElementBuilder(config, updateCallback, validationRules);
}
exports.prepareInputElement = prepareInputElement;