"use strict";

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

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

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

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

var _utils = require("../utils");

var ValidationResult = /*#__PURE__*/function () {
  function ValidationResult(props) {
    (0, _classCallCheck2["default"])(this, ValidationResult);
    (0, _extends2["default"])(this, props);
  }

  (0, _createClass2["default"])(ValidationResult, [{
    key: "validationMessage",
    get: function get() {
      var $validationMessage = this.$validationMessage,
          injectionOptions = this.injectionOptions;

      if ($validationMessage && injectionOptions) {
        var _this$validationProps = this.validationProps,
            name = _this$validationProps.name,
            dataSet = _this$validationProps.dataSet;
        return (0, _utils.getGlobalConfig)('validationMessageFormatter', dataSet && dataSet.getField(name))($validationMessage, injectionOptions);
      }

      return $validationMessage;
    },
    set: function set(validationMessage) {
      this.$validationMessage = validationMessage;
    }
  }]);
  return ValidationResult;
}();

exports["default"] = ValidationResult;
//# sourceMappingURL=ValidationResult.js.map
