@rjsf/react-bootstrap
Version:
React Bootstrap theme, fields and widgets for react-jsonschema-form, powered by react-bootstrap
18 lines • 1.18 kB
JavaScript
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, displayLabel, hasDescription, hasToolbar, uiSchema, registry } = props;
const uiOptions = getUiOptions(uiSchema);
const ArrayFieldItemButtonsTemplate = getTemplate('ArrayFieldItemButtonsTemplate', registry, uiOptions);
const btnStyle = {
flex: 1,
paddingLeft: 6,
paddingRight: 6,
fontWeight: 'bold',
};
const padding = hasDescription ? 'pb-1' : 'pt-4 mt-2';
return (_jsx("div", { children: _jsxs(Row, { className: 'mb-2 d-flex align-items-center', children: [_jsx(Col, { xs: '8', md: '9', lg: '10', children: children }), _jsx(Col, { xs: '4', md: '3', lg: '2', className: displayLabel ? padding : 'py-4', children: hasToolbar && (_jsx("div", { className: 'd-flex flex-row', children: _jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: btnStyle }) })) })] }) }));
}
//# sourceMappingURL=ArrayFieldItemTemplate.js.map