UNPKG

@rjsf/react-bootstrap

Version:

React Bootstrap theme, fields and widgets for react-jsonschema-form, powered by react-bootstrap

17 lines 1.04 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Row from 'react-bootstrap/Row'; import Col from 'react-bootstrap/Col'; import { getTemplate, getUiOptions, } from '@rjsf/utils'; export default function ArrayFieldItemTemplate(props) { const { children, buttonsProps, hasToolbar, uiSchema, registry } = props; const uiOptions = getUiOptions(uiSchema); const ArrayFieldItemButtonsTemplate = getTemplate('ArrayFieldItemButtonsTemplate', registry, uiOptions); const btnStyle = { flex: 1, paddingLeft: 6, paddingRight: 6, fontWeight: 'bold', }; return (_jsx("div", { children: _jsxs(Row, { className: 'mb-2 d-flex align-items-center', children: [_jsx(Col, { xs: '9', lg: '9', children: children }), _jsx(Col, { xs: '3', lg: '3', className: 'py-4', children: hasToolbar && (_jsx("div", { className: 'd-flex flex-row', children: _jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) })) })] }) })); } //# sourceMappingURL=ArrayFieldItemTemplate.js.map