index-legacy-f9ff88bf.js 1.8 KB

1
  1. System.register(["./index-legacy-4bc02896.js","./index-legacy-8f644dad.js"],(function(e,c){"use strict";var l,a,t,n,o,r,s,i,u,d,b,f,h,g,k;return{setters:[e=>{l=e.f,a=e.F},e=>{t=e.x,n=e.a6,o=e.C,r=e.E,s=e.d,i=e.ae,u=e.H,d=e.ad,b=e.a,f=e.az,h=e.G,g=e.aF,k=e.w}],execute:function(){const[c,p,v]=t("search"),m=n({},l,{label:String,shape:o("square"),leftIcon:o("search"),clearable:r,actionText:String,background:String,showAction:Boolean});var I=s({name:c,props:m,emits:["blur","focus","clear","search","cancel","clickInput","clickLeftIcon","clickRightIcon","update:modelValue"],setup(e,{emit:c,slots:t,attrs:o}){const r=i(),s=u(),k=()=>{t.action||(c("update:modelValue",""),c("cancel"))},m=l=>{13===l.keyCode&&(g(l),c("search",e.modelValue))},I=()=>e.id||`${r}-input`,y=()=>{if(t.label||e.label)return b("label",{"class":p("label"),"for":I()},[t.label?t.label():e.label])},x=()=>{if(e.showAction){const c=e.actionText||v("cancel");return b("div",{"class":p("action"),role:"button",tabindex:0,onClick:k},[t.action?t.action():c])}},C=e=>c("blur",e),w=e=>c("focus",e),S=e=>c("clear",e),V=e=>c("clickInput",e),j=e=>c("clickLeftIcon",e),A=e=>c("clickRightIcon",e),F=Object.keys(l),L=()=>{const l=n({},o,f(e,F),{id:I()});return b(a,h({ref:s,type:"search","class":p("field",{"with-message":l.errorMessage}),border:!1,onBlur:C,onFocus:w,onClear:S,onKeypress:m,onClickInput:V,onClickLeftIcon:j,onClickRightIcon:A,"onUpdate:modelValue":e=>c("update:modelValue",e)},l),f(t,["left-icon","right-icon"]))};return d({focus:()=>{var e;return null==(e=s.value)?void 0:e.focus()},blur:()=>{var e;return null==(e=s.value)?void 0:e.blur()}}),()=>{var c;return b("div",{"class":p({"show-action":e.showAction}),style:{background:e.background}},[null==(c=t.left)?void 0:c.call(t),b("div",{"class":p("content",e.shape)},[y(),L()]),x()])}}});e("S",k(I))}}}));