zarm
Version:
基于 React 的移动端UI库
44 lines (35 loc) • 1.3 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTransformOrigin = exports.getTransitionName = void 0;
var _includes = _interopRequireDefault(require("lodash/includes"));
var getTransitionName = function getTransitionName(prefixCls, placement, animationType) {
if (animationType === 'menu-slide' && placement) {
if ((0, _includes.default)(placement, 'top')) {
return "".concat(prefixCls, "-").concat(animationType, "-down");
}
return "".concat(prefixCls, "-").concat(animationType, "-up");
}
return "".concat(prefixCls, "-").concat(animationType);
};
exports.getTransitionName = getTransitionName;
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];
};
exports.getTransformOrigin = getTransformOrigin;
;