@limetech/lime-elements
Version:
14 lines (13 loc) • 680 B
JavaScript
import JSONObjectField from "@rjsf/core/lib/components/fields/ObjectField";
import React from "react";
import { CodeEditor } from "../widgets/code-editor";
import { renderDescription, renderTitle } from "../templates/common";
import { isCustomObjectSchema } from "./field-helpers";
export class ObjectField extends React.Component {
render() {
if (!isCustomObjectSchema(this.props.schema)) {
return React.createElement(JSONObjectField, this.props);
}
return React.createElement(React.Fragment, {}, renderTitle(this.props.schema.title), renderDescription(this.props.schema.description), React.createElement(CodeEditor, this.props));
}
}