import{At as e,Q as t,T as n,U as r,c as i,et as a,s as o,w as s}from"./dom-CdSnbvZ6.js";import{D as c,E as l,T as u,V as d,k as f}from"./settings-BF7JcItU.js";var p=n({name:`QItemSection`,props:{avatar:Boolean,thumbnail:Boolean,side:Boolean,top:Boolean,noWrap:Boolean},setup(e,{slots:t}){let n=r(()=>`q-item__section column q-item__section--${e.avatar===!0||e.side===!0||e.thumbnail===!0?`side`:`main`}`+(e.top===!0?` q-item__section--top justify-start`:` justify-center`)+(e.avatar===!0?` q-item__section--avatar`:``)+(e.thumbnail===!0?` q-item__section--thumbnail`:``)+(e.noWrap===!0?` q-item__section--nowrap`:``));return()=>a(`div`,{class:n.value},o(t.default))}}),m=n({name:`QItem`,props:{...l,...f,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(n,{slots:o,emit:l}){let{proxy:{$q:f}}=t(),p=u(n,f),{hasLink:m,linkAttrs:h,linkClass:g,linkTag:_,navigateOnClick:v}=c(),y=e(null),b=e(null),x=r(()=>n.clickable===!0||m.value===!0||n.tag===`label`),S=r(()=>n.disable!==!0&&x.value===!0),C=r(()=>`q-item q-item-type row no-wrap`+(n.dense===!0?` q-item--dense`:``)+(p.value===!0?` q-item--dark`:``)+(m.value===!0&&n.active===null?g.value:n.active===!0?` q-item--active${n.activeClass===void 0?``:` ${n.activeClass}`}`:``)+(n.disable===!0?` disabled`:``)+(S.value===!0?` q-item--clickable q-link cursor-pointer `+(n.manualFocus===!0?`q-manual-focusable`:`q-focusable q-hoverable`)+(n.focused===!0?` q-manual-focusable--focused`:``):``)),w=r(()=>n.insetLevel===void 0?null:{[`padding`+(f.lang.rtl===!0?`Right`:`Left`)]:16+n.insetLevel*56+`px`});function T(e){S.value===!0&&(b.value!==null&&e.qAvoidFocus!==!0&&(e.qKeyEvent!==!0&&document.activeElement===y.value?b.value.focus():document.activeElement===b.value&&y.value.focus()),v(e))}function E(e){if(S.value===!0&&d(e,[13,32])===!0){s(e),e.qKeyEvent=!0;let t=new MouseEvent(`click`,e);t.qKeyEvent=!0,y.value.dispatchEvent(t)}l(`keyup`,e)}function D(){let e=i(o.default,[]);return S.value===!0&&e.unshift(a(`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===!0?(e.tabindex=n.tabindex||`0`,Object.assign(e,h.value)):x.value===!0&&(e[`aria-disabled`]=`true`),a(_.value,e,D())}}}),h=n({name:`QItemLabel`,props:{overline:Boolean,caption:Boolean,header:Boolean,lines:[Number,String]},setup(e,{slots:t}){let n=r(()=>parseInt(e.lines,10)),i=r(()=>`q-item__label`+(e.overline===!0?` q-item__label--overline text-overline`:``)+(e.caption===!0?` q-item__label--caption text-caption`:``)+(e.header===!0?` q-item__label--header`:``)+(n.value===1?` ellipsis`:``)),s=r(()=>e.lines!==void 0&&n.value>1?{overflow:`hidden`,display:`-webkit-box`,"-webkit-box-orient":`vertical`,"-webkit-line-clamp":n.value}:null);return()=>a(`div`,{style:s.value,class:i.value},o(t.default))}});export{m as n,p as r,h as t};