import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper";
var _excluded = ["dataSet"];
import { __decorate } from "tslib";
import React from 'react';
import { observer } from 'mobx-react';
import { global } from 'choerodon-ui/shared';
import C7NSpin from '../../../es/spin';
import { DataSetStatus } from '../data-set/enum';
import DataSetComponent from '../data-set/DataSetComponent';

var Spin = /*#__PURE__*/function (_DataSetComponent) {
  _inherits(Spin, _DataSetComponent);

  var _super = _createSuper(Spin);

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

    return _super.apply(this, arguments);
  }

  _createClass(Spin, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          dataSet = _this$props.dataSet,
          otherProps = _objectWithoutProperties(_this$props, _excluded);

      var props = {};

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

      return /*#__PURE__*/React.createElement(C7NSpin, _extends({}, otherProps, props));
    }
  }], [{
    key: "setDefaultIndicator",
    value: function setDefaultIndicator(indicator) {
      global.DEFAULT_SPIN_INDICATOR = indicator;
    }
  }]);

  return Spin;
}(DataSetComponent);

Spin.displayName = 'Spin';
Spin = __decorate([observer], Spin);
export default Spin;
//# sourceMappingURL=index.js.map
