react-star-rating-input
Advanced tools
Comparing version 7.0.1 to 8.0.0
@@ -1,5 +0,10 @@ | ||
# 7.0.0 | ||
# v8 | ||
* Convert to TypeScript | ||
* New reduced API: interactive StarRatingInput + static StarRating | ||
# v7 | ||
* React is no longer in the dependencies | ||
* Replace react-intl with plain text props: clearLabel, clearHint | ||
* Compatibility with React 0.15 verified |
{ | ||
"name": "react-star-rating-input", | ||
"version": "7.0.1", | ||
"description": "React.js component for entering 0-5 stars", | ||
"main": "index.js", | ||
"version": "8.0.0", | ||
"description": "React.js components for entering/displaying star ratings", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"pretest": "jshint tests src index.js demo.js", | ||
"test": "mocha -r tests/helpers/jsdom-bootstrap -b tests/*.spec.js", | ||
"build": "browserify demo.js | uglifyjs > www/bundle.js", | ||
"tdd": "mocha -r tests/helpers/jsdom-bootstrap -b -R min -w tests/*.spec.js" | ||
"build": "tsc", | ||
"demo": "parcel serve -d www --no-source-maps src/demo.html", | ||
"demo-build": "parcel build -d www --no-source-maps --public-url /h/react-star-rating-input src/demo.html", | ||
"lint": "tslint -c tslint.json src/*.{ts,tsx} test/*.{ts,tsx}", | ||
"prepublish": "npm run build", | ||
"pretest": "npm run lint", | ||
"tdd": "mocha -r ts-node/register -r tests/helpers/configureEnzyme --watch-extensions ts,tsx -b -R min -w tests/*.spec.*", | ||
"test": "mocha -r ts-node/register -r tests/helpers/configureEnzyme -b tests/*.spec.*" | ||
}, | ||
@@ -17,14 +22,14 @@ "repository": { | ||
"keywords": [ | ||
"reactjs", | ||
"TypeScript", | ||
"browser", | ||
"component", | ||
"react-component", | ||
"control", | ||
"form", | ||
"html", | ||
"form", | ||
"browser", | ||
"browserify", | ||
"input", | ||
"control", | ||
"widget", | ||
"rating", | ||
"react-component", | ||
"reactjs", | ||
"stars", | ||
"rating" | ||
"widget" | ||
], | ||
@@ -38,13 +43,21 @@ "author": "Ivan Krechetov <ikr@ikr.su>", | ||
"devDependencies": { | ||
"browserify": "^13.0.1", | ||
"insert-css": "^1.0.0", | ||
"jsdom": "^9.2.1", | ||
"jshint": "^2.9.2", | ||
"mocha": "^2.5.3", | ||
"react": "^15.1.0", | ||
"react-addons-test-utils": "^15.1.0", | ||
"react-dom": "^15.1.0", | ||
"sinon": "^1.17.4", | ||
"uglify-js": "^2.6.2" | ||
"@types/enzyme": "^3.1.12", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^8.10.21", | ||
"@types/react": "^16.4.6", | ||
"@types/react-dom": "^16.0.6", | ||
"@types/sinon": "^5.0.1", | ||
"enzyme": "^3.3.0", | ||
"enzyme-adapter-react-16": "^1.1.1", | ||
"insert-css": "^2.0.0", | ||
"jsdom": "^11.11.0", | ||
"mocha": "^5.2.0", | ||
"parcel-bundler": "^1.9.7", | ||
"react": "^16.4.1", | ||
"react-dom": "^16.4.1", | ||
"sinon": "^6.1.3", | ||
"ts-node": "^7.0.0", | ||
"tslint": "^5.11.0", | ||
"typescript": "^2.9.2" | ||
} | ||
} |
@@ -5,28 +5,33 @@ [![Build Status](https://travis-ci.org/ikr/react-star-rating-input.svg?branch=master)](https://travis-ci.org/ikr/react-star-rating-input) | ||
React.js component for entering 0-N stars (N is 5 by default). See | ||
[the demo](http://ikr.su/h/react-star-rating-input/demo.html). | ||
React.js components for entering 0—N stars (N is 5 by default), or displaying 0—N stars. See [the | ||
demo](http://ikr.su/h/react-star-rating-input/demo.html). | ||
It's published to npm compiled to ES5, and should work in IE11, if `Promise` gets polyfilled. | ||
# Installation | ||
Made for [Browserify](http://browserify.org/); graphics and CSS bundled. | ||
npm install --save react-star-rating-input | ||
The two main exports are: `{StarRatingInput, StarRating}`. The former is for an interactive input | ||
control, the latter is for passive star rating display. Star rasters and CSS is exported as the | ||
`{css}` string. | ||
# Usage | ||
See [the code](https://github.com/ikr/react-star-rating-input/blob/master/demo.js) of the demo | ||
See [the code](https://github.com/ikr/react-star-rating-input/blob/master/src/demo.tsx) of the demo | ||
mentioned above. | ||
## Props | ||
## StarRatingInput props | ||
Static layout | ||
* `size` -- how many stars to display. The default value is 5 | ||
* `showClear` -- hides the "Clear" link when `false`. The default value is `true` | ||
* `clearLabel` -- custom text for the "Clear" link | ||
* `clearHint` -- custom `<a>`'s title, a tooltip for the "Clear" link on mouse-hover | ||
* `size` — how many stars to display. The default value is 5 | ||
Interaction | ||
* `value` -- how many stars are selected | ||
* `onChange: function (value) {...}` -- your `value` change handler | ||
* `value` — how many stars are selected | ||
* `onChange: (value: number) => void` — your `value` change handler | ||
## StarRating props | ||
* `value` — how many stars are displayed |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2599700
121
37
18
50
1