1import{D as e,Ht as t,On as n,ct as r,ft as i,g as a,k as o,mt as s,qt as c,tt as l,v as u,xt as d}from"./runtime-core.esm-bundler-BqIb1SNH.js";import{t as f}from"./useId-Cy-6KJQN.js";import{t as p}from"./Primitive-DPYd1Vv4.js";import{a as m,i as h,n as g,o as _,s as v}from"./RovingFocusGroup-CBNbzIIM.js";var y=o({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(o){let y=o,b=g(),x=f(),S=a(()=>y.tabStopId||x),C=a(()=>b.currentTabStopId.value===S.value),{getItems:w,CollectionItem:T}=v();r(()=>{y.focusable&&b.onFocusableItemAdd()}),i(()=>{y.focusable&&b.onFocusableItemRemove()}),t(()=>y.focusable,(e,t)=>{e!==t&&(e?b.onFocusableItemAdd():b.onFocusableItemRemove())});function E(e){if(e.key===`Tab`&&e.shiftKey){b.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=m(e,b.orientation.value,b.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!y.allowShiftKey&&e.shiftKey)return;e.preventDefault();let n=[...w().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=b.loop.value?_(n,r+1):n.slice(r+1)}l(()=>h(n))}}return(t,r)=>(s(),u(n(T),null,{default:c(()=>[e(n(p),{tabindex:C.value?0:-1,"data-orientation":n(b).orientation.value,"data-active":t.active?``:void 0,"data-disabled":t.focusable?void 0:``,as:t.as,"as-child":t.asChild,onMousedown:r[0]||(r[0]=e=>{t.focusable?n(b).onItemFocus(S.value):e.preventDefault()}),onFocus:r[1]||(r[1]=e=>n(b).onItemFocus(S.value)),onKeydown:E},{default:c(()=>[d(t.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}});export{y as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.