Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/forms / build / dist / new-forms / plugins / TextAreaPlugin.js
Size: Mime:
"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