import{_ as e,b as t,et as n,s as r}from"./runtime-core.esm-bundler-Babufkcf.js";import{t as i}from"./create-CGAkPJkS.js";import{m as a}from"./dom-BXiDqs7-.js";import{n as o}from"./Ripple-DUI3t__o.js";import{a as s,o as c}from"./QIcon-cTVL6ikA.js";import{c as l,s as u}from"./QBtn-DkiaKEsC.js";import{n as d,t as f}from"./use-dark-B6e4te0z.js";var p=i({name:`QItemSection`,props:{avatar:Boolean,thumbnail:Boolean,side:Boolean,top:Boolean,noWrap:Boolean},setup(e,{slots:n}){let i=r(()=>`q-item__section column q-item__section--${e.avatar||e.side||e.thumbnail?`side`:`main`}`+(e.top?` q-item__section--top justify-start`:` justify-center`)+(e.avatar?` q-item__section--avatar`:``)+(e.thumbnail?` q-item__section--thumbnail`:``)+(e.noWrap?` q-item__section--nowrap`:``));return()=>t(`div`,{class:i.value},s(n.default))}}),m=i({name:`QItem`,props:{...d,...l,tag:{type:String,default:`div`},active:{type:Boolean,default:null},clickable:Boolean,dense:Boolean,insetLevel:Number,tabindex:[String,Number],focused:Boolean,manualFocus:Boolean},emits:[`click`,`keyup`],setup(i,{slots:s,emit:l}){let{proxy:{$q:d}}=e(),p=f(i,d),{hasLink:m,linkAttrs:h,linkClass:g,linkTag:_,navigateOnClick:v}=u(),y=n(null),b=n(null),x=r(()=>i.clickable||m.value||i.tag===`label`),S=r(()=>!i.disable&&x.value),C=r(()=>`q-item q-item-type row no-wrap`+(i.dense?` q-item--dense`:``)+(p.value?` q-item--dark`:``)+(m.value&&i.active===null?g.value:i.active?` q-item--active${i.activeClass===void 0?``:` ${i.activeClass}`}`:``)+(i.disable?` disabled`:``)+(S.value?` q-item--clickable q-link cursor-pointer `+(i.manualFocus?`q-manual-focusable`:`q-focusable q-hoverable`)+(i.focused?` q-manual-focusable--focused`:``):``)),w=r(()=>i.insetLevel===void 0?null:{[`padding`+(d.lang.rtl?`Right`:`Left`)]:16+i.insetLevel*56+`px`});function T(e){S.value&&(b.value!==null&&!e.qAvoidFocus&&(!e.qKeyEvent&&document.activeElement===y.value?b.value.focus():document.activeElement===b.value&&y.value.focus()),v(e))}function E(e){if(S.value&&o(e,[13,32])){a(e),e.qKeyEvent=!0;let t=new MouseEvent(`click`,e);t.qKeyEvent=!0,y.value.dispatchEvent(t)}l(`keyup`,e)}function D(){let e=c(s.default,[]);return S.value&&e.unshift(t(`div`,{class:`q-focus-helper`,tabindex:-1,ref:b})),e}return()=>{let e={ref:y,class:C.value,style:w.value,role:`listitem`,onClick:T,onKeyup:E};return S.value?(e.tabindex=i.tabindex||`0`,Object.assign(e,h.value)):x.value&&(e[`aria-disabled`]=`true`),t(_.value,e,D())}}});export{p as n,m as t};