Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rsuite-check-tree

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rsuite-check-tree - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

36

lib/CheckTree.js

@@ -99,19 +99,9 @@ 'use strict';

_this.getSelectedValues = function (activeNode) {
_this.getSelectedValues = function (nextData) {
var _this$props2 = _this.props,
relation = _this$props2.relation,
valueKey = _this$props2.valueKey,
childrenKey = _this$props2.childrenKey;
var checkState = activeNode.checkState;
var selectedValues = _this.state.selectedValues;
var selectedValues = [];
if (activeNode.checkState === 'checked') {
selectedValues.push(activeNode[valueKey]);
} else if (checkState === 'unchecked') {
_lodash2.default.remove(selectedValues, function (value) {
return value === activeNode[valueKey];
});
}
var loop = function loop(nodes) {

@@ -121,6 +111,2 @@ nodes.forEach(function (node) {

selectedValues.push(node[valueKey]);
} else if (checkState === 'unchecked') {
_lodash2.default.remove(selectedValues, function (value) {
return value === node[valueKey];
});
}

@@ -132,7 +118,4 @@ if (node[childrenKey]) {

};
loop(nextData);
if (relation && activeNode[childrenKey]) {
loop(activeNode[childrenKey]);
}
return selectedValues;

@@ -202,3 +185,2 @@ };

_this.handleSelect = function (activeNodeData, layer) {
var selectedValues = _this.state.selectedValues;
var _this$props5 = _this.props,

@@ -216,10 +198,10 @@ valueKey = _this$props5.valueKey,

relation && _this.checkChildren(activeNode[childrenKey], activeNode.checkState);
_this.getSelectedValues(activeNode);
var selectedValues = _this.getSelectedValues(nextData);
_this.setState({
data: nextData
data: nextData,
selectedValues: selectedValues
}, function () {
onChange && onChange(selectedValues);
onSelect && onSelect(activeNode, nextData, layer);
});
onChange && onChange(selectedValues);
onSelect && onSelect(activeNode, nextData, layer);
}

@@ -226,0 +208,0 @@ };

{
"name": "rsuite-check-tree",
"version": "0.1.4",
"version": "0.1.5",
"description": "A react check tree component",

@@ -13,3 +13,5 @@ "scripts": {

"test": "npm run lint",
"publish-docs": "node docs/gh-pages.js"
"publish-docs": "node docs/gh-pages.js",
"predeploy": "npm run build",
"deploy": "npm publish"
},

@@ -94,2 +96,2 @@ "main": "lib/index.js",

}
}
}
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