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

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 _react = _interopRequireDefault(require("react"));

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

var _shared = require("choerodon-ui/shared");

var _spin = _interopRequireDefault(require("../../../lib/spin"));

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

var _DataSetComponent2 = _interopRequireDefault(require("../data-set/DataSetComponent"));

var _excluded = ["dataSet"];

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

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

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

  (0, _createClass2["default"])(Spin, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          dataSet = _this$props.dataSet,
          otherProps = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
      var props = {};

      if (dataSet) {
        props.spinning = dataSet.status !== _enum.DataSetStatus.ready;
      }

      return /*#__PURE__*/_react["default"].createElement(_spin["default"], (0, _extends2["default"])({}, otherProps, props));
    }
  }], [{
    key: "setDefaultIndicator",
    value: function setDefaultIndicator(indicator) {
      _shared.global.DEFAULT_SPIN_INDICATOR = indicator;
    }
  }]);
  return Spin;
}(_DataSetComponent2["default"]);

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