UNPKG

@snups/rjsf-mantine

Version:

Mantine theme, fields and widgets for react-jsonschema-form

18 lines 1.16 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Box } from '@mantine/core'; import { getTemplate, getUiOptions, } from '@snups/rjsf-utils'; /** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field * content, (label, description, children, errors and help) inside a `WrapIfAdditional` component. * * @param props - The `FieldTemplateProps` for this component */ export default function FieldTemplate(props) { const { id, classNames, style, label, errors, help, displayLabel, description, rawDescription, hidden, schema, uiSchema, registry, children, ...otherProps } = props; const uiOptions = getUiOptions(uiSchema); const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions); if (hidden) { return _jsx(Box, { display: 'none', children: children }); } return (_jsxs(WrapIfAdditionalTemplate, { id: id, classNames: classNames, style: style, label: label, schema: schema, uiSchema: uiSchema, registry: registry, ...otherProps, children: [children, errors, help] })); } //# sourceMappingURL=FieldTemplate.js.map