System.register(["./index-legacy-fdce4919.js","./index-legacy-39907d87.js"],(function(e,t){"use strict";var a,r,n,o,c,l,s,i,u,_,d,h,f,p,m,g,b,v,k,q,y=document.createElement("style");return y.textContent="._m-search_1oqt0_1{--van-cell-background-color: transparent}._m-search_1oqt0_1 input::-moz-placeholder{color:var(--k-gray-4)}._m-search_1oqt0_1 input::placeholder{color:var(--k-gray-4)}._m-search_1oqt0_1 .van-field__control{-webkit-user-select:text!important;-moz-user-select:text!important;user-select:text!important;font-size:.34667rem}._m-search_1oqt0_1 .van-search__field{background:transparent!important;padding:0 var(--van-padding-xs) 0 0}._m-search_1oqt0_1 .van-field__right-icon{display:flex;align-items:center;justify-content:center;padding-right:.10667rem}._m-search_1oqt0_1._default_1oqt0_22 .van-search__content{background:#f8f9fc!important}._m-search_1oqt0_1._white_1oqt0_25 .van-search__content{background:#fff!important}._m-search_1oqt0_1._transparent_1oqt0_28 .van-search__content{background:rgba(255,255,255,.16)}._m-search_1oqt0_1._transparent_1oqt0_28 .van-search__content input::-moz-placeholder{color:#fff}._m-search_1oqt0_1._transparent_1oqt0_28 .van-search__content input::placeholder{color:#fff}._m-search_1oqt0_1._transparent_1oqt0_28 .van-search__content input,._m-search_1oqt0_1._transparent_1oqt0_28 .van-search__content .van-field__clear{color:#fff}._m-search_1oqt0_1 ._searchBtn_1oqt0_40{width:1.38667rem;height:.66667rem;padding:0;font-size:.34667rem;font-weight:500;--van-button-mini-height: .74667rem;--van-font-size-xs: .32rem;background:linear-gradient(to right,#5BECFF,#259CFE);border:none}\n",document.head.appendChild(y),{setters:[e=>{a=e.c,r=e.a9,n=e.m,o=e.t,c=e.d,l=e.br,s=e.r,i=e.X,u=e.a,_=e.ae,d=e.h,h=e.p,f=e.k,p=e.x,m=e.w,g=e.I,b=e.C,v=e.A},e=>{k=e.f,q=e.F}],execute:function(){const[y,x,I]=a("search"),w=r({},k,{label:String,shape:n("square"),leftIcon:n("search"),clearable:o,actionText:String,background:String,showAction:Boolean});var B=c({name:y,props:w,emits:["blur","focus","clear","search","cancel","clickInput","clickLeftIcon","clickRightIcon","update:modelValue"],setup(e,{emit:t,slots:a,attrs:n}){const o=l(),c=s(),f=()=>{a.action||(t("update:modelValue",""),t("cancel"))},p=a=>{13===a.keyCode&&(h(a),t("search",e.modelValue))},m=()=>e.id||`${o}-input`,g=()=>{if(a.label||e.label)return u("label",{class:x("label"),for:m()},[a.label?a.label():e.label])},b=()=>{if(e.showAction){const t=e.actionText||I("cancel");return u("div",{class:x("action"),role:"button",tabindex:0,onClick:f},[a.action?a.action():t])}},v=e=>t("blur",e),y=e=>t("focus",e),w=e=>t("clear",e),B=e=>t("clickInput",e),C=e=>t("clickLeftIcon",e),S=e=>t("clickRightIcon",e),V=Object.keys(k),z=()=>{const o=r({},n,_(e,V),{id:m()});return u(q,d({ref:c,type:"search",class:x("field"),border:!1,onBlur:v,onFocus:y,onClear:w,onKeypress:p,onClickInput:B,onClickLeftIcon:C,onClickRightIcon:S,"onUpdate:modelValue":e=>t("update:modelValue",e)},o),_(a,["left-icon","right-icon"]))};return i({focus:()=>{var e;return null==(e=c.value)?void 0:e.focus()},blur:()=>{var e;return null==(e=c.value)?void 0:e.blur()}}),()=>{var t;return u("div",{class:x({"show-action":e.showAction}),style:{background:e.background}},[null==(t=a.left)?void 0:t.call(a),u("div",{class:x("content",e.shape)},[g(),z()]),b()])}}});const C=f(B),S={"m-search":"_m-search_1oqt0_1",default:"_default_1oqt0_22",white:"_white_1oqt0_25",transparent:"_transparent_1oqt0_28",searchBtn:"_searchBtn_1oqt0_40"},V=""+new URL("icon-search-d43eb2c3.svg",t.meta.url).href;e("M",c({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:V},inputBackground:{type:String,default:"default"}},emits:["search","focus","blur"],setup(e,{slots:t,emit:a}){const r=p({search:e.modelValue||""});return m((()=>e.modelValue),(()=>{r.search=e.modelValue})),()=>u(C,{class:[S["m-search"],S[e.inputBackground]],shape:e.shape,background:e.background,placeholder:e.placeholder,disabled:e.disabled,autofocus:e.autofocus,autocomplete:"off",clearable:e.clearable,modelValue:r.search,"onUpdate:modelValue":e=>r.search=e,clearTrigger:"always",onClear:()=>{console.log("clear"),r.search="",a("search",r.search)},onFocus:()=>a("focus"),onBlur:()=>a("blur",r.search),onSearch:()=>a("search",r.search)},{left:()=>t.left&&t.left(),"left-icon":()=>u(g,{name:e.searchIcon,class:S.leftIcon},null),"right-icon":()=>u(b,{disabled:e.disabled,class:S.searchBtn,round:!0,type:"primary",size:"mini",onClick:()=>a("search",r.search)},{default:()=>[v("搜索")]})})}}))}}}));
