@talend/react-forms
Version:
React forms library based on json schema form.
37 lines • 1.07 kB
JavaScript
import PropTypes from 'prop-types';
import { Form, StackItem } from '@talend/design-system';
import Widget from '../../Widget';
import { createElement as _createElement } from "react";
import { jsx as _jsx } from "react/jsx-runtime";
export default function Columns(props) {
const {
schema,
...restProps
} = props;
return /*#__PURE__*/_jsx(Form.Fieldset, {
legend: schema.title,
children: /*#__PURE__*/_jsx(Form.Row, {
"data-form-row": true,
isStretched: true,
children: schema.items.map((colSchema, index) => /*#__PURE__*/_jsx(StackItem, {
grow: true,
isFullWidth: true,
children: /*#__PURE__*/_createElement(Widget, {
...restProps,
key: index,
schema: colSchema
})
}, index))
})
});
}
if (process.env.NODE_ENV !== 'production') {
Columns.propTypes = {
schema: PropTypes.shape({
items: PropTypes.array.isRequired,
title: PropTypes.string
}).isRequired,
...Widget.propTypes
};
}
//# sourceMappingURL=Columns.component.js.map