Repository URL to install this package:
|
Version:
3.5.4 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = require("react");
const mobx_react_1 = require("xmobx/mobx-react");
const styleh_components_1 = require("styleh-components");
const ObserverInput_1 = require("../inputs/ObserverInput");
const validators_1 = require("../../validators");
const StyledTextArea = styleh_components_1.styled.textarea ``;
let TextAreaPlugin = class TextAreaPlugin extends React.Component {
constructor() {
super(...arguments);
this.renderInput = (props) => React.createElement(StyledTextArea, Object.assign({}, props));
}
static isSatisfiedByProps(props) {
return ['textarea'].includes(props.type);
}
render() {
const _a = this.props, { ref, className } = _a, remainingProps = tslib_1.__rest(_a, ["ref", "className"]);
return (React.createElement(ObserverInput_1.ObserverInput, Object.assign({ renderInput: this.renderInput,
// dataQa="qa-textarea"
className: className }, remainingProps)));
}
};
TextAreaPlugin.defaultState = (inputState) => {
return {
validator: (value) => validators_1.isValid(value) || validators_1.errorMessageFor('required'),
};
};
TextAreaPlugin = tslib_1.__decorate([
mobx_react_1.observer
], TextAreaPlugin);
exports.TextAreaPlugin = TextAreaPlugin;
//# sourceMappingURL=TextAreaPlugin.js.map