@talend/react-forms
Version:
React forms library based on json schema form.
42 lines • 951 B
JavaScript
import PropTypes from 'prop-types';
import { TextMode as FieldTemplate } from '../../FieldTemplate';
import { jsx as _jsx } from "react/jsx-runtime";
export default function TextMode({
id,
schema,
value
}) {
const {
rows = 5,
title,
labelProps
} = schema;
return /*#__PURE__*/_jsx(FieldTemplate, {
id: id,
label: title,
labelProps: labelProps,
children: /*#__PURE__*/_jsx("pre", {
style: {
height: `${rows * 2}rem`,
fontSize: 'inherit'
},
children: value
})
});
}
if (process.env.NODE_ENV !== 'production') {
TextMode.propTypes = {
id: PropTypes.string,
schema: PropTypes.shape({
rows: PropTypes.number,
title: PropTypes.string,
labelProps: PropTypes.object
}),
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
};
}
TextMode.defaultProps = {
schema: {},
value: ''
};
//# sourceMappingURL=TextMode.component.js.map