UNPKG

@astarte-platform/react-bootstrap

Version:

React Bootstrap theme, fields and widgets for react-jsonschema-form, powered by react-bootstrap, this is a package from a fork of official project

11 lines 984 B
import { jsx as _jsx } from "react/jsx-runtime"; import { ariaDescribedByIds } from '@rjsf/utils'; import FormControl from 'react-bootstrap/FormControl'; import InputGroup from 'react-bootstrap/InputGroup'; export default function 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 (_jsx(InputGroup, { children: _jsx(FormControl, { id: id, name: id, as: 'textarea', placeholder: placeholder, disabled: disabled, readOnly: readonly, value: value, required: required, autoFocus: autofocus, rows: options.rows || 5, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id) }) })); } //# sourceMappingURL=TextareaWidget.js.map