ynotsoft-dynamic-form 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +47 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/package.json +23 -7
- package/dist/MyButton.cjs +0 -2
- package/dist/MyButton.cjs.map +0 -1
- package/dist/MyButton.js +0 -2
- package/dist/MyButton.js.map +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var tt=Object.create;var J=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var nt=(e,r)=>{for(var c in r)J(e,c,{get:r[c],enumerable:!0})},me=(e,r,c,h)=>{if(r&&typeof r=="object"||typeof r=="function")for(let d of rt(r))!st.call(e,d)&&d!==c&&J(e,d,{get:()=>r[d],enumerable:!(h=ot(r,d))||h.enumerable});return e};var I=(e,r,c)=>(c=e!=null?tt(at(e)):{},me(r||!e||!e.__esModule?J(c,"default",{value:e,enumerable:!0}):c,e)),lt=e=>me(J({},"__esModule",{value:!0}),e);var Rt={};nt(Rt,{DynamicForm:()=>ae,DynamicFormComponent:()=>ae,MyButton:()=>Q,MyButtonComponent:()=>Q,default:()=>Ft});module.exports=lt(Rt);var ue=require("react/jsx-runtime");function Q({children:e,onClick:r}){return(0,ue.jsx)("button",{onClick:r,children:e})}var M=require("react"),Ze=require("react-hot-toast"),de=I(require("dayjs"),1);var be=I(require("axios"),1),Z=I(require("react-hot-toast"),1);var pe={REACT_API_URL:"http://localhost:5000/"};var ge=be.default.create({baseURL:pe.REACT_API_URL,headers:{"Content-Type":"application/json"}});ge.interceptors.response.use(e=>e.data,e=>{var r;if(e.response&&e.response.status===403)return Z.default.error("You are not authorized to access this resource."),Promise.reject("You are not authorized to access this resource.");if(e.response)return Z.default.error("An error occurred"),Promise.reject(((r=e.response.data)==null?void 0:r.message)||"An error occurred");Z.default.error(e.message)});var he=ge;var fe=require("react/jsx-runtime");function it(e){return(0,fe.jsx)("input",{type:"hidden",name:e.name,value:e.value},e.name)}var xe=it;var ye=I(require("react-select"),1),ve=I(require("react-select/animated"),1),Ne=require("react/jsx-runtime");function ct({field:e,formValues:r,handleChange:c,touched:h,errors:d,handleBlur:a}){let l=e.disabled&&e.disabled(r),p=e.options||[],s=(0,ve.default)(),b=r[e.name]||[];return(0,Ne.jsx)(ye.default,{components:s,isMulti:!0,isDisabled:l,name:e.label,value:b,onChange:v=>c(e.name,v),options:p,placeholder:e.placeholder,closeMenuOnSelect:!1})}var we=ct;var g=I(require("@radix-ui/react-select"),1),At=require("react"),ke=require("@heroicons/react/20/solid"),w=require("react/jsx-runtime");function dt({field:e,formValues:r,handleChange:c,handleBlur:h}){var p;let d=r[e.name]||"",a=typeof e.disabled=="function"?e.disabled(r):e.disabled,l=e.options||[];return(0,w.jsxs)(g.Root,{value:d,onValueChange:s=>c(e.name,s),disabled:a,children:[(0,w.jsxs)(g.Trigger,{id:e.name,onBlur:()=>h(e.name),className:`inline-flex items-center justify-between w-full px-3 py-2 border rounded-md text-sm transition-all
|
|
2
|
+
${a?"bg-gray-100 text-gray-500 cursor-not-allowed":"border-gray-300 hover:border-gray-400 focus:ring-2 focus:ring-blue-500"}
|
|
3
|
+
`,children:[(0,w.jsx)(g.Value,{placeholder:e.placeholder||`Select ${((p=e.label)==null?void 0:p.toLowerCase())||""}`}),(0,w.jsx)(g.Icon,{className:"ml-2 text-gray-500",children:(0,w.jsx)(ke.ChevronDownIcon,{className:"w-4 h-4"})})]}),(0,w.jsx)(g.Portal,{children:(0,w.jsxs)(g.Content,{className:"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]",position:"popper",sideOffset:5,children:[(0,w.jsx)(g.ScrollUpButton,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:(0,w.jsx)(g.Arrow,{className:"fill-white stroke-gray-200"})}),(0,w.jsxs)(g.Viewport,{className:"p-1",children:[e.groupLabel&&(0,w.jsx)(g.Group,{children:(0,w.jsx)(g.Label,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),l.map(s=>(0,w.jsx)(g.Item,{value:s.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
|
|
4
|
+
data-[state=checked]:bg-blue-50
|
|
5
|
+
data-[state=checked]:text-blue-600
|
|
6
|
+
`,children:(0,w.jsx)(g.ItemText,{children:s.label})},s.value)),e.separator&&(0,w.jsx)(g.Separator,{className:"my-1 h-px bg-gray-200"})]}),(0,w.jsx)(g.Arrow,{className:"fill-white stroke-gray-200"})]})})]})}var Ce=dt;var zt=require("react"),Fe=require("react/jsx-runtime");function mt({field:e,formValues:r,handleChange:c,handleBlur:h,touched:d,errors:a}){let l=e.readOnly&&e.disabled;return(0,Fe.jsx)("input",{...e.props,type:"email",value:r[e.name]||"",onChange:s=>c(e.name,s.target.value),onBlur:()=>h(e.name),disabled:l,name:e.name,placeholder:e.placeholder,className:`w-full px-3 py-2 border rounded-md ${!1?"border-red-500":"border-gray-300"} ${l?"bg-gray-100 text-gray-500 cursor-not-allowed":""}`})}var Se=mt;var _t=require("react"),Re=require("react/jsx-runtime");function ut({field:e,formValues:r,handleChange:c,handleBlur:h,touched:d,errors:a}){console.log("Rendering InputField for",e);let l=e.readOnly||e.disabled;return(0,Re.jsx)("input",{...e.props,id:e.name,type:e.type||"text",value:r[e.name]||"",onChange:s=>c(e.name,s.target.value),onBlur:()=>h(e.name),disabled:l,name:e.name,placeholder:e.placeholder,min:e.minLength,max:e.maxLength,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${!1?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${l?"bg-gray-50 text-gray-500":"bg-background"}`})}var ne=ut;var Gt=require("react"),le=require("react/jsx-runtime");function pt({field:e,formValues:r}){let c=r[e.name]||e.content||"";return(0,le.jsx)("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,id:e.name.toLowerCase()+"_id",children:(0,le.jsx)("div",{className:"w-full px-3 py-2 border rounded-md overflow-y-auto max-h-40 prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:c}})},e.name)}var Pe=pt;var D=require("react/jsx-runtime");function bt({field:e,formValues:r,handleChange:c,handleBlur:h,touched:d,errors:a}){let l=e.disabled&&e.disabled(r),p=!1;return(0,D.jsxs)("div",{className:"mt-1 space-x-2",children:[(0,D.jsx)("input",{...e.props,id:"id_"+e.name,type:"checkbox",checked:r[e.name]||!1,onChange:s=>c(e.name,s.target.checked),onBlur:()=>h(e.name),disabled:l,className:`rounded border-gray-300 ${l?"opacity-50 cursor-not-allowed":""}`}),(0,D.jsxs)("label",{className:"",htmlFor:"id_"+e.name,children:[e.label,e.required&&(0,D.jsx)("span",{className:"text-red-500",children:"*"})]}),p&&(0,D.jsx)("p",{className:"mt-1 text-sm text-red-500",children:p})]})}var Le=bt;var _=I(require("@radix-ui/react-popover"),1),$e=require("react"),Ie=require("react-day-picker"),qt=require("react-day-picker/dist/style.css"),S=require("react/jsx-runtime");function gt({field:e,formValues:r,handleChange:c,handleBlur:h}){let[d,a]=(0,$e.useState)(!1),l=r[e.name]??{from:null,to:null},p=b=>c(e.name,b),s=()=>c(e.name,{from:null,to:null});return(0,S.jsx)("div",{children:(0,S.jsxs)(_.Root,{open:d,onOpenChange:a,children:[(0,S.jsx)(_.Trigger,{asChild:!0,children:(0,S.jsxs)("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":d,onClick:()=>a(!0),onKeyDown:b=>b.key==="Enter"&&a(!0),className:`
|
|
7
|
+
inline-flex items-center justify-between gap-2
|
|
8
|
+
w-full h-9 rounded-md border border-gray-300 bg-white
|
|
9
|
+
px-3 py-2 text-sm font-normal shadow-sm
|
|
10
|
+
hover:bg-gray-50 hover:text-gray-900
|
|
11
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2
|
|
12
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
13
|
+
`,children:[l.from?l.to?(0,S.jsxs)("span",{children:[l.from.toLocaleDateString()," \u2013 ",l.to.toLocaleDateString()]}):(0,S.jsx)("span",{children:l.from.toLocaleDateString()}):(0,S.jsx)("span",{className:"text-muted-foreground",children:e.placeholder||"Select date range"}),(0,S.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-down opacity-70",children:(0,S.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}),(0,S.jsxs)(_.Content,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[(0,S.jsx)(Ie.DayPicker,{mode:"range",selected:l,onSelect:p,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),(0,S.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[(0,S.jsx)("button",{type:"button",onClick:s,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),(0,S.jsx)("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})]})})}var Ee=gt;var Jt=require("react"),ie=require("react-hot-toast");var Me={apiBaseUrl:process.env.API_BASE_URL||""};var x=require("react/jsx-runtime");function ht({field:e,formValues:r,touched:c,errors:h,fileUploads:d,setFileUploads:a,fileInputRefs:l,handleChange:p,onFieldsChange:s}){let b=c[e.name]&&h[e.name],v=e.type==="multifile",P=d[e.name]||{},C=r[e.name],B=v?C||[]:[C].filter(Boolean),L=e.disabled&&e.disabled(r),O=`px-4 py-2 bg-gray-100 border rounded hover:bg-gray-200 ${L?"cursor-not-allowed":""}`,V=`${Me.REACT_API_URL}uploads`,A=i=>{if(i===0)return"0 Bytes";let t=1024,o=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(i)/Math.log(t));return parseFloat((i/Math.pow(t,n)).toFixed(2))+" "+o[n]},U=async(i,t)=>{let o=new FormData;o.append("file",i);let n=await fetch(`${V}`,{method:"POST",body:o});if(!n.ok)throw ie.toast.error("Upload failed"),new Error("Upload failed");return await n.json()},f=async(i,t)=>{if(!t)return;if(i.maxSize&&t.size>i.maxSize)throw new Error(`File size must not exceed ${A(i.maxSize)}`);let o=await U(t,i.name),n={...r,[i.name]:o};p(i.name,o),s(n)},$=async(i,t)=>{let o=r[i.name]||[];if(o.length+t.length>i.maxFiles)throw new Error(`Maximum ${i.maxFiles} files allowed`);t.forEach(k=>{if(i.maxSize&&k.size>i.maxSize)throw new Error(`Each file must not exceed ${A(i.maxSize)}`)});let n=await Promise.all(t.map(k=>U(k,i.name))),m=[...o,...n];p(i.name,m),s({...r,[i.name]:m})},X=async(i,t)=>{let o=Array.from(t);try{e.type==="file"?await f(e,o[0]):e.type==="multifile"&&await $(e,o),l.current[i]&&(l.current[i].value="")}catch(n){ie.toast.error(`Upload failed: ${n.message}`)}},se=async(i,t)=>{let o;e.type==="file"?o="":o=(r[i]||[]).filter(m=>m!==t),p(i,o),s({...r,[i]:o}),l.current[i]&&(l.current[i].value="")};return(0,x.jsxs)("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:[(0,x.jsxs)("label",{className:"block font-medium mb-1",children:[e.label,e.required&&(0,x.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsxs)("div",{className:"items-center space-x-2",children:[(0,x.jsxs)("button",{type:"button",disabled:L,onClick:()=>l.current[e.name].click(),className:O,children:["Choose ",v?"Files":"File"]}),v&&B.length>0&&(0,x.jsxs)("span",{className:"text-sm text-gray-600",children:[B.length," of ",e.maxFiles," files uploaded"]})]}),(0,x.jsx)("input",{ref:i=>l.current[e.name]=i,type:"file",accept:e.accept,multiple:v,className:"hidden",onChange:i=>X(e.name,i.target.files)}),(0,x.jsx)("div",{className:"space-y-2",children:B.map((i,t)=>{let o=Object.values(P).find(n=>n.file===i);return(0,x.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[(0,x.jsxs)("div",{className:"flex items-center space-x-2",children:[o&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{className:"text-sm",children:o.fileName}),(0,x.jsxs)("span",{className:"text-xs text-gray-500",children:["(",A(o.fileSize),")"]})]}),!o&&(0,x.jsx)("span",{className:"text-sm",children:i.original_name})]}),(0,x.jsx)("button",{type:"button",onClick:()=>se(e.name,i),className:"text-red-500 hover:text-red-700 ml-3",children:"Remove"})]},i)})}),Object.entries(P).map(([i,t])=>t.status==="uploading"?(0,x.jsxs)("div",{className:"relative pt-1",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsxs)("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",i]}),(0,x.jsxs)("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[t.progress,"%"]})]}),(0,x.jsx)("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:(0,x.jsx)("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${t.progress}%`}})})]},i):null)]}),b&&(0,x.jsx)("p",{className:"mt-1 text-sm text-red-500",children:b})]},e.name)}var ce=ht;var ee=require("react"),j=require("react/jsx-runtime");function xt({field:e,formValues:r,handleChange:c,handleBlur:h,touched:d,errors:a,charCount:l,setCharCounts:p}){let s=(0,ee.useRef)(null),b=r[e.name]||"",v=typeof e.disabled=="function"?e.disabled(r):e.disabled||e.readOnly,P=d!=null&&d[e.name]&&(a!=null&&a[e.name])?a[e.name]:null,C=()=>{let L=s.current;L&&(L.style.height="auto",L.style.height=`${L.scrollHeight+2}px`)};(0,ee.useEffect)(()=>{C()},[b]);let B=L=>{c(e.name,L.target.value),C(),p&&p(O=>({...O,[e.name]:L.target.value.length}))};return(0,j.jsxs)("div",{className:"space-y-2",children:[(0,j.jsx)("textarea",{...e.props,ref:s,id:e.name,name:e.name,placeholder:e.placeholder||"",value:b,onChange:B,onBlur:()=>h(e.name),disabled:v,maxLength:e.maxLength,rows:e.rows||3,className:`flex w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none overflow-y-auto ${P?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${v?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),(0,j.jsx)("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&(0,j.jsxs)("span",{className:"text-xs text-gray-500",children:[l||0,"/",e.maxLength," characters"]})})]})}var Be=xt;var Ae=require("@mui/x-date-pickers"),ro=require("react"),De=require("@mui/x-date-pickers/AdapterDayjs"),Te=require("@mui/x-date-pickers/DateTimeField"),te=require("react/jsx-runtime");function ft({field:e,formValues:r,handleChange:c,handleBlur:h,touched:d,errors:a}){return(0,te.jsx)("div",{children:(0,te.jsx)(Ae.LocalizationProvider,{dateAdapter:De.AdapterDayjs,adapterLocale:"aus",children:(0,te.jsx)(Te.DateTimeField,{value:e.value,onChange:l=>c(e.name,l)})})})}var ze=ft;var oe=require("@radix-ui/react-separator"),T=require("react/jsx-runtime");function yt({field:e}){return e!=null&&e.label?(0,T.jsxs)("div",{className:"relative flex items-center py-4",children:[(0,T.jsx)(oe.Separator,{className:"flex-1 h-px bg-gray-300"}),(0,T.jsx)("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),(0,T.jsx)(oe.Separator,{className:"flex-1 h-px bg-gray-300"})]}):(0,T.jsx)(oe.Separator,{className:"my-4 h-px bg-gray-300"})}var Oe=yt;var lo=require("react"),H=I(require("@radix-ui/react-radio-group"),1),E=require("react/jsx-runtime");function vt({field:e,formValues:r,handleChange:c,handleBlur:h}){let d=r[e.name]||"",a=typeof e.disabled=="function"?e.disabled(r):e.disabled,l=e.options||[],p=e.inline||!1;return(0,E.jsx)(H.Root,{value:d,onValueChange:s=>c(e.name,s),onBlur:()=>h(e.name),disabled:a,className:p?"flex flex-wrap gap-4":"space-y-3","aria-label":e.label||e.name,children:l.map(s=>{let b=typeof s=="object"?s.value:s,v=typeof s=="object"?s.label:s,P=typeof s=="object"?s.description:null,C=`${e.name}-${b}`;return(0,E.jsxs)("div",{className:"relative flex items-start",children:[(0,E.jsx)("div",{className:"flex h-6 items-center",children:(0,E.jsx)(H.Item,{value:b,id:C,disabled:a,className:`
|
|
14
|
+
relative size-4 rounded-full border transition-all
|
|
15
|
+
${a?"border-gray-300 bg-gray-100 cursor-not-allowed":"border-gray-300 bg-white hover:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"}
|
|
16
|
+
data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600
|
|
17
|
+
`,children:(0,E.jsx)(H.Indicator,{className:"flex items-center justify-center w-full h-full relative after:content-[''] after:block after:w-1.5 after:h-1.5 after:rounded-full after:bg-white"})})}),(0,E.jsxs)("div",{className:"ml-3 text-sm",children:[(0,E.jsx)("label",{htmlFor:C,className:`font-medium ${a?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:v}),P&&!p&&(0,E.jsx)("p",{className:`text-sm ${a?"text-gray-400":"text-gray-500"}`,children:P})]})]},b)})})}var Ue=vt;var mo=require("react"),q=require("react/jsx-runtime");function wt({field:e}){let r=e.text||e.label||"",c=e.description||"",h=e.size||"lg",d=e.underline||!1,a=e.align||"left",l=e.className||"",p={sm:"text-base font-semibold",md:"text-lg font-semibold",lg:"text-xl font-bold",xl:"text-2xl font-bold","2xl":"text-3xl font-bold","3xl":"text-4xl font-bold","4xl":"text-5xl font-bold"},s={left:"text-left",center:"text-center",right:"text-right"},b=`
|
|
18
|
+
${p[h]||p.lg}
|
|
19
|
+
${s[a]||s.left}
|
|
20
|
+
${d?"border-b-2 border-gray-300 pb-2":""}
|
|
21
|
+
${l}
|
|
22
|
+
text-gray-900
|
|
23
|
+
`.trim(),v=`
|
|
24
|
+
mt-1 text-sm text-gray-600
|
|
25
|
+
${s[a]||s.left}
|
|
26
|
+
`.trim();return(0,q.jsxs)("div",{className:"my-4",children:[(0,q.jsx)("h2",{className:b,children:r}),c&&(0,q.jsx)("p",{className:v,children:c})]})}var _e=wt;var G=I(require("@radix-ui/react-popover"),1),je=require("react"),He=require("react-day-picker"),bo=require("react-day-picker/dist/style.css"),F=require("react/jsx-runtime");function Nt({field:e,formValues:r,handleChange:c,handleBlur:h}){let[d,a]=(0,je.useState)(!1),l=r[e.name]??null,p=b=>c(e.name,b),s=()=>c(e.name,null);return(0,F.jsx)("div",{children:(0,F.jsxs)(G.Root,{open:d,onOpenChange:a,children:[(0,F.jsx)(G.Trigger,{asChild:!0,children:(0,F.jsxs)("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":d,onClick:()=>a(!0),onKeyDown:b=>b.key==="Enter"&&a(!0),className:`
|
|
27
|
+
inline-flex items-center justify-between gap-2
|
|
28
|
+
w-full h-9 rounded-md border border-gray-300 bg-white
|
|
29
|
+
px-3 py-2 text-sm font-normal shadow-sm
|
|
30
|
+
hover:bg-gray-50 hover:text-gray-900
|
|
31
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2
|
|
32
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
33
|
+
`,children:[l?(0,F.jsx)("span",{children:l.toLocaleDateString()}):(0,F.jsx)("span",{className:"text-muted-foreground",children:e.placeholder||"Select date"}),(0,F.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-down opacity-70",children:(0,F.jsx)("path",{d:"m6 9 6 6 6-6"})})]})}),(0,F.jsxs)(G.Content,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[(0,F.jsx)(He.DayPicker,{mode:"single",selected:l,onSelect:p,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),(0,F.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[(0,F.jsx)("button",{type:"button",onClick:s,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),(0,F.jsx)("button",{type:"button",onClick:()=>a(!1),className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})]})})}var Ge=Nt;var z=I(require("react"),1),W=I(require("@radix-ui/react-popover"),1),u=require("react/jsx-runtime");function kt({field:e,formValues:r,handleChange:c,handleBlur:h}){let[d,a]=(0,z.useState)(!1),[l,p]=(0,z.useState)("12"),[s,b]=(0,z.useState)("00"),[v,P]=(0,z.useState)("PM"),C=r[e.name]||"";z.default.useEffect(()=>{if(C){let f=C.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);f&&(p(f[1].padStart(2,"0")),b(f[2]),P(f[3].toUpperCase()))}},[C]);let B=()=>{let f=`${l}:${s} ${v}`;c(e.name,f),a(!1)},L=()=>{c(e.name,""),p("12"),b("00"),P("PM")},O=()=>{let f=parseInt(l);p((f%12+1).toString().padStart(2,"0"))},V=()=>{let f=parseInt(l);p((f===1?12:f-1).toString().padStart(2,"0"))},A=()=>{let f=parseInt(s);b(((f+5)%60).toString().padStart(2,"0"))},U=()=>{let f=parseInt(s);b((f===0?55:f-5).toString().padStart(2,"0"))};return(0,u.jsx)("div",{children:(0,u.jsxs)(W.Root,{open:d,onOpenChange:a,children:[(0,u.jsx)(W.Trigger,{asChild:!0,children:(0,u.jsxs)("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":d,onClick:()=>a(!0),className:`
|
|
34
|
+
inline-flex items-center justify-between gap-2
|
|
35
|
+
w-full h-9 rounded-md border border-gray-300 bg-white
|
|
36
|
+
px-3 py-2 text-sm font-normal shadow-sm
|
|
37
|
+
hover:bg-gray-50 hover:text-gray-900
|
|
38
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2
|
|
39
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
40
|
+
`,children:[C?(0,u.jsx)("span",{children:C}):(0,u.jsx)("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),(0,u.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-clock opacity-70",children:[(0,u.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,u.jsx)("polyline",{points:"12 6 12 12 16 14"})]})]})}),(0,u.jsx)(W.Content,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:(0,u.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,u.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,u.jsxs)("div",{className:"flex flex-col items-center",children:[(0,u.jsx)("button",{type:"button",onClick:O,className:"p-1 hover:bg-gray-100 rounded",children:(0,u.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,u.jsx)("polyline",{points:"18 15 12 9 6 15"})})}),(0,u.jsx)("input",{type:"text",value:l,onChange:f=>{let $=f.target.value.replace(/\D/g,"");($===""||parseInt($)>=1&&parseInt($)<=12)&&p($.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),(0,u.jsx)("button",{type:"button",onClick:V,className:"p-1 hover:bg-gray-100 rounded",children:(0,u.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,u.jsx)("polyline",{points:"6 9 12 15 18 9"})})})]}),(0,u.jsx)("span",{className:"text-2xl font-semibold",children:":"}),(0,u.jsxs)("div",{className:"flex flex-col items-center",children:[(0,u.jsx)("button",{type:"button",onClick:A,className:"p-1 hover:bg-gray-100 rounded",children:(0,u.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,u.jsx)("polyline",{points:"18 15 12 9 6 15"})})}),(0,u.jsx)("input",{type:"text",value:s,onChange:f=>{let $=f.target.value.replace(/\D/g,"");($===""||parseInt($)>=0&&parseInt($)<=59)&&b($.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),(0,u.jsx)("button",{type:"button",onClick:U,className:"p-1 hover:bg-gray-100 rounded",children:(0,u.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,u.jsx)("polyline",{points:"6 9 12 15 18 9"})})})]}),(0,u.jsxs)("div",{className:"flex flex-col gap-1 ml-2",children:[(0,u.jsx)("button",{type:"button",onClick:()=>P("AM"),className:`
|
|
41
|
+
px-3 py-1 text-sm font-medium rounded
|
|
42
|
+
${v==="AM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
|
|
43
|
+
`,children:"AM"}),(0,u.jsx)("button",{type:"button",onClick:()=>P("PM"),className:`
|
|
44
|
+
px-3 py-1 text-sm font-medium rounded
|
|
45
|
+
${v==="PM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
|
|
46
|
+
`,children:"PM"})]})]}),(0,u.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[(0,u.jsx)("button",{type:"button",onClick:L,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),(0,u.jsx)("button",{type:"button",onClick:B,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})})]})})}var We=kt;var fo=require("react");var re=require("@heroicons/react/20/solid"),Ve=require("@heroicons/react/20/solid"),Ye=require("@heroicons/react/24/outline");var N=require("react/jsx-runtime");function qe({message:e}){return(0,N.jsx)("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:(0,N.jsxs)("div",{className:"flex items-center gap-3",children:[(0,N.jsx)(re.XCircleIcon,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),(0,N.jsx)("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function Ke({message:e}){return(0,N.jsx)("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:(0,N.jsxs)("div",{className:"flex items-center gap-3",children:[(0,N.jsx)(Ye.ExclamationCircleIcon,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),(0,N.jsx)("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function Xe({message:e}){return(0,N.jsx)("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:(0,N.jsxs)("div",{className:"flex items-center gap-3",children:[(0,N.jsx)(Ve.CheckCircleIcon,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),(0,N.jsx)("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function Je({message:e}){return(0,N.jsx)("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:(0,N.jsxs)("div",{className:"flex items-center gap-3",children:[(0,N.jsx)(re.InformationCircleIcon,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),(0,N.jsx)("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}var K=require("react/jsx-runtime");function Ct({field:e}){let{variant:r="info",message:c,content:h}=e,d=c||h||"";switch(r.toLowerCase()){case"error":case"danger":return(0,K.jsx)(qe,{message:d});case"success":return(0,K.jsx)(Xe,{message:d});case"warning":case"warn":return(0,K.jsx)(Ke,{message:d});case"info":case"information":default:return(0,K.jsx)(Je,{message:d})}}var Qe=Ct;var et=require("@radix-ui/react-label"),R=require("react/jsx-runtime"),St=({formDefinition:e,sendFormValues:r,children:c,defaultValues:h={},onFieldsChange:d=()=>{}})=>{let[a,l]=(0,M.useState)({...h}),[p,s]=(0,M.useState)({}),[b,v]=(0,M.useState)({}),[P,C]=(0,M.useState)({}),B=["hidden","html","linebreak","header","alert"],L=(0,M.useMemo)(()=>({file:ce,multifile:ce,dateRange:Ee,date:Ge,dayTimePicker:ze,time:We,hidden:xe,multiselect:we,select:Ce,email:Se,litertext:Pe,checkbox:Le,radiogroup:Ue,input:ne,textarea:Be,header:_e,alert:Qe,linebreak:Oe}),[]),O={},V=async(t,o=null)=>{try{let n=await he(`/${t.optionsUrl}`);console.log(n);let m=[];t.type==="select"?m=[{value:"",label:`Select ${t.label.toLowerCase()}`},...n.data]:m=[...n.data.map(k=>({value:k.value,label:k.label}))],e.fields.forEach(k=>{k.name===t.name&&(k.options=m)})}catch(n){console.error(`Failed to load options for ${t.name}:`,n)}finally{}};(0,M.useEffect)(()=>{if(e!=null&&e.fields&&e.fields.length>0){if(!e.fields.some(n=>n.value))return;e.fields.forEach(n=>{n.optionsUrl&&V(n)});let o={};e.fields.forEach(n=>{o[n.name]=h[n.name]??n.value??(n.type==="multiselect"?[]:"")}),l(o)}},[e]);let A=(t,o,n)=>{if(t.disabled&&t.disabled(n))return null;if(t.required){if(!o)return`${t.label} is required`;if(Array.isArray(o)&&o.length===0)return`Please select at least one ${t.label.toLowerCase()}`}if(t.validate){let m=t.validate(o,n);if(m)return m}if(t.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o))return"Please enter a valid email address";if(t.type==="number"){if(t.min!==void 0&&o<t.min)return`${t.label} must be at least ${t.min}`;if(t.max!==void 0&&o>t.max)return`${t.label} must be no more than ${t.max}`}return t.type==="date"&&!(0,de.default)(o).isValid()?`${t.label} must be a valid date`:t.maxLength&&o&&o.length>t.maxLength?`${t.label} must not exceed ${t.maxLength} characters`:null},U=(t,o)=>{let n=e.fields.find(y=>y.name===t);if(!n)return;let m={...a};console.log(o),n.type==="multiselect"?m[t]=Array.isArray(o)?o:Array.from(o.target.selectedOptions).map(y=>y.value):n.type==="dateRange"?(console.log(o),m[t]=[{startDate:o[0].from,endDate:o[0].to,key:"selection"}]):n.type==="dayTimePicker"?m[t]=o?(0,de.default)(o).format("YYYY-MM-DD HH:mm:ss"):"":m[t]=o,n.type==="select"&&e.fields.forEach(y=>{y.showIf&&!y.showIf(m)&&(m[y.name]=y.type==="multiselect"?[]:"")}),e.fields.forEach(y=>{y.disabled&&y.disabled(m)&&(m[y.name]=y.type==="multiselect"?[]:"")}),l(m);let k={};e.fields.forEach(y=>{if(!y.showIf||y.showIf(m)){let Y=A(y,m[y.name],m);Y&&(k[y.name]=Y)}}),s(k)},f=t=>{v({...b,[t]:!0})},$=t=>{t.preventDefault();let o={};e.fields.forEach(m=>{o[m.name]=!0}),v(o);let n={};e.fields.forEach(m=>{if((!m.showIf||m.showIf(a))&&(!m.disabled||!m.disabled(a))){let k=A(m,a[m.name],a);k&&(n[m.name]=k)}}),s(n),Object.keys(n).length===0?r(a):Ze.toast.error("Please correct the errors in the form")};(0,M.useEffect)(()=>{d(a)},[a,d]);let X={green:"border-green-500 bg-green-50",blue:"border-blue-500 bg-blue-50",red:"border-red-500 bg-red-50",yellow:"border-yellow-500 bg-yellow-50",purple:"border-purple-500 bg-purple-50",indigo:"border-indigo-500 bg-indigo-50",gray:"border-gray-500 bg-gray-50",pink:"border-pink-500 bg-pink-50",orange:"border-orange-500 bg-orange-50"};function se(t,o,n){if(B.includes(o.type))return(0,R.jsx)("div",{className:o.fieldClass||"col-span-8",children:t});let m=o.containerStyle,k=o.color||"blue",y=m==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${o.containerClassName||X[k]||X.blue}`:"",Y=(0,R.jsxs)(R.Fragment,{children:[o.label&&(0,R.jsxs)(et.Label,{htmlFor:o.name,className:"block text-sm font-medium mb-1",children:[o.label,o.required&&(0,R.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,R.jsx)("div",{children:t}),n&&(0,R.jsx)("p",{className:"mt-1 text-sm text-red-500",children:n})]});return(0,R.jsx)("div",{className:`mb-4 ${o.fieldClass||"col-span-8"}`,children:m==="card"?(0,R.jsx)("div",{className:y,children:Y}):Y})}let i=t=>{if(t.showIf&&!t.showIf(a))return null;let o=L[t.type]||ne;a[t.name]===void 0&&(a[t.name]=t.value!==void 0?t.value:t.type==="multiselect"?[]:"");let n=b[t.name]&&p[t.name]?p[t.name]:null;return se((0,R.jsx)(o,{field:t,formValues:a,handleChange:U,handleBlur:()=>f(t.name),setCharCounts:C,charCount:P[t.name]||0}),t)};return(0,R.jsxs)("form",{onSubmit:$,className:"grid grid-cols-12 gap-x-4 mx-auto",children:[e?e.fields.map(i):(0,R.jsx)("div",{children:"Loading..."}),c]})},ae=St;var Ft=ae;0&&(module.exports={DynamicForm,DynamicFormComponent,MyButton,MyButtonComponent});
|
|
47
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.jsx","../src/MyButton.jsx","../src/DynamicForm/DynamicForm.jsx","../src/services/Interceptors.jsx","../src/config.jsx","../src/DynamicForm/fields/HiddenField.jsx","../src/DynamicForm/fields/MultiSelectField.jsx","../src/DynamicForm/fields/SelectField.jsx","../src/DynamicForm/fields/EmailField.jsx","../src/DynamicForm/fields/InputField.jsx","../src/DynamicForm/fields/HtmlField.jsx","../src/DynamicForm/fields/CheckboxField.jsx","../src/DynamicForm/fields/DateRangePickerField.jsx","../src/DynamicForm/fields/FileField.jsx","../src/config.js","../src/DynamicForm/fields/TextArea.jsx","../src/DynamicForm/fields/DayTimePickerField.jsx","../src/DynamicForm/fields/LineBreakField.jsx","../src/DynamicForm/fields/RadioGroups.jsx","../src/DynamicForm/fields/HeaderField.jsx","../src/DynamicForm/fields/DatePickerField.jsx","../src/DynamicForm/fields/timeField.jsx","../src/DynamicForm/fields/AlertMessageField.jsx","../src/DynamicForm/components/formats/alerts/Alerts.jsx"],"sourcesContent":["// Named exports\nexport { default as MyButton } from './MyButton.jsx';\nexport { default as DynamicForm } from './DynamicForm/DynamicForm.jsx';\n\n// Default exports for backward compatibility\nimport MyButtonComponent from './MyButton.jsx';\nimport DynamicFormComponent from './DynamicForm/DynamicForm.jsx';\n\n// Export default as DynamicForm (main component)\nexport default DynamicFormComponent;\n\n// Also export a default MyButton for direct import\nexport { MyButtonComponent, DynamicFormComponent };","// src/MyButton.jsx\nexport default function MyButton({ children, onClick }) {\n return <button onClick={onClick}>{children}</button>;\n}","import { useState, useEffect, useRef, useMemo } from \"react\";\nimport { toast } from \"react-hot-toast\";\nimport dayjs from \"dayjs\";\n// import \"dayjs/locale/de\"; // Remove this to avoid module resolution issues\nimport apiClient from \"../services/Interceptors.jsx\";\nimport { default as RenderHiddenField } from \"./fields/HiddenField\";\nimport { default as RenderMultiSelectField } from \"./fields/MultiSelectField\";\nimport { default as RenderSelectField } from \"./fields/SelectField\";\nimport { default as RenderEmailField } from \"./fields/EmailField\";\nimport { default as RenderInputField } from \"./fields/InputField\";\nimport { default as RenderHtmlField } from \"./fields/HtmlField\";\nimport { default as RenderCheckboxField } from \"./fields/CheckboxField\";\nimport { default as RenderDayPickerField } from \"./fields/DateRangePickerField\";\nimport { default as RenderFileInputField } from \"./fields/FileField\";\nimport { default as RenderTextAreaField } from \"./fields/TextArea\";\nimport { default as DayTimePickerField } from \"./fields/DayTimePickerField\";\nimport { default as RenderLineBreakField } from \"./fields/LineBreakField\";\nimport { default as RenderRadioGroupField } from \"./fields/RadioGroups\";\nimport { default as RenderHeaderField } from \"./fields/HeaderField\";\nimport { default as RenderDatePickerField } from \"./fields/DatePickerField\";\nimport { default as RenderTimeField } from \"./fields/timeField\";\nimport { default as RenderAlertMessageField } from \"./fields/AlertMessageField\";\nimport { Label } from \"@radix-ui/react-label\";\nconst DynamicForm = ({\n formDefinition,\n sendFormValues,\n children,\n defaultValues = {},\n onFieldsChange = () => { },\n}) => {\n\n const [formValues, setFormValues] = useState({ ...defaultValues });\n const [errors, setErrors] = useState({});\n const [touched, setTouched] = useState({});\n const [charCounts, setCharCounts] = useState({});\n const excludeFromFieldFormat = [\"hidden\", \"html\", \"linebreak\", \"header\", \"alert\"];\n const FIELD_RENDERERS = useMemo(() => ({\n file: RenderFileInputField,\n multifile: RenderFileInputField,\n dateRange: RenderDayPickerField,\n date: RenderDatePickerField,\n dayTimePicker: DayTimePickerField,\n time: RenderTimeField,\n hidden: RenderHiddenField,\n multiselect: RenderMultiSelectField,\n select: RenderSelectField,\n email: RenderEmailField,\n litertext: RenderHtmlField,\n checkbox: RenderCheckboxField,\n radiogroup: RenderRadioGroupField,\n input: RenderInputField,\n textarea: RenderTextAreaField,\n header: RenderHeaderField,\n alert: RenderAlertMessageField,\n linebreak: RenderLineBreakField,\n\n }), []);\n\n\n const FIELD_FORMATTERS = {\n\n\n }\n\n const loadOptionsForField = async (field, dependentValue = null) => {\n\n try {\n const response = await apiClient(`/${field.optionsUrl}`);\n console.log(response)\n // Add empty option at the beginning if not exists\n let options = [];\n if (field.type === \"select\") {\n options = [\n { value: \"\", label: `Select ${field.label.toLowerCase()}` },\n ...response.data,\n ];\n } else {\n options = [...response.data.map((item) => (\n { value: item.value, label: item.label }\n ))];\n }\n formDefinition.fields.forEach((f) => {\n if (f.name === field.name) {\n f.options = options;\n }\n });\n //setFieldOptions((prev) => ({ ...prev, [field.name]: options }));\n } catch (error) {\n console.error(`Failed to load options for ${field.name}:`, error);\n } finally {\n }\n };\n\n\n useEffect(() => {\n if (formDefinition?.fields && formDefinition.fields.length > 0) {\n // Wait until at least one field has a non-empty value\n const hasData = formDefinition.fields.some((f) => f.value);\n if (!hasData) return; // Don't set empty values early\n\n // Load async options\n formDefinition.fields.forEach((field) => {\n if (field.optionsUrl) loadOptionsForField(field);\n });\n\n // Initialise form values\n const initialValues = {};\n formDefinition.fields.forEach((field) => {\n initialValues[field.name] =\n defaultValues[field.name] ??\n field.value ??\n (field.type === \"multiselect\" ? [] : \"\");\n });\n\n setFormValues(initialValues);\n }\n }, [formDefinition]);\n\n\n\n\n\n const validateField = (field, value, allValues) => {\n if (field.disabled && field.disabled(allValues)) {\n return null;\n }\n\n if (field.required) {\n if (!value) {\n return `${field.label} is required`;\n }\n if (Array.isArray(value) && value.length === 0) {\n return `Please select at least one ${field.label.toLowerCase()}`;\n }\n }\n\n if (field.validate) {\n const error = field.validate(value, allValues);\n if (error) return error;\n }\n\n // Email validation addition\n if (field.type === \"email\") {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(value)) return \"Please enter a valid email address\";\n }\n\n if (field.type === \"number\") {\n if (field.min !== undefined && value < field.min) {\n return `${field.label} must be at least ${field.min}`;\n }\n if (field.max !== undefined && value > field.max) {\n return `${field.label} must be no more than ${field.max}`;\n }\n }\n\n if (field.type === \"date\") {\n // Ensure the value is a valid date\n if (!dayjs(value).isValid()) {\n return `${field.label} must be a valid date`;\n }\n }\n\n if (field.maxLength && value && value.length > field.maxLength) {\n return `${field.label} must not exceed ${field.maxLength} characters`;\n }\n\n return null;\n };\n\n\n const handleChange = (fieldName, value) => {\n const field = formDefinition.fields.find((f) => f.name === fieldName);\n if (!field) return;\n\n const newValues = { ...formValues };\n console.log(value)\n // Handle multiselect values\n if (field.type === \"multiselect\") {\n newValues[fieldName] = Array.isArray(value)\n ? value\n : Array.from(value.target.selectedOptions).map((option) => option.value);\n }\n // Handle DateRangePicker (dayPicker)\n\n else if (field.type === \"dateRange\") {\n console.log(value)\n newValues[fieldName] = [\n {\n startDate: value[0].from,\n endDate: value[0].to,\n key: \"selection\",\n },\n ];\n\n }\n // Handle DateTime Picker\n else if (field.type === \"dayTimePicker\") {\n newValues[fieldName] = value ? dayjs(value).format(\"YYYY-MM-DD HH:mm:ss\") : \"\";\n }\n else {\n newValues[fieldName] = value;\n }\n\n // Clear dependent fields when parent selection changes\n if (field.type === \"select\") {\n formDefinition.fields.forEach((f) => {\n if (f.showIf && !f.showIf(newValues)) {\n newValues[f.name] = f.type === \"multiselect\" ? [] : \"\";\n }\n });\n }\n\n formDefinition.fields.forEach((f) => {\n if (f.disabled && f.disabled(newValues)) {\n newValues[f.name] = f.type === \"multiselect\" ? [] : \"\";\n }\n });\n\n setFormValues(newValues);\n\n // Validate all fields\n const newErrors = {};\n formDefinition.fields.forEach((f) => {\n if (!f.showIf || f.showIf(newValues)) {\n const error = validateField(f, newValues[f.name], newValues);\n if (error) newErrors[f.name] = error;\n }\n });\n\n setErrors(newErrors);\n };\n\n\n const handleBlur = (fieldName) => {\n setTouched({ ...touched, [fieldName]: true });\n };\n\n const handleSubmit = (e) => {\n e.preventDefault();\n\n const allTouched = {};\n formDefinition.fields.forEach((field) => {\n allTouched[field.name] = true;\n });\n setTouched(allTouched);\n\n const newErrors = {};\n formDefinition.fields.forEach((field) => {\n if (\n (!field.showIf || field.showIf(formValues)) &&\n (!field.disabled || !field.disabled(formValues))\n ) {\n const error = validateField(field, formValues[field.name], formValues);\n if (error) newErrors[field.name] = error;\n }\n });\n\n setErrors(newErrors);\n\n if (Object.keys(newErrors).length === 0) {\n sendFormValues(formValues);\n } else {\n toast.error(\"Please correct the errors in the form\");\n }\n };\n\n\n useEffect(() => {\n\n onFieldsChange(formValues);\n\n }, [formValues, onFieldsChange]);\n\n\n // Color variants for field card container\n const FIELD_COLOR_VARIANTS = {\n green: 'border-green-500 bg-green-50',\n blue: 'border-blue-500 bg-blue-50',\n red: 'border-red-500 bg-red-50',\n yellow: 'border-yellow-500 bg-yellow-50',\n purple: 'border-purple-500 bg-purple-50',\n indigo: 'border-indigo-500 bg-indigo-50',\n gray: 'border-gray-500 bg-gray-50',\n pink: 'border-pink-500 bg-pink-50',\n orange: 'border-orange-500 bg-orange-50',\n };\n\n\n function fieldFormat(children, field, error) {\n if (excludeFromFieldFormat.includes(field.type)) {\n return <div className={field.fieldClass || \"col-span-8\"}>{children}</div>;\n }\n\n const containerStyle = field.containerStyle;\n const color = field.color || 'blue';\n const containerClasses = containerStyle === 'card'\n ? `rounded-lg border text-card-foreground shadow-sm p-4 ${field.containerClassName || FIELD_COLOR_VARIANTS[color] || FIELD_COLOR_VARIANTS.blue}`\n : '';\n\n const content = (\n <>\n {field.label && (\n <Label\n htmlFor={field.name}\n className=\"block text-sm font-medium mb-1\"\n >\n {field.label}\n {field.required && <span className=\"text-red-500 ml-1\">*</span>}\n </Label>\n )}\n\n {/* InputField or any other field goes here */}\n <div>{children}</div>\n\n {error && (\n <p className=\"mt-1 text-sm text-red-500\">\n {error}\n </p>\n )}\n </>\n );\n\n return (\n <div className={`mb-4 ${field.fieldClass || \"col-span-8\"}`}>\n {containerStyle === 'card' ? (\n <div className={containerClasses}>\n {content}\n </div>\n ) : content}\n </div>\n );\n }\n\n const renderField = (field) => {\n if (field.showIf && !field.showIf(formValues)) return null;\n\n const FieldComponent = FIELD_RENDERERS[field.type] || RenderInputField;\n if (formValues[field.name] === undefined) {\n formValues[field.name] =\n field.value !== undefined\n ? field.value\n : field.type === \"multiselect\"\n ? []\n : \"\";\n }\n\n const error = touched[field.name] && errors[field.name] ? errors[field.name] : null;\n\n return (fieldFormat(\n <FieldComponent\n field={field}\n formValues={formValues}\n handleChange={handleChange}\n handleBlur={() => handleBlur(field.name)}\n setCharCounts={setCharCounts}\n charCount={charCounts[field.name] || 0}\n //error={error}\n />, field\n )\n );\n };\n\n\n return (\n <form onSubmit={handleSubmit} className=\"grid grid-cols-12 gap-x-4 mx-auto\">\n {formDefinition ? (\n formDefinition.fields.map(renderField)\n ) : (\n <div>Loading...</div>\n )}\n {children}\n </form>\n );\n};\n\nexport default DynamicForm;","import axios from 'axios';\nimport toast from 'react-hot-toast';\nimport {config} from '../config';\nconst apiClient = axios.create({\n baseURL: config.REACT_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n \n apiClient.interceptors.response.use(\n (response) => response.data,\n (error) => {\n if (error.response && error.response.status === 403) {\n toast.error( 'You are not authorized to access this resource.');\n return Promise.reject('You are not authorized to access this resource.');\n }else if (error.response) {\n toast.error( 'An error occurred' );\n return Promise.reject(error.response.data?.message || 'An error occurred');\n } else{\n toast.error(error.message);\n }\n \n\n }\n );\n export default apiClient;","export const config = {\"REACT_API_URL\": \"http://localhost:5000/\"};","\n// This component renders a hidden input field for forms. This used to include data in form submissions without displaying it to the user.\nfunction HiddenField(field) {\n return <input type=\"hidden\" name={field.name} value={field.value} key={field.name} />;\n}\nexport default HiddenField;","import Select from 'react-select'\nimport makeAnimated from 'react-select/animated'\n\nfunction MultiSelectField({ field, formValues, handleChange, touched, errors, handleBlur }) {\n //const error = touched[field.name] && errors[field.name];\n const isDisabled = field.disabled && field.disabled(formValues);\n const options = field.options || [];\n\n const animatedComponents = makeAnimated();\n\n const currentValues = formValues[field.name] || [];\n\n return (\n\n <Select\n components={animatedComponents}\n isMulti\n isDisabled={isDisabled}\n name={field.label}\n value={currentValues}\n onChange={(selected) => handleChange(field.name, selected)}\n options={options}\n placeholder={field.placeholder}\n closeMenuOnSelect={false}\n />\n\n );\n}\nexport default MultiSelectField;","import * as Select from \"@radix-ui/react-select\";\nimport React from \"react\";\n// get arrow down icon from icon hero icon\nimport { ChevronDownIcon } from \"@heroicons/react/20/solid\";\n\nfunction SelectField({ field, formValues, handleChange, handleBlur }) {\n const value = formValues[field.name] || \"\";\n const isDisabled =\n typeof field.disabled === \"function\"\n ? field.disabled(formValues)\n : field.disabled;\n const options = field.options || [];\n\n return (\n <Select.Root\n value={value}\n onValueChange={(val) => handleChange(field.name, val)}\n disabled={isDisabled}\n >\n {/* --- Trigger --- */}\n <Select.Trigger\n id={field.name}\n onBlur={() => handleBlur(field.name)}\n className={`inline-flex items-center justify-between w-full px-3 py-2 border rounded-md text-sm transition-all\n ${isDisabled\n ? \"bg-gray-100 text-gray-500 cursor-not-allowed\"\n : \"border-gray-300 hover:border-gray-400 focus:ring-2 focus:ring-blue-500\"}\n `}\n >\n <Select.Value\n placeholder={\n field.placeholder || `Select ${field.label?.toLowerCase() || \"\"}`\n }\n />\n <Select.Icon className=\"ml-2 text-gray-500\">\n <ChevronDownIcon className=\"w-4 h-4\" />\n </Select.Icon>\n </Select.Trigger>\n\n {/* --- Dropdown --- */}\n <Select.Portal>\n <Select.Content\n className=\"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]\"\n position=\"popper\"\n sideOffset={5}\n >\n {/* Scroll Up */}\n <Select.ScrollUpButton className=\"flex items-center justify-center h-6 text-gray-500 bg-gray-50\">\n <Select.Arrow className=\"fill-white stroke-gray-200\" />\n </Select.ScrollUpButton>\n\n <Select.Viewport className=\"p-1\">\n {/* Optional grouped items */}\n {field.groupLabel && (\n <Select.Group>\n <Select.Label className=\"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide\">\n {field.groupLabel}\n </Select.Label>\n </Select.Group>\n )}\n\n {/* List of options */}\n {options.map((option) => (\n <Select.Item\n key={option.value}\n value={option.value}\n className={`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none\n data-[state=checked]:bg-blue-50\n data-[state=checked]:text-blue-600\n `}\n >\n <Select.ItemText>{option.label}</Select.ItemText>\n\n </Select.Item>\n ))}\n\n {/* Optional separator */}\n {field.separator && (\n <Select.Separator className=\"my-1 h-px bg-gray-200\" />\n )}\n </Select.Viewport>\n\n {/* Scroll Down */}\n\n {/* Optional arrow */}\n <Select.Arrow className=\"fill-white stroke-gray-200\" />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n}\n\nexport default SelectField;\n","import React from 'react';\n\nfunction EmailField({ field, formValues, handleChange, handleBlur, touched, errors }) {\n //const error = touched[field.name] && errors[field.name];\n const isDisabled = field.readOnly && field.disabled;\n const error = false;\n return (\n <input\n {...field.props}\n type=\"email\"\n value={formValues[field.name] || \"\"}\n onChange={(e) => handleChange(field.name, e.target.value)}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n name={field.name}\n placeholder={field.placeholder}\n className={`w-full px-3 py-2 border rounded-md ${\n error ? \"border-red-500\" : \"border-gray-300\"\n } ${isDisabled ? \"bg-gray-100 text-gray-500 cursor-not-allowed\" : \"\"}`}\n />\n );\n}\n\nexport default EmailField;","import React from \"react\";\n\nfunction InputField({ field, formValues, handleChange, handleBlur, touched, errors }) {\n console.log(\"Rendering InputField for\", field);\n const isDisabled = field.readOnly || field.disabled;\n const error = false\n return (\n <input\n {...field.props}\n id={field.name}\n type={field.type || \"text\"}\n value={formValues[field.name] || \"\"}\n onChange={(e) => handleChange(field.name, e.target.value)}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n name={field.name}\n placeholder={field.placeholder}\n min={field.minLength}\n max={field.maxLength}\n className={`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${\n error \n ? \"border-red-500 focus-visible:ring-red-500\" \n : \"border-input focus-visible:ring-blue-500\"\n } ${\n isDisabled \n ? \"bg-gray-50 text-gray-500\" \n : \"bg-background\"\n }`}\n />\n\n );\n}\n\nexport default InputField;","import React from 'react'\n\n\nfunction HtmlField({ field, formValues }) {\n const htmlContent = formValues[field.name] || field.content || \"\";\n \n return (\n <div key={field.name} className={`mb-4 ${field.fieldClass ? field.fieldClass : \"col-span-full\"}`} id={field.name.toLowerCase() + \"_id\"}>\n <div \n className=\"w-full px-3 py-2 border rounded-md overflow-y-auto max-h-40 prose prose-sm max-w-none\" \n dangerouslySetInnerHTML={{ __html: htmlContent }} \n />\n </div>\n )\n}\n\nexport default HtmlField\n","\n\nfunction CheckboxField({field, formValues, handleChange, handleBlur, touched, errors}) {\n //const error = touched[field.name] && errors[field.name];\n const isDisabled = field.disabled && field.disabled(formValues);\n const error = false \n return (\n <div className=\"mt-1 space-x-2\">\n <input\n {...field.props}\n id={\"id_\" + field.name}\n type=\"checkbox\"\n checked={formValues[field.name] || false}\n onChange={(e) => handleChange(field.name, e.target.checked)}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n className={`rounded border-gray-300 ${\n isDisabled ? \"opacity-50 cursor-not-allowed\" : \"\"\n }`}\n />\n <label className=\"\" htmlFor={\"id_\" + field.name}>\n {field.label}\n {field.required && <span className=\"text-red-500\">*</span>}\n </label>\n {error && <p className=\"mt-1 text-sm text-red-500\">{error}</p>}\n </div>\n )\n}\n\nexport default CheckboxField","import * as Popover from \"@radix-ui/react-popover\";\nimport { useState } from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport \"react-day-picker/dist/style.css\";\n\nfunction DateRangeField({ field, formValues, handleChange, handleBlur }) {\n const [open, setOpen] = useState(false);\n const selected = formValues[field.name] ?? { from: null, to: null };\n\n const handleSelect = (range) => handleChange(field.name, range);\n const handleClear = () => handleChange(field.name, { from: null, to: null });\n\n return (\n <div>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n id={field.name}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => setOpen(true)}\n onKeyDown={(e) => e.key === \"Enter\" && setOpen(true)}\n className=\"\n inline-flex items-center justify-between gap-2\n w-full h-9 rounded-md border border-gray-300 bg-white\n px-3 py-2 text-sm font-normal shadow-sm\n hover:bg-gray-50 hover:text-gray-900\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2\n disabled:cursor-not-allowed disabled:opacity-50\n \"\n >\n {selected.from ? (\n selected.to ? (\n <span>\n {selected.from.toLocaleDateString()} – {selected.to.toLocaleDateString()}\n </span>\n ) : (\n <span>{selected.from.toLocaleDateString()}</span>\n )\n ) : (\n <span className=\"text-muted-foreground\">\n {field.placeholder || \"Select date range\"}\n </span>\n )}\n\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"lucide lucide-chevron-down opacity-70\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n </Popover.Trigger>\n\n <Popover.Content\n align=\"start\"\n sideOffset={2}\n className=\"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto\"\n >\n <DayPicker\n mode=\"range\"\n selected={selected}\n onSelect={handleSelect}\n showOutsideDays\n className=\"rounded-md bg-white p-3 text-xs\"\n />\n \n {/* Action buttons */}\n <div className=\"flex items-center justify-between gap-2 border-t border-gray-200 p-3\">\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2\"\n >\n Clear\n </button>\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2\"\n >\n Done\n </button>\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n}\n\nexport default DateRangeField;\n","import React from 'react'\nimport { toast } from \"react-hot-toast\";\nimport { config } from \"../../config.js\";\n\nfunction FileField({\n field,\n formValues,\n touched,\n errors,\n fileUploads,\n setFileUploads,\n fileInputRefs,\n handleChange,\n onFieldsChange\n}) {\n const error = touched[field.name] && errors[field.name];\n const isMultiple = field.type === \"multifile\";\n const uploads = fileUploads[field.name] || {};\n const currentValues = formValues[field.name];\n const values = isMultiple\n ? currentValues || []\n : [currentValues].filter(Boolean);\n const isDisabled = field.disabled && field.disabled(formValues);\n const disablebtnClasses = `px-4 py-2 bg-gray-100 border rounded hover:bg-gray-200 ${isDisabled ? \"cursor-not-allowed\" : \"\"\n }`;\n\n const uploadUrl = `${config.REACT_API_URL}uploads`;\n\n const formatFileSize = (bytes) => {\n if (bytes === 0) return \"0 Bytes\";\n const k = 1024;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + \" \" + sizes[i];\n };\n\n const uploadFile = async (file, fieldName) => {\n const formData = new FormData();\n formData.append(\"file\", file);\n\n const response = await fetch(`${uploadUrl}`, {\n method: \"POST\",\n body: formData,\n });\n\n if (!response.ok) {\n toast.error(\"Upload failed\");\n throw new Error(\"Upload failed\");\n }\n\n const data = await response.json();\n return data;\n };\n\n const handleSingleFileUpload = async (field, file) => {\n if (!file) return;\n\n // Validate file size\n if (field.maxSize && file.size > field.maxSize) {\n throw new Error(\n `File size must not exceed ${formatFileSize(field.maxSize)}`\n );\n }\n\n // Upload the file\n const uploadedData = await uploadFile(file, field.name);\n\n // Update form values with the uploaded URL\n const newValues = { ...formValues, [field.name]: uploadedData };\n handleChange(field.name, uploadedData);\n onFieldsChange(newValues);\n };\n\n const handleMultiFileUpload = async (field, files) => {\n const currentUrls = formValues[field.name] || [];\n if (currentUrls.length + files.length > field.maxFiles) {\n throw new Error(`Maximum ${field.maxFiles} files allowed`);\n }\n\n // Validate each file size\n files.forEach((file) => {\n if (field.maxSize && file.size > field.maxSize) {\n throw new Error(\n `Each file must not exceed ${formatFileSize(field.maxSize)}`\n );\n }\n });\n\n // Upload all files\n const uploadedUrls = await Promise.all(\n files.map((file) => uploadFile(file, field.name))\n );\n\n // Update form values with the new URLs\n const newUrls = [...currentUrls, ...uploadedUrls];\n handleChange(field.name, newUrls);\n onFieldsChange({ ...formValues, [field.name]: newUrls });\n };\n\n const handleFileChange = async (fieldName, files) => {\n const fileList = Array.from(files);\n\n try {\n if (field.type === \"file\") {\n await handleSingleFileUpload(field, fileList[0]);\n } else if (field.type === \"multifile\") {\n await handleMultiFileUpload(field, fileList);\n }\n\n // Clear file input after processing\n if (fileInputRefs.current[fieldName]) {\n fileInputRefs.current[fieldName].value = \"\"; // This resets the file input field\n }\n } catch (error) {\n toast.error(`Upload failed: ${error.message}`);\n }\n };\n\n const removeFile = async (fieldName, urlToRemove) => {\n let newValue;\n\n if (field.type === \"file\") {\n newValue = \"\";\n } else {\n const urls = formValues[fieldName] || [];\n newValue = urls.filter((url) => url !== urlToRemove);\n }\n\n handleChange(fieldName, newValue);\n onFieldsChange({ ...formValues, [fieldName]: newValue });\n\n // Reset the file input field after removing the file\n if (fileInputRefs.current[fieldName]) {\n fileInputRefs.current[fieldName].value = \"\"; // Reset file input after removing\n }\n };\n\n return (\n <div key={field.name} className={`mb-4 ${field.fieldClass || 'col-span-full'}`}>\n <label className=\"block font-medium mb-1\">\n {field.label}\n {field.required && <span className=\"text-red-500\">*</span>}\n </label>\n\n <div className=\"space-y-2\">\n <div className=\"items-center space-x-2\">\n <button\n type=\"button\"\n disabled={isDisabled}\n onClick={() => fileInputRefs.current[field.name].click()}\n className={disablebtnClasses}\n >\n Choose {isMultiple ? \"Files\" : \"File\"}\n </button>\n {isMultiple && values.length > 0 && (\n <span className=\"text-sm text-gray-600\">\n {values.length} of {field.maxFiles} files uploaded\n </span>\n )}\n </div>\n\n <input\n ref={(el) => (fileInputRefs.current[field.name] = el)}\n type=\"file\"\n accept={field.accept}\n multiple={isMultiple}\n className=\"hidden\"\n onChange={(e) => handleFileChange(field.name, e.target.files)}\n />\n\n {/* Uploaded Files List */}\n <div className=\"space-y-2\">\n {values.map((file, index) => {\n const upload = Object.values(uploads).find(\n (u) => u.file === file\n );\n return (\n <div\n key={file}\n className=\"flex items-center justify-between p-2 bg-gray-50 rounded\"\n >\n <div className=\"flex items-center space-x-2\">\n {upload && (\n <>\n <span className=\"text-sm\">{upload.fileName}</span>\n <span className=\"text-xs text-gray-500\">\n ({formatFileSize(upload.fileSize)})\n </span>\n </>\n )}\n {!upload && (\n <span className=\"text-sm\">{file.original_name}</span>\n )}\n </div>\n <button\n type=\"button\"\n onClick={() => removeFile(field.name, file)}\n className=\"text-red-500 hover:text-red-700 ml-3\"\n >\n Remove\n </button>\n </div>\n );\n })}\n </div>\n\n {/* Upload Progress */}\n {Object.entries(uploads).map(([fileName, upload]) => {\n if (upload.status === \"uploading\") {\n return (\n <div key={fileName} className=\"relative pt-1\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs font-semibold inline-block text-blue-600\">\n Uploading {fileName}\n </span>\n <span className=\"text-xs font-semibold inline-block text-blue-600\">\n {upload.progress}%\n </span>\n </div>\n <div className=\"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200\">\n <div\n className=\"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500\"\n style={{ width: `${upload.progress}%` }}\n />\n </div>\n </div>\n );\n }\n return null;\n })}\n </div>\n\n {error && <p className=\"mt-1 text-sm text-red-500\">{error}</p>}\n </div>\n );\n}\n\nexport default FileField;","// Default configuration for the DynamicForm package\nexport const config = {\n // Add your configuration values here\n apiBaseUrl: process.env.API_BASE_URL || '',\n // Add other config values as needed\n};","import React, { useRef, useEffect } from \"react\";\n\nfunction TextAreaField({\n field,\n formValues,\n handleChange,\n handleBlur,\n touched,\n errors,\n charCount,\n setCharCounts,\n}) {\n const textareaRef = useRef(null);\n const value = formValues[field.name] || \"\";\n const isDisabled =\n typeof field.disabled === \"function\"\n ? field.disabled(formValues)\n : field.disabled || field.readOnly;\n const error = touched?.[field.name] && errors?.[field.name] ? errors[field.name] : null;\n\n // Auto-resize logic\n const autoResize = () => {\n const el = textareaRef.current;\n if (el) {\n el.style.height = \"auto\";\n el.style.height = `${el.scrollHeight + 2}px`;\n }\n };\n\n // Auto-resize on mount & when value changes\n useEffect(() => {\n autoResize();\n }, [value]);\n\n const handleTextareaChange = (e) => {\n handleChange(field.name, e.target.value);\n autoResize();\n\n if (setCharCounts) {\n setCharCounts((prev) => ({\n ...prev,\n [field.name]: e.target.value.length,\n }));\n }\n };\n\n return (\n <div className=\"space-y-2\">\n <textarea\n {...field.props}\n ref={textareaRef}\n id={field.name}\n name={field.name}\n placeholder={field.placeholder || \"\"}\n value={value}\n onChange={handleTextareaChange}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n maxLength={field.maxLength}\n rows={field.rows || 3}\n className={`flex w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none overflow-y-auto ${\n error \n ? \"border-red-500 focus-visible:ring-red-500\" \n : \"border-input focus-visible:ring-blue-500\"\n } ${\n isDisabled \n ? \"bg-gray-50 text-gray-500\" \n : \"bg-background\"\n }`}\n style={{\n minHeight: \"80px\",\n maxHeight: \"400px\",\n }}\n />\n\n <div className=\"flex justify-between items-center\">\n {/* Character counter */}\n {field.maxLength && !field.readOnly && (\n <span className=\"text-xs text-gray-500\">\n {charCount || 0}/{field.maxLength} characters\n </span>\n )}\n\n </div>\n </div>\n );\n}\n\nexport default TextAreaField;\n","import { LocalizationProvider } from '@mui/x-date-pickers';\nimport React from 'react'\nimport { AdapterDayjs } from \"@mui/x-date-pickers/AdapterDayjs\";\nimport { DateTimeField } from \"@mui/x-date-pickers/DateTimeField\";\n\nfunction DayTimePickerField({ field, formValues, handleChange, handleBlur, touched, errors }) {\n return (\n <div>\n <LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale=\"aus\">\n <DateTimeField\n value={field.value}\n onChange={(newValue) => handleChange(field.name, newValue)}\n />\n </LocalizationProvider> \n \n </div>\n )\n}\nexport default DayTimePickerField\n\n\n\n","\nimport { Separator } from \"@radix-ui/react-separator\"\n\nfunction LineBreakField({ field }) {\n if (!field?.label) return <Separator className=\"my-4 h-px bg-gray-300\" />;\n\n return (\n <div className=\"relative flex items-center py-4\">\n <Separator className=\"flex-1 h-px bg-gray-300\" />\n <span className=\"px-3 font-medium text-gray-600 bg-white\">\n {field.label}\n </span>\n <Separator className=\"flex-1 h-px bg-gray-300\" />\n </div>\n );\n}\n\nexport default LineBreakField;","/**\n * RadioGroupField Component\n * \n * A Radix UI-based radio group field for DynamicForm\n * \n * @example\n * // Basic usage (stacked layout)\n * {\n * type: 'radio',\n * name: 'plan',\n * label: 'Select Plan',\n * options: [\n * { value: 'basic', label: 'Basic Plan', description: 'Perfect for individuals' },\n * { value: 'pro', label: 'Pro Plan', description: 'For professionals' },\n * { value: 'enterprise', label: 'Enterprise', description: 'For large teams' }\n * ]\n * }\n * \n * @example\n * // Inline layout\n * {\n * type: 'radio',\n * name: 'size',\n * label: 'Select Size',\n * inline: true,\n * options: ['Small', 'Medium', 'Large']\n * }\n * \n * @example\n * // Simple string options\n * {\n * type: 'radio',\n * name: 'color',\n * label: 'Choose Color',\n * options: ['Red', 'Green', 'Blue']\n * }\n * \n * @example\n * // With disabled state\n * {\n * type: 'radio',\n * name: 'subscription',\n * label: 'Subscription Type',\n * disabled: (formValues) => formValues.hasActiveSubscription,\n * options: [\n * { value: 'monthly', label: 'Monthly' },\n * { value: 'yearly', label: 'Yearly' }\n * ]\n * }\n */\n\nimport React from 'react';\nimport * as RadioGroup from '@radix-ui/react-radio-group';\n\nfunction RadioGroupField({ field, formValues, handleChange, handleBlur }) {\n const value = formValues[field.name] || '';\n const isDisabled = typeof field.disabled === 'function' \n ? field.disabled(formValues) \n : field.disabled;\n const options = field.options || [];\n const isInline = field.inline || false;\n\n return (\n <RadioGroup.Root\n value={value}\n onValueChange={(val) => handleChange(field.name, val)}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n className={isInline ? 'flex flex-wrap gap-4' : 'space-y-3'}\n aria-label={field.label || field.name}\n >\n {options.map((option) => {\n const optionValue = typeof option === 'object' ? option.value : option;\n const optionLabel = typeof option === 'object' ? option.label : option;\n\n const optionDescription = typeof option === 'object' ? option.description : null;\n const itemId = `${field.name}-${optionValue}`;\n\n return (\n <div key={optionValue} className=\"relative flex items-start\">\n <div className=\"flex h-6 items-center\">\n <RadioGroup.Item\n value={optionValue}\n id={itemId}\n disabled={isDisabled}\n className={`\n relative size-4 rounded-full border transition-all\n ${isDisabled \n ? 'border-gray-300 bg-gray-100 cursor-not-allowed' \n : 'border-gray-300 bg-white hover:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2'\n }\n data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600\n `}\n >\n <RadioGroup.Indicator className=\"flex items-center justify-center w-full h-full relative after:content-[''] after:block after:w-1.5 after:h-1.5 after:rounded-full after:bg-white\" />\n </RadioGroup.Item>\n </div>\n <div className=\"ml-3 text-sm\">\n <label \n htmlFor={itemId} \n className={`font-medium ${isDisabled ? 'text-gray-500' : 'text-gray-900 cursor-pointer'}`}\n >\n {optionLabel}\n </label>\n {optionDescription && !isInline && (\n <p className={`text-sm ${isDisabled ? 'text-gray-400' : 'text-gray-500'}`}>\n {optionDescription}\n </p>\n )}\n </div>\n </div>\n );\n })}\n </RadioGroup.Root>\n );\n}\n\nexport default RadioGroupField;\n","/**\n * HeaderField Component\n * \n * A header/title field for DynamicForm to display section headers, titles, or dividers\n * \n * @example\n * // Large header (h1)\n * {\n * type: 'header',\n * text: 'Personal Information',\n * size: 'xl' // or '2xl', '3xl', '4xl'\n * }\n * \n * @example\n * // Medium header with description (h2)\n * {\n * type: 'header',\n * text: 'Contact Details',\n * description: 'Please provide your contact information',\n * size: 'lg'\n * }\n * \n * @example\n * // Small header (h3)\n * {\n * type: 'header',\n * text: 'Account Settings',\n * size: 'md'\n * }\n * \n * @example\n * // Header with underline\n * {\n * type: 'header',\n * text: 'Billing Information',\n * underline: true,\n * size: 'lg'\n * }\n * \n * @example\n * // Header with custom styling\n * {\n * type: 'header',\n * text: 'Important Section',\n * size: 'xl',\n * className: 'text-blue-600',\n * align: 'center' // 'left', 'center', 'right'\n * }\n */\n\nimport React from 'react';\n\nfunction HeaderField({ field }) {\n const text = field.text || field.label || '';\n const description = field.description || '';\n const size = field.size || 'lg'; // 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl'\n const underline = field.underline || false;\n const align = field.align || 'left'; // 'left', 'center', 'right'\n const customClass = field.className || '';\n\n // Size mappings\n const sizeClasses = {\n sm: 'text-base font-semibold',\n md: 'text-lg font-semibold',\n lg: 'text-xl font-bold',\n xl: 'text-2xl font-bold',\n '2xl': 'text-3xl font-bold',\n '3xl': 'text-4xl font-bold',\n '4xl': 'text-5xl font-bold',\n };\n\n const alignClasses = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n };\n\n const headerClass = `\n ${sizeClasses[size] || sizeClasses.lg}\n ${alignClasses[align] || alignClasses.left}\n ${underline ? 'border-b-2 border-gray-300 pb-2' : ''}\n ${customClass}\n text-gray-900\n `.trim();\n\n const descriptionClass = `\n mt-1 text-sm text-gray-600\n ${alignClasses[align] || alignClasses.left}\n `.trim();\n\n return (\n <div className=\"my-4\">\n <h2 className={headerClass}>\n {text}\n </h2>\n {description && (\n <p className={descriptionClass}>\n {description}\n </p>\n )}\n </div>\n );\n}\n\nexport default HeaderField;\n","import * as Popover from \"@radix-ui/react-popover\";\nimport { useState } from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport \"react-day-picker/dist/style.css\";\n\nfunction DateRangeField({ field, formValues, handleChange, handleBlur }) {\n const [open, setOpen] = useState(false);\n const selected = formValues[field.name] ?? null;\n\n const handleSelect = (date) => handleChange(field.name, date);\n const handleClear = () => handleChange(field.name, null);\n\n return (\n <div>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n id={field.name}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => setOpen(true)}\n onKeyDown={(e) => e.key === \"Enter\" && setOpen(true)}\n className=\"\n inline-flex items-center justify-between gap-2\n w-full h-9 rounded-md border border-gray-300 bg-white\n px-3 py-2 text-sm font-normal shadow-sm\n hover:bg-gray-50 hover:text-gray-900\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2\n disabled:cursor-not-allowed disabled:opacity-50\n \"\n >\n {selected ? (\n <span>{selected.toLocaleDateString()}</span>\n ) : (\n <span className=\"text-muted-foreground\">\n {field.placeholder || \"Select date\"}\n </span>\n )}\n\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"lucide lucide-chevron-down opacity-70\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n </Popover.Trigger>\n\n <Popover.Content\n align=\"start\"\n sideOffset={2}\n className=\"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto\"\n >\n <DayPicker\n mode=\"single\"\n selected={selected}\n onSelect={handleSelect}\n showOutsideDays\n className=\"rounded-md bg-white p-3 text-xs\"\n />\n \n {/* Action buttons */}\n <div className=\"flex items-center justify-between gap-2 border-t border-gray-200 p-3\">\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2\"\n >\n Clear\n </button>\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2\"\n >\n Done\n </button>\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n}\n\nexport default DateRangeField;\n","import React, { useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\n\nfunction TimeField({ field, formValues, handleChange, handleBlur }) {\n const [open, setOpen] = useState(false);\n const [hours, setHours] = useState(\"12\");\n const [minutes, setMinutes] = useState(\"00\");\n const [period, setPeriod] = useState(\"PM\");\n\n const value = formValues[field.name] || \"\";\n\n // Parse existing value if present\n React.useEffect(() => {\n if (value) {\n const timeMatch = value.match(/(\\d{1,2}):(\\d{2})\\s*(AM|PM)/i);\n if (timeMatch) {\n setHours(timeMatch[1].padStart(2, \"0\"));\n setMinutes(timeMatch[2]);\n setPeriod(timeMatch[3].toUpperCase());\n }\n }\n }, [value]);\n\n const handleApply = () => {\n const timeString = `${hours}:${minutes} ${period}`;\n handleChange(field.name, timeString);\n setOpen(false);\n };\n\n const handleClear = () => {\n handleChange(field.name, \"\");\n setHours(\"12\");\n setMinutes(\"00\");\n setPeriod(\"PM\");\n };\n\n const incrementHours = () => {\n const h = parseInt(hours);\n setHours(((h % 12) + 1).toString().padStart(2, \"0\"));\n };\n\n const decrementHours = () => {\n const h = parseInt(hours);\n setHours((h === 1 ? 12 : h - 1).toString().padStart(2, \"0\"));\n };\n\n const incrementMinutes = () => {\n const m = parseInt(minutes);\n setMinutes(((m + 5) % 60).toString().padStart(2, \"0\"));\n };\n\n const decrementMinutes = () => {\n const m = parseInt(minutes);\n setMinutes((m === 0 ? 55 : m - 5).toString().padStart(2, \"0\"));\n };\n\n return (\n <div>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n id={field.name}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => setOpen(true)}\n className=\"\n inline-flex items-center justify-between gap-2\n w-full h-9 rounded-md border border-gray-300 bg-white\n px-3 py-2 text-sm font-normal shadow-sm\n hover:bg-gray-50 hover:text-gray-900\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2\n disabled:cursor-not-allowed disabled:opacity-50\n \"\n >\n {value ? (\n <span>{value}</span>\n ) : (\n <span className=\"text-gray-400\">\n {field.placeholder || \"Select time\"}\n </span>\n )}\n\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"lucide lucide-clock opacity-70\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12 6 12 12 16 14\" />\n </svg>\n </button>\n </Popover.Trigger>\n\n <Popover.Content\n align=\"start\"\n sideOffset={2}\n className=\"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64\"\n >\n <div className=\"flex flex-col gap-4\">\n {/* Time picker */}\n <div className=\"flex items-center justify-center gap-2\">\n {/* Hours */}\n <div className=\"flex flex-col items-center\">\n <button\n type=\"button\"\n onClick={incrementHours}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"18 15 12 9 6 15\" />\n </svg>\n </button>\n <input\n type=\"text\"\n value={hours}\n onChange={(e) => {\n const val = e.target.value.replace(/\\D/g, \"\");\n if (val === \"\" || (parseInt(val) >= 1 && parseInt(val) <= 12)) {\n setHours(val.padStart(2, \"0\"));\n }\n }}\n className=\"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2\"\n maxLength=\"2\"\n />\n <button\n type=\"button\"\n onClick={decrementHours}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n </div>\n\n <span className=\"text-2xl font-semibold\">:</span>\n\n {/* Minutes */}\n <div className=\"flex flex-col items-center\">\n <button\n type=\"button\"\n onClick={incrementMinutes}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"18 15 12 9 6 15\" />\n </svg>\n </button>\n <input\n type=\"text\"\n value={minutes}\n onChange={(e) => {\n const val = e.target.value.replace(/\\D/g, \"\");\n if (val === \"\" || (parseInt(val) >= 0 && parseInt(val) <= 59)) {\n setMinutes(val.padStart(2, \"0\"));\n }\n }}\n className=\"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2\"\n maxLength=\"2\"\n />\n <button\n type=\"button\"\n onClick={decrementMinutes}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n </div>\n\n {/* AM/PM */}\n <div className=\"flex flex-col gap-1 ml-2\">\n <button\n type=\"button\"\n onClick={() => setPeriod(\"AM\")}\n className={`\n px-3 py-1 text-sm font-medium rounded\n ${\n period === \"AM\"\n ? \"bg-blue-600 text-white\"\n : \"bg-gray-100 text-gray-700 hover:bg-gray-200\"\n }\n `}\n >\n AM\n </button>\n <button\n type=\"button\"\n onClick={() => setPeriod(\"PM\")}\n className={`\n px-3 py-1 text-sm font-medium rounded\n ${\n period === \"PM\"\n ? \"bg-blue-600 text-white\"\n : \"bg-gray-100 text-gray-700 hover:bg-gray-200\"\n }\n `}\n >\n PM\n </button>\n </div>\n </div>\n\n {/* Action buttons */}\n <div className=\"flex items-center justify-between gap-2 border-t border-gray-200 pt-3\">\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2\"\n >\n Clear\n </button>\n <button\n type=\"button\"\n onClick={handleApply}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2\"\n >\n Done\n </button>\n </div>\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n}\n\nexport default TimeField;","import React from \"react\";\nimport { Error, Success, Warning, Info } from \"../components/formats/alerts/Alerts.jsx\";\n\nfunction AlertMessageField({ field }) {\n const { variant = \"info\", message, content } = field;\n\n const alertMessage = message || content || \"\";\n\n // Render based on variant type\n switch (variant.toLowerCase()) {\n case \"error\":\n case \"danger\":\n return <Error message={alertMessage} />;\n\n case \"success\":\n return <Success message={alertMessage} />;\n\n case \"warning\":\n case \"warn\":\n return <Warning message={alertMessage} />;\n\n case \"info\":\n case \"information\":\n default:\n return <Info message={alertMessage} />;\n }\n}\n\nexport default AlertMessageField;","import { InformationCircleIcon, XCircleIcon } from \"@heroicons/react/20/solid\";\nimport { CheckCircleIcon } from \"@heroicons/react/20/solid\";\nimport { ExclamationCircleIcon } from \"@heroicons/react/24/outline\";\nimport { htmlMarkup } from \"../../../../utils/html_markup\";\n\nfunction Error({ message }) {\n return (\n <div className=\"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <XCircleIcon aria-hidden=\"true\" className=\"size-5 text-red-500 shrink-0\" />\n <span className=\"text-sm font-medium text-red-900\">{message}</span>\n </div>\n </div>\n );\n}\nfunction Warning({ message }) {\n return (\n <div className=\"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <ExclamationCircleIcon\n aria-hidden=\"true\"\n className=\"size-5 text-amber-600 shrink-0\"\n />\n <span className=\"text-sm font-medium text-amber-900\">{message}</span>\n </div>\n </div>\n );\n}\n\nfunction Success({ message }) {\n return (\n <div className=\"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <CheckCircleIcon\n aria-hidden=\"true\"\n className=\"size-5 text-green-600 shrink-0\"\n />\n <span className=\"text-sm font-medium text-green-900\">{message}</span>\n </div>\n </div>\n );\n}\n\nfunction Info({ message }) {\n return (\n <div className=\"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <InformationCircleIcon\n aria-hidden=\"true\"\n className=\"size-5 text-blue-600 shrink-0\"\n />\n <span className=\"text-sm font-medium text-blue-900\">{message}</span>\n </div>\n </div>\n );\n}\n\nexport { Error, Success, Warning, Info };"],"mappings":"4jBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,iBAAAE,GAAA,yBAAAA,GAAA,aAAAC,EAAA,sBAAAA,EAAA,YAAAC,KAAA,eAAAC,GAAAL,ICES,IAAAM,GAAA,6BADM,SAARC,EAA0B,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAG,CACtD,SAAO,QAAC,UAAO,QAASA,EAAU,SAAAD,EAAS,CAC7C,CCHA,IAAAE,EAAqD,iBACrDC,GAAsB,2BACtBC,GAAkB,sBCFlB,IAAAC,GAAkB,sBAClBC,EAAkB,gCCDX,IAAMC,GAAS,CAAC,cAAiB,wBAAwB,EDGhE,IAAMC,GAAY,GAAAC,QAAM,OAAO,CAC3B,QAASC,GAAO,cAChB,QAAS,CACP,eAAgB,kBAClB,CACF,CAAC,EAEDF,GAAU,aAAa,SAAS,IAC7BG,GAAaA,EAAS,KACtBC,GAAU,CAZf,IAAAC,EAaM,GAAID,EAAM,UAAYA,EAAM,SAAS,SAAW,IAC9C,SAAAE,QAAM,MAAO,iDAAiD,EACvD,QAAQ,OAAO,iDAAiD,EACnE,GAAIF,EAAM,SACd,SAAAE,Q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AI,EAAI,KAE/E,OAAQuB,MACJ,OAACM,EAAA,CACG,MAAO7B,EACP,WAAY7B,EACZ,aAAc0C,EACd,WAAY,IAAMK,EAAWlB,EAAM,IAAI,EACvC,cAAetB,EACf,UAAWD,EAAWuB,EAAM,IAAI,GAAK,EAEzC,EAAIA,CACR,CAEJ,EAGA,SACI,QAAC,QAAK,SAAUmB,EAAc,UAAU,oCACnC,UAAArD,EACGA,EAAe,OAAO,IAAI8D,CAAW,KAErC,OAAC,OAAI,sBAAU,EAElB5D,GACL,CAER,EAEO8D,GAAQjE,GF/Wf,IAAOkE,GAAQC","names":["index_exports","__export","DynamicForm_default","MyButton","index_default","__toCommonJS","import_jsx_runtime","MyButton","children","onClick","import_react","import_react_hot_toast","import_dayjs","import_axios","import_react_hot_toast","config","apiClient","axios","config","response","error","_a","toast","Interceptors_default","import_jsx_runtime","HiddenField","field","HiddenField_default","import_react_select","import_animated","import_jsx_runtime","MultiSelectField","field","formValues","handleChange","touched","errors","handleBlur","isDisabled","options","animatedComponents","makeAnimated","currentValues","Select","selected","MultiSelectField_default","Select","import_react","import_solid","import_jsx_runtime","SelectField","field","formValues","handleChange","handleBlur","_a","value","isDisabled","options","val","option","SelectField_default","import_react","import_jsx_runtime","EmailField","field","formValues","handleChange","handleBlur","touched","errors","isDisabled","e","EmailField_default","import_react","import_jsx_runtime","InputField","field","formValues","handleChange","handleBlur","touched","errors","isDisabled","e","InputField_default","import_react","import_jsx_runtime","HtmlField","field","formValues","htmlContent","HtmlField_default","import_jsx_runtime","CheckboxField","field","formValues","handleChange","handleBlur","touched","errors","isDisabled","error","e","CheckboxField_default","Popover","import_react","import_react_day_picker","import_style","import_jsx_runtime","DateRangeField","field","formValues","handleChange","handleBlur","open","setOpen","selected","handleSelect","range","handleClear","e","DateRangePickerField_default","import_react","import_react_hot_toast","config","import_jsx_runtime","FileField","field","formValues","touched","errors","fileUploads","setFileUploads","fileInputRefs","handleChange","onFieldsChange","error","isMultiple","uploads","currentValues","values","isDisabled","disablebtnClasses","uploadUrl","config","formatFileSize","bytes","k","sizes","i","uploadFile","file","fieldName","formData","response","handleSingleFileUpload","uploadedData","newValues","handleMultiFileUpload","files","currentUrls","uploadedUrls","newUrls","handleFileChange","fileList","removeFile","urlToRemove","newValue","url","el","e","index","upload","u","fileName","FileField_default","import_react","import_jsx_runtime","TextAreaField","field","formValues","handleChange","handleBlur","touched","errors","charCount","setCharCounts","textareaRef","value","isDisabled","error","autoResize","el","handleTextareaChange","e","prev","TextArea_default","import_x_date_pickers","import_react","import_AdapterDayjs","import_DateTimeField","import_jsx_runtime","DayTimePickerField","field","formValues","handleChange","handleBlur","touched","errors","newValue","DayTimePickerField_default","import_react_separator","import_jsx_runtime","LineBreakField","field","LineBreakField_default","import_react","RadioGroup","import_jsx_runtime","RadioGroupField","field","formValues","handleChange","handleBlur","value","isDisabled","options","isInline","val","option","optionValue","optionLabel","optionDescription","itemId","RadioGroups_default","import_react","import_jsx_runtime","HeaderField","field","text","description","size","underline","align","customClass","sizeClasses","alignClasses","headerClass","descriptionClass","HeaderField_default","Popover","import_react","import_react_day_picker","import_style","import_jsx_runtime","DateRangeField","field","formValues","handleChange","handleBlur","open","setOpen","selected","handleSelect","date","handleClear","e","DatePickerField_default","import_react","Popover","import_jsx_runtime","TimeField","field","formValues","handleChange","handleBlur","open","setOpen","hours","setHours","minutes","setMinutes","period","setPeriod","value","React","timeMatch","handleApply","timeString","handleClear","incrementHours","h","decrementHours","incrementMinutes","m","decrementMinutes","e","val","timeField_default","import_react","import_solid","import_outline","import_jsx_runtime","Error","message","Warning","Success","Info","import_jsx_runtime","AlertMessageField","field","variant","message","content","alertMessage","Error","Success","Warning","Info","AlertMessageField_default","import_react_label","import_jsx_runtime","DynamicForm","formDefinition","sendFormValues","children","defaultValues","onFieldsChange","formValues","setFormValues","errors","setErrors","touched","setTouched","charCounts","setCharCounts","excludeFromFieldFormat","FIELD_RENDERERS","FileField_default","DateRangePickerField_default","DatePickerField_default","DayTimePickerField_default","timeField_default","HiddenField_default","MultiSelectField_default","SelectField_default","EmailField_default","HtmlField_default","CheckboxField_default","RadioGroups_default","InputField_default","TextArea_default","HeaderField_default","AlertMessageField_default","LineBreakField_default","FIELD_FORMATTERS","loadOptionsForField","field","dependentValue","response","Interceptors_default","options","item","f","error","initialValues","validateField","value","allValues","dayjs","handleChange","fieldName","newValues","option","newErrors","handleBlur","handleSubmit","e","allTouched","FIELD_COLOR_VARIANTS","fieldFormat","containerStyle","color","containerClasses","content","renderField","FieldComponent","DynamicForm_default","index_default","DynamicForm_default"]}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{jsx as _e}from"react/jsx-runtime";function ee({children:e,onClick:n}){return _e("button",{onClick:n,children:e})}import{useState as Q,useEffect as Oe,useMemo as $t}from"react";import{toast as It}from"react-hot-toast";import Ue from"dayjs";import je from"axios";import te from"react-hot-toast";var ce={REACT_API_URL:"http://localhost:5000/"};var de=je.create({baseURL:ce.REACT_API_URL,headers:{"Content-Type":"application/json"}});de.interceptors.response.use(e=>e.data,e=>{var n;if(e.response&&e.response.status===403)return te.error("You are not authorized to access this resource."),Promise.reject("You are not authorized to access this resource.");if(e.response)return te.error("An error occurred"),Promise.reject(((n=e.response.data)==null?void 0:n.message)||"An error occurred");te.error(e.message)});var me=de;import{jsx as Ge}from"react/jsx-runtime";function He(e){return Ge("input",{type:"hidden",name:e.name,value:e.value},e.name)}var ue=He;import We from"react-select";import Ve from"react-select/animated";import{jsx as qe}from"react/jsx-runtime";function Ye({field:e,formValues:n,handleChange:d,touched:h,errors:u,handleBlur:r}){let l=e.disabled&&e.disabled(n),m=e.options||[],a=Ve(),p=n[e.name]||[];return qe(We,{components:a,isMulti:!0,isDisabled:l,name:e.label,value:p,onChange:y=>d(e.name,y),options:m,placeholder:e.placeholder,closeMenuOnSelect:!1})}var pe=Ye;import*as b from"@radix-ui/react-select";import"react";import{ChevronDownIcon as Ke}from"@heroicons/react/20/solid";import{jsx as F,jsxs as V}from"react/jsx-runtime";function Xe({field:e,formValues:n,handleChange:d,handleBlur:h}){var m;let u=n[e.name]||"",r=typeof e.disabled=="function"?e.disabled(n):e.disabled,l=e.options||[];return V(b.Root,{value:u,onValueChange:a=>d(e.name,a),disabled:r,children:[V(b.Trigger,{id:e.name,onBlur:()=>h(e.name),className:`inline-flex items-center justify-between w-full px-3 py-2 border rounded-md text-sm transition-all
|
|
2
|
+
${r?"bg-gray-100 text-gray-500 cursor-not-allowed":"border-gray-300 hover:border-gray-400 focus:ring-2 focus:ring-blue-500"}
|
|
3
|
+
`,children:[F(b.Value,{placeholder:e.placeholder||`Select ${((m=e.label)==null?void 0:m.toLowerCase())||""}`}),F(b.Icon,{className:"ml-2 text-gray-500",children:F(Ke,{className:"w-4 h-4"})})]}),F(b.Portal,{children:V(b.Content,{className:"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]",position:"popper",sideOffset:5,children:[F(b.ScrollUpButton,{className:"flex items-center justify-center h-6 text-gray-500 bg-gray-50",children:F(b.Arrow,{className:"fill-white stroke-gray-200"})}),V(b.Viewport,{className:"p-1",children:[e.groupLabel&&F(b.Group,{children:F(b.Label,{className:"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide",children:e.groupLabel})}),l.map(a=>F(b.Item,{value:a.value,className:`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none
|
|
4
|
+
data-[state=checked]:bg-blue-50
|
|
5
|
+
data-[state=checked]:text-blue-600
|
|
6
|
+
`,children:F(b.ItemText,{children:a.label})},a.value)),e.separator&&F(b.Separator,{className:"my-1 h-px bg-gray-200"})]}),F(b.Arrow,{className:"fill-white stroke-gray-200"})]})})]})}var be=Xe;import"react";import{jsx as Qe}from"react/jsx-runtime";function Je({field:e,formValues:n,handleChange:d,handleBlur:h,touched:u,errors:r}){let l=e.readOnly&&e.disabled;return Qe("input",{...e.props,type:"email",value:n[e.name]||"",onChange:a=>d(e.name,a.target.value),onBlur:()=>h(e.name),disabled:l,name:e.name,placeholder:e.placeholder,className:`w-full px-3 py-2 border rounded-md ${!1?"border-red-500":"border-gray-300"} ${l?"bg-gray-100 text-gray-500 cursor-not-allowed":""}`})}var ge=Je;import"react";import{jsx as et}from"react/jsx-runtime";function Ze({field:e,formValues:n,handleChange:d,handleBlur:h,touched:u,errors:r}){console.log("Rendering InputField for",e);let l=e.readOnly||e.disabled;return et("input",{...e.props,id:e.name,type:e.type||"text",value:n[e.name]||"",onChange:a=>d(e.name,a.target.value),onBlur:()=>h(e.name),disabled:l,name:e.name,placeholder:e.placeholder,min:e.minLength,max:e.maxLength,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${!1?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${l?"bg-gray-50 text-gray-500":"bg-background"}`})}var oe=Ze;import"react";import{jsx as he}from"react/jsx-runtime";function tt({field:e,formValues:n}){let d=n[e.name]||e.content||"";return he("div",{className:`mb-4 ${e.fieldClass?e.fieldClass:"col-span-full"}`,id:e.name.toLowerCase()+"_id",children:he("div",{className:"w-full px-3 py-2 border rounded-md overflow-y-auto max-h-40 prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:d}})},e.name)}var xe=tt;import{jsx as re,jsxs as fe}from"react/jsx-runtime";function ot({field:e,formValues:n,handleChange:d,handleBlur:h,touched:u,errors:r}){let l=e.disabled&&e.disabled(n),m=!1;return fe("div",{className:"mt-1 space-x-2",children:[re("input",{...e.props,id:"id_"+e.name,type:"checkbox",checked:n[e.name]||!1,onChange:a=>d(e.name,a.target.checked),onBlur:()=>h(e.name),disabled:l,className:`rounded border-gray-300 ${l?"opacity-50 cursor-not-allowed":""}`}),fe("label",{className:"",htmlFor:"id_"+e.name,children:[e.label,e.required&&re("span",{className:"text-red-500",children:"*"})]}),m&&re("p",{className:"mt-1 text-sm text-red-500",children:m})]})}var ye=ot;import*as T from"@radix-ui/react-popover";import{useState as rt}from"react";import{DayPicker as at}from"react-day-picker";import"react-day-picker/dist/style.css";import{jsx as L,jsxs as G}from"react/jsx-runtime";function st({field:e,formValues:n,handleChange:d,handleBlur:h}){let[u,r]=rt(!1),l=n[e.name]??{from:null,to:null},m=p=>d(e.name,p),a=()=>d(e.name,{from:null,to:null});return L("div",{children:G(T.Root,{open:u,onOpenChange:r,children:[L(T.Trigger,{asChild:!0,children:G("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":u,onClick:()=>r(!0),onKeyDown:p=>p.key==="Enter"&&r(!0),className:`
|
|
7
|
+
inline-flex items-center justify-between gap-2
|
|
8
|
+
w-full h-9 rounded-md border border-gray-300 bg-white
|
|
9
|
+
px-3 py-2 text-sm font-normal shadow-sm
|
|
10
|
+
hover:bg-gray-50 hover:text-gray-900
|
|
11
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2
|
|
12
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
13
|
+
`,children:[l.from?l.to?G("span",{children:[l.from.toLocaleDateString()," \u2013 ",l.to.toLocaleDateString()]}):L("span",{children:l.from.toLocaleDateString()}):L("span",{className:"text-muted-foreground",children:e.placeholder||"Select date range"}),L("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-down opacity-70",children:L("path",{d:"m6 9 6 6 6-6"})})]})}),G(T.Content,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[L(at,{mode:"range",selected:l,onSelect:m,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),G("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[L("button",{type:"button",onClick:a,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),L("button",{type:"button",onClick:()=>r(!1),className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})]})})}var ve=st;import"react";import{toast as Ne}from"react-hot-toast";var we={apiBaseUrl:process.env.API_BASE_URL||""};import{Fragment as lt,jsx as $,jsxs as C}from"react/jsx-runtime";function nt({field:e,formValues:n,touched:d,errors:h,fileUploads:u,setFileUploads:r,fileInputRefs:l,handleChange:m,onFieldsChange:a}){let p=d[e.name]&&h[e.name],y=e.type==="multifile",N=u[e.name]||{},w=n[e.name],P=y?w||[]:[w].filter(Boolean),k=e.disabled&&e.disabled(n),A=`px-4 py-2 bg-gray-100 border rounded hover:bg-gray-200 ${k?"cursor-not-allowed":""}`,j=`${we.REACT_API_URL}uploads`,M=i=>{if(i===0)return"0 Bytes";let t=1024,o=["Bytes","KB","MB","GB"],s=Math.floor(Math.log(i)/Math.log(t));return parseFloat((i/Math.pow(t,s)).toFixed(2))+" "+o[s]},D=async(i,t)=>{let o=new FormData;o.append("file",i);let s=await fetch(`${j}`,{method:"POST",body:o});if(!s.ok)throw Ne.error("Upload failed"),new Error("Upload failed");return await s.json()},x=async(i,t)=>{if(!t)return;if(i.maxSize&&t.size>i.maxSize)throw new Error(`File size must not exceed ${M(i.maxSize)}`);let o=await D(t,i.name),s={...n,[i.name]:o};m(i.name,o),a(s)},S=async(i,t)=>{let o=n[i.name]||[];if(o.length+t.length>i.maxFiles)throw new Error(`Maximum ${i.maxFiles} files allowed`);t.forEach(v=>{if(i.maxSize&&v.size>i.maxSize)throw new Error(`Each file must not exceed ${M(i.maxSize)}`)});let s=await Promise.all(t.map(v=>D(v,i.name))),c=[...o,...s];m(i.name,c),a({...n,[i.name]:c})},W=async(i,t)=>{let o=Array.from(t);try{e.type==="file"?await x(e,o[0]):e.type==="multifile"&&await S(e,o),l.current[i]&&(l.current[i].value="")}catch(s){Ne.error(`Upload failed: ${s.message}`)}},Z=async(i,t)=>{let o;e.type==="file"?o="":o=(n[i]||[]).filter(c=>c!==t),m(i,o),a({...n,[i]:o}),l.current[i]&&(l.current[i].value="")};return C("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,children:[C("label",{className:"block font-medium mb-1",children:[e.label,e.required&&$("span",{className:"text-red-500",children:"*"})]}),C("div",{className:"space-y-2",children:[C("div",{className:"items-center space-x-2",children:[C("button",{type:"button",disabled:k,onClick:()=>l.current[e.name].click(),className:A,children:["Choose ",y?"Files":"File"]}),y&&P.length>0&&C("span",{className:"text-sm text-gray-600",children:[P.length," of ",e.maxFiles," files uploaded"]})]}),$("input",{ref:i=>l.current[e.name]=i,type:"file",accept:e.accept,multiple:y,className:"hidden",onChange:i=>W(e.name,i.target.files)}),$("div",{className:"space-y-2",children:P.map((i,t)=>{let o=Object.values(N).find(s=>s.file===i);return C("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[C("div",{className:"flex items-center space-x-2",children:[o&&C(lt,{children:[$("span",{className:"text-sm",children:o.fileName}),C("span",{className:"text-xs text-gray-500",children:["(",M(o.fileSize),")"]})]}),!o&&$("span",{className:"text-sm",children:i.original_name})]}),$("button",{type:"button",onClick:()=>Z(e.name,i),className:"text-red-500 hover:text-red-700 ml-3",children:"Remove"})]},i)})}),Object.entries(N).map(([i,t])=>t.status==="uploading"?C("div",{className:"relative pt-1",children:[C("div",{className:"flex items-center justify-between",children:[C("span",{className:"text-xs font-semibold inline-block text-blue-600",children:["Uploading ",i]}),C("span",{className:"text-xs font-semibold inline-block text-blue-600",children:[t.progress,"%"]})]}),$("div",{className:"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200",children:$("div",{className:"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500",style:{width:`${t.progress}%`}})})]},i):null)]}),p&&$("p",{className:"mt-1 text-sm text-red-500",children:p})]},e.name)}var ae=nt;import{useRef as it,useEffect as ct}from"react";import{jsx as ke,jsxs as Ce}from"react/jsx-runtime";function dt({field:e,formValues:n,handleChange:d,handleBlur:h,touched:u,errors:r,charCount:l,setCharCounts:m}){let a=it(null),p=n[e.name]||"",y=typeof e.disabled=="function"?e.disabled(n):e.disabled||e.readOnly,N=u!=null&&u[e.name]&&(r!=null&&r[e.name])?r[e.name]:null,w=()=>{let k=a.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight+2}px`)};ct(()=>{w()},[p]);let P=k=>{d(e.name,k.target.value),w(),m&&m(A=>({...A,[e.name]:k.target.value.length}))};return Ce("div",{className:"space-y-2",children:[ke("textarea",{...e.props,ref:a,id:e.name,name:e.name,placeholder:e.placeholder||"",value:p,onChange:P,onBlur:()=>h(e.name),disabled:y,maxLength:e.maxLength,rows:e.rows||3,className:`flex w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none overflow-y-auto ${N?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${y?"bg-gray-50 text-gray-500":"bg-background"}`,style:{minHeight:"80px",maxHeight:"400px"}}),ke("div",{className:"flex justify-between items-center",children:e.maxLength&&!e.readOnly&&Ce("span",{className:"text-xs text-gray-500",children:[l||0,"/",e.maxLength," characters"]})})]})}var Se=dt;import{LocalizationProvider as mt}from"@mui/x-date-pickers";import"react";import{AdapterDayjs as ut}from"@mui/x-date-pickers/AdapterDayjs";import{DateTimeField as pt}from"@mui/x-date-pickers/DateTimeField";import{jsx as se}from"react/jsx-runtime";function bt({field:e,formValues:n,handleChange:d,handleBlur:h,touched:u,errors:r}){return se("div",{children:se(mt,{dateAdapter:ut,adapterLocale:"aus",children:se(pt,{value:e.value,onChange:l=>d(e.name,l)})})})}var Fe=bt;import{Separator as ne}from"@radix-ui/react-separator";import{jsx as Y,jsxs as ht}from"react/jsx-runtime";function gt({field:e}){return e!=null&&e.label?ht("div",{className:"relative flex items-center py-4",children:[Y(ne,{className:"flex-1 h-px bg-gray-300"}),Y("span",{className:"px-3 font-medium text-gray-600 bg-white",children:e.label}),Y(ne,{className:"flex-1 h-px bg-gray-300"})]}):Y(ne,{className:"my-4 h-px bg-gray-300"})}var Re=gt;import"react";import*as O from"@radix-ui/react-radio-group";import{jsx as z,jsxs as Pe}from"react/jsx-runtime";function xt({field:e,formValues:n,handleChange:d,handleBlur:h}){let u=n[e.name]||"",r=typeof e.disabled=="function"?e.disabled(n):e.disabled,l=e.options||[],m=e.inline||!1;return z(O.Root,{value:u,onValueChange:a=>d(e.name,a),onBlur:()=>h(e.name),disabled:r,className:m?"flex flex-wrap gap-4":"space-y-3","aria-label":e.label||e.name,children:l.map(a=>{let p=typeof a=="object"?a.value:a,y=typeof a=="object"?a.label:a,N=typeof a=="object"?a.description:null,w=`${e.name}-${p}`;return Pe("div",{className:"relative flex items-start",children:[z("div",{className:"flex h-6 items-center",children:z(O.Item,{value:p,id:w,disabled:r,className:`
|
|
14
|
+
relative size-4 rounded-full border transition-all
|
|
15
|
+
${r?"border-gray-300 bg-gray-100 cursor-not-allowed":"border-gray-300 bg-white hover:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"}
|
|
16
|
+
data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600
|
|
17
|
+
`,children:z(O.Indicator,{className:"flex items-center justify-center w-full h-full relative after:content-[''] after:block after:w-1.5 after:h-1.5 after:rounded-full after:bg-white"})})}),Pe("div",{className:"ml-3 text-sm",children:[z("label",{htmlFor:w,className:`font-medium ${r?"text-gray-500":"text-gray-900 cursor-pointer"}`,children:y}),N&&!m&&z("p",{className:`text-sm ${r?"text-gray-400":"text-gray-500"}`,children:N})]})]},p)})})}var Le=xt;import"react";import{jsx as $e,jsxs as yt}from"react/jsx-runtime";function ft({field:e}){let n=e.text||e.label||"",d=e.description||"",h=e.size||"lg",u=e.underline||!1,r=e.align||"left",l=e.className||"",m={sm:"text-base font-semibold",md:"text-lg font-semibold",lg:"text-xl font-bold",xl:"text-2xl font-bold","2xl":"text-3xl font-bold","3xl":"text-4xl font-bold","4xl":"text-5xl font-bold"},a={left:"text-left",center:"text-center",right:"text-right"},p=`
|
|
18
|
+
${m[h]||m.lg}
|
|
19
|
+
${a[r]||a.left}
|
|
20
|
+
${u?"border-b-2 border-gray-300 pb-2":""}
|
|
21
|
+
${l}
|
|
22
|
+
text-gray-900
|
|
23
|
+
`.trim(),y=`
|
|
24
|
+
mt-1 text-sm text-gray-600
|
|
25
|
+
${a[r]||a.left}
|
|
26
|
+
`.trim();return yt("div",{className:"my-4",children:[$e("h2",{className:p,children:n}),d&&$e("p",{className:y,children:d})]})}var Ie=ft;import*as U from"@radix-ui/react-popover";import{useState as vt}from"react";import{DayPicker as wt}from"react-day-picker";import"react-day-picker/dist/style.css";import{jsx as I,jsxs as q}from"react/jsx-runtime";function Nt({field:e,formValues:n,handleChange:d,handleBlur:h}){let[u,r]=vt(!1),l=n[e.name]??null,m=p=>d(e.name,p),a=()=>d(e.name,null);return I("div",{children:q(U.Root,{open:u,onOpenChange:r,children:[I(U.Trigger,{asChild:!0,children:q("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":u,onClick:()=>r(!0),onKeyDown:p=>p.key==="Enter"&&r(!0),className:`
|
|
27
|
+
inline-flex items-center justify-between gap-2
|
|
28
|
+
w-full h-9 rounded-md border border-gray-300 bg-white
|
|
29
|
+
px-3 py-2 text-sm font-normal shadow-sm
|
|
30
|
+
hover:bg-gray-50 hover:text-gray-900
|
|
31
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2
|
|
32
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
33
|
+
`,children:[l?I("span",{children:l.toLocaleDateString()}):I("span",{className:"text-muted-foreground",children:e.placeholder||"Select date"}),I("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-down opacity-70",children:I("path",{d:"m6 9 6 6 6-6"})})]})}),q(U.Content,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto",children:[I(wt,{mode:"single",selected:l,onSelect:m,showOutsideDays:!0,className:"rounded-md bg-white p-3 text-xs"}),q("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 p-3",children:[I("button",{type:"button",onClick:a,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),I("button",{type:"button",onClick:()=>r(!1),className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})]})})}var Ee=Nt;import kt,{useState as K}from"react";import*as _ from"@radix-ui/react-popover";import{jsx as g,jsxs as E}from"react/jsx-runtime";function Ct({field:e,formValues:n,handleChange:d,handleBlur:h}){let[u,r]=K(!1),[l,m]=K("12"),[a,p]=K("00"),[y,N]=K("PM"),w=n[e.name]||"";kt.useEffect(()=>{if(w){let x=w.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);x&&(m(x[1].padStart(2,"0")),p(x[2]),N(x[3].toUpperCase()))}},[w]);let P=()=>{let x=`${l}:${a} ${y}`;d(e.name,x),r(!1)},k=()=>{d(e.name,""),m("12"),p("00"),N("PM")},A=()=>{let x=parseInt(l);m((x%12+1).toString().padStart(2,"0"))},j=()=>{let x=parseInt(l);m((x===1?12:x-1).toString().padStart(2,"0"))},M=()=>{let x=parseInt(a);p(((x+5)%60).toString().padStart(2,"0"))},D=()=>{let x=parseInt(a);p((x===0?55:x-5).toString().padStart(2,"0"))};return g("div",{children:E(_.Root,{open:u,onOpenChange:r,children:[g(_.Trigger,{asChild:!0,children:E("button",{type:"button",id:e.name,"aria-haspopup":"dialog","aria-expanded":u,onClick:()=>r(!0),className:`
|
|
34
|
+
inline-flex items-center justify-between gap-2
|
|
35
|
+
w-full h-9 rounded-md border border-gray-300 bg-white
|
|
36
|
+
px-3 py-2 text-sm font-normal shadow-sm
|
|
37
|
+
hover:bg-gray-50 hover:text-gray-900
|
|
38
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2
|
|
39
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
40
|
+
`,children:[w?g("span",{children:w}):g("span",{className:"text-gray-400",children:e.placeholder||"Select time"}),E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-clock opacity-70",children:[g("circle",{cx:"12",cy:"12",r:"10"}),g("polyline",{points:"12 6 12 12 16 14"})]})]})}),g(_.Content,{align:"start",sideOffset:2,className:"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64",children:E("div",{className:"flex flex-col gap-4",children:[E("div",{className:"flex items-center justify-center gap-2",children:[E("div",{className:"flex flex-col items-center",children:[g("button",{type:"button",onClick:A,className:"p-1 hover:bg-gray-100 rounded",children:g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:g("polyline",{points:"18 15 12 9 6 15"})})}),g("input",{type:"text",value:l,onChange:x=>{let S=x.target.value.replace(/\D/g,"");(S===""||parseInt(S)>=1&&parseInt(S)<=12)&&m(S.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),g("button",{type:"button",onClick:j,className:"p-1 hover:bg-gray-100 rounded",children:g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:g("polyline",{points:"6 9 12 15 18 9"})})})]}),g("span",{className:"text-2xl font-semibold",children:":"}),E("div",{className:"flex flex-col items-center",children:[g("button",{type:"button",onClick:M,className:"p-1 hover:bg-gray-100 rounded",children:g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:g("polyline",{points:"18 15 12 9 6 15"})})}),g("input",{type:"text",value:a,onChange:x=>{let S=x.target.value.replace(/\D/g,"");(S===""||parseInt(S)>=0&&parseInt(S)<=59)&&p(S.padStart(2,"0"))},className:"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2",maxLength:"2"}),g("button",{type:"button",onClick:D,className:"p-1 hover:bg-gray-100 rounded",children:g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:g("polyline",{points:"6 9 12 15 18 9"})})})]}),E("div",{className:"flex flex-col gap-1 ml-2",children:[g("button",{type:"button",onClick:()=>N("AM"),className:`
|
|
41
|
+
px-3 py-1 text-sm font-medium rounded
|
|
42
|
+
${y==="AM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
|
|
43
|
+
`,children:"AM"}),g("button",{type:"button",onClick:()=>N("PM"),className:`
|
|
44
|
+
px-3 py-1 text-sm font-medium rounded
|
|
45
|
+
${y==="PM"?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}
|
|
46
|
+
`,children:"PM"})]})]}),E("div",{className:"flex items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[g("button",{type:"button",onClick:k,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2",children:"Clear"}),g("button",{type:"button",onClick:P,className:"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2",children:"Done"})]})]})})]})})}var Me=Ct;import"react";import{InformationCircleIcon as St,XCircleIcon as Ft}from"@heroicons/react/20/solid";import{CheckCircleIcon as Rt}from"@heroicons/react/20/solid";import{ExclamationCircleIcon as Pt}from"@heroicons/react/24/outline";import{jsx as R,jsxs as X}from"react/jsx-runtime";function Be({message:e}){return R("div",{className:"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm",children:X("div",{className:"flex items-center gap-3",children:[R(Ft,{"aria-hidden":"true",className:"size-5 text-red-500 shrink-0"}),R("span",{className:"text-sm font-medium text-red-900",children:e})]})})}function Ae({message:e}){return R("div",{className:"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm",children:X("div",{className:"flex items-center gap-3",children:[R(Pt,{"aria-hidden":"true",className:"size-5 text-amber-600 shrink-0"}),R("span",{className:"text-sm font-medium text-amber-900",children:e})]})})}function De({message:e}){return R("div",{className:"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm",children:X("div",{className:"flex items-center gap-3",children:[R(Rt,{"aria-hidden":"true",className:"size-5 text-green-600 shrink-0"}),R("span",{className:"text-sm font-medium text-green-900",children:e})]})})}function Te({message:e}){return R("div",{className:"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm",children:X("div",{className:"flex items-center gap-3",children:[R(St,{"aria-hidden":"true",className:"size-5 text-blue-600 shrink-0"}),R("span",{className:"text-sm font-medium text-blue-900",children:e})]})})}import{jsx as J}from"react/jsx-runtime";function Lt({field:e}){let{variant:n="info",message:d,content:h}=e,u=d||h||"";switch(n.toLowerCase()){case"error":case"danger":return J(Be,{message:u});case"success":return J(De,{message:u});case"warning":case"warn":return J(Ae,{message:u});case"info":case"information":default:return J(Te,{message:u})}}var ze=Lt;import{Label as Et}from"@radix-ui/react-label";import{Fragment as Bt,jsx as B,jsxs as le}from"react/jsx-runtime";var Mt=({formDefinition:e,sendFormValues:n,children:d,defaultValues:h={},onFieldsChange:u=()=>{}})=>{let[r,l]=Q({...h}),[m,a]=Q({}),[p,y]=Q({}),[N,w]=Q({}),P=["hidden","html","linebreak","header","alert"],k=$t(()=>({file:ae,multifile:ae,dateRange:ve,date:Ee,dayTimePicker:Fe,time:Me,hidden:ue,multiselect:pe,select:be,email:ge,litertext:xe,checkbox:ye,radiogroup:Le,input:oe,textarea:Se,header:Ie,alert:ze,linebreak:Re}),[]),A={},j=async(t,o=null)=>{try{let s=await me(`/${t.optionsUrl}`);console.log(s);let c=[];t.type==="select"?c=[{value:"",label:`Select ${t.label.toLowerCase()}`},...s.data]:c=[...s.data.map(v=>({value:v.value,label:v.label}))],e.fields.forEach(v=>{v.name===t.name&&(v.options=c)})}catch(s){console.error(`Failed to load options for ${t.name}:`,s)}finally{}};Oe(()=>{if(e!=null&&e.fields&&e.fields.length>0){if(!e.fields.some(s=>s.value))return;e.fields.forEach(s=>{s.optionsUrl&&j(s)});let o={};e.fields.forEach(s=>{o[s.name]=h[s.name]??s.value??(s.type==="multiselect"?[]:"")}),l(o)}},[e]);let M=(t,o,s)=>{if(t.disabled&&t.disabled(s))return null;if(t.required){if(!o)return`${t.label} is required`;if(Array.isArray(o)&&o.length===0)return`Please select at least one ${t.label.toLowerCase()}`}if(t.validate){let c=t.validate(o,s);if(c)return c}if(t.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o))return"Please enter a valid email address";if(t.type==="number"){if(t.min!==void 0&&o<t.min)return`${t.label} must be at least ${t.min}`;if(t.max!==void 0&&o>t.max)return`${t.label} must be no more than ${t.max}`}return t.type==="date"&&!Ue(o).isValid()?`${t.label} must be a valid date`:t.maxLength&&o&&o.length>t.maxLength?`${t.label} must not exceed ${t.maxLength} characters`:null},D=(t,o)=>{let s=e.fields.find(f=>f.name===t);if(!s)return;let c={...r};console.log(o),s.type==="multiselect"?c[t]=Array.isArray(o)?o:Array.from(o.target.selectedOptions).map(f=>f.value):s.type==="dateRange"?(console.log(o),c[t]=[{startDate:o[0].from,endDate:o[0].to,key:"selection"}]):s.type==="dayTimePicker"?c[t]=o?Ue(o).format("YYYY-MM-DD HH:mm:ss"):"":c[t]=o,s.type==="select"&&e.fields.forEach(f=>{f.showIf&&!f.showIf(c)&&(c[f.name]=f.type==="multiselect"?[]:"")}),e.fields.forEach(f=>{f.disabled&&f.disabled(c)&&(c[f.name]=f.type==="multiselect"?[]:"")}),l(c);let v={};e.fields.forEach(f=>{if(!f.showIf||f.showIf(c)){let H=M(f,c[f.name],c);H&&(v[f.name]=H)}}),a(v)},x=t=>{y({...p,[t]:!0})},S=t=>{t.preventDefault();let o={};e.fields.forEach(c=>{o[c.name]=!0}),y(o);let s={};e.fields.forEach(c=>{if((!c.showIf||c.showIf(r))&&(!c.disabled||!c.disabled(r))){let v=M(c,r[c.name],r);v&&(s[c.name]=v)}}),a(s),Object.keys(s).length===0?n(r):It.error("Please correct the errors in the form")};Oe(()=>{u(r)},[r,u]);let W={green:"border-green-500 bg-green-50",blue:"border-blue-500 bg-blue-50",red:"border-red-500 bg-red-50",yellow:"border-yellow-500 bg-yellow-50",purple:"border-purple-500 bg-purple-50",indigo:"border-indigo-500 bg-indigo-50",gray:"border-gray-500 bg-gray-50",pink:"border-pink-500 bg-pink-50",orange:"border-orange-500 bg-orange-50"};function Z(t,o,s){if(P.includes(o.type))return B("div",{className:o.fieldClass||"col-span-8",children:t});let c=o.containerStyle,v=o.color||"blue",f=c==="card"?`rounded-lg border text-card-foreground shadow-sm p-4 ${o.containerClassName||W[v]||W.blue}`:"",H=le(Bt,{children:[o.label&&le(Et,{htmlFor:o.name,className:"block text-sm font-medium mb-1",children:[o.label,o.required&&B("span",{className:"text-red-500 ml-1",children:"*"})]}),B("div",{children:t}),s&&B("p",{className:"mt-1 text-sm text-red-500",children:s})]});return B("div",{className:`mb-4 ${o.fieldClass||"col-span-8"}`,children:c==="card"?B("div",{className:f,children:H}):H})}let i=t=>{if(t.showIf&&!t.showIf(r))return null;let o=k[t.type]||oe;r[t.name]===void 0&&(r[t.name]=t.value!==void 0?t.value:t.type==="multiselect"?[]:"");let s=p[t.name]&&m[t.name]?m[t.name]:null;return Z(B(o,{field:t,formValues:r,handleChange:D,handleBlur:()=>x(t.name),setCharCounts:w,charCount:N[t.name]||0}),t)};return le("form",{onSubmit:S,className:"grid grid-cols-12 gap-x-4 mx-auto",children:[e?e.fields.map(i):B("div",{children:"Loading..."}),d]})},ie=Mt;var Or=ie;export{ie as DynamicForm,ie as DynamicFormComponent,ee as MyButton,ee as MyButtonComponent,Or as default};
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/MyButton.jsx","../src/DynamicForm/DynamicForm.jsx","../src/services/Interceptors.jsx","../src/config.jsx","../src/DynamicForm/fields/HiddenField.jsx","../src/DynamicForm/fields/MultiSelectField.jsx","../src/DynamicForm/fields/SelectField.jsx","../src/DynamicForm/fields/EmailField.jsx","../src/DynamicForm/fields/InputField.jsx","../src/DynamicForm/fields/HtmlField.jsx","../src/DynamicForm/fields/CheckboxField.jsx","../src/DynamicForm/fields/DateRangePickerField.jsx","../src/DynamicForm/fields/FileField.jsx","../src/config.js","../src/DynamicForm/fields/TextArea.jsx","../src/DynamicForm/fields/DayTimePickerField.jsx","../src/DynamicForm/fields/LineBreakField.jsx","../src/DynamicForm/fields/RadioGroups.jsx","../src/DynamicForm/fields/HeaderField.jsx","../src/DynamicForm/fields/DatePickerField.jsx","../src/DynamicForm/fields/timeField.jsx","../src/DynamicForm/fields/AlertMessageField.jsx","../src/DynamicForm/components/formats/alerts/Alerts.jsx","../src/index.jsx"],"sourcesContent":["// src/MyButton.jsx\nexport default function MyButton({ children, onClick }) {\n return <button onClick={onClick}>{children}</button>;\n}","import { useState, useEffect, useRef, useMemo } from \"react\";\nimport { toast } from \"react-hot-toast\";\nimport dayjs from \"dayjs\";\n// import \"dayjs/locale/de\"; // Remove this to avoid module resolution issues\nimport apiClient from \"../services/Interceptors.jsx\";\nimport { default as RenderHiddenField } from \"./fields/HiddenField\";\nimport { default as RenderMultiSelectField } from \"./fields/MultiSelectField\";\nimport { default as RenderSelectField } from \"./fields/SelectField\";\nimport { default as RenderEmailField } from \"./fields/EmailField\";\nimport { default as RenderInputField } from \"./fields/InputField\";\nimport { default as RenderHtmlField } from \"./fields/HtmlField\";\nimport { default as RenderCheckboxField } from \"./fields/CheckboxField\";\nimport { default as RenderDayPickerField } from \"./fields/DateRangePickerField\";\nimport { default as RenderFileInputField } from \"./fields/FileField\";\nimport { default as RenderTextAreaField } from \"./fields/TextArea\";\nimport { default as DayTimePickerField } from \"./fields/DayTimePickerField\";\nimport { default as RenderLineBreakField } from \"./fields/LineBreakField\";\nimport { default as RenderRadioGroupField } from \"./fields/RadioGroups\";\nimport { default as RenderHeaderField } from \"./fields/HeaderField\";\nimport { default as RenderDatePickerField } from \"./fields/DatePickerField\";\nimport { default as RenderTimeField } from \"./fields/timeField\";\nimport { default as RenderAlertMessageField } from \"./fields/AlertMessageField\";\nimport { Label } from \"@radix-ui/react-label\";\nconst DynamicForm = ({\n formDefinition,\n sendFormValues,\n children,\n defaultValues = {},\n onFieldsChange = () => { },\n}) => {\n\n const [formValues, setFormValues] = useState({ ...defaultValues });\n const [errors, setErrors] = useState({});\n const [touched, setTouched] = useState({});\n const [charCounts, setCharCounts] = useState({});\n const excludeFromFieldFormat = [\"hidden\", \"html\", \"linebreak\", \"header\", \"alert\"];\n const FIELD_RENDERERS = useMemo(() => ({\n file: RenderFileInputField,\n multifile: RenderFileInputField,\n dateRange: RenderDayPickerField,\n date: RenderDatePickerField,\n dayTimePicker: DayTimePickerField,\n time: RenderTimeField,\n hidden: RenderHiddenField,\n multiselect: RenderMultiSelectField,\n select: RenderSelectField,\n email: RenderEmailField,\n litertext: RenderHtmlField,\n checkbox: RenderCheckboxField,\n radiogroup: RenderRadioGroupField,\n input: RenderInputField,\n textarea: RenderTextAreaField,\n header: RenderHeaderField,\n alert: RenderAlertMessageField,\n linebreak: RenderLineBreakField,\n\n }), []);\n\n\n const FIELD_FORMATTERS = {\n\n\n }\n\n const loadOptionsForField = async (field, dependentValue = null) => {\n\n try {\n const response = await apiClient(`/${field.optionsUrl}`);\n console.log(response)\n // Add empty option at the beginning if not exists\n let options = [];\n if (field.type === \"select\") {\n options = [\n { value: \"\", label: `Select ${field.label.toLowerCase()}` },\n ...response.data,\n ];\n } else {\n options = [...response.data.map((item) => (\n { value: item.value, label: item.label }\n ))];\n }\n formDefinition.fields.forEach((f) => {\n if (f.name === field.name) {\n f.options = options;\n }\n });\n //setFieldOptions((prev) => ({ ...prev, [field.name]: options }));\n } catch (error) {\n console.error(`Failed to load options for ${field.name}:`, error);\n } finally {\n }\n };\n\n\n useEffect(() => {\n if (formDefinition?.fields && formDefinition.fields.length > 0) {\n // Wait until at least one field has a non-empty value\n const hasData = formDefinition.fields.some((f) => f.value);\n if (!hasData) return; // Don't set empty values early\n\n // Load async options\n formDefinition.fields.forEach((field) => {\n if (field.optionsUrl) loadOptionsForField(field);\n });\n\n // Initialise form values\n const initialValues = {};\n formDefinition.fields.forEach((field) => {\n initialValues[field.name] =\n defaultValues[field.name] ??\n field.value ??\n (field.type === \"multiselect\" ? [] : \"\");\n });\n\n setFormValues(initialValues);\n }\n }, [formDefinition]);\n\n\n\n\n\n const validateField = (field, value, allValues) => {\n if (field.disabled && field.disabled(allValues)) {\n return null;\n }\n\n if (field.required) {\n if (!value) {\n return `${field.label} is required`;\n }\n if (Array.isArray(value) && value.length === 0) {\n return `Please select at least one ${field.label.toLowerCase()}`;\n }\n }\n\n if (field.validate) {\n const error = field.validate(value, allValues);\n if (error) return error;\n }\n\n // Email validation addition\n if (field.type === \"email\") {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (!emailRegex.test(value)) return \"Please enter a valid email address\";\n }\n\n if (field.type === \"number\") {\n if (field.min !== undefined && value < field.min) {\n return `${field.label} must be at least ${field.min}`;\n }\n if (field.max !== undefined && value > field.max) {\n return `${field.label} must be no more than ${field.max}`;\n }\n }\n\n if (field.type === \"date\") {\n // Ensure the value is a valid date\n if (!dayjs(value).isValid()) {\n return `${field.label} must be a valid date`;\n }\n }\n\n if (field.maxLength && value && value.length > field.maxLength) {\n return `${field.label} must not exceed ${field.maxLength} characters`;\n }\n\n return null;\n };\n\n\n const handleChange = (fieldName, value) => {\n const field = formDefinition.fields.find((f) => f.name === fieldName);\n if (!field) return;\n\n const newValues = { ...formValues };\n console.log(value)\n // Handle multiselect values\n if (field.type === \"multiselect\") {\n newValues[fieldName] = Array.isArray(value)\n ? value\n : Array.from(value.target.selectedOptions).map((option) => option.value);\n }\n // Handle DateRangePicker (dayPicker)\n\n else if (field.type === \"dateRange\") {\n console.log(value)\n newValues[fieldName] = [\n {\n startDate: value[0].from,\n endDate: value[0].to,\n key: \"selection\",\n },\n ];\n\n }\n // Handle DateTime Picker\n else if (field.type === \"dayTimePicker\") {\n newValues[fieldName] = value ? dayjs(value).format(\"YYYY-MM-DD HH:mm:ss\") : \"\";\n }\n else {\n newValues[fieldName] = value;\n }\n\n // Clear dependent fields when parent selection changes\n if (field.type === \"select\") {\n formDefinition.fields.forEach((f) => {\n if (f.showIf && !f.showIf(newValues)) {\n newValues[f.name] = f.type === \"multiselect\" ? [] : \"\";\n }\n });\n }\n\n formDefinition.fields.forEach((f) => {\n if (f.disabled && f.disabled(newValues)) {\n newValues[f.name] = f.type === \"multiselect\" ? [] : \"\";\n }\n });\n\n setFormValues(newValues);\n\n // Validate all fields\n const newErrors = {};\n formDefinition.fields.forEach((f) => {\n if (!f.showIf || f.showIf(newValues)) {\n const error = validateField(f, newValues[f.name], newValues);\n if (error) newErrors[f.name] = error;\n }\n });\n\n setErrors(newErrors);\n };\n\n\n const handleBlur = (fieldName) => {\n setTouched({ ...touched, [fieldName]: true });\n };\n\n const handleSubmit = (e) => {\n e.preventDefault();\n\n const allTouched = {};\n formDefinition.fields.forEach((field) => {\n allTouched[field.name] = true;\n });\n setTouched(allTouched);\n\n const newErrors = {};\n formDefinition.fields.forEach((field) => {\n if (\n (!field.showIf || field.showIf(formValues)) &&\n (!field.disabled || !field.disabled(formValues))\n ) {\n const error = validateField(field, formValues[field.name], formValues);\n if (error) newErrors[field.name] = error;\n }\n });\n\n setErrors(newErrors);\n\n if (Object.keys(newErrors).length === 0) {\n sendFormValues(formValues);\n } else {\n toast.error(\"Please correct the errors in the form\");\n }\n };\n\n\n useEffect(() => {\n\n onFieldsChange(formValues);\n\n }, [formValues, onFieldsChange]);\n\n\n // Color variants for field card container\n const FIELD_COLOR_VARIANTS = {\n green: 'border-green-500 bg-green-50',\n blue: 'border-blue-500 bg-blue-50',\n red: 'border-red-500 bg-red-50',\n yellow: 'border-yellow-500 bg-yellow-50',\n purple: 'border-purple-500 bg-purple-50',\n indigo: 'border-indigo-500 bg-indigo-50',\n gray: 'border-gray-500 bg-gray-50',\n pink: 'border-pink-500 bg-pink-50',\n orange: 'border-orange-500 bg-orange-50',\n };\n\n\n function fieldFormat(children, field, error) {\n if (excludeFromFieldFormat.includes(field.type)) {\n return <div className={field.fieldClass || \"col-span-8\"}>{children}</div>;\n }\n\n const containerStyle = field.containerStyle;\n const color = field.color || 'blue';\n const containerClasses = containerStyle === 'card'\n ? `rounded-lg border text-card-foreground shadow-sm p-4 ${field.containerClassName || FIELD_COLOR_VARIANTS[color] || FIELD_COLOR_VARIANTS.blue}`\n : '';\n\n const content = (\n <>\n {field.label && (\n <Label\n htmlFor={field.name}\n className=\"block text-sm font-medium mb-1\"\n >\n {field.label}\n {field.required && <span className=\"text-red-500 ml-1\">*</span>}\n </Label>\n )}\n\n {/* InputField or any other field goes here */}\n <div>{children}</div>\n\n {error && (\n <p className=\"mt-1 text-sm text-red-500\">\n {error}\n </p>\n )}\n </>\n );\n\n return (\n <div className={`mb-4 ${field.fieldClass || \"col-span-8\"}`}>\n {containerStyle === 'card' ? (\n <div className={containerClasses}>\n {content}\n </div>\n ) : content}\n </div>\n );\n }\n\n const renderField = (field) => {\n if (field.showIf && !field.showIf(formValues)) return null;\n\n const FieldComponent = FIELD_RENDERERS[field.type] || RenderInputField;\n if (formValues[field.name] === undefined) {\n formValues[field.name] =\n field.value !== undefined\n ? field.value\n : field.type === \"multiselect\"\n ? []\n : \"\";\n }\n\n const error = touched[field.name] && errors[field.name] ? errors[field.name] : null;\n\n return (fieldFormat(\n <FieldComponent\n field={field}\n formValues={formValues}\n handleChange={handleChange}\n handleBlur={() => handleBlur(field.name)}\n setCharCounts={setCharCounts}\n charCount={charCounts[field.name] || 0}\n //error={error}\n />, field\n )\n );\n };\n\n\n return (\n <form onSubmit={handleSubmit} className=\"grid grid-cols-12 gap-x-4 mx-auto\">\n {formDefinition ? (\n formDefinition.fields.map(renderField)\n ) : (\n <div>Loading...</div>\n )}\n {children}\n </form>\n );\n};\n\nexport default DynamicForm;","import axios from 'axios';\nimport toast from 'react-hot-toast';\nimport {config} from '../config';\nconst apiClient = axios.create({\n baseURL: config.REACT_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n \n apiClient.interceptors.response.use(\n (response) => response.data,\n (error) => {\n if (error.response && error.response.status === 403) {\n toast.error( 'You are not authorized to access this resource.');\n return Promise.reject('You are not authorized to access this resource.');\n }else if (error.response) {\n toast.error( 'An error occurred' );\n return Promise.reject(error.response.data?.message || 'An error occurred');\n } else{\n toast.error(error.message);\n }\n \n\n }\n );\n export default apiClient;","export const config = {\"REACT_API_URL\": \"http://localhost:5000/\"};","\n// This component renders a hidden input field for forms. This used to include data in form submissions without displaying it to the user.\nfunction HiddenField(field) {\n return <input type=\"hidden\" name={field.name} value={field.value} key={field.name} />;\n}\nexport default HiddenField;","import Select from 'react-select'\nimport makeAnimated from 'react-select/animated'\n\nfunction MultiSelectField({ field, formValues, handleChange, touched, errors, handleBlur }) {\n //const error = touched[field.name] && errors[field.name];\n const isDisabled = field.disabled && field.disabled(formValues);\n const options = field.options || [];\n\n const animatedComponents = makeAnimated();\n\n const currentValues = formValues[field.name] || [];\n\n return (\n\n <Select\n components={animatedComponents}\n isMulti\n isDisabled={isDisabled}\n name={field.label}\n value={currentValues}\n onChange={(selected) => handleChange(field.name, selected)}\n options={options}\n placeholder={field.placeholder}\n closeMenuOnSelect={false}\n />\n\n );\n}\nexport default MultiSelectField;","import * as Select from \"@radix-ui/react-select\";\nimport React from \"react\";\n// get arrow down icon from icon hero icon\nimport { ChevronDownIcon } from \"@heroicons/react/20/solid\";\n\nfunction SelectField({ field, formValues, handleChange, handleBlur }) {\n const value = formValues[field.name] || \"\";\n const isDisabled =\n typeof field.disabled === \"function\"\n ? field.disabled(formValues)\n : field.disabled;\n const options = field.options || [];\n\n return (\n <Select.Root\n value={value}\n onValueChange={(val) => handleChange(field.name, val)}\n disabled={isDisabled}\n >\n {/* --- Trigger --- */}\n <Select.Trigger\n id={field.name}\n onBlur={() => handleBlur(field.name)}\n className={`inline-flex items-center justify-between w-full px-3 py-2 border rounded-md text-sm transition-all\n ${isDisabled\n ? \"bg-gray-100 text-gray-500 cursor-not-allowed\"\n : \"border-gray-300 hover:border-gray-400 focus:ring-2 focus:ring-blue-500\"}\n `}\n >\n <Select.Value\n placeholder={\n field.placeholder || `Select ${field.label?.toLowerCase() || \"\"}`\n }\n />\n <Select.Icon className=\"ml-2 text-gray-500\">\n <ChevronDownIcon className=\"w-4 h-4\" />\n </Select.Icon>\n </Select.Trigger>\n\n {/* --- Dropdown --- */}\n <Select.Portal>\n <Select.Content\n className=\"bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[var(--radix-select-trigger-width)]\"\n position=\"popper\"\n sideOffset={5}\n >\n {/* Scroll Up */}\n <Select.ScrollUpButton className=\"flex items-center justify-center h-6 text-gray-500 bg-gray-50\">\n <Select.Arrow className=\"fill-white stroke-gray-200\" />\n </Select.ScrollUpButton>\n\n <Select.Viewport className=\"p-1\">\n {/* Optional grouped items */}\n {field.groupLabel && (\n <Select.Group>\n <Select.Label className=\"px-2 py-1 text-xs text-gray-500 uppercase tracking-wide\">\n {field.groupLabel}\n </Select.Label>\n </Select.Group>\n )}\n\n {/* List of options */}\n {options.map((option) => (\n <Select.Item\n key={option.value}\n value={option.value}\n className={`relative flex items-center px-3 py-2 text-sm rounded cursor-pointer select-none\n data-[state=checked]:bg-blue-50\n data-[state=checked]:text-blue-600\n `}\n >\n <Select.ItemText>{option.label}</Select.ItemText>\n\n </Select.Item>\n ))}\n\n {/* Optional separator */}\n {field.separator && (\n <Select.Separator className=\"my-1 h-px bg-gray-200\" />\n )}\n </Select.Viewport>\n\n {/* Scroll Down */}\n\n {/* Optional arrow */}\n <Select.Arrow className=\"fill-white stroke-gray-200\" />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n}\n\nexport default SelectField;\n","import React from 'react';\n\nfunction EmailField({ field, formValues, handleChange, handleBlur, touched, errors }) {\n //const error = touched[field.name] && errors[field.name];\n const isDisabled = field.readOnly && field.disabled;\n const error = false;\n return (\n <input\n {...field.props}\n type=\"email\"\n value={formValues[field.name] || \"\"}\n onChange={(e) => handleChange(field.name, e.target.value)}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n name={field.name}\n placeholder={field.placeholder}\n className={`w-full px-3 py-2 border rounded-md ${\n error ? \"border-red-500\" : \"border-gray-300\"\n } ${isDisabled ? \"bg-gray-100 text-gray-500 cursor-not-allowed\" : \"\"}`}\n />\n );\n}\n\nexport default EmailField;","import React from \"react\";\n\nfunction InputField({ field, formValues, handleChange, handleBlur, touched, errors }) {\n console.log(\"Rendering InputField for\", field);\n const isDisabled = field.readOnly || field.disabled;\n const error = false\n return (\n <input\n {...field.props}\n id={field.name}\n type={field.type || \"text\"}\n value={formValues[field.name] || \"\"}\n onChange={(e) => handleChange(field.name, e.target.value)}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n name={field.name}\n placeholder={field.placeholder}\n min={field.minLength}\n max={field.maxLength}\n className={`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${\n error \n ? \"border-red-500 focus-visible:ring-red-500\" \n : \"border-input focus-visible:ring-blue-500\"\n } ${\n isDisabled \n ? \"bg-gray-50 text-gray-500\" \n : \"bg-background\"\n }`}\n />\n\n );\n}\n\nexport default InputField;","import React from 'react'\n\n\nfunction HtmlField({ field, formValues }) {\n const htmlContent = formValues[field.name] || field.content || \"\";\n \n return (\n <div key={field.name} className={`mb-4 ${field.fieldClass ? field.fieldClass : \"col-span-full\"}`} id={field.name.toLowerCase() + \"_id\"}>\n <div \n className=\"w-full px-3 py-2 border rounded-md overflow-y-auto max-h-40 prose prose-sm max-w-none\" \n dangerouslySetInnerHTML={{ __html: htmlContent }} \n />\n </div>\n )\n}\n\nexport default HtmlField\n","\n\nfunction CheckboxField({field, formValues, handleChange, handleBlur, touched, errors}) {\n //const error = touched[field.name] && errors[field.name];\n const isDisabled = field.disabled && field.disabled(formValues);\n const error = false \n return (\n <div className=\"mt-1 space-x-2\">\n <input\n {...field.props}\n id={\"id_\" + field.name}\n type=\"checkbox\"\n checked={formValues[field.name] || false}\n onChange={(e) => handleChange(field.name, e.target.checked)}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n className={`rounded border-gray-300 ${\n isDisabled ? \"opacity-50 cursor-not-allowed\" : \"\"\n }`}\n />\n <label className=\"\" htmlFor={\"id_\" + field.name}>\n {field.label}\n {field.required && <span className=\"text-red-500\">*</span>}\n </label>\n {error && <p className=\"mt-1 text-sm text-red-500\">{error}</p>}\n </div>\n )\n}\n\nexport default CheckboxField","import * as Popover from \"@radix-ui/react-popover\";\nimport { useState } from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport \"react-day-picker/dist/style.css\";\n\nfunction DateRangeField({ field, formValues, handleChange, handleBlur }) {\n const [open, setOpen] = useState(false);\n const selected = formValues[field.name] ?? { from: null, to: null };\n\n const handleSelect = (range) => handleChange(field.name, range);\n const handleClear = () => handleChange(field.name, { from: null, to: null });\n\n return (\n <div>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n id={field.name}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => setOpen(true)}\n onKeyDown={(e) => e.key === \"Enter\" && setOpen(true)}\n className=\"\n inline-flex items-center justify-between gap-2\n w-full h-9 rounded-md border border-gray-300 bg-white\n px-3 py-2 text-sm font-normal shadow-sm\n hover:bg-gray-50 hover:text-gray-900\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2\n disabled:cursor-not-allowed disabled:opacity-50\n \"\n >\n {selected.from ? (\n selected.to ? (\n <span>\n {selected.from.toLocaleDateString()} – {selected.to.toLocaleDateString()}\n </span>\n ) : (\n <span>{selected.from.toLocaleDateString()}</span>\n )\n ) : (\n <span className=\"text-muted-foreground\">\n {field.placeholder || \"Select date range\"}\n </span>\n )}\n\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"lucide lucide-chevron-down opacity-70\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n </Popover.Trigger>\n\n <Popover.Content\n align=\"start\"\n sideOffset={2}\n className=\"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto\"\n >\n <DayPicker\n mode=\"range\"\n selected={selected}\n onSelect={handleSelect}\n showOutsideDays\n className=\"rounded-md bg-white p-3 text-xs\"\n />\n \n {/* Action buttons */}\n <div className=\"flex items-center justify-between gap-2 border-t border-gray-200 p-3\">\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2\"\n >\n Clear\n </button>\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2\"\n >\n Done\n </button>\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n}\n\nexport default DateRangeField;\n","import React from 'react'\nimport { toast } from \"react-hot-toast\";\nimport { config } from \"../../config.js\";\n\nfunction FileField({\n field,\n formValues,\n touched,\n errors,\n fileUploads,\n setFileUploads,\n fileInputRefs,\n handleChange,\n onFieldsChange\n}) {\n const error = touched[field.name] && errors[field.name];\n const isMultiple = field.type === \"multifile\";\n const uploads = fileUploads[field.name] || {};\n const currentValues = formValues[field.name];\n const values = isMultiple\n ? currentValues || []\n : [currentValues].filter(Boolean);\n const isDisabled = field.disabled && field.disabled(formValues);\n const disablebtnClasses = `px-4 py-2 bg-gray-100 border rounded hover:bg-gray-200 ${isDisabled ? \"cursor-not-allowed\" : \"\"\n }`;\n\n const uploadUrl = `${config.REACT_API_URL}uploads`;\n\n const formatFileSize = (bytes) => {\n if (bytes === 0) return \"0 Bytes\";\n const k = 1024;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + \" \" + sizes[i];\n };\n\n const uploadFile = async (file, fieldName) => {\n const formData = new FormData();\n formData.append(\"file\", file);\n\n const response = await fetch(`${uploadUrl}`, {\n method: \"POST\",\n body: formData,\n });\n\n if (!response.ok) {\n toast.error(\"Upload failed\");\n throw new Error(\"Upload failed\");\n }\n\n const data = await response.json();\n return data;\n };\n\n const handleSingleFileUpload = async (field, file) => {\n if (!file) return;\n\n // Validate file size\n if (field.maxSize && file.size > field.maxSize) {\n throw new Error(\n `File size must not exceed ${formatFileSize(field.maxSize)}`\n );\n }\n\n // Upload the file\n const uploadedData = await uploadFile(file, field.name);\n\n // Update form values with the uploaded URL\n const newValues = { ...formValues, [field.name]: uploadedData };\n handleChange(field.name, uploadedData);\n onFieldsChange(newValues);\n };\n\n const handleMultiFileUpload = async (field, files) => {\n const currentUrls = formValues[field.name] || [];\n if (currentUrls.length + files.length > field.maxFiles) {\n throw new Error(`Maximum ${field.maxFiles} files allowed`);\n }\n\n // Validate each file size\n files.forEach((file) => {\n if (field.maxSize && file.size > field.maxSize) {\n throw new Error(\n `Each file must not exceed ${formatFileSize(field.maxSize)}`\n );\n }\n });\n\n // Upload all files\n const uploadedUrls = await Promise.all(\n files.map((file) => uploadFile(file, field.name))\n );\n\n // Update form values with the new URLs\n const newUrls = [...currentUrls, ...uploadedUrls];\n handleChange(field.name, newUrls);\n onFieldsChange({ ...formValues, [field.name]: newUrls });\n };\n\n const handleFileChange = async (fieldName, files) => {\n const fileList = Array.from(files);\n\n try {\n if (field.type === \"file\") {\n await handleSingleFileUpload(field, fileList[0]);\n } else if (field.type === \"multifile\") {\n await handleMultiFileUpload(field, fileList);\n }\n\n // Clear file input after processing\n if (fileInputRefs.current[fieldName]) {\n fileInputRefs.current[fieldName].value = \"\"; // This resets the file input field\n }\n } catch (error) {\n toast.error(`Upload failed: ${error.message}`);\n }\n };\n\n const removeFile = async (fieldName, urlToRemove) => {\n let newValue;\n\n if (field.type === \"file\") {\n newValue = \"\";\n } else {\n const urls = formValues[fieldName] || [];\n newValue = urls.filter((url) => url !== urlToRemove);\n }\n\n handleChange(fieldName, newValue);\n onFieldsChange({ ...formValues, [fieldName]: newValue });\n\n // Reset the file input field after removing the file\n if (fileInputRefs.current[fieldName]) {\n fileInputRefs.current[fieldName].value = \"\"; // Reset file input after removing\n }\n };\n\n return (\n <div key={field.name} className={`mb-4 ${field.fieldClass || 'col-span-full'}`}>\n <label className=\"block font-medium mb-1\">\n {field.label}\n {field.required && <span className=\"text-red-500\">*</span>}\n </label>\n\n <div className=\"space-y-2\">\n <div className=\"items-center space-x-2\">\n <button\n type=\"button\"\n disabled={isDisabled}\n onClick={() => fileInputRefs.current[field.name].click()}\n className={disablebtnClasses}\n >\n Choose {isMultiple ? \"Files\" : \"File\"}\n </button>\n {isMultiple && values.length > 0 && (\n <span className=\"text-sm text-gray-600\">\n {values.length} of {field.maxFiles} files uploaded\n </span>\n )}\n </div>\n\n <input\n ref={(el) => (fileInputRefs.current[field.name] = el)}\n type=\"file\"\n accept={field.accept}\n multiple={isMultiple}\n className=\"hidden\"\n onChange={(e) => handleFileChange(field.name, e.target.files)}\n />\n\n {/* Uploaded Files List */}\n <div className=\"space-y-2\">\n {values.map((file, index) => {\n const upload = Object.values(uploads).find(\n (u) => u.file === file\n );\n return (\n <div\n key={file}\n className=\"flex items-center justify-between p-2 bg-gray-50 rounded\"\n >\n <div className=\"flex items-center space-x-2\">\n {upload && (\n <>\n <span className=\"text-sm\">{upload.fileName}</span>\n <span className=\"text-xs text-gray-500\">\n ({formatFileSize(upload.fileSize)})\n </span>\n </>\n )}\n {!upload && (\n <span className=\"text-sm\">{file.original_name}</span>\n )}\n </div>\n <button\n type=\"button\"\n onClick={() => removeFile(field.name, file)}\n className=\"text-red-500 hover:text-red-700 ml-3\"\n >\n Remove\n </button>\n </div>\n );\n })}\n </div>\n\n {/* Upload Progress */}\n {Object.entries(uploads).map(([fileName, upload]) => {\n if (upload.status === \"uploading\") {\n return (\n <div key={fileName} className=\"relative pt-1\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-xs font-semibold inline-block text-blue-600\">\n Uploading {fileName}\n </span>\n <span className=\"text-xs font-semibold inline-block text-blue-600\">\n {upload.progress}%\n </span>\n </div>\n <div className=\"overflow-hidden h-2 mt-1 text-xs flex rounded bg-blue-200\">\n <div\n className=\"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500\"\n style={{ width: `${upload.progress}%` }}\n />\n </div>\n </div>\n );\n }\n return null;\n })}\n </div>\n\n {error && <p className=\"mt-1 text-sm text-red-500\">{error}</p>}\n </div>\n );\n}\n\nexport default FileField;","// Default configuration for the DynamicForm package\nexport const config = {\n // Add your configuration values here\n apiBaseUrl: process.env.API_BASE_URL || '',\n // Add other config values as needed\n};","import React, { useRef, useEffect } from \"react\";\n\nfunction TextAreaField({\n field,\n formValues,\n handleChange,\n handleBlur,\n touched,\n errors,\n charCount,\n setCharCounts,\n}) {\n const textareaRef = useRef(null);\n const value = formValues[field.name] || \"\";\n const isDisabled =\n typeof field.disabled === \"function\"\n ? field.disabled(formValues)\n : field.disabled || field.readOnly;\n const error = touched?.[field.name] && errors?.[field.name] ? errors[field.name] : null;\n\n // Auto-resize logic\n const autoResize = () => {\n const el = textareaRef.current;\n if (el) {\n el.style.height = \"auto\";\n el.style.height = `${el.scrollHeight + 2}px`;\n }\n };\n\n // Auto-resize on mount & when value changes\n useEffect(() => {\n autoResize();\n }, [value]);\n\n const handleTextareaChange = (e) => {\n handleChange(field.name, e.target.value);\n autoResize();\n\n if (setCharCounts) {\n setCharCounts((prev) => ({\n ...prev,\n [field.name]: e.target.value.length,\n }));\n }\n };\n\n return (\n <div className=\"space-y-2\">\n <textarea\n {...field.props}\n ref={textareaRef}\n id={field.name}\n name={field.name}\n placeholder={field.placeholder || \"\"}\n value={value}\n onChange={handleTextareaChange}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n maxLength={field.maxLength}\n rows={field.rows || 3}\n className={`flex w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none overflow-y-auto ${\n error \n ? \"border-red-500 focus-visible:ring-red-500\" \n : \"border-input focus-visible:ring-blue-500\"\n } ${\n isDisabled \n ? \"bg-gray-50 text-gray-500\" \n : \"bg-background\"\n }`}\n style={{\n minHeight: \"80px\",\n maxHeight: \"400px\",\n }}\n />\n\n <div className=\"flex justify-between items-center\">\n {/* Character counter */}\n {field.maxLength && !field.readOnly && (\n <span className=\"text-xs text-gray-500\">\n {charCount || 0}/{field.maxLength} characters\n </span>\n )}\n\n </div>\n </div>\n );\n}\n\nexport default TextAreaField;\n","import { LocalizationProvider } from '@mui/x-date-pickers';\nimport React from 'react'\nimport { AdapterDayjs } from \"@mui/x-date-pickers/AdapterDayjs\";\nimport { DateTimeField } from \"@mui/x-date-pickers/DateTimeField\";\n\nfunction DayTimePickerField({ field, formValues, handleChange, handleBlur, touched, errors }) {\n return (\n <div>\n <LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale=\"aus\">\n <DateTimeField\n value={field.value}\n onChange={(newValue) => handleChange(field.name, newValue)}\n />\n </LocalizationProvider> \n \n </div>\n )\n}\nexport default DayTimePickerField\n\n\n\n","\nimport { Separator } from \"@radix-ui/react-separator\"\n\nfunction LineBreakField({ field }) {\n if (!field?.label) return <Separator className=\"my-4 h-px bg-gray-300\" />;\n\n return (\n <div className=\"relative flex items-center py-4\">\n <Separator className=\"flex-1 h-px bg-gray-300\" />\n <span className=\"px-3 font-medium text-gray-600 bg-white\">\n {field.label}\n </span>\n <Separator className=\"flex-1 h-px bg-gray-300\" />\n </div>\n );\n}\n\nexport default LineBreakField;","/**\n * RadioGroupField Component\n * \n * A Radix UI-based radio group field for DynamicForm\n * \n * @example\n * // Basic usage (stacked layout)\n * {\n * type: 'radio',\n * name: 'plan',\n * label: 'Select Plan',\n * options: [\n * { value: 'basic', label: 'Basic Plan', description: 'Perfect for individuals' },\n * { value: 'pro', label: 'Pro Plan', description: 'For professionals' },\n * { value: 'enterprise', label: 'Enterprise', description: 'For large teams' }\n * ]\n * }\n * \n * @example\n * // Inline layout\n * {\n * type: 'radio',\n * name: 'size',\n * label: 'Select Size',\n * inline: true,\n * options: ['Small', 'Medium', 'Large']\n * }\n * \n * @example\n * // Simple string options\n * {\n * type: 'radio',\n * name: 'color',\n * label: 'Choose Color',\n * options: ['Red', 'Green', 'Blue']\n * }\n * \n * @example\n * // With disabled state\n * {\n * type: 'radio',\n * name: 'subscription',\n * label: 'Subscription Type',\n * disabled: (formValues) => formValues.hasActiveSubscription,\n * options: [\n * { value: 'monthly', label: 'Monthly' },\n * { value: 'yearly', label: 'Yearly' }\n * ]\n * }\n */\n\nimport React from 'react';\nimport * as RadioGroup from '@radix-ui/react-radio-group';\n\nfunction RadioGroupField({ field, formValues, handleChange, handleBlur }) {\n const value = formValues[field.name] || '';\n const isDisabled = typeof field.disabled === 'function' \n ? field.disabled(formValues) \n : field.disabled;\n const options = field.options || [];\n const isInline = field.inline || false;\n\n return (\n <RadioGroup.Root\n value={value}\n onValueChange={(val) => handleChange(field.name, val)}\n onBlur={() => handleBlur(field.name)}\n disabled={isDisabled}\n className={isInline ? 'flex flex-wrap gap-4' : 'space-y-3'}\n aria-label={field.label || field.name}\n >\n {options.map((option) => {\n const optionValue = typeof option === 'object' ? option.value : option;\n const optionLabel = typeof option === 'object' ? option.label : option;\n\n const optionDescription = typeof option === 'object' ? option.description : null;\n const itemId = `${field.name}-${optionValue}`;\n\n return (\n <div key={optionValue} className=\"relative flex items-start\">\n <div className=\"flex h-6 items-center\">\n <RadioGroup.Item\n value={optionValue}\n id={itemId}\n disabled={isDisabled}\n className={`\n relative size-4 rounded-full border transition-all\n ${isDisabled \n ? 'border-gray-300 bg-gray-100 cursor-not-allowed' \n : 'border-gray-300 bg-white hover:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2'\n }\n data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600\n `}\n >\n <RadioGroup.Indicator className=\"flex items-center justify-center w-full h-full relative after:content-[''] after:block after:w-1.5 after:h-1.5 after:rounded-full after:bg-white\" />\n </RadioGroup.Item>\n </div>\n <div className=\"ml-3 text-sm\">\n <label \n htmlFor={itemId} \n className={`font-medium ${isDisabled ? 'text-gray-500' : 'text-gray-900 cursor-pointer'}`}\n >\n {optionLabel}\n </label>\n {optionDescription && !isInline && (\n <p className={`text-sm ${isDisabled ? 'text-gray-400' : 'text-gray-500'}`}>\n {optionDescription}\n </p>\n )}\n </div>\n </div>\n );\n })}\n </RadioGroup.Root>\n );\n}\n\nexport default RadioGroupField;\n","/**\n * HeaderField Component\n * \n * A header/title field for DynamicForm to display section headers, titles, or dividers\n * \n * @example\n * // Large header (h1)\n * {\n * type: 'header',\n * text: 'Personal Information',\n * size: 'xl' // or '2xl', '3xl', '4xl'\n * }\n * \n * @example\n * // Medium header with description (h2)\n * {\n * type: 'header',\n * text: 'Contact Details',\n * description: 'Please provide your contact information',\n * size: 'lg'\n * }\n * \n * @example\n * // Small header (h3)\n * {\n * type: 'header',\n * text: 'Account Settings',\n * size: 'md'\n * }\n * \n * @example\n * // Header with underline\n * {\n * type: 'header',\n * text: 'Billing Information',\n * underline: true,\n * size: 'lg'\n * }\n * \n * @example\n * // Header with custom styling\n * {\n * type: 'header',\n * text: 'Important Section',\n * size: 'xl',\n * className: 'text-blue-600',\n * align: 'center' // 'left', 'center', 'right'\n * }\n */\n\nimport React from 'react';\n\nfunction HeaderField({ field }) {\n const text = field.text || field.label || '';\n const description = field.description || '';\n const size = field.size || 'lg'; // 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl'\n const underline = field.underline || false;\n const align = field.align || 'left'; // 'left', 'center', 'right'\n const customClass = field.className || '';\n\n // Size mappings\n const sizeClasses = {\n sm: 'text-base font-semibold',\n md: 'text-lg font-semibold',\n lg: 'text-xl font-bold',\n xl: 'text-2xl font-bold',\n '2xl': 'text-3xl font-bold',\n '3xl': 'text-4xl font-bold',\n '4xl': 'text-5xl font-bold',\n };\n\n const alignClasses = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n };\n\n const headerClass = `\n ${sizeClasses[size] || sizeClasses.lg}\n ${alignClasses[align] || alignClasses.left}\n ${underline ? 'border-b-2 border-gray-300 pb-2' : ''}\n ${customClass}\n text-gray-900\n `.trim();\n\n const descriptionClass = `\n mt-1 text-sm text-gray-600\n ${alignClasses[align] || alignClasses.left}\n `.trim();\n\n return (\n <div className=\"my-4\">\n <h2 className={headerClass}>\n {text}\n </h2>\n {description && (\n <p className={descriptionClass}>\n {description}\n </p>\n )}\n </div>\n );\n}\n\nexport default HeaderField;\n","import * as Popover from \"@radix-ui/react-popover\";\nimport { useState } from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport \"react-day-picker/dist/style.css\";\n\nfunction DateRangeField({ field, formValues, handleChange, handleBlur }) {\n const [open, setOpen] = useState(false);\n const selected = formValues[field.name] ?? null;\n\n const handleSelect = (date) => handleChange(field.name, date);\n const handleClear = () => handleChange(field.name, null);\n\n return (\n <div>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n id={field.name}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => setOpen(true)}\n onKeyDown={(e) => e.key === \"Enter\" && setOpen(true)}\n className=\"\n inline-flex items-center justify-between gap-2\n w-full h-9 rounded-md border border-gray-300 bg-white\n px-3 py-2 text-sm font-normal shadow-sm\n hover:bg-gray-50 hover:text-gray-900\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2\n disabled:cursor-not-allowed disabled:opacity-50\n \"\n >\n {selected ? (\n <span>{selected.toLocaleDateString()}</span>\n ) : (\n <span className=\"text-muted-foreground\">\n {field.placeholder || \"Select date\"}\n </span>\n )}\n\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"lucide lucide-chevron-down opacity-70\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n </Popover.Trigger>\n\n <Popover.Content\n align=\"start\"\n sideOffset={2}\n className=\"z-50 rounded-md border border-gray-200 bg-white p-0 shadow-md w-auto\"\n >\n <DayPicker\n mode=\"single\"\n selected={selected}\n onSelect={handleSelect}\n showOutsideDays\n className=\"rounded-md bg-white p-3 text-xs\"\n />\n \n {/* Action buttons */}\n <div className=\"flex items-center justify-between gap-2 border-t border-gray-200 p-3\">\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2\"\n >\n Clear\n </button>\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2\"\n >\n Done\n </button>\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n}\n\nexport default DateRangeField;\n","import React, { useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\n\nfunction TimeField({ field, formValues, handleChange, handleBlur }) {\n const [open, setOpen] = useState(false);\n const [hours, setHours] = useState(\"12\");\n const [minutes, setMinutes] = useState(\"00\");\n const [period, setPeriod] = useState(\"PM\");\n\n const value = formValues[field.name] || \"\";\n\n // Parse existing value if present\n React.useEffect(() => {\n if (value) {\n const timeMatch = value.match(/(\\d{1,2}):(\\d{2})\\s*(AM|PM)/i);\n if (timeMatch) {\n setHours(timeMatch[1].padStart(2, \"0\"));\n setMinutes(timeMatch[2]);\n setPeriod(timeMatch[3].toUpperCase());\n }\n }\n }, [value]);\n\n const handleApply = () => {\n const timeString = `${hours}:${minutes} ${period}`;\n handleChange(field.name, timeString);\n setOpen(false);\n };\n\n const handleClear = () => {\n handleChange(field.name, \"\");\n setHours(\"12\");\n setMinutes(\"00\");\n setPeriod(\"PM\");\n };\n\n const incrementHours = () => {\n const h = parseInt(hours);\n setHours(((h % 12) + 1).toString().padStart(2, \"0\"));\n };\n\n const decrementHours = () => {\n const h = parseInt(hours);\n setHours((h === 1 ? 12 : h - 1).toString().padStart(2, \"0\"));\n };\n\n const incrementMinutes = () => {\n const m = parseInt(minutes);\n setMinutes(((m + 5) % 60).toString().padStart(2, \"0\"));\n };\n\n const decrementMinutes = () => {\n const m = parseInt(minutes);\n setMinutes((m === 0 ? 55 : m - 5).toString().padStart(2, \"0\"));\n };\n\n return (\n <div>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n id={field.name}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={() => setOpen(true)}\n className=\"\n inline-flex items-center justify-between gap-2\n w-full h-9 rounded-md border border-gray-300 bg-white\n px-3 py-2 text-sm font-normal shadow-sm\n hover:bg-gray-50 hover:text-gray-900\n focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2\n disabled:cursor-not-allowed disabled:opacity-50\n \"\n >\n {value ? (\n <span>{value}</span>\n ) : (\n <span className=\"text-gray-400\">\n {field.placeholder || \"Select time\"}\n </span>\n )}\n\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"lucide lucide-clock opacity-70\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12 6 12 12 16 14\" />\n </svg>\n </button>\n </Popover.Trigger>\n\n <Popover.Content\n align=\"start\"\n sideOffset={2}\n className=\"z-50 rounded-md border border-gray-200 bg-white p-4 shadow-md w-64\"\n >\n <div className=\"flex flex-col gap-4\">\n {/* Time picker */}\n <div className=\"flex items-center justify-center gap-2\">\n {/* Hours */}\n <div className=\"flex flex-col items-center\">\n <button\n type=\"button\"\n onClick={incrementHours}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"18 15 12 9 6 15\" />\n </svg>\n </button>\n <input\n type=\"text\"\n value={hours}\n onChange={(e) => {\n const val = e.target.value.replace(/\\D/g, \"\");\n if (val === \"\" || (parseInt(val) >= 1 && parseInt(val) <= 12)) {\n setHours(val.padStart(2, \"0\"));\n }\n }}\n className=\"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2\"\n maxLength=\"2\"\n />\n <button\n type=\"button\"\n onClick={decrementHours}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n </div>\n\n <span className=\"text-2xl font-semibold\">:</span>\n\n {/* Minutes */}\n <div className=\"flex flex-col items-center\">\n <button\n type=\"button\"\n onClick={incrementMinutes}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"18 15 12 9 6 15\" />\n </svg>\n </button>\n <input\n type=\"text\"\n value={minutes}\n onChange={(e) => {\n const val = e.target.value.replace(/\\D/g, \"\");\n if (val === \"\" || (parseInt(val) >= 0 && parseInt(val) <= 59)) {\n setMinutes(val.padStart(2, \"0\"));\n }\n }}\n className=\"w-14 text-center text-2xl font-semibold border-0 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded py-2\"\n maxLength=\"2\"\n />\n <button\n type=\"button\"\n onClick={decrementMinutes}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </button>\n </div>\n\n {/* AM/PM */}\n <div className=\"flex flex-col gap-1 ml-2\">\n <button\n type=\"button\"\n onClick={() => setPeriod(\"AM\")}\n className={`\n px-3 py-1 text-sm font-medium rounded\n ${\n period === \"AM\"\n ? \"bg-blue-600 text-white\"\n : \"bg-gray-100 text-gray-700 hover:bg-gray-200\"\n }\n `}\n >\n AM\n </button>\n <button\n type=\"button\"\n onClick={() => setPeriod(\"PM\")}\n className={`\n px-3 py-1 text-sm font-medium rounded\n ${\n period === \"PM\"\n ? \"bg-blue-600 text-white\"\n : \"bg-gray-100 text-gray-700 hover:bg-gray-200\"\n }\n `}\n >\n PM\n </button>\n </div>\n </div>\n\n {/* Action buttons */}\n <div className=\"flex items-center justify-between gap-2 border-t border-gray-200 pt-3\">\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-gray-300 bg-white hover:bg-gray-100 hover:text-gray-900 h-9 px-4 py-2\"\n >\n Clear\n </button>\n <button\n type=\"button\"\n onClick={handleApply}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-blue-600 text-white hover:bg-blue-700 h-9 px-4 py-2\"\n >\n Done\n </button>\n </div>\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n}\n\nexport default TimeField;","import React from \"react\";\nimport { Error, Success, Warning, Info } from \"../components/formats/alerts/Alerts.jsx\";\n\nfunction AlertMessageField({ field }) {\n const { variant = \"info\", message, content } = field;\n\n const alertMessage = message || content || \"\";\n\n // Render based on variant type\n switch (variant.toLowerCase()) {\n case \"error\":\n case \"danger\":\n return <Error message={alertMessage} />;\n\n case \"success\":\n return <Success message={alertMessage} />;\n\n case \"warning\":\n case \"warn\":\n return <Warning message={alertMessage} />;\n\n case \"info\":\n case \"information\":\n default:\n return <Info message={alertMessage} />;\n }\n}\n\nexport default AlertMessageField;","import { InformationCircleIcon, XCircleIcon } from \"@heroicons/react/20/solid\";\nimport { CheckCircleIcon } from \"@heroicons/react/20/solid\";\nimport { ExclamationCircleIcon } from \"@heroicons/react/24/outline\";\nimport { htmlMarkup } from \"../../../../utils/html_markup\";\n\nfunction Error({ message }) {\n return (\n <div className=\"rounded-lg bg-red-50 border border-red-100 p-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <XCircleIcon aria-hidden=\"true\" className=\"size-5 text-red-500 shrink-0\" />\n <span className=\"text-sm font-medium text-red-900\">{message}</span>\n </div>\n </div>\n );\n}\nfunction Warning({ message }) {\n return (\n <div className=\"rounded-lg bg-amber-50 border border-amber-100 p-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <ExclamationCircleIcon\n aria-hidden=\"true\"\n className=\"size-5 text-amber-600 shrink-0\"\n />\n <span className=\"text-sm font-medium text-amber-900\">{message}</span>\n </div>\n </div>\n );\n}\n\nfunction Success({ message }) {\n return (\n <div className=\"rounded-lg bg-green-50 border border-green-100 p-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <CheckCircleIcon\n aria-hidden=\"true\"\n className=\"size-5 text-green-600 shrink-0\"\n />\n <span className=\"text-sm font-medium text-green-900\">{message}</span>\n </div>\n </div>\n );\n}\n\nfunction Info({ message }) {\n return (\n <div className=\"rounded-lg bg-blue-50 border border-blue-100 p-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <InformationCircleIcon\n aria-hidden=\"true\"\n className=\"size-5 text-blue-600 shrink-0\"\n />\n <span className=\"text-sm font-medium text-blue-900\">{message}</span>\n </div>\n </div>\n );\n}\n\nexport { Error, Success, Warning, Info };","// Named exports\nexport { default as MyButton } from './MyButton.jsx';\nexport { default as DynamicForm } from './DynamicForm/DynamicForm.jsx';\n\n// Default exports for backward compatibility\nimport MyButtonComponent from './MyButton.jsx';\nimport DynamicFormComponent from './DynamicForm/DynamicForm.jsx';\n\n// Export default as DynamicForm (main component)\nexport default DynamicFormComponent;\n\n// Also export a default MyButton for direct import\nexport { MyButtonComponent, DynamicFormComponent };"],"mappings":"AAES,cAAAA,OAAA,oBADM,SAARC,GAA0B,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAG,CACtD,OAAOH,GAAC,UAAO,QAASG,EAAU,SAAAD,EAAS,CAC7C,CCHA,OAAS,YAAAE,EAAU,aAAAC,GAAmB,WAAAC,OAAe,QACrD,OAAS,SAAAC,OAAa,kBACtB,OAAOC,OAAW,QCFlB,OAAOC,OAAW,QAClB,OAAOC,OAAW,kBCDX,IAAMC,GAAS,CAAC,cAA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B,EAAM,IAAI,IAAM,SAC3B/B,EAAW+B,EAAM,IAAI,EACjBA,EAAM,QAAU,OACVA,EAAM,MACNA,EAAM,OAAS,cACX,CAAC,EACD,IAGlB,IAAMO,EAAQjC,EAAQ0B,EAAM,IAAI,GAAK5B,EAAO4B,EAAM,IAAI,EAAI5B,EAAO4B,EAAM,IAAI,EAAI,KAE/E,OAAQyB,EACJhE,EAACsE,EAAA,CACG,MAAO/B,EACP,WAAY/B,EACZ,aAAc6C,EACd,WAAY,IAAMK,EAAWnB,EAAM,IAAI,EACvC,cAAevB,EACf,UAAWD,EAAWwB,EAAM,IAAI,GAAK,EAEzC,EAAIA,CACR,CAEJ,EAGA,OACItC,GAAC,QAAK,SAAU0D,EAAc,UAAU,oCACnC,UAAAxD,EACGA,EAAe,OAAO,IAAIkE,CAAW,EAErCrE,EAAC,OAAI,sBAAU,EAElBK,GACL,CAER,EAEOkE,GAAQrE,GsB/Wf,IAAOsE,GAAQC","names":["jsx","MyButton","children","onClick","useState","useEffect","useMemo","toast","dayjs","axios","toast","config","apiClient","axios","config","response","error","_a","toast","Interceptors_default","jsx","HiddenField","field","HiddenField_default","Select","makeAnimated","jsx","MultiSelectField","field","formValues","handleChange","touched","errors","handleBlur","isDisabled","options","animatedComponents","currentValues","selected","MultiSelectField_default","Select","ChevronDownIcon","jsx","jsxs","SelectField","field","formValues","handleChange","handleBlur","_a","value","isDisabled","options","val","option","SelectField_default","jsx","EmailField","field","formValues","handleChange","handleBlur","touched","errors","isDisabled","e","EmailField_default","jsx","InputField","field","formValues","handleChange","handleBlur","touched","errors","isDisabled","e","InputField_default","jsx","HtmlField","field","formValues","htmlContent","HtmlField_default","jsx","jsxs","CheckboxField","field","formValues","handleChange","handleBlur","touched","errors","isDisabled","error","e","CheckboxField_default","Popover","useState","DayPicker","jsx","jsxs","DateRangeField","field","formValues","handleChange","handleBlur","open","setOpen","selected","handleSelect","range","handleClear","e","DateRangePickerField_default","toast","config","Fragment","jsx","jsxs","FileField","field","formValues","touched","errors","fileUploads","setFileUploads","fileInputRefs","handleChange","onFieldsChange","error","isMultiple","uploads","currentValues","values","isDisabled","disablebtnClasses","uploadUrl","config","formatFileSize","bytes","k","sizes","i","uploadFile","file","fieldName","formData","response","toast","handleSingleFileUpload","uploadedData","newValues","handleMultiFileUpload","files","currentUrls","uploadedUrls","newUrls","handleFileChange","fileList","removeFile","urlToRemove","newValue","url","el","e","index","upload","u","fileName","FileField_default","useRef","useEffect","jsx","jsxs","TextAreaField","field","formValues","handleChange","handleBlur","touched","errors","charCount","setCharCounts","textareaRef","value","isDisabled","error","autoResize","el","handleTextareaChange","e","prev","TextArea_default","LocalizationProvider","AdapterDayjs","DateTimeField","jsx","DayTimePickerField","field","formValues","handleChange","handleBlur","touched","errors","newValue","DayTimePickerField_default","Separator","jsx","jsxs","LineBreakField","field","LineBreakField_default","RadioGroup","jsx","jsxs","RadioGroupField","field","formValues","handleChange","handleBlur","value","isDisabled","options","isInline","val","option","optionValue","optionLabel","optionDescription","itemId","RadioGroups_default","jsx","jsxs","HeaderField","field","text","description","size","underline","align","customClass","sizeClasses","alignClasses","headerClass","descriptionClass","HeaderField_default","Popover","useState","DayPicker","jsx","jsxs","DateRangeField","field","formValues","handleChange","handleBlur","open","setOpen","selected","handleSelect","date","handleClear","e","DatePickerField_default","React","useState","Popover","jsx","jsxs","TimeField","field","formValues","handleChange","handleBlur","open","setOpen","hours","setHours","minutes","setMinutes","period","setPeriod","value","timeMatch","handleApply","timeString","handleClear","incrementHours","h","decrementHours","incrementMinutes","m","decrementMinutes","e","val","timeField_default","InformationCircleIcon","XCircleIcon","CheckCircleIcon","ExclamationCircleIcon","jsx","jsxs","Error","message","XCircleIcon","Warning","ExclamationCircleIcon","Success","CheckCircleIcon","Info","InformationCircleIcon","jsx","AlertMessageField","field","variant","message","content","alertMessage","Error","Success","Warning","Info","AlertMessageField_default","Label","Fragment","jsx","jsxs","DynamicForm","formDefinition","sendFormValues","children","defaultValues","onFieldsChange","formValues","setFormValues","useState","errors","setErrors","touched","setTouched","charCounts","setCharCounts","excludeFromFieldFormat","FIELD_RENDERERS","useMemo","FileField_default","DateRangePickerField_default","DatePickerField_default","DayTimePickerField_default","timeField_default","HiddenField_default","MultiSelectField_default","SelectField_default","EmailField_default","HtmlField_default","CheckboxField_default","RadioGroups_default","InputField_default","TextArea_default","HeaderField_default","AlertMessageField_default","LineBreakField_default","FIELD_FORMATTERS","loadOptionsForField","field","dependentValue","response","Interceptors_default","options","item","f","error","useEffect","initialValues","validateField","value","allValues","dayjs","handleChange","fieldName","newValues","option","newErrors","handleBlur","handleSubmit","e","allTouched","toast","FIELD_COLOR_VARIANTS","fieldFormat","containerStyle","color","containerClasses","content","renderField","FieldComponent","DynamicForm_default","index_default","DynamicForm_default"]}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ynotsoft-dynamic-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Small React UI bits",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/
|
|
7
|
-
"module": "dist/
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"import": "./dist/
|
|
11
|
-
"require": "./dist/
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
@@ -18,7 +18,23 @@
|
|
|
18
18
|
"sideEffects": false,
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": "^18.2.0 || ^19.0.0",
|
|
21
|
-
"react-dom": "^18.2.0 || ^19.0.0"
|
|
21
|
+
"react-dom": "^18.2.0 || ^19.0.0",
|
|
22
|
+
"react-hot-toast": "^2.0.0",
|
|
23
|
+
"dayjs": "^1.11.0",
|
|
24
|
+
"dompurify": "^3.0.0",
|
|
25
|
+
"@radix-ui/react-label": "^2.0.0",
|
|
26
|
+
"@radix-ui/react-popover": "^1.0.0",
|
|
27
|
+
"@radix-ui/react-radio-group": "^1.0.0",
|
|
28
|
+
"@radix-ui/react-select": "^2.0.0",
|
|
29
|
+
"@radix-ui/react-separator": "^1.0.0",
|
|
30
|
+
"react-day-picker": "^8.0.0 || ^9.0.0",
|
|
31
|
+
"@mui/material": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
32
|
+
"@mui/x-date-pickers": "^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
33
|
+
"@emotion/react": "^11.0.0",
|
|
34
|
+
"@emotion/styled": "^11.0.0",
|
|
35
|
+
"react-select": "^5.0.0",
|
|
36
|
+
"@heroicons/react": "^2.0.0",
|
|
37
|
+
"axios": "^1.0.0"
|
|
22
38
|
},
|
|
23
39
|
"devDependencies": {
|
|
24
40
|
"tsup": "^8.5.0",
|
|
@@ -37,4 +53,4 @@
|
|
|
37
53
|
"react",
|
|
38
54
|
"components"
|
|
39
55
|
]
|
|
40
|
-
}
|
|
56
|
+
}
|
package/dist/MyButton.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var b=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var e=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var k=(n,t)=>{for(var u in t)b(n,u,{get:t[u],enumerable:!0})},p=(n,t,u,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of e(t))!i.call(n,o)&&o!==u&&b(n,o,{get:()=>t[o],enumerable:!(f=d(t,o))||f.enumerable});return n};var r=n=>p(b({},"__esModule",{value:!0}),n);var y={};k(y,{default:()=>l});module.exports=r(y);var c=require("react/jsx-runtime");function l({children:n,onClick:t}){return(0,c.jsx)("button",{onClick:t,children:n})}
|
|
2
|
-
//# sourceMappingURL=MyButton.cjs.map
|
package/dist/MyButton.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/MyButton.jsx"],"sourcesContent":["// src/MyButton.jsx\nexport default function MyButton({ children, onClick }) {\n return <button onClick={onClick}>{children}</button>;\n}"],"mappings":"4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAES,IAAAI,EAAA,6BADM,SAARF,EAA0B,CAAE,SAAAG,EAAU,QAAAC,CAAQ,EAAG,CACtD,SAAO,OAAC,UAAO,QAASA,EAAU,SAAAD,EAAS,CAC7C","names":["MyButton_exports","__export","MyButton","__toCommonJS","import_jsx_runtime","children","onClick"]}
|
package/dist/MyButton.js
DELETED
package/dist/MyButton.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/MyButton.jsx"],"sourcesContent":["// src/MyButton.jsx\nexport default function MyButton({ children, onClick }) {\n return <button onClick={onClick}>{children}</button>;\n}"],"mappings":"AAES,cAAAA,MAAA,oBADM,SAARC,EAA0B,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAG,CACtD,OAAOH,EAAC,UAAO,QAASG,EAAU,SAAAD,EAAS,CAC7C","names":["jsx","MyButton","children","onClick"]}
|