1import R from"./Icon.da05d890.js";import{e as A,a as G,b as J}from"./entry.0d7d2bc0.js";import{d as j,o as q,b as L,c as h,w as $,D as s,E as r,H as y,x as n,P as w,M as c,N as g,V as C,_ as M,ae as O,i as I,ac as k,F as Q,I as W,J as X,C as V,$ as Y,G as D,R as p}from"./swiper-vue.8a5bbbde.js";const Z=["type","placeholder","disabled"],_={key:1,class:"swap ml-1"},ee={key:0,class:"select-none"},le=j({__name:"TextField",props:{modelValue:null,label:null,placeholder:null,bgColor:null,type:null,width:null,append:null,clear:{type:Boolean},rounded:{type:Boolean},readonly:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},autoFocus:{type:Boolean},hint:null,hideHint:{type:Boolean},size:null,rules:null},emits:["update:modelValue","change","blur","focus","clear"],setup(e,{expose:H,emit:u}){const a=e,{onEnter:P,INPUT:v,errMsg:d,validate:f,resetValidation:T,focus:K,localValue:o}=A(a);q(()=>{var l;a.autoFocus&&((l=v.value)==null||l.focus())});const m=L(!1),b=l=>{var t;return a.readonly&&((t=l==null?void 0:l.preventDefault)==null?void 0:t.call(l))},B=h(()=>{switch(a.size){case"xs":return"input-xs";case"sm":return"input-sm";case"md":return"input-md";case"lg":return"input-lg";default:return"input-md"}});$(()=>o.value,l=>{d.value=""});const F=h(()=>d.value||a.hint),z=h(()=>/^#(?:[0-9a-fA-F]{3,4}){1,2}$/i.test(a.bgColor));$(()=>a.modelValue,()=>{o.value=a.modelValue});const N=()=>{var l;u("update:modelValue",null),o.value=null,u("clear"),(l=v.value)==null||l.focus()},S=l=>{u("change",o.value),f()},U=l=>{f(o.value),u("blur",l)};return H({validate:f,resetValidation:T,doClear:N,focus:K}),(l,t)=>{const x=R,E=G;return s(),r("div",{style:D({width:isNaN(Number(e.width))?e.width:`${e.width}px`}),class:"input-item"},[e.label?(s(),r("span",{key:0,class:y([{"text-secondary-200":!n(d),"text-error":!!n(d),"ml-1":!e.rounded,"ml-2":e.size==="sm","ml-4":e.rounded&&e.size!=="sm","mb-3":!e.hideHint,"text-sm":e.size==="sm"},"pb-1"])},w(e.label),3)):c("",!0),g("div",{class:y(["input_wrapper input input-bordered",{"input-error":!!n(d),"input-disabled":e.disabled,"rounded-full":e.rounded,[e.bgColor]:!n(z),[n(B)]:n(B)}]),style:D(e.bgColor&&n(z)?{backgroundColor:e.bgColor}:{})},[C(l.$slots,"prepend",{},void 0,!0),M(g("input",{ref_key:"INPUT",ref:v,"onUpdate:modelValue":t[0]||(t[0]=i=>I(o)?o.value=i:null),onInput:t[1]||(t[1]=i=>u("update:modelValue",n(o))),onKeydown:[b,t[2]||(t[2]=k(p(()=>{},["prevent"]),["enter"]))],onKeypress:[b,t[3]||(t[3]=k(p(()=>{},["prevent"]),["enter"]))],onKeyup:[b,t[4]||(t[4]=k(p(i=>n(P)(),["prevent"]),["enter"]))],onChange:S,onBlur:U,onFocus:t[5]||(t[5]=i=>u("focus")),type:n(m)?"text":e.type,placeholder:e.placeholder,disabled:e.disabled,class:y(["text-field__input",{readonly:e.readonly,"opacity-0":e.loading}])},null,42,Z),[[O,n(o)]]),e.clear?(s(),r(Q,{key:0},[n(o)!==null?(s(),W(E,{key:0,onClick:N,ghost:"",circle:"",size:"sm",disabled:e.disabled},{default:X(()=>[V(x,{name:"heroicons-outline:x",class:"h-6 w-6"})]),_:1},8,["disabled"])):c("",!0)],64)):c("",!0),a.type==="password"?(s(),r("label",_,[M(g("input",{type:"checkbox","onUpdate:modelValue":t[6]||(t[6]=i=>I(m)?m.value=i:null)},null,512),[[Y,n(m)]]),V(x,{name:"heroicons-outline:eye-on",class:"swap-on h-6 w-6"}),V(x,{name:"heroicons-outline:eye-off",class:"swap-off h-6 w-6"})])):c("",!0),C(l.$slots,"append",{},()=>[e.append?(s(),r("span",ee,w(e.append),1)):c("",!0)],!0)],6),C(l.$slots,"append-outside",{},void 0,!0),e.hideHint?c("",!0):(s(),r("div",{key:1,onClick:t[7]||(t[7]=p(()=>{},["stop"])),class:y(["h-fit text-xs text-secondary-100 mt-1",{"opacity-0":!n(F),"text-error":!!n(d),"ml-1":!e.rounded,"ml-4":e.rounded}])},w(n(F)||"\u200C"),3))],4)}}});const ae=J(le,[["__scopeId","data-v-828cca78"]]);export{ae as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.