import{j as k,h as _,g as V,d as B,m as o,o as a,e as i,t as u,J as m,F as r,G as f,c as L,q as F}from"./index-CTxlYqj4.js";import{d as N}from"./VAvatar-x_79C0tA.js";const P={class:"m-label"},w=["onClick"],I={class:"text-grey-darken-1"},S={__name:"ChoiceField",props:{modelValue:{type:[Number,String],default:null},label:{type:String,default:""},choices:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},choicesPerLine:{type:Number,required:!1,default:null}},emits:["update:modelValue"],setup(s,{emit:b}){const l=s,h=b,c=_({get(){return l.modelValue},set(e){h("update:modelValue",e)}}),n=V([]);function p(){if(l.choicesPerLine){let e=0;for(;e<l.choices.length;){const d=l.choices.slice(e,e+l.choicesPerLine);n.value.push(d),e+=l.choicesPerLine}}else n.value.push(l.choices)}function v(e){return!l.disabled&&e===c.value?"primary":""}function x(e){l.disabled||(c.value=e)}return B(()=>{p()}),(e,d)=>(a(),o(r,null,[i("div",{class:m(["text-subtitle-1 text-grey-darken-1 mb-5",{"label--disabled":s.disabled}])},[i("label",P,u(s.label),1)],2),(a(!0),o(r,null,f(n.value,(y,g)=>(a(),o("div",{key:g,class:"d-flex flex-grow-0"},[(a(!0),o(r,null,f(y,(t,C)=>(a(),o("div",{key:C,class:m(["choice rounded pa-10 mr-4 text-center flex-grow-0 mb-4",{"choice--disabled":s.disabled,"choice--selected":!s.disabled&&c.value===t.value}]),onClick:q=>x(t.value)},[t.icon?(a(),L(N,{key:0,class:"d-block mb-2 mx-auto",color:v(t.value),size:"x-large",icon:t.icon},null,8,["color","icon"])):F("",!0),i("span",I,u(t.label),1)],10,w))),128))]))),128))],64))}},A=k(S,[["__scopeId","data-v-762c41e2"]]);export{A as C};
