1import{D as e,E as t,Ht as n,J as r,Lt as i,On as a,Pt as o,Zn as s,_ as c,b as l,g as u,gt as d,mt as f,qt as p,tr as m,v as h,vn as g,xt as _,y as v}from"./DTnvIjeT.js";import{t as y}from"./B4kuXVpu.js";import{n as b,t as x}from"./CcHx_sWp2.js";import{t as S}from"./_7hCNplN2.js";import{t as C}from"./BiJQShT4.js";import{c as w,i as T,n as E,r as D}from"./DgF6ZRjU2.js";var O={slots:{root:``,wrapper:``,labelWrapper:`flex content-center items-center justify-between gap-1`,label:`block font-medium text-default`,container:`relative`,description:`text-muted`,error:`mt-2 text-error`,hint:`text-muted`,help:`mt-2 text-muted`},variants:{size:{xs:{root:`text-xs`},sm:{root:`text-xs`},md:{root:`text-sm`},lg:{root:`text-sm`},xl:{root:`text-base`}},required:{true:{label:`after:content-['*'] after:ms-0.5 after:text-error`}},orientation:{vertical:{container:`mt-1`},horizontal:{root:`flex justify-between place-items-baseline gap-2`}}},defaultVariants:{size:`md`}},k=[`id`],A=[`id`],j=[`id`],M=[`id`],N={__name:`UFormField`,props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1,default:`vertical`},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(N){let P=N,F=i(),I=b(`formField`,P),L=y(),R=u(()=>x({extend:O,...L.ui?.formField||{}})({size:I.size,required:I.required,orientation:I.orientation})),z=r(E,null),B=u(()=>I.error||z?.value?.find(e=>e.name===I.name||I.errorPattern&&e.name?.match(I.errorPattern))?.message),V=g(o()),H=V.value,U=r(T,void 0);return n(V,()=>{U&&I.name&&(U.value[I.name]={id:V.value,pattern:I.errorPattern})},{immediate:!0}),d(w,V),d(D,u(()=>({error:B.value,name:I.name,size:I.size,eagerValidation:I.eagerValidation,validateOnInputDelay:I.validateOnInputDelay,errorPattern:I.errorPattern,hint:I.hint,description:I.description,help:I.help,ariaId:H}))),(n,r)=>(f(),h(a(S),{as:a(I).as,"data-orientation":a(I).orientation,"data-slot":`root`,class:s(R.value.root({class:[a(I).ui?.root,a(I).class]}))},{default:p(()=>[c(`div`,{"data-slot":`wrapper`,class:s(R.value.wrapper({class:a(I).ui?.wrapper}))},[a(I).label||F.label?(f(),l(`div`,{key:0,"data-slot":`labelWrapper`,class:s(R.value.labelWrapper({class:a(I).ui?.labelWrapper}))},[e(a(C),{for:V.value,"data-slot":`label`,class:s(R.value.label({class:a(I).ui?.label}))},{default:p(()=>[_(n.$slots,`label`,{label:a(I).label},()=>[t(m(a(I).label),1)])]),_:3},8,[`for`,`class`]),a(I).hint||F.hint?(f(),l(`span`,{key:0,id:`${a(H)}-hint`,"data-slot":`hint`,class:s(R.value.hint({class:a(I).ui?.hint}))},[_(n.$slots,`hint`,{hint:a(I).hint},()=>[t(m(a(I).hint),1)])],10,k)):v(``,!0)],2)):v(``,!0),a(I).description||F.description?(f(),l(`p`,{key:1,id:`${a(H)}-description`,"data-slot":`description`,class:s(R.value.description({class:a(I).ui?.description}))},[_(n.$slots,`description`,{description:a(I).description},()=>[t(m(a(I).description),1)])],10,A)):v(``,!0)],2),c(`div`,{class:s([(a(I).label||!!F.label||a(I).description||!!F.description)&&R.value.container({class:a(I).ui?.container})])},[_(n.$slots,`default`,{error:B.value}),a(I).error!==!1&&(typeof B.value==`string`&&B.value||F.error)?(f(),l(`div`,{key:0,id:`${a(H)}-error`,"data-slot":`error`,class:s(R.value.error({class:a(I).ui?.error}))},[_(n.$slots,`error`,{error:B.value},()=>[t(m(B.value),1)])],10,j)):a(I).help||F.help?(f(),l(`div`,{key:1,id:`${a(H)}-help`,"data-slot":`help`,class:s(R.value.help({class:a(I).ui?.help}))},[_(n.$slots,`help`,{help:a(I).help},()=>[t(m(a(I).help),1)])],10,M)):v(``,!0)],2)]),_:3},8,[`as`,`data-orientation`,`class`]))}};export{N as t};
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.