import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

import React, { createElement } from 'react';
import { RadioStack, RadioStackProps } from './component';
export var RadioStackContainer =
/*#__PURE__*/
function (_React$Component) {
  _inherits(RadioStackContainer, _React$Component);

  function RadioStackContainer() {
    var _getPrototypeOf2;

    var _this;

    _classCallCheck(this, RadioStackContainer);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RadioStackContainer)).call.apply(_getPrototypeOf2, [this].concat(args)));

    _this.handleChange = function (e) {
      var data = _objectSpread({}, _this.props, {
        value: e.currentTarget.value
      });

      _this.props.onChange(e, data);
    };

    return _this;
  }

  _createClass(RadioStackContainer, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          id = _this$props.id,
          radios = _this$props.radios,
          active = _this$props.active;
      var props = {
        id: id,
        radios: radios,
        active: active,
        onChange: this.handleChange
      };
      return createElement(RadioStack, props);
    }
  }]);

  return RadioStackContainer;
}(React.Component);