import{a6 as e,a,Q as t,a8 as l,aU as n,aV as i,aW as s,aX as u,h as o,aY as c,aT as v,aZ as r,g as m}from"./index.9313841a.js";var d=e({name:"QItemSection",props:{avatar:Boolean,thumbnail:Boolean,side:Boolean,top:Boolean,noWrap:Boolean},setup(e,{slots:n}){const i=a((()=>"q-item__section column q-item__section--"+(!0===e.avatar||!0===e.side||!0===e.thumbnail?"side":"main")+(!0===e.top?" q-item__section--top justify-start":" justify-center")+(!0===e.avatar?" q-item__section--avatar":"")+(!0===e.thumbnail?" q-item__section--thumbnail":"")+(!0===e.noWrap?" q-item__section--nowrap":"")));return()=>t("div",{class:i.value},l(n.default))}}),p=e({name:"QItem",props:{...n,...i,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(e,{slots:l,emit:n}){const{proxy:{$q:i}}=m(),d=s(e,i),{hasLink:p,linkAttrs:f,linkClass:b,linkTag:q,navigateOnClick:k}=u(),y=o(null),_=o(null),g=a((()=>!0===e.clickable||!0===p.value||"label"===e.tag)),h=a((()=>!0!==e.disable&&!0===g.value)),B=a((()=>"q-item q-item-type row no-wrap"+(!0===e.dense?" q-item--dense":"")+(!0===d.value?" q-item--dark":"")+(!0===p.value&&null===e.active?b.value:!0===e.active?" q-item--active"+(void 0!==e.activeClass?` ${e.activeClass}`:""):"")+(!0===e.disable?" disabled":"")+(!0===h.value?" q-item--clickable q-link cursor-pointer "+(!0===e.manualFocus?"q-manual-focusable":"q-focusable q-hoverable")+(!0===e.focused?" q-manual-focusable--focused":""):""))),x=a((()=>{if(void 0===e.insetLevel)return null;return{["padding"+(!0===i.lang.rtl?"Right":"Left")]:16+56*e.insetLevel+"px"}}));function E(e){!0===h.value&&(null!==_.value&&!0!==e.qAvoidFocus&&(!0!==e.qKeyEvent&&document.activeElement===y.value?_.value.focus():document.activeElement===_.value&&y.value.focus()),k(e))}function C(e){if(!0===h.value&&!0===c(e,[13,32])){v(e),e.qKeyEvent=!0;const a=new MouseEvent("click",e);a.qKeyEvent=!0,y.value.dispatchEvent(a)}n("keyup",e)}return()=>{const a={ref:y,class:B.value,style:x.value,role:"listitem",onClick:E,onKeyup:C};return!0===h.value?(a.tabindex=e.tabindex||"0",Object.assign(a,f.value)):!0===g.value&&(a["aria-disabled"]="true"),t(q.value,a,function(){const e=r(l.default,[]);return!0===h.value&&e.unshift(t("div",{class:"q-focus-helper",tabindex:-1,ref:_})),e}())}}});export{p as Q,d as a};
