import{_ as y}from"./IconChevronDown-NfcUpI8U.js";import{M as b,H as k,r as M,g as x,K as C,B as V,o as n,c as l,a as B,t as c,n as s,b as T,F as N,h as O,k as D,i as I,I as w}from"./index-Bb2UEb_P.js";import{v as z}from"./index-Dax_IkAt.js";const F={key:0,class:"tw-absolute tw-overflow-y-auto tw-top-11 tw-right-0 tw-bg-white tw-border tw-border-gray-200 tw-rounded tw-w-full tw-z-20 tw-select-none tw-max-h-48"},S=["onClick"],K=b({__name:"InputSelect",props:w({disabled:{type:Boolean},options:{},paramToMatch:{default:"value"},placeholder:{default:"Выберите"}},{modelValue:{},modelModifiers:{}}),emits:w(["update"],["update:modelValue"]),setup(t,{emit:d}){const o=k(t,"modelValue"),m=d,a=M(!1),u=x(()=>{const e=t.options.find(i=>i[t.paramToMatch]===o.value);return e?e.name:null});function f(){a.value=!1}function p(){!t.disabled&&t.options.length&&(a.value=!a.value)}function v(e){a.value=!1,e[t.paramToMatch]!==o.value&&(o.value=e[t.paramToMatch],m("update"))}return(e,i)=>{const h=y;return C((n(),l("div",{class:"tw-relative tw-text-gray-800 tw-flex tw-items-center tw-justify-between tw-rounded tw-px-4 tw-h-10 tw-border tw-border-gray-200 tw-cursor-pointer",onClick:p},[B("div",{class:s(u.value?"tw-text-gray-800":"tw-text-gray-400")},c(u.value||e.placeholder),3),T(h,{class:s(["tw-flex-none tw-w-6 tw-h-6 tw-duration-200",{"tw-rotate-180":a.value,"tw-rotate-0":!a.value,"tw-text-gray-200":!e.options.length}])},null,8,["class"]),a.value?(n(),l("ul",F,[(n(!0),l(N,null,O(e.options,(r,g)=>(n(),l("li",{key:g,class:s(["tw-flex tw-items-center tw-px-4 tw-h-10 tw-gap-2 hover:tw-bg-sky-100 tw-cursor-pointer tw-rounded",r[e.paramToMatch]===o.value?"tw-font-bold":""]),onClick:D(_=>v(r),["stop"])},c(r.name),11,S))),128))])):I("",!0)])),[[V(z),f]])}}});export{K as _};
