<commit_before>import Vue from 'vue'

import QDialog from '../dialog/QDialog.js'
import QMenu from '../menu/QMenu.js'

import AnchorMixin from '../../mixins/anchor.js'
import { prevent } from '../../utils/event.js'
import slot from '../../utils/slot.js'

export default Vue.extend({
  name: 'QPopupProxy',

  mixins: [ AnchorMixin ],

  props: {
    value: Boolean,

    breakpoint: {
      type: [String, Number],
      default: 450
    }
  },

  data () {
    return {
      showing: false,
      type: null
    }
  },

  watch: {
    value (val) {
      if (val !== this.showing) {
        this[val ? 'show' : 'hide']()
      }
    }
  },

  methods: {
    toggle (evt) {
      if (evt === void 0 || evt.defaultPrevented !== true) {
        this[this.showing === true ? 'hide' : 'show'](evt)
      }
    },

    show (evt) {
      if (
        this.showing === true ||
        (this.__showCondition !== void 0 && this.__showCondition(evt) !== true)
      ) {
        return
      }

      evt !== void 0 && prevent(evt)

      const breakpoint = parseInt(this.breakpoint, 10)

      this.showing = true
      this.$emit('input', true)

      this.type = this.$q.screen.width < breakpoint || this.$q.screen.height < breakpoint
        ? 'dialog'
        : 'menu'
    },

    hide () {
      if (this.showing !== true) {
        this.showing = false
        this.$emit('input', false)
      }
    },

    __hide (evt) {
      this.showing = false
      this.$emit('input', false)

      this.$listeners.hide !== void 0 && this.$emit('hide', evt)
    }
  },

  render (h) {
    if (this.type === null) {
      return
    }

    const child = slot(this, 'default')

    let props = (
      this.type === 'menu' &&
      child !== void 0 &&
      child[0] !== void 0 &&<commit_msg>fix(QPopupProxy): Fix hide() method condition<commit_after>import Vue from 'vue'

import QDialog from '../dialog/QDialog.js'
import QMenu from '../menu/QMenu.js'

import AnchorMixin from '../../mixins/anchor.js'
import { prevent } from '../../utils/event.js'
import slot from '../../utils/slot.js'

export default Vue.extend({
  name: 'QPopupProxy',

  mixins: [ AnchorMixin ],

  props: {
    value: Boolean,

    breakpoint: {
      type: [String, Number],
      default: 450
    }
  },

  data () {
    return {
      showing: false,
      type: null
    }
  },

  watch: {
    value (val) {
      if (val !== this.showing) {
        this[val ? 'show' : 'hide']()
      }
    }
  },

  methods: {
    toggle (evt) {
      if (evt === void 0 || evt.defaultPrevented !== true) {
        this[this.showing === true ? 'hide' : 'show'](evt)
      }
    },

    show (evt) {
      if (
        this.showing === true ||
        (this.__showCondition !== void 0 && this.__showCondition(evt) !== true)
      ) {
        return
      }

      evt !== void 0 && prevent(evt)

      const breakpoint = parseInt(this.breakpoint, 10)

      this.showing = true
      this.$emit('input', true)

      this.type = this.$q.screen.width < breakpoint || this.$q.screen.height < breakpoint
        ? 'dialog'
        : 'menu'
    },

    hide () {
      if (this.showing !== false) {
        this.showing = false
        this.$emit('input', false)
      }
    },

    __hide (evt) {
      this.showing = false
      this.$emit('input', false)

      this.$listeners.hide !== void 0 && this.$emit('hide', evt)
    }
  },

  render (h) {
    if (this.type === null) {
      return
    }

    const child = slot(this, 'default')

    let props = (
      this.type === 'menu' &&
      child !== void 0 &&
      child[0] !== void 0 &&
{'fraction_non_alphanumeric': 0.17293233082706766, 'fraction_numerical': 0.006683375104427736, 'mean_word_length': 1.8991121872477805, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '818700', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1201, 'n_words': 278}