react-bootstrap-switch
Advanced tools
Comparing version 3.4.5 to 15.0.0
{ | ||
"name": "react-bootstrap-switch", | ||
"description": "Turn checkboxes and radio buttons into toggle switches.", | ||
"version": "3.4.5", | ||
"version": "15.0.0", | ||
"keywords": [ | ||
@@ -17,25 +17,7 @@ "react", | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Mattia Larentis", | ||
"email": "mattia@larentis.eu", | ||
"url": "http://larentis.eu" | ||
}, | ||
{ | ||
"name": "Emanuele Marchi", | ||
"email": "emanuele@lostcrew.it", | ||
"url": "http://lostcrew.it" | ||
}, | ||
{ | ||
"name": "Peter Stein", | ||
"url": "http://www.bdmdesign.org" | ||
} | ||
], | ||
"main": "dist/js/react-bootstrap-switch.js", | ||
"main": "dist/js/index.js", | ||
"peerDependencies": { | ||
"react": "^0.14 || ^15.0.0" | ||
"react": "^15.0.0", | ||
"react-dom": "^15.0.0" | ||
}, | ||
"dependencies": { | ||
"jquery": ">=1.9.0" | ||
}, | ||
"repository": { | ||
@@ -49,43 +31,33 @@ "type": "git", | ||
"devDependencies": { | ||
"browser-sync": "^2.6.4", | ||
"coffee-react-transform": "^3.2.0", | ||
"coffee-script": "~1.9.2", | ||
"babel-core": "^6.10.4", | ||
"babel-eslint": "^6.1.1", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-preset-react": "^6.11.1", | ||
"babelify": "^7.3.0", | ||
"browser-sync": "^2.2.1", | ||
"browserify": "^8.1.3", | ||
"eslint": "^2.13.1", | ||
"eslint-plugin-babel": "^3.3.0", | ||
"eslint-plugin-import": "^1.10.2", | ||
"eslint-plugin-jsx-a11y": "^1.5.5", | ||
"eslint-plugin-react": "^5.2.2", | ||
"gulp": "^3.8.11", | ||
"gulp-changed": "^1.2.1", | ||
"gulp-cjsx": "^3.0.0", | ||
"gulp-coffee": "~2.3.1", | ||
"gulp-coffeelint": "~0.4.0", | ||
"gulp-connect": "^2.2.0", | ||
"gulp-header": "~1.2.2", | ||
"gulp-jade": "^1.0.0", | ||
"gulp-less": "^3.0.2", | ||
"gulp-load-plugins": "^0.10.0", | ||
"gulp-notify": "^2.2.0", | ||
"gulp-open": "~0.3.2", | ||
"gulp-plumber": "^1.0.0", | ||
"gulp-rename": "~1.2.2", | ||
"gulp-uglify": "~1.2.0", | ||
"gulp-util": "~3.0.4", | ||
"jasmine-core": "^2.2.0", | ||
"karma": "~0.12.31", | ||
"karma-firefox-launcher": "~0.1.4", | ||
"karma-jasmine": "^0.3.5", | ||
"less-plugin-clean-css": "^1.5.0", | ||
"run-sequence": "~1.0.2" | ||
"gulp-clean-css": "^2.0.11", | ||
"gulp-header": "^1.8.7", | ||
"gulp-less": "^3.1.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-util": "^3.0.3", | ||
"output-file-sync": "^1.1.2", | ||
"react": "^15.0.0", | ||
"react-bootstrap": "^0.29.5", | ||
"react-dom": "^15.0.0", | ||
"reactify": "^1.1.1", | ||
"vinyl-source-stream": "^1.0.0", | ||
"watchify": "^2.3.0" | ||
}, | ||
"scripts": { | ||
"dev": "NODE_ENV=development gulp", | ||
"build": "gulp dist", | ||
"test": "gulp test" | ||
}, | ||
"npmName": "react-bootstrap-switch", | ||
"npmFileMap": [ | ||
{ | ||
"basePath": "/dist/", | ||
"files": [ | ||
"*.js", | ||
"bootstrap3/*.css", | ||
"bootstrap2/*.css" | ||
] | ||
} | ||
] | ||
"lint": "eslint ." | ||
} | ||
} |
@@ -8,4 +8,8 @@ # Bootstrap Switch | ||
## Compatability | ||
Verion 3.4.x is built for React.js 0.14. It will not work with earlier versions of React.js. | ||
## Version Compatability | ||
| React Version | Switch Version | | ||
| ------------- | -------------- | | ||
| v15.x | v15.x | | ||
| v14.x | v3.4.x | | ||
| v13.x | v3.3.x | | ||
@@ -39,13 +43,13 @@ NOTE: The CSS from the original version is not fully compatible. There is CSS and LESS included in this repo, or any 3rd party themes can likely be made compatible with the changes shown [in this commit](https://github.com/Julusian/react-bootstrap-switch/commit/bbd9754b0cebb82aeb1724ca86c79529e4a7b9df). | ||
| ----------------- | ------- | --------- | ------ | ----------- | | ||
| **state** | boolean | true | true, false | Initial starting state of the switch | | ||
| **size** | string | null | null, 'mini', 'small', 'normal', 'large' | The checkbox size | | ||
| **animate** | boolean | true | true, false | Animate the switch | | ||
| **value** | boolean | true | true, false, null | State of the switch. Null indidcates indeterminate. Use to store state external to the switch | | ||
| **defaultValue** | boolean | true | true, false, null | Initial starting state of the switch. Null indidcates indeterminate. Use to make the switch remember and handle state itself | | ||
| **bsSize** | string | null | null, 'mini', 'small', 'normal', 'large' | The checkbox size | | ||
| **animate** | boolean | true | true, false | Enable or disable animation for the switch | | ||
| **disabled** | boolean | false | true, false | Disable state | | ||
| **readonly** | boolean | false | true, false | Readonly state | | ||
| **indeterminate** | boolean | false | true, false | Indeterminate state | | ||
| **inverse** | boolean | false | true, false | Inverse switch direction| | ||
| **onColor** | string | 'primary' | 'primary', 'info', 'success', 'warning', 'danger', 'default' | Color of the on state of the switch | | ||
| **offColor** | string | 'default' | 'primary', 'info', 'success', 'warning', 'danger', 'default' | Color of the off state of the switch | | ||
| **onText** | string | 'ON' | | Text of the on state of the switch | | ||
| **offText** | string | 'OFF' | | Text of the off state of the switch | | ||
| **onColor** | string | 'primary' | 'primary', 'info', 'success', 'warning', 'danger', 'default' | Color of the on side of the switch | | ||
| **offColor** | string | 'default' | 'primary', 'info', 'success', 'warning', 'danger', 'default' | Color of the off side of the switch | | ||
| **onText** | string | 'ON' | | Text of the on side of the switch | | ||
| **offText** | string | 'OFF' | | Text of the off side of the switch | | ||
| **labelText** | string | '' | | Text of the center handle of the switch | | ||
@@ -56,3 +60,3 @@ | **handleWidth** | string or number | 'auto' | 'auto' or Number | Width of the left and right sides in pixels | | ||
| **wrapperClass** | string | 'wrapper' | | Container element class(es) | | ||
| **onChange** | function | undefined| | function(elm, state){} or function(state){} | | ||
| **onChange** | function | undefined| | function(elm, state){} | | ||
@@ -62,12 +66,3 @@ ### Methods | ||
| ------------ | ------- | ----------- | | ||
| **value** | boolean | Get or set the switch state | | ||
| **valueState** | boolean | Get or set the switch state | | ||
| **toggleValue** | | Toggle the switch state | | ||
| **toggleState** | | Toggle the switch state | | ||
| **disabled** | boolean | Get or set the disabled state | | ||
| **toggleDisabled** | | Toggle the disabled state | | ||
| **readonly** | boolean | Get or set the readonly state | | ||
| **toggleReadonly** | | Toggle the readonly state | | ||
| **handleWidth** | string or number | Set the width of the left and right sides in pixels | | ||
| **labelWidth** | string or number | Set the width of the center handle in pixels | | ||
| **value** | boolean or null | Get or set the switch state | | ||
@@ -80,9 +75,22 @@ | ||
## LESS | ||
## Examples and Contributing | ||
The following will get a local copy of the code and launch the example page. | ||
Any changes to the source files will be automatically loaded into your browser upon saving the files. | ||
``` | ||
git clone https://github.com/Julusian/react-bootstrap-switch.git | ||
cd react-bootstrap-switch | ||
npm install | ||
npm run dev | ||
``` | ||
## LESS / CSS | ||
Import `src/less/bootstrap2/bootstrap-switch.less` for bootstrap 2 or `src/less/bootstrap3/bootstrap-switch.less` for bootstrap 3 in your compilation stack. | ||
NOTE: The LESS files from the original switch are not fully compatible, updated versions are included in this repo. | ||
NOTE: The LESS and CSS files from the original switch are not fully compatible, updated versions are included in this repo. | ||
## License | ||
@@ -89,0 +97,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
95
92490
11
1123
1
+ Addedreact-dom@15.7.0(transitive)
- Removedjquery@>=1.9.0
- Removedjquery@3.7.1(transitive)