react-bootstrap-toggle
Advanced tools
Comparing version 1.2.19 to 2.0.0
{ | ||
"name": "react-bootstrap-toggle", | ||
"version": "1.2.19", | ||
"version": "2.0.0", | ||
"description": "A React version of the bootstrap-toggle without the JQuery dependency", | ||
"main": "./lib/react-bootstrap-toggle.js", | ||
"main": "./dist/react-bootstrap-toggle.js", | ||
"repository": { | ||
@@ -11,5 +11,8 @@ "type": "git", | ||
"scripts": { | ||
"less": "gulp less", | ||
"compile": "babel --presets es2015,react -d lib/ src/", | ||
"prepublish": "npm run compile && npm run less" | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"coverage": "jest --coverage", | ||
"start": "webpack-dev-server --inline --hot", | ||
"coveralls": "jet --coverage | coveralls", | ||
"build": "babel src -d dist" | ||
}, | ||
@@ -21,22 +24,26 @@ "keywords": [ | ||
"license": "ISC", | ||
"peerDependencies": { | ||
"react": "^0.14.6 || ^15.0.0-rc || ^15.0", | ||
"react-dom": "^0.14.6 || ^15.0.0-rc || ^15.0" | ||
"devDependencies": { | ||
"babel-core": "^6.20.0", | ||
"babel-eslint": "^7.1.1", | ||
"babel-loader": "^6.2.8", | ||
"babel-preset-es2015": "^6.18.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-preset-stage-0": "^6.16.0", | ||
"enzyme": "^2.6.0", | ||
"eslint": "^3.11.1", | ||
"eslint-config-airbnb": "^13.0.0", | ||
"eslint-loader": "^1.6.1", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^6.7.1", | ||
"jest": "^17.0.3", | ||
"react-addons-test-utils": "^15.4.1", | ||
"sinon": "^1.17.6", | ||
"webpack": "^1.13.3", | ||
"webpack-dev-server": "^1.16.2" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.4.5", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-preset-react": "^6.3.13", | ||
"babelify": "^7.2.0", | ||
"browserify": "^13.0.0", | ||
"gulp": "^3.9.0", | ||
"gulp-less": "^3.0.5", | ||
"gulp-sourcemaps": "^1.6.0", | ||
"gulp-uglify": "^1.5.1", | ||
"react": "^0.14.6", | ||
"react-dom": "^0.14.6", | ||
"vinyl-buffer": "^1.0.0", | ||
"vinyl-source-stream": "^1.1.0", | ||
"watchify": "^3.7.0" | ||
"dependencies": { | ||
"react": "^15.4.2", | ||
"react-dom": "^15.4.2" | ||
} | ||
} |
## React-Bootstrap-Toggle | ||
[![Build Status](https://travis-ci.org/arnthor3/react-bootstrap-toggle.svg?branch=master)](https://travis-ci.org/arnthor3/react-bootstrap-toggle) | ||
[![Coverage Status](https://coveralls.io/repos/github/arnthor3/react-bootstrap-toggle/badge.svg?branch=master)](https://coveralls.io/github/arnthor3/react-bootstrap-toggle?branch=master) | ||
This is a react component of the http://www.bootstraptoggle.com/ project. | ||
You need to include the bootstrap css file and also the bootstrap2-toggle css file in your app. | ||
If you are using the npm version then you can include it from the module like this. | ||
```sh | ||
<link rel="stylesheet" href="node_modules/lib/bootstrap2-toggle.css"> | ||
``` | ||
Or you could import it to your SASS or LESS build. | ||
```html | ||
@import "node_modules/lib/bootstrap2-toggle.c## React-Bootstrap-Toggle | ||
``` | ||
This is a react component of the http://www.bootstraptoggle.com/ project. | ||
### Usage | ||
@@ -38,9 +23,32 @@ | ||
```js | ||
import React from 'react'; | ||
import React, { Component } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import ReactBootstrapToggle from 'react-bootstrap-toggle'; | ||
import Toggle from 'react-bootstrap-toggle'; | ||
let on = <h1>Yeah!</h1>; | ||
let off = <span> no.no.no <br> NOOOO!!!! </span>; | ||
class Form extends Componentn { | ||
constructor() { | ||
super(); | ||
this.state = { toggleActive: false }; | ||
this.onToggle = this.onToggle.bind(this); | ||
} | ||
onToggle() { | ||
this.setState({ toggleActive: !this.state.toggleActive }); | ||
} | ||
render() { | ||
return ( | ||
<form> | ||
<input type="text"> | ||
<input type="number"> | ||
<Toggle | ||
onClick={this.onToggle} | ||
/> | ||
</form> | ||
) | ||
} | ||
} | ||
ReactDOM.render(<ReactBootstrapToggle | ||
@@ -62,4 +70,2 @@ on={on} | ||
Name|Type|Default|Description| | ||
@@ -75,5 +81,5 @@ ---|---|---|--- | ||
height|integer|*null*|Sets the height of the toggle. if set to *null*, height will be calculated. | ||
onChange|function|*null*|A Callback that returns the state of the toggle | ||
onClick|function|*null*|A Callback that returns the current state of the toggle | ||
### Updates | ||
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
28214
18
733
83
18
1
+ Addedreact@^15.4.2
+ Addedreact-dom@^15.4.2