react-simple-formkit 2.4.5 → 2.4.6
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/README.md +143 -100
- package/dist/react-simple-formkit.js +4 -4
- package/dist/react-simple-formkit.mjs +392 -403
- package/dist/react-simple-formkit.umd.js +4 -4
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(M,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],s):(M=typeof globalThis<"u"?globalThis:M||self,s(M.Name={},M.React))})(this,function(M,s){"use strict";var se={exports:{}},q={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var he;function _e(){if(he)return q;he=1;var o=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(i,u,f){var c=null;if(f!==void 0&&(c=""+f),u.key!==void 0&&(c=""+u.key),"key"in u){f={};for(var h in u)h!=="key"&&(f[h]=u[h])}else f=u;return u=f.ref,{$$typeof:o,type:i,key:c,ref:u!==void 0?u:null,props:f}}return q.Fragment=t,q.jsx=a,q.jsxs=a,q}var $={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Ee;function Oe(){return Ee||(Ee=1,process.env.NODE_ENV!=="production"&&function(){function o(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ne?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case S:return"Fragment";case y:return"Profiler";case w:return"StrictMode";case W:return"Suspense";case z:return"SuspenseList";case p:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case k:return"Portal";case A:return(r.displayName||"Context")+".Provider";case T:return(r._context.displayName||"Context")+".Consumer";case P:var g=r.render;return r=r.displayName,r||(r=g.displayName||g.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Z:return g=r.displayName||null,g!==null?g:o(r.type)||"Memo";case H:g=r._payload,r=r._init;try{return o(r(g))}catch{}}return null}function t(r){return""+r}function a(r){try{t(r);var g=!1}catch{g=!0}if(g){g=console;var F=g.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return F.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),t(r)}}function i(r){if(r===S)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===H)return"<...>";try{var g=o(r);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function u(){var r=ee.A;return r===null?null:r.getOwner()}function f(){return Error("react-stack-top-frame")}function c(r){if(oe.call(r,"key")){var g=Object.getOwnPropertyDescriptor(r,"key").get;if(g&&g.isReactWarning)return!1}return r.key!==void 0}function h(r,g){function F(){X||(X=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}F.isReactWarning=!0,Object.defineProperty(r,"key",{get:F,configurable:!0})}function E(){var r=o(this.type);return ce[r]||(ce[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function C(r,g,F,j,V,Y,Q,re){return F=Y.ref,r={$$typeof:_,type:r,key:g,props:Y,_owner:V},(F!==void 0?F:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:E}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function m(r,g,F,j,V,Y,Q,re){var O=g.children;if(O!==void 0)if(j)if(de(O)){for(j=0;j<O.length;j++)l(O[j]);Object.freeze&&Object.freeze(O)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(O);if(oe.call(g,"key")){O=o(r);var U=Object.keys(g).filter(function(be){return be!=="key"});j=0<U.length?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}",ue[O+j]||(U=0<U.length?"{"+U.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,P,w,G,w),le[w+P]=!0)}if(w=null,T!==void 0&&(a(T),w=""+T),c(g)&&(a(g.key),w=""+g.key),"key"in g){T={};for(var se in g)se!=="key"&&(T[se]=g[se])}else T=g;return w&&m(T,typeof t=="function"?t.displayName||t.name||"Unknown":t),h(t,w,I,U,u(),T,Q,re)}function l(t){typeof t=="object"&&t!==null&&t.$$typeof===A&&t._store&&(t._store.validated=1)}var R=s,A=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),p=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),te=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=Object.prototype.hasOwnProperty,de=Array.isArray,K=console.createTask?console.createTask:function(){return null};R={"react-stack-bottom-frame":function(t){return t()}};var X,ae={},M=R["react-stack-bottom-frame"].bind(R,d)(),ue=K(i(d)),le={};ee.Fragment=S,ee.jsx=function(t,g,T,P,U){var I=1e4>te.recentlyCreatedOwnerStacks++;return E(t,g,T,!1,P,U,I?Error("react-stack-top-frame"):M,I?K(i(t)):ue)},ee.jsxs=function(t,g,T,P,U){var I=1e4>te.recentlyCreatedOwnerStacks++;return E(t,g,T,!0,P,U,I?Error("react-stack-top-frame"):M,I?K(i(t)):ue)}}()),ee}var Ee;function Oe(){return Ee||(Ee=1,process.env.NODE_ENV==="production"?ne.exports=Ae():ne.exports=_e()),ne.exports}var me=Oe();const v=()=>{},Re=s.createContext({ref:null,watch:v,actions:{subscribe:v,reset:v,trigger:v,reload:v,resetField:v,setValue:v,getValues:v,getErrors:v,getFieldStates:v,getFormState:v,setError:v,clearError:v,clearErrors:v,checkValidity:v,getFieldValidity:v,getDefaultValues:v,setFieldState:v,triggerFieldBlur:v,resetFieldState:v,getControlledFields:v,setFormState:v,getEvents:v,getWatchEvents:v,addGroups:v},registerController:v,registerHookWatcher:v,lastReloadedAt:v,loadFormValues:v,getWatchValue:v,channels:{}}),ie=()=>s.useContext(Re),je=({id:o,control:r,method:a,action:i,children:u,onChange:d,onBlur:c,onSubmit:m=()=>{},onInput:C=()=>{},onReset:h=()=>{},numberFields:E=[],className:l,...R})=>{const A=s.useCallback(y=>{r.ref&&(r.ref.current=y,r.ref.current&&r.initForm())},[r]);return s.useEffect(()=>{let y=()=>{},S=()=>{};return d&&(y=r.channels.subscribe("onChange",d)),c&&(S=r.channels.subscribe("onBlur",c)),()=>{y(),S()}},[r.lastReloadedAt]),me.jsx(Re.Provider,{value:r,children:me.jsx("form",{id:o,ref:A,action:i,method:a,className:l,onInput:C,onSubmit:y=>{a||y.preventDefault();const S=r.loadFormValues();m(S)},onChange:y=>{const S=y.target.name;!S||r.actions.getControlledFields().has(S)||r.actions.setValue(S,y.target.value)},onBlur:y=>{const S=y.target.name;if(!S||r.actions.getControlledFields().has(S))return;const D=y.target.value;r.channels.publish("onBlur",S,D,r.actions.getValues()),r.triggerBlurWatchers(S)},onReset:y=>{r.actions.reset(),h(y)},...R,children:u},r.lastReloadedAt)})},fe={isDirty:!1,isTouched:!1,error:null},Ce={lastReset:null,isDirty:!1,isError:!1,errorFields:[],dirtyFields:[],touchedFields:[]},we={},Pe=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"],x=(o={},r="")=>r.split(".").reduce((a,i)=>a&&a[i]!==void 0?a[i]:void 0,o),L=(o={},r="",a)=>{const i=Array.isArray(o)?[...o]:{...o};let u=i;const d=r.split(".");return d.forEach((c,m)=>{m<d.length-1?(u[c]||(u[c]=/^\d+$/.test(d[m+1])?[]:{}),Array.isArray(u[c])?u[c]=[...u[c]]:u[c]={...u[c]},u=u[c]):u[c]=a}),i},ve=o=>{let r=Array.isArray(o)?[...o]:{...o};return Object.keys(r).forEach(a=>{if(a.includes(".")){const i=x(r,a);r=L(r,a,i||""),delete r[a]}}),r},Ne=["errors","fieldStates","formState"],z=o=>Ne.some(r=>o.startsWith(r))?o:"values."+o,Se=o=>{typeof o.setCustomValidity=="function"&&o.setCustomValidity("");let r=o.validity,a=Pe.find(i=>r[i]);if(a)return{type:a,message:o.validationMessage}},ye=(o=new Set,r={},a="")=>Object.keys(r||{}).reduce((i,u)=>{const d=(r||{})[u];return o.has(a+u)?[...i,...ye(o,d,a+u+".")]:d!=null&&d.isDirty?[...i,a+u]:i},[]),ke=(o=new Set,r={},a="")=>Object.keys(r||{}).reduce((i,u)=>{const d=(r||{})[u];return o.has(a+u)?[...i,...ke(o,d,a+u+".")]:d!=null&&d.isTouched?[...i,a+u]:i},[]),pe=(o=new Set,r={},a="")=>Object.keys(r||{}).reduce((i,u)=>{const d=(r||{})[u];return o.has(a+u)?[...i,...pe(o,d,a+u+".")]:d?[...i,a+u]:i},[]),Fe=({control:o,name:r,defaultValue:a,shouldUnRegister:i})=>{const{actions:u,registerController:d,channels:c,getWatchValue:m,triggerBlurWatchers:C}=o||ie(),h=s.useRef(),E=s.useRef(),l=x(u.getDefaultValues(),r)||a||"",[R,A]=s.useState(l),[y,S]=s.useState({}),D=s.useCallback((k,{shouldDirty:p=!0,shouldOnChange:O=!0}={})=>{var V;let W=k;((V=k==null?void 0:k.target)==null?void 0:V.value)!==void 0&&(W=k.target.value),A(W),u.setValue(r,W,{shouldDirty:p,shouldOnChange:O})},[u.setValue]),j=s.useCallback(k=>{const p=u.getValues(),O=k??x(p,r);c.publish("onBlur",r,O,p),C(r)},[]);return s.useEffect(()=>{const k=d(r,A,{shouldUnRegister:i});return()=>{k(),E.current&&E.current()}},[i]),new Proxy({ref:h,name:r,defaultValue:l,value:R,onChange:D,onBlur:j,fieldState:y},{get(k,p,O){return typeof p=="string"&&p==="fieldState"&&(E.current&&E.current(),E.current=u.subscribe(`fieldStates.${r}`,()=>{S(m({name:`fieldStates.${r}`}))})),Reflect.get(k,p,O)}})},De=({name:o,control:r,shouldUnRegister:a,defaultValue:i,render:u=({ref:d,name:c,defaultValue:m,value:C,onChange:h,onBlur:E,fieldState:l})=>null})=>{const d=Fe({name:o,defaultValue:i,shouldUnRegister:a,control:r});return u(d)},xe=()=>{const[o,r]=s.useState(),a=s.useCallback(()=>r(new Date().toString()),[]);return[o,a]},We=()=>{const[,o]=s.useState({});return s.useCallback(()=>o({}),[])},Me=({channels:o,getWatchValue:r})=>{const a=We(),i=s.useCallback((c,m="onChange")=>{if(!c)return o.subscribeWatch("values",()=>a()),r();if(typeof c=="string"){let C=z(c);m==="onBlur"&&(C=`blur.${C}`),o.subscribeWatch(C,(h,E)=>{h!==E&&a()})}return Array.isArray(c)&&c.forEach(C=>{let h=z(C);m==="onBlur"&&(h=`blur.${h}`),o.subscribeWatch(h,(E,l)=>{E!==l&&a()})}),r({name:c})},[]),u=s.useCallback(({name:c,compute:m,setValue:C,mode:h="onChange"})=>{if(typeof m=="function")return o.subscribe("values",()=>{const l=r({compute:m});C(l)});if(!c)return o.subscribe("values",()=>{C(r())});if(typeof c=="string"){let E=z(c);return h==="onBlur"&&(E=`blur.${E}`),o.subscribe(E,()=>{const R=r({name:c});C(R)})}if(Array.isArray(c)){const E=[];return c.forEach(l=>{let R=z(l);h==="onBlur"&&(R=`blur.${R}`);const A=o.subscribe(R,()=>{const y=r({name:c});C(y)});E.push(A)}),()=>E.forEach(l=>l())}throw new Error("Parameters of name must be string or array of string or compute must be a function")},[]),d=s.useCallback((c,m,C="onChange")=>{if(!c)return o.subscribe("values",()=>m(r()));if(["onChange","onBlur"].includes(c))return o.subscribe(c,m);if(typeof c=="string"){let h=z(c);return C==="onBlur"&&(h=`blur.${h}`),o.subscribe(h,()=>m(r({name:c})))}if(Array.isArray(c)){const h=[];return c.forEach(E=>{let l=z(E);C==="onBlur"&&(l=`blur.${l}`);const R=o.subscribe(l,()=>{m(r({name:c}))});h.push(R)}),()=>h.forEach(E=>E())}throw new Error("Parameters of name must be string or array of string")},[]);return{watch:i,registerHookWatcher:u,getWatchValue:r,subscribe:d}},Be=({getWatchValue:o})=>{const r=s.useRef(new Map),a=s.useRef(new Map),i=s.useCallback(()=>a.current,[]),u=s.useCallback(()=>r.current,[]),d=s.useCallback(()=>{r.current.clear(),a.current.clear()},[]),c=l=>l.replace("values.","").replace("values",""),m=s.useCallback((l,...R)=>{const A=l.split(".");A.forEach((y,S)=>{const D=A.slice(0,A.length-S).join("."),j=r.current.get(D),k=a.current.get(D);if(S>0){const p=R[0],O=o({name:c(D)});R=[L(O,l.replace(D,""),p)]}j&&j.forEach(p=>p(...R)),k&&k.forEach(p=>p(...R))})},[]),C=s.useCallback((l,{trickle:R=!1,bubble:A=!1})=>{const y=l.split(".");let S=[o({name:c(l)})];y.forEach((D,j)=>{const k=y.slice(0,y.length-j).join("."),p=r.current.get(k),O=a.current.get(k);if(j>0&&A){const W=S[0],V=o({name:c(k)});S=[L(V,l.replace(k,""),W)]}p&&(j===0||A)&&p.forEach(W=>W(...S)),O&&(j===0||A)&&O.forEach(W=>W(...S))}),R&&(r.current.forEach((D,j)=>{j.startsWith(l)&&D.forEach(k=>k(o({name:c(j)})))}),a.current.forEach((D,j)=>{j.startsWith(l)&&D.forEach(k=>k(o({name:c(j)})))}))},[]),h=s.useCallback((l,R)=>(r.current.has(l)||r.current.set(l,new Set),r.current.get(l).add(R),()=>{var A;return(A=r.current.get(l))==null?void 0:A.delete(R)}),[]),E=s.useCallback((l,R)=>{a.current.has(l)||(a.current.set(l,new Set),a.current.get(l).add(R))},[]);return{reset:d,publish:m,subscribe:h,subscribeWatch:E,getEvents:u,getWatchEvents:i,trigger:C}},Ie=({defaultValues:o=we,shouldUnRegister:r=!1,groups:a=[]}={})=>{const[i,u]=xe(),d=s.useRef(),c=s.useRef(new Map),m=s.useRef({}),C=s.useRef({}),h=s.useRef({...Ce}),E=s.useRef({...o}),l=s.useRef({...o}),R=s.useRef(new Set(a)),A=s.useCallback((e,n=l.current)=>Object.keys(n).reduce((b,f)=>{if(typeof n[f]=="object")return{...b,[f]:A(e,n[f])};const N={...e?{}:C.current[f]||{},...fe};return{...b,[f]:N}},{}),[]),y=s.useCallback((e={},{clearCustomFormStates:n=!1,clearCustomFieldStates:b=!1,groups:f=R.current}={})=>{l.current={...l.current,...e},E.current={...l.current},c.current.forEach((N,_)=>{N(x(l.current,_)??"")}),m.current={},R.current=new Set(f),c.current=new Map,h.current={...n?{}:h.current,...Ce},C.current=A(b),F.reset(),u()},[]),S=s.useCallback(()=>{let e=Object.fromEntries(new FormData(d.current));c.current.forEach((b,f)=>{e=L(e,f,x(E.current,f))});let n={...E.current,...e};return ve(n)},[]),D=s.useCallback(e=>Se(e.target),[]),j=s.useCallback(()=>l.current,[]),k=s.useCallback(()=>c.current,[]),p=s.useCallback((e,n)=>n?Array.isArray(n)?n.reduce((b,f)=>({...b,[f]:x(e,f)}),{}):x(e,n):{...e},[]),O=s.useCallback(e=>p(E.current,e),[p]),W=s.useCallback(e=>p(m.current,e),[p]),V=s.useCallback(e=>p(C.current,e),[p]),Z=s.useCallback(e=>p({...h.current,lastReset:i},e),[i]),H=s.useCallback(({name:e,compute:n}={})=>!e&&!n||e==="values"?O():typeof n=="function"?n(O()):Array.isArray(e)?e.reduce((b,f)=>({...b,[f]:H({name:f})}),{}):x({...E.current,errors:m.current,fieldStates:C.current,formState:Z()},e),[]),F=Be({getWatchValue:H}),{watch:oe,registerHookWatcher:te,subscribe:ce}=Me({getWatchValue:H,channels:F}),de=s.useCallback((e,n)=>{typeof n=="function"&&(n=n(Z(e)));const b=h.current,f=x(b,e);f!==n&&(h.current=L(h.current,e,n),F.publish(`formState.${e}`,n,f))},[]),K=s.useCallback((e,n)=>{typeof n=="function"&&(n=n(W(e))),M(e,"error",n)},[]),X=s.useCallback(e=>{M(e,"error",null)},[]),ae=s.useCallback(()=>{h.current.isError&&Object.keys(m.current).forEach(e=>X(e))},[]),M=s.useCallback((e,n,b)=>{try{if(typeof b=="function"&&(b=b(V(e))),R.current.has(e))if(typeof b=="object"&&b!==null){Object.keys(b).forEach(_=>{M(`${e}.${_}`,n,b[_])});return}else return console.error(`Cannot set primitive value for nested parent field "${e}". Please set value for its children or provide an object.`);const f=x(C.current,e)||{...fe},N=x(f,n);if(N!==b){if(C.current=L(C.current,`${e}.${n}`,b),F.publish(`fieldStates.${e}.${n}`,b,N),n==="error"){const _=x(m.current,e),J=b||null;_!==J&&(m.current=L(m.current,e,J),F.publish(`errors.${e}`,J,_));const Y=pe(R.current,m.current);h.current.errorFields=Y,F.publish("formState.errorFields",Y);const q=Y.length>0;if(h.current.isError!==q){const Te=h.current.isError;h.current.isError=q,F.publish("formState.isError",q,Te)}}if(n==="isDirty"){const _=ye(R.current,C.current);h.current.dirtyFields=_,F.publish("formState.dirtyFields",_);const J=_.length>0;if(h.current.isDirty!==J){const Y=h.current.isDirty;h.current.isDirty=J,F.publish("formState.isDirty",J,Y)}}if(n==="isTouched"){const _=ke(R.current,C.current);h.current.touchedFields=_,F.publish("formState.touchedFields",_)}}}catch(f){console.log(f)}},[]),ue=s.useCallback(e=>{M(e,"isDirty",!1),M(e,"isTouched",!1),M(e,"error",!1)},[]),le=s.useCallback(e=>{const n=Se(e.target);n?K(e.target.name,n):X(e.target.name)},[]),t=s.useCallback((e,n,{shouldDirty:b=!0,shouldOnChange:f=!0}={})=>{if(typeof n=="function"&&(n=n(O(e))),R.current.has(e)){typeof n=="object"&&n!==null?Object.keys(n).forEach(Y=>{t(`${e}.${Y}`,n[Y],{shouldDirty:b,shouldOnChange:f})}):console.error(`Cannot set primitive value for nested parent field "${e}". Please set value for its children or provide an object.`);return}const N=x(E.current,e);if(n===N)return;E.current=L(E.current,e,n),F.publish(`values.${e}`,n,N);const _=c.current.get(e);if(_&&_(n),e.includes(".")){const Y=e.split("."),q=Y.findIndex((Te,Le)=>!R.current.has(Y.slice(0,Le+1).join(".")));q!==-1&&(e=Y.slice(0,q+1).join("."))}n&&M(e,"isTouched",!0);const J=n!==(x(l.current,e)||"");b&&M(e,"isDirty",J),f&&F.publish("onChange",e,n,N)},[]),g=s.useCallback(e=>{const n=e.split(".");let b="";n.forEach((f,N)=>{N<n.length-1&&(b=b?`${b}.${f}`:f,R.current.add(b))})},[]),T=s.useCallback(e=>{Array.isArray(e)?e.forEach(n=>g(n+".")):g(e+".")},[]),P=s.useCallback((e="",n,{shouldUnRegister:b=r}={})=>{if(!e){console.error("Controller must have a name");return}return c.current.set(e,n),C.current=L(C.current,e,{...fe}),e.includes(".")&&g(e),()=>{b&&c.current.delete(e)}},[]),U=s.useCallback((e,{keepError:n,keepDirty:b,keepTouched:f,defaultValue:N})=>{const _=c.current.get(e);if(!_)throw new Error(`Cannot reset "${e}" because it's uncontrolled field`);l.current=L(l.current,e,N),E.current=L(E.current,e,N),_&&_(N),n||X(e),b||M(e,"isDirty",!1),f||M(e,"isTouched",!1)},[]),I=s.useCallback((e,{bubble:n,trickle:b}={})=>{if(!e)return F.trigger("values",{bubble:n,trickle:b??!0});if(!Array.isArray(e)){const f=z(e);F.trigger(f,{bubble:n,trickle:b});return}e.forEach(f=>{const N=z(f);F.trigger(N,{bubble:n,trickle:b})})},[]),Q=s.useCallback(e=>{F.publish(`blur.values.${e}`,O(e)),F.publish(`blur.errors.${e}`,W(e));const n=V(e);Object.keys(n||{}).forEach(f=>{F.publish(`blur.fieldStates.${e}.${f}`,n[f])});const b=Z();Object.keys(b||{}).forEach(f=>{F.publish(`blur.formState.${f}`,b[f])})},[]),re=s.useCallback((e,n=O(e))=>{F.publish("onBlur",e,n,O()),Q(e)},[]),w=s.useMemo(()=>({subscribe:ce,reset:y,trigger:I,reload:u,resetField:U,setValue:t,getValues:O,getErrors:W,getFieldStates:V,getFormState:Z,setError:K,clearError:X,clearErrors:ae,checkValidity:le,getFieldValidity:D,getDefaultValues:j,setFieldState:M,triggerFieldBlur:re,resetFieldState:ue,getControlledFields:k,setFormState:de,getEvents:F.getEvents,getWatchEvents:F.getWatchEvents,addGroups:T}),[i]),G=s.useCallback(()=>{[...d.current.querySelectorAll("[name]")].forEach(b=>{const f=b.name||"";f.includes(".")&&g(f),!b.defaultValue&&!c.current.has(f)&&x(l.current,f)&&(b.defaultValue=x(l.current,f))});const n=S();E.current={...n},l.current={...n}},[]),se=s.useMemo(()=>({ref:d,watch:oe,actions:w,initForm:G,registerController:P,registerHookWatcher:te,lastReloadedAt:i,loadFormValues:S,getWatchValue:H,triggerBlurWatchers:Q,channels:F}),[i]),be=s.useMemo(()=>({control:se,actions:w,watch:oe}),[i]);return s.useLayoutEffect(()=>{d.current&&G()},[i]),s.useLayoutEffect(()=>{C.current=A(!1)},[]),be},Ye=({control:o,name:r,compute:a,mode:i})=>{const{getWatchValue:u,registerHookWatcher:d}=o||ie(),c=u({name:r,compute:a}),[m,C]=s.useState(c);return s.useEffect(()=>d({name:r,compute:a,value:m,setValue:C,mode:i}),[]),m};B.Controller=De,B.Form=je,B.restoreFromDotNotation=ve,B.useController=Fe,B.useForm=Ie,B.useFormContext=ie,B.useWatch=Ye,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|
|
22
|
+
<%s key={someKey} {...props} />`,j,O,U,O),ue[O+j]=!0)}if(O=null,F!==void 0&&(a(F),O=""+F),c(g)&&(a(g.key),O=""+g.key),"key"in g){F={};for(var te in g)te!=="key"&&(F[te]=g[te])}else F=g;return O&&h(F,typeof r=="function"?r.displayName||r.name||"Unknown":r),C(r,O,Y,V,u(),F,Q,re)}function l(r){typeof r=="object"&&r!==null&&r.$$typeof===_&&r._store&&(r._store.validated=1)}var R=s,_=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),A=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),ee=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,de=Array.isArray,K=console.createTask?console.createTask:function(){return null};R={"react-stack-bottom-frame":function(r){return r()}};var X,ce={},B=R["react-stack-bottom-frame"].bind(R,f)(),ae=K(i(f)),ue={};$.Fragment=S,$.jsx=function(r,g,F,j,V){var Y=1e4>ee.recentlyCreatedOwnerStacks++;return m(r,g,F,!1,j,V,Y?Error("react-stack-top-frame"):B,Y?K(i(r)):ae)},$.jsxs=function(r,g,F,j,V){var Y=1e4>ee.recentlyCreatedOwnerStacks++;return m(r,g,F,!0,j,V,Y?Error("react-stack-top-frame"):B,Y?K(i(r)):ae)}}()),$}var me;function je(){return me||(me=1,process.env.NODE_ENV==="production"?se.exports=_e():se.exports=Oe()),se.exports}var Re=je();const v=()=>{},Ce=s.createContext({ref:null,watch:v,actions:{subscribe:v,reset:v,trigger:v,reload:v,resetField:v,setValue:v,getValues:v,getErrors:v,getFieldStates:v,getFormState:v,setError:v,clearError:v,clearErrors:v,checkValidity:v,getFieldValidity:v,getDefaultValues:v,setFieldState:v,triggerFieldBlur:v,resetFieldState:v,getControlledFields:v,setFormState:v,getEvents:v,getWatchEvents:v,addGroups:v},registerController:v,registerHookWatcher:v,lastReloadedAt:v,loadFormValues:v,getWatchValue:v,channels:{}}),ie=()=>s.useContext(Ce),we=({id:o,control:t,method:a,action:i,children:u,onChange:f,onBlur:c,onSubmit:h=()=>{},onInput:E=()=>{},onReset:C=()=>{},numberFields:m=[],className:l,...R})=>{const _=s.useCallback(k=>{t.ref&&(t.ref.current=k,t.ref.current&&t.initForm())},[t]);return s.useEffect(()=>{let k=()=>{},S=()=>{};return f&&(k=t.channels.subscribe("onChange",f)),c&&(S=t.channels.subscribe("onBlur",c)),()=>{k(),S()}},[t.lastReloadedAt]),Re.jsx(Ce.Provider,{value:t,children:Re.jsx("form",{id:o,ref:_,action:i,method:a,className:l,onInput:E,onSubmit:k=>{a||k.preventDefault();const S=t.loadFormValues();h(S)},onChange:k=>{const S=k.target.name;!S||t.actions.getControlledFields().has(S)||t.actions.setValue(S,k.target.value)},onBlur:k=>{const S=k.target.name;if(!S||t.actions.getControlledFields().has(S))return;const w=k.target.value;t.channels.publish("onBlur",S,w,t.actions.getValues()),t.triggerBlurWatchers(S)},onReset:k=>{t.actions.reset(),C(k)},...R,children:u},t.lastReloadedAt)})},fe={isDirty:!1,isTouched:!1,error:null},ve={lastReset:null,isDirty:!1,isError:!1,errorFields:[],dirtyFields:[],touchedFields:[]},Pe={},Ne=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"],D=(o={},t="")=>t.split(".").reduce((a,i)=>a&&a[i]!==void 0?a[i]:void 0,o),L=(o={},t="",a)=>{const i=Array.isArray(o)?[...o]:{...o};let u=i;const f=t.split(".");return f.forEach((c,h)=>{h<f.length-1?(u[c]||(u[c]=/^\d+$/.test(f[h+1])?[]:{}),Array.isArray(u[c])?u[c]=[...u[c]]:u[c]={...u[c]},u=u[c]):u[c]=a}),i},Se=o=>{let t=Array.isArray(o)?[...o]:{...o};return Object.keys(t).forEach(a=>{if(a.includes(".")){const i=D(t,a);t=L(t,a,i||""),delete t[a]}}),t},De=["errors","fieldStates","formState"],G=o=>De.some(t=>o.startsWith(t))?o:"values."+o,ye=o=>{typeof o.setCustomValidity=="function"&&o.setCustomValidity("");let t=o.validity,a=Ne.find(i=>t[i]);if(a)return{type:a,message:o.validationMessage}},ke=(o=new Set,t={},a="")=>Object.keys(t||{}).reduce((i,u)=>{const f=(t||{})[u];return o.has(a+u)?[...i,...ke(o,f,a+u+".")]:f!=null&&f.isDirty?[...i,a+u]:i},[]),pe=(o=new Set,t={},a="")=>Object.keys(t||{}).reduce((i,u)=>{const f=(t||{})[u];return o.has(a+u)?[...i,...pe(o,f,a+u+".")]:f!=null&&f.isTouched?[...i,a+u]:i},[]),Fe=(o=new Set,t={},a="")=>Object.keys(t||{}).reduce((i,u)=>{const f=(t||{})[u];return o.has(a+u)?[...i,...Fe(o,f,a+u+".")]:f?[...i,a+u]:i},[]),Te=({control:o,name:t,compute:a,mode:i})=>{const{getWatchValue:u,registerHookWatcher:f}=o||ie(),c=u({name:t,compute:a}),[h,E]=s.useState(c);return s.useEffect(()=>f({name:t,compute:a,value:h,setValue:E,mode:i}),[]),h},Ae=({control:o,name:t,defaultValue:a,shouldUnRegister:i})=>{const{actions:u,registerController:f,channels:c,getWatchValue:h,triggerBlurWatchers:E}=o||ie(),C=s.useRef(),m=s.useRef(),l=D(u.getDefaultValues(),t)||a||"",R=Te({name:t})??l,[_,k]=s.useState({}),S=s.useCallback((y,{shouldDirty:T=!0,shouldOnChange:A=!0}={})=>{var W;let P=y;((W=y==null?void 0:y.target)==null?void 0:W.value)!==void 0&&(P=y.target.value),u.setValue(t,P,{shouldDirty:T,shouldOnChange:A})},[u.setValue]),w=s.useCallback(y=>{const T=u.getValues(),A=y??D(T,t);c.publish("onBlur",t,A,T),E(t)},[]);return s.useEffect(()=>{const y=f(t,{shouldUnRegister:i});return()=>{y&&y(),m.current&&m.current()}},[i,t]),new Proxy({ref:C,name:t,defaultValue:l,value:R,onChange:S,onBlur:w,fieldState:_},{get(y,T,A){return typeof T=="string"&&T==="fieldState"&&(m.current&&m.current(),m.current=u.subscribe(`fieldStates.${t}`,()=>{k(h({name:`fieldStates.${t}`}))})),Reflect.get(y,T,A)}})},xe=({name:o,control:t,shouldUnRegister:a,defaultValue:i,render:u=({ref:f,name:c,defaultValue:h,value:E,onChange:C,onBlur:m,fieldState:l})=>null})=>{const f=Ae({name:o,defaultValue:i,shouldUnRegister:a,control:t});return u(f)},We=()=>{const[o,t]=s.useState(),a=s.useCallback(()=>t(new Date().toString()),[]);return[o,a]},Be=()=>{const[,o]=s.useState({});return s.useCallback(()=>o({}),[])},Ie=({channels:o,getWatchValue:t})=>{const a=Be(),i=s.useCallback((c,h="onChange")=>{if(!c)return o.subscribeWatch("values",()=>a()),t();if(typeof c=="string"){let E=G(c);h==="onBlur"&&(E=`blur.${E}`),o.subscribeWatch(E,(C,m)=>{C!==m&&a()})}return Array.isArray(c)&&c.forEach(E=>{let C=G(E);h==="onBlur"&&(C=`blur.${C}`),o.subscribeWatch(C,(m,l)=>{m!==l&&a()})}),t({name:c})},[]),u=s.useCallback(({name:c,compute:h,setValue:E,mode:C="onChange"})=>{if(typeof h=="function")return o.subscribe("values",()=>{const l=t({compute:h});E(l)});if(!c)return o.subscribe("values",()=>{E(t())});if(typeof c=="string"){let m=G(c);return C==="onBlur"&&(m=`blur.${m}`),o.subscribe(m,()=>{const R=t({name:c});E(R)})}if(Array.isArray(c)){const m=[];return c.forEach(l=>{let R=G(l);C==="onBlur"&&(R=`blur.${R}`);const _=o.subscribe(R,()=>{const k=t({name:c});E(k)});m.push(_)}),()=>m.forEach(l=>l())}throw new Error("Parameters of name must be string or array of string or compute must be a function")},[]),f=s.useCallback((c,h,E="onChange")=>{if(!c)return o.subscribe("values",()=>h(t()));if(["onChange","onBlur"].includes(c))return o.subscribe(c,h);if(typeof c=="string"){let C=G(c);return E==="onBlur"&&(C=`blur.${C}`),o.subscribe(C,()=>h(t({name:c})))}if(Array.isArray(c)){const C=[];return c.forEach(m=>{let l=G(m);E==="onBlur"&&(l=`blur.${l}`);const R=o.subscribe(l,()=>{h(t({name:c}))});C.push(R)}),()=>C.forEach(m=>m())}throw new Error("Parameters of name must be string or array of string")},[]);return{watch:i,registerHookWatcher:u,getWatchValue:t,subscribe:f}},Me=({getWatchValue:o})=>{const t=s.useRef(new Map),a=s.useRef(new Map),i=s.useCallback(()=>a.current,[]),u=s.useCallback(()=>t.current,[]),f=s.useCallback(()=>{t.current.clear(),a.current.clear()},[]),c=l=>l.replace("values.","").replace("values",""),h=s.useCallback((l,...R)=>{const _=l.split(".");_.forEach((k,S)=>{const w=_.slice(0,_.length-S).join("."),y=t.current.get(w),T=a.current.get(w);if(S>0){const A=R[0],P=o({name:c(w)});R=[L(P,l.replace(w,""),A)]}y&&y.forEach(A=>A(...R)),T&&T.forEach(A=>A(...R))})},[]),E=s.useCallback((l,{trickle:R=!1,bubble:_=!1})=>{const k=l.split(".");let S=[o({name:c(l)})];k.forEach((w,y)=>{const T=k.slice(0,k.length-y).join("."),A=t.current.get(T),P=a.current.get(T);if(y>0&&_){const W=S[0],z=o({name:c(T)});S=[L(z,l.replace(T,""),W)]}A&&(y===0||_)&&A.forEach(W=>W(...S)),P&&(y===0||_)&&P.forEach(W=>W(...S))}),R&&(t.current.forEach((w,y)=>{y.startsWith(l)&&w.forEach(T=>T(o({name:c(y)})))}),a.current.forEach((w,y)=>{y.startsWith(l)&&w.forEach(T=>T(o({name:c(y)})))}))},[]),C=s.useCallback((l,R)=>(t.current.has(l)||t.current.set(l,new Set),t.current.get(l).add(R),()=>{var _;return(_=t.current.get(l))==null?void 0:_.delete(R)}),[]),m=s.useCallback((l,R)=>{a.current.has(l)||(a.current.set(l,new Set),a.current.get(l).add(R))},[]);return{reset:f,publish:h,subscribe:C,subscribeWatch:m,getEvents:u,getWatchEvents:i,trigger:E}},Ye=({defaultValues:o=Pe,shouldUnRegister:t=!1,groups:a=[]}={})=>{const[i,u]=We(),f=s.useRef(),c=s.useRef({}),h=s.useRef({}),E=s.useRef({...ve}),C=s.useRef({...o}),m=s.useRef({...o}),l=s.useRef(new Set),R=s.useRef(new Set(a)),_=s.useCallback((e,n=m.current)=>Object.keys(n).reduce((d,b)=>{if(typeof n[b]=="object")return{...d,[b]:_(e,n[b])};const N={...e?{}:h.current[b]||{},...fe};return{...d,[b]:N}},{}),[]),k=s.useCallback((e={},{clearCustomFormStates:n=!1,clearCustomFieldStates:d=!1,groups:b=R.current}={})=>{c.current={},m.current={...m.current,...e},C.current={...m.current},l.current=new Set,R.current=new Set(b),E.current={...n?{}:E.current,...ve},h.current=_(d),p.reset(),u()},[]),S=s.useCallback(()=>{let e=Object.fromEntries(new FormData(f.current));l.current.forEach(d=>{e=L(e,d,D(C.current,d))});let n={...C.current,...e};return Se(n)},[]),w=s.useCallback(e=>ye(e.target),[]),y=s.useCallback(()=>m.current,[]),T=s.useCallback(()=>l.current,[]),A=s.useCallback((e,n)=>n?Array.isArray(n)?n.reduce((d,b)=>({...d,[b]:D(e,b)}),{}):D(e,n):{...e},[]),P=s.useCallback(e=>A(C.current,e),[A]),W=s.useCallback(e=>A(c.current,e),[A]),z=s.useCallback(e=>A(h.current,e),[A]),Z=s.useCallback(e=>A({...E.current,lastReset:i},e),[i]),H=s.useCallback(({name:e,compute:n}={})=>!e&&!n||e==="values"?P():typeof n=="function"?n(P()):Array.isArray(e)?e.reduce((d,b)=>({...d,[b]:H({name:b})}),{}):D({...C.current,errors:c.current,fieldStates:h.current,formState:Z()},e),[]),p=Me({getWatchValue:H}),{watch:ne,registerHookWatcher:ee,subscribe:oe}=Ie({getWatchValue:H,channels:p}),de=s.useCallback((e,n)=>{typeof n=="function"&&(n=n(Z(e)));const d=E.current,b=D(d,e);b!==n&&(E.current=L(E.current,e,n),p.publish(`formState.${e}`,n,b))},[]),K=s.useCallback((e,n)=>{typeof n=="function"&&(n=n(W(e))),B(e,"error",n)},[]),X=s.useCallback(e=>{B(e,"error",null)},[]),ce=s.useCallback(()=>{E.current.isError&&Object.keys(c.current).forEach(e=>X(e))},[]),B=s.useCallback((e,n,d)=>{try{if(typeof d=="function"&&(d=d(z(e))),R.current.has(e))if(typeof d=="object"&&d!==null){Object.keys(d).forEach(x=>{B(`${e}.${x}`,n,d[x])});return}else return console.error(`Cannot set primitive value for nested parent field "${e}". Please set value for its children or provide an object.`);const b=D(h.current,e)||{...fe},N=D(b,n);if(N!==d){if(h.current=L(h.current,`${e}.${n}`,d),p.publish(`fieldStates.${e}.${n}`,d,N),n==="error"){const x=D(c.current,e),I=d||null;x!==I&&(c.current=L(c.current,e,I),p.publish(`errors.${e}`,I,x));const J=Fe(R.current,c.current);E.current.errorFields=J,p.publish("formState.errorFields",J);const le=J.length>0;if(E.current.isError!==le){const ge=E.current.isError;E.current.isError=le,p.publish("formState.isError",le,ge)}}if(n==="isDirty"){const x=ke(R.current,h.current);E.current.dirtyFields=x,p.publish("formState.dirtyFields",x);const I=x.length>0;if(E.current.isDirty!==I){const J=E.current.isDirty;E.current.isDirty=I,p.publish("formState.isDirty",I,J)}}if(n==="isTouched"){const x=pe(R.current,h.current);E.current.touchedFields=x,p.publish("formState.touchedFields",x)}}}catch(b){console.log(b)}},[]),ae=s.useCallback(e=>{B(e,"isDirty",!1),B(e,"isTouched",!1),B(e,"error",!1)},[]),ue=s.useCallback(e=>{const n=ye(e.target);n?K(e.target.name,n):X(e.target.name)},[]),r=s.useCallback((e,n,{shouldDirty:d=!0,shouldOnChange:b=!0}={})=>{if(typeof n=="function"&&(n=n(P(e))),R.current.has(e)){typeof n=="object"&&n!==null?Object.keys(n).forEach(I=>{r(`${e}.${I}`,n[I],{shouldDirty:d,shouldOnChange:b})}):console.error(`Cannot set primitive value for nested parent field "${e}". Please set value for its children or provide an object.`);return}const N=D(C.current,e);if(n===N)return;if(C.current=L(C.current,e,n),p.publish(`values.${e}`,n,N),e.includes(".")){const I=e.split("."),J=I.findIndex((le,ge)=>!R.current.has(I.slice(0,ge+1).join(".")));J!==-1&&(e=I.slice(0,J+1).join("."))}n&&B(e,"isTouched",!0);const x=n!==(D(m.current,e)||"");d&&B(e,"isDirty",x),b&&p.publish("onChange",e,n,N)},[]),g=s.useCallback(e=>{const n=e.split(".");let d="";n.forEach((b,N)=>{N<n.length-1&&(d=d?`${d}.${b}`:b,R.current.add(d))})},[]),F=s.useCallback(e=>{Array.isArray(e)?e.forEach(n=>g(n+".")):g(e+".")},[]),j=s.useCallback((e="",{shouldUnRegister:n=t}={})=>e?(l.current.add(e),h.current=L(h.current,e,{...fe}),e.includes(".")&&g(e),()=>{n&&l.current.delete(e)}):console.error("Controller must have a name"),[]),V=s.useCallback((e,{keepError:n,keepDirty:d,keepTouched:b,defaultValue:N})=>{if(!l.current.has(e))throw new Error(`Cannot reset "${e}" because it's uncontrolled field`);m.current=L(m.current,e,N),C.current=L(C.current,e,N),p.publish(`values.${e}`,N),n||X(e),d||B(e,"isDirty",!1),b||B(e,"isTouched",!1)},[]),Y=s.useCallback((e,{bubble:n,trickle:d}={})=>{if(!e)return p.trigger("values",{bubble:n,trickle:d??!0});if(!Array.isArray(e)){const b=G(e);p.trigger(b,{bubble:n,trickle:d});return}e.forEach(b=>{const N=G(b);p.trigger(N,{bubble:n,trickle:d})})},[]),Q=s.useCallback(e=>{p.publish(`blur.values.${e}`,P(e)),p.publish(`blur.errors.${e}`,W(e));const n=z(e);Object.keys(n||{}).forEach(b=>{p.publish(`blur.fieldStates.${e}.${b}`,n[b])});const d=Z();Object.keys(d||{}).forEach(b=>{p.publish(`blur.formState.${b}`,d[b])})},[]),re=s.useCallback((e,n=P(e))=>{p.publish("onBlur",e,n,P()),Q(e)},[]),O=s.useMemo(()=>({subscribe:oe,reset:k,trigger:Y,reload:u,resetField:V,setValue:r,getValues:P,getErrors:W,getFieldStates:z,getFormState:Z,setError:K,clearError:X,clearErrors:ce,checkValidity:ue,getFieldValidity:w,getDefaultValues:y,setFieldState:B,triggerFieldBlur:re,resetFieldState:ae,getControlledFields:T,setFormState:de,getEvents:p.getEvents,getWatchEvents:p.getWatchEvents,addGroups:F}),[i]),U=s.useCallback(()=>{[...f.current.querySelectorAll("[name]")].forEach(d=>{const b=d.name||"";b.includes(".")&&g(b),!d.defaultValue&&!l.current.has(b)&&D(m.current,b)&&(d.defaultValue=D(m.current,b))});const n=S();C.current={...n},m.current={...n}},[]),te=s.useMemo(()=>({ref:f,watch:ne,actions:O,initForm:U,registerController:j,registerHookWatcher:ee,lastReloadedAt:i,loadFormValues:S,getWatchValue:H,triggerBlurWatchers:Q,channels:p}),[i]),be=s.useMemo(()=>({control:te,actions:O,watch:ne}),[i]);return s.useLayoutEffect(()=>{f.current&&U()},[i]),s.useLayoutEffect(()=>{h.current=_(!1)},[]),be};M.Controller=xe,M.Form=we,M.restoreFromDotNotation=Se,M.useController=Ae,M.useForm=Ye,M.useFormContext=ie,M.useWatch=Te,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-simple-formkit",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.6",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react formkit",
|
|
6
6
|
"react ez formkit",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"dayjs": "^1.11.13",
|
|
36
36
|
"react": "^19.1.0",
|
|
37
37
|
"react-dom": "^19.1.0",
|
|
38
|
+
"react-hook-form": "^7.76.1",
|
|
38
39
|
"react-simple-formkit": "^2.4.3",
|
|
39
40
|
"vite": "^6.0.7",
|
|
40
41
|
"zod": "^4.4.3"
|