Repository URL to install this package:
|
Version:
3.0.0-beta.2 ▾
|
"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