'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FormAmountAndCurrency = undefined;

var _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; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _textInputAndSelect = require('kitten/components/form/text-input-and-select');

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

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

var FormAmountAndCurrency = function FormAmountAndCurrency(props) {
  var currencyOptions = props.currencyOptions,
      currencyName = props.currencyName,
      currencyValue = props.currencyValue,
      textInputAndSelectProps = _objectWithoutProperties(props, ['currencyOptions', 'currencyName', 'currencyValue']);

  return _react2.default.createElement(_textInputAndSelect.TextInputAndSelect, _extends({
    selectOptions: currencyOptions,
    selectName: currencyName,
    selectValue: currencyValue,
    key: currencyName,
    type: 'number'
  }, textInputAndSelectProps));
};

exports.FormAmountAndCurrency = FormAmountAndCurrency;
FormAmountAndCurrency.defaultProps = {
  tiny: false,
  disabled: false,
  currencyOptions: [{ value: 'eur', label: 'EUR' }],
  currencyName: null,
  currencyValue: null,
  digits: null // 2 or 12 for now
};