perf(📦): remove @ant-design/css-animation (#28201)

* perf(📦): remove @ant-design/css-animation

* fix test case

* fix test case
This commit is contained in:
偏右 2020-12-04 19:36:16 +08:00 committed by GitHub
parent 5e42ba482a
commit 28d3d9038f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -1,5 +1,4 @@
import * as React from 'react';
import TransitionEvents from '@ant-design/css-animation/lib/Event';
import { supportRef, composeRef } from 'rc-util/lib/ref';
import raf from './raf';
import { ConfigConsumer, ConfigConsumerProps, CSPConfig, ConfigContext } from '../config-provider';
@ -106,8 +105,10 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
if (insertExtraNode) {
node.appendChild(extraNode);
}
TransitionEvents.addStartEventListener(node, this.onTransitionStart);
TransitionEvents.addEndEventListener(node, this.onTransitionEnd);
['transition', 'animation'].forEach(name => {
node.addEventListener(`${name}start`, this.onTransitionStart);
node.addEventListener(`${name}end`, this.onTransitionEnd);
});
};
onTransitionStart = (e: AnimationEvent) => {
@ -190,8 +191,10 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
node.removeChild(this.extraNode);
}
TransitionEvents.removeStartEventListener(node, this.onTransitionStart);
TransitionEvents.removeEndEventListener(node, this.onTransitionEnd);
['transition', 'animation'].forEach(name => {
node.removeEventListener(`${name}start`, this.onTransitionStart);
node.removeEventListener(`${name}end`, this.onTransitionEnd);
});
}
renderWave = ({ csp }: ConfigConsumerProps) => {

View File

@ -107,7 +107,6 @@
],
"dependencies": {
"@ant-design/colors": "^5.0.0",
"@ant-design/css-animation": "^1.7.2",
"@ant-design/icons": "^4.3.0",
"@ant-design/react-slick": "~0.27.0",
"@babel/runtime": "^7.11.2",