first commit
This commit is contained in:
33
frontend/node_modules/antd/es/tabs/hooks/useAnimateConfig.js
generated
vendored
Normal file
33
frontend/node_modules/antd/es/tabs/hooks/useAnimateConfig.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import { getTransitionName } from '../../_util/motion';
|
||||
const motion = {
|
||||
motionAppear: false,
|
||||
motionEnter: true,
|
||||
motionLeave: true
|
||||
};
|
||||
export default function useAnimateConfig(prefixCls, animated = {
|
||||
inkBar: true,
|
||||
tabPane: false
|
||||
}) {
|
||||
let mergedAnimated;
|
||||
if (animated === false) {
|
||||
mergedAnimated = {
|
||||
inkBar: false,
|
||||
tabPane: false
|
||||
};
|
||||
} else if (animated === true) {
|
||||
mergedAnimated = {
|
||||
inkBar: true,
|
||||
tabPane: true
|
||||
};
|
||||
} else {
|
||||
mergedAnimated = Object.assign({
|
||||
inkBar: true
|
||||
}, typeof animated === 'object' ? animated : {});
|
||||
}
|
||||
if (mergedAnimated.tabPane) {
|
||||
mergedAnimated.tabPaneMotion = Object.assign(Object.assign({}, motion), {
|
||||
motionName: getTransitionName(prefixCls, 'switch')
|
||||
});
|
||||
}
|
||||
return mergedAnimated;
|
||||
}
|
||||
Reference in New Issue
Block a user