import{defineComponent as h,computed as p,createVNode as r}from"vue";import y from"../_util/vue-types/index.mjs";const C={value:Number,index:Number,prefixCls:String,allowHalf:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},character:y.any,characterRender:Function,focused:{type:Boolean,default:void 0},count:Number,onClick:Function,onHover:Function},b=h({compatConfig:{MODE:3},name:"Star",inheritAttrs:!1,props:C,emits:["hover","click"],setup(l,{emit:s}){const f=e=>{const{index:n}=l;s("hover",e,n)},v=e=>{const{index:n}=l;s("click",e,n)},m=e=>{const{index:n}=l;e.keyCode===13&&s("click",e,n)},x=p(()=>{const{prefixCls:e,index:n,value:t,allowHalf:i,focused:a}=l,c=n+1;let o=e;return t===0&&n===0&&a?o+=` ${e}-focused`:i&&t+.5>=c&&t<c?(o+=` ${e}-half ${e}-active`,a&&(o+=` ${e}-focused`)):(o+=c<=t?` ${e}-full`:` ${e}-zero`,c===t&&a&&(o+=` ${e}-focused`)),o});return()=>{const{disabled:e,prefixCls:n,characterRender:t,character:i,index:a,count:c,value:o}=l,u=typeof i=="function"?i({disabled:e,prefixCls:n,index:a,count:c,value:o}):i;let d=r("li",{class:x.value},[r("div",{onClick:e?null:v,onKeydown:e?null:m,onMousemove:e?null:f,role:"radio","aria-checked":o>a?"true":"false","aria-posinset":a+1,"aria-setsize":c,tabindex:e?-1:0},[r("div",{class:`${n}-first`},[u]),r("div",{class:`${n}-second`},[u])])]);return t&&(d=t(d,l)),d}}});export{b as default,C as starProps};
