<commit_before>export default {
  name: 'QSlideTransition',
  props: {
    appear: Boolean,
    duration: {
      type: Number,
      default: 300
    }
  },
  methods: {
    __begin (el, height) {
      el.style.overflowY = 'hidden'
      if (height !== void 0) {
        el.style.height = `${height}px`
      }
      el.style.transition = `height ${this.duration}ms cubic-bezier(.25, .8, .50, 1)`
    },
    __end (el, event) {
      el.style.overflowY = null
      el.style.height = null
      el.style.transition = null
      this.__cleanup()
      event !== this.lastEvent && this.$emit(event)
    },
    __cleanup () {
      clearTimeout(this.timer)
      this.el.removeEventListener('transitionend', this.animListener)
      delete this.animListener
    }
  },
  beforeDestroy () {
    this.animListener && this.animListener()
  },
  render (h) {
    return h('transition', {
      props: {
        css: false,
        appear: this.appear
      },
      on: {
        enter: (el, done) => {
          let pos = 0
          this.el = el

          if (this.animListener) {
            pos = el.offsetHeight
            this.animListener()
          }
          else {
            this.lastEvent = 'hide'
          }

          this.__begin(el, pos)

          this.animListener = () => {
            this.__end(el, 'show')
            done()
          }
          this.timer = setTimeout(() => {
            el.style.height = `${el.scrollHeight}px`
            el.addEventListener('transitionend', this.animListener)
          }, 100)
        },
        leave: (el, done) => {
          let pos
          this.el = el

          if (this.animListener) {
            pos = el.offsetHeight
            this.animListener()
          }
          else {
            this.lastEvent = 'show'
            pos = el.scrollHeight
          }

          this.__begin(el, pos)

          this.animListener = () => {
            this.__end(el, 'hide')
            done()
          }
          this.timer = setTimeout(() => {
            el.style.height = 0
            el.addEventListener('transitionend', this.animListener)
          }, 100)
        }
      }
    }, this.$slots.default)
  }
}<commit_msg>fix: Step content is inserted multiple times when switching from Vertical to Horizontal #2601<commit_after>export default {
  name: 'QSlideTransition',

  props: {
    appear: Boolean,
    duration: {
      type: Number,
      default: 300
    }
  },

  methods: {
    __begin (el, height, done) {
      el.style.overflowY = 'hidden'
      if (height !== void 0) {
        el.style.height = `${height}px`
      }
      el.style.transition = `height ${this.duration}ms cubic-bezier(.25, .8, .50, 1)`

      this.animating = true
      this.done = done
    },

    __end (el, event) {
      el.style.overflowY = null
      el.style.height = null
      el.style.transition = null
      this.__cleanup()
      event !== this.lastEvent && this.$emit(event)
    },

    __cleanup () {
      this.done && this.done()
      this.done = null
      this.animating = false

      clearTimeout(this.timer)
      this.el.removeEventListener('transitionend', this.animListener)
      this.animListener = null
    }
  },

  beforeDestroy () {
    this.animating && this.__cleanup()
  },

  render (h) {
    return h('transition', {
      props: {
        css: false,
        appear: this.appear
      },
      on: {
        enter: (el, done) => {
          let pos = 0
          this.el = el

          if (this.animating === true) {
            this.__cleanup()
            pos = el.offsetHeight === el.scrollHeight ? 0 : void 0
          }
          else {
            this.lastEvent = 'hide'
          }

          this.__begin(el, pos, done)

          this.timer = setTimeout(() => {
            el.style.height = `${el.scrollHeight}px`
            this.animListener = () => {
              this.__end(el, 'show')
            }
            el.addEventListener('transitionend', this.animListener)
          }, 100)
        },
        leave: (el, done) => {
          let pos
          this.el = el

          if (this.animating === true) {
            this.__cleanup()
          }
          else {
            this.lastEvent = 'show'
            pos = el.scrollHeight
          }

          this.__begin(el, pos, done)

          this.timer = setTimeout(() => {
            el.style.height = 0
            this.animListener = () => {
              this.__end(el, 'hide')
            }
            el.addEventListener('transitionend', this.animListener)
          }, 100)
        }
      }
    }, this.$slots.default)
  }
}
{'fraction_non_alphanumeric': 0.13321761770449123, 'fraction_numerical': 0.009112605771316989, 'mean_word_length': 1.4905456509994597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2646451', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1347, 'n_words': 274}