@rjsf/mui
Version:
Material UI 7 theme, fields and widgets for react-jsonschema-form
19 lines • 968 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { RichHelp } from '@rjsf/core';
import { helpId, getUiOptions, } from '@rjsf/utils';
import FormHelperText from '@mui/material/FormHelperText';
import { computeSxProps, getMuiProps } from '../util.js';
/** The `FieldHelpTemplate` component renders any help desired for a field
*
* @param props - The `FieldHelpProps` to be rendered
*/
export default function FieldHelpTemplate(props) {
const { fieldPathId, help, uiSchema, registry } = props;
if (!help) {
return null;
}
const uiOptions = getUiOptions(uiSchema);
const { rjsfSlotProps: { helpFormHelperText } = {} } = getMuiProps(uiOptions);
return (_jsx(FormHelperText, { component: 'div', id: helpId(fieldPathId), ...helpFormHelperText, sx: computeSxProps({ mt: 0.625 }, helpFormHelperText), children: _jsx(RichHelp, { help: help, registry: registry, uiSchema: uiSchema }) }));
}
//# sourceMappingURL=FieldHelpTemplate.js.map