@snups/rjsf-mantine
Version:
Mantine theme, fields and widgets for react-jsonschema-form
14 lines • 1.08 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTemplate, getUiOptions, } from '@snups/rjsf-utils';
import { Box, Flex, Group } from '@mantine/core';
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
*
* @param props - The `ArrayFieldItemTemplateType` props for the component
*/
export default function ArrayFieldItemTemplate(props) {
const { buttonsProps, className, hasToolbar, index, uiSchema, registry, children } = props;
const uiOptions = getUiOptions(uiSchema);
const ArrayFieldItemButtonsTemplate = getTemplate('ArrayFieldItemButtonsTemplate', registry, uiOptions);
return (_jsx(Box, { className: className || 'rjsf-array-item', mb: 'xs', children: _jsxs(Flex, { gap: 'xs', align: 'end', justify: 'center', children: [_jsx(Box, { w: '100%', children: children }), hasToolbar && (_jsx(Group, { wrap: 'nowrap', gap: 2, mb: 7, children: _jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps }) }))] }) }, `array-item-${index}`));
}
//# sourceMappingURL=ArrayFieldItemTemplate.js.map