UNPKG

@aotearoan/neon

Version:

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

104 lines (103 loc) 4.21 kB
import b from "./NeonTreeMenu.es.js"; import { resolveComponent as C, openBlock as t, createElementBlock as s, normalizeClass as p, createElementVNode as i, Fragment as k, renderList as _, createVNode as f, withCtx as y, withKeys as a, withModifiers as u, toDisplayString as c, createCommentVNode as h } from "vue"; import v from "../../../_virtual/_plugin-vue_export-helper.es.js"; const $ = { class: "no-style" }, w = ["onKeydown"], K = { class: "no-style neon-tree-menu__links" }; function g(e, o, x, N, A, V) { const d = C("neon-link"); return e.model ? (t(), s("nav", { key: 0, class: p([{ "neon-tree-menu--expand-all": e.expandAll }, "neon-tree-menu"]) }, [ i("ul", $, [ (t(!0), s(k, null, _(e.model, (l) => (t(), s("li", { key: l.key, class: p([{ "neon-tree-menu__section--expanded": l.expanded || e.expandAll, "neon-tree-menu__section--disabled": l.disabled }, "neon-tree-menu__section"]) }, [ f(d, { href: l.href, "no-style": !l.href, class: "neon-tree-menu__section-link", "outline-style": "none", tabindex: "-1", onClick: (n) => !l.disabled && e.onClick(l.key) }, { default: y(() => [ i("span", { class: "neon-tree-menu__section-link-label neon-tree-menu__section-link-label--outline-text", role: "link", tabindex: "0", onKeydown: [ a(u((n) => !l.disabled && e.onClick(l.key), ["stop", "prevent"]), ["space"]), a((n) => l.href && e.click(n), ["enter"]), a((n) => l.href && e.click(n), ["space"]) ] }, c(l.label), 41, w) ]), _: 2 }, 1032, ["href", "no-style", "onClick"]), i("ul", K, [ (t(!0), s(k, null, _(l.children, (n) => (t(), s("li", { key: n.key, class: "neon-tree-menu__link-item" }, [ f(d, { href: n.href, "no-style": !0, class: "neon-tree-menu__link", "outline-style": "none", tabindex: "-1", onClick: (r) => e.onClick(n.key) }, { default: y(() => [ i("span", { class: "neon-tree-menu__link-label neon-tree-menu__link-label--outline-text", role: "link", tabindex: "0", onKeydown: [ o[0] || (o[0] = a((r) => e.click(r), ["enter"])), o[1] || (o[1] = a(u((r) => e.click(r), ["prevent"]), ["space"])) ] }, c(n.label), 33) ]), _: 2 }, 1032, ["href", "onClick"]), n.anchors && n.anchors.length > 0 ? (t(), s("ul", { key: 0, class: p([{ "neon-tree-menu__anchors--expanded": e.expandAll || e.url === n.href }, "no-style neon-tree-menu__anchors"]) }, [ (t(!0), s(k, null, _(n.anchors, (r) => (t(), s("li", { key: r }, [ f(d, { href: `${n.href}#${e.fragment(r)}`, class: "neon-link--no-style neon-tree-menu__anchor", "outline-style": "none", tabindex: "-1" }, { default: y(() => [ i("span", { class: "neon-tree-menu__anchor-label neon-tree-menu__anchor-label--outline-text", role: "link", tabindex: "0", onKeydown: [ o[2] || (o[2] = a(u((m) => e.click(m), ["prevent"]), ["space"])), o[3] || (o[3] = a(u((m) => e.click(m), ["prevent"]), ["enter"])) ] }, c(r), 33) ]), _: 2 }, 1032, ["href"]) ]))), 128)) ], 2)) : h("", !0) ]))), 128)) ]) ], 2))), 128)) ]) ], 2)) : h("", !0); } const z = /* @__PURE__ */ v(b, [["render", g]]); export { z as default }; //# sourceMappingURL=NeonTreeMenu.vue.es.js.map