import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _Radio from "@alifd/next/es/radio";
var _excluded = ["nextTablePrefix", "value", "onChange", "rules", "name", "renderChildren"];
import React from "react";
import BaseTableField from "./baseTableField";
var RadioGroup = _Radio.Group;
var RadioField = /*#__PURE__*/function (_BaseTableField) {
  _inheritsLoose(RadioField, _BaseTableField);
  function RadioField() {
    return _BaseTableField.apply(this, arguments) || this;
  }
  var _proto = RadioField.prototype;
  _proto.renderField = function renderField() {
    var field = this.field;
    var _this$props = this.props,
      nextTablePrefix = _this$props.nextTablePrefix,
      value = _this$props.value,
      onChange = _this$props.onChange,
      rules = _this$props.rules,
      name = _this$props.name,
      renderChildren = _this$props.renderChildren,
      rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
    if (renderChildren) {
      return /*#__PURE__*/React.createElement(RadioGroup, _extends({
        className: nextTablePrefix + "radio-group"
      }, field.init(name, {
        rules: rules
      }, rest)), renderChildren());
    }
    return null;
  };
  return RadioField;
}(BaseTableField);
export { RadioField as default };