fx-form-widget
Version:
39 lines • 1.51 kB
JavaScript
import _Row from "antd/es/row";
import Separator from '../Separator';
import { nanoid } from 'nanoid';
import React from 'react';
import { renderDifferentLayputComponent } from '../ContentWrap';
import RenderWidget from '../ContentWrap/renderWidget';
var Group = function Group(props) {
var _props$schemaChildren = props.schemaChildrenData,
schemaChildrenData = _props$schemaChildren === void 0 ? [] : _props$schemaChildren,
_props$viewSchema = props.viewSchema,
viewSchema = _props$viewSchema === void 0 ? {} : _props$viewSchema,
wid = props.wid,
columnStyle = props.columnStyle;
var lineType = viewSchema.lineType,
title = viewSchema.title;
var renderFormItem = function renderFormItem(children) {
if (!children) {
return null;
}
return children.map(function (schemaData) {
var children = schemaData.children;
if (children) {
return renderDifferentLayputComponent(schemaData, nanoid());
}
return /*#__PURE__*/React.createElement(RenderWidget, {
schema: schemaData,
key: nanoid()
});
});
};
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(Separator, {
title: title,
lineStyle: lineType,
wid: wid
}), (schemaChildrenData === null || schemaChildrenData === void 0 ? void 0 : schemaChildrenData.length) !== 0 && /*#__PURE__*/React.createElement(_Row, {
gutter: 16
}, renderFormItem(schemaChildrenData)));
};
export default Group;