"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 UrlField = /*#__PURE__*/function (_TextField) {
  (0, _inherits2["default"])(UrlField, _TextField);

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

  function UrlField() {
    var _this;

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

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

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