PIMS/public/build/assets/VisuallyHidden-BvthYHr5.js

2 lines
2.4 KiB
JavaScript

import{a8 as f,a7 as p,r as u,c as l,a5 as d,aa as m,ab as c,ac as h,d as v,k as y,o as w,w as g,G as P,u as b}from"./app-BXYcVHqk.js";import{u as E}from"./useForwardExpose-Djbxsgaa.js";import{P as x}from"./AppLogoIcon.vue_vue_type_script_setup_true_lang-BzXwPo6R.js";function _(e,t){const s=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(s);return[n=>{const i=f(o,n);if(i||i===null)return i;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},n=>(p(o,n),n)]}function R(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}const[C]=_("ConfigProvider");function V(e){const t=C({dir:u("ltr")});return l(()=>e?.value||t.dir?.value||"ltr")}function j(e){const t=d(),s=t?.type.emits,o={};return s?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),s?.forEach(r=>{o[m(c(r))]=(...a)=>e(r,...a)}),o}function $(e){const t=d(),s=Object.keys(t?.type.props??{}).reduce((r,a)=>{const n=(t?.type.props[a]).default;return n!==void 0&&(r[a]=n),r},{}),o=h(e);return l(()=>{const r={},a=t?.vnode.props??{};return Object.keys(a).forEach(n=>{r[c(n)]=a[n]}),Object.keys({...s,...r}).reduce((n,i)=>(o.value[i]!==void 0&&(n[i]=o.value[i]),n),{})})}function q(e,t){const s=$(e),o=t?j(t):{};return l(()=>({...s.value,...o}))}function B(){const e=u(),t=l(()=>["#text","#comment"].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:E(e));return{primitiveElement:e,currentElement:t}}var k=v({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,s)=>(w(),y(b(x),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:g(()=>[P(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),O=k;export{O as V,V as a,B as b,_ as c,$ as d,j as e,R as g,C as i,q as u};