Comparing version 0.15.4 to 0.16.0
@@ -53,6 +53,12 @@ 'use strict'; | ||
}); | ||
this.defaultExpandAll = props.defaultExpandAll; | ||
var expandedKeys = props.defaultExpandedKeys; | ||
var checkedKeys = props.defaultCheckedKeys; | ||
this.defaultExpandAll = props.defaultExpandAll; | ||
if ('checkedKeys' in props) { | ||
checkedKeys = props.checkedKeys || []; | ||
} | ||
var selectedKeys = props.multiple ? [].concat(_toConsumableArray(props.defaultSelectedKeys)) : [props.defaultSelectedKeys[0]]; | ||
if ('selectedKeys' in props) { | ||
selectedKeys = props.multiple ? [].concat(_toConsumableArray(props.selectedKeys)) : [props.selectedKeys[0]]; | ||
} | ||
this.state = { | ||
@@ -66,2 +72,14 @@ expandedKeys: expandedKeys, | ||
_createClass(Tree, [{ | ||
key: 'componentWillReceiveProps', | ||
value: function componentWillReceiveProps(nextProps) { | ||
var props = {}; | ||
if ('checkedKeys' in nextProps) { | ||
props.checkedKeys = nextProps.checkedKeys; | ||
} | ||
if ('selectedKeys' in nextProps) { | ||
props.selectedKeys = nextProps.selectedKeys; | ||
} | ||
this.setState(props); | ||
} | ||
}, { | ||
key: 'getCheckKeys', | ||
@@ -68,0 +86,0 @@ value: function getCheckKeys() { |
{ | ||
"name": "rc-tree", | ||
"version": "0.15.4", | ||
"version": "0.16.0", | ||
"description": "tree ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -77,3 +77,5 @@ # rc-tree | ||
|defaultExpandedKeys | expand specific treeNodes | String[] | false | | ||
|checkedKeys | checked treeNodes | String[] | [] | | ||
|defaultCheckedKeys | default checked treeNodes | String[] | [] | | ||
|selectedKeys | selected treeNodes | String[] | [] | | ||
|defaultSelectedKeys | default selected treeNodes | String[] | [] | | ||
@@ -80,0 +82,0 @@ |onCheck | click the treeNode/checkbox to fire | function(e:{checked:bool,node,checkedKeys,event}) | - | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33356
731
112