antd
Version:
An enterprise-class UI design language and React components implementation
34 lines (29 loc) • 1.43 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _extends from "@babel/runtime/helpers/esm/extends";
var initMotionCommon = function initMotionCommon(duration) {
return {
animationDuration: duration,
animationFillMode: 'both'
};
}; // FIXME: origin less code seems same as initMotionCommon. Maybe we can safe remove
var initMotionCommonLeave = function initMotionCommonLeave(duration) {
return {
animationDuration: duration,
animationFillMode: 'both'
};
};
export var initMotion = function initMotion(motionCls, inKeyframes, outKeyframes, duration) {
var _ref;
return _ref = {}, _defineProperty(_ref, "\n ".concat(motionCls, "-enter,\n ").concat(motionCls, "-appear\n "), _extends(_extends({}, initMotionCommon(duration)), {
animationPlayState: 'paused'
})), _defineProperty(_ref, "".concat(motionCls, "-leave"), _extends(_extends({}, initMotionCommonLeave(duration)), {
animationPlayState: 'paused'
})), _defineProperty(_ref, "\n ".concat(motionCls, "-enter").concat(motionCls, "-enter-active,\n ").concat(motionCls, "-appear").concat(motionCls, "-appear-active\n "), {
animationName: inKeyframes,
animationPlayState: 'running'
}), _defineProperty(_ref, "".concat(motionCls, "-leave").concat(motionCls, "-leave-active"), {
animationName: outKeyframes,
animationPlayState: 'running',
pointerEvents: 'none'
}), _ref;
};