zarm
Version:
基于 React 的移动端UI库
29 lines (27 loc) • 937 B
JavaScript
import includes from 'lodash/includes';
export var getTransitionName = function getTransitionName(prefixCls, placement, animationType) {
if (animationType === 'menu-slide' && placement) {
if (includes(placement, 'top')) {
return "".concat(prefixCls, "-").concat(animationType, "-down");
}
return "".concat(prefixCls, "-").concat(animationType, "-up");
}
return "".concat(prefixCls, "-").concat(animationType);
};
export var getTransformOrigin = function getTransformOrigin(placement) {
var transformOrigin = {
'top-start': 'left bottom',
top: 'center bottom',
'top-end': 'right bottom',
'left-start': 'right top',
left: 'right center',
'left-end': 'right bottom',
'bottom-start': 'left top',
bottom: 'center top',
'bottom-end': 'right top',
'right-start': 'left top',
right: 'left center',
'right-end': 'left bottom'
};
return transformOrigin[placement];
};