@chris-bellman/rjsf-mantine-5-theme
Version:
Mantine 5 theme, fields and widgets for react-jsonschema-form. Based on @aokiapp/rjsf-mantine-theme
52 lines (49 loc) • 1.36 kB
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import { Box, Stack } from '@mantine/core';
import { getUiOptions, canExpand } from '@rjsf/utils';
function ObjectFieldTemplate(props) {
const {
disabled,
formData,
idSchema,
onAddClick,
properties,
readonly,
registry,
// required,
schema,
// title,
uiSchema
} = props;
const options = getUiOptions(uiSchema);
const {
ButtonTemplates: { AddButton }
} = registry.templates;
const classNames = options.classNames;
return /* @__PURE__ */ jsxs(
"div",
{
id: idSchema.$id,
style: {
width: "100%",
marginBottom: "12px"
},
className: `armt-template-objectfield ${classNames ?? ""}`,
children: [
/* @__PURE__ */ jsx(Box, { className: "armt-template-objectfield-item", children: /* @__PURE__ */ jsx(Stack, { spacing: "xs", children: properties.map((prop) => prop.content) }) }),
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx(
AddButton,
{
className: "object-property-expand",
onClick: onAddClick(schema),
disabled: disabled || readonly,
uiSchema,
registry
}
)
]
}
);
}
export { ObjectFieldTemplate as default };
//# sourceMappingURL=ObjectFieldTemplate.mjs.map