1import{_ as N}from"./rtrfU26z.js";import{d as Y,V as H,z as L,r as y,c as r,al as P,Z as W,$ as Z,Y as j,o as q,m as G,p as J,w as p,l as o,g as h,W as v,ak as V,aV as O,f as S,n as K,b7 as Q,a4 as l}from"./Bb7NlLQg.js";const $=u=>{u.style.height="0",u.style.height=`${u.scrollHeight+2}px`},X={mounted:$,updated:$},ee=["name","placeholder","autofocus","readonly","disabled","rows"],ae=["name","type","placeholder","min","max","maxlength","step","autofocus","readonly","disabled"],oe=Y({__name:"index",props:{modelValue:{},name:{},type:{},validation:{},label:{},placeholder:{},size:{},rows:{default:2},unit:{},disabled:{type:Boolean},loading:{type:Boolean},readonly:{type:Boolean},inline:{type:Boolean},transparent:{type:Boolean},autofocus:{type:Boolean},indent:{type:Boolean,default:void 0},border:{type:Boolean,default:void 0},mask:{},debounce:{},maxlength:{},min:{default:0},max:{},step:{},hint:{}},emits:["change","focus","blur","keydown","keyup","update:modelValue"],setup(u,{expose:z,emit:C}){const e=u,s=C,c=H(),{$isTabSwitch:M}=L(),d=y(null),g=a=>{s("update:modelValue",a),s("change",a)},A=P(),b=y(""),m=y(!1),n=r({get(){return m.value?b.value:e.modelValue},set(a){e.debounce?(b.value=a,m.value=!0,A(()=>{g(a),m.value=!1},e.debounce)):g(a)}}),{errorMessage:D,validate:T,handleChange:E}=W(e.name,Z(e,"validation"),{initialValue:n.value});j(n,a=>E(a));const I=r(()=>!!(e.placeholder||n.value||n.value===0)),i=r(()=>e.type==="number"),x=r(()=>e.type==="textarea"),k=()=>{s("blur"),i.value&&n.value===""&&(n.value=void 0)},R=()=>{M.value||s("focus")},w=()=>{var a;(a=d.value)==null||a.focus()},U=()=>{var a;(a=d.value)==null||a.blur()},B=a=>{if(i.value){const t=a.code||a.key;([l.Minus,l.KeyE].includes(t)||n.value&&e.maxlength&&String(n.value).length>=e.maxlength&&!([l.Backspace,l.ArrowLeft,l.ArrowRight].includes(t)||a.metaKey)||(e.step||0)>=1&&[l.Period,l.Comma].includes(t))&&a.preventDefault()}s("keydown",a)},_=a=>{if(i.value){const t=n.value;(t||t===0)&&typeof t=="number"&&(t<e.min&&(n.value=e.min),e.max&&t>e.max&&(n.value=e.max)),t&&e.maxlength&&String(t).length>=e.maxlength&&(n.value=String(t).substr(0,e.maxlength))}s("keyup",a)};return q(()=>{e.autofocus&&setTimeout(w,500)}),z({focus:w,blur:U,validate:T}),(a,t)=>{const F=N;return h(),G(F,{name:e.name,label:e.label,unit:e.unit,loading:e.loading,filled:o(I),inline:e.inline,transparent:e.transparent,disabled:e.disabled,indent:e.indent,border:e.border,size:e.size,rows:e.rows,hint:e.hint,"error-message":o(D),textarea:o(x),class:"ui-input"},J({default:p(()=>[o(x)?V((h(),S("textarea",{key:0,ref_key:"refInput",ref:d,"onUpdate:modelValue":t[0]||(t[0]=f=>K(n)?n.value=f:null),name:e.name,placeholder:e.placeholder,autofocus:e.autofocus,readonly:e.readonly,disabled:e.disabled,rows:e.rows,"data-test":"input",onBlur:k,onKeydown:B,onKeyup:_},null,40,ee)),[[O,o(n)],[o(X)]]):V((h(),S("input",{key:1,ref_key:"refInput",ref:d,"onUpdate:modelValue":t[1]||(t[1]=f=>K(n)?n.value=f:null),name:e.name,type:e.type,placeholder:e.placeholder,min:o(i)?e.min:void 0,max:o(i)?e.max:void 0,maxlength:e.maxlength,step:e.step,autofocus:e.autofocus,readonly:e.readonly,disabled:e.disabled,autocomplete:"off","data-test":"input",lang:"en-US",onBlur:k,onFocus:R,onKeydown:B,onKeyup:_},null,40,ae)),[[Q,o(n)]])]),_:2},[o(c).prepend?{name:"prepend",fn:p(()=>[v(a.$slots,"prepend")]),key:"0"}:void 0,o(c).append?{name:"append",fn:p(()=>[v(a.$slots,"append")]),key:"1"}:void 0,o(c).unit?{name:"unit",fn:p(()=>[v(a.$slots,"unit")]),key:"2"}:void 0]),1032,["name","label","unit","loading","filled","inline","transparent","disabled","indent","border","size","rows","hint","error-message","textarea"])}}});export{oe as _};
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.