Socket
Socket
Sign inDemoInstall

rc-rate

Package Overview
Dependencies
Maintainers
6
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.5.0 to 2.5.1

26

es/Rate.js

@@ -1,3 +0,5 @@

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -13,2 +15,4 @@

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

@@ -18,4 +22,2 @@

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -46,3 +48,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onHover", function (event, index) {
_defineProperty(_assertThisInitialized(_this), "onHover", function (event, index) {
var onHoverChange = _this.props.onHoverChange;

@@ -64,3 +66,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onMouseLeave", function () {
_defineProperty(_assertThisInitialized(_this), "onMouseLeave", function () {
var onHoverChange = _this.props.onHoverChange;

@@ -76,3 +78,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onClick", function (event, index) {
_defineProperty(_assertThisInitialized(_this), "onClick", function (event, index) {
var allowClear = _this.props.allowClear;

@@ -98,3 +100,3 @@ var value = _this.state.value;

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onFocus", function () {
_defineProperty(_assertThisInitialized(_this), "onFocus", function () {
var onFocus = _this.props.onFocus;

@@ -111,3 +113,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onBlur", function () {
_defineProperty(_assertThisInitialized(_this), "onBlur", function () {
var onBlur = _this.props.onBlur;

@@ -124,3 +126,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onKeyDown", function (event) {
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
var keyCode = event.keyCode;

@@ -160,3 +162,3 @@ var _this$props = _this.props,

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "saveRef", function (index) {
_defineProperty(_assertThisInitialized(_this), "saveRef", function (index) {
return function (node) {

@@ -167,3 +169,3 @@ _this.stars[index] = node;

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "saveRate", function (node) {
_defineProperty(_assertThisInitialized(_this), "saveRate", function (node) {
_this.rate = node;

@@ -236,3 +238,3 @@ });

if (!disabled) {
this.rate.focus();
this.rate.blur();
}

@@ -239,0 +241,0 @@ }

@@ -11,2 +11,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

@@ -16,4 +18,2 @@

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -42,3 +42,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onHover", function (e) {
_defineProperty(_assertThisInitialized(_this), "onHover", function (e) {
var _this$props = _this.props,

@@ -50,3 +50,3 @@ onHover = _this$props.onHover,

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onClick", function (e) {
_defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
var _this$props2 = _this.props,

@@ -58,3 +58,3 @@ onClick = _this$props2.onClick,

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onKeyDown", function (e) {
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (e) {
var _this$props3 = _this.props,

@@ -61,0 +61,0 @@ onClick = _this$props3.onClick,

@@ -26,4 +26,6 @@ "use strict";

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -39,2 +41,4 @@

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

@@ -44,4 +48,2 @@

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -63,3 +65,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onHover", function (event, index) {
_defineProperty(_assertThisInitialized(_this), "onHover", function (event, index) {
var onHoverChange = _this.props.onHoverChange;

@@ -81,3 +83,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onMouseLeave", function () {
_defineProperty(_assertThisInitialized(_this), "onMouseLeave", function () {
var onHoverChange = _this.props.onHoverChange;

@@ -93,3 +95,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onClick", function (event, index) {
_defineProperty(_assertThisInitialized(_this), "onClick", function (event, index) {
var allowClear = _this.props.allowClear;

@@ -115,3 +117,3 @@ var value = _this.state.value;

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onFocus", function () {
_defineProperty(_assertThisInitialized(_this), "onFocus", function () {
var onFocus = _this.props.onFocus;

@@ -128,3 +130,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onBlur", function () {
_defineProperty(_assertThisInitialized(_this), "onBlur", function () {
var onBlur = _this.props.onBlur;

@@ -141,3 +143,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onKeyDown", function (event) {
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
var keyCode = event.keyCode;

@@ -177,3 +179,3 @@ var _this$props = _this.props,

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "saveRef", function (index) {
_defineProperty(_assertThisInitialized(_this), "saveRef", function (index) {
return function (node) {

@@ -184,3 +186,3 @@ _this.stars[index] = node;

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "saveRate", function (node) {
_defineProperty(_assertThisInitialized(_this), "saveRate", function (node) {
_this.rate = node;

@@ -253,3 +255,3 @@ });

if (!disabled) {
this.rate.focus();
this.rate.blur();
}

@@ -256,0 +258,0 @@ }

@@ -24,2 +24,4 @@ "use strict";

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

@@ -29,4 +31,2 @@

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -52,3 +52,3 @@

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onHover", function (e) {
_defineProperty(_assertThisInitialized(_this), "onHover", function (e) {
var _this$props = _this.props,

@@ -60,3 +60,3 @@ onHover = _this$props.onHover,

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onClick", function (e) {
_defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
var _this$props2 = _this.props,

@@ -68,3 +68,3 @@ onClick = _this$props2.onClick,

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onKeyDown", function (e) {
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (e) {
var _this$props3 = _this.props,

@@ -71,0 +71,0 @@ onClick = _this$props3.onClick,

{
"name": "rc-rate",
"version": "2.5.0",
"version": "2.5.1",
"description": "React Star Rate Component",

@@ -5,0 +5,0 @@ "keywords": [

@@ -54,7 +54,31 @@ # rc-rate

```js
var Rate = require('rc-rate');
var React = require('react');
React.render(<Rate />, container);
import React from 'react'
import ReactDOM from 'react-dom'
import Rate from 'rc-rate'
ReactDOM.render(
<Rate />,
document.getElementById('root')
)
```
### with [styled-components](https://github.com/styled-components/styled-components)
```js
import React from 'react'
import ReactDOM from 'react-dom'
import Rate from 'rc-rate'
import styled from 'styled-components'
cosnt StyledRate = styled(Rate)`
&.rc-rate {
font-size: ${({ size }) => size}px;
}
`
ReactDOM.render(
<StyledRate size="24" />,
document.getElementById('root')
)
```
## API

@@ -61,0 +85,0 @@

Sorry, the diff of this file is not supported yet

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