UNPKG

@rjsf/semantic-ui

Version:

Semantic UI theme, fields and widgets for react-jsonschema-form

23 lines 995 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Grid, Header } from 'semantic-ui-react'; import { getSemanticProps } from '../util.js'; const DEFAULT_OPTIONS = { inverted: false, dividing: true, }; /** The `TitleField` is the template to use to render the title of a field * * @param props - The `TitleFieldProps` for this component */ export default function TitleField({ id, title, uiSchema, optionalDataControl, }) { const semanticProps = getSemanticProps({ uiSchema, defaultSchemaProps: DEFAULT_OPTIONS, }); let heading = title ? (_jsx(Header, { id: id, ...semanticProps, as: 'h5', children: title })) : null; if (optionalDataControl) { heading = (_jsxs(Grid, { colums: 2, relaxed: true, children: [_jsx(Grid.Column, { width: 14, style: { paddingRight: 0 }, children: heading }), _jsx(Grid.Column, { width: 2, children: optionalDataControl })] })); } return heading; } //# sourceMappingURL=TitleField.js.map