import{I as u}from"./iconify-p99pbjf9.js";import{z as g,j as a,g as o,A as n,J as i,D as m,B as f,O as d,H as k,P as v,K as C,L as V,c as L}from"./index-DOFLUERq.js";import{_ as H}from"./_plugin-vue_export-helper-DlAUqK2U.js";const S={class:"field-controls"},B={class:"select-input"},M=["innerHTML"],T={key:1,class:"control"},I={key:0,class:"control-label label"},N={class:"select-input"},w=["value","disabled"],z=["value"],D=["innerHTML"],O={__name:"SelectControl",props:["df","read_only","modelValue","no_label"],emits:["update:modelValue"],setup(l,{emit:b}){const r=l;let p=b,c=g();function h(){let e=r.df.options;return typeof e=="string"&&(e=e.split(`
`)||"",e=e.map(t=>({label:t,value:t}))),e?.length&&typeof e[0]=="string"&&(e=e.map(t=>({label:t,value:t}))),r.df.sort_options&&e.sort((t,s)=>t.label.localeCompare(s.label)),e||[]}let y=L(()=>h());function _(e){p("update:modelValue",e.target.value)}return(e,t)=>a(c).label?(o(),n("div",{key:0,class:k(["control form-builder-control",{editable:a(c).label}])},[i("div",S,[m(e.$slots,"label",{},void 0,!0),m(e.$slots,"actions",{},void 0,!0)]),i("div",B,[t[0]||(t[0]=i("input",{class:"form-control",readonly:""},null,-1)),f(a(u),{icon:"mdi:chevron-down",class:"select-icon"})]),l.df.description?(o(),n("div",{key:0,class:"mt-2 description",innerHTML:l.df.description},null,8,M)):d("",!0)],2)):(o(),n("div",T,[l.no_label?d("",!0):(o(),n("div",I,v(l.df.label),1)),i("div",N,[i("select",{class:"form-control",value:l.modelValue,onChange:_,disabled:l.read_only||l.df.read_only},[(o(!0),n(C,null,V(a(y),s=>(o(),n("option",{key:s.value,value:s.value},v(s.label),9,z))),128))],40,w),f(a(u),{icon:"mdi:chevron-down",class:"select-icon"})]),l.df.description?(o(),n("div",{key:1,class:"mt-2 description",innerHTML:l.df.description},null,8,D)):d("",!0)]))}},A=H(O,[["__scopeId","data-v-870e6b55"]]);export{A as default};
