"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 React = _interopRequireWildcard(require("react"));
var _radioGroup = _interopRequireDefault(require("../radio-group"));
require("./index.less");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
var _default = exports["default"] = function _default(props) {
  var title = props.title,
    dataList = props.dataList,
    styleKey = props.styleKey,
    children = props.children,
    styleData = props.styleData,
    _props$contentStyle = props.contentStyle,
    contentStyle = _props$contentStyle === void 0 ? {} : _props$contentStyle,
    value = props.value,
    longTitle = props.longTitle;
  return /*#__PURE__*/React.createElement("div", {
    className: "row-container"
  }, title && /*#__PURE__*/React.createElement("div", {
    className: styleData[styleKey] ? (!longTitle ? 'title-contaienr' : 'title-contaienr-long') + " title-text title-text-active" : (!longTitle ? 'title-contaienr' : 'title-contaienr-long') + " title-text"
  }, title), /*#__PURE__*/React.createElement("div", {
    className: "content-container",
    style: contentStyle
  }, children ? children : /*#__PURE__*/React.createElement(_radioGroup["default"], (0, _extends2["default"])({
    dataList: dataList
  }, props, {
    // @ts-ignore
    // 区分是style类型的值还是其他普通的值，从styleData获取的是对象
    value: typeof value != 'string' ? styleData && styleData[styleKey] : value
  }))));
};