maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
52 lines (51 loc) • 1.67 kB
JavaScript
import { defineComponent as p, useCssVars as d, openBlock as h, createBlock as u, TransitionGroup as y, withCtx as g, renderSlot as l, nextTick as r } from "vue";
import './assets/MazTransitionExpand.CvCjUYCg.css';const f = /* @__PURE__ */ p({
__name: "MazTransitionExpand",
props: {
animationDuration: { default: "300ms" }
},
setup(n) {
d((t) => ({
"6402c434": t.animationDuration
}));
function a(t) {
const o = getComputedStyle(t).width;
t.style.width = o, t.style.position = "absolute", t.style.visibility = "hidden", t.style.height = "auto", t.style.top = "bottom";
const i = getComputedStyle(t).height;
t.style.width = "", t.style.position = "", t.style.visibility = "", t.style.height = "0px", getComputedStyle(t).height, r(() => {
t.style.height = i;
});
}
function s(t) {
t.style.height = "auto";
}
function e(t) {
const o = getComputedStyle(t).height;
t.style.height = o, getComputedStyle(t).height, r(() => {
t.style.height = "0px";
});
}
return (t, o) => (h(), u(y, {
class: "m-transition-expand m-reset-css",
name: "maz-expand",
tag: "div",
onEnter: o[0] || (o[0] = (i) => a(i)),
onAfterEnter: o[1] || (o[1] = (i) => s(i)),
onLeave: o[2] || (o[2] = (i) => e(i))
}, {
default: g(() => [
l(t.$slots, "default", {}, void 0, !0)
]),
_: 3
/* FORWARDED */
}));
}
}), c = (n, a) => {
const s = n.__vccOpts || n;
for (const [e, t] of a)
s[e] = t;
return s;
}, v = /* @__PURE__ */ c(f, [["__scopeId", "data-v-fbd5f8a0"]]);
export {
v as default
};