@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
3 lines (2 loc) • 3.1 kB
JavaScript
;const i=require("./NeonTreeMenu.cjs.js"),e=require("vue"),d=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),u={class:"no-style"},c=["onKeydown"],m={class:"no-style neon-tree-menu__links"};function k(n,o,y,_,h,f){const s=e.resolveComponent("neon-link");return n.model?(e.openBlock(),e.createElementBlock("nav",{key:0,class:e.normalizeClass([{"neon-tree-menu--expand-all":n.expandAll},"neon-tree-menu"])},[e.createElementVNode("ul",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.model,t=>(e.openBlock(),e.createElementBlock("li",{key:t.key,class:e.normalizeClass([{"neon-tree-menu__section--expanded":t.expanded||n.expandAll,"neon-tree-menu__section--disabled":t.disabled},"neon-tree-menu__section"])},[e.createVNode(s,{href:t.href,"no-style":!t.href,class:"neon-tree-menu__section-link","outline-style":"none",tabindex:"-1",onClick:l=>!t.disabled&&n.onClick(t.key)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"neon-tree-menu__section-link-label neon-tree-menu__section-link-label--outline-text",role:"link",tabindex:"0",onKeydown:[e.withKeys(e.withModifiers(l=>!t.disabled&&n.onClick(t.key),["stop","prevent"]),["space"]),e.withKeys(l=>t.href&&n.click(l),["enter"]),e.withKeys(l=>t.href&&n.click(l),["space"])]},e.toDisplayString(t.label),41,c)]),_:2},1032,["href","no-style","onClick"]),e.createElementVNode("ul",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.children,l=>(e.openBlock(),e.createElementBlock("li",{key:l.key,class:"neon-tree-menu__link-item"},[e.createVNode(s,{href:l.href,"no-style":!0,class:"neon-tree-menu__link","outline-style":"none",tabindex:"-1",onClick:r=>n.onClick(l.key)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"neon-tree-menu__link-label neon-tree-menu__link-label--outline-text",role:"link",tabindex:"0",onKeydown:[o[0]||(o[0]=e.withKeys(r=>n.click(r),["enter"])),o[1]||(o[1]=e.withKeys(e.withModifiers(r=>n.click(r),["prevent"]),["space"]))]},e.toDisplayString(l.label),33)]),_:2},1032,["href","onClick"]),l.anchors&&l.anchors.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass([{"neon-tree-menu__anchors--expanded":n.expandAll||n.url===l.href},"no-style neon-tree-menu__anchors"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.anchors,r=>(e.openBlock(),e.createElementBlock("li",{key:r},[e.createVNode(s,{href:`${l.href}#${n.fragment(r)}`,class:"neon-link--no-style neon-tree-menu__anchor","outline-style":"none",tabindex:"-1"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"neon-tree-menu__anchor-label neon-tree-menu__anchor-label--outline-text",role:"link",tabindex:"0",onKeydown:[o[2]||(o[2]=e.withKeys(e.withModifiers(a=>n.click(a),["prevent"]),["space"])),o[3]||(o[3]=e.withKeys(e.withModifiers(a=>n.click(a),["prevent"]),["enter"]))]},e.toDisplayString(r),33)]),_:2},1032,["href"])]))),128))],2)):e.createCommentVNode("",!0)]))),128))])],2))),128))])],2)):e.createCommentVNode("",!0)}const p=d(i,[["render",k]]);module.exports=p;
//# sourceMappingURL=NeonTreeMenu.vue.cjs.js.map