"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var _radio = _interopRequireDefault(require("@alifd/next/lib/radio"));
var _react = _interopRequireDefault(require("react"));
var _baseTableField = _interopRequireDefault(require("./baseTableField"));
var _excluded = ["nextTablePrefix", "value", "onChange", "rules", "name", "renderChildren"];
var RadioGroup = _radio["default"].Group;
var RadioField = /*#__PURE__*/function (_BaseTableField) {
  (0, _inheritsLoose2["default"])(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 = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, _excluded);
    if (renderChildren) {
      return /*#__PURE__*/_react["default"].createElement(RadioGroup, (0, _extends2["default"])({
        className: nextTablePrefix + "radio-group"
      }, field.init(name, {
        rules: rules
      }, rest)), renderChildren());
    }
    return null;
  };
  return RadioField;
}(_baseTableField["default"]);
exports["default"] = RadioField;