Viewing File: /usr/local/cpanel/base/frontend/jupiter/koality/_nuxt/BBOQFEVZ.js

import{ao as w,aq as z,bT as y,bU as S,A as V,aE as j,bV as B,i as P,o,c as C,w as q,b as g,D as i,e as p,a as D,k as n,ag as d,l as f,t as m,p as h,ai as N,s as v,at as x,bW as I,bX as W,bY as E}from"./EJiqiqZX.js";import{L as F}from"./lBS7YjNH.js";const K={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",orientation:"vertical"}},O=["id"],A=["id"],L=["id"],T=["id"],G={__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},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(t){const e=t,l=w(),k=z(),a=v(()=>x({extend:x(K),...k.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),$=y(S,null),s=v(()=>e.error||$?.value?.find(r=>r.name===e.name||e.errorPattern&&r.name?.match(e.errorPattern))?.message),u=V(j()),c=u.value,b=y(B,void 0);return P(u,()=>{b&&e.name&&(b.value[e.name]={id:u.value,pattern:e.errorPattern})},{immediate:!0}),I(W,u),I(E,v(()=>({error:s.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:c}))),(r,U)=>(o(),C(n(N),{as:t.as,"data-orientation":t.orientation,"data-slot":"root",class:i(a.value.root({class:[e.ui?.root,e.class]}))},{default:q(()=>[g("div",{"data-slot":"wrapper",class:i(a.value.wrapper({class:e.ui?.wrapper}))},[t.label||l.label?(o(),p("div",{key:0,"data-slot":"labelWrapper",class:i(a.value.labelWrapper({class:e.ui?.labelWrapper}))},[D(n(F),{for:u.value,"data-slot":"label",class:i(a.value.label({class:e.ui?.label}))},{default:q(()=>[d(r.$slots,"label",{label:t.label},()=>[f(m(t.label),1)])]),_:3},8,["for","class"]),t.hint||l.hint?(o(),p("span",{key:0,id:`${n(c)}-hint`,"data-slot":"hint",class:i(a.value.hint({class:e.ui?.hint}))},[d(r.$slots,"hint",{hint:t.hint},()=>[f(m(t.hint),1)])],10,O)):h("",!0)],2)):h("",!0),t.description||l.description?(o(),p("p",{key:1,id:`${n(c)}-description`,"data-slot":"description",class:i(a.value.description({class:e.ui?.description}))},[d(r.$slots,"description",{description:t.description},()=>[f(m(t.description),1)])],10,A)):h("",!0)],2),g("div",{class:i([(t.label||!!l.label||t.description||!!l.description)&&a.value.container({class:e.ui?.container})])},[d(r.$slots,"default",{error:s.value}),e.error!==!1&&(typeof s.value=="string"&&s.value||l.error)?(o(),p("div",{key:0,id:`${n(c)}-error`,"data-slot":"error",class:i(a.value.error({class:e.ui?.error}))},[d(r.$slots,"error",{error:s.value},()=>[f(m(s.value),1)])],10,L)):t.help||l.help?(o(),p("div",{key:1,id:`${n(c)}-help`,"data-slot":"help",class:i(a.value.help({class:e.ui?.help}))},[d(r.$slots,"help",{help:t.help},()=>[f(m(t.help),1)])],10,T)):h("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}};export{G as _};
Back to Directory File Manager