Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-rate

Package Overview
Dependencies
Maintainers
4
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-rate - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

es/index.js

8

lib/index.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__esModule = true;

@@ -11,5 +9,5 @@ var _Rate = require('./Rate');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports["default"] = _Rate2["default"];
exports['default'] = _Rate2['default'];
module.exports = exports['default'];
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__esModule = true;

@@ -29,6 +27,4 @@ var _react = require('react');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -38,3 +34,3 @@

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

@@ -57,2 +53,5 @@ function noop() {}

}
_this.stars = {};
_this.state = {

@@ -77,3 +76,3 @@ value: value

Rate.prototype.getStarDOM = function getStarDOM(index) {
return _reactDom2["default"].findDOMNode(this.refs['star_' + index]);
return _reactDom2['default'].findDOMNode(this.stars[index]);
};

@@ -109,4 +108,4 @@

for (var index = 0; index < count; index++) {
stars.push(_react2["default"].createElement(_Star2["default"], {
ref: 'star_' + index,
stars.push(_react2['default'].createElement(_Star2['default'], {
ref: this.saveRef(index),
index: index,

@@ -123,6 +122,6 @@ disabled: disabled,

}
return _react2["default"].createElement(
return _react2['default'].createElement(
'ul',
{
className: (0, _classnames2["default"])(prefixCls, disabledClass, className),
className: (0, _classnames2['default'])(prefixCls, disabledClass, className),
style: style,

@@ -136,16 +135,16 @@ onMouseLeave: disabled ? null : this.onMouseLeave

return Rate;
}(_react2["default"].Component);
}(_react2['default'].Component);
Rate.propTypes = {
disabled: _propTypes2["default"].bool,
value: _propTypes2["default"].number,
defaultValue: _propTypes2["default"].number,
count: _propTypes2["default"].number,
allowHalf: _propTypes2["default"].bool,
style: _propTypes2["default"].object,
prefixCls: _propTypes2["default"].string,
onChange: _propTypes2["default"].func,
onHoverChange: _propTypes2["default"].func,
className: _propTypes2["default"].string,
character: _propTypes2["default"].node
disabled: _propTypes2['default'].bool,
value: _propTypes2['default'].number,
defaultValue: _propTypes2['default'].number,
count: _propTypes2['default'].number,
allowHalf: _propTypes2['default'].bool,
style: _propTypes2['default'].object,
prefixCls: _propTypes2['default'].string,
onChange: _propTypes2['default'].func,
onHoverChange: _propTypes2['default'].func,
className: _propTypes2['default'].string,
character: _propTypes2['default'].node
};

@@ -191,5 +190,11 @@ Rate.defaultProps = {

};
this.saveRef = function (index) {
return function (node) {
_this2.stars[index] = node;
};
};
};
exports["default"] = Rate;
exports['default'] = Rate;
module.exports = exports['default'];
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__esModule = true;

@@ -15,6 +13,4 @@ var _react = require('react');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -24,3 +20,3 @@

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

@@ -76,3 +72,3 @@ var Star = function (_React$Component) {

return _react2["default"].createElement(
return _react2['default'].createElement(
'li',

@@ -84,3 +80,3 @@ {

},
_react2["default"].createElement(
_react2['default'].createElement(
'div',

@@ -90,3 +86,3 @@ { className: prefixCls + '-first' },

),
_react2["default"].createElement(
_react2['default'].createElement(
'div',

@@ -100,15 +96,15 @@ { className: prefixCls + '-second' },

return Star;
}(_react2["default"].Component);
}(_react2['default'].Component);
Star.propTypes = {
value: _propTypes2["default"].number,
index: _propTypes2["default"].number,
prefixCls: _propTypes2["default"].string,
allowHalf: _propTypes2["default"].bool,
disabled: _propTypes2["default"].bool,
onHover: _propTypes2["default"].func,
onClick: _propTypes2["default"].func,
character: _propTypes2["default"].node
value: _propTypes2['default'].number,
index: _propTypes2['default'].number,
prefixCls: _propTypes2['default'].string,
allowHalf: _propTypes2['default'].bool,
disabled: _propTypes2['default'].bool,
onHover: _propTypes2['default'].func,
onClick: _propTypes2['default'].func,
character: _propTypes2['default'].node
};
exports["default"] = Star;
exports['default'] = Star;
module.exports = exports['default'];
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__esModule = true;
exports.getOffsetLeft = getOffsetLeft;

@@ -7,0 +5,0 @@ function getScroll(w, top) {

{
"name": "rc-rate",
"version": "2.1.1",
"version": "2.2.0",
"description": "React Star Rate Component",

@@ -21,2 +21,3 @@ "keywords": [

"lib",
"es",
"assets/*.css"

@@ -26,2 +27,3 @@ ],

"main": "./lib/index",
"module": "./es/index",
"config": {

@@ -32,2 +34,3 @@ "port": 8000

"build": "rc-tools run build",
"compile": "rc-tools run compile --babel-runtime",
"gh-pages": "rc-tools run gh-pages",

@@ -37,14 +40,16 @@ "start": "rc-tools run server",

"lint": "rc-tools run lint",
"karma": "rc-tools run karma",
"saucelabs": "rc-tools run saucelabs",
"test": "rc-tools run test",
"chrome-test": "rc-tools run chrome-test",
"coverage": "rc-tools run coverage"
"karma": "rc-test run karma",
"saucelabs": "rc-test run saucelabs",
"test": "rc-test run test",
"chrome-test": "rc-test run chrome-test",
"coverage": "rc-test run coverage"
},
"devDependencies": {
"core-js": "^2.5.1",
"expect.js": "0.3.x",
"pre-commit": "1.x",
"rc-tools": "5.x",
"react": "^15.0.0",
"react-dom": "^15.0.0"
"rc-test": "^6.0.8",
"rc-tools": "^7.0.2",
"react": "^16.0.0",
"react-dom": "^16.0.0"
},

@@ -55,2 +60,3 @@ "pre-commit": [

"dependencies": {
"babel-runtime": "^6.26.0",
"classnames": "^2.2.5",

@@ -57,0 +63,0 @@ "prop-types": "^15.5.8"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc