import{_ as p}from"./C1ENETdz.js";import{d as f,m as u,g as c,r as b,p as v,q as y,i as B,o as r,b as k,j as x,c as V,e as $,v as g,f as M,k as w}from"./DnBXlrVC.js";const N={class:"flex flex items-center border n-border-base rounded py-1 n-bg-base n-text-input pl-1 pr-2 focus-within:n-focus-base focus-within:border-context"},C=f({__name:"NTextInput",props:u({modelValue:{default:""},icon:{},placeholder:{},disabled:{type:Boolean},autofocus:{type:Boolean},autocomplete:{},readonly:{type:Boolean},type:{default:"text"}},{modelValue:{required:!0,default:""},modelModifiers:{}}),emits:u(["blur","focus","input"],["update:modelValue"]),setup(s,{emit:i}){const m=s,n=i,l=c(s,"modelValue"),a=b();return v(()=>{m.autofocus&&y(()=>{a.value.focus()})}),(o,e)=>{const d=p;return r(),B("div",N,[k(o.$slots,"icon",{},()=>[o.icon?(r(),V(d,{key:0,icon:o.icon,class:"op50 ml-0.3em mr-0.1em text-1.1em"},null,8,["icon"])):$("",!0)]),x(M("input",w({ref_key:"inputRef",ref:a,"onUpdate:modelValue":e[0]||(e[0]=t=>l.value=t)},o.$props,{class:"w-full flex-auto n-bg-base !outline-none ml-0.4em",onBlur:e[1]||(e[1]=t=>n("blur")),onFocus:e[2]||(e[2]=t=>n("focus")),onInput:e[3]||(e[3]=t=>n("input"))}),null,16),[[g,l.value]])])}}});export{C as _};
