import{S as e}from"./index-5d1fdc82.js";import{d as a,r,I as l,j as s,a as c,V as t,B as o,p as n}from"./index-4bd11d60.js";const u={"m-search":"_m-search_1t7gn_1",searchBtn:"_searchBtn_1t7gn_23",leftIcon:"_leftIcon_1t7gn_38"},A=a({name:"m-search",props:{modelValue:{type:String,"default":""},shape:{type:String,"default":"round"},disabled:{type:Boolean,"default":!1},clearable:{type:Boolean,"default":!0},autofocus:{type:Boolean,"default":!1},placeholder:{type:String,"default":"请输入搜索关键词"},background:{type:String,"default":"#fff"},searchIcon:{type:String,"default":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAjVBMVEUAAAABwbUBwbUIxbMAx7sBwrUG0sEBwrUCwbYAwrYBwbYBwbYCwrYDw7YEwbYCxbcExLUYzKIBwrYBwrUBwrUBwrUBwrYBwrYCwrYCwrYCwrcCwrcBwbUDw7gBwrUBwbYBwrUCwrYCwrYCwrcCwrYDwbUCxLcAw7cBwbUCwrYCw7YExbgCwrYBwrYBwbXnPIxzAAAALnRSTlMA/PkTCs4G9qgZ6uJ6PyYhEAVm8u/VvK6fllYc5jDbx8Gaj4qDX0UssnZxO2qxSgNy2wAAAfBJREFUOMuNVNmWgjAUAwoCyibKDops4zb8/+cNaXUslnrMg+fahiS3t6DMoNtV7rRNF7p+oHyCF54MbWTYJI67lRH168EcOahry1skrgZjFLC+BAuSl/3IsD8Yx6h85kh+BM2Uee/OvefbduG7zYalMKo3zXQEEI6PrtL+/JnmxYRAPMxb9loaqua5A11KCqGBcAeJTH+tGFhIlk4xhN3u9v//Cs0YmiIccOPVM9IBHQ3KIkgCx543sWRDzNHHkcnqJ8TxpOOOp+2SHa6Nps6KFP20bYa0rDDDXk4NkC+jCXLMHf4y1HANUDlTdfA/UFP0ZaNqp8pAJUMHQoGqYQ/JAduIUjtWyZH9295xbp+y/mK0BJU7VZorZ65wx1MdpY+ykVMhpTrsiBNcdV0elbtMDt6Lq4xZwTQiD4c1huBJkrYql29rIU27HOFWwh+iFB5k9+ES8yeCzP21cKGfgHCBaWCn5mYZJAhkOuQt5y2iGrn4tJnkOr/YliOgpeT9SBA47oOHopttYEW58xfPrx8bZp12TvaLR6m7hl+LzLjZbhSg1nkKrnaacfVbDGEe67utEEvIgHz9sTRf3+yoIWxCYgaQqzA7H43IiFNneO6RE8sQCEMP7KKwCXdqzwy58gVYhu4zictQuspXCPLO3f4BoTRURugakDAAAAAASUVORK5CYII="},inputBackground:{type:String,"default":"#f8f9fc"}},emits:["search","focus","blur"],setup(a,{slots:A,emit:d,expose:h}){const p=r({search:a.modelValue||""}),w=l();return s((()=>a.modelValue),(()=>{p.search=a.modelValue})),h({searchBlur:()=>{var e;null==(e=w.value)||e.blur()}}),()=>c(e,{"class":[u["m-search"],u[a.inputBackground]],style:{"--van-search-content-background":a.inputBackground},ref:w,shape:a.shape,background:a.background,placeholder:a.placeholder,disabled:a.disabled,autofocus:a.autofocus,autocomplete:"off",clearable:a.clearable,modelValue:p.search,"onUpdate:modelValue":e=>p.search=e,clearTrigger:"always",onClear:()=>{p.search="",d("search",p.search)},onFocus:()=>d("focus"),onBlur:()=>d("blur",p.search),onSearch:()=>d("search",p.search)},{left:()=>A.left&&A.left(),"left-icon":()=>c(t,{name:a.searchIcon,"class":u.leftIcon},null),"right-icon":()=>c(o,{disabled:a.disabled,"class":u.searchBtn,round:!0,type:"primary",size:"mini",onClick:()=>d("search",p.search)},{"default":()=>[n("搜索")]})})}});export{A as O};
