1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports["default"] = exports.getTransitionName = void 0;
|
7 |
|
8 |
|
9 | var getCollapsedHeight = function getCollapsedHeight() {
|
10 | return {
|
11 | height: 0,
|
12 | opacity: 0
|
13 | };
|
14 | };
|
15 |
|
16 | var getRealHeight = function getRealHeight(node) {
|
17 | return {
|
18 | height: node.scrollHeight,
|
19 | opacity: 1
|
20 | };
|
21 | };
|
22 |
|
23 | var getCurrentHeight = function getCurrentHeight(node) {
|
24 | return {
|
25 | height: node.offsetHeight
|
26 | };
|
27 | };
|
28 |
|
29 | var skipOpacityTransition = function skipOpacityTransition(_, event) {
|
30 | return (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
31 | };
|
32 |
|
33 | var collapseMotion = {
|
34 | motionName: 'ant-motion-collapse',
|
35 | onAppearStart: getCollapsedHeight,
|
36 | onEnterStart: getCollapsedHeight,
|
37 | onAppearActive: getRealHeight,
|
38 | onEnterActive: getRealHeight,
|
39 | onLeaveStart: getCurrentHeight,
|
40 | onLeaveActive: getCollapsedHeight,
|
41 | onAppearEnd: skipOpacityTransition,
|
42 | onEnterEnd: skipOpacityTransition,
|
43 | onLeaveEnd: skipOpacityTransition,
|
44 | motionDeadline: 500
|
45 | };
|
46 |
|
47 | var getTransitionName = function getTransitionName(rootPrefixCls, motion, transitionName) {
|
48 | if (transitionName !== undefined) {
|
49 | return transitionName;
|
50 | }
|
51 |
|
52 | return "".concat(rootPrefixCls, "-").concat(motion);
|
53 | };
|
54 |
|
55 | exports.getTransitionName = getTransitionName;
|
56 | var _default = collapseMotion;
|
57 | exports["default"] = _default; |
\ | No newline at end of file |