Comparing version 5.8.8 to 5.9.0
@@ -246,11 +246,9 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
ref: listRef, | ||
onVisibleChange: function onVisibleChange(originList, fullList) { | ||
var originSet = new Set(originList); | ||
var restList = fullList.filter(function (item) { | ||
return !originSet.has(item); | ||
}); | ||
// Motion node is not render. Skip motion | ||
if (restList.some(function (item) { | ||
return itemKey(item) === MOTION_KEY; | ||
onVisibleChange: function onVisibleChange(originList) { | ||
// The best match is using `fullList` - `originList` = `restList` | ||
// and check the `restList` to see if has the MOTION_KEY node | ||
// but this will cause performance issue for long list compare | ||
// we just check `originList` and repeat trigger `onMotionEnd` | ||
if (originList.every(function (item) { | ||
return itemKey(item) !== MOTION_KEY; | ||
})) { | ||
@@ -257,0 +255,0 @@ onMotionEnd(); |
@@ -1107,5 +1107,12 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
delete cloneKeyEntities[MOTION_KEY]; | ||
newState.expandedKeys = Object.keys(cloneKeyEntities).map(function (key) { | ||
return cloneKeyEntities[key].key; | ||
// Only take the key who has the children to enhance the performance | ||
var nextExpandedKeys = []; | ||
Object.keys(cloneKeyEntities).forEach(function (key) { | ||
var entity = cloneKeyEntities[key]; | ||
if (entity.children && entity.children.length) { | ||
nextExpandedKeys.push(entity.key); | ||
} | ||
}); | ||
newState.expandedKeys = nextExpandedKeys; | ||
} else if (!prevProps && props.defaultExpandedKeys) { | ||
@@ -1112,0 +1119,0 @@ newState.expandedKeys = props.autoExpandParent || props.defaultExpandParent ? conductExpandParent(props.defaultExpandedKeys, keyEntities) : props.defaultExpandedKeys; |
@@ -256,11 +256,9 @@ "use strict"; | ||
ref: listRef, | ||
onVisibleChange: function onVisibleChange(originList, fullList) { | ||
var originSet = new Set(originList); | ||
var restList = fullList.filter(function (item) { | ||
return !originSet.has(item); | ||
}); | ||
// Motion node is not render. Skip motion | ||
if (restList.some(function (item) { | ||
return itemKey(item) === MOTION_KEY; | ||
onVisibleChange: function onVisibleChange(originList) { | ||
// The best match is using `fullList` - `originList` = `restList` | ||
// and check the `restList` to see if has the MOTION_KEY node | ||
// but this will cause performance issue for long list compare | ||
// we just check `originList` and repeat trigger `onMotionEnd` | ||
if (originList.every(function (item) { | ||
return itemKey(item) !== MOTION_KEY; | ||
})) { | ||
@@ -267,0 +265,0 @@ onMotionEnd(); |
@@ -1117,5 +1117,12 @@ "use strict"; | ||
delete cloneKeyEntities[_NodeList.MOTION_KEY]; | ||
newState.expandedKeys = Object.keys(cloneKeyEntities).map(function (key) { | ||
return cloneKeyEntities[key].key; | ||
// Only take the key who has the children to enhance the performance | ||
var nextExpandedKeys = []; | ||
Object.keys(cloneKeyEntities).forEach(function (key) { | ||
var entity = cloneKeyEntities[key]; | ||
if (entity.children && entity.children.length) { | ||
nextExpandedKeys.push(entity.key); | ||
} | ||
}); | ||
newState.expandedKeys = nextExpandedKeys; | ||
} else if (!prevProps && props.defaultExpandedKeys) { | ||
@@ -1122,0 +1129,0 @@ newState.expandedKeys = props.autoExpandParent || props.defaultExpandParent ? (0, _util.conductExpandParent)(props.defaultExpandedKeys, keyEntities) : props.defaultExpandedKeys; |
{ | ||
"name": "rc-tree", | ||
"version": "5.8.8", | ||
"version": "5.9.0", | ||
"description": "tree ui component for react", | ||
@@ -51,3 +51,3 @@ "engines": { | ||
"@testing-library/jest-dom": "^6.1.5", | ||
"@testing-library/react": "^14.1.2", | ||
"@testing-library/react": "^15.0.7", | ||
"@types/jest": "^29.5.10", | ||
@@ -61,3 +61,3 @@ "@types/react": "^18.0.0", | ||
"eslint-plugin-jest": "^27.6.0", | ||
"eslint-plugin-unicorn": "^51.0.1", | ||
"eslint-plugin-unicorn": "^53.0.0", | ||
"father": "^4.4.0", | ||
@@ -67,3 +67,3 @@ "gh-pages": "^6.1.1", | ||
"less": "^3.11.1", | ||
"np": "^9.0.0", | ||
"np": "^10.0.5", | ||
"rc-dialog": "^8.1.0", | ||
@@ -70,0 +70,0 @@ "rc-test": "^7.0.15", |
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
372399
7719