rc-tree-select
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -117,2 +117,3 @@ 'use strict'; | ||
treeCheckStrictly: _react.PropTypes.bool, | ||
treeHalfCheckedValues: _react.PropTypes.array, | ||
treeIcon: _react.PropTypes.bool, | ||
@@ -336,3 +337,3 @@ treeLine: _react.PropTypes.bool, | ||
} | ||
props.onSelect(event, item); | ||
props.onSelect(event, item, info); | ||
var checkEvt = info.event === 'check'; | ||
@@ -339,0 +340,0 @@ if ((0, _util.isMultipleOrTags)(props)) { |
@@ -125,3 +125,3 @@ 'use strict'; | ||
renderTree: function renderTree(keys, newTreeNodes, multiple) { | ||
renderTree: function renderTree(keys, halfCheckedKeys, newTreeNodes, multiple) { | ||
var props = this.props; | ||
@@ -140,2 +140,5 @@ | ||
}; | ||
if (props.treeCheckStrictly && halfCheckedKeys.length) { | ||
trProps.halfCheckedKeys = halfCheckedKeys; | ||
} | ||
@@ -241,2 +244,3 @@ // 为避免混乱,checkable 模式下,select 失效 | ||
var keys = []; | ||
var halfCheckedKeys = []; | ||
(0, _util.loopAllChildren)(treeNodes, function (child) { | ||
@@ -248,2 +252,7 @@ if (props.value.some(function (item) { | ||
} | ||
if (props.treeHalfCheckedValues && props.treeHalfCheckedValues.some(function (item) { | ||
return item === (0, _util.getValuePropValue)(child); | ||
})) { | ||
halfCheckedKeys.push(child.key); | ||
} | ||
}); | ||
@@ -268,3 +277,3 @@ | ||
search, | ||
notFoundContent ? notFoundContent : this.renderTree(keys, treeNodes, multiple) | ||
notFoundContent ? notFoundContent : this.renderTree(keys, halfCheckedKeys, treeNodes, multiple) | ||
); | ||
@@ -271,0 +280,0 @@ |
{ | ||
"name": "rc-tree-select", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "tree-select ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -75,4 +75,4 @@ # rc-tree-select | ||
|labelInValue| whether to embed label in value, see above value type | Bool | false | | ||
|onChange | called when select treeNode or input value change(combobox) | function(value, label) | - | | ||
|onSelect | called when select treeNode | function(value, node) | - | | ||
|onChange | called when select treeNode or input value change(combobox) | function(value, label(null), extra) | - | | ||
|onSelect | called when select treeNode | function(value, node, extra) | - | | ||
|onSearch | called when input changed | function | - | | ||
@@ -85,2 +85,3 @@ |showCheckedStrategy | `TreeSelect.SHOW_ALL`: show all checked treeNodes (Include parent treeNode). `TreeSelect.SHOW_PARENT`: show checked treeNodes (Just show parent treeNode). Default just show child. | enum{TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD } | TreeSelect.SHOW_CHILD | | ||
|treeCheckStrictly | check node precisely, parent and children nodes are not associated| bool | false | | ||
|treeHalfCheckedValues | half checked treeNode values, when set checkStrictly, it works. | array | - | | ||
|filterTreeNode | filter some treeNodes as you need. it should return true | function(treeNode) | - | | ||
@@ -87,0 +88,0 @@ |treeNodeFilterProp | which prop value of treeNode will be used for filter if filterTreeNode return true | String | 'value' | |
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
101396
2948
114