"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));

var _tslib = require("tslib");

var _mobxReact = require("mobx-react");

var _TextField2 = require("../text-field/TextField");

var _localeContext = require("../locale-context");

var _enum = require("../data-set/enum");

var EmailField = /*#__PURE__*/function (_TextField) {
  (0, _inherits2["default"])(EmailField, _TextField);

  var _super = (0, _createSuper2["default"])(EmailField);

  function EmailField() {
    var _this;

    (0, _classCallCheck2["default"])(this, EmailField);
    _this = _super.apply(this, arguments);
    _this.type = 'email';
    return _this;
  }

  (0, _createClass2["default"])(EmailField, [{
    key: "range",
    get: function get() {
      return false;
    }
  }, {
    key: "getFieldType",
    value: function getFieldType() {
      return _enum.FieldType.email;
    }
  }, {
    key: "defaultValidationMessages",
    get: function get() {
      var label = this.getProp('label');
      return {
        valueMissing: (0, _localeContext.$l)('EmailField', label ? 'value_missing' : 'value_missing_no_label', {
          label: label
        }),
        typeMismatch: (0, _localeContext.$l)('EmailField', 'type_mismatch')
      };
    }
  }]);
  return EmailField;
}(_TextField2.TextField);

EmailField.displayName = 'EmailField';
EmailField = (0, _tslib.__decorate)([_mobxReact.observer], EmailField);
var _default = EmailField;
exports["default"] = _default;
//# sourceMappingURL=EmailField.js.map
