import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _get from "@babel/runtime/helpers/get";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
import { __decorate } from "tslib";
import { computed } from 'mobx';
import ViewComponent from '../core/ViewComponent';
import localeContext from '../locale-context/LocaleContext';

var DataSetComponent = /*#__PURE__*/function (_ViewComponent) {
  _inherits(DataSetComponent, _ViewComponent);

  var _super = _createSuper(DataSetComponent);

  function DataSetComponent() {
    _classCallCheck(this, DataSetComponent);

    return _super.apply(this, arguments);
  }

  _createClass(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.locale.lang;
    }
  }, {
    key: "getObservableProps",
    value: function getObservableProps(props, context) {
      var observableProps = _get(_getPrototypeOf(DataSetComponent.prototype), "getObservableProps", this).call(this, props, context);

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

      return observableProps;
    }
  }, {
    key: "getOmitPropsKeys",
    value: function getOmitPropsKeys() {
      return _get(_getPrototypeOf(DataSetComponent.prototype), "getOmitPropsKeys", this).call(this).concat(['dataSet']);
    }
  }]);

  return DataSetComponent;
}(ViewComponent);

export { DataSetComponent as default };

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