UNPKG

synapse-react-client

Version:

[![Build Status](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client.svg?branch=main)](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client) [![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synaps

21 lines 1.02 kB
"use strict"; 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