UNPKG

@agentlab/rjsf-antd

Version:

Ant Design theme, fields and widgets for react-jsonschema-form

25 lines 1.23 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; // remove this once https://github.com/rjsf-team/react-jsonschema-form/issues/1405 is resolved import React from 'react'; import Form from 'react-jsonschema-form'; function withTheme(themeProps) { const sss = React.forwardRef((_a, ref) => { var { fields, widgets } = _a, directProps = __rest(_a, ["fields", "widgets"]); return (React.createElement(Form, Object.assign({}, themeProps, directProps, { fields: Object.assign(Object.assign({}, themeProps.fields), fields), widgets: Object.assign(Object.assign({}, themeProps.widgets), widgets), ref: ref }))); }); sss.displayName = 'withTheme_ref'; return sss; } withTheme.displayName = 'withTheme'; export default withTheme; //# sourceMappingURL=withTheme.js.map