PluginProbe
WindPress – Tailwind CSS integration for WordPress / 3.2.91
WindPress – Tailwind CSS integration for WordPress v3.2.91
3.2.91 3.2.92 3.2.90 3.2.89 3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 All 146 releases
windpress / assets / dist / assets / FormField-BONtkd8t.js

FormField-BONtkd8t.js in WindPress – Tailwind CSS integration for WordPress 3.2.91, at assets/dist/assets/FormField-BONtkd8t.js

1 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import{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"./runtime-core.esm-bundler-DWQsayW-.js";import{C as y,H as b,S as x,b as S,c as C,f as w,o as T,s as E}from"./Button-Czvw3j-x.js";import{t as D}from"./Label-CSgyJJ_8.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:`FormField`,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=x(`formField`,P),L=b(),R=u(()=>S({extend:O,...L.ui?.formField||{}})({size:I.size,required:I.required,orientation:I.orientation})),z=r(T,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(C,void 0);return n(V,()=>{U&&I.name&&(U.value[I.name]={id:V.value,pattern:I.errorPattern})},{immediate:!0}),d(w,V),d(E,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(y),{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(D),{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};