import * as tslib_1 from "tslib";
import React from 'react';
import { Form, Radio } from 'antd';
var FormRadio = function (props) {
    var label = props.label, labelCol = props.labelCol, wrapperCol = props.wrapperCol, field = props.field, initialValue = props.initialValue, required = props.required, validator = props.validator;
    var _a = props.form, getFieldDecorator = _a.getFieldDecorator, getFieldValue = _a.getFieldValue;
    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\u9009\u62E9" + label },
            {
                validator: function (rule, value, callback) {
                    return validator ? validator(rule, value, callback) : callback();
                },
            },
        ],
    })(props.readOnly ? (props.render ? (props.render(getFieldValue(field))) : (React.createElement("span", null, getFieldValue(field)))) : (React.createElement(Radio.Group, { onChange: props.onChange, disabled: props.disabled }, props.options.map(function (option) { return (React.createElement(Radio, { value: option.key }, option.value)); }))))));
};
export default FormRadio;
//# sourceMappingURL=index.js.map