rc-tree-select
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -53,2 +53,3 @@ 'use strict'; | ||
propTypes: { | ||
children: _react.PropTypes.any, | ||
multiple: _react.PropTypes.bool, | ||
@@ -209,3 +210,3 @@ filterTreeNode: _react.PropTypes.any, | ||
var label = state.label.concat(); | ||
var popValue = value.pop(); | ||
value.pop(); | ||
label.pop(); | ||
@@ -267,4 +268,4 @@ this.fireChange(value, label); | ||
value = !check ? value.concat([selectedValue]) : [].concat(_toConsumableArray(info.checkedKeys)); | ||
label = !check ? label.concat([selectedLabel]) : info.allCheckedNodesKeys.map(function (item) { | ||
return _this.getLabelFromOption(item.node); | ||
label = !check ? label.concat([selectedLabel]) : info.allCheckedNodesKeys.map(function (i) { | ||
return _this.getLabelFromOption(i.node); | ||
}); | ||
@@ -335,4 +336,4 @@ } else { | ||
// }); | ||
var loop = function loop(children, level) { | ||
_react2['default'].Children.forEach(children, function (item) { | ||
var loop = function loop(childs) { | ||
_react2['default'].Children.forEach(childs, function (item) { | ||
if (item.props.children) { | ||
@@ -339,0 +340,0 @@ loop(item.props.children); |
@@ -102,3 +102,4 @@ 'use strict'; | ||
filterTree: function filterTree(treeNode) { | ||
return this.props.inputValue && treeNode.props[this.props.treeNodeFilterProp].indexOf(this.props.inputValue) > -1; | ||
var props = this.props; | ||
return props.inputValue && treeNode.props[props.treeNodeFilterProp].indexOf(props.inputValue) > -1; | ||
}, | ||
@@ -184,12 +185,13 @@ | ||
}); | ||
for (var i = 1; i < levelArr.length; i++) { | ||
level[levelArr[i]].forEach(function (cur) { | ||
loop(childrenArr, cur, function (arr, index) { | ||
arr[index].children = arr[index].children || []; | ||
arr[index].children.push({ | ||
pos: cur, | ||
node: filterChildren[cur] | ||
}); | ||
var loopFn = function loopFn(cur) { | ||
loop(childrenArr, cur, function (arr, index) { | ||
arr[index].children = arr[index].children || []; | ||
arr[index].children.push({ | ||
pos: cur, | ||
node: filterChildren[cur] | ||
}); | ||
}); | ||
}; | ||
for (var i = 1; i < levelArr.length; i++) { | ||
level[levelArr[i]].forEach(loopFn); | ||
} | ||
@@ -233,3 +235,3 @@ } | ||
var keys = []; | ||
(0, _util.loopAllChildren)(props.treeNodes, function (child, index, pos) { | ||
(0, _util.loopAllChildren)(props.treeNodes, function (child) { | ||
if (vals.indexOf(child.props.value) > -1) { | ||
@@ -236,0 +238,0 @@ keys.push(child.key); |
@@ -32,2 +32,6 @@ 'use strict'; | ||
exports['default'] = TreeNode; | ||
TreeNode.propTypes = { | ||
value: _react2['default'].PropTypes.string | ||
}; | ||
module.exports = exports['default']; |
{ | ||
"name": "rc-tree-select", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "tree-select ui component for react", | ||
@@ -43,2 +43,3 @@ "keywords": [ | ||
"pre-commit": "1.x", | ||
"rc-form": "^0.7.3", | ||
"rc-select": "^5.4.0", | ||
@@ -45,0 +46,0 @@ "rc-server": "3.x", |
@@ -116,3 +116,3 @@ # rc-tree-select | ||
|key | the unique key of treeNode, you must setting | String | - | | ||
|value | default as treeNodeFilterProp | String | 'value' | | ||
|value | default as treeNodeFilterProp | String | '' | | ||
|title | tree/subTree's title | String | '---' | | ||
@@ -119,0 +119,0 @@ |isLeaf | whether it's leaf node | bool | false | |
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
84516
2469
9