import { ChangeEvent, FocusEvent } from 'react'; import { ariaDescribedByIds, FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils'; import FormControl from 'react-bootstrap/FormControl'; import InputGroup from 'react-bootstrap/InputGroup'; type CustomWidgetProps = WidgetProps< T, S, F > & { options: any; }; export default function TextareaWidget< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any >({ id, placeholder, value, required, disabled, autofocus, readonly, onBlur, onFocus, onChange, options, }: CustomWidgetProps) { const _onChange = ({ target: { value } }: ChangeEvent) => onChange(value === '' ? options.emptyValue : value); const _onBlur = ({ target: { value } }: FocusEvent) => onBlur(id, value); const _onFocus = ({ target: { value } }: FocusEvent) => onFocus(id, value); return ( (id)} /> ); }