maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
55 lines (54 loc) • 2 kB
JavaScript
import { defineComponent as l, mergeModels as m, useModel as u, ref as r, onMounted as f, onUnmounted as p, openBlock as v, createElementBlock as c, normalizeClass as _, normalizeStyle as x, createElementVNode as E, mergeProps as h, renderSlot as g } from "vue";
import { _ as M } from "./MazStepper.Gxu3fyI5.mjs";
import '../assets/MazExpandAnimation.iDSQfAB4.css';const A = ["aria-hidden"], y = /* @__PURE__ */ l({
inheritAttrs: !1,
__name: "MazExpandAnimation",
props: /* @__PURE__ */ m({
duration: { default: "300ms" },
timingFunction: { default: "ease-in-out" }
}, {
modelValue: { type: Boolean },
modelModifiers: {}
}),
emits: ["update:modelValue"],
setup(d) {
const a = u(d, "modelValue"), i = r(!a.value), t = r();
function o() {
a.value || (i.value = !0);
}
function s() {
a.value && (i.value = !1);
}
return f(() => {
var e, n;
(e = t.value) == null || e.addEventListener("transitionstart", o, !1), (n = t.value) == null || n.addEventListener("transitionend", s, !1);
}), p(() => {
var e, n;
(e = t.value) == null || e.removeEventListener("transitionstart", o, !1), (n = t.value) == null || n.removeEventListener("transitionend", s, !1);
}), (e, n) => (v(), c("div", {
ref_key: "expandAnimationRef",
ref: t,
class: _(["m-expand-animation m-reset-css", { "m-expand-animation--expanded": a.value }]),
"aria-hidden": !a.value,
role: "region",
style: x([{ "--expand-animation-duration": e.duration, "--expand-animation-timing-function": e.timingFunction }])
}, [
E(
"div",
h({ class: "m-expand-animation__inner" }, e.$attrs, {
class: {
"--overflow-hidden": i.value
}
}),
[
g(e.$slots, "default", {}, void 0, !0)
],
16
/* FULL_PROPS */
)
], 14, A));
}
}), V = /* @__PURE__ */ M(y, [["__scopeId", "data-v-058a2912"]]);
export {
V as default
};