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.
47 lines
1.1 KiB
47 lines
1.1 KiB
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports["default"] = void 0;
|
|
|
|
// ================== Collapse Motion ==================
|
|
var getCollapsedHeight = function getCollapsedHeight() {
|
|
return {
|
|
height: 0,
|
|
opacity: 0
|
|
};
|
|
};
|
|
|
|
var getRealHeight = function getRealHeight(node) {
|
|
return {
|
|
height: node.scrollHeight,
|
|
opacity: 1
|
|
};
|
|
};
|
|
|
|
var getCurrentHeight = function getCurrentHeight(node) {
|
|
return {
|
|
height: node.offsetHeight
|
|
};
|
|
};
|
|
|
|
var skipOpacityTransition = function skipOpacityTransition(_, event) {
|
|
return 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 _default = collapseMotion;
|
|
exports["default"] = _default; |