{"version":3,"file":"C_7iyQFV.js","sources":["../../../../node_modules/quasar/src/components/slide-transition/QSlideTransition.js"],"sourcesContent":["import { h, onBeforeUnmount, Transition } from 'vue'\n\nimport { createComponent } from '../../utils/private.create/create.js'\n\nexport default createComponent({\n name: 'QSlideTransition',\n\n props: {\n appear: Boolean,\n duration: {\n type: Number,\n default: 300\n }\n },\n\n emits: [ 'show', 'hide' ],\n\n setup (props, { slots, emit }) {\n let animating = false, doneFn, element\n let timer = null, timerFallback = null, animListener, lastEvent\n\n function cleanup () {\n doneFn && doneFn()\n doneFn = null\n animating = false\n\n if (timer !== null) {\n clearTimeout(timer)\n timer = null\n }\n\n if (timerFallback !== null) {\n clearTimeout(timerFallback)\n timerFallback = null\n }\n\n element !== void 0 && element.removeEventListener('transitionend', animListener)\n animListener = null\n }\n\n function begin (el, height, done) {\n // here overflowY is 'hidden'\n if (height !== void 0) {\n el.style.height = `${ height }px`\n }\n el.style.transition = `height ${ props.duration }ms cubic-bezier(.25, .8, .50, 1)`\n\n animating = true\n doneFn = done\n }\n\n function end (el, event) {\n el.style.overflowY = null\n el.style.height = null\n el.style.transition = null\n cleanup()\n event !== lastEvent && emit(event)\n }\n\n function onEnter (el, done) {\n let pos = 0\n element = el\n\n // if animationg overflowY is already 'hidden'\n if (animating === true) {\n cleanup()\n pos = el.offsetHeight === el.scrollHeight ? 0 : void 0\n }\n else {\n lastEvent = 'hide'\n el.style.overflowY = 'hidden'\n }\n\n begin(el, pos, done)\n\n timer = setTimeout(() => {\n timer = null\n el.style.height = `${ el.scrollHeight }px`\n animListener = evt => {\n timerFallback = null\n\n if (Object(evt) !== evt || evt.target === el) {\n end(el, 'show')\n }\n }\n el.addEventListener('transitionend', animListener)\n timerFallback = setTimeout(animListener, props.duration * 1.1)\n }, 100)\n }\n\n function onLeave (el, done) {\n let pos\n element = el\n\n if (animating === true) {\n cleanup()\n }\n else {\n lastEvent = 'show'\n // we need to set overflowY 'hidden' before calculating the height\n // or else we get small differences\n el.style.overflowY = 'hidden'\n pos = el.scrollHeight\n }\n\n begin(el, pos, done)\n\n timer = setTimeout(() => {\n timer = null\n el.style.height = 0\n animListener = evt => {\n timerFallback = null\n\n if (Object(evt) !== evt || evt.target === el) {\n end(el, 'hide')\n }\n }\n el.addEventListener('transitionend', animListener)\n timerFallback = setTimeout(animListener, props.duration * 1.1)\n }, 100)\n }\n\n onBeforeUnmount(() => {\n animating === true && cleanup()\n })\n\n return () => h(Transition, {\n css: false,\n appear: props.appear,\n onEnter,\n onLeave\n }, slots.default)\n }\n})\n"],"names":["QSlideTransition","createComponent","props","slots","emit","animating","doneFn","element","timer","timerFallback","animListener","lastEvent","cleanup","begin","el","height","done","end","event","onEnter","pos","evt","onLeave","onBeforeUnmount","h","Transition"],"mappings":"yDAIA,MAAAA,EAAeC,EAAgB,CAC7B,KAAM,mBAEN,MAAO,CACL,OAAQ,QACR,SAAU,CACR,KAAM,OACN,QAAS,GACV,CACF,EAED,MAAO,CAAE,OAAQ,MAAQ,EAEzB,MAAOC,EAAO,CAAE,MAAAC,EAAO,KAAAC,CAAI,EAAI,CAC7B,IAAIC,EAAY,GAAOC,EAAQC,EAC3BC,EAAQ,KAAMC,EAAgB,KAAMC,EAAcC,EAEtD,SAASC,GAAW,CAClBN,GAAUA,EAAQ,EAClBA,EAAS,KACTD,EAAY,GAERG,IAAU,OACZ,aAAaA,CAAK,EAClBA,EAAQ,MAGNC,IAAkB,OACpB,aAAaA,CAAa,EAC1BA,EAAgB,MAGlBF,IAAY,QAAUA,EAAQ,oBAAoB,gBAAiBG,CAAY,EAC/EA,EAAe,IAChB,CAED,SAASG,EAAOC,EAAIC,EAAQC,EAAM,CAE5BD,IAAW,SACbD,EAAG,MAAM,OAAS,GAAIC,CAAQ,MAEhCD,EAAG,MAAM,WAAa,UAAWZ,EAAM,QAAQ,mCAE/CG,EAAY,GACZC,EAASU,CACV,CAED,SAASC,EAAKH,EAAII,EAAO,CACvBJ,EAAG,MAAM,UAAY,KACrBA,EAAG,MA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