🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

react-checkbox-group

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-checkbox-group - npm Package Compare versions

Comparing version

to
0.1.6

{
"name": "react-checkbox-group",
"version": "0.1.5",
"version": "0.1.6",
"description": "Sensible checkbox groups manipulation for DOM.",
"main": "react-checkbox-group.jsx",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublish": "node_modules/.bin/babel --stage 1 ./react-checkbox-group.jsx --out-file ./react-checkbox-group.js"
},

@@ -28,5 +29,8 @@ "repository": {

"homepage": "https://github.com/ziad-saab/react-checkbox-group",
"dependencies": {
"react": "~0.11.1"
"peerDependencies": {
"react": ">= 0.11.1 < 1"
},
"devDependencies": {
"babel": "^5.6.7"
}
}

@@ -6,3 +6,4 @@ /**

var CheckboxGroup = module.exports = React.createClass({
module.exports = React.createClass({
displayName: 'CheckboxGroup',
getInitialState: function() {

@@ -23,4 +24,4 @@ return {defaultValue: this.props.defaultValue || []};

render: function() {
return this.transferPropsTo(
<div onChange={this.props.onChange}>
return (
<div {...this.props}>
{this.props.children}

@@ -34,4 +35,4 @@ </div>

// the tag and it'll be done here
var $checkboxes = this.getCheckboxes();
for (var i = 0, length = $checkboxes.length; i < length; i++) {
let $checkboxes = this.getCheckboxes();
for (let i = 0, length = $checkboxes.length; i < length; i++) {
$checkboxes[i].setAttribute('name', this.props.name);

@@ -46,3 +47,3 @@ }

setCheckedBoxes: function() {
var $checkboxes = this.getCheckboxes();
let $checkboxes = this.getCheckboxes();
// if `value` is passed from parent, always use that value. This is similar

@@ -53,8 +54,8 @@ // to React's controlled component. If `defaultValue` is used instead,

// a controlled component
var destinationValue = this.props.value != null
let destinationValue = this.props.value != null
? this.props.value
: this.state.defaultValue;
for (var i = 0, length = $checkboxes.length; i < length; i++) {
var $checkbox = $checkboxes[i];
for (let i = 0, length = $checkboxes.length; i < length; i++) {
let $checkbox = $checkboxes[i];

@@ -71,6 +72,6 @@ // intentionally use implicit conversion for those who accidentally used,

getCheckedValues: function() {
var $checkboxes = this.getCheckboxes();
let $checkboxes = this.getCheckboxes();
var checked = [];
for (var i = 0, length = $checkboxes.length; i < length; i++) {
let checked = [];
for (let i = 0, length = $checkboxes.length; i < length; i++) {
if ($checkboxes[i].checked) {

@@ -77,0 +78,0 @@ checked.push($checkboxes[i].value);

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet