import create from "../utils/create";
import Popup from "../mixins/popup";
import Icon from "../icon";
export default create({
  render: function render() {
    var _obj;

    var _vm = this;

    var _h = _vm.$createElement;

    var _c = _vm._self._c || _h;

    return _vm.shouldRender ? _c('transition', {
      attrs: {
        "name": _vm.currentTransition
      },
      on: {
        "after-enter": _vm.onOpened,
        "after-leave": _vm.onClosed
      }
    }, [_c('div', {
      directives: [{
        name: "show",
        rawName: "v-show",
        value: _vm.value,
        expression: "value"
      }],
      class: _vm.b((_obj = {
        round: _vm.round
      }, _obj[_vm.position] = _vm.position, _obj)),
      on: {
        "click": _vm.onClick
      }
    }, [_vm._t("default"), _vm.closeable ? _c('Icon', {
      class: _vm.b('close-icon', _vm.closeIconPosition),
      attrs: {
        "role": "button",
        "tabindex": "0",
        "name": _vm.closeIcon
      },
      on: {
        "click": _vm.close
      }
    }) : _vm._e()], 2)]) : _vm._e();
  },
  components: {
    Icon: Icon
  },
  name: "popup",
  mixins: [Popup],
  props: {
    round: Boolean,
    duration: [Number, String],
    closeable: Boolean,
    closeIcon: {
      type: String,
      default: "close"
    },
    closeIconPosition: {
      type: String,
      default: "top-right"
    },
    position: String,
    transition: String,
    overlay: {
      type: Boolean,
      default: true
    },
    closeOnClickOverlay: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    currentTransition: function currentTransition() {
      return this.transition || (this.position ? "popup-slide-" + this.position : "vm-fade");
    }
  }
});