UNPKG

@chris-bellman/rjsf-mantine-5-theme

Version:

Mantine 5 theme, fields and widgets for react-jsonschema-form. Based on @aokiapp/rjsf-mantine-theme

56 lines (51 loc) 1.47 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var jsxRuntime = require('react/jsx-runtime'); var core = require('@mantine/core'); var utils = require('@rjsf/utils'); function ObjectFieldTemplate(props) { const { disabled, formData, idSchema, onAddClick, properties, readonly, registry, // required, schema, // title, uiSchema } = props; const options = utils.getUiOptions(uiSchema); const { ButtonTemplates: { AddButton } } = registry.templates; const classNames = options.classNames; return /* @__PURE__ */ jsxRuntime.jsxs( "div", { id: idSchema.$id, style: { width: "100%", marginBottom: "12px" }, className: `armt-template-objectfield ${classNames ?? ""}`, children: [ /* @__PURE__ */ jsxRuntime.jsx(core.Box, { className: "armt-template-objectfield-item", children: /* @__PURE__ */ jsxRuntime.jsx(core.Stack, { spacing: "xs", children: properties.map((prop) => prop.content) }) }), utils.canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsxRuntime.jsx( AddButton, { className: "object-property-expand", onClick: onAddClick(schema), disabled: disabled || readonly, uiSchema, registry } ) ] } ); } exports.default = ObjectFieldTemplate; //# sourceMappingURL=ObjectFieldTemplate.cjs.map