index-legacy-d070deda.js 4.9 KB

1
  1. System.register(["./index-legacy-7aaf3ce7.js","./index-legacy-3df53755.js"],(function(e,a){"use strict";var t,r,n,c,l,o,s,d,h,i,_,u,f,p,m,k,g,b,v,y;return{setters:[e=>{t=e.c,r=e.ad,n=e.m,c=e.t,l=e.d,o=e.bo,s=e.r,d=e.Z,h=e.a,i=e.af,_=e.h,u=e.p,f=e.k,p=e.x,m=e.w,k=e.I,g=e.C,b=e.A},e=>{v=e.f,y=e.F}],execute:function(){var I=document.createElement("style");I.textContent="._m-search_15dhk_1{--van-cell-background-color: transparent}._m-search_15dhk_1 input::-moz-placeholder{color:var(--k-gray-4)}._m-search_15dhk_1 input::placeholder{color:var(--k-gray-4)}._m-search_15dhk_1 .van-field__control{-webkit-user-select:text!important;-moz-user-select:text!important;user-select:text!important;font-size:.34667rem}._m-search_15dhk_1 .van-search__field{background:transparent!important;padding:0 var(--van-padding-xs) 0 0}._m-search_15dhk_1 .van-field__right-icon{display:flex;align-items:center;justify-content:center;padding-right:.10667rem}._m-search_15dhk_1._default_15dhk_22 .van-search__content{background:#f8f9fc!important}._m-search_15dhk_1._white_15dhk_25 .van-search__content{background:#fff!important}._m-search_15dhk_1._transparent_15dhk_28 .van-search__content{background:rgba(255,255,255,.16)}._m-search_15dhk_1._transparent_15dhk_28 .van-search__content input::-moz-placeholder{color:#fff}._m-search_15dhk_1._transparent_15dhk_28 .van-search__content input::placeholder{color:#fff}._m-search_15dhk_1._transparent_15dhk_28 .van-search__content input,._m-search_15dhk_1._transparent_15dhk_28 .van-search__content .van-field__clear{color:#fff}._m-search_15dhk_1 ._searchBtn_15dhk_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}._m-search_15dhk_1 ._leftIcon_15dhk_51{width:.37333rem;height:.37333rem;margin-top:-.05333rem}._m-search_15dhk_1 ._leftIcon_15dhk_51 img{width:100%;height:100%}\n",document.head.appendChild(I);const[w,x,B]=t("search"),C=r({},v,{label:String,shape:n("square"),leftIcon:n("search"),clearable:c,actionText:String,background:String,showAction:Boolean});var S=l({name:w,props:C,emits:["blur","focus","clear","search","cancel","clickInput","clickLeftIcon","clickRightIcon","update:modelValue"],setup(e,{emit:a,slots:t,attrs:n}){const c=o(),l=s(),f=()=>{t.action||(a("update:modelValue",""),a("cancel"))},p=t=>{13===t.keyCode&&(u(t),a("search",e.modelValue))},m=()=>e.id||`${c}-input`,k=()=>{if(t.label||e.label)return h("label",{class:x("label"),for:m()},[t.label?t.label():e.label])},g=()=>{if(e.showAction){const a=e.actionText||B("cancel");return h("div",{class:x("action"),role:"button",tabindex:0,onClick:f},[t.action?t.action():a])}},b=e=>a("blur",e),I=e=>a("focus",e),w=e=>a("clear",e),C=e=>a("clickInput",e),S=e=>a("clickLeftIcon",e),V=e=>a("clickRightIcon",e),z=Object.keys(v),F=()=>{const c=r({},n,i(e,z),{id:m()});return h(y,_({ref:l,type:"search",class:x("field"),border:!1,onBlur:b,onFocus:I,onClear:w,onKeypress:p,onClickInput:C,onClickLeftIcon:S,onClickRightIcon:V,"onUpdate:modelValue":e=>a("update:modelValue",e)},c),i(t,["left-icon","right-icon"]))};return d({focus:()=>{var e;return null==(e=l.value)?void 0:e.focus()},blur:()=>{var e;return null==(e=l.value)?void 0:e.blur()}}),()=>{var a;return h("div",{class:x({"show-action":e.showAction}),style:{background:e.background}},[null==(a=t.left)?void 0:a.call(t),h("div",{class:x("content",e.shape)},[k(),F()]),g()])}}});const V=f(S),z={"m-search":"_m-search_15dhk_1",default:"_default_15dhk_22",white:"_white_15dhk_25",transparent:"_transparent_15dhk_28",searchBtn:"_searchBtn_15dhk_40",leftIcon:"_leftIcon_15dhk_51"},F=""+new URL("icon-search-d43eb2c3.svg",a.meta.url).href;e("M",l({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:F},inputBackground:{type:String,default:"default"}},emits:["search","focus","blur"],setup(e,{slots:a,emit:t}){const r=p({search:e.modelValue||""});return m((()=>e.modelValue),(()=>{r.search=e.modelValue})),()=>h(V,{class:[z["m-search"],z[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="",t("search",r.search)},onFocus:()=>t("focus"),onBlur:()=>t("blur",r.search),onSearch:()=>t("search",r.search)},{left:()=>a.left&&a.left(),"left-icon":()=>h(k,{name:e.searchIcon,class:z.leftIcon},null),"right-icon":()=>h(g,{disabled:e.disabled,class:z.searchBtn,round:!0,type:"primary",size:"mini",onClick:()=>t("search",r.search)},{default:()=>[b("搜索")]})})}}))}}}));