Files
icehrm/web/node_modules/rc-menu/es/utils/legacyUtil.js
2020-05-20 18:47:29 +02:00

29 lines
1.0 KiB
JavaScript

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
import warning from "rc-util/es/warning";
export function getMotion(_ref) {
var prefixCls = _ref.prefixCls,
motion = _ref.motion,
openAnimation = _ref.openAnimation,
openTransitionName = _ref.openTransitionName;
if (motion) {
return motion;
}
if (_typeof(openAnimation) === 'object' && openAnimation) {
warning(false, 'Object type of `openAnimation` is removed. Please use `motion` instead.');
} else if (typeof openAnimation === 'string') {
return {
motionName: "".concat(prefixCls, "-open-").concat(openAnimation)
};
}
if (openTransitionName) {
return {
motionName: openTransitionName
};
}
return null;
}