"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 _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

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

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

var _tslib = require("tslib");

var _mobx = require("mobx");

var _ViewComponent2 = _interopRequireDefault(require("../core/ViewComponent"));

var _LocaleContext = _interopRequireDefault(require("../locale-context/LocaleContext"));

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

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

  function DataSetComponent() {
    (0, _classCallCheck2["default"])(this, DataSetComponent);
    return _super.apply(this, arguments);
  }

  (0, _createClass2["default"])(DataSetComponent, [{
    key: "dataSet",
    get: function get() {
      return this.observableProps.dataSet;
    }
  }, {
    key: "lang",
    get: function get() {
      var lang = this.observableProps.lang;

      if (lang) {
        return lang;
      }

      var dataSet = this.dataSet;

      if (dataSet && dataSet.lang) {
        return dataSet.lang;
      }

      return _LocaleContext["default"].locale.lang;
    }
  }, {
    key: "getObservableProps",
    value: function getObservableProps(props, context) {
      var observableProps = (0, _get2["default"])((0, _getPrototypeOf2["default"])(DataSetComponent.prototype), "getObservableProps", this).call(this, props, context);

      if ('dataSet' in props) {
        observableProps.dataSet = props.dataSet;
      }

      return observableProps;
    }
  }, {
    key: "getOmitPropsKeys",
    value: function getOmitPropsKeys() {
      return (0, _get2["default"])((0, _getPrototypeOf2["default"])(DataSetComponent.prototype), "getOmitPropsKeys", this).call(this).concat(['dataSet']);
    }
  }]);
  return DataSetComponent;
}(_ViewComponent2["default"]);

exports["default"] = DataSetComponent;
(0, _tslib.__decorate)([_mobx.computed], DataSetComponent.prototype, "lang", null);
//# sourceMappingURL=DataSetComponent.js.map
