You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.5 KiB
58 lines
1.5 KiB
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.getTransitionName = exports["default"] = void 0;
|
|
|
|
// ================== Collapse Motion ==================
|
|
var getCollapsedHeight = function getCollapsedHeight() {
|
|
return {
|
|
height: 0,
|
|
opacity: 0
|
|
};
|
|
};
|
|
|
|
var getRealHeight = function getRealHeight(node) {
|
|
var scrollHeight = node.scrollHeight;
|
|
return {
|
|
height: scrollHeight,
|
|
opacity: 1
|
|
};
|
|
};
|
|
|
|
var getCurrentHeight = function getCurrentHeight(node) {
|
|
return {
|
|
height: node ? node.offsetHeight : 0
|
|
};
|
|
};
|
|
|
|
var skipOpacityTransition = function skipOpacityTransition(_, event) {
|
|
return (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
|
};
|
|
|
|
var collapseMotion = {
|
|
motionName: 'ant-motion-collapse',
|
|
onAppearStart: getCollapsedHeight,
|
|
onEnterStart: getCollapsedHeight,
|
|
onAppearActive: getRealHeight,
|
|
onEnterActive: getRealHeight,
|
|
onLeaveStart: getCurrentHeight,
|
|
onLeaveActive: getCollapsedHeight,
|
|
onAppearEnd: skipOpacityTransition,
|
|
onEnterEnd: skipOpacityTransition,
|
|
onLeaveEnd: skipOpacityTransition,
|
|
motionDeadline: 500
|
|
};
|
|
|
|
var getTransitionName = function getTransitionName(rootPrefixCls, motion, transitionName) {
|
|
if (transitionName !== undefined) {
|
|
return transitionName;
|
|
}
|
|
|
|
return "".concat(rootPrefixCls, "-").concat(motion);
|
|
};
|
|
|
|
exports.getTransitionName = getTransitionName;
|
|
var _default = collapseMotion;
|
|
exports["default"] = _default; |