<<<<<<<< HEAD:dist/assets/index-699a98f0.js
import{c as F,ai as b,m as h,t as L,d as k,bp as N,r as P,a2 as T,a as l,ak as f,h as D,p as O,k as U,x as K,w as M,I as j,C as q,A as z}from"./index-4228b913.js";import{f as g,F as $}from"./index-5d69dcb8.js";const[G,o,H]=F("search"),J=b({},g,{label:String,shape:h("square"),leftIcon:h("search"),clearable:L,actionText:String,background:String,showAction:Boolean});var Q=k({name:G,props:J,emits:["blur","focus","clear","search","cancel","clickInput","clickLeftIcon","clickRightIcon","update:modelValue"],setup(a,{emit:n,slots:c,attrs:t}){const s=N(),u=P(),I=()=>{c.action||(n("update:modelValue",""),n("cancel"))},m=e=>{e.keyCode===13&&(O(e),n("search",a.modelValue))},d=()=>a.id||`${s}-input`,_=()=>{if(c.label||a.label)return l("label",{class:o("label"),for:d()},[c.label?c.label():a.label])},p=()=>{if(a.showAction){const e=a.actionText||H("cancel");return l("div",{class:o("action"),role:"button",tabindex:0,onClick:I},[c.action?c.action():e])}},y=()=>{var e;return(e=u.value)==null?void 0:e.blur()},C=()=>{var e;return(e=u.value)==null?void 0:e.focus()},S=e=>n("blur",e),v=e=>n("focus",e),B=e=>n("clear",e),V=e=>n("clickInput",e),w=e=>n("clickLeftIcon",e),x=e=>n("clickRightIcon",e),R=Object.keys(g),E=()=>{const e=b({},t,f(a,R),{id:d()}),i=A=>n("update:modelValue",A);return l($,D({ref:u,type:"search",class:o("field"),border:!1,onBlur:S,onFocus:v,onClear:B,onKeypress:m,onClickInput:V,onClickLeftIcon:w,onClickRightIcon:x,"onUpdate:modelValue":i},e),f(c,["left-icon","right-icon"]))};return T({focus:C,blur:y}),()=>{var e;return l("div",{class:o({"show-action":a.showAction}),style:{background:a.background}},[(e=c.left)==null?void 0:e.call(c),l("div",{class:o("content",a.shape)},[_(),E()]),p()])}}});const W=U(Q),X="_white_15dhk_25",Y="_transparent_15dhk_28",Z="_searchBtn_15dhk_40",ee="_leftIcon_15dhk_51",r={"m-search":"_m-search_15dhk_1",default:"_default_15dhk_22",white:X,transparent:Y,searchBtn:Z,leftIcon:ee},ae=""+new URL("icon-search-d43eb2c3.svg",import.meta.url).href,te=k({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:ae},inputBackground:{type:String,default:"default"}},emits:["search","focus","blur"],setup(a,{slots:n,emit:c}){const t=K({search:a.modelValue||""});return M(()=>a.modelValue,()=>{t.search=a.modelValue}),()=>l(W,{class:[r["m-search"],r[a.inputBackground]],shape:a.shape,background:a.background,placeholder:a.placeholder,disabled:a.disabled,autofocus:a.autofocus,autocomplete:"off",clearable:a.clearable,modelValue:t.search,"onUpdate:modelValue":s=>t.search=s,clearTrigger:"always",onClear:()=>{console.log("clear"),t.search="",c("search",t.search)},onFocus:()=>c("focus"),onBlur:()=>c("blur",t.search),onSearch:()=>c("search",t.search)},{left:()=>n.left&&n.left(),"left-icon":()=>l(j,{name:a.searchIcon,class:r.leftIcon},null),"right-icon":()=>l(q,{disabled:a.disabled,class:r.searchBtn,round:!0,type:"primary",size:"mini",onClick:()=>c("search",t.search)},{default:()=>[z("搜索")]})})}});export{te as M};
========
import{c as F,ai as b,m as h,t as L,d as k,bp as N,r as P,a2 as T,a as l,ak as f,h as D,p as O,k as U,x as K,w as M,I as j,C as q,A as z}from"./index-c4313132.js";import{f as g,F as $}from"./index-4f22eedc.js";const[G,o,H]=F("search"),J=b({},g,{label:String,shape:h("square"),leftIcon:h("search"),clearable:L,actionText:String,background:String,showAction:Boolean});var Q=k({name:G,props:J,emits:["blur","focus","clear","search","cancel","clickInput","clickLeftIcon","clickRightIcon","update:modelValue"],setup(a,{emit:n,slots:c,attrs:t}){const s=N(),u=P(),I=()=>{c.action||(n("update:modelValue",""),n("cancel"))},m=e=>{e.keyCode===13&&(O(e),n("search",a.modelValue))},d=()=>a.id||`${s}-input`,_=()=>{if(c.label||a.label)return l("label",{class:o("label"),for:d()},[c.label?c.label():a.label])},p=()=>{if(a.showAction){const e=a.actionText||H("cancel");return l("div",{class:o("action"),role:"button",tabindex:0,onClick:I},[c.action?c.action():e])}},y=()=>{var e;return(e=u.value)==null?void 0:e.blur()},C=()=>{var e;return(e=u.value)==null?void 0:e.focus()},S=e=>n("blur",e),v=e=>n("focus",e),B=e=>n("clear",e),V=e=>n("clickInput",e),w=e=>n("clickLeftIcon",e),x=e=>n("clickRightIcon",e),R=Object.keys(g),E=()=>{const e=b({},t,f(a,R),{id:d()}),i=A=>n("update:modelValue",A);return l($,D({ref:u,type:"search",class:o("field"),border:!1,onBlur:S,onFocus:v,onClear:B,onKeypress:m,onClickInput:V,onClickLeftIcon:w,onClickRightIcon:x,"onUpdate:modelValue":i},e),f(c,["left-icon","right-icon"]))};return T({focus:C,blur:y}),()=>{var e;return l("div",{class:o({"show-action":a.showAction}),style:{background:a.background}},[(e=c.left)==null?void 0:e.call(c),l("div",{class:o("content",a.shape)},[_(),E()]),p()])}}});const W=U(Q),X="_white_15dhk_25",Y="_transparent_15dhk_28",Z="_searchBtn_15dhk_40",ee="_leftIcon_15dhk_51",r={"m-search":"_m-search_15dhk_1",default:"_default_15dhk_22",white:X,transparent:Y,searchBtn:Z,leftIcon:ee},ae=""+new URL("icon-search-d43eb2c3.svg",import.meta.url).href,te=k({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:ae},inputBackground:{type:String,default:"default"}},emits:["search","focus","blur"],setup(a,{slots:n,emit:c}){const t=K({search:a.modelValue||""});return M(()=>a.modelValue,()=>{t.search=a.modelValue}),()=>l(W,{class:[r["m-search"],r[a.inputBackground]],shape:a.shape,background:a.background,placeholder:a.placeholder,disabled:a.disabled,autofocus:a.autofocus,autocomplete:"off",clearable:a.clearable,modelValue:t.search,"onUpdate:modelValue":s=>t.search=s,clearTrigger:"always",onClear:()=>{console.log("clear"),t.search="",c("search",t.search)},onFocus:()=>c("focus"),onBlur:()=>c("blur",t.search),onSearch:()=>c("search",t.search)},{left:()=>n.left&&n.left(),"left-icon":()=>l(j,{name:a.searchIcon,class:r.leftIcon},null),"right-icon":()=>l(q,{disabled:a.disabled,class:r.searchBtn,round:!0,type:"primary",size:"mini",onClick:()=>c("search",t.search)},{default:()=>[z("搜索")]})})}});export{te as M};
>>>>>>>> 0f2588f61580675e1c866dc0769d4ceb917efcec:dist/assets/index-6b24a85f.js
