Comparing version 0.19.0 to 0.19.1
@@ -120,3 +120,6 @@ 'use strict'; | ||
var newChildren = item.props.children; | ||
if (Array.isArray(newChildren)) { | ||
if (newChildren) { | ||
if (!Array.isArray(newChildren)) { | ||
newChildren = [newChildren]; | ||
} | ||
loop(newChildren, pos); | ||
@@ -136,5 +139,17 @@ } | ||
} | ||
var splitPos = function splitPos(pos) { | ||
return pos.split('-'); | ||
}; | ||
// stripTail('x-xx-sss-xx') | ||
var stripTail = function stripTail(str) { | ||
var arr = str.match(/(.+)(-[^-]+)$/); | ||
var st = ''; | ||
if (arr && arr.length === 3) { | ||
st = arr[1]; | ||
} | ||
return st; | ||
}; | ||
checkedArr.forEach(function (_pos) { | ||
Object.keys(obj).forEach(function (i) { | ||
if (i.length > _pos.length && i.indexOf(_pos) === 0) { | ||
if (splitPos(i).length > splitPos(_pos).length && i.indexOf(_pos) === 0) { | ||
obj[i].checkPart = false; | ||
@@ -153,4 +168,4 @@ if (evt) { | ||
var loop = function loop(__pos) { | ||
var _posLen = __pos.length; | ||
if (_posLen <= 3) { | ||
var _posLen = splitPos(__pos).length; | ||
if (_posLen <= 2) { | ||
return; | ||
@@ -160,5 +175,5 @@ } | ||
var siblingChecked = 0; | ||
var parentPos = __pos.substring(0, _posLen - 2); | ||
var parentPos = stripTail(__pos); | ||
Object.keys(obj).forEach(function (i) { | ||
if (i.length === _posLen && i.substring(0, _posLen - 2) === parentPos) { | ||
if (splitPos(i).length === _posLen && i.indexOf(parentPos) === 0) { | ||
sibling++; | ||
@@ -165,0 +180,0 @@ if (obj[i].checked) { |
{ | ||
"name": "rc-tree", | ||
"version": "0.19.0", | ||
"version": "0.19.1", | ||
"description": "tree ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
37446
846