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.0-beta to 1.2.0-beta.1

50

lib/Tree.js

@@ -227,36 +227,38 @@ 'use strict';

var checkedKeys = [].concat(_toConsumableArray(this.state.checkedKeys));
if (checked && checkedKeys.indexOf(key) === -1) {
var index = checkedKeys.indexOf(key);
if (checked && index === -1) {
checkedKeys.push(key);
}
// checkStrictly
var _checkedKeys = [].concat(_toConsumableArray(checkedKeys));
if (this.props.checkStrictly) {
var index = _checkedKeys.indexOf(key);
if (!checked && index > -1) {
_checkedKeys.splice(index, 1);
}
}
var checkKeys = (0, _util.getTreeNodesStates)(this.props.children, checkedKeys, checked, key);
var newSt = {
event: 'check',
node: treeNode,
checked: checked,
checkedNodes: checkKeys.checkedNodes,
checkedNodesPositions: checkKeys.checkedNodesPositions
checked: checked
};
checkedKeys = checkKeys.checkedKeys;
if (!('checkedKeys' in this.props)) {
this.setState({
checkedKeys: checkedKeys
// checkStrictly
if (this.props.checkStrictly && 'checkedKeys' in this.props) {
if (!checked && index > -1) {
checkedKeys.splice(index, 1);
}
newSt.checkedNodes = [];
(0, _util.loopAllChildren)(this.props.children, function (item, ind, pos, keyOrPos) {
if (checkedKeys.indexOf(keyOrPos) !== -1) {
checked = true;
newSt.checkedNodes.push(item);
}
});
}
} else {
var checkKeys = (0, _util.getTreeNodesStates)(this.props.children, checkedKeys, checked, key);
newSt.checkedNodes = checkKeys.checkedNodes;
newSt.checkedNodesPositions = checkKeys.checkedNodesPositions;
if (this.props.checkStrictly) {
delete newSt.checkedNodes;
delete newSt.checkedNodesPositions;
checkedKeys = checkKeys.checkedKeys;
if (!('checkedKeys' in this.props)) {
this.setState({
checkedKeys: checkedKeys
});
}
}
this.props.onCheck(this.props.checkStrictly ? _checkedKeys : checkedKeys, newSt);
this.props.onCheck(checkedKeys, newSt);
}

@@ -263,0 +265,0 @@ }, {

{
"name": "rc-tree",
"version": "1.2.0-beta",
"version": "1.2.0-beta.1",
"description": "tree ui component for react",

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

@@ -72,3 +72,3 @@ # 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. | String[] | [] |
|checkStrictly| check the key of node precisely, parent and children nodes are not associated| bool | false |
|checkStrictly| check node precisely, parent and children nodes are not associated| bool | false |
|defaultCheckedKeys | default checked treeNodes | String[] | [] |

@@ -75,0 +75,0 @@ |selectedKeys | Controlled selected treeNodes(After setting, defaultSelectedKeys will not work) | 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