UNPKG

@open-data-v/ui

Version:

OpenDataV UI基础包

38 lines (37 loc) 1.86 kB
const o = "0.3s height ease-in-out, 0.3s padding-top ease-in-out, 0.3s padding-bottom ease-in-out", d = { onBeforeEnter(e) { const t = e; t.style.transition = o, t.dataset && (t.dataset.oldPaddingTop = t.style.paddingTop, t.dataset.oldPaddingBottom = t.style.paddingBottom), t.style.height = "0", t.style.paddingTop = "0", t.style.paddingBottom = "0"; }, onEnter(e) { const t = e; t.dataset.oldOverflow = t.style.overflow, t.style.transitionProperty = "all", t.scrollHeight !== 0 ? (t.style.height = t.scrollHeight + "px", t.style.paddingTop = t.dataset.oldPaddingTop || "", t.style.paddingBottom = t.dataset.oldPaddingBottom || "") : (t.style.height = "", t.style.paddingTop = t.dataset.oldPaddingTop || "", t.style.paddingBottom = t.dataset.oldPaddingBottom || ""), t.style.overflow = "hidden"; }, onAfterEnter(e) { const t = e; t.style.transition = "", t.style.height = "", t.style.overflow = t.dataset.oldOverflow || ""; }, onBeforeLeave(e) { const t = e; t.dataset && (t.dataset.oldPaddingTop = t.style.paddingTop, t.dataset.oldPaddingBottom = t.style.paddingBottom, t.dataset.oldOverflow = t.style.overflow), t.style.height = t.scrollHeight + "px", t.style.overflow = "hidden"; }, onLeave(e) { const t = e; t.style.transitionProperty = "all", t.scrollHeight !== 0 && (t.style.transition = o, t.style.height = "0", t.style.paddingTop = "0", t.style.paddingBottom = "0"); }, onAfterLeave(e) { const t = e; t.style.transition, t.style.height = "", t.style.overflow = t.dataset.oldOverflow || "", t.style.paddingTop = t.dataset.oldPaddingTop || "", t.style.paddingBottom = t.dataset.oldPaddingBottom || ""; } }, s = { functional: !0, setup() { return { collapseTransitionProps: d }; } }; export { s as default }; //# sourceMappingURL=Transition.vue.esm2.js.map