UNPKG

@agentlab/rjsf-antd

Version:

Ant Design theme, fields and widgets for react-jsonschema-form

11 lines 776 B
import React from 'react'; import { Input } from 'antd'; const { TextArea } = Input; const TextareaWidget = ({ id, placeholder, value, required, disabled, autofocus, readonly, onBlur, onFocus, onChange, options, }) => { const _onChange = ({ target: { value } }) => onChange(value === '' ? options.emptyValue : value); const _onBlur = ({ target: { value } }) => onBlur(id, value); const _onFocus = ({ target: { value } }) => onFocus(id, value); return (React.createElement(TextArea, { placeholder: placeholder, disabled: disabled || readonly, value: value, required: required, autoFocus: autofocus, rows: options.rows || 5, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus })); }; export default TextareaWidget; //# sourceMappingURL=TextareaWidget.js.map