UNPKG

maz-ui

Version:

A standalone components library for Vue.Js 3 & Nuxt.Js 3

60 lines (59 loc) 1.69 kB
import { inject as p, defineComponent as f, ref as c, watch as l, computed as i, openBlock as d, createBlock as v, Transition as _, withCtx as T, withDirectives as z, createElementVNode as C, renderSlot as w, vShow as h } from "vue"; import './assets/MazTabsContentItem.CIoBhqeU.css';function I(e, n) { const t = p(e, n); if (!t) throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${e.toString()}`); return t; } const y = /* @__PURE__ */ f({ __name: "MazTabsContentItem", props: { tab: { type: Number, required: !0 } }, setup(e) { const n = e, t = c("maz-tab-transition"), o = c(), { currentTab: r } = I("maz-tabs"); l( () => r.value, (a, s) => { if (typeof a == "number" && typeof s == "number") { const b = s < a; t.value = b ? "maz-tab-transition" : "maz-tab-reverse-transition"; } }, { immediate: !0 } ); const m = i(() => n.tab - 1), u = i(() => r.value - 1 === m.value); return (a, s) => (d(), v(_, { name: t.value, persisted: "" }, { default: T(() => [ z(C( "div", { ref_key: "MazTabsContentItem", ref: o, class: "m-tabs-content-item m-reset-css" }, [ w(a.$slots, "default", {}, void 0, !0) ], 512 /* NEED_PATCH */ ), [ [h, u.value] ]) ]), _: 3 /* FORWARDED */ }, 8, ["name"])); } }), S = (e, n) => { const t = e.__vccOpts || e; for (const [o, r] of n) t[o] = r; return t; }, M = /* @__PURE__ */ S(y, [["__scopeId", "data-v-89ecbfa6"]]); export { M as default };