import "../../../src/scss/popup.scss";
import PopupMixin from "../../../es5/mixins/popup";
import mixins from "../../../es5/utils/mixins";
export default mixins(PopupMixin
/* @vue/component */
).extend({
  name: 'w-popup',
  props: {
    visible: Boolean,
    height: {
      type: [String, Number],
      default: 'auto',
      validator: function validator(val) {
        return /^(auto)|(\d+(px|vh|%)?)$/.test(val.toString());
      }
    },
    mask: {
      type: Boolean,
      default: true
    },
    lockOnScroll: {
      type: Boolean,
      default: true
    },
    closeOnClickMask: {
      type: Boolean,
      default: true
    },
    maskClass: {
      type: String,
      default: 'weui-mask'
    },
    backgroundColor: String
  },
  computed: {
    style: function style() {
      return {
        backgroundColor: this.backgroundColor,
        height: /^\d+$/.test(this.height.toString()) ? parseInt(this.height) + 'px' : this.height
      };
    }
  },
  mounted: function mounted() {
    if (this.visible) {
      this.open();
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("transition", {
      "attrs": {
        "enter-active-class": "weui-animate-slide-up",
        "leave-active-class": "weui-animate-slide-down"
      }
    }, [h("div", {
      "class": "wv-popup",
      "directives": [{
        name: "show",
        value: this.visible
      }],
      "style": this.style
    }, [this.$slots.default])]);
  }
});
//# sourceMappingURL=WPopup.js.map