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AADrB,eAEG,YAFH,EAEkB,GAAG,KAAH,CAAS,YAAT,CAFlB;AAKA,eAAG,KAAH,CAAS,QAAT,GAAoB,QAApB;AACA,eAAG,KAAH,CAAS,YAAT,IAA4B,GAAG,WAAW,yBAAW,YAAX,CAAd,CAA5B;AACA,iBAAK,GAAG,YAAR,CARO,CAQc;AAErB,kCAAsB;AAAA,uBAAM,GAAG,KAAH,CAAS,YAAT,IAAyB,CAA/B;AAAA,aAAtB;AACD,SA3CI;;AA6CL,8BA7CK;AA8CL,wBAAgB;AA9CX,KAAP;AAiDA,aAAS,UAAT,CAAqB,EAArB,EAAuB;AACrB,+BAAuB,GAAG,OAA1B,IAAqC,GAAG,OAAH,CAAW,SAAX,CAAqB,MAArB,CAA4B,mBAA5B,CAArC;AACA,oBAAY,EAAZ;AACD;AAED,aAAS,WAAT,CAAsB,EAAtB,EAAwB;AACtB,WAAG,KAAH,CAAS,QAAT,GAAoB,GAAG,aAAH,CAAiB,QAArC;AACA,WAAG,KAAH,CAAS,YAAT,IAAyB,GAAG,aAAH,CAAiB,YAAjB,CAAzB;AACA,eAAO,GAAG,aAAV;AACD;AACF,C","sourcesContent":["import { upperFirst } from '../../util/helpers'\n\nexport default function (expandedParentClass = '', x = false) {\n const sizeProperty = x ? 'width' : 'height'\n\n return {\n beforeEnter (el) {\n el._parent = el.parentNode\n el._initialStyle = {\n transition: el.style.transition,\n visibility: el.style.visibility,\n overflow: el.style.overflow,\n [sizeProperty]: el.style[sizeProperty]\n }\n },\n\n enter (el) {\n const initialStyle = el._initialStyle\n el.style.setProperty('transition', 'none', 'important')\n el.style.visibility = 'hidden'\n const size = `${el['offset' + upperFirst(sizeProperty)]}px`\n el.style.visibility = initialStyle.visibility\n el.style.overflow = 'hidden'\n el.style[sizeProperty] = 0\n void el.offsetHeight // force reflow\n el.style.transition = initialStyle.transition\n\n expandedParentClass && el._parent && el._parent.classList.add(expandedParentClass)\n\n requestAnimationFrame(() => {\n el.style[sizeProperty] = size\n })\n },\n\n afterEnter: resetStyles,\n enterCancelled: resetStyles,\n\n leave (el) {\n el._initialStyle = {\n overflow: el.style.overflow,\n [sizeProperty]: el.style[sizeProperty]\n }\n\n el.style.overflow = 'hidden'\n el.style[sizeProperty] = `${el['offset' + upperFirst(sizeProperty)]}px`\n void el.offsetHeight // force reflow\n\n requestAnimationFrame(() => el.style[sizeProperty] = 0)\n },\n\n afterLeave,\n leaveCancelled: afterLeave\n }\n\n function afterLeave (el) {\n expandedParentClass && el._parent && el._parent.classList.remove(expandedParentClass)\n resetStyles(el)\n }\n\n function resetStyles (el) {\n el.style.overflow = el._initialStyle.overflow\n el.style[sizeProperty] = el._initialStyle[sizeProperty]\n delete el._initialStyle\n }\n}\n"],"sourceRoot":""}
|