"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = Mask;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _vue = require("vue");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _motionUtil = require("../utils/motionUtil");
var _transition = require("../../_util/transition");
function Mask(props) {
  const {
    prefixCls,
    zIndex,
    mask,
    maskAnimation,
    maskTransitionName,
    onClick,
    visible,
    maskStyle = {}
  } = props;
  if (!mask) {
    return null;
  }
  let transitionProps = {};
  if (maskTransitionName || maskAnimation) {
    const motion = (0, _motionUtil.getMotion)({
      prefixCls,
      transitionName: maskTransitionName,
      animation: maskAnimation
    });
    transitionProps = (0, _transition.getTransitionProps)(motion.name);
  }
  return (0, _vue.createVNode)(_vue.Transition, (0, _objectSpread2.default)({
    "appear": true
  }, transitionProps), {
    default: () => [(0, _vue.withDirectives)((0, _vue.createVNode)("div", {
      "style": (0, _extends2.default)({
        zIndex
      }, maskStyle),
      "class": `${prefixCls}-mask`,
      "onClick": onClick
    }, null), [[_vue.vShow, visible]])]
  });
}
Mask.displayName = 'Mask';