"use strict";

var _react = _interopRequireDefault(require("react"));

var _react2 = require("@storybook/react");

var _addonKnobs = require("@storybook/addon-knobs");

var _reduxForm = require("redux-form");

var _component = _interopRequireDefault(require("./component"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

// const { getState, dispatch } = configureStore();
var TestWrap = function TestWrap(_ref) {
  var children = _ref.children;
  return _react.default.createElement("form", null, children);
};

var RFWrap = (0, _reduxForm.reduxForm)({
  form: 'rf-wrap2'
})(TestWrap);

var props = function props() {
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
      _ref2$isDisabled = _ref2.isDisabled,
      isDisabled = _ref2$isDisabled === void 0 ? undefined : _ref2$isDisabled,
      _ref2$valuePassed = _ref2.valuePassed,
      valuePassed = _ref2$valuePassed === void 0 ? undefined : _ref2$valuePassed,
      _ref2$label = _ref2.label,
      label = _ref2$label === void 0 ? undefined : _ref2$label;

  return {
    isDisabled: (0, _addonKnobs.boolean)('isDisabled', isDisabled),
    valuePassed: (0, _addonKnobs.text)('valuePassed', valuePassed),
    label: (0, _addonKnobs.text)('label', label) // input

  };
}; // const onChange = ({ target: { value }}) => { dispatch(updateRadioRF(value)); forceReRender() };


(0, _react2.storiesOf)('Web|form/Radio').add('ReduxForm', function () {
  return _react.default.createElement(RFWrap, null, _react.default.createElement(_component.default, _extends({}, props({
    valuePassed: 'male',
    label: 'male'
  }), {
    input: {
      checked: false,
      name: 'sex'
    }
  })));
}, {
  info: 'redux-form lib, reduxForm() parent, Field parent'
});