1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3 | import * as React from 'react';
|
4 | import classNames from 'classnames';
|
5 | import CSSMotion from 'rc-motion';
|
6 | import { getMotion } from "../utils/legacyUtil";
|
7 | export default function Mask(props) {
|
8 | var prefixCls = props.prefixCls,
|
9 | visible = props.visible,
|
10 | zIndex = props.zIndex,
|
11 | mask = props.mask,
|
12 | maskMotion = props.maskMotion,
|
13 | maskAnimation = props.maskAnimation,
|
14 | maskTransitionName = props.maskTransitionName;
|
15 |
|
16 | if (!mask) {
|
17 | return null;
|
18 | }
|
19 |
|
20 | var motion = {};
|
21 |
|
22 | if (maskMotion || maskTransitionName || maskAnimation) {
|
23 | motion = _objectSpread({
|
24 | motionAppear: true
|
25 | }, getMotion({
|
26 | motion: maskMotion,
|
27 | prefixCls: prefixCls,
|
28 | transitionName: maskTransitionName,
|
29 | animation: maskAnimation
|
30 | }));
|
31 | }
|
32 |
|
33 | return React.createElement(CSSMotion, _extends({}, motion, {
|
34 | visible: visible,
|
35 | removeOnLeave: true
|
36 | }), function (_ref) {
|
37 | var className = _ref.className;
|
38 | return React.createElement("div", {
|
39 | style: {
|
40 | zIndex: zIndex
|
41 | },
|
42 | className: classNames("".concat(prefixCls, "-mask"), className)
|
43 | });
|
44 | });
|
45 | } |
\ | No newline at end of file |