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

rc-tree

Package Overview
Dependencies
Maintainers
2
Versions
308
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-tree - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

16

lib/Tree.js

@@ -230,3 +230,3 @@ 'use strict';

var checked = !treeNode.props.checked;
if (treeNode.props.checkPart) {
if (treeNode.props.halfChecked) {
checked = true;

@@ -273,3 +273,3 @@ }

this.treeNodesStates[treeNode.props.pos].checked = false;
this.treeNodesStates[treeNode.props.pos].checkPart = false;
this.treeNodesStates[treeNode.props.pos].halfChecked = false;
(0, _util.handleCheckState)(this.treeNodesStates, [treeNode.props.pos], false);

@@ -533,5 +533,5 @@ }

if (props.checkedKeys.halfChecked) {
cloneProps.checkPart = props.checkedKeys.halfChecked.indexOf(key) !== -1 || false;
cloneProps.halfChecked = props.checkedKeys.halfChecked.indexOf(key) !== -1 || false;
} else {
cloneProps.checkPart = false;
cloneProps.halfChecked = false;
}

@@ -542,3 +542,3 @@ } else {

}
cloneProps.checkPart = this.checkPartKeys.indexOf(key) !== -1;
cloneProps.halfChecked = this.halfCheckedKeys.indexOf(key) !== -1;
}

@@ -577,3 +577,3 @@

this.treeNodesStates = props._treeNodesStates.treeNodesStates;
this.checkPartKeys = props._treeNodesStates.checkPartKeys;
this.halfCheckedKeys = props._treeNodesStates.halfCheckedKeys;
this.checkedKeys = props._treeNodesStates.checkedKeys;

@@ -598,3 +598,3 @@ } else {

checked: false,
checkPart: false,
halfChecked: false,
siblingPosition: siblingPosition

@@ -612,3 +612,3 @@ };

}
_this4.checkPartKeys = checkKeys.checkPartKeys;
_this4.halfCheckedKeys = checkKeys.halfCheckedKeys;
_this4.checkedKeys = checkKeys.checkedKeys;

@@ -615,0 +615,0 @@ })();

@@ -195,6 +195,6 @@ 'use strict';

var checkboxCls = _defineProperty({}, prefixCls + '-checkbox', true);
if (props.checkPart) {
if (props.checked) {
checkboxCls[prefixCls + '-checkbox-checked'] = true;
} else if (props.halfChecked) {
checkboxCls[prefixCls + '-checkbox-indeterminate'] = true;
} else if (props.checked) {
checkboxCls[prefixCls + '-checkbox-checked'] = true;
}

@@ -201,0 +201,0 @@ var customEle = null;

@@ -193,3 +193,3 @@ /* eslint no-loop-func: 0*/

if (iArr.length > _posArr.length && isInclude(_posArr, iArr)) {
obj[i].checkPart = false;
obj[i].halfChecked = false;
obj[i].checked = checkIt;

@@ -237,3 +237,3 @@ objKeys[index] = null;

}
} else if (obj[i].checkPart) {
} else if (obj[i].halfChecked) {
siblingChecked += 0.5;

@@ -250,8 +250,8 @@ }

parent.checked = false;
parent.checkPart = false;
parent.halfChecked = false;
} else if (siblingChecked === sibling) {
parent.checked = true;
parent.checkPart = false;
parent.halfChecked = false;
} else {
parent.checkPart = true;
parent.halfChecked = true;
parent.checked = false;

@@ -272,3 +272,3 @@ }

function getCheck(treeNodesStates) {
var checkPartKeys = [];
var halfCheckedKeys = [];
var checkedKeys = [];

@@ -283,8 +283,8 @@ var checkedNodes = [];

checkedNodesPositions.push({ node: itemObj.node, pos: item });
} else if (itemObj.checkPart) {
checkPartKeys.push(itemObj.key);
} else if (itemObj.halfChecked) {
halfCheckedKeys.push(itemObj.key);
}
});
return {
checkPartKeys: checkPartKeys, checkedKeys: checkedKeys, checkedNodes: checkedNodes, checkedNodesPositions: checkedNodesPositions, treeNodesStates: treeNodesStates
halfCheckedKeys: halfCheckedKeys, checkedKeys: checkedKeys, checkedNodes: checkedNodes, checkedNodesPositions: checkedNodesPositions, treeNodesStates: treeNodesStates
};

@@ -291,0 +291,0 @@ }

{
"name": "rc-tree",
"version": "1.2.1",
"version": "1.2.2",
"description": "tree ui component for react",

@@ -5,0 +5,0 @@ "keywords": [

@@ -73,3 +73,2 @@ # rc-tree

|checkedKeys | Controlled checked treeNodes(After setting, defaultCheckedKeys will not work). Note: parent and children nodes are associated, if the parent node's key exists, it all children node will be checked, and vice versa. When set checkable and checkStrictly, it should be an object, which contains checked array and halfChecked array. | String[]/{checked:Array<String>,halfChecked:Array<String>} | [] |
|halfCheckedKeys | when set checkStrictly, it works | String[] | [] |
|checkStrictly| check node precisely, parent and children nodes are not associated| bool | false |

@@ -76,0 +75,0 @@ |defaultSelectedKeys | default selected treeNodes | String[] | [] |

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