UNPKG

@aotearoan/neon

Version:

Neon is a lightweight design library of Vue 3 components with minimal dependencies.

37 lines (36 loc) 1.11 kB
import { defineComponent as o, ref as t, onMounted as s, onUnmounted as i } from "vue"; import { NeonResponsiveUtils as r } from "../../../../common/utils/NeonResponsiveUtils.es.js"; import { NeonResponsive as a } from "../../../../common/enums/NeonResponsive.es.js"; const m = o({ name: "NeonTab", props: { /** * True if the current tab is the visible tab. */ selected: { type: Boolean, required: !0 }, /** * Id of the tab (matches the key in NeonTabModel). */ id: { type: String, default: null }, /** * By default, use CSS display property to show/hide tab contents. This flag will enable using v-if instead. * */ toggleOnIf: { type: Boolean, default: !1 } }, setup() { const n = t(!1), e = () => { n.value = window.matchMedia(r.breakpoints[a.MobileLarge]).matches; }; return s(() => { window.addEventListener("resize", e, { passive: !0 }), e(); }), i(() => { window.removeEventListener("resize", e); }), { responsiveView: n }; } }); export { m as default }; //# sourceMappingURL=NeonTab.es.js.map