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 / src / new-forms / plugins / TextPlugin.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 exotic_1 = require("exotic");
// import { InputState } from '../inputs/InputState'
const ObserverInput_1 = require("../inputs/ObserverInput");
let TextBoxPlugin = class TextBoxPlugin extends React.Component {
    static isSatisfiedByProps(props) {
        return exotic_1.isUndefined(props.type) || ['text'].includes(props.type) || true;
    }
    // static defaultProps = {
    // can use these defaultProps for creating state?
    // ^ will not work, needs more info at runtime
    // validator: isValidLength,
    // }
    render() {
        return React.createElement(ObserverInput_1.ObserverInput, Object.assign({}, this.props));
    }
};
// used by state
TextBoxPlugin.defaultState = {
    validator: (value) => true,
};
TextBoxPlugin = tslib_1.__decorate([
    mobx_react_1.observer
], TextBoxPlugin);
exports.TextBoxPlugin = TextBoxPlugin;
exports.TextPlugin = TextBoxPlugin;
exports.default = TextBoxPlugin;
//# sourceMappingURL=TextPlugin.js.map