synapse-react-client
Version:
[](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client) [](https://badge.fury.io/js/synaps
21 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomTextWidget = void 0;
var tslib_1 = require("tslib");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
/**
* This TextWidget is almost identical to the rjsf TextWidget, except we handle numbers like strings to prevent issues if
* the actual annotation data is not a string.
*/
var CustomTextWidget = function (props) {
var BaseInput = props.registry.widgets.BaseInput;
// options.inputType will override the input type determined via schema
var inputType = null;
if (props.schema.type === 'number' || props.schema.type === 'integer') {
inputType = 'text';
}
return react_1.default.createElement(BaseInput, (0, tslib_1.__assign)({}, props, { options: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, props.options), { inputType: inputType }) }));
};
exports.CustomTextWidget = CustomTextWidget;
exports.default = exports.CustomTextWidget;
//# sourceMappingURL=CustomTextWidget.js.map