UNPKG

react-admin-component

Version:
26 lines 1.25 kB
import * as tslib_1 from "tslib"; import React from 'react'; import { Form, Input } from 'antd'; var FormCustom = function (props) { var label = props.label, labelCol = props.labelCol, wrapperCol = props.wrapperCol, field = props.field, initialValue = props.initialValue, required = props.required, validator = props.validator, customRender = props.customRender; var getFieldDecorator = props.form.getFieldDecorator; return (React.createElement(Form.Item, tslib_1.__assign({}, { label: label, labelCol: labelCol, wrapperCol: wrapperCol, }, { className: props.className, style: props.style }), getFieldDecorator(field, { initialValue: initialValue, rules: [ { required: required, message: "\u8BF7\u8F93\u5165" + label }, { validator: function (rule, value, callback) { return validator ? validator(rule, value, callback) : callback(); }, }, ], })(React.createElement(Input, { style: { display: 'none' } })), customRender && customRender(props.form))); }; export default FormCustom; //# sourceMappingURL=index.js.map