1 line
2.8 KiB
JavaScript
1 line
2.8 KiB
JavaScript
import{C as e,E as t,Mt as n,Qt as r,W as i,Y as a,Z as o,_ as s,c,dt as l,g as u,h as d,m as f,tn as p,v as m,w as h}from"./vendor/json-editor-vue-ddj4xtqm.js";import{_ as g,j as _,k as v,v as y}from"#entry";import{t as b}from"./filepath-item-osqp88cx.js";import{t as x}from"./constants-i6giw94a.js";import{t as S}from"./dist-k9rc0n5t.js";import{t as C}from"./nmarkdown-ftmgc061.js";var w={rounded:``,"font-mono":``},T={key:0,"text-primary":``},E={key:0},D={title:`Vue Directive`},O={"max-w-100":``},k={px4:``,py3:``,"text-sm":``},A={flex:`~ gap2`,n:`primary xs`},j={border:`t base`,"max-h-60":``,"of-auto":``,px4:``,py3:``},M={"text-sm":``},N={"text-primary":``},P={flex:`~ col gap-2`,"items-start":``,pt3:``,"text-sm":``,op75:``},F={key:1,"text-sm":``,op50:``},I=t({__name:`ComposableItem`,props:{item:{},isDirective:{type:Boolean,default:!1},metadata:{},filepath:{},counter:{type:Boolean,default:!0},classes:{default:`px2 py1 text-sm bg-gray:5 `}},setup(t){let I=t,L=g(),R=y(),z=f(()=>I.item.as||I.item.name),B=f(()=>{let e=z.value;return I.isDirective&&(e[0]!==`v`&&(e=`v${e}`),e=S(e)),e}),V=f(()=>I.metadata?.injectionUsage?.[z.value]?.count||0),H=f(()=>(I.metadata?.injectionUsage?.[z.value]?.moduleIds||[]).filter(e=>!e.endsWith(`?macro=true`))),U=f(()=>I.item.meta?.docsUrl?I.item.meta.docsUrl:[`nuxt`,`#app`,`nuxt3`].includes(I.item.from)?x.nuxt[I.item.name]:I.item.from===`vue`?x.vue[I.item.name]:null);return(f,g)=>{let y=_,x=C,S=v,W=b,G=o(`VDropdown`);return i(),u(G,{disabled:!I.metadata},{popper:l(()=>[d(`div`,O,[d(`div`,k,[t.item.meta?.description?(i(),u(x,{key:0,tag:`div`,pb3:``,"text-sm":``,markdown:t.item.meta.description},null,8,[`markdown`])):s(``,!0),d(`div`,A,[h(S,{icon:`carbon-copy`,onClick:g[0]||=e=>n(L)(B.value,`imports-name`)},{default:l(()=>[...g[2]||=[e(` Copy `,-1)]]),_:1}),t.filepath?(i(),u(S,{key:0,icon:`carbon-code`,onClick:g[1]||=e=>t.filepath&&n(R)(t.filepath)},{default:l(()=>[...g[3]||=[e(` Source `,-1)]]),_:1})):s(``,!0),U.value?(i(),u(S,{key:1,icon:`carbon-catalog`,to:U.value,target:`_blank`},{default:l(()=>[...g[4]||=[e(` Docs `,-1)]]),_:1},8,[`to`])):s(``,!0)])]),d(`div`,j,[V.value?(i(),m(c,{key:0},[d(`div`,M,[g[5]||=d(`span`,{op50:``},`It has been referenced `,-1),d(`strong`,N,p(V.value),1),g[6]||=d(`span`,{op50:``},` times by:`,-1)]),d(`div`,P,[(i(!0),m(c,null,a(H.value,e=>(i(),u(W,{key:e,filepath:e},null,8,[`filepath`]))),128))])],64)):(i(),m(`div`,F,` Not in use via auto import. `))])])]),default:l(()=>[d(`button`,{"hover:text-primary":``,class:r([t.metadata&&!V.value?`op30 hover:op100`:``,t.classes])},[d(`code`,w,[e(p(z.value)+` `,1),V.value&&t.counter?(i(),m(`sup`,T,`x`+p(V.value),1)):s(``,!0)]),t.isDirective?(i(),m(`sup`,E,[d(`abbr`,D,[h(y,{icon:`tabler:hexagon-letter-d`})])])):s(``,!0)],2)]),_:1},8,[`disabled`])}}}),L=Object.assign(I,{__name:`ComposableItem`});export{L as t}; |