import _extends from "@babel/runtime/helpers/extends";
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";
import React, { Component } from 'react';
import Icon from '../icon';
import RcRate from '../rc-components/rate';
import ConfigContext from '../config-provider/ConfigContext';

var Rate = /*#__PURE__*/function (_Component) {
  _inherits(Rate, _Component);

  var _super = _createSuper(Rate);

  function Rate() {
    var _this;

    _classCallCheck(this, Rate);

    _this = _super.apply(this, arguments);

    _this.saveRate = function (node) {
      _this.rcRate = node;
    };

    return _this;
  }

  _createClass(Rate, [{
    key: "focus",
    value: function focus() {
      this.rcRate.focus();
    }
  }, {
    key: "blur",
    value: function blur() {
      this.rcRate.blur();
    }
  }, {
    key: "render",
    value: function render() {
      var getPrefixCls = this.context.getPrefixCls;
      return /*#__PURE__*/React.createElement(RcRate, _extends({
        ref: this.saveRate,
        prefixCls: getPrefixCls('rate')
      }, this.props));
    }
  }], [{
    key: "contextType",
    get: function get() {
      return ConfigContext;
    }
  }]);

  return Rate;
}(Component);

export { Rate as default };
Rate.displayName = 'Rate';
Rate.defaultProps = {
  character: /*#__PURE__*/React.createElement(Icon, {
    type: "star"
  })
};
//# sourceMappingURL=index.js.map
