'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FormPhoneNumber = 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 _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 FormPhoneNumber = function FormPhoneNumber(props) {
  var areaOptions = props.areaOptions,
      areaName = props.areaName,
      areaValue = props.areaValue,
      textInputAndSelectProps = _objectWithoutProperties(props, ['areaOptions', 'areaName', 'areaValue']);

  return _react2.default.createElement(_textInputAndSelect.TextInputAndSelect, _extends({
    selectOptions: areaOptions,
    selectName: areaName,
    selectValue: areaValue,
    appendSelect: true,
    type: 'tel'
  }, textInputAndSelectProps));
};

exports.FormPhoneNumber = FormPhoneNumber;
FormPhoneNumber.defaultProps = {
  tiny: false,
  disabled: false,
  areaOptions: [{ value: '+33', label: '+33' }],
  areaName: null,
  areaValue: null,
  digits: null // 2 or 12 for now
};