Repository URL to install this package:
|
Version:
2.0.4 ▾
|
"use strict";
var __importDefault = this && this.__importDefault || function (mod) {
return mod && mod.__esModule ? mod : {
"default": mod
};
};
Object.defineProperty(exports, "__esModule", {
value: true
});
const react_1 = __importDefault(require("react"));
const TextArea_1 = __importDefault(require("../../../../inputs/TextArea"));
const _validators_1 = require("../../../deps/_validators");
const InputChain_1 = require("../../InputChain");
class TextAreaInput extends InputChain_1.InputChain {
static isSatisfiedByProps(props) {
return props.type === 'textarea';
}
validate() {
console.log('TextAreaInput_validate');
const {
maxLength,
minLength
} = this.entries();
const value = this.getValue(); // as long as we configured one
if (maxLength || minLength) {
this.isValid = _validators_1.validators.isValidLength(value, minLength, maxLength);
}
}
render() {
const state = this.get('state');
const props = this.get('props');
console.log('TextAreaInput_render');
const attributes = Object.assign({}, props, {
state,
onChange: event => {
this.setValue(event.target.value);
this.validate();
}
});
return react_1.default.createElement(TextArea_1.default, Object.assign({}, attributes));
}
}
exports.TextAreaInput = TextAreaInput;
exports.default = TextAreaInput; //# sourceMappingURL=TextAreaInput.js.map