Files
video-gen/video-gen-admin/node_modules/antd/es/tabs/hooks/useAnimateConfig.js
T
2026-05-25 17:08:18 +08:00

36 lines
813 B
JavaScript

import { isPlainObject } from '../../_util/is';
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 = {
inkBar: true,
...(isPlainObject(animated) ? animated : {})
};
}
if (mergedAnimated.tabPane) {
mergedAnimated.tabPaneMotion = {
...motion,
motionName: getTransitionName(prefixCls, 'switch')
};
}
return mergedAnimated;
}